From e226046cb8843580086117bafc060898cdcbee2f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 1 May 2019 08:47:10 +0000 Subject: [PATCH] Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan # ignore-this-changeset Depends on D28954 Differential Revision: https://phabricator.services.mozilla.com/D28956 --HG-- extra : moz-landing-system : lando --- accessible/atk/UtilInterface.cpp | 58 +- accessible/atk/nsMaiHyperlink.cpp | 72 +- accessible/base/nsCoreUtils.cpp | 118 +- accessible/base/nsCoreUtils.h | 88 +- accessible/base/nsTextEquivUtils.h | 46 +- .../interfaces/msaa/AccessibleMarshalThunk.c | 4 +- .../ipc/win/handler/HandlerTextLeaf.cpp | 98 +- accessible/ipc/win/handler/HandlerTextLeaf.h | 96 +- accessible/windows/ia2/ia2AccessibleAction.h | 24 +- .../windows/ia2/ia2AccessibleComponent.h | 10 +- .../windows/ia2/ia2AccessibleEditableText.h | 6 +- .../windows/ia2/ia2AccessibleHyperlink.h | 12 +- accessible/windows/ia2/ia2AccessibleImage.h | 12 +- .../windows/ia2/ia2AccessibleRelation.cpp | 22 +- .../windows/ia2/ia2AccessibleRelation.h | 26 +- accessible/windows/ia2/ia2AccessibleTable.h | 90 +- .../windows/ia2/ia2AccessibleTableCell.h | 36 +- accessible/windows/ia2/ia2AccessibleText.h | 90 +- accessible/windows/ia2/ia2AccessibleValue.h | 8 +- accessible/windows/msaa/AccessibleWrap.h | 112 +- .../windows/msaa/ApplicationAccessibleWrap.h | 10 +- accessible/windows/msaa/LazyInstantiator.cpp | 93 +- accessible/windows/msaa/LazyInstantiator.h | 62 +- accessible/windows/sdn/sdnDocAccessible.h | 14 +- accessible/xpcom/nsAccessibleRelation.cpp | 18 +- browser/components/about/AboutRedirector.h | 2 +- .../dirprovider/DirectoryProvider.cpp | 18 +- .../dirprovider/DirectoryProvider.h | 6 +- .../components/shell/nsGNOMEShellService.cpp | 62 +- build/macosx/permissions/chown_revert.c | 4 +- build/macosx/permissions/chown_root.c | 4 +- build/unix/elfhack/elf.cpp | 154 +-- build/unix/elfhack/elfhack.cpp | 234 ++-- build/unix/elfhack/elfxx.h | 228 ++-- build/unix/elfhack/inject.c | 30 +- build/unix/elfhack/test.c | 4 +- caps/NullPrincipalURI.h | 40 +- caps/tests/gtest/TestOriginAttributes.cpp | 4 +- chrome/nsChromeProtocolHandler.cpp | 22 +- chrome/nsChromeProtocolHandler.h | 4 +- config/nsinstall.c | 28 +- config/pathsub.c | 36 +- config/pathsub.h | 20 +- devtools/platform/nsJSInspector.cpp | 6 +- dom/base/Link.cpp | 76 +- dom/base/Link.h | 70 +- dom/base/NodeIterator.cpp | 40 +- dom/base/NodeIterator.h | 36 +- dom/base/NodeUbiReporting.h | 32 +- dom/base/nsContentPolicy.cpp | 22 +- dom/base/nsContentPolicy.h | 8 +- dom/base/nsContentPolicyUtils.h | 20 +- dom/base/nsDOMJSUtils.h | 4 +- dom/base/nsDataDocumentContentPolicy.cpp | 22 +- dom/base/nsGlobalWindowCommands.cpp | 372 +++--- dom/base/nsIScriptGlobalObject.h | 14 +- dom/base/nsJSEnvironment.h | 46 +- dom/base/nsNoDataProtocolContentPolicy.cpp | 16 +- dom/base/nsSyncLoadService.cpp | 50 +- dom/base/nsTextFragmentSSE2.cpp | 6 +- .../test/gtest/TestPlainTextSerializer.cpp | 2 +- dom/canvas/MurmurHash3.cpp | 46 +- dom/clients/manager/ClientOpenWindowUtils.h | 2 +- dom/file/uri/FontTableURIProtocolHandler.cpp | 24 +- dom/html/nsHTMLDNSPrefetch.cpp | 96 +- dom/html/nsHTMLDNSPrefetch.h | 46 +- dom/html/nsIHTMLDocument.h | 2 +- dom/ipc/RemoteWebProgress.cpp | 22 +- dom/ipc/RemoteWebProgress.h | 2 +- dom/ipc/RemoteWebProgressRequest.cpp | 70 +- dom/media/AudioCompactor.cpp | 2 +- dom/media/gtest/TestAudioCompactor.cpp | 14 +- dom/media/platforms/ffmpeg/FFmpegRDFTTypes.h | 6 +- dom/media/platforms/wmf/WMF.h | 22 +- dom/media/systemservices/OpenSLESProvider.cpp | 36 +- dom/media/systemservices/OpenSLESProvider.h | 30 +- .../video_engine/platform_uithread.cc | 4 +- dom/media/webaudio/blink/ZeroPole.cpp | 2 +- dom/media/webaudio/blink/ZeroPole.h | 2 +- dom/plugins/base/npruntime.h | 100 +- dom/plugins/base/nsJSNPRuntime.cpp | 498 +++---- dom/plugins/base/nsJSNPRuntime.h | 72 +- dom/plugins/base/nsNPAPIPlugin.cpp | 382 +++--- dom/plugins/base/nsNPAPIPlugin.h | 142 +- .../base/nsPluginDirServiceProvider.cpp | 10 +- dom/plugins/base/nsPluginDirServiceProvider.h | 4 +- dom/plugins/base/nsPluginNativeWindow.h | 14 +- dom/plugins/base/nsPluginNativeWindowWin.cpp | 51 +- dom/plugins/base/nsPluginsDirUtils.h | 22 +- dom/plugins/ipc/PluginUtilsOSX.mm | 58 +- .../testplugin/flashplugin/nptest_name.cpp | 6 +- dom/plugins/test/testplugin/nptest_name.cpp | 6 +- .../testplugin/secondplugin/nptest_name.cpp | 6 +- .../testplugin/thirdplugin/nptest_name.cpp | 6 +- dom/power/PowerManagerService.cpp | 24 +- dom/security/nsCSPService.cpp | 18 +- dom/svg/SVGAnimatedInteger.cpp | 20 +- dom/svg/SVGAnimatedLengthList.cpp | 30 +- dom/svg/SVGAnimatedNumberList.cpp | 30 +- dom/svg/SVGAnimatedPathSegList.cpp | 34 +- dom/svg/SVGAnimatedPointList.cpp | 34 +- dom/svg/SVGFragmentIdentifier.h | 8 +- dom/svg/SVGLength.h | 14 +- dom/svg/SVGPolygonElement.cpp | 16 +- dom/svg/SVGTitleElement.h | 18 +- dom/system/OSFileConstants.cpp | 40 +- dom/webbrowserpersist/nsWebBrowserPersist.cpp | 258 ++-- dom/webbrowserpersist/nsWebBrowserPersist.h | 88 +- editor/libeditor/HTMLEditorController.cpp | 14 +- editor/txmgr/tests/TestTXMgr.cpp | 32 +- extensions/auth/gssapi.h | 216 ++- extensions/auth/nsAuthGSSAPI.cpp | 56 +- extensions/auth/nsAuthSASL.cpp | 28 +- extensions/auth/nsAuthSSPI.cpp | 56 +- extensions/auth/nsAuthSSPI.h | 4 +- extensions/auth/nsHttpNegotiateAuth.cpp | 74 +- extensions/auth/nsHttpNegotiateAuth.h | 4 +- extensions/permissions/nsContentBlocker.cpp | 30 +- extensions/permissions/nsContentBlocker.h | 8 +- .../pref/autoconfig/src/nsAutoConfig.cpp | 24 +- extensions/pref/autoconfig/src/nsAutoConfig.h | 8 +- .../autoconfig/src/nsJSConfigTriggers.cpp | 16 +- .../pref/autoconfig/src/nsJSConfigTriggers.h | 8 +- .../pref/autoconfig/src/nsReadConfig.cpp | 10 +- extensions/pref/autoconfig/src/nsReadConfig.h | 2 +- .../glue/RemoteSpellCheckEngineChild.h | 6 +- .../spellcheck/src/mozEnglishWordUtils.cpp | 12 +- extensions/spellcheck/src/mozSpellChecker.cpp | 58 +- gfx/2d/2D.h | 462 +++---- gfx/2d/AutoHelpersWin.h | 2 +- gfx/2d/BlurLS3.cpp | 98 +- gfx/2d/BlurNEON.cpp | 56 +- gfx/2d/BlurSSE2.cpp | 121 +- gfx/2d/BorrowedContext.h | 48 +- gfx/2d/BufferEdgePad.cpp | 16 +- gfx/2d/DataSourceSurfaceWrapper.h | 8 +- gfx/2d/DrawEventRecorder.cpp | 18 +- gfx/2d/DrawTargetCairo.h | 166 +-- gfx/2d/DrawTargetCapture.h | 120 +- gfx/2d/DrawTargetD2D1.cpp | 254 ++-- gfx/2d/DrawTargetD2D1.h | 152 +-- gfx/2d/DrawTargetDual.cpp | 100 +- gfx/2d/DrawTargetDual.h | 94 +- gfx/2d/DrawTargetOffset.h | 100 +- gfx/2d/DrawTargetRecording.cpp | 213 ++- gfx/2d/DrawTargetRecording.h | 122 +- gfx/2d/DrawTargetSkia.h | 148 +-- gfx/2d/DrawTargetTiled.h | 106 +- gfx/2d/DrawTargetWrapAndRecord.cpp | 237 ++-- gfx/2d/DrawTargetWrapAndRecord.h | 104 +- gfx/2d/FilterNodeCapture.h | 30 +- gfx/2d/FilterNodeD2D1.cpp | 66 +- gfx/2d/FilterNodeD2D1.h | 68 +- gfx/2d/FilterNodeSoftware.cpp | 502 +++---- gfx/2d/FilterNodeSoftware.h | 322 ++--- gfx/2d/Filters.h | 30 +- gfx/2d/GradientStopsD2D.h | 4 +- gfx/2d/Helpers.h | 10 +- gfx/2d/HelpersD2D.h | 166 +-- gfx/2d/ImageScaling.cpp | 62 +- gfx/2d/ImageScaling.h | 48 +- gfx/2d/ImageScalingSSE2.cpp | 122 +- gfx/2d/InlineTranslator.cpp | 16 +- gfx/2d/LuminanceNEON.cpp | 10 +- gfx/2d/LuminanceNEON.h | 6 +- gfx/2d/NativeFontResourceDWrite.h | 8 +- gfx/2d/Path.cpp | 42 +- gfx/2d/PathAnalysis.h | 14 +- gfx/2d/PathCairo.cpp | 50 +- gfx/2d/PathCairo.h | 48 +- gfx/2d/PathCapture.cpp | 48 +- gfx/2d/PathCapture.h | 38 +- gfx/2d/PathD2D.cpp | 48 +- gfx/2d/PathD2D.h | 44 +- gfx/2d/PathRecording.cpp | 14 +- gfx/2d/PathRecording.h | 40 +- gfx/2d/PathSkia.cpp | 40 +- gfx/2d/PathSkia.h | 40 +- gfx/2d/PatternHelpers.h | 42 +- gfx/2d/QuartzSupport.h | 20 +- gfx/2d/RecordedEvent.cpp | 18 +- gfx/2d/RecordedEvent.h | 114 +- gfx/2d/RecordedEventImpl.h | 1128 ++++++++-------- gfx/2d/RecordingTypes.h | 12 +- gfx/2d/SFNTNameTable.cpp | 63 +- gfx/2d/SFNTNameTable.h | 26 +- gfx/2d/SSEHelpers.h | 6 +- gfx/2d/SVGTurbulenceRenderer-inl.h | 52 +- gfx/2d/ScaledFontBase.cpp | 46 +- gfx/2d/SourceSurfaceD2D1.cpp | 20 +- gfx/2d/SourceSurfaceD2D1.h | 16 +- gfx/2d/SourceSurfaceDual.h | 6 +- gfx/2d/Tools.h | 28 +- gfx/2d/UserData.h | 22 +- gfx/2d/ssse3-scaler.c | 80 +- gfx/2d/ssse3-scaler.h | 4 +- gfx/2d/unittest/Main.cpp | 2 +- gfx/2d/unittest/TestBase.cpp | 4 +- gfx/2d/unittest/TestBase.h | 8 +- gfx/2d/unittest/TestCairo.cpp | 8 +- gfx/2d/unittest/TestDrawTargetBase.cpp | 12 +- gfx/2d/unittest/TestDrawTargetBase.h | 8 +- gfx/2d/unittest/TestScaling.cpp | 26 +- gfx/ipc/SharedDIB.cpp | 2 +- gfx/ipc/SharedDIB.h | 4 +- gfx/ipc/SharedDIBWin.cpp | 11 +- gfx/layers/AxisPhysicsMSDModel.cpp | 2 +- gfx/layers/AxisPhysicsMSDModel.h | 2 +- gfx/layers/AxisPhysicsModel.cpp | 4 +- gfx/layers/AxisPhysicsModel.h | 8 +- gfx/layers/RenderTrace.cpp | 16 +- gfx/layers/RenderTrace.h | 30 +- gfx/layers/apz/test/gtest/TestPinching.cpp | 2 +- gfx/layers/client/TextureClientPool.h | 10 +- gfx/layers/d3d11/ReadbackManagerD3D11.cpp | 16 +- .../opengl/GLBlitTextureImageHelper.cpp | 40 +- gfx/layers/opengl/OGLShaderProgram.cpp | 42 +- gfx/src/X11Util.h | 24 +- gfx/src/gfxCrashReporterUtils.h | 6 +- gfx/src/nsThebesFontEnumerator.cpp | 42 +- gfx/src/nsTransform2D.cpp | 6 +- gfx/src/nsTransform2D.h | 8 +- gfx/tests/gtest/TestRegion.cpp | 18 +- gfx/tests/gtest/gfxSurfaceRefCountTest.cpp | 14 +- gfx/thebes/cairo-xlib-utils.h | 12 +- gfx/thebes/d3dkmtQueryStatistics.h | 2 +- gfx/thebes/gfx2DGlue.h | 24 +- gfx/thebes/gfxASurface.cpp | 56 +- gfx/thebes/gfxASurface.h | 38 +- gfx/thebes/gfxAlphaRecovery.h | 12 +- gfx/thebes/gfxCoreTextShaper.cpp | 57 +- gfx/thebes/gfxCoreTextShaper.h | 10 +- gfx/thebes/gfxDWriteFonts.h | 32 +- gfx/thebes/gfxFT2Fonts.cpp | 24 +- gfx/thebes/gfxFT2Fonts.h | 28 +- gfx/thebes/gfxFailure.h | 2 +- gfx/thebes/gfxFontInfoLoader.cpp | 18 +- gfx/thebes/gfxGDIFont.cpp | 36 +- gfx/thebes/gfxGDIFont.h | 30 +- gfx/thebes/gfxGlyphExtents.cpp | 22 +- gfx/thebes/gfxGraphiteShaper.cpp | 52 +- gfx/thebes/gfxGraphiteShaper.h | 24 +- gfx/thebes/gfxHarfBuzzShaper.cpp | 330 +++-- gfx/thebes/gfxHarfBuzzShaper.h | 58 +- gfx/thebes/gfxMacFont.cpp | 50 +- gfx/thebes/gfxMacFont.h | 28 +- gfx/thebes/gfxMathTable.cpp | 2 +- gfx/thebes/gfxMathTable.h | 4 +- gfx/thebes/gfxPattern.h | 22 +- gfx/thebes/gfxQuartzSurface.cpp | 24 +- gfx/thebes/gfxSVGGlyphs.cpp | 64 +- gfx/thebes/gfxSVGGlyphs.h | 54 +- gfx/thebes/gfxWindowsSurface.cpp | 18 +- gfx/thebes/gfxXlibNativeRenderer.cpp | 88 +- gfx/vr/service/osvr/ClientKit/DisplayC.h | 44 +- gfx/vr/service/osvr/ClientKit/InterfaceC.h | 2 +- .../osvr/ClientKit/InterfaceCallbackC.h | 2 +- .../service/osvr/ClientKit/InterfaceStateC.h | 4 +- .../service/osvr/Util/ClientCallbackTypesC.h | 88 +- gfx/vr/service/osvr/Util/ClientOpaqueTypesC.h | 4 +- .../service/osvr/Util/ImagingReportTypesC.h | 2 +- gfx/vr/service/osvr/Util/MatrixConventionsC.h | 16 +- gfx/vr/service/osvr/Util/Pose3C.h | 2 +- gfx/vr/service/osvr/Util/QuaternionC.h | 8 +- gfx/vr/service/osvr/Util/QuatlibInteropC.h | 20 +- gfx/vr/service/osvr/Util/TimeValueC.h | 40 +- gfx/vr/service/osvr/Util/Vec2C.h | 8 +- gfx/vr/service/osvr/Util/Vec3C.h | 8 +- hal/HalLog.h | 2 +- hal/cocoa/CocoaSensor.mm | 4 +- hal/cocoa/smslib.h | 12 +- hal/cocoa/smslib.mm | 90 +- hal/fallback/FallbackVibration.cpp | 5 +- hal/windows/WindowsSensor.cpp | 14 +- image/decoders/icon/nsIconURI.h | 38 +- .../hyphenation/glue/nsHyphenationManager.cpp | 22 +- intl/hyphenation/glue/nsHyphenationManager.h | 8 +- intl/hyphenation/glue/nsHyphenator.cpp | 28 +- intl/lwbrk/rulebrk.h | 4 +- intl/uconv/nsConverterInputStream.h | 2 +- ipc/app/MozillaRuntimeMain.cpp | 2 +- ipc/chromium/src/base/basictypes.h | 6 +- ipc/chromium/src/chrome/common/mach_ipc_mac.h | 34 +- .../src/chrome/common/mach_ipc_mac.mm | 40 +- ipc/glue/MessageLink.cpp | 30 +- ipc/glue/MessageLink.h | 34 +- ipc/glue/ProcessUtils_bsd.cpp | 4 +- ipc/glue/ProcessUtils_linux.cpp | 2 +- ipc/glue/ProcessUtils_mac.mm | 2 +- ipc/glue/ProcessUtils_none.cpp | 2 +- ipc/ipdl/test/cxx/TestCancel.cpp | 4 +- ipc/ipdl/test/cxx/TestCancel.h | 4 +- ipc/ipdl/test/cxx/TestUrgency.cpp | 8 +- ipc/ipdl/test/cxx/TestUrgency.h | 8 +- ipc/mscom/DispatchForwarder.h | 26 +- ipc/testshell/XPCShellEnvironment.cpp | 70 +- .../rootAnalysis/t/sixgill-tree/source.cpp | 14 +- js/src/jsapi-tests/testPrintf.cpp | 6 +- js/src/jsapi-tests/valueABI.c | 4 +- js/src/vm/PosixNSPR.cpp | 14 +- js/src/vm/PosixNSPR.h | 14 +- js/xpconnect/shell/xpcshellMacUtils.mm | 2 +- layout/base/nsCSSColorUtils.cpp | 6 +- layout/base/nsCSSColorUtils.h | 6 +- layout/base/nsFrameTraversal.h | 10 +- layout/generic/nsFontInflationData.cpp | 98 +- layout/generic/nsFontInflationData.h | 22 +- layout/generic/nsIntervalSet.cpp | 20 +- layout/generic/nsIntervalSet.h | 14 +- layout/style/nsHTMLStyleSheet.cpp | 47 +- layout/style/test/ListCSSProperties.cpp | 20 +- layout/style/test/ParseCSS.cpp | 12 +- layout/svg/nsSVGPatternFrame.cpp | 169 ++- layout/tables/BasicTableLayoutStrategy.cpp | 64 +- layout/tables/FixedTableLayoutStrategy.cpp | 38 +- layout/tables/SpanningCellSorter.cpp | 32 +- layout/tables/SpanningCellSorter.h | 18 +- layout/tables/nsITableCellLayout.h | 2 +- .../layout-debug/src/nsLayoutDebuggingTools.h | 4 +- media/mtransport/SrtpFlow.cpp | 24 +- media/mtransport/SrtpFlow.h | 16 +- media/mtransport/dtlsidentity.cpp | 60 +- .../fuzztest/stun_parser_libfuzz.cpp | 8 +- media/mtransport/nr_socket_prsock.cpp | 301 +++-- media/mtransport/nr_socket_prsock.h | 156 +-- media/mtransport/nr_timer.cpp | 40 +- media/mtransport/nricectx.cpp | 182 +-- media/mtransport/nricectx.h | 106 +- media/mtransport/nriceresolver.cpp | 36 +- media/mtransport/nriceresolver.h | 38 +- media/mtransport/nriceresolverfake.cpp | 34 +- media/mtransport/nriceresolverfake.h | 34 +- media/mtransport/nrinterfaceprioritizer.cpp | 34 +- media/mtransport/stun_socket_filter.cpp | 90 +- media/mtransport/test/TestSyncRunnable.cpp | 2 +- .../test/buffered_stun_socket_unittest.cpp | 14 +- media/mtransport/test/dummysocket.h | 40 +- .../test/multi_tcp_socket_unittest.cpp | 66 +- media/mtransport/test/nrappkit_unittest.cpp | 6 +- .../test/proxy_tunnel_socket_unittest.cpp | 16 +- .../test/runnable_utils_unittest.cpp | 24 +- media/mtransport/test/sctp_unittest.cpp | 77 +- .../test/sockettransportservice_unittest.cpp | 22 +- media/mtransport/test/stunserver.cpp | 109 +- media/mtransport/test/stunserver.h | 54 +- .../test/test_nr_socket_ice_unittest.cpp | 92 +- .../test/test_nr_socket_unittest.cpp | 66 +- media/mtransport/test/turn_unittest.cpp | 31 +- .../test/webrtcproxychannel_unittest.cpp | 134 +- media/mtransport/test_nr_socket.cpp | 160 +-- media/mtransport/test_nr_socket.h | 112 +- media/mtransport/transportflow.h | 18 +- media/mtransport/transportlayer.cpp | 4 +- media/mtransport/transportlayer.h | 18 +- media/mtransport/transportlayerdtls.cpp | 194 +-- media/mtransport/transportlayerice.cpp | 14 +- media/mtransport/transportlayerice.h | 14 +- media/mtransport/transportlayerloopback.h | 20 +- .../signaling/fuzztest/sdp_parser_libfuzz.cpp | 6 +- .../webrtc/signaling/src/common/NullDeleter.h | 2 +- .../src/common/browser_logging/WebRtcLog.cpp | 8 +- .../src/common/time_profiling/timecard.c | 18 +- .../src/common/time_profiling/timecard.h | 18 +- .../signaling/src/sdp/SipccSdpParser.cpp | 14 +- memory/mozalloc/mozalloc_oom.cpp | 2 +- mfbt/MemoryChecking.h | 10 +- .../components/build/nsBrowserModule.cpp | 4 +- modules/libjar/nsJARChannel.cpp | 112 +- modules/libjar/nsJARChannel.h | 8 +- modules/libjar/nsJARInputStream.cpp | 48 +- modules/libjar/nsJARProtocolHandler.cpp | 22 +- modules/libjar/nsJARProtocolHandler.h | 4 +- modules/libjar/nsJARURI.cpp | 164 +-- modules/libjar/nsJARURI.h | 64 +- modules/libjar/nsZipArchive.cpp | 146 +-- modules/libjar/zipwriter/StreamFunctions.cpp | 4 +- .../libjar/zipwriter/nsDeflateConverter.cpp | 34 +- modules/libjar/zipwriter/nsDeflateConverter.h | 2 +- modules/libjar/zipwriter/nsZipDataStream.cpp | 20 +- modules/libjar/zipwriter/nsZipDataStream.h | 10 +- modules/libjar/zipwriter/nsZipHeader.cpp | 44 +- modules/libjar/zipwriter/nsZipHeader.h | 12 +- modules/libjar/zipwriter/nsZipWriter.cpp | 68 +- modules/libjar/zipwriter/nsZipWriter.h | 12 +- mozglue/android/NSSBridge.h | 30 +- mozglue/android/NativeCrypto.cpp | 49 +- mozglue/android/NativeCrypto.h | 10 +- mozglue/android/SQLiteBridge.h | 40 +- mozglue/android/nsGeckoUtils.cpp | 40 +- mozglue/android/pbkdf2_sha256.c | 38 +- mozglue/android/pbkdf2_sha256.h | 16 +- mozglue/build/SSE.cpp | 4 +- mozglue/build/arm.cpp | 4 +- mozglue/build/mips.cpp | 2 +- mozglue/linker/BaseElf.cpp | 44 +- mozglue/linker/BaseElf.h | 38 +- mozglue/linker/CustomElf.cpp | 104 +- mozglue/linker/CustomElf.h | 20 +- mozglue/linker/ElfLoader.cpp | 245 ++-- mozglue/linker/ElfLoader.h | 166 +-- mozglue/linker/Elfxx.h | 12 +- mozglue/linker/Logging.h | 2 +- mozglue/linker/Mappable.cpp | 54 +- mozglue/linker/Mappable.h | 20 +- mozglue/linker/Utils.h | 130 +- mozglue/linker/Zip.cpp | 48 +- mozglue/linker/Zip.h | 66 +- mozglue/linker/tests/TestZip.cpp | 12 +- mozglue/misc/Debug.h | 4 +- mozglue/tests/TestPrintf.cpp | 12 +- netwerk/base/ADivertableParentChannel.h | 2 +- netwerk/base/ArrayBufferInputStream.cpp | 18 +- netwerk/base/AutoClose.h | 8 +- netwerk/base/BackgroundFileSaver.cpp | 86 +- netwerk/base/CaptivePortalService.cpp | 12 +- netwerk/base/Dashboard.cpp | 140 +- netwerk/base/Dashboard.h | 26 +- netwerk/base/EventTokenBucket.cpp | 24 +- netwerk/base/EventTokenBucket.h | 4 +- netwerk/base/FuzzyLayer.cpp | 28 +- netwerk/base/FuzzyLayer.h | 2 +- netwerk/base/IOActivityMonitor.cpp | 86 +- netwerk/base/LoadContextInfo.cpp | 38 +- netwerk/base/NetworkConnectivityService.cpp | 30 +- netwerk/base/PollableEvent.cpp | 16 +- netwerk/base/PollableEvent.h | 8 +- netwerk/base/Predictor.cpp | 274 ++-- netwerk/base/Predictor.h | 114 +- netwerk/base/ProxyAutoConfig.cpp | 122 +- netwerk/base/ProxyAutoConfig.h | 20 +- netwerk/base/RedirectChannelRegistrar.cpp | 12 +- netwerk/base/RequestContextService.cpp | 42 +- netwerk/base/RequestContextService.h | 2 +- netwerk/base/ShutdownLayer.cpp | 8 +- netwerk/base/ShutdownLayer.h | 2 +- netwerk/base/SimpleBuffer.cpp | 10 +- netwerk/base/SimpleBuffer.h | 4 +- netwerk/base/TCPFastOpenLayer.cpp | 82 +- netwerk/base/TCPFastOpenLayer.h | 12 +- netwerk/base/Tickler.cpp | 6 +- netwerk/base/nsASocketHandler.h | 8 +- netwerk/base/nsAsyncStreamCopier.cpp | 41 +- netwerk/base/nsAsyncStreamCopier.h | 14 +- netwerk/base/nsBaseChannel.cpp | 103 +- netwerk/base/nsBaseChannel.h | 38 +- netwerk/base/nsBaseContentStream.cpp | 14 +- netwerk/base/nsBaseContentStream.h | 2 +- netwerk/base/nsDNSPrefetch.cpp | 16 +- netwerk/base/nsDownloader.cpp | 16 +- netwerk/base/nsDownloader.h | 6 +- netwerk/base/nsIOService.cpp | 225 ++-- netwerk/base/nsIncrementalDownload.cpp | 76 +- netwerk/base/nsIncrementalStreamLoader.cpp | 30 +- netwerk/base/nsIncrementalStreamLoader.h | 6 +- netwerk/base/nsInputStreamPump.cpp | 48 +- netwerk/base/nsInputStreamPump.h | 8 +- netwerk/base/nsLoadGroup.cpp | 104 +- netwerk/base/nsMIMEInputStream.h | 4 +- netwerk/base/nsNetAddr.cpp | 16 +- netwerk/base/nsNetSegmentUtils.h | 4 +- netwerk/base/nsNetUtil.cpp | 604 ++++----- netwerk/base/nsNetUtil.h | 568 ++++---- netwerk/base/nsPACMan.cpp | 67 +- netwerk/base/nsPACMan.h | 36 +- netwerk/base/nsPreloadedStream.cpp | 22 +- netwerk/base/nsPreloadedStream.h | 4 +- netwerk/base/nsProtocolProxyService.cpp | 239 ++-- netwerk/base/nsProtocolProxyService.h | 82 +- netwerk/base/nsProxyInfo.cpp | 20 +- netwerk/base/nsProxyInfo.h | 14 +- netwerk/base/nsRequestObserverProxy.cpp | 20 +- netwerk/base/nsRequestObserverProxy.h | 6 +- netwerk/base/nsServerSocket.cpp | 46 +- netwerk/base/nsServerSocket.h | 14 +- netwerk/base/nsSimpleStreamListener.cpp | 12 +- netwerk/base/nsSimpleURI.cpp | 142 +- netwerk/base/nsSimpleURI.h | 58 +- netwerk/base/nsSocketTransport2.cpp | 230 ++-- netwerk/base/nsSocketTransport2.h | 88 +- netwerk/base/nsSocketTransportService2.cpp | 114 +- netwerk/base/nsSocketTransportService2.h | 44 +- netwerk/base/nsStandardURL.cpp | 338 ++--- netwerk/base/nsStandardURL.h | 158 +-- netwerk/base/nsStreamListenerTee.cpp | 18 +- netwerk/base/nsStreamListenerWrapper.h | 2 +- netwerk/base/nsStreamLoader.cpp | 28 +- netwerk/base/nsStreamLoader.h | 6 +- netwerk/base/nsStreamTransportService.cpp | 40 +- netwerk/base/nsSyncStreamListener.cpp | 20 +- netwerk/base/nsTransportUtils.cpp | 18 +- netwerk/base/nsTransportUtils.h | 6 +- netwerk/base/nsURLHelper.cpp | 160 +-- netwerk/base/nsURLHelper.h | 90 +- netwerk/base/nsURLHelperOSX.cpp | 26 +- netwerk/base/nsURLHelperUnix.cpp | 4 +- netwerk/base/nsURLHelperWin.cpp | 6 +- netwerk/base/nsURLParsers.cpp | 154 +-- netwerk/base/nsURLParsers.h | 63 +- netwerk/cache/nsApplicationCache.h | 4 +- netwerk/cache/nsApplicationCacheService.cpp | 46 +- netwerk/cache/nsCacheDevice.h | 26 +- netwerk/cache/nsCacheEntry.cpp | 110 +- netwerk/cache/nsCacheEntry.h | 80 +- netwerk/cache/nsCacheEntryDescriptor.cpp | 114 +- netwerk/cache/nsCacheMetaData.cpp | 26 +- netwerk/cache/nsCacheService.cpp | 246 ++-- netwerk/cache/nsCacheService.h | 118 +- netwerk/cache/nsCacheSession.cpp | 24 +- netwerk/cache/nsCacheUtils.h | 6 +- netwerk/cache/nsDeleteDir.cpp | 22 +- netwerk/cache/nsDeleteDir.h | 14 +- netwerk/cache/nsDiskCacheDeviceSQL.cpp | 353 +++-- netwerk/cache/nsDiskCacheDeviceSQL.h | 200 +-- netwerk/cache2/AppCacheStorage.cpp | 32 +- netwerk/cache2/CacheEntry.cpp | 134 +- netwerk/cache2/CacheEntry.h | 204 +-- netwerk/cache2/CacheFile.cpp | 178 +-- netwerk/cache2/CacheFile.h | 108 +- netwerk/cache2/CacheFileChunk.cpp | 56 +- netwerk/cache2/CacheFileChunk.h | 60 +- netwerk/cache2/CacheFileContextEvictor.cpp | 36 +- netwerk/cache2/CacheFileContextEvictor.h | 22 +- netwerk/cache2/CacheFileIOManager.cpp | 258 ++-- netwerk/cache2/CacheFileIOManager.h | 190 +-- netwerk/cache2/CacheFileInputStream.cpp | 32 +- netwerk/cache2/CacheFileInputStream.h | 12 +- netwerk/cache2/CacheFileMetadata.cpp | 89 +- netwerk/cache2/CacheFileMetadata.h | 64 +- netwerk/cache2/CacheFileOutputStream.cpp | 30 +- netwerk/cache2/CacheFileOutputStream.h | 12 +- netwerk/cache2/CacheFileUtils.cpp | 58 +- netwerk/cache2/CacheFileUtils.h | 50 +- netwerk/cache2/CacheHashUtils.cpp | 14 +- netwerk/cache2/CacheHashUtils.h | 20 +- netwerk/cache2/CacheIndex.cpp | 246 ++-- netwerk/cache2/CacheIndex.h | 164 +-- netwerk/cache2/CacheIndexContextIterator.cpp | 8 +- netwerk/cache2/CacheIndexContextIterator.h | 8 +- netwerk/cache2/CacheIndexIterator.cpp | 12 +- netwerk/cache2/CacheIndexIterator.h | 14 +- netwerk/cache2/CacheStorage.cpp | 38 +- netwerk/cache2/OldWrappers.cpp | 142 +- netwerk/cache2/OldWrappers.h | 102 +- netwerk/cookie/CookieServiceChild.cpp | 104 +- netwerk/cookie/CookieServiceChild.h | 56 +- netwerk/cookie/CookieServiceParent.cpp | 52 +- netwerk/cookie/CookieServiceParent.h | 38 +- netwerk/cookie/nsCookie.cpp | 52 +- netwerk/cookie/nsCookie.h | 28 +- netwerk/cookie/nsCookiePermission.cpp | 8 +- netwerk/cookie/nsCookieService.cpp | 492 +++---- netwerk/cookie/nsCookieService.h | 192 +-- netwerk/dns/ChildDNSService.cpp | 106 +- netwerk/dns/ChildDNSService.h | 24 +- netwerk/dns/DNS.cpp | 46 +- netwerk/dns/DNS.h | 36 +- netwerk/dns/DNSRequestChild.cpp | 46 +- netwerk/dns/DNSRequestParent.cpp | 16 +- netwerk/dns/TRR.cpp | 57 +- netwerk/dns/TRR.h | 32 +- netwerk/dns/TRRService.cpp | 44 +- netwerk/dns/TRRService.h | 30 +- netwerk/dns/nsDNSService2.cpp | 180 ++- netwerk/dns/nsDNSService2.h | 34 +- netwerk/dns/nsEffectiveTLDService.cpp | 48 +- netwerk/dns/nsHostResolver.cpp | 138 +- netwerk/dns/nsHostResolver.h | 122 +- netwerk/dns/punycode.c | 4 +- netwerk/dns/punycode.h | 4 +- netwerk/mime/nsMIMEHeaderParamImpl.cpp | 215 ++- netwerk/mime/nsMIMEHeaderParamImpl.h | 24 +- netwerk/protocol/about/nsAboutBlank.h | 2 +- netwerk/protocol/about/nsAboutCache.cpp | 34 +- netwerk/protocol/about/nsAboutCache.h | 60 +- netwerk/protocol/about/nsAboutCacheEntry.cpp | 62 +- netwerk/protocol/about/nsAboutCacheEntry.h | 20 +- .../protocol/about/nsAboutProtocolHandler.cpp | 68 +- netwerk/protocol/about/nsAboutProtocolUtils.h | 8 +- netwerk/protocol/data/DataChannelChild.h | 2 +- netwerk/protocol/data/DataChannelParent.cpp | 18 +- netwerk/protocol/data/nsDataChannel.h | 4 +- netwerk/protocol/file/FileChannelChild.cpp | 10 +- netwerk/protocol/file/FileChannelChild.h | 2 +- netwerk/protocol/file/FileChannelParent.cpp | 18 +- netwerk/protocol/file/nsFileChannel.cpp | 56 +- netwerk/protocol/file/nsFileChannel.h | 12 +- .../protocol/file/nsFileProtocolHandler.cpp | 50 +- netwerk/protocol/ftp/nsFTPChannel.cpp | 32 +- netwerk/protocol/ftp/nsFTPChannel.h | 26 +- .../protocol/ftp/nsFtpConnectionThread.cpp | 56 +- netwerk/protocol/ftp/nsFtpProtocolHandler.cpp | 52 +- netwerk/protocol/ftp/nsFtpProtocolHandler.h | 12 +- netwerk/protocol/gio/nsGIOProtocolHandler.cpp | 142 +- netwerk/protocol/http/ASpdySession.cpp | 24 +- netwerk/protocol/http/ASpdySession.h | 22 +- .../http/AltDataOutputStreamChild.cpp | 22 +- netwerk/protocol/http/AlternateServices.cpp | 130 +- netwerk/protocol/http/AlternateServices.h | 84 +- netwerk/protocol/http/CacheControlParser.cpp | 10 +- netwerk/protocol/http/CacheControlParser.h | 10 +- .../protocol/http/ConnectionDiagnostics.cpp | 12 +- netwerk/protocol/http/Http2Compression.cpp | 133 +- netwerk/protocol/http/Http2Compression.h | 62 +- netwerk/protocol/http/Http2Push.cpp | 64 +- netwerk/protocol/http/Http2Push.h | 50 +- netwerk/protocol/http/Http2Session.cpp | 364 +++--- netwerk/protocol/http/Http2Session.h | 151 ++- netwerk/protocol/http/Http2Stream.cpp | 112 +- netwerk/protocol/http/Http2Stream.h | 75 +- netwerk/protocol/http/HttpAuthUtils.h | 2 +- netwerk/protocol/http/HttpBaseChannel.h | 350 ++--- netwerk/protocol/http/HttpInfo.h | 2 +- netwerk/protocol/http/HttpTrafficAnalyzer.cpp | 2 +- netwerk/protocol/http/HttpTrafficAnalyzer.h | 2 +- netwerk/protocol/http/NullHttpChannel.cpp | 238 ++-- netwerk/protocol/http/NullHttpChannel.h | 8 +- netwerk/protocol/http/NullHttpTransaction.cpp | 32 +- netwerk/protocol/http/NullHttpTransaction.h | 8 +- netwerk/protocol/http/TunnelUtils.cpp | 308 ++--- netwerk/protocol/http/TunnelUtils.h | 102 +- netwerk/protocol/http/nsAHttpConnection.h | 180 +-- netwerk/protocol/http/nsAHttpTransaction.h | 80 +- netwerk/protocol/http/nsHttp.cpp | 156 +-- netwerk/protocol/http/nsHttp.h | 86 +- .../http/nsHttpActivityDistributor.cpp | 16 +- netwerk/protocol/http/nsHttpAuthCache.cpp | 128 +- netwerk/protocol/http/nsHttpAuthCache.h | 134 +- netwerk/protocol/http/nsHttpAuthManager.h | 4 +- netwerk/protocol/http/nsHttpBasicAuth.cpp | 30 +- netwerk/protocol/http/nsHttpChannel.cpp | 453 ++++--- netwerk/protocol/http/nsHttpChannel.h | 200 +-- .../http/nsHttpChannelAuthProvider.cpp | 166 +-- .../protocol/http/nsHttpChannelAuthProvider.h | 82 +- .../protocol/http/nsHttpChunkedDecoder.cpp | 14 +- netwerk/protocol/http/nsHttpChunkedDecoder.h | 14 +- netwerk/protocol/http/nsHttpConnection.cpp | 118 +- netwerk/protocol/http/nsHttpConnection.h | 78 +- .../protocol/http/nsHttpConnectionInfo.cpp | 58 +- netwerk/protocol/http/nsHttpConnectionInfo.h | 88 +- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 516 ++++---- netwerk/protocol/http/nsHttpConnectionMgr.h | 257 ++-- netwerk/protocol/http/nsHttpDigestAuth.cpp | 78 +- netwerk/protocol/http/nsHttpHandler.cpp | 150 +-- netwerk/protocol/http/nsHttpHandler.h | 120 +- netwerk/protocol/http/nsHttpHeaderArray.cpp | 78 +- netwerk/protocol/http/nsHttpHeaderArray.h | 68 +- netwerk/protocol/http/nsHttpNTLMAuth.cpp | 48 +- netwerk/protocol/http/nsHttpRequestHead.cpp | 46 +- netwerk/protocol/http/nsHttpRequestHead.h | 40 +- netwerk/protocol/http/nsHttpResponseHead.cpp | 128 +- netwerk/protocol/http/nsHttpResponseHead.h | 86 +- netwerk/protocol/http/nsHttpTransaction.cpp | 120 +- netwerk/protocol/http/nsHttpTransaction.h | 99 +- netwerk/protocol/http/nsServerTiming.cpp | 16 +- netwerk/protocol/http/nsServerTiming.h | 8 +- .../viewsource/nsViewSourceChannel.cpp | 210 +-- .../viewsource/nsViewSourceHandler.cpp | 34 +- .../protocol/viewsource/nsViewSourceHandler.h | 12 +- .../websocket/BaseWebSocketChannel.cpp | 72 +- .../protocol/websocket/BaseWebSocketChannel.h | 54 +- .../protocol/websocket/WebSocketChannel.cpp | 291 +++-- netwerk/protocol/websocket/WebSocketChannel.h | 50 +- netwerk/sctp/datachannel/DataChannel.cpp | 337 +++-- netwerk/sctp/datachannel/DataChannel.h | 166 +-- .../sctp/datachannel/DataChannelListener.h | 16 +- netwerk/socket/nsSOCKSIOLayer.cpp | 176 +-- netwerk/socket/nsSOCKSIOLayer.h | 10 +- netwerk/socket/nsSOCKSSocketProvider.cpp | 34 +- netwerk/socket/nsSOCKSSocketProvider.h | 4 +- netwerk/socket/nsSocketProviderService.cpp | 4 +- netwerk/socket/nsUDPSocketProvider.cpp | 22 +- .../streamconv/converters/ParseFTPList.cpp | 20 +- netwerk/streamconv/converters/ParseFTPList.h | 8 +- .../converters/nsDirIndexParser.cpp | 38 +- .../converters/nsFTPDirListingConv.cpp | 40 +- .../converters/nsHTTPCompressConv.cpp | 74 +- .../converters/nsHTTPCompressConv.h | 20 +- .../streamconv/converters/nsIndexedToHTML.h | 14 +- .../converters/nsMultiMixedConv.cpp | 108 +- .../streamconv/nsStreamConverterService.cpp | 80 +- netwerk/streamconv/nsStreamConverterService.h | 10 +- .../android/nsAndroidNetworkLinkService.cpp | 6 +- .../linux/nsNotifyAddrListener_Linux.cpp | 54 +- netwerk/system/mac/nsNetworkLinkService.h | 4 +- netwerk/system/mac/nsNetworkLinkService.mm | 72 +- netwerk/system/win32/nsNotifyAddrListener.cpp | 46 +- netwerk/system/win32/nsNotifyAddrListener.h | 8 +- netwerk/test/TestCookie.cpp | 40 +- netwerk/wifi/nsWifiMonitor.cpp | 18 +- netwerk/wifi/nsWifiScannerFreeBSD.cpp | 16 +- netwerk/wifi/nsWifiScannerMac.cpp | 2 +- netwerk/wifi/nsWifiScannerSolaris.cpp | 20 +- netwerk/wifi/osx_wifi.h | 8 +- netwerk/wifi/win_wifiScanner.cpp | 14 +- netwerk/wifi/win_wifiScanner.h | 2 +- parser/htmlparser/nsExpatDriver.cpp | 182 +-- parser/htmlparser/nsExpatDriver.h | 46 +- security/manager/pki/nsASN1Tree.h | 28 +- security/manager/ssl/NSSErrorsService.cpp | 12 +- security/manager/ssl/PSMContentListener.h | 14 +- security/manager/ssl/md4.c | 12 +- security/manager/ssl/md4.h | 2 +- .../manager/ssl/nsCertOverrideService.cpp | 82 +- security/manager/ssl/nsCertOverrideService.h | 44 +- security/manager/ssl/nsCertTree.cpp | 216 +-- security/manager/ssl/nsCertTree.h | 40 +- security/manager/ssl/nsCryptoHash.cpp | 30 +- security/manager/ssl/nsKeygenThread.cpp | 24 +- security/manager/ssl/nsKeygenThread.h | 28 +- security/manager/ssl/nsNSSASN1Object.cpp | 56 +- security/manager/ssl/nsNSSASN1Object.h | 6 +- security/manager/ssl/nsNSSCertTrust.cpp | 4 +- security/manager/ssl/nsNSSCertTrust.h | 8 +- security/manager/ssl/nsNTLMAuthModule.cpp | 160 ++- .../manager/ssl/nsProtectedAuthThread.cpp | 14 +- security/manager/ssl/nsProtectedAuthThread.h | 6 +- security/manager/ssl/nsSSLSocketProvider.cpp | 20 +- security/manager/ssl/nsSecurityHeaderParser.h | 8 +- security/manager/ssl/nsTLSSocketProvider.cpp | 20 +- security/manager/ssl/nsVerificationJob.h | 2 +- .../ssl/tests/gtest/DeserializeCertTest.cpp | 2 +- .../unit/tlsserver/cmd/OCSPStaplingServer.cpp | 12 +- .../ssl/tests/unit/tlsserver/lib/TLSServer.h | 23 +- security/sandbox/common/SandboxSettings.cpp | 2 +- security/sandbox/linux/glue/SandboxCrash.cpp | 8 +- security/sandbox/mac/Sandbox.mm | 60 +- .../remoteSandboxBroker.cpp | 16 +- .../remotesandboxbroker/remoteSandboxBroker.h | 8 +- .../win/src/sandboxbroker/sandboxBroker.h | 24 +- startupcache/StartupCacheUtils.cpp | 16 +- startupcache/StartupCacheUtils.h | 12 +- storage/IStorageBindingParamsInternal.h | 4 +- storage/SQLCollations.cpp | 68 +- storage/SQLCollations.h | 42 +- storage/SQLiteMutex.h | 14 +- storage/StorageBaseStatementInternal.cpp | 24 +- storage/StorageBaseStatementInternal.h | 78 +- storage/TelemetryVFS.cpp | 204 +-- storage/VacuumManager.cpp | 20 +- storage/VacuumManager.h | 2 +- storage/Variant.h | 108 +- storage/Variant_inl.h | 51 +- storage/mozStorageArgValueArray.cpp | 53 +- storage/mozStorageArgValueArray.h | 4 +- storage/mozStorageAsyncStatement.cpp | 40 +- storage/mozStorageAsyncStatement.h | 6 +- storage/mozStorageAsyncStatementExecution.cpp | 34 +- storage/mozStorageAsyncStatementExecution.h | 36 +- storage/mozStorageAsyncStatementJSHelper.cpp | 22 +- storage/mozStorageAsyncStatementJSHelper.h | 6 +- storage/mozStorageBindingParams.cpp | 92 +- storage/mozStorageBindingParams.h | 20 +- storage/mozStorageBindingParamsArray.cpp | 12 +- storage/mozStorageBindingParamsArray.h | 16 +- storage/mozStorageConnection.cpp | 254 ++-- storage/mozStorageConnection.h | 48 +- storage/mozStorageError.cpp | 6 +- storage/mozStorageError.h | 2 +- storage/mozStoragePrivateHelpers.cpp | 18 +- storage/mozStorageResultSet.cpp | 4 +- storage/mozStorageResultSet.h | 2 +- storage/mozStorageRow.cpp | 46 +- storage/mozStorageRow.h | 2 +- storage/mozStorageSQLFunctions.cpp | 62 +- storage/mozStorageSQLFunctions.h | 14 +- storage/mozStorageService.cpp | 76 +- storage/mozStorageService.h | 14 +- storage/mozStorageStatement.cpp | 122 +- storage/mozStorageStatement.h | 14 +- storage/mozStorageStatementData.h | 14 +- storage/mozStorageStatementJSHelper.cpp | 34 +- storage/mozStorageStatementJSHelper.h | 12 +- storage/test/gtest/storage_test_harness.h | 24 +- storage/test/gtest/test_AsXXX_helpers.cpp | 20 +- ...st_asyncStatementExecution_transaction.cpp | 40 +- storage/test/gtest/test_mutex.cpp | 4 +- storage/variantToSQLiteT_impl.h | 4 +- .../autocomplete/nsAutoCompleteController.cpp | 110 +- .../components/build/nsToolkitCompsModule.cpp | 6 +- .../components/build/nsToolkitCompsModule.h | 4 +- .../ctypes/tests/jsctypes-test-finalizer.cpp | 40 +- .../ctypes/tests/jsctypes-test-finalizer.h | 26 +- toolkit/components/find/nsFindService.cpp | 16 +- .../maintenanceservice/maintenanceservice.cpp | 8 +- .../maintenanceservice/maintenanceservice.h | 4 +- .../maintenanceservice/servicebase.cpp | 2 +- .../maintenanceservice/servicebase.h | 2 +- .../maintenanceservice/serviceinstall.cpp | 32 +- .../maintenanceservice/serviceinstall.h | 2 +- .../maintenanceservice/workmonitor.cpp | 34 +- .../maintenanceservice/workmonitor.h | 2 +- toolkit/components/mediasniffer/mp3sniff.c | 14 +- toolkit/components/mediasniffer/mp3sniff.h | 2 +- .../nsParentalControlsService.h | 4 +- .../nsParentalControlsServiceAndroid.cpp | 16 +- .../nsParentalControlsServiceCocoa.mm | 24 +- .../nsParentalControlsServiceDefault.cpp | 16 +- .../nsParentalControlsServiceWin.cpp | 36 +- toolkit/components/places/SQLFunctions.cpp | 140 +- toolkit/components/places/SQLFunctions.h | 56 +- .../places/nsAnnoProtocolHandler.cpp | 48 +- .../components/places/nsAnnoProtocolHandler.h | 6 +- toolkit/components/places/nsPlacesMacros.h | 4 +- .../tests/gtest/places_test_harness_tail.h | 2 +- .../printingui/ipc/PrintDataUtils.cpp | 36 +- .../printingui/ipc/PrintDataUtils.h | 2 +- .../components/printingui/nsPrintProgress.cpp | 42 +- toolkit/components/remote/RemoteUtils.cpp | 26 +- .../components/remote/nsDBusRemoteClient.cpp | 20 +- .../components/remote/nsDBusRemoteClient.h | 16 +- .../components/remote/nsDBusRemoteServer.cpp | 38 +- .../components/remote/nsDBusRemoteServer.h | 12 +- toolkit/components/remote/nsRemoteClient.h | 8 +- .../components/remote/nsWinRemoteClient.cpp | 12 +- toolkit/components/remote/nsWinRemoteClient.h | 8 +- .../components/remote/nsWinRemoteServer.cpp | 22 +- toolkit/components/remote/nsWinRemoteUtils.h | 4 +- toolkit/components/remote/nsXRemoteClient.cpp | 82 +- toolkit/components/remote/nsXRemoteClient.h | 24 +- toolkit/components/remote/nsXRemoteServer.cpp | 56 +- .../components/startup/StartupTimeline.cpp | 4 +- toolkit/components/startup/nsAppStartup.cpp | 50 +- .../statusfilter/nsBrowserStatusFilter.cpp | 62 +- .../statusfilter/nsBrowserStatusFilter.h | 2 +- .../components/telemetry/core/ScalarInfo.h | 8 +- .../telemetry/other/ProcessedStack.cpp | 24 +- .../telemetry/other/ProcessedStack.h | 14 +- .../telemetry/other/WebrtcTelemetry.cpp | 26 +- .../telemetry/other/WebrtcTelemetry.h | 4 +- .../typeaheadfind/nsTypeAheadFind.h | 34 +- .../nsCheckSummedOutputStream.cpp | 20 +- .../nsCheckSummedOutputStream.h | 14 +- .../nsUrlClassifierStreamUpdater.cpp | 68 +- .../nsUrlClassifierStreamUpdater.h | 26 +- toolkit/crashreporter/LoadLibraryRemote.cpp | 93 +- toolkit/crashreporter/rust/rust_demangle.h | 4 +- .../update/common/certificatecheck.cpp | 4 +- .../mozapps/update/common/certificatecheck.h | 4 +- toolkit/mozapps/update/common/pathhash.cpp | 19 +- toolkit/mozapps/update/common/readstrings.cpp | 48 +- toolkit/mozapps/update/common/readstrings.h | 6 +- toolkit/mozapps/update/common/uachelper.h | 2 +- .../mozapps/update/common/updatehelper.cpp | 20 +- toolkit/mozapps/update/common/updatehelper.h | 10 +- .../mozapps/update/tests/TestAUSHelper.cpp | 22 +- .../update/tests/TestAUSReadStrings.cpp | 8 +- .../mozapps/update/updater/archivereader.cpp | 42 +- .../mozapps/update/updater/archivereader.h | 18 +- .../update/updater/bspatch/bspatch.cpp | 28 +- toolkit/mozapps/update/updater/progressui.h | 2 +- .../mozapps/update/updater/progressui_gtk.cpp | 14 +- .../update/updater/progressui_null.cpp | 2 +- .../mozapps/update/updater/progressui_osx.mm | 14 +- .../mozapps/update/updater/progressui_win.cpp | 4 +- toolkit/mozapps/update/updater/updater.cpp | 388 +++--- toolkit/profile/ProfileUnlockerWin.h | 16 +- toolkit/profile/nsProfileLock.cpp | 30 +- toolkit/system/gnome/nsGSettingsService.cpp | 116 +- .../system/unixproxy/nsLibProxySettings.cpp | 18 +- toolkit/xre/AutoSQLiteLifetime.cpp | 16 +- toolkit/xre/MacApplicationDelegate.mm | 72 +- toolkit/xre/MacAutoreleasePool.h | 6 +- toolkit/xre/glxtest.cpp | 48 +- toolkit/xre/nsGDKErrorHandler.cpp | 6 +- toolkit/xre/nsNativeAppSupportBase.cpp | 2 +- toolkit/xre/nsNativeAppSupportUnix.cpp | 68 +- toolkit/xre/nsNativeAppSupportWin.cpp | 4 +- toolkit/xre/nsSigHandlers.cpp | 70 +- toolkit/xre/nsUpdateDriver.cpp | 68 +- toolkit/xre/nsUpdateDriver.h | 10 +- toolkit/xre/nsWindowsRestart.cpp | 30 +- toolkit/xre/nsWindowsWMain.cpp | 26 +- toolkit/xre/nsX11ErrorHandler.cpp | 8 +- toolkit/xre/nsX11ErrorHandler.h | 2 +- .../test/win/TestXREMakeCommandLineWin.cpp | 18 +- .../minidump_stackwalk/minidump_stackwalk.cc | 10 +- .../interface/harness/FuzzerTestHarness.h | 20 +- tools/jprof/bfd.cpp | 54 +- tools/jprof/coff.cpp | 16 +- tools/jprof/elf.cpp | 26 +- tools/jprof/intcnt.cpp | 2 +- tools/jprof/stub/libmalloc.cpp | 73 +- tools/profiler/core/EHABIStackWalk.cpp | 110 +- tools/profiler/core/EHABIStackWalk.h | 4 +- tools/profiler/core/shared-libraries-macos.cc | 36 +- tools/profiler/lul/LulDwarf.cpp | 212 +-- tools/profiler/lul/LulDwarfExt.h | 146 +-- tools/profiler/tests/gtest/LulTestDwarf.cpp | 24 +- .../tests/gtest/LulTestInfrastructure.cpp | 56 +- .../tests/gtest/LulTestInfrastructure.h | 105 +- .../exthandler/ExternalHelperAppChild.cpp | 18 +- uriloader/exthandler/ExternalHelperAppChild.h | 10 +- .../android/nsExternalURLHandlerService.cpp | 4 +- .../exthandler/mac/nsDecodeAppleFile.cpp | 34 +- uriloader/exthandler/mac/nsDecodeAppleFile.h | 6 +- uriloader/exthandler/mac/nsMIMEInfoMac.mm | 8 +- .../exthandler/mac/nsOSHelperAppService.mm | 82 +- uriloader/exthandler/nsDBusHandlerApp.cpp | 32 +- .../exthandler/nsExternalProtocolHandler.cpp | 98 +- uriloader/exthandler/nsLocalHandlerApp.cpp | 30 +- uriloader/exthandler/nsLocalHandlerApp.h | 6 +- uriloader/exthandler/nsMIMEInfoImpl.h | 86 +- uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 6 +- uriloader/exthandler/unix/nsMIMEInfoUnix.h | 14 +- .../prefetch/OfflineCacheUpdateChild.cpp | 66 +- uriloader/prefetch/OfflineCacheUpdateGlue.cpp | 22 +- uriloader/prefetch/OfflineCacheUpdateGlue.h | 44 +- uriloader/prefetch/nsOfflineCacheUpdate.cpp | 228 ++-- uriloader/prefetch/nsOfflineCacheUpdate.h | 114 +- .../prefetch/nsOfflineCacheUpdateService.cpp | 114 +- uriloader/prefetch/nsPrefetchService.cpp | 94 +- uriloader/prefetch/nsPrefetchService.h | 22 +- widget/GfxDriverInfo.h | 34 +- widget/GfxInfoCollector.cpp | 14 +- widget/GfxInfoCollector.h | 24 +- widget/GfxInfoX11.cpp | 88 +- widget/android/ANRReporter.cpp | 4 +- widget/android/AndroidGraphicBuffer.h | 12 +- widget/android/GfxInfo.h | 50 +- widget/android/nsAndroidProtocolHandler.cpp | 38 +- widget/android/nsClipboard.cpp | 16 +- widget/android/nsIdleServiceAndroid.cpp | 2 +- widget/android/nsWidgetFactory.h | 4 +- widget/cocoa/GfxInfo.h | 52 +- widget/cocoa/OSXNotificationCenter.h | 8 +- widget/cocoa/OSXNotificationCenter.mm | 127 +- widget/cocoa/nsCocoaFeatures.h | 2 +- widget/cocoa/nsCocoaFeatures.mm | 10 +- widget/cocoa/nsCursorManager.h | 10 +- widget/cocoa/nsCursorManager.mm | 24 +- widget/cocoa/nsIdleServiceX.mm | 6 +- widget/cocoa/nsMacCursor.h | 14 +- widget/cocoa/nsMacCursor.mm | 46 +- widget/cocoa/nsMenuBaseX.h | 12 +- widget/cocoa/nsPrintSettingsX.h | 34 +- widget/cocoa/nsSound.mm | 10 +- widget/cocoa/nsWidgetFactory.mm | 2 +- widget/gtk/compat/gdk/gdkdnd.h | 8 +- widget/gtk/compat/gdk/gdkvisual.h | 2 +- widget/gtk/compat/gdk/gdkwindow.h | 6 +- widget/gtk/compat/gdk/gdkx.h | 10 +- widget/gtk/compat/glib/gmem.h | 6 +- widget/gtk/compat/gtk/gtkwidget.h | 8 +- widget/gtk/compat/gtk/gtkwindow.h | 8 +- widget/gtk/maiRedundantObjectFactory.c | 16 +- widget/gtk/maiRedundantObjectFactory.h | 2 +- widget/gtk/mozcontainer.cpp | 225 ++-- widget/gtk/mozcontainer.h | 30 +- widget/gtk/mozwayland/mozwayland.c | 132 +- widget/gtk/mozwayland/mozwayland.h | 50 +- widget/gtk/nsAppShell.h | 2 +- widget/gtk/nsBidiKeyboard.cpp | 8 +- widget/gtk/nsCUPSShim.cpp | 7 +- widget/gtk/nsCUPSShim.h | 30 +- widget/gtk/nsClipboard.cpp | 112 +- widget/gtk/nsClipboardWayland.cpp | 226 ++-- widget/gtk/nsClipboardX11.cpp | 92 +- widget/gtk/nsDragService.cpp | 292 ++--- widget/gtk/nsDragService.h | 66 +- widget/gtk/nsFilePicker.cpp | 119 +- widget/gtk/nsFilePicker.h | 48 +- widget/gtk/nsGtkCursors.h | 6 +- widget/gtk/nsLookAndFeel.h | 10 +- widget/gtk/nsPSPrinters.cpp | 12 +- widget/gtk/nsPrintDialogGTK.h | 8 +- widget/gtk/nsPrintSettingsGTK.h | 70 +- widget/gtk/nsSound.cpp | 70 +- widget/gtk/nsWaylandDisplay.cpp | 66 +- widget/gtk/nsWidgetFactory.h | 4 +- widget/gtk/nsWindow.cpp | 1156 ++++++++--------- widget/gtkxtbin/gtk2xtbin.c | 118 +- widget/gtkxtbin/gtk2xtbin.h | 24 +- widget/headless/HeadlessClipboard.cpp | 16 +- widget/headless/HeadlessLookAndFeel.h | 10 +- widget/headless/HeadlessSound.cpp | 8 +- widget/nsAppShellSingleton.h | 8 +- widget/nsBaseAppShell.cpp | 18 +- widget/nsBaseScreen.cpp | 14 +- widget/nsBaseScreen.h | 16 +- widget/nsHTMLFormatConverter.cpp | 24 +- widget/nsIPrintDialogService.h | 8 +- widget/nsPrintSettingsImpl.cpp | 164 +-- widget/nsSoundProxy.cpp | 2 +- widget/uikit/GfxInfo.h | 50 +- widget/uikit/nsAppShell.mm | 34 +- widget/uikit/nsLookAndFeel.h | 10 +- widget/uikit/nsLookAndFeel.mm | 12 +- widget/uikit/nsScreenManager.mm | 24 +- widget/windows/IEnumFE.cpp | 14 +- widget/windows/IEnumFE.h | 16 +- widget/windows/JumpListItem.cpp | 76 +- widget/windows/JumpListItem.h | 38 +- widget/windows/ProcInfo.cpp | 10 +- widget/windows/TaskbarPreview.cpp | 50 +- widget/windows/TaskbarPreview.h | 18 +- widget/windows/TaskbarPreviewButton.cpp | 22 +- widget/windows/TaskbarTabPreview.cpp | 45 +- widget/windows/TaskbarTabPreview.h | 12 +- widget/windows/TaskbarWindowPreview.cpp | 38 +- widget/windows/TaskbarWindowPreview.h | 12 +- widget/windows/WinPointerEvents.cpp | 10 +- widget/windows/WinPointerEvents.h | 22 +- widget/windows/WinTaskbar.cpp | 62 +- widget/windows/WinTaskbar.h | 6 +- widget/windows/WindowHook.cpp | 32 +- widget/windows/WindowHook.h | 30 +- widget/windows/nsFilePicker.cpp | 86 +- widget/windows/nsFilePicker.h | 64 +- widget/windows/nsIdleServiceWin.cpp | 2 +- widget/windows/nsLookAndFeel.cpp | 26 +- widget/windows/nsSound.cpp | 22 +- widget/windows/nsUXThemeData.cpp | 2 +- widget/windows/nsUXThemeData.h | 2 +- widget/windows/nsWidgetFactory.h | 4 +- widget/windows/nsWindowDbg.cpp | 2 +- widget/windows/nsWindowDbg.h | 4 +- xpcom/components/ModuleUtils.h | 12 +- xpcom/ds/nsQuickSort.cpp | 58 +- xpcom/io/crc32c.h | 2 +- xpcom/io/nsLocalFile.h | 26 +- xpcom/tests/RegFactory.cpp | 8 +- xpcom/tests/TestPRIntN.cpp | 4 +- xpcom/tests/gtest/TestAutoPtr.cpp | 48 +- xpcom/tests/gtest/TestAutoRef.cpp | 4 +- xpcom/tests/gtest/TestCallTemplates.cpp | 16 +- xpcom/tests/gtest/TestTextFormatter.cpp | 5 +- xpcom/tests/windows/TestCOM.cpp | 25 +- xpfe/appshell/nsAppShellService.h | 10 +- xpfe/appshell/nsAppShellWindowEnumerator.cpp | 54 +- xpfe/appshell/nsAppShellWindowEnumerator.h | 60 +- xpfe/appshell/nsWindowMediator.h | 22 +- 1031 files changed, 26916 insertions(+), 26999 deletions(-) diff --git a/accessible/atk/UtilInterface.cpp b/accessible/atk/UtilInterface.cpp index 12a27bc85a69f..5cc347f91b1b6 100644 --- a/accessible/atk/UtilInterface.cpp +++ b/accessible/atk/UtilInterface.cpp @@ -24,10 +24,10 @@ typedef AtkUtilClass MaiUtilClass; extern "C" { static guint (*gail_add_global_event_listener)(GSignalEmissionHook listener, - const gchar *event_type); + const gchar* event_type); static void (*gail_remove_global_event_listener)(guint remove_listener); static void (*gail_remove_key_event_listener)(guint remove_listener); -static AtkObject *(*gail_get_root)(); +static AtkObject* (*gail_get_root)(); } struct MaiUtilListenerInfo { @@ -41,13 +41,13 @@ struct MaiUtilListenerInfo { guint gail_listenerid; }; -static GHashTable *sListener_list = nullptr; +static GHashTable* sListener_list = nullptr; static gint sListener_idx = 1; extern "C" { static guint add_listener(GSignalEmissionHook listener, - const gchar *object_type, const gchar *signal, - const gchar *hook_data, guint gail_listenerid = 0) { + const gchar* object_type, const gchar* signal, + const gchar* hook_data, guint gail_listenerid = 0) { GType type; guint signal_id; gint rc = 0; @@ -56,12 +56,12 @@ static guint add_listener(GSignalEmissionHook listener, if (type) { signal_id = g_signal_lookup(signal, type); if (signal_id > 0) { - MaiUtilListenerInfo *listener_info; + MaiUtilListenerInfo* listener_info; rc = sListener_idx; listener_info = - (MaiUtilListenerInfo *)g_malloc(sizeof(MaiUtilListenerInfo)); + (MaiUtilListenerInfo*)g_malloc(sizeof(MaiUtilListenerInfo)); listener_info->key = sListener_idx; listener_info->hook_id = g_signal_add_emission_hook( signal_id, 0, listener, g_strdup(hook_data), (GDestroyNotify)g_free); @@ -80,9 +80,9 @@ static guint add_listener(GSignalEmissionHook listener, } static guint mai_util_add_global_event_listener(GSignalEmissionHook listener, - const gchar *event_type) { + const gchar* event_type) { guint rc = 0; - gchar **split_string; + gchar** split_string; split_string = g_strsplit(event_type, ":", 3); @@ -106,11 +106,11 @@ static guint mai_util_add_global_event_listener(GSignalEmissionHook listener, static void mai_util_remove_global_event_listener(guint remove_listener) { if (remove_listener > 0) { - MaiUtilListenerInfo *listener_info; + MaiUtilListenerInfo* listener_info; gint tmp_idx = remove_listener; listener_info = - (MaiUtilListenerInfo *)g_hash_table_lookup(sListener_list, &tmp_idx); + (MaiUtilListenerInfo*)g_hash_table_lookup(sListener_list, &tmp_idx); if (listener_info != nullptr) { if (gail_remove_global_event_listener && listener_info->gail_listenerid) { @@ -144,8 +144,8 @@ static void mai_util_remove_global_event_listener(guint remove_listener) { } } -static AtkKeyEventStruct *atk_key_event_from_gdk_event_key(GdkEventKey *key) { - AtkKeyEventStruct *event = g_new0(AtkKeyEventStruct, 1); +static AtkKeyEventStruct* atk_key_event_from_gdk_event_key(GdkEventKey* key) { + AtkKeyEventStruct* event = g_new0(AtkKeyEventStruct, 1); switch (key->type) { case GDK_KEY_PRESS: event->type = ATK_KEY_EVENT_PRESS; @@ -173,7 +173,7 @@ static AtkKeyEventStruct *atk_key_event_from_gdk_event_key(GdkEventKey *key) { } struct MaiKeyEventInfo { - AtkKeyEventStruct *key_event; + AtkKeyEventStruct* key_event; gpointer func_data; }; @@ -183,7 +183,7 @@ union AtkKeySnoopFuncPointer { }; static gboolean notify_hf(gpointer key, gpointer value, gpointer data) { - MaiKeyEventInfo *info = (MaiKeyEventInfo *)data; + MaiKeyEventInfo* info = (MaiKeyEventInfo*)data; AtkKeySnoopFuncPointer atkKeySnoop; atkKeySnoop.data = value; return (atkKeySnoop.func_ptr)(info->key_event, info->func_data) ? TRUE @@ -191,20 +191,20 @@ static gboolean notify_hf(gpointer key, gpointer value, gpointer data) { } static void insert_hf(gpointer key, gpointer value, gpointer data) { - GHashTable *new_table = (GHashTable *)data; + GHashTable* new_table = (GHashTable*)data; g_hash_table_insert(new_table, key, value); } -static GHashTable *sKey_listener_list = nullptr; +static GHashTable* sKey_listener_list = nullptr; -static gint mai_key_snooper(GtkWidget *the_widget, GdkEventKey *event, +static gint mai_key_snooper(GtkWidget* the_widget, GdkEventKey* event, gpointer func_data) { /* notify each AtkKeySnoopFunc in turn... */ - MaiKeyEventInfo *info = g_new0(MaiKeyEventInfo, 1); + MaiKeyEventInfo* info = g_new0(MaiKeyEventInfo, 1); gint consumed = 0; if (sKey_listener_list) { - GHashTable *new_hash = g_hash_table_new(nullptr, nullptr); + GHashTable* new_hash = g_hash_table_new(nullptr, nullptr); g_hash_table_foreach(sKey_listener_list, insert_hf, new_hash); info->key_event = atk_key_event_from_gdk_event_key(event); info->func_data = func_data; @@ -257,8 +257,8 @@ static void mai_util_remove_key_event_listener(guint remove_listener) { } } -static AtkObject *mai_util_get_root() { - ApplicationAccessible *app = ApplicationAcc(); +static AtkObject* mai_util_get_root() { + ApplicationAccessible* app = ApplicationAcc(); if (app) return app->GetAtkObject(); // We've shutdown, try to use gail instead @@ -269,28 +269,28 @@ static AtkObject *mai_util_get_root() { return nullptr; } -static const gchar *mai_util_get_toolkit_name() { return MAI_NAME; } +static const gchar* mai_util_get_toolkit_name() { return MAI_NAME; } -static const gchar *mai_util_get_toolkit_version() { return MAI_VERSION; } +static const gchar* mai_util_get_toolkit_version() { return MAI_VERSION; } static void _listener_info_destroy(gpointer data) { g_free(data); } -static void window_added(AtkObject *atk_obj, guint index, AtkObject *child) { +static void window_added(AtkObject* atk_obj, guint index, AtkObject* child) { if (!IS_MAI_OBJECT(child)) return; static guint id = g_signal_lookup("create", MAI_TYPE_ATK_OBJECT); g_signal_emit(child, id, 0); } -static void window_removed(AtkObject *atk_obj, guint index, AtkObject *child) { +static void window_removed(AtkObject* atk_obj, guint index, AtkObject* child) { if (!IS_MAI_OBJECT(child)) return; static guint id = g_signal_lookup("destroy", MAI_TYPE_ATK_OBJECT); g_signal_emit(child, id, 0); } -static void UtilInterfaceInit(MaiUtilClass *klass) { - AtkUtilClass *atk_class; +static void UtilInterfaceInit(MaiUtilClass* klass) { + AtkUtilClass* atk_class; gpointer data; data = g_type_class_peek(ATK_TYPE_UTIL); @@ -314,7 +314,7 @@ static void UtilInterfaceInit(MaiUtilClass *klass) { sListener_list = g_hash_table_new_full(g_int_hash, g_int_equal, nullptr, _listener_info_destroy); // Keep track of added/removed windows. - AtkObject *root = atk_get_root(); + AtkObject* root = atk_get_root(); g_signal_connect(root, "children-changed::add", (GCallback)window_added, nullptr); g_signal_connect(root, "children-changed::remove", (GCallback)window_removed, diff --git a/accessible/atk/nsMaiHyperlink.cpp b/accessible/atk/nsMaiHyperlink.cpp index 963c49282700e..3e10ed189d6e0 100644 --- a/accessible/atk/nsMaiHyperlink.cpp +++ b/accessible/atk/nsMaiHyperlink.cpp @@ -38,7 +38,7 @@ struct MaiAtkHyperlink { * The MaiHyperlink whose properties and features are exported via this * hyperlink instance. */ - MaiHyperlink *maiHyperlink; + MaiHyperlink* maiHyperlink; }; struct MaiAtkHyperlinkClass { @@ -49,23 +49,23 @@ GType mai_atk_hyperlink_get_type(void); G_BEGIN_DECLS /* callbacks for AtkHyperlink */ -static void classInitCB(AtkHyperlinkClass *aClass); -static void finalizeCB(GObject *aObj); +static void classInitCB(AtkHyperlinkClass* aClass); +static void finalizeCB(GObject* aObj); /* callbacks for AtkHyperlink virtual functions */ -static gchar *getUriCB(AtkHyperlink *aLink, gint aLinkIndex); -static AtkObject *getObjectCB(AtkHyperlink *aLink, gint aLinkIndex); -static gint getEndIndexCB(AtkHyperlink *aLink); -static gint getStartIndexCB(AtkHyperlink *aLink); -static gboolean isValidCB(AtkHyperlink *aLink); -static gint getAnchorCountCB(AtkHyperlink *aLink); +static gchar* getUriCB(AtkHyperlink* aLink, gint aLinkIndex); +static AtkObject* getObjectCB(AtkHyperlink* aLink, gint aLinkIndex); +static gint getEndIndexCB(AtkHyperlink* aLink); +static gint getStartIndexCB(AtkHyperlink* aLink); +static gboolean isValidCB(AtkHyperlink* aLink); +static gint getAnchorCountCB(AtkHyperlink* aLink); G_END_DECLS static gpointer parent_class = nullptr; -static MaiHyperlink *GetMaiHyperlink(AtkHyperlink *aHyperlink) { +static MaiHyperlink* GetMaiHyperlink(AtkHyperlink* aHyperlink) { NS_ENSURE_TRUE(MAI_IS_ATK_HYPERLINK(aHyperlink), nullptr); - MaiHyperlink *maiHyperlink = MAI_ATK_HYPERLINK(aHyperlink)->maiHyperlink; + MaiHyperlink* maiHyperlink = MAI_ATK_HYPERLINK(aHyperlink)->maiHyperlink; NS_ENSURE_TRUE(maiHyperlink != nullptr, nullptr); NS_ENSURE_TRUE(maiHyperlink->GetAtkHyperlink() == aHyperlink, nullptr); return maiHyperlink; @@ -96,7 +96,7 @@ GType mai_atk_hyperlink_get_type(void) { MaiHyperlink::MaiHyperlink(AccessibleOrProxy aHyperLink) : mHyperlink(aHyperLink), mMaiAtkHyperlink(nullptr) { - mMaiAtkHyperlink = reinterpret_cast( + mMaiAtkHyperlink = reinterpret_cast( g_object_new(mai_atk_hyperlink_get_type(), nullptr)); NS_ASSERTION(mMaiAtkHyperlink, "OUT OF MEMORY"); if (!mMaiAtkHyperlink) return; @@ -113,8 +113,8 @@ MaiHyperlink::~MaiHyperlink() { /* static functions for ATK callbacks */ -void classInitCB(AtkHyperlinkClass *aClass) { - GObjectClass *gobject_class = G_OBJECT_CLASS(aClass); +void classInitCB(AtkHyperlinkClass* aClass) { + GObjectClass* gobject_class = G_OBJECT_CLASS(aClass); parent_class = g_type_class_peek_parent(aClass); @@ -128,11 +128,11 @@ void classInitCB(AtkHyperlinkClass *aClass) { gobject_class->finalize = finalizeCB; } -void finalizeCB(GObject *aObj) { +void finalizeCB(GObject* aObj) { NS_ASSERTION(MAI_IS_ATK_HYPERLINK(aObj), "Invalid MaiAtkHyperlink"); if (!MAI_IS_ATK_HYPERLINK(aObj)) return; - MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aObj); + MaiAtkHyperlink* maiAtkHyperlink = MAI_ATK_HYPERLINK(aObj); maiAtkHyperlink->maiHyperlink = nullptr; /* call parent finalize function */ @@ -140,12 +140,12 @@ void finalizeCB(GObject *aObj) { G_OBJECT_CLASS(parent_class)->finalize(aObj); } -gchar *getUriCB(AtkHyperlink *aLink, gint aLinkIndex) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gchar* getUriCB(AtkHyperlink* aLink, gint aLinkIndex) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return nullptr; nsAutoCString cautoStr; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) { + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) { nsCOMPtr uri = hyperlink->AnchorURIAt(aLinkIndex); if (!uri) return nullptr; @@ -162,28 +162,28 @@ gchar *getUriCB(AtkHyperlink *aLink, gint aLinkIndex) { return g_strdup(cautoStr.get()); } -AtkObject *getObjectCB(AtkHyperlink *aLink, gint aLinkIndex) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +AtkObject* getObjectCB(AtkHyperlink* aLink, gint aLinkIndex) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) { return nullptr; } - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) { - Accessible *anchor = hyperlink->AnchorAt(aLinkIndex); + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) { + Accessible* anchor = hyperlink->AnchorAt(aLinkIndex); NS_ENSURE_TRUE(anchor, nullptr); return AccessibleWrap::GetAtkObject(anchor); } - ProxyAccessible *anchor = maiLink->Proxy()->AnchorAt(aLinkIndex); + ProxyAccessible* anchor = maiLink->Proxy()->AnchorAt(aLinkIndex); return anchor ? GetWrapperFor(anchor) : nullptr; } -gint getEndIndexCB(AtkHyperlink *aLink) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gint getEndIndexCB(AtkHyperlink* aLink) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return false; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) return static_cast(hyperlink->EndOffset()); bool valid = false; @@ -191,11 +191,11 @@ gint getEndIndexCB(AtkHyperlink *aLink) { return valid ? static_cast(endIdx) : -1; } -gint getStartIndexCB(AtkHyperlink *aLink) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gint getStartIndexCB(AtkHyperlink* aLink) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return -1; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) return static_cast(hyperlink->StartOffset()); bool valid = false; @@ -203,21 +203,21 @@ gint getStartIndexCB(AtkHyperlink *aLink) { return valid ? static_cast(startIdx) : -1; } -gboolean isValidCB(AtkHyperlink *aLink) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gboolean isValidCB(AtkHyperlink* aLink) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return false; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) return static_cast(hyperlink->IsLinkValid()); return static_cast(maiLink->Proxy()->IsLinkValid()); } -gint getAnchorCountCB(AtkHyperlink *aLink) { - MaiHyperlink *maiLink = GetMaiHyperlink(aLink); +gint getAnchorCountCB(AtkHyperlink* aLink) { + MaiHyperlink* maiLink = GetMaiHyperlink(aLink); if (!maiLink) return -1; - if (Accessible *hyperlink = maiLink->GetAccHyperlink()) + if (Accessible* hyperlink = maiLink->GetAccHyperlink()) return static_cast(hyperlink->AnchorCount()); bool valid = false; diff --git a/accessible/base/nsCoreUtils.cpp b/accessible/base/nsCoreUtils.cpp index 25518f163408f..a308f6c013e40 100644 --- a/accessible/base/nsCoreUtils.cpp +++ b/accessible/base/nsCoreUtils.cpp @@ -43,16 +43,16 @@ using namespace mozilla; // nsCoreUtils //////////////////////////////////////////////////////////////////////////////// -bool nsCoreUtils::IsLabelWithControl(nsIContent *aContent) { - dom::HTMLLabelElement *label = dom::HTMLLabelElement::FromNode(aContent); +bool nsCoreUtils::IsLabelWithControl(nsIContent* aContent) { + dom::HTMLLabelElement* label = dom::HTMLLabelElement::FromNode(aContent); if (label && label->GetControl()) return true; return false; } -bool nsCoreUtils::HasClickListener(nsIContent *aContent) { +bool nsCoreUtils::HasClickListener(nsIContent* aContent) { NS_ENSURE_TRUE(aContent, false); - EventListenerManager *listenerManager = + EventListenerManager* listenerManager = aContent->GetExistingListenerManager(); return listenerManager && @@ -61,13 +61,13 @@ bool nsCoreUtils::HasClickListener(nsIContent *aContent) { listenerManager->HasListenersFor(nsGkAtoms::onmouseup)); } -void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex, - nsTreeColumn *aColumn, - const nsAString &aPseudoElt) { +void nsCoreUtils::DispatchClickEvent(XULTreeElement* aTree, int32_t aRowIndex, + nsTreeColumn* aColumn, + const nsAString& aPseudoElt) { RefPtr tcElm = aTree->GetTreeBody(); if (!tcElm) return; - Document *document = tcElm->GetUncomposedDoc(); + Document* document = tcElm->GetUncomposedDoc(); if (!document) return; RefPtr presShell = document->GetPresShell(); @@ -92,7 +92,7 @@ void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex, // Dispatch mouse events. AutoWeakFrame tcFrame = tcElm->GetPrimaryFrame(); - nsIFrame *rootFrame = presShell->GetRootFrame(); + nsIFrame* rootFrame = presShell->GetRootFrame(); nsPoint offset; nsCOMPtr rootWidget = @@ -114,9 +114,9 @@ void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex, } void nsCoreUtils::DispatchMouseEvent(EventMessage aMessage, int32_t aX, - int32_t aY, nsIContent *aContent, - nsIFrame *aFrame, PresShell *aPresShell, - nsIWidget *aRootWidget) { + int32_t aY, nsIContent* aContent, + nsIFrame* aFrame, PresShell* aPresShell, + nsIWidget* aRootWidget) { WidgetMouseEvent event(true, aMessage, aRootWidget, WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal); @@ -132,10 +132,10 @@ void nsCoreUtils::DispatchMouseEvent(EventMessage aMessage, int32_t aX, } void nsCoreUtils::DispatchTouchEvent(EventMessage aMessage, int32_t aX, - int32_t aY, nsIContent *aContent, - nsIFrame *aFrame, PresShell *aPresShell, - nsIWidget *aRootWidget) { - nsIDocShell *docShell = nullptr; + int32_t aY, nsIContent* aContent, + nsIFrame* aFrame, PresShell* aPresShell, + nsIWidget* aRootWidget) { + nsIDocShell* docShell = nullptr; if (aPresShell->GetDocument()) { docShell = aPresShell->GetDocument()->GetDocShell(); } @@ -156,7 +156,7 @@ void nsCoreUtils::DispatchTouchEvent(EventMessage aMessage, int32_t aX, aPresShell->HandleEventWithTarget(&event, aFrame, aContent, &status); } -uint32_t nsCoreUtils::GetAccessKeyFor(nsIContent *aContent) { +uint32_t nsCoreUtils::GetAccessKeyFor(nsIContent* aContent) { // Accesskeys are registered by @accesskey attribute only. At first check // whether it is presented on the given element to avoid the slow // EventStateManager::GetRegisteredAccessKey() method. @@ -164,16 +164,16 @@ uint32_t nsCoreUtils::GetAccessKeyFor(nsIContent *aContent) { !aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey)) return 0; - nsPresContext *presContext = aContent->OwnerDoc()->GetPresContext(); + nsPresContext* presContext = aContent->OwnerDoc()->GetPresContext(); if (!presContext) return 0; - EventStateManager *esm = presContext->EventStateManager(); + EventStateManager* esm = presContext->EventStateManager(); if (!esm) return 0; return esm->GetRegisteredAccessKey(aContent->AsElement()); } -nsIContent *nsCoreUtils::GetDOMElementFor(nsIContent *aContent) { +nsIContent* nsCoreUtils::GetDOMElementFor(nsIContent* aContent) { if (aContent->IsElement()) return aContent; if (aContent->IsText()) return aContent->GetFlattenedTreeParent(); @@ -181,7 +181,7 @@ nsIContent *nsCoreUtils::GetDOMElementFor(nsIContent *aContent) { return nullptr; } -nsINode *nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset) { +nsINode* nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode* aNode, uint32_t aOffset) { if (aNode && aNode->IsElement()) { uint32_t childCount = aNode->GetChildCount(); NS_ASSERTION(aOffset <= childCount, "Wrong offset of the DOM point!"); @@ -195,12 +195,12 @@ nsINode *nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset) { return aNode; } -bool nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode, - nsINode *aPossibleDescendantNode, - nsINode *aRootNode) { +bool nsCoreUtils::IsAncestorOf(nsINode* aPossibleAncestorNode, + nsINode* aPossibleDescendantNode, + nsINode* aRootNode) { NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, false); - nsINode *parentNode = aPossibleDescendantNode; + nsINode* parentNode = aPossibleDescendantNode; while ((parentNode = parentNode->GetParentNode()) && parentNode != aRootNode) { if (parentNode == aPossibleAncestorNode) return true; @@ -209,7 +209,7 @@ bool nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode, return false; } -nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, +nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, uint32_t aScrollType) { ScrollAxis vertical, horizontal; ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal); @@ -217,14 +217,14 @@ nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, return ScrollSubstringTo(aFrame, aRange, vertical, horizontal); } -nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, +nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, ScrollAxis aVertical, ScrollAxis aHorizontal) { if (!aFrame || !aRange) { return NS_ERROR_FAILURE; } - nsPresContext *presContext = aFrame->PresContext(); + nsPresContext* presContext = aFrame->PresContext(); nsCOMPtr selCon; aFrame->GetSelectionController(presContext, getter_AddRefs(selCon)); @@ -245,10 +245,10 @@ nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, return NS_OK; } -void nsCoreUtils::ScrollFrameToPoint(nsIFrame *aScrollableFrame, - nsIFrame *aFrame, - const nsIntPoint &aPoint) { - nsIScrollableFrame *scrollableFrame = do_QueryFrame(aScrollableFrame); +void nsCoreUtils::ScrollFrameToPoint(nsIFrame* aScrollableFrame, + nsIFrame* aFrame, + const nsIntPoint& aPoint) { + nsIScrollableFrame* scrollableFrame = do_QueryFrame(aScrollableFrame); if (!scrollableFrame) return; nsPoint point = @@ -263,8 +263,8 @@ void nsCoreUtils::ScrollFrameToPoint(nsIFrame *aScrollableFrame, } void nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType, - ScrollAxis *aVertical, - ScrollAxis *aHorizontal) { + ScrollAxis* aVertical, + ScrollAxis* aHorizontal) { WhereToScroll whereY, whereX; WhenToScroll whenY, whenX; switch (aScrollType) { @@ -314,7 +314,7 @@ void nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType, *aHorizontal = ScrollAxis(whereX, whenX); } -nsIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode *aNode) { +nsIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode* aNode) { nsIntPoint coords(0, 0); nsCOMPtr treeItem(GetDocShellFor(aNode)); if (!treeItem) return coords; @@ -330,14 +330,14 @@ nsIntPoint nsCoreUtils::GetScreenCoordsForWindow(nsINode *aNode) { return coords; } -already_AddRefed nsCoreUtils::GetDocShellFor(nsINode *aNode) { +already_AddRefed nsCoreUtils::GetDocShellFor(nsINode* aNode) { if (!aNode) return nullptr; nsCOMPtr docShell = aNode->OwnerDoc()->GetDocShell(); return docShell.forget(); } -bool nsCoreUtils::IsRootDocument(Document *aDocument) { +bool nsCoreUtils::IsRootDocument(Document* aDocument) { nsCOMPtr docShellTreeItem = aDocument->GetDocShell(); NS_ASSERTION(docShellTreeItem, "No document shell for document!"); @@ -347,14 +347,14 @@ bool nsCoreUtils::IsRootDocument(Document *aDocument) { return !parentTreeItem; } -bool nsCoreUtils::IsContentDocument(Document *aDocument) { +bool nsCoreUtils::IsContentDocument(Document* aDocument) { nsCOMPtr docShellTreeItem = aDocument->GetDocShell(); NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!"); return (docShellTreeItem->ItemType() == nsIDocShellTreeItem::typeContent); } -bool nsCoreUtils::IsTabDocument(Document *aDocumentNode) { +bool nsCoreUtils::IsTabDocument(Document* aDocumentNode) { nsCOMPtr treeItem(aDocumentNode->GetDocShell()); nsCOMPtr parentTreeItem; @@ -370,8 +370,8 @@ bool nsCoreUtils::IsTabDocument(Document *aDocumentNode) { return parentTreeItem == rootTreeItem; } -bool nsCoreUtils::IsErrorPage(Document *aDocument) { - nsIURI *uri = aDocument->GetDocumentURI(); +bool nsCoreUtils::IsErrorPage(Document* aDocument) { + nsIURI* uri = aDocument->GetDocumentURI(); bool isAboutScheme = false; uri->SchemeIs("about", &isAboutScheme); if (!isAboutScheme) return false; @@ -385,13 +385,13 @@ bool nsCoreUtils::IsErrorPage(Document *aDocument) { return StringBeginsWith(path, neterror) || StringBeginsWith(path, certerror); } -bool nsCoreUtils::GetID(nsIContent *aContent, nsAString &aID) { +bool nsCoreUtils::GetID(nsIContent* aContent, nsAString& aID) { return aContent->IsElement() && aContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::id, aID); } -bool nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsAtom *aAttr, - int32_t *aUInt) { +bool nsCoreUtils::GetUIntAttr(nsIContent* aContent, nsAtom* aAttr, + int32_t* aUInt) { nsAutoString value; if (!aContent->IsElement()) { return false; @@ -409,11 +409,11 @@ bool nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsAtom *aAttr, return false; } -void nsCoreUtils::GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent, - nsAString &aLanguage) { +void nsCoreUtils::GetLanguageFor(nsIContent* aContent, nsIContent* aRootContent, + nsAString& aLanguage) { aLanguage.Truncate(); - nsIContent *walkUp = aContent; + nsIContent* walkUp = aContent; while (walkUp && walkUp != aRootContent && (!walkUp->IsElement() || !walkUp->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::lang, @@ -421,9 +421,9 @@ void nsCoreUtils::GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent, walkUp = walkUp->GetParent(); } -XULTreeElement *nsCoreUtils::GetTree(nsIContent *aContent) { +XULTreeElement* nsCoreUtils::GetTree(nsIContent* aContent) { // Find DOMNode's parents recursively until reach the tag - nsIContent *currentContent = aContent; + nsIContent* currentContent = aContent; while (currentContent) { if (currentContent->NodeInfo()->Equals(nsGkAtoms::tree, kNameSpaceID_XUL)) { return XULTreeElement::FromNode(currentContent); @@ -435,7 +435,7 @@ XULTreeElement *nsCoreUtils::GetTree(nsIContent *aContent) { } already_AddRefed nsCoreUtils::GetFirstSensibleColumn( - XULTreeElement *aTree) { + XULTreeElement* aTree) { RefPtr cols = aTree->GetColumns(); if (!cols) return nullptr; @@ -445,13 +445,13 @@ already_AddRefed nsCoreUtils::GetFirstSensibleColumn( return column.forget(); } -uint32_t nsCoreUtils::GetSensibleColumnCount(XULTreeElement *aTree) { +uint32_t nsCoreUtils::GetSensibleColumnCount(XULTreeElement* aTree) { uint32_t count = 0; RefPtr cols = aTree->GetColumns(); if (!cols) return count; - nsTreeColumn *column = cols->GetFirstColumn(); + nsTreeColumn* column = cols->GetFirstColumn(); while (column) { if (!IsColumnHidden(column)) count++; @@ -463,7 +463,7 @@ uint32_t nsCoreUtils::GetSensibleColumnCount(XULTreeElement *aTree) { } already_AddRefed nsCoreUtils::GetSensibleColumnAt( - XULTreeElement *aTree, uint32_t aIndex) { + XULTreeElement* aTree, uint32_t aIndex) { uint32_t idx = aIndex; nsCOMPtr column = GetFirstSensibleColumn(aTree); @@ -478,7 +478,7 @@ already_AddRefed nsCoreUtils::GetSensibleColumnAt( } already_AddRefed nsCoreUtils::GetNextSensibleColumn( - nsTreeColumn *aColumn) { + nsTreeColumn* aColumn) { RefPtr nextColumn = aColumn->GetNext(); while (nextColumn && IsColumnHidden(nextColumn)) { @@ -489,7 +489,7 @@ already_AddRefed nsCoreUtils::GetNextSensibleColumn( } already_AddRefed nsCoreUtils::GetPreviousSensibleColumn( - nsTreeColumn *aColumn) { + nsTreeColumn* aColumn) { RefPtr prevColumn = aColumn->GetPrevious(); while (prevColumn && IsColumnHidden(prevColumn)) { @@ -499,13 +499,13 @@ already_AddRefed nsCoreUtils::GetPreviousSensibleColumn( return prevColumn.forget(); } -bool nsCoreUtils::IsColumnHidden(nsTreeColumn *aColumn) { - Element *element = aColumn->Element(); +bool nsCoreUtils::IsColumnHidden(nsTreeColumn* aColumn) { + Element* element = aColumn->Element(); return element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden, nsGkAtoms::_true, eCaseMatters); } -void nsCoreUtils::ScrollTo(PresShell *aPresShell, nsIContent *aContent, +void nsCoreUtils::ScrollTo(PresShell* aPresShell, nsIContent* aContent, uint32_t aScrollType) { ScrollAxis vertical, horizontal; ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal); @@ -513,7 +513,7 @@ void nsCoreUtils::ScrollTo(PresShell *aPresShell, nsIContent *aContent, ScrollFlags::ScrollOverflowHidden); } -bool nsCoreUtils::IsWhitespaceString(const nsAString &aString) { +bool nsCoreUtils::IsWhitespaceString(const nsAString& aString) { nsAString::const_char_iterator iterBegin, iterEnd; aString.BeginReading(iterBegin); diff --git a/accessible/base/nsCoreUtils.h b/accessible/base/nsCoreUtils.h index 036416cd8a0ca..3e237def98135 100644 --- a/accessible/base/nsCoreUtils.h +++ b/accessible/base/nsCoreUtils.h @@ -39,13 +39,13 @@ class nsCoreUtils { /** * Return true if the given node is a label of a control. */ - static bool IsLabelWithControl(nsIContent *aContent); + static bool IsLabelWithControl(nsIContent* aContent); /** * Return true if the given node has registered click, mousedown or mouseup * event listeners. */ - static bool HasClickListener(nsIContent *aContent); + static bool HasClickListener(nsIContent* aContent); /** * Dispatch click event to XUL tree cell. @@ -57,9 +57,9 @@ class nsCoreUtils { * XULTreeElement for available values */ MOZ_CAN_RUN_SCRIPT - static void DispatchClickEvent(mozilla::dom::XULTreeElement *aTree, - int32_t aRowIndex, nsTreeColumn *aColumn, - const nsAString &aPseudoElt = EmptyString()); + static void DispatchClickEvent(mozilla::dom::XULTreeElement* aTree, + int32_t aRowIndex, nsTreeColumn* aColumn, + const nsAString& aPseudoElt = EmptyString()); /** * Send mouse event to the given element. @@ -74,9 +74,9 @@ class nsCoreUtils { */ MOZ_CAN_RUN_SCRIPT static void DispatchMouseEvent(mozilla::EventMessage aMessage, int32_t aX, - int32_t aY, nsIContent *aContent, - nsIFrame *aFrame, PresShell *aPresShell, - nsIWidget *aRootWidget); + int32_t aY, nsIContent* aContent, + nsIFrame* aFrame, PresShell* aPresShell, + nsIWidget* aRootWidget); /** * Send a touch event with a single touch point to the given element. @@ -91,9 +91,9 @@ class nsCoreUtils { */ MOZ_CAN_RUN_SCRIPT static void DispatchTouchEvent(mozilla::EventMessage aMessage, int32_t aX, - int32_t aY, nsIContent *aContent, - nsIFrame *aFrame, PresShell *aPresShell, - nsIWidget *aRootWidget); + int32_t aY, nsIContent* aContent, + nsIFrame* aFrame, PresShell* aPresShell, + nsIWidget* aRootWidget); /** * Return an accesskey registered on the given element by @@ -101,7 +101,7 @@ class nsCoreUtils { * * @param aContent - the given element. */ - static uint32_t GetAccessKeyFor(nsIContent *aContent); + static uint32_t GetAccessKeyFor(nsIContent* aContent); /** * Return DOM element related with the given node, i.e. @@ -111,12 +111,12 @@ class nsCoreUtils { * * @param aNode [in] the given DOM node */ - static nsIContent *GetDOMElementFor(nsIContent *aContent); + static nsIContent* GetDOMElementFor(nsIContent* aContent); /** * Return DOM node for the given DOM point. */ - static nsINode *GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset); + static nsINode* GetDOMNodeFromDOMPoint(nsINode* aNode, uint32_t aOffset); /** * Is the first passed in node an ancestor of the second? @@ -131,9 +131,9 @@ class nsCoreUtils { * @return true if aPossibleAncestorNode is an ancestor of * aPossibleDescendantNode */ - static bool IsAncestorOf(nsINode *aPossibleAncestorNode, - nsINode *aPossibleDescendantNode, - nsINode *aRootNode = nullptr); + static bool IsAncestorOf(nsINode* aPossibleAncestorNode, + nsINode* aPossibleDescendantNode, + nsINode* aRootNode = nullptr); /** * Helper method to scroll range into view, used for implementation of @@ -143,7 +143,7 @@ class nsCoreUtils { * @param aRange the range to scroll to * @param aScrollType the place a range should be scrolled to */ - static nsresult ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, + static nsresult ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, uint32_t aScrollType); /** Helper method to scroll range into view, used for implementation of @@ -156,7 +156,7 @@ class nsCoreUtils { * @param aHorizontal how to align horizontally, specified in percents, * and when. */ - static nsresult ScrollSubstringTo(nsIFrame *aFrame, nsRange *aRange, + static nsresult ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, mozilla::ScrollAxis aVertical, mozilla::ScrollAxis aHorizontal); @@ -168,16 +168,16 @@ class nsCoreUtils { * @param aFrame the frame to scroll * @param aPoint the point scroll to */ - static void ScrollFrameToPoint(nsIFrame *aScrollableFrame, nsIFrame *aFrame, - const nsIntPoint &aPoint); + static void ScrollFrameToPoint(nsIFrame* aScrollableFrame, nsIFrame* aFrame, + const nsIntPoint& aPoint); /** * Converts scroll type constant defined in nsIAccessibleScrollType to * vertical and horizontal parameters. */ static void ConvertScrollTypeToPercents(uint32_t aScrollType, - mozilla::ScrollAxis *aVertical, - mozilla::ScrollAxis *aHorizontal); + mozilla::ScrollAxis* aVertical, + mozilla::ScrollAxis* aHorizontal); /** * Returns coordinates in device pixels relative screen for the top level @@ -185,37 +185,37 @@ class nsCoreUtils { * * @param aNode the DOM node hosted in the window. */ - static nsIntPoint GetScreenCoordsForWindow(nsINode *aNode); + static nsIntPoint GetScreenCoordsForWindow(nsINode* aNode); /** * Return document shell for the given DOM node. */ - static already_AddRefed GetDocShellFor(nsINode *aNode); + static already_AddRefed GetDocShellFor(nsINode* aNode); /** * Return true if the given document is root document. */ - static bool IsRootDocument(Document *aDocument); + static bool IsRootDocument(Document* aDocument); /** * Return true if the given document is content document (not chrome). */ - static bool IsContentDocument(Document *aDocument); + static bool IsContentDocument(Document* aDocument); /** * Return true if the given document node is for tab document accessible. */ - static bool IsTabDocument(Document *aDocumentNode); + static bool IsTabDocument(Document* aDocumentNode); /** * Return true if the given document is an error page. */ - static bool IsErrorPage(Document *aDocument); + static bool IsErrorPage(Document* aDocument); /** * Return presShell for the document containing the given DOM node. */ - static PresShell *GetPresShellFor(nsINode *aNode) { + static PresShell* GetPresShellFor(nsINode* aNode) { return aNode->OwnerDoc()->GetPresShell(); } @@ -226,13 +226,13 @@ class nsCoreUtils { * @param aID Where to put ID string * @return true if there is an ID set for this node */ - static bool GetID(nsIContent *aContent, nsAString &aID); + static bool GetID(nsIContent* aContent, nsAString& aID); /** * Convert attribute value of the given node to positive integer. If no * attribute or wrong value then false is returned. */ - static bool GetUIntAttr(nsIContent *aContent, nsAtom *aAttr, int32_t *aUInt); + static bool GetUIntAttr(nsIContent* aContent, nsAtom* aAttr, int32_t* aUInt); /** * Returns language for the given node. @@ -241,59 +241,59 @@ class nsCoreUtils { * @param aRootContent [in] container of the given node * @param aLanguage [out] language */ - static void GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent, - nsAString &aLanguage); + static void GetLanguageFor(nsIContent* aContent, nsIContent* aRootContent, + nsAString& aLanguage); /** * Return tree from any levels DOMNode under the XUL tree. */ - static mozilla::dom::XULTreeElement *GetTree(nsIContent *aContent); + static mozilla::dom::XULTreeElement* GetTree(nsIContent* aContent); /** * Return first sensible column for the given tree box object. */ static already_AddRefed GetFirstSensibleColumn( - mozilla::dom::XULTreeElement *aTree); + mozilla::dom::XULTreeElement* aTree); /** * Return sensible columns count for the given tree box object. */ - static uint32_t GetSensibleColumnCount(mozilla::dom::XULTreeElement *aTree); + static uint32_t GetSensibleColumnCount(mozilla::dom::XULTreeElement* aTree); /** * Return sensible column at the given index for the given tree box object. */ static already_AddRefed GetSensibleColumnAt( - mozilla::dom::XULTreeElement *aTree, uint32_t aIndex); + mozilla::dom::XULTreeElement* aTree, uint32_t aIndex); /** * Return next sensible column for the given column. */ static already_AddRefed GetNextSensibleColumn( - nsTreeColumn *aColumn); + nsTreeColumn* aColumn); /** * Return previous sensible column for the given column. */ static already_AddRefed GetPreviousSensibleColumn( - nsTreeColumn *aColumn); + nsTreeColumn* aColumn); /** * Return true if the given column is hidden (i.e. not sensible). */ - static bool IsColumnHidden(nsTreeColumn *aColumn); + static bool IsColumnHidden(nsTreeColumn* aColumn); /** * Scroll content into view. */ MOZ_CAN_RUN_SCRIPT - static void ScrollTo(PresShell *aPresShell, nsIContent *aContent, + static void ScrollTo(PresShell* aPresShell, nsIContent* aContent, uint32_t aScrollType); /** * Return true if the given node is table header element. */ - static bool IsHTMLTableHeader(nsIContent *aContent) { + static bool IsHTMLTableHeader(nsIContent* aContent) { return aContent->NodeInfo()->Equals(nsGkAtoms::th) || (aContent->IsElement() && aContent->AsElement()->HasAttr( kNameSpaceID_None, nsGkAtoms::scope)); @@ -304,7 +304,7 @@ class nsCoreUtils { * only. In contrast to nsWhitespaceTokenizer class it takes into account * non-breaking space (0xa0). */ - static bool IsWhitespaceString(const nsAString &aString); + static bool IsWhitespaceString(const nsAString& aString); /** * Returns true if the given character is whitespace symbol. diff --git a/accessible/base/nsTextEquivUtils.h b/accessible/base/nsTextEquivUtils.h index e655f5b3b0f2a..6ff4e1384b805 100644 --- a/accessible/base/nsTextEquivUtils.h +++ b/accessible/base/nsTextEquivUtils.h @@ -48,7 +48,7 @@ class nsTextEquivUtils { * @param aRule [in] a given name rule * @return true if the accessible has the rule */ - static inline bool HasNameRule(Accessible *aAccessible, + static inline bool HasNameRule(Accessible* aAccessible, ETextEquivRule aRule) { return (GetRoleRule(aAccessible->Role()) & aRule) == aRule; } @@ -59,15 +59,15 @@ class nsTextEquivUtils { * @param aAccessible [in] the given accessible * @param aName [out] accessible name */ - static nsresult GetNameFromSubtree(const Accessible *aAccessible, - nsAString &aName); + static nsresult GetNameFromSubtree(const Accessible* aAccessible, + nsAString& aName); /** * Calculates text equivalent from the subtree. Similar to GetNameFromSubtree. * However it returns not empty result for things like HTML p. */ - static void GetTextEquivFromSubtree(const Accessible *aAccessible, - nsString &aTextEquiv) { + static void GetTextEquivFromSubtree(const Accessible* aAccessible, + nsString& aTextEquiv) { aTextEquiv.Truncate(); AppendFromAccessibleChildren(aAccessible, &aTextEquiv); @@ -82,9 +82,9 @@ class nsTextEquivUtils { * @param aIDRefsAttr [in] IDRefs attribute on DOM node of the accessible * @param aTextEquiv [out] result text equivalent */ - static nsresult GetTextEquivFromIDRefs(const Accessible *aAccessible, - nsAtom *aIDRefsAttr, - nsAString &aTextEquiv); + static nsresult GetTextEquivFromIDRefs(const Accessible* aAccessible, + nsAtom* aIDRefsAttr, + nsAString& aTextEquiv); /** * Calculates the text equivalent from the given content and its subtree if @@ -97,9 +97,9 @@ class nsTextEquivUtils { * computed from * @param aString [in, out] the string */ - static nsresult AppendTextEquivFromContent(const Accessible *aInitiatorAcc, - nsIContent *aContent, - nsAString *aString); + static nsresult AppendTextEquivFromContent(const Accessible* aInitiatorAcc, + nsIContent* aContent, + nsAString* aString); /** * Calculates the text equivalent from the given text content (may be text @@ -108,46 +108,46 @@ class nsTextEquivUtils { * @param aContent [in] the text content * @param aString [in, out] the string */ - static nsresult AppendTextEquivFromTextContent(nsIContent *aContent, - nsAString *aString); + static nsresult AppendTextEquivFromTextContent(nsIContent* aContent, + nsAString* aString); private: /** * Iterates accessible children and calculates text equivalent from each * child. */ - static nsresult AppendFromAccessibleChildren(const Accessible *aAccessible, - nsAString *aString); + static nsresult AppendFromAccessibleChildren(const Accessible* aAccessible, + nsAString* aString); /** * Calculates text equivalent from the given accessible and its subtree if * allowed. */ - static nsresult AppendFromAccessible(Accessible *aAccessible, - nsAString *aString); + static nsresult AppendFromAccessible(Accessible* aAccessible, + nsAString* aString); /** * Calculates text equivalent from the value of given accessible. */ - static nsresult AppendFromValue(Accessible *aAccessible, nsAString *aString); + static nsresult AppendFromValue(Accessible* aAccessible, nsAString* aString); /** * Iterates DOM children and calculates text equivalent from each child node. */ - static nsresult AppendFromDOMChildren(nsIContent *aContent, - nsAString *aString); + static nsresult AppendFromDOMChildren(nsIContent* aContent, + nsAString* aString); /** * Calculates text equivalent from the given DOM node and its subtree if * allowed. */ - static nsresult AppendFromDOMNode(nsIContent *aContent, nsAString *aString); + static nsresult AppendFromDOMNode(nsIContent* aContent, nsAString* aString); /** * Concatenates strings and appends space between them. Returns true if * text equivalent string was appended. */ - static bool AppendString(nsAString *aString, - const nsAString &aTextEquivalent); + static bool AppendString(nsAString* aString, + const nsAString& aTextEquivalent); /** * Returns the rule (constant of ETextEquivRule) for a given role. diff --git a/accessible/interfaces/msaa/AccessibleMarshalThunk.c b/accessible/interfaces/msaa/AccessibleMarshalThunk.c index 8b3d2b67e808c..481223ed13633 100644 --- a/accessible/interfaces/msaa/AccessibleMarshalThunk.c +++ b/accessible/interfaces/msaa/AccessibleMarshalThunk.c @@ -7,11 +7,11 @@ #include "ISimpleDOM.h" HRESULT STDMETHODCALLTYPE ISimpleDOMNode_get_localInterface_Proxy( - ISimpleDOMNode *This, void **localInterface) { + ISimpleDOMNode* This, void** localInterface) { return E_NOTIMPL; } HRESULT STDMETHODCALLTYPE ISimpleDOMNode_get_localInterface_Stub( - ISimpleDOMNode *This, IUnknown **localInterface) { + ISimpleDOMNode* This, IUnknown** localInterface) { return E_NOTIMPL; } diff --git a/accessible/ipc/win/handler/HandlerTextLeaf.cpp b/accessible/ipc/win/handler/HandlerTextLeaf.cpp index 8e6b95e711db6..730aa88df9093 100644 --- a/accessible/ipc/win/handler/HandlerTextLeaf.cpp +++ b/accessible/ipc/win/handler/HandlerTextLeaf.cpp @@ -14,8 +14,8 @@ namespace mozilla { namespace a11y { -HandlerTextLeaf::HandlerTextLeaf(IDispatch *aParent, long aIndexInParent, - HWND aHwnd, AccChildData &aData) +HandlerTextLeaf::HandlerTextLeaf(IDispatch* aParent, long aIndexInParent, + HWND aHwnd, AccChildData& aData) : mParent(aParent), mIndexInParent(aIndexInParent), mHwnd(aHwnd), @@ -39,31 +39,31 @@ IMPL_IUNKNOWN_QUERY_TAIL /*** IDispatch ***/ HRESULT -HandlerTextLeaf::GetTypeInfoCount(UINT *pctinfo) { return E_NOTIMPL; } +HandlerTextLeaf::GetTypeInfoCount(UINT* pctinfo) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { +HandlerTextLeaf::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) { +HandlerTextLeaf::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, + LCID lcid, DISPID* rgDispId) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, - WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, - UINT *puArgErr) { + WORD wFlags, DISPPARAMS* pDispParams, + VARIANT* pVarResult, EXCEPINFO* pExcepInfo, + UINT* puArgErr) { return E_NOTIMPL; } /*** IAccessible ***/ HRESULT -HandlerTextLeaf::get_accParent(IDispatch **ppdispParent) { +HandlerTextLeaf::get_accParent(IDispatch** ppdispParent) { if (!ppdispParent) { return E_INVALIDARG; } @@ -74,7 +74,7 @@ HandlerTextLeaf::get_accParent(IDispatch **ppdispParent) { } HRESULT -HandlerTextLeaf::get_accChildCount(long *pcountChildren) { +HandlerTextLeaf::get_accChildCount(long* pcountChildren) { if (!pcountChildren) { return E_INVALIDARG; } @@ -84,12 +84,12 @@ HandlerTextLeaf::get_accChildCount(long *pcountChildren) { } HRESULT -HandlerTextLeaf::get_accChild(VARIANT varChild, IDispatch **ppdispChild) { +HandlerTextLeaf::get_accChild(VARIANT varChild, IDispatch** ppdispChild) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accName(VARIANT varChild, BSTR *pszName) { +HandlerTextLeaf::get_accName(VARIANT varChild, BSTR* pszName) { if (varChild.lVal != CHILDID_SELF || !pszName) { return E_INVALIDARG; } @@ -99,17 +99,17 @@ HandlerTextLeaf::get_accName(VARIANT varChild, BSTR *pszName) { } HRESULT -HandlerTextLeaf::get_accValue(VARIANT varChild, BSTR *pszValue) { +HandlerTextLeaf::get_accValue(VARIANT varChild, BSTR* pszValue) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accDescription(VARIANT varChild, BSTR *pszDescription) { +HandlerTextLeaf::get_accDescription(VARIANT varChild, BSTR* pszDescription) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accRole(VARIANT varChild, VARIANT *pvarRole) { +HandlerTextLeaf::get_accRole(VARIANT varChild, VARIANT* pvarRole) { if (varChild.lVal != CHILDID_SELF || !pvarRole) { return E_INVALIDARG; } @@ -120,7 +120,7 @@ HandlerTextLeaf::get_accRole(VARIANT varChild, VARIANT *pvarRole) { } HRESULT -HandlerTextLeaf::get_accState(VARIANT varChild, VARIANT *pvarState) { +HandlerTextLeaf::get_accState(VARIANT varChild, VARIANT* pvarState) { if (varChild.lVal != CHILDID_SELF || !pvarState) { return E_INVALIDARG; } @@ -131,31 +131,31 @@ HandlerTextLeaf::get_accState(VARIANT varChild, VARIANT *pvarState) { } HRESULT -HandlerTextLeaf::get_accHelp(VARIANT varChild, BSTR *pszHelp) { +HandlerTextLeaf::get_accHelp(VARIANT varChild, BSTR* pszHelp) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, - long *pidTopic) { +HandlerTextLeaf::get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, + long* pidTopic) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_accKeyboardShortcut(VARIANT varChild, - BSTR *pszKeyboardShortcut) { + BSTR* pszKeyboardShortcut) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accFocus(VARIANT *pvarChild) { return E_NOTIMPL; } +HandlerTextLeaf::get_accFocus(VARIANT* pvarChild) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_accSelection(VARIANT *pvarChildren) { return E_NOTIMPL; } +HandlerTextLeaf::get_accSelection(VARIANT* pvarChildren) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_accDefaultAction(VARIANT varChild, - BSTR *pszDefaultAction) { + BSTR* pszDefaultAction) { return E_NOTIMPL; } @@ -165,8 +165,8 @@ HandlerTextLeaf::accSelect(long flagsSelect, VARIANT varChild) { } HRESULT -HandlerTextLeaf::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, - long *pcyHeight, VARIANT varChild) { +HandlerTextLeaf::accLocation(long* pxLeft, long* pyTop, long* pcxWidth, + long* pcyHeight, VARIANT varChild) { if (varChild.lVal != CHILDID_SELF || !pxLeft || !pyTop || !pcxWidth || !pcyHeight) { return E_INVALIDARG; @@ -181,12 +181,12 @@ HandlerTextLeaf::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, HRESULT HandlerTextLeaf::accNavigate(long navDir, VARIANT varStart, - VARIANT *pvarEndUpAt) { + VARIANT* pvarEndUpAt) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::accHitTest(long xLeft, long yTop, VARIANT *pvarChild) { +HandlerTextLeaf::accHitTest(long xLeft, long yTop, VARIANT* pvarChild) { return E_NOTIMPL; } @@ -206,23 +206,23 @@ HandlerTextLeaf::put_accValue(VARIANT varChild, BSTR szValue) { /*** IAccessible2 ***/ HRESULT -HandlerTextLeaf::get_nRelations(long *nRelations) { return E_NOTIMPL; } +HandlerTextLeaf::get_nRelations(long* nRelations) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_relation(long relationIndex, - IAccessibleRelation **relation) { + IAccessibleRelation** relation) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_relations(long maxRelations, - IAccessibleRelation **relations, - long *nRelations) { + IAccessibleRelation** relations, + long* nRelations) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::role(long *role) { +HandlerTextLeaf::role(long* role) { if (!role) { return E_INVALIDARG; } @@ -241,13 +241,13 @@ HandlerTextLeaf::scrollToPoint(IA2CoordinateType coordinateType, long x, } HRESULT -HandlerTextLeaf::get_groupPosition(long *groupLevel, long *similarItemsInGroup, - long *positionInGroup) { +HandlerTextLeaf::get_groupPosition(long* groupLevel, long* similarItemsInGroup, + long* positionInGroup) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_states(AccessibleStates *states) { +HandlerTextLeaf::get_states(AccessibleStates* states) { if (!states) { return E_INVALIDARG; } @@ -257,34 +257,34 @@ HandlerTextLeaf::get_states(AccessibleStates *states) { } HRESULT -HandlerTextLeaf::get_extendedRole(BSTR *extendedRole) { return E_NOTIMPL; } +HandlerTextLeaf::get_extendedRole(BSTR* extendedRole) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_localizedExtendedRole(BSTR *localizedExtendedRole) { +HandlerTextLeaf::get_localizedExtendedRole(BSTR* localizedExtendedRole) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_nExtendedStates(long *nExtendedStates) { +HandlerTextLeaf::get_nExtendedStates(long* nExtendedStates) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_extendedStates(long maxExtendedStates, - BSTR **extendedStates, - long *nExtendedStates) { + BSTR** extendedStates, + long* nExtendedStates) { return E_NOTIMPL; } HRESULT HandlerTextLeaf::get_localizedExtendedStates(long maxLocalizedExtendedStates, - BSTR **localizedExtendedStates, - long *nLocalizedExtendedStates) { + BSTR** localizedExtendedStates, + long* nLocalizedExtendedStates) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_uniqueID(long *uniqueID) { +HandlerTextLeaf::get_uniqueID(long* uniqueID) { if (!uniqueID) { return E_INVALIDARG; } @@ -294,7 +294,7 @@ HandlerTextLeaf::get_uniqueID(long *uniqueID) { } HRESULT -HandlerTextLeaf::get_windowHandle(HWND *windowHandle) { +HandlerTextLeaf::get_windowHandle(HWND* windowHandle) { if (!windowHandle) { return E_INVALIDARG; } @@ -304,7 +304,7 @@ HandlerTextLeaf::get_windowHandle(HWND *windowHandle) { } HRESULT -HandlerTextLeaf::get_indexInParent(long *indexInParent) { +HandlerTextLeaf::get_indexInParent(long* indexInParent) { if (!indexInParent) { return E_INVALIDARG; } @@ -314,16 +314,16 @@ HandlerTextLeaf::get_indexInParent(long *indexInParent) { } HRESULT -HandlerTextLeaf::get_locale(IA2Locale *locale) { return E_NOTIMPL; } +HandlerTextLeaf::get_locale(IA2Locale* locale) { return E_NOTIMPL; } HRESULT -HandlerTextLeaf::get_attributes(BSTR *attributes) { return E_NOTIMPL; } +HandlerTextLeaf::get_attributes(BSTR* attributes) { return E_NOTIMPL; } /*** IServiceProvider ***/ HRESULT HandlerTextLeaf::QueryService(REFGUID aServiceId, REFIID aIid, - void **aOutInterface) { + void** aOutInterface) { if (aIid == IID_IAccessible2) { RefPtr ia2(this); ia2.forget(aOutInterface); diff --git a/accessible/ipc/win/handler/HandlerTextLeaf.h b/accessible/ipc/win/handler/HandlerTextLeaf.h index e23a7777a1e29..f1a31b9219948 100644 --- a/accessible/ipc/win/handler/HandlerTextLeaf.h +++ b/accessible/ipc/win/handler/HandlerTextLeaf.h @@ -20,80 +20,80 @@ namespace a11y { class HandlerTextLeaf final : public IAccessible2, public IServiceProvider { public: - explicit HandlerTextLeaf(IDispatch *aParent, long aIndexInParent, HWND aHwnd, - AccChildData &aData); + explicit HandlerTextLeaf(IDispatch* aParent, long aIndexInParent, HWND aHwnd, + AccChildData& aData); DECL_IUNKNOWN // IDispatch - STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) override; + STDMETHODIMP GetTypeInfoCount(UINT* pctinfo) override; STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, - ITypeInfo **ppTInfo) override; - STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) override; + ITypeInfo** ppTInfo) override; + STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, + LCID lcid, DISPID* rgDispId) override; STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, - DISPPARAMS *pDispParams, VARIANT *pVarResult, - EXCEPINFO *pExcepInfo, UINT *puArgErr) override; + DISPPARAMS* pDispParams, VARIANT* pVarResult, + EXCEPINFO* pExcepInfo, UINT* puArgErr) override; // IAccessible - STDMETHODIMP get_accParent(IDispatch **ppdispParent) override; - STDMETHODIMP get_accChildCount(long *pcountChildren) override; - STDMETHODIMP get_accChild(VARIANT varChild, IDispatch **ppdispChild) override; - STDMETHODIMP get_accName(VARIANT varChild, BSTR *pszName) override; - STDMETHODIMP get_accValue(VARIANT varChild, BSTR *pszValue) override; + STDMETHODIMP get_accParent(IDispatch** ppdispParent) override; + STDMETHODIMP get_accChildCount(long* pcountChildren) override; + STDMETHODIMP get_accChild(VARIANT varChild, IDispatch** ppdispChild) override; + STDMETHODIMP get_accName(VARIANT varChild, BSTR* pszName) override; + STDMETHODIMP get_accValue(VARIANT varChild, BSTR* pszValue) override; STDMETHODIMP get_accDescription(VARIANT varChild, - BSTR *pszDescription) override; - STDMETHODIMP get_accRole(VARIANT varChild, VARIANT *pvarRole) override; - STDMETHODIMP get_accState(VARIANT varChild, VARIANT *pvarState) override; - STDMETHODIMP get_accHelp(VARIANT varChild, BSTR *pszHelp) override; - STDMETHODIMP get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, - long *pidTopic) override; + BSTR* pszDescription) override; + STDMETHODIMP get_accRole(VARIANT varChild, VARIANT* pvarRole) override; + STDMETHODIMP get_accState(VARIANT varChild, VARIANT* pvarState) override; + STDMETHODIMP get_accHelp(VARIANT varChild, BSTR* pszHelp) override; + STDMETHODIMP get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, + long* pidTopic) override; STDMETHODIMP get_accKeyboardShortcut(VARIANT varChild, - BSTR *pszKeyboardShortcut) override; - STDMETHODIMP get_accFocus(VARIANT *pvarChild) override; - STDMETHODIMP get_accSelection(VARIANT *pvarChildren) override; + BSTR* pszKeyboardShortcut) override; + STDMETHODIMP get_accFocus(VARIANT* pvarChild) override; + STDMETHODIMP get_accSelection(VARIANT* pvarChildren) override; STDMETHODIMP get_accDefaultAction(VARIANT varChild, - BSTR *pszDefaultAction) override; + BSTR* pszDefaultAction) override; STDMETHODIMP accSelect(long flagsSelect, VARIANT varChild) override; - STDMETHODIMP accLocation(long *pxLeft, long *pyTop, long *pcxWidth, - long *pcyHeight, VARIANT varChild) override; + STDMETHODIMP accLocation(long* pxLeft, long* pyTop, long* pcxWidth, + long* pcyHeight, VARIANT varChild) override; STDMETHODIMP accNavigate(long navDir, VARIANT varStart, - VARIANT *pvarEndUpAt) override; - STDMETHODIMP accHitTest(long xLeft, long yTop, VARIANT *pvarChild) override; + VARIANT* pvarEndUpAt) override; + STDMETHODIMP accHitTest(long xLeft, long yTop, VARIANT* pvarChild) override; STDMETHODIMP accDoDefaultAction(VARIANT varChild) override; STDMETHODIMP put_accName(VARIANT varChild, BSTR szName) override; STDMETHODIMP put_accValue(VARIANT varChild, BSTR szValue) override; // IAccessible2 - STDMETHODIMP get_nRelations(long *nRelations) override; + STDMETHODIMP get_nRelations(long* nRelations) override; STDMETHODIMP get_relation(long relationIndex, - IAccessibleRelation **relation) override; - STDMETHODIMP get_relations(long maxRelations, IAccessibleRelation **relations, - long *nRelations) override; - STDMETHODIMP role(long *role) override; + IAccessibleRelation** relation) override; + STDMETHODIMP get_relations(long maxRelations, IAccessibleRelation** relations, + long* nRelations) override; + STDMETHODIMP role(long* role) override; STDMETHODIMP scrollTo(IA2ScrollType scrollType) override; STDMETHODIMP scrollToPoint(IA2CoordinateType coordinateType, long x, long y) override; - STDMETHODIMP get_groupPosition(long *groupLevel, long *similarItemsInGroup, - long *positionInGroup) override; - STDMETHODIMP get_states(AccessibleStates *states) override; - STDMETHODIMP get_extendedRole(BSTR *extendedRole) override; - STDMETHODIMP get_localizedExtendedRole(BSTR *localizedExtendedRole) override; - STDMETHODIMP get_nExtendedStates(long *nExtendedStates) override; - STDMETHODIMP get_extendedStates(long maxExtendedStates, BSTR **extendedStates, - long *nExtendedStates) override; + STDMETHODIMP get_groupPosition(long* groupLevel, long* similarItemsInGroup, + long* positionInGroup) override; + STDMETHODIMP get_states(AccessibleStates* states) override; + STDMETHODIMP get_extendedRole(BSTR* extendedRole) override; + STDMETHODIMP get_localizedExtendedRole(BSTR* localizedExtendedRole) override; + STDMETHODIMP get_nExtendedStates(long* nExtendedStates) override; + STDMETHODIMP get_extendedStates(long maxExtendedStates, BSTR** extendedStates, + long* nExtendedStates) override; STDMETHODIMP get_localizedExtendedStates( - long maxLocalizedExtendedStates, BSTR **localizedExtendedStates, - long *nLocalizedExtendedStates) override; - STDMETHODIMP get_uniqueID(long *uniqueID) override; - STDMETHODIMP get_windowHandle(HWND *windowHandle) override; - STDMETHODIMP get_indexInParent(long *indexInParent) override; - STDMETHODIMP get_locale(IA2Locale *locale) override; - STDMETHODIMP get_attributes(BSTR *attributes) override; + long maxLocalizedExtendedStates, BSTR** localizedExtendedStates, + long* nLocalizedExtendedStates) override; + STDMETHODIMP get_uniqueID(long* uniqueID) override; + STDMETHODIMP get_windowHandle(HWND* windowHandle) override; + STDMETHODIMP get_indexInParent(long* indexInParent) override; + STDMETHODIMP get_locale(IA2Locale* locale) override; + STDMETHODIMP get_attributes(BSTR* attributes) override; // IServiceProvider STDMETHODIMP QueryService(REFGUID aServiceId, REFIID aIid, - void **aOutInterface) override; + void** aOutInterface) override; private: ~HandlerTextLeaf(); diff --git a/accessible/windows/ia2/ia2AccessibleAction.h b/accessible/windows/ia2/ia2AccessibleAction.h index dfc131cff0cdb..e85c3458440fe 100644 --- a/accessible/windows/ia2/ia2AccessibleAction.h +++ b/accessible/windows/ia2/ia2AccessibleAction.h @@ -18,39 +18,39 @@ namespace a11y { class ia2AccessibleAction : public IAccessibleAction { public: // IUnknown - STDMETHODIMP QueryInterface(REFIID, void **); + STDMETHODIMP QueryInterface(REFIID, void**); // IAccessibleAction virtual HRESULT STDMETHODCALLTYPE nActions( - /* [retval][out] */ long *nActions); + /* [retval][out] */ long* nActions); virtual HRESULT STDMETHODCALLTYPE doAction( /* [in] */ long actionIndex); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_description( /* [in] */ long actionIndex, - /* [retval][out] */ BSTR *description); + /* [retval][out] */ BSTR* description); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_keyBinding( /* [in] */ long actionIndex, /* [in] */ long nMaxBinding, - /* [length_is][length_is][size_is][size_is][out] */ BSTR **keyBinding, - /* [retval][out] */ long *nBinding); + /* [length_is][length_is][size_is][size_is][out] */ BSTR** keyBinding, + /* [retval][out] */ long* nBinding); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_name( /* [in] */ long actionIndex, - /* [retval][out] */ BSTR *name); + /* [retval][out] */ BSTR* name); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedName( /* [in] */ long actionIndex, - /* [retval][out] */ BSTR *localizedName); + /* [retval][out] */ BSTR* localizedName); }; } // namespace a11y } // namespace mozilla #define FORWARD_IACCESSIBLEACTION(Class) \ - virtual HRESULT STDMETHODCALLTYPE nActions(long *nActions) { \ + virtual HRESULT STDMETHODCALLTYPE nActions(long* nActions) { \ return Class::nActions(nActions); \ } \ \ @@ -59,22 +59,22 @@ class ia2AccessibleAction : public IAccessibleAction { } \ \ virtual HRESULT STDMETHODCALLTYPE get_description(long actionIndex, \ - BSTR *description) { \ + BSTR* description) { \ return Class::get_description(actionIndex, description); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_keyBinding( \ - long actionIndex, long nMaxBinding, BSTR **keyBinding, long *nBinding) { \ + long actionIndex, long nMaxBinding, BSTR** keyBinding, long* nBinding) { \ return Class::get_keyBinding(actionIndex, nMaxBinding, keyBinding, \ nBinding); \ } \ \ - virtual HRESULT STDMETHODCALLTYPE get_name(long actionIndex, BSTR *name) { \ + virtual HRESULT STDMETHODCALLTYPE get_name(long actionIndex, BSTR* name) { \ return Class::get_name(actionIndex, name); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_localizedName(long actionIndex, \ - BSTR *localizedName) { \ + BSTR* localizedName) { \ return Class::get_localizedName(actionIndex, localizedName); \ } diff --git a/accessible/windows/ia2/ia2AccessibleComponent.h b/accessible/windows/ia2/ia2AccessibleComponent.h index 77fb15a95a291..54e87d19630e0 100644 --- a/accessible/windows/ia2/ia2AccessibleComponent.h +++ b/accessible/windows/ia2/ia2AccessibleComponent.h @@ -16,18 +16,18 @@ namespace a11y { class ia2AccessibleComponent : public IAccessibleComponent { public: // IUnknown - STDMETHODIMP QueryInterface(REFIID, void **); + STDMETHODIMP QueryInterface(REFIID, void**); // IAccessibleComponent virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_locationInParent( - /* [out] */ long *x, - /* [retval][out] */ long *y); + /* [out] */ long* x, + /* [retval][out] */ long* y); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_foreground( - /* [retval][out] */ IA2Color *foreground); + /* [retval][out] */ IA2Color* foreground); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_background( - /* [retval][out] */ IA2Color *background); + /* [retval][out] */ IA2Color* background); }; } // namespace a11y diff --git a/accessible/windows/ia2/ia2AccessibleEditableText.h b/accessible/windows/ia2/ia2AccessibleEditableText.h index 0b31adfc9123c..7c6470773d065 100644 --- a/accessible/windows/ia2/ia2AccessibleEditableText.h +++ b/accessible/windows/ia2/ia2AccessibleEditableText.h @@ -28,7 +28,7 @@ class ia2AccessibleEditableText : public IAccessibleEditableText { virtual HRESULT STDMETHODCALLTYPE insertText( /* [in] */ long offset, - /* [in] */ BSTR *text); + /* [in] */ BSTR* text); virtual HRESULT STDMETHODCALLTYPE cutText( /* [in] */ long startOffset, @@ -41,12 +41,12 @@ class ia2AccessibleEditableText : public IAccessibleEditableText { virtual HRESULT STDMETHODCALLTYPE replaceText( /* [in] */ long startOffset, /* [in] */ long endOffset, - /* [in] */ BSTR *text); + /* [in] */ BSTR* text); virtual HRESULT STDMETHODCALLTYPE setAttributes( /* [in] */ long startOffset, /* [in] */ long endOffset, - /* [in] */ BSTR *attributes); + /* [in] */ BSTR* attributes); }; } // namespace a11y diff --git a/accessible/windows/ia2/ia2AccessibleHyperlink.h b/accessible/windows/ia2/ia2AccessibleHyperlink.h index 34cb59ddaf3c1..c469255e1cb69 100644 --- a/accessible/windows/ia2/ia2AccessibleHyperlink.h +++ b/accessible/windows/ia2/ia2AccessibleHyperlink.h @@ -20,27 +20,27 @@ class ia2AccessibleHyperlink : public ia2AccessibleAction, public IAccessibleHyperlink { public: // IUnknown - STDMETHODIMP QueryInterface(REFIID, void **); + STDMETHODIMP QueryInterface(REFIID, void**); // IAccessibleAction FORWARD_IACCESSIBLEACTION(ia2AccessibleAction) virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_anchor( /* [in] */ long index, - /* [retval][out] */ VARIANT *anchor); + /* [retval][out] */ VARIANT* anchor); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_anchorTarget( /* [in] */ long index, - /* [retval][out] */ VARIANT *anchorTarget); + /* [retval][out] */ VARIANT* anchorTarget); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_startIndex( - /* [retval][out] */ long *index); + /* [retval][out] */ long* index); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_endIndex( - /* [retval][out] */ long *index); + /* [retval][out] */ long* index); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_valid( - /* [retval][out] */ boolean *valid); + /* [retval][out] */ boolean* valid); }; } // namespace a11y diff --git a/accessible/windows/ia2/ia2AccessibleImage.h b/accessible/windows/ia2/ia2AccessibleImage.h index fe8d2bff9850d..23c7b74f77154 100644 --- a/accessible/windows/ia2/ia2AccessibleImage.h +++ b/accessible/windows/ia2/ia2AccessibleImage.h @@ -16,20 +16,20 @@ namespace a11y { class ia2AccessibleImage : public IAccessibleImage { public: // IUnknown - STDMETHODIMP QueryInterface(REFIID, void **); + STDMETHODIMP QueryInterface(REFIID, void**); // IAccessibleImage virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_description( - /* [retval][out] */ BSTR *description); + /* [retval][out] */ BSTR* description); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_imagePosition( /* [in] */ enum IA2CoordinateType coordinateType, - /* [out] */ long *x, - /* [retval][out] */ long *y); + /* [out] */ long* x, + /* [retval][out] */ long* y); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_imageSize( - /* [out] */ long *height, - /* [retval][out] */ long *width); + /* [out] */ long* height, + /* [retval][out] */ long* width); }; } // namespace a11y diff --git a/accessible/windows/ia2/ia2AccessibleRelation.cpp b/accessible/windows/ia2/ia2AccessibleRelation.cpp index bde7c68993ce7..1e920c537668b 100644 --- a/accessible/windows/ia2/ia2AccessibleRelation.cpp +++ b/accessible/windows/ia2/ia2AccessibleRelation.cpp @@ -14,9 +14,9 @@ using namespace mozilla::a11y; -ia2AccessibleRelation::ia2AccessibleRelation(RelationType aType, Relation *aRel) +ia2AccessibleRelation::ia2AccessibleRelation(RelationType aType, Relation* aRel) : mType(aType) { - Accessible *target = nullptr; + Accessible* target = nullptr; while ((target = aRel->Next())) mTargets.AppendElement(target); } @@ -30,7 +30,7 @@ IMPL_IUNKNOWN_QUERY_TAIL // IAccessibleRelation STDMETHODIMP -ia2AccessibleRelation::get_relationType(BSTR *aRelationType) { +ia2AccessibleRelation::get_relationType(BSTR* aRelationType) { if (!aRelationType) return E_INVALIDARG; *aRelationType = nullptr; @@ -48,7 +48,7 @@ ia2AccessibleRelation::get_relationType(BSTR *aRelationType) { } STDMETHODIMP -ia2AccessibleRelation::get_localizedRelationType(BSTR *aLocalizedRelationType) { +ia2AccessibleRelation::get_localizedRelationType(BSTR* aLocalizedRelationType) { if (!aLocalizedRelationType) return E_INVALIDARG; *aLocalizedRelationType = nullptr; @@ -56,7 +56,7 @@ ia2AccessibleRelation::get_localizedRelationType(BSTR *aLocalizedRelationType) { } STDMETHODIMP -ia2AccessibleRelation::get_nTargets(long *aNTargets) { +ia2AccessibleRelation::get_nTargets(long* aNTargets) { if (!aNTargets) return E_INVALIDARG; *aNTargets = mTargets.Length(); @@ -64,22 +64,22 @@ ia2AccessibleRelation::get_nTargets(long *aNTargets) { } STDMETHODIMP -ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget) { +ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown** aTarget) { if (aTargetIndex < 0 || (uint32_t)aTargetIndex >= mTargets.Length() || !aTarget) return E_INVALIDARG; - AccessibleWrap *target = - static_cast(mTargets[aTargetIndex].get()); - *aTarget = static_cast(target); + AccessibleWrap* target = + static_cast(mTargets[aTargetIndex].get()); + *aTarget = static_cast(target); (*aTarget)->AddRef(); return S_OK; } STDMETHODIMP -ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown **aTargets, - long *aNTargets) { +ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown** aTargets, + long* aNTargets) { if (!aNTargets || !aTargets) return E_INVALIDARG; *aNTargets = 0; diff --git a/accessible/windows/ia2/ia2AccessibleRelation.h b/accessible/windows/ia2/ia2AccessibleRelation.h index d15a4ee0b7f3a..afed4be56ec24 100644 --- a/accessible/windows/ia2/ia2AccessibleRelation.h +++ b/accessible/windows/ia2/ia2AccessibleRelation.h @@ -21,10 +21,10 @@ namespace a11y { class ia2AccessibleRelation final : public IAccessibleRelation { public: - ia2AccessibleRelation(RelationType aType, Relation *aRel); + ia2AccessibleRelation(RelationType aType, Relation* aRel); ia2AccessibleRelation(RelationType aType, - nsTArray> &&aTargets) + nsTArray>&& aTargets) : mType(aType), mTargets(std::move(aTargets)) {} // IUnknown @@ -32,29 +32,29 @@ class ia2AccessibleRelation final : public IAccessibleRelation { // IAccessibleRelation virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_relationType( - /* [retval][out] */ BSTR *relationType); + /* [retval][out] */ BSTR* relationType); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_localizedRelationType( - /* [retval][out] */ BSTR *localizedRelationType); + /* [retval][out] */ BSTR* localizedRelationType); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nTargets( - /* [retval][out] */ long *nTargets); + /* [retval][out] */ long* nTargets); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_target( /* [in] */ long targetIndex, - /* [retval][out] */ IUnknown **target); + /* [retval][out] */ IUnknown** target); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_targets( /* [in] */ long maxTargets, - /* [length_is][size_is][out] */ IUnknown **target, - /* [retval][out] */ long *nTargets); + /* [length_is][size_is][out] */ IUnknown** target, + /* [retval][out] */ long* nTargets); inline bool HasTargets() const { return mTargets.Length(); } private: ia2AccessibleRelation(); - ia2AccessibleRelation(const ia2AccessibleRelation &); - ia2AccessibleRelation &operator=(const ia2AccessibleRelation &); + ia2AccessibleRelation(const ia2AccessibleRelation&); + ia2AccessibleRelation& operator=(const ia2AccessibleRelation&); RelationType mType; nsTArray> mTargets; @@ -64,12 +64,12 @@ class ia2AccessibleRelation final : public IAccessibleRelation { * Gecko to IAccessible2 relation types map. */ -const WCHAR *const IA2_RELATION_NULL = L""; +const WCHAR* const IA2_RELATION_NULL = L""; #define RELATIONTYPE(geckoType, name, atkType, msaaType, ia2Type) \ - std::pair(RelationType::geckoType, ia2Type), + std::pair(RelationType::geckoType, ia2Type), -static const std::pair sRelationTypePairs[] = +static const std::pair sRelationTypePairs[] = { #include "RelationTypeMap.h" }; diff --git a/accessible/windows/ia2/ia2AccessibleTable.h b/accessible/windows/ia2/ia2AccessibleTable.h index e0c2427f60c13..97b7103d8508a 100644 --- a/accessible/windows/ia2/ia2AccessibleTable.h +++ b/accessible/windows/ia2/ia2AccessibleTable.h @@ -19,101 +19,101 @@ class TableAccessible; class ia2AccessibleTable : public IAccessibleTable, public IAccessibleTable2 { public: // IUnknown - STDMETHODIMP QueryInterface(REFIID, void **); + STDMETHODIMP QueryInterface(REFIID, void**); // IAccessibleTable virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_accessibleAt( /* [in] */ long row, /* [in] */ long column, - /* [retval][out] */ IUnknown **accessible); + /* [retval][out] */ IUnknown** accessible); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_caption( - /* [retval][out] */ IUnknown **accessible); + /* [retval][out] */ IUnknown** accessible); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_childIndex( /* [in] */ long rowIndex, /* [in] */ long columnIndex, - /* [retval][out] */ long *childIndex); + /* [retval][out] */ long* childIndex); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnDescription( /* [in] */ long column, - /* [retval][out] */ BSTR *description); + /* [retval][out] */ BSTR* description); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnExtentAt( /* [in] */ long row, /* [in] */ long column, - /* [retval][out] */ long *nColumnsSpanned); + /* [retval][out] */ long* nColumnsSpanned); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnHeader( - /* [out] */ IAccessibleTable **accessibleTable, - /* [retval][out] */ long *startingRowIndex); + /* [out] */ IAccessibleTable** accessibleTable, + /* [retval][out] */ long* startingRowIndex); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnIndex( /* [in] */ long childIndex, - /* [retval][out] */ long *columnIndex); + /* [retval][out] */ long* columnIndex); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nColumns( - /* [retval][out] */ long *columnCount); + /* [retval][out] */ long* columnCount); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nRows( - /* [retval][out] */ long *rowCount); + /* [retval][out] */ long* rowCount); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nSelectedChildren( - /* [retval][out] */ long *childCount); + /* [retval][out] */ long* childCount); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nSelectedColumns( - /* [retval][out] */ long *columnCount); + /* [retval][out] */ long* columnCount); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nSelectedRows( - /* [retval][out] */ long *rowCount); + /* [retval][out] */ long* rowCount); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowDescription( /* [in] */ long row, - /* [retval][out] */ BSTR *description); + /* [retval][out] */ BSTR* description); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowExtentAt( /* [in] */ long row, /* [in] */ long column, - /* [retval][out] */ long *nRowsSpanned); + /* [retval][out] */ long* nRowsSpanned); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowHeader( - /* [out] */ IAccessibleTable **accessibleTable, - /* [retval][out] */ long *startingColumnIndex); + /* [out] */ IAccessibleTable** accessibleTable, + /* [retval][out] */ long* startingColumnIndex); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowIndex( /* [in] */ long childIndex, - /* [retval][out] */ long *rowIndex); + /* [retval][out] */ long* rowIndex); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedChildren( /* [in] */ long maxChildren, - /* [length_is][length_is][size_is][size_is][out] */ long **children, - /* [retval][out] */ long *nChildren); + /* [length_is][length_is][size_is][size_is][out] */ long** children, + /* [retval][out] */ long* nChildren); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedColumns( /* [in] */ long maxColumns, - /* [length_is][length_is][size_is][size_is][out] */ long **columns, - /* [retval][out] */ long *nColumns); + /* [length_is][length_is][size_is][size_is][out] */ long** columns, + /* [retval][out] */ long* nColumns); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedRows( /* [in] */ long maxRows, - /* [length_is][length_is][size_is][size_is][out] */ long **rows, - /* [retval][out] */ long *nRows); + /* [length_is][length_is][size_is][size_is][out] */ long** rows, + /* [retval][out] */ long* nRows); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_summary( - /* [retval][out] */ IUnknown **accessible); + /* [retval][out] */ IUnknown** accessible); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isColumnSelected( /* [in] */ long column, - /* [retval][out] */ boolean *isSelected); + /* [retval][out] */ boolean* isSelected); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isRowSelected( /* [in] */ long row, - /* [retval][out] */ boolean *isSelected); + /* [retval][out] */ boolean* isSelected); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isSelected( /* [in] */ long row, /* [in] */ long column, - /* [retval][out] */ boolean *isSelected); + /* [retval][out] */ boolean* isSelected); virtual HRESULT STDMETHODCALLTYPE selectRow( /* [in] */ long row); @@ -129,41 +129,41 @@ class ia2AccessibleTable : public IAccessibleTable, public IAccessibleTable2 { virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowColumnExtentsAtIndex( /* [in] */ long index, - /* [out] */ long *row, - /* [out] */ long *column, - /* [out] */ long *rowExtents, - /* [out] */ long *columnExtents, - /* [retval][out] */ boolean *isSelected); + /* [out] */ long* row, + /* [out] */ long* column, + /* [out] */ long* rowExtents, + /* [out] */ long* columnExtents, + /* [retval][out] */ boolean* isSelected); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_modelChange( - /* [retval][out] */ IA2TableModelChange *modelChange); + /* [retval][out] */ IA2TableModelChange* modelChange); // IAccessibleTable2 virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_cellAt( /* [in] */ long row, /* [in] */ long column, - /* [out, retval] */ IUnknown **cell); + /* [out, retval] */ IUnknown** cell); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nSelectedCells( - /* [out, retval] */ long *cellCount); + /* [out, retval] */ long* cellCount); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedCells( - /* [out, size_is(,*nSelectedCells,)] */ IUnknown ***cells, - /* [out, retval] */ long *nSelectedCells); + /* [out, size_is(,*nSelectedCells,)] */ IUnknown*** cells, + /* [out, retval] */ long* nSelectedCells); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedColumns( - /* [out, size_is(,*nColumns)] */ long **selectedColumns, - /* [out, retval] */ long *nColumns); + /* [out, size_is(,*nColumns)] */ long** selectedColumns, + /* [out, retval] */ long* nColumns); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selectedRows( - /* [out, size_is(,*nRows)] */ long **selectedRows, - /* [out, retval] */ long *nRows); + /* [out, size_is(,*nRows)] */ long** selectedRows, + /* [out, retval] */ long* nRows); protected: - ia2AccessibleTable(TableAccessible *aTable) : mTable(aTable) {} + ia2AccessibleTable(TableAccessible* aTable) : mTable(aTable) {} - TableAccessible *mTable; + TableAccessible* mTable; }; } // namespace a11y diff --git a/accessible/windows/ia2/ia2AccessibleTableCell.h b/accessible/windows/ia2/ia2AccessibleTableCell.h index ca2cc8bbff9d4..bb7504f20c5b3 100644 --- a/accessible/windows/ia2/ia2AccessibleTableCell.h +++ b/accessible/windows/ia2/ia2AccessibleTableCell.h @@ -17,48 +17,48 @@ class TableCellAccessible; class ia2AccessibleTableCell : public IAccessibleTableCell { public: // IUnknown - STDMETHODIMP QueryInterface(REFIID, void **); + STDMETHODIMP QueryInterface(REFIID, void**); // IAccessibleTableCell virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_table( - /* [out, retval] */ IUnknown **table); + /* [out, retval] */ IUnknown** table); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnExtent( - /* [out, retval] */ long *nColumnsSpanned); + /* [out, retval] */ long* nColumnsSpanned); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnHeaderCells( - /* [out, size_is(,*nColumnHeaderCells,)] */ IUnknown ***cellAccessibles, - /* [out, retval] */ long *nColumnHeaderCells); + /* [out, size_is(,*nColumnHeaderCells,)] */ IUnknown*** cellAccessibles, + /* [out, retval] */ long* nColumnHeaderCells); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_columnIndex( - /* [out, retval] */ long *columnIndex); + /* [out, retval] */ long* columnIndex); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowExtent( - /* [out, retval] */ long *nRowsSpanned); + /* [out, retval] */ long* nRowsSpanned); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowHeaderCells( - /* [out, size_is(,*nRowHeaderCells,)] */ IUnknown ***cellAccessibles, - /* [out, retval] */ long *nRowHeaderCells); + /* [out, size_is(,*nRowHeaderCells,)] */ IUnknown*** cellAccessibles, + /* [out, retval] */ long* nRowHeaderCells); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowIndex( - /* [out, retval] */ long *rowIndex); + /* [out, retval] */ long* rowIndex); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_rowColumnExtents( - /* [out] */ long *row, - /* [out] */ long *column, - /* [out] */ long *rowExtents, - /* [out] */ long *columnExtents, - /* [out, retval] */ boolean *isSelected); + /* [out] */ long* row, + /* [out] */ long* column, + /* [out] */ long* rowExtents, + /* [out] */ long* columnExtents, + /* [out, retval] */ boolean* isSelected); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_isSelected( - /* [out, retval] */ boolean *isSelected); + /* [out, retval] */ boolean* isSelected); protected: - ia2AccessibleTableCell(TableCellAccessible *aTableCell) + ia2AccessibleTableCell(TableCellAccessible* aTableCell) : mTableCell(aTableCell) {} - TableCellAccessible *mTableCell; + TableCellAccessible* mTableCell; }; } // namespace a11y diff --git a/accessible/windows/ia2/ia2AccessibleText.h b/accessible/windows/ia2/ia2AccessibleText.h index f1193d03c60d2..f302535b08607 100644 --- a/accessible/windows/ia2/ia2AccessibleText.h +++ b/accessible/windows/ia2/ia2AccessibleText.h @@ -25,60 +25,60 @@ class ia2AccessibleText : public IAccessibleText { virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_attributes( /* [in] */ long offset, - /* [out] */ long *startOffset, - /* [out] */ long *endOffset, - /* [retval][out] */ BSTR *textAttributes); + /* [out] */ long* startOffset, + /* [out] */ long* endOffset, + /* [retval][out] */ BSTR* textAttributes); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_caretOffset( - /* [retval][out] */ long *offset); + /* [retval][out] */ long* offset); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_characterExtents( /* [in] */ long offset, /* [in] */ enum IA2CoordinateType coordType, - /* [out] */ long *x, - /* [out] */ long *y, - /* [out] */ long *width, - /* [retval][out] */ long *height); + /* [out] */ long* x, + /* [out] */ long* y, + /* [out] */ long* width, + /* [retval][out] */ long* height); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nSelections( - /* [retval][out] */ long *nSelections); + /* [retval][out] */ long* nSelections); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_offsetAtPoint( /* [in] */ long x, /* [in] */ long y, /* [in] */ enum IA2CoordinateType coordType, - /* [retval][out] */ long *offset); + /* [retval][out] */ long* offset); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_selection( /* [in] */ long selectionIndex, - /* [out] */ long *startOffset, - /* [retval][out] */ long *endOffset); + /* [out] */ long* startOffset, + /* [retval][out] */ long* endOffset); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_text( /* [in] */ long startOffset, /* [in] */ long endOffset, - /* [retval][out] */ BSTR *text); + /* [retval][out] */ BSTR* text); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_textBeforeOffset( /* [in] */ long offset, /* [in] */ enum IA2TextBoundaryType boundaryType, - /* [out] */ long *startOffset, - /* [out] */ long *endOffset, - /* [retval][out] */ BSTR *text); + /* [out] */ long* startOffset, + /* [out] */ long* endOffset, + /* [retval][out] */ BSTR* text); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_textAfterOffset( /* [in] */ long offset, /* [in] */ enum IA2TextBoundaryType boundaryType, - /* [out] */ long *startOffset, - /* [out] */ long *endOffset, - /* [retval][out] */ BSTR *text); + /* [out] */ long* startOffset, + /* [out] */ long* endOffset, + /* [retval][out] */ BSTR* text); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_textAtOffset( /* [in] */ long offset, /* [in] */ enum IA2TextBoundaryType boundaryType, - /* [out] */ long *startOffset, - /* [out] */ long *endOffset, - /* [retval][out] */ BSTR *text); + /* [out] */ long* startOffset, + /* [out] */ long* endOffset, + /* [retval][out] */ BSTR* text); virtual HRESULT STDMETHODCALLTYPE removeSelection( /* [in] */ long selectionIndex); @@ -92,7 +92,7 @@ class ia2AccessibleText : public IAccessibleText { /* [in] */ long endOffset); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nCharacters( - /* [retval][out] */ long *nCharacters); + /* [retval][out] */ long* nCharacters); virtual HRESULT STDMETHODCALLTYPE scrollSubstringTo( /* [in] */ long startIndex, @@ -107,14 +107,14 @@ class ia2AccessibleText : public IAccessibleText { /* [in] */ long y); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_newText( - /* [retval][out] */ IA2TextSegment *newText); + /* [retval][out] */ IA2TextSegment* newText); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_oldText( - /* [retval][out] */ IA2TextSegment *oldText); + /* [retval][out] */ IA2TextSegment* oldText); static void InitTextChangeData(); - static void UpdateTextChangeData(HyperTextAccessibleWrap *aAcc, bool aInsert, - const nsString &aStr, int32_t aStart, + static void UpdateTextChangeData(HyperTextAccessibleWrap* aAcc, bool aInsert, + const nsString& aStr, int32_t aStart, uint32_t aLen); protected: @@ -125,7 +125,7 @@ class ia2AccessibleText : public IAccessibleText { static uint32_t sLastTextChangeEnd; private: - HRESULT GetModifiedText(bool aGetInsertedText, IA2TextSegment *aNewText); + HRESULT GetModifiedText(bool aGetInsertedText, IA2TextSegment* aNewText); AccessibleTextBoundary GetGeckoTextBoundary( enum IA2TextBoundaryType coordinateType); }; @@ -140,58 +140,58 @@ class ia2AccessibleText : public IAccessibleText { } \ \ virtual HRESULT STDMETHODCALLTYPE get_attributes( \ - long offset, long *startOffset, long *endOffset, BSTR *textAttributes) { \ + long offset, long* startOffset, long* endOffset, BSTR* textAttributes) { \ return Class::get_attributes(offset, startOffset, endOffset, \ textAttributes); \ } \ \ - virtual HRESULT STDMETHODCALLTYPE get_caretOffset(long *offset) { \ + virtual HRESULT STDMETHODCALLTYPE get_caretOffset(long* offset) { \ return Class::get_caretOffset(offset); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_characterExtents( \ - long offset, enum IA2CoordinateType coordType, long *x, long *y, \ - long *width, long *height) { \ + long offset, enum IA2CoordinateType coordType, long* x, long* y, \ + long* width, long* height) { \ return Class::get_characterExtents(offset, coordType, x, y, width, \ height); \ } \ \ - virtual HRESULT STDMETHODCALLTYPE get_nSelections(long *nSelections) { \ + virtual HRESULT STDMETHODCALLTYPE get_nSelections(long* nSelections) { \ return Class::get_nSelections(nSelections); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_offsetAtPoint( \ - long x, long y, enum IA2CoordinateType coordType, long *offset) { \ + long x, long y, enum IA2CoordinateType coordType, long* offset) { \ return Class::get_offsetAtPoint(x, y, coordType, offset); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_selection( \ - long selectionIndex, long *startOffset, long *endOffset) { \ + long selectionIndex, long* startOffset, long* endOffset) { \ return Class::get_selection(selectionIndex, startOffset, endOffset); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_text(long startOffset, long endOffset, \ - BSTR *text) { \ + BSTR* text) { \ return Class::get_text(startOffset, endOffset, text); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_textBeforeOffset( \ - long offset, enum IA2TextBoundaryType boundaryType, long *startOffset, \ - long *endOffset, BSTR *text) { \ + long offset, enum IA2TextBoundaryType boundaryType, long* startOffset, \ + long* endOffset, BSTR* text) { \ return Class::get_textBeforeOffset(offset, boundaryType, startOffset, \ endOffset, text); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_textAfterOffset( \ - long offset, enum IA2TextBoundaryType boundaryType, long *startOffset, \ - long *endOffset, BSTR *text) { \ + long offset, enum IA2TextBoundaryType boundaryType, long* startOffset, \ + long* endOffset, BSTR* text) { \ return Class::get_textAfterOffset(offset, boundaryType, startOffset, \ endOffset, text); \ } \ \ virtual HRESULT STDMETHODCALLTYPE get_textAtOffset( \ - long offset, enum IA2TextBoundaryType boundaryType, long *startOffset, \ - long *endOffset, BSTR *text) { \ + long offset, enum IA2TextBoundaryType boundaryType, long* startOffset, \ + long* endOffset, BSTR* text) { \ return Class::get_textAtOffset(offset, boundaryType, startOffset, \ endOffset, text); \ } \ @@ -209,7 +209,7 @@ class ia2AccessibleText : public IAccessibleText { return Class::setSelection(selectionIndex, startOffset, endOffset); \ } \ \ - virtual HRESULT STDMETHODCALLTYPE get_nCharacters(long *nCharacters) { \ + virtual HRESULT STDMETHODCALLTYPE get_nCharacters(long* nCharacters) { \ return Class::get_nCharacters(nCharacters); \ } \ \ @@ -225,11 +225,11 @@ class ia2AccessibleText : public IAccessibleText { x, y); \ } \ \ - virtual HRESULT STDMETHODCALLTYPE get_newText(IA2TextSegment *newText) { \ + virtual HRESULT STDMETHODCALLTYPE get_newText(IA2TextSegment* newText) { \ return Class::get_newText(newText); \ } \ \ - virtual HRESULT STDMETHODCALLTYPE get_oldText(IA2TextSegment *oldText) { \ + virtual HRESULT STDMETHODCALLTYPE get_oldText(IA2TextSegment* oldText) { \ return Class::get_oldText(oldText); \ } diff --git a/accessible/windows/ia2/ia2AccessibleValue.h b/accessible/windows/ia2/ia2AccessibleValue.h index e5d366bd8ed05..e430c60e5abef 100644 --- a/accessible/windows/ia2/ia2AccessibleValue.h +++ b/accessible/windows/ia2/ia2AccessibleValue.h @@ -16,20 +16,20 @@ namespace a11y { class ia2AccessibleValue : public IAccessibleValue { public: // IUnknown - STDMETHODIMP QueryInterface(REFIID, void **); + STDMETHODIMP QueryInterface(REFIID, void**); // IAccessibleValue virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_currentValue( - /* [retval][out] */ VARIANT *currentValue); + /* [retval][out] */ VARIANT* currentValue); virtual HRESULT STDMETHODCALLTYPE setCurrentValue( /* [in] */ VARIANT value); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_maximumValue( - /* [retval][out] */ VARIANT *maximumValue); + /* [retval][out] */ VARIANT* maximumValue); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_minimumValue( - /* [retval][out] */ VARIANT *minimumValue); + /* [retval][out] */ VARIANT* minimumValue); }; } // namespace a11y diff --git a/accessible/windows/msaa/AccessibleWrap.h b/accessible/windows/msaa/AccessibleWrap.h index 4f5a818428f08..6b3b9a6d5c9e6 100644 --- a/accessible/windows/msaa/AccessibleWrap.h +++ b/accessible/windows/msaa/AccessibleWrap.h @@ -37,92 +37,92 @@ class AccessibleWrap : public Accessible, public ia2AccessibleHyperlink, public ia2AccessibleValue { public: // construction, destruction - AccessibleWrap(nsIContent *aContent, DocAccessible *aDoc); + AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc); // nsISupports NS_DECL_ISUPPORTS_INHERITED public: // IUnknown methods - see iunknown.h for documentation - STDMETHODIMP QueryInterface(REFIID, void **) override; + STDMETHODIMP QueryInterface(REFIID, void**) override; // Return the registered OLE class ID of this object's CfDataObj. CLSID GetClassID() const; public: // COM interface IAccessible virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accParent( - /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdispParent) + /* [retval][out] */ IDispatch __RPC_FAR* __RPC_FAR* ppdispParent) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accChildCount( - /* [retval][out] */ long __RPC_FAR *pcountChildren) override; + /* [retval][out] */ long __RPC_FAR* pcountChildren) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accChild( /* [in] */ VARIANT varChild, - /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdispChild) override; + /* [retval][out] */ IDispatch __RPC_FAR* __RPC_FAR* ppdispChild) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accName( /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ BSTR __RPC_FAR *pszName) override; + /* [retval][out] */ BSTR __RPC_FAR* pszName) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accValue( /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ BSTR __RPC_FAR *pszValue) override; + /* [retval][out] */ BSTR __RPC_FAR* pszValue) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accDescription( /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ BSTR __RPC_FAR *pszDescription) override; + /* [retval][out] */ BSTR __RPC_FAR* pszDescription) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accRole( /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ VARIANT __RPC_FAR *pvarRole) override; + /* [retval][out] */ VARIANT __RPC_FAR* pvarRole) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accState( /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ VARIANT __RPC_FAR *pvarState) override; + /* [retval][out] */ VARIANT __RPC_FAR* pvarState) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accHelp( /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ BSTR __RPC_FAR *pszHelp) override; + /* [retval][out] */ BSTR __RPC_FAR* pszHelp) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accHelpTopic( - /* [out] */ BSTR __RPC_FAR *pszHelpFile, + /* [out] */ BSTR __RPC_FAR* pszHelpFile, /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ long __RPC_FAR *pidTopic) override; + /* [retval][out] */ long __RPC_FAR* pidTopic) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accKeyboardShortcut( /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ BSTR __RPC_FAR *pszKeyboardShortcut) override; + /* [retval][out] */ BSTR __RPC_FAR* pszKeyboardShortcut) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accFocus( - /* [retval][out] */ VARIANT __RPC_FAR *pvarChild) override; + /* [retval][out] */ VARIANT __RPC_FAR* pvarChild) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accSelection( - /* [retval][out] */ VARIANT __RPC_FAR *pvarChildren) override; + /* [retval][out] */ VARIANT __RPC_FAR* pvarChildren) override; virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accDefaultAction( /* [optional][in] */ VARIANT varChild, - /* [retval][out] */ BSTR __RPC_FAR *pszDefaultAction) override; + /* [retval][out] */ BSTR __RPC_FAR* pszDefaultAction) override; virtual /* [id] */ HRESULT STDMETHODCALLTYPE accSelect( /* [in] */ long flagsSelect, /* [optional][in] */ VARIANT varChild) override; virtual /* [id] */ HRESULT STDMETHODCALLTYPE accLocation( - /* [out] */ long __RPC_FAR *pxLeft, - /* [out] */ long __RPC_FAR *pyTop, - /* [out] */ long __RPC_FAR *pcxWidth, - /* [out] */ long __RPC_FAR *pcyHeight, + /* [out] */ long __RPC_FAR* pxLeft, + /* [out] */ long __RPC_FAR* pyTop, + /* [out] */ long __RPC_FAR* pcxWidth, + /* [out] */ long __RPC_FAR* pcyHeight, /* [optional][in] */ VARIANT varChild) override; virtual /* [id] */ HRESULT STDMETHODCALLTYPE accNavigate( /* [in] */ long navDir, /* [optional][in] */ VARIANT varStart, - /* [retval][out] */ VARIANT __RPC_FAR *pvarEndUpAt) override; + /* [retval][out] */ VARIANT __RPC_FAR* pvarEndUpAt) override; virtual /* [id] */ HRESULT STDMETHODCALLTYPE accHitTest( /* [in] */ long xLeft, /* [in] */ long yTop, - /* [retval][out] */ VARIANT __RPC_FAR *pvarChild) override; + /* [retval][out] */ VARIANT __RPC_FAR* pvarChild) override; virtual /* [id] */ HRESULT STDMETHODCALLTYPE accDoDefaultAction( /* [optional][in] */ VARIANT varChild) override; @@ -136,32 +136,32 @@ class AccessibleWrap : public Accessible, /* [in] */ BSTR szValue) override; // IDispatch (support of scripting languages like VB) - virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo) override; + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT* pctinfo) override; virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, - ITypeInfo **ppTInfo) override; + ITypeInfo** ppTInfo) override; virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, - LPOLESTR *rgszNames, + LPOLESTR* rgszNames, UINT cNames, LCID lcid, - DISPID *rgDispId) override; + DISPID* rgDispId) override; virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, - DISPPARAMS *pDispParams, - VARIANT *pVarResult, - EXCEPINFO *pExcepInfo, - UINT *puArgErr) override; + DISPPARAMS* pDispParams, + VARIANT* pVarResult, + EXCEPINFO* pExcepInfo, + UINT* puArgErr) override; // Accessible - virtual nsresult HandleAccEvent(AccEvent *aEvent) override; + virtual nsresult HandleAccEvent(AccEvent* aEvent) override; virtual void Shutdown() override; // Helper methods - static int32_t GetChildIDFor(Accessible *aAccessible); - static HWND GetHWNDFor(Accessible *aAccessible); + static int32_t GetChildIDFor(Accessible* aAccessible); + static HWND GetHWNDFor(Accessible* aAccessible); - static void FireWinEvent(Accessible *aTarget, uint32_t aEventType); + static void FireWinEvent(Accessible* aTarget, uint32_t aEventType); /** * System caret support: update the Windows caret position. @@ -170,13 +170,13 @@ class AccessibleWrap : public Accessible, * We will use an invisible system caret. * Gecko is still responsible for drawing its own caret */ - void UpdateSystemCaretFor(Accessible *aAccessible); - static void UpdateSystemCaretFor(ProxyAccessible *aProxy, - const LayoutDeviceIntRect &aCaretRect); + void UpdateSystemCaretFor(Accessible* aAccessible); + static void UpdateSystemCaretFor(ProxyAccessible* aProxy, + const LayoutDeviceIntRect& aCaretRect); private: static void UpdateSystemCaretFor(HWND aCaretWnd, - const LayoutDeviceIntRect &aCaretRect); + const LayoutDeviceIntRect& aCaretRect); public: /** @@ -188,11 +188,11 @@ class AccessibleWrap : public Accessible, * Find an accessible by the given child ID in cached documents. */ MOZ_MUST_USE already_AddRefed GetIAccessibleFor( - const VARIANT &aVarChild, bool *aIsDefunct); + const VARIANT& aVarChild, bool* aIsDefunct); - virtual void GetNativeInterface(void **aOutAccessible) override; + virtual void GetNativeInterface(void** aOutAccessible) override; - static IDispatch *NativeAccessible(Accessible *aAccessible); + static IDispatch* NativeAccessible(Accessible* aAccessible); uint32_t GetExistingID() const { return mID; } static const uint32_t kNoID = 0; @@ -205,11 +205,11 @@ class AccessibleWrap : public Accessible, static void InvalidateHandlers(); - bool DispatchTextChangeToHandler(bool aIsInsert, const nsString &aText, + bool DispatchTextChangeToHandler(bool aIsInsert, const nsString& aText, int32_t aStart, uint32_t aLen); - static void AssignChildIDTo(NotNull aSdnAcc); - static void ReleaseChildID(NotNull aSdnAcc); + static void AssignChildIDTo(NotNull aSdnAcc); + static void ReleaseChildID(NotNull aSdnAcc); protected: virtual ~AccessibleWrap(); @@ -217,25 +217,25 @@ class AccessibleWrap : public Accessible, uint32_t mID; HRESULT - ResolveChild(const VARIANT &aVarChild, IAccessible **aOutInterface); + ResolveChild(const VARIANT& aVarChild, IAccessible** aOutInterface); /** * Find a remote accessible by the given child ID. */ MOZ_MUST_USE already_AddRefed GetRemoteIAccessibleFor( - const VARIANT &aVarChild); + const VARIANT& aVarChild); /** * Return the wrapper for the document's proxy. */ - DocProxyAccessibleWrap *DocProxyWrapper() const; + DocProxyAccessibleWrap* DocProxyWrapper() const; /** * Creates ITypeInfo for LIBID_Accessibility if it's needed and returns it. */ - static ITypeInfo *GetTI(LCID lcid); + static ITypeInfo* GetTI(LCID lcid); - static ITypeInfo *gTypeInfo; + static ITypeInfo* gTypeInfo; static MsaaIdGenerator sIDGen; @@ -268,21 +268,21 @@ class AccessibleWrap : public Accessible, }; struct HandlerControllerData final { - HandlerControllerData(DWORD aPid, RefPtr &&aCtrl) + HandlerControllerData(DWORD aPid, RefPtr&& aCtrl) : mPid(aPid), mCtrl(std::move(aCtrl)) { mIsProxy = mozilla::mscom::IsProxy(mCtrl); } - HandlerControllerData(HandlerControllerData &&aOther) + HandlerControllerData(HandlerControllerData&& aOther) : mPid(aOther.mPid), mIsProxy(aOther.mIsProxy), mCtrl(std::move(aOther.mCtrl)) {} - bool operator==(const HandlerControllerData &aOther) const { + bool operator==(const HandlerControllerData& aOther) const { return mPid == aOther.mPid; } - bool operator==(const DWORD &aPid) const { return mPid == aPid; } + bool operator==(const DWORD& aPid) const { return mPid == aPid; } DWORD mPid; bool mIsProxy; @@ -292,8 +292,8 @@ class AccessibleWrap : public Accessible, static StaticAutoPtr> sHandlerControllers; }; -static inline AccessibleWrap *WrapperFor(const ProxyAccessible *aProxy) { - return reinterpret_cast(aProxy->GetWrapper()); +static inline AccessibleWrap* WrapperFor(const ProxyAccessible* aProxy) { + return reinterpret_cast(aProxy->GetWrapper()); } } // namespace a11y diff --git a/accessible/windows/msaa/ApplicationAccessibleWrap.h b/accessible/windows/msaa/ApplicationAccessibleWrap.h index 779cfb8500248..48bbaef013c7e 100644 --- a/accessible/windows/msaa/ApplicationAccessibleWrap.h +++ b/accessible/windows/msaa/ApplicationAccessibleWrap.h @@ -27,20 +27,20 @@ class ApplicationAccessibleWrap : public ApplicationAccessible, virtual already_AddRefed NativeAttributes() override; // IUnknown - STDMETHODIMP QueryInterface(REFIID, void **); + STDMETHODIMP QueryInterface(REFIID, void**); // IAccessibleApplication virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_appName( - /* [retval][out] */ BSTR *name); + /* [retval][out] */ BSTR* name); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_appVersion( - /* [retval][out] */ BSTR *version); + /* [retval][out] */ BSTR* version); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_toolkitName( - /* [retval][out] */ BSTR *name); + /* [retval][out] */ BSTR* name); virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_toolkitVersion( - /* [retval][out] */ BSTR *version); + /* [retval][out] */ BSTR* version); }; } // namespace a11y diff --git a/accessible/windows/msaa/LazyInstantiator.cpp b/accessible/windows/msaa/LazyInstantiator.cpp index a82a2738d446c..d0f7801e72a84 100644 --- a/accessible/windows/msaa/LazyInstantiator.cpp +++ b/accessible/windows/msaa/LazyInstantiator.cpp @@ -40,7 +40,7 @@ already_AddRefed LazyInstantiator::GetRootAccessible(HWND aHwnd) { // To track this, we set the kLazyInstantiatorProp on the HWND with a pointer // to an existing instance. We only create a new LazyInstatiator if that prop // has not already been set. - LazyInstantiator *existingInstantiator = reinterpret_cast( + LazyInstantiator* existingInstantiator = reinterpret_cast( ::GetProp(aHwnd, kLazyInstantiatorProp)); RefPtr result; @@ -63,7 +63,7 @@ already_AddRefed LazyInstantiator::GetRootAccessible(HWND aHwnd) { } // a11y is running, so we just resolve the real root accessible. - a11y::Accessible *rootAcc = widget::WinUtils::GetRootAccessibleForHWND(aHwnd); + a11y::Accessible* rootAcc = widget::WinUtils::GetRootAccessibleForHWND(aHwnd); if (!rootAcc) { return nullptr; } @@ -80,8 +80,8 @@ already_AddRefed LazyInstantiator::GetRootAccessible(HWND aHwnd) { // running). We can bypass LazyInstantiator by retrieving the internal // unknown (which is not wrapped by the LazyInstantiator) and then querying // that for IID_IAccessible. - a11y::RootAccessibleWrap *rootWrap = - static_cast(rootAcc); + a11y::RootAccessibleWrap* rootWrap = + static_cast(rootAcc); RefPtr punk(rootWrap->GetInternalUnknown()); MOZ_ASSERT(punk); @@ -103,7 +103,7 @@ already_AddRefed LazyInstantiator::GetRootAccessible(HWND aHwnd) { */ /* static */ void LazyInstantiator::EnableBlindAggregation(HWND aHwnd) { - LazyInstantiator *existingInstantiator = reinterpret_cast( + LazyInstantiator* existingInstantiator = reinterpret_cast( ::GetProp(aHwnd, kLazyInstantiatorProp)); if (!existingInstantiator) { @@ -139,7 +139,7 @@ void LazyInstantiator::ClearProp() { // Remove ourselves as the designated LazyInstantiator for mHwnd DebugOnly removedProp = ::RemoveProp(mHwnd, kLazyInstantiatorProp); MOZ_ASSERT(!removedProp || - reinterpret_cast(removedProp.value) == this); + reinterpret_cast(removedProp.value) == this); } /** @@ -160,7 +160,7 @@ LazyInstantiator::GetClientPid(const DWORD aClientTid) { struct DllBlockInfo { // The name of the DLL. - const wchar_t *mName; + const wchar_t* mName; // If mUntilVersion is ALL_VERSIONS, we'll block all versions of this dll. // Otherwise, we'll block all versions less than the given version, as queried @@ -184,7 +184,7 @@ static const DllBlockInfo gBlockedInprocDlls[] = { /** * This is the blocklist for known "bad" remote clients that instantiate a11y. */ -static const char *gBlockedRemoteClients[] = { +static const char* gBlockedRemoteClients[] = { "tbnotifier.exe" // Ask.com Toolbar, bug 1453876 }; @@ -207,7 +207,7 @@ bool LazyInstantiator::IsBlockedInjection() { for (size_t index = 0, len = ArrayLength(gBlockedInprocDlls); index < len; ++index) { - const DllBlockInfo &blockedDll = gBlockedInprocDlls[index]; + const DllBlockInfo& blockedDll = gBlockedInprocDlls[index]; HMODULE module = ::GetModuleHandleW(blockedDll.mName); if (!module) { // This dll isn't loaded. @@ -265,13 +265,13 @@ bool LazyInstantiator::ShouldInstantiate(const DWORD aClientTid) { return true; } -RootAccessibleWrap *LazyInstantiator::ResolveRootAccWrap() { - Accessible *acc = widget::WinUtils::GetRootAccessibleForHWND(mHwnd); +RootAccessibleWrap* LazyInstantiator::ResolveRootAccWrap() { + Accessible* acc = widget::WinUtils::GetRootAccessibleForHWND(mHwnd); if (!acc || !acc->IsRoot()) { return nullptr; } - return static_cast(acc); + return static_cast(acc); } /** @@ -320,8 +320,7 @@ LazyInstantiator::MaybeResolveRoot() { } // Wrap ourselves around the root accessible wrap - mRealRootUnk = - mWeakRootAccWrap->Aggregate(static_cast(this)); + mRealRootUnk = mWeakRootAccWrap->Aggregate(static_cast(this)); if (!mRealRootUnk) { return E_FAIL; } @@ -332,8 +331,8 @@ LazyInstantiator::MaybeResolveRoot() { // Now obtain mWeakAccessible which we use to forward our incoming calls // to the real accesssible. - HRESULT hr = mRealRootUnk->QueryInterface(IID_IAccessible, - (void **)&mWeakAccessible); + HRESULT hr = + mRealRootUnk->QueryInterface(IID_IAccessible, (void**)&mWeakAccessible); if (FAILED(hr)) { return hr; } @@ -366,7 +365,7 @@ LazyInstantiator::MaybeResolveRoot() { return E_NOTIMPL; } - hr = mRealRootUnk->QueryInterface(IID_IAccessible, (void **)&mWeakAccessible); + hr = mRealRootUnk->QueryInterface(IID_IAccessible, (void**)&mWeakAccessible); if (FAILED(hr)) { return hr; } @@ -460,14 +459,14 @@ LazyInstantiator::ResolveDispatch() { } // Now create the standard IDispatch for IAccessible - hr = ::CreateStdDispatch(static_cast(this), - static_cast(this), accTypeInfo, + hr = ::CreateStdDispatch(static_cast(this), + static_cast(this), accTypeInfo, getter_AddRefs(mStdDispatch)); if (FAILED(hr)) { return hr; } - hr = mStdDispatch->QueryInterface(IID_IDispatch, (void **)&mWeakDispatch); + hr = mStdDispatch->QueryInterface(IID_IDispatch, (void**)&mWeakDispatch); if (FAILED(hr)) { return hr; } @@ -491,42 +490,42 @@ LazyInstantiator::ResolveDispatch() { */ HRESULT -LazyInstantiator::GetTypeInfoCount(UINT *pctinfo) { +LazyInstantiator::GetTypeInfoCount(UINT* pctinfo) { RESOLVE_IDISPATCH; return mWeakDispatch->GetTypeInfoCount(pctinfo); } HRESULT -LazyInstantiator::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { +LazyInstantiator::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo) { RESOLVE_IDISPATCH; return mWeakDispatch->GetTypeInfo(iTInfo, lcid, ppTInfo); } HRESULT -LazyInstantiator::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) { +LazyInstantiator::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, + LCID lcid, DISPID* rgDispId) { RESOLVE_IDISPATCH; return mWeakDispatch->GetIDsOfNames(riid, rgszNames, cNames, lcid, rgDispId); } HRESULT LazyInstantiator::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, - WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, - UINT *puArgErr) { + WORD wFlags, DISPPARAMS* pDispParams, + VARIANT* pVarResult, EXCEPINFO* pExcepInfo, + UINT* puArgErr) { RESOLVE_IDISPATCH; return mWeakDispatch->Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); } HRESULT -LazyInstantiator::get_accParent(IDispatch **ppdispParent) { +LazyInstantiator::get_accParent(IDispatch** ppdispParent) { RESOLVE_ROOT; return mWeakAccessible->get_accParent(ppdispParent); } HRESULT -LazyInstantiator::get_accChildCount(long *pcountChildren) { +LazyInstantiator::get_accChildCount(long* pcountChildren) { if (!pcountChildren) { return E_INVALIDARG; } @@ -536,7 +535,7 @@ LazyInstantiator::get_accChildCount(long *pcountChildren) { } HRESULT -LazyInstantiator::get_accChild(VARIANT varChild, IDispatch **ppdispChild) { +LazyInstantiator::get_accChild(VARIANT varChild, IDispatch** ppdispChild) { if (!ppdispChild) { return E_INVALIDARG; } @@ -546,7 +545,7 @@ LazyInstantiator::get_accChild(VARIANT varChild, IDispatch **ppdispChild) { } HRESULT -LazyInstantiator::get_accName(VARIANT varChild, BSTR *pszName) { +LazyInstantiator::get_accName(VARIANT varChild, BSTR* pszName) { if (!pszName) { return E_INVALIDARG; } @@ -556,7 +555,7 @@ LazyInstantiator::get_accName(VARIANT varChild, BSTR *pszName) { } HRESULT -LazyInstantiator::get_accValue(VARIANT varChild, BSTR *pszValue) { +LazyInstantiator::get_accValue(VARIANT varChild, BSTR* pszValue) { if (!pszValue) { return E_INVALIDARG; } @@ -566,7 +565,7 @@ LazyInstantiator::get_accValue(VARIANT varChild, BSTR *pszValue) { } HRESULT -LazyInstantiator::get_accDescription(VARIANT varChild, BSTR *pszDescription) { +LazyInstantiator::get_accDescription(VARIANT varChild, BSTR* pszDescription) { if (!pszDescription) { return E_INVALIDARG; } @@ -576,7 +575,7 @@ LazyInstantiator::get_accDescription(VARIANT varChild, BSTR *pszDescription) { } HRESULT -LazyInstantiator::get_accRole(VARIANT varChild, VARIANT *pvarRole) { +LazyInstantiator::get_accRole(VARIANT varChild, VARIANT* pvarRole) { if (!pvarRole) { return E_INVALIDARG; } @@ -586,7 +585,7 @@ LazyInstantiator::get_accRole(VARIANT varChild, VARIANT *pvarRole) { } HRESULT -LazyInstantiator::get_accState(VARIANT varChild, VARIANT *pvarState) { +LazyInstantiator::get_accState(VARIANT varChild, VARIANT* pvarState) { if (!pvarState) { return E_INVALIDARG; } @@ -596,19 +595,19 @@ LazyInstantiator::get_accState(VARIANT varChild, VARIANT *pvarState) { } HRESULT -LazyInstantiator::get_accHelp(VARIANT varChild, BSTR *pszHelp) { +LazyInstantiator::get_accHelp(VARIANT varChild, BSTR* pszHelp) { return E_NOTIMPL; } HRESULT -LazyInstantiator::get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, - long *pidTopic) { +LazyInstantiator::get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, + long* pidTopic) { return E_NOTIMPL; } HRESULT LazyInstantiator::get_accKeyboardShortcut(VARIANT varChild, - BSTR *pszKeyboardShortcut) { + BSTR* pszKeyboardShortcut) { if (!pszKeyboardShortcut) { return E_INVALIDARG; } @@ -619,7 +618,7 @@ LazyInstantiator::get_accKeyboardShortcut(VARIANT varChild, } HRESULT -LazyInstantiator::get_accFocus(VARIANT *pvarChild) { +LazyInstantiator::get_accFocus(VARIANT* pvarChild) { if (!pvarChild) { return E_INVALIDARG; } @@ -629,7 +628,7 @@ LazyInstantiator::get_accFocus(VARIANT *pvarChild) { } HRESULT -LazyInstantiator::get_accSelection(VARIANT *pvarChildren) { +LazyInstantiator::get_accSelection(VARIANT* pvarChildren) { if (!pvarChildren) { return E_INVALIDARG; } @@ -640,7 +639,7 @@ LazyInstantiator::get_accSelection(VARIANT *pvarChildren) { HRESULT LazyInstantiator::get_accDefaultAction(VARIANT varChild, - BSTR *pszDefaultAction) { + BSTR* pszDefaultAction) { if (!pszDefaultAction) { return E_INVALIDARG; } @@ -656,8 +655,8 @@ LazyInstantiator::accSelect(long flagsSelect, VARIANT varChild) { } HRESULT -LazyInstantiator::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, - long *pcyHeight, VARIANT varChild) { +LazyInstantiator::accLocation(long* pxLeft, long* pyTop, long* pcxWidth, + long* pcyHeight, VARIANT varChild) { RESOLVE_ROOT; return mWeakAccessible->accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varChild); @@ -665,7 +664,7 @@ LazyInstantiator::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, HRESULT LazyInstantiator::accNavigate(long navDir, VARIANT varStart, - VARIANT *pvarEndUpAt) { + VARIANT* pvarEndUpAt) { if (!pvarEndUpAt) { return E_INVALIDARG; } @@ -675,7 +674,7 @@ LazyInstantiator::accNavigate(long navDir, VARIANT varStart, } HRESULT -LazyInstantiator::accHitTest(long xLeft, long yTop, VARIANT *pvarChild) { +LazyInstantiator::accHitTest(long xLeft, long yTop, VARIANT* pvarChild) { if (!pvarChild) { return E_INVALIDARG; } @@ -702,7 +701,7 @@ LazyInstantiator::put_accValue(VARIANT varChild, BSTR szValue) { HRESULT LazyInstantiator::QueryService(REFGUID aServiceId, REFIID aServiceIid, - void **aOutInterface) { + void** aOutInterface) { if (!aOutInterface) { return E_INVALIDARG; } diff --git a/accessible/windows/msaa/LazyInstantiator.h b/accessible/windows/msaa/LazyInstantiator.h index ef48634875158..b019383946c89 100644 --- a/accessible/windows/msaa/LazyInstantiator.h +++ b/accessible/windows/msaa/LazyInstantiator.h @@ -35,52 +35,52 @@ class LazyInstantiator final : public IAccessible, public IServiceProvider { static void EnableBlindAggregation(HWND aHwnd); // IUnknown - STDMETHODIMP QueryInterface(REFIID aIid, void **aOutInterface) override; + STDMETHODIMP QueryInterface(REFIID aIid, void** aOutInterface) override; STDMETHODIMP_(ULONG) AddRef() override; STDMETHODIMP_(ULONG) Release() override; // IDispatch - STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) override; + STDMETHODIMP GetTypeInfoCount(UINT* pctinfo) override; STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, - ITypeInfo **ppTInfo) override; - STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) override; + ITypeInfo** ppTInfo) override; + STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames, UINT cNames, + LCID lcid, DISPID* rgDispId) override; STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, - DISPPARAMS *pDispParams, VARIANT *pVarResult, - EXCEPINFO *pExcepInfo, UINT *puArgErr) override; + DISPPARAMS* pDispParams, VARIANT* pVarResult, + EXCEPINFO* pExcepInfo, UINT* puArgErr) override; // IAccessible - STDMETHODIMP get_accParent(IDispatch **ppdispParent) override; - STDMETHODIMP get_accChildCount(long *pcountChildren) override; - STDMETHODIMP get_accChild(VARIANT varChild, IDispatch **ppdispChild) override; - STDMETHODIMP get_accName(VARIANT varChild, BSTR *pszName) override; - STDMETHODIMP get_accValue(VARIANT varChild, BSTR *pszValue) override; + STDMETHODIMP get_accParent(IDispatch** ppdispParent) override; + STDMETHODIMP get_accChildCount(long* pcountChildren) override; + STDMETHODIMP get_accChild(VARIANT varChild, IDispatch** ppdispChild) override; + STDMETHODIMP get_accName(VARIANT varChild, BSTR* pszName) override; + STDMETHODIMP get_accValue(VARIANT varChild, BSTR* pszValue) override; STDMETHODIMP get_accDescription(VARIANT varChild, - BSTR *pszDescription) override; - STDMETHODIMP get_accRole(VARIANT varChild, VARIANT *pvarRole) override; - STDMETHODIMP get_accState(VARIANT varChild, VARIANT *pvarState) override; - STDMETHODIMP get_accHelp(VARIANT varChild, BSTR *pszHelp) override; - STDMETHODIMP get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, - long *pidTopic) override; + BSTR* pszDescription) override; + STDMETHODIMP get_accRole(VARIANT varChild, VARIANT* pvarRole) override; + STDMETHODIMP get_accState(VARIANT varChild, VARIANT* pvarState) override; + STDMETHODIMP get_accHelp(VARIANT varChild, BSTR* pszHelp) override; + STDMETHODIMP get_accHelpTopic(BSTR* pszHelpFile, VARIANT varChild, + long* pidTopic) override; STDMETHODIMP get_accKeyboardShortcut(VARIANT varChild, - BSTR *pszKeyboardShortcut) override; - STDMETHODIMP get_accFocus(VARIANT *pvarChild) override; - STDMETHODIMP get_accSelection(VARIANT *pvarChildren) override; + BSTR* pszKeyboardShortcut) override; + STDMETHODIMP get_accFocus(VARIANT* pvarChild) override; + STDMETHODIMP get_accSelection(VARIANT* pvarChildren) override; STDMETHODIMP get_accDefaultAction(VARIANT varChild, - BSTR *pszDefaultAction) override; + BSTR* pszDefaultAction) override; STDMETHODIMP accSelect(long flagsSelect, VARIANT varChild) override; - STDMETHODIMP accLocation(long *pxLeft, long *pyTop, long *pcxWidth, - long *pcyHeight, VARIANT varChild) override; + STDMETHODIMP accLocation(long* pxLeft, long* pyTop, long* pcxWidth, + long* pcyHeight, VARIANT varChild) override; STDMETHODIMP accNavigate(long navDir, VARIANT varStart, - VARIANT *pvarEndUpAt) override; - STDMETHODIMP accHitTest(long xLeft, long yTop, VARIANT *pvarChild) override; + VARIANT* pvarEndUpAt) override; + STDMETHODIMP accHitTest(long xLeft, long yTop, VARIANT* pvarChild) override; STDMETHODIMP accDoDefaultAction(VARIANT varChild) override; STDMETHODIMP put_accName(VARIANT varChild, BSTR szName) override; STDMETHODIMP put_accValue(VARIANT varChild, BSTR szValue) override; // IServiceProvider STDMETHODIMP QueryService(REFGUID aServiceId, REFIID aServiceIid, - void **aOutInterface) override; + void** aOutInterface) override; private: explicit LazyInstantiator(HWND aHwnd); @@ -101,7 +101,7 @@ class LazyInstantiator final : public IAccessible, public IServiceProvider { */ HRESULT ResolveDispatch(); - RootAccessibleWrap *ResolveRootAccWrap(); + RootAccessibleWrap* ResolveRootAccWrap(); void TransplantRefCnt(); void ClearProp(); @@ -118,9 +118,9 @@ class LazyInstantiator final : public IAccessible, public IServiceProvider { * references to them, we would be holding strong references to ourselves, * creating a cycle. */ - RootAccessibleWrap *mWeakRootAccWrap; - IAccessible *mWeakAccessible; - IDispatch *mWeakDispatch; + RootAccessibleWrap* mWeakRootAccWrap; + IAccessible* mWeakAccessible; + IDispatch* mWeakDispatch; }; } // namespace a11y diff --git a/accessible/windows/sdn/sdnDocAccessible.h b/accessible/windows/sdn/sdnDocAccessible.h index 18650ada04f81..5b1f9d6dd844a 100644 --- a/accessible/windows/sdn/sdnDocAccessible.h +++ b/accessible/windows/sdn/sdnDocAccessible.h @@ -17,7 +17,7 @@ namespace a11y { class sdnDocAccessible final : public ISimpleDOMDocument { public: - explicit sdnDocAccessible(DocAccessibleWrap *aAccessible) + explicit sdnDocAccessible(DocAccessibleWrap* aAccessible) : mAccessible(aAccessible){}; ~sdnDocAccessible(){}; @@ -25,23 +25,23 @@ class sdnDocAccessible final : public ISimpleDOMDocument { // ISimpleDOMDocument virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_URL( - /* [out] */ BSTR __RPC_FAR *url); + /* [out] */ BSTR __RPC_FAR* url); virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_title( - /* [out] */ BSTR __RPC_FAR *title); + /* [out] */ BSTR __RPC_FAR* title); virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_mimeType( - /* [out] */ BSTR __RPC_FAR *mimeType); + /* [out] */ BSTR __RPC_FAR* mimeType); virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_docType( - /* [out] */ BSTR __RPC_FAR *docType); + /* [out] */ BSTR __RPC_FAR* docType); virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nameSpaceURIForID( /* [in] */ short nameSpaceID, - /* [out] */ BSTR __RPC_FAR *nameSpaceURI); + /* [out] */ BSTR __RPC_FAR* nameSpaceURI); virtual /* [id] */ HRESULT STDMETHODCALLTYPE put_alternateViewMediaTypes( - /* [in] */ BSTR __RPC_FAR *commaSeparatedMediaTypes); + /* [in] */ BSTR __RPC_FAR* commaSeparatedMediaTypes); protected: RefPtr mAccessible; diff --git a/accessible/xpcom/nsAccessibleRelation.cpp b/accessible/xpcom/nsAccessibleRelation.cpp index 5523ab6c026c0..933a394689f76 100644 --- a/accessible/xpcom/nsAccessibleRelation.cpp +++ b/accessible/xpcom/nsAccessibleRelation.cpp @@ -14,21 +14,21 @@ using namespace mozilla::a11y; -nsAccessibleRelation::nsAccessibleRelation(uint32_t aType, Relation *aRel) +nsAccessibleRelation::nsAccessibleRelation(uint32_t aType, Relation* aRel) : mType(aType) { mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID); - Accessible *targetAcc = nullptr; + Accessible* targetAcc = nullptr; while ((targetAcc = aRel->Next())) - mTargets->AppendElement(static_cast(ToXPC(targetAcc))); + mTargets->AppendElement(static_cast(ToXPC(targetAcc))); } nsAccessibleRelation::nsAccessibleRelation( - uint32_t aType, const nsTArray *aTargets) + uint32_t aType, const nsTArray* aTargets) : mType(aType) { mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID); for (uint32_t idx = 0; idx < aTargets->Length(); ++idx) { mTargets->AppendElement( - static_cast(ToXPC(aTargets->ElementAt(idx)))); + static_cast(ToXPC(aTargets->ElementAt(idx)))); } } @@ -39,21 +39,21 @@ NS_IMPL_ISUPPORTS(nsAccessibleRelation, nsIAccessibleRelation) // nsIAccessibleRelation NS_IMETHODIMP -nsAccessibleRelation::GetRelationType(uint32_t *aType) { +nsAccessibleRelation::GetRelationType(uint32_t* aType) { NS_ENSURE_ARG_POINTER(aType); *aType = mType; return NS_OK; } NS_IMETHODIMP -nsAccessibleRelation::GetTargetsCount(uint32_t *aCount) { +nsAccessibleRelation::GetTargetsCount(uint32_t* aCount) { NS_ENSURE_ARG_POINTER(aCount); *aCount = 0; return mTargets->GetLength(aCount); } NS_IMETHODIMP -nsAccessibleRelation::GetTarget(uint32_t aIndex, nsIAccessible **aTarget) { +nsAccessibleRelation::GetTarget(uint32_t aIndex, nsIAccessible** aTarget) { NS_ENSURE_ARG_POINTER(aTarget); nsresult rv = NS_OK; nsCOMPtr target = do_QueryElementAt(mTargets, aIndex, &rv); @@ -62,7 +62,7 @@ nsAccessibleRelation::GetTarget(uint32_t aIndex, nsIAccessible **aTarget) { } NS_IMETHODIMP -nsAccessibleRelation::GetTargets(nsIArray **aTargets) { +nsAccessibleRelation::GetTargets(nsIArray** aTargets) { NS_ENSURE_ARG_POINTER(aTargets); NS_ADDREF(*aTargets = mTargets); return NS_OK; diff --git a/browser/components/about/AboutRedirector.h b/browser/components/about/AboutRedirector.h index 464408d602f1f..51e7b87e3f671 100644 --- a/browser/components/about/AboutRedirector.h +++ b/browser/components/about/AboutRedirector.h @@ -18,7 +18,7 @@ class AboutRedirector : public nsIAboutModule { AboutRedirector() {} - static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); + static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult); protected: virtual ~AboutRedirector() {} diff --git a/browser/components/dirprovider/DirectoryProvider.cpp b/browser/components/dirprovider/DirectoryProvider.cpp index acd84b905cbf3..7963dbcf7accd 100644 --- a/browser/components/dirprovider/DirectoryProvider.cpp +++ b/browser/components/dirprovider/DirectoryProvider.cpp @@ -34,8 +34,8 @@ NS_IMPL_ISUPPORTS(DirectoryProvider, nsIDirectoryServiceProvider, nsIDirectoryServiceProvider2) NS_IMETHODIMP -DirectoryProvider::GetFile(const char *aKey, bool *aPersist, - nsIFile **aResult) { +DirectoryProvider::GetFile(const char* aKey, bool* aPersist, + nsIFile** aResult) { return NS_ERROR_FAILURE; } @@ -56,8 +56,8 @@ DirectoryProvider::GetFile(const char *aKey, bool *aPersist, // "distribution.searchplugins.defaultLocale" // which specifies a default locale to use. -static void AppendDistroSearchDirs(nsIProperties *aDirSvc, - nsCOMArray &array) { +static void AppendDistroSearchDirs(nsIProperties* aDirSvc, + nsCOMArray& array) { nsCOMPtr searchPlugins; nsresult rv = aDirSvc->Get(XRE_APP_DISTRIBUTION_DIR, NS_GET_IID(nsIFile), getter_AddRefs(searchPlugins)); @@ -118,7 +118,7 @@ static void AppendDistroSearchDirs(nsIProperties *aDirSvc, } NS_IMETHODIMP -DirectoryProvider::GetFiles(const char *aKey, nsISimpleEnumerator **aResult) { +DirectoryProvider::GetFiles(const char* aKey, nsISimpleEnumerator** aResult) { if (!strcmp(aKey, NS_APP_DISTRIBUTION_SEARCH_DIR_LIST)) { nsCOMPtr dirSvc( do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID)); @@ -134,13 +134,13 @@ DirectoryProvider::GetFiles(const char *aKey, nsISimpleEnumerator **aResult) { } NS_IMETHODIMP -DirectoryProvider::AppendingEnumerator::HasMoreElements(bool *aResult) { +DirectoryProvider::AppendingEnumerator::HasMoreElements(bool* aResult) { *aResult = mNext ? true : false; return NS_OK; } NS_IMETHODIMP -DirectoryProvider::AppendingEnumerator::GetNext(nsISupports **aResult) { +DirectoryProvider::AppendingEnumerator::GetNext(nsISupports** aResult) { if (aResult) NS_ADDREF(*aResult = mNext); mNext = nullptr; @@ -160,7 +160,7 @@ DirectoryProvider::AppendingEnumerator::GetNext(nsISupports **aResult) { nextbase->Clone(getter_AddRefs(mNext)); if (!mNext) continue; - char const *const *i = mAppendList; + char const* const* i = mAppendList; while (*i) { mNext->AppendNative(nsDependentCString(*i)); ++i; @@ -177,7 +177,7 @@ DirectoryProvider::AppendingEnumerator::GetNext(nsISupports **aResult) { } DirectoryProvider::AppendingEnumerator::AppendingEnumerator( - nsISimpleEnumerator *aBase, char const *const *aAppendList) + nsISimpleEnumerator* aBase, char const* const* aAppendList) : mBase(aBase), mAppendList(aAppendList) { // Initialize mNext to begin. GetNext(nullptr); diff --git a/browser/components/dirprovider/DirectoryProvider.h b/browser/components/dirprovider/DirectoryProvider.h index 7b33ad41b6fa9..e2c1ffdb0c734 100644 --- a/browser/components/dirprovider/DirectoryProvider.h +++ b/browser/components/dirprovider/DirectoryProvider.h @@ -30,14 +30,14 @@ class DirectoryProvider final : public nsIDirectoryServiceProvider2 { public: NS_DECL_NSISIMPLEENUMERATOR - AppendingEnumerator(nsISimpleEnumerator *aBase, - char const *const *aAppendList); + AppendingEnumerator(nsISimpleEnumerator* aBase, + char const* const* aAppendList); private: ~AppendingEnumerator() override = default; nsCOMPtr mBase; - char const *const *const mAppendList; + char const* const* const mAppendList; nsCOMPtr mNext; }; }; diff --git a/browser/components/shell/nsGNOMEShellService.cpp b/browser/components/shell/nsGNOMEShellService.cpp index bf797176e28ab..7d21a3fc848d3 100644 --- a/browser/components/shell/nsGNOMEShellService.cpp +++ b/browser/components/shell/nsGNOMEShellService.cpp @@ -44,13 +44,13 @@ using namespace mozilla; struct ProtocolAssociation { - const char *name; + const char* name; bool essential; }; struct MimeTypeAssociation { - const char *mimeType; - const char *extensions; + const char* mimeType; + const char* extensions; }; static const ProtocolAssociation appProtocols[] = { @@ -115,15 +115,15 @@ NS_IMPL_ISUPPORTS(nsGNOMEShellService, nsIGNOMEShellService, nsIShellService, nsIToolkitShellService) bool nsGNOMEShellService::GetAppPathFromLauncher() { - gchar *tmp; + gchar* tmp; - const char *launcher = PR_GetEnv("MOZ_APP_LAUNCHER"); + const char* launcher = PR_GetEnv("MOZ_APP_LAUNCHER"); if (!launcher) return false; if (g_path_is_absolute(launcher)) { mAppPath = launcher; tmp = g_path_get_basename(launcher); - gchar *fullpath = g_find_program_in_path(tmp); + gchar* fullpath = g_find_program_in_path(tmp); if (fullpath && mAppPath.Equals(fullpath)) mAppIsInPath = true; g_free(fullpath); } else { @@ -137,10 +137,10 @@ bool nsGNOMEShellService::GetAppPathFromLauncher() { return true; } -bool nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const { - gchar *commandPath; +bool nsGNOMEShellService::KeyMatchesAppName(const char* aKeyValue) const { + gchar* commandPath; if (mUseLocaleFilenames) { - gchar *nativePath = + gchar* nativePath = g_filename_from_utf8(aKeyValue, -1, nullptr, nullptr, nullptr); if (!nativePath) { NS_ERROR("Error converting path to filesystem encoding"); @@ -161,9 +161,9 @@ bool nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const { } bool nsGNOMEShellService::CheckHandlerMatchesAppName( - const nsACString &handler) const { + const nsACString& handler) const { gint argc; - gchar **argv; + gchar** argv; nsAutoCString command(handler); // The string will be something of the form: [/path/to/]browser "%s" @@ -182,17 +182,17 @@ bool nsGNOMEShellService::CheckHandlerMatchesAppName( NS_IMETHODIMP nsGNOMEShellService::IsDefaultBrowser(bool aForAllTypes, - bool *aIsDefaultBrowser) { + bool* aIsDefaultBrowser) { *aIsDefaultBrowser = false; if (IsRunningAsASnap()) { - const gchar *argv[] = {"xdg-settings", "check", "default-web-browser", + const gchar* argv[] = {"xdg-settings", "check", "default-web-browser", "firefox.desktop", nullptr}; GSpawnFlags flags = static_cast(G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL); - gchar *output = nullptr; + gchar* output = nullptr; gint exit_status = 0; - if (!g_spawn_sync(nullptr, (gchar **)argv, nullptr, flags, nullptr, nullptr, + if (!g_spawn_sync(nullptr, (gchar**)argv, nullptr, flags, nullptr, nullptr, &output, nullptr, &exit_status, nullptr)) { return NS_OK; } @@ -243,12 +243,12 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers) { #endif if (IsRunningAsASnap()) { - const gchar *argv[] = {"xdg-settings", "set", "default-web-browser", + const gchar* argv[] = {"xdg-settings", "set", "default-web-browser", "firefox.desktop", nullptr}; GSpawnFlags flags = static_cast(G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL); - g_spawn_sync(nullptr, (gchar **)argv, nullptr, flags, nullptr, nullptr, + g_spawn_sync(nullptr, (gchar**)argv, nullptr, flags, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); return NS_OK; } @@ -312,16 +312,16 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers) { } NS_IMETHODIMP -nsGNOMEShellService::GetCanSetDesktopBackground(bool *aResult) { +nsGNOMEShellService::GetCanSetDesktopBackground(bool* aResult) { // setting desktop background is currently only supported // for Gnome or desktops using the same GSettings keys - const char *currentDesktop = getenv("XDG_CURRENT_DESKTOP"); + const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP"); if (currentDesktop && strstr(currentDesktop, "GNOME") != nullptr) { *aResult = true; return NS_OK; } - const char *gnomeSession = getenv("GNOME_DESKTOP_SESSION_ID"); + const char* gnomeSession = getenv("GNOME_DESKTOP_SESSION_ID"); if (gnomeSession) { *aResult = true; } else { @@ -331,7 +331,7 @@ nsGNOMEShellService::GetCanSetDesktopBackground(bool *aResult) { return NS_OK; } -static nsresult WriteImage(const nsCString &aPath, imgIContainer *aImage) { +static nsresult WriteImage(const nsCString& aPath, imgIContainer* aImage) { #if !defined(MOZ_WIDGET_GTK) return NS_ERROR_NOT_AVAILABLE; #else @@ -339,7 +339,7 @@ static nsresult WriteImage(const nsCString &aPath, imgIContainer *aImage) { do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1"); if (!imgToPixbuf) return NS_ERROR_NOT_AVAILABLE; - GdkPixbuf *pixbuf = imgToPixbuf->ConvertImageToPixbuf(aImage); + GdkPixbuf* pixbuf = imgToPixbuf->ConvertImageToPixbuf(aImage); if (!pixbuf) return NS_ERROR_NOT_AVAILABLE; gboolean res = gdk_pixbuf_save(pixbuf, aPath.get(), "png", nullptr, nullptr); @@ -350,9 +350,9 @@ static nsresult WriteImage(const nsCString &aPath, imgIContainer *aImage) { } NS_IMETHODIMP -nsGNOMEShellService::SetDesktopBackground(dom::Element *aElement, +nsGNOMEShellService::SetDesktopBackground(dom::Element* aElement, int32_t aPosition, - const nsACString &aImageName) { + const nsACString& aImageName) { nsresult rv; nsCOMPtr imageContent = do_QueryInterface(aElement, &rv); @@ -415,7 +415,7 @@ nsGNOMEShellService::SetDesktopBackground(dom::Element *aElement, gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(kDesktopBGSchema), getter_AddRefs(background_settings)); if (background_settings) { - gchar *file_uri = g_filename_to_uri(filePath.get(), nullptr, nullptr); + gchar* file_uri = g_filename_to_uri(filePath.get(), nullptr, nullptr); if (!file_uri) return NS_ERROR_FAILURE; background_settings->SetString(NS_LITERAL_CSTRING(kDesktopOptionGSKey), @@ -437,7 +437,7 @@ nsGNOMEShellService::SetDesktopBackground(dom::Element *aElement, #define COLOR_8_TO_16_BIT(_c) ((_c) << 8 | (_c)) NS_IMETHODIMP -nsGNOMEShellService::GetDesktopBackgroundColor(uint32_t *aColor) { +nsGNOMEShellService::GetDesktopBackgroundColor(uint32_t* aColor) { nsCOMPtr gsettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); nsCOMPtr background_settings; @@ -467,10 +467,10 @@ nsGNOMEShellService::GetDesktopBackgroundColor(uint32_t *aColor) { return NS_OK; } -static void ColorToCString(uint32_t aColor, nsCString &aResult) { +static void ColorToCString(uint32_t aColor, nsCString& aResult) { // The #rrrrggggbbbb format is used to match gdk_color_to_string() aResult.SetLength(13); - char *buf = aResult.BeginWriting(); + char* buf = aResult.BeginWriting(); if (!buf) return; uint16_t red = COLOR_8_TO_16_BIT((aColor >> 16) & 0xff); @@ -523,8 +523,8 @@ nsGNOMEShellService::OpenApplication(int32_t aApplication) { } NS_IMETHODIMP -nsGNOMEShellService::OpenApplicationWithURI(nsIFile *aApplication, - const nsACString &aURI) { +nsGNOMEShellService::OpenApplicationWithURI(nsIFile* aApplication, + const nsACString& aURI) { nsresult rv; nsCOMPtr process = do_CreateInstance("@mozilla.org/process/util;1", &rv); @@ -534,6 +534,6 @@ nsGNOMEShellService::OpenApplicationWithURI(nsIFile *aApplication, if (NS_FAILED(rv)) return rv; const nsCString spec(aURI); - const char *specStr = spec.get(); + const char* specStr = spec.get(); return process->Run(false, &specStr, 1); } diff --git a/build/macosx/permissions/chown_revert.c b/build/macosx/permissions/chown_revert.c index daef0b0559cbf..72dc1e64d5cb0 100644 --- a/build/macosx/permissions/chown_revert.c +++ b/build/macosx/permissions/chown_revert.c @@ -5,7 +5,7 @@ #include #include -int main(int argc, char **argv) { +int main(int argc, char** argv) { if (argc != 2) return 1; uid_t realuser = getuid(); @@ -14,5 +14,5 @@ int main(int argc, char **argv) { uidstring[19] = '\0'; return execl("/usr/sbin/chown", "/usr/sbin/chown", "-R", "-h", uidstring, - argv[1], (char *)0); + argv[1], (char*)0); } diff --git a/build/macosx/permissions/chown_root.c b/build/macosx/permissions/chown_root.c index d4996ab5d65c4..e2ef111c7f60a 100644 --- a/build/macosx/permissions/chown_root.c +++ b/build/macosx/permissions/chown_root.c @@ -4,9 +4,9 @@ #include -int main(int argc, char **argv) { +int main(int argc, char** argv) { if (argc != 2) return 1; return execl("/usr/sbin/chown", "/usr/sbin/chown", "-R", "-h", "root:admin", - argv[1], (char *)0); + argv[1], (char*)0); } diff --git a/build/unix/elfhack/elf.cpp b/build/unix/elfhack/elf.cpp index 1925e0da4dba0..ba1f7de18e03d 100644 --- a/build/unix/elfhack/elf.cpp +++ b/build/unix/elfhack/elf.cpp @@ -8,7 +8,7 @@ #include "elfxx.h" template -void Elf_Ehdr_Traits::swap(T &t, R &r) { +void Elf_Ehdr_Traits::swap(T& t, R& r) { memcpy(r.e_ident, t.e_ident, sizeof(r.e_ident)); r.e_type = endian::swap(t.e_type); r.e_machine = endian::swap(t.e_machine); @@ -26,7 +26,7 @@ void Elf_Ehdr_Traits::swap(T &t, R &r) { } template -void Elf_Phdr_Traits::swap(T &t, R &r) { +void Elf_Phdr_Traits::swap(T& t, R& r) { r.p_type = endian::swap(t.p_type); r.p_offset = endian::swap(t.p_offset); r.p_vaddr = endian::swap(t.p_vaddr); @@ -38,7 +38,7 @@ void Elf_Phdr_Traits::swap(T &t, R &r) { } template -void Elf_Shdr_Traits::swap(T &t, R &r) { +void Elf_Shdr_Traits::swap(T& t, R& r) { r.sh_name = endian::swap(t.sh_name); r.sh_type = endian::swap(t.sh_type); r.sh_flags = endian::swap(t.sh_flags); @@ -52,13 +52,13 @@ void Elf_Shdr_Traits::swap(T &t, R &r) { } template -void Elf_Dyn_Traits::swap(T &t, R &r) { +void Elf_Dyn_Traits::swap(T& t, R& r) { r.d_tag = endian::swap(t.d_tag); r.d_un.d_val = endian::swap(t.d_un.d_val); } template -void Elf_Sym_Traits::swap(T &t, R &r) { +void Elf_Sym_Traits::swap(T& t, R& r) { r.st_name = endian::swap(t.st_name); r.st_value = endian::swap(t.st_value); r.st_size = endian::swap(t.st_size); @@ -69,26 +69,26 @@ void Elf_Sym_Traits::swap(T &t, R &r) { template struct _Rel_info { - static inline void swap(Elf32_Word &t, Elf32_Word &r) { r = endian::swap(t); } - static inline void swap(Elf64_Xword &t, Elf64_Xword &r) { + static inline void swap(Elf32_Word& t, Elf32_Word& r) { r = endian::swap(t); } + static inline void swap(Elf64_Xword& t, Elf64_Xword& r) { r = endian::swap(t); } - static inline void swap(Elf64_Xword &t, Elf32_Word &r) { + static inline void swap(Elf64_Xword& t, Elf32_Word& r) { r = endian::swap(ELF32_R_INFO(ELF64_R_SYM(t), ELF64_R_TYPE(t))); } - static inline void swap(Elf32_Word &t, Elf64_Xword &r) { + static inline void swap(Elf32_Word& t, Elf64_Xword& r) { r = endian::swap(ELF64_R_INFO(ELF32_R_SYM(t), ELF32_R_TYPE(t))); } }; template -void Elf_Rel_Traits::swap(T &t, R &r) { +void Elf_Rel_Traits::swap(T& t, R& r) { r.r_offset = endian::swap(t.r_offset); _Rel_info::swap(t.r_info, r.r_info); } template -void Elf_Rela_Traits::swap(T &t, R &r) { +void Elf_Rela_Traits::swap(T& t, R& r) { r.r_offset = endian::swap(t.r_offset); _Rel_info::swap(t.r_info, r.r_info); r.r_addend = endian::swap(t.r_addend); @@ -99,13 +99,13 @@ static const Elf32_Shdr null32_section = {0, SHT_NULL, 0, 0, 0, Elf_Shdr null_section(null32_section); -Elf_Ehdr::Elf_Ehdr(std::ifstream &file, char ei_class, char ei_data) +Elf_Ehdr::Elf_Ehdr(std::ifstream& file, char ei_class, char ei_data) : serializable(file, ei_class, ei_data), ElfSection(null_section, nullptr, nullptr) { shdr.sh_size = Elf_Ehdr::size(ei_class); } -Elf::Elf(std::ifstream &file) { +Elf::Elf(std::ifstream& file) { if (!file.is_open()) throw std::runtime_error("Error opening file"); file.exceptions(std::ifstream::eofbit | std::ifstream::failbit | @@ -152,7 +152,7 @@ Elf::Elf(std::ifstream &file) { "unsupported ELF inconsistency: ehdr->e_phentsize != sizeof(phdr)"); // Read section headers - Elf_Shdr **shdr = new Elf_Shdr *[ehdr->e_shnum]; + Elf_Shdr** shdr = new Elf_Shdr*[ehdr->e_shnum]; file.seekg(ehdr->e_shoff); for (int i = 0; i < ehdr->e_shnum; i++) shdr[i] = new Elf_Shdr(file, e_ident[EI_CLASS], e_ident[EI_DATA]); @@ -177,7 +177,7 @@ Elf::Elf(std::ifstream &file) { tmp_file = &file; // Fill sections list - sections = new ElfSection *[ehdr->e_shnum]; + sections = new ElfSection*[ehdr->e_shnum]; for (int i = 0; i < ehdr->e_shnum; i++) sections[i] = nullptr; for (int i = 1; i < ehdr->e_shnum; i++) { if (sections[i] != nullptr) continue; @@ -223,7 +223,7 @@ Elf::Elf(std::ifstream &file) { for (int i = 0; i < ehdr->e_shnum; i++) delete shdr[i]; delete[] shdr; - eh_shstrndx = (ElfStrtab_Section *)sections[ehdr->e_shstrndx]; + eh_shstrndx = (ElfStrtab_Section*)sections[ehdr->e_shstrndx]; // Skip reading program headers if there aren't any if (ehdr->e_phnum == 0) return; @@ -242,7 +242,7 @@ Elf::Elf(std::ifstream &file) { if ((ehdr->e_machine == EM_X86_64) && (phdr.p_align == 0x200000)) phdr.p_align = 0x1000; } - ElfSegment *segment = new ElfSegment(&phdr); + ElfSegment* segment = new ElfSegment(&phdr); // Some segments aren't entirely filled (if at all) by sections // For those, we use fake sections if ((phdr.p_type == PT_LOAD) && (phdr.p_offset == 0)) { @@ -286,20 +286,20 @@ Elf::Elf(std::ifstream &file) { } Elf::~Elf() { - for (std::vector::iterator seg = segments.begin(); + for (std::vector::iterator seg = segments.begin(); seg != segments.end(); seg++) delete *seg; delete[] sections; - ElfSection *section = ehdr; + ElfSection* section = ehdr; while (section != nullptr) { - ElfSection *next = section->getNext(); + ElfSection* next = section->getNext(); delete section; section = next; } } // TODO: This shouldn't fail after inserting sections -ElfSection *Elf::getSection(int index) { +ElfSection* Elf::getSection(int index) { if ((index < -1) || (index >= ehdr->e_shnum)) throw std::runtime_error("Section index out of bounds"); if (index == -1) @@ -308,9 +308,9 @@ ElfSection *Elf::getSection(int index) { // Special case: the section at index 0 is void if (index == 0) return nullptr; // Infinite recursion guard - if (sections[index] == (ElfSection *)this) return nullptr; + if (sections[index] == (ElfSection*)this) return nullptr; if (sections[index] == nullptr) { - sections[index] = (ElfSection *)this; + sections[index] = (ElfSection*)this; switch (tmp_shdr[index]->sh_type) { case SHT_DYNAMIC: sections[index] = @@ -340,9 +340,9 @@ ElfSection *Elf::getSection(int index) { return sections[index]; } -ElfSection *Elf::getSectionAt(unsigned int offset) { +ElfSection* Elf::getSectionAt(unsigned int offset) { for (int i = 1; i < ehdr->e_shnum; i++) { - ElfSection *section = getSection(i); + ElfSection* section = getSection(i); if ((section != nullptr) && (section->getFlags() & SHF_ALLOC) && !(section->getFlags() & SHF_TLS) && (offset >= section->getAddr()) && (offset < section->getAddr() + section->getSize())) @@ -351,8 +351,8 @@ ElfSection *Elf::getSectionAt(unsigned int offset) { return nullptr; } -ElfSegment *Elf::getSegmentByType(unsigned int type, ElfSegment *last) { - std::vector::iterator seg; +ElfSegment* Elf::getSegmentByType(unsigned int type, ElfSegment* last) { + std::vector::iterator seg; if (last) { seg = std::find(segments.begin(), segments.end(), last); ++seg; @@ -363,22 +363,22 @@ ElfSegment *Elf::getSegmentByType(unsigned int type, ElfSegment *last) { return nullptr; } -void Elf::removeSegment(ElfSegment *segment) { +void Elf::removeSegment(ElfSegment* segment) { if (!segment) return; - std::vector::iterator seg; + std::vector::iterator seg; seg = std::find(segments.begin(), segments.end(), segment); if (seg == segments.end()) return; segment->clear(); segments.erase(seg); } -ElfDynamic_Section *Elf::getDynSection() { - for (std::vector::iterator seg = segments.begin(); +ElfDynamic_Section* Elf::getDynSection() { + for (std::vector::iterator seg = segments.begin(); seg != segments.end(); seg++) if (((*seg)->getType() == PT_DYNAMIC) && ((*seg)->getFirstSection() != nullptr) && (*seg)->getFirstSection()->getType() == SHT_DYNAMIC) - return (ElfDynamic_Section *)(*seg)->getFirstSection(); + return (ElfDynamic_Section*)(*seg)->getFirstSection(); return nullptr; } @@ -386,7 +386,7 @@ ElfDynamic_Section *Elf::getDynSection() { void Elf::normalize() { // fixup section headers sh_name; TODO: that should be done by sections // themselves - for (ElfSection *section = ehdr; section != nullptr; + for (ElfSection* section = ehdr; section != nullptr; section = section->getNext()) { if (section->getIndex() == 0) continue; @@ -397,10 +397,10 @@ void Elf::normalize() { ehdr->markDirty(); // Check segments consistency int i = 0; - for (std::vector::iterator seg = segments.begin(); + for (std::vector::iterator seg = segments.begin(); seg != segments.end(); seg++, i++) { - std::list::iterator it = (*seg)->begin(); - for (ElfSection *last = *(it++); it != (*seg)->end(); last = *(it++)) { + std::list::iterator it = (*seg)->begin(); + for (ElfSection* last = *(it++); it != (*seg)->end(); last = *(it++)) { if (((*it)->getType() != SHT_NOBITS) && ((*it)->getAddr() - last->getAddr()) != ((*it)->getOffset() - last->getOffset())) { @@ -409,8 +409,8 @@ void Elf::normalize() { } } - ElfSegment *prevLoad = nullptr; - for (auto &it : segments) { + ElfSegment* prevLoad = nullptr; + for (auto& it : segments) { if (it->getType() == PT_LOAD) { if (prevLoad) { size_t alignedPrevEnd = (prevLoad->getAddr() + prevLoad->getMemSize() + @@ -442,7 +442,7 @@ void Elf::normalize() { // Check sections consistency unsigned int minOffset = 0; - for (ElfSection *section = ehdr; section != nullptr; + for (ElfSection* section = ehdr; section != nullptr; section = section->getNext()) { unsigned int offset = section->getOffset(); if (offset < minOffset) { @@ -454,13 +454,13 @@ void Elf::normalize() { } } -void Elf::write(std::ofstream &file) { +void Elf::write(std::ofstream& file) { normalize(); - for (ElfSection *section = ehdr; section != nullptr; + for (ElfSection* section = ehdr; section != nullptr; section = section->getNext()) { file.seekp(section->getOffset()); if (section == phdr_section) { - for (std::vector::iterator seg = segments.begin(); + for (std::vector::iterator seg = segments.begin(); seg != segments.end(); seg++) { Elf_Phdr phdr; phdr.p_type = (*seg)->getType(); @@ -476,7 +476,7 @@ void Elf::write(std::ofstream &file) { } else if (section == shdr_section) { null_section.serialize(file, ehdr->e_ident[EI_CLASS], ehdr->e_ident[EI_DATA]); - for (ElfSection *sec = ehdr; sec != nullptr; sec = sec->getNext()) { + for (ElfSection* sec = ehdr; sec != nullptr; sec = sec->getNext()) { if (sec->getType() != SHT_NULL) sec->getShdr().serialize(file, ehdr->e_ident[EI_CLASS], ehdr->e_ident[EI_DATA]); @@ -486,7 +486,7 @@ void Elf::write(std::ofstream &file) { } } -ElfSection::ElfSection(Elf_Shdr &s, std::ifstream *file, Elf *parent) +ElfSection::ElfSection(Elf_Shdr& s, std::ifstream* file, Elf* parent) : shdr(s), link(shdr.sh_link == SHN_UNDEF ? nullptr : parent->getSection(shdr.sh_link)), @@ -497,7 +497,7 @@ ElfSection::ElfSection(Elf_Shdr &s, std::ifstream *file, Elf *parent) (shdr.sh_type == SHT_NOBITS)) data = nullptr; else { - data = static_cast(malloc(shdr.sh_size)); + data = static_cast(malloc(shdr.sh_size)); if (!data) { throw std::runtime_error("Could not malloc ElfSection data"); } @@ -509,7 +509,7 @@ ElfSection::ElfSection(Elf_Shdr &s, std::ifstream *file, Elf *parent) if (shdr.sh_name == 0) name = nullptr; else { - ElfStrtab_Section *strtab = (ElfStrtab_Section *)parent->getSection(-1); + ElfStrtab_Section* strtab = (ElfStrtab_Section*)parent->getSection(-1); // Special case (see elfgeneric.cpp): if strtab is nullptr, the // section being created is the strtab. if (strtab == nullptr) @@ -548,8 +548,8 @@ unsigned int ElfSection::getOffset() { unsigned int offset = previous->getOffset(); - ElfSegment *ptload = getSegmentByType(PT_LOAD); - ElfSegment *prev_ptload = previous->getSegmentByType(PT_LOAD); + ElfSegment* ptload = getSegmentByType(PT_LOAD); + ElfSegment* prev_ptload = previous->getSegmentByType(PT_LOAD); if (ptload && (ptload == prev_ptload)) { offset += getAddr() - previous->getAddr(); @@ -559,7 +559,7 @@ unsigned int ElfSection::getOffset() { if (previous->getType() != SHT_NOBITS) offset += previous->getSize(); Elf32_Word align = 0x1000; - for (std::vector::iterator seg = segments.begin(); + for (std::vector::iterator seg = segments.begin(); seg != segments.end(); seg++) align = std::max(align, (*seg)->getAlign()); @@ -581,7 +581,7 @@ unsigned int ElfSection::getOffset() { int ElfSection::getIndex() { if (index != -1) return index; if (getType() == SHT_NULL) return (index = 0); - ElfSection *reference; + ElfSection* reference; for (reference = previous; (reference != nullptr) && (reference->getType() == SHT_NULL); reference = reference->getPrevious()) @@ -590,7 +590,7 @@ int ElfSection::getIndex() { return (index = reference->getIndex() + 1); } -Elf_Shdr &ElfSection::getShdr() { +Elf_Shdr& ElfSection::getShdr() { getOffset(); if (shdr.sh_link == (Elf32_Word)-1) shdr.sh_link = getLink() ? getLink()->getIndex() : 0; @@ -602,7 +602,7 @@ Elf_Shdr &ElfSection::getShdr() { return shdr; } -ElfSegment::ElfSegment(Elf_Phdr *phdr) +ElfSegment::ElfSegment(Elf_Phdr* phdr) : type(phdr->p_type), v_p_diff(phdr->p_paddr - phdr->p_vaddr), flags(phdr->p_flags), @@ -611,19 +611,19 @@ ElfSegment::ElfSegment(Elf_Phdr *phdr) filesz(phdr->p_filesz), memsz(phdr->p_memsz) {} -void ElfSegment::addSection(ElfSection *section) { +void ElfSegment::addSection(ElfSection* section) { // Make sure all sections in PT_GNU_RELRO won't be moved by elfhack assert(!((type == PT_GNU_RELRO) && (section->isRelocatable()))); // TODO: Check overlapping sections - std::list::iterator i; + std::list::iterator i; for (i = sections.begin(); i != sections.end(); ++i) if ((*i)->getAddr() > section->getAddr()) break; sections.insert(i, section); section->addToSegment(this); } -void ElfSegment::removeSection(ElfSection *section) { +void ElfSegment::removeSection(ElfSection* section) { sections.remove(section); section->removeFromSegment(this); } @@ -633,7 +633,7 @@ unsigned int ElfSegment::getFileSize() { if (sections.empty()) return 0; // Search the last section that is not SHT_NOBITS - std::list::reverse_iterator i; + std::list::reverse_iterator i; for (i = sections.rbegin(); (i != sections.rend()) && ((*i)->getType() == SHT_NOBITS); ++i) ; @@ -674,25 +674,25 @@ unsigned int ElfSegment::getAddr() { } void ElfSegment::clear() { - for (std::list::iterator i = sections.begin(); + for (std::list::iterator i = sections.begin(); i != sections.end(); ++i) (*i)->removeFromSegment(this); sections.clear(); } -ElfValue *ElfDynamic_Section::getValueForType(unsigned int tag) { +ElfValue* ElfDynamic_Section::getValueForType(unsigned int tag) { for (unsigned int i = 0; i < shdr.sh_size / shdr.sh_entsize; i++) if (dyns[i].tag == tag) return dyns[i].value; return nullptr; } -ElfSection *ElfDynamic_Section::getSectionForType(unsigned int tag) { - ElfValue *value = getValueForType(tag); +ElfSection* ElfDynamic_Section::getSectionForType(unsigned int tag) { + ElfValue* value = getValueForType(tag); return value ? value->getSection() : nullptr; } -bool ElfDynamic_Section::setValueForType(unsigned int tag, ElfValue *val) { +bool ElfDynamic_Section::setValueForType(unsigned int tag, ElfValue* val) { unsigned int i; unsigned int shnum = shdr.sh_size / shdr.sh_entsize; for (i = 0; (i < shnum) && (dyns[i].tag != DT_NULL); i++) @@ -711,8 +711,8 @@ bool ElfDynamic_Section::setValueForType(unsigned int tag, ElfValue *val) { return true; } -ElfDynamic_Section::ElfDynamic_Section(Elf_Shdr &s, std::ifstream *file, - Elf *parent) +ElfDynamic_Section::ElfDynamic_Section(Elf_Shdr& s, std::ifstream* file, + Elf* parent) : ElfSection(s, file, parent) { int pos = file->tellg(); dyns.resize(s.sh_size / s.sh_entsize); @@ -802,7 +802,7 @@ ElfDynamic_Section::~ElfDynamic_Section() { delete dyns[i].value; } -void ElfDynamic_Section::serialize(std::ofstream &file, char ei_class, +void ElfDynamic_Section::serialize(std::ofstream& file, char ei_class, char ei_data) { for (unsigned int i = 0; i < shdr.sh_size / shdr.sh_entsize; i++) { Elf_Dyn dyn; @@ -812,19 +812,19 @@ void ElfDynamic_Section::serialize(std::ofstream &file, char ei_class, } } -ElfSymtab_Section::ElfSymtab_Section(Elf_Shdr &s, std::ifstream *file, - Elf *parent) +ElfSymtab_Section::ElfSymtab_Section(Elf_Shdr& s, std::ifstream* file, + Elf* parent) : ElfSection(s, file, parent) { int pos = file->tellg(); syms.resize(s.sh_size / s.sh_entsize); - ElfStrtab_Section *strtab = (ElfStrtab_Section *)getLink(); + ElfStrtab_Section* strtab = (ElfStrtab_Section*)getLink(); file->seekg(shdr.sh_offset); for (unsigned int i = 0; i < shdr.sh_size / shdr.sh_entsize; i++) { Elf_Sym sym(*file, parent->getClass(), parent->getData()); syms[i].name = strtab->getStr(sym.st_name); syms[i].info = sym.st_info; syms[i].other = sym.st_other; - ElfSection *section = + ElfSection* section = (sym.st_shndx == SHN_ABS) ? nullptr : parent->getSection(sym.st_shndx); new (&syms[i].value) ElfLocation(section, sym.st_value, ElfLocation::ABSOLUTE); @@ -834,16 +834,16 @@ ElfSymtab_Section::ElfSymtab_Section(Elf_Shdr &s, std::ifstream *file, file->seekg(pos); } -void ElfSymtab_Section::serialize(std::ofstream &file, char ei_class, +void ElfSymtab_Section::serialize(std::ofstream& file, char ei_class, char ei_data) { - ElfStrtab_Section *strtab = (ElfStrtab_Section *)getLink(); + ElfStrtab_Section* strtab = (ElfStrtab_Section*)getLink(); for (unsigned int i = 0; i < shdr.sh_size / shdr.sh_entsize; i++) { Elf_Sym sym; sym.st_name = strtab->getStrIndex(syms[i].name); sym.st_info = syms[i].info; sym.st_other = syms[i].other; sym.st_value = syms[i].value.getValue(); - ElfSection *section = syms[i].value.getSection(); + ElfSection* section = syms[i].value.getSection(); if (syms[i].defined) sym.st_shndx = section ? section->getIndex() : SHN_ABS; else @@ -853,7 +853,7 @@ void ElfSymtab_Section::serialize(std::ofstream &file, char ei_class, } } -Elf_SymValue *ElfSymtab_Section::lookup(const char *name, +Elf_SymValue* ElfSymtab_Section::lookup(const char* name, unsigned int type_filter) { for (std::vector::iterator sym = syms.begin(); sym != syms.end(); sym++) { @@ -865,7 +865,7 @@ Elf_SymValue *ElfSymtab_Section::lookup(const char *name, return nullptr; } -const char *ElfStrtab_Section::getStr(unsigned int index) { +const char* ElfStrtab_Section::getStr(unsigned int index) { for (std::vector::iterator t = table.begin(); t != table.end(); t++) { if (index < t->used) return t->buf + index; @@ -875,7 +875,7 @@ const char *ElfStrtab_Section::getStr(unsigned int index) { return nullptr; } -const char *ElfStrtab_Section::getStr(const char *string) { +const char* ElfStrtab_Section::getStr(const char* string) { if (string == nullptr) return nullptr; // If the given string is within the section, return it @@ -891,7 +891,7 @@ const char *ElfStrtab_Section::getStr(const char *string) { if (table.back().size - table.back().used < len) table.resize(table.size() + 1); - char *alloc_str = table.back().buf + table.back().used; + char* alloc_str = table.back().buf + table.back().used; memcpy(alloc_str, string, len); table.back().used += len; @@ -901,7 +901,7 @@ const char *ElfStrtab_Section::getStr(const char *string) { return alloc_str; } -unsigned int ElfStrtab_Section::getStrIndex(const char *string) { +unsigned int ElfStrtab_Section::getStrIndex(const char* string) { if (string == nullptr) return 0; unsigned int index = 0; @@ -917,7 +917,7 @@ unsigned int ElfStrtab_Section::getStrIndex(const char *string) { return 0; } -void ElfStrtab_Section::serialize(std::ofstream &file, char ei_class, +void ElfStrtab_Section::serialize(std::ofstream& file, char ei_class, char ei_data) { file.seekp(getOffset()); for (std::vector::iterator t = table.begin(); t != table.end(); diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp index 7a5fceecc044d..2c24cbac4b577 100644 --- a/build/unix/elfhack/elfhack.cpp +++ b/build/unix/elfhack/elfhack.cpp @@ -27,7 +27,7 @@ # define R_ARM_THM_JUMP24 0x1e #endif -char *rundir = nullptr; +char* rundir = nullptr; template struct wrapped { @@ -40,7 +40,7 @@ class Elf_Addr_Traits { typedef wrapped Type64; template - static inline void swap(T &t, R &r) { + static inline void swap(T& t, R& r) { r.value = endian::swap(t.value); } }; @@ -53,7 +53,7 @@ class Elf_RelHack_Traits { typedef Elf32_Rel Type64; template - static inline void swap(T &t, R &r) { + static inline void swap(T& t, R& r) { r.r_offset = endian::swap(t.r_offset); r.r_info = endian::swap(t.r_info); } @@ -63,11 +63,11 @@ typedef serializable Elf_RelHack; class ElfRelHack_Section : public ElfSection { public: - ElfRelHack_Section(Elf_Shdr &s) : ElfSection(s, nullptr, nullptr) { + ElfRelHack_Section(Elf_Shdr& s) : ElfSection(s, nullptr, nullptr) { name = elfhack_data; }; - void serialize(std::ofstream &file, char ei_class, char ei_data) { + void serialize(std::ofstream& file, char ei_class, char ei_data) { for (std::vector::iterator i = rels.begin(); i != rels.end(); ++i) (*i).serialize(file, ei_class, ei_data); @@ -75,7 +75,7 @@ class ElfRelHack_Section : public ElfSection { bool isRelocatable() { return true; } - void push_back(Elf_RelHack &r) { + void push_back(Elf_RelHack& r) { rels.push_back(r); shdr.sh_size = rels.size() * shdr.sh_entsize; } @@ -86,8 +86,8 @@ class ElfRelHack_Section : public ElfSection { class ElfRelHackCode_Section : public ElfSection { public: - ElfRelHackCode_Section(Elf_Shdr &s, Elf &e, - ElfRelHack_Section &relhack_section, unsigned int init, + ElfRelHackCode_Section(Elf_Shdr& s, Elf& e, + ElfRelHack_Section& relhack_section, unsigned int init, unsigned int mprotect_cb, unsigned int sysconf_cb) : ElfSection(s, nullptr, nullptr), parent(e), @@ -120,13 +120,13 @@ class ElfRelHackCode_Section : public ElfSection { throw std::runtime_error( "architecture of object for injected code doesn't match"); - ElfSymtab_Section *symtab = nullptr; + ElfSymtab_Section* symtab = nullptr; // Find the symbol table. - for (ElfSection *section = elf->getSection(1); section != nullptr; + for (ElfSection* section = elf->getSection(1); section != nullptr; section = section->getNext()) { if (section->getType() == SHT_SYMTAB) - symtab = (ElfSymtab_Section *)section; + symtab = (ElfSymtab_Section*)section; } if (symtab == nullptr) throw std::runtime_error( @@ -139,7 +139,7 @@ class ElfRelHackCode_Section : public ElfSection { std::string symbol = "init"; if (!init) symbol += "_noinit"; if (relro) symbol += "_relro"; - Elf_SymValue *sym = symtab->lookup(symbol.c_str()); + Elf_SymValue* sym = symtab->lookup(symbol.c_str()); if (!sym) throw std::runtime_error( "Couldn't find an 'init' symbol in the injected code"); @@ -155,7 +155,7 @@ class ElfRelHackCode_Section : public ElfSection { // is the virtual address of the instruction that calls the original init, // but we don't have it at this point, so punt to just init. if (init > 0xffffff && parent.getMachine() == EM_ARM) { - Elf_SymValue *trampoline = symtab->lookup("init_trampoline"); + Elf_SymValue* trampoline = symtab->lookup("init_trampoline"); if (!trampoline) { throw std::runtime_error( "Couldn't find an 'init_trampoline' symbol in the injected code"); @@ -166,9 +166,9 @@ class ElfRelHackCode_Section : public ElfSection { } // Adjust code sections offsets according to their size - std::vector::iterator c = code.begin(); + std::vector::iterator c = code.begin(); (*c)->getShdr().sh_addr = 0; - for (ElfSection *last = *(c++); c != code.end(); ++c) { + for (ElfSection* last = *(c++); c != code.end(); ++c) { unsigned int addr = last->getShdr().sh_addr + last->getSize(); if (addr & ((*c)->getAddrAlign() - 1)) addr = (addr | ((*c)->getAddrAlign() - 1)) + 1; @@ -180,11 +180,11 @@ class ElfRelHackCode_Section : public ElfSection { last = *c; } shdr.sh_size = code.back()->getAddr() + code.back()->getSize(); - data = static_cast(malloc(shdr.sh_size)); + data = static_cast(malloc(shdr.sh_size)); if (!data) { throw std::runtime_error("Could not malloc ElfSection data"); } - char *buf = data; + char* buf = data; for (c = code.begin(); c != code.end(); ++c) { memcpy(buf, (*c)->getData(), (*c)->getSize()); buf += (*c)->getSize(); @@ -194,23 +194,23 @@ class ElfRelHackCode_Section : public ElfSection { ~ElfRelHackCode_Section() { delete elf; } - void serialize(std::ofstream &file, char ei_class, char ei_data) { + void serialize(std::ofstream& file, char ei_class, char ei_data) { // Readjust code offsets - for (std::vector::iterator c = code.begin(); c != code.end(); + for (std::vector::iterator c = code.begin(); c != code.end(); ++c) (*c)->getShdr().sh_addr += getAddr(); // Apply relocations - for (std::vector::iterator c = code.begin(); c != code.end(); + for (std::vector::iterator c = code.begin(); c != code.end(); ++c) { - for (ElfSection *rel = elf->getSection(1); rel != nullptr; + for (ElfSection* rel = elf->getSection(1); rel != nullptr; rel = rel->getNext()) if (((rel->getType() == SHT_REL) || (rel->getType() == SHT_RELA)) && (rel->getInfo().section == *c)) { if (rel->getType() == SHT_REL) - apply_relocations((ElfRel_Section *)rel, *c); + apply_relocations((ElfRel_Section*)rel, *c); else - apply_relocations((ElfRel_Section *)rel, *c); + apply_relocations((ElfRel_Section*)rel, *c); } } @@ -221,7 +221,7 @@ class ElfRelHackCode_Section : public ElfSection { unsigned int getEntryPoint() { return entry_point; } - void insertBefore(ElfSection *section, bool dirty = true) override { + void insertBefore(ElfSection* section, bool dirty = true) override { // Adjust the address so that this section is adjacent to the one it's // being inserted before. This avoids creating holes which subsequently // might lead the PHDR-adjusting code to create unnecessary additional @@ -232,7 +232,7 @@ class ElfRelHackCode_Section : public ElfSection { } private: - void add_code_section(ElfSection *section) { + void add_code_section(ElfSection* section) { if (section) { /* Don't add section if it's already been added in the past */ for (auto s = code.begin(); s != code.end(); ++s) { @@ -245,23 +245,23 @@ class ElfRelHackCode_Section : public ElfSection { /* Look at the relocations associated to the given section to find other * sections that it requires */ - void find_code(ElfSection *section) { - for (ElfSection *s = elf->getSection(1); s != nullptr; s = s->getNext()) { + void find_code(ElfSection* section) { + for (ElfSection* s = elf->getSection(1); s != nullptr; s = s->getNext()) { if (((s->getType() == SHT_REL) || (s->getType() == SHT_RELA)) && (s->getInfo().section == section)) { if (s->getType() == SHT_REL) - scan_relocs_for_code((ElfRel_Section *)s); + scan_relocs_for_code((ElfRel_Section*)s); else - scan_relocs_for_code((ElfRel_Section *)s); + scan_relocs_for_code((ElfRel_Section*)s); } } } template - void scan_relocs_for_code(ElfRel_Section *rel) { - ElfSymtab_Section *symtab = (ElfSymtab_Section *)rel->getLink(); + void scan_relocs_for_code(ElfRel_Section* rel) { + ElfSymtab_Section* symtab = (ElfSymtab_Section*)rel->getLink(); for (auto r = rel->rels.begin(); r != rel->rels.end(); ++r) { - ElfSection *section = + ElfSection* section = symtab->syms[ELF32_R_SYM(r->r_info)].value.getSection(); add_code_section(section); } @@ -349,7 +349,7 @@ class ElfRelHackCode_Section : public ElfSection { }; template - void apply_relocation(ElfSection *the_code, char *base, Elf_Rel *r, + void apply_relocation(ElfSection* the_code, char* base, Elf_Rel* r, unsigned int addr) { relocation_type relocation; Elf32_Addr value; @@ -359,7 +359,7 @@ class ElfRelHackCode_Section : public ElfSection { } template - void apply_relocation(ElfSection *the_code, char *base, Elf_Rela *r, + void apply_relocation(ElfSection* the_code, char* base, Elf_Rela* r, unsigned int addr) { relocation_type relocation; Elf32_Addr value = @@ -368,22 +368,22 @@ class ElfRelHackCode_Section : public ElfSection { } template - void apply_relocations(ElfRel_Section *rel, ElfSection *the_code) { + void apply_relocations(ElfRel_Section* rel, ElfSection* the_code) { assert(rel->getType() == Rel_Type::sh_type); - char *buf = data + (the_code->getAddr() - code.front()->getAddr()); + char* buf = data + (the_code->getAddr() - code.front()->getAddr()); // TODO: various checks on the sections - ElfSymtab_Section *symtab = (ElfSymtab_Section *)rel->getLink(); + ElfSymtab_Section* symtab = (ElfSymtab_Section*)rel->getLink(); for (typename std::vector::iterator r = rel->rels.begin(); r != rel->rels.end(); ++r) { // TODO: various checks on the symbol - const char *name = symtab->syms[ELF32_R_SYM(r->r_info)].name; + const char* name = symtab->syms[ELF32_R_SYM(r->r_info)].name; unsigned int addr; if (symtab->syms[ELF32_R_SYM(r->r_info)].value.getSection() == nullptr) { if (strcmp(name, "relhack") == 0) { addr = relhack_section.getAddr(); } else if (strcmp(name, "elf_header") == 0) { // TODO: change this ungly hack to something better - ElfSection *ehdr = parent.getSection(1)->getPrevious()->getPrevious(); + ElfSection* ehdr = parent.getSection(1)->getPrevious()->getPrevious(); addr = ehdr->getAddr(); } else if (strcmp(name, "original_init") == 0) { if (init_trampoline) { @@ -412,7 +412,7 @@ class ElfRelHackCode_Section : public ElfSection { throw std::runtime_error("Unsupported symbol in relocation"); } } else { - ElfSection *section = + ElfSection* section = symtab->syms[ELF32_R_SYM(r->r_info)].value.getSection(); assert((section->getType() == SHT_PROGBITS) && (section->getFlags() & SHF_EXECINSTR)); @@ -452,44 +452,44 @@ class ElfRelHackCode_Section : public ElfSection { } Elf *elf, &parent; - ElfRelHack_Section &relhack_section; - std::vector code; + ElfRelHack_Section& relhack_section; + std::vector code; unsigned int init; - ElfSection *init_trampoline; + ElfSection* init_trampoline; unsigned int mprotect_cb; unsigned int sysconf_cb; int entry_point; - ElfSegment *relro; + ElfSegment* relro; }; -unsigned int get_addend(Elf_Rel *rel, Elf *elf) { +unsigned int get_addend(Elf_Rel* rel, Elf* elf) { ElfLocation loc(rel->r_offset, elf); Elf_Addr addr(loc.getBuffer(), Elf_Addr::size(elf->getClass()), elf->getClass(), elf->getData()); return addr.value; } -unsigned int get_addend(Elf_Rela *rel, Elf *elf) { return rel->r_addend; } +unsigned int get_addend(Elf_Rela* rel, Elf* elf) { return rel->r_addend; } -void set_relative_reloc(Elf_Rel *rel, Elf *elf, unsigned int value) { +void set_relative_reloc(Elf_Rel* rel, Elf* elf, unsigned int value) { ElfLocation loc(rel->r_offset, elf); Elf_Addr addr; addr.value = value; - addr.serialize(const_cast(loc.getBuffer()), + addr.serialize(const_cast(loc.getBuffer()), Elf_Addr::size(elf->getClass()), elf->getClass(), elf->getData()); } -void set_relative_reloc(Elf_Rela *rel, Elf *elf, unsigned int value) { +void set_relative_reloc(Elf_Rela* rel, Elf* elf, unsigned int value) { // ld puts the value of relocated relocations both in the addend and // at r_offset. For consistency, keep it that way. - set_relative_reloc((Elf_Rel *)rel, elf, value); + set_relative_reloc((Elf_Rel*)rel, elf, value); rel->r_addend = value; } -void maybe_split_segment(Elf *elf, ElfSegment *segment) { - std::list::iterator it = segment->begin(); - for (ElfSection *last = *(it++); it != segment->end(); last = *(it++)) { +void maybe_split_segment(Elf* elf, ElfSegment* segment) { + std::list::iterator it = segment->begin(); + for (ElfSection* last = *(it++); it != segment->end(); last = *(it++)) { // When two consecutive non-SHT_NOBITS sections are apart by more // than the alignment of the section, the second can be moved closer // to the first, but this requires the segment to be split. @@ -505,7 +505,7 @@ void maybe_split_segment(Elf *elf, ElfSegment *segment) { phdr.p_align = segment->getAlign(); phdr.p_filesz = (unsigned int)-1; phdr.p_memsz = (unsigned int)-1; - ElfSegment *newSegment = new ElfSegment(&phdr); + ElfSegment* newSegment = new ElfSegment(&phdr); elf->insertSegmentAfter(segment, newSegment); for (; it != segment->end(); ++it) { newSegment->addSection(*it); @@ -540,7 +540,7 @@ static char encoding_data_size(char encoding) { return encoding & 0x07; } // Advance `step` bytes in the buffer at `data` with size `size`, returning // the advanced buffer pointer and remaining size. // Returns true if step <= size. -static bool advance_buffer(char **data, size_t *size, size_t step) { +static bool advance_buffer(char** data, size_t* size, size_t step) { if (step > *size) return false; *data += step; @@ -550,7 +550,7 @@ static bool advance_buffer(char **data, size_t *size, size_t step) { // Advance in the given buffer, skipping the full length of the variable-length // encoded LEB128 type in CIE/FDE data. -static bool skip_LEB128(char **data, size_t *size) { +static bool skip_LEB128(char** data, size_t* size) { if (!*size) return false; while (*size && (*(*data)++ & (char)0x80)) { @@ -561,7 +561,7 @@ static bool skip_LEB128(char **data, size_t *size) { // Advance in the given buffer, skipping the full length of a pointer encoded // with the given encoding. -static bool skip_eh_frame_pointer(char **data, size_t *size, char encoding) { +static bool skip_eh_frame_pointer(char** data, size_t* size, char encoding) { switch (encoding_data_size(encoding)) { case DW_EH_PE_data2: return advance_buffer(data, size, 2); @@ -577,9 +577,9 @@ static bool skip_eh_frame_pointer(char **data, size_t *size, char encoding) { // Specialized implementations for adjust_eh_frame_pointer(). template -static bool adjust_eh_frame_sized_pointer(char **data, size_t *size, - ElfSection *eh_frame, - unsigned int origAddr, Elf *elf) { +static bool adjust_eh_frame_sized_pointer(char** data, size_t* size, + ElfSection* eh_frame, + unsigned int origAddr, Elf* elf) { if (*size < sizeof(T)) return false; serializable> pointer(*data, *size, elf->getClass(), @@ -602,9 +602,9 @@ static bool adjust_eh_frame_sized_pointer(char **data, size_t *size, // In the given eh_frame section, adjust the pointer with the given encoding, // pointed to by the given buffer (`data`, `size`), considering the eh_frame // section was originally at `origAddr`. Also advances in the buffer. -static bool adjust_eh_frame_pointer(char **data, size_t *size, char encoding, - ElfSection *eh_frame, unsigned int origAddr, - Elf *elf) { +static bool adjust_eh_frame_pointer(char** data, size_t* size, char encoding, + ElfSection* eh_frame, unsigned int origAddr, + Elf* elf) { if ((encoding & 0x70) != DW_EH_PE_pcrel) return skip_eh_frame_pointer(data, size, encoding); @@ -640,12 +640,12 @@ static bool adjust_eh_frame_pointer(char **data, size_t *size, char encoding, // The eh_frame section may contain "PC"-relative pointers. If we move the // section, those need to be adjusted. Other type of pointers are relative to // sections we don't touch. -static void adjust_eh_frame(ElfSection *eh_frame, unsigned int origAddr, - Elf *elf) { +static void adjust_eh_frame(ElfSection* eh_frame, unsigned int origAddr, + Elf* elf) { if (eh_frame->getAddr() == origAddr) // nothing to do; return; - char *data = const_cast(eh_frame->getData()); + char* data = const_cast(eh_frame->getData()); size_t size = eh_frame->getSize(); char LSDAencoding = DW_EH_PE_omit; char FDEencoding = DW_EH_PE_absptr; @@ -659,7 +659,7 @@ static void adjust_eh_frame(ElfSection *eh_frame, unsigned int origAddr, data, size, elf->getClass(), elf->getData()); if (!advance_buffer(&data, &size, sizeof(uint32_t))) goto malformed; - char *cursor = data; + char* cursor = data; size_t length = entryLength.value; if (length == 0) { @@ -686,7 +686,7 @@ static void adjust_eh_frame(ElfSection *eh_frame, unsigned int origAddr, throw std::runtime_error("Unsupported eh_frame version"); } // NUL terminated string. - const char *augmentationString = cursor; + const char* augmentationString = cursor; size_t l = strnlen(augmentationString, length - 1); if (l == length - 1) goto malformed; if (!advance_buffer(&cursor, &length, l + 1)) goto malformed; @@ -759,16 +759,16 @@ static void adjust_eh_frame(ElfSection *eh_frame, unsigned int origAddr, } template -int do_relocation_section(Elf *elf, unsigned int rel_type, +int do_relocation_section(Elf* elf, unsigned int rel_type, unsigned int rel_type2, bool force) { - ElfDynamic_Section *dyn = elf->getDynSection(); + ElfDynamic_Section* dyn = elf->getDynSection(); if (dyn == nullptr) { fprintf(stderr, "Couldn't find SHT_DYNAMIC section\n"); return -1; } - ElfRel_Section *section = - (ElfRel_Section *)dyn->getSectionForType(Rel_Type::d_tag); + ElfRel_Section* section = + (ElfRel_Section*)dyn->getSectionForType(Rel_Type::d_tag); if (section == nullptr) { fprintf(stderr, "No relocations\n"); return -1; @@ -814,9 +814,9 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, // The binary may have .ctors instead of DT_INIT_ARRAY, for its init // functions, but this falls into the second case above, since .ctors // are actually run by DT_INIT code. - ElfValue *value = dyn->getValueForType(DT_INIT); + ElfValue* value = dyn->getValueForType(DT_INIT); unsigned int original_init = value ? value->getValue() : 0; - ElfSection *init_array = nullptr; + ElfSection* init_array = nullptr; if (!value || !value->getValue()) { value = dyn->getValueForType(DT_INIT_ARRAYSZ); if (value && value->getValue() >= entry_sz) @@ -825,10 +825,10 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, Elf_Shdr relhack_section(relhack32_section); Elf_Shdr relhackcode_section(relhackcode32_section); - ElfRelHack_Section *relhack = new ElfRelHack_Section(relhack_section); + ElfRelHack_Section* relhack = new ElfRelHack_Section(relhack_section); - ElfSymtab_Section *symtab = (ElfSymtab_Section *)section->getLink(); - Elf_SymValue *sym = symtab->lookup("__cxa_pure_virtual"); + ElfSymtab_Section* symtab = (ElfSymtab_Section*)section->getLink(); + Elf_SymValue* sym = symtab->lookup("__cxa_pure_virtual"); std::vector new_rels; Elf_RelHack relhack_entry; @@ -856,7 +856,7 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, Elf_Addr addr(loc.getBuffer(), entry_sz, elf->getClass(), elf->getData()); if (addr.value == sym->value.getValue()) { - memset((char *)loc.getBuffer(), 0, entry_sz); + memset((char*)loc.getBuffer(), 0, entry_sz); continue; } } @@ -866,7 +866,7 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, // have absolute relocations (rel_type2) for it. if ((ELF32_R_TYPE(i->r_info) == rel_type2) && (sym == &symtab->syms[ELF32_R_SYM(i->r_info)])) { - memset((char *)loc.getBuffer(), 0, entry_sz); + memset((char*)loc.getBuffer(), 0, entry_sz); continue; } } @@ -892,7 +892,7 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, unsigned int addend = get_addend(&*i, elf); if (addr.value == 0) { addr.value = addend; - addr.serialize(const_cast(loc.getBuffer()), entry_sz, + addr.serialize(const_cast(loc.getBuffer()), entry_sz, elf->getClass(), elf->getData()); } else if (addr.value != addend) { fprintf(stderr, @@ -928,21 +928,21 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, // before any other). Otherwise, replace the first entry and keep the // original pointer. std::sort(init_array_relocs.begin(), init_array_relocs.end(), - [](Rel_Type &a, Rel_Type &b) { return a.r_offset < b.r_offset; }); + [](Rel_Type& a, Rel_Type& b) { return a.r_offset < b.r_offset; }); size_t expected = init_array->getAddr(); const size_t zero = 0; const size_t all = SIZE_MAX; - const char *data = init_array->getData(); + const char* data = init_array->getData(); size_t length = Elf_Addr::size(elf->getClass()); size_t off = 0; for (; off < init_array_relocs.size(); off++) { - auto &r = init_array_relocs[off]; + auto& r = init_array_relocs[off]; if (r.r_offset >= expected + length && (memcmp(data + off * length, &zero, length) == 0 || memcmp(data + off * length, &all, length) == 0)) { // We found a hole, move the preceding entries. while (off) { - auto &p = init_array_relocs[--off]; + auto& p = init_array_relocs[--off]; if (ELF32_R_TYPE(p.r_info) == rel_type) { unsigned int addend = get_addend(&p, elf); p.r_offset += length; @@ -970,12 +970,12 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, } else { // Use relocated value of DT_INIT_ARRAY's first entry for the // function to be called by the injected code. - auto &rel = init_array_relocs[0]; + auto& rel = init_array_relocs[0]; unsigned int addend = get_addend(&rel, elf); if (ELF32_R_TYPE(rel.r_info) == rel_type) { original_init = addend; } else if (ELF32_R_TYPE(rel.r_info) == rel_type2) { - ElfSymtab_Section *symtab = (ElfSymtab_Section *)section->getLink(); + ElfSymtab_Section* symtab = (ElfSymtab_Section*)section->getLink(); original_init = symtab->syms[ELF32_R_SYM(rel.r_info)].value.getValue() + addend; } else { @@ -1005,15 +1005,15 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, // section temporarily (it will be restored to a null value before any code // can actually use it) if (elf->getSegmentByType(PT_GNU_RELRO)) { - ElfSection *gnu_versym = dyn->getSectionForType(DT_VERSYM); - auto lookup = [&symtab, &gnu_versym](const char *symbol) { - Elf_SymValue *sym_value = symtab->lookup(symbol, STT(FUNC)); + ElfSection* gnu_versym = dyn->getSectionForType(DT_VERSYM); + auto lookup = [&symtab, &gnu_versym](const char* symbol) { + Elf_SymValue* sym_value = symtab->lookup(symbol, STT(FUNC)); if (!sym_value) { symtab->syms.emplace_back(); sym_value = &symtab->syms.back(); symtab->grow(symtab->syms.size() * symtab->getEntSize()); sym_value->name = - ((ElfStrtab_Section *)symtab->getLink())->getStr(symbol); + ((ElfStrtab_Section*)symtab->getLink())->getStr(symbol); sym_value->info = ELF32_ST_INFO(STB_GLOBAL, STT_FUNC); sym_value->other = STV_DEFAULT; new (&sym_value->value) ElfLocation(nullptr, 0, ElfLocation::ABSOLUTE); @@ -1031,14 +1031,14 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, return sym_value; }; - Elf_SymValue *mprotect = lookup("mprotect"); - Elf_SymValue *sysconf = lookup("sysconf"); + Elf_SymValue* mprotect = lookup("mprotect"); + Elf_SymValue* sysconf = lookup("sysconf"); // Add relocations for the mprotect and sysconf symbols. auto add_relocation_to = [&new_rels, &symtab, rel_type2]( - Elf_SymValue *symbol, unsigned int location) { + Elf_SymValue* symbol, unsigned int location) { new_rels.emplace_back(); - Rel_Type &rel = new_rels.back(); + Rel_Type& rel = new_rels.back(); memset(&rel, 0, sizeof(rel)); rel.r_info = ELF32_R_INFO( std::distance(symtab->syms.begin(), @@ -1050,7 +1050,7 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, // Find the beginning of the bss section, and use an aligned location in // there for the relocation. - for (ElfSection *s = elf->getSection(1); s != nullptr; s = s->getNext()) { + for (ElfSection* s = elf->getSection(1); s != nullptr; s = s->getNext()) { if (s->getType() != SHT_NOBITS || (s->getFlags() & (SHF_TLS | SHF_WRITE)) != SHF_WRITE) { continue; @@ -1076,13 +1076,13 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, section->rels.assign(new_rels.begin(), new_rels.end()); section->shrink(new_rels.size() * section->getEntSize()); - ElfRelHackCode_Section *relhackcode = + ElfRelHackCode_Section* relhackcode = new ElfRelHackCode_Section(relhackcode_section, *elf, *relhack, original_init, mprotect_cb, sysconf_cb); // Find the first executable section, and insert the relhack code before // that. The relhack data is inserted between .rel.dyn and .rel.plt. - ElfSection *first_executable = nullptr; - for (ElfSection *s = elf->getSection(1); s != nullptr; s = s->getNext()) { + ElfSection* first_executable = nullptr; + for (ElfSection* s = elf->getSection(1); s != nullptr; s = s->getNext()) { if (s->getFlags() & SHF_EXECINSTR) { first_executable = s; break; @@ -1115,13 +1115,13 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, // PT_LOAD for just both of them because they are not considered relocatable. // But they are, in fact, kind of relocatable, albeit with some manual work. // Which we'll do here. - ElfSegment *eh_frame_segment = elf->getSegmentByType(PT_GNU_EH_FRAME); - ElfSection *eh_frame_hdr = + ElfSegment* eh_frame_segment = elf->getSegmentByType(PT_GNU_EH_FRAME); + ElfSection* eh_frame_hdr = eh_frame_segment ? eh_frame_segment->getFirstSection() : nullptr; // The .eh_frame section usually follows the eh_frame_hdr section. - ElfSection *eh_frame = eh_frame_hdr ? eh_frame_hdr->getNext() : nullptr; - ElfSection *first = eh_frame_hdr; - ElfSection *second = eh_frame; + ElfSection* eh_frame = eh_frame_hdr ? eh_frame_hdr->getNext() : nullptr; + ElfSection* first = eh_frame_hdr; + ElfSection* second = eh_frame; if (eh_frame && strcmp(eh_frame->getName(), ".eh_frame")) { // But sometimes it appears *before* the eh_frame_hdr section. eh_frame = eh_frame_hdr->getPrevious(); @@ -1140,7 +1140,7 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, // this would save. unsigned int distance = second->getAddr() - first->getAddr(); unsigned int origAddr = eh_frame->getAddr(); - ElfSection *previous = first->getPrevious(); + ElfSection* previous = first->getPrevious(); first->getShdr().sh_addr = (previous->getAddr() + previous->getSize() + first->getAddrAlign() - 1) & ~(first->getAddrAlign() - 1); @@ -1160,20 +1160,20 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, } // Adjust PT_LOAD segments - for (ElfSegment *segment = elf->getSegmentByType(PT_LOAD); segment; + for (ElfSegment* segment = elf->getSegmentByType(PT_LOAD); segment; segment = elf->getSegmentByType(PT_LOAD, segment)) { maybe_split_segment(elf, segment); } // Ensure Elf sections will be at their final location. elf->normalize(); - ElfLocation *init = + ElfLocation* init = new ElfLocation(relhackcode, relhackcode->getEntryPoint()); if (init_array) { // Adjust the first DT_INIT_ARRAY entry to point at the injected code // by transforming its relocation into a relative one pointing to the // address of the injected code. - Rel_Type *rel = §ion->rels[init_array_insert]; + Rel_Type* rel = §ion->rels[init_array_insert]; rel->r_info = ELF32_R_INFO(0, rel_type); // Set as a relative relocation set_relative_reloc(rel, elf, init->getValue()); } else if (!dyn->setValueForType(DT_INIT, init)) { @@ -1188,13 +1188,13 @@ int do_relocation_section(Elf *elf, unsigned int rel_type, return 0; } -static inline int backup_file(const char *name) { +static inline int backup_file(const char* name) { std::string fname(name); fname += ".bak"; return rename(name, fname.c_str()); } -void do_file(const char *name, bool backup = false, bool force = false) { +void do_file(const char* name, bool backup = false, bool force = false) { std::ifstream file(name, std::ios::in | std::ios::binary); Elf elf(file); unsigned int size = elf.getSize(); @@ -1204,7 +1204,7 @@ void do_file(const char *name, bool backup = false, bool force = false) { return; } - for (ElfSection *section = elf.getSection(1); section != nullptr; + for (ElfSection* section = elf.getSection(1); section != nullptr; section = section->getNext()) { if (section->getName() && (strncmp(section->getName(), ".elfhack.", 9) == 0)) { @@ -1242,7 +1242,7 @@ void do_file(const char *name, bool backup = false, bool force = false) { } } -void undo_file(const char *name, bool backup = false) { +void undo_file(const char* name, bool backup = false) { std::ifstream file(name, std::ios::in | std::ios::binary); Elf elf(file); unsigned int size = elf.getSize(); @@ -1253,7 +1253,7 @@ void undo_file(const char *name, bool backup = false) { } ElfSection *data = nullptr, *text = nullptr; - for (ElfSection *section = elf.getSection(1); section != nullptr; + for (ElfSection* section = elf.getSection(1); section != nullptr; section = section->getNext()) { if (section->getName() && (strcmp(section->getName(), elfhack_data) == 0)) data = section; @@ -1270,8 +1270,8 @@ void undo_file(const char *name, bool backup = false) { // the segment that contains them both and the following segment. // When the elfhack sections are in separate segments, try to merge // those segments. - ElfSegment *first = data->getSegmentByType(PT_LOAD); - ElfSegment *second = text->getSegmentByType(PT_LOAD); + ElfSegment* first = data->getSegmentByType(PT_LOAD); + ElfSegment* second = text->getSegmentByType(PT_LOAD); if (first == second) { second = elf.getSegmentByType(PT_LOAD, first); } @@ -1283,7 +1283,7 @@ void undo_file(const char *name, bool backup = false) { } // Move sections from the second PT_LOAD to the first, and remove the // second PT_LOAD segment. - for (std::list::iterator section = second->begin(); + for (std::list::iterator section = second->begin(); section != second->end(); ++section) first->addSection(*section); @@ -1300,12 +1300,12 @@ void undo_file(const char *name, bool backup = false) { } } -int main(int argc, char *argv[]) { +int main(int argc, char* argv[]) { int arg; bool backup = false; bool force = false; bool revert = false; - char *lastSlash = rindex(argv[0], '/'); + char* lastSlash = rindex(argv[0], '/'); if (lastSlash != nullptr) rundir = strndup(argv[0], lastSlash - argv[0]); for (arg = 1; arg < argc; arg++) { if (strcmp(argv[arg], "-f") == 0) diff --git a/build/unix/elfhack/elfxx.h b/build/unix/elfhack/elfxx.h index 109862832a47c..91e9bbfb837fb 100644 --- a/build/unix/elfhack/elfxx.h +++ b/build/unix/elfhack/elfxx.h @@ -59,7 +59,7 @@ class FixedSizeData { typedef Wrapper Type64; template - static void swap(T &t, R &r) { + static void swap(T& t, R& r) { r.value = endian::swap(t.value); } }; @@ -70,7 +70,7 @@ class Elf_Ehdr_Traits { typedef Elf64_Ehdr Type64; template - static void swap(T &t, R &r); + static void swap(T& t, R& r); }; class Elf_Phdr_Traits { @@ -79,7 +79,7 @@ class Elf_Phdr_Traits { typedef Elf64_Phdr Type64; template - static void swap(T &t, R &r); + static void swap(T& t, R& r); }; class Elf_Shdr_Traits { @@ -88,7 +88,7 @@ class Elf_Shdr_Traits { typedef Elf64_Shdr Type64; template - static void swap(T &t, R &r); + static void swap(T& t, R& r); }; class Elf_Dyn_Traits { @@ -97,7 +97,7 @@ class Elf_Dyn_Traits { typedef Elf64_Dyn Type64; template - static void swap(T &t, R &r); + static void swap(T& t, R& r); }; class Elf_Sym_Traits { @@ -106,7 +106,7 @@ class Elf_Sym_Traits { typedef Elf64_Sym Type64; template - static void swap(T &t, R &r); + static void swap(T& t, R& r); }; class Elf_Rel_Traits { @@ -115,7 +115,7 @@ class Elf_Rel_Traits { typedef Elf64_Rel Type64; template - static void swap(T &t, R &r); + static void swap(T& t, R& r); }; class Elf_Rela_Traits { @@ -124,13 +124,13 @@ class Elf_Rela_Traits { typedef Elf64_Rela Type64; template - static void swap(T &t, R &r); + static void swap(T& t, R& r); }; class ElfValue { public: virtual unsigned int getValue() { return 0; } - virtual ElfSection *getSection() { return nullptr; } + virtual ElfSection* getSection() { return nullptr; } }; class ElfPlainValue : public ElfValue { @@ -142,47 +142,47 @@ class ElfPlainValue : public ElfValue { }; class ElfLocation : public ElfValue { - ElfSection *section; + ElfSection* section; unsigned int offset; public: enum position { ABSOLUTE, RELATIVE }; ElfLocation() : section(nullptr), offset(0){}; - ElfLocation(ElfSection *section, unsigned int off, + ElfLocation(ElfSection* section, unsigned int off, enum position pos = RELATIVE); - ElfLocation(unsigned int location, Elf *elf); + ElfLocation(unsigned int location, Elf* elf); unsigned int getValue(); - ElfSection *getSection() { return section; } - const char *getBuffer(); + ElfSection* getSection() { return section; } + const char* getBuffer(); }; class ElfSize : public ElfValue { - ElfSection *section; + ElfSection* section; public: - ElfSize(ElfSection *s) : section(s){}; + ElfSize(ElfSection* s) : section(s){}; unsigned int getValue(); - ElfSection *getSection() { return section; } + ElfSection* getSection() { return section; } }; class ElfEntSize : public ElfValue { - ElfSection *section; + ElfSection* section; public: - ElfEntSize(ElfSection *s) : section(s){}; + ElfEntSize(ElfSection* s) : section(s){}; unsigned int getValue(); - ElfSection *getSection() { return section; } + ElfSection* getSection() { return section; } }; template class serializable : public T::Type32 { public: serializable(){}; - serializable(const typename T::Type32 &p) : T::Type32(p){}; + serializable(const typename T::Type32& p) : T::Type32(p){}; private: template - void init(const char *buf, size_t len, char ei_data) { + void init(const char* buf, size_t len, char ei_data) { R e; assert(len >= sizeof(e)); memcpy(&e, buf, sizeof(e)); @@ -197,20 +197,20 @@ class serializable : public T::Type32 { } template - void serialize(const char *buf, size_t len, char ei_data) { + void serialize(const char* buf, size_t len, char ei_data) { assert(len >= sizeof(R)); if (ei_data == ELFDATA2LSB) { - T::template swap(*this, *(R *)buf); + T::template swap(*this, *(R*)buf); return; } else if (ei_data == ELFDATA2MSB) { - T::template swap(*this, *(R *)buf); + T::template swap(*this, *(R*)buf); return; } throw std::runtime_error("Unsupported ELF data encoding"); } public: - serializable(const char *buf, size_t len, char ei_class, char ei_data) { + serializable(const char* buf, size_t len, char ei_class, char ei_data) { if (ei_class == ELFCLASS32) { init(buf, len, ei_data); return; @@ -221,37 +221,37 @@ class serializable : public T::Type32 { throw std::runtime_error("Unsupported ELF class"); } - serializable(std::ifstream &file, char ei_class, char ei_data) { + serializable(std::ifstream& file, char ei_class, char ei_data) { if (ei_class == ELFCLASS32) { typename T::Type32 e; - file.read((char *)&e, sizeof(e)); - init((char *)&e, sizeof(e), ei_data); + file.read((char*)&e, sizeof(e)); + init((char*)&e, sizeof(e), ei_data); return; } else if (ei_class == ELFCLASS64) { typename T::Type64 e; - file.read((char *)&e, sizeof(e)); - init((char *)&e, sizeof(e), ei_data); + file.read((char*)&e, sizeof(e)); + init((char*)&e, sizeof(e), ei_data); return; } throw std::runtime_error("Unsupported ELF class or data encoding"); } - void serialize(std::ofstream &file, char ei_class, char ei_data) { + void serialize(std::ofstream& file, char ei_class, char ei_data) { if (ei_class == ELFCLASS32) { typename T::Type32 e; - serialize((char *)&e, sizeof(e), ei_data); - file.write((char *)&e, sizeof(e)); + serialize((char*)&e, sizeof(e), ei_data); + file.write((char*)&e, sizeof(e)); return; } else if (ei_class == ELFCLASS64) { typename T::Type64 e; - serialize((char *)&e, sizeof(e), ei_data); - file.write((char *)&e, sizeof(e)); + serialize((char*)&e, sizeof(e), ei_data); + file.write((char*)&e, sizeof(e)); return; } throw std::runtime_error("Unsupported ELF class or data encoding"); } - void serialize(char *buf, size_t len, char ei_class, char ei_data) { + void serialize(char* buf, size_t len, char ei_class, char ei_data) { if (ei_class == ELFCLASS32) { serialize(buf, len, ei_data); return; @@ -275,20 +275,20 @@ typedef serializable Elf_Shdr; class Elf { public: - Elf(std::ifstream &file); + Elf(std::ifstream& file); ~Elf(); /* index == -1 is treated as index == ehdr.e_shstrndx */ - ElfSection *getSection(int index); + ElfSection* getSection(int index); - ElfSection *getSectionAt(unsigned int offset); + ElfSection* getSectionAt(unsigned int offset); - ElfSegment *getSegmentByType(unsigned int type, ElfSegment *last = nullptr); + ElfSegment* getSegmentByType(unsigned int type, ElfSegment* last = nullptr); - ElfDynamic_Section *getDynSection(); + ElfDynamic_Section* getDynSection(); void normalize(); - void write(std::ofstream &file); + void write(std::ofstream& file); char getClass(); char getData(); @@ -296,46 +296,46 @@ class Elf { char getMachine(); unsigned int getSize(); - void insertSegmentAfter(ElfSegment *previous, ElfSegment *segment) { - std::vector::iterator prev = + void insertSegmentAfter(ElfSegment* previous, ElfSegment* segment) { + std::vector::iterator prev = std::find(segments.begin(), segments.end(), previous); segments.insert(prev + 1, segment); } - void removeSegment(ElfSegment *segment); + void removeSegment(ElfSegment* segment); private: - Elf_Ehdr *ehdr; + Elf_Ehdr* ehdr; ElfLocation eh_entry; - ElfStrtab_Section *eh_shstrndx; - ElfSection **sections; - std::vector segments; + ElfStrtab_Section* eh_shstrndx; + ElfSection** sections; + std::vector segments; ElfSection *shdr_section, *phdr_section; /* Values used only during initialization */ - Elf_Shdr **tmp_shdr; - std::ifstream *tmp_file; + Elf_Shdr** tmp_shdr; + std::ifstream* tmp_file; }; class ElfSection { public: typedef union { - ElfSection *section; + ElfSection* section; int index; } SectionInfo; - ElfSection(Elf_Shdr &s, std::ifstream *file, Elf *parent); + ElfSection(Elf_Shdr& s, std::ifstream* file, Elf* parent); virtual ~ElfSection() { free(data); } - const char *getName() { return name; } + const char* getName() { return name; } unsigned int getType() { return shdr.sh_type; } unsigned int getFlags() { return shdr.sh_flags; } unsigned int getAddr(); unsigned int getSize() { return shdr.sh_size; } unsigned int getAddrAlign() { return shdr.sh_addralign; } unsigned int getEntSize() { return shdr.sh_entsize; } - const char *getData() { return data; } - ElfSection *getLink() { return link; } + const char* getData() { return data; } + ElfSection* getLink() { return link; } SectionInfo getInfo() { return info; } void shrink(unsigned int newsize) { @@ -347,7 +347,7 @@ class ElfSection { void grow(unsigned int newsize) { if (newsize > shdr.sh_size) { - data = static_cast(realloc(data, newsize)); + data = static_cast(realloc(data, newsize)); memset(data + shdr.sh_size, 0, newsize - shdr.sh_size); shdr.sh_size = newsize; markDirty(); @@ -356,10 +356,10 @@ class ElfSection { unsigned int getOffset(); int getIndex(); - Elf_Shdr &getShdr(); + Elf_Shdr& getShdr(); - ElfSection *getNext() { return next; } - ElfSection *getPrevious() { return previous; } + ElfSection* getNext() { return next; } + ElfSection* getPrevious() { return previous; } virtual bool isRelocatable() { return ((getType() == SHT_SYMTAB) || (getType() == SHT_STRTAB) || @@ -371,7 +371,7 @@ class ElfSection { (getFlags() & SHF_ALLOC); } - void insertAfter(ElfSection *section, bool dirty = true) { + void insertAfter(ElfSection* section, bool dirty = true) { if (previous != nullptr) previous->next = next; if (next != nullptr) next->previous = previous; previous = section; @@ -385,7 +385,7 @@ class ElfSection { insertInSegments(section->segments); } - virtual void insertBefore(ElfSection *section, bool dirty = true) { + virtual void insertBefore(ElfSection* section, bool dirty = true) { if (previous != nullptr) previous->next = next; if (next != nullptr) next->previous = previous; next = section; @@ -407,49 +407,49 @@ class ElfSection { if (next) next->markDirty(); } - virtual void serialize(std::ofstream &file, char ei_class, char ei_data) { + virtual void serialize(std::ofstream& file, char ei_class, char ei_data) { if (getType() == SHT_NOBITS) return; file.seekp(getOffset()); file.write(data, getSize()); } - ElfSegment *getSegmentByType(unsigned int type); + ElfSegment* getSegmentByType(unsigned int type); private: friend class ElfSegment; - void addToSegment(ElfSegment *segment) { segments.push_back(segment); } + void addToSegment(ElfSegment* segment) { segments.push_back(segment); } - void removeFromSegment(ElfSegment *segment) { - std::vector::iterator i = + void removeFromSegment(ElfSegment* segment) { + std::vector::iterator i = std::find(segments.begin(), segments.end(), segment); segments.erase(i, i + 1); } - void insertInSegments(std::vector &segs); + void insertInSegments(std::vector& segs); protected: Elf_Shdr shdr; - char *data; - const char *name; + char* data; + const char* name; private: - ElfSection *link; + ElfSection* link; SectionInfo info; ElfSection *next, *previous; int index; - std::vector segments; + std::vector segments; }; class ElfSegment { public: - ElfSegment(Elf_Phdr *phdr); + ElfSegment(Elf_Phdr* phdr); unsigned int getType() { return type; } unsigned int getFlags() { return flags; } unsigned int getAlign() { return align; } - ElfSection *getFirstSection() { + ElfSection* getFirstSection() { return sections.empty() ? nullptr : sections.front(); } int getVPDiff() { return v_p_diff; } @@ -458,11 +458,11 @@ class ElfSegment { unsigned int getOffset(); unsigned int getAddr(); - void addSection(ElfSection *section); - void removeSection(ElfSection *section); + void addSection(ElfSection* section); + void removeSection(ElfSection* section); - std::list::iterator begin() { return sections.begin(); } - std::list::iterator end() { return sections.end(); } + std::list::iterator begin() { return sections.begin(); } + std::list::iterator end() { return sections.end(); } void clear(); @@ -471,7 +471,7 @@ class ElfSegment { int v_p_diff; // Difference between physical and virtual address unsigned int flags; unsigned int align; - std::list sections; + std::list sections; // The following are only really used for PT_GNU_RELRO until something // better is found. unsigned int vaddr; @@ -480,8 +480,8 @@ class ElfSegment { class Elf_Ehdr : public serializable, public ElfSection { public: - Elf_Ehdr(std::ifstream &file, char ei_class, char ei_data); - void serialize(std::ofstream &file, char ei_class, char ei_data) { + Elf_Ehdr(std::ifstream& file, char ei_class, char ei_data); + void serialize(std::ofstream& file, char ei_class, char ei_data) { serializable::serialize(file, ei_class, ei_data); } }; @@ -489,9 +489,9 @@ class Elf_Ehdr : public serializable, public ElfSection { class Elf_Phdr : public serializable { public: Elf_Phdr(){}; - Elf_Phdr(std::ifstream &file, char ei_class, char ei_data) + Elf_Phdr(std::ifstream& file, char ei_class, char ei_data) : serializable(file, ei_class, ei_data){}; - bool contains(ElfSection *section) { + bool contains(ElfSection* section) { unsigned int size = section->getSize(); unsigned int addr = section->getAddr(); // This may be biased, but should work in most cases @@ -510,19 +510,19 @@ typedef serializable Elf_Dyn; struct Elf_DynValue { unsigned int tag; - ElfValue *value; + ElfValue* value; }; class ElfDynamic_Section : public ElfSection { public: - ElfDynamic_Section(Elf_Shdr &s, std::ifstream *file, Elf *parent); + ElfDynamic_Section(Elf_Shdr& s, std::ifstream* file, Elf* parent); ~ElfDynamic_Section(); - void serialize(std::ofstream &file, char ei_class, char ei_data); + void serialize(std::ofstream& file, char ei_class, char ei_data); - ElfValue *getValueForType(unsigned int tag); - ElfSection *getSectionForType(unsigned int tag); - bool setValueForType(unsigned int tag, ElfValue *val); + ElfValue* getValueForType(unsigned int tag); + ElfSection* getSectionForType(unsigned int tag); + bool setValueForType(unsigned int tag, ElfValue* val); private: std::vector dyns; @@ -531,7 +531,7 @@ class ElfDynamic_Section : public ElfSection { typedef serializable Elf_Sym; struct Elf_SymValue { - const char *name; + const char* name; unsigned char info; unsigned char other; ElfLocation value; @@ -543,11 +543,11 @@ struct Elf_SymValue { class ElfSymtab_Section : public ElfSection { public: - ElfSymtab_Section(Elf_Shdr &s, std::ifstream *file, Elf *parent); + ElfSymtab_Section(Elf_Shdr& s, std::ifstream* file, Elf* parent); - void serialize(std::ofstream &file, char ei_class, char ei_data); + void serialize(std::ofstream& file, char ei_class, char ei_data); - Elf_SymValue *lookup(const char *name, + Elf_SymValue* lookup(const char* name, unsigned int type_filter = STT(OBJECT) | STT(FUNC)); // private: // Until we have a real API @@ -558,7 +558,7 @@ class Elf_Rel : public serializable { public: Elf_Rel() : serializable(){}; - Elf_Rel(std::ifstream &file, char ei_class, char ei_data) + Elf_Rel(std::ifstream& file, char ei_class, char ei_data) : serializable(file, ei_class, ei_data){}; static const unsigned int sh_type = SHT_REL; @@ -570,7 +570,7 @@ class Elf_Rela : public serializable { public: Elf_Rela() : serializable(){}; - Elf_Rela(std::ifstream &file, char ei_class, char ei_data) + Elf_Rela(std::ifstream& file, char ei_class, char ei_data) : serializable(file, ei_class, ei_data){}; static const unsigned int sh_type = SHT_RELA; @@ -581,7 +581,7 @@ class Elf_Rela : public serializable { template class ElfRel_Section : public ElfSection { public: - ElfRel_Section(Elf_Shdr &s, std::ifstream *file, Elf *parent) + ElfRel_Section(Elf_Shdr& s, std::ifstream* file, Elf* parent) : ElfSection(s, file, parent) { int pos = file->tellg(); file->seekg(shdr.sh_offset); @@ -592,7 +592,7 @@ class ElfRel_Section : public ElfSection { file->seekg(pos); } - void serialize(std::ofstream &file, char ei_class, char ei_data) { + void serialize(std::ofstream& file, char ei_class, char ei_data) { for (typename std::vector::iterator i = rels.begin(); i != rels.end(); ++i) (*i).serialize(file, ei_class, ei_data); @@ -603,7 +603,7 @@ class ElfRel_Section : public ElfSection { class ElfStrtab_Section : public ElfSection { public: - ElfStrtab_Section(Elf_Shdr &s, std::ifstream *file, Elf *parent) + ElfStrtab_Section(Elf_Shdr& s, std::ifstream* file, Elf* parent) : ElfSection(s, file, parent) { table.push_back(table_storage(data, shdr.sh_size)); } @@ -614,22 +614,22 @@ class ElfStrtab_Section : public ElfSection { delete[] t->buf; } - const char *getStr(unsigned int index); + const char* getStr(unsigned int index); - const char *getStr(const char *string); + const char* getStr(const char* string); - unsigned int getStrIndex(const char *string); + unsigned int getStrIndex(const char* string); - void serialize(std::ofstream &file, char ei_class, char ei_data); + void serialize(std::ofstream& file, char ei_class, char ei_data); private: struct table_storage { unsigned int size, used; - char *buf; + char* buf; table_storage() : size(4096), used(0), buf(new char[4096]) {} - table_storage(const char *data, unsigned int sz) - : size(sz), used(sz), buf(const_cast(data)) {} + table_storage(const char* data, unsigned int sz) + : size(sz), used(sz), buf(const_cast(data)) {} }; std::vector table; }; @@ -643,28 +643,28 @@ inline char Elf::getType() { return ehdr->e_type; } inline char Elf::getMachine() { return ehdr->e_machine; } inline unsigned int Elf::getSize() { - ElfSection *section; + ElfSection* section; for (section = shdr_section /* It's usually not far from the end */; section->getNext() != nullptr; section = section->getNext()) ; return section->getOffset() + section->getSize(); } -inline ElfSegment *ElfSection::getSegmentByType(unsigned int type) { - for (std::vector::iterator seg = segments.begin(); +inline ElfSegment* ElfSection::getSegmentByType(unsigned int type) { + for (std::vector::iterator seg = segments.begin(); seg != segments.end(); ++seg) if ((*seg)->getType() == type) return *seg; return nullptr; } -inline void ElfSection::insertInSegments(std::vector &segs) { - for (std::vector::iterator it = segs.begin(); it != segs.end(); +inline void ElfSection::insertInSegments(std::vector& segs) { + for (std::vector::iterator it = segs.begin(); it != segs.end(); ++it) { (*it)->addSection(this); } } -inline ElfLocation::ElfLocation(ElfSection *section, unsigned int off, +inline ElfLocation::ElfLocation(ElfSection* section, unsigned int off, enum position pos) : section(section) { if ((pos == ABSOLUTE) && section) @@ -673,7 +673,7 @@ inline ElfLocation::ElfLocation(ElfSection *section, unsigned int off, offset = off; } -inline ElfLocation::ElfLocation(unsigned int location, Elf *elf) { +inline ElfLocation::ElfLocation(unsigned int location, Elf* elf) { section = elf->getSectionAt(location); offset = location - (section ? section->getAddr() : 0); } @@ -682,7 +682,7 @@ inline unsigned int ElfLocation::getValue() { return (section ? section->getAddr() : 0) + offset; } -inline const char *ElfLocation::getBuffer() { +inline const char* ElfLocation::getBuffer() { return section ? section->getData() + offset : nullptr; } diff --git a/build/unix/elfhack/inject.c b/build/unix/elfhack/inject.c index 1a262423fa350..54049fb268cdd 100644 --- a/build/unix/elfhack/inject.c +++ b/build/unix/elfhack/inject.c @@ -30,7 +30,7 @@ // trampoline, corresponding to the code GCC generates with long_call. #ifdef __arm__ __attribute__((section(".text._init_trampoline"), naked)) int init_trampoline( - int argc, char **argv, char **env) { + int argc, char** argv, char** env) { __asm__ __volatile__( // thumb doesn't allow to use r12/ip with ldr, and thus would require an // additional push/pop to save/restore the modified register, which would @@ -46,13 +46,13 @@ __attribute__((section(".text._init_trampoline"), naked)) int init_trampoline( #endif extern __attribute__((visibility("hidden"))) void original_init(int argc, - char **argv, - char **env); + char** argv, + char** env); extern __attribute__((visibility("hidden"))) Elf32_Rel relhack[]; extern __attribute__((visibility("hidden"))) Elf_Ehdr elf_header; -extern __attribute__((visibility("hidden"))) int (*mprotect_cb)(void *addr, +extern __attribute__((visibility("hidden"))) int (*mprotect_cb)(void* addr, size_t len, int prot); extern __attribute__((visibility("hidden"))) long (*sysconf_cb)(int name); @@ -60,24 +60,24 @@ extern __attribute__((visibility("hidden"))) char relro_start[]; extern __attribute__((visibility("hidden"))) char relro_end[]; static inline __attribute__((always_inline)) void do_relocations(void) { - Elf32_Rel *rel; + Elf32_Rel* rel; Elf_Addr *ptr, *start; for (rel = relhack; rel->r_offset; rel++) { - start = (Elf_Addr *)((intptr_t)&elf_header + rel->r_offset); + start = (Elf_Addr*)((intptr_t)&elf_header + rel->r_offset); for (ptr = start; ptr < &start[rel->r_info]; ptr++) *ptr += (intptr_t)&elf_header; } } __attribute__((section(".text._init_noinit"))) int init_noinit(int argc, - char **argv, - char **env) { + char** argv, + char** env) { do_relocations(); return 0; } -__attribute__((section(".text._init"))) int init(int argc, char **argv, - char **env) { +__attribute__((section(".text._init"))) int init(int argc, char** argv, + char** env) { do_relocations(); original_init(argc, argv, env); // Ensure there is no tail-call optimization, avoiding the use of the @@ -96,12 +96,12 @@ static inline __attribute__((always_inline)) void do_relocations_with_relro( // By the time the injected code runs, the relro segment is read-only. But // we want to apply relocations in it, so we set it r/w first. We'll restore // it to read-only in relro_post. - mprotect_cb((void *)aligned_relro_start, + mprotect_cb((void*)aligned_relro_start, aligned_relro_end - aligned_relro_start, PROT_READ | PROT_WRITE); do_relocations(); - mprotect_cb((void *)aligned_relro_start, + mprotect_cb((void*)aligned_relro_start, aligned_relro_end - aligned_relro_start, PROT_READ); // mprotect_cb and sysconf_cb are allocated in .bss, so we need to restore // them to a NULL value. @@ -110,14 +110,14 @@ static inline __attribute__((always_inline)) void do_relocations_with_relro( } __attribute__((section(".text._init_noinit_relro"))) int init_noinit_relro( - int argc, char **argv, char **env) { + int argc, char** argv, char** env) { do_relocations_with_relro(); return 0; } __attribute__((section(".text._init_relro"))) int init_relro(int argc, - char **argv, - char **env) { + char** argv, + char** env) { do_relocations_with_relro(); original_init(argc, argv, env); return 0; diff --git a/build/unix/elfhack/test.c b/build/unix/elfhack/test.c index b94eda911c945..9e412de21e985 100644 --- a/build/unix/elfhack/test.c +++ b/build/unix/elfhack/test.c @@ -91,7 +91,7 @@ DEF(times) # include "test.c" # undef DEF -const char *strings[] = { +const char* strings[] = { # define DEF(w) str_##w, # include "test.c" # include "test.c" @@ -101,7 +101,7 @@ const char *strings[] = { /* Create a hole between two zones of relative relocations */ const int hole[] = {42, 42, 42, 42}; -const char *strings2[] = { +const char* strings2[] = { # include "test.c" # include "test.c" # include "test.c" diff --git a/caps/NullPrincipalURI.h b/caps/NullPrincipalURI.h index 32364b090c8a5..56181a97ee3df 100644 --- a/caps/NullPrincipalURI.h +++ b/caps/NullPrincipalURI.h @@ -46,7 +46,7 @@ class NullPrincipalURI final : public nsIURI, public nsISizeOf { private: NullPrincipalURI(); - NullPrincipalURI(const NullPrincipalURI &aOther); + NullPrincipalURI(const NullPrincipalURI& aOther); ~NullPrincipalURI() {} @@ -54,22 +54,22 @@ class NullPrincipalURI final : public nsIURI, public nsISizeOf { nsAutoCStringN mPath; - nsresult Clone(nsIURI **aURI); - nsresult SetSpecInternal(const nsACString &input); - nsresult SetScheme(const nsACString &input); - nsresult SetUserPass(const nsACString &input); - nsresult SetUsername(const nsACString &input); - nsresult SetPassword(const nsACString &input); - nsresult SetHostPort(const nsACString &aValue); - nsresult SetHost(const nsACString &input); + nsresult Clone(nsIURI** aURI); + nsresult SetSpecInternal(const nsACString& input); + nsresult SetScheme(const nsACString& input); + nsresult SetUserPass(const nsACString& input); + nsresult SetUsername(const nsACString& input); + nsresult SetPassword(const nsACString& input); + nsresult SetHostPort(const nsACString& aValue); + nsresult SetHost(const nsACString& input); nsresult SetPort(int32_t port); - nsresult SetPathQueryRef(const nsACString &input); - nsresult SetRef(const nsACString &input); - nsresult SetFilePath(const nsACString &input); - nsresult SetQuery(const nsACString &input); - nsresult SetQueryWithEncoding(const nsACString &input, - const Encoding *encoding); - bool Deserialize(const mozilla::ipc::URIParams &); + nsresult SetPathQueryRef(const nsACString& input); + nsresult SetRef(const nsACString& input); + nsresult SetFilePath(const nsACString& input); + nsresult SetQuery(const nsACString& input); + nsresult SetQueryWithEncoding(const nsACString& input, + const Encoding* encoding); + bool Deserialize(const mozilla::ipc::URIParams&); public: class Mutator final : public nsIURIMutator, @@ -77,17 +77,17 @@ class NullPrincipalURI final : public nsIURI, public nsISizeOf { NS_DECL_ISUPPORTS NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI) - NS_IMETHOD Deserialize(const mozilla::ipc::URIParams &aParams) override { + NS_IMETHOD Deserialize(const mozilla::ipc::URIParams& aParams) override { return InitFromIPCParams(aParams); } - NS_IMETHOD Finalize(nsIURI **aURI) override { + NS_IMETHOD Finalize(nsIURI** aURI) override { mURI.forget(aURI); return NS_OK; } - NS_IMETHOD SetSpec(const nsACString &aSpec, - nsIURIMutator **aMutator) override { + NS_IMETHOD SetSpec(const nsACString& aSpec, + nsIURIMutator** aMutator) override { if (aMutator) { nsCOMPtr mutator = this; mutator.forget(aMutator); diff --git a/caps/tests/gtest/TestOriginAttributes.cpp b/caps/tests/gtest/TestOriginAttributes.cpp index 9aaae8282972e..69bd1cf47fbc2 100644 --- a/caps/tests/gtest/TestOriginAttributes.cpp +++ b/caps/tests/gtest/TestOriginAttributes.cpp @@ -9,7 +9,7 @@ using mozilla::OriginAttributes; using mozilla::Preferences; -static void TestSuffix(const OriginAttributes &attrs) { +static void TestSuffix(const OriginAttributes& attrs) { nsAutoCString suffix; attrs.CreateSuffix(suffix); @@ -20,7 +20,7 @@ static void TestSuffix(const OriginAttributes &attrs) { EXPECT_EQ(attrs, attrsFromSuffix); } -static void TestFPD(const nsAString &spec, const nsAString &fpd) { +static void TestFPD(const nsAString& spec, const nsAString& fpd) { OriginAttributes attrs; nsCOMPtr url; ASSERT_EQ(NS_NewURI(getter_AddRefs(url), spec), NS_OK); diff --git a/chrome/nsChromeProtocolHandler.cpp b/chrome/nsChromeProtocolHandler.cpp index ebd6f7dba50a9..faf9b30007565 100644 --- a/chrome/nsChromeProtocolHandler.cpp +++ b/chrome/nsChromeProtocolHandler.cpp @@ -38,41 +38,41 @@ NS_IMPL_ISUPPORTS(nsChromeProtocolHandler, nsIProtocolHandler, // nsIProtocolHandler methods: NS_IMETHODIMP -nsChromeProtocolHandler::GetScheme(nsACString &result) { +nsChromeProtocolHandler::GetScheme(nsACString& result) { result.AssignLiteral("chrome"); return NS_OK; } NS_IMETHODIMP -nsChromeProtocolHandler::GetDefaultPort(int32_t *result) { +nsChromeProtocolHandler::GetDefaultPort(int32_t* result) { *result = -1; // no port for chrome: URLs return NS_OK; } NS_IMETHODIMP -nsChromeProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +nsChromeProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { // don't override anything. *_retval = false; return NS_OK; } NS_IMETHODIMP -nsChromeProtocolHandler::GetProtocolFlags(uint32_t *result) { +nsChromeProtocolHandler::GetProtocolFlags(uint32_t* result) { *result = URI_STD | URI_IS_UI_RESOURCE | URI_IS_LOCAL_RESOURCE; return NS_OK; } NS_IMETHODIMP -nsChromeProtocolHandler::NewURI(const nsACString &aSpec, const char *aCharset, - nsIURI *aBaseURI, nsIURI **result) { +nsChromeProtocolHandler::NewURI(const nsACString& aSpec, const char* aCharset, + nsIURI* aBaseURI, nsIURI** result) { return nsChromeProtocolHandler::CreateNewURI(aSpec, aCharset, aBaseURI, result); } /* static */ nsresult nsChromeProtocolHandler::CreateNewURI( - const nsACString &aSpec, const char *aCharset, nsIURI *aBaseURI, - nsIURI **result) { + const nsACString& aSpec, const char* aCharset, nsIURI* aBaseURI, + nsIURI** result) { // Chrome: URLs (currently) have no additional structure beyond that provided // by standard URLs, so there is no "outer" given to CreateInstance nsresult rv; @@ -99,8 +99,8 @@ nsChromeProtocolHandler::NewURI(const nsACString &aSpec, const char *aCharset, } NS_IMETHODIMP -nsChromeProtocolHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, - nsIChannel **aResult) { +nsChromeProtocolHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, + nsIChannel** aResult) { nsresult rv; NS_ENSURE_ARG_POINTER(aURI); diff --git a/chrome/nsChromeProtocolHandler.h b/chrome/nsChromeProtocolHandler.h index d43a2e00e1c92..1fcced3dac1f7 100644 --- a/chrome/nsChromeProtocolHandler.h +++ b/chrome/nsChromeProtocolHandler.h @@ -27,8 +27,8 @@ class nsChromeProtocolHandler final : public nsIProtocolHandler, // nsChromeProtocolHandler methods: nsChromeProtocolHandler() {} - static nsresult CreateNewURI(const nsACString &aSpec, const char *aCharset, - nsIURI *aBaseURI, nsIURI **result); + static nsresult CreateNewURI(const nsACString& aSpec, const char* aCharset, + nsIURI* aBaseURI, nsIURI** result); private: ~nsChromeProtocolHandler() {} diff --git a/config/nsinstall.c b/config/nsinstall.c index 7119f22c509e3..ca70dc40f8348 100644 --- a/config/nsinstall.c +++ b/config/nsinstall.c @@ -62,8 +62,8 @@ static void usage(void) { exit(2); } -static int mkdirs(char *path, mode_t mode) { - char *cp; +static int mkdirs(char* path, mode_t mode) { + char* cp; struct stat sb; int res; int l; @@ -91,10 +91,10 @@ static int mkdirs(char *path, mode_t mode) { return res; } -static uid_t touid(char *owner) { - struct passwd *pw; +static uid_t touid(char* owner) { + struct passwd* pw; uid_t uid; - char *cp; + char* cp; pw = getpwnam(owner); if (pw) return pw->pw_uid; @@ -103,10 +103,10 @@ static uid_t touid(char *owner) { return uid; } -static gid_t togid(char *group) { - struct group *gr; +static gid_t togid(char* group) { + struct group* gr; gid_t gid; - char *cp; + char* cp; gr = getgrnam(group); if (gr) return gr->gr_gid; @@ -115,8 +115,8 @@ static gid_t togid(char *group) { return gid; } -static void copyfile(char *name, char *toname, mode_t mode, char *group, - char *owner, int dotimes, uid_t uid, gid_t gid) { +static void copyfile(char* name, char* toname, mode_t mode, char* group, + char* owner, int dotimes, uid_t uid, gid_t gid) { int fromfd, tofd = -1, cc, wc, exists; char buf[BUFSIZ], *bp; struct stat sb, tosb; @@ -181,10 +181,10 @@ static void copyfile(char *name, char *toname, mode_t mode, char *group, #endif } -static void copydir(char *from, char *to, mode_t mode, char *group, char *owner, +static void copydir(char* from, char* to, mode_t mode, char* group, char* owner, int dotimes, uid_t uid, gid_t gid) { - DIR *dir; - struct dirent *ep; + DIR* dir; + struct dirent* ep; struct stat sb; char *base, *destdir, *direntry, *destentry; @@ -226,7 +226,7 @@ static void copydir(char *from, char *to, mode_t mode, char *group, char *owner, closedir(dir); } -int main(int argc, char **argv) { +int main(int argc, char** argv) { int onlydir, dodir, dolink, dorelsymlink, dotimes, opt, len, lplen, tdlen, bnlen, exists; mode_t mode = 0755; diff --git a/config/pathsub.c b/config/pathsub.c index 271b26dff353d..cac00d95fef6b 100644 --- a/config/pathsub.c +++ b/config/pathsub.c @@ -27,9 +27,9 @@ # include "sunos4.h" #endif -char *program; +char* program; -void fail(const char *format, ...) { +void fail(const char* format, ...) { int error; va_list ap; @@ -55,7 +55,7 @@ void fail(const char *format, ...) { exit(1); } -char *getcomponent(char *path, char *name) { +char* getcomponent(char* path, char* name) { if (*path == '\0') return 0; if (*path == '/') { *name++ = '/'; @@ -74,19 +74,19 @@ char *getcomponent(char *path, char *name) { /* ** The static buffer in Unixware's readdir is too small. */ -struct dirent *readdir(DIR *d) { - static struct dirent *buf = NULL; +struct dirent* readdir(DIR* d) { + static struct dirent* buf = NULL; if (buf == NULL) - buf = (struct dirent *)malloc(sizeof(struct dirent) + MAXPATHLEN); + buf = (struct dirent*)malloc(sizeof(struct dirent) + MAXPATHLEN); return (readdir_r(d, buf)); } #endif -char *ino2name(ino_t ino) { - DIR *dp; - struct dirent *ep; - char *name; +char* ino2name(ino_t ino) { + DIR* dp; + struct dirent* ep; + char* name; dp = opendir(".."); if (!dp) fail("cannot read parent directory"); @@ -99,27 +99,27 @@ char *ino2name(ino_t ino) { return name; } -void *xmalloc(size_t size) { - void *p = malloc(size); +void* xmalloc(size_t size) { + void* p = malloc(size); if (!p) fail("cannot allocate %u bytes", size); return p; } -char *xstrdup(char *s) { return strcpy(xmalloc(strlen(s) + 1), s); } +char* xstrdup(char* s) { return strcpy(xmalloc(strlen(s) + 1), s); } -char *xbasename(char *path) { - char *cp; +char* xbasename(char* path) { + char* cp; while ((cp = strrchr(path, '/')) && cp[1] == '\0') *cp = '\0'; if (!cp) return path; return cp + 1; } -void xchdir(const char *dir) { +void xchdir(const char* dir) { if (chdir(dir) < 0) fail("cannot change directory to %s", dir); } -int relatepaths(char *from, char *to, char *outpath) { +int relatepaths(char* from, char* to, char* outpath) { char *cp, *cp2; int len; char buf[NAME_MAX]; @@ -149,7 +149,7 @@ int relatepaths(char *from, char *to, char *outpath) { return len; } -void reversepath(char *inpath, char *name, int len, char *outpath) { +void reversepath(char* inpath, char* name, int len, char* outpath) { char *cp, *cp2; char buf[NAME_MAX]; struct stat sb; diff --git a/config/pathsub.h b/config/pathsub.h index 9a6cb4c6a7cea..e01bc63d86743 100644 --- a/config/pathsub.h +++ b/config/pathsub.h @@ -23,20 +23,20 @@ #undef NAME_MAX #define NAME_MAX 256 -extern char *program; +extern char* program; -extern void fail(const char *format, ...); -extern char *getcomponent(char *path, char *name); -extern char *ino2name(ino_t ino); -extern void *xmalloc(size_t size); -extern char *xstrdup(char *s); -extern char *xbasename(char *path); -extern void xchdir(const char *dir); +extern void fail(const char* format, ...); +extern char* getcomponent(char* path, char* name); +extern char* ino2name(ino_t ino); +extern void* xmalloc(size_t size); +extern char* xstrdup(char* s); +extern char* xbasename(char* path); +extern void xchdir(const char* dir); /* Relate absolute pathnames from and to returning the result in outpath. */ -extern int relatepaths(char *from, char *to, char *outpath); +extern int relatepaths(char* from, char* to, char* outpath); /* XXX changes current working directory -- caveat emptor */ -extern void reversepath(char *inpath, char *name, int len, char *outpath); +extern void reversepath(char* inpath, char* name, int len, char* outpath); #endif /* pathsub_h___ */ diff --git a/devtools/platform/nsJSInspector.cpp b/devtools/platform/nsJSInspector.cpp index e4a1e92130f3e..33924a209a3c9 100644 --- a/devtools/platform/nsJSInspector.cpp +++ b/devtools/platform/nsJSInspector.cpp @@ -62,7 +62,7 @@ nsJSInspector::~nsJSInspector() { NS_IMETHODIMP nsJSInspector::EnterNestedEventLoop(JS::Handle requestor, - uint32_t *out) { + uint32_t* out) { nsresult rv = NS_OK; mLastRequestor = requestor; @@ -88,7 +88,7 @@ nsJSInspector::EnterNestedEventLoop(JS::Handle requestor, } NS_IMETHODIMP -nsJSInspector::ExitNestedEventLoop(uint32_t *out) { +nsJSInspector::ExitNestedEventLoop(uint32_t* out) { if (mNestedLoopLevel > 0) { mRequestors.RemoveElementAt(--mNestedLoopLevel); if (mNestedLoopLevel > 0) @@ -105,7 +105,7 @@ nsJSInspector::ExitNestedEventLoop(uint32_t *out) { } NS_IMETHODIMP -nsJSInspector::GetEventLoopNestLevel(uint32_t *out) { +nsJSInspector::GetEventLoopNestLevel(uint32_t* out) { *out = mNestedLoopLevel; return NS_OK; } diff --git a/dom/base/Link.cpp b/dom/base/Link.cpp index b76c6f393f6a8..70a29b4ee1733 100644 --- a/dom/base/Link.cpp +++ b/dom/base/Link.cpp @@ -39,7 +39,7 @@ namespace dom { using places::History; #endif -Link::Link(Element *aElement) +Link::Link(Element* aElement) : mElement(aElement), mLinkState(eLinkState_NotLink), mNeedsRegistration(false), @@ -95,10 +95,10 @@ void Link::CancelDNSPrefetch(nsWrapperCache::FlagsType aDeferredFlag, } } -void Link::GetContentPolicyMimeTypeMedia(nsAttrValue &aAsAttr, - nsContentPolicyType &aPolicyType, - nsString &aMimeType, - nsAString &aMedia) { +void Link::GetContentPolicyMimeTypeMedia(nsAttrValue& aAsAttr, + nsContentPolicyType& aPolicyType, + nsString& aMimeType, + nsAString& aMedia) { nsAutoString as; mElement->GetAttr(kNameSpaceID_None, nsGkAtoms::as, as); Link::ParseAsValue(as, aAsAttr); @@ -185,8 +185,8 @@ void Link::TryDNSPrefetchOrPreconnectOrPrefetchOrPreloadOrPrerender() { } } -void Link::UpdatePreload(nsAtom *aName, const nsAttrValue *aValue, - const nsAttrValue *aOldValue) { +void Link::UpdatePreload(nsAtom* aName, const nsAttrValue* aValue, + const nsAttrValue* aOldValue) { MOZ_ASSERT(mElement->IsInComposedDoc()); if (!ElementHasHref()) { @@ -340,9 +340,9 @@ void Link::SetLinkState(nsLinkState aState) { EventStates Link::LinkState() const { // We are a constant method, but we are just lazily doing things and have to // track that state. Cast away that constness! - Link *self = const_cast(this); + Link* self = const_cast(this); - Element *element = self->mElement; + Element* element = self->mElement; // If we have not yet registered for notifications and need to, // due to our href changing, register now! @@ -362,7 +362,7 @@ EventStates Link::LinkState() const { #ifdef ANDROID nsCOMPtr history = services::GetHistoryService(); #elif defined(MOZ_PLACES) - History *history = History::GetService(); + History* history = History::GetService(); #else nsCOMPtr history; #endif @@ -390,21 +390,21 @@ EventStates Link::LinkState() const { return EventStates(); } -nsIURI *Link::GetURI() const { +nsIURI* Link::GetURI() const { // If we have this URI cached, use it. if (mCachedURI) { return mCachedURI; } // Otherwise obtain it. - Link *self = const_cast(this); - Element *element = self->mElement; + Link* self = const_cast(this); + Element* element = self->mElement; mCachedURI = element->GetHrefURI(); return mCachedURI; } -void Link::SetProtocol(const nsAString &aProtocol) { +void Link::SetProtocol(const nsAString& aProtocol) { nsCOMPtr uri(GetURI()); if (!uri) { // Ignore failures to be compatible with NS4. @@ -426,7 +426,7 @@ void Link::SetProtocol(const nsAString &aProtocol) { SetHrefAttribute(uri); } -void Link::SetPassword(const nsAString &aPassword) { +void Link::SetPassword(const nsAString& aPassword) { nsCOMPtr uri(GetURI()); if (!uri) { // Ignore failures to be compatible with NS4. @@ -441,7 +441,7 @@ void Link::SetPassword(const nsAString &aPassword) { } } -void Link::SetUsername(const nsAString &aUsername) { +void Link::SetUsername(const nsAString& aUsername) { nsCOMPtr uri(GetURI()); if (!uri) { // Ignore failures to be compatible with NS4. @@ -456,7 +456,7 @@ void Link::SetUsername(const nsAString &aUsername) { } } -void Link::SetHost(const nsAString &aHost) { +void Link::SetHost(const nsAString& aHost) { nsCOMPtr uri(GetURI()); if (!uri) { // Ignore failures to be compatible with NS4. @@ -471,7 +471,7 @@ void Link::SetHost(const nsAString &aHost) { SetHrefAttribute(uri); } -void Link::SetHostname(const nsAString &aHostname) { +void Link::SetHostname(const nsAString& aHostname) { nsCOMPtr uri(GetURI()); if (!uri) { // Ignore failures to be compatible with NS4. @@ -486,7 +486,7 @@ void Link::SetHostname(const nsAString &aHostname) { SetHrefAttribute(uri); } -void Link::SetPathname(const nsAString &aPathname) { +void Link::SetPathname(const nsAString& aPathname) { nsCOMPtr uri(GetURI()); nsCOMPtr url(do_QueryInterface(uri)); if (!url) { @@ -503,7 +503,7 @@ void Link::SetPathname(const nsAString &aPathname) { SetHrefAttribute(uri); } -void Link::SetSearch(const nsAString &aSearch) { +void Link::SetSearch(const nsAString& aSearch) { nsCOMPtr uri(GetURI()); nsCOMPtr url(do_QueryInterface(uri)); if (!url) { @@ -522,7 +522,7 @@ void Link::SetSearch(const nsAString &aSearch) { SetHrefAttribute(uri); } -void Link::SetPort(const nsAString &aPort) { +void Link::SetPort(const nsAString& aPort) { nsCOMPtr uri(GetURI()); if (!uri) { // Ignore failures to be compatible with NS4. @@ -548,7 +548,7 @@ void Link::SetPort(const nsAString &aPort) { SetHrefAttribute(uri); } -void Link::SetHash(const nsAString &aHash) { +void Link::SetHash(const nsAString& aHash) { nsCOMPtr uri(GetURI()); if (!uri) { // Ignore failures to be compatible with NS4. @@ -564,7 +564,7 @@ void Link::SetHash(const nsAString &aHash) { SetHrefAttribute(uri); } -void Link::GetOrigin(nsAString &aOrigin) { +void Link::GetOrigin(nsAString& aOrigin) { aOrigin.Truncate(); nsCOMPtr uri(GetURI()); @@ -577,7 +577,7 @@ void Link::GetOrigin(nsAString &aOrigin) { aOrigin.Assign(origin); } -void Link::GetProtocol(nsAString &_protocol) { +void Link::GetProtocol(nsAString& _protocol) { nsCOMPtr uri(GetURI()); if (!uri) { _protocol.AssignLiteral("http"); @@ -589,7 +589,7 @@ void Link::GetProtocol(nsAString &_protocol) { _protocol.Append(char16_t(':')); } -void Link::GetUsername(nsAString &aUsername) { +void Link::GetUsername(nsAString& aUsername) { aUsername.Truncate(); nsCOMPtr uri(GetURI()); @@ -602,7 +602,7 @@ void Link::GetUsername(nsAString &aUsername) { CopyASCIItoUTF16(username, aUsername); } -void Link::GetPassword(nsAString &aPassword) { +void Link::GetPassword(nsAString& aPassword) { aPassword.Truncate(); nsCOMPtr uri(GetURI()); @@ -615,7 +615,7 @@ void Link::GetPassword(nsAString &aPassword) { CopyASCIItoUTF16(password, aPassword); } -void Link::GetHost(nsAString &_host) { +void Link::GetHost(nsAString& _host) { _host.Truncate(); nsCOMPtr uri(GetURI()); @@ -631,7 +631,7 @@ void Link::GetHost(nsAString &_host) { } } -void Link::GetHostname(nsAString &_hostname) { +void Link::GetHostname(nsAString& _hostname) { _hostname.Truncate(); nsCOMPtr uri(GetURI()); @@ -643,7 +643,7 @@ void Link::GetHostname(nsAString &_hostname) { nsContentUtils::GetHostOrIPv6WithBrackets(uri, _hostname); } -void Link::GetPathname(nsAString &_pathname) { +void Link::GetPathname(nsAString& _pathname) { _pathname.Truncate(); nsCOMPtr uri(GetURI()); @@ -661,7 +661,7 @@ void Link::GetPathname(nsAString &_pathname) { } } -void Link::GetSearch(nsAString &_search) { +void Link::GetSearch(nsAString& _search) { _search.Truncate(); nsCOMPtr uri(GetURI()); @@ -680,7 +680,7 @@ void Link::GetSearch(nsAString &_search) { } } -void Link::GetPort(nsAString &_port) { +void Link::GetPort(nsAString& _port) { _port.Truncate(); nsCOMPtr uri(GetURI()); @@ -700,7 +700,7 @@ void Link::GetPort(nsAString &_port) { } } -void Link::GetHash(nsAString &_hash) { +void Link::GetHash(nsAString& _hash) { _hash.Truncate(); nsCOMPtr uri(GetURI()); @@ -732,7 +732,7 @@ void Link::ResetLinkState(bool aNotify, bool aHasHref) { // currently registered; in either case, we should remove ourself // from the doc and the history. if (!mNeedsRegistration && mLinkState != eLinkState_NotLink) { - Document *doc = mElement->GetComposedDoc(); + Document* doc = mElement->GetComposedDoc(); if (doc && (mRegistered || mLinkState == eLinkState_Visited)) { // Tell the document to forget about this link if we've registered // with it before. @@ -780,7 +780,7 @@ void Link::UnregisterFromHistory() { #ifdef ANDROID nsCOMPtr history = services::GetHistoryService(); #elif defined(MOZ_PLACES) - History *history = History::GetService(); + History* history = History::GetService(); #else nsCOMPtr history; #endif @@ -795,7 +795,7 @@ void Link::UnregisterFromHistory() { } } -void Link::SetHrefAttribute(nsIURI *aURI) { +void Link::SetHrefAttribute(nsIURI* aURI) { NS_ASSERTION(aURI, "Null URI is illegal!"); // if we change this code to not reserialize we need to do something smarter @@ -807,7 +807,7 @@ void Link::SetHrefAttribute(nsIURI *aURI) { NS_ConvertUTF8toUTF16(href), true); } -size_t Link::SizeOfExcludingThis(mozilla::SizeOfState &aState) const { +size_t Link::SizeOfExcludingThis(mozilla::SizeOfState& aState) const { size_t n = 0; if (mCachedURI) { @@ -831,7 +831,7 @@ static const nsAttrValue::EnumTable kAsAttributeTable[] = { {"fetch", DESTINATION_FETCH}, {nullptr, 0}}; /* static */ -void Link::ParseAsValue(const nsAString &aValue, nsAttrValue &aResult) { +void Link::ParseAsValue(const nsAString& aValue, nsAttrValue& aResult) { DebugOnly success = aResult.ParseEnumValue(aValue, kAsAttributeTable, false, // default value is a empty string @@ -842,7 +842,7 @@ void Link::ParseAsValue(const nsAString &aValue, nsAttrValue &aResult) { } /* static */ -nsContentPolicyType Link::AsValueToContentPolicy(const nsAttrValue &aValue) { +nsContentPolicyType Link::AsValueToContentPolicy(const nsAttrValue& aValue) { switch (aValue.GetEnumValue()) { case DESTINATION_INVALID: return nsIContentPolicy::TYPE_INVALID; diff --git a/dom/base/Link.h b/dom/base/Link.h index f72d10c1921b9..777e28cc0e6f1 100644 --- a/dom/base/Link.h +++ b/dom/base/Link.h @@ -38,7 +38,7 @@ class Link : public nsISupports { /** * aElement is the element pointer corresponding to this link. */ - explicit Link(Element *aElement); + explicit Link(Element* aElement); /** * This constructor is only used for testing. @@ -57,31 +57,31 @@ class Link : public nsISupports { /** * @return the URI this link is for, if available. */ - nsIURI *GetURI() const; - virtual nsIURI *GetURIExternal() const { return GetURI(); } + nsIURI* GetURI() const; + virtual nsIURI* GetURIExternal() const { return GetURI(); } /** * Helper methods for modifying and obtaining parts of the URI of the Link. */ - void SetProtocol(const nsAString &aProtocol); - void SetUsername(const nsAString &aUsername); - void SetPassword(const nsAString &aPassword); - void SetHost(const nsAString &aHost); - void SetHostname(const nsAString &aHostname); - void SetPathname(const nsAString &aPathname); - void SetSearch(const nsAString &aSearch); - void SetPort(const nsAString &aPort); - void SetHash(const nsAString &aHash); - void GetOrigin(nsAString &aOrigin); - void GetProtocol(nsAString &_protocol); - void GetUsername(nsAString &aUsername); - void GetPassword(nsAString &aPassword); - void GetHost(nsAString &_host); - void GetHostname(nsAString &_hostname); - void GetPathname(nsAString &_pathname); - void GetSearch(nsAString &_search); - void GetPort(nsAString &_port); - void GetHash(nsAString &_hash); + void SetProtocol(const nsAString& aProtocol); + void SetUsername(const nsAString& aUsername); + void SetPassword(const nsAString& aPassword); + void SetHost(const nsAString& aHost); + void SetHostname(const nsAString& aHostname); + void SetPathname(const nsAString& aPathname); + void SetSearch(const nsAString& aSearch); + void SetPort(const nsAString& aPort); + void SetHash(const nsAString& aHash); + void GetOrigin(nsAString& aOrigin); + void GetProtocol(nsAString& _protocol); + void GetUsername(nsAString& aUsername); + void GetPassword(nsAString& aPassword); + void GetHost(nsAString& _host); + void GetHostname(nsAString& _hostname); + void GetPathname(nsAString& _pathname); + void GetSearch(nsAString& _search); + void GetPort(nsAString& _port); + void GetHash(nsAString& _hash); /** * Invalidates any link caching, and resets the state to the default. @@ -93,7 +93,7 @@ class Link : public nsISupports { void ResetLinkState(bool aNotify, bool aHasHref); // This method nevers returns a null element. - Element *GetElement() const { return mElement; } + Element* GetElement() const { return mElement; } /** * DNS prefetch has been deferred until later, e.g. page load complete. @@ -115,7 +115,7 @@ class Link : public nsISupports { */ virtual bool HasDeferredDNSPrefetchRequest() { return true; } - virtual size_t SizeOfExcludingThis(mozilla::SizeOfState &aState) const; + virtual size_t SizeOfExcludingThis(mozilla::SizeOfState& aState) const; virtual bool ElementHasHref() const; @@ -126,8 +126,8 @@ class Link : public nsISupports { // This is called by HTMLLinkElement. void TryDNSPrefetchOrPreconnectOrPrefetchOrPreloadOrPrerender(); - void UpdatePreload(nsAtom *aName, const nsAttrValue *aValue, - const nsAttrValue *aOldValue); + void UpdatePreload(nsAtom* aName, const nsAttrValue* aValue, + const nsAttrValue* aOldValue); void CancelPrefetchOrPreload(); bool HasPendingLinkUpdate() const { return mHasPendingLinkUpdate; } @@ -138,14 +138,14 @@ class Link : public nsISupports { // similar to the one in Element. Overriders must call // ClearHasPendingLinkUpdate(). // If you change this, change also the method in Element. - virtual void NodeInfoChanged(Document *aOldDoc) = 0; + virtual void NodeInfoChanged(Document* aOldDoc) = 0; bool IsInDNSPrefetch() { return mInDNSPrefetch; } void SetIsInDNSPrefetch() { mInDNSPrefetch = true; } void ClearIsInDNSPrefetch() { mInDNSPrefetch = false; } - static void ParseAsValue(const nsAString &aValue, nsAttrValue &aResult); - static nsContentPolicyType AsValueToContentPolicy(const nsAttrValue &aValue); + static void ParseAsValue(const nsAString& aValue, nsAttrValue& aResult); + static nsContentPolicyType AsValueToContentPolicy(const nsAttrValue& aValue); protected: virtual ~Link(); @@ -161,7 +161,7 @@ class Link : public nsISupports { return !!GetURI(); } - nsIURI *GetCachedURI() const { return mCachedURI; } + nsIURI* GetCachedURI() const { return mCachedURI; } bool HasCachedURI() const { return !!mCachedURI; } private: @@ -171,15 +171,15 @@ class Link : public nsISupports { */ void UnregisterFromHistory(); - void SetHrefAttribute(nsIURI *aURI); + void SetHrefAttribute(nsIURI* aURI); - void GetContentPolicyMimeTypeMedia(nsAttrValue &aAsAttr, - nsContentPolicyType &aPolicyType, - nsString &aMimeType, nsAString &aMedia); + void GetContentPolicyMimeTypeMedia(nsAttrValue& aAsAttr, + nsContentPolicyType& aPolicyType, + nsString& aMimeType, nsAString& aMedia); mutable nsCOMPtr mCachedURI; - Element *const mElement; + Element* const mElement; uint16_t mLinkState; diff --git a/dom/base/NodeIterator.cpp b/dom/base/NodeIterator.cpp index f4b27fbacc0b2..1d0f986ed9183 100644 --- a/dom/base/NodeIterator.cpp +++ b/dom/base/NodeIterator.cpp @@ -25,10 +25,10 @@ namespace dom { /* * NodePointer implementation */ -NodeIterator::NodePointer::NodePointer(nsINode *aNode, bool aBeforeNode) +NodeIterator::NodePointer::NodePointer(nsINode* aNode, bool aBeforeNode) : mNode(aNode), mBeforeNode(aBeforeNode) {} -bool NodeIterator::NodePointer::MoveToNext(nsINode *aRoot) { +bool NodeIterator::NodePointer::MoveToNext(nsINode* aRoot) { if (!mNode) return false; if (mBeforeNode) { @@ -36,7 +36,7 @@ bool NodeIterator::NodePointer::MoveToNext(nsINode *aRoot) { return true; } - nsINode *child = mNode->GetFirstChild(); + nsINode* child = mNode->GetFirstChild(); if (child) { mNode = child; return true; @@ -45,7 +45,7 @@ bool NodeIterator::NodePointer::MoveToNext(nsINode *aRoot) { return MoveForward(aRoot, mNode); } -bool NodeIterator::NodePointer::MoveToPrevious(nsINode *aRoot) { +bool NodeIterator::NodePointer::MoveToPrevious(nsINode* aRoot) { if (!mNode) return false; if (!mBeforeNode) { @@ -61,8 +61,8 @@ bool NodeIterator::NodePointer::MoveToPrevious(nsINode *aRoot) { } void NodeIterator::NodePointer::AdjustAfterRemoval( - nsINode *aRoot, nsINode *aContainer, nsIContent *aChild, - nsIContent *aPreviousSibling) { + nsINode* aRoot, nsINode* aContainer, nsIContent* aChild, + nsIContent* aPreviousSibling) { // If mNode is null or the root there is nothing to do. if (!mNode || mNode == aRoot) return; @@ -71,7 +71,7 @@ void NodeIterator::NodePointer::AdjustAfterRemoval( if (mBeforeNode) { // Try the next sibling - nsINode *nextSibling = aPreviousSibling ? aPreviousSibling->GetNextSibling() + nsINode* nextSibling = aPreviousSibling ? aPreviousSibling->GetNextSibling() : aContainer->GetFirstChild(); if (nextSibling) { @@ -89,11 +89,11 @@ void NodeIterator::NodePointer::AdjustAfterRemoval( MoveBackward(aContainer, aPreviousSibling); } -bool NodeIterator::NodePointer::MoveForward(nsINode *aRoot, nsINode *aNode) { +bool NodeIterator::NodePointer::MoveForward(nsINode* aRoot, nsINode* aNode) { while (1) { if (aNode == aRoot) break; - nsINode *sibling = aNode->GetNextSibling(); + nsINode* sibling = aNode->GetNextSibling(); if (sibling) { mNode = sibling; return true; @@ -104,7 +104,7 @@ bool NodeIterator::NodePointer::MoveForward(nsINode *aRoot, nsINode *aNode) { return false; } -void NodeIterator::NodePointer::MoveBackward(nsINode *aParent, nsINode *aNode) { +void NodeIterator::NodePointer::MoveBackward(nsINode* aParent, nsINode* aNode) { if (aNode) { do { mNode = aNode; @@ -119,8 +119,8 @@ void NodeIterator::NodePointer::MoveBackward(nsINode *aParent, nsINode *aNode) { * Factories, constructors and destructors */ -NodeIterator::NodeIterator(nsINode *aRoot, uint32_t aWhatToShow, - NodeFilter *aFilter) +NodeIterator::NodeIterator(nsINode* aRoot, uint32_t aWhatToShow, + NodeFilter* aFilter) : nsTraversal(aRoot, aWhatToShow, aFilter), mPointer(mRoot, true) { aRoot->AddMutationObserver(this); } @@ -156,7 +156,7 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(NodeIterator) NS_IMPL_CYCLE_COLLECTING_RELEASE(NodeIterator) already_AddRefed NodeIterator::NextOrPrevNode( - NodePointer::MoveToMethodType aMove, ErrorResult &aResult) { + NodePointer::MoveToMethodType aMove, ErrorResult& aResult) { if (mInAcceptNode) { aResult.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return nullptr; @@ -165,8 +165,8 @@ already_AddRefed NodeIterator::NextOrPrevNode( mWorkingPointer = mPointer; struct AutoClear { - NodePointer *mPtr; - explicit AutoClear(NodePointer *ptr) : mPtr(ptr) {} + NodePointer* mPtr; + explicit AutoClear(NodePointer* ptr) : mPtr(ptr) {} ~AutoClear() { mPtr->Clear(); } } ac(&mWorkingPointer); @@ -196,17 +196,17 @@ void NodeIterator::Detach() { * nsIMutationObserver interface */ -void NodeIterator::ContentRemoved(nsIContent *aChild, - nsIContent *aPreviousSibling) { - nsINode *container = aChild->GetParentNode(); +void NodeIterator::ContentRemoved(nsIContent* aChild, + nsIContent* aPreviousSibling) { + nsINode* container = aChild->GetParentNode(); mPointer.AdjustAfterRemoval(mRoot, container, aChild, aPreviousSibling); mWorkingPointer.AdjustAfterRemoval(mRoot, container, aChild, aPreviousSibling); } -bool NodeIterator::WrapObject(JSContext *cx, JS::Handle aGivenProto, - JS::MutableHandle aReflector) { +bool NodeIterator::WrapObject(JSContext* cx, JS::Handle aGivenProto, + JS::MutableHandle aReflector) { return NodeIterator_Binding::Wrap(cx, this, aGivenProto, aReflector); } diff --git a/dom/base/NodeIterator.h b/dom/base/NodeIterator.h index e0680c868db9e..ed851a8455f6b 100644 --- a/dom/base/NodeIterator.h +++ b/dom/base/NodeIterator.h @@ -24,56 +24,56 @@ class NodeIterator final : public nsStubMutationObserver, public nsTraversal { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NodeIterator(nsINode *aRoot, uint32_t aWhatToShow, NodeFilter *aFilter); + NodeIterator(nsINode* aRoot, uint32_t aWhatToShow, NodeFilter* aFilter); NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED NS_DECL_CYCLE_COLLECTION_CLASS(NodeIterator) // WebIDL API - nsINode *Root() const { return mRoot; } - nsINode *GetReferenceNode() const { return mPointer.mNode; } + nsINode* Root() const { return mRoot; } + nsINode* GetReferenceNode() const { return mPointer.mNode; } bool PointerBeforeReferenceNode() const { return mPointer.mBeforeNode; } uint32_t WhatToShow() const { return mWhatToShow; } - NodeFilter *GetFilter() { return mFilter; } - already_AddRefed NextNode(ErrorResult &aResult) { + NodeFilter* GetFilter() { return mFilter; } + already_AddRefed NextNode(ErrorResult& aResult) { return NextOrPrevNode(&NodePointer::MoveToNext, aResult); } - already_AddRefed PreviousNode(ErrorResult &aResult) { + already_AddRefed PreviousNode(ErrorResult& aResult) { return NextOrPrevNode(&NodePointer::MoveToPrevious, aResult); } void Detach(); - bool WrapObject(JSContext *cx, JS::Handle aGivenProto, - JS::MutableHandle aReflector); + bool WrapObject(JSContext* cx, JS::Handle aGivenProto, + JS::MutableHandle aReflector); private: virtual ~NodeIterator(); struct NodePointer { NodePointer() : mNode(nullptr), mBeforeNode(false) {} - NodePointer(nsINode *aNode, bool aBeforeNode); + NodePointer(nsINode* aNode, bool aBeforeNode); - typedef bool (NodePointer::*MoveToMethodType)(nsINode *); - bool MoveToNext(nsINode *aRoot); - bool MoveToPrevious(nsINode *aRoot); + typedef bool (NodePointer::*MoveToMethodType)(nsINode*); + bool MoveToNext(nsINode* aRoot); + bool MoveToPrevious(nsINode* aRoot); - bool MoveForward(nsINode *aRoot, nsINode *aNode); - void MoveBackward(nsINode *aParent, nsINode *aNode); + bool MoveForward(nsINode* aRoot, nsINode* aNode); + void MoveBackward(nsINode* aParent, nsINode* aNode); - void AdjustAfterRemoval(nsINode *aRoot, nsINode *aContainer, - nsIContent *aChild, nsIContent *aPreviousSibling); + void AdjustAfterRemoval(nsINode* aRoot, nsINode* aContainer, + nsIContent* aChild, nsIContent* aPreviousSibling); void Clear() { mNode = nullptr; } - nsINode *mNode; + nsINode* mNode; bool mBeforeNode; }; // Have to return a strong ref, because the act of testing the node can // remove it from the DOM so we're holding the only ref to it. already_AddRefed NextOrPrevNode(NodePointer::MoveToMethodType aMove, - ErrorResult &aResult); + ErrorResult& aResult); NodePointer mPointer; NodePointer mWorkingPointer; diff --git a/dom/base/NodeUbiReporting.h b/dom/base/NodeUbiReporting.h index 0bbadf8461917..9c64754a2e7ba 100644 --- a/dom/base/NodeUbiReporting.h +++ b/dom/base/NodeUbiReporting.h @@ -25,59 +25,59 @@ namespace ubi { template <> class Concrete : public Base { protected: - explicit Concrete(nsINode *ptr) : Base(ptr) {} + explicit Concrete(nsINode* ptr) : Base(ptr) {} public: - static void construct(void *storage, nsINode *ptr); + static void construct(void* storage, nsINode* ptr); Size size(mozilla::MallocSizeOf mallocSizeOf) const override; - js::UniquePtr edges(JSContext *cx, bool wantNames) const override; + js::UniquePtr edges(JSContext* cx, bool wantNames) const override; - nsINode &get() const { return *static_cast(ptr); } + nsINode& get() const { return *static_cast(ptr); } CoarseType coarseType() const final { return CoarseType::DOMNode; } - const char16_t *descriptiveTypeName() const override; + const char16_t* descriptiveTypeName() const override; }; template <> class Concrete : public Concrete { protected: - explicit Concrete(nsIContent *ptr) : Concrete(ptr) {} + explicit Concrete(nsIContent* ptr) : Concrete(ptr) {} public: - static void construct(void *storage, nsIContent *ptr) { + static void construct(void* storage, nsIContent* ptr) { new (storage) Concrete(ptr); } - const char16_t *typeName() const override { return concreteTypeName; }; + const char16_t* typeName() const override { return concreteTypeName; }; static const char16_t concreteTypeName[]; }; template <> class Concrete : public Concrete { protected: - explicit Concrete(mozilla::dom::Document *ptr) : Concrete(ptr) {} + explicit Concrete(mozilla::dom::Document* ptr) : Concrete(ptr) {} public: - static void construct(void *storage, mozilla::dom::Document *ptr) { + static void construct(void* storage, mozilla::dom::Document* ptr) { new (storage) Concrete(ptr); } Size size(mozilla::MallocSizeOf mallocSizeOf) const override; - mozilla::dom::Document &getDoc() const { - return *static_cast(ptr); + mozilla::dom::Document& getDoc() const { + return *static_cast(ptr); } - const char16_t *typeName() const override { return concreteTypeName; }; + const char16_t* typeName() const override { return concreteTypeName; }; static const char16_t concreteTypeName[]; }; template <> class Concrete : public Concrete { protected: - explicit Concrete(mozilla::dom::Attr *ptr) : Concrete(ptr) {} + explicit Concrete(mozilla::dom::Attr* ptr) : Concrete(ptr) {} public: - static void construct(void *storage, mozilla::dom::Attr *ptr) { + static void construct(void* storage, mozilla::dom::Attr* ptr) { new (storage) Concrete(ptr); } - const char16_t *typeName() const override { return concreteTypeName; }; + const char16_t* typeName() const override { return concreteTypeName; }; static const char16_t concreteTypeName[]; }; diff --git a/dom/base/nsContentPolicy.cpp b/dom/base/nsContentPolicy.cpp index d3eaf6ab49b06..1d943d5b0efd4 100644 --- a/dom/base/nsContentPolicy.cpp +++ b/dom/base/nsContentPolicy.cpp @@ -35,7 +35,7 @@ NS_IMPL_ISUPPORTS(nsContentPolicy, nsIContentPolicy) static mozilla::LazyLogModule gConPolLog("nsContentPolicy"); -nsresult NS_NewContentPolicy(nsIContentPolicy **aResult) { +nsresult NS_NewContentPolicy(nsIContentPolicy** aResult) { *aResult = new nsContentPolicy; NS_ADDREF(*aResult); return NS_OK; @@ -64,10 +64,10 @@ nsContentPolicy::~nsContentPolicy() {} #endif // defined(DEBUG) inline nsresult nsContentPolicy::CheckPolicy(CPMethod policyMethod, - nsIURI *contentLocation, - nsILoadInfo *loadInfo, - const nsACString &mimeType, - int16_t *decision) { + nsIURI* contentLocation, + nsILoadInfo* loadInfo, + const nsACString& mimeType, + int16_t* decision) { nsContentPolicyType contentType = loadInfo->InternalContentPolicyType(); nsCOMPtr requestingContext = loadInfo->GetLoadingContext(); nsCOMPtr requestPrincipal = loadInfo->TriggeringPrincipal(); @@ -120,7 +120,7 @@ inline nsresult nsContentPolicy::CheckPolicy(CPMethod policyMethod, * their permissions. */ nsresult rv; - const nsCOMArray &entries = mPolicies.GetCachedEntries(); + const nsCOMArray& entries = mPolicies.GetCachedEntries(); nsCOMPtr window; if (nsCOMPtr node = do_QueryInterface(requestingContext)) { @@ -176,7 +176,7 @@ inline nsresult nsContentPolicy::CheckPolicy(CPMethod policyMethod, } \ /* skip all this nonsense if the call failed or logging is disabled */ \ if (NS_SUCCEEDED(rv) && MOZ_LOG_TEST(gConPolLog, LogLevel::Debug)) { \ - const char *resultName; \ + const char* resultName; \ if (decision) { \ resultName = NS_CP_ResponseName(*decision); \ } else { \ @@ -193,8 +193,8 @@ inline nsresult nsContentPolicy::CheckPolicy(CPMethod policyMethod, PR_END_MACRO NS_IMETHODIMP -nsContentPolicy::ShouldLoad(nsIURI *contentLocation, nsILoadInfo *loadInfo, - const nsACString &mimeType, int16_t *decision) { +nsContentPolicy::ShouldLoad(nsIURI* contentLocation, nsILoadInfo* loadInfo, + const nsACString& mimeType, int16_t* decision) { // ShouldProcess does not need a content location, but we do MOZ_ASSERT(contentLocation, "Must provide request location"); nsresult rv = CheckPolicy(&nsIContentPolicy::ShouldLoad, contentLocation, @@ -205,8 +205,8 @@ nsContentPolicy::ShouldLoad(nsIURI *contentLocation, nsILoadInfo *loadInfo, } NS_IMETHODIMP -nsContentPolicy::ShouldProcess(nsIURI *contentLocation, nsILoadInfo *loadInfo, - const nsACString &mimeType, int16_t *decision) { +nsContentPolicy::ShouldProcess(nsIURI* contentLocation, nsILoadInfo* loadInfo, + const nsACString& mimeType, int16_t* decision) { nsresult rv = CheckPolicy(&nsIContentPolicy::ShouldProcess, contentLocation, loadInfo, mimeType, decision); LOG_CHECK("ShouldProcess"); diff --git a/dom/base/nsContentPolicy.h b/dom/base/nsContentPolicy.h index cba12b45cced0..9b41e30e6be13 100644 --- a/dom/base/nsContentPolicy.h +++ b/dom/base/nsContentPolicy.h @@ -33,11 +33,11 @@ class nsContentPolicy : public nsIContentPolicy { // Helper method that applies policyMethod across all policies in mPolicies // with the given parameters - nsresult CheckPolicy(CPMethod policyMethod, nsIURI *aURI, - nsILoadInfo *aLoadInfo, const nsACString &mimeGuess, - int16_t *decision); + nsresult CheckPolicy(CPMethod policyMethod, nsIURI* aURI, + nsILoadInfo* aLoadInfo, const nsACString& mimeGuess, + int16_t* decision); }; -nsresult NS_NewContentPolicy(nsIContentPolicy **aResult); +nsresult NS_NewContentPolicy(nsIContentPolicy** aResult); #endif /* __nsContentPolicy_h__ */ diff --git a/dom/base/nsContentPolicyUtils.h b/dom/base/nsContentPolicyUtils.h index 9b67464a082a3..9af71cb85b3f5 100644 --- a/dom/base/nsContentPolicyUtils.h +++ b/dom/base/nsContentPolicyUtils.h @@ -68,7 +68,7 @@ * @param response the response code * @return the name of the given response code */ -inline const char *NS_CP_ResponseName(int16_t response) { +inline const char* NS_CP_ResponseName(int16_t response) { switch (response) { CASE_RETURN(REJECT_REQUEST); CASE_RETURN(REJECT_TYPE); @@ -89,7 +89,7 @@ inline const char *NS_CP_ResponseName(int16_t response) { * @param contentType the content type code * @return the name of the given content type code */ -inline const char *NS_CP_ContentTypeName(uint32_t contentType) { +inline const char* NS_CP_ContentTypeName(uint32_t contentType) { switch (contentType) { CASE_RETURN(TYPE_OTHER); CASE_RETURN(TYPE_SCRIPT); @@ -183,7 +183,7 @@ inline const char *NS_CP_ContentTypeName(uint32_t contentType) { n = win ? win->GetExtantDoc() : nullptr; \ } \ if (n) { \ - mozilla::dom::Document *d = n->OwnerDoc(); \ + mozilla::dom::Document* d = n->OwnerDoc(); \ if (d->IsLoadedAsData() || d->IsBeingUsedAsImage() || \ d->IsResourceDoc()) { \ nsCOMPtr dataPolicy = \ @@ -211,9 +211,9 @@ inline const char *NS_CP_ContentTypeName(uint32_t contentType) { * origin URI will be passed). */ inline nsresult NS_CheckContentLoadPolicy( - nsIURI *contentLocation, nsILoadInfo *loadInfo, const nsACString &mimeType, - int16_t *decision, nsIContentPolicy *policyService = nullptr) { - nsIPrincipal *loadingPrincipal = loadInfo->LoadingPrincipal(); + nsIURI* contentLocation, nsILoadInfo* loadInfo, const nsACString& mimeType, + int16_t* decision, nsIContentPolicy* policyService = nullptr) { + nsIPrincipal* loadingPrincipal = loadInfo->LoadingPrincipal(); nsCOMPtr context = loadInfo->GetLoadingContext(); nsContentPolicyType contentType = loadInfo->InternalContentPolicyType(); CHECK_PRINCIPAL_AND_DATA(ShouldLoad); @@ -227,9 +227,9 @@ inline nsresult NS_CheckContentLoadPolicy( * Alias for calling ShouldProcess on the content policy service. */ inline nsresult NS_CheckContentProcessPolicy( - nsIURI *contentLocation, nsILoadInfo *loadInfo, const nsACString &mimeType, - int16_t *decision, nsIContentPolicy *policyService = nullptr) { - nsIPrincipal *loadingPrincipal = loadInfo->LoadingPrincipal(); + nsIURI* contentLocation, nsILoadInfo* loadInfo, const nsACString& mimeType, + int16_t* decision, nsIContentPolicy* policyService = nullptr) { + nsIPrincipal* loadingPrincipal = loadInfo->LoadingPrincipal(); nsCOMPtr context = loadInfo->GetLoadingContext(); nsContentPolicyType contentType = loadInfo->InternalContentPolicyType(); CHECK_PRINCIPAL_AND_DATA(ShouldProcess); @@ -265,7 +265,7 @@ inline nsresult NS_CheckContentProcessPolicy( * happening in. These are somewhat odd semantics, and bug 466687 has been * filed to consider improving them. */ -inline nsIDocShell *NS_CP_GetDocShellFromContext(nsISupports *aContext) { +inline nsIDocShell* NS_CP_GetDocShellFromContext(nsISupports* aContext) { if (!aContext) { return nullptr; } diff --git a/dom/base/nsDOMJSUtils.h b/dom/base/nsDOMJSUtils.h index 10ff19bf31fc5..f73faefde1540 100644 --- a/dom/base/nsDOMJSUtils.h +++ b/dom/base/nsDOMJSUtils.h @@ -19,7 +19,7 @@ class nsIJSArgArray; // Optionally, aArgv may be nullptr, in which case the array is allocated and // rooted, but all items remain nullptr. This presumably means the caller // will then QI us for nsIJSArgArray, and set our array elements. -nsresult NS_CreateJSArgv(JSContext *aContext, uint32_t aArgc, - const JS::Value *aArgv, nsIJSArgArray **aArray); +nsresult NS_CreateJSArgv(JSContext* aContext, uint32_t aArgc, + const JS::Value* aArgv, nsIJSArgArray** aArray); #endif // nsDOMJSUtils_h__ diff --git a/dom/base/nsDataDocumentContentPolicy.cpp b/dom/base/nsDataDocumentContentPolicy.cpp index c5003ab7c2ad1..22522649e0bb3 100644 --- a/dom/base/nsDataDocumentContentPolicy.cpp +++ b/dom/base/nsDataDocumentContentPolicy.cpp @@ -26,7 +26,7 @@ NS_IMPL_ISUPPORTS(nsDataDocumentContentPolicy, nsIContentPolicy) // Helper method for ShouldLoad() // Checks a URI for the given flags. Returns true if the URI has the flags, // and false if not (or if we weren't able to tell). -static bool HasFlags(nsIURI *aURI, uint32_t aURIFlags) { +static bool HasFlags(nsIURI* aURI, uint32_t aURIFlags) { bool hasFlags; nsresult rv = NS_URIChainHasFlags(aURI, aURIFlags, &hasFlags); return NS_SUCCEEDED(rv) && hasFlags; @@ -36,10 +36,10 @@ static bool HasFlags(nsIURI *aURI, uint32_t aURIFlags) { // CHECK_PRINCIPAL_AND_DATA in nsContentPolicyUtils is still valid. // nsContentPolicyUtils may not pass all the parameters to ShouldLoad. NS_IMETHODIMP -nsDataDocumentContentPolicy::ShouldLoad(nsIURI *aContentLocation, - nsILoadInfo *aLoadInfo, - const nsACString &aMimeGuess, - int16_t *aDecision) { +nsDataDocumentContentPolicy::ShouldLoad(nsIURI* aContentLocation, + nsILoadInfo* aLoadInfo, + const nsACString& aMimeGuess, + int16_t* aDecision) { auto setBlockingReason = MakeScopeExit([&]() { if (NS_CP_REJECTED(*aDecision)) { NS_SetRequestBlockingReason( @@ -82,7 +82,7 @@ nsDataDocumentContentPolicy::ShouldLoad(nsIURI *aContentLocation, } } - mozilla::dom::Document *docToCheckForImage = doc->GetDisplayDocument(); + mozilla::dom::Document* docToCheckForImage = doc->GetDisplayDocument(); if (!docToCheckForImage) { docToCheckForImage = doc; } @@ -104,7 +104,7 @@ nsDataDocumentContentPolicy::ShouldLoad(nsIURI *aContentLocation, // Report error, if we can. if (node) { - nsIPrincipal *requestingPrincipal = node->NodePrincipal(); + nsIPrincipal* requestingPrincipal = node->NodePrincipal(); RefPtr principalURI; nsresult rv = requestingPrincipal->GetURI(getter_AddRefs(principalURI)); if (NS_SUCCEEDED(rv) && principalURI) { @@ -153,9 +153,9 @@ nsDataDocumentContentPolicy::ShouldLoad(nsIURI *aContentLocation, } NS_IMETHODIMP -nsDataDocumentContentPolicy::ShouldProcess(nsIURI *aContentLocation, - nsILoadInfo *aLoadInfo, - const nsACString &aMimeGuess, - int16_t *aDecision) { +nsDataDocumentContentPolicy::ShouldProcess(nsIURI* aContentLocation, + nsILoadInfo* aLoadInfo, + const nsACString& aMimeGuess, + int16_t* aDecision) { return ShouldLoad(aContentLocation, aLoadInfo, aMimeGuess, aDecision); } diff --git a/dom/base/nsGlobalWindowCommands.cpp b/dom/base/nsGlobalWindowCommands.cpp index 65eab318e3e0f..4fa14da6231cc 100644 --- a/dom/base/nsGlobalWindowCommands.cpp +++ b/dom/base/nsGlobalWindowCommands.cpp @@ -40,72 +40,72 @@ using namespace mozilla; using namespace mozilla::layers; -constexpr const char *sSelectAllString = "cmd_selectAll"; -constexpr const char *sSelectNoneString = "cmd_selectNone"; -constexpr const char *sCopyImageLocationString = "cmd_copyImageLocation"; -constexpr const char *sCopyImageContentsString = "cmd_copyImageContents"; -constexpr const char *sCopyImageString = "cmd_copyImage"; - -constexpr const char *sScrollTopString = "cmd_scrollTop"; -constexpr const char *sScrollBottomString = "cmd_scrollBottom"; -constexpr const char *sScrollPageUpString = "cmd_scrollPageUp"; -constexpr const char *sScrollPageDownString = "cmd_scrollPageDown"; -constexpr const char *sScrollLineUpString = "cmd_scrollLineUp"; -constexpr const char *sScrollLineDownString = "cmd_scrollLineDown"; -constexpr const char *sScrollLeftString = "cmd_scrollLeft"; -constexpr const char *sScrollRightString = "cmd_scrollRight"; -constexpr const char *sMoveTopString = "cmd_moveTop"; -constexpr const char *sMoveBottomString = "cmd_moveBottom"; -constexpr const char *sMovePageUpString = "cmd_movePageUp"; -constexpr const char *sMovePageDownString = "cmd_movePageDown"; -constexpr const char *sLinePreviousString = "cmd_linePrevious"; -constexpr const char *sLineNextString = "cmd_lineNext"; -constexpr const char *sCharPreviousString = "cmd_charPrevious"; -constexpr const char *sCharNextString = "cmd_charNext"; +constexpr const char* sSelectAllString = "cmd_selectAll"; +constexpr const char* sSelectNoneString = "cmd_selectNone"; +constexpr const char* sCopyImageLocationString = "cmd_copyImageLocation"; +constexpr const char* sCopyImageContentsString = "cmd_copyImageContents"; +constexpr const char* sCopyImageString = "cmd_copyImage"; + +constexpr const char* sScrollTopString = "cmd_scrollTop"; +constexpr const char* sScrollBottomString = "cmd_scrollBottom"; +constexpr const char* sScrollPageUpString = "cmd_scrollPageUp"; +constexpr const char* sScrollPageDownString = "cmd_scrollPageDown"; +constexpr const char* sScrollLineUpString = "cmd_scrollLineUp"; +constexpr const char* sScrollLineDownString = "cmd_scrollLineDown"; +constexpr const char* sScrollLeftString = "cmd_scrollLeft"; +constexpr const char* sScrollRightString = "cmd_scrollRight"; +constexpr const char* sMoveTopString = "cmd_moveTop"; +constexpr const char* sMoveBottomString = "cmd_moveBottom"; +constexpr const char* sMovePageUpString = "cmd_movePageUp"; +constexpr const char* sMovePageDownString = "cmd_movePageDown"; +constexpr const char* sLinePreviousString = "cmd_linePrevious"; +constexpr const char* sLineNextString = "cmd_lineNext"; +constexpr const char* sCharPreviousString = "cmd_charPrevious"; +constexpr const char* sCharNextString = "cmd_charNext"; // These are so the browser can use editor navigation key bindings // helps with accessibility (boolean pref accessibility.browsewithcaret) -constexpr const char *sSelectCharPreviousString = "cmd_selectCharPrevious"; -constexpr const char *sSelectCharNextString = "cmd_selectCharNext"; +constexpr const char* sSelectCharPreviousString = "cmd_selectCharPrevious"; +constexpr const char* sSelectCharNextString = "cmd_selectCharNext"; -constexpr const char *sWordPreviousString = "cmd_wordPrevious"; -constexpr const char *sWordNextString = "cmd_wordNext"; -constexpr const char *sSelectWordPreviousString = "cmd_selectWordPrevious"; -constexpr const char *sSelectWordNextString = "cmd_selectWordNext"; +constexpr const char* sWordPreviousString = "cmd_wordPrevious"; +constexpr const char* sWordNextString = "cmd_wordNext"; +constexpr const char* sSelectWordPreviousString = "cmd_selectWordPrevious"; +constexpr const char* sSelectWordNextString = "cmd_selectWordNext"; -constexpr const char *sBeginLineString = "cmd_beginLine"; -constexpr const char *sEndLineString = "cmd_endLine"; -constexpr const char *sSelectBeginLineString = "cmd_selectBeginLine"; -constexpr const char *sSelectEndLineString = "cmd_selectEndLine"; +constexpr const char* sBeginLineString = "cmd_beginLine"; +constexpr const char* sEndLineString = "cmd_endLine"; +constexpr const char* sSelectBeginLineString = "cmd_selectBeginLine"; +constexpr const char* sSelectEndLineString = "cmd_selectEndLine"; -constexpr const char *sSelectLinePreviousString = "cmd_selectLinePrevious"; -constexpr const char *sSelectLineNextString = "cmd_selectLineNext"; +constexpr const char* sSelectLinePreviousString = "cmd_selectLinePrevious"; +constexpr const char* sSelectLineNextString = "cmd_selectLineNext"; -constexpr const char *sSelectPageUpString = "cmd_selectPageUp"; -constexpr const char *sSelectPageDownString = "cmd_selectPageDown"; +constexpr const char* sSelectPageUpString = "cmd_selectPageUp"; +constexpr const char* sSelectPageDownString = "cmd_selectPageDown"; -constexpr const char *sSelectTopString = "cmd_selectTop"; -constexpr const char *sSelectBottomString = "cmd_selectBottom"; +constexpr const char* sSelectTopString = "cmd_selectTop"; +constexpr const char* sSelectBottomString = "cmd_selectBottom"; // Physical-direction movement and selection commands -constexpr const char *sMoveLeftString = "cmd_moveLeft"; -constexpr const char *sMoveRightString = "cmd_moveRight"; -constexpr const char *sMoveUpString = "cmd_moveUp"; -constexpr const char *sMoveDownString = "cmd_moveDown"; -constexpr const char *sMoveLeft2String = "cmd_moveLeft2"; -constexpr const char *sMoveRight2String = "cmd_moveRight2"; -constexpr const char *sMoveUp2String = "cmd_moveUp2"; -constexpr const char *sMoveDown2String = "cmd_moveDown2"; - -constexpr const char *sSelectLeftString = "cmd_selectLeft"; -constexpr const char *sSelectRightString = "cmd_selectRight"; -constexpr const char *sSelectUpString = "cmd_selectUp"; -constexpr const char *sSelectDownString = "cmd_selectDown"; -constexpr const char *sSelectLeft2String = "cmd_selectLeft2"; -constexpr const char *sSelectRight2String = "cmd_selectRight2"; -constexpr const char *sSelectUp2String = "cmd_selectUp2"; -constexpr const char *sSelectDown2String = "cmd_selectDown2"; +constexpr const char* sMoveLeftString = "cmd_moveLeft"; +constexpr const char* sMoveRightString = "cmd_moveRight"; +constexpr const char* sMoveUpString = "cmd_moveUp"; +constexpr const char* sMoveDownString = "cmd_moveDown"; +constexpr const char* sMoveLeft2String = "cmd_moveLeft2"; +constexpr const char* sMoveRight2String = "cmd_moveRight2"; +constexpr const char* sMoveUp2String = "cmd_moveUp2"; +constexpr const char* sMoveDown2String = "cmd_moveDown2"; + +constexpr const char* sSelectLeftString = "cmd_selectLeft"; +constexpr const char* sSelectRightString = "cmd_selectRight"; +constexpr const char* sSelectUpString = "cmd_selectUp"; +constexpr const char* sSelectDownString = "cmd_selectDown"; +constexpr const char* sSelectLeft2String = "cmd_selectLeft2"; +constexpr const char* sSelectRight2String = "cmd_selectRight2"; +constexpr const char* sSelectUp2String = "cmd_selectUp2"; +constexpr const char* sSelectDown2String = "cmd_selectDown2"; #if 0 # pragma mark - @@ -115,24 +115,24 @@ constexpr const char *sSelectDown2String = "cmd_selectDown2"; class nsSelectionCommandsBase : public nsIControllerCommand { public: NS_DECL_ISUPPORTS - NS_IMETHOD IsCommandEnabled(const char *aCommandName, - nsISupports *aCommandContext, - bool *_retval) override; - NS_IMETHOD GetCommandStateParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) override; + NS_IMETHOD IsCommandEnabled(const char* aCommandName, + nsISupports* aCommandContext, + bool* _retval) override; + NS_IMETHOD GetCommandStateParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) override; MOZ_CAN_RUN_SCRIPT - NS_IMETHOD DoCommandParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) override; + NS_IMETHOD DoCommandParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) override; protected: virtual ~nsSelectionCommandsBase() {} - static nsresult GetPresShellFromWindow(nsPIDOMWindowOuter *aWindow, - PresShell **aPresShell); + static nsresult GetPresShellFromWindow(nsPIDOMWindowOuter* aWindow, + PresShell** aPresShell); static nsresult GetSelectionControllerFromWindow( - nsPIDOMWindowOuter *aWindow, nsISelectionController **aSelCon); + nsPIDOMWindowOuter* aWindow, nsISelectionController** aSelCon); // no member variables, please, we're stateless! }; @@ -141,8 +141,8 @@ class nsSelectionCommandsBase : public nsIControllerCommand { // caret' setting class nsSelectMoveScrollCommand : public nsSelectionCommandsBase { public: - NS_IMETHOD DoCommand(const char *aCommandName, - nsISupports *aCommandContext) override; + NS_IMETHOD DoCommand(const char* aCommandName, + nsISupports* aCommandContext) override; // no member variables, please, we're stateless! }; @@ -150,8 +150,8 @@ class nsSelectMoveScrollCommand : public nsSelectionCommandsBase { // this class implements physical-movement versions of the above class nsPhysicalSelectMoveScrollCommand : public nsSelectionCommandsBase { public: - NS_IMETHOD DoCommand(const char *aCommandName, - nsISupports *aCommandContext) override; + NS_IMETHOD DoCommand(const char* aCommandName, + nsISupports* aCommandContext) override; // no member variables, please, we're stateless! }; @@ -159,8 +159,8 @@ class nsPhysicalSelectMoveScrollCommand : public nsSelectionCommandsBase { // this class implements other selection commands class nsSelectCommand : public nsSelectionCommandsBase { public: - NS_IMETHOD DoCommand(const char *aCommandName, - nsISupports *aCommandContext) override; + NS_IMETHOD DoCommand(const char* aCommandName, + nsISupports* aCommandContext) override; // no member variables, please, we're stateless! }; @@ -168,8 +168,8 @@ class nsSelectCommand : public nsSelectionCommandsBase { // this class implements physical-movement versions of selection commands class nsPhysicalSelectCommand : public nsSelectionCommandsBase { public: - NS_IMETHOD DoCommand(const char *aCommandName, - nsISupports *aCommandContext) override; + NS_IMETHOD DoCommand(const char* aCommandName, + nsISupports* aCommandContext) override; // no member variables, please, we're stateless! }; @@ -181,9 +181,9 @@ class nsPhysicalSelectCommand : public nsSelectionCommandsBase { NS_IMPL_ISUPPORTS(nsSelectionCommandsBase, nsIControllerCommand) NS_IMETHODIMP -nsSelectionCommandsBase::IsCommandEnabled(const char *aCommandName, - nsISupports *aCommandContext, - bool *outCmdEnabled) { +nsSelectionCommandsBase::IsCommandEnabled(const char* aCommandName, + nsISupports* aCommandContext, + bool* outCmdEnabled) { // XXX this needs fixing. e.g. you can't scroll up if you're already at the // top of the document. *outCmdEnabled = true; @@ -191,28 +191,28 @@ nsSelectionCommandsBase::IsCommandEnabled(const char *aCommandName, } NS_IMETHODIMP -nsSelectionCommandsBase::GetCommandStateParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) { +nsSelectionCommandsBase::GetCommandStateParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) { // XXX we should probably return the enabled state return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsSelectionCommandsBase::DoCommandParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) { +nsSelectionCommandsBase::DoCommandParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) { return DoCommand(aCommandName, aCommandContext); } // protected methods nsresult nsSelectionCommandsBase::GetPresShellFromWindow( - nsPIDOMWindowOuter *aWindow, PresShell **aPresShell) { + nsPIDOMWindowOuter* aWindow, PresShell** aPresShell) { *aPresShell = nullptr; NS_ENSURE_TRUE(aWindow, NS_ERROR_FAILURE); - nsIDocShell *docShell = aWindow->GetDocShell(); + nsIDocShell* docShell = aWindow->GetDocShell(); NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE); NS_IF_ADDREF(*aPresShell = docShell->GetPresShell()); @@ -220,7 +220,7 @@ nsresult nsSelectionCommandsBase::GetPresShellFromWindow( } nsresult nsSelectionCommandsBase::GetSelectionControllerFromWindow( - nsPIDOMWindowOuter *aWindow, nsISelectionController **aSelCon) { + nsPIDOMWindowOuter* aWindow, nsISelectionController** aSelCon) { RefPtr presShell; GetPresShellFromWindow(aWindow, getter_AddRefs(presShell)); if (!presShell) { @@ -236,9 +236,9 @@ nsresult nsSelectionCommandsBase::GetSelectionControllerFromWindow( #endif // Helpers for nsSelectMoveScrollCommand and nsPhysicalSelectMoveScrollCommand -static void AdjustFocusAfterCaretMove(nsPIDOMWindowOuter *aWindow) { +static void AdjustFocusAfterCaretMove(nsPIDOMWindowOuter* aWindow) { // adjust the focus to the new caret position - nsIFocusManager *fm = nsFocusManager::GetFocusManager(); + nsIFocusManager* fm = nsFocusManager::GetFocusManager(); if (fm) { RefPtr result; fm->MoveFocus(aWindow, nullptr, nsIFocusManager::MOVEFOCUS_CARET, @@ -246,8 +246,8 @@ static void AdjustFocusAfterCaretMove(nsPIDOMWindowOuter *aWindow) { } } -static bool IsCaretOnInWindow(nsPIDOMWindowOuter *aWindow, - nsISelectionController *aSelCont) { +static bool IsCaretOnInWindow(nsPIDOMWindowOuter* aWindow, + nsISelectionController* aSelCont) { // We allow the caret to be moved with arrow keys on any window for which // the caret is enabled. In particular, this includes caret-browsing mode // in non-chrome documents. @@ -300,8 +300,8 @@ static constexpr struct BrowseCommand { &nsISelectionController::CompleteScroll, &nsISelectionController::IntraLineMove}}; -nsresult nsSelectMoveScrollCommand::DoCommand(const char *aCommandName, - nsISupports *aCommandContext) { +nsresult nsSelectMoveScrollCommand::DoCommand(const char* aCommandName, + nsISupports* aCommandContext) { nsCOMPtr piWindow(do_QueryInterface(aCommandContext)); nsCOMPtr selCont; GetSelectionControllerFromWindow(piWindow, getter_AddRefs(selCont)); @@ -329,7 +329,7 @@ nsresult nsSelectMoveScrollCommand::DoCommand(const char *aCommandName, // ScrollLine, etc., as if for horizontal-mode content, but this may need // to be reconsidered once we have more experience with vertical content. static const struct PhysicalBrowseCommand { - const char *command; + const char* command; int16_t direction, amount; KeyboardScrollAction::KeyboardScrollActionType scrollAction; nsresult (NS_STDCALL nsISelectionController::*scroll)(bool); @@ -359,7 +359,7 @@ static const struct PhysicalBrowseCommand { }; nsresult nsPhysicalSelectMoveScrollCommand::DoCommand( - const char *aCommandName, nsISupports *aCommandContext) { + const char* aCommandName, nsISupports* aCommandContext) { nsCOMPtr piWindow(do_QueryInterface(aCommandContext)); nsCOMPtr selCont; GetSelectionControllerFromWindow(piWindow, getter_AddRefs(selCont)); @@ -368,7 +368,7 @@ nsresult nsPhysicalSelectMoveScrollCommand::DoCommand( bool caretOn = IsCaretOnInWindow(piWindow, selCont); for (size_t i = 0; i < ArrayLength(physicalBrowseCommands); i++) { - const PhysicalBrowseCommand &cmd = physicalBrowseCommands[i]; + const PhysicalBrowseCommand& cmd = physicalBrowseCommands[i]; if (!strcmp(aCommandName, cmd.command)) { int16_t dir = cmd.direction; if (caretOn && @@ -406,8 +406,8 @@ static const struct SelectCommand { {sSelectTopString, sSelectBottomString, &nsISelectionController::CompleteMove}}; -nsresult nsSelectCommand::DoCommand(const char *aCommandName, - nsISupports *aCommandContext) { +nsresult nsSelectCommand::DoCommand(const char* aCommandName, + nsISupports* aCommandContext) { nsCOMPtr piWindow(do_QueryInterface(aCommandContext)); nsCOMPtr selCont; GetSelectionControllerFromWindow(piWindow, getter_AddRefs(selCont)); @@ -429,7 +429,7 @@ nsresult nsSelectCommand::DoCommand(const char *aCommandName, #endif static const struct PhysicalSelectCommand { - const char *command; + const char* command; int16_t direction, amount; } physicalSelectCommands[] = { {sSelectLeftString, nsISelectionController::MOVE_LEFT, 0}, @@ -441,8 +441,8 @@ static const struct PhysicalSelectCommand { {sSelectUp2String, nsISelectionController::MOVE_UP, 1}, {sSelectDown2String, nsISelectionController::MOVE_DOWN, 1}}; -nsresult nsPhysicalSelectCommand::DoCommand(const char *aCommandName, - nsISupports *aCommandContext) { +nsresult nsPhysicalSelectCommand::DoCommand(const char* aCommandName, + nsISupports* aCommandContext) { nsCOMPtr piWindow(do_QueryInterface(aCommandContext)); nsCOMPtr selCont; GetSelectionControllerFromWindow(piWindow, getter_AddRefs(selCont)); @@ -472,9 +472,9 @@ class nsClipboardCommand final : public nsIControllerCommand { NS_IMPL_ISUPPORTS(nsClipboardCommand, nsIControllerCommand) -nsresult nsClipboardCommand::IsCommandEnabled(const char *aCommandName, - nsISupports *aContext, - bool *outCmdEnabled) { +nsresult nsClipboardCommand::IsCommandEnabled(const char* aCommandName, + nsISupports* aContext, + bool* outCmdEnabled) { NS_ENSURE_ARG_POINTER(outCmdEnabled); *outCmdEnabled = false; @@ -501,8 +501,8 @@ nsresult nsClipboardCommand::IsCommandEnabled(const char *aCommandName, return NS_OK; } -nsresult nsClipboardCommand::DoCommand(const char *aCommandName, - nsISupports *aContext) { +nsresult nsClipboardCommand::DoCommand(const char* aCommandName, + nsISupports* aContext) { if (strcmp(aCommandName, "cmd_cut") && strcmp(aCommandName, "cmd_copy") && strcmp(aCommandName, "cmd_paste")) return NS_OK; @@ -510,7 +510,7 @@ nsresult nsClipboardCommand::DoCommand(const char *aCommandName, nsCOMPtr window = do_QueryInterface(aContext); NS_ENSURE_TRUE(window, NS_ERROR_FAILURE); - nsIDocShell *docShell = window->GetDocShell(); + nsIDocShell* docShell = window->GetDocShell(); NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE); RefPtr presShell = docShell->GetPresShell(); @@ -532,15 +532,15 @@ nsresult nsClipboardCommand::DoCommand(const char *aCommandName, } NS_IMETHODIMP -nsClipboardCommand::GetCommandStateParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) { +nsClipboardCommand::GetCommandStateParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) { return NS_ERROR_NOT_IMPLEMENTED; } -nsresult nsClipboardCommand::DoCommandParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aContext) { +nsresult nsClipboardCommand::DoCommandParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aContext) { return DoCommand(aCommandName, aContext); } @@ -556,15 +556,15 @@ class nsSelectionCommand : public nsIControllerCommand { protected: virtual ~nsSelectionCommand() {} - virtual nsresult IsClipboardCommandEnabled(const char *aCommandName, - nsIContentViewerEdit *aEdit, - bool *outCmdEnabled) = 0; - virtual nsresult DoClipboardCommand(const char *aCommandName, - nsIContentViewerEdit *aEdit, - nsICommandParams *aParams) = 0; + virtual nsresult IsClipboardCommandEnabled(const char* aCommandName, + nsIContentViewerEdit* aEdit, + bool* outCmdEnabled) = 0; + virtual nsresult DoClipboardCommand(const char* aCommandName, + nsIContentViewerEdit* aEdit, + nsICommandParams* aParams) = 0; static nsresult GetContentViewerEditFromContext( - nsISupports *aContext, nsIContentViewerEdit **aEditInterface); + nsISupports* aContext, nsIContentViewerEdit** aEditInterface); // no member variables, please, we're stateless! }; @@ -578,9 +578,9 @@ NS_IMPL_ISUPPORTS(nsSelectionCommand, nsIControllerCommand) ----------------------------------------------------------------------------*/ NS_IMETHODIMP -nsSelectionCommand::IsCommandEnabled(const char *aCommandName, - nsISupports *aCommandContext, - bool *outCmdEnabled) { +nsSelectionCommand::IsCommandEnabled(const char* aCommandName, + nsISupports* aCommandContext, + bool* outCmdEnabled) { NS_ENSURE_ARG_POINTER(outCmdEnabled); *outCmdEnabled = false; @@ -592,8 +592,8 @@ nsSelectionCommand::IsCommandEnabled(const char *aCommandName, } NS_IMETHODIMP -nsSelectionCommand::DoCommand(const char *aCommandName, - nsISupports *aCommandContext) { +nsSelectionCommand::DoCommand(const char* aCommandName, + nsISupports* aCommandContext) { nsCOMPtr contentEdit; GetContentViewerEditFromContext(aCommandContext, getter_AddRefs(contentEdit)); NS_ENSURE_TRUE(contentEdit, NS_ERROR_NOT_INITIALIZED); @@ -602,16 +602,16 @@ nsSelectionCommand::DoCommand(const char *aCommandName, } NS_IMETHODIMP -nsSelectionCommand::GetCommandStateParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) { +nsSelectionCommand::GetCommandStateParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsSelectionCommand::DoCommandParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) { +nsSelectionCommand::DoCommandParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) { nsCOMPtr contentEdit; GetContentViewerEditFromContext(aCommandContext, getter_AddRefs(contentEdit)); NS_ENSURE_TRUE(contentEdit, NS_ERROR_NOT_INITIALIZED); @@ -620,14 +620,14 @@ nsSelectionCommand::DoCommandParams(const char *aCommandName, } nsresult nsSelectionCommand::GetContentViewerEditFromContext( - nsISupports *aContext, nsIContentViewerEdit **aEditInterface) { + nsISupports* aContext, nsIContentViewerEdit** aEditInterface) { NS_ENSURE_ARG(aEditInterface); *aEditInterface = nullptr; nsCOMPtr window = do_QueryInterface(aContext); NS_ENSURE_TRUE(window, NS_ERROR_INVALID_ARG); - nsIDocShell *docShell = window->GetDocShell(); + nsIDocShell* docShell = window->GetDocShell(); NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE); nsCOMPtr viewer; @@ -646,12 +646,12 @@ nsresult nsSelectionCommand::GetContentViewerEditFromContext( #define NS_DECL_CLIPBOARD_COMMAND(_cmd) \ class _cmd : public nsSelectionCommand { \ protected: \ - virtual nsresult IsClipboardCommandEnabled(const char *aCommandName, \ - nsIContentViewerEdit *aEdit, \ - bool *outCmdEnabled) override; \ - virtual nsresult DoClipboardCommand(const char *aCommandName, \ - nsIContentViewerEdit *aEdit, \ - nsICommandParams *aParams) override; \ + virtual nsresult IsClipboardCommandEnabled(const char* aCommandName, \ + nsIContentViewerEdit* aEdit, \ + bool* outCmdEnabled) override; \ + virtual nsresult DoClipboardCommand(const char* aCommandName, \ + nsIContentViewerEdit* aEdit, \ + nsICommandParams* aParams) override; \ /* no member variables, please, we're stateless! */ \ }; @@ -661,14 +661,14 @@ NS_DECL_CLIPBOARD_COMMAND(nsClipboardSelectAllNoneCommands) NS_DECL_CLIPBOARD_COMMAND(nsClipboardGetContentsCommand) nsresult nsClipboardCopyLinkCommand::IsClipboardCommandEnabled( - const char *aCommandName, nsIContentViewerEdit *aEdit, - bool *outCmdEnabled) { + const char* aCommandName, nsIContentViewerEdit* aEdit, + bool* outCmdEnabled) { return aEdit->GetInLink(outCmdEnabled); } nsresult nsClipboardCopyLinkCommand::DoClipboardCommand( - const char *aCommandName, nsIContentViewerEdit *aEdit, - nsICommandParams *aParams) { + const char* aCommandName, nsIContentViewerEdit* aEdit, + nsICommandParams* aParams) { return aEdit->CopyLinkLocation(); } @@ -677,14 +677,14 @@ nsresult nsClipboardCopyLinkCommand::DoClipboardCommand( #endif nsresult nsClipboardImageCommands::IsClipboardCommandEnabled( - const char *aCommandName, nsIContentViewerEdit *aEdit, - bool *outCmdEnabled) { + const char* aCommandName, nsIContentViewerEdit* aEdit, + bool* outCmdEnabled) { return aEdit->GetInImage(outCmdEnabled); } nsresult nsClipboardImageCommands::DoClipboardCommand( - const char *aCommandName, nsIContentViewerEdit *aEdit, - nsICommandParams *aParams) { + const char* aCommandName, nsIContentViewerEdit* aEdit, + nsICommandParams* aParams) { if (!nsCRT::strcmp(sCopyImageLocationString, aCommandName)) return aEdit->CopyImage(nsIContentViewerEdit::COPY_IMAGE_TEXT); if (!nsCRT::strcmp(sCopyImageContentsString, aCommandName)) @@ -702,15 +702,15 @@ nsresult nsClipboardImageCommands::DoClipboardCommand( #endif nsresult nsClipboardSelectAllNoneCommands::IsClipboardCommandEnabled( - const char *aCommandName, nsIContentViewerEdit *aEdit, - bool *outCmdEnabled) { + const char* aCommandName, nsIContentViewerEdit* aEdit, + bool* outCmdEnabled) { *outCmdEnabled = true; return NS_OK; } nsresult nsClipboardSelectAllNoneCommands::DoClipboardCommand( - const char *aCommandName, nsIContentViewerEdit *aEdit, - nsICommandParams *aParams) { + const char* aCommandName, nsIContentViewerEdit* aEdit, + nsICommandParams* aParams) { if (!nsCRT::strcmp(sSelectAllString, aCommandName)) return aEdit->SelectAll(); return aEdit->ClearSelection(); @@ -721,17 +721,17 @@ nsresult nsClipboardSelectAllNoneCommands::DoClipboardCommand( #endif nsresult nsClipboardGetContentsCommand::IsClipboardCommandEnabled( - const char *aCommandName, nsIContentViewerEdit *aEdit, - bool *outCmdEnabled) { + const char* aCommandName, nsIContentViewerEdit* aEdit, + bool* outCmdEnabled) { return aEdit->GetCanGetContents(outCmdEnabled); } nsresult nsClipboardGetContentsCommand::DoClipboardCommand( - const char *aCommandName, nsIContentViewerEdit *aEdit, - nsICommandParams *aParams) { + const char* aCommandName, nsIContentViewerEdit* aEdit, + nsICommandParams* aParams) { NS_ENSURE_ARG(aParams); - nsCommandParams *params = aParams->AsCommandParams(); + nsCommandParams* params = aParams->AsCommandParams(); nsAutoCString mimeType("text/plain"); @@ -880,35 +880,35 @@ class nsLookUpDictionaryCommand final : public nsIControllerCommand { NS_IMPL_ISUPPORTS(nsLookUpDictionaryCommand, nsIControllerCommand) NS_IMETHODIMP -nsLookUpDictionaryCommand::IsCommandEnabled(const char *aCommandName, - nsISupports *aCommandContext, - bool *aRetval) { +nsLookUpDictionaryCommand::IsCommandEnabled(const char* aCommandName, + nsISupports* aCommandContext, + bool* aRetval) { *aRetval = true; return NS_OK; } NS_IMETHODIMP -nsLookUpDictionaryCommand::GetCommandStateParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) { +nsLookUpDictionaryCommand::GetCommandStateParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsLookUpDictionaryCommand::DoCommand(const char *aCommandName, - nsISupports *aCommandContext) { +nsLookUpDictionaryCommand::DoCommand(const char* aCommandName, + nsISupports* aCommandContext) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsLookUpDictionaryCommand::DoCommandParams(const char *aCommandName, - nsICommandParams *aParams, - nsISupports *aCommandContext) { +nsLookUpDictionaryCommand::DoCommandParams(const char* aCommandName, + nsICommandParams* aParams, + nsISupports* aCommandContext) { if (NS_WARN_IF(!nsContentUtils::IsSafeToRunScript())) { return NS_ERROR_NOT_AVAILABLE; } - nsCommandParams *params = aParams->AsCommandParams(); + nsCommandParams* params = aParams->AsCommandParams(); ErrorResult error; int32_t x = params->GetInt("x", error); @@ -927,17 +927,17 @@ nsLookUpDictionaryCommand::DoCommandParams(const char *aCommandName, return NS_ERROR_FAILURE; } - nsIDocShell *docShell = window->GetDocShell(); + nsIDocShell* docShell = window->GetDocShell(); if (NS_WARN_IF(!docShell)) { return NS_ERROR_FAILURE; } - PresShell *presShell = docShell->GetPresShell(); + PresShell* presShell = docShell->GetPresShell(); if (NS_WARN_IF(!presShell)) { return NS_ERROR_FAILURE; } - nsPresContext *presContext = presShell->GetPresContext(); + nsPresContext* presContext = presShell->GetPresContext(); if (NS_WARN_IF(!presContext)) { return NS_ERROR_FAILURE; } @@ -1022,31 +1022,31 @@ nsLookUpDictionaryCommand::DoCommandParams(const char *aCommandName, ----------------------------------------------------------------------------*/ -#define NS_REGISTER_ONE_COMMAND(_cmdClass, _cmdName) \ - { \ - _cmdClass *theCmd = new _cmdClass(); \ - rv = aCommandTable->RegisterCommand( \ - _cmdName, static_cast(theCmd)); \ +#define NS_REGISTER_ONE_COMMAND(_cmdClass, _cmdName) \ + { \ + _cmdClass* theCmd = new _cmdClass(); \ + rv = aCommandTable->RegisterCommand( \ + _cmdName, static_cast(theCmd)); \ } #define NS_REGISTER_FIRST_COMMAND(_cmdClass, _cmdName) \ { \ - _cmdClass *theCmd = new _cmdClass(); \ + _cmdClass* theCmd = new _cmdClass(); \ rv = aCommandTable->RegisterCommand( \ - _cmdName, static_cast(theCmd)); + _cmdName, static_cast(theCmd)); #define NS_REGISTER_NEXT_COMMAND(_cmdClass, _cmdName) \ rv = aCommandTable->RegisterCommand( \ - _cmdName, static_cast(theCmd)); + _cmdName, static_cast(theCmd)); -#define NS_REGISTER_LAST_COMMAND(_cmdClass, _cmdName) \ - rv = aCommandTable->RegisterCommand( \ - _cmdName, static_cast(theCmd)); \ +#define NS_REGISTER_LAST_COMMAND(_cmdClass, _cmdName) \ + rv = aCommandTable->RegisterCommand( \ + _cmdName, static_cast(theCmd)); \ } // static nsresult nsWindowCommandRegistration::RegisterWindowCommands( - nsControllerCommandTable *aCommandTable) { + nsControllerCommandTable* aCommandTable) { nsresult rv; // XXX rework the macros to use a loop is possible, reducing code size @@ -1129,14 +1129,14 @@ nsresult nsWindowCommandRegistration::RegisterWindowCommands( /* static */ bool nsGlobalWindowCommands::FindScrollCommand( - const char *aCommandName, KeyboardScrollAction *aOutAction) { + const char* aCommandName, KeyboardScrollAction* aOutAction) { // Search for a keyboard scroll action to do for this command in // browseCommands and physicalBrowseCommands. Each command exists in only one // of them, so the order we examine browseCommands and physicalBrowseCommands // doesn't matter. for (size_t i = 0; i < ArrayLength(browseCommands); i++) { - const BrowseCommand &cmd = browseCommands[i]; + const BrowseCommand& cmd = browseCommands[i]; bool forward = !strcmp(aCommandName, cmd.forward); bool reverse = !strcmp(aCommandName, cmd.reverse); if (forward || reverse) { @@ -1146,7 +1146,7 @@ bool nsGlobalWindowCommands::FindScrollCommand( } for (size_t i = 0; i < ArrayLength(physicalBrowseCommands); i++) { - const PhysicalBrowseCommand &cmd = physicalBrowseCommands[i]; + const PhysicalBrowseCommand& cmd = physicalBrowseCommands[i]; if (!strcmp(aCommandName, cmd.command)) { int16_t dir = cmd.direction; bool forward = (dir == nsISelectionController::MOVE_RIGHT || diff --git a/dom/base/nsIScriptGlobalObject.h b/dom/base/nsIScriptGlobalObject.h index fbb60e1412004..748f21f4cac99 100644 --- a/dom/base/nsIScriptGlobalObject.h +++ b/dom/base/nsIScriptGlobalObject.h @@ -26,9 +26,9 @@ struct ErrorEventInit; // notifies it of an error via nsIScriptGlobalObject::HandleScriptError. // Returns true if HandleDOMEvent was actually called, in which case // aStatus will be filled in with the status. -bool NS_HandleScriptError(nsIScriptGlobalObject *aScriptGlobal, - const mozilla::dom::ErrorEventInit &aErrorEvent, - nsEventStatus *aStatus); +bool NS_HandleScriptError(nsIScriptGlobalObject* aScriptGlobal, + const mozilla::dom::ErrorEventInit& aErrorEvent, + nsEventStatus* aStatus); // Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs #define NS_ISCRIPTGLOBALOBJECT_IID \ @@ -62,15 +62,15 @@ class nsIScriptGlobalObject : public nsIGlobalObject { /** * Get a script context (WITHOUT added reference) for the specified language. */ - virtual nsIScriptContext *GetScriptContext() = 0; + virtual nsIScriptContext* GetScriptContext() = 0; - nsIScriptContext *GetContext() { return GetScriptContext(); } + nsIScriptContext* GetContext() { return GetScriptContext(); } /** * Handle a script error. Generally called by a script context. */ - bool HandleScriptError(const mozilla::dom::ErrorEventInit &aErrorEventInit, - nsEventStatus *aEventStatus) { + bool HandleScriptError(const mozilla::dom::ErrorEventInit& aErrorEventInit, + nsEventStatus* aEventStatus) { return NS_HandleScriptError(this, aErrorEventInit, aEventStatus); } diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h index 75952cf750a78..5da763b2bc0f3 100644 --- a/dom/base/nsJSEnvironment.h +++ b/dom/base/nsJSEnvironment.h @@ -36,34 +36,34 @@ struct CycleCollectorResults; class nsJSContext : public nsIScriptContext { public: - nsJSContext(bool aGCOnDestruction, nsIScriptGlobalObject *aGlobalObject); + nsJSContext(bool aGCOnDestruction, nsIScriptGlobalObject* aGlobalObject); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsJSContext, nsIScriptContext) - virtual nsIScriptGlobalObject *GetGlobalObject() override; - inline nsIScriptGlobalObject *GetGlobalObjectRef() { + virtual nsIScriptGlobalObject* GetGlobalObject() override; + inline nsIScriptGlobalObject* GetGlobalObjectRef() { return mGlobalObjectRef; } virtual nsresult InitContext() override; virtual bool IsContextInitialized() override; - virtual nsresult SetProperty(JS::Handle aTarget, - const char *aPropName, - nsISupports *aVal) override; + virtual nsresult SetProperty(JS::Handle aTarget, + const char* aPropName, + nsISupports* aVal) override; virtual bool GetProcessingScriptTag() override; virtual void SetProcessingScriptTag(bool aResult) override; - virtual nsresult InitClasses(JS::Handle aGlobalObj) override; + virtual nsresult InitClasses(JS::Handle aGlobalObj) override; virtual void WillInitializeContext() override; virtual void DidInitializeContext() override; - virtual void SetWindowProxy(JS::Handle aWindowProxy) override; - virtual JSObject *GetWindowProxy() override; + virtual void SetWindowProxy(JS::Handle aWindowProxy) override; + virtual JSObject* GetWindowProxy() override; enum IsShrinking { ShrinkingGC, NonShrinkingGC }; @@ -77,7 +77,7 @@ class nsJSContext : public nsIScriptContext { IsShrinking aShrinking = NonShrinkingGC, int64_t aSliceMillis = 0); - static void CycleCollectNow(nsICycleCollectorListener *aListener = nullptr); + static void CycleCollectNow(nsICycleCollectorListener* aListener = nullptr); // Run a cycle collector slice, using a heuristic to decide how long to run // it. @@ -88,7 +88,7 @@ class nsJSContext : public nsIScriptContext { static void BeginCycleCollectionCallback(); static void EndCycleCollectionCallback( - mozilla::CycleCollectorResults &aResults); + mozilla::CycleCollectorResults& aResults); // Return the longest CC slice time since ClearMaxCCSliceTime() was last // called. @@ -102,11 +102,11 @@ class nsJSContext : public nsIScriptContext { // If user has been idle and aDocShell is for an iframe being loaded in an // already loaded top level docshell, this will run a CC or GC // timer/runner if there is such pending. - static void MaybeRunNextCollectorSlice(nsIDocShell *aDocShell, + static void MaybeRunNextCollectorSlice(nsIDocShell* aDocShell, JS::GCReason aReason); // The GC should probably run soon, in the zone of object aObj (if given). - static void PokeGC(JS::GCReason aReason, JSObject *aObj, int aDelay = 0); + static void PokeGC(JS::GCReason aReason, JSObject* aObj, int aDelay = 0); static void KillGCTimer(); static void PokeShrinkingGC(); @@ -123,10 +123,10 @@ class nsJSContext : public nsIScriptContext { static uint32_t CleanupsSinceLastGC(); - nsIScriptGlobalObject *GetCachedGlobalObject() { + nsIScriptGlobalObject* GetCachedGlobalObject() { // Verify that we have a global so that this // does always return a null when GetGlobalObject() is null. - JSObject *global = GetWindowProxy(); + JSObject* global = GetWindowProxy(); return global ? mGlobalObjectRef.get() : nullptr; } @@ -134,17 +134,17 @@ class nsJSContext : public nsIScriptContext { virtual ~nsJSContext(); // Helper to convert xpcom datatypes to jsvals. - nsresult ConvertSupportsTojsvals(JSContext *aCx, nsISupports *aArgs, - JS::Handle aScope, + nsresult ConvertSupportsTojsvals(JSContext* aCx, nsISupports* aArgs, + JS::Handle aScope, JS::MutableHandleVector aArgsOut); - nsresult AddSupportsPrimitiveTojsvals(JSContext *aCx, nsISupports *aArg, - JS::Value *aArgv); + nsresult AddSupportsPrimitiveTojsvals(JSContext* aCx, nsISupports* aArg, + JS::Value* aArgv); private: void Destroy(); - JS::Heap mWindowProxy; + JS::Heap mWindowProxy; bool mIsInitialized; bool mGCOnDestruction; @@ -154,7 +154,7 @@ class nsJSContext : public nsIScriptContext { // context does. It is eventually collected by the cycle collector. nsCOMPtr mGlobalObjectRef; - static bool DOMOperationCallback(JSContext *cx); + static bool DOMOperationCallback(JSContext* cx); }; namespace mozilla { @@ -167,7 +167,7 @@ void ShutdownJSEnvironment(); class AsyncErrorReporter final : public mozilla::Runnable { public: // aWindow may be null if this error report is not associated with a window - explicit AsyncErrorReporter(xpc::ErrorReport *aReport) + explicit AsyncErrorReporter(xpc::ErrorReport* aReport) : Runnable("dom::AsyncErrorReporter"), mReport(aReport) {} NS_IMETHOD Run() override { @@ -199,7 +199,7 @@ class nsIJSArgArray : public nsIArray { // Bug 312003 describes why this must be "void **", but after calling argv // may be cast to JS::Value* and the args found at: // ((JS::Value*)argv)[0], ..., ((JS::Value*)argv)[argc - 1] - virtual nsresult GetArgs(uint32_t *argc, void **argv) = 0; + virtual nsresult GetArgs(uint32_t* argc, void** argv) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIJSArgArray, NS_IJSARGARRAY_IID) diff --git a/dom/base/nsNoDataProtocolContentPolicy.cpp b/dom/base/nsNoDataProtocolContentPolicy.cpp index 89f891f243656..eeb9c67ff8c2c 100644 --- a/dom/base/nsNoDataProtocolContentPolicy.cpp +++ b/dom/base/nsNoDataProtocolContentPolicy.cpp @@ -23,10 +23,10 @@ NS_IMPL_ISUPPORTS(nsNoDataProtocolContentPolicy, nsIContentPolicy) NS_IMETHODIMP -nsNoDataProtocolContentPolicy::ShouldLoad(nsIURI *aContentLocation, - nsILoadInfo *aLoadInfo, - const nsACString &aMimeGuess, - int16_t *aDecision) { +nsNoDataProtocolContentPolicy::ShouldLoad(nsIURI* aContentLocation, + nsILoadInfo* aLoadInfo, + const nsACString& aMimeGuess, + int16_t* aDecision) { uint32_t contentType = aLoadInfo->GetExternalContentPolicyType(); MOZ_ASSERT(contentType == nsContentUtils::InternalContentPolicyTypeToExternal( @@ -67,9 +67,9 @@ nsNoDataProtocolContentPolicy::ShouldLoad(nsIURI *aContentLocation, } NS_IMETHODIMP -nsNoDataProtocolContentPolicy::ShouldProcess(nsIURI *aContentLocation, - nsILoadInfo *aLoadInfo, - const nsACString &aMimeGuess, - int16_t *aDecision) { +nsNoDataProtocolContentPolicy::ShouldProcess(nsIURI* aContentLocation, + nsILoadInfo* aLoadInfo, + const nsACString& aMimeGuess, + int16_t* aDecision) { return ShouldLoad(aContentLocation, aLoadInfo, aMimeGuess, aDecision); } diff --git a/dom/base/nsSyncLoadService.cpp b/dom/base/nsSyncLoadService.cpp index 6f7e4f2092bb5..6590ccea5a713 100644 --- a/dom/base/nsSyncLoadService.cpp +++ b/dom/base/nsSyncLoadService.cpp @@ -44,9 +44,9 @@ class nsSyncLoader : public nsIStreamListener, NS_DECL_ISUPPORTS - nsresult LoadDocument(nsIChannel *aChannel, bool aChannelIsSync, + nsresult LoadDocument(nsIChannel* aChannel, bool aChannelIsSync, bool aForceToXML, ReferrerPolicy aReferrerPolicy, - Document **aResult); + Document** aResult); NS_FORWARD_NSISTREAMLISTENER(mListener->) NS_DECL_NSIREQUESTOBSERVER @@ -58,8 +58,8 @@ class nsSyncLoader : public nsIStreamListener, private: virtual ~nsSyncLoader(); - nsresult PushAsyncStream(nsIStreamListener *aListener); - nsresult PushSyncStream(nsIStreamListener *aListener); + nsresult PushAsyncStream(nsIStreamListener* aListener); + nsresult PushSyncStream(nsIStreamListener* aListener); nsCOMPtr mChannel; nsCOMPtr mListener; @@ -71,7 +71,7 @@ class nsForceXMLListener : public nsIStreamListener { virtual ~nsForceXMLListener(); public: - explicit nsForceXMLListener(nsIStreamListener *aListener); + explicit nsForceXMLListener(nsIStreamListener* aListener); NS_DECL_ISUPPORTS NS_FORWARD_NSISTREAMLISTENER(mListener->) @@ -81,7 +81,7 @@ class nsForceXMLListener : public nsIStreamListener { nsCOMPtr mListener; }; -nsForceXMLListener::nsForceXMLListener(nsIStreamListener *aListener) +nsForceXMLListener::nsForceXMLListener(nsIStreamListener* aListener) : mListener(aListener) {} nsForceXMLListener::~nsForceXMLListener() {} @@ -89,7 +89,7 @@ nsForceXMLListener::~nsForceXMLListener() {} NS_IMPL_ISUPPORTS(nsForceXMLListener, nsIStreamListener, nsIRequestObserver) NS_IMETHODIMP -nsForceXMLListener::OnStartRequest(nsIRequest *aRequest) { +nsForceXMLListener::OnStartRequest(nsIRequest* aRequest) { nsresult status; aRequest->GetStatus(&status); nsCOMPtr channel = do_QueryInterface(aRequest); @@ -101,7 +101,7 @@ nsForceXMLListener::OnStartRequest(nsIRequest *aRequest) { } NS_IMETHODIMP -nsForceXMLListener::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) { +nsForceXMLListener::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) { return mListener->OnStopRequest(aRequest, aStatusCode); } @@ -115,10 +115,10 @@ NS_IMPL_ISUPPORTS(nsSyncLoader, nsIStreamListener, nsIRequestObserver, nsIChannelEventSink, nsIInterfaceRequestor, nsISupportsWeakReference) -nsresult nsSyncLoader::LoadDocument(nsIChannel *aChannel, bool aChannelIsSync, +nsresult nsSyncLoader::LoadDocument(nsIChannel* aChannel, bool aChannelIsSync, bool aForceToXML, ReferrerPolicy aReferrerPolicy, - Document **aResult) { + Document** aResult) { NS_ENSURE_ARG(aChannel); NS_ENSURE_ARG_POINTER(aResult); *aResult = nullptr; @@ -195,7 +195,7 @@ nsresult nsSyncLoader::LoadDocument(nsIChannel *aChannel, bool aChannelIsSync, return NS_OK; } -nsresult nsSyncLoader::PushAsyncStream(nsIStreamListener *aListener) { +nsresult nsSyncLoader::PushAsyncStream(nsIStreamListener* aListener) { mListener = aListener; mAsyncLoadStatus = NS_OK; @@ -206,7 +206,7 @@ nsresult nsSyncLoader::PushAsyncStream(nsIStreamListener *aListener) { if (NS_SUCCEEDED(rv)) { // process events until we're finished. mLoading = true; - nsIThread *thread = NS_GetCurrentThread(); + nsIThread* thread = NS_GetCurrentThread(); while (mLoading && NS_SUCCEEDED(rv)) { bool processedEvent; rv = thread->ProcessNextEvent(true, &processedEvent); @@ -224,7 +224,7 @@ nsresult nsSyncLoader::PushAsyncStream(nsIStreamListener *aListener) { return mAsyncLoadStatus; } -nsresult nsSyncLoader::PushSyncStream(nsIStreamListener *aListener) { +nsresult nsSyncLoader::PushSyncStream(nsIStreamListener* aListener) { nsCOMPtr in; nsresult rv = mChannel->Open(getter_AddRefs(in)); NS_ENSURE_SUCCESS(rv, rv); @@ -238,12 +238,12 @@ nsresult nsSyncLoader::PushSyncStream(nsIStreamListener *aListener) { } NS_IMETHODIMP -nsSyncLoader::OnStartRequest(nsIRequest *aRequest) { +nsSyncLoader::OnStartRequest(nsIRequest* aRequest) { return mListener->OnStartRequest(aRequest); } NS_IMETHODIMP -nsSyncLoader::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) { +nsSyncLoader::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) { if (NS_SUCCEEDED(mAsyncLoadStatus) && NS_FAILED(aStatusCode)) { mAsyncLoadStatus = aStatusCode; } @@ -257,9 +257,9 @@ nsSyncLoader::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) { } NS_IMETHODIMP -nsSyncLoader::AsyncOnChannelRedirect(nsIChannel *aOldChannel, - nsIChannel *aNewChannel, uint32_t aFlags, - nsIAsyncVerifyRedirectCallback *callback) { +nsSyncLoader::AsyncOnChannelRedirect(nsIChannel* aOldChannel, + nsIChannel* aNewChannel, uint32_t aFlags, + nsIAsyncVerifyRedirectCallback* callback) { MOZ_ASSERT(aNewChannel, "Redirecting to null channel?"); mChannel = aNewChannel; @@ -269,16 +269,16 @@ nsSyncLoader::AsyncOnChannelRedirect(nsIChannel *aOldChannel, } NS_IMETHODIMP -nsSyncLoader::GetInterface(const nsIID &aIID, void **aResult) { +nsSyncLoader::GetInterface(const nsIID& aIID, void** aResult) { return QueryInterface(aIID, aResult); } /* static */ nsresult nsSyncLoadService::LoadDocument( - nsIURI *aURI, nsContentPolicyType aContentPolicyType, - nsIPrincipal *aLoaderPrincipal, nsSecurityFlags aSecurityFlags, - nsILoadGroup *aLoadGroup, nsICookieSettings *aCookieSettings, - bool aForceToXML, ReferrerPolicy aReferrerPolicy, Document **aResult) { + nsIURI* aURI, nsContentPolicyType aContentPolicyType, + nsIPrincipal* aLoaderPrincipal, nsSecurityFlags aSecurityFlags, + nsILoadGroup* aLoadGroup, nsICookieSettings* aCookieSettings, + bool aForceToXML, ReferrerPolicy aReferrerPolicy, Document** aResult) { nsCOMPtr channel; nsresult rv = NS_NewChannel(getter_AddRefs(channel), aURI, aLoaderPrincipal, @@ -304,8 +304,8 @@ nsresult nsSyncLoadService::LoadDocument( /* static */ nsresult nsSyncLoadService::PushSyncStreamToListener( - already_AddRefed aIn, nsIStreamListener *aListener, - nsIChannel *aChannel) { + already_AddRefed aIn, nsIStreamListener* aListener, + nsIChannel* aChannel) { nsCOMPtr in = std::move(aIn); // Set up buffering stream diff --git a/dom/base/nsTextFragmentSSE2.cpp b/dom/base/nsTextFragmentSSE2.cpp index 6fcf866fe0ff0..b6f5817cc32ab 100644 --- a/dom/base/nsTextFragmentSSE2.cpp +++ b/dom/base/nsTextFragmentSSE2.cpp @@ -20,7 +20,7 @@ static inline bool is_zero(__m128i x) { return _mm_movemask_epi8(_mm_cmpeq_epi8(x, _mm_setzero_si128())) == 0xffff; } -int32_t FirstNon8Bit(const char16_t *str, const char16_t *end) { +int32_t FirstNon8Bit(const char16_t* str, const char16_t* end) { const uint32_t numUnicharsPerVector = 8; typedef Non8BitParameters p; const size_t mask = p::mask(); @@ -42,7 +42,7 @@ int32_t FirstNon8Bit(const char16_t *str, const char16_t *end) { const uint16_t shortMask = 0xff00; __m128i vectmask = _mm_set1_epi16(static_cast(shortMask)); for (; i < vectWalkEnd; i += numUnicharsPerVector) { - const __m128i vect = *reinterpret_cast(str + i); + const __m128i vect = *reinterpret_cast(str + i); if (!is_zero(_mm_and_si128(vect, vectmask))) return i; } @@ -50,7 +50,7 @@ int32_t FirstNon8Bit(const char16_t *str, const char16_t *end) { const int32_t wordWalkEnd = ((len - i) / numUnicharsPerWord) * numUnicharsPerWord; for (; i < wordWalkEnd; i += numUnicharsPerWord) { - const size_t word = *reinterpret_cast(str + i); + const size_t word = *reinterpret_cast(str + i); if (word & mask) return i; } diff --git a/dom/base/test/gtest/TestPlainTextSerializer.cpp b/dom/base/test/gtest/TestPlainTextSerializer.cpp index 133b10de91fd1..ef2e37e26397c 100644 --- a/dom/base/test/gtest/TestPlainTextSerializer.cpp +++ b/dom/base/test/gtest/TestPlainTextSerializer.cpp @@ -12,7 +12,7 @@ #include "nsCRT.h" #include "nsIParserUtils.h" -void ConvertBufToPlainText(nsString &aConBuf, int aFlag) { +void ConvertBufToPlainText(nsString& aConBuf, int aFlag) { nsCOMPtr utils = do_GetService(NS_PARSERUTILS_CONTRACTID); utils->ConvertToPlainText(aConBuf, aFlag, 72, aConBuf); } diff --git a/dom/canvas/MurmurHash3.cpp b/dom/canvas/MurmurHash3.cpp index 64a6bfd6d8f28..9a6006e6e6271 100644 --- a/dom/canvas/MurmurHash3.cpp +++ b/dom/canvas/MurmurHash3.cpp @@ -54,9 +54,9 @@ inline uint64_t rotl64(uint64_t x, int8_t r) { // Block read - if your platform needs to do endian-swapping or can only // handle aligned reads, do the conversion here -FORCE_INLINE uint32_t getblock(const uint32_t *p, int i) { return p[i]; } +FORCE_INLINE uint32_t getblock(const uint32_t* p, int i) { return p[i]; } -FORCE_INLINE uint64_t getblock(const uint64_t *p, int i) { return p[i]; } +FORCE_INLINE uint64_t getblock(const uint64_t* p, int i) { return p[i]; } //----------------------------------------------------------------------------- // Finalization mix - force all bits of a hash block to avalanche @@ -87,8 +87,8 @@ FORCE_INLINE uint64_t fmix(uint64_t k) { //----------------------------------------------------------------------------- -void MurmurHash3_x86_32(const void *key, int len, uint32_t seed, void *out) { - const uint8_t *data = (const uint8_t *)key; +void MurmurHash3_x86_32(const void* key, int len, uint32_t seed, void* out) { + const uint8_t* data = (const uint8_t*)key; const int nblocks = len / 4; uint32_t h1 = seed; @@ -99,7 +99,7 @@ void MurmurHash3_x86_32(const void *key, int len, uint32_t seed, void *out) { //---------- // body - const uint32_t *blocks = (const uint32_t *)(data + nblocks * 4); + const uint32_t* blocks = (const uint32_t*)(data + nblocks * 4); for (int i = -nblocks; i; i++) { uint32_t k1 = getblock(blocks, i); @@ -116,7 +116,7 @@ void MurmurHash3_x86_32(const void *key, int len, uint32_t seed, void *out) { //---------- // tail - const uint8_t *tail = (const uint8_t *)(data + nblocks * 4); + const uint8_t* tail = (const uint8_t*)(data + nblocks * 4); uint32_t k1 = 0; @@ -140,14 +140,14 @@ void MurmurHash3_x86_32(const void *key, int len, uint32_t seed, void *out) { h1 = fmix(h1); - *(uint32_t *)out = h1; + *(uint32_t*)out = h1; } //----------------------------------------------------------------------------- -void MurmurHash3_x86_128(const void *key, const int len, uint32_t seed, - void *out) { - const uint8_t *data = (const uint8_t *)key; +void MurmurHash3_x86_128(const void* key, const int len, uint32_t seed, + void* out) { + const uint8_t* data = (const uint8_t*)key; const int nblocks = len / 16; uint32_t h1 = seed; @@ -163,7 +163,7 @@ void MurmurHash3_x86_128(const void *key, const int len, uint32_t seed, //---------- // body - const uint32_t *blocks = (const uint32_t *)(data + nblocks * 16); + const uint32_t* blocks = (const uint32_t*)(data + nblocks * 16); for (int i = -nblocks; i; i++) { uint32_t k1 = getblock(blocks, i * 4 + 0); @@ -211,7 +211,7 @@ void MurmurHash3_x86_128(const void *key, const int len, uint32_t seed, //---------- // tail - const uint8_t *tail = (const uint8_t *)(data + nblocks * 16); + const uint8_t* tail = (const uint8_t*)(data + nblocks * 16); uint32_t k1 = 0; uint32_t k2 = 0; @@ -297,17 +297,17 @@ void MurmurHash3_x86_128(const void *key, const int len, uint32_t seed, h3 += h1; h4 += h1; - ((uint32_t *)out)[0] = h1; - ((uint32_t *)out)[1] = h2; - ((uint32_t *)out)[2] = h3; - ((uint32_t *)out)[3] = h4; + ((uint32_t*)out)[0] = h1; + ((uint32_t*)out)[1] = h2; + ((uint32_t*)out)[2] = h3; + ((uint32_t*)out)[3] = h4; } //----------------------------------------------------------------------------- -void MurmurHash3_x64_128(const void *key, const int len, const uint32_t seed, - void *out) { - const uint8_t *data = (const uint8_t *)key; +void MurmurHash3_x64_128(const void* key, const int len, const uint32_t seed, + void* out) { + const uint8_t* data = (const uint8_t*)key; const int nblocks = len / 16; uint64_t h1 = seed; @@ -319,7 +319,7 @@ void MurmurHash3_x64_128(const void *key, const int len, const uint32_t seed, //---------- // body - const uint64_t *blocks = (const uint64_t *)(data); + const uint64_t* blocks = (const uint64_t*)(data); for (int i = 0; i < nblocks; i++) { uint64_t k1 = getblock(blocks, i * 2 + 0); @@ -347,7 +347,7 @@ void MurmurHash3_x64_128(const void *key, const int len, const uint32_t seed, //---------- // tail - const uint8_t *tail = (const uint8_t *)(data + nblocks * 16); + const uint8_t* tail = (const uint8_t*)(data + nblocks * 16); uint64_t k1 = 0; uint64_t k2 = 0; @@ -409,8 +409,8 @@ void MurmurHash3_x64_128(const void *key, const int len, const uint32_t seed, h1 += h2; h2 += h1; - ((uint64_t *)out)[0] = h1; - ((uint64_t *)out)[1] = h2; + ((uint64_t*)out)[0] = h1; + ((uint64_t*)out)[1] = h2; } //----------------------------------------------------------------------------- diff --git a/dom/clients/manager/ClientOpenWindowUtils.h b/dom/clients/manager/ClientOpenWindowUtils.h index a426f449440a1..9e16969f4d20f 100644 --- a/dom/clients/manager/ClientOpenWindowUtils.h +++ b/dom/clients/manager/ClientOpenWindowUtils.h @@ -13,7 +13,7 @@ namespace mozilla { namespace dom { MOZ_MUST_USE RefPtr ClientOpenWindowInCurrentProcess( - const ClientOpenWindowArgs &aArgs); + const ClientOpenWindowArgs& aArgs); } // namespace dom } // namespace mozilla diff --git a/dom/file/uri/FontTableURIProtocolHandler.cpp b/dom/file/uri/FontTableURIProtocolHandler.cpp index 19c8a31549ec7..1c6df9ebeb171 100644 --- a/dom/file/uri/FontTableURIProtocolHandler.cpp +++ b/dom/file/uri/FontTableURIProtocolHandler.cpp @@ -14,7 +14,7 @@ using namespace mozilla; using namespace mozilla::dom; /* static */ -nsresult FontTableURIProtocolHandler::GenerateURIString(nsACString &aUri) { +nsresult FontTableURIProtocolHandler::GenerateURIString(nsACString& aUri) { nsresult rv; nsCOMPtr uuidgen = do_GetService("@mozilla.org/uuid-generator;1", &rv); @@ -42,46 +42,46 @@ NS_IMPL_ISUPPORTS(FontTableURIProtocolHandler, nsIProtocolHandler, nsISupportsWeakReference) NS_IMETHODIMP -FontTableURIProtocolHandler::GetDefaultPort(int32_t *result) { +FontTableURIProtocolHandler::GetDefaultPort(int32_t* result) { *result = -1; return NS_OK; } NS_IMETHODIMP -FontTableURIProtocolHandler::GetProtocolFlags(uint32_t *result) { +FontTableURIProtocolHandler::GetProtocolFlags(uint32_t* result) { *result = URI_NORELATIVE | URI_NOAUTH | URI_LOADABLE_BY_SUBSUMERS | URI_NON_PERSISTABLE | URI_IS_LOCAL_RESOURCE; return NS_OK; } NS_IMETHODIMP -FontTableURIProtocolHandler::GetFlagsForURI(nsIURI *aURI, uint32_t *aResult) { +FontTableURIProtocolHandler::GetFlagsForURI(nsIURI* aURI, uint32_t* aResult) { return FontTableURIProtocolHandler::GetProtocolFlags(aResult); } NS_IMETHODIMP -FontTableURIProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, - nsIChannel **result) { +FontTableURIProtocolHandler::NewChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, + nsIChannel** result) { return NS_ERROR_DOM_BAD_URI; } NS_IMETHODIMP -FontTableURIProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +FontTableURIProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { *_retval = false; return NS_OK; } NS_IMETHODIMP -FontTableURIProtocolHandler::GetScheme(nsACString &result) { +FontTableURIProtocolHandler::GetScheme(nsACString& result) { result.AssignLiteral(FONTTABLEURI_SCHEME); return NS_OK; } NS_IMETHODIMP -FontTableURIProtocolHandler::NewURI(const nsACString &aSpec, - const char *aCharset, nsIURI *aBaseURI, - nsIURI **aResult) { +FontTableURIProtocolHandler::NewURI(const nsACString& aSpec, + const char* aCharset, nsIURI* aBaseURI, + nsIURI** aResult) { nsresult rv; nsCOMPtr uri; diff --git a/dom/html/nsHTMLDNSPrefetch.cpp b/dom/html/nsHTMLDNSPrefetch.cpp index 903fa26535112..d42063e0c8399 100644 --- a/dom/html/nsHTMLDNSPrefetch.cpp +++ b/dom/html/nsHTMLDNSPrefetch.cpp @@ -40,9 +40,9 @@ using namespace mozilla::net; static NS_DEFINE_CID(kDNSServiceCID, NS_DNSSERVICE_CID); bool sDisablePrefetchHTTPSPref; static bool sInitialized = false; -static nsIDNSService *sDNSService = nullptr; -static nsHTMLDNSPrefetch::nsDeferrals *sPrefetches = nullptr; -static nsHTMLDNSPrefetch::nsListener *sDNSListener = nullptr; +static nsIDNSService* sDNSService = nullptr; +static nsHTMLDNSPrefetch::nsDeferrals* sPrefetches = nullptr; +static nsHTMLDNSPrefetch::nsListener* sDNSListener = nullptr; bool sEsniEnabled; nsresult nsHTMLDNSPrefetch::Initialize() { @@ -94,32 +94,32 @@ nsresult nsHTMLDNSPrefetch::Shutdown() { return NS_OK; } -bool nsHTMLDNSPrefetch::IsAllowed(Document *aDocument) { +bool nsHTMLDNSPrefetch::IsAllowed(Document* aDocument) { // There is no need to do prefetch on non UI scenarios such as XMLHttpRequest. return aDocument->IsDNSPrefetchAllowed() && aDocument->GetWindow(); } -nsresult nsHTMLDNSPrefetch::Prefetch(Link *aElement, uint16_t flags) { +nsresult nsHTMLDNSPrefetch::Prefetch(Link* aElement, uint16_t flags) { if (!(sInitialized && sPrefetches && sDNSService && sDNSListener)) return NS_ERROR_NOT_AVAILABLE; return sPrefetches->Add(flags, aElement); } -nsresult nsHTMLDNSPrefetch::PrefetchLow(Link *aElement) { +nsresult nsHTMLDNSPrefetch::PrefetchLow(Link* aElement) { return Prefetch(aElement, nsIDNSService::RESOLVE_PRIORITY_LOW); } -nsresult nsHTMLDNSPrefetch::PrefetchMedium(Link *aElement) { +nsresult nsHTMLDNSPrefetch::PrefetchMedium(Link* aElement) { return Prefetch(aElement, nsIDNSService::RESOLVE_PRIORITY_MEDIUM); } -nsresult nsHTMLDNSPrefetch::PrefetchHigh(Link *aElement) { +nsresult nsHTMLDNSPrefetch::PrefetchHigh(Link* aElement) { return Prefetch(aElement, 0); } -nsresult nsHTMLDNSPrefetch::Prefetch(const nsAString &hostname, bool isHttps, - const OriginAttributes &aOriginAttributes, +nsresult nsHTMLDNSPrefetch::Prefetch(const nsAString& hostname, bool isHttps, + const OriginAttributes& aOriginAttributes, uint16_t flags) { if (IsNeckoChild()) { // We need to check IsEmpty() because net_IsValidHostName() @@ -161,26 +161,26 @@ nsresult nsHTMLDNSPrefetch::Prefetch(const nsAString &hostname, bool isHttps, } nsresult nsHTMLDNSPrefetch::PrefetchLow( - const nsAString &hostname, bool isHttps, - const OriginAttributes &aOriginAttributes) { + const nsAString& hostname, bool isHttps, + const OriginAttributes& aOriginAttributes) { return Prefetch(hostname, isHttps, aOriginAttributes, nsIDNSService::RESOLVE_PRIORITY_LOW); } nsresult nsHTMLDNSPrefetch::PrefetchMedium( - const nsAString &hostname, bool isHttps, - const OriginAttributes &aOriginAttributes) { + const nsAString& hostname, bool isHttps, + const OriginAttributes& aOriginAttributes) { return Prefetch(hostname, isHttps, aOriginAttributes, nsIDNSService::RESOLVE_PRIORITY_MEDIUM); } nsresult nsHTMLDNSPrefetch::PrefetchHigh( - const nsAString &hostname, bool isHttps, - const OriginAttributes &aOriginAttributes) { + const nsAString& hostname, bool isHttps, + const OriginAttributes& aOriginAttributes) { return Prefetch(hostname, isHttps, aOriginAttributes, 0); } -nsresult nsHTMLDNSPrefetch::CancelPrefetch(Link *aElement, uint16_t flags, +nsresult nsHTMLDNSPrefetch::CancelPrefetch(Link* aElement, uint16_t flags, nsresult aReason) { if (!(sInitialized && sPrefetches && sDNSService && sDNSListener)) return NS_ERROR_NOT_AVAILABLE; @@ -188,7 +188,7 @@ nsresult nsHTMLDNSPrefetch::CancelPrefetch(Link *aElement, uint16_t flags, nsAutoString hostname; aElement->GetHostname(hostname); - Element *element = aElement->GetElement(); + Element* element = aElement->GetElement(); NS_ENSURE_TRUE(element, NS_ERROR_FAILURE); nsAutoString protocol; @@ -203,8 +203,8 @@ nsresult nsHTMLDNSPrefetch::CancelPrefetch(Link *aElement, uint16_t flags, } nsresult nsHTMLDNSPrefetch::CancelPrefetch( - const nsAString &hostname, bool isHttps, - const OriginAttributes &aOriginAttributes, uint16_t flags, + const nsAString& hostname, bool isHttps, + const OriginAttributes& aOriginAttributes, uint16_t flags, nsresult aReason) { // Forward this request to Necko Parent if we're a child process if (IsNeckoChild()) { @@ -241,19 +241,19 @@ nsresult nsHTMLDNSPrefetch::CancelPrefetch( return rv; } -nsresult nsHTMLDNSPrefetch::CancelPrefetchLow(Link *aElement, +nsresult nsHTMLDNSPrefetch::CancelPrefetchLow(Link* aElement, nsresult aReason) { return CancelPrefetch(aElement, nsIDNSService::RESOLVE_PRIORITY_LOW, aReason); } nsresult nsHTMLDNSPrefetch::CancelPrefetchLow( - const nsAString &hostname, bool isHttps, - const OriginAttributes &aOriginAttributes, nsresult aReason) { + const nsAString& hostname, bool isHttps, + const OriginAttributes& aOriginAttributes, nsresult aReason) { return CancelPrefetch(hostname, isHttps, aOriginAttributes, nsIDNSService::RESOLVE_PRIORITY_LOW, aReason); } -void nsHTMLDNSPrefetch::LinkDestroyed(Link *aLink) { +void nsHTMLDNSPrefetch::LinkDestroyed(Link* aLink) { MOZ_ASSERT(aLink->IsInDNSPrefetch()); if (sPrefetches) { // Clean up all the possible links at once. @@ -266,15 +266,15 @@ void nsHTMLDNSPrefetch::LinkDestroyed(Link *aLink) { NS_IMPL_ISUPPORTS(nsHTMLDNSPrefetch::nsListener, nsIDNSListener) NS_IMETHODIMP -nsHTMLDNSPrefetch::nsListener::OnLookupComplete(nsICancelable *request, - nsIDNSRecord *rec, +nsHTMLDNSPrefetch::nsListener::OnLookupComplete(nsICancelable* request, + nsIDNSRecord* rec, nsresult status) { return NS_OK; } NS_IMETHODIMP -nsHTMLDNSPrefetch::nsListener::OnLookupByTypeComplete(nsICancelable *request, - nsIDNSByTypeRecord *res, +nsHTMLDNSPrefetch::nsListener::OnLookupByTypeComplete(nsICancelable* request, + nsIDNSByTypeRecord* res, nsresult status) { return NS_OK; } @@ -309,7 +309,7 @@ void nsHTMLDNSPrefetch::nsDeferrals::Flush() { } } -nsresult nsHTMLDNSPrefetch::nsDeferrals::Add(uint16_t flags, Link *aElement) { +nsresult nsHTMLDNSPrefetch::nsDeferrals::Add(uint16_t flags, Link* aElement) { // The FIFO has no lock, so it can only be accessed on main thread NS_ASSERTION(NS_IsMainThread(), "nsDeferrals::Add must be on main thread"); @@ -347,7 +347,7 @@ void nsHTMLDNSPrefetch::nsDeferrals::SubmitQueue() { nsCOMPtr hrefURI(link ? link->GetURI() : nullptr); bool isLocalResource = false; nsresult rv = NS_OK; - Element *element = link->GetElement(); + Element* element = link->GetElement(); hostName.Truncate(); bool isHttps = false; @@ -436,9 +436,9 @@ void nsHTMLDNSPrefetch::nsDeferrals::RemoveUnboundLinks() { // nsITimer related method -void nsHTMLDNSPrefetch::nsDeferrals::Tick(nsITimer *aTimer, void *aClosure) { - nsHTMLDNSPrefetch::nsDeferrals *self = - (nsHTMLDNSPrefetch::nsDeferrals *)aClosure; +void nsHTMLDNSPrefetch::nsDeferrals::Tick(nsITimer* aTimer, void* aClosure) { + nsHTMLDNSPrefetch::nsDeferrals* self = + (nsHTMLDNSPrefetch::nsDeferrals*)aClosure; NS_ASSERTION(NS_IsMainThread(), "nsDeferrals::Tick must be on main thread"); NS_ASSERTION(self->mTimerArmed, "Timer is not armed"); @@ -454,8 +454,8 @@ void nsHTMLDNSPrefetch::nsDeferrals::Tick(nsITimer *aTimer, void *aClosure) { //////////// nsIWebProgressListener methods NS_IMETHODIMP -nsHTMLDNSPrefetch::nsDeferrals::OnStateChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsHTMLDNSPrefetch::nsDeferrals::OnStateChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t progressStateFlags, nsresult aStatus) { // The FIFO has no lock, so it can only be accessed on main thread @@ -477,8 +477,8 @@ nsHTMLDNSPrefetch::nsDeferrals::OnStateChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsHTMLDNSPrefetch::nsDeferrals::OnProgressChange(nsIWebProgress *aProgress, - nsIRequest *aRequest, +nsHTMLDNSPrefetch::nsDeferrals::OnProgressChange(nsIWebProgress* aProgress, + nsIRequest* aRequest, int32_t curSelfProgress, int32_t maxSelfProgress, int32_t curTotalProgress, @@ -487,39 +487,39 @@ nsHTMLDNSPrefetch::nsDeferrals::OnProgressChange(nsIWebProgress *aProgress, } NS_IMETHODIMP -nsHTMLDNSPrefetch::nsDeferrals::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *location, +nsHTMLDNSPrefetch::nsDeferrals::OnLocationChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, + nsIURI* location, uint32_t aFlags) { return NS_OK; } NS_IMETHODIMP -nsHTMLDNSPrefetch::nsDeferrals::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsHTMLDNSPrefetch::nsDeferrals::OnStatusChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, nsresult aStatus, - const char16_t *aMessage) { + const char16_t* aMessage) { return NS_OK; } NS_IMETHODIMP -nsHTMLDNSPrefetch::nsDeferrals::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsHTMLDNSPrefetch::nsDeferrals::OnSecurityChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aState) { return NS_OK; } NS_IMETHODIMP nsHTMLDNSPrefetch::nsDeferrals::OnContentBlockingEvent( - nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aEvent) { + nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t aEvent) { return NS_OK; } //////////// nsIObserver method NS_IMETHODIMP -nsHTMLDNSPrefetch::nsDeferrals::Observe(nsISupports *subject, const char *topic, - const char16_t *data) { +nsHTMLDNSPrefetch::nsDeferrals::Observe(nsISupports* subject, const char* topic, + const char16_t* data) { if (!strcmp(topic, "xpcom-shutdown")) Flush(); return NS_OK; diff --git a/dom/html/nsHTMLDNSPrefetch.h b/dom/html/nsHTMLDNSPrefetch.h index b433124e3333f..42f548046c947 100644 --- a/dom/html/nsHTMLDNSPrefetch.h +++ b/dom/html/nsHTMLDNSPrefetch.h @@ -34,7 +34,7 @@ class nsHTMLDNSPrefetch { // The required aDocument parameter is the context requesting the prefetch - // under certain circumstances (e.g. headers, or security context) associated // with the context the prefetch will not be performed. - static bool IsAllowed(mozilla::dom::Document *aDocument); + static bool IsAllowed(mozilla::dom::Document* aDocument); static nsresult Initialize(); static nsresult Shutdown(); @@ -47,36 +47,36 @@ class nsHTMLDNSPrefetch { // weight, but its request is also more likely to be dropped due to a // full queue and it may only be used from the main thread. - static nsresult PrefetchHigh(mozilla::dom::Link *aElement); - static nsresult PrefetchMedium(mozilla::dom::Link *aElement); - static nsresult PrefetchLow(mozilla::dom::Link *aElement); + static nsresult PrefetchHigh(mozilla::dom::Link* aElement); + static nsresult PrefetchMedium(mozilla::dom::Link* aElement); + static nsresult PrefetchLow(mozilla::dom::Link* aElement); static nsresult PrefetchHigh( - const nsAString &host, bool isHttps, - const mozilla::OriginAttributes &aOriginAttributes); + const nsAString& host, bool isHttps, + const mozilla::OriginAttributes& aOriginAttributes); static nsresult PrefetchMedium( - const nsAString &host, bool isHttps, - const mozilla::OriginAttributes &aOriginAttributes); + const nsAString& host, bool isHttps, + const mozilla::OriginAttributes& aOriginAttributes); static nsresult PrefetchLow( - const nsAString &host, bool isHttps, - const mozilla::OriginAttributes &aOriginAttributes); + const nsAString& host, bool isHttps, + const mozilla::OriginAttributes& aOriginAttributes); static nsresult CancelPrefetchLow( - const nsAString &host, bool isHttps, - const mozilla::OriginAttributes &aOriginAttributes, nsresult aReason); - static nsresult CancelPrefetchLow(mozilla::dom::Link *aElement, + const nsAString& host, bool isHttps, + const mozilla::OriginAttributes& aOriginAttributes, nsresult aReason); + static nsresult CancelPrefetchLow(mozilla::dom::Link* aElement, nsresult aReason); - static void LinkDestroyed(mozilla::dom::Link *aLink); + static void LinkDestroyed(mozilla::dom::Link* aLink); private: - static nsresult Prefetch(const nsAString &host, bool isHttps, - const mozilla::OriginAttributes &aOriginAttributes, + static nsresult Prefetch(const nsAString& host, bool isHttps, + const mozilla::OriginAttributes& aOriginAttributes, uint16_t flags); - static nsresult Prefetch(mozilla::dom::Link *aElement, uint16_t flags); + static nsresult Prefetch(mozilla::dom::Link* aElement, uint16_t flags); static nsresult CancelPrefetch( - const nsAString &hostname, bool isHttps, - const mozilla::OriginAttributes &aOriginAttributes, uint16_t flags, + const nsAString& hostname, bool isHttps, + const mozilla::OriginAttributes& aOriginAttributes, uint16_t flags, nsresult aReason); - static nsresult CancelPrefetch(mozilla::dom::Link *aElement, uint16_t flags, + static nsresult CancelPrefetch(mozilla::dom::Link* aElement, uint16_t flags, nsresult aReason); public: @@ -103,7 +103,7 @@ class nsHTMLDNSPrefetch { nsDeferrals(); void Activate(); - nsresult Add(uint16_t flags, mozilla::dom::Link *aElement); + nsresult Add(uint16_t flags, mozilla::dom::Link* aElement); void RemoveUnboundLinks(); @@ -119,7 +119,7 @@ class nsHTMLDNSPrefetch { nsCOMPtr mTimer; bool mTimerArmed; - static void Tick(nsITimer *aTimer, void *aClosure); + static void Tick(nsITimer* aTimer, void* aClosure); static const int sMaxDeferred = 512; // keep power of 2 for masking static const int sMaxDeferredMask = (sMaxDeferred - 1); @@ -127,7 +127,7 @@ class nsHTMLDNSPrefetch { struct deferred_entry { uint16_t mFlags; // Link implementation clears this raw pointer in its destructor. - mozilla::dom::Link *mElement; + mozilla::dom::Link* mElement; } mEntries[sMaxDeferred]; }; diff --git a/dom/html/nsIHTMLDocument.h b/dom/html/nsIHTMLDocument.h index 11c50568ccf63..3275a818eb82a 100644 --- a/dom/html/nsIHTMLDocument.h +++ b/dom/html/nsIHTMLDocument.h @@ -61,7 +61,7 @@ class nsIHTMLDocument : public nsISupports { * @param aChange +1 if the contentEditable attribute/property was changed to * true, -1 if it was changed to false */ - virtual nsresult ChangeContentEditableCount(nsIContent *aElement, + virtual nsresult ChangeContentEditableCount(nsIContent* aElement, int32_t aChange) = 0; enum EditingState { diff --git a/dom/ipc/RemoteWebProgress.cpp b/dom/ipc/RemoteWebProgress.cpp index 3e6783b06cea6..b09c1edb89729 100644 --- a/dom/ipc/RemoteWebProgress.cpp +++ b/dom/ipc/RemoteWebProgress.cpp @@ -18,7 +18,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(RemoteWebProgress) NS_INTERFACE_MAP_ENTRY(nsIRemoteWebProgress) NS_INTERFACE_MAP_END -NS_IMETHODIMP RemoteWebProgress::Init(nsIWebProgress *aManager, +NS_IMETHODIMP RemoteWebProgress::Init(nsIWebProgress* aManager, bool aIsTopLevel) { mManager = aManager; mIsTopLevel = aIsTopLevel; @@ -39,7 +39,7 @@ NS_IMETHODIMP RemoteWebProgress::Update(uint64_t aOuterDOMWindowID, } NS_IMETHODIMP RemoteWebProgress::AddProgressListener( - nsIWebProgressListener *aListener, uint32_t aNotifyMask) { + nsIWebProgressListener* aListener, uint32_t aNotifyMask) { if (mManager) { return mManager->AddProgressListener(aListener, aNotifyMask); } else { @@ -50,7 +50,7 @@ NS_IMETHODIMP RemoteWebProgress::AddProgressListener( } NS_IMETHODIMP RemoteWebProgress::RemoveProgressListener( - nsIWebProgressListener *aListener) { + nsIWebProgressListener* aListener) { if (mManager) { return mManager->RemoveProgressListener(aListener); } else { @@ -60,45 +60,45 @@ NS_IMETHODIMP RemoteWebProgress::RemoveProgressListener( return NS_OK; } -NS_IMETHODIMP RemoteWebProgress::GetDOMWindow(mozIDOMWindowProxy **aDOMWindow) { +NS_IMETHODIMP RemoteWebProgress::GetDOMWindow(mozIDOMWindowProxy** aDOMWindow) { return NS_ERROR_NOT_AVAILABLE; } -NS_IMETHODIMP RemoteWebProgress::GetDOMWindowID(uint64_t *aDOMWindowID) { +NS_IMETHODIMP RemoteWebProgress::GetDOMWindowID(uint64_t* aDOMWindowID) { *aDOMWindowID = mOuterDOMWindowID; return NS_OK; } NS_IMETHODIMP RemoteWebProgress::GetInnerDOMWindowID( - uint64_t *aInnerDOMWindowID) { + uint64_t* aInnerDOMWindowID) { *aInnerDOMWindowID = mInnerDOMWindowID; return NS_OK; } -NS_IMETHODIMP RemoteWebProgress::GetIsTopLevel(bool *aIsTopLevel) { +NS_IMETHODIMP RemoteWebProgress::GetIsTopLevel(bool* aIsTopLevel) { NS_ENSURE_ARG_POINTER(aIsTopLevel); *aIsTopLevel = mIsTopLevel; return NS_OK; } NS_IMETHODIMP RemoteWebProgress::GetIsLoadingDocument( - bool *aIsLoadingDocument) { + bool* aIsLoadingDocument) { NS_ENSURE_ARG_POINTER(aIsLoadingDocument); *aIsLoadingDocument = mIsLoadingDocument; return NS_OK; } -NS_IMETHODIMP RemoteWebProgress::GetLoadType(uint32_t *aLoadType) { +NS_IMETHODIMP RemoteWebProgress::GetLoadType(uint32_t* aLoadType) { NS_ENSURE_ARG_POINTER(aLoadType); *aLoadType = mLoadType; return NS_OK; } -NS_IMETHODIMP RemoteWebProgress::GetTarget(nsIEventTarget **aTarget) { +NS_IMETHODIMP RemoteWebProgress::GetTarget(nsIEventTarget** aTarget) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgress::SetTarget(nsIEventTarget *aTarget) { +NS_IMETHODIMP RemoteWebProgress::SetTarget(nsIEventTarget* aTarget) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/dom/ipc/RemoteWebProgress.h b/dom/ipc/RemoteWebProgress.h index c6ee31549892b..365ac144a6f31 100644 --- a/dom/ipc/RemoteWebProgress.h +++ b/dom/ipc/RemoteWebProgress.h @@ -26,7 +26,7 @@ class RemoteWebProgress final : public nsIRemoteWebProgress { mIsLoadingDocument(false), mIsTopLevel(false) {} - RemoteWebProgress(nsIWebProgress *aManager, uint64_t aOuterDOMWindowID, + RemoteWebProgress(nsIWebProgress* aManager, uint64_t aOuterDOMWindowID, uint64_t aInnerDOMWindowID, uint32_t aLoadType, bool aIsLoadingDocument, bool aIsTopLevel) : mManager(aManager), diff --git a/dom/ipc/RemoteWebProgressRequest.cpp b/dom/ipc/RemoteWebProgressRequest.cpp index 2fec8c3dbed63..47945bfd2088f 100644 --- a/dom/ipc/RemoteWebProgressRequest.cpp +++ b/dom/ipc/RemoteWebProgressRequest.cpp @@ -10,8 +10,8 @@ namespace dom { NS_IMPL_ISUPPORTS(RemoteWebProgressRequest, nsIRequest, nsIChannel, nsIClassifiedChannel, nsIRemoteWebProgressRequest) -NS_IMETHODIMP RemoteWebProgressRequest::Init(nsIURI *aURI, nsIURI *aOriginalURI, - const nsACString &aMatchedList) { +NS_IMETHODIMP RemoteWebProgressRequest::Init(nsIURI* aURI, nsIURI* aOriginalURI, + const nsACString& aMatchedList) { mURI = aURI; mOriginalURI = aOriginalURI; mMatchedList = aMatchedList; @@ -21,67 +21,67 @@ NS_IMETHODIMP RemoteWebProgressRequest::Init(nsIURI *aURI, nsIURI *aOriginalURI, // nsIChannel methods -NS_IMETHODIMP RemoteWebProgressRequest::GetOriginalURI(nsIURI **aOriginalURI) { +NS_IMETHODIMP RemoteWebProgressRequest::GetOriginalURI(nsIURI** aOriginalURI) { NS_ENSURE_ARG_POINTER(aOriginalURI); NS_ADDREF(*aOriginalURI = mOriginalURI); return NS_OK; } -NS_IMETHODIMP RemoteWebProgressRequest::SetOriginalURI(nsIURI *aOriginalURI) { +NS_IMETHODIMP RemoteWebProgressRequest::SetOriginalURI(nsIURI* aOriginalURI) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::GetURI(nsIURI **aURI) { +NS_IMETHODIMP RemoteWebProgressRequest::GetURI(nsIURI** aURI) { NS_ENSURE_ARG_POINTER(aURI); NS_ADDREF(*aURI = mURI); return NS_OK; } -NS_IMETHODIMP RemoteWebProgressRequest::GetOwner(nsISupports **aOwner) { +NS_IMETHODIMP RemoteWebProgressRequest::GetOwner(nsISupports** aOwner) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::SetOwner(nsISupports *aOwner) { +NS_IMETHODIMP RemoteWebProgressRequest::SetOwner(nsISupports* aOwner) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetNotificationCallbacks( - nsIInterfaceRequestor **aNotificationCallbacks) { + nsIInterfaceRequestor** aNotificationCallbacks) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::SetNotificationCallbacks( - nsIInterfaceRequestor *aNotificationCallbacks) { + nsIInterfaceRequestor* aNotificationCallbacks) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetSecurityInfo( - nsISupports **aSecurityInfo) { + nsISupports** aSecurityInfo) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetContentType( - nsACString &aContentType) { + nsACString& aContentType) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::SetContentType( - const nsACString &aContentType) { + const nsACString& aContentType) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetContentCharset( - nsACString &aContentCharset) { + nsACString& aContentCharset) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::SetContentCharset( - const nsACString &aContentCharset) { + const nsACString& aContentCharset) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetContentLength( - int64_t *aContentLength) { + int64_t* aContentLength) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -90,17 +90,17 @@ NS_IMETHODIMP RemoteWebProgressRequest::SetContentLength( return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::Open(nsIInputStream **_retval) { +NS_IMETHODIMP RemoteWebProgressRequest::Open(nsIInputStream** _retval) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::AsyncOpen( - nsIStreamListener *aListener) { + nsIStreamListener* aListener) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetContentDisposition( - uint32_t *aContentDisposition) { + uint32_t* aContentDisposition) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -110,53 +110,53 @@ NS_IMETHODIMP RemoteWebProgressRequest::SetContentDisposition( } NS_IMETHODIMP RemoteWebProgressRequest::GetContentDispositionFilename( - nsAString &aContentDispositionFilename) { + nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::SetContentDispositionFilename( - const nsAString &aContentDispositionFilename) { + const nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetContentDispositionHeader( - nsACString &aContentDispositionHeader) { + nsACString& aContentDispositionHeader) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::GetLoadInfo(nsILoadInfo **aLoadInfo) { +NS_IMETHODIMP RemoteWebProgressRequest::GetLoadInfo(nsILoadInfo** aLoadInfo) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::SetLoadInfo(nsILoadInfo *aLoadInfo) { +NS_IMETHODIMP RemoteWebProgressRequest::SetLoadInfo(nsILoadInfo* aLoadInfo) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::GetIsDocument(bool *aIsDocument) { +NS_IMETHODIMP RemoteWebProgressRequest::GetIsDocument(bool* aIsDocument) { return NS_ERROR_NOT_IMPLEMENTED; } // nsIClassifiedChannel methods NS_IMETHODIMP RemoteWebProgressRequest::SetMatchedInfo( - const nsACString &aList, const nsACString &aProvider, - const nsACString &aFullHash) { + const nsACString& aList, const nsACString& aProvider, + const nsACString& aFullHash) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedList( - nsACString &aMatchedList) { + nsACString& aMatchedList) { aMatchedList = mMatchedList; return NS_OK; } NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedProvider( - nsACString &aMatchedProvider) { + nsACString& aMatchedProvider) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedFullHash( - nsACString &aMatchedFullHash) { + nsACString& aMatchedFullHash) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -176,15 +176,15 @@ NS_IMETHODIMP RemoteWebProgressRequest::GetMatchedTrackingFullHashes( } // nsIRequest methods -NS_IMETHODIMP RemoteWebProgressRequest::GetName(nsACString &aName) { +NS_IMETHODIMP RemoteWebProgressRequest::GetName(nsACString& aName) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::IsPending(bool *_retval) { +NS_IMETHODIMP RemoteWebProgressRequest::IsPending(bool* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::GetStatus(nsresult *aStatus) { +NS_IMETHODIMP RemoteWebProgressRequest::GetStatus(nsresult* aStatus) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -201,15 +201,15 @@ NS_IMETHODIMP RemoteWebProgressRequest::Resume(void) { } NS_IMETHODIMP RemoteWebProgressRequest::GetLoadGroup( - nsILoadGroup **aLoadGroup) { + nsILoadGroup** aLoadGroup) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::SetLoadGroup(nsILoadGroup *aLoadGroup) { +NS_IMETHODIMP RemoteWebProgressRequest::SetLoadGroup(nsILoadGroup* aLoadGroup) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP RemoteWebProgressRequest::GetLoadFlags(nsLoadFlags *aLoadFlags) { +NS_IMETHODIMP RemoteWebProgressRequest::GetLoadFlags(nsLoadFlags* aLoadFlags) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/dom/media/AudioCompactor.cpp b/dom/media/AudioCompactor.cpp index faf0693784eca..54e723d55ef7d 100644 --- a/dom/media/AudioCompactor.cpp +++ b/dom/media/AudioCompactor.cpp @@ -42,7 +42,7 @@ uint32_t AudioCompactor::GetChunkSamples(uint32_t aFrames, uint32_t aChannels, return chunkSize / sizeof(AudioDataValue); } -uint32_t AudioCompactor::NativeCopy::operator()(AudioDataValue *aBuffer, +uint32_t AudioCompactor::NativeCopy::operator()(AudioDataValue* aBuffer, uint32_t aSamples) { NS_ASSERTION(aBuffer, "cannot copy to null buffer pointer"); NS_ASSERTION(aSamples, "cannot copy zero values"); diff --git a/dom/media/gtest/TestAudioCompactor.cpp b/dom/media/gtest/TestAudioCompactor.cpp index 563b10e9bda88..69d9f54cc551f 100644 --- a/dom/media/gtest/TestAudioCompactor.cpp +++ b/dom/media/gtest/TestAudioCompactor.cpp @@ -17,8 +17,8 @@ class MemoryFunctor : public nsDequeFunctor { MemoryFunctor() : mSize(0) {} MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf); - void operator()(void *aObject) override { - const AudioData *audioData = static_cast(aObject); + void operator()(void* aObject) override { + const AudioData* audioData = static_cast(aObject); mSize += audioData->SizeOfIncludingThis(MallocSizeOf); } @@ -27,14 +27,14 @@ class MemoryFunctor : public nsDequeFunctor { class TestCopy { public: - TestCopy(uint32_t aFrames, uint32_t aChannels, uint32_t &aCallCount, - uint32_t &aFrameCount) + TestCopy(uint32_t aFrames, uint32_t aChannels, uint32_t& aCallCount, + uint32_t& aFrameCount) : mFrames(aFrames), mChannels(aChannels), mCallCount(aCallCount), mFrameCount(aFrameCount) {} - uint32_t operator()(AudioDataValue *aBuffer, uint32_t aSamples) { + uint32_t operator()(AudioDataValue* aBuffer, uint32_t aSamples) { mCallCount += 1; uint32_t frames = std::min(mFrames - mFrameCount, aSamples / mChannels); mFrameCount += frames; @@ -44,8 +44,8 @@ class TestCopy { private: const uint32_t mFrames; const uint32_t mChannels; - uint32_t &mCallCount; - uint32_t &mFrameCount; + uint32_t& mCallCount; + uint32_t& mFrameCount; }; static void TestAudioCompactor(size_t aBytes) { diff --git a/dom/media/platforms/ffmpeg/FFmpegRDFTTypes.h b/dom/media/platforms/ffmpeg/FFmpegRDFTTypes.h index f2cc10e56c513..cb3e2476fbad7 100644 --- a/dom/media/platforms/ffmpeg/FFmpegRDFTTypes.h +++ b/dom/media/platforms/ffmpeg/FFmpegRDFTTypes.h @@ -20,9 +20,9 @@ enum RDFTransformType { extern "C" { -typedef RDFTContext *(*AvRdftInitFn)(int nbits, enum RDFTransformType trans); -typedef void (*AvRdftCalcFn)(RDFTContext *s, FFTSample *data); -typedef void (*AvRdftEndFn)(RDFTContext *s); +typedef RDFTContext* (*AvRdftInitFn)(int nbits, enum RDFTransformType trans); +typedef void (*AvRdftCalcFn)(RDFTContext* s, FFTSample* data); +typedef void (*AvRdftEndFn)(RDFTContext* s); } struct FFmpegRDFTFuncs { diff --git a/dom/media/platforms/wmf/WMF.h b/dom/media/platforms/wmf/WMF.h index 2add8dfe0b55c..36db75fac5be8 100644 --- a/dom/media/platforms/wmf/WMF.h +++ b/dom/media/platforms/wmf/WMF.h @@ -58,29 +58,29 @@ HRESULT MFShutdown(); // All functions below are wrappers around the corresponding WMF function, // and automatically locate and call the corresponding function in the WMF DLLs. -HRESULT MFCreateMediaType(IMFMediaType **aOutMFType); +HRESULT MFCreateMediaType(IMFMediaType** aOutMFType); HRESULT MFGetStrideForBitmapInfoHeader(DWORD aFormat, DWORD aWidth, - LONG *aOutStride); + LONG* aOutStride); -HRESULT MFGetService(IUnknown *punkObject, REFGUID guidService, REFIID riid, - LPVOID *ppvObject); +HRESULT MFGetService(IUnknown* punkObject, REFGUID guidService, REFIID riid, + LPVOID* ppvObject); HRESULT DXVA2CreateDirect3DDeviceManager9( - UINT *pResetToken, IDirect3DDeviceManager9 **ppDXVAManager); + UINT* pResetToken, IDirect3DDeviceManager9** ppDXVAManager); -HRESULT MFCreateDXGIDeviceManager(UINT *pResetToken, - IMFDXGIDeviceManager **ppDXVAManager); +HRESULT MFCreateDXGIDeviceManager(UINT* pResetToken, + IMFDXGIDeviceManager** ppDXVAManager); -HRESULT MFCreateSample(IMFSample **ppIMFSample); +HRESULT MFCreateSample(IMFSample** ppIMFSample); HRESULT MFCreateAlignedMemoryBuffer(DWORD cbMaxLength, DWORD fAlignmentFlags, - IMFMediaBuffer **ppBuffer); + IMFMediaBuffer** ppBuffer); -HRESULT MFCreateDXGISurfaceBuffer(REFIID riid, IUnknown *punkSurface, +HRESULT MFCreateDXGISurfaceBuffer(REFIID riid, IUnknown* punkSurface, UINT uSubresourceIndex, BOOL fButtomUpWhenLinear, - IMFMediaBuffer **ppBuffer); + IMFMediaBuffer** ppBuffer); } // end namespace wmf } // end namespace mozilla diff --git a/dom/media/systemservices/OpenSLESProvider.cpp b/dom/media/systemservices/OpenSLESProvider.cpp index ba2fdcbd93f76..339fb44f86a4e 100644 --- a/dom/media/systemservices/OpenSLESProvider.cpp +++ b/dom/media/systemservices/OpenSLESProvider.cpp @@ -39,7 +39,7 @@ OpenSLESProvider::~OpenSLESProvider() { } /* static */ -OpenSLESProvider &OpenSLESProvider::getInstance() { +OpenSLESProvider& OpenSLESProvider::getInstance() { // This doesn't need a Mutex in C++11 or GCC 4.3+, see N2660 and // https://gcc.gnu.org/projects/cxx0x.html static OpenSLESProvider instance; @@ -47,15 +47,15 @@ OpenSLESProvider &OpenSLESProvider::getInstance() { } /* static */ -SLresult OpenSLESProvider::Get(SLObjectItf *aObjectm, SLuint32 aOptionCount, - const SLEngineOption *aOptions) { - OpenSLESProvider &provider = OpenSLESProvider::getInstance(); +SLresult OpenSLESProvider::Get(SLObjectItf* aObjectm, SLuint32 aOptionCount, + const SLEngineOption* aOptions) { + OpenSLESProvider& provider = OpenSLESProvider::getInstance(); return provider.GetEngine(aObjectm, aOptionCount, aOptions); } -SLresult OpenSLESProvider::GetEngine(SLObjectItf *aObjectm, +SLresult OpenSLESProvider::GetEngine(SLObjectItf* aObjectm, SLuint32 aOptionCount, - const SLEngineOption *aOptions) { + const SLEngineOption* aOptions) { MutexAutoLock lock(mLock); LOG(("Getting OpenSLES engine")); // Bug 1042051: Validate options are the same @@ -78,9 +78,9 @@ SLresult OpenSLESProvider::GetEngine(SLObjectItf *aObjectm, } } -SLresult OpenSLESProvider::ConstructEngine(SLObjectItf *aObjectm, +SLresult OpenSLESProvider::ConstructEngine(SLObjectItf* aObjectm, SLuint32 aOptionCount, - const SLEngineOption *aOptions) { + const SLEngineOption* aOptions) { mLock.AssertCurrentThreadOwns(); if (!mOpenSLESLib) { @@ -91,9 +91,9 @@ SLresult OpenSLESProvider::ConstructEngine(SLObjectItf *aObjectm, } } - typedef SLresult (*slCreateEngine_t)( - SLObjectItf *, SLuint32, const SLEngineOption *, SLuint32, - const SLInterfaceID *, const SLboolean *); + typedef SLresult (*slCreateEngine_t)(SLObjectItf*, SLuint32, + const SLEngineOption*, SLuint32, + const SLInterfaceID*, const SLboolean*); slCreateEngine_t f_slCreateEngine = (slCreateEngine_t)dlsym(mOpenSLESLib, "slCreateEngine"); @@ -103,12 +103,12 @@ SLresult OpenSLESProvider::ConstructEngine(SLObjectItf *aObjectm, } /* static */ -void OpenSLESProvider::Destroy(SLObjectItf *aObjectm) { - OpenSLESProvider &provider = OpenSLESProvider::getInstance(); +void OpenSLESProvider::Destroy(SLObjectItf* aObjectm) { + OpenSLESProvider& provider = OpenSLESProvider::getInstance(); provider.DestroyEngine(aObjectm); } -void OpenSLESProvider::DestroyEngine(SLObjectItf *aObjectm) { +void OpenSLESProvider::DestroyEngine(SLObjectItf* aObjectm) { MutexAutoLock lock(mLock); NS_ASSERTION(mOpenSLESLib, "OpenSLES destroy called but library is not open"); @@ -130,7 +130,7 @@ void OpenSLESProvider::DestroyEngine(SLObjectItf *aObjectm) { /* static */ SLresult OpenSLESProvider::Realize(SLObjectItf aObjectm) { - OpenSLESProvider &provider = OpenSLESProvider::getInstance(); + OpenSLESProvider& provider = OpenSLESProvider::getInstance(); return provider.RealizeEngine(aObjectm); } @@ -159,12 +159,12 @@ SLresult OpenSLESProvider::RealizeEngine(SLObjectItf aObjectm) { } // namespace mozilla extern "C" { -SLresult mozilla_get_sles_engine(SLObjectItf *aObjectm, SLuint32 aOptionCount, - const SLEngineOption *aOptions) { +SLresult mozilla_get_sles_engine(SLObjectItf* aObjectm, SLuint32 aOptionCount, + const SLEngineOption* aOptions) { return mozilla::OpenSLESProvider::Get(aObjectm, aOptionCount, aOptions); } -void mozilla_destroy_sles_engine(SLObjectItf *aObjectm) { +void mozilla_destroy_sles_engine(SLObjectItf* aObjectm) { mozilla::OpenSLESProvider::Destroy(aObjectm); } diff --git a/dom/media/systemservices/OpenSLESProvider.h b/dom/media/systemservices/OpenSLESProvider.h index b03ee5e795f43..f1f5a7e4defe6 100644 --- a/dom/media/systemservices/OpenSLESProvider.h +++ b/dom/media/systemservices/OpenSLESProvider.h @@ -13,9 +13,9 @@ extern "C" { #endif extern MOZ_EXPORT SLresult -mozilla_get_sles_engine(SLObjectItf *aObjectm, SLuint32 aOptionCount, - const SLEngineOption *aOptions); -extern MOZ_EXPORT void mozilla_destroy_sles_engine(SLObjectItf *aObjectm); +mozilla_get_sles_engine(SLObjectItf* aObjectm, SLuint32 aOptionCount, + const SLEngineOption* aOptions); +extern MOZ_EXPORT void mozilla_destroy_sles_engine(SLObjectItf* aObjectm); /* Realize is always in synchronous mode. */ extern MOZ_EXPORT SLresult mozilla_realize_sles_engine(SLObjectItf aObjectm); #ifdef __cplusplus @@ -31,30 +31,30 @@ namespace mozilla { class OpenSLESProvider { public: - static SLresult Get(SLObjectItf *aObjectm, SLuint32 aOptionCount, - const SLEngineOption *aOptions); - static void Destroy(SLObjectItf *aObjectm); + static SLresult Get(SLObjectItf* aObjectm, SLuint32 aOptionCount, + const SLEngineOption* aOptions); + static void Destroy(SLObjectItf* aObjectm); static SLresult Realize(SLObjectItf aObjectm); private: OpenSLESProvider(); ~OpenSLESProvider(); - OpenSLESProvider(OpenSLESProvider const &); // NO IMPLEMENTATION - void operator=(OpenSLESProvider const &); // NO IMPLEMENTATION - static OpenSLESProvider &getInstance(); - SLresult GetEngine(SLObjectItf *aObjectm, SLuint32 aOptionCount, - const SLEngineOption *aOptions); - SLresult ConstructEngine(SLObjectItf *aObjectm, SLuint32 aOptionCount, - const SLEngineOption *aOptions); + OpenSLESProvider(OpenSLESProvider const&); // NO IMPLEMENTATION + void operator=(OpenSLESProvider const&); // NO IMPLEMENTATION + static OpenSLESProvider& getInstance(); + SLresult GetEngine(SLObjectItf* aObjectm, SLuint32 aOptionCount, + const SLEngineOption* aOptions); + SLresult ConstructEngine(SLObjectItf* aObjectm, SLuint32 aOptionCount, + const SLEngineOption* aOptions); SLresult RealizeEngine(SLObjectItf aObjectm); - void DestroyEngine(SLObjectItf *aObjectm); + void DestroyEngine(SLObjectItf* aObjectm); // Protect all our internal variables mozilla::Mutex mLock; SLObjectItf mSLEngine; int mSLEngineUsers; bool mIsRealized; - void *mOpenSLESLib; + void* mOpenSLESLib; }; } // namespace mozilla diff --git a/dom/media/systemservices/video_engine/platform_uithread.cc b/dom/media/systemservices/video_engine/platform_uithread.cc index 3f0e99ef672ec..eab3aa38e6ee0 100644 --- a/dom/media/systemservices/video_engine/platform_uithread.cc +++ b/dom/media/systemservices/video_engine/platform_uithread.cc @@ -132,8 +132,8 @@ LRESULT CALLBACK PlatformUIThread::EventWindowProc(HWND hwnd, UINT uMsg, return 0; } - PlatformUIThread *twui = - static_cast(GetPropW(hwnd, kThisProperty)); + PlatformUIThread* twui = + static_cast(GetPropW(hwnd, kThisProperty)); if (!twui) { return DefWindowProc(hwnd, uMsg, wParam, lParam); } diff --git a/dom/media/webaudio/blink/ZeroPole.cpp b/dom/media/webaudio/blink/ZeroPole.cpp index c59334ba8415f..4d0888d758f4b 100644 --- a/dom/media/webaudio/blink/ZeroPole.cpp +++ b/dom/media/webaudio/blink/ZeroPole.cpp @@ -35,7 +35,7 @@ namespace WebCore { -void ZeroPole::process(const float *source, float *destination, +void ZeroPole::process(const float* source, float* destination, int framesToProcess) { float zero = m_zero; float pole = m_pole; diff --git a/dom/media/webaudio/blink/ZeroPole.h b/dom/media/webaudio/blink/ZeroPole.h index 26c0e003474bf..07f3f04f53b9f 100644 --- a/dom/media/webaudio/blink/ZeroPole.h +++ b/dom/media/webaudio/blink/ZeroPole.h @@ -37,7 +37,7 @@ class ZeroPole { public: ZeroPole() : m_zero(0), m_pole(0), m_lastX(0), m_lastY(0) {} - void process(const float *source, float *destination, int framesToProcess); + void process(const float* source, float* destination, int framesToProcess); // Reset filter state. void reset() { diff --git a/dom/plugins/base/npruntime.h b/dom/plugins/base/npruntime.h index 306e44fcbc55b..a2c4fa1597a90 100644 --- a/dom/plugins/base/npruntime.h +++ b/dom/plugins/base/npruntime.h @@ -85,7 +85,7 @@ typedef struct NPClass NPClass; typedef char NPUTF8; typedef struct _NPString { - const NPUTF8 *UTF8Characters; + const NPUTF8* UTF8Characters; uint32_t UTF8Length; } NPString; @@ -106,7 +106,7 @@ typedef struct _NPVariant { int32_t intValue; double doubleValue; NPString stringValue; - NPObject *objectValue; + NPObject* objectValue; } value; } NPVariant; @@ -120,7 +120,7 @@ typedef struct _NPVariant { After calling NPN_ReleaseVariantValue, the type of the variant will be NPVariantType_Void. */ -void NPN_ReleaseVariantValue(NPVariant *variant); +void NPN_ReleaseVariantValue(NPVariant* variant); #define NPVARIANT_IS_VOID(_v) ((_v).type == NPVariantType_Void) #define NPVARIANT_IS_NULL(_v) ((_v).type == NPVariantType_Null) @@ -200,7 +200,7 @@ void NPN_ReleaseVariantValue(NPVariant *variant); NPVariantType_Object Object */ -typedef void *NPIdentifier; +typedef void* NPIdentifier; /* NPObjects have methods and properties. Methods and properties are @@ -213,16 +213,16 @@ typedef void *NPIdentifier; by the browser. Plugins do not need to worry about memory management with regards to NPIdentifiers. */ -NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name); -void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, - NPIdentifier *identifiers); +NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name); +void NPN_GetStringIdentifiers(const NPUTF8** names, int32_t nameCount, + NPIdentifier* identifiers); NPIdentifier NPN_GetIntIdentifier(int32_t intid); bool NPN_IdentifierIsString(NPIdentifier identifier); /* The NPUTF8 returned from NPN_UTF8FromIdentifier SHOULD be freed. */ -NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier); +NPUTF8* NPN_UTF8FromIdentifier(NPIdentifier identifier); /* Get the integer represented by identifier. If identifier is not an @@ -237,27 +237,27 @@ int32_t NPN_IntFromIdentifier(NPIdentifier identifier); The NPVariant *result argument of these functions (where applicable) should be released using NPN_ReleaseVariantValue(). */ -typedef NPObject *(*NPAllocateFunctionPtr)(NPP npp, NPClass *aClass); -typedef void (*NPDeallocateFunctionPtr)(NPObject *npobj); -typedef void (*NPInvalidateFunctionPtr)(NPObject *npobj); -typedef bool (*NPHasMethodFunctionPtr)(NPObject *npobj, NPIdentifier name); -typedef bool (*NPInvokeFunctionPtr)(NPObject *npobj, NPIdentifier name, - const NPVariant *args, uint32_t argCount, - NPVariant *result); -typedef bool (*NPInvokeDefaultFunctionPtr)(NPObject *npobj, - const NPVariant *args, +typedef NPObject* (*NPAllocateFunctionPtr)(NPP npp, NPClass* aClass); +typedef void (*NPDeallocateFunctionPtr)(NPObject* npobj); +typedef void (*NPInvalidateFunctionPtr)(NPObject* npobj); +typedef bool (*NPHasMethodFunctionPtr)(NPObject* npobj, NPIdentifier name); +typedef bool (*NPInvokeFunctionPtr)(NPObject* npobj, NPIdentifier name, + const NPVariant* args, uint32_t argCount, + NPVariant* result); +typedef bool (*NPInvokeDefaultFunctionPtr)(NPObject* npobj, + const NPVariant* args, uint32_t argCount, - NPVariant *result); -typedef bool (*NPHasPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name); -typedef bool (*NPGetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name, - NPVariant *result); -typedef bool (*NPSetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name, - const NPVariant *value); -typedef bool (*NPRemovePropertyFunctionPtr)(NPObject *npobj, NPIdentifier name); -typedef bool (*NPEnumerationFunctionPtr)(NPObject *npobj, NPIdentifier **value, - uint32_t *count); -typedef bool (*NPConstructFunctionPtr)(NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result); + NPVariant* result); +typedef bool (*NPHasPropertyFunctionPtr)(NPObject* npobj, NPIdentifier name); +typedef bool (*NPGetPropertyFunctionPtr)(NPObject* npobj, NPIdentifier name, + NPVariant* result); +typedef bool (*NPSetPropertyFunctionPtr)(NPObject* npobj, NPIdentifier name, + const NPVariant* value); +typedef bool (*NPRemovePropertyFunctionPtr)(NPObject* npobj, NPIdentifier name); +typedef bool (*NPEnumerationFunctionPtr)(NPObject* npobj, NPIdentifier** value, + uint32_t* count); +typedef bool (*NPConstructFunctionPtr)(NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result); /* NPObjects returned by create, retain, invoke, and getProperty pass @@ -310,7 +310,7 @@ struct NPClass { ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_CTOR) struct NPObject { - NPClass *_class; + NPClass* _class; uint32_t referenceCount; /* * Additional space may be allocated here by types of NPObjects @@ -323,19 +323,19 @@ struct NPObject { returned. This method will initialize the referenceCount member of the NPObject to 1. */ -NPObject *NPN_CreateObject(NPP npp, NPClass *aClass); +NPObject* NPN_CreateObject(NPP npp, NPClass* aClass); /* Increment the NPObject's reference count. */ -NPObject *NPN_RetainObject(NPObject *npobj); +NPObject* NPN_RetainObject(NPObject* npobj); /* Decremented the NPObject's reference count. If the reference count goes to zero, the class's destroy function is invoke if specified, otherwise the object is freed directly. */ -void NPN_ReleaseObject(NPObject *npobj); +void NPN_ReleaseObject(NPObject* npobj); /* Functions to access script objects represented by NPObject. @@ -349,23 +349,23 @@ void NPN_ReleaseObject(NPObject *npobj); on which the plugin was initialized. */ -bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, - const NPVariant *args, uint32_t argCount, NPVariant *result); -bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result); -bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, - NPVariant *result); -bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, - NPVariant *result); -bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, - const NPVariant *value); -bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName); -bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName); -bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName); -bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, - uint32_t *count); -bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result); +bool NPN_Invoke(NPP npp, NPObject* npobj, NPIdentifier methodName, + const NPVariant* args, uint32_t argCount, NPVariant* result); +bool NPN_InvokeDefault(NPP npp, NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result); +bool NPN_Evaluate(NPP npp, NPObject* npobj, NPString* script, + NPVariant* result); +bool NPN_GetProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName, + NPVariant* result); +bool NPN_SetProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName, + const NPVariant* value); +bool NPN_RemoveProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName); +bool NPN_HasProperty(NPP npp, NPObject* npobj, NPIdentifier propertyName); +bool NPN_HasMethod(NPP npp, NPObject* npobj, NPIdentifier methodName); +bool NPN_Enumerate(NPP npp, NPObject* npobj, NPIdentifier** identifier, + uint32_t* count); +bool NPN_Construct(NPP npp, NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result); /* NPN_SetException may be called to trigger a script exception upon @@ -373,7 +373,7 @@ bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, NPN_SetException (npobj, message); */ -void NPN_SetException(NPObject *npobj, const NPUTF8 *message); +void NPN_SetException(NPObject* npobj, const NPUTF8* message); #ifdef __cplusplus } diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 1cddc619a546a..8a2a6e34cdbb9 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -45,22 +45,22 @@ struct JSObjWrapperHasher { typedef nsJSObjWrapperKey Key; typedef Key Lookup; - static uint32_t hash(const Lookup &l) { - return js::MovableCellHasher>::hash(l.mJSObj) ^ + static uint32_t hash(const Lookup& l) { + return js::MovableCellHasher>::hash(l.mJSObj) ^ HashGeneric(l.mNpp); } - static bool match(const Key &k, const Lookup &l) { - return js::MovableCellHasher>::match(k.mJSObj, - l.mJSObj) && + static bool match(const Key& k, const Lookup& l) { + return js::MovableCellHasher>::match(k.mJSObj, + l.mJSObj) && k.mNpp == l.mNpp; } }; namespace JS { template <> -struct GCPolicy { - static void trace(JSTracer *trc, nsJSObjWrapper **wrapper, const char *name) { +struct GCPolicy { + static void trace(JSTracer* trc, nsJSObjWrapper** wrapper, const char* name) { MOZ_ASSERT(wrapper); MOZ_ASSERT(*wrapper); (*wrapper)->trace(trc); @@ -74,8 +74,8 @@ struct GCPolicy { class NPObjWrapperHashEntry : public PLDHashEntryHdr { public: - NPObject *mNPObj; // Must be the first member for the PLDHash stubs to work - JS::TenuredHeap mJSObj; + NPObject* mNPObj; // Must be the first member for the PLDHash stubs to work + JS::TenuredHeap mJSObj; NPP mNpp; }; @@ -86,7 +86,7 @@ class NPObjWrapperHashEntry : public PLDHashEntryHdr { // when a plugin is torn down in case there's a leak in the plugin (we // don't want to leak the world just because a plugin leaks an // NPObject). -typedef JS::GCHashMap JSObjWrapperTable; static UniquePtr sJSObjWrappers; @@ -96,7 +96,7 @@ static UniquePtr sJSObjWrappers; static bool sJSObjWrappersAccessible = false; // Hash of NPObject wrappers that wrap NPObjects as JSObjects. -static PLDHashTable *sNPObjWrappers; +static PLDHashTable* sNPObjWrappers; // Global wrapper count. This includes JSObject wrappers *and* // NPObject wrappers. When this count goes to zero, there are no more @@ -105,11 +105,11 @@ static int32_t sWrapperCount; static bool sCallbackIsRegistered = false; -static nsTArray *sDelayedReleases; +static nsTArray* sDelayedReleases; namespace { -inline bool NPObjectIsOutOfProcessProxy(NPObject *obj) { +inline bool NPObjectIsOutOfProcessProxy(NPObject* obj) { return obj->_class == PluginScriptableObjectParent::GetClass(); } @@ -123,7 +123,7 @@ inline bool NPObjectIsOutOfProcessProxy(NPObject *obj) { class MOZ_STACK_CLASS AutoJSExceptionSuppressor { public: - AutoJSExceptionSuppressor(dom::AutoEntryScript &aes, nsJSObjWrapper *aWrapper) + AutoJSExceptionSuppressor(dom::AutoEntryScript& aes, nsJSObjWrapper* aWrapper) : mAes(aes), mIsDestroyPending(aWrapper->mDestroyPending) {} ~AutoJSExceptionSuppressor() { @@ -133,7 +133,7 @@ class MOZ_STACK_CLASS AutoJSExceptionSuppressor { } protected: - dom::AutoEntryScript &mAes; + dom::AutoEntryScript& mAes; bool mIsDestroyPending; }; @@ -154,105 +154,105 @@ class NPObjWrapperProxyHandler : public js::BaseProxyHandler { constexpr NPObjWrapperProxyHandler() : BaseProxyHandler(&family) {} - bool defineProperty(JSContext *cx, JS::Handle proxy, + bool defineProperty(JSContext* cx, JS::Handle proxy, JS::Handle id, JS::Handle desc, - JS::ObjectOpResult &result) const override { + JS::ObjectOpResult& result) const override { ::JS_ReportErrorASCII(cx, "Trying to add unsupported property on NPObject!"); return false; } bool getPrototypeIfOrdinary( - JSContext *cx, JS::Handle proxy, bool *isOrdinary, - JS::MutableHandle proto) const override { + JSContext* cx, JS::Handle proxy, bool* isOrdinary, + JS::MutableHandle proto) const override { *isOrdinary = true; proto.set(js::GetStaticPrototype(proxy)); return true; } - bool isExtensible(JSContext *cx, JS::Handle proxy, - bool *extensible) const override { + bool isExtensible(JSContext* cx, JS::Handle proxy, + bool* extensible) const override { // Needs to be extensible so nsObjectLoadingContent can mutate our // __proto__. *extensible = true; return true; } - bool preventExtensions(JSContext *cx, JS::Handle proxy, - JS::ObjectOpResult &result) const override { + bool preventExtensions(JSContext* cx, JS::Handle proxy, + JS::ObjectOpResult& result) const override { result.succeed(); return true; } bool getOwnPropertyDescriptor( - JSContext *cx, JS::Handle proxy, JS::Handle id, + JSContext* cx, JS::Handle proxy, JS::Handle id, JS::MutableHandle desc) const override; - bool ownPropertyKeys(JSContext *cx, JS::Handle proxy, + bool ownPropertyKeys(JSContext* cx, JS::Handle proxy, JS::MutableHandleVector properties) const override; - bool delete_(JSContext *cx, JS::Handle proxy, JS::Handle id, - JS::ObjectOpResult &result) const override; + bool delete_(JSContext* cx, JS::Handle proxy, JS::Handle id, + JS::ObjectOpResult& result) const override; - bool get(JSContext *cx, JS::Handle proxy, + bool get(JSContext* cx, JS::Handle proxy, JS::Handle receiver, JS::Handle id, JS::MutableHandle vp) const override; - bool set(JSContext *cx, JS::Handle proxy, JS::Handle id, + bool set(JSContext* cx, JS::Handle proxy, JS::Handle id, JS::Handle vp, JS::Handle receiver, - JS::ObjectOpResult &result) const override; + JS::ObjectOpResult& result) const override; - bool isCallable(JSObject *obj) const override { return true; } - bool call(JSContext *cx, JS::Handle proxy, - const JS::CallArgs &args) const override; + bool isCallable(JSObject* obj) const override { return true; } + bool call(JSContext* cx, JS::Handle proxy, + const JS::CallArgs& args) const override; - bool isConstructor(JSObject *obj) const override { return true; } - bool construct(JSContext *cx, JS::Handle proxy, - const JS::CallArgs &args) const override; + bool isConstructor(JSObject* obj) const override { return true; } + bool construct(JSContext* cx, JS::Handle proxy, + const JS::CallArgs& args) const override; - bool finalizeInBackground(const JS::Value &priv) const override { + bool finalizeInBackground(const JS::Value& priv) const override { return false; } - void finalize(JSFreeOp *fop, JSObject *proxy) const override; + void finalize(JSFreeOp* fop, JSObject* proxy) const override; - size_t objectMoved(JSObject *obj, JSObject *old) const override; + size_t objectMoved(JSObject* obj, JSObject* old) const override; }; const char NPObjWrapperProxyHandler::family = 0; const NPObjWrapperProxyHandler NPObjWrapperProxyHandler::singleton; -static bool NPObjWrapper_Resolve(JSContext *cx, JS::Handle obj, - JS::Handle id, bool *resolved, - JS::MutableHandle method); +static bool NPObjWrapper_Resolve(JSContext* cx, JS::Handle obj, + JS::Handle id, bool* resolved, + JS::MutableHandle method); -static bool NPObjWrapper_toPrimitive(JSContext *cx, unsigned argc, - JS::Value *vp); +static bool NPObjWrapper_toPrimitive(JSContext* cx, unsigned argc, + JS::Value* vp); -static bool CreateNPObjectMember(NPP npp, JSContext *cx, - JS::Handle obj, NPObject *npobj, +static bool CreateNPObjectMember(NPP npp, JSContext* cx, + JS::Handle obj, NPObject* npobj, JS::Handle id, - NPVariant *getPropertyResult, + NPVariant* getPropertyResult, JS::MutableHandle vp); const js::Class sNPObjWrapperProxyClass = PROXY_CLASS_DEF(NPRUNTIME_JSCLASS_NAME, JSCLASS_HAS_RESERVED_SLOTS(1)); typedef struct NPObjectMemberPrivate { - JS::Heap npobjWrapper; + JS::Heap npobjWrapper; JS::Heap fieldValue; JS::Heap methodName; NPP npp = nullptr; } NPObjectMemberPrivate; -static void NPObjectMember_Finalize(JSFreeOp *fop, JSObject *obj); +static void NPObjectMember_Finalize(JSFreeOp* fop, JSObject* obj); -static bool NPObjectMember_Call(JSContext *cx, unsigned argc, JS::Value *vp); +static bool NPObjectMember_Call(JSContext* cx, unsigned argc, JS::Value* vp); -static void NPObjectMember_Trace(JSTracer *trc, JSObject *obj); +static void NPObjectMember_Trace(JSTracer* trc, JSObject* obj); -static bool NPObjectMember_toPrimitive(JSContext *cx, unsigned argc, - JS::Value *vp); +static bool NPObjectMember_toPrimitive(JSContext* cx, unsigned argc, + JS::Value* vp); static const JSClassOps sNPObjectMemberClassOps = {nullptr, nullptr, @@ -273,7 +273,7 @@ static const JSClass sNPObjectMemberClass = { static void OnWrapperDestroyed(); -static void TraceJSObjWrappers(JSTracer *trc, void *data) { +static void TraceJSObjWrappers(JSTracer* trc, void* data) { if (sJSObjWrappers) { sJSObjWrappers->trace(trc); } @@ -283,12 +283,12 @@ static void DelayedReleaseGCCallback(JSGCStatus status) { if (JSGC_END == status) { // Take ownership of sDelayedReleases and null it out now. The // _releaseobject call below can reenter GC and double-free these objects. - nsAutoPtr> delayedReleases(sDelayedReleases); + nsAutoPtr> delayedReleases(sDelayedReleases); sDelayedReleases = nullptr; if (delayedReleases) { for (uint32_t i = 0; i < delayedReleases->Length(); ++i) { - NPObject *obj = (*delayedReleases)[i]; + NPObject* obj = (*delayedReleases)[i]; if (obj) _releaseobject(obj); OnWrapperDestroyed(); } @@ -302,7 +302,7 @@ static bool RegisterGCCallbacks() { } // Register a callback to trace wrapped JSObjects. - JSContext *cx = dom::danger::GetJSContext(); + JSContext* cx = dom::danger::GetJSContext(); if (!JS_AddExtraGCRootsTracer(cx, TraceJSObjWrappers, nullptr)) { return false; } @@ -320,7 +320,7 @@ static void UnregisterGCCallbacks() { MOZ_ASSERT(sCallbackIsRegistered); // Remove tracing callback. - JSContext *cx = dom::danger::GetJSContext(); + JSContext* cx = dom::danger::GetJSContext(); JS_RemoveExtraGCRootsTracer(cx, TraceJSObjWrappers, nullptr); // Remove delayed destruction callback. @@ -396,10 +396,10 @@ namespace mozilla { namespace plugins { namespace parent { -static nsIGlobalObject *GetGlobalObject(NPP npp) { +static nsIGlobalObject* GetGlobalObject(NPP npp) { NS_ENSURE_TRUE(npp, nullptr); - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; NS_ENSURE_TRUE(inst, nullptr); RefPtr owner = inst->GetOwner(); @@ -416,10 +416,10 @@ static nsIGlobalObject *GetGlobalObject(NPP npp) { } // namespace plugins } // namespace mozilla -static NPP LookupNPP(NPObject *npobj); +static NPP LookupNPP(NPObject* npobj); -static JS::Value NPVariantToJSVal(NPP npp, JSContext *cx, - const NPVariant *variant) { +static JS::Value NPVariantToJSVal(NPP npp, JSContext* cx, + const NPVariant* variant) { switch (variant->type) { case NPVariantType_Void: return JS::UndefinedValue(); @@ -436,10 +436,10 @@ static JS::Value NPVariantToJSVal(NPP npp, JSContext *cx, return ::JS_NumberValue(NPVARIANT_TO_DOUBLE(*variant)); } case NPVariantType_String: { - const NPString *s = &NPVARIANT_TO_STRING(*variant); + const NPString* s = &NPVARIANT_TO_STRING(*variant); NS_ConvertUTF8toUTF16 utf16String(s->UTF8Characters, s->UTF8Length); - JSString *str = + JSString* str = ::JS_NewUCStringCopyN(cx, utf16String.get(), utf16String.Length()); if (str) { @@ -450,7 +450,7 @@ static JS::Value NPVariantToJSVal(NPP npp, JSContext *cx, } case NPVariantType_Object: { if (npp) { - JSObject *obj = nsNPObjWrapper::GetNewOrUsed( + JSObject* obj = nsNPObjWrapper::GetNewOrUsed( npp, cx, NPVARIANT_TO_OBJECT(*variant)); if (obj) { @@ -471,8 +471,8 @@ static JS::Value NPVariantToJSVal(NPP npp, JSContext *cx, return JS::UndefinedValue(); } -bool JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value &val, - NPVariant *variant) { +bool JSValToNPVariant(NPP npp, JSContext* cx, const JS::Value& val, + NPVariant* variant) { NS_ASSERTION(npp, "Must have an NPP to wrap a jsval!"); if (val.isPrimitive()) { @@ -493,7 +493,7 @@ bool JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value &val, DOUBLE_TO_NPVARIANT(d, *variant); } } else if (val.isString()) { - JSString *jsstr = val.toString(); + JSString* jsstr = val.toString(); nsAutoJSString str; if (!str.init(cx, jsstr)) { @@ -501,7 +501,7 @@ bool JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value &val, } uint32_t len; - char *p = ToNewUTF8String(str, &len); + char* p = ToNewUTF8String(str, &len); if (!p) { return false; @@ -524,8 +524,8 @@ bool JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value &val, // we run with the original wrapped object, since sometimes there are // legitimate cases where a security wrapper ends up here (for example, // Location objects, which are _always_ behind security wrappers). - JS::Rooted obj(cx, &val.toObject()); - JS::Rooted global(cx); + JS::Rooted obj(cx, &val.toObject()); + JS::Rooted global(cx); // CheckedUnwrapStatic is fine here; if we get a Location or WindowProxy, // we'll just use the current global instead. obj = js::CheckedUnwrapStatic(obj); @@ -536,7 +536,7 @@ bool JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value &val, global = JS::CurrentGlobalOrNull(cx); } - NPObject *npobj = nsJSObjWrapper::GetNewOrUsed(npp, obj, global); + NPObject* npobj = nsJSObjWrapper::GetNewOrUsed(npp, obj, global); if (!npobj) { return false; } @@ -547,8 +547,8 @@ bool JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value &val, return true; } -static void ThrowJSExceptionASCII(JSContext *cx, const char *message) { - const char *ex = PeekException(); +static void ThrowJSExceptionASCII(JSContext* cx, const char* message) { + const char* ex = PeekException(); if (ex) { nsAutoString ucex; @@ -565,7 +565,7 @@ static void ThrowJSExceptionASCII(JSContext *cx, const char *message) { ucex.AppendLiteral("]."); } - JSString *str = ::JS_NewUCStringCopyN(cx, ucex.get(), ucex.Length()); + JSString* str = ::JS_NewUCStringCopyN(cx, ucex.get(), ucex.Length()); if (str) { JS::Rooted exn(cx, JS::StringValue(str)); @@ -578,8 +578,8 @@ static void ThrowJSExceptionASCII(JSContext *cx, const char *message) { } } -static bool ReportExceptionIfPending(JSContext *cx) { - const char *ex = PeekException(); +static bool ReportExceptionIfPending(JSContext* cx) { + const char* ex = PeekException(); if (!ex) { return true; @@ -609,7 +609,7 @@ nsJSObjWrapper::~nsJSObjWrapper() { } // static -NPObject *nsJSObjWrapper::NP_Allocate(NPP npp, NPClass *aClass) { +NPObject* nsJSObjWrapper::NP_Allocate(NPP npp, NPClass* aClass) { NS_ASSERTION(aClass == &sJSObjWrapperNPClass, "Huh, wrong class passed to NP_Allocate()!!!"); @@ -617,14 +617,14 @@ NPObject *nsJSObjWrapper::NP_Allocate(NPP npp, NPClass *aClass) { } // static -void nsJSObjWrapper::NP_Deallocate(NPObject *npobj) { +void nsJSObjWrapper::NP_Deallocate(NPObject* npobj) { // nsJSObjWrapper::~nsJSObjWrapper() will call NP_Invalidate(). - delete (nsJSObjWrapper *)npobj; + delete (nsJSObjWrapper*)npobj; } // static -void nsJSObjWrapper::NP_Invalidate(NPObject *npobj) { - nsJSObjWrapper *jsnpobj = (nsJSObjWrapper *)npobj; +void nsJSObjWrapper::NP_Invalidate(NPObject* npobj) { + nsJSObjWrapper* jsnpobj = (nsJSObjWrapper*)npobj; if (jsnpobj && jsnpobj->mJSObj) { if (sJSObjWrappersAccessible) { @@ -641,29 +641,29 @@ void nsJSObjWrapper::NP_Invalidate(NPObject *npobj) { } } -static bool GetProperty(JSContext *cx, JSObject *objArg, NPIdentifier npid, +static bool GetProperty(JSContext* cx, JSObject* objArg, NPIdentifier npid, JS::MutableHandle rval) { NS_ASSERTION(NPIdentifierIsInt(npid) || NPIdentifierIsString(npid), "id must be either string or int!\n"); - JS::Rooted obj(cx, objArg); + JS::Rooted obj(cx, objArg); JS::Rooted id(cx, NPIdentifierToJSId(npid)); return ::JS_GetPropertyById(cx, obj, id, rval); } -static void MarkCrossZoneNPIdentifier(JSContext *cx, NPIdentifier npid) { +static void MarkCrossZoneNPIdentifier(JSContext* cx, NPIdentifier npid) { JS_MarkCrossZoneId(cx, NPIdentifierToJSId(npid)); } // static -bool nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id) { +bool nsJSObjWrapper::NP_HasMethod(NPObject* npobj, NPIdentifier id) { NPP npp = NPPStack::Peek(); - nsIGlobalObject *globalObject = GetGlobalObject(npp); + nsIGlobalObject* globalObject = GetGlobalObject(npp); if (NS_WARN_IF(!globalObject)) { return false; } dom::AutoEntryScript aes(globalObject, "NPAPI HasMethod"); - JSContext *cx = aes.cx(); + JSContext* cx = aes.cx(); if (!npobj) { ThrowJSExceptionASCII(cx, "Null npobj in nsJSObjWrapper::NP_HasMethod!"); @@ -671,7 +671,7 @@ bool nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id) { return false; } - nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; + nsJSObjWrapper* npjsobj = (nsJSObjWrapper*)npobj; JSAutoRealm ar(cx, npjsobj->mJSObjGlobal); MarkCrossZoneNPIdentifier(cx, id); @@ -684,9 +684,9 @@ bool nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id) { return ok && !v.isPrimitive() && ::JS_ObjectIsFunction(v.toObjectOrNull()); } -static bool doInvoke(NPObject *npobj, NPIdentifier method, - const NPVariant *args, uint32_t argCount, bool ctorCall, - NPVariant *result) { +static bool doInvoke(NPObject* npobj, NPIdentifier method, + const NPVariant* args, uint32_t argCount, bool ctorCall, + NPVariant* result) { NPP npp = NPPStack::Peek(); nsCOMPtr globalObject = GetGlobalObject(npp); @@ -697,7 +697,7 @@ static bool doInvoke(NPObject *npobj, NPIdentifier method, // We're about to run script via JS_CallFunctionValue, so we need an // AutoEntryScript. NPAPI plugins are Gecko-specific and not in any spec. dom::AutoEntryScript aes(globalObject, "NPAPI doInvoke"); - JSContext *cx = aes.cx(); + JSContext* cx = aes.cx(); if (!npobj || !result) { ThrowJSExceptionASCII(cx, "Null npobj, or result in doInvoke!"); @@ -708,9 +708,9 @@ static bool doInvoke(NPObject *npobj, NPIdentifier method, // Initialize *result VOID_TO_NPVARIANT(*result); - nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; + nsJSObjWrapper* npjsobj = (nsJSObjWrapper*)npobj; - JS::Rooted jsobj(cx, npjsobj->mJSObj); + JS::Rooted jsobj(cx, npjsobj->mJSObj); JSAutoRealm ar(cx, npjsobj->mJSObjGlobal); MarkCrossZoneNPIdentifier(cx, method); JS::Rooted fv(cx); @@ -740,7 +740,7 @@ static bool doInvoke(NPObject *npobj, NPIdentifier method, bool ok = false; if (ctorCall) { - JSObject *newObj = ::JS_New(cx, jsobj, jsargs); + JSObject* newObj = ::JS_New(cx, jsobj, jsargs); if (newObj) { v.setObject(*newObj); @@ -756,9 +756,9 @@ static bool doInvoke(NPObject *npobj, NPIdentifier method, } // static -bool nsJSObjWrapper::NP_Invoke(NPObject *npobj, NPIdentifier method, - const NPVariant *args, uint32_t argCount, - NPVariant *result) { +bool nsJSObjWrapper::NP_Invoke(NPObject* npobj, NPIdentifier method, + const NPVariant* args, uint32_t argCount, + NPVariant* result) { if (method == NPIdentifier_VOID) { return false; } @@ -767,21 +767,21 @@ bool nsJSObjWrapper::NP_Invoke(NPObject *npobj, NPIdentifier method, } // static -bool nsJSObjWrapper::NP_InvokeDefault(NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result) { +bool nsJSObjWrapper::NP_InvokeDefault(NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result) { return doInvoke(npobj, NPIdentifier_VOID, args, argCount, false, result); } // static -bool nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier npid) { +bool nsJSObjWrapper::NP_HasProperty(NPObject* npobj, NPIdentifier npid) { NPP npp = NPPStack::Peek(); - nsIGlobalObject *globalObject = GetGlobalObject(npp); + nsIGlobalObject* globalObject = GetGlobalObject(npp); if (NS_WARN_IF(!globalObject)) { return false; } dom::AutoEntryScript aes(globalObject, "NPAPI HasProperty"); - JSContext *cx = aes.cx(); + JSContext* cx = aes.cx(); if (!npobj) { ThrowJSExceptionASCII(cx, "Null npobj in nsJSObjWrapper::NP_HasProperty!"); @@ -789,11 +789,11 @@ bool nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier npid) { return false; } - nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; + nsJSObjWrapper* npjsobj = (nsJSObjWrapper*)npobj; bool found, ok = false; AutoJSExceptionSuppressor suppressor(aes, npjsobj); - JS::Rooted jsobj(cx, npjsobj->mJSObj); + JS::Rooted jsobj(cx, npjsobj->mJSObj); JSAutoRealm ar(cx, npjsobj->mJSObjGlobal); MarkCrossZoneNPIdentifier(cx, npid); @@ -805,8 +805,8 @@ bool nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier npid) { } // static -bool nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id, - NPVariant *result) { +bool nsJSObjWrapper::NP_GetProperty(NPObject* npobj, NPIdentifier id, + NPVariant* result) { NPP npp = NPPStack::Peek(); nsCOMPtr globalObject = GetGlobalObject(npp); @@ -817,7 +817,7 @@ bool nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id, // We're about to run script via JS_CallFunctionValue, so we need an // AutoEntryScript. NPAPI plugins are Gecko-specific and not in any spec. dom::AutoEntryScript aes(globalObject, "NPAPI get"); - JSContext *cx = aes.cx(); + JSContext* cx = aes.cx(); if (!npobj) { ThrowJSExceptionASCII(cx, "Null npobj in nsJSObjWrapper::NP_GetProperty!"); @@ -825,7 +825,7 @@ bool nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id, return false; } - nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; + nsJSObjWrapper* npjsobj = (nsJSObjWrapper*)npobj; AutoJSExceptionSuppressor suppressor(aes, npjsobj); JSAutoRealm ar(cx, npjsobj->mJSObjGlobal); @@ -837,8 +837,8 @@ bool nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id, } // static -bool nsJSObjWrapper::NP_SetProperty(NPObject *npobj, NPIdentifier npid, - const NPVariant *value) { +bool nsJSObjWrapper::NP_SetProperty(NPObject* npobj, NPIdentifier npid, + const NPVariant* value) { NPP npp = NPPStack::Peek(); nsCOMPtr globalObject = GetGlobalObject(npp); @@ -849,7 +849,7 @@ bool nsJSObjWrapper::NP_SetProperty(NPObject *npobj, NPIdentifier npid, // We're about to run script via JS_CallFunctionValue, so we need an // AutoEntryScript. NPAPI plugins are Gecko-specific and not in any spec. dom::AutoEntryScript aes(globalObject, "NPAPI set"); - JSContext *cx = aes.cx(); + JSContext* cx = aes.cx(); if (!npobj) { ThrowJSExceptionASCII(cx, "Null npobj in nsJSObjWrapper::NP_SetProperty!"); @@ -857,11 +857,11 @@ bool nsJSObjWrapper::NP_SetProperty(NPObject *npobj, NPIdentifier npid, return false; } - nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; + nsJSObjWrapper* npjsobj = (nsJSObjWrapper*)npobj; bool ok = false; AutoJSExceptionSuppressor suppressor(aes, npjsobj); - JS::Rooted jsObj(cx, npjsobj->mJSObj); + JS::Rooted jsObj(cx, npjsobj->mJSObj); JSAutoRealm ar(cx, npjsobj->mJSObjGlobal); MarkCrossZoneNPIdentifier(cx, npid); @@ -876,15 +876,15 @@ bool nsJSObjWrapper::NP_SetProperty(NPObject *npobj, NPIdentifier npid, } // static -bool nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier npid) { +bool nsJSObjWrapper::NP_RemoveProperty(NPObject* npobj, NPIdentifier npid) { NPP npp = NPPStack::Peek(); - nsIGlobalObject *globalObject = GetGlobalObject(npp); + nsIGlobalObject* globalObject = GetGlobalObject(npp); if (NS_WARN_IF(!globalObject)) { return false; } dom::AutoEntryScript aes(globalObject, "NPAPI RemoveProperty"); - JSContext *cx = aes.cx(); + JSContext* cx = aes.cx(); if (!npobj) { ThrowJSExceptionASCII(cx, @@ -893,11 +893,11 @@ bool nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier npid) { return false; } - nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; + nsJSObjWrapper* npjsobj = (nsJSObjWrapper*)npobj; AutoJSExceptionSuppressor suppressor(aes, npjsobj); JS::ObjectOpResult result; - JS::Rooted obj(cx, npjsobj->mJSObj); + JS::Rooted obj(cx, npjsobj->mJSObj); JSAutoRealm ar(cx, npjsobj->mJSObjGlobal); MarkCrossZoneNPIdentifier(cx, npid); @@ -922,16 +922,16 @@ bool nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier npid) { } // static -bool nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray, - uint32_t *count) { +bool nsJSObjWrapper::NP_Enumerate(NPObject* npobj, NPIdentifier** idarray, + uint32_t* count) { NPP npp = NPPStack::Peek(); - nsIGlobalObject *globalObject = GetGlobalObject(npp); + nsIGlobalObject* globalObject = GetGlobalObject(npp); if (NS_WARN_IF(!globalObject)) { return false; } dom::AutoEntryScript aes(globalObject, "NPAPI Enumerate"); - JSContext *cx = aes.cx(); + JSContext* cx = aes.cx(); *idarray = 0; *count = 0; @@ -942,10 +942,10 @@ bool nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray, return false; } - nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; + nsJSObjWrapper* npjsobj = (nsJSObjWrapper*)npobj; AutoJSExceptionSuppressor suppressor(aes, npjsobj); - JS::Rooted jsobj(cx, npjsobj->mJSObj); + JS::Rooted jsobj(cx, npjsobj->mJSObj); JSAutoRealm ar(cx, npjsobj->mJSObjGlobal); JS::Rooted ida(cx, JS::IdVector(cx)); @@ -954,7 +954,7 @@ bool nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray, } *count = ida.length(); - *idarray = (NPIdentifier *)malloc(*count * sizeof(NPIdentifier)); + *idarray = (NPIdentifier*)malloc(*count * sizeof(NPIdentifier)); if (!*idarray) { ThrowJSExceptionASCII(cx, "Memory allocation failed for NPIdentifier!"); return false; @@ -969,7 +969,7 @@ bool nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray, NPIdentifier id; if (v.isString()) { - JS::Rooted str(cx, v.toString()); + JS::Rooted str(cx, v.toString()); str = JS_AtomizeAndPinJSString(cx, str); if (!str) { free(*idarray); @@ -989,16 +989,16 @@ bool nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray, } // static -bool nsJSObjWrapper::NP_Construct(NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result) { +bool nsJSObjWrapper::NP_Construct(NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result) { return doInvoke(npobj, NPIdentifier_VOID, args, argCount, true, result); } // Look up or create an NPObject that wraps the JSObject obj. // static -NPObject *nsJSObjWrapper::GetNewOrUsed(NPP npp, JS::Handle obj, - JS::Handle objGlobal) { +NPObject* nsJSObjWrapper::GetNewOrUsed(NPP npp, JS::Handle obj, + JS::Handle objGlobal) { if (!npp) { NS_ERROR("Null NPP passed to nsJSObjWrapper::GetNewOrUsed()!"); @@ -1017,7 +1017,7 @@ NPObject *nsJSObjWrapper::GetNewOrUsed(NPP npp, JS::Handle obj, // obj is one of our own, its private data is the NPObject we're // looking for. - NPObject *npobj = (NPObject *)js::GetProxyPrivate(obj).toPrivate(); + NPObject* npobj = (NPObject*)js::GetProxyPrivate(obj).toPrivate(); // If the private is null, that means that the object has already been torn // down, possible because the owning plugin was destroyed (there can be @@ -1047,8 +1047,8 @@ NPObject *nsJSObjWrapper::GetNewOrUsed(NPP npp, JS::Handle obj, // No existing nsJSObjWrapper, create one. - nsJSObjWrapper *wrapper = - (nsJSObjWrapper *)_createobject(npp, &sJSObjWrapperNPClass); + nsJSObjWrapper* wrapper = + (nsJSObjWrapper*)_createobject(npp, &sJSObjWrapperNPClass); if (!wrapper) { // Out of memory, entry not yet added to table. @@ -1075,9 +1075,9 @@ NPObject *nsJSObjWrapper::GetNewOrUsed(NPP npp, JS::Handle obj, // Because this function unwraps, its return value must be wrapped for the cx // compartment for callers that plan to hold onto the result or do anything // substantial with it. -static JSObject *GetNPObjectWrapper(JSContext *cx, JS::Handle aObj, +static JSObject* GetNPObjectWrapper(JSContext* cx, JS::Handle aObj, bool wrapResult = true) { - JS::Rooted obj(cx, aObj); + JS::Rooted obj(cx, aObj); // We can't have WindowProxy or Location objects with NP object wrapper // objects on their proto chain, since they have immutable prototypes. So @@ -1098,35 +1098,35 @@ static JSObject *GetNPObjectWrapper(JSContext *cx, JS::Handle aObj, return nullptr; } -static NPObject *GetNPObject(JSContext *cx, JS::Handle aObj) { - JS::Rooted obj(cx, aObj); +static NPObject* GetNPObject(JSContext* cx, JS::Handle aObj) { + JS::Rooted obj(cx, aObj); obj = GetNPObjectWrapper(cx, obj, /* wrapResult = */ false); if (!obj) { return nullptr; } - return (NPObject *)js::GetProxyPrivate(obj).toPrivate(); + return (NPObject*)js::GetProxyPrivate(obj).toPrivate(); } -static JSObject *NPObjWrapper_GetResolvedProps(JSContext *cx, - JS::Handle obj) { +static JSObject* NPObjWrapper_GetResolvedProps(JSContext* cx, + JS::Handle obj) { JS::Value slot = js::GetProxyReservedSlot(obj, 0); if (slot.isObject()) return &slot.toObject(); MOZ_ASSERT(slot.isUndefined()); - JSObject *res = JS_NewObject(cx, nullptr); + JSObject* res = JS_NewObject(cx, nullptr); if (!res) return nullptr; SetProxyReservedSlot(obj, 0, JS::ObjectValue(*res)); return res; } -bool NPObjWrapperProxyHandler::delete_(JSContext *cx, - JS::Handle proxy, +bool NPObjWrapperProxyHandler::delete_(JSContext* cx, + JS::Handle proxy, JS::Handle id, - JS::ObjectOpResult &result) const { - NPObject *npobj = GetNPObject(cx, proxy); + JS::ObjectOpResult& result) const { + NPObject* npobj = GetNPObject(cx, proxy); if (!npobj || !npobj->_class || !npobj->_class->hasProperty || !npobj->_class->removeProperty) { @@ -1135,8 +1135,8 @@ bool NPObjWrapperProxyHandler::delete_(JSContext *cx, return false; } - JS::Rooted resolvedProps( - cx, NPObjWrapper_GetResolvedProps(cx, proxy)); + JS::Rooted resolvedProps(cx, + NPObjWrapper_GetResolvedProps(cx, proxy)); if (!resolvedProps) return false; if (!JS_DeletePropertyById(cx, resolvedProps, id, result)) return false; @@ -1160,12 +1160,12 @@ bool NPObjWrapperProxyHandler::delete_(JSContext *cx, return succeeded ? result.succeed() : result.failCantDelete(); } -bool NPObjWrapperProxyHandler::set(JSContext *cx, JS::Handle proxy, +bool NPObjWrapperProxyHandler::set(JSContext* cx, JS::Handle proxy, JS::Handle id, JS::Handle vp, JS::Handle receiver, - JS::ObjectOpResult &result) const { - NPObject *npobj = GetNPObject(cx, proxy); + JS::ObjectOpResult& result) const { + NPObject* npobj = GetNPObject(cx, proxy); if (!npobj || !npobj->_class || !npobj->_class->hasProperty || !npobj->_class->setProperty) { @@ -1186,7 +1186,7 @@ bool NPObjWrapperProxyHandler::set(JSContext *cx, JS::Handle proxy, { bool resolved = false; - JS::Rooted method(cx); + JS::Rooted method(cx); if (!NPObjWrapper_Resolve(cx, proxy, id, &resolved, &method)) return false; if (!resolved) { // We don't have a property/method with this id. Forward to the prototype @@ -1231,13 +1231,13 @@ bool NPObjWrapperProxyHandler::set(JSContext *cx, JS::Handle proxy, return result.succeed(); } -static bool CallNPMethod(JSContext *cx, unsigned argc, JS::Value *vp); +static bool CallNPMethod(JSContext* cx, unsigned argc, JS::Value* vp); -bool NPObjWrapperProxyHandler::get(JSContext *cx, JS::Handle proxy, +bool NPObjWrapperProxyHandler::get(JSContext* cx, JS::Handle proxy, JS::Handle receiver, JS::Handle id, JS::MutableHandle vp) const { - NPObject *npobj = GetNPObject(cx, proxy); + NPObject* npobj = GetNPObject(cx, proxy); if (!npobj || !npobj->_class || !npobj->_class->hasProperty || !npobj->_class->hasMethod || !npobj->_class->getProperty) { @@ -1281,7 +1281,7 @@ bool NPObjWrapperProxyHandler::get(JSContext *cx, JS::Handle proxy, { bool resolved = false; - JS::Rooted method(cx); + JS::Rooted method(cx); if (!NPObjWrapper_Resolve(cx, proxy, id, &resolved, &method)) return false; if (method) { vp.setObject(*method); @@ -1304,8 +1304,8 @@ bool NPObjWrapperProxyHandler::get(JSContext *cx, JS::Handle proxy, NPIdentifier identifier = JSIdToNPIdentifier(id); if (NPObjectIsOutOfProcessProxy(npobj)) { - PluginScriptableObjectParent *actor = - static_cast(npobj)->parent; + PluginScriptableObjectParent* actor = + static_cast(npobj)->parent; // actor may be null if the plugin crashed. if (!actor) return false; @@ -1357,10 +1357,10 @@ bool NPObjWrapperProxyHandler::get(JSContext *cx, JS::Handle proxy, return js::BaseProxyHandler::get(cx, proxy, receiver, id, vp); } -static bool CallNPMethodInternal(JSContext *cx, JS::Handle obj, - unsigned argc, JS::Value *argv, - JS::Value *rval, bool ctorCall) { - NPObject *npobj = GetNPObject(cx, obj); +static bool CallNPMethodInternal(JSContext* cx, JS::Handle obj, + unsigned argc, JS::Value* argv, + JS::Value* rval, bool ctorCall) { + NPObject* npobj = GetNPObject(cx, obj); if (!npobj || !npobj->_class) { ThrowJSExceptionASCII(cx, "Bad NPObject as private data!"); @@ -1381,12 +1381,12 @@ static bool CallNPMethodInternal(JSContext *cx, JS::Handle obj, PluginDestructionGuard pdg(npp); NPVariant npargs_buf[8]; - NPVariant *npargs = npargs_buf; + NPVariant* npargs = npargs_buf; if (argc > (sizeof(npargs_buf) / sizeof(NPVariant))) { // Our stack buffer isn't large enough to hold all arguments, // malloc a buffer. - npargs = (NPVariant *)malloc(argc * sizeof(NPVariant)); + npargs = (NPVariant*)malloc(argc * sizeof(NPVariant)); if (!npargs) { ThrowJSExceptionASCII(cx, "Out of memory!"); @@ -1412,9 +1412,9 @@ static bool CallNPMethodInternal(JSContext *cx, JS::Handle obj, NPVariant v; VOID_TO_NPVARIANT(v); - JSObject *funobj = argv[-2].toObjectOrNull(); + JSObject* funobj = argv[-2].toObjectOrNull(); bool ok; - const char *msg = "Error calling method on NPObject!"; + const char* msg = "Error calling method on NPObject!"; if (ctorCall) { // construct a new NPObject based on the NPClass in npobj. Fail if @@ -1433,9 +1433,9 @@ static bool CallNPMethodInternal(JSContext *cx, JS::Handle obj, // the function object. if (npobj->_class->invoke) { - JSFunction *fun = ::JS_GetObjectFunction(funobj); - JS::Rooted funId(cx, ::JS_GetFunctionId(fun)); - JSString *name = ::JS_AtomizeAndPinJSString(cx, funId); + JSFunction* fun = ::JS_GetObjectFunction(funobj); + JS::Rooted funId(cx, ::JS_GetFunctionId(fun)); + JSString* name = ::JS_AtomizeAndPinJSString(cx, funId); NPIdentifier id = StringToNPIdentifier(cx, name); ok = npobj->_class->invoke(npobj, id, npargs, argc, &v); @@ -1484,22 +1484,22 @@ static bool CallNPMethodInternal(JSContext *cx, JS::Handle obj, return ReportExceptionIfPending(cx); } -static bool CallNPMethod(JSContext *cx, unsigned argc, JS::Value *vp) { +static bool CallNPMethod(JSContext* cx, unsigned argc, JS::Value* vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (!args.thisv().isObject()) { ThrowJSExceptionASCII(cx, "plug-in method called on incompatible non-object"); return false; } - JS::Rooted obj(cx, &args.thisv().toObject()); + JS::Rooted obj(cx, &args.thisv().toObject()); return CallNPMethodInternal(cx, obj, args.length(), args.array(), vp, false); } bool NPObjWrapperProxyHandler::getOwnPropertyDescriptor( - JSContext *cx, JS::Handle proxy, JS::Handle id, + JSContext* cx, JS::Handle proxy, JS::Handle id, JS::MutableHandle desc) const { bool resolved = false; - JS::Rooted method(cx); + JS::Rooted method(cx); if (!NPObjWrapper_Resolve(cx, proxy, id, &resolved, &method)) return false; if (!resolved) { // No such property. @@ -1518,9 +1518,9 @@ bool NPObjWrapperProxyHandler::getOwnPropertyDescriptor( } bool NPObjWrapperProxyHandler::ownPropertyKeys( - JSContext *cx, JS::Handle proxy, + JSContext* cx, JS::Handle proxy, JS::MutableHandleVector properties) const { - NPObject *npobj = GetNPObject(cx, proxy); + NPObject* npobj = GetNPObject(cx, proxy); if (!npobj || !npobj->_class) { ThrowJSExceptionASCII(cx, "Bad NPObject as private data!"); return false; @@ -1533,7 +1533,7 @@ bool NPObjWrapperProxyHandler::ownPropertyKeys( return true; } - NPIdentifier *identifiers; + NPIdentifier* identifiers; uint32_t length; if (!npobj->_class->enumerate(npobj, &identifiers, &length)) { if (ReportExceptionIfPending(cx)) { @@ -1574,14 +1574,14 @@ bool NPObjWrapperProxyHandler::ownPropertyKeys( // call it and assign it to resolvedProps[id]. This function is also assigned // to the |method| outparam so callers can return it directly if we're doing a // |get|. -static bool NPObjWrapper_Resolve(JSContext *cx, JS::Handle obj, - JS::Handle id, bool *resolvedp, - JS::MutableHandle method) { +static bool NPObjWrapper_Resolve(JSContext* cx, JS::Handle obj, + JS::Handle id, bool* resolvedp, + JS::MutableHandle method) { if (JSID_IS_SYMBOL(id)) return true; AUTO_PROFILER_LABEL("NPObjWrapper_Resolve", JS); - NPObject *npobj = GetNPObject(cx, obj); + NPObject* npobj = GetNPObject(cx, obj); if (!npobj || !npobj->_class || !npobj->_class->hasProperty || !npobj->_class->hasMethod) { @@ -1590,8 +1590,8 @@ static bool NPObjWrapper_Resolve(JSContext *cx, JS::Handle obj, return false; } - JS::Rooted resolvedProps(cx, - NPObjWrapper_GetResolvedProps(cx, obj)); + JS::Rooted resolvedProps(cx, + NPObjWrapper_GetResolvedProps(cx, obj)); if (!resolvedProps) return false; JS::Rooted res(cx); if (!JS_GetPropertyById(cx, resolvedProps, id, &res)) return false; @@ -1623,7 +1623,7 @@ static bool NPObjWrapper_Resolve(JSContext *cx, JS::Handle obj, NS_ASSERTION(JSID_IS_STRING(id) || JSID_IS_INT(id), "id must be either string or int!\n"); - JSFunction *fnc = ::JS_DefineFunctionById( + JSFunction* fnc = ::JS_DefineFunctionById( cx, resolvedProps, id, CallNPMethod, 0, JSPROP_ENUMERATE); if (!fnc) return false; @@ -1636,28 +1636,28 @@ static bool NPObjWrapper_Resolve(JSContext *cx, JS::Handle obj, return true; } -void NPObjWrapperProxyHandler::finalize(JSFreeOp *fop, JSObject *proxy) const { +void NPObjWrapperProxyHandler::finalize(JSFreeOp* fop, JSObject* proxy) const { JS::AutoAssertGCCallback inCallback; - NPObject *npobj = (NPObject *)js::GetProxyPrivate(proxy).toPrivate(); + NPObject* npobj = (NPObject*)js::GetProxyPrivate(proxy).toPrivate(); if (npobj) { if (sNPObjWrappers) { // If the sNPObjWrappers map contains an entry that refers to this // wrapper, remove it. auto entry = - static_cast(sNPObjWrappers->Search(npobj)); + static_cast(sNPObjWrappers->Search(npobj)); if (entry && entry->mJSObj == proxy) { sNPObjWrappers->Remove(npobj); } } } - if (!sDelayedReleases) sDelayedReleases = new nsTArray; + if (!sDelayedReleases) sDelayedReleases = new nsTArray; sDelayedReleases->AppendElement(npobj); } -size_t NPObjWrapperProxyHandler::objectMoved(JSObject *obj, - JSObject *old) const { +size_t NPObjWrapperProxyHandler::objectMoved(JSObject* obj, + JSObject* old) const { // The wrapper JSObject has been moved, so we need to update the entry in the // sNPObjWrappers hash table, if present. @@ -1665,7 +1665,7 @@ size_t NPObjWrapperProxyHandler::objectMoved(JSObject *obj, return 0; } - NPObject *npobj = (NPObject *)js::GetProxyPrivate(obj).toPrivate(); + NPObject* npobj = (NPObject*)js::GetProxyPrivate(obj).toPrivate(); if (!npobj) { return 0; } @@ -1674,28 +1674,28 @@ size_t NPObjWrapperProxyHandler::objectMoved(JSObject *obj, JS::AutoSuppressGCAnalysis nogc; auto entry = - static_cast(sNPObjWrappers->Search(npobj)); + static_cast(sNPObjWrappers->Search(npobj)); MOZ_ASSERT(entry && entry->mJSObj); MOZ_ASSERT(entry->mJSObj == old); entry->mJSObj = obj; return 0; } -bool NPObjWrapperProxyHandler::call(JSContext *cx, JS::Handle proxy, - const JS::CallArgs &args) const { +bool NPObjWrapperProxyHandler::call(JSContext* cx, JS::Handle proxy, + const JS::CallArgs& args) const { return CallNPMethodInternal(cx, proxy, args.length(), args.array(), args.rval().address(), false); } -bool NPObjWrapperProxyHandler::construct(JSContext *cx, - JS::Handle proxy, - const JS::CallArgs &args) const { +bool NPObjWrapperProxyHandler::construct(JSContext* cx, + JS::Handle proxy, + const JS::CallArgs& args) const { return CallNPMethodInternal(cx, proxy, args.length(), args.array(), args.rval().address(), true); } -static bool NPObjWrapper_toPrimitive(JSContext *cx, unsigned argc, - JS::Value *vp) { +static bool NPObjWrapper_toPrimitive(JSContext* cx, unsigned argc, + JS::Value* vp) { // Plugins do not simply use the default OrdinaryToPrimitive behavior, // because that behavior involves calling toString or valueOf on objects // which weren't designed to accommodate this. Usually this wouldn't be a @@ -1728,7 +1728,7 @@ static bool NPObjWrapper_toPrimitive(JSContext *cx, unsigned argc, return false; } -bool nsNPObjWrapper::IsWrapper(JSObject *obj) { +bool nsNPObjWrapper::IsWrapper(JSObject* obj) { return js::GetObjectClass(obj) == &sNPObjWrapperProxyClass; } @@ -1737,7 +1737,7 @@ bool nsNPObjWrapper::IsWrapper(JSObject *obj) { // and it's destroyed prematurely. // static -void nsNPObjWrapper::OnDestroy(NPObject *npobj) { +void nsNPObjWrapper::OnDestroy(NPObject* npobj) { if (!npobj) { return; } @@ -1755,7 +1755,7 @@ void nsNPObjWrapper::OnDestroy(NPObject *npobj) { } auto entry = - static_cast(sNPObjWrappers->Search(npobj)); + static_cast(sNPObjWrappers->Search(npobj)); if (entry && entry->mJSObj) { // Found an NPObject wrapper, null out its JSObjects' private data. @@ -1773,8 +1773,8 @@ void nsNPObjWrapper::OnDestroy(NPObject *npobj) { // is always in the compartment of the passed-in JSContext (it might be a CCW). // static -JSObject *nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, - NPObject *npobj) { +JSObject* nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext* cx, + NPObject* npobj) { if (!npobj) { NS_ERROR("Null NPObject passed to nsNPObjWrapper::GetNewOrUsed()!"); @@ -1784,7 +1784,7 @@ JSObject *nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, if (npobj->_class == &nsJSObjWrapper::sJSObjWrapperNPClass) { // npobj is one of our own, return its existing JSObject. - JS::Rooted obj(cx, ((nsJSObjWrapper *)npobj)->mJSObj); + JS::Rooted obj(cx, ((nsJSObjWrapper*)npobj)->mJSObj); if (!JS_WrapObject(cx, &obj)) { return nullptr; } @@ -1804,8 +1804,8 @@ JSObject *nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, } } - auto entry = static_cast( - sNPObjWrappers->Add(npobj, fallible)); + auto entry = + static_cast(sNPObjWrappers->Add(npobj, fallible)); if (!entry) { // Out of memory @@ -1816,7 +1816,7 @@ JSObject *nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, if (entry->mJSObj) { // Found a NPObject wrapper. First check it is still alive. - JSObject *obj = entry->mJSObj.unbarrieredGetPtr(); + JSObject* obj = entry->mJSObj.unbarrieredGetPtr(); if (js::gc::EdgeNeedsSweepUnbarriered(&obj)) { // The object is dead (finalization will happen at a later time). By the // time we leave this function, this entry will either be updated with a @@ -1826,7 +1826,7 @@ JSObject *nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, } else { // It may not be in the same compartment as cx, so we need to wrap it // before returning it. - JS::Rooted obj(cx, entry->mJSObj); + JS::Rooted obj(cx, entry->mJSObj); if (!JS_WrapObject(cx, &obj)) { return nullptr; } @@ -1844,7 +1844,7 @@ JSObject *nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, JS::RootedValue priv(cx, JS::PrivateValue(nullptr)); js::ProxyOptions options; options.setClass(&sNPObjWrapperProxyClass); - JS::Rooted obj( + JS::Rooted obj( cx, js::NewProxyObject(cx, &NPObjWrapperProxyHandler::singleton, priv, nullptr, options)); @@ -1852,7 +1852,7 @@ JSObject *nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, // Reload entry if the JS_NewObject call caused a GC and reallocated // the table (see bug 445229). This is guaranteed to succeed. - entry = static_cast(sNPObjWrappers->Search(npobj)); + entry = static_cast(sNPObjWrappers->Search(npobj)); NS_ASSERTION(entry, "Hashtable didn't find what we just added?"); } @@ -1883,7 +1883,7 @@ void nsJSNPRuntime::OnPluginDestroy(NPP npp) { sJSObjWrappersAccessible = false; for (auto iter = sJSObjWrappers->modIter(); !iter.done(); iter.next()) { - nsJSObjWrapper *npobj = iter.get().value(); + nsJSObjWrapper* npobj = iter.get().value(); MOZ_ASSERT(npobj->_class == &nsJSObjWrapper::sJSObjWrapperNPClass); if (npobj->mNpp == npp) { if (npobj->_class && npobj->_class->invalidate) { @@ -1901,15 +1901,15 @@ void nsJSNPRuntime::OnPluginDestroy(NPP npp) { if (sNPObjWrappers) { for (auto i = sNPObjWrappers->Iter(); !i.Done(); i.Next()) { - auto entry = static_cast(i.Get()); + auto entry = static_cast(i.Get()); if (entry->mNpp == npp) { // HACK: temporarily hide the table we're enumerating so that // invalidate() and deallocate() don't touch it. - PLDHashTable *tmp = sNPObjWrappers; + PLDHashTable* tmp = sNPObjWrappers; sNPObjWrappers = nullptr; - NPObject *npobj = entry->mNPObj; + NPObject* npobj = entry->mNPObj; if (npobj->_class && npobj->_class->invalidate) { npobj->_class->invalidate(npobj); @@ -1954,7 +1954,7 @@ void nsJSNPRuntime::OnPluginDestroyPending(NPP npp) { // Prevent modification of sJSObjWrappers table if we go reentrant. sJSObjWrappersAccessible = false; for (auto iter = sJSObjWrappers->iter(); !iter.done(); iter.next()) { - nsJSObjWrapper *npobj = iter.get().value(); + nsJSObjWrapper* npobj = iter.get().value(); MOZ_ASSERT(npobj->_class == &nsJSObjWrapper::sJSObjWrapperNPClass); if (npobj->mNpp == npp) { npobj->mDestroyPending = true; @@ -1965,14 +1965,14 @@ void nsJSNPRuntime::OnPluginDestroyPending(NPP npp) { } // Find the NPP for a NPObject. -static NPP LookupNPP(NPObject *npobj) { +static NPP LookupNPP(NPObject* npobj) { if (npobj->_class == &nsJSObjWrapper::sJSObjWrapperNPClass) { - nsJSObjWrapper *o = static_cast(npobj); + nsJSObjWrapper* o = static_cast(npobj); return o->mNpp; } - auto entry = static_cast( - sNPObjWrappers->Add(npobj, fallible)); + auto entry = + static_cast(sNPObjWrappers->Add(npobj, fallible)); if (!entry) { return nullptr; @@ -1983,10 +1983,10 @@ static NPP LookupNPP(NPObject *npobj) { return entry->mNpp; } -static bool CreateNPObjectMember(NPP npp, JSContext *cx, - JS::Handle aObj, NPObject *npobj, +static bool CreateNPObjectMember(NPP npp, JSContext* cx, + JS::Handle aObj, NPObject* npobj, JS::Handle id, - NPVariant *getPropertyResult, + NPVariant* getPropertyResult, JS::MutableHandle vp) { if (!npobj || !npobj->_class || !npobj->_class->getProperty || !npobj->_class->invoke) { @@ -1995,11 +1995,11 @@ static bool CreateNPObjectMember(NPP npp, JSContext *cx, return false; } - NPObjectMemberPrivate *memberPrivate = new NPObjectMemberPrivate; + NPObjectMemberPrivate* memberPrivate = new NPObjectMemberPrivate; - JS::Rooted obj(cx, aObj); + JS::Rooted obj(cx, aObj); - JS::Rooted memobj(cx, ::JS_NewObject(cx, &sNPObjectMemberClass)); + JS::Rooted memobj(cx, ::JS_NewObject(cx, &sNPObjectMemberClass)); if (!memobj) { delete memberPrivate; return false; @@ -2007,7 +2007,7 @@ static bool CreateNPObjectMember(NPP npp, JSContext *cx, vp.setObject(*memobj); - ::JS_SetPrivate(memobj, (void *)memberPrivate); + ::JS_SetPrivate(memobj, (void*)memberPrivate); NPIdentifier identifier = JSIdToNPIdentifier(id); @@ -2045,38 +2045,38 @@ static bool CreateNPObjectMember(NPP npp, JSContext *cx, toPrimitiveId = SYMBOL_TO_JSID(JS::GetWellKnownSymbol(cx, JS::SymbolCode::toPrimitive)); - JSFunction *fun = JS_NewFunction(cx, NPObjectMember_toPrimitive, 1, 0, + JSFunction* fun = JS_NewFunction(cx, NPObjectMember_toPrimitive, 1, 0, "Symbol.toPrimitive"); if (!fun) return false; - JS::Rooted funObj(cx, JS_GetFunctionObject(fun)); + JS::Rooted funObj(cx, JS_GetFunctionObject(fun)); if (!JS_DefinePropertyById(cx, memobj, toPrimitiveId, funObj, 0)) return false; return true; } -static void NPObjectMember_Finalize(JSFreeOp *fop, JSObject *obj) { - NPObjectMemberPrivate *memberPrivate; +static void NPObjectMember_Finalize(JSFreeOp* fop, JSObject* obj) { + NPObjectMemberPrivate* memberPrivate; - memberPrivate = (NPObjectMemberPrivate *)::JS_GetPrivate(obj); + memberPrivate = (NPObjectMemberPrivate*)::JS_GetPrivate(obj); if (!memberPrivate) return; delete memberPrivate; } -static bool NPObjectMember_Call(JSContext *cx, unsigned argc, JS::Value *vp) { +static bool NPObjectMember_Call(JSContext* cx, unsigned argc, JS::Value* vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::Rooted memobj(cx, &args.callee()); + JS::Rooted memobj(cx, &args.callee()); NS_ENSURE_TRUE(memobj, false); - NPObjectMemberPrivate *memberPrivate = - (NPObjectMemberPrivate *)::JS_GetInstancePrivate( + NPObjectMemberPrivate* memberPrivate = + (NPObjectMemberPrivate*)::JS_GetInstancePrivate( cx, memobj, &sNPObjectMemberClass, &args); if (!memberPrivate || !memberPrivate->npobjWrapper) return false; - JS::Rooted objWrapper(cx, memberPrivate->npobjWrapper); - NPObject *npobj = GetNPObject(cx, objWrapper); + JS::Rooted objWrapper(cx, memberPrivate->npobjWrapper); + NPObject* npobj = GetNPObject(cx, objWrapper); if (!npobj) { ThrowJSExceptionASCII(cx, "Call on invalid member object"); @@ -2084,12 +2084,12 @@ static bool NPObjectMember_Call(JSContext *cx, unsigned argc, JS::Value *vp) { } NPVariant npargs_buf[8]; - NPVariant *npargs = npargs_buf; + NPVariant* npargs = npargs_buf; if (args.length() > (sizeof(npargs_buf) / sizeof(NPVariant))) { // Our stack buffer isn't large enough to hold all arguments, // malloc a buffer. - npargs = (NPVariant *)malloc(args.length() * sizeof(NPVariant)); + npargs = (NPVariant*)malloc(args.length() * sizeof(NPVariant)); if (!npargs) { ThrowJSExceptionASCII(cx, "Out of memory!"); @@ -2142,9 +2142,9 @@ static bool NPObjectMember_Call(JSContext *cx, unsigned argc, JS::Value *vp) { return ReportExceptionIfPending(cx); } -static void NPObjectMember_Trace(JSTracer *trc, JSObject *obj) { - NPObjectMemberPrivate *memberPrivate = - (NPObjectMemberPrivate *)::JS_GetPrivate(obj); +static void NPObjectMember_Trace(JSTracer* trc, JSObject* obj) { + NPObjectMemberPrivate* memberPrivate = + (NPObjectMemberPrivate*)::JS_GetPrivate(obj); if (!memberPrivate) return; // Our NPIdentifier is not always interned, so we must trace it. @@ -2161,8 +2161,8 @@ static void NPObjectMember_Trace(JSTracer *trc, JSObject *obj) { "NPObject Member => npobjWrapper"); } -static bool NPObjectMember_toPrimitive(JSContext *cx, unsigned argc, - JS::Value *vp) { +static bool NPObjectMember_toPrimitive(JSContext* cx, unsigned argc, + JS::Value* vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); JS::RootedValue thisv(cx, args.thisv()); if (thisv.isPrimitive()) { @@ -2171,8 +2171,8 @@ static bool NPObjectMember_toPrimitive(JSContext *cx, unsigned argc, } JS::RootedObject obj(cx, &thisv.toObject()); - NPObjectMemberPrivate *memberPrivate = - (NPObjectMemberPrivate *)::JS_GetInstancePrivate( + NPObjectMemberPrivate* memberPrivate = + (NPObjectMemberPrivate*)::JS_GetInstancePrivate( cx, obj, &sNPObjectMemberClass, &args); if (!memberPrivate) return false; @@ -2181,7 +2181,7 @@ static bool NPObjectMember_toPrimitive(JSContext *cx, unsigned argc, args.rval().set(memberPrivate->fieldValue); if (args.rval().isObject()) { - JS::Rooted objVal(cx, &args.rval().toObject()); + JS::Rooted objVal(cx, &args.rval().toObject()); return JS::ToPrimitive(cx, objVal, hint, args.rval()); } return true; diff --git a/dom/plugins/base/nsJSNPRuntime.h b/dom/plugins/base/nsJSNPRuntime.h index 728f90da2c76e..06b11737d0d84 100644 --- a/dom/plugins/base/nsJSNPRuntime.h +++ b/dom/plugins/base/nsJSNPRuntime.h @@ -20,44 +20,44 @@ class nsJSNPRuntime { class nsJSObjWrapperKey { public: - nsJSObjWrapperKey(JSObject *obj, NPP npp) : mJSObj(obj), mNpp(npp) {} + nsJSObjWrapperKey(JSObject* obj, NPP npp) : mJSObj(obj), mNpp(npp) {} - bool operator==(const nsJSObjWrapperKey &other) const { + bool operator==(const nsJSObjWrapperKey& other) const { return mJSObj == other.mJSObj && mNpp == other.mNpp; } - bool operator!=(const nsJSObjWrapperKey &other) const { + bool operator!=(const nsJSObjWrapperKey& other) const { return !(*this == other); } - void trace(JSTracer *trc) { + void trace(JSTracer* trc) { JS::TraceEdge(trc, &mJSObj, "nsJSObjWrapperKey"); } - nsJSObjWrapperKey(const nsJSObjWrapperKey &other) + nsJSObjWrapperKey(const nsJSObjWrapperKey& other) : mJSObj(other.mJSObj), mNpp(other.mNpp) {} - void operator=(const nsJSObjWrapperKey &other) { + void operator=(const nsJSObjWrapperKey& other) { mJSObj = other.mJSObj; mNpp = other.mNpp; } - JS::Heap mJSObj; + JS::Heap mJSObj; NPP mNpp; }; class nsJSObjWrapper : public NPObject { public: - JS::Heap mJSObj; + JS::Heap mJSObj; // Because mJSObj might be a cross-compartment wrapper, we can't use it to // enter the target realm. We use this global instead (it's always // same-compartment with mJSObj). - JS::Heap mJSObjGlobal; + JS::Heap mJSObjGlobal; const NPP mNpp; bool mDestroyPending; - static NPObject *GetNewOrUsed(NPP npp, JS::Handle obj, - JS::Handle objGlobal); + static NPObject* GetNewOrUsed(NPP npp, JS::Handle obj, + JS::Handle objGlobal); - void trace(JSTracer *trc) { + void trace(JSTracer* trc) { JS::TraceEdge(trc, &mJSObj, "nsJSObjWrapper::mJSObj"); JS::TraceEdge(trc, &mJSObjGlobal, "nsJSObjWrapper::mJSObjGlobal"); } @@ -66,25 +66,25 @@ class nsJSObjWrapper : public NPObject { explicit nsJSObjWrapper(NPP npp); ~nsJSObjWrapper(); - static NPObject *NP_Allocate(NPP npp, NPClass *aClass); - static void NP_Deallocate(NPObject *obj); - static void NP_Invalidate(NPObject *obj); - static bool NP_HasMethod(NPObject *, NPIdentifier identifier); - static bool NP_Invoke(NPObject *obj, NPIdentifier method, - const NPVariant *args, uint32_t argCount, - NPVariant *result); - static bool NP_InvokeDefault(NPObject *obj, const NPVariant *args, - uint32_t argCount, NPVariant *result); - static bool NP_HasProperty(NPObject *obj, NPIdentifier property); - static bool NP_GetProperty(NPObject *obj, NPIdentifier property, - NPVariant *result); - static bool NP_SetProperty(NPObject *obj, NPIdentifier property, - const NPVariant *value); - static bool NP_RemoveProperty(NPObject *obj, NPIdentifier property); - static bool NP_Enumerate(NPObject *npobj, NPIdentifier **identifier, - uint32_t *count); - static bool NP_Construct(NPObject *obj, const NPVariant *args, - uint32_t argCount, NPVariant *result); + static NPObject* NP_Allocate(NPP npp, NPClass* aClass); + static void NP_Deallocate(NPObject* obj); + static void NP_Invalidate(NPObject* obj); + static bool NP_HasMethod(NPObject*, NPIdentifier identifier); + static bool NP_Invoke(NPObject* obj, NPIdentifier method, + const NPVariant* args, uint32_t argCount, + NPVariant* result); + static bool NP_InvokeDefault(NPObject* obj, const NPVariant* args, + uint32_t argCount, NPVariant* result); + static bool NP_HasProperty(NPObject* obj, NPIdentifier property); + static bool NP_GetProperty(NPObject* obj, NPIdentifier property, + NPVariant* result); + static bool NP_SetProperty(NPObject* obj, NPIdentifier property, + const NPVariant* value); + static bool NP_RemoveProperty(NPObject* obj, NPIdentifier property); + static bool NP_Enumerate(NPObject* npobj, NPIdentifier** identifier, + uint32_t* count); + static bool NP_Construct(NPObject* obj, const NPVariant* args, + uint32_t argCount, NPVariant* result); public: static NPClass sJSObjWrapperNPClass; @@ -92,12 +92,12 @@ class nsJSObjWrapper : public NPObject { class nsNPObjWrapper { public: - static bool IsWrapper(JSObject *obj); - static void OnDestroy(NPObject *npobj); - static JSObject *GetNewOrUsed(NPP npp, JSContext *cx, NPObject *npobj); + static bool IsWrapper(JSObject* obj); + static void OnDestroy(NPObject* npobj); + static JSObject* GetNewOrUsed(NPP npp, JSContext* cx, NPObject* npobj); }; -bool JSValToNPVariant(NPP npp, JSContext *cx, const JS::Value &val, - NPVariant *variant); +bool JSValToNPVariant(NPP npp, JSContext* cx, const JS::Value& val, + NPVariant* variant); #endif // nsJSNPRuntime_h_ diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index c1b07e7ba17db..5736756871923 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -177,7 +177,7 @@ void NS_NotifyPluginCall(NSPluginCallReentry aReentryState) { } nsNPAPIPlugin::nsNPAPIPlugin() { - memset((void *)&mPluginFuncs, 0, sizeof(mPluginFuncs)); + memset((void*)&mPluginFuncs, 0, sizeof(mPluginFuncs)); mPluginFuncs.size = sizeof(mPluginFuncs); mPluginFuncs.version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR; @@ -189,13 +189,13 @@ nsNPAPIPlugin::~nsNPAPIPlugin() { mLibrary = nullptr; } -void nsNPAPIPlugin::PluginCrashed(const nsAString &pluginDumpID, - const nsAString &browserDumpID) { +void nsNPAPIPlugin::PluginCrashed(const nsAString& pluginDumpID, + const nsAString& browserDumpID) { RefPtr host = nsPluginHost::GetInst(); host->PluginCrashed(this, pluginDumpID, browserDumpID); } -inline PluginLibrary *GetNewPluginLibrary(nsPluginTag *aPluginTag) { +inline PluginLibrary* GetNewPluginLibrary(nsPluginTag* aPluginTag) { AUTO_PROFILER_LABEL("GetNewPluginLibrary", OTHER); if (!aPluginTag) { @@ -212,8 +212,8 @@ inline PluginLibrary *GetNewPluginLibrary(nsPluginTag *aPluginTag) { // Creates an nsNPAPIPlugin object. One nsNPAPIPlugin object exists per plugin // (not instance). -nsresult nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, - nsNPAPIPlugin **aResult) { +nsresult nsNPAPIPlugin::CreatePlugin(nsPluginTag* aPluginTag, + nsNPAPIPlugin** aResult) { AUTO_PROFILER_LABEL("nsNPAPIPlugin::CreatePlugin", OTHER); *aResult = nullptr; @@ -223,7 +223,7 @@ nsresult nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, RefPtr plugin = new nsNPAPIPlugin(); - PluginLibrary *pluginLib = GetNewPluginLibrary(aPluginTag); + PluginLibrary* pluginLib = GetNewPluginLibrary(aPluginTag); if (!pluginLib) { return NS_ERROR_FAILURE; } @@ -281,9 +281,9 @@ nsresult nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, return NS_OK; } -PluginLibrary *nsNPAPIPlugin::GetLibrary() { return mLibrary; } +PluginLibrary* nsNPAPIPlugin::GetLibrary() { return mLibrary; } -NPPluginFuncs *nsNPAPIPlugin::PluginFuncs() { return &mPluginFuncs; } +NPPluginFuncs* nsNPAPIPlugin::PluginFuncs() { return &mPluginFuncs; } nsresult nsNPAPIPlugin::Shutdown() { NPP_PLUGIN_LOG(PLUGIN_LOG_BASIC, @@ -295,22 +295,22 @@ nsresult nsNPAPIPlugin::Shutdown() { return NS_OK; } -nsresult nsNPAPIPlugin::RetainStream(NPStream *pstream, - nsISupports **aRetainedPeer) { +nsresult nsNPAPIPlugin::RetainStream(NPStream* pstream, + nsISupports** aRetainedPeer) { if (!aRetainedPeer) return NS_ERROR_NULL_POINTER; *aRetainedPeer = nullptr; if (!pstream || !pstream->ndata) return NS_ERROR_NULL_POINTER; - nsNPAPIStreamWrapper *streamWrapper = - static_cast(pstream->ndata); - nsNPAPIPluginStreamListener *listener = streamWrapper->GetStreamListener(); + nsNPAPIStreamWrapper* streamWrapper = + static_cast(pstream->ndata); + nsNPAPIPluginStreamListener* listener = streamWrapper->GetStreamListener(); if (!listener) { return NS_ERROR_NULL_POINTER; } - nsIStreamListener *streamListener = listener->GetStreamListenerPeer(); + nsIStreamListener* streamListener = listener->GetStreamListenerPeer(); if (!streamListener) { return NS_ERROR_NULL_POINTER; } @@ -322,22 +322,22 @@ nsresult nsNPAPIPlugin::RetainStream(NPStream *pstream, // Create a new NPP GET or POST (given in the type argument) url // stream that may have a notify callback -NPError MakeNewNPAPIStreamInternal(NPP npp, const char *relativeURL, - const char *target, +NPError MakeNewNPAPIStreamInternal(NPP npp, const char* relativeURL, + const char* target, eNPPStreamTypeInternal type, bool bDoNotify = false, - void *notifyData = nullptr, uint32_t len = 0, - const char *buf = nullptr) { + void* notifyData = nullptr, uint32_t len = 0, + const char* buf = nullptr) { if (!npp) return NPERR_INVALID_INSTANCE_ERROR; PluginDestructionGuard guard(npp); - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; if (!inst || !inst->IsRunning()) return NPERR_INVALID_INSTANCE_ERROR; nsCOMPtr pluginHostCOM = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID); - nsPluginHost *pluginHost = static_cast(pluginHostCOM.get()); + nsPluginHost* pluginHost = static_cast(pluginHostCOM.get()); if (!pluginHost) { return NPERR_GENERIC_ERROR; } @@ -382,17 +382,17 @@ NPError MakeNewNPAPIStreamInternal(NPP npp, const char *relativeURL, } #if defined(MOZ_MEMORY) && defined(XP_WIN) -extern "C" size_t malloc_usable_size(const void *ptr); +extern "C" size_t malloc_usable_size(const void* ptr); #endif namespace { -static char *gNPPException; +static char* gNPPException; -static Document *GetDocumentFromNPP(NPP npp) { +static Document* GetDocumentFromNPP(NPP npp) { NS_ENSURE_TRUE(npp, nullptr); - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; NS_ENSURE_TRUE(inst, nullptr); PluginDestructionGuard guard(inst); @@ -406,10 +406,10 @@ static Document *GetDocumentFromNPP(NPP npp) { return doc; } -static NPIdentifier doGetIdentifier(JSContext *cx, const NPUTF8 *name) { +static NPIdentifier doGetIdentifier(JSContext* cx, const NPUTF8* name) { NS_ConvertUTF8toUTF16 utf16name(name); - JSString *str = + JSString* str = ::JS_AtomizeAndPinUCStringN(cx, utf16name.get(), utf16name.Length()); if (!str) return nullptr; @@ -448,7 +448,7 @@ NPPExceptionAutoHolder::~NPPExceptionAutoHolder() { NPP NPPStack::sCurrentNPP = nullptr; -const char *PeekException() { return gNPPException; } +const char* PeekException() { return gNPPException; } void PopException() { NS_ASSERTION(gNPPException, "Uh, no NPP exception to pop!"); @@ -468,7 +468,7 @@ namespace mozilla { namespace plugins { namespace parent { -NPError _geturl(NPP npp, const char *relativeURL, const char *target) { +NPError _geturl(NPP npp, const char* relativeURL, const char* target) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_geturl called from the wrong thread\n")); @@ -476,7 +476,7 @@ NPError _geturl(NPP npp, const char *relativeURL, const char *target) { } NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetURL: npp=%p, target=%s, url=%s\n", - (void *)npp, target, relativeURL)); + (void*)npp, target, relativeURL)); PluginDestructionGuard guard(npp); @@ -484,8 +484,8 @@ NPError _geturl(NPP npp, const char *relativeURL, const char *target) { eNPPStreamTypeInternal_Get); } -NPError _geturlnotify(NPP npp, const char *relativeURL, const char *target, - void *notifyData) { +NPError _geturlnotify(NPP npp, const char* relativeURL, const char* target, + void* notifyData) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_geturlnotify called from the wrong thread\n")); @@ -494,7 +494,7 @@ NPError _geturlnotify(NPP npp, const char *relativeURL, const char *target, NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetURLNotify: npp=%p, target=%s, notify=%p, url=%s\n", - (void *)npp, target, notifyData, relativeURL)); + (void*)npp, target, notifyData, relativeURL)); PluginDestructionGuard guard(npp); @@ -502,9 +502,9 @@ NPError _geturlnotify(NPP npp, const char *relativeURL, const char *target, npp, relativeURL, target, eNPPStreamTypeInternal_Get, true, notifyData); } -NPError _posturlnotify(NPP npp, const char *relativeURL, const char *target, - uint32_t len, const char *buf, NPBool file, - void *notifyData) { +NPError _posturlnotify(NPP npp, const char* relativeURL, const char* target, + uint32_t len, const char* buf, NPBool file, + void* notifyData) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_posturlnotify called from the wrong thread\n")); @@ -512,11 +512,10 @@ NPError _posturlnotify(NPP npp, const char *relativeURL, const char *target, } if (!buf) return NPERR_INVALID_PARAM; - NPN_PLUGIN_LOG( - PLUGIN_LOG_NORMAL, - ("NPN_PostURLNotify: npp=%p, target=%s, len=%d, file=%d, " - "notify=%p, url=%s, buf=%s\n", - (void *)npp, target, len, file, notifyData, relativeURL, buf)); + NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, + ("NPN_PostURLNotify: npp=%p, target=%s, len=%d, file=%d, " + "notify=%p, url=%s, buf=%s\n", + (void*)npp, target, len, file, notifyData, relativeURL, buf)); PluginDestructionGuard guard(npp); @@ -525,8 +524,8 @@ NPError _posturlnotify(NPP npp, const char *relativeURL, const char *target, notifyData, len, buf); } -NPError _posturl(NPP npp, const char *relativeURL, const char *target, - uint32_t len, const char *buf, NPBool file) { +NPError _posturl(NPP npp, const char* relativeURL, const char* target, + uint32_t len, const char* buf, NPBool file) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_posturl called from the wrong thread\n")); @@ -535,7 +534,7 @@ NPError _posturl(NPP npp, const char *relativeURL, const char *target, NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_PostURL: npp=%p, target=%s, file=%d, len=%d, url=%s, " "buf=%s\n", - (void *)npp, target, file, len, relativeURL, buf)); + (void*)npp, target, file, len, relativeURL, buf)); PluginDestructionGuard guard(npp); @@ -544,11 +543,11 @@ NPError _posturl(NPP npp, const char *relativeURL, const char *target, len, buf); } -void _status(NPP npp, const char *message) { +void _status(NPP npp, const char* message) { // NPN_Status is no longer supported. } -void _memfree(void *ptr) { +void _memfree(void* ptr) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_memfree called from the wrong thread\n")); @@ -584,7 +583,7 @@ void _reloadplugins(NPBool reloadPages) { pluginHost->ReloadPlugins(); } -void _invalidaterect(NPP npp, NPRect *invalidRect) { +void _invalidaterect(NPP npp, NPRect* invalidRect) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_invalidaterect called from the wrong thread\n")); @@ -593,7 +592,7 @@ void _invalidaterect(NPP npp, NPRect *invalidRect) { NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_InvalidateRect: npp=%p, top=%d, left=%d, bottom=%d, " "right=%d\n", - (void *)npp, invalidRect->top, invalidRect->left, + (void*)npp, invalidRect->top, invalidRect->left, invalidRect->bottom, invalidRect->right)); if (!npp || !npp->ndata) { @@ -601,11 +600,11 @@ void _invalidaterect(NPP npp, NPRect *invalidRect) { return; } - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; PluginDestructionGuard guard(inst); - inst->InvalidateRect((NPRect *)invalidRect); + inst->InvalidateRect((NPRect*)invalidRect); } void _invalidateregion(NPP npp, NPRegion invalidRegion) { @@ -615,15 +614,15 @@ void _invalidateregion(NPP npp, NPRegion invalidRegion) { return; } NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, - ("NPN_InvalidateRegion: npp=%p, region=%p\n", (void *)npp, - (void *)invalidRegion)); + ("NPN_InvalidateRegion: npp=%p, region=%p\n", (void*)npp, + (void*)invalidRegion)); if (!npp || !npp->ndata) { NS_WARNING("_invalidateregion: npp or npp->ndata == 0"); return; } - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; PluginDestructionGuard guard(inst); @@ -632,7 +631,7 @@ void _invalidateregion(NPP npp, NPRegion invalidRegion) { void _forceredraw(NPP npp) {} -NPObject *_getwindowobject(NPP npp) { +NPObject* _getwindowobject(NPP npp) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getwindowobject called from the wrong thread\n")); @@ -641,27 +640,26 @@ NPObject *_getwindowobject(NPP npp) { // The window want to return here is the outer window, *not* the inner (since // we don't know what the plugin will do with it). - Document *doc = GetDocumentFromNPP(npp); + Document* doc = GetDocumentFromNPP(npp); NS_ENSURE_TRUE(doc, nullptr); nsCOMPtr outer = doc->GetWindow(); NS_ENSURE_TRUE(outer, nullptr); - JS::Rooted windowProxy( + JS::Rooted windowProxy( dom::RootingCx(), nsGlobalWindowOuter::Cast(outer)->GetGlobalJSObject()); - JS::Rooted global(dom::RootingCx(), - JS::GetNonCCWObjectGlobal(windowProxy)); + JS::Rooted global(dom::RootingCx(), + JS::GetNonCCWObjectGlobal(windowProxy)); return nsJSObjWrapper::GetNewOrUsed(npp, windowProxy, global); } -NPObject *_getpluginelement(NPP npp) { +NPObject* _getpluginelement(NPP npp) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getpluginelement called from the wrong thread\n")); return nullptr; } - nsNPAPIPluginInstance *inst = - static_cast(npp->ndata); + nsNPAPIPluginInstance* inst = static_cast(npp->ndata); if (!inst) return nullptr; RefPtr element; @@ -669,7 +667,7 @@ NPObject *_getpluginelement(NPP npp) { if (!element) return nullptr; - Document *doc = GetDocumentFromNPP(npp); + Document* doc = GetDocumentFromNPP(npp); if (NS_WARN_IF(!doc)) { return nullptr; } @@ -678,7 +676,7 @@ NPObject *_getpluginelement(NPP npp) { if (NS_WARN_IF(!jsapi.Init(doc->GetInnerWindow()))) { return nullptr; } - JSContext *cx = jsapi.cx(); + JSContext* cx = jsapi.cx(); nsCOMPtr xpc(nsIXPConnect::XPConnect()); NS_ENSURE_TRUE(xpc, nullptr); @@ -697,7 +695,7 @@ NPObject *_getpluginelement(NPP npp) { return nsJSObjWrapper::GetNewOrUsed(npp, obj, global); } -NPIdentifier _getstringidentifier(const NPUTF8 *name) { +NPIdentifier _getstringidentifier(const NPUTF8* name) { if (!name) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getstringidentifier: passed null name")); @@ -712,8 +710,8 @@ NPIdentifier _getstringidentifier(const NPUTF8 *name) { return doGetIdentifier(cx, name); } -void _getstringidentifiers(const NPUTF8 **names, int32_t nameCount, - NPIdentifier *identifiers) { +void _getstringidentifiers(const NPUTF8** names, int32_t nameCount, + NPIdentifier* identifiers) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getstringidentifiers called from the wrong thread\n")); @@ -740,7 +738,7 @@ NPIdentifier _getintidentifier(int32_t intid) { return IntToNPIdentifier(intid); } -NPUTF8 *_utf8fromidentifier(NPIdentifier id) { +NPUTF8* _utf8fromidentifier(NPIdentifier id) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_utf8fromidentifier called from the wrong thread\n")); @@ -751,7 +749,7 @@ NPUTF8 *_utf8fromidentifier(NPIdentifier id) { return nullptr; } - JSString *str = NPIdentifierToString(id); + JSString* str = NPIdentifierToString(id); nsAutoString autoStr; AssignJSFlatString(autoStr, JS_ASSERT_STRING_IS_FLAT(str)); @@ -780,7 +778,7 @@ bool _identifierisstring(NPIdentifier id) { return NPIdentifierIsString(id); } -NPObject *_createobject(NPP npp, NPClass *aClass) { +NPObject* _createobject(NPP npp, NPClass* aClass) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_createobject called from the wrong thread\n")); @@ -802,12 +800,12 @@ NPObject *_createobject(NPP npp, NPClass *aClass) { NPPAutoPusher nppPusher(npp); - NPObject *npobj; + NPObject* npobj; if (aClass->allocate) { npobj = aClass->allocate(npp, aClass); } else { - npobj = (NPObject *)malloc(sizeof(NPObject)); + npobj = (NPObject*)malloc(sizeof(NPObject)); } if (npobj) { @@ -822,7 +820,7 @@ NPObject *_createobject(NPP npp, NPClass *aClass) { return npobj; } -NPObject *_retainobject(NPObject *npobj) { +NPObject* _retainobject(NPObject* npobj) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_retainobject called from the wrong thread\n")); @@ -831,20 +829,20 @@ NPObject *_retainobject(NPObject *npobj) { #ifdef NS_BUILD_REFCNT_LOGGING int32_t refCnt = #endif - PR_ATOMIC_INCREMENT((int32_t *)&npobj->referenceCount); + PR_ATOMIC_INCREMENT((int32_t*)&npobj->referenceCount); NS_LOG_ADDREF(npobj, refCnt, "BrowserNPObject", sizeof(NPObject)); } return npobj; } -void _releaseobject(NPObject *npobj) { +void _releaseobject(NPObject* npobj) { // If nothing is passed, just return, even if we're on the wrong thread. if (!npobj) { return; } - int32_t refCnt = PR_ATOMIC_DECREMENT((int32_t *)&npobj->referenceCount); + int32_t refCnt = PR_ATOMIC_DECREMENT((int32_t*)&npobj->referenceCount); NS_LOG_RELEASE(npobj, refCnt, "BrowserNPObject"); if (refCnt == 0) { @@ -861,8 +859,8 @@ void _releaseobject(NPObject *npobj) { } } -bool _invoke(NPP npp, NPObject *npobj, NPIdentifier method, - const NPVariant *args, uint32_t argCount, NPVariant *result) { +bool _invoke(NPP npp, NPObject* npobj, NPIdentifier method, + const NPVariant* args, uint32_t argCount, NPVariant* result) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_invoke called from the wrong thread\n")); @@ -882,8 +880,8 @@ bool _invoke(NPP npp, NPObject *npobj, NPIdentifier method, return npobj->_class->invoke(npobj, method, args, argCount, result); } -bool _invokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result) { +bool _invokeDefault(NPP npp, NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_invokedefault called from the wrong thread\n")); @@ -902,7 +900,7 @@ bool _invokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, return npobj->_class->invokeDefault(npobj, args, argCount, result); } -bool _evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result) { +bool _evaluate(NPP npp, NPObject* npobj, NPString* script, NPVariant* result) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_evaluate called from the wrong thread\n")); @@ -912,19 +910,19 @@ bool _evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result) { NPPAutoPusher nppPusher(npp); - Document *doc = GetDocumentFromNPP(npp); + Document* doc = GetDocumentFromNPP(npp); NS_ENSURE_TRUE(doc, false); - nsGlobalWindowInner *win = nsGlobalWindowInner::Cast(doc->GetInnerWindow()); + nsGlobalWindowInner* win = nsGlobalWindowInner::Cast(doc->GetInnerWindow()); if (NS_WARN_IF(!win || !win->FastGetGlobalJSObject())) { return false; } nsAutoMicroTask mt; dom::AutoEntryScript aes(win, "NPAPI NPN_evaluate"); - JSContext *cx = aes.cx(); + JSContext* cx = aes.cx(); - JS::Rooted obj(cx, nsNPObjWrapper::GetNewOrUsed(npp, cx, npobj)); + JS::Rooted obj(cx, nsNPObjWrapper::GetNewOrUsed(npp, cx, npobj)); if (!obj) { return false; @@ -946,10 +944,10 @@ bool _evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result) { NS_ConvertUTF8toUTF16 utf16script(script->UTF8Characters, script->UTF8Length); - nsIPrincipal *principal = doc->NodePrincipal(); + nsIPrincipal* principal = doc->NodePrincipal(); nsAutoCString specStr; - const char *spec; + const char* spec; nsCOMPtr uri; principal->GetURI(getter_AddRefs(uri)); @@ -984,7 +982,7 @@ bool _evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result) { JS::CompileOptions options(cx); options.setFileAndLine(spec, 0); JS::Rooted rval(cx); - JS::RootedVector scopeChain(cx); + JS::RootedVector scopeChain(cx); if (!JS_IsGlobalObject(obj) && !scopeChain.append(obj)) { return false; } @@ -1011,8 +1009,8 @@ bool _evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result) { (!result || JSValToNPVariant(npp, cx, rval, result)); } -bool _getproperty(NPP npp, NPObject *npobj, NPIdentifier property, - NPVariant *result) { +bool _getproperty(NPP npp, NPObject* npobj, NPIdentifier property, + NPVariant* result) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getproperty called from the wrong thread\n")); @@ -1033,8 +1031,8 @@ bool _getproperty(NPP npp, NPObject *npobj, NPIdentifier property, return true; } -bool _setproperty(NPP npp, NPObject *npobj, NPIdentifier property, - const NPVariant *value) { +bool _setproperty(NPP npp, NPObject* npobj, NPIdentifier property, + const NPVariant* value) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_setproperty called from the wrong thread\n")); @@ -1053,7 +1051,7 @@ bool _setproperty(NPP npp, NPObject *npobj, NPIdentifier property, return npobj->_class->setProperty(npobj, property, value); } -bool _removeproperty(NPP npp, NPObject *npobj, NPIdentifier property) { +bool _removeproperty(NPP npp, NPObject* npobj, NPIdentifier property) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_removeproperty called from the wrong thread\n")); @@ -1072,7 +1070,7 @@ bool _removeproperty(NPP npp, NPObject *npobj, NPIdentifier property) { return npobj->_class->removeProperty(npobj, property); } -bool _hasproperty(NPP npp, NPObject *npobj, NPIdentifier propertyName) { +bool _hasproperty(NPP npp, NPObject* npobj, NPIdentifier propertyName) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_hasproperty called from the wrong thread\n")); @@ -1091,7 +1089,7 @@ bool _hasproperty(NPP npp, NPObject *npobj, NPIdentifier propertyName) { return npobj->_class->hasProperty(npobj, propertyName); } -bool _hasmethod(NPP npp, NPObject *npobj, NPIdentifier methodName) { +bool _hasmethod(NPP npp, NPObject* npobj, NPIdentifier methodName) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_hasmethod called from the wrong thread\n")); @@ -1110,8 +1108,8 @@ bool _hasmethod(NPP npp, NPObject *npobj, NPIdentifier methodName) { return npobj->_class->hasMethod(npobj, methodName); } -bool _enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, - uint32_t *count) { +bool _enumerate(NPP npp, NPObject* npobj, NPIdentifier** identifier, + uint32_t* count) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_enumerate called from the wrong thread\n")); @@ -1135,8 +1133,8 @@ bool _enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, return npobj->_class->enumerate(npobj, identifier, count); } -bool _construct(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result) { +bool _construct(NPP npp, NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_construct called from the wrong thread\n")); @@ -1154,7 +1152,7 @@ bool _construct(NPP npp, NPObject *npobj, const NPVariant *args, return npobj->_class->construct(npobj, args, argCount, result); } -void _releasevariantvalue(NPVariant *variant) { +void _releasevariantvalue(NPVariant* variant) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_releasevariantvalue called from the wrong thread\n")); @@ -1167,14 +1165,14 @@ void _releasevariantvalue(NPVariant *variant) { case NPVariantType_Double: break; case NPVariantType_String: { - const NPString *s = &NPVARIANT_TO_STRING(*variant); + const NPString* s = &NPVARIANT_TO_STRING(*variant); if (s->UTF8Characters) { #if defined(MOZ_MEMORY) && defined(XP_WIN) - if (malloc_usable_size((void *)s->UTF8Characters) != 0) { - free((void *)s->UTF8Characters); + if (malloc_usable_size((void*)s->UTF8Characters) != 0) { + free((void*)s->UTF8Characters); } else { - void *p = (void *)s->UTF8Characters; + void* p = (void*)s->UTF8Characters; DWORD nheaps = 0; AutoTArray heaps; nheaps = GetProcessHeaps(0, heaps.Elements()); @@ -1188,13 +1186,13 @@ void _releasevariantvalue(NPVariant *variant) { } } #else - free((void *)s->UTF8Characters); + free((void*)s->UTF8Characters); #endif } break; } case NPVariantType_Object: { - NPObject *npobj = NPVARIANT_TO_OBJECT(*variant); + NPObject* npobj = NPVARIANT_TO_OBJECT(*variant); if (npobj) _releaseobject(npobj); @@ -1207,7 +1205,7 @@ void _releasevariantvalue(NPVariant *variant) { VOID_TO_NPVARIANT(*variant); } -void _setexception(NPObject *npobj, const NPUTF8 *message) { +void _setexception(NPObject* npobj, const NPUTF8* message) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_setexception called from the wrong thread\n")); @@ -1225,14 +1223,14 @@ void _setexception(NPObject *npobj, const NPUTF8 *message) { gNPPException = strdup(message); } -NPError _getvalue(NPP npp, NPNVariable variable, void *result) { +NPError _getvalue(NPP npp, NPNVariable variable, void* result) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getvalue called from the wrong thread\n")); return NPERR_INVALID_PARAM; } - NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetValue: npp=%p, var=%d\n", - (void *)npp, (int)variable)); + NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, + ("NPN_GetValue: npp=%p, var=%d\n", (void*)npp, (int)variable)); nsresult res; @@ -1245,7 +1243,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { case NPNVxDisplay: { # if defined(MOZ_X11) if (npp) { - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; bool windowless = false; inst->IsWindowless(&windowless); // The documentation on the types for many variables in NP(N|P)_GetValue @@ -1265,7 +1263,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { } } if (windowless || needsXEmbed) { - (*(Display **)result) = mozilla::DefaultXDisplay(); + (*(Display**)result) = mozilla::DefaultXDisplay(); return NPERR_NO_ERROR; } } @@ -1281,7 +1279,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { case NPNVnetscapeWindow: { if (!npp || !npp->ndata) return NPERR_INVALID_INSTANCE_ERROR; - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; RefPtr owner = inst->GetOwner(); NS_ENSURE_TRUE(owner, NPERR_NO_ERROR); @@ -1294,17 +1292,17 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { #endif case NPNVjavascriptEnabledBool: { - *(NPBool *)result = false; + *(NPBool*)result = false; bool js = false; res = Preferences::GetBool("javascript.enabled", &js); if (NS_SUCCEEDED(res)) { - *(NPBool *)result = js; + *(NPBool*)result = js; } return NPERR_NO_ERROR; } case NPNVasdEnabledBool: - *(NPBool *)result = false; + *(NPBool*)result = false; return NPERR_NO_ERROR; case NPNVisOfflineBool: { @@ -1314,65 +1312,65 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { if (NS_SUCCEEDED(res)) res = ioservice->GetOffline(&offline); if (NS_FAILED(res)) return NPERR_GENERIC_ERROR; - *(NPBool *)result = offline; + *(NPBool*)result = offline; return NPERR_NO_ERROR; } case NPNVToolkit: { #ifdef MOZ_WIDGET_GTK - *((NPNToolkitType *)result) = NPNVGtk2; + *((NPNToolkitType*)result) = NPNVGtk2; #endif - if (*(NPNToolkitType *)result) return NPERR_NO_ERROR; + if (*(NPNToolkitType*)result) return NPERR_NO_ERROR; return NPERR_GENERIC_ERROR; } case NPNVSupportsXEmbedBool: { #ifdef MOZ_WIDGET_GTK - *(NPBool *)result = true; + *(NPBool*)result = true; #else - *(NPBool *)result = false; + *(NPBool*)result = false; #endif return NPERR_NO_ERROR; } case NPNVWindowNPObject: { - *(NPObject **)result = _getwindowobject(npp); + *(NPObject**)result = _getwindowobject(npp); - return *(NPObject **)result ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR; + return *(NPObject**)result ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR; } case NPNVPluginElementNPObject: { - *(NPObject **)result = _getpluginelement(npp); + *(NPObject**)result = _getpluginelement(npp); - return *(NPObject **)result ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR; + return *(NPObject**)result ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR; } case NPNVSupportsWindowless: { #if defined(XP_WIN) || defined(XP_MACOSX) || \ (defined(MOZ_X11) && defined(MOZ_WIDGET_GTK)) - *(NPBool *)result = true; + *(NPBool*)result = true; #else - *(NPBool *)result = false; + *(NPBool*)result = false; #endif return NPERR_NO_ERROR; } case NPNVprivateModeBool: { bool privacy; - nsNPAPIPluginInstance *inst = - static_cast(npp->ndata); + nsNPAPIPluginInstance* inst = + static_cast(npp->ndata); if (!inst) return NPERR_GENERIC_ERROR; nsresult rv = inst->IsPrivateBrowsing(&privacy); if (NS_FAILED(rv)) return NPERR_GENERIC_ERROR; - *(NPBool *)result = (NPBool)privacy; + *(NPBool*)result = (NPBool)privacy; return NPERR_NO_ERROR; } case NPNVdocumentOrigin: { - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; if (!inst) { return NPERR_GENERIC_ERROR; } @@ -1383,7 +1381,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { return NPERR_GENERIC_ERROR; } - nsIPrincipal *principal = element->NodePrincipal(); + nsIPrincipal* principal = element->NodePrincipal(); nsAutoString utf16Origin; res = nsContentUtils::GetUTFOrigin(principal, utf16Origin); @@ -1410,18 +1408,18 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { return NPERR_GENERIC_ERROR; } - *(char **)result = ToNewCString(normalizedUTF8Origin); - return *(char **)result ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR; + *(char**)result = ToNewCString(normalizedUTF8Origin); + return *(char**)result ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR; } #ifdef XP_MACOSX case NPNVpluginDrawingModel: { if (npp) { - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; if (inst) { NPDrawingModel drawingModel; - inst->GetDrawingModel((int32_t *)&drawingModel); - *(NPDrawingModel *)result = drawingModel; + inst->GetDrawingModel((int32_t*)&drawingModel); + *(NPDrawingModel*)result = drawingModel; return NPERR_NO_ERROR; } } @@ -1430,70 +1428,70 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { # ifndef NP_NO_QUICKDRAW case NPNVsupportsQuickDrawBool: { - *(NPBool *)result = false; + *(NPBool*)result = false; return NPERR_NO_ERROR; } # endif case NPNVsupportsCoreGraphicsBool: { - *(NPBool *)result = true; + *(NPBool*)result = true; return NPERR_NO_ERROR; } case NPNVsupportsCoreAnimationBool: { - *(NPBool *)result = true; + *(NPBool*)result = true; return NPERR_NO_ERROR; } case NPNVsupportsInvalidatingCoreAnimationBool: { - *(NPBool *)result = true; + *(NPBool*)result = true; return NPERR_NO_ERROR; } case NPNVsupportsCompositingCoreAnimationPluginsBool: { - *(NPBool *)result = PR_TRUE; + *(NPBool*)result = PR_TRUE; return NPERR_NO_ERROR; } # ifndef NP_NO_CARBON case NPNVsupportsCarbonBool: { - *(NPBool *)result = false; + *(NPBool*)result = false; return NPERR_NO_ERROR; } # endif case NPNVsupportsCocoaBool: { - *(NPBool *)result = true; + *(NPBool*)result = true; return NPERR_NO_ERROR; } case NPNVsupportsUpdatedCocoaTextInputBool: { - *(NPBool *)result = true; + *(NPBool*)result = true; return NPERR_NO_ERROR; } #endif #if defined(XP_MACOSX) || defined(XP_WIN) case NPNVcontentsScaleFactor: { - nsNPAPIPluginInstance *inst = - (nsNPAPIPluginInstance *)(npp ? npp->ndata : nullptr); + nsNPAPIPluginInstance* inst = + (nsNPAPIPluginInstance*)(npp ? npp->ndata : nullptr); double scaleFactor = inst ? inst->GetContentsScaleFactor() : 1.0; - *(double *)result = scaleFactor; + *(double*)result = scaleFactor; return NPERR_NO_ERROR; } #endif case NPNVCSSZoomFactor: { - nsNPAPIPluginInstance *inst = - (nsNPAPIPluginInstance *)(npp ? npp->ndata : nullptr); + nsNPAPIPluginInstance* inst = + (nsNPAPIPluginInstance*)(npp ? npp->ndata : nullptr); double scaleFactor = inst ? inst->GetCSSZoomFactor() : 1.0; - *(double *)result = scaleFactor; + *(double*)result = scaleFactor; return NPERR_NO_ERROR; } @@ -1503,7 +1501,7 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { case NPNVserviceManager: // old XPCOM objects, no longer supported, but null out the out // param to avoid crashing plugins that still try to use this. - *(nsISupports **)result = nullptr; + *(nsISupports**)result = nullptr; MOZ_FALLTHROUGH; default: @@ -1513,18 +1511,18 @@ NPError _getvalue(NPP npp, NPNVariable variable, void *result) { } } -NPError _setvalue(NPP npp, NPPVariable variable, void *result) { +NPError _setvalue(NPP npp, NPPVariable variable, void* result) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_setvalue called from the wrong thread\n")); return NPERR_INVALID_PARAM; } - NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_SetValue: npp=%p, var=%d\n", - (void *)npp, (int)variable)); + NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, + ("NPN_SetValue: npp=%p, var=%d\n", (void*)npp, (int)variable)); if (!npp) return NPERR_INVALID_INSTANCE_ERROR; - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; NS_ASSERTION(inst, "null instance"); @@ -1573,7 +1571,7 @@ NPError _setvalue(NPP npp, NPPVariable variable, void *result) { case NPPVpluginIsPlayingAudio: { const bool isPlaying = result; - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)npp->ndata; MOZ_ASSERT(inst); if (!isPlaying && !inst->HasAudioChannelAgent()) { @@ -1612,40 +1610,40 @@ NPError _setvalue(NPP npp, NPPVariable variable, void *result) { } } -NPError _requestread(NPStream *pstream, NPByteRange *rangeList) { +NPError _requestread(NPStream* pstream, NPByteRange* rangeList) { return NPERR_STREAM_NOT_SEEKABLE; } // Deprecated, only stubbed out -void * /* OJI type: JRIEnv* */ +void* /* OJI type: JRIEnv* */ _getJavaEnv() { NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetJavaEnv\n")); return nullptr; } -const char *_useragent(NPP npp) { +const char* _useragent(NPP npp) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_useragent called from the wrong thread\n")); return nullptr; } - NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_UserAgent: npp=%p\n", (void *)npp)); + NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_UserAgent: npp=%p\n", (void*)npp)); nsCOMPtr pluginHostCOM( do_GetService(MOZ_PLUGIN_HOST_CONTRACTID)); - nsPluginHost *pluginHost = static_cast(pluginHostCOM.get()); + nsPluginHost* pluginHost = static_cast(pluginHostCOM.get()); if (!pluginHost) { return nullptr; } - const char *retstr; + const char* retstr; nsresult rv = pluginHost->UserAgent(&retstr); if (NS_FAILED(rv)) return nullptr; return retstr; } -void *_memalloc(uint32_t size) { +void* _memalloc(uint32_t size) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_memalloc called from the wrong thread\n")); @@ -1655,9 +1653,9 @@ void *_memalloc(uint32_t size) { } // Deprecated, only stubbed out -void * /* OJI type: jref */ +void* /* OJI type: jref */ _getJavaPeer(NPP npp) { - NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetJavaPeer: npp=%p\n", (void *)npp)); + NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_GetJavaPeer: npp=%p\n", (void*)npp)); return nullptr; } @@ -1668,8 +1666,8 @@ void _pushpopupsenabledstate(NPP npp, NPBool enabled) { ("NPN_pushpopupsenabledstate called from the wrong thread\n")); return; } - nsNPAPIPluginInstance *inst = - npp ? (nsNPAPIPluginInstance *)npp->ndata : nullptr; + nsNPAPIPluginInstance* inst = + npp ? (nsNPAPIPluginInstance*)npp->ndata : nullptr; if (!inst) return; inst->PushPopupsEnabledState(enabled); @@ -1682,15 +1680,15 @@ void _poppopupsenabledstate(NPP npp) { ("NPN_poppopupsenabledstate called from the wrong thread\n")); return; } - nsNPAPIPluginInstance *inst = - npp ? (nsNPAPIPluginInstance *)npp->ndata : nullptr; + nsNPAPIPluginInstance* inst = + npp ? (nsNPAPIPluginInstance*)npp->ndata : nullptr; if (!inst) return; inst->PopPopupsEnabledState(); } -NPError _getvalueforurl(NPP instance, NPNURLVariable variable, const char *url, - char **value, uint32_t *len) { +NPError _getvalueforurl(NPP instance, NPNURLVariable variable, const char* url, + char** value, uint32_t* len) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_getvalueforurl called from the wrong thread\n")); @@ -1726,8 +1724,8 @@ NPError _getvalueforurl(NPP instance, NPNURLVariable variable, const char *url, return NPERR_GENERIC_ERROR; } -NPError _setvalueforurl(NPP instance, NPNURLVariable variable, const char *url, - const char *value, uint32_t len) { +NPError _setvalueforurl(NPP instance, NPNURLVariable variable, const char* url, + const char* value, uint32_t len) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_setvalueforurl called from the wrong thread\n")); @@ -1765,7 +1763,7 @@ uint32_t _scheduletimer(NPP instance, uint32_t interval, NPBool repeat, return 0; } - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata; if (!inst) return 0; return inst->ScheduleTimer(interval, repeat, timerFunc); @@ -1778,13 +1776,13 @@ void _unscheduletimer(NPP instance, uint32_t timerID) { return; } - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata; if (!inst) return; inst->UnscheduleTimer(timerID); } -NPError _popupcontextmenu(NPP instance, NPMenu *menu) { +NPError _popupcontextmenu(NPP instance, NPMenu* menu) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_popupcontextmenu called from the wrong thread\n")); @@ -1792,13 +1790,13 @@ NPError _popupcontextmenu(NPP instance, NPMenu *menu) { } #ifdef MOZ_WIDGET_COCOA - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata; double pluginX, pluginY; double screenX, screenY; - const NPCocoaEvent *currentEvent = - static_cast(inst->GetCurrentEvent()); + const NPCocoaEvent* currentEvent = + static_cast(inst->GetCurrentEvent()); if (!currentEvent) { return NPERR_GENERIC_ERROR; } @@ -1836,29 +1834,29 @@ NPError _popupcontextmenu(NPP instance, NPMenu *menu) { } NPBool _convertpoint(NPP instance, double sourceX, double sourceY, - NPCoordinateSpace sourceSpace, double *destX, - double *destY, NPCoordinateSpace destSpace) { + NPCoordinateSpace sourceSpace, double* destX, + double* destY, NPCoordinateSpace destSpace) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_convertpoint called from the wrong thread\n")); return 0; } - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata; if (!inst) return false; return inst->ConvertPoint(sourceX, sourceY, sourceSpace, destX, destY, destSpace); } -void _urlredirectresponse(NPP instance, void *notifyData, NPBool allow) { +void _urlredirectresponse(NPP instance, void* notifyData, NPBool allow) { if (!NS_IsMainThread()) { NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS, ("NPN_convertpoint called from the wrong thread\n")); return; } - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata; + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata; if (!inst) { return; } @@ -1866,9 +1864,9 @@ void _urlredirectresponse(NPP instance, void *notifyData, NPBool allow) { inst->URLRedirectResponse(notifyData, allow); } -NPError _initasyncsurface(NPP instance, NPSize *size, NPImageFormat format, - void *initData, NPAsyncSurface *surface) { - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata; +NPError _initasyncsurface(NPP instance, NPSize* size, NPImageFormat format, + void* initData, NPAsyncSurface* surface) { + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata; if (!inst) { return NPERR_GENERIC_ERROR; } @@ -1876,8 +1874,8 @@ NPError _initasyncsurface(NPP instance, NPSize *size, NPImageFormat format, return inst->InitAsyncSurface(size, format, initData, surface); } -NPError _finalizeasyncsurface(NPP instance, NPAsyncSurface *surface) { - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata; +NPError _finalizeasyncsurface(NPP instance, NPAsyncSurface* surface) { + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata; if (!inst) { return NPERR_GENERIC_ERROR; } @@ -1885,9 +1883,9 @@ NPError _finalizeasyncsurface(NPP instance, NPAsyncSurface *surface) { return inst->FinalizeAsyncSurface(surface); } -void _setcurrentasyncsurface(NPP instance, NPAsyncSurface *surface, - NPRect *changed) { - nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata; +void _setcurrentasyncsurface(NPP instance, NPAsyncSurface* surface, + NPRect* changed) { + nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata; if (!inst) { return; } diff --git a/dom/plugins/base/nsNPAPIPlugin.h b/dom/plugins/base/nsNPAPIPlugin.h index ad82110c57825..9f11d6b01e714 100644 --- a/dom/plugins/base/nsNPAPIPlugin.h +++ b/dom/plugins/base/nsNPAPIPlugin.h @@ -27,13 +27,13 @@ class nsNPAPIPlugin final { // Constructs and initializes an nsNPAPIPlugin object. A nullptr file path // will prevent this from calling NP_Initialize. - static nsresult CreatePlugin(nsPluginTag *aPluginTag, - nsNPAPIPlugin **aResult); + static nsresult CreatePlugin(nsPluginTag* aPluginTag, + nsNPAPIPlugin** aResult); - PluginLibrary *GetLibrary(); + PluginLibrary* GetLibrary(); // PluginFuncs() can't fail but results are only valid if GetLibrary() // succeeds - NPPluginFuncs *PluginFuncs(); + NPPluginFuncs* PluginFuncs(); #if defined(XP_MACOSX) && !defined(__LP64__) void SetPluginRefNum(short aRefNum); @@ -43,18 +43,18 @@ class nsNPAPIPlugin final { // crashes and is no longer usable. pluginDumpID/browserDumpID are // the IDs of respective minidumps that were written, or empty if no // minidump was written. - void PluginCrashed(const nsAString &pluginDumpID, - const nsAString &browserDumpID); + void PluginCrashed(const nsAString& pluginDumpID, + const nsAString& browserDumpID); nsresult Shutdown(); - static nsresult RetainStream(NPStream *pstream, nsISupports **aRetainedPeer); + static nsresult RetainStream(NPStream* pstream, nsISupports** aRetainedPeer); private: ~nsNPAPIPlugin(); NPPluginFuncs mPluginFuncs; - PluginLibrary *mLibrary; + PluginLibrary* mLibrary; }; namespace mozilla { @@ -78,11 +78,11 @@ inline bool NPIdentifierIsString(NPIdentifier id) { return JSID_IS_STRING(NPIdentifierToJSId(id)); } -inline JSString *NPIdentifierToString(NPIdentifier id) { +inline JSString* NPIdentifierToString(NPIdentifier id) { return JSID_TO_STRING(NPIdentifierToJSId(id)); } -inline NPIdentifier StringToNPIdentifier(JSContext *cx, JSString *str) { +inline NPIdentifier StringToNPIdentifier(JSContext* cx, JSString* str) { return JSIdToNPIdentifier(INTERNED_STRING_TO_JSID(cx, str)); } @@ -98,7 +98,7 @@ inline NPIdentifier IntToNPIdentifier(int i) { return JSIdToNPIdentifier(INT_TO_JSID(i)); } -JSContext *GetJSContext(NPP npp); +JSContext* GetJSContext(NPP npp); inline bool NPStringIdentifierIsPermanent(NPIdentifier id) { AutoSafeJSContext cx; @@ -107,68 +107,68 @@ inline bool NPStringIdentifierIsPermanent(NPIdentifier id) { #define NPIdentifier_VOID (JSIdToNPIdentifier(JSID_VOID)) -NPObject *_getwindowobject(NPP npp); +NPObject* _getwindowobject(NPP npp); -NPObject *_getpluginelement(NPP npp); +NPObject* _getpluginelement(NPP npp); -NPIdentifier _getstringidentifier(const NPUTF8 *name); +NPIdentifier _getstringidentifier(const NPUTF8* name); -void _getstringidentifiers(const NPUTF8 **names, int32_t nameCount, - NPIdentifier *identifiers); +void _getstringidentifiers(const NPUTF8** names, int32_t nameCount, + NPIdentifier* identifiers); bool _identifierisstring(NPIdentifier identifiers); NPIdentifier _getintidentifier(int32_t intid); -NPUTF8 *_utf8fromidentifier(NPIdentifier identifier); +NPUTF8* _utf8fromidentifier(NPIdentifier identifier); int32_t _intfromidentifier(NPIdentifier identifier); -NPObject *_createobject(NPP npp, NPClass *aClass); +NPObject* _createobject(NPP npp, NPClass* aClass); -NPObject *_retainobject(NPObject *npobj); +NPObject* _retainobject(NPObject* npobj); -void _releaseobject(NPObject *npobj); +void _releaseobject(NPObject* npobj); -bool _invoke(NPP npp, NPObject *npobj, NPIdentifier method, - const NPVariant *args, uint32_t argCount, NPVariant *result); +bool _invoke(NPP npp, NPObject* npobj, NPIdentifier method, + const NPVariant* args, uint32_t argCount, NPVariant* result); -bool _invokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result); +bool _invokeDefault(NPP npp, NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result); -bool _evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result); +bool _evaluate(NPP npp, NPObject* npobj, NPString* script, NPVariant* result); -bool _getproperty(NPP npp, NPObject *npobj, NPIdentifier property, - NPVariant *result); +bool _getproperty(NPP npp, NPObject* npobj, NPIdentifier property, + NPVariant* result); -bool _setproperty(NPP npp, NPObject *npobj, NPIdentifier property, - const NPVariant *value); +bool _setproperty(NPP npp, NPObject* npobj, NPIdentifier property, + const NPVariant* value); -bool _removeproperty(NPP npp, NPObject *npobj, NPIdentifier property); +bool _removeproperty(NPP npp, NPObject* npobj, NPIdentifier property); -bool _hasproperty(NPP npp, NPObject *npobj, NPIdentifier propertyName); +bool _hasproperty(NPP npp, NPObject* npobj, NPIdentifier propertyName); -bool _hasmethod(NPP npp, NPObject *npobj, NPIdentifier methodName); +bool _hasmethod(NPP npp, NPObject* npobj, NPIdentifier methodName); -bool _enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, - uint32_t *count); +bool _enumerate(NPP npp, NPObject* npobj, NPIdentifier** identifier, + uint32_t* count); -bool _construct(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result); +bool _construct(NPP npp, NPObject* npobj, const NPVariant* args, + uint32_t argCount, NPVariant* result); -void _releasevariantvalue(NPVariant *variant); +void _releasevariantvalue(NPVariant* variant); -void _setexception(NPObject *npobj, const NPUTF8 *message); +void _setexception(NPObject* npobj, const NPUTF8* message); void _pushpopupsenabledstate(NPP npp, NPBool enabled); void _poppopupsenabledstate(NPP npp); -NPError _getvalueforurl(NPP instance, NPNURLVariable variable, const char *url, - char **value, uint32_t *len); +NPError _getvalueforurl(NPP instance, NPNURLVariable variable, const char* url, + char** value, uint32_t* len); -NPError _setvalueforurl(NPP instance, NPNURLVariable variable, const char *url, - const char *value, uint32_t len); +NPError _setvalueforurl(NPP instance, NPNURLVariable variable, const char* url, + const char* value, uint32_t len); typedef void (*PluginTimerFunc)(NPP npp, uint32_t timerID); @@ -177,70 +177,70 @@ uint32_t _scheduletimer(NPP instance, uint32_t interval, NPBool repeat, void _unscheduletimer(NPP instance, uint32_t timerID); -NPError _popupcontextmenu(NPP instance, NPMenu *menu); +NPError _popupcontextmenu(NPP instance, NPMenu* menu); NPBool _convertpoint(NPP instance, double sourceX, double sourceY, - NPCoordinateSpace sourceSpace, double *destX, - double *destY, NPCoordinateSpace destSpace); + NPCoordinateSpace sourceSpace, double* destX, + double* destY, NPCoordinateSpace destSpace); -NPError _requestread(NPStream *pstream, NPByteRange *rangeList); +NPError _requestread(NPStream* pstream, NPByteRange* rangeList); -NPError _geturlnotify(NPP npp, const char *relativeURL, const char *target, - void *notifyData); +NPError _geturlnotify(NPP npp, const char* relativeURL, const char* target, + void* notifyData); -NPError _getvalue(NPP npp, NPNVariable variable, void *r_value); +NPError _getvalue(NPP npp, NPNVariable variable, void* r_value); -NPError _setvalue(NPP npp, NPPVariable variable, void *r_value); +NPError _setvalue(NPP npp, NPPVariable variable, void* r_value); -NPError _geturl(NPP npp, const char *relativeURL, const char *target); +NPError _geturl(NPP npp, const char* relativeURL, const char* target); -NPError _posturlnotify(NPP npp, const char *relativeURL, const char *target, - uint32_t len, const char *buf, NPBool file, - void *notifyData); +NPError _posturlnotify(NPP npp, const char* relativeURL, const char* target, + uint32_t len, const char* buf, NPBool file, + void* notifyData); -NPError _posturl(NPP npp, const char *relativeURL, const char *target, - uint32_t len, const char *buf, NPBool file); +NPError _posturl(NPP npp, const char* relativeURL, const char* target, + uint32_t len, const char* buf, NPBool file); -void _status(NPP npp, const char *message); +void _status(NPP npp, const char* message); -void _memfree(void *ptr); +void _memfree(void* ptr); uint32_t _memflush(uint32_t size); void _reloadplugins(NPBool reloadPages); -void _invalidaterect(NPP npp, NPRect *invalidRect); +void _invalidaterect(NPP npp, NPRect* invalidRect); void _invalidateregion(NPP npp, NPRegion invalidRegion); void _forceredraw(NPP npp); -const char *_useragent(NPP npp); +const char* _useragent(NPP npp); -void *_memalloc(uint32_t size); +void* _memalloc(uint32_t size); // Deprecated entry points for the old Java plugin. -void * /* OJI type: JRIEnv* */ +void* /* OJI type: JRIEnv* */ _getJavaEnv(); -void * /* OJI type: jref */ +void* /* OJI type: jref */ _getJavaPeer(NPP npp); -void _urlredirectresponse(NPP instance, void *notifyData, NPBool allow); +void _urlredirectresponse(NPP instance, void* notifyData, NPBool allow); -NPError _initasyncsurface(NPP instance, NPSize *size, NPImageFormat format, - void *initData, NPAsyncSurface *surface); +NPError _initasyncsurface(NPP instance, NPSize* size, NPImageFormat format, + void* initData, NPAsyncSurface* surface); -NPError _finalizeasyncsurface(NPP instance, NPAsyncSurface *surface); +NPError _finalizeasyncsurface(NPP instance, NPAsyncSurface* surface); -void _setcurrentasyncsurface(NPP instance, NPAsyncSurface *surface, - NPRect *changed); +void _setcurrentasyncsurface(NPP instance, NPAsyncSurface* surface, + NPRect* changed); } /* namespace parent */ } /* namespace plugins */ } /* namespace mozilla */ -const char *PeekException(); +const char* PeekException(); void PopException(); @@ -283,7 +283,7 @@ class NPPExceptionAutoHolder { ~NPPExceptionAutoHolder(); protected: - char *mOldException; + char* mOldException; }; #endif // nsNPAPIPlugin_h_ diff --git a/dom/plugins/base/nsPluginDirServiceProvider.cpp b/dom/plugins/base/nsPluginDirServiceProvider.cpp index 9fdc4a6ba57a6..092e1fb9f0a0a 100644 --- a/dom/plugins/base/nsPluginDirServiceProvider.cpp +++ b/dom/plugins/base/nsPluginDirServiceProvider.cpp @@ -35,8 +35,8 @@ NS_IMPL_ISUPPORTS(nsPluginDirServiceProvider, nsIDirectoryServiceProvider) //***************************************************************************** NS_IMETHODIMP -nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant, - nsIFile **_retval) { +nsPluginDirServiceProvider::GetFile(const char* charProp, bool* persistant, + nsIFile** _retval) { NS_ENSURE_ARG(charProp); *_retval = nullptr; @@ -46,7 +46,7 @@ nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant, } nsresult nsPluginDirServiceProvider::GetPLIDDirectories( - nsISimpleEnumerator **aEnumerator) { + nsISimpleEnumerator** aEnumerator) { NS_ENSURE_ARG_POINTER(aEnumerator); *aEnumerator = nullptr; @@ -59,7 +59,7 @@ nsresult nsPluginDirServiceProvider::GetPLIDDirectories( } nsresult nsPluginDirServiceProvider::GetPLIDDirectoriesWithRootKey( - uint32_t aKey, nsCOMArray &aDirs) { + uint32_t aKey, nsCOMArray& aDirs) { nsCOMPtr regKey = do_CreateInstance("@mozilla.org/windows-registry-key;1"); NS_ENSURE_TRUE(regKey, NS_ERROR_FAILURE); @@ -105,7 +105,7 @@ nsresult nsPluginDirServiceProvider::GetPLIDDirectoriesWithRootKey( if (NS_SUCCEEDED(localFile->Exists(&isFileThere)) && isFileThere) { int32_t c = aDirs.Count(); for (int32_t i = 0; i < c; i++) { - nsIFile *dup = static_cast(aDirs[i]); + nsIFile* dup = static_cast(aDirs[i]); if (dup && NS_SUCCEEDED(dup->Equals(localFile, &isDupEntry)) && isDupEntry) { break; diff --git a/dom/plugins/base/nsPluginDirServiceProvider.h b/dom/plugins/base/nsPluginDirServiceProvider.h index 441a0101d7729..bca57e69cb260 100644 --- a/dom/plugins/base/nsPluginDirServiceProvider.h +++ b/dom/plugins/base/nsPluginDirServiceProvider.h @@ -26,11 +26,11 @@ class nsPluginDirServiceProvider : public nsIDirectoryServiceProvider { NS_DECL_NSIDIRECTORYSERVICEPROVIDER #ifdef XP_WIN - static nsresult GetPLIDDirectories(nsISimpleEnumerator **aEnumerator); + static nsresult GetPLIDDirectories(nsISimpleEnumerator** aEnumerator); private: static nsresult GetPLIDDirectoriesWithRootKey(uint32_t aKey, - nsCOMArray &aDirs); + nsCOMArray& aDirs); #endif protected: diff --git a/dom/plugins/base/nsPluginNativeWindow.h b/dom/plugins/base/nsPluginNativeWindow.h index 35b2f12a39ce5..1fa0bea35a59c 100644 --- a/dom/plugins/base/nsPluginNativeWindow.h +++ b/dom/plugins/base/nsPluginNativeWindow.h @@ -33,27 +33,27 @@ class nsPluginNativeWindow : public NPWindow { */ public: - nsresult GetPluginInstance(RefPtr &aPluginInstance) { + nsresult GetPluginInstance(RefPtr& aPluginInstance) { aPluginInstance = mPluginInstance; return NS_OK; } - nsresult SetPluginInstance(nsNPAPIPluginInstance *aPluginInstance) { + nsresult SetPluginInstance(nsNPAPIPluginInstance* aPluginInstance) { if (mPluginInstance != aPluginInstance) mPluginInstance = aPluginInstance; return NS_OK; } - nsresult GetPluginWidget(nsIWidget **aWidget) const { + nsresult GetPluginWidget(nsIWidget** aWidget) const { NS_IF_ADDREF(*aWidget = mWidget); return NS_OK; } - nsresult SetPluginWidget(nsIWidget *aWidget) { + nsresult SetPluginWidget(nsIWidget* aWidget) { mWidget = aWidget; return NS_OK; } public: virtual nsresult CallSetWindow( - RefPtr &aPluginInstance) { + RefPtr& aPluginInstance) { // null aPluginInstance means that we want to call SetWindow(null) if (aPluginInstance) aPluginInstance->SetWindow(this); @@ -69,8 +69,8 @@ class nsPluginNativeWindow : public NPWindow { nsCOMPtr mWidget; }; -nsresult PLUG_NewPluginNativeWindow(nsPluginNativeWindow **aPluginNativeWindow); +nsresult PLUG_NewPluginNativeWindow(nsPluginNativeWindow** aPluginNativeWindow); nsresult PLUG_DeletePluginNativeWindow( - nsPluginNativeWindow *aPluginNativeWindow); + nsPluginNativeWindow* aPluginNativeWindow); #endif //_nsPluginNativeWindow_h_ diff --git a/dom/plugins/base/nsPluginNativeWindowWin.cpp b/dom/plugins/base/nsPluginNativeWindowWin.cpp index cc97959b25440..f093882abd564 100644 --- a/dom/plugins/base/nsPluginNativeWindowWin.cpp +++ b/dom/plugins/base/nsPluginNativeWindowWin.cpp @@ -48,7 +48,7 @@ typedef nsTWeakRef PluginWindowWeakRef; class PluginWindowEvent : public Runnable { public: PluginWindowEvent(); - void Init(const PluginWindowWeakRef &ref, HWND hWnd, UINT msg, WPARAM wParam, + void Init(const PluginWindowWeakRef& ref, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); void Clear(); HWND GetWnd() { return mWnd; }; @@ -78,7 +78,7 @@ void PluginWindowEvent::Clear() { mLParam = 0; } -void PluginWindowEvent::Init(const PluginWindowWeakRef &ref, HWND aWnd, +void PluginWindowEvent::Init(const PluginWindowWeakRef& ref, HWND aWnd, UINT aMsg, WPARAM aWParam, LPARAM aLParam) { NS_ASSERTION(aWnd != nullptr, "invalid plugin event value"); NS_ASSERTION(mWnd == nullptr, "event already in use"); @@ -99,7 +99,7 @@ class nsPluginNativeWindowWin : public nsPluginNativeWindow { virtual ~nsPluginNativeWindowWin(); virtual nsresult CallSetWindow( - RefPtr &aPluginInstance); + RefPtr& aPluginInstance); private: nsresult SubclassAndAssociateWindow(); @@ -110,7 +110,7 @@ class nsPluginNativeWindowWin : public nsPluginNativeWindow { WNDPROC GetPrevWindowProc(); void SetPrevWindowProc(WNDPROC proc) { mPluginWinProc = proc; } WNDPROC GetWindowProc(); - PluginWindowEvent *GetPluginWindowEvent(HWND aWnd, UINT aMsg, WPARAM aWParam, + PluginWindowEvent* GetPluginWindowEvent(HWND aWnd, UINT aMsg, WPARAM aWParam, LPARAM aLParam); private: @@ -128,8 +128,8 @@ class nsPluginNativeWindowWin : public nsPluginNativeWindow { static bool sInPreviousMessageDispatch = false; -static bool ProcessFlashMessageDelayed(nsPluginNativeWindowWin *aWin, - nsNPAPIPluginInstance *aInst, HWND hWnd, +static bool ProcessFlashMessageDelayed(nsPluginNativeWindowWin* aWin, + nsNPAPIPluginInstance* aInst, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { NS_ENSURE_TRUE(aWin, false); NS_ENSURE_TRUE(aInst, false); @@ -158,7 +158,7 @@ static bool ProcessFlashMessageDelayed(nsPluginNativeWindowWin *aWin, class nsDelayedPopupsEnabledEvent : public Runnable { public: - explicit nsDelayedPopupsEnabledEvent(nsNPAPIPluginInstance *inst) + explicit nsDelayedPopupsEnabledEvent(nsNPAPIPluginInstance* inst) : Runnable("nsDelayedPopupsEnabledEvent"), mInst(inst) {} NS_DECL_NSIRUNNABLE @@ -187,7 +187,7 @@ static LRESULT CALLBACK PluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, */ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - nsPluginNativeWindowWin *win = (nsPluginNativeWindowWin *)::GetProp( + nsPluginNativeWindowWin* win = (nsPluginNativeWindowWin*)::GetProp( hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION); if (!win) return TRUE; @@ -344,18 +344,18 @@ static LRESULT CALLBACK PluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, static WindowsDllInterceptor sUser32Intercept; #ifdef _WIN64 -typedef LONG_PTR(WINAPI *User32SetWindowLongPtrA)(HWND hWnd, int nIndex, +typedef LONG_PTR(WINAPI* User32SetWindowLongPtrA)(HWND hWnd, int nIndex, LONG_PTR dwNewLong); -typedef LONG_PTR(WINAPI *User32SetWindowLongPtrW)(HWND hWnd, int nIndex, +typedef LONG_PTR(WINAPI* User32SetWindowLongPtrW)(HWND hWnd, int nIndex, LONG_PTR dwNewLong); static WindowsDllInterceptor::FuncHookType sUser32SetWindowLongAHookStub; static WindowsDllInterceptor::FuncHookType sUser32SetWindowLongWHookStub; #else -typedef LONG(WINAPI *User32SetWindowLongA)(HWND hWnd, int nIndex, +typedef LONG(WINAPI* User32SetWindowLongA)(HWND hWnd, int nIndex, LONG dwNewLong); -typedef LONG(WINAPI *User32SetWindowLongW)(HWND hWnd, int nIndex, +typedef LONG(WINAPI* User32SetWindowLongW)(HWND hWnd, int nIndex, LONG dwNewLong); static WindowsDllInterceptor::FuncHookType sUser32SetWindowLongAHookStub; @@ -364,7 +364,7 @@ static WindowsDllInterceptor::FuncHookType #endif static inline bool SetWindowLongHookCheck(HWND hWnd, int nIndex, LONG_PTR newLong) { - nsPluginNativeWindowWin *win = (nsPluginNativeWindowWin *)GetProp( + nsPluginNativeWindowWin* win = (nsPluginNativeWindowWin*)GetProp( hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION); if (!win || (win && win->mPluginType != nsPluginHost::eSpecialType_Flash) || (nIndex == GWLP_WNDPROC && @@ -386,7 +386,7 @@ LONG WINAPI SetWindowLongAHook(HWND hWnd, int nIndex, LONG newLong) LONG_PTR proc = sUser32SetWindowLongAHookStub(hWnd, nIndex, newLong); // We already checked this in SetWindowLongHookCheck - nsPluginNativeWindowWin *win = (nsPluginNativeWindowWin *)GetProp( + nsPluginNativeWindowWin* win = (nsPluginNativeWindowWin*)GetProp( hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION); // Hook our subclass back up, just like we do on setwindow. @@ -409,7 +409,7 @@ LONG WINAPI SetWindowLongWHook(HWND hWnd, int nIndex, LONG newLong) LONG_PTR proc = sUser32SetWindowLongWHookStub(hWnd, nIndex, newLong); // We already checked this in SetWindowLongHookCheck - nsPluginNativeWindowWin *win = (nsPluginNativeWindowWin *)GetProp( + nsPluginNativeWindowWin* win = (nsPluginNativeWindowWin*)GetProp( hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION); // Hook our subclass back up, just like we do on setwindow. @@ -469,7 +469,7 @@ WNDPROC nsPluginNativeWindowWin::GetPrevWindowProc() { return mPrevWinProc; } WNDPROC nsPluginNativeWindowWin::GetWindowProc() { return mPluginWinProc; } NS_IMETHODIMP PluginWindowEvent::Run() { - nsPluginNativeWindowWin *win = mPluginWindowRef.get(); + nsPluginNativeWindowWin* win = mPluginWindowRef.get(); if (!win) return NS_OK; HWND hWnd = GetWnd(); @@ -493,14 +493,14 @@ NS_IMETHODIMP PluginWindowEvent::Run() { return NS_OK; } -PluginWindowEvent *nsPluginNativeWindowWin::GetPluginWindowEvent( +PluginWindowEvent* nsPluginNativeWindowWin::GetPluginWindowEvent( HWND aWnd, UINT aMsg, WPARAM aWParam, LPARAM aLParam) { if (!mWeakRef) { mWeakRef = this; if (!mWeakRef) return nullptr; } - PluginWindowEvent *event; + PluginWindowEvent* event; // We have the ability to alloc if needed in case in the future some plugin // should post multiple PostMessages. However, this could lead to many @@ -519,7 +519,7 @@ PluginWindowEvent *nsPluginNativeWindowWin::GetPluginWindowEvent( } nsresult nsPluginNativeWindowWin::CallSetWindow( - RefPtr &aPluginInstance) { + RefPtr& aPluginInstance) { // Note, 'window' can be null // check the incoming instance, null indicates that window is going away and @@ -535,7 +535,7 @@ nsresult nsPluginNativeWindowWin::CallSetWindow( // check plugin mime type and cache it if it will need special treatment later if (mPluginType == nsPluginHost::eSpecialType_None) { - const char *mimetype = nullptr; + const char* mimetype = nullptr; if (NS_SUCCEEDED(aPluginInstance->GetMIMEType(&mimetype)) && mimetype) { mPluginType = nsPluginHost::GetSpecialType(nsDependentCString(mimetype)); } @@ -609,9 +609,8 @@ nsresult nsPluginNativeWindowWin::SubclassAndAssociateWindow() { (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)PluginWndProc); if (!mPluginWinProc) return NS_ERROR_FAILURE; - DebugOnly win = - (nsPluginNativeWindowWin *)::GetProp( - hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION); + DebugOnly win = (nsPluginNativeWindowWin*)::GetProp( + hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION); NS_ASSERTION(!win || (win == this), "plugin window already has property and this is not us"); @@ -649,7 +648,7 @@ nsresult nsPluginNativeWindowWin::UndoSubclassAndAssociateWindow() { } nsresult PLUG_NewPluginNativeWindow( - nsPluginNativeWindow **aPluginNativeWindow) { + nsPluginNativeWindow** aPluginNativeWindow) { NS_ENSURE_ARG_POINTER(aPluginNativeWindow); *aPluginNativeWindow = new nsPluginNativeWindowWin(); @@ -657,9 +656,9 @@ nsresult PLUG_NewPluginNativeWindow( } nsresult PLUG_DeletePluginNativeWindow( - nsPluginNativeWindow *aPluginNativeWindow) { + nsPluginNativeWindow* aPluginNativeWindow) { NS_ENSURE_ARG_POINTER(aPluginNativeWindow); - nsPluginNativeWindowWin *p = (nsPluginNativeWindowWin *)aPluginNativeWindow; + nsPluginNativeWindowWin* p = (nsPluginNativeWindowWin*)aPluginNativeWindow; delete p; return NS_OK; } diff --git a/dom/plugins/base/nsPluginsDirUtils.h b/dom/plugins/base/nsPluginsDirUtils.h index 05c63b165748c..e4d929d1fca21 100644 --- a/dom/plugins/base/nsPluginsDirUtils.h +++ b/dom/plugins/base/nsPluginsDirUtils.h @@ -16,20 +16,20 @@ // E.g. "mime type::desecription;" // correct w/o ext // "mime type:desecription;" // wrong w/o ext // -static nsresult ParsePluginMimeDescription(const char *mdesc, - nsPluginInfo &info) { +static nsresult ParsePluginMimeDescription(const char* mdesc, + nsPluginInfo& info) { nsresult rv = NS_ERROR_FAILURE; if (!mdesc || !*mdesc) return rv; - char *mdescDup = + char* mdescDup = PL_strdup(mdesc); // make a dup of intput string we'll change it content char anEmptyString[] = ""; - AutoTArray tmpMimeTypeArr; + AutoTArray tmpMimeTypeArr; char delimiters[] = {':', ':', ';'}; int mimeTypeVariantCount = 0; - char *p = mdescDup; // make a dup of intput string we'll change it content + char* p = mdescDup; // make a dup of intput string we'll change it content while (p) { - char *ptrMimeArray[] = {anEmptyString, anEmptyString, anEmptyString}; + char* ptrMimeArray[] = {anEmptyString, anEmptyString, anEmptyString}; // It's easy to point out ptrMimeArray[0] to the string sounds like // "Mime type is not specified, plugin will not function properly." @@ -42,7 +42,7 @@ static nsresult ParsePluginMimeDescription(const char *mdesc, // empty string on GetMIMEDescription() call, e.g. plugger returns "" if // pluggerrc file is not found. - char *s = p; + char* s = p; int i; for (i = 0; i < (int)sizeof(delimiters) && (p = PL_strchr(s, delimiters[i])); @@ -66,12 +66,10 @@ static nsresult ParsePluginMimeDescription(const char *mdesc, if (mimeTypeVariantCount) { info.fVariantCount = mimeTypeVariantCount; // we can do these 3 mallocs at once, later on code cleanup - info.fMimeTypeArray = - (char **)malloc(mimeTypeVariantCount * sizeof(char *)); + info.fMimeTypeArray = (char**)malloc(mimeTypeVariantCount * sizeof(char*)); info.fMimeDescriptionArray = - (char **)malloc(mimeTypeVariantCount * sizeof(char *)); - info.fExtensionArray = - (char **)malloc(mimeTypeVariantCount * sizeof(char *)); + (char**)malloc(mimeTypeVariantCount * sizeof(char*)); + info.fExtensionArray = (char**)malloc(mimeTypeVariantCount * sizeof(char*)); int j, i; for (j = i = 0; i < mimeTypeVariantCount; i++) { diff --git a/dom/plugins/ipc/PluginUtilsOSX.mm b/dom/plugins/ipc/PluginUtilsOSX.mm index fdfc7e58a944d..9aac0b3c3daa0 100644 --- a/dom/plugins/ipc/PluginUtilsOSX.mm +++ b/dom/plugins/ipc/PluginUtilsOSX.mm @@ -26,10 +26,10 @@ - (void)setContentsScale:(double)scale; @interface CGBridgeLayer : CALayer { DrawPluginFunc mDrawFunc; - void *mPluginInstance; + void* mPluginInstance; nsIntRect mUpdateRect; } -- (void)setDrawFunc:(DrawPluginFunc)aFunc pluginInstance:(void *)aPluginInstance; +- (void)setDrawFunc:(DrawPluginFunc)aFunc pluginInstance:(void*)aPluginInstance; - (void)updateRect:(nsIntRect)aRect; @end @@ -40,7 +40,7 @@ - (void)updateRect:(nsIntRect)aRect; // originally specified in a call to CGBitmapContextCreate() or // CGBitmapContextCreateWithData(). typedef void (*CGBitmapContextSetDataFunc)(CGContextRef c, size_t x, size_t y, size_t width, - size_t height, void *data, size_t bitsPerComponent, + size_t height, void* data, size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow); CGBitmapContextSetDataFunc CGBitmapContextSetDataPtr = NULL; @@ -49,7 +49,7 @@ - (void)updateRect:(nsIntRect)aRect { mUpdateRect.UnionRect(mUpdateRect, aRect); } -- (void)setDrawFunc:(DrawPluginFunc)aFunc pluginInstance:(void *)aPluginInstance { +- (void)setDrawFunc:(DrawPluginFunc)aFunc pluginInstance:(void*)aPluginInstance { mDrawFunc = aFunc; mPluginInstance = aPluginInstance; } @@ -70,16 +70,16 @@ - (void)drawInContext:(CGContextRef)aCGContext { @end -void *mozilla::plugins::PluginUtilsOSX::GetCGLayer(DrawPluginFunc aFunc, void *aPluginInstance, +void* mozilla::plugins::PluginUtilsOSX::GetCGLayer(DrawPluginFunc aFunc, void* aPluginInstance, double aContentsScaleFactor) { - CGBridgeLayer *bridgeLayer = [[CGBridgeLayer alloc] init]; + CGBridgeLayer* bridgeLayer = [[CGBridgeLayer alloc] init]; // We need to make bridgeLayer behave properly when its superlayer changes // size (in nsCARenderer::SetBounds()). bridgeLayer.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable; bridgeLayer.needsDisplayOnBoundsChange = YES; - NSNull *nullValue = [NSNull null]; - NSDictionary *actions = [NSDictionary + NSNull* nullValue = [NSNull null]; + NSDictionary* actions = [NSDictionary dictionaryWithObjectsAndKeys:nullValue, @"bounds", nullValue, @"contents", nullValue, @"contentsRect", nullValue, @"position", nil]; [bridgeLayer setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]]; @@ -100,13 +100,13 @@ - (void)drawInContext:(CGContextRef)aCGContext { return bridgeLayer; } -void mozilla::plugins::PluginUtilsOSX::ReleaseCGLayer(void *cgLayer) { - CGBridgeLayer *bridgeLayer = (CGBridgeLayer *)cgLayer; +void mozilla::plugins::PluginUtilsOSX::ReleaseCGLayer(void* cgLayer) { + CGBridgeLayer* bridgeLayer = (CGBridgeLayer*)cgLayer; [bridgeLayer release]; } -void mozilla::plugins::PluginUtilsOSX::Repaint(void *caLayer, nsIntRect aRect) { - CGBridgeLayer *bridgeLayer = (CGBridgeLayer *)caLayer; +void mozilla::plugins::PluginUtilsOSX::Repaint(void* caLayer, nsIntRect aRect) { + CGBridgeLayer* bridgeLayer = (CGBridgeLayer*)caLayer; [CATransaction begin]; [bridgeLayer updateRect:aRect]; [bridgeLayer setNeedsDisplay]; @@ -116,9 +116,9 @@ - (void)drawInContext:(CGContextRef)aCGContext { @interface EventProcessor : NSObject { RemoteProcessEvents aRemoteEvents; - void *aPluginModule; + void* aPluginModule; } -- (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void *)pluginModule; +- (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void*)pluginModule; - (void)onTick; @end @@ -127,7 +127,7 @@ - (void)onTick { aRemoteEvents(aPluginModule); } -- (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void *)pluginModule { +- (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void*)pluginModule { aRemoteEvents = remoteEvents; aPluginModule = pluginModule; } @@ -135,8 +135,8 @@ - (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void *)p #define EVENT_PROCESS_DELAY 0.05 // 50 ms -NPError mozilla::plugins::PluginUtilsOSX::ShowCocoaContextMenu(void *aMenu, int aX, int aY, - void *pluginModule, +NPError mozilla::plugins::PluginUtilsOSX::ShowCocoaContextMenu(void* aMenu, int aX, int aY, + void* pluginModule, RemoteProcessEvents remoteEvent) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -148,8 +148,8 @@ - (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void *)p // change to an arrow cursor automatically -- as it does in Chrome. [[NSCursor arrowCursor] set]; - EventProcessor *eventProcessor = nullptr; - NSTimer *eventTimer = nullptr; + EventProcessor* eventProcessor = nullptr; + NSTimer* eventTimer = nullptr; if (pluginModule) { // Create a timer to process browser events while waiting // on the menu. This prevents the browser from hanging @@ -166,7 +166,7 @@ - (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void *)p [[NSRunLoop currentRunLoop] addTimer:eventTimer forMode:NSEventTrackingRunLoopMode]; } - NSMenu *nsmenu = reinterpret_cast(aMenu); + NSMenu* nsmenu = reinterpret_cast(aMenu); NSPoint screen_point = ::NSMakePoint(aX, aY); [nsmenu popUpMenuPositioningItem:nil atLocation:screen_point inView:nil]; @@ -191,13 +191,13 @@ - (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void *)p namespace mozilla { namespace plugins { namespace PluginUtilsOSX { -static void *sApplicationASN = NULL; -static void *sApplicationInfoItem = NULL; +static void* sApplicationASN = NULL; +static void* sApplicationInfoItem = NULL; } // namespace PluginUtilsOSX } // namespace plugins } // namespace mozilla -bool mozilla::plugins::PluginUtilsOSX::SetProcessName(const char *aProcessName) { +bool mozilla::plugins::PluginUtilsOSX::SetProcessName(const char* aProcessName) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; nsAutoreleasePool localPool; @@ -205,8 +205,8 @@ - (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void *)p return false; } - NSString *currentName = - [[[NSBundle mainBundle] localizedInfoDictionary] objectForKey:(NSString *)kCFBundleNameKey]; + NSString* currentName = + [[[NSBundle mainBundle] localizedInfoDictionary] objectForKey:(NSString*)kCFBundleNameKey]; char formattedName[1024]; SprintfLiteral(formattedName, "%s %s", [currentName UTF8String], aProcessName); @@ -216,7 +216,7 @@ - (void)setRemoteEvents:(RemoteProcessEvents)remoteEvents pluginModule:(void *)p // This function is based on Chrome/Webkit's and relies on potentially dangerous SPI. typedef CFTypeRef (*LSGetASNType)(); typedef OSStatus (*LSSetInformationItemType)(int, CFTypeRef, CFStringRef, CFStringRef, - CFDictionaryRef *); + CFDictionaryRef*); CFBundleRef launchServices = ::CFBundleGetBundleWithIdentifier(CFSTR("com.apple.LaunchServices")); if (!launchServices) { @@ -244,12 +244,12 @@ typedef OSStatus (*LSSetInformationItemType)(int, CFTypeRef, CFStringRef, CFStri LSSetInformationItemType setInformationItemFunc = reinterpret_cast(sApplicationInfoItem); - void *displayNameKeyAddr = + void* displayNameKeyAddr = ::CFBundleGetDataPointerForName(launchServices, CFSTR("_kLSDisplayNameKey")); CFStringRef displayNameKey = nil; if (displayNameKeyAddr) { - displayNameKey = reinterpret_cast(*(CFStringRef *)displayNameKeyAddr); + displayNameKey = reinterpret_cast(*(CFStringRef*)displayNameKeyAddr); } // Rename will fail without this @@ -350,7 +350,7 @@ typedef OSStatus (*LSSetInformationItemType)(int, CFTypeRef, CFStringRef, CFStri bool nsDoubleBufferCARenderer::HasCALayer() { return !!mCALayer; } -void nsDoubleBufferCARenderer::SetCALayer(void *aCALayer) { mCALayer = aCALayer; } +void nsDoubleBufferCARenderer::SetCALayer(void* aCALayer) { mCALayer = aCALayer; } bool nsDoubleBufferCARenderer::InitFrontSurface(size_t aWidth, size_t aHeight, double aContentsScaleFactor, diff --git a/dom/plugins/test/testplugin/flashplugin/nptest_name.cpp b/dom/plugins/test/testplugin/flashplugin/nptest_name.cpp index deaad995ca8ed..31f4f6321ffd0 100644 --- a/dom/plugins/test/testplugin/flashplugin/nptest_name.cpp +++ b/dom/plugins/test/testplugin/flashplugin/nptest_name.cpp @@ -2,7 +2,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/. */ -const char *sPluginName = "Shockwave Flash"; -const char *sPluginDescription = "Flash plug-in for testing purposes."; -const char *sMimeDescription = +const char* sPluginName = "Shockwave Flash"; +const char* sPluginDescription = "Flash plug-in for testing purposes."; +const char* sMimeDescription = "application/x-shockwave-flash-test:swf:Flash test type"; diff --git a/dom/plugins/test/testplugin/nptest_name.cpp b/dom/plugins/test/testplugin/nptest_name.cpp index 1055bbfe4cf59..3fc6f1fb3cbe9 100644 --- a/dom/plugins/test/testplugin/nptest_name.cpp +++ b/dom/plugins/test/testplugin/nptest_name.cpp @@ -1,8 +1,8 @@ -const char *sPluginName = "Test Plug-in"; -const char *sPluginDescription = +const char* sPluginName = "Test Plug-in"; +const char* sPluginDescription = "Plug-in for testing purposes.\xE2\x84\xA2 " "(\xe0\xa4\xb9\xe0\xa4\xbf\xe0\xa4\xa8\xe0\xa5\x8d\xe0\xa4\xa6\xe0\xa5\x80 " "\xe4\xb8\xad\xe6\x96\x87 " "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9)"; -const char *sMimeDescription = +const char* sMimeDescription = "application/x-test:tst:Test \xE2\x84\xA2 mimetype"; diff --git a/dom/plugins/test/testplugin/secondplugin/nptest_name.cpp b/dom/plugins/test/testplugin/secondplugin/nptest_name.cpp index 12cc68b69428b..23b821ae61f6c 100644 --- a/dom/plugins/test/testplugin/secondplugin/nptest_name.cpp +++ b/dom/plugins/test/testplugin/secondplugin/nptest_name.cpp @@ -2,6 +2,6 @@ * 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/. */ -const char *sPluginName = "Second Test Plug-in"; -const char *sPluginDescription = "Second plug-in for testing purposes."; -const char *sMimeDescription = "application/x-Second-Test:ts2:Second test type"; +const char* sPluginName = "Second Test Plug-in"; +const char* sPluginDescription = "Second plug-in for testing purposes."; +const char* sMimeDescription = "application/x-Second-Test:ts2:Second test type"; diff --git a/dom/plugins/test/testplugin/thirdplugin/nptest_name.cpp b/dom/plugins/test/testplugin/thirdplugin/nptest_name.cpp index 34eb5973d4b4f..f9788020b8ad6 100644 --- a/dom/plugins/test/testplugin/thirdplugin/nptest_name.cpp +++ b/dom/plugins/test/testplugin/thirdplugin/nptest_name.cpp @@ -2,6 +2,6 @@ * 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/. */ -const char *sPluginName = "Third Test Plug-in"; -const char *sPluginDescription = "Third plug-in for testing purposes."; -const char *sMimeDescription = "application/x-Third-Test:ts3:Third test type"; +const char* sPluginName = "Third Test Plug-in"; +const char* sPluginDescription = "Third plug-in for testing purposes."; +const char* sMimeDescription = "application/x-Third-Test:ts3:Third test type"; diff --git a/dom/power/PowerManagerService.cpp b/dom/power/PowerManagerService.cpp index a42231d8e32fa..49dbbee59611c 100644 --- a/dom/power/PowerManagerService.cpp +++ b/dom/power/PowerManagerService.cpp @@ -53,7 +53,7 @@ PowerManagerService::~PowerManagerService() { } void PowerManagerService::ComputeWakeLockState( - const WakeLockInformation &aWakeLockInfo, nsAString &aState) { + const WakeLockInformation& aWakeLockInfo, nsAString& aState) { WakeLockState state = hal::ComputeWakeLockState(aWakeLockInfo.numLocks(), aWakeLockInfo.numHidden()); switch (state) { @@ -69,7 +69,7 @@ void PowerManagerService::ComputeWakeLockState( } } -void PowerManagerService::Notify(const WakeLockInformation &aWakeLockInfo) { +void PowerManagerService::Notify(const WakeLockInformation& aWakeLockInfo) { nsAutoString state; ComputeWakeLockState(aWakeLockInfo, state); @@ -87,7 +87,7 @@ void PowerManagerService::Notify(const WakeLockInformation &aWakeLockInfo) { } NS_IMETHODIMP -PowerManagerService::AddWakeLockListener(nsIDOMMozWakeLockListener *aListener) { +PowerManagerService::AddWakeLockListener(nsIDOMMozWakeLockListener* aListener) { if (mWakeLockListeners.Contains(aListener)) return NS_OK; mWakeLockListeners.AppendElement(aListener); @@ -96,14 +96,14 @@ PowerManagerService::AddWakeLockListener(nsIDOMMozWakeLockListener *aListener) { NS_IMETHODIMP PowerManagerService::RemoveWakeLockListener( - nsIDOMMozWakeLockListener *aListener) { + nsIDOMMozWakeLockListener* aListener) { mWakeLockListeners.RemoveElement(aListener); return NS_OK; } NS_IMETHODIMP -PowerManagerService::GetWakeLockState(const nsAString &aTopic, - nsAString &aState) { +PowerManagerService::GetWakeLockState(const nsAString& aTopic, + nsAString& aState) { WakeLockInformation info; GetWakeLockInfo(aTopic, &info); @@ -113,8 +113,8 @@ PowerManagerService::GetWakeLockState(const nsAString &aTopic, } already_AddRefed PowerManagerService::NewWakeLock( - const nsAString &aTopic, nsPIDOMWindowInner *aWindow, - mozilla::ErrorResult &aRv) { + const nsAString& aTopic, nsPIDOMWindowInner* aWindow, + mozilla::ErrorResult& aRv) { RefPtr wakelock = new WakeLock(); aRv = wakelock->Init(aTopic, aWindow); if (aRv.Failed()) { @@ -125,9 +125,9 @@ already_AddRefed PowerManagerService::NewWakeLock( } NS_IMETHODIMP -PowerManagerService::NewWakeLock(const nsAString &aTopic, - mozIDOMWindow *aWindow, - nsIWakeLock **aWakeLock) { +PowerManagerService::NewWakeLock(const nsAString& aTopic, + mozIDOMWindow* aWindow, + nsIWakeLock** aWakeLock) { mozilla::ErrorResult rv; RefPtr wakelock = NewWakeLock(aTopic, nsPIDOMWindowInner::From(aWindow), rv); @@ -140,7 +140,7 @@ PowerManagerService::NewWakeLock(const nsAString &aTopic, } already_AddRefed PowerManagerService::NewWakeLockOnBehalfOfProcess( - const nsAString &aTopic, ContentParent *aContentParent) { + const nsAString& aTopic, ContentParent* aContentParent) { RefPtr wakelock = new WakeLock(); nsresult rv = wakelock->Init(aTopic, aContentParent); NS_ENSURE_SUCCESS(rv, nullptr); diff --git a/dom/security/nsCSPService.cpp b/dom/security/nsCSPService.cpp index 00206246688d8..0d999337b6448 100644 --- a/dom/security/nsCSPService.cpp +++ b/dom/security/nsCSPService.cpp @@ -34,7 +34,7 @@ CSPService::~CSPService() {} NS_IMPL_ISUPPORTS(CSPService, nsIContentPolicy, nsIChannelEventSink) // Helper function to identify protocols and content types not subject to CSP. -bool subjectToCSP(nsIURI *aURI, nsContentPolicyType aContentType) { +bool subjectToCSP(nsIURI* aURI, nsContentPolicyType aContentType) { nsContentPolicyType contentType = nsContentUtils::InternalContentPolicyTypeToExternal(aContentType); @@ -115,8 +115,8 @@ bool subjectToCSP(nsIURI *aURI, nsContentPolicyType aContentType) { /* nsIContentPolicy implementation */ NS_IMETHODIMP -CSPService::ShouldLoad(nsIURI *aContentLocation, nsILoadInfo *aLoadInfo, - const nsACString &aMimeTypeGuess, int16_t *aDecision) { +CSPService::ShouldLoad(nsIURI* aContentLocation, nsILoadInfo* aLoadInfo, + const nsACString& aMimeTypeGuess, int16_t* aDecision) { if (!aContentLocation) { return NS_ERROR_FAILURE; } @@ -228,9 +228,9 @@ CSPService::ShouldLoad(nsIURI *aContentLocation, nsILoadInfo *aLoadInfo, } NS_IMETHODIMP -CSPService::ShouldProcess(nsIURI *aContentLocation, nsILoadInfo *aLoadInfo, - const nsACString &aMimeTypeGuess, - int16_t *aDecision) { +CSPService::ShouldProcess(nsIURI* aContentLocation, nsILoadInfo* aLoadInfo, + const nsACString& aMimeTypeGuess, + int16_t* aDecision) { if (!aContentLocation) { return NS_ERROR_FAILURE; } @@ -260,9 +260,9 @@ CSPService::ShouldProcess(nsIURI *aContentLocation, nsILoadInfo *aLoadInfo, /* nsIChannelEventSink implementation */ NS_IMETHODIMP -CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel, - nsIChannel *newChannel, uint32_t flags, - nsIAsyncVerifyRedirectCallback *callback) { +CSPService::AsyncOnChannelRedirect(nsIChannel* oldChannel, + nsIChannel* newChannel, uint32_t flags, + nsIAsyncVerifyRedirectCallback* callback) { net::nsAsyncRedirectAutoCallback autoCallback(callback); nsCOMPtr newUri; diff --git a/dom/svg/SVGAnimatedInteger.cpp b/dom/svg/SVGAnimatedInteger.cpp index 474e1beea6cf1..6e4e6db26e461 100644 --- a/dom/svg/SVGAnimatedInteger.cpp +++ b/dom/svg/SVGAnimatedInteger.cpp @@ -22,8 +22,8 @@ static SVGAttrTearoffTable sSVGAnimatedIntegerTearoffTable; -nsresult SVGAnimatedInteger::SetBaseValueString(const nsAString &aValueAsString, - SVGElement *aSVGElement) { +nsresult SVGAnimatedInteger::SetBaseValueString(const nsAString& aValueAsString, + SVGElement* aSVGElement) { bool success; auto token = SVGContentUtils::GetAndEnsureOneToken(aValueAsString, success); @@ -47,12 +47,12 @@ nsresult SVGAnimatedInteger::SetBaseValueString(const nsAString &aValueAsString, return NS_OK; } -void SVGAnimatedInteger::GetBaseValueString(nsAString &aValueAsString) { +void SVGAnimatedInteger::GetBaseValueString(nsAString& aValueAsString) { aValueAsString.Truncate(); aValueAsString.AppendInt(mBaseVal); } -void SVGAnimatedInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) { +void SVGAnimatedInteger::SetBaseValue(int aValue, SVGElement* aSVGElement) { // We can't just rely on SetParsedAttrValue (as called by DidChangeInteger) // detecting redundant changes since it will compare false if the existing // attribute value has an associated serialized version (a string value) even @@ -71,7 +71,7 @@ void SVGAnimatedInteger::SetBaseValue(int aValue, SVGElement *aSVGElement) { aSVGElement->DidChangeInteger(mAttrEnum); } -void SVGAnimatedInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) { +void SVGAnimatedInteger::SetAnimValue(int aValue, SVGElement* aSVGElement) { if (mIsAnimated && aValue == mAnimVal) { return; } @@ -81,7 +81,7 @@ void SVGAnimatedInteger::SetAnimValue(int aValue, SVGElement *aSVGElement) { } already_AddRefed -SVGAnimatedInteger::ToDOMAnimatedInteger(SVGElement *aSVGElement) { +SVGAnimatedInteger::ToDOMAnimatedInteger(SVGElement* aSVGElement) { RefPtr domAnimatedInteger = sSVGAnimatedIntegerTearoffTable.GetTearoff(this); if (!domAnimatedInteger) { @@ -96,13 +96,13 @@ SVGAnimatedInteger::DOMAnimatedInteger::~DOMAnimatedInteger() { sSVGAnimatedIntegerTearoffTable.RemoveTearoff(mVal); } -UniquePtr SVGAnimatedInteger::ToSMILAttr(SVGElement *aSVGElement) { +UniquePtr SVGAnimatedInteger::ToSMILAttr(SVGElement* aSVGElement) { return MakeUnique(this, aSVGElement); } nsresult SVGAnimatedInteger::SMILInteger::ValueFromString( - const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/, - SMILValue &aValue, bool &aPreventCachingOfSandwich) const { + const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, + SMILValue& aValue, bool& aPreventCachingOfSandwich) const { int32_t val; if (!SVGContentUtils::ParseInteger(aStr, val)) { @@ -131,7 +131,7 @@ void SVGAnimatedInteger::SMILInteger::ClearAnimValue() { } nsresult SVGAnimatedInteger::SMILInteger::SetAnimValue( - const SMILValue &aValue) { + const SMILValue& aValue) { NS_ASSERTION(aValue.mType == SMILIntegerType::Singleton(), "Unexpected type to assign animated value"); if (aValue.mType == SMILIntegerType::Singleton()) { diff --git a/dom/svg/SVGAnimatedLengthList.cpp b/dom/svg/SVGAnimatedLengthList.cpp index 7de8876cb2993..56eeb92e7aace 100644 --- a/dom/svg/SVGAnimatedLengthList.cpp +++ b/dom/svg/SVGAnimatedLengthList.cpp @@ -17,14 +17,14 @@ namespace mozilla { using namespace dom; -nsresult SVGAnimatedLengthList::SetBaseValueString(const nsAString &aValue) { +nsresult SVGAnimatedLengthList::SetBaseValueString(const nsAString& aValue) { SVGLengthList newBaseValue; nsresult rv = newBaseValue.SetValueFromString(aValue); if (NS_FAILED(rv)) { return rv; } - DOMSVGAnimatedLengthList *domWrapper = + DOMSVGAnimatedLengthList* domWrapper = DOMSVGAnimatedLengthList::GetDOMWrapperIfExists(this); if (domWrapper) { // We must send this notification *before* changing mBaseVal! If the length @@ -49,7 +49,7 @@ nsresult SVGAnimatedLengthList::SetBaseValueString(const nsAString &aValue) { } void SVGAnimatedLengthList::ClearBaseValue(uint32_t aAttrEnum) { - DOMSVGAnimatedLengthList *domWrapper = + DOMSVGAnimatedLengthList* domWrapper = DOMSVGAnimatedLengthList::GetDOMWrapperIfExists(this); if (domWrapper) { // We must send this notification *before* changing mBaseVal! (See above.) @@ -59,10 +59,10 @@ void SVGAnimatedLengthList::ClearBaseValue(uint32_t aAttrEnum) { // Caller notifies } -nsresult SVGAnimatedLengthList::SetAnimValue(const SVGLengthList &aNewAnimValue, - SVGElement *aElement, +nsresult SVGAnimatedLengthList::SetAnimValue(const SVGLengthList& aNewAnimValue, + SVGElement* aElement, uint32_t aAttrEnum) { - DOMSVGAnimatedLengthList *domWrapper = + DOMSVGAnimatedLengthList* domWrapper = DOMSVGAnimatedLengthList::GetDOMWrapperIfExists(this); if (domWrapper) { // A new animation may totally change the number of items in the animVal @@ -97,9 +97,9 @@ nsresult SVGAnimatedLengthList::SetAnimValue(const SVGLengthList &aNewAnimValue, return NS_OK; } -void SVGAnimatedLengthList::ClearAnimValue(SVGElement *aElement, +void SVGAnimatedLengthList::ClearAnimValue(SVGElement* aElement, uint32_t aAttrEnum) { - DOMSVGAnimatedLengthList *domWrapper = + DOMSVGAnimatedLengthList* domWrapper = DOMSVGAnimatedLengthList::GetDOMWrapperIfExists(this); if (domWrapper) { // When all animation ends, animVal simply mirrors baseVal, which may have @@ -113,7 +113,7 @@ void SVGAnimatedLengthList::ClearAnimValue(SVGElement *aElement, aElement->DidAnimateLengthList(aAttrEnum); } -UniquePtr SVGAnimatedLengthList::ToSMILAttr(SVGElement *aSVGElement, +UniquePtr SVGAnimatedLengthList::ToSMILAttr(SVGElement* aSVGElement, uint8_t aAttrEnum, uint8_t aAxis, bool aCanZeroPadList) { @@ -122,10 +122,10 @@ UniquePtr SVGAnimatedLengthList::ToSMILAttr(SVGElement *aSVGElement, } nsresult SVGAnimatedLengthList::SMILAnimatedLengthList::ValueFromString( - const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/, - SMILValue &aValue, bool &aPreventCachingOfSandwich) const { + const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, + SMILValue& aValue, bool& aPreventCachingOfSandwich) const { SMILValue val(&SVGLengthListSMILType::sSingleton); - SVGLengthListAndInfo *llai = static_cast(val.mU.mPtr); + SVGLengthListAndInfo* llai = static_cast(val.mU.mPtr); nsresult rv = llai->SetValueFromString(aStr); if (NS_SUCCEEDED(rv)) { llai->SetInfo(mElement, mAxis, mCanZeroPadList); @@ -166,7 +166,7 @@ SMILValue SVGAnimatedLengthList::SMILAnimatedLengthList::GetBaseValue() const { SMILValue val; SMILValue tmp(&SVGLengthListSMILType::sSingleton); - SVGLengthListAndInfo *llai = static_cast(tmp.mU.mPtr); + SVGLengthListAndInfo* llai = static_cast(tmp.mU.mPtr); nsresult rv = llai->CopyFrom(mVal->mBaseVal); if (NS_SUCCEEDED(rv)) { llai->SetInfo(mElement, mAxis, mCanZeroPadList); @@ -176,11 +176,11 @@ SMILValue SVGAnimatedLengthList::SMILAnimatedLengthList::GetBaseValue() const { } nsresult SVGAnimatedLengthList::SMILAnimatedLengthList::SetAnimValue( - const SMILValue &aValue) { + const SMILValue& aValue) { NS_ASSERTION(aValue.mType == &SVGLengthListSMILType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SVGLengthListSMILType::sSingleton) { - mVal->SetAnimValue(*static_cast(aValue.mU.mPtr), + mVal->SetAnimValue(*static_cast(aValue.mU.mPtr), mElement, mAttrEnum); } return NS_OK; diff --git a/dom/svg/SVGAnimatedNumberList.cpp b/dom/svg/SVGAnimatedNumberList.cpp index 44073a585880d..7ae1cd40373cd 100644 --- a/dom/svg/SVGAnimatedNumberList.cpp +++ b/dom/svg/SVGAnimatedNumberList.cpp @@ -16,14 +16,14 @@ using namespace mozilla::dom; namespace mozilla { -nsresult SVGAnimatedNumberList::SetBaseValueString(const nsAString &aValue) { +nsresult SVGAnimatedNumberList::SetBaseValueString(const nsAString& aValue) { SVGNumberList newBaseValue; nsresult rv = newBaseValue.SetValueFromString(aValue); if (NS_FAILED(rv)) { return rv; } - DOMSVGAnimatedNumberList *domWrapper = + DOMSVGAnimatedNumberList* domWrapper = DOMSVGAnimatedNumberList::GetDOMWrapperIfExists(this); if (domWrapper) { // We must send this notification *before* changing mBaseVal! If the length @@ -49,7 +49,7 @@ nsresult SVGAnimatedNumberList::SetBaseValueString(const nsAString &aValue) { } void SVGAnimatedNumberList::ClearBaseValue(uint32_t aAttrEnum) { - DOMSVGAnimatedNumberList *domWrapper = + DOMSVGAnimatedNumberList* domWrapper = DOMSVGAnimatedNumberList::GetDOMWrapperIfExists(this); if (domWrapper) { // We must send this notification *before* changing mBaseVal! (See above.) @@ -60,10 +60,10 @@ void SVGAnimatedNumberList::ClearBaseValue(uint32_t aAttrEnum) { // Caller notifies } -nsresult SVGAnimatedNumberList::SetAnimValue(const SVGNumberList &aNewAnimValue, - SVGElement *aElement, +nsresult SVGAnimatedNumberList::SetAnimValue(const SVGNumberList& aNewAnimValue, + SVGElement* aElement, uint32_t aAttrEnum) { - DOMSVGAnimatedNumberList *domWrapper = + DOMSVGAnimatedNumberList* domWrapper = DOMSVGAnimatedNumberList::GetDOMWrapperIfExists(this); if (domWrapper) { // A new animation may totally change the number of items in the animVal @@ -98,9 +98,9 @@ nsresult SVGAnimatedNumberList::SetAnimValue(const SVGNumberList &aNewAnimValue, return NS_OK; } -void SVGAnimatedNumberList::ClearAnimValue(SVGElement *aElement, +void SVGAnimatedNumberList::ClearAnimValue(SVGElement* aElement, uint32_t aAttrEnum) { - DOMSVGAnimatedNumberList *domWrapper = + DOMSVGAnimatedNumberList* domWrapper = DOMSVGAnimatedNumberList::GetDOMWrapperIfExists(this); if (domWrapper) { // When all animation ends, animVal simply mirrors baseVal, which may have @@ -114,16 +114,16 @@ void SVGAnimatedNumberList::ClearAnimValue(SVGElement *aElement, aElement->DidAnimateNumberList(aAttrEnum); } -UniquePtr SVGAnimatedNumberList::ToSMILAttr(SVGElement *aSVGElement, +UniquePtr SVGAnimatedNumberList::ToSMILAttr(SVGElement* aSVGElement, uint8_t aAttrEnum) { return MakeUnique(this, aSVGElement, aAttrEnum); } nsresult SVGAnimatedNumberList::SMILAnimatedNumberList::ValueFromString( - const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/, - SMILValue &aValue, bool &aPreventCachingOfSandwich) const { + const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, + SMILValue& aValue, bool& aPreventCachingOfSandwich) const { SMILValue val(&SVGNumberListSMILType::sSingleton); - SVGNumberListAndInfo *nlai = static_cast(val.mU.mPtr); + SVGNumberListAndInfo* nlai = static_cast(val.mU.mPtr); nsresult rv = nlai->SetValueFromString(aStr); if (NS_SUCCEEDED(rv)) { nlai->SetInfo(mElement); @@ -140,7 +140,7 @@ SMILValue SVGAnimatedNumberList::SMILAnimatedNumberList::GetBaseValue() const { SMILValue val; SMILValue tmp(&SVGNumberListSMILType::sSingleton); - SVGNumberListAndInfo *nlai = static_cast(tmp.mU.mPtr); + SVGNumberListAndInfo* nlai = static_cast(tmp.mU.mPtr); nsresult rv = nlai->CopyFrom(mVal->mBaseVal); if (NS_SUCCEEDED(rv)) { nlai->SetInfo(mElement); @@ -150,11 +150,11 @@ SMILValue SVGAnimatedNumberList::SMILAnimatedNumberList::GetBaseValue() const { } nsresult SVGAnimatedNumberList::SMILAnimatedNumberList::SetAnimValue( - const SMILValue &aValue) { + const SMILValue& aValue) { NS_ASSERTION(aValue.mType == &SVGNumberListSMILType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SVGNumberListSMILType::sSingleton) { - mVal->SetAnimValue(*static_cast(aValue.mU.mPtr), + mVal->SetAnimValue(*static_cast(aValue.mU.mPtr), mElement, mAttrEnum); } return NS_OK; diff --git a/dom/svg/SVGAnimatedPathSegList.cpp b/dom/svg/SVGAnimatedPathSegList.cpp index 130b187d5bc7a..9f55bd5ec1149 100644 --- a/dom/svg/SVGAnimatedPathSegList.cpp +++ b/dom/svg/SVGAnimatedPathSegList.cpp @@ -18,7 +18,7 @@ using namespace mozilla::dom; namespace mozilla { -nsresult SVGAnimatedPathSegList::SetBaseValueString(const nsAString &aValue) { +nsresult SVGAnimatedPathSegList::SetBaseValueString(const nsAString& aValue) { SVGPathData newBaseValue; // The spec says that the path data is parsed and accepted up to the first @@ -33,13 +33,13 @@ nsresult SVGAnimatedPathSegList::SetBaseValueString(const nsAString &aValue) { // change them. See the comments in // DOMSVGPathSegList::InternalListWillChangeTo(). - DOMSVGPathSegList *baseValWrapper = + DOMSVGPathSegList* baseValWrapper = DOMSVGPathSegList::GetDOMWrapperIfExists(GetBaseValKey()); if (baseValWrapper) { baseValWrapper->InternalListWillChangeTo(newBaseValue); } - DOMSVGPathSegList *animValWrapper = nullptr; + DOMSVGPathSegList* animValWrapper = nullptr; if (!IsAnimating()) { // DOM anim val wraps our base val too! animValWrapper = DOMSVGPathSegList::GetDOMWrapperIfExists(GetAnimValKey()); if (animValWrapper) { @@ -71,14 +71,14 @@ nsresult SVGAnimatedPathSegList::SetBaseValueString(const nsAString &aValue) { void SVGAnimatedPathSegList::ClearBaseValue() { // We must send these notifications *before* changing mBaseVal! (See above.) - DOMSVGPathSegList *baseValWrapper = + DOMSVGPathSegList* baseValWrapper = DOMSVGPathSegList::GetDOMWrapperIfExists(GetBaseValKey()); if (baseValWrapper) { baseValWrapper->InternalListWillChangeTo(SVGPathData()); } if (!IsAnimating()) { // DOM anim val wraps our base val too! - DOMSVGPathSegList *animValWrapper = + DOMSVGPathSegList* animValWrapper = DOMSVGPathSegList::GetDOMWrapperIfExists(GetAnimValKey()); if (animValWrapper) { animValWrapper->InternalListWillChangeTo(SVGPathData()); @@ -89,8 +89,8 @@ void SVGAnimatedPathSegList::ClearBaseValue() { // Caller notifies } -nsresult SVGAnimatedPathSegList::SetAnimValue(const SVGPathData &aNewAnimValue, - SVGElement *aElement) { +nsresult SVGAnimatedPathSegList::SetAnimValue(const SVGPathData& aNewAnimValue, + SVGElement* aElement) { // Note that a new animation may totally change the number of items in the // animVal list, either replacing what was essentially a mirror of the // baseVal list, or else replacing and overriding an existing animation. @@ -104,7 +104,7 @@ nsresult SVGAnimatedPathSegList::SetAnimValue(const SVGPathData &aNewAnimValue, // We must send these notifications *before* changing mAnimVal! (See above.) - DOMSVGPathSegList *domWrapper = + DOMSVGPathSegList* domWrapper = DOMSVGPathSegList::GetDOMWrapperIfExists(GetAnimValKey()); if (domWrapper) { domWrapper->InternalListWillChangeTo(aNewAnimValue); @@ -122,10 +122,10 @@ nsresult SVGAnimatedPathSegList::SetAnimValue(const SVGPathData &aNewAnimValue, return rv; } -void SVGAnimatedPathSegList::ClearAnimValue(SVGElement *aElement) { +void SVGAnimatedPathSegList::ClearAnimValue(SVGElement* aElement) { // We must send these notifications *before* changing mAnimVal! (See above.) - DOMSVGPathSegList *domWrapper = + DOMSVGPathSegList* domWrapper = DOMSVGPathSegList::GetDOMWrapperIfExists(GetAnimValKey()); if (domWrapper) { // When all animation ends, animVal simply mirrors baseVal, which may have @@ -141,15 +141,15 @@ bool SVGAnimatedPathSegList::IsRendered() const { return mAnimVal ? !mAnimVal->IsEmpty() : !mBaseVal.IsEmpty(); } -UniquePtr SVGAnimatedPathSegList::ToSMILAttr(SVGElement *aElement) { +UniquePtr SVGAnimatedPathSegList::ToSMILAttr(SVGElement* aElement) { return MakeUnique(this, aElement); } nsresult SVGAnimatedPathSegList::SMILAnimatedPathSegList::ValueFromString( - const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/, - SMILValue &aValue, bool &aPreventCachingOfSandwich) const { + const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, + SMILValue& aValue, bool& aPreventCachingOfSandwich) const { SMILValue val(SVGPathSegListSMILType::Singleton()); - SVGPathDataAndInfo *list = static_cast(val.mU.mPtr); + SVGPathDataAndInfo* list = static_cast(val.mU.mPtr); nsresult rv = list->SetValueFromString(aStr); if (NS_SUCCEEDED(rv)) { list->SetElement(mElement); @@ -167,7 +167,7 @@ SMILValue SVGAnimatedPathSegList::SMILAnimatedPathSegList::GetBaseValue() SMILValue val; SMILValue tmp(SVGPathSegListSMILType::Singleton()); - SVGPathDataAndInfo *list = static_cast(tmp.mU.mPtr); + SVGPathDataAndInfo* list = static_cast(tmp.mU.mPtr); nsresult rv = list->CopyFrom(mVal->mBaseVal); if (NS_SUCCEEDED(rv)) { list->SetElement(mElement); @@ -177,11 +177,11 @@ SMILValue SVGAnimatedPathSegList::SMILAnimatedPathSegList::GetBaseValue() } nsresult SVGAnimatedPathSegList::SMILAnimatedPathSegList::SetAnimValue( - const SMILValue &aValue) { + const SMILValue& aValue) { NS_ASSERTION(aValue.mType == SVGPathSegListSMILType::Singleton(), "Unexpected type to assign animated value"); if (aValue.mType == SVGPathSegListSMILType::Singleton()) { - mVal->SetAnimValue(*static_cast(aValue.mU.mPtr), + mVal->SetAnimValue(*static_cast(aValue.mU.mPtr), mElement); } return NS_OK; diff --git a/dom/svg/SVGAnimatedPointList.cpp b/dom/svg/SVGAnimatedPointList.cpp index fe5e9f940b509..ed00bbde23c53 100644 --- a/dom/svg/SVGAnimatedPointList.cpp +++ b/dom/svg/SVGAnimatedPointList.cpp @@ -18,7 +18,7 @@ using namespace mozilla::dom; namespace mozilla { -nsresult SVGAnimatedPointList::SetBaseValueString(const nsAString &aValue) { +nsresult SVGAnimatedPointList::SetBaseValueString(const nsAString& aValue) { SVGPointList newBaseValue; // The spec says that the point data is parsed and accepted up to the first @@ -33,13 +33,13 @@ nsresult SVGAnimatedPointList::SetBaseValueString(const nsAString &aValue) { // change them. See the comments in // DOMSVGPointList::InternalListWillChangeTo(). - DOMSVGPointList *baseValWrapper = + DOMSVGPointList* baseValWrapper = DOMSVGPointList::GetDOMWrapperIfExists(GetBaseValKey()); if (baseValWrapper) { baseValWrapper->InternalListWillChangeTo(newBaseValue); } - DOMSVGPointList *animValWrapper = nullptr; + DOMSVGPointList* animValWrapper = nullptr; if (!IsAnimating()) { // DOM anim val wraps our base val too! animValWrapper = DOMSVGPointList::GetDOMWrapperIfExists(GetAnimValKey()); if (animValWrapper) { @@ -71,14 +71,14 @@ nsresult SVGAnimatedPointList::SetBaseValueString(const nsAString &aValue) { void SVGAnimatedPointList::ClearBaseValue() { // We must send these notifications *before* changing mBaseVal! (See above.) - DOMSVGPointList *baseValWrapper = + DOMSVGPointList* baseValWrapper = DOMSVGPointList::GetDOMWrapperIfExists(GetBaseValKey()); if (baseValWrapper) { baseValWrapper->InternalListWillChangeTo(SVGPointList()); } if (!IsAnimating()) { // DOM anim val wraps our base val too! - DOMSVGPointList *animValWrapper = + DOMSVGPointList* animValWrapper = DOMSVGPointList::GetDOMWrapperIfExists(GetAnimValKey()); if (animValWrapper) { animValWrapper->InternalListWillChangeTo(SVGPointList()); @@ -89,8 +89,8 @@ void SVGAnimatedPointList::ClearBaseValue() { // Caller notifies } -nsresult SVGAnimatedPointList::SetAnimValue(const SVGPointList &aNewAnimValue, - SVGElement *aElement) { +nsresult SVGAnimatedPointList::SetAnimValue(const SVGPointList& aNewAnimValue, + SVGElement* aElement) { // Note that a new animation may totally change the number of items in the // animVal list, either replacing what was essentially a mirror of the // baseVal list, or else replacing and overriding an existing animation. @@ -106,7 +106,7 @@ nsresult SVGAnimatedPointList::SetAnimValue(const SVGPointList &aNewAnimValue, // We must send this notification *before* changing mAnimVal! (See above.) - DOMSVGPointList *domWrapper = + DOMSVGPointList* domWrapper = DOMSVGPointList::GetDOMWrapperIfExists(GetAnimValKey()); if (domWrapper) { domWrapper->InternalListWillChangeTo(aNewAnimValue); @@ -125,10 +125,10 @@ nsresult SVGAnimatedPointList::SetAnimValue(const SVGPointList &aNewAnimValue, return NS_OK; } -void SVGAnimatedPointList::ClearAnimValue(SVGElement *aElement) { +void SVGAnimatedPointList::ClearAnimValue(SVGElement* aElement) { // We must send these notifications *before* changing mAnimVal! (See above.) - DOMSVGPointList *domWrapper = + DOMSVGPointList* domWrapper = DOMSVGPointList::GetDOMWrapperIfExists(GetAnimValKey()); if (domWrapper) { // When all animation ends, animVal simply mirrors baseVal, which may have @@ -140,15 +140,15 @@ void SVGAnimatedPointList::ClearAnimValue(SVGElement *aElement) { aElement->DidAnimatePointList(); } -UniquePtr SVGAnimatedPointList::ToSMILAttr(SVGElement *aElement) { +UniquePtr SVGAnimatedPointList::ToSMILAttr(SVGElement* aElement) { return MakeUnique(this, aElement); } nsresult SVGAnimatedPointList::SMILAnimatedPointList::ValueFromString( - const nsAString &aStr, const dom::SVGAnimationElement * /*aSrcElement*/, - SMILValue &aValue, bool &aPreventCachingOfSandwich) const { + const nsAString& aStr, const dom::SVGAnimationElement* /*aSrcElement*/, + SMILValue& aValue, bool& aPreventCachingOfSandwich) const { SMILValue val(&SVGPointListSMILType::sSingleton); - SVGPointListAndInfo *list = static_cast(val.mU.mPtr); + SVGPointListAndInfo* list = static_cast(val.mU.mPtr); nsresult rv = list->SetValueFromString(aStr); if (NS_SUCCEEDED(rv)) { list->SetInfo(mElement); @@ -165,7 +165,7 @@ SMILValue SVGAnimatedPointList::SMILAnimatedPointList::GetBaseValue() const { SMILValue val; SMILValue tmp(&SVGPointListSMILType::sSingleton); - SVGPointListAndInfo *list = static_cast(tmp.mU.mPtr); + SVGPointListAndInfo* list = static_cast(tmp.mU.mPtr); nsresult rv = list->CopyFrom(mVal->mBaseVal); if (NS_SUCCEEDED(rv)) { list->SetInfo(mElement); @@ -175,11 +175,11 @@ SMILValue SVGAnimatedPointList::SMILAnimatedPointList::GetBaseValue() const { } nsresult SVGAnimatedPointList::SMILAnimatedPointList::SetAnimValue( - const SMILValue &aValue) { + const SMILValue& aValue) { NS_ASSERTION(aValue.mType == &SVGPointListSMILType::sSingleton, "Unexpected type to assign animated value"); if (aValue.mType == &SVGPointListSMILType::sSingleton) { - mVal->SetAnimValue(*static_cast(aValue.mU.mPtr), + mVal->SetAnimValue(*static_cast(aValue.mU.mPtr), mElement); } return NS_OK; diff --git a/dom/svg/SVGFragmentIdentifier.h b/dom/svg/SVGFragmentIdentifier.h index 14ae65074373a..d26aab5bf8c0d 100644 --- a/dom/svg/SVGFragmentIdentifier.h +++ b/dom/svg/SVGFragmentIdentifier.h @@ -31,16 +31,16 @@ class SVGFragmentIdentifier { * in which case further processing by the caller can stop. Otherwise return * false as we may have an ordinary anchor which needs to be :target matched. */ - static bool ProcessFragmentIdentifier(dom::Document *aDocument, - const nsAString &aAnchorName); + static bool ProcessFragmentIdentifier(dom::Document* aDocument, + const nsAString& aAnchorName); private: /** * Parse an SVG ViewSpec and set applicable attributes on the root element. * @return true if there is a valid ViewSpec */ - static bool ProcessSVGViewSpec(const nsAString &aViewSpec, - dom::SVGSVGElement *root); + static bool ProcessSVGViewSpec(const nsAString& aViewSpec, + dom::SVGSVGElement* root); }; } // namespace mozilla diff --git a/dom/svg/SVGLength.h b/dom/svg/SVGLength.h index 26de57b04f61e..e6ecb87c02d11 100644 --- a/dom/svg/SVGLength.h +++ b/dom/svg/SVGLength.h @@ -43,17 +43,17 @@ class SVGLength { NS_ASSERTION(IsValid(), "Constructed an invalid length"); } - bool operator==(const SVGLength &rhs) const { + bool operator==(const SVGLength& rhs) const { return mValue == rhs.mValue && mUnit == rhs.mUnit; } - void GetValueAsString(nsAString &aValue) const; + void GetValueAsString(nsAString& aValue) const; /** * This method returns true, unless there was a parse failure, in which * case it returns false (and the length is left unchanged). */ - bool SetValueFromString(const nsAString &aString); + bool SetValueFromString(const nsAString& aString); /** * This will usually return a valid, finite number. There is one exception @@ -87,7 +87,7 @@ class SVGLength { * If it's not possible to convert this length's value to user units, then * this method will return numeric_limits::quiet_NaN(). */ - float GetValueInUserUnits(const dom::SVGElement *aElement, + float GetValueInUserUnits(const dom::SVGElement* aElement, uint8_t aAxis) const { return mValue * GetUserUnitsPerUnit(aElement, aAxis); } @@ -98,7 +98,7 @@ class SVGLength { * This method returns numeric_limits::quiet_NaN() if it is not * possible to convert the value to the specified unit. */ - float GetValueInSpecifiedUnit(uint8_t aUnit, const dom::SVGElement *aElement, + float GetValueInSpecifiedUnit(uint8_t aUnit, const dom::SVGElement* aElement, uint8_t aAxis) const; bool IsPercentage() const { @@ -117,7 +117,7 @@ class SVGLength { * factor between the length's current unit and user units is undefined (see * the comments for GetUserUnitsPerInch and GetUserUnitsPerPercent). */ - float GetUserUnitsPerUnit(const dom::SVGElement *aElement, + float GetUserUnitsPerUnit(const dom::SVGElement* aElement, uint8_t aAxis) const; private: @@ -140,7 +140,7 @@ class SVGLength { * This function returns a non-negative value if the conversion factor is * defined, otherwise it returns numeric_limits::quiet_NaN(). */ - static float GetUserUnitsPerPercent(const dom::SVGElement *aElement, + static float GetUserUnitsPerPercent(const dom::SVGElement* aElement, uint8_t aAxis); float mValue; diff --git a/dom/svg/SVGPolygonElement.cpp b/dom/svg/SVGPolygonElement.cpp index 5bb40e3db1c24..0fc689fafdf1a 100644 --- a/dom/svg/SVGPolygonElement.cpp +++ b/dom/svg/SVGPolygonElement.cpp @@ -17,8 +17,8 @@ NS_IMPL_NS_NEW_SVG_ELEMENT(Polygon) namespace mozilla { namespace dom { -JSObject *SVGPolygonElement::WrapNode(JSContext *aCx, - JS::Handle aGivenProto) { +JSObject* SVGPolygonElement::WrapNode(JSContext* aCx, + JS::Handle aGivenProto) { return SVGPolygonElement_Binding::Wrap(aCx, this, aGivenProto); } @@ -26,7 +26,7 @@ JSObject *SVGPolygonElement::WrapNode(JSContext *aCx, // Implementation SVGPolygonElement::SVGPolygonElement( - already_AddRefed &&aNodeInfo) + already_AddRefed&& aNodeInfo) : SVGPolygonElementBase(std::move(aNodeInfo)) {} //---------------------------------------------------------------------- @@ -37,15 +37,15 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPolygonElement) //---------------------------------------------------------------------- // SVGGeometryElement methods -void SVGPolygonElement::GetMarkPoints(nsTArray *aMarks) { +void SVGPolygonElement::GetMarkPoints(nsTArray* aMarks) { SVGPolyElement::GetMarkPoints(aMarks); if (aMarks->IsEmpty() || aMarks->LastElement().type != SVGMark::eEnd) { return; } - SVGMark *endMark = &aMarks->LastElement(); - SVGMark *startMark = &aMarks->ElementAt(0); + SVGMark* endMark = &aMarks->LastElement(); + SVGMark* startMark = &aMarks->ElementAt(0); float angle = std::atan2(startMark->y - endMark->y, startMark->x - endMark->x); @@ -59,8 +59,8 @@ void SVGPolygonElement::GetMarkPoints(nsTArray *aMarks) { SVGMark(startMark->x, startMark->y, startMark->angle, SVGMark::eEnd)); } -already_AddRefed SVGPolygonElement::BuildPath(PathBuilder *aBuilder) { - const SVGPointList &points = mPoints.GetAnimValue(); +already_AddRefed SVGPolygonElement::BuildPath(PathBuilder* aBuilder) { + const SVGPointList& points = mPoints.GetAnimValue(); if (points.IsEmpty()) { return nullptr; diff --git a/dom/svg/SVGTitleElement.h b/dom/svg/SVGTitleElement.h index 316e1de6455e0..d49200e38d197 100644 --- a/dom/svg/SVGTitleElement.h +++ b/dom/svg/SVGTitleElement.h @@ -12,7 +12,7 @@ #include "nsStubMutationObserver.h" nsresult NS_NewSVGTitleElement( - nsIContent **aResult, already_AddRefed &&aNodeInfo); + nsIContent** aResult, already_AddRefed&& aNodeInfo); namespace mozilla { namespace dom { @@ -22,14 +22,14 @@ class SVGTitleElement final : public SVGTitleElementBase, public nsStubMutationObserver { protected: friend nsresult(::NS_NewSVGTitleElement( - nsIContent **aResult, - already_AddRefed &&aNodeInfo)); + nsIContent** aResult, + already_AddRefed&& aNodeInfo)); explicit SVGTitleElement( - already_AddRefed &&aNodeInfo); + already_AddRefed&& aNodeInfo); ~SVGTitleElement() = default; - virtual JSObject *WrapNode(JSContext *aCx, - JS::Handle aGivenProto) override; + virtual JSObject* WrapNode(JSContext* aCx, + JS::Handle aGivenProto) override; public: // interfaces: @@ -42,10 +42,10 @@ class SVGTitleElement final : public SVGTitleElementBase, NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED - virtual nsresult Clone(dom::NodeInfo *, nsINode **aResult) const override; + virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; - virtual nsresult BindToTree(Document *aDocument, nsIContent *aParent, - nsIContent *aBindingParent) override; + virtual nsresult BindToTree(Document* aDocument, nsIContent* aParent, + nsIContent* aBindingParent) override; virtual void UnbindFromTree(bool aDeep = true, bool aNullParent = true) override; diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp index 3339b5f0b9f3c..4e2c96fa7755d 100644 --- a/dom/system/OSFileConstants.cpp +++ b/dom/system/OSFileConstants.cpp @@ -119,7 +119,7 @@ struct OSFileConstantsService::Paths { * @param aOutPath The path to the special directory. In case of error, * the string is set to void. */ -nsresult GetPathToSpecialDir(const char *aKey, nsString &aOutPath) { +nsresult GetPathToSpecialDir(const char* aKey, nsString& aOutPath) { nsCOMPtr file; nsresult rv = NS_GetSpecialDirectory(aKey, getter_AddRefs(file)); if (NS_FAILED(rv) || !file) { @@ -140,8 +140,8 @@ nsresult GetPathToSpecialDir(const char *aKey, nsString &aOutPath) { * and |mPaths->localProfileDir| once the profile is setup. */ NS_IMETHODIMP -OSFileConstantsService::Observe(nsISupports *, const char *aTopic, - const char16_t *) { +OSFileConstantsService::Observe(nsISupports*, const char* aTopic, + const char16_t*) { if (!mInitialized) { // Initialization has not taken place, something is wrong, // don't make things worse. @@ -725,9 +725,9 @@ static const dom::ConstantSpec gWinProperties[] = { * If the field does not exist, create it. If it exists but is not an * object, throw a JS error. */ -JSObject *GetOrCreateObjectProperty(JSContext *cx, - JS::Handle aObject, - const char *aProperty) { +JSObject* GetOrCreateObjectProperty(JSContext* cx, + JS::Handle aObject, + const char* aProperty) { JS::Rooted val(cx); if (!JS_GetProperty(cx, aObject, aProperty, &val)) { return nullptr; @@ -750,12 +750,12 @@ JSObject *GetOrCreateObjectProperty(JSContext *cx, * * If the nsString is void (i.e. IsVoid is true), do nothing. */ -bool SetStringProperty(JSContext *cx, JS::Handle aObject, - const char *aProperty, const nsString aValue) { +bool SetStringProperty(JSContext* cx, JS::Handle aObject, + const char* aProperty, const nsString aValue) { if (aValue.IsVoid()) { return true; } - JSString *strValue = JS_NewUCStringCopyZ(cx, aValue.get()); + JSString* strValue = JS_NewUCStringCopyZ(cx, aValue.get()); NS_ENSURE_TRUE(strValue, false); JS::Rooted valValue(cx, JS::StringValue(strValue)); return JS_SetProperty(cx, aObject, aProperty, valValue); @@ -768,7 +768,7 @@ bool SetStringProperty(JSContext *cx, JS::Handle aObject, * all its constants. */ bool OSFileConstantsService::DefineOSFileConstants( - JSContext *aCx, JS::Handle aGlobal) { + JSContext* aCx, JS::Handle aGlobal) { if (!mInitialized) { JS_ReportErrorNumberASCII(aCx, js::GetErrorMessage, nullptr, JSMSG_CANT_OPEN, "OSFileConstants", @@ -776,18 +776,18 @@ bool OSFileConstantsService::DefineOSFileConstants( return false; } - JS::Rooted objOS(aCx); + JS::Rooted objOS(aCx); if (!(objOS = GetOrCreateObjectProperty(aCx, aGlobal, "OS"))) { return false; } - JS::Rooted objConstants(aCx); + JS::Rooted objConstants(aCx); if (!(objConstants = GetOrCreateObjectProperty(aCx, objOS, "Constants"))) { return false; } // Build OS.Constants.libc - JS::Rooted objLibc(aCx); + JS::Rooted objLibc(aCx); if (!(objLibc = GetOrCreateObjectProperty(aCx, objConstants, "libc"))) { return false; } @@ -798,7 +798,7 @@ bool OSFileConstantsService::DefineOSFileConstants( #if defined(XP_WIN) // Build OS.Constants.Win - JS::Rooted objWin(aCx); + JS::Rooted objWin(aCx); if (!(objWin = GetOrCreateObjectProperty(aCx, objConstants, "Win"))) { return false; } @@ -809,7 +809,7 @@ bool OSFileConstantsService::DefineOSFileConstants( // Build OS.Constants.Sys - JS::Rooted objSys(aCx); + JS::Rooted objSys(aCx); if (!(objSys = GetOrCreateObjectProperty(aCx, objConstants, "Sys"))) { return false; } @@ -821,7 +821,7 @@ bool OSFileConstantsService::DefineOSFileConstants( DebugOnly rv = runtime->GetOS(os); MOZ_ASSERT(NS_SUCCEEDED(rv)); - JSString *strVersion = JS_NewStringCopyZ(aCx, os.get()); + JSString* strVersion = JS_NewStringCopyZ(aCx, os.get()); if (!strVersion) { return false; } @@ -856,7 +856,7 @@ bool OSFileConstantsService::DefineOSFileConstants( // Build OS.Constants.Path - JS::Rooted objPath(aCx); + JS::Rooted objPath(aCx); if (!(objPath = GetOrCreateObjectProperty(aCx, objConstants, "Path"))) { return false; } @@ -961,7 +961,7 @@ OSFileConstantsService::~OSFileConstantsService() { } NS_IMETHODIMP -OSFileConstantsService::Init(JSContext *aCx) { +OSFileConstantsService::Init(JSContext* aCx) { MOZ_ASSERT(NS_IsMainThread()); nsresult rv = InitOSFileConstants(); @@ -969,8 +969,8 @@ OSFileConstantsService::Init(JSContext *aCx) { return rv; } - mozJSComponentLoader *loader = mozJSComponentLoader::Get(); - JS::Rooted targetObj(aCx); + mozJSComponentLoader* loader = mozJSComponentLoader::Get(); + JS::Rooted targetObj(aCx); loader->FindTargetObject(aCx, &targetObj); if (!DefineOSFileConstants(aCx, targetObj)) { diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.cpp b/dom/webbrowserpersist/nsWebBrowserPersist.cpp index 47b94490f87df..fda3351ee9ee4 100644 --- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp +++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp @@ -102,7 +102,7 @@ struct nsWebBrowserPersist::URIData { nsCString mRelativePathToData; nsCString mCharset; - nsresult GetLocalURI(nsIURI *targetBaseURI, nsCString &aSpecOut); + nsresult GetLocalURI(nsIURI* targetBaseURI, nsCString& aSpecOut); }; // Information about the output stream @@ -114,7 +114,7 @@ struct nsWebBrowserPersist::OutputData { int64_t mSelfProgressMax; bool mCalcFileExt; - OutputData(nsIURI *aFile, nsIURI *aOriginalLocation, bool aCalcFileExt) + OutputData(nsIURI* aFile, nsIURI* aOriginalLocation, bool aCalcFileExt) : mFile(aFile), mOriginalLocation(aOriginalLocation), mSelfProgress(0), @@ -132,7 +132,7 @@ struct nsWebBrowserPersist::UploadData { int64_t mSelfProgress; int64_t mSelfProgressMax; - explicit UploadData(nsIURI *aFile) + explicit UploadData(nsIURI* aFile) : mFile(aFile), mSelfProgress(0), mSelfProgressMax(10000) {} }; @@ -147,7 +147,7 @@ struct nsWebBrowserPersist::CleanupData { class nsWebBrowserPersist::OnWalk final : public nsIWebBrowserPersistResourceVisitor { public: - OnWalk(nsWebBrowserPersist *aParent, nsIURI *aFile, nsIFile *aDataPath) + OnWalk(nsWebBrowserPersist* aParent, nsIURI* aFile, nsIFile* aDataPath) : mParent(aParent), mFile(aFile), mDataPath(aDataPath) {} NS_DECL_NSIWEBBROWSERPERSISTRESOURCEVISITOR @@ -166,7 +166,7 @@ NS_IMPL_ISUPPORTS(nsWebBrowserPersist::OnWalk, class nsWebBrowserPersist::OnWrite final : public nsIWebBrowserPersistWriteCompletion { public: - OnWrite(nsWebBrowserPersist *aParent, nsIURI *aFile, nsIFile *aLocalFile) + OnWrite(nsWebBrowserPersist* aParent, nsIURI* aFile, nsIFile* aLocalFile) : mParent(aParent), mFile(aFile), mLocalFile(aLocalFile) {} NS_DECL_NSIWEBBROWSERPERSISTWRITECOMPLETION @@ -185,10 +185,10 @@ NS_IMPL_ISUPPORTS(nsWebBrowserPersist::OnWrite, class nsWebBrowserPersist::FlatURIMap final : public nsIWebBrowserPersistURIMap { public: - explicit FlatURIMap(const nsACString &aTargetBase) + explicit FlatURIMap(const nsACString& aTargetBase) : mTargetBase(aTargetBase) {} - void Add(const nsACString &aMapFrom, const nsACString &aMapTo) { + void Add(const nsACString& aMapFrom, const nsACString& aMapTo) { mMapFrom.AppendElement(aMapFrom); mMapTo.AppendElement(aMapTo); } @@ -207,22 +207,22 @@ class nsWebBrowserPersist::FlatURIMap final NS_IMPL_ISUPPORTS(nsWebBrowserPersist::FlatURIMap, nsIWebBrowserPersistURIMap) NS_IMETHODIMP -nsWebBrowserPersist::FlatURIMap::GetNumMappedURIs(uint32_t *aNum) { +nsWebBrowserPersist::FlatURIMap::GetNumMappedURIs(uint32_t* aNum) { MOZ_ASSERT(mMapFrom.Length() == mMapTo.Length()); *aNum = mMapTo.Length(); return NS_OK; } NS_IMETHODIMP -nsWebBrowserPersist::FlatURIMap::GetTargetBaseURI(nsACString &aTargetBase) { +nsWebBrowserPersist::FlatURIMap::GetTargetBaseURI(nsACString& aTargetBase) { aTargetBase = mTargetBase; return NS_OK; } NS_IMETHODIMP nsWebBrowserPersist::FlatURIMap::GetURIMapping(uint32_t aIndex, - nsACString &aMapFrom, - nsACString &aMapTo) { + nsACString& aMapFrom, + nsACString& aMapTo) { MOZ_ASSERT(mMapFrom.Length() == mMapTo.Length()); if (aIndex >= mMapTo.Length()) { return NS_ERROR_INVALID_ARG; @@ -244,7 +244,7 @@ const uint32_t kDefaultPersistFlags = nsIWebBrowserPersist::PERSIST_FLAGS_REPLACE_EXISTING_FILES; // String bundle where error messages come from -const char *kWebBrowserPersistStringBundle = +const char* kWebBrowserPersistStringBundle = "chrome://global/locale/nsWebBrowserPersist.properties"; nsWebBrowserPersist::nsWebBrowserPersist() @@ -289,8 +289,8 @@ NS_INTERFACE_MAP_END // nsWebBrowserPersist::nsIInterfaceRequestor //***************************************************************************** -NS_IMETHODIMP nsWebBrowserPersist::GetInterface(const nsIID &aIID, - void **aIFace) { +NS_IMETHODIMP nsWebBrowserPersist::GetInterface(const nsIID& aIID, + void** aIFace) { NS_ENSURE_ARG_POINTER(aIFace); *aIFace = nullptr; @@ -318,7 +318,7 @@ NS_IMETHODIMP nsWebBrowserPersist::GetInterface(const nsIID &aIID, // nsWebBrowserPersist::nsIWebBrowserPersist //***************************************************************************** -NS_IMETHODIMP nsWebBrowserPersist::GetPersistFlags(uint32_t *aPersistFlags) { +NS_IMETHODIMP nsWebBrowserPersist::GetPersistFlags(uint32_t* aPersistFlags) { NS_ENSURE_ARG_POINTER(aPersistFlags); *aPersistFlags = mPersistFlags; return NS_OK; @@ -332,7 +332,7 @@ NS_IMETHODIMP nsWebBrowserPersist::SetPersistFlags(uint32_t aPersistFlags) { return NS_OK; } -NS_IMETHODIMP nsWebBrowserPersist::GetCurrentState(uint32_t *aCurrentState) { +NS_IMETHODIMP nsWebBrowserPersist::GetCurrentState(uint32_t* aCurrentState) { NS_ENSURE_ARG_POINTER(aCurrentState); if (mCompleted) { *aCurrentState = PERSIST_STATE_FINISHED; @@ -344,14 +344,14 @@ NS_IMETHODIMP nsWebBrowserPersist::GetCurrentState(uint32_t *aCurrentState) { return NS_OK; } -NS_IMETHODIMP nsWebBrowserPersist::GetResult(nsresult *aResult) { +NS_IMETHODIMP nsWebBrowserPersist::GetResult(nsresult* aResult) { NS_ENSURE_ARG_POINTER(aResult); *aResult = mPersistResult; return NS_OK; } NS_IMETHODIMP nsWebBrowserPersist::GetProgressListener( - nsIWebProgressListener **aProgressListener) { + nsIWebProgressListener** aProgressListener) { NS_ENSURE_ARG_POINTER(aProgressListener); *aProgressListener = mProgressListener; NS_IF_ADDREF(*aProgressListener); @@ -359,7 +359,7 @@ NS_IMETHODIMP nsWebBrowserPersist::GetProgressListener( } NS_IMETHODIMP nsWebBrowserPersist::SetProgressListener( - nsIWebProgressListener *aProgressListener) { + nsIWebProgressListener* aProgressListener) { mProgressListener = aProgressListener; mProgressListener2 = do_QueryInterface(aProgressListener); mEventSink = do_GetInterface(aProgressListener); @@ -367,10 +367,10 @@ NS_IMETHODIMP nsWebBrowserPersist::SetProgressListener( } NS_IMETHODIMP nsWebBrowserPersist::SaveURI( - nsIURI *aURI, nsIPrincipal *aPrincipal, uint32_t aCacheKey, - nsIURI *aReferrer, uint32_t aReferrerPolicy, nsIInputStream *aPostData, - const char *aExtraHeaders, nsISupports *aFile, - nsILoadContext *aPrivacyContext) { + nsIURI* aURI, nsIPrincipal* aPrincipal, uint32_t aCacheKey, + nsIURI* aReferrer, uint32_t aReferrerPolicy, nsIInputStream* aPostData, + const char* aExtraHeaders, nsISupports* aFile, + nsILoadContext* aPrivacyContext) { bool isPrivate = aPrivacyContext && aPrivacyContext->UsePrivateBrowsing(); return SavePrivacyAwareURI(aURI, aPrincipal, aCacheKey, aReferrer, aReferrerPolicy, aPostData, aExtraHeaders, aFile, @@ -378,9 +378,9 @@ NS_IMETHODIMP nsWebBrowserPersist::SaveURI( } NS_IMETHODIMP nsWebBrowserPersist::SavePrivacyAwareURI( - nsIURI *aURI, nsIPrincipal *aPrincipal, uint32_t aCacheKey, - nsIURI *aReferrer, uint32_t aReferrerPolicy, nsIInputStream *aPostData, - const char *aExtraHeaders, nsISupports *aFile, bool aIsPrivate) { + nsIURI* aURI, nsIPrincipal* aPrincipal, uint32_t aCacheKey, + nsIURI* aReferrer, uint32_t aReferrerPolicy, nsIInputStream* aPostData, + const char* aExtraHeaders, nsISupports* aFile, bool aIsPrivate) { NS_ENSURE_TRUE(mFirstAndOnlyUse, NS_ERROR_FAILURE); mFirstAndOnlyUse = false; // Stop people from reusing this object! @@ -397,8 +397,8 @@ NS_IMETHODIMP nsWebBrowserPersist::SavePrivacyAwareURI( return NS_FAILED(rv) ? rv : NS_OK; } -NS_IMETHODIMP nsWebBrowserPersist::SaveChannel(nsIChannel *aChannel, - nsISupports *aFile) { +NS_IMETHODIMP nsWebBrowserPersist::SaveChannel(nsIChannel* aChannel, + nsISupports* aFile) { NS_ENSURE_TRUE(mFirstAndOnlyUse, NS_ERROR_FAILURE); mFirstAndOnlyUse = false; // Stop people from reusing this object! @@ -416,10 +416,10 @@ NS_IMETHODIMP nsWebBrowserPersist::SaveChannel(nsIChannel *aChannel, return NS_FAILED(rv) ? rv : NS_OK; } -NS_IMETHODIMP nsWebBrowserPersist::SaveDocument(nsISupports *aDocument, - nsISupports *aFile, - nsISupports *aDataPath, - const char *aOutputContentType, +NS_IMETHODIMP nsWebBrowserPersist::SaveDocument(nsISupports* aDocument, + nsISupports* aFile, + nsISupports* aDataPath, + const char* aOutputContentType, uint32_t aEncodingFlags, uint32_t aWrapColumn) { NS_ENSURE_TRUE(mFirstAndOnlyUse, NS_ERROR_FAILURE); @@ -490,9 +490,9 @@ NS_IMETHODIMP nsWebBrowserPersist::CancelSave() { return Cancel(NS_BINDING_ABORTED); } -nsresult nsWebBrowserPersist::StartUpload(nsIStorageStream *storStream, - nsIURI *aDestinationURI, - const nsACString &aContentType) { +nsresult nsWebBrowserPersist::StartUpload(nsIStorageStream* storStream, + nsIURI* aDestinationURI, + const nsACString& aContentType) { // setup the upload channel if the destination is not local nsCOMPtr inputstream; nsresult rv = storStream->NewInputStream(0, getter_AddRefs(inputstream)); @@ -501,9 +501,9 @@ nsresult nsWebBrowserPersist::StartUpload(nsIStorageStream *storStream, return StartUpload(inputstream, aDestinationURI, aContentType); } -nsresult nsWebBrowserPersist::StartUpload(nsIInputStream *aInputStream, - nsIURI *aDestinationURI, - const nsACString &aContentType) { +nsresult nsWebBrowserPersist::StartUpload(nsIInputStream* aInputStream, + nsIURI* aDestinationURI, + const nsACString& aContentType) { nsCOMPtr destChannel; CreateChannelFromURI(aDestinationURI, getter_AddRefs(destChannel)); nsCOMPtr uploadChannel(do_QueryInterface(destChannel)); @@ -536,7 +536,7 @@ void nsWebBrowserPersist::SerializeNextFile() { // bottleneck, the count of not-yet-persisted URIs could be // maintained separately. for (auto iter = mURIMap.Iter(); !iter.Done(); iter.Next()) { - URIData *data = iter.UserData(); + URIData* data = iter.UserData(); if (data->mNeedsPersisting && !data->mSaved) { urisToPersist++; } @@ -548,7 +548,7 @@ void nsWebBrowserPersist::SerializeNextFile() { // Persist each file in the uri map. The document(s) // will be saved after the last one of these is saved. for (auto iter = mURIMap.Iter(); !iter.Done(); iter.Next()) { - URIData *data = iter.UserData(); + URIData* data = iter.UserData(); if (!data->mNeedsPersisting || data->mSaved) { continue; @@ -699,9 +699,9 @@ void nsWebBrowserPersist::SerializeNextFile() { } NS_IMETHODIMP -nsWebBrowserPersist::OnWrite::OnFinish(nsIWebBrowserPersistDocument *aDoc, - nsIOutputStream *aStream, - const nsACString &aContentType, +nsWebBrowserPersist::OnWrite::OnFinish(nsIWebBrowserPersistDocument* aDoc, + nsIOutputStream* aStream, + const nsACString& aContentType, nsresult aStatus) { nsresult rv = aStatus; @@ -735,7 +735,7 @@ nsWebBrowserPersist::OnWrite::OnFinish(nsIWebBrowserPersistDocument *aDoc, // nsWebBrowserPersist::nsIRequestObserver //***************************************************************************** -NS_IMETHODIMP nsWebBrowserPersist::OnStartRequest(nsIRequest *request) { +NS_IMETHODIMP nsWebBrowserPersist::OnStartRequest(nsIRequest* request) { if (mProgressListener) { uint32_t stateFlags = nsIWebProgressListener::STATE_START | nsIWebProgressListener::STATE_IS_REQUEST; @@ -749,14 +749,14 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStartRequest(nsIRequest *request) { NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE); nsCOMPtr keyPtr = do_QueryInterface(request); - OutputData *data = mOutputMap.Get(keyPtr); + OutputData* data = mOutputMap.Get(keyPtr); // NOTE: This code uses the channel as a hash key so it will not // recognize redirected channels because the key is not the same. // When that happens we remove and add the data entry to use the // new channel as the hash key. if (!data) { - UploadData *upData = mUploadList.Get(keyPtr); + UploadData* upData = mUploadList.Get(keyPtr); if (!upData) { // Redirect? Try and fixup the output table nsresult rv = FixRedirectedChannelEntry(channel); @@ -806,7 +806,7 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStartRequest(nsIRequest *request) { if (NS_SUCCEEDED(rv)) { nsAutoCString spec; chanURI->GetSpec(spec); - URIData *uridata; + URIData* uridata; if (mURIMap.Get(spec, &uridata)) { uridata->mFile = data->mFile; } @@ -829,10 +829,10 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStartRequest(nsIRequest *request) { return NS_OK; } -NS_IMETHODIMP nsWebBrowserPersist::OnStopRequest(nsIRequest *request, +NS_IMETHODIMP nsWebBrowserPersist::OnStopRequest(nsIRequest* request, nsresult status) { nsCOMPtr keyPtr = do_QueryInterface(request); - OutputData *data = mOutputMap.Get(keyPtr); + OutputData* data = mOutputMap.Get(keyPtr); if (data) { if (NS_SUCCEEDED(mPersistResult) && NS_FAILED(status)) { SendErrorStatusChange(true, status, request, data->mFile); @@ -842,7 +842,7 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStopRequest(nsIRequest *request, mOutputMap.Remove(keyPtr); } else { // if we didn't find the data in mOutputMap, try mUploadList - UploadData *upData = mUploadList.Get(keyPtr); + UploadData* upData = mUploadList.Get(keyPtr); if (upData) { mUploadList.Remove(keyPtr); } @@ -868,8 +868,8 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStopRequest(nsIRequest *request, //***************************************************************************** NS_IMETHODIMP -nsWebBrowserPersist::OnDataAvailable(nsIRequest *request, - nsIInputStream *aIStream, uint64_t aOffset, +nsWebBrowserPersist::OnDataAvailable(nsIRequest* request, + nsIInputStream* aIStream, uint64_t aOffset, uint32_t aLength) { bool cancel = mCancel; if (!cancel) { @@ -880,7 +880,7 @@ nsWebBrowserPersist::OnDataAvailable(nsIRequest *request, NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE); nsCOMPtr keyPtr = do_QueryInterface(request); - OutputData *data = mOutputMap.Get(keyPtr); + OutputData* data = mOutputMap.Get(keyPtr); if (!data) { // might be uploadData; consume necko's buffer and bail... uint32_t n; @@ -913,7 +913,7 @@ nsWebBrowserPersist::OnDataAvailable(nsIRequest *request, // full), we get NS_OK with some bytes written, then an error. // So, we want to write again in that case to get the actual // error code. - const char *bufPtr = buffer; // Where to write from. + const char* bufPtr = buffer; // Where to write from. while (NS_SUCCEEDED(rv) && bytesRead) { uint32_t bytesWritten = 0; rv = data->mStream->Write(bufPtr, bytesRead, &bytesWritten); @@ -988,8 +988,8 @@ nsWebBrowserPersist::OnDataAvailable(nsIRequest *request, // nsWebBrowserPersist::nsIProgressEventSink //***************************************************************************** -NS_IMETHODIMP nsWebBrowserPersist::OnProgress(nsIRequest *request, - nsISupports *ctxt, +NS_IMETHODIMP nsWebBrowserPersist::OnProgress(nsIRequest* request, + nsISupports* ctxt, int64_t aProgress, int64_t aProgressMax) { if (!mProgressListener) { @@ -998,12 +998,12 @@ NS_IMETHODIMP nsWebBrowserPersist::OnProgress(nsIRequest *request, // Store the progress of this request nsCOMPtr keyPtr = do_QueryInterface(request); - OutputData *data = mOutputMap.Get(keyPtr); + OutputData* data = mOutputMap.Get(keyPtr); if (data) { data->mSelfProgress = aProgress; data->mSelfProgressMax = aProgressMax; } else { - UploadData *upData = mUploadList.Get(keyPtr); + UploadData* upData = mUploadList.Get(keyPtr); if (upData) { upData->mSelfProgress = aProgress; upData->mSelfProgressMax = aProgressMax; @@ -1032,9 +1032,9 @@ NS_IMETHODIMP nsWebBrowserPersist::OnProgress(nsIRequest *request, return NS_OK; } -NS_IMETHODIMP nsWebBrowserPersist::OnStatus(nsIRequest *request, - nsISupports *ctxt, nsresult status, - const char16_t *statusArg) { +NS_IMETHODIMP nsWebBrowserPersist::OnStatus(nsIRequest* request, + nsISupports* ctxt, nsresult status, + const char16_t* statusArg) { if (mProgressListener) { // We need to filter out non-error error codes. // Is the only NS_SUCCEEDED value NS_OK? @@ -1078,8 +1078,8 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStatus(nsIRequest *request, // notification to the web progress listener. nsresult nsWebBrowserPersist::SendErrorStatusChange(bool aIsReadError, nsresult aResult, - nsIRequest *aRequest, - nsIURI *aURI) { + nsIRequest* aRequest, + nsIURI* aURI) { NS_ENSURE_ARG_POINTER(aURI); if (!mProgressListener) { @@ -1101,7 +1101,7 @@ nsresult nsWebBrowserPersist::SendErrorStatusChange(bool aIsReadError, AppendUTF8toUTF16(fileurl, path); } - const char *msgId; + const char* msgId; switch (aResult) { case NS_ERROR_FILE_NAME_TOO_LONG: // File name too long. @@ -1145,7 +1145,7 @@ nsresult nsWebBrowserPersist::SendErrorStatusChange(bool aIsReadError, NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && bundle, NS_ERROR_FAILURE); nsAutoString msgText; - const char16_t *strings[1]; + const char16_t* strings[1]; strings[0] = path.get(); rv = bundle->FormatStringFromName(msgId, strings, 1, msgText); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); @@ -1155,8 +1155,8 @@ nsresult nsWebBrowserPersist::SendErrorStatusChange(bool aIsReadError, return NS_OK; } -nsresult nsWebBrowserPersist::GetValidURIFromObject(nsISupports *aObject, - nsIURI **aURI) const { +nsresult nsWebBrowserPersist::GetValidURIFromObject(nsISupports* aObject, + nsIURI** aURI) const { NS_ENSURE_ARG_POINTER(aObject); NS_ENSURE_ARG_POINTER(aURI); @@ -1175,8 +1175,8 @@ nsresult nsWebBrowserPersist::GetValidURIFromObject(nsISupports *aObject, } /* static */ -nsresult nsWebBrowserPersist::GetLocalFileFromURI(nsIURI *aURI, - nsIFile **aLocalFile) { +nsresult nsWebBrowserPersist::GetLocalFileFromURI(nsIURI* aURI, + nsIFile** aLocalFile) { nsresult rv; nsCOMPtr fileURL = do_QueryInterface(aURI, &rv); @@ -1193,9 +1193,9 @@ nsresult nsWebBrowserPersist::GetLocalFileFromURI(nsIURI *aURI, } /* static */ -nsresult nsWebBrowserPersist::AppendPathToURI(nsIURI *aURI, - const nsAString &aPath, - nsCOMPtr &aOutURI) { +nsresult nsWebBrowserPersist::AppendPathToURI(nsIURI* aURI, + const nsAString& aPath, + nsCOMPtr& aOutURI) { NS_ENSURE_ARG_POINTER(aURI); nsAutoCString newPath; @@ -1215,10 +1215,10 @@ nsresult nsWebBrowserPersist::AppendPathToURI(nsIURI *aURI, } nsresult nsWebBrowserPersist::SaveURIInternal( - nsIURI *aURI, nsIPrincipal *aTriggeringPrincipal, + nsIURI* aURI, nsIPrincipal* aTriggeringPrincipal, nsContentPolicyType aContentPolicyType, uint32_t aCacheKey, - nsIURI *aReferrer, uint32_t aReferrerPolicy, nsIInputStream *aPostData, - const char *aExtraHeaders, nsIURI *aFile, bool aCalcFileExt, + nsIURI* aReferrer, uint32_t aReferrerPolicy, nsIInputStream* aPostData, + const char* aExtraHeaders, nsIURI* aFile, bool aCalcFileExt, bool aIsPrivate) { NS_ENSURE_ARG_POINTER(aURI); NS_ENSURE_ARG_POINTER(aFile); @@ -1247,7 +1247,7 @@ nsresult nsWebBrowserPersist::SaveURIInternal( aContentPolicyType, cookieSettings, nullptr, // aPerformanceStorage nullptr, // aLoadGroup - static_cast(this), loadFlags); + static_cast(this), loadFlags); nsCOMPtr pbChannel = do_QueryInterface(inputChannel); @@ -1304,7 +1304,7 @@ nsresult nsWebBrowserPersist::SaveURIInternal( nsAutoCString headerValue; int32_t crlf = 0; int32_t colon = 0; - const char *kWhitespace = "\b\t\r\n "; + const char* kWhitespace = "\b\t\r\n "; nsAutoCString extraHeaders(aExtraHeaders); while (true) { crlf = extraHeaders.Find("\r\n", true); @@ -1330,8 +1330,8 @@ nsresult nsWebBrowserPersist::SaveURIInternal( return SaveChannelInternal(inputChannel, aFile, aCalcFileExt); } -nsresult nsWebBrowserPersist::SaveChannelInternal(nsIChannel *aChannel, - nsIURI *aFile, +nsresult nsWebBrowserPersist::SaveChannelInternal(nsIChannel* aChannel, + nsIURI* aFile, bool aCalcFileExt) { NS_ENSURE_ARG_POINTER(aChannel); NS_ENSURE_ARG_POINTER(aFile); @@ -1390,7 +1390,7 @@ nsresult nsWebBrowserPersist::SaveChannelInternal(nsIChannel *aChannel, } nsresult nsWebBrowserPersist::GetExtensionForContentType( - const char16_t *aContentType, char16_t **aExt) { + const char16_t* aContentType, char16_t** aExt) { NS_ENSURE_ARG_POINTER(aContentType); NS_ENSURE_ARG_POINTER(aExt); @@ -1416,7 +1416,7 @@ nsresult nsWebBrowserPersist::GetExtensionForContentType( } nsresult nsWebBrowserPersist::SaveDocumentDeferred( - mozilla::UniquePtr &&aData) { + mozilla::UniquePtr&& aData) { nsresult rv = SaveDocumentInternal(aData->mDocument, aData->mFile, aData->mDataPath); if (NS_FAILED(rv)) { @@ -1427,7 +1427,7 @@ nsresult nsWebBrowserPersist::SaveDocumentDeferred( } nsresult nsWebBrowserPersist::SaveDocumentInternal( - nsIWebBrowserPersistDocument *aDocument, nsIURI *aFile, nsIURI *aDataPath) { + nsIWebBrowserPersistDocument* aDocument, nsIURI* aFile, nsIURI* aDataPath) { mURI = nullptr; NS_ENSURE_ARG_POINTER(aDocument); NS_ENSURE_ARG_POINTER(aFile); @@ -1534,7 +1534,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( // filenames of saved URIs are known, the documents can be fixed up and // saved - auto *docData = new DocData; + auto* docData = new DocData; docData->mBaseURI = mCurrentBaseURI; docData->mCharset = mCurrentCharset; docData->mDocument = aDocument; @@ -1547,7 +1547,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( new OnWalk(this, aFile, localDataPath); return aDocument->ReadResources(visit); } else { - auto *docData = new DocData; + auto* docData = new DocData; docData->mBaseURI = mCurrentBaseURI; docData->mCharset = mCurrentCharset; docData->mDocument = aDocument; @@ -1562,15 +1562,15 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal( NS_IMETHODIMP nsWebBrowserPersist::OnWalk::VisitResource( - nsIWebBrowserPersistDocument *aDoc, const nsACString &aURI, + nsIWebBrowserPersistDocument* aDoc, const nsACString& aURI, nsContentPolicyType aContentPolicyType) { return mParent->StoreURI(nsAutoCString(aURI).get(), aDoc, aContentPolicyType); } NS_IMETHODIMP nsWebBrowserPersist::OnWalk::VisitDocument( - nsIWebBrowserPersistDocument *aDoc, nsIWebBrowserPersistDocument *aSubDoc) { - URIData *data = nullptr; + nsIWebBrowserPersistDocument* aDoc, nsIWebBrowserPersistDocument* aSubDoc) { + URIData* data = nullptr; nsAutoCString uriSpec; nsresult rv = aSubDoc->GetDocumentURI(uriSpec); NS_ENSURE_SUCCESS(rv, rv); @@ -1586,7 +1586,7 @@ nsWebBrowserPersist::OnWalk::VisitDocument( } NS_IMETHODIMP -nsWebBrowserPersist::OnWalk::EndVisit(nsIWebBrowserPersistDocument *aDoc, +nsWebBrowserPersist::OnWalk::EndVisit(nsIWebBrowserPersistDocument* aDoc, nsresult aStatus) { if (NS_FAILED(aStatus)) { mParent->SendErrorStatusChange(true, aStatus, nullptr, mFile); @@ -1597,8 +1597,8 @@ nsWebBrowserPersist::OnWalk::EndVisit(nsIWebBrowserPersistDocument *aDoc, return NS_OK; } -void nsWebBrowserPersist::FinishSaveDocumentInternal(nsIURI *aFile, - nsIFile *aDataPath) { +void nsWebBrowserPersist::FinishSaveDocumentInternal(nsIURI* aFile, + nsIFile* aDataPath) { // If there are things to persist, create a directory to hold them if (mCurrentThingsToPersist > 0) { if (aDataPath) { @@ -1623,7 +1623,7 @@ void nsWebBrowserPersist::FinishSaveDocumentInternal(nsIURI *aFile, } if (mPersistFlags & PERSIST_FLAGS_CLEANUP_ON_FAILURE) { // Add to list of things to delete later if all goes wrong - auto *cleanupData = new CleanupData; + auto* cleanupData = new CleanupData; cleanupData->mFile = aDataPath; cleanupData->mIsDirectory = true; mCleanupList.AppendElement(cleanupData); @@ -1668,13 +1668,13 @@ void nsWebBrowserPersist::Cleanup() { uint32_t i; for (i = 0; i < mDocList.Length(); i++) { - DocData *docData = mDocList.ElementAt(i); + DocData* docData = mDocList.ElementAt(i); delete docData; } mDocList.Clear(); for (i = 0; i < mCleanupList.Length(); i++) { - CleanupData *cleanupData = mCleanupList.ElementAt(i); + CleanupData* cleanupData = mCleanupList.ElementAt(i); delete cleanupData; } mCleanupList.Clear(); @@ -1691,7 +1691,7 @@ void nsWebBrowserPersist::CleanupLocalFiles() { for (pass = 0; pass < 2; pass++) { uint32_t i; for (i = 0; i < mCleanupList.Length(); i++) { - CleanupData *cleanupData = mCleanupList.ElementAt(i); + CleanupData* cleanupData = mCleanupList.ElementAt(i); nsCOMPtr file = cleanupData->mFile; // Test if the dir / file exists (something in an earlier loop @@ -1767,7 +1767,7 @@ void nsWebBrowserPersist::CleanupLocalFiles() { } nsresult nsWebBrowserPersist::CalculateUniqueFilename( - nsIURI *aURI, nsCOMPtr &aOutURI) { + nsIURI* aURI, nsCOMPtr& aOutURI) { nsCOMPtr url(do_QueryInterface(aURI)); NS_ENSURE_TRUE(url, NS_ERROR_FAILURE); @@ -1904,8 +1904,8 @@ nsresult nsWebBrowserPersist::CalculateUniqueFilename( return NS_OK; } -nsresult nsWebBrowserPersist::MakeFilenameFromURI(nsIURI *aURI, - nsString &aFilename) { +nsresult nsWebBrowserPersist::MakeFilenameFromURI(nsIURI* aURI, + nsString& aFilename) { // Try to get filename from the URI. nsAutoString fileName; @@ -1925,7 +1925,7 @@ nsresult nsWebBrowserPersist::MakeFilenameFromURI(nsIURI *aURI, // Unescape the file name (GetFileName escapes it) NS_UnescapeURL(nameFromURL); uint32_t nameLength = 0; - const char *p = nameFromURL.get(); + const char* p = nameFromURL.get(); for (; *p && *p != ';' && *p != '?' && *p != '#' && *p != '.'; p++) { if (IsAsciiAlpha(*p) || IsAsciiDigit(*p) || *p == '.' || *p == '-' || *p == '_' || (*p == ' ')) { @@ -1958,8 +1958,8 @@ nsresult nsWebBrowserPersist::MakeFilenameFromURI(nsIURI *aURI, } nsresult nsWebBrowserPersist::CalculateAndAppendFileExt( - nsIURI *aURI, nsIChannel *aChannel, nsIURI *aOriginalURIWithExtension, - nsCOMPtr &aOutURI) { + nsIURI* aURI, nsIChannel* aChannel, nsIURI* aOriginalURIWithExtension, + nsCOMPtr& aOutURI) { nsresult rv = NS_OK; if (!mMIMEService) { @@ -2055,7 +2055,7 @@ nsresult nsWebBrowserPersist::CalculateAndAppendFileExt( } nsresult nsWebBrowserPersist::MakeOutputStream( - nsIURI *aURI, nsIOutputStream **aOutputStream) { + nsIURI* aURI, nsIOutputStream** aOutputStream) { nsresult rv; nsCOMPtr localFile; @@ -2069,7 +2069,7 @@ nsresult nsWebBrowserPersist::MakeOutputStream( } nsresult nsWebBrowserPersist::MakeOutputStreamFromFile( - nsIFile *aFile, nsIOutputStream **aOutputStream) { + nsIFile* aFile, nsIOutputStream** aOutputStream) { nsresult rv = NS_OK; nsCOMPtr fileOutputStream = @@ -2089,7 +2089,7 @@ nsresult nsWebBrowserPersist::MakeOutputStreamFromFile( if (mPersistFlags & PERSIST_FLAGS_CLEANUP_ON_FAILURE) { // Add to cleanup list in event of failure - auto *cleanupData = new CleanupData; + auto* cleanupData = new CleanupData; if (!cleanupData) { NS_RELEASE(*aOutputStream); return NS_ERROR_OUT_OF_MEMORY; @@ -2103,7 +2103,7 @@ nsresult nsWebBrowserPersist::MakeOutputStreamFromFile( } nsresult nsWebBrowserPersist::MakeOutputStreamFromURI( - nsIURI *aURI, nsIOutputStream **aOutputStream) { + nsIURI* aURI, nsIOutputStream** aOutputStream) { uint32_t segsize = 8192; uint32_t maxsize = uint32_t(-1); nsCOMPtr storStream; @@ -2151,16 +2151,16 @@ void nsWebBrowserPersist::EndDownload(nsresult aResult) { } nsresult nsWebBrowserPersist::FixRedirectedChannelEntry( - nsIChannel *aNewChannel) { + nsIChannel* aNewChannel) { NS_ENSURE_ARG_POINTER(aNewChannel); // Iterate through existing open channels looking for one with a URI // matching the one specified. nsCOMPtr originalURI; aNewChannel->GetOriginalURI(getter_AddRefs(originalURI)); - nsISupports *matchingKey = nullptr; + nsISupports* matchingKey = nullptr; for (auto iter = mOutputMap.Iter(); !iter.Done(); iter.Next()) { - nsISupports *key = iter.Key(); + nsISupports* key = iter.Key(); nsCOMPtr thisChannel = do_QueryInterface(key); nsCOMPtr thisURI; @@ -2200,7 +2200,7 @@ void nsWebBrowserPersist::CalcTotalProgress() { // Total up the progress of each output stream for (auto iter = mOutputMap.Iter(); !iter.Done(); iter.Next()) { // Only count toward total progress if destination file is local. - OutputData *data = iter.UserData(); + OutputData* data = iter.UserData(); nsCOMPtr fileURL = do_QueryInterface(data->mFile); if (fileURL) { mTotalCurrentProgress += data->mSelfProgress; @@ -2212,7 +2212,7 @@ void nsWebBrowserPersist::CalcTotalProgress() { if (mUploadList.Count() > 0) { // Total up the progress of each upload for (auto iter = mUploadList.Iter(); !iter.Done(); iter.Next()) { - UploadData *data = iter.UserData(); + UploadData* data = iter.UserData(); if (data) { mTotalCurrentProgress += data->mSelfProgress; mTotalMaxProgress += data->mSelfProgressMax; @@ -2228,10 +2228,10 @@ void nsWebBrowserPersist::CalcTotalProgress() { } } -nsresult nsWebBrowserPersist::StoreURI(const char *aURI, - nsIWebBrowserPersistDocument *aDoc, +nsresult nsWebBrowserPersist::StoreURI(const char* aURI, + nsIWebBrowserPersistDocument* aDoc, nsContentPolicyType aContentPolicyType, - bool aNeedsPersisting, URIData **aData) { + bool aNeedsPersisting, URIData** aData) { NS_ENSURE_ARG_POINTER(aURI); nsCOMPtr uri; @@ -2242,10 +2242,10 @@ nsresult nsWebBrowserPersist::StoreURI(const char *aURI, return StoreURI(uri, aDoc, aContentPolicyType, aNeedsPersisting, aData); } -nsresult nsWebBrowserPersist::StoreURI(nsIURI *aURI, - nsIWebBrowserPersistDocument *aDoc, +nsresult nsWebBrowserPersist::StoreURI(nsIURI* aURI, + nsIWebBrowserPersistDocument* aDoc, nsContentPolicyType aContentPolicyType, - bool aNeedsPersisting, URIData **aData) { + bool aNeedsPersisting, URIData** aData) { NS_ENSURE_ARG_POINTER(aURI); if (aData) { *aData = nullptr; @@ -2264,7 +2264,7 @@ nsresult nsWebBrowserPersist::StoreURI(nsIURI *aURI, return NS_OK; } - URIData *data = nullptr; + URIData* data = nullptr; MakeAndStoreLocalFilenameInURIMap(aURI, aDoc, aContentPolicyType, aNeedsPersisting, &data); if (aData) { @@ -2274,8 +2274,8 @@ nsresult nsWebBrowserPersist::StoreURI(nsIURI *aURI, return NS_OK; } -nsresult nsWebBrowserPersist::URIData::GetLocalURI(nsIURI *targetBaseURI, - nsCString &aSpecOut) { +nsresult nsWebBrowserPersist::URIData::GetLocalURI(nsIURI* targetBaseURI, + nsCString& aSpecOut) { aSpecOut.SetIsVoid(true); if (!mNeedsFixup) { return NS_OK; @@ -2345,14 +2345,14 @@ nsresult nsWebBrowserPersist::URIData::GetLocalURI(nsIURI *targetBaseURI, return NS_OK; } -bool nsWebBrowserPersist::DocumentEncoderExists(const char *aContentType) { +bool nsWebBrowserPersist::DocumentEncoderExists(const char* aContentType) { return do_getDocumentTypeSupportedForEncoding(aContentType); } nsresult nsWebBrowserPersist::SaveSubframeContent( - nsIWebBrowserPersistDocument *aFrameContent, - nsIWebBrowserPersistDocument *aParentDocument, const nsCString &aURISpec, - URIData *aData) { + nsIWebBrowserPersistDocument* aFrameContent, + nsIWebBrowserPersistDocument* aParentDocument, const nsCString& aURISpec, + URIData* aData) { NS_ENSURE_ARG_POINTER(aData); // Extract the content type for the frame's contents. @@ -2441,8 +2441,8 @@ nsresult nsWebBrowserPersist::SaveSubframeContent( return NS_OK; } -nsresult nsWebBrowserPersist::CreateChannelFromURI(nsIURI *aURI, - nsIChannel **aChannel) { +nsresult nsWebBrowserPersist::CreateChannelFromURI(nsIURI* aURI, + nsIChannel** aChannel) { nsresult rv = NS_OK; *aChannel = nullptr; @@ -2453,7 +2453,7 @@ nsresult nsWebBrowserPersist::CreateChannelFromURI(nsIURI *aURI, NS_ENSURE_ARG_POINTER(*aChannel); rv = (*aChannel)->SetNotificationCallbacks( - static_cast(this)); + static_cast(this)); NS_ENSURE_SUCCESS(rv, rv); return NS_OK; } @@ -2461,9 +2461,9 @@ nsresult nsWebBrowserPersist::CreateChannelFromURI(nsIURI *aURI, // we store the current location as the key (absolutized version of domnode's // attribute's value) nsresult nsWebBrowserPersist::MakeAndStoreLocalFilenameInURIMap( - nsIURI *aURI, nsIWebBrowserPersistDocument *aDoc, + nsIURI* aURI, nsIWebBrowserPersistDocument* aDoc, nsContentPolicyType aContentPolicyType, bool aNeedsPersisting, - URIData **aData) { + URIData** aData) { NS_ENSURE_ARG_POINTER(aURI); nsAutoCString spec; @@ -2471,7 +2471,7 @@ nsresult nsWebBrowserPersist::MakeAndStoreLocalFilenameInURIMap( NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); // Create a sensibly named filename for the URI and store in the URI map - URIData *data; + URIData* data; if (mURIMap.Get(spec, &data)) { if (aNeedsPersisting) { data->mNeedsPersisting = true; @@ -2516,7 +2516,7 @@ nsresult nsWebBrowserPersist::MakeAndStoreLocalFilenameInURIMap( } // Decide if we need to apply conversion to the passed channel. -void nsWebBrowserPersist::SetApplyConversionIfNeeded(nsIChannel *aChannel) { +void nsWebBrowserPersist::SetApplyConversionIfNeeded(nsIChannel* aChannel) { nsresult rv = NS_OK; nsCOMPtr encChannel = do_QueryInterface(aChannel, &rv); if (NS_FAILED(rv)) return; diff --git a/dom/webbrowserpersist/nsWebBrowserPersist.h b/dom/webbrowserpersist/nsWebBrowserPersist.h index a21f28ed98b1b..9d95b32b5e5e3 100644 --- a/dom/webbrowserpersist/nsWebBrowserPersist.h +++ b/dom/webbrowserpersist/nsWebBrowserPersist.h @@ -55,20 +55,20 @@ class nsWebBrowserPersist final : public nsIInterfaceRequestor, // Private members private: virtual ~nsWebBrowserPersist(); - nsresult SaveURIInternal(nsIURI *aURI, nsIPrincipal *aTriggeringPrincipal, + nsresult SaveURIInternal(nsIURI* aURI, nsIPrincipal* aTriggeringPrincipal, nsContentPolicyType aContentPolicyType, - uint32_t aCacheKey, nsIURI *aReferrer, - uint32_t aReferrerPolicy, nsIInputStream *aPostData, - const char *aExtraHeaders, nsIURI *aFile, + uint32_t aCacheKey, nsIURI* aReferrer, + uint32_t aReferrerPolicy, nsIInputStream* aPostData, + const char* aExtraHeaders, nsIURI* aFile, bool aCalcFileExt, bool aIsPrivate); - nsresult SaveChannelInternal(nsIChannel *aChannel, nsIURI *aFile, + nsresult SaveChannelInternal(nsIChannel* aChannel, nsIURI* aFile, bool aCalcFileExt); - nsresult SaveDocumentInternal(nsIWebBrowserPersistDocument *aDocument, - nsIURI *aFile, nsIURI *aDataPath); + nsresult SaveDocumentInternal(nsIWebBrowserPersistDocument* aDocument, + nsIURI* aFile, nsIURI* aDataPath); nsresult SaveDocuments(); - void FinishSaveDocumentInternal(nsIURI *aFile, nsIFile *aDataPath); - nsresult GetExtensionForContentType(const char16_t *aContentType, - char16_t **aExt); + void FinishSaveDocumentInternal(nsIURI* aFile, nsIFile* aDataPath); + nsresult GetExtensionForContentType(const char16_t* aContentType, + char16_t** aExt); struct CleanupData; struct DocData; @@ -84,53 +84,53 @@ class nsWebBrowserPersist final : public nsIInterfaceRequestor, friend class OnWalk; friend class OnWrite; - nsresult SaveDocumentDeferred(mozilla::UniquePtr &&aData); + nsresult SaveDocumentDeferred(mozilla::UniquePtr&& aData); void Cleanup(); void CleanupLocalFiles(); - nsresult GetValidURIFromObject(nsISupports *aObject, nsIURI **aURI) const; - static nsresult GetLocalFileFromURI(nsIURI *aURI, nsIFile **aLocalFile); - static nsresult AppendPathToURI(nsIURI *aURI, const nsAString &aPath, - nsCOMPtr &aOutURI); + nsresult GetValidURIFromObject(nsISupports* aObject, nsIURI** aURI) const; + static nsresult GetLocalFileFromURI(nsIURI* aURI, nsIFile** aLocalFile); + static nsresult AppendPathToURI(nsIURI* aURI, const nsAString& aPath, + nsCOMPtr& aOutURI); nsresult MakeAndStoreLocalFilenameInURIMap( - nsIURI *aURI, nsIWebBrowserPersistDocument *aDoc, + nsIURI* aURI, nsIWebBrowserPersistDocument* aDoc, nsContentPolicyType aContentPolicyType, bool aNeedsPersisting, - URIData **aData); - nsresult MakeOutputStream(nsIURI *aFile, nsIOutputStream **aOutputStream); - nsresult MakeOutputStreamFromFile(nsIFile *aFile, - nsIOutputStream **aOutputStream); - nsresult MakeOutputStreamFromURI(nsIURI *aURI, nsIOutputStream **aOutStream); - nsresult CreateChannelFromURI(nsIURI *aURI, nsIChannel **aChannel); - nsresult StartUpload(nsIStorageStream *aOutStream, nsIURI *aDestinationURI, - const nsACString &aContentType); - nsresult StartUpload(nsIInputStream *aInputStream, nsIURI *aDestinationURI, - const nsACString &aContentType); - nsresult CalculateAndAppendFileExt(nsIURI *aURI, nsIChannel *aChannel, - nsIURI *aOriginalURIWithExtension, - nsCOMPtr &aOutURI); - nsresult CalculateUniqueFilename(nsIURI *aURI, nsCOMPtr &aOutURI); - nsresult MakeFilenameFromURI(nsIURI *aURI, nsString &aFilename); - nsresult StoreURI(const char *aURI, nsIWebBrowserPersistDocument *aDoc, + URIData** aData); + nsresult MakeOutputStream(nsIURI* aFile, nsIOutputStream** aOutputStream); + nsresult MakeOutputStreamFromFile(nsIFile* aFile, + nsIOutputStream** aOutputStream); + nsresult MakeOutputStreamFromURI(nsIURI* aURI, nsIOutputStream** aOutStream); + nsresult CreateChannelFromURI(nsIURI* aURI, nsIChannel** aChannel); + nsresult StartUpload(nsIStorageStream* aOutStream, nsIURI* aDestinationURI, + const nsACString& aContentType); + nsresult StartUpload(nsIInputStream* aInputStream, nsIURI* aDestinationURI, + const nsACString& aContentType); + nsresult CalculateAndAppendFileExt(nsIURI* aURI, nsIChannel* aChannel, + nsIURI* aOriginalURIWithExtension, + nsCOMPtr& aOutURI); + nsresult CalculateUniqueFilename(nsIURI* aURI, nsCOMPtr& aOutURI); + nsresult MakeFilenameFromURI(nsIURI* aURI, nsString& aFilename); + nsresult StoreURI(const char* aURI, nsIWebBrowserPersistDocument* aDoc, nsContentPolicyType aContentPolicyType, - bool aNeedsPersisting = true, URIData **aData = nullptr); - nsresult StoreURI(nsIURI *aURI, nsIWebBrowserPersistDocument *aDoc, + bool aNeedsPersisting = true, URIData** aData = nullptr); + nsresult StoreURI(nsIURI* aURI, nsIWebBrowserPersistDocument* aDoc, nsContentPolicyType aContentPolicyType, - bool aNeedsPersisting = true, URIData **aData = nullptr); - bool DocumentEncoderExists(const char *aContentType); + bool aNeedsPersisting = true, URIData** aData = nullptr); + bool DocumentEncoderExists(const char* aContentType); - nsresult SaveSubframeContent(nsIWebBrowserPersistDocument *aFrameContent, - nsIWebBrowserPersistDocument *aParentDocument, - const nsCString &aURISpec, URIData *aData); + nsresult SaveSubframeContent(nsIWebBrowserPersistDocument* aFrameContent, + nsIWebBrowserPersistDocument* aParentDocument, + const nsCString& aURISpec, URIData* aData); nsresult SendErrorStatusChange(bool aIsReadError, nsresult aResult, - nsIRequest *aRequest, nsIURI *aURI); + nsIRequest* aRequest, nsIURI* aURI); - nsresult FixRedirectedChannelEntry(nsIChannel *aNewChannel); + nsresult FixRedirectedChannelEntry(nsIChannel* aNewChannel); void EndDownload(nsresult aResult); void FinishDownload(); void SerializeNextFile(); void CalcTotalProgress(); - void SetApplyConversionIfNeeded(nsIChannel *aChannel); + void SetApplyConversionIfNeeded(nsIChannel* aChannel); nsCOMPtr mCurrentDataPath; bool mCurrentDataPathIsRelative; @@ -155,8 +155,8 @@ class nsWebBrowserPersist final : public nsIInterfaceRequestor, nsClassHashtable mURIMap; nsCOMPtr mFlatURIMap; nsTArray> mWalkStack; - nsTArray mDocList; - nsTArray mCleanupList; + nsTArray mDocList; + nsTArray mCleanupList; nsTArray mFilenameList; bool mFirstAndOnlyUse; bool mSavingDocument; diff --git a/editor/libeditor/HTMLEditorController.cpp b/editor/libeditor/HTMLEditorController.cpp index aa53e5c5719c9..0a369957b4516 100644 --- a/editor/libeditor/HTMLEditorController.cpp +++ b/editor/libeditor/HTMLEditorController.cpp @@ -12,16 +12,16 @@ namespace mozilla { -#define NS_REGISTER_COMMAND(_cmdClass, _cmdName) \ - { \ - aCommandTable->RegisterCommand( \ - _cmdName, \ - static_cast(_cmdClass::GetInstance())); \ +#define NS_REGISTER_COMMAND(_cmdClass, _cmdName) \ + { \ + aCommandTable->RegisterCommand( \ + _cmdName, \ + static_cast(_cmdClass::GetInstance())); \ } // static nsresult HTMLEditorController::RegisterEditorDocStateCommands( - nsControllerCommandTable *aCommandTable) { + nsControllerCommandTable* aCommandTable) { // observer commands for document state NS_REGISTER_COMMAND(DocumentStateCommand, "obs_documentCreated") NS_REGISTER_COMMAND(DocumentStateCommand, "obs_documentWillBeDestroyed") @@ -43,7 +43,7 @@ nsresult HTMLEditorController::RegisterEditorDocStateCommands( // static nsresult HTMLEditorController::RegisterHTMLEditorCommands( - nsControllerCommandTable *aCommandTable) { + nsControllerCommandTable* aCommandTable) { // Edit menu NS_REGISTER_COMMAND(PasteNoFormattingCommand, "cmd_pasteNoFormatting"); diff --git a/editor/txmgr/tests/TestTXMgr.cpp b/editor/txmgr/tests/TestTXMgr.cpp index 8c4add2d60098..ed93e3e213f98 100644 --- a/editor/txmgr/tests/TestTXMgr.cpp +++ b/editor/txmgr/tests/TestTXMgr.cpp @@ -14,11 +14,11 @@ using mozilla::TransactionManager; static int32_t sConstructorCount = 0; static int32_t sDoCount = 0; -static int32_t *sDoOrderArr = 0; +static int32_t* sDoOrderArr = 0; static int32_t sUndoCount = 0; -static int32_t *sUndoOrderArr = 0; +static int32_t* sUndoOrderArr = 0; static int32_t sRedoCount = 0; -static int32_t *sRedoOrderArr = 0; +static int32_t* sRedoOrderArr = 0; int32_t sSimpleTestDoOrderArr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -318,14 +318,14 @@ class SimpleTransaction : public TestTransaction { return (mFlags & THROWS_REDO_ERROR_FLAG) ? NS_ERROR_FAILURE : NS_OK; } - NS_IMETHOD GetIsTransient(bool *aIsTransient) override { + NS_IMETHOD GetIsTransient(bool* aIsTransient) override { if (aIsTransient) { *aIsTransient = (mFlags & TRANSIENT_FLAG) ? true : false; } return NS_OK; } - NS_IMETHOD Merge(nsITransaction *aTransaction, bool *aDidMerge) override { + NS_IMETHOD Merge(nsITransaction* aTransaction, bool* aDidMerge) override { if (aDidMerge) { *aDidMerge = (mFlags & MERGE_FLAG) ? true : false; } @@ -335,7 +335,7 @@ class SimpleTransaction : public TestTransaction { class AggregateTransaction : public SimpleTransaction { private: - AggregateTransaction(nsITransactionManager *aTXMgr, int32_t aLevel, + AggregateTransaction(nsITransactionManager* aTXMgr, int32_t aLevel, int32_t aNumber, int32_t aMaxLevel, int32_t aNumChildrenPerNode, int32_t aFlags) { mLevel = aLevel; @@ -348,7 +348,7 @@ class AggregateTransaction : public SimpleTransaction { mNumChildrenPerNode = aNumChildrenPerNode; } - nsITransactionManager *mTXMgr; + nsITransactionManager* mTXMgr; int32_t mLevel; int32_t mNumber; @@ -358,7 +358,7 @@ class AggregateTransaction : public SimpleTransaction { int32_t mNumChildrenPerNode; public: - AggregateTransaction(nsITransactionManager *aTXMgr, int32_t aMaxLevel, + AggregateTransaction(nsITransactionManager* aTXMgr, int32_t aMaxLevel, int32_t aNumChildrenPerNode, int32_t aFlags = NONE_FLAG) { mLevel = 1; @@ -434,15 +434,15 @@ class AggregateTransaction : public SimpleTransaction { class TestTransactionFactory { public: - virtual TestTransaction *create(nsITransactionManager *txmgr, + virtual TestTransaction* create(nsITransactionManager* txmgr, int32_t flags) = 0; }; class SimpleTransactionFactory : public TestTransactionFactory { public: - TestTransaction *create(nsITransactionManager *txmgr, + TestTransaction* create(nsITransactionManager* txmgr, int32_t flags) override { - return (TestTransaction *)new SimpleTransaction(flags); + return (TestTransaction*)new SimpleTransaction(flags); } }; @@ -459,9 +459,9 @@ class AggregateTransactionFactory : public TestTransactionFactory { mNumChildrenPerNode(aNumChildrenPerNode), mFixedFlags(aFixedFlags) {} - TestTransaction *create(nsITransactionManager *txmgr, + TestTransaction* create(nsITransactionManager* txmgr, int32_t flags) override { - return (TestTransaction *)new AggregateTransaction( + return (TestTransaction*)new AggregateTransaction( txmgr, mMaxLevel, mNumChildrenPerNode, flags | mFixedFlags); } }; @@ -482,7 +482,7 @@ void reset_globals() { /** * Test behaviors in non-batch mode. **/ -void quick_test(TestTransactionFactory *factory) { +void quick_test(TestTransactionFactory* factory) { /******************************************************************* * * Create a transaction manager implementation: @@ -1229,7 +1229,7 @@ TEST(TestTXMgr, AggregationTest) /** * Test behaviors in batch mode. **/ -void quick_batch_test(TestTransactionFactory *factory) { +void quick_batch_test(TestTransactionFactory* factory) { /******************************************************************* * * Create a transaction manager implementation: @@ -1858,7 +1858,7 @@ TEST(TestTXMgr, AggregationBatchTest) * Create 'iterations * (iterations + 1) / 2' transactions; * do/undo/redo/undo them. **/ -void stress_test(TestTransactionFactory *factory, int32_t iterations) { +void stress_test(TestTransactionFactory* factory, int32_t iterations) { /******************************************************************* * * Create a transaction manager: diff --git a/extensions/auth/gssapi.h b/extensions/auth/gssapi.h index 3500a3c4f00f0..8ce30a8ca358e 100644 --- a/extensions/auth/gssapi.h +++ b/extensions/auth/gssapi.h @@ -108,9 +108,9 @@ EXTERN_C_BEGIN * Now define the three implementation-dependent types. */ -typedef void *gss_name_t; -typedef void *gss_ctx_id_t; -typedef void *gss_cred_id_t; +typedef void* gss_name_t; +typedef void* gss_ctx_id_t; +typedef void* gss_cred_id_t; /* * The following type must be defined as the smallest natural @@ -147,7 +147,7 @@ typedef OM_object_identifier gss_OID_desc, *gss_OID; typedef gss_uint32 OM_uint32; typedef struct gss_OID_desc_struct { OM_uint32 length; - void *elements; + void* elements; } gss_OID_desc, *gss_OID; #endif /* !OM_STRING */ @@ -166,7 +166,7 @@ typedef int gss_cred_usage_t; typedef struct gss_buffer_desc_struct { size_t length; - void *value; + void* value; } gss_buffer_desc, *gss_buffer_t; typedef struct gss_channel_bindings_struct { @@ -441,78 +441,78 @@ extern gss_OID GSS_C_NT_EXPORT_NAME; GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_acquire_cred)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_name_t, /* desired_name */ OM_uint32, /* time_req */ const gss_OID_set, /* desired_mechs */ gss_cred_usage_t, /* cred_usage */ - gss_cred_id_t *, /* output_cred_handle */ - gss_OID_set *, /* actual_mechs */ - OM_uint32 * /* time_rec */ + gss_cred_id_t*, /* output_cred_handle */ + gss_OID_set*, /* actual_mechs */ + OM_uint32* /* time_rec */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_cred)( - OM_uint32 *, /* minor_status */ - gss_cred_id_t * /* cred_handle */ + OM_uint32*, /* minor_status */ + gss_cred_id_t* /* cred_handle */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_init_sec_context)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_cred_id_t, /* initiator_cred_handle */ - gss_ctx_id_t *, /* context_handle */ + gss_ctx_id_t*, /* context_handle */ const gss_name_t, /* target_name */ const gss_OID, /* mech_type */ OM_uint32, /* req_flags */ OM_uint32, /* time_req */ const gss_channel_bindings_t, /* input_chan_bindings */ const gss_buffer_t, /* input_token */ - gss_OID *, /* actual_mech_type */ + gss_OID*, /* actual_mech_type */ gss_buffer_t, /* output_token */ - OM_uint32 *, /* ret_flags */ - OM_uint32 * /* time_rec */ + OM_uint32*, /* ret_flags */ + OM_uint32* /* time_rec */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_accept_sec_context)( - OM_uint32 *, /* minor_status */ - gss_ctx_id_t *, /* context_handle */ + OM_uint32*, /* minor_status */ + gss_ctx_id_t*, /* context_handle */ const gss_cred_id_t, /* acceptor_cred_handle */ const gss_buffer_t, /* input_token_buffer */ const gss_channel_bindings_t, /* input_chan_bindings */ - gss_name_t *, /* src_name */ - gss_OID *, /* mech_type */ + gss_name_t*, /* src_name */ + gss_OID*, /* mech_type */ gss_buffer_t, /* output_token */ - OM_uint32 *, /* ret_flags */ - OM_uint32 *, /* time_rec */ - gss_cred_id_t * /* delegated_cred_handle */ + OM_uint32*, /* ret_flags */ + OM_uint32*, /* time_rec */ + gss_cred_id_t* /* delegated_cred_handle */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_process_context_token)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_ctx_id_t, /* context_handle */ const gss_buffer_t /* token_buffer */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_delete_sec_context)( - OM_uint32 *, /* minor_status */ - gss_ctx_id_t *, /* context_handle */ - gss_buffer_t /* output_token */ + OM_uint32*, /* minor_status */ + gss_ctx_id_t*, /* context_handle */ + gss_buffer_t /* output_token */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_context_time)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_ctx_id_t, /* context_handle */ - OM_uint32 * /* time_rec */ + OM_uint32* /* time_rec */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_get_mic)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_ctx_id_t, /* context_handle */ gss_qop_t, /* qop_req */ const gss_buffer_t, /* message_buffer */ @@ -521,220 +521,218 @@ OM_uint32 GSS_CALLCONV GSS_FUNC(gss_get_mic)( GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_verify_mic)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_ctx_id_t, /* context_handle */ const gss_buffer_t, /* message_buffer */ const gss_buffer_t, /* token_buffer */ - gss_qop_t * /* qop_state */ + gss_qop_t* /* qop_state */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_wrap)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_ctx_id_t, /* context_handle */ int, /* conf_req_flag */ gss_qop_t, /* qop_req */ const gss_buffer_t, /* input_message_buffer */ - int *, /* conf_state */ + int*, /* conf_state */ gss_buffer_t /* output_message_buffer */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_unwrap)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_ctx_id_t, /* context_handle */ const gss_buffer_t, /* input_message_buffer */ gss_buffer_t, /* output_message_buffer */ - int *, /* conf_state */ - gss_qop_t * /* qop_state */ + int*, /* conf_state */ + gss_qop_t* /* qop_state */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_display_status)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ OM_uint32, /* status_value */ int, /* status_type */ const gss_OID, /* mech_type */ - OM_uint32 *, /* message_context */ + OM_uint32*, /* message_context */ gss_buffer_t /* status_string */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_indicate_mechs)( - OM_uint32 *, /* minor_status */ - gss_OID_set * /* mech_set */ + OM_uint32*, /* minor_status */ + gss_OID_set* /* mech_set */ ); GSS_MAKE_TYPEDEF -OM_uint32 GSS_CALLCONV GSS_FUNC(gss_compare_name)( - OM_uint32 *, /* minor_status */ - const gss_name_t, /* name1 */ - const gss_name_t, /* name2 */ - int * /* name_equal */ +OM_uint32 GSS_CALLCONV GSS_FUNC(gss_compare_name)(OM_uint32*, /* minor_status */ + const gss_name_t, /* name1 */ + const gss_name_t, /* name2 */ + int* /* name_equal */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_display_name)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_name_t, /* input_name */ gss_buffer_t, /* output_name_buffer */ - gss_OID * /* output_name_type */ + gss_OID* /* output_name_type */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_import_name)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_buffer_t, /* input_name_buffer */ const gss_OID, /* input_name_type */ - gss_name_t * /* output_name */ + gss_name_t* /* output_name */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_export_name)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_name_t, /* input_name */ gss_buffer_t /* exported_name */ ); GSS_MAKE_TYPEDEF -OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_name)( - OM_uint32 *, /* minor_status */ - gss_name_t * /* input_name */ +OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_name)(OM_uint32*, /* minor_status */ + gss_name_t* /* input_name */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_buffer)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ gss_buffer_t /* buffer */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_release_oid_set)( - OM_uint32 *, /* minor_status */ - gss_OID_set * /* set */ + OM_uint32*, /* minor_status */ + gss_OID_set* /* set */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_cred)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_cred_id_t, /* cred_handle */ - gss_name_t *, /* name */ - OM_uint32 *, /* lifetime */ - gss_cred_usage_t *, /* cred_usage */ - gss_OID_set * /* mechanisms */ + gss_name_t*, /* name */ + OM_uint32*, /* lifetime */ + gss_cred_usage_t*, /* cred_usage */ + gss_OID_set* /* mechanisms */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_context)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_ctx_id_t, /* context_handle */ - gss_name_t *, /* src_name */ - gss_name_t *, /* targ_name */ - OM_uint32 *, /* lifetime_rec */ - gss_OID *, /* mech_type */ - OM_uint32 *, /* ctx_flags */ - int *, /* locally_initiated */ - int * /* open */ + gss_name_t*, /* src_name */ + gss_name_t*, /* targ_name */ + OM_uint32*, /* lifetime_rec */ + gss_OID*, /* mech_type */ + OM_uint32*, /* ctx_flags */ + int*, /* locally_initiated */ + int* /* open */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_wrap_size_limit)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_ctx_id_t, /* context_handle */ int, /* conf_req_flag */ gss_qop_t, /* qop_req */ OM_uint32, /* req_output_size */ - OM_uint32 * /* max_input_size */ + OM_uint32* /* max_input_size */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_add_cred)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_cred_id_t, /* input_cred_handle */ const gss_name_t, /* desired_name */ const gss_OID, /* desired_mech */ gss_cred_usage_t, /* cred_usage */ OM_uint32, /* initiator_time_req */ OM_uint32, /* acceptor_time_req */ - gss_cred_id_t *, /* output_cred_handle */ - gss_OID_set *, /* actual_mechs */ - OM_uint32 *, /* initiator_time_rec */ - OM_uint32 * /* acceptor_time_rec */ + gss_cred_id_t*, /* output_cred_handle */ + gss_OID_set*, /* actual_mechs */ + OM_uint32*, /* initiator_time_rec */ + OM_uint32* /* acceptor_time_rec */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_cred_by_mech)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_cred_id_t, /* cred_handle */ const gss_OID, /* mech_type */ - gss_name_t *, /* name */ - OM_uint32 *, /* initiator_lifetime */ - OM_uint32 *, /* acceptor_lifetime */ - gss_cred_usage_t * /* cred_usage */ + gss_name_t*, /* name */ + OM_uint32*, /* initiator_lifetime */ + OM_uint32*, /* acceptor_lifetime */ + gss_cred_usage_t* /* cred_usage */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_export_sec_context)( - OM_uint32 *, /* minor_status */ - gss_ctx_id_t *, /* context_handle */ - gss_buffer_t /* interprocess_token */ + OM_uint32*, /* minor_status */ + gss_ctx_id_t*, /* context_handle */ + gss_buffer_t /* interprocess_token */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_import_sec_context)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_buffer_t, /* interprocess_token */ - gss_ctx_id_t * /* context_handle */ + gss_ctx_id_t* /* context_handle */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_create_empty_oid_set)( - OM_uint32 *, /* minor_status */ - gss_OID_set * /* oid_set */ + OM_uint32*, /* minor_status */ + gss_OID_set* /* oid_set */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_add_oid_set_member)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_OID, /* member_oid */ - gss_OID_set * /* oid_set */ + gss_OID_set* /* oid_set */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_test_oid_set_member)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_OID, /* member */ const gss_OID_set, /* set */ - int * /* present */ + int* /* present */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_names_for_mech)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_OID, /* mechanism */ - gss_OID_set * /* name_types */ + gss_OID_set* /* name_types */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_inquire_mechs_for_name)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_name_t, /* input_name */ - gss_OID_set * /* mech_types */ + gss_OID_set* /* mech_types */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_canonicalize_name)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_name_t, /* input_name */ const gss_OID, /* mech_type */ - gss_name_t * /* output_name */ + gss_name_t* /* output_name */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_duplicate_name)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ const gss_name_t, /* src_name */ - gss_name_t * /* dest_name */ + gss_name_t* /* dest_name */ ); /* @@ -749,7 +747,7 @@ OM_uint32 GSS_CALLCONV GSS_FUNC(gss_duplicate_name)( */ GSS_MAKE_TYPEDEF -OM_uint32 GSS_CALLCONV GSS_FUNC(gss_sign)(OM_uint32 *, /* minor_status */ +OM_uint32 GSS_CALLCONV GSS_FUNC(gss_sign)(OM_uint32*, /* minor_status */ gss_ctx_id_t, /* context_handle */ int, /* qop_req */ gss_buffer_t, /* message_buffer */ @@ -757,32 +755,32 @@ OM_uint32 GSS_CALLCONV GSS_FUNC(gss_sign)(OM_uint32 *, /* minor_status */ ); GSS_MAKE_TYPEDEF -OM_uint32 GSS_CALLCONV GSS_FUNC(gss_verify)(OM_uint32 *, /* minor_status */ +OM_uint32 GSS_CALLCONV GSS_FUNC(gss_verify)(OM_uint32*, /* minor_status */ gss_ctx_id_t, /* context_handle */ gss_buffer_t, /* message_buffer */ gss_buffer_t, /* token_buffer */ - int * /* qop_state */ + int* /* qop_state */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_seal)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ gss_ctx_id_t, /* context_handle */ int, /* conf_req_flag */ int, /* qop_req */ gss_buffer_t, /* input_message_buffer */ - int *, /* conf_state */ + int*, /* conf_state */ gss_buffer_t /* output_message_buffer */ ); GSS_MAKE_TYPEDEF OM_uint32 GSS_CALLCONV GSS_FUNC(gss_unseal)( - OM_uint32 *, /* minor_status */ + OM_uint32*, /* minor_status */ gss_ctx_id_t, /* context_handle */ gss_buffer_t, /* input_message_buffer */ gss_buffer_t, /* output_message_buffer */ - int *, /* conf_state */ - int * /* qop_state */ + int*, /* conf_state */ + int* /* qop_state */ ); #if defined(XP_MACOSX) diff --git a/extensions/auth/nsAuthGSSAPI.cpp b/extensions/auth/nsAuthGSSAPI.cpp index 87dba213034c4..2c32c88b091fd 100644 --- a/extensions/auth/nsAuthGSSAPI.cpp +++ b/extensions/auth/nsAuthGSSAPI.cpp @@ -34,8 +34,8 @@ #ifdef XP_MACOSX typedef KLStatus (*KLCacheHasValidTickets_type)(KLPrincipal, KLKerberosVersion, - KLBoolean *, KLPrincipal *, - char **); + KLBoolean*, KLPrincipal*, + char**); #endif #if defined(HAVE_RES_NINIT) @@ -54,14 +54,14 @@ using namespace mozilla; // has the same value static gss_OID_desc gss_c_nt_hostbased_service = { - 10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04"}; + 10, (void*)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04"}; static const char kNegotiateAuthGssLib[] = "network.negotiate-auth.gsslib"; static const char kNegotiateAuthNativeImp[] = "network.negotiate-auth.using-native-gsslib"; static struct GSSFunction { - const char *str; + const char* str; PRFuncPtr func; } gssFuncs[] = {{"gss_display_status", nullptr}, {"gss_init_sec_context", nullptr}, @@ -75,7 +75,7 @@ static struct GSSFunction { {"gss_unwrap", nullptr}}; static bool gssNativeImp = true; -static PRLibrary *gssLibrary = nullptr; +static PRLibrary* gssLibrary = nullptr; #define gss_display_status_ptr ((gss_display_status_type)*gssFuncs[0].func) #define gss_init_sec_context_ptr ((gss_init_sec_context_type)*gssFuncs[1].func) @@ -106,7 +106,7 @@ static nsresult gssInit() { #endif gssNativeImp = Preferences::GetBool(kNegotiateAuthNativeImp); - PRLibrary *lib = nullptr; + PRLibrary* lib = nullptr; if (!libPath.IsEmpty()) { LOG(("Attempting to load user specified library [%s]\n", libPath.get())); @@ -132,7 +132,7 @@ static nsresult gssInit() { * fine. */ - const char *const verLibNames[] = { + const char* const verLibNames[] = { "libasn1.so", "libcrypto.so", "libroken.so", "libheimbase.so", "libcom_err.so", "libkrb5.so", "libgssapi.so"}; @@ -145,9 +145,9 @@ static nsresult gssInit() { #else - const char *const libNames[] = {"gss", "gssapi_krb5", "gssapi"}; + const char* const libNames[] = {"gss", "gssapi_krb5", "gssapi"}; - const char *const verLibNames[] = { + const char* const verLibNames[] = { "libgssapi_krb5.so.2", /* MIT - FC, Suse10, Debian */ "libgssapi.so.4", /* Heimdal - Suse10, MDK */ "libgssapi.so.1" /* Heimdal - Suse9, CITI - FC, MDK, Suse10*/ @@ -171,7 +171,7 @@ static nsresult gssInit() { } for (size_t i = 0; i < ArrayLength(libNames) && !lib; ++i) { - char *libName = PR_GetLibraryName(nullptr, libNames[i]); + char* libName = PR_GetLibraryName(nullptr, libNames[i]); if (libName) { lib = PR_LoadLibrary(libName); PR_FreeLibraryName(libName); @@ -217,7 +217,7 @@ static nsresult gssInit() { // Generate proper GSSAPI error messages from the major and // minor status codes. -void LogGssError(OM_uint32 maj_stat, OM_uint32 min_stat, const char *prefix) { +void LogGssError(OM_uint32 maj_stat, OM_uint32 min_stat, const char* prefix) { if (!MOZ_LOG_TEST(gNegotiateLog, LogLevel::Debug)) { return; } @@ -236,13 +236,13 @@ void LogGssError(OM_uint32 maj_stat, OM_uint32 min_stat, const char *prefix) { do { ret = gss_display_status_ptr(&new_stat, maj_stat, GSS_C_GSS_CODE, GSS_C_NULL_OID, &msg_ctx, &status1_string); - errorStr.Append((const char *)status1_string.value, status1_string.length); + errorStr.Append((const char*)status1_string.value, status1_string.length); gss_release_buffer_ptr(&new_stat, &status1_string); errorStr += '\n'; ret = gss_display_status_ptr(&new_stat, min_stat, GSS_C_MECH_CODE, GSS_C_NULL_OID, &msg_ctx, &status2_string); - errorStr.Append((const char *)status2_string.value, status2_string.length); + errorStr.Append((const char*)status2_string.value, status2_string.length); errorStr += '\n'; } while (!GSS_ERROR(ret) && msg_ctx != 0); @@ -259,9 +259,9 @@ nsAuthGSSAPI::nsAuthGSSAPI(pType package) : mServiceFlags(REQ_DEFAULT) { unsigned int i; static gss_OID_desc gss_krb5_mech_oid_desc = { - 9, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02"}; + 9, (void*)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02"}; static gss_OID_desc gss_spnego_mech_oid_desc = { - 6, (void *)"\x2b\x06\x01\x05\x05\x02"}; + 6, (void*)"\x2b\x06\x01\x05\x05\x02"}; LOG(("entering nsAuthGSSAPI::nsAuthGSSAPI()\n")); @@ -326,9 +326,9 @@ void nsAuthGSSAPI::Shutdown() { NS_IMPL_ISUPPORTS(nsAuthGSSAPI, nsIAuthModule) NS_IMETHODIMP -nsAuthGSSAPI::Init(const char *serviceName, uint32_t serviceFlags, - const char16_t *domain, const char16_t *username, - const char16_t *password) { +nsAuthGSSAPI::Init(const char* serviceName, uint32_t serviceFlags, + const char16_t* domain, const char16_t* username, + const char16_t* password) { // we don't expect to be passed any user credentials NS_ASSERTION(!domain && !username && !password, "unexpected credentials"); @@ -355,8 +355,8 @@ nsAuthGSSAPI::Init(const char *serviceName, uint32_t serviceFlags, } NS_IMETHODIMP -nsAuthGSSAPI::GetNextToken(const void *inToken, uint32_t inTokenLen, - void **outToken, uint32_t *outTokenLen) { +nsAuthGSSAPI::GetNextToken(const void* inToken, uint32_t inTokenLen, + void** outToken, uint32_t* outTokenLen) { OM_uint32 major_status, minor_status; OM_uint32 req_flags = 0; gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; @@ -377,7 +377,7 @@ nsAuthGSSAPI::GetNextToken(const void *inToken, uint32_t inTokenLen, if (mServiceFlags & REQ_MUTUAL_AUTH) req_flags |= GSS_C_MUTUAL_FLAG; - input_token.value = (void *)mServiceName.get(); + input_token.value = (void*)mServiceName.get(); input_token.length = mServiceName.Length() + 1; #if defined(HAVE_RES_NINIT) @@ -394,7 +394,7 @@ nsAuthGSSAPI::GetNextToken(const void *inToken, uint32_t inTokenLen, if (inToken) { input_token.length = inTokenLen; - input_token.value = (void *)inToken; + input_token.value = (void*)inToken; in_token_ptr = &input_token; } else if (mCtx != GSS_C_NO_CONTEXT) { // If there is no input token, then we are starting a new @@ -469,14 +469,14 @@ nsAuthGSSAPI::GetNextToken(const void *inToken, uint32_t inTokenLen, } NS_IMETHODIMP -nsAuthGSSAPI::Unwrap(const void *inToken, uint32_t inTokenLen, void **outToken, - uint32_t *outTokenLen) { +nsAuthGSSAPI::Unwrap(const void* inToken, uint32_t inTokenLen, void** outToken, + uint32_t* outTokenLen) { OM_uint32 major_status, minor_status; gss_buffer_desc input_token; gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; - input_token.value = (void *)inToken; + input_token.value = (void*)inToken; input_token.length = inTokenLen; major_status = gss_unwrap_ptr(&minor_status, mCtx, &input_token, @@ -501,14 +501,14 @@ nsAuthGSSAPI::Unwrap(const void *inToken, uint32_t inTokenLen, void **outToken, } NS_IMETHODIMP -nsAuthGSSAPI::Wrap(const void *inToken, uint32_t inTokenLen, bool confidential, - void **outToken, uint32_t *outTokenLen) { +nsAuthGSSAPI::Wrap(const void* inToken, uint32_t inTokenLen, bool confidential, + void** outToken, uint32_t* outTokenLen) { OM_uint32 major_status, minor_status; gss_buffer_desc input_token; gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; - input_token.value = (void *)inToken; + input_token.value = (void*)inToken; input_token.length = inTokenLen; major_status = diff --git a/extensions/auth/nsAuthSASL.cpp b/extensions/auth/nsAuthSASL.cpp index 0566c030a12c0..6932f1c168421 100644 --- a/extensions/auth/nsAuthSASL.cpp +++ b/extensions/auth/nsAuthSASL.cpp @@ -20,9 +20,9 @@ void nsAuthSASL::Reset() { mSASLReady = false; } NS_IMPL_ISUPPORTS(nsAuthSASL, nsIAuthModule) NS_IMETHODIMP -nsAuthSASL::Init(const char *serviceName, uint32_t serviceFlags, - const char16_t *domain, const char16_t *username, - const char16_t *password) { +nsAuthSASL::Init(const char* serviceName, uint32_t serviceFlags, + const char16_t* domain, const char16_t* username, + const char16_t* password) { nsresult rv; NS_ASSERTION(username, "SASL requires a username"); @@ -34,7 +34,7 @@ nsAuthSASL::Init(const char *serviceName, uint32_t serviceFlags, serviceFlags |= REQ_MUTUAL_AUTH; // Find out whether we should be trying SSPI or not - const char *authType = "kerb-gss"; + const char* authType = "kerb-gss"; nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); if (prefs) { @@ -51,11 +51,11 @@ nsAuthSASL::Init(const char *serviceName, uint32_t serviceFlags, } NS_IMETHODIMP -nsAuthSASL::GetNextToken(const void *inToken, uint32_t inTokenLen, - void **outToken, uint32_t *outTokenLen) { +nsAuthSASL::GetNextToken(const void* inToken, uint32_t inTokenLen, + void** outToken, uint32_t* outTokenLen) { nsresult rv; - void *unwrappedToken; - char *message; + void* unwrappedToken; + char* message; uint32_t unwrappedTokenLen, messageLen; nsAutoCString userbuf; @@ -88,7 +88,7 @@ nsAuthSASL::GetNextToken(const void *inToken, uint32_t inTokenLen, NS_CopyUnicodeToNative(mUsername, userbuf); messageLen = userbuf.Length() + 4 + 1; - message = (char *)moz_xmalloc(messageLen); + message = (char*)moz_xmalloc(messageLen); message[0] = 0x01; // No security layer message[1] = 0x00; message[2] = 0x00; @@ -96,7 +96,7 @@ nsAuthSASL::GetNextToken(const void *inToken, uint32_t inTokenLen, strcpy(message + 4, userbuf.get()); // Userbuf should not be nullptr terminated, so trim the trailing nullptr // when wrapping the message - rv = mInnerModule->Wrap((void *)message, messageLen - 1, false, outToken, + rv = mInnerModule->Wrap((void*)message, messageLen - 1, false, outToken, outTokenLen); free(message); Reset(); // All done @@ -111,13 +111,13 @@ nsAuthSASL::GetNextToken(const void *inToken, uint32_t inTokenLen, } NS_IMETHODIMP -nsAuthSASL::Unwrap(const void *inToken, uint32_t inTokenLen, void **outToken, - uint32_t *outTokenLen) { +nsAuthSASL::Unwrap(const void* inToken, uint32_t inTokenLen, void** outToken, + uint32_t* outTokenLen) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsAuthSASL::Wrap(const void *inToken, uint32_t inTokenLen, bool confidential, - void **outToken, uint32_t *outTokenLen) { +nsAuthSASL::Wrap(const void* inToken, uint32_t inTokenLen, bool confidential, + void** outToken, uint32_t* outTokenLen) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/extensions/auth/nsAuthSSPI.cpp b/extensions/auth/nsAuthSSPI.cpp index 9f7d792e8b5fe..298ce98299864 100644 --- a/extensions/auth/nsAuthSSPI.cpp +++ b/extensions/auth/nsAuthSSPI.cpp @@ -42,13 +42,13 @@ //----------------------------------------------------------------------------- -static const wchar_t *const pTypeName[] = {L"Kerberos", L"Negotiate", L"NTLM"}; +static const wchar_t* const pTypeName[] = {L"Kerberos", L"Negotiate", L"NTLM"}; #ifdef DEBUG # define CASE_(_x) \ case _x: \ return #_x; -static const char *MapErrorCode(int rc) { +static const char* MapErrorCode(int rc) { switch (rc) { CASE_(SEC_E_OK) CASE_(SEC_I_CONTINUE_NEEDED) @@ -89,7 +89,7 @@ static nsresult InitSSPI() { //----------------------------------------------------------------------------- -nsresult nsAuthSSPI::MakeSN(const char *principal, nsCString &result) { +nsresult nsAuthSSPI::MakeSN(const char* principal, nsCString& result) { nsresult rv; nsAutoCString buf(principal); @@ -104,7 +104,7 @@ nsresult nsAuthSSPI::MakeSN(const char *principal, nsCString &result) { do_GetService(NS_DNSSERVICE_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; - auto dns = static_cast(dnsService.get()); + auto dns = static_cast(dnsService.get()); // This could be expensive if our DNS cache cannot satisfy the request. // However, we should have at least hit the OS resolver once prior to @@ -173,9 +173,9 @@ void nsAuthSSPI::Reset() { NS_IMPL_ISUPPORTS(nsAuthSSPI, nsIAuthModule) NS_IMETHODIMP -nsAuthSSPI::Init(const char *serviceName, uint32_t serviceFlags, - const char16_t *domain, const char16_t *username, - const char16_t *password) { +nsAuthSSPI::Init(const char* serviceName, uint32_t serviceFlags, + const char16_t* domain, const char16_t* username, + const char16_t* password) { LOG((" nsAuthSSPI::Init\n")); mIsFirst = true; @@ -193,9 +193,9 @@ nsAuthSSPI::Init(const char *serviceName, uint32_t serviceFlags, rv = InitSSPI(); if (NS_FAILED(rv)) return rv; } - SEC_WCHAR *package; + SEC_WCHAR* package; - package = (SEC_WCHAR *)pTypeName[(int)mPackage]; + package = (SEC_WCHAR*)pTypeName[(int)mPackage]; if (mPackage == PACKAGE_TYPE_NTLM) { // (bug 535193) For NTLM, just use the uri host, do not do canonical host @@ -229,7 +229,7 @@ nsAuthSSPI::Init(const char *serviceName, uint32_t serviceFlags, MS_TimeStamp useBefore; SEC_WINNT_AUTH_IDENTITY_W ai; - SEC_WINNT_AUTH_IDENTITY_W *pai = nullptr; + SEC_WINNT_AUTH_IDENTITY_W* pai = nullptr; // domain, username, and password will be null if nsHttpNTLMAuth's // ChallengeReceived returns false for identityInvalid. Use default @@ -239,11 +239,11 @@ nsAuthSSPI::Init(const char *serviceName, uint32_t serviceFlags, mUsername.Assign(username); mPassword.Assign(password); mDomain.Assign(domain); - ai.Domain = reinterpret_cast(mDomain.BeginWriting()); + ai.Domain = reinterpret_cast(mDomain.BeginWriting()); ai.DomainLength = mDomain.Length(); - ai.User = reinterpret_cast(mUsername.BeginWriting()); + ai.User = reinterpret_cast(mUsername.BeginWriting()); ai.UserLength = mUsername.Length(); - ai.Password = reinterpret_cast(mPassword.BeginWriting()); + ai.Password = reinterpret_cast(mPassword.BeginWriting()); ai.PasswordLength = mPassword.Length(); ai.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE; pai = &ai; @@ -271,8 +271,8 @@ nsAuthSSPI::Init(const char *serviceName, uint32_t serviceFlags, // certificate (when available) in the first call of the function. The // second time these arguments hold an input token. NS_IMETHODIMP -nsAuthSSPI::GetNextToken(const void *inToken, uint32_t inTokenLen, - void **outToken, uint32_t *outTokenLen) { +nsAuthSSPI::GetNextToken(const void* inToken, uint32_t inTokenLen, + void** outToken, uint32_t* outTokenLen) { // String for end-point bindings. const char end_point[] = "tls-server-end-point:"; const int end_point_length = sizeof(end_point) - 1; @@ -283,12 +283,12 @@ nsAuthSSPI::GetNextToken(const void *inToken, uint32_t inTokenLen, MS_TimeStamp ignored; DWORD ctxAttr, ctxReq = 0; - CtxtHandle *ctxIn; + CtxtHandle* ctxIn; SecBufferDesc ibd, obd; // Optional second input buffer for the CBT (Channel Binding Token) SecBuffer ib[2], ob; // Pointer to the block of memory that stores the CBT - char *sspi_cbt = nullptr; + char* sspi_cbt = nullptr; SEC_CHANNEL_BINDINGS pendpoint_binding; LOG(("entering nsAuthSSPI::GetNextToken()\n")); @@ -348,10 +348,10 @@ nsAuthSSPI::GetNextToken(const void *inToken, uint32_t inTokenLen, ib[ibd.cBuffers].cbBuffer = pendpoint_binding.cbApplicationDataLength + pendpoint_binding.dwApplicationDataOffset; - sspi_cbt = (char *)moz_xmalloc(ib[ibd.cBuffers].cbBuffer); + sspi_cbt = (char*)moz_xmalloc(ib[ibd.cBuffers].cbBuffer); // Helper to write in the memory block that stores the CBT - char *sspi_cbt_ptr = sspi_cbt; + char* sspi_cbt_ptr = sspi_cbt; ib[ibd.cBuffers].pvBuffer = sspi_cbt; ibd.cBuffers++; @@ -372,7 +372,7 @@ nsAuthSSPI::GetNextToken(const void *inToken, uint32_t inTokenLen, crypto = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) rv = crypto->Init(nsICryptoHash::SHA256); if (NS_SUCCEEDED(rv)) - rv = crypto->Update((unsigned char *)mCertDERData, mCertDERLength); + rv = crypto->Update((unsigned char*)mCertDERData, mCertDERLength); if (NS_SUCCEEDED(rv)) rv = crypto->Finish(false, hashString); if (NS_FAILED(rv)) { free(mCertDERData); @@ -396,7 +396,7 @@ nsAuthSSPI::GetNextToken(const void *inToken, uint32_t inTokenLen, // We always need this SECBUFFER. ib[ibd.cBuffers].BufferType = SECBUFFER_TOKEN; ib[ibd.cBuffers].cbBuffer = inTokenLen; - ib[ibd.cBuffers].pvBuffer = (void *)inToken; + ib[ibd.cBuffers].pvBuffer = (void*)inToken; ibd.cBuffers++; ctxIn = &mCtxt; } @@ -422,7 +422,7 @@ nsAuthSSPI::GetNextToken(const void *inToken, uint32_t inTokenLen, memset(ob.pvBuffer, 0, ob.cbBuffer); NS_ConvertUTF8toUTF16 wSN(mServiceName); - SEC_WCHAR *sn = (SEC_WCHAR *)wSN.get(); + SEC_WCHAR* sn = (SEC_WCHAR*)wSN.get(); rc = (sspi->InitializeSecurityContextW)( &mCred, ctxIn, sn, ctxReq, 0, SECURITY_NATIVE_DREP, @@ -454,8 +454,8 @@ nsAuthSSPI::GetNextToken(const void *inToken, uint32_t inTokenLen, } NS_IMETHODIMP -nsAuthSSPI::Unwrap(const void *inToken, uint32_t inTokenLen, void **outToken, - uint32_t *outTokenLen) { +nsAuthSSPI::Unwrap(const void* inToken, uint32_t inTokenLen, void** outToken, + uint32_t* outTokenLen) { SECURITY_STATUS rc; SecBufferDesc ibd; SecBuffer ib[2]; @@ -516,8 +516,8 @@ class secBuffers { }; NS_IMETHODIMP -nsAuthSSPI::Wrap(const void *inToken, uint32_t inTokenLen, bool confidential, - void **outToken, uint32_t *outTokenLen) { +nsAuthSSPI::Wrap(const void* inToken, uint32_t inTokenLen, bool confidential, + void** outToken, uint32_t* outTokenLen) { SECURITY_STATUS rc; SecBufferDesc ibd; @@ -554,9 +554,9 @@ nsAuthSSPI::Wrap(const void *inToken, uint32_t inTokenLen, bool confidential, if (SEC_SUCCESS(rc)) { int len = bufs.ib[0].cbBuffer + bufs.ib[1].cbBuffer + bufs.ib[2].cbBuffer; - char *p = (char *)moz_xmalloc(len); + char* p = (char*)moz_xmalloc(len); - *outToken = (void *)p; + *outToken = (void*)p; *outTokenLen = len; memcpy(p, bufs.ib[0].pvBuffer, bufs.ib[0].cbBuffer); diff --git a/extensions/auth/nsAuthSSPI.h b/extensions/auth/nsAuthSSPI.h index 051ca8a0ac889..b54b417862a10 100644 --- a/extensions/auth/nsAuthSSPI.h +++ b/extensions/auth/nsAuthSSPI.h @@ -41,7 +41,7 @@ class nsAuthSSPI final : public nsIAuthModule { typedef ::TimeStamp MS_TimeStamp; private: - nsresult MakeSN(const char *principal, nsCString &result); + nsresult MakeSN(const char* principal, nsCString& result); CredHandle mCred; CtxtHandle mCtxt; @@ -53,7 +53,7 @@ class nsAuthSSPI final : public nsIAuthModule { nsString mUsername; nsString mPassword; bool mIsFirst; - void *mCertDERData; + void* mCertDERData; uint32_t mCertDERLength; }; diff --git a/extensions/auth/nsHttpNegotiateAuth.cpp b/extensions/auth/nsHttpNegotiateAuth.cpp index bf22aea81d363..41c64aaa4ff2f 100644 --- a/extensions/auth/nsHttpNegotiateAuth.cpp +++ b/extensions/auth/nsHttpNegotiateAuth.cpp @@ -75,7 +75,7 @@ mozilla::StaticRefPtr nsHttpNegotiateAuth::gSingleton; //----------------------------------------------------------------------------- // Return false when the channel comes from a Private browsing window. -static bool TestNotInPBMode(nsIHttpAuthenticableChannel *authChannel, +static bool TestNotInPBMode(nsIHttpAuthenticableChannel* authChannel, bool proxyAuth) { // Proxy should go all the time, it's not considered a privacy leak // to send default credentials to a proxy. @@ -125,7 +125,7 @@ already_AddRefed nsHttpNegotiateAuth::GetOrCreate() { } NS_IMETHODIMP -nsHttpNegotiateAuth::GetAuthFlags(uint32_t *flags) { +nsHttpNegotiateAuth::GetAuthFlags(uint32_t* flags) { // // Negotiate Auth creds should not be reused across multiple requests. // Only perform the negotiation when it is explicitly requested by the @@ -147,12 +147,12 @@ nsHttpNegotiateAuth::GetAuthFlags(uint32_t *flags) { // there is no correct way to get the users credentials. // NS_IMETHODIMP -nsHttpNegotiateAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel, - const char *challenge, bool isProxyAuth, - nsISupports **sessionState, - nsISupports **continuationState, - bool *identityInvalid) { - nsIAuthModule *rawModule = (nsIAuthModule *)*continuationState; +nsHttpNegotiateAuth::ChallengeReceived(nsIHttpAuthenticableChannel* authChannel, + const char* challenge, bool isProxyAuth, + nsISupports** sessionState, + nsISupports** continuationState, + bool* identityInvalid) { + nsIAuthModule* rawModule = (nsIAuthModule*)*continuationState; *identityInvalid = false; if (rawModule) { @@ -214,7 +214,7 @@ nsHttpNegotiateAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel, // service.InsertLiteral("HTTP@", 0); - const char *authType; + const char* authType; if (TestBoolPref(kNegotiateAuthSSPI)) { LOG((" using negotiate-sspi\n")); authType = "negotiate-sspi"; @@ -259,11 +259,11 @@ class GetNextTokenCompleteEvent final : public nsIRunnable, public: NS_DECL_THREADSAFE_ISUPPORTS - explicit GetNextTokenCompleteEvent(nsIHttpAuthenticatorCallback *aCallback) + explicit GetNextTokenCompleteEvent(nsIHttpAuthenticatorCallback* aCallback) : mCallback(aCallback), mCreds(nullptr), mCancelled(false) {} NS_IMETHODIMP DispatchSuccess( - char *aCreds, uint32_t aFlags, + char* aCreds, uint32_t aFlags, already_AddRefed aSessionState, already_AddRefed aContinuationState) { // Called from worker thread @@ -312,7 +312,7 @@ class GetNextTokenCompleteEvent final : public nsIRunnable, private: nsCOMPtr mCallback; - char *mCreds; // This class owns it, freed in destructor + char* mCreds; // This class owns it, freed in destructor uint32_t mFlags; nsresult mResult; bool mCancelled; @@ -332,12 +332,12 @@ class GetNextTokenRunnable final : public mozilla::Runnable { ~GetNextTokenRunnable() override = default; public: - GetNextTokenRunnable(nsIHttpAuthenticableChannel *authChannel, - const char *challenge, bool isProxyAuth, - const char16_t *domain, const char16_t *username, - const char16_t *password, nsISupports *sessionState, - nsISupports *continuationState, - GetNextTokenCompleteEvent *aCompleteEvent) + GetNextTokenRunnable(nsIHttpAuthenticableChannel* authChannel, + const char* challenge, bool isProxyAuth, + const char16_t* domain, const char16_t* username, + const char16_t* password, nsISupports* sessionState, + nsISupports* continuationState, + GetNextTokenCompleteEvent* aCompleteEvent) : mozilla::Runnable("GetNextTokenRunnable"), mAuthChannel(authChannel), mChallenge(challenge), @@ -353,7 +353,7 @@ class GetNextTokenRunnable final : public mozilla::Runnable { // Runs on worker thread MOZ_ASSERT(!NS_IsMainThread()); - char *creds; + char* creds; uint32_t flags; nsresult rv = ObtainCredentialsAndFlags(&creds, &flags); @@ -372,14 +372,14 @@ class GetNextTokenRunnable final : public mozilla::Runnable { mContinuationState.forget()); } - NS_IMETHODIMP ObtainCredentialsAndFlags(char **aCreds, uint32_t *aFlags) { + NS_IMETHODIMP ObtainCredentialsAndFlags(char** aCreds, uint32_t* aFlags) { nsresult rv; // Use negotiate service to call GenerateCredentials outside of main thread nsCOMPtr authenticator = new nsHttpNegotiateAuth(); - nsISupports *sessionState = mSessionState; - nsISupports *continuationState = mContinuationState; + nsISupports* sessionState = mSessionState; + nsISupports* continuationState = mContinuationState; // The continuationState is for the sake of completeness propagated // to the caller (despite it is not changed in any GenerateCredentials // implementation). @@ -422,11 +422,11 @@ class GetNextTokenRunnable final : public mozilla::Runnable { NS_IMETHODIMP nsHttpNegotiateAuth::GenerateCredentialsAsync( - nsIHttpAuthenticableChannel *authChannel, - nsIHttpAuthenticatorCallback *aCallback, const char *challenge, - bool isProxyAuth, const char16_t *domain, const char16_t *username, - const char16_t *password, nsISupports *sessionState, - nsISupports *continuationState, nsICancelable **aCancelable) { + nsIHttpAuthenticableChannel* authChannel, + nsIHttpAuthenticatorCallback* aCallback, const char* challenge, + bool isProxyAuth, const char16_t* domain, const char16_t* username, + const char16_t* password, nsISupports* sessionState, + nsISupports* continuationState, nsICancelable** aCancelable) { NS_ENSURE_ARG(aCallback); NS_ENSURE_ARG_POINTER(aCancelable); @@ -458,12 +458,12 @@ nsHttpNegotiateAuth::GenerateCredentialsAsync( // NS_IMETHODIMP nsHttpNegotiateAuth::GenerateCredentials( - nsIHttpAuthenticableChannel *authChannel, const char *challenge, - bool isProxyAuth, const char16_t *domain, const char16_t *username, - const char16_t *password, nsISupports **sessionState, - nsISupports **continuationState, uint32_t *flags, char **creds) { + nsIHttpAuthenticableChannel* authChannel, const char* challenge, + bool isProxyAuth, const char16_t* domain, const char16_t* username, + const char16_t* password, nsISupports** sessionState, + nsISupports** continuationState, uint32_t* flags, char** creds) { // ChallengeReceived must have been called previously. - nsIAuthModule *module = (nsIAuthModule *)*continuationState; + nsIAuthModule* module = (nsIAuthModule*)*continuationState; NS_ENSURE_TRUE(module, NS_ERROR_NOT_INITIALIZED); *flags = USING_INTERNAL_IDENTITY; @@ -503,7 +503,7 @@ nsHttpNegotiateAuth::GenerateCredentials( // // Decode the response that followed the "Negotiate" token // - nsresult rv = Base64Decode(challenge, len, (char **)&inToken, &inTokenLen); + nsresult rv = Base64Decode(challenge, len, (char**)&inToken, &inTokenLen); if (NS_FAILED(rv)) { free(inToken); @@ -531,7 +531,7 @@ nsHttpNegotiateAuth::GenerateCredentials( // // base64 encode the output token. // - char *encoded_token = PL_Base64Encode((char *)outToken, outTokenLen, nullptr); + char* encoded_token = PL_Base64Encode((char*)outToken, outTokenLen, nullptr); free(outToken); @@ -541,14 +541,14 @@ nsHttpNegotiateAuth::GenerateCredentials( // allocate a buffer sizeof("Negotiate" + " " + b64output_token + "\0") const int bufsize = kNegotiateLen + 1 + strlen(encoded_token) + 1; - *creds = (char *)moz_xmalloc(bufsize); + *creds = (char*)moz_xmalloc(bufsize); snprintf(*creds, bufsize, "%s %s", kNegotiate, encoded_token); PR_Free(encoded_token); // PL_Base64Encode() uses PR_Malloc(). return rv; } -bool nsHttpNegotiateAuth::TestBoolPref(const char *pref) { +bool nsHttpNegotiateAuth::TestBoolPref(const char* pref) { nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); if (!prefs) return false; @@ -559,7 +559,7 @@ bool nsHttpNegotiateAuth::TestBoolPref(const char *pref) { return val; } -bool nsHttpNegotiateAuth::TestNonFqdn(nsIURI *uri) { +bool nsHttpNegotiateAuth::TestNonFqdn(nsIURI* uri) { nsAutoCString host; PRNetAddr addr; diff --git a/extensions/auth/nsHttpNegotiateAuth.h b/extensions/auth/nsHttpNegotiateAuth.h index 05beff1fd4850..c69c4c3c568e9 100644 --- a/extensions/auth/nsHttpNegotiateAuth.h +++ b/extensions/auth/nsHttpNegotiateAuth.h @@ -26,10 +26,10 @@ class nsHttpNegotiateAuth final : public nsIHttpAuthenticator { ~nsHttpNegotiateAuth() {} // returns the value of the given boolean pref - bool TestBoolPref(const char *pref); + bool TestBoolPref(const char* pref); // tests if the host part of an uri is fully qualified - bool TestNonFqdn(nsIURI *uri); + bool TestNonFqdn(nsIURI* uri); // Thread for GenerateCredentialsAsync RefPtr mNegotiateThread; diff --git a/extensions/permissions/nsContentBlocker.cpp b/extensions/permissions/nsContentBlocker.cpp index ba1180a04ac0b..bd98eb5aa5a70 100644 --- a/extensions/permissions/nsContentBlocker.cpp +++ b/extensions/permissions/nsContentBlocker.cpp @@ -134,8 +134,8 @@ nsresult nsContentBlocker::Init() { #define LIMIT(x, low, high, default) \ ((x) >= (low) && (x) <= (high) ? (x) : (default)) -void nsContentBlocker::PrefChanged(nsIPrefBranch *aPrefBranch, - const char *aPref) { +void nsContentBlocker::PrefChanged(nsIPrefBranch* aPrefBranch, + const char* aPref) { int32_t val; #define PREF_CHANGED(_P) (!aPref || !strcmp(aPref, _P)) @@ -150,8 +150,8 @@ void nsContentBlocker::PrefChanged(nsIPrefBranch *aPrefBranch, // nsIContentPolicy Implementation NS_IMETHODIMP -nsContentBlocker::ShouldLoad(nsIURI *aContentLocation, nsILoadInfo *aLoadInfo, - const nsACString &aMimeGuess, int16_t *aDecision) { +nsContentBlocker::ShouldLoad(nsIURI* aContentLocation, nsILoadInfo* aLoadInfo, + const nsACString& aMimeGuess, int16_t* aDecision) { uint32_t contentType = aLoadInfo->GetExternalContentPolicyType(); nsCOMPtr loadingPrincipal = aLoadInfo->LoadingPrincipal(); nsCOMPtr requestingLocation; @@ -205,10 +205,10 @@ nsContentBlocker::ShouldLoad(nsIURI *aContentLocation, nsILoadInfo *aLoadInfo, } NS_IMETHODIMP -nsContentBlocker::ShouldProcess(nsIURI *aContentLocation, - nsILoadInfo *aLoadInfo, - const nsACString &aMimeGuess, - int16_t *aDecision) { +nsContentBlocker::ShouldProcess(nsIURI* aContentLocation, + nsILoadInfo* aLoadInfo, + const nsACString& aMimeGuess, + int16_t* aDecision) { uint32_t contentType = aLoadInfo->GetExternalContentPolicyType(); nsCOMPtr requestingContext = aLoadInfo->GetLoadingContext(); nsCOMPtr loadingPrincipal = aLoadInfo->LoadingPrincipal(); @@ -264,10 +264,10 @@ nsContentBlocker::ShouldProcess(nsIURI *aContentLocation, return ShouldLoad(aContentLocation, aLoadInfo, aMimeGuess, aDecision); } -nsresult nsContentBlocker::TestPermission(nsIURI *aCurrentURI, - nsIURI *aFirstURI, +nsresult nsContentBlocker::TestPermission(nsIURI* aCurrentURI, + nsIURI* aFirstURI, int32_t aContentType, - bool *aPermission, bool *aFromPrefs) { + bool* aPermission, bool* aFromPrefs) { *aFromPrefs = false; nsresult rv; @@ -345,7 +345,7 @@ nsresult nsContentBlocker::TestPermission(nsIURI *aCurrentURI, // Get the domain, ie the last part of the host (www.domain.com -> // domain.com) This will break on co.uk - const nsACString &tail = + const nsACString& tail = Substring(currentHost, dot, currentHost.Length() - dot); nsAutoCString firstHost; @@ -359,7 +359,7 @@ nsresult nsContentBlocker::TestPermission(nsIURI *aCurrentURI, } // Get the last part of the firstUri with the same length as |tail| - const nsACString &firstTail = Substring( + const nsACString& firstTail = Substring( firstHost, firstHost.Length() - tail.Length(), tail.Length()); // Check that both tails are the same, and that just before the tail in @@ -376,8 +376,8 @@ nsresult nsContentBlocker::TestPermission(nsIURI *aCurrentURI, } NS_IMETHODIMP -nsContentBlocker::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsContentBlocker::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { NS_ASSERTION(!strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, aTopic), "unexpected topic - we only deal with pref changes!"); diff --git a/extensions/permissions/nsContentBlocker.h b/extensions/permissions/nsContentBlocker.h index 30c1e05feb6b8..0a27398feb381 100644 --- a/extensions/permissions/nsContentBlocker.h +++ b/extensions/permissions/nsContentBlocker.h @@ -30,10 +30,10 @@ class nsContentBlocker final : public nsIContentPolicy, private: ~nsContentBlocker() {} - void PrefChanged(nsIPrefBranch *, const char *); - nsresult TestPermission(nsIURI *aCurrentURI, nsIURI *aFirstURI, - int32_t aContentType, bool *aPermission, - bool *aFromPrefs); + void PrefChanged(nsIPrefBranch*, const char*); + nsresult TestPermission(nsIURI* aCurrentURI, nsIURI* aFirstURI, + int32_t aContentType, bool* aPermission, + bool* aFromPrefs); nsCOMPtr mPermissionManager; nsCOMPtr mPrefBranchInternal; diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.cpp b/extensions/pref/autoconfig/src/nsAutoConfig.cpp index 435c5601eaac6..d14fb7b1b3145 100644 --- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp +++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp @@ -57,15 +57,15 @@ nsresult nsAutoConfig::Init() { nsAutoConfig::~nsAutoConfig() {} -void nsAutoConfig::SetConfigURL(const char *aConfigURL) { +void nsAutoConfig::SetConfigURL(const char* aConfigURL) { mConfigURL.Assign(aConfigURL); } NS_IMETHODIMP -nsAutoConfig::OnStartRequest(nsIRequest *request) { return NS_OK; } +nsAutoConfig::OnStartRequest(nsIRequest* request) { return NS_OK; } NS_IMETHODIMP -nsAutoConfig::OnDataAvailable(nsIRequest *request, nsIInputStream *aIStream, +nsAutoConfig::OnDataAvailable(nsIRequest* request, nsIInputStream* aIStream, uint64_t aSourceOffset, uint32_t aLength) { uint32_t amt, size; nsresult rv; @@ -82,7 +82,7 @@ nsAutoConfig::OnDataAvailable(nsIRequest *request, nsIInputStream *aIStream, } NS_IMETHODIMP -nsAutoConfig::OnStopRequest(nsIRequest *request, nsresult aStatus) { +nsAutoConfig::OnStopRequest(nsIRequest* request, nsresult aStatus) { nsresult rv; // If the request is failed, go read the failover.jsc file @@ -128,13 +128,13 @@ nsAutoConfig::OnStopRequest(nsIRequest *request, nsresult aStatus) { } // Notify method as a TimerCallBack function -NS_IMETHODIMP nsAutoConfig::Notify(nsITimer *timer) { +NS_IMETHODIMP nsAutoConfig::Notify(nsITimer* timer) { downloadAutoConfig(); return NS_OK; } NS_IMETHODIMP -nsAutoConfig::GetName(nsACString &aName) { +nsAutoConfig::GetName(nsACString& aName) { aName.AssignLiteral("nsAutoConfig"); return NS_OK; } @@ -144,8 +144,8 @@ nsAutoConfig::GetName(nsACString &aName) { creation time. Second time it calls downloadAutoConfig(). */ -NS_IMETHODIMP nsAutoConfig::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *someData) { +NS_IMETHODIMP nsAutoConfig::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* someData) { nsresult rv = NS_OK; if (!nsCRT::strcmp(aTopic, "profile-after-change")) { // We will be calling downloadAutoConfig even if there is no profile @@ -344,7 +344,7 @@ nsresult nsAutoConfig::readOfflineFile() { return NS_OK; } -nsresult nsAutoConfig::evaluateLocalFile(nsIFile *file) { +nsresult nsAutoConfig::evaluateLocalFile(nsIFile* file) { nsresult rv; nsCOMPtr inStr; @@ -354,7 +354,7 @@ nsresult nsAutoConfig::evaluateLocalFile(nsIFile *file) { int64_t fileSize; file->GetFileSize(&fileSize); uint32_t fs = fileSize; // Converting 64 bit structure to unsigned int - char *buf = (char *)malloc(fs * sizeof(char)); + char* buf = (char*)malloc(fs * sizeof(char)); if (!buf) return NS_ERROR_OUT_OF_MEMORY; uint32_t amt = 0; @@ -386,7 +386,7 @@ nsresult nsAutoConfig::writeFailoverFile() { return rv; } -nsresult nsAutoConfig::getEmailAddr(nsACString &emailAddr) { +nsresult nsAutoConfig::getEmailAddr(nsACString& emailAddr) { nsresult rv; nsAutoCString prefValue; @@ -427,7 +427,7 @@ nsresult nsAutoConfig::getEmailAddr(nsACString &emailAddr) { return NS_OK; } -nsresult nsAutoConfig::PromptForEMailAddress(nsACString &emailAddress) { +nsresult nsAutoConfig::PromptForEMailAddress(nsACString& emailAddress) { nsresult rv; nsCOMPtr promptService = do_GetService("@mozilla.org/embedcomp/prompt-service;1", &rv); diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.h b/extensions/pref/autoconfig/src/nsAutoConfig.h index a76329f1eeba8..2670f3ea25001 100644 --- a/extensions/pref/autoconfig/src/nsAutoConfig.h +++ b/extensions/pref/autoconfig/src/nsAutoConfig.h @@ -34,16 +34,16 @@ class nsAutoConfig final : public nsITimerCallback, nsAutoConfig(); nsresult Init(); - void SetConfigURL(const char *aConfigURL); + void SetConfigURL(const char* aConfigURL); protected: virtual ~nsAutoConfig(); nsresult downloadAutoConfig(); nsresult readOfflineFile(); - nsresult evaluateLocalFile(nsIFile *file); + nsresult evaluateLocalFile(nsIFile* file); nsresult writeFailoverFile(); - nsresult getEmailAddr(nsACString &emailAddr); - nsresult PromptForEMailAddress(nsACString &emailAddress); + nsresult getEmailAddr(nsACString& emailAddr); + nsresult PromptForEMailAddress(nsACString& emailAddress); nsCString mBuf; nsCOMPtr mPrefBranch; bool mLoaded; diff --git a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp index 874885649965a..684c22fd59723 100644 --- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp +++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp @@ -30,8 +30,8 @@ using mozilla::dom::AutoJSAPI; //***************************************************************************** -static JS::PersistentRooted autoconfigSystemSb; -static JS::PersistentRooted autoconfigSb; +static JS::PersistentRooted autoconfigSystemSb; +static JS::PersistentRooted autoconfigSb; static bool sandboxEnabled; nsresult CentralizedAdminPrefManagerInit(bool aSandboxEnabled) { @@ -50,7 +50,7 @@ nsresult CentralizedAdminPrefManagerInit(bool aSandboxEnabled) { // Create a sandbox. AutoSafeJSContext cx; - JS::Rooted sandbox(cx); + JS::Rooted sandbox(cx); nsresult rv = xpc->CreateSandbox(cx, principal, sandbox.address()); NS_ENSURE_SUCCESS(rv, rv); @@ -89,8 +89,8 @@ nsresult CentralizedAdminPrefManagerFinish() { return NS_OK; } -nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length, - const char *filename, bool globalContext, +nsresult EvaluateAdminConfigScript(const char* js_buffer, size_t length, + const char* filename, bool globalContext, bool callbacks, bool skipFirstLine, bool isPrivileged) { if (!sandboxEnabled) { @@ -102,8 +102,8 @@ nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length, } nsresult EvaluateAdminConfigScript(JS::HandleObject sandbox, - const char *js_buffer, size_t length, - const char *filename, bool globalContext, + const char* js_buffer, size_t length, + const char* filename, bool globalContext, bool callbacks, bool skipFirstLine) { if (skipFirstLine) { /* In order to protect the privacy of the JavaScript preferences file @@ -132,7 +132,7 @@ nsresult EvaluateAdminConfigScript(JS::HandleObject sandbox, if (!jsapi.Init(sandbox)) { return NS_ERROR_UNEXPECTED; } - JSContext *cx = jsapi.cx(); + JSContext* cx = jsapi.cx(); nsAutoCString script(js_buffer, length); JS::RootedValue v(cx); diff --git a/extensions/pref/autoconfig/src/nsJSConfigTriggers.h b/extensions/pref/autoconfig/src/nsJSConfigTriggers.h index 53556e3086e5a..d4477d8f100e7 100644 --- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.h +++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.h @@ -4,14 +4,14 @@ #include "nscore.h" #include "js/TypeDecls.h" -nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length, - const char *filename, bool bGlobalContext, +nsresult EvaluateAdminConfigScript(const char* js_buffer, size_t length, + const char* filename, bool bGlobalContext, bool bCallbacks, bool skipFirstLine, bool isPrivileged = false); nsresult EvaluateAdminConfigScript(JS::HandleObject sandbox, - const char *js_buffer, size_t length, - const char *filename, bool bGlobalContext, + const char* js_buffer, size_t length, + const char* filename, bool bGlobalContext, bool bCallbacks, bool skipFirstLine); #endif // nsConfigTriggers_h diff --git a/extensions/pref/autoconfig/src/nsReadConfig.cpp b/extensions/pref/autoconfig/src/nsReadConfig.cpp index 1c6f08e46baff..a6e66d4512324 100644 --- a/extensions/pref/autoconfig/src/nsReadConfig.cpp +++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp @@ -83,8 +83,8 @@ nsresult nsReadConfig::Init() { nsReadConfig::~nsReadConfig() { CentralizedAdminPrefManagerFinish(); } -NS_IMETHODIMP nsReadConfig::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *someData) { +NS_IMETHODIMP nsReadConfig::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* someData) { nsresult rv = NS_OK; if (!nsCRT::strcmp(aTopic, NS_PREFSERVICE_READ_TOPIC_ID)) { @@ -115,7 +115,7 @@ NS_IMETHODIMP nsReadConfig::Observe(nsISupports *aSubject, const char *aTopic, /** * This is the blocklist for known bad autoconfig files. */ -static const char *gBlockedConfigs[] = {"dsengine.cfg"}; +static const char* gBlockedConfigs[] = {"dsengine.cfg"}; nsresult nsReadConfig::readConfigFile() { nsresult rv = NS_OK; @@ -231,7 +231,7 @@ nsresult nsReadConfig::readConfigFile() { return NS_OK; } // ReadConfigFile -nsresult nsReadConfig::openAndEvaluateJSFile(const char *aFileName, +nsresult nsReadConfig::openAndEvaluateJSFile(const char* aFileName, int32_t obscureValue, bool isEncoded, bool isBinDir) { nsresult rv; @@ -275,7 +275,7 @@ nsresult nsReadConfig::openAndEvaluateJSFile(const char *aFileName, if (fs64 > UINT32_MAX) return NS_ERROR_FILE_TOO_BIG; uint32_t fs = (uint32_t)fs64; - char *buf = (char *)malloc(fs * sizeof(char)); + char* buf = (char*)malloc(fs * sizeof(char)); if (!buf) return NS_ERROR_OUT_OF_MEMORY; rv = inStr->Read(buf, (uint32_t)fs, &amt); diff --git a/extensions/pref/autoconfig/src/nsReadConfig.h b/extensions/pref/autoconfig/src/nsReadConfig.h index 2587579e6e22a..465a5171865c1 100644 --- a/extensions/pref/autoconfig/src/nsReadConfig.h +++ b/extensions/pref/autoconfig/src/nsReadConfig.h @@ -23,7 +23,7 @@ class nsReadConfig final : public nsIObserver { virtual ~nsReadConfig(); nsresult readConfigFile(); - nsresult openAndEvaluateJSFile(const char *aFileName, int32_t obscureValue, + nsresult openAndEvaluateJSFile(const char* aFileName, int32_t obscureValue, bool isEncoded, bool isBinDir); bool mRead; diff --git a/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.h b/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.h index a2f3a84ab9cb3..766976e136b9e 100644 --- a/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.h +++ b/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.h @@ -16,14 +16,14 @@ namespace mozilla { class RemoteSpellcheckEngineChild : public mozilla::PRemoteSpellcheckEngineChild { public: - explicit RemoteSpellcheckEngineChild(mozSpellChecker *aOwner); + explicit RemoteSpellcheckEngineChild(mozSpellChecker* aOwner); virtual ~RemoteSpellcheckEngineChild(); RefPtr SetCurrentDictionaryFromList( - const nsTArray &aList); + const nsTArray& aList); private: - mozSpellChecker *mOwner; + mozSpellChecker* mOwner; }; } // namespace mozilla diff --git a/extensions/spellcheck/src/mozEnglishWordUtils.cpp b/extensions/spellcheck/src/mozEnglishWordUtils.cpp index 60ff718d33028..0a26c6cbc4a6d 100644 --- a/extensions/spellcheck/src/mozEnglishWordUtils.cpp +++ b/extensions/spellcheck/src/mozEnglishWordUtils.cpp @@ -31,19 +31,19 @@ bool mozEnglishWordUtils::ucIsAlpha(char16_t aChar) { return nsUGenCategory::kLetter == mozilla::unicode::GetGenCategory(aChar); } -bool mozEnglishWordUtils::FindNextWord(const nsAString &aWord, uint32_t offset, - int32_t *begin, int32_t *end) { +bool mozEnglishWordUtils::FindNextWord(const nsAString& aWord, uint32_t offset, + int32_t* begin, int32_t* end) { if (offset >= aWord.Length()) { *begin = -1; *end = -1; return false; } - const char16_t *word = aWord.BeginReading(); + const char16_t* word = aWord.BeginReading(); uint32_t length = aWord.Length(); - const char16_t *p = word + offset; - const char16_t *endbuf = word + length; - const char16_t *startWord = p; + const char16_t* p = word + offset; + const char16_t* endbuf = word + length; + const char16_t* startWord = p; // XXX These loops should be modified to handle non-BMP characters. // if previous character is a word character, need to advance out of the diff --git a/extensions/spellcheck/src/mozSpellChecker.cpp b/extensions/spellcheck/src/mozSpellChecker.cpp index 47bc416a956c4..cfcd726192073 100644 --- a/extensions/spellcheck/src/mozSpellChecker.cpp +++ b/extensions/spellcheck/src/mozSpellChecker.cpp @@ -50,7 +50,7 @@ mozSpellChecker::~mozSpellChecker() { nsresult mozSpellChecker::Init() { mSpellCheckingEngine = nullptr; if (XRE_IsContentProcess()) { - mozilla::dom::ContentChild *contentChild = + mozilla::dom::ContentChild* contentChild = mozilla::dom::ContentChild::GetSingleton(); MOZ_ASSERT(contentChild); mEngine = new RemoteSpellcheckEngineChild(this); @@ -63,19 +63,19 @@ nsresult mozSpellChecker::Init() { return NS_OK; } -TextServicesDocument *mozSpellChecker::GetTextServicesDocument() { +TextServicesDocument* mozSpellChecker::GetTextServicesDocument() { return mTextServicesDocument; } nsresult mozSpellChecker::SetDocument( - TextServicesDocument *aTextServicesDocument, bool aFromStartofDoc) { + TextServicesDocument* aTextServicesDocument, bool aFromStartofDoc) { mTextServicesDocument = aTextServicesDocument; mFromStart = aFromStartofDoc; return NS_OK; } -nsresult mozSpellChecker::NextMisspelledWord(nsAString &aWord, - nsTArray &aSuggestions) { +nsresult mozSpellChecker::NextMisspelledWord(nsAString& aWord, + nsTArray& aSuggestions) { if (NS_WARN_IF(!mConverter)) { return NS_ERROR_NOT_INITIALIZED; } @@ -115,15 +115,15 @@ nsresult mozSpellChecker::NextMisspelledWord(nsAString &aWord, } RefPtr mozSpellChecker::CheckWords( - const nsTArray &aWords) { + const nsTArray& aWords) { if (XRE_IsContentProcess()) { return mEngine->SendCheckAsync(aWords)->Then( GetMainThreadSerialEventTarget(), __func__, - [](nsTArray &&aIsMisspelled) { + [](nsTArray&& aIsMisspelled) { return CheckWordPromise::CreateAndResolve(std::move(aIsMisspelled), __func__); }, - [](mozilla::ipc::ResponseRejectReason &&aReason) { + [](mozilla::ipc::ResponseRejectReason&& aReason) { return CheckWordPromise::CreateAndReject(NS_ERROR_NOT_AVAILABLE, __func__); }); @@ -131,7 +131,7 @@ RefPtr mozSpellChecker::CheckWords( nsTArray misspells; misspells.SetCapacity(aWords.Length()); - for (auto &word : aWords) { + for (auto& word : aWords) { bool misspelled; nsresult rv = CheckWord(word, &misspelled, nullptr); if (NS_WARN_IF(NS_FAILED(rv))) { @@ -142,8 +142,8 @@ RefPtr mozSpellChecker::CheckWords( return CheckWordPromise::CreateAndResolve(std::move(misspells), __func__); } -nsresult mozSpellChecker::CheckWord(const nsAString &aWord, bool *aIsMisspelled, - nsTArray *aSuggestions) { +nsresult mozSpellChecker::CheckWord(const nsAString& aWord, bool* aIsMisspelled, + nsTArray* aSuggestions) { nsresult result; bool correct; @@ -165,11 +165,11 @@ nsresult mozSpellChecker::CheckWord(const nsAString &aWord, bool *aIsMisspelled, if (!correct) { if (aSuggestions) { uint32_t count, i; - char16_t **words; + char16_t** words; result = mSpellCheckingEngine->Suggest(aWord, &words, &count); NS_ENSURE_SUCCESS(result, result); - nsString *suggestions = aSuggestions->AppendElements(count); + nsString* suggestions = aSuggestions->AppendElements(count); for (i = 0; i < count; i++) { suggestions[i].Assign(words[i]); } @@ -181,8 +181,8 @@ nsresult mozSpellChecker::CheckWord(const nsAString &aWord, bool *aIsMisspelled, return NS_OK; } -nsresult mozSpellChecker::Replace(const nsAString &aOldWord, - const nsAString &aNewWord, +nsresult mozSpellChecker::Replace(const nsAString& aOldWord, + const nsAString& aNewWord, bool aAllOccurrences) { if (NS_WARN_IF(!mConverter)) { return NS_ERROR_NOT_INITIALIZED; @@ -279,14 +279,14 @@ nsresult mozSpellChecker::Replace(const nsAString &aOldWord, return NS_OK; } -nsresult mozSpellChecker::IgnoreAll(const nsAString &aWord) { +nsresult mozSpellChecker::IgnoreAll(const nsAString& aWord) { if (mPersonalDictionary) { mPersonalDictionary->IgnoreWord(aWord); } return NS_OK; } -nsresult mozSpellChecker::AddWordToPersonalDictionary(const nsAString &aWord) { +nsresult mozSpellChecker::AddWordToPersonalDictionary(const nsAString& aWord) { nsresult res; if (NS_WARN_IF(!mPersonalDictionary)) { return NS_ERROR_NOT_INITIALIZED; @@ -296,7 +296,7 @@ nsresult mozSpellChecker::AddWordToPersonalDictionary(const nsAString &aWord) { } nsresult mozSpellChecker::RemoveWordFromPersonalDictionary( - const nsAString &aWord) { + const nsAString& aWord) { nsresult res; if (NS_WARN_IF(!mPersonalDictionary)) { return NS_ERROR_NOT_INITIALIZED; @@ -305,7 +305,7 @@ nsresult mozSpellChecker::RemoveWordFromPersonalDictionary( return res; } -nsresult mozSpellChecker::GetPersonalDictionary(nsTArray *aWordList) { +nsresult mozSpellChecker::GetPersonalDictionary(nsTArray* aWordList) { if (!aWordList || !mPersonalDictionary) return NS_ERROR_NULL_POINTER; nsCOMPtr words; @@ -321,9 +321,9 @@ nsresult mozSpellChecker::GetPersonalDictionary(nsTArray *aWordList) { } nsresult mozSpellChecker::GetDictionaryList( - nsTArray *aDictionaryList) { + nsTArray* aDictionaryList) { if (XRE_IsContentProcess()) { - ContentChild *child = ContentChild::GetSingleton(); + ContentChild* child = ContentChild::GetSingleton(); child->GetAvailableDictionaries(*aDictionaryList); return NS_OK; } @@ -341,7 +341,7 @@ nsresult mozSpellChecker::GetDictionaryList( nsCOMPtr engine = spellCheckingEngines[i]; uint32_t count = 0; - char16_t **words = nullptr; + char16_t** words = nullptr; engine->GetDictionaryList(&words, &count); for (uint32_t k = 0; k < count; k++) { nsAutoString dictName; @@ -366,7 +366,7 @@ nsresult mozSpellChecker::GetDictionaryList( return NS_OK; } -nsresult mozSpellChecker::GetCurrentDictionary(nsAString &aDictionary) { +nsresult mozSpellChecker::GetCurrentDictionary(nsAString& aDictionary) { if (XRE_IsContentProcess()) { aDictionary = mCurrentDictionary; return NS_OK; @@ -380,7 +380,7 @@ nsresult mozSpellChecker::GetCurrentDictionary(nsAString &aDictionary) { return mSpellCheckingEngine->GetDictionary(aDictionary); } -nsresult mozSpellChecker::SetCurrentDictionary(const nsAString &aDictionary) { +nsresult mozSpellChecker::SetCurrentDictionary(const nsAString& aDictionary) { if (XRE_IsContentProcess()) { nsString wrappedDict = nsString(aDictionary); bool isSuccess; @@ -433,7 +433,7 @@ nsresult mozSpellChecker::SetCurrentDictionary(const nsAString &aDictionary) { } RefPtr mozSpellChecker::SetCurrentDictionaryFromList( - const nsTArray &aList) { + const nsTArray& aList) { if (aList.IsEmpty()) { return GenericPromise::CreateAndReject(NS_ERROR_INVALID_ARG, __func__); } @@ -443,7 +443,7 @@ RefPtr mozSpellChecker::SetCurrentDictionaryFromList( return mEngine->SetCurrentDictionaryFromList(aList); } - for (auto &dictionary : aList) { + for (auto& dictionary : aList) { nsresult rv = SetCurrentDictionary(dictionary); if (NS_SUCCEEDED(rv)) { return GenericPromise::CreateAndResolve(true, __func__); @@ -453,7 +453,7 @@ RefPtr mozSpellChecker::SetCurrentDictionaryFromList( return GenericPromise::CreateAndReject(NS_ERROR_NOT_AVAILABLE, __func__); } -nsresult mozSpellChecker::SetupDoc(int32_t *outBlockOffset) { +nsresult mozSpellChecker::SetupDoc(int32_t* outBlockOffset) { nsresult rv; TextServicesDocument::BlockSelectionStatus blockStatus; @@ -513,7 +513,7 @@ nsresult mozSpellChecker::SetupDoc(int32_t *outBlockOffset) { // give us this, because it can't assume a read-only document. shamelessly // stolen from nsTextServicesDocument nsresult mozSpellChecker::GetCurrentBlockIndex( - TextServicesDocument *aTextServicesDocument, int32_t *aOutBlockIndex) { + TextServicesDocument* aTextServicesDocument, int32_t* aOutBlockIndex) { int32_t blockIndex = 0; bool isDone = false; nsresult result = NS_OK; @@ -532,7 +532,7 @@ nsresult mozSpellChecker::GetCurrentBlockIndex( } nsresult mozSpellChecker::GetEngineList( - nsCOMArray *aSpellCheckingEngines) { + nsCOMArray* aSpellCheckingEngines) { MOZ_ASSERT(!XRE_IsContentProcess()); nsresult rv; diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h index fadb281bfd364..e8ff78600e294 100644 --- a/gfx/2d/2D.h +++ b/gfx/2d/2D.h @@ -50,10 +50,10 @@ struct _cairo_scaled_font; typedef _cairo_scaled_font cairo_scaled_font_t; struct FT_LibraryRec_; -typedef FT_LibraryRec_ *FT_Library; +typedef FT_LibraryRec_* FT_Library; struct FT_FaceRec_; -typedef FT_FaceRec_ *FT_Face; +typedef FT_FaceRec_* FT_Face; typedef int FT_Error; @@ -70,10 +70,10 @@ class SkCanvas; struct gfxFontStyle; struct CGContext; -typedef struct CGContext *CGContextRef; +typedef struct CGContext* CGContextRef; struct CGFont; -typedef CGFont *CGFontRef; +typedef CGFont* CGFontRef; namespace mozilla { @@ -104,12 +104,12 @@ struct NativeSurface { NativeSurfaceType mType; SurfaceFormat mFormat; gfx::IntSize mSize; - void *mSurface; + void* mSurface; }; struct NativeFont { NativeFontType mType; - void *mFont; + void* mFont; }; /** @@ -143,7 +143,7 @@ struct StrokeOptions { JoinStyle aLineJoin = JoinStyle::MITER_OR_BEVEL, CapStyle aLineCap = CapStyle::BUTT, Float aMiterLimit = 10.0f, size_t aDashLength = 0, - const Float *aDashPattern = 0, Float aDashOffset = 0.f) + const Float* aDashPattern = 0, Float aDashOffset = 0.f) : mLineWidth(aLineWidth), mMiterLimit(aMiterLimit), mDashPattern(aDashLength > 0 ? aDashPattern : 0), @@ -156,7 +156,7 @@ struct StrokeOptions { Float mLineWidth; //!< Width of the stroke in userspace. Float mMiterLimit; //!< Miter limit in units of linewidth - const Float *mDashPattern; /**< Series of on/off userspace lengths defining + const Float* mDashPattern; /**< Series of on/off userspace lengths defining dash. Owned by the caller; must live at least as long as this StrokeOptions. mDashPattern != null <=> mDashLength > 0. */ @@ -223,7 +223,7 @@ class ColorPattern : public Pattern { public: // Explicit because consumers should generally use ToDeviceColor when // creating a ColorPattern. - explicit ColorPattern(const Color &aColor) : mColor(aColor) {} + explicit ColorPattern(const Color& aColor) : mColor(aColor) {} PatternType GetType() const override { return PatternType::COLOR; } @@ -238,8 +238,8 @@ class ColorPattern : public Pattern { class LinearGradientPattern : public Pattern { public: /// For constructor parameter description, see member data documentation. - LinearGradientPattern(const Point &aBegin, const Point &aEnd, - GradientStops *aStops, const Matrix &aMatrix = Matrix()) + LinearGradientPattern(const Point& aBegin, const Point& aEnd, + GradientStops* aStops, const Matrix& aMatrix = Matrix()) : mBegin(aBegin), mEnd(aEnd), mStops(aStops), mMatrix(aMatrix) {} PatternType GetType() const override { return PatternType::LINEAR_GRADIENT; } @@ -264,9 +264,9 @@ class LinearGradientPattern : public Pattern { class RadialGradientPattern : public Pattern { public: /// For constructor parameter description, see member data documentation. - RadialGradientPattern(const Point &aCenter1, const Point &aCenter2, - Float aRadius1, Float aRadius2, GradientStops *aStops, - const Matrix &aMatrix = Matrix()) + RadialGradientPattern(const Point& aCenter1, const Point& aCenter2, + Float aRadius1, Float aRadius2, GradientStops* aStops, + const Matrix& aMatrix = Matrix()) : mCenter1(aCenter1), mCenter2(aCenter2), mRadius1(aRadius1), @@ -294,10 +294,10 @@ class RadialGradientPattern : public Pattern { class SurfacePattern : public Pattern { public: /// For constructor parameter description, see member data documentation. - SurfacePattern(SourceSurface *aSourceSurface, ExtendMode aExtendMode, - const Matrix &aMatrix = Matrix(), + SurfacePattern(SourceSurface* aSourceSurface, ExtendMode aExtendMode, + const Matrix& aMatrix = Matrix(), SamplingFilter aSamplingFilter = SamplingFilter::GOOD, - const IntRect &aSamplingRect = IntRect()) + const IntRect& aSamplingRect = IntRect()) : mSurface(aSourceSurface), mExtendMode(aExtendMode), mSamplingFilter(aSamplingFilter), @@ -355,7 +355,7 @@ class SourceSurface : public external::AtomicRefCounted { * the objects are different (e.g. indirection due to * DataSourceSurfaceWrapper). */ - virtual bool Equals(SourceSurface *aOther, bool aSymmetric = true) { + virtual bool Equals(SourceSurface* aOther, bool aSymmetric = true) { return this == aOther || (aSymmetric && aOther && aOther->Equals(this, false)); } @@ -379,13 +379,13 @@ class SourceSurface : public external::AtomicRefCounted { /** Tries to get this SourceSurface's native surface. This will fail if aType * is not the type of this SourceSurface's native surface. */ - virtual void *GetNativeSurface(NativeSurfaceType aType) { return nullptr; } + virtual void* GetNativeSurface(NativeSurfaceType aType) { return nullptr; } - void AddUserData(UserDataKey *key, void *userData, void (*destroy)(void *)) { + void AddUserData(UserDataKey* key, void* userData, void (*destroy)(void*)) { mUserData.Add(key, userData, destroy); } - void *GetUserData(UserDataKey *key) const { return mUserData.Get(key); } - void RemoveUserData(UserDataKey *key) { mUserData.RemoveAndDestroy(key); } + void* GetUserData(UserDataKey* key) const { return mUserData.Get(key); } + void RemoveUserData(UserDataKey* key) { mUserData.RemoveAndDestroy(key); } protected: friend class DrawTargetCaptureImpl; @@ -410,7 +410,7 @@ class DataSourceSurface : public SourceSurface { #endif struct MappedSurface { - uint8_t *mData; + uint8_t* mData; int32_t mStride; }; @@ -425,10 +425,10 @@ class DataSourceSurface : public SourceSurface { */ class ScopedMap final { public: - ScopedMap(DataSourceSurface *aSurface, MapType aType) + ScopedMap(DataSourceSurface* aSurface, MapType aType) : mSurface(aSurface), mIsMapped(aSurface->Map(aType, &mMap)) {} - ScopedMap(ScopedMap &&aOther) + ScopedMap(ScopedMap&& aOther) : mSurface(std::move(aOther.mSurface)), mMap(aOther.mMap), mIsMapped(aOther.mIsMapped) { @@ -436,7 +436,7 @@ class DataSourceSurface : public SourceSurface { aOther.mIsMapped = false; } - ScopedMap &operator=(ScopedMap &&aOther) { + ScopedMap& operator=(ScopedMap&& aOther) { if (mIsMapped) { mSurface->Unmap(); } @@ -454,7 +454,7 @@ class DataSourceSurface : public SourceSurface { } } - uint8_t *GetData() const { + uint8_t* GetData() const { MOZ_ASSERT(mIsMapped); return mMap.mData; } @@ -464,7 +464,7 @@ class DataSourceSurface : public SourceSurface { return mMap.mStride; } - const MappedSurface *GetMappedSurface() const { + const MappedSurface* GetMappedSurface() const { MOZ_ASSERT(mIsMapped); return &mMap; } @@ -472,8 +472,8 @@ class DataSourceSurface : public SourceSurface { bool IsMapped() const { return mIsMapped; } private: - ScopedMap(const ScopedMap &aOther) = delete; - ScopedMap &operator=(const ScopedMap &aOther) = delete; + ScopedMap(const ScopedMap& aOther) = delete; + ScopedMap& operator=(const ScopedMap& aOther) = delete; RefPtr mSurface; MappedSurface mMap; @@ -488,7 +488,7 @@ class DataSourceSurface : public SourceSurface { * Deprecated means you shouldn't be using this!! Use Map instead. * Please deny any reviews which add calls to this! */ - virtual uint8_t *GetData() = 0; + virtual uint8_t* GetData() = 0; /** @deprecated * Stride of the surface, distance in bytes between the start of the image @@ -509,7 +509,7 @@ class DataSourceSurface : public SourceSurface { // Once mfbt supports Monitors we should implement proper read/write // locking to prevent write races. */ - virtual bool Map(MapType, MappedSurface *aMappedSurface) { + virtual bool Map(MapType, MappedSurface* aMappedSurface) { aMappedSurface->mData = GetData(); aMappedSurface->mStride = Stride(); bool success = !!aMappedSurface->mData; @@ -537,10 +537,10 @@ class DataSourceSurface : public SourceSurface { * Add the size of the underlying data buffer to the aggregate. */ virtual void AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf, - size_t &aHeapSizeOut, - size_t &aNonHeapSizeOut, - size_t &aExtHandlesOut, - uint64_t &aExtIdOut) const {} + size_t& aHeapSizeOut, + size_t& aNonHeapSizeOut, + size_t& aExtHandlesOut, + uint64_t& aExtIdOut) const {} /** * Returns whether or not the data was allocated on the heap. This should @@ -556,7 +556,7 @@ class DataSourceSurface : public SourceSurface { /** * Indicate a region which has changed in the surface. */ - virtual void Invalidate(const IntRect &aDirtyRect) {} + virtual void Invalidate(const IntRect& aDirtyRect) {} protected: Atomic mMapCount; @@ -572,20 +572,20 @@ class PathSink : public RefCounted { * be considered closed during fill operations, however when stroking the * closing line segment will not be drawn. */ - virtual void MoveTo(const Point &aPoint) = 0; + virtual void MoveTo(const Point& aPoint) = 0; /** Add a linesegment to the current figure */ - virtual void LineTo(const Point &aPoint) = 0; + virtual void LineTo(const Point& aPoint) = 0; /** Add a cubic bezier curve to the current figure */ - virtual void BezierTo(const Point &aCP1, const Point &aCP2, - const Point &aCP3) = 0; + virtual void BezierTo(const Point& aCP1, const Point& aCP2, + const Point& aCP3) = 0; /** Add a quadratic bezier curve to the current figure */ - virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) = 0; + virtual void QuadraticBezierTo(const Point& aCP1, const Point& aCP2) = 0; /** Close the current figure, this will essentially generate a line segment * from the current point to the starting point for the current figure */ virtual void Close() = 0; /** Add an arc to the current figure */ - virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle, + virtual void Arc(const Point& aOrigin, float aRadius, float aStartAngle, float aEndAngle, bool aAntiClockwise = false) = 0; /** Point the current subpath is at - or where the next subpath will start * if there is no active subpath. @@ -613,7 +613,7 @@ class Path : public external::AtomicRefCounted { return CopyToBuilder(GetFillRule()); } inline already_AddRefed TransformedCopyToBuilder( - const Matrix &aTransform) const { + const Matrix& aTransform) const { return TransformedCopyToBuilder(aTransform, GetFillRule()); } /** This returns a PathBuilder object that contains a copy of the contents of @@ -622,41 +622,41 @@ class Path : public external::AtomicRefCounted { virtual already_AddRefed CopyToBuilder( FillRule aFillRule) const = 0; virtual already_AddRefed TransformedCopyToBuilder( - const Matrix &aTransform, FillRule aFillRule) const = 0; + const Matrix& aTransform, FillRule aFillRule) const = 0; /** This function checks if a point lies within a path. It allows passing a * transform that will transform the path to the coordinate space in which * aPoint is given. */ - virtual bool ContainsPoint(const Point &aPoint, - const Matrix &aTransform) const = 0; + virtual bool ContainsPoint(const Point& aPoint, + const Matrix& aTransform) const = 0; /** This function checks if a point lies within the stroke of a path using the * specified strokeoptions. It allows passing a transform that will transform * the path to the coordinate space in which aPoint is given. */ - virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions, - const Point &aPoint, - const Matrix &aTransform) const = 0; + virtual bool StrokeContainsPoint(const StrokeOptions& aStrokeOptions, + const Point& aPoint, + const Matrix& aTransform) const = 0; /** This functions gets the bounds of this path. These bounds are not * guaranteed to be tight. A transform may be specified that gives the bounds * after application of the transform. */ - virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const = 0; + virtual Rect GetBounds(const Matrix& aTransform = Matrix()) const = 0; /** This function gets the bounds of the stroke of this path using the * specified strokeoptions. These bounds are not guaranteed to be tight. * A transform may be specified that gives the bounds after application of * the transform. */ - virtual Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions, - const Matrix &aTransform = Matrix()) const = 0; + virtual Rect GetStrokedBounds(const StrokeOptions& aStrokeOptions, + const Matrix& aTransform = Matrix()) const = 0; /** Take the contents of this path and stream it to another sink, this works * regardless of the backend that might be used for the destination sink. */ - virtual void StreamToSink(PathSink *aSink) const = 0; + virtual void StreamToSink(PathSink* aSink) const = 0; /** This gets the fillrule this path's builder was created with. This is not * mutable. @@ -665,7 +665,7 @@ class Path : public external::AtomicRefCounted { virtual Float ComputeLength(); - virtual Point ComputePointAtLength(Float aLength, Point *aTangent = nullptr); + virtual Point ComputePointAtLength(Float aLength, Point* aTangent = nullptr); protected: Path(); @@ -693,7 +693,7 @@ struct Glyph { Point mPosition; }; -static inline bool operator==(const Glyph &aOne, const Glyph &aOther) { +static inline bool operator==(const Glyph& aOne, const Glyph& aOther) { return aOne.mIndex == aOther.mIndex && aOne.mPosition == aOther.mPosition; } @@ -702,8 +702,8 @@ static inline bool operator==(const Glyph &aOne, const Glyph &aOther) { * as roc suggested. But for now it's a simple container for a glyph vector. */ struct GlyphBuffer { - const Glyph - *mGlyphs; //!< A pointer to a buffer of glyphs. Managed by the caller. + const Glyph* + mGlyphs; //!< A pointer to a buffer of glyphs. Managed by the caller. uint32_t mNumGlyphs; //!< Number of glyphs mGlyphs points to. }; @@ -737,38 +737,38 @@ class UnscaledFont : public SupportsThreadSafeWeakPtr { static uint32_t DeletionCounter() { return sDeletionCounter; } - typedef void (*FontFileDataOutput)(const uint8_t *aData, uint32_t aLength, - uint32_t aIndex, void *aBaton); - typedef void (*WRFontDescriptorOutput)(const uint8_t *aData, uint32_t aLength, - uint32_t aIndex, void *aBaton); - typedef void (*FontInstanceDataOutput)(const uint8_t *aData, uint32_t aLength, - void *aBaton); - typedef void (*FontDescriptorOutput)(const uint8_t *aData, uint32_t aLength, - uint32_t aIndex, void *aBaton); + typedef void (*FontFileDataOutput)(const uint8_t* aData, uint32_t aLength, + uint32_t aIndex, void* aBaton); + typedef void (*WRFontDescriptorOutput)(const uint8_t* aData, uint32_t aLength, + uint32_t aIndex, void* aBaton); + typedef void (*FontInstanceDataOutput)(const uint8_t* aData, uint32_t aLength, + void* aBaton); + typedef void (*FontDescriptorOutput)(const uint8_t* aData, uint32_t aLength, + uint32_t aIndex, void* aBaton); - virtual bool GetFontFileData(FontFileDataOutput, void *) { return false; } + virtual bool GetFontFileData(FontFileDataOutput, void*) { return false; } - virtual bool GetWRFontDescriptor(WRFontDescriptorOutput, void *) { + virtual bool GetWRFontDescriptor(WRFontDescriptorOutput, void*) { return false; } - virtual bool GetFontInstanceData(FontInstanceDataOutput, void *) { + virtual bool GetFontInstanceData(FontInstanceDataOutput, void*) { return false; } - virtual bool GetFontDescriptor(FontDescriptorOutput, void *) { return false; } + virtual bool GetFontDescriptor(FontDescriptorOutput, void*) { return false; } virtual already_AddRefed CreateScaledFont( - Float aGlyphSize, const uint8_t *aInstanceData, - uint32_t aInstanceDataLength, const FontVariation *aVariations, + Float aGlyphSize, const uint8_t* aInstanceData, + uint32_t aInstanceDataLength, const FontVariation* aVariations, uint32_t aNumVariations) { return nullptr; } virtual already_AddRefed CreateScaledFontFromWRFont( - Float aGlyphSize, const wr::FontInstanceOptions *aOptions, - const wr::FontInstancePlatformOptions *aPlatformOptions, - const FontVariation *aVariations, uint32_t aNumVariations) { + Float aGlyphSize, const wr::FontInstanceOptions* aOptions, + const wr::FontInstancePlatformOptions* aPlatformOptions, + const FontVariation* aVariations, uint32_t aNumVariations) { return CreateScaledFont(aGlyphSize, nullptr, 0, aVariations, aNumVariations); } @@ -803,35 +803,35 @@ class ScaledFont : public SupportsThreadSafeWeakPtr { * passed in. */ virtual already_AddRefed GetPathForGlyphs( - const GlyphBuffer &aBuffer, const DrawTarget *aTarget) = 0; + const GlyphBuffer& aBuffer, const DrawTarget* aTarget) = 0; /** This copies the path describing the glyphs into a PathBuilder. We use this * API rather than a generic API to append paths because it allows easier * implementation in some backends, and more efficient implementation in * others. */ - virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, - PathBuilder *aBuilder, - const Matrix *aTransformHint = nullptr) = 0; + virtual void CopyGlyphsToBuilder(const GlyphBuffer& aBuffer, + PathBuilder* aBuilder, + const Matrix* aTransformHint = nullptr) = 0; /* This gets the metrics of a set of glyphs for the current font face. */ - virtual void GetGlyphDesignMetrics(const uint16_t *aGlyphIndices, + virtual void GetGlyphDesignMetrics(const uint16_t* aGlyphIndices, uint32_t aNumGlyphs, - GlyphMetrics *aGlyphMetrics) = 0; + GlyphMetrics* aGlyphMetrics) = 0; - typedef void (*FontInstanceDataOutput)(const uint8_t *aData, uint32_t aLength, - const FontVariation *aVariations, - uint32_t aNumVariations, void *aBaton); + typedef void (*FontInstanceDataOutput)(const uint8_t* aData, uint32_t aLength, + const FontVariation* aVariations, + uint32_t aNumVariations, void* aBaton); - virtual bool GetFontInstanceData(FontInstanceDataOutput, void *) { + virtual bool GetFontInstanceData(FontInstanceDataOutput, void*) { return false; } virtual bool GetWRFontInstanceOptions( - Maybe *aOutOptions, - Maybe *aOutPlatformOptions, - std::vector *aOutVariations) { + Maybe* aOutOptions, + Maybe* aOutPlatformOptions, + std::vector* aOutVariations) { return false; } @@ -839,17 +839,17 @@ class ScaledFont : public SupportsThreadSafeWeakPtr { virtual bool HasVariationSettings() { return false; } - void AddUserData(UserDataKey *key, void *userData, void (*destroy)(void *)) { + void AddUserData(UserDataKey* key, void* userData, void (*destroy)(void*)) { mUserData.Add(key, userData, destroy); } - void *GetUserData(UserDataKey *key) { return mUserData.Get(key); } + void* GetUserData(UserDataKey* key) { return mUserData.Get(key); } - void RemoveUserData(UserDataKey *key) { mUserData.RemoveAndDestroy(key); } + void RemoveUserData(UserDataKey* key) { mUserData.RemoveAndDestroy(key); } - const RefPtr &GetUnscaledFont() const { return mUnscaledFont; } + const RefPtr& GetUnscaledFont() const { return mUnscaledFont; } - virtual cairo_scaled_font_t *GetCairoScaledFont() { return nullptr; } - virtual void SetCairoScaledFont(cairo_scaled_font_t *font) {} + virtual cairo_scaled_font_t* GetCairoScaledFont() { return nullptr; } + virtual void SetCairoScaledFont(cairo_scaled_font_t* font) {} Float GetSyntheticObliqueAngle() const { return mSyntheticObliqueAngle; } void SetSyntheticObliqueAngle(Float aAngle) { @@ -857,7 +857,7 @@ class ScaledFont : public SupportsThreadSafeWeakPtr { } protected: - explicit ScaledFont(const RefPtr &aUnscaledFont) + explicit ScaledFont(const RefPtr& aUnscaledFont) : mUnscaledFont(aUnscaledFont), mSyntheticObliqueAngle(0.0f) {} UserData mUserData; @@ -887,7 +887,7 @@ class NativeFontResource * @return an already_addrefed UnscaledFont, containing nullptr if failed. */ virtual already_AddRefed CreateUnscaledFont( - uint32_t aIndex, const uint8_t *aInstanceData, + uint32_t aIndex, const uint8_t* aInstanceData, uint32_t aInstanceDataLength) = 0; virtual ~NativeFontResource() = default; @@ -936,11 +936,11 @@ class DrawTarget : public external::AtomicRefCounted { * While the bits is locked any modifications to this DrawTarget is forbidden. * Release takes the original data pointer for safety. */ - virtual bool LockBits(uint8_t **aData, IntSize *aSize, int32_t *aStride, - SurfaceFormat *aFormat, IntPoint *aOrigin = nullptr) { + virtual bool LockBits(uint8_t** aData, IntSize* aSize, int32_t* aStride, + SurfaceFormat* aFormat, IntPoint* aOrigin = nullptr) { return false; } - virtual void ReleaseBits(uint8_t *aData) {} + virtual void ReleaseBits(uint8_t* aData) {} /** Ensure that the DrawTarget backend has flushed all drawing operations to * this draw target. This must be called before using the backing surface of @@ -954,8 +954,8 @@ class DrawTarget : public external::AtomicRefCounted { * @param aSource Capture DrawTarget to draw * @param aTransform Transform to apply when replaying commands */ - virtual void DrawCapturedDT(DrawTargetCapture *aCaptureDT, - const Matrix &aTransform); + virtual void DrawCapturedDT(DrawTargetCapture* aCaptureDT, + const Matrix& aTransform); /** * Draw a surface to the draw target. Possibly doing partial drawing or @@ -971,14 +971,14 @@ class DrawTarget : public external::AtomicRefCounted { * @param aSurfOptions DrawSurface options that are applied */ virtual void DrawSurface( - SourceSurface *aSurface, const Rect &aDest, const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(), - const DrawOptions &aOptions = DrawOptions()) = 0; + SourceSurface* aSurface, const Rect& aDest, const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions = DrawSurfaceOptions(), + const DrawOptions& aOptions = DrawOptions()) = 0; virtual void DrawDependentSurface( - uint64_t aId, const Rect &aDest, - const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(), - const DrawOptions &aOptions = DrawOptions()) { + uint64_t aId, const Rect& aDest, + const DrawSurfaceOptions& aSurfOptions = DrawSurfaceOptions(), + const DrawOptions& aOptions = DrawOptions()) { MOZ_CRASH("GFX: DrawDependentSurface"); } @@ -990,9 +990,9 @@ class DrawTarget : public external::AtomicRefCounted { * @param aDestPoint Destination point on the DrawTarget to draw the * SourceRectangle of the filter output to */ - virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) = 0; + virtual void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) = 0; /** * Blend a surface to the draw target with a shadow. The shadow is drawn as a @@ -1008,9 +1008,9 @@ class DrawTarget : public external::AtomicRefCounted { * @param aSigma Sigma used for the guassian filter kernel * @param aOperator Composition operator used */ - virtual void DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + virtual void DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) = 0; /** @@ -1019,7 +1019,7 @@ class DrawTarget : public external::AtomicRefCounted { * * @param aRect Rectangle to clear */ - virtual void ClearRect(const Rect &aRect) = 0; + virtual void ClearRect(const Rect& aRect) = 0; /** * This is essentially a 'memcpy' between two surfaces. It moves a pixel @@ -1030,8 +1030,8 @@ class DrawTarget : public external::AtomicRefCounted { * @param aSourceRect Source rectangle to be copied * @param aDest Destination point to copy the surface to */ - virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) = 0; + virtual void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) = 0; /** @see CopySurface * Same as CopySurface, except uses itself as the source. @@ -1039,8 +1039,8 @@ class DrawTarget : public external::AtomicRefCounted { * Some backends may be able to optimize this better * than just taking a snapshot and using CopySurface. */ - virtual void CopyRect(const IntRect &aSourceRect, - const IntPoint &aDestination) { + virtual void CopyRect(const IntRect& aSourceRect, + const IntPoint& aDestination) { RefPtr source = Snapshot(); CopySurface(source, aSourceRect, aDestination); } @@ -1052,8 +1052,8 @@ class DrawTarget : public external::AtomicRefCounted { * @param aPattern Pattern that forms the source of this filling operation * @param aOptions Options that are applied to this operation */ - virtual void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) = 0; + virtual void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) = 0; /** * Fill a rounded rectangle on the DrawTarget with a certain source pattern. @@ -1063,9 +1063,9 @@ class DrawTarget : public external::AtomicRefCounted { * @param aPattern Pattern that forms the source of this filling operation * @param aOptions Options that are applied to this operation */ - virtual void FillRoundedRect(const RoundedRect &aRect, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()); + virtual void FillRoundedRect(const RoundedRect& aRect, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()); /** * Stroke a rectangle on the DrawTarget with a certain source pattern. @@ -1074,9 +1074,9 @@ class DrawTarget : public external::AtomicRefCounted { * @param aPattern Pattern that forms the source of this stroking operation * @param aOptions Options that are applied to this operation */ - virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) = 0; + virtual void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) = 0; /** * Stroke a line on the DrawTarget with a certain source pattern. @@ -1086,10 +1086,10 @@ class DrawTarget : public external::AtomicRefCounted { * @param aPattern Pattern that forms the source of this stroking operation * @param aOptions Options that are applied to this operation */ - virtual void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) = 0; + virtual void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) = 0; /** * Stroke a path on the draw target with a certain source pattern. @@ -1099,9 +1099,9 @@ class DrawTarget : public external::AtomicRefCounted { * @param aStrokeOptions Stroke options used for this operation * @param aOptions Draw options used for this operation */ - virtual void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) = 0; + virtual void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) = 0; /** * Fill a path on the draw target with a certain source pattern. @@ -1110,23 +1110,23 @@ class DrawTarget : public external::AtomicRefCounted { * @param aPattern Pattern that should be used for the fill * @param aOptions Draw options used for this operation */ - virtual void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) = 0; + virtual void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) = 0; /** * Fill a series of glyphs on the draw target with a certain source pattern. */ - virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) = 0; + virtual void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) = 0; /** * Stroke a series of glyphs on the draw target with a certain source pattern. */ virtual void StrokeGlyphs( - ScaledFont *aFont, const GlyphBuffer &aBuffer, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()); + ScaledFont* aFont, const GlyphBuffer& aBuffer, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()); /** * This takes a source pattern and a mask, and composites the source pattern @@ -1137,8 +1137,8 @@ class DrawTarget : public external::AtomicRefCounted { * @param aMask Mask pattern * @param aOptions Drawing options */ - virtual void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) = 0; + virtual void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) = 0; /** * This takes a source pattern and a mask, and composites the source pattern @@ -1150,9 +1150,9 @@ class DrawTarget : public external::AtomicRefCounted { * @param aOffset a transformed offset that the surface is masked at * @param aOptions Drawing options */ - virtual void MaskSurface(const Pattern &aSource, SourceSurface *aMask, + virtual void MaskSurface(const Pattern& aSource, SourceSurface* aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) = 0; + const DrawOptions& aOptions = DrawOptions()) = 0; /** * Draw aSurface using the 3D transform aMatrix. The DrawTarget's transform @@ -1161,15 +1161,15 @@ class DrawTarget : public external::AtomicRefCounted { * If the transform fails (i.e. because aMatrix is singular), false is * returned and nothing is drawn. */ - virtual bool Draw3DTransformedSurface(SourceSurface *aSurface, - const Matrix4x4 &aMatrix); + virtual bool Draw3DTransformedSurface(SourceSurface* aSurface, + const Matrix4x4& aMatrix); /** * Push a clip to the DrawTarget. * * @param aPath The path to clip to */ - virtual void PushClip(const Path *aPath) = 0; + virtual void PushClip(const Path* aPath) = 0; /** * Push an axis-aligned rectangular clip to the DrawTarget. This rectangle @@ -1177,7 +1177,7 @@ class DrawTarget : public external::AtomicRefCounted { * * @param aRect The rect to clip to */ - virtual void PushClipRect(const Rect &aRect) = 0; + virtual void PushClipRect(const Rect& aRect) = 0; /** * Push a clip region specifed by the union of axis-aligned rectangular @@ -1187,7 +1187,7 @@ class DrawTarget : public external::AtomicRefCounted { * @param aRects The rects to clip to * @param aCount The number of rectangles */ - virtual void PushDeviceSpaceClipRects(const IntRect *aRects, uint32_t aCount); + virtual void PushDeviceSpaceClipRects(const IntRect* aRects, uint32_t aCount); /** Pop a clip from the DrawTarget. A pop without a corresponding push will * be ignored. @@ -1210,9 +1210,9 @@ class DrawTarget : public external::AtomicRefCounted { * @param aCopyBackground Whether to copy the background into the layer, this * is only supported when aOpaque is true. */ - virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) { MOZ_CRASH("GFX: PushLayer"); } @@ -1234,9 +1234,9 @@ class DrawTarget : public external::AtomicRefCounted { * is only supported when aOpaque is true. */ virtual void PushLayerWithBlend(bool aOpaque, Float aOpacity, - SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false, CompositionOp = CompositionOp::OP_OVER) { MOZ_CRASH("GFX: PushLayerWithBlend"); @@ -1253,13 +1253,13 @@ class DrawTarget : public external::AtomicRefCounted { * Perform an in-place blur operation. This is only supported on data draw * targets. */ - virtual void Blur(const AlphaBoxBlur &aBlur); + virtual void Blur(const AlphaBoxBlur& aBlur); /** * Performs an in-place edge padding operation. * aRegion is specified in device space. */ - virtual void PadEdges(const IntRegion &aRegion); + virtual void PadEdges(const IntRegion& aRegion); /** * Performs an in-place buffer unrotation operation. @@ -1274,7 +1274,7 @@ class DrawTarget : public external::AtomicRefCounted { * time. */ virtual already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const = 0; /** @@ -1283,9 +1283,9 @@ class DrawTarget : public external::AtomicRefCounted { * aSourceSurface or some other existing surface. */ virtual already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const = 0; + SourceSurface* aSurface) const = 0; virtual already_AddRefed OptimizeSourceSurfaceForUnknownAlpha( - SourceSurface *aSurface) const { + SourceSurface* aSurface) const { return OptimizeSourceSurface(aSurface); } @@ -1296,14 +1296,14 @@ class DrawTarget : public external::AtomicRefCounted { * NativeSurface. */ virtual already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const = 0; + const NativeSurface& aSurface) const = 0; /** * Create a DrawTarget whose snapshot is optimized for use with this * DrawTarget. */ virtual already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const = 0; + const IntSize& aSize, SurfaceFormat aFormat) const = 0; /** * Create a DrawTarget whose snapshot is optimized for use with this @@ -1314,8 +1314,8 @@ class DrawTarget : public external::AtomicRefCounted { * @param aDestPoint is the dest point that will be passed to DrawFilter. */ virtual already_AddRefed CreateSimilarDrawTargetForFilter( - const IntSize &aSize, SurfaceFormat aFormat, FilterNode *aFilter, - FilterNode *aSource, const Rect &aSourceRect, const Point &aDestPoint) { + const IntSize& aSize, SurfaceFormat aFormat, FilterNode* aFilter, + FilterNode* aSource, const Rect& aSourceRect, const Point& aDestPoint) { return CreateSimilarDrawTarget(aSize, aFormat); } @@ -1325,7 +1325,7 @@ class DrawTarget : public external::AtomicRefCounted { * return null (i.e. this function returning false has meaning, but returning * true doesn't guarantee anything). */ - virtual bool CanCreateSimilarDrawTarget(const IntSize &aSize, + virtual bool CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const { return true; } @@ -1339,7 +1339,7 @@ class DrawTarget : public external::AtomicRefCounted { * its size. */ virtual already_AddRefed CreateShadowDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat, float aSigma) const { + const IntSize& aSize, SurfaceFormat aFormat, float aSigma) const { return CreateSimilarDrawTarget(aSize, aFormat); } @@ -1348,7 +1348,7 @@ class DrawTarget : public external::AtomicRefCounted { * on this DrawTarget's rect transformed to the new target's space. */ virtual RefPtr CreateClippedDrawTarget( - const IntSize &aMaxSize, const Matrix &aTransform, + const IntSize& aMaxSize, const Matrix& aTransform, SurfaceFormat aFormat) const { return CreateSimilarDrawTarget(aMaxSize, aFormat); } @@ -1360,7 +1360,7 @@ class DrawTarget : public external::AtomicRefCounted { * cache pixels, and would have no effect if it were caching a recording. */ virtual RefPtr CreateSimilarRasterTarget( - const IntSize &aSize, SurfaceFormat aFormat) const { + const IntSize& aSize, SurfaceFormat aFormat) const { return CreateSimilarDrawTarget(aSize, aFormat); } @@ -1385,7 +1385,7 @@ class DrawTarget : public external::AtomicRefCounted { * the gradient area. */ virtual already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const = 0; /** @@ -1409,10 +1409,10 @@ class DrawTarget : public external::AtomicRefCounted { * aNumGlyphs The amount of elements in aGlyphIndices * aGlyphMetrics The glyph metrics */ - virtual void GetGlyphRasterizationMetrics(ScaledFont *aScaledFont, - const uint16_t *aGlyphIndices, + virtual void GetGlyphRasterizationMetrics(ScaledFont* aScaledFont, + const uint16_t* aGlyphIndices, uint32_t aNumGlyphs, - GlyphMetrics *aGlyphMetrics) { + GlyphMetrics* aGlyphMetrics) { aScaledFont->GetGlyphDesignMetrics(aGlyphIndices, aNumGlyphs, aGlyphMetrics); } @@ -1434,12 +1434,12 @@ class DrawTarget : public external::AtomicRefCounted { * FillRect, try to integrate the translation into FillRect's aRect * argument's x/y offset. */ - virtual void SetTransform(const Matrix &aTransform) { + virtual void SetTransform(const Matrix& aTransform) { mTransform = aTransform; mTransformDirty = true; } - inline void ConcatTransform(const Matrix &aTransform) { + inline void ConcatTransform(const Matrix& aTransform) { SetTransform(aTransform * Matrix(GetTransform())); } @@ -1448,26 +1448,26 @@ class DrawTarget : public external::AtomicRefCounted { /** Tries to get a native surface for a DrawTarget, this may fail if the * draw target cannot convert to this surface type. */ - virtual void *GetNativeSurface(NativeSurfaceType aType) { return nullptr; } + virtual void* GetNativeSurface(NativeSurfaceType aType) { return nullptr; } virtual bool IsDualDrawTarget() const { return false; } virtual bool IsTiledDrawTarget() const { return false; } virtual bool SupportsRegionClipping() const { return true; } - void AddUserData(UserDataKey *key, void *userData, void (*destroy)(void *)) { + void AddUserData(UserDataKey* key, void* userData, void (*destroy)(void*)) { mUserData.Add(key, userData, destroy); } - void *GetUserData(UserDataKey *key) const { return mUserData.Get(key); } - void *RemoveUserData(UserDataKey *key) { return mUserData.Remove(key); } + void* GetUserData(UserDataKey* key) const { return mUserData.Get(key); } + void* RemoveUserData(UserDataKey* key) { return mUserData.Remove(key); } /** Within this rectangle all pixels will be opaque by the time the result of * this DrawTarget is first used for drawing. Either by the underlying surface * being used as an input to external drawing, or Snapshot() being called. * This rectangle is specified in device space. */ - void SetOpaqueRect(const IntRect &aRect) { mOpaqueRect = aRect; } + void SetOpaqueRect(const IntRect& aRect) { mOpaqueRect = aRect; } - const IntRect &GetOpaqueRect() const { return mOpaqueRect; } + const IntRect& GetOpaqueRect() const { return mOpaqueRect; } virtual bool IsCurrentGroupOpaque() { return GetFormat() == SurfaceFormat::B8G8R8X8; @@ -1489,7 +1489,7 @@ class DrawTarget : public external::AtomicRefCounted { * Note: this is a bit of a hack. It might be better to just recreate * the DrawTargetRecording. */ - virtual void FlushItem(const IntRect &aBounds) {} + virtual void FlushItem(const IntRect& aBounds) {} /** * Ensures that no snapshot is still pointing to this DrawTarget's surface @@ -1535,12 +1535,12 @@ struct Tile { }; struct TileSet { - Tile *mTiles; + Tile* mTiles; size_t mTileCount; }; struct Config { - LogForwarder *mLogForwarder; + LogForwarder* mLogForwarder; int32_t mMaxTextureSize; int32_t mMaxAllocSize; @@ -1554,7 +1554,7 @@ class GFX2D_API Factory { using char_type = filesystem::Path::value_type; public: - static void Init(const Config &aConfig); + static void Init(const Config& aConfig); static void ShutDown(); static bool HasSSE2(); @@ -1576,7 +1576,7 @@ class GFX2D_API Factory { * conservative; some code has in the past and may in the future use signed * integers to store buffer lengths etc. */ - static bool CheckSurfaceSize(const IntSize &sz, int32_t limit = 0, + static bool CheckSurfaceSize(const IntSize& sz, int32_t limit = 0, int32_t allocLimit = 0); /** @@ -1587,19 +1587,19 @@ class GFX2D_API Factory { /** Make sure the given dimension satisfies the CheckSurfaceSize and is * within 8k limit. The 8k value is chosen a bit randomly. */ - static bool ReasonableSurfaceSize(const IntSize &aSize); + static bool ReasonableSurfaceSize(const IntSize& aSize); - static bool AllowedSurfaceSize(const IntSize &aSize); + static bool AllowedSurfaceSize(const IntSize& aSize); static already_AddRefed CreateDrawTargetForCairoSurface( - cairo_surface_t *aSurface, const IntSize &aSize, - SurfaceFormat *aFormat = nullptr); + cairo_surface_t* aSurface, const IntSize& aSize, + SurfaceFormat* aFormat = nullptr); static already_AddRefed CreateSourceSurfaceForCairoSurface( - cairo_surface_t *aSurface, const IntSize &aSize, SurfaceFormat aFormat); + cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat aFormat); static already_AddRefed CreateDrawTarget(BackendType aBackend, - const IntSize &aSize, + const IntSize& aSize, SurfaceFormat aFormat); /** @@ -1612,7 +1612,7 @@ class GFX2D_API Factory { * @param aFlushBytes The byte limit at which to flush the CaptureCommandList */ static already_AddRefed CreateCaptureDrawTargetForTarget( - gfx::DrawTarget *aTarget, size_t aFlushBytes = 0); + gfx::DrawTarget* aTarget, size_t aFlushBytes = 0); /** * Create a DrawTarget that captures the drawing commands and can be replayed @@ -1621,26 +1621,26 @@ class GFX2D_API Factory { * @param aSize Size of the area this DT will capture. */ static already_AddRefed CreateCaptureDrawTarget( - BackendType aBackend, const IntSize &aSize, SurfaceFormat aFormat); + BackendType aBackend, const IntSize& aSize, SurfaceFormat aFormat); static already_AddRefed CreateCaptureDrawTargetForData( - BackendType aBackend, const IntSize &aSize, SurfaceFormat aFormat, + BackendType aBackend, const IntSize& aSize, SurfaceFormat aFormat, int32_t aStride, size_t aSurfaceAllocationSize); static already_AddRefed CreateWrapAndRecordDrawTarget( - DrawEventRecorder *aRecorder, DrawTarget *aDT); + DrawEventRecorder* aRecorder, DrawTarget* aDT); static already_AddRefed CreateRecordingDrawTarget( - DrawEventRecorder *aRecorder, DrawTarget *aDT, IntSize aSize); + DrawEventRecorder* aRecorder, DrawTarget* aDT, IntSize aSize); static already_AddRefed CreateDrawTargetForData( - BackendType aBackend, unsigned char *aData, const IntSize &aSize, + BackendType aBackend, unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat, bool aUninitialized = false); #ifdef XP_DARWIN static already_AddRefed CreateScaledFontForMacFont( - CGFontRef aCGFont, const RefPtr &aUnscaledFont, Float aSize, - const Color &aFontSmoothingBackgroundColor, bool aUseFontSmoothing = true, + CGFontRef aCGFont, const RefPtr& aUnscaledFont, Float aSize, + const Color& aFontSmoothingBackgroundColor, bool aUseFontSmoothing = true, bool aApplySyntheticBold = false); #endif @@ -1657,15 +1657,15 @@ class GFX2D_API Factory { * @return a NativeFontResource of nullptr if failed. */ static already_AddRefed CreateNativeFontResource( - uint8_t *aData, uint32_t aSize, BackendType aBackendType, - FontType aFontType, void *aFontContext = nullptr); + uint8_t* aData, uint32_t aSize, BackendType aBackendType, + FontType aFontType, void* aFontContext = nullptr); /** * This creates an unscaled font of the given type based on font descriptor * data retrieved from ScaledFont::GetFontDescriptor. */ static already_AddRefed CreateUnscaledFontFromFontDescriptor( - FontType aType, const uint8_t *aData, uint32_t aDataLength, + FontType aType, const uint8_t* aData, uint32_t aDataLength, uint32_t aIndex); /** @@ -1676,8 +1676,8 @@ class GFX2D_API Factory { * must correspond to the same font. */ static already_AddRefed CreateScaledFontForNativeFont( - const NativeFont &aNativeFont, const RefPtr &aUnscaledFont, - Float aSize, cairo_scaled_font_t *aScaledFont = nullptr); + const NativeFont& aNativeFont, const RefPtr& aUnscaledFont, + Float aSize, cairo_scaled_font_t* aScaledFont = nullptr); /** * This creates a simple data source surface for a certain size. It allocates @@ -1686,7 +1686,7 @@ class GFX2D_API Factory { * is returned. The surface is not zeroed unless requested. */ static already_AddRefed CreateDataSourceSurface( - const IntSize &aSize, SurfaceFormat aFormat, bool aZero = false); + const IntSize& aSize, SurfaceFormat aFormat, bool aZero = false); /** * This creates a simple data source surface for a certain size with a @@ -1696,10 +1696,10 @@ class GFX2D_API Factory { * where nullptr is returned. The surface is not zeroed unless requested. */ static already_AddRefed CreateDataSourceSurfaceWithStride( - const IntSize &aSize, SurfaceFormat aFormat, int32_t aStride, + const IntSize& aSize, SurfaceFormat aFormat, int32_t aStride, bool aZero = false); - typedef void (*SourceSurfaceDeallocator)(void *aClosure); + typedef void (*SourceSurfaceDeallocator)(void* aClosure); /** * This creates a simple data source surface for some existing data. It will @@ -1715,35 +1715,35 @@ class GFX2D_API Factory { * DataSourceSurface. */ static already_AddRefed CreateWrappingDataSourceSurface( - uint8_t *aData, int32_t aStride, const IntSize &aSize, + uint8_t* aData, int32_t aStride, const IntSize& aSize, SurfaceFormat aFormat, SourceSurfaceDeallocator aDeallocator = nullptr, - void *aClosure = nullptr); + void* aClosure = nullptr); - static void CopyDataSourceSurface(DataSourceSurface *aSource, - DataSourceSurface *aDest); + static void CopyDataSourceSurface(DataSourceSurface* aSource, + DataSourceSurface* aDest); static already_AddRefed CreateEventRecorderForFile( - const char_type *aFilename); + const char_type* aFilename); - static void SetGlobalEventRecorder(DrawEventRecorder *aRecorder); + static void SetGlobalEventRecorder(DrawEventRecorder* aRecorder); static uint32_t GetMaxSurfaceSize(BackendType aType); - static LogForwarder *GetLogForwarder() { + static LogForwarder* GetLogForwarder() { return sConfig ? sConfig->mLogForwarder : nullptr; } private: - static Config *sConfig; + static Config* sConfig; public: static void PurgeAllCaches(); - static already_AddRefed CreateDualDrawTarget(DrawTarget *targetA, - DrawTarget *targetB); + static already_AddRefed CreateDualDrawTarget(DrawTarget* targetA, + DrawTarget* targetB); static already_AddRefed CreateDualSourceSurface( - SourceSurface *sourceA, SourceSurface *sourceB); + SourceSurface* sourceA, SourceSurface* sourceB); /* * This creates a new tiled DrawTarget. When a tiled drawtarget is used the @@ -1752,15 +1752,15 @@ class GFX2D_API Factory { * and format. */ static already_AddRefed CreateTiledDrawTarget( - const TileSet &aTileSet); + const TileSet& aTileSet); static already_AddRefed CreateOffsetDrawTarget( - DrawTarget *aDrawTarget, IntPoint aTileOrigin); + DrawTarget* aDrawTarget, IntPoint aTileOrigin); static bool DoesBackendSupportDataDrawtarget(BackendType aType); #ifdef USE_SKIA static already_AddRefed CreateDrawTargetWithSkCanvas( - SkCanvas *aCanvas); + SkCanvas* aCanvas); #endif #ifdef MOZ_ENABLE_FREETYPE @@ -1772,9 +1772,9 @@ class GFX2D_API Factory { static void LockFTLibrary(FT_Library aFTLibrary); static void UnlockFTLibrary(FT_Library aFTLibrary); - static FT_Face NewFTFace(FT_Library aFTLibrary, const char *aFileName, + static FT_Face NewFTFace(FT_Library aFTLibrary, const char* aFileName, int aFaceIndex); - static FT_Face NewFTFaceFromData(FT_Library aFTLibrary, const uint8_t *aData, + static FT_Face NewFTFaceFromData(FT_Library aFTLibrary, const uint8_t* aData, size_t aDataSize, int aFaceIndex); static void ReleaseFTFace(FT_Face aFace); static FT_Error LoadFTGlyph(FT_Face aFace, uint32_t aGlyphIndex, @@ -1789,16 +1789,16 @@ class GFX2D_API Factory { #ifdef WIN32 static already_AddRefed CreateDrawTargetForD3D11Texture( - ID3D11Texture2D *aTexture, SurfaceFormat aFormat); + ID3D11Texture2D* aTexture, SurfaceFormat aFormat); /* * Attempts to create and install a D2D1 device from the supplied Direct3D11 * device. Returns true on success, or false on failure and leaves the * D2D1/Direct3D11 devices unset. */ - static bool SetDirect3D11Device(ID3D11Device *aDevice); + static bool SetDirect3D11Device(ID3D11Device* aDevice); static RefPtr GetDirect3D11Device(); - static RefPtr GetD2D1Device(uint32_t *aOutSeqNo = nullptr); + static RefPtr GetD2D1Device(uint32_t* aOutSeqNo = nullptr); static bool HasD2D1Device(); static RefPtr GetDWriteFactory(); static RefPtr EnsureDWriteFactory(); @@ -1812,10 +1812,10 @@ class GFX2D_API Factory { static void D2DCleanup(); static already_AddRefed CreateScaledFontForDWriteFont( - IDWriteFontFace *aFontFace, const gfxFontStyle *aStyle, - const RefPtr &aUnscaledFont, Float aSize, + IDWriteFontFace* aFontFace, const gfxFontStyle* aStyle, + const RefPtr& aUnscaledFont, Float aSize, bool aUseEmbeddedBitmap, bool aForceGDIMode, - IDWriteRenderingParams *aParams, Float aGamma, Float aContrast); + IDWriteRenderingParams* aParams, Float aGamma, Float aContrast); static void SetSystemTextQuality(uint8_t aQuality); @@ -1840,7 +1840,7 @@ class GFX2D_API Factory { #endif private: - static DrawEventRecorder *mRecorder; + static DrawEventRecorder* mRecorder; }; } // namespace gfx diff --git a/gfx/2d/AutoHelpersWin.h b/gfx/2d/AutoHelpersWin.h index ed26baeec93d8..733f8a1e274cb 100644 --- a/gfx/2d/AutoHelpersWin.h +++ b/gfx/2d/AutoHelpersWin.h @@ -28,7 +28,7 @@ class AutoDC { // Select a font into the given DC, and auto-restore. class AutoSelectFont { public: - AutoSelectFont(HDC aDC, LOGFONTW *aLogFont) : mOwnsFont(false) { + AutoSelectFont(HDC aDC, LOGFONTW* aLogFont) : mOwnsFont(false) { mFont = ::CreateFontIndirectW(aLogFont); if (mFont) { mOwnsFont = true; diff --git a/gfx/2d/BlurLS3.cpp b/gfx/2d/BlurLS3.cpp index 18e28a99e4715..5fc5ff3b250f9 100644 --- a/gfx/2d/BlurLS3.cpp +++ b/gfx/2d/BlurLS3.cpp @@ -21,7 +21,7 @@ typedef struct { } __m128i; MOZ_ALWAYS_INLINE -__m128i loadUnaligned128(__m128i *p) { +__m128i loadUnaligned128(__m128i* p) { __m128i v; asm volatile( @@ -80,9 +80,9 @@ __m128i Divide(__m128i aValues, __m128i aDivisor) { } MOZ_ALWAYS_INLINE -__m128i BlurFourPixels(const __m128i &aTopLeft, const __m128i &aTopRight, - const __m128i &aBottomRight, const __m128i &aBottomLeft, - const __m128i &aDivisor) { +__m128i BlurFourPixels(const __m128i& aTopLeft, const __m128i& aTopRight, + const __m128i& aBottomRight, const __m128i& aBottomLeft, + const __m128i& aDivisor) { __m128i values; asm volatile( @@ -99,7 +99,7 @@ __m128i BlurFourPixels(const __m128i &aTopLeft, const __m128i &aTopRight, } MOZ_ALWAYS_INLINE -void LoadIntegralRowFromRow(uint32_t *aDest, const uint8_t *aSource, +void LoadIntegralRowFromRow(uint32_t* aDest, const uint8_t* aSource, int32_t aSourceWidth, int32_t aLeftInflation, int32_t aRightInflation) { int32_t currentRowSum = 0; @@ -155,9 +155,9 @@ __m128i AccumulatePixelSums(__m128i aPixels) { MOZ_ALWAYS_INLINE void GenerateIntegralImage_LS3(int32_t aLeftInflation, int32_t aRightInflation, int32_t aTopInflation, int32_t aBottomInflation, - uint32_t *aIntegralImage, - size_t aIntegralImageStride, uint8_t *aSource, - int32_t aSourceStride, const IntSize &aSize) { + uint32_t* aIntegralImage, + size_t aIntegralImageStride, uint8_t* aSource, + int32_t aSourceStride, const IntSize& aSize) { MOZ_ASSERT(!(aLeftInflation & 3)); uint32_t stride32bit = aIntegralImageStride / 4; @@ -169,9 +169,9 @@ void GenerateIntegralImage_LS3(int32_t aLeftInflation, int32_t aRightInflation, aRightInflation); for (int y = 1; y < aTopInflation + 1; y++) { - uint32_t *intRow = aIntegralImage + (y * stride32bit); - uint32_t *intPrevRow = aIntegralImage + (y - 1) * stride32bit; - uint32_t *intFirstRow = aIntegralImage; + uint32_t* intRow = aIntegralImage + (y * stride32bit); + uint32_t* intPrevRow = aIntegralImage + (y - 1) * stride32bit; + uint32_t* intFirstRow = aIntegralImage; for (int x = 0; x < integralImageSize.width; x += 4) { __m128i firstRow, previousRow; @@ -207,9 +207,9 @@ void GenerateIntegralImage_LS3(int32_t aLeftInflation, int32_t aRightInflation, [ zeroh ] "=f"(zero.h), [ zerol ] "=f"(zero.l)); for (int y = aTopInflation + 1; y < (aSize.height + aTopInflation); y++) { __m128i currentRowSum; - uint32_t *intRow = aIntegralImage + (y * stride32bit); - uint32_t *intPrevRow = aIntegralImage + (y - 1) * stride32bit; - uint8_t *sourceRow = aSource + aSourceStride * (y - aTopInflation); + uint32_t* intRow = aIntegralImage + (y * stride32bit); + uint32_t* intPrevRow = aIntegralImage + (y - 1) * stride32bit; + uint8_t* sourceRow = aSource + aSourceStride * (y - aTopInflation); uint32_t pixel = sourceRow[0]; asm volatile( @@ -248,7 +248,7 @@ void GenerateIntegralImage_LS3(int32_t aLeftInflation, int32_t aRightInflation, ); } for (int x = aLeftInflation; x < (aSize.width + aLeftInflation); x += 4) { - uint32_t pixels = *(uint32_t *)(sourceRow + (x - aLeftInflation)); + uint32_t pixels = *(uint32_t*)(sourceRow + (x - aLeftInflation)); __m128i sumPixels, t; // It's important to shuffle here. When we exit this loop currentRowSum @@ -293,7 +293,7 @@ void GenerateIntegralImage_LS3(int32_t aLeftInflation, int32_t aRightInflation, // Deal with unaligned portion. Get the correct pixel from currentRowSum, // see explanation above. uint32_t intCurrentRowSum = - ((uint32_t *)¤tRowSum)[(aSize.width % 4) - 1]; + ((uint32_t*)¤tRowSum)[(aSize.width % 4) - 1]; for (; x < integralImageSize.width; x++) { // We could be unaligned here! if (!(x & 3)) { @@ -364,11 +364,11 @@ void GenerateIntegralImage_LS3(int32_t aLeftInflation, int32_t aRightInflation, for (int y = aSize.height + aTopInflation; y < integralImageSize.height; y++) { - __m128i *intRow = (__m128i *)(aIntegralImage + (y * stride32bit)); - __m128i *intPrevRow = (__m128i *)(aIntegralImage + (y - 1) * stride32bit); - __m128i *intLastRow = - (__m128i *)(aIntegralImage + - (integralImageSize.height - 1) * stride32bit); + __m128i* intRow = (__m128i*)(aIntegralImage + (y * stride32bit)); + __m128i* intPrevRow = (__m128i*)(aIntegralImage + (y - 1) * stride32bit); + __m128i* intLastRow = + (__m128i*)(aIntegralImage + + (integralImageSize.height - 1) * stride32bit); for (int x = 0; x < integralImageSize.width; x += 4) { __m128i t1, t2; @@ -395,9 +395,9 @@ void GenerateIntegralImage_LS3(int32_t aLeftInflation, int32_t aRightInflation, /** * Attempt to do an in-place box blur using an integral image. */ -void AlphaBoxBlur::BoxBlur_LS3(uint8_t *aData, int32_t aLeftLobe, +void AlphaBoxBlur::BoxBlur_LS3(uint8_t* aData, int32_t aLeftLobe, int32_t aRightLobe, int32_t aTopLobe, - int32_t aBottomLobe, uint32_t *aIntegralImage, + int32_t aBottomLobe, uint32_t* aIntegralImage, size_t aIntegralImageStride) const { IntSize size = GetSize(); @@ -438,23 +438,23 @@ void AlphaBoxBlur::BoxBlur_LS3(uint8_t *aData, int32_t aLeftLobe, // This points to the start of the rectangle within the IntegralImage that // overlaps the surface being blurred. - uint32_t *innerIntegral = + uint32_t* innerIntegral = aIntegralImage + (aTopLobe * stride32bit) + leftInflation; IntRect skipRect = mSkipRect; int32_t stride = mStride; - uint8_t *data = aData; + uint8_t* data = aData; for (int32_t y = 0; y < size.height; y++) { bool inSkipRectY = y > skipRect.y && y < skipRect.YMost(); - uint32_t *topLeftBase = + uint32_t* topLeftBase = innerIntegral + ((y - aTopLobe) * ptrdiff_t(stride32bit) - aLeftLobe); - uint32_t *topRightBase = + uint32_t* topRightBase = innerIntegral + ((y - aTopLobe) * ptrdiff_t(stride32bit) + aRightLobe); - uint32_t *bottomRightBase = + uint32_t* bottomRightBase = innerIntegral + ((y + aBottomLobe) * ptrdiff_t(stride32bit) + aRightLobe); - uint32_t *bottomLeftBase = + uint32_t* bottomLeftBase = innerIntegral + ((y + aBottomLobe) * ptrdiff_t(stride32bit) - aLeftLobe); @@ -474,31 +474,31 @@ void AlphaBoxBlur::BoxBlur_LS3(uint8_t *aData, int32_t aLeftLobe, __m128i bottomRight; __m128i bottomLeft; - topLeft = loadUnaligned128((__m128i *)(topLeftBase + x)); - topRight = loadUnaligned128((__m128i *)(topRightBase + x)); - bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x)); - bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x)); + topLeft = loadUnaligned128((__m128i*)(topLeftBase + x)); + topRight = loadUnaligned128((__m128i*)(topRightBase + x)); + bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x)); + bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x)); __m128i result1 = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); - topLeft = loadUnaligned128((__m128i *)(topLeftBase + x + 4)); - topRight = loadUnaligned128((__m128i *)(topRightBase + x + 4)); - bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x + 4)); - bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x + 4)); + topLeft = loadUnaligned128((__m128i*)(topLeftBase + x + 4)); + topRight = loadUnaligned128((__m128i*)(topRightBase + x + 4)); + bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x + 4)); + bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x + 4)); __m128i result2 = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); - topLeft = loadUnaligned128((__m128i *)(topLeftBase + x + 8)); - topRight = loadUnaligned128((__m128i *)(topRightBase + x + 8)); - bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x + 8)); - bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x + 8)); + topLeft = loadUnaligned128((__m128i*)(topLeftBase + x + 8)); + topRight = loadUnaligned128((__m128i*)(topRightBase + x + 8)); + bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x + 8)); + bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x + 8)); __m128i result3 = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); - topLeft = loadUnaligned128((__m128i *)(topLeftBase + x + 12)); - topRight = loadUnaligned128((__m128i *)(topRightBase + x + 12)); - bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x + 12)); - bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x + 12)); + topLeft = loadUnaligned128((__m128i*)(topLeftBase + x + 12)); + topRight = loadUnaligned128((__m128i*)(topRightBase + x + 12)); + bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x + 12)); + bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x + 12)); __m128i result4 = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); @@ -535,10 +535,10 @@ void AlphaBoxBlur::BoxBlur_LS3(uint8_t *aData, int32_t aLeftLobe, inSkipRectY = false; continue; } - __m128i topLeft = loadUnaligned128((__m128i *)(topLeftBase + x)); - __m128i topRight = loadUnaligned128((__m128i *)(topRightBase + x)); - __m128i bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x)); - __m128i bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x)); + __m128i topLeft = loadUnaligned128((__m128i*)(topLeftBase + x)); + __m128i topRight = loadUnaligned128((__m128i*)(topRightBase + x)); + __m128i bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x)); + __m128i bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x)); __m128i result = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); diff --git a/gfx/2d/BlurNEON.cpp b/gfx/2d/BlurNEON.cpp index 2f33a2435db1a..601b6f363de66 100644 --- a/gfx/2d/BlurNEON.cpp +++ b/gfx/2d/BlurNEON.cpp @@ -21,18 +21,18 @@ uint16x4_t Divide(uint32x4_t aValues, uint32x2_t aDivisor) { } MOZ_ALWAYS_INLINE -uint16x4_t BlurFourPixels(const uint32x4_t &aTopLeft, - const uint32x4_t &aTopRight, - const uint32x4_t &aBottomRight, - const uint32x4_t &aBottomLeft, - const uint32x2_t &aDivisor) { +uint16x4_t BlurFourPixels(const uint32x4_t& aTopLeft, + const uint32x4_t& aTopRight, + const uint32x4_t& aBottomRight, + const uint32x4_t& aBottomLeft, + const uint32x2_t& aDivisor) { uint32x4_t values = vaddq_u32( vsubq_u32(vsubq_u32(aBottomRight, aTopRight), aBottomLeft), aTopLeft); return Divide(values, aDivisor); } MOZ_ALWAYS_INLINE -void LoadIntegralRowFromRow(uint32_t *aDest, const uint8_t *aSource, +void LoadIntegralRowFromRow(uint32_t* aDest, const uint8_t* aSource, int32_t aSourceWidth, int32_t aLeftInflation, int32_t aRightInflation) { int32_t currentRowSum = 0; @@ -54,9 +54,9 @@ void LoadIntegralRowFromRow(uint32_t *aDest, const uint8_t *aSource, MOZ_ALWAYS_INLINE void GenerateIntegralImage_NEON( int32_t aLeftInflation, int32_t aRightInflation, int32_t aTopInflation, - int32_t aBottomInflation, uint32_t *aIntegralImage, - size_t aIntegralImageStride, uint8_t *aSource, int32_t aSourceStride, - const IntSize &aSize) { + int32_t aBottomInflation, uint32_t* aIntegralImage, + size_t aIntegralImageStride, uint8_t* aSource, int32_t aSourceStride, + const IntSize& aSize) { MOZ_ASSERT(!(aLeftInflation & 3)); uint32_t stride32bit = aIntegralImageStride / 4; @@ -67,9 +67,9 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_NEON( aRightInflation); for (int y = 1; y < aTopInflation + 1; y++) { - uint32_t *intRow = aIntegralImage + (y * stride32bit); - uint32_t *intPrevRow = aIntegralImage + (y - 1) * stride32bit; - uint32_t *intFirstRow = aIntegralImage; + uint32_t* intRow = aIntegralImage + (y * stride32bit); + uint32_t* intPrevRow = aIntegralImage + (y - 1) * stride32bit; + uint32_t* intFirstRow = aIntegralImage; for (int x = 0; x < integralImageSize.width; x += 4) { uint32x4_t firstRow = vld1q_u32(intFirstRow + x); @@ -80,9 +80,9 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_NEON( for (int y = aTopInflation + 1; y < (aSize.height + aTopInflation); y++) { uint32x4_t currentRowSum = vdupq_n_u32(0); - uint32_t *intRow = aIntegralImage + (y * stride32bit); - uint32_t *intPrevRow = aIntegralImage + (y - 1) * stride32bit; - uint8_t *sourceRow = aSource + aSourceStride * (y - aTopInflation); + uint32_t* intRow = aIntegralImage + (y * stride32bit); + uint32_t* intPrevRow = aIntegralImage + (y - 1) * stride32bit; + uint8_t* sourceRow = aSource + aSourceStride * (y - aTopInflation); uint32_t pixel = sourceRow[0]; for (int x = 0; x < aLeftInflation; x += 4) { @@ -121,7 +121,7 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_NEON( // Deal with unaligned portion. Get the correct pixel from currentRowSum, // see explanation above. uint32_t intCurrentRowSum = - ((uint32_t *)¤tRowSum)[(aSize.width % 4) - 1]; + ((uint32_t*)¤tRowSum)[(aSize.width % 4) - 1]; for (; x < integralImageSize.width; x++) { // We could be unaligned here! if (!(x & 3)) { @@ -160,9 +160,9 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_NEON( for (int y = aSize.height + aTopInflation; y < integralImageSize.height; y++) { - uint32_t *intRow = aIntegralImage + (y * stride32bit); - uint32_t *intPrevRow = aIntegralImage + (y - 1) * stride32bit; - uint32_t *intLastRow = + uint32_t* intRow = aIntegralImage + (y * stride32bit); + uint32_t* intPrevRow = aIntegralImage + (y - 1) * stride32bit; + uint32_t* intLastRow = aIntegralImage + (integralImageSize.height - 1) * stride32bit; for (int x = 0; x < integralImageSize.width; x += 4) { vst1q_u32(intRow + x, vaddq_u32(vld1q_u32(intLastRow + x), @@ -175,9 +175,9 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_NEON( /** * Attempt to do an in-place box blur using an integral image. */ -void AlphaBoxBlur::BoxBlur_NEON(uint8_t *aData, int32_t aLeftLobe, +void AlphaBoxBlur::BoxBlur_NEON(uint8_t* aData, int32_t aLeftLobe, int32_t aRightLobe, int32_t aTopLobe, - int32_t aBottomLobe, uint32_t *aIntegralImage, + int32_t aBottomLobe, uint32_t* aIntegralImage, size_t aIntegralImageStride) const { IntSize size = GetSize(); @@ -208,22 +208,22 @@ void AlphaBoxBlur::BoxBlur_NEON(uint8_t *aData, int32_t aLeftLobe, // This points to the start of the rectangle within the IntegralImage that // overlaps the surface being blurred. - uint32_t *innerIntegral = + uint32_t* innerIntegral = aIntegralImage + (aTopLobe * stride32bit) + leftInflation; IntRect skipRect = mSkipRect; int32_t stride = mStride; - uint8_t *data = aData; + uint8_t* data = aData; for (int32_t y = 0; y < size.height; y++) { bool inSkipRectY = y > skipRect.y && y < skipRect.YMost(); - uint32_t *topLeftBase = + uint32_t* topLeftBase = innerIntegral + ((y - aTopLobe) * ptrdiff_t(stride32bit) - aLeftLobe); - uint32_t *topRightBase = + uint32_t* topRightBase = innerIntegral + ((y - aTopLobe) * ptrdiff_t(stride32bit) + aRightLobe); - uint32_t *bottomRightBase = + uint32_t* bottomRightBase = innerIntegral + ((y + aBottomLobe) * ptrdiff_t(stride32bit) + aRightLobe); - uint32_t *bottomLeftBase = + uint32_t* bottomLeftBase = innerIntegral + ((y + aBottomLobe) * ptrdiff_t(stride32bit) - aLeftLobe); @@ -294,7 +294,7 @@ void AlphaBoxBlur::BoxBlur_NEON(uint8_t *aData, int32_t aLeftLobe, BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); uint32x2_t final = vreinterpret_u32_u8(vmovn_u16(vcombine_u16(result, vdup_n_u16(0)))); - *(uint32_t *)(data + stride * y + x) = vget_lane_u32(final, 0); + *(uint32_t*)(data + stride * y + x) = vget_lane_u32(final, 0); } } } diff --git a/gfx/2d/BlurSSE2.cpp b/gfx/2d/BlurSSE2.cpp index 86ab593fc2f83..5514e48e8ebe7 100644 --- a/gfx/2d/BlurSSE2.cpp +++ b/gfx/2d/BlurSSE2.cpp @@ -35,9 +35,9 @@ __m128i Divide(__m128i aValues, __m128i aDivisor) { } MOZ_ALWAYS_INLINE -__m128i BlurFourPixels(const __m128i &aTopLeft, const __m128i &aTopRight, - const __m128i &aBottomRight, const __m128i &aBottomLeft, - const __m128i &aDivisor) { +__m128i BlurFourPixels(const __m128i& aTopLeft, const __m128i& aTopRight, + const __m128i& aBottomRight, const __m128i& aBottomLeft, + const __m128i& aDivisor) { __m128i values = _mm_add_epi32( _mm_sub_epi32(_mm_sub_epi32(aBottomRight, aTopRight), aBottomLeft), aTopLeft); @@ -45,7 +45,7 @@ __m128i BlurFourPixels(const __m128i &aTopLeft, const __m128i &aTopRight, } MOZ_ALWAYS_INLINE -void LoadIntegralRowFromRow(uint32_t *aDest, const uint8_t *aSource, +void LoadIntegralRowFromRow(uint32_t* aDest, const uint8_t* aSource, int32_t aSourceWidth, int32_t aLeftInflation, int32_t aRightInflation) { int32_t currentRowSum = 0; @@ -81,9 +81,9 @@ __m128i AccumulatePixelSums(__m128i aPixels) { MOZ_ALWAYS_INLINE void GenerateIntegralImage_SSE2( int32_t aLeftInflation, int32_t aRightInflation, int32_t aTopInflation, - int32_t aBottomInflation, uint32_t *aIntegralImage, - size_t aIntegralImageStride, uint8_t *aSource, int32_t aSourceStride, - const IntSize &aSize) { + int32_t aBottomInflation, uint32_t* aIntegralImage, + size_t aIntegralImageStride, uint8_t* aSource, int32_t aSourceStride, + const IntSize& aSize) { MOZ_ASSERT(!(aLeftInflation & 3)); uint32_t stride32bit = aIntegralImageStride / 4; @@ -95,23 +95,23 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_SSE2( aRightInflation); for (int y = 1; y < aTopInflation + 1; y++) { - uint32_t *intRow = aIntegralImage + (y * stride32bit); - uint32_t *intPrevRow = aIntegralImage + (y - 1) * stride32bit; - uint32_t *intFirstRow = aIntegralImage; + uint32_t* intRow = aIntegralImage + (y * stride32bit); + uint32_t* intPrevRow = aIntegralImage + (y - 1) * stride32bit; + uint32_t* intFirstRow = aIntegralImage; for (int x = 0; x < integralImageSize.width; x += 4) { - __m128i firstRow = _mm_load_si128((__m128i *)(intFirstRow + x)); - __m128i previousRow = _mm_load_si128((__m128i *)(intPrevRow + x)); - _mm_store_si128((__m128i *)(intRow + x), + __m128i firstRow = _mm_load_si128((__m128i*)(intFirstRow + x)); + __m128i previousRow = _mm_load_si128((__m128i*)(intPrevRow + x)); + _mm_store_si128((__m128i*)(intRow + x), _mm_add_epi32(firstRow, previousRow)); } } for (int y = aTopInflation + 1; y < (aSize.height + aTopInflation); y++) { __m128i currentRowSum = _mm_setzero_si128(); - uint32_t *intRow = aIntegralImage + (y * stride32bit); - uint32_t *intPrevRow = aIntegralImage + (y - 1) * stride32bit; - uint8_t *sourceRow = aSource + aSourceStride * (y - aTopInflation); + uint32_t* intRow = aIntegralImage + (y * stride32bit); + uint32_t* intPrevRow = aIntegralImage + (y - 1) * stride32bit; + uint8_t* sourceRow = aSource + aSourceStride * (y - aTopInflation); uint32_t pixel = sourceRow[0]; for (int x = 0; x < aLeftInflation; x += 4) { @@ -123,12 +123,11 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_SSE2( currentRowSum = _mm_shuffle_epi32(sumPixels, _MM_SHUFFLE(3, 3, 3, 3)); _mm_store_si128( - (__m128i *)(intRow + x), - _mm_add_epi32(sumPixels, - _mm_load_si128((__m128i *)(intPrevRow + x)))); + (__m128i*)(intRow + x), + _mm_add_epi32(sumPixels, _mm_load_si128((__m128i*)(intPrevRow + x)))); } for (int x = aLeftInflation; x < (aSize.width + aLeftInflation); x += 4) { - uint32_t pixels = *(uint32_t *)(sourceRow + (x - aLeftInflation)); + uint32_t pixels = *(uint32_t*)(sourceRow + (x - aLeftInflation)); // It's important to shuffle here. When we exit this loop currentRowSum // has to be set to sumPixels, so that the following loop can get the @@ -144,9 +143,8 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_SSE2( currentRowSum = sumPixels; _mm_store_si128( - (__m128i *)(intRow + x), - _mm_add_epi32(sumPixels, - _mm_load_si128((__m128i *)(intPrevRow + x)))); + (__m128i*)(intRow + x), + _mm_add_epi32(sumPixels, _mm_load_si128((__m128i*)(intPrevRow + x)))); } pixel = sourceRow[aSize.width - 1]; @@ -155,7 +153,7 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_SSE2( // Deal with unaligned portion. Get the correct pixel from currentRowSum, // see explanation above. uint32_t intCurrentRowSum = - ((uint32_t *)¤tRowSum)[(aSize.width % 4) - 1]; + ((uint32_t*)¤tRowSum)[(aSize.width % 4) - 1]; for (; x < integralImageSize.width; x++) { // We could be unaligned here! if (!(x & 3)) { @@ -177,9 +175,8 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_SSE2( currentRowSum = _mm_shuffle_epi32(sumPixels, _MM_SHUFFLE(3, 3, 3, 3)); _mm_store_si128( - (__m128i *)(intRow + x), - _mm_add_epi32(sumPixels, - _mm_load_si128((__m128i *)(intPrevRow + x)))); + (__m128i*)(intRow + x), + _mm_add_epi32(sumPixels, _mm_load_si128((__m128i*)(intPrevRow + x)))); } } @@ -194,11 +191,11 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_SSE2( for (int y = aSize.height + aTopInflation; y < integralImageSize.height; y++) { - __m128i *intRow = (__m128i *)(aIntegralImage + (y * stride32bit)); - __m128i *intPrevRow = (__m128i *)(aIntegralImage + (y - 1) * stride32bit); - __m128i *intLastRow = - (__m128i *)(aIntegralImage + - (integralImageSize.height - 1) * stride32bit); + __m128i* intRow = (__m128i*)(aIntegralImage + (y * stride32bit)); + __m128i* intPrevRow = (__m128i*)(aIntegralImage + (y - 1) * stride32bit); + __m128i* intLastRow = + (__m128i*)(aIntegralImage + + (integralImageSize.height - 1) * stride32bit); for (int x = 0; x < integralImageSize.width; x += 4) { _mm_store_si128(intRow + (x / 4), @@ -212,9 +209,9 @@ MOZ_ALWAYS_INLINE void GenerateIntegralImage_SSE2( /** * Attempt to do an in-place box blur using an integral image. */ -void AlphaBoxBlur::BoxBlur_SSE2(uint8_t *aData, int32_t aLeftLobe, +void AlphaBoxBlur::BoxBlur_SSE2(uint8_t* aData, int32_t aLeftLobe, int32_t aRightLobe, int32_t aTopLobe, - int32_t aBottomLobe, uint32_t *aIntegralImage, + int32_t aBottomLobe, uint32_t* aIntegralImage, size_t aIntegralImageStride) const { IntSize size = GetSize(); @@ -246,25 +243,25 @@ void AlphaBoxBlur::BoxBlur_SSE2(uint8_t *aData, int32_t aLeftLobe, // This points to the start of the rectangle within the IntegralImage that // overlaps the surface being blurred. - uint32_t *innerIntegral = + uint32_t* innerIntegral = aIntegralImage + (aTopLobe * stride32bit) + leftInflation; IntRect skipRect = mSkipRect; int32_t stride = mStride; - uint8_t *data = aData; + uint8_t* data = aData; for (int32_t y = 0; y < size.height; y++) { // Not using ContainsY(y) because we do not skip y == skipRect.Y() // although that may not be done on purpose bool inSkipRectY = y > skipRect.Y() && y < skipRect.YMost(); - uint32_t *topLeftBase = + uint32_t* topLeftBase = innerIntegral + ((y - aTopLobe) * ptrdiff_t(stride32bit) - aLeftLobe); - uint32_t *topRightBase = + uint32_t* topRightBase = innerIntegral + ((y - aTopLobe) * ptrdiff_t(stride32bit) + aRightLobe); - uint32_t *bottomRightBase = + uint32_t* bottomRightBase = innerIntegral + ((y + aBottomLobe) * ptrdiff_t(stride32bit) + aRightLobe); - uint32_t *bottomLeftBase = + uint32_t* bottomLeftBase = innerIntegral + ((y + aBottomLobe) * ptrdiff_t(stride32bit) - aLeftLobe); @@ -286,38 +283,38 @@ void AlphaBoxBlur::BoxBlur_SSE2(uint8_t *aData, int32_t aLeftLobe, __m128i bottomRight; __m128i bottomLeft; - topLeft = loadUnaligned128((__m128i *)(topLeftBase + x)); - topRight = loadUnaligned128((__m128i *)(topRightBase + x)); - bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x)); - bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x)); + topLeft = loadUnaligned128((__m128i*)(topLeftBase + x)); + topRight = loadUnaligned128((__m128i*)(topRightBase + x)); + bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x)); + bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x)); __m128i result1 = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); - topLeft = loadUnaligned128((__m128i *)(topLeftBase + x + 4)); - topRight = loadUnaligned128((__m128i *)(topRightBase + x + 4)); - bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x + 4)); - bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x + 4)); + topLeft = loadUnaligned128((__m128i*)(topLeftBase + x + 4)); + topRight = loadUnaligned128((__m128i*)(topRightBase + x + 4)); + bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x + 4)); + bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x + 4)); __m128i result2 = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); - topLeft = loadUnaligned128((__m128i *)(topLeftBase + x + 8)); - topRight = loadUnaligned128((__m128i *)(topRightBase + x + 8)); - bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x + 8)); - bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x + 8)); + topLeft = loadUnaligned128((__m128i*)(topLeftBase + x + 8)); + topRight = loadUnaligned128((__m128i*)(topRightBase + x + 8)); + bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x + 8)); + bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x + 8)); __m128i result3 = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); - topLeft = loadUnaligned128((__m128i *)(topLeftBase + x + 12)); - topRight = loadUnaligned128((__m128i *)(topRightBase + x + 12)); - bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x + 12)); - bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x + 12)); + topLeft = loadUnaligned128((__m128i*)(topLeftBase + x + 12)); + topRight = loadUnaligned128((__m128i*)(topRightBase + x + 12)); + bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x + 12)); + bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x + 12)); __m128i result4 = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); __m128i final = _mm_packus_epi16(_mm_packs_epi32(result1, result2), _mm_packs_epi32(result3, result4)); - _mm_storeu_si128((__m128i *)(data + stride * y + x), final); + _mm_storeu_si128((__m128i*)(data + stride * y + x), final); } // Process the remaining pixels 4 bytes at a time. @@ -331,17 +328,17 @@ void AlphaBoxBlur::BoxBlur_SSE2(uint8_t *aData, int32_t aLeftLobe, inSkipRectY = false; continue; } - __m128i topLeft = loadUnaligned128((__m128i *)(topLeftBase + x)); - __m128i topRight = loadUnaligned128((__m128i *)(topRightBase + x)); - __m128i bottomRight = loadUnaligned128((__m128i *)(bottomRightBase + x)); - __m128i bottomLeft = loadUnaligned128((__m128i *)(bottomLeftBase + x)); + __m128i topLeft = loadUnaligned128((__m128i*)(topLeftBase + x)); + __m128i topRight = loadUnaligned128((__m128i*)(topRightBase + x)); + __m128i bottomRight = loadUnaligned128((__m128i*)(bottomRightBase + x)); + __m128i bottomLeft = loadUnaligned128((__m128i*)(bottomLeftBase + x)); __m128i result = BlurFourPixels(topLeft, topRight, bottomRight, bottomLeft, divisor); __m128i final = _mm_packus_epi16( _mm_packs_epi32(result, _mm_setzero_si128()), _mm_setzero_si128()); - *(uint32_t *)(data + stride * y + x) = _mm_cvtsi128_si32(final); + *(uint32_t*)(data + stride * y + x) = _mm_cvtsi128_si32(final); } } } diff --git a/gfx/2d/BorrowedContext.h b/gfx/2d/BorrowedContext.h index 5d9ccc526ef35..d39e220db0b8f 100644 --- a/gfx/2d/BorrowedContext.h +++ b/gfx/2d/BorrowedContext.h @@ -32,14 +32,14 @@ class BorrowedCairoContext { public: BorrowedCairoContext() : mCairo(nullptr), mDT(nullptr) {} - explicit BorrowedCairoContext(DrawTarget *aDT) : mDT(aDT) { + explicit BorrowedCairoContext(DrawTarget* aDT) : mDT(aDT) { mCairo = BorrowCairoContextFromDrawTarget(aDT); } // We can optionally Init after construction in // case we don't know what the DT will be at construction // time. - cairo_t *Init(DrawTarget *aDT) { + cairo_t* Init(DrawTarget* aDT) { MOZ_ASSERT(!mDT, "Can't initialize twice!"); mDT = aDT; return mCairo = BorrowCairoContextFromDrawTarget(aDT); @@ -59,12 +59,12 @@ class BorrowedCairoContext { ~BorrowedCairoContext() { MOZ_ASSERT(!mCairo); } - cairo_t *mCairo; + cairo_t* mCairo; private: - static cairo_t *BorrowCairoContextFromDrawTarget(DrawTarget *aDT); - static void ReturnCairoContextToDrawTarget(DrawTarget *aDT, cairo_t *aCairo); - DrawTarget *mDT; + static cairo_t* BorrowCairoContextFromDrawTarget(DrawTarget* aDT); + static void ReturnCairoContextToDrawTarget(DrawTarget* aDT, cairo_t* aCairo); + DrawTarget* mDT; }; #ifdef MOZ_X11 @@ -84,7 +84,7 @@ class BorrowedXlibDrawable { mVisual(nullptr), mXRenderFormat(nullptr) {} - explicit BorrowedXlibDrawable(DrawTarget *aDT) + explicit BorrowedXlibDrawable(DrawTarget* aDT) : mDT(nullptr), mDisplay(nullptr), mDrawable(X11None), @@ -97,7 +97,7 @@ class BorrowedXlibDrawable { // We can optionally Init after construction in // case we don't know what the DT will be at construction // time. - bool Init(DrawTarget *aDT); + bool Init(DrawTarget* aDT); // The caller needs to call Finish if drawable is non-zero when // they are done with the context. This is currently explicit @@ -108,22 +108,22 @@ class BorrowedXlibDrawable { ~BorrowedXlibDrawable() { MOZ_ASSERT(!mDrawable); } - Display *GetDisplay() const { return mDisplay; } + Display* GetDisplay() const { return mDisplay; } Drawable GetDrawable() const { return mDrawable; } - Screen *GetScreen() const { return mScreen; } - Visual *GetVisual() const { return mVisual; } + Screen* GetScreen() const { return mScreen; } + Visual* GetVisual() const { return mVisual; } IntSize GetSize() const { return mSize; } Point GetOffset() const { return mOffset; } - XRenderPictFormat *GetXRenderFormat() const { return mXRenderFormat; } + XRenderPictFormat* GetXRenderFormat() const { return mXRenderFormat; } private: - DrawTarget *mDT; - Display *mDisplay; + DrawTarget* mDT; + Display* mDisplay; Drawable mDrawable; - Screen *mScreen; - Visual *mVisual; - XRenderPictFormat *mXRenderFormat; + Screen* mScreen; + Visual* mVisual; + XRenderPictFormat* mXRenderFormat; IntSize mSize; Point mOffset; }; @@ -140,7 +140,7 @@ class BorrowedCGContext { public: BorrowedCGContext() : cg(nullptr), mDT(nullptr) {} - explicit BorrowedCGContext(DrawTarget *aDT) : mDT(aDT) { + explicit BorrowedCGContext(DrawTarget* aDT) : mDT(aDT) { MOZ_ASSERT(aDT, "Caller should check for nullptr"); cg = BorrowCGContextFromDrawTarget(aDT); } @@ -148,7 +148,7 @@ class BorrowedCGContext { // We can optionally Init after construction in // case we don't know what the DT will be at construction // time. - CGContextRef Init(DrawTarget *aDT) { + CGContextRef Init(DrawTarget* aDT) { MOZ_ASSERT(aDT, "Caller should check for nullptr"); MOZ_ASSERT(!mDT, "Can't initialize twice!"); mDT = aDT; @@ -174,18 +174,18 @@ class BorrowedCGContext { private: # ifdef USE_SKIA - static CGContextRef BorrowCGContextFromDrawTarget(DrawTarget *aDT); - static void ReturnCGContextToDrawTarget(DrawTarget *aDT, CGContextRef cg); + static CGContextRef BorrowCGContextFromDrawTarget(DrawTarget* aDT); + static void ReturnCGContextToDrawTarget(DrawTarget* aDT, CGContextRef cg); # else - static CGContextRef BorrowCGContextFromDrawTarget(DrawTarget *aDT) { + static CGContextRef BorrowCGContextFromDrawTarget(DrawTarget* aDT) { MOZ_CRASH("Not supported without Skia"); } - static void ReturnCGContextToDrawTarget(DrawTarget *aDT, CGContextRef cg) { + static void ReturnCGContextToDrawTarget(DrawTarget* aDT, CGContextRef cg) { MOZ_CRASH("not supported without Skia"); } # endif - DrawTarget *mDT; + DrawTarget* mDT; }; #endif diff --git a/gfx/2d/BufferEdgePad.cpp b/gfx/2d/BufferEdgePad.cpp index 76687256185d8..69f508f7886a9 100644 --- a/gfx/2d/BufferEdgePad.cpp +++ b/gfx/2d/BufferEdgePad.cpp @@ -15,10 +15,10 @@ namespace mozilla { namespace gfx { -void PadDrawTargetOutFromRegion(DrawTarget *aDrawTarget, - const nsIntRegion &aRegion) { +void PadDrawTargetOutFromRegion(DrawTarget* aDrawTarget, + const nsIntRegion& aRegion) { struct LockedBits { - uint8_t *data; + uint8_t* data; IntSize size; int32_t stride; SurfaceFormat format; @@ -28,8 +28,8 @@ void PadDrawTargetOutFromRegion(DrawTarget *aDrawTarget, return x; } - static void ensure_memcpy(uint8_t *dst, uint8_t *src, size_t n, - uint8_t *bitmap, int stride, int height) { + static void ensure_memcpy(uint8_t* dst, uint8_t* src, size_t n, + uint8_t* bitmap, int stride, int height) { if (src + n > bitmap + stride * height) { MOZ_CRASH("GFX: long src memcpy"); } @@ -44,10 +44,10 @@ void PadDrawTargetOutFromRegion(DrawTarget *aDrawTarget, } } - static void visitor(void *closure, VisitSide side, int x1, int y1, int x2, + static void visitor(void* closure, VisitSide side, int x1, int y1, int x2, int y2) { - LockedBits *lb = static_cast(closure); - uint8_t *bitmap = lb->data; + LockedBits* lb = static_cast(closure); + uint8_t* bitmap = lb->data; const int bpp = gfx::BytesPerPixel(lb->format); const int stride = lb->stride; const int width = lb->size.width; diff --git a/gfx/2d/DataSourceSurfaceWrapper.h b/gfx/2d/DataSourceSurfaceWrapper.h index 63116256339e5..b5d346614704f 100644 --- a/gfx/2d/DataSourceSurfaceWrapper.h +++ b/gfx/2d/DataSourceSurfaceWrapper.h @@ -17,23 +17,23 @@ namespace gfx { class DataSourceSurfaceWrapper final : public DataSourceSurface { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceWrapper, override) - explicit DataSourceSurfaceWrapper(DataSourceSurface *aSurface) + explicit DataSourceSurfaceWrapper(DataSourceSurface* aSurface) : mSurface(aSurface) {} - bool Equals(SourceSurface *aOther, bool aSymmetric = true) override { + bool Equals(SourceSurface* aOther, bool aSymmetric = true) override { return DataSourceSurface::Equals(aOther, aSymmetric) || mSurface->Equals(aOther, aSymmetric); } SurfaceType GetType() const override { return SurfaceType::DATA; } - uint8_t *GetData() override { return mSurface->GetData(); } + uint8_t* GetData() override { return mSurface->GetData(); } int32_t Stride() override { return mSurface->Stride(); } IntSize GetSize() const override { return mSurface->GetSize(); } SurfaceFormat GetFormat() const override { return mSurface->GetFormat(); } bool IsValid() const override { return mSurface->IsValid(); } - bool Map(MapType aType, MappedSurface *aMappedSurface) override { + bool Map(MapType aType, MappedSurface* aMappedSurface) override { return mSurface->Map(aType, aMappedSurface); } diff --git a/gfx/2d/DrawEventRecorder.cpp b/gfx/2d/DrawEventRecorder.cpp index 17c51a5e94d3b..bed456c826052 100644 --- a/gfx/2d/DrawEventRecorder.cpp +++ b/gfx/2d/DrawEventRecorder.cpp @@ -17,13 +17,13 @@ using namespace std; DrawEventRecorderPrivate::DrawEventRecorderPrivate() : mExternalFonts(false) {} void DrawEventRecorderPrivate::StoreExternalSurfaceRecording( - SourceSurface *aSurface, uint64_t aKey) { + SourceSurface* aSurface, uint64_t aKey) { RecordEvent(RecordedExternalSurfaceCreation(aSurface, aKey)); mExternalSurfaces.push_back(aSurface); } void DrawEventRecorderPrivate::StoreSourceSurfaceRecording( - SourceSurface *aSurface, const char *aReason) { + SourceSurface* aSurface, const char* aReason) { RefPtr dataSurf = aSurface->GetDataSurface(); if (dataSurf) { DataSourceSurface::ScopedMap map(dataSurf, DataSourceSurface::READ); @@ -44,7 +44,7 @@ void DrawEventRecorderPrivate::StoreSourceSurfaceRecording( aSurface->GetFormat())); } -void DrawEventRecorderFile::RecordEvent(const RecordedEvent &aEvent) { +void DrawEventRecorderFile::RecordEvent(const RecordedEvent& aEvent) { WriteElement(mOutputStream, aEvent.mType); aEvent.RecordToStream(mOutputStream); @@ -52,7 +52,7 @@ void DrawEventRecorderFile::RecordEvent(const RecordedEvent &aEvent) { Flush(); } -void DrawEventRecorderMemory::RecordEvent(const RecordedEvent &aEvent) { +void DrawEventRecorderMemory::RecordEvent(const RecordedEvent& aEvent) { WriteElement(mOutputStream, aEvent.mType); aEvent.RecordToStream(mOutputStream); @@ -62,12 +62,12 @@ void DrawEventRecorderMemory::AddDependentSurface(uint64_t aDependencyId) { mDependentSurfaces.PutEntry(aDependencyId); } -nsTHashtable - &&DrawEventRecorderMemory::TakeDependentSurfaces() { +nsTHashtable&& +DrawEventRecorderMemory::TakeDependentSurfaces() { return std::move(mDependentSurfaces); } -DrawEventRecorderFile::DrawEventRecorderFile(const char_type *aFilename) +DrawEventRecorderFile::DrawEventRecorderFile(const char_type* aFilename) : mOutputStream(aFilename, ofstream::binary) { WriteHeader(mOutputStream); } @@ -78,7 +78,7 @@ void DrawEventRecorderFile::Flush() { mOutputStream.flush(); } bool DrawEventRecorderFile::IsOpen() { return mOutputStream.is_open(); } -void DrawEventRecorderFile::OpenNew(const char_type *aFilename) { +void DrawEventRecorderFile::OpenNew(const char_type* aFilename) { MOZ_ASSERT(!mOutputStream.is_open()); mOutputStream.open(aFilename, ofstream::binary); @@ -96,7 +96,7 @@ DrawEventRecorderMemory::DrawEventRecorderMemory() { } DrawEventRecorderMemory::DrawEventRecorderMemory( - const SerializeResourcesFn &aFn) + const SerializeResourcesFn& aFn) : mSerializeCallback(aFn) { mExternalFonts = !!mSerializeCallback; WriteHeader(mOutputStream); diff --git a/gfx/2d/DrawTargetCairo.h b/gfx/2d/DrawTargetCairo.h index f23e44f940751..63d36745d2680 100644 --- a/gfx/2d/DrawTargetCairo.h +++ b/gfx/2d/DrawTargetCairo.h @@ -22,7 +22,7 @@ class GradientStopsCairo : public GradientStops { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsCairo, override) - GradientStopsCairo(GradientStop *aStops, uint32_t aNumStops, + GradientStopsCairo(GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode) : mExtendMode(aExtendMode) { for (uint32_t i = 0; i < aNumStops; ++i) { @@ -32,7 +32,7 @@ class GradientStopsCairo : public GradientStops { virtual ~GradientStopsCairo() = default; - const std::vector &GetStops() const { return mStops; } + const std::vector& GetStops() const { return mStops; } ExtendMode GetExtendMode() const { return mExtendMode; } @@ -66,66 +66,66 @@ class DrawTargetCairo final : public DrawTarget { virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) override; - virtual bool LockBits(uint8_t **aData, IntSize *aSize, int32_t *aStride, - SurfaceFormat *aFormat, - IntPoint *aOrigin = nullptr) override; - virtual void ReleaseBits(uint8_t *aData) override; + virtual bool LockBits(uint8_t** aData, IntSize* aSize, int32_t* aStride, + SurfaceFormat* aFormat, + IntPoint* aOrigin = nullptr) override; + virtual void ReleaseBits(uint8_t* aData) override; virtual void Flush() override; virtual void DrawSurface( - SourceSurface *aSurface, const Rect &aDest, const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + SourceSurface* aSurface, const Rect& aDest, const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions = DrawSurfaceOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) override; - virtual void ClearRect(const Rect &aRect) override; - - virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; - virtual void CopyRect(const IntRect &aSourceRect, - const IntPoint &aDestination) override; - - virtual void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - - virtual void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - - virtual void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - - virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions) override; - virtual void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void ClearRect(const Rect& aRect) override; + + virtual void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; + virtual void CopyRect(const IntRect& aSourceRect, + const IntPoint& aDestination) override; + + virtual void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + + virtual void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + + virtual void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + + virtual void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions) override; + virtual void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) override; virtual void MaskSurface( - const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; + const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; - virtual bool Draw3DTransformedSurface(SourceSurface *aSurface, - const Matrix4x4 &aMatrix) override; + virtual bool Draw3DTransformedSurface(SourceSurface* aSurface, + const Matrix4x4& aMatrix) override; - virtual void PushClip(const Path *aPath) override; - virtual void PushClipRect(const Rect &aRect) override; + virtual void PushClip(const Path* aPath) override; + virtual void PushClipRect(const Rect& aRect) override; virtual void PopClip() override; - virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) override; virtual void PopLayer() override; @@ -133,67 +133,67 @@ class DrawTargetCairo final : public DrawTarget { FillRule aFillRule = FillRule::FILL_WINDING) const override; virtual already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override; virtual already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override; + SourceSurface* aSurface) const override; virtual already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override; + const NativeSurface& aSurface) const override; virtual already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override; + const IntSize& aSize, SurfaceFormat aFormat) const override; virtual already_AddRefed CreateShadowDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat, float aSigma) const override; + const IntSize& aSize, SurfaceFormat aFormat, float aSigma) const override; virtual already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; virtual already_AddRefed CreateFilter(FilterType aType) override; virtual void GetGlyphRasterizationMetrics( - ScaledFont *aScaledFont, const uint16_t *aGlyphIndices, - uint32_t aNumGlyphs, GlyphMetrics *aGlyphMetrics) override; + ScaledFont* aScaledFont, const uint16_t* aGlyphIndices, + uint32_t aNumGlyphs, GlyphMetrics* aGlyphMetrics) override; - virtual void *GetNativeSurface(NativeSurfaceType aType) override; + virtual void* GetNativeSurface(NativeSurfaceType aType) override; - bool Init(cairo_surface_t *aSurface, const IntSize &aSize, - SurfaceFormat *aFormat = nullptr); - bool Init(const IntSize &aSize, SurfaceFormat aFormat); - bool Init(unsigned char *aData, const IntSize &aSize, int32_t aStride, + bool Init(cairo_surface_t* aSurface, const IntSize& aSize, + SurfaceFormat* aFormat = nullptr); + bool Init(const IntSize& aSize, SurfaceFormat aFormat); + bool Init(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat); - virtual void SetTransform(const Matrix &aTransform) override; + virtual void SetTransform(const Matrix& aTransform) override; virtual void DetachAllSnapshots() override { MarkSnapshotIndependent(); } // Call to set up aContext for drawing (with the current transform, etc). // Pass the path you're going to be using if you have one. // Implicitly calls WillChange(aPath). - void PrepareForDrawing(cairo_t *aContext, const Path *aPath = nullptr); + void PrepareForDrawing(cairo_t* aContext, const Path* aPath = nullptr); - static cairo_surface_t *GetDummySurface(); + static cairo_surface_t* GetDummySurface(); // Cairo hardcodes this as its maximum surface size. static size_t GetMaxSurfaceSize() { return 32767; } private: // methods // Init cairo surface without doing a cairo_surface_reference() call. - bool InitAlreadyReferenced(cairo_surface_t *aSurface, const IntSize &aSize, - SurfaceFormat *aFormat = nullptr); + bool InitAlreadyReferenced(cairo_surface_t* aSurface, const IntSize& aSize, + SurfaceFormat* aFormat = nullptr); enum DrawPatternType { DRAW_FILL, DRAW_STROKE }; - void DrawPattern(const Pattern &aPattern, const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions, DrawPatternType aDrawType, + void DrawPattern(const Pattern& aPattern, const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions, DrawPatternType aDrawType, bool aPathBoundsClip = false); - void CopySurfaceInternal(cairo_surface_t *aSurface, const IntRect &aSource, - const IntPoint &aDest); + void CopySurfaceInternal(cairo_surface_t* aSurface, const IntRect& aSource, + const IntPoint& aDest); Rect GetUserSpaceClip(); // Call before you make any changes to the backing surface with which this // context is associated. Pass the path you're going to be using if you have // one. - void WillChange(const Path *aPath = nullptr); + void WillChange(const Path* aPath = nullptr); // Call if there is any reason to disassociate the snapshot from this draw // target; for example, because we're going to be destroyed. @@ -201,21 +201,21 @@ class DrawTargetCairo final : public DrawTarget { // If the current operator is "source" then clear the destination before we // draw into it, to simulate the effect of an unbounded source operator. - void ClearSurfaceForUnboundedSource(const CompositionOp &aOperator); + void ClearSurfaceForUnboundedSource(const CompositionOp& aOperator); // Set the Cairo context font options according to the current draw target // font state. void SetFontOptions(); private: // data - cairo_t *mContext; - cairo_surface_t *mSurface; + cairo_t* mContext; + cairo_surface_t* mSurface; IntSize mSize; bool mTransformSingular; - uint8_t *mLockedBits; + uint8_t* mLockedBits; - cairo_font_options_t *mFontOptions; + cairo_font_options_t* mFontOptions; struct PushedLayer { PushedLayer(Float aOpacity, bool aWasPermittingSubpixelAA) @@ -223,7 +223,7 @@ class DrawTargetCairo final : public DrawTarget { mMaskPattern(nullptr), mWasPermittingSubpixelAA(aWasPermittingSubpixelAA) {} Float mOpacity; - cairo_pattern_t *mMaskPattern; + cairo_pattern_t* mMaskPattern; bool mWasPermittingSubpixelAA; }; std::vector mPushedLayers; @@ -231,7 +231,7 @@ class DrawTargetCairo final : public DrawTarget { // The latest snapshot of this surface. This needs to be told when this // target is modified. We keep it alive as a cache. RefPtr mSnapshot; - static cairo_surface_t *mDummySurface; + static cairo_surface_t* mDummySurface; }; } // namespace gfx diff --git a/gfx/2d/DrawTargetCapture.h b/gfx/2d/DrawTargetCapture.h index d2f2757dff16c..04c974f664410 100644 --- a/gfx/2d/DrawTargetCapture.h +++ b/gfx/2d/DrawTargetCapture.h @@ -23,11 +23,11 @@ class DrawTargetCaptureImpl final : public DrawTargetCapture { friend class SourceSurfaceCapture; public: - DrawTargetCaptureImpl(gfx::DrawTarget *aTarget, size_t aFlushBytes); - DrawTargetCaptureImpl(BackendType aBackend, const IntSize &aSize, + DrawTargetCaptureImpl(gfx::DrawTarget* aTarget, size_t aFlushBytes); + DrawTargetCaptureImpl(BackendType aBackend, const IntSize& aSize, SurfaceFormat aFormat); - bool Init(const IntSize &aSize, DrawTarget *aRefDT); + bool Init(const IntSize& aSize, DrawTarget* aRefDT); void InitForData(int32_t aStride, size_t aSurfaceAllocationSize); BackendType GetBackendType() const override { @@ -42,94 +42,94 @@ class DrawTargetCaptureImpl final : public DrawTargetCapture { void DetachAllSnapshots() override; IntSize GetSize() const override { return mSize; } void Flush() override {} - void DrawSurface(SourceSurface *aSurface, const Rect &aDest, - const Rect &aSource, const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) override; - void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override; - void DrawSurfaceWithShadow(SourceSurface *aSurface, const Point &aDest, - const Color &aColor, const Point &aOffset, + void DrawSurface(SourceSurface* aSurface, const Rect& aDest, + const Rect& aSource, const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) override; + void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override; + void DrawSurfaceWithShadow(SourceSurface* aSurface, const Point& aDest, + const Color& aColor, const Point& aOffset, Float aSigma, CompositionOp aOperator) override; - void ClearRect(const Rect &aRect) override; - void MaskSurface(const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; - void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; - void CopyRect(const IntRect &aSourceRect, - const IntPoint &aDestination) override; - - void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - void FillRoundedRect(const RoundedRect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - void StrokeGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) override; - void PushClip(const Path *aPath) override; - void PushClipRect(const Rect &aRect) override; + void ClearRect(const Rect& aRect) override; + void MaskSurface(const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; + void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; + void CopyRect(const IntRect& aSourceRect, + const IntPoint& aDestination) override; + + void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + void FillRoundedRect(const RoundedRect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + void StrokeGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) override; + void PushClip(const Path* aPath) override; + void PushClipRect(const Rect& aRect) override; void PopClip() override; - void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, const IntRect &aBounds, + void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, const IntRect& aBounds, bool aCopyBackground) override; void PopLayer() override; - void Blur(const AlphaBoxBlur &aBlur) override; - void PadEdges(const IntRegion &aRegion) override; + void Blur(const AlphaBoxBlur& aBlur) override; + void PadEdges(const IntRegion& aRegion) override; - void SetTransform(const Matrix &aTransform) override; + void SetTransform(const Matrix& aTransform) override; bool SupportsRegionClipping() const override { return mRefDT->SupportsRegionClipping(); } already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override { return mRefDT->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat); } already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override; + SourceSurface* aSurface) const override; already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override { + const NativeSurface& aSurface) const override { return mRefDT->CreateSourceSurfaceFromNativeSurface(aSurface); } already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override; + const IntSize& aSize, SurfaceFormat aFormat) const override; RefPtr CreateSimilarRasterTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override; + const IntSize& aSize, SurfaceFormat aFormat) const override; already_AddRefed CreatePathBuilder( FillRule aFillRule = FillRule::FILL_WINDING) const override; already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override { return mRefDT->CreateGradientStops(aStops, aNumStops, aExtendMode); } already_AddRefed CreateFilter(FilterType aType) override; - void ReplayToDrawTarget(DrawTarget *aDT, const Matrix &aTransform); + void ReplayToDrawTarget(DrawTarget* aDT, const Matrix& aTransform); bool IsEmpty() const override; void Dump() override; @@ -149,7 +149,7 @@ class DrawTargetCaptureImpl final : public DrawTargetCapture { // that are required while recording. It should be noted there's no // guarantees on the alignments of DrawingCommands allocated in this array. template - T *AppendToCommandList() { + T* AppendToCommandList() { if (T::AffectsSnapshot) { MarkChanged(); } @@ -160,7 +160,7 @@ class DrawTargetCaptureImpl final : public DrawTargetCapture { return mCommands.Append(); } template - T *ReuseOrAppendToCommandList() { + T* ReuseOrAppendToCommandList() { if (T::AffectsSnapshot) { MarkChanged(); } diff --git a/gfx/2d/DrawTargetD2D1.cpp b/gfx/2d/DrawTargetD2D1.cpp index e48ff82f5bcb3..a4c4dd471ad54 100644 --- a/gfx/2d/DrawTargetD2D1.cpp +++ b/gfx/2d/DrawTargetD2D1.cpp @@ -25,9 +25,9 @@ using namespace std; // decltype is not usable for overloaded functions. -typedef HRESULT(WINAPI *D2D1CreateFactoryFunc)( +typedef HRESULT(WINAPI* D2D1CreateFactoryFunc)( D2D1_FACTORY_TYPE factoryType, REFIID iid, - CONST D2D1_FACTORY_OPTIONS *pFactoryOptions, void **factory); + CONST D2D1_FACTORY_OPTIONS* pFactoryOptions, void** factory); namespace mozilla { namespace gfx { @@ -92,7 +92,7 @@ bool DrawTargetD2D1::IsValid() const { // Uninitialized DTs are considered valid. return mInitState != InitState::Failure; } else { - return const_cast(this)->EnsureInitialized(); + return const_cast(this)->EnsureInitialized(); } } @@ -175,10 +175,10 @@ static const uint32_t kTransformedGlyphsBeforePurge = 1000; void DrawTargetD2D1::Flush() { FlushInternal(); } -void DrawTargetD2D1::DrawSurface(SourceSurface *aSurface, const Rect &aDest, - const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) { +void DrawTargetD2D1::DrawSurface(SourceSurface* aSurface, const Rect& aDest, + const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) { PrepareForDrawing(aOptions.mCompositionOp, ColorPattern(Color())); D2D1_RECT_F samplingBounds; @@ -215,7 +215,7 @@ void DrawTargetD2D1::DrawSurface(SourceSurface *aSurface, const Rect &aDest, if (aSurface->GetType() == SurfaceType::D2D1_1_IMAGE) { // If this is called with a DataSourceSurface it might do a partial upload // that our DrawBitmap call doesn't support. - hr = image->QueryInterface((ID2D1Bitmap **)getter_AddRefs(bitmap)); + hr = image->QueryInterface((ID2D1Bitmap**)getter_AddRefs(bitmap)); } if (SUCCEEDED(hr) && bitmap && @@ -243,9 +243,9 @@ void DrawTargetD2D1::DrawSurface(SourceSurface *aSurface, const Rect &aDest, FinalizeDrawing(aOptions.mCompositionOp, ColorPattern(Color())); } -void DrawTargetD2D1::DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions) { +void DrawTargetD2D1::DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions) { if (aNode->GetBackendType() != FILTER_BACKEND_DIRECT2D1_1) { gfxWarning() << *this << ": Incompatible filter passed to DrawFilter."; return; @@ -255,7 +255,7 @@ void DrawTargetD2D1::DrawFilter(FilterNode *aNode, const Rect &aSourceRect, mDC->SetAntialiasMode(D2DAAMode(aOptions.mAntialiasMode)); - FilterNodeD2D1 *node = static_cast(aNode); + FilterNodeD2D1* node = static_cast(aNode); node->WillDraw(this); if (aOptions.mAlpha == 1.0f) { @@ -281,10 +281,10 @@ void DrawTargetD2D1::DrawFilter(FilterNode *aNode, const Rect &aSourceRect, FinalizeDrawing(aOptions.mCompositionOp, ColorPattern(Color())); } -void DrawTargetD2D1::DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, - const Color &aColor, - const Point &aOffset, Float aSigma, +void DrawTargetD2D1::DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, + const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) { if (!EnsureInitialized()) { return; @@ -340,7 +340,7 @@ void DrawTargetD2D1::DrawSurfaceWithShadow(SourceSurface *aSurface, } } -void DrawTargetD2D1::ClearRect(const Rect &aRect) { +void DrawTargetD2D1::ClearRect(const Rect& aRect) { if (!EnsureInitialized()) { return; } @@ -404,8 +404,8 @@ void DrawTargetD2D1::ClearRect(const Rect &aRect) { return; } -void DrawTargetD2D1::MaskSurface(const Pattern &aSource, SourceSurface *aMask, - Point aOffset, const DrawOptions &aOptions) { +void DrawTargetD2D1::MaskSurface(const Pattern& aSource, SourceSurface* aMask, + Point aOffset, const DrawOptions& aOptions) { if (!EnsureInitialized()) { return; } @@ -432,7 +432,7 @@ void DrawTargetD2D1::MaskSurface(const Pattern &aSource, SourceSurface *aMask, IntSize::Truncate(aMask->GetSize().width, aMask->GetSize().height); Rect dest = Rect(aOffset.x, aOffset.y, Float(size.width), Float(size.height)); - HRESULT hr = image->QueryInterface((ID2D1Bitmap **)getter_AddRefs(bitmap)); + HRESULT hr = image->QueryInterface((ID2D1Bitmap**)getter_AddRefs(bitmap)); if (!bitmap || FAILED(hr)) { // D2D says if we have an actual ID2D1Image and not a bitmap underlying the // object, we can't query for a bitmap. Instead, Push/PopLayer @@ -482,9 +482,9 @@ void DrawTargetD2D1::MaskSurface(const Pattern &aSource, SourceSurface *aMask, FinalizeDrawing(aOptions.mCompositionOp, aSource); } -void DrawTargetD2D1::CopySurface(SourceSurface *aSurface, - const IntRect &aSourceRect, - const IntPoint &aDestination) { +void DrawTargetD2D1::CopySurface(SourceSurface* aSurface, + const IntRect& aSourceRect, + const IntPoint& aDestination) { if (!EnsureInitialized()) { return; } @@ -519,7 +519,7 @@ void DrawTargetD2D1::CopySurface(SourceSurface *aSurface, mat._32); RefPtr bitmap; - HRESULT hr = image->QueryInterface((ID2D1Bitmap **)getter_AddRefs(bitmap)); + HRESULT hr = image->QueryInterface((ID2D1Bitmap**)getter_AddRefs(bitmap)); if (SUCCEEDED(hr) && bitmap && mFormat == SurfaceFormat::A8) { RefPtr brush; @@ -554,8 +554,8 @@ void DrawTargetD2D1::CopySurface(SourceSurface *aSurface, D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY); } -void DrawTargetD2D1::FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetD2D1::FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions) { PrepareForDrawing(aOptions.mCompositionOp, aPattern); mDC->SetAntialiasMode(D2DAAMode(aOptions.mAntialiasMode)); @@ -566,9 +566,9 @@ void DrawTargetD2D1::FillRect(const Rect &aRect, const Pattern &aPattern, FinalizeDrawing(aOptions.mCompositionOp, aPattern); } -void DrawTargetD2D1::FillRoundedRect(const RoundedRect &aRect, - const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetD2D1::FillRoundedRect(const RoundedRect& aRect, + const Pattern& aPattern, + const DrawOptions& aOptions) { if (!aRect.corners.AreRadiiSame()) { return DrawTarget::FillRoundedRect(aRect, aPattern, aOptions); } @@ -582,9 +582,9 @@ void DrawTargetD2D1::FillRoundedRect(const RoundedRect &aRect, FinalizeDrawing(aOptions.mCompositionOp, aPattern); } -void DrawTargetD2D1::StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetD2D1::StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { PrepareForDrawing(aOptions.mCompositionOp, aPattern); mDC->SetAntialiasMode(D2DAAMode(aOptions.mAntialiasMode)); @@ -599,10 +599,10 @@ void DrawTargetD2D1::StrokeRect(const Rect &aRect, const Pattern &aPattern, FinalizeDrawing(aOptions.mCompositionOp, aPattern); } -void DrawTargetD2D1::StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetD2D1::StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { PrepareForDrawing(aOptions.mCompositionOp, aPattern); mDC->SetAntialiasMode(D2DAAMode(aOptions.mAntialiasMode)); @@ -617,19 +617,19 @@ void DrawTargetD2D1::StrokeLine(const Point &aStart, const Point &aEnd, FinalizeDrawing(aOptions.mCompositionOp, aPattern); } -void DrawTargetD2D1::Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { - const Path *path = aPath; +void DrawTargetD2D1::Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { + const Path* path = aPath; if (aPath->GetBackendType() == BackendType::CAPTURE) { - path = static_cast(aPath)->GetRealizedPath(); + path = static_cast(aPath)->GetRealizedPath(); } if (path->GetBackendType() != BackendType::DIRECT2D1_1) { gfxDebug() << *this << ": Ignoring drawing call for incompatible path."; return; } - const PathD2D *d2dPath = static_cast(path); + const PathD2D* d2dPath = static_cast(path); PrepareForDrawing(aOptions.mCompositionOp, aPattern); @@ -645,18 +645,18 @@ void DrawTargetD2D1::Stroke(const Path *aPath, const Pattern &aPattern, FinalizeDrawing(aOptions.mCompositionOp, aPattern); } -void DrawTargetD2D1::Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions) { - const Path *path = aPath; +void DrawTargetD2D1::Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions) { + const Path* path = aPath; if (aPath && aPath->GetBackendType() == BackendType::CAPTURE) { - path = static_cast(aPath)->GetRealizedPath(); + path = static_cast(aPath)->GetRealizedPath(); } if (!path || path->GetBackendType() != BackendType::DIRECT2D1_1) { gfxDebug() << *this << ": Ignoring drawing call for incompatible path."; return; } - const PathD2D *d2dPath = static_cast(path); + const PathD2D* d2dPath = static_cast(path); PrepareForDrawing(aOptions.mCompositionOp, aPattern); @@ -669,17 +669,17 @@ void DrawTargetD2D1::Fill(const Path *aPath, const Pattern &aPattern, FinalizeDrawing(aOptions.mCompositionOp, aPattern); } -void DrawTargetD2D1::FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetD2D1::FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions) { if (aFont->GetType() != FontType::DWRITE) { gfxDebug() << *this << ": Ignoring drawing call for incompatible font."; return; } - ScaledFontDWrite *font = static_cast(aFont); + ScaledFontDWrite* font = static_cast(aFont); - IDWriteRenderingParams *params = font->mParams; + IDWriteRenderingParams* params = font->mParams; AntialiasMode aaMode = font->GetDefaultAAMode(); @@ -799,8 +799,8 @@ void DrawTargetD2D1::FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, FinalizeDrawing(aOptions.mCompositionOp, aPattern); } -void DrawTargetD2D1::Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions) { +void DrawTargetD2D1::Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions) { PrepareForDrawing(aOptions.mCompositionOp, aSource); RefPtr source = CreateBrushForPattern(aSource, aOptions.mAlpha); @@ -821,8 +821,8 @@ void DrawTargetD2D1::Mask(const Pattern &aSource, const Pattern &aMask, FinalizeDrawing(aOptions.mCompositionOp, aSource); } -void DrawTargetD2D1::PushClipGeometry(ID2D1Geometry *aGeometry, - const D2D1_MATRIX_3X2_F &aTransform, +void DrawTargetD2D1::PushClipGeometry(ID2D1Geometry* aGeometry, + const D2D1_MATRIX_3X2_F& aTransform, bool aPixelAligned) { mCurrentClippedGeometry = nullptr; @@ -845,10 +845,10 @@ void DrawTargetD2D1::PushClipGeometry(ID2D1Geometry *aGeometry, } } -void DrawTargetD2D1::PushClip(const Path *aPath) { - const Path *path = aPath; +void DrawTargetD2D1::PushClip(const Path* aPath) { + const Path* path = aPath; if (aPath->GetBackendType() == BackendType::CAPTURE) { - path = static_cast(aPath)->GetRealizedPath(); + path = static_cast(aPath)->GetRealizedPath(); } if (path->GetBackendType() != BackendType::DIRECT2D1_1) { @@ -859,12 +859,12 @@ void DrawTargetD2D1::PushClip(const Path *aPath) { return; } - RefPtr pathD2D = static_cast(const_cast(path)); + RefPtr pathD2D = static_cast(const_cast(path)); PushClipGeometry(pathD2D->GetGeometry(), D2DMatrix(mTransform)); } -void DrawTargetD2D1::PushClipRect(const Rect &aRect) { +void DrawTargetD2D1::PushClipRect(const Rect& aRect) { if (!EnsureInitialized()) { return; } @@ -899,7 +899,7 @@ void DrawTargetD2D1::PushClipRect(const Rect &aRect) { } } -void DrawTargetD2D1::PushDeviceSpaceClipRects(const IntRect *aRects, +void DrawTargetD2D1::PushDeviceSpaceClipRects(const IntRect* aRects, uint32_t aCount) { if (!EnsureInitialized()) { return; @@ -911,7 +911,7 @@ void DrawTargetD2D1::PushDeviceSpaceClipRects(const IntRect *aRects, path->Open(getter_AddRefs(sink)); sink->SetFillMode(D2D1_FILL_MODE_WINDING); for (uint32_t i = 0; i < aCount; i++) { - const IntRect &rect = aRects[i]; + const IntRect& rect = aRects[i]; sink->BeginFigure(D2DPoint(rect.TopLeft()), D2D1_FIGURE_BEGIN_FILLED); D2D1_POINT_2F lines[3] = {D2DPoint(rect.TopRight()), D2DPoint(rect.BottomRight()), @@ -948,9 +948,9 @@ void DrawTargetD2D1::PopClip() { } void DrawTargetD2D1::PushLayer(bool aOpaque, Float aOpacity, - SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds, bool aCopyBackground) { + SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds, bool aCopyBackground) { if (!EnsureInitialized()) { return; } @@ -1044,7 +1044,7 @@ void DrawTargetD2D1::PopLayer() { } already_AddRefed DrawTargetD2D1::CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const { RefPtr bitmap; @@ -1072,7 +1072,7 @@ already_AddRefed DrawTargetD2D1::CreateSourceSurfaceFromData( } already_AddRefed DrawTargetD2D1::CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const { + const IntSize& aSize, SurfaceFormat aFormat) const { RefPtr dt = new DrawTargetD2D1(); if (!dt->Init(aSize, aFormat)) { @@ -1082,7 +1082,7 @@ already_AddRefed DrawTargetD2D1::CreateSimilarDrawTarget( return dt.forget(); } -bool DrawTargetD2D1::CanCreateSimilarDrawTarget(const IntSize &aSize, +bool DrawTargetD2D1::CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const { RefPtr dc = Factory::GetD2DDeviceContext(); if (!dc) { @@ -1120,14 +1120,14 @@ already_AddRefed DrawTargetD2D1::CreatePathBuilder( } already_AddRefed DrawTargetD2D1::CreateGradientStops( - GradientStop *rawStops, uint32_t aNumStops, ExtendMode aExtendMode) const { + GradientStop* rawStops, uint32_t aNumStops, ExtendMode aExtendMode) const { if (aNumStops == 0) { gfxWarning() << *this << ": Failed to create GradientStopCollection with no stops."; return nullptr; } - D2D1_GRADIENT_STOP *stops = new D2D1_GRADIENT_STOP[aNumStops]; + D2D1_GRADIENT_STOP* stops = new D2D1_GRADIENT_STOP[aNumStops]; for (uint32_t i = 0; i < aNumStops; i++) { stops[i].position = rawStops[i].offset; @@ -1160,10 +1160,10 @@ already_AddRefed DrawTargetD2D1::CreateFilter(FilterType aType) { return FilterNodeD2D1::Create(mDC, aType); } -void DrawTargetD2D1::GetGlyphRasterizationMetrics(ScaledFont *aScaledFont, - const uint16_t *aGlyphIndices, +void DrawTargetD2D1::GetGlyphRasterizationMetrics(ScaledFont* aScaledFont, + const uint16_t* aGlyphIndices, uint32_t aNumGlyphs, - GlyphMetrics *aGlyphMetrics) { + GlyphMetrics* aGlyphMetrics) { MOZ_ASSERT(aScaledFont->GetType() == FontType::DWRITE); aScaledFont->GetGlyphDesignMetrics(aGlyphIndices, aNumGlyphs, aGlyphMetrics); @@ -1178,7 +1178,7 @@ void DrawTargetD2D1::GetGlyphRasterizationMetrics(ScaledFont *aScaledFont, } } -bool DrawTargetD2D1::Init(ID3D11Texture2D *aTexture, SurfaceFormat aFormat) { +bool DrawTargetD2D1::Init(ID3D11Texture2D* aTexture, SurfaceFormat aFormat) { RefPtr device = Factory::GetD2D1Device(&mDeviceSeq); if (!device) { gfxCriticalNote << "[D2D1.1] Failed to obtain a device for " @@ -1186,9 +1186,8 @@ bool DrawTargetD2D1::Init(ID3D11Texture2D *aTexture, SurfaceFormat aFormat) { return false; } - aTexture->QueryInterface( - __uuidof(IDXGISurface), - (void **)((IDXGISurface **)getter_AddRefs(mSurface))); + aTexture->QueryInterface(__uuidof(IDXGISurface), + (void**)((IDXGISurface**)getter_AddRefs(mSurface))); if (!mSurface) { gfxCriticalError() << "[D2D1.1] Failed to obtain a DXGI surface."; return false; @@ -1204,7 +1203,7 @@ bool DrawTargetD2D1::Init(ID3D11Texture2D *aTexture, SurfaceFormat aFormat) { return true; } -bool DrawTargetD2D1::Init(const IntSize &aSize, SurfaceFormat aFormat) { +bool DrawTargetD2D1::Init(const IntSize& aSize, SurfaceFormat aFormat) { RefPtr device = Factory::GetD2D1Device(&mDeviceSeq); if (!device) { gfxCriticalNote << "[D2D1.1] Failed to obtain a device for " @@ -1371,7 +1370,7 @@ bool DrawTargetD2D1::EnsureInitialized() { props.colorContext = nullptr; props.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET; hr = mDC->CreateBitmap(D2DIntSize(mSize), nullptr, 0, props, - (ID2D1Bitmap1 **)getter_AddRefs(mBitmap)); + (ID2D1Bitmap1**)getter_AddRefs(mBitmap)); if (FAILED(hr)) { gfxCriticalError() << "[D2D1.1] 3CreateBitmap failure " << mSize @@ -1386,7 +1385,7 @@ bool DrawTargetD2D1::EnsureInitialized() { props.colorContext = nullptr; props.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET; hr = mDC->CreateBitmapFromDxgiSurface( - mSurface, props, (ID2D1Bitmap1 **)getter_AddRefs(mBitmap)); + mSurface, props, (ID2D1Bitmap1**)getter_AddRefs(mBitmap)); if (FAILED(hr)) { gfxCriticalError() @@ -1448,7 +1447,7 @@ void DrawTargetD2D1::MarkChanged() { } bool DrawTargetD2D1::ShouldClipTemporarySurfaceDrawing(CompositionOp aOp, - const Pattern &aPattern, + const Pattern& aPattern, bool aClipIsComplex) { bool patternSupported = IsPatternSupportedByD2D(aPattern); return patternSupported && !CurrentLayer().mIsOpaque && @@ -1457,7 +1456,7 @@ bool DrawTargetD2D1::ShouldClipTemporarySurfaceDrawing(CompositionOp aOp, } void DrawTargetD2D1::PrepareForDrawing(CompositionOp aOp, - const Pattern &aPattern) { + const Pattern& aPattern) { if (!EnsureInitialized()) { return; } @@ -1503,7 +1502,7 @@ void DrawTargetD2D1::PrepareForDrawing(CompositionOp aOp, } void DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, - const Pattern &aPattern) { + const Pattern& aPattern) { bool patternSupported = IsPatternSupportedByD2D(aPattern); if (D2DSupportsPrimitiveBlendMode(aOp) && patternSupported) { @@ -1589,8 +1588,8 @@ void DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, return; } - const RadialGradientPattern *pat = - static_cast(&aPattern); + const RadialGradientPattern* pat = + static_cast(&aPattern); if (pat->mCenter1 == pat->mCenter2 && pat->mRadius1 == pat->mRadius2) { // Draw nothing! return; @@ -1613,8 +1612,7 @@ void DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, radialGradientEffect->SetValue( RADIAL_PROP_STOP_COLLECTION, - static_cast(pat->mStops.get()) - ->mStopCollection); + static_cast(pat->mStops.get())->mStopCollection); radialGradientEffect->SetValue( RADIAL_PROP_CENTER_1, D2D1::Vector2F(pat->mCenter1.x, pat->mCenter1.y)); radialGradientEffect->SetValue( @@ -1630,7 +1628,7 @@ void DrawTargetD2D1::FinalizeDrawing(CompositionOp aOp, D2DCompositionMode(aOp)); } -void DrawTargetD2D1::AddDependencyOnSource(SourceSurfaceD2D1 *aSource) { +void DrawTargetD2D1::AddDependencyOnSource(SourceSurfaceD2D1* aSource) { Maybe snapshotLock; // We grab the SnapshotLock as well, this guaranteeds aSource->mDrawTarget // cannot be cleared in between the if statement and the dereference. @@ -1647,8 +1645,8 @@ void DrawTargetD2D1::AddDependencyOnSource(SourceSurfaceD2D1 *aSource) { } } -static D2D1_RECT_F IntersectRect(const D2D1_RECT_F &aRect1, - const D2D1_RECT_F &aRect2) { +static D2D1_RECT_F IntersectRect(const D2D1_RECT_F& aRect1, + const D2D1_RECT_F& aRect2) { D2D1_RECT_F result; result.left = max(aRect1.left, aRect2.left); result.top = max(aRect1.top, aRect2.top); @@ -1661,8 +1659,8 @@ static D2D1_RECT_F IntersectRect(const D2D1_RECT_F &aRect1, return result; } -bool DrawTargetD2D1::GetDeviceSpaceClipRect(D2D1_RECT_F &aClipRect, - bool &aIsPixelAligned) { +bool DrawTargetD2D1::GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, + bool& aIsPixelAligned) { if (!CurrentLayer().mPushedClips.size()) { return false; } @@ -1748,7 +1746,7 @@ already_AddRefed DrawTargetD2D1::GetImageForLayerContent( } already_AddRefed DrawTargetD2D1::GetClippedGeometry( - IntRect *aClipBounds) { + IntRect* aClipBounds) { if (mCurrentClippedGeometry) { *aClipBounds = mCurrentClipBounds; RefPtr clippedGeometry(mCurrentClippedGeometry); @@ -1874,9 +1872,9 @@ void DrawTargetD2D1::PushAllClips() { } } -void DrawTargetD2D1::PushClipsToDC(ID2D1DeviceContext *aDC, +void DrawTargetD2D1::PushClipsToDC(ID2D1DeviceContext* aDC, bool aForceIgnoreAlpha, - const D2D1_RECT_F &aMaxRect) { + const D2D1_RECT_F& aMaxRect) { mDC->SetTransform(D2D1::IdentityMatrix()); mTransformDirty = true; @@ -1894,7 +1892,7 @@ void DrawTargetD2D1::PushClipsToDC(ID2D1DeviceContext *aDC, } } -void DrawTargetD2D1::PopClipsFromDC(ID2D1DeviceContext *aDC) { +void DrawTargetD2D1::PopClipsFromDC(ID2D1DeviceContext* aDC) { for (int i = CurrentLayer().mPushedClips.size() - 1; i >= 0; i--) { if (CurrentLayer().mPushedClips[i].mGeometry) { aDC->PopLayer(); @@ -1909,30 +1907,29 @@ already_AddRefed DrawTargetD2D1::CreateTransparentBlackBrush() { } already_AddRefed DrawTargetD2D1::GetSolidColorBrush( - const D2D_COLOR_F &aColor) { + const D2D_COLOR_F& aColor) { RefPtr brush = mSolidColorBrush; brush->SetColor(aColor); return brush.forget(); } already_AddRefed DrawTargetD2D1::CreateBrushForPattern( - const Pattern &aPattern, Float aAlpha) { + const Pattern& aPattern, Float aAlpha) { if (!IsPatternSupportedByD2D(aPattern)) { return GetSolidColorBrush(D2D1::ColorF(1.0f, 1.0f, 1.0f, 1.0f)); } if (aPattern.GetType() == PatternType::COLOR) { - Color color = static_cast(&aPattern)->mColor; + Color color = static_cast(&aPattern)->mColor; return GetSolidColorBrush( D2D1::ColorF(color.r, color.g, color.b, color.a * aAlpha)); } if (aPattern.GetType() == PatternType::LINEAR_GRADIENT) { RefPtr gradBrush; - const LinearGradientPattern *pat = - static_cast(&aPattern); + const LinearGradientPattern* pat = + static_cast(&aPattern); - GradientStopsD2D *stops = - static_cast(pat->mStops.get()); + GradientStopsD2D* stops = static_cast(pat->mStops.get()); if (!stops) { gfxDebug() << "No stops specified for gradient pattern."; @@ -1958,11 +1955,10 @@ already_AddRefed DrawTargetD2D1::CreateBrushForPattern( } if (aPattern.GetType() == PatternType::RADIAL_GRADIENT) { RefPtr gradBrush; - const RadialGradientPattern *pat = - static_cast(&aPattern); + const RadialGradientPattern* pat = + static_cast(&aPattern); - GradientStopsD2D *stops = - static_cast(pat->mStops.get()); + GradientStopsD2D* stops = static_cast(pat->mStops.get()); if (!stops) { gfxDebug() << "No stops specified for gradient pattern."; @@ -1989,7 +1985,7 @@ already_AddRefed DrawTargetD2D1::CreateBrushForPattern( return gradBrush.forget(); } if (aPattern.GetType() == PatternType::SURFACE) { - const SurfacePattern *pat = static_cast(&aPattern); + const SurfacePattern* pat = static_cast(&aPattern); if (!pat->mSurface) { gfxDebug() << "No source surface specified for surface pattern"; @@ -2004,8 +2000,8 @@ already_AddRefed DrawTargetD2D1::CreateBrushForPattern( RefPtr surf = pat->mSurface; if (pat->mSurface->GetType() == SurfaceType::CAPTURE) { - SourceSurfaceCapture *capture = - static_cast(pat->mSurface.get()); + SourceSurfaceCapture* capture = + static_cast(pat->mSurface.get()); RefPtr resolved = capture->Resolve(GetBackendType()); if (resolved) { surf = resolved; @@ -2021,8 +2017,7 @@ already_AddRefed DrawTargetD2D1::CreateBrushForPattern( // source bitmapbrush with source format A8. This creates a BGRA surface // with the same alpha values that the A8 surface has. RefPtr bitmap; - HRESULT hr = - image->QueryInterface((ID2D1Bitmap **)getter_AddRefs(bitmap)); + HRESULT hr = image->QueryInterface((ID2D1Bitmap**)getter_AddRefs(bitmap)); if (SUCCEEDED(hr) && bitmap) { RefPtr oldTarget; RefPtr tmpBitmap; @@ -2052,8 +2047,7 @@ already_AddRefed DrawTargetD2D1::CreateBrushForPattern( if (pat->mSamplingRect.IsEmpty()) { RefPtr bitmap; - HRESULT hr = - image->QueryInterface((ID2D1Bitmap **)getter_AddRefs(bitmap)); + HRESULT hr = image->QueryInterface((ID2D1Bitmap**)getter_AddRefs(bitmap)); if (SUCCEEDED(hr) && bitmap) { /** * Create the brush with the proper repeat modes. @@ -2113,13 +2107,13 @@ already_AddRefed DrawTargetD2D1::CreateBrushForPattern( } already_AddRefed DrawTargetD2D1::GetImageForSurface( - SourceSurface *aSurface, Matrix &aSourceTransform, ExtendMode aExtendMode, - const IntRect *aSourceRect, bool aUserSpace) { + SourceSurface* aSurface, Matrix& aSourceTransform, ExtendMode aExtendMode, + const IntRect* aSourceRect, bool aUserSpace) { RefPtr image; switch (aSurface->GetType()) { case SurfaceType::CAPTURE: { - SourceSurfaceCapture *capture = - static_cast(aSurface); + SourceSurfaceCapture* capture = + static_cast(aSurface); RefPtr resolved = capture->Resolve(GetBackendType()); if (!resolved) { return nullptr; @@ -2129,18 +2123,18 @@ already_AddRefed DrawTargetD2D1::GetImageForSurface( aSourceRect, aUserSpace); } break; case SurfaceType::D2D1_1_IMAGE: { - SourceSurfaceD2D1 *surf = static_cast(aSurface); + SourceSurfaceD2D1* surf = static_cast(aSurface); image = surf->GetImage(); AddDependencyOnSource(surf); } break; case SurfaceType::DUAL_DT: { // Sometimes we have a dual drawtarget but the underlying targets // are d2d surfaces. Let's not readback and reupload in those cases. - SourceSurfaceDual *surface = static_cast(aSurface); - SourceSurface *first = surface->GetFirstSurface(); + SourceSurfaceDual* surface = static_cast(aSurface); + SourceSurface* first = surface->GetFirstSurface(); if (first->GetType() == SurfaceType::D2D1_1_IMAGE) { MOZ_ASSERT(surface->SameSurfaceTypes()); - SourceSurfaceD2D1 *d2dSurface = static_cast(first); + SourceSurfaceD2D1* d2dSurface = static_cast(first); image = d2dSurface->GetImage(); AddDependencyOnSource(d2dSurface); break; @@ -2164,7 +2158,7 @@ already_AddRefed DrawTargetD2D1::GetImageForSurface( } already_AddRefed DrawTargetD2D1::OptimizeSourceSurface( - SourceSurface *aSurface) const { + SourceSurface* aSurface) const { if (aSurface->GetType() == SurfaceType::D2D1_1_IMAGE) { RefPtr surface(aSurface); return surface.forget(); @@ -2177,8 +2171,8 @@ already_AddRefed DrawTargetD2D1::OptimizeSourceSurface( // Special case captures so we don't resolve them to a data surface. if (aSurface->GetType() == SurfaceType::CAPTURE) { - SourceSurfaceCapture *capture = - static_cast(aSurface); + SourceSurfaceCapture* capture = + static_cast(aSurface); RefPtr resolved = capture->Resolve(GetBackendType()); if (!resolved) { return nullptr; @@ -2218,11 +2212,11 @@ already_AddRefed DrawTargetD2D1::OptimizeSourceSurface( data->GetFormat(), data->GetSize()); } -void DrawTargetD2D1::PushD2DLayer(ID2D1DeviceContext *aDC, - ID2D1Geometry *aGeometry, - const D2D1_MATRIX_3X2_F &aTransform, +void DrawTargetD2D1::PushD2DLayer(ID2D1DeviceContext* aDC, + ID2D1Geometry* aGeometry, + const D2D1_MATRIX_3X2_F& aTransform, bool aPixelAligned, bool aForceIgnoreAlpha, - const D2D1_RECT_F &aMaxRect) { + const D2D1_RECT_F& aMaxRect) { D2D1_LAYER_OPTIONS1 options = D2D1_LAYER_OPTIONS1_NONE; if (CurrentLayer().mIsOpaque || aForceIgnoreAlpha) { diff --git a/gfx/2d/DrawTargetD2D1.h b/gfx/2d/DrawTargetD2D1.h index 85f096993dba3..28a0f8d3bec77 100644 --- a/gfx/2d/DrawTargetD2D1.h +++ b/gfx/2d/DrawTargetD2D1.h @@ -47,81 +47,81 @@ class DrawTargetD2D1 : public DrawTarget { virtual IntSize GetSize() const override { return mSize; } virtual void Flush() override; - virtual void DrawSurface(SourceSurface *aSurface, const Rect &aDest, - const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) override; - virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + virtual void DrawSurface(SourceSurface* aSurface, const Rect& aDest, + const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) override; + virtual void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) override; - virtual void ClearRect(const Rect &aRect) override; + virtual void ClearRect(const Rect& aRect) override; virtual void MaskSurface( - const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; + const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; - virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; + virtual void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; - virtual void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; virtual void FillRoundedRect( - const RoundedRect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - - virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void PushClip(const Path *aPath) override; - virtual void PushClipRect(const Rect &aRect) override; - virtual void PushDeviceSpaceClipRects(const IntRect *aRects, + const RoundedRect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + + virtual void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void PushClip(const Path* aPath) override; + virtual void PushClipRect(const Rect& aRect) override; + virtual void PushDeviceSpaceClipRects(const IntRect* aRects, uint32_t aCount) override; virtual void PopClip() override; - virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) override; virtual void PopLayer() override; virtual already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override; virtual already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override; + SourceSurface* aSurface) const override; virtual already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override { + const NativeSurface& aSurface) const override { return nullptr; } virtual already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override; - virtual bool CanCreateSimilarDrawTarget(const IntSize &aSize, + const IntSize& aSize, SurfaceFormat aFormat) const override; + virtual bool CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const override; virtual already_AddRefed CreatePathBuilder( FillRule aFillRule = FillRule::FILL_WINDING) const override; virtual already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; virtual already_AddRefed CreateFilter(FilterType aType) override; @@ -131,18 +131,18 @@ class DrawTargetD2D1 : public DrawTarget { return CurrentLayer().mIsOpaque; } - virtual void *GetNativeSurface(NativeSurfaceType aType) override { + virtual void* GetNativeSurface(NativeSurfaceType aType) override { return nullptr; } virtual void DetachAllSnapshots() override { MarkChanged(); } virtual void GetGlyphRasterizationMetrics( - ScaledFont *aScaledFont, const uint16_t *aGlyphIndices, - uint32_t aNumGlyphs, GlyphMetrics *aGlyphMetrics) override; + ScaledFont* aScaledFont, const uint16_t* aGlyphIndices, + uint32_t aNumGlyphs, GlyphMetrics* aGlyphMetrics) override; - bool Init(const IntSize &aSize, SurfaceFormat aFormat); - bool Init(ID3D11Texture2D *aTexture, SurfaceFormat aFormat); + bool Init(const IntSize& aSize, SurfaceFormat aFormat); + bool Init(ID3D11Texture2D* aTexture, SurfaceFormat aFormat); uint32_t GetByteSize() const; // This function will get an image for a surface, it may adjust the source @@ -150,10 +150,10 @@ class DrawTargetD2D1 : public DrawTarget { // oritingal SourceSurface. By default, the surface and its transform are // interpreted in user-space, but may be specified in device-space instead. already_AddRefed GetImageForSurface( - SourceSurface *aSurface, Matrix &aSourceTransform, ExtendMode aExtendMode, - const IntRect *aSourceRect = nullptr, bool aUserSpace = true); + SourceSurface* aSurface, Matrix& aSourceTransform, ExtendMode aExtendMode, + const IntRect* aSourceRect = nullptr, bool aUserSpace = true); - already_AddRefed GetImageForSurface(SourceSurface *aSurface, + already_AddRefed GetImageForSurface(SourceSurface* aSurface, ExtendMode aExtendMode) { Matrix mat; return GetImageForSurface(aSurface, mat, aExtendMode, nullptr); @@ -181,29 +181,29 @@ class DrawTargetD2D1 : public DrawTarget { void FlushInternal(bool aHasDependencyMutex = false); bool EnsureInitialized(); - typedef std::unordered_set TargetSet; + typedef std::unordered_set TargetSet; // This function will mark the surface as changing, and make sure any // copy-on-write snapshots are notified. void MarkChanged(); bool ShouldClipTemporarySurfaceDrawing(CompositionOp aOp, - const Pattern &aPattern, + const Pattern& aPattern, bool aClipIsComplex); - void PrepareForDrawing(CompositionOp aOp, const Pattern &aPattern); - void FinalizeDrawing(CompositionOp aOp, const Pattern &aPattern); + void PrepareForDrawing(CompositionOp aOp, const Pattern& aPattern); + void FinalizeDrawing(CompositionOp aOp, const Pattern& aPattern); void FlushTransformToDC() { if (mTransformDirty) { mDC->SetTransform(D2DMatrix(mTransform)); mTransformDirty = false; } } - void AddDependencyOnSource(SourceSurfaceD2D1 *aSource); + void AddDependencyOnSource(SourceSurfaceD2D1* aSource); // Must be called with all clips popped and an identity matrix set. already_AddRefed GetImageForLayerContent( bool aShouldPreserveContent = true); - ID2D1Image *CurrentTarget() { + ID2D1Image* CurrentTarget() { if (CurrentLayer().mCurrentList) { return CurrentLayer().mCurrentList; } @@ -215,33 +215,33 @@ class DrawTargetD2D1 : public DrawTarget { // are currently set. The returned clipped geometry must be clipped by these // bounds to correctly reflect the total clip. This is in device space and // only for clips applied to the -current layer-. - already_AddRefed GetClippedGeometry(IntRect *aClipBounds); + already_AddRefed GetClippedGeometry(IntRect* aClipBounds); already_AddRefed GetInverseClippedGeometry(); // This gives the device space clip rect applied to the -current layer-. - bool GetDeviceSpaceClipRect(D2D1_RECT_F &aClipRect, bool &aIsPixelAligned); + bool GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAligned); void PopAllClips(); void PushAllClips(); - void PushClipsToDC(ID2D1DeviceContext *aDC, bool aForceIgnoreAlpha = false, - const D2D1_RECT_F &aMaxRect = D2D1::InfiniteRect()); - void PopClipsFromDC(ID2D1DeviceContext *aDC); + void PushClipsToDC(ID2D1DeviceContext* aDC, bool aForceIgnoreAlpha = false, + const D2D1_RECT_F& aMaxRect = D2D1::InfiniteRect()); + void PopClipsFromDC(ID2D1DeviceContext* aDC); already_AddRefed CreateTransparentBlackBrush(); already_AddRefed GetSolidColorBrush( - const D2D_COLOR_F &aColor); - already_AddRefed CreateBrushForPattern(const Pattern &aPattern, + const D2D_COLOR_F& aColor); + already_AddRefed CreateBrushForPattern(const Pattern& aPattern, Float aAlpha = 1.0f); - void PushClipGeometry(ID2D1Geometry *aGeometry, - const D2D1_MATRIX_3X2_F &aTransform, + void PushClipGeometry(ID2D1Geometry* aGeometry, + const D2D1_MATRIX_3X2_F& aTransform, bool aPixelAligned = false); - void PushD2DLayer(ID2D1DeviceContext *aDC, ID2D1Geometry *aGeometry, - const D2D1_MATRIX_3X2_F &aTransform, + void PushD2DLayer(ID2D1DeviceContext* aDC, ID2D1Geometry* aGeometry, + const D2D1_MATRIX_3X2_F& aTransform, bool aPixelAligned = false, bool aForceIgnoreAlpha = false, - const D2D1_RECT_F &aLayerRect = D2D1::InfiniteRect()); + const D2D1_RECT_F& aLayerRect = D2D1::InfiniteRect()); // This function is used to determine if the mDC is still valid; if it is // stale, we should avoid using it to execute any draw commands. @@ -289,7 +289,7 @@ class DrawTargetD2D1 : public DrawTarget { bool mOldPermitSubpixelAA; }; std::vector mPushedLayers; - PushedLayer &CurrentLayer() { return mPushedLayers.back(); } + PushedLayer& CurrentLayer() { return mPushedLayers.back(); } // The latest snapshot of this surface. This needs to be told when this // target is modified. We keep it alive as a cache. diff --git a/gfx/2d/DrawTargetDual.cpp b/gfx/2d/DrawTargetDual.cpp index a81eefa374bf0..7a264b120c2ae 100644 --- a/gfx/2d/DrawTargetDual.cpp +++ b/gfx/2d/DrawTargetDual.cpp @@ -13,7 +13,7 @@ namespace gfx { class DualSurface { public: - inline explicit DualSurface(SourceSurface *aSurface) { + inline explicit DualSurface(SourceSurface* aSurface) { if (!aSurface) { mA = mB = nullptr; return; @@ -24,13 +24,13 @@ class DualSurface { return; } - SourceSurfaceDual *ssDual = static_cast(aSurface); + SourceSurfaceDual* ssDual = static_cast(aSurface); mA = ssDual->mA; mB = ssDual->mB; } - SourceSurface *mA; - SourceSurface *mB; + SourceSurface* mA; + SourceSurface* mB; }; /* This only needs to split patterns up for SurfacePatterns. Only in that @@ -39,23 +39,23 @@ class DualSurface { */ class DualPattern final { public: - inline explicit DualPattern(const Pattern &aPattern) + inline explicit DualPattern(const Pattern& aPattern) : mPatternsInitialized(false) { if (aPattern.GetType() != PatternType::SURFACE) { mA = mB = &aPattern; return; } - const SurfacePattern *surfPat = - static_cast(&aPattern); + const SurfacePattern* surfPat = + static_cast(&aPattern); if (surfPat->mSurface->GetType() != SurfaceType::DUAL_DT) { mA = mB = &aPattern; return; } - const SourceSurfaceDual *ssDual = - static_cast(surfPat->mSurface.get()); + const SourceSurfaceDual* ssDual = + static_cast(surfPat->mSurface.get()); mA = new (mSurfPatA.addr()) SurfacePattern(ssDual->mA, surfPat->mExtendMode, surfPat->mMatrix, surfPat->mSamplingFilter); @@ -75,8 +75,8 @@ class DualPattern final { ClassStorage mSurfPatA; ClassStorage mSurfPatB; - const Pattern *mA; - const Pattern *mB; + const Pattern* mA; + const Pattern* mB; bool mPatternsInitialized; }; @@ -86,96 +86,96 @@ void DrawTargetDual::DetachAllSnapshots() { mB->DetachAllSnapshots(); } -void DrawTargetDual::DrawSurface(SourceSurface *aSurface, const Rect &aDest, - const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) { +void DrawTargetDual::DrawSurface(SourceSurface* aSurface, const Rect& aDest, + const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) { DualSurface surface(aSurface); mA->DrawSurface(surface.mA, aDest, aSource, aSurfOptions, aOptions); mB->DrawSurface(surface.mB, aDest, aSource, aSurfOptions, aOptions); } -void DrawTargetDual::DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, - const Color &aColor, - const Point &aOffset, Float aSigma, +void DrawTargetDual::DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, + const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOp) { DualSurface surface(aSurface); mA->DrawSurfaceWithShadow(surface.mA, aDest, aColor, aOffset, aSigma, aOp); mB->DrawSurfaceWithShadow(surface.mB, aDest, aColor, aOffset, aSigma, aOp); } -void DrawTargetDual::MaskSurface(const Pattern &aSource, SourceSurface *aMask, - Point aOffset, const DrawOptions &aOptions) { +void DrawTargetDual::MaskSurface(const Pattern& aSource, SourceSurface* aMask, + Point aOffset, const DrawOptions& aOptions) { DualPattern source(aSource); DualSurface mask(aMask); mA->MaskSurface(*source.mA, mask.mA, aOffset, aOptions); mB->MaskSurface(*source.mB, mask.mB, aOffset, aOptions); } -void DrawTargetDual::ClearRect(const Rect &aRect) { +void DrawTargetDual::ClearRect(const Rect& aRect) { mA->FillRect(aRect, ColorPattern(Color(0.0, 0.0, 0.0, 1.0))); mB->FillRect(aRect, ColorPattern(Color(1.0, 1.0, 1.0, 1.0))); } -void DrawTargetDual::CopySurface(SourceSurface *aSurface, - const IntRect &aSourceRect, - const IntPoint &aDestination) { +void DrawTargetDual::CopySurface(SourceSurface* aSurface, + const IntRect& aSourceRect, + const IntPoint& aDestination) { DualSurface surface(aSurface); mA->CopySurface(surface.mA, aSourceRect, aDestination); mB->CopySurface(surface.mB, aSourceRect, aDestination); } -void DrawTargetDual::FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetDual::FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions) { DualPattern pattern(aPattern); mA->FillRect(aRect, *pattern.mA, aOptions); mB->FillRect(aRect, *pattern.mB, aOptions); } -void DrawTargetDual::StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetDual::StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { DualPattern pattern(aPattern); mA->StrokeRect(aRect, *pattern.mA, aStrokeOptions, aOptions); mB->StrokeRect(aRect, *pattern.mB, aStrokeOptions, aOptions); } -void DrawTargetDual::StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetDual::StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { DualPattern pattern(aPattern); mA->StrokeLine(aStart, aEnd, *pattern.mA, aStrokeOptions, aOptions); mB->StrokeLine(aStart, aEnd, *pattern.mB, aStrokeOptions, aOptions); } -void DrawTargetDual::Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetDual::Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { DualPattern pattern(aPattern); mA->Stroke(aPath, *pattern.mA, aStrokeOptions, aOptions); mB->Stroke(aPath, *pattern.mB, aStrokeOptions, aOptions); } -void DrawTargetDual::Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetDual::Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions) { DualPattern pattern(aPattern); mA->Fill(aPath, *pattern.mA, aOptions); mB->Fill(aPath, *pattern.mB, aOptions); } -void DrawTargetDual::FillGlyphs(ScaledFont *aScaledFont, - const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetDual::FillGlyphs(ScaledFont* aScaledFont, + const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions) { DualPattern pattern(aPattern); mA->FillGlyphs(aScaledFont, aBuffer, *pattern.mA, aOptions); mB->FillGlyphs(aScaledFont, aBuffer, *pattern.mB, aOptions); } -void DrawTargetDual::Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions) { +void DrawTargetDual::Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions) { DualPattern source(aSource); DualPattern mask(aMask); mA->Mask(*source.mA, *mask.mA, aOptions); @@ -183,9 +183,9 @@ void DrawTargetDual::Mask(const Pattern &aSource, const Pattern &aMask, } void DrawTargetDual::PushLayer(bool aOpaque, Float aOpacity, - SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds, bool aCopyBackground) { + SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds, bool aCopyBackground) { DualSurface mask(aMask); mA->PushLayer(aOpaque, aOpacity, mask.mA, aMaskTransform, aBounds, aCopyBackground); @@ -194,13 +194,13 @@ void DrawTargetDual::PushLayer(bool aOpaque, Float aOpacity, } already_AddRefed DrawTargetDual::CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const { + const IntSize& aSize, SurfaceFormat aFormat) const { /* Now that we have PushLayer there a very few cases where a user of * DrawTargetDual wants to have a DualTarget when creating a similar one. */ return mA->CreateSimilarDrawTarget(aSize, aFormat); } -bool DrawTargetDual::CanCreateSimilarDrawTarget(const IntSize &aSize, +bool DrawTargetDual::CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const { return mA->CanCreateSimilarDrawTarget(aSize, aFormat); } diff --git a/gfx/2d/DrawTargetDual.h b/gfx/2d/DrawTargetDual.h index 64590c97515ca..4d85f468a017c 100644 --- a/gfx/2d/DrawTargetDual.h +++ b/gfx/2d/DrawTargetDual.h @@ -46,7 +46,7 @@ class DrawTargetDual : public DrawTarget { }; MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetDual, override) - DrawTargetDual(DrawTarget *aA, DrawTarget *aB) : mA(aA), mB(aB) { + DrawTargetDual(DrawTarget* aA, DrawTarget* aB) : mA(aA), mB(aB) { mFormat = aA->GetFormat(); } @@ -62,12 +62,12 @@ class DrawTargetDual : public DrawTarget { virtual void DetachAllSnapshots() override; FORWARD_FUNCTION(Flush) - FORWARD_FUNCTION1(PushClip, const Path *, aPath) - FORWARD_FUNCTION1(PushClipRect, const Rect &, aRect) + FORWARD_FUNCTION1(PushClip, const Path*, aPath) + FORWARD_FUNCTION1(PushClipRect, const Rect&, aRect) FORWARD_FUNCTION(PopClip) FORWARD_FUNCTION(PopLayer) - virtual void SetTransform(const Matrix &aTransform) override { + virtual void SetTransform(const Matrix& aTransform) override { mTransform = aTransform; mA->SetTransform(aTransform); mB->SetTransform(aTransform); @@ -77,61 +77,61 @@ class DrawTargetDual : public DrawTarget { return mA->SupportsRegionClipping() && mB->SupportsRegionClipping(); } - virtual void DrawSurface(SourceSurface *aSurface, const Rect &aDest, - const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) override; + virtual void DrawSurface(SourceSurface* aSurface, const Rect& aDest, + const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) override; virtual void DrawFilter( - FilterNode *aNode, const Rect &aSourceRect, const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override { + FilterNode* aNode, const Rect& aSourceRect, const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override { mA->DrawFilter(aNode, aSourceRect, aDestPoint, aOptions); mB->DrawFilter(aNode, aSourceRect, aDestPoint, aOptions); } virtual void MaskSurface( - const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; + const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; - virtual void DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + virtual void DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOp) override; - virtual void ClearRect(const Rect &aRect) override; + virtual void ClearRect(const Rect& aRect) override; - virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; + virtual void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; - virtual void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions) override; + virtual void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions) override; - virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) override; + virtual void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) override; - virtual void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) override; + virtual void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) override; - virtual void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) override; + virtual void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) override; - virtual void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions) override; + virtual void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions) override; - virtual void FillGlyphs(ScaledFont *aScaledFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions) override; + virtual void FillGlyphs(ScaledFont* aScaledFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions) override; - virtual void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions) override; + virtual void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions) override; - virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) override; virtual bool Unrotate(IntPoint aRotation) override { @@ -139,24 +139,24 @@ class DrawTargetDual : public DrawTarget { } virtual already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override { return mA->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat); } virtual already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override { + SourceSurface* aSurface) const override { return mA->OptimizeSourceSurface(aSurface); } virtual already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override { + const NativeSurface& aSurface) const override { return mA->CreateSourceSurfaceFromNativeSurface(aSurface); } virtual already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override; - virtual bool CanCreateSimilarDrawTarget(const IntSize &aSize, + const IntSize& aSize, SurfaceFormat aFormat) const override; + virtual bool CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const override; virtual already_AddRefed CreatePathBuilder( @@ -165,7 +165,7 @@ class DrawTargetDual : public DrawTarget { } virtual already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override { return mA->CreateGradientStops(aStops, aNumStops, aExtendMode); } @@ -174,7 +174,7 @@ class DrawTargetDual : public DrawTarget { return mA->CreateFilter(aType); } - virtual void *GetNativeSurface(NativeSurfaceType aType) override { + virtual void* GetNativeSurface(NativeSurfaceType aType) override { return nullptr; } diff --git a/gfx/2d/DrawTargetOffset.h b/gfx/2d/DrawTargetOffset.h index 191afdd14ce59..4292c6a08c868 100644 --- a/gfx/2d/DrawTargetOffset.h +++ b/gfx/2d/DrawTargetOffset.h @@ -44,7 +44,7 @@ class DrawTargetOffset : public DrawTarget { public: DrawTargetOffset(); - bool Init(DrawTarget *aDrawTarget, IntPoint aOrigin); + bool Init(DrawTarget* aDrawTarget, IntPoint aOrigin); // We'll pestimistically return true here virtual bool IsTiledDrawTarget() const override { return true; } @@ -68,88 +68,88 @@ class DrawTargetOffset : public DrawTarget { } virtual void Flush() override; - virtual void DrawSurface(SourceSurface *aSurface, const Rect &aDest, - const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) override; - virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void DrawSurface(SourceSurface* aSurface, const Rect& aDest, + const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) override; + virtual void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override; virtual void DrawSurfaceWithShadow( - SourceSurface *aSurface, const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + SourceSurface* aSurface, const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) override { /* Not implemented */ MOZ_CRASH("GFX: DrawSurfaceWithShadow"); } - virtual void ClearRect(const Rect &aRect) override; + virtual void ClearRect(const Rect& aRect) override; virtual void MaskSurface( - const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; - - virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; - - virtual void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void PushClip(const Path *aPath) override; - virtual void PushClipRect(const Rect &aRect) override; + const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; + + virtual void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; + + virtual void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void PushClip(const Path* aPath) override; + virtual void PushClipRect(const Rect& aRect) override; virtual void PopClip() override; - virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) override; virtual void PushLayerWithBlend( - bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, const IntRect &aBounds = IntRect(), + bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, const IntRect& aBounds = IntRect(), bool aCopyBackground = false, CompositionOp = CompositionOp::OP_OVER) override; virtual void PopLayer() override; - virtual void SetTransform(const Matrix &aTransform) override; + virtual void SetTransform(const Matrix& aTransform) override; virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) override; virtual already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override { return mDrawTarget->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat); } virtual already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override { + SourceSurface* aSurface) const override { return mDrawTarget->OptimizeSourceSurface(aSurface); } virtual already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override { + const NativeSurface& aSurface) const override { return mDrawTarget->CreateSourceSurfaceFromNativeSurface(aSurface); } virtual already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override { + const IntSize& aSize, SurfaceFormat aFormat) const override { return mDrawTarget->CreateSimilarDrawTarget(aSize, aFormat); } virtual bool CanCreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override { + const IntSize& aSize, SurfaceFormat aFormat) const override { return mDrawTarget->CanCreateSimilarDrawTarget(aSize, aFormat); } @@ -159,7 +159,7 @@ class DrawTargetOffset : public DrawTarget { } virtual already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override { return mDrawTarget->CreateGradientStops(aStops, aNumStops, aExtendMode); } diff --git a/gfx/2d/DrawTargetRecording.cpp b/gfx/2d/DrawTargetRecording.cpp index f7e04a1fef0ee..684c5f668dabc 100644 --- a/gfx/2d/DrawTargetRecording.cpp +++ b/gfx/2d/DrawTargetRecording.cpp @@ -19,15 +19,15 @@ namespace mozilla { namespace gfx { struct RecordingSourceSurfaceUserData { - void *refPtr; + void* refPtr; RefPtr recorder; }; -static void RecordingSourceSurfaceUserDataFunc(void *aUserData) { - RecordingSourceSurfaceUserData *userData = - static_cast(aUserData); +static void RecordingSourceSurfaceUserDataFunc(void* aUserData) { + RecordingSourceSurfaceUserData* userData = + static_cast(aUserData); - userData->recorder->RemoveSourceSurface((SourceSurface *)userData->refPtr); + userData->recorder->RemoveSourceSurface((SourceSurface*)userData->refPtr); userData->recorder->RemoveStoredObject(userData->refPtr); userData->recorder->RecordEvent( RecordedSourceSurfaceDestruction(ReferencePtr(userData->refPtr))); @@ -35,9 +35,9 @@ static void RecordingSourceSurfaceUserDataFunc(void *aUserData) { delete userData; } -static void EnsureSurfaceStoredRecording(DrawEventRecorderPrivate *aRecorder, - SourceSurface *aSurface, - const char *reason) { +static void EnsureSurfaceStoredRecording(DrawEventRecorderPrivate* aRecorder, + SourceSurface* aSurface, + const char* reason) { if (aRecorder->HasStoredObject(aSurface)) { return; } @@ -46,10 +46,10 @@ static void EnsureSurfaceStoredRecording(DrawEventRecorderPrivate *aRecorder, aRecorder->AddStoredObject(aSurface); aRecorder->AddSourceSurface(aSurface); - RecordingSourceSurfaceUserData *userData = new RecordingSourceSurfaceUserData; + RecordingSourceSurfaceUserData* userData = new RecordingSourceSurfaceUserData; userData->refPtr = aSurface; userData->recorder = aRecorder; - aSurface->AddUserData(reinterpret_cast(aRecorder), userData, + aSurface->AddUserData(reinterpret_cast(aRecorder), userData, &RecordingSourceSurfaceUserDataFunc); } @@ -58,7 +58,7 @@ class SourceSurfaceRecording : public SourceSurface { MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceRecording, override) SourceSurfaceRecording(IntSize aSize, SurfaceFormat aFormat, - DrawEventRecorderPrivate *aRecorder) + DrawEventRecorderPrivate* aRecorder) : mSize(aSize), mFormat(aFormat), mRecorder(aRecorder) { mRecorder->AddStoredObject(this); } @@ -93,7 +93,7 @@ class DataSourceSurfaceRecording : public DataSourceSurface { ~DataSourceSurfaceRecording() {} - static already_AddRefed Init(uint8_t *aData, IntSize aSize, + static already_AddRefed Init(uint8_t* aData, IntSize aSize, int32_t aStride, SurfaceFormat aFormat) { // XXX: do we need to ensure any alignment here? @@ -111,7 +111,7 @@ class DataSourceSurfaceRecording : public DataSourceSurface { IntSize GetSize() const override { return mSize; } int32_t Stride() override { return mStride; } SurfaceFormat GetFormat() const override { return mFormat; } - uint8_t *GetData() override { return mData.get(); } + uint8_t* GetData() override { return mData.get(); } UniquePtr mData; IntSize mSize; @@ -123,7 +123,7 @@ class GradientStopsRecording : public GradientStops { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsRecording, override) - explicit GradientStopsRecording(DrawEventRecorderPrivate *aRecorder) + explicit GradientStopsRecording(DrawEventRecorderPrivate* aRecorder) : mRecorder(aRecorder) { mRecorder->AddStoredObject(this); } @@ -144,7 +144,7 @@ class FilterNodeRecording : public FilterNode { MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeRecording, override) using FilterNode::SetAttribute; - explicit FilterNodeRecording(DrawEventRecorderPrivate *aRecorder) + explicit FilterNodeRecording(DrawEventRecorderPrivate* aRecorder) : mRecorder(aRecorder) { mRecorder->AddStoredObject(this); } @@ -154,12 +154,12 @@ class FilterNodeRecording : public FilterNode { mRecorder->RecordEvent(RecordedFilterNodeDestruction(ReferencePtr(this))); } - void SetInput(uint32_t aIndex, SourceSurface *aSurface) override { + void SetInput(uint32_t aIndex, SourceSurface* aSurface) override { EnsureSurfaceStoredRecording(mRecorder, aSurface, "SetInput"); mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aSurface)); } - void SetInput(uint32_t aIndex, FilterNode *aFilter) override { + void SetInput(uint32_t aIndex, FilterNode* aFilter) override { MOZ_ASSERT(mRecorder->HasStoredObject(aFilter)); mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aFilter)); @@ -175,20 +175,20 @@ class FilterNodeRecording : public FilterNode { FORWARD_SET_ATTRIBUTE(bool, BOOL); FORWARD_SET_ATTRIBUTE(uint32_t, UINT32); FORWARD_SET_ATTRIBUTE(Float, FLOAT); - FORWARD_SET_ATTRIBUTE(const Size &, SIZE); - FORWARD_SET_ATTRIBUTE(const IntSize &, INTSIZE); - FORWARD_SET_ATTRIBUTE(const IntPoint &, INTPOINT); - FORWARD_SET_ATTRIBUTE(const Rect &, RECT); - FORWARD_SET_ATTRIBUTE(const IntRect &, INTRECT); - FORWARD_SET_ATTRIBUTE(const Point &, POINT); - FORWARD_SET_ATTRIBUTE(const Matrix &, MATRIX); - FORWARD_SET_ATTRIBUTE(const Matrix5x4 &, MATRIX5X4); - FORWARD_SET_ATTRIBUTE(const Point3D &, POINT3D); - FORWARD_SET_ATTRIBUTE(const Color &, COLOR); + FORWARD_SET_ATTRIBUTE(const Size&, SIZE); + FORWARD_SET_ATTRIBUTE(const IntSize&, INTSIZE); + FORWARD_SET_ATTRIBUTE(const IntPoint&, INTPOINT); + FORWARD_SET_ATTRIBUTE(const Rect&, RECT); + FORWARD_SET_ATTRIBUTE(const IntRect&, INTRECT); + FORWARD_SET_ATTRIBUTE(const Point&, POINT); + FORWARD_SET_ATTRIBUTE(const Matrix&, MATRIX); + FORWARD_SET_ATTRIBUTE(const Matrix5x4&, MATRIX5X4); + FORWARD_SET_ATTRIBUTE(const Point3D&, POINT3D); + FORWARD_SET_ATTRIBUTE(const Color&, COLOR); #undef FORWARD_SET_ATTRIBUTE - void SetAttribute(uint32_t aIndex, const Float *aFloat, + void SetAttribute(uint32_t aIndex, const Float* aFloat, uint32_t aSize) override { mRecorder->RecordEvent( RecordedFilterNodeSetAttribute(this, aIndex, aFloat, aSize)); @@ -199,10 +199,10 @@ class FilterNodeRecording : public FilterNode { RefPtr mRecorder; }; -DrawTargetRecording::DrawTargetRecording(DrawEventRecorder *aRecorder, - DrawTarget *aDT, IntSize aSize, +DrawTargetRecording::DrawTargetRecording(DrawEventRecorder* aRecorder, + DrawTarget* aDT, IntSize aSize, bool aHasData) - : mRecorder(static_cast(aRecorder)), + : mRecorder(static_cast(aRecorder)), mFinalDT(aDT), mSize(aSize) { RefPtr snapshot = aHasData ? mFinalDT->Snapshot() : nullptr; @@ -212,7 +212,7 @@ DrawTargetRecording::DrawTargetRecording(DrawEventRecorder *aRecorder, mFormat = mFinalDT->GetFormat(); } -DrawTargetRecording::DrawTargetRecording(const DrawTargetRecording *aDT, +DrawTargetRecording::DrawTargetRecording(const DrawTargetRecording* aDT, IntSize aSize, SurfaceFormat aFormat) : mRecorder(aDT->mRecorder), mFinalDT(aDT->mFinalDT), mSize(aSize) { mFormat = aFormat; @@ -222,34 +222,34 @@ DrawTargetRecording::~DrawTargetRecording() { mRecorder->RecordEvent(RecordedDrawTargetDestruction(ReferencePtr(this))); } -void DrawTargetRecording::FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetRecording::FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aPattern); mRecorder->RecordEvent(RecordedFillRect(this, aRect, aPattern, aOptions)); } -void DrawTargetRecording::StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetRecording::StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aPattern); mRecorder->RecordEvent( RecordedStrokeRect(this, aRect, aPattern, aStrokeOptions, aOptions)); } -void DrawTargetRecording::StrokeLine(const Point &aBegin, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetRecording::StrokeLine(const Point& aBegin, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aPattern); mRecorder->RecordEvent(RecordedStrokeLine(this, aBegin, aEnd, aPattern, aStrokeOptions, aOptions)); } -void DrawTargetRecording::Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetRecording::Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions) { RefPtr pathRecording = EnsurePathStored(aPath); EnsurePatternDependenciesStored(aPattern); @@ -257,31 +257,31 @@ void DrawTargetRecording::Fill(const Path *aPath, const Pattern &aPattern, } struct RecordingFontUserData { - void *refPtr; + void* refPtr; RefPtr recorder; }; -static void RecordingFontUserDataDestroyFunc(void *aUserData) { - RecordingFontUserData *userData = - static_cast(aUserData); +static void RecordingFontUserDataDestroyFunc(void* aUserData) { + RecordingFontUserData* userData = + static_cast(aUserData); userData->recorder->RecordEvent( RecordedScaledFontDestruction(ReferencePtr(userData->refPtr))); - userData->recorder->RemoveScaledFont((ScaledFont *)userData->refPtr); + userData->recorder->RemoveScaledFont((ScaledFont*)userData->refPtr); delete userData; } -void DrawTargetRecording::FillGlyphs(ScaledFont *aFont, - const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetRecording::FillGlyphs(ScaledFont* aFont, + const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aPattern); - UserDataKey *userDataKey = reinterpret_cast(mRecorder.get()); + UserDataKey* userDataKey = reinterpret_cast(mRecorder.get()); if (mRecorder->WantsExternalFonts()) { mRecorder->AddScaledFont(aFont); } else if (!aFont->GetUserData(userDataKey)) { - UnscaledFont *unscaledFont = aFont->GetUnscaledFont(); + UnscaledFont* unscaledFont = aFont->GetUnscaledFont(); if (!mRecorder->HasStoredObject(unscaledFont)) { RecordedFontData fontData(unscaledFont); RecordedFontDetails fontDetails; @@ -308,7 +308,7 @@ void DrawTargetRecording::FillGlyphs(ScaledFont *aFont, mRecorder->AddStoredObject(unscaledFont); } mRecorder->RecordEvent(RecordedScaledFontCreation(aFont, unscaledFont)); - RecordingFontUserData *userData = new RecordingFontUserData; + RecordingFontUserData* userData = new RecordingFontUserData; userData->refPtr = aFont; userData->recorder = mRecorder; aFont->AddUserData(userDataKey, userData, @@ -320,17 +320,17 @@ void DrawTargetRecording::FillGlyphs(ScaledFont *aFont, this, aFont, aPattern, aOptions, aBuffer.mGlyphs, aBuffer.mNumGlyphs)); } -void DrawTargetRecording::Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions) { +void DrawTargetRecording::Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aSource); EnsurePatternDependenciesStored(aMask); mRecorder->RecordEvent(RecordedMask(this, aSource, aMask, aOptions)); } -void DrawTargetRecording::MaskSurface(const Pattern &aSource, - SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions) { +void DrawTargetRecording::MaskSurface(const Pattern& aSource, + SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aSource); EnsureSurfaceStoredRecording(mRecorder, aMask, "MaskSurface"); @@ -338,9 +338,9 @@ void DrawTargetRecording::MaskSurface(const Pattern &aSource, RecordedMaskSurface(this, aSource, aMask, aOffset, aOptions)); } -void DrawTargetRecording::Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetRecording::Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { RefPtr pathRecording = EnsurePathStored(aPath); EnsurePatternDependenciesStored(aPattern); @@ -370,10 +370,10 @@ already_AddRefed DrawTargetRecording::IntoLuminanceSource( void DrawTargetRecording::DetachAllSnapshots() {} -void DrawTargetRecording::DrawSurface(SourceSurface *aSurface, - const Rect &aDest, const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) { +void DrawTargetRecording::DrawSurface(SourceSurface* aSurface, + const Rect& aDest, const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) { EnsureSurfaceStoredRecording(mRecorder, aSurface, "DrawSurface"); mRecorder->RecordEvent(RecordedDrawSurface(this, aSurface, aDest, aSource, @@ -381,25 +381,25 @@ void DrawTargetRecording::DrawSurface(SourceSurface *aSurface, } void DrawTargetRecording::DrawDependentSurface( - uint64_t aId, const Rect &aDest, const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) { + uint64_t aId, const Rect& aDest, const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) { mRecorder->AddDependentSurface(aId); mRecorder->RecordEvent( RecordedDrawDependentSurface(this, aId, aDest, aSurfOptions, aOptions)); } void DrawTargetRecording::DrawSurfaceWithShadow( - SourceSurface *aSurface, const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, CompositionOp aOp) { + SourceSurface* aSurface, const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOp) { EnsureSurfaceStoredRecording(mRecorder, aSurface, "DrawSurfaceWithShadow"); mRecorder->RecordEvent(RecordedDrawSurfaceWithShadow( this, aSurface, aDest, aColor, aOffset, aSigma, aOp)); } -void DrawTargetRecording::DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions) { +void DrawTargetRecording::DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions) { MOZ_ASSERT(mRecorder->HasStoredObject(aNode)); mRecorder->RecordEvent( @@ -415,37 +415,37 @@ already_AddRefed DrawTargetRecording::CreateFilter( return retNode.forget(); } -void DrawTargetRecording::ClearRect(const Rect &aRect) { +void DrawTargetRecording::ClearRect(const Rect& aRect) { mRecorder->RecordEvent(RecordedClearRect(this, aRect)); } -void DrawTargetRecording::CopySurface(SourceSurface *aSurface, - const IntRect &aSourceRect, - const IntPoint &aDestination) { +void DrawTargetRecording::CopySurface(SourceSurface* aSurface, + const IntRect& aSourceRect, + const IntPoint& aDestination) { EnsureSurfaceStoredRecording(mRecorder, aSurface, "CopySurface"); mRecorder->RecordEvent( RecordedCopySurface(this, aSurface, aSourceRect, aDestination)); } -void DrawTargetRecording::PushClip(const Path *aPath) { +void DrawTargetRecording::PushClip(const Path* aPath) { RefPtr pathRecording = EnsurePathStored(aPath); mRecorder->RecordEvent(RecordedPushClip(this, pathRecording)); } -void DrawTargetRecording::PushClipRect(const Rect &aRect) { +void DrawTargetRecording::PushClipRect(const Rect& aRect) { mRecorder->RecordEvent(RecordedPushClipRect(this, aRect)); } void DrawTargetRecording::PopClip() { - mRecorder->RecordEvent(RecordedPopClip(static_cast(this))); + mRecorder->RecordEvent(RecordedPopClip(static_cast(this))); } void DrawTargetRecording::PushLayer(bool aOpaque, Float aOpacity, - SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds, + SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds, bool aCopyBackground) { if (aMask) { EnsureSurfaceStoredRecording(mRecorder, aMask, "PushLayer"); @@ -457,9 +457,9 @@ void DrawTargetRecording::PushLayer(bool aOpaque, Float aOpacity, } void DrawTargetRecording::PushLayerWithBlend(bool aOpaque, Float aOpacity, - SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds, + SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds, bool aCopyBackground, CompositionOp aCompositionOp) { if (aMask) { @@ -472,12 +472,12 @@ void DrawTargetRecording::PushLayerWithBlend(bool aOpaque, Float aOpacity, } void DrawTargetRecording::PopLayer() { - mRecorder->RecordEvent(RecordedPopLayer(static_cast(this))); + mRecorder->RecordEvent(RecordedPopLayer(static_cast(this))); } already_AddRefed -DrawTargetRecording::CreateSourceSurfaceFromData(unsigned char *aData, - const IntSize &aSize, +DrawTargetRecording::CreateSourceSurfaceFromData(unsigned char* aData, + const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const { RefPtr surf = @@ -493,20 +493,20 @@ DrawTargetRecording::CreateSourceSurfaceFromData(unsigned char *aData, } already_AddRefed DrawTargetRecording::OptimizeSourceSurface( - SourceSurface *aSurface) const { + SourceSurface* aSurface) const { RefPtr surf(aSurface); return surf.forget(); } already_AddRefed DrawTargetRecording::CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const { + const NativeSurface& aSurface) const { MOZ_ASSERT(false); return nullptr; } already_AddRefed DrawTargetRecording::CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const { + const IntSize& aSize, SurfaceFormat aFormat) const { RefPtr similarDT; if (mFinalDT->CanCreateSimilarDrawTarget(aSize, aFormat)) { similarDT = new DrawTargetRecording(this, aSize, aFormat); @@ -525,12 +525,12 @@ already_AddRefed DrawTargetRecording::CreateSimilarDrawTarget( } bool DrawTargetRecording::CanCreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const { + const IntSize& aSize, SurfaceFormat aFormat) const { return mFinalDT->CanCreateSimilarDrawTarget(aSize, aFormat); } RefPtr DrawTargetRecording::CreateClippedDrawTarget( - const IntSize &aMaxSize, const Matrix &aTransform, + const IntSize& aMaxSize, const Matrix& aTransform, SurfaceFormat aFormat) const { RefPtr similarDT; if (mFinalDT->CanCreateSimilarDrawTarget(aMaxSize, aFormat)) { @@ -548,8 +548,8 @@ RefPtr DrawTargetRecording::CreateClippedDrawTarget( already_AddRefed DrawTargetRecording::CreateSimilarDrawTargetForFilter( - const IntSize &aMaxSize, SurfaceFormat aFormat, FilterNode *aFilter, - FilterNode *aSource, const Rect &aSourceRect, const Point &aDestPoint) { + const IntSize& aMaxSize, SurfaceFormat aFormat, FilterNode* aFilter, + FilterNode* aSource, const Rect& aSourceRect, const Point& aDestPoint) { RefPtr similarDT; if (mFinalDT->CanCreateSimilarDrawTarget(aMaxSize, aFormat)) { similarDT = new DrawTargetRecording(this, aMaxSize, aFormat); @@ -572,7 +572,7 @@ already_AddRefed DrawTargetRecording::CreatePathBuilder( } already_AddRefed DrawTargetRecording::CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode) const { + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode) const { RefPtr retStops = new GradientStopsRecording(mRecorder); mRecorder->RecordEvent( @@ -581,17 +581,17 @@ already_AddRefed DrawTargetRecording::CreateGradientStops( return retStops.forget(); } -void DrawTargetRecording::SetTransform(const Matrix &aTransform) { +void DrawTargetRecording::SetTransform(const Matrix& aTransform) { mRecorder->RecordEvent(RecordedSetTransform(this, aTransform)); DrawTarget::SetTransform(aTransform); } already_AddRefed DrawTargetRecording::EnsurePathStored( - const Path *aPath) { + const Path* aPath) { RefPtr pathRecording; if (aPath->GetBackendType() == BackendType::RECORDING) { pathRecording = - const_cast(static_cast(aPath)); + const_cast(static_cast(aPath)); if (mRecorder->HasStoredObject(aPath)) { return pathRecording.forget(); } @@ -614,7 +614,7 @@ already_AddRefed DrawTargetRecording::EnsurePathStored( // This should only be called on the 'root' DrawTargetRecording. // Calling it on a child DrawTargetRecordings will cause confusion. -void DrawTargetRecording::FlushItem(const IntRect &aBounds) { +void DrawTargetRecording::FlushItem(const IntRect& aBounds) { mRecorder->FlushItem(aBounds); // Reinitialize the recorder (FlushItem will write a new recording header) // Tell the new recording about our draw target @@ -628,24 +628,23 @@ void DrawTargetRecording::FlushItem(const IntRect &aBounds) { } void DrawTargetRecording::EnsurePatternDependenciesStored( - const Pattern &aPattern) { + const Pattern& aPattern) { switch (aPattern.GetType()) { case PatternType::COLOR: // No dependencies here. return; case PatternType::LINEAR_GRADIENT: { MOZ_ASSERT(mRecorder->HasStoredObject( - static_cast(&aPattern)->mStops)); + static_cast(&aPattern)->mStops)); return; } case PatternType::RADIAL_GRADIENT: { MOZ_ASSERT(mRecorder->HasStoredObject( - static_cast(&aPattern)->mStops)); + static_cast(&aPattern)->mStops)); return; } case PatternType::SURFACE: { - const SurfacePattern *pat = - static_cast(&aPattern); + const SurfacePattern* pat = static_cast(&aPattern); EnsureSurfaceStoredRecording(mRecorder, pat->mSurface, "EnsurePatternDependenciesStored"); return; diff --git a/gfx/2d/DrawTargetRecording.h b/gfx/2d/DrawTargetRecording.h index d7f1cecdea6b4..6578925bfe10a 100644 --- a/gfx/2d/DrawTargetRecording.h +++ b/gfx/2d/DrawTargetRecording.h @@ -16,7 +16,7 @@ namespace gfx { class DrawTargetRecording : public DrawTarget { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetRecording, override) - DrawTargetRecording(DrawEventRecorder *aRecorder, DrawTarget *aDT, + DrawTargetRecording(DrawEventRecorder* aRecorder, DrawTarget* aDT, IntSize aSize, bool aHasData = false); ~DrawTargetRecording(); @@ -43,7 +43,7 @@ class DrawTargetRecording : public DrawTarget { */ virtual void Flush() override { mFinalDT->Flush(); } - virtual void FlushItem(const IntRect &aBounds) override; + virtual void FlushItem(const IntRect& aBounds) override; /* * Draw a surface to the draw target. Possibly doing partial drawing or @@ -57,18 +57,18 @@ class DrawTargetRecording : public DrawTarget { * aSurfOptions DrawSurface options that are applied */ virtual void DrawSurface( - SourceSurface *aSurface, const Rect &aDest, const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + SourceSurface* aSurface, const Rect& aDest, const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions = DrawSurfaceOptions(), + const DrawOptions& aOptions = DrawOptions()) override; virtual void DrawDependentSurface( - uint64_t aId, const Rect &aDest, - const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + uint64_t aId, const Rect& aDest, + const DrawSurfaceOptions& aSurfOptions = DrawSurfaceOptions(), + const DrawOptions& aOptions = DrawOptions()) override; - virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override; /* * Blend a surface to the draw target with a shadow. The shadow is drawn as a @@ -84,9 +84,9 @@ class DrawTargetRecording : public DrawTarget { * aSigma Sigma used for the guassian filter kernel * aOperator Composition operator used */ - virtual void DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + virtual void DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) override; /* @@ -95,7 +95,7 @@ class DrawTargetRecording : public DrawTarget { * * aRect Rectangle to clear */ - virtual void ClearRect(const Rect &aRect) override; + virtual void ClearRect(const Rect& aRect) override; /* * This is essentially a 'memcpy' between two surfaces. It moves a pixel @@ -106,8 +106,8 @@ class DrawTargetRecording : public DrawTarget { * aSourceRect Source rectangle to be copied * aDest Destination point to copy the surface to */ - virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; + virtual void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; /* * Fill a rectangle on the DrawTarget with a certain source pattern. @@ -116,8 +116,8 @@ class DrawTargetRecording : public DrawTarget { * aPattern Pattern that forms the source of this filling operation * aOptions Options that are applied to this operation */ - virtual void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; /* * Stroke a rectangle on the DrawTarget with a certain source pattern. @@ -126,9 +126,9 @@ class DrawTargetRecording : public DrawTarget { * aPattern Pattern that forms the source of this stroking operation * aOptions Options that are applied to this operation */ - virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + virtual void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; /* * Stroke a line on the DrawTarget with a certain source pattern. @@ -138,10 +138,10 @@ class DrawTargetRecording : public DrawTarget { * aPattern Pattern that forms the source of this stroking operation * aOptions Options that are applied to this operation */ - virtual void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + virtual void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; /* * Stroke a path on the draw target with a certain source pattern. @@ -151,9 +151,9 @@ class DrawTargetRecording : public DrawTarget { * aStrokeOptions Stroke options used for this operation * aOptions Draw options used for this operation */ - virtual void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + virtual void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; /* * Fill a path on the draw target with a certain source pattern. @@ -162,15 +162,15 @@ class DrawTargetRecording : public DrawTarget { * aPattern Pattern that should be used for the fill * aOptions Draw options used for this operation */ - virtual void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; /* * Fill a series of clyphs on the draw target with a certain source pattern. */ - virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; /* * This takes a source pattern and a mask, and composites the source pattern @@ -181,19 +181,19 @@ class DrawTargetRecording : public DrawTarget { * aMask Mask pattern * aOptions Drawing options */ - virtual void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) override; virtual void MaskSurface( - const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; + const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; /* * Push a clip to the DrawTarget. * * aPath The path to clip to */ - virtual void PushClip(const Path *aPath) override; + virtual void PushClip(const Path* aPath) override; /* * Push an axis-aligned rectangular clip to the DrawTarget. This rectangle @@ -201,7 +201,7 @@ class DrawTargetRecording : public DrawTarget { * * aRect The rect to clip to */ - virtual void PushClipRect(const Rect &aRect) override; + virtual void PushClipRect(const Rect& aRect) override; /* Pop a clip from the DrawTarget. A pop without a corresponding push will * be ignored. @@ -224,9 +224,9 @@ class DrawTargetRecording : public DrawTarget { * @param aCopyBackground Whether to copy the background into the layer, this * is only supported when aOpaque is true. */ - virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) override; /** @@ -248,8 +248,8 @@ class DrawTargetRecording : public DrawTarget { * the destination */ virtual void PushLayerWithBlend( - bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, const IntRect &aBounds = IntRect(), + bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, const IntRect& aBounds = IntRect(), bool aCopyBackground = false, CompositionOp aCompositionOp = CompositionOp::OP_OVER) override; @@ -268,7 +268,7 @@ class DrawTargetRecording : public DrawTarget { * time. */ virtual already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override; /* @@ -277,7 +277,7 @@ class DrawTargetRecording : public DrawTarget { * other existing surface. */ virtual already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override; + SourceSurface* aSurface) const override; /* * Create a SourceSurface for a type of NativeSurface. This may fail if the @@ -285,29 +285,29 @@ class DrawTargetRecording : public DrawTarget { * in. */ virtual already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override; + const NativeSurface& aSurface) const override; /* * Create a DrawTarget whose snapshot is optimized for use with this * DrawTarget. */ virtual already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override; + const IntSize& aSize, SurfaceFormat aFormat) const override; - bool CanCreateSimilarDrawTarget(const IntSize &aSize, + bool CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const override; /** * Create a similar DrawTarget whose requested size may be clipped based * on this DrawTarget's rect transformed to the new target's space. */ virtual RefPtr CreateClippedDrawTarget( - const IntSize &aMaxSize, const Matrix &aTransform, + const IntSize& aMaxSize, const Matrix& aTransform, SurfaceFormat aFormat) const override; virtual already_AddRefed CreateSimilarDrawTargetForFilter( - const IntSize &aSize, SurfaceFormat aFormat, FilterNode *aFilter, - FilterNode *aSource, const Rect &aSourceRect, - const Point &aDestPoint) override; + const IntSize& aSize, SurfaceFormat aFormat, FilterNode* aFilter, + FilterNode* aSource, const Rect& aSourceRect, + const Point& aDestPoint) override; /* * Create a path builder with the specified fillmode. * @@ -329,7 +329,7 @@ class DrawTargetRecording : public DrawTarget { * gradient area. */ virtual already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; virtual already_AddRefed CreateFilter(FilterType aType) override; @@ -338,12 +338,12 @@ class DrawTargetRecording : public DrawTarget { * Set a transform on the surface, this transform is applied at drawing time * to both the mask and source of the operation. */ - virtual void SetTransform(const Matrix &aTransform) override; + virtual void SetTransform(const Matrix& aTransform) override; /* Tries to get a native surface for a DrawTarget, this may fail if the * draw target cannot convert to this surface type. */ - virtual void *GetNativeSurface(NativeSurfaceType aType) override { + virtual void* GetNativeSurface(NativeSurfaceType aType) override { return mFinalDT->GetNativeSurface(aType); } @@ -359,12 +359,12 @@ class DrawTargetRecording : public DrawTarget { * @param aSize size of the the similar DrawTarget * @param aFormat format of the similar DrawTarget */ - DrawTargetRecording(const DrawTargetRecording *aDT, IntSize aSize, + DrawTargetRecording(const DrawTargetRecording* aDT, IntSize aSize, SurfaceFormat aFormat); - Path *GetPathForPathRecording(const Path *aPath) const; - already_AddRefed EnsurePathStored(const Path *aPath); - void EnsurePatternDependenciesStored(const Pattern &aPattern); + Path* GetPathForPathRecording(const Path* aPath) const; + already_AddRefed EnsurePathStored(const Path* aPath); + void EnsurePatternDependenciesStored(const Pattern& aPattern); RefPtr mRecorder; RefPtr mFinalDT; diff --git a/gfx/2d/DrawTargetSkia.h b/gfx/2d/DrawTargetSkia.h index bb9b150e01fca..86c28c63773af 100644 --- a/gfx/2d/DrawTargetSkia.h +++ b/gfx/2d/DrawTargetSkia.h @@ -39,96 +39,96 @@ class DrawTargetSkia : public DrawTarget { } virtual already_AddRefed Snapshot() override; virtual IntSize GetSize() const override { return mSize; }; - virtual bool LockBits(uint8_t **aData, IntSize *aSize, int32_t *aStride, - SurfaceFormat *aFormat, - IntPoint *aOrigin = nullptr) override; - virtual void ReleaseBits(uint8_t *aData) override; + virtual bool LockBits(uint8_t** aData, IntSize* aSize, int32_t* aStride, + SurfaceFormat* aFormat, + IntPoint* aOrigin = nullptr) override; + virtual void ReleaseBits(uint8_t* aData) override; virtual void Flush() override; virtual void DrawSurface( - SourceSurface *aSurface, const Rect &aDest, const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + SourceSurface* aSurface, const Rect& aDest, const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions = DrawSurfaceOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) override; - virtual void ClearRect(const Rect &aRect) override; - virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; - virtual void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - - virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void ClearRect(const Rect& aRect) override; + virtual void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; + virtual void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + virtual void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + + virtual void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; virtual void StrokeGlyphs( - ScaledFont *aFont, const GlyphBuffer &aBuffer, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - virtual void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) override; + ScaledFont* aFont, const GlyphBuffer& aBuffer, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + virtual void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) override; virtual void MaskSurface( - const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; - virtual bool Draw3DTransformedSurface(SourceSurface *aSurface, - const Matrix4x4 &aMatrix) override; - virtual void PushClip(const Path *aPath) override; - virtual void PushClipRect(const Rect &aRect) override; - virtual void PushDeviceSpaceClipRects(const IntRect *aRects, + const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; + virtual bool Draw3DTransformedSurface(SourceSurface* aSurface, + const Matrix4x4& aMatrix) override; + virtual void PushClip(const Path* aPath) override; + virtual void PushClipRect(const Rect& aRect) override; + virtual void PushDeviceSpaceClipRects(const IntRect* aRects, uint32_t aCount) override; virtual void PopClip() override; - virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) override; virtual void PushLayerWithBlend( - bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, const IntRect &aBounds = IntRect(), + bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, const IntRect& aBounds = IntRect(), bool aCopyBackground = false, CompositionOp aCompositionOp = CompositionOp::OP_OVER) override; virtual void PopLayer() override; virtual already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override; virtual already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override; + SourceSurface* aSurface) const override; virtual already_AddRefed OptimizeSourceSurfaceForUnknownAlpha( - SourceSurface *aSurface) const override; + SourceSurface* aSurface) const override; virtual already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override; + const NativeSurface& aSurface) const override; virtual already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override; - virtual bool CanCreateSimilarDrawTarget(const IntSize &aSize, + const IntSize& aSize, SurfaceFormat aFormat) const override; + virtual bool CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const override; virtual already_AddRefed CreatePathBuilder( FillRule aFillRule = FillRule::FILL_WINDING) const override; virtual already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; virtual already_AddRefed CreateFilter(FilterType aType) override; - virtual void SetTransform(const Matrix &aTransform) override; - virtual void *GetNativeSurface(NativeSurfaceType aType) override; + virtual void SetTransform(const Matrix& aTransform) override; + virtual void* GetNativeSurface(NativeSurfaceType aType) override; virtual void DetachAllSnapshots() override { MarkChanged(); } - bool Init(const IntSize &aSize, SurfaceFormat aFormat); - bool Init(unsigned char *aData, const IntSize &aSize, int32_t aStride, + bool Init(const IntSize& aSize, SurfaceFormat aFormat); + bool Init(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat, bool aUninitialized = false); - bool Init(SkCanvas *aCanvas); + bool Init(SkCanvas* aCanvas); // Skia assumes that texture sizes fit in 16-bit signed integers. static size_t GetMaxSurfaceSize() { return 32767; } @@ -146,13 +146,13 @@ class DrawTargetSkia : public DrawTarget { bool ShouldLCDRenderText(FontType aFontType, AntialiasMode aAntialiasMode); - void DrawGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const StrokeOptions *aStrokeOptions = nullptr, - const DrawOptions &aOptions = DrawOptions()); + void DrawGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const StrokeOptions* aStrokeOptions = nullptr, + const DrawOptions& aOptions = DrawOptions()); struct PushedLayer { - PushedLayer(bool aOldPermitSubpixelAA, SourceSurface *aMask) + PushedLayer(bool aOldPermitSubpixelAA, SourceSurface* aMask) : mOldPermitSubpixelAA(aOldPermitSubpixelAA), mMask(aMask) {} bool mOldPermitSubpixelAA; RefPtr mMask; @@ -161,22 +161,22 @@ class DrawTargetSkia : public DrawTarget { IntSize mSize; sk_sp mSurface; - SkCanvas *mCanvas; + SkCanvas* mCanvas; RefPtr mSnapshot; Mutex mSnapshotLock; #ifdef MOZ_WIDGET_COCOA friend class BorrowedCGContext; - CGContextRef BorrowCGContext(const DrawOptions &aOptions); + CGContextRef BorrowCGContext(const DrawOptions& aOptions); void ReturnCGContext(CGContextRef); - bool FillGlyphsWithCG(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()); + bool FillGlyphsWithCG(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()); CGContextRef mCG; CGColorSpaceRef mColorSpace; - uint8_t *mCanvasData; + uint8_t* mCanvasData; IntSize mCGSize; bool mNeedLayer; #endif diff --git a/gfx/2d/DrawTargetTiled.h b/gfx/2d/DrawTargetTiled.h index 5b6d80539fab0..110ffa647f8ae 100644 --- a/gfx/2d/DrawTargetTiled.h +++ b/gfx/2d/DrawTargetTiled.h @@ -22,7 +22,7 @@ namespace gfx { struct TileInternal : public Tile { TileInternal() : mClippedOut(false) {} - explicit TileInternal(const Tile &aOther) + explicit TileInternal(const Tile& aOther) : Tile(aOther), mClippedOut(false) {} bool mClippedOut; @@ -32,7 +32,7 @@ class DrawTargetTiled : public DrawTarget { public: DrawTargetTiled(); - bool Init(const TileSet &mTiles); + bool Init(const TileSet& mTiles); bool IsTiledDrawTarget() const override { return true; } @@ -54,88 +54,88 @@ class DrawTargetTiled : public DrawTarget { IntRect GetRect() const override { return mRect; } void Flush() override; - void DrawSurface(SourceSurface *aSurface, const Rect &aDest, - const Rect &aSource, const DrawSurfaceOptions &aSurfOptions, - const DrawOptions &aOptions) override; - void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override; + void DrawSurface(SourceSurface* aSurface, const Rect& aDest, + const Rect& aSource, const DrawSurfaceOptions& aSurfOptions, + const DrawOptions& aOptions) override; + void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override; void DrawSurfaceWithShadow( - SourceSurface *aSurface, const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + SourceSurface* aSurface, const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) override { /* Not implemented */ MOZ_CRASH("GFX: DrawSurfaceWithShadow"); } - void ClearRect(const Rect &aRect) override; - void MaskSurface(const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; - - void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; - - void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; - void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; - void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) override; - void PushClip(const Path *aPath) override; - void PushClipRect(const Rect &aRect) override; + void ClearRect(const Rect& aRect) override; + void MaskSurface(const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; + + void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; + + void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; + void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; + void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) override; + void PushClip(const Path* aPath) override; + void PushClipRect(const Rect& aRect) override; void PopClip() override; - void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) override; - void PushLayerWithBlend(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + void PushLayerWithBlend(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false, CompositionOp = CompositionOp::OP_OVER) override; void PopLayer() override; - void PadEdges(const IntRegion &aRegion) override; + void PadEdges(const IntRegion& aRegion) override; - void SetTransform(const Matrix &aTransform) override; + void SetTransform(const Matrix& aTransform) override; void SetPermitSubpixelAA(bool aPermitSubpixelAA) override; already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override { return mTiles[0].mDrawTarget->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat); } already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override { + SourceSurface* aSurface) const override { return mTiles[0].mDrawTarget->OptimizeSourceSurface(aSurface); } already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override { + const NativeSurface& aSurface) const override { return mTiles[0].mDrawTarget->CreateSourceSurfaceFromNativeSurface( aSurface); } already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override { + const IntSize& aSize, SurfaceFormat aFormat) const override { return mTiles[0].mDrawTarget->CreateSimilarDrawTarget(aSize, aFormat); } - bool CanCreateSimilarDrawTarget(const IntSize &aSize, + bool CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const override { return mTiles[0].mDrawTarget->CanCreateSimilarDrawTarget(aSize, aFormat); } @@ -146,7 +146,7 @@ class DrawTargetTiled : public DrawTarget { } already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override { return mTiles[0].mDrawTarget->CreateGradientStops(aStops, aNumStops, aExtendMode); @@ -175,7 +175,7 @@ class DrawTargetTiled : public DrawTarget { class SnapshotTiled : public SourceSurface { public: - SnapshotTiled(const std::vector &aTiles, const IntRect &aRect) + SnapshotTiled(const std::vector& aTiles, const IntRect& aRect) : mRect(aRect) { for (size_t i = 0; i < aTiles.size(); i++) { mSnapshots.push_back(aTiles[i].mDrawTarget->Snapshot()); diff --git a/gfx/2d/DrawTargetWrapAndRecord.cpp b/gfx/2d/DrawTargetWrapAndRecord.cpp index f447482315015..be4e3c602061c 100644 --- a/gfx/2d/DrawTargetWrapAndRecord.cpp +++ b/gfx/2d/DrawTargetWrapAndRecord.cpp @@ -19,15 +19,15 @@ namespace mozilla { namespace gfx { struct WrapAndRecordSourceSurfaceUserData { - void *refPtr; + void* refPtr; RefPtr recorder; }; -static void WrapAndRecordSourceSurfaceUserDataFunc(void *aUserData) { - WrapAndRecordSourceSurfaceUserData *userData = - static_cast(aUserData); +static void WrapAndRecordSourceSurfaceUserDataFunc(void* aUserData) { + WrapAndRecordSourceSurfaceUserData* userData = + static_cast(aUserData); - userData->recorder->RemoveSourceSurface((SourceSurface *)userData->refPtr); + userData->recorder->RemoveSourceSurface((SourceSurface*)userData->refPtr); userData->recorder->RemoveStoredObject(userData->refPtr); userData->recorder->RecordEvent( RecordedSourceSurfaceDestruction(ReferencePtr(userData->refPtr))); @@ -35,10 +35,10 @@ static void WrapAndRecordSourceSurfaceUserDataFunc(void *aUserData) { delete userData; } -static void StoreSourceSurface(DrawEventRecorderPrivate *aRecorder, - SourceSurface *aSurface, - DataSourceSurface *aDataSurf, - const char *reason) { +static void StoreSourceSurface(DrawEventRecorderPrivate* aRecorder, + SourceSurface* aSurface, + DataSourceSurface* aDataSurf, + const char* reason) { if (!aDataSurf) { gfxWarning() << "Recording failed to record SourceSurface for " << reason; // Insert a bogus source surface. @@ -57,8 +57,8 @@ static void StoreSourceSurface(DrawEventRecorderPrivate *aRecorder, } } -static void EnsureSurfaceStored(DrawEventRecorderPrivate *aRecorder, - SourceSurface *aSurface, const char *reason) { +static void EnsureSurfaceStored(DrawEventRecorderPrivate* aRecorder, + SourceSurface* aSurface, const char* reason) { if (aRecorder->HasStoredObject(aSurface)) { return; } @@ -68,11 +68,11 @@ static void EnsureSurfaceStored(DrawEventRecorderPrivate *aRecorder, aRecorder->AddStoredObject(aSurface); aRecorder->AddSourceSurface(aSurface); - WrapAndRecordSourceSurfaceUserData *userData = + WrapAndRecordSourceSurfaceUserData* userData = new WrapAndRecordSourceSurfaceUserData; userData->refPtr = aSurface; userData->recorder = aRecorder; - aSurface->AddUserData(reinterpret_cast(aRecorder), userData, + aSurface->AddUserData(reinterpret_cast(aRecorder), userData, &WrapAndRecordSourceSurfaceUserDataFunc); } @@ -80,8 +80,8 @@ class SourceSurfaceWrapAndRecord : public SourceSurface { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceWrapAndRecord, override) - SourceSurfaceWrapAndRecord(SourceSurface *aFinalSurface, - DrawEventRecorderPrivate *aRecorder) + SourceSurfaceWrapAndRecord(SourceSurface* aFinalSurface, + DrawEventRecorderPrivate* aRecorder) : mFinalSurface(aFinalSurface), mRecorder(aRecorder) { mRecorder->AddStoredObject(this); } @@ -109,8 +109,8 @@ class GradientStopsWrapAndRecord : public GradientStops { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsWrapAndRecord, override) - GradientStopsWrapAndRecord(GradientStops *aFinalGradientStops, - DrawEventRecorderPrivate *aRecorder) + GradientStopsWrapAndRecord(GradientStops* aFinalGradientStops, + DrawEventRecorderPrivate* aRecorder) : mFinalGradientStops(aFinalGradientStops), mRecorder(aRecorder) { mRecorder->AddStoredObject(this); } @@ -127,20 +127,20 @@ class GradientStopsWrapAndRecord : public GradientStops { RefPtr mRecorder; }; -static SourceSurface *GetSourceSurface(SourceSurface *aSurface) { +static SourceSurface* GetSourceSurface(SourceSurface* aSurface) { if (aSurface->GetType() != SurfaceType::RECORDING) { return aSurface; } - return static_cast(aSurface)->mFinalSurface; + return static_cast(aSurface)->mFinalSurface; } -static GradientStops *GetGradientStops(GradientStops *aStops) { +static GradientStops* GetGradientStops(GradientStops* aStops) { if (aStops->GetBackendType() != BackendType::RECORDING) { return aStops; } - return static_cast(aStops)->mFinalGradientStops; + return static_cast(aStops)->mFinalGradientStops; } class FilterNodeWrapAndRecord : public FilterNode { @@ -148,8 +148,8 @@ class FilterNodeWrapAndRecord : public FilterNode { MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeWrapAndRecord, override) using FilterNode::SetAttribute; - FilterNodeWrapAndRecord(FilterNode *aFinalFilterNode, - DrawEventRecorderPrivate *aRecorder) + FilterNodeWrapAndRecord(FilterNode* aFinalFilterNode, + DrawEventRecorderPrivate* aRecorder) : mFinalFilterNode(aFinalFilterNode), mRecorder(aRecorder) { mRecorder->AddStoredObject(this); } @@ -159,23 +159,23 @@ class FilterNodeWrapAndRecord : public FilterNode { mRecorder->RecordEvent(RecordedFilterNodeDestruction(ReferencePtr(this))); } - static FilterNode *GetFilterNode(FilterNode *aNode) { + static FilterNode* GetFilterNode(FilterNode* aNode) { if (aNode->GetBackendType() != FILTER_BACKEND_RECORDING) { gfxWarning() << "Non recording filter node used with recording DrawTarget!"; return aNode; } - return static_cast(aNode)->mFinalFilterNode; + return static_cast(aNode)->mFinalFilterNode; } - void SetInput(uint32_t aIndex, SourceSurface *aSurface) override { + void SetInput(uint32_t aIndex, SourceSurface* aSurface) override { EnsureSurfaceStored(mRecorder, aSurface, "SetInput"); mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aSurface)); mFinalFilterNode->SetInput(aIndex, GetSourceSurface(aSurface)); } - void SetInput(uint32_t aIndex, FilterNode *aFilter) override { + void SetInput(uint32_t aIndex, FilterNode* aFilter) override { MOZ_ASSERT(mRecorder->HasStoredObject(aFilter)); mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aFilter)); @@ -193,20 +193,20 @@ class FilterNodeWrapAndRecord : public FilterNode { FORWARD_SET_ATTRIBUTE(bool, BOOL); FORWARD_SET_ATTRIBUTE(uint32_t, UINT32); FORWARD_SET_ATTRIBUTE(Float, FLOAT); - FORWARD_SET_ATTRIBUTE(const Size &, SIZE); - FORWARD_SET_ATTRIBUTE(const IntSize &, INTSIZE); - FORWARD_SET_ATTRIBUTE(const IntPoint &, INTPOINT); - FORWARD_SET_ATTRIBUTE(const Rect &, RECT); - FORWARD_SET_ATTRIBUTE(const IntRect &, INTRECT); - FORWARD_SET_ATTRIBUTE(const Point &, POINT); - FORWARD_SET_ATTRIBUTE(const Matrix &, MATRIX); - FORWARD_SET_ATTRIBUTE(const Matrix5x4 &, MATRIX5X4); - FORWARD_SET_ATTRIBUTE(const Point3D &, POINT3D); - FORWARD_SET_ATTRIBUTE(const Color &, COLOR); + FORWARD_SET_ATTRIBUTE(const Size&, SIZE); + FORWARD_SET_ATTRIBUTE(const IntSize&, INTSIZE); + FORWARD_SET_ATTRIBUTE(const IntPoint&, INTPOINT); + FORWARD_SET_ATTRIBUTE(const Rect&, RECT); + FORWARD_SET_ATTRIBUTE(const IntRect&, INTRECT); + FORWARD_SET_ATTRIBUTE(const Point&, POINT); + FORWARD_SET_ATTRIBUTE(const Matrix&, MATRIX); + FORWARD_SET_ATTRIBUTE(const Matrix5x4&, MATRIX5X4); + FORWARD_SET_ATTRIBUTE(const Point3D&, POINT3D); + FORWARD_SET_ATTRIBUTE(const Color&, COLOR); #undef FORWARD_SET_ATTRIBUTE - virtual void SetAttribute(uint32_t aIndex, const Float *aFloat, + virtual void SetAttribute(uint32_t aIndex, const Float* aFloat, uint32_t aSize) override { mRecorder->RecordEvent( RecordedFilterNodeSetAttribute(this, aIndex, aFloat, aSize)); @@ -220,8 +220,8 @@ class FilterNodeWrapAndRecord : public FilterNode { }; struct AdjustedPattern final { - explicit AdjustedPattern(const Pattern &aPattern) : mPattern(nullptr) { - mOrigPattern = const_cast(&aPattern); + explicit AdjustedPattern(const Pattern& aPattern) : mPattern(nullptr) { + mOrigPattern = const_cast(&aPattern); } ~AdjustedPattern() { @@ -230,28 +230,28 @@ struct AdjustedPattern final { } } - operator Pattern *() { + operator Pattern*() { switch (mOrigPattern->GetType()) { case PatternType::COLOR: return mOrigPattern; case PatternType::SURFACE: { - SurfacePattern *surfPat = static_cast(mOrigPattern); + SurfacePattern* surfPat = static_cast(mOrigPattern); mPattern = new (mSurfPat) SurfacePattern( GetSourceSurface(surfPat->mSurface), surfPat->mExtendMode, surfPat->mMatrix, surfPat->mSamplingFilter, surfPat->mSamplingRect); return mPattern; } case PatternType::LINEAR_GRADIENT: { - LinearGradientPattern *linGradPat = - static_cast(mOrigPattern); + LinearGradientPattern* linGradPat = + static_cast(mOrigPattern); mPattern = new (mLinGradPat) LinearGradientPattern( linGradPat->mBegin, linGradPat->mEnd, GetGradientStops(linGradPat->mStops), linGradPat->mMatrix); return mPattern; } case PatternType::RADIAL_GRADIENT: { - RadialGradientPattern *radGradPat = - static_cast(mOrigPattern); + RadialGradientPattern* radGradPat = + static_cast(mOrigPattern); mPattern = new (mRadGradPat) RadialGradientPattern( radGradPat->mCenter1, radGradPat->mCenter2, radGradPat->mRadius1, radGradPat->mRadius2, GetGradientStops(radGradPat->mStops), @@ -272,13 +272,13 @@ struct AdjustedPattern final { char mSurfPat[sizeof(SurfacePattern)]; }; - Pattern *mOrigPattern; - Pattern *mPattern; + Pattern* mOrigPattern; + Pattern* mPattern; }; -DrawTargetWrapAndRecord::DrawTargetWrapAndRecord(DrawEventRecorder *aRecorder, - DrawTarget *aDT, bool aHasData) - : mRecorder(static_cast(aRecorder)), +DrawTargetWrapAndRecord::DrawTargetWrapAndRecord(DrawEventRecorder* aRecorder, + DrawTarget* aDT, bool aHasData) + : mRecorder(static_cast(aRecorder)), mFinalDT(aDT) { RefPtr snapshot = aHasData ? mFinalDT->Snapshot() : nullptr; mRecorder->RecordEvent(RecordedDrawTargetCreation( @@ -288,7 +288,7 @@ DrawTargetWrapAndRecord::DrawTargetWrapAndRecord(DrawEventRecorder *aRecorder, } DrawTargetWrapAndRecord::DrawTargetWrapAndRecord( - const DrawTargetWrapAndRecord *aDT, DrawTarget *aSimilarDT) + const DrawTargetWrapAndRecord* aDT, DrawTarget* aSimilarDT) : mRecorder(aDT->mRecorder), mFinalDT(aSimilarDT) { mRecorder->RecordEvent(RecordedCreateSimilarDrawTarget( this, mFinalDT->GetSize(), mFinalDT->GetFormat())); @@ -297,22 +297,22 @@ DrawTargetWrapAndRecord::DrawTargetWrapAndRecord( DrawTargetWrapAndRecord::~DrawTargetWrapAndRecord() { mRecorder->RecordEvent( - RecordedDrawTargetDestruction(static_cast(this))); + RecordedDrawTargetDestruction(static_cast(this))); } -void DrawTargetWrapAndRecord::FillRect(const Rect &aRect, - const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::FillRect(const Rect& aRect, + const Pattern& aPattern, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aPattern); mRecorder->RecordEvent(RecordedFillRect(this, aRect, aPattern, aOptions)); mFinalDT->FillRect(aRect, *AdjustedPattern(aPattern), aOptions); } -void DrawTargetWrapAndRecord::StrokeRect(const Rect &aRect, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::StrokeRect(const Rect& aRect, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aPattern); mRecorder->RecordEvent( @@ -321,10 +321,10 @@ void DrawTargetWrapAndRecord::StrokeRect(const Rect &aRect, aOptions); } -void DrawTargetWrapAndRecord::StrokeLine(const Point &aBegin, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::StrokeLine(const Point& aBegin, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aPattern); mRecorder->RecordEvent(RecordedStrokeLine(this, aBegin, aEnd, aPattern, @@ -333,8 +333,8 @@ void DrawTargetWrapAndRecord::StrokeLine(const Point &aBegin, const Point &aEnd, aOptions); } -void DrawTargetWrapAndRecord::Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions) { RefPtr pathWrapAndRecord = EnsurePathStored(aPath); EnsurePatternDependenciesStored(aPattern); @@ -345,29 +345,29 @@ void DrawTargetWrapAndRecord::Fill(const Path *aPath, const Pattern &aPattern, } struct WrapAndRecordFontUserData { - void *refPtr; + void* refPtr; RefPtr recorder; }; -static void WrapAndRecordFontUserDataDestroyFunc(void *aUserData) { - WrapAndRecordFontUserData *userData = - static_cast(aUserData); +static void WrapAndRecordFontUserDataDestroyFunc(void* aUserData) { + WrapAndRecordFontUserData* userData = + static_cast(aUserData); userData->recorder->RecordEvent( RecordedScaledFontDestruction(ReferencePtr(userData->refPtr))); - userData->recorder->RemoveScaledFont((ScaledFont *)userData->refPtr); + userData->recorder->RemoveScaledFont((ScaledFont*)userData->refPtr); delete userData; } -void DrawTargetWrapAndRecord::FillGlyphs(ScaledFont *aFont, - const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::FillGlyphs(ScaledFont* aFont, + const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aPattern); - UserDataKey *userDataKey = reinterpret_cast(mRecorder.get()); + UserDataKey* userDataKey = reinterpret_cast(mRecorder.get()); if (!aFont->GetUserData(userDataKey)) { - UnscaledFont *unscaledFont = aFont->GetUnscaledFont(); + UnscaledFont* unscaledFont = aFont->GetUnscaledFont(); if (!mRecorder->HasStoredObject(unscaledFont)) { RecordedFontData fontData(unscaledFont); RecordedFontDetails fontDetails; @@ -396,7 +396,7 @@ void DrawTargetWrapAndRecord::FillGlyphs(ScaledFont *aFont, mRecorder->RecordEvent(RecordedScaledFontCreation(aFont, unscaledFont)); - WrapAndRecordFontUserData *userData = new WrapAndRecordFontUserData; + WrapAndRecordFontUserData* userData = new WrapAndRecordFontUserData; userData->refPtr = aFont; userData->recorder = mRecorder; aFont->AddUserData(userDataKey, userData, @@ -409,8 +409,8 @@ void DrawTargetWrapAndRecord::FillGlyphs(ScaledFont *aFont, mFinalDT->FillGlyphs(aFont, aBuffer, *AdjustedPattern(aPattern), aOptions); } -void DrawTargetWrapAndRecord::Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aSource); EnsurePatternDependenciesStored(aMask); @@ -418,9 +418,9 @@ void DrawTargetWrapAndRecord::Mask(const Pattern &aSource, const Pattern &aMask, mFinalDT->Mask(*AdjustedPattern(aSource), *AdjustedPattern(aMask), aOptions); } -void DrawTargetWrapAndRecord::MaskSurface(const Pattern &aSource, - SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::MaskSurface(const Pattern& aSource, + SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions) { EnsurePatternDependenciesStored(aSource); EnsureSurfaceStored(mRecorder, aMask, "MaskSurface"); @@ -430,9 +430,9 @@ void DrawTargetWrapAndRecord::MaskSurface(const Pattern &aSource, aOffset, aOptions); } -void DrawTargetWrapAndRecord::Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions, + const DrawOptions& aOptions) { RefPtr pathWrapAndRecord = EnsurePathStored(aPath); EnsurePatternDependenciesStored(aPattern); @@ -472,8 +472,8 @@ void DrawTargetWrapAndRecord::DetachAllSnapshots() { } void DrawTargetWrapAndRecord::DrawSurface( - SourceSurface *aSurface, const Rect &aDest, const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions, const DrawOptions &aOptions) { + SourceSurface* aSurface, const Rect& aDest, const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions, const DrawOptions& aOptions) { EnsureSurfaceStored(mRecorder, aSurface, "DrawSurface"); mRecorder->RecordEvent(RecordedDrawSurface(this, aSurface, aDest, aSource, @@ -483,8 +483,8 @@ void DrawTargetWrapAndRecord::DrawSurface( } void DrawTargetWrapAndRecord::DrawSurfaceWithShadow( - SourceSurface *aSurface, const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, CompositionOp aOp) { + SourceSurface* aSurface, const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOp) { EnsureSurfaceStored(mRecorder, aSurface, "DrawSurfaceWithShadow"); mRecorder->RecordEvent(RecordedDrawSurfaceWithShadow( @@ -493,10 +493,10 @@ void DrawTargetWrapAndRecord::DrawSurfaceWithShadow( aOffset, aSigma, aOp); } -void DrawTargetWrapAndRecord::DrawFilter(FilterNode *aNode, - const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions) { +void DrawTargetWrapAndRecord::DrawFilter(FilterNode* aNode, + const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions) { MOZ_ASSERT(mRecorder->HasStoredObject(aNode)); mRecorder->RecordEvent( @@ -516,14 +516,14 @@ already_AddRefed DrawTargetWrapAndRecord::CreateFilter( return retNode.forget(); } -void DrawTargetWrapAndRecord::ClearRect(const Rect &aRect) { +void DrawTargetWrapAndRecord::ClearRect(const Rect& aRect) { mRecorder->RecordEvent(RecordedClearRect(this, aRect)); mFinalDT->ClearRect(aRect); } -void DrawTargetWrapAndRecord::CopySurface(SourceSurface *aSurface, - const IntRect &aSourceRect, - const IntPoint &aDestination) { +void DrawTargetWrapAndRecord::CopySurface(SourceSurface* aSurface, + const IntRect& aSourceRect, + const IntPoint& aDestination) { EnsureSurfaceStored(mRecorder, aSurface, "CopySurface"); mRecorder->RecordEvent( @@ -531,27 +531,27 @@ void DrawTargetWrapAndRecord::CopySurface(SourceSurface *aSurface, mFinalDT->CopySurface(GetSourceSurface(aSurface), aSourceRect, aDestination); } -void DrawTargetWrapAndRecord::PushClip(const Path *aPath) { +void DrawTargetWrapAndRecord::PushClip(const Path* aPath) { RefPtr pathWrapAndRecord = EnsurePathStored(aPath); mRecorder->RecordEvent(RecordedPushClip(this, pathWrapAndRecord)); mFinalDT->PushClip(pathWrapAndRecord->mPath); } -void DrawTargetWrapAndRecord::PushClipRect(const Rect &aRect) { +void DrawTargetWrapAndRecord::PushClipRect(const Rect& aRect) { mRecorder->RecordEvent(RecordedPushClipRect(this, aRect)); mFinalDT->PushClipRect(aRect); } void DrawTargetWrapAndRecord::PopClip() { - mRecorder->RecordEvent(RecordedPopClip(static_cast(this))); + mRecorder->RecordEvent(RecordedPopClip(static_cast(this))); mFinalDT->PopClip(); } void DrawTargetWrapAndRecord::PushLayer(bool aOpaque, Float aOpacity, - SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds, + SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds, bool aCopyBackground) { if (aMask) { EnsureSurfaceStored(mRecorder, aMask, "PushLayer"); @@ -565,13 +565,13 @@ void DrawTargetWrapAndRecord::PushLayer(bool aOpaque, Float aOpacity, } void DrawTargetWrapAndRecord::PopLayer() { - mRecorder->RecordEvent(RecordedPopLayer(static_cast(this))); + mRecorder->RecordEvent(RecordedPopLayer(static_cast(this))); mFinalDT->PopLayer(); } already_AddRefed DrawTargetWrapAndRecord::CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const { RefPtr surf = mFinalDT->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat); @@ -586,7 +586,7 @@ DrawTargetWrapAndRecord::CreateSourceSurfaceFromData( } already_AddRefed DrawTargetWrapAndRecord::OptimizeSourceSurface( - SourceSurface *aSurface) const { + SourceSurface* aSurface) const { RefPtr surf = mFinalDT->OptimizeSourceSurface(aSurface); RefPtr retSurf = @@ -606,7 +606,7 @@ already_AddRefed DrawTargetWrapAndRecord::OptimizeSourceSurface( already_AddRefed DrawTargetWrapAndRecord::CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const { + const NativeSurface& aSurface) const { RefPtr surf = mFinalDT->CreateSourceSurfaceFromNativeSurface(aSurface); @@ -621,7 +621,7 @@ DrawTargetWrapAndRecord::CreateSourceSurfaceFromNativeSurface( } already_AddRefed DrawTargetWrapAndRecord::CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const { + const IntSize& aSize, SurfaceFormat aFormat) const { RefPtr similarDT = mFinalDT->CreateSimilarDrawTarget(aSize, aFormat); if (!similarDT) { @@ -633,7 +633,7 @@ already_AddRefed DrawTargetWrapAndRecord::CreateSimilarDrawTarget( } bool DrawTargetWrapAndRecord::CanCreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const { + const IntSize& aSize, SurfaceFormat aFormat) const { return mFinalDT->CanCreateSimilarDrawTarget(aSize, aFormat); } @@ -644,7 +644,7 @@ already_AddRefed DrawTargetWrapAndRecord::CreatePathBuilder( } already_AddRefed DrawTargetWrapAndRecord::CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode) const { + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode) const { RefPtr stops = mFinalDT->CreateGradientStops(aStops, aNumStops, aExtendMode); @@ -657,18 +657,18 @@ already_AddRefed DrawTargetWrapAndRecord::CreateGradientStops( return retStops.forget(); } -void DrawTargetWrapAndRecord::SetTransform(const Matrix &aTransform) { +void DrawTargetWrapAndRecord::SetTransform(const Matrix& aTransform) { mRecorder->RecordEvent(RecordedSetTransform(this, aTransform)); DrawTarget::SetTransform(aTransform); mFinalDT->SetTransform(aTransform); } already_AddRefed DrawTargetWrapAndRecord::EnsurePathStored( - const Path *aPath) { + const Path* aPath) { RefPtr pathWrapAndRecord; if (aPath->GetBackendType() == BackendType::RECORDING) { pathWrapAndRecord = - const_cast(static_cast(aPath)); + const_cast(static_cast(aPath)); if (mRecorder->HasStoredObject(aPath)) { return pathWrapAndRecord.forget(); } @@ -691,24 +691,23 @@ already_AddRefed DrawTargetWrapAndRecord::EnsurePathStored( } void DrawTargetWrapAndRecord::EnsurePatternDependenciesStored( - const Pattern &aPattern) { + const Pattern& aPattern) { switch (aPattern.GetType()) { case PatternType::COLOR: // No dependencies here. return; case PatternType::LINEAR_GRADIENT: { MOZ_ASSERT(mRecorder->HasStoredObject( - static_cast(&aPattern)->mStops)); + static_cast(&aPattern)->mStops)); return; } case PatternType::RADIAL_GRADIENT: { MOZ_ASSERT(mRecorder->HasStoredObject( - static_cast(&aPattern)->mStops)); + static_cast(&aPattern)->mStops)); return; } case PatternType::SURFACE: { - const SurfacePattern *pat = - static_cast(&aPattern); + const SurfacePattern* pat = static_cast(&aPattern); EnsureSurfaceStored(mRecorder, pat->mSurface, "EnsurePatternDependenciesStored"); return; diff --git a/gfx/2d/DrawTargetWrapAndRecord.h b/gfx/2d/DrawTargetWrapAndRecord.h index 9890a1c080b3e..c5ed11ad58ba9 100644 --- a/gfx/2d/DrawTargetWrapAndRecord.h +++ b/gfx/2d/DrawTargetWrapAndRecord.h @@ -16,7 +16,7 @@ namespace gfx { class DrawTargetWrapAndRecord : public DrawTarget { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetWrapAndRecord, override) - DrawTargetWrapAndRecord(DrawEventRecorder *aRecorder, DrawTarget *aDT, + DrawTargetWrapAndRecord(DrawEventRecorder* aRecorder, DrawTarget* aDT, bool aHasData = false); ~DrawTargetWrapAndRecord(); @@ -55,13 +55,13 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aSurfOptions DrawSurface options that are applied */ virtual void DrawSurface( - SourceSurface *aSurface, const Rect &aDest, const Rect &aSource, - const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + SourceSurface* aSurface, const Rect& aDest, const Rect& aSource, + const DrawSurfaceOptions& aSurfOptions = DrawSurfaceOptions(), + const DrawOptions& aOptions = DrawOptions()) override; - virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void DrawFilter(FilterNode* aNode, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions = DrawOptions()) override; /* * Blend a surface to the draw target with a shadow. The shadow is drawn as a @@ -77,9 +77,9 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aSigma Sigma used for the guassian filter kernel * aOperator Composition operator used */ - virtual void DrawSurfaceWithShadow(SourceSurface *aSurface, - const Point &aDest, const Color &aColor, - const Point &aOffset, Float aSigma, + virtual void DrawSurfaceWithShadow(SourceSurface* aSurface, + const Point& aDest, const Color& aColor, + const Point& aOffset, Float aSigma, CompositionOp aOperator) override; /* @@ -88,7 +88,7 @@ class DrawTargetWrapAndRecord : public DrawTarget { * * aRect Rectangle to clear */ - virtual void ClearRect(const Rect &aRect) override; + virtual void ClearRect(const Rect& aRect) override; /* * This is essentially a 'memcpy' between two surfaces. It moves a pixel @@ -99,8 +99,8 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aSourceRect Source rectangle to be copied * aDest Destination point to copy the surface to */ - virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect, - const IntPoint &aDestination) override; + virtual void CopySurface(SourceSurface* aSurface, const IntRect& aSourceRect, + const IntPoint& aDestination) override; /* * Fill a rectangle on the DrawTarget with a certain source pattern. @@ -109,8 +109,8 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aPattern Pattern that forms the source of this filling operation * aOptions Options that are applied to this operation */ - virtual void FillRect(const Rect &aRect, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void FillRect(const Rect& aRect, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; /* * Stroke a rectangle on the DrawTarget with a certain source pattern. @@ -119,9 +119,9 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aPattern Pattern that forms the source of this stroking operation * aOptions Options that are applied to this operation */ - virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + virtual void StrokeRect(const Rect& aRect, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; /* * Stroke a line on the DrawTarget with a certain source pattern. @@ -131,10 +131,10 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aPattern Pattern that forms the source of this stroking operation * aOptions Options that are applied to this operation */ - virtual void StrokeLine(const Point &aStart, const Point &aEnd, - const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + virtual void StrokeLine(const Point& aStart, const Point& aEnd, + const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; /* * Stroke a path on the draw target with a certain source pattern. @@ -144,9 +144,9 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aStrokeOptions Stroke options used for this operation * aOptions Draw options used for this operation */ - virtual void Stroke(const Path *aPath, const Pattern &aPattern, - const StrokeOptions &aStrokeOptions = StrokeOptions(), - const DrawOptions &aOptions = DrawOptions()) override; + virtual void Stroke(const Path* aPath, const Pattern& aPattern, + const StrokeOptions& aStrokeOptions = StrokeOptions(), + const DrawOptions& aOptions = DrawOptions()) override; /* * Fill a path on the draw target with a certain source pattern. @@ -155,15 +155,15 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aPattern Pattern that should be used for the fill * aOptions Draw options used for this operation */ - virtual void Fill(const Path *aPath, const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void Fill(const Path* aPath, const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; /* * Fill a series of clyphs on the draw target with a certain source pattern. */ - virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer, - const Pattern &aPattern, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer, + const Pattern& aPattern, + const DrawOptions& aOptions = DrawOptions()) override; /* * This takes a source pattern and a mask, and composites the source pattern @@ -174,19 +174,19 @@ class DrawTargetWrapAndRecord : public DrawTarget { * aMask Mask pattern * aOptions Drawing options */ - virtual void Mask(const Pattern &aSource, const Pattern &aMask, - const DrawOptions &aOptions = DrawOptions()) override; + virtual void Mask(const Pattern& aSource, const Pattern& aMask, + const DrawOptions& aOptions = DrawOptions()) override; virtual void MaskSurface( - const Pattern &aSource, SourceSurface *aMask, Point aOffset, - const DrawOptions &aOptions = DrawOptions()) override; + const Pattern& aSource, SourceSurface* aMask, Point aOffset, + const DrawOptions& aOptions = DrawOptions()) override; /* * Push a clip to the DrawTarget. * * aPath The path to clip to */ - virtual void PushClip(const Path *aPath) override; + virtual void PushClip(const Path* aPath) override; /* * Push an axis-aligned rectangular clip to the DrawTarget. This rectangle @@ -194,7 +194,7 @@ class DrawTargetWrapAndRecord : public DrawTarget { * * aRect The rect to clip to */ - virtual void PushClipRect(const Rect &aRect) override; + virtual void PushClipRect(const Rect& aRect) override; /* Pop a clip from the DrawTarget. A pop without a corresponding push will * be ignored. @@ -217,9 +217,9 @@ class DrawTargetWrapAndRecord : public DrawTarget { * @param aCopyBackground Whether to copy the background into the layer, this * is only supported when aOpaque is true. */ - virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask, - const Matrix &aMaskTransform, - const IntRect &aBounds = IntRect(), + virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask, + const Matrix& aMaskTransform, + const IntRect& aBounds = IntRect(), bool aCopyBackground = false) override; /** @@ -237,7 +237,7 @@ class DrawTargetWrapAndRecord : public DrawTarget { * time. */ virtual already_AddRefed CreateSourceSurfaceFromData( - unsigned char *aData, const IntSize &aSize, int32_t aStride, + unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) const override; /* @@ -246,7 +246,7 @@ class DrawTargetWrapAndRecord : public DrawTarget { * other existing surface. */ virtual already_AddRefed OptimizeSourceSurface( - SourceSurface *aSurface) const override; + SourceSurface* aSurface) const override; /* * Create a SourceSurface for a type of NativeSurface. This may fail if the @@ -254,16 +254,16 @@ class DrawTargetWrapAndRecord : public DrawTarget { * in. */ virtual already_AddRefed CreateSourceSurfaceFromNativeSurface( - const NativeSurface &aSurface) const override; + const NativeSurface& aSurface) const override; /* * Create a DrawTarget whose snapshot is optimized for use with this * DrawTarget. */ virtual already_AddRefed CreateSimilarDrawTarget( - const IntSize &aSize, SurfaceFormat aFormat) const override; + const IntSize& aSize, SurfaceFormat aFormat) const override; - virtual bool CanCreateSimilarDrawTarget(const IntSize &aSize, + virtual bool CanCreateSimilarDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) const override; /* @@ -287,7 +287,7 @@ class DrawTargetWrapAndRecord : public DrawTarget { * gradient area. */ virtual already_AddRefed CreateGradientStops( - GradientStop *aStops, uint32_t aNumStops, + GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; virtual already_AddRefed CreateFilter(FilterType aType) override; @@ -296,12 +296,12 @@ class DrawTargetWrapAndRecord : public DrawTarget { * Set a transform on the surface, this transform is applied at drawing time * to both the mask and source of the operation. */ - virtual void SetTransform(const Matrix &aTransform) override; + virtual void SetTransform(const Matrix& aTransform) override; /* Tries to get a native surface for a DrawTarget, this may fail if the * draw target cannot convert to this surface type. */ - virtual void *GetNativeSurface(NativeSurfaceType aType) override { + virtual void* GetNativeSurface(NativeSurfaceType aType) override { return mFinalDT->GetNativeSurface(aType); } @@ -319,12 +319,12 @@ class DrawTargetWrapAndRecord : public DrawTarget { * called * @param aSimilarDT Similar DrawTarget created from aDT.mFinalDT. */ - DrawTargetWrapAndRecord(const DrawTargetWrapAndRecord *aDT, - DrawTarget *aSimilarDT); + DrawTargetWrapAndRecord(const DrawTargetWrapAndRecord* aDT, + DrawTarget* aSimilarDT); - Path *GetPathForPathRecording(const Path *aPath) const; - already_AddRefed EnsurePathStored(const Path *aPath); - void EnsurePatternDependenciesStored(const Pattern &aPattern); + Path* GetPathForPathRecording(const Path* aPath) const; + already_AddRefed EnsurePathStored(const Path* aPath); + void EnsurePatternDependenciesStored(const Pattern& aPattern); RefPtr mRecorder; RefPtr mFinalDT; diff --git a/gfx/2d/FilterNodeCapture.h b/gfx/2d/FilterNodeCapture.h index 491a214d1c4a5..5c126fcd60f40 100644 --- a/gfx/2d/FilterNodeCapture.h +++ b/gfx/2d/FilterNodeCapture.h @@ -25,10 +25,10 @@ class FilterNodeCapture final : public FilterNode { FilterBackend GetBackendType() override { return FILTER_BACKEND_CAPTURE; } - RefPtr Validate(DrawTarget *aDT); + RefPtr Validate(DrawTarget* aDT); template - void Replace(uint32_t aIndex, const T &aValue, C &aContainer) { + void Replace(uint32_t aIndex, const T& aValue, C& aContainer) { // This replace function avoids generating the hash twice. auto result = aContainer.insert({aIndex, typename C::mapped_type(aValue)}); if (!result.second) { @@ -36,11 +36,11 @@ class FilterNodeCapture final : public FilterNode { } } - void SetInput(uint32_t aIndex, SourceSurface *aSurface) override { + void SetInput(uint32_t aIndex, SourceSurface* aSurface) override { mInputsChanged = true; Replace(aIndex, RefPtr(aSurface), mInputs); } - void SetInput(uint32_t aIndex, FilterNode *aFilter) override { + void SetInput(uint32_t aIndex, FilterNode* aFilter) override { mInputsChanged = true; Replace(aIndex, RefPtr(aFilter), mInputs); } @@ -55,39 +55,39 @@ class FilterNodeCapture final : public FilterNode { void SetAttribute(uint32_t aIndex, Float aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const Point &aValue) override { + void SetAttribute(uint32_t aIndex, const Point& aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const Matrix5x4 &aValue) override { + void SetAttribute(uint32_t aIndex, const Matrix5x4& aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const Point3D &aValue) override { + void SetAttribute(uint32_t aIndex, const Point3D& aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const Size &aValue) override { + void SetAttribute(uint32_t aIndex, const Size& aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const IntSize &aValue) override { + void SetAttribute(uint32_t aIndex, const IntSize& aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const Color &aValue) override { + void SetAttribute(uint32_t aIndex, const Color& aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const Rect &aValue) override { + void SetAttribute(uint32_t aIndex, const Rect& aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const IntRect &aValue) override { + void SetAttribute(uint32_t aIndex, const IntRect& aValue) override { Replace(aIndex, aValue, mAttributes); } void SetAttribute(uint32_t aIndex, bool aValue) override { Replace(aIndex, aValue, mAttributes); } - virtual void SetAttribute(uint32_t aIndex, const Float *aValues, + virtual void SetAttribute(uint32_t aIndex, const Float* aValues, uint32_t aSize) override; - void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override { + void SetAttribute(uint32_t aIndex, const IntPoint& aValue) override { Replace(aIndex, aValue, mAttributes); } - void SetAttribute(uint32_t aIndex, const Matrix &aValue) override { + void SetAttribute(uint32_t aIndex, const Matrix& aValue) override { Replace(aIndex, aValue, mAttributes); } diff --git a/gfx/2d/FilterNodeD2D1.cpp b/gfx/2d/FilterNodeD2D1.cpp index 4bf83a7d8586e..682b288400cd5 100644 --- a/gfx/2d/FilterNodeD2D1.cpp +++ b/gfx/2d/FilterNodeD2D1.cpp @@ -142,8 +142,8 @@ D2D1_CHANNEL_SELECTOR D2DChannelSelector(uint32_t aMode) { return D2D1_CHANNEL_SELECTOR_R; } -already_AddRefed GetImageForSourceSurface(DrawTarget *aDT, - SourceSurface *aSurface) { +already_AddRefed GetImageForSourceSurface(DrawTarget* aDT, + SourceSurface* aSurface) { if (aDT->IsTiledDrawTarget() || aDT->IsDualDrawTarget() || aDT->IsCaptureDT()) { gfxDevCrash(LogReason::FilterNodeD2D1Target) @@ -153,7 +153,7 @@ already_AddRefed GetImageForSourceSurface(DrawTarget *aDT, } switch (aDT->GetBackendType()) { case BackendType::DIRECT2D1_1: - return static_cast(aDT)->GetImageForSurface( + return static_cast(aDT)->GetImageForSurface( aSurface, ExtendMode::CLAMP); default: gfxDevCrash(LogReason::FilterNodeD2D1Backend) @@ -207,7 +207,7 @@ uint32_t ConvertValue(FilterType aType, uint32_t aAttribute, uint32_t aValue) { return aValue; } -void ConvertValue(FilterType aType, uint32_t aAttribute, IntSize &aValue) { +void ConvertValue(FilterType aType, uint32_t aAttribute, IntSize& aValue) { switch (aType) { case FilterType::MORPHOLOGY: if (aAttribute == ATT_MORPHOLOGY_RADII) { @@ -498,7 +498,7 @@ GetD2D1PropForAttribute(FilterType aType, uint32_t aIndex) { } bool GetD2D1PropsForIntSize(FilterType aType, uint32_t aIndex, - UINT32 *aPropWidth, UINT32 *aPropHeight) { + UINT32* aPropWidth, UINT32* aPropHeight) { switch (aType) { case FilterType::MORPHOLOGY: if (aIndex == ATT_MORPHOLOGY_RADII) { @@ -604,7 +604,7 @@ static bool HasUnboundedOutputRegion(FilterType aType) { } /* static */ -already_AddRefed FilterNodeD2D1::Create(ID2D1DeviceContext *aDC, +already_AddRefed FilterNodeD2D1::Create(ID2D1DeviceContext* aDC, FilterType aType) { if (aType == FilterType::CONVOLVE_MATRIX) { return MakeAndAddRef(aDC); @@ -657,9 +657,9 @@ void FilterNodeD2D1::InitUnmappedProperties() { } } -void FilterNodeD2D1::SetInput(uint32_t aIndex, SourceSurface *aSurface) { +void FilterNodeD2D1::SetInput(uint32_t aIndex, SourceSurface* aSurface) { UINT32 input = GetD2D1InputForInput(mType, aIndex); - ID2D1Effect *effect = InputEffect(); + ID2D1Effect* effect = InputEffect(); MOZ_ASSERT(input < effect->GetInputCount()); if (mType == FilterType::COMPOSITE) { @@ -691,9 +691,9 @@ void FilterNodeD2D1::SetInput(uint32_t aIndex, SourceSurface *aSurface) { effect->SetInput(input, nullptr); } -void FilterNodeD2D1::SetInput(uint32_t aIndex, FilterNode *aFilter) { +void FilterNodeD2D1::SetInput(uint32_t aIndex, FilterNode* aFilter) { UINT32 input = GetD2D1InputForInput(mType, aIndex); - ID2D1Effect *effect = InputEffect(); + ID2D1Effect* effect = InputEffect(); if (mType == FilterType::COMPOSITE) { UINT32 inputCount = effect->GetInputCount(); @@ -713,7 +713,7 @@ void FilterNodeD2D1::SetInput(uint32_t aIndex, FilterNode *aFilter) { return; } - FilterNodeD2D1 *filter = static_cast(aFilter); + FilterNodeD2D1* filter = static_cast(aFilter); mInputSurfaces.resize(effect->GetInputCount()); mInputFilters.resize(effect->GetInputCount()); @@ -727,12 +727,12 @@ void FilterNodeD2D1::SetInput(uint32_t aIndex, FilterNode *aFilter) { } } -void FilterNodeD2D1::WillDraw(DrawTarget *aDT) { +void FilterNodeD2D1::WillDraw(DrawTarget* aDT) { // Convert input SourceSurfaces into ID2D1Images and set them on the effect. for (size_t inputIndex = 0; inputIndex < mInputSurfaces.size(); inputIndex++) { if (mInputSurfaces[inputIndex]) { - ID2D1Effect *effect = InputEffect(); + ID2D1Effect* effect = InputEffect(); RefPtr image = GetImageForSourceSurface(aDT, mInputSurfaces[inputIndex]); effect->SetInput(inputIndex, image); @@ -772,35 +772,35 @@ void FilterNodeD2D1::SetAttribute(uint32_t aIndex, Float aValue) { mEffect->SetValue(input, aValue); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Point &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Point& aValue) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); mEffect->SetValue(input, D2DPoint(aValue)); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Matrix5x4 &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Matrix5x4& aValue) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); mEffect->SetValue(input, D2DMatrix5x4(aValue)); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Point3D &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Point3D& aValue) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); mEffect->SetValue(input, D2DVector3D(aValue)); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Size &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Size& aValue) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); mEffect->SetValue(input, D2D1::Vector2F(aValue.width, aValue.height)); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntSize &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntSize& aValue) { UINT32 widthProp, heightProp; if (!GetD2D1PropsForIntSize(mType, aIndex, &widthProp, &heightProp)) { @@ -814,7 +814,7 @@ void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntSize &aValue) { mEffect->SetValue(heightProp, (UINT)value.height); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Color &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Color& aValue) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); @@ -834,14 +834,14 @@ void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Color &aValue) { } } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Rect &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Rect& aValue) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); mEffect->SetValue(input, D2DRect(aValue)); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntRect &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntRect& aValue) { if (mType == FilterType::TURBULENCE) { MOZ_ASSERT(aIndex == ATT_TURBULENCE_RECT); @@ -868,22 +868,22 @@ void FilterNodeD2D1::SetAttribute(uint32_t aIndex, bool aValue) { mEffect->SetValue(input, (BOOL)aValue); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Float *aValues, +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Float* aValues, uint32_t aSize) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); - mEffect->SetValue(input, (BYTE *)aValues, sizeof(Float) * aSize); + mEffect->SetValue(input, (BYTE*)aValues, sizeof(Float) * aSize); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntPoint &aValue) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const IntPoint& aValue) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); mEffect->SetValue(input, D2DPoint(aValue)); } -void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Matrix &aMatrix) { +void FilterNodeD2D1::SetAttribute(uint32_t aIndex, const Matrix& aMatrix) { UINT32 input = GetD2D1PropForAttribute(mType, aIndex); MOZ_ASSERT(input < mEffect->GetPropertyCount()); @@ -900,7 +900,7 @@ void FilterNodeOpacityD2D1::SetAttribute(uint32_t aIndex, Float aValue) { D2D1_COLORMATRIX_ALPHA_MODE_STRAIGHT); } -FilterNodeConvolveD2D1::FilterNodeConvolveD2D1(ID2D1DeviceContext *aDC) +FilterNodeConvolveD2D1::FilterNodeConvolveD2D1(ID2D1DeviceContext* aDC) : FilterNodeD2D1(nullptr, FilterType::CONVOLVE_MATRIX), mEdgeMode(EDGE_MODE_DUPLICATE) { // Correctly handling the interaction of edge mode and source rect is a bit @@ -948,7 +948,7 @@ FilterNodeConvolveD2D1::FilterNodeConvolveD2D1(ID2D1DeviceContext *aDC) UpdateSourceRect(); } -void FilterNodeConvolveD2D1::SetInput(uint32_t aIndex, FilterNode *aFilter) { +void FilterNodeConvolveD2D1::SetInput(uint32_t aIndex, FilterNode* aFilter) { FilterNodeD2D1::SetInput(aIndex, aFilter); UpdateChain(); @@ -964,7 +964,7 @@ void FilterNodeConvolveD2D1::SetAttribute(uint32_t aIndex, uint32_t aValue) { UpdateChain(); } -ID2D1Effect *FilterNodeConvolveD2D1::InputEffect() { +ID2D1Effect* FilterNodeConvolveD2D1::InputEffect() { return mEdgeMode == EDGE_MODE_NONE ? mEffect.get() : mExtendInputEffect.get(); } @@ -1003,7 +1003,7 @@ void FilterNodeConvolveD2D1::UpdateChain() { } void FilterNodeConvolveD2D1::SetAttribute(uint32_t aIndex, - const IntSize &aValue) { + const IntSize& aValue) { if (aIndex != ATT_CONVOLVE_MATRIX_KERNEL_SIZE) { MOZ_ASSERT(false); return; @@ -1018,7 +1018,7 @@ void FilterNodeConvolveD2D1::SetAttribute(uint32_t aIndex, } void FilterNodeConvolveD2D1::SetAttribute(uint32_t aIndex, - const IntPoint &aValue) { + const IntPoint& aValue) { if (aIndex != ATT_CONVOLVE_MATRIX_TARGET) { MOZ_ASSERT(false); return; @@ -1030,7 +1030,7 @@ void FilterNodeConvolveD2D1::SetAttribute(uint32_t aIndex, } void FilterNodeConvolveD2D1::SetAttribute(uint32_t aIndex, - const IntRect &aValue) { + const IntRect& aValue) { if (aIndex != ATT_CONVOLVE_MATRIX_SOURCE_RECT) { MOZ_ASSERT(false); return; @@ -1057,7 +1057,7 @@ void FilterNodeConvolveD2D1::UpdateSourceRect() { } FilterNodeExtendInputAdapterD2D1::FilterNodeExtendInputAdapterD2D1( - ID2D1DeviceContext *aDC, FilterNodeD2D1 *aFilterNode, FilterType aType) + ID2D1DeviceContext* aDC, FilterNodeD2D1* aFilterNode, FilterType aType) : FilterNodeD2D1(aFilterNode->MainEffect(), aType), mWrappedFilterNode(aFilterNode) { // We have an mEffect that looks at the bounds of the input effect, and we @@ -1080,7 +1080,7 @@ FilterNodeExtendInputAdapterD2D1::FilterNodeExtendInputAdapterD2D1( } FilterNodePremultiplyAdapterD2D1::FilterNodePremultiplyAdapterD2D1( - ID2D1DeviceContext *aDC, FilterNodeD2D1 *aFilterNode, FilterType aType) + ID2D1DeviceContext* aDC, FilterNodeD2D1* aFilterNode, FilterType aType) : FilterNodeD2D1(aFilterNode->MainEffect(), aType) { // D2D1 component transfer effects do strange things when it comes to // premultiplication. diff --git a/gfx/2d/FilterNodeD2D1.h b/gfx/2d/FilterNodeD2D1.h index 089d37a2ed5af..7fa28a86e05c8 100644 --- a/gfx/2d/FilterNodeD2D1.h +++ b/gfx/2d/FilterNodeD2D1.h @@ -20,44 +20,44 @@ class FilterNodeD2D1 : public FilterNode { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeD2D1, override) - static already_AddRefed Create(ID2D1DeviceContext *aDC, + static already_AddRefed Create(ID2D1DeviceContext* aDC, FilterType aType); - FilterNodeD2D1(ID2D1Effect *aEffect, FilterType aType) + FilterNodeD2D1(ID2D1Effect* aEffect, FilterType aType) : mEffect(aEffect), mType(aType) { InitUnmappedProperties(); } virtual FilterBackend GetBackendType() { return FILTER_BACKEND_DIRECT2D1_1; } - virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface); - virtual void SetInput(uint32_t aIndex, FilterNode *aFilter); + virtual void SetInput(uint32_t aIndex, SourceSurface* aSurface); + virtual void SetInput(uint32_t aIndex, FilterNode* aFilter); virtual void SetAttribute(uint32_t aIndex, uint32_t aValue); virtual void SetAttribute(uint32_t aIndex, Float aValue); - virtual void SetAttribute(uint32_t aIndex, const Point &aValue); - virtual void SetAttribute(uint32_t aIndex, const Matrix5x4 &aValue); - virtual void SetAttribute(uint32_t aIndex, const Point3D &aValue); - virtual void SetAttribute(uint32_t aIndex, const Size &aValue); - virtual void SetAttribute(uint32_t aIndex, const IntSize &aValue); - virtual void SetAttribute(uint32_t aIndex, const Color &aValue); - virtual void SetAttribute(uint32_t aIndex, const Rect &aValue); - virtual void SetAttribute(uint32_t aIndex, const IntRect &aValue); + virtual void SetAttribute(uint32_t aIndex, const Point& aValue); + virtual void SetAttribute(uint32_t aIndex, const Matrix5x4& aValue); + virtual void SetAttribute(uint32_t aIndex, const Point3D& aValue); + virtual void SetAttribute(uint32_t aIndex, const Size& aValue); + virtual void SetAttribute(uint32_t aIndex, const IntSize& aValue); + virtual void SetAttribute(uint32_t aIndex, const Color& aValue); + virtual void SetAttribute(uint32_t aIndex, const Rect& aValue); + virtual void SetAttribute(uint32_t aIndex, const IntRect& aValue); virtual void SetAttribute(uint32_t aIndex, bool aValue); - virtual void SetAttribute(uint32_t aIndex, const Float *aValues, + virtual void SetAttribute(uint32_t aIndex, const Float* aValues, uint32_t aSize); - virtual void SetAttribute(uint32_t aIndex, const IntPoint &aValue); - virtual void SetAttribute(uint32_t aIndex, const Matrix &aValue); + virtual void SetAttribute(uint32_t aIndex, const IntPoint& aValue); + virtual void SetAttribute(uint32_t aIndex, const Matrix& aValue); // Called by DrawTarget before it draws our OutputEffect, and recursively // by the filter nodes that have this filter as one of their inputs. This // gives us a chance to convert any input surfaces to the target format for // the DrawTarget that we will draw to. - virtual void WillDraw(DrawTarget *aDT); + virtual void WillDraw(DrawTarget* aDT); - virtual ID2D1Effect *MainEffect() { return mEffect.get(); } - virtual ID2D1Effect *InputEffect() { return mEffect.get(); } - virtual ID2D1Effect *OutputEffect() { return mEffect.get(); } + virtual ID2D1Effect* MainEffect() { return mEffect.get(); } + virtual ID2D1Effect* InputEffect() { return mEffect.get(); } + virtual ID2D1Effect* OutputEffect() { return mEffect.get(); } protected: friend class DrawTargetD2D1; @@ -79,16 +79,16 @@ class FilterNodeD2D1 : public FilterNode { class FilterNodeConvolveD2D1 : public FilterNodeD2D1 { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeConvolveD2D1, override) - explicit FilterNodeConvolveD2D1(ID2D1DeviceContext *aDC); + explicit FilterNodeConvolveD2D1(ID2D1DeviceContext* aDC); - void SetInput(uint32_t aIndex, FilterNode *aFilter) override; + void SetInput(uint32_t aIndex, FilterNode* aFilter) override; void SetAttribute(uint32_t aIndex, uint32_t aValue) override; - void SetAttribute(uint32_t aIndex, const IntSize &aValue) override; - void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override; - void SetAttribute(uint32_t aIndex, const IntRect &aValue) override; + void SetAttribute(uint32_t aIndex, const IntSize& aValue) override; + void SetAttribute(uint32_t aIndex, const IntPoint& aValue) override; + void SetAttribute(uint32_t aIndex, const IntRect& aValue) override; - ID2D1Effect *InputEffect() override; + ID2D1Effect* InputEffect() override; private: using FilterNode::SetAttribute; @@ -109,7 +109,7 @@ class FilterNodeConvolveD2D1 : public FilterNodeD2D1 { class FilterNodeOpacityD2D1 : public FilterNodeD2D1 { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeOpacityD2D1, override) - FilterNodeOpacityD2D1(ID2D1Effect *aEffect, FilterType aType) + FilterNodeOpacityD2D1(ID2D1Effect* aEffect, FilterType aType) : FilterNodeD2D1(aEffect, aType) {} void SetAttribute(uint32_t aIndex, Float aValue) override; @@ -119,12 +119,12 @@ class FilterNodeExtendInputAdapterD2D1 : public FilterNodeD2D1 { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeExtendInputAdapterD2D1, override) - FilterNodeExtendInputAdapterD2D1(ID2D1DeviceContext *aDC, - FilterNodeD2D1 *aFilterNode, + FilterNodeExtendInputAdapterD2D1(ID2D1DeviceContext* aDC, + FilterNodeD2D1* aFilterNode, FilterType aType); - ID2D1Effect *InputEffect() override { return mExtendInputEffect.get(); } - ID2D1Effect *OutputEffect() override { + ID2D1Effect* InputEffect() override { return mExtendInputEffect.get(); } + ID2D1Effect* OutputEffect() override { return mWrappedFilterNode->OutputEffect(); } @@ -137,12 +137,12 @@ class FilterNodePremultiplyAdapterD2D1 : public FilterNodeD2D1 { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodePremultiplyAdapterD2D1, override) - FilterNodePremultiplyAdapterD2D1(ID2D1DeviceContext *aDC, - FilterNodeD2D1 *aFilterNode, + FilterNodePremultiplyAdapterD2D1(ID2D1DeviceContext* aDC, + FilterNodeD2D1* aFilterNode, FilterType aType); - ID2D1Effect *InputEffect() override { return mPrePremultiplyEffect.get(); } - ID2D1Effect *OutputEffect() override { + ID2D1Effect* InputEffect() override { return mPrePremultiplyEffect.get(); } + ID2D1Effect* OutputEffect() override { return mPostUnpremultiplyEffect.get(); } diff --git a/gfx/2d/FilterNodeSoftware.cpp b/gfx/2d/FilterNodeSoftware.cpp index 114ebecbfa8c5..cec55607f7a0e 100644 --- a/gfx/2d/FilterNodeSoftware.cpp +++ b/gfx/2d/FilterNodeSoftware.cpp @@ -103,10 +103,10 @@ class PowCache { class PointLightSoftware { public: bool SetAttribute(uint32_t aIndex, Float) { return false; } - bool SetAttribute(uint32_t aIndex, const Point3D &); + bool SetAttribute(uint32_t aIndex, const Point3D&); void Prepare() {} - Point3D GetVectorToLight(const Point3D &aTargetPoint); - uint32_t GetColor(uint32_t aLightColor, const Point3D &aVectorToLight); + Point3D GetVectorToLight(const Point3D& aTargetPoint); + uint32_t GetColor(uint32_t aLightColor, const Point3D& aVectorToLight); private: Point3D mPosition; @@ -116,10 +116,10 @@ class SpotLightSoftware { public: SpotLightSoftware(); bool SetAttribute(uint32_t aIndex, Float); - bool SetAttribute(uint32_t aIndex, const Point3D &); + bool SetAttribute(uint32_t aIndex, const Point3D&); void Prepare(); - Point3D GetVectorToLight(const Point3D &aTargetPoint); - uint32_t GetColor(uint32_t aLightColor, const Point3D &aVectorToLight); + Point3D GetVectorToLight(const Point3D& aTargetPoint); + uint32_t GetColor(uint32_t aLightColor, const Point3D& aVectorToLight); private: Point3D mPosition; @@ -135,10 +135,10 @@ class DistantLightSoftware { public: DistantLightSoftware(); bool SetAttribute(uint32_t aIndex, Float); - bool SetAttribute(uint32_t aIndex, const Point3D &) { return false; } + bool SetAttribute(uint32_t aIndex, const Point3D&) { return false; } void Prepare(); - Point3D GetVectorToLight(const Point3D &aTargetPoint); - uint32_t GetColor(uint32_t aLightColor, const Point3D &aVectorToLight); + Point3D GetVectorToLight(const Point3D& aTargetPoint); + uint32_t GetColor(uint32_t aLightColor, const Point3D& aVectorToLight); private: Float mAzimuth; @@ -151,7 +151,7 @@ class DiffuseLightingSoftware { DiffuseLightingSoftware(); bool SetAttribute(uint32_t aIndex, Float); void Prepare() {} - uint32_t LightPixel(const Point3D &aNormal, const Point3D &aVectorToLight, + uint32_t LightPixel(const Point3D& aNormal, const Point3D& aVectorToLight, uint32_t aColor); private: @@ -163,7 +163,7 @@ class SpecularLightingSoftware { SpecularLightingSoftware(); bool SetAttribute(uint32_t aIndex, Float); void Prepare(); - uint32_t LightPixel(const Point3D &aNormal, const Point3D &aVectorToLight, + uint32_t LightPixel(const Point3D& aNormal, const Point3D& aVectorToLight, uint32_t aColor); private: @@ -181,12 +181,12 @@ static int32_t NS_lround(double x) { } static already_AddRefed CloneAligned( - DataSourceSurface *aSource) { + DataSourceSurface* aSource) { return CreateDataSourceSurfaceByCloning(aSource); } -static void FillRectWithPixel(DataSourceSurface *aSurface, - const IntRect &aFillRect, IntPoint aPixelPos) { +static void FillRectWithPixel(DataSourceSurface* aSurface, + const IntRect& aFillRect, IntPoint aPixelPos) { MOZ_ASSERT(!aFillRect.Overflows()); MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aFillRect), "aFillRect needs to be completely inside the surface"); @@ -197,17 +197,17 @@ static void FillRectWithPixel(DataSourceSurface *aSurface, if (MOZ2D_WARN_IF(!surfMap.IsMapped())) { return; } - uint8_t *sourcePixelData = + uint8_t* sourcePixelData = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aPixelPos); - uint8_t *data = + uint8_t* data = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aFillRect.TopLeft()); int bpp = BytesPerPixel(aSurface->GetFormat()); // Fill the first row by hand. if (bpp == 4) { - uint32_t sourcePixel = *(uint32_t *)sourcePixelData; + uint32_t sourcePixel = *(uint32_t*)sourcePixelData; for (int32_t x = 0; x < aFillRect.Width(); x++) { - *((uint32_t *)data + x) = sourcePixel; + *((uint32_t*)data + x) = sourcePixel; } } else if (BytesPerPixel(aSurface->GetFormat()) == 1) { uint8_t sourcePixel = *sourcePixelData; @@ -221,8 +221,8 @@ static void FillRectWithPixel(DataSourceSurface *aSurface, } static void FillRectWithVerticallyRepeatingHorizontalStrip( - DataSourceSurface *aSurface, const IntRect &aFillRect, - const IntRect &aSampleRect) { + DataSourceSurface* aSurface, const IntRect& aFillRect, + const IntRect& aSampleRect) { MOZ_ASSERT(!aFillRect.Overflows()); MOZ_ASSERT(!aSampleRect.Overflows()); MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aFillRect), @@ -235,13 +235,13 @@ static void FillRectWithVerticallyRepeatingHorizontalStrip( return; } - uint8_t *sampleData = + uint8_t* sampleData = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aSampleRect.TopLeft()); - uint8_t *data = + uint8_t* data = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aFillRect.TopLeft()); if (BytesPerPixel(aSurface->GetFormat()) == 4) { for (int32_t y = 0; y < aFillRect.Height(); y++) { - PodCopy((uint32_t *)data, (uint32_t *)sampleData, aFillRect.Width()); + PodCopy((uint32_t*)data, (uint32_t*)sampleData, aFillRect.Width()); data += surfMap.GetStride(); } } else if (BytesPerPixel(aSurface->GetFormat()) == 1) { @@ -253,8 +253,8 @@ static void FillRectWithVerticallyRepeatingHorizontalStrip( } static void FillRectWithHorizontallyRepeatingVerticalStrip( - DataSourceSurface *aSurface, const IntRect &aFillRect, - const IntRect &aSampleRect) { + DataSourceSurface* aSurface, const IntRect& aFillRect, + const IntRect& aSampleRect) { MOZ_ASSERT(!aFillRect.Overflows()); MOZ_ASSERT(!aSampleRect.Overflows()); MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aFillRect), @@ -267,15 +267,15 @@ static void FillRectWithHorizontallyRepeatingVerticalStrip( return; } - uint8_t *sampleData = + uint8_t* sampleData = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aSampleRect.TopLeft()); - uint8_t *data = + uint8_t* data = DataAtOffset(aSurface, surfMap.GetMappedSurface(), aFillRect.TopLeft()); if (BytesPerPixel(aSurface->GetFormat()) == 4) { for (int32_t y = 0; y < aFillRect.Height(); y++) { - int32_t sampleColor = *((uint32_t *)sampleData); + int32_t sampleColor = *((uint32_t*)sampleData); for (int32_t x = 0; x < aFillRect.Width(); x++) { - *((uint32_t *)data + x) = sampleColor; + *((uint32_t*)data + x) = sampleColor; } data += surfMap.GetStride(); sampleData += surfMap.GetStride(); @@ -290,8 +290,8 @@ static void FillRectWithHorizontallyRepeatingVerticalStrip( } } -static void DuplicateEdges(DataSourceSurface *aSurface, - const IntRect &aFromRect) { +static void DuplicateEdges(DataSourceSurface* aSurface, + const IntRect& aFromRect) { MOZ_ASSERT(!aFromRect.Overflows()); MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aFromRect), "aFromRect needs to be completely inside the surface"); @@ -357,16 +357,16 @@ static void DuplicateEdges(DataSourceSurface *aSurface, } } -static IntPoint TileIndex(const IntRect &aFirstTileRect, - const IntPoint &aPoint) { +static IntPoint TileIndex(const IntRect& aFirstTileRect, + const IntPoint& aPoint) { return IntPoint(int32_t(floor(double(aPoint.x - aFirstTileRect.X()) / aFirstTileRect.Width())), int32_t(floor(double(aPoint.y - aFirstTileRect.Y()) / aFirstTileRect.Height()))); } -static void TileSurface(DataSourceSurface *aSource, DataSourceSurface *aTarget, - const IntPoint &aOffset) { +static void TileSurface(DataSourceSurface* aSource, DataSourceSurface* aTarget, + const IntPoint& aOffset) { IntRect sourceRect(aOffset, aSource->GetSize()); IntRect targetRect(IntPoint(0, 0), aTarget->GetSize()); IntPoint startIndex = TileIndex(sourceRect, targetRect.TopLeft()); @@ -385,8 +385,8 @@ static void TileSurface(DataSourceSurface *aSource, DataSourceSurface *aTarget, } static already_AddRefed GetDataSurfaceInRect( - SourceSurface *aSurface, const IntRect &aSurfaceRect, - const IntRect &aDestRect, ConvolveMatrixEdgeMode aEdgeMode) { + SourceSurface* aSurface, const IntRect& aSurfaceRect, + const IntRect& aDestRect, ConvolveMatrixEdgeMode aEdgeMode) { MOZ_ASSERT(aSurface ? aSurfaceRect.Size() == aSurface->GetSize() : aSurfaceRect.IsEmpty()); @@ -539,9 +539,9 @@ already_AddRefed FilterNodeSoftware::Create(FilterType aType) { return filter.forget(); } -void FilterNodeSoftware::Draw(DrawTarget *aDrawTarget, const Rect &aSourceRect, - const Point &aDestPoint, - const DrawOptions &aOptions) { +void FilterNodeSoftware::Draw(DrawTarget* aDrawTarget, const Rect& aSourceRect, + const Point& aDestPoint, + const DrawOptions& aOptions) { #ifdef DEBUG_DUMP_SURFACES printf("
\nRendering filter %s...\n",
          GetName());
@@ -607,7 +607,7 @@ void FilterNodeSoftware::Draw(DrawTarget *aDrawTarget, const Rect &aSourceRect,
 }
 
 already_AddRefed FilterNodeSoftware::GetOutput(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   MOZ_ASSERT(GetOutputRectInRect(aRect).Contains(aRect));
 
   if (aRect.Overflows()) {
@@ -655,7 +655,7 @@ already_AddRefed FilterNodeSoftware::GetOutput(
   return GetDataSurfaceInRect(cachedOutput, cachedRect, aRect, EDGE_MODE_NONE);
 }
 
-void FilterNodeSoftware::RequestRect(const IntRect &aRect) {
+void FilterNodeSoftware::RequestRect(const IntRect& aRect) {
   if (mRequestedRect.Contains(aRect)) {
     // Bail out now. Otherwise pathological filters can spend time exponential
     // in the number of primitives, e.g. if each primitive takes the
@@ -667,9 +667,9 @@ void FilterNodeSoftware::RequestRect(const IntRect &aRect) {
 }
 
 IntRect FilterNodeSoftware::MapInputRectToSource(uint32_t aInputEnumIndex,
-                                                 const IntRect &aRect,
-                                                 const IntRect &aMax,
-                                                 FilterNode *aSourceNode) {
+                                                 const IntRect& aRect,
+                                                 const IntRect& aMax,
+                                                 FilterNode* aSourceNode) {
   int32_t inputIndex = InputIndex(aInputEnumIndex);
   if (inputIndex < 0) {
     gfxDevCrash(LogReason::FilterInputError)
@@ -694,7 +694,7 @@ IntRect FilterNodeSoftware::MapInputRectToSource(uint32_t aInputEnumIndex,
 }
 
 void FilterNodeSoftware::RequestInputRect(uint32_t aInputEnumIndex,
-                                          const IntRect &aRect) {
+                                          const IntRect& aRect) {
   if (aRect.Overflows()) {
     return;
   }
@@ -723,9 +723,9 @@ SurfaceFormat FilterNodeSoftware::DesiredFormat(SurfaceFormat aCurrentFormat,
 
 already_AddRefed
 FilterNodeSoftware::GetInputDataSourceSurface(
-    uint32_t aInputEnumIndex, const IntRect &aRect, FormatHint aFormatHint,
+    uint32_t aInputEnumIndex, const IntRect& aRect, FormatHint aFormatHint,
     ConvolveMatrixEdgeMode aEdgeMode,
-    const IntRect *aTransparencyPaddedSourceRect) {
+    const IntRect* aTransparencyPaddedSourceRect) {
   if (aRect.Overflows()) {
     return nullptr;
   }
@@ -847,7 +847,7 @@ FilterNodeSoftware::GetInputDataSourceSurface(
 }
 
 IntRect FilterNodeSoftware::GetInputRectInRect(uint32_t aInputEnumIndex,
-                                               const IntRect &aInRect) {
+                                               const IntRect& aInRect) {
   if (aInRect.Overflows()) {
     return IntRect();
   }
@@ -871,20 +871,20 @@ size_t FilterNodeSoftware::NumberOfSetInputs() {
 }
 
 void FilterNodeSoftware::AddInvalidationListener(
-    FilterInvalidationListener *aListener) {
+    FilterInvalidationListener* aListener) {
   MOZ_ASSERT(aListener, "null listener");
   mInvalidationListeners.push_back(aListener);
 }
 
 void FilterNodeSoftware::RemoveInvalidationListener(
-    FilterInvalidationListener *aListener) {
+    FilterInvalidationListener* aListener) {
   MOZ_ASSERT(aListener, "null listener");
-  std::vector::iterator it = std::find(
+  std::vector::iterator it = std::find(
       mInvalidationListeners.begin(), mInvalidationListeners.end(), aListener);
   mInvalidationListeners.erase(it);
 }
 
-void FilterNodeSoftware::FilterInvalidated(FilterNodeSoftware *aFilter) {
+void FilterNodeSoftware::FilterInvalidated(FilterNodeSoftware* aFilter) {
   Invalidate();
 }
 
@@ -892,7 +892,7 @@ void FilterNodeSoftware::Invalidate() {
   MutexAutoLock lock(mCacheMutex);
   mCachedOutput = nullptr;
   mCachedRect = IntRect();
-  for (std::vector::iterator it =
+  for (std::vector::iterator it =
            mInvalidationListeners.begin();
        it != mInvalidationListeners.end(); it++) {
     (*it)->FilterInvalidated(this);
@@ -916,21 +916,21 @@ FilterNodeSoftware::~FilterNodeSoftware() {
   }
 }
 
-void FilterNodeSoftware::SetInput(uint32_t aIndex, FilterNode *aFilter) {
+void FilterNodeSoftware::SetInput(uint32_t aIndex, FilterNode* aFilter) {
   if (aFilter && aFilter->GetBackendType() != FILTER_BACKEND_SOFTWARE) {
     MOZ_ASSERT(false, "can only take software filters as inputs");
     return;
   }
-  SetInput(aIndex, nullptr, static_cast(aFilter));
+  SetInput(aIndex, nullptr, static_cast(aFilter));
 }
 
-void FilterNodeSoftware::SetInput(uint32_t aIndex, SourceSurface *aSurface) {
+void FilterNodeSoftware::SetInput(uint32_t aIndex, SourceSurface* aSurface) {
   SetInput(aIndex, aSurface, nullptr);
 }
 
 void FilterNodeSoftware::SetInput(uint32_t aInputEnumIndex,
-                                  SourceSurface *aSurface,
-                                  FilterNodeSoftware *aFilter) {
+                                  SourceSurface* aSurface,
+                                  FilterNodeSoftware* aFilter) {
   int32_t inputIndex = InputIndex(aInputEnumIndex);
   if (inputIndex < 0) {
     gfxDevCrash(LogReason::FilterInputSet) << "Invalid set " << inputIndex;
@@ -1016,7 +1016,7 @@ static CompositionOp ToBlendOp(BlendMode aOp) {
 }
 
 already_AddRefed FilterNodeBlendSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RefPtr input1 =
       GetInputDataSourceSurface(IN_BLEND_IN, aRect, NEED_COLOR_CHANNELS);
   RefPtr input2 =
@@ -1074,20 +1074,20 @@ already_AddRefed FilterNodeBlendSoftware::Render(
   return target.forget();
 }
 
-void FilterNodeBlendSoftware::RequestFromInputsForRect(const IntRect &aRect) {
+void FilterNodeBlendSoftware::RequestFromInputsForRect(const IntRect& aRect) {
   RequestInputRect(IN_BLEND_IN, aRect);
   RequestInputRect(IN_BLEND_IN2, aRect);
 }
 
-IntRect FilterNodeBlendSoftware::MapRectToSource(const IntRect &aRect,
-                                                 const IntRect &aMax,
-                                                 FilterNode *aSourceNode) {
+IntRect FilterNodeBlendSoftware::MapRectToSource(const IntRect& aRect,
+                                                 const IntRect& aMax,
+                                                 FilterNode* aSourceNode) {
   IntRect result = MapInputRectToSource(IN_BLEND_IN, aRect, aMax, aSourceNode);
   result.OrWith(MapInputRectToSource(IN_BLEND_IN2, aRect, aMax, aSourceNode));
   return result;
 }
 
-IntRect FilterNodeBlendSoftware::GetOutputRectInRect(const IntRect &aRect) {
+IntRect FilterNodeBlendSoftware::GetOutputRectInRect(const IntRect& aRect) {
   return GetInputRectInRect(IN_BLEND_IN, aRect)
       .Union(GetInputRectInRect(IN_BLEND_IN2, aRect))
       .Intersect(aRect);
@@ -1113,14 +1113,14 @@ void FilterNodeTransformSoftware::SetAttribute(uint32_t aIndex,
 }
 
 void FilterNodeTransformSoftware::SetAttribute(uint32_t aIndex,
-                                               const Matrix &aMatrix) {
+                                               const Matrix& aMatrix) {
   MOZ_ASSERT(aIndex == ATT_TRANSFORM_MATRIX);
   mMatrix = aMatrix;
   Invalidate();
 }
 
 IntRect FilterNodeTransformSoftware::SourceRectForOutputRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   if (aRect.IsEmpty()) {
     return IntRect();
   }
@@ -1139,9 +1139,9 @@ IntRect FilterNodeTransformSoftware::SourceRectForOutputRect(
   return GetInputRectInRect(IN_TRANSFORM_IN, neededIntRect);
 }
 
-IntRect FilterNodeTransformSoftware::MapRectToSource(const IntRect &aRect,
-                                                     const IntRect &aMax,
-                                                     FilterNode *aSourceNode) {
+IntRect FilterNodeTransformSoftware::MapRectToSource(const IntRect& aRect,
+                                                     const IntRect& aMax,
+                                                     FilterNode* aSourceNode) {
   if (aRect.IsEmpty()) {
     return IntRect();
   }
@@ -1162,7 +1162,7 @@ IntRect FilterNodeTransformSoftware::MapRectToSource(const IntRect &aRect,
 }
 
 already_AddRefed FilterNodeTransformSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   IntRect srcRect = SourceRectForOutputRect(aRect);
 
   RefPtr input =
@@ -1211,11 +1211,11 @@ already_AddRefed FilterNodeTransformSoftware::Render(
 }
 
 void FilterNodeTransformSoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RequestInputRect(IN_TRANSFORM_IN, SourceRectForOutputRect(aRect));
 }
 
-IntRect FilterNodeTransformSoftware::GetOutputRectInRect(const IntRect &aRect) {
+IntRect FilterNodeTransformSoftware::GetOutputRectInRect(const IntRect& aRect) {
   IntRect srcRect = SourceRectForOutputRect(aRect);
   if (srcRect.IsEmpty()) {
     return IntRect();
@@ -1243,7 +1243,7 @@ int32_t FilterNodeMorphologySoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 void FilterNodeMorphologySoftware::SetAttribute(uint32_t aIndex,
-                                                const IntSize &aRadii) {
+                                                const IntSize& aRadii) {
   MOZ_ASSERT(aIndex == ATT_MORPHOLOGY_RADII);
   mRadii.width = std::min(std::max(aRadii.width, 0), 100000);
   mRadii.height = std::min(std::max(aRadii.height, 0), 100000);
@@ -1258,8 +1258,8 @@ void FilterNodeMorphologySoftware::SetAttribute(uint32_t aIndex,
 }
 
 static already_AddRefed ApplyMorphology(
-    const IntRect &aSourceRect, DataSourceSurface *aInput,
-    const IntRect &aDestRect, int32_t rx, int32_t ry,
+    const IntRect& aSourceRect, DataSourceSurface* aInput,
+    const IntRect& aDestRect, int32_t rx, int32_t ry,
     MorphologyOperator aOperator) {
   IntRect srcRect = aSourceRect - aDestRect.TopLeft();
   IntRect destRect = aDestRect - aDestRect.TopLeft();
@@ -1287,9 +1287,9 @@ static already_AddRefed ApplyMorphology(
     if (MOZ2D_WARN_IF(!sourceMap.IsMapped() || !tmpMap.IsMapped())) {
       return nullptr;
     }
-    uint8_t *sourceData = DataAtOffset(aInput, sourceMap.GetMappedSurface(),
+    uint8_t* sourceData = DataAtOffset(aInput, sourceMap.GetMappedSurface(),
                                        destRect.TopLeft() - srcRect.TopLeft());
-    uint8_t *tmpData = DataAtOffset(tmp, tmpMap.GetMappedSurface(),
+    uint8_t* tmpData = DataAtOffset(tmp, tmpMap.GetMappedSurface(),
                                     destRect.TopLeft() - tmpRect.TopLeft());
 
     FilterProcessing::ApplyMorphologyHorizontal(
@@ -1313,11 +1313,11 @@ static already_AddRefed ApplyMorphology(
       return nullptr;
     }
     int32_t tmpStride = tmpMap.GetStride();
-    uint8_t *tmpData = DataAtOffset(tmp, tmpMap.GetMappedSurface(),
+    uint8_t* tmpData = DataAtOffset(tmp, tmpMap.GetMappedSurface(),
                                     destRect.TopLeft() - tmpRect.TopLeft());
 
     int32_t destStride = destMap.GetStride();
-    uint8_t *destData = destMap.GetData();
+    uint8_t* destData = destMap.GetData();
 
     FilterProcessing::ApplyMorphologyVertical(
         tmpData, tmpStride, destData, destStride, destRect, ry, aOperator);
@@ -1327,7 +1327,7 @@ static already_AddRefed ApplyMorphology(
 }
 
 already_AddRefed FilterNodeMorphologySoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   IntRect srcRect = aRect;
   srcRect.Inflate(mRadii);
 
@@ -1348,14 +1348,14 @@ already_AddRefed FilterNodeMorphologySoftware::Render(
 }
 
 void FilterNodeMorphologySoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   IntRect srcRect = aRect;
   srcRect.Inflate(mRadii);
   RequestInputRect(IN_MORPHOLOGY_IN, srcRect);
 }
 
 IntRect FilterNodeMorphologySoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   IntRect inflatedSourceRect = aRect;
   inflatedSourceRect.Inflate(mRadii);
   IntRect inputRect = GetInputRectInRect(IN_MORPHOLOGY_IN, inflatedSourceRect);
@@ -1377,7 +1377,7 @@ int32_t FilterNodeColorMatrixSoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 void FilterNodeColorMatrixSoftware::SetAttribute(uint32_t aIndex,
-                                                 const Matrix5x4 &aMatrix) {
+                                                 const Matrix5x4& aMatrix) {
   MOZ_ASSERT(aIndex == ATT_COLOR_MATRIX_MATRIX);
   mMatrix = aMatrix;
   Invalidate();
@@ -1391,7 +1391,7 @@ void FilterNodeColorMatrixSoftware::SetAttribute(uint32_t aIndex,
 }
 
 static already_AddRefed Premultiply(
-    DataSourceSurface *aSurface) {
+    DataSourceSurface* aSurface) {
   if (aSurface->GetFormat() == SurfaceFormat::A8) {
     RefPtr surface(aSurface);
     return surface.forget();
@@ -1410,9 +1410,9 @@ static already_AddRefed Premultiply(
     return nullptr;
   }
 
-  uint8_t *inputData = inputMap.GetData();
+  uint8_t* inputData = inputMap.GetData();
   int32_t inputStride = inputMap.GetStride();
-  uint8_t *targetData = targetMap.GetData();
+  uint8_t* targetData = targetMap.GetData();
   int32_t targetStride = targetMap.GetStride();
 
   FilterProcessing::DoPremultiplicationCalculation(
@@ -1422,7 +1422,7 @@ static already_AddRefed Premultiply(
 }
 
 static already_AddRefed Unpremultiply(
-    DataSourceSurface *aSurface) {
+    DataSourceSurface* aSurface) {
   if (aSurface->GetFormat() == SurfaceFormat::A8) {
     RefPtr surface(aSurface);
     return surface.forget();
@@ -1441,9 +1441,9 @@ static already_AddRefed Unpremultiply(
     return nullptr;
   }
 
-  uint8_t *inputData = inputMap.GetData();
+  uint8_t* inputData = inputMap.GetData();
   int32_t inputStride = inputMap.GetStride();
-  uint8_t *targetData = targetMap.GetData();
+  uint8_t* targetData = targetMap.GetData();
   int32_t targetStride = targetMap.GetStride();
 
   FilterProcessing::DoUnpremultiplicationCalculation(
@@ -1452,7 +1452,7 @@ static already_AddRefed Unpremultiply(
   return target.forget();
 }
 
-static already_AddRefed Opacity(DataSourceSurface *aSurface,
+static already_AddRefed Opacity(DataSourceSurface* aSurface,
                                                    Float aValue) {
   if (aValue == 1.0f) {
     RefPtr surface(aSurface);
@@ -1472,9 +1472,9 @@ static already_AddRefed Opacity(DataSourceSurface *aSurface,
     return nullptr;
   }
 
-  uint8_t *inputData = inputMap.GetData();
+  uint8_t* inputData = inputMap.GetData();
   int32_t inputStride = inputMap.GetStride();
-  uint8_t *targetData = targetMap.GetData();
+  uint8_t* targetData = targetMap.GetData();
   int32_t targetStride = targetMap.GetStride();
 
   if (aSurface->GetFormat() == SurfaceFormat::A8) {
@@ -1490,7 +1490,7 @@ static already_AddRefed Opacity(DataSourceSurface *aSurface,
 }
 
 already_AddRefed FilterNodeColorMatrixSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RefPtr input =
       GetInputDataSourceSurface(IN_COLOR_MATRIX_IN, aRect, NEED_COLOR_CHANNELS);
   if (!input) {
@@ -1512,17 +1512,17 @@ already_AddRefed FilterNodeColorMatrixSoftware::Render(
 }
 
 void FilterNodeColorMatrixSoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RequestInputRect(IN_COLOR_MATRIX_IN, aRect);
 }
 
 IntRect FilterNodeColorMatrixSoftware::MapRectToSource(
-    const IntRect &aRect, const IntRect &aMax, FilterNode *aSourceNode) {
+    const IntRect& aRect, const IntRect& aMax, FilterNode* aSourceNode) {
   return MapInputRectToSource(IN_COLOR_MATRIX_IN, aRect, aMax, aSourceNode);
 }
 
 IntRect FilterNodeColorMatrixSoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   if (mMatrix._54 > 0.0f) {
     return aRect;
   }
@@ -1530,13 +1530,13 @@ IntRect FilterNodeColorMatrixSoftware::GetOutputRectInRect(
 }
 
 void FilterNodeFloodSoftware::SetAttribute(uint32_t aIndex,
-                                           const Color &aColor) {
+                                           const Color& aColor) {
   MOZ_ASSERT(aIndex == ATT_FLOOD_COLOR);
   mColor = aColor;
   Invalidate();
 }
 
-static uint32_t ColorToBGRA(const Color &aColor) {
+static uint32_t ColorToBGRA(const Color& aColor) {
   union {
     uint32_t color;
     uint8_t components[4];
@@ -1559,7 +1559,7 @@ static SurfaceFormat FormatForColor(Color aColor) {
 }
 
 already_AddRefed FilterNodeFloodSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   SurfaceFormat format = FormatForColor(mColor);
   RefPtr target =
       Factory::CreateDataSourceSurface(aRect.Size(), format);
@@ -1572,14 +1572,14 @@ already_AddRefed FilterNodeFloodSoftware::Render(
     return nullptr;
   }
 
-  uint8_t *targetData = targetMap.GetData();
+  uint8_t* targetData = targetMap.GetData();
   int32_t stride = targetMap.GetStride();
 
   if (format == SurfaceFormat::B8G8R8A8) {
     uint32_t color = ColorToBGRA(mColor);
     for (int32_t y = 0; y < aRect.Height(); y++) {
       for (int32_t x = 0; x < aRect.Width(); x++) {
-        *((uint32_t *)targetData + x) = color;
+        *((uint32_t*)targetData + x) = color;
       }
       PodZero(&targetData[aRect.Width() * 4], stride - aRect.Width() * 4);
       targetData += stride;
@@ -1605,17 +1605,17 @@ already_AddRefed FilterNodeFloodSoftware::Render(
 // Override GetOutput to get around caching. Rendering simple floods is
 // comparatively fast.
 already_AddRefed FilterNodeFloodSoftware::GetOutput(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   return Render(aRect);
 }
 
-IntRect FilterNodeFloodSoftware::MapRectToSource(const IntRect &aRect,
-                                                 const IntRect &aMax,
-                                                 FilterNode *aSourceNode) {
+IntRect FilterNodeFloodSoftware::MapRectToSource(const IntRect& aRect,
+                                                 const IntRect& aMax,
+                                                 FilterNode* aSourceNode) {
   return IntRect();
 }
 
-IntRect FilterNodeFloodSoftware::GetOutputRectInRect(const IntRect &aRect) {
+IntRect FilterNodeFloodSoftware::GetOutputRectInRect(const IntRect& aRect) {
   if (mColor.a == 0.0f) {
     return IntRect();
   }
@@ -1632,7 +1632,7 @@ int32_t FilterNodeTileSoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 void FilterNodeTileSoftware::SetAttribute(uint32_t aIndex,
-                                          const IntRect &aSourceRect) {
+                                          const IntRect& aSourceRect) {
   MOZ_ASSERT(aIndex == ATT_TILE_SOURCE_RECT);
   mSourceRect.SetRect(int32_t(aSourceRect.X()), int32_t(aSourceRect.Y()),
                       int32_t(aSourceRect.Width()),
@@ -1642,7 +1642,7 @@ void FilterNodeTileSoftware::SetAttribute(uint32_t aIndex,
 
 namespace {
 struct CompareIntRects {
-  bool operator()(const IntRect &a, const IntRect &b) const {
+  bool operator()(const IntRect& a, const IntRect& b) const {
     if (a.X() != b.X()) {
       return a.X() < b.X();
     }
@@ -1659,7 +1659,7 @@ struct CompareIntRects {
 }  // namespace
 
 already_AddRefed FilterNodeTileSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   if (mSourceRect.IsEmpty()) {
     return nullptr;
   }
@@ -1726,14 +1726,14 @@ already_AddRefed FilterNodeTileSoftware::Render(
   return target.forget();
 }
 
-void FilterNodeTileSoftware::RequestFromInputsForRect(const IntRect &aRect) {
+void FilterNodeTileSoftware::RequestFromInputsForRect(const IntRect& aRect) {
   // Do not request anything.
   // Source rects for the tile filter can be discontinuous with large gaps
   // between them. Requesting those from our input filter might cause it to
   // render the whole bounding box of all of them, which would be wasteful.
 }
 
-IntRect FilterNodeTileSoftware::GetOutputRectInRect(const IntRect &aRect) {
+IntRect FilterNodeTileSoftware::GetOutputRectInRect(const IntRect& aRect) {
   return aRect;
 }
 
@@ -1780,7 +1780,7 @@ void FilterNodeComponentTransferSoftware::GenerateLookupTable(
 
 template 
 static void TransferComponents(
-    DataSourceSurface *aInput, DataSourceSurface *aTarget,
+    DataSourceSurface* aInput, DataSourceSurface* aTarget,
     const uint8_t aLookupTables[BytesPerPixel][256]) {
   MOZ_ASSERT(aInput->GetFormat() == aTarget->GetFormat(), "different formats");
   IntSize size = aInput->GetSize();
@@ -1791,9 +1791,9 @@ static void TransferComponents(
     return;
   }
 
-  uint8_t *sourceData = sourceMap.GetData();
+  uint8_t* sourceData = sourceMap.GetData();
   int32_t sourceStride = sourceMap.GetStride();
-  uint8_t *targetData = targetMap.GetData();
+  uint8_t* targetData = targetMap.GetData();
   int32_t targetStride = targetMap.GetStride();
 
   MOZ_ASSERT(sourceStride <= targetStride, "target smaller than source");
@@ -1824,7 +1824,7 @@ static bool IsAllZero(const uint8_t aLookupTable[256]) {
 }
 
 already_AddRefed FilterNodeComponentTransferSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   if (mDisableR && mDisableG && mDisableB && mDisableA) {
     return GetInputDataSourceSurface(IN_TRANSFER_IN, aRect);
   }
@@ -1881,17 +1881,17 @@ already_AddRefed FilterNodeComponentTransferSoftware::Render(
 }
 
 void FilterNodeComponentTransferSoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RequestInputRect(IN_TRANSFER_IN, aRect);
 }
 
 IntRect FilterNodeComponentTransferSoftware::MapRectToSource(
-    const IntRect &aRect, const IntRect &aMax, FilterNode *aSourceNode) {
+    const IntRect& aRect, const IntRect& aMax, FilterNode* aSourceNode) {
   return MapInputRectToSource(IN_TRANSFER_IN, aRect, aMax, aSourceNode);
 }
 
 IntRect FilterNodeComponentTransferSoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   if (mDisableA) {
     return GetInputRectInRect(IN_TRANSFER_IN, aRect);
   }
@@ -1909,7 +1909,7 @@ int32_t FilterNodeComponentTransferSoftware::InputIndex(
 }
 
 void FilterNodeTableTransferSoftware::SetAttribute(uint32_t aIndex,
-                                                   const Float *aFloat,
+                                                   const Float* aFloat,
                                                    uint32_t aSize) {
   std::vector table(aFloat, aFloat + aSize);
   switch (aIndex) {
@@ -1953,7 +1953,7 @@ void FilterNodeTableTransferSoftware::FillLookupTable(ptrdiff_t aComponent,
 }
 
 void FilterNodeTableTransferSoftware::FillLookupTableImpl(
-    std::vector &aTableValues, uint8_t aTable[256]) {
+    std::vector& aTableValues, uint8_t aTable[256]) {
   uint32_t tvLength = aTableValues.size();
   if (tvLength < 2) {
     return;
@@ -1972,7 +1972,7 @@ void FilterNodeTableTransferSoftware::FillLookupTableImpl(
 }
 
 void FilterNodeDiscreteTransferSoftware::SetAttribute(uint32_t aIndex,
-                                                      const Float *aFloat,
+                                                      const Float* aFloat,
                                                       uint32_t aSize) {
   std::vector discrete(aFloat, aFloat + aSize);
   switch (aIndex) {
@@ -2016,7 +2016,7 @@ void FilterNodeDiscreteTransferSoftware::FillLookupTable(ptrdiff_t aComponent,
 }
 
 void FilterNodeDiscreteTransferSoftware::FillLookupTableImpl(
-    std::vector &aTableValues, uint8_t aTable[256]) {
+    std::vector& aTableValues, uint8_t aTable[256]) {
   uint32_t tvLength = aTableValues.size();
   if (tvLength < 1) {
     return;
@@ -2216,14 +2216,14 @@ int32_t FilterNodeConvolveMatrixSoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 void FilterNodeConvolveMatrixSoftware::SetAttribute(
-    uint32_t aIndex, const IntSize &aKernelSize) {
+    uint32_t aIndex, const IntSize& aKernelSize) {
   MOZ_ASSERT(aIndex == ATT_CONVOLVE_MATRIX_KERNEL_SIZE);
   mKernelSize = aKernelSize;
   Invalidate();
 }
 
 void FilterNodeConvolveMatrixSoftware::SetAttribute(uint32_t aIndex,
-                                                    const Float *aMatrix,
+                                                    const Float* aMatrix,
                                                     uint32_t aSize) {
   MOZ_ASSERT(aIndex == ATT_CONVOLVE_MATRIX_KERNEL_MATRIX);
   mKernelMatrix = std::vector(aMatrix, aMatrix + aSize);
@@ -2246,7 +2246,7 @@ void FilterNodeConvolveMatrixSoftware::SetAttribute(uint32_t aIndex,
 }
 
 void FilterNodeConvolveMatrixSoftware::SetAttribute(
-    uint32_t aIndex, const Size &aKernelUnitLength) {
+    uint32_t aIndex, const Size& aKernelUnitLength) {
   switch (aIndex) {
     case ATT_CONVOLVE_MATRIX_KERNEL_UNIT_LENGTH:
       mKernelUnitLength = aKernelUnitLength;
@@ -2258,14 +2258,14 @@ void FilterNodeConvolveMatrixSoftware::SetAttribute(
 }
 
 void FilterNodeConvolveMatrixSoftware::SetAttribute(uint32_t aIndex,
-                                                    const IntPoint &aTarget) {
+                                                    const IntPoint& aTarget) {
   MOZ_ASSERT(aIndex == ATT_CONVOLVE_MATRIX_TARGET);
   mTarget = aTarget;
   Invalidate();
 }
 
 void FilterNodeConvolveMatrixSoftware::SetAttribute(
-    uint32_t aIndex, const IntRect &aSourceRect) {
+    uint32_t aIndex, const IntRect& aSourceRect) {
   MOZ_ASSERT(aIndex == ATT_CONVOLVE_MATRIX_SOURCE_RECT);
   mSourceRect = aSourceRect;
   Invalidate();
@@ -2287,8 +2287,8 @@ void FilterNodeConvolveMatrixSoftware::SetAttribute(uint32_t aIndex,
 
 #ifdef DEBUG
 static inline void DebugOnlyCheckColorSamplingAccess(
-    const uint8_t *aSampleAddress, const uint8_t *aBoundsBegin,
-    const uint8_t *aBoundsEnd) {
+    const uint8_t* aSampleAddress, const uint8_t* aBoundsBegin,
+    const uint8_t* aBoundsEnd) {
   MOZ_ASSERT(aSampleAddress >= aBoundsBegin, "accessing before start");
   MOZ_ASSERT(aSampleAddress < aBoundsEnd, "accessing after end");
 }
@@ -2297,28 +2297,28 @@ static inline void DebugOnlyCheckColorSamplingAccess(
 #endif
 
 static inline uint8_t ColorComponentAtPoint(
-    const uint8_t *aData, int32_t aStride, const uint8_t *aBoundsBegin,
-    const uint8_t *aBoundsEnd, int32_t x, int32_t y, size_t bpp, ptrdiff_t c) {
+    const uint8_t* aData, int32_t aStride, const uint8_t* aBoundsBegin,
+    const uint8_t* aBoundsEnd, int32_t x, int32_t y, size_t bpp, ptrdiff_t c) {
   DebugOnlyCheckColorSamplingAccess(&aData[y * aStride + bpp * x + c],
                                     aBoundsBegin, aBoundsEnd);
   return aData[y * aStride + bpp * x + c];
 }
 
-static inline int32_t ColorAtPoint(const uint8_t *aData, int32_t aStride,
-                                   const uint8_t *aBoundsBegin,
-                                   const uint8_t *aBoundsEnd, int32_t x,
+static inline int32_t ColorAtPoint(const uint8_t* aData, int32_t aStride,
+                                   const uint8_t* aBoundsBegin,
+                                   const uint8_t* aBoundsEnd, int32_t x,
                                    int32_t y) {
   DebugOnlyCheckColorSamplingAccess(aData + y * aStride + 4 * x, aBoundsBegin,
                                     aBoundsEnd);
-  return *(uint32_t *)(aData + y * aStride + 4 * x);
+  return *(uint32_t*)(aData + y * aStride + 4 * x);
 }
 
 // Accepts fractional x & y and does bilinear interpolation.
 // Only call this if the pixel (floor(x)+1, floor(y)+1) is accessible.
-static inline uint8_t ColorComponentAtPoint(const uint8_t *aData,
+static inline uint8_t ColorComponentAtPoint(const uint8_t* aData,
                                             int32_t aStride,
-                                            const uint8_t *aBoundsBegin,
-                                            const uint8_t *aBoundsEnd, Float x,
+                                            const uint8_t* aBoundsBegin,
+                                            const uint8_t* aBoundsEnd, Float x,
                                             Float y, size_t bpp, ptrdiff_t c) {
   const uint32_t f = 256;
   const int32_t lx = floor(x);
@@ -2327,13 +2327,13 @@ static inline uint8_t ColorComponentAtPoint(const uint8_t *aData,
   const int32_t tlx = f - tux;
   const int32_t tuy = uint32_t((y - ly) * f);
   const int32_t tly = f - tuy;
-  const uint8_t &cll = ColorComponentAtPoint(aData, aStride, aBoundsBegin,
+  const uint8_t& cll = ColorComponentAtPoint(aData, aStride, aBoundsBegin,
                                              aBoundsEnd, lx, ly, bpp, c);
-  const uint8_t &cul = ColorComponentAtPoint(aData, aStride, aBoundsBegin,
+  const uint8_t& cul = ColorComponentAtPoint(aData, aStride, aBoundsBegin,
                                              aBoundsEnd, lx + 1, ly, bpp, c);
-  const uint8_t &clu = ColorComponentAtPoint(aData, aStride, aBoundsBegin,
+  const uint8_t& clu = ColorComponentAtPoint(aData, aStride, aBoundsBegin,
                                              aBoundsEnd, lx, ly + 1, bpp, c);
-  const uint8_t &cuu = ColorComponentAtPoint(
+  const uint8_t& cuu = ColorComponentAtPoint(
       aData, aStride, aBoundsBegin, aBoundsEnd, lx + 1, ly + 1, bpp, c);
   return ((cll * tlx + cul * tux) * tly + (clu * tlx + cuu * tux) * tuy +
           f * f / 2) /
@@ -2343,12 +2343,12 @@ static inline uint8_t ColorComponentAtPoint(const uint8_t *aData,
 static int32_t ClampToNonZero(int32_t a) { return a * (a >= 0); }
 
 template 
-static void ConvolvePixel(const uint8_t *aSourceData, uint8_t *aTargetData,
+static void ConvolvePixel(const uint8_t* aSourceData, uint8_t* aTargetData,
                           int32_t aWidth, int32_t aHeight,
                           int32_t aSourceStride, int32_t aTargetStride,
-                          const uint8_t *aSourceBegin,
-                          const uint8_t *aSourceEnd, int32_t aX, int32_t aY,
-                          const int32_t *aKernel, int32_t aBias, int32_t shiftL,
+                          const uint8_t* aSourceBegin,
+                          const uint8_t* aSourceEnd, int32_t aX, int32_t aY,
+                          const int32_t* aKernel, int32_t aBias, int32_t shiftL,
                           int32_t shiftR, bool aPreserveAlpha, int32_t aOrderX,
                           int32_t aOrderY, int32_t aTargetX, int32_t aTargetY,
                           CoordType aKernelUnitLengthX,
@@ -2386,7 +2386,7 @@ static void ConvolvePixel(const uint8_t *aSourceData, uint8_t *aTargetData,
 }
 
 already_AddRefed FilterNodeConvolveMatrixSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   if (mKernelUnitLength.width == floor(mKernelUnitLength.width) &&
       mKernelUnitLength.height == floor(mKernelUnitLength.height)) {
     return DoRender(aRect, (int32_t)mKernelUnitLength.width,
@@ -2395,7 +2395,7 @@ already_AddRefed FilterNodeConvolveMatrixSoftware::Render(
   return DoRender(aRect, mKernelUnitLength.width, mKernelUnitLength.height);
 }
 
-static std::vector ReversedVector(const std::vector &aVector) {
+static std::vector ReversedVector(const std::vector& aVector) {
   size_t length = aVector.size();
   std::vector result(length, 0);
   for (size_t i = 0; i < length; i++) {
@@ -2404,7 +2404,7 @@ static std::vector ReversedVector(const std::vector &aVector) {
   return result;
 }
 
-static std::vector ScaledVector(const std::vector &aVector,
+static std::vector ScaledVector(const std::vector& aVector,
                                        Float aDivisor) {
   size_t length = aVector.size();
   std::vector result(length, 0);
@@ -2414,7 +2414,7 @@ static std::vector ScaledVector(const std::vector &aVector,
   return result;
 }
 
-static Float MaxVectorSum(const std::vector &aVector) {
+static Float MaxVectorSum(const std::vector& aVector) {
   Float sum = 0;
   size_t length = aVector.size();
   for (size_t i = 0; i < length; i++) {
@@ -2427,8 +2427,8 @@ static Float MaxVectorSum(const std::vector &aVector) {
 
 // Returns shiftL and shiftR in such a way that
 // a << shiftL >> shiftR is roughly a * aFloat.
-static void TranslateDoubleToShifts(double aDouble, int32_t &aShiftL,
-                                    int32_t &aShiftR) {
+static void TranslateDoubleToShifts(double aDouble, int32_t& aShiftL,
+                                    int32_t& aShiftR) {
   aShiftL = 0;
   aShiftR = 0;
   if (aDouble <= 0) {
@@ -2447,7 +2447,7 @@ static void TranslateDoubleToShifts(double aDouble, int32_t &aShiftL,
 
 template 
 already_AddRefed FilterNodeConvolveMatrixSoftware::DoRender(
-    const IntRect &aRect, CoordType aKernelUnitLengthX,
+    const IntRect& aRect, CoordType aKernelUnitLengthX,
     CoordType aKernelUnitLengthY) {
   if (mKernelSize.width <= 0 || mKernelSize.height <= 0 ||
       mKernelMatrix.size() !=
@@ -2486,12 +2486,12 @@ already_AddRefed FilterNodeConvolveMatrixSoftware::DoRender(
     return nullptr;
   }
 
-  uint8_t *sourceData =
+  uint8_t* sourceData =
       DataAtOffset(input, sourceMap.GetMappedSurface(), offset);
   int32_t sourceStride = sourceMap.GetStride();
-  uint8_t *sourceBegin = sourceMap.GetData();
-  uint8_t *sourceEnd = sourceBegin + sourceStride * input->GetSize().height;
-  uint8_t *targetData = targetMap.GetData();
+  uint8_t* sourceBegin = sourceMap.GetData();
+  uint8_t* sourceEnd = sourceBegin + sourceStride * input->GetSize().height;
+  uint8_t* targetData = targetMap.GetData();
   int32_t targetStride = targetMap.GetStride();
 
   // Why exactly are we reversing the kernel?
@@ -2510,7 +2510,7 @@ already_AddRefed FilterNodeConvolveMatrixSoftware::DoRender(
   MOZ_ASSERT(255.0 * maxResultAbs * factorFromShifts <= INT32_MAX / 2.0,
              "badly chosen float-to-int scale");
 
-  int32_t *intKernel = new int32_t[kernel.size()];
+  int32_t* intKernel = new int32_t[kernel.size()];
   for (size_t i = 0; i < kernel.size(); i++) {
     intKernel[i] = NS_lround(kernel[i] * factorFromShifts);
   }
@@ -2531,18 +2531,18 @@ already_AddRefed FilterNodeConvolveMatrixSoftware::DoRender(
 }
 
 void FilterNodeConvolveMatrixSoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RequestInputRect(IN_CONVOLVE_MATRIX_IN, InflatedSourceRect(aRect));
 }
 
 IntRect FilterNodeConvolveMatrixSoftware::MapRectToSource(
-    const IntRect &aRect, const IntRect &aMax, FilterNode *aSourceNode) {
+    const IntRect& aRect, const IntRect& aMax, FilterNode* aSourceNode) {
   return MapInputRectToSource(IN_CONVOLVE_MATRIX_IN, InflatedSourceRect(aRect),
                               aMax, aSourceNode);
 }
 
 IntRect FilterNodeConvolveMatrixSoftware::InflatedSourceRect(
-    const IntRect &aDestRect) {
+    const IntRect& aDestRect) {
   if (aDestRect.IsEmpty()) {
     return IntRect();
   }
@@ -2561,7 +2561,7 @@ IntRect FilterNodeConvolveMatrixSoftware::InflatedSourceRect(
 }
 
 IntRect FilterNodeConvolveMatrixSoftware::InflatedDestRect(
-    const IntRect &aSourceRect) {
+    const IntRect& aSourceRect) {
   if (aSourceRect.IsEmpty()) {
     return IntRect();
   }
@@ -2580,7 +2580,7 @@ IntRect FilterNodeConvolveMatrixSoftware::InflatedDestRect(
 }
 
 IntRect FilterNodeConvolveMatrixSoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   IntRect srcRequest = InflatedSourceRect(aRect);
   IntRect srcOutput = GetInputRectInRect(IN_COLOR_MATRIX_IN, srcRequest);
   return InflatedDestRect(srcOutput).Intersect(aRect);
@@ -2624,7 +2624,7 @@ void FilterNodeDisplacementMapSoftware::SetAttribute(uint32_t aIndex,
 }
 
 already_AddRefed FilterNodeDisplacementMapSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   IntRect srcRect = InflatedSourceOrDestRect(aRect);
   RefPtr input = GetInputDataSourceSurface(
       IN_DISPLACEMENT_MAP_IN, srcRect, NEED_COLOR_CHANNELS);
@@ -2646,14 +2646,14 @@ already_AddRefed FilterNodeDisplacementMapSoftware::Render(
     return nullptr;
   }
 
-  uint8_t *sourceData =
+  uint8_t* sourceData =
       DataAtOffset(input, inputMap.GetMappedSurface(), offset);
   int32_t sourceStride = inputMap.GetStride();
-  uint8_t *sourceBegin = inputMap.GetData();
-  uint8_t *sourceEnd = sourceBegin + sourceStride * input->GetSize().height;
-  uint8_t *mapData = mapMap.GetData();
+  uint8_t* sourceBegin = inputMap.GetData();
+  uint8_t* sourceEnd = sourceBegin + sourceStride * input->GetSize().height;
+  uint8_t* mapData = mapMap.GetData();
   int32_t mapStride = mapMap.GetStride();
-  uint8_t *targetData = targetMap.GetData();
+  uint8_t* targetData = targetMap.GetData();
   int32_t targetStride = targetMap.GetStride();
 
   static const ptrdiff_t channelMap[4] = {
@@ -2673,7 +2673,7 @@ already_AddRefed FilterNodeDisplacementMapSoftware::Render(
           x + scaleOver255 * mapData[mapIndex + xChannel] + scaleAdjustment;
       int32_t sourceY =
           y + scaleOver255 * mapData[mapIndex + yChannel] + scaleAdjustment;
-      *(uint32_t *)(targetData + targIndex) = ColorAtPoint(
+      *(uint32_t*)(targetData + targIndex) = ColorAtPoint(
           sourceData, sourceStride, sourceBegin, sourceEnd, sourceX, sourceY);
     }
 
@@ -2686,13 +2686,13 @@ already_AddRefed FilterNodeDisplacementMapSoftware::Render(
 }
 
 void FilterNodeDisplacementMapSoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RequestInputRect(IN_DISPLACEMENT_MAP_IN, InflatedSourceOrDestRect(aRect));
   RequestInputRect(IN_DISPLACEMENT_MAP_IN2, aRect);
 }
 
 IntRect FilterNodeDisplacementMapSoftware::MapRectToSource(
-    const IntRect &aRect, const IntRect &aMax, FilterNode *aSourceNode) {
+    const IntRect& aRect, const IntRect& aMax, FilterNode* aSourceNode) {
   IntRect result =
       MapInputRectToSource(IN_DISPLACEMENT_MAP_IN,
                            InflatedSourceOrDestRect(aRect), aMax, aSourceNode);
@@ -2702,14 +2702,14 @@ IntRect FilterNodeDisplacementMapSoftware::MapRectToSource(
 }
 
 IntRect FilterNodeDisplacementMapSoftware::InflatedSourceOrDestRect(
-    const IntRect &aDestOrSourceRect) {
+    const IntRect& aDestOrSourceRect) {
   IntRect sourceOrDestRect = aDestOrSourceRect;
   sourceOrDestRect.Inflate(ceil(fabs(mScale) / 2));
   return sourceOrDestRect;
 }
 
 IntRect FilterNodeDisplacementMapSoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   IntRect srcRequest = InflatedSourceOrDestRect(aRect);
   IntRect srcOutput = GetInputRectInRect(IN_DISPLACEMENT_MAP_IN, srcRequest);
   return InflatedSourceOrDestRect(srcOutput).Intersect(aRect);
@@ -2726,7 +2726,7 @@ int32_t FilterNodeTurbulenceSoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 void FilterNodeTurbulenceSoftware::SetAttribute(uint32_t aIndex,
-                                                const Size &aBaseFrequency) {
+                                                const Size& aBaseFrequency) {
   switch (aIndex) {
     case ATT_TURBULENCE_BASE_FREQUENCY:
       mBaseFrequency = aBaseFrequency;
@@ -2739,7 +2739,7 @@ void FilterNodeTurbulenceSoftware::SetAttribute(uint32_t aIndex,
 }
 
 void FilterNodeTurbulenceSoftware::SetAttribute(uint32_t aIndex,
-                                                const IntRect &aRect) {
+                                                const IntRect& aRect) {
   switch (aIndex) {
     case ATT_TURBULENCE_RECT:
       mRenderRect = aRect;
@@ -2778,20 +2778,20 @@ void FilterNodeTurbulenceSoftware::SetAttribute(uint32_t aIndex,
 }
 
 already_AddRefed FilterNodeTurbulenceSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   return FilterProcessing::RenderTurbulence(
       aRect.Size(), aRect.TopLeft(), mBaseFrequency, mSeed, mNumOctaves, mType,
       mStitchable, Rect(mRenderRect));
 }
 
 IntRect FilterNodeTurbulenceSoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   return aRect.Intersect(mRenderRect);
 }
 
-IntRect FilterNodeTurbulenceSoftware::MapRectToSource(const IntRect &aRect,
-                                                      const IntRect &aMax,
-                                                      FilterNode *aSourceNode) {
+IntRect FilterNodeTurbulenceSoftware::MapRectToSource(const IntRect& aRect,
+                                                      const IntRect& aMax,
+                                                      FilterNode* aSourceNode) {
   return IntRect();
 }
 
@@ -2811,7 +2811,7 @@ int32_t FilterNodeArithmeticCombineSoftware::InputIndex(
 }
 
 void FilterNodeArithmeticCombineSoftware::SetAttribute(uint32_t aIndex,
-                                                       const Float *aFloat,
+                                                       const Float* aFloat,
                                                        uint32_t aSize) {
   MOZ_ASSERT(aIndex == ATT_ARITHMETIC_COMBINE_COEFFICIENTS);
   MOZ_RELEASE_ASSERT(aSize == 4);
@@ -2825,7 +2825,7 @@ void FilterNodeArithmeticCombineSoftware::SetAttribute(uint32_t aIndex,
 }
 
 already_AddRefed FilterNodeArithmeticCombineSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RefPtr input1 = GetInputDataSourceSurface(
       IN_ARITHMETIC_COMBINE_IN, aRect, NEED_COLOR_CHANNELS);
   RefPtr input2 = GetInputDataSourceSurface(
@@ -2853,13 +2853,13 @@ already_AddRefed FilterNodeArithmeticCombineSoftware::Render(
 }
 
 void FilterNodeArithmeticCombineSoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RequestInputRect(IN_ARITHMETIC_COMBINE_IN, aRect);
   RequestInputRect(IN_ARITHMETIC_COMBINE_IN2, aRect);
 }
 
 IntRect FilterNodeArithmeticCombineSoftware::MapRectToSource(
-    const IntRect &aRect, const IntRect &aMax, FilterNode *aSourceNode) {
+    const IntRect& aRect, const IntRect& aMax, FilterNode* aSourceNode) {
   IntRect result =
       MapInputRectToSource(IN_ARITHMETIC_COMBINE_IN, aRect, aMax, aSourceNode);
   result.OrWith(MapInputRectToSource(IN_ARITHMETIC_COMBINE_IN2, aRect, aMax,
@@ -2868,7 +2868,7 @@ IntRect FilterNodeArithmeticCombineSoftware::MapRectToSource(
 }
 
 IntRect FilterNodeArithmeticCombineSoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   if (mK4 > 0.0f) {
     return aRect;
   }
@@ -2904,7 +2904,7 @@ void FilterNodeCompositeSoftware::SetAttribute(uint32_t aIndex,
 }
 
 already_AddRefed FilterNodeCompositeSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RefPtr start = GetInputDataSourceSurface(
       IN_COMPOSITE_IN_START, aRect, NEED_COLOR_CHANNELS);
   RefPtr dest = Factory::CreateDataSourceSurface(
@@ -2947,15 +2947,15 @@ already_AddRefed FilterNodeCompositeSoftware::Render(
 }
 
 void FilterNodeCompositeSoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   for (size_t inputIndex = 0; inputIndex < NumberOfSetInputs(); inputIndex++) {
     RequestInputRect(IN_COMPOSITE_IN_START + inputIndex, aRect);
   }
 }
 
-IntRect FilterNodeCompositeSoftware::MapRectToSource(const IntRect &aRect,
-                                                     const IntRect &aMax,
-                                                     FilterNode *aSourceNode) {
+IntRect FilterNodeCompositeSoftware::MapRectToSource(const IntRect& aRect,
+                                                     const IntRect& aMax,
+                                                     FilterNode* aSourceNode) {
   IntRect result;
   for (size_t inputIndex = 0; inputIndex < NumberOfSetInputs(); inputIndex++) {
     result.OrWith(MapInputRectToSource(IN_COMPOSITE_IN_START + inputIndex,
@@ -2964,7 +2964,7 @@ IntRect FilterNodeCompositeSoftware::MapRectToSource(const IntRect &aRect,
   return result;
 }
 
-IntRect FilterNodeCompositeSoftware::GetOutputRectInRect(const IntRect &aRect) {
+IntRect FilterNodeCompositeSoftware::GetOutputRectInRect(const IntRect& aRect) {
   IntRect rect;
   for (size_t inputIndex = 0; inputIndex < NumberOfSetInputs(); inputIndex++) {
     IntRect inputRect =
@@ -2988,7 +2988,7 @@ int32_t FilterNodeBlurXYSoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 already_AddRefed FilterNodeBlurXYSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   Size sigmaXY = StdDeviationXY();
   IntSize d =
       AlphaBoxBlur::CalculateBlurRadius(Point(sigmaXY.width, sigmaXY.height));
@@ -3057,19 +3057,19 @@ already_AddRefed FilterNodeBlurXYSoftware::Render(
   return GetDataSurfaceInRect(target, srcRect, aRect, EDGE_MODE_NONE);
 }
 
-void FilterNodeBlurXYSoftware::RequestFromInputsForRect(const IntRect &aRect) {
+void FilterNodeBlurXYSoftware::RequestFromInputsForRect(const IntRect& aRect) {
   RequestInputRect(IN_GAUSSIAN_BLUR_IN, InflatedSourceOrDestRect(aRect));
 }
 
-IntRect FilterNodeBlurXYSoftware::MapRectToSource(const IntRect &aRect,
-                                                  const IntRect &aMax,
-                                                  FilterNode *aSourceNode) {
+IntRect FilterNodeBlurXYSoftware::MapRectToSource(const IntRect& aRect,
+                                                  const IntRect& aMax,
+                                                  FilterNode* aSourceNode) {
   return MapInputRectToSource(
       IN_GAUSSIAN_BLUR_IN, InflatedSourceOrDestRect(aRect), aMax, aSourceNode);
 }
 
 IntRect FilterNodeBlurXYSoftware::InflatedSourceOrDestRect(
-    const IntRect &aDestRect) {
+    const IntRect& aDestRect) {
   Size sigmaXY = StdDeviationXY();
   IntSize d =
       AlphaBoxBlur::CalculateBlurRadius(Point(sigmaXY.width, sigmaXY.height));
@@ -3078,7 +3078,7 @@ IntRect FilterNodeBlurXYSoftware::InflatedSourceOrDestRect(
   return srcRect;
 }
 
-IntRect FilterNodeBlurXYSoftware::GetOutputRectInRect(const IntRect &aRect) {
+IntRect FilterNodeBlurXYSoftware::GetOutputRectInRect(const IntRect& aRect) {
   IntRect srcRequest = InflatedSourceOrDestRect(aRect);
   IntRect srcOutput = GetInputRectInRect(IN_GAUSSIAN_BLUR_IN, srcRequest);
   return InflatedSourceOrDestRect(srcOutput).Intersect(aRect);
@@ -3151,7 +3151,7 @@ int32_t FilterNodeCropSoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 void FilterNodeCropSoftware::SetAttribute(uint32_t aIndex,
-                                          const Rect &aSourceRect) {
+                                          const Rect& aSourceRect) {
   MOZ_ASSERT(aIndex == ATT_CROP_RECT);
   Rect srcRect = aSourceRect;
   srcRect.Round();
@@ -3162,22 +3162,22 @@ void FilterNodeCropSoftware::SetAttribute(uint32_t aIndex,
 }
 
 already_AddRefed FilterNodeCropSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   return GetInputDataSourceSurface(IN_CROP_IN, aRect.Intersect(mCropRect));
 }
 
-void FilterNodeCropSoftware::RequestFromInputsForRect(const IntRect &aRect) {
+void FilterNodeCropSoftware::RequestFromInputsForRect(const IntRect& aRect) {
   RequestInputRect(IN_CROP_IN, aRect.Intersect(mCropRect));
 }
 
-IntRect FilterNodeCropSoftware::MapRectToSource(const IntRect &aRect,
-                                                const IntRect &aMax,
-                                                FilterNode *aSourceNode) {
+IntRect FilterNodeCropSoftware::MapRectToSource(const IntRect& aRect,
+                                                const IntRect& aMax,
+                                                FilterNode* aSourceNode) {
   return MapInputRectToSource(IN_CROP_IN, aRect.Intersect(mCropRect), aMax,
                               aSourceNode);
 }
 
-IntRect FilterNodeCropSoftware::GetOutputRectInRect(const IntRect &aRect) {
+IntRect FilterNodeCropSoftware::GetOutputRectInRect(const IntRect& aRect) {
   return GetInputRectInRect(IN_CROP_IN, aRect).Intersect(mCropRect);
 }
 
@@ -3191,24 +3191,24 @@ int32_t FilterNodePremultiplySoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 already_AddRefed FilterNodePremultiplySoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RefPtr input =
       GetInputDataSourceSurface(IN_PREMULTIPLY_IN, aRect);
   return input ? Premultiply(input) : nullptr;
 }
 
 void FilterNodePremultiplySoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RequestInputRect(IN_PREMULTIPLY_IN, aRect);
 }
 
 IntRect FilterNodePremultiplySoftware::MapRectToSource(
-    const IntRect &aRect, const IntRect &aMax, FilterNode *aSourceNode) {
+    const IntRect& aRect, const IntRect& aMax, FilterNode* aSourceNode) {
   return MapInputRectToSource(IN_PREMULTIPLY_IN, aRect, aMax, aSourceNode);
 }
 
 IntRect FilterNodePremultiplySoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   return GetInputRectInRect(IN_PREMULTIPLY_IN, aRect);
 }
 
@@ -3222,24 +3222,24 @@ int32_t FilterNodeUnpremultiplySoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 already_AddRefed FilterNodeUnpremultiplySoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RefPtr input =
       GetInputDataSourceSurface(IN_UNPREMULTIPLY_IN, aRect);
   return input ? Unpremultiply(input) : nullptr;
 }
 
 void FilterNodeUnpremultiplySoftware::RequestFromInputsForRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RequestInputRect(IN_UNPREMULTIPLY_IN, aRect);
 }
 
 IntRect FilterNodeUnpremultiplySoftware::MapRectToSource(
-    const IntRect &aRect, const IntRect &aMax, FilterNode *aSourceNode) {
+    const IntRect& aRect, const IntRect& aMax, FilterNode* aSourceNode) {
   return MapInputRectToSource(IN_UNPREMULTIPLY_IN, aRect, aMax, aSourceNode);
 }
 
 IntRect FilterNodeUnpremultiplySoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   return GetInputRectInRect(IN_UNPREMULTIPLY_IN, aRect);
 }
 
@@ -3259,27 +3259,27 @@ int32_t FilterNodeOpacitySoftware::InputIndex(uint32_t aInputEnumIndex) {
 }
 
 already_AddRefed FilterNodeOpacitySoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   RefPtr input =
       GetInputDataSourceSurface(IN_OPACITY_IN, aRect);
   return input ? Opacity(input, mValue) : nullptr;
 }
 
-void FilterNodeOpacitySoftware::RequestFromInputsForRect(const IntRect &aRect) {
+void FilterNodeOpacitySoftware::RequestFromInputsForRect(const IntRect& aRect) {
   RequestInputRect(IN_OPACITY_IN, aRect);
 }
 
-IntRect FilterNodeOpacitySoftware::MapRectToSource(const IntRect &aRect,
-                                                   const IntRect &aMax,
-                                                   FilterNode *aSourceNode) {
+IntRect FilterNodeOpacitySoftware::MapRectToSource(const IntRect& aRect,
+                                                   const IntRect& aMax,
+                                                   FilterNode* aSourceNode) {
   return MapInputRectToSource(IN_OPACITY_IN, aRect, aMax, aSourceNode);
 }
 
-IntRect FilterNodeOpacitySoftware::GetOutputRectInRect(const IntRect &aRect) {
+IntRect FilterNodeOpacitySoftware::GetOutputRectInRect(const IntRect& aRect) {
   return GetInputRectInRect(IN_OPACITY_IN, aRect);
 }
 
-bool PointLightSoftware::SetAttribute(uint32_t aIndex, const Point3D &aPoint) {
+bool PointLightSoftware::SetAttribute(uint32_t aIndex, const Point3D& aPoint) {
   switch (aIndex) {
     case ATT_POINT_LIGHT_POSITION:
       mPosition = aPoint;
@@ -3293,7 +3293,7 @@ bool PointLightSoftware::SetAttribute(uint32_t aIndex, const Point3D &aPoint) {
 SpotLightSoftware::SpotLightSoftware()
     : mSpecularFocus(0), mLimitingConeAngle(0), mLimitingConeCos(1) {}
 
-bool SpotLightSoftware::SetAttribute(uint32_t aIndex, const Point3D &aPoint) {
+bool SpotLightSoftware::SetAttribute(uint32_t aIndex, const Point3D& aPoint) {
   switch (aIndex) {
     case ATT_SPOT_LIGHT_POSITION:
       mPosition = aPoint;
@@ -3337,7 +3337,7 @@ bool DistantLightSoftware::SetAttribute(uint32_t aIndex, Float aValue) {
   return true;
 }
 
-static inline Point3D Normalized(const Point3D &vec) {
+static inline Point3D Normalized(const Point3D& vec) {
   Point3D copy(vec);
   copy.Normalize();
   return copy;
@@ -3345,7 +3345,7 @@ static inline Point3D Normalized(const Point3D &vec) {
 
 template 
 FilterNodeLightingSoftware::FilterNodeLightingSoftware(
-    const char *aTypeName)
+    const char* aTypeName)
     : mLock("FilterNodeLightingSoftware"),
       mSurfaceScale(0)
 #if defined(MOZILLA_INTERNAL_API) && \
@@ -3369,7 +3369,7 @@ int32_t FilterNodeLightingSoftware::InputIndex(
 
 template 
 void FilterNodeLightingSoftware::SetAttribute(
-    uint32_t aIndex, const Point3D &aPoint) {
+    uint32_t aIndex, const Point3D& aPoint) {
   if (mLight.SetAttribute(aIndex, aPoint)) {
     Invalidate();
     return;
@@ -3397,7 +3397,7 @@ void FilterNodeLightingSoftware::SetAttribute(
 
 template 
 void FilterNodeLightingSoftware::SetAttribute(
-    uint32_t aIndex, const Size &aKernelUnitLength) {
+    uint32_t aIndex, const Size& aKernelUnitLength) {
   switch (aIndex) {
     case ATT_LIGHTING_KERNEL_UNIT_LENGTH:
       mKernelUnitLength = aKernelUnitLength;
@@ -3410,7 +3410,7 @@ void FilterNodeLightingSoftware::SetAttribute(
 
 template 
 void FilterNodeLightingSoftware::SetAttribute(
-    uint32_t aIndex, const Color &aColor) {
+    uint32_t aIndex, const Color& aColor) {
   MOZ_ASSERT(aIndex == ATT_LIGHTING_COLOR);
   mColor = aColor;
   Invalidate();
@@ -3419,16 +3419,16 @@ void FilterNodeLightingSoftware::SetAttribute(
 template 
 IntRect
 FilterNodeLightingSoftware::GetOutputRectInRect(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   return aRect;
 }
 
-Point3D PointLightSoftware::GetVectorToLight(const Point3D &aTargetPoint) {
+Point3D PointLightSoftware::GetVectorToLight(const Point3D& aTargetPoint) {
   return Normalized(mPosition - aTargetPoint);
 }
 
 uint32_t PointLightSoftware::GetColor(uint32_t aLightColor,
-                                      const Point3D &aVectorToLight) {
+                                      const Point3D& aVectorToLight) {
   return aLightColor;
 }
 
@@ -3439,12 +3439,12 @@ void SpotLightSoftware::Prepare() {
   mPowCache.CacheForExponent(mSpecularFocus);
 }
 
-Point3D SpotLightSoftware::GetVectorToLight(const Point3D &aTargetPoint) {
+Point3D SpotLightSoftware::GetVectorToLight(const Point3D& aTargetPoint) {
   return Normalized(mPosition - aTargetPoint);
 }
 
 uint32_t SpotLightSoftware::GetColor(uint32_t aLightColor,
-                                     const Point3D &aVectorToLight) {
+                                     const Point3D& aVectorToLight) {
   union {
     uint32_t color;
     uint8_t colorC[4];
@@ -3484,21 +3484,21 @@ void DistantLightSoftware::Prepare() {
   mVectorToLight.z = sin(mElevation * radPerDeg);
 }
 
-Point3D DistantLightSoftware::GetVectorToLight(const Point3D &aTargetPoint) {
+Point3D DistantLightSoftware::GetVectorToLight(const Point3D& aTargetPoint) {
   return mVectorToLight;
 }
 
 uint32_t DistantLightSoftware::GetColor(uint32_t aLightColor,
-                                        const Point3D &aVectorToLight) {
+                                        const Point3D& aVectorToLight) {
   return aLightColor;
 }
 
 template 
-static Point3D GenerateNormal(const uint8_t *data, int32_t stride,
-                              uint8_t *boundsBegin, uint8_t *boundsEnd,
+static Point3D GenerateNormal(const uint8_t* data, int32_t stride,
+                              uint8_t* boundsBegin, uint8_t* boundsEnd,
                               int32_t x, int32_t y, float surfaceScale,
                               CoordType dx, CoordType dy) {
-  const uint8_t *index = data + y * stride + x;
+  const uint8_t* index = data + y * stride + x;
 
   CoordType zero = 0;
 
@@ -3540,7 +3540,7 @@ static Point3D GenerateNormal(const uint8_t *data, int32_t stride,
 template 
 already_AddRefed
 FilterNodeLightingSoftware::Render(
-    const IntRect &aRect) {
+    const IntRect& aRect) {
   if (mKernelUnitLength.width == floor(mKernelUnitLength.width) &&
       mKernelUnitLength.height == floor(mKernelUnitLength.height)) {
     return DoRender(aRect, (int32_t)mKernelUnitLength.width,
@@ -3551,7 +3551,7 @@ FilterNodeLightingSoftware::Render(
 
 template 
 void FilterNodeLightingSoftware<
-    LightType, LightingType>::RequestFromInputsForRect(const IntRect &aRect) {
+    LightType, LightingType>::RequestFromInputsForRect(const IntRect& aRect) {
   IntRect srcRect = aRect;
   srcRect.Inflate(ceil(mKernelUnitLength.width),
                   ceil(mKernelUnitLength.height));
@@ -3560,7 +3560,7 @@ void FilterNodeLightingSoftware<
 
 template 
 IntRect FilterNodeLightingSoftware::MapRectToSource(
-    const IntRect &aRect, const IntRect &aMax, FilterNode *aSourceNode) {
+    const IntRect& aRect, const IntRect& aMax, FilterNode* aSourceNode) {
   IntRect srcRect = aRect;
   srcRect.Inflate(ceil(mKernelUnitLength.width),
                   ceil(mKernelUnitLength.height));
@@ -3571,7 +3571,7 @@ template 
 template 
 already_AddRefed
 FilterNodeLightingSoftware::DoRender(
-    const IntRect &aRect, CoordType aKernelUnitLengthX,
+    const IntRect& aRect, CoordType aKernelUnitLengthX,
     CoordType aKernelUnitLengthY) {
   MOZ_ASSERT(aKernelUnitLengthX > 0,
              "aKernelUnitLengthX can be a negative or zero value");
@@ -3612,12 +3612,12 @@ FilterNodeLightingSoftware::DoRender(
     return nullptr;
   }
 
-  uint8_t *sourceData =
+  uint8_t* sourceData =
       DataAtOffset(input, sourceMap.GetMappedSurface(), offset);
   int32_t sourceStride = sourceMap.GetStride();
-  uint8_t *sourceBegin = sourceMap.GetData();
-  uint8_t *sourceEnd = sourceBegin + sourceStride * input->GetSize().height;
-  uint8_t *targetData = targetMap.GetData();
+  uint8_t* sourceBegin = sourceMap.GetData();
+  uint8_t* sourceEnd = sourceBegin + sourceStride * input->GetSize().height;
+  uint8_t* targetData = targetMap.GetData();
   int32_t targetStride = targetMap.GetStride();
 
   MutexAutoLock lock(mLock);
@@ -3641,7 +3641,7 @@ FilterNodeLightingSoftware::DoRender(
       Point3D rayDir = mLight.GetVectorToLight(pt);
       uint32_t color = mLight.GetColor(lightColor, rayDir);
 
-      *(uint32_t *)(targetData + targetIndex) =
+      *(uint32_t*)(targetData + targetIndex) =
           mLighting.LightPixel(normal, rayDir, color);
     }
 
@@ -3666,8 +3666,8 @@ bool DiffuseLightingSoftware::SetAttribute(uint32_t aIndex, Float aValue) {
   return true;
 }
 
-uint32_t DiffuseLightingSoftware::LightPixel(const Point3D &aNormal,
-                                             const Point3D &aVectorToLight,
+uint32_t DiffuseLightingSoftware::LightPixel(const Point3D& aNormal,
+                                             const Point3D& aVectorToLight,
                                              uint32_t aColor) {
   Float dotNL = std::max(0.0f, aNormal.DotProduct(aVectorToLight));
   Float diffuseNL = mDiffuseConstant * dotNL;
@@ -3711,8 +3711,8 @@ void SpecularLightingSoftware::Prepare() {
   mSpecularConstantInt = uint32_t(mSpecularConstant * (1 << 8));
 }
 
-uint32_t SpecularLightingSoftware::LightPixel(const Point3D &aNormal,
-                                              const Point3D &aVectorToLight,
+uint32_t SpecularLightingSoftware::LightPixel(const Point3D& aNormal,
+                                              const Point3D& aVectorToLight,
                                               uint32_t aColor) {
   Point3D vectorToEye(0, 0, 1);
   Point3D halfwayVector = Normalized(aVectorToLight + vectorToEye);
diff --git a/gfx/2d/FilterNodeSoftware.h b/gfx/2d/FilterNodeSoftware.h
index c0a49bd6887b0..ab76a08f89f5c 100644
--- a/gfx/2d/FilterNodeSoftware.h
+++ b/gfx/2d/FilterNodeSoftware.h
@@ -27,7 +27,7 @@ class FilterNodeSoftware;
  */
 class FilterInvalidationListener {
  public:
-  virtual void FilterInvalidated(FilterNodeSoftware *aFilter) = 0;
+  virtual void FilterInvalidated(FilterNodeSoftware* aFilter) = 0;
 };
 
 /**
@@ -46,20 +46,20 @@ class FilterNodeSoftware : public FilterNode,
   static already_AddRefed Create(FilterType aType);
 
   // Draw the filter, intended to be called by DrawTarget*::DrawFilter.
-  void Draw(DrawTarget *aDrawTarget, const Rect &aSourceRect,
-            const Point &aDestPoint, const DrawOptions &aOptions);
+  void Draw(DrawTarget* aDrawTarget, const Rect& aSourceRect,
+            const Point& aDestPoint, const DrawOptions& aOptions);
 
   FilterBackend GetBackendType() override { return FILTER_BACKEND_SOFTWARE; }
-  void SetInput(uint32_t aIndex, SourceSurface *aSurface) override;
-  void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
+  void SetInput(uint32_t aIndex, SourceSurface* aSurface) override;
+  void SetInput(uint32_t aIndex, FilterNode* aFilter) override;
 
-  virtual const char *GetName() { return "Unknown"; }
+  virtual const char* GetName() { return "Unknown"; }
 
-  void AddInvalidationListener(FilterInvalidationListener *aListener);
-  void RemoveInvalidationListener(FilterInvalidationListener *aListener);
+  void AddInvalidationListener(FilterInvalidationListener* aListener);
+  void RemoveInvalidationListener(FilterInvalidationListener* aListener);
 
   // FilterInvalidationListener implementation
-  void FilterInvalidated(FilterNodeSoftware *aFilter) override;
+  void FilterInvalidated(FilterNodeSoftware* aFilter) override;
 
  protected:
   // The following methods are intended to be overriden by subclasses.
@@ -79,7 +79,7 @@ class FilterNodeSoftware : public FilterNode,
    * This method returns the intersection of the filter's output rect with
    * aInRect. Filters with unconstrained output always return aInRect.
    */
-  virtual IntRect GetOutputRectInRect(const IntRect &aInRect) = 0;
+  virtual IntRect GetOutputRectInRect(const IntRect& aInRect) = 0;
 
   /**
    * Return a surface with the rendered output which is of size aRect.Size().
@@ -90,21 +90,21 @@ class FilterNodeSoftware : public FilterNode,
    * pass through input surfaces unchanged.
    * Callers need to treat the returned surface as immutable.
    */
-  virtual already_AddRefed Render(const IntRect &aRect) = 0;
+  virtual already_AddRefed Render(const IntRect& aRect) = 0;
 
   /**
    * Call RequestRect (see below) on any input filters with the desired input
    * rect, so that the input filter knows what to cache the next time it
    * renders.
    */
-  virtual void RequestFromInputsForRect(const IntRect &aRect) {}
+  virtual void RequestFromInputsForRect(const IntRect& aRect) {}
 
   /**
    * This method provides a caching default implementation but can be overriden
    * by subclasses that don't want to cache their output. Those classes should
    * call Render(aRect) directly from here.
    */
-  virtual already_AddRefed GetOutput(const IntRect &aRect);
+  virtual already_AddRefed GetOutput(const IntRect& aRect);
 
   // The following methods are non-virtual helper methods.
 
@@ -137,27 +137,27 @@ class FilterNodeSoftware : public FilterNode,
    * Each pixel row of the returned surface is guaranteed to be 16-byte aligned.
    */
   already_AddRefed GetInputDataSourceSurface(
-      uint32_t aInputEnumIndex, const IntRect &aRect,
+      uint32_t aInputEnumIndex, const IntRect& aRect,
       FormatHint aFormatHint = CAN_HANDLE_A8,
       ConvolveMatrixEdgeMode aEdgeMode = EDGE_MODE_NONE,
-      const IntRect *aTransparencyPaddedSourceRect = nullptr);
+      const IntRect* aTransparencyPaddedSourceRect = nullptr);
 
   /**
    * Returns the intersection of the input filter's or surface's output rect
    * with aInRect.
    */
-  IntRect GetInputRectInRect(uint32_t aInputEnumIndex, const IntRect &aInRect);
+  IntRect GetInputRectInRect(uint32_t aInputEnumIndex, const IntRect& aInRect);
 
   /**
    * Calls RequestRect on the specified input, if it's a filter.
    */
-  void RequestInputRect(uint32_t aInputEnumIndex, const IntRect &aRect);
+  void RequestInputRect(uint32_t aInputEnumIndex, const IntRect& aRect);
 
   /**
    * Calls MapRectToSource on the specified input, if it's a filter.
    */
-  IntRect MapInputRectToSource(uint32_t aInputEnumIndex, const IntRect &aRect,
-                               const IntRect &aMax, FilterNode *aSourceNode);
+  IntRect MapInputRectToSource(uint32_t aInputEnumIndex, const IntRect& aRect,
+                               const IntRect& aMax, FilterNode* aSourceNode);
 
   /**
    * Returns the number of set input filters or surfaces. Needed for filters
@@ -177,15 +177,15 @@ class FilterNodeSoftware : public FilterNode,
    * GetOutput call. Expected to call RequestRect on this filter's input
    * filters.
    */
-  void RequestRect(const IntRect &aRect);
+  void RequestRect(const IntRect& aRect);
 
   /**
    * Set input filter and clear input surface for this input index, or set
    * input surface and clear input filter. One of aSurface and aFilter should
    * be null.
    */
-  void SetInput(uint32_t aIndex, SourceSurface *aSurface,
-                FilterNodeSoftware *aFilter);
+  void SetInput(uint32_t aIndex, SourceSurface* aSurface,
+                FilterNodeSoftware* aFilter);
 
  protected:
   /**
@@ -201,7 +201,7 @@ class FilterNodeSoftware : public FilterNode,
    * unsubscribe themselves from us when they let go of their reference to us.
    * This ensures that the pointers in this array are never stale.
    */
-  std::vector mInvalidationListeners;
+  std::vector mInvalidationListeners;
 
   /**
    * Lock guarding mRequestedRect, mCachedRect, and mCachedOutput. All uses
@@ -228,19 +228,19 @@ class FilterNodeTransformSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTransformSoftware, override)
   FilterNodeTransformSoftware();
-  const char *GetName() override { return "Transform"; }
+  const char* GetName() override { return "Transform"; }
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, uint32_t aGraphicsFilter) override;
-  void SetAttribute(uint32_t aIndex, const Matrix &aMatrix) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, const Matrix& aMatrix) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
-  IntRect SourceRectForOutputRect(const IntRect &aRect);
+  void RequestFromInputsForRect(const IntRect& aRect) override;
+  IntRect SourceRectForOutputRect(const IntRect& aRect);
 
  private:
   Matrix mMatrix;
@@ -251,17 +251,17 @@ class FilterNodeBlendSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlendSoftware, override)
   FilterNodeBlendSoftware();
-  const char *GetName() override { return "Blend"; }
+  const char* GetName() override { return "Blend"; }
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, uint32_t aBlendMode) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
 
  private:
   BlendMode mBlendMode;
@@ -272,16 +272,16 @@ class FilterNodeMorphologySoftware : public FilterNodeSoftware {
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeMorphologySoftware,
                                           override)
   FilterNodeMorphologySoftware();
-  const char *GetName() override { return "Morphology"; }
+  const char* GetName() override { return "Morphology"; }
   using FilterNodeSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const IntSize &aRadii) override;
+  void SetAttribute(uint32_t aIndex, const IntSize& aRadii) override;
   void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
 
  private:
   IntSize mRadii;
@@ -292,18 +292,18 @@ class FilterNodeColorMatrixSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeColorMatrixSoftware,
                                           override)
-  const char *GetName() override { return "ColorMatrix"; }
+  const char* GetName() override { return "ColorMatrix"; }
   using FilterNodeSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const Matrix5x4 &aMatrix) override;
+  void SetAttribute(uint32_t aIndex, const Matrix5x4& aMatrix) override;
   void SetAttribute(uint32_t aIndex, uint32_t aAlphaMode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  private:
   Matrix5x4 mMatrix;
@@ -313,16 +313,16 @@ class FilterNodeColorMatrixSoftware : public FilterNodeSoftware {
 class FilterNodeFloodSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeFloodSoftware, override)
-  const char *GetName() override { return "Flood"; }
+  const char* GetName() override { return "Flood"; }
   using FilterNodeSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const Color &aColor) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, const Color& aColor) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed GetOutput(const IntRect &aRect) override;
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed GetOutput(const IntRect& aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
 
  private:
   Color mColor;
@@ -331,15 +331,15 @@ class FilterNodeFloodSoftware : public FilterNodeSoftware {
 class FilterNodeTileSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTileSoftware, override)
-  const char *GetName() override { return "Tile"; }
+  const char* GetName() override { return "Tile"; }
   using FilterNodeSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const IntRect &aSourceRect) override;
+  void SetAttribute(uint32_t aIndex, const IntRect& aSourceRect) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
 
  private:
   IntRect mSourceRect;
@@ -356,14 +356,14 @@ class FilterNodeComponentTransferSoftware : public FilterNodeSoftware {
 
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, bool aDisable) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
   virtual void GenerateLookupTable(ptrdiff_t aComponent,
                                    uint8_t aTables[4][256], bool aDisabled);
   virtual void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) = 0;
@@ -379,16 +379,16 @@ class FilterNodeTableTransferSoftware
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTableTransferSoftware,
                                           override)
-  const char *GetName() override { return "TableTransfer"; }
+  const char* GetName() override { return "TableTransfer"; }
   using FilterNodeComponentTransferSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const Float *aFloat,
+  void SetAttribute(uint32_t aIndex, const Float* aFloat,
                     uint32_t aSize) override;
 
  protected:
   void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
 
  private:
-  void FillLookupTableImpl(std::vector &aTableValues,
+  void FillLookupTableImpl(std::vector& aTableValues,
                            uint8_t aTable[256]);
 
   std::vector mTableR;
@@ -402,16 +402,16 @@ class FilterNodeDiscreteTransferSoftware
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDiscreteTransferSoftware,
                                           override)
-  const char *GetName() override { return "DiscreteTransfer"; }
+  const char* GetName() override { return "DiscreteTransfer"; }
   using FilterNodeComponentTransferSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const Float *aFloat,
+  void SetAttribute(uint32_t aIndex, const Float* aFloat,
                     uint32_t aSize) override;
 
  protected:
   void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
 
  private:
-  void FillLookupTableImpl(std::vector &aTableValues,
+  void FillLookupTableImpl(std::vector& aTableValues,
                            uint8_t aTable[256]);
 
   std::vector mTableR;
@@ -426,7 +426,7 @@ class FilterNodeLinearTransferSoftware
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeLinearTransformSoftware,
                                           override)
   FilterNodeLinearTransferSoftware();
-  const char *GetName() override { return "LinearTransfer"; }
+  const char* GetName() override { return "LinearTransfer"; }
   using FilterNodeComponentTransferSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, Float aValue) override;
 
@@ -452,7 +452,7 @@ class FilterNodeGammaTransferSoftware
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeGammaTransferSoftware,
                                           override)
   FilterNodeGammaTransferSoftware();
-  const char *GetName() override { return "GammaTransfer"; }
+  const char* GetName() override { return "GammaTransfer"; }
   using FilterNodeComponentTransferSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, Float aValue) override;
 
@@ -482,34 +482,34 @@ class FilterNodeConvolveMatrixSoftware : public FilterNodeSoftware {
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeConvolveMatrixSoftware,
                                           override)
   FilterNodeConvolveMatrixSoftware();
-  const char *GetName() override { return "ConvolveMatrix"; }
+  const char* GetName() override { return "ConvolveMatrix"; }
   using FilterNodeSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const IntSize &aKernelSize) override;
-  void SetAttribute(uint32_t aIndex, const Float *aMatrix,
+  void SetAttribute(uint32_t aIndex, const IntSize& aKernelSize) override;
+  void SetAttribute(uint32_t aIndex, const Float* aMatrix,
                     uint32_t aSize) override;
   void SetAttribute(uint32_t aIndex, Float aValue) override;
-  void SetAttribute(uint32_t aIndex, const Size &aKernelUnitLength) override;
-  void SetAttribute(uint32_t aIndex, const IntRect &aSourceRect) override;
-  void SetAttribute(uint32_t aIndex, const IntPoint &aTarget) override;
+  void SetAttribute(uint32_t aIndex, const Size& aKernelUnitLength) override;
+  void SetAttribute(uint32_t aIndex, const IntRect& aSourceRect) override;
+  void SetAttribute(uint32_t aIndex, const IntPoint& aTarget) override;
   void SetAttribute(uint32_t aIndex, uint32_t aEdgeMode) override;
   void SetAttribute(uint32_t aIndex, bool aPreserveAlpha) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
 
  private:
   template 
-  already_AddRefed DoRender(const IntRect &aRect,
+  already_AddRefed DoRender(const IntRect& aRect,
                                                CoordType aKernelUnitLengthX,
                                                CoordType aKernelUnitLengthY);
 
-  IntRect InflatedSourceRect(const IntRect &aDestRect);
-  IntRect InflatedDestRect(const IntRect &aSourceRect);
+  IntRect InflatedSourceRect(const IntRect& aDestRect);
+  IntRect InflatedDestRect(const IntRect& aSourceRect);
 
   IntSize mKernelSize;
   std::vector mKernelMatrix;
@@ -527,21 +527,21 @@ class FilterNodeDisplacementMapSoftware : public FilterNodeSoftware {
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDisplacementMapSoftware,
                                           override)
   FilterNodeDisplacementMapSoftware();
-  const char *GetName() override { return "DisplacementMap"; }
+  const char* GetName() override { return "DisplacementMap"; }
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, Float aScale) override;
   void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
 
  private:
-  IntRect InflatedSourceOrDestRect(const IntRect &aDestOrSourceRect);
+  IntRect InflatedSourceOrDestRect(const IntRect& aDestOrSourceRect);
 
   Float mScale;
   ColorChannel mChannelX;
@@ -553,18 +553,18 @@ class FilterNodeTurbulenceSoftware : public FilterNodeSoftware {
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTurbulenceSoftware,
                                           override)
   FilterNodeTurbulenceSoftware();
-  const char *GetName() override { return "Turbulence"; }
+  const char* GetName() override { return "Turbulence"; }
   using FilterNodeSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const Size &aSize) override;
-  void SetAttribute(uint32_t aIndex, const IntRect &aRenderRect) override;
+  void SetAttribute(uint32_t aIndex, const Size& aSize) override;
+  void SetAttribute(uint32_t aIndex, const IntRect& aRenderRect) override;
   void SetAttribute(uint32_t aIndex, bool aStitchable) override;
   void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
 
  private:
@@ -581,18 +581,18 @@ class FilterNodeArithmeticCombineSoftware : public FilterNodeSoftware {
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeArithmeticCombineSoftware,
                                           override)
   FilterNodeArithmeticCombineSoftware();
-  const char *GetName() override { return "ArithmeticCombine"; }
+  const char* GetName() override { return "ArithmeticCombine"; }
   using FilterNodeSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const Float *aFloat,
+  void SetAttribute(uint32_t aIndex, const Float* aFloat,
                     uint32_t aSize) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
 
  private:
   Float mK1;
@@ -605,17 +605,17 @@ class FilterNodeCompositeSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCompositeSoftware, override)
   FilterNodeCompositeSoftware();
-  const char *GetName() override { return "Composite"; }
+  const char* GetName() override { return "Composite"; }
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  private:
   CompositeOperator mOperator;
@@ -627,13 +627,13 @@ class FilterNodeBlurXYSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlurXYSoftware, override)
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  IntRect InflatedSourceOrDestRect(const IntRect &aDestRect);
-  void RequestFromInputsForRect(const IntRect &aRect) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  IntRect InflatedSourceOrDestRect(const IntRect& aDestRect);
+  void RequestFromInputsForRect(const IntRect& aRect) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
   // Implemented by subclasses.
   virtual Size StdDeviationXY() = 0;
@@ -644,7 +644,7 @@ class FilterNodeGaussianBlurSoftware : public FilterNodeBlurXYSoftware {
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeGaussianBlurSoftware,
                                           override)
   FilterNodeGaussianBlurSoftware();
-  const char *GetName() override { return "GaussianBlur"; }
+  const char* GetName() override { return "GaussianBlur"; }
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
 
@@ -660,7 +660,7 @@ class FilterNodeDirectionalBlurSoftware : public FilterNodeBlurXYSoftware {
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDirectionalBlurSoftware,
                                           override)
   FilterNodeDirectionalBlurSoftware();
-  const char *GetName() override { return "DirectionalBlur"; }
+  const char* GetName() override { return "DirectionalBlur"; }
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
   void SetAttribute(uint32_t aIndex, uint32_t aBlurDirection) override;
@@ -676,17 +676,17 @@ class FilterNodeDirectionalBlurSoftware : public FilterNodeBlurXYSoftware {
 class FilterNodeCropSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCropSoftware, override)
-  const char *GetName() override { return "Crop"; }
+  const char* GetName() override { return "Crop"; }
   using FilterNodeSoftware::SetAttribute;
-  void SetAttribute(uint32_t aIndex, const Rect &aSourceRect) override;
+  void SetAttribute(uint32_t aIndex, const Rect& aSourceRect) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  private:
   IntRect mCropRect;
@@ -696,46 +696,46 @@ class FilterNodePremultiplySoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodePremultiplySoftware,
                                           override)
-  const char *GetName() override { return "Premultiply"; }
+  const char* GetName() override { return "Premultiply"; }
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 };
 
 class FilterNodeUnpremultiplySoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeUnpremultiplySoftware,
                                           override)
-  const char *GetName() override { return "Unpremultiply"; }
+  const char* GetName() override { return "Unpremultiply"; }
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 };
 
 class FilterNodeOpacitySoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeOpacitySoftware, override)
-  const char *GetName() override { return "Opacity"; }
+  const char* GetName() override { return "Opacity"; }
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, Float aValue) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
 
   Float mValue = 1.0f;
 };
@@ -746,28 +746,28 @@ class FilterNodeLightingSoftware : public FilterNodeSoftware {
 #if defined(MOZILLA_INTERNAL_API) && \
     (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
   // Helpers for refcounted
-  const char *typeName() const override { return mTypeName; }
+  const char* typeName() const override { return mTypeName; }
   size_t typeSize() const override { return sizeof(*this); }
 #endif
-  explicit FilterNodeLightingSoftware(const char *aTypeName);
-  const char *GetName() override { return "Lighting"; }
+  explicit FilterNodeLightingSoftware(const char* aTypeName);
+  const char* GetName() override { return "Lighting"; }
   using FilterNodeSoftware::SetAttribute;
   void SetAttribute(uint32_t aIndex, Float) override;
-  void SetAttribute(uint32_t aIndex, const Size &) override;
-  void SetAttribute(uint32_t aIndex, const Point3D &) override;
-  void SetAttribute(uint32_t aIndex, const Color &) override;
-  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                          FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, const Size&) override;
+  void SetAttribute(uint32_t aIndex, const Point3D&) override;
+  void SetAttribute(uint32_t aIndex, const Color&) override;
+  IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                          FilterNode* aSourceNode) override;
 
  protected:
-  already_AddRefed Render(const IntRect &aRect) override;
-  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed Render(const IntRect& aRect) override;
+  IntRect GetOutputRectInRect(const IntRect& aRect) override;
   int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  void RequestFromInputsForRect(const IntRect &aRect) override;
+  void RequestFromInputsForRect(const IntRect& aRect) override;
 
  private:
   template 
-  already_AddRefed DoRender(const IntRect &aRect,
+  already_AddRefed DoRender(const IntRect& aRect,
                                                CoordType aKernelUnitLengthX,
                                                CoordType aKernelUnitLengthY);
 
@@ -779,7 +779,7 @@ class FilterNodeLightingSoftware : public FilterNodeSoftware {
   Color mColor;
 #if defined(MOZILLA_INTERNAL_API) && \
     (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
-  const char *mTypeName;
+  const char* mTypeName;
 #endif
 };
 
diff --git a/gfx/2d/Filters.h b/gfx/2d/Filters.h
index 367bcc85d52c0..33044c9f47572 100644
--- a/gfx/2d/Filters.h
+++ b/gfx/2d/Filters.h
@@ -374,10 +374,10 @@ class FilterNode : public external::AtomicRefCounted {
 
   virtual FilterBackend GetBackendType() = 0;
 
-  virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) {
+  virtual void SetInput(uint32_t aIndex, SourceSurface* aSurface) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) {
+  virtual void SetInput(uint32_t aIndex, FilterNode* aFilter) {
     MOZ_CRASH("GFX: FilterNode");
   }
 
@@ -390,37 +390,37 @@ class FilterNode : public external::AtomicRefCounted {
   virtual void SetAttribute(uint32_t aIndex, Float) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const Size &) {
+  virtual void SetAttribute(uint32_t aIndex, const Size&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const IntSize &) {
+  virtual void SetAttribute(uint32_t aIndex, const IntSize&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const IntPoint &) {
+  virtual void SetAttribute(uint32_t aIndex, const IntPoint&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const Rect &) {
+  virtual void SetAttribute(uint32_t aIndex, const Rect&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const IntRect &) {
+  virtual void SetAttribute(uint32_t aIndex, const IntRect&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const Point &) {
+  virtual void SetAttribute(uint32_t aIndex, const Point&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const Matrix &) {
+  virtual void SetAttribute(uint32_t aIndex, const Matrix&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const Matrix5x4 &) {
+  virtual void SetAttribute(uint32_t aIndex, const Matrix5x4&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const Point3D &) {
+  virtual void SetAttribute(uint32_t aIndex, const Point3D&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const Color &) {
+  virtual void SetAttribute(uint32_t aIndex, const Color&) {
     MOZ_CRASH("GFX: FilterNode");
   }
-  virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
+  virtual void SetAttribute(uint32_t aIndex, const Float* aFloat,
                             uint32_t aSize) {
     MOZ_CRASH("GFX: FilterNode");
   }
@@ -428,8 +428,8 @@ class FilterNode : public external::AtomicRefCounted {
   /** Maps a rectangle in filter space back to a rectangle in the space of
    * aSourceNode's first input. aSourceNode should not have an input
    * assigned when calling this function. */
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) {
+  virtual IntRect MapRectToSource(const IntRect& aRect, const IntRect& aMax,
+                                  FilterNode* aSourceNode) {
     return aMax;
   }
 
diff --git a/gfx/2d/GradientStopsD2D.h b/gfx/2d/GradientStopsD2D.h
index fada5c51294c1..20e60eb1d0f07 100644
--- a/gfx/2d/GradientStopsD2D.h
+++ b/gfx/2d/GradientStopsD2D.h
@@ -18,8 +18,8 @@ class GradientStopsD2D : public GradientStops {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsD2D, override)
 
-  GradientStopsD2D(ID2D1GradientStopCollection *aStopCollection,
-                   ID3D11Device *aDevice)
+  GradientStopsD2D(ID2D1GradientStopCollection* aStopCollection,
+                   ID3D11Device* aDevice)
       : mStopCollection(aStopCollection), mDevice(aDevice) {}
 
   virtual BackendType GetBackendType() const { return BackendType::DIRECT2D; }
diff --git a/gfx/2d/Helpers.h b/gfx/2d/Helpers.h
index 66f421c0e4cdf..349e99973ac19 100644
--- a/gfx/2d/Helpers.h
+++ b/gfx/2d/Helpers.h
@@ -16,10 +16,10 @@ class AutoRestoreTransform final {
  public:
   AutoRestoreTransform() = default;
 
-  explicit AutoRestoreTransform(DrawTarget *aTarget)
+  explicit AutoRestoreTransform(DrawTarget* aTarget)
       : mDrawTarget(aTarget), mOldTransform(aTarget->GetTransform()) {}
 
-  void Init(DrawTarget *aTarget) {
+  void Init(DrawTarget* aTarget) {
     MOZ_ASSERT(!mDrawTarget || aTarget == mDrawTarget);
     if (!mDrawTarget) {
       mDrawTarget = aTarget;
@@ -40,19 +40,19 @@ class AutoRestoreTransform final {
 
 class AutoPopClips final {
  public:
-  explicit AutoPopClips(DrawTarget *aTarget)
+  explicit AutoPopClips(DrawTarget* aTarget)
       : mDrawTarget(aTarget), mPushCount(0) {
     MOZ_ASSERT(mDrawTarget);
   }
 
   ~AutoPopClips() { PopAll(); }
 
-  void PushClip(const Path *aPath) {
+  void PushClip(const Path* aPath) {
     mDrawTarget->PushClip(aPath);
     ++mPushCount;
   }
 
-  void PushClipRect(const Rect &aRect) {
+  void PushClipRect(const Rect& aRect) {
     mDrawTarget->PushClipRect(aRect);
     ++mPushCount;
   }
diff --git a/gfx/2d/HelpersD2D.h b/gfx/2d/HelpersD2D.h
index aac4817642b1d..5f10d7ee6d57d 100644
--- a/gfx/2d/HelpersD2D.h
+++ b/gfx/2d/HelpersD2D.h
@@ -27,20 +27,20 @@ namespace gfx {
 
 RefPtr D2DFactory();
 
-static inline D2D1_POINT_2F D2DPoint(const Point &aPoint) {
+static inline D2D1_POINT_2F D2DPoint(const Point& aPoint) {
   return D2D1::Point2F(aPoint.x, aPoint.y);
 }
 
-static inline D2D1_SIZE_U D2DIntSize(const IntSize &aSize) {
+static inline D2D1_SIZE_U D2DIntSize(const IntSize& aSize) {
   return D2D1::SizeU(aSize.width, aSize.height);
 }
 
 template 
-static inline D2D1_RECT_F D2DRect(const T &aRect) {
+static inline D2D1_RECT_F D2DRect(const T& aRect) {
   return D2D1::RectF(aRect.X(), aRect.Y(), aRect.XMost(), aRect.YMost());
 }
 
-static inline D2D1_ROUNDED_RECT D2DRoundedRect(const RoundedRect &aRect) {
+static inline D2D1_ROUNDED_RECT D2DRoundedRect(const RoundedRect& aRect) {
   return D2D1::RoundedRect(D2DRect(aRect.rect),
                            aRect.corners.BottomLeft().width,
                            aRect.corners.BottomLeft().height);
@@ -92,7 +92,7 @@ static inline D2D1_INTERPOLATION_MODE D2DInterpolationMode(
   }
 }
 
-static inline D2D1_MATRIX_5X4_F D2DMatrix5x4(const Matrix5x4 &aMatrix) {
+static inline D2D1_MATRIX_5X4_F D2DMatrix5x4(const Matrix5x4& aMatrix) {
   return D2D1::Matrix5x4F(aMatrix._11, aMatrix._12, aMatrix._13, aMatrix._14,
                           aMatrix._21, aMatrix._22, aMatrix._23, aMatrix._24,
                           aMatrix._31, aMatrix._32, aMatrix._33, aMatrix._34,
@@ -100,7 +100,7 @@ static inline D2D1_MATRIX_5X4_F D2DMatrix5x4(const Matrix5x4 &aMatrix) {
                           aMatrix._51, aMatrix._52, aMatrix._53, aMatrix._54);
 }
 
-static inline D2D1_VECTOR_3F D2DVector3D(const Point3D &aPoint) {
+static inline D2D1_VECTOR_3F D2DVector3D(const Point3D& aPoint) {
   return D2D1::Vector3F(aPoint.x, aPoint.y, aPoint.z);
 }
 
@@ -113,20 +113,20 @@ static inline D2D1_ANTIALIAS_MODE D2DAAMode(AntialiasMode aMode) {
   }
 }
 
-static inline D2D1_MATRIX_3X2_F D2DMatrix(const Matrix &aTransform) {
+static inline D2D1_MATRIX_3X2_F D2DMatrix(const Matrix& aTransform) {
   return D2D1::Matrix3x2F(aTransform._11, aTransform._12, aTransform._21,
                           aTransform._22, aTransform._31, aTransform._32);
 }
 
-static inline D2D1_COLOR_F D2DColor(const Color &aColor) {
+static inline D2D1_COLOR_F D2DColor(const Color& aColor) {
   return D2D1::ColorF(aColor.r, aColor.g, aColor.b, aColor.a);
 }
 
-static inline IntSize ToIntSize(const D2D1_SIZE_U &aSize) {
+static inline IntSize ToIntSize(const D2D1_SIZE_U& aSize) {
   return IntSize(aSize.width, aSize.height);
 }
 
-static inline SurfaceFormat ToPixelFormat(const D2D1_PIXEL_FORMAT &aFormat) {
+static inline SurfaceFormat ToPixelFormat(const D2D1_PIXEL_FORMAT& aFormat) {
   switch (aFormat.format) {
     case DXGI_FORMAT_A8_UNORM:
     case DXGI_FORMAT_R8_UNORM:
@@ -142,17 +142,17 @@ static inline SurfaceFormat ToPixelFormat(const D2D1_PIXEL_FORMAT &aFormat) {
   }
 }
 
-static inline Rect ToRect(const D2D1_RECT_F &aRect) {
+static inline Rect ToRect(const D2D1_RECT_F& aRect) {
   return Rect(aRect.left, aRect.top, aRect.right - aRect.left,
               aRect.bottom - aRect.top);
 }
 
-static inline Matrix ToMatrix(const D2D1_MATRIX_3X2_F &aTransform) {
+static inline Matrix ToMatrix(const D2D1_MATRIX_3X2_F& aTransform) {
   return Matrix(aTransform._11, aTransform._12, aTransform._21, aTransform._22,
                 aTransform._31, aTransform._32);
 }
 
-static inline Point ToPoint(const D2D1_POINT_2F &aPoint) {
+static inline Point ToPoint(const D2D1_POINT_2F& aPoint) {
   return Point(aPoint.x, aPoint.y);
 }
 
@@ -300,13 +300,13 @@ static inline D2D1_PRIMITIVE_BLEND D2DPrimitiveBlendMode(CompositionOp aOp) {
   }
 }
 
-static inline bool IsPatternSupportedByD2D(const Pattern &aPattern) {
+static inline bool IsPatternSupportedByD2D(const Pattern& aPattern) {
   if (aPattern.GetType() != PatternType::RADIAL_GRADIENT) {
     return true;
   }
 
-  const RadialGradientPattern *pat =
-      static_cast(&aPattern);
+  const RadialGradientPattern* pat =
+      static_cast(&aPattern);
 
   if (pat->mRadius1 != 0) {
     return false;
@@ -335,10 +335,10 @@ struct ShaderConstantRectD3D10 {
       : mX(aX), mY(aY), mWidth(aWidth), mHeight(aHeight) {}
 
   // For easy passing to SetVertexShaderConstantF.
-  operator float *() { return &mX; }
+  operator float*() { return &mX; }
 };
 
-static inline DWRITE_MATRIX DWriteMatrixFromMatrix(Matrix &aMatrix) {
+static inline DWRITE_MATRIX DWriteMatrixFromMatrix(Matrix& aMatrix) {
   DWRITE_MATRIX mat;
   mat.m11 = aMatrix._11;
   mat.m12 = aMatrix._12;
@@ -382,15 +382,15 @@ class AutoDWriteGlyphRun : public DWRITE_GLYPH_RUN {
   UINT16 mAutoIndices[kNumAutoGlyphs];
 };
 
-static inline void DWriteGlyphRunFromGlyphs(const GlyphBuffer &aGlyphs,
-                                            ScaledFontDWrite *aFont,
-                                            AutoDWriteGlyphRun *run) {
+static inline void DWriteGlyphRunFromGlyphs(const GlyphBuffer& aGlyphs,
+                                            ScaledFontDWrite* aFont,
+                                            AutoDWriteGlyphRun* run) {
   run->allocate(aGlyphs.mNumGlyphs);
 
-  FLOAT *advances = const_cast(run->glyphAdvances);
-  UINT16 *indices = const_cast(run->glyphIndices);
-  DWRITE_GLYPH_OFFSET *offsets =
-      const_cast(run->glyphOffsets);
+  FLOAT* advances = const_cast(run->glyphAdvances);
+  UINT16* indices = const_cast(run->glyphIndices);
+  DWRITE_GLYPH_OFFSET* offsets =
+      const_cast(run->glyphOffsets);
 
   memset(advances, 0, sizeof(FLOAT) * aGlyphs.mNumGlyphs);
   for (unsigned int i = 0; i < aGlyphs.mNumGlyphs; i++) {
@@ -407,14 +407,14 @@ static inline void DWriteGlyphRunFromGlyphs(const GlyphBuffer &aGlyphs,
 }
 
 static inline already_AddRefed ConvertRectToGeometry(
-    const D2D1_RECT_F &aRect) {
+    const D2D1_RECT_F& aRect) {
   RefPtr rectGeom;
   D2DFactory()->CreateRectangleGeometry(&aRect, getter_AddRefs(rectGeom));
   return rectGeom.forget();
 }
 
 static inline already_AddRefed GetTransformedGeometry(
-    ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform) {
+    ID2D1Geometry* aGeometry, const D2D1_MATRIX_3X2_F& aTransform) {
   RefPtr tmpGeometry;
   D2DFactory()->CreatePathGeometry(getter_AddRefs(tmpGeometry));
   RefPtr currentSink;
@@ -426,7 +426,7 @@ static inline already_AddRefed GetTransformedGeometry(
 }
 
 static inline already_AddRefed IntersectGeometry(
-    ID2D1Geometry *aGeometryA, ID2D1Geometry *aGeometryB) {
+    ID2D1Geometry* aGeometryA, ID2D1Geometry* aGeometryB) {
   RefPtr pathGeom;
   D2DFactory()->CreatePathGeometry(getter_AddRefs(pathGeom));
   RefPtr sink;
@@ -439,7 +439,7 @@ static inline already_AddRefed IntersectGeometry(
 }
 
 static inline already_AddRefed CreateStrokeStyleForOptions(
-    const StrokeOptions &aStrokeOptions) {
+    const StrokeOptions& aStrokeOptions) {
   RefPtr style;
 
   D2D1_CAP_STYLE capStyle;
@@ -513,10 +513,10 @@ static inline already_AddRefed CreateStrokeStyleForOptions(
 // uploads the minimum requirement and possibly downscales. It adjusts the
 // input Matrix to compensate.
 static inline already_AddRefed CreatePartialBitmapForSurface(
-    DataSourceSurface *aSurface, const Matrix &aDestinationTransform,
-    const IntSize &aDestinationSize, ExtendMode aExtendMode,
-    Matrix &aSourceTransform, ID2D1RenderTarget *aRT,
-    const IntRect *aSourceRect = nullptr) {
+    DataSourceSurface* aSurface, const Matrix& aDestinationTransform,
+    const IntSize& aDestinationSize, ExtendMode aExtendMode,
+    Matrix& aSourceTransform, ID2D1RenderTarget* aRT,
+    const IntRect* aSourceRect = nullptr) {
   RefPtr bitmap;
 
   // This is where things get complicated. The source surface was
@@ -673,8 +673,8 @@ static inline already_AddRefed CreatePartialBitmapForSurface(
   }
 }
 
-static inline void AddRectToSink(ID2D1GeometrySink *aSink,
-                                 const D2D1_RECT_F &aRect) {
+static inline void AddRectToSink(ID2D1GeometrySink* aSink,
+                                 const D2D1_RECT_F& aRect) {
   aSink->BeginFigure(D2D1::Point2F(aRect.left, aRect.top),
                      D2D1_FIGURE_BEGIN_FILLED);
   aSink->AddLine(D2D1::Point2F(aRect.right, aRect.top));
@@ -685,18 +685,18 @@ static inline void AddRectToSink(ID2D1GeometrySink *aSink,
 
 class DCCommandSink : public ID2D1CommandSink {
  public:
-  explicit DCCommandSink(ID2D1DeviceContext *aCtx) : mCtx(aCtx) {}
+  explicit DCCommandSink(ID2D1DeviceContext* aCtx) : mCtx(aCtx) {}
 
-  HRESULT STDMETHODCALLTYPE QueryInterface(const IID &aIID, void **aPtr) {
+  HRESULT STDMETHODCALLTYPE QueryInterface(const IID& aIID, void** aPtr) {
     if (!aPtr) {
       return E_POINTER;
     }
 
     if (aIID == IID_IUnknown) {
-      *aPtr = static_cast(this);
+      *aPtr = static_cast(this);
       return S_OK;
     } else if (aIID == IID_ID2D1CommandSink) {
-      *aPtr = static_cast(this);
+      *aPtr = static_cast(this);
       return S_OK;
     }
 
@@ -733,12 +733,12 @@ class DCCommandSink : public ID2D1CommandSink {
   }
 
   STDMETHODIMP SetTextRenderingParams(
-      _In_opt_ IDWriteRenderingParams *textRenderingParams) {
+      _In_opt_ IDWriteRenderingParams* textRenderingParams) {
     mCtx->SetTextRenderingParams(textRenderingParams);
     return S_OK;
   }
 
-  STDMETHODIMP SetTransform(_In_ CONST D2D1_MATRIX_3X2_F *transform) {
+  STDMETHODIMP SetTransform(_In_ CONST D2D1_MATRIX_3X2_F* transform) {
     mCtx->SetTransform(transform);
     return S_OK;
   }
@@ -753,55 +753,55 @@ class DCCommandSink : public ID2D1CommandSink {
     return S_OK;
   }
 
-  STDMETHODIMP Clear(_In_opt_ CONST D2D1_COLOR_F *color) {
+  STDMETHODIMP Clear(_In_opt_ CONST D2D1_COLOR_F* color) {
     mCtx->Clear(color);
     return S_OK;
   }
 
   STDMETHODIMP DrawGlyphRun(
-      D2D1_POINT_2F baselineOrigin, _In_ CONST DWRITE_GLYPH_RUN *glyphRun,
-      _In_opt_ CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription,
-      _In_ ID2D1Brush *foregroundBrush, DWRITE_MEASURING_MODE measuringMode) {
+      D2D1_POINT_2F baselineOrigin, _In_ CONST DWRITE_GLYPH_RUN* glyphRun,
+      _In_opt_ CONST DWRITE_GLYPH_RUN_DESCRIPTION* glyphRunDescription,
+      _In_ ID2D1Brush* foregroundBrush, DWRITE_MEASURING_MODE measuringMode) {
     mCtx->DrawGlyphRun(baselineOrigin, glyphRun, glyphRunDescription,
                        foregroundBrush, measuringMode);
     return S_OK;
   }
 
   STDMETHODIMP DrawLine(D2D1_POINT_2F point0, D2D1_POINT_2F point1,
-                        _In_ ID2D1Brush *brush, FLOAT strokeWidth,
-                        _In_opt_ ID2D1StrokeStyle *strokeStyle) {
+                        _In_ ID2D1Brush* brush, FLOAT strokeWidth,
+                        _In_opt_ ID2D1StrokeStyle* strokeStyle) {
     mCtx->DrawLine(point0, point1, brush, strokeWidth, strokeStyle);
     return S_OK;
   }
 
-  STDMETHODIMP DrawGeometry(_In_ ID2D1Geometry *geometry,
-                            _In_ ID2D1Brush *brush, FLOAT strokeWidth,
-                            _In_opt_ ID2D1StrokeStyle *strokeStyle) {
+  STDMETHODIMP DrawGeometry(_In_ ID2D1Geometry* geometry,
+                            _In_ ID2D1Brush* brush, FLOAT strokeWidth,
+                            _In_opt_ ID2D1StrokeStyle* strokeStyle) {
     mCtx->DrawGeometry(geometry, brush, strokeWidth, strokeStyle);
     return S_OK;
   }
 
-  STDMETHODIMP DrawRectangle(_In_ CONST D2D1_RECT_F *rect,
-                             _In_ ID2D1Brush *brush, FLOAT strokeWidth,
-                             _In_opt_ ID2D1StrokeStyle *strokeStyle) {
+  STDMETHODIMP DrawRectangle(_In_ CONST D2D1_RECT_F* rect,
+                             _In_ ID2D1Brush* brush, FLOAT strokeWidth,
+                             _In_opt_ ID2D1StrokeStyle* strokeStyle) {
     mCtx->DrawRectangle(rect, brush, strokeWidth, strokeStyle);
     return S_OK;
   }
 
   STDMETHODIMP DrawBitmap(
-      _In_ ID2D1Bitmap *bitmap,
-      _In_opt_ CONST D2D1_RECT_F *destinationRectangle, FLOAT opacity,
+      _In_ ID2D1Bitmap* bitmap,
+      _In_opt_ CONST D2D1_RECT_F* destinationRectangle, FLOAT opacity,
       D2D1_INTERPOLATION_MODE interpolationMode,
-      _In_opt_ CONST D2D1_RECT_F *sourceRectangle,
-      _In_opt_ CONST D2D1_MATRIX_4X4_F *perspectiveTransform) {
+      _In_opt_ CONST D2D1_RECT_F* sourceRectangle,
+      _In_opt_ CONST D2D1_MATRIX_4X4_F* perspectiveTransform) {
     mCtx->DrawBitmap(bitmap, destinationRectangle, opacity, interpolationMode,
                      sourceRectangle, perspectiveTransform);
     return S_OK;
   }
 
-  STDMETHODIMP DrawImage(_In_ ID2D1Image *image,
-                         _In_opt_ CONST D2D1_POINT_2F *targetOffset,
-                         _In_opt_ CONST D2D1_RECT_F *imageRectangle,
+  STDMETHODIMP DrawImage(_In_ ID2D1Image* image,
+                         _In_opt_ CONST D2D1_POINT_2F* targetOffset,
+                         _In_opt_ CONST D2D1_RECT_F* imageRectangle,
                          D2D1_INTERPOLATION_MODE interpolationMode,
                          D2D1_COMPOSITE_MODE compositeMode) {
     mCtx->DrawImage(image, targetOffset, imageRectangle, interpolationMode,
@@ -809,47 +809,47 @@ class DCCommandSink : public ID2D1CommandSink {
     return S_OK;
   }
 
-  STDMETHODIMP DrawGdiMetafile(_In_ ID2D1GdiMetafile *gdiMetafile,
-                               _In_opt_ CONST D2D1_POINT_2F *targetOffset) {
+  STDMETHODIMP DrawGdiMetafile(_In_ ID2D1GdiMetafile* gdiMetafile,
+                               _In_opt_ CONST D2D1_POINT_2F* targetOffset) {
     mCtx->DrawGdiMetafile(gdiMetafile, targetOffset);
     return S_OK;
   }
 
-  STDMETHODIMP FillMesh(_In_ ID2D1Mesh *mesh, _In_ ID2D1Brush *brush) {
+  STDMETHODIMP FillMesh(_In_ ID2D1Mesh* mesh, _In_ ID2D1Brush* brush) {
     mCtx->FillMesh(mesh, brush);
     return S_OK;
   }
 
-  STDMETHODIMP FillOpacityMask(_In_ ID2D1Bitmap *opacityMask,
-                               _In_ ID2D1Brush *brush,
-                               _In_opt_ CONST D2D1_RECT_F *destinationRectangle,
-                               _In_opt_ CONST D2D1_RECT_F *sourceRectangle) {
+  STDMETHODIMP FillOpacityMask(_In_ ID2D1Bitmap* opacityMask,
+                               _In_ ID2D1Brush* brush,
+                               _In_opt_ CONST D2D1_RECT_F* destinationRectangle,
+                               _In_opt_ CONST D2D1_RECT_F* sourceRectangle) {
     mCtx->FillOpacityMask(opacityMask, brush, destinationRectangle,
                           sourceRectangle);
     return S_OK;
   }
 
-  STDMETHODIMP FillGeometry(_In_ ID2D1Geometry *geometry,
-                            _In_ ID2D1Brush *brush,
-                            _In_opt_ ID2D1Brush *opacityBrush) {
+  STDMETHODIMP FillGeometry(_In_ ID2D1Geometry* geometry,
+                            _In_ ID2D1Brush* brush,
+                            _In_opt_ ID2D1Brush* opacityBrush) {
     mCtx->FillGeometry(geometry, brush, opacityBrush);
     return S_OK;
   }
 
-  STDMETHODIMP FillRectangle(_In_ CONST D2D1_RECT_F *rect,
-                             _In_ ID2D1Brush *brush) {
+  STDMETHODIMP FillRectangle(_In_ CONST D2D1_RECT_F* rect,
+                             _In_ ID2D1Brush* brush) {
     mCtx->FillRectangle(rect, brush);
     return S_OK;
   }
 
-  STDMETHODIMP PushAxisAlignedClip(_In_ CONST D2D1_RECT_F *clipRect,
+  STDMETHODIMP PushAxisAlignedClip(_In_ CONST D2D1_RECT_F* clipRect,
                                    D2D1_ANTIALIAS_MODE antialiasMode) {
     mCtx->PushAxisAlignedClip(clipRect, antialiasMode);
     return S_OK;
   }
 
-  STDMETHODIMP PushLayer(_In_ CONST D2D1_LAYER_PARAMETERS1 *layerParameters1,
-                         _In_opt_ ID2D1Layer *layer) {
+  STDMETHODIMP PushLayer(_In_ CONST D2D1_LAYER_PARAMETERS1* layerParameters1,
+                         _In_opt_ ID2D1Layer* layer) {
     mCtx->PushLayer(layerParameters1, layer);
     return S_OK;
   }
@@ -864,7 +864,7 @@ class DCCommandSink : public ID2D1CommandSink {
     return S_OK;
   }
 
-  ID2D1DeviceContext *mCtx;
+  ID2D1DeviceContext* mCtx;
 };
 
 class MOZ_STACK_CLASS AutoRestoreFP final {
@@ -892,18 +892,18 @@ class MOZ_STACK_CLASS AutoRestoreFP final {
 // what we expect
 class StreamingGeometrySink : public ID2D1SimplifiedGeometrySink {
  public:
-  explicit StreamingGeometrySink(PathSink *aSink) : mSink(aSink) {}
+  explicit StreamingGeometrySink(PathSink* aSink) : mSink(aSink) {}
 
-  HRESULT STDMETHODCALLTYPE QueryInterface(const IID &aIID, void **aPtr) {
+  HRESULT STDMETHODCALLTYPE QueryInterface(const IID& aIID, void** aPtr) {
     if (!aPtr) {
       return E_POINTER;
     }
 
     if (aIID == IID_IUnknown) {
-      *aPtr = static_cast(this);
+      *aPtr = static_cast(this);
       return S_OK;
     } else if (aIID == IID_ID2D1SimplifiedGeometrySink) {
-      *aPtr = static_cast(this);
+      *aPtr = static_cast(this);
       return S_OK;
     }
 
@@ -921,14 +921,14 @@ class StreamingGeometrySink : public ID2D1SimplifiedGeometrySink {
     AutoRestoreFP resetFloatingPoint;
     mSink->MoveTo(ToPoint(aPoint));
   }
-  STDMETHOD_(void, AddLines)(const D2D1_POINT_2F *aLines, UINT aCount) {
+  STDMETHOD_(void, AddLines)(const D2D1_POINT_2F* aLines, UINT aCount) {
     AutoRestoreFP resetFloatingPoint;
     for (UINT i = 0; i < aCount; i++) {
       mSink->LineTo(ToPoint(aLines[i]));
     }
   }
   STDMETHOD_(void, AddBeziers)
-  (const D2D1_BEZIER_SEGMENT *aSegments, UINT aCount) {
+  (const D2D1_BEZIER_SEGMENT* aSegments, UINT aCount) {
     AutoRestoreFP resetFloatingPoint;
     for (UINT i = 0; i < aCount; i++) {
       mSink->BezierTo(ToPoint(aSegments[i].point1),
@@ -951,7 +951,7 @@ class StreamingGeometrySink : public ID2D1SimplifiedGeometrySink {
   }
 
  private:
-  PathSink *mSink;
+  PathSink* mSink;
 };
 
 }  // namespace gfx
diff --git a/gfx/2d/ImageScaling.cpp b/gfx/2d/ImageScaling.cpp
index 3baac775a3c19..e6533fca7dd69 100644
--- a/gfx/2d/ImageScaling.cpp
+++ b/gfx/2d/ImageScaling.cpp
@@ -43,7 +43,7 @@ inline uint32_t Avg2(uint32_t a, uint32_t b) {
   return ((sum & mask) >> 1) + carry;
 }
 
-void ImageHalfScaler::ScaleForSize(const IntSize &aSize) {
+void ImageHalfScaler::ScaleForSize(const IntSize& aSize) {
   uint32_t horizontalDownscales = 0;
   uint32_t verticalDownscales = 0;
 
@@ -86,8 +86,8 @@ void ImageHalfScaler::ScaleForSize(const IntSize &aSize) {
 
   if (uintptr_t(mDataStorage) % 16) {
     // Our storage does not start at a 16-byte boundary. Make sure mData does!
-    mData = (uint8_t *)(uintptr_t(mDataStorage) +
-                        (16 - (uintptr_t(mDataStorage) % 16)));
+    mData = (uint8_t*)(uintptr_t(mDataStorage) +
+                       (16 - (uintptr_t(mDataStorage) % 16)));
   } else {
     mData = mDataStorage;
   }
@@ -101,7 +101,7 @@ void ImageHalfScaler::ScaleForSize(const IntSize &aSize) {
    */
   IntSize currentSampledSize = mOrigSize;
   uint32_t currentSampledStride = mOrigStride;
-  uint8_t *currentSampledData = mOrigData;
+  uint8_t* currentSampledData = mOrigData;
 
   while (verticalDownscales && horizontalDownscales) {
     if (currentSampledSize.width % 2) {
@@ -151,8 +151,8 @@ void ImageHalfScaler::ScaleForSize(const IntSize &aSize) {
   }
 }
 
-void ImageHalfScaler::HalfImage2D(uint8_t *aSource, int32_t aSourceStride,
-                                  const IntSize &aSourceSize, uint8_t *aDest,
+void ImageHalfScaler::HalfImage2D(uint8_t* aSource, int32_t aSourceStride,
+                                  const IntSize& aSourceSize, uint8_t* aDest,
                                   uint32_t aDestStride) {
 #ifdef USE_SSE2
   if (Factory::HasSSE2()) {
@@ -164,9 +164,9 @@ void ImageHalfScaler::HalfImage2D(uint8_t *aSource, int32_t aSourceStride,
   }
 }
 
-void ImageHalfScaler::HalfImageVertical(uint8_t *aSource, int32_t aSourceStride,
-                                        const IntSize &aSourceSize,
-                                        uint8_t *aDest, uint32_t aDestStride) {
+void ImageHalfScaler::HalfImageVertical(uint8_t* aSource, int32_t aSourceStride,
+                                        const IntSize& aSourceSize,
+                                        uint8_t* aDest, uint32_t aDestStride) {
 #ifdef USE_SSE2
   if (Factory::HasSSE2()) {
     HalfImageVertical_SSE2(aSource, aSourceStride, aSourceSize, aDest,
@@ -179,10 +179,10 @@ void ImageHalfScaler::HalfImageVertical(uint8_t *aSource, int32_t aSourceStride,
   }
 }
 
-void ImageHalfScaler::HalfImageHorizontal(uint8_t *aSource,
+void ImageHalfScaler::HalfImageHorizontal(uint8_t* aSource,
                                           int32_t aSourceStride,
-                                          const IntSize &aSourceSize,
-                                          uint8_t *aDest,
+                                          const IntSize& aSourceSize,
+                                          uint8_t* aDest,
                                           uint32_t aDestStride) {
 #ifdef USE_SSE2
   if (Factory::HasSSE2()) {
@@ -196,47 +196,47 @@ void ImageHalfScaler::HalfImageHorizontal(uint8_t *aSource,
   }
 }
 
-void ImageHalfScaler::HalfImage2D_C(uint8_t *aSource, int32_t aSourceStride,
-                                    const IntSize &aSourceSize, uint8_t *aDest,
+void ImageHalfScaler::HalfImage2D_C(uint8_t* aSource, int32_t aSourceStride,
+                                    const IntSize& aSourceSize, uint8_t* aDest,
                                     uint32_t aDestStride) {
   for (int y = 0; y < aSourceSize.height; y += 2) {
-    uint32_t *storage = (uint32_t *)(aDest + (y / 2) * aDestStride);
+    uint32_t* storage = (uint32_t*)(aDest + (y / 2) * aDestStride);
     for (int x = 0; x < aSourceSize.width; x += 2) {
-      uint8_t *upperRow = aSource + (y * aSourceStride + x * 4);
-      uint8_t *lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
+      uint8_t* upperRow = aSource + (y * aSourceStride + x * 4);
+      uint8_t* lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
 
-      *storage++ = Avg2x2(*(uint32_t *)upperRow, *((uint32_t *)upperRow + 1),
-                          *(uint32_t *)lowerRow, *((uint32_t *)lowerRow + 1));
+      *storage++ = Avg2x2(*(uint32_t*)upperRow, *((uint32_t*)upperRow + 1),
+                          *(uint32_t*)lowerRow, *((uint32_t*)lowerRow + 1));
     }
   }
 }
 
-void ImageHalfScaler::HalfImageVertical_C(uint8_t *aSource,
+void ImageHalfScaler::HalfImageVertical_C(uint8_t* aSource,
                                           int32_t aSourceStride,
-                                          const IntSize &aSourceSize,
-                                          uint8_t *aDest,
+                                          const IntSize& aSourceSize,
+                                          uint8_t* aDest,
                                           uint32_t aDestStride) {
   for (int y = 0; y < aSourceSize.height; y += 2) {
-    uint32_t *storage = (uint32_t *)(aDest + (y / 2) * aDestStride);
+    uint32_t* storage = (uint32_t*)(aDest + (y / 2) * aDestStride);
     for (int x = 0; x < aSourceSize.width; x++) {
-      uint32_t *upperRow = (uint32_t *)(aSource + (y * aSourceStride + x * 4));
-      uint32_t *lowerRow =
-          (uint32_t *)(aSource + ((y + 1) * aSourceStride + x * 4));
+      uint32_t* upperRow = (uint32_t*)(aSource + (y * aSourceStride + x * 4));
+      uint32_t* lowerRow =
+          (uint32_t*)(aSource + ((y + 1) * aSourceStride + x * 4));
 
       *storage++ = Avg2(*upperRow, *lowerRow);
     }
   }
 }
 
-void ImageHalfScaler::HalfImageHorizontal_C(uint8_t *aSource,
+void ImageHalfScaler::HalfImageHorizontal_C(uint8_t* aSource,
                                             int32_t aSourceStride,
-                                            const IntSize &aSourceSize,
-                                            uint8_t *aDest,
+                                            const IntSize& aSourceSize,
+                                            uint8_t* aDest,
                                             uint32_t aDestStride) {
   for (int y = 0; y < aSourceSize.height; y++) {
-    uint32_t *storage = (uint32_t *)(aDest + y * aDestStride);
+    uint32_t* storage = (uint32_t*)(aDest + y * aDestStride);
     for (int x = 0; x < aSourceSize.width; x += 2) {
-      uint32_t *pixels = (uint32_t *)(aSource + (y * aSourceStride + x * 4));
+      uint32_t* pixels = (uint32_t*)(aSource + (y * aSourceStride + x * 4));
 
       *storage++ = Avg2(*pixels, *(pixels + 1));
     }
diff --git a/gfx/2d/ImageScaling.h b/gfx/2d/ImageScaling.h
index 3c3e4ba30bfda..446b5287c6a93 100644
--- a/gfx/2d/ImageScaling.h
+++ b/gfx/2d/ImageScaling.h
@@ -17,7 +17,7 @@ namespace gfx {
 
 class ImageHalfScaler {
  public:
-  ImageHalfScaler(uint8_t *aData, int32_t aStride, const IntSize &aSize)
+  ImageHalfScaler(uint8_t* aData, int32_t aStride, const IntSize& aSize)
       : mOrigData(aData),
         mOrigStride(aStride),
         mOrigSize(aSize),
@@ -27,52 +27,52 @@ class ImageHalfScaler {
 
   ~ImageHalfScaler() { delete[] mDataStorage; }
 
-  void ScaleForSize(const IntSize &aSize);
+  void ScaleForSize(const IntSize& aSize);
 
-  uint8_t *GetScaledData() const { return mData; }
+  uint8_t* GetScaledData() const { return mData; }
   IntSize GetSize() const { return mSize; }
   uint32_t GetStride() const { return mStride; }
 
  private:
-  void HalfImage2D(uint8_t *aSource, int32_t aSourceStride,
-                   const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImage2D(uint8_t* aSource, int32_t aSourceStride,
+                   const IntSize& aSourceSize, uint8_t* aDest,
                    uint32_t aDestStride);
-  void HalfImageVertical(uint8_t *aSource, int32_t aSourceStride,
-                         const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImageVertical(uint8_t* aSource, int32_t aSourceStride,
+                         const IntSize& aSourceSize, uint8_t* aDest,
                          uint32_t aDestStride);
-  void HalfImageHorizontal(uint8_t *aSource, int32_t aSourceStride,
-                           const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImageHorizontal(uint8_t* aSource, int32_t aSourceStride,
+                           const IntSize& aSourceSize, uint8_t* aDest,
                            uint32_t aDestStride);
 
   // This is our SSE2 scaling function. Our destination must always be 16-byte
   // aligned and use a 16-byte aligned stride.
-  void HalfImage2D_SSE2(uint8_t *aSource, int32_t aSourceStride,
-                        const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImage2D_SSE2(uint8_t* aSource, int32_t aSourceStride,
+                        const IntSize& aSourceSize, uint8_t* aDest,
                         uint32_t aDestStride);
-  void HalfImageVertical_SSE2(uint8_t *aSource, int32_t aSourceStride,
-                              const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImageVertical_SSE2(uint8_t* aSource, int32_t aSourceStride,
+                              const IntSize& aSourceSize, uint8_t* aDest,
                               uint32_t aDestStride);
-  void HalfImageHorizontal_SSE2(uint8_t *aSource, int32_t aSourceStride,
-                                const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImageHorizontal_SSE2(uint8_t* aSource, int32_t aSourceStride,
+                                const IntSize& aSourceSize, uint8_t* aDest,
                                 uint32_t aDestStride);
 
-  void HalfImage2D_C(uint8_t *aSource, int32_t aSourceStride,
-                     const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImage2D_C(uint8_t* aSource, int32_t aSourceStride,
+                     const IntSize& aSourceSize, uint8_t* aDest,
                      uint32_t aDestStride);
-  void HalfImageVertical_C(uint8_t *aSource, int32_t aSourceStride,
-                           const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImageVertical_C(uint8_t* aSource, int32_t aSourceStride,
+                           const IntSize& aSourceSize, uint8_t* aDest,
                            uint32_t aDestStride);
-  void HalfImageHorizontal_C(uint8_t *aSource, int32_t aSourceStride,
-                             const IntSize &aSourceSize, uint8_t *aDest,
+  void HalfImageHorizontal_C(uint8_t* aSource, int32_t aSourceStride,
+                             const IntSize& aSourceSize, uint8_t* aDest,
                              uint32_t aDestStride);
 
-  uint8_t *mOrigData;
+  uint8_t* mOrigData;
   int32_t mOrigStride;
   IntSize mOrigSize;
 
-  uint8_t *mDataStorage;
+  uint8_t* mDataStorage;
   // Guaranteed 16-byte aligned
-  uint8_t *mData;
+  uint8_t* mData;
   IntSize mSize;
   // Guaranteed 16-byte aligned
   uint32_t mStride;
diff --git a/gfx/2d/ImageScalingSSE2.cpp b/gfx/2d/ImageScalingSSE2.cpp
index 9f37ce13edd6b..b43eb81838793 100644
--- a/gfx/2d/ImageScalingSSE2.cpp
+++ b/gfx/2d/ImageScalingSSE2.cpp
@@ -63,8 +63,8 @@ MOZ_ALWAYS_INLINE __m128i _mm_not_si128(__m128i arg) {
  * stack variables. This inlines properly on MSVC 2010. It does -not- inline
  * with just the inline directive.
  */
-MOZ_ALWAYS_INLINE __m128i avg_sse2_8x2(__m128i *a, __m128i *b, __m128i *c,
-                                       __m128i *d) {
+MOZ_ALWAYS_INLINE __m128i avg_sse2_8x2(__m128i* a, __m128i* b, __m128i* c,
+                                       __m128i* d) {
 #define shuf1 _MM_SHUFFLE(2, 0, 2, 0)
 #define shuf2 _MM_SHUFFLE(3, 1, 3, 1)
 
@@ -137,22 +137,21 @@ MOZ_ALWAYS_INLINE uint32_t Avg2(uint32_t a, uint32_t b) {
 namespace mozilla {
 namespace gfx {
 
-void ImageHalfScaler::HalfImage2D_SSE2(uint8_t *aSource, int32_t aSourceStride,
-                                       const IntSize &aSourceSize,
-                                       uint8_t *aDest, uint32_t aDestStride) {
+void ImageHalfScaler::HalfImage2D_SSE2(uint8_t* aSource, int32_t aSourceStride,
+                                       const IntSize& aSourceSize,
+                                       uint8_t* aDest, uint32_t aDestStride) {
   const int Bpp = 4;
 
   for (int y = 0; y < aSourceSize.height; y += 2) {
-    __m128i *storage = (__m128i *)(aDest + (y / 2) * aDestStride);
+    __m128i* storage = (__m128i*)(aDest + (y / 2) * aDestStride);
     int x = 0;
     // Run a loop depending on alignment.
     if (!(uintptr_t(aSource + (y * aSourceStride)) % 16) &&
         !(uintptr_t(aSource + ((y + 1) * aSourceStride)) % 16)) {
       for (; x < (aSourceSize.width - 7); x += 8) {
-        __m128i *upperRow =
-            (__m128i *)(aSource + (y * aSourceStride + x * Bpp));
-        __m128i *lowerRow =
-            (__m128i *)(aSource + ((y + 1) * aSourceStride + x * Bpp));
+        __m128i* upperRow = (__m128i*)(aSource + (y * aSourceStride + x * Bpp));
+        __m128i* lowerRow =
+            (__m128i*)(aSource + ((y + 1) * aSourceStride + x * Bpp));
 
         __m128i a = _mm_load_si128(upperRow);
         __m128i b = _mm_load_si128(upperRow + 1);
@@ -163,10 +162,9 @@ void ImageHalfScaler::HalfImage2D_SSE2(uint8_t *aSource, int32_t aSourceStride,
       }
     } else if (!(uintptr_t(aSource + (y * aSourceStride)) % 16)) {
       for (; x < (aSourceSize.width - 7); x += 8) {
-        __m128i *upperRow =
-            (__m128i *)(aSource + (y * aSourceStride + x * Bpp));
-        __m128i *lowerRow =
-            (__m128i *)(aSource + ((y + 1) * aSourceStride + x * Bpp));
+        __m128i* upperRow = (__m128i*)(aSource + (y * aSourceStride + x * Bpp));
+        __m128i* lowerRow =
+            (__m128i*)(aSource + ((y + 1) * aSourceStride + x * Bpp));
 
         __m128i a = _mm_load_si128(upperRow);
         __m128i b = _mm_load_si128(upperRow + 1);
@@ -177,24 +175,22 @@ void ImageHalfScaler::HalfImage2D_SSE2(uint8_t *aSource, int32_t aSourceStride,
       }
     } else if (!(uintptr_t(aSource + ((y + 1) * aSourceStride)) % 16)) {
       for (; x < (aSourceSize.width - 7); x += 8) {
-        __m128i *upperRow =
-            (__m128i *)(aSource + (y * aSourceStride + x * Bpp));
-        __m128i *lowerRow =
-            (__m128i *)(aSource + ((y + 1) * aSourceStride + x * Bpp));
+        __m128i* upperRow = (__m128i*)(aSource + (y * aSourceStride + x * Bpp));
+        __m128i* lowerRow =
+            (__m128i*)(aSource + ((y + 1) * aSourceStride + x * Bpp));
 
-        __m128i a = loadUnaligned128((__m128i *)upperRow);
-        __m128i b = loadUnaligned128((__m128i *)upperRow + 1);
-        __m128i c = _mm_load_si128((__m128i *)lowerRow);
-        __m128i d = _mm_load_si128((__m128i *)lowerRow + 1);
+        __m128i a = loadUnaligned128((__m128i*)upperRow);
+        __m128i b = loadUnaligned128((__m128i*)upperRow + 1);
+        __m128i c = _mm_load_si128((__m128i*)lowerRow);
+        __m128i d = _mm_load_si128((__m128i*)lowerRow + 1);
 
         *storage++ = avg_sse2_8x2(&a, &b, &c, &d);
       }
     } else {
       for (; x < (aSourceSize.width - 7); x += 8) {
-        __m128i *upperRow =
-            (__m128i *)(aSource + (y * aSourceStride + x * Bpp));
-        __m128i *lowerRow =
-            (__m128i *)(aSource + ((y + 1) * aSourceStride + x * Bpp));
+        __m128i* upperRow = (__m128i*)(aSource + (y * aSourceStride + x * Bpp));
+        __m128i* lowerRow =
+            (__m128i*)(aSource + ((y + 1) * aSourceStride + x * Bpp));
 
         __m128i a = loadUnaligned128(upperRow);
         __m128i b = loadUnaligned128(upperRow + 1);
@@ -205,7 +201,7 @@ void ImageHalfScaler::HalfImage2D_SSE2(uint8_t *aSource, int32_t aSourceStride,
       }
     }
 
-    uint32_t *unalignedStorage = (uint32_t *)storage;
+    uint32_t* unalignedStorage = (uint32_t*)storage;
     // Take care of the final pixels, we know there's an even number of pixels
     // in the source rectangle. We use a 2x2 'simd' implementation for this.
     //
@@ -216,95 +212,95 @@ void ImageHalfScaler::HalfImage2D_SSE2(uint8_t *aSource, int32_t aSourceStride,
     // in this situation we have unused stride to write into harmlessly.
     // I do not believe the additional code complexity would be worth it though.
     for (; x < aSourceSize.width; x += 2) {
-      uint8_t *upperRow = aSource + (y * aSourceStride + x * Bpp);
-      uint8_t *lowerRow = aSource + ((y + 1) * aSourceStride + x * Bpp);
+      uint8_t* upperRow = aSource + (y * aSourceStride + x * Bpp);
+      uint8_t* lowerRow = aSource + ((y + 1) * aSourceStride + x * Bpp);
 
       *unalignedStorage++ =
-          Avg2x2(*(uint32_t *)upperRow, *((uint32_t *)upperRow + 1),
-                 *(uint32_t *)lowerRow, *((uint32_t *)lowerRow + 1));
+          Avg2x2(*(uint32_t*)upperRow, *((uint32_t*)upperRow + 1),
+                 *(uint32_t*)lowerRow, *((uint32_t*)lowerRow + 1));
     }
   }
 }
 
-void ImageHalfScaler::HalfImageVertical_SSE2(uint8_t *aSource,
+void ImageHalfScaler::HalfImageVertical_SSE2(uint8_t* aSource,
                                              int32_t aSourceStride,
-                                             const IntSize &aSourceSize,
-                                             uint8_t *aDest,
+                                             const IntSize& aSourceSize,
+                                             uint8_t* aDest,
                                              uint32_t aDestStride) {
   for (int y = 0; y < aSourceSize.height; y += 2) {
-    __m128i *storage = (__m128i *)(aDest + (y / 2) * aDestStride);
+    __m128i* storage = (__m128i*)(aDest + (y / 2) * aDestStride);
     int x = 0;
     // Run a loop depending on alignment.
     if (!(uintptr_t(aSource + (y * aSourceStride)) % 16) &&
         !(uintptr_t(aSource + ((y + 1) * aSourceStride)) % 16)) {
       for (; x < (aSourceSize.width - 3); x += 4) {
-        uint8_t *upperRow = aSource + (y * aSourceStride + x * 4);
-        uint8_t *lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
+        uint8_t* upperRow = aSource + (y * aSourceStride + x * 4);
+        uint8_t* lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
 
-        __m128i a = _mm_load_si128((__m128i *)upperRow);
-        __m128i b = _mm_load_si128((__m128i *)lowerRow);
+        __m128i a = _mm_load_si128((__m128i*)upperRow);
+        __m128i b = _mm_load_si128((__m128i*)lowerRow);
 
         *storage++ = avg_sse2_4x2_4x1(a, b);
       }
     } else if (!(uintptr_t(aSource + (y * aSourceStride)) % 16)) {
       // This line doesn't align well.
       for (; x < (aSourceSize.width - 3); x += 4) {
-        uint8_t *upperRow = aSource + (y * aSourceStride + x * 4);
-        uint8_t *lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
+        uint8_t* upperRow = aSource + (y * aSourceStride + x * 4);
+        uint8_t* lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
 
-        __m128i a = _mm_load_si128((__m128i *)upperRow);
-        __m128i b = loadUnaligned128((__m128i *)lowerRow);
+        __m128i a = _mm_load_si128((__m128i*)upperRow);
+        __m128i b = loadUnaligned128((__m128i*)lowerRow);
 
         *storage++ = avg_sse2_4x2_4x1(a, b);
       }
     } else if (!(uintptr_t(aSource + ((y + 1) * aSourceStride)) % 16)) {
       for (; x < (aSourceSize.width - 3); x += 4) {
-        uint8_t *upperRow = aSource + (y * aSourceStride + x * 4);
-        uint8_t *lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
+        uint8_t* upperRow = aSource + (y * aSourceStride + x * 4);
+        uint8_t* lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
 
-        __m128i a = loadUnaligned128((__m128i *)upperRow);
-        __m128i b = _mm_load_si128((__m128i *)lowerRow);
+        __m128i a = loadUnaligned128((__m128i*)upperRow);
+        __m128i b = _mm_load_si128((__m128i*)lowerRow);
 
         *storage++ = avg_sse2_4x2_4x1(a, b);
       }
     } else {
       for (; x < (aSourceSize.width - 3); x += 4) {
-        uint8_t *upperRow = aSource + (y * aSourceStride + x * 4);
-        uint8_t *lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
+        uint8_t* upperRow = aSource + (y * aSourceStride + x * 4);
+        uint8_t* lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
 
-        __m128i a = loadUnaligned128((__m128i *)upperRow);
-        __m128i b = loadUnaligned128((__m128i *)lowerRow);
+        __m128i a = loadUnaligned128((__m128i*)upperRow);
+        __m128i b = loadUnaligned128((__m128i*)lowerRow);
 
         *storage++ = avg_sse2_4x2_4x1(a, b);
       }
     }
 
-    uint32_t *unalignedStorage = (uint32_t *)storage;
+    uint32_t* unalignedStorage = (uint32_t*)storage;
     // Take care of the final pixels, we know there's an even number of pixels
     // in the source rectangle.
     //
     // Similar overflow considerations are valid as in the previous function.
     for (; x < aSourceSize.width; x++) {
-      uint8_t *upperRow = aSource + (y * aSourceStride + x * 4);
-      uint8_t *lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
+      uint8_t* upperRow = aSource + (y * aSourceStride + x * 4);
+      uint8_t* lowerRow = aSource + ((y + 1) * aSourceStride + x * 4);
 
-      *unalignedStorage++ = Avg2(*(uint32_t *)upperRow, *(uint32_t *)lowerRow);
+      *unalignedStorage++ = Avg2(*(uint32_t*)upperRow, *(uint32_t*)lowerRow);
     }
   }
 }
 
-void ImageHalfScaler::HalfImageHorizontal_SSE2(uint8_t *aSource,
+void ImageHalfScaler::HalfImageHorizontal_SSE2(uint8_t* aSource,
                                                int32_t aSourceStride,
-                                               const IntSize &aSourceSize,
-                                               uint8_t *aDest,
+                                               const IntSize& aSourceSize,
+                                               uint8_t* aDest,
                                                uint32_t aDestStride) {
   for (int y = 0; y < aSourceSize.height; y++) {
-    __m128i *storage = (__m128i *)(aDest + (y * aDestStride));
+    __m128i* storage = (__m128i*)(aDest + (y * aDestStride));
     int x = 0;
     // Run a loop depending on alignment.
     if (!(uintptr_t(aSource + (y * aSourceStride)) % 16)) {
       for (; x < (aSourceSize.width - 7); x += 8) {
-        __m128i *pixels = (__m128i *)(aSource + (y * aSourceStride + x * 4));
+        __m128i* pixels = (__m128i*)(aSource + (y * aSourceStride + x * 4));
 
         __m128i a = _mm_load_si128(pixels);
         __m128i b = _mm_load_si128(pixels + 1);
@@ -313,7 +309,7 @@ void ImageHalfScaler::HalfImageHorizontal_SSE2(uint8_t *aSource,
       }
     } else {
       for (; x < (aSourceSize.width - 7); x += 8) {
-        __m128i *pixels = (__m128i *)(aSource + (y * aSourceStride + x * 4));
+        __m128i* pixels = (__m128i*)(aSource + (y * aSourceStride + x * 4));
 
         __m128i a = loadUnaligned128(pixels);
         __m128i b = loadUnaligned128(pixels + 1);
@@ -322,13 +318,13 @@ void ImageHalfScaler::HalfImageHorizontal_SSE2(uint8_t *aSource,
       }
     }
 
-    uint32_t *unalignedStorage = (uint32_t *)storage;
+    uint32_t* unalignedStorage = (uint32_t*)storage;
     // Take care of the final pixels, we know there's an even number of pixels
     // in the source rectangle.
     //
     // Similar overflow considerations are valid as in the previous function.
     for (; x < aSourceSize.width; x += 2) {
-      uint32_t *pixels = (uint32_t *)(aSource + (y * aSourceStride + x * 4));
+      uint32_t* pixels = (uint32_t*)(aSource + (y * aSourceStride + x * 4));
 
       *unalignedStorage++ = Avg2(*pixels, *(pixels + 1));
     }
diff --git a/gfx/2d/InlineTranslator.cpp b/gfx/2d/InlineTranslator.cpp
index da101d09fc3ce..f99a1290a8aae 100644
--- a/gfx/2d/InlineTranslator.cpp
+++ b/gfx/2d/InlineTranslator.cpp
@@ -18,14 +18,14 @@ using namespace mozilla::gfx;
 namespace mozilla {
 namespace gfx {
 
-InlineTranslator::InlineTranslator(DrawTarget *aDT, void *aFontContext)
+InlineTranslator::InlineTranslator(DrawTarget* aDT, void* aFontContext)
     : mBaseDT(aDT), mFontContext(aFontContext) {}
 
-bool InlineTranslator::TranslateRecording(char *aData, size_t aLen) {
+bool InlineTranslator::TranslateRecording(char* aData, size_t aLen) {
   // an istream like class for reading from memory
   struct MemReader {
-    MemReader(char *aData, size_t aLen) : mData(aData), mEnd(aData + aLen) {}
-    void read(char *s, std::streamsize n) {
+    MemReader(char* aData, size_t aLen) : mData(aData), mEnd(aData + aLen) {}
+    void read(char* s, std::streamsize n) {
       if (n <= (mEnd - mData)) {
         memcpy(s, mData, n);
         mData += n;
@@ -38,8 +38,8 @@ bool InlineTranslator::TranslateRecording(char *aData, size_t aLen) {
     bool eof() { return mData > mEnd; }
     bool good() { return !eof(); }
 
-    char *mData;
-    char *mEnd;
+    char* mData;
+    char* mEnd;
   };
   MemReader reader(aData, aLen);
 
@@ -69,7 +69,7 @@ bool InlineTranslator::TranslateRecording(char *aData, size_t aLen) {
   while (reader.good()) {
     bool success = RecordedEvent::DoWithEvent(
         reader, static_cast(eventType),
-        [&](RecordedEvent *recordedEvent) {
+        [&](RecordedEvent* recordedEvent) {
           // Make sure that the whole event was read from the stream
           // successfully.
           if (!reader.good()) {
@@ -98,7 +98,7 @@ bool InlineTranslator::TranslateRecording(char *aData, size_t aLen) {
 }
 
 already_AddRefed InlineTranslator::CreateDrawTarget(
-    ReferencePtr aRefPtr, const gfx::IntSize &aSize,
+    ReferencePtr aRefPtr, const gfx::IntSize& aSize,
     gfx::SurfaceFormat aFormat) {
   RefPtr drawTarget = mBaseDT;
   AddDrawTarget(aRefPtr, drawTarget);
diff --git a/gfx/2d/LuminanceNEON.cpp b/gfx/2d/LuminanceNEON.cpp
index d95f50f12adc7..cb84336268e10 100644
--- a/gfx/2d/LuminanceNEON.cpp
+++ b/gfx/2d/LuminanceNEON.cpp
@@ -24,16 +24,16 @@ using namespace mozilla::gfx;
 #  define GFX_ARGB32_OFFSET_B 0
 #endif
 
-void ComputesRGBLuminanceMask_NEON(const uint8_t *aSourceData,
-                                   int32_t aSourceStride, uint8_t *aDestData,
-                                   int32_t aDestStride, const IntSize &aSize,
+void ComputesRGBLuminanceMask_NEON(const uint8_t* aSourceData,
+                                   int32_t aSourceStride, uint8_t* aDestData,
+                                   int32_t aDestStride, const IntSize& aSize,
                                    float aOpacity) {
   int32_t redFactor = 55 * aOpacity;     // 255 * 0.2125 * opacity
   int32_t greenFactor = 183 * aOpacity;  // 255 * 0.7154 * opacity
   int32_t blueFactor = 18 * aOpacity;    // 255 * 0.0721
-  const uint8_t *sourcePixel = aSourceData;
+  const uint8_t* sourcePixel = aSourceData;
   int32_t sourceOffset = aSourceStride - 4 * aSize.width;
-  uint8_t *destPixel = aDestData;
+  uint8_t* destPixel = aDestData;
   int32_t destOffset = aDestStride - aSize.width;
 
   sourcePixel = aSourceData;
diff --git a/gfx/2d/LuminanceNEON.h b/gfx/2d/LuminanceNEON.h
index 5cdce0c7327d4..1af0d039ddd92 100644
--- a/gfx/2d/LuminanceNEON.h
+++ b/gfx/2d/LuminanceNEON.h
@@ -9,10 +9,10 @@
 
 #include "mozilla/gfx/Point.h"
 
-void ComputesRGBLuminanceMask_NEON(const uint8_t *aSourceData,
-                                   int32_t aSourceStride, uint8_t *aDestData,
+void ComputesRGBLuminanceMask_NEON(const uint8_t* aSourceData,
+                                   int32_t aSourceStride, uint8_t* aDestData,
                                    int32_t aDestStride,
-                                   const mozilla::gfx::IntSize &aSize,
+                                   const mozilla::gfx::IntSize& aSize,
                                    float aOpacity);
 
 #endif /* __LUMINANCENEON_H__ */
diff --git a/gfx/2d/NativeFontResourceDWrite.h b/gfx/2d/NativeFontResourceDWrite.h
index 2db4dbe10eb9a..ba11904136e45 100644
--- a/gfx/2d/NativeFontResourceDWrite.h
+++ b/gfx/2d/NativeFontResourceDWrite.h
@@ -28,17 +28,17 @@ class NativeFontResourceDWrite final : public NativeFontResource {
    * @param aNeedsCairo whether the ScaledFont created needs a cairo scaled font
    * @return Referenced NativeFontResourceDWrite or nullptr if invalid.
    */
-  static already_AddRefed Create(uint8_t *aFontData,
+  static already_AddRefed Create(uint8_t* aFontData,
                                                            uint32_t aDataLength,
                                                            bool aNeedsCairo);
 
   already_AddRefed CreateUnscaledFont(
-      uint32_t aIndex, const uint8_t *aInstanceData,
+      uint32_t aIndex, const uint8_t* aInstanceData,
       uint32_t aInstanceDataLength) final;
 
  private:
   NativeFontResourceDWrite(
-      IDWriteFactory *aFactory, already_AddRefed aFontFile,
+      IDWriteFactory* aFactory, already_AddRefed aFontFile,
       already_AddRefed aFontFileStream,
       DWRITE_FONT_FACE_TYPE aFaceType, uint32_t aNumberOfFaces,
       bool aNeedsCairo)
@@ -49,7 +49,7 @@ class NativeFontResourceDWrite final : public NativeFontResource {
         mNumberOfFaces(aNumberOfFaces),
         mNeedsCairo(aNeedsCairo) {}
 
-  IDWriteFactory *mFactory;
+  IDWriteFactory* mFactory;
   RefPtr mFontFile;
   RefPtr mFontFileStream;
   DWRITE_FONT_FACE_TYPE mFaceType;
diff --git a/gfx/2d/Path.cpp b/gfx/2d/Path.cpp
index 5e64db7107f42..6b0357ed6e89b 100644
--- a/gfx/2d/Path.cpp
+++ b/gfx/2d/Path.cpp
@@ -24,7 +24,7 @@ struct PointD : public BasePoint {
 
   PointD() : Super() {}
   PointD(double aX, double aY) : Super(aX, aY) {}
-  MOZ_IMPLICIT PointD(const Point &aPoint) : Super(aPoint.x, aPoint.y) {}
+  MOZ_IMPLICIT PointD(const Point& aPoint) : Super(aPoint.x, aPoint.y) {}
 
   Point ToPoint() const {
     return Point(static_cast(x), static_cast(y));
@@ -33,14 +33,14 @@ struct PointD : public BasePoint {
 
 struct BezierControlPoints {
   BezierControlPoints() {}
-  BezierControlPoints(const PointD &aCP1, const PointD &aCP2,
-                      const PointD &aCP3, const PointD &aCP4)
+  BezierControlPoints(const PointD& aCP1, const PointD& aCP2,
+                      const PointD& aCP3, const PointD& aCP4)
       : mCP1(aCP1), mCP2(aCP2), mCP3(aCP3), mCP4(aCP4) {}
 
   PointD mCP1, mCP2, mCP3, mCP4;
 };
 
-void FlattenBezier(const BezierControlPoints &aPoints, PathSink *aSink,
+void FlattenBezier(const BezierControlPoints& aPoints, PathSink* aSink,
                    double aTolerance);
 
 Path::Path() {}
@@ -52,7 +52,7 @@ Float Path::ComputeLength() {
   return mFlattenedPath->ComputeLength();
 }
 
-Point Path::ComputePointAtLength(Float aLength, Point *aTangent) {
+Point Path::ComputePointAtLength(Float aLength, Point* aTangent) {
   EnsureFlattenedPath();
   return mFlattenedPath->ComputePointAtLength(aLength, aTangent);
 }
@@ -68,7 +68,7 @@ void Path::EnsureFlattenedPath() {
 // error) of the approximation from the actual Bezier curve.
 const Float kFlatteningTolerance = 0.0001f;
 
-void FlattenedPath::MoveTo(const Point &aPoint) {
+void FlattenedPath::MoveTo(const Point& aPoint) {
   MOZ_ASSERT(!mCalculatedLength);
   FlatPathOp op;
   op.mType = FlatPathOp::OP_MOVETO;
@@ -78,7 +78,7 @@ void FlattenedPath::MoveTo(const Point &aPoint) {
   mLastMove = aPoint;
 }
 
-void FlattenedPath::LineTo(const Point &aPoint) {
+void FlattenedPath::LineTo(const Point& aPoint) {
   MOZ_ASSERT(!mCalculatedLength);
   FlatPathOp op;
   op.mType = FlatPathOp::OP_LINETO;
@@ -86,14 +86,14 @@ void FlattenedPath::LineTo(const Point &aPoint) {
   mPathOps.push_back(op);
 }
 
-void FlattenedPath::BezierTo(const Point &aCP1, const Point &aCP2,
-                             const Point &aCP3) {
+void FlattenedPath::BezierTo(const Point& aCP1, const Point& aCP2,
+                             const Point& aCP3) {
   MOZ_ASSERT(!mCalculatedLength);
   FlattenBezier(BezierControlPoints(CurrentPoint(), aCP1, aCP2, aCP3), this,
                 kFlatteningTolerance);
 }
 
-void FlattenedPath::QuadraticBezierTo(const Point &aCP1, const Point &aCP2) {
+void FlattenedPath::QuadraticBezierTo(const Point& aCP1, const Point& aCP2) {
   MOZ_ASSERT(!mCalculatedLength);
   // We need to elevate the degree of this quadratic B�zier to cubic, so we're
   // going to add an intermediate control point, and recompute control point 1.
@@ -112,7 +112,7 @@ void FlattenedPath::Close() {
   LineTo(mLastMove);
 }
 
-void FlattenedPath::Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+void FlattenedPath::Arc(const Point& aOrigin, float aRadius, float aStartAngle,
                         float aEndAngle, bool aAntiClockwise) {
   ArcToBezier(this, aOrigin, Size(aRadius, aRadius), aStartAngle, aEndAngle,
               aAntiClockwise);
@@ -137,7 +137,7 @@ Float FlattenedPath::ComputeLength() {
   return mCachedLength;
 }
 
-Point FlattenedPath::ComputePointAtLength(Float aLength, Point *aTangent) {
+Point FlattenedPath::ComputePointAtLength(Float aLength, Point* aTangent) {
   // We track the last point that -wasn't- in the same place as the current
   // point so if we pass the edge of the path with a bunch of zero length
   // paths we still get the correct tangent vector.
@@ -182,9 +182,9 @@ Point FlattenedPath::ComputePointAtLength(Float aLength, Point *aTangent) {
 
 // This function explicitly permits aControlPoints to refer to the same object
 // as either of the other arguments.
-static void SplitBezier(const BezierControlPoints &aControlPoints,
-                        BezierControlPoints *aFirstSegmentControlPoints,
-                        BezierControlPoints *aSecondSegmentControlPoints,
+static void SplitBezier(const BezierControlPoints& aControlPoints,
+                        BezierControlPoints* aFirstSegmentControlPoints,
+                        BezierControlPoints* aSecondSegmentControlPoints,
                         double t) {
   MOZ_ASSERT(aSecondSegmentControlPoints);
 
@@ -212,8 +212,8 @@ static void SplitBezier(const BezierControlPoints &aControlPoints,
   aSecondSegmentControlPoints->mCP3 = cp3a;
 }
 
-static void FlattenBezierCurveSegment(const BezierControlPoints &aControlPoints,
-                                      PathSink *aSink, double aTolerance) {
+static void FlattenBezierCurveSegment(const BezierControlPoints& aControlPoints,
+                                      PathSink* aSink, double aTolerance) {
   /* The algorithm implemented here is based on:
    * http://cis.usouthal.edu/~hain/general/Publications/Bezier/Bezier%20Offset%20Curves.pdf
    *
@@ -262,7 +262,7 @@ static void FlattenBezierCurveSegment(const BezierControlPoints &aControlPoints,
 }
 
 static inline void FindInflectionApproximationRange(
-    BezierControlPoints aControlPoints, double *aMin, double *aMax, double aT,
+    BezierControlPoints aControlPoints, double* aMin, double* aMax, double aT,
     double aTolerance) {
   SplitBezier(aControlPoints, nullptr, &aControlPoints, aT);
 
@@ -358,8 +358,8 @@ static inline void FindInflectionApproximationRange(
  * hain has any numerical advantages over the one used below.
  */
 static inline void FindInflectionPoints(
-    const BezierControlPoints &aControlPoints, double *aT1, double *aT2,
-    uint32_t *aCount) {
+    const BezierControlPoints& aControlPoints, double* aT1, double* aT2,
+    uint32_t* aCount) {
   // Find inflection points.
   // See www.faculty.idc.ac.il/arik/quality/appendixa.html for an explanation
   // of this approach.
@@ -428,7 +428,7 @@ static inline void FindInflectionPoints(
   }
 }
 
-void FlattenBezier(const BezierControlPoints &aControlPoints, PathSink *aSink,
+void FlattenBezier(const BezierControlPoints& aControlPoints, PathSink* aSink,
                    double aTolerance) {
   double t1;
   double t2;
diff --git a/gfx/2d/PathAnalysis.h b/gfx/2d/PathAnalysis.h
index 5cb1453c33548..1b89f29a93629 100644
--- a/gfx/2d/PathAnalysis.h
+++ b/gfx/2d/PathAnalysis.h
@@ -26,13 +26,13 @@ class FlattenedPath : public PathSink {
 
   FlattenedPath() : mCachedLength(0), mCalculatedLength(false) {}
 
-  virtual void MoveTo(const Point &aPoint) override;
-  virtual void LineTo(const Point &aPoint) override;
-  virtual void BezierTo(const Point &aCP1, const Point &aCP2,
-                        const Point &aCP3) override;
-  virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
+  virtual void MoveTo(const Point& aPoint) override;
+  virtual void LineTo(const Point& aPoint) override;
+  virtual void BezierTo(const Point& aCP1, const Point& aCP2,
+                        const Point& aCP3) override;
+  virtual void QuadraticBezierTo(const Point& aCP1, const Point& aCP2) override;
   virtual void Close() override;
-  virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+  virtual void Arc(const Point& aOrigin, float aRadius, float aStartAngle,
                    float aEndAngle, bool aAntiClockwise = false) override;
 
   virtual Point CurrentPoint() const override {
@@ -40,7 +40,7 @@ class FlattenedPath : public PathSink {
   }
 
   Float ComputeLength();
-  Point ComputePointAtLength(Float aLength, Point *aTangent);
+  Point ComputePointAtLength(Float aLength, Point* aTangent);
 
  private:
   Float mCachedLength;
diff --git a/gfx/2d/PathCairo.cpp b/gfx/2d/PathCairo.cpp
index cbd46731291ad..1def9942be87a 100644
--- a/gfx/2d/PathCairo.cpp
+++ b/gfx/2d/PathCairo.cpp
@@ -16,7 +16,7 @@ namespace gfx {
 
 PathBuilderCairo::PathBuilderCairo(FillRule aFillRule) : mFillRule(aFillRule) {}
 
-void PathBuilderCairo::MoveTo(const Point &aPoint) {
+void PathBuilderCairo::MoveTo(const Point& aPoint) {
   cairo_path_data_t data;
   data.header.type = CAIRO_PATH_MOVE_TO;
   data.header.length = 2;
@@ -28,7 +28,7 @@ void PathBuilderCairo::MoveTo(const Point &aPoint) {
   mBeginPoint = mCurrentPoint = aPoint;
 }
 
-void PathBuilderCairo::LineTo(const Point &aPoint) {
+void PathBuilderCairo::LineTo(const Point& aPoint) {
   cairo_path_data_t data;
   data.header.type = CAIRO_PATH_LINE_TO;
   data.header.length = 2;
@@ -40,8 +40,8 @@ void PathBuilderCairo::LineTo(const Point &aPoint) {
   mCurrentPoint = aPoint;
 }
 
-void PathBuilderCairo::BezierTo(const Point &aCP1, const Point &aCP2,
-                                const Point &aCP3) {
+void PathBuilderCairo::BezierTo(const Point& aCP1, const Point& aCP2,
+                                const Point& aCP3) {
   cairo_path_data_t data;
   data.header.type = CAIRO_PATH_CURVE_TO;
   data.header.length = 4;
@@ -59,7 +59,7 @@ void PathBuilderCairo::BezierTo(const Point &aCP1, const Point &aCP2,
   mCurrentPoint = aCP3;
 }
 
-void PathBuilderCairo::QuadraticBezierTo(const Point &aCP1, const Point &aCP2) {
+void PathBuilderCairo::QuadraticBezierTo(const Point& aCP1, const Point& aCP2) {
   // We need to elevate the degree of this quadratic Bézier to cubic, so we're
   // going to add an intermediate control point, and recompute control point 1.
   // The first and last control points remain the same.
@@ -95,7 +95,7 @@ void PathBuilderCairo::Close() {
   mCurrentPoint = mBeginPoint;
 }
 
-void PathBuilderCairo::Arc(const Point &aOrigin, float aRadius,
+void PathBuilderCairo::Arc(const Point& aOrigin, float aRadius,
                            float aStartAngle, float aEndAngle,
                            bool aAntiClockwise) {
   ArcToBezier(this, aOrigin, Size(aRadius, aRadius), aStartAngle, aEndAngle,
@@ -109,17 +109,17 @@ already_AddRefed PathBuilderCairo::Finish() {
 }
 
 PathCairo::PathCairo(FillRule aFillRule,
-                     std::vector &aPathData,
-                     const Point &aCurrentPoint)
+                     std::vector& aPathData,
+                     const Point& aCurrentPoint)
     : mFillRule(aFillRule),
       mContainingContext(nullptr),
       mCurrentPoint(aCurrentPoint) {
   mPathData.swap(aPathData);
 }
 
-PathCairo::PathCairo(cairo_t *aContext)
+PathCairo::PathCairo(cairo_t* aContext)
     : mFillRule(FillRule::FILL_WINDING), mContainingContext(nullptr) {
-  cairo_path_t *path = cairo_copy_path(aContext);
+  cairo_path_t* path = cairo_copy_path(aContext);
 
   // XXX - mCurrentPoint is not properly set here, the same is true for the
   // D2D Path code, we never require current point when hitting this codepath
@@ -148,7 +148,7 @@ already_AddRefed PathCairo::CopyToBuilder(
 }
 
 already_AddRefed PathCairo::TransformedCopyToBuilder(
-    const Matrix &aTransform, FillRule aFillRule) const {
+    const Matrix& aTransform, FillRule aFillRule) const {
   RefPtr builder = new PathBuilderCairo(aFillRule);
 
   AppendPathToBuilder(builder, &aTransform);
@@ -157,8 +157,8 @@ already_AddRefed PathCairo::TransformedCopyToBuilder(
   return builder.forget();
 }
 
-bool PathCairo::ContainsPoint(const Point &aPoint,
-                              const Matrix &aTransform) const {
+bool PathCairo::ContainsPoint(const Point& aPoint,
+                              const Matrix& aTransform) const {
   Matrix inverse = aTransform;
   inverse.Invert();
   Point transformed = inverse.TransformPoint(aPoint);
@@ -168,9 +168,9 @@ bool PathCairo::ContainsPoint(const Point &aPoint,
   return cairo_in_fill(mContainingContext, transformed.x, transformed.y);
 }
 
-bool PathCairo::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                    const Point &aPoint,
-                                    const Matrix &aTransform) const {
+bool PathCairo::StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                                    const Point& aPoint,
+                                    const Matrix& aTransform) const {
   Matrix inverse = aTransform;
   inverse.Invert();
   Point transformed = inverse.TransformPoint(aPoint);
@@ -182,7 +182,7 @@ bool PathCairo::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
   return cairo_in_stroke(mContainingContext, transformed.x, transformed.y);
 }
 
-Rect PathCairo::GetBounds(const Matrix &aTransform) const {
+Rect PathCairo::GetBounds(const Matrix& aTransform) const {
   EnsureContainingContext(aTransform);
 
   double x1, y1, x2, y2;
@@ -192,8 +192,8 @@ Rect PathCairo::GetBounds(const Matrix &aTransform) const {
   return aTransform.TransformBounds(bounds);
 }
 
-Rect PathCairo::GetStrokedBounds(const StrokeOptions &aStrokeOptions,
-                                 const Matrix &aTransform) const {
+Rect PathCairo::GetStrokedBounds(const StrokeOptions& aStrokeOptions,
+                                 const Matrix& aTransform) const {
   EnsureContainingContext(aTransform);
 
   double x1, y1, x2, y2;
@@ -205,7 +205,7 @@ Rect PathCairo::GetStrokedBounds(const StrokeOptions &aStrokeOptions,
   return aTransform.TransformBounds(bounds);
 }
 
-void PathCairo::StreamToSink(PathSink *aSink) const {
+void PathCairo::StreamToSink(PathSink* aSink) const {
   for (size_t i = 0; i < mPathData.size(); i++) {
     switch (mPathData[i].header.type) {
       case CAIRO_PATH_MOVE_TO:
@@ -233,7 +233,7 @@ void PathCairo::StreamToSink(PathSink *aSink) const {
   }
 }
 
-void PathCairo::EnsureContainingContext(const Matrix &aTransform) const {
+void PathCairo::EnsureContainingContext(const Matrix& aTransform) const {
   if (mContainingContext) {
     if (mContainingTransform.ExactlyEquals(aTransform)) {
       return;
@@ -251,7 +251,7 @@ void PathCairo::EnsureContainingContext(const Matrix &aTransform) const {
   SetPathOnContext(mContainingContext);
 }
 
-void PathCairo::SetPathOnContext(cairo_t *aContext) const {
+void PathCairo::SetPathOnContext(cairo_t* aContext) const {
   // Needs the correct fill rule set.
   cairo_set_fill_rule(aContext, GfxFillRuleToCairoFillRule(mFillRule));
 
@@ -259,15 +259,15 @@ void PathCairo::SetPathOnContext(cairo_t *aContext) const {
 
   if (!mPathData.empty()) {
     cairo_path_t path;
-    path.data = const_cast(&mPathData.front());
+    path.data = const_cast(&mPathData.front());
     path.num_data = mPathData.size();
     path.status = CAIRO_STATUS_SUCCESS;
     cairo_append_path(aContext, &path);
   }
 }
 
-void PathCairo::AppendPathToBuilder(PathBuilderCairo *aBuilder,
-                                    const Matrix *aTransform) const {
+void PathCairo::AppendPathToBuilder(PathBuilderCairo* aBuilder,
+                                    const Matrix* aTransform) const {
   if (aTransform) {
     size_t i = 0;
     while (i < mPathData.size()) {
diff --git a/gfx/2d/PathCairo.h b/gfx/2d/PathCairo.h
index 24949dc334c58..6ed079d742adb 100644
--- a/gfx/2d/PathCairo.h
+++ b/gfx/2d/PathCairo.h
@@ -22,13 +22,13 @@ class PathBuilderCairo : public PathBuilder {
 
   explicit PathBuilderCairo(FillRule aFillRule);
 
-  void MoveTo(const Point &aPoint) override;
-  void LineTo(const Point &aPoint) override;
-  void BezierTo(const Point &aCP1, const Point &aCP2,
-                const Point &aCP3) override;
-  void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
+  void MoveTo(const Point& aPoint) override;
+  void LineTo(const Point& aPoint) override;
+  void BezierTo(const Point& aCP1, const Point& aCP2,
+                const Point& aCP3) override;
+  void QuadraticBezierTo(const Point& aCP1, const Point& aCP2) override;
   void Close() override;
-  void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+  void Arc(const Point& aOrigin, float aRadius, float aStartAngle,
            float aEndAngle, bool aAntiClockwise = false) override;
   Point CurrentPoint() const override;
   already_AddRefed Finish() override;
@@ -50,9 +50,9 @@ class PathCairo : public Path {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathCairo, override)
 
-  PathCairo(FillRule aFillRule, std::vector &aPathData,
-            const Point &aCurrentPoint);
-  explicit PathCairo(cairo_t *aContext);
+  PathCairo(FillRule aFillRule, std::vector& aPathData,
+            const Point& aCurrentPoint);
+  explicit PathCairo(cairo_t* aContext);
   virtual ~PathCairo();
 
   BackendType GetBackendType() const override { return BackendType::CAIRO; }
@@ -60,35 +60,35 @@ class PathCairo : public Path {
   already_AddRefed CopyToBuilder(
       FillRule aFillRule) const override;
   already_AddRefed TransformedCopyToBuilder(
-      const Matrix &aTransform, FillRule aFillRule) const override;
+      const Matrix& aTransform, FillRule aFillRule) const override;
 
-  bool ContainsPoint(const Point &aPoint,
-                     const Matrix &aTransform) const override;
+  bool ContainsPoint(const Point& aPoint,
+                     const Matrix& aTransform) const override;
 
-  bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                           const Point &aPoint,
-                           const Matrix &aTransform) const override;
+  bool StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                           const Point& aPoint,
+                           const Matrix& aTransform) const override;
 
-  Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
+  Rect GetBounds(const Matrix& aTransform = Matrix()) const override;
 
-  Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
-                        const Matrix &aTransform = Matrix()) const override;
+  Rect GetStrokedBounds(const StrokeOptions& aStrokeOptions,
+                        const Matrix& aTransform = Matrix()) const override;
 
-  void StreamToSink(PathSink *aSink) const override;
+  void StreamToSink(PathSink* aSink) const override;
 
   FillRule GetFillRule() const override { return mFillRule; }
 
-  void SetPathOnContext(cairo_t *aContext) const;
+  void SetPathOnContext(cairo_t* aContext) const;
 
-  void AppendPathToBuilder(PathBuilderCairo *aBuilder,
-                           const Matrix *aTransform = nullptr) const;
+  void AppendPathToBuilder(PathBuilderCairo* aBuilder,
+                           const Matrix* aTransform = nullptr) const;
 
  private:
-  void EnsureContainingContext(const Matrix &aTransform) const;
+  void EnsureContainingContext(const Matrix& aTransform) const;
 
   FillRule mFillRule;
   std::vector mPathData;
-  mutable cairo_t *mContainingContext;
+  mutable cairo_t* mContainingContext;
   mutable Matrix mContainingTransform;
   Point mCurrentPoint;
 };
diff --git a/gfx/2d/PathCapture.cpp b/gfx/2d/PathCapture.cpp
index bc2b67365a2df..b3aa0e0d23407 100644
--- a/gfx/2d/PathCapture.cpp
+++ b/gfx/2d/PathCapture.cpp
@@ -11,7 +11,7 @@ namespace gfx {
 
 using namespace std;
 
-void PathBuilderCapture::MoveTo(const Point &aPoint) {
+void PathBuilderCapture::MoveTo(const Point& aPoint) {
   PathOp op;
   op.mType = PathOp::OP_MOVETO;
   op.mP1 = aPoint;
@@ -19,7 +19,7 @@ void PathBuilderCapture::MoveTo(const Point &aPoint) {
   mCurrentPoint = aPoint;
 }
 
-void PathBuilderCapture::LineTo(const Point &aPoint) {
+void PathBuilderCapture::LineTo(const Point& aPoint) {
   PathOp op;
   op.mType = PathOp::OP_LINETO;
   op.mP1 = aPoint;
@@ -27,8 +27,8 @@ void PathBuilderCapture::LineTo(const Point &aPoint) {
   mCurrentPoint = aPoint;
 }
 
-void PathBuilderCapture::BezierTo(const Point &aCP1, const Point &aCP2,
-                                  const Point &aCP3) {
+void PathBuilderCapture::BezierTo(const Point& aCP1, const Point& aCP2,
+                                  const Point& aCP3) {
   PathOp op;
   op.mType = PathOp::OP_BEZIERTO;
   op.mP1 = aCP1;
@@ -38,8 +38,8 @@ void PathBuilderCapture::BezierTo(const Point &aCP1, const Point &aCP2,
   mCurrentPoint = aCP3;
 }
 
-void PathBuilderCapture::QuadraticBezierTo(const Point &aCP1,
-                                           const Point &aCP2) {
+void PathBuilderCapture::QuadraticBezierTo(const Point& aCP1,
+                                           const Point& aCP2) {
   PathOp op;
   op.mType = PathOp::OP_QUADRATICBEZIERTO;
   op.mP1 = aCP1;
@@ -48,7 +48,7 @@ void PathBuilderCapture::QuadraticBezierTo(const Point &aCP1,
   mCurrentPoint = aCP2;
 }
 
-void PathBuilderCapture::Arc(const Point &aOrigin, float aRadius,
+void PathBuilderCapture::Arc(const Point& aOrigin, float aRadius,
                              float aStartAngle, float aEndAngle,
                              bool aAntiClockwise) {
   PathOp op;
@@ -83,7 +83,7 @@ already_AddRefed PathCapture::CopyToBuilder(
 }
 
 already_AddRefed PathCapture::TransformedCopyToBuilder(
-    const Matrix &aTransform, FillRule aFillRule) const {
+    const Matrix& aTransform, FillRule aFillRule) const {
   RefPtr capture = new PathBuilderCapture(aFillRule, mDT);
   typedef std::vector pathOpVec;
   for (pathOpVec::const_iterator iter = mPathOps.begin();
@@ -92,9 +92,9 @@ already_AddRefed PathCapture::TransformedCopyToBuilder(
     newPathOp.mType = iter->mType;
     if (newPathOp.mType == PathOp::OpType::OP_ARC) {
       struct ArcTransformer {
-        ArcTransformer(pathOpVec &aVector, const Matrix &aTransform)
+        ArcTransformer(pathOpVec& aVector, const Matrix& aTransform)
             : mVector(&aVector), mTransform(&aTransform) {}
-        void BezierTo(const Point &aCP1, const Point &aCP2, const Point &aCP3) {
+        void BezierTo(const Point& aCP1, const Point& aCP2, const Point& aCP3) {
           PathOp newPathOp;
           newPathOp.mType = PathOp::OP_BEZIERTO;
           newPathOp.mP1 = mTransform->TransformPoint(aCP1);
@@ -102,14 +102,14 @@ already_AddRefed PathCapture::TransformedCopyToBuilder(
           newPathOp.mP3 = mTransform->TransformPoint(aCP3);
           mVector->push_back(newPathOp);
         }
-        void LineTo(const Point &aPoint) {
+        void LineTo(const Point& aPoint) {
           PathOp newPathOp;
           newPathOp.mType = PathOp::OP_LINETO;
           newPathOp.mP1 = mTransform->TransformPoint(aPoint);
           mVector->push_back(newPathOp);
         }
-        pathOpVec *mVector;
-        const Matrix *mTransform;
+        pathOpVec* mVector;
+        const Matrix* mTransform;
       };
 
       ArcTransformer arcTransformer(capture->mPathOps, aTransform);
@@ -132,40 +132,40 @@ already_AddRefed PathCapture::TransformedCopyToBuilder(
   capture->mCurrentPoint = aTransform.TransformPoint(mCurrentPoint);
   return capture.forget();
 }
-bool PathCapture::ContainsPoint(const Point &aPoint,
-                                const Matrix &aTransform) const {
+bool PathCapture::ContainsPoint(const Point& aPoint,
+                                const Matrix& aTransform) const {
   if (!EnsureRealizedPath()) {
     return false;
   }
   return mRealizedPath->ContainsPoint(aPoint, aTransform);
 }
 
-bool PathCapture::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                      const Point &aPoint,
-                                      const Matrix &aTransform) const {
+bool PathCapture::StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                                      const Point& aPoint,
+                                      const Matrix& aTransform) const {
   if (!EnsureRealizedPath()) {
     return false;
   }
   return mRealizedPath->StrokeContainsPoint(aStrokeOptions, aPoint, aTransform);
 }
 
-Rect PathCapture::GetBounds(const Matrix &aTransform) const {
+Rect PathCapture::GetBounds(const Matrix& aTransform) const {
   if (!EnsureRealizedPath()) {
     return Rect();
   }
   return mRealizedPath->GetBounds(aTransform);
 }
 
-Rect PathCapture::GetStrokedBounds(const StrokeOptions &aStrokeOptions,
-                                   const Matrix &aTransform) const {
+Rect PathCapture::GetStrokedBounds(const StrokeOptions& aStrokeOptions,
+                                   const Matrix& aTransform) const {
   if (!EnsureRealizedPath()) {
     return Rect();
   }
   return mRealizedPath->GetStrokedBounds(aStrokeOptions, aTransform);
 }
 
-void PathCapture::StreamToSink(PathSink *aSink) const {
-  for (const PathOp &op : mPathOps) {
+void PathCapture::StreamToSink(PathSink* aSink) const {
+  for (const PathOp& op : mPathOps) {
     switch (op.mType) {
       case PathOp::OP_MOVETO:
         aSink->MoveTo(op.mP1);
@@ -200,7 +200,7 @@ bool PathCapture::EnsureRealizedPath() const {
   return true;
 }
 
-Path *PathCapture::GetRealizedPath() const {
+Path* PathCapture::GetRealizedPath() const {
   if (!EnsureRealizedPath()) {
     return nullptr;
   }
diff --git a/gfx/2d/PathCapture.h b/gfx/2d/PathCapture.h
index 51e0beae0fff8..4fa4c14700073 100644
--- a/gfx/2d/PathCapture.h
+++ b/gfx/2d/PathCapture.h
@@ -22,23 +22,23 @@ class PathBuilderCapture : public PathBuilder {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderCapture, override)
 
-  PathBuilderCapture(FillRule aFillRule, DrawTarget *aDT)
+  PathBuilderCapture(FillRule aFillRule, DrawTarget* aDT)
       : mFillRule(aFillRule), mDT(aDT) {}
 
   /* Move the current point in the path, any figure currently being drawn will
    * be considered closed during fill operations, however when stroking the
    * closing line segment will not be drawn.
    */
-  virtual void MoveTo(const Point &aPoint) override;
+  virtual void MoveTo(const Point& aPoint) override;
   /* Add a linesegment to the current figure */
-  virtual void LineTo(const Point &aPoint) override;
+  virtual void LineTo(const Point& aPoint) override;
   /* Add a cubic bezier curve to the current figure */
-  virtual void BezierTo(const Point &aCP1, const Point &aCP2,
-                        const Point &aCP3) override;
+  virtual void BezierTo(const Point& aCP1, const Point& aCP2,
+                        const Point& aCP3) override;
   /* Add a quadratic bezier curve to the current figure */
-  virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
+  virtual void QuadraticBezierTo(const Point& aCP1, const Point& aCP2) override;
   /* Add an arc to the current figure */
-  virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+  virtual void Arc(const Point& aOrigin, float aRadius, float aStartAngle,
                    float aEndAngle, bool aAntiClockwise) override;
   /* Close the current figure, this will essentially generate a line segment
    * from the current point to the starting point for the current figure
@@ -70,7 +70,7 @@ class PathCapture : public Path {
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathCapture, override)
 
   PathCapture(const std::vector aOps, FillRule aFillRule,
-              DrawTarget *aDT, const Point &aCurrentPoint)
+              DrawTarget* aDT, const Point& aCurrentPoint)
       : mPathOps(aOps),
         mFillRule(aFillRule),
         mDT(aDT),
@@ -82,24 +82,24 @@ class PathCapture : public Path {
   virtual already_AddRefed CopyToBuilder(
       FillRule aFillRule) const override;
   virtual already_AddRefed TransformedCopyToBuilder(
-      const Matrix &aTransform, FillRule aFillRule) const override;
-  virtual bool ContainsPoint(const Point &aPoint,
-                             const Matrix &aTransform) const override;
-  virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                   const Point &aPoint,
-                                   const Matrix &aTransform) const override;
+      const Matrix& aTransform, FillRule aFillRule) const override;
+  virtual bool ContainsPoint(const Point& aPoint,
+                             const Matrix& aTransform) const override;
+  virtual bool StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                                   const Point& aPoint,
+                                   const Matrix& aTransform) const override;
 
-  virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
+  virtual Rect GetBounds(const Matrix& aTransform = Matrix()) const override;
 
   virtual Rect GetStrokedBounds(
-      const StrokeOptions &aStrokeOptions,
-      const Matrix &aTransform = Matrix()) const override;
+      const StrokeOptions& aStrokeOptions,
+      const Matrix& aTransform = Matrix()) const override;
 
-  virtual void StreamToSink(PathSink *aSink) const override;
+  virtual void StreamToSink(PathSink* aSink) const override;
 
   virtual FillRule GetFillRule() const override { return mFillRule; }
 
-  Path *GetRealizedPath() const;
+  Path* GetRealizedPath() const;
 
  private:
   bool EnsureRealizedPath() const;
diff --git a/gfx/2d/PathD2D.cpp b/gfx/2d/PathD2D.cpp
index 0b0e4e2a83bc2..7f657c6db2e5c 100644
--- a/gfx/2d/PathD2D.cpp
+++ b/gfx/2d/PathD2D.cpp
@@ -19,19 +19,19 @@ namespace gfx {
 // continued.
 class OpeningGeometrySink : public ID2D1SimplifiedGeometrySink {
  public:
-  explicit OpeningGeometrySink(ID2D1SimplifiedGeometrySink *aSink)
+  explicit OpeningGeometrySink(ID2D1SimplifiedGeometrySink* aSink)
       : mSink(aSink), mNeedsFigureEnded(false) {}
 
-  HRESULT STDMETHODCALLTYPE QueryInterface(const IID &aIID, void **aPtr) {
+  HRESULT STDMETHODCALLTYPE QueryInterface(const IID& aIID, void** aPtr) {
     if (!aPtr) {
       return E_POINTER;
     }
 
     if (aIID == IID_IUnknown) {
-      *aPtr = static_cast(this);
+      *aPtr = static_cast(this);
       return S_OK;
     } else if (aIID == IID_ID2D1SimplifiedGeometrySink) {
-      *aPtr = static_cast(this);
+      *aPtr = static_cast(this);
       return S_OK;
     }
 
@@ -52,12 +52,12 @@ class OpeningGeometrySink : public ID2D1SimplifiedGeometrySink {
     EnsureFigureEnded();
     return mSink->BeginFigure(aPoint, aBegin);
   }
-  STDMETHOD_(void, AddLines)(const D2D1_POINT_2F *aLines, UINT aCount) {
+  STDMETHOD_(void, AddLines)(const D2D1_POINT_2F* aLines, UINT aCount) {
     EnsureFigureEnded();
     return mSink->AddLines(aLines, aCount);
   }
   STDMETHOD_(void, AddBeziers)
-  (const D2D1_BEZIER_SEGMENT *aSegments, UINT aCount) {
+  (const D2D1_BEZIER_SEGMENT* aSegments, UINT aCount) {
     EnsureFigureEnded();
     return mSink->AddBeziers(aSegments, aCount);
   }
@@ -87,13 +87,13 @@ class OpeningGeometrySink : public ID2D1SimplifiedGeometrySink {
     }
   }
 
-  ID2D1SimplifiedGeometrySink *mSink;
+  ID2D1SimplifiedGeometrySink* mSink;
   bool mNeedsFigureEnded;
 };
 
 PathBuilderD2D::~PathBuilderD2D() {}
 
-void PathBuilderD2D::MoveTo(const Point &aPoint) {
+void PathBuilderD2D::MoveTo(const Point& aPoint) {
   if (mFigureActive) {
     mSink->EndFigure(D2D1_FIGURE_END_OPEN);
     mFigureActive = false;
@@ -102,15 +102,15 @@ void PathBuilderD2D::MoveTo(const Point &aPoint) {
   mCurrentPoint = aPoint;
 }
 
-void PathBuilderD2D::LineTo(const Point &aPoint) {
+void PathBuilderD2D::LineTo(const Point& aPoint) {
   EnsureActive(aPoint);
   mSink->AddLine(D2DPoint(aPoint));
 
   mCurrentPoint = aPoint;
 }
 
-void PathBuilderD2D::BezierTo(const Point &aCP1, const Point &aCP2,
-                              const Point &aCP3) {
+void PathBuilderD2D::BezierTo(const Point& aCP1, const Point& aCP2,
+                              const Point& aCP3) {
   EnsureActive(aCP1);
   mSink->AddBezier(
       D2D1::BezierSegment(D2DPoint(aCP1), D2DPoint(aCP2), D2DPoint(aCP3)));
@@ -118,7 +118,7 @@ void PathBuilderD2D::BezierTo(const Point &aCP1, const Point &aCP2,
   mCurrentPoint = aCP3;
 }
 
-void PathBuilderD2D::QuadraticBezierTo(const Point &aCP1, const Point &aCP2) {
+void PathBuilderD2D::QuadraticBezierTo(const Point& aCP1, const Point& aCP2) {
   EnsureActive(aCP1);
   mSink->AddQuadraticBezier(
       D2D1::QuadraticBezierSegment(D2DPoint(aCP1), D2DPoint(aCP2)));
@@ -136,7 +136,7 @@ void PathBuilderD2D::Close() {
   }
 }
 
-void PathBuilderD2D::Arc(const Point &aOrigin, Float aRadius, Float aStartAngle,
+void PathBuilderD2D::Arc(const Point& aOrigin, Float aRadius, Float aStartAngle,
                          Float aEndAngle, bool aAntiClockwise) {
   MOZ_ASSERT(aRadius >= 0);
 
@@ -225,7 +225,7 @@ void PathBuilderD2D::Arc(const Point &aOrigin, Float aRadius, Float aStartAngle,
 
 Point PathBuilderD2D::CurrentPoint() const { return mCurrentPoint; }
 
-void PathBuilderD2D::EnsureActive(const Point &aPoint) {
+void PathBuilderD2D::EnsureActive(const Point& aPoint) {
   if (!mFigureActive) {
     mSink->BeginFigure(D2DPoint(aPoint), D2D1_FIGURE_BEGIN_FILLED);
     mBeginPoint = aPoint;
@@ -253,7 +253,7 @@ already_AddRefed PathD2D::CopyToBuilder(FillRule aFillRule) const {
 }
 
 already_AddRefed PathD2D::TransformedCopyToBuilder(
-    const Matrix &aTransform, FillRule aFillRule) const {
+    const Matrix& aTransform, FillRule aFillRule) const {
   RefPtr path;
   HRESULT hr =
       DrawTargetD2D1::factory()->CreatePathGeometry(getter_AddRefs(path));
@@ -302,7 +302,7 @@ already_AddRefed PathD2D::TransformedCopyToBuilder(
   return pathBuilder.forget();
 }
 
-void PathD2D::StreamToSink(PathSink *aSink) const {
+void PathD2D::StreamToSink(PathSink* aSink) const {
   HRESULT hr;
 
   StreamingGeometrySink sink(aSink);
@@ -316,8 +316,8 @@ void PathD2D::StreamToSink(PathSink *aSink) const {
   }
 }
 
-bool PathD2D::ContainsPoint(const Point &aPoint,
-                            const Matrix &aTransform) const {
+bool PathD2D::ContainsPoint(const Point& aPoint,
+                            const Matrix& aTransform) const {
   BOOL result;
 
   HRESULT hr = mGeometry->FillContainsPoint(
@@ -331,9 +331,9 @@ bool PathD2D::ContainsPoint(const Point &aPoint,
   return !!result;
 }
 
-bool PathD2D::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                  const Point &aPoint,
-                                  const Matrix &aTransform) const {
+bool PathD2D::StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                                  const Point& aPoint,
+                                  const Matrix& aTransform) const {
   BOOL result;
 
   RefPtr strokeStyle =
@@ -350,7 +350,7 @@ bool PathD2D::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
   return !!result;
 }
 
-Rect PathD2D::GetBounds(const Matrix &aTransform) const {
+Rect PathD2D::GetBounds(const Matrix& aTransform) const {
   D2D1_RECT_F d2dBounds;
 
   HRESULT hr = mGeometry->GetBounds(D2DMatrix(aTransform), &d2dBounds);
@@ -364,8 +364,8 @@ Rect PathD2D::GetBounds(const Matrix &aTransform) const {
   return bounds;
 }
 
-Rect PathD2D::GetStrokedBounds(const StrokeOptions &aStrokeOptions,
-                               const Matrix &aTransform) const {
+Rect PathD2D::GetStrokedBounds(const StrokeOptions& aStrokeOptions,
+                               const Matrix& aTransform) const {
   D2D1_RECT_F d2dBounds;
 
   RefPtr strokeStyle =
diff --git a/gfx/2d/PathD2D.h b/gfx/2d/PathD2D.h
index 569b8323985de..1423e27a8e027 100644
--- a/gfx/2d/PathD2D.h
+++ b/gfx/2d/PathD2D.h
@@ -19,7 +19,7 @@ class PathD2D;
 class PathBuilderD2D : public PathBuilder {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderD2D, override)
-  PathBuilderD2D(ID2D1GeometrySink *aSink, ID2D1PathGeometry *aGeom,
+  PathBuilderD2D(ID2D1GeometrySink* aSink, ID2D1PathGeometry* aGeom,
                  FillRule aFillRule, BackendType aBackendType)
       : mSink(aSink),
         mGeometry(aGeom),
@@ -28,13 +28,13 @@ class PathBuilderD2D : public PathBuilder {
         mBackendType(aBackendType) {}
   virtual ~PathBuilderD2D();
 
-  virtual void MoveTo(const Point &aPoint);
-  virtual void LineTo(const Point &aPoint);
-  virtual void BezierTo(const Point &aCP1, const Point &aCP2,
-                        const Point &aCP3);
-  virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2);
+  virtual void MoveTo(const Point& aPoint);
+  virtual void LineTo(const Point& aPoint);
+  virtual void BezierTo(const Point& aCP1, const Point& aCP2,
+                        const Point& aCP3);
+  virtual void QuadraticBezierTo(const Point& aCP1, const Point& aCP2);
   virtual void Close();
-  virtual void Arc(const Point &aOrigin, Float aRadius, Float aStartAngle,
+  virtual void Arc(const Point& aOrigin, Float aRadius, Float aStartAngle,
                    Float aEndAngle, bool aAntiClockwise = false);
   virtual Point CurrentPoint() const;
 
@@ -42,14 +42,14 @@ class PathBuilderD2D : public PathBuilder {
 
   virtual BackendType GetBackendType() const { return mBackendType; }
 
-  ID2D1GeometrySink *GetSink() { return mSink; }
+  ID2D1GeometrySink* GetSink() { return mSink; }
 
   bool IsFigureActive() const { return mFigureActive; }
 
  private:
   friend class PathD2D;
 
-  void EnsureActive(const Point &aPoint);
+  void EnsureActive(const Point& aPoint);
 
   RefPtr mSink;
   RefPtr mGeometry;
@@ -64,8 +64,8 @@ class PathBuilderD2D : public PathBuilder {
 class PathD2D : public Path {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathD2D, override)
-  PathD2D(ID2D1PathGeometry *aGeometry, bool aEndedActive,
-          const Point &aEndPoint, FillRule aFillRule, BackendType aBackendType)
+  PathD2D(ID2D1PathGeometry* aGeometry, bool aEndedActive,
+          const Point& aEndPoint, FillRule aFillRule, BackendType aBackendType)
       : mGeometry(aGeometry),
         mEndedActive(aEndedActive),
         mEndPoint(aEndPoint),
@@ -76,25 +76,25 @@ class PathD2D : public Path {
 
   virtual already_AddRefed CopyToBuilder(FillRule aFillRule) const;
   virtual already_AddRefed TransformedCopyToBuilder(
-      const Matrix &aTransform, FillRule aFillRule) const;
+      const Matrix& aTransform, FillRule aFillRule) const;
 
-  virtual bool ContainsPoint(const Point &aPoint,
-                             const Matrix &aTransform) const;
+  virtual bool ContainsPoint(const Point& aPoint,
+                             const Matrix& aTransform) const;
 
-  virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                   const Point &aPoint,
-                                   const Matrix &aTransform) const;
+  virtual bool StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                                   const Point& aPoint,
+                                   const Matrix& aTransform) const;
 
-  virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const;
+  virtual Rect GetBounds(const Matrix& aTransform = Matrix()) const;
 
-  virtual Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
-                                const Matrix &aTransform = Matrix()) const;
+  virtual Rect GetStrokedBounds(const StrokeOptions& aStrokeOptions,
+                                const Matrix& aTransform = Matrix()) const;
 
-  virtual void StreamToSink(PathSink *aSink) const;
+  virtual void StreamToSink(PathSink* aSink) const;
 
   virtual FillRule GetFillRule() const { return mFillRule; }
 
-  ID2D1Geometry *GetGeometry() { return mGeometry; }
+  ID2D1Geometry* GetGeometry() { return mGeometry; }
 
  private:
   friend class DrawTargetD2D;
diff --git a/gfx/2d/PathRecording.cpp b/gfx/2d/PathRecording.cpp
index 3670ae7648d57..005add1144293 100644
--- a/gfx/2d/PathRecording.cpp
+++ b/gfx/2d/PathRecording.cpp
@@ -13,7 +13,7 @@ namespace gfx {
 
 using namespace std;
 
-void PathBuilderRecording::MoveTo(const Point &aPoint) {
+void PathBuilderRecording::MoveTo(const Point& aPoint) {
   PathOp op;
   op.mType = PathOp::OP_MOVETO;
   op.mP1 = aPoint;
@@ -21,7 +21,7 @@ void PathBuilderRecording::MoveTo(const Point &aPoint) {
   mPathBuilder->MoveTo(aPoint);
 }
 
-void PathBuilderRecording::LineTo(const Point &aPoint) {
+void PathBuilderRecording::LineTo(const Point& aPoint) {
   PathOp op;
   op.mType = PathOp::OP_LINETO;
   op.mP1 = aPoint;
@@ -29,8 +29,8 @@ void PathBuilderRecording::LineTo(const Point &aPoint) {
   mPathBuilder->LineTo(aPoint);
 }
 
-void PathBuilderRecording::BezierTo(const Point &aCP1, const Point &aCP2,
-                                    const Point &aCP3) {
+void PathBuilderRecording::BezierTo(const Point& aCP1, const Point& aCP2,
+                                    const Point& aCP3) {
   PathOp op;
   op.mType = PathOp::OP_BEZIERTO;
   op.mP1 = aCP1;
@@ -40,8 +40,8 @@ void PathBuilderRecording::BezierTo(const Point &aCP1, const Point &aCP2,
   mPathBuilder->BezierTo(aCP1, aCP2, aCP3);
 }
 
-void PathBuilderRecording::QuadraticBezierTo(const Point &aCP1,
-                                             const Point &aCP2) {
+void PathBuilderRecording::QuadraticBezierTo(const Point& aCP1,
+                                             const Point& aCP2) {
   PathOp op;
   op.mType = PathOp::OP_QUADRATICBEZIERTO;
   op.mP1 = aCP1;
@@ -83,7 +83,7 @@ already_AddRefed PathRecording::CopyToBuilder(
 }
 
 already_AddRefed PathRecording::TransformedCopyToBuilder(
-    const Matrix &aTransform, FillRule aFillRule) const {
+    const Matrix& aTransform, FillRule aFillRule) const {
   RefPtr pathBuilder =
       mPath->TransformedCopyToBuilder(aTransform, aFillRule);
   RefPtr recording =
diff --git a/gfx/2d/PathRecording.h b/gfx/2d/PathRecording.h
index 7a9007f33263e..fea2a144a7cce 100644
--- a/gfx/2d/PathRecording.h
+++ b/gfx/2d/PathRecording.h
@@ -23,28 +23,28 @@ class PathBuilderRecording : public PathBuilder {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderRecording, override)
 
-  PathBuilderRecording(PathBuilder *aBuilder, FillRule aFillRule)
+  PathBuilderRecording(PathBuilder* aBuilder, FillRule aFillRule)
       : mPathBuilder(aBuilder), mFillRule(aFillRule) {}
 
   /* Move the current point in the path, any figure currently being drawn will
    * be considered closed during fill operations, however when stroking the
    * closing line segment will not be drawn.
    */
-  virtual void MoveTo(const Point &aPoint) override;
+  virtual void MoveTo(const Point& aPoint) override;
   /* Add a linesegment to the current figure */
-  virtual void LineTo(const Point &aPoint) override;
+  virtual void LineTo(const Point& aPoint) override;
   /* Add a cubic bezier curve to the current figure */
-  virtual void BezierTo(const Point &aCP1, const Point &aCP2,
-                        const Point &aCP3) override;
+  virtual void BezierTo(const Point& aCP1, const Point& aCP2,
+                        const Point& aCP3) override;
   /* Add a quadratic bezier curve to the current figure */
-  virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
+  virtual void QuadraticBezierTo(const Point& aCP1, const Point& aCP2) override;
   /* Close the current figure, this will essentially generate a line segment
    * from the current point to the starting point for the current figure
    */
   virtual void Close() override;
 
   /* Add an arc to the current figure */
-  virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+  virtual void Arc(const Point& aOrigin, float aRadius, float aStartAngle,
                    float aEndAngle, bool aAntiClockwise) override {
     ArcToBezier(this, aOrigin, Size(aRadius, aRadius), aStartAngle, aEndAngle,
                 aAntiClockwise);
@@ -73,7 +73,7 @@ class PathRecording : public Path {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathRecording, override)
 
-  PathRecording(Path *aPath, const std::vector aOps, FillRule aFillRule)
+  PathRecording(Path* aPath, const std::vector aOps, FillRule aFillRule)
       : mPath(aPath), mPathOps(aOps), mFillRule(aFillRule) {}
 
   ~PathRecording();
@@ -84,35 +84,35 @@ class PathRecording : public Path {
   virtual already_AddRefed CopyToBuilder(
       FillRule aFillRule) const override;
   virtual already_AddRefed TransformedCopyToBuilder(
-      const Matrix &aTransform, FillRule aFillRule) const override;
-  virtual bool ContainsPoint(const Point &aPoint,
-                             const Matrix &aTransform) const override {
+      const Matrix& aTransform, FillRule aFillRule) const override;
+  virtual bool ContainsPoint(const Point& aPoint,
+                             const Matrix& aTransform) const override {
     return mPath->ContainsPoint(aPoint, aTransform);
   }
-  virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                   const Point &aPoint,
-                                   const Matrix &aTransform) const override {
+  virtual bool StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                                   const Point& aPoint,
+                                   const Matrix& aTransform) const override {
     return mPath->StrokeContainsPoint(aStrokeOptions, aPoint, aTransform);
   }
 
-  virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const override {
+  virtual Rect GetBounds(const Matrix& aTransform = Matrix()) const override {
     return mPath->GetBounds(aTransform);
   }
 
   virtual Rect GetStrokedBounds(
-      const StrokeOptions &aStrokeOptions,
-      const Matrix &aTransform = Matrix()) const override {
+      const StrokeOptions& aStrokeOptions,
+      const Matrix& aTransform = Matrix()) const override {
     return mPath->GetStrokedBounds(aStrokeOptions, aTransform);
   }
 
-  virtual void StreamToSink(PathSink *aSink) const override {
+  virtual void StreamToSink(PathSink* aSink) const override {
     mPath->StreamToSink(aSink);
   }
 
   virtual FillRule GetFillRule() const override { return mFillRule; }
 
-  void StorePath(std::ostream &aStream) const;
-  static void ReadPathToBuilder(std::istream &aStream, PathBuilder *aBuilder);
+  void StorePath(std::ostream& aStream) const;
+  static void ReadPathToBuilder(std::istream& aStream, PathBuilder* aBuilder);
 
  private:
   friend class DrawTargetWrapAndRecord;
diff --git a/gfx/2d/PathSkia.cpp b/gfx/2d/PathSkia.cpp
index 260af08e27d12..fddede8571bb3 100644
--- a/gfx/2d/PathSkia.cpp
+++ b/gfx/2d/PathSkia.cpp
@@ -14,7 +14,7 @@
 namespace mozilla {
 namespace gfx {
 
-PathBuilderSkia::PathBuilderSkia(const Matrix &aTransform, const SkPath &aPath,
+PathBuilderSkia::PathBuilderSkia(const Matrix& aTransform, const SkPath& aPath,
                                  FillRule aFillRule)
     : mPath(aPath) {
   SkMatrix matrix;
@@ -34,11 +34,11 @@ void PathBuilderSkia::SetFillRule(FillRule aFillRule) {
   }
 }
 
-void PathBuilderSkia::MoveTo(const Point &aPoint) {
+void PathBuilderSkia::MoveTo(const Point& aPoint) {
   mPath.moveTo(SkFloatToScalar(aPoint.x), SkFloatToScalar(aPoint.y));
 }
 
-void PathBuilderSkia::LineTo(const Point &aPoint) {
+void PathBuilderSkia::LineTo(const Point& aPoint) {
   if (!mPath.countPoints()) {
     MoveTo(aPoint);
   } else {
@@ -46,8 +46,8 @@ void PathBuilderSkia::LineTo(const Point &aPoint) {
   }
 }
 
-void PathBuilderSkia::BezierTo(const Point &aCP1, const Point &aCP2,
-                               const Point &aCP3) {
+void PathBuilderSkia::BezierTo(const Point& aCP1, const Point& aCP2,
+                               const Point& aCP3) {
   if (!mPath.countPoints()) {
     MoveTo(aCP1);
   }
@@ -56,7 +56,7 @@ void PathBuilderSkia::BezierTo(const Point &aCP1, const Point &aCP2,
                 SkFloatToScalar(aCP3.x), SkFloatToScalar(aCP3.y));
 }
 
-void PathBuilderSkia::QuadraticBezierTo(const Point &aCP1, const Point &aCP2) {
+void PathBuilderSkia::QuadraticBezierTo(const Point& aCP1, const Point& aCP2) {
   if (!mPath.countPoints()) {
     MoveTo(aCP1);
   }
@@ -66,7 +66,7 @@ void PathBuilderSkia::QuadraticBezierTo(const Point &aCP1, const Point &aCP2) {
 
 void PathBuilderSkia::Close() { mPath.close(); }
 
-void PathBuilderSkia::Arc(const Point &aOrigin, float aRadius,
+void PathBuilderSkia::Arc(const Point& aOrigin, float aRadius,
                           float aStartAngle, float aEndAngle,
                           bool aAntiClockwise) {
   ArcToBezier(this, aOrigin, Size(aRadius, aRadius), aStartAngle, aEndAngle,
@@ -86,7 +86,7 @@ already_AddRefed PathBuilderSkia::Finish() {
   return MakeAndAddRef(mPath, mFillRule);
 }
 
-void PathBuilderSkia::AppendPath(const SkPath &aPath) { mPath.addPath(aPath); }
+void PathBuilderSkia::AppendPath(const SkPath& aPath) { mPath.addPath(aPath); }
 
 already_AddRefed PathSkia::CopyToBuilder(
     FillRule aFillRule) const {
@@ -94,12 +94,12 @@ already_AddRefed PathSkia::CopyToBuilder(
 }
 
 already_AddRefed PathSkia::TransformedCopyToBuilder(
-    const Matrix &aTransform, FillRule aFillRule) const {
+    const Matrix& aTransform, FillRule aFillRule) const {
   return MakeAndAddRef(aTransform, mPath, aFillRule);
 }
 
-static bool SkPathContainsPoint(const SkPath &aPath, const Point &aPoint,
-                                const Matrix &aTransform) {
+static bool SkPathContainsPoint(const SkPath& aPath, const Point& aPoint,
+                                const Matrix& aTransform) {
   Matrix inverse = aTransform;
   if (!inverse.Invert()) {
     return false;
@@ -109,8 +109,8 @@ static bool SkPathContainsPoint(const SkPath &aPath, const Point &aPoint,
   return aPath.contains(point.fX, point.fY);
 }
 
-bool PathSkia::ContainsPoint(const Point &aPoint,
-                             const Matrix &aTransform) const {
+bool PathSkia::ContainsPoint(const Point& aPoint,
+                             const Matrix& aTransform) const {
   if (!mPath.isFinite()) {
     return false;
   }
@@ -118,9 +118,9 @@ bool PathSkia::ContainsPoint(const Point &aPoint,
   return SkPathContainsPoint(mPath, aPoint, aTransform);
 }
 
-bool PathSkia::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                   const Point &aPoint,
-                                   const Matrix &aTransform) const {
+bool PathSkia::StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                                   const Point& aPoint,
+                                   const Matrix& aTransform) const {
   if (!mPath.isFinite()) {
     return false;
   }
@@ -136,7 +136,7 @@ bool PathSkia::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
   return SkPathContainsPoint(strokePath, aPoint, aTransform);
 }
 
-Rect PathSkia::GetBounds(const Matrix &aTransform) const {
+Rect PathSkia::GetBounds(const Matrix& aTransform) const {
   if (!mPath.isFinite()) {
     return Rect();
   }
@@ -145,8 +145,8 @@ Rect PathSkia::GetBounds(const Matrix &aTransform) const {
   return aTransform.TransformBounds(bounds);
 }
 
-Rect PathSkia::GetStrokedBounds(const StrokeOptions &aStrokeOptions,
-                                const Matrix &aTransform) const {
+Rect PathSkia::GetStrokedBounds(const StrokeOptions& aStrokeOptions,
+                                const Matrix& aTransform) const {
   if (!mPath.isFinite()) {
     return Rect();
   }
@@ -163,7 +163,7 @@ Rect PathSkia::GetStrokedBounds(const StrokeOptions &aStrokeOptions,
   return aTransform.TransformBounds(bounds);
 }
 
-void PathSkia::StreamToSink(PathSink *aSink) const {
+void PathSkia::StreamToSink(PathSink* aSink) const {
   SkPath::RawIter iter(mPath);
 
   SkPoint points[4];
diff --git a/gfx/2d/PathSkia.h b/gfx/2d/PathSkia.h
index d0efe6fbb5817..36586f91f9f5a 100644
--- a/gfx/2d/PathSkia.h
+++ b/gfx/2d/PathSkia.h
@@ -19,22 +19,22 @@ class PathBuilderSkia : public PathBuilder {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderSkia, override)
 
-  PathBuilderSkia(const Matrix &aTransform, const SkPath &aPath,
+  PathBuilderSkia(const Matrix& aTransform, const SkPath& aPath,
                   FillRule aFillRule);
   explicit PathBuilderSkia(FillRule aFillRule);
 
-  void MoveTo(const Point &aPoint) override;
-  void LineTo(const Point &aPoint) override;
-  void BezierTo(const Point &aCP1, const Point &aCP2,
-                const Point &aCP3) override;
-  void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
+  void MoveTo(const Point& aPoint) override;
+  void LineTo(const Point& aPoint) override;
+  void BezierTo(const Point& aCP1, const Point& aCP2,
+                const Point& aCP3) override;
+  void QuadraticBezierTo(const Point& aCP1, const Point& aCP2) override;
   void Close() override;
-  void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+  void Arc(const Point& aOrigin, float aRadius, float aStartAngle,
            float aEndAngle, bool aAntiClockwise = false) override;
   Point CurrentPoint() const override;
   already_AddRefed Finish() override;
 
-  void AppendPath(const SkPath &aPath);
+  void AppendPath(const SkPath& aPath);
 
   BackendType GetBackendType() const override { return BackendType::SKIA; }
 
@@ -49,7 +49,7 @@ class PathSkia : public Path {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathSkia, override)
 
-  PathSkia(SkPath &aPath, FillRule aFillRule) : mFillRule(aFillRule) {
+  PathSkia(SkPath& aPath, FillRule aFillRule) : mFillRule(aFillRule) {
     mPath.swap(aPath);
   }
 
@@ -58,25 +58,25 @@ class PathSkia : public Path {
   already_AddRefed CopyToBuilder(
       FillRule aFillRule) const override;
   already_AddRefed TransformedCopyToBuilder(
-      const Matrix &aTransform, FillRule aFillRule) const override;
+      const Matrix& aTransform, FillRule aFillRule) const override;
 
-  bool ContainsPoint(const Point &aPoint,
-                     const Matrix &aTransform) const override;
+  bool ContainsPoint(const Point& aPoint,
+                     const Matrix& aTransform) const override;
 
-  bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                           const Point &aPoint,
-                           const Matrix &aTransform) const override;
+  bool StrokeContainsPoint(const StrokeOptions& aStrokeOptions,
+                           const Point& aPoint,
+                           const Matrix& aTransform) const override;
 
-  Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
+  Rect GetBounds(const Matrix& aTransform = Matrix()) const override;
 
-  Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
-                        const Matrix &aTransform = Matrix()) const override;
+  Rect GetStrokedBounds(const StrokeOptions& aStrokeOptions,
+                        const Matrix& aTransform = Matrix()) const override;
 
-  void StreamToSink(PathSink *aSink) const override;
+  void StreamToSink(PathSink* aSink) const override;
 
   FillRule GetFillRule() const override { return mFillRule; }
 
-  const SkPath &GetPath() const { return mPath; }
+  const SkPath& GetPath() const { return mPath; }
 
  private:
   friend class DrawTargetSkia;
diff --git a/gfx/2d/PatternHelpers.h b/gfx/2d/PatternHelpers.h
index 6e08577843ba7..d7047df5d49e1 100644
--- a/gfx/2d/PatternHelpers.h
+++ b/gfx/2d/PatternHelpers.h
@@ -29,7 +29,7 @@ class GeneralPattern final {
  public:
   explicit GeneralPattern() = default;
 
-  GeneralPattern(const GeneralPattern &aOther) {}
+  GeneralPattern(const GeneralPattern& aOther) {}
 
   ~GeneralPattern() {
     if (mPattern) {
@@ -37,24 +37,24 @@ class GeneralPattern final {
     }
   }
 
-  Pattern *Init(const Pattern &aPattern) {
+  Pattern* Init(const Pattern& aPattern) {
     MOZ_ASSERT(!mPattern);
     switch (aPattern.GetType()) {
       case PatternType::COLOR:
         mPattern = new (mColorPattern.addr())
-            ColorPattern(static_cast(aPattern));
+            ColorPattern(static_cast(aPattern));
         break;
       case PatternType::LINEAR_GRADIENT:
         mPattern = new (mLinearGradientPattern.addr()) LinearGradientPattern(
-            static_cast(aPattern));
+            static_cast(aPattern));
         break;
       case PatternType::RADIAL_GRADIENT:
         mPattern = new (mRadialGradientPattern.addr()) RadialGradientPattern(
-            static_cast(aPattern));
+            static_cast(aPattern));
         break;
       case PatternType::SURFACE:
         mPattern = new (mSurfacePattern.addr())
-            SurfacePattern(static_cast(aPattern));
+            SurfacePattern(static_cast(aPattern));
         break;
       default:
         MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unknown pattern type");
@@ -62,46 +62,46 @@ class GeneralPattern final {
     return mPattern;
   }
 
-  ColorPattern *InitColorPattern(const Color &aColor) {
+  ColorPattern* InitColorPattern(const Color& aColor) {
     MOZ_ASSERT(!mPattern);
     mPattern = new (mColorPattern.addr()) ColorPattern(aColor);
     return mColorPattern.addr();
   }
 
-  LinearGradientPattern *InitLinearGradientPattern(
-      const Point &aBegin, const Point &aEnd, GradientStops *aStops,
-      const Matrix &aMatrix = Matrix()) {
+  LinearGradientPattern* InitLinearGradientPattern(
+      const Point& aBegin, const Point& aEnd, GradientStops* aStops,
+      const Matrix& aMatrix = Matrix()) {
     MOZ_ASSERT(!mPattern);
     mPattern = new (mLinearGradientPattern.addr())
         LinearGradientPattern(aBegin, aEnd, aStops, aMatrix);
     return mLinearGradientPattern.addr();
   }
 
-  RadialGradientPattern *InitRadialGradientPattern(
-      const Point &aCenter1, const Point &aCenter2, Float aRadius1,
-      Float aRadius2, GradientStops *aStops, const Matrix &aMatrix = Matrix()) {
+  RadialGradientPattern* InitRadialGradientPattern(
+      const Point& aCenter1, const Point& aCenter2, Float aRadius1,
+      Float aRadius2, GradientStops* aStops, const Matrix& aMatrix = Matrix()) {
     MOZ_ASSERT(!mPattern);
     mPattern = new (mRadialGradientPattern.addr()) RadialGradientPattern(
         aCenter1, aCenter2, aRadius1, aRadius2, aStops, aMatrix);
     return mRadialGradientPattern.addr();
   }
 
-  SurfacePattern *InitSurfacePattern(
-      SourceSurface *aSourceSurface, ExtendMode aExtendMode,
-      const Matrix &aMatrix = Matrix(),
+  SurfacePattern* InitSurfacePattern(
+      SourceSurface* aSourceSurface, ExtendMode aExtendMode,
+      const Matrix& aMatrix = Matrix(),
       SamplingFilter aSamplingFilter = SamplingFilter::GOOD,
-      const IntRect &aSamplingRect = IntRect()) {
+      const IntRect& aSamplingRect = IntRect()) {
     MOZ_ASSERT(!mPattern);
     mPattern = new (mSurfacePattern.addr()) SurfacePattern(
         aSourceSurface, aExtendMode, aMatrix, aSamplingFilter, aSamplingRect);
     return mSurfacePattern.addr();
   }
 
-  Pattern *GetPattern() { return mPattern; }
+  Pattern* GetPattern() { return mPattern; }
 
-  const Pattern *GetPattern() const { return mPattern; }
+  const Pattern* GetPattern() const { return mPattern; }
 
-  operator Pattern &() {
+  operator Pattern&() {
     if (!mPattern) {
       MOZ_CRASH("GFX: GeneralPattern not initialized");
     }
@@ -115,7 +115,7 @@ class GeneralPattern final {
     AlignedStorage2 mRadialGradientPattern;
     AlignedStorage2 mSurfacePattern;
   };
-  Pattern *mPattern = nullptr;
+  Pattern* mPattern = nullptr;
 };
 
 }  // namespace gfx
diff --git a/gfx/2d/QuartzSupport.h b/gfx/2d/QuartzSupport.h
index fdf57bb3f0d8d..10571dbcfbdd9 100644
--- a/gfx/2d/QuartzSupport.h
+++ b/gfx/2d/QuartzSupport.h
@@ -49,34 +49,34 @@ class nsCARenderer : public mozilla::RefCounted {
   // smallest fully addressable part of a display.  But in HiDPI modes each
   // "display pixel" corresponds to more than one device pixel.  Multiply
   // display pixels by aContentsScaleFactor to get device pixels.
-  nsresult SetupRenderer(void *aCALayer, int aWidth, int aHeight,
+  nsresult SetupRenderer(void* aCALayer, int aWidth, int aHeight,
                          double aContentsScaleFactor,
                          AllowOfflineRendererEnum aAllowOfflineRenderer);
   // aWidth and aHeight are in "display pixels".  Multiply by
   // aContentsScaleFactor to get device pixels.
   nsresult Render(int aWidth, int aHeight, double aContentsScaleFactor,
-                  CGImageRef *aOutCAImage);
+                  CGImageRef* aOutCAImage);
   bool isInit() { return mCARenderer != nullptr; }
   /*
    * Render the CALayer to an IOSurface. If no IOSurface
    * is attached then an internal pixel buffer will be
    * used.
    */
-  void AttachIOSurface(MacIOSurface *aSurface);
+  void AttachIOSurface(MacIOSurface* aSurface);
   IOSurfaceID GetIOSurfaceID();
   // aX, aY, aWidth and aHeight are in "display pixels".  Multiply by
   // surf->GetContentsScaleFactor() to get device pixels.
   static nsresult DrawSurfaceToCGContext(CGContextRef aContext,
-                                         MacIOSurface *surf,
+                                         MacIOSurface* surf,
                                          CGColorSpaceRef aColorSpace, int aX,
                                          int aY, size_t aWidth, size_t aHeight);
 
   // Remove & Add the layer without destroying
   // the renderer for fast back buffer swapping.
   void DetachCALayer();
-  void AttachCALayer(void *aCALayer);
+  void AttachCALayer(void* aCALayer);
 #  ifdef DEBUG
-  static void SaveToDisk(MacIOSurface *surf);
+  static void SaveToDisk(MacIOSurface* surf);
 #  endif
  private:
   // aWidth and aHeight are in "display pixels".  Multiply by
@@ -87,12 +87,12 @@ class nsCARenderer : public mozilla::RefCounted {
   void SetViewport(int aWidth, int aHeight);
   void Destroy();
 
-  void *mCARenderer;
-  void *mWrapperCALayer;
+  void* mCARenderer;
+  void* mWrapperCALayer;
   GLuint mFBOTexture;
-  _CGLContextObject *mOpenGLContext;
+  _CGLContextObject* mOpenGLContext;
   CGImageRef mCGImage;
-  void *mCGData;
+  void* mCGData;
   RefPtr mIOSurface;
   uint32_t mFBO;
   uint32_t mIOTexture;
diff --git a/gfx/2d/RecordedEvent.cpp b/gfx/2d/RecordedEvent.cpp
index 30f9128434f52..593e008d72624 100644
--- a/gfx/2d/RecordedEvent.cpp
+++ b/gfx/2d/RecordedEvent.cpp
@@ -19,12 +19,12 @@ namespace gfx {
 
 using namespace std;
 
-RecordedEvent *RecordedEvent::LoadEventFromStream(std::istream &aStream,
+RecordedEvent* RecordedEvent::LoadEventFromStream(std::istream& aStream,
                                                   EventType aType) {
   return LoadEvent(aStream, aType);
 }
 
-RecordedEvent *RecordedEvent::LoadEventFromStream(EventStream &aStream,
+RecordedEvent* RecordedEvent::LoadEventFromStream(EventStream& aStream,
                                                   EventType aType) {
   return LoadEvent(aStream, aType);
 }
@@ -119,8 +119,8 @@ string RecordedEvent::GetEventName(EventType aType) {
 }
 
 template 
-void RecordedEvent::RecordUnscaledFontImpl(UnscaledFont *aUnscaledFont,
-                                           S &aOutput) {
+void RecordedEvent::RecordUnscaledFontImpl(UnscaledFont* aUnscaledFont,
+                                           S& aOutput) {
   RecordedFontData fontData(aUnscaledFont);
   RecordedFontDetails fontDetails;
   if (fontData.GetFontDetails(fontDetails)) {
@@ -146,18 +146,18 @@ void RecordedEvent::RecordUnscaledFontImpl(UnscaledFont *aUnscaledFont,
   }
 }
 
-void RecordedEvent::RecordUnscaledFont(UnscaledFont *aUnscaledFont,
-                                       std::ostream *aOutput) {
+void RecordedEvent::RecordUnscaledFont(UnscaledFont* aUnscaledFont,
+                                       std::ostream* aOutput) {
   RecordUnscaledFontImpl(aUnscaledFont, *aOutput);
 }
 
-void RecordedEvent::RecordUnscaledFont(UnscaledFont *aUnscaledFont,
-                                       MemStream &aOutput) {
+void RecordedEvent::RecordUnscaledFont(UnscaledFont* aUnscaledFont,
+                                       MemStream& aOutput) {
   RecordUnscaledFontImpl(aUnscaledFont, aOutput);
 }
 
 already_AddRefed Translator::CreateDrawTarget(
-    ReferencePtr aRefPtr, const IntSize &aSize, SurfaceFormat aFormat) {
+    ReferencePtr aRefPtr, const IntSize& aSize, SurfaceFormat aFormat) {
   RefPtr newDT =
       GetReferenceDrawTarget()->CreateSimilarDrawTarget(aSize, aFormat);
   AddDrawTarget(aRefPtr, newDT);
diff --git a/gfx/2d/RecordedEvent.h b/gfx/2d/RecordedEvent.h
index dbfe365e8e549..6b37bd1570c38 100644
--- a/gfx/2d/RecordedEvent.h
+++ b/gfx/2d/RecordedEvent.h
@@ -33,25 +33,25 @@ const uint16_t kMinorRevision = 0;
 struct ReferencePtr {
   ReferencePtr() : mLongPtr(0) {}
 
-  MOZ_IMPLICIT ReferencePtr(const void *aLongPtr)
+  MOZ_IMPLICIT ReferencePtr(const void* aLongPtr)
       : mLongPtr(uint64_t(aLongPtr)) {}
 
   template 
-  MOZ_IMPLICIT ReferencePtr(const RefPtr &aPtr)
+  MOZ_IMPLICIT ReferencePtr(const RefPtr& aPtr)
       : mLongPtr(uint64_t(aPtr.get())) {}
 
-  ReferencePtr &operator=(const void *aLongPtr) {
+  ReferencePtr& operator=(const void* aLongPtr) {
     mLongPtr = uint64_t(aLongPtr);
     return *this;
   }
 
   template 
-  ReferencePtr &operator=(const RefPtr &aPtr) {
+  ReferencePtr& operator=(const RefPtr& aPtr) {
     mLongPtr = uint64_t(aPtr.get());
     return *this;
   }
 
-  operator void *() const { return (void *)mLongPtr; }
+  operator void*() const { return (void*)mLongPtr; }
 
   uint64_t mLongPtr;
 };
@@ -73,41 +73,41 @@ class Translator {
  public:
   virtual ~Translator() = default;
 
-  virtual DrawTarget *LookupDrawTarget(ReferencePtr aRefPtr) = 0;
-  virtual Path *LookupPath(ReferencePtr aRefPtr) = 0;
-  virtual SourceSurface *LookupSourceSurface(ReferencePtr aRefPtr) = 0;
-  virtual FilterNode *LookupFilterNode(ReferencePtr aRefPtr) = 0;
-  virtual GradientStops *LookupGradientStops(ReferencePtr aRefPtr) = 0;
-  virtual ScaledFont *LookupScaledFont(ReferencePtr aRefPtr) = 0;
-  virtual UnscaledFont *LookupUnscaledFont(ReferencePtr aRefPtr) = 0;
-  virtual NativeFontResource *LookupNativeFontResource(uint64_t aKey) = 0;
+  virtual DrawTarget* LookupDrawTarget(ReferencePtr aRefPtr) = 0;
+  virtual Path* LookupPath(ReferencePtr aRefPtr) = 0;
+  virtual SourceSurface* LookupSourceSurface(ReferencePtr aRefPtr) = 0;
+  virtual FilterNode* LookupFilterNode(ReferencePtr aRefPtr) = 0;
+  virtual GradientStops* LookupGradientStops(ReferencePtr aRefPtr) = 0;
+  virtual ScaledFont* LookupScaledFont(ReferencePtr aRefPtr) = 0;
+  virtual UnscaledFont* LookupUnscaledFont(ReferencePtr aRefPtr) = 0;
+  virtual NativeFontResource* LookupNativeFontResource(uint64_t aKey) = 0;
   virtual already_AddRefed LookupExternalSurface(uint64_t aKey) {
     return nullptr;
   }
-  virtual void AddDrawTarget(ReferencePtr aRefPtr, DrawTarget *aDT) = 0;
+  virtual void AddDrawTarget(ReferencePtr aRefPtr, DrawTarget* aDT) = 0;
   virtual void RemoveDrawTarget(ReferencePtr aRefPtr) = 0;
-  virtual void AddPath(ReferencePtr aRefPtr, Path *aPath) = 0;
+  virtual void AddPath(ReferencePtr aRefPtr, Path* aPath) = 0;
   virtual void RemovePath(ReferencePtr aRefPtr) = 0;
-  virtual void AddSourceSurface(ReferencePtr aRefPtr, SourceSurface *aPath) = 0;
+  virtual void AddSourceSurface(ReferencePtr aRefPtr, SourceSurface* aPath) = 0;
   virtual void RemoveSourceSurface(ReferencePtr aRefPtr) = 0;
   virtual void AddFilterNode(mozilla::gfx::ReferencePtr aRefPtr,
-                             FilterNode *aSurface) = 0;
+                             FilterNode* aSurface) = 0;
   virtual void RemoveFilterNode(mozilla::gfx::ReferencePtr aRefPtr) = 0;
-  virtual void AddGradientStops(ReferencePtr aRefPtr, GradientStops *aPath) = 0;
+  virtual void AddGradientStops(ReferencePtr aRefPtr, GradientStops* aPath) = 0;
   virtual void RemoveGradientStops(ReferencePtr aRefPtr) = 0;
-  virtual void AddScaledFont(ReferencePtr aRefPtr, ScaledFont *aScaledFont) = 0;
+  virtual void AddScaledFont(ReferencePtr aRefPtr, ScaledFont* aScaledFont) = 0;
   virtual void RemoveScaledFont(ReferencePtr aRefPtr) = 0;
   virtual void AddUnscaledFont(ReferencePtr aRefPtr,
-                               UnscaledFont *aUnscaledFont) = 0;
+                               UnscaledFont* aUnscaledFont) = 0;
   virtual void RemoveUnscaledFont(ReferencePtr aRefPtr) = 0;
   virtual void AddNativeFontResource(
-      uint64_t aKey, NativeFontResource *aNativeFontResource) = 0;
+      uint64_t aKey, NativeFontResource* aNativeFontResource) = 0;
 
   virtual already_AddRefed CreateDrawTarget(ReferencePtr aRefPtr,
-                                                        const IntSize &aSize,
+                                                        const IntSize& aSize,
                                                         SurfaceFormat aFormat);
-  virtual DrawTarget *GetReferenceDrawTarget() = 0;
-  virtual void *GetFontContext() { return nullptr; }
+  virtual DrawTarget* GetReferenceDrawTarget() = 0;
+  virtual void* GetFontContext() { return nullptr; }
 };
 
 struct ColorPatternStorage {
@@ -141,7 +141,7 @@ struct SurfacePatternStorage {
 struct PatternStorage {
   PatternType mType;
   union {
-    char *mStorage;
+    char* mStorage;
     char mColor[sizeof(ColorPatternStorage)];
     char mLinear[sizeof(LinearGradientPatternStorage)];
     char mRadial[sizeof(RadialGradientPatternStorage)];
@@ -156,21 +156,21 @@ struct PatternStorage {
  * size. */
 struct SizeCollector {
   SizeCollector() : mTotalSize(0) {}
-  void write(const char *, size_t s) { mTotalSize += s; }
+  void write(const char*, size_t s) { mTotalSize += s; }
   size_t mTotalSize;
 };
 
 struct MemWriter {
-  explicit MemWriter(char *aPtr) : mPtr(aPtr) {}
-  void write(const char *aData, size_t aSize) {
+  explicit MemWriter(char* aPtr) : mPtr(aPtr) {}
+  void write(const char* aData, size_t aSize) {
     memcpy(mPtr, aData, aSize);
     mPtr += aSize;
   }
-  char *mPtr;
+  char* mPtr;
 };
 
 struct MemStream {
-  char *mData;
+  char* mData;
   size_t mLength;
   size_t mCapacity;
   void Resize(size_t aSize) {
@@ -182,11 +182,11 @@ struct MemStream {
       if (mLength > mCapacity) {
         mCapacity = mLength * 2;
       }
-      mData = (char *)realloc(mData, mCapacity);
+      mData = (char*)realloc(mData, mCapacity);
     }
   }
 
-  void write(const char *aData, size_t aSize) {
+  void write(const char* aData, size_t aSize) {
     Resize(mLength + aSize);
     memcpy(mData + mLength - aSize, aData, aSize);
   }
@@ -197,8 +197,8 @@ struct MemStream {
 
 class EventStream {
  public:
-  virtual void write(const char *aData, size_t aSize) = 0;
-  virtual void read(char *aOut, size_t aSize) = 0;
+  virtual void write(const char* aData, size_t aSize) = 0;
+  virtual void read(char* aOut, size_t aSize) = 0;
 };
 
 class RecordedEvent {
@@ -268,25 +268,25 @@ class RecordedEvent {
    * @return true unless a fatal problem has occurred and playback should
    * abort.
    */
-  virtual bool PlayEvent(Translator *aTranslator) const { return true; }
+  virtual bool PlayEvent(Translator* aTranslator) const { return true; }
 
-  virtual void RecordToStream(std::ostream &aStream) const = 0;
-  virtual void RecordToStream(EventStream &aStream) const = 0;
-  virtual void RecordToStream(MemStream &aStream) const = 0;
+  virtual void RecordToStream(std::ostream& aStream) const = 0;
+  virtual void RecordToStream(EventStream& aStream) const = 0;
+  virtual void RecordToStream(MemStream& aStream) const = 0;
 
-  virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const {}
+  virtual void OutputSimpleEventInfo(std::stringstream& aStringStream) const {}
 
   template 
-  void RecordPatternData(S &aStream,
-                         const PatternStorage &aPatternStorage) const;
+  void RecordPatternData(S& aStream,
+                         const PatternStorage& aPatternStorage) const;
   template 
-  void ReadPatternData(S &aStream, PatternStorage &aPatternStorage) const;
-  void StorePattern(PatternStorage &aDestination, const Pattern &aSource) const;
+  void ReadPatternData(S& aStream, PatternStorage& aPatternStorage) const;
+  void StorePattern(PatternStorage& aDestination, const Pattern& aSource) const;
   template 
-  void RecordStrokeOptions(S &aStream,
-                           const StrokeOptions &aStrokeOptions) const;
+  void RecordStrokeOptions(S& aStream,
+                           const StrokeOptions& aStrokeOptions) const;
   template 
-  void ReadStrokeOptions(S &aStream, StrokeOptions &aStrokeOptions);
+  void ReadStrokeOptions(S& aStream, StrokeOptions& aStrokeOptions);
 
   virtual std::string GetName() const = 0;
 
@@ -294,21 +294,21 @@ class RecordedEvent {
 
   virtual ReferencePtr GetDestinedDT() { return nullptr; }
 
-  void OutputSimplePatternInfo(const PatternStorage &aStorage,
-                               std::stringstream &aOutput) const;
+  void OutputSimplePatternInfo(const PatternStorage& aStorage,
+                               std::stringstream& aOutput) const;
 
   template 
-  static RecordedEvent *LoadEvent(S &aStream, EventType aType);
-  static RecordedEvent *LoadEventFromStream(std::istream &aStream,
+  static RecordedEvent* LoadEvent(S& aStream, EventType aType);
+  static RecordedEvent* LoadEventFromStream(std::istream& aStream,
                                             EventType aType);
-  static RecordedEvent *LoadEventFromStream(EventStream &aStream,
+  static RecordedEvent* LoadEventFromStream(EventStream& aStream,
                                             EventType aType);
 
   // An alternative to LoadEvent that avoids a heap allocation for the event.
   // This accepts a callable `f' that will take a RecordedEvent* as a single
   // parameter
   template 
-  static bool DoWithEvent(S &aStream, EventType aType, F f);
+  static bool DoWithEvent(S& aStream, EventType aType, F f);
 
   EventType GetType() const { return (EventType)mType; }
 
@@ -316,12 +316,12 @@ class RecordedEvent {
   friend class DrawEventRecorderPrivate;
   friend class DrawEventRecorderFile;
   friend class DrawEventRecorderMemory;
-  static void RecordUnscaledFont(UnscaledFont *aUnscaledFont,
-                                 std::ostream *aOutput);
-  static void RecordUnscaledFont(UnscaledFont *aUnscaledFont,
-                                 MemStream &aOutput);
+  static void RecordUnscaledFont(UnscaledFont* aUnscaledFont,
+                                 std::ostream* aOutput);
+  static void RecordUnscaledFont(UnscaledFont* aUnscaledFont,
+                                 MemStream& aOutput);
   template 
-  static void RecordUnscaledFontImpl(UnscaledFont *aUnscaledFont, S &aOutput);
+  static void RecordUnscaledFontImpl(UnscaledFont* aUnscaledFont, S& aOutput);
 
   MOZ_IMPLICIT RecordedEvent(int32_t aType) : mType(aType) {}
 
diff --git a/gfx/2d/RecordedEventImpl.h b/gfx/2d/RecordedEventImpl.h
index 8285dde600ccc..ef1b0c03216b9 100644
--- a/gfx/2d/RecordedEventImpl.h
+++ b/gfx/2d/RecordedEventImpl.h
@@ -25,18 +25,18 @@ class RecordedEventDerived : public RecordedEvent {
   using RecordedEvent::RecordedEvent;
 
  public:
-  void RecordToStream(std::ostream &aStream) const override {
-    static_cast(this)->Record(aStream);
+  void RecordToStream(std::ostream& aStream) const override {
+    static_cast(this)->Record(aStream);
   }
-  void RecordToStream(EventStream &aStream) const override {
-    static_cast(this)->Record(aStream);
+  void RecordToStream(EventStream& aStream) const override {
+    static_cast(this)->Record(aStream);
   }
-  void RecordToStream(MemStream &aStream) const override {
+  void RecordToStream(MemStream& aStream) const override {
     SizeCollector size;
-    static_cast(this)->Record(size);
+    static_cast(this)->Record(size);
     aStream.Resize(aStream.mLength + size.mTotalSize);
     MemWriter writer(aStream.mData + aStream.mLength - size.mTotalSize);
-    static_cast(this)->Record(writer);
+    static_cast(this)->Record(writer);
   }
 };
 
@@ -46,13 +46,13 @@ class RecordedDrawingEvent : public RecordedEventDerived {
   ReferencePtr GetDestinedDT() override { return mDT; }
 
  protected:
-  RecordedDrawingEvent(RecordedEvent::EventType aType, DrawTarget *aTarget)
+  RecordedDrawingEvent(RecordedEvent::EventType aType, DrawTarget* aTarget)
       : RecordedEventDerived(aType), mDT(aTarget) {}
 
   template 
-  RecordedDrawingEvent(RecordedEvent::EventType aType, S &aStream);
+  RecordedDrawingEvent(RecordedEvent::EventType aType, S& aStream);
   template 
-  void Record(S &aStream) const;
+  void Record(S& aStream) const;
 
   ReferencePtr GetObjectRef() const override;
 
@@ -63,9 +63,9 @@ class RecordedDrawTargetCreation
     : public RecordedEventDerived {
  public:
   RecordedDrawTargetCreation(ReferencePtr aRefPtr, BackendType aType,
-                             const IntSize &aSize, SurfaceFormat aFormat,
+                             const IntSize& aSize, SurfaceFormat aFormat,
                              bool aHasExistingData = false,
-                             SourceSurface *aExistingData = nullptr)
+                             SourceSurface* aExistingData = nullptr)
       : RecordedEventDerived(DRAWTARGETCREATION),
         mRefPtr(aRefPtr),
         mBackendType(aType),
@@ -74,12 +74,12 @@ class RecordedDrawTargetCreation
         mHasExistingData(aHasExistingData),
         mExistingData(aExistingData) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
+  void Record(S& aStream) const;
   virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
+      std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "DrawTarget Creation"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -95,7 +95,7 @@ class RecordedDrawTargetCreation
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedDrawTargetCreation(S &aStream);
+  MOZ_IMPLICIT RecordedDrawTargetCreation(S& aStream);
 };
 
 class RecordedDrawTargetDestruction
@@ -106,11 +106,11 @@ class RecordedDrawTargetDestruction
         mRefPtr(aRefPtr),
         mBackendType(BackendType::NONE) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "DrawTarget Destruction"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -123,25 +123,25 @@ class RecordedDrawTargetDestruction
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedDrawTargetDestruction(S &aStream);
+  MOZ_IMPLICIT RecordedDrawTargetDestruction(S& aStream);
 };
 
 class RecordedCreateSimilarDrawTarget
     : public RecordedEventDerived {
  public:
-  RecordedCreateSimilarDrawTarget(ReferencePtr aRefPtr, const IntSize &aSize,
+  RecordedCreateSimilarDrawTarget(ReferencePtr aRefPtr, const IntSize& aSize,
                                   SurfaceFormat aFormat)
       : RecordedEventDerived(CREATESIMILARDRAWTARGET),
         mRefPtr(aRefPtr),
         mSize(aSize),
         mFormat(aFormat) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
+  void Record(S& aStream) const;
   virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
+      std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "CreateSimilarDrawTarget"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -154,14 +154,14 @@ class RecordedCreateSimilarDrawTarget
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedCreateSimilarDrawTarget(S &aStream);
+  MOZ_IMPLICIT RecordedCreateSimilarDrawTarget(S& aStream);
 };
 
 class RecordedCreateClippedDrawTarget
     : public RecordedEventDerived {
  public:
-  RecordedCreateClippedDrawTarget(ReferencePtr aRefPtr, const IntSize &aMaxSize,
-                                  const Matrix &aTransform,
+  RecordedCreateClippedDrawTarget(ReferencePtr aRefPtr, const IntSize& aMaxSize,
+                                  const Matrix& aTransform,
                                   SurfaceFormat aFormat)
       : RecordedEventDerived(CREATECLIPPEDDRAWTARGET),
         mRefPtr(aRefPtr),
@@ -169,12 +169,12 @@ class RecordedCreateClippedDrawTarget
         mTransform(aTransform),
         mFormat(aFormat) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
+  void Record(S& aStream) const;
   virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
+      std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "CreateClippedDrawTarget"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -188,18 +188,18 @@ class RecordedCreateClippedDrawTarget
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedCreateClippedDrawTarget(S &aStream);
+  MOZ_IMPLICIT RecordedCreateClippedDrawTarget(S& aStream);
 };
 
 class RecordedCreateDrawTargetForFilter
     : public RecordedDrawingEvent {
  public:
-  RecordedCreateDrawTargetForFilter(DrawTarget *aDT, ReferencePtr aRefPtr,
-                                    const IntSize &aMaxSize,
-                                    SurfaceFormat aFormat, FilterNode *aFilter,
-                                    FilterNode *aSource,
-                                    const Rect &aSourceRect,
-                                    const Point &aDestPoint)
+  RecordedCreateDrawTargetForFilter(DrawTarget* aDT, ReferencePtr aRefPtr,
+                                    const IntSize& aMaxSize,
+                                    SurfaceFormat aFormat, FilterNode* aFilter,
+                                    FilterNode* aSource,
+                                    const Rect& aSourceRect,
+                                    const Point& aDestPoint)
       : RecordedDrawingEvent(CREATEDRAWTARGETFORFILTER, aDT),
         mRefPtr(aRefPtr),
         mMaxSize(aMaxSize),
@@ -209,12 +209,12 @@ class RecordedCreateDrawTargetForFilter
         mSourceRect(aSourceRect),
         mDestPoint(aDestPoint) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
+  void Record(S& aStream) const;
   virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
+      std::stringstream& aStringStream) const override;
 
   std::string GetName() const override {
     return "CreateSimilarDrawTargetForFilter";
@@ -233,13 +233,13 @@ class RecordedCreateDrawTargetForFilter
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedCreateDrawTargetForFilter(S &aStream);
+  MOZ_IMPLICIT RecordedCreateDrawTargetForFilter(S& aStream);
 };
 
 class RecordedFillRect : public RecordedDrawingEvent {
  public:
-  RecordedFillRect(DrawTarget *aDT, const Rect &aRect, const Pattern &aPattern,
-                   const DrawOptions &aOptions)
+  RecordedFillRect(DrawTarget* aDT, const Rect& aRect, const Pattern& aPattern,
+                   const DrawOptions& aOptions)
       : RecordedDrawingEvent(FILLRECT, aDT),
         mRect(aRect),
         mPattern(),
@@ -247,11 +247,11 @@ class RecordedFillRect : public RecordedDrawingEvent {
     StorePattern(mPattern, aPattern);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "FillRect"; }
 
@@ -259,7 +259,7 @@ class RecordedFillRect : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedFillRect(S &aStream);
+  MOZ_IMPLICIT RecordedFillRect(S& aStream);
 
   Rect mRect;
   PatternStorage mPattern;
@@ -268,10 +268,10 @@ class RecordedFillRect : public RecordedDrawingEvent {
 
 class RecordedStrokeRect : public RecordedDrawingEvent {
  public:
-  RecordedStrokeRect(DrawTarget *aDT, const Rect &aRect,
-                     const Pattern &aPattern,
-                     const StrokeOptions &aStrokeOptions,
-                     const DrawOptions &aOptions)
+  RecordedStrokeRect(DrawTarget* aDT, const Rect& aRect,
+                     const Pattern& aPattern,
+                     const StrokeOptions& aStrokeOptions,
+                     const DrawOptions& aOptions)
       : RecordedDrawingEvent(STROKERECT, aDT),
         mRect(aRect),
         mPattern(),
@@ -280,11 +280,11 @@ class RecordedStrokeRect : public RecordedDrawingEvent {
     StorePattern(mPattern, aPattern);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "StrokeRect"; }
 
@@ -292,7 +292,7 @@ class RecordedStrokeRect : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedStrokeRect(S &aStream);
+  MOZ_IMPLICIT RecordedStrokeRect(S& aStream);
 
   Rect mRect;
   PatternStorage mPattern;
@@ -302,10 +302,10 @@ class RecordedStrokeRect : public RecordedDrawingEvent {
 
 class RecordedStrokeLine : public RecordedDrawingEvent {
  public:
-  RecordedStrokeLine(DrawTarget *aDT, const Point &aBegin, const Point &aEnd,
-                     const Pattern &aPattern,
-                     const StrokeOptions &aStrokeOptions,
-                     const DrawOptions &aOptions)
+  RecordedStrokeLine(DrawTarget* aDT, const Point& aBegin, const Point& aEnd,
+                     const Pattern& aPattern,
+                     const StrokeOptions& aStrokeOptions,
+                     const DrawOptions& aOptions)
       : RecordedDrawingEvent(STROKELINE, aDT),
         mBegin(aBegin),
         mEnd(aEnd),
@@ -315,11 +315,11 @@ class RecordedStrokeLine : public RecordedDrawingEvent {
     StorePattern(mPattern, aPattern);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "StrokeLine"; }
 
@@ -327,7 +327,7 @@ class RecordedStrokeLine : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedStrokeLine(S &aStream);
+  MOZ_IMPLICIT RecordedStrokeLine(S& aStream);
 
   Point mBegin;
   Point mEnd;
@@ -338,8 +338,8 @@ class RecordedStrokeLine : public RecordedDrawingEvent {
 
 class RecordedFill : public RecordedDrawingEvent {
  public:
-  RecordedFill(DrawTarget *aDT, ReferencePtr aPath, const Pattern &aPattern,
-               const DrawOptions &aOptions)
+  RecordedFill(DrawTarget* aDT, ReferencePtr aPath, const Pattern& aPattern,
+               const DrawOptions& aOptions)
       : RecordedDrawingEvent(FILL, aDT),
         mPath(aPath),
         mPattern(),
@@ -347,11 +347,11 @@ class RecordedFill : public RecordedDrawingEvent {
     StorePattern(mPattern, aPattern);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "Fill"; }
 
@@ -359,7 +359,7 @@ class RecordedFill : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedFill(S &aStream);
+  MOZ_IMPLICIT RecordedFill(S& aStream);
 
   ReferencePtr mPath;
   PatternStorage mPattern;
@@ -368,9 +368,9 @@ class RecordedFill : public RecordedDrawingEvent {
 
 class RecordedFillGlyphs : public RecordedDrawingEvent {
  public:
-  RecordedFillGlyphs(DrawTarget *aDT, ReferencePtr aScaledFont,
-                     const Pattern &aPattern, const DrawOptions &aOptions,
-                     const Glyph *aGlyphs, uint32_t aNumGlyphs)
+  RecordedFillGlyphs(DrawTarget* aDT, ReferencePtr aScaledFont,
+                     const Pattern& aPattern, const DrawOptions& aOptions,
+                     const Glyph* aGlyphs, uint32_t aNumGlyphs)
       : RecordedDrawingEvent(FILLGLYPHS, aDT),
         mScaledFont(aScaledFont),
         mPattern(),
@@ -382,11 +382,11 @@ class RecordedFillGlyphs : public RecordedDrawingEvent {
   }
   virtual ~RecordedFillGlyphs();
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "FillGlyphs"; }
 
@@ -394,19 +394,19 @@ class RecordedFillGlyphs : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedFillGlyphs(S &aStream);
+  MOZ_IMPLICIT RecordedFillGlyphs(S& aStream);
 
   ReferencePtr mScaledFont;
   PatternStorage mPattern;
   DrawOptions mOptions;
-  Glyph *mGlyphs;
+  Glyph* mGlyphs;
   uint32_t mNumGlyphs;
 };
 
 class RecordedMask : public RecordedDrawingEvent {
  public:
-  RecordedMask(DrawTarget *aDT, const Pattern &aSource, const Pattern &aMask,
-               const DrawOptions &aOptions)
+  RecordedMask(DrawTarget* aDT, const Pattern& aSource, const Pattern& aMask,
+               const DrawOptions& aOptions)
       : RecordedDrawingEvent(MASK, aDT),
         mSource(),
         mMask(),
@@ -415,11 +415,11 @@ class RecordedMask : public RecordedDrawingEvent {
     StorePattern(mMask, aMask);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "Mask"; }
 
@@ -427,7 +427,7 @@ class RecordedMask : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedMask(S &aStream);
+  MOZ_IMPLICIT RecordedMask(S& aStream);
 
   PatternStorage mSource;
   PatternStorage mMask;
@@ -436,9 +436,9 @@ class RecordedMask : public RecordedDrawingEvent {
 
 class RecordedStroke : public RecordedDrawingEvent {
  public:
-  RecordedStroke(DrawTarget *aDT, ReferencePtr aPath, const Pattern &aPattern,
-                 const StrokeOptions &aStrokeOptions,
-                 const DrawOptions &aOptions)
+  RecordedStroke(DrawTarget* aDT, ReferencePtr aPath, const Pattern& aPattern,
+                 const StrokeOptions& aStrokeOptions,
+                 const DrawOptions& aOptions)
       : RecordedDrawingEvent(STROKE, aDT),
         mPath(aPath),
         mPattern(),
@@ -447,12 +447,12 @@ class RecordedStroke : public RecordedDrawingEvent {
     StorePattern(mPattern, aPattern);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
+  void Record(S& aStream) const;
   virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
+      std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "Stroke"; }
 
@@ -460,7 +460,7 @@ class RecordedStroke : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedStroke(S &aStream);
+  MOZ_IMPLICIT RecordedStroke(S& aStream);
 
   ReferencePtr mPath;
   PatternStorage mPattern;
@@ -470,14 +470,14 @@ class RecordedStroke : public RecordedDrawingEvent {
 
 class RecordedClearRect : public RecordedDrawingEvent {
  public:
-  RecordedClearRect(DrawTarget *aDT, const Rect &aRect)
+  RecordedClearRect(DrawTarget* aDT, const Rect& aRect)
       : RecordedDrawingEvent(CLEARRECT, aDT), mRect(aRect) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "ClearRect"; }
 
@@ -485,25 +485,25 @@ class RecordedClearRect : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedClearRect(S &aStream);
+  MOZ_IMPLICIT RecordedClearRect(S& aStream);
 
   Rect mRect;
 };
 
 class RecordedCopySurface : public RecordedDrawingEvent {
  public:
-  RecordedCopySurface(DrawTarget *aDT, ReferencePtr aSourceSurface,
-                      const IntRect &aSourceRect, const IntPoint &aDest)
+  RecordedCopySurface(DrawTarget* aDT, ReferencePtr aSourceSurface,
+                      const IntRect& aSourceRect, const IntPoint& aDest)
       : RecordedDrawingEvent(COPYSURFACE, aDT),
         mSourceSurface(aSourceSurface),
         mSourceRect(aSourceRect),
         mDest(aDest) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "CopySurface"; }
 
@@ -511,7 +511,7 @@ class RecordedCopySurface : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedCopySurface(S &aStream);
+  MOZ_IMPLICIT RecordedCopySurface(S& aStream);
 
   ReferencePtr mSourceSurface;
   IntRect mSourceRect;
@@ -520,14 +520,14 @@ class RecordedCopySurface : public RecordedDrawingEvent {
 
 class RecordedPushClip : public RecordedDrawingEvent {
  public:
-  RecordedPushClip(DrawTarget *aDT, ReferencePtr aPath)
+  RecordedPushClip(DrawTarget* aDT, ReferencePtr aPath)
       : RecordedDrawingEvent(PUSHCLIP, aDT), mPath(aPath) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "PushClip"; }
 
@@ -535,21 +535,21 @@ class RecordedPushClip : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedPushClip(S &aStream);
+  MOZ_IMPLICIT RecordedPushClip(S& aStream);
 
   ReferencePtr mPath;
 };
 
 class RecordedPushClipRect : public RecordedDrawingEvent {
  public:
-  RecordedPushClipRect(DrawTarget *aDT, const Rect &aRect)
+  RecordedPushClipRect(DrawTarget* aDT, const Rect& aRect)
       : RecordedDrawingEvent(PUSHCLIPRECT, aDT), mRect(aRect) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "PushClipRect"; }
 
@@ -557,21 +557,21 @@ class RecordedPushClipRect : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedPushClipRect(S &aStream);
+  MOZ_IMPLICIT RecordedPushClipRect(S& aStream);
 
   Rect mRect;
 };
 
 class RecordedPopClip : public RecordedDrawingEvent {
  public:
-  MOZ_IMPLICIT RecordedPopClip(DrawTarget *aDT)
+  MOZ_IMPLICIT RecordedPopClip(DrawTarget* aDT)
       : RecordedDrawingEvent(POPCLIP, aDT) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "PopClip"; }
 
@@ -579,14 +579,14 @@ class RecordedPopClip : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedPopClip(S &aStream);
+  MOZ_IMPLICIT RecordedPopClip(S& aStream);
 };
 
 class RecordedPushLayer : public RecordedDrawingEvent {
  public:
-  RecordedPushLayer(DrawTarget *aDT, bool aOpaque, Float aOpacity,
-                    SourceSurface *aMask, const Matrix &aMaskTransform,
-                    const IntRect &aBounds, bool aCopyBackground)
+  RecordedPushLayer(DrawTarget* aDT, bool aOpaque, Float aOpacity,
+                    SourceSurface* aMask, const Matrix& aMaskTransform,
+                    const IntRect& aBounds, bool aCopyBackground)
       : RecordedDrawingEvent(PUSHLAYER, aDT),
         mOpaque(aOpaque),
         mOpacity(aOpacity),
@@ -595,11 +595,11 @@ class RecordedPushLayer : public RecordedDrawingEvent {
         mBounds(aBounds),
         mCopyBackground(aCopyBackground) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "PushLayer"; }
 
@@ -607,7 +607,7 @@ class RecordedPushLayer : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedPushLayer(S &aStream);
+  MOZ_IMPLICIT RecordedPushLayer(S& aStream);
 
   bool mOpaque;
   Float mOpacity;
@@ -620,9 +620,9 @@ class RecordedPushLayer : public RecordedDrawingEvent {
 class RecordedPushLayerWithBlend
     : public RecordedDrawingEvent {
  public:
-  RecordedPushLayerWithBlend(DrawTarget *aDT, bool aOpaque, Float aOpacity,
-                             SourceSurface *aMask, const Matrix &aMaskTransform,
-                             const IntRect &aBounds, bool aCopyBackground,
+  RecordedPushLayerWithBlend(DrawTarget* aDT, bool aOpaque, Float aOpacity,
+                             SourceSurface* aMask, const Matrix& aMaskTransform,
+                             const IntRect& aBounds, bool aCopyBackground,
                              CompositionOp aCompositionOp)
       : RecordedDrawingEvent(PUSHLAYERWITHBLEND, aDT),
         mOpaque(aOpaque),
@@ -633,12 +633,12 @@ class RecordedPushLayerWithBlend
         mCopyBackground(aCopyBackground),
         mCompositionOp(aCompositionOp) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
+  void Record(S& aStream) const;
   virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
+      std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "PushLayerWithBlend"; }
 
@@ -646,7 +646,7 @@ class RecordedPushLayerWithBlend
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedPushLayerWithBlend(S &aStream);
+  MOZ_IMPLICIT RecordedPushLayerWithBlend(S& aStream);
 
   bool mOpaque;
   Float mOpacity;
@@ -659,14 +659,14 @@ class RecordedPushLayerWithBlend
 
 class RecordedPopLayer : public RecordedDrawingEvent {
  public:
-  MOZ_IMPLICIT RecordedPopLayer(DrawTarget *aDT)
+  MOZ_IMPLICIT RecordedPopLayer(DrawTarget* aDT)
       : RecordedDrawingEvent(POPLAYER, aDT) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "PopLayer"; }
 
@@ -674,19 +674,19 @@ class RecordedPopLayer : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedPopLayer(S &aStream);
+  MOZ_IMPLICIT RecordedPopLayer(S& aStream);
 };
 
 class RecordedSetTransform : public RecordedDrawingEvent {
  public:
-  RecordedSetTransform(DrawTarget *aDT, const Matrix &aTransform)
+  RecordedSetTransform(DrawTarget* aDT, const Matrix& aTransform)
       : RecordedDrawingEvent(SETTRANSFORM, aDT), mTransform(aTransform) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "SetTransform"; }
 
@@ -696,15 +696,15 @@ class RecordedSetTransform : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedSetTransform(S &aStream);
+  MOZ_IMPLICIT RecordedSetTransform(S& aStream);
 };
 
 class RecordedDrawSurface : public RecordedDrawingEvent {
  public:
-  RecordedDrawSurface(DrawTarget *aDT, ReferencePtr aRefSource,
-                      const Rect &aDest, const Rect &aSource,
-                      const DrawSurfaceOptions &aDSOptions,
-                      const DrawOptions &aOptions)
+  RecordedDrawSurface(DrawTarget* aDT, ReferencePtr aRefSource,
+                      const Rect& aDest, const Rect& aSource,
+                      const DrawSurfaceOptions& aDSOptions,
+                      const DrawOptions& aOptions)
       : RecordedDrawingEvent(DRAWSURFACE, aDT),
         mRefSource(aRefSource),
         mDest(aDest),
@@ -712,11 +712,11 @@ class RecordedDrawSurface : public RecordedDrawingEvent {
         mDSOptions(aDSOptions),
         mOptions(aOptions) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "DrawSurface"; }
 
@@ -724,7 +724,7 @@ class RecordedDrawSurface : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedDrawSurface(S &aStream);
+  MOZ_IMPLICIT RecordedDrawSurface(S& aStream);
 
   ReferencePtr mRefSource;
   Rect mDest;
@@ -736,20 +736,20 @@ class RecordedDrawSurface : public RecordedDrawingEvent {
 class RecordedDrawDependentSurface
     : public RecordedDrawingEvent {
  public:
-  RecordedDrawDependentSurface(DrawTarget *aDT, uint64_t aId, const Rect &aDest,
-                               const DrawSurfaceOptions &aDSOptions,
-                               const DrawOptions &aOptions)
+  RecordedDrawDependentSurface(DrawTarget* aDT, uint64_t aId, const Rect& aDest,
+                               const DrawSurfaceOptions& aDSOptions,
+                               const DrawOptions& aOptions)
       : RecordedDrawingEvent(DRAWDEPENDENTSURFACE, aDT),
         mId(aId),
         mDest(aDest),
         mDSOptions(aDSOptions),
         mOptions(aOptions) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "DrawDependentSurface"; }
 
@@ -757,7 +757,7 @@ class RecordedDrawDependentSurface
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedDrawDependentSurface(S &aStream);
+  MOZ_IMPLICIT RecordedDrawDependentSurface(S& aStream);
 
   uint64_t mId;
   Rect mDest;
@@ -768,9 +768,9 @@ class RecordedDrawDependentSurface
 class RecordedDrawSurfaceWithShadow
     : public RecordedDrawingEvent {
  public:
-  RecordedDrawSurfaceWithShadow(DrawTarget *aDT, ReferencePtr aRefSource,
-                                const Point &aDest, const Color &aColor,
-                                const Point &aOffset, Float aSigma,
+  RecordedDrawSurfaceWithShadow(DrawTarget* aDT, ReferencePtr aRefSource,
+                                const Point& aDest, const Color& aColor,
+                                const Point& aOffset, Float aSigma,
                                 CompositionOp aOp)
       : RecordedDrawingEvent(DRAWSURFACEWITHSHADOW, aDT),
         mRefSource(aRefSource),
@@ -780,11 +780,11 @@ class RecordedDrawSurfaceWithShadow
         mSigma(aSigma),
         mOp(aOp) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "DrawSurfaceWithShadow"; }
 
@@ -792,7 +792,7 @@ class RecordedDrawSurfaceWithShadow
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedDrawSurfaceWithShadow(S &aStream);
+  MOZ_IMPLICIT RecordedDrawSurfaceWithShadow(S& aStream);
 
   ReferencePtr mRefSource;
   Point mDest;
@@ -804,20 +804,20 @@ class RecordedDrawSurfaceWithShadow
 
 class RecordedDrawFilter : public RecordedDrawingEvent {
  public:
-  RecordedDrawFilter(DrawTarget *aDT, ReferencePtr aNode,
-                     const Rect &aSourceRect, const Point &aDestPoint,
-                     const DrawOptions &aOptions)
+  RecordedDrawFilter(DrawTarget* aDT, ReferencePtr aNode,
+                     const Rect& aSourceRect, const Point& aDestPoint,
+                     const DrawOptions& aOptions)
       : RecordedDrawingEvent(DRAWFILTER, aDT),
         mNode(aNode),
         mSourceRect(aSourceRect),
         mDestPoint(aDestPoint),
         mOptions(aOptions) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "DrawFilter"; }
 
@@ -825,7 +825,7 @@ class RecordedDrawFilter : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedDrawFilter(S &aStream);
+  MOZ_IMPLICIT RecordedDrawFilter(S& aStream);
 
   ReferencePtr mNode;
   Rect mSourceRect;
@@ -835,14 +835,14 @@ class RecordedDrawFilter : public RecordedDrawingEvent {
 
 class RecordedPathCreation : public RecordedEventDerived {
  public:
-  MOZ_IMPLICIT RecordedPathCreation(PathRecording *aPath);
+  MOZ_IMPLICIT RecordedPathCreation(PathRecording* aPath);
   ~RecordedPathCreation();
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "Path Creation"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -855,20 +855,20 @@ class RecordedPathCreation : public RecordedEventDerived {
   std::vector mPathOps;
 
   template 
-  MOZ_IMPLICIT RecordedPathCreation(S &aStream);
+  MOZ_IMPLICIT RecordedPathCreation(S& aStream);
 };
 
 class RecordedPathDestruction
     : public RecordedEventDerived {
  public:
-  MOZ_IMPLICIT RecordedPathDestruction(PathRecording *aPath)
+  MOZ_IMPLICIT RecordedPathDestruction(PathRecording* aPath)
       : RecordedEventDerived(PATHDESTRUCTION), mRefPtr(aPath) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "Path Destruction"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -879,14 +879,14 @@ class RecordedPathDestruction
   ReferencePtr mRefPtr;
 
   template 
-  MOZ_IMPLICIT RecordedPathDestruction(S &aStream);
+  MOZ_IMPLICIT RecordedPathDestruction(S& aStream);
 };
 
 class RecordedSourceSurfaceCreation
     : public RecordedEventDerived {
  public:
-  RecordedSourceSurfaceCreation(ReferencePtr aRefPtr, uint8_t *aData,
-                                int32_t aStride, const IntSize &aSize,
+  RecordedSourceSurfaceCreation(ReferencePtr aRefPtr, uint8_t* aData,
+                                int32_t aStride, const IntSize& aSize,
                                 SurfaceFormat aFormat)
       : RecordedEventDerived(SOURCESURFACECREATION),
         mRefPtr(aRefPtr),
@@ -898,11 +898,11 @@ class RecordedSourceSurfaceCreation
 
   ~RecordedSourceSurfaceCreation();
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "SourceSurface Creation"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -911,14 +911,14 @@ class RecordedSourceSurfaceCreation
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
-  uint8_t *mData;
+  uint8_t* mData;
   int32_t mStride;
   IntSize mSize;
   SurfaceFormat mFormat;
   bool mDataOwned;
 
   template 
-  MOZ_IMPLICIT RecordedSourceSurfaceCreation(S &aStream);
+  MOZ_IMPLICIT RecordedSourceSurfaceCreation(S& aStream);
 };
 
 class RecordedSourceSurfaceDestruction
@@ -927,11 +927,11 @@ class RecordedSourceSurfaceDestruction
   MOZ_IMPLICIT RecordedSourceSurfaceDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(SOURCESURFACEDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "SourceSurface Destruction"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -942,7 +942,7 @@ class RecordedSourceSurfaceDestruction
   ReferencePtr mRefPtr;
 
   template 
-  MOZ_IMPLICIT RecordedSourceSurfaceDestruction(S &aStream);
+  MOZ_IMPLICIT RecordedSourceSurfaceDestruction(S& aStream);
 };
 
 class RecordedExternalSurfaceCreation
@@ -955,11 +955,11 @@ class RecordedExternalSurfaceCreation
 
   ~RecordedExternalSurfaceCreation() {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const;
+  virtual bool PlayEvent(Translator* aTranslator) const;
 
   template 
-  void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
+  void Record(S& aStream) const;
+  virtual void OutputSimpleEventInfo(std::stringstream& aStringStream) const;
 
   virtual std::string GetName() const {
     return "SourceSurfaceSharedData Creation";
@@ -973,7 +973,7 @@ class RecordedExternalSurfaceCreation
   uint64_t mKey;
 
   template 
-  MOZ_IMPLICIT RecordedExternalSurfaceCreation(S &aStream);
+  MOZ_IMPLICIT RecordedExternalSurfaceCreation(S& aStream);
 };
 
 class RecordedFilterNodeCreation
@@ -986,11 +986,11 @@ class RecordedFilterNodeCreation
 
   ~RecordedFilterNodeCreation();
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "FilterNode Creation"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1002,7 +1002,7 @@ class RecordedFilterNodeCreation
   FilterType mType;
 
   template 
-  MOZ_IMPLICIT RecordedFilterNodeCreation(S &aStream);
+  MOZ_IMPLICIT RecordedFilterNodeCreation(S& aStream);
 };
 
 class RecordedFilterNodeDestruction
@@ -1011,11 +1011,11 @@ class RecordedFilterNodeDestruction
   MOZ_IMPLICIT RecordedFilterNodeDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(FILTERNODEDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "FilterNode Destruction"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1026,13 +1026,13 @@ class RecordedFilterNodeDestruction
   ReferencePtr mRefPtr;
 
   template 
-  MOZ_IMPLICIT RecordedFilterNodeDestruction(S &aStream);
+  MOZ_IMPLICIT RecordedFilterNodeDestruction(S& aStream);
 };
 
 class RecordedGradientStopsCreation
     : public RecordedEventDerived {
  public:
-  RecordedGradientStopsCreation(ReferencePtr aRefPtr, GradientStop *aStops,
+  RecordedGradientStopsCreation(ReferencePtr aRefPtr, GradientStop* aStops,
                                 uint32_t aNumStops, ExtendMode aExtendMode)
       : RecordedEventDerived(GRADIENTSTOPSCREATION),
         mRefPtr(aRefPtr),
@@ -1043,11 +1043,11 @@ class RecordedGradientStopsCreation
 
   ~RecordedGradientStopsCreation();
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "GradientStops Creation"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1056,13 +1056,13 @@ class RecordedGradientStopsCreation
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
-  GradientStop *mStops;
+  GradientStop* mStops;
   uint32_t mNumStops;
   ExtendMode mExtendMode;
   bool mDataOwned;
 
   template 
-  MOZ_IMPLICIT RecordedGradientStopsCreation(S &aStream);
+  MOZ_IMPLICIT RecordedGradientStopsCreation(S& aStream);
 };
 
 class RecordedGradientStopsDestruction
@@ -1071,11 +1071,11 @@ class RecordedGradientStopsDestruction
   MOZ_IMPLICIT RecordedGradientStopsDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(GRADIENTSTOPSDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "GradientStops Destruction"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1086,19 +1086,19 @@ class RecordedGradientStopsDestruction
   ReferencePtr mRefPtr;
 
   template 
-  MOZ_IMPLICIT RecordedGradientStopsDestruction(S &aStream);
+  MOZ_IMPLICIT RecordedGradientStopsDestruction(S& aStream);
 };
 
 class RecordedSnapshot : public RecordedEventDerived {
  public:
-  RecordedSnapshot(ReferencePtr aRefPtr, DrawTarget *aDT)
+  RecordedSnapshot(ReferencePtr aRefPtr, DrawTarget* aDT)
       : RecordedEventDerived(SNAPSHOT), mRefPtr(aRefPtr), mDT(aDT) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "Snapshot"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1110,13 +1110,13 @@ class RecordedSnapshot : public RecordedEventDerived {
   ReferencePtr mDT;
 
   template 
-  MOZ_IMPLICIT RecordedSnapshot(S &aStream);
+  MOZ_IMPLICIT RecordedSnapshot(S& aStream);
 };
 
 class RecordedIntoLuminanceSource
     : public RecordedEventDerived {
  public:
-  RecordedIntoLuminanceSource(ReferencePtr aRefPtr, DrawTarget *aDT,
+  RecordedIntoLuminanceSource(ReferencePtr aRefPtr, DrawTarget* aDT,
                               LuminanceType aLuminanceType, float aOpacity)
       : RecordedEventDerived(INTOLUMINANCE),
         mRefPtr(aRefPtr),
@@ -1124,11 +1124,11 @@ class RecordedIntoLuminanceSource
         mLuminanceType(aLuminanceType),
         mOpacity(aOpacity) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "IntoLuminanceSource"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1142,18 +1142,18 @@ class RecordedIntoLuminanceSource
   float mOpacity;
 
   template 
-  MOZ_IMPLICIT RecordedIntoLuminanceSource(S &aStream);
+  MOZ_IMPLICIT RecordedIntoLuminanceSource(S& aStream);
 };
 
 class RecordedFontData : public RecordedEventDerived {
  public:
-  static void FontDataProc(const uint8_t *aData, uint32_t aSize,
-                           uint32_t aIndex, void *aBaton) {
-    auto recordedFontData = static_cast(aBaton);
+  static void FontDataProc(const uint8_t* aData, uint32_t aSize,
+                           uint32_t aIndex, void* aBaton) {
+    auto recordedFontData = static_cast(aBaton);
     recordedFontData->SetFontData(aData, aSize, aIndex);
   }
 
-  explicit RecordedFontData(UnscaledFont *aUnscaledFont)
+  explicit RecordedFontData(UnscaledFont* aUnscaledFont)
       : RecordedEventDerived(FONTDATA),
         mType(aUnscaledFont->GetType()),
         mData(nullptr),
@@ -1166,42 +1166,42 @@ class RecordedFontData : public RecordedEventDerived {
 
   bool IsValid() const { return mGetFontFileDataSucceeded; }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "Font Data"; }
   ReferencePtr GetObjectRef() const override { return nullptr; };
 
-  void SetFontData(const uint8_t *aData, uint32_t aSize, uint32_t aIndex);
+  void SetFontData(const uint8_t* aData, uint32_t aSize, uint32_t aIndex);
 
-  bool GetFontDetails(RecordedFontDetails &fontDetails);
+  bool GetFontDetails(RecordedFontDetails& fontDetails);
 
  private:
   friend class RecordedEvent;
 
   FontType mType;
-  uint8_t *mData;
+  uint8_t* mData;
   RecordedFontDetails mFontDetails;
 
   bool mGetFontFileDataSucceeded;
 
   template 
-  MOZ_IMPLICIT RecordedFontData(S &aStream);
+  MOZ_IMPLICIT RecordedFontData(S& aStream);
 };
 
 class RecordedFontDescriptor
     : public RecordedEventDerived {
  public:
-  static void FontDescCb(const uint8_t *aData, uint32_t aSize, uint32_t aIndex,
-                         void *aBaton) {
-    auto recordedFontDesc = static_cast(aBaton);
+  static void FontDescCb(const uint8_t* aData, uint32_t aSize, uint32_t aIndex,
+                         void* aBaton) {
+    auto recordedFontDesc = static_cast(aBaton);
     recordedFontDesc->SetFontDescriptor(aData, aSize, aIndex);
   }
 
-  explicit RecordedFontDescriptor(UnscaledFont *aUnscaledFont)
+  explicit RecordedFontDescriptor(UnscaledFont* aUnscaledFont)
       : RecordedEventDerived(FONTDESC),
         mType(aUnscaledFont->GetType()),
         mIndex(0),
@@ -1213,11 +1213,11 @@ class RecordedFontDescriptor
 
   bool IsValid() const { return mHasDesc; }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "Font Desc"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1225,7 +1225,7 @@ class RecordedFontDescriptor
  private:
   friend class RecordedEvent;
 
-  void SetFontDescriptor(const uint8_t *aData, uint32_t aSize, uint32_t aIndex);
+  void SetFontDescriptor(const uint8_t* aData, uint32_t aSize, uint32_t aIndex);
 
   bool mHasDesc;
 
@@ -1235,20 +1235,20 @@ class RecordedFontDescriptor
   ReferencePtr mRefPtr;
 
   template 
-  MOZ_IMPLICIT RecordedFontDescriptor(S &aStream);
+  MOZ_IMPLICIT RecordedFontDescriptor(S& aStream);
 };
 
 class RecordedUnscaledFontCreation
     : public RecordedEventDerived {
  public:
-  static void FontInstanceDataProc(const uint8_t *aData, uint32_t aSize,
-                                   void *aBaton) {
+  static void FontInstanceDataProc(const uint8_t* aData, uint32_t aSize,
+                                   void* aBaton) {
     auto recordedUnscaledFontCreation =
-        static_cast(aBaton);
+        static_cast(aBaton);
     recordedUnscaledFontCreation->SetFontInstanceData(aData, aSize);
   }
 
-  RecordedUnscaledFontCreation(UnscaledFont *aUnscaledFont,
+  RecordedUnscaledFontCreation(UnscaledFont* aUnscaledFont,
                                RecordedFontDetails aFontDetails)
       : RecordedEventDerived(UNSCALEDFONTCREATION),
         mRefPtr(aUnscaledFont),
@@ -1257,16 +1257,16 @@ class RecordedUnscaledFontCreation
     aUnscaledFont->GetFontInstanceData(FontInstanceDataProc, this);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "UnscaledFont Creation"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
-  void SetFontInstanceData(const uint8_t *aData, uint32_t aSize);
+  void SetFontInstanceData(const uint8_t* aData, uint32_t aSize);
 
  private:
   friend class RecordedEvent;
@@ -1277,7 +1277,7 @@ class RecordedUnscaledFontCreation
   std::vector mInstanceData;
 
   template 
-  MOZ_IMPLICIT RecordedUnscaledFontCreation(S &aStream);
+  MOZ_IMPLICIT RecordedUnscaledFontCreation(S& aStream);
 };
 
 class RecordedUnscaledFontDestruction
@@ -1286,10 +1286,10 @@ class RecordedUnscaledFontDestruction
   MOZ_IMPLICIT RecordedUnscaledFontDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(UNSCALEDFONTDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "UnscaledFont Destruction"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1300,23 +1300,23 @@ class RecordedUnscaledFontDestruction
   ReferencePtr mRefPtr;
 
   template 
-  MOZ_IMPLICIT RecordedUnscaledFontDestruction(S &aStream);
+  MOZ_IMPLICIT RecordedUnscaledFontDestruction(S& aStream);
 };
 
 class RecordedScaledFontCreation
     : public RecordedEventDerived {
  public:
-  static void FontInstanceDataProc(const uint8_t *aData, uint32_t aSize,
-                                   const FontVariation *aVariations,
-                                   uint32_t aNumVariations, void *aBaton) {
+  static void FontInstanceDataProc(const uint8_t* aData, uint32_t aSize,
+                                   const FontVariation* aVariations,
+                                   uint32_t aNumVariations, void* aBaton) {
     auto recordedScaledFontCreation =
-        static_cast(aBaton);
+        static_cast(aBaton);
     recordedScaledFontCreation->SetFontInstanceData(aData, aSize, aVariations,
                                                     aNumVariations);
   }
 
-  RecordedScaledFontCreation(ScaledFont *aScaledFont,
-                             UnscaledFont *aUnscaledFont)
+  RecordedScaledFontCreation(ScaledFont* aScaledFont,
+                             UnscaledFont* aUnscaledFont)
       : RecordedEventDerived(SCALEDFONTCREATION),
         mRefPtr(aScaledFont),
         mUnscaledFont(aUnscaledFont),
@@ -1324,17 +1324,17 @@ class RecordedScaledFontCreation
     aScaledFont->GetFontInstanceData(FontInstanceDataProc, this);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "ScaledFont Creation"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
-  void SetFontInstanceData(const uint8_t *aData, uint32_t aSize,
-                           const FontVariation *aVariations,
+  void SetFontInstanceData(const uint8_t* aData, uint32_t aSize,
+                           const FontVariation* aVariations,
                            uint32_t aNumVariations);
 
  private:
@@ -1347,7 +1347,7 @@ class RecordedScaledFontCreation
   std::vector mVariations;
 
   template 
-  MOZ_IMPLICIT RecordedScaledFontCreation(S &aStream);
+  MOZ_IMPLICIT RecordedScaledFontCreation(S& aStream);
 };
 
 class RecordedScaledFontDestruction
@@ -1356,11 +1356,11 @@ class RecordedScaledFontDestruction
   MOZ_IMPLICIT RecordedScaledFontDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(SCALEDFONTDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "ScaledFont Destruction"; }
   ReferencePtr GetObjectRef() const override { return mRefPtr; }
@@ -1371,14 +1371,14 @@ class RecordedScaledFontDestruction
   ReferencePtr mRefPtr;
 
   template 
-  MOZ_IMPLICIT RecordedScaledFontDestruction(S &aStream);
+  MOZ_IMPLICIT RecordedScaledFontDestruction(S& aStream);
 };
 
 class RecordedMaskSurface : public RecordedDrawingEvent {
  public:
-  RecordedMaskSurface(DrawTarget *aDT, const Pattern &aPattern,
-                      ReferencePtr aRefMask, const Point &aOffset,
-                      const DrawOptions &aOptions)
+  RecordedMaskSurface(DrawTarget* aDT, const Pattern& aPattern,
+                      ReferencePtr aRefMask, const Point& aOffset,
+                      const DrawOptions& aOptions)
       : RecordedDrawingEvent(MASKSURFACE, aDT),
         mPattern(),
         mRefMask(aRefMask),
@@ -1387,11 +1387,11 @@ class RecordedMaskSurface : public RecordedDrawingEvent {
     StorePattern(mPattern, aPattern);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
 
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "MaskSurface"; }
 
@@ -1399,7 +1399,7 @@ class RecordedMaskSurface : public RecordedDrawingEvent {
   friend class RecordedEvent;
 
   template 
-  MOZ_IMPLICIT RecordedMaskSurface(S &aStream);
+  MOZ_IMPLICIT RecordedMaskSurface(S& aStream);
 
   PatternStorage mPattern;
   ReferencePtr mRefMask;
@@ -1428,7 +1428,7 @@ class RecordedFilterNodeSetAttribute
   };
 
   template 
-  RecordedFilterNodeSetAttribute(FilterNode *aNode, uint32_t aIndex,
+  RecordedFilterNodeSetAttribute(FilterNode* aNode, uint32_t aIndex,
                                  T aArgument, ArgType aArgType)
       : RecordedEventDerived(FILTERNODESETATTRIBUTE),
         mNode(aNode),
@@ -1438,8 +1438,8 @@ class RecordedFilterNodeSetAttribute
     memcpy(&mPayload.front(), &aArgument, sizeof(T));
   }
 
-  RecordedFilterNodeSetAttribute(FilterNode *aNode, uint32_t aIndex,
-                                 const Float *aFloat, uint32_t aSize)
+  RecordedFilterNodeSetAttribute(FilterNode* aNode, uint32_t aIndex,
+                                 const Float* aFloat, uint32_t aSize)
       : RecordedEventDerived(FILTERNODESETATTRIBUTE),
         mNode(aNode),
         mIndex(aIndex),
@@ -1448,10 +1448,10 @@ class RecordedFilterNodeSetAttribute
     memcpy(&mPayload.front(), aFloat, sizeof(Float) * aSize);
   }
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "SetAttribute"; }
   ReferencePtr GetObjectRef() const override { return mNode; }
@@ -1466,32 +1466,32 @@ class RecordedFilterNodeSetAttribute
   std::vector mPayload;
 
   template 
-  MOZ_IMPLICIT RecordedFilterNodeSetAttribute(S &aStream);
+  MOZ_IMPLICIT RecordedFilterNodeSetAttribute(S& aStream);
 };
 
 class RecordedFilterNodeSetInput
     : public RecordedEventDerived {
  public:
-  RecordedFilterNodeSetInput(FilterNode *aNode, uint32_t aIndex,
-                             FilterNode *aInputNode)
+  RecordedFilterNodeSetInput(FilterNode* aNode, uint32_t aIndex,
+                             FilterNode* aInputNode)
       : RecordedEventDerived(FILTERNODESETINPUT),
         mNode(aNode),
         mIndex(aIndex),
         mInputFilter(aInputNode),
         mInputSurface(nullptr) {}
 
-  RecordedFilterNodeSetInput(FilterNode *aNode, uint32_t aIndex,
-                             SourceSurface *aInputSurface)
+  RecordedFilterNodeSetInput(FilterNode* aNode, uint32_t aIndex,
+                             SourceSurface* aInputSurface)
       : RecordedEventDerived(FILTERNODESETINPUT),
         mNode(aNode),
         mIndex(aIndex),
         mInputFilter(nullptr),
         mInputSurface(aInputSurface) {}
 
-  bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator* aTranslator) const override;
   template 
-  void Record(S &aStream) const;
-  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+  void Record(S& aStream) const;
+  void OutputSimpleEventInfo(std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "SetInput"; }
   ReferencePtr GetObjectRef() const override { return mNode; }
@@ -1505,7 +1505,7 @@ class RecordedFilterNodeSetInput
   ReferencePtr mInputSurface;
 
   template 
-  MOZ_IMPLICIT RecordedFilterNodeSetInput(S &aStream);
+  MOZ_IMPLICIT RecordedFilterNodeSetInput(S& aStream);
 };
 
 static std::string NameFromBackend(BackendType aType) {
@@ -1520,30 +1520,30 @@ static std::string NameFromBackend(BackendType aType) {
 }
 
 template 
-void RecordedEvent::RecordPatternData(S &aStream,
-                                      const PatternStorage &aPattern) const {
+void RecordedEvent::RecordPatternData(S& aStream,
+                                      const PatternStorage& aPattern) const {
   WriteElement(aStream, aPattern.mType);
 
   switch (aPattern.mType) {
     case PatternType::COLOR: {
-      WriteElement(aStream, *reinterpret_cast(
+      WriteElement(aStream, *reinterpret_cast(
                                 &aPattern.mStorage));
       return;
     }
     case PatternType::LINEAR_GRADIENT: {
       WriteElement(aStream,
-                   *reinterpret_cast(
+                   *reinterpret_cast(
                        &aPattern.mStorage));
       return;
     }
     case PatternType::RADIAL_GRADIENT: {
       WriteElement(aStream,
-                   *reinterpret_cast(
+                   *reinterpret_cast(
                        &aPattern.mStorage));
       return;
     }
     case PatternType::SURFACE: {
-      WriteElement(aStream, *reinterpret_cast(
+      WriteElement(aStream, *reinterpret_cast(
                                 &aPattern.mStorage));
       return;
     }
@@ -1553,28 +1553,28 @@ void RecordedEvent::RecordPatternData(S &aStream,
 }
 
 template 
-void RecordedEvent::ReadPatternData(S &aStream,
-                                    PatternStorage &aPattern) const {
+void RecordedEvent::ReadPatternData(S& aStream,
+                                    PatternStorage& aPattern) const {
   ReadElement(aStream, aPattern.mType);
 
   switch (aPattern.mType) {
     case PatternType::COLOR: {
       ReadElement(aStream,
-                  *reinterpret_cast(&aPattern.mStorage));
+                  *reinterpret_cast(&aPattern.mStorage));
       return;
     }
     case PatternType::LINEAR_GRADIENT: {
-      ReadElement(aStream, *reinterpret_cast(
+      ReadElement(aStream, *reinterpret_cast(
                                &aPattern.mStorage));
       return;
     }
     case PatternType::RADIAL_GRADIENT: {
-      ReadElement(aStream, *reinterpret_cast(
+      ReadElement(aStream, *reinterpret_cast(
                                &aPattern.mStorage));
       return;
     }
     case PatternType::SURFACE: {
-      ReadElement(aStream, *reinterpret_cast(
+      ReadElement(aStream, *reinterpret_cast(
                                &aPattern.mStorage));
       return;
     }
@@ -1583,22 +1583,22 @@ void RecordedEvent::ReadPatternData(S &aStream,
   }
 }
 
-inline void RecordedEvent::StorePattern(PatternStorage &aDestination,
-                                        const Pattern &aSource) const {
+inline void RecordedEvent::StorePattern(PatternStorage& aDestination,
+                                        const Pattern& aSource) const {
   aDestination.mType = aSource.GetType();
 
   switch (aSource.GetType()) {
     case PatternType::COLOR: {
-      reinterpret_cast(&aDestination.mStorage)->mColor =
-          static_cast(&aSource)->mColor;
+      reinterpret_cast(&aDestination.mStorage)->mColor =
+          static_cast(&aSource)->mColor;
       return;
     }
     case PatternType::LINEAR_GRADIENT: {
-      LinearGradientPatternStorage *store =
-          reinterpret_cast(
+      LinearGradientPatternStorage* store =
+          reinterpret_cast(
               &aDestination.mStorage);
-      const LinearGradientPattern *pat =
-          static_cast(&aSource);
+      const LinearGradientPattern* pat =
+          static_cast(&aSource);
       store->mBegin = pat->mBegin;
       store->mEnd = pat->mEnd;
       store->mMatrix = pat->mMatrix;
@@ -1606,11 +1606,11 @@ inline void RecordedEvent::StorePattern(PatternStorage &aDestination,
       return;
     }
     case PatternType::RADIAL_GRADIENT: {
-      RadialGradientPatternStorage *store =
-          reinterpret_cast(
+      RadialGradientPatternStorage* store =
+          reinterpret_cast(
               &aDestination.mStorage);
-      const RadialGradientPattern *pat =
-          static_cast(&aSource);
+      const RadialGradientPattern* pat =
+          static_cast(&aSource);
       store->mCenter1 = pat->mCenter1;
       store->mCenter2 = pat->mCenter2;
       store->mRadius1 = pat->mRadius1;
@@ -1620,9 +1620,9 @@ inline void RecordedEvent::StorePattern(PatternStorage &aDestination,
       return;
     }
     case PatternType::SURFACE: {
-      SurfacePatternStorage *store =
-          reinterpret_cast(&aDestination.mStorage);
-      const SurfacePattern *pat = static_cast(&aSource);
+      SurfacePatternStorage* store =
+          reinterpret_cast(&aDestination.mStorage);
+      const SurfacePattern* pat = static_cast(&aSource);
       store->mExtend = pat->mExtendMode;
       store->mSamplingFilter = pat->mSamplingFilter;
       store->mMatrix = pat->mMatrix;
@@ -1635,7 +1635,7 @@ inline void RecordedEvent::StorePattern(PatternStorage &aDestination,
 
 template 
 void RecordedEvent::RecordStrokeOptions(
-    S &aStream, const StrokeOptions &aStrokeOptions) const {
+    S& aStream, const StrokeOptions& aStrokeOptions) const {
   JoinStyle joinStyle = aStrokeOptions.mLineJoin;
   CapStyle capStyle = aStrokeOptions.mLineCap;
 
@@ -1650,13 +1650,13 @@ void RecordedEvent::RecordStrokeOptions(
     return;
   }
 
-  aStream.write((char *)aStrokeOptions.mDashPattern,
+  aStream.write((char*)aStrokeOptions.mDashPattern,
                 sizeof(Float) * aStrokeOptions.mDashLength);
 }
 
 template 
-void RecordedEvent::ReadStrokeOptions(S &aStream,
-                                      StrokeOptions &aStrokeOptions) {
+void RecordedEvent::ReadStrokeOptions(S& aStream,
+                                      StrokeOptions& aStrokeOptions) {
   uint64_t dashLength;
   JoinStyle joinStyle;
   CapStyle capStyle;
@@ -1679,24 +1679,24 @@ void RecordedEvent::ReadStrokeOptions(S &aStream,
 
   mDashPatternStorage.resize(aStrokeOptions.mDashLength);
   aStrokeOptions.mDashPattern = &mDashPatternStorage.front();
-  aStream.read((char *)aStrokeOptions.mDashPattern,
+  aStream.read((char*)aStrokeOptions.mDashPattern,
                sizeof(Float) * aStrokeOptions.mDashLength);
 }
 
 inline void RecordedEvent::OutputSimplePatternInfo(
-    const PatternStorage &aStorage, std::stringstream &aOutput) const {
+    const PatternStorage& aStorage, std::stringstream& aOutput) const {
   switch (aStorage.mType) {
     case PatternType::COLOR: {
       const Color color =
-          reinterpret_cast(&aStorage.mStorage)
+          reinterpret_cast(&aStorage.mStorage)
               ->mColor;
       aOutput << "Color: (" << color.r << ", " << color.g << ", " << color.b
               << ", " << color.a << ")";
       return;
     }
     case PatternType::LINEAR_GRADIENT: {
-      const LinearGradientPatternStorage *store =
-          reinterpret_cast(
+      const LinearGradientPatternStorage* store =
+          reinterpret_cast(
               &aStorage.mStorage);
 
       aOutput << "LinearGradient (" << store->mBegin.x << ", "
@@ -1705,16 +1705,16 @@ inline void RecordedEvent::OutputSimplePatternInfo(
       return;
     }
     case PatternType::RADIAL_GRADIENT: {
-      const RadialGradientPatternStorage *store =
-          reinterpret_cast(
+      const RadialGradientPatternStorage* store =
+          reinterpret_cast(
               &aStorage.mStorage);
       aOutput << "RadialGradient (Center 1: (" << store->mCenter1.x << ", "
               << store->mCenter2.y << ") Radius 2: " << store->mRadius2;
       return;
     }
     case PatternType::SURFACE: {
-      const SurfacePatternStorage *store =
-          reinterpret_cast(&aStorage.mStorage);
+      const SurfacePatternStorage* store =
+          reinterpret_cast(&aStorage.mStorage);
       aOutput << "Surface (0x" << store->mSurface << ")";
       return;
     }
@@ -1724,14 +1724,14 @@ inline void RecordedEvent::OutputSimplePatternInfo(
 template 
 template 
 RecordedDrawingEvent::RecordedDrawingEvent(RecordedEvent::EventType aType,
-                                              S &aStream)
+                                              S& aStream)
     : RecordedEventDerived(aType) {
   ReadElement(aStream, mDT);
 }
 
 template 
 template 
-void RecordedDrawingEvent::Record(S &aStream) const {
+void RecordedDrawingEvent::Record(S& aStream) const {
   WriteElement(aStream, mDT);
 }
 
@@ -1741,7 +1741,7 @@ ReferencePtr RecordedDrawingEvent::GetObjectRef() const {
 }
 
 inline bool RecordedDrawTargetCreation::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   RefPtr newDT =
       aTranslator->CreateDrawTarget(mRefPtr, mSize, mFormat);
 
@@ -1761,7 +1761,7 @@ inline bool RecordedDrawTargetCreation::PlayEvent(
 }
 
 template 
-void RecordedDrawTargetCreation::Record(S &aStream) const {
+void RecordedDrawTargetCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mBackendType);
   WriteElement(aStream, mSize);
@@ -1775,14 +1775,14 @@ void RecordedDrawTargetCreation::Record(S &aStream) const {
 
     DataSourceSurface::ScopedMap map(dataSurf, DataSourceSurface::READ);
     for (int y = 0; y < mSize.height; y++) {
-      aStream.write((const char *)map.GetData() + y * map.GetStride(),
+      aStream.write((const char*)map.GetData() + y * map.GetStride(),
                     BytesPerPixel(mFormat) * mSize.width);
     }
   }
 }
 
 template 
-RecordedDrawTargetCreation::RecordedDrawTargetCreation(S &aStream)
+RecordedDrawTargetCreation::RecordedDrawTargetCreation(S& aStream)
     : RecordedEventDerived(DRAWTARGETCREATION), mExistingData(nullptr) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mBackendType);
@@ -1802,7 +1802,7 @@ RecordedDrawTargetCreation::RecordedDrawTargetCreation(S &aStream)
 
     DataSourceSurface::ScopedMap map(dataSurf, DataSourceSurface::READ);
     for (int y = 0; y < mSize.height; y++) {
-      aStream.read((char *)map.GetData() + y * map.GetStride(),
+      aStream.read((char*)map.GetData() + y * map.GetStride(),
                    BytesPerPixel(mFormat) * mSize.width);
     }
     mExistingData = dataSurf;
@@ -1810,36 +1810,36 @@ RecordedDrawTargetCreation::RecordedDrawTargetCreation(S &aStream)
 }
 
 inline void RecordedDrawTargetCreation::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] DrawTarget Creation (Type: "
                 << NameFromBackend(mBackendType) << ", Size: " << mSize.width
                 << "x" << mSize.height << ")";
 }
 
 inline bool RecordedDrawTargetDestruction::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   aTranslator->RemoveDrawTarget(mRefPtr);
   return true;
 }
 
 template 
-void RecordedDrawTargetDestruction::Record(S &aStream) const {
+void RecordedDrawTargetDestruction::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
 }
 
 template 
-RecordedDrawTargetDestruction::RecordedDrawTargetDestruction(S &aStream)
+RecordedDrawTargetDestruction::RecordedDrawTargetDestruction(S& aStream)
     : RecordedEventDerived(DRAWTARGETDESTRUCTION) {
   ReadElement(aStream, mRefPtr);
 }
 
 inline void RecordedDrawTargetDestruction::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] DrawTarget Destruction";
 }
 
 inline bool RecordedCreateSimilarDrawTarget::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   RefPtr newDT =
       aTranslator->GetReferenceDrawTarget()->CreateSimilarDrawTarget(mSize,
                                                                      mFormat);
@@ -1855,14 +1855,14 @@ inline bool RecordedCreateSimilarDrawTarget::PlayEvent(
 }
 
 template 
-void RecordedCreateSimilarDrawTarget::Record(S &aStream) const {
+void RecordedCreateSimilarDrawTarget::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mSize);
   WriteElement(aStream, mFormat);
 }
 
 template 
-RecordedCreateSimilarDrawTarget::RecordedCreateSimilarDrawTarget(S &aStream)
+RecordedCreateSimilarDrawTarget::RecordedCreateSimilarDrawTarget(S& aStream)
     : RecordedEventDerived(CREATESIMILARDRAWTARGET) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mSize);
@@ -1870,14 +1870,14 @@ RecordedCreateSimilarDrawTarget::RecordedCreateSimilarDrawTarget(S &aStream)
 }
 
 inline void RecordedCreateSimilarDrawTarget::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr
                 << "] CreateSimilarDrawTarget (Size: " << mSize.width << "x"
                 << mSize.height << ")";
 }
 
 inline bool RecordedCreateDrawTargetForFilter::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   IntRect baseRect = aTranslator->LookupDrawTarget(mDT)->GetRect();
 
   auto maxRect = IntRect(IntPoint(0, 0), mMaxSize);
@@ -1933,7 +1933,7 @@ inline bool RecordedCreateDrawTargetForFilter::PlayEvent(
 }
 
 inline bool RecordedCreateClippedDrawTarget::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   const IntRect baseRect = aTranslator->GetReferenceDrawTarget()->GetRect();
   const IntRect transformedRect = RoundedToInt(
       mTransform.Inverse().TransformBounds(IntRectToRect(baseRect)));
@@ -1963,7 +1963,7 @@ inline bool RecordedCreateClippedDrawTarget::PlayEvent(
 }
 
 template 
-void RecordedCreateClippedDrawTarget::Record(S &aStream) const {
+void RecordedCreateClippedDrawTarget::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mMaxSize);
   WriteElement(aStream, mTransform);
@@ -1971,7 +1971,7 @@ void RecordedCreateClippedDrawTarget::Record(S &aStream) const {
 }
 
 template 
-RecordedCreateClippedDrawTarget::RecordedCreateClippedDrawTarget(S &aStream)
+RecordedCreateClippedDrawTarget::RecordedCreateClippedDrawTarget(S& aStream)
     : RecordedEventDerived(CREATECLIPPEDDRAWTARGET) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mMaxSize);
@@ -1980,12 +1980,12 @@ RecordedCreateClippedDrawTarget::RecordedCreateClippedDrawTarget(S &aStream)
 }
 
 inline void RecordedCreateClippedDrawTarget::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] CreateClippedDrawTarget ()";
 }
 
 template 
-void RecordedCreateDrawTargetForFilter::Record(S &aStream) const {
+void RecordedCreateDrawTargetForFilter::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mMaxSize);
@@ -1997,7 +1997,7 @@ void RecordedCreateDrawTargetForFilter::Record(S &aStream) const {
 }
 
 template 
-RecordedCreateDrawTargetForFilter::RecordedCreateDrawTargetForFilter(S &aStream)
+RecordedCreateDrawTargetForFilter::RecordedCreateDrawTargetForFilter(S& aStream)
     : RecordedDrawingEvent(CREATEDRAWTARGETFORFILTER, aStream) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mMaxSize);
@@ -2009,14 +2009,14 @@ RecordedCreateDrawTargetForFilter::RecordedCreateDrawTargetForFilter(S &aStream)
 }
 
 inline void RecordedCreateDrawTargetForFilter::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] CreateDrawTargetForFilter ()";
 }
 
 struct GenericPattern {
-  GenericPattern(const PatternStorage &aStorage, Translator *aTranslator)
+  GenericPattern(const PatternStorage& aStorage, Translator* aTranslator)
       : mPattern(nullptr), mTranslator(aTranslator) {
-    mStorage = const_cast(&aStorage);
+    mStorage = const_cast(&aStorage);
   }
 
   ~GenericPattern() {
@@ -2025,15 +2025,15 @@ struct GenericPattern {
     }
   }
 
-  operator Pattern *() {
+  operator Pattern*() {
     switch (mStorage->mType) {
       case PatternType::COLOR:
         return new (mColPat) ColorPattern(
-            reinterpret_cast(&mStorage->mStorage)
+            reinterpret_cast(&mStorage->mStorage)
                 ->mColor);
       case PatternType::SURFACE: {
-        SurfacePatternStorage *storage =
-            reinterpret_cast(&mStorage->mStorage);
+        SurfacePatternStorage* storage =
+            reinterpret_cast(&mStorage->mStorage);
         mPattern = new (mSurfPat)
             SurfacePattern(mTranslator->LookupSourceSurface(storage->mSurface),
                            storage->mExtend, storage->mMatrix,
@@ -2041,8 +2041,8 @@ struct GenericPattern {
         return mPattern;
       }
       case PatternType::LINEAR_GRADIENT: {
-        LinearGradientPatternStorage *storage =
-            reinterpret_cast(
+        LinearGradientPatternStorage* storage =
+            reinterpret_cast(
                 &mStorage->mStorage);
         mPattern = new (mLinGradPat) LinearGradientPattern(
             storage->mBegin, storage->mEnd,
@@ -2051,8 +2051,8 @@ struct GenericPattern {
         return mPattern;
       }
       case PatternType::RADIAL_GRADIENT: {
-        RadialGradientPatternStorage *storage =
-            reinterpret_cast(
+        RadialGradientPatternStorage* storage =
+            reinterpret_cast(
                 &mStorage->mStorage);
         mPattern = new (mRadGradPat) RadialGradientPattern(
             storage->mCenter1, storage->mCenter2, storage->mRadius1,
@@ -2075,19 +2075,19 @@ struct GenericPattern {
     char mSurfPat[sizeof(SurfacePattern)];
   };
 
-  PatternStorage *mStorage;
-  Pattern *mPattern;
-  Translator *mTranslator;
+  PatternStorage* mStorage;
+  Pattern* mPattern;
+  Translator* mTranslator;
 };
 
-inline bool RecordedFillRect::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedFillRect::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->FillRect(
       mRect, *GenericPattern(mPattern, aTranslator), mOptions);
   return true;
 }
 
 template 
-void RecordedFillRect::Record(S &aStream) const {
+void RecordedFillRect::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mRect);
   WriteElement(aStream, mOptions);
@@ -2095,7 +2095,7 @@ void RecordedFillRect::Record(S &aStream) const {
 }
 
 template 
-RecordedFillRect::RecordedFillRect(S &aStream)
+RecordedFillRect::RecordedFillRect(S& aStream)
     : RecordedDrawingEvent(FILLRECT, aStream) {
   ReadElement(aStream, mRect);
   ReadElement(aStream, mOptions);
@@ -2103,21 +2103,21 @@ RecordedFillRect::RecordedFillRect(S &aStream)
 }
 
 inline void RecordedFillRect::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] FillRect (" << mRect.X() << ", "
                 << mRect.Y() << " - " << mRect.Width() << " x "
                 << mRect.Height() << ") ";
   OutputSimplePatternInfo(mPattern, aStringStream);
 }
 
-inline bool RecordedStrokeRect::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedStrokeRect::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->StrokeRect(
       mRect, *GenericPattern(mPattern, aTranslator), mStrokeOptions, mOptions);
   return true;
 }
 
 template 
-void RecordedStrokeRect::Record(S &aStream) const {
+void RecordedStrokeRect::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mRect);
   WriteElement(aStream, mOptions);
@@ -2126,7 +2126,7 @@ void RecordedStrokeRect::Record(S &aStream) const {
 }
 
 template 
-RecordedStrokeRect::RecordedStrokeRect(S &aStream)
+RecordedStrokeRect::RecordedStrokeRect(S& aStream)
     : RecordedDrawingEvent(STROKERECT, aStream) {
   ReadElement(aStream, mRect);
   ReadElement(aStream, mOptions);
@@ -2135,7 +2135,7 @@ RecordedStrokeRect::RecordedStrokeRect(S &aStream)
 }
 
 inline void RecordedStrokeRect::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] StrokeRect (" << mRect.X() << ", "
                 << mRect.Y() << " - " << mRect.Width() << " x "
                 << mRect.Height()
@@ -2143,7 +2143,7 @@ inline void RecordedStrokeRect::OutputSimpleEventInfo(
   OutputSimplePatternInfo(mPattern, aStringStream);
 }
 
-inline bool RecordedStrokeLine::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedStrokeLine::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->StrokeLine(
       mBegin, mEnd, *GenericPattern(mPattern, aTranslator), mStrokeOptions,
       mOptions);
@@ -2151,7 +2151,7 @@ inline bool RecordedStrokeLine::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-void RecordedStrokeLine::Record(S &aStream) const {
+void RecordedStrokeLine::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mBegin);
   WriteElement(aStream, mEnd);
@@ -2161,7 +2161,7 @@ void RecordedStrokeLine::Record(S &aStream) const {
 }
 
 template 
-RecordedStrokeLine::RecordedStrokeLine(S &aStream)
+RecordedStrokeLine::RecordedStrokeLine(S& aStream)
     : RecordedDrawingEvent(STROKELINE, aStream) {
   ReadElement(aStream, mBegin);
   ReadElement(aStream, mEnd);
@@ -2171,14 +2171,14 @@ RecordedStrokeLine::RecordedStrokeLine(S &aStream)
 }
 
 inline void RecordedStrokeLine::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] StrokeLine (" << mBegin.x << ", "
                 << mBegin.y << " - " << mEnd.x << ", " << mEnd.y
                 << ") LineWidth: " << mStrokeOptions.mLineWidth << "px ";
   OutputSimplePatternInfo(mPattern, aStringStream);
 }
 
-inline bool RecordedFill::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedFill::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->Fill(
       aTranslator->LookupPath(mPath), *GenericPattern(mPattern, aTranslator),
       mOptions);
@@ -2186,14 +2186,14 @@ inline bool RecordedFill::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-RecordedFill::RecordedFill(S &aStream) : RecordedDrawingEvent(FILL, aStream) {
+RecordedFill::RecordedFill(S& aStream) : RecordedDrawingEvent(FILL, aStream) {
   ReadElement(aStream, mPath);
   ReadElement(aStream, mOptions);
   ReadPatternData(aStream, mPattern);
 }
 
 template 
-void RecordedFill::Record(S &aStream) const {
+void RecordedFill::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mPath);
   WriteElement(aStream, mOptions);
@@ -2201,14 +2201,14 @@ void RecordedFill::Record(S &aStream) const {
 }
 
 inline void RecordedFill::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] Fill (" << mPath << ") ";
   OutputSimplePatternInfo(mPattern, aStringStream);
 }
 
 inline RecordedFillGlyphs::~RecordedFillGlyphs() { delete[] mGlyphs; }
 
-inline bool RecordedFillGlyphs::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedFillGlyphs::PlayEvent(Translator* aTranslator) const {
   GlyphBuffer buffer;
   buffer.mGlyphs = mGlyphs;
   buffer.mNumGlyphs = mNumGlyphs;
@@ -2219,33 +2219,33 @@ inline bool RecordedFillGlyphs::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-RecordedFillGlyphs::RecordedFillGlyphs(S &aStream)
+RecordedFillGlyphs::RecordedFillGlyphs(S& aStream)
     : RecordedDrawingEvent(FILLGLYPHS, aStream) {
   ReadElement(aStream, mScaledFont);
   ReadElement(aStream, mOptions);
   ReadPatternData(aStream, mPattern);
   ReadElement(aStream, mNumGlyphs);
   mGlyphs = new Glyph[mNumGlyphs];
-  aStream.read((char *)mGlyphs, sizeof(Glyph) * mNumGlyphs);
+  aStream.read((char*)mGlyphs, sizeof(Glyph) * mNumGlyphs);
 }
 
 template 
-void RecordedFillGlyphs::Record(S &aStream) const {
+void RecordedFillGlyphs::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mScaledFont);
   WriteElement(aStream, mOptions);
   RecordPatternData(aStream, mPattern);
   WriteElement(aStream, mNumGlyphs);
-  aStream.write((char *)mGlyphs, sizeof(Glyph) * mNumGlyphs);
+  aStream.write((char*)mGlyphs, sizeof(Glyph) * mNumGlyphs);
 }
 
 inline void RecordedFillGlyphs::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] FillGlyphs (" << mScaledFont << ") ";
   OutputSimplePatternInfo(mPattern, aStringStream);
 }
 
-inline bool RecordedMask::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedMask::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->Mask(
       *GenericPattern(mSource, aTranslator),
       *GenericPattern(mMask, aTranslator), mOptions);
@@ -2253,14 +2253,14 @@ inline bool RecordedMask::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-RecordedMask::RecordedMask(S &aStream) : RecordedDrawingEvent(MASK, aStream) {
+RecordedMask::RecordedMask(S& aStream) : RecordedDrawingEvent(MASK, aStream) {
   ReadElement(aStream, mOptions);
   ReadPatternData(aStream, mSource);
   ReadPatternData(aStream, mMask);
 }
 
 template 
-void RecordedMask::Record(S &aStream) const {
+void RecordedMask::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mOptions);
   RecordPatternData(aStream, mSource);
@@ -2268,14 +2268,14 @@ void RecordedMask::Record(S &aStream) const {
 }
 
 inline void RecordedMask::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] Mask (Source: ";
   OutputSimplePatternInfo(mSource, aStringStream);
   aStringStream << " Mask: ";
   OutputSimplePatternInfo(mMask, aStringStream);
 }
 
-inline bool RecordedStroke::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedStroke::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->Stroke(
       aTranslator->LookupPath(mPath), *GenericPattern(mPattern, aTranslator),
       mStrokeOptions, mOptions);
@@ -2283,7 +2283,7 @@ inline bool RecordedStroke::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-void RecordedStroke::Record(S &aStream) const {
+void RecordedStroke::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mPath);
   WriteElement(aStream, mOptions);
@@ -2292,7 +2292,7 @@ void RecordedStroke::Record(S &aStream) const {
 }
 
 template 
-RecordedStroke::RecordedStroke(S &aStream)
+RecordedStroke::RecordedStroke(S& aStream)
     : RecordedDrawingEvent(STROKE, aStream) {
   ReadElement(aStream, mPath);
   ReadElement(aStream, mOptions);
@@ -2301,44 +2301,44 @@ RecordedStroke::RecordedStroke(S &aStream)
 }
 
 inline void RecordedStroke::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] Stroke (" << mPath
                 << ") LineWidth: " << mStrokeOptions.mLineWidth << "px ";
   OutputSimplePatternInfo(mPattern, aStringStream);
 }
 
-inline bool RecordedClearRect::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedClearRect::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->ClearRect(mRect);
   return true;
 }
 
 template 
-void RecordedClearRect::Record(S &aStream) const {
+void RecordedClearRect::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mRect);
 }
 
 template 
-RecordedClearRect::RecordedClearRect(S &aStream)
+RecordedClearRect::RecordedClearRect(S& aStream)
     : RecordedDrawingEvent(CLEARRECT, aStream) {
   ReadElement(aStream, mRect);
 }
 
 inline void RecordedClearRect::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] ClearRect (" << mRect.X() << ", "
                 << mRect.Y() << " - " << mRect.Width() << " x "
                 << mRect.Height() << ") ";
 }
 
-inline bool RecordedCopySurface::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedCopySurface::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->CopySurface(
       aTranslator->LookupSourceSurface(mSourceSurface), mSourceRect, mDest);
   return true;
 }
 
 template 
-void RecordedCopySurface::Record(S &aStream) const {
+void RecordedCopySurface::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mSourceSurface);
   WriteElement(aStream, mSourceRect);
@@ -2346,7 +2346,7 @@ void RecordedCopySurface::Record(S &aStream) const {
 }
 
 template 
-RecordedCopySurface::RecordedCopySurface(S &aStream)
+RecordedCopySurface::RecordedCopySurface(S& aStream)
     : RecordedDrawingEvent(COPYSURFACE, aStream) {
   ReadElement(aStream, mSourceSurface);
   ReadElement(aStream, mSourceRect);
@@ -2354,77 +2354,77 @@ RecordedCopySurface::RecordedCopySurface(S &aStream)
 }
 
 inline void RecordedCopySurface::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] CopySurface (" << mSourceSurface << ")";
 }
 
-inline bool RecordedPushClip::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedPushClip::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->PushClip(aTranslator->LookupPath(mPath));
   return true;
 }
 
 template 
-void RecordedPushClip::Record(S &aStream) const {
+void RecordedPushClip::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mPath);
 }
 
 template 
-RecordedPushClip::RecordedPushClip(S &aStream)
+RecordedPushClip::RecordedPushClip(S& aStream)
     : RecordedDrawingEvent(PUSHCLIP, aStream) {
   ReadElement(aStream, mPath);
 }
 
 inline void RecordedPushClip::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] PushClip (" << mPath << ") ";
 }
 
-inline bool RecordedPushClipRect::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedPushClipRect::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->PushClipRect(mRect);
   return true;
 }
 
 template 
-void RecordedPushClipRect::Record(S &aStream) const {
+void RecordedPushClipRect::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mRect);
 }
 
 template 
-RecordedPushClipRect::RecordedPushClipRect(S &aStream)
+RecordedPushClipRect::RecordedPushClipRect(S& aStream)
     : RecordedDrawingEvent(PUSHCLIPRECT, aStream) {
   ReadElement(aStream, mRect);
 }
 
 inline void RecordedPushClipRect::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] PushClipRect (" << mRect.X() << ", "
                 << mRect.Y() << " - " << mRect.Width() << " x "
                 << mRect.Height() << ") ";
 }
 
-inline bool RecordedPopClip::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedPopClip::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->PopClip();
   return true;
 }
 
 template 
-void RecordedPopClip::Record(S &aStream) const {
+void RecordedPopClip::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
 }
 
 template 
-RecordedPopClip::RecordedPopClip(S &aStream)
+RecordedPopClip::RecordedPopClip(S& aStream)
     : RecordedDrawingEvent(POPCLIP, aStream) {}
 
 inline void RecordedPopClip::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] PopClip";
 }
 
-inline bool RecordedPushLayer::PlayEvent(Translator *aTranslator) const {
-  SourceSurface *mask =
+inline bool RecordedPushLayer::PlayEvent(Translator* aTranslator) const {
+  SourceSurface* mask =
       mMask ? aTranslator->LookupSourceSurface(mMask) : nullptr;
   aTranslator->LookupDrawTarget(mDT)->PushLayer(
       mOpaque, mOpacity, mask, mMaskTransform, mBounds, mCopyBackground);
@@ -2432,7 +2432,7 @@ inline bool RecordedPushLayer::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-void RecordedPushLayer::Record(S &aStream) const {
+void RecordedPushLayer::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mOpaque);
   WriteElement(aStream, mOpacity);
@@ -2443,7 +2443,7 @@ void RecordedPushLayer::Record(S &aStream) const {
 }
 
 template 
-RecordedPushLayer::RecordedPushLayer(S &aStream)
+RecordedPushLayer::RecordedPushLayer(S& aStream)
     : RecordedDrawingEvent(PUSHLAYER, aStream) {
   ReadElement(aStream, mOpaque);
   ReadElement(aStream, mOpacity);
@@ -2454,14 +2454,14 @@ RecordedPushLayer::RecordedPushLayer(S &aStream)
 }
 
 inline void RecordedPushLayer::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] PushPLayer (Opaque=" << mOpaque
                 << ", Opacity=" << mOpacity << ", Mask Ref=" << mMask << ") ";
 }
 
 inline bool RecordedPushLayerWithBlend::PlayEvent(
-    Translator *aTranslator) const {
-  SourceSurface *mask =
+    Translator* aTranslator) const {
+  SourceSurface* mask =
       mMask ? aTranslator->LookupSourceSurface(mMask) : nullptr;
   aTranslator->LookupDrawTarget(mDT)->PushLayerWithBlend(
       mOpaque, mOpacity, mask, mMaskTransform, mBounds, mCopyBackground,
@@ -2470,7 +2470,7 @@ inline bool RecordedPushLayerWithBlend::PlayEvent(
 }
 
 template 
-void RecordedPushLayerWithBlend::Record(S &aStream) const {
+void RecordedPushLayerWithBlend::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mOpaque);
   WriteElement(aStream, mOpacity);
@@ -2482,7 +2482,7 @@ void RecordedPushLayerWithBlend::Record(S &aStream) const {
 }
 
 template 
-RecordedPushLayerWithBlend::RecordedPushLayerWithBlend(S &aStream)
+RecordedPushLayerWithBlend::RecordedPushLayerWithBlend(S& aStream)
     : RecordedDrawingEvent(PUSHLAYERWITHBLEND, aStream) {
   ReadElement(aStream, mOpaque);
   ReadElement(aStream, mOpacity);
@@ -2494,56 +2494,56 @@ RecordedPushLayerWithBlend::RecordedPushLayerWithBlend(S &aStream)
 }
 
 inline void RecordedPushLayerWithBlend::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] PushLayerWithBlend (Opaque=" << mOpaque
                 << ", Opacity=" << mOpacity << ", Mask Ref=" << mMask << ") ";
 }
 
-inline bool RecordedPopLayer::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedPopLayer::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->PopLayer();
   return true;
 }
 
 template 
-void RecordedPopLayer::Record(S &aStream) const {
+void RecordedPopLayer::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
 }
 
 template 
-RecordedPopLayer::RecordedPopLayer(S &aStream)
+RecordedPopLayer::RecordedPopLayer(S& aStream)
     : RecordedDrawingEvent(POPLAYER, aStream) {}
 
 inline void RecordedPopLayer::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] PopLayer";
 }
 
-inline bool RecordedSetTransform::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedSetTransform::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->SetTransform(mTransform);
   return true;
 }
 
 template 
-void RecordedSetTransform::Record(S &aStream) const {
+void RecordedSetTransform::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mTransform);
 }
 
 template 
-RecordedSetTransform::RecordedSetTransform(S &aStream)
+RecordedSetTransform::RecordedSetTransform(S& aStream)
     : RecordedDrawingEvent(SETTRANSFORM, aStream) {
   ReadElement(aStream, mTransform);
 }
 
 inline void RecordedSetTransform::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] SetTransform [ " << mTransform._11 << " "
                 << mTransform._12 << " ; " << mTransform._21 << " "
                 << mTransform._22 << " ; " << mTransform._31 << " "
                 << mTransform._32 << " ]";
 }
 
-inline bool RecordedDrawSurface::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedDrawSurface::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->DrawSurface(
       aTranslator->LookupSourceSurface(mRefSource), mDest, mSource, mDSOptions,
       mOptions);
@@ -2551,7 +2551,7 @@ inline bool RecordedDrawSurface::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-void RecordedDrawSurface::Record(S &aStream) const {
+void RecordedDrawSurface::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mRefSource);
   WriteElement(aStream, mDest);
@@ -2561,7 +2561,7 @@ void RecordedDrawSurface::Record(S &aStream) const {
 }
 
 template 
-RecordedDrawSurface::RecordedDrawSurface(S &aStream)
+RecordedDrawSurface::RecordedDrawSurface(S& aStream)
     : RecordedDrawingEvent(DRAWSURFACE, aStream) {
   ReadElement(aStream, mRefSource);
   ReadElement(aStream, mDest);
@@ -2571,12 +2571,12 @@ RecordedDrawSurface::RecordedDrawSurface(S &aStream)
 }
 
 inline void RecordedDrawSurface::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] DrawSurface (" << mRefSource << ")";
 }
 
 inline bool RecordedDrawDependentSurface::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   RefPtr surface(aTranslator->LookupExternalSurface(mId));
   aTranslator->LookupDrawTarget(mDT)->DrawSurface(
       surface, mDest, Rect(Point(), Size(surface->GetSize())), mDSOptions,
@@ -2585,7 +2585,7 @@ inline bool RecordedDrawDependentSurface::PlayEvent(
 }
 
 template 
-void RecordedDrawDependentSurface::Record(S &aStream) const {
+void RecordedDrawDependentSurface::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mId);
   WriteElement(aStream, mDest);
@@ -2594,7 +2594,7 @@ void RecordedDrawDependentSurface::Record(S &aStream) const {
 }
 
 template 
-RecordedDrawDependentSurface::RecordedDrawDependentSurface(S &aStream)
+RecordedDrawDependentSurface::RecordedDrawDependentSurface(S& aStream)
     : RecordedDrawingEvent(DRAWDEPENDENTSURFACE, aStream) {
   ReadElement(aStream, mId);
   ReadElement(aStream, mDest);
@@ -2603,18 +2603,18 @@ RecordedDrawDependentSurface::RecordedDrawDependentSurface(S &aStream)
 }
 
 inline void RecordedDrawDependentSurface::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] DrawDependentSurface (" << mId << ")";
 }
 
-inline bool RecordedDrawFilter::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedDrawFilter::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->DrawFilter(
       aTranslator->LookupFilterNode(mNode), mSourceRect, mDestPoint, mOptions);
   return true;
 }
 
 template 
-void RecordedDrawFilter::Record(S &aStream) const {
+void RecordedDrawFilter::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mNode);
   WriteElement(aStream, mSourceRect);
@@ -2623,7 +2623,7 @@ void RecordedDrawFilter::Record(S &aStream) const {
 }
 
 template 
-RecordedDrawFilter::RecordedDrawFilter(S &aStream)
+RecordedDrawFilter::RecordedDrawFilter(S& aStream)
     : RecordedDrawingEvent(DRAWFILTER, aStream) {
   ReadElement(aStream, mNode);
   ReadElement(aStream, mSourceRect);
@@ -2632,12 +2632,12 @@ RecordedDrawFilter::RecordedDrawFilter(S &aStream)
 }
 
 inline void RecordedDrawFilter::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] DrawFilter (" << mNode << ")";
 }
 
 inline bool RecordedDrawSurfaceWithShadow::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->DrawSurfaceWithShadow(
       aTranslator->LookupSourceSurface(mRefSource), mDest, mColor, mOffset,
       mSigma, mOp);
@@ -2645,7 +2645,7 @@ inline bool RecordedDrawSurfaceWithShadow::PlayEvent(
 }
 
 template 
-void RecordedDrawSurfaceWithShadow::Record(S &aStream) const {
+void RecordedDrawSurfaceWithShadow::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   WriteElement(aStream, mRefSource);
   WriteElement(aStream, mDest);
@@ -2656,7 +2656,7 @@ void RecordedDrawSurfaceWithShadow::Record(S &aStream) const {
 }
 
 template 
-RecordedDrawSurfaceWithShadow::RecordedDrawSurfaceWithShadow(S &aStream)
+RecordedDrawSurfaceWithShadow::RecordedDrawSurfaceWithShadow(S& aStream)
     : RecordedDrawingEvent(DRAWSURFACEWITHSHADOW, aStream) {
   ReadElement(aStream, mRefSource);
   ReadElement(aStream, mDest);
@@ -2667,13 +2667,13 @@ RecordedDrawSurfaceWithShadow::RecordedDrawSurfaceWithShadow(S &aStream)
 }
 
 inline void RecordedDrawSurfaceWithShadow::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] DrawSurfaceWithShadow (" << mRefSource
                 << ") Color: (" << mColor.r << ", " << mColor.g << ", "
                 << mColor.b << ", " << mColor.a << ")";
 }
 
-inline RecordedPathCreation::RecordedPathCreation(PathRecording *aPath)
+inline RecordedPathCreation::RecordedPathCreation(PathRecording* aPath)
     : RecordedEventDerived(PATHCREATION),
       mRefPtr(aPath),
       mFillRule(aPath->mFillRule),
@@ -2681,12 +2681,12 @@ inline RecordedPathCreation::RecordedPathCreation(PathRecording *aPath)
 
 inline RecordedPathCreation::~RecordedPathCreation() {}
 
-inline bool RecordedPathCreation::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedPathCreation::PlayEvent(Translator* aTranslator) const {
   RefPtr builder =
       aTranslator->GetReferenceDrawTarget()->CreatePathBuilder(mFillRule);
 
   for (size_t i = 0; i < mPathOps.size(); i++) {
-    const PathOp &op = mPathOps[i];
+    const PathOp& op = mPathOps[i];
     switch (op.mType) {
       case PathOp::OP_MOVETO:
         builder->MoveTo(op.mP1);
@@ -2715,7 +2715,7 @@ inline bool RecordedPathCreation::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-void RecordedPathCreation::Record(S &aStream) const {
+void RecordedPathCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, uint64_t(mPathOps.size()));
   WriteElement(aStream, mFillRule);
@@ -2736,7 +2736,7 @@ void RecordedPathCreation::Record(S &aStream) const {
 }
 
 template 
-RecordedPathCreation::RecordedPathCreation(S &aStream)
+RecordedPathCreation::RecordedPathCreation(S& aStream)
     : RecordedEventDerived(PATHCREATION) {
   uint64_t size;
 
@@ -2762,28 +2762,28 @@ RecordedPathCreation::RecordedPathCreation(S &aStream)
 }
 
 inline void RecordedPathCreation::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr
                 << "] Path created (OpCount: " << mPathOps.size() << ")";
 }
-inline bool RecordedPathDestruction::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedPathDestruction::PlayEvent(Translator* aTranslator) const {
   aTranslator->RemovePath(mRefPtr);
   return true;
 }
 
 template 
-void RecordedPathDestruction::Record(S &aStream) const {
+void RecordedPathDestruction::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
 }
 
 template 
-RecordedPathDestruction::RecordedPathDestruction(S &aStream)
+RecordedPathDestruction::RecordedPathDestruction(S& aStream)
     : RecordedEventDerived(PATHDESTRUCTION) {
   ReadElement(aStream, mRefPtr);
 }
 
 inline void RecordedPathDestruction::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] Path Destroyed";
 }
 
@@ -2794,7 +2794,7 @@ inline RecordedSourceSurfaceCreation::~RecordedSourceSurfaceCreation() {
 }
 
 inline bool RecordedSourceSurfaceCreation::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   if (!mData) {
     return false;
   }
@@ -2807,19 +2807,19 @@ inline bool RecordedSourceSurfaceCreation::PlayEvent(
 }
 
 template 
-void RecordedSourceSurfaceCreation::Record(S &aStream) const {
+void RecordedSourceSurfaceCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mSize);
   WriteElement(aStream, mFormat);
   MOZ_ASSERT(mData);
   for (int y = 0; y < mSize.height; y++) {
-    aStream.write((const char *)mData + y * mStride,
+    aStream.write((const char*)mData + y * mStride,
                   BytesPerPixel(mFormat) * mSize.width);
   }
 }
 
 template 
-RecordedSourceSurfaceCreation::RecordedSourceSurfaceCreation(S &aStream)
+RecordedSourceSurfaceCreation::RecordedSourceSurfaceCreation(S& aStream)
     : RecordedEventDerived(SOURCESURFACECREATION), mDataOwned(true) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mSize);
@@ -2831,41 +2831,41 @@ RecordedSourceSurfaceCreation::RecordedSourceSurfaceCreation(S &aStream)
         << "RecordedSourceSurfaceCreation failed to allocate data of size "
         << size;
   } else {
-    aStream.read((char *)mData, size);
+    aStream.read((char*)mData, size);
   }
 }
 
 inline void RecordedSourceSurfaceCreation::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr
                 << "] SourceSurface created (Size: " << mSize.width << "x"
                 << mSize.height << ")";
 }
 
 inline bool RecordedSourceSurfaceDestruction::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   aTranslator->RemoveSourceSurface(mRefPtr);
   return true;
 }
 
 template 
-void RecordedSourceSurfaceDestruction::Record(S &aStream) const {
+void RecordedSourceSurfaceDestruction::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
 }
 
 template 
-RecordedSourceSurfaceDestruction::RecordedSourceSurfaceDestruction(S &aStream)
+RecordedSourceSurfaceDestruction::RecordedSourceSurfaceDestruction(S& aStream)
     : RecordedEventDerived(SOURCESURFACEDESTRUCTION) {
   ReadElement(aStream, mRefPtr);
 }
 
 inline void RecordedSourceSurfaceDestruction::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] SourceSurface Destroyed";
 }
 
 inline bool RecordedExternalSurfaceCreation::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   RefPtr surface = aTranslator->LookupExternalSurface(mKey);
   if (!surface) {
     return false;
@@ -2876,20 +2876,20 @@ inline bool RecordedExternalSurfaceCreation::PlayEvent(
 }
 
 template 
-void RecordedExternalSurfaceCreation::Record(S &aStream) const {
+void RecordedExternalSurfaceCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mKey);
 }
 
 template 
-RecordedExternalSurfaceCreation::RecordedExternalSurfaceCreation(S &aStream)
+RecordedExternalSurfaceCreation::RecordedExternalSurfaceCreation(S& aStream)
     : RecordedEventDerived(EXTERNALSURFACECREATION) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mKey);
 }
 
 inline void RecordedExternalSurfaceCreation::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr
                 << "] SourceSurfaceSharedData created (Key: " << mKey << ")";
 }
@@ -2897,7 +2897,7 @@ inline void RecordedExternalSurfaceCreation::OutputSimpleEventInfo(
 inline RecordedFilterNodeCreation::~RecordedFilterNodeCreation() {}
 
 inline bool RecordedFilterNodeCreation::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   RefPtr node =
       aTranslator->GetReferenceDrawTarget()->CreateFilter(mType);
   aTranslator->AddFilterNode(mRefPtr, node);
@@ -2905,43 +2905,43 @@ inline bool RecordedFilterNodeCreation::PlayEvent(
 }
 
 template 
-void RecordedFilterNodeCreation::Record(S &aStream) const {
+void RecordedFilterNodeCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mType);
 }
 
 template 
-RecordedFilterNodeCreation::RecordedFilterNodeCreation(S &aStream)
+RecordedFilterNodeCreation::RecordedFilterNodeCreation(S& aStream)
     : RecordedEventDerived(FILTERNODECREATION) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mType);
 }
 
 inline void RecordedFilterNodeCreation::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr
                 << "] FilterNode created (Type: " << int(mType) << ")";
 }
 
 inline bool RecordedFilterNodeDestruction::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   aTranslator->RemoveFilterNode(mRefPtr);
   return true;
 }
 
 template 
-void RecordedFilterNodeDestruction::Record(S &aStream) const {
+void RecordedFilterNodeDestruction::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
 }
 
 template 
-RecordedFilterNodeDestruction::RecordedFilterNodeDestruction(S &aStream)
+RecordedFilterNodeDestruction::RecordedFilterNodeDestruction(S& aStream)
     : RecordedEventDerived(FILTERNODEDESTRUCTION) {
   ReadElement(aStream, mRefPtr);
 }
 
 inline void RecordedFilterNodeDestruction::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] FilterNode Destroyed";
 }
 
@@ -2952,7 +2952,7 @@ inline RecordedGradientStopsCreation::~RecordedGradientStopsCreation() {
 }
 
 inline bool RecordedGradientStopsCreation::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   RefPtr src =
       aTranslator->GetReferenceDrawTarget()->CreateGradientStops(
           mStops, mNumStops, mExtendMode);
@@ -2961,54 +2961,54 @@ inline bool RecordedGradientStopsCreation::PlayEvent(
 }
 
 template 
-void RecordedGradientStopsCreation::Record(S &aStream) const {
+void RecordedGradientStopsCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mExtendMode);
   WriteElement(aStream, mNumStops);
-  aStream.write((const char *)mStops, mNumStops * sizeof(GradientStop));
+  aStream.write((const char*)mStops, mNumStops * sizeof(GradientStop));
 }
 
 template 
-RecordedGradientStopsCreation::RecordedGradientStopsCreation(S &aStream)
+RecordedGradientStopsCreation::RecordedGradientStopsCreation(S& aStream)
     : RecordedEventDerived(GRADIENTSTOPSCREATION), mDataOwned(true) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mExtendMode);
   ReadElement(aStream, mNumStops);
   mStops = new GradientStop[mNumStops];
 
-  aStream.read((char *)mStops, mNumStops * sizeof(GradientStop));
+  aStream.read((char*)mStops, mNumStops * sizeof(GradientStop));
 }
 
 inline void RecordedGradientStopsCreation::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr
                 << "] GradientStops created (Stops: " << mNumStops << ")";
 }
 
 inline bool RecordedGradientStopsDestruction::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   aTranslator->RemoveGradientStops(mRefPtr);
   return true;
 }
 
 template 
-void RecordedGradientStopsDestruction::Record(S &aStream) const {
+void RecordedGradientStopsDestruction::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
 }
 
 template 
-RecordedGradientStopsDestruction::RecordedGradientStopsDestruction(S &aStream)
+RecordedGradientStopsDestruction::RecordedGradientStopsDestruction(S& aStream)
     : RecordedEventDerived(GRADIENTSTOPSDESTRUCTION) {
   ReadElement(aStream, mRefPtr);
 }
 
 inline void RecordedGradientStopsDestruction::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] GradientStops Destroyed";
 }
 
 inline bool RecordedIntoLuminanceSource::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   RefPtr src =
       aTranslator->LookupDrawTarget(mDT)->IntoLuminanceSource(mLuminanceType,
                                                               mOpacity);
@@ -3017,7 +3017,7 @@ inline bool RecordedIntoLuminanceSource::PlayEvent(
 }
 
 template 
-void RecordedIntoLuminanceSource::Record(S &aStream) const {
+void RecordedIntoLuminanceSource::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mDT);
   WriteElement(aStream, mLuminanceType);
@@ -3025,7 +3025,7 @@ void RecordedIntoLuminanceSource::Record(S &aStream) const {
 }
 
 template 
-RecordedIntoLuminanceSource::RecordedIntoLuminanceSource(S &aStream)
+RecordedIntoLuminanceSource::RecordedIntoLuminanceSource(S& aStream)
     : RecordedEventDerived(INTOLUMINANCE) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mDT);
@@ -3034,38 +3034,38 @@ RecordedIntoLuminanceSource::RecordedIntoLuminanceSource(S &aStream)
 }
 
 inline void RecordedIntoLuminanceSource::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] Into Luminance Source (DT: " << mDT
                 << ")";
 }
 
-inline bool RecordedSnapshot::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedSnapshot::PlayEvent(Translator* aTranslator) const {
   RefPtr src = aTranslator->LookupDrawTarget(mDT)->Snapshot();
   aTranslator->AddSourceSurface(mRefPtr, src);
   return true;
 }
 
 template 
-void RecordedSnapshot::Record(S &aStream) const {
+void RecordedSnapshot::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mDT);
 }
 
 template 
-RecordedSnapshot::RecordedSnapshot(S &aStream)
+RecordedSnapshot::RecordedSnapshot(S& aStream)
     : RecordedEventDerived(SNAPSHOT) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mDT);
 }
 
 inline void RecordedSnapshot::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] Snapshot Created (DT: " << mDT << ")";
 }
 
 inline RecordedFontData::~RecordedFontData() { delete[] mData; }
 
-inline bool RecordedFontData::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedFontData::PlayEvent(Translator* aTranslator) const {
   if (!mData) {
     return false;
   }
@@ -3083,21 +3083,21 @@ inline bool RecordedFontData::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-void RecordedFontData::Record(S &aStream) const {
+void RecordedFontData::Record(S& aStream) const {
   MOZ_ASSERT(mGetFontFileDataSucceeded);
 
   WriteElement(aStream, mType);
   WriteElement(aStream, mFontDetails.fontDataKey);
   WriteElement(aStream, mFontDetails.size);
-  aStream.write((const char *)mData, mFontDetails.size);
+  aStream.write((const char*)mData, mFontDetails.size);
 }
 
 inline void RecordedFontData::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "Font Data of size " << mFontDetails.size;
 }
 
-inline void RecordedFontData::SetFontData(const uint8_t *aData, uint32_t aSize,
+inline void RecordedFontData::SetFontData(const uint8_t* aData, uint32_t aSize,
                                           uint32_t aIndex) {
   mData = new (fallible) uint8_t[aSize];
   if (!mData) {
@@ -3112,7 +3112,7 @@ inline void RecordedFontData::SetFontData(const uint8_t *aData, uint32_t aSize,
   mFontDetails.index = aIndex;
 }
 
-inline bool RecordedFontData::GetFontDetails(RecordedFontDetails &fontDetails) {
+inline bool RecordedFontData::GetFontDetails(RecordedFontDetails& fontDetails) {
   if (!mGetFontFileDataSucceeded) {
     return false;
   }
@@ -3124,7 +3124,7 @@ inline bool RecordedFontData::GetFontDetails(RecordedFontDetails &fontDetails) {
 }
 
 template 
-RecordedFontData::RecordedFontData(S &aStream)
+RecordedFontData::RecordedFontData(S& aStream)
     : RecordedEventDerived(FONTDATA), mType(FontType::UNKNOWN), mData(nullptr) {
   ReadElement(aStream, mType);
   ReadElement(aStream, mFontDetails.fontDataKey);
@@ -3135,13 +3135,13 @@ RecordedFontData::RecordedFontData(S &aStream)
         << "RecordedFontData failed to allocate data for playback of size "
         << mFontDetails.size;
   } else {
-    aStream.read((char *)mData, mFontDetails.size);
+    aStream.read((char*)mData, mFontDetails.size);
   }
 }
 
 inline RecordedFontDescriptor::~RecordedFontDescriptor() {}
 
-inline bool RecordedFontDescriptor::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedFontDescriptor::PlayEvent(Translator* aTranslator) const {
   RefPtr font = Factory::CreateUnscaledFontFromFontDescriptor(
       mType, mData.data(), mData.size(), mIndex);
   if (!font) {
@@ -3156,21 +3156,21 @@ inline bool RecordedFontDescriptor::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-void RecordedFontDescriptor::Record(S &aStream) const {
+void RecordedFontDescriptor::Record(S& aStream) const {
   MOZ_ASSERT(mHasDesc);
   WriteElement(aStream, mType);
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mIndex);
   WriteElement(aStream, (size_t)mData.size());
-  aStream.write((char *)mData.data(), mData.size());
+  aStream.write((char*)mData.data(), mData.size());
 }
 
 inline void RecordedFontDescriptor::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] Font Descriptor";
 }
 
-inline void RecordedFontDescriptor::SetFontDescriptor(const uint8_t *aData,
+inline void RecordedFontDescriptor::SetFontDescriptor(const uint8_t* aData,
                                                       uint32_t aSize,
                                                       uint32_t aIndex) {
   mData.assign(aData, aData + aSize);
@@ -3178,7 +3178,7 @@ inline void RecordedFontDescriptor::SetFontDescriptor(const uint8_t *aData,
 }
 
 template 
-RecordedFontDescriptor::RecordedFontDescriptor(S &aStream)
+RecordedFontDescriptor::RecordedFontDescriptor(S& aStream)
     : RecordedEventDerived(FONTDESC) {
   ReadElement(aStream, mType);
   ReadElement(aStream, mRefPtr);
@@ -3187,12 +3187,12 @@ RecordedFontDescriptor::RecordedFontDescriptor(S &aStream)
   size_t size;
   ReadElement(aStream, size);
   mData.resize(size);
-  aStream.read((char *)mData.data(), size);
+  aStream.read((char*)mData.data(), size);
 }
 
 inline bool RecordedUnscaledFontCreation::PlayEvent(
-    Translator *aTranslator) const {
-  NativeFontResource *fontResource =
+    Translator* aTranslator) const {
+  NativeFontResource* fontResource =
       aTranslator->LookupNativeFontResource(mFontDataKey);
   if (!fontResource) {
     gfxDevCrash(LogReason::NativeFontResourceNotFound)
@@ -3208,26 +3208,26 @@ inline bool RecordedUnscaledFontCreation::PlayEvent(
 }
 
 template 
-void RecordedUnscaledFontCreation::Record(S &aStream) const {
+void RecordedUnscaledFontCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mFontDataKey);
   WriteElement(aStream, mIndex);
   WriteElement(aStream, (size_t)mInstanceData.size());
-  aStream.write((char *)mInstanceData.data(), mInstanceData.size());
+  aStream.write((char*)mInstanceData.data(), mInstanceData.size());
 }
 
 inline void RecordedUnscaledFontCreation::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] UnscaledFont Created";
 }
 
 inline void RecordedUnscaledFontCreation::SetFontInstanceData(
-    const uint8_t *aData, uint32_t aSize) {
+    const uint8_t* aData, uint32_t aSize) {
   mInstanceData.assign(aData, aData + aSize);
 }
 
 template 
-RecordedUnscaledFontCreation::RecordedUnscaledFontCreation(S &aStream)
+RecordedUnscaledFontCreation::RecordedUnscaledFontCreation(S& aStream)
     : RecordedEventDerived(UNSCALEDFONTCREATION) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mFontDataKey);
@@ -3236,34 +3236,34 @@ RecordedUnscaledFontCreation::RecordedUnscaledFontCreation(S &aStream)
   size_t size;
   ReadElement(aStream, size);
   mInstanceData.resize(size);
-  aStream.read((char *)mInstanceData.data(), size);
+  aStream.read((char*)mInstanceData.data(), size);
 }
 
 inline bool RecordedUnscaledFontDestruction::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   aTranslator->RemoveUnscaledFont(mRefPtr);
   return true;
 }
 
 template 
-void RecordedUnscaledFontDestruction::Record(S &aStream) const {
+void RecordedUnscaledFontDestruction::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
 }
 
 template 
-RecordedUnscaledFontDestruction::RecordedUnscaledFontDestruction(S &aStream)
+RecordedUnscaledFontDestruction::RecordedUnscaledFontDestruction(S& aStream)
     : RecordedEventDerived(UNSCALEDFONTDESTRUCTION) {
   ReadElement(aStream, mRefPtr);
 }
 
 inline void RecordedUnscaledFontDestruction::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] UnscaledFont Destroyed";
 }
 
 inline bool RecordedScaledFontCreation::PlayEvent(
-    Translator *aTranslator) const {
-  UnscaledFont *unscaledFont = aTranslator->LookupUnscaledFont(mUnscaledFont);
+    Translator* aTranslator) const {
+  UnscaledFont* unscaledFont = aTranslator->LookupUnscaledFont(mUnscaledFont);
   if (!unscaledFont) {
     gfxDevCrash(LogReason::UnscaledFontNotFound)
         << "UnscaledFont lookup failed for key |" << hexa(mUnscaledFont)
@@ -3279,31 +3279,31 @@ inline bool RecordedScaledFontCreation::PlayEvent(
 }
 
 template 
-void RecordedScaledFontCreation::Record(S &aStream) const {
+void RecordedScaledFontCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mUnscaledFont);
   WriteElement(aStream, mGlyphSize);
   WriteElement(aStream, (size_t)mInstanceData.size());
-  aStream.write((char *)mInstanceData.data(), mInstanceData.size());
+  aStream.write((char*)mInstanceData.data(), mInstanceData.size());
   WriteElement(aStream, (size_t)mVariations.size());
-  aStream.write((char *)mVariations.data(),
+  aStream.write((char*)mVariations.data(),
                 sizeof(FontVariation) * mVariations.size());
 }
 
 inline void RecordedScaledFontCreation::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] ScaledFont Created";
 }
 
 inline void RecordedScaledFontCreation::SetFontInstanceData(
-    const uint8_t *aData, uint32_t aSize, const FontVariation *aVariations,
+    const uint8_t* aData, uint32_t aSize, const FontVariation* aVariations,
     uint32_t aNumVariations) {
   mInstanceData.assign(aData, aData + aSize);
   mVariations.assign(aVariations, aVariations + aNumVariations);
 }
 
 template 
-RecordedScaledFontCreation::RecordedScaledFontCreation(S &aStream)
+RecordedScaledFontCreation::RecordedScaledFontCreation(S& aStream)
     : RecordedEventDerived(SCALEDFONTCREATION) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mUnscaledFont);
@@ -3312,37 +3312,37 @@ RecordedScaledFontCreation::RecordedScaledFontCreation(S &aStream)
   size_t size;
   ReadElement(aStream, size);
   mInstanceData.resize(size);
-  aStream.read((char *)mInstanceData.data(), size);
+  aStream.read((char*)mInstanceData.data(), size);
   size_t numVariations;
   ReadElement(aStream, numVariations);
   mVariations.resize(numVariations);
-  aStream.read((char *)mVariations.data(),
+  aStream.read((char*)mVariations.data(),
                sizeof(FontVariation) * numVariations);
 }
 
 inline bool RecordedScaledFontDestruction::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   aTranslator->RemoveScaledFont(mRefPtr);
   return true;
 }
 
 template 
-void RecordedScaledFontDestruction::Record(S &aStream) const {
+void RecordedScaledFontDestruction::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
 }
 
 template 
-RecordedScaledFontDestruction::RecordedScaledFontDestruction(S &aStream)
+RecordedScaledFontDestruction::RecordedScaledFontDestruction(S& aStream)
     : RecordedEventDerived(SCALEDFONTDESTRUCTION) {
   ReadElement(aStream, mRefPtr);
 }
 
 inline void RecordedScaledFontDestruction::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] ScaledFont Destroyed";
 }
 
-inline bool RecordedMaskSurface::PlayEvent(Translator *aTranslator) const {
+inline bool RecordedMaskSurface::PlayEvent(Translator* aTranslator) const {
   aTranslator->LookupDrawTarget(mDT)->MaskSurface(
       *GenericPattern(mPattern, aTranslator),
       aTranslator->LookupSourceSurface(mRefMask), mOffset, mOptions);
@@ -3350,7 +3350,7 @@ inline bool RecordedMaskSurface::PlayEvent(Translator *aTranslator) const {
 }
 
 template 
-void RecordedMaskSurface::Record(S &aStream) const {
+void RecordedMaskSurface::Record(S& aStream) const {
   RecordedDrawingEvent::Record(aStream);
   RecordPatternData(aStream, mPattern);
   WriteElement(aStream, mRefMask);
@@ -3359,7 +3359,7 @@ void RecordedMaskSurface::Record(S &aStream) const {
 }
 
 template 
-RecordedMaskSurface::RecordedMaskSurface(S &aStream)
+RecordedMaskSurface::RecordedMaskSurface(S& aStream)
     : RecordedDrawingEvent(MASKSURFACE, aStream) {
   ReadPatternData(aStream, mPattern);
   ReadElement(aStream, mRefMask);
@@ -3368,23 +3368,23 @@ RecordedMaskSurface::RecordedMaskSurface(S &aStream)
 }
 
 inline void RecordedMaskSurface::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mDT << "] MaskSurface (" << mRefMask << ")  Offset: ("
                 << mOffset.x << "x" << mOffset.y << ") Pattern: ";
   OutputSimplePatternInfo(mPattern, aStringStream);
 }
 
 template 
-void ReplaySetAttribute(FilterNode *aNode, uint32_t aIndex, T aValue) {
+void ReplaySetAttribute(FilterNode* aNode, uint32_t aIndex, T aValue) {
   aNode->SetAttribute(aIndex, aValue);
 }
 
 inline bool RecordedFilterNodeSetAttribute::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
 #define REPLAY_SET_ATTRIBUTE(type, argtype)                          \
   case ARGTYPE_##argtype:                                            \
     ReplaySetAttribute(aTranslator->LookupFilterNode(mNode), mIndex, \
-                       *(type *)&mPayload.front());                  \
+                       *(type*)&mPayload.front());                   \
     break
 
   switch (mArgType) {
@@ -3403,7 +3403,7 @@ inline bool RecordedFilterNodeSetAttribute::PlayEvent(
     REPLAY_SET_ATTRIBUTE(Color, COLOR);
     case ARGTYPE_FLOAT_ARRAY:
       aTranslator->LookupFilterNode(mNode)->SetAttribute(
-          mIndex, reinterpret_cast(&mPayload.front()),
+          mIndex, reinterpret_cast(&mPayload.front()),
           mPayload.size() / sizeof(Float));
       break;
   }
@@ -3412,16 +3412,16 @@ inline bool RecordedFilterNodeSetAttribute::PlayEvent(
 }
 
 template 
-void RecordedFilterNodeSetAttribute::Record(S &aStream) const {
+void RecordedFilterNodeSetAttribute::Record(S& aStream) const {
   WriteElement(aStream, mNode);
   WriteElement(aStream, mIndex);
   WriteElement(aStream, mArgType);
   WriteElement(aStream, uint64_t(mPayload.size()));
-  aStream.write((const char *)&mPayload.front(), mPayload.size());
+  aStream.write((const char*)&mPayload.front(), mPayload.size());
 }
 
 template 
-RecordedFilterNodeSetAttribute::RecordedFilterNodeSetAttribute(S &aStream)
+RecordedFilterNodeSetAttribute::RecordedFilterNodeSetAttribute(S& aStream)
     : RecordedEventDerived(FILTERNODESETATTRIBUTE) {
   ReadElement(aStream, mNode);
   ReadElement(aStream, mIndex);
@@ -3429,16 +3429,16 @@ RecordedFilterNodeSetAttribute::RecordedFilterNodeSetAttribute(S &aStream)
   uint64_t size;
   ReadElement(aStream, size);
   mPayload.resize(size_t(size));
-  aStream.read((char *)&mPayload.front(), size);
+  aStream.read((char*)&mPayload.front(), size);
 }
 
 inline void RecordedFilterNodeSetAttribute::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mNode << "] SetAttribute (" << mIndex << ")";
 }
 
 inline bool RecordedFilterNodeSetInput::PlayEvent(
-    Translator *aTranslator) const {
+    Translator* aTranslator) const {
   if (mInputFilter) {
     aTranslator->LookupFilterNode(mNode)->SetInput(
         mIndex, aTranslator->LookupFilterNode(mInputFilter));
@@ -3451,7 +3451,7 @@ inline bool RecordedFilterNodeSetInput::PlayEvent(
 }
 
 template 
-void RecordedFilterNodeSetInput::Record(S &aStream) const {
+void RecordedFilterNodeSetInput::Record(S& aStream) const {
   WriteElement(aStream, mNode);
   WriteElement(aStream, mIndex);
   WriteElement(aStream, mInputFilter);
@@ -3459,7 +3459,7 @@ void RecordedFilterNodeSetInput::Record(S &aStream) const {
 }
 
 template 
-RecordedFilterNodeSetInput::RecordedFilterNodeSetInput(S &aStream)
+RecordedFilterNodeSetInput::RecordedFilterNodeSetInput(S& aStream)
     : RecordedEventDerived(FILTERNODESETINPUT) {
   ReadElement(aStream, mNode);
   ReadElement(aStream, mIndex);
@@ -3468,7 +3468,7 @@ RecordedFilterNodeSetInput::RecordedFilterNodeSetInput(S &aStream)
 }
 
 inline void RecordedFilterNodeSetInput::OutputSimpleEventInfo(
-    std::stringstream &aStringStream) const {
+    std::stringstream& aStringStream) const {
   aStringStream << "[" << mNode << "] SetAttribute (" << mIndex << ", ";
 
   if (mInputFilter) {
@@ -3532,7 +3532,7 @@ inline void RecordedFilterNodeSetInput::OutputSimpleEventInfo(
   f(EXTERNALSURFACECREATION, RecordedExternalSurfaceCreation);
 
 template 
-RecordedEvent *RecordedEvent::LoadEvent(S &aStream, EventType aType) {
+RecordedEvent* RecordedEvent::LoadEvent(S& aStream, EventType aType) {
   switch (aType) {
     FOR_EACH_EVENT(LOAD_EVENT_TYPE)
     default:
@@ -3547,7 +3547,7 @@ RecordedEvent *RecordedEvent::LoadEvent(S &aStream, EventType aType) {
   }
 
 template 
-bool RecordedEvent::DoWithEvent(S &aStream, EventType aType, F f) {
+bool RecordedEvent::DoWithEvent(S& aStream, EventType aType, F f) {
   switch (aType) {
     FOR_EACH_EVENT(DO_WITH_EVENT_TYPE)
     default:
diff --git a/gfx/2d/RecordingTypes.h b/gfx/2d/RecordingTypes.h
index e2d0625882568..4558591dec6bd 100644
--- a/gfx/2d/RecordingTypes.h
+++ b/gfx/2d/RecordingTypes.h
@@ -14,20 +14,20 @@ namespace gfx {
 
 template 
 struct ElementStreamFormat {
-  static void Write(S &aStream, const T &aElement) {
-    aStream.write(reinterpret_cast(&aElement), sizeof(T));
+  static void Write(S& aStream, const T& aElement) {
+    aStream.write(reinterpret_cast(&aElement), sizeof(T));
   }
-  static void Read(S &aStream, T &aElement) {
-    aStream.read(reinterpret_cast(&aElement), sizeof(T));
+  static void Read(S& aStream, T& aElement) {
+    aStream.read(reinterpret_cast(&aElement), sizeof(T));
   }
 };
 
 template 
-void WriteElement(S &aStream, const T &aElement) {
+void WriteElement(S& aStream, const T& aElement) {
   ElementStreamFormat::Write(aStream, aElement);
 }
 template 
-void ReadElement(S &aStream, T &aElement) {
+void ReadElement(S& aStream, T& aElement) {
   ElementStreamFormat::Read(aStream, aElement);
 }
 
diff --git a/gfx/2d/SFNTNameTable.cpp b/gfx/2d/SFNTNameTable.cpp
index 235d4e012ef14..01f2931f573f7 100644
--- a/gfx/2d/SFNTNameTable.cpp
+++ b/gfx/2d/SFNTNameTable.cpp
@@ -67,7 +67,7 @@ enum ENameDecoder : int {
 };
 
 /* static */
-UniquePtr SFNTNameTable::Create(const uint8_t *aNameData,
+UniquePtr SFNTNameTable::Create(const uint8_t* aNameData,
                                                uint32_t aDataLength) {
   MOZ_ASSERT(aNameData);
 
@@ -76,8 +76,7 @@ UniquePtr SFNTNameTable::Create(const uint8_t *aNameData,
     return nullptr;
   }
 
-  const NameHeader *nameHeader =
-      reinterpret_cast(aNameData);
+  const NameHeader* nameHeader = reinterpret_cast(aNameData);
   if (nameHeader->format != FORMAT_0) {
     gfxWarning() << "Only Name Table Format 0 is supported.";
     return nullptr;
@@ -100,17 +99,17 @@ UniquePtr SFNTNameTable::Create(const uint8_t *aNameData,
       new SFNTNameTable(nameHeader, aNameData, aDataLength));
 }
 
-SFNTNameTable::SFNTNameTable(const NameHeader *aNameHeader,
-                             const uint8_t *aNameData, uint32_t aDataLength)
+SFNTNameTable::SFNTNameTable(const NameHeader* aNameHeader,
+                             const uint8_t* aNameData, uint32_t aDataLength)
     : mFirstRecord(
-          reinterpret_cast(aNameData + sizeof(NameHeader))),
+          reinterpret_cast(aNameData + sizeof(NameHeader))),
       mEndOfRecords(mFirstRecord + aNameHeader->count),
       mStringData(aNameData + aNameHeader->stringOffset),
       mStringDataLength(aDataLength - aNameHeader->stringOffset) {
-  MOZ_ASSERT(reinterpret_cast(aNameHeader) == aNameData);
+  MOZ_ASSERT(reinterpret_cast(aNameHeader) == aNameData);
 }
 
-static bool IsUTF16Encoding(const NameRecord *aNameRecord) {
+static bool IsUTF16Encoding(const NameRecord* aNameRecord) {
   if (aNameRecord->platformID == PLATFORM_ID_MICROSOFT &&
       (aNameRecord->encodingID == ENCODING_ID_MICROSOFT_UNICODEBMP ||
        aNameRecord->encodingID == ENCODING_ID_MICROSOFT_SYMBOL)) {
@@ -125,7 +124,7 @@ static bool IsUTF16Encoding(const NameRecord *aNameRecord) {
 }
 
 #if defined(XP_MACOSX)
-static bool IsMacRomanEncoding(const NameRecord *aNameRecord) {
+static bool IsMacRomanEncoding(const NameRecord* aNameRecord) {
   if (aNameRecord->platformID == PLATFORM_ID_MAC &&
       aNameRecord->encodingID == ENCODING_ID_MAC_ROMAN) {
     return true;
@@ -135,16 +134,16 @@ static bool IsMacRomanEncoding(const NameRecord *aNameRecord) {
 }
 #endif
 
-static NameRecordMatchers *CreateCanonicalMatchers(
-    const BigEndianUint16 &aNameID) {
+static NameRecordMatchers* CreateCanonicalMatchers(
+    const BigEndianUint16& aNameID) {
   // For Windows, we return only Microsoft platform name record
   // matchers. On Mac, we return matchers for both Microsoft platform
   // records and Mac platform records.
-  NameRecordMatchers *matchers = new NameRecordMatchers();
+  NameRecordMatchers* matchers = new NameRecordMatchers();
 
 #if defined(XP_MACOSX)
   // First, look for the English name.
-  if (!matchers->append([=](const NameRecord *aNameRecord) {
+  if (!matchers->append([=](const NameRecord* aNameRecord) {
         if (aNameRecord->nameID == aNameID &&
             aNameRecord->languageID == LANG_ID_MAC_ENGLISH &&
             aNameRecord->platformID == PLATFORM_ID_MAC &&
@@ -158,7 +157,7 @@ static NameRecordMatchers *CreateCanonicalMatchers(
   }
 
   // Second, look for all languages.
-  if (!matchers->append([=](const NameRecord *aNameRecord) {
+  if (!matchers->append([=](const NameRecord* aNameRecord) {
         if (aNameRecord->nameID == aNameID &&
             aNameRecord->platformID == PLATFORM_ID_MAC &&
             IsMacRomanEncoding(aNameRecord)) {
@@ -172,7 +171,7 @@ static NameRecordMatchers *CreateCanonicalMatchers(
 #endif /* defined(XP_MACOSX) */
 
   // First, look for the English name (this will normally succeed).
-  if (!matchers->append([=](const NameRecord *aNameRecord) {
+  if (!matchers->append([=](const NameRecord* aNameRecord) {
         if (aNameRecord->nameID == aNameID &&
             aNameRecord->languageID == LANG_ID_MICROSOFT_EN_US &&
             aNameRecord->platformID == PLATFORM_ID_MICROSOFT &&
@@ -186,7 +185,7 @@ static NameRecordMatchers *CreateCanonicalMatchers(
   }
 
   // Second, look for all languages.
-  if (!matchers->append([=](const NameRecord *aNameRecord) {
+  if (!matchers->append([=](const NameRecord* aNameRecord) {
         if (aNameRecord->nameID == aNameID &&
             aNameRecord->platformID == PLATFORM_ID_MICROSOFT &&
             IsUTF16Encoding(aNameRecord)) {
@@ -201,25 +200,25 @@ static NameRecordMatchers *CreateCanonicalMatchers(
   return matchers;
 }
 
-static const NameRecordMatchers &FullNameMatchers() {
-  static const NameRecordMatchers *sFullNameMatchers =
+static const NameRecordMatchers& FullNameMatchers() {
+  static const NameRecordMatchers* sFullNameMatchers =
       CreateCanonicalMatchers(NAME_ID_FULL);
   return *sFullNameMatchers;
 }
 
-static const NameRecordMatchers &FamilyMatchers() {
-  static const NameRecordMatchers *sFamilyMatchers =
+static const NameRecordMatchers& FamilyMatchers() {
+  static const NameRecordMatchers* sFamilyMatchers =
       CreateCanonicalMatchers(NAME_ID_FAMILY);
   return *sFamilyMatchers;
 }
 
-static const NameRecordMatchers &StyleMatchers() {
-  static const NameRecordMatchers *sStyleMatchers =
+static const NameRecordMatchers& StyleMatchers() {
+  static const NameRecordMatchers* sStyleMatchers =
       CreateCanonicalMatchers(NAME_ID_STYLE);
   return *sStyleMatchers;
 }
 
-bool SFNTNameTable::GetU16FullName(mozilla::u16string &aU16FullName) {
+bool SFNTNameTable::GetU16FullName(mozilla::u16string& aU16FullName) {
   if (ReadU16Name(FullNameMatchers(), aU16FullName)) {
     return true;
   }
@@ -242,12 +241,12 @@ bool SFNTNameTable::GetU16FullName(mozilla::u16string &aU16FullName) {
   return true;
 }
 
-bool SFNTNameTable::ReadU16Name(const NameRecordMatchers &aMatchers,
-                                mozilla::u16string &aU16Name) {
+bool SFNTNameTable::ReadU16Name(const NameRecordMatchers& aMatchers,
+                                mozilla::u16string& aU16Name) {
   MOZ_ASSERT(!aMatchers.empty());
 
   for (size_t i = 0; i < aMatchers.length(); ++i) {
-    const NameRecord *record = mFirstRecord;
+    const NameRecord* record = mFirstRecord;
     while (record != mEndOfRecords) {
       switch (aMatchers[i](record)) {
         case eNameDecoderUTF16:
@@ -269,8 +268,8 @@ bool SFNTNameTable::ReadU16Name(const NameRecordMatchers &aMatchers,
   return false;
 }
 
-bool SFNTNameTable::ReadU16NameFromU16Record(const NameRecord *aNameRecord,
-                                             mozilla::u16string &aU16Name) {
+bool SFNTNameTable::ReadU16NameFromU16Record(const NameRecord* aNameRecord,
+                                             mozilla::u16string& aU16Name) {
   uint32_t offset = aNameRecord->offset;
   uint32_t length = aNameRecord->length;
   if (mStringDataLength < offset + length) {
@@ -278,7 +277,7 @@ bool SFNTNameTable::ReadU16NameFromU16Record(const NameRecord *aNameRecord,
     return false;
   }
 
-  const uint8_t *startOfName = mStringData + offset;
+  const uint8_t* startOfName = mStringData + offset;
   size_t actualLength = length / sizeof(char16_t);
   UniquePtr nameData(new char16_t[actualLength]);
   NativeEndian::copyAndSwapFromBigEndian(nameData.get(), startOfName,
@@ -290,7 +289,7 @@ bool SFNTNameTable::ReadU16NameFromU16Record(const NameRecord *aNameRecord,
 
 #if defined(XP_MACOSX)
 bool SFNTNameTable::ReadU16NameFromMacRomanRecord(
-    const NameRecord *aNameRecord, mozilla::u16string &aU16Name) {
+    const NameRecord* aNameRecord, mozilla::u16string& aU16Name) {
   uint32_t offset = aNameRecord->offset;
   uint32_t length = aNameRecord->length;
   if (mStringDataLength < offset + length) {
@@ -303,7 +302,7 @@ bool SFNTNameTable::ReadU16NameFromMacRomanRecord(
   }
 
   // pointer to the Mac Roman encoded string in the name record
-  const uint8_t *encodedStr = mStringData + offset;
+  const uint8_t* encodedStr = mStringData + offset;
 
   CFStringRef cfString;
   cfString = CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, encodedStr,
@@ -321,7 +320,7 @@ bool SFNTNameTable::ReadU16NameFromMacRomanRecord(
 
   CFRelease(cfString);
 
-  aU16Name.assign(reinterpret_cast(u16Buffer.get()), decodedLength);
+  aU16Name.assign(reinterpret_cast(u16Buffer.get()), decodedLength);
 
   return true;
 }
diff --git a/gfx/2d/SFNTNameTable.h b/gfx/2d/SFNTNameTable.h
index f2debd6702ef7..b31c811406954 100644
--- a/gfx/2d/SFNTNameTable.h
+++ b/gfx/2d/SFNTNameTable.h
@@ -20,7 +20,7 @@ struct NameHeader;
 struct NameRecord;
 enum ENameDecoder : int;
 
-typedef Vector>
+typedef Vector>
     NameRecordMatchers;
 
 class SFNTNameTable final {
@@ -33,7 +33,7 @@ class SFNTNameTable final {
    * @param aDataLength length
    * @return UniquePtr to a SFNTNameTable or nullptr if the header is invalid.
    */
-  static UniquePtr Create(const uint8_t *aNameData,
+  static UniquePtr Create(const uint8_t* aNameData,
                                          uint32_t aDataLength);
 
   /**
@@ -44,26 +44,26 @@ class SFNTNameTable final {
    * @param aU16FullName string to be populated with the full name.
    * @return true if the full name is successfully read.
    */
-  bool GetU16FullName(mozilla::u16string &aU16FullName);
+  bool GetU16FullName(mozilla::u16string& aU16FullName);
 
  private:
-  SFNTNameTable(const NameHeader *aNameHeader, const uint8_t *aNameData,
+  SFNTNameTable(const NameHeader* aNameHeader, const uint8_t* aNameData,
                 uint32_t aDataLength);
 
-  bool ReadU16Name(const NameRecordMatchers &aMatchers,
-                   mozilla::u16string &aU16Name);
+  bool ReadU16Name(const NameRecordMatchers& aMatchers,
+                   mozilla::u16string& aU16Name);
 
-  bool ReadU16NameFromU16Record(const NameRecord *aNameRecord,
-                                mozilla::u16string &aU16Name);
+  bool ReadU16NameFromU16Record(const NameRecord* aNameRecord,
+                                mozilla::u16string& aU16Name);
 
 #if defined(XP_MACOSX)
-  bool ReadU16NameFromMacRomanRecord(const NameRecord *aNameRecord,
-                                     mozilla::u16string &aU16Name);
+  bool ReadU16NameFromMacRomanRecord(const NameRecord* aNameRecord,
+                                     mozilla::u16string& aU16Name);
 #endif
 
-  const NameRecord *mFirstRecord;
-  const NameRecord *mEndOfRecords;
-  const uint8_t *mStringData;
+  const NameRecord* mFirstRecord;
+  const NameRecord* mEndOfRecords;
+  const uint8_t* mStringData;
   const uint32_t mStringDataLength;
 };
 
diff --git a/gfx/2d/SSEHelpers.h b/gfx/2d/SSEHelpers.h
index 56d5508b5aaac..1b32024009600 100644
--- a/gfx/2d/SSEHelpers.h
+++ b/gfx/2d/SSEHelpers.h
@@ -11,8 +11,8 @@
  * faster. Once enough people are on architectures where _mm_loadu_si128 is
  * fast we can migrate to it.
  */
-MOZ_ALWAYS_INLINE __m128i loadUnaligned128(const __m128i *aSource) {
+MOZ_ALWAYS_INLINE __m128i loadUnaligned128(const __m128i* aSource) {
   // Yes! We use uninitialized memory here, we'll overwrite it though!
-  __m128 res = _mm_loadl_pi(_mm_set1_ps(0), (const __m64 *)aSource);
-  return _mm_castps_si128(_mm_loadh_pi(res, ((const __m64 *)(aSource)) + 1));
+  __m128 res = _mm_loadl_pi(_mm_set1_ps(0), (const __m64*)aSource);
+  return _mm_castps_si128(_mm_loadh_pi(res, ((const __m64*)(aSource)) + 1));
 }
diff --git a/gfx/2d/SVGTurbulenceRenderer-inl.h b/gfx/2d/SVGTurbulenceRenderer-inl.h
index 6ef3054965580..9daff837b7d18 100644
--- a/gfx/2d/SVGTurbulenceRenderer-inl.h
+++ b/gfx/2d/SVGTurbulenceRenderer-inl.h
@@ -15,11 +15,11 @@ template 
 class SVGTurbulenceRenderer {
  public:
-  SVGTurbulenceRenderer(const Size &aBaseFrequency, int32_t aSeed,
-                        int aNumOctaves, const Rect &aTileRect);
+  SVGTurbulenceRenderer(const Size& aBaseFrequency, int32_t aSeed,
+                        int aNumOctaves, const Rect& aTileRect);
 
-  already_AddRefed Render(const IntSize &aSize,
-                                             const Point &aOffset) const;
+  already_AddRefed Render(const IntSize& aSize,
+                                             const Point& aOffset) const;
 
  private:
   /* The turbulence calculation code is an adapted version of what
@@ -37,13 +37,13 @@ class SVGTurbulenceRenderer {
   const static int sBSize = 0x100;
   const static int sBM = 0xff;
   void InitFromSeed(int32_t aSeed);
-  void AdjustBaseFrequencyForStitch(const Rect &aTileRect);
+  void AdjustBaseFrequencyForStitch(const Rect& aTileRect);
   IntPoint AdjustForStitch(IntPoint aLatticePoint,
-                           const StitchInfo &aStitchInfo) const;
-  StitchInfo CreateStitchInfo(const Rect &aTileRect) const;
-  f32x4_t Noise2(Point aVec, const StitchInfo &aStitchInfo) const;
-  i32x4_t Turbulence(const Point &aPoint) const;
-  Point EquivalentNonNegativeOffset(const Point &aOffset) const;
+                           const StitchInfo& aStitchInfo) const;
+  StitchInfo CreateStitchInfo(const Rect& aTileRect) const;
+  f32x4_t Noise2(Point aVec, const StitchInfo& aStitchInfo) const;
+  i32x4_t Turbulence(const Point& aPoint) const;
+  Point EquivalentNonNegativeOffset(const Point& aOffset) const;
 
   Size mBaseFrequency;
   int32_t mNumOctaves;
@@ -97,8 +97,8 @@ struct RandomNumberSource {
 template 
 SVGTurbulenceRenderer::
-    SVGTurbulenceRenderer(const Size &aBaseFrequency, int32_t aSeed,
-                          int aNumOctaves, const Rect &aTileRect)
+    SVGTurbulenceRenderer(const Size& aBaseFrequency, int32_t aSeed,
+                          int aNumOctaves, const Rect& aTileRect)
     : mBaseFrequency(aBaseFrequency),
       mNumOctaves(aNumOctaves),
       mStitchInfo(),
@@ -169,7 +169,7 @@ static inline float AdjustForLength(float aFreq, float aLength) {
 template 
 void SVGTurbulenceRenderer::
-    AdjustBaseFrequencyForStitch(const Rect &aTileRect) {
+    AdjustBaseFrequencyForStitch(const Rect& aTileRect) {
   mBaseFrequency =
       Size(AdjustForLength(mBaseFrequency.width, aTileRect.Width()),
            AdjustForLength(mBaseFrequency.height, aTileRect.Height()));
@@ -180,7 +180,7 @@ template ::StitchInfo
 SVGTurbulenceRenderer::CreateStitchInfo(const Rect &aTileRect) const {
+                      u8x16_t>::CreateStitchInfo(const Rect& aTileRect) const {
   StitchInfo stitch;
   stitch.width =
       int32_t(floorf(aTileRect.Width() * mBaseFrequency.width + 0.5f));
@@ -198,8 +198,8 @@ static MOZ_ALWAYS_INLINE Point SCurve(Point t) {
 }
 
 template 
-static MOZ_ALWAYS_INLINE f32x4_t BiMix(const f32x4_t &aa, const f32x4_t &ab,
-                                       const f32x4_t &ba, const f32x4_t &bb,
+static MOZ_ALWAYS_INLINE f32x4_t BiMix(const f32x4_t& aa, const f32x4_t& ab,
+                                       const f32x4_t& ba, const f32x4_t& bb,
                                        Point s) {
   return simd::MixF32(simd::MixF32(aa, ab, s.x), simd::MixF32(ba, bb, s.x),
                       s.y);
@@ -209,7 +209,7 @@ template 
 IntPoint
 SVGTurbulenceRenderer::AdjustForStitch(
-    IntPoint aLatticePoint, const StitchInfo &aStitchInfo) const {
+    IntPoint aLatticePoint, const StitchInfo& aStitchInfo) const {
   if (Stitch) {
     if (aLatticePoint.x >= aStitchInfo.wrapX) {
       aLatticePoint.x -= aStitchInfo.width;
@@ -224,7 +224,7 @@ SVGTurbulenceRenderer::AdjustForStitch(
 template 
 f32x4_t SVGTurbulenceRenderer::Noise2(
-    Point aVec, const StitchInfo &aStitchInfo) const {
+    Point aVec, const StitchInfo& aStitchInfo) const {
   // aVec is guaranteed to be non-negative, so casting to int32_t always
   // rounds towards negative infinity.
   IntPoint topLeftLatticePoint(int32_t(aVec.x), int32_t(aVec.y));
@@ -236,10 +236,10 @@ f32x4_t SVGTurbulenceRenderer::Noise2(
   uint8_t i = mLatticeSelector[b0.x & sBM];
   uint8_t j = mLatticeSelector[b1.x & sBM];
 
-  const f32x4_t *qua = mGradient[(i + b0.y) & sBM];
-  const f32x4_t *qub = mGradient[(i + b1.y) & sBM];
-  const f32x4_t *qva = mGradient[(j + b0.y) & sBM];
-  const f32x4_t *qvb = mGradient[(j + b1.y) & sBM];
+  const f32x4_t* qua = mGradient[(i + b0.y) & sBM];
+  const f32x4_t* qub = mGradient[(i + b1.y) & sBM];
+  const f32x4_t* qva = mGradient[(j + b0.y) & sBM];
+  const f32x4_t* qvb = mGradient[(j + b1.y) & sBM];
 
   return BiMix(simd::WSumF32(qua[0], qua[1], r.x, r.y),
                simd::WSumF32(qva[0], qva[1], r.x - 1.f, r.y),
@@ -267,7 +267,7 @@ static inline i32x4_t ColorToBGRA(f32x4_t aUnscaledUnpreFloat) {
 template 
 i32x4_t SVGTurbulenceRenderer::Turbulence(const Point &aPoint) const {
+                              u8x16_t>::Turbulence(const Point& aPoint) const {
   StitchInfo stitchInfo = mStitchInfo;
   f32x4_t sum = simd::FromF32(0);
   Point vec(aPoint.x * mBaseFrequency.width, aPoint.y * mBaseFrequency.height);
@@ -317,7 +317,7 @@ static inline Float FiniteDivide(Float aValue, Float aDivisor) {
 template 
 Point SVGTurbulenceRenderer::
-    EquivalentNonNegativeOffset(const Point &aOffset) const {
+    EquivalentNonNegativeOffset(const Point& aOffset) const {
   Size basePeriod = Stitch ? Size(mStitchInfo.width, mStitchInfo.height)
                            : Size(sBSize, sBSize);
   Size repeatingSize(FiniteDivide(basePeriod.width, mBaseFrequency.width),
@@ -330,7 +330,7 @@ template 
 already_AddRefed
 SVGTurbulenceRenderer::Render(
-    const IntSize &aSize, const Point &aOffset) const {
+    const IntSize& aSize, const Point& aOffset) const {
   RefPtr target =
       Factory::CreateDataSourceSurface(aSize, SurfaceFormat::B8G8R8A8);
   if (!target) {
@@ -338,7 +338,7 @@ SVGTurbulenceRenderer::Render(
   }
 
   DataSourceSurface::ScopedMap map(target, DataSourceSurface::READ_WRITE);
-  uint8_t *targetData = map.GetData();
+  uint8_t* targetData = map.GetData();
   uint32_t stride = map.GetStride();
 
   Point startOffset = EquivalentNonNegativeOffset(aOffset);
diff --git a/gfx/2d/ScaledFontBase.cpp b/gfx/2d/ScaledFontBase.cpp
index efdf770df3a52..9bd37d0d3809b 100644
--- a/gfx/2d/ScaledFontBase.cpp
+++ b/gfx/2d/ScaledFontBase.cpp
@@ -52,7 +52,7 @@ ScaledFontBase::~ScaledFontBase() {
 #endif
 }
 
-ScaledFontBase::ScaledFontBase(const RefPtr &aUnscaledFont,
+ScaledFontBase::ScaledFontBase(const RefPtr& aUnscaledFont,
                                Float aSize)
     : ScaledFont(aUnscaledFont)
 #ifdef USE_SKIA
@@ -68,9 +68,9 @@ ScaledFontBase::ScaledFontBase(const RefPtr &aUnscaledFont,
 }
 
 #ifdef USE_SKIA
-SkTypeface *ScaledFontBase::GetSkTypeface() {
+SkTypeface* ScaledFontBase::GetSkTypeface() {
   if (!mTypeface) {
-    SkTypeface *typeface = CreateSkTypeface();
+    SkTypeface* typeface = CreateSkTypeface();
     if (!mTypeface.compareExchange(nullptr, typeface)) {
       SkSafeUnref(typeface);
     }
@@ -81,7 +81,7 @@ SkTypeface *ScaledFontBase::GetSkTypeface() {
 
 #ifdef USE_CAIRO_SCALED_FONT
 bool ScaledFontBase::PopulateCairoScaledFont() {
-  cairo_font_face_t *cairoFontFace = GetCairoFontFace();
+  cairo_font_face_t* cairoFontFace = GetCairoFontFace();
   if (!cairoFontFace) {
     return false;
   }
@@ -92,7 +92,7 @@ bool ScaledFontBase::PopulateCairoScaledFont() {
   cairo_matrix_init_scale(&sizeMatrix, mSize, mSize);
   cairo_matrix_init_identity(&identityMatrix);
 
-  cairo_font_options_t *fontOptions = cairo_font_options_create();
+  cairo_font_options_t* fontOptions = cairo_font_options_create();
 
   mScaledFont = cairo_scaled_font_create(cairoFontFace, &sizeMatrix,
                                          &identityMatrix, fontOptions);
@@ -105,8 +105,8 @@ bool ScaledFontBase::PopulateCairoScaledFont() {
 #endif
 
 #ifdef USE_SKIA
-SkPath ScaledFontBase::GetSkiaPathForGlyphs(const GlyphBuffer &aBuffer) {
-  SkTypeface *typeFace = GetSkTypeface();
+SkPath ScaledFontBase::GetSkiaPathForGlyphs(const GlyphBuffer& aBuffer) {
+  SkTypeface* typeFace = GetSkTypeface();
   MOZ_ASSERT(typeFace);
 
   SkFont font(sk_ref_sp(typeFace), SkFloatToScalar(mSize));
@@ -118,14 +118,14 @@ SkPath ScaledFontBase::GetSkiaPathForGlyphs(const GlyphBuffer &aBuffer) {
   }
 
   struct Context {
-    const Glyph *mGlyph;
+    const Glyph* mGlyph;
     SkPath mPath;
   } ctx = {aBuffer.mGlyphs};
 
   font.getPaths(
       indices.data(), indices.size(),
-      [](const SkPath *glyphPath, const SkMatrix &scaleMatrix, void *ctxPtr) {
-        Context &ctx = *reinterpret_cast(ctxPtr);
+      [](const SkPath* glyphPath, const SkMatrix& scaleMatrix, void* ctxPtr) {
+        Context& ctx = *reinterpret_cast(ctxPtr);
         if (glyphPath) {
           SkMatrix transMatrix(scaleMatrix);
           transMatrix.postTranslate(SkFloatToScalar(ctx.mGlyph->mPosition.x),
@@ -141,7 +141,7 @@ SkPath ScaledFontBase::GetSkiaPathForGlyphs(const GlyphBuffer &aBuffer) {
 #endif
 
 already_AddRefed ScaledFontBase::GetPathForGlyphs(
-    const GlyphBuffer &aBuffer, const DrawTarget *aTarget) {
+    const GlyphBuffer& aBuffer, const DrawTarget* aTarget) {
 #ifdef USE_SKIA
   if (aTarget->GetBackendType() == BackendType::SKIA) {
     SkPath path = GetSkiaPathForGlyphs(aBuffer);
@@ -152,8 +152,8 @@ already_AddRefed ScaledFontBase::GetPathForGlyphs(
   if (aTarget->GetBackendType() == BackendType::CAIRO) {
     MOZ_ASSERT(mScaledFont);
 
-    DrawTarget *dt = const_cast(aTarget);
-    cairo_t *ctx = static_cast(
+    DrawTarget* dt = const_cast(aTarget);
+    cairo_t* ctx = static_cast(
         dt->GetNativeSurface(NativeSurfaceType::CAIRO_CONTEXT));
 
     bool isNewContext = !ctx;
@@ -196,13 +196,13 @@ already_AddRefed ScaledFontBase::GetPathForGlyphs(
   return nullptr;
 }
 
-void ScaledFontBase::CopyGlyphsToBuilder(const GlyphBuffer &aBuffer,
-                                         PathBuilder *aBuilder,
-                                         const Matrix *aTransformHint) {
+void ScaledFontBase::CopyGlyphsToBuilder(const GlyphBuffer& aBuffer,
+                                         PathBuilder* aBuilder,
+                                         const Matrix* aTransformHint) {
   BackendType backendType = aBuilder->GetBackendType();
 #ifdef USE_SKIA
   if (backendType == BackendType::SKIA) {
-    PathBuilderSkia *builder = static_cast(aBuilder);
+    PathBuilderSkia* builder = static_cast(aBuilder);
     builder->AppendPath(GetSkiaPathForGlyphs(aBuffer));
     return;
   }
@@ -211,8 +211,8 @@ void ScaledFontBase::CopyGlyphsToBuilder(const GlyphBuffer &aBuffer,
   if (backendType == BackendType::CAIRO) {
     MOZ_ASSERT(mScaledFont);
 
-    PathBuilderCairo *builder = static_cast(aBuilder);
-    cairo_t *ctx = cairo_create(DrawTargetCairo::GetDummySurface());
+    PathBuilderCairo* builder = static_cast(aBuilder);
+    cairo_t* ctx = cairo_create(DrawTargetCairo::GetDummySurface());
 
     if (aTransformHint) {
       cairo_matrix_t mat;
@@ -249,9 +249,9 @@ void ScaledFontBase::CopyGlyphsToBuilder(const GlyphBuffer &aBuffer,
   MOZ_ASSERT(false, "Path not being copied");
 }
 
-void ScaledFontBase::GetGlyphDesignMetrics(const uint16_t *aGlyphs,
+void ScaledFontBase::GetGlyphDesignMetrics(const uint16_t* aGlyphs,
                                            uint32_t aNumGlyphs,
-                                           GlyphMetrics *aGlyphMetrics) {
+                                           GlyphMetrics* aGlyphMetrics) {
 #ifdef USE_CAIRO_SCALED_FONT
   if (mScaledFont) {
     for (uint32_t i = 0; i < aNumGlyphs; i++) {
@@ -270,7 +270,7 @@ void ScaledFontBase::GetGlyphDesignMetrics(const uint16_t *aGlyphs,
       aGlyphMetrics[i].mWidth = extents.width;
       aGlyphMetrics[i].mHeight = extents.height;
 
-      cairo_font_options_t *options = cairo_font_options_create();
+      cairo_font_options_t* options = cairo_font_options_create();
       cairo_scaled_font_get_font_options(mScaledFont, options);
 
       if (cairo_font_options_get_antialias(options) != CAIRO_ANTIALIAS_NONE) {
@@ -302,7 +302,7 @@ void ScaledFontBase::GetGlyphDesignMetrics(const uint16_t *aGlyphs,
 }
 
 #ifdef USE_CAIRO_SCALED_FONT
-void ScaledFontBase::SetCairoScaledFont(cairo_scaled_font_t *font) {
+void ScaledFontBase::SetCairoScaledFont(cairo_scaled_font_t* font) {
   MOZ_ASSERT(!mScaledFont);
 
   if (font == mScaledFont) return;
diff --git a/gfx/2d/SourceSurfaceD2D1.cpp b/gfx/2d/SourceSurfaceD2D1.cpp
index 60b725075d009..659b500c59bb1 100644
--- a/gfx/2d/SourceSurfaceD2D1.cpp
+++ b/gfx/2d/SourceSurfaceD2D1.cpp
@@ -10,15 +10,15 @@
 namespace mozilla {
 namespace gfx {
 
-SourceSurfaceD2D1::SourceSurfaceD2D1(ID2D1Image *aImage,
-                                     ID2D1DeviceContext *aDC,
+SourceSurfaceD2D1::SourceSurfaceD2D1(ID2D1Image* aImage,
+                                     ID2D1DeviceContext* aDC,
                                      SurfaceFormat aFormat,
-                                     const IntSize &aSize, DrawTargetD2D1 *aDT)
+                                     const IntSize& aSize, DrawTargetD2D1* aDT)
     : mImage(aImage),
       mDC(aDC),
       mDevice(Factory::GetD2D1Device()),
       mDrawTarget(aDT) {
-  aImage->QueryInterface((ID2D1Bitmap1 **)getter_AddRefs(mRealizedBitmap));
+  aImage->QueryInterface((ID2D1Bitmap1**)getter_AddRefs(mRealizedBitmap));
 
   mFormat = aFormat;
   mSize = aSize;
@@ -56,7 +56,7 @@ already_AddRefed SourceSurfaceD2D1::GetDataSurface() {
   props.bitmapOptions =
       D2D1_BITMAP_OPTIONS_CANNOT_DRAW | D2D1_BITMAP_OPTIONS_CPU_READ;
   hr = mDC->CreateBitmap(D2DIntSize(mSize), nullptr, 0, props,
-                         (ID2D1Bitmap1 **)getter_AddRefs(softwareBitmap));
+                         (ID2D1Bitmap1**)getter_AddRefs(softwareBitmap));
 
   if (FAILED(hr)) {
     gfxCriticalError() << "Failed to create software bitmap: " << mSize
@@ -100,7 +100,7 @@ bool SourceSurfaceD2D1::EnsureRealizedBitmap() {
   props.colorContext = nullptr;
   props.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET;
   dc->CreateBitmap(D2DIntSize(mSize), nullptr, 0, props,
-                   (ID2D1Bitmap1 **)getter_AddRefs(mRealizedBitmap));
+                   (ID2D1Bitmap1**)getter_AddRefs(mRealizedBitmap));
 
   dc->SetTarget(mRealizedBitmap);
 
@@ -128,7 +128,7 @@ void SourceSurfaceD2D1::DrawTargetWillChange() {
   props.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET;
   HRESULT hr =
       mDC->CreateBitmap(D2DIntSize(mSize), nullptr, 0, props,
-                        (ID2D1Bitmap1 **)getter_AddRefs(mRealizedBitmap));
+                        (ID2D1Bitmap1**)getter_AddRefs(mRealizedBitmap));
 
   if (FAILED(hr)) {
     gfxCriticalError()
@@ -160,7 +160,7 @@ void SourceSurfaceD2D1::MarkIndependent() {
   }
 }
 
-DataSourceSurfaceD2D1::DataSourceSurfaceD2D1(ID2D1Bitmap1 *aMappableBitmap,
+DataSourceSurfaceD2D1::DataSourceSurfaceD2D1(ID2D1Bitmap1* aMappableBitmap,
                                              SurfaceFormat aFormat)
     : mBitmap(aMappableBitmap),
       mFormat(aFormat),
@@ -179,14 +179,14 @@ IntSize DataSourceSurfaceD2D1::GetSize() const {
   return IntSize(int32_t(size.width), int32_t(size.height));
 }
 
-uint8_t *DataSourceSurfaceD2D1::GetData() {
+uint8_t* DataSourceSurfaceD2D1::GetData() {
   EnsureMapped();
 
   return mMap.bits;
 }
 
 bool DataSourceSurfaceD2D1::Map(MapType aMapType,
-                                MappedSurface *aMappedSurface) {
+                                MappedSurface* aMappedSurface) {
   // DataSourceSurfaces used with the new Map API should not be used with
   // GetData!!
   MOZ_ASSERT(!mImplicitMapped);
diff --git a/gfx/2d/SourceSurfaceD2D1.h b/gfx/2d/SourceSurfaceD2D1.h
index 56642268e1640..7d2ce10805aa2 100644
--- a/gfx/2d/SourceSurfaceD2D1.h
+++ b/gfx/2d/SourceSurfaceD2D1.h
@@ -22,9 +22,9 @@ class SourceSurfaceD2D1 : public SourceSurface {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceD2D1, override)
 
-  SourceSurfaceD2D1(ID2D1Image *aImage, ID2D1DeviceContext *aDC,
-                    SurfaceFormat aFormat, const IntSize &aSize,
-                    DrawTargetD2D1 *aDT = nullptr);
+  SourceSurfaceD2D1(ID2D1Image* aImage, ID2D1DeviceContext* aDC,
+                    SurfaceFormat aFormat, const IntSize& aSize,
+                    DrawTargetD2D1* aDT = nullptr);
   ~SourceSurfaceD2D1();
 
   SurfaceType GetType() const override { return SurfaceType::D2D1_1_IMAGE; }
@@ -33,7 +33,7 @@ class SourceSurfaceD2D1 : public SourceSurface {
   bool IsValid() const override;
   already_AddRefed GetDataSurface() override;
 
-  ID2D1Image *GetImage() { return mImage; }
+  ID2D1Image* GetImage() { return mImage; }
 
   void EnsureIndependent() {
     if (!mDrawTarget) return;
@@ -64,7 +64,7 @@ class SourceSurfaceD2D1 : public SourceSurface {
 
   SurfaceFormat mFormat;
   IntSize mSize;
-  DrawTargetD2D1 *mDrawTarget;
+  DrawTargetD2D1* mDrawTarget;
   std::shared_ptr mSnapshotLock;
 };
 
@@ -72,16 +72,16 @@ class DataSourceSurfaceD2D1 : public DataSourceSurface {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceD2D1, override)
 
-  DataSourceSurfaceD2D1(ID2D1Bitmap1 *aMappableBitmap, SurfaceFormat aFormat);
+  DataSourceSurfaceD2D1(ID2D1Bitmap1* aMappableBitmap, SurfaceFormat aFormat);
   ~DataSourceSurfaceD2D1();
 
   SurfaceType GetType() const override { return SurfaceType::DATA; }
   IntSize GetSize() const override;
   SurfaceFormat GetFormat() const override { return mFormat; }
   bool IsValid() const override { return !!mBitmap; }
-  uint8_t *GetData() override;
+  uint8_t* GetData() override;
   int32_t Stride() override;
-  bool Map(MapType, MappedSurface *aMappedSurface) override;
+  bool Map(MapType, MappedSurface* aMappedSurface) override;
   void Unmap() override;
 
  private:
diff --git a/gfx/2d/SourceSurfaceDual.h b/gfx/2d/SourceSurfaceDual.h
index ec211416eb7d1..4125c3c59c8b9 100644
--- a/gfx/2d/SourceSurfaceDual.h
+++ b/gfx/2d/SourceSurfaceDual.h
@@ -19,10 +19,10 @@ class SourceSurfaceDual : public SourceSurface {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceDual, override)
 
-  SourceSurfaceDual(DrawTarget *aDTA, DrawTarget *aDTB)
+  SourceSurfaceDual(DrawTarget* aDTA, DrawTarget* aDTB)
       : mA(aDTA->Snapshot()), mB(aDTB->Snapshot()) {}
 
-  SourceSurfaceDual(SourceSurface *aSourceA, SourceSurface *aSourceB)
+  SourceSurfaceDual(SourceSurface* aSourceA, SourceSurface* aSourceB)
       : mA(aSourceA), mB(aSourceB) {}
 
   virtual SurfaceType GetType() const override { return SurfaceType::DUAL_DT; }
@@ -36,7 +36,7 @@ class SourceSurfaceDual : public SourceSurface {
     return mA->GetDataSurface();
   }
 
-  SourceSurface *GetFirstSurface() {
+  SourceSurface* GetFirstSurface() {
     MOZ_ASSERT(mA->GetType() == mB->GetType());
     return mA;
   }
diff --git a/gfx/2d/Tools.h b/gfx/2d/Tools.h
index c58e9c1a3612b..3f8c71128a760 100644
--- a/gfx/2d/Tools.h
+++ b/gfx/2d/Tools.h
@@ -35,8 +35,8 @@ template 
 struct ClassStorage {
   char bytes[sizeof(T)];
 
-  const T *addr() const { return (const T *)bytes; }
-  T *addr() { return (T *)(void *)bytes; }
+  const T* addr() const { return (const T*)bytes; }
+  T* addr() { return (T*)(void*)bytes; }
 };
 
 static inline bool FuzzyEqual(Float aA, Float aB, Float aErr) {
@@ -46,7 +46,7 @@ static inline bool FuzzyEqual(Float aA, Float aB, Float aErr) {
   return false;
 }
 
-static inline void NudgeToInteger(float *aVal) {
+static inline void NudgeToInteger(float* aVal) {
   float r = floorf(*aVal + 0.5f);
   // The error threshold should be proportional to the rounded value. This
   // bounds the relative error introduced by the nudge operation. However,
@@ -58,14 +58,14 @@ static inline void NudgeToInteger(float *aVal) {
   }
 }
 
-static inline void NudgeToInteger(float *aVal, float aErr) {
+static inline void NudgeToInteger(float* aVal, float aErr) {
   float r = floorf(*aVal + 0.5f);
   if (FuzzyEqual(r, *aVal, aErr)) {
     *aVal = r;
   }
 }
 
-static inline void NudgeToInteger(double *aVal) {
+static inline void NudgeToInteger(double* aVal) {
   float f = float(*aVal);
   NudgeToInteger(&f);
   *aVal = f;
@@ -125,9 +125,9 @@ struct AlignedArray final {
     if (aZero) {
       // calloc can be more efficient than new[] for large chunks,
       // so we use calloc/malloc/free for everything.
-      mStorage = static_cast(calloc(1u, storageByteCount.value()));
+      mStorage = static_cast(calloc(1u, storageByteCount.value()));
     } else {
-      mStorage = static_cast(malloc(storageByteCount.value()));
+      mStorage = static_cast(malloc(storageByteCount.value()));
     }
     if (!mStorage) {
       mStorage = nullptr;
@@ -138,10 +138,10 @@ struct AlignedArray final {
     if (uintptr_t(mStorage) % alignment) {
       // Our storage does not start at a -byte boundary. Make sure
       // mPtr does!
-      mPtr = (T *)(uintptr_t(mStorage) + alignment -
-                   (uintptr_t(mStorage) % alignment));
+      mPtr = (T*)(uintptr_t(mStorage) + alignment -
+                  (uintptr_t(mStorage) % alignment));
     } else {
-      mPtr = (T *)(mStorage);
+      mPtr = (T*)(mStorage);
     }
     // Now that mPtr is pointing to the aligned position we can use placement
     // |operator new| to invoke any ctors at the correct positions. For types
@@ -151,7 +151,7 @@ struct AlignedArray final {
     mCount = aCount;
   }
 
-  void Swap(AlignedArray &aOther) {
+  void Swap(AlignedArray& aOther) {
     mozilla::Swap(mPtr, aOther.mPtr);
     mozilla::Swap(mStorage, aOther.mStorage);
     mozilla::Swap(mCount, aOther.mCount);
@@ -161,12 +161,12 @@ struct AlignedArray final {
     return aMallocSizeOf(mStorage);
   }
 
-  MOZ_ALWAYS_INLINE operator T *() { return mPtr; }
+  MOZ_ALWAYS_INLINE operator T*() { return mPtr; }
 
-  T *mPtr;
+  T* mPtr;
 
  private:
-  uint8_t *mStorage;
+  uint8_t* mStorage;
   size_t mCount;
 };
 
diff --git a/gfx/2d/UserData.h b/gfx/2d/UserData.h
index b59b81c17ab7b..b5c5cc51c310c 100644
--- a/gfx/2d/UserData.h
+++ b/gfx/2d/UserData.h
@@ -20,14 +20,14 @@ struct UserDataKey {
 
 /* this class is basically a clone of the user data concept from cairo */
 class UserData {
-  typedef void (*destroyFunc)(void *data);
+  typedef void (*destroyFunc)(void* data);
 
  public:
   UserData() : count(0), entries(nullptr) {}
 
   /* Attaches untyped userData associated with key. destroy is called on
    * destruction */
-  void Add(UserDataKey *key, void *userData, destroyFunc destroy) {
+  void Add(UserDataKey* key, void* userData, destroyFunc destroy) {
     for (int i = 0; i < count; i++) {
       if (key == entries[i].key) {
         if (entries[i].destroy) {
@@ -44,7 +44,7 @@ class UserData {
     // do (see bug 666609). Plus, the entries array is expect to stay small
     // so doing a realloc everytime we add a new entry shouldn't be too costly
     entries =
-        static_cast(realloc(entries, sizeof(Entry) * (count + 1)));
+        static_cast(realloc(entries, sizeof(Entry) * (count + 1)));
 
     if (!entries) {
       MOZ_CRASH("GFX: UserData::Add");
@@ -58,10 +58,10 @@ class UserData {
   }
 
   /* Remove and return user data associated with key, without destroying it */
-  void *Remove(UserDataKey *key) {
+  void* Remove(UserDataKey* key) {
     for (int i = 0; i < count; i++) {
       if (key == entries[i].key) {
-        void *userData = entries[i].userData;
+        void* userData = entries[i].userData;
         // decrement before looping so entries[i+1] doesn't read past the end:
         --count;
         for (; i < count; i++) {
@@ -74,7 +74,7 @@ class UserData {
   }
 
   /* Remove and destroy a given key */
-  void RemoveAndDestroy(UserDataKey *key) {
+  void RemoveAndDestroy(UserDataKey* key) {
     for (int i = 0; i < count; i++) {
       if (key == entries[i].key) {
         if (entries[i].destroy) {
@@ -90,7 +90,7 @@ class UserData {
   }
 
   /* Retrives the userData for the associated key */
-  void *Get(UserDataKey *key) const {
+  void* Get(UserDataKey* key) const {
     for (int i = 0; i < count; i++) {
       if (key == entries[i].key) {
         return entries[i].userData;
@@ -99,7 +99,7 @@ class UserData {
     return nullptr;
   }
 
-  bool Has(UserDataKey *key) {
+  bool Has(UserDataKey* key) {
     for (int i = 0; i < count; i++) {
       if (key == entries[i].key) {
         return true;
@@ -123,13 +123,13 @@ class UserData {
 
  private:
   struct Entry {
-    const UserDataKey *key;
-    void *userData;
+    const UserDataKey* key;
+    void* userData;
     destroyFunc destroy;
   };
 
   int count;
-  Entry *entries;
+  Entry* entries;
 };
 
 }  // namespace gfx
diff --git a/gfx/2d/ssse3-scaler.c b/gfx/2d/ssse3-scaler.c
index 074f60ea1b902..8bfeb8b785f24 100644
--- a/gfx/2d/ssse3-scaler.c
+++ b/gfx/2d/ssse3-scaler.c
@@ -78,9 +78,9 @@ static force_inline int pixman_fixed_to_bilinear_weight(pixman_fixed_t x) {
          ((1 << BILINEAR_INTERPOLATION_BITS) - 1);
 }
 
-static void pixman_transform_point_31_16_3d(const pixman_transform_t *t,
-                                            const pixman_vector_48_16_t *v,
-                                            pixman_vector_48_16_t *result) {
+static void pixman_transform_point_31_16_3d(const pixman_transform_t* t,
+                                            const pixman_vector_48_16_t* v,
+                                            pixman_vector_48_16_t* result) {
   int i;
   int64_t tmp[3][2];
 
@@ -108,7 +108,7 @@ static void pixman_transform_point_31_16_3d(const pixman_transform_t *t,
 }
 
 static pixman_bool_t pixman_transform_point_3d(
-    const struct pixman_transform *transform, struct pixman_vector *vector) {
+    const struct pixman_transform* transform, struct pixman_vector* vector) {
   pixman_vector_48_16_t tmp;
   tmp.v[0] = vector->vector[0];
   tmp.v[1] = vector->vector[1];
@@ -125,9 +125,9 @@ static pixman_bool_t pixman_transform_point_3d(
 }
 
 struct bits_image_t {
-  uint32_t *bits;
+  uint32_t* bits;
   int rowstride;
-  pixman_transform_t *transform;
+  pixman_transform_t* transform;
 };
 
 typedef struct bits_image_t bits_image_t;
@@ -136,21 +136,21 @@ typedef struct {
 } pixman_iter_info_t;
 
 typedef struct pixman_iter_t pixman_iter_t;
-typedef void (*pixman_iter_fini_t)(pixman_iter_t *iter);
+typedef void (*pixman_iter_fini_t)(pixman_iter_t* iter);
 
 struct pixman_iter_t {
   int x, y;
   pixman_iter_fini_t fini;
-  bits_image_t *image;
-  uint32_t *buffer;
+  bits_image_t* image;
+  uint32_t* buffer;
   int width;
   int height;
-  void *data;
+  void* data;
 };
 
 typedef struct {
   int y;
-  uint64_t *buffer;
+  uint64_t* buffer;
 } line_t;
 
 typedef struct {
@@ -160,15 +160,15 @@ typedef struct {
   uint64_t data[1];
 } bilinear_info_t;
 
-static void ssse3_fetch_horizontal(bits_image_t *image, line_t *line, int y,
+static void ssse3_fetch_horizontal(bits_image_t* image, line_t* line, int y,
                                    pixman_fixed_t x, pixman_fixed_t ux, int n) {
-  uint32_t *bits = image->bits + y * image->rowstride;
+  uint32_t* bits = image->bits + y * image->rowstride;
   __m128i vx = _mm_set_epi16(-(x + 1), x, -(x + 1), x, -(x + ux + 1), x + ux,
                              -(x + ux + 1), x + ux);
   __m128i vux = _mm_set_epi16(-2 * ux, 2 * ux, -2 * ux, 2 * ux, -2 * ux, 2 * ux,
                               -2 * ux, 2 * ux);
   __m128i vaddc = _mm_set_epi16(1, 0, 1, 0, 1, 0, 1, 0);
-  __m128i *b = (__m128i *)line->buffer;
+  __m128i* b = (__m128i*)line->buffer;
   __m128i vrl0, vrl1;
 
   while ((n -= 2) >= 0) {
@@ -180,22 +180,22 @@ static void ssse3_fetch_horizontal(bits_image_t *image, line_t *line, int y,
     } else {
       if (pixman_fixed_to_int(x + ux) < 0) printf("underflow\n");
       vrl1 = _mm_loadl_epi64(
-          (__m128i *)(bits + (pixman_fixed_to_int(x + ux) < 0
-                                  ? 0
-                                  : pixman_fixed_to_int(x + ux))));
+          (__m128i*)(bits + (pixman_fixed_to_int(x + ux) < 0
+                                 ? 0
+                                 : pixman_fixed_to_int(x + ux))));
     }
 #else
-    vrl1 = _mm_loadl_epi64((__m128i *)(bits + pixman_fixed_to_int(x + ux)));
+    vrl1 = _mm_loadl_epi64((__m128i*)(bits + pixman_fixed_to_int(x + ux)));
 #endif
     /* vrl1: R1, L1 */
 
   final_pixel:
 #ifdef HACKY_PADDING
     vrl0 = _mm_loadl_epi64(
-        (__m128i *)(bits +
-                    (pixman_fixed_to_int(x) < 0 ? 0 : pixman_fixed_to_int(x))));
+        (__m128i*)(bits +
+                   (pixman_fixed_to_int(x) < 0 ? 0 : pixman_fixed_to_int(x))));
 #else
-    vrl0 = _mm_loadl_epi64((__m128i *)(bits + pixman_fixed_to_int(x)));
+    vrl0 = _mm_loadl_epi64((__m128i*)(bits + pixman_fixed_to_int(x)));
 #endif
     /* vrl0: R0, L0 */
 
@@ -277,10 +277,10 @@ static void ssse3_fetch_horizontal(bits_image_t *image, line_t *line, int y,
 }
 
 // scale a line of destination pixels
-static uint32_t *ssse3_fetch_bilinear_cover(pixman_iter_t *iter,
-                                            const uint32_t *mask) {
+static uint32_t* ssse3_fetch_bilinear_cover(pixman_iter_t* iter,
+                                            const uint32_t* mask) {
   pixman_fixed_t fx, ux;
-  bilinear_info_t *info = iter->data;
+  bilinear_info_t* info = iter->data;
   line_t *line0, *line1;
   int y0, y1;
   int32_t dist_y;
@@ -291,7 +291,7 @@ static uint32_t *ssse3_fetch_bilinear_cover(pixman_iter_t *iter,
   ux = iter->image->transform->matrix[0][0];
 
   y0 = pixman_fixed_to_int(info->y);
-  if (y0 < 0) *(volatile char *)0 = 9;
+  if (y0 < 0) *(volatile char*)0 = 9;
   y1 = y0 + 1;
 
   // clamping in y direction
@@ -335,10 +335,10 @@ static uint32_t *ssse3_fetch_bilinear_cover(pixman_iter_t *iter,
 #endif
 
   for (i = 0; i + 3 < iter->width; i += 4) {
-    __m128i top0 = _mm_load_si128((__m128i *)(line0->buffer + i));
-    __m128i bot0 = _mm_load_si128((__m128i *)(line1->buffer + i));
-    __m128i top1 = _mm_load_si128((__m128i *)(line0->buffer + i + 2));
-    __m128i bot1 = _mm_load_si128((__m128i *)(line1->buffer + i + 2));
+    __m128i top0 = _mm_load_si128((__m128i*)(line0->buffer + i));
+    __m128i bot0 = _mm_load_si128((__m128i*)(line1->buffer + i));
+    __m128i top1 = _mm_load_si128((__m128i*)(line0->buffer + i + 2));
+    __m128i bot1 = _mm_load_si128((__m128i*)(line1->buffer + i + 2));
 #ifdef PIXMAN_STYLE_INTERPOLATION
     __m128i r0, r1, tmp, p;
 
@@ -379,12 +379,12 @@ static uint32_t *ssse3_fetch_bilinear_cover(pixman_iter_t *iter,
 #endif
 
     p = _mm_packus_epi16(r0, r1);
-    _mm_storeu_si128((__m128i *)(iter->buffer + i), p);
+    _mm_storeu_si128((__m128i*)(iter->buffer + i), p);
   }
 
   while (i < iter->width) {
-    __m128i top0 = _mm_load_si128((__m128i *)(line0->buffer + i));
-    __m128i bot0 = _mm_load_si128((__m128i *)(line1->buffer + i));
+    __m128i top0 = _mm_load_si128((__m128i*)(line0->buffer + i));
+    __m128i bot0 = _mm_load_si128((__m128i*)(line1->buffer + i));
 
 #ifdef PIXMAN_STYLE_INTERPOLATION
     __m128i r0, tmp, p;
@@ -408,10 +408,10 @@ static uint32_t *ssse3_fetch_bilinear_cover(pixman_iter_t *iter,
     p = _mm_packus_epi16(r0, r0);
 
     if (iter->width - i == 1) {
-      *(uint32_t *)(iter->buffer + i) = _mm_cvtsi128_si32(p);
+      *(uint32_t*)(iter->buffer + i) = _mm_cvtsi128_si32(p);
       i++;
     } else {
-      _mm_storel_epi64((__m128i *)(iter->buffer + i), p);
+      _mm_storel_epi64((__m128i*)(iter->buffer + i), p);
       i += 2;
     }
   }
@@ -421,13 +421,13 @@ static uint32_t *ssse3_fetch_bilinear_cover(pixman_iter_t *iter,
   return iter->buffer;
 }
 
-static void ssse3_bilinear_cover_iter_fini(pixman_iter_t *iter) {
+static void ssse3_bilinear_cover_iter_fini(pixman_iter_t* iter) {
   free(iter->data);
 }
 
-static void ssse3_bilinear_cover_iter_init(pixman_iter_t *iter) {
+static void ssse3_bilinear_cover_iter_init(pixman_iter_t* iter) {
   int width = iter->width;
-  bilinear_info_t *info;
+  bilinear_info_t* info;
   pixman_vector_t v;
 
   if (iter->x > PIXMAN_FIXED_INT_MAX || iter->x < PIXMAN_FIXED_INT_MIN ||
@@ -447,7 +447,7 @@ static void ssse3_bilinear_cover_iter_init(pixman_iter_t *iter) {
   info->x = v.vector[0] - pixman_fixed_1 / 2;
   info->y = v.vector[1] - pixman_fixed_1 / 2;
 
-#define ALIGN(addr) ((void *)((((uintptr_t)(addr)) + 15) & (~15)))
+#define ALIGN(addr) ((void*)((((uintptr_t)(addr)) + 15) & (~15)))
 
   /* It is safe to set the y coordinates to -1 initially
    * because COVER_CLIP_BILINEAR ensures that we will only
@@ -473,8 +473,8 @@ static void ssse3_bilinear_cover_iter_init(pixman_iter_t *iter) {
 /* scale the src from src_width/height to dest_width/height drawn
  * into the rectangle x,y width,height
  * src_stride and dst_stride are 4 byte units */
-bool ssse3_scale_data(uint32_t *src, int src_width, int src_height,
-                      int src_stride, uint32_t *dest, int dest_width,
+bool ssse3_scale_data(uint32_t* src, int src_width, int src_height,
+                      int src_stride, uint32_t* dest, int dest_width,
                       int dest_height, int dest_stride, int x, int y, int width,
                       int height) {
   // XXX: assert(src_width > 1)
diff --git a/gfx/2d/ssse3-scaler.h b/gfx/2d/ssse3-scaler.h
index c08dacbbcf683..4496e5b5df1a5 100644
--- a/gfx/2d/ssse3-scaler.h
+++ b/gfx/2d/ssse3-scaler.h
@@ -12,8 +12,8 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-bool ssse3_scale_data(uint32_t *src, int src_width, int src_height,
-                      int src_stride, uint32_t *dest, int dest_width,
+bool ssse3_scale_data(uint32_t* src, int src_width, int src_height,
+                      int src_stride, uint32_t* dest, int dest_width,
                       int dest_height, int dest_rowstride, int x, int y,
                       int width, int height);
 #ifdef __cplusplus
diff --git a/gfx/2d/unittest/Main.cpp b/gfx/2d/unittest/Main.cpp
index 89e865c1db1e5..006127b371bc4 100644
--- a/gfx/2d/unittest/Main.cpp
+++ b/gfx/2d/unittest/Main.cpp
@@ -16,7 +16,7 @@
 #include 
 
 struct TestObject {
-  TestBase *test;
+  TestBase* test;
   std::string name;
 };
 
diff --git a/gfx/2d/unittest/TestBase.cpp b/gfx/2d/unittest/TestBase.cpp
index dd1df90123093..e389267b71bbc 100644
--- a/gfx/2d/unittest/TestBase.cpp
+++ b/gfx/2d/unittest/TestBase.cpp
@@ -10,7 +10,7 @@
 
 using namespace std;
 
-int TestBase::RunTests(int *aFailures) {
+int TestBase::RunTests(int* aFailures) {
   int testsRun = 0;
   *aFailures = 0;
 
@@ -26,7 +26,7 @@ int TestBase::RunTests(int *aFailures) {
     // of child clases, so we reinterpret cast those child class pointers to
     // TestBase and then call the functions. Because the compiler believes
     // these function calls are members of TestBase.
-    ((*reinterpret_cast((mTests[i].implPointer))).*
+    ((*reinterpret_cast((mTests[i].implPointer))).*
      (mTests[i].funcCall))();
 
     if (!mTestFailed) {
diff --git a/gfx/2d/unittest/TestBase.h b/gfx/2d/unittest/TestBase.h
index 95018c236e796..701451d0c3217 100644
--- a/gfx/2d/unittest/TestBase.h
+++ b/gfx/2d/unittest/TestBase.h
@@ -30,17 +30,17 @@ class TestBase {
 
   typedef void (TestBase::*TestCall)();
 
-  int RunTests(int *aFailures);
+  int RunTests(int* aFailures);
 
  protected:
   static void LogMessage(std::string aMessage);
 
   struct Test {
-    Test(TestCall aCall, std::string aName, void *aImplPointer)
+    Test(TestCall aCall, std::string aName, void* aImplPointer)
         : funcCall(aCall), name(aName), implPointer(aImplPointer) {}
     TestCall funcCall;
     std::string name;
-    void *implPointer;
+    void* implPointer;
   };
   std::vector mTests;
 
@@ -48,5 +48,5 @@ class TestBase {
 
  private:
   // This doesn't really work with our generic member pointer trick.
-  TestBase(const TestBase &aOther);
+  TestBase(const TestBase& aOther);
 };
diff --git a/gfx/2d/unittest/TestCairo.cpp b/gfx/2d/unittest/TestCairo.cpp
index 1f9530c55b5e6..4ed7ad4d4af17 100644
--- a/gfx/2d/unittest/TestCairo.cpp
+++ b/gfx/2d/unittest/TestCairo.cpp
@@ -12,11 +12,11 @@ namespace layers {
 static void TryCircle(double centerX, double centerY, double radius) {
   printf("TestCairo:TryArcs centerY %f, radius %f\n", centerY, radius);
 
-  cairo_surface_t *surf =
+  cairo_surface_t* surf =
       cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 8, 21);
   ASSERT_TRUE(surf != nullptr);
 
-  cairo_t *cairo = cairo_create(surf);
+  cairo_t* cairo = cairo_create(surf);
   ASSERT_TRUE(cairo != nullptr);
 
   cairo_set_antialias(cairo, CAIRO_ANTIALIAS_NONE);
@@ -57,10 +57,10 @@ TEST(Cairo, Bug1063486)
   double x1, y1, x2, y2;
   const double epsilon = .01;
 
-  cairo_surface_t *surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1);
+  cairo_surface_t* surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1);
   ASSERT_TRUE(surf != nullptr);
 
-  cairo_t *cairo = cairo_create(surf);
+  cairo_t* cairo = cairo_create(surf);
   ASSERT_TRUE(cairo != nullptr);
 
   printf("Path 1\n");
diff --git a/gfx/2d/unittest/TestDrawTargetBase.cpp b/gfx/2d/unittest/TestDrawTargetBase.cpp
index 45f76729399ff..67759cb10986b 100644
--- a/gfx/2d/unittest/TestDrawTargetBase.cpp
+++ b/gfx/2d/unittest/TestDrawTargetBase.cpp
@@ -46,8 +46,8 @@ void TestDrawTargetBase::RefreshSnapshot() {
   mDataSnapshot = snapshot->GetDataSurface();
 }
 
-void TestDrawTargetBase::VerifyAllPixels(const Color &aColor) {
-  uint32_t *colVal = (uint32_t *)mDataSnapshot->GetData();
+void TestDrawTargetBase::VerifyAllPixels(const Color& aColor) {
+  uint32_t* colVal = (uint32_t*)mDataSnapshot->GetData();
 
   uint32_t expected = RGBAPixelFromColor(aColor);
 
@@ -62,9 +62,9 @@ void TestDrawTargetBase::VerifyAllPixels(const Color &aColor) {
   }
 }
 
-void TestDrawTargetBase::VerifyPixel(const IntPoint &aPoint,
-                                     mozilla::gfx::Color &aColor) {
-  uint32_t *colVal = (uint32_t *)mDataSnapshot->GetData();
+void TestDrawTargetBase::VerifyPixel(const IntPoint& aPoint,
+                                     mozilla::gfx::Color& aColor) {
+  uint32_t* colVal = (uint32_t*)mDataSnapshot->GetData();
 
   uint32_t expected = RGBAPixelFromColor(aColor);
   uint32_t rawActual =
@@ -95,7 +95,7 @@ void TestDrawTargetBase::VerifyPixel(const IntPoint &aPoint,
   }
 }
 
-uint32_t TestDrawTargetBase::RGBAPixelFromColor(const Color &aColor) {
+uint32_t TestDrawTargetBase::RGBAPixelFromColor(const Color& aColor) {
   return uint8_t((aColor.b * 255) + 0.5f) |
          uint8_t((aColor.g * 255) + 0.5f) << 8 |
          uint8_t((aColor.r * 255) + 0.5f) << 16 |
diff --git a/gfx/2d/unittest/TestDrawTargetBase.h b/gfx/2d/unittest/TestDrawTargetBase.h
index 518e8012fc095..c0616b07e0e90 100644
--- a/gfx/2d/unittest/TestDrawTargetBase.h
+++ b/gfx/2d/unittest/TestDrawTargetBase.h
@@ -27,11 +27,11 @@ class TestDrawTargetBase : public TestBase {
 
   void RefreshSnapshot();
 
-  void VerifyAllPixels(const mozilla::gfx::Color &aColor);
-  void VerifyPixel(const mozilla::gfx::IntPoint &aPoint,
-                   mozilla::gfx::Color &aColor);
+  void VerifyAllPixels(const mozilla::gfx::Color& aColor);
+  void VerifyPixel(const mozilla::gfx::IntPoint& aPoint,
+                   mozilla::gfx::Color& aColor);
 
-  uint32_t RGBAPixelFromColor(const mozilla::gfx::Color &aColor);
+  uint32_t RGBAPixelFromColor(const mozilla::gfx::Color& aColor);
 
   RefPtr mDT;
   RefPtr mDataSnapshot;
diff --git a/gfx/2d/unittest/TestScaling.cpp b/gfx/2d/unittest/TestScaling.cpp
index d0997119fb758..fd15455f26cc8 100644
--- a/gfx/2d/unittest/TestScaling.cpp
+++ b/gfx/2d/unittest/TestScaling.cpp
@@ -24,7 +24,7 @@ void TestScaling::BasicHalfScale() {
   std::vector data;
   data.resize(500 * 500 * 4);
 
-  uint32_t *pixels = reinterpret_cast(&data.front());
+  uint32_t* pixels = reinterpret_cast(&data.front());
   for (int y = 0; y < 500; y += 2) {
     for (int x = 0; x < 500; x += 2) {
       pixels[y * 500 + x] = 0xff00ff00;
@@ -40,7 +40,7 @@ void TestScaling::BasicHalfScale() {
   VERIFY(scaler.GetSize().width == 250);
   VERIFY(scaler.GetSize().height == 250);
 
-  pixels = (uint32_t *)scaler.GetScaledData();
+  pixels = (uint32_t*)scaler.GetScaledData();
 
   for (int y = 0; y < 250; y++) {
     for (int x = 0; x < 250; x++) {
@@ -53,7 +53,7 @@ void TestScaling::DoubleHalfScale() {
   std::vector data;
   data.resize(500 * 500 * 4);
 
-  uint32_t *pixels = reinterpret_cast(&data.front());
+  uint32_t* pixels = reinterpret_cast(&data.front());
   for (int y = 0; y < 500; y += 2) {
     for (int x = 0; x < 500; x += 2) {
       pixels[y * 500 + x] = 0xff00ff00;
@@ -68,7 +68,7 @@ void TestScaling::DoubleHalfScale() {
   VERIFY(scaler.GetSize().width == 125);
   VERIFY(scaler.GetSize().height == 125);
 
-  pixels = (uint32_t *)scaler.GetScaledData();
+  pixels = (uint32_t*)scaler.GetScaledData();
 
   for (int y = 0; y < 125; y++) {
     for (int x = 0; x < 125; x++) {
@@ -83,7 +83,7 @@ void TestScaling::UnevenHalfScale() {
   // separately.
   data.resize(499 * 500 * 4);
 
-  uint32_t *pixels = reinterpret_cast(&data.front());
+  uint32_t* pixels = reinterpret_cast(&data.front());
   for (int y = 0; y < 500; y += 2) {
     for (int x = 0; x < 500; x += 2) {
       pixels[y * 500 + x] = 0xff00ff00;
@@ -104,7 +104,7 @@ void TestScaling::UnevenHalfScale() {
   VERIFY(scaler.GetSize().width == 249);
   VERIFY(scaler.GetSize().height == 249);
 
-  pixels = (uint32_t *)scaler.GetScaledData();
+  pixels = (uint32_t*)scaler.GetScaledData();
 
   for (int y = 0; y < 249; y++) {
     for (int x = 0; x < 249; x++) {
@@ -118,7 +118,7 @@ void TestScaling::OddStrideHalfScale() {
   // Use a 4-byte aligned stride to test if that doesn't cause any issues.
   data.resize(499 * 499 * 4);
 
-  uint32_t *pixels = reinterpret_cast(&data.front());
+  uint32_t* pixels = reinterpret_cast(&data.front());
   for (int y = 0; y < 500; y += 2) {
     for (int x = 0; x < 500; x += 2) {
       pixels[y * 499 + x] = 0xff00ff00;
@@ -139,7 +139,7 @@ void TestScaling::OddStrideHalfScale() {
   VERIFY(scaler.GetSize().width == 249);
   VERIFY(scaler.GetSize().height == 249);
 
-  pixels = (uint32_t *)scaler.GetScaledData();
+  pixels = (uint32_t*)scaler.GetScaledData();
 
   for (int y = 0; y < 249; y++) {
     for (int x = 0; x < 249; x++) {
@@ -151,7 +151,7 @@ void TestScaling::VerticalHalfScale() {
   std::vector data;
   data.resize(500 * 500 * 4);
 
-  uint32_t *pixels = reinterpret_cast(&data.front());
+  uint32_t* pixels = reinterpret_cast(&data.front());
   for (int y = 0; y < 500; y += 2) {
     for (int x = 0; x < 500; x += 2) {
       pixels[y * 500 + x] = 0xff00ff00;
@@ -166,7 +166,7 @@ void TestScaling::VerticalHalfScale() {
   VERIFY(scaler.GetSize().width == 500);
   VERIFY(scaler.GetSize().height == 250);
 
-  pixels = (uint32_t *)scaler.GetScaledData();
+  pixels = (uint32_t*)scaler.GetScaledData();
 
   for (int y = 0; y < 250; y++) {
     for (int x = 0; x < 500; x += 2) {
@@ -180,7 +180,7 @@ void TestScaling::HorizontalHalfScale() {
   std::vector data;
   data.resize(520 * 500 * 4);
 
-  uint32_t *pixels = reinterpret_cast(&data.front());
+  uint32_t* pixels = reinterpret_cast(&data.front());
   for (int y = 0; y < 500; y++) {
     for (int x = 0; x < 520; x += 8) {
       pixels[y * 520 + x] = 0xff00ff00;
@@ -199,7 +199,7 @@ void TestScaling::HorizontalHalfScale() {
   VERIFY(scaler.GetSize().width == 260);
   VERIFY(scaler.GetSize().height == 500);
 
-  pixels = (uint32_t *)scaler.GetScaledData();
+  pixels = (uint32_t*)scaler.GetScaledData();
 
   for (int y = 0; y < 500; y++) {
     for (int x = 0; x < 260; x += 4) {
@@ -215,7 +215,7 @@ void TestScaling::MixedHalfScale() {
   std::vector data;
   data.resize(500 * 500 * 4);
 
-  uint32_t *pixels = reinterpret_cast(&data.front());
+  uint32_t* pixels = reinterpret_cast(&data.front());
   for (int y = 0; y < 500; y += 2) {
     for (int x = 0; x < 500; x += 2) {
       pixels[y * 500 + x] = 0xff00ff00;
diff --git a/gfx/ipc/SharedDIB.cpp b/gfx/ipc/SharedDIB.cpp
index c99335611cbde..7593c41a45115 100644
--- a/gfx/ipc/SharedDIB.cpp
+++ b/gfx/ipc/SharedDIB.cpp
@@ -46,7 +46,7 @@ nsresult SharedDIB::Attach(Handle aHandle, uint32_t aSize) {
 }
 
 nsresult SharedDIB::ShareToProcess(base::ProcessId aTargetPid,
-                                   Handle *aNewHandle) {
+                                   Handle* aNewHandle) {
   if (!mShMem) return NS_ERROR_UNEXPECTED;
 
   if (!mShMem->ShareToProcess(aTargetPid, aNewHandle))
diff --git a/gfx/ipc/SharedDIB.h b/gfx/ipc/SharedDIB.h
index bff4531e10419..d957bb8269ce0 100644
--- a/gfx/ipc/SharedDIB.h
+++ b/gfx/ipc/SharedDIB.h
@@ -38,10 +38,10 @@ class SharedDIB {
   nsresult Attach(Handle aHandle, uint32_t aSize);
 
   // Returns a SharedMemoryHandle suitable for sharing with another process.
-  nsresult ShareToProcess(base::ProcessId aTargetPid, Handle *aNewHandle);
+  nsresult ShareToProcess(base::ProcessId aTargetPid, Handle* aNewHandle);
 
  protected:
-  base::SharedMemory *mShMem;
+  base::SharedMemory* mShMem;
 };
 
 }  // namespace gfx
diff --git a/gfx/ipc/SharedDIBWin.cpp b/gfx/ipc/SharedDIBWin.cpp
index 76f83d6f9cee4..b879277def98d 100644
--- a/gfx/ipc/SharedDIBWin.cpp
+++ b/gfx/ipc/SharedDIBWin.cpp
@@ -75,10 +75,10 @@ nsresult SharedDIBWin::Attach(Handle aHandle, uint32_t aWidth, uint32_t aHeight,
 
 uint32_t SharedDIBWin::SetupBitmapHeader(uint32_t aWidth, uint32_t aHeight,
                                          bool aTransparent,
-                                         BITMAPV4HEADER *aHeader) {
+                                         BITMAPV4HEADER* aHeader) {
   // D3D cannot handle an offscreen memory that pitch (SysMemPitch) is negative.
   // So we create top-to-bottom DIB.
-  memset((void *)aHeader, 0, sizeof(BITMAPV4HEADER));
+  memset((void*)aHeader, 0, sizeof(BITMAPV4HEADER));
   aHeader->bV4Size = sizeof(BITMAPV4HEADER);
   aHeader->bV4Width = aWidth;
   aHeader->bV4Height = -LONG(aHeight);  // top-to-buttom DIB
@@ -95,14 +95,13 @@ uint32_t SharedDIBWin::SetupBitmapHeader(uint32_t aWidth, uint32_t aHeight,
           (-aHeader->bV4Height * aHeader->bV4Width * kBytesPerPixel));
 }
 
-nsresult SharedDIBWin::SetupSurface(HDC aHdc, BITMAPV4HEADER *aHdr) {
+nsresult SharedDIBWin::SetupSurface(HDC aHdc, BITMAPV4HEADER* aHdr) {
   mSharedHdc = ::CreateCompatibleDC(aHdc);
 
   if (!mSharedHdc) return NS_ERROR_FAILURE;
 
-  mSharedBmp =
-      ::CreateDIBSection(mSharedHdc, (BITMAPINFO *)aHdr, DIB_RGB_COLORS,
-                         &mBitmapBits, mShMem->handle(), kHeaderBytes);
+  mSharedBmp = ::CreateDIBSection(mSharedHdc, (BITMAPINFO*)aHdr, DIB_RGB_COLORS,
+                                  &mBitmapBits, mShMem->handle(), kHeaderBytes);
   if (!mSharedBmp) return NS_ERROR_FAILURE;
 
   mOldObj = SelectObject(mSharedHdc, mSharedBmp);
diff --git a/gfx/layers/AxisPhysicsMSDModel.cpp b/gfx/layers/AxisPhysicsMSDModel.cpp
index 2197dac92416e..fdcc5c453434e 100644
--- a/gfx/layers/AxisPhysicsMSDModel.cpp
+++ b/gfx/layers/AxisPhysicsMSDModel.cpp
@@ -40,7 +40,7 @@ AxisPhysicsMSDModel::AxisPhysicsMSDModel(double aInitialPosition,
 
 AxisPhysicsMSDModel::~AxisPhysicsMSDModel() {}
 
-double AxisPhysicsMSDModel::Acceleration(const State &aState) {
+double AxisPhysicsMSDModel::Acceleration(const State& aState) {
   // Simulate a Mass-Damper-Spring Model; assume a unit mass
 
   // Hooke’s Law: http://en.wikipedia.org/wiki/Hooke%27s_law
diff --git a/gfx/layers/AxisPhysicsMSDModel.h b/gfx/layers/AxisPhysicsMSDModel.h
index 9bc784bf55fd8..e624293c4b0db 100644
--- a/gfx/layers/AxisPhysicsMSDModel.h
+++ b/gfx/layers/AxisPhysicsMSDModel.h
@@ -41,7 +41,7 @@ class AxisPhysicsMSDModel : public AxisPhysicsModel {
   bool IsFinished(double aSmallestVisibleIncrement);
 
  protected:
-  double Acceleration(const State &aState) override;
+  double Acceleration(const State& aState) override;
 
  private:
   /**
diff --git a/gfx/layers/AxisPhysicsModel.cpp b/gfx/layers/AxisPhysicsModel.cpp
index 5aa2d583cb741..7c9bc1cae4e3d 100644
--- a/gfx/layers/AxisPhysicsModel.cpp
+++ b/gfx/layers/AxisPhysicsModel.cpp
@@ -60,7 +60,7 @@ void AxisPhysicsModel::SetPosition(double aPosition) {
   mProgress = 1.0;
 }
 
-void AxisPhysicsModel::Simulate(const TimeDuration &aDeltaTime) {
+void AxisPhysicsModel::Simulate(const TimeDuration& aDeltaTime) {
   for (mProgress += aDeltaTime.ToSeconds() / kFixedTimestep; mProgress > 1.0;
        mProgress -= 1.0) {
     Integrate(kFixedTimestep);
@@ -85,7 +85,7 @@ void AxisPhysicsModel::Integrate(double aDeltaTime) {
 }
 
 AxisPhysicsModel::Derivative AxisPhysicsModel::Evaluate(
-    const State &aInitState, double aDeltaTime, const Derivative &aDerivative) {
+    const State& aInitState, double aDeltaTime, const Derivative& aDerivative) {
   State state(aInitState.p + aDerivative.dp * aDeltaTime,
               aInitState.v + aDerivative.dv * aDeltaTime);
 
diff --git a/gfx/layers/AxisPhysicsModel.h b/gfx/layers/AxisPhysicsModel.h
index cfb77fb57e3d6..4aa6a69c11f13 100644
--- a/gfx/layers/AxisPhysicsModel.h
+++ b/gfx/layers/AxisPhysicsModel.h
@@ -31,7 +31,7 @@ class AxisPhysicsModel {
    * Advance the physics simulation.
    * |aDelta| is the time since the last sample.
    */
-  void Simulate(const TimeDuration &aDeltaTime);
+  void Simulate(const TimeDuration& aDeltaTime);
 
   /**
    * Gets the raw velocity of this axis at this moment.
@@ -72,7 +72,7 @@ class AxisPhysicsModel {
    * axis-position-units / second that should be added or removed from the
    * velocity.
    */
-  virtual double Acceleration(const State &aState) = 0;
+  virtual double Acceleration(const State& aState) = 0;
 
  private:
   /**
@@ -108,8 +108,8 @@ class AxisPhysicsModel {
    * Apply delta velocity and position represented by aDerivative over
    * aDeltaTime seconds, calculate new acceleration, and return new deltas.
    */
-  Derivative Evaluate(const State &aInitState, double aDeltaTime,
-                      const Derivative &aDerivative);
+  Derivative Evaluate(const State& aInitState, double aDeltaTime,
+                      const Derivative& aDerivative);
 
   /**
    * Helper function for performing linear interpolation (lerp) of double's
diff --git a/gfx/layers/RenderTrace.cpp b/gfx/layers/RenderTrace.cpp
index 1115dedf0f80e..a2897a675eb9c 100644
--- a/gfx/layers/RenderTrace.cpp
+++ b/gfx/layers/RenderTrace.cpp
@@ -14,7 +14,7 @@
 namespace mozilla {
 namespace layers {
 
-static gfx::Matrix4x4 GetRootTransform(Layer *aLayer) {
+static gfx::Matrix4x4 GetRootTransform(Layer* aLayer) {
   gfx::Matrix4x4 layerTrans = aLayer->GetTransform();
   layerTrans.ProjectTo2D();
   if (aLayer->GetParent() != nullptr) {
@@ -23,10 +23,10 @@ static gfx::Matrix4x4 GetRootTransform(Layer *aLayer) {
   return layerTrans;
 }
 
-void RenderTraceLayers(Layer *aLayer, const char *aColor,
+void RenderTraceLayers(Layer* aLayer, const char* aColor,
                        const gfx::Matrix4x4 aRootTransform) {
   int colorId = 0;
-  ForEachNode(aLayer, [&colorId](Layer *layer) {
+  ForEachNode(aLayer, [&colorId](Layer* layer) {
     gfx::Matrix4x4 trans = aRootTransform * layer->GetTransform();
     trans.ProjectTo2D();
     gfx::IntRect clipRect = layer->GetLocalVisibleRegion().GetBounds();
@@ -44,7 +44,7 @@ void RenderTraceLayers(Layer *aLayer, const char *aColor,
   });
 }
 
-void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor,
+void RenderTraceInvalidateStart(Layer* aLayer, const char* aColor,
                                 const gfx::IntRect aRect) {
   gfx::Matrix4x4 trans = GetRootTransform(aLayer);
   gfx::Rect rect(aRect.x, aRect.y, aRect.width, aRect.height);
@@ -54,22 +54,22 @@ void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor,
                 (int)PR_IntervalNow(), aColor, (int)rect.x, (int)rect.y,
                 (int)rect.width, (int)rect.height);
 }
-void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor) {
+void RenderTraceInvalidateEnd(Layer* aLayer, const char* aColor) {
   // Clear with an empty rect
   RenderTraceInvalidateStart(aLayer, aColor, gfx::IntRect());
 }
 
-void renderTraceEventStart(const char *aComment, const char *aColor) {
+void renderTraceEventStart(const char* aComment, const char* aColor) {
   printf_stderr("%s RENDERTRACE %u fillrect #%s 0 0 10 10\n", aComment,
                 (int)PR_IntervalNow(), aColor);
 }
 
-void renderTraceEventEnd(const char *aComment, const char *aColor) {
+void renderTraceEventEnd(const char* aComment, const char* aColor) {
   printf_stderr("%s RENDERTRACE %u fillrect #%s 0 0 0 0\n", aComment,
                 (int)PR_IntervalNow(), aColor);
 }
 
-void renderTraceEventEnd(const char *aColor) {
+void renderTraceEventEnd(const char* aColor) {
   renderTraceEventEnd("", aColor);
 }
 
diff --git a/gfx/layers/RenderTrace.h b/gfx/layers/RenderTrace.h
index 9584e7a418923..404ba1ea1d6db 100644
--- a/gfx/layers/RenderTrace.h
+++ b/gfx/layers/RenderTrace.h
@@ -24,46 +24,46 @@ namespace layers {
 
 class Layer;
 
-void RenderTraceLayers(Layer *aLayer, const char *aColor,
+void RenderTraceLayers(Layer* aLayer, const char* aColor,
                        const gfx::Matrix4x4 aRootTransform = gfx::Matrix4x4(),
                        bool aReset = true);
 
-void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor,
+void RenderTraceInvalidateStart(Layer* aLayer, const char* aColor,
                                 const gfx::IntRect aRect);
-void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor);
+void RenderTraceInvalidateEnd(Layer* aLayer, const char* aColor);
 
-void renderTraceEventStart(const char *aComment, const char *aColor);
-void renderTraceEventEnd(const char *aComment, const char *aColor);
-void renderTraceEventEnd(const char *aColor);
+void renderTraceEventStart(const char* aComment, const char* aColor);
+void renderTraceEventEnd(const char* aComment, const char* aColor);
+void renderTraceEventEnd(const char* aColor);
 
 struct RenderTraceScope {
  public:
-  RenderTraceScope(const char *aComment, const char *aColor)
+  RenderTraceScope(const char* aComment, const char* aColor)
       : mComment(aComment), mColor(aColor) {
     renderTraceEventStart(mComment, mColor);
   }
   ~RenderTraceScope() { renderTraceEventEnd(mComment, mColor); }
 
  private:
-  const char *mComment;
-  const char *mColor;
+  const char* mComment;
+  const char* mColor;
 };
 
 #ifndef MOZ_RENDERTRACE
-inline void RenderTraceLayers(Layer *aLayer, const char *aColor,
+inline void RenderTraceLayers(Layer* aLayer, const char* aColor,
                               const gfx::Matrix4x4 aRootTransform,
                               bool aReset) {}
 
-inline void RenderTraceInvalidateStart(Layer *aLayer, const char *aColor,
+inline void RenderTraceInvalidateStart(Layer* aLayer, const char* aColor,
                                        const gfx::IntRect aRect) {}
 
-inline void RenderTraceInvalidateEnd(Layer *aLayer, const char *aColor) {}
+inline void RenderTraceInvalidateEnd(Layer* aLayer, const char* aColor) {}
 
-inline void renderTraceEventStart(const char *aComment, const char *aColor) {}
+inline void renderTraceEventStart(const char* aComment, const char* aColor) {}
 
-inline void renderTraceEventEnd(const char *aComment, const char *aColor) {}
+inline void renderTraceEventEnd(const char* aComment, const char* aColor) {}
 
-inline void renderTraceEventEnd(const char *aColor) {}
+inline void renderTraceEventEnd(const char* aColor) {}
 
 #endif  // MOZ_RENDERTRACE
 
diff --git a/gfx/layers/apz/test/gtest/TestPinching.cpp b/gfx/layers/apz/test/gtest/TestPinching.cpp
index 0a6610e8cfc9c..2cde136daa253 100644
--- a/gfx/layers/apz/test/gtest/TestPinching.cpp
+++ b/gfx/layers/apz/test/gtest/TestPinching.cpp
@@ -30,7 +30,7 @@ class APZCPinchTester : public APZCBasicTester {
   }
 
   void DoPinchTest(bool aShouldTriggerPinch,
-                   nsTArray *aAllowedTouchBehaviors = nullptr) {
+                   nsTArray* aAllowedTouchBehaviors = nullptr) {
     apzc->SetFrameMetrics(GetPinchableFrameMetrics());
     MakeApzcZoomable();
 
diff --git a/gfx/layers/client/TextureClientPool.h b/gfx/layers/client/TextureClientPool.h
index 0ce5801f35c5f..c7306f28ef6d4 100644
--- a/gfx/layers/client/TextureClientPool.h
+++ b/gfx/layers/client/TextureClientPool.h
@@ -35,7 +35,7 @@ class TextureClientAllocator {
    * Return a TextureClient that is not yet ready to be reused, but will be
    * imminently.
    */
-  virtual void ReturnTextureClientDeferred(TextureClient *aClient) = 0;
+  virtual void ReturnTextureClientDeferred(TextureClient* aClient) = 0;
 
   virtual void ReportClientLost() = 0;
 };
@@ -49,7 +49,7 @@ class TextureClientPool final : public TextureClientAllocator {
                     gfx::IntSize aSize, TextureFlags aFlags,
                     uint32_t aShrinkTimeoutMsec, uint32_t aClearTimeoutMsec,
                     uint32_t aInitialPoolSize, uint32_t aPoolUnusedSize,
-                    TextureForwarder *aAllocator);
+                    TextureForwarder* aAllocator);
 
   /**
    * Gets an allocated TextureClient of size and format that are determined
@@ -66,13 +66,13 @@ class TextureClientPool final : public TextureClientAllocator {
    * Return a TextureClient that is no longer being used and is ready for
    * immediate re-use or destruction.
    */
-  void ReturnTextureClient(TextureClient *aClient);
+  void ReturnTextureClient(TextureClient* aClient);
 
   /**
    * Return a TextureClient that is not yet ready to be reused, but will be
    * imminently.
    */
-  void ReturnTextureClientDeferred(TextureClient *aClient) override;
+  void ReturnTextureClientDeferred(TextureClient* aClient) override;
 
   /**
    * Return any clients to the pool that were previously returned in
@@ -160,7 +160,7 @@ class TextureClientPool final : public TextureClientAllocator {
   RefPtr mShrinkTimer;
   RefPtr mClearTimer;
   // This mSurfaceAllocator owns us, so no need to hold a ref to it
-  TextureForwarder *mSurfaceAllocator;
+  TextureForwarder* mSurfaceAllocator;
 
   // Keep track of whether this pool has been destroyed or not. If it has,
   // we won't accept returns of TextureClients anymore, and the refcounting
diff --git a/gfx/layers/d3d11/ReadbackManagerD3D11.cpp b/gfx/layers/d3d11/ReadbackManagerD3D11.cpp
index 93a86ab7110a4..bf641449a5a78 100644
--- a/gfx/layers/d3d11/ReadbackManagerD3D11.cpp
+++ b/gfx/layers/d3d11/ReadbackManagerD3D11.cpp
@@ -36,7 +36,7 @@ class ReadbackResultWriterD3D11 final : public nsIRunnable {
   ~ReadbackResultWriterD3D11() {}
   NS_DECL_THREADSAFE_ISUPPORTS
  public:
-  explicit ReadbackResultWriterD3D11(ReadbackTask *aTask) : mTask(aTask) {}
+  explicit ReadbackResultWriterD3D11(ReadbackTask* aTask) : mTask(aTask) {}
 
   NS_IMETHOD Run() override {
     D3D10_TEXTURE2D_DESC desc;
@@ -54,7 +54,7 @@ class ReadbackResultWriterD3D11 final : public nsIRunnable {
 
     {
       RefPtr surf = Factory::CreateWrappingDataSourceSurface(
-          (uint8_t *)mappedTex.pData, mappedTex.RowPitch,
+          (uint8_t*)mappedTex.pData, mappedTex.RowPitch,
           IntSize(desc.Width, desc.Height), SurfaceFormat::B8G8R8A8);
 
       mTask->mSink->ProcessReadback(surf);
@@ -73,8 +73,8 @@ class ReadbackResultWriterD3D11 final : public nsIRunnable {
 
 NS_IMPL_ISUPPORTS(ReadbackResultWriterD3D11, nsIRunnable)
 
-DWORD WINAPI ReadbackManagerD3D11::StartTaskThread(void *aManager) {
-  static_cast(aManager)->ProcessTasks();
+DWORD WINAPI ReadbackManagerD3D11::StartTaskThread(void* aManager) {
+  static_cast(aManager)->ProcessTasks();
 
   return 0;
 }
@@ -102,9 +102,9 @@ ReadbackManagerD3D11::~ReadbackManagerD3D11() {
   }
 }
 
-void ReadbackManagerD3D11::PostTask(ID3D10Texture2D *aTexture,
-                                    TextureReadbackSink *aSink) {
-  ReadbackTask *task = new ReadbackTask;
+void ReadbackManagerD3D11::PostTask(ID3D10Texture2D* aTexture,
+                                    TextureReadbackSink* aSink) {
+  ReadbackTask* task = new ReadbackTask;
   task->mReadbackTexture = aTexture;
   task->mSink = aSink;
 
@@ -128,7 +128,7 @@ void ReadbackManagerD3D11::ProcessTasks() {
     if (mPendingReadbackTasks.Length() == 0) {
       MOZ_CRASH("Trying to read from an empty array, bad bad bad");
     }
-    ReadbackTask *nextReadbackTask = mPendingReadbackTasks[0].forget();
+    ReadbackTask* nextReadbackTask = mPendingReadbackTasks[0].forget();
     mPendingReadbackTasks.RemoveElementAt(0);
     ::LeaveCriticalSection(&mTaskMutex);
 
diff --git a/gfx/layers/opengl/GLBlitTextureImageHelper.cpp b/gfx/layers/opengl/GLBlitTextureImageHelper.cpp
index cef2924f1b77b..1659b23f025f8 100644
--- a/gfx/layers/opengl/GLBlitTextureImageHelper.cpp
+++ b/gfx/layers/opengl/GLBlitTextureImageHelper.cpp
@@ -21,7 +21,7 @@ using namespace mozilla::gl;
 namespace mozilla {
 namespace layers {
 
-GLBlitTextureImageHelper::GLBlitTextureImageHelper(CompositorOGL *aCompositor)
+GLBlitTextureImageHelper::GLBlitTextureImageHelper(CompositorOGL* aCompositor)
     : mCompositor(aCompositor),
       mBlitProgram(0),
       mBlitFramebuffer(0)
@@ -29,17 +29,17 @@ GLBlitTextureImageHelper::GLBlitTextureImageHelper(CompositorOGL *aCompositor)
 {}
 
 GLBlitTextureImageHelper::~GLBlitTextureImageHelper() {
-  GLContext *gl = mCompositor->gl();
+  GLContext* gl = mCompositor->gl();
   // Likely used by OGL Layers.
   gl->fDeleteProgram(mBlitProgram);
   gl->fDeleteFramebuffers(1, &mBlitFramebuffer);
 }
 
-void GLBlitTextureImageHelper::BlitTextureImage(TextureImage *aSrc,
-                                                const gfx::IntRect &aSrcRect,
-                                                TextureImage *aDst,
-                                                const gfx::IntRect &aDstRect) {
-  GLContext *gl = mCompositor->gl();
+void GLBlitTextureImageHelper::BlitTextureImage(TextureImage* aSrc,
+                                                const gfx::IntRect& aSrcRect,
+                                                TextureImage* aDst,
+                                                const gfx::IntRect& aDstRect) {
+  GLContext* gl = mCompositor->gl();
 
   if (!aSrc || !aDst || aSrcRect.IsEmpty() || aDstRect.IsEmpty()) return;
 
@@ -145,7 +145,7 @@ void GLBlitTextureImageHelper::BlitTextureImage(TextureImage *aSrc,
 
         // now put the coords into the d[xy]0 .. d[xy]1 coordinate space
         // from the 0..1 that it comes out of decompose
-        InfallibleTArray &coords = rects.vertCoords();
+        InfallibleTArray& coords = rects.vertCoords();
 
         for (unsigned int i = 0; i < coords.Length(); ++i) {
           coords[i].x = (coords[i].x * (dx1 - dx0)) + dx0;
@@ -175,7 +175,7 @@ void GLBlitTextureImageHelper::BlitTextureImage(TextureImage *aSrc,
 
 void GLBlitTextureImageHelper::SetBlitFramebufferForDestTexture(
     GLuint aTexture) {
-  GLContext *gl = mCompositor->gl();
+  GLContext* gl = mCompositor->gl();
   if (!mBlitFramebuffer) {
     gl->fGenFramebuffers(1, &mBlitFramebuffer);
   }
@@ -202,7 +202,7 @@ void GLBlitTextureImageHelper::UseBlitProgram() {
   // so we need to Reset the program
   mCompositor->ResetProgram();
 
-  GLContext *gl = mCompositor->gl();
+  GLContext* gl = mCompositor->gl();
   if (mBlitProgram) {
     gl->fUseProgram(mBlitProgram);
     return;
@@ -214,7 +214,7 @@ void GLBlitTextureImageHelper::UseBlitProgram() {
   shaders[0] = gl->fCreateShader(LOCAL_GL_VERTEX_SHADER);
   shaders[1] = gl->fCreateShader(LOCAL_GL_FRAGMENT_SHADER);
 
-  const char *blitVSSrc =
+  const char* blitVSSrc =
       "attribute vec2 aVertex;"
       "attribute vec2 aTexCoord;"
       "varying vec2 vTexCoord;"
@@ -222,7 +222,7 @@ void GLBlitTextureImageHelper::UseBlitProgram() {
       "  vTexCoord = aTexCoord;"
       "  gl_Position = vec4(aVertex, 0.0, 1.0);"
       "}";
-  const char *blitFSSrc =
+  const char* blitFSSrc =
       "#ifdef GL_ES\nprecision mediump float;\n#endif\n"
       "uniform sampler2D uSrcTexture;"
       "varying vec2 vTexCoord;"
@@ -230,8 +230,8 @@ void GLBlitTextureImageHelper::UseBlitProgram() {
       "  gl_FragColor = texture2D(uSrcTexture, vTexCoord);"
       "}";
 
-  gl->fShaderSource(shaders[0], 1, (const GLchar **)&blitVSSrc, nullptr);
-  gl->fShaderSource(shaders[1], 1, (const GLchar **)&blitFSSrc, nullptr);
+  gl->fShaderSource(shaders[0], 1, (const GLchar**)&blitVSSrc, nullptr);
+  gl->fShaderSource(shaders[1], 1, (const GLchar**)&blitFSSrc, nullptr);
 
   for (int i = 0; i < 2; ++i) {
     GLint success, len = 0;
@@ -242,10 +242,10 @@ void GLBlitTextureImageHelper::UseBlitProgram() {
 
     if (!success) {
       nsAutoCString log;
-      gl->fGetShaderiv(shaders[i], LOCAL_GL_INFO_LOG_LENGTH, (GLint *)&len);
+      gl->fGetShaderiv(shaders[i], LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&len);
       log.SetLength(len);
-      gl->fGetShaderInfoLog(shaders[i], len, (GLint *)&len,
-                            (char *)log.BeginWriting());
+      gl->fGetShaderInfoLog(shaders[i], len, (GLint*)&len,
+                            (char*)log.BeginWriting());
 
       printf_stderr("Shader %d compilation failed:\n%s\n", i, log.get());
       return;
@@ -266,10 +266,10 @@ void GLBlitTextureImageHelper::UseBlitProgram() {
 
   if (!success) {
     nsAutoCString log;
-    gl->fGetProgramiv(mBlitProgram, LOCAL_GL_INFO_LOG_LENGTH, (GLint *)&len);
+    gl->fGetProgramiv(mBlitProgram, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&len);
     log.SetLength(len);
-    gl->fGetProgramInfoLog(mBlitProgram, len, (GLint *)&len,
-                           (char *)log.BeginWriting());
+    gl->fGetProgramInfoLog(mBlitProgram, len, (GLint*)&len,
+                           (char*)log.BeginWriting());
 
     printf_stderr("Program linking failed:\n%s\n", log.get());
     return;
diff --git a/gfx/layers/opengl/OGLShaderProgram.cpp b/gfx/layers/opengl/OGLShaderProgram.cpp
index b967ad1fb24b6..f89bf4279d956 100644
--- a/gfx/layers/opengl/OGLShaderProgram.cpp
+++ b/gfx/layers/opengl/OGLShaderProgram.cpp
@@ -26,9 +26,9 @@ using namespace std;
 #define GAUSSIAN_KERNEL_HALF_WIDTH 11
 #define GAUSSIAN_KERNEL_STEP 0.2
 
-static void AddUniforms(ProgramProfileOGL &aProfile) {
+static void AddUniforms(ProgramProfileOGL& aProfile) {
   // This needs to be kept in sync with the KnownUniformName enum
-  static const char *sKnownUniformNames[] = {"uLayerTransform",
+  static const char* sKnownUniformNames[] = {"uLayerTransform",
                                              "uLayerTransformInverse",
                                              "uMaskTransform",
                                              "uBackdropTransform",
@@ -367,8 +367,8 @@ ProgramProfileOGL ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig) {
     fs << "varying vec2 vBackdropCoord;" << endl;
   }
 
-  const char *sampler2D = "sampler2D";
-  const char *texture2D = "texture2D";
+  const char* sampler2D = "sampler2D";
+  const char* texture2D = "texture2D";
 
   if (aConfig.mFeatures & ENABLE_TEXTURE_RECT) {
     fs << "uniform vec2 uTexCoordMultiplier;" << endl;
@@ -380,8 +380,8 @@ ProgramProfileOGL ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig) {
     texture2D = "texture2DRect";
   }
 
-  const char *maskSampler2D = "sampler2D";
-  const char *maskTexture2D = "texture2D";
+  const char* maskSampler2D = "sampler2D";
+  const char* maskTexture2D = "texture2D";
 
   if (aConfig.mFeatures & ENABLE_MASK &&
       aConfig.mFeatures & ENABLE_MASK_TEXTURE_RECT) {
@@ -616,8 +616,8 @@ ProgramProfileOGL ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig) {
   return result;
 }
 
-void ProgramProfileOGL::BuildMixBlender(const ShaderConfigOGL &aConfig,
-                                        std::ostringstream &fs) {
+void ProgramProfileOGL::BuildMixBlender(const ShaderConfigOGL& aConfig,
+                                        std::ostringstream& fs) {
   // From the "Compositing and Blending Level 1" spec.
   // Generate helper functions first.
   switch (aConfig.mCompositionOp) {
@@ -833,8 +833,8 @@ void ProgramProfileOGL::BuildMixBlender(const ShaderConfigOGL &aConfig,
   fs << "}" << endl;
 }
 
-ShaderProgramOGL::ShaderProgramOGL(GLContext *aGL,
-                                   const ProgramProfileOGL &aProfile)
+ShaderProgramOGL::ShaderProgramOGL(GLContext* aGL,
+                                   const ProgramProfileOGL& aProfile)
     : mGL(aGL), mProgram(0), mProfile(aProfile), mProgramState(STATE_NEW) {}
 
 ShaderProgramOGL::~ShaderProgramOGL() {
@@ -878,14 +878,14 @@ bool ShaderProgramOGL::Initialize() {
 }
 
 GLint ShaderProgramOGL::CreateShader(GLenum aShaderType,
-                                     const char *aShaderSource) {
+                                     const char* aShaderSource) {
   GLint success, len = 0;
 
   GLint sh = mGL->fCreateShader(aShaderType);
-  mGL->fShaderSource(sh, 1, (const GLchar **)&aShaderSource, nullptr);
+  mGL->fShaderSource(sh, 1, (const GLchar**)&aShaderSource, nullptr);
   mGL->fCompileShader(sh);
   mGL->fGetShaderiv(sh, LOCAL_GL_COMPILE_STATUS, &success);
-  mGL->fGetShaderiv(sh, LOCAL_GL_INFO_LOG_LENGTH, (GLint *)&len);
+  mGL->fGetShaderiv(sh, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&len);
   /* Even if compiling is successful, there may still be warnings.  Print them
    * in a debug build.  The > 10 is to catch silly compilers that might put
    * some whitespace in the log but otherwise leave it empty.
@@ -897,7 +897,7 @@ GLint ShaderProgramOGL::CreateShader(GLenum aShaderType,
   ) {
     nsAutoCString log;
     log.SetLength(len);
-    mGL->fGetShaderInfoLog(sh, len, (GLint *)&len, (char *)log.BeginWriting());
+    mGL->fGetShaderInfoLog(sh, len, (GLint*)&len, (char*)log.BeginWriting());
     log.Truncate(len);
 
     if (!success) {
@@ -919,8 +919,8 @@ GLint ShaderProgramOGL::CreateShader(GLenum aShaderType,
   return sh;
 }
 
-bool ShaderProgramOGL::CreateProgram(const char *aVertexShaderString,
-                                     const char *aFragmentShaderString) {
+bool ShaderProgramOGL::CreateProgram(const char* aVertexShaderString,
+                                     const char* aFragmentShaderString) {
   GLuint vertexShader =
       CreateShader(LOCAL_GL_VERTEX_SHADER, aVertexShaderString);
   GLuint fragmentShader =
@@ -932,7 +932,7 @@ bool ShaderProgramOGL::CreateProgram(const char *aVertexShaderString,
   mGL->fAttachShader(result, vertexShader);
   mGL->fAttachShader(result, fragmentShader);
 
-  for (Pair &attribute : mProfile.mAttributes) {
+  for (Pair& attribute : mProfile.mAttributes) {
     mGL->fBindAttribLocation(result, attribute.second(),
                              attribute.first().get());
   }
@@ -941,7 +941,7 @@ bool ShaderProgramOGL::CreateProgram(const char *aVertexShaderString,
 
   GLint success, len;
   mGL->fGetProgramiv(result, LOCAL_GL_LINK_STATUS, &success);
-  mGL->fGetProgramiv(result, LOCAL_GL_INFO_LOG_LENGTH, (GLint *)&len);
+  mGL->fGetProgramiv(result, LOCAL_GL_INFO_LOG_LENGTH, (GLint*)&len);
   /* Even if linking is successful, there may still be warnings.  Print them
    * in a debug build.  The > 10 is to catch silly compilers that might put
    * some whitespace in the log but otherwise leave it empty.
@@ -953,8 +953,8 @@ bool ShaderProgramOGL::CreateProgram(const char *aVertexShaderString,
   ) {
     nsAutoCString log;
     log.SetLength(len);
-    mGL->fGetProgramInfoLog(result, len, (GLint *)&len,
-                            (char *)log.BeginWriting());
+    mGL->fGetProgramInfoLog(result, len, (GLint*)&len,
+                            (char*)log.BeginWriting());
 
     if (!success) {
       printf_stderr("=== PROGRAM LINKING FAILED ===\n");
@@ -1011,7 +1011,7 @@ void ShaderProgramOGL::SetBlurRadius(float aRX, float aRY) {
 }
 
 void ShaderProgramOGL::SetYUVColorSpace(gfx::YUVColorSpace aYUVColorSpace) {
-  const float *yuvToRgb =
+  const float* yuvToRgb =
       gfxUtils::YuvToRgbMatrix3x3ColumnMajor(aYUVColorSpace);
   SetMatrix3fvUniform(KnownUniform::YuvColorMatrix, yuvToRgb);
 }
diff --git a/gfx/src/X11Util.h b/gfx/src/X11Util.h
index dbd9091a6be40..e3e78b0cd5b8e 100644
--- a/gfx/src/X11Util.h
+++ b/gfx/src/X11Util.h
@@ -25,7 +25,7 @@ namespace mozilla {
 /**
  * Return the default X Display created and used by the UI toolkit.
  */
-inline Display *DefaultXDisplay() {
+inline Display* DefaultXDisplay() {
 #if defined(MOZ_WIDGET_GTK)
   return GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
 #endif
@@ -37,8 +37,8 @@ inline Display *DefaultXDisplay() {
  * to nullptr and 0 respectively.  Both out-parameter pointers are assumed
  * non-nullptr.
  */
-void FindVisualAndDepth(Display *aDisplay, VisualID aVisualID, Visual **aVisual,
-                        int *aDepth);
+void FindVisualAndDepth(Display* aDisplay, VisualID aVisualID, Visual** aVisual,
+                        int* aDepth);
 
 /**
  * Ensure that all X requests have been processed.
@@ -49,7 +49,7 @@ void FindVisualAndDepth(Display *aDisplay, VisualID aVisualID, Visual **aVisual,
  * intermediate requests.
  */
 
-void FinishX(Display *aDisplay);
+void FinishX(Display* aDisplay);
 
 /**
  * Invoke XFree() on a pointer to memory allocated by Xlib (if the
@@ -57,9 +57,9 @@ void FinishX(Display *aDisplay);
  */
 template 
 struct ScopedXFreePtrTraits {
-  typedef T *type;
-  static T *empty() { return nullptr; }
-  static void release(T *ptr) {
+  typedef T* type;
+  static T* empty() { return nullptr; }
+  static void release(T* ptr) {
     if (ptr != nullptr) XFree(ptr);
   }
 };
@@ -100,16 +100,16 @@ class ScopedXErrorHandler {
   ErrorEvent mXError;
 
   // static pointer for use by the error handler
-  static ErrorEvent *sXErrorPtr;
+  static ErrorEvent* sXErrorPtr;
 
   // what to restore sXErrorPtr to on destruction
-  ErrorEvent *mOldXErrorPtr;
+  ErrorEvent* mOldXErrorPtr;
 
   // what to restore the error handler to on destruction
-  int (*mOldErrorHandler)(Display *, XErrorEvent *);
+  int (*mOldErrorHandler)(Display*, XErrorEvent*);
 
  public:
-  static int ErrorHandler(Display *, XErrorEvent *ev);
+  static int ErrorHandler(Display*, XErrorEvent* ev);
 
   /**
    * @param aAllowOffMainThread whether to warn if used off main thread
@@ -126,7 +126,7 @@ class ScopedXErrorHandler {
    * XErrorEvent object. If multiple errors occurred, the first one will be
    * returned.
    */
-  bool SyncAndGetError(Display *dpy, XErrorEvent *ev = nullptr);
+  bool SyncAndGetError(Display* dpy, XErrorEvent* ev = nullptr);
 };
 
 class OffMainThreadScopedXErrorHandler : public ScopedXErrorHandler {
diff --git a/gfx/src/gfxCrashReporterUtils.h b/gfx/src/gfxCrashReporterUtils.h
index 83db0e375be3d..30b670df61075 100644
--- a/gfx/src/gfxCrashReporterUtils.h
+++ b/gfx/src/gfxCrashReporterUtils.h
@@ -27,7 +27,7 @@ namespace mozilla {
  */
 class ScopedGfxFeatureReporter {
  public:
-  explicit ScopedGfxFeatureReporter(const char *aFeature, bool aForce = false)
+  explicit ScopedGfxFeatureReporter(const char* aFeature, bool aForce = false)
       : mFeature(aFeature), mStatusChar('-'), mStatusNumber(0) {
     WriteAppNote(aForce ? '!' : '?', 0);
   }
@@ -38,12 +38,12 @@ class ScopedGfxFeatureReporter {
     mStatusNumber = aNumber;
   }
 
-  static void AppNote(const nsACString &aMessage);
+  static void AppNote(const nsACString& aMessage);
 
   class AppNoteWritingRunnable;
 
  protected:
-  const char *mFeature;
+  const char* mFeature;
   char mStatusChar;
   int32_t mStatusNumber;
 
diff --git a/gfx/src/nsThebesFontEnumerator.cpp b/gfx/src/nsThebesFontEnumerator.cpp
index da039e495919a..2b73b6cd6f5aa 100644
--- a/gfx/src/nsThebesFontEnumerator.cpp
+++ b/gfx/src/nsThebesFontEnumerator.cpp
@@ -23,15 +23,15 @@ NS_IMPL_ISUPPORTS(nsThebesFontEnumerator, nsIFontEnumerator)
 nsThebesFontEnumerator::nsThebesFontEnumerator() {}
 
 NS_IMETHODIMP
-nsThebesFontEnumerator::EnumerateAllFonts(uint32_t *aCount,
-                                          char16_t ***aResult) {
+nsThebesFontEnumerator::EnumerateAllFonts(uint32_t* aCount,
+                                          char16_t*** aResult) {
   return EnumerateFonts(nullptr, nullptr, aCount, aResult);
 }
 
 NS_IMETHODIMP
-nsThebesFontEnumerator::EnumerateFonts(const char *aLangGroup,
-                                       const char *aGeneric, uint32_t *aCount,
-                                       char16_t ***aResult) {
+nsThebesFontEnumerator::EnumerateFonts(const char* aLangGroup,
+                                       const char* aGeneric, uint32_t* aCount,
+                                       char16_t*** aResult) {
   NS_ENSURE_ARG_POINTER(aCount);
   NS_ENSURE_ARG_POINTER(aResult);
 
@@ -61,8 +61,8 @@ nsThebesFontEnumerator::EnumerateFonts(const char *aLangGroup,
     return NS_OK;
   }
 
-  char16_t **fs = static_cast(
-      moz_xmalloc(fontList.Length() * sizeof(char16_t *)));
+  char16_t** fs = static_cast(
+      moz_xmalloc(fontList.Length() * sizeof(char16_t*)));
   for (uint32_t i = 0; i < fontList.Length(); i++) {
     fs[i] = ToNewUnicode(fontList[i]);
   }
@@ -74,7 +74,7 @@ nsThebesFontEnumerator::EnumerateFonts(const char *aLangGroup,
 }
 
 struct EnumerateFontsPromise final {
-  explicit EnumerateFontsPromise(mozilla::dom::Promise *aPromise)
+  explicit EnumerateFontsPromise(mozilla::dom::Promise* aPromise)
       : mPromise(aPromise) {
     MOZ_ASSERT(aPromise);
     MOZ_ASSERT(NS_IsMainThread());
@@ -119,9 +119,9 @@ class EnumerateFontsResult final : public Runnable {
 
 class EnumerateFontsTask final : public Runnable {
  public:
-  EnumerateFontsTask(nsAtom *aLangGroupAtom, const nsAutoCString &aGeneric,
+  EnumerateFontsTask(nsAtom* aLangGroupAtom, const nsAutoCString& aGeneric,
                      UniquePtr aEnumerateFontsPromise,
-                     nsIEventTarget *aMainThreadTarget)
+                     nsIEventTarget* aMainThreadTarget)
       : Runnable("EnumerateFontsTask"),
         mLangGroupAtom(aLangGroupAtom),
         mGeneric(aGeneric),
@@ -152,15 +152,15 @@ class EnumerateFontsTask final : public Runnable {
 };
 
 NS_IMETHODIMP
-nsThebesFontEnumerator::EnumerateAllFontsAsync(JSContext *aCx,
+nsThebesFontEnumerator::EnumerateAllFontsAsync(JSContext* aCx,
                                                JS::MutableHandleValue aRval) {
   return EnumerateFontsAsync(nullptr, nullptr, aCx, aRval);
 }
 
 NS_IMETHODIMP
-nsThebesFontEnumerator::EnumerateFontsAsync(const char *aLangGroup,
-                                            const char *aGeneric,
-                                            JSContext *aCx,
+nsThebesFontEnumerator::EnumerateFontsAsync(const char* aLangGroup,
+                                            const char* aGeneric,
+                                            JSContext* aCx,
                                             JS::MutableHandleValue aRval) {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -208,7 +208,7 @@ nsThebesFontEnumerator::EnumerateFontsAsync(const char *aLangGroup,
 }
 
 NS_IMETHODIMP
-nsThebesFontEnumerator::HaveFontFor(const char *aLangGroup, bool *aResult) {
+nsThebesFontEnumerator::HaveFontFor(const char* aLangGroup, bool* aResult) {
   NS_ENSURE_ARG_POINTER(aResult);
 
   *aResult = true;
@@ -216,9 +216,9 @@ nsThebesFontEnumerator::HaveFontFor(const char *aLangGroup, bool *aResult) {
 }
 
 NS_IMETHODIMP
-nsThebesFontEnumerator::GetDefaultFont(const char *aLangGroup,
-                                       const char *aGeneric,
-                                       char16_t **aResult) {
+nsThebesFontEnumerator::GetDefaultFont(const char* aLangGroup,
+                                       const char* aGeneric,
+                                       char16_t** aResult) {
   if (NS_WARN_IF(!aResult) || NS_WARN_IF(!aLangGroup) ||
       NS_WARN_IF(!aGeneric)) {
     return NS_ERROR_INVALID_ARG;
@@ -234,15 +234,15 @@ nsThebesFontEnumerator::GetDefaultFont(const char *aLangGroup,
 }
 
 NS_IMETHODIMP
-nsThebesFontEnumerator::UpdateFontList(bool *_retval) {
+nsThebesFontEnumerator::UpdateFontList(bool* _retval) {
   gfxPlatform::GetPlatform()->UpdateFontList();
   *_retval = false;  // always return false for now
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsThebesFontEnumerator::GetStandardFamilyName(const char16_t *aName,
-                                              char16_t **aResult) {
+nsThebesFontEnumerator::GetStandardFamilyName(const char16_t* aName,
+                                              char16_t** aResult) {
   NS_ENSURE_ARG_POINTER(aResult);
   NS_ENSURE_ARG_POINTER(aName);
 
diff --git a/gfx/src/nsTransform2D.cpp b/gfx/src/nsTransform2D.cpp
index 6a6db2eb8b574..655511a626979 100644
--- a/gfx/src/nsTransform2D.cpp
+++ b/gfx/src/nsTransform2D.cpp
@@ -6,13 +6,13 @@
 
 #include "nsTransform2D.h"
 
-void nsTransform2D ::TransformCoord(nscoord *ptX, nscoord *ptY) const {
+void nsTransform2D ::TransformCoord(nscoord* ptX, nscoord* ptY) const {
   *ptX = NSToCoordRound(*ptX * m00 + m20);
   *ptY = NSToCoordRound(*ptY * m11 + m21);
 }
 
-void nsTransform2D ::TransformCoord(nscoord *aX, nscoord *aY, nscoord *aWidth,
-                                    nscoord *aHeight) const {
+void nsTransform2D ::TransformCoord(nscoord* aX, nscoord* aY, nscoord* aWidth,
+                                    nscoord* aHeight) const {
   nscoord x2 = *aX + *aWidth;
   nscoord y2 = *aY + *aHeight;
   TransformCoord(aX, aY);
diff --git a/gfx/src/nsTransform2D.h b/gfx/src/nsTransform2D.h
index 57377b0458a61..4150c9a269377 100644
--- a/gfx/src/nsTransform2D.h
+++ b/gfx/src/nsTransform2D.h
@@ -52,7 +52,7 @@ class nsTransform2D {
    * @param      pt, Point to return translation values in
    **/
 
-  void GetTranslationCoord(nscoord *ptX, nscoord *ptY) const {
+  void GetTranslationCoord(nscoord* ptX, nscoord* ptY) const {
     *ptX = NSToCoordRound(m20);
     *ptY = NSToCoordRound(m21);
   }
@@ -63,7 +63,7 @@ class nsTransform2D {
    * @param    pt Point to transform
    **/
 
-  void TransformCoord(nscoord *ptX, nscoord *ptY) const;
+  void TransformCoord(nscoord* ptX, nscoord* ptY) const;
 
   /**
    * apply matrix to rect
@@ -71,8 +71,8 @@ class nsTransform2D {
    * @param    rect Rect to transform
    **/
 
-  void TransformCoord(nscoord *aX, nscoord *aY, nscoord *aWidth,
-                      nscoord *aHeight) const;
+  void TransformCoord(nscoord* aX, nscoord* aY, nscoord* aWidth,
+                      nscoord* aHeight) const;
 
   /**
    * add a scale to a Transform via x, y pair
diff --git a/gfx/tests/gtest/TestRegion.cpp b/gfx/tests/gtest/TestRegion.cpp
index 631831ac0fc21..d756b38615f85 100644
--- a/gfx/tests/gtest/TestRegion.cpp
+++ b/gfx/tests/gtest/TestRegion.cpp
@@ -1151,7 +1151,7 @@ TEST(Gfx, RegionContains)
 #define REGION_VALUE 0xff
 
 struct RegionBitmap {
-  RegionBitmap(unsigned char *bitmap, int width, int height)
+  RegionBitmap(unsigned char* bitmap, int width, int height)
       : bitmap(bitmap), width(width), height(height) {}
 
   void clear() {
@@ -1162,10 +1162,10 @@ struct RegionBitmap {
     }
   }
 
-  void set(nsRegion ®ion) {
+  void set(nsRegion& region) {
     clear();
     for (auto iter = region.RectIter(); !iter.Done(); iter.Next()) {
-      const nsRect &r = iter.Get();
+      const nsRect& r = iter.Get();
       for (int y = r.Y(); y < r.YMost(); y++) {
         for (int x = r.X(); x < r.XMost(); x++) {
           bitmap[x + y * width] = REGION_VALUE;
@@ -1188,7 +1188,7 @@ struct RegionBitmap {
       }
     }
   }
-  void compare(RegionBitmap &reference) {
+  void compare(RegionBitmap& reference) {
     for (int y = 0; y < height; y++) {
       for (int x = 0; x < width; x++) {
         EXPECT_EQ(bitmap[x + y * width], reference.bitmap[x + y * width]);
@@ -1196,16 +1196,16 @@ struct RegionBitmap {
     }
   }
 
-  unsigned char *bitmap;
+  unsigned char* bitmap;
   int width;
   int height;
 };
 
-static void VisitEdge(void *closure, VisitSide side, int x1, int y1, int x2,
+static void VisitEdge(void* closure, VisitSide side, int x1, int y1, int x2,
                       int y2) {
   EXPECT_GE(x2, x1);
-  RegionBitmap *visitor = static_cast(closure);
-  unsigned char *bitmap = visitor->bitmap;
+  RegionBitmap* visitor = static_cast(closure);
+  unsigned char* bitmap = visitor->bitmap;
   const int width = visitor->width;
 
   if (side == VisitSide::TOP) {
@@ -1231,7 +1231,7 @@ static void VisitEdge(void *closure, VisitSide side, int x1, int y1, int x2,
   }
 }
 
-static void TestVisit(nsRegion &r) {
+static void TestVisit(nsRegion& r) {
   auto reference = mozilla::MakeUnique(600 * 600);
   auto result = mozilla::MakeUnique(600 * 600);
   RegionBitmap ref(reference.get(), 600, 600);
diff --git a/gfx/tests/gtest/gfxSurfaceRefCountTest.cpp b/gfx/tests/gtest/gfxSurfaceRefCountTest.cpp
index c7106070b7d48..d74ffb82a9c3c 100644
--- a/gfx/tests/gtest/gfxSurfaceRefCountTest.cpp
+++ b/gfx/tests/gtest/gfxSurfaceRefCountTest.cpp
@@ -13,7 +13,7 @@
 
 #include "cairo.h"
 
-static int GetASurfaceRefCount(gfxASurface *s) {
+static int GetASurfaceRefCount(gfxASurface* s) {
   NS_ADDREF(s);
   return s->Release();
 }
@@ -27,7 +27,7 @@ static int CheckInt(int value, int expected) {
   return 0;
 }
 
-static int CheckPointer(void *value, void *expected) {
+static int CheckPointer(void* value, void* expected) {
   if (value != expected) {
     fprintf(stderr, "Expected %p got %p\n", expected, value);
     return 1;
@@ -37,7 +37,7 @@ static int CheckPointer(void *value, void *expected) {
 }
 
 static cairo_user_data_key_t destruction_key;
-static void SurfaceDestroyNotifier(void *data) { *(int *)data = 1; }
+static void SurfaceDestroyNotifier(void* data) { *(int*)data = 1; }
 
 static int TestNewSurface() {
   int failures = 0;
@@ -45,7 +45,7 @@ static int TestNewSurface() {
 
   RefPtr s = new gfxImageSurface(mozilla::gfx::IntSize(10, 10),
                                               SurfaceFormat::A8R8G8B8_UINT32);
-  cairo_surface_t *cs = s->CairoSurface();
+  cairo_surface_t* cs = s->CairoSurface();
 
   cairo_surface_set_user_data(cs, &destruction_key, &destroyed,
                               SurfaceDestroyNotifier);
@@ -60,7 +60,7 @@ static int TestNewSurface() {
   failures += CheckInt(cairo_surface_get_reference_count(cs), 2);
   failures += CheckInt(destroyed, 0);
 
-  gfxASurface *savedWrapper = s.get();
+  gfxASurface* savedWrapper = s.get();
 
   s = nullptr;
 
@@ -91,7 +91,7 @@ static int TestExistingSurface() {
   int failures = 0;
   int destroyed = 0;
 
-  cairo_surface_t *cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 10, 10);
+  cairo_surface_t* cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 10, 10);
 
   cairo_surface_set_user_data(cs, &destruction_key, &destroyed,
                               SurfaceDestroyNotifier);
@@ -109,7 +109,7 @@ static int TestExistingSurface() {
   failures += CheckInt(cairo_surface_get_reference_count(cs), 3);
   failures += CheckInt(destroyed, 0);
 
-  gfxASurface *savedWrapper = s.get();
+  gfxASurface* savedWrapper = s.get();
 
   s = nullptr;
 
diff --git a/gfx/thebes/cairo-xlib-utils.h b/gfx/thebes/cairo-xlib-utils.h
index f51e144086c6b..0125ff12cbf07 100644
--- a/gfx/thebes/cairo-xlib-utils.h
+++ b/gfx/thebes/cairo-xlib-utils.h
@@ -23,8 +23,8 @@ CAIRO_BEGIN_DECLS
  * @return True on success, False on non-recoverable error
  */
 typedef cairo_bool_t (*cairo_xlib_drawing_callback)(
-    void *closure, Screen *screen, Drawable drawable, Visual *visual,
-    short offset_x, short offset_y, XRectangle *clip_rects,
+    void* closure, Screen* screen, Drawable drawable, Visual* visual,
+    short offset_x, short offset_y, XRectangle* clip_rects,
     unsigned int num_rects);
 
 /**
@@ -32,7 +32,7 @@ typedef cairo_bool_t (*cairo_xlib_drawing_callback)(
  * caller may wish to reapply the drawing efficiently later.
  */
 typedef struct {
-  cairo_surface_t *surface;
+  cairo_surface_t* surface;
   cairo_bool_t uniform_alpha;
   cairo_bool_t uniform_color;
   double alpha;   /* valid only if uniform_alpha is TRUE */
@@ -103,12 +103,12 @@ typedef enum {
  * in which case the color is always uniform) then we won't bother returning
  * a surface for it.
  */
-void cairo_draw_with_xlib(cairo_t *cr, cairo_xlib_drawing_callback callback,
-                          void *closure, Display *dpy, unsigned int width,
+void cairo_draw_with_xlib(cairo_t* cr, cairo_xlib_drawing_callback callback,
+                          void* closure, Display* dpy, unsigned int width,
                           unsigned int height,
                           cairo_xlib_drawing_opacity_t is_opaque,
                           cairo_xlib_drawing_support_t capabilities,
-                          cairo_xlib_drawing_result_t *result);
+                          cairo_xlib_drawing_result_t* result);
 
 CAIRO_END_DECLS
 
diff --git a/gfx/thebes/d3dkmtQueryStatistics.h b/gfx/thebes/d3dkmtQueryStatistics.h
index 8d74bb886bece..c3491f8a06e40 100644
--- a/gfx/thebes/d3dkmtQueryStatistics.h
+++ b/gfx/thebes/d3dkmtQueryStatistics.h
@@ -153,5 +153,5 @@ typedef struct _D3DKMTQS {
 } D3DKMTQS;
 
 extern "C" {
-typedef __checkReturn NTSTATUS(APIENTRY *PFND3DKMTQS)(const D3DKMTQS *);
+typedef __checkReturn NTSTATUS(APIENTRY* PFND3DKMTQS)(const D3DKMTQS*);
 }
diff --git a/gfx/thebes/gfx2DGlue.h b/gfx/thebes/gfx2DGlue.h
index 9cd49b621ac6f..41342bff1ba67 100644
--- a/gfx/thebes/gfx2DGlue.h
+++ b/gfx/thebes/gfx2DGlue.h
@@ -18,50 +18,50 @@
 namespace mozilla {
 namespace gfx {
 
-inline Rect ToRect(const gfxRect &aRect) {
+inline Rect ToRect(const gfxRect& aRect) {
   return Rect(Float(aRect.X()), Float(aRect.Y()), Float(aRect.Width()),
               Float(aRect.Height()));
 }
 
-inline RectDouble ToRectDouble(const gfxRect &aRect) {
+inline RectDouble ToRectDouble(const gfxRect& aRect) {
   return RectDouble(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height());
 }
 
-inline Matrix ToMatrix(const gfxMatrix &aMatrix) {
+inline Matrix ToMatrix(const gfxMatrix& aMatrix) {
   return Matrix(Float(aMatrix._11), Float(aMatrix._12), Float(aMatrix._21),
                 Float(aMatrix._22), Float(aMatrix._31), Float(aMatrix._32));
 }
 
-inline gfxMatrix ThebesMatrix(const Matrix &aMatrix) {
+inline gfxMatrix ThebesMatrix(const Matrix& aMatrix) {
   return gfxMatrix(aMatrix._11, aMatrix._12, aMatrix._21, aMatrix._22,
                    aMatrix._31, aMatrix._32);
 }
 
-inline Point ToPoint(const gfxPoint &aPoint) {
+inline Point ToPoint(const gfxPoint& aPoint) {
   return Point(Float(aPoint.x), Float(aPoint.y));
 }
 
-inline Size ToSize(const gfxSize &aSize) {
+inline Size ToSize(const gfxSize& aSize) {
   return Size(Float(aSize.width), Float(aSize.height));
 }
 
-inline gfxPoint ThebesPoint(const Point &aPoint) {
+inline gfxPoint ThebesPoint(const Point& aPoint) {
   return gfxPoint(aPoint.x, aPoint.y);
 }
 
-inline gfxSize ThebesSize(const Size &aSize) {
+inline gfxSize ThebesSize(const Size& aSize) {
   return gfxSize(aSize.width, aSize.height);
 }
 
-inline gfxRect ThebesRect(const Rect &aRect) {
+inline gfxRect ThebesRect(const Rect& aRect) {
   return gfxRect(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height());
 }
 
-inline gfxRect ThebesRect(const IntRect &aRect) {
+inline gfxRect ThebesRect(const IntRect& aRect) {
   return gfxRect(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height());
 }
 
-inline gfxRect ThebesRect(const RectDouble &aRect) {
+inline gfxRect ThebesRect(const RectDouble& aRect) {
   return gfxRect(aRect.X(), aRect.Y(), aRect.Width(), aRect.Height());
 }
 
@@ -96,7 +96,7 @@ inline SurfaceFormat ImageFormatToSurfaceFormat(gfxImageFormat aFormat) {
   }
 }
 
-inline gfxContentType ContentForFormat(const SurfaceFormat &aFormat) {
+inline gfxContentType ContentForFormat(const SurfaceFormat& aFormat) {
   switch (aFormat) {
     case SurfaceFormat::R5G6B5_UINT16:
     case SurfaceFormat::B8G8R8X8:
diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp
index 342a063173163..d8c6cff84d1e8 100644
--- a/gfx/thebes/gfxASurface.cpp
+++ b/gfx/thebes/gfxASurface.cpp
@@ -108,28 +108,28 @@ nsrefcnt gfxASurface::Release(void) {
   return mFloatingRefs;
 }
 
-void gfxASurface::SurfaceDestroyFunc(void *data) {
-  gfxASurface *surf = (gfxASurface *)data;
+void gfxASurface::SurfaceDestroyFunc(void* data) {
+  gfxASurface* surf = (gfxASurface*)data;
   // fprintf (stderr, "Deleting wrapper for %p (wrapper: %p)\n", surf->mSurface,
   //          data);
   delete surf;
 }
 
-gfxASurface *gfxASurface::GetSurfaceWrapper(cairo_surface_t *csurf) {
+gfxASurface* gfxASurface::GetSurfaceWrapper(cairo_surface_t* csurf) {
   if (!csurf) return nullptr;
-  return (gfxASurface *)cairo_surface_get_user_data(csurf,
-                                                    &gfxasurface_pointer_key);
+  return (gfxASurface*)cairo_surface_get_user_data(csurf,
+                                                   &gfxasurface_pointer_key);
 }
 
-void gfxASurface::SetSurfaceWrapper(cairo_surface_t *csurf,
-                                    gfxASurface *asurf) {
+void gfxASurface::SetSurfaceWrapper(cairo_surface_t* csurf,
+                                    gfxASurface* asurf) {
   if (!csurf) return;
   cairo_surface_set_user_data(csurf, &gfxasurface_pointer_key, asurf,
                               SurfaceDestroyFunc);
 }
 
-already_AddRefed gfxASurface::Wrap(cairo_surface_t *csurf,
-                                                const IntSize &aSize) {
+already_AddRefed gfxASurface::Wrap(cairo_surface_t* csurf,
+                                                const IntSize& aSize) {
   RefPtr result;
 
   /* Do we already have a wrapper for this surface? */
@@ -170,7 +170,7 @@ already_AddRefed gfxASurface::Wrap(cairo_surface_t *csurf,
   return result.forget();
 }
 
-void gfxASurface::Init(cairo_surface_t *surface, bool existingSurface) {
+void gfxASurface::Init(cairo_surface_t* surface, bool existingSurface) {
   SetSurfaceWrapper(surface, this);
   MOZ_ASSERT(surface, "surface should be a valid pointer");
 
@@ -206,7 +206,7 @@ gfxContentType gfxASurface::GetContentType() const {
   return (gfxContentType)cairo_surface_get_content(mSurface);
 }
 
-void gfxASurface::SetDeviceOffset(const gfxPoint &offset) {
+void gfxASurface::SetDeviceOffset(const gfxPoint& offset) {
   if (!mSurfaceValid) return;
   cairo_surface_set_device_offset(mSurface, offset.x, offset.y);
 }
@@ -221,7 +221,7 @@ gfxPoint gfxASurface::GetDeviceOffset() const {
 void gfxASurface::Flush() const {
   if (!mSurfaceValid) return;
   cairo_surface_flush(mSurface);
-  gfxPlatform::ClearSourceSurfaceForSurface(const_cast(this));
+  gfxPlatform::ClearSourceSurfaceForSurface(const_cast(this));
 }
 
 void gfxASurface::MarkDirty() {
@@ -230,20 +230,20 @@ void gfxASurface::MarkDirty() {
   gfxPlatform::ClearSourceSurfaceForSurface(this);
 }
 
-void gfxASurface::MarkDirty(const gfxRect &r) {
+void gfxASurface::MarkDirty(const gfxRect& r) {
   if (!mSurfaceValid) return;
   cairo_surface_mark_dirty_rectangle(mSurface, (int)r.X(), (int)r.Y(),
                                      (int)r.Width(), (int)r.Height());
   gfxPlatform::ClearSourceSurfaceForSurface(this);
 }
 
-void gfxASurface::SetData(const cairo_user_data_key_t *key, void *user_data,
+void gfxASurface::SetData(const cairo_user_data_key_t* key, void* user_data,
                           thebes_destroy_func_t destroy) {
   if (!mSurfaceValid) return;
   cairo_surface_set_user_data(mSurface, key, user_data, destroy);
 }
 
-void *gfxASurface::GetData(const cairo_user_data_key_t *key) {
+void* gfxASurface::GetData(const cairo_user_data_key_t* key) {
   if (!mSurfaceValid) return nullptr;
   return cairo_surface_get_user_data(mSurface, key);
 }
@@ -254,12 +254,12 @@ void gfxASurface::Finish() {
 }
 
 already_AddRefed gfxASurface::CreateSimilarSurface(
-    gfxContentType aContent, const IntSize &aSize) {
+    gfxContentType aContent, const IntSize& aSize) {
   if (!mSurface || !mSurfaceValid) {
     return nullptr;
   }
 
-  cairo_surface_t *surface = cairo_surface_create_similar(
+  cairo_surface_t* surface = cairo_surface_create_similar(
       mSurface, cairo_content_t(int(aContent)), aSize.width, aSize.height);
   if (cairo_surface_status(surface)) {
     cairo_surface_destroy(surface);
@@ -297,8 +297,8 @@ int gfxASurface::CairoStatus() {
   return cairo_surface_status(mSurface);
 }
 
-nsresult gfxASurface::BeginPrinting(const nsAString &aTitle,
-                                    const nsAString &aPrintToFileName) {
+nsresult gfxASurface::BeginPrinting(const nsAString& aTitle,
+                                    const nsAString& aPrintToFileName) {
   return NS_OK;
 }
 
@@ -343,12 +343,12 @@ int32_t gfxASurface::BytePerPixelFromFormat(gfxImageFormat format) {
 
 /** Memory reporting **/
 
-static const char *sDefaultSurfaceDescription =
+static const char* sDefaultSurfaceDescription =
     "Memory used by gfx surface of the given type.";
 
 struct SurfaceMemoryReporterAttrs {
-  const char *path;
-  const char *description;
+  const char* path;
+  const char* description;
 };
 
 static const SurfaceMemoryReporterAttrs sSurfaceMemoryReporterAttrs[] = {
@@ -416,15 +416,15 @@ class SurfaceMemoryReporter final : public nsIMemoryReporter {
   // threadsafe.
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  NS_IMETHOD CollectReports(nsIHandleReportCallback *aHandleReport,
-                            nsISupports *aData, bool aAnonymize) override {
+  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
+                            nsISupports* aData, bool aAnonymize) override {
     const size_t len = ArrayLength(sSurfaceMemoryReporterAttrs);
     for (size_t i = 0; i < len; i++) {
       int64_t amount = sSurfaceMemoryUsed[i];
 
       if (amount != 0) {
-        const char *path = sSurfaceMemoryReporterAttrs[i].path;
-        const char *desc = sSurfaceMemoryReporterAttrs[i].description;
+        const char* path = sSurfaceMemoryReporterAttrs[i].path;
+        const char* desc = sSurfaceMemoryReporterAttrs[i].description;
         if (!desc) {
           desc = sDefaultSurfaceDescription;
         }
@@ -498,7 +498,7 @@ uint8_t gfxASurface::BytesPerPixel(gfxImageFormat aImageFormat) {
   }
 }
 
-void gfxASurface::SetOpaqueRect(const gfxRect &aRect) {
+void gfxASurface::SetOpaqueRect(const gfxRect& aRect) {
   if (aRect.IsEmpty()) {
     mOpaqueRect = nullptr;
   } else if (!!mOpaqueRect) {
@@ -508,7 +508,7 @@ void gfxASurface::SetOpaqueRect(const gfxRect &aRect) {
   }
 }
 
-/* static */ const gfxRect &gfxASurface::GetEmptyOpaqueRect() {
+/* static */ const gfxRect& gfxASurface::GetEmptyOpaqueRect() {
   static const gfxRect empty(0, 0, 0, 0);
   return empty;
 }
diff --git a/gfx/thebes/gfxASurface.h b/gfx/thebes/gfxASurface.h
index e6b248cca0138..4968c6b19e329 100644
--- a/gfx/thebes/gfxASurface.h
+++ b/gfx/thebes/gfxASurface.h
@@ -42,34 +42,34 @@ class gfxASurface {
    * This adds a reference to csurf (owned by the returned gfxASurface).
    */
   static already_AddRefed Wrap(
-      cairo_surface_t *csurf,
-      const mozilla::gfx::IntSize &aSize = mozilla::gfx::IntSize(-1, -1));
+      cairo_surface_t* csurf,
+      const mozilla::gfx::IntSize& aSize = mozilla::gfx::IntSize(-1, -1));
 
   /*** this DOES NOT addref the surface */
-  cairo_surface_t *CairoSurface() { return mSurface; }
+  cairo_surface_t* CairoSurface() { return mSurface; }
 
   gfxSurfaceType GetType() const;
 
   gfxContentType GetContentType() const;
 
-  void SetDeviceOffset(const gfxPoint &offset);
+  void SetDeviceOffset(const gfxPoint& offset);
   gfxPoint GetDeviceOffset() const;
 
   void Flush() const;
   void MarkDirty();
-  void MarkDirty(const gfxRect &r);
+  void MarkDirty(const gfxRect& r);
 
   /* Printing backend functions */
-  virtual nsresult BeginPrinting(const nsAString &aTitle,
-                                 const nsAString &aPrintToFileName);
+  virtual nsresult BeginPrinting(const nsAString& aTitle,
+                                 const nsAString& aPrintToFileName);
   virtual nsresult EndPrinting();
   virtual nsresult AbortPrinting();
   virtual nsresult BeginPage();
   virtual nsresult EndPage();
 
-  void SetData(const cairo_user_data_key_t *key, void *user_data,
+  void SetData(const cairo_user_data_key_t* key, void* user_data,
                thebes_destroy_func_t destroy);
-  void *GetData(const cairo_user_data_key_t *key);
+  void* GetData(const cairo_user_data_key_t* key);
 
   virtual void Finish();
 
@@ -79,7 +79,7 @@ class gfxASurface {
    * Returns null on error.
    */
   virtual already_AddRefed CreateSimilarSurface(
-      gfxContentType aType, const mozilla::gfx::IntSize &aSize);
+      gfxContentType aType, const mozilla::gfx::IntSize& aSize);
 
   /**
    * Returns an image surface for this surface, or nullptr if not supported.
@@ -133,9 +133,9 @@ class gfxASurface {
 
   virtual mozilla::gfx::SurfaceFormat GetSurfaceFormat() const;
 
-  void SetOpaqueRect(const gfxRect &aRect);
+  void SetOpaqueRect(const gfxRect& aRect);
 
-  const gfxRect &GetOpaqueRect() {
+  const gfxRect& GetOpaqueRect() {
     if (!!mOpaqueRect) return *mOpaqueRect;
     return GetEmptyOpaqueRect();
   }
@@ -145,25 +145,25 @@ class gfxASurface {
  protected:
   gfxASurface();
 
-  static gfxASurface *GetSurfaceWrapper(cairo_surface_t *csurf);
-  static void SetSurfaceWrapper(cairo_surface_t *csurf, gfxASurface *asurf);
+  static gfxASurface* GetSurfaceWrapper(cairo_surface_t* csurf);
+  static void SetSurfaceWrapper(cairo_surface_t* csurf, gfxASurface* asurf);
 
   // NB: Init() *must* be called from within subclass's
   // constructors.  It's unsafe to call it after the ctor finishes;
   // leaks and use-after-frees are possible.
-  void Init(cairo_surface_t *surface, bool existingSurface = false);
+  void Init(cairo_surface_t* surface, bool existingSurface = false);
 
   // out-of-line helper to allow GetOpaqueRect() to be inlined
   // without including gfxRect.h here
-  static const gfxRect &GetEmptyOpaqueRect();
+  static const gfxRect& GetEmptyOpaqueRect();
 
   virtual ~gfxASurface();
 
-  cairo_surface_t *mSurface;
+  cairo_surface_t* mSurface;
   mozilla::UniquePtr mOpaqueRect;
 
  private:
-  static void SurfaceDestroyFunc(void *data);
+  static void SurfaceDestroyFunc(void* data);
 
   int32_t mFloatingRefs;
   int32_t mBytesRecorded;
@@ -177,7 +177,7 @@ class gfxASurface {
  */
 class gfxUnknownSurface : public gfxASurface {
  public:
-  gfxUnknownSurface(cairo_surface_t *surf, const mozilla::gfx::IntSize &aSize)
+  gfxUnknownSurface(cairo_surface_t* surf, const mozilla::gfx::IntSize& aSize)
       : mSize(aSize) {
     Init(surf, true);
   }
diff --git a/gfx/thebes/gfxAlphaRecovery.h b/gfx/thebes/gfxAlphaRecovery.h
index 772d5bd1d2a28..53b38f2ac0bd7 100644
--- a/gfx/thebes/gfxAlphaRecovery.h
+++ b/gfx/thebes/gfxAlphaRecovery.h
@@ -30,16 +30,16 @@ class gfxAlphaRecovery {
    * The surfaces must have format RGB24 or ARGB32.
    * Returns true on success.
    */
-  static bool RecoverAlpha(gfxImageSurface *blackSurface,
-                           const gfxImageSurface *whiteSurface);
+  static bool RecoverAlpha(gfxImageSurface* blackSurface,
+                           const gfxImageSurface* whiteSurface);
 
 #ifdef MOZILLA_MAY_SUPPORT_SSE2
   /* This does the same as the previous function, but uses SSE2
    * optimizations. Usually this should not be called directly.  Be sure to
    * check mozilla::supports_sse2() before calling this function.
    */
-  static bool RecoverAlphaSSE2(gfxImageSurface *blackSurface,
-                               const gfxImageSurface *whiteSurface);
+  static bool RecoverAlphaSSE2(gfxImageSurface* blackSurface,
+                               const gfxImageSurface* whiteSurface);
 
   /**
    * A common use-case for alpha recovery is to paint into a
@@ -53,10 +53,10 @@ class gfxAlphaRecovery {
    * The returned rect is always a superset of |aRect|.
    */
   static mozilla::gfx::IntRect AlignRectForSubimageRecovery(
-      const mozilla::gfx::IntRect &aRect, gfxImageSurface *aSurface);
+      const mozilla::gfx::IntRect& aRect, gfxImageSurface* aSurface);
 #else
   static mozilla::gfx::IntRect AlignRectForSubimageRecovery(
-      const mozilla::gfx::IntRect &aRect, gfxImageSurface *) {
+      const mozilla::gfx::IntRect& aRect, gfxImageSurface*) {
     return aRect;
   }
 #endif
diff --git a/gfx/thebes/gfxCoreTextShaper.cpp b/gfx/thebes/gfxCoreTextShaper.cpp
index a9444d5b33ee6..d447b98d73f29 100644
--- a/gfx/thebes/gfxCoreTextShaper.cpp
+++ b/gfx/thebes/gfxCoreTextShaper.cpp
@@ -31,9 +31,8 @@ CFDictionaryRef gfxCoreTextShaper::CreateAttrDict(bool aRightToLeft) {
                                      : kCTWritingDirectionLeftToRight);
   CFNumberRef dirNumber =
       ::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt16Type, &dirOverride);
-  CFArrayRef dirArray =
-      ::CFArrayCreate(kCFAllocatorDefault, (const void **)&dirNumber, 1,
-                      &kCFTypeArrayCallBacks);
+  CFArrayRef dirArray = ::CFArrayCreate(
+      kCFAllocatorDefault, (const void**)&dirNumber, 1, &kCFTypeArrayCallBacks);
   ::CFRelease(dirNumber);
   CFTypeRef attrs[] = {kCTFontAttributeName, kCTWritingDirectionAttributeName};
   CFTypeRef values[] = {mCTFont[0], dirArray};
@@ -44,7 +43,7 @@ CFDictionaryRef gfxCoreTextShaper::CreateAttrDict(bool aRightToLeft) {
   return attrDict;
 }
 
-gfxCoreTextShaper::gfxCoreTextShaper(gfxMacFont *aFont)
+gfxCoreTextShaper::gfxCoreTextShaper(gfxMacFont* aFont)
     : gfxFontShaper(aFont),
       mAttributesDictLTR(nullptr),
       mAttributesDictRTL(nullptr) {
@@ -76,15 +75,15 @@ static bool IsBuggyIndicScript(unicode::Script aScript) {
          aScript == unicode::Script::ORIYA || aScript == unicode::Script::KHMER;
 }
 
-bool gfxCoreTextShaper::ShapeText(DrawTarget *aDrawTarget,
-                                  const char16_t *aText, uint32_t aOffset,
+bool gfxCoreTextShaper::ShapeText(DrawTarget* aDrawTarget,
+                                  const char16_t* aText, uint32_t aOffset,
                                   uint32_t aLength, Script aScript,
                                   bool aVertical, RoundingFlags aRounding,
-                                  gfxShapedText *aShapedText) {
+                                  gfxShapedText* aShapedText) {
   // Create a CFAttributedString with text and style info, so we can use
   // CoreText to lay it out.
   bool isRightToLeft = aShapedText->IsRightToLeft();
-  const UniChar *text = reinterpret_cast(aText);
+  const UniChar* text = reinterpret_cast(aText);
 
   CFStringRef stringObj = ::CFStringCreateWithCharactersNoCopy(
       kCFAllocatorDefault, text, aLength, kCFAllocatorNull);
@@ -92,12 +91,12 @@ bool gfxCoreTextShaper::ShapeText(DrawTarget *aDrawTarget,
   // Figure out whether we should try to set the AAT small-caps feature:
   // examine OpenType tags for the requested style, and see if 'smcp' is
   // among them.
-  const gfxFontStyle *style = mFont->GetStyle();
-  gfxFontEntry *entry = mFont->GetFontEntry();
-  auto handleFeatureTag = [](const uint32_t &aTag, uint32_t &aValue,
-                             void *aUserArg) -> void {
+  const gfxFontStyle* style = mFont->GetStyle();
+  gfxFontEntry* entry = mFont->GetFontEntry();
+  auto handleFeatureTag = [](const uint32_t& aTag, uint32_t& aValue,
+                             void* aUserArg) -> void {
     if (aTag == HB_TAG('s', 'm', 'c', 'p') && aValue) {
-      *static_cast(aUserArg) = true;
+      *static_cast(aUserArg) = true;
     }
   };
   bool addSmallCaps = false;
@@ -170,8 +169,8 @@ bool gfxCoreTextShaper::ShapeText(DrawTarget *aDrawTarget,
       // If Core Text manufactured a new dictionary, this may indicate
       // unexpected font substitution. In that case, we fail (and fall
       // back to harfbuzz shaping)...
-      const void *font1 = ::CFDictionaryGetValue(attrObj, kCTFontAttributeName);
-      const void *font2 = ::CFDictionaryGetValue(runAttr, kCTFontAttributeName);
+      const void* font1 = ::CFDictionaryGetValue(attrObj, kCTFontAttributeName);
+      const void* font2 = ::CFDictionaryGetValue(runAttr, kCTFontAttributeName);
       if (font1 != font2) {
         // ...except that if the fallback was only for a variation
         // selector or join control that is otherwise unsupported,
@@ -207,7 +206,7 @@ bool gfxCoreTextShaper::ShapeText(DrawTarget *aDrawTarget,
        // some testing indicates that 90%+ of glyph runs will fit
        // without requiring a separate allocation
 
-nsresult gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
+nsresult gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText* aShapedText,
                                              uint32_t aOffset, uint32_t aLength,
                                              CTRunRef aCTRun) {
   typedef gfxShapedText::CompressedGlyph CompressedGlyph;
@@ -240,9 +239,9 @@ nsresult gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
   UniquePtr glyphsArray;
   UniquePtr positionsArray;
   UniquePtr glyphToCharArray;
-  const CGGlyph *glyphs = nullptr;
-  const CGPoint *positions = nullptr;
-  const CFIndex *glyphToChar = nullptr;
+  const CGGlyph* glyphs = nullptr;
+  const CGPoint* positions = nullptr;
+  const CFIndex* glyphToChar = nullptr;
 
   // Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds,
   // and so allocating a new array and copying data with CTRunGetGlyphs
@@ -290,7 +289,7 @@ nsresult gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
                                                 nullptr, nullptr, nullptr);
 
   AutoTArray detailedGlyphs;
-  CompressedGlyph *charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset;
+  CompressedGlyph* charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset;
 
   // CoreText gives us the glyphindex-to-charindex mapping, which relates each
   // glyph to a source text character; we also need the charindex-to-glyphindex
@@ -309,7 +308,7 @@ nsresult gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
   if (!charToGlyphArray.SetLength(stringRange.length, fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
-  int32_t *charToGlyph = charToGlyphArray.Elements();
+  int32_t* charToGlyph = charToGlyphArray.Elements();
   for (int32_t offset = 0; offset < stringRange.length; ++offset) {
     charToGlyph[offset] = NO_GLYPH;
   }
@@ -503,7 +502,7 @@ nsresult gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
       // advance, hence the placement of the loop-exit test and the measurement
       // of the next glyph
       while (true) {
-        gfxTextRun::DetailedGlyph *details = detailedGlyphs.AppendElement();
+        gfxTextRun::DetailedGlyph* details = detailedGlyphs.AppendElement();
         details->mGlyphID = glyphs[glyphStart];
         details->mOffset.y = -positions[glyphStart].y * appUnitsPerDevUnit;
         details->mAdvance = advance;
@@ -530,7 +529,7 @@ nsresult gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
     // the rest of the chars in the group are ligature continuations, no
     // associated glyphs
     while (++baseCharIndex != endCharIndex && baseCharIndex < wordLength) {
-      CompressedGlyph &shapedTextGlyph = charGlyphs[baseCharIndex];
+      CompressedGlyph& shapedTextGlyph = charGlyphs[baseCharIndex];
       NS_ASSERTION(!shapedTextGlyph.IsSimpleGlyph(),
                    "overwriting a simple glyph");
       shapedTextGlyph.SetComplex(inOrder && shapedTextGlyph.IsClusterStart(),
@@ -556,7 +555,7 @@ nsresult gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
 #define MAX_FEATURES 5  // max used by any of our Get*Descriptor functions
 
 CTFontDescriptorRef gfxCoreTextShaper::CreateFontFeaturesDescriptor(
-    const std::pair *aFeatures, size_t aCount) {
+    const std::pair* aFeatures, size_t aCount) {
   MOZ_ASSERT(aCount <= MAX_FEATURES);
 
   CFDictionaryRef featureSettings[MAX_FEATURES];
@@ -571,7 +570,7 @@ CTFontDescriptorRef gfxCoreTextShaper::CreateFontFeaturesDescriptor(
                         kCTFontFeatureSelectorIdentifierKey};
     CFTypeRef values[] = {type, selector};
     featureSettings[i] = ::CFDictionaryCreate(
-        kCFAllocatorDefault, (const void **)keys, (const void **)values,
+        kCFAllocatorDefault, (const void**)keys, (const void**)values,
         ArrayLength(keys), &kCFTypeDictionaryKeyCallBacks,
         &kCFTypeDictionaryValueCallBacks);
 
@@ -580,7 +579,7 @@ CTFontDescriptorRef gfxCoreTextShaper::CreateFontFeaturesDescriptor(
   }
 
   CFArrayRef featuresArray =
-      ::CFArrayCreate(kCFAllocatorDefault, (const void **)featureSettings,
+      ::CFArrayCreate(kCFAllocatorDefault, (const void**)featureSettings,
                       aCount,  // not ArrayLength(featureSettings), as we
                                // may not have used all the allocated slots
                       &kCFTypeArrayCallBacks);
@@ -592,7 +591,7 @@ CTFontDescriptorRef gfxCoreTextShaper::CreateFontFeaturesDescriptor(
   const CFTypeRef attrKeys[] = {kCTFontFeatureSettingsAttribute};
   const CFTypeRef attrValues[] = {featuresArray};
   CFDictionaryRef attributesDict = ::CFDictionaryCreate(
-      kCFAllocatorDefault, (const void **)attrKeys, (const void **)attrValues,
+      kCFAllocatorDefault, (const void**)attrKeys, (const void**)attrValues,
       ArrayLength(attrKeys), &kCFTypeDictionaryKeyCallBacks,
       &kCFTypeDictionaryValueCallBacks);
   ::CFRelease(featuresArray);
@@ -634,9 +633,9 @@ CTFontDescriptorRef gfxCoreTextShaper::GetFeaturesDescriptor(
 
 CTFontRef gfxCoreTextShaper::CreateCTFontWithFeatures(
     CGFloat aSize, CTFontDescriptorRef aDescriptor) {
-  const gfxFontEntry *fe = mFont->GetFontEntry();
+  const gfxFontEntry* fe = mFont->GetFontEntry();
   bool isInstalledFont = !fe->IsUserFont() || fe->IsLocalUserFont();
-  CGFontRef cgFont = static_cast(mFont)->GetCGFontRef();
+  CGFontRef cgFont = static_cast(mFont)->GetCGFontRef();
   return gfxMacFont::CreateCTFontFromCGFontWithVariations(
       cgFont, aSize, isInstalledFont, aDescriptor);
 }
diff --git a/gfx/thebes/gfxCoreTextShaper.h b/gfx/thebes/gfxCoreTextShaper.h
index e398088415a9a..c06ff73f743a9 100644
--- a/gfx/thebes/gfxCoreTextShaper.h
+++ b/gfx/thebes/gfxCoreTextShaper.h
@@ -14,13 +14,13 @@ class gfxMacFont;
 
 class gfxCoreTextShaper : public gfxFontShaper {
  public:
-  explicit gfxCoreTextShaper(gfxMacFont *aFont);
+  explicit gfxCoreTextShaper(gfxMacFont* aFont);
 
   virtual ~gfxCoreTextShaper();
 
-  bool ShapeText(DrawTarget *aDrawTarget, const char16_t *aText, uint32_t aOffset, uint32_t aLength,
+  bool ShapeText(DrawTarget* aDrawTarget, const char16_t* aText, uint32_t aOffset, uint32_t aLength,
                  Script aScript, bool aVertical, RoundingFlags aRounding,
-                 gfxShapedText *aShapedText) override;
+                 gfxShapedText* aShapedText) override;
 
   // clean up static objects that may have been cached
   static void Shutdown();
@@ -47,7 +47,7 @@ class gfxCoreTextShaper : public gfxFontShaper {
   CFDictionaryRef mAttributesDictLTR;
   CFDictionaryRef mAttributesDictRTL;
 
-  nsresult SetGlyphsFromRun(gfxShapedText *aShapedText, uint32_t aOffset, uint32_t aLength,
+  nsresult SetGlyphsFromRun(gfxShapedText* aShapedText, uint32_t aOffset, uint32_t aLength,
                             CTRunRef aCTRun);
 
   CTFontRef CreateCTFontWithFeatures(CGFloat aSize, CTFontDescriptorRef aDescriptor);
@@ -56,7 +56,7 @@ class gfxCoreTextShaper : public gfxFontShaper {
   CFDictionaryRef CreateAttrDictWithoutDirection();
 
   static CTFontDescriptorRef CreateFontFeaturesDescriptor(
-      const std::pair *aFeatures, size_t aCount);
+      const std::pair* aFeatures, size_t aCount);
 
   static CTFontDescriptorRef GetFeaturesDescriptor(FeatureFlags aFeatureFlags);
 
diff --git a/gfx/thebes/gfxDWriteFonts.h b/gfx/thebes/gfxDWriteFonts.h
index 7b3dce2ff673c..73b148ad9cecb 100644
--- a/gfx/thebes/gfxDWriteFonts.h
+++ b/gfx/thebes/gfxDWriteFonts.h
@@ -26,8 +26,8 @@ typedef _cairo_font_face cairo_font_face_t;
  */
 class gfxDWriteFont : public gfxFont {
  public:
-  gfxDWriteFont(const RefPtr &aUnscaledFont,
-                gfxFontEntry *aFontEntry, const gfxFontStyle *aFontStyle,
+  gfxDWriteFont(const RefPtr& aUnscaledFont,
+                gfxFontEntry* aFontEntry, const gfxFontStyle* aFontStyle,
                 RefPtr aFontFace = nullptr,
                 AntialiasOption = kAntialiasDefault);
   ~gfxDWriteFont();
@@ -40,19 +40,19 @@ class gfxDWriteFont : public gfxFont {
 
   uint32_t GetSpaceGlyph() override;
 
-  bool SetupCairoFont(DrawTarget *aDrawTarget) override;
+  bool SetupCairoFont(DrawTarget* aDrawTarget) override;
 
   bool AllowSubpixelAA() override { return mAllowManualShowGlyphs; }
 
   bool IsValid() const;
 
-  IDWriteFontFace *GetFontFace();
+  IDWriteFontFace* GetFontFace();
 
   /* override Measure to add padding for antialiasing */
-  RunMetrics Measure(const gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
+  RunMetrics Measure(const gfxTextRun* aTextRun, uint32_t aStart, uint32_t aEnd,
                      BoundingBoxType aBoundingBoxType,
-                     DrawTarget *aDrawTargetForTightBoundingBox,
-                     Spacing *aSpacing,
+                     DrawTarget* aDrawTargetForTightBoundingBox,
+                     Spacing* aSpacing,
                      mozilla::gfx::ShapedTextFlags aOrientation) override;
 
   bool ProvidesGlyphWidths() const override;
@@ -60,27 +60,27 @@ class gfxDWriteFont : public gfxFont {
   int32_t GetGlyphWidth(uint16_t aGID) override;
 
   void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                              FontCacheSizes *aSizes) const override;
+                              FontCacheSizes* aSizes) const override;
   void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                              FontCacheSizes *aSizes) const override;
+                              FontCacheSizes* aSizes) const override;
 
   FontType GetType() const override { return FONT_TYPE_DWRITE; }
 
   already_AddRefed GetScaledFont(
-      mozilla::gfx::DrawTarget *aTarget) override;
+      mozilla::gfx::DrawTarget* aTarget) override;
 
  protected:
-  cairo_scaled_font_t *InitCairoScaledFont();
+  cairo_scaled_font_t* InitCairoScaledFont();
 
-  const Metrics &GetHorizontalMetrics() override;
+  const Metrics& GetHorizontalMetrics() override;
 
-  bool GetFakeMetricsForArialBlack(DWRITE_FONT_METRICS *aFontMetrics);
+  bool GetFakeMetricsForArialBlack(DWRITE_FONT_METRICS* aFontMetrics);
 
   void ComputeMetrics(AntialiasOption anAAOption);
 
   bool HasBitmapStrikeForSize(uint32_t aSize);
 
-  cairo_font_face_t *CairoFontFace();
+  cairo_font_face_t* CairoFontFace();
 
   gfxFloat MeasureGlyphWidth(uint16_t aGlyph);
 
@@ -90,9 +90,9 @@ class gfxDWriteFont : public gfxFont {
   RefPtr mFontFace;
   RefPtr mFontFace1;  // may be unavailable on older DWrite
 
-  cairo_font_face_t *mCairoFontFace;
+  cairo_font_face_t* mCairoFontFace;
 
-  Metrics *mMetrics;
+  Metrics* mMetrics;
 
   // cache of glyph widths in 16.16 fixed-point pixels
   mozilla::UniquePtr> mGlyphWidths;
diff --git a/gfx/thebes/gfxFT2Fonts.cpp b/gfx/thebes/gfxFT2Fonts.cpp
index 769cdc6991ba4..ccce93f48fffd 100644
--- a/gfx/thebes/gfxFT2Fonts.cpp
+++ b/gfx/thebes/gfxFT2Fonts.cpp
@@ -40,10 +40,10 @@ using namespace mozilla::gfx;
  * gfxFT2Font
  */
 
-bool gfxFT2Font::ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
+bool gfxFT2Font::ShapeText(DrawTarget* aDrawTarget, const char16_t* aText,
                            uint32_t aOffset, uint32_t aLength, Script aScript,
                            bool aVertical, RoundingFlags aRounding,
-                           gfxShapedText *aShapedText) {
+                           gfxShapedText* aShapedText) {
   if (!gfxFont::ShapeText(aDrawTarget, aText, aOffset, aLength, aScript,
                           aVertical, aRounding, aShapedText)) {
     // harfbuzz must have failed(?!), just render raw glyphs
@@ -55,8 +55,8 @@ bool gfxFT2Font::ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
   return true;
 }
 
-void gfxFT2Font::AddRange(const char16_t *aText, uint32_t aOffset,
-                          uint32_t aLength, gfxShapedText *aShapedText) {
+void gfxFT2Font::AddRange(const char16_t* aText, uint32_t aOffset,
+                          uint32_t aLength, gfxShapedText* aShapedText) {
   typedef gfxShapedText::CompressedGlyph CompressedGlyph;
 
   const uint32_t appUnitsPerDevUnit = aShapedText->GetAppUnitsPerDevUnit();
@@ -65,7 +65,7 @@ void gfxFT2Font::AddRange(const char16_t *aText, uint32_t aOffset,
   gfxFT2LockedFace faceLock(this);
   FT_Face face = faceLock.get();
 
-  CompressedGlyph *charGlyphs = aShapedText->GetCharacterGlyphs();
+  CompressedGlyph* charGlyphs = aShapedText->GetCharacterGlyphs();
 
   const gfxFT2Font::CachedGlyphData *cgd = nullptr, *cgdNext = nullptr;
 
@@ -152,9 +152,9 @@ void gfxFT2Font::AddRange(const char16_t *aText, uint32_t aOffset,
   }
 }
 
-gfxFT2Font::gfxFT2Font(const RefPtr &aUnscaledFont,
-                       cairo_scaled_font_t *aCairoFont, FT_Face aFTFace,
-                       FT2FontEntry *aFontEntry, const gfxFontStyle *aFontStyle)
+gfxFT2Font::gfxFT2Font(const RefPtr& aUnscaledFont,
+                       cairo_scaled_font_t* aCairoFont, FT_Face aFTFace,
+                       FT2FontEntry* aFontEntry, const gfxFontStyle* aFontStyle)
     : gfxFT2FontBase(aUnscaledFont, aCairoFont, aFontEntry, aFontStyle),
       mCharGlyphCache(32),
       mFTFace(aFTFace) {
@@ -166,7 +166,7 @@ gfxFT2Font::gfxFT2Font(const RefPtr &aUnscaledFont,
 
 gfxFT2Font::~gfxFT2Font() {}
 
-already_AddRefed gfxFT2Font::GetScaledFont(DrawTarget *aTarget) {
+already_AddRefed gfxFT2Font::GetScaledFont(DrawTarget* aTarget) {
   if (!mAzureScaledFont) {
     NativeFont nativeFont;
     nativeFont.mType = NativeFontType::FREETYPE_FACE;
@@ -182,7 +182,7 @@ already_AddRefed gfxFT2Font::GetScaledFont(DrawTarget *aTarget) {
 }
 
 void gfxFT2Font::FillGlyphDataForChar(FT_Face face, uint32_t ch,
-                                      CachedGlyphData *gd) {
+                                      CachedGlyphData* gd) {
   if (!face->charmap || face->charmap->encoding != FT_ENCODING_UNICODE) {
     FT_Select_Charmap(face, FT_ENCODING_UNICODE);
   }
@@ -217,14 +217,14 @@ void gfxFT2Font::FillGlyphDataForChar(FT_Face face, uint32_t ch,
 }
 
 void gfxFT2Font::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
-                                        FontCacheSizes *aSizes) const {
+                                        FontCacheSizes* aSizes) const {
   gfxFont::AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
   aSizes->mFontInstances +=
       mCharGlyphCache.ShallowSizeOfExcludingThis(aMallocSizeOf);
 }
 
 void gfxFT2Font::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
-                                        FontCacheSizes *aSizes) const {
+                                        FontCacheSizes* aSizes) const {
   aSizes->mFontInstances += aMallocSizeOf(this);
   AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
 }
diff --git a/gfx/thebes/gfxFT2Fonts.h b/gfx/thebes/gfxFT2Fonts.h
index 0abfaabe9fe14..0b4df43c40318 100644
--- a/gfx/thebes/gfxFT2Fonts.h
+++ b/gfx/thebes/gfxFT2Fonts.h
@@ -19,20 +19,20 @@ class FT2FontEntry;
 
 class gfxFT2Font : public gfxFT2FontBase {
  public:  // new functions
-  gfxFT2Font(const RefPtr &aUnscaledFont,
-             cairo_scaled_font_t *aCairoFont, FT_Face aFTFace,
-             FT2FontEntry *aFontEntry, const gfxFontStyle *aFontStyle);
+  gfxFT2Font(const RefPtr& aUnscaledFont,
+             cairo_scaled_font_t* aCairoFont, FT_Face aFTFace,
+             FT2FontEntry* aFontEntry, const gfxFontStyle* aFontStyle);
   virtual ~gfxFT2Font();
 
-  FT2FontEntry *GetFontEntry();
+  FT2FontEntry* GetFontEntry();
 
   already_AddRefed GetScaledFont(
-      DrawTarget *aTarget) override;
+      DrawTarget* aTarget) override;
 
   void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                              FontCacheSizes *aSizes) const override;
+                              FontCacheSizes* aSizes) const override;
   void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                              FontCacheSizes *aSizes) const override;
+                              FontCacheSizes* aSizes) const override;
 
  protected:
   struct CachedGlyphData {
@@ -46,8 +46,8 @@ class gfxFT2Font : public gfxFT2FontBase {
     int32_t xAdvance;
   };
 
-  const CachedGlyphData *GetGlyphDataForChar(FT_Face aFace, uint32_t ch) {
-    CharGlyphMapEntryType *entry = mCharGlyphCache.PutEntry(ch);
+  const CachedGlyphData* GetGlyphDataForChar(FT_Face aFace, uint32_t ch) {
+    CharGlyphMapEntryType* entry = mCharGlyphCache.PutEntry(ch);
 
     if (!entry) return nullptr;
 
@@ -59,15 +59,15 @@ class gfxFT2Font : public gfxFT2FontBase {
     return &entry->mData;
   }
 
-  bool ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
+  bool ShapeText(DrawTarget* aDrawTarget, const char16_t* aText,
                  uint32_t aOffset, uint32_t aLength, Script aScript,
                  bool aVertical, RoundingFlags aRounding,
-                 gfxShapedText *aShapedText) override;
+                 gfxShapedText* aShapedText) override;
 
-  void FillGlyphDataForChar(FT_Face face, uint32_t ch, CachedGlyphData *gd);
+  void FillGlyphDataForChar(FT_Face face, uint32_t ch, CachedGlyphData* gd);
 
-  void AddRange(const char16_t *aText, uint32_t aOffset, uint32_t aLength,
-                gfxShapedText *aShapedText);
+  void AddRange(const char16_t* aText, uint32_t aOffset, uint32_t aLength,
+                gfxShapedText* aShapedText);
 
   typedef nsBaseHashtableET
       CharGlyphMapEntryType;
diff --git a/gfx/thebes/gfxFailure.h b/gfx/thebes/gfxFailure.h
index a2eaa85bf7014..04192a5a6e13f 100644
--- a/gfx/thebes/gfxFailure.h
+++ b/gfx/thebes/gfxFailure.h
@@ -14,7 +14,7 @@
 
 namespace mozilla {
 namespace gfx {
-inline void LogFailure(const nsCString &failure) {
+inline void LogFailure(const nsCString& failure) {
   nsCOMPtr gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
   gfxInfo->LogFailure(failure);
 }
diff --git a/gfx/thebes/gfxFontInfoLoader.cpp b/gfx/thebes/gfxFontInfoLoader.cpp
index 6e1bc614a28d3..4e1532d7facf6 100644
--- a/gfx/thebes/gfxFontInfoLoader.cpp
+++ b/gfx/thebes/gfxFontInfoLoader.cpp
@@ -44,7 +44,7 @@ class FontInfoLoadCompleteEvent : public Runnable {
  public:
   NS_INLINE_DECL_REFCOUNTING_INHERITED(FontInfoLoadCompleteEvent, Runnable)
 
-  explicit FontInfoLoadCompleteEvent(FontInfoData *aFontInfo)
+  explicit FontInfoLoadCompleteEvent(FontInfoData* aFontInfo)
       : mozilla::Runnable("FontInfoLoadCompleteEvent"), mFontInfo(aFontInfo) {}
 
   NS_IMETHOD Run() override;
@@ -59,7 +59,7 @@ class AsyncFontInfoLoader : public Runnable {
  public:
   NS_INLINE_DECL_REFCOUNTING_INHERITED(AsyncFontInfoLoader, Runnable)
 
-  explicit AsyncFontInfoLoader(FontInfoData *aFontInfo)
+  explicit AsyncFontInfoLoader(FontInfoData* aFontInfo)
       : mozilla::Runnable("AsyncFontInfoLoader"), mFontInfo(aFontInfo) {
     mCompleteEvent = new FontInfoLoadCompleteEvent(aFontInfo);
   }
@@ -77,7 +77,7 @@ class ShutdownThreadEvent : public Runnable {
  public:
   NS_INLINE_DECL_REFCOUNTING_INHERITED(ShutdownThreadEvent, Runnable)
 
-  explicit ShutdownThreadEvent(nsIThread *aThread)
+  explicit ShutdownThreadEvent(nsIThread* aThread)
       : mozilla::Runnable("ShutdownThreadEvent"), mThread(aThread) {}
   NS_IMETHOD Run() override {
     mThread->Shutdown();
@@ -90,8 +90,8 @@ class ShutdownThreadEvent : public Runnable {
 
 // runs on main thread after async font info loading is done
 nsresult FontInfoLoadCompleteEvent::Run() {
-  gfxFontInfoLoader *loader =
-      static_cast(gfxPlatformFontList::PlatformFontList());
+  gfxFontInfoLoader* loader =
+      static_cast(gfxPlatformFontList::PlatformFontList());
 
   loader->FinalizeLoader(mFontInfo);
 
@@ -112,9 +112,9 @@ nsresult AsyncFontInfoLoader::Run() {
 NS_IMPL_ISUPPORTS(gfxFontInfoLoader::ShutdownObserver, nsIObserver)
 
 NS_IMETHODIMP
-gfxFontInfoLoader::ShutdownObserver::Observe(nsISupports *aSubject,
-                                             const char *aTopic,
-                                             const char16_t *someData) {
+gfxFontInfoLoader::ShutdownObserver::Observe(nsISupports* aSubject,
+                                             const char* aTopic,
+                                             const char16_t* someData) {
   if (!nsCRT::strcmp(aTopic, "quit-application")) {
     mLoader->CancelLoader();
   } else {
@@ -177,7 +177,7 @@ void gfxFontInfoLoader::StartLoader(uint32_t aDelay, uint32_t aInterval) {
   }
 }
 
-void gfxFontInfoLoader::FinalizeLoader(FontInfoData *aFontInfo) {
+void gfxFontInfoLoader::FinalizeLoader(FontInfoData* aFontInfo) {
   // Avoid loading data if loader has already been canceled.
   // This should mean that CancelLoader() ran and the Load
   // thread has already Shutdown(), and likely before processing
diff --git a/gfx/thebes/gfxGDIFont.cpp b/gfx/thebes/gfxGDIFont.cpp
index bd3803dd4caeb..4e6dd773d9b7e 100644
--- a/gfx/thebes/gfxGDIFont.cpp
+++ b/gfx/thebes/gfxGDIFont.cpp
@@ -40,7 +40,7 @@ static inline cairo_antialias_t GetCairoAntialiasOption(
   }
 }
 
-gfxGDIFont::gfxGDIFont(GDIFontEntry *aFontEntry, const gfxFontStyle *aFontStyle,
+gfxGDIFont::gfxGDIFont(GDIFontEntry* aFontEntry, const gfxFontStyle* aFontStyle,
                        AntialiasOption anAAOption)
     : gfxFont(nullptr, aFontEntry, aFontStyle, anAAOption),
       mFont(nullptr),
@@ -75,14 +75,14 @@ gfxGDIFont::~gfxGDIFont() {
 
 UniquePtr gfxGDIFont::CopyWithAntialiasOption(
     AntialiasOption anAAOption) {
-  auto entry = static_cast(mFontEntry.get());
+  auto entry = static_cast(mFontEntry.get());
   return MakeUnique(entry, &mStyle, anAAOption);
 }
 
-bool gfxGDIFont::ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
+bool gfxGDIFont::ShapeText(DrawTarget* aDrawTarget, const char16_t* aText,
                            uint32_t aOffset, uint32_t aLength, Script aScript,
                            bool aVertical, RoundingFlags aRounding,
-                           gfxShapedText *aShapedText) {
+                           gfxShapedText* aShapedText) {
   if (!mIsValid) {
     NS_WARNING("invalid font! expect incorrect text rendering");
     return false;
@@ -100,11 +100,11 @@ bool gfxGDIFont::ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
                             aVertical, aRounding, aShapedText);
 }
 
-const gfxFont::Metrics &gfxGDIFont::GetHorizontalMetrics() { return *mMetrics; }
+const gfxFont::Metrics& gfxGDIFont::GetHorizontalMetrics() { return *mMetrics; }
 
 uint32_t gfxGDIFont::GetSpaceGlyph() { return mSpaceGlyph; }
 
-bool gfxGDIFont::SetupCairoFont(DrawTarget *aDrawTarget) {
+bool gfxGDIFont::SetupCairoFont(DrawTarget* aDrawTarget) {
   if (!mScaledFont ||
       cairo_scaled_font_status(mScaledFont) != CAIRO_STATUS_SUCCESS) {
     // Don't cairo_set_scaled_font as that would propagate the error to
@@ -115,7 +115,7 @@ bool gfxGDIFont::SetupCairoFont(DrawTarget *aDrawTarget) {
   return true;
 }
 
-already_AddRefed gfxGDIFont::GetScaledFont(DrawTarget *aTarget) {
+already_AddRefed gfxGDIFont::GetScaledFont(DrawTarget* aTarget) {
   if (!mAzureScaledFont) {
     NativeFont nativeFont;
     nativeFont.mType = NativeFontType::GDI_LOGFONT;
@@ -132,11 +132,11 @@ already_AddRefed gfxGDIFont::GetScaledFont(DrawTarget *aTarget) {
   return scaledFont.forget();
 }
 
-gfxFont::RunMetrics gfxGDIFont::Measure(const gfxTextRun *aTextRun,
+gfxFont::RunMetrics gfxGDIFont::Measure(const gfxTextRun* aTextRun,
                                         uint32_t aStart, uint32_t aEnd,
                                         BoundingBoxType aBoundingBoxType,
-                                        DrawTarget *aRefDrawTarget,
-                                        Spacing *aSpacing,
+                                        DrawTarget* aRefDrawTarget,
+                                        Spacing* aSpacing,
                                         gfx::ShapedTextFlags aOrientation) {
   gfxFont::RunMetrics metrics =
       gfxFont::Measure(aTextRun, aStart, aEnd, aBoundingBoxType, aRefDrawTarget,
@@ -218,7 +218,7 @@ void gfxGDIFont::Initialize() {
   // Get font metrics if size > 0
   if (mAdjustedSize > 0.0) {
     OUTLINETEXTMETRIC oMetrics;
-    TEXTMETRIC &metrics = oMetrics.otmTextMetrics;
+    TEXTMETRIC& metrics = oMetrics.otmTextMetrics;
 
     if (0 < GetOutlineTextMetrics(dc.GetDC(), sizeof(oMetrics), &oMetrics)) {
       mMetrics->strikeoutSize = (double)oMetrics.otmsStrikeoutSize;
@@ -303,8 +303,8 @@ void gfxGDIFont::Initialize() {
                                      TRUETYPE_TAG('O', 'S', '/', '2'));
     if (os2Table) {
       uint32_t len;
-      const OS2Table *os2 =
-          reinterpret_cast(hb_blob_get_data(os2Table, &len));
+      const OS2Table* os2 =
+          reinterpret_cast(hb_blob_get_data(os2Table, &len));
       if (len >= offsetof(OS2Table, sTypoLineGap) + sizeof(int16_t)) {
         const uint16_t kUseTypoMetricsMask = 1 << 7;
         if ((uint16_t(os2->fsSelection) & kUseTypoMetricsMask)) {
@@ -376,7 +376,7 @@ void gfxGDIFont::Initialize() {
   cairo_matrix_init_identity(&ctm);
   cairo_matrix_init_scale(&sizeMatrix, mAdjustedSize, mAdjustedSize);
 
-  cairo_font_options_t *fontOptions = cairo_font_options_create();
+  cairo_font_options_t* fontOptions = cairo_font_options_create();
   if (mAntialiasOption != kAntialiasDefault) {
     cairo_font_options_set_antialias(fontOptions,
                                      GetCairoAntialiasOption(mAntialiasOption));
@@ -412,8 +412,8 @@ void gfxGDIFont::Initialize() {
 #endif
 }
 
-void gfxGDIFont::FillLogFont(LOGFONTW &aLogFont, gfxFloat aSize) {
-  GDIFontEntry *fe = static_cast(GetFontEntry());
+void gfxGDIFont::FillLogFont(LOGFONTW& aLogFont, gfxFloat aSize) {
+  GDIFontEntry* fe = static_cast(GetFontEntry());
 
   // Figure out the lfWeight value to use for GDI font selection,
   // or zero to use the entry's current LOGFONT value.
@@ -509,7 +509,7 @@ int32_t gfxGDIFont::GetGlyphWidth(uint16_t aGID) {
 }
 
 void gfxGDIFont::AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                                        FontCacheSizes *aSizes) const {
+                                        FontCacheSizes* aSizes) const {
   gfxFont::AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
   aSizes->mFontInstances += aMallocSizeOf(mMetrics);
   if (mGlyphWidths) {
@@ -519,7 +519,7 @@ void gfxGDIFont::AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
 }
 
 void gfxGDIFont::AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                                        FontCacheSizes *aSizes) const {
+                                        FontCacheSizes* aSizes) const {
   aSizes->mFontInstances += aMallocSizeOf(this);
   AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
 }
diff --git a/gfx/thebes/gfxGDIFont.h b/gfx/thebes/gfxGDIFont.h
index d8c0c206fa772..318784778ee49 100644
--- a/gfx/thebes/gfxGDIFont.h
+++ b/gfx/thebes/gfxGDIFont.h
@@ -18,28 +18,28 @@
 
 class gfxGDIFont : public gfxFont {
  public:
-  gfxGDIFont(GDIFontEntry *aFontEntry, const gfxFontStyle *aFontStyle,
+  gfxGDIFont(GDIFontEntry* aFontEntry, const gfxFontStyle* aFontStyle,
              AntialiasOption anAAOption = kAntialiasDefault);
 
   virtual ~gfxGDIFont();
 
   HFONT GetHFONT() { return mFont; }
 
-  cairo_font_face_t *CairoFontFace() { return mFontFace; }
+  cairo_font_face_t* CairoFontFace() { return mFontFace; }
 
   /* overrides for the pure virtual methods in gfxFont */
   uint32_t GetSpaceGlyph() override;
 
-  bool SetupCairoFont(DrawTarget *aDrawTarget) override;
+  bool SetupCairoFont(DrawTarget* aDrawTarget) override;
 
   already_AddRefed GetScaledFont(
-      DrawTarget *aTarget) override;
+      DrawTarget* aTarget) override;
 
   /* override Measure to add padding for antialiasing */
-  RunMetrics Measure(const gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
+  RunMetrics Measure(const gfxTextRun* aTextRun, uint32_t aStart, uint32_t aEnd,
                      BoundingBoxType aBoundingBoxType,
-                     DrawTarget *aDrawTargetForTightBoundingBox,
-                     Spacing *aSpacing,
+                     DrawTarget* aDrawTargetForTightBoundingBox,
+                     Spacing* aSpacing,
                      mozilla::gfx::ShapedTextFlags aOrientation) override;
 
   /* required for MathML to suppress effects of ClearType "padding" */
@@ -58,20 +58,20 @@ class gfxGDIFont : public gfxFont {
   int32_t GetGlyphWidth(uint16_t aGID) override;
 
   void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                              FontCacheSizes *aSizes) const;
+                              FontCacheSizes* aSizes) const;
   void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                              FontCacheSizes *aSizes) const;
+                              FontCacheSizes* aSizes) const;
 
   FontType GetType() const override { return FONT_TYPE_GDI; }
 
  protected:
-  const Metrics &GetHorizontalMetrics() override;
+  const Metrics& GetHorizontalMetrics() override;
 
   /* override to ensure the cairo font is set up properly */
-  bool ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
+  bool ShapeText(DrawTarget* aDrawTarget, const char16_t* aText,
                  uint32_t aOffset, uint32_t aLength, Script aScript,
                  bool aVertical, RoundingFlags aRounding,
-                 gfxShapedText *aShapedText) override;
+                 gfxShapedText* aShapedText) override;
 
   void Initialize();  // creates metrics and Cairo fonts
 
@@ -79,12 +79,12 @@ class gfxGDIFont : public gfxFont {
   // (Synthetic italic is *not* handled here, because GDI may not reliably
   // use the face we expect if we tweak the lfItalic field, and because we
   // have generic support for this in gfxFont::Draw instead.)
-  void FillLogFont(LOGFONTW &aLogFont, gfxFloat aSize);
+  void FillLogFont(LOGFONTW& aLogFont, gfxFloat aSize);
 
   HFONT mFont;
-  cairo_font_face_t *mFontFace;
+  cairo_font_face_t* mFontFace;
 
-  Metrics *mMetrics;
+  Metrics* mMetrics;
   uint32_t mSpaceGlyph;
 
   bool mNeedsSyntheticBold;
diff --git a/gfx/thebes/gfxGlyphExtents.cpp b/gfx/thebes/gfxGlyphExtents.cpp
index 545406a9475a7..ee627b4f73a8f 100644
--- a/gfx/thebes/gfxGlyphExtents.cpp
+++ b/gfx/thebes/gfxGlyphExtents.cpp
@@ -33,11 +33,11 @@ gfxGlyphExtents::~gfxGlyphExtents() {
   MOZ_COUNT_DTOR(gfxGlyphExtents);
 }
 
-bool gfxGlyphExtents::GetTightGlyphExtentsAppUnits(gfxFont *aFont,
-                                                   DrawTarget *aDrawTarget,
+bool gfxGlyphExtents::GetTightGlyphExtentsAppUnits(gfxFont* aFont,
+                                                   DrawTarget* aDrawTarget,
                                                    uint32_t aGlyphID,
-                                                   gfxRect *aExtents) {
-  HashEntry *entry = mTightGlyphExtents.GetEntry(aGlyphID);
+                                                   gfxRect* aExtents) {
+  HashEntry* entry = mTightGlyphExtents.GetEntry(aGlyphID);
   if (!entry) {
     // Some functions higher up in the call chain deliberately pass in a
     // nullptr DrawTarget, e.g. GetBaselinePosition() passes nullptr to
@@ -69,7 +69,7 @@ gfxGlyphExtents::GlyphWidths::~GlyphWidths() {
   for (i = 0; i < count; ++i) {
     uintptr_t bits = mBlocks[i];
     if (bits && !(bits & 0x1)) {
-      delete[] reinterpret_cast(bits);
+      delete[] reinterpret_cast(bits);
     }
   }
 }
@@ -81,7 +81,7 @@ uint32_t gfxGlyphExtents::GlyphWidths::SizeOfExcludingThis(
   for (i = 0; i < mBlocks.Length(); ++i) {
     uintptr_t bits = mBlocks[i];
     if (bits && !(bits & 0x1)) {
-      size += aMallocSizeOf(reinterpret_cast(bits));
+      size += aMallocSizeOf(reinterpret_cast(bits));
     }
   }
   return size;
@@ -91,7 +91,7 @@ void gfxGlyphExtents::GlyphWidths::Set(uint32_t aGlyphID, uint16_t aWidth) {
   uint32_t block = aGlyphID >> BLOCK_SIZE_BITS;
   uint32_t len = mBlocks.Length();
   if (block >= len) {
-    uintptr_t *elems = mBlocks.AppendElements(block + 1 - len);
+    uintptr_t* elems = mBlocks.AppendElements(block + 1 - len);
     if (!elems) return;
     memset(elems, 0, sizeof(uintptr_t) * (block + 1 - len));
   }
@@ -103,7 +103,7 @@ void gfxGlyphExtents::GlyphWidths::Set(uint32_t aGlyphID, uint16_t aWidth) {
     return;
   }
 
-  uint16_t *newBlock;
+  uint16_t* newBlock;
   if (bits & 0x1) {
     // Expand the block to a real block. We could avoid this by checking
     // glyphOffset == GetGlyphOffset(bits), but that never happens so don't
@@ -117,14 +117,14 @@ void gfxGlyphExtents::GlyphWidths::Set(uint32_t aGlyphID, uint16_t aWidth) {
     newBlock[GetGlyphOffset(bits)] = GetWidth(bits);
     mBlocks[block] = reinterpret_cast(newBlock);
   } else {
-    newBlock = reinterpret_cast(bits);
+    newBlock = reinterpret_cast(bits);
   }
   newBlock[glyphOffset] = aWidth;
 }
 
 void gfxGlyphExtents::SetTightGlyphExtents(uint32_t aGlyphID,
-                                           const gfxRect &aExtentsAppUnits) {
-  HashEntry *entry = mTightGlyphExtents.PutEntry(aGlyphID);
+                                           const gfxRect& aExtentsAppUnits) {
+  HashEntry* entry = mTightGlyphExtents.PutEntry(aGlyphID);
   if (!entry) return;
   entry->x = aExtentsAppUnits.X();
   entry->y = aExtentsAppUnits.Y();
diff --git a/gfx/thebes/gfxGraphiteShaper.cpp b/gfx/thebes/gfxGraphiteShaper.cpp
index ed7ef2c8799b4..448c33171e3c9 100644
--- a/gfx/thebes/gfxGraphiteShaper.cpp
+++ b/gfx/thebes/gfxGraphiteShaper.cpp
@@ -28,7 +28,7 @@ using namespace mozilla;  // for AutoSwap_* types
  * Creation and destruction; on deletion, release any font tables we're holding
  */
 
-gfxGraphiteShaper::gfxGraphiteShaper(gfxFont *aFont)
+gfxGraphiteShaper::gfxGraphiteShaper(gfxFont* aFont)
     : gfxFontShaper(aFont),
       mGrFace(mFont->GetFontEntry()->GetGrFace()),
       mGrFont(nullptr),
@@ -44,9 +44,9 @@ gfxGraphiteShaper::~gfxGraphiteShaper() {
 }
 
 /*static*/
-float gfxGraphiteShaper::GrGetAdvance(const void *appFontHandle,
+float gfxGraphiteShaper::GrGetAdvance(const void* appFontHandle,
                                       uint16_t glyphid) {
-  const CallbackData *cb = static_cast(appFontHandle);
+  const CallbackData* cb = static_cast(appFontHandle);
   return FixedToFloat(cb->mFont->GetGlyphWidth(glyphid));
 }
 
@@ -62,30 +62,30 @@ static inline uint32_t MakeGraphiteLangTag(uint32_t aTag) {
 }
 
 struct GrFontFeatures {
-  gr_face *mFace;
-  gr_feature_val *mFeatures;
+  gr_face* mFace;
+  gr_feature_val* mFeatures;
 };
 
-static void AddFeature(const uint32_t &aTag, uint32_t &aValue, void *aUserArg) {
-  GrFontFeatures *f = static_cast(aUserArg);
+static void AddFeature(const uint32_t& aTag, uint32_t& aValue, void* aUserArg) {
+  GrFontFeatures* f = static_cast(aUserArg);
 
-  const gr_feature_ref *fref = gr_face_find_fref(f->mFace, aTag);
+  const gr_feature_ref* fref = gr_face_find_fref(f->mFace, aTag);
   if (fref) {
     gr_fref_set_feature_value(fref, aValue, f->mFeatures);
   }
 }
 
-bool gfxGraphiteShaper::ShapeText(DrawTarget *aDrawTarget,
-                                  const char16_t *aText, uint32_t aOffset,
+bool gfxGraphiteShaper::ShapeText(DrawTarget* aDrawTarget,
+                                  const char16_t* aText, uint32_t aOffset,
                                   uint32_t aLength, Script aScript,
                                   bool aVertical, RoundingFlags aRounding,
-                                  gfxShapedText *aShapedText) {
+                                  gfxShapedText* aShapedText) {
   // some font back-ends require this in order to get proper hinted metrics
   if (!mFont->SetupCairoFont(aDrawTarget)) {
     return false;
   }
 
-  const gfxFontStyle *style = mFont->GetStyle();
+  const gfxFontStyle* style = mFont->GetStyle();
 
   if (!mGrFont) {
     if (!mGrFace) {
@@ -122,7 +122,7 @@ bool gfxGraphiteShaper::ShapeText(DrawTarget *aDrawTarget,
     }
   }
 
-  gfxFontEntry *entry = mFont->GetFontEntry();
+  gfxFontEntry* entry = mFont->GetFontEntry();
   uint32_t grLang = 0;
   if (style->languageOverride) {
     grLang = MakeGraphiteLangTag(style->languageOverride);
@@ -133,7 +133,7 @@ bool gfxGraphiteShaper::ShapeText(DrawTarget *aDrawTarget,
     style->language->ToUTF8String(langString);
     grLang = GetGraphiteTagForLang(langString);
   }
-  gr_feature_val *grFeatures = gr_face_featureval_for_lang(mGrFace, grLang);
+  gr_feature_val* grFeatures = gr_face_featureval_for_lang(mGrFace, grLang);
 
   // insert any merged features into Graphite feature list
   GrFontFeatures f = {mGrFace, grFeatures};
@@ -161,7 +161,7 @@ bool gfxGraphiteShaper::ShapeText(DrawTarget *aDrawTarget,
       gr_count_unicode_characters(gr_utf16, aText, aText + aLength, nullptr);
   gr_bidirtl grBidi = gr_bidirtl(
       aShapedText->IsRightToLeft() ? (gr_rtl | gr_nobidi) : gr_nobidi);
-  gr_segment *seg = gr_make_seg(mGrFont, mGrFace, 0, grFeatures, gr_utf16,
+  gr_segment* seg = gr_make_seg(mGrFont, mGrFace, 0, grFeatures, gr_utf16,
                                 aText, numChars, grBidi);
 
   gr_featureval_destroy(grFeatures);
@@ -191,8 +191,8 @@ struct Cluster {
 };
 
 nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
-    gfxShapedText *aShapedText, uint32_t aOffset, uint32_t aLength,
-    const char16_t *aText, gr_segment *aSegment, RoundingFlags aRounding) {
+    gfxShapedText* aShapedText, uint32_t aOffset, uint32_t aLength,
+    const char16_t* aText, gr_segment* aSegment, RoundingFlags aRounding) {
   typedef gfxShapedText::CompressedGlyph CompressedGlyph;
 
   int32_t dev2appUnits = aShapedText->GetAppUnitsPerDevUnit();
@@ -217,7 +217,7 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
   // each is associated with
   uint32_t gIndex = 0;  // glyph slot index
   uint32_t cIndex = 0;  // current cluster index
-  for (const gr_slot *slot = gr_seg_first_slot(aSegment); slot != nullptr;
+  for (const gr_slot* slot = gr_seg_first_slot(aSegment); slot != nullptr;
        slot = gr_slot_next_in_segment(slot), gIndex++) {
     uint32_t before =
         gr_cinfo_base(gr_seg_cinfo(aSegment, gr_slot_before(slot)));
@@ -240,7 +240,7 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
     if (gr_slot_can_insert_before(slot) && clusters[cIndex].nChars &&
         before >= clusters[cIndex].baseChar + clusters[cIndex].nChars) {
       NS_ASSERTION(cIndex < aLength - 1, "cIndex at end of word");
-      Cluster &c = clusters[cIndex + 1];
+      Cluster& c = clusters[cIndex + 1];
       c.baseChar = clusters[cIndex].baseChar + clusters[cIndex].nChars;
       c.nChars = before - c.baseChar;
       c.baseGlyph = gIndex;
@@ -263,14 +263,14 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
     }
   }
 
-  CompressedGlyph *charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset;
+  CompressedGlyph* charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset;
 
   bool roundX = bool(aRounding & RoundingFlags::kRoundX);
   bool roundY = bool(aRounding & RoundingFlags::kRoundY);
 
   // now put glyphs into the textrun, one cluster at a time
   for (uint32_t i = 0; i <= cIndex; ++i) {
-    const Cluster &c = clusters[i];
+    const Cluster& c = clusters[i];
 
     float adv;  // total advance of the cluster
     if (rtl) {
@@ -307,7 +307,7 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
       AutoTArray details;
       float clusterLoc;
       for (uint32_t j = c.baseGlyph; j < c.baseGlyph + c.nGlyphs; ++j) {
-        gfxShapedText::DetailedGlyph *d = details.AppendElement();
+        gfxShapedText::DetailedGlyph* d = details.AppendElement();
         d->mGlyphID = gids[j];
         d->mOffset.y = roundY ? NSToIntRound(-yLocs[j]) * dev2appUnits
                               : -yLocs[j] * dev2appUnits;
@@ -331,7 +331,7 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
 
     for (uint32_t j = c.baseChar + 1; j < c.baseChar + c.nChars; ++j) {
       NS_ASSERTION(j < aLength, "unexpected offset");
-      CompressedGlyph &g = charGlyphs[j];
+      CompressedGlyph& g = charGlyphs[j];
       NS_ASSERTION(!g.IsSimpleGlyph(), "overwriting a simple glyph");
       g.SetComplex(g.IsClusterStart(), false, 0);
     }
@@ -345,10 +345,10 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
 // for language tag validation - include list of tags from the IANA registry
 #include "gfxLanguageTagList.cpp"
 
-nsTHashtable *gfxGraphiteShaper::sLanguageTags;
+nsTHashtable* gfxGraphiteShaper::sLanguageTags;
 
 /*static*/
-uint32_t gfxGraphiteShaper::GetGraphiteTagForLang(const nsCString &aLang) {
+uint32_t gfxGraphiteShaper::GetGraphiteTagForLang(const nsCString& aLang) {
   int len = aLang.Length();
   if (len < 2) {
     return 0;
@@ -383,7 +383,7 @@ uint32_t gfxGraphiteShaper::GetGraphiteTagForLang(const nsCString &aLang) {
     // store the registered IANA tags in a hash for convenient validation
     sLanguageTags =
         new nsTHashtable(ArrayLength(sLanguageTagList));
-    for (const uint32_t *tag = sLanguageTagList; *tag != 0; ++tag) {
+    for (const uint32_t* tag = sLanguageTagList; *tag != 0; ++tag) {
       sLanguageTags->PutEntry(*tag);
     }
   }
diff --git a/gfx/thebes/gfxGraphiteShaper.h b/gfx/thebes/gfxGraphiteShaper.h
index 78cdd9a2793c8..d360bba6a8750 100644
--- a/gfx/thebes/gfxGraphiteShaper.h
+++ b/gfx/thebes/gfxGraphiteShaper.h
@@ -16,39 +16,39 @@ struct gr_segment;
 
 class gfxGraphiteShaper : public gfxFontShaper {
  public:
-  explicit gfxGraphiteShaper(gfxFont *aFont);
+  explicit gfxGraphiteShaper(gfxFont* aFont);
   virtual ~gfxGraphiteShaper();
 
-  bool ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
+  bool ShapeText(DrawTarget* aDrawTarget, const char16_t* aText,
                  uint32_t aOffset, uint32_t aLength, Script aScript,
                  bool aVertical, RoundingFlags aRounding,
-                 gfxShapedText *aShapedText) override;
+                 gfxShapedText* aShapedText) override;
 
   static void Shutdown();
 
  protected:
-  nsresult SetGlyphsFromSegment(gfxShapedText *aShapedText, uint32_t aOffset,
-                                uint32_t aLength, const char16_t *aText,
-                                gr_segment *aSegment, RoundingFlags aRounding);
+  nsresult SetGlyphsFromSegment(gfxShapedText* aShapedText, uint32_t aOffset,
+                                uint32_t aLength, const char16_t* aText,
+                                gr_segment* aSegment, RoundingFlags aRounding);
 
-  static float GrGetAdvance(const void *appFontHandle, uint16_t glyphid);
+  static float GrGetAdvance(const void* appFontHandle, uint16_t glyphid);
 
-  gr_face *mGrFace;  // owned by the font entry; shaper must call
+  gr_face* mGrFace;  // owned by the font entry; shaper must call
                      // gfxFontEntry::ReleaseGrFace when finished with it
-  gr_font *mGrFont;  // owned by the shaper itself
+  gr_font* mGrFont;  // owned by the shaper itself
 
   struct CallbackData {
     // mFont is a pointer to the font that owns this shaper, so it will
     // remain valid throughout our lifetime
-    gfxFont *MOZ_NON_OWNING_REF mFont;
+    gfxFont* MOZ_NON_OWNING_REF mFont;
   };
 
   CallbackData mCallbackData;
   bool mFallbackToSmallCaps;  // special fallback for the petite-caps case
 
   // Convert HTML 'lang' (BCP47) to Graphite language code
-  static uint32_t GetGraphiteTagForLang(const nsCString &aLang);
-  static nsTHashtable *sLanguageTags;
+  static uint32_t GetGraphiteTagForLang(const nsCString& aLang);
+  static nsTHashtable* sLanguageTags;
 };
 
 #endif /* GFX_GRAPHITESHAPER_H */
diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp
index 9e984caf71d98..b72687fe69b18 100644
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -19,7 +19,7 @@
 #include "unicode/unorm.h"
 #include "unicode/utext.h"
 
-static const UNormalizer2 *sNormalizer = nullptr;
+static const UNormalizer2* sNormalizer = nullptr;
 
 #include 
 
@@ -38,7 +38,7 @@ using namespace mozilla::unicode;  // for Unicode property lookup
  * Creation and destruction; on deletion, release any font tables we're holding
  */
 
-gfxHarfBuzzShaper::gfxHarfBuzzShaper(gfxFont *aFont)
+gfxHarfBuzzShaper::gfxHarfBuzzShaper(gfxFont* aFont)
     : gfxFontShaper(aFont),
       mHBFace(aFont->GetFontEntry()->GetHBFace()),
       mHBFont(nullptr),
@@ -96,8 +96,7 @@ hb_codepoint_t gfxHarfBuzzShaper::GetNominalGlyph(
                  "cmap data not correctly set up, expect disaster");
 
     uint32_t length;
-    const uint8_t *data =
-        (const uint8_t *)hb_blob_get_data(mCmapTable, &length);
+    const uint8_t* data = (const uint8_t*)hb_blob_get_data(mCmapTable, &length);
 
     switch (mCmapFormat) {
       case 4:
@@ -144,7 +143,7 @@ hb_codepoint_t gfxHarfBuzzShaper::GetVariationGlyph(
                "cmap data not correctly set up, expect disaster");
 
   uint32_t length;
-  const uint8_t *data = (const uint8_t *)hb_blob_get_data(mCmapTable, &length);
+  const uint8_t* data = (const uint8_t*)hb_blob_get_data(mCmapTable, &length);
 
   if (mUVSTableOffset) {
     hb_codepoint_t gid = gfxFontUtils::MapUVSToGlyphFormat14(
@@ -178,8 +177,8 @@ hb_codepoint_t gfxHarfBuzzShaper::GetVariationGlyph(
   return 0;
 }
 
-static int VertFormsGlyphCompare(const void *aKey, const void *aElem) {
-  return int(*((hb_codepoint_t *)(aKey))) - int(*((uint16_t *)(aElem)));
+static int VertFormsGlyphCompare(const void* aKey, const void* aElem) {
+  return int(*((hb_codepoint_t*)(aKey))) - int(*((uint16_t*)(aElem)));
 }
 
 // Return a vertical presentation-form codepoint corresponding to the
@@ -221,17 +220,17 @@ hb_codepoint_t gfxHarfBuzzShaper::GetVerticalPresentationForm(
       {0xff5b, 0xfe37},  // FULLWIDTH LEFT CURLY BRACKET
       {0xff5d, 0xfe38}   // FULLWIDTH RIGHT CURLY BRACKET
   };
-  const uint16_t *charPair = static_cast(
+  const uint16_t* charPair = static_cast(
       bsearch(&aUnicode, sVerticalForms, ArrayLength(sVerticalForms),
               sizeof(sVerticalForms[0]), VertFormsGlyphCompare));
   return charPair ? charPair[1] : 0;
 }
 
-static hb_bool_t HBGetNominalGlyph(hb_font_t *font, void *font_data,
+static hb_bool_t HBGetNominalGlyph(hb_font_t* font, void* font_data,
                                    hb_codepoint_t unicode,
-                                   hb_codepoint_t *glyph, void *user_data) {
-  const gfxHarfBuzzShaper::FontCallbackData *fcd =
-      static_cast(font_data);
+                                   hb_codepoint_t* glyph, void* user_data) {
+  const gfxHarfBuzzShaper::FontCallbackData* fcd =
+      static_cast(font_data);
 
   if (fcd->mShaper->UseVerticalPresentationForms()) {
     hb_codepoint_t verticalForm =
@@ -249,12 +248,12 @@ static hb_bool_t HBGetNominalGlyph(hb_font_t *font, void *font_data,
   return *glyph != 0;
 }
 
-static hb_bool_t HBGetVariationGlyph(hb_font_t *font, void *font_data,
+static hb_bool_t HBGetVariationGlyph(hb_font_t* font, void* font_data,
                                      hb_codepoint_t unicode,
                                      hb_codepoint_t variation_selector,
-                                     hb_codepoint_t *glyph, void *user_data) {
-  const gfxHarfBuzzShaper::FontCallbackData *fcd =
-      static_cast(font_data);
+                                     hb_codepoint_t* glyph, void* user_data) {
+  const gfxHarfBuzzShaper::FontCallbackData* fcd =
+      static_cast(font_data);
 
   if (fcd->mShaper->UseVerticalPresentationForms()) {
     hb_codepoint_t verticalForm =
@@ -300,7 +299,7 @@ hb_position_t gfxHarfBuzzShaper::GetGlyphHAdvance(hb_codepoint_t glyph) const {
   // glyph must be valid now, because we checked during initialization
   // that mNumLongHMetrics is > 0, and that the metrics table is large enough
   // to contain mNumLongHMetrics records
-  const ::GlyphMetrics *metrics = reinterpret_cast(
+  const ::GlyphMetrics* metrics = reinterpret_cast(
       hb_blob_get_data(mHmtxTable, nullptr));
   return FloatToFixed(mFont->FUnitsToDevUnitsFactor() *
                       uint16_t(metrics->metrics[glyph].advanceWidth));
@@ -324,20 +323,20 @@ hb_position_t gfxHarfBuzzShaper::GetGlyphVAdvance(hb_codepoint_t glyph) const {
   // glyph must be valid now, because we checked during initialization
   // that mNumLongVMetrics is > 0, and that the metrics table is large enough
   // to contain mNumLongVMetrics records
-  const ::GlyphMetrics *metrics = reinterpret_cast(
+  const ::GlyphMetrics* metrics = reinterpret_cast(
       hb_blob_get_data(mVmtxTable, nullptr));
   return FloatToFixed(mFont->FUnitsToDevUnitsFactor() *
                       uint16_t(metrics->metrics[glyph].advanceWidth));
 }
 
 /* static */
-hb_position_t gfxHarfBuzzShaper::HBGetGlyphHAdvance(hb_font_t *font,
-                                                    void *font_data,
+hb_position_t gfxHarfBuzzShaper::HBGetGlyphHAdvance(hb_font_t* font,
+                                                    void* font_data,
                                                     hb_codepoint_t glyph,
-                                                    void *user_data) {
-  const gfxHarfBuzzShaper::FontCallbackData *fcd =
-      static_cast(font_data);
-  const gfxHarfBuzzShaper *shaper = fcd->mShaper;
+                                                    void* user_data) {
+  const gfxHarfBuzzShaper::FontCallbackData* fcd =
+      static_cast(font_data);
+  const gfxHarfBuzzShaper* shaper = fcd->mShaper;
   if (shaper->mUseFontGlyphWidths) {
     return shaper->GetFont()->GetGlyphWidth(glyph);
   }
@@ -345,12 +344,12 @@ hb_position_t gfxHarfBuzzShaper::HBGetGlyphHAdvance(hb_font_t *font,
 }
 
 /* static */
-hb_position_t gfxHarfBuzzShaper::HBGetGlyphVAdvance(hb_font_t *font,
-                                                    void *font_data,
+hb_position_t gfxHarfBuzzShaper::HBGetGlyphVAdvance(hb_font_t* font,
+                                                    void* font_data,
                                                     hb_codepoint_t glyph,
-                                                    void *user_data) {
-  const gfxHarfBuzzShaper::FontCallbackData *fcd =
-      static_cast(font_data);
+                                                    void* user_data) {
+  const gfxHarfBuzzShaper::FontCallbackData* fcd =
+      static_cast(font_data);
   // Currently, we don't offer gfxFont subclasses a method to override this
   // and provide hinted platform-specific vertical advances (analogous to the
   // GetGlyphWidth method for horizontal advances). If that proves necessary,
@@ -375,34 +374,34 @@ struct VORGrec {
 };
 
 /* static */
-hb_bool_t gfxHarfBuzzShaper::HBGetGlyphVOrigin(hb_font_t *font, void *font_data,
+hb_bool_t gfxHarfBuzzShaper::HBGetGlyphVOrigin(hb_font_t* font, void* font_data,
                                                hb_codepoint_t glyph,
-                                               hb_position_t *x,
-                                               hb_position_t *y,
-                                               void *user_data) {
-  const gfxHarfBuzzShaper::FontCallbackData *fcd =
-      static_cast(font_data);
+                                               hb_position_t* x,
+                                               hb_position_t* y,
+                                               void* user_data) {
+  const gfxHarfBuzzShaper::FontCallbackData* fcd =
+      static_cast(font_data);
   fcd->mShaper->GetGlyphVOrigin(glyph, x, y);
   return true;
 }
 
 void gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph,
-                                        hb_position_t *aX,
-                                        hb_position_t *aY) const {
+                                        hb_position_t* aX,
+                                        hb_position_t* aY) const {
   *aX = 0.5 * (mUseFontGlyphWidths ? mFont->GetGlyphWidth(aGlyph)
                                    : GetGlyphHAdvance(aGlyph));
 
   if (mVORGTable) {
     // We checked in Initialize() that the VORG table is safely readable,
     // so no length/bounds-check needed here.
-    const VORG *vorg =
-        reinterpret_cast(hb_blob_get_data(mVORGTable, nullptr));
+    const VORG* vorg =
+        reinterpret_cast(hb_blob_get_data(mVORGTable, nullptr));
 
-    const VORGrec *lo = reinterpret_cast(vorg + 1);
-    const VORGrec *hi = lo + uint16_t(vorg->numVertOriginYMetrics);
-    const VORGrec *limit = hi;
+    const VORGrec* lo = reinterpret_cast(vorg + 1);
+    const VORGrec* hi = lo + uint16_t(vorg->numVertOriginYMetrics);
+    const VORGrec* limit = hi;
     while (lo < hi) {
-      const VORGrec *mid = lo + (hi - lo) / 2;
+      const VORGrec* mid = lo + (hi - lo) / 2;
       if (uint16_t(mid->glyphIndex) < aGlyph) {
         lo = mid + 1;
       } else {
@@ -422,14 +421,14 @@ void gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph,
 
   if (mVmtxTable) {
     bool emptyGlyf;
-    const Glyf *glyf = FindGlyf(aGlyph, &emptyGlyf);
+    const Glyf* glyf = FindGlyf(aGlyph, &emptyGlyf);
     if (glyf) {
       if (emptyGlyf) {
         *aY = 0;
         return;
       }
 
-      const ::GlyphMetrics *metrics = reinterpret_cast(
+      const ::GlyphMetrics* metrics = reinterpret_cast(
           hb_blob_get_data(mVmtxTable, nullptr));
       int16_t lsb;
       if (aGlyph < hb_codepoint_t(mNumLongVMetrics)) {
@@ -437,8 +436,8 @@ void gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph,
         lsb = int16_t(metrics->metrics[aGlyph].lsb);
       } else {
         // Glyph is covered by the second (sidebearing-only) array
-        const AutoSwap_PRInt16 *sidebearings =
-            reinterpret_cast(
+        const AutoSwap_PRInt16* sidebearings =
+            reinterpret_cast(
                 &metrics->metrics[mNumLongVMetrics]);
         lsb = int16_t(sidebearings[aGlyph - mNumLongVMetrics]);
       }
@@ -459,7 +458,7 @@ void gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph,
                                       TRUETYPE_TAG('h', 'h', 'e', 'a'));
     if (hheaTable) {
       uint32_t len;
-      const MetricsHeader *hhea = reinterpret_cast(
+      const MetricsHeader* hhea = reinterpret_cast(
           hb_blob_get_data(hheaTable, &len));
       if (len >= sizeof(MetricsHeader)) {
         // divide up the default advance we're using (1em) in proportion
@@ -473,7 +472,7 @@ void gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph,
     if (mDefaultVOrg < 0.0) {
       // Last resort, for non-sfnt fonts: get the horizontal metrics and
       // compute a default VOrg from their ascent and descent.
-      const gfxFont::Metrics &mtx = mFont->GetHorizontalMetrics();
+      const gfxFont::Metrics& mtx = mFont->GetHorizontalMetrics();
       gfxFloat advance =
           mFont->GetMetrics(nsFontMetrics::eVertical).aveCharWidth;
       gfxFloat ascent = mtx.emAscent;
@@ -489,12 +488,12 @@ void gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph,
   *aY = mDefaultVOrg;
 }
 
-static hb_bool_t HBGetGlyphExtents(hb_font_t *font, void *font_data,
+static hb_bool_t HBGetGlyphExtents(hb_font_t* font, void* font_data,
                                    hb_codepoint_t glyph,
-                                   hb_glyph_extents_t *extents,
-                                   void *user_data) {
-  const gfxHarfBuzzShaper::FontCallbackData *fcd =
-      static_cast(font_data);
+                                   hb_glyph_extents_t* extents,
+                                   void* user_data) {
+  const gfxHarfBuzzShaper::FontCallbackData* fcd =
+      static_cast(font_data);
   return fcd->mShaper->GetGlyphExtents(glyph, extents);
 }
 
@@ -502,19 +501,19 @@ static hb_bool_t HBGetGlyphExtents(hb_font_t *font, void *font_data,
 // Returns null if not found, otherwise pointer to the beginning of the
 // glyph's data. Sets aEmptyGlyf true if there is no actual data;
 // otherwise, it's guaranteed that we can read at least the bounding box.
-const gfxHarfBuzzShaper::Glyf *gfxHarfBuzzShaper::FindGlyf(
-    hb_codepoint_t aGlyph, bool *aEmptyGlyf) const {
+const gfxHarfBuzzShaper::Glyf* gfxHarfBuzzShaper::FindGlyf(
+    hb_codepoint_t aGlyph, bool* aEmptyGlyf) const {
   if (!mLoadedLocaGlyf) {
     mLoadedLocaGlyf = true;  // only try this once; if it fails, this
                              // isn't a truetype font
-    gfxFontEntry *entry = mFont->GetFontEntry();
+    gfxFontEntry* entry = mFont->GetFontEntry();
     uint32_t len;
     gfxFontEntry::AutoTable headTable(entry, TRUETYPE_TAG('h', 'e', 'a', 'd'));
     if (!headTable) {
       return nullptr;
     }
-    const HeadTable *head =
-        reinterpret_cast(hb_blob_get_data(headTable, &len));
+    const HeadTable* head =
+        reinterpret_cast(hb_blob_get_data(headTable, &len));
     if (len < sizeof(HeadTable)) {
       return nullptr;
     }
@@ -530,21 +529,21 @@ const gfxHarfBuzzShaper::Glyf *gfxHarfBuzzShaper::FindGlyf(
 
   uint32_t offset;  // offset of glyph record in the 'glyf' table
   uint32_t len;
-  const char *data = hb_blob_get_data(mLocaTable, &len);
+  const char* data = hb_blob_get_data(mLocaTable, &len);
   if (mLocaLongOffsets) {
     if ((aGlyph + 1) * sizeof(AutoSwap_PRUint32) > len) {
       return nullptr;
     }
-    const AutoSwap_PRUint32 *offsets =
-        reinterpret_cast(data);
+    const AutoSwap_PRUint32* offsets =
+        reinterpret_cast(data);
     offset = offsets[aGlyph];
     *aEmptyGlyf = (offset == uint16_t(offsets[aGlyph + 1]));
   } else {
     if ((aGlyph + 1) * sizeof(AutoSwap_PRUint16) > len) {
       return nullptr;
     }
-    const AutoSwap_PRUint16 *offsets =
-        reinterpret_cast(data);
+    const AutoSwap_PRUint16* offsets =
+        reinterpret_cast(data);
     offset = uint16_t(offsets[aGlyph]);
     *aEmptyGlyf = (offset == uint16_t(offsets[aGlyph + 1]));
     offset *= 2;
@@ -555,13 +554,13 @@ const gfxHarfBuzzShaper::Glyf *gfxHarfBuzzShaper::FindGlyf(
     return nullptr;
   }
 
-  return reinterpret_cast(data + offset);
+  return reinterpret_cast(data + offset);
 }
 
 hb_bool_t gfxHarfBuzzShaper::GetGlyphExtents(
-    hb_codepoint_t aGlyph, hb_glyph_extents_t *aExtents) const {
+    hb_codepoint_t aGlyph, hb_glyph_extents_t* aExtents) const {
   bool emptyGlyf;
-  const Glyf *glyf = FindGlyf(aGlyph, &emptyGlyf);
+  const Glyf* glyf = FindGlyf(aGlyph, &emptyGlyf);
   if (!glyf) {
     // TODO: for non-truetype fonts, get extents some other way?
     return false;
@@ -590,10 +589,10 @@ hb_bool_t gfxHarfBuzzShaper::GetGlyphExtents(
   return true;
 }
 
-static hb_bool_t HBGetContourPoint(hb_font_t *font, void *font_data,
+static hb_bool_t HBGetContourPoint(hb_font_t* font, void* font_data,
                                    unsigned int point_index,
-                                   hb_codepoint_t glyph, hb_position_t *x,
-                                   hb_position_t *y, void *user_data) {
+                                   hb_codepoint_t glyph, hb_position_t* x,
+                                   hb_position_t* y, void* user_data) {
   /* not yet implemented - no support for used of hinted contour points
      to fine-tune anchor positions in GPOS AnchorFormat2 */
   return false;
@@ -620,19 +619,19 @@ struct KernPair {
 // If the pair  is found, the kerning value is
 // added to aValue, so that multiple subtables can accumulate a total
 // kerning value for a given pair.
-static void GetKernValueFmt0(const void *aSubtable, uint32_t aSubtableLen,
+static void GetKernValueFmt0(const void* aSubtable, uint32_t aSubtableLen,
                              uint16_t aFirstGlyph, uint16_t aSecondGlyph,
-                             int32_t &aValue, bool aIsOverride = false,
+                             int32_t& aValue, bool aIsOverride = false,
                              bool aIsMinimum = false) {
-  const KernHeaderFmt0 *hdr =
-      reinterpret_cast(aSubtable);
+  const KernHeaderFmt0* hdr =
+      reinterpret_cast(aSubtable);
 
-  const KernPair *lo = reinterpret_cast(hdr + 1);
-  const KernPair *hi = lo + uint16_t(hdr->nPairs);
-  const KernPair *limit = hi;
+  const KernPair* lo = reinterpret_cast(hdr + 1);
+  const KernPair* hi = lo + uint16_t(hdr->nPairs);
+  const KernPair* limit = hi;
 
-  if (reinterpret_cast(aSubtable) + aSubtableLen <
-      reinterpret_cast(hi)) {
+  if (reinterpret_cast(aSubtable) + aSubtableLen <
+      reinterpret_cast(hi)) {
     // subtable is not large enough to contain the claimed number
     // of kern pairs, so just ignore it
     return;
@@ -642,7 +641,7 @@ static void GetKernValueFmt0(const void *aSubtable, uint32_t aSubtableLen,
 
   uint32_t key = KERN_PAIR_KEY(aFirstGlyph, aSecondGlyph);
   while (lo < hi) {
-    const KernPair *mid = lo + (hi - lo) / 2;
+    const KernPair* mid = lo + (hi - lo) / 2;
     if (KERN_PAIR_KEY(mid->left, mid->right) < key) {
       lo = mid + 1;
     } else {
@@ -681,7 +680,7 @@ struct KernClassTableHdr {
   AutoSwap_PRUint16 offsets[1];  // actually an array of nGlyphs entries
 };
 
-static int16_t GetKernValueVersion1Fmt2(const void *aSubtable,
+static int16_t GetKernValueVersion1Fmt2(const void* aSubtable,
                                         uint32_t aSubtableLen,
                                         uint16_t aFirstGlyph,
                                         uint16_t aSecondGlyph) {
@@ -689,17 +688,17 @@ static int16_t GetKernValueVersion1Fmt2(const void *aSubtable,
     return 0;
   }
 
-  const char *base = reinterpret_cast(aSubtable);
-  const char *subtableEnd = base + aSubtableLen;
+  const char* base = reinterpret_cast(aSubtable);
+  const char* subtableEnd = base + aSubtableLen;
 
-  const KernHeaderVersion1Fmt2 *h =
-      reinterpret_cast(aSubtable);
+  const KernHeaderVersion1Fmt2* h =
+      reinterpret_cast(aSubtable);
   uint32_t offset = h->array;
 
-  const KernClassTableHdr *leftClassTable =
-      reinterpret_cast(base +
-                                                  uint16_t(h->leftOffsetTable));
-  if (reinterpret_cast(leftClassTable) +
+  const KernClassTableHdr* leftClassTable =
+      reinterpret_cast(base +
+                                                 uint16_t(h->leftOffsetTable));
+  if (reinterpret_cast(leftClassTable) +
           sizeof(KernClassTableHdr) >
       subtableEnd) {
     return 0;
@@ -707,7 +706,7 @@ static int16_t GetKernValueVersion1Fmt2(const void *aSubtable,
   if (aFirstGlyph >= uint16_t(leftClassTable->firstGlyph)) {
     aFirstGlyph -= uint16_t(leftClassTable->firstGlyph);
     if (aFirstGlyph < uint16_t(leftClassTable->nGlyphs)) {
-      if (reinterpret_cast(leftClassTable) +
+      if (reinterpret_cast(leftClassTable) +
               sizeof(KernClassTableHdr) + aFirstGlyph * sizeof(uint16_t) >=
           subtableEnd) {
         return 0;
@@ -716,10 +715,10 @@ static int16_t GetKernValueVersion1Fmt2(const void *aSubtable,
     }
   }
 
-  const KernClassTableHdr *rightClassTable =
-      reinterpret_cast(
-          base + uint16_t(h->rightOffsetTable));
-  if (reinterpret_cast(rightClassTable) +
+  const KernClassTableHdr* rightClassTable =
+      reinterpret_cast(base +
+                                                 uint16_t(h->rightOffsetTable));
+  if (reinterpret_cast(rightClassTable) +
           sizeof(KernClassTableHdr) >
       subtableEnd) {
     return 0;
@@ -727,7 +726,7 @@ static int16_t GetKernValueVersion1Fmt2(const void *aSubtable,
   if (aSecondGlyph >= uint16_t(rightClassTable->firstGlyph)) {
     aSecondGlyph -= uint16_t(rightClassTable->firstGlyph);
     if (aSecondGlyph < uint16_t(rightClassTable->nGlyphs)) {
-      if (reinterpret_cast(rightClassTable) +
+      if (reinterpret_cast(rightClassTable) +
               sizeof(KernClassTableHdr) + aSecondGlyph * sizeof(uint16_t) >=
           subtableEnd) {
         return 0;
@@ -736,9 +735,9 @@ static int16_t GetKernValueVersion1Fmt2(const void *aSubtable,
     }
   }
 
-  const AutoSwap_PRInt16 *pval =
-      reinterpret_cast(base + offset);
-  if (reinterpret_cast(pval + 1) >= subtableEnd) {
+  const AutoSwap_PRInt16* pval =
+      reinterpret_cast(base + offset);
+  if (reinterpret_cast(pval + 1) >= subtableEnd) {
     return 0;
   }
   return *pval;
@@ -759,7 +758,7 @@ struct KernHeaderVersion1Fmt3 {
   uint8_t flags;
 };
 
-static int16_t GetKernValueVersion1Fmt3(const void *aSubtable,
+static int16_t GetKernValueVersion1Fmt3(const void* aSubtable,
                                         uint32_t aSubtableLen,
                                         uint16_t aFirstGlyph,
                                         uint16_t aSecondGlyph) {
@@ -768,8 +767,8 @@ static int16_t GetKernValueVersion1Fmt3(const void *aSubtable,
     return 0;
   }
 
-  const KernHeaderVersion1Fmt3 *hdr =
-      reinterpret_cast(aSubtable);
+  const KernHeaderVersion1Fmt3* hdr =
+      reinterpret_cast(aSubtable);
   if (hdr->flags != 0) {
     return 0;
   }
@@ -789,12 +788,12 @@ static int16_t GetKernValueVersion1Fmt3(const void *aSubtable,
   }
 
   // get pointers to the four arrays within the subtable
-  const AutoSwap_PRInt16 *kernValue =
-      reinterpret_cast(hdr + 1);
-  const uint8_t *leftClass =
-      reinterpret_cast(kernValue + hdr->kernValueCount);
-  const uint8_t *rightClass = leftClass + glyphCount;
-  const uint8_t *kernIndex = rightClass + glyphCount;
+  const AutoSwap_PRInt16* kernValue =
+      reinterpret_cast(hdr + 1);
+  const uint8_t* leftClass =
+      reinterpret_cast(kernValue + hdr->kernValueCount);
+  const uint8_t* rightClass = leftClass + glyphCount;
+  const uint8_t* kernIndex = rightClass + glyphCount;
 
   uint8_t lc = leftClass[aFirstGlyph];
   uint8_t rc = rightClass[aSecondGlyph];
@@ -841,7 +840,7 @@ hb_position_t gfxHarfBuzzShaper::GetHKerning(uint16_t aFirstGlyph,
   }
 
   uint32_t len;
-  const char *base = hb_blob_get_data(mKernTable, &len);
+  const char* base = hb_blob_get_data(mKernTable, &len);
   if (len < sizeof(KernTableVersion0)) {
     return 0;
   }
@@ -849,8 +848,8 @@ hb_position_t gfxHarfBuzzShaper::GetHKerning(uint16_t aFirstGlyph,
 
   // First try to interpret as "version 0" kern table
   // (see http://www.microsoft.com/typography/otspec/kern.htm)
-  const KernTableVersion0 *kern0 =
-      reinterpret_cast(base);
+  const KernTableVersion0* kern0 =
+      reinterpret_cast(base);
   if (uint16_t(kern0->version) == 0) {
     uint16_t nTables = kern0->nTables;
     uint32_t offs = sizeof(KernTableVersion0);
@@ -858,9 +857,8 @@ hb_position_t gfxHarfBuzzShaper::GetHKerning(uint16_t aFirstGlyph,
       if (offs + sizeof(KernTableSubtableHeaderVersion0) > len) {
         break;
       }
-      const KernTableSubtableHeaderVersion0 *st0 =
-          reinterpret_cast(base +
-                                                                    offs);
+      const KernTableSubtableHeaderVersion0* st0 =
+          reinterpret_cast(base + offs);
       uint16_t subtableLen = uint16_t(st0->length);
       if (offs + subtableLen > len) {
         break;
@@ -904,8 +902,8 @@ hb_position_t gfxHarfBuzzShaper::GetHKerning(uint16_t aFirstGlyph,
   } else {
     // It wasn't a "version 0" table; check if it is Apple version 1.0
     // (see http://developer.apple.com/fonts/TTRefMan/RM06/Chap6kern.html)
-    const KernTableVersion1 *kern1 =
-        reinterpret_cast(base);
+    const KernTableVersion1* kern1 =
+        reinterpret_cast(base);
     if (uint32_t(kern1->version) == 0x00010000) {
       uint32_t nTables = kern1->nTables;
       uint32_t offs = sizeof(KernTableVersion1);
@@ -913,9 +911,9 @@ hb_position_t gfxHarfBuzzShaper::GetHKerning(uint16_t aFirstGlyph,
         if (offs + sizeof(KernTableSubtableHeaderVersion1) > len) {
           break;
         }
-        const KernTableSubtableHeaderVersion1 *st1 =
-            reinterpret_cast(base +
-                                                                      offs);
+        const KernTableSubtableHeaderVersion1* st1 =
+            reinterpret_cast(base +
+                                                                     offs);
         uint32_t subtableLen = uint32_t(st1->length);
         offs += subtableLen;
         uint16_t coverage = st1->coverage;
@@ -969,12 +967,12 @@ hb_position_t gfxHarfBuzzShaper::GetHKerning(uint16_t aFirstGlyph,
   return 0;
 }
 
-static hb_position_t HBGetHKerning(hb_font_t *font, void *font_data,
+static hb_position_t HBGetHKerning(hb_font_t* font, void* font_data,
                                    hb_codepoint_t first_glyph,
                                    hb_codepoint_t second_glyph,
-                                   void *user_data) {
-  const gfxHarfBuzzShaper::FontCallbackData *fcd =
-      static_cast(font_data);
+                                   void* user_data) {
+  const gfxHarfBuzzShaper::FontCallbackData* fcd =
+      static_cast(font_data);
   return fcd->mShaper->GetHKerning(first_glyph, second_glyph);
 }
 
@@ -982,23 +980,23 @@ static hb_position_t HBGetHKerning(hb_font_t *font, void *font_data,
  * HarfBuzz unicode property callbacks
  */
 
-static hb_codepoint_t HBGetMirroring(hb_unicode_funcs_t *ufuncs,
-                                     hb_codepoint_t aCh, void *user_data) {
+static hb_codepoint_t HBGetMirroring(hb_unicode_funcs_t* ufuncs,
+                                     hb_codepoint_t aCh, void* user_data) {
   return GetMirroredChar(aCh);
 }
 
 static hb_unicode_general_category_t HBGetGeneralCategory(
-    hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh, void *user_data) {
+    hb_unicode_funcs_t* ufuncs, hb_codepoint_t aCh, void* user_data) {
   return hb_unicode_general_category_t(GetGeneralCategory(aCh));
 }
 
-static hb_script_t HBGetScript(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh,
-                               void *user_data) {
+static hb_script_t HBGetScript(hb_unicode_funcs_t* ufuncs, hb_codepoint_t aCh,
+                               void* user_data) {
   return hb_script_t(GetScriptTagForCode(GetScriptCode(aCh)));
 }
 
 static hb_unicode_combining_class_t HBGetCombiningClass(
-    hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh, void *user_data) {
+    hb_unicode_funcs_t* ufuncs, hb_codepoint_t aCh, void* user_data) {
   return hb_unicode_combining_class_t(GetCombiningClass(aCh));
 }
 
@@ -1034,9 +1032,9 @@ static const char16_t sDageshForms[0x05EA - 0x05D0 + 1] = {
     0xFB4A   // TAV
 };
 
-static hb_bool_t HBUnicodeCompose(hb_unicode_funcs_t *ufuncs, hb_codepoint_t a,
-                                  hb_codepoint_t b, hb_codepoint_t *ab,
-                                  void *user_data) {
+static hb_bool_t HBUnicodeCompose(hb_unicode_funcs_t* ufuncs, hb_codepoint_t a,
+                                  hb_codepoint_t b, hb_codepoint_t* ab,
+                                  void* user_data) {
   if (sNormalizer) {
     UChar32 ch = unorm2_composePair(sNormalizer, a, b);
     if (ch >= 0) {
@@ -1048,9 +1046,9 @@ static hb_bool_t HBUnicodeCompose(hb_unicode_funcs_t *ufuncs, hb_codepoint_t a,
   return false;
 }
 
-static hb_bool_t HBUnicodeDecompose(hb_unicode_funcs_t *ufuncs,
-                                    hb_codepoint_t ab, hb_codepoint_t *a,
-                                    hb_codepoint_t *b, void *user_data) {
+static hb_bool_t HBUnicodeDecompose(hb_unicode_funcs_t* ufuncs,
+                                    hb_codepoint_t ab, hb_codepoint_t* a,
+                                    hb_codepoint_t* b, void* user_data) {
 #ifdef MOZ_WIDGET_ANDROID
   // Hack for the SamsungDevanagari font, bug 1012365:
   // support U+0972 by decomposing it.
@@ -1094,10 +1092,10 @@ static hb_bool_t HBUnicodeDecompose(hb_unicode_funcs_t *ufuncs,
   return *b != 0 || *a != ab;
 }
 
-static void AddOpenTypeFeature(const uint32_t &aTag, uint32_t &aValue,
-                               void *aUserArg) {
-  nsTArray *features =
-      static_cast *>(aUserArg);
+static void AddOpenTypeFeature(const uint32_t& aTag, uint32_t& aValue,
+                               void* aUserArg) {
+  nsTArray* features =
+      static_cast*>(aUserArg);
 
   hb_feature_t feat = {0, 0, 0, UINT_MAX};
   feat.tag = aTag;
@@ -1109,8 +1107,8 @@ static void AddOpenTypeFeature(const uint32_t &aTag, uint32_t &aValue,
  * gfxFontShaper override to initialize the text run using HarfBuzz
  */
 
-static hb_font_funcs_t *sHBFontFuncs = nullptr;
-static hb_unicode_funcs_t *sHBUnicodeFuncs = nullptr;
+static hb_font_funcs_t* sHBFontFuncs = nullptr;
+static hb_unicode_funcs_t* sHBUnicodeFuncs = nullptr;
 static const hb_script_t sMathScript =
     hb_ot_tag_to_script(HB_TAG('m', 'a', 't', 'h'));
 
@@ -1161,7 +1159,7 @@ bool gfxHarfBuzzShaper::Initialize() {
     MOZ_ASSERT(U_SUCCESS(error), "failed to get ICU normalizer");
   }
 
-  gfxFontEntry *entry = mFont->GetFontEntry();
+  gfxFontEntry* entry = mFont->GetFontEntry();
   if (!mUseFontGetGlyph) {
     // get the cmap table and find offset to our subtable
     mCmapTable = entry->GetFontTable(TRUETYPE_TAG('c', 'm', 'a', 'p'));
@@ -1170,7 +1168,7 @@ bool gfxHarfBuzzShaper::Initialize() {
       return false;
     }
     uint32_t len;
-    const uint8_t *data = (const uint8_t *)hb_blob_get_data(mCmapTable, &len);
+    const uint8_t* data = (const uint8_t*)hb_blob_get_data(mCmapTable, &len);
     mCmapFormat = gfxFontUtils::FindPreferredSubtable(
         data, len, &mSubtableOffset, &mUVSTableOffset);
     if (mCmapFormat <= 0) {
@@ -1201,12 +1199,12 @@ bool gfxHarfBuzzShaper::Initialize() {
   uint32_t scale = FloatToFixed(mFont->GetAdjustedSize());  // 16.16 fixed-point
   hb_font_set_scale(mHBFont, scale, scale);
 
-  const auto &vars = mFont->GetStyle()->variationSettings;
+  const auto& vars = mFont->GetStyle()->variationSettings;
   size_t len = vars.Length();
   if (len > 0) {
     // Fortunately, the hb_variation_t struct is compatible with our
     // gfxFontFeature, so we can simply cast here.
-    auto hbVars = reinterpret_cast(vars.Elements());
+    auto hbVars = reinterpret_cast(vars.Elements());
     hb_font_set_variations(mHBFont, hbVars, len);
   }
 
@@ -1216,11 +1214,11 @@ bool gfxHarfBuzzShaper::Initialize() {
 bool gfxHarfBuzzShaper::LoadHmtxTable() {
   // Read mNumLongHMetrics from metrics-head table without caching its
   // blob, and preload/cache the metrics table.
-  gfxFontEntry *entry = mFont->GetFontEntry();
+  gfxFontEntry* entry = mFont->GetFontEntry();
   gfxFontEntry::AutoTable hheaTable(entry, TRUETYPE_TAG('h', 'h', 'e', 'a'));
   if (hheaTable) {
     uint32_t len;
-    const MetricsHeader *hhea = reinterpret_cast(
+    const MetricsHeader* hhea = reinterpret_cast(
         hb_blob_get_data(hheaTable, &len));
     if (len >= sizeof(MetricsHeader)) {
       mNumLongHMetrics = hhea->numOfLongMetrics;
@@ -1262,11 +1260,11 @@ void gfxHarfBuzzShaper::InitializeVertical() {
 
   // Load vertical metrics if present in the font; if not, we'll synthesize
   // vertical glyph advances based on (horizontal) ascent/descent metrics.
-  gfxFontEntry *entry = mFont->GetFontEntry();
+  gfxFontEntry* entry = mFont->GetFontEntry();
   gfxFontEntry::AutoTable vheaTable(entry, TRUETYPE_TAG('v', 'h', 'e', 'a'));
   if (vheaTable) {
     uint32_t len;
-    const MetricsHeader *vhea = reinterpret_cast(
+    const MetricsHeader* vhea = reinterpret_cast(
         hb_blob_get_data(vheaTable, &len));
     if (len >= sizeof(MetricsHeader)) {
       mNumLongVMetrics = vhea->numOfLongMetrics;
@@ -1275,7 +1273,7 @@ void gfxHarfBuzzShaper::InitializeVertical() {
       int numGlyphs = -1;  // invalid if we fail to read 'maxp'
       if (maxpTable &&
           hb_blob_get_length(maxpTable) >= sizeof(MaxpTableHeader)) {
-        const MaxpTableHeader *maxp = reinterpret_cast(
+        const MaxpTableHeader* maxp = reinterpret_cast(
             hb_blob_get_data(maxpTable, nullptr));
         numGlyphs = uint16_t(maxp->numGlyphs);
       }
@@ -1300,8 +1298,8 @@ void gfxHarfBuzzShaper::InitializeVertical() {
     mVORGTable = entry->GetFontTable(TRUETYPE_TAG('V', 'O', 'R', 'G'));
     if (mVORGTable) {
       uint32_t len;
-      const VORG *vorg =
-          reinterpret_cast(hb_blob_get_data(mVORGTable, &len));
+      const VORG* vorg =
+          reinterpret_cast(hb_blob_get_data(mVORGTable, &len));
       if (len < sizeof(VORG) || uint16_t(vorg->majorVersion) != 1 ||
           uint16_t(vorg->minorVersion) != 0 ||
           len < sizeof(VORG) +
@@ -1316,11 +1314,11 @@ void gfxHarfBuzzShaper::InitializeVertical() {
   }
 }
 
-bool gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget,
-                                  const char16_t *aText, uint32_t aOffset,
+bool gfxHarfBuzzShaper::ShapeText(DrawTarget* aDrawTarget,
+                                  const char16_t* aText, uint32_t aOffset,
                                   uint32_t aLength, Script aScript,
                                   bool aVertical, RoundingFlags aRounding,
-                                  gfxShapedText *aShapedText) {
+                                  gfxShapedText* aShapedText) {
   // some font back-ends require this in order to get proper hinted metrics
   if (!mFont->SetupCairoFont(aDrawTarget)) {
     return false;
@@ -1340,7 +1338,7 @@ bool gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget,
     }
   }
 
-  const gfxFontStyle *style = mFont->GetStyle();
+  const gfxFontStyle* style = mFont->GetStyle();
 
   // determine whether petite-caps falls back to small-caps
   bool addSmallCaps = false;
@@ -1357,7 +1355,7 @@ bool gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget,
     }
   }
 
-  gfxFontEntry *entry = mFont->GetFontEntry();
+  gfxFontEntry* entry = mFont->GetFontEntry();
 
   // insert any merged features into hb_feature array
   AutoTArray features;
@@ -1394,8 +1392,8 @@ bool gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget,
   hb_buffer_set_language(mBuffer, language);
 
   uint32_t length = aLength;
-  hb_buffer_add_utf16(mBuffer, reinterpret_cast(aText),
-                      length, 0, length);
+  hb_buffer_add_utf16(mBuffer, reinterpret_cast(aText), length,
+                      0, length);
 
   hb_shape(mHBFont, mBuffer, features.Elements(), features.Length());
 
@@ -1418,15 +1416,15 @@ bool gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget,
        // will fit without requiring separate allocation
        // for charToGlyphArray
 
-nsresult gfxHarfBuzzShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
+nsresult gfxHarfBuzzShaper::SetGlyphsFromRun(gfxShapedText* aShapedText,
                                              uint32_t aOffset, uint32_t aLength,
-                                             const char16_t *aText,
+                                             const char16_t* aText,
                                              bool aVertical,
                                              RoundingFlags aRounding) {
   typedef gfxShapedText::CompressedGlyph CompressedGlyph;
 
   uint32_t numGlyphs;
-  const hb_glyph_info_t *ginfo = hb_buffer_get_glyph_infos(mBuffer, &numGlyphs);
+  const hb_glyph_info_t* ginfo = hb_buffer_get_glyph_infos(mBuffer, &numGlyphs);
   if (numGlyphs == 0) {
     return NS_OK;
   }
@@ -1440,7 +1438,7 @@ nsresult gfxHarfBuzzShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  int32_t *charToGlyph = charToGlyphArray.Elements();
+  int32_t* charToGlyph = charToGlyphArray.Elements();
   for (uint32_t offset = 0; offset < wordLength; ++offset) {
     charToGlyph[offset] = NO_GLYPH;
   }
@@ -1465,7 +1463,7 @@ nsresult gfxHarfBuzzShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
   }
 
   int32_t appUnitsPerDevUnit = aShapedText->GetAppUnitsPerDevUnit();
-  CompressedGlyph *charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset;
+  CompressedGlyph* charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset;
 
   // factor to convert 16.16 fixed-point pixels to app units
   // (only used if not rounding)
@@ -1486,7 +1484,7 @@ nsresult gfxHarfBuzzShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
   // keep track of y-position to set glyph offsets if needed
   nscoord bPos = 0;
 
-  const hb_glyph_position_t *posInfo =
+  const hb_glyph_position_t* posInfo =
       hb_buffer_get_glyph_positions(mBuffer, nullptr);
 
   while (glyphStart < int32_t(numGlyphs)) {
@@ -1624,7 +1622,7 @@ nsresult gfxHarfBuzzShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
       // its advance, hence the placement of the loop-exit test and the
       // measurement of the next glyph.
       while (1) {
-        gfxTextRun::DetailedGlyph *details = detailedGlyphs.AppendElement();
+        gfxTextRun::DetailedGlyph* details = detailedGlyphs.AppendElement();
         details->mGlyphID = ginfo[glyphStart].codepoint;
 
         details->mAdvance = advance;
@@ -1691,7 +1689,7 @@ nsresult gfxHarfBuzzShaper::SetGlyphsFromRun(gfxShapedText *aShapedText,
     // no associated glyphs
     while (++baseCharIndex != endCharIndex &&
            baseCharIndex < int32_t(wordLength)) {
-      CompressedGlyph &g = charGlyphs[baseCharIndex];
+      CompressedGlyph& g = charGlyphs[baseCharIndex];
       NS_ASSERTION(!g.IsSimpleGlyph(), "overwriting a simple glyph");
       g.SetComplex(g.IsClusterStart(), false, 0);
     }
diff --git a/gfx/thebes/gfxHarfBuzzShaper.h b/gfx/thebes/gfxHarfBuzzShaper.h
index dae8bd83b7193..898e9c7e01523 100644
--- a/gfx/thebes/gfxHarfBuzzShaper.h
+++ b/gfx/thebes/gfxHarfBuzzShaper.h
@@ -14,7 +14,7 @@
 
 class gfxHarfBuzzShaper : public gfxFontShaper {
  public:
-  explicit gfxHarfBuzzShaper(gfxFont *aFont);
+  explicit gfxHarfBuzzShaper(gfxFont* aFont);
   virtual ~gfxHarfBuzzShaper();
 
   /*
@@ -22,18 +22,18 @@ class gfxHarfBuzzShaper : public gfxFontShaper {
    * FontCallbackData struct
    */
   struct FontCallbackData {
-    gfxHarfBuzzShaper *mShaper;
+    gfxHarfBuzzShaper* mShaper;
   };
 
   bool Initialize();
 
-  bool ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
+  bool ShapeText(DrawTarget* aDrawTarget, const char16_t* aText,
                  uint32_t aOffset, uint32_t aLength, Script aScript,
                  bool aVertical, RoundingFlags aRounding,
-                 gfxShapedText *aShapedText) override;
+                 gfxShapedText* aShapedText) override;
 
   // get a given font table in harfbuzz blob form
-  hb_blob_t *GetFontTable(hb_tag_t aTag) const;
+  hb_blob_t* GetFontTable(hb_tag_t aTag) const;
 
   // map unicode character to glyph ID
   hb_codepoint_t GetNominalGlyph(hb_codepoint_t unicode) const;
@@ -45,27 +45,27 @@ class gfxHarfBuzzShaper : public gfxFontShaper {
 
   hb_position_t GetGlyphVAdvance(hb_codepoint_t glyph) const;
 
-  void GetGlyphVOrigin(hb_codepoint_t aGlyph, hb_position_t *aX,
-                       hb_position_t *aY) const;
+  void GetGlyphVOrigin(hb_codepoint_t aGlyph, hb_position_t* aX,
+                       hb_position_t* aY) const;
 
   // get harfbuzz horizontal advance in 16.16 fixed point format.
-  static hb_position_t HBGetGlyphHAdvance(hb_font_t *font, void *font_data,
+  static hb_position_t HBGetGlyphHAdvance(hb_font_t* font, void* font_data,
                                           hb_codepoint_t glyph,
-                                          void *user_data);
+                                          void* user_data);
 
   // get harfbuzz vertical advance in 16.16 fixed point format.
-  static hb_position_t HBGetGlyphVAdvance(hb_font_t *font, void *font_data,
+  static hb_position_t HBGetGlyphVAdvance(hb_font_t* font, void* font_data,
                                           hb_codepoint_t glyph,
-                                          void *user_data);
+                                          void* user_data);
 
-  static hb_bool_t HBGetGlyphVOrigin(hb_font_t *font, void *font_data,
-                                     hb_codepoint_t glyph, hb_position_t *x,
-                                     hb_position_t *y, void *user_data);
+  static hb_bool_t HBGetGlyphVOrigin(hb_font_t* font, void* font_data,
+                                     hb_codepoint_t glyph, hb_position_t* x,
+                                     hb_position_t* y, void* user_data);
 
   hb_position_t GetHKerning(uint16_t aFirstGlyph, uint16_t aSecondGlyph) const;
 
   hb_bool_t GetGlyphExtents(hb_codepoint_t aGlyph,
-                            hb_glyph_extents_t *aExtents) const;
+                            hb_glyph_extents_t* aExtents) const;
 
   bool UseVerticalPresentationForms() const {
     return mUseVerticalPresentationForms;
@@ -87,13 +87,13 @@ class gfxHarfBuzzShaper : public gfxFontShaper {
   static hb_codepoint_t GetVerticalPresentationForm(hb_codepoint_t aUnicode);
 
  protected:
-  nsresult SetGlyphsFromRun(gfxShapedText *aShapedText, uint32_t aOffset,
-                            uint32_t aLength, const char16_t *aText,
+  nsresult SetGlyphsFromRun(gfxShapedText* aShapedText, uint32_t aOffset,
+                            uint32_t aLength, const char16_t* aText,
                             bool aVertical, RoundingFlags aRounding);
 
   // retrieve glyph positions, applying advance adjustments and attachments
   // returns results in appUnits
-  nscoord GetGlyphPositions(gfxContext *aContext, nsTArray &aPositions,
+  nscoord GetGlyphPositions(gfxContext* aContext, nsTArray& aPositions,
                             uint32_t aAppUnitsPerDevUnit);
 
   void InitializeVertical();
@@ -108,17 +108,17 @@ class gfxHarfBuzzShaper : public gfxFontShaper {
     mozilla::AutoSwap_PRInt16 yMax;
   };
 
-  const Glyf *FindGlyf(hb_codepoint_t aGlyph, bool *aEmptyGlyf) const;
+  const Glyf* FindGlyf(hb_codepoint_t aGlyph, bool* aEmptyGlyf) const;
 
   // harfbuzz face object: we acquire a reference from the font entry
   // on shaper creation, and release it in our destructor
-  hb_face_t *mHBFace;
+  hb_face_t* mHBFace;
 
   // size-specific font object, owned by the gfxHarfBuzzShaper
-  hb_font_t *mHBFont;
+  hb_font_t* mHBFont;
 
   // harfbuzz buffer for the shaping process
-  hb_buffer_t *mBuffer;
+  hb_buffer_t* mBuffer;
 
   FontCallbackData mCallbackData;
 
@@ -128,23 +128,23 @@ class gfxHarfBuzzShaper : public gfxFontShaper {
   // in the font.
 
   // Old-style TrueType kern table, if we're not doing GPOS kerning
-  mutable hb_blob_t *mKernTable;
+  mutable hb_blob_t* mKernTable;
 
   // Cached copy of the hmtx table.
-  mutable hb_blob_t *mHmtxTable;
+  mutable hb_blob_t* mHmtxTable;
 
   // For vertical fonts, cached vmtx and VORG table, if present.
-  mutable hb_blob_t *mVmtxTable;
-  mutable hb_blob_t *mVORGTable;
+  mutable hb_blob_t* mVmtxTable;
+  mutable hb_blob_t* mVORGTable;
   // And for vertical TrueType (not CFF) fonts that have vmtx,
   // we also use loca and glyf to get glyph bounding boxes.
-  mutable hb_blob_t *mLocaTable;
-  mutable hb_blob_t *mGlyfTable;
+  mutable hb_blob_t* mLocaTable;
+  mutable hb_blob_t* mGlyfTable;
 
   // Cached pointer to cmap subtable to be used for char-to-glyph mapping.
   // This comes from GetFontTablePtr; if it is non-null, our destructor
   // must call ReleaseFontTablePtr to avoid permanently caching the table.
-  mutable hb_blob_t *mCmapTable;
+  mutable hb_blob_t* mCmapTable;
   mutable int32_t mCmapFormat;
   mutable uint32_t mSubtableOffset;
   mutable uint32_t mUVSTableOffset;
diff --git a/gfx/thebes/gfxMacFont.cpp b/gfx/thebes/gfxMacFont.cpp
index 4e48ade511ac5..61eeaebe48125 100644
--- a/gfx/thebes/gfxMacFont.cpp
+++ b/gfx/thebes/gfxMacFont.cpp
@@ -26,14 +26,14 @@ using namespace mozilla::gfx;
 
 template 
 struct TagEquals {
-  bool Equals(const T &aIter, uint32_t aTag) const {
+  bool Equals(const T& aIter, uint32_t aTag) const {
     return aIter.mTag == aTag;
   }
 };
 
-gfxMacFont::gfxMacFont(const RefPtr &aUnscaledFont,
-                       MacOSFontEntry *aFontEntry,
-                       const gfxFontStyle *aFontStyle)
+gfxMacFont::gfxMacFont(const RefPtr& aUnscaledFont,
+                       MacOSFontEntry* aFontEntry,
+                       const gfxFontStyle* aFontStyle)
     : gfxFont(aUnscaledFont, aFontEntry, aFontStyle),
       mCGFont(nullptr),
       mCTFont(nullptr),
@@ -71,7 +71,7 @@ gfxMacFont::gfxMacFont(const RefPtr &aUnscaledFont,
       if (index == axes.NoIndex) {
         aFontEntry->mHasOpszAxis = false;
       } else {
-        const auto &axis = axes[index];
+        const auto& axis = axes[index];
         aFontEntry->mHasOpszAxis = true;
         aFontEntry->mOpszAxis = axis;
         // Pick a slightly-adjusted version of the default that we'll
@@ -93,8 +93,8 @@ gfxMacFont::gfxMacFont(const RefPtr &aUnscaledFont,
         vars.AppendElement(opsz);
       } else {
         // Figure out a "safe" value that Core Text won't ignore.
-        auto &value = vars[index].mValue;
-        auto &axis = aFontEntry->mOpszAxis;
+        auto& value = vars[index].mValue;
+        auto& axis = aFontEntry->mOpszAxis;
         value = fmin(fmax(value, axis.mMinValue), axis.mMaxValue);
         if (std::abs(value - axis.mDefaultValue) < kOpszFudgeAmount) {
           value = aFontEntry->mAdjustedDefaultOpsz;
@@ -141,7 +141,7 @@ gfxMacFont::gfxMacFont(const RefPtr &aUnscaledFont,
   cairo_matrix_init_identity(&ctm);
   cairo_matrix_init_scale(&sizeMatrix, mAdjustedSize, mAdjustedSize);
 
-  cairo_font_options_t *fontOptions = cairo_font_options_create();
+  cairo_font_options_t* fontOptions = cairo_font_options_create();
 
   // turn off font anti-aliasing based on user pref setting
   if ((mAdjustedSize <=
@@ -187,10 +187,10 @@ gfxMacFont::~gfxMacFont() {
   }
 }
 
-bool gfxMacFont::ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
+bool gfxMacFont::ShapeText(DrawTarget* aDrawTarget, const char16_t* aText,
                            uint32_t aOffset, uint32_t aLength, Script aScript,
                            bool aVertical, RoundingFlags aRounding,
-                           gfxShapedText *aShapedText) {
+                           gfxShapedText* aShapedText) {
   if (!mIsValid) {
     NS_WARNING("invalid font! expect incorrect text rendering");
     return false;
@@ -198,7 +198,7 @@ bool gfxMacFont::ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
 
   // Currently, we don't support vertical shaping via CoreText,
   // so we ignore RequiresAATLayout if vertical is requested.
-  auto macFontEntry = static_cast(GetFontEntry());
+  auto macFontEntry = static_cast(GetFontEntry());
   if (macFontEntry->RequiresAATLayout() && !aVertical) {
     if (!mCoreTextShaper) {
       mCoreTextShaper = MakeUnique(this);
@@ -232,7 +232,7 @@ bool gfxMacFont::ShapeText(DrawTarget *aDrawTarget, const char16_t *aText,
                             aVertical, aRounding, aShapedText);
 }
 
-bool gfxMacFont::SetupCairoFont(DrawTarget *aDrawTarget) {
+bool gfxMacFont::SetupCairoFont(DrawTarget* aDrawTarget) {
   if (cairo_scaled_font_status(mScaledFont) != CAIRO_STATUS_SUCCESS) {
     // Don't cairo_set_scaled_font as that would propagate the error to
     // the cairo_t, precluding any further drawing.
@@ -242,11 +242,11 @@ bool gfxMacFont::SetupCairoFont(DrawTarget *aDrawTarget) {
   return true;
 }
 
-gfxFont::RunMetrics gfxMacFont::Measure(const gfxTextRun *aTextRun,
+gfxFont::RunMetrics gfxMacFont::Measure(const gfxTextRun* aTextRun,
                                         uint32_t aStart, uint32_t aEnd,
                                         BoundingBoxType aBoundingBoxType,
-                                        DrawTarget *aRefDrawTarget,
-                                        Spacing *aSpacing,
+                                        DrawTarget* aRefDrawTarget,
+                                        Spacing* aSpacing,
                                         gfx::ShapedTextFlags aOrientation) {
   gfxFont::RunMetrics metrics =
       gfxFont::Measure(aTextRun, aStart, aEnd, aBoundingBoxType, aRefDrawTarget,
@@ -279,8 +279,8 @@ void gfxMacFont::InitMetrics() {
       ::CGFontCopyTableForTag(mCGFont, TRUETYPE_TAG('h', 'e', 'a', 'd'));
   if (headData) {
     if (size_t(::CFDataGetLength(headData)) >= sizeof(HeadTable)) {
-      const HeadTable *head =
-          reinterpret_cast(::CFDataGetBytePtr(headData));
+      const HeadTable* head =
+          reinterpret_cast(::CFDataGetBytePtr(headData));
       upem = head->unitsPerEm;
     }
     ::CFRelease(headData);
@@ -308,7 +308,7 @@ void gfxMacFont::InitMetrics() {
   // use CG's idea of unitsPerEm, which may differ from the "true" value in
   // the head table of the font (see bug 580863)
   gfxFloat cgConvFactor;
-  if (static_cast(mFontEntry.get())->IsCFF()) {
+  if (static_cast(mFontEntry.get())->IsCFF()) {
     cgConvFactor = mAdjustedSize / ::CGFontGetUnitsPerEm(mCGFont);
   } else {
     cgConvFactor = mFUnitsConvFactor;
@@ -337,7 +337,7 @@ void gfxMacFont::InitMetrics() {
     gfxFloat aspect = mMetrics.xHeight / mStyle.size;
     mAdjustedSize = mStyle.GetAdjustedSize(aspect);
     mFUnitsConvFactor = mAdjustedSize / upem;
-    if (static_cast(mFontEntry.get())->IsCFF()) {
+    if (static_cast(mFontEntry.get())->IsCFF()) {
       cgConvFactor = mAdjustedSize / ::CGFontGetUnitsPerEm(mCGFont);
     } else {
       cgConvFactor = mFUnitsConvFactor;
@@ -415,7 +415,7 @@ void gfxMacFont::InitMetrics() {
 }
 
 gfxFloat gfxMacFont::GetCharWidth(CFDataRef aCmap, char16_t aUniChar,
-                                  uint32_t *aGlyphID, gfxFloat aConvFactor) {
+                                  uint32_t* aGlyphID, gfxFloat aConvFactor) {
   CGGlyph glyph = 0;
 
   if (aCmap) {
@@ -472,8 +472,8 @@ CTFontRef gfxMacFont::CreateCTFontFromCGFontWithVariations(
     CFDictionaryRef variations = ::CGFontCopyVariations(aCGFont);
     if (variations) {
       CFDictionaryRef varAttr = ::CFDictionaryCreate(
-          nullptr, (const void **)&kCTFontVariationAttribute,
-          (const void **)&variations, 1, &kCFTypeDictionaryKeyCallBacks,
+          nullptr, (const void**)&kCTFontVariationAttribute,
+          (const void**)&variations, 1, &kCFTypeDictionaryKeyCallBacks,
           &kCFTypeDictionaryValueCallBacks);
       ::CFRelease(variations);
 
@@ -566,7 +566,7 @@ void gfxMacFont::InitMetricsFromPlatform() {
   mIsValid = true;
 }
 
-already_AddRefed gfxMacFont::GetScaledFont(DrawTarget *aTarget) {
+already_AddRefed gfxMacFont::GetScaledFont(DrawTarget* aTarget) {
   if (!mAzureScaledFont) {
     mAzureScaledFont = Factory::CreateScaledFontForMacFont(
         GetCGFontRef(), GetUnscaledFont(), GetAdjustedSize(),
@@ -584,14 +584,14 @@ already_AddRefed gfxMacFont::GetScaledFont(DrawTarget *aTarget) {
 }
 
 void gfxMacFont::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
-                                        FontCacheSizes *aSizes) const {
+                                        FontCacheSizes* aSizes) const {
   gfxFont::AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
   // mCGFont is shared with the font entry, so not counted here;
   // and we don't have APIs to measure the cairo mFontFace object
 }
 
 void gfxMacFont::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
-                                        FontCacheSizes *aSizes) const {
+                                        FontCacheSizes* aSizes) const {
   aSizes->mFontInstances += aMallocSizeOf(this);
   AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
 }
diff --git a/gfx/thebes/gfxMacFont.h b/gfx/thebes/gfxMacFont.h
index 684ec1d9bd269..e44613501b7b0 100644
--- a/gfx/thebes/gfxMacFont.h
+++ b/gfx/thebes/gfxMacFont.h
@@ -17,8 +17,8 @@ class MacOSFontEntry;
 
 class gfxMacFont : public gfxFont {
  public:
-  gfxMacFont(const RefPtr &aUnscaledFont, MacOSFontEntry *aFontEntry,
-             const gfxFontStyle *aFontStyle);
+  gfxMacFont(const RefPtr& aUnscaledFont, MacOSFontEntry* aFontEntry,
+             const gfxFontStyle* aFontStyle);
 
   virtual ~gfxMacFont();
 
@@ -27,12 +27,12 @@ class gfxMacFont : public gfxFont {
   /* overrides for the pure virtual methods in gfxFont */
   uint32_t GetSpaceGlyph() override { return mSpaceGlyph; }
 
-  bool SetupCairoFont(DrawTarget *aDrawTarget) override;
+  bool SetupCairoFont(DrawTarget* aDrawTarget) override;
 
   /* override Measure to add padding for antialiasing */
-  RunMetrics Measure(const gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
-                     BoundingBoxType aBoundingBoxType, DrawTarget *aDrawTargetForTightBoundingBox,
-                     Spacing *aSpacing, mozilla::gfx::ShapedTextFlags aOrientation) override;
+  RunMetrics Measure(const gfxTextRun* aTextRun, uint32_t aStart, uint32_t aEnd,
+                     BoundingBoxType aBoundingBoxType, DrawTarget* aDrawTargetForTightBoundingBox,
+                     Spacing* aSpacing, mozilla::gfx::ShapedTextFlags aOrientation) override;
 
   // We need to provide hinted (non-linear) glyph widths if using a font
   // with embedded color bitmaps (Apple Color Emoji), as Core Text renders
@@ -44,12 +44,12 @@ class gfxMacFont : public gfxFont {
   int32_t GetGlyphWidth(uint16_t aGID) override;
 
   already_AddRefed GetScaledFont(
-      mozilla::gfx::DrawTarget *aTarget) override;
+      mozilla::gfx::DrawTarget* aTarget) override;
 
   void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                              FontCacheSizes *aSizes) const override;
+                              FontCacheSizes* aSizes) const override;
   void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
-                              FontCacheSizes *aSizes) const override;
+                              FontCacheSizes* aSizes) const override;
 
   FontType GetType() const override { return FONT_TYPE_MAC; }
 
@@ -61,19 +61,19 @@ class gfxMacFont : public gfxFont {
                                                         CTFontDescriptorRef aFontDesc = nullptr);
 
  protected:
-  const Metrics &GetHorizontalMetrics() override { return mMetrics; }
+  const Metrics& GetHorizontalMetrics() override { return mMetrics; }
 
   // override to prefer CoreText shaping with fonts that depend on AAT
-  bool ShapeText(DrawTarget *aDrawTarget, const char16_t *aText, uint32_t aOffset, uint32_t aLength,
+  bool ShapeText(DrawTarget* aDrawTarget, const char16_t* aText, uint32_t aOffset, uint32_t aLength,
                  Script aScript, bool aVertical, RoundingFlags aRounding,
-                 gfxShapedText *aShapedText) override;
+                 gfxShapedText* aShapedText) override;
 
   void InitMetrics();
   void InitMetricsFromPlatform();
 
   // Get width and glyph ID for a character; uses aConvFactor
   // to convert font units as returned by CG to actual dimensions
-  gfxFloat GetCharWidth(CFDataRef aCmap, char16_t aUniChar, uint32_t *aGlyphID,
+  gfxFloat GetCharWidth(CFDataRef aCmap, char16_t aUniChar, uint32_t* aGlyphID,
                         gfxFloat aConvFactor);
 
   // a strong reference to the CoreGraphics font
@@ -83,7 +83,7 @@ class gfxMacFont : public gfxFont {
   // glyph widths; otherwise null.
   CTFontRef mCTFont;
 
-  cairo_font_face_t *mFontFace;
+  cairo_font_face_t* mFontFace;
 
   mozilla::UniquePtr mCoreTextShaper;
 
diff --git a/gfx/thebes/gfxMathTable.cpp b/gfx/thebes/gfxMathTable.cpp
index c462e773d1acd..6a27efff21d93 100644
--- a/gfx/thebes/gfxMathTable.cpp
+++ b/gfx/thebes/gfxMathTable.cpp
@@ -12,7 +12,7 @@
 
 using namespace mozilla;
 
-gfxMathTable::gfxMathTable(hb_face_t *aFace, gfxFloat aSize) {
+gfxMathTable::gfxMathTable(hb_face_t* aFace, gfxFloat aSize) {
   mMathVariantCache.vertical = false;
   mHBFont = hb_font_create(aFace);
   if (mHBFont) {
diff --git a/gfx/thebes/gfxMathTable.h b/gfx/thebes/gfxMathTable.h
index 666fdfe5bf2a7..bb7595c36d9f0 100644
--- a/gfx/thebes/gfxMathTable.h
+++ b/gfx/thebes/gfxMathTable.h
@@ -17,7 +17,7 @@ class gfxMathTable {
    * @param aFace The HarfBuzz face containing the math table.
    * @param aSize The font size to pass to HarfBuzz.
    */
-  gfxMathTable(hb_face_t *aFace, gfxFloat aSize);
+  gfxMathTable(hb_face_t* aFace, gfxFloat aSize);
 
   /**
    * Releases our reference to the MATH table and cleans up everything else.
@@ -134,7 +134,7 @@ class gfxMathTable {
 
  private:
   // size-specific font object, owned by the gfxMathTable
-  hb_font_t *mHBFont;
+  hb_font_t* mHBFont;
 
   static const unsigned int kMaxCachedSizeCount = 10;
   struct MathVariantCacheEntry {
diff --git a/gfx/thebes/gfxPattern.h b/gfx/thebes/gfxPattern.h
index 5472c739070c6..68fde97917087 100644
--- a/gfx/thebes/gfxPattern.h
+++ b/gfx/thebes/gfxPattern.h
@@ -21,23 +21,23 @@ class gfxPattern final {
   NS_INLINE_DECL_REFCOUNTING(gfxPattern)
 
  public:
-  explicit gfxPattern(const mozilla::gfx::Color &aColor);
+  explicit gfxPattern(const mozilla::gfx::Color& aColor);
   // linear
   gfxPattern(gfxFloat x0, gfxFloat y0, gfxFloat x1, gfxFloat y1);  // linear
   gfxPattern(gfxFloat cx0, gfxFloat cy0, gfxFloat radius0, gfxFloat cx1,
              gfxFloat cy1, gfxFloat radius1);  // radial
-  gfxPattern(mozilla::gfx::SourceSurface *aSurface,
-             const mozilla::gfx::Matrix &aPatternToUserSpace);
+  gfxPattern(mozilla::gfx::SourceSurface* aSurface,
+             const mozilla::gfx::Matrix& aPatternToUserSpace);
 
-  void AddColorStop(gfxFloat offset, const mozilla::gfx::Color &c);
-  void SetColorStops(mozilla::gfx::GradientStops *aStops);
+  void AddColorStop(gfxFloat offset, const mozilla::gfx::Color& c);
+  void SetColorStops(mozilla::gfx::GradientStops* aStops);
 
   // This should only be called on a cairo pattern that we want to use with
   // Azure. We will read back the color stops from cairo and try to look
   // them up in the cache.
-  void CacheColorStops(const mozilla::gfx::DrawTarget *aDT);
+  void CacheColorStops(const mozilla::gfx::DrawTarget* aDT);
 
-  void SetMatrix(const gfxMatrix &matrix);
+  void SetMatrix(const gfxMatrix& matrix);
   gfxMatrix GetMatrix() const;
   gfxMatrix GetInverseMatrix() const;
 
@@ -46,9 +46,9 @@ class gfxPattern final {
    * was set. When this is nullptr it is assumed the transform is identical
    * to the current transform.
    */
-  mozilla::gfx::Pattern *GetPattern(
-      const mozilla::gfx::DrawTarget *aTarget,
-      const mozilla::gfx::Matrix *aOriginalUserToDevice = nullptr);
+  mozilla::gfx::Pattern* GetPattern(
+      const mozilla::gfx::DrawTarget* aTarget,
+      const mozilla::gfx::Matrix* aOriginalUserToDevice = nullptr);
   bool IsOpaque();
 
   // clamp, repeat, reflect
@@ -58,7 +58,7 @@ class gfxPattern final {
   mozilla::gfx::SamplingFilter SamplingFilter() const;
 
   /* returns TRUE if it succeeded */
-  bool GetSolidColor(mozilla::gfx::Color &aColorOut);
+  bool GetSolidColor(mozilla::gfx::Color& aColorOut);
 
  private:
   // Private destructor, to discourage deletion outside of Release():
diff --git a/gfx/thebes/gfxQuartzSurface.cpp b/gfx/thebes/gfxQuartzSurface.cpp
index 4b48f4c1903d0..ff5711569f0b5 100644
--- a/gfx/thebes/gfxQuartzSurface.cpp
+++ b/gfx/thebes/gfxQuartzSurface.cpp
@@ -13,7 +13,7 @@
 
 void gfxQuartzSurface::MakeInvalid() { mSize = mozilla::gfx::IntSize(-1, -1); }
 
-gfxQuartzSurface::gfxQuartzSurface(const mozilla::gfx::IntSize &desiredSize,
+gfxQuartzSurface::gfxQuartzSurface(const mozilla::gfx::IntSize& desiredSize,
                                    gfxImageFormat format)
     : mCGContext(nullptr), mSize(desiredSize) {
   if (!mozilla::gfx::Factory::CheckSurfaceSize(desiredSize)) MakeInvalid();
@@ -22,7 +22,7 @@ gfxQuartzSurface::gfxQuartzSurface(const mozilla::gfx::IntSize &desiredSize,
   unsigned int height = static_cast(mSize.height);
 
   cairo_format_t cformat = GfxFormatToCairoFormat(format);
-  cairo_surface_t *surf = cairo_quartz_surface_create(cformat, width, height);
+  cairo_surface_t* surf = cairo_quartz_surface_create(cformat, width, height);
 
   mCGContext = cairo_quartz_surface_get_cg_context(surf);
 
@@ -35,14 +35,14 @@ gfxQuartzSurface::gfxQuartzSurface(const mozilla::gfx::IntSize &desiredSize,
 }
 
 gfxQuartzSurface::gfxQuartzSurface(CGContextRef context,
-                                   const mozilla::gfx::IntSize &size)
+                                   const mozilla::gfx::IntSize& size)
     : mCGContext(context), mSize(size) {
   if (!mozilla::gfx::Factory::CheckSurfaceSize(size)) MakeInvalid();
 
   unsigned int width = static_cast(mSize.width);
   unsigned int height = static_cast(mSize.height);
 
-  cairo_surface_t *surf =
+  cairo_surface_t* surf =
       cairo_quartz_surface_create_for_cg_context(context, width, height);
 
   CGContextRetain(mCGContext);
@@ -53,8 +53,8 @@ gfxQuartzSurface::gfxQuartzSurface(CGContextRef context,
   }
 }
 
-gfxQuartzSurface::gfxQuartzSurface(cairo_surface_t *csurf,
-                                   const mozilla::gfx::IntSize &aSize)
+gfxQuartzSurface::gfxQuartzSurface(cairo_surface_t* csurf,
+                                   const mozilla::gfx::IntSize& aSize)
     : mSize(aSize) {
   mCGContext = cairo_quartz_surface_get_cg_context(csurf);
   CGContextRetain(mCGContext);
@@ -62,14 +62,14 @@ gfxQuartzSurface::gfxQuartzSurface(cairo_surface_t *csurf,
   Init(csurf, true);
 }
 
-gfxQuartzSurface::gfxQuartzSurface(unsigned char *data,
-                                   const mozilla::gfx::IntSize &aSize,
+gfxQuartzSurface::gfxQuartzSurface(unsigned char* data,
+                                   const mozilla::gfx::IntSize& aSize,
                                    long stride, gfxImageFormat format)
     : mCGContext(nullptr), mSize(aSize.width, aSize.height) {
   if (!mozilla::gfx::Factory::CheckSurfaceSize(aSize)) MakeInvalid();
 
   cairo_format_t cformat = GfxFormatToCairoFormat(format);
-  cairo_surface_t *surf = cairo_quartz_surface_create_for_data(
+  cairo_surface_t* surf = cairo_quartz_surface_create_for_data(
       data, cformat, aSize.width, aSize.height, stride);
 
   mCGContext = cairo_quartz_surface_get_cg_context(surf);
@@ -83,8 +83,8 @@ gfxQuartzSurface::gfxQuartzSurface(unsigned char *data,
 }
 
 already_AddRefed gfxQuartzSurface::CreateSimilarSurface(
-    gfxContentType aType, const mozilla::gfx::IntSize &aSize) {
-  cairo_surface_t *surface = cairo_quartz_surface_create_cg_layer(
+    gfxContentType aType, const mozilla::gfx::IntSize& aSize) {
+  cairo_surface_t* surface = cairo_quartz_surface_create_cg_layer(
       mSurface, (cairo_content_t)aType, aSize.width, aSize.height);
   if (cairo_surface_status(surface)) {
     cairo_surface_destroy(surface);
@@ -97,7 +97,7 @@ already_AddRefed gfxQuartzSurface::CreateSimilarSurface(
 }
 
 already_AddRefed gfxQuartzSurface::GetAsImageSurface() {
-  cairo_surface_t *surface = cairo_quartz_surface_get_image(mSurface);
+  cairo_surface_t* surface = cairo_quartz_surface_get_image(mSurface);
   if (!surface || cairo_surface_status(surface)) return nullptr;
 
   RefPtr img = Wrap(surface);
diff --git a/gfx/thebes/gfxSVGGlyphs.cpp b/gfx/thebes/gfxSVGGlyphs.cpp
index 256cafb22daed..d2d1c3e14914f 100644
--- a/gfx/thebes/gfxSVGGlyphs.cpp
+++ b/gfx/thebes/gfxSVGGlyphs.cpp
@@ -43,17 +43,17 @@ using mozilla::dom::Element;
 /* static */
 const mozilla::gfx::Color SimpleTextContextPaint::sZero;
 
-gfxSVGGlyphs::gfxSVGGlyphs(hb_blob_t *aSVGTable, gfxFontEntry *aFontEntry)
+gfxSVGGlyphs::gfxSVGGlyphs(hb_blob_t* aSVGTable, gfxFontEntry* aFontEntry)
     : mSVGData(aSVGTable), mFontEntry(aFontEntry) {
   unsigned int length;
-  const char *svgData = hb_blob_get_data(mSVGData, &length);
-  mHeader = reinterpret_cast(svgData);
+  const char* svgData = hb_blob_get_data(mSVGData, &length);
+  mHeader = reinterpret_cast(svgData);
   mDocIndex = nullptr;
 
   if (sizeof(Header) <= length && uint16_t(mHeader->mVersion) == 0 &&
       uint64_t(mHeader->mDocIndexOffset) + 2 <= length) {
-    const DocIndex *docIndex =
-        reinterpret_cast(svgData + mHeader->mDocIndexOffset);
+    const DocIndex* docIndex =
+        reinterpret_cast(svgData + mHeader->mDocIndexOffset);
     // Limit the number of documents to avoid overflow
     if (uint64_t(mHeader->mDocIndexOffset) + 2 +
             uint16_t(docIndex->mNumEntries) * sizeof(IndexEntry) <=
@@ -79,9 +79,9 @@ void gfxSVGGlyphs::DidRefresh() { mFontEntry->NotifyGlyphsChanged(); }
  *        sets intersecting of size > 1 -- so... don't do that)
  */
 /* static */
-int gfxSVGGlyphs::CompareIndexEntries(const void *aKey, const void *aEntry) {
-  const uint32_t key = *(uint32_t *)aKey;
-  const IndexEntry *entry = (const IndexEntry *)aEntry;
+int gfxSVGGlyphs::CompareIndexEntries(const void* aKey, const void* aEntry) {
+  const uint32_t key = *(uint32_t*)aKey;
+  const IndexEntry* entry = (const IndexEntry*)aEntry;
 
   if (key < uint16_t(entry->mStartGlyph)) {
     return -1;
@@ -92,25 +92,25 @@ int gfxSVGGlyphs::CompareIndexEntries(const void *aKey, const void *aEntry) {
   return 0;
 }
 
-gfxSVGGlyphsDocument *gfxSVGGlyphs::FindOrCreateGlyphsDocument(
+gfxSVGGlyphsDocument* gfxSVGGlyphs::FindOrCreateGlyphsDocument(
     uint32_t aGlyphId) {
   if (!mDocIndex) {
     // Invalid table
     return nullptr;
   }
 
-  IndexEntry *entry = (IndexEntry *)bsearch(
+  IndexEntry* entry = (IndexEntry*)bsearch(
       &aGlyphId, mDocIndex->mEntries, uint16_t(mDocIndex->mNumEntries),
       sizeof(IndexEntry), CompareIndexEntries);
   if (!entry) {
     return nullptr;
   }
 
-  gfxSVGGlyphsDocument *result = mGlyphDocs.Get(entry->mDocOffset);
+  gfxSVGGlyphsDocument* result = mGlyphDocs.Get(entry->mDocOffset);
 
   if (!result) {
     unsigned int length;
-    const uint8_t *data = (const uint8_t *)hb_blob_get_data(mSVGData, &length);
+    const uint8_t* data = (const uint8_t*)hb_blob_get_data(mSVGData, &length);
     if (entry->mDocOffset > 0 && uint64_t(mHeader->mDocIndexOffset) +
                                          entry->mDocOffset +
                                          entry->mDocLength <=
@@ -175,8 +175,8 @@ void gfxSVGGlyphsDocument::DidRefresh() { mOwner->DidRefresh(); }
  * table
  * @param aElem The element to search from
  */
-void gfxSVGGlyphsDocument::FindGlyphElements(Element *aElem) {
-  for (nsIContent *child = aElem->GetLastChild(); child;
+void gfxSVGGlyphsDocument::FindGlyphElements(Element* aElem) {
+  for (nsIContent* child = aElem->GetLastChild(); child;
        child = child->GetPreviousSibling()) {
     if (!child->IsElement()) {
       continue;
@@ -194,11 +194,11 @@ void gfxSVGGlyphsDocument::FindGlyphElements(Element *aElem) {
  * @param aGlyphId The glyph id
  * @return true iff rendering succeeded
  */
-void gfxSVGGlyphs::RenderGlyph(gfxContext *aContext, uint32_t aGlyphId,
-                               SVGContextPaint *aContextPaint) {
+void gfxSVGGlyphs::RenderGlyph(gfxContext* aContext, uint32_t aGlyphId,
+                               SVGContextPaint* aContextPaint) {
   gfxContextAutoSaveRestore aContextRestorer(aContext);
 
-  Element *glyph = mGlyphIdMap.Get(aGlyphId);
+  Element* glyph = mGlyphIdMap.Get(aGlyphId);
   MOZ_ASSERT(glyph, "No glyph element. Should check with HasSVGGlyph() first!");
 
   AutoSetRestoreSVGContextPaint autoSetRestore(
@@ -208,21 +208,21 @@ void gfxSVGGlyphs::RenderGlyph(gfxContext *aContext, uint32_t aGlyphId,
 }
 
 bool gfxSVGGlyphs::GetGlyphExtents(uint32_t aGlyphId,
-                                   const gfxMatrix &aSVGToAppSpace,
-                                   gfxRect *aResult) {
-  Element *glyph = mGlyphIdMap.Get(aGlyphId);
+                                   const gfxMatrix& aSVGToAppSpace,
+                                   gfxRect* aResult) {
+  Element* glyph = mGlyphIdMap.Get(aGlyphId);
   NS_ASSERTION(glyph,
                "No glyph element. Should check with HasSVGGlyph() first!");
 
   return nsSVGUtils::GetSVGGlyphExtents(glyph, aSVGToAppSpace, aResult);
 }
 
-Element *gfxSVGGlyphs::GetGlyphElement(uint32_t aGlyphId) {
-  Element *elem;
+Element* gfxSVGGlyphs::GetGlyphElement(uint32_t aGlyphId) {
+  Element* elem;
 
   if (!mGlyphIdMap.Get(aGlyphId, &elem)) {
     elem = nullptr;
-    if (gfxSVGGlyphsDocument *set = FindOrCreateGlyphsDocument(aGlyphId)) {
+    if (gfxSVGGlyphsDocument* set = FindOrCreateGlyphsDocument(aGlyphId)) {
       elem = set->GetGlyphElement(aGlyphId);
     }
     mGlyphIdMap.Put(aGlyphId, elem);
@@ -249,13 +249,13 @@ size_t gfxSVGGlyphs::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
   return result;
 }
 
-Element *gfxSVGGlyphsDocument::GetGlyphElement(uint32_t aGlyphId) {
+Element* gfxSVGGlyphsDocument::GetGlyphElement(uint32_t aGlyphId) {
   return mGlyphIdMap.Get(aGlyphId);
 }
 
-gfxSVGGlyphsDocument::gfxSVGGlyphsDocument(const uint8_t *aBuffer,
+gfxSVGGlyphsDocument::gfxSVGGlyphsDocument(const uint8_t* aBuffer,
                                            uint32_t aBufLen,
-                                           gfxSVGGlyphs *aSVGGlyphs)
+                                           gfxSVGGlyphs* aSVGGlyphs)
     : mOwner(aSVGGlyphs) {
   ParseDocument(aBuffer, aBufLen);
   if (!mDocument) {
@@ -263,7 +263,7 @@ gfxSVGGlyphsDocument::gfxSVGGlyphsDocument(const uint8_t *aBuffer,
     return;
   }
 
-  Element *root = mDocument->GetRootElement();
+  Element* root = mDocument->GetRootElement();
   if (!root) {
     NS_WARNING("Could not parse SVG glyphs document");
     return;
@@ -291,12 +291,12 @@ gfxSVGGlyphsDocument::~gfxSVGGlyphsDocument() {
   }
 }
 
-static nsresult CreateBufferedStream(const uint8_t *aBuffer, uint32_t aBufLen,
-                                     nsCOMPtr &aResult) {
+static nsresult CreateBufferedStream(const uint8_t* aBuffer, uint32_t aBufLen,
+                                     nsCOMPtr& aResult) {
   nsCOMPtr stream;
   nsresult rv = NS_NewByteInputStream(
       getter_AddRefs(stream),
-      MakeSpan(reinterpret_cast(aBuffer), aBufLen),
+      MakeSpan(reinterpret_cast(aBuffer), aBufLen),
       NS_ASSIGNMENT_DEPEND);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -313,7 +313,7 @@ static nsresult CreateBufferedStream(const uint8_t *aBuffer, uint32_t aBufLen,
   return NS_OK;
 }
 
-nsresult gfxSVGGlyphsDocument::ParseDocument(const uint8_t *aBuffer,
+nsresult gfxSVGGlyphsDocument::ParseDocument(const uint8_t* aBuffer,
                                              uint32_t aBufLen) {
   // Mostly pulled from nsDOMParser::ParseFromStream
 
@@ -387,7 +387,7 @@ nsresult gfxSVGGlyphsDocument::ParseDocument(const uint8_t *aBuffer,
   return NS_OK;
 }
 
-void gfxSVGGlyphsDocument::InsertGlyphId(Element *aGlyphElement) {
+void gfxSVGGlyphsDocument::InsertGlyphId(Element* aGlyphElement) {
   nsAutoString glyphIdStr;
   static const uint32_t glyphPrefixLength = 5;
   // The maximum glyph ID is 65535 so the maximum length of the numeric part
diff --git a/gfx/thebes/gfxSVGGlyphs.h b/gfx/thebes/gfxSVGGlyphs.h
index 9dafda2d8bf9b..0350ee448e011 100644
--- a/gfx/thebes/gfxSVGGlyphs.h
+++ b/gfx/thebes/gfxSVGGlyphs.h
@@ -40,10 +40,10 @@ class gfxSVGGlyphsDocument final : public nsAPostRefreshObserver {
   typedef mozilla::dom::Element Element;
 
  public:
-  gfxSVGGlyphsDocument(const uint8_t *aBuffer, uint32_t aBufLen,
-                       gfxSVGGlyphs *aSVGGlyphs);
+  gfxSVGGlyphsDocument(const uint8_t* aBuffer, uint32_t aBufLen,
+                       gfxSVGGlyphs* aSVGGlyphs);
 
-  Element *GetGlyphElement(uint32_t aGlyphId);
+  Element* GetGlyphElement(uint32_t aGlyphId);
 
   ~gfxSVGGlyphsDocument();
 
@@ -52,21 +52,21 @@ class gfxSVGGlyphsDocument final : public nsAPostRefreshObserver {
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
  private:
-  nsresult ParseDocument(const uint8_t *aBuffer, uint32_t aBufLen);
+  nsresult ParseDocument(const uint8_t* aBuffer, uint32_t aBufLen);
 
   nsresult SetupPresentation();
 
-  void FindGlyphElements(Element *aElement);
+  void FindGlyphElements(Element* aElement);
 
-  void InsertGlyphId(Element *aGlyphElement);
+  void InsertGlyphId(Element* aGlyphElement);
 
   // Weak so as not to create a cycle. mOwner owns us so this can't dangle.
-  gfxSVGGlyphs *mOwner;
+  gfxSVGGlyphs* mOwner;
   RefPtr mDocument;
   nsCOMPtr mViewer;
   RefPtr mPresShell;
 
-  nsBaseHashtable mGlyphIdMap;
+  nsBaseHashtable mGlyphIdMap;
 
   nsCString mSVGGlyphsDocumentURI;
 };
@@ -89,7 +89,7 @@ class gfxSVGGlyphs {
    * that are passed in, and will hb_blob_destroy() them when finished;
    * the caller should -not- destroy these references.
    */
-  gfxSVGGlyphs(hb_blob_t *aSVGTable, gfxFontEntry *aFontEntry);
+  gfxSVGGlyphs(hb_blob_t* aSVGTable, gfxFontEntry* aFontEntry);
 
   /**
    * Releases our references to the SVG table and cleans up everything else.
@@ -107,7 +107,7 @@ class gfxSVGGlyphs {
    * If a |gfxSVGGlyphsDocument| has not been created for the document, create
    * one.
    */
-  gfxSVGGlyphsDocument *FindOrCreateGlyphsDocument(uint32_t aGlyphId);
+  gfxSVGGlyphsDocument* FindOrCreateGlyphsDocument(uint32_t aGlyphId);
 
   /**
    * Return true iff there is an SVG glyph for |aGlyphId|
@@ -119,29 +119,29 @@ class gfxSVGGlyphs {
    * @param aContextPaint Information on text context paints.
    *   See |SVGContextPaint|.
    */
-  void RenderGlyph(gfxContext *aContext, uint32_t aGlyphId,
-                   mozilla::SVGContextPaint *aContextPaint);
+  void RenderGlyph(gfxContext* aContext, uint32_t aGlyphId,
+                   mozilla::SVGContextPaint* aContextPaint);
 
   /**
    * Get the extents for the SVG glyph associated with |aGlyphId|
    * @param aSVGToAppSpace The matrix mapping the SVG glyph space to the
    *   target context space
    */
-  bool GetGlyphExtents(uint32_t aGlyphId, const gfxMatrix &aSVGToAppSpace,
-                       gfxRect *aResult);
+  bool GetGlyphExtents(uint32_t aGlyphId, const gfxMatrix& aSVGToAppSpace,
+                       gfxRect* aResult);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
  private:
-  Element *GetGlyphElement(uint32_t aGlyphId);
+  Element* GetGlyphElement(uint32_t aGlyphId);
 
   nsClassHashtable mGlyphDocs;
-  nsBaseHashtable mGlyphIdMap;
+  nsBaseHashtable mGlyphIdMap;
 
-  hb_blob_t *mSVGData;
+  hb_blob_t* mSVGData;
 
   // pointer to the font entry that owns this gfxSVGGlyphs object
-  gfxFontEntry *MOZ_NON_OWNING_REF mFontEntry;
+  gfxFontEntry* MOZ_NON_OWNING_REF mFontEntry;
 
   const struct Header {
     mozilla::AutoSwap_PRUint16 mVersion;
@@ -161,7 +161,7 @@ class gfxSVGGlyphs {
     IndexEntry mEntries[1]; /* actual length = mNumEntries */
   } * mDocIndex;
 
-  static int CompareIndexEntries(const void *_a, const void *_b);
+  static int CompareIndexEntries(const void* _a, const void* _b);
 };
 
 /**
@@ -179,8 +179,8 @@ class SimpleTextContextPaint : public mozilla::SVGContextPaint {
  private:
   static const mozilla::gfx::Color sZero;
 
-  static gfxMatrix SetupDeviceToPatternMatrix(gfxPattern *aPattern,
-                                              const gfxMatrix &aCTM) {
+  static gfxMatrix SetupDeviceToPatternMatrix(gfxPattern* aPattern,
+                                              const gfxMatrix& aCTM) {
     if (!aPattern) {
       return gfxMatrix();
     }
@@ -192,8 +192,8 @@ class SimpleTextContextPaint : public mozilla::SVGContextPaint {
   }
 
  public:
-  SimpleTextContextPaint(gfxPattern *aFillPattern, gfxPattern *aStrokePattern,
-                         const gfxMatrix &aCTM)
+  SimpleTextContextPaint(gfxPattern* aFillPattern, gfxPattern* aStrokePattern,
+                         const gfxMatrix& aCTM)
       : mFillPattern(aFillPattern ? aFillPattern : new gfxPattern(sZero)),
         mStrokePattern(aStrokePattern ? aStrokePattern
                                       : new gfxPattern(sZero)) {
@@ -202,8 +202,8 @@ class SimpleTextContextPaint : public mozilla::SVGContextPaint {
   }
 
   already_AddRefed GetFillPattern(
-      const DrawTarget *aDrawTarget, float aOpacity, const gfxMatrix &aCTM,
-      imgDrawingParams &aImgParams) override {
+      const DrawTarget* aDrawTarget, float aOpacity, const gfxMatrix& aCTM,
+      imgDrawingParams& aImgParams) override {
     if (mFillPattern) {
       mFillPattern->SetMatrix(aCTM * mFillMatrix);
     }
@@ -212,8 +212,8 @@ class SimpleTextContextPaint : public mozilla::SVGContextPaint {
   }
 
   already_AddRefed GetStrokePattern(
-      const DrawTarget *aDrawTarget, float aOpacity, const gfxMatrix &aCTM,
-      imgDrawingParams &aImgParams) override {
+      const DrawTarget* aDrawTarget, float aOpacity, const gfxMatrix& aCTM,
+      imgDrawingParams& aImgParams) override {
     if (mStrokePattern) {
       mStrokePattern->SetMatrix(aCTM * mStrokeMatrix);
     }
diff --git a/gfx/thebes/gfxWindowsSurface.cpp b/gfx/thebes/gfxWindowsSurface.cpp
index a7866db921161..b57d4fdb8c2a3 100644
--- a/gfx/thebes/gfxWindowsSurface.cpp
+++ b/gfx/thebes/gfxWindowsSurface.cpp
@@ -20,24 +20,24 @@ gfxWindowsSurface::gfxWindowsSurface(HDC dc, uint32_t flags)
   InitWithDC(flags);
 }
 
-gfxWindowsSurface::gfxWindowsSurface(IDirect3DSurface9 *surface, uint32_t flags)
+gfxWindowsSurface::gfxWindowsSurface(IDirect3DSurface9* surface, uint32_t flags)
     : mOwnsDC(false), mDC(0), mWnd(nullptr) {
-  cairo_surface_t *surf = cairo_win32_surface_create_with_d3dsurface9(surface);
+  cairo_surface_t* surf = cairo_win32_surface_create_with_d3dsurface9(surface);
   Init(surf);
 }
 
-void gfxWindowsSurface::MakeInvalid(mozilla::gfx::IntSize &size) {
+void gfxWindowsSurface::MakeInvalid(mozilla::gfx::IntSize& size) {
   size = mozilla::gfx::IntSize(-1, -1);
 }
 
-gfxWindowsSurface::gfxWindowsSurface(const mozilla::gfx::IntSize &realSize,
+gfxWindowsSurface::gfxWindowsSurface(const mozilla::gfx::IntSize& realSize,
                                      gfxImageFormat imageFormat)
     : mOwnsDC(false), mWnd(nullptr) {
   mozilla::gfx::IntSize size(realSize);
   if (!mozilla::gfx::Factory::CheckSurfaceSize(size)) MakeInvalid(size);
 
   cairo_format_t cformat = GfxFormatToCairoFormat(imageFormat);
-  cairo_surface_t *surf =
+  cairo_surface_t* surf =
       cairo_win32_surface_create_with_dib(cformat, size.width, size.height);
 
   Init(surf);
@@ -50,7 +50,7 @@ gfxWindowsSurface::gfxWindowsSurface(const mozilla::gfx::IntSize &realSize,
   }
 }
 
-gfxWindowsSurface::gfxWindowsSurface(cairo_surface_t *csurf)
+gfxWindowsSurface::gfxWindowsSurface(cairo_surface_t* csurf)
     : mOwnsDC(false), mWnd(nullptr) {
   if (cairo_surface_status(csurf) == 0)
     mDC = cairo_win32_surface_get_dc(csurf);
@@ -72,12 +72,12 @@ void gfxWindowsSurface::InitWithDC(uint32_t flags) {
 }
 
 already_AddRefed gfxWindowsSurface::CreateSimilarSurface(
-    gfxContentType aContent, const mozilla::gfx::IntSize &aSize) {
+    gfxContentType aContent, const mozilla::gfx::IntSize& aSize) {
   if (!mSurface || !mSurfaceValid) {
     return nullptr;
   }
 
-  cairo_surface_t *surface;
+  cairo_surface_t* surface;
   if (GetContentType() == gfxContentType::COLOR_ALPHA) {
     // When creating a similar surface to a transparent surface, ensure
     // the new surface uses a DIB. cairo_surface_create_similar won't
@@ -132,7 +132,7 @@ already_AddRefed gfxWindowsSurface::GetAsImageSurface() {
       CairoSurface() != nullptr,
       "CairoSurface() shouldn't be nullptr when mSurfaceValid is TRUE!");
 
-  cairo_surface_t *isurf = cairo_win32_surface_get_image(CairoSurface());
+  cairo_surface_t* isurf = cairo_win32_surface_get_image(CairoSurface());
   if (!isurf) return nullptr;
 
   RefPtr result =
diff --git a/gfx/thebes/gfxXlibNativeRenderer.cpp b/gfx/thebes/gfxXlibNativeRenderer.cpp
index a66b3ad7e9fec..0bf34e359adb1 100644
--- a/gfx/thebes/gfxXlibNativeRenderer.cpp
+++ b/gfx/thebes/gfxXlibNativeRenderer.cpp
@@ -62,17 +62,17 @@ using namespace mozilla::gfx;
       server...
 */
 
-static cairo_bool_t _convert_coord_to_int(double coord, int32_t *v) {
+static cairo_bool_t _convert_coord_to_int(double coord, int32_t* v) {
   *v = (int32_t)coord;
   /* XXX allow some tolerance here? */
   return *v == coord;
 }
 
-static bool _get_rectangular_clip(cairo_t *cr, const IntRect &bounds,
-                                  bool *need_clip, IntRect *rectangles,
-                                  int max_rectangles, int *num_rectangles) {
-  cairo_rectangle_list_t *cliplist;
-  cairo_rectangle_t *clips;
+static bool _get_rectangular_clip(cairo_t* cr, const IntRect& bounds,
+                                  bool* need_clip, IntRect* rectangles,
+                                  int max_rectangles, int* num_rectangles) {
+  cairo_rectangle_list_t* cliplist;
+  cairo_rectangle_t* clips;
   int i;
   bool retval = true;
 
@@ -132,9 +132,9 @@ static bool _get_rectangular_clip(cairo_t *cr, const IntRect &bounds,
  * Try the direct path.
  * @return True if we took the direct path
  */
-bool gfxXlibNativeRenderer::DrawDirect(DrawTarget *aDT, IntSize size,
-                                       uint32_t flags, Screen *screen,
-                                       Visual *visual) {
+bool gfxXlibNativeRenderer::DrawDirect(DrawTarget* aDT, IntSize size,
+                                       uint32_t flags, Screen* screen,
+                                       Visual* visual) {
   // We need to actually borrow the context because we want to read out the
   // clip rectangles.
   BorrowedCairoContext borrowed(aDT);
@@ -148,10 +148,10 @@ bool gfxXlibNativeRenderer::DrawDirect(DrawTarget *aDT, IntSize size,
   return direct;
 }
 
-bool gfxXlibNativeRenderer::DrawCairo(cairo_t *cr, IntSize size, uint32_t flags,
-                                      Screen *screen, Visual *visual) {
+bool gfxXlibNativeRenderer::DrawCairo(cairo_t* cr, IntSize size, uint32_t flags,
+                                      Screen* screen, Visual* visual) {
   /* Check that the target surface is an xlib surface. */
-  cairo_surface_t *target = cairo_get_group_target(cr);
+  cairo_surface_t* target = cairo_get_group_target(cr);
   if (cairo_surface_get_type(target) != CAIRO_SURFACE_TYPE_XLIB) {
     NATIVE_DRAWING_NOTE("FALLBACK: non-X surface");
     return false;
@@ -218,7 +218,7 @@ bool gfxXlibNativeRenderer::DrawCairo(cairo_t *cr, IntSize size, uint32_t flags,
   }
 
   /* Check that there is a visual */
-  Visual *target_visual = cairo_xlib_surface_get_visual(target);
+  Visual* target_visual = cairo_xlib_surface_get_visual(target);
   if (!target_visual) {
     NATIVE_DRAWING_NOTE("FALLBACK: no Visual for surface");
     return false;
@@ -227,7 +227,7 @@ bool gfxXlibNativeRenderer::DrawCairo(cairo_t *cr, IntSize size, uint32_t flags,
   if (!supports_alternate_visual && target_visual != visual) {
     // Only the format of the visual is important (not the GLX properties)
     // for Xlib or XRender drawing.
-    XRenderPictFormat *target_format =
+    XRenderPictFormat* target_format =
         cairo_xlib_surface_get_xrender_format(target);
     if (!target_format ||
         (target_format !=
@@ -249,7 +249,7 @@ bool gfxXlibNativeRenderer::DrawCairo(cairo_t *cr, IntSize size, uint32_t flags,
   return false;
 }
 
-static bool VisualHasAlpha(Screen *screen, Visual *visual) {
+static bool VisualHasAlpha(Screen* screen, Visual* visual) {
   // There may be some other visuals format with alpha but usually this is
   // the only one we care about.
   return visual->c_class == TrueColor && visual->bits_per_rgb == 8 &&
@@ -260,20 +260,20 @@ static bool VisualHasAlpha(Screen *screen, Visual *visual) {
 
 // Returns whether pixel conversion between visual and format is exact (in
 // both directions).
-static bool FormatConversionIsExact(Screen *screen, Visual *visual,
-                                    XRenderPictFormat *format) {
+static bool FormatConversionIsExact(Screen* screen, Visual* visual,
+                                    XRenderPictFormat* format) {
   if (!format || visual->c_class != TrueColor ||
       format->type != PictTypeDirect ||
       gfxXlibSurface::DepthOfVisual(screen, visual) != format->depth)
     return false;
 
-  XRenderPictFormat *visualFormat =
+  XRenderPictFormat* visualFormat =
       XRenderFindVisualFormat(DisplayOfScreen(screen), visual);
 
   if (visualFormat->type != PictTypeDirect) return false;
 
-  const XRenderDirectFormat &a = visualFormat->direct;
-  const XRenderDirectFormat &b = format->direct;
+  const XRenderDirectFormat& a = visualFormat->direct;
+  const XRenderDirectFormat& b = format->direct;
   return a.redMask == b.redMask && a.greenMask == b.greenMask &&
          a.blueMask == b.blueMask;
 }
@@ -282,10 +282,10 @@ static bool FormatConversionIsExact(Screen *screen, Visual *visual,
 // The surface format and strategy are inter-dependent.
 enum DrawingMethod { eSimple, eCopyBackground, eAlphaExtraction };
 
-static cairo_surface_t *CreateTempXlibSurface(
-    cairo_surface_t *cairoTarget, DrawTarget *drawTarget, IntSize size,
-    bool canDrawOverBackground, uint32_t flags, Screen *screen, Visual *visual,
-    DrawingMethod *method) {
+static cairo_surface_t* CreateTempXlibSurface(
+    cairo_surface_t* cairoTarget, DrawTarget* drawTarget, IntSize size,
+    bool canDrawOverBackground, uint32_t flags, Screen* screen, Visual* visual,
+    DrawingMethod* method) {
   NS_ASSERTION(cairoTarget || drawTarget, "Must have some type");
 
   bool drawIsOpaque = (flags & gfxXlibNativeRenderer::DRAW_IS_OPAQUE) != 0;
@@ -299,7 +299,7 @@ static cairo_surface_t *CreateTempXlibSurface(
       cairoTarget ? cairo_surface_get_type(cairoTarget)
                   : (cairo_surface_type_t)0xFF;
 
-  Screen *target_screen = cairoTargetType == CAIRO_SURFACE_TYPE_XLIB
+  Screen* target_screen = cairoTargetType == CAIRO_SURFACE_TYPE_XLIB
                               ? cairo_xlib_surface_get_screen(cairoTarget)
                               : screen;
 
@@ -321,8 +321,8 @@ static cairo_surface_t *CreateTempXlibSurface(
     // Analyse the pixel formats either to check whether we can
     // doCopyBackground or to see if we can find a better visual for
     // opaque drawing.
-    Visual *target_visual = nullptr;
-    XRenderPictFormat *target_format = nullptr;
+    Visual* target_visual = nullptr;
+    XRenderPictFormat* target_format = nullptr;
     if (cairoTargetType == CAIRO_SURFACE_TYPE_XLIB) {
       target_visual = cairo_xlib_surface_get_visual(cairoTarget);
       target_format = cairo_xlib_surface_get_xrender_format(cairoTarget);
@@ -332,7 +332,7 @@ static cairo_surface_t *CreateTempXlibSurface(
                      : CairoFormatToGfxFormat(
                            cairo_image_surface_get_format(cairoTarget));
       target_visual = gfxXlibSurface::FindVisual(screen, imageFormat);
-      Display *dpy = DisplayOfScreen(screen);
+      Display* dpy = DisplayOfScreen(screen);
       if (target_visual) {
         target_format = XRenderFindVisualFormat(dpy, target_visual);
       } else {
@@ -362,8 +362,8 @@ static cairo_surface_t *CreateTempXlibSurface(
       (screen != target_screen ||
        !(doCopyBackground || VisualHasAlpha(screen, visual)))) {
     // Try to find a visual with an alpha channel.
-    Screen *visualScreen = supportsAlternateScreen ? target_screen : screen;
-    Visual *argbVisual = gfxXlibSurface::FindVisual(
+    Screen* visualScreen = supportsAlternateScreen ? target_screen : screen;
+    Visual* argbVisual = gfxXlibSurface::FindVisual(
         visualScreen, SurfaceFormat::A8R8G8B8_UINT32);
     if (argbVisual) {
       visual = argbVisual;
@@ -372,7 +372,7 @@ static cairo_surface_t *CreateTempXlibSurface(
                gfxXlibSurface::DepthOfVisual(screen, visual) != 24) {
       // Will need to do alpha extraction; prefer a 24-bit visual.
       // No advantage in using the target screen.
-      Visual *rgb24Visual =
+      Visual* rgb24Visual =
           gfxXlibSurface::FindVisual(screen, SurfaceFormat::X8R8G8B8_UINT32);
       if (rgb24Visual) {
         visual = rgb24Visual;
@@ -385,7 +385,7 @@ static cairo_surface_t *CreateTempXlibSurface(
           ? cairo_xlib_surface_get_drawable(cairoTarget)
           : RootWindowOfScreen(screen);
 
-  cairo_surface_t *surface = gfxXlibSurface::CreateCairoSurface(
+  cairo_surface_t* surface = gfxXlibSurface::CreateCairoSurface(
       screen, visual, IntSize(size.width, size.height), drawable);
   if (!surface) {
     return nullptr;
@@ -408,7 +408,7 @@ static cairo_surface_t *CreateTempXlibSurface(
 }
 
 bool gfxXlibNativeRenderer::DrawOntoTempSurface(
-    cairo_surface_t *tempXlibSurface, IntPoint offset) {
+    cairo_surface_t* tempXlibSurface, IntPoint offset) {
   cairo_surface_flush(tempXlibSurface);
   /* no clipping is needed because the callback can't draw outside the native
      surface anyway */
@@ -418,10 +418,10 @@ bool gfxXlibNativeRenderer::DrawOntoTempSurface(
 }
 
 static already_AddRefed CopyXlibSurfaceToImage(
-    cairo_surface_t *tempXlibSurface, IntSize size, gfxImageFormat format) {
+    cairo_surface_t* tempXlibSurface, IntSize size, gfxImageFormat format) {
   RefPtr result = new gfxImageSurface(size, format);
 
-  cairo_t *copyCtx = cairo_create(result->CairoSurface());
+  cairo_t* copyCtx = cairo_create(result->CairoSurface());
   cairo_set_source_surface(copyCtx, tempXlibSurface, 0, 0);
   cairo_set_operator(copyCtx, CAIRO_OPERATOR_SOURCE);
   cairo_paint(copyCtx);
@@ -430,8 +430,8 @@ static already_AddRefed CopyXlibSurfaceToImage(
   return result.forget();
 }
 
-void gfxXlibNativeRenderer::Draw(gfxContext *ctx, IntSize size, uint32_t flags,
-                                 Screen *screen, Visual *visual) {
+void gfxXlibNativeRenderer::Draw(gfxContext* ctx, IntSize size, uint32_t flags,
+                                 Screen* screen, Visual* visual) {
   Matrix matrix = ctx->CurrentMatrix();
 
   // We can only draw direct or onto a copied background if pixels align and
@@ -456,7 +456,7 @@ void gfxXlibNativeRenderer::Draw(gfxContext *ctx, IntSize size, uint32_t flags,
     NATIVE_DRAWING_NOTE("FALLBACK: unsupported operator");
   }
 
-  DrawTarget *drawTarget = ctx->GetDrawTarget();
+  DrawTarget* drawTarget = ctx->GetDrawTarget();
   if (!drawTarget) {
     gfxCriticalError() << "gfxContext without a DrawTarget";
     return;
@@ -499,11 +499,11 @@ void gfxXlibNativeRenderer::Draw(gfxContext *ctx, IntSize size, uint32_t flags,
   DrawingMethod method;
   Matrix dtTransform = drawTarget->GetTransform();
   gfxPoint deviceTranslation = gfxPoint(dtTransform._31, dtTransform._32);
-  cairo_t *cairo = static_cast(
+  cairo_t* cairo = static_cast(
       drawTarget->GetNativeSurface(NativeSurfaceType::CAIRO_CONTEXT));
-  cairo_surface_t *cairoTarget =
+  cairo_surface_t* cairoTarget =
       cairo ? cairo_get_group_target(cairo) : nullptr;
-  cairo_surface_t *tempXlibSurface = CreateTempXlibSurface(
+  cairo_surface_t* tempXlibSurface = CreateTempXlibSurface(
       cairoTarget, drawTarget, size, canDrawOverBackground, flags, screen,
       visual, &method);
   if (!tempXlibSurface) {
@@ -512,7 +512,7 @@ void gfxXlibNativeRenderer::Draw(gfxContext *ctx, IntSize size, uint32_t flags,
 
   bool drawIsOpaque = (flags & DRAW_IS_OPAQUE) != 0;
   if (!drawIsOpaque) {
-    cairo_t *tmpCtx = cairo_create(tempXlibSurface);
+    cairo_t* tmpCtx = cairo_create(tempXlibSurface);
     if (method == eCopyBackground) {
       NS_ASSERTION(cairoTarget,
                    "eCopyBackground only used when there's a cairoTarget");
@@ -558,7 +558,7 @@ void gfxXlibNativeRenderer::Draw(gfxContext *ctx, IntSize size, uint32_t flags,
   RefPtr blackImage = CopyXlibSurfaceToImage(
       tempXlibSurface, size, SurfaceFormat::A8R8G8B8_UINT32);
 
-  cairo_t *tmpCtx = cairo_create(tempXlibSurface);
+  cairo_t* tmpCtx = cairo_create(tempXlibSurface);
   cairo_set_source_rgba(tmpCtx, 1.0, 1.0, 1.0, 1.0);
   cairo_set_operator(tmpCtx, CAIRO_OPERATOR_SOURCE);
   cairo_paint(tmpCtx);
@@ -574,7 +574,7 @@ void gfxXlibNativeRenderer::Draw(gfxContext *ctx, IntSize size, uint32_t flags,
       return;
     }
 
-    gfxASurface *paintSurface = blackImage;
+    gfxASurface* paintSurface = blackImage;
     RefPtr sourceSurface =
         Factory::CreateSourceSurfaceForCairoSurface(
             paintSurface->CairoSurface(), size, moz2DFormat);
diff --git a/gfx/vr/service/osvr/ClientKit/DisplayC.h b/gfx/vr/service/osvr/ClientKit/DisplayC.h
index 75155e6b305c5..fb11ca6b53c76 100644
--- a/gfx/vr/service/osvr/ClientKit/DisplayC.h
+++ b/gfx/vr/service/osvr/ClientKit/DisplayC.h
@@ -54,7 +54,7 @@ OSVR_EXTERN_C_BEGIN
 */
 
 /** @brief Opaque type of a display configuration. */
-typedef struct OSVR_DisplayConfigObject *OSVR_DisplayConfig;
+typedef struct OSVR_DisplayConfigObject* OSVR_DisplayConfig;
 
 /** @brief Allocates a display configuration object populated with data from the
     OSVR system.
@@ -99,7 +99,7 @@ typedef struct OSVR_DisplayConfigObject *OSVR_DisplayConfig;
     error occurred, in which case the output argument is unmodified.
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
-osvrClientGetDisplay(OSVR_ClientContext ctx, OSVR_DisplayConfig *disp);
+osvrClientGetDisplay(OSVR_ClientContext ctx, OSVR_DisplayConfig* disp);
 
 /** @brief Frees a display configuration object. The corresponding context must
     still be open.
@@ -141,7 +141,7 @@ osvrClientCheckDisplayStartup(OSVR_DisplayConfig disp);
    which case the output argument is unmodified.
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetNumDisplayInputs(
-    OSVR_DisplayConfig disp, OSVR_DisplayInputCount *numDisplayInputs);
+    OSVR_DisplayConfig disp, OSVR_DisplayInputCount* numDisplayInputs);
 
 /** @brief Retrieve the pixel dimensions of a given display input for a display
    config
@@ -161,7 +161,7 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetNumDisplayInputs(
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetDisplayDimensions(
     OSVR_DisplayConfig disp, OSVR_DisplayInputCount displayInputIndex,
-    OSVR_DisplayDimension *width, OSVR_DisplayDimension *height);
+    OSVR_DisplayDimension* width, OSVR_DisplayDimension* height);
 
 /** @brief A display config can have one (or theoretically more) viewers:
     retrieve the viewer count.
@@ -177,7 +177,7 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetDisplayDimensions(
    the output argument is unmodified.
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
-osvrClientGetNumViewers(OSVR_DisplayConfig disp, OSVR_ViewerCount *viewers);
+osvrClientGetNumViewers(OSVR_DisplayConfig disp, OSVR_ViewerCount* viewers);
 
 /** @brief Get the pose of a viewer in a display config.
 
@@ -192,7 +192,7 @@ osvrClientGetNumViewers(OSVR_DisplayConfig disp, OSVR_ViewerCount *viewers);
     yet available, in which case the pose argument is unmodified.
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetViewerPose(
-    OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_Pose3 *pose);
+    OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_Pose3* pose);
 
 /** @brief Each viewer in a display config can have one or more "eyes" which
     have a substantially similar pose: get the count.
@@ -209,7 +209,7 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetViewerPose(
     the output argument is unmodified.
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetNumEyesForViewer(
-    OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount *eyes);
+    OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount* eyes);
 
 /** @brief Get the "viewpoint" for the given eye of a viewer in a display
    config.
@@ -226,7 +226,7 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetNumEyesForViewer(
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
 osvrClientGetViewerEyePose(OSVR_DisplayConfig disp, OSVR_ViewerCount viewer,
-                           OSVR_EyeCount eye, OSVR_Pose3 *pose);
+                           OSVR_EyeCount eye, OSVR_Pose3* pose);
 
 /** @brief Get the view matrix (inverse of pose) for the given eye of a
     viewer in a display config - matrix of **doubles**.
@@ -245,7 +245,7 @@ osvrClientGetViewerEyePose(OSVR_DisplayConfig disp, OSVR_ViewerCount viewer,
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixd(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
-    OSVR_MatrixConventions flags, double *mat);
+    OSVR_MatrixConventions flags, double* mat);
 
 /** @brief Get the view matrix (inverse of pose) for the given eye of a
     viewer in a display config - matrix of **floats**.
@@ -264,7 +264,7 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixd(
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixf(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
-    OSVR_MatrixConventions flags, float *mat);
+    OSVR_MatrixConventions flags, float* mat);
 
 /** @brief Each eye of each viewer in a display config has one or more surfaces
     (aka "screens") on which content should be rendered.
@@ -283,7 +283,7 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixf(
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetNumSurfacesForViewerEye(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
-    OSVR_SurfaceCount *surfaces);
+    OSVR_SurfaceCount* surfaces);
 
 /** @brief Get the dimensions/location of the viewport **within the display
     input** for a surface seen by an eye of a viewer in a display config. (This
@@ -311,9 +311,9 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetNumSurfacesForViewerEye(
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
 osvrClientGetRelativeViewportForViewerEyeSurface(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
-    OSVR_SurfaceCount surface, OSVR_ViewportDimension *left,
-    OSVR_ViewportDimension *bottom, OSVR_ViewportDimension *width,
-    OSVR_ViewportDimension *height);
+    OSVR_SurfaceCount surface, OSVR_ViewportDimension* left,
+    OSVR_ViewportDimension* bottom, OSVR_ViewportDimension* width,
+    OSVR_ViewportDimension* height);
 
 /** @brief Get the index of the display input for a surface seen by an eye of a
    viewer in a display config.
@@ -342,7 +342,7 @@ osvrClientGetRelativeViewportForViewerEyeSurface(
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
 osvrClientGetViewerEyeSurfaceDisplayInputIndex(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
-    OSVR_SurfaceCount surface, OSVR_DisplayInputCount *displayInput);
+    OSVR_SurfaceCount surface, OSVR_DisplayInputCount* displayInput);
 
 /** @brief Get the projection matrix for a surface seen by an eye of a viewer
     in a display config. (double version)
@@ -366,7 +366,7 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
 osvrClientGetViewerEyeSurfaceProjectionMatrixd(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
     OSVR_SurfaceCount surface, double near, double far,
-    OSVR_MatrixConventions flags, double *matrix);
+    OSVR_MatrixConventions flags, double* matrix);
 
 /** @brief Get the projection matrix for a surface seen by an eye of a viewer
     in a display config. (float version)
@@ -390,7 +390,7 @@ OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
 osvrClientGetViewerEyeSurfaceProjectionMatrixf(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
     OSVR_SurfaceCount surface, float near, float far,
-    OSVR_MatrixConventions flags, float *matrix);
+    OSVR_MatrixConventions flags, float* matrix);
 
 /** @brief Get the clipping planes (positions at unit distance) for a surface
    seen by an eye of a viewer
@@ -421,8 +421,8 @@ osvrClientGetViewerEyeSurfaceProjectionMatrixf(
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
 osvrClientGetViewerEyeSurfaceProjectionClippingPlanes(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
-    OSVR_SurfaceCount surface, double *left, double *right, double *bottom,
-    double *top);
+    OSVR_SurfaceCount surface, double* left, double* right, double* bottom,
+    double* top);
 
 /** @brief Determines if a surface seen by an eye of a viewer in a display
     config requests some distortion to be performed.
@@ -448,7 +448,7 @@ osvrClientDoesViewerEyeSurfaceWantDistortion(OSVR_DisplayConfig disp,
                                              OSVR_ViewerCount viewer,
                                              OSVR_EyeCount eye,
                                              OSVR_SurfaceCount surface,
-                                             OSVR_CBool *distortionRequested);
+                                             OSVR_CBool* distortionRequested);
 
 /** @brief Returns the priority/availability of radial distortion parameters for
     a surface seen by an eye of a viewer in a display config.
@@ -474,7 +474,7 @@ osvrClientDoesViewerEyeSurfaceWantDistortion(OSVR_DisplayConfig disp,
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
 osvrClientGetViewerEyeSurfaceRadialDistortionPriority(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
-    OSVR_SurfaceCount surface, OSVR_DistortionPriority *priority);
+    OSVR_SurfaceCount surface, OSVR_DistortionPriority* priority);
 
 /** @brief Returns the radial distortion parameters, if known/requested, for a
     surface seen by an eye of a viewer in a display config.
@@ -495,7 +495,7 @@ osvrClientGetViewerEyeSurfaceRadialDistortionPriority(
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode
 osvrClientGetViewerEyeSurfaceRadialDistortion(
     OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye,
-    OSVR_SurfaceCount surface, OSVR_RadialDistortionParameters *params);
+    OSVR_SurfaceCount surface, OSVR_RadialDistortionParameters* params);
 
 /** @}
     @}
diff --git a/gfx/vr/service/osvr/ClientKit/InterfaceC.h b/gfx/vr/service/osvr/ClientKit/InterfaceC.h
index 9d7048a1bfdf4..a8523b1733ff8 100644
--- a/gfx/vr/service/osvr/ClientKit/InterfaceC.h
+++ b/gfx/vr/service/osvr/ClientKit/InterfaceC.h
@@ -54,7 +54,7 @@ OSVR_EXTERN_C_BEGIN
    otherwise it will be freed when the context is closed.
 */
 OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrClientGetInterface(
-    OSVR_ClientContext ctx, const char path[], OSVR_ClientInterface *iface);
+    OSVR_ClientContext ctx, const char path[], OSVR_ClientInterface* iface);
 
 /** @brief Free an interface object before context closure.
 
diff --git a/gfx/vr/service/osvr/ClientKit/InterfaceCallbackC.h b/gfx/vr/service/osvr/ClientKit/InterfaceCallbackC.h
index 8268d139a9db8..18e2c135a78d9 100644
--- a/gfx/vr/service/osvr/ClientKit/InterfaceCallbackC.h
+++ b/gfx/vr/service/osvr/ClientKit/InterfaceCallbackC.h
@@ -48,7 +48,7 @@ OSVR_EXTERN_C_BEGIN
 #define OSVR_INTERFACE_CALLBACK_METHOD(TYPE)                          \
   /** @brief Register a callback for TYPE reports on an interface */  \
   OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrRegister##TYPE##Callback( \
-      OSVR_ClientInterface iface, OSVR_##TYPE##Callback cb, void *userdata);
+      OSVR_ClientInterface iface, OSVR_##TYPE##Callback cb, void* userdata);
 
 OSVR_INTERFACE_CALLBACK_METHOD(Pose)
 OSVR_INTERFACE_CALLBACK_METHOD(Position)
diff --git a/gfx/vr/service/osvr/ClientKit/InterfaceStateC.h b/gfx/vr/service/osvr/ClientKit/InterfaceStateC.h
index 2b51540c109c8..46d0b60393c24 100644
--- a/gfx/vr/service/osvr/ClientKit/InterfaceStateC.h
+++ b/gfx/vr/service/osvr/ClientKit/InterfaceStateC.h
@@ -50,8 +50,8 @@ OSVR_EXTERN_C_BEGIN
   /** @brief Get TYPE state from an interface, returning failure if none \
    * exists */                                                           \
   OSVR_CLIENTKIT_EXPORT OSVR_ReturnCode osvrGet##TYPE##State(            \
-      OSVR_ClientInterface iface, struct OSVR_TimeValue *timestamp,      \
-      OSVR_##TYPE##State *state);
+      OSVR_ClientInterface iface, struct OSVR_TimeValue* timestamp,      \
+      OSVR_##TYPE##State* state);
 
 OSVR_CALLBACK_METHODS(Pose)
 OSVR_CALLBACK_METHODS(Position)
diff --git a/gfx/vr/service/osvr/Util/ClientCallbackTypesC.h b/gfx/vr/service/osvr/Util/ClientCallbackTypesC.h
index 635cc11cec560..4a3c53e8224d1 100644
--- a/gfx/vr/service/osvr/Util/ClientCallbackTypesC.h
+++ b/gfx/vr/service/osvr/Util/ClientCallbackTypesC.h
@@ -55,81 +55,81 @@ OSVR_EXTERN_C_BEGIN
 
 /* generated file - do not edit! */
 /** @brief C function type for a Pose callback */
-typedef void (*OSVR_PoseCallback)(void *userdata,
-                                  const struct OSVR_TimeValue *timestamp,
-                                  const struct OSVR_PoseReport *report);
+typedef void (*OSVR_PoseCallback)(void* userdata,
+                                  const struct OSVR_TimeValue* timestamp,
+                                  const struct OSVR_PoseReport* report);
 /** @brief C function type for a Position callback */
-typedef void (*OSVR_PositionCallback)(void *userdata,
-                                      const struct OSVR_TimeValue *timestamp,
-                                      const struct OSVR_PositionReport *report);
+typedef void (*OSVR_PositionCallback)(void* userdata,
+                                      const struct OSVR_TimeValue* timestamp,
+                                      const struct OSVR_PositionReport* report);
 /** @brief C function type for a Orientation callback */
 typedef void (*OSVR_OrientationCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_OrientationReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_OrientationReport* report);
 /** @brief C function type for a Velocity callback */
-typedef void (*OSVR_VelocityCallback)(void *userdata,
-                                      const struct OSVR_TimeValue *timestamp,
-                                      const struct OSVR_VelocityReport *report);
+typedef void (*OSVR_VelocityCallback)(void* userdata,
+                                      const struct OSVR_TimeValue* timestamp,
+                                      const struct OSVR_VelocityReport* report);
 /** @brief C function type for a LinearVelocity callback */
 typedef void (*OSVR_LinearVelocityCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_LinearVelocityReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_LinearVelocityReport* report);
 /** @brief C function type for a AngularVelocity callback */
 typedef void (*OSVR_AngularVelocityCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_AngularVelocityReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_AngularVelocityReport* report);
 /** @brief C function type for a Acceleration callback */
 typedef void (*OSVR_AccelerationCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_AccelerationReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_AccelerationReport* report);
 /** @brief C function type for a LinearAcceleration callback */
 typedef void (*OSVR_LinearAccelerationCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_LinearAccelerationReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_LinearAccelerationReport* report);
 /** @brief C function type for a AngularAcceleration callback */
 typedef void (*OSVR_AngularAccelerationCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_AngularAccelerationReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_AngularAccelerationReport* report);
 /** @brief C function type for a Button callback */
-typedef void (*OSVR_ButtonCallback)(void *userdata,
-                                    const struct OSVR_TimeValue *timestamp,
-                                    const struct OSVR_ButtonReport *report);
+typedef void (*OSVR_ButtonCallback)(void* userdata,
+                                    const struct OSVR_TimeValue* timestamp,
+                                    const struct OSVR_ButtonReport* report);
 /** @brief C function type for a Analog callback */
-typedef void (*OSVR_AnalogCallback)(void *userdata,
-                                    const struct OSVR_TimeValue *timestamp,
-                                    const struct OSVR_AnalogReport *report);
+typedef void (*OSVR_AnalogCallback)(void* userdata,
+                                    const struct OSVR_TimeValue* timestamp,
+                                    const struct OSVR_AnalogReport* report);
 /** @brief C function type for a Imaging callback */
-typedef void (*OSVR_ImagingCallback)(void *userdata,
-                                     const struct OSVR_TimeValue *timestamp,
-                                     const struct OSVR_ImagingReport *report);
+typedef void (*OSVR_ImagingCallback)(void* userdata,
+                                     const struct OSVR_TimeValue* timestamp,
+                                     const struct OSVR_ImagingReport* report);
 /** @brief C function type for a Location2D callback */
 typedef void (*OSVR_Location2DCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_Location2DReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_Location2DReport* report);
 /** @brief C function type for a Direction callback */
 typedef void (*OSVR_DirectionCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_DirectionReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_DirectionReport* report);
 /** @brief C function type for a EyeTracker2D callback */
 typedef void (*OSVR_EyeTracker2DCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_EyeTracker2DReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_EyeTracker2DReport* report);
 /** @brief C function type for a EyeTracker3D callback */
 typedef void (*OSVR_EyeTracker3DCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_EyeTracker3DReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_EyeTracker3DReport* report);
 /** @brief C function type for a EyeTrackerBlink callback */
 typedef void (*OSVR_EyeTrackerBlinkCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_EyeTrackerBlinkReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_EyeTrackerBlinkReport* report);
 /** @brief C function type for a NaviVelocity callback */
 typedef void (*OSVR_NaviVelocityCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_NaviVelocityReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_NaviVelocityReport* report);
 /** @brief C function type for a NaviPosition callback */
 typedef void (*OSVR_NaviPositionCallback)(
-    void *userdata, const struct OSVR_TimeValue *timestamp,
-    const struct OSVR_NaviPositionReport *report);
+    void* userdata, const struct OSVR_TimeValue* timestamp,
+    const struct OSVR_NaviPositionReport* report);
 
 /** @} */
 
diff --git a/gfx/vr/service/osvr/Util/ClientOpaqueTypesC.h b/gfx/vr/service/osvr/Util/ClientOpaqueTypesC.h
index 64eba6d61ee59..84203bb0d4880 100644
--- a/gfx/vr/service/osvr/Util/ClientOpaqueTypesC.h
+++ b/gfx/vr/service/osvr/Util/ClientOpaqueTypesC.h
@@ -50,7 +50,7 @@ OSVR_EXTERN_C_BEGIN
 
     You are required to clean up this handle with osvrClientShutdown().
 */
-typedef struct OSVR_ClientContextObject *OSVR_ClientContext;
+typedef struct OSVR_ClientContextObject* OSVR_ClientContext;
 
 /** @brief Opaque handle to an interface used for registering callbacks and
    getting status.
@@ -60,7 +60,7 @@ typedef struct OSVR_ClientContextObject *OSVR_ClientContext;
    using osvrClientFreeInterface() to inform the context that you no longer need
    this interface.
 */
-typedef struct OSVR_ClientInterfaceObject *OSVR_ClientInterface;
+typedef struct OSVR_ClientInterfaceObject* OSVR_ClientInterface;
 
 /** @} */
 
diff --git a/gfx/vr/service/osvr/Util/ImagingReportTypesC.h b/gfx/vr/service/osvr/Util/ImagingReportTypesC.h
index d255a453ea636..c3d1a1dee8f57 100644
--- a/gfx/vr/service/osvr/Util/ImagingReportTypesC.h
+++ b/gfx/vr/service/osvr/Util/ImagingReportTypesC.h
@@ -76,7 +76,7 @@ typedef struct OSVR_ImagingMetadata {
 
 typedef struct OSVR_ImagingState {
   OSVR_ImagingMetadata metadata;
-  OSVR_ImageBufferElement *data;
+  OSVR_ImageBufferElement* data;
 } OSVR_ImagingState;
 
 typedef struct OSVR_ImagingReport {
diff --git a/gfx/vr/service/osvr/Util/MatrixConventionsC.h b/gfx/vr/service/osvr/Util/MatrixConventionsC.h
index c8a2eaf86b549..d9d31ef857bff 100644
--- a/gfx/vr/service/osvr/Util/MatrixConventionsC.h
+++ b/gfx/vr/service/osvr/Util/MatrixConventionsC.h
@@ -136,7 +136,7 @@ enum {
     @param[out] mat an array of 16 doubles
 */
 OSVR_UTIL_EXPORT OSVR_ReturnCode osvrPose3ToMatrixd(
-    OSVR_Pose3 const *pose, OSVR_MatrixConventions flags, double *mat);
+    OSVR_Pose3 const* pose, OSVR_MatrixConventions flags, double* mat);
 
 /** @brief Set a matrix of floats based on a Pose3.
     @param pose The Pose3 to convert
@@ -144,7 +144,7 @@ OSVR_UTIL_EXPORT OSVR_ReturnCode osvrPose3ToMatrixd(
     @param[out] mat an array of 16 floats
 */
 OSVR_UTIL_EXPORT OSVR_ReturnCode osvrPose3ToMatrixf(
-    OSVR_Pose3 const *pose, OSVR_MatrixConventions flags, float *mat);
+    OSVR_Pose3 const* pose, OSVR_MatrixConventions flags, float* mat);
 /** @} */
 
 OSVR_EXTERN_C_END
@@ -152,24 +152,24 @@ OSVR_EXTERN_C_END
 #ifdef __cplusplus
 /** @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
  * type) */
-inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const *pose,
+inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const* pose,
                                          OSVR_MatrixConventions flags,
-                                         double *mat) {
+                                         double* mat) {
   return osvrPose3ToMatrixd(pose, flags, mat);
 }
 
 /** @brief Set a matrix based on a Pose3. (C++-only overload - detecting scalar
  * type) */
-inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const *pose,
+inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const* pose,
                                          OSVR_MatrixConventions flags,
-                                         float *mat) {
+                                         float* mat) {
   return osvrPose3ToMatrixf(pose, flags, mat);
 }
 
 /** @brief Set a matrix based on a Pose3. (C++-only overload - detects scalar
  * and takes array rather than pointer) */
 template 
-inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const *pose,
+inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const* pose,
                                          OSVR_MatrixConventions flags,
                                          Scalar mat[OSVR_MATRIX_SIZE]) {
   return osvrPose3ToMatrix(pose, flags, &(mat[0]));
@@ -177,7 +177,7 @@ inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const *pose,
 /** @brief Set a matrix based on a Pose3. (C++-only overload - detects scalar,
  * takes array, takes pose by reference) */
 template 
-inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const &pose,
+inline OSVR_ReturnCode osvrPose3ToMatrix(OSVR_Pose3 const& pose,
                                          OSVR_MatrixConventions flags,
                                          Scalar mat[OSVR_MATRIX_SIZE]) {
   return osvrPose3ToMatrix(&pose, flags, &(mat[0]));
diff --git a/gfx/vr/service/osvr/Util/Pose3C.h b/gfx/vr/service/osvr/Util/Pose3C.h
index 5070fbd83cceb..cf56e7cc5334b 100644
--- a/gfx/vr/service/osvr/Util/Pose3C.h
+++ b/gfx/vr/service/osvr/Util/Pose3C.h
@@ -59,7 +59,7 @@ typedef struct OSVR_Pose3 {
 } OSVR_Pose3;
 
 /** @brief Set a pose to identity */
-OSVR_INLINE void osvrPose3SetIdentity(OSVR_Pose3 *pose) {
+OSVR_INLINE void osvrPose3SetIdentity(OSVR_Pose3* pose) {
   osvrQuatSetIdentity(&(pose->rotation));
   osvrVec3Zero(&(pose->translation));
 }
diff --git a/gfx/vr/service/osvr/Util/QuaternionC.h b/gfx/vr/service/osvr/Util/QuaternionC.h
index e69e03fa7cd5a..065c68bd4e024 100644
--- a/gfx/vr/service/osvr/Util/QuaternionC.h
+++ b/gfx/vr/service/osvr/Util/QuaternionC.h
@@ -53,11 +53,11 @@ typedef struct OSVR_Quaternion {
 
 #define OSVR_QUAT_MEMBER(COMPONENT, INDEX)                                  \
   /** @brief Accessor for quaternion component COMPONENT */                 \
-  OSVR_INLINE double osvrQuatGet##COMPONENT(OSVR_Quaternion const *q) {     \
+  OSVR_INLINE double osvrQuatGet##COMPONENT(OSVR_Quaternion const* q) {     \
     return q->data[INDEX];                                                  \
   }                                                                         \
   /** @brief Setter for quaternion component COMPONENT */                   \
-  OSVR_INLINE void osvrQuatSet##COMPONENT(OSVR_Quaternion *q, double val) { \
+  OSVR_INLINE void osvrQuatSet##COMPONENT(OSVR_Quaternion* q, double val) { \
     q->data[INDEX] = val;                                                   \
   }
 
@@ -69,7 +69,7 @@ OSVR_QUAT_MEMBER(Z, 3)
 #undef OSVR_QUAT_MEMBER
 
 /** @brief Set a quaternion to the identity rotation */
-OSVR_INLINE void osvrQuatSetIdentity(OSVR_Quaternion *q) {
+OSVR_INLINE void osvrQuatSetIdentity(OSVR_Quaternion* q) {
   osvrQuatSetW(q, 1);
   osvrQuatSetX(q, 0);
   osvrQuatSetY(q, 0);
@@ -82,7 +82,7 @@ OSVR_EXTERN_C_END
 
 #ifdef __cplusplus
 template 
-inline StreamType &operator<<(StreamType &os, OSVR_Quaternion const &quat) {
+inline StreamType& operator<<(StreamType& os, OSVR_Quaternion const& quat) {
   os << "(" << osvrQuatGetW(&quat) << ", (" << osvrQuatGetX(&quat) << ", "
      << osvrQuatGetY(&quat) << ", " << osvrQuatGetZ(&quat) << "))";
   return os;
diff --git a/gfx/vr/service/osvr/Util/QuatlibInteropC.h b/gfx/vr/service/osvr/Util/QuatlibInteropC.h
index d89427c3a6c0f..1519f02c100d4 100644
--- a/gfx/vr/service/osvr/Util/QuatlibInteropC.h
+++ b/gfx/vr/service/osvr/Util/QuatlibInteropC.h
@@ -44,36 +44,36 @@ OSVR_EXTERN_C_BEGIN
 /** @addtogroup UtilMath
     @{
 */
-OSVR_INLINE void osvrQuatToQuatlib(q_type dest, OSVR_Quaternion const *src) {
+OSVR_INLINE void osvrQuatToQuatlib(q_type dest, OSVR_Quaternion const* src) {
   dest[Q_W] = osvrQuatGetW(src);
   dest[Q_X] = osvrQuatGetX(src);
   dest[Q_Y] = osvrQuatGetY(src);
   dest[Q_Z] = osvrQuatGetZ(src);
 }
 
-OSVR_INLINE void osvrQuatFromQuatlib(OSVR_Quaternion *dest, q_type const src) {
+OSVR_INLINE void osvrQuatFromQuatlib(OSVR_Quaternion* dest, q_type const src) {
   osvrQuatSetW(dest, src[Q_W]);
   osvrQuatSetX(dest, src[Q_X]);
   osvrQuatSetY(dest, src[Q_Y]);
   osvrQuatSetZ(dest, src[Q_Z]);
 }
 
-OSVR_INLINE void osvrVec3ToQuatlib(q_vec_type dest, OSVR_Vec3 const *src) {
-  memcpy((void *)(dest), (void const *)(src->data), sizeof(double) * 3);
+OSVR_INLINE void osvrVec3ToQuatlib(q_vec_type dest, OSVR_Vec3 const* src) {
+  memcpy((void*)(dest), (void const*)(src->data), sizeof(double) * 3);
 }
 
-OSVR_INLINE void osvrVec3FromQuatlib(OSVR_Vec3 *dest, q_vec_type const src) {
-  memcpy((void *)(dest->data), (void const *)(src), sizeof(double) * 3);
+OSVR_INLINE void osvrVec3FromQuatlib(OSVR_Vec3* dest, q_vec_type const src) {
+  memcpy((void*)(dest->data), (void const*)(src), sizeof(double) * 3);
 }
 
-OSVR_INLINE void osvrPose3ToQuatlib(q_xyz_quat_type *dest,
-                                    OSVR_Pose3 const *src) {
+OSVR_INLINE void osvrPose3ToQuatlib(q_xyz_quat_type* dest,
+                                    OSVR_Pose3 const* src) {
   osvrVec3ToQuatlib(dest->xyz, &(src->translation));
   osvrQuatToQuatlib(dest->quat, &(src->rotation));
 }
 
-OSVR_INLINE void osvrPose3FromQuatlib(OSVR_Pose3 *dest,
-                                      q_xyz_quat_type const *src) {
+OSVR_INLINE void osvrPose3FromQuatlib(OSVR_Pose3* dest,
+                                      q_xyz_quat_type const* src) {
   osvrVec3FromQuatlib(&(dest->translation), src->xyz);
   osvrQuatFromQuatlib(&(dest->rotation), src->quat);
 }
diff --git a/gfx/vr/service/osvr/Util/TimeValueC.h b/gfx/vr/service/osvr/Util/TimeValueC.h
index f0b81c5955278..eb6a4f7cec8e4 100644
--- a/gfx/vr/service/osvr/Util/TimeValueC.h
+++ b/gfx/vr/service/osvr/Util/TimeValueC.h
@@ -87,7 +87,7 @@ typedef struct OSVR_TimeValue {
 
 #ifdef OSVR_HAVE_STRUCT_TIMEVAL
 /** @brief Gets the current time in the TimeValue. Parallel to gettimeofday. */
-OSVR_UTIL_EXPORT void osvrTimeValueGetNow(OSVR_OUT OSVR_TimeValue *dest)
+OSVR_UTIL_EXPORT void osvrTimeValueGetNow(OSVR_OUT OSVR_TimeValue* dest)
     OSVR_FUNC_NONNULL((1));
 
 struct timeval; /* forward declaration */
@@ -101,7 +101,7 @@ struct timeval; /* forward declaration */
    anything.
 */
 OSVR_UTIL_EXPORT void osvrTimeValueToStructTimeval(
-    OSVR_OUT struct timeval *dest, OSVR_IN_PTR const OSVR_TimeValue *src)
+    OSVR_OUT struct timeval* dest, OSVR_IN_PTR const OSVR_TimeValue* src)
     OSVR_FUNC_NONNULL((1, 2));
 
 /** @brief Converts from a TimeValue struct to your system's struct timeval.
@@ -114,7 +114,7 @@ OSVR_UTIL_EXPORT void osvrTimeValueToStructTimeval(
    anything.
 */
 OSVR_UTIL_EXPORT void osvrStructTimevalToTimeValue(
-    OSVR_OUT OSVR_TimeValue *dest, OSVR_IN_PTR const struct timeval *src)
+    OSVR_OUT OSVR_TimeValue* dest, OSVR_IN_PTR const struct timeval* src)
     OSVR_FUNC_NONNULL((1, 2));
 #endif
 
@@ -125,7 +125,7 @@ OSVR_UTIL_EXPORT void osvrStructTimevalToTimeValue(
 
     If the given pointer is NULL, this function returns without doing anything.
 */
-OSVR_UTIL_EXPORT void osvrTimeValueNormalize(OSVR_INOUT_PTR OSVR_TimeValue *tv)
+OSVR_UTIL_EXPORT void osvrTimeValueNormalize(OSVR_INOUT_PTR OSVR_TimeValue* tv)
     OSVR_FUNC_NONNULL((1));
 
 /** @brief Sums two time values, replacing the first with the result.
@@ -137,8 +137,8 @@ OSVR_UTIL_EXPORT void osvrTimeValueNormalize(OSVR_INOUT_PTR OSVR_TimeValue *tv)
 
     Both parameters are expected to be in normalized form.
 */
-OSVR_UTIL_EXPORT void osvrTimeValueSum(OSVR_INOUT_PTR OSVR_TimeValue *tvA,
-                                       OSVR_IN_PTR const OSVR_TimeValue *tvB)
+OSVR_UTIL_EXPORT void osvrTimeValueSum(OSVR_INOUT_PTR OSVR_TimeValue* tvA,
+                                       OSVR_IN_PTR const OSVR_TimeValue* tvB)
     OSVR_FUNC_NONNULL((1, 2));
 
 /** @brief Computes the difference between two time values, replacing the first
@@ -154,7 +154,7 @@ OSVR_UTIL_EXPORT void osvrTimeValueSum(OSVR_INOUT_PTR OSVR_TimeValue *tvA,
     Both parameters are expected to be in normalized form.
 */
 OSVR_UTIL_EXPORT void osvrTimeValueDifference(
-    OSVR_INOUT_PTR OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB)
+    OSVR_INOUT_PTR OSVR_TimeValue* tvA, OSVR_IN_PTR const OSVR_TimeValue* tvB)
     OSVR_FUNC_NONNULL((1, 2));
 
 /** @brief  Compares two time values (assumed to be normalized), returning
@@ -163,8 +163,8 @@ OSVR_UTIL_EXPORT void osvrTimeValueDifference(
     @return <0 if A is earlier than B, 0 if they are the same, and >0 if A
     is later than B.
 */
-OSVR_UTIL_EXPORT int osvrTimeValueCmp(OSVR_IN_PTR const OSVR_TimeValue *tvA,
-                                      OSVR_IN_PTR const OSVR_TimeValue *tvB)
+OSVR_UTIL_EXPORT int osvrTimeValueCmp(OSVR_IN_PTR const OSVR_TimeValue* tvA,
+                                      OSVR_IN_PTR const OSVR_TimeValue* tvB)
     OSVR_FUNC_NONNULL((1, 2));
 
 OSVR_EXTERN_C_END
@@ -179,8 +179,8 @@ OSVR_EXTERN_C_END
     @return Duration of timespan in seconds (floating-point)
 */
 OSVR_INLINE double osvrTimeValueDurationSeconds(
-    OSVR_IN_PTR const OSVR_TimeValue *tvA,
-    OSVR_IN_PTR const OSVR_TimeValue *tvB) {
+    OSVR_IN_PTR const OSVR_TimeValue* tvA,
+    OSVR_IN_PTR const OSVR_TimeValue* tvB) {
   OSVR_TimeValue A = *tvA;
   osvrTimeValueDifference(&A, tvB);
   double dt = A.seconds + A.microseconds / 1000000.0;
@@ -189,8 +189,8 @@ OSVR_INLINE double osvrTimeValueDurationSeconds(
 
 /** @brief True if A is later than B */
 OSVR_INLINE OSVR_CBool
-osvrTimeValueGreater(OSVR_IN_PTR const OSVR_TimeValue *tvA,
-                     OSVR_IN_PTR const OSVR_TimeValue *tvB) {
+osvrTimeValueGreater(OSVR_IN_PTR const OSVR_TimeValue* tvA,
+                     OSVR_IN_PTR const OSVR_TimeValue* tvB) {
   if (!tvA || !tvB) {
     return OSVR_FALSE;
   }
@@ -207,7 +207,7 @@ osvrTimeValueGreater(OSVR_IN_PTR const OSVR_TimeValue *tvA,
 #  include 
 
 /// Returns true if the time value is normalized. Typically used in assertions.
-inline bool osvrTimeValueIsNormalized(const OSVR_TimeValue &tv) {
+inline bool osvrTimeValueIsNormalized(const OSVR_TimeValue& tv) {
 #  ifdef __APPLE__
   // apparently standard library used on mac only has floating-point abs?
   return std::abs(double(tv.microseconds)) < 1000000 &&
@@ -218,8 +218,8 @@ inline bool osvrTimeValueIsNormalized(const OSVR_TimeValue &tv) {
 }
 
 /// True if A is later than B
-inline bool osvrTimeValueGreater(const OSVR_TimeValue &tvA,
-                                 const OSVR_TimeValue &tvB) {
+inline bool osvrTimeValueGreater(const OSVR_TimeValue& tvA,
+                                 const OSVR_TimeValue& tvB) {
   assert(osvrTimeValueIsNormalized(tvA) &&
          "First timevalue argument to comparison was not normalized!");
   assert(osvrTimeValueIsNormalized(tvB) &&
@@ -229,18 +229,18 @@ inline bool osvrTimeValueGreater(const OSVR_TimeValue &tvA,
 }
 
 /// Operator > overload for time values
-inline bool operator>(const OSVR_TimeValue &tvA, const OSVR_TimeValue &tvB) {
+inline bool operator>(const OSVR_TimeValue& tvA, const OSVR_TimeValue& tvB) {
   return osvrTimeValueGreater(tvA, tvB);
 }
 
 /// Operator < overload for time values
-inline bool operator<(const OSVR_TimeValue &tvA, const OSVR_TimeValue &tvB) {
+inline bool operator<(const OSVR_TimeValue& tvA, const OSVR_TimeValue& tvB) {
   // Change the order of arguments before forwarding.
   return osvrTimeValueGreater(tvB, tvA);
 }
 
 /// Operator == overload for time values
-inline bool operator==(const OSVR_TimeValue &tvA, const OSVR_TimeValue &tvB) {
+inline bool operator==(const OSVR_TimeValue& tvA, const OSVR_TimeValue& tvB) {
   assert(osvrTimeValueIsNormalized(tvA) &&
          "First timevalue argument to equality comparison was not normalized!");
   assert(
@@ -249,7 +249,7 @@ inline bool operator==(const OSVR_TimeValue &tvA, const OSVR_TimeValue &tvB) {
   return (tvA.seconds == tvB.seconds) && (tvA.microseconds == tvB.microseconds);
 }
 /// Operator == overload for time values
-inline bool operator!=(const OSVR_TimeValue &tvA, const OSVR_TimeValue &tvB) {
+inline bool operator!=(const OSVR_TimeValue& tvA, const OSVR_TimeValue& tvB) {
   assert(osvrTimeValueIsNormalized(tvA) &&
          "First timevalue argument to "
          "inequality comparison was not "
diff --git a/gfx/vr/service/osvr/Util/Vec2C.h b/gfx/vr/service/osvr/Util/Vec2C.h
index 7e2599daa5720..0641270c1f885 100644
--- a/gfx/vr/service/osvr/Util/Vec2C.h
+++ b/gfx/vr/service/osvr/Util/Vec2C.h
@@ -52,11 +52,11 @@ typedef struct OSVR_Vec2 {
 
 #define OSVR_VEC_MEMBER(COMPONENT, INDEX)                             \
   /** @brief Accessor for Vec2 component COMPONENT */                 \
-  OSVR_INLINE double osvrVec2Get##COMPONENT(OSVR_Vec2 const *v) {     \
+  OSVR_INLINE double osvrVec2Get##COMPONENT(OSVR_Vec2 const* v) {     \
     return v->data[INDEX];                                            \
   }                                                                   \
   /** @brief Setter for Vec2 component COMPONENT */                   \
-  OSVR_INLINE void osvrVec2Set##COMPONENT(OSVR_Vec2 *v, double val) { \
+  OSVR_INLINE void osvrVec2Set##COMPONENT(OSVR_Vec2* v, double val) { \
     v->data[INDEX] = val;                                             \
   }
 
@@ -66,7 +66,7 @@ OSVR_VEC_MEMBER(Y, 1)
 #undef OSVR_VEC_MEMBER
 
 /** @brief Set a Vec2 to the zero vector */
-OSVR_INLINE void osvrVec2Zero(OSVR_Vec2 *v) {
+OSVR_INLINE void osvrVec2Zero(OSVR_Vec2* v) {
   osvrVec2SetX(v, 0);
   osvrVec2SetY(v, 0);
 }
@@ -77,7 +77,7 @@ OSVR_EXTERN_C_END
 
 #ifdef __cplusplus
 template 
-inline StreamType &operator<<(StreamType &os, OSVR_Vec2 const &vec) {
+inline StreamType& operator<<(StreamType& os, OSVR_Vec2 const& vec) {
   os << "(" << vec.data[0] << ", " << vec.data[1] << ")";
   return os;
 }
diff --git a/gfx/vr/service/osvr/Util/Vec3C.h b/gfx/vr/service/osvr/Util/Vec3C.h
index a18dcdf432e02..f72327c05b6ea 100644
--- a/gfx/vr/service/osvr/Util/Vec3C.h
+++ b/gfx/vr/service/osvr/Util/Vec3C.h
@@ -52,11 +52,11 @@ typedef struct OSVR_Vec3 {
 
 #define OSVR_VEC_MEMBER(COMPONENT, INDEX)                             \
   /** @brief Accessor for Vec3 component COMPONENT */                 \
-  OSVR_INLINE double osvrVec3Get##COMPONENT(OSVR_Vec3 const *v) {     \
+  OSVR_INLINE double osvrVec3Get##COMPONENT(OSVR_Vec3 const* v) {     \
     return v->data[INDEX];                                            \
   }                                                                   \
   /** @brief Setter for Vec3 component COMPONENT */                   \
-  OSVR_INLINE void osvrVec3Set##COMPONENT(OSVR_Vec3 *v, double val) { \
+  OSVR_INLINE void osvrVec3Set##COMPONENT(OSVR_Vec3* v, double val) { \
     v->data[INDEX] = val;                                             \
   }
 
@@ -67,7 +67,7 @@ OSVR_VEC_MEMBER(Z, 2)
 #undef OSVR_VEC_MEMBER
 
 /** @brief Set a Vec3 to the zero vector */
-OSVR_INLINE void osvrVec3Zero(OSVR_Vec3 *v) {
+OSVR_INLINE void osvrVec3Zero(OSVR_Vec3* v) {
   osvrVec3SetX(v, 0);
   osvrVec3SetY(v, 0);
   osvrVec3SetZ(v, 0);
@@ -79,7 +79,7 @@ OSVR_EXTERN_C_END
 
 #ifdef __cplusplus
 template 
-inline StreamType &operator<<(StreamType &os, OSVR_Vec3 const &vec) {
+inline StreamType& operator<<(StreamType& os, OSVR_Vec3 const& vec) {
   os << "(" << vec.data[0] << ", " << vec.data[1] << ", " << vec.data[2] << ")";
   return os;
 }
diff --git a/hal/HalLog.h b/hal/HalLog.h
index b5d9863bf8f6a..fcf9c5edfa798 100644
--- a/hal/HalLog.h
+++ b/hal/HalLog.h
@@ -20,7 +20,7 @@ namespace mozilla {
 
 namespace hal {
 
-mozilla::LogModule *GetHalLog();
+mozilla::LogModule* GetHalLog();
 #define HAL_LOG(...) \
   MOZ_LOG(mozilla::hal::GetHalLog(), LogLevel::Debug, (__VA_ARGS__))
 #define HAL_ERR(...) \
diff --git a/hal/cocoa/CocoaSensor.mm b/hal/cocoa/CocoaSensor.mm
index 4da4c3f272a50..95bd886e7fc02 100644
--- a/hal/cocoa/CocoaSensor.mm
+++ b/hal/cocoa/CocoaSensor.mm
@@ -15,7 +15,7 @@
 using namespace mozilla::hal;
 namespace mozilla {
 namespace hal_impl {
-static nsITimer *sUpdateTimer = nullptr;
+static nsITimer* sUpdateTimer = nullptr;
 static bool sActiveSensors[NUM_SENSOR_TYPE];
 static io_connect_t sDataPort = IO_OBJECT_NULL;
 static uint64_t sLastMean = -1;
@@ -35,7 +35,7 @@ static float LMUvalueToLux(uint64_t aValue) {
   float lux = ceil(static_cast(term4 + term3 + term2 + term1 - 0.19));
   return lux > 0 ? lux : 0;
 }
-void UpdateHandler(nsITimer *aTimer, void *aClosure) {
+void UpdateHandler(nsITimer* aTimer, void* aClosure) {
   for (int i = 0; i < NUM_SENSOR_TYPE; i++) {
     if (!sActiveSensors[i]) {
       continue;
diff --git a/hal/cocoa/smslib.h b/hal/cocoa/smslib.h
index 82db5b02ca911..41604cebec6bb 100644
--- a/hal/cocoa/smslib.h
+++ b/hal/cocoa/smslib.h
@@ -118,11 +118,11 @@ int smsStartup(id logObject, SEL logSelector);
 int smsDebugStartup(id logObject, SEL logSelector);
 
 // Returns the current calibration values.
-void smsGetCalibration(sms_calibration *calibrationRecord);
+void smsGetCalibration(sms_calibration* calibrationRecord);
 
 // Sets the calibration, but does NOT store it as a preference. If the argument
 // is nil then the current calibration is set from the built-in value table.
-void smsSetCalibration(sms_calibration *calibrationRecord);
+void smsSetCalibration(sms_calibration* calibrationRecord);
 
 // Stores the current calibration values as a stored preference.
 void smsStoreCalibration(void);
@@ -137,22 +137,22 @@ void smsDeleteCalibration(void);
 
 // Fills in the accel record with calibrated acceleration data. Takes
 // 1-2ms to return a value. Returns 0 if success, error number if failure.
-int smsGetData(sms_acceleration *accel);
+int smsGetData(sms_acceleration* accel);
 
 // Fills in the accel record with uncalibrated acceleration data.
 // Returns 0 if success, error number if failure.
-int smsGetUncalibratedData(sms_acceleration *accel);
+int smsGetUncalibratedData(sms_acceleration* accel);
 
 // Returns the length of a raw block of data for the current type of sensor.
 int smsGetBufferLength(void);
 
 // Takes a pointer to accelGetRawLength() bytes; sets those bytes
 // to return value from sensor. Make darn sure the buffer length is right!
-void smsGetBufferData(char *buffer);
+void smsGetBufferData(char* buffer);
 
 // This returns an NSString describing the current calibration in
 // human-readable form. Also include a description of the machine.
-NSString *smsGetCalibrationDescription(void);
+NSString* smsGetCalibrationDescription(void);
 
 // Shuts down the accelerometer.
 void smsShutdown(void);
diff --git a/hal/cocoa/smslib.mm b/hal/cocoa/smslib.mm
index d59516a440367..1a27d404a3f13 100644
--- a/hal/cocoa/smslib.mm
+++ b/hal/cocoa/smslib.mm
@@ -66,8 +66,8 @@
 
 // Represents the configuration of a type of sensor.
 typedef struct sensorSpec {
-  const char *model;      // Prefix of model to be tested
-  const char *name;       // Name of device to be read
+  const char* model;      // Prefix of model to be tested
+  const char* name;       // Name of device to be read
   unsigned int function;  // Kernel function index
   int recordSize;         // Size of record to be sent/received
   axisStruct axes[3];     // Description of three axes (X, Y, Z)
@@ -221,20 +221,20 @@
 
 #pragma mark Internal prototypes
 
-static int getData(sms_acceleration *accel, int calibrated, id logObject, SEL logSelector);
+static int getData(sms_acceleration* accel, int calibrated, id logObject, SEL logSelector);
 static float getAxis(int which, int calibrated);
 static int signExtend(int value, int size);
-static NSString *getModelName(void);
-static NSString *getOSVersion(void);
+static NSString* getModelName(void);
+static NSString* getOSVersion(void);
 static BOOL loadCalibration(void);
 static void storeCalibration(void);
 static void defaultCalibration(void);
 static void deleteCalibration(void);
-static int prefIntRead(NSString *prefName, BOOL *success);
-static void prefIntWrite(NSString *prefName, int prefValue);
-static float prefFloatRead(NSString *prefName, BOOL *success);
-static void prefFloatWrite(NSString *prefName, float prefValue);
-static void prefDelete(NSString *prefName);
+static int prefIntRead(NSString* prefName, BOOL* success);
+static void prefIntWrite(NSString* prefName, int prefValue);
+static float prefFloatRead(NSString* prefName, BOOL* success);
+static void prefFloatWrite(NSString* prefName, float prefValue);
+static void prefDelete(NSString* prefName);
 static void prefSynchronize(void);
 // static long getMicroseconds(void);
 float fakeData(NSTimeInterval time);
@@ -245,7 +245,7 @@
 static io_connect_t connection;     // Connection for reading accel values
 static int running = NO;            // True if we successfully started
 static unsigned int sensorNum = 0;  // The current index into sensors[]
-static const char *serviceName;     // The name of the current service
+static const char* serviceName;     // The name of the current service
 static char *iRecord, *oRecord;     // Pointers to read/write records for sensor
 static int recordSize;              // Size of read/write records
 static unsigned int function;       // Which kernel function should be used
@@ -310,7 +310,7 @@ int smsStartup(id logObject, SEL logSelector) {
   running = NO;
   debugging = NO;
 
-  NSString *modelName = getModelName();
+  NSString* modelName = getModelName();
 
   LOG_ARG(@"Machine model: %@\n", modelName);
   LOG_ARG(@"OS X version: %@\n", getOSVersion());
@@ -325,7 +325,7 @@ int smsStartup(id logObject, SEL logSelector) {
     LOG_3ARG(@"Trying service \"%s\" with selector %d and %d byte record:\n", serviceName, function,
              recordSize);
 
-    NSString *targetName = [NSString stringWithCString:sensors[sensorNum].model
+    NSString* targetName = [NSString stringWithCString:sensors[sensorNum].model
                                               encoding:NSMacOSRomanStringEncoding];
     LOG_ARG(@"    Comparing model name to target \"%@\": ", targetName);
     if ([targetName length] == 0 || [modelName hasPrefix:targetName]) {
@@ -400,8 +400,8 @@ int smsStartup(id logObject, SEL logSelector) {
 
     defaultCalibration();
 
-    iRecord = (char *)malloc(recordSize);
-    oRecord = (char *)malloc(recordSize);
+    iRecord = (char*)malloc(recordSize);
+    oRecord = (char*)malloc(recordSize);
 
     running = YES;
     result = getData(&accel, true, logObject, logSelector);
@@ -439,7 +439,7 @@ int smsDebugStartup(id logObject, SEL logSelector) {
 }
 
 // Returns the current calibration values.
-void smsGetCalibration(sms_calibration *calibrationRecord) {
+void smsGetCalibration(sms_calibration* calibrationRecord) {
   int x;
 
   for (x = 0; x < 3; x++) {
@@ -450,7 +450,7 @@ void smsGetCalibration(sms_calibration *calibrationRecord) {
 
 // Sets the calibration, but does NOT store it as a preference. If the argument
 // is nil then the current calibration is set from the built-in value table.
-void smsSetCalibration(sms_calibration *calibrationRecord) {
+void smsSetCalibration(sms_calibration* calibrationRecord) {
   int x;
 
   if (!debugging) {
@@ -494,7 +494,7 @@ void smsDeleteCalibration(void) {
 
 // Fills in the accel record with calibrated acceleration data. Takes
 // 1-2ms to return a value. Returns 0 if success, error number if failure.
-int smsGetData(sms_acceleration *accel) {
+int smsGetData(sms_acceleration* accel) {
   NSTimeInterval time;
   if (debugging) {
     usleep(1500);  // Usually takes 1-2 milliseconds
@@ -510,7 +510,7 @@ int smsGetData(sms_acceleration *accel) {
 
 // Fills in the accel record with uncalibrated acceleration data.
 // Returns 0 if success, error number if failure.
-int smsGetUncalibratedData(sms_acceleration *accel) {
+int smsGetUncalibratedData(sms_acceleration* accel) {
   NSTimeInterval time;
   if (debugging) {
     usleep(1500);  // Usually takes 1-2 milliseconds
@@ -537,7 +537,7 @@ int smsGetBufferLength(void) {
 
 // Takes a pointer to accelGetRawLength() bytes; sets those bytes
 // to return value from sensor. Make darn sure the buffer length is right!
-void smsGetBufferData(char *buffer) {
+void smsGetBufferData(char* buffer) {
   IOItemCount iSize = recordSize;
   IOByteCount oSize = recordSize;
   kern_return_t result;
@@ -551,10 +551,10 @@ void smsGetBufferData(char *buffer) {
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
   const size_t InStructSize = recordSize;
   size_t OutStructSize = recordSize;
-  result = IOConnectCallStructMethod(connection,
-                                     function,  // magic kernel function number
-                                     (const void *)iRecord, InStructSize, (void *)buffer,
-                                     &OutStructSize);
+  result =
+      IOConnectCallStructMethod(connection,
+                                function,  // magic kernel function number
+                                (const void*)iRecord, InStructSize, (void*)buffer, &OutStructSize);
 #else   // __MAC_OS_X_VERSION_MIN_REQUIRED 1050
   result = IOConnectMethodStructureIStructureO(connection,
                                                function,  // magic kernel function number
@@ -568,9 +568,9 @@ void smsGetBufferData(char *buffer) {
 
 // This returns an NSString describing the current calibration in
 // human-readable form. Also include a description of the machine.
-NSString *smsGetCalibrationDescription(void) {
+NSString* smsGetCalibrationDescription(void) {
   BOOL success;
-  NSMutableString *s = [[NSMutableString alloc] init];
+  NSMutableString* s = [[NSMutableString alloc] init];
 
   if (debugging) {
     [s release];
@@ -667,7 +667,7 @@ static void deleteCalibration(void) {
 
 // Read a named floating point value from the stored preferences. Sets
 // the success boolean based on, you guessed it, whether it succeeds.
-static float prefFloatRead(NSString *prefName, BOOL *success) {
+static float prefFloatRead(NSString* prefName, BOOL* success) {
   float result = 0.0f;
 
   CFPropertyListRef ref = CFPreferencesCopyAppValue((CFStringRef)prefName, APP_ID);
@@ -682,7 +682,7 @@ static float prefFloatRead(NSString *prefName, BOOL *success) {
     // Is it a floating point number?
     if (CFNumberIsFloatType((CFNumberRef)ref)) {
       // Yup: grab it.
-      *success = CFNumberGetValue((__CFNumber *)ref, kCFNumberFloat32Type, &result);
+      *success = CFNumberGetValue((__CFNumber*)ref, kCFNumberFloat32Type, &result);
     } else {
       // Nope: grab as an integer, and convert to a float.
       long num;
@@ -706,14 +706,14 @@ static float prefFloatRead(NSString *prefName, BOOL *success) {
 }
 
 // Writes a named floating point value to the stored preferences.
-static void prefFloatWrite(NSString *prefName, float prefValue) {
+static void prefFloatWrite(NSString* prefName, float prefValue) {
   CFNumberRef cfFloat = CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &prefValue);
   CFPreferencesSetAppValue((CFStringRef)prefName, cfFloat, APP_ID);
   CFRelease(cfFloat);
 }
 
 // Reads a named integer value from the stored preferences.
-static int prefIntRead(NSString *prefName, BOOL *success) {
+static int prefIntRead(NSString* prefName, BOOL* success) {
   Boolean internalSuccess;
   CFIndex result = CFPreferencesGetAppIntegerValue((CFStringRef)prefName, APP_ID, &internalSuccess);
   *success = internalSuccess;
@@ -722,13 +722,13 @@ static int prefIntRead(NSString *prefName, BOOL *success) {
 }
 
 // Writes a named integer value to the stored preferences.
-static void prefIntWrite(NSString *prefName, int prefValue) {
+static void prefIntWrite(NSString* prefName, int prefValue) {
   CFPreferencesSetAppValue((CFStringRef)prefName, (CFNumberRef)[NSNumber numberWithInt:prefValue],
                            APP_ID);
 }
 
 // Deletes the named preference values.
-static void prefDelete(NSString *prefName) {
+static void prefDelete(NSString* prefName) {
   CFPreferencesSetAppValue((CFStringRef)prefName, NULL, APP_ID);
 }
 
@@ -736,7 +736,7 @@ static void prefDelete(NSString *prefName) {
 static void prefSynchronize(void) { CFPreferencesAppSynchronize(APP_ID); }
 
 // Internal version of accelGetData, with logging
-int getData(sms_acceleration *accel, int calibrated, id logObject, SEL logSelector) {
+int getData(sms_acceleration* accel, int calibrated, id logObject, SEL logSelector) {
   IOItemCount iSize = recordSize;
   IOByteCount oSize = recordSize;
   kern_return_t result;
@@ -754,10 +754,10 @@ int getData(sms_acceleration *accel, int calibrated, id logObject, SEL logSelect
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
   const size_t InStructSize = recordSize;
   size_t OutStructSize = recordSize;
-  result = IOConnectCallStructMethod(connection,
-                                     function,  // magic kernel function number
-                                     (const void *)iRecord, InStructSize, (void *)oRecord,
-                                     &OutStructSize);
+  result =
+      IOConnectCallStructMethod(connection,
+                                function,  // magic kernel function number
+                                (const void*)iRecord, InStructSize, (void*)oRecord, &OutStructSize);
 #else   // __MAC_OS_X_VERSION_MIN_REQUIRED 1050
   result = IOConnectMethodStructureIStructureO(connection,
                                                function,  // magic kernel function number
@@ -793,7 +793,7 @@ float getAxis(int which, int calibrated) {
   // endianness, we still have to get it into the proper end of value.
 #if (BYTE_ORDER == BIG_ENDIAN)
   // On PowerPC processors
-  memcpy(((char *)&value) + (sizeof(int) - size), &oRecord[indx], size);
+  memcpy(((char*)&value) + (sizeof(int) - size), &oRecord[indx], size);
 #endif
 #if (BYTE_ORDER == LITTLE_ENDIAN)
   // On Intel processors
@@ -828,11 +828,11 @@ int signExtend(int value, int size) {
 }
 
 // Returns the model name of the computer (e.g. "MacBookPro1,1")
-NSString *getModelName(void) {
+NSString* getModelName(void) {
   char model[32];
   size_t len = sizeof(model);
   int name[2] = {CTL_HW, HW_MODEL};
-  NSString *result;
+  NSString* result;
 
   if (sysctl(name, 2, &model, &len, NULL, 0) == 0) {
     result = [NSString stringWithFormat:@"%s", model];
@@ -844,12 +844,12 @@ int signExtend(int value, int size) {
 }
 
 // Returns the current OS X version and build (e.g. "10.4.7 (build 8J2135a)")
-NSString *getOSVersion(void) {
-  NSDictionary *dict = [NSDictionary
+NSString* getOSVersion(void) {
+  NSDictionary* dict = [NSDictionary
       dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
-  NSString *versionString = [dict objectForKey:@"ProductVersion"];
-  NSString *buildString = [dict objectForKey:@"ProductBuildVersion"];
-  NSString *wholeString = [NSString stringWithFormat:@"%@ (build %@)", versionString, buildString];
+  NSString* versionString = [dict objectForKey:@"ProductVersion"];
+  NSString* buildString = [dict objectForKey:@"ProductBuildVersion"];
+  NSString* wholeString = [NSString stringWithFormat:@"%@ (build %@)", versionString, buildString];
   return wholeString;
 }
 
diff --git a/hal/fallback/FallbackVibration.cpp b/hal/fallback/FallbackVibration.cpp
index c2a2d31a62be5..13db8a0a8a5d9 100644
--- a/hal/fallback/FallbackVibration.cpp
+++ b/hal/fallback/FallbackVibration.cpp
@@ -11,10 +11,9 @@ using mozilla::hal::WindowIdentifier;
 namespace mozilla {
 namespace hal_impl {
 
-void Vibrate(const nsTArray &pattern, const hal::WindowIdentifier &) {
-}
+void Vibrate(const nsTArray& pattern, const hal::WindowIdentifier&) {}
 
-void CancelVibrate(const hal::WindowIdentifier &) {}
+void CancelVibrate(const hal::WindowIdentifier&) {}
 
 }  // namespace hal_impl
 }  // namespace mozilla
diff --git a/hal/windows/WindowsSensor.cpp b/hal/windows/WindowsSensor.cpp
index 52c91a4a8d992..27898c2787e37 100644
--- a/hal/windows/WindowsSensor.cpp
+++ b/hal/windows/WindowsSensor.cpp
@@ -35,11 +35,11 @@ class SensorEvent final : public ISensorEvents {
     return count;
   }
 
-  STDMETHODIMP QueryInterface(REFIID iid, void **ppv) {
+  STDMETHODIMP QueryInterface(REFIID iid, void** ppv) {
     if (iid == IID_IUnknown) {
-      *ppv = static_cast(this);
+      *ppv = static_cast(this);
     } else if (iid == IID_ISensorEvents) {
-      *ppv = static_cast(this);
+      *ppv = static_cast(this);
     } else {
       return E_NOINTERFACE;
     }
@@ -49,18 +49,18 @@ class SensorEvent final : public ISensorEvents {
 
   // ISensorEvents interface
 
-  STDMETHODIMP OnEvent(ISensor *aSensor, REFGUID aId,
-                       IPortableDeviceValues *aData) {
+  STDMETHODIMP OnEvent(ISensor* aSensor, REFGUID aId,
+                       IPortableDeviceValues* aData) {
     return S_OK;
   }
 
   STDMETHODIMP OnLeave(REFSENSOR_ID aId) { return S_OK; }
 
-  STDMETHODIMP OnStateChanged(ISensor *aSensor, SensorState state) {
+  STDMETHODIMP OnStateChanged(ISensor* aSensor, SensorState state) {
     return S_OK;
   }
 
-  STDMETHODIMP OnDataUpdated(ISensor *aSensor, ISensorDataReport *aReport) {
+  STDMETHODIMP OnDataUpdated(ISensor* aSensor, ISensorDataReport* aReport) {
     PROPVARIANT v;
     HRESULT hr;
     InfallibleTArray values;
diff --git a/image/decoders/icon/nsIconURI.h b/image/decoders/icon/nsIconURI.h
index d0c2bcc300a90..8b24ff92f378a 100644
--- a/image/decoders/icon/nsIconURI.h
+++ b/image/decoders/icon/nsIconURI.h
@@ -41,22 +41,22 @@ class nsMozIconURI final : public nsIMozIconURI, public nsINestedURI {
                        // kStateStrings
 
  private:
-  nsresult Clone(nsIURI **aURI);
-  nsresult SetSpecInternal(const nsACString &input);
-  nsresult SetScheme(const nsACString &input);
-  nsresult SetUserPass(const nsACString &input);
-  nsresult SetUsername(const nsACString &input);
-  nsresult SetPassword(const nsACString &input);
-  nsresult SetHostPort(const nsACString &aValue);
-  nsresult SetHost(const nsACString &input);
+  nsresult Clone(nsIURI** aURI);
+  nsresult SetSpecInternal(const nsACString& input);
+  nsresult SetScheme(const nsACString& input);
+  nsresult SetUserPass(const nsACString& input);
+  nsresult SetUsername(const nsACString& input);
+  nsresult SetPassword(const nsACString& input);
+  nsresult SetHostPort(const nsACString& aValue);
+  nsresult SetHost(const nsACString& input);
   nsresult SetPort(int32_t port);
-  nsresult SetPathQueryRef(const nsACString &input);
-  nsresult SetRef(const nsACString &input);
-  nsresult SetFilePath(const nsACString &input);
-  nsresult SetQuery(const nsACString &input);
-  nsresult SetQueryWithEncoding(const nsACString &input,
-                                const mozilla::Encoding *encoding);
-  bool Deserialize(const mozilla::ipc::URIParams &);
+  nsresult SetPathQueryRef(const nsACString& input);
+  nsresult SetRef(const nsACString& input);
+  nsresult SetFilePath(const nsACString& input);
+  nsresult SetQuery(const nsACString& input);
+  nsresult SetQueryWithEncoding(const nsACString& input,
+                                const mozilla::Encoding* encoding);
+  bool Deserialize(const mozilla::ipc::URIParams&);
 
  public:
   class Mutator final : public nsIURIMutator,
@@ -64,17 +64,17 @@ class nsMozIconURI final : public nsIMozIconURI, public nsINestedURI {
     NS_DECL_ISUPPORTS
     NS_FORWARD_SAFE_NSIURISETTERS_RET(mURI)
 
-    NS_IMETHOD Deserialize(const mozilla::ipc::URIParams &aParams) override {
+    NS_IMETHOD Deserialize(const mozilla::ipc::URIParams& aParams) override {
       return InitFromIPCParams(aParams);
     }
 
-    NS_IMETHOD Finalize(nsIURI **aURI) override {
+    NS_IMETHOD Finalize(nsIURI** aURI) override {
       mURI.forget(aURI);
       return NS_OK;
     }
 
-    NS_IMETHOD SetSpec(const nsACString &aSpec,
-                       nsIURIMutator **aMutator) override {
+    NS_IMETHOD SetSpec(const nsACString& aSpec,
+                       nsIURIMutator** aMutator) override {
       if (aMutator) {
         nsCOMPtr mutator = this;
         mutator.forget(aMutator);
diff --git a/intl/hyphenation/glue/nsHyphenationManager.cpp b/intl/hyphenation/glue/nsHyphenationManager.cpp
index 273cdd113260a..70fac41e53c23 100644
--- a/intl/hyphenation/glue/nsHyphenationManager.cpp
+++ b/intl/hyphenation/glue/nsHyphenationManager.cpp
@@ -28,14 +28,14 @@ using namespace mozilla;
 static const char kIntlHyphenationAliasPrefix[] = "intl.hyphenation-alias.";
 static const char kMemoryPressureNotification[] = "memory-pressure";
 
-nsHyphenationManager *nsHyphenationManager::sInstance = nullptr;
+nsHyphenationManager* nsHyphenationManager::sInstance = nullptr;
 
 NS_IMPL_ISUPPORTS(nsHyphenationManager::MemoryPressureObserver, nsIObserver)
 
 NS_IMETHODIMP
-nsHyphenationManager::MemoryPressureObserver::Observe(nsISupports *aSubject,
-                                                      const char *aTopic,
-                                                      const char16_t *aData) {
+nsHyphenationManager::MemoryPressureObserver::Observe(nsISupports* aSubject,
+                                                      const char* aTopic,
+                                                      const char16_t* aData) {
   if (!nsCRT::strcmp(aTopic, kMemoryPressureNotification)) {
     // We don't call Instance() here, as we don't want to create a hyphenation
     // manager if there isn't already one in existence.
@@ -48,7 +48,7 @@ nsHyphenationManager::MemoryPressureObserver::Observe(nsISupports *aSubject,
   return NS_OK;
 }
 
-nsHyphenationManager *nsHyphenationManager::Instance() {
+nsHyphenationManager* nsHyphenationManager::Instance() {
   if (sInstance == nullptr) {
     sInstance = new nsHyphenationManager();
 
@@ -74,7 +74,7 @@ nsHyphenationManager::nsHyphenationManager() {
 nsHyphenationManager::~nsHyphenationManager() { sInstance = nullptr; }
 
 already_AddRefed nsHyphenationManager::GetHyphenator(
-    nsAtom *aLocale) {
+    nsAtom* aLocale) {
   RefPtr hyph;
   mHyphenators.Get(aLocale, getter_AddRefs(hyph));
   if (hyph) {
@@ -178,13 +178,13 @@ void nsHyphenationManager::LoadPatternListFromOmnijar(Omnijar::Type aType) {
     return;
   }
 
-  nsZipFind *find;
+  nsZipFind* find;
   zip->FindInit("hyphenation/hyph_*.dic", &find);
   if (!find) {
     return;
   }
 
-  const char *result;
+  const char* result;
   uint16_t len;
   while (NS_SUCCEEDED(find->FindNext(&result, &len))) {
     nsCString uriString(base);
@@ -219,7 +219,7 @@ void nsHyphenationManager::LoadPatternListFromOmnijar(Omnijar::Type aType) {
   delete find;
 }
 
-void nsHyphenationManager::LoadPatternListFromDir(nsIFile *aDir) {
+void nsHyphenationManager::LoadPatternListFromDir(nsIFile* aDir) {
   nsresult rv;
 
   bool check = false;
@@ -271,12 +271,12 @@ void nsHyphenationManager::LoadPatternListFromDir(nsIFile *aDir) {
 }
 
 void nsHyphenationManager::LoadAliases() {
-  nsIPrefBranch *prefRootBranch = Preferences::GetRootBranch();
+  nsIPrefBranch* prefRootBranch = Preferences::GetRootBranch();
   if (!prefRootBranch) {
     return;
   }
   uint32_t prefCount;
-  char **prefNames;
+  char** prefNames;
   nsresult rv = prefRootBranch->GetChildList(kIntlHyphenationAliasPrefix,
                                              &prefCount, &prefNames);
   if (NS_SUCCEEDED(rv) && prefCount > 0) {
diff --git a/intl/hyphenation/glue/nsHyphenationManager.h b/intl/hyphenation/glue/nsHyphenationManager.h
index 1b00e9607c0dd..b3d0b957ec8cf 100644
--- a/intl/hyphenation/glue/nsHyphenationManager.h
+++ b/intl/hyphenation/glue/nsHyphenationManager.h
@@ -20,9 +20,9 @@ class nsHyphenationManager {
  public:
   nsHyphenationManager();
 
-  already_AddRefed GetHyphenator(nsAtom *aLocale);
+  already_AddRefed GetHyphenator(nsAtom* aLocale);
 
-  static nsHyphenationManager *Instance();
+  static nsHyphenationManager* Instance();
 
   static void Shutdown();
 
@@ -40,14 +40,14 @@ class nsHyphenationManager {
 
   void LoadPatternList();
   void LoadPatternListFromOmnijar(mozilla::Omnijar::Type aType);
-  void LoadPatternListFromDir(nsIFile *aDir);
+  void LoadPatternListFromDir(nsIFile* aDir);
   void LoadAliases();
 
   nsRefPtrHashtable, nsAtom> mHyphAliases;
   nsInterfaceHashtable, nsIURI> mPatternFiles;
   nsRefPtrHashtable, nsHyphenator> mHyphenators;
 
-  static nsHyphenationManager *sInstance;
+  static nsHyphenationManager* sInstance;
 };
 
 #endif  // nsHyphenationManager_h__
diff --git a/intl/hyphenation/glue/nsHyphenator.cpp b/intl/hyphenation/glue/nsHyphenator.cpp
index ff6354e146a17..6b8fd0e25c64b 100644
--- a/intl/hyphenation/glue/nsHyphenator.cpp
+++ b/intl/hyphenation/glue/nsHyphenator.cpp
@@ -11,7 +11,7 @@
 
 #include "hyphen.h"
 
-nsHyphenator::nsHyphenator(nsIURI *aURI) : mDict(nullptr) {
+nsHyphenator::nsHyphenator(nsIURI* aURI) : mDict(nullptr) {
   nsCString uriSpec;
   nsresult rv = aURI->GetSpec(uriSpec);
   if (NS_FAILED(rv)) {
@@ -27,15 +27,15 @@ nsHyphenator::nsHyphenator(nsIURI *aURI) : mDict(nullptr) {
 
 nsHyphenator::~nsHyphenator() {
   if (mDict != nullptr) {
-    hnj_hyphen_free((HyphenDict *)mDict);
+    hnj_hyphen_free((HyphenDict*)mDict);
     mDict = nullptr;
   }
 }
 
 bool nsHyphenator::IsValid() { return (mDict != nullptr); }
 
-nsresult nsHyphenator::Hyphenate(const nsAString &aString,
-                                 nsTArray &aHyphens) {
+nsresult nsHyphenator::Hyphenate(const nsAString& aString,
+                                 nsTArray& aHyphens) {
   if (!aHyphens.SetLength(aString.Length(), mozilla::fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
@@ -73,9 +73,9 @@ nsresult nsHyphenator::Hyphenate(const nsAString &aString,
       // Convert the word to utf-8 for libhyphen, lowercasing it as we go
       // so that it will match the (lowercased) patterns (bug 1105644).
       nsAutoCString utf8;
-      const char16_t *const begin = aString.BeginReading();
-      const char16_t *cur = begin + wordStart;
-      const char16_t *end = begin + wordLimit;
+      const char16_t* const begin = aString.BeginReading();
+      const char16_t* cur = begin + wordStart;
+      const char16_t* end = begin + wordLimit;
       while (cur < end) {
         uint32_t ch = *cur++;
 
@@ -113,10 +113,10 @@ nsresult nsHyphenator::Hyphenate(const nsAString &aString,
 
       AutoTArray utf8hyphens;
       utf8hyphens.SetLength(utf8.Length() + 5);
-      char **rep = nullptr;
-      int *pos = nullptr;
-      int *cut = nullptr;
-      int err = hnj_hyphen_hyphenate2((HyphenDict *)mDict, utf8.BeginReading(),
+      char** rep = nullptr;
+      int* pos = nullptr;
+      int* cut = nullptr;
+      int err = hnj_hyphen_hyphenate2((HyphenDict*)mDict, utf8.BeginReading(),
                                       utf8.Length(), utf8hyphens.Elements(),
                                       nullptr, &rep, &pos, &cut);
       if (!err) {
@@ -124,9 +124,9 @@ nsresult nsHyphenator::Hyphenate(const nsAString &aString,
         // from utf8 code unit indexing (which would match the utf8 input
         // string directly) to Unicode character indexing.
         // We then need to convert this to utf16 code unit offsets for Gecko.
-        const char *hyphPtr = utf8hyphens.Elements();
-        const char16_t *cur = begin + wordStart;
-        const char16_t *end = begin + wordLimit;
+        const char* hyphPtr = utf8hyphens.Elements();
+        const char16_t* cur = begin + wordStart;
+        const char16_t* end = begin + wordLimit;
         while (cur < end) {
           if (*hyphPtr & 0x01) {
             aHyphens[cur - begin] = true;
diff --git a/intl/lwbrk/rulebrk.h b/intl/lwbrk/rulebrk.h
index 5067f08b40c14..c1f2e0957b2b0 100644
--- a/intl/lwbrk/rulebrk.h
+++ b/intl/lwbrk/rulebrk.h
@@ -16,9 +16,9 @@ purpose.  It is provided "as is" without express or implied warranty.
 extern "C" {
 #endif
 
-int TrbWordBreakPos(const th_char *pstr, int left, const th_char *rstr,
+int TrbWordBreakPos(const th_char* pstr, int left, const th_char* rstr,
                     int right);
-int TrbFollowing(const th_char *begin, int length, int offset);
+int TrbFollowing(const th_char* begin, int length, int offset);
 
 #ifdef __cplusplus
 }
diff --git a/intl/uconv/nsConverterInputStream.h b/intl/uconv/nsConverterInputStream.h
index b54d83a50c385..2235359c484fa 100644
--- a/intl/uconv/nsConverterInputStream.h
+++ b/intl/uconv/nsConverterInputStream.h
@@ -45,7 +45,7 @@ class nsConverterInputStream : public nsIConverterInputStream,
  private:
   virtual ~nsConverterInputStream() { Close(); }
 
-  uint32_t Fill(nsresult *aErrorCode);
+  uint32_t Fill(nsresult* aErrorCode);
 
   mozilla::UniquePtr mConverter;
   FallibleTArray mByteData;
diff --git a/ipc/app/MozillaRuntimeMain.cpp b/ipc/app/MozillaRuntimeMain.cpp
index 831e80611a18d..d0ab944a30078 100644
--- a/ipc/app/MozillaRuntimeMain.cpp
+++ b/ipc/app/MozillaRuntimeMain.cpp
@@ -11,7 +11,7 @@
 
 using namespace mozilla;
 
-int main(int argc, char *argv[]) {
+int main(int argc, char* argv[]) {
 #ifdef HAS_DLL_BLOCKLIST
   DllBlocklist_Initialize(eDllBlocklistInitFlagIsChildProcess);
 #endif
diff --git a/ipc/chromium/src/base/basictypes.h b/ipc/chromium/src/base/basictypes.h
index e0c30f2e33711..8cd84bee59ed5 100644
--- a/ipc/chromium/src/base/basictypes.h
+++ b/ipc/chromium/src/base/basictypes.h
@@ -50,8 +50,8 @@ const int64_t kint64max = ((int64_t)GG_LONGLONG(0x7FFFFFFFFFFFFFFF));
 // This should be used in the private: declarations for a class
 #undef DISALLOW_COPY_AND_ASSIGN
 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
-  TypeName(const TypeName &);              \
-  void operator=(const TypeName &)
+  TypeName(const TypeName&);               \
+  void operator=(const TypeName&)
 
 // An older, deprecated, politically incorrect name for the above.
 #undef DISALLOW_EVIL_CONSTRUCTORS
@@ -154,7 +154,7 @@ char (&ArraySizeHelper(const T (&array)[N]))[N];
 // but the proposal was submitted too late.  It will probably make
 // its way into the language in the future.
 template 
-inline To implicit_cast(From const &f) {
+inline To implicit_cast(From const& f) {
   return f;
 }
 
diff --git a/ipc/chromium/src/chrome/common/mach_ipc_mac.h b/ipc/chromium/src/chrome/common/mach_ipc_mac.h
index 41f76687efb38..d9a8483600baf 100644
--- a/ipc/chromium/src/chrome/common/mach_ipc_mac.h
+++ b/ipc/chromium/src/chrome/common/mach_ipc_mac.h
@@ -97,7 +97,7 @@ class MachMsgPortDescriptor : public mach_msg_port_descriptor_t {
   }
 
   // Copy constructor
-  MachMsgPortDescriptor(const MachMsgPortDescriptor &desc) {
+  MachMsgPortDescriptor(const MachMsgPortDescriptor& desc) {
     name = desc.name;
     pad1 = desc.pad1;
     pad2 = desc.pad2;
@@ -136,7 +136,7 @@ class MachMessage {
   virtual ~MachMessage();
 
   // The receiver of the message can retrieve the raw data this way
-  u_int8_t *GetData() {
+  u_int8_t* GetData() {
     return GetDataLength() > 0 ? GetDataPacket()->data : NULL;
   }
 
@@ -149,12 +149,12 @@ class MachMessage {
 
   // Adds a descriptor (typically a mach port) to be translated
   // returns true if successful, otherwise not enough space
-  bool AddDescriptor(const MachMsgPortDescriptor &desc);
+  bool AddDescriptor(const MachMsgPortDescriptor& desc);
 
   int GetDescriptorCount() const {
     return storage_->body.msgh_descriptor_count;
   }
-  MachMsgPortDescriptor *GetDescriptor(int n);
+  MachMsgPortDescriptor* GetDescriptor(int n);
 
   // Convenience method which gets the mach port described by the descriptor
   mach_port_t GetTranslatedPort(int n);
@@ -163,7 +163,7 @@ class MachMessage {
   bool IsSimpleMessage() const { return GetDescriptorCount() == 0; }
 
   // Sets raw data for the message (returns false if not enough space)
-  bool SetData(const void *data, int32_t data_length);
+  bool SetData(const void* data, int32_t data_length);
 
  protected:
   // Consider this an abstract base class - must create an actual instance
@@ -172,7 +172,7 @@ class MachMessage {
 
   // Constructor for use with preallocate storage.
   // storage_length must be >= EmptyMessageSize()
-  MachMessage(void *storage, size_t storage_length);
+  MachMessage(void* storage, size_t storage_length);
 
   friend class ReceivePort;
   friend class MachPortSender;
@@ -184,10 +184,10 @@ class MachMessage {
     u_int8_t data[1];     // actual size limited by storage_length_bytes_
   };
 
-  MessageDataPacket *GetDataPacket();
+  MessageDataPacket* GetDataPacket();
 
   void SetDescriptorCount(int n);
-  void SetDescriptor(int n, const MachMsgPortDescriptor &desc);
+  void SetDescriptor(int n, const MachMsgPortDescriptor& desc);
 
   // Returns total message size setting msgh_size in the header to this value
   int CalculateSize();
@@ -197,7 +197,7 @@ class MachMessage {
   size_t MaxSize() const { return storage_length_bytes_; }
 
  protected:
-  mach_msg_header_t *Head() { return &(storage_->head); }
+  mach_msg_header_t* Head() { return &(storage_->head); }
 
  private:
   struct MachMessageData {
@@ -216,7 +216,7 @@ class MachMessage {
                                           sizeof(MessageDataPacket);
 
  private:
-  MachMessageData *storage_;
+  MachMessageData* storage_;
   size_t storage_length_bytes_;
   bool own_storage_;  // Is storage owned by this object?
 };
@@ -232,7 +232,7 @@ class MachMessage {
 class MachReceiveMessage : public MachMessage {
  public:
   MachReceiveMessage() : MachMessage() {}
-  MachReceiveMessage(void *storage, size_t storage_length)
+  MachReceiveMessage(void* storage, size_t storage_length)
       : MachMessage(storage, storage_length) {}
 
  private:
@@ -243,7 +243,7 @@ class MachReceiveMessage : public MachMessage {
 class MachSendMessage : public MachMessage {
  public:
   explicit MachSendMessage(int32_t message_id);
-  MachSendMessage(void *storage, size_t storage_length, int32_t message_id);
+  MachSendMessage(void* storage, size_t storage_length, int32_t message_id);
 
  private:
   void Initialize(int32_t message_id);
@@ -256,7 +256,7 @@ class MachSendMessage : public MachMessage {
 class ReceivePort {
  public:
   // Creates a new mach port for receiving messages and registers a name for it
-  explicit ReceivePort(const char *receive_port_name);
+  explicit ReceivePort(const char* receive_port_name);
 
   // Given an already existing mach port, use it.  We take ownership of the
   // port and deallocate it in our destructor.
@@ -268,10 +268,10 @@ class ReceivePort {
   ~ReceivePort();
 
   // Waits on the mach port until message received or timeout
-  kern_return_t WaitForMessage(MachReceiveMessage *out_message,
+  kern_return_t WaitForMessage(MachReceiveMessage* out_message,
                                mach_msg_timeout_t timeout);
 
-  kern_return_t SendMessageToSelf(MachSendMessage &msg,
+  kern_return_t SendMessageToSelf(MachSendMessage& msg,
                                   mach_msg_timeout_t timeout);
 
   // The underlying mach port that we wrap
@@ -289,12 +289,12 @@ class ReceivePort {
 class MachPortSender {
  public:
   // get a port with send rights corresponding to a named registered service
-  explicit MachPortSender(const char *receive_port_name);
+  explicit MachPortSender(const char* receive_port_name);
 
   // Given an already existing mach port, use it.
   explicit MachPortSender(mach_port_t send_port);
 
-  kern_return_t SendMessage(MachSendMessage &message,
+  kern_return_t SendMessage(MachSendMessage& message,
                             mach_msg_timeout_t timeout);
 
  private:
diff --git a/ipc/chromium/src/chrome/common/mach_ipc_mac.mm b/ipc/chromium/src/chrome/common/mach_ipc_mac.mm
index bf07a6236ae92..f0c56717821e4 100644
--- a/ipc/chromium/src/chrome/common/mach_ipc_mac.mm
+++ b/ipc/chromium/src/chrome/common/mach_ipc_mac.mm
@@ -12,7 +12,7 @@
 //==============================================================================
 MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() { Initialize(message_id); }
 
-MachSendMessage::MachSendMessage(void *storage, size_t storage_length, int32_t message_id)
+MachSendMessage::MachSendMessage(void* storage, size_t storage_length, int32_t message_id)
     : MachMessage(storage, storage_length) {
   Initialize(message_id);
 }
@@ -40,8 +40,8 @@
 }
 
 //==============================================================================
-MachMessage::MachMessage(void *storage, size_t storage_length)
-    : storage_(static_cast(storage)),
+MachMessage::MachMessage(void* storage, size_t storage_length)
+    : storage_(static_cast(storage)),
       storage_length_bytes_(storage_length),
       own_storage_(false) {
   DCHECK(storage);
@@ -67,7 +67,7 @@
 
 //==============================================================================
 // returns true if successful
-bool MachMessage::SetData(const void *data, int32_t data_length) {
+bool MachMessage::SetData(const void* data, int32_t data_length) {
   // Enforce the fact that it's only safe to call this method once on a
   // message.
   DCHECK(GetDataPacket()->data_length == 0);
@@ -109,22 +109,22 @@
 }
 
 //==============================================================================
-MachMessage::MessageDataPacket *MachMessage::GetDataPacket() {
+MachMessage::MessageDataPacket* MachMessage::GetDataPacket() {
   int desc_size = sizeof(MachMsgPortDescriptor) * GetDescriptorCount();
-  MessageDataPacket *packet = reinterpret_cast(storage_->padding + desc_size);
+  MessageDataPacket* packet = reinterpret_cast(storage_->padding + desc_size);
 
   return packet;
 }
 
 //==============================================================================
-void MachMessage::SetDescriptor(int n, const MachMsgPortDescriptor &desc) {
-  MachMsgPortDescriptor *desc_array = reinterpret_cast(storage_->padding);
+void MachMessage::SetDescriptor(int n, const MachMsgPortDescriptor& desc) {
+  MachMsgPortDescriptor* desc_array = reinterpret_cast(storage_->padding);
   desc_array[n] = desc;
 }
 
 //==============================================================================
 // returns true if successful otherwise there was not enough space
-bool MachMessage::AddDescriptor(const MachMsgPortDescriptor &desc) {
+bool MachMessage::AddDescriptor(const MachMsgPortDescriptor& desc) {
   // first check to make sure we have enough space
   int size = CalculateSize();
   int new_size = size + sizeof(MachMsgPortDescriptor);
@@ -135,7 +135,7 @@
 
   // unfortunately, we need to move the data to allow space for the
   // new descriptor
-  u_int8_t *p = reinterpret_cast(GetDataPacket());
+  u_int8_t* p = reinterpret_cast(GetDataPacket());
   bcopy(p, p + sizeof(MachMsgPortDescriptor), GetDataLength() + 2 * sizeof(int32_t));
 
   SetDescriptor(GetDescriptorCount(), desc);
@@ -158,9 +158,9 @@
 }
 
 //==============================================================================
-MachMsgPortDescriptor *MachMessage::GetDescriptor(int n) {
+MachMsgPortDescriptor* MachMessage::GetDescriptor(int n) {
   if (n < GetDescriptorCount()) {
-    MachMsgPortDescriptor *desc = reinterpret_cast(storage_->padding);
+    MachMsgPortDescriptor* desc = reinterpret_cast(storage_->padding);
     return desc + n;
   }
 
@@ -179,7 +179,7 @@
 
 //==============================================================================
 // create a new mach port for receiving messages and register a name for it
-ReceivePort::ReceivePort(const char *receive_port_name) {
+ReceivePort::ReceivePort(const char* receive_port_name) {
   mach_port_t current_task = mach_task_self();
 
   init_result_ = mach_port_allocate(current_task, MACH_PORT_RIGHT_RECEIVE, &port_);
@@ -190,8 +190,8 @@
 
   if (init_result_ != KERN_SUCCESS) return;
 
-  NSPort *ns_port = [NSMachPort portWithMachPort:port_];
-  NSString *port_name = [NSString stringWithUTF8String:receive_port_name];
+  NSPort* ns_port = [NSMachPort portWithMachPort:port_];
+  NSString* port_name = [NSString stringWithUTF8String:receive_port_name];
   [[NSMachBootstrapServer sharedInstance] registerPort:ns_port name:port_name];
 }
 
@@ -219,7 +219,7 @@
 }
 
 //==============================================================================
-kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage *out_message,
+kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage* out_message,
                                           mach_msg_timeout_t timeout) {
   if (!out_message) {
     return KERN_INVALID_ARGUMENT;
@@ -245,7 +245,7 @@
 
 //==============================================================================
 // send a message to this port
-kern_return_t ReceivePort::SendMessageToSelf(MachSendMessage &message, mach_msg_timeout_t timeout) {
+kern_return_t ReceivePort::SendMessageToSelf(MachSendMessage& message, mach_msg_timeout_t timeout) {
   if (message.Head()->msgh_size == 0) {
     NOTREACHED();
     return KERN_INVALID_VALUE;  // just for safety -- never should occur
@@ -268,14 +268,14 @@
 
 //==============================================================================
 // get a port with send rights corresponding to a named registered service
-MachPortSender::MachPortSender(const char *receive_port_name) {
+MachPortSender::MachPortSender(const char* receive_port_name) {
   mach_port_t bootstrap_port = 0;
   init_result_ = task_get_bootstrap_port(mach_task_self(), &bootstrap_port);
 
   if (init_result_ != KERN_SUCCESS) return;
 
   init_result_ =
-      bootstrap_look_up(bootstrap_port, const_cast(receive_port_name), &send_port_);
+      bootstrap_look_up(bootstrap_port, const_cast(receive_port_name), &send_port_);
 }
 
 //==============================================================================
@@ -283,7 +283,7 @@
     : send_port_(send_port), init_result_(KERN_SUCCESS) {}
 
 //==============================================================================
-kern_return_t MachPortSender::SendMessage(MachSendMessage &message, mach_msg_timeout_t timeout) {
+kern_return_t MachPortSender::SendMessage(MachSendMessage& message, mach_msg_timeout_t timeout) {
   if (message.Head()->msgh_size == 0) {
     NOTREACHED();
     return KERN_INVALID_VALUE;  // just for safety -- never should occur
diff --git a/ipc/glue/MessageLink.cpp b/ipc/glue/MessageLink.cpp
index 52b4c019a3bd8..9530b593dee45 100644
--- a/ipc/glue/MessageLink.cpp
+++ b/ipc/glue/MessageLink.cpp
@@ -38,7 +38,7 @@ using namespace std;
 namespace mozilla {
 namespace ipc {
 
-MessageLink::MessageLink(MessageChannel *aChan) : mChan(aChan) {}
+MessageLink::MessageLink(MessageChannel* aChan) : mChan(aChan) {}
 
 MessageLink::~MessageLink() {
 #ifdef DEBUG
@@ -46,7 +46,7 @@ MessageLink::~MessageLink() {
 #endif
 }
 
-ProcessLink::ProcessLink(MessageChannel *aChan)
+ProcessLink::ProcessLink(MessageChannel* aChan)
     : MessageLink(aChan),
       mTransport(nullptr),
       mIOLoop(nullptr),
@@ -60,8 +60,8 @@ ProcessLink::~ProcessLink() {
 #endif
 }
 
-void ProcessLink::Open(mozilla::ipc::Transport *aTransport,
-                       MessageLoop *aIOLoop, Side aSide) {
+void ProcessLink::Open(mozilla::ipc::Transport* aTransport,
+                       MessageLoop* aIOLoop, Side aSide) {
   mChan->AssertWorkerThread();
 
   MOZ_ASSERT(aTransport, "need transport layer");
@@ -131,17 +131,17 @@ void ProcessLink::Open(mozilla::ipc::Transport *aTransport,
   }
 }
 
-void ProcessLink::EchoMessage(Message *msg) {
+void ProcessLink::EchoMessage(Message* msg) {
   mChan->AssertWorkerThread();
   mChan->mMonitor->AssertCurrentThreadOwns();
 
-  mIOLoop->PostTask(NewNonOwningRunnableMethod(
+  mIOLoop->PostTask(NewNonOwningRunnableMethod(
       "ipc::ProcessLink::OnEchoMessage", this, &ProcessLink::OnEchoMessage,
       msg));
   // OnEchoMessage takes ownership of |msg|
 }
 
-void ProcessLink::SendMessage(Message *msg) {
+void ProcessLink::SendMessage(Message* msg) {
   if (msg->size() > IPC::Channel::kMaximumMessageSize) {
     CrashReporter::AnnotateCrashReport(
         CrashReporter::Annotation::IPCMessageName,
@@ -157,7 +157,7 @@ void ProcessLink::SendMessage(Message *msg) {
   }
   mChan->mMonitor->AssertCurrentThreadOwns();
 
-  mIOLoop->PostTask(NewNonOwningRunnableMethod(
+  mIOLoop->PostTask(NewNonOwningRunnableMethod(
       "IPC::Channel::Send", mTransport, &Transport::Send, msg));
 }
 
@@ -169,7 +169,7 @@ void ProcessLink::SendClose() {
       "ipc::ProcessLink::OnCloseChannel", this, &ProcessLink::OnCloseChannel));
 }
 
-ThreadLink::ThreadLink(MessageChannel *aChan, MessageChannel *aTargetChan)
+ThreadLink::ThreadLink(MessageChannel* aChan, MessageChannel* aTargetChan)
     : MessageLink(aChan), mTargetChan(aTargetChan) {}
 
 ThreadLink::~ThreadLink() {
@@ -195,12 +195,12 @@ ThreadLink::~ThreadLink() {
   // also protects against the two ~ThreadLink() calls racing.
   if (mTargetChan) {
     MOZ_ASSERT(mTargetChan->mLink);
-    static_cast(mTargetChan->mLink)->mTargetChan = nullptr;
+    static_cast(mTargetChan->mLink)->mTargetChan = nullptr;
   }
   mTargetChan = nullptr;
 }
 
-void ThreadLink::EchoMessage(Message *msg) {
+void ThreadLink::EchoMessage(Message* msg) {
   mChan->AssertWorkerThread();
   mChan->mMonitor->AssertCurrentThreadOwns();
 
@@ -208,7 +208,7 @@ void ThreadLink::EchoMessage(Message *msg) {
   delete msg;
 }
 
-void ThreadLink::SendMessage(Message *msg) {
+void ThreadLink::SendMessage(Message* msg) {
   if (!mChan->mIsPostponingSends) {
     mChan->AssertWorkerThread();
   }
@@ -246,14 +246,14 @@ uint32_t ThreadLink::Unsound_NumQueuedMessages() const {
 // The methods below run in the context of the IO thread
 //
 
-void ProcessLink::OnMessageReceived(Message &&msg) {
+void ProcessLink::OnMessageReceived(Message&& msg) {
   AssertIOThread();
   NS_ASSERTION(mChan->mChannelState != ChannelError, "Shouldn't get here!");
   MonitorAutoLock lock(*mChan->mMonitor);
   mChan->OnMessageReceivedFromLink(std::move(msg));
 }
 
-void ProcessLink::OnEchoMessage(Message *msg) {
+void ProcessLink::OnEchoMessage(Message* msg) {
   AssertIOThread();
   OnMessageReceived(std::move(*msg));
   delete msg;
@@ -355,7 +355,7 @@ void ProcessLink::OnCloseChannel() {
 
   MonitorAutoLock lock(*mChan->mMonitor);
 
-  DebugOnly previousListener =
+  DebugOnly previousListener =
       mTransport->set_listener(mExistingListener);
 
   // OnChannelError may have reset the listener already.
diff --git a/ipc/glue/MessageLink.h b/ipc/glue/MessageLink.h
index 25dc586e04848..940c73d14547d 100644
--- a/ipc/glue/MessageLink.h
+++ b/ipc/glue/MessageLink.h
@@ -38,34 +38,34 @@ class MessageLink {
  public:
   typedef IPC::Message Message;
 
-  explicit MessageLink(MessageChannel *aChan);
+  explicit MessageLink(MessageChannel* aChan);
   virtual ~MessageLink();
 
   // n.b.: These methods all require that the channel monitor is
   // held when they are invoked.
-  virtual void EchoMessage(Message *msg) = 0;
-  virtual void SendMessage(Message *msg) = 0;
+  virtual void EchoMessage(Message* msg) = 0;
+  virtual void SendMessage(Message* msg) = 0;
   virtual void SendClose() = 0;
 
   virtual bool Unsound_IsClosed() const = 0;
   virtual uint32_t Unsound_NumQueuedMessages() const = 0;
 
  protected:
-  MessageChannel *mChan;
+  MessageChannel* mChan;
 };
 
 class ProcessLink : public MessageLink, public Transport::Listener {
   void OnCloseChannel();
   void OnChannelOpened();
   void OnTakeConnectedChannel();
-  void OnEchoMessage(Message *msg);
+  void OnEchoMessage(Message* msg);
 
   void AssertIOThread() const {
     MOZ_ASSERT(mIOLoop == MessageLoop::current(), "not on I/O thread!");
   }
 
  public:
-  explicit ProcessLink(MessageChannel *chan);
+  explicit ProcessLink(MessageChannel* chan);
   virtual ~ProcessLink();
 
   // The ProcessLink will register itself as the IPC::Channel::Listener on the
@@ -75,18 +75,18 @@ class ProcessLink : public MessageLink, public Transport::Listener {
   // listener as well). Once the channel is closed (either via normal shutdown
   // or a pipe error) the chain will be destroyed and the original listener
   // will again be registered.
-  void Open(Transport *aTransport, MessageLoop *aIOLoop, Side aSide);
+  void Open(Transport* aTransport, MessageLoop* aIOLoop, Side aSide);
 
   // Run on the I/O thread, only when using inter-process link.
   // These methods acquire the monitor and forward to the
   // similarly named methods in AsyncChannel below
   // (OnMessageReceivedFromLink(), etc)
-  virtual void OnMessageReceived(Message &&msg) override;
+  virtual void OnMessageReceived(Message&& msg) override;
   virtual void OnChannelConnected(int32_t peer_pid) override;
   virtual void OnChannelError() override;
 
-  virtual void EchoMessage(Message *msg) override;
-  virtual void SendMessage(Message *msg) override;
+  virtual void EchoMessage(Message* msg) override;
+  virtual void SendMessage(Message* msg) override;
   virtual void SendClose() override;
 
   virtual bool Unsound_IsClosed() const override;
@@ -96,25 +96,25 @@ class ProcessLink : public MessageLink, public Transport::Listener {
   void OnChannelConnectError();
 
  protected:
-  Transport *mTransport;
-  MessageLoop *mIOLoop;                    // thread where IO happens
-  Transport::Listener *mExistingListener;  // channel's previous listener
+  Transport* mTransport;
+  MessageLoop* mIOLoop;                    // thread where IO happens
+  Transport::Listener* mExistingListener;  // channel's previous listener
 };
 
 class ThreadLink : public MessageLink {
  public:
-  ThreadLink(MessageChannel *aChan, MessageChannel *aTargetChan);
+  ThreadLink(MessageChannel* aChan, MessageChannel* aTargetChan);
   virtual ~ThreadLink();
 
-  virtual void EchoMessage(Message *msg) override;
-  virtual void SendMessage(Message *msg) override;
+  virtual void EchoMessage(Message* msg) override;
+  virtual void SendMessage(Message* msg) override;
   virtual void SendClose() override;
 
   virtual bool Unsound_IsClosed() const override;
   virtual uint32_t Unsound_NumQueuedMessages() const override;
 
  protected:
-  MessageChannel *mTargetChan;
+  MessageChannel* mTargetChan;
 };
 
 }  // namespace ipc
diff --git a/ipc/glue/ProcessUtils_bsd.cpp b/ipc/glue/ProcessUtils_bsd.cpp
index 7fb42f5c0c1a8..fa113f2e58a39 100644
--- a/ipc/glue/ProcessUtils_bsd.cpp
+++ b/ipc/glue/ProcessUtils_bsd.cpp
@@ -15,9 +15,9 @@
 namespace mozilla {
 namespace ipc {
 
-void SetThisProcessName(const char *aName) {
+void SetThisProcessName(const char* aName) {
 #if defined(OS_NETBSD)
-  pthread_setname_np(pthread_self(), "%s", (void *)aName);
+  pthread_setname_np(pthread_self(), "%s", (void*)aName);
 #else
   pthread_set_name_np(pthread_self(), aName);
 #endif
diff --git a/ipc/glue/ProcessUtils_linux.cpp b/ipc/glue/ProcessUtils_linux.cpp
index 93e9070c0f2ae..da15745753085 100644
--- a/ipc/glue/ProcessUtils_linux.cpp
+++ b/ipc/glue/ProcessUtils_linux.cpp
@@ -14,7 +14,7 @@ namespace mozilla {
 
 namespace ipc {
 
-void SetThisProcessName(const char *aName) {
+void SetThisProcessName(const char* aName) {
   prctl(PR_SET_NAME, (unsigned long)aName, 0uL, 0uL, 0uL);
 }
 
diff --git a/ipc/glue/ProcessUtils_mac.mm b/ipc/glue/ProcessUtils_mac.mm
index 641ce00f58b11..0991738f9aef5 100644
--- a/ipc/glue/ProcessUtils_mac.mm
+++ b/ipc/glue/ProcessUtils_mac.mm
@@ -11,7 +11,7 @@
 namespace mozilla {
 namespace ipc {
 
-void SetThisProcessName(const char *aName) {
+void SetThisProcessName(const char* aName) {
   mozilla::plugins::PluginUtilsOSX::SetProcessName(aName);
 }
 
diff --git a/ipc/glue/ProcessUtils_none.cpp b/ipc/glue/ProcessUtils_none.cpp
index 0714bf2a20c13..49566a0720dd0 100644
--- a/ipc/glue/ProcessUtils_none.cpp
+++ b/ipc/glue/ProcessUtils_none.cpp
@@ -9,7 +9,7 @@
 namespace mozilla {
 namespace ipc {
 
-void SetThisProcessName(const char *aString) { (void)aString; }
+void SetThisProcessName(const char* aString) { (void)aString; }
 
 }  // namespace ipc
 }  // namespace mozilla
diff --git a/ipc/ipdl/test/cxx/TestCancel.cpp b/ipc/ipdl/test/cxx/TestCancel.cpp
index 40cc0ff0761e0..2f97aa2e9307c 100644
--- a/ipc/ipdl/test/cxx/TestCancel.cpp
+++ b/ipc/ipdl/test/cxx/TestCancel.cpp
@@ -55,7 +55,7 @@ mozilla::ipc::IPCResult TestCancelParent::RecvDone() {
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult TestCancelParent::RecvCheckParent(uint32_t *reply) {
+mozilla::ipc::IPCResult TestCancelParent::RecvCheckParent(uint32_t* reply) {
   *reply = 12;
   return IPC_OK();
 }
@@ -102,7 +102,7 @@ mozilla::ipc::IPCResult TestCancelChild::RecvTest3_1() {
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult TestCancelChild::RecvCheckChild(uint32_t *reply) {
+mozilla::ipc::IPCResult TestCancelChild::RecvCheckChild(uint32_t* reply) {
   *reply = 12;
   return IPC_OK();
 }
diff --git a/ipc/ipdl/test/cxx/TestCancel.h b/ipc/ipdl/test/cxx/TestCancel.h
index 1a452197f0474..7d944d6a6950c 100644
--- a/ipc/ipdl/test/cxx/TestCancel.h
+++ b/ipc/ipdl/test/cxx/TestCancel.h
@@ -25,7 +25,7 @@ class TestCancelParent : public PTestCancelParent {
   mozilla::ipc::IPCResult RecvTest3_2();
   mozilla::ipc::IPCResult RecvDone();
 
-  mozilla::ipc::IPCResult RecvCheckParent(uint32_t *reply);
+  mozilla::ipc::IPCResult RecvCheckParent(uint32_t* reply);
 
   virtual void ActorDestroy(ActorDestroyReason why) override {
     passed("ok");
@@ -43,7 +43,7 @@ class TestCancelChild : public PTestCancelChild {
   mozilla::ipc::IPCResult RecvTest2_2();
   mozilla::ipc::IPCResult RecvTest3_1();
 
-  mozilla::ipc::IPCResult RecvCheckChild(uint32_t *reply);
+  mozilla::ipc::IPCResult RecvCheckChild(uint32_t* reply);
 
   virtual void ActorDestroy(ActorDestroyReason why) override { QuitChild(); }
 };
diff --git a/ipc/ipdl/test/cxx/TestUrgency.cpp b/ipc/ipdl/test/cxx/TestUrgency.cpp
index be06cf9166e71..5845f8210d350 100644
--- a/ipc/ipdl/test/cxx/TestUrgency.cpp
+++ b/ipc/ipdl/test/cxx/TestUrgency.cpp
@@ -27,7 +27,7 @@ void TestUrgencyParent::Main() {
   if (!SendStart()) fail("sending Start");
 }
 
-mozilla::ipc::IPCResult TestUrgencyParent::RecvTest1(uint32_t *value) {
+mozilla::ipc::IPCResult TestUrgencyParent::RecvTest1(uint32_t* value) {
   if (!SendReply1(value)) fail("sending Reply1");
   if (*value != 99) fail("bad value");
   return IPC_OK();
@@ -42,7 +42,7 @@ mozilla::ipc::IPCResult TestUrgencyParent::RecvTest2() {
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult TestUrgencyParent::RecvTest3(uint32_t *value) {
+mozilla::ipc::IPCResult TestUrgencyParent::RecvTest3(uint32_t* value) {
   if (inreply_) fail("nested non-urgent on top of urgent rpc");
   *value = 1000;
   return IPC_OK();
@@ -88,7 +88,7 @@ mozilla::ipc::IPCResult TestUrgencyChild::RecvStart() {
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult TestUrgencyChild::RecvReply1(uint32_t *reply) {
+mozilla::ipc::IPCResult TestUrgencyChild::RecvReply1(uint32_t* reply) {
   if (test_ != kFirstTestBegin) fail("wrong test # in RecvReply1");
 
   *reply = 99;
@@ -96,7 +96,7 @@ mozilla::ipc::IPCResult TestUrgencyChild::RecvReply1(uint32_t *reply) {
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult TestUrgencyChild::RecvReply2(uint32_t *reply) {
+mozilla::ipc::IPCResult TestUrgencyChild::RecvReply2(uint32_t* reply) {
   if (test_ != kSecondTestBegin) fail("wrong test # in RecvReply2");
 
   // sleep for 5 seconds so the parent process tries to deliver more messages.
diff --git a/ipc/ipdl/test/cxx/TestUrgency.h b/ipc/ipdl/test/cxx/TestUrgency.h
index 581e15a503425..6af73177ee1aa 100644
--- a/ipc/ipdl/test/cxx/TestUrgency.h
+++ b/ipc/ipdl/test/cxx/TestUrgency.h
@@ -19,9 +19,9 @@ class TestUrgencyParent : public PTestUrgencyParent {
 
   void Main();
 
-  mozilla::ipc::IPCResult RecvTest1(uint32_t *value);
+  mozilla::ipc::IPCResult RecvTest1(uint32_t* value);
   mozilla::ipc::IPCResult RecvTest2();
-  mozilla::ipc::IPCResult RecvTest3(uint32_t *value);
+  mozilla::ipc::IPCResult RecvTest3(uint32_t* value);
   mozilla::ipc::IPCResult RecvTest4_Begin();
   mozilla::ipc::IPCResult RecvTest4_NestedSync();
   mozilla::ipc::IPCResult RecvFinalTest_Begin();
@@ -42,8 +42,8 @@ class TestUrgencyChild : public PTestUrgencyChild {
   virtual ~TestUrgencyChild();
 
   mozilla::ipc::IPCResult RecvStart();
-  mozilla::ipc::IPCResult RecvReply1(uint32_t *reply);
-  mozilla::ipc::IPCResult RecvReply2(uint32_t *reply);
+  mozilla::ipc::IPCResult RecvReply1(uint32_t* reply);
+  mozilla::ipc::IPCResult RecvReply2(uint32_t* reply);
 
   virtual void ActorDestroy(ActorDestroyReason why) override { QuitChild(); }
 
diff --git a/ipc/mscom/DispatchForwarder.h b/ipc/mscom/DispatchForwarder.h
index 710b9b4050047..55d3fbb4f297b 100644
--- a/ipc/mscom/DispatchForwarder.h
+++ b/ipc/mscom/DispatchForwarder.h
@@ -17,29 +17,29 @@ namespace mscom {
 
 class DispatchForwarder final : public IDispatch {
  public:
-  static HRESULT Create(IInterceptor *aInterceptor,
-                        STAUniquePtr &aTarget, IUnknown **aOutput);
+  static HRESULT Create(IInterceptor* aInterceptor,
+                        STAUniquePtr& aTarget, IUnknown** aOutput);
 
   // IUnknown
-  STDMETHODIMP QueryInterface(REFIID riid, void **ppv) override;
+  STDMETHODIMP QueryInterface(REFIID riid, void** ppv) override;
   STDMETHODIMP_(ULONG) AddRef() override;
   STDMETHODIMP_(ULONG) Release() override;
 
   // IDispatch
   STDMETHODIMP GetTypeInfoCount(
-      /* [out] */ __RPC__out UINT *pctinfo) override;
+      /* [out] */ __RPC__out UINT* pctinfo) override;
 
   STDMETHODIMP GetTypeInfo(
       /* [in] */ UINT iTInfo,
       /* [in] */ LCID lcid,
-      /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo) override;
+      /* [out] */ __RPC__deref_out_opt ITypeInfo** ppTInfo) override;
 
   STDMETHODIMP GetIDsOfNames(
       /* [in] */ __RPC__in REFIID riid,
-      /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames,
+      /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR* rgszNames,
       /* [range][in] */ __RPC__in_range(0, 16384) UINT cNames,
       /* [in] */ LCID lcid,
-      /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId)
+      /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID* rgDispId)
       override;
 
   STDMETHODIMP Invoke(
@@ -52,17 +52,17 @@ class DispatchForwarder final : public IDispatch {
       /* [annotation][in] */
       _In_ WORD wFlags,
       /* [annotation][out][in] */
-      _In_ DISPPARAMS *pDispParams,
+      _In_ DISPPARAMS* pDispParams,
       /* [annotation][out] */
-      _Out_opt_ VARIANT *pVarResult,
+      _Out_opt_ VARIANT* pVarResult,
       /* [annotation][out] */
-      _Out_opt_ EXCEPINFO *pExcepInfo,
+      _Out_opt_ EXCEPINFO* pExcepInfo,
       /* [annotation][out] */
-      _Out_opt_ UINT *puArgErr) override;
+      _Out_opt_ UINT* puArgErr) override;
 
  private:
-  DispatchForwarder(IInterceptor *aInterceptor,
-                    STAUniquePtr &aTarget);
+  DispatchForwarder(IInterceptor* aInterceptor,
+                    STAUniquePtr& aTarget);
   ~DispatchForwarder();
 
  private:
diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp
index c2712bbdfb735..895020acda359 100644
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -59,25 +59,25 @@ namespace {
 
 static const char kDefaultRuntimeScriptFilename[] = "xpcshell.js";
 
-inline XPCShellEnvironment *Environment(Handle global) {
+inline XPCShellEnvironment* Environment(Handle global) {
   AutoJSAPI jsapi;
   if (!jsapi.Init(global)) {
     return nullptr;
   }
-  JSContext *cx = jsapi.cx();
+  JSContext* cx = jsapi.cx();
   Rooted v(cx);
   if (!JS_GetProperty(cx, global, "__XPCShellEnvironment", &v) ||
       !v.get().isDouble()) {
     return nullptr;
   }
-  return static_cast(v.get().toPrivate());
+  return static_cast(v.get().toPrivate());
 }
 
-static bool Print(JSContext *cx, unsigned argc, JS::Value *vp) {
+static bool Print(JSContext* cx, unsigned argc, JS::Value* vp) {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 
   for (unsigned i = 0; i < args.length(); i++) {
-    JSString *str = JS::ToString(cx, args[i]);
+    JSString* str = JS::ToString(cx, args[i]);
     if (!str) return false;
     JS::UniqueChars bytes = JS_EncodeStringToLatin1(cx, str);
     if (!bytes) return false;
@@ -89,7 +89,7 @@ static bool Print(JSContext *cx, unsigned argc, JS::Value *vp) {
   return true;
 }
 
-static bool GetLine(char *bufp, FILE *file, const char *prompt) {
+static bool GetLine(char* bufp, FILE* file, const char* prompt) {
   char line[256];
   fputs(prompt, stdout);
   fflush(stdout);
@@ -98,12 +98,12 @@ static bool GetLine(char *bufp, FILE *file, const char *prompt) {
   return true;
 }
 
-static bool Dump(JSContext *cx, unsigned argc, JS::Value *vp) {
+static bool Dump(JSContext* cx, unsigned argc, JS::Value* vp) {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 
   if (!args.length()) return true;
 
-  JSString *str = JS::ToString(cx, args[0]);
+  JSString* str = JS::ToString(cx, args[0]);
   if (!str) return false;
   JS::UniqueChars bytes = JS_EncodeStringToLatin1(cx, str);
   if (!bytes) return false;
@@ -113,7 +113,7 @@ static bool Dump(JSContext *cx, unsigned argc, JS::Value *vp) {
   return true;
 }
 
-static bool Load(JSContext *cx, unsigned argc, JS::Value *vp) {
+static bool Load(JSContext* cx, unsigned argc, JS::Value* vp) {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 
   JS::RootedObject thisObject(cx);
@@ -124,11 +124,11 @@ static bool Load(JSContext *cx, unsigned argc, JS::Value *vp) {
   }
 
   for (unsigned i = 0; i < args.length(); i++) {
-    JS::Rooted str(cx, JS::ToString(cx, args[i]));
+    JS::Rooted str(cx, JS::ToString(cx, args[i]));
     if (!str) return false;
     JS::UniqueChars filename = JS_EncodeStringToLatin1(cx, str);
     if (!filename) return false;
-    FILE *file = fopen(filename.get(), "r");
+    FILE* file = fopen(filename.get(), "r");
     if (!file) {
       filename = JS_EncodeStringToUTF8(cx, str);
       if (!filename) return false;
@@ -140,7 +140,7 @@ static bool Load(JSContext *cx, unsigned argc, JS::Value *vp) {
     JS::CompileOptions options(cx);
     options.setFileAndLine(filename.get(), 1);
 
-    JS::Rooted script(cx, JS::CompileUtf8File(cx, options, file));
+    JS::Rooted script(cx, JS::CompileUtf8File(cx, options, file));
     fclose(file);
     if (!script) return false;
 
@@ -152,15 +152,15 @@ static bool Load(JSContext *cx, unsigned argc, JS::Value *vp) {
   return true;
 }
 
-static bool Quit(JSContext *cx, unsigned argc, JS::Value *vp) {
-  Rooted global(cx, JS::CurrentGlobalOrNull(cx));
-  XPCShellEnvironment *env = Environment(global);
+static bool Quit(JSContext* cx, unsigned argc, JS::Value* vp) {
+  Rooted global(cx, JS::CurrentGlobalOrNull(cx));
+  XPCShellEnvironment* env = Environment(global);
   env->SetIsQuitting();
 
   return false;
 }
 
-static bool DumpXPC(JSContext *cx, unsigned argc, JS::Value *vp) {
+static bool DumpXPC(JSContext* cx, unsigned argc, JS::Value* vp) {
   JS::CallArgs args = CallArgsFromVp(argc, vp);
 
   uint16_t depth = 2;
@@ -174,7 +174,7 @@ static bool DumpXPC(JSContext *cx, unsigned argc, JS::Value *vp) {
   return true;
 }
 
-static bool GC(JSContext *cx, unsigned argc, JS::Value *vp) {
+static bool GC(JSContext* cx, unsigned argc, JS::Value* vp) {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 
   JS_GC(cx);
@@ -184,7 +184,7 @@ static bool GC(JSContext *cx, unsigned argc, JS::Value *vp) {
 }
 
 #ifdef JS_GC_ZEAL
-static bool GCZeal(JSContext *cx, unsigned argc, JS::Value *vp) {
+static bool GCZeal(JSContext* cx, unsigned argc, JS::Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);
 
   uint32_t zeal;
@@ -216,17 +216,17 @@ typedef enum JSShellErrNum {
 
 } /* anonymous namespace */
 
-void XPCShellEnvironment::ProcessFile(JSContext *cx, const char *filename,
-                                      FILE *file, bool forceTTY) {
-  XPCShellEnvironment *env = this;
+void XPCShellEnvironment::ProcessFile(JSContext* cx, const char* filename,
+                                      FILE* file, bool forceTTY) {
+  XPCShellEnvironment* env = this;
 
   JS::Rooted result(cx);
   int lineno, startline;
   bool ok, hitEOF;
   char *bufp, buffer[4096];
-  JSString *str;
+  JSString* str;
 
-  JS::Rooted global(cx, JS::CurrentGlobalOrNull(cx));
+  JS::Rooted global(cx, JS::CurrentGlobalOrNull(cx));
   MOZ_ASSERT(global);
 
   if (forceTTY) {
@@ -251,7 +251,7 @@ void XPCShellEnvironment::ProcessFile(JSContext *cx, const char *filename,
     JS::CompileOptions options(cx);
     options.setFileAndLine(filename, 1);
 
-    JS::Rooted script(cx, JS::CompileUtf8File(cx, options, file));
+    JS::Rooted script(cx, JS::CompileUtf8File(cx, options, file));
     if (script) {
       (void)JS_ExecuteScript(cx, script, &result);
     }
@@ -290,7 +290,7 @@ void XPCShellEnvironment::ProcessFile(JSContext *cx, const char *filename,
     options.setFileAndLine("typein", startline);
 
     JS::SourceText srcBuf;
-    JS::Rooted script(cx);
+    JS::Rooted script(cx);
 
     if (srcBuf.init(cx, buffer, strlen(buffer),
                     JS::SourceOwnership::Borrowed) &&
@@ -315,8 +315,8 @@ void XPCShellEnvironment::ProcessFile(JSContext *cx, const char *filename,
 }
 
 // static
-XPCShellEnvironment *XPCShellEnvironment::CreateEnvironment() {
-  auto *env = new XPCShellEnvironment();
+XPCShellEnvironment* XPCShellEnvironment::CreateEnvironment() {
+  auto* env = new XPCShellEnvironment();
   if (env && !env->Init()) {
     delete env;
     env = nullptr;
@@ -377,9 +377,9 @@ bool XPCShellEnvironment::Init() {
   options.creationOptions().setNewCompartmentInSystemZone();
   xpc::SetPrefableRealmOptions(options);
 
-  JS::Rooted globalObj(cx);
+  JS::Rooted globalObj(cx);
   rv = xpc::InitClassesWithNewWrappedGlobal(
-      cx, static_cast(backstagePass), principal, 0, options,
+      cx, static_cast(backstagePass), principal, 0, options,
       &globalObj);
   if (NS_FAILED(rv)) {
     NS_ERROR("InitClassesWithNewWrappedGlobal failed!");
@@ -405,7 +405,7 @@ bool XPCShellEnvironment::Init() {
 
   mGlobalHolder = globalObj;
 
-  FILE *runtimeScriptFile = fopen(kDefaultRuntimeScriptFilename, "r");
+  FILE* runtimeScriptFile = fopen(kDefaultRuntimeScriptFilename, "r");
   if (runtimeScriptFile) {
     fprintf(stdout, "[loading '%s'...]\n", kDefaultRuntimeScriptFilename);
     ProcessFile(cx, kDefaultRuntimeScriptFilename, runtimeScriptFile, false);
@@ -415,11 +415,11 @@ bool XPCShellEnvironment::Init() {
   return true;
 }
 
-bool XPCShellEnvironment::EvaluateString(const nsString &aString,
-                                         nsString *aResult) {
+bool XPCShellEnvironment::EvaluateString(const nsString& aString,
+                                         nsString* aResult) {
   AutoEntryScript aes(GetGlobalObject(),
                       "ipc XPCShellEnvironment::EvaluateString");
-  JSContext *cx = aes.cx();
+  JSContext* cx = aes.cx();
 
   JS::CompileOptions options(cx);
   options.setFileAndLine("typein", 0);
@@ -430,7 +430,7 @@ bool XPCShellEnvironment::EvaluateString(const nsString &aString,
     return false;
   }
 
-  JS::Rooted script(cx, JS::Compile(cx, options, srcBuf));
+  JS::Rooted script(cx, JS::Compile(cx, options, srcBuf));
   if (!script) {
     return false;
   }
@@ -444,7 +444,7 @@ bool XPCShellEnvironment::EvaluateString(const nsString &aString,
   if (ok && !result.isUndefined()) {
     /* Suppress warnings from JS::ToString(). */
     JS::AutoSuppressWarningReporter suppressWarnings(cx);
-    JSString *str = JS::ToString(cx, result);
+    JSString* str = JS::ToString(cx, result);
     nsAutoJSString autoStr;
     if (str) autoStr.init(cx, str);
 
diff --git a/js/src/devtools/rootAnalysis/t/sixgill-tree/source.cpp b/js/src/devtools/rootAnalysis/t/sixgill-tree/source.cpp
index cb4ae7dd5eea6..9bf5eb9ffe79a 100644
--- a/js/src/devtools/rootAnalysis/t/sixgill-tree/source.cpp
+++ b/js/src/devtools/rootAnalysis/t/sixgill-tree/source.cpp
@@ -24,7 +24,7 @@ struct SpecialObject : public JSObject {
 
 struct ErrorResult {
   bool hasObj;
-  JSObject *obj;
+  JSObject* obj;
   void trace() {}
 } ANNOTATE("Suppressed GC Pointer");
 
@@ -34,7 +34,7 @@ struct OkContainer {
 };
 
 struct UnrootedPointer {
-  JSObject *obj;
+  JSObject* obj;
 };
 
 template 
@@ -46,22 +46,22 @@ extern void js_GC() ANNOTATE("GC Call") ANNOTATE("Slow");
 
 void js_GC() {}
 
-void root_arg(JSObject *obj, JSObject *random) {
+void root_arg(JSObject* obj, JSObject* random) {
   // Use all these types so they get included in the output.
   SpecialObject so;
   UnrootedPointer up;
   Bogon b;
   OkContainer okc;
-  Rooted ro;
-  Rooted rso;
+  Rooted ro;
+  Rooted rso;
 
   obj = random;
 
-  JSObject *other1 = obj;
+  JSObject* other1 = obj;
   js_GC();
 
   float MARKER1 = 0;
-  JSObject *other2 = obj;
+  JSObject* other2 = obj;
   other1->f = 1;
   other2->f = -1;
 
diff --git a/js/src/jsapi-tests/testPrintf.cpp b/js/src/jsapi-tests/testPrintf.cpp
index c6683b9363c4c..603a6a8725291 100644
--- a/js/src/jsapi-tests/testPrintf.cpp
+++ b/js/src/jsapi-tests/testPrintf.cpp
@@ -15,7 +15,7 @@
 #include "jsapi-tests/tests.h"
 
 static bool MOZ_FORMAT_PRINTF(2, 3)
-    print_one(const char *expect, const char *fmt, ...) {
+    print_one(const char* expect, const char* fmt, ...) {
   va_list ap;
 
   va_start(ap, fmt);
@@ -25,7 +25,7 @@ static bool MOZ_FORMAT_PRINTF(2, 3)
   return output && !strcmp(output.get(), expect);
 }
 
-static const char *zero() { return nullptr; }
+static const char* zero() { return nullptr; }
 
 BEGIN_TEST(testPrintf) {
   CHECK(print_one("23", "%d", 23));
@@ -46,7 +46,7 @@ BEGIN_TEST(testPrintf) {
   CHECK(print_one("27270", "%zu", (size_t)27270));
   CHECK(print_one("hello", "he%so", "ll"));
   CHECK(print_one("(null)", "%s", ::zero()));
-  CHECK(print_one("0", "%p", (char *)0));
+  CHECK(print_one("0", "%p", (char*)0));
   CHECK(print_one("h", "%c", 'h'));
   CHECK(print_one("1.500000", "%f", 1.5f));
   CHECK(print_one("1.5", "%g", 1.5));
diff --git a/js/src/jsapi-tests/valueABI.c b/js/src/jsapi-tests/valueABI.c
index b11560e9a9480..4dc10e1d48f8b 100644
--- a/js/src/jsapi-tests/valueABI.c
+++ b/js/src/jsapi-tests/valueABI.c
@@ -8,11 +8,11 @@
 
 /* See testValueABI.cpp */
 
-bool C_ValueToObject(JSContext *cx, jsval v, JSObject **obj) {
+bool C_ValueToObject(JSContext* cx, jsval v, JSObject** obj) {
   return JS_ValueToObject(cx, v, obj);
 }
 
-jsval C_GetEmptyStringValue(JSContext *cx) {
+jsval C_GetEmptyStringValue(JSContext* cx) {
   return JS_GetEmptyStringValue(cx);
 }
 
diff --git a/js/src/vm/PosixNSPR.cpp b/js/src/vm/PosixNSPR.cpp
index 41ce31e488a9e..a70b4ab7981db 100644
--- a/js/src/vm/PosixNSPR.cpp
+++ b/js/src/vm/PosixNSPR.cpp
@@ -14,29 +14,29 @@
 #  include 
 #  include 
 
-int32_t PR_FileDesc2NativeHandle(PRFileDesc *fd) {
+int32_t PR_FileDesc2NativeHandle(PRFileDesc* fd) {
   MOZ_CRASH("PR_FileDesc2NativeHandle");
 }
 
-PRStatus PR_GetOpenFileInfo(PRFileDesc *fd, PRFileInfo *info) {
+PRStatus PR_GetOpenFileInfo(PRFileDesc* fd, PRFileInfo* info) {
   MOZ_CRASH("PR_GetOpenFileInfo");
 }
 
-int32_t PR_Seek(PRFileDesc *fd, int32_t offset, PRSeekWhence whence) {
+int32_t PR_Seek(PRFileDesc* fd, int32_t offset, PRSeekWhence whence) {
   MOZ_CRASH("PR_Seek");
 }
 
-PRFileMap *PR_CreateFileMap(PRFileDesc *fd, int64_t size,
+PRFileMap* PR_CreateFileMap(PRFileDesc* fd, int64_t size,
                             PRFileMapProtect prot) {
   MOZ_CRASH("PR_CreateFileMap");
 }
 
-void *PR_MemMap(PRFileMap *fmap, int64_t offset, uint32_t len) {
+void* PR_MemMap(PRFileMap* fmap, int64_t offset, uint32_t len) {
   MOZ_CRASH("PR_MemMap");
 }
 
-PRStatus PR_MemUnmap(void *addr, uint32_t len) { MOZ_CRASH("PR_MemUnmap"); }
+PRStatus PR_MemUnmap(void* addr, uint32_t len) { MOZ_CRASH("PR_MemUnmap"); }
 
-PRStatus PR_CloseFileMap(PRFileMap *fmap) { MOZ_CRASH("PR_CloseFileMap"); }
+PRStatus PR_CloseFileMap(PRFileMap* fmap) { MOZ_CRASH("PR_CloseFileMap"); }
 
 #endif /* JS_POSIX_NSPR */
diff --git a/js/src/vm/PosixNSPR.h b/js/src/vm/PosixNSPR.h
index 2fe9890788c95..ef36f62351baa 100644
--- a/js/src/vm/PosixNSPR.h
+++ b/js/src/vm/PosixNSPR.h
@@ -11,7 +11,7 @@
 
 #  include "jspubtd.h"
 
-int32_t PR_FileDesc2NativeHandle(PRFileDesc *fd);
+int32_t PR_FileDesc2NativeHandle(PRFileDesc* fd);
 
 enum PRFileType { PR_FILE_FILE = 1, PR_FILE_DIRECTORY = 2, PR_FILE_OTHER = 3 };
 
@@ -24,11 +24,11 @@ struct PRFileInfo {
 
 typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus;
 
-PRStatus PR_GetOpenFileInfo(PRFileDesc *fd, PRFileInfo *info);
+PRStatus PR_GetOpenFileInfo(PRFileDesc* fd, PRFileInfo* info);
 
 enum PRSeekWhence { PR_SEEK_SET = 0, PR_SEEK_CUR = 1, PR_SEEK_END = 2 };
 
-int32_t PR_Seek(PRFileDesc *fd, int32_t offset, PRSeekWhence whence);
+int32_t PR_Seek(PRFileDesc* fd, int32_t offset, PRSeekWhence whence);
 
 enum PRFileMapProtect {
   PR_PROT_READONLY,
@@ -38,14 +38,14 @@ enum PRFileMapProtect {
 
 struct PRFileMap;
 
-PRFileMap *PR_CreateFileMap(PRFileDesc *fd, int64_t size,
+PRFileMap* PR_CreateFileMap(PRFileDesc* fd, int64_t size,
                             PRFileMapProtect prot);
 
-void *PR_MemMap(PRFileMap *fmap, int64_t offset, uint32_t len);
+void* PR_MemMap(PRFileMap* fmap, int64_t offset, uint32_t len);
 
-PRStatus PR_MemUnmap(void *addr, uint32_t len);
+PRStatus PR_MemUnmap(void* addr, uint32_t len);
 
-PRStatus PR_CloseFileMap(PRFileMap *fmap);
+PRStatus PR_CloseFileMap(PRFileMap* fmap);
 
 #endif /* JS_POSIX_NSPR */
 
diff --git a/js/xpconnect/shell/xpcshellMacUtils.mm b/js/xpconnect/shell/xpcshellMacUtils.mm
index 8062a58a5ed1b..d034895154a95 100644
--- a/js/xpconnect/shell/xpcshellMacUtils.mm
+++ b/js/xpconnect/shell/xpcshellMacUtils.mm
@@ -6,7 +6,7 @@
 
 #include 
 
-static NSAutoreleasePool *pool = NULL;
+static NSAutoreleasePool* pool = NULL;
 
 void InitAutoreleasePool() { pool = [[NSAutoreleasePool alloc] init]; }
 
diff --git a/layout/base/nsCSSColorUtils.cpp b/layout/base/nsCSSColorUtils.cpp
index 11ff4c73d80de..66e6a333bac16 100644
--- a/layout/base/nsCSSColorUtils.cpp
+++ b/layout/base/nsCSSColorUtils.cpp
@@ -64,8 +64,8 @@ int32_t NS_GetLuminosity(nscolor aColor) {
 // Hue is the primary color defined from 0 to 359 degrees
 // Saturation is defined from 0 to 255.  The higher the number.. the deeper
 // the color Value is the brightness of the color. 0 is black, 255 is white.
-void NS_RGB2HSV(nscolor aColor, uint16_t &aHue, uint16_t &aSat,
-                uint16_t &aValue, uint8_t &aAlpha) {
+void NS_RGB2HSV(nscolor aColor, uint16_t& aHue, uint16_t& aSat,
+                uint16_t& aValue, uint8_t& aAlpha) {
   uint8_t r, g, b;
   int16_t delta, min, max, r1, b1, g1;
   float hue;
@@ -127,7 +127,7 @@ void NS_RGB2HSV(nscolor aColor, uint16_t &aHue, uint16_t &aSat,
 // Hue is the primary color defined from 0 to 359 degrees
 // Saturation is defined from 0 to 255.  The higher the number.. the deeper
 // the color Value is the brightness of the color. 0 is black, 255 is white.
-void NS_HSV2RGB(nscolor &aColor, uint16_t aHue, uint16_t aSat, uint16_t aValue,
+void NS_HSV2RGB(nscolor& aColor, uint16_t aHue, uint16_t aSat, uint16_t aValue,
                 uint8_t aAlpha) {
   uint16_t r = 0, g = 0, b = 0;
   uint16_t i, p, q, t;
diff --git a/layout/base/nsCSSColorUtils.h b/layout/base/nsCSSColorUtils.h
index 1006024849774..df654b4f10925 100644
--- a/layout/base/nsCSSColorUtils.h
+++ b/layout/base/nsCSSColorUtils.h
@@ -30,11 +30,11 @@ int NS_GetBrightness(uint8_t aRed, uint8_t aGreen, uint8_t aBlue);
 int32_t NS_GetLuminosity(nscolor aColor);
 
 // function to convert from RGBA color space to HSVA color space
-void NS_RGB2HSV(nscolor aColor, uint16_t &aHue, uint16_t &aSat,
-                uint16_t &aValue, uint8_t &aAlpha);
+void NS_RGB2HSV(nscolor aColor, uint16_t& aHue, uint16_t& aSat,
+                uint16_t& aValue, uint8_t& aAlpha);
 
 // function to convert from HSVA color space to RGBA color space
-void NS_HSV2RGB(nscolor &aColor, uint16_t aHue, uint16_t aSat, uint16_t aValue,
+void NS_HSV2RGB(nscolor& aColor, uint16_t aHue, uint16_t aSat, uint16_t aValue,
                 uint8_t aAlpha);
 
 #endif
diff --git a/layout/base/nsFrameTraversal.h b/layout/base/nsFrameTraversal.h
index 7223fef605dfe..d41d02b52d965 100644
--- a/layout/base/nsFrameTraversal.h
+++ b/layout/base/nsFrameTraversal.h
@@ -12,13 +12,13 @@
 
 class nsIFrame;
 
-nsresult NS_NewFrameTraversal(nsIFrameEnumerator **aEnumerator,
-                              nsPresContext *aPresContext, nsIFrame *aStart,
+nsresult NS_NewFrameTraversal(nsIFrameEnumerator** aEnumerator,
+                              nsPresContext* aPresContext, nsIFrame* aStart,
                               nsIteratorType aType, bool aVisual,
                               bool aLockInScrollView, bool aFollowOOFs,
                               bool aSkipPopupChecks);
 
-nsresult NS_CreateFrameTraversal(nsIFrameTraversal **aResult);
+nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult);
 
 class nsFrameTraversal final : public nsIFrameTraversal {
  public:
@@ -26,8 +26,8 @@ class nsFrameTraversal final : public nsIFrameTraversal {
 
   NS_DECL_ISUPPORTS
 
-  NS_IMETHOD NewFrameTraversal(nsIFrameEnumerator **aEnumerator,
-                               nsPresContext *aPresContext, nsIFrame *aStart,
+  NS_IMETHOD NewFrameTraversal(nsIFrameEnumerator** aEnumerator,
+                               nsPresContext* aPresContext, nsIFrame* aStart,
                                int32_t aType, bool aVisual,
                                bool aLockInScrollView, bool aFollowOOFs,
                                bool aSkipPopupChecks) override;
diff --git a/layout/generic/nsFontInflationData.cpp b/layout/generic/nsFontInflationData.cpp
index 03f625c6227a0..195970948ed2c 100644
--- a/layout/generic/nsFontInflationData.cpp
+++ b/layout/generic/nsFontInflationData.cpp
@@ -22,10 +22,10 @@ using namespace mozilla::layout;
 NS_DECLARE_FRAME_PROPERTY_DELETABLE(FontInflationDataProperty,
                                     nsFontInflationData)
 
-/* static */ nsFontInflationData *nsFontInflationData::FindFontInflationDataFor(
-    const nsIFrame *aFrame) {
+/* static */ nsFontInflationData* nsFontInflationData::FindFontInflationDataFor(
+    const nsIFrame* aFrame) {
   // We have one set of font inflation data per block formatting context.
-  const nsIFrame *bfc = FlowRootFor(aFrame);
+  const nsIFrame* bfc = FlowRootFor(aFrame);
   NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
                "should have found a flow root");
   MOZ_ASSERT(aFrame->GetWritingMode().IsVertical() ==
@@ -37,11 +37,11 @@ NS_DECLARE_FRAME_PROPERTY_DELETABLE(FontInflationDataProperty,
 
 /* static */
 bool nsFontInflationData::UpdateFontInflationDataISizeFor(
-    const ReflowInput &aReflowInput) {
-  nsIFrame *bfc = aReflowInput.mFrame;
+    const ReflowInput& aReflowInput) {
+  nsIFrame* bfc = aReflowInput.mFrame;
   NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
                "should have been given a flow root");
-  nsFontInflationData *data = bfc->GetProperty(FontInflationDataProperty());
+  nsFontInflationData* data = bfc->GetProperty(FontInflationDataProperty());
   bool oldInflationEnabled;
   nscoord oldUsableISize;
   if (data) {
@@ -62,18 +62,18 @@ bool nsFontInflationData::UpdateFontInflationDataISizeFor(
 }
 
 /* static */
-void nsFontInflationData::MarkFontInflationDataTextDirty(nsIFrame *aBFCFrame) {
+void nsFontInflationData::MarkFontInflationDataTextDirty(nsIFrame* aBFCFrame) {
   NS_ASSERTION(aBFCFrame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
                "should have been given a flow root");
 
-  nsFontInflationData *data =
+  nsFontInflationData* data =
       aBFCFrame->GetProperty(FontInflationDataProperty());
   if (data) {
     data->MarkTextDirty();
   }
 }
 
-nsFontInflationData::nsFontInflationData(nsIFrame *aBFCFrame)
+nsFontInflationData::nsFontInflationData(nsIFrame* aBFCFrame)
     : mBFCFrame(aBFCFrame),
       mUsableISize(0),
       mTextAmount(0),
@@ -88,23 +88,23 @@ nsFontInflationData::nsFontInflationData(nsIFrame *aBFCFrame)
  *
  * aKnownCommonAncestor is a known common ancestor of both.
  */
-static nsIFrame *NearestCommonAncestorFirstInFlow(
-    nsIFrame *aFrame1, nsIFrame *aFrame2, nsIFrame *aKnownCommonAncestor) {
+static nsIFrame* NearestCommonAncestorFirstInFlow(
+    nsIFrame* aFrame1, nsIFrame* aFrame2, nsIFrame* aKnownCommonAncestor) {
   aFrame1 = aFrame1->FirstInFlow();
   aFrame2 = aFrame2->FirstInFlow();
   aKnownCommonAncestor = aKnownCommonAncestor->FirstInFlow();
 
-  AutoTArray ancestors1, ancestors2;
-  for (nsIFrame *f = aFrame1; f != aKnownCommonAncestor;
+  AutoTArray ancestors1, ancestors2;
+  for (nsIFrame* f = aFrame1; f != aKnownCommonAncestor;
        (f = f->GetParent()) && (f = f->FirstInFlow())) {
     ancestors1.AppendElement(f);
   }
-  for (nsIFrame *f = aFrame2; f != aKnownCommonAncestor;
+  for (nsIFrame* f = aFrame2; f != aKnownCommonAncestor;
        (f = f->GetParent()) && (f = f->FirstInFlow())) {
     ancestors2.AppendElement(f);
   }
 
-  nsIFrame *result = aKnownCommonAncestor;
+  nsIFrame* result = aKnownCommonAncestor;
   uint32_t i1 = ancestors1.Length(), i2 = ancestors2.Length();
   while (i1-- != 0 && i2-- != 0) {
     if (ancestors1[i1] != ancestors2[i2]) {
@@ -116,15 +116,15 @@ static nsIFrame *NearestCommonAncestorFirstInFlow(
   return result;
 }
 
-static nscoord ComputeDescendantISize(const ReflowInput &aAncestorReflowInput,
-                                      nsIFrame *aDescendantFrame) {
-  nsIFrame *ancestorFrame = aAncestorReflowInput.mFrame->FirstInFlow();
+static nscoord ComputeDescendantISize(const ReflowInput& aAncestorReflowInput,
+                                      nsIFrame* aDescendantFrame) {
+  nsIFrame* ancestorFrame = aAncestorReflowInput.mFrame->FirstInFlow();
   if (aDescendantFrame == ancestorFrame) {
     return aAncestorReflowInput.ComputedISize();
   }
 
-  AutoTArray frames;
-  for (nsIFrame *f = aDescendantFrame; f != ancestorFrame;
+  AutoTArray frames;
+  for (nsIFrame* f = aDescendantFrame; f != ancestorFrame;
        f = f->GetParent()->FirstInFlow()) {
     frames.AppendElement(f);
   }
@@ -135,13 +135,13 @@ static nscoord ComputeDescendantISize(const ReflowInput &aAncestorReflowInput,
   // occasionally cause problems when writing tests on desktop.
 
   uint32_t len = frames.Length();
-  ReflowInput *reflowInputs =
-      static_cast(moz_xmalloc(sizeof(ReflowInput) * len));
-  nsPresContext *presContext = aDescendantFrame->PresContext();
+  ReflowInput* reflowInputs =
+      static_cast(moz_xmalloc(sizeof(ReflowInput) * len));
+  nsPresContext* presContext = aDescendantFrame->PresContext();
   for (uint32_t i = 0; i < len; ++i) {
-    const ReflowInput &parentReflowInput =
+    const ReflowInput& parentReflowInput =
         (i == 0) ? aAncestorReflowInput : reflowInputs[i - 1];
-    nsIFrame *frame = frames[len - i - 1];
+    nsIFrame* frame = frames[len - i - 1];
     WritingMode wm = frame->GetWritingMode();
     LogicalSize availSize = parentReflowInput.ComputedSize(wm);
     availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
@@ -164,12 +164,12 @@ static nscoord ComputeDescendantISize(const ReflowInput &aAncestorReflowInput,
   return result;
 }
 
-void nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput) {
-  nsIFrame *bfc = aReflowInput.mFrame;
+void nsFontInflationData::UpdateISize(const ReflowInput& aReflowInput) {
+  nsIFrame* bfc = aReflowInput.mFrame;
   NS_ASSERTION(bfc->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT,
                "must be block formatting context");
 
-  nsIFrame *firstInflatableDescendant =
+  nsIFrame* firstInflatableDescendant =
       FindEdgeInflatableFrameIn(bfc, eFromStart);
   if (!firstInflatableDescendant) {
     mTextAmount = 0;
@@ -178,14 +178,14 @@ void nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput) {
     mInflationEnabled = false;
     return;
   }
-  nsIFrame *lastInflatableDescendant = FindEdgeInflatableFrameIn(bfc, eFromEnd);
+  nsIFrame* lastInflatableDescendant = FindEdgeInflatableFrameIn(bfc, eFromEnd);
   MOZ_ASSERT(!firstInflatableDescendant == !lastInflatableDescendant,
              "null-ness should match; NearestCommonAncestorFirstInFlow"
              " will crash when passed null");
 
   // Particularly when we're computing for the root BFC, the inline-size of
   // nca might differ significantly for the inline-size of bfc.
-  nsIFrame *nca = NearestCommonAncestorFirstInFlow(
+  nsIFrame* nca = NearestCommonAncestorFirstInFlow(
       firstInflatableDescendant, lastInflatableDescendant, bfc);
   while (!nca->IsContainerForFontSizeInflation()) {
     nca = nca->GetParent()->FirstInFlow();
@@ -195,7 +195,7 @@ void nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput) {
 
   // See comment above "font.size.inflation.lineThreshold" in
   // modules/libpref/src/init/all.js .
-  PresShell *presShell = bfc->PresShell();
+  PresShell* presShell = bfc->PresShell();
   uint32_t lineThreshold = presShell->FontSizeInflationLineThreshold();
   nscoord newTextThreshold = (newNCAISize * lineThreshold) / 100;
 
@@ -214,7 +214,7 @@ void nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput) {
   // possible or make sense.
   // Hence the ISize assumed to be usable for displaying text is limited to the
   // visible area.
-  nsPresContext *presContext = bfc->PresContext();
+  nsPresContext* presContext = bfc->PresContext();
   MOZ_ASSERT(
       bfc->GetWritingMode().IsVertical() == nca->GetWritingMode().IsVertical(),
       "writing mode of NCA should match that of its flow root");
@@ -226,14 +226,14 @@ void nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput) {
   mInflationEnabled = mTextAmount >= mTextThreshold;
 }
 
-/* static */ nsIFrame *nsFontInflationData::FindEdgeInflatableFrameIn(
-    nsIFrame *aFrame, SearchDirection aDirection) {
+/* static */ nsIFrame* nsFontInflationData::FindEdgeInflatableFrameIn(
+    nsIFrame* aFrame, SearchDirection aDirection) {
   // NOTE: This function has a similar structure to ScanTextIn!
 
   // FIXME: Should probably only scan the text that's actually going to
   // be inflated!
 
-  nsIFormControlFrame *fcf = do_QueryFrame(aFrame);
+  nsIFormControlFrame* fcf = do_QueryFrame(aFrame);
   if (fcf) {
     return aFrame;
   }
@@ -242,9 +242,9 @@ void nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput) {
   AutoTArray lists;
   aFrame->GetChildLists(&lists);
   for (uint32_t i = 0, len = lists.Length(); i < len; ++i) {
-    const nsFrameList &list =
+    const nsFrameList& list =
         lists[(aDirection == eFromStart) ? i : len - i - 1].mList;
-    for (nsIFrame *kid = (aDirection == eFromStart) ? list.FirstChild()
+    for (nsIFrame* kid = (aDirection == eFromStart) ? list.FirstChild()
                                                     : list.LastChild();
          kid; kid = (aDirection == eFromStart) ? kid->GetNextSibling()
                                                : kid->GetPrevSibling()) {
@@ -254,7 +254,7 @@ void nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput) {
       }
 
       if (kid->IsTextFrame()) {
-        nsIContent *content = kid->GetContent();
+        nsIContent* content = kid->GetContent();
         if (content && kid == content->GetPrimaryFrame()) {
           uint32_t len = nsTextFrameUtils::
               ComputeApproximateLengthWithWhitespaceCompression(
@@ -264,7 +264,7 @@ void nsFontInflationData::UpdateISize(const ReflowInput &aReflowInput) {
           }
         }
       } else {
-        nsIFrame *kidResult = FindEdgeInflatableFrameIn(kid, aDirection);
+        nsIFrame* kidResult = FindEdgeInflatableFrameIn(kid, aDirection);
         if (kidResult) {
           return kidResult;
         }
@@ -282,16 +282,16 @@ void nsFontInflationData::ScanText() {
   mInflationEnabled = mTextAmount >= mTextThreshold;
 }
 
-static uint32_t DoCharCountOfLargestOption(nsIFrame *aContainer) {
+static uint32_t DoCharCountOfLargestOption(nsIFrame* aContainer) {
   uint32_t result = 0;
-  for (nsIFrame *option : aContainer->PrincipalChildList()) {
+  for (nsIFrame* option : aContainer->PrincipalChildList()) {
     uint32_t optionResult;
     if (option->GetContent()->IsHTMLElement(nsGkAtoms::optgroup)) {
       optionResult = DoCharCountOfLargestOption(option);
     } else {
       // REVIEW: Check the frame structure for this!
       optionResult = 0;
-      for (nsIFrame *optionChild : option->PrincipalChildList()) {
+      for (nsIFrame* optionChild : option->PrincipalChildList()) {
         if (optionChild->IsTextFrame()) {
           optionResult += nsTextFrameUtils::
               ComputeApproximateLengthWithWhitespaceCompression(
@@ -306,13 +306,13 @@ static uint32_t DoCharCountOfLargestOption(nsIFrame *aContainer) {
   return result;
 }
 
-static uint32_t CharCountOfLargestOption(nsIFrame *aListControlFrame) {
+static uint32_t CharCountOfLargestOption(nsIFrame* aListControlFrame) {
   return DoCharCountOfLargestOption(
-      static_cast(aListControlFrame)
+      static_cast(aListControlFrame)
           ->GetOptionsContainer());
 }
 
-void nsFontInflationData::ScanTextIn(nsIFrame *aFrame) {
+void nsFontInflationData::ScanTextIn(nsIFrame* aFrame) {
   // NOTE: This function has a similar structure to FindEdgeInflatableFrameIn!
 
   // FIXME: Should probably only scan the text that's actually going to
@@ -322,7 +322,7 @@ void nsFontInflationData::ScanTextIn(nsIFrame *aFrame) {
   for (; !lists.IsDone(); lists.Next()) {
     nsFrameList::Enumerator kids(lists.CurrentList());
     for (; !kids.AtEnd(); kids.Next()) {
-      nsIFrame *kid = kids.get();
+      nsIFrame* kid = kids.get();
       if (kid->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) {
         // Goes in a different set of inflation data.
         continue;
@@ -330,7 +330,7 @@ void nsFontInflationData::ScanTextIn(nsIFrame *aFrame) {
 
       LayoutFrameType fType = kid->Type();
       if (fType == LayoutFrameType::Text) {
-        nsIContent *content = kid->GetContent();
+        nsIContent* content = kid->GetContent();
         if (content && kid == content->GetPrimaryFrame()) {
           uint32_t len = nsTextFrameUtils::
               ComputeApproximateLengthWithWhitespaceCompression(
@@ -346,7 +346,7 @@ void nsFontInflationData::ScanTextIn(nsIFrame *aFrame) {
         // We don't want changes to the amount of text in a text input
         // to change what we count towards inflation.
         nscoord fontSize = kid->StyleFont()->mFont.size;
-        int32_t charCount = static_cast(kid)->GetCols();
+        int32_t charCount = static_cast(kid)->GetCols();
         mTextAmount += charCount * fontSize;
       } else if (fType == LayoutFrameType::ComboboxControl) {
         // See textInputFrame above (with s/amount of text/selected option/).
@@ -354,7 +354,7 @@ void nsFontInflationData::ScanTextIn(nsIFrame *aFrame) {
         // need to exclude the display frame.
         nscoord fontSize = kid->StyleFont()->mFont.size;
         int32_t charCount = CharCountOfLargestOption(
-            static_cast(kid)->GetDropDown());
+            static_cast(kid)->GetDropDown());
         mTextAmount += charCount * fontSize;
       } else if (fType == LayoutFrameType::ListControl) {
         // See textInputFrame above (with s/amount of text/selected option/).
diff --git a/layout/generic/nsFontInflationData.h b/layout/generic/nsFontInflationData.h
index 3815c7249cfb0..35b7e1f7679a9 100644
--- a/layout/generic/nsFontInflationData.h
+++ b/layout/generic/nsFontInflationData.h
@@ -16,13 +16,13 @@ class nsFontInflationData {
   using ReflowInput = mozilla::ReflowInput;
 
  public:
-  static nsFontInflationData *FindFontInflationDataFor(const nsIFrame *aFrame);
+  static nsFontInflationData* FindFontInflationDataFor(const nsIFrame* aFrame);
 
   // Returns whether the usable width changed (which requires the
   // caller to mark its descendants dirty)
-  static bool UpdateFontInflationDataISizeFor(const ReflowInput &aReflowInput);
+  static bool UpdateFontInflationDataISizeFor(const ReflowInput& aReflowInput);
 
-  static void MarkFontInflationDataTextDirty(nsIFrame *aFrame);
+  static void MarkFontInflationDataTextDirty(nsIFrame* aFrame);
 
   bool InflationEnabled() {
     if (mTextDirty) {
@@ -34,14 +34,14 @@ class nsFontInflationData {
   nscoord UsableISize() const { return mUsableISize; }
 
  private:
-  explicit nsFontInflationData(nsIFrame *aBFCFrame);
+  explicit nsFontInflationData(nsIFrame* aBFCFrame);
 
-  nsFontInflationData(const nsFontInflationData &) = delete;
-  void operator=(const nsFontInflationData &) = delete;
+  nsFontInflationData(const nsFontInflationData&) = delete;
+  void operator=(const nsFontInflationData&) = delete;
 
-  void UpdateISize(const ReflowInput &aReflowInput);
+  void UpdateISize(const ReflowInput& aReflowInput);
   enum SearchDirection { eFromStart, eFromEnd };
-  static nsIFrame *FindEdgeInflatableFrameIn(nsIFrame *aFrame,
+  static nsIFrame* FindEdgeInflatableFrameIn(nsIFrame* aFrame,
                                              SearchDirection aDirection);
 
   void MarkTextDirty() { mTextDirty = true; }
@@ -51,16 +51,16 @@ class nsFontInflationData {
   // (yielding the inline-size that would be occupied by the characters if
   // they were all em squares).  But stop scanning if mTextAmount
   // crosses mTextThreshold.
-  void ScanTextIn(nsIFrame *aFrame);
+  void ScanTextIn(nsIFrame* aFrame);
 
-  static const nsIFrame *FlowRootFor(const nsIFrame *aFrame) {
+  static const nsIFrame* FlowRootFor(const nsIFrame* aFrame) {
     while (!(aFrame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT)) {
       aFrame = aFrame->GetParent();
     }
     return aFrame;
   }
 
-  nsIFrame *mBFCFrame;
+  nsIFrame* mBFCFrame;
   nscoord mUsableISize;
   nscoord mTextAmount, mTextThreshold;
   bool mInflationEnabled;  // for this BFC
diff --git a/layout/generic/nsIntervalSet.cpp b/layout/generic/nsIntervalSet.cpp
index 28fed4964e4a6..9cb61253a7776 100644
--- a/layout/generic/nsIntervalSet.cpp
+++ b/layout/generic/nsIntervalSet.cpp
@@ -13,24 +13,24 @@
 
 using namespace mozilla;
 
-nsIntervalSet::nsIntervalSet(PresShell *aPresShell)
+nsIntervalSet::nsIntervalSet(PresShell* aPresShell)
     : mList(nullptr), mPresShell(aPresShell) {}
 
 nsIntervalSet::~nsIntervalSet() {
-  Interval *current = mList;
+  Interval* current = mList;
   while (current) {
-    Interval *trash = current;
+    Interval* trash = current;
     current = current->mNext;
     FreeInterval(trash);
   }
 }
 
-void *nsIntervalSet::AllocateInterval() {
+void* nsIntervalSet::AllocateInterval() {
   return mPresShell->AllocateByObjectID(eArenaObjectID_nsIntervalSet_Interval,
                                         sizeof(Interval));
 }
 
-void nsIntervalSet::FreeInterval(nsIntervalSet::Interval *aInterval) {
+void nsIntervalSet::FreeInterval(nsIntervalSet::Interval* aInterval) {
   NS_ASSERTION(aInterval, "null interval");
 
   aInterval->Interval::~Interval();
@@ -38,16 +38,16 @@ void nsIntervalSet::FreeInterval(nsIntervalSet::Interval *aInterval) {
 }
 
 void nsIntervalSet::IncludeInterval(coord_type aBegin, coord_type aEnd) {
-  auto newInterval = static_cast(AllocateInterval());
+  auto newInterval = static_cast(AllocateInterval());
   new (newInterval) Interval(aBegin, aEnd);
 
-  Interval **current = &mList;
+  Interval** current = &mList;
   while (*current && (*current)->mEnd < aBegin) current = &(*current)->mNext;
 
   newInterval->mNext = *current;
   *current = newInterval;
 
-  Interval *subsumed = newInterval->mNext;
+  Interval* subsumed = newInterval->mNext;
   while (subsumed && subsumed->mBegin <= aEnd) {
     newInterval->mBegin = std::min(newInterval->mBegin, subsumed->mBegin);
     newInterval->mEnd = std::max(newInterval->mEnd, subsumed->mEnd);
@@ -58,7 +58,7 @@ void nsIntervalSet::IncludeInterval(coord_type aBegin, coord_type aEnd) {
 }
 
 bool nsIntervalSet::Intersects(coord_type aBegin, coord_type aEnd) const {
-  Interval *current = mList;
+  Interval* current = mList;
   while (current && current->mBegin <= aEnd) {
     if (current->mEnd >= aBegin) return true;
     current = current->mNext;
@@ -67,7 +67,7 @@ bool nsIntervalSet::Intersects(coord_type aBegin, coord_type aEnd) const {
 }
 
 bool nsIntervalSet::Contains(coord_type aBegin, coord_type aEnd) const {
-  Interval *current = mList;
+  Interval* current = mList;
   while (current && current->mBegin <= aBegin) {
     if (current->mEnd >= aEnd) return true;
     current = current->mNext;
diff --git a/layout/generic/nsIntervalSet.h b/layout/generic/nsIntervalSet.h
index 1a6424ed73ecd..0d89357bd74b7 100644
--- a/layout/generic/nsIntervalSet.h
+++ b/layout/generic/nsIntervalSet.h
@@ -23,7 +23,7 @@ class nsIntervalSet {
  public:
   typedef nscoord coord_type;
 
-  explicit nsIntervalSet(mozilla::PresShell *aPresShell);
+  explicit nsIntervalSet(mozilla::PresShell* aPresShell);
   ~nsIntervalSet();
 
   /*
@@ -58,15 +58,15 @@ class nsIntervalSet {
 
     coord_type mBegin;
     coord_type mEnd;
-    Interval *mPrev;
-    Interval *mNext;
+    Interval* mPrev;
+    Interval* mNext;
   };
 
-  void *AllocateInterval();
-  void FreeInterval(Interval *aInterval);
+  void* AllocateInterval();
+  void FreeInterval(Interval* aInterval);
 
-  Interval *mList;
-  mozilla::PresShell *mPresShell;
+  Interval* mList;
+  mozilla::PresShell* mPresShell;
 };
 
 #endif  // !defined(nsIntervalSet_h___)
diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp
index 7807f4cf036e4..597ca45e6620e 100644
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -33,30 +33,30 @@ using namespace mozilla::dom;
 // -----------------------------------------------------------
 
 struct MappedAttrTableEntry : public PLDHashEntryHdr {
-  nsMappedAttributes *mAttributes;
+  nsMappedAttributes* mAttributes;
 };
 
-static PLDHashNumber MappedAttrTable_HashKey(const void *key) {
-  nsMappedAttributes *attributes =
-      static_cast(const_cast(key));
+static PLDHashNumber MappedAttrTable_HashKey(const void* key) {
+  nsMappedAttributes* attributes =
+      static_cast(const_cast(key));
 
   return attributes->HashValue();
 }
 
-static void MappedAttrTable_ClearEntry(PLDHashTable *table,
-                                       PLDHashEntryHdr *hdr) {
-  MappedAttrTableEntry *entry = static_cast(hdr);
+static void MappedAttrTable_ClearEntry(PLDHashTable* table,
+                                       PLDHashEntryHdr* hdr) {
+  MappedAttrTableEntry* entry = static_cast(hdr);
 
   entry->mAttributes->DropStyleSheetReference();
   memset(entry, 0, sizeof(MappedAttrTableEntry));
 }
 
-static bool MappedAttrTable_MatchEntry(const PLDHashEntryHdr *hdr,
-                                       const void *key) {
-  nsMappedAttributes *attributes =
-      static_cast(const_cast(key));
-  const MappedAttrTableEntry *entry =
-      static_cast(hdr);
+static bool MappedAttrTable_MatchEntry(const PLDHashEntryHdr* hdr,
+                                       const void* key) {
+  nsMappedAttributes* attributes =
+      static_cast(const_cast(key));
+  const MappedAttrTableEntry* entry =
+      static_cast(hdr);
 
   return attributes->Equals(entry->mAttributes);
 }
@@ -69,14 +69,14 @@ static const PLDHashTableOps MappedAttrTable_Ops = {
 
 // -----------------------------------------------------------
 
-nsHTMLStyleSheet::nsHTMLStyleSheet(Document *aDocument)
+nsHTMLStyleSheet::nsHTMLStyleSheet(Document* aDocument)
     : mDocument(aDocument),
       mMappedAttrTable(&MappedAttrTable_Ops, sizeof(MappedAttrTableEntry)),
       mMappedAttrsDirty(false) {
   MOZ_ASSERT(aDocument);
 }
 
-void nsHTMLStyleSheet::SetOwningDocument(Document *aDocument) {
+void nsHTMLStyleSheet::SetOwningDocument(Document* aDocument) {
   mDocument = aDocument;  // not refcounted
 }
 
@@ -90,7 +90,7 @@ void nsHTMLStyleSheet::Reset() {
 }
 
 nsresult nsHTMLStyleSheet::ImplLinkColorSetter(
-    RefPtr &aDecl, nscolor aColor) {
+    RefPtr& aDecl, nscolor aColor) {
   if (!mDocument || !mDocument->GetPresShell()) {
     return NS_OK;
   }
@@ -101,8 +101,8 @@ nsresult nsHTMLStyleSheet::ImplLinkColorSetter(
 
   // Now make sure we restyle any links that might need it.  This
   // shouldn't happen often, so just rebuilding everything is ok.
-  if (Element *root = mDocument->GetRootElement()) {
-    RestyleManager *rm = mDocument->GetPresContext()->RestyleManager();
+  if (Element* root = mDocument->GetRootElement()) {
+    RestyleManager* rm = mDocument->GetPresContext()->RestyleManager();
     rm->PostRestyleEvent(root, RestyleHint::RestyleSubtree(), nsChangeHint(0));
   }
   return NS_OK;
@@ -121,9 +121,9 @@ nsresult nsHTMLStyleSheet::SetVisitedLinkColor(nscolor aColor) {
 }
 
 already_AddRefed nsHTMLStyleSheet::UniqueMappedAttributes(
-    nsMappedAttributes *aMapped) {
+    nsMappedAttributes* aMapped) {
   mMappedAttrsDirty = true;
-  auto entry = static_cast(
+  auto entry = static_cast(
       mMappedAttrTable.Add(aMapped, fallible));
   if (!entry) return nullptr;
   if (!entry->mAttributes) {
@@ -134,7 +134,7 @@ already_AddRefed nsHTMLStyleSheet::UniqueMappedAttributes(
   return ret.forget();
 }
 
-void nsHTMLStyleSheet::DropMappedAttributes(nsMappedAttributes *aMapped) {
+void nsHTMLStyleSheet::DropMappedAttributes(nsMappedAttributes* aMapped) {
   NS_ENSURE_TRUE_VOID(aMapped);
 #ifdef DEBUG
   uint32_t entryCount = mMappedAttrTable.EntryCount() - 1;
@@ -147,8 +147,7 @@ void nsHTMLStyleSheet::DropMappedAttributes(nsMappedAttributes *aMapped) {
 
 void nsHTMLStyleSheet::CalculateMappedServoDeclarations() {
   for (auto iter = mMappedAttrTable.Iter(); !iter.Done(); iter.Next()) {
-    MappedAttrTableEntry *attr =
-        static_cast(iter.Get());
+    MappedAttrTableEntry* attr = static_cast(iter.Get());
     if (attr->mAttributes->GetServoStyle()) {
       // Only handle cases which haven't been filled in already
       continue;
@@ -163,7 +162,7 @@ size_t nsHTMLStyleSheet::DOMSizeOfIncludingThis(
 
   n += mMappedAttrTable.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (auto iter = mMappedAttrTable.ConstIter(); !iter.Done(); iter.Next()) {
-    auto entry = static_cast(iter.Get());
+    auto entry = static_cast(iter.Get());
     n += entry->mAttributes->SizeOfIncludingThis(aMallocSizeOf);
   }
 
diff --git a/layout/style/test/ListCSSProperties.cpp b/layout/style/test/ListCSSProperties.cpp
index 39ec97dc95886..a48c9b662046d 100644
--- a/layout/style/test/ListCSSProperties.cpp
+++ b/layout/style/test/ListCSSProperties.cpp
@@ -15,9 +15,9 @@
 #define STRINGIFY_METHOD(method_) #method_
 
 struct PropertyInfo {
-  const char *propName;
-  const char *domName;
-  const char *pref;
+  const char* propName;
+  const char* domName;
+  const char* pref;
 };
 
 const PropertyInfo gLonghandProperties[] = {
@@ -38,7 +38,7 @@ const PropertyInfo gLonghandProperties[] = {
  * be used.  They're in the same order as the above list, with some
  * items skipped.
  */
-const char *gLonghandPropertiesWithDOMProp[] = {
+const char* gLonghandPropertiesWithDOMProp[] = {
 
 #define CSS_PROP_LIST_EXCLUDE_INTERNAL
 #define CSS_PROP_LONGHAND(name_, ...) #name_,
@@ -67,7 +67,7 @@ const PropertyInfo gShorthandProperties[] = {
 };
 
 /* see gLonghandPropertiesWithDOMProp */
-const char *gShorthandPropertiesWithDOMProp[] = {
+const char* gShorthandPropertiesWithDOMProp[] = {
 
 #define CSS_PROP_LIST_EXCLUDE_INTERNAL
 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) #name_,
@@ -83,7 +83,7 @@ const char *gShorthandPropertiesWithDOMProp[] = {
 
 #undef STRINGIFY_METHOD
 
-const char *gInaccessibleProperties[] = {
+const char* gInaccessibleProperties[] = {
     // Don't print the properties that aren't accepted by the parser, per
     // CSSParserImpl::ParseProperty
     "-x-cols",
@@ -107,22 +107,22 @@ const char *gInaccessibleProperties[] = {
     "-moz-window-shadow",                    // chrome-only internal properties
 };
 
-inline int is_inaccessible(const char *aPropName) {
+inline int is_inaccessible(const char* aPropName) {
   for (unsigned j = 0; j < MOZ_ARRAY_LENGTH(gInaccessibleProperties); ++j) {
     if (strcmp(aPropName, gInaccessibleProperties[j]) == 0) return 1;
   }
   return 0;
 }
 
-void print_array(const char *aName, const PropertyInfo *aProps,
-                 unsigned aPropsLength, const char *const *aDOMProps,
+void print_array(const char* aName, const PropertyInfo* aProps,
+                 unsigned aPropsLength, const char* const* aDOMProps,
                  unsigned aDOMPropsLength) {
   printf("var %s = [\n", aName);
 
   int first = 1;
   unsigned j = 0;  // index into DOM prop list
   for (unsigned i = 0; i < aPropsLength; ++i) {
-    const PropertyInfo *p = aProps + i;
+    const PropertyInfo* p = aProps + i;
 
     if (is_inaccessible(p->propName))
       // inaccessible properties never have DOM props, so don't
diff --git a/layout/style/test/ParseCSS.cpp b/layout/style/test/ParseCSS.cpp
index 82a4b91f4bb2b..04e37d48e2bb0 100644
--- a/layout/style/test/ParseCSS.cpp
+++ b/layout/style/test/ParseCSS.cpp
@@ -24,20 +24,20 @@
 
 using namespace mozilla;
 
-static already_AddRefed FileToURI(const char *aFilename,
-                                          nsresult *aRv = 0) {
+static already_AddRefed FileToURI(const char* aFilename,
+                                          nsresult* aRv = 0) {
   nsCOMPtr lf(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, aRv));
   NS_ENSURE_TRUE(lf, nullptr);
   // XXX Handle relative paths somehow.
   lf->InitWithNativePath(nsDependentCString(aFilename));
 
-  nsIURI *uri = nullptr;
+  nsIURI* uri = nullptr;
   nsresult rv = NS_NewFileURI(&uri, lf);
   if (aRv) *aRv = rv;
   return uri;
 }
 
-static int ParseCSSFile(nsIURI *aSheetURI) {
+static int ParseCSSFile(nsIURI* aSheetURI) {
   RefPtr = new mozilla::css::Loader();
   RefPtr sheet;
   loader->LoadSheetSync(aSheetURI, getter_AddRefs(sheet));
@@ -53,7 +53,7 @@ static int ParseCSSFile(nsIURI *aSheetURI) {
   return 0;
 }
 
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
   if (argc < 2) {
     fprintf(stderr, "%s [FILE]...\n", argv[0]);
   }
@@ -62,7 +62,7 @@ int main(int argc, char **argv) {
 
   int res = 0;
   for (int i = 1; i < argc; ++i) {
-    const char *filename = argv[i];
+    const char* filename = argv[i];
 
     printf("\nParsing %s.\n", filename);
 
diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp
index d5773088d1343..c0929fb2cfb6a 100644
--- a/layout/svg/nsSVGPatternFrame.cpp
+++ b/layout/svg/nsSVGPatternFrame.cpp
@@ -36,8 +36,8 @@ using namespace mozilla::image;
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGPatternFrame::nsSVGPatternFrame(ComputedStyle *aStyle,
-                                     nsPresContext *aPresContext)
+nsSVGPatternFrame::nsSVGPatternFrame(ComputedStyle* aStyle,
+                                     nsPresContext* aPresContext)
     : nsSVGPaintServerFrame(aStyle, aPresContext, kClassID),
       mSource(nullptr),
       mLoopFlag(false),
@@ -49,7 +49,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsSVGPatternFrame)
 // nsIFrame methods:
 
 nsresult nsSVGPatternFrame::AttributeChanged(int32_t aNameSpaceID,
-                                             nsAtom *aAttribute,
+                                             nsAtom* aAttribute,
                                              int32_t aModType) {
   if (aNameSpaceID == kNameSpaceID_None &&
       (aAttribute == nsGkAtoms::patternUnits ||
@@ -77,8 +77,8 @@ nsresult nsSVGPatternFrame::AttributeChanged(int32_t aNameSpaceID,
 }
 
 #ifdef DEBUG
-void nsSVGPatternFrame::Init(nsIContent *aContent, nsContainerFrame *aParent,
-                             nsIFrame *aPrevInFlow) {
+void nsSVGPatternFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
+                             nsIFrame* aPrevInFlow) {
   NS_ASSERTION(aContent->IsSVGElement(nsGkAtoms::pattern),
                "Content is not an SVG pattern");
 
@@ -113,7 +113,7 @@ gfxMatrix nsSVGPatternFrame::GetCanvasTM() {
 // -------------------------------------------------------------------------
 
 /** Calculate the maximum expansion of a matrix */
-static float MaxExpansion(const Matrix &aMatrix) {
+static float MaxExpansion(const Matrix& aMatrix) {
   // maximum expansion derivation from
   // http://lists.cairographics.org/archives/cairo/2004-October/001980.html
   // and also implemented in cairo_matrix_transformed_circle_major_axis
@@ -132,7 +132,7 @@ static float MaxExpansion(const Matrix &aMatrix) {
 // scale if the viewBox is specified and _patternUnits_ is set to or defaults to
 // objectBoundingBox though, since in that case the viewBox is relative to the
 // bbox
-static bool IncludeBBoxScale(const SVGAnimatedViewBox &aViewBox,
+static bool IncludeBBoxScale(const SVGAnimatedViewBox& aViewBox,
                              uint32_t aPatternContentUnits,
                              uint32_t aPatternUnits) {
   return (!aViewBox.IsExplicitlySet() &&
@@ -144,9 +144,9 @@ static bool IncludeBBoxScale(const SVGAnimatedViewBox &aViewBox,
 // Given the matrix for the pattern element's own transform, this returns a
 // combined matrix including the transforms applicable to its target.
 static Matrix GetPatternMatrix(uint16_t aPatternUnits,
-                               const Matrix &patternTransform,
-                               const gfxRect &bbox, const gfxRect &callerBBox,
-                               const Matrix &callerCTM) {
+                               const Matrix& patternTransform,
+                               const gfxRect& bbox, const gfxRect& callerBBox,
+                               const Matrix& callerCTM) {
   // We really want the pattern matrix to handle translations
   gfxFloat minx = bbox.X();
   gfxFloat miny = bbox.Y();
@@ -164,12 +164,12 @@ static Matrix GetPatternMatrix(uint16_t aPatternUnits,
   return patternMatrix;
 }
 
-static nsresult GetTargetGeometry(gfxRect *aBBox,
-                                  const SVGAnimatedViewBox &aViewBox,
+static nsresult GetTargetGeometry(gfxRect* aBBox,
+                                  const SVGAnimatedViewBox& aViewBox,
                                   uint16_t aPatternContentUnits,
-                                  uint16_t aPatternUnits, nsIFrame *aTarget,
-                                  const Matrix &aContextMatrix,
-                                  const gfxRect *aOverrideBounds) {
+                                  uint16_t aPatternUnits, nsIFrame* aTarget,
+                                  const Matrix& aContextMatrix,
+                                  const gfxRect* aOverrideBounds) {
   *aBBox = aOverrideBounds
                ? *aOverrideBounds
                : nsSVGUtils::GetBBox(aTarget,
@@ -193,10 +193,10 @@ static nsresult GetTargetGeometry(gfxRect *aBBox,
 }
 
 already_AddRefed nsSVGPatternFrame::PaintPattern(
-    const DrawTarget *aDrawTarget, Matrix *patternMatrix,
-    const Matrix &aContextMatrix, nsIFrame *aSource,
+    const DrawTarget* aDrawTarget, Matrix* patternMatrix,
+    const Matrix& aContextMatrix, nsIFrame* aSource,
     nsStyleSVGPaint nsStyleSVG::*aFillOrStroke, float aGraphicOpacity,
-    const gfxRect *aOverrideBounds, imgDrawingParams &aImgParams) {
+    const gfxRect* aOverrideBounds, imgDrawingParams& aImgParams) {
   /*
    * General approach:
    *    Set the content geometry stuff
@@ -209,14 +209,14 @@ already_AddRefed nsSVGPatternFrame::PaintPattern(
    *    Return
    */
 
-  nsSVGPatternFrame *patternWithChildren = GetPatternWithChildren();
+  nsSVGPatternFrame* patternWithChildren = GetPatternWithChildren();
   if (!patternWithChildren) {
     // Either no kids or a bad reference
     return nullptr;
   }
-  nsIFrame *firstKid = patternWithChildren->mFrames.FirstChild();
+  nsIFrame* firstKid = patternWithChildren->mFrames.FirstChild();
 
-  const SVGAnimatedViewBox &viewBox = GetViewBox();
+  const SVGAnimatedViewBox& viewBox = GetViewBox();
 
   uint16_t patternContentUnits =
       GetEnumValue(SVGPatternElement::PATTERNCONTENTUNITS);
@@ -346,7 +346,7 @@ already_AddRefed nsSVGPatternFrame::PaintPattern(
 
   if (aSource->IsFrameOfType(nsIFrame::eSVGGeometry)) {
     // Set the geometrical parent of the pattern we are rendering
-    patternWithChildren->mSource = static_cast(aSource);
+    patternWithChildren->mSource = static_cast(aSource);
   }
 
   // Delay checking NS_FRAME_DRAWING_AS_PAINTSERVER bit until here so we can
@@ -354,11 +354,11 @@ already_AddRefed nsSVGPatternFrame::PaintPattern(
   if (!(patternWithChildren->GetStateBits() &
         NS_FRAME_DRAWING_AS_PAINTSERVER)) {
     AutoSetRestorePaintServerState paintServer(patternWithChildren);
-    for (nsIFrame *kid = firstKid; kid; kid = kid->GetNextSibling()) {
+    for (nsIFrame* kid = firstKid; kid; kid = kid->GetNextSibling()) {
       gfxMatrix tm = *(patternWithChildren->mCTM);
 
       // The CTM of each frame referencing us can be different
-      nsSVGDisplayableFrame *SVGFrame = do_QueryFrame(kid);
+      nsSVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
       if (SVGFrame) {
         SVGFrame->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
         tm = nsSVGUtils::GetTransformMatrixInUserSpace(kid) * tm;
@@ -383,7 +383,7 @@ already_AddRefed nsSVGPatternFrame::PaintPattern(
 // How do we handle the insertion of a new frame?
 // We really don't want to rerender this every time,
 // do we?
-nsSVGPatternFrame *nsSVGPatternFrame::GetPatternWithChildren() {
+nsSVGPatternFrame* nsSVGPatternFrame::GetPatternWithChildren() {
   // Do we have any children ourselves?
   if (!mFrames.IsEmpty()) {
     return this;
@@ -401,7 +401,7 @@ nsSVGPatternFrame *nsSVGPatternFrame::GetPatternWithChildren() {
     return nullptr;
   }
 
-  nsSVGPatternFrame *next = GetReferencedPattern();
+  nsSVGPatternFrame* next = GetReferencedPattern();
   if (!next) {
     return nullptr;
   }
@@ -410,9 +410,9 @@ nsSVGPatternFrame *nsSVGPatternFrame::GetPatternWithChildren() {
 }
 
 uint16_t nsSVGPatternFrame::GetEnumValue(uint32_t aIndex,
-                                         nsIContent *aDefault) {
-  SVGAnimatedEnumeration &thisEnum =
-      static_cast(GetContent())->mEnumAttributes[aIndex];
+                                         nsIContent* aDefault) {
+  SVGAnimatedEnumeration& thisEnum =
+      static_cast(GetContent())->mEnumAttributes[aIndex];
 
   if (thisEnum.IsExplicitlySet()) {
     return thisEnum.GetAnimValue();
@@ -425,23 +425,22 @@ uint16_t nsSVGPatternFrame::GetEnumValue(uint32_t aIndex,
                                         &sRefChainLengthCounter);
   if (MOZ_UNLIKELY(!refChainGuard.Reference())) {
     // Break reference chain
-    return static_cast(aDefault)
+    return static_cast(aDefault)
         ->mEnumAttributes[aIndex]
         .GetAnimValue();
   }
 
-  nsSVGPatternFrame *next = GetReferencedPattern();
+  nsSVGPatternFrame* next = GetReferencedPattern();
   return next ? next->GetEnumValue(aIndex, aDefault)
-              : static_cast(aDefault)
+              : static_cast(aDefault)
                     ->mEnumAttributes[aIndex]
                     .GetAnimValue();
 }
 
-SVGAnimatedTransformList *nsSVGPatternFrame::GetPatternTransformList(
-    nsIContent *aDefault) {
-  SVGAnimatedTransformList *thisTransformList =
-      static_cast(GetContent())
-          ->GetAnimatedTransformList();
+SVGAnimatedTransformList* nsSVGPatternFrame::GetPatternTransformList(
+    nsIContent* aDefault) {
+  SVGAnimatedTransformList* thisTransformList =
+      static_cast(GetContent())->GetAnimatedTransformList();
 
   if (thisTransformList && thisTransformList->IsExplicitlySet())
     return thisTransformList;
@@ -453,17 +452,17 @@ SVGAnimatedTransformList *nsSVGPatternFrame::GetPatternTransformList(
                                         &sRefChainLengthCounter);
   if (MOZ_UNLIKELY(!refChainGuard.Reference())) {
     // Break reference chain
-    return static_cast(aDefault)->mPatternTransform.get();
+    return static_cast(aDefault)->mPatternTransform.get();
   }
 
-  nsSVGPatternFrame *next = GetReferencedPattern();
+  nsSVGPatternFrame* next = GetReferencedPattern();
   return next ? next->GetPatternTransformList(aDefault)
-              : static_cast(aDefault)
+              : static_cast(aDefault)
                     ->mPatternTransform.get();
 }
 
 gfxMatrix nsSVGPatternFrame::GetPatternTransform() {
-  SVGAnimatedTransformList *animTransformList =
+  SVGAnimatedTransformList* animTransformList =
       GetPatternTransformList(GetContent());
   if (!animTransformList) {
     return gfxMatrix();
@@ -472,9 +471,9 @@ gfxMatrix nsSVGPatternFrame::GetPatternTransform() {
   return animTransformList->GetAnimValue().GetConsolidationMatrix();
 }
 
-const SVGAnimatedViewBox &nsSVGPatternFrame::GetViewBox(nsIContent *aDefault) {
-  const SVGAnimatedViewBox &thisViewBox =
-      static_cast(GetContent())->mViewBox;
+const SVGAnimatedViewBox& nsSVGPatternFrame::GetViewBox(nsIContent* aDefault) {
+  const SVGAnimatedViewBox& thisViewBox =
+      static_cast(GetContent())->mViewBox;
 
   if (thisViewBox.IsExplicitlySet()) {
     return thisViewBox;
@@ -487,18 +486,18 @@ const SVGAnimatedViewBox &nsSVGPatternFrame::GetViewBox(nsIContent *aDefault) {
                                         &sRefChainLengthCounter);
   if (MOZ_UNLIKELY(!refChainGuard.Reference())) {
     // Break reference chain
-    return static_cast(aDefault)->mViewBox;
+    return static_cast(aDefault)->mViewBox;
   }
 
-  nsSVGPatternFrame *next = GetReferencedPattern();
+  nsSVGPatternFrame* next = GetReferencedPattern();
   return next ? next->GetViewBox(aDefault)
-              : static_cast(aDefault)->mViewBox;
+              : static_cast(aDefault)->mViewBox;
 }
 
-const SVGAnimatedPreserveAspectRatio &nsSVGPatternFrame::GetPreserveAspectRatio(
-    nsIContent *aDefault) {
-  const SVGAnimatedPreserveAspectRatio &thisPar =
-      static_cast(GetContent())->mPreserveAspectRatio;
+const SVGAnimatedPreserveAspectRatio& nsSVGPatternFrame::GetPreserveAspectRatio(
+    nsIContent* aDefault) {
+  const SVGAnimatedPreserveAspectRatio& thisPar =
+      static_cast(GetContent())->mPreserveAspectRatio;
 
   if (thisPar.IsExplicitlySet()) {
     return thisPar;
@@ -511,20 +510,18 @@ const SVGAnimatedPreserveAspectRatio &nsSVGPatternFrame::GetPreserveAspectRatio(
                                         &sRefChainLengthCounter);
   if (MOZ_UNLIKELY(!refChainGuard.Reference())) {
     // Break reference chain
-    return static_cast(aDefault)->mPreserveAspectRatio;
+    return static_cast(aDefault)->mPreserveAspectRatio;
   }
 
-  nsSVGPatternFrame *next = GetReferencedPattern();
-  return next
-             ? next->GetPreserveAspectRatio(aDefault)
-             : static_cast(aDefault)->mPreserveAspectRatio;
+  nsSVGPatternFrame* next = GetReferencedPattern();
+  return next ? next->GetPreserveAspectRatio(aDefault)
+              : static_cast(aDefault)->mPreserveAspectRatio;
 }
 
-const SVGAnimatedLength *nsSVGPatternFrame::GetLengthValue(
-    uint32_t aIndex, nsIContent *aDefault) {
-  const SVGAnimatedLength *thisLength =
-      &static_cast(GetContent())
-           ->mLengthAttributes[aIndex];
+const SVGAnimatedLength* nsSVGPatternFrame::GetLengthValue(
+    uint32_t aIndex, nsIContent* aDefault) {
+  const SVGAnimatedLength* thisLength =
+      &static_cast(GetContent())->mLengthAttributes[aIndex];
 
   if (thisLength->IsExplicitlySet()) {
     return thisLength;
@@ -537,26 +534,26 @@ const SVGAnimatedLength *nsSVGPatternFrame::GetLengthValue(
                                         &sRefChainLengthCounter);
   if (MOZ_UNLIKELY(!refChainGuard.Reference())) {
     // Break reference chain
-    return &static_cast(aDefault)
+    return &static_cast(aDefault)
                 ->mLengthAttributes[aIndex];
   }
 
-  nsSVGPatternFrame *next = GetReferencedPattern();
+  nsSVGPatternFrame* next = GetReferencedPattern();
   return next ? next->GetLengthValue(aIndex, aDefault)
-              : &static_cast(aDefault)
+              : &static_cast(aDefault)
                      ->mLengthAttributes[aIndex];
 }
 
 // Private (helper) methods
 
-nsSVGPatternFrame *nsSVGPatternFrame::GetReferencedPattern() {
+nsSVGPatternFrame* nsSVGPatternFrame::GetReferencedPattern() {
   if (mNoHRefURI) {
     return nullptr;
   }
 
-  auto GetHref = [this](nsAString &aHref) {
-    SVGPatternElement *pattern =
-        static_cast(this->GetContent());
+  auto GetHref = [this](nsAString& aHref) {
+    SVGPatternElement* pattern =
+        static_cast(this->GetContent());
     if (pattern->mStringAttributes[SVGPatternElement::HREF].IsExplicitlySet()) {
       pattern->mStringAttributes[SVGPatternElement::HREF].GetAnimValue(aHref,
                                                                        pattern);
@@ -567,11 +564,11 @@ nsSVGPatternFrame *nsSVGPatternFrame::GetReferencedPattern() {
     this->mNoHRefURI = aHref.IsEmpty();
   };
 
-  nsIFrame *tframe = SVGObserverUtils::GetAndObserveTemplate(this, GetHref);
+  nsIFrame* tframe = SVGObserverUtils::GetAndObserveTemplate(this, GetHref);
   if (tframe) {
     LayoutFrameType frameType = tframe->Type();
     if (frameType == LayoutFrameType::SVGPattern) {
-      return static_cast(tframe);
+      return static_cast(tframe);
     }
     // We don't call SVGObserverUtils::RemoveTemplateObserver and set
     // `mNoHRefURI = false` here since we want to be invalidated if the ID
@@ -582,9 +579,9 @@ nsSVGPatternFrame *nsSVGPatternFrame::GetReferencedPattern() {
 }
 
 gfxRect nsSVGPatternFrame::GetPatternRect(uint16_t aPatternUnits,
-                                          const gfxRect &aTargetBBox,
-                                          const Matrix &aTargetCTM,
-                                          nsIFrame *aTarget) {
+                                          const gfxRect& aTargetBBox,
+                                          const Matrix& aTargetCTM,
+                                          nsIFrame* aTarget) {
   // We need to initialize our box
   float x, y, width, height;
 
@@ -611,14 +608,14 @@ gfxRect nsSVGPatternFrame::GetPatternRect(uint16_t aPatternUnits,
   return gfxRect(x, y, width, height);
 }
 
-gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox &aViewBox,
+gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox& aViewBox,
                                           uint16_t aPatternContentUnits,
                                           uint16_t aPatternUnits,
-                                          const gfxRect &callerBBox,
-                                          const Matrix &callerCTM,
-                                          nsIFrame *aTarget) {
-  SVGViewportElement *ctx = nullptr;
-  nsIContent *targetContent = aTarget->GetContent();
+                                          const gfxRect& callerBBox,
+                                          const Matrix& callerCTM,
+                                          nsIFrame* aTarget) {
+  SVGViewportElement* ctx = nullptr;
+  nsIContent* targetContent = aTarget->GetContent();
   gfxFloat scaleX, scaleY;
 
   // The objectBoundingBox conversion must be handled in the CTM:
@@ -627,7 +624,7 @@ gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox &aViewBox,
     scaleY = callerBBox.Height();
   } else {
     if (targetContent->IsSVGElement()) {
-      ctx = static_cast(targetContent)->GetCtx();
+      ctx = static_cast(targetContent)->GetCtx();
     }
     scaleX = scaleY = MaxExpansion(callerCTM);
   }
@@ -635,7 +632,7 @@ gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox &aViewBox,
   if (!aViewBox.IsExplicitlySet()) {
     return gfxMatrix(scaleX, 0.0, 0.0, scaleY, 0.0, 0.0);
   }
-  const SVGViewBox &viewBox = aViewBox.GetAnimValue();
+  const SVGViewBox& viewBox = aViewBox.GetAnimValue();
 
   if (viewBox.height <= 0.0f || viewBox.width <= 0.0f) {
     return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);  // singular
@@ -672,10 +669,10 @@ gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox &aViewBox,
 //----------------------------------------------------------------------
 // nsSVGPaintServerFrame methods:
 already_AddRefed nsSVGPatternFrame::GetPaintServerPattern(
-    nsIFrame *aSource, const DrawTarget *aDrawTarget,
-    const gfxMatrix &aContextMatrix, nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
-    float aGraphicOpacity, imgDrawingParams &aImgParams,
-    const gfxRect *aOverrideBounds) {
+    nsIFrame* aSource, const DrawTarget* aDrawTarget,
+    const gfxMatrix& aContextMatrix, nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
+    float aGraphicOpacity, imgDrawingParams& aImgParams,
+    const gfxRect* aOverrideBounds) {
   if (aGraphicOpacity == 0.0f) {
     return do_AddRef(new gfxPattern(Color()));
   }
@@ -704,7 +701,7 @@ already_AddRefed nsSVGPatternFrame::GetPaintServerPattern(
 // Public functions
 // -------------------------------------------------------------------------
 
-nsIFrame *NS_NewSVGPatternFrame(PresShell *aPresShell, ComputedStyle *aStyle) {
+nsIFrame* NS_NewSVGPatternFrame(PresShell* aPresShell, ComputedStyle* aStyle) {
   return new (aPresShell)
       nsSVGPatternFrame(aStyle, aPresShell->GetPresContext());
 }
diff --git a/layout/tables/BasicTableLayoutStrategy.cpp b/layout/tables/BasicTableLayoutStrategy.cpp
index e6f63abd1d8e1..b4a7ff0e496cc 100644
--- a/layout/tables/BasicTableLayoutStrategy.cpp
+++ b/layout/tables/BasicTableLayoutStrategy.cpp
@@ -28,7 +28,7 @@ namespace css = mozilla::css;
 
 #undef DEBUG_TABLE_STRATEGY
 
-BasicTableLayoutStrategy::BasicTableLayoutStrategy(nsTableFrame *aTableFrame)
+BasicTableLayoutStrategy::BasicTableLayoutStrategy(nsTableFrame* aTableFrame)
     : nsITableLayoutStrategy(nsITableLayoutStrategy::Auto),
       mTableFrame(aTableFrame) {
   MarkIntrinsicISizesDirty();
@@ -38,7 +38,7 @@ BasicTableLayoutStrategy::BasicTableLayoutStrategy(nsTableFrame *aTableFrame)
 BasicTableLayoutStrategy::~BasicTableLayoutStrategy() {}
 
 /* virtual */
-nscoord BasicTableLayoutStrategy::GetMinISize(gfxContext *aRenderingContext) {
+nscoord BasicTableLayoutStrategy::GetMinISize(gfxContext* aRenderingContext) {
   DISPLAY_MIN_INLINE_SIZE(mTableFrame, mMinISize);
   if (mMinISize == NS_INTRINSIC_WIDTH_UNKNOWN) {
     ComputeIntrinsicISizes(aRenderingContext);
@@ -47,7 +47,7 @@ nscoord BasicTableLayoutStrategy::GetMinISize(gfxContext *aRenderingContext) {
 }
 
 /* virtual */
-nscoord BasicTableLayoutStrategy::GetPrefISize(gfxContext *aRenderingContext,
+nscoord BasicTableLayoutStrategy::GetPrefISize(gfxContext* aRenderingContext,
                                                bool aComputingSize) {
   DISPLAY_PREF_INLINE_SIZE(mTableFrame, mPrefISize);
   NS_ASSERTION((mPrefISize == NS_INTRINSIC_WIDTH_UNKNOWN) ==
@@ -75,11 +75,11 @@ struct CellISizeInfo {
 
 // Used for both column and cell calculations.  The parts needed only
 // for cells are skipped when aIsCell is false.
-static CellISizeInfo GetISizeInfo(gfxContext *aRenderingContext,
-                                  nsIFrame *aFrame, WritingMode aWM,
+static CellISizeInfo GetISizeInfo(gfxContext* aRenderingContext,
+                                  nsIFrame* aFrame, WritingMode aWM,
                                   bool aIsCell) {
   nscoord minCoord, prefCoord;
-  const nsStylePosition *stylePos = aFrame->StylePosition();
+  const nsStylePosition* stylePos = aFrame->StylePosition();
   bool isQuirks =
       aFrame->PresContext()->CompatibilityMode() == eCompatibility_NavQuirks;
   nscoord boxSizingToBorderEdge = 0;
@@ -122,7 +122,7 @@ static CellISizeInfo GetISizeInfo(gfxContext *aRenderingContext,
   float prefPercent = 0.0f;
   bool hasSpecifiedISize = false;
 
-  const auto &iSize = stylePos->ISize(aWM);
+  const auto& iSize = stylePos->ISize(aWM);
   // NOTE: We're ignoring calc() units with both lengths and percentages here,
   // for lack of a sensible idea for what to do with them.  This means calc()
   // with percentages is basically handled like 'auto' for table cells and
@@ -219,14 +219,14 @@ static CellISizeInfo GetISizeInfo(gfxContext *aRenderingContext,
   return CellISizeInfo(minCoord, prefCoord, prefPercent, hasSpecifiedISize);
 }
 
-static inline CellISizeInfo GetCellISizeInfo(gfxContext *aRenderingContext,
-                                             nsTableCellFrame *aCellFrame,
+static inline CellISizeInfo GetCellISizeInfo(gfxContext* aRenderingContext,
+                                             nsTableCellFrame* aCellFrame,
                                              WritingMode aWM) {
   return GetISizeInfo(aRenderingContext, aCellFrame, aWM, true);
 }
 
-static inline CellISizeInfo GetColISizeInfo(gfxContext *aRenderingContext,
-                                            nsIFrame *aFrame, WritingMode aWM) {
+static inline CellISizeInfo GetColISizeInfo(gfxContext* aRenderingContext,
+                                            nsIFrame* aFrame, WritingMode aWM) {
   return GetISizeInfo(aRenderingContext, aFrame, aWM, false);
 }
 
@@ -237,9 +237,9 @@ static inline CellISizeInfo GetColISizeInfo(gfxContext *aRenderingContext,
  * browsers are).
  */
 void BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(
-    gfxContext *aRenderingContext) {
-  nsTableFrame *tableFrame = mTableFrame;
-  nsTableCellMap *cellMap = tableFrame->GetCellMap();
+    gfxContext* aRenderingContext) {
+  nsTableFrame* tableFrame = mTableFrame;
+  nsTableCellMap* cellMap = tableFrame->GetCellMap();
   WritingMode wm = tableFrame->GetWritingMode();
 
   mozilla::AutoStackArena arena;
@@ -249,7 +249,7 @@ void BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(
   // a colspan.
   int32_t col, col_end;
   for (col = 0, col_end = cellMap->GetColCount(); col < col_end; ++col) {
-    nsTableColFrame *colFrame = tableFrame->GetColFrame(col);
+    nsTableColFrame* colFrame = tableFrame->GetColFrame(col);
     if (!colFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
@@ -282,7 +282,7 @@ void BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(
     // colspans.
     nsCellMapColumnIterator columnIter(cellMap, col);
     int32_t row, colSpan;
-    nsTableCellFrame *cellFrame;
+    nsTableCellFrame* cellFrame;
     while ((cellFrame = columnIter.GetNextFrame(&row, &colSpan))) {
       if (colSpan > 1) {
         spanningCells.AddCell(colSpan, row, col);
@@ -324,7 +324,7 @@ void BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(
   // Starting with smaller colspans makes it more likely that we
   // satisfy all the constraints given and don't distribute space to
   // columns where we don't need it.
-  SpanningCellSorter::Item *item;
+  SpanningCellSorter::Item* item;
   int32_t colSpan;
   while ((item = spanningCells.GetNext(&colSpan))) {
     NS_ASSERTION(colSpan > 1,
@@ -332,11 +332,11 @@ void BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(
     do {
       int32_t row = item->row;
       col = item->col;
-      CellData *cellData = cellMap->GetDataAt(row, col);
+      CellData* cellData = cellMap->GetDataAt(row, col);
       NS_ASSERTION(cellData && cellData->IsOrig(),
                    "bogus result from spanning cell sorter");
 
-      nsTableCellFrame *cellFrame = cellData->GetCellFrame();
+      nsTableCellFrame* cellFrame = cellData->GetCellFrame();
       NS_ASSERTION(cellFrame, "bogus result from spanning cell sorter");
 
       CellISizeInfo info = GetCellISizeInfo(aRenderingContext, cellFrame, wm);
@@ -354,7 +354,7 @@ void BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(
     // for each increment of colspan.
 
     for (col = 0, col_end = cellMap->GetColCount(); col < col_end; ++col) {
-      nsTableColFrame *colFrame = tableFrame->GetColFrame(col);
+      nsTableColFrame* colFrame = tableFrame->GetColFrame(col);
       if (!colFrame) {
         NS_ERROR("column frames out of sync with cell map");
         continue;
@@ -379,7 +379,7 @@ void BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(
   // 100%).  This means layout depends on the order of columns.
   float pct_used = 0.0f;
   for (col = 0, col_end = cellMap->GetColCount(); col < col_end; ++col) {
-    nsTableColFrame *colFrame = tableFrame->GetColFrame(col);
+    nsTableColFrame* colFrame = tableFrame->GetColFrame(col);
     if (!colFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
@@ -395,10 +395,10 @@ void BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(
 }
 
 void BasicTableLayoutStrategy::ComputeIntrinsicISizes(
-    gfxContext *aRenderingContext) {
+    gfxContext* aRenderingContext) {
   ComputeColumnIntrinsicISizes(aRenderingContext);
 
-  nsTableCellMap *cellMap = mTableFrame->GetCellMap();
+  nsTableCellMap* cellMap = mTableFrame->GetCellMap();
   nscoord min = 0, pref = 0, max_small_pct_pref = 0, nonpct_pref_total = 0;
   float pct_total = 0.0f;  // always from 0.0f - 1.0f
   int32_t colCount = cellMap->GetColCount();
@@ -407,7 +407,7 @@ void BasicTableLayoutStrategy::ComputeIntrinsicISizes(
   nscoord add = mTableFrame->GetColSpacing(colCount);
 
   for (int32_t col = 0; col < colCount; ++col) {
-    nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+    nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
     if (!colFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
@@ -485,7 +485,7 @@ void BasicTableLayoutStrategy::MarkIntrinsicISizesDirty() {
 
 /* virtual */
 void BasicTableLayoutStrategy::ComputeColumnISizes(
-    const ReflowInput &aReflowInput) {
+    const ReflowInput& aReflowInput) {
   nscoord iSize = aReflowInput.ComputedISize();
 
   if (mLastCalcISize == iSize) {
@@ -504,7 +504,7 @@ void BasicTableLayoutStrategy::ComputeColumnISizes(
     ComputeIntrinsicISizes(aReflowInput.mRenderingContext);
   }
 
-  nsTableCellMap *cellMap = mTableFrame->GetCellMap();
+  nsTableCellMap* cellMap = mTableFrame->GetCellMap();
   int32_t colCount = cellMap->GetColCount();
   if (colCount <= 0) return;  // nothing to do
 
@@ -525,10 +525,10 @@ void BasicTableLayoutStrategy::DistributePctISizeToColumns(float aSpanPrefPct,
   // and to reduce aSpanPrefPct by columns that already have % isize
 
   int32_t scol, scol_end;
-  nsTableCellMap *cellMap = mTableFrame->GetCellMap();
+  nsTableCellMap* cellMap = mTableFrame->GetCellMap();
   for (scol = aFirstCol, scol_end = aFirstCol + aColCount; scol < scol_end;
        ++scol) {
-    nsTableColFrame *scolFrame = mTableFrame->GetColFrame(scol);
+    nsTableColFrame* scolFrame = mTableFrame->GetColFrame(scol);
     if (!scolFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
@@ -555,7 +555,7 @@ void BasicTableLayoutStrategy::DistributePctISizeToColumns(float aSpanPrefPct,
   const bool spanHasNonPctPref = nonPctTotalPrefISize > 0;  // Loop invariant
   for (scol = aFirstCol, scol_end = aFirstCol + aColCount; scol < scol_end;
        ++scol) {
-    nsTableColFrame *scolFrame = mTableFrame->GetColFrame(scol);
+    nsTableColFrame* scolFrame = mTableFrame->GetColFrame(scol);
     if (!scolFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
@@ -690,9 +690,9 @@ void BasicTableLayoutStrategy::DistributeISizeToColumns(
   int32_t numNonSpecZeroISizeCols = 0;
 
   int32_t col;
-  nsTableCellMap *cellMap = mTableFrame->GetCellMap();
+  nsTableCellMap* cellMap = mTableFrame->GetCellMap();
   for (col = aFirstCol; col < aFirstCol + aColCount; ++col) {
-    nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+    nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
     if (!colFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
@@ -806,7 +806,7 @@ void BasicTableLayoutStrategy::DistributeISizeToColumns(
 #endif
 
   for (col = aFirstCol; col < aFirstCol + aColCount; ++col) {
-    nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+    nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
     if (!colFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
diff --git a/layout/tables/FixedTableLayoutStrategy.cpp b/layout/tables/FixedTableLayoutStrategy.cpp
index 5588035e7ddb2..cfe2e80f5a596 100644
--- a/layout/tables/FixedTableLayoutStrategy.cpp
+++ b/layout/tables/FixedTableLayoutStrategy.cpp
@@ -19,7 +19,7 @@
 
 using namespace mozilla;
 
-FixedTableLayoutStrategy::FixedTableLayoutStrategy(nsTableFrame *aTableFrame)
+FixedTableLayoutStrategy::FixedTableLayoutStrategy(nsTableFrame* aTableFrame)
     : nsITableLayoutStrategy(nsITableLayoutStrategy::Fixed),
       mTableFrame(aTableFrame) {
   MarkIntrinsicISizesDirty();
@@ -29,7 +29,7 @@ FixedTableLayoutStrategy::FixedTableLayoutStrategy(nsTableFrame *aTableFrame)
 FixedTableLayoutStrategy::~FixedTableLayoutStrategy() {}
 
 /* virtual */
-nscoord FixedTableLayoutStrategy::GetMinISize(gfxContext *aRenderingContext) {
+nscoord FixedTableLayoutStrategy::GetMinISize(gfxContext* aRenderingContext) {
   DISPLAY_MIN_INLINE_SIZE(mTableFrame, mMinISize);
   if (mMinISize != NS_INTRINSIC_WIDTH_UNKNOWN) {
     return mMinISize;
@@ -50,7 +50,7 @@ nscoord FixedTableLayoutStrategy::GetMinISize(gfxContext *aRenderingContext) {
   // XXX Should we really ignore 'min-inline-size' and 'max-inline-size'?
   // XXX Should we really ignore inline sizes on column groups?
 
-  nsTableCellMap *cellMap = mTableFrame->GetCellMap();
+  nsTableCellMap* cellMap = mTableFrame->GetCellMap();
   int32_t colCount = cellMap->GetColCount();
 
   nscoord result = 0;
@@ -61,13 +61,13 @@ nscoord FixedTableLayoutStrategy::GetMinISize(gfxContext *aRenderingContext) {
 
   WritingMode wm = mTableFrame->GetWritingMode();
   for (int32_t col = 0; col < colCount; ++col) {
-    nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+    nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
     if (!colFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
     }
     nscoord spacing = mTableFrame->GetColSpacing(col);
-    const auto *styleISize = &colFrame->StylePosition()->ISize(wm);
+    const auto* styleISize = &colFrame->StylePosition()->ISize(wm);
     if (styleISize->ConvertsToLength()) {
       result +=
           colFrame->ComputeISizeValue(aRenderingContext, 0, 0, 0, *styleISize);
@@ -82,7 +82,7 @@ nscoord FixedTableLayoutStrategy::GetMinISize(gfxContext *aRenderingContext) {
       // first row.
       bool originates;
       int32_t colSpan;
-      nsTableCellFrame *cellFrame =
+      nsTableCellFrame* cellFrame =
           cellMap->GetCellInfoAt(0, col, &originates, &colSpan);
       if (cellFrame) {
         styleISize = &cellFrame->StylePosition()->ISize(wm);
@@ -118,7 +118,7 @@ nscoord FixedTableLayoutStrategy::GetMinISize(gfxContext *aRenderingContext) {
 }
 
 /* virtual */
-nscoord FixedTableLayoutStrategy::GetPrefISize(gfxContext *aRenderingContext,
+nscoord FixedTableLayoutStrategy::GetPrefISize(gfxContext* aRenderingContext,
                                                bool aComputingSize) {
   // It's theoretically possible to do something much better here that
   // depends only on the columns and the first row (where we look at
@@ -150,7 +150,7 @@ static inline nscoord AllocateUnassigned(nscoord aUnassignedSpace,
 
 /* virtual */
 void FixedTableLayoutStrategy::ComputeColumnISizes(
-    const ReflowInput &aReflowInput) {
+    const ReflowInput& aReflowInput) {
   nscoord tableISize = aReflowInput.ComputedISize();
 
   if (mLastCalcISize == tableISize) {
@@ -158,7 +158,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
   }
   mLastCalcISize = tableISize;
 
-  nsTableCellMap *cellMap = mTableFrame->GetCellMap();
+  nsTableCellMap* cellMap = mTableFrame->GetCellMap();
   int32_t colCount = cellMap->GetColCount();
 
   if (colCount == 0) {
@@ -198,7 +198,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
 
   WritingMode wm = mTableFrame->GetWritingMode();
   for (int32_t col = 0; col < colCount; ++col) {
-    nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+    nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
     if (!colFrame) {
       oldColISizes.AppendElement(0);
       NS_ERROR("column frames out of sync with cell map");
@@ -206,7 +206,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
     }
     oldColISizes.AppendElement(colFrame->GetFinalISize());
     colFrame->ResetPrefPercent();
-    const auto *styleISize = &colFrame->StylePosition()->ISize(wm);
+    const auto* styleISize = &colFrame->StylePosition()->ISize(wm);
     nscoord colISize;
     if (styleISize->ConvertsToLength()) {
       colISize = colFrame->ComputeISizeValue(aReflowInput.mRenderingContext, 0,
@@ -227,10 +227,10 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
       // first row.
       bool originates;
       int32_t colSpan;
-      nsTableCellFrame *cellFrame =
+      nsTableCellFrame* cellFrame =
           cellMap->GetCellInfoAt(0, col, &originates, &colSpan);
       if (cellFrame) {
-        const nsStylePosition *cellStylePos = cellFrame->StylePosition();
+        const nsStylePosition* cellStylePos = cellFrame->StylePosition();
         styleISize = &cellStylePos->ISize(wm);
         if (styleISize->ConvertsToLength() ||
             (styleISize->IsExtremumLength() &&
@@ -304,7 +304,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
       nscoord reduce = std::min(pctUsed, -unassignedSpace);
       float reduceRatio = float(reduce) / pctTotal;
       for (int32_t col = 0; col < colCount; ++col) {
-        nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+        nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
         if (!colFrame) {
           NS_ERROR("column frames out of sync with cell map");
           continue;
@@ -325,7 +325,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
     // the columns.
     nscoord toAssign = unassignedSpace / unassignedCount;
     for (int32_t col = 0; col < colCount; ++col) {
-      nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+      nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
       if (!colFrame) {
         NS_ERROR("column frames out of sync with cell map");
         continue;
@@ -340,7 +340,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
       // Distribute proportionally to non-percentage columns.
       nscoord specUndist = specTotal;
       for (int32_t col = 0; col < colCount; ++col) {
-        nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+        nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
         if (!colFrame) {
           NS_ERROR("column frames out of sync with cell map");
           continue;
@@ -365,7 +365,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
       // Distribute proportionally to percentage columns.
       float pctUndist = pctTotal;
       for (int32_t col = 0; col < colCount; ++col) {
-        nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+        nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
         if (!colFrame) {
           NS_ERROR("column frames out of sync with cell map");
           continue;
@@ -390,7 +390,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
       // Distribute equally to the zero-iSize columns.
       int32_t colsRemaining = colCount;
       for (int32_t col = 0; col < colCount; ++col) {
-        nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+        nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
         if (!colFrame) {
           NS_ERROR("column frames out of sync with cell map");
           continue;
@@ -406,7 +406,7 @@ void FixedTableLayoutStrategy::ComputeColumnISizes(
     }
   }
   for (int32_t col = 0; col < colCount; ++col) {
-    nsTableColFrame *colFrame = mTableFrame->GetColFrame(col);
+    nsTableColFrame* colFrame = mTableFrame->GetColFrame(col);
     if (!colFrame) {
       NS_ERROR("column frames out of sync with cell map");
       continue;
diff --git a/layout/tables/SpanningCellSorter.cpp b/layout/tables/SpanningCellSorter.cpp
index 69b5b1ad5dd5b..cdf100764daef 100644
--- a/layout/tables/SpanningCellSorter.cpp
+++ b/layout/tables/SpanningCellSorter.cpp
@@ -30,14 +30,14 @@ SpanningCellSorter::~SpanningCellSorter() { delete[] mSortedHashTable; }
     PLDHashTable::ClearEntryStub, nullptr};
 
 /* static */
-PLDHashNumber SpanningCellSorter::HashTableHashKey(const void *key) {
+PLDHashNumber SpanningCellSorter::HashTableHashKey(const void* key) {
   return HashGeneric(key);
 }
 
 /* static */
-bool SpanningCellSorter::HashTableMatchEntry(const PLDHashEntryHdr *hdr,
-                                             const void *key) {
-  const HashTableEntry *entry = static_cast(hdr);
+bool SpanningCellSorter::HashTableMatchEntry(const PLDHashEntryHdr* hdr,
+                                             const void* key) {
+  const HashTableEntry* entry = static_cast(hdr);
   return NS_PTR_TO_INT32(key) == entry->mColSpan;
 }
 
@@ -45,7 +45,7 @@ bool SpanningCellSorter::AddCell(int32_t aColSpan, int32_t aRow, int32_t aCol) {
   NS_ASSERTION(mState == ADDING, "cannot call AddCell after GetNext");
   NS_ASSERTION(aColSpan >= ARRAY_BASE, "cannot add cells with colspan<2");
 
-  Item *i = (Item *)mozilla::AutoStackArena::Allocate(sizeof(Item));
+  Item* i = (Item*)mozilla::AutoStackArena::Allocate(sizeof(Item));
   NS_ENSURE_TRUE(i != nullptr, false);
 
   i->row = aRow;
@@ -56,7 +56,7 @@ bool SpanningCellSorter::AddCell(int32_t aColSpan, int32_t aRow, int32_t aCol) {
     i->next = mArray[index];
     mArray[index] = i;
   } else {
-    auto entry = static_cast(
+    auto entry = static_cast(
         mHashTable.Add(NS_INT32_TO_PTR(aColSpan), fallible));
     NS_ENSURE_TRUE(entry, false);
 
@@ -74,16 +74,16 @@ bool SpanningCellSorter::AddCell(int32_t aColSpan, int32_t aRow, int32_t aCol) {
 }
 
 /* static */
-int SpanningCellSorter::SortArray(const void *a, const void *b, void *closure) {
-  int32_t spanA = (*static_cast(a))->mColSpan;
-  int32_t spanB = (*static_cast(b))->mColSpan;
+int SpanningCellSorter::SortArray(const void* a, const void* b, void* closure) {
+  int32_t spanA = (*static_cast(a))->mColSpan;
+  int32_t spanB = (*static_cast(b))->mColSpan;
 
   if (spanA < spanB) return -1;
   if (spanA == spanB) return 0;
   return 1;
 }
 
-SpanningCellSorter::Item *SpanningCellSorter::GetNext(int32_t *aColSpan) {
+SpanningCellSorter::Item* SpanningCellSorter::GetNext(int32_t* aColSpan) {
   NS_ASSERTION(mState != DONE, "done enumerating, stop calling");
 
   switch (mState) {
@@ -96,14 +96,14 @@ SpanningCellSorter::Item *SpanningCellSorter::GetNext(int32_t *aColSpan) {
       while (mEnumerationIndex < ARRAY_SIZE && !mArray[mEnumerationIndex])
         ++mEnumerationIndex;
       if (mEnumerationIndex < ARRAY_SIZE) {
-        Item *result = mArray[mEnumerationIndex];
+        Item* result = mArray[mEnumerationIndex];
         *aColSpan = IndexToSpan(mEnumerationIndex);
         NS_ASSERTION(result, "logic error");
 #ifdef DEBUG_SPANNING_CELL_SORTER
         printf(
             "SpanningCellSorter[%p]:"
             " returning list for colspan=%d from array\n",
-            static_cast(this), *aColSpan);
+            static_cast(this), *aColSpan);
 #endif
         ++mEnumerationIndex;
         return result;
@@ -112,10 +112,10 @@ SpanningCellSorter::Item *SpanningCellSorter::GetNext(int32_t *aColSpan) {
       mState = ENUMERATING_HASH;
       mEnumerationIndex = 0;
       if (mHashTable.EntryCount() > 0) {
-        HashTableEntry **sh = new HashTableEntry *[mHashTable.EntryCount()];
+        HashTableEntry** sh = new HashTableEntry*[mHashTable.EntryCount()];
         int32_t j = 0;
         for (auto iter = mHashTable.Iter(); !iter.Done(); iter.Next()) {
-          sh[j++] = static_cast(iter.Get());
+          sh[j++] = static_cast(iter.Get());
         }
         NS_QuickSort(sh, mHashTable.EntryCount(), sizeof(sh[0]), SortArray,
                      nullptr);
@@ -124,14 +124,14 @@ SpanningCellSorter::Item *SpanningCellSorter::GetNext(int32_t *aColSpan) {
       MOZ_FALLTHROUGH;
     case ENUMERATING_HASH:
       if (mEnumerationIndex < mHashTable.EntryCount()) {
-        Item *result = mSortedHashTable[mEnumerationIndex]->mItems;
+        Item* result = mSortedHashTable[mEnumerationIndex]->mItems;
         *aColSpan = mSortedHashTable[mEnumerationIndex]->mColSpan;
         NS_ASSERTION(result, "holes in hash table");
 #ifdef DEBUG_SPANNING_CELL_SORTER
         printf(
             "SpanningCellSorter[%p]:"
             " returning list for colspan=%d from hash\n",
-            static_cast(this), *aColSpan);
+            static_cast(this), *aColSpan);
 #endif
         ++mEnumerationIndex;
         return result;
diff --git a/layout/tables/SpanningCellSorter.h b/layout/tables/SpanningCellSorter.h
index 692eda232d5a0..1b8f6960f0175 100644
--- a/layout/tables/SpanningCellSorter.h
+++ b/layout/tables/SpanningCellSorter.h
@@ -28,7 +28,7 @@ class MOZ_STACK_CLASS SpanningCellSorter {
 
   struct Item {
     int32_t row, col;
-    Item *next;
+    Item* next;
   };
 
   /**
@@ -43,7 +43,7 @@ class MOZ_STACK_CLASS SpanningCellSorter {
    * for a colspan value, and the lists are given in order from lowest
    * to highest colspan.  The colspan value is filled in to *aColSpan.
    */
-  Item *GetNext(int32_t *aColSpan);
+  Item* GetNext(int32_t* aColSpan);
 
  private:
   enum State { ADDING, ENUMERATING_ARRAY, ENUMERATING_HASH, DONE };
@@ -54,7 +54,7 @@ class MOZ_STACK_CLASS SpanningCellSorter {
 
   enum { ARRAY_BASE = 2 };
   enum { ARRAY_SIZE = 8 };
-  Item *mArray[ARRAY_SIZE];
+  Item* mArray[ARRAY_SIZE];
   int32_t SpanToIndex(int32_t aSpan) { return aSpan - ARRAY_BASE; }
   int32_t IndexToSpan(int32_t aIndex) { return aIndex + ARRAY_BASE; }
   bool UseArrayForSpan(int32_t aSpan) {
@@ -65,26 +65,26 @@ class MOZ_STACK_CLASS SpanningCellSorter {
   PLDHashTable mHashTable;
   struct HashTableEntry : public PLDHashEntryHdr {
     int32_t mColSpan;
-    Item *mItems;
+    Item* mItems;
   };
 
   static const PLDHashTableOps HashTableOps;
 
-  static PLDHashNumber HashTableHashKey(const void *key);
-  static bool HashTableMatchEntry(const PLDHashEntryHdr *hdr, const void *key);
+  static PLDHashNumber HashTableHashKey(const void* key);
+  static bool HashTableMatchEntry(const PLDHashEntryHdr* hdr, const void* key);
 
-  static int SortArray(const void *a, const void *b, void *closure);
+  static int SortArray(const void* a, const void* b, void* closure);
 
   /* state used only during enumeration */
   uint32_t mEnumerationIndex;  // into mArray or mSortedHashTable
-  HashTableEntry **mSortedHashTable;
+  HashTableEntry** mSortedHashTable;
 
   /*
    * operator new is forbidden since we use the pres shell's stack
    * memory, which much be pushed and popped at points matching a
    * push/pop on the C++ stack.
    */
-  void *operator new(size_t sz) CPP_THROW_NEW { return nullptr; }
+  void* operator new(size_t sz) CPP_THROW_NEW { return nullptr; }
 };
 
 #endif
diff --git a/layout/tables/nsITableCellLayout.h b/layout/tables/nsITableCellLayout.h
index 4d075db339707..9413911689ac8 100644
--- a/layout/tables/nsITableCellLayout.h
+++ b/layout/tables/nsITableCellLayout.h
@@ -25,7 +25,7 @@ class nsITableCellLayout {
 
   /** return the mapped cell's row and column indexes (starting at 0 for each)
    */
-  NS_IMETHOD GetCellIndexes(int32_t &aRowIndex, int32_t &aColIndex) = 0;
+  NS_IMETHOD GetCellIndexes(int32_t& aRowIndex, int32_t& aColIndex) = 0;
 };
 
 #endif
diff --git a/layout/tools/layout-debug/src/nsLayoutDebuggingTools.h b/layout/tools/layout-debug/src/nsLayoutDebuggingTools.h
index 9a7bfb28a70f5..56ed09f15769c 100644
--- a/layout/tools/layout-debug/src/nsLayoutDebuggingTools.h
+++ b/layout/tools/layout-debug/src/nsLayoutDebuggingTools.h
@@ -23,8 +23,8 @@ class nsLayoutDebuggingTools : public nsILayoutDebuggingTools {
   virtual ~nsLayoutDebuggingTools();
 
   void ForceRefresh();
-  nsresult GetBoolPref(const char *aPrefName, bool *aValue);
-  nsresult SetBoolPrefAndRefresh(const char *aPrefName, bool aNewValue);
+  nsresult GetBoolPref(const char* aPrefName, bool* aValue);
+  nsresult SetBoolPrefAndRefresh(const char* aPrefName, bool aNewValue);
 
   nsCOMPtr mDocShell;
 
diff --git a/media/mtransport/SrtpFlow.cpp b/media/mtransport/SrtpFlow.cpp
index 55c03a03ca26c..97634b7a126b2 100644
--- a/media/mtransport/SrtpFlow.cpp
+++ b/media/mtransport/SrtpFlow.cpp
@@ -37,7 +37,7 @@ unsigned int SrtpFlow::SaltSize(int cipher_suite) {
 }
 
 RefPtr SrtpFlow::Create(int cipher_suite, bool inbound,
-                                  const void *key, size_t key_len) {
+                                  const void* key, size_t key_len) {
   nsresult res = Init();
   if (!NS_SUCCEEDED(res)) return nullptr;
 
@@ -89,7 +89,7 @@ RefPtr SrtpFlow::Create(int cipher_suite, bool inbound,
   // This key is copied into the srtp_t object, so we don't
   // need to keep it.
   policy.key =
-      const_cast(static_cast(key));
+      const_cast(static_cast(key));
   policy.ssrc.type = inbound ? ssrc_any_inbound : ssrc_any_outbound;
   policy.ssrc.value = 0;
   policy.ekt = nullptr;
@@ -108,8 +108,8 @@ RefPtr SrtpFlow::Create(int cipher_suite, bool inbound,
   return flow;
 }
 
-nsresult SrtpFlow::CheckInputs(bool protect, void *in, int in_len, int max_len,
-                               int *out_len) {
+nsresult SrtpFlow::CheckInputs(bool protect, void* in, int in_len, int max_len,
+                               int* out_len) {
   MOZ_ASSERT(in);
   if (!in) {
     MOZ_MTLOG(ML_ERROR, "NULL input value");
@@ -142,7 +142,7 @@ nsresult SrtpFlow::CheckInputs(bool protect, void *in, int in_len, int max_len,
   return NS_OK;
 }
 
-nsresult SrtpFlow::ProtectRtp(void *in, int in_len, int max_len, int *out_len) {
+nsresult SrtpFlow::ProtectRtp(void* in, int in_len, int max_len, int* out_len) {
   nsresult res = CheckInputs(true, in, in_len, max_len, out_len);
   if (NS_FAILED(res)) return res;
 
@@ -163,8 +163,8 @@ nsresult SrtpFlow::ProtectRtp(void *in, int in_len, int max_len, int *out_len) {
   return NS_OK;
 }
 
-nsresult SrtpFlow::UnprotectRtp(void *in, int in_len, int max_len,
-                                int *out_len) {
+nsresult SrtpFlow::UnprotectRtp(void* in, int in_len, int max_len,
+                                int* out_len) {
   nsresult res = CheckInputs(false, in, in_len, max_len, out_len);
   if (NS_FAILED(res)) return res;
 
@@ -185,8 +185,8 @@ nsresult SrtpFlow::UnprotectRtp(void *in, int in_len, int max_len,
   return NS_OK;
 }
 
-nsresult SrtpFlow::ProtectRtcp(void *in, int in_len, int max_len,
-                               int *out_len) {
+nsresult SrtpFlow::ProtectRtcp(void* in, int in_len, int max_len,
+                               int* out_len) {
   nsresult res = CheckInputs(true, in, in_len, max_len, out_len);
   if (NS_FAILED(res)) return res;
 
@@ -207,8 +207,8 @@ nsresult SrtpFlow::ProtectRtcp(void *in, int in_len, int max_len,
   return NS_OK;
 }
 
-nsresult SrtpFlow::UnprotectRtcp(void *in, int in_len, int max_len,
-                                 int *out_len) {
+nsresult SrtpFlow::UnprotectRtcp(void* in, int in_len, int max_len,
+                                 int* out_len) {
   nsresult res = CheckInputs(false, in, in_len, max_len, out_len);
   if (NS_FAILED(res)) return res;
 
@@ -230,7 +230,7 @@ nsresult SrtpFlow::UnprotectRtcp(void *in, int in_len, int max_len,
 }
 
 // Statics
-void SrtpFlow::srtp_event_handler(srtp_event_data_t *data) {
+void SrtpFlow::srtp_event_handler(srtp_event_data_t* data) {
   // TODO(ekr@rtfm.com): Implement this
   MOZ_CRASH();
 }
diff --git a/media/mtransport/SrtpFlow.h b/media/mtransport/SrtpFlow.h
index 4071465b17f68..92fbfcf1a58d4 100644
--- a/media/mtransport/SrtpFlow.h
+++ b/media/mtransport/SrtpFlow.h
@@ -42,22 +42,22 @@ class SrtpFlow {
   static unsigned int SaltSize(int cipher_suite);
 
   static RefPtr Create(int cipher_suite, bool inbound,
-                                 const void *key, size_t key_len);
+                                 const void* key, size_t key_len);
 
-  nsresult ProtectRtp(void *in, int in_len, int max_len, int *out_len);
-  nsresult UnprotectRtp(void *in, int in_len, int max_len, int *out_len);
-  nsresult ProtectRtcp(void *in, int in_len, int max_len, int *out_len);
-  nsresult UnprotectRtcp(void *in, int in_len, int max_len, int *out_len);
+  nsresult ProtectRtp(void* in, int in_len, int max_len, int* out_len);
+  nsresult UnprotectRtp(void* in, int in_len, int max_len, int* out_len);
+  nsresult ProtectRtcp(void* in, int in_len, int max_len, int* out_len);
+  nsresult UnprotectRtcp(void* in, int in_len, int max_len, int* out_len);
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SrtpFlow)
 
-  static void srtp_event_handler(srtp_event_data_t *data);
+  static void srtp_event_handler(srtp_event_data_t* data);
 
  private:
   SrtpFlow() : session_(nullptr) {}
 
-  nsresult CheckInputs(bool protect, void *in, int in_len, int max_len,
-                       int *out_len);
+  nsresult CheckInputs(bool protect, void* in, int in_len, int max_len,
+                       int* out_len);
 
   static nsresult Init();
   static bool initialized;  // Was libsrtp initialized? Only happens once.
diff --git a/media/mtransport/dtlsidentity.cpp b/media/mtransport/dtlsidentity.cpp
index bb315922807a1..2dee1dc9cd442 100644
--- a/media/mtransport/dtlsidentity.cpp
+++ b/media/mtransport/dtlsidentity.cpp
@@ -24,17 +24,17 @@
 namespace mozilla {
 
 // TODO(bug 1522632): This function should be moved to NSS
-static SECItem *ExportDEREncryptedPrivateKeyInfo(
-    PK11SlotInfo *slot,    /* optional, encrypt key in this slot */
+static SECItem* ExportDEREncryptedPrivateKeyInfo(
+    PK11SlotInfo* slot,    /* optional, encrypt key in this slot */
     SECOidTag algTag,      /* encrypt key with this algorithm */
-    const SECItem *pwitem, /* password for PBE encryption */
-    SECKEYPrivateKey *pk,  /* encrypt this private key */
+    const SECItem* pwitem, /* password for PBE encryption */
+    SECKEYPrivateKey* pk,  /* encrypt this private key */
     int iteration,         /* interations for PBE alg */
-    void *wincx)           /* context for password callback ? */
+    void* wincx)           /* context for password callback ? */
 {
-  SECKEYEncryptedPrivateKeyInfo *pki = PK11_ExportEncryptedPrivKeyInfo(
-      slot, algTag, const_cast(pwitem), pk, iteration, wincx);
-  SECItem *derPKI;
+  SECKEYEncryptedPrivateKeyInfo* pki = PK11_ExportEncryptedPrivKeyInfo(
+      slot, algTag, const_cast(pwitem), pk, iteration, wincx);
+  SECItem* derPKI;
 
   if (!pki) {
     return NULL;
@@ -48,11 +48,11 @@ static SECItem *ExportDEREncryptedPrivateKeyInfo(
 
 // This function should be moved to NSS
 static SECStatus ImportDEREncryptedPrivateKeyInfoAndReturnKey(
-    PK11SlotInfo *slot, SECItem *derPKI, SECItem *pwitem, SECItem *nickname,
-    SECItem *publicValue, PRBool isPerm, PRBool isPrivate, KeyType type,
-    unsigned int keyUsage, SECKEYPrivateKey **privk, void *wincx) {
-  SECKEYEncryptedPrivateKeyInfo *epki = NULL;
-  PLArenaPool *temparena = NULL;
+    PK11SlotInfo* slot, SECItem* derPKI, SECItem* pwitem, SECItem* nickname,
+    SECItem* publicValue, PRBool isPerm, PRBool isPrivate, KeyType type,
+    unsigned int keyUsage, SECKEYPrivateKey** privk, void* wincx) {
+  SECKEYEncryptedPrivateKeyInfo* epki = NULL;
+  PLArenaPool* temparena = NULL;
   SECStatus rv = SECFailure;
 
   temparena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
@@ -93,8 +93,8 @@ static SECStatus ImportDEREncryptedPrivateKeyInfoAndReturnKey(
   return rv;
 }
 
-nsresult DtlsIdentity::Serialize(nsTArray *aKeyDer,
-                                 nsTArray *aCertDer) {
+nsresult DtlsIdentity::Serialize(nsTArray* aKeyDer,
+                                 nsTArray* aCertDer) {
   UniquePK11SlotInfo slot(PK11_GetInternalSlot());
   if (!slot) {
     MOZ_ASSERT(false);
@@ -120,7 +120,7 @@ nsresult DtlsIdentity::Serialize(nsTArray *aKeyDer,
 
 /* static */
 RefPtr DtlsIdentity::Deserialize(
-    const nsTArray &aKeyDer, const nsTArray &aCertDer,
+    const nsTArray& aKeyDer, const nsTArray& aCertDer,
     SSLKEAType authType) {
   UniquePK11SlotInfo slot(PK11_GetInternalSlot());
   if (!slot) {
@@ -128,7 +128,7 @@ RefPtr DtlsIdentity::Deserialize(
     return nullptr;
   }
 
-  SECItem certDer = {siBuffer, const_cast(aCertDer.Elements()),
+  SECItem certDer = {siBuffer, const_cast(aCertDer.Elements()),
                      static_cast(aCertDer.Length())};
   UniqueCERTCertificate cert(CERT_NewTempCertificate(
       CERT_GetDefaultCertDB(), &certDer, nullptr, true, true));
@@ -137,7 +137,7 @@ RefPtr DtlsIdentity::Deserialize(
   // (why did we not need this for encryption?)
   ScopedSECKEYPublicKey publicKey(CERT_ExtractPublicKey(cert.get()));
   // This is a pointer to data inside publicKey
-  SECItem *publicValue = nullptr;
+  SECItem* publicValue = nullptr;
   switch (publicKey->keyType) {
     case dsaKey:
       publicValue = &publicKey->u.dsa.publicValue;
@@ -156,12 +156,12 @@ RefPtr DtlsIdentity::Deserialize(
       return nullptr;
   }
 
-  SECItem derPKI = {siBuffer, const_cast(aKeyDer.Elements()),
+  SECItem derPKI = {siBuffer, const_cast(aKeyDer.Elements()),
                     static_cast(aKeyDer.Length())};
 
   // See comment in Serialize about this dummy password stuff
   SECItem dummyPassword = {siBuffer, nullptr, 0};
-  SECKEYPrivateKey *privateKey;
+  SECKEYPrivateKey* privateKey;
   if (ImportDEREncryptedPrivateKeyInfoAndReturnKey(
           slot.get(), &derPKI, &dummyPassword, nullptr, publicValue, false,
           false, publicKey->keyType, KU_ALL, &privateKey,
@@ -201,7 +201,7 @@ RefPtr DtlsIdentity::Generate() {
 
   unsigned char paramBuf[12];  // OIDs are small
   SECItem ecdsaParams = {siBuffer, paramBuf, sizeof(paramBuf)};
-  SECOidData *oidData = SECOID_FindOIDByTag(SEC_OID_SECG_EC_SECP256R1);
+  SECOidData* oidData = SECOID_FindOIDByTag(SEC_OID_SECG_EC_SECP256R1);
   if (!oidData || (oidData->oid.len > (sizeof(paramBuf) - 2))) {
     return nullptr;
   }
@@ -210,7 +210,7 @@ RefPtr DtlsIdentity::Generate() {
   memcpy(ecdsaParams.data + 2, oidData->oid.data, oidData->oid.len);
   ecdsaParams.len = oidData->oid.len + 2;
 
-  SECKEYPublicKey *pubkey;
+  SECKEYPublicKey* pubkey;
   UniqueSECKEYPrivateKey private_key(
       PK11_GenerateKeyPair(slot.get(), CKM_EC_KEY_PAIR_GEN, &ecdsaParams,
                            &pubkey, PR_FALSE, PR_TRUE, nullptr));
@@ -252,7 +252,7 @@ RefPtr DtlsIdentity::Generate() {
   unsigned long serial;
   // Note: This serial in principle could collide, but it's unlikely
   rv = PK11_GenerateRandomOnSlot(
-      slot.get(), reinterpret_cast(&serial), sizeof(serial));
+      slot.get(), reinterpret_cast(&serial), sizeof(serial));
   if (rv != SECSuccess) {
     return nullptr;
   }
@@ -263,7 +263,7 @@ RefPtr DtlsIdentity::Generate() {
     return nullptr;
   }
 
-  PLArenaPool *arena = certificate->arena;
+  PLArenaPool* arena = certificate->arena;
 
   rv = SECOID_SetAlgorithmID(arena, &certificate->signature,
                              SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE, nullptr);
@@ -282,7 +282,7 @@ RefPtr DtlsIdentity::Generate() {
     return nullptr;
   }
 
-  SECItem *signedCert = PORT_ArenaZNew(arena, SECItem);
+  SECItem* signedCert = PORT_ArenaZNew(arena, SECItem);
   if (!signedCert) {
     return nullptr;
   }
@@ -302,15 +302,15 @@ RefPtr DtlsIdentity::Generate() {
 
 const std::string DtlsIdentity::DEFAULT_HASH_ALGORITHM = "sha-256";
 
-nsresult DtlsIdentity::ComputeFingerprint(DtlsDigest *digest) const {
-  const UniqueCERTCertificate &c = cert();
+nsresult DtlsIdentity::ComputeFingerprint(DtlsDigest* digest) const {
+  const UniqueCERTCertificate& c = cert();
   MOZ_ASSERT(c);
 
   return ComputeFingerprint(c, digest);
 }
 
-nsresult DtlsIdentity::ComputeFingerprint(const UniqueCERTCertificate &cert,
-                                          DtlsDigest *digest) {
+nsresult DtlsIdentity::ComputeFingerprint(const UniqueCERTCertificate& cert,
+                                          DtlsDigest* digest) {
   MOZ_ASSERT(cert);
 
   HASH_HashType ht;
@@ -329,7 +329,7 @@ nsresult DtlsIdentity::ComputeFingerprint(const UniqueCERTCertificate &cert,
     return NS_ERROR_INVALID_ARG;
   }
 
-  const SECHashObject *ho = HASH_GetHashObject(ht);
+  const SECHashObject* ho = HASH_GetHashObject(ht);
   MOZ_ASSERT(ho);
   if (!ho) {
     return NS_ERROR_INVALID_ARG;
diff --git a/media/mtransport/fuzztest/stun_parser_libfuzz.cpp b/media/mtransport/fuzztest/stun_parser_libfuzz.cpp
index c866cf75a0400..73bae5024cc1b 100644
--- a/media/mtransport/fuzztest/stun_parser_libfuzz.cpp
+++ b/media/mtransport/fuzztest/stun_parser_libfuzz.cpp
@@ -16,12 +16,12 @@ extern "C" {
 #include "stun_codec.h"
 }
 
-int FuzzingInitStunParser(int *argc, char ***argv) { return 0; }
+int FuzzingInitStunParser(int* argc, char*** argv) { return 0; }
 
-static int RunStunParserFuzzing(const uint8_t *data, size_t size) {
-  nr_stun_message *req = 0;
+static int RunStunParserFuzzing(const uint8_t* data, size_t size) {
+  nr_stun_message* req = 0;
 
-  UCHAR *mes = (UCHAR *)data;
+  UCHAR* mes = (UCHAR*)data;
 
   if (!nr_stun_message_create2(&req, mes, size)) {
     nr_stun_decode_message(req, nullptr, nullptr);
diff --git a/media/mtransport/nr_socket_prsock.cpp b/media/mtransport/nr_socket_prsock.cpp
index 63a0154d20a07..0cafbcc994eef 100644
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -195,11 +195,11 @@ class SingletonThreadHolder final {
   // Must be threadsafe for StaticRefPtr/ClearOnShutdown
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SingletonThreadHolder)
 
-  explicit SingletonThreadHolder(const nsACString &aName) : mName(aName) {
+  explicit SingletonThreadHolder(const nsACString& aName) : mName(aName) {
     mParentThread = NS_GetCurrentThread();
   }
 
-  nsIThread *GetThread() { return mThread; }
+  nsIThread* GetThread() { return mThread; }
 
   /*
    * Keep track of how many instances are using a SingletonThreadHolder.
@@ -250,7 +250,7 @@ static void ClearSingletonOnShutdown() {
 }
 #endif
 
-static nsIThread *GetIOThreadAndAddUse_s() {
+static nsIThread* GetIOThreadAndAddUse_s() {
   // Always runs on STS thread!
 #if defined(MOZILLA_INTERNAL_API)
   // We need to safely release this on shutdown to avoid leaks
@@ -270,7 +270,7 @@ static nsIThread *GetIOThreadAndAddUse_s() {
 #endif
 }
 
-NrSocketIpc::NrSocketIpc(nsIEventTarget *aThread) : io_thread_(aThread) {}
+NrSocketIpc::NrSocketIpc(nsIEventTarget* aThread) : io_thread_(aThread) {}
 
 static TimeStamp nr_socket_short_term_violation_time;
 static TimeStamp nr_socket_long_term_violation_time;
@@ -285,8 +285,8 @@ TimeStamp NrSocketBase::long_term_violation_time() {
 
 // NrSocketBase implementation
 // async_event APIs
-int NrSocketBase::async_wait(int how, NR_async_cb cb, void *cb_arg,
-                             char *function, int line) {
+int NrSocketBase::async_wait(int how, NR_async_cb cb, void* cb_arg,
+                             char* function, int line) {
   uint16_t flag;
 
   switch (how) {
@@ -343,7 +343,7 @@ void NrSocketBase::fire_callback(int how) {
 NS_IMPL_ISUPPORTS0(NrSocket)
 
 // The nsASocket callbacks
-void NrSocket::OnSocketReady(PRFileDesc *fd, int16_t outflags) {
+void NrSocket::OnSocketReady(PRFileDesc* fd, int16_t outflags) {
   if (outflags & PR_POLL_READ & poll_flags()) fire_callback(NR_ASYNC_WAIT_READ);
   if (outflags & PR_POLL_WRITE & poll_flags())
     fire_callback(NR_ASYNC_WAIT_WRITE);
@@ -352,17 +352,17 @@ void NrSocket::OnSocketReady(PRFileDesc *fd, int16_t outflags) {
     close();
 }
 
-void NrSocket::OnSocketDetached(PRFileDesc *fd) {
+void NrSocket::OnSocketDetached(PRFileDesc* fd) {
   r_log(LOG_GENERIC, LOG_DEBUG, "Socket %p detached", fd);
 }
 
-void NrSocket::IsLocal(bool *aIsLocal) {
+void NrSocket::IsLocal(bool* aIsLocal) {
   // TODO(jesup): better check? Does it matter? (likely no)
   *aIsLocal = false;
 }
 
 // async_event APIs
-int NrSocket::async_wait(int how, NR_async_cb cb, void *cb_arg, char *function,
+int NrSocket::async_wait(int how, NR_async_cb cb, void* cb_arg, char* function,
                          int line) {
   int r = NrSocketBase::async_wait(how, cb, cb_arg, function, line);
 
@@ -384,8 +384,8 @@ int NrSocket::cancel(int how) {
 }
 
 // Helper functions for addresses
-static int nr_transport_addr_to_praddr(nr_transport_addr *addr,
-                                       PRNetAddr *naddr) {
+static int nr_transport_addr_to_praddr(nr_transport_addr* addr,
+                                       PRNetAddr* naddr) {
   int _status;
 
   memset(naddr, 0, sizeof(*naddr));
@@ -423,7 +423,7 @@ static int nr_transport_addr_to_praddr(nr_transport_addr *addr,
 
 // XXX schien@mozilla.com: copy from PRNetAddrToNetAddr,
 // should be removed after fix the link error in signaling_unittests
-static int praddr_to_netaddr(const PRNetAddr *prAddr, net::NetAddr *addr) {
+static int praddr_to_netaddr(const PRNetAddr* prAddr, net::NetAddr* addr) {
   int _status;
 
   switch (prAddr->raw.family) {
@@ -449,8 +449,8 @@ static int praddr_to_netaddr(const PRNetAddr *prAddr, net::NetAddr *addr) {
   return (_status);
 }
 
-static int nr_transport_addr_to_netaddr(nr_transport_addr *addr,
-                                        net::NetAddr *naddr) {
+static int nr_transport_addr_to_netaddr(nr_transport_addr* addr,
+                                        net::NetAddr* naddr) {
   int r, _status;
   PRNetAddr praddr;
 
@@ -467,8 +467,8 @@ static int nr_transport_addr_to_netaddr(nr_transport_addr *addr,
   return (_status);
 }
 
-int nr_netaddr_to_transport_addr(const net::NetAddr *netaddr,
-                                 nr_transport_addr *addr, int protocol) {
+int nr_netaddr_to_transport_addr(const net::NetAddr* netaddr,
+                                 nr_transport_addr* addr, int protocol) {
   int _status;
   int r;
 
@@ -480,7 +480,7 @@ int nr_netaddr_to_transport_addr(const net::NetAddr *netaddr,
         ABORT(r);
       break;
     case AF_INET6:
-      if ((r = nr_ip6_port_to_transport_addr((in6_addr *)&netaddr->inet6.ip.u8,
+      if ((r = nr_ip6_port_to_transport_addr((in6_addr*)&netaddr->inet6.ip.u8,
                                              ntohs(netaddr->inet6.port),
                                              protocol, addr)))
         ABORT(r);
@@ -494,8 +494,8 @@ int nr_netaddr_to_transport_addr(const net::NetAddr *netaddr,
   return (_status);
 }
 
-int nr_praddr_to_transport_addr(const PRNetAddr *praddr,
-                                nr_transport_addr *addr, int protocol,
+int nr_praddr_to_transport_addr(const PRNetAddr* praddr,
+                                nr_transport_addr* addr, int protocol,
                                 int keep) {
   int _status;
   int r;
@@ -507,7 +507,7 @@ int nr_praddr_to_transport_addr(const PRNetAddr *praddr,
       ip4.sin_family = PF_INET;
       ip4.sin_addr.s_addr = praddr->inet.ip;
       ip4.sin_port = praddr->inet.port;
-      if ((r = nr_sockaddr_to_transport_addr((sockaddr *)&ip4, protocol, keep,
+      if ((r = nr_sockaddr_to_transport_addr((sockaddr*)&ip4, protocol, keep,
                                              addr)))
         ABORT(r);
       break;
@@ -517,7 +517,7 @@ int nr_praddr_to_transport_addr(const PRNetAddr *praddr,
       ip6.sin6_flowinfo = praddr->ipv6.flowinfo;
       memcpy(&ip6.sin6_addr, &praddr->ipv6.ip, sizeof(in6_addr));
       ip6.sin6_scope_id = praddr->ipv6.scope_id;
-      if ((r = nr_sockaddr_to_transport_addr((sockaddr *)&ip6, protocol, keep,
+      if ((r = nr_sockaddr_to_transport_addr((sockaddr*)&ip6, protocol, keep,
                                              addr)))
         ABORT(r);
       break;
@@ -535,8 +535,8 @@ int nr_praddr_to_transport_addr(const PRNetAddr *praddr,
  * nr_transport_addr_get_addrstring_and_port
  * convert nr_transport_addr to IP address string and port number
  */
-int nr_transport_addr_get_addrstring_and_port(nr_transport_addr *addr,
-                                              nsACString *host, int32_t *port) {
+int nr_transport_addr_get_addrstring_and_port(nr_transport_addr* addr,
+                                              nsACString* host, int32_t* port) {
   int r, _status;
   char addr_string[64];
 
@@ -560,7 +560,7 @@ int nr_transport_addr_get_addrstring_and_port(nr_transport_addr *addr,
 }
 
 // nr_socket APIs (as member functions)
-int NrSocket::create(nr_transport_addr *addr) {
+int NrSocket::create(nr_transport_addr* addr) {
   int r, _status;
 
   PRStatus status;
@@ -784,8 +784,8 @@ static int ShouldDrop(size_t len) {
 }
 
 // This should be called on the STS thread.
-int NrSocket::sendto(const void *msg, size_t len, int flags,
-                     nr_transport_addr *to) {
+int NrSocket::sendto(const void* msg, size_t len, int flags,
+                     nr_transport_addr* to) {
   ASSERT_ON_THREAD(ststhread_);
   int r, _status;
   PRNetAddr naddr;
@@ -795,7 +795,7 @@ int NrSocket::sendto(const void *msg, size_t len, int flags,
 
   if (fd_ == nullptr) ABORT(R_EOD);
 
-  if (nr_is_stun_request_message((UCHAR *)msg, len) && ShouldDrop(len)) {
+  if (nr_is_stun_request_message((UCHAR*)msg, len) && ShouldDrop(len)) {
     ABORT(R_WOULDBLOCK);
   }
 
@@ -814,8 +814,8 @@ int NrSocket::sendto(const void *msg, size_t len, int flags,
   return (_status);
 }
 
-int NrSocket::recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                       nr_transport_addr *from) {
+int NrSocket::recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                       nr_transport_addr* from) {
   ASSERT_ON_THREAD(ststhread_);
   int r, _status;
   PRNetAddr nfrom;
@@ -839,7 +839,7 @@ int NrSocket::recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
   return (_status);
 }
 
-int NrSocket::getaddr(nr_transport_addr *addrp) {
+int NrSocket::getaddr(nr_transport_addr* addrp) {
   ASSERT_ON_THREAD(ststhread_);
   return nr_transport_addr_copy(addrp, &my_addr_);
 }
@@ -850,7 +850,7 @@ void NrSocket::close() {
   mCondition = NS_BASE_STREAM_CLOSED;
 }
 
-int NrSocket::connect(nr_transport_addr *addr) {
+int NrSocket::connect(nr_transport_addr* addr) {
   ASSERT_ON_THREAD(ststhread_);
   int r, _status;
   PRNetAddr naddr;
@@ -891,7 +891,7 @@ int NrSocket::connect(nr_transport_addr *addr) {
   return (_status);
 }
 
-int NrSocket::write(const void *msg, size_t len, size_t *written) {
+int NrSocket::write(const void* msg, size_t len, size_t* written) {
   ASSERT_ON_THREAD(ststhread_);
   int _status;
   int32_t status;
@@ -912,7 +912,7 @@ int NrSocket::write(const void *msg, size_t len, size_t *written) {
   return _status;
 }
 
-int NrSocket::read(void *buf, size_t maxlen, size_t *len) {
+int NrSocket::read(void* buf, size_t maxlen, size_t* len) {
   ASSERT_ON_THREAD(ststhread_);
   int _status;
   int32_t status;
@@ -951,13 +951,13 @@ int NrSocket::listen(int backlog) {
   return (_status);
 }
 
-int NrSocket::accept(nr_transport_addr *addrp, nr_socket **sockp) {
+int NrSocket::accept(nr_transport_addr* addrp, nr_socket** sockp) {
   ASSERT_ON_THREAD(ststhread_);
   int _status, r;
   PRStatus status;
-  PRFileDesc *prfd;
+  PRFileDesc* prfd;
   PRNetAddr nfrom;
-  NrSocket *sock = nullptr;
+  NrSocket* sock = nullptr;
   nsresult rv;
   PRSocketOptionData opt_nonblock, opt_nodelay;
   nsCOMPtr stservice =
@@ -1004,8 +1004,7 @@ int NrSocket::accept(nr_transport_addr *addrp, nr_socket **sockp) {
   }
 
   // Should fail only with OOM
-  if ((r = nr_socket_create_int(static_cast(sock), sock->vtbl(),
-                                sockp)))
+  if ((r = nr_socket_create_int(static_cast(sock), sock->vtbl(), sockp)))
     ABORT(r);
 
   // Remember our thread.
@@ -1033,7 +1032,7 @@ int NrSocket::accept(nr_transport_addr *addrp, nr_socket **sockp) {
 
 NS_IMPL_ISUPPORTS(NrUdpSocketIpcProxy, nsIUDPSocketInternal)
 
-nsresult NrUdpSocketIpcProxy::Init(const RefPtr &socket) {
+nsresult NrUdpSocketIpcProxy::Init(const RefPtr& socket) {
   nsresult rv;
   sts_thread_ = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
@@ -1053,15 +1052,15 @@ NrUdpSocketIpcProxy::~NrUdpSocketIpcProxy() {
 
 // IUDPSocketInternal interfaces
 // callback while error happened in UDP socket operation
-NS_IMETHODIMP NrUdpSocketIpcProxy::CallListenerError(const nsACString &message,
-                                                     const nsACString &filename,
+NS_IMETHODIMP NrUdpSocketIpcProxy::CallListenerError(const nsACString& message,
+                                                     const nsACString& filename,
                                                      uint32_t line_number) {
   return socket_->CallListenerError(message, filename, line_number);
 }
 
 // callback while receiving UDP packet
 NS_IMETHODIMP NrUdpSocketIpcProxy::CallListenerReceivedData(
-    const nsACString &host, uint16_t port, const uint8_t *data,
+    const nsACString& host, uint16_t port, const uint8_t* data,
     uint32_t data_length) {
   return socket_->CallListenerReceivedData(host, port, data, data_length);
 }
@@ -1103,14 +1102,14 @@ NrUdpSocketIpc::~NrUdpSocketIpc() {
 
 // IUDPSocketInternal interfaces
 // callback while error happened in UDP socket operation
-NS_IMETHODIMP NrUdpSocketIpc::CallListenerError(const nsACString &message,
-                                                const nsACString &filename,
+NS_IMETHODIMP NrUdpSocketIpc::CallListenerError(const nsACString& message,
+                                                const nsACString& filename,
                                                 uint32_t line_number) {
   ASSERT_ON_THREAD(io_thread_);
 
   r_log(LOG_GENERIC, LOG_ERR, "UDP socket error:%s at %s:%d this=%p",
         message.BeginReading(), filename.BeginReading(), line_number,
-        (void *)this);
+        (void*)this);
 
   ReentrantMonitorAutoEnter mon(monitor_);
   err_ = true;
@@ -1120,9 +1119,9 @@ NS_IMETHODIMP NrUdpSocketIpc::CallListenerError(const nsACString &message,
 }
 
 // callback while receiving UDP packet
-NS_IMETHODIMP NrUdpSocketIpc::CallListenerReceivedData(const nsACString &host,
+NS_IMETHODIMP NrUdpSocketIpc::CallListenerReceivedData(const nsACString& host,
                                                        uint16_t port,
-                                                       const uint8_t *data,
+                                                       const uint8_t* data,
                                                        uint32_t data_length) {
   ASSERT_ON_THREAD(io_thread_);
 
@@ -1212,7 +1211,7 @@ NS_IMETHODIMP NrUdpSocketIpc::CallListenerOpened() {
   ASSERT_ON_THREAD(io_thread_);
   ReentrantMonitorAutoEnter mon(monitor_);
 
-  r_log(LOG_GENERIC, LOG_DEBUG, "UDP socket opened this=%p", (void *)this);
+  r_log(LOG_GENERIC, LOG_DEBUG, "UDP socket opened this=%p", (void*)this);
   nsresult rv = SetAddress();
   if (NS_FAILED(rv)) {
     return rv;
@@ -1229,7 +1228,7 @@ NS_IMETHODIMP NrUdpSocketIpc::CallListenerConnected() {
 
   ReentrantMonitorAutoEnter mon(monitor_);
 
-  r_log(LOG_GENERIC, LOG_DEBUG, "UDP socket connected this=%p", (void *)this);
+  r_log(LOG_GENERIC, LOG_DEBUG, "UDP socket connected this=%p", (void*)this);
   MOZ_ASSERT(state_ == NR_CONNECTED);
 
   nsresult rv = SetAddress();
@@ -1250,7 +1249,7 @@ NS_IMETHODIMP NrUdpSocketIpc::CallListenerClosed() {
 
   ReentrantMonitorAutoEnter mon(monitor_);
 
-  r_log(LOG_GENERIC, LOG_DEBUG, "UDP socket closed this=%p", (void *)this);
+  r_log(LOG_GENERIC, LOG_DEBUG, "UDP socket closed this=%p", (void*)this);
   MOZ_ASSERT(state_ == NR_CONNECTED || state_ == NR_CLOSING);
   state_ = NR_CLOSED;
 
@@ -1260,7 +1259,7 @@ NS_IMETHODIMP NrUdpSocketIpc::CallListenerClosed() {
 //
 // NrSocketBase methods.
 //
-int NrUdpSocketIpc::create(nr_transport_addr *addr) {
+int NrUdpSocketIpc::create(nr_transport_addr* addr) {
   ASSERT_ON_THREAD(sts_thread_);
 
   int r, _status;
@@ -1313,8 +1312,8 @@ int NrUdpSocketIpc::create(nr_transport_addr *addr) {
   return (_status);
 }
 
-int NrUdpSocketIpc::sendto(const void *msg, size_t len, int flags,
-                           nr_transport_addr *to) {
+int NrUdpSocketIpc::sendto(const void* msg, size_t len, int flags,
+                           nr_transport_addr* to) {
   ASSERT_ON_THREAD(sts_thread_);
 
   ReentrantMonitorAutoEnter mon(monitor_);
@@ -1334,12 +1333,12 @@ int NrUdpSocketIpc::sendto(const void *msg, size_t len, int flags,
     return r;
   }
 
-  if (nr_is_stun_request_message((UCHAR *)msg, len) && ShouldDrop(len)) {
+  if (nr_is_stun_request_message((UCHAR*)msg, len) && ShouldDrop(len)) {
     return R_WOULDBLOCK;
   }
 
   nsAutoPtr buf(new MediaPacket);
-  buf->Copy(static_cast(msg), len);
+  buf->Copy(static_cast(msg), len);
 
   RUN_ON_THREAD(io_thread_,
                 mozilla::WrapRunnable(RefPtr(this),
@@ -1366,8 +1365,8 @@ void NrUdpSocketIpc::close() {
   std::swap(received_msgs_, empty);
 }
 
-int NrUdpSocketIpc::recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                             nr_transport_addr *from) {
+int NrUdpSocketIpc::recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                             nr_transport_addr* from) {
   ASSERT_ON_THREAD(sts_thread_);
 
   ReentrantMonitorAutoEnter mon(monitor_);
@@ -1411,7 +1410,7 @@ int NrUdpSocketIpc::recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
   return (_status);
 }
 
-int NrUdpSocketIpc::getaddr(nr_transport_addr *addrp) {
+int NrUdpSocketIpc::getaddr(nr_transport_addr* addrp) {
   ASSERT_ON_THREAD(sts_thread_);
 
   ReentrantMonitorAutoEnter mon(monitor_);
@@ -1423,14 +1422,14 @@ int NrUdpSocketIpc::getaddr(nr_transport_addr *addrp) {
   return nr_transport_addr_copy(addrp, &my_addr_);
 }
 
-int NrUdpSocketIpc::connect(nr_transport_addr *addr) {
+int NrUdpSocketIpc::connect(nr_transport_addr* addr) {
   int r, _status;
   int32_t port;
   nsCString host;
 
   ReentrantMonitorAutoEnter mon(monitor_);
   r_log(LOG_GENERIC, LOG_DEBUG, "NrUdpSocketIpc::connect(%s) this=%p",
-        addr->as_string, (void *)this);
+        addr->as_string, (void*)this);
 
   if ((r = nr_transport_addr_get_addrstring_and_port(addr, &host, &port))) {
     ABORT(r);
@@ -1446,7 +1445,7 @@ int NrUdpSocketIpc::connect(nr_transport_addr *addr) {
   mon.Wait();
 
   r_log(LOG_GENERIC, LOG_DEBUG,
-        "NrUdpSocketIpc::connect this=%p completed err_ = %s", (void *)this,
+        "NrUdpSocketIpc::connect this=%p completed err_ = %s", (void*)this,
         err_ ? "true" : "false");
 
   if (err_) {
@@ -1458,12 +1457,12 @@ int NrUdpSocketIpc::connect(nr_transport_addr *addr) {
   return _status;
 }
 
-int NrUdpSocketIpc::write(const void *msg, size_t len, size_t *written) {
+int NrUdpSocketIpc::write(const void* msg, size_t len, size_t* written) {
   MOZ_ASSERT(false);
   return R_INTERNAL;
 }
 
-int NrUdpSocketIpc::read(void *buf, size_t maxlen, size_t *len) {
+int NrUdpSocketIpc::read(void* buf, size_t maxlen, size_t* len) {
   MOZ_ASSERT(false);
   return R_INTERNAL;
 }
@@ -1473,13 +1472,13 @@ int NrUdpSocketIpc::listen(int backlog) {
   return R_INTERNAL;
 }
 
-int NrUdpSocketIpc::accept(nr_transport_addr *addrp, nr_socket **sockp) {
+int NrUdpSocketIpc::accept(nr_transport_addr* addrp, nr_socket** sockp) {
   MOZ_ASSERT(false);
   return R_INTERNAL;
 }
 
 // IO thread executors
-void NrUdpSocketIpc::create_i(const nsACString &host, const uint16_t port) {
+void NrUdpSocketIpc::create_i(const nsACString& host, const uint16_t port) {
   ASSERT_ON_THREAD(io_thread_);
 
   uint32_t minBuffSize = 0;
@@ -1530,7 +1529,7 @@ void NrUdpSocketIpc::create_i(const nsACString &host, const uint16_t port) {
   }
 }
 
-void NrUdpSocketIpc::connect_i(const nsACString &host, const uint16_t port) {
+void NrUdpSocketIpc::connect_i(const nsACString& host, const uint16_t port) {
   ASSERT_ON_THREAD(io_thread_);
   nsresult rv;
   ReentrantMonitorAutoEnter mon(monitor_);
@@ -1551,7 +1550,7 @@ void NrUdpSocketIpc::connect_i(const nsACString &host, const uint16_t port) {
   }
 }
 
-void NrUdpSocketIpc::sendto_i(const net::NetAddr &addr,
+void NrUdpSocketIpc::sendto_i(const net::NetAddr& addr,
                               nsAutoPtr buf) {
   ASSERT_ON_THREAD(io_thread_);
 
@@ -1583,8 +1582,8 @@ static void ReleaseIOThread_s() { sThread->ReleaseUse(); }
 
 // close(), but transfer the socket_child_ reference to die as well
 // static
-void NrUdpSocketIpc::destroy_i(nsIUDPSocketChild *aChild,
-                               nsCOMPtr &aStsThread) {
+void NrUdpSocketIpc::destroy_i(nsIUDPSocketChild* aChild,
+                               nsCOMPtr& aStsThread) {
   RefPtr socket_child_ref =
       already_AddRefed(aChild);
   if (socket_child_ref) {
@@ -1618,7 +1617,7 @@ void NrUdpSocketIpc::recv_callback_s(RefPtr msg) {
 // TCPSocket.
 class NrTcpSocketIpc::TcpSocketReadyRunner : public Runnable {
  public:
-  explicit TcpSocketReadyRunner(NrTcpSocketIpc *sck)
+  explicit TcpSocketReadyRunner(NrTcpSocketIpc* sck)
       : Runnable("NrTcpSocketIpc::TcpSocketReadyRunner"), socket_(sck) {}
 
   NS_IMETHOD Run() override {
@@ -1632,8 +1631,8 @@ class NrTcpSocketIpc::TcpSocketReadyRunner : public Runnable {
 
 NS_IMPL_ISUPPORTS(NrTcpSocketIpc, nsITCPSocketCallback)
 
-NrTcpSocketIpc::NrTcpSocketIpc(nsIThread *aThread)
-    : NrSocketIpc(static_cast(aThread)),
+NrTcpSocketIpc::NrTcpSocketIpc(nsIThread* aThread)
+    : NrSocketIpc(static_cast(aThread)),
       mirror_state_(NR_INIT),
       state_(NR_INIT),
       buffered_bytes_(0),
@@ -1693,9 +1692,9 @@ NS_IMETHODIMP NrTcpSocketIpc::UpdateBufferedAmount(uint32_t buffered_amount,
 }
 
 NS_IMETHODIMP NrTcpSocketIpc::FireDataArrayEvent(
-    const nsAString &aType, const InfallibleTArray &buffer) {
+    const nsAString& aType, const InfallibleTArray& buffer) {
   // Called when we received data.
-  uint8_t *buf = const_cast(buffer.Elements());
+  uint8_t* buf = const_cast(buffer.Elements());
 
   nsAutoPtr data_buf(new MediaPacket);
   data_buf->Copy(buf, buffer.Length());
@@ -1708,8 +1707,8 @@ NS_IMETHODIMP NrTcpSocketIpc::FireDataArrayEvent(
   return NS_OK;
 }
 
-NS_IMETHODIMP NrTcpSocketIpc::FireErrorEvent(const nsAString &type,
-                                             const nsAString &name) {
+NS_IMETHODIMP NrTcpSocketIpc::FireErrorEvent(const nsAString& type,
+                                             const nsAString& name) {
   r_log(LOG_GENERIC, LOG_ERR, "Error from TCPSocketChild: type: %s, name: %s",
         NS_LossyConvertUTF16toASCII(type).get(),
         NS_LossyConvertUTF16toASCII(name).get());
@@ -1727,12 +1726,12 @@ NS_IMETHODIMP NrTcpSocketIpc::FireErrorEvent(const nsAString &type,
 
 // methods of nsITCPSocketCallback that we are not going to implement.
 
-NS_IMETHODIMP NrTcpSocketIpc::FireDataStringEvent(const nsAString &type,
-                                                  const nsACString &data) {
+NS_IMETHODIMP NrTcpSocketIpc::FireDataStringEvent(const nsAString& type,
+                                                  const nsACString& data) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP NrTcpSocketIpc::FireEvent(const nsAString &type) {
+NS_IMETHODIMP NrTcpSocketIpc::FireEvent(const nsAString& type) {
   // XXX support type.mData == 'close' at least
   return NS_ERROR_NOT_IMPLEMENTED;
 }
@@ -1740,7 +1739,7 @@ NS_IMETHODIMP NrTcpSocketIpc::FireEvent(const nsAString &type) {
 //
 // NrSocketBase methods.
 //
-int NrTcpSocketIpc::create(nr_transport_addr *addr) {
+int NrTcpSocketIpc::create(nr_transport_addr* addr) {
   int r, _status;
   nsresult rv;
   int32_t port;
@@ -1770,19 +1769,19 @@ int NrTcpSocketIpc::create(nr_transport_addr *addr) {
   return (_status);
 }
 
-int NrTcpSocketIpc::sendto(const void *msg, size_t len, int flags,
-                           nr_transport_addr *to) {
+int NrTcpSocketIpc::sendto(const void* msg, size_t len, int flags,
+                           nr_transport_addr* to) {
   MOZ_ASSERT(false);
   return R_INTERNAL;
 }
 
-int NrTcpSocketIpc::recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                             nr_transport_addr *from) {
+int NrTcpSocketIpc::recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                             nr_transport_addr* from) {
   MOZ_ASSERT(false);
   return R_INTERNAL;
 }
 
-int NrTcpSocketIpc::getaddr(nr_transport_addr *addrp) {
+int NrTcpSocketIpc::getaddr(nr_transport_addr* addrp) {
   ASSERT_ON_THREAD(sts_thread_);
   return nr_transport_addr_copy(addrp, &my_addr_);
 }
@@ -1806,7 +1805,7 @@ void NrTcpSocketIpc::close() {
   std::swap(msg_queue_, empty);
 }
 
-int NrTcpSocketIpc::connect(nr_transport_addr *addr) {
+int NrTcpSocketIpc::connect(nr_transport_addr* addr) {
   nsCString remote_addr, local_addr;
   int32_t remote_port, local_port;
   int r, _status;
@@ -1836,7 +1835,7 @@ int NrTcpSocketIpc::connect(nr_transport_addr *addr) {
   return _status;
 }
 
-int NrTcpSocketIpc::write(const void *msg, size_t len, size_t *written) {
+int NrTcpSocketIpc::write(const void* msg, size_t len, size_t* written) {
   ASSERT_ON_THREAD(sts_thread_);
   int _status = 0;
   if (state_ != NR_CONNECTED) {
@@ -1849,8 +1848,8 @@ int NrTcpSocketIpc::write(const void *msg, size_t len, size_t *written) {
 
   buffered_bytes_ += len;
   {
-    InfallibleTArray *arr = new InfallibleTArray();
-    arr->AppendElements(static_cast(msg), len);
+    InfallibleTArray* arr = new InfallibleTArray();
+    arr->AppendElements(static_cast(msg), len);
     // keep track of un-acknowleged writes by tracking number.
     writes_in_flight_.push_back(len);
     RUN_ON_THREAD(
@@ -1865,7 +1864,7 @@ int NrTcpSocketIpc::write(const void *msg, size_t len, size_t *written) {
   return _status;
 }
 
-int NrTcpSocketIpc::read(void *buf, size_t maxlen, size_t *len) {
+int NrTcpSocketIpc::read(void* buf, size_t maxlen, size_t* len) {
   int _status = 0;
   if (state_ != NR_CONNECTED) {
     ABORT(R_FAILED);
@@ -1894,15 +1893,15 @@ int NrTcpSocketIpc::read(void *buf, size_t maxlen, size_t *len) {
 
 int NrTcpSocketIpc::listen(int backlog) { return R_INTERNAL; }
 
-int NrTcpSocketIpc::accept(nr_transport_addr *addrp, nr_socket **sockp) {
+int NrTcpSocketIpc::accept(nr_transport_addr* addrp, nr_socket** sockp) {
   return R_INTERNAL;
 }
 
-void NrTcpSocketIpc::connect_i(const nsACString &remote_addr,
+void NrTcpSocketIpc::connect_i(const nsACString& remote_addr,
                                uint16_t remote_port,
-                               const nsACString &local_addr,
+                               const nsACString& local_addr,
                                uint16_t local_port,
-                               const nsACString &tls_host) {
+                               const nsACString& tls_host) {
   ASSERT_ON_THREAD(io_thread_);
   // io_thread_ was initialized as main thread at constructor,
   // so the following assertion should be true.
@@ -1910,7 +1909,7 @@ void NrTcpSocketIpc::connect_i(const nsACString &remote_addr,
 
   mirror_state_ = NR_CONNECTING;
 
-  dom::TCPSocketChild *child =
+  dom::TCPSocketChild* child =
       new dom::TCPSocketChild(NS_ConvertUTF8toUTF16(remote_addr), remote_port,
                               SystemGroup::EventTargetFor(TaskCategory::Other));
   socket_child_ = child;
@@ -1952,7 +1951,7 @@ void NrTcpSocketIpc::close_i() {
 
 // close(), but transfer the socket_child_ reference to die as well
 // static
-void NrTcpSocketIpc::release_child_i(dom::TCPSocketChild *aChild) {
+void NrTcpSocketIpc::release_child_i(dom::TCPSocketChild* aChild) {
   RefPtr socket_child_ref =
       already_AddRefed(aChild);
   if (socket_child_ref) {
@@ -1982,7 +1981,7 @@ void NrTcpSocketIpc::message_sent_s(uint32_t buffered_amount,
   maybe_post_socket_ready();
 }
 
-void NrTcpSocketIpc::recv_message_s(nr_tcp_message *msg) {
+void NrTcpSocketIpc::recv_message_s(nr_tcp_message* msg) {
   ASSERT_ON_THREAD(sts_thread_);
   msg_queue_.push(msg);
   maybe_post_socket_ready();
@@ -2056,23 +2055,23 @@ void NrTcpSocketIpc::maybe_post_socket_ready() {
 using namespace mozilla;
 
 // Bridge to the nr_socket interface
-static int nr_socket_local_destroy(void **objp);
-static int nr_socket_local_sendto(void *obj, const void *msg, size_t len,
-                                  int flags, nr_transport_addr *to);
-static int nr_socket_local_recvfrom(void *obj, void *restrict buf,
-                                    size_t maxlen, size_t *len, int flags,
-                                    nr_transport_addr *from);
-static int nr_socket_local_getfd(void *obj, NR_SOCKET *fd);
-static int nr_socket_local_getaddr(void *obj, nr_transport_addr *addrp);
-static int nr_socket_local_close(void *obj);
-static int nr_socket_local_connect(void *sock, nr_transport_addr *addr);
-static int nr_socket_local_write(void *obj, const void *msg, size_t len,
-                                 size_t *written);
-static int nr_socket_local_read(void *obj, void *restrict buf, size_t maxlen,
-                                size_t *len);
-static int nr_socket_local_listen(void *obj, int backlog);
-static int nr_socket_local_accept(void *obj, nr_transport_addr *addrp,
-                                  nr_socket **sockp);
+static int nr_socket_local_destroy(void** objp);
+static int nr_socket_local_sendto(void* obj, const void* msg, size_t len,
+                                  int flags, nr_transport_addr* to);
+static int nr_socket_local_recvfrom(void* obj, void* restrict buf,
+                                    size_t maxlen, size_t* len, int flags,
+                                    nr_transport_addr* from);
+static int nr_socket_local_getfd(void* obj, NR_SOCKET* fd);
+static int nr_socket_local_getaddr(void* obj, nr_transport_addr* addrp);
+static int nr_socket_local_close(void* obj);
+static int nr_socket_local_connect(void* sock, nr_transport_addr* addr);
+static int nr_socket_local_write(void* obj, const void* msg, size_t len,
+                                 size_t* written);
+static int nr_socket_local_read(void* obj, void* restrict buf, size_t maxlen,
+                                size_t* len);
+static int nr_socket_local_listen(void* obj, int backlog);
+static int nr_socket_local_accept(void* obj, nr_transport_addr* addrp,
+                                  nr_socket** sockp);
 
 static nr_socket_vtbl nr_socket_local_vtbl = {2,
                                               nr_socket_local_destroy,
@@ -2089,8 +2088,8 @@ static nr_socket_vtbl nr_socket_local_vtbl = {2,
 
 /* static */
 int NrSocketBase::CreateSocket(
-    nr_transport_addr *addr, RefPtr *sock,
-    const std::shared_ptr &config) {
+    nr_transport_addr* addr, RefPtr* sock,
+    const std::shared_ptr& config) {
   int r, _status;
 
   if (IsForbiddenAddress(addr)) {
@@ -2139,7 +2138,7 @@ int NrSocketBase::CreateSocket(
 }
 
 // static
-bool NrSocketBase::IsForbiddenAddress(nr_transport_addr *addr) {
+bool NrSocketBase::IsForbiddenAddress(nr_transport_addr* addr) {
   int r, port;
 
   r = nr_transport_addr_get_port(addr, &port);
@@ -2159,10 +2158,10 @@ bool NrSocketBase::IsForbiddenAddress(nr_transport_addr *addr) {
   return false;
 }
 
-static int nr_socket_local_destroy(void **objp) {
+static int nr_socket_local_destroy(void** objp) {
   if (!objp || !*objp) return 0;
 
-  NrSocketBase *sock = static_cast(*objp);
+  NrSocketBase* sock = static_cast(*objp);
   *objp = nullptr;
 
   sock->close();    // Signal STS that we want not to listen
@@ -2171,88 +2170,88 @@ static int nr_socket_local_destroy(void **objp) {
   return 0;
 }
 
-static int nr_socket_local_sendto(void *obj, const void *msg, size_t len,
-                                  int flags, nr_transport_addr *addr) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_sendto(void* obj, const void* msg, size_t len,
+                                  int flags, nr_transport_addr* addr) {
+  NrSocketBase* sock = static_cast(obj);
 
   return sock->sendto(msg, len, flags, addr);
 }
 
-static int nr_socket_local_recvfrom(void *obj, void *restrict buf,
-                                    size_t maxlen, size_t *len, int flags,
-                                    nr_transport_addr *addr) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_recvfrom(void* obj, void* restrict buf,
+                                    size_t maxlen, size_t* len, int flags,
+                                    nr_transport_addr* addr) {
+  NrSocketBase* sock = static_cast(obj);
 
   return sock->recvfrom(buf, maxlen, len, flags, addr);
 }
 
-static int nr_socket_local_getfd(void *obj, NR_SOCKET *fd) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_getfd(void* obj, NR_SOCKET* fd) {
+  NrSocketBase* sock = static_cast(obj);
 
   *fd = sock;
 
   return 0;
 }
 
-static int nr_socket_local_getaddr(void *obj, nr_transport_addr *addrp) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_getaddr(void* obj, nr_transport_addr* addrp) {
+  NrSocketBase* sock = static_cast(obj);
 
   return sock->getaddr(addrp);
 }
 
-static int nr_socket_local_close(void *obj) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_close(void* obj) {
+  NrSocketBase* sock = static_cast(obj);
 
   sock->close();
 
   return 0;
 }
 
-static int nr_socket_local_write(void *obj, const void *msg, size_t len,
-                                 size_t *written) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_write(void* obj, const void* msg, size_t len,
+                                 size_t* written) {
+  NrSocketBase* sock = static_cast(obj);
 
   return sock->write(msg, len, written);
 }
 
-static int nr_socket_local_read(void *obj, void *restrict buf, size_t maxlen,
-                                size_t *len) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_read(void* obj, void* restrict buf, size_t maxlen,
+                                size_t* len) {
+  NrSocketBase* sock = static_cast(obj);
 
   return sock->read(buf, maxlen, len);
 }
 
-static int nr_socket_local_connect(void *obj, nr_transport_addr *addr) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_connect(void* obj, nr_transport_addr* addr) {
+  NrSocketBase* sock = static_cast(obj);
 
   return sock->connect(addr);
 }
 
-static int nr_socket_local_listen(void *obj, int backlog) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_listen(void* obj, int backlog) {
+  NrSocketBase* sock = static_cast(obj);
 
   return sock->listen(backlog);
 }
 
-static int nr_socket_local_accept(void *obj, nr_transport_addr *addrp,
-                                  nr_socket **sockp) {
-  NrSocketBase *sock = static_cast(obj);
+static int nr_socket_local_accept(void* obj, nr_transport_addr* addrp,
+                                  nr_socket** sockp) {
+  NrSocketBase* sock = static_cast(obj);
 
   return sock->accept(addrp, sockp);
 }
 
 // Implement async api
-int NR_async_wait(NR_SOCKET sock, int how, NR_async_cb cb, void *cb_arg,
-                  char *function, int line) {
-  NrSocketBase *s = static_cast(sock);
+int NR_async_wait(NR_SOCKET sock, int how, NR_async_cb cb, void* cb_arg,
+                  char* function, int line) {
+  NrSocketBase* s = static_cast(sock);
 
   return s->async_wait(how, cb, cb_arg, function, line);
 }
 
 int NR_async_cancel(NR_SOCKET sock, int how) {
-  NrSocketBase *s = static_cast(sock);
+  NrSocketBase* s = static_cast(sock);
 
   return s->cancel(how);
 }
 
-nr_socket_vtbl *NrSocketBase::vtbl() { return &nr_socket_local_vtbl; }
+nr_socket_vtbl* NrSocketBase::vtbl() { return &nr_socket_local_vtbl; }
diff --git a/media/mtransport/nr_socket_prsock.h b/media/mtransport/nr_socket_prsock.h
index 82e6f612e3f9d..81b47c605a03e 100644
--- a/media/mtransport/nr_socket_prsock.h
+++ b/media/mtransport/nr_socket_prsock.h
@@ -105,26 +105,26 @@ class NrSocketBase {
 
   // Factory method; will create either an NrSocket, NrUdpSocketIpc, or
   // NrTcpSocketIpc as appropriate.
-  static int CreateSocket(nr_transport_addr *addr, RefPtr *sock,
-                          const std::shared_ptr &config);
-  static bool IsForbiddenAddress(nr_transport_addr *addr);
+  static int CreateSocket(nr_transport_addr* addr, RefPtr* sock,
+                          const std::shared_ptr& config);
+  static bool IsForbiddenAddress(nr_transport_addr* addr);
 
   // the nr_socket APIs
-  virtual int create(nr_transport_addr *addr) = 0;
-  virtual int sendto(const void *msg, size_t len, int flags,
-                     nr_transport_addr *to) = 0;
-  virtual int recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                       nr_transport_addr *from) = 0;
-  virtual int getaddr(nr_transport_addr *addrp) = 0;
+  virtual int create(nr_transport_addr* addr) = 0;
+  virtual int sendto(const void* msg, size_t len, int flags,
+                     nr_transport_addr* to) = 0;
+  virtual int recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                       nr_transport_addr* from) = 0;
+  virtual int getaddr(nr_transport_addr* addrp) = 0;
   virtual void close() = 0;
-  virtual int connect(nr_transport_addr *addr) = 0;
-  virtual int write(const void *msg, size_t len, size_t *written) = 0;
-  virtual int read(void *buf, size_t maxlen, size_t *len) = 0;
+  virtual int connect(nr_transport_addr* addr) = 0;
+  virtual int write(const void* msg, size_t len, size_t* written) = 0;
+  virtual int read(void* buf, size_t maxlen, size_t* len) = 0;
   virtual int listen(int backlog) = 0;
-  virtual int accept(nr_transport_addr *addrp, nr_socket **sockp) = 0;
+  virtual int accept(nr_transport_addr* addrp, nr_socket** sockp) = 0;
 
   // Implementations of the async_event APIs
-  virtual int async_wait(int how, NR_async_cb cb, void *cb_arg, char *function,
+  virtual int async_wait(int how, NR_async_cb cb, void* cb_arg, char* function,
                          int line);
   virtual int cancel(int how);
 
@@ -133,11 +133,11 @@ class NrSocketBase {
 
   uint32_t poll_flags() { return poll_flags_; }
 
-  virtual nr_socket_vtbl *vtbl();  // To access in test classes.
+  virtual nr_socket_vtbl* vtbl();  // To access in test classes.
 
   static TimeStamp short_term_violation_time();
   static TimeStamp long_term_violation_time();
-  const nr_transport_addr &my_addr() const { return my_addr_; }
+  const nr_transport_addr& my_addr() const { return my_addr_; }
 
   void fire_callback(int how);
 
@@ -147,7 +147,7 @@ class NrSocketBase {
 
  private:
   NR_async_cb cbs_[NR_ASYNC_WAIT_WRITE + 1];
-  void *cb_args_[NR_ASYNC_WAIT_WRITE + 1];
+  void* cb_args_[NR_ASYNC_WAIT_WRITE + 1];
   uint32_t poll_flags_;
 };
 
@@ -156,9 +156,9 @@ class NrSocket : public NrSocketBase, public nsASocketHandler {
   NrSocket() : fd_(nullptr) {}
 
   // Implement nsASocket
-  virtual void OnSocketReady(PRFileDesc *fd, int16_t outflags) override;
-  virtual void OnSocketDetached(PRFileDesc *fd) override;
-  virtual void IsLocal(bool *aIsLocal) override;
+  virtual void OnSocketReady(PRFileDesc* fd, int16_t outflags) override;
+  virtual void OnSocketDetached(PRFileDesc* fd) override;
+  virtual void IsLocal(bool* aIsLocal) override;
   virtual uint64_t ByteCountSent() override { return 0; }
   virtual uint64_t ByteCountReceived() override { return 0; }
 
@@ -166,24 +166,24 @@ class NrSocket : public NrSocketBase, public nsASocketHandler {
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // Implementations of the async_event APIs
-  virtual int async_wait(int how, NR_async_cb cb, void *cb_arg, char *function,
+  virtual int async_wait(int how, NR_async_cb cb, void* cb_arg, char* function,
                          int line) override;
   virtual int cancel(int how) override;
 
   // Implementations of the nr_socket APIs
-  virtual int create(nr_transport_addr *addr)
+  virtual int create(nr_transport_addr* addr)
       override;  // (really init, but it's called create)
-  virtual int sendto(const void *msg, size_t len, int flags,
-                     nr_transport_addr *to) override;
-  virtual int recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                       nr_transport_addr *from) override;
-  virtual int getaddr(nr_transport_addr *addrp) override;
+  virtual int sendto(const void* msg, size_t len, int flags,
+                     nr_transport_addr* to) override;
+  virtual int recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                       nr_transport_addr* from) override;
+  virtual int getaddr(nr_transport_addr* addrp) override;
   virtual void close() override;
-  virtual int connect(nr_transport_addr *addr) override;
-  virtual int write(const void *msg, size_t len, size_t *written) override;
-  virtual int read(void *buf, size_t maxlen, size_t *len) override;
+  virtual int connect(nr_transport_addr* addr) override;
+  virtual int write(const void* msg, size_t len, size_t* written) override;
+  virtual int read(void* buf, size_t maxlen, size_t* len) override;
   virtual int listen(int backlog) override;
-  virtual int accept(nr_transport_addr *addrp, nr_socket **sockp) override;
+  virtual int accept(nr_transport_addr* addrp, nr_socket** sockp) override;
 
  protected:
   virtual ~NrSocket() {
@@ -192,12 +192,12 @@ class NrSocket : public NrSocketBase, public nsASocketHandler {
 
   DISALLOW_COPY_ASSIGN(NrSocket);
 
-  PRFileDesc *fd_;
+  PRFileDesc* fd_;
   nsCOMPtr ststhread_;
 };
 
 struct nr_udp_message {
-  nr_udp_message(const PRNetAddr &from, nsAutoPtr &data)
+  nr_udp_message(const PRNetAddr& from, nsAutoPtr& data)
       : from(from), data(data) {}
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nr_udp_message);
@@ -220,7 +220,7 @@ class NrSocketIpc : public NrSocketBase {
     NR_CLOSED,
   };
 
-  NrSocketIpc(nsIEventTarget *aThread);
+  NrSocketIpc(nsIEventTarget* aThread);
 
  protected:
   nsCOMPtr sts_thread_;
@@ -238,11 +238,11 @@ class NrUdpSocketIpc : public NrSocketIpc {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(NrUdpSocketIpc, override)
 
-  NS_IMETHODIMP CallListenerError(const nsACString &message,
-                                  const nsACString &filename,
+  NS_IMETHODIMP CallListenerError(const nsACString& message,
+                                  const nsACString& filename,
                                   uint32_t line_number);
-  NS_IMETHODIMP CallListenerReceivedData(const nsACString &host, uint16_t port,
-                                         const uint8_t *data,
+  NS_IMETHODIMP CallListenerReceivedData(const nsACString& host, uint16_t port,
+                                         const uint8_t* data,
                                          uint32_t data_length);
   NS_IMETHODIMP CallListenerOpened();
   NS_IMETHODIMP CallListenerConnected();
@@ -251,18 +251,18 @@ class NrUdpSocketIpc : public NrSocketIpc {
   NrUdpSocketIpc();
 
   // Implementations of the NrSocketBase APIs
-  virtual int create(nr_transport_addr *addr) override;
-  virtual int sendto(const void *msg, size_t len, int flags,
-                     nr_transport_addr *to) override;
-  virtual int recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                       nr_transport_addr *from) override;
-  virtual int getaddr(nr_transport_addr *addrp) override;
+  virtual int create(nr_transport_addr* addr) override;
+  virtual int sendto(const void* msg, size_t len, int flags,
+                     nr_transport_addr* to) override;
+  virtual int recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                       nr_transport_addr* from) override;
+  virtual int getaddr(nr_transport_addr* addrp) override;
   virtual void close() override;
-  virtual int connect(nr_transport_addr *addr) override;
-  virtual int write(const void *msg, size_t len, size_t *written) override;
-  virtual int read(void *buf, size_t maxlen, size_t *len) override;
+  virtual int connect(nr_transport_addr* addr) override;
+  virtual int write(const void* msg, size_t len, size_t* written) override;
+  virtual int read(void* buf, size_t maxlen, size_t* len) override;
   virtual int listen(int backlog) override;
-  virtual int accept(nr_transport_addr *addrp, nr_socket **sockp) override;
+  virtual int accept(nr_transport_addr* addrp, nr_socket** sockp) override;
 
  private:
   virtual ~NrUdpSocketIpc();
@@ -272,13 +272,13 @@ class NrUdpSocketIpc : public NrSocketIpc {
   nsresult SetAddress();  // Set the local address from parent info.
 
   // Main or private thread executors of the NrSocketBase APIs
-  void create_i(const nsACString &host, const uint16_t port);
-  void connect_i(const nsACString &host, const uint16_t port);
-  void sendto_i(const net::NetAddr &addr, nsAutoPtr buf);
+  void create_i(const nsACString& host, const uint16_t port);
+  void connect_i(const nsACString& host, const uint16_t port);
+  void sendto_i(const net::NetAddr& addr, nsAutoPtr buf);
   void close_i();
 #if defined(MOZILLA_INTERNAL_API) && !defined(MOZILLA_XPCOMRT_API)
-  static void destroy_i(nsIUDPSocketChild *aChild,
-                        nsCOMPtr &aStsThread);
+  static void destroy_i(nsIUDPSocketChild* aChild,
+                        nsCOMPtr& aStsThread);
 #endif
   // STS thread executor
   void recv_callback_s(RefPtr msg);
@@ -299,7 +299,7 @@ class NrUdpSocketIpcProxy : public nsIUDPSocketInternal {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIUDPSOCKETINTERNAL
 
-  nsresult Init(const RefPtr &socket);
+  nsresult Init(const RefPtr& socket);
 
  private:
   virtual ~NrUdpSocketIpcProxy();
@@ -309,12 +309,12 @@ class NrUdpSocketIpcProxy : public nsIUDPSocketInternal {
 };
 
 struct nr_tcp_message {
-  explicit nr_tcp_message(nsAutoPtr &data)
+  explicit nr_tcp_message(nsAutoPtr& data)
       : read_bytes(0), data(data) {}
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nr_tcp_message);
 
-  const uint8_t *reading_pointer() const { return data->data() + read_bytes; }
+  const uint8_t* reading_pointer() const { return data->data() + read_bytes; }
 
   size_t unread_bytes() const { return data->len() - read_bytes; }
 
@@ -333,21 +333,21 @@ class NrTcpSocketIpc : public NrSocketIpc, public nsITCPSocketCallback {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITCPSOCKETCALLBACK
 
-  explicit NrTcpSocketIpc(nsIThread *aThread);
+  explicit NrTcpSocketIpc(nsIThread* aThread);
 
   // Implementations of the NrSocketBase APIs
-  virtual int create(nr_transport_addr *addr) override;
-  virtual int sendto(const void *msg, size_t len, int flags,
-                     nr_transport_addr *to) override;
-  virtual int recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                       nr_transport_addr *from) override;
-  virtual int getaddr(nr_transport_addr *addrp) override;
+  virtual int create(nr_transport_addr* addr) override;
+  virtual int sendto(const void* msg, size_t len, int flags,
+                     nr_transport_addr* to) override;
+  virtual int recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                       nr_transport_addr* from) override;
+  virtual int getaddr(nr_transport_addr* addrp) override;
   virtual void close() override;
-  virtual int connect(nr_transport_addr *addr) override;
-  virtual int write(const void *msg, size_t len, size_t *written) override;
-  virtual int read(void *buf, size_t maxlen, size_t *len) override;
+  virtual int connect(nr_transport_addr* addr) override;
+  virtual int write(const void* msg, size_t len, size_t* written) override;
+  virtual int read(void* buf, size_t maxlen, size_t* len) override;
   virtual int listen(int backlog) override;
-  virtual int accept(nr_transport_addr *addrp, nr_socket **sockp) override;
+  virtual int accept(nr_transport_addr* addrp, nr_socket** sockp) override;
 
  private:
   class TcpSocketReadyRunner;
@@ -355,18 +355,18 @@ class NrTcpSocketIpc : public NrSocketIpc, public nsITCPSocketCallback {
   virtual ~NrTcpSocketIpc();
 
   // Main thread executors of the NrSocketBase APIs
-  void connect_i(const nsACString &remote_addr, uint16_t remote_port,
-                 const nsACString &local_addr, uint16_t local_port,
-                 const nsACString &tls_host);
+  void connect_i(const nsACString& remote_addr, uint16_t remote_port,
+                 const nsACString& local_addr, uint16_t local_port,
+                 const nsACString& tls_host);
   void write_i(nsAutoPtr> buf,
                uint32_t tracking_number);
   void close_i();
 
-  static void release_child_i(dom::TCPSocketChild *aChild);
+  static void release_child_i(dom::TCPSocketChild* aChild);
 
   // STS thread executor
   void message_sent_s(uint32_t bufferedAmount, uint32_t tracking_number);
-  void recv_message_s(nr_tcp_message *msg);
+  void recv_message_s(nr_tcp_message* msg);
   void update_state_s(NrSocketIpcState next_state);
   void maybe_post_socket_ready();
 
@@ -386,12 +386,12 @@ class NrTcpSocketIpc : public NrSocketIpc, public nsITCPSocketCallback {
 };
 #endif
 
-int nr_netaddr_to_transport_addr(const net::NetAddr *netaddr,
-                                 nr_transport_addr *addr, int protocol);
-int nr_praddr_to_transport_addr(const PRNetAddr *praddr,
-                                nr_transport_addr *addr, int protocol,
+int nr_netaddr_to_transport_addr(const net::NetAddr* netaddr,
+                                 nr_transport_addr* addr, int protocol);
+int nr_praddr_to_transport_addr(const PRNetAddr* praddr,
+                                nr_transport_addr* addr, int protocol,
                                 int keep);
-int nr_transport_addr_get_addrstring_and_port(nr_transport_addr *addr,
-                                              nsACString *host, int32_t *port);
+int nr_transport_addr_get_addrstring_and_port(nr_transport_addr* addr,
+                                              nsACString* host, int32_t* port);
 }  // namespace mozilla
 #endif
diff --git a/media/mtransport/nr_timer.cpp b/media/mtransport/nr_timer.cpp
index 6fd9d1b770e4b..30d6002ee9fd6 100644
--- a/media/mtransport/nr_timer.cpp
+++ b/media/mtransport/nr_timer.cpp
@@ -70,7 +70,7 @@ namespace mozilla {
 
 class nrappkitCallback {
  public:
-  nrappkitCallback(NR_async_cb cb, void *cb_arg, const char *function, int line)
+  nrappkitCallback(NR_async_cb cb, void* cb_arg, const char* function, int line)
       : cb_(cb), cb_arg_(cb_arg), function_(function), line_(line) {}
   virtual ~nrappkitCallback() {}
 
@@ -79,7 +79,7 @@ class nrappkitCallback {
  protected:
   /* additional members */
   NR_async_cb cb_;
-  void *cb_arg_;
+  void* cb_arg_;
   std::string function_;
   int line_;
 };
@@ -92,11 +92,11 @@ class nrappkitTimerCallback : public nrappkitCallback,
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
 
-  nrappkitTimerCallback(NR_async_cb cb, void *cb_arg, const char *function,
+  nrappkitTimerCallback(NR_async_cb cb, void* cb_arg, const char* function,
                         int line)
       : nrappkitCallback(cb, cb_arg, function, line), timer_(nullptr) {}
 
-  void SetTimer(already_AddRefed &&timer) { timer_ = timer; }
+  void SetTimer(already_AddRefed&& timer) { timer_ = timer; }
 
   virtual void Cancel() override {
     AddRef();  // Cancelling the timer causes the callback it holds to
@@ -107,7 +107,7 @@ class nrappkitTimerCallback : public nrappkitCallback,
   }
 
   NS_IMETHOD
-  GetName(nsACString &aName) override {
+  GetName(nsACString& aName) override {
     aName.AssignLiteral("nrappkitTimerCallback");
     return NS_OK;
   }
@@ -119,7 +119,7 @@ class nrappkitTimerCallback : public nrappkitCallback,
 
 NS_IMPL_ISUPPORTS(nrappkitTimerCallback, nsITimerCallback, nsINamed)
 
-NS_IMETHODIMP nrappkitTimerCallback::Notify(nsITimer *timer) {
+NS_IMETHODIMP nrappkitTimerCallback::Notify(nsITimer* timer) {
   r_log(LOG_GENERIC, LOG_DEBUG, "Timer callback fired (set in %s:%d)",
         function_.c_str(), line_);
   MOZ_RELEASE_ASSERT(timer == timer_);
@@ -132,7 +132,7 @@ NS_IMETHODIMP nrappkitTimerCallback::Notify(nsITimer *timer) {
 
 class nrappkitScheduledCallback : public nrappkitCallback {
  public:
-  nrappkitScheduledCallback(NR_async_cb cb, void *cb_arg, const char *function,
+  nrappkitScheduledCallback(NR_async_cb cb, void* cb_arg, const char* function,
                             int line)
       : nrappkitCallback(cb, cb_arg, function, line) {}
 
@@ -170,9 +170,9 @@ static void CheckSTSThread() {
   ASSERT_ON_THREAD(sts_thread.value);
 }
 
-static int nr_async_timer_set_zero(NR_async_cb cb, void *arg, char *func, int l,
-                                   nrappkitCallback **handle) {
-  nrappkitScheduledCallback *callback(
+static int nr_async_timer_set_zero(NR_async_cb cb, void* arg, char* func, int l,
+                                   nrappkitCallback** handle) {
+  nrappkitScheduledCallback* callback(
       new nrappkitScheduledCallback(cb, arg, func, l));
 
   nsresult rv = GetSTSThread()->Dispatch(
@@ -189,13 +189,13 @@ static int nr_async_timer_set_zero(NR_async_cb cb, void *arg, char *func, int l,
   return 0;
 }
 
-static int nr_async_timer_set_nonzero(int timeout, NR_async_cb cb, void *arg,
-                                      char *func, int l,
-                                      nrappkitCallback **handle) {
+static int nr_async_timer_set_nonzero(int timeout, NR_async_cb cb, void* arg,
+                                      char* func, int l,
+                                      nrappkitCallback** handle) {
   nsresult rv;
   CheckSTSThread();
 
-  nrappkitTimerCallback *callback = new nrappkitTimerCallback(cb, arg, func, l);
+  nrappkitTimerCallback* callback = new nrappkitTimerCallback(cb, arg, func, l);
 
   nsCOMPtr timer;
   rv = NS_NewTimerWithCallback(getter_AddRefs(timer), callback, timeout,
@@ -213,11 +213,11 @@ static int nr_async_timer_set_nonzero(int timeout, NR_async_cb cb, void *arg,
   return 0;
 }
 
-int NR_async_timer_set(int timeout, NR_async_cb cb, void *arg, char *func,
-                       int l, void **handle) {
+int NR_async_timer_set(int timeout, NR_async_cb cb, void* arg, char* func,
+                       int l, void** handle) {
   CheckSTSThread();
 
-  nrappkitCallback *callback;
+  nrappkitCallback* callback;
   int r;
 
   if (!timeout) {
@@ -233,13 +233,13 @@ int NR_async_timer_set(int timeout, NR_async_cb cb, void *arg, char *func,
   return 0;
 }
 
-int NR_async_schedule(NR_async_cb cb, void *arg, char *func, int l) {
+int NR_async_schedule(NR_async_cb cb, void* arg, char* func, int l) {
   // No need to check the thread because we check it next in the
   // timer set.
   return NR_async_timer_set(0, cb, arg, func, l, nullptr);
 }
 
-int NR_async_timer_cancel(void *handle) {
+int NR_async_timer_cancel(void* handle) {
   // Check for the handle being nonzero because sometimes we get
   // no-op cancels that aren't on the STS thread. This can be
   // non-racy as long as the upper-level code is careful.
@@ -247,7 +247,7 @@ int NR_async_timer_cancel(void *handle) {
 
   CheckSTSThread();
 
-  nrappkitCallback *callback = static_cast(handle);
+  nrappkitCallback* callback = static_cast(handle);
   callback->Cancel();
 
   return 0;
diff --git a/media/mtransport/nricectx.cpp b/media/mtransport/nricectx.cpp
index fb4d813d7e00d..aa7429c590440 100644
--- a/media/mtransport/nricectx.cpp
+++ b/media/mtransport/nricectx.cpp
@@ -117,13 +117,13 @@ const char kNrIceTransportTls[] = "tls";
 
 static bool initialized = false;
 
-static int noop(void **obj) { return 0; }
+static int noop(void** obj) { return 0; }
 
 static nr_socket_factory_vtbl ctx_socket_factory_vtbl = {nr_socket_local_create,
                                                          noop};
 
 // Implement NSPR-based crypto algorithms
-static int nr_crypto_nss_random_bytes(UCHAR *buf, size_t len) {
+static int nr_crypto_nss_random_bytes(UCHAR* buf, size_t len) {
   UniquePK11SlotInfo slot(PK11_GetInternalSlot());
   if (!slot) return R_INTERNAL;
 
@@ -133,14 +133,14 @@ static int nr_crypto_nss_random_bytes(UCHAR *buf, size_t len) {
   return 0;
 }
 
-static int nr_crypto_nss_hmac(UCHAR *key, size_t keyl, UCHAR *buf, size_t bufl,
-                              UCHAR *result) {
+static int nr_crypto_nss_hmac(UCHAR* key, size_t keyl, UCHAR* buf, size_t bufl,
+                              UCHAR* result) {
   CK_MECHANISM_TYPE mech = CKM_SHA_1_HMAC;
-  PK11SlotInfo *slot = nullptr;
+  PK11SlotInfo* slot = nullptr;
   MOZ_ASSERT(keyl > 0);
   SECItem keyi = {siBuffer, key, static_cast(keyl)};
-  PK11SymKey *skey = nullptr;
-  PK11Context *hmac_ctx = nullptr;
+  PK11SymKey* skey = nullptr;
+  PK11Context* hmac_ctx = nullptr;
   SECStatus status;
   unsigned int hmac_len;
   SECItem param = {siBuffer, nullptr, 0};
@@ -177,11 +177,11 @@ static int nr_crypto_nss_hmac(UCHAR *key, size_t keyl, UCHAR *buf, size_t bufl,
   return err;
 }
 
-static int nr_crypto_nss_md5(UCHAR *buf, size_t bufl, UCHAR *result) {
+static int nr_crypto_nss_md5(UCHAR* buf, size_t bufl, UCHAR* result) {
   int err = R_INTERNAL;
   SECStatus rv;
 
-  const SECHashObject *ho = HASH_GetHashObject(HASH_AlgMD5);
+  const SECHashObject* ho = HASH_GetHashObject(HASH_AlgMD5);
   MOZ_ASSERT(ho);
   if (!ho) goto abort;
 
@@ -198,7 +198,7 @@ static int nr_crypto_nss_md5(UCHAR *buf, size_t bufl, UCHAR *result) {
 static nr_ice_crypto_vtbl nr_ice_crypto_nss_vtbl = {
     nr_crypto_nss_random_bytes, nr_crypto_nss_hmac, nr_crypto_nss_md5};
 
-nsresult NrIceStunServer::ToNicerStunStruct(nr_ice_stun_server *server) const {
+nsresult NrIceStunServer::ToNicerStunStruct(nr_ice_stun_server* server) const {
   int r;
 
   memset(server, 0, sizeof(nr_ice_stun_server));
@@ -236,7 +236,7 @@ nsresult NrIceStunServer::ToNicerStunStruct(nr_ice_stun_server *server) const {
   return NS_OK;
 }
 
-nsresult NrIceTurnServer::ToNicerTurnStruct(nr_ice_turn_server *server) const {
+nsresult NrIceTurnServer::ToNicerTurnStruct(nr_ice_turn_server* server) const {
   memset(server, 0, sizeof(nr_ice_turn_server));
 
   nsresult rv = ToNicerStunStruct(&server->turn_server);
@@ -252,7 +252,7 @@ nsresult NrIceTurnServer::ToNicerTurnStruct(nr_ice_turn_server *server) const {
   // C++03 23.2.4, Paragraph 1 stipulates that the elements
   // in std::vector must be contiguous, and can therefore be
   // used as input to functions expecting C arrays.
-  int r = r_data_create(&server->password, const_cast(&password_[0]),
+  int r = r_data_create(&server->password, const_cast(&password_[0]),
                         password_.size());
   if (r) {
     RFREE(server->username);
@@ -262,7 +262,7 @@ nsresult NrIceTurnServer::ToNicerTurnStruct(nr_ice_turn_server *server) const {
   return NS_OK;
 }
 
-NrIceCtx::NrIceCtx(const std::string &name, Policy policy)
+NrIceCtx::NrIceCtx(const std::string& name, Policy policy)
     : connection_state_(ICE_CTX_INIT),
       gathering_state_(ICE_CTX_GATHER_INIT),
       name_(name),
@@ -279,7 +279,7 @@ NrIceCtx::NrIceCtx(const std::string &name, Policy policy)
       proxy_config_(nullptr) {}
 
 /* static */
-RefPtr NrIceCtx::Create(const std::string &name, bool allow_loopback,
+RefPtr NrIceCtx::Create(const std::string& name, bool allow_loopback,
                                   bool tcp_enabled, bool allow_link_local,
                                   Policy policy) {
   // InitializeGlobals only executes once
@@ -294,8 +294,8 @@ RefPtr NrIceCtx::Create(const std::string &name, bool allow_loopback,
   return ctx;
 }
 
-RefPtr NrIceCtx::CreateStream(const std::string &id,
-                                                const std::string &name,
+RefPtr NrIceCtx::CreateStream(const std::string& id,
+                                                const std::string& name,
                                                 int components) {
   if (streams_.count(id)) {
     MOZ_ASSERT(false);
@@ -308,7 +308,7 @@ RefPtr NrIceCtx::CreateStream(const std::string &id,
   return stream;
 }
 
-void NrIceCtx::DestroyStream(const std::string &id) {
+void NrIceCtx::DestroyStream(const std::string& id) {
   auto it = streams_.find(id);
   if (it != streams_.end()) {
     auto preexisting_stream = it->second;
@@ -318,8 +318,8 @@ void NrIceCtx::DestroyStream(const std::string &id) {
 }
 
 // Handler callbacks
-int NrIceCtx::select_pair(void *obj, nr_ice_media_stream *stream,
-                          int component_id, nr_ice_cand_pair **potentials,
+int NrIceCtx::select_pair(void* obj, nr_ice_media_stream* stream,
+                          int component_id, nr_ice_cand_pair** potentials,
                           int potential_ct) {
   MOZ_MTLOG(ML_DEBUG, "select pair called: potential_ct = " << potential_ct);
   MOZ_ASSERT(stream->local_stream);
@@ -328,13 +328,13 @@ int NrIceCtx::select_pair(void *obj, nr_ice_media_stream *stream,
   return 0;
 }
 
-int NrIceCtx::stream_ready(void *obj, nr_ice_media_stream *stream) {
+int NrIceCtx::stream_ready(void* obj, nr_ice_media_stream* stream) {
   MOZ_MTLOG(ML_DEBUG, "stream_ready called");
   MOZ_ASSERT(!stream->local_stream);
   MOZ_ASSERT(!stream->obsolete);
 
   // Get the ICE ctx.
-  NrIceCtx *ctx = static_cast(obj);
+  NrIceCtx* ctx = static_cast(obj);
 
   RefPtr s = ctx->FindStream(stream);
 
@@ -346,13 +346,13 @@ int NrIceCtx::stream_ready(void *obj, nr_ice_media_stream *stream) {
   return 0;
 }
 
-int NrIceCtx::stream_failed(void *obj, nr_ice_media_stream *stream) {
+int NrIceCtx::stream_failed(void* obj, nr_ice_media_stream* stream) {
   MOZ_MTLOG(ML_DEBUG, "stream_failed called");
   MOZ_ASSERT(!stream->local_stream);
   MOZ_ASSERT(!stream->obsolete);
 
   // Get the ICE ctx
-  NrIceCtx *ctx = static_cast(obj);
+  NrIceCtx* ctx = static_cast(obj);
   RefPtr s = ctx->FindStream(stream);
 
   // Streams which do not exist should never fail.
@@ -363,22 +363,22 @@ int NrIceCtx::stream_failed(void *obj, nr_ice_media_stream *stream) {
   return 0;
 }
 
-int NrIceCtx::ice_checking(void *obj, nr_ice_peer_ctx *pctx) {
+int NrIceCtx::ice_checking(void* obj, nr_ice_peer_ctx* pctx) {
   MOZ_MTLOG(ML_DEBUG, "ice_checking called");
 
   // Get the ICE ctx
-  NrIceCtx *ctx = static_cast(obj);
+  NrIceCtx* ctx = static_cast(obj);
 
   ctx->SetConnectionState(ICE_CTX_CHECKING);
 
   return 0;
 }
 
-int NrIceCtx::ice_connected(void *obj, nr_ice_peer_ctx *pctx) {
+int NrIceCtx::ice_connected(void* obj, nr_ice_peer_ctx* pctx) {
   MOZ_MTLOG(ML_DEBUG, "ice_connected called");
 
   // Get the ICE ctx
-  NrIceCtx *ctx = static_cast(obj);
+  NrIceCtx* ctx = static_cast(obj);
 
   // This is called even on failed contexts.
   if (ctx->connection_state() != ICE_CTX_FAILED) {
@@ -388,22 +388,22 @@ int NrIceCtx::ice_connected(void *obj, nr_ice_peer_ctx *pctx) {
   return 0;
 }
 
-int NrIceCtx::ice_disconnected(void *obj, nr_ice_peer_ctx *pctx) {
+int NrIceCtx::ice_disconnected(void* obj, nr_ice_peer_ctx* pctx) {
   MOZ_MTLOG(ML_DEBUG, "ice_disconnected called");
 
   // Get the ICE ctx
-  NrIceCtx *ctx = static_cast(obj);
+  NrIceCtx* ctx = static_cast(obj);
 
   ctx->SetConnectionState(ICE_CTX_DISCONNECTED);
 
   return 0;
 }
 
-int NrIceCtx::msg_recvd(void *obj, nr_ice_peer_ctx *pctx,
-                        nr_ice_media_stream *stream, int component_id,
-                        UCHAR *msg, int len) {
+int NrIceCtx::msg_recvd(void* obj, nr_ice_peer_ctx* pctx,
+                        nr_ice_media_stream* stream, int component_id,
+                        UCHAR* msg, int len) {
   // Get the ICE ctx
-  NrIceCtx *ctx = static_cast(obj);
+  NrIceCtx* ctx = static_cast(obj);
   RefPtr s = ctx->FindStream(stream);
 
   // Streams which do not exist should never have packets.
@@ -414,12 +414,12 @@ int NrIceCtx::msg_recvd(void *obj, nr_ice_peer_ctx *pctx,
   return 0;
 }
 
-void NrIceCtx::trickle_cb(void *arg, nr_ice_ctx *ice_ctx,
-                          nr_ice_media_stream *stream, int component_id,
-                          nr_ice_candidate *candidate) {
+void NrIceCtx::trickle_cb(void* arg, nr_ice_ctx* ice_ctx,
+                          nr_ice_media_stream* stream, int component_id,
+                          nr_ice_candidate* candidate) {
   MOZ_ASSERT(!stream->obsolete);
   // Get the ICE ctx
-  NrIceCtx *ctx = static_cast(arg);
+  NrIceCtx* ctx = static_cast(arg);
   RefPtr s = ctx->FindStream(stream);
 
   if (!s) {
@@ -456,14 +456,14 @@ void NrIceCtx::InitializeGlobals(bool allow_loopback, bool tcp_enabled,
 
     // Set the priorites for candidate type preferences.
     // These numbers come from RFC 5245 S. 4.1.2.2
-    NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_SRV_RFLX, 100);
-    NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_PEER_RFLX, 110);
-    NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_HOST, 126);
-    NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_RELAYED, 5);
-    NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_SRV_RFLX_TCP, 99);
-    NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_PEER_RFLX_TCP, 109);
-    NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_HOST_TCP, 125);
-    NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_RELAYED_TCP, 0);
+    NR_reg_set_uchar((char*)NR_ICE_REG_PREF_TYPE_SRV_RFLX, 100);
+    NR_reg_set_uchar((char*)NR_ICE_REG_PREF_TYPE_PEER_RFLX, 110);
+    NR_reg_set_uchar((char*)NR_ICE_REG_PREF_TYPE_HOST, 126);
+    NR_reg_set_uchar((char*)NR_ICE_REG_PREF_TYPE_RELAYED, 5);
+    NR_reg_set_uchar((char*)NR_ICE_REG_PREF_TYPE_SRV_RFLX_TCP, 99);
+    NR_reg_set_uchar((char*)NR_ICE_REG_PREF_TYPE_PEER_RFLX_TCP, 109);
+    NR_reg_set_uchar((char*)NR_ICE_REG_PREF_TYPE_HOST_TCP, 125);
+    NR_reg_set_uchar((char*)NR_ICE_REG_PREF_TYPE_RELAYED_TCP, 0);
 
     int32_t stun_client_maximum_transmits = 7;
     int32_t ice_trickle_grace_period = 5000;
@@ -491,30 +491,30 @@ void NrIceCtx::InitializeGlobals(bool allow_loopback, bool tcp_enabled,
       }
     }
 
-    NR_reg_set_uint4((char *)"stun.client.maximum_transmits",
+    NR_reg_set_uint4((char*)"stun.client.maximum_transmits",
                      stun_client_maximum_transmits);
-    NR_reg_set_uint4((char *)NR_ICE_REG_TRICKLE_GRACE_PERIOD,
+    NR_reg_set_uint4((char*)NR_ICE_REG_TRICKLE_GRACE_PERIOD,
                      ice_trickle_grace_period);
-    NR_reg_set_int4((char *)NR_ICE_REG_ICE_TCP_SO_SOCK_COUNT,
+    NR_reg_set_int4((char*)NR_ICE_REG_ICE_TCP_SO_SOCK_COUNT,
                     ice_tcp_so_sock_count);
-    NR_reg_set_int4((char *)NR_ICE_REG_ICE_TCP_LISTEN_BACKLOG,
+    NR_reg_set_int4((char*)NR_ICE_REG_ICE_TCP_LISTEN_BACKLOG,
                     ice_tcp_listen_backlog);
 
-    NR_reg_set_char((char *)NR_ICE_REG_ICE_TCP_DISABLE, !tcp_enabled);
+    NR_reg_set_char((char*)NR_ICE_REG_ICE_TCP_DISABLE, !tcp_enabled);
 
     if (allow_loopback) {
-      NR_reg_set_char((char *)NR_STUN_REG_PREF_ALLOW_LOOPBACK_ADDRS, 1);
+      NR_reg_set_char((char*)NR_STUN_REG_PREF_ALLOW_LOOPBACK_ADDRS, 1);
     }
 
     if (allow_link_local) {
-      NR_reg_set_char((char *)NR_STUN_REG_PREF_ALLOW_LINK_LOCAL_ADDRS, 1);
+      NR_reg_set_char((char*)NR_STUN_REG_PREF_ALLOW_LINK_LOCAL_ADDRS, 1);
     }
     if (force_net_interface.Length() > 0) {
       // Stupid cast.... but needed
-      const nsCString &flat =
-          PromiseFlatCString(static_cast(force_net_interface));
-      NR_reg_set_string((char *)NR_ICE_REG_PREF_FORCE_INTERFACE_NAME,
-                        const_cast(flat.get()));
+      const nsCString& flat =
+          PromiseFlatCString(static_cast(force_net_interface));
+      NR_reg_set_string((char*)NR_ICE_REG_PREF_FORCE_INTERFACE_NAME,
+                        const_cast(flat.get()));
     }
   }
 }
@@ -547,13 +547,13 @@ nsTArray NrIceCtx::GetStunAddrs() {
   return addrs;
 }
 
-void NrIceCtx::SetStunAddrs(const nsTArray &addrs) {
-  nr_local_addr *local_addrs;
+void NrIceCtx::SetStunAddrs(const nsTArray& addrs) {
+  nr_local_addr* local_addrs;
   local_addrs = new nr_local_addr[addrs.Length()];
 
   for (size_t i = 0; i < addrs.Length(); ++i) {
     nr_local_addr_copy(&local_addrs[i],
-                       const_cast(&addrs[i].localAddr()));
+                       const_cast(&addrs[i].localAddr()));
   }
   nr_ice_set_local_addresses(ctx_, local_addrs, addrs.Length());
 
@@ -576,7 +576,7 @@ bool NrIceCtx::Initialize() {
       break;
   }
 
-  r = nr_ice_ctx_create(const_cast(name_.c_str()), flags, &ctx_);
+  r = nr_ice_ctx_create(const_cast(name_.c_str()), flags, &ctx_);
 
   if (r) {
     MOZ_MTLOG(ML_ERROR, "Couldn't create ICE ctx for '" << name_ << "'");
@@ -585,7 +585,7 @@ bool NrIceCtx::Initialize() {
 
   // override default factory to capture optional proxy config when creating
   // sockets.
-  nr_socket_factory *factory;
+  nr_socket_factory* factory;
   r = nr_socket_factory_create_int(this, &ctx_socket_factory_vtbl, &factory);
 
   if (r) {
@@ -594,7 +594,7 @@ bool NrIceCtx::Initialize() {
   }
   nr_ice_ctx_set_socket_factory(ctx_, factory);
 
-  nr_interface_prioritizer *prioritizer = CreateInterfacePrioritizer();
+  nr_interface_prioritizer* prioritizer = CreateInterfacePrioritizer();
   if (!prioritizer) {
     MOZ_MTLOG(LogLevel::Error, "Couldn't create interface prioritizer.");
     return false;
@@ -641,7 +641,7 @@ bool NrIceCtx::Initialize() {
   if (!mapping_type.IsEmpty() && !filtering_type.IsEmpty()) {
     MOZ_MTLOG(ML_DEBUG, "NAT filtering type: " << filtering_type.get());
     MOZ_MTLOG(ML_DEBUG, "NAT mapping type: " << mapping_type.get());
-    TestNat *test_nat = new TestNat;
+    TestNat* test_nat = new TestNat;
     test_nat->filtering_type_ = TestNat::ToNatBehavior(filtering_type.get());
     test_nat->mapping_type_ = TestNat::ToNatBehavior(mapping_type.get());
     test_nat->block_udp_ = block_udp;
@@ -668,7 +668,7 @@ bool NrIceCtx::Initialize() {
   // only have one peer ctx.
   std::string peer_name = name_ + ":default";
   r = nr_ice_peer_ctx_create(ctx_, ice_handler_,
-                             const_cast(peer_name.c_str()), &peer_);
+                             const_cast(peer_name.c_str()), &peer_);
   if (r) {
     MOZ_MTLOG(ML_ERROR, "Couldn't create ICE peer ctx for '" << name_ << "'");
     return false;
@@ -681,9 +681,9 @@ bool NrIceCtx::Initialize() {
   return true;
 }
 
-int NrIceCtx::SetNat(const RefPtr &aNat) {
+int NrIceCtx::SetNat(const RefPtr& aNat) {
   nat_ = aNat;
-  nr_socket_factory *fac;
+  nr_socket_factory* fac;
   int r = nat_->create_socket_factory(&fac);
   if (r) {
     return r;
@@ -695,8 +695,8 @@ int NrIceCtx::SetNat(const RefPtr &aNat) {
 // ONLY USE THIS FOR TESTING. Will cause totally unpredictable and possibly very
 // bad effects if ICE is still live.
 void NrIceCtx::internal_DeinitializeGlobal() {
-  NR_reg_del((char *)"stun");
-  NR_reg_del((char *)"ice");
+  NR_reg_del((char*)"stun");
+  NR_reg_del((char*)"ice");
   RLogConnector::DestroyInstance();
   nr_crypto_vtbl = nullptr;
   initialized = false;
@@ -706,7 +706,7 @@ void NrIceCtx::internal_SetTimerAccelarator(int divider) {
   ctx_->test_timer_divider = divider;
 }
 
-void NrIceCtx::AccumulateStats(const NrIceStats &stats) {
+void NrIceCtx::AccumulateStats(const NrIceStats& stats) {
   nr_accumulate_count(&(ctx_->stats.stun_retransmits), stats.stun_retransmits);
   nr_accumulate_count(&(ctx_->stats.turn_401s), stats.turn_401s);
   nr_accumulate_count(&(ctx_->stats.turn_403s), stats.turn_403s);
@@ -717,7 +717,7 @@ NrIceStats NrIceCtx::Destroy() {
   // designed to be called more than once so if stats are desired, this can be
   // called just prior to the destructor
   MOZ_MTLOG(ML_DEBUG, "Destroying ICE ctx '" << name_ << "'");
-  for (auto &idAndStream : streams_) {
+  for (auto& idAndStream : streams_) {
     idAndStream.second->Close();
   }
 
@@ -806,7 +806,7 @@ nsresult NrIceCtx::SetPolicy(Policy policy) {
 }
 
 nsresult NrIceCtx::SetStunServers(
-    const std::vector &stun_servers) {
+    const std::vector& stun_servers) {
   if (stun_servers.empty()) return NS_OK;
 
   auto servers = MakeUnique(stun_servers.size());
@@ -831,7 +831,7 @@ nsresult NrIceCtx::SetStunServers(
 // TODO(ekr@rtfm.com): This is just SetStunServers with s/Stun/Turn
 // Could we do a template or something?
 nsresult NrIceCtx::SetTurnServers(
-    const std::vector &turn_servers) {
+    const std::vector& turn_servers) {
   if (turn_servers.empty()) return NS_OK;
 
   auto servers = MakeUnique(turn_servers.size());
@@ -855,7 +855,7 @@ nsresult NrIceCtx::SetTurnServers(
   return NS_OK;
 }
 
-nsresult NrIceCtx::SetResolver(nr_resolver *resolver) {
+nsresult NrIceCtx::SetResolver(nr_resolver* resolver) {
   int r = nr_ice_ctx_set_resolver(ctx_, resolver);
 
   if (r) {
@@ -866,7 +866,7 @@ nsresult NrIceCtx::SetResolver(nr_resolver *resolver) {
   return NS_OK;
 }
 
-nsresult NrIceCtx::SetProxyServer(NrSocketProxyConfig &&config) {
+nsresult NrIceCtx::SetProxyServer(NrSocketProxyConfig&& config) {
   proxy_config_.reset(new NrSocketProxyConfig(std::move(config)));
   return NS_OK;
 }
@@ -918,8 +918,8 @@ nsresult NrIceCtx::StartGathering(bool default_route_only, bool proxy_only) {
   return NS_OK;
 }
 
-RefPtr NrIceCtx::FindStream(nr_ice_media_stream *stream) {
-  for (auto &idAndStream : streams_) {
+RefPtr NrIceCtx::FindStream(nr_ice_media_stream* stream) {
+  for (auto& idAndStream : streams_) {
     if (idAndStream.second->HasStream(stream)) {
       return idAndStream.second;
     }
@@ -929,7 +929,7 @@ RefPtr NrIceCtx::FindStream(nr_ice_media_stream *stream) {
 }
 
 std::vector NrIceCtx::GetGlobalAttributes() {
-  char **attrs = nullptr;
+  char** attrs = nullptr;
   int attrct;
   int r;
   std::vector ret;
@@ -951,10 +951,10 @@ std::vector NrIceCtx::GetGlobalAttributes() {
 }
 
 nsresult NrIceCtx::ParseGlobalAttributes(std::vector attrs) {
-  std::vector attrs_in;
+  std::vector attrs_in;
   attrs_in.reserve(attrs.size());
-  for (auto &attr : attrs) {
-    attrs_in.push_back(const_cast(attr.c_str()));
+  for (auto& attr : attrs) {
+    attrs_in.push_back(const_cast(attr.c_str()));
   }
 
   int r = nr_ice_peer_ctx_parse_global_attributes(
@@ -969,7 +969,7 @@ nsresult NrIceCtx::ParseGlobalAttributes(std::vector attrs) {
 }
 
 bool NrIceCtx::HasStreamsToConnect() const {
-  for (auto &idAndStream : streams_) {
+  for (auto& idAndStream : streams_) {
     if (idAndStream.second->state() != NrIceMediaStream::ICE_CLOSED) {
       return true;
     }
@@ -1010,8 +1010,8 @@ nsresult NrIceCtx::StartChecks(bool offerer) {
   return NS_OK;
 }
 
-void NrIceCtx::gather_cb(NR_SOCKET s, int h, void *arg) {
-  NrIceCtx *ctx = static_cast(arg);
+void NrIceCtx::gather_cb(NR_SOCKET s, int h, void* arg) {
+  NrIceCtx* ctx = static_cast(arg);
 
   ctx->SetGatheringState(ICE_CTX_GATHER_COMPLETE);
 }
@@ -1091,7 +1091,7 @@ void NrIceCtx::SetConnectionState(ConnectionState state) {
               "NrIceCtx(" << name_ << "): dumping r_log ringbuffer... ");
     std::deque logs;
     RLogConnector::GetInstance()->GetAny(0, &logs);
-    for (auto &log : logs) {
+    for (auto& log : logs) {
       MOZ_MTLOG(ML_INFO, log);
     }
   }
@@ -1112,17 +1112,17 @@ void NrIceCtx::SetGatheringState(GatheringState state) {
 }  // namespace mozilla
 
 // Reimplement nr_ice_compute_codeword to avoid copyright issues
-void nr_ice_compute_codeword(char *buf, int len, char *codeword) {
+void nr_ice_compute_codeword(char* buf, int len, char* codeword) {
   UINT4 c;
 
   r_crc32(buf, len, &c);
 
-  PL_Base64Encode(reinterpret_cast(&c), 3, codeword);
+  PL_Base64Encode(reinterpret_cast(&c), 3, codeword);
   codeword[4] = 0;
 }
 
-int nr_socket_local_create(void *obj, nr_transport_addr *addr,
-                           nr_socket **sockp) {
+int nr_socket_local_create(void* obj, nr_transport_addr* addr,
+                           nr_socket** sockp) {
   using namespace mozilla;
 
   RefPtr sock;
@@ -1130,7 +1130,7 @@ int nr_socket_local_create(void *obj, nr_transport_addr *addr,
   shared_ptr config = nullptr;
 
   if (obj) {
-    config = static_cast(obj)->GetProxyConfig();
+    config = static_cast(obj)->GetProxyConfig();
   }
 
   r = NrSocketBase::CreateSocket(addr, &sock, config);
@@ -1138,7 +1138,7 @@ int nr_socket_local_create(void *obj, nr_transport_addr *addr,
     ABORT(r);
   }
 
-  r = nr_socket_create_int(static_cast(sock), sock->vtbl(), sockp);
+  r = nr_socket_create_int(static_cast(sock), sock->vtbl(), sockp);
   if (r) ABORT(r);
 
   _status = 0;
@@ -1146,7 +1146,7 @@ int nr_socket_local_create(void *obj, nr_transport_addr *addr,
   {
     // We will release this reference in destroy(), not exactly the normal
     // ownership model, but it is what it is.
-    NrSocketBase *dummy = sock.forget().take();
+    NrSocketBase* dummy = sock.forget().take();
     (void)dummy;
   }
 
diff --git a/media/mtransport/nricectx.h b/media/mtransport/nricectx.h
index 70a0f272b6326..8ac805b301e0a 100644
--- a/media/mtransport/nricectx.h
+++ b/media/mtransport/nricectx.h
@@ -83,7 +83,7 @@ typedef struct nr_ice_turn_server_ nr_ice_turn_server;
 typedef struct nr_resolver_ nr_resolver;
 typedef struct nr_proxy_tunnel_config_ nr_proxy_tunnel_config;
 
-typedef void *NR_SOCKET;
+typedef void* NR_SOCKET;
 
 namespace mozilla {
 
@@ -102,14 +102,14 @@ extern const char kNrIceTransportTls[];
 
 class NrIceStunServer {
  public:
-  explicit NrIceStunServer(const PRNetAddr &addr) : has_addr_(true) {
+  explicit NrIceStunServer(const PRNetAddr& addr) : has_addr_(true) {
     memcpy(&addr_, &addr, sizeof(addr));
   }
 
   // The main function to use. Will take either an address or a hostname.
   static UniquePtr Create(
-      const std::string &addr, uint16_t port,
-      const char *transport = kNrIceTransportUdp) {
+      const std::string& addr, uint16_t port,
+      const char* transport = kNrIceTransportUdp) {
     UniquePtr server(new NrIceStunServer(transport));
 
     nsresult rv = server->Init(addr, port);
@@ -118,13 +118,13 @@ class NrIceStunServer {
     return server;
   }
 
-  nsresult ToNicerStunStruct(nr_ice_stun_server *server) const;
+  nsresult ToNicerStunStruct(nr_ice_stun_server* server) const;
 
  protected:
-  explicit NrIceStunServer(const char *transport)
+  explicit NrIceStunServer(const char* transport)
       : addr_(), transport_(transport) {}
 
-  nsresult Init(const std::string &addr, uint16_t port) {
+  nsresult Init(const std::string& addr, uint16_t port) {
     PRStatus status = PR_StringToNetAddr(addr.c_str(), &addr_);
     if (status == PR_SUCCESS) {
       // Parseable as an address
@@ -153,9 +153,9 @@ class NrIceStunServer {
 class NrIceTurnServer : public NrIceStunServer {
  public:
   static UniquePtr Create(
-      const std::string &addr, uint16_t port, const std::string &username,
-      const std::vector &password,
-      const char *transport = kNrIceTransportUdp) {
+      const std::string& addr, uint16_t port, const std::string& username,
+      const std::vector& password,
+      const char* transport = kNrIceTransportUdp) {
     UniquePtr server(
         new NrIceTurnServer(username, password, transport));
 
@@ -165,12 +165,12 @@ class NrIceTurnServer : public NrIceStunServer {
     return server;
   }
 
-  nsresult ToNicerTurnStruct(nr_ice_turn_server *server) const;
+  nsresult ToNicerTurnStruct(nr_ice_turn_server* server) const;
 
  private:
-  NrIceTurnServer(const std::string &username,
-                  const std::vector &password,
-                  const char *transport)
+  NrIceTurnServer(const std::string& username,
+                  const std::vector& password,
+                  const char* transport)
       : NrIceStunServer(transport), username_(username), password_(password) {}
 
   std::string username_;
@@ -210,14 +210,14 @@ class NrIceCtx {
   enum Policy { ICE_POLICY_RELAY, ICE_POLICY_NO_HOST, ICE_POLICY_ALL };
 
   static RefPtr Create(
-      const std::string &name, bool allow_loopback = false,
+      const std::string& name, bool allow_loopback = false,
       bool tcp_enabled = true, bool allow_link_local = false,
       NrIceCtx::Policy policy = NrIceCtx::ICE_POLICY_ALL);
 
-  RefPtr CreateStream(const std::string &id,
-                                        const std::string &name,
+  RefPtr CreateStream(const std::string& id,
+                                        const std::string& name,
                                         int components);
-  void DestroyStream(const std::string &id);
+  void DestroyStream(const std::string& id);
 
   // initialize ICE globals, crypto, and logging
   static void InitializeGlobals(bool allow_loopback = false,
@@ -227,11 +227,11 @@ class NrIceCtx {
   // static GetStunAddrs for use in parent process to support
   // sandboxing restrictions
   static nsTArray GetStunAddrs();
-  void SetStunAddrs(const nsTArray &addrs);
+  void SetStunAddrs(const nsTArray& addrs);
 
   bool Initialize();
 
-  int SetNat(const RefPtr &aNat);
+  int SetNat(const RefPtr& aNat);
 
   // Deinitialize all ICE global state. Used only for testing.
   static void internal_DeinitializeGlobal();
@@ -239,13 +239,13 @@ class NrIceCtx {
   // Divide some timers to faster testing. Used only for testing.
   void internal_SetTimerAccelarator(int divider);
 
-  nr_ice_ctx *ctx() { return ctx_; }
-  nr_ice_peer_ctx *peer() { return peer_; }
+  nr_ice_ctx* ctx() { return ctx_; }
+  nr_ice_peer_ctx* peer() { return peer_; }
 
   // Testing only.
   void destroy_peer_ctx();
 
-  RefPtr GetStream(const std::string &id) {
+  RefPtr GetStream(const std::string& id) {
     auto it = streams_.find(id);
     if (it != streams_.end()) {
       return it->second;
@@ -255,7 +255,7 @@ class NrIceCtx {
 
   std::vector> GetStreams() const {
     std::vector> result;
-    for (auto &idAndStream : streams_) {
+    for (auto& idAndStream : streams_) {
       result.push_back(idAndStream.second);
     }
     return result;
@@ -264,7 +264,7 @@ class NrIceCtx {
   bool HasStreamsToConnect() const;
 
   // The name of the ctx
-  const std::string &name() const { return name_; }
+  const std::string& name() const { return name_; }
 
   // Current state
   ConnectionState connection_state() const { return connection_state_; }
@@ -291,21 +291,21 @@ class NrIceCtx {
 
   // Set the STUN servers. Must be called before StartGathering
   // (if at all).
-  nsresult SetStunServers(const std::vector &stun_servers);
+  nsresult SetStunServers(const std::vector& stun_servers);
 
   // Set the TURN servers. Must be called before StartGathering
   // (if at all).
-  nsresult SetTurnServers(const std::vector &turn_servers);
+  nsresult SetTurnServers(const std::vector& turn_servers);
 
   // Provide the resolution provider. Must be called before
   // StartGathering.
-  nsresult SetResolver(nr_resolver *resolver);
+  nsresult SetResolver(nr_resolver* resolver);
 
   // Provide the proxy address. Must be called before
   // StartGathering.
-  nsresult SetProxyServer(NrSocketProxyConfig &&config);
+  nsresult SetProxyServer(NrSocketProxyConfig&& config);
 
-  const std::shared_ptr &GetProxyConfig() {
+  const std::shared_ptr& GetProxyConfig() {
     return proxy_config_;
   }
 
@@ -324,7 +324,7 @@ class NrIceCtx {
   // more forking.
   nsresult Finalize();
 
-  void AccumulateStats(const NrIceStats &stats);
+  void AccumulateStats(const NrIceStats& stats);
   NrIceStats Destroy();
 
   // Are we trickling?
@@ -332,9 +332,9 @@ class NrIceCtx {
 
   // Signals to indicate events. API users can (and should)
   // register for these.
-  sigslot::signal2
+  sigslot::signal2
       SignalGatheringStateChange;
-  sigslot::signal2
+  sigslot::signal2
       SignalConnectionStateChange;
 
   // The thread to direct method calls to
@@ -343,33 +343,33 @@ class NrIceCtx {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(NrIceCtx)
 
  private:
-  NrIceCtx(const std::string &name, Policy policy);
+  NrIceCtx(const std::string& name, Policy policy);
 
   virtual ~NrIceCtx();
 
   DISALLOW_COPY_ASSIGN(NrIceCtx);
 
   // Callbacks for nICEr
-  static void gather_cb(NR_SOCKET s, int h, void *arg);  // ICE gather complete
+  static void gather_cb(NR_SOCKET s, int h, void* arg);  // ICE gather complete
 
   // Handler implementation
-  static int select_pair(void *obj, nr_ice_media_stream *stream,
-                         int component_id, nr_ice_cand_pair **potentials,
+  static int select_pair(void* obj, nr_ice_media_stream* stream,
+                         int component_id, nr_ice_cand_pair** potentials,
                          int potential_ct);
-  static int stream_ready(void *obj, nr_ice_media_stream *stream);
-  static int stream_failed(void *obj, nr_ice_media_stream *stream);
-  static int ice_checking(void *obj, nr_ice_peer_ctx *pctx);
-  static int ice_connected(void *obj, nr_ice_peer_ctx *pctx);
-  static int ice_disconnected(void *obj, nr_ice_peer_ctx *pctx);
-  static int msg_recvd(void *obj, nr_ice_peer_ctx *pctx,
-                       nr_ice_media_stream *stream, int component_id,
-                       unsigned char *msg, int len);
-  static void trickle_cb(void *arg, nr_ice_ctx *ctx,
-                         nr_ice_media_stream *stream, int component_id,
-                         nr_ice_candidate *candidate);
+  static int stream_ready(void* obj, nr_ice_media_stream* stream);
+  static int stream_failed(void* obj, nr_ice_media_stream* stream);
+  static int ice_checking(void* obj, nr_ice_peer_ctx* pctx);
+  static int ice_connected(void* obj, nr_ice_peer_ctx* pctx);
+  static int ice_disconnected(void* obj, nr_ice_peer_ctx* pctx);
+  static int msg_recvd(void* obj, nr_ice_peer_ctx* pctx,
+                       nr_ice_media_stream* stream, int component_id,
+                       unsigned char* msg, int len);
+  static void trickle_cb(void* arg, nr_ice_ctx* ctx,
+                         nr_ice_media_stream* stream, int component_id,
+                         nr_ice_candidate* candidate);
 
   // Find a media stream by stream ptr. Gross
-  RefPtr FindStream(nr_ice_media_stream *stream);
+  RefPtr FindStream(nr_ice_media_stream* stream);
 
   // Set the state
   void SetConnectionState(ConnectionState state);
@@ -384,10 +384,10 @@ class NrIceCtx {
   TimeStamp ice_start_time_;
   bool ice_controlling_set_;
   std::map> streams_;
-  nr_ice_ctx *ctx_;
-  nr_ice_peer_ctx *peer_;
-  nr_ice_handler_vtbl *ice_handler_vtbl_;  // Must be pointer
-  nr_ice_handler *ice_handler_;            // Must be pointer
+  nr_ice_ctx* ctx_;
+  nr_ice_peer_ctx* peer_;
+  nr_ice_handler_vtbl* ice_handler_vtbl_;  // Must be pointer
+  nr_ice_handler* ice_handler_;            // Must be pointer
   bool trickle_;
   nsCOMPtr sts_target_;  // The thread to run on
   Policy policy_;
diff --git a/media/mtransport/nriceresolver.cpp b/media/mtransport/nriceresolver.cpp
index 16c65701c0cb1..4a598cac099c7 100644
--- a/media/mtransport/nriceresolver.cpp
+++ b/media/mtransport/nriceresolver.cpp
@@ -98,10 +98,10 @@ nsresult NrIceResolver::Init() {
   return rv;
 }
 
-nr_resolver *NrIceResolver::AllocateResolver() {
-  nr_resolver *resolver;
+nr_resolver* NrIceResolver::AllocateResolver() {
+  nr_resolver* resolver;
 
-  int r = nr_resolver_create_int((void *)this, vtbl_, &resolver);
+  int r = nr_resolver_create_int((void*)this, vtbl_, &resolver);
   MOZ_ASSERT(!r);
   if (r) {
     MOZ_MTLOG(ML_ERROR, "nr_resolver_create_int failed");
@@ -124,25 +124,25 @@ void NrIceResolver::DestroyResolver() {
   Release();
 }
 
-int NrIceResolver::destroy(void **objp) {
+int NrIceResolver::destroy(void** objp) {
   if (!objp || !*objp) return 0;
-  NrIceResolver *resolver = static_cast(*objp);
+  NrIceResolver* resolver = static_cast(*objp);
   *objp = nullptr;
   resolver->DestroyResolver();
   return 0;
 }
 
-int NrIceResolver::resolve(void *obj, nr_resolver_resource *resource,
-                           int (*cb)(void *cb_arg, nr_transport_addr *addr),
-                           void *cb_arg, void **handle) {
+int NrIceResolver::resolve(void* obj, nr_resolver_resource* resource,
+                           int (*cb)(void* cb_arg, nr_transport_addr* addr),
+                           void* cb_arg, void** handle) {
   MOZ_ASSERT(obj);
-  return static_cast(obj)->resolve(resource, cb, cb_arg,
-                                                    handle);
+  return static_cast(obj)->resolve(resource, cb, cb_arg,
+                                                   handle);
 }
 
-int NrIceResolver::resolve(nr_resolver_resource *resource,
-                           int (*cb)(void *cb_arg, nr_transport_addr *addr),
-                           void *cb_arg, void **handle) {
+int NrIceResolver::resolve(nr_resolver_resource* resource,
+                           int (*cb)(void* cb_arg, nr_transport_addr* addr),
+                           void* cb_arg, void** handle) {
   int _status;
   MOZ_ASSERT(allocated_resolvers_ > 0);
   ASSERT_ON_THREAD(sts_thread_);
@@ -191,12 +191,12 @@ int NrIceResolver::resolve(nr_resolver_resource *resource,
 }
 
 nsresult NrIceResolver::PendingResolution::OnLookupComplete(
-    nsICancelable *request, nsIDNSRecord *record, nsresult status) {
+    nsICancelable* request, nsIDNSRecord* record, nsresult status) {
   ASSERT_ON_THREAD(thread_);
   // First check if we've been canceled. This is single-threaded on the STS
   // thread, but cancel() cannot guarantee this event isn't on the queue.
   if (request_) {
-    nr_transport_addr *cb_addr = nullptr;
+    nr_transport_addr* cb_addr = nullptr;
     nr_transport_addr ta;
     // TODO(jib@mozilla.com): Revisit when we do TURN.
     if (NS_SUCCEEDED(status)) {
@@ -214,11 +214,11 @@ nsresult NrIceResolver::PendingResolution::OnLookupComplete(
   return NS_OK;
 }
 
-int NrIceResolver::cancel(void *obj, void *handle) {
+int NrIceResolver::cancel(void* obj, void* handle) {
   MOZ_ALWAYS_TRUE(obj);
   MOZ_ASSERT(handle);
-  ASSERT_ON_THREAD(static_cast(obj)->sts_thread_);
-  return static_cast(handle)->cancel();
+  ASSERT_ON_THREAD(static_cast(obj)->sts_thread_);
+  return static_cast(handle)->cancel();
 }
 
 int NrIceResolver::PendingResolution::cancel() {
diff --git a/media/mtransport/nriceresolver.h b/media/mtransport/nriceresolver.h
index 2b6befb589adb..1aaa0f55d3402 100644
--- a/media/mtransport/nriceresolver.h
+++ b/media/mtransport/nriceresolver.h
@@ -67,37 +67,37 @@ class NrIceResolver {
   NrIceResolver();
 
   nsresult Init();
-  nr_resolver *AllocateResolver();
+  nr_resolver* AllocateResolver();
   void DestroyResolver();
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(NrIceResolver)
 
-  int resolve(nr_resolver_resource *resource,
-              int (*cb)(void *cb_arg, nr_transport_addr *addr), void *cb_arg,
-              void **handle);
+  int resolve(nr_resolver_resource* resource,
+              int (*cb)(void* cb_arg, nr_transport_addr* addr), void* cb_arg,
+              void** handle);
 
  private:
   // Implementations of vtbl functions
-  static int destroy(void **objp);
-  static int resolve(void *obj, nr_resolver_resource *resource,
-                     int (*cb)(void *cb_arg, nr_transport_addr *addr),
-                     void *cb_arg, void **handle);
-  static void resolve_cb(NR_SOCKET s, int how, void *cb_arg);
-  static int cancel(void *obj, void *handle);
+  static int destroy(void** objp);
+  static int resolve(void* obj, nr_resolver_resource* resource,
+                     int (*cb)(void* cb_arg, nr_transport_addr* addr),
+                     void* cb_arg, void** handle);
+  static void resolve_cb(NR_SOCKET s, int how, void* cb_arg);
+  static int cancel(void* obj, void* handle);
 
   class PendingResolution : public nsIDNSListener {
    public:
-    PendingResolution(nsIEventTarget *thread, uint16_t port, int transport,
-                      int (*cb)(void *cb_arg, nr_transport_addr *addr),
-                      void *cb_arg)
+    PendingResolution(nsIEventTarget* thread, uint16_t port, int transport,
+                      int (*cb)(void* cb_arg, nr_transport_addr* addr),
+                      void* cb_arg)
         : thread_(thread),
           port_(port),
           transport_(transport),
           cb_(cb),
           cb_arg_(cb_arg) {}
-    NS_IMETHOD OnLookupComplete(nsICancelable *request, nsIDNSRecord *record,
+    NS_IMETHOD OnLookupComplete(nsICancelable* request, nsIDNSRecord* record,
                                 nsresult status) override;
-    NS_IMETHOD OnLookupByTypeComplete(nsICancelable *request,
-                                      nsIDNSByTypeRecord *res,
+    NS_IMETHOD OnLookupByTypeComplete(nsICancelable* request,
+                                      nsIDNSByTypeRecord* res,
                                       nsresult status) override {
       return NS_OK;
     }
@@ -110,11 +110,11 @@ class NrIceResolver {
     nsCOMPtr thread_;
     uint16_t port_;
     int transport_;
-    int (*cb_)(void *cb_arg, nr_transport_addr *addr);
-    void *cb_arg_;
+    int (*cb_)(void* cb_arg, nr_transport_addr* addr);
+    void* cb_arg_;
   };
 
-  nr_resolver_vtbl *vtbl_;
+  nr_resolver_vtbl* vtbl_;
   nsCOMPtr sts_thread_;
   nsCOMPtr dns_;
 #ifdef DEBUG
diff --git a/media/mtransport/nriceresolverfake.cpp b/media/mtransport/nriceresolverfake.cpp
index 8a2fc15574ef6..b275f15c1a346 100644
--- a/media/mtransport/nriceresolverfake.cpp
+++ b/media/mtransport/nriceresolverfake.cpp
@@ -72,10 +72,10 @@ NrIceResolverFake::~NrIceResolverFake() {
   delete vtbl_;
 }
 
-nr_resolver *NrIceResolverFake::AllocateResolver() {
-  nr_resolver *resolver;
+nr_resolver* NrIceResolverFake::AllocateResolver() {
+  nr_resolver* resolver;
 
-  int r = nr_resolver_create_int((void *)this, vtbl_, &resolver);
+  int r = nr_resolver_create_int((void*)this, vtbl_, &resolver);
   MOZ_ASSERT(!r);
   if (r) return nullptr;
 
@@ -86,10 +86,10 @@ nr_resolver *NrIceResolverFake::AllocateResolver() {
 
 void NrIceResolverFake::DestroyResolver() { --allocated_resolvers_; }
 
-int NrIceResolverFake::destroy(void **objp) {
+int NrIceResolverFake::destroy(void** objp) {
   if (!objp || !*objp) return 0;
 
-  NrIceResolverFake *fake = static_cast(*objp);
+  NrIceResolverFake* fake = static_cast(*objp);
   *objp = nullptr;
 
   fake->DestroyResolver();
@@ -97,23 +97,23 @@ int NrIceResolverFake::destroy(void **objp) {
   return 0;
 }
 
-int NrIceResolverFake::resolve(void *obj, nr_resolver_resource *resource,
-                               int (*cb)(void *cb_arg, nr_transport_addr *addr),
-                               void *cb_arg, void **handle) {
+int NrIceResolverFake::resolve(void* obj, nr_resolver_resource* resource,
+                               int (*cb)(void* cb_arg, nr_transport_addr* addr),
+                               void* cb_arg, void** handle) {
   int r, _status;
 
   MOZ_ASSERT(obj);
-  NrIceResolverFake *fake = static_cast(obj);
+  NrIceResolverFake* fake = static_cast(obj);
 
   MOZ_ASSERT(fake->allocated_resolvers_ > 0);
 
-  PendingResolution *pending = new PendingResolution(
+  PendingResolution* pending = new PendingResolution(
       fake, resource->domain_name, resource->port ? resource->port : 3478,
       resource->transport_protocol ? resource->transport_protocol : IPPROTO_UDP,
       resource->address_family, cb, cb_arg);
 
   if ((r = NR_ASYNC_TIMER_SET(fake->delay_ms_, NrIceResolverFake::resolve_cb,
-                              (void *)pending, &pending->timer_handle_))) {
+                              (void*)pending, &pending->timer_handle_))) {
     delete pending;
     ABORT(r);
   }
@@ -124,11 +124,11 @@ int NrIceResolverFake::resolve(void *obj, nr_resolver_resource *resource,
   return (_status);
 }
 
-void NrIceResolverFake::resolve_cb(NR_SOCKET s, int how, void *cb_arg) {
+void NrIceResolverFake::resolve_cb(NR_SOCKET s, int how, void* cb_arg) {
   MOZ_ASSERT(cb_arg);
-  PendingResolution *pending = static_cast(cb_arg);
+  PendingResolution* pending = static_cast(cb_arg);
 
-  const PRNetAddr *addr =
+  const PRNetAddr* addr =
       pending->resolver_->Resolve(pending->hostname_, pending->address_family_);
 
   if (addr) {
@@ -160,11 +160,11 @@ void NrIceResolverFake::resolve_cb(NR_SOCKET s, int how, void *cb_arg) {
   delete pending;
 }
 
-int NrIceResolverFake::cancel(void *obj, void *handle) {
+int NrIceResolverFake::cancel(void* obj, void* handle) {
   MOZ_ASSERT(obj);
-  MOZ_ASSERT(static_cast(obj)->allocated_resolvers_ > 0);
+  MOZ_ASSERT(static_cast(obj)->allocated_resolvers_ > 0);
 
-  PendingResolution *pending = static_cast(handle);
+  PendingResolution* pending = static_cast(handle);
 
   NR_async_timer_cancel(pending->timer_handle_);
   delete pending;
diff --git a/media/mtransport/nriceresolverfake.h b/media/mtransport/nriceresolverfake.h
index e456fbfd04411..dfe81d7ceada8 100644
--- a/media/mtransport/nriceresolverfake.h
+++ b/media/mtransport/nriceresolverfake.h
@@ -61,7 +61,7 @@ class NrIceResolverFake {
   NrIceResolverFake();
   ~NrIceResolverFake();
 
-  void SetAddr(const std::string &hostname, const PRNetAddr &addr) {
+  void SetAddr(const std::string& hostname, const PRNetAddr& addr) {
     switch (addr.raw.family) {
       case AF_INET:
         addrs_[hostname] = addr;
@@ -74,21 +74,21 @@ class NrIceResolverFake {
     }
   }
 
-  nr_resolver *AllocateResolver();
+  nr_resolver* AllocateResolver();
 
   void DestroyResolver();
 
  private:
   // Implementations of vtbl functions
-  static int destroy(void **objp);
-  static int resolve(void *obj, nr_resolver_resource *resource,
-                     int (*cb)(void *cb_arg, nr_transport_addr *addr),
-                     void *cb_arg, void **handle);
-  static void resolve_cb(NR_SOCKET s, int how, void *cb_arg);
-  static int cancel(void *obj, void *handle);
+  static int destroy(void** objp);
+  static int resolve(void* obj, nr_resolver_resource* resource,
+                     int (*cb)(void* cb_arg, nr_transport_addr* addr),
+                     void* cb_arg, void** handle);
+  static void resolve_cb(NR_SOCKET s, int how, void* cb_arg);
+  static int cancel(void* obj, void* handle);
 
   // Get an address.
-  const PRNetAddr *Resolve(const std::string &hostname, int address_family) {
+  const PRNetAddr* Resolve(const std::string& hostname, int address_family) {
     switch (address_family) {
       case AF_INET:
         if (!addrs_.count(hostname)) return nullptr;
@@ -104,10 +104,10 @@ class NrIceResolverFake {
   }
 
   struct PendingResolution {
-    PendingResolution(NrIceResolverFake *resolver, const std::string &hostname,
+    PendingResolution(NrIceResolverFake* resolver, const std::string& hostname,
                       uint16_t port, int transport, int address_family,
-                      int (*cb)(void *cb_arg, nr_transport_addr *addr),
-                      void *cb_arg)
+                      int (*cb)(void* cb_arg, nr_transport_addr* addr),
+                      void* cb_arg)
         : resolver_(resolver),
           hostname_(hostname),
           port_(port),
@@ -116,17 +116,17 @@ class NrIceResolverFake {
           cb_(cb),
           cb_arg_(cb_arg) {}
 
-    NrIceResolverFake *resolver_;
+    NrIceResolverFake* resolver_;
     std::string hostname_;
     uint16_t port_;
     int transport_;
     int address_family_;
-    int (*cb_)(void *cb_arg, nr_transport_addr *addr);
-    void *cb_arg_;
-    void *timer_handle_;
+    int (*cb_)(void* cb_arg, nr_transport_addr* addr);
+    void* cb_arg_;
+    void* timer_handle_;
   };
 
-  nr_resolver_vtbl *vtbl_;
+  nr_resolver_vtbl* vtbl_;
   std::map addrs_;
   std::map addrs6_;
   uint32_t delay_ms_;
diff --git a/media/mtransport/nrinterfaceprioritizer.cpp b/media/mtransport/nrinterfaceprioritizer.cpp
index 0b366ad528672..9037b48c2024f 100644
--- a/media/mtransport/nrinterfaceprioritizer.cpp
+++ b/media/mtransport/nrinterfaceprioritizer.cpp
@@ -25,7 +25,7 @@ class LocalAddress {
         type_preference_(-1),
         ip_version_(-1) {}
 
-  bool Init(const nr_local_addr &local_addr) {
+  bool Init(const nr_local_addr& local_addr) {
     ifname_ = local_addr.addr.ifname;
 
     char buf[MAXIFNAME + 47];
@@ -51,7 +51,7 @@ class LocalAddress {
     return true;
   }
 
-  bool operator<(const LocalAddress &rhs) const {
+  bool operator<(const LocalAddress& rhs) const {
     // Interface that is "less" here is preferred.
     // If type preferences are different, we should simply sort by
     // |type_preference_|.
@@ -93,7 +93,7 @@ class LocalAddress {
     return addr_ < rhs.addr_;
   }
 
-  const std::string &GetKey() const { return key_; }
+  const std::string& GetKey() const { return key_; }
 
  private:
   // Getting the preference corresponding to a type. Getting lower number here
@@ -117,7 +117,7 @@ class LocalAddress {
 
   // TODO(bug 895790): Once we can get useful interface properties on Darwin,
   // we should remove this stuff.
-  static const std::vector &interface_preference_list() {
+  static const std::vector& interface_preference_list() {
     static std::vector list(build_interface_preference_list());
     return list;
   }
@@ -166,7 +166,7 @@ class InterfacePrioritizer {
  public:
   InterfacePrioritizer() : local_addrs_(), preference_map_(), sorted_(false) {}
 
-  int add(const nr_local_addr *iface) {
+  int add(const nr_local_addr* iface) {
     LocalAddress addr;
     if (!addr.Init(*iface)) {
       return R_FAILED;
@@ -183,7 +183,7 @@ class InterfacePrioritizer {
   int sort() {
     UCHAR tmp_pref = 127;
     preference_map_.clear();
-    for (const auto &local_addr : local_addrs_) {
+    for (const auto& local_addr : local_addrs_) {
       if (tmp_pref == 0) {
         return R_FAILED;
       }
@@ -193,7 +193,7 @@ class InterfacePrioritizer {
     return 0;
   }
 
-  int getPreference(const char *key, UCHAR *pref) {
+  int getPreference(const char* key, UCHAR* pref) {
     if (!sorted_) {
       return R_FAILED;
     }
@@ -213,27 +213,27 @@ class InterfacePrioritizer {
 
 }  // anonymous namespace
 
-static int add_interface(void *obj, nr_local_addr *iface) {
-  InterfacePrioritizer *ip = static_cast(obj);
+static int add_interface(void* obj, nr_local_addr* iface) {
+  InterfacePrioritizer* ip = static_cast(obj);
   return ip->add(iface);
 }
 
-static int get_priority(void *obj, const char *key, UCHAR *pref) {
-  InterfacePrioritizer *ip = static_cast(obj);
+static int get_priority(void* obj, const char* key, UCHAR* pref) {
+  InterfacePrioritizer* ip = static_cast(obj);
   return ip->getPreference(key, pref);
 }
 
-static int sort_preference(void *obj) {
-  InterfacePrioritizer *ip = static_cast(obj);
+static int sort_preference(void* obj) {
+  InterfacePrioritizer* ip = static_cast(obj);
   return ip->sort();
 }
 
-static int destroy(void **objp) {
+static int destroy(void** objp) {
   if (!objp || !*objp) {
     return 0;
   }
 
-  InterfacePrioritizer *ip = static_cast(*objp);
+  InterfacePrioritizer* ip = static_cast(*objp);
   *objp = nullptr;
   delete ip;
 
@@ -245,8 +245,8 @@ static nr_interface_prioritizer_vtbl priorizer_vtbl = {
 
 namespace mozilla {
 
-nr_interface_prioritizer *CreateInterfacePrioritizer() {
-  nr_interface_prioritizer *ip;
+nr_interface_prioritizer* CreateInterfacePrioritizer() {
+  nr_interface_prioritizer* ip;
   int r = nr_interface_prioritizer_create_int(new InterfacePrioritizer(),
                                               &priorizer_vtbl, &ip);
   if (r != 0) {
diff --git a/media/mtransport/stun_socket_filter.cpp b/media/mtransport/stun_socket_filter.cpp
index be458686381f7..e19505fa0c0c0 100644
--- a/media/mtransport/stun_socket_filter.cpp
+++ b/media/mtransport/stun_socket_filter.cpp
@@ -19,8 +19,8 @@ namespace {
 
 class NetAddrCompare {
  public:
-  bool operator()(const mozilla::net::NetAddr &lhs,
-                  const mozilla::net::NetAddr &rhs) const {
+  bool operator()(const mozilla::net::NetAddr& lhs,
+                  const mozilla::net::NetAddr& rhs) const {
     if (lhs.raw.family != rhs.raw.family) {
       return lhs.raw.family < rhs.raw.family;
     }
@@ -45,13 +45,13 @@ class NetAddrCompare {
 
 class PendingSTUNRequest {
  public:
-  PendingSTUNRequest(const mozilla::net::NetAddr &netaddr, const UINT12 &id)
+  PendingSTUNRequest(const mozilla::net::NetAddr& netaddr, const UINT12& id)
       : id_(id), net_addr_(netaddr), is_id_set_(true) {}
 
-  MOZ_IMPLICIT PendingSTUNRequest(const mozilla::net::NetAddr &netaddr)
+  MOZ_IMPLICIT PendingSTUNRequest(const mozilla::net::NetAddr& netaddr)
       : id_(), net_addr_(netaddr), is_id_set_(false) {}
 
-  bool operator<(const PendingSTUNRequest &rhs) const {
+  bool operator<(const PendingSTUNRequest& rhs) const {
     if (NetAddrCompare()(net_addr_, rhs.net_addr_)) {
       return true;
     }
@@ -92,11 +92,11 @@ class STUNUDPSocketFilter : public nsISocketFilter {
  private:
   virtual ~STUNUDPSocketFilter() {}
 
-  bool filter_incoming_packet(const mozilla::net::NetAddr *remote_addr,
-                              const uint8_t *data, uint32_t len);
+  bool filter_incoming_packet(const mozilla::net::NetAddr* remote_addr,
+                              const uint8_t* data, uint32_t len);
 
-  bool filter_outgoing_packet(const mozilla::net::NetAddr *remote_addr,
-                              const uint8_t *data, uint32_t len);
+  bool filter_outgoing_packet(const mozilla::net::NetAddr* remote_addr,
+                              const uint8_t* data, uint32_t len);
 
   std::set white_list_;
   std::set pending_requests_;
@@ -106,9 +106,9 @@ class STUNUDPSocketFilter : public nsISocketFilter {
 NS_IMPL_ISUPPORTS(STUNUDPSocketFilter, nsISocketFilter)
 
 NS_IMETHODIMP
-STUNUDPSocketFilter::FilterPacket(const mozilla::net::NetAddr *remote_addr,
-                                  const uint8_t *data, uint32_t len,
-                                  int32_t direction, bool *result) {
+STUNUDPSocketFilter::FilterPacket(const mozilla::net::NetAddr* remote_addr,
+                                  const uint8_t* data, uint32_t len,
+                                  int32_t direction, bool* result) {
   switch (direction) {
     case nsISocketFilter::SF_INCOMING:
       *result = filter_incoming_packet(remote_addr, data, len);
@@ -123,7 +123,7 @@ STUNUDPSocketFilter::FilterPacket(const mozilla::net::NetAddr *remote_addr,
 }
 
 bool STUNUDPSocketFilter::filter_incoming_packet(
-    const mozilla::net::NetAddr *remote_addr, const uint8_t *data,
+    const mozilla::net::NetAddr* remote_addr, const uint8_t* data,
     uint32_t len) {
   // Check white list
   if (white_list_.find(*remote_addr) != white_list_.end()) {
@@ -133,9 +133,9 @@ bool STUNUDPSocketFilter::filter_incoming_packet(
   // If it is a STUN response message and we can match its id with one of the
   // pending requests, we can add this address into whitelist.
   if (nr_is_stun_response_message(
-          reinterpret_cast(const_cast(data)), len)) {
-    const nr_stun_message_header *msg =
-        reinterpret_cast(data);
+          reinterpret_cast(const_cast(data)), len)) {
+    const nr_stun_message_header* msg =
+        reinterpret_cast(data);
     PendingSTUNRequest pending_req(*remote_addr, msg->id);
     std::set::iterator it =
         pending_requests_.find(pending_req);
@@ -149,9 +149,9 @@ bool STUNUDPSocketFilter::filter_incoming_packet(
   // If it's an incoming STUN request we let it pass and add it to the list of
   // pending response for white listing once we answer.
   if (nr_is_stun_request_message(
-          reinterpret_cast(const_cast(data)), len)) {
-    const nr_stun_message_header *msg =
-        reinterpret_cast(data);
+          reinterpret_cast(const_cast(data)), len)) {
+    const nr_stun_message_header* msg =
+        reinterpret_cast(data);
     response_allowed_.insert(PendingSTUNRequest(*remote_addr, msg->id));
     return true;
   }
@@ -168,7 +168,7 @@ bool STUNUDPSocketFilter::filter_incoming_packet(
 }
 
 bool STUNUDPSocketFilter::filter_outgoing_packet(
-    const mozilla::net::NetAddr *remote_addr, const uint8_t *data,
+    const mozilla::net::NetAddr* remote_addr, const uint8_t* data,
     uint32_t len) {
   // Check white list
   if (white_list_.find(*remote_addr) != white_list_.end()) {
@@ -178,9 +178,9 @@ bool STUNUDPSocketFilter::filter_outgoing_packet(
   // Check if it is a stun packet. If yes, we put it into a pending list and
   // wait for response packet.
   if (nr_is_stun_request_message(
-          reinterpret_cast(const_cast(data)), len)) {
-    const nr_stun_message_header *msg =
-        reinterpret_cast(data);
+          reinterpret_cast(const_cast(data)), len)) {
+    const nr_stun_message_header* msg =
+        reinterpret_cast(data);
     pending_requests_.insert(PendingSTUNRequest(*remote_addr, msg->id));
     return true;
   }
@@ -188,9 +188,9 @@ bool STUNUDPSocketFilter::filter_outgoing_packet(
   // If it is a stun response packet, and we had received the request before, we
   // can allow it packet to pass filter.
   if (nr_is_stun_response_message(
-          reinterpret_cast(const_cast(data)), len)) {
-    const nr_stun_message_header *msg =
-        reinterpret_cast(data);
+          reinterpret_cast(const_cast(data)), len)) {
+    const nr_stun_message_header* msg =
+        reinterpret_cast(data);
     std::set::iterator it =
         response_allowed_.find(PendingSTUNRequest(*remote_addr, msg->id));
     if (it != response_allowed_.end()) {
@@ -205,9 +205,9 @@ bool STUNUDPSocketFilter::filter_outgoing_packet(
 
 class PendingSTUNId {
  public:
-  explicit PendingSTUNId(const UINT12 &id) : id_(id) {}
+  explicit PendingSTUNId(const UINT12& id) : id_(id) {}
 
-  bool operator<(const PendingSTUNId &rhs) const {
+  bool operator<(const PendingSTUNId& rhs) const {
     return memcmp(id_.octet, rhs.id_.octet, sizeof(id_.octet)) < 0;
   }
 
@@ -227,9 +227,9 @@ class STUNTCPSocketFilter : public nsISocketFilter {
  private:
   virtual ~STUNTCPSocketFilter() {}
 
-  bool filter_incoming_packet(const uint8_t *data, uint32_t len);
+  bool filter_incoming_packet(const uint8_t* data, uint32_t len);
 
-  bool filter_outgoing_packet(const uint8_t *data, uint32_t len);
+  bool filter_outgoing_packet(const uint8_t* data, uint32_t len);
 
   bool white_listed_;
   std::set pending_request_ids_;
@@ -239,9 +239,9 @@ class STUNTCPSocketFilter : public nsISocketFilter {
 NS_IMPL_ISUPPORTS(STUNTCPSocketFilter, nsISocketFilter)
 
 NS_IMETHODIMP
-STUNTCPSocketFilter::FilterPacket(const mozilla::net::NetAddr *remote_addr,
-                                  const uint8_t *data, uint32_t len,
-                                  int32_t direction, bool *result) {
+STUNTCPSocketFilter::FilterPacket(const mozilla::net::NetAddr* remote_addr,
+                                  const uint8_t* data, uint32_t len,
+                                  int32_t direction, bool* result) {
   switch (direction) {
     case nsISocketFilter::SF_INCOMING:
       *result = filter_incoming_packet(data, len);
@@ -255,14 +255,14 @@ STUNTCPSocketFilter::FilterPacket(const mozilla::net::NetAddr *remote_addr,
   return NS_OK;
 }
 
-bool STUNTCPSocketFilter::filter_incoming_packet(const uint8_t *data,
+bool STUNTCPSocketFilter::filter_incoming_packet(const uint8_t* data,
                                                  uint32_t len) {
   // check if white listed already
   if (white_listed_) {
     return true;
   }
 
-  UCHAR *stun = const_cast(data);
+  UCHAR* stun = const_cast(data);
   uint32_t length = len;
   if (!nr_is_stun_message(stun, length)) {
     stun += 2;
@@ -278,8 +278,8 @@ bool STUNTCPSocketFilter::filter_incoming_packet(const uint8_t *data,
     }
   }
 
-  const nr_stun_message_header *msg =
-      reinterpret_cast(stun);
+  const nr_stun_message_header* msg =
+      reinterpret_cast(stun);
 
   // If it is a STUN response message and we can match its id with one of the
   // pending requests, we can add this address into whitelist.
@@ -299,14 +299,14 @@ bool STUNTCPSocketFilter::filter_incoming_packet(const uint8_t *data,
   return true;
 }
 
-bool STUNTCPSocketFilter::filter_outgoing_packet(const uint8_t *data,
+bool STUNTCPSocketFilter::filter_outgoing_packet(const uint8_t* data,
                                                  uint32_t len) {
   // check if white listed already
   if (white_listed_) {
     return true;
   }
 
-  UCHAR *stun = const_cast(data);
+  UCHAR* stun = const_cast(data);
   uint32_t length = len;
   if (!nr_is_stun_message(stun, length)) {
     stun += 2;
@@ -316,8 +316,8 @@ bool STUNTCPSocketFilter::filter_outgoing_packet(const uint8_t *data,
     }
   }
 
-  const nr_stun_message_header *msg =
-      reinterpret_cast(stun);
+  const nr_stun_message_header* msg =
+      reinterpret_cast(stun);
 
   // Check if it is a stun request. If yes, we put it into a pending list and
   // wait for response packet.
@@ -346,8 +346,8 @@ bool STUNTCPSocketFilter::filter_outgoing_packet(const uint8_t *data,
 NS_IMPL_ISUPPORTS(nsStunUDPSocketFilterHandler, nsISocketFilterHandler)
 
 NS_IMETHODIMP nsStunUDPSocketFilterHandler::NewFilter(
-    nsISocketFilter **result) {
-  nsISocketFilter *ret = new STUNUDPSocketFilter();
+    nsISocketFilter** result) {
+  nsISocketFilter* ret = new STUNUDPSocketFilter();
   NS_ADDREF(*result = ret);
   return NS_OK;
 }
@@ -355,8 +355,8 @@ NS_IMETHODIMP nsStunUDPSocketFilterHandler::NewFilter(
 NS_IMPL_ISUPPORTS(nsStunTCPSocketFilterHandler, nsISocketFilterHandler)
 
 NS_IMETHODIMP nsStunTCPSocketFilterHandler::NewFilter(
-    nsISocketFilter **result) {
-  nsISocketFilter *ret = new STUNTCPSocketFilter();
+    nsISocketFilter** result) {
+  nsISocketFilter* ret = new STUNTCPSocketFilter();
   NS_ADDREF(*result = ret);
   return NS_OK;
 }
diff --git a/media/mtransport/test/TestSyncRunnable.cpp b/media/mtransport/test/TestSyncRunnable.cpp
index 8dedee99cfab8..5e86209fb2cf6 100644
--- a/media/mtransport/test/TestSyncRunnable.cpp
+++ b/media/mtransport/test/TestSyncRunnable.cpp
@@ -10,7 +10,7 @@
 
 using namespace mozilla;
 
-nsIThread *gThread = nullptr;
+nsIThread* gThread = nullptr;
 
 class TestRunnable : public Runnable {
  public:
diff --git a/media/mtransport/test/buffered_stun_socket_unittest.cpp b/media/mtransport/test/buffered_stun_socket_unittest.cpp
index c8d8740d88167..c48cbc1a2a0ac 100644
--- a/media/mtransport/test/buffered_stun_socket_unittest.cpp
+++ b/media/mtransport/test/buffered_stun_socket_unittest.cpp
@@ -52,7 +52,7 @@ class BufferedStunSocketTest : public MtransportTest {
     ASSERT_EQ(0, r);
     dummy_ = dummy.forget();  // Now owned by test_socket_.
 
-    r = nr_str_port_to_transport_addr((char *)"192.0.2.133", 3333, IPPROTO_TCP,
+    r = nr_str_port_to_transport_addr((char*)"192.0.2.133", 3333, IPPROTO_TCP,
                                       &remote_addr_);
     ASSERT_EQ(0, r);
 
@@ -60,11 +60,11 @@ class BufferedStunSocketTest : public MtransportTest {
     ASSERT_EQ(0, r);
   }
 
-  nr_socket *socket() { return test_socket_; }
+  nr_socket* socket() { return test_socket_; }
 
  protected:
   RefPtr dummy_;
-  nr_socket *test_socket_;
+  nr_socket* test_socket_;
   nr_transport_addr remote_addr_;
 };
 
@@ -154,8 +154,8 @@ TEST_F(BufferedStunSocketTest, TestSendToReject) {
 TEST_F(BufferedStunSocketTest, TestSendToWrongAddr) {
   nr_transport_addr addr;
 
-  int r = nr_str_port_to_transport_addr((char *)"192.0.2.134", 3333,
-                                        IPPROTO_TCP, &addr);
+  int r = nr_str_port_to_transport_addr((char*)"192.0.2.134", 3333, IPPROTO_TCP,
+                                        &addr);
   ASSERT_EQ(0, r);
 
   r = nr_socket_sendto(test_socket_, kStunMessage, kStunMessageLen, 0, &addr);
@@ -232,8 +232,8 @@ TEST_F(BufferedStunSocketTest, TestReceiveRecvFromReallyLong) {
   uint8_t garbage[4096];
   memset(garbage, 0xff, sizeof(garbage));
   memcpy(garbage, kStunMessage, kStunMessageLen);
-  nr_stun_message_header *hdr =
-      reinterpret_cast(garbage);
+  nr_stun_message_header* hdr =
+      reinterpret_cast(garbage);
   hdr->length = htons(3000);
 
   dummy_->SetReadBuffer(garbage, sizeof(garbage));
diff --git a/media/mtransport/test/dummysocket.h b/media/mtransport/test/dummysocket.h
index d0c88d8251787..882bbd86e4a2d 100644
--- a/media/mtransport/test/dummysocket.h
+++ b/media/mtransport/test/dummysocket.h
@@ -59,44 +59,44 @@ class DummySocket : public NrSocketBase {
         self_(nullptr) {}
 
   // the nr_socket APIs
-  virtual int create(nr_transport_addr *addr) override { return 0; }
+  virtual int create(nr_transport_addr* addr) override { return 0; }
 
-  virtual int sendto(const void *msg, size_t len, int flags,
-                     nr_transport_addr *to) override {
+  virtual int sendto(const void* msg, size_t len, int flags,
+                     nr_transport_addr* to) override {
     MOZ_CRASH();
     return 0;
   }
 
-  virtual int recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                       nr_transport_addr *from) override {
+  virtual int recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                       nr_transport_addr* from) override {
     MOZ_CRASH();
     return 0;
   }
 
-  virtual int getaddr(nr_transport_addr *addrp) override {
+  virtual int getaddr(nr_transport_addr* addrp) override {
     MOZ_CRASH();
     return 0;
   }
 
   virtual void close() override {}
 
-  virtual int connect(nr_transport_addr *addr) override {
+  virtual int connect(nr_transport_addr* addr) override {
     nr_transport_addr_copy(&connect_addr_, addr);
     return 0;
   }
 
   virtual int listen(int backlog) override { return 0; }
 
-  virtual int accept(nr_transport_addr *addrp, nr_socket **sockp) override {
+  virtual int accept(nr_transport_addr* addrp, nr_socket** sockp) override {
     return 0;
   }
 
-  virtual int write(const void *msg, size_t len, size_t *written) override {
+  virtual int write(const void* msg, size_t len, size_t* written) override {
     size_t to_write = std::min(len, writable_);
 
     if (to_write) {
       UniquePtr msgbuf(new MediaPacket);
-      msgbuf->Copy(static_cast(msg), to_write);
+      msgbuf->Copy(static_cast(msg), to_write);
       write_buffer_ = merge(std::move(write_buffer_), std::move(msgbuf));
     }
 
@@ -105,7 +105,7 @@ class DummySocket : public NrSocketBase {
     return 0;
   }
 
-  virtual int read(void *buf, size_t maxlen, size_t *len) override {
+  virtual int read(void* buf, size_t maxlen, size_t* len) override {
     if (!read_buffer_.get()) {
       return R_WOULDBLOCK;
     }
@@ -116,7 +116,7 @@ class DummySocket : public NrSocketBase {
     *len = to_read;
 
     if (to_read < read_buffer_->len()) {
-      MediaPacket *newPacket = new MediaPacket;
+      MediaPacket* newPacket = new MediaPacket;
       newPacket->Copy(read_buffer_->data() + to_read,
                       read_buffer_->len() - to_read);
       read_buffer_.reset(newPacket);
@@ -130,7 +130,7 @@ class DummySocket : public NrSocketBase {
   // Implementations of the async_event APIs.
   // These are no-ops because we handle scheduling manually
   // for test purposes.
-  virtual int async_wait(int how, NR_async_cb cb, void *cb_arg, char *function,
+  virtual int async_wait(int how, NR_async_cb cb, void* cb_arg, char* function,
                          int line) override {
     EXPECT_EQ(nullptr, cb_);
     cb_ = cb;
@@ -147,7 +147,7 @@ class DummySocket : public NrSocketBase {
   }
 
   // Read/Manipulate the current state.
-  void CheckWriteBuffer(const uint8_t *data, size_t len) {
+  void CheckWriteBuffer(const uint8_t* data, size_t len) {
     if (!len) {
       EXPECT_EQ(nullptr, write_buffer_.get());
     } else {
@@ -163,7 +163,7 @@ class DummySocket : public NrSocketBase {
 
   void FireWritableCb() {
     NR_async_cb cb = cb_;
-    void *cb_arg = cb_arg_;
+    void* cb_arg = cb_arg_;
 
     cb_ = nullptr;
     cb_arg_ = nullptr;
@@ -171,7 +171,7 @@ class DummySocket : public NrSocketBase {
     cb(this, NR_ASYNC_WAIT_WRITE, cb_arg);
   }
 
-  void SetReadBuffer(const uint8_t *data, size_t len) {
+  void SetReadBuffer(const uint8_t* data, size_t len) {
     EXPECT_EQ(nullptr, write_buffer_.get());
     read_buffer_.reset(new MediaPacket);
     read_buffer_->Copy(data, len);
@@ -181,7 +181,7 @@ class DummySocket : public NrSocketBase {
 
   void SetReadable(size_t val) { readable_ = val; }
 
-  nr_socket *get_nr_socket() {
+  nr_socket* get_nr_socket() {
     if (!self_) {
       int r = nr_socket_create_int(this, vtbl(), &self_);
       AddRef();
@@ -191,7 +191,7 @@ class DummySocket : public NrSocketBase {
     return self_;
   }
 
-  nr_transport_addr *get_connect_addr() { return &connect_addr_; }
+  nr_transport_addr* get_connect_addr() { return &connect_addr_; }
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DummySocket, override);
 
@@ -206,8 +206,8 @@ class DummySocket : public NrSocketBase {
   UniquePtr read_buffer_;
 
   NR_async_cb cb_;
-  void *cb_arg_;
-  nr_socket *self_;
+  void* cb_arg_;
+  nr_socket* self_;
 
   nr_transport_addr connect_addr_;
 };
diff --git a/media/mtransport/test/multi_tcp_socket_unittest.cpp b/media/mtransport/test/multi_tcp_socket_unittest.cpp
index 567d87553e8bd..a242c8406695b 100644
--- a/media/mtransport/test/multi_tcp_socket_unittest.cpp
+++ b/media/mtransport/test/multi_tcp_socket_unittest.cpp
@@ -62,21 +62,21 @@ class MultiTcpSocketTest : public MtransportTest {
 
   DISALLOW_COPY_ASSIGN(MultiTcpSocketTest);
 
-  static void SockReadable(NR_SOCKET s, int how, void *arg) {
-    MultiTcpSocketTest *obj = static_cast(arg);
+  static void SockReadable(NR_SOCKET s, int how, void* arg) {
+    MultiTcpSocketTest* obj = static_cast(arg);
     obj->SetReadable(true);
   }
 
   void Shutdown_s() {
     ice_ctx_ = nullptr;
-    for (auto &sock : socks) {
+    for (auto& sock : socks) {
       nr_socket_destroy(&sock);
     }
   }
 
   static uint16_t GetRandomPort() {
     uint16_t result;
-    if (PK11_GenerateRandom((unsigned char *)&result, 2) != SECSuccess) {
+    if (PK11_GenerateRandom((unsigned char*)&result, 2) != SECSuccess) {
       MOZ_ASSERT(false);
       return 0;
     }
@@ -89,7 +89,7 @@ class MultiTcpSocketTest : public MtransportTest {
   }
 
   void Create_s(nr_socket_tcp_type tcp_type, std::string stun_server_addr,
-                uint16_t stun_server_port, nr_socket **sock) {
+                uint16_t stun_server_port, nr_socket** sock) {
     nr_transport_addr local;
     // Get start of port range for test
     static unsigned short port_s = GetRandomPort();
@@ -107,7 +107,7 @@ class MultiTcpSocketTest : public MtransportTest {
     r = 1;
     for (int tries = 10; tries && r; --tries) {
       r = nr_str_port_to_transport_addr(
-          (char *)"127.0.0.1", EnsureEphemeral(port_s++), IPPROTO_TCP, &local);
+          (char*)"127.0.0.1", EnsureEphemeral(port_s++), IPPROTO_TCP, &local);
       ASSERT_EQ(0, r);
 
       r = nr_socket_multi_tcp_create(ice_ctx_->ctx(), &local, tcp_type, 1, 2048,
@@ -121,10 +121,10 @@ class MultiTcpSocketTest : public MtransportTest {
     ASSERT_EQ(0, r);
   }
 
-  nr_socket *Create(nr_socket_tcp_type tcp_type,
+  nr_socket* Create(nr_socket_tcp_type tcp_type,
                     std::string stun_server_addr = "",
                     uint16_t stun_server_port = 0) {
-    nr_socket *sock = nullptr;
+    nr_socket* sock = nullptr;
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::Create_s, tcp_type,
                      stun_server_addr, stun_server_port, &sock),
@@ -132,7 +132,7 @@ class MultiTcpSocketTest : public MtransportTest {
     return sock;
   }
 
-  void Listen_s(nr_socket *sock) {
+  void Listen_s(nr_socket* sock) {
     nr_transport_addr addr;
     int r = nr_socket_getaddr(sock, &addr);
     ASSERT_EQ(0, r);
@@ -141,24 +141,24 @@ class MultiTcpSocketTest : public MtransportTest {
     ASSERT_EQ(0, r);
   }
 
-  void Listen(nr_socket *sock) {
+  void Listen(nr_socket* sock) {
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::Listen_s, sock),
         NS_DISPATCH_SYNC);
   }
 
-  void Destroy_s(nr_socket *sock) {
+  void Destroy_s(nr_socket* sock) {
     int r = nr_socket_destroy(&sock);
     ASSERT_EQ(0, r);
   }
 
-  void Destroy(nr_socket *sock) {
+  void Destroy(nr_socket* sock) {
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::Destroy_s, sock),
         NS_DISPATCH_SYNC);
   }
 
-  void Connect_s(nr_socket *from, nr_socket *to) {
+  void Connect_s(nr_socket* from, nr_socket* to) {
     nr_transport_addr addr_to;
     nr_transport_addr addr_from;
     int r = nr_socket_getaddr(to, &addr_to);
@@ -171,13 +171,13 @@ class MultiTcpSocketTest : public MtransportTest {
     ASSERT_EQ(0, r);
   }
 
-  void Connect(nr_socket *from, nr_socket *to) {
+  void Connect(nr_socket* from, nr_socket* to) {
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::Connect_s, from, to),
         NS_DISPATCH_SYNC);
   }
 
-  void ConnectSo_s(nr_socket *so1, nr_socket *so2) {
+  void ConnectSo_s(nr_socket* so1, nr_socket* so2) {
     nr_transport_addr addr_so1;
     nr_transport_addr addr_so2;
     int r = nr_socket_getaddr(so1, &addr_so1);
@@ -191,14 +191,14 @@ class MultiTcpSocketTest : public MtransportTest {
     ASSERT_EQ(0, r);
   }
 
-  void ConnectSo(nr_socket *from, nr_socket *to) {
+  void ConnectSo(nr_socket* from, nr_socket* to) {
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::ConnectSo_s, from, to),
         NS_DISPATCH_SYNC);
   }
 
-  void SendDataToAddress_s(nr_socket *from, nr_transport_addr *to,
-                           const char *data, size_t len) {
+  void SendDataToAddress_s(nr_socket* from, nr_transport_addr* to,
+                           const char* data, size_t len) {
     nr_transport_addr addr_from;
 
     int r = nr_socket_getaddr(from, &addr_from);
@@ -209,7 +209,7 @@ class MultiTcpSocketTest : public MtransportTest {
     ASSERT_EQ(0, r);
   }
 
-  void SendData(nr_socket *from, nr_transport_addr *to, const char *data,
+  void SendData(nr_socket* from, nr_transport_addr* to, const char* data,
                 size_t len) {
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::SendDataToAddress_s, from, to,
@@ -217,7 +217,7 @@ class MultiTcpSocketTest : public MtransportTest {
         NS_DISPATCH_SYNC);
   }
 
-  void SendDataToSocket_s(nr_socket *from, nr_socket *to, const char *data,
+  void SendDataToSocket_s(nr_socket* from, nr_socket* to, const char* data,
                           size_t len) {
     nr_transport_addr addr_to;
 
@@ -226,15 +226,15 @@ class MultiTcpSocketTest : public MtransportTest {
     SendDataToAddress_s(from, &addr_to, data, len);
   }
 
-  void SendData(nr_socket *from, nr_socket *to, const char *data, size_t len) {
+  void SendData(nr_socket* from, nr_socket* to, const char* data, size_t len) {
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::SendDataToSocket_s, from, to,
                      data, len),
         NS_DISPATCH_SYNC);
   }
 
-  void RecvDataFromAddress_s(nr_transport_addr *expected_from,
-                             nr_socket *sent_to, const char *expected_data,
+  void RecvDataFromAddress_s(nr_transport_addr* expected_from,
+                             nr_socket* sent_to, const char* expected_data,
                              size_t expected_len) {
     SetReadable(false);
     size_t buflen = expected_len ? expected_len + 1 : 100;
@@ -263,8 +263,8 @@ class MultiTcpSocketTest : public MtransportTest {
     }
   }
 
-  void RecvData(nr_transport_addr *expected_from, nr_socket *sent_to,
-                const char *expected_data = nullptr, size_t expected_len = 0) {
+  void RecvData(nr_transport_addr* expected_from, nr_socket* sent_to,
+                const char* expected_data = nullptr, size_t expected_len = 0) {
     ASSERT_TRUE_WAIT(IsReadable(), 1000);
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::RecvDataFromAddress_s,
@@ -272,8 +272,8 @@ class MultiTcpSocketTest : public MtransportTest {
         NS_DISPATCH_SYNC);
   }
 
-  void RecvDataFromSocket_s(nr_socket *expected_from, nr_socket *sent_to,
-                            const char *expected_data, size_t expected_len) {
+  void RecvDataFromSocket_s(nr_socket* expected_from, nr_socket* sent_to,
+                            const char* expected_data, size_t expected_len) {
     nr_transport_addr addr_from;
 
     int r = nr_socket_getaddr(expected_from, &addr_from);
@@ -282,8 +282,8 @@ class MultiTcpSocketTest : public MtransportTest {
     RecvDataFromAddress_s(&addr_from, sent_to, expected_data, expected_len);
   }
 
-  void RecvData(nr_socket *expected_from, nr_socket *sent_to,
-                const char *expected_data, size_t expected_len) {
+  void RecvData(nr_socket* expected_from, nr_socket* sent_to,
+                const char* expected_data, size_t expected_len) {
     ASSERT_TRUE_WAIT(IsReadable(), 1000);
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &MultiTcpSocketTest::RecvDataFromSocket_s,
@@ -291,7 +291,7 @@ class MultiTcpSocketTest : public MtransportTest {
         NS_DISPATCH_SYNC);
   }
 
-  void RecvDataFailed_s(nr_socket *sent_to, size_t expected_len,
+  void RecvDataFailed_s(nr_socket* sent_to, size_t expected_len,
                         int expected_err) {
     SetReadable(false);
     char received_data[expected_len + 1];
@@ -307,7 +307,7 @@ class MultiTcpSocketTest : public MtransportTest {
                                << " on " << addr_to.as_string;
   }
 
-  void RecvDataFailed(nr_socket *sent_to, size_t expected_len,
+  void RecvDataFailed(nr_socket* sent_to, size_t expected_len,
                       int expected_err) {
     ASSERT_TRUE_WAIT(IsReadable(), 1000);
     test_utils_->sts_target()->Dispatch(
@@ -316,7 +316,7 @@ class MultiTcpSocketTest : public MtransportTest {
         NS_DISPATCH_SYNC);
   }
 
-  void TransferData(nr_socket *from, nr_socket *to, const char *data,
+  void TransferData(nr_socket* from, nr_socket* to, const char* data,
                     size_t len) {
     SendData(from, to, data, len);
     RecvData(from, to, data, len);
@@ -325,7 +325,7 @@ class MultiTcpSocketTest : public MtransportTest {
  protected:
   bool IsReadable() const { return readable; }
   void SetReadable(bool r) { readable = r; }
-  std::vector socks;
+  std::vector socks;
   Atomic readable;
   RefPtr ice_ctx_;
 };
diff --git a/media/mtransport/test/nrappkit_unittest.cpp b/media/mtransport/test/nrappkit_unittest.cpp
index 1238104f2c2ff..3aa995cf219fa 100644
--- a/media/mtransport/test/nrappkit_unittest.cpp
+++ b/media/mtransport/test/nrappkit_unittest.cpp
@@ -91,16 +91,16 @@ class TimerTest : public MtransportTest {
     return 0;
   }
 
-  static void cb(NR_SOCKET r, int how, void *arg) {
+  static void cb(NR_SOCKET r, int how, void* arg) {
     std::cerr << "Timer fired " << std::endl;
 
-    TimerTest *t = static_cast(arg);
+    TimerTest* t = static_cast(arg);
 
     t->fired_ = true;
   }
 
  protected:
-  void *handle_;
+  void* handle_;
   bool fired_;
 };
 }  // namespace
diff --git a/media/mtransport/test/proxy_tunnel_socket_unittest.cpp b/media/mtransport/test/proxy_tunnel_socket_unittest.cpp
index c8e5cf1d5c9cf..a6c2ef888c40d 100644
--- a/media/mtransport/test/proxy_tunnel_socket_unittest.cpp
+++ b/media/mtransport/test/proxy_tunnel_socket_unittest.cpp
@@ -40,7 +40,7 @@ class NrSocketProxyTest : public MtransportTest {
     config.reset(new NrSocketProxyConfig(0, alpn, net::LoadInfoArgs()));
     // config is never used but must be non-null
     mSProxy = new NrSocketProxy(config);
-    int r = nr_socket_create_int((void *)mSProxy.get(), mSProxy->vtbl(),
+    int r = nr_socket_create_int((void*)mSProxy.get(), mSProxy->vtbl(),
                                  &nr_socket_);
     ASSERT_EQ(0, r);
 
@@ -50,13 +50,13 @@ class NrSocketProxyTest : public MtransportTest {
 
   void TearDown() override { mSProxy->close(); }
 
-  static void readable_cb(NR_SOCKET s, int how, void *cb_arg) {
-    NrSocketProxyTest *test = (NrSocketProxyTest *)cb_arg;
+  static void readable_cb(NR_SOCKET s, int how, void* cb_arg) {
+    NrSocketProxyTest* test = (NrSocketProxyTest*)cb_arg;
     size_t capacity = std::min(test->mReadChunkSize, test->mReadAllowance);
     nsTArray array(capacity);
     size_t read;
 
-    nr_socket_read(test->nr_socket_, (char *)array.Elements(), array.Capacity(),
+    nr_socket_read(test->nr_socket_, (char*)array.Elements(), array.Capacity(),
                    &read, 0);
 
     ASSERT_TRUE(read <= array.Capacity());
@@ -75,18 +75,18 @@ class NrSocketProxyTest : public MtransportTest {
     }
   }
 
-  static void writable_cb(NR_SOCKET s, int how, void *cb_arg) {
-    NrSocketProxyTest *test = (NrSocketProxyTest *)cb_arg;
+  static void writable_cb(NR_SOCKET s, int how, void* cb_arg) {
+    NrSocketProxyTest* test = (NrSocketProxyTest*)cb_arg;
     test->mConnected = true;
   }
 
   const std::string DataString() {
-    return std::string((char *)mData.Elements(), mData.Length());
+    return std::string((char*)mData.Elements(), mData.Length());
   }
 
  protected:
   RefPtr mSProxy;
-  nr_socket *nr_socket_;
+  nr_socket* nr_socket_;
 
   nsTArray mData;
   nsTArray mEmptyArray;
diff --git a/media/mtransport/test/runnable_utils_unittest.cpp b/media/mtransport/test/runnable_utils_unittest.cpp
index a5b451ed9f2ba..c8e0311e4a9e1 100644
--- a/media/mtransport/test/runnable_utils_unittest.cpp
+++ b/media/mtransport/test/runnable_utils_unittest.cpp
@@ -42,17 +42,17 @@ class Destructor {
   }
 
  public:
-  explicit Destructor(bool *destroyed) : destroyed_(destroyed) {}
+  explicit Destructor(bool* destroyed) : destroyed_(destroyed) {}
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Destructor)
 
  private:
-  bool *destroyed_;
+  bool* destroyed_;
 };
 
 class TargetClass {
  public:
-  explicit TargetClass(int *ran) : ran_(ran) {}
+  explicit TargetClass(int* ran) : ran_(ran) {}
 
   void m1(int x) {
     std::cerr << __FUNCTION__ << " " << x << std::endl;
@@ -64,7 +64,7 @@ class TargetClass {
     *ran_ = 2;
   }
 
-  void m1set(bool *z) {
+  void m1set(bool* z) {
     std::cerr << __FUNCTION__ << std::endl;
     *z = true;
   }
@@ -72,11 +72,11 @@ class TargetClass {
     std::cerr << __FUNCTION__ << std::endl;
     return x;
   }
-  void destructor_target(Destructor *) {}
+  void destructor_target(Destructor*) {}
 
   void destructor_target_ref(RefPtr destructor) {}
 
-  int *ran_;
+  int* ran_;
 };
 
 class RunnableArgsTest : public MtransportTest {
@@ -84,13 +84,13 @@ class RunnableArgsTest : public MtransportTest {
   RunnableArgsTest() : MtransportTest(), ran_(0), cl_(&ran_) {}
 
   void Test1Arg() {
-    Runnable *r = WrapRunnable(&cl_, &TargetClass::m1, 1);
+    Runnable* r = WrapRunnable(&cl_, &TargetClass::m1, 1);
     r->Run();
     ASSERT_EQ(1, ran_);
   }
 
   void Test2Args() {
-    Runnable *r = WrapRunnable(&cl_, &TargetClass::m2, 1, 2);
+    Runnable* r = WrapRunnable(&cl_, &TargetClass::m2, 1, 2);
     r->Run();
     ASSERT_EQ(2, ran_);
   }
@@ -113,13 +113,13 @@ class DispatchTest : public MtransportTest {
   }
 
   void Test1Arg() {
-    Runnable *r = WrapRunnable(&cl_, &TargetClass::m1, 1);
+    Runnable* r = WrapRunnable(&cl_, &TargetClass::m1, 1);
     target_->Dispatch(r, NS_DISPATCH_SYNC);
     ASSERT_EQ(1, ran_);
   }
 
   void Test2Args() {
-    Runnable *r = WrapRunnable(&cl_, &TargetClass::m2, 1, 2);
+    Runnable* r = WrapRunnable(&cl_, &TargetClass::m2, 1, 2);
     target_->Dispatch(r, NS_DISPATCH_SYNC);
     ASSERT_EQ(2, ran_);
   }
@@ -158,9 +158,9 @@ TEST_F(DispatchTest, Test1Set) { Test1Set(); }
 
 TEST_F(DispatchTest, TestRet) { TestRet(); }
 
-void SetNonMethod(TargetClass *cl, int x) { cl->m1(x); }
+void SetNonMethod(TargetClass* cl, int x) { cl->m1(x); }
 
-int SetNonMethodRet(TargetClass *cl, int x) {
+int SetNonMethodRet(TargetClass* cl, int x) {
   cl->m1(x);
 
   return x;
diff --git a/media/mtransport/test/sctp_unittest.cpp b/media/mtransport/test/sctp_unittest.cpp
index acf4b5914f776..ed598b6f9d552 100644
--- a/media/mtransport/test/sctp_unittest.cpp
+++ b/media/mtransport/test/sctp_unittest.cpp
@@ -41,7 +41,7 @@ class TransportTestPeer;
 
 class SendPeriodic : public nsITimerCallback {
  public:
-  SendPeriodic(TransportTestPeer *peer, int to_send)
+  SendPeriodic(TransportTestPeer* peer, int to_send)
       : peer_(peer), to_send_(to_send) {}
 
   NS_DECL_THREADSAFE_ISUPPORTS
@@ -50,7 +50,7 @@ class SendPeriodic : public nsITimerCallback {
  protected:
   virtual ~SendPeriodic() {}
 
-  TransportTestPeer *peer_;
+  TransportTestPeer* peer_;
   int to_send_;
 };
 
@@ -59,7 +59,7 @@ NS_IMPL_ISUPPORTS(SendPeriodic, nsITimerCallback)
 class TransportTestPeer : public sigslot::has_slots<> {
  public:
   TransportTestPeer(std::string name, int local_port, int remote_port,
-                    MtransportTestUtils *utils)
+                    MtransportTestUtils* utils)
       : name_(name),
         connected_(false),
         sent_(0),
@@ -72,10 +72,10 @@ class TransportTestPeer : public sigslot::has_slots<> {
         periodic_(nullptr),
         test_utils_(utils) {
     std::cerr << "Creating TransportTestPeer; flow="
-              << static_cast(flow_.get()) << " local=" << local_port
+              << static_cast(flow_.get()) << " local=" << local_port
               << " remote=" << remote_port << std::endl;
 
-    usrsctp_register_address(static_cast(this));
+    usrsctp_register_address(static_cast(this));
     int r = usrsctp_set_non_blocking(sctp_, 1);
     EXPECT_GE(r, 0);
 
@@ -102,7 +102,7 @@ class TransportTestPeer : public sigslot::has_slots<> {
     local_addr_.sconn_len = sizeof(struct sockaddr_conn);
 #endif
     local_addr_.sconn_port = htons(local_port);
-    local_addr_.sconn_addr = static_cast(this);
+    local_addr_.sconn_addr = static_cast(this);
 
     memset(&remote_addr_, 0, sizeof(remote_addr_));
     remote_addr_.sconn_family = AF_CONN;
@@ -111,7 +111,7 @@ class TransportTestPeer : public sigslot::has_slots<> {
     remote_addr_.sconn_len = sizeof(struct sockaddr_conn);
 #endif
     remote_addr_.sconn_port = htons(remote_port);
-    remote_addr_.sconn_addr = static_cast(this);
+    remote_addr_.sconn_addr = static_cast(this);
 
     nsresult res;
     res = loopback_->Init();
@@ -120,9 +120,9 @@ class TransportTestPeer : public sigslot::has_slots<> {
 
   ~TransportTestPeer() {
     std::cerr << "Destroying sctp connection flow="
-              << static_cast(flow_.get()) << std::endl;
+              << static_cast(flow_.get()) << std::endl;
     usrsctp_close(sctp_);
-    usrsctp_deregister_address(static_cast(this));
+    usrsctp_deregister_address(static_cast(this));
 
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &TransportTestPeer::Disconnect_s), NS_DISPATCH_SYNC);
@@ -130,13 +130,13 @@ class TransportTestPeer : public sigslot::has_slots<> {
     std::cerr << "~TransportTestPeer() completed" << std::endl;
   }
 
-  void ConnectSocket(TransportTestPeer *peer) {
+  void ConnectSocket(TransportTestPeer* peer) {
     test_utils_->sts_target()->Dispatch(
         WrapRunnable(this, &TransportTestPeer::ConnectSocket_s, peer),
         NS_DISPATCH_SYNC);
   }
 
-  void ConnectSocket_s(TransportTestPeer *peer) {
+  void ConnectSocket_s(TransportTestPeer* peer) {
     loopback_->Connect(peer->loopback_);
     ASSERT_EQ((nsresult)NS_OK, loopback_->Init());
     flow_->PushLayer(loopback_);
@@ -148,13 +148,13 @@ class TransportTestPeer : public sigslot::has_slots<> {
     ASSERT_TRUE(sctp_);
     std::cerr << "Calling usrsctp_bind()" << std::endl;
     int r =
-        usrsctp_bind(sctp_, reinterpret_cast(&local_addr_),
+        usrsctp_bind(sctp_, reinterpret_cast(&local_addr_),
                      sizeof(local_addr_));
     ASSERT_GE(0, r);
 
     std::cerr << "Calling usrsctp_connect()" << std::endl;
     r = usrsctp_connect(sctp_,
-                        reinterpret_cast(&remote_addr_),
+                        reinterpret_cast(&remote_addr_),
                         sizeof(remote_addr_));
     ASSERT_GE(0, r);
   }
@@ -186,7 +186,7 @@ class TransportTestPeer : public sigslot::has_slots<> {
     info.snd_assoc_id = 0;
 
     int r = usrsctp_sendv(sctp_, buf, sizeof(buf), nullptr, 0,
-                          static_cast(&info), sizeof(info),
+                          static_cast(&info), sizeof(info),
                           SCTP_SENDV_SNDINFO, 0);
     ASSERT_TRUE(r >= 0);
     ASSERT_EQ(sizeof(buf), (size_t)r);
@@ -199,12 +199,12 @@ class TransportTestPeer : public sigslot::has_slots<> {
   bool connected() const { return connected_; }
 
   static TransportResult SendPacket_s(nsAutoPtr packet,
-                                      const RefPtr &flow,
-                                      TransportLayer *layer) {
+                                      const RefPtr& flow,
+                                      TransportLayer* layer) {
     return layer->SendPacket(*packet);
   }
 
-  TransportResult SendPacket(const unsigned char *data, size_t len) {
+  TransportResult SendPacket(const unsigned char* data, size_t len) {
     nsAutoPtr packet(new MediaPacket);
     packet->Copy(data, len);
 
@@ -222,21 +222,20 @@ class TransportTestPeer : public sigslot::has_slots<> {
     return 0;
   }
 
-  void PacketReceived(TransportLayer *layer, MediaPacket &packet) {
+  void PacketReceived(TransportLayer* layer, MediaPacket& packet) {
     std::cerr << "Received " << packet.len() << " bytes" << std::endl;
 
     // Pass the data to SCTP
 
-    usrsctp_conninput(static_cast(this), packet.data(), packet.len(),
-                      0);
+    usrsctp_conninput(static_cast(this), packet.data(), packet.len(), 0);
   }
 
   // Process SCTP notification
-  void Notification(union sctp_notification *msg, size_t len) {
+  void Notification(union sctp_notification* msg, size_t len) {
     ASSERT_EQ(msg->sn_header.sn_length, len);
 
     if (msg->sn_header.sn_type == SCTP_ASSOC_CHANGE) {
-      struct sctp_assoc_change *change = &msg->sn_assoc_change;
+      struct sctp_assoc_change* change = &msg->sn_assoc_change;
 
       if (change->sac_state == SCTP_COMM_UP) {
         std::cerr << "Connection up" << std::endl;
@@ -250,25 +249,25 @@ class TransportTestPeer : public sigslot::has_slots<> {
 
   void SetConnected(bool state) { connected_ = state; }
 
-  static int conn_output(void *addr, void *buffer, size_t length, uint8_t tos,
+  static int conn_output(void* addr, void* buffer, size_t length, uint8_t tos,
                          uint8_t set_df) {
-    TransportTestPeer *peer = static_cast(addr);
+    TransportTestPeer* peer = static_cast(addr);
 
-    peer->SendPacket(static_cast(buffer), length);
+    peer->SendPacket(static_cast(buffer), length);
 
     return 0;
   }
 
-  static int receive_cb(struct socket *sock, union sctp_sockstore addr,
-                        void *data, size_t datalen, struct sctp_rcvinfo rcv,
-                        int flags, void *ulp_info) {
-    TransportTestPeer *me =
-        static_cast(addr.sconn.sconn_addr);
+  static int receive_cb(struct socket* sock, union sctp_sockstore addr,
+                        void* data, size_t datalen, struct sctp_rcvinfo rcv,
+                        int flags, void* ulp_info) {
+    TransportTestPeer* me =
+        static_cast(addr.sconn.sconn_addr);
     MOZ_ASSERT(me);
 
     if (flags & MSG_NOTIFICATION) {
-      union sctp_notification *notif =
-          static_cast(data);
+      union sctp_notification* notif =
+          static_cast(data);
 
       me->Notification(notif, datalen);
       return 0;
@@ -290,18 +289,18 @@ class TransportTestPeer : public sigslot::has_slots<> {
   size_t received_;
   // Owns the TransportLayerLoopback, but basically does nothing else.
   RefPtr flow_;
-  TransportLayerLoopback *loopback_;
+  TransportLayerLoopback* loopback_;
 
   struct sockaddr_conn local_addr_;
   struct sockaddr_conn remote_addr_;
-  struct socket *sctp_;
+  struct socket* sctp_;
   nsCOMPtr timer_;
   RefPtr periodic_;
-  MtransportTestUtils *test_utils_;
+  MtransportTestUtils* test_utils_;
 };
 
 // Implemented here because it calls a method of TransportTestPeer
-NS_IMETHODIMP SendPeriodic::Notify(nsITimer *timer) {
+NS_IMETHODIMP SendPeriodic::Notify(nsITimer* timer) {
   peer_->SendOne();
   --to_send_;
   if (!to_send_) {
@@ -316,7 +315,7 @@ class SctpTransportTest : public MtransportTest {
 
   ~SctpTransportTest() {}
 
-  static void debug_printf(const char *format, ...) {
+  static void debug_printf(const char* format, ...) {
     va_list ap;
 
     va_start(ap, format);
@@ -364,8 +363,8 @@ class SctpTransportTest : public MtransportTest {
   }
 
  protected:
-  TransportTestPeer *p1_;
-  TransportTestPeer *p2_;
+  TransportTestPeer* p1_;
+  TransportTestPeer* p2_;
 };
 
 TEST_F(SctpTransportTest, TestConnect) { ConnectSocket(); }
diff --git a/media/mtransport/test/sockettransportservice_unittest.cpp b/media/mtransport/test/sockettransportservice_unittest.cpp
index 46be3d90d4390..b5b352a000d2a 100644
--- a/media/mtransport/test/sockettransportservice_unittest.cpp
+++ b/media/mtransport/test/sockettransportservice_unittest.cpp
@@ -59,15 +59,15 @@ class SocketTransportServiceTest : public MtransportTest {
   nsCOMPtr stservice_;
   nsCOMPtr target_;
   size_t received_;
-  PRFileDesc *readpipe_;
-  PRFileDesc *writepipe_;
+  PRFileDesc* readpipe_;
+  PRFileDesc* writepipe_;
   bool registered_;
 };
 
 // Received an event.
 class EventReceived : public Runnable {
  public:
-  explicit EventReceived(SocketTransportServiceTest *test)
+  explicit EventReceived(SocketTransportServiceTest* test)
       : Runnable("EventReceived"), test_(test) {}
 
   NS_IMETHOD Run() override {
@@ -75,13 +75,13 @@ class EventReceived : public Runnable {
     return NS_OK;
   }
 
-  SocketTransportServiceTest *test_;
+  SocketTransportServiceTest* test_;
 };
 
 // Register our listener on the socket
 class RegisterEvent : public Runnable {
  public:
-  explicit RegisterEvent(SocketTransportServiceTest *test)
+  explicit RegisterEvent(SocketTransportServiceTest* test)
       : Runnable("RegisterEvent"), test_(test) {}
 
   NS_IMETHOD Run() override {
@@ -89,14 +89,14 @@ class RegisterEvent : public Runnable {
     return NS_OK;
   }
 
-  SocketTransportServiceTest *test_;
+  SocketTransportServiceTest* test_;
 };
 
 class SocketHandler : public nsASocketHandler {
  public:
-  explicit SocketHandler(SocketTransportServiceTest *test) : test_(test) {}
+  explicit SocketHandler(SocketTransportServiceTest* test) : test_(test) {}
 
-  void OnSocketReady(PRFileDesc *fd, int16_t outflags) override {
+  void OnSocketReady(PRFileDesc* fd, int16_t outflags) override {
     unsigned char buf[1600];
 
     int32_t rv;
@@ -107,9 +107,9 @@ class SocketHandler : public nsASocketHandler {
     }
   }
 
-  void OnSocketDetached(PRFileDesc *fd) override {}
+  void OnSocketDetached(PRFileDesc* fd) override {}
 
-  void IsLocal(bool *aIsLocal) override {
+  void IsLocal(bool* aIsLocal) override {
     // TODO(jesup): better check? Does it matter? (likely no)
     *aIsLocal = false;
   }
@@ -123,7 +123,7 @@ class SocketHandler : public nsASocketHandler {
   virtual ~SocketHandler() {}
 
  private:
-  SocketTransportServiceTest *test_;
+  SocketTransportServiceTest* test_;
 };
 
 NS_IMPL_ISUPPORTS0(SocketHandler)
diff --git a/media/mtransport/test/stunserver.cpp b/media/mtransport/test/stunserver.cpp
index 841fe912b4635..f020b1c0bf1a4 100644
--- a/media/mtransport/test/stunserver.cpp
+++ b/media/mtransport/test/stunserver.cpp
@@ -112,14 +112,14 @@ namespace mozilla {
 // Wrapper nr_socket which allows us to lie to the stun server about the
 // IP address.
 struct nr_socket_wrapped {
-  nr_socket *sock_;
+  nr_socket* sock_;
   nr_transport_addr addr_;
 };
 
-static int nr_socket_wrapped_destroy(void **objp) {
+static int nr_socket_wrapped_destroy(void** objp) {
   if (!objp || !*objp) return 0;
 
-  nr_socket_wrapped *wrapped = static_cast(*objp);
+  nr_socket_wrapped* wrapped = static_cast(*objp);
   *objp = nullptr;
 
   delete wrapped;
@@ -127,38 +127,38 @@ static int nr_socket_wrapped_destroy(void **objp) {
   return 0;
 }
 
-static int nr_socket_wrapped_sendto(void *obj, const void *msg, size_t len,
-                                    int flags, nr_transport_addr *addr) {
-  nr_socket_wrapped *wrapped = static_cast(obj);
+static int nr_socket_wrapped_sendto(void* obj, const void* msg, size_t len,
+                                    int flags, nr_transport_addr* addr) {
+  nr_socket_wrapped* wrapped = static_cast(obj);
 
   return nr_socket_sendto(wrapped->sock_, msg, len, flags, &wrapped->addr_);
 }
 
-static int nr_socket_wrapped_recvfrom(void *obj, void *restrict buf,
-                                      size_t maxlen, size_t *len, int flags,
-                                      nr_transport_addr *addr) {
-  nr_socket_wrapped *wrapped = static_cast(obj);
+static int nr_socket_wrapped_recvfrom(void* obj, void* restrict buf,
+                                      size_t maxlen, size_t* len, int flags,
+                                      nr_transport_addr* addr) {
+  nr_socket_wrapped* wrapped = static_cast(obj);
 
   return nr_socket_recvfrom(wrapped->sock_, buf, maxlen, len, flags, addr);
 }
 
-static int nr_socket_wrapped_getfd(void *obj, NR_SOCKET *fd) {
-  nr_socket_wrapped *wrapped = static_cast(obj);
+static int nr_socket_wrapped_getfd(void* obj, NR_SOCKET* fd) {
+  nr_socket_wrapped* wrapped = static_cast(obj);
 
   return nr_socket_getfd(wrapped->sock_, fd);
 }
 
-static int nr_socket_wrapped_getaddr(void *obj, nr_transport_addr *addrp) {
-  nr_socket_wrapped *wrapped = static_cast(obj);
+static int nr_socket_wrapped_getaddr(void* obj, nr_transport_addr* addrp) {
+  nr_socket_wrapped* wrapped = static_cast(obj);
 
   return nr_socket_getaddr(wrapped->sock_, addrp);
 }
 
-static int nr_socket_wrapped_close(void *obj) { MOZ_CRASH(); }
+static int nr_socket_wrapped_close(void* obj) { MOZ_CRASH(); }
 
-static int nr_socket_wrapped_set_send_addr(nr_socket *sock,
-                                           nr_transport_addr *addr) {
-  nr_socket_wrapped *wrapped = static_cast(sock->obj);
+static int nr_socket_wrapped_set_send_addr(nr_socket* sock,
+                                           nr_transport_addr* addr) {
+  nr_socket_wrapped* wrapped = static_cast(sock->obj);
 
   return nr_transport_addr_copy(&wrapped->addr_, addr);
 }
@@ -176,7 +176,7 @@ static nr_socket_vtbl nr_socket_wrapped_vtbl = {2,
                                                 nullptr,
                                                 nullptr};
 
-int nr_socket_wrapped_create(nr_socket *inner, nr_socket **outp) {
+int nr_socket_wrapped_create(nr_socket* inner, nr_socket** outp) {
   auto wrapped = MakeUnique();
 
   wrapped->sock_ = inner;
@@ -191,10 +191,10 @@ int nr_socket_wrapped_create(nr_socket *inner, nr_socket **outp) {
 // Instance static.
 // Note: Calling Create() at static init time is not going to be safe, since
 // we have no reason to expect this will be initted to a nullptr yet.
-TestStunServer *TestStunServer::instance;
-TestStunTcpServer *TestStunTcpServer::instance;
-TestStunServer *TestStunServer::instance6;
-TestStunTcpServer *TestStunTcpServer::instance6;
+TestStunServer* TestStunServer::instance;
+TestStunTcpServer* TestStunTcpServer::instance;
+TestStunServer* TestStunServer::instance6;
+TestStunTcpServer* TestStunTcpServer::instance6;
 uint16_t TestStunServer::instance_port = 3478;
 uint16_t TestStunTcpServer::instance_port = 3478;
 
@@ -220,7 +220,7 @@ TestStunServer::~TestStunServer() {
   delete response_addr_;
 }
 
-int TestStunServer::SetInternalPort(nr_local_addr *addr, uint16_t port) {
+int TestStunServer::SetInternalPort(nr_local_addr* addr, uint16_t port) {
   if (nr_transport_addr_set_port(&addr->addr, port)) {
     MOZ_MTLOG(ML_ERROR, "Couldn't set port");
     return R_INTERNAL;
@@ -234,7 +234,7 @@ int TestStunServer::SetInternalPort(nr_local_addr *addr, uint16_t port) {
   return 0;
 }
 
-int TestStunServer::TryOpenListenSocket(nr_local_addr *addr, uint16_t port) {
+int TestStunServer::TryOpenListenSocket(nr_local_addr* addr, uint16_t port) {
   int r = SetInternalPort(addr, port);
 
   if (r) return r;
@@ -305,7 +305,7 @@ int TestStunServer::Initialize(int address_family) {
     return R_INTERNAL;
   }
 
-  r = nr_stun_server_ctx_create(const_cast("Test STUN server"),
+  r = nr_stun_server_ctx_create(const_cast("Test STUN server"),
                                 send_sock_, &stun_server_);
   if (r) {
     MOZ_MTLOG(ML_ERROR, "Couldn't create STUN server");
@@ -350,7 +350,7 @@ UniquePtr TestStunServer::Create(int address_family) {
 
 void TestStunServer::ConfigurePort(uint16_t port) { instance_port = port; }
 
-TestStunServer *TestStunServer::GetInstance(int address_family) {
+TestStunServer* TestStunServer::GetInstance(int address_family) {
   switch (address_family) {
     case AF_INET:
       if (!instance) instance = Create(address_family).release();
@@ -374,21 +374,21 @@ void TestStunServer::ShutdownInstance() {
 }
 
 struct DeferredStunOperation {
-  DeferredStunOperation(TestStunServer *server, const char *data, size_t len,
-                        nr_transport_addr *addr, nr_socket *sock)
+  DeferredStunOperation(TestStunServer* server, const char* data, size_t len,
+                        nr_transport_addr* addr, nr_socket* sock)
       : server_(server), buffer_(), sock_(sock) {
-    buffer_.Copy(reinterpret_cast(data), len);
+    buffer_.Copy(reinterpret_cast(data), len);
     nr_transport_addr_copy(&addr_, addr);
   }
 
-  TestStunServer *server_;
+  TestStunServer* server_;
   MediaPacket buffer_;
   nr_transport_addr addr_;
-  nr_socket *sock_;
+  nr_socket* sock_;
 };
 
-void TestStunServer::Process(const uint8_t *msg, size_t len,
-                             nr_transport_addr *addr, nr_socket *sock) {
+void TestStunServer::Process(const uint8_t* msg, size_t len,
+                             nr_transport_addr* addr, nr_socket* sock) {
   if (!sock) {
     sock = send_sock_;
   }
@@ -397,13 +397,12 @@ void TestStunServer::Process(const uint8_t *msg, size_t len,
   nr_socket_wrapped_set_send_addr(sock, addr);
 
   nr_stun_server_process_request(
-      stun_server_, sock,
-      const_cast(reinterpret_cast(msg)), len,
-      response_addr_ ? response_addr_ : addr, NR_STUN_AUTH_RULE_OPTIONAL);
+      stun_server_, sock, const_cast(reinterpret_cast(msg)),
+      len, response_addr_ ? response_addr_ : addr, NR_STUN_AUTH_RULE_OPTIONAL);
 }
 
-void TestStunServer::process_cb(NR_SOCKET s, int how, void *cb_arg) {
-  DeferredStunOperation *op = static_cast(cb_arg);
+void TestStunServer::process_cb(NR_SOCKET s, int how, void* cb_arg) {
+  DeferredStunOperation* op = static_cast(cb_arg);
   op->server_->timer_handle_ = nullptr;
   op->server_->Process(op->buffer_.data(), op->buffer_.len(), &op->addr_,
                        op->sock_);
@@ -411,26 +410,26 @@ void TestStunServer::process_cb(NR_SOCKET s, int how, void *cb_arg) {
   delete op;
 }
 
-nr_socket *TestStunServer::GetReceivingSocket(NR_SOCKET s) {
+nr_socket* TestStunServer::GetReceivingSocket(NR_SOCKET s) {
   return listen_sock_;
 }
 
-nr_socket *TestStunServer::GetSendingSocket(nr_socket *sock) {
+nr_socket* TestStunServer::GetSendingSocket(nr_socket* sock) {
   return send_sock_;
 }
 
-void TestStunServer::readable_cb(NR_SOCKET s, int how, void *cb_arg) {
-  TestStunServer *server = static_cast(cb_arg);
+void TestStunServer::readable_cb(NR_SOCKET s, int how, void* cb_arg) {
+  TestStunServer* server = static_cast(cb_arg);
 
   char message[max_stun_message_size];
   size_t message_len;
   nr_transport_addr addr;
-  nr_socket *recv_sock = server->GetReceivingSocket(s);
+  nr_socket* recv_sock = server->GetReceivingSocket(s);
   if (!recv_sock) {
     MOZ_MTLOG(ML_ERROR, "Failed to lookup receiving socket");
     return;
   }
-  nr_socket *send_sock = server->GetSendingSocket(recv_sock);
+  nr_socket* send_sock = server->GetSendingSocket(recv_sock);
 
   /* Re-arm. */
   NR_ASYNC_WAIT(s, NR_ASYNC_WAIT_READ, &TestStunServer::readable_cb, server);
@@ -464,7 +463,7 @@ void TestStunServer::readable_cb(NR_SOCKET s, int how, void *cb_arg) {
                                                  &addr, send_sock),
                        &server->timer_handle_);
   } else {
-    server->Process(reinterpret_cast(message), message_len,
+    server->Process(reinterpret_cast(message), message_len,
                     &addr, send_sock);
   }
 }
@@ -477,7 +476,7 @@ void TestStunServer::SetDropInitialPackets(uint32_t count) {
   initial_ct_ = count;
 }
 
-nsresult TestStunServer::SetResponseAddr(nr_transport_addr *addr) {
+nsresult TestStunServer::SetResponseAddr(nr_transport_addr* addr) {
   delete response_addr_;
 
   response_addr_ = new nr_transport_addr();
@@ -488,7 +487,7 @@ nsresult TestStunServer::SetResponseAddr(nr_transport_addr *addr) {
   return NS_OK;
 }
 
-nsresult TestStunServer::SetResponseAddr(const std::string &addr,
+nsresult TestStunServer::SetResponseAddr(const std::string& addr,
                                          uint16_t port) {
   nr_transport_addr addr2;
 
@@ -514,7 +513,7 @@ void TestStunServer::Reset() {
 
 void TestStunTcpServer::ConfigurePort(uint16_t port) { instance_port = port; }
 
-TestStunTcpServer *TestStunTcpServer::GetInstance(int address_family) {
+TestStunTcpServer* TestStunTcpServer::GetInstance(int address_family) {
   switch (address_family) {
     case AF_INET:
       if (!instance) instance = Create(address_family).release();
@@ -537,14 +536,14 @@ void TestStunTcpServer::ShutdownInstance() {
   instance6 = nullptr;
 }
 
-int TestStunTcpServer::TryOpenListenSocket(nr_local_addr *addr, uint16_t port) {
+int TestStunTcpServer::TryOpenListenSocket(nr_local_addr* addr, uint16_t port) {
   addr->addr.protocol = IPPROTO_TCP;
 
   int r = SetInternalPort(addr, port);
 
   if (r) return r;
 
-  nr_socket *sock;
+  nr_socket* sock;
   if (nr_socket_local_create(nullptr, &addr->addr, &sock)) {
     MOZ_MTLOG(ML_ERROR, "Couldn't create listen tcp socket");
     return R_ALREADY;
@@ -564,14 +563,14 @@ int TestStunTcpServer::TryOpenListenSocket(nr_local_addr *addr, uint16_t port) {
   return 0;
 }
 
-nr_socket *TestStunTcpServer::GetReceivingSocket(NR_SOCKET s) {
+nr_socket* TestStunTcpServer::GetReceivingSocket(NR_SOCKET s) {
   return connections_[s];
 }
 
-nr_socket *TestStunTcpServer::GetSendingSocket(nr_socket *sock) { return sock; }
+nr_socket* TestStunTcpServer::GetSendingSocket(nr_socket* sock) { return sock; }
 
-void TestStunTcpServer::accept_cb(NR_SOCKET s, int how, void *cb_arg) {
-  TestStunTcpServer *server = static_cast(cb_arg);
+void TestStunTcpServer::accept_cb(NR_SOCKET s, int how, void* cb_arg) {
+  TestStunTcpServer* server = static_cast(cb_arg);
   nr_socket *newsock, *bufsock, *wrapsock;
   nr_transport_addr remote_addr;
   NR_SOCKET fd;
diff --git a/media/mtransport/test/stunserver.h b/media/mtransport/test/stunserver.h
index bf4cc07d3c0d3..9db3d7410b6b7 100644
--- a/media/mtransport/test/stunserver.h
+++ b/media/mtransport/test/stunserver.h
@@ -25,7 +25,7 @@ class TestStunServer {
  public:
   // Generally, you should only call API in this class from the same thread that
   // the initial |GetInstance| call was made from.
-  static TestStunServer *GetInstance(int address_family = AF_INET);
+  static TestStunServer* GetInstance(int address_family = AF_INET);
   static void ShutdownInstance();
   // |ConfigurePort| will only have an effect if called before the first call
   // to |GetInstance| (possibly following a |ShutdownInstance| call)
@@ -38,20 +38,20 @@ class TestStunServer {
   void SetActive(bool active);
   void SetDelay(uint32_t delay_ms);
   void SetDropInitialPackets(uint32_t count);
-  const std::string &addr() const { return listen_addr_; }
+  const std::string& addr() const { return listen_addr_; }
   uint16_t port() const { return listen_port_; }
 
   // These should only be called from the same thread as the initial
   // |GetInstance| call.
-  nsresult SetResponseAddr(nr_transport_addr *addr);
-  nsresult SetResponseAddr(const std::string &addr, uint16_t port);
+  nsresult SetResponseAddr(nr_transport_addr* addr);
+  nsresult SetResponseAddr(const std::string& addr, uint16_t port);
 
   void Reset();
 
   static const size_t max_stun_message_size = 4096;
 
-  virtual nr_socket *GetReceivingSocket(NR_SOCKET s);
-  virtual nr_socket *GetSendingSocket(nr_socket *sock);
+  virtual nr_socket* GetReceivingSocket(NR_SOCKET s);
+  virtual nr_socket* GetSendingSocket(nr_socket* sock);
 
  protected:
   TestStunServer()
@@ -65,60 +65,60 @@ class TestStunServer {
         response_addr_(nullptr),
         timer_handle_(nullptr) {}
 
-  int SetInternalPort(nr_local_addr *addr, uint16_t port);
+  int SetInternalPort(nr_local_addr* addr, uint16_t port);
   int Initialize(int address_family);
 
-  static void readable_cb(NR_SOCKET sock, int how, void *cb_arg);
+  static void readable_cb(NR_SOCKET sock, int how, void* cb_arg);
 
  private:
-  void Process(const uint8_t *msg, size_t len, nr_transport_addr *addr_in,
-               nr_socket *sock);
-  virtual int TryOpenListenSocket(nr_local_addr *addr, uint16_t port);
-  static void process_cb(NR_SOCKET sock, int how, void *cb_arg);
+  void Process(const uint8_t* msg, size_t len, nr_transport_addr* addr_in,
+               nr_socket* sock);
+  virtual int TryOpenListenSocket(nr_local_addr* addr, uint16_t port);
+  static void process_cb(NR_SOCKET sock, int how, void* cb_arg);
 
  protected:
   std::string listen_addr_;
   uint16_t listen_port_;
-  nr_socket *listen_sock_;
-  nr_socket *send_sock_;
-  nr_stun_server_ctx *stun_server_;
+  nr_socket* listen_sock_;
+  nr_socket* send_sock_;
+  nr_stun_server_ctx* stun_server_;
 
  private:
   bool active_;
   uint32_t delay_ms_;
   uint32_t initial_ct_;
-  nr_transport_addr *response_addr_;
-  void *timer_handle_;
+  nr_transport_addr* response_addr_;
+  void* timer_handle_;
   std::map received_ct_;
 
-  static TestStunServer *instance;
-  static TestStunServer *instance6;
+  static TestStunServer* instance;
+  static TestStunServer* instance6;
   static uint16_t instance_port;
 };
 
 class TestStunTcpServer : public TestStunServer {
  public:
-  static TestStunTcpServer *GetInstance(int address_family);
+  static TestStunTcpServer* GetInstance(int address_family);
   static void ShutdownInstance();
   static void ConfigurePort(uint16_t port);
   virtual ~TestStunTcpServer();
 
-  virtual nr_socket *GetReceivingSocket(NR_SOCKET s);
-  virtual nr_socket *GetSendingSocket(nr_socket *sock);
+  virtual nr_socket* GetReceivingSocket(NR_SOCKET s);
+  virtual nr_socket* GetSendingSocket(nr_socket* sock);
 
  protected:
   TestStunTcpServer() {}
-  static void accept_cb(NR_SOCKET sock, int how, void *cb_arg);
+  static void accept_cb(NR_SOCKET sock, int how, void* cb_arg);
 
  private:
-  virtual int TryOpenListenSocket(nr_local_addr *addr, uint16_t port);
+  virtual int TryOpenListenSocket(nr_local_addr* addr, uint16_t port);
   static UniquePtr Create(int address_family);
 
-  static TestStunTcpServer *instance;
-  static TestStunTcpServer *instance6;
+  static TestStunTcpServer* instance;
+  static TestStunTcpServer* instance6;
   static uint16_t instance_port;
 
-  std::map connections_;
+  std::map connections_;
 };
 }  // End of namespace mozilla
 #endif
diff --git a/media/mtransport/test/test_nr_socket_ice_unittest.cpp b/media/mtransport/test/test_nr_socket_ice_unittest.cpp
index d11d57b270888..b9036368da9b4 100644
--- a/media/mtransport/test/test_nr_socket_ice_unittest.cpp
+++ b/media/mtransport/test/test_nr_socket_ice_unittest.cpp
@@ -61,8 +61,8 @@ static unsigned int kDefaultTimeout = 7000;
 
 class IcePeer {
  public:
-  IcePeer(const char *name, TestNat *nat, UINT4 flags,
-          MtransportTestUtils *test_utils)
+  IcePeer(const char* name, TestNat* nat, UINT4 flags,
+          MtransportTestUtils* test_utils)
       : name_(name),
         ice_checking_(false),
         ice_connected_(false),
@@ -74,10 +74,10 @@ class IcePeer {
         peer_ctx_(nullptr),
         nat_(nat),
         test_utils_(test_utils) {
-    nr_ice_ctx_create(const_cast(name_.c_str()), flags, &ice_ctx_);
+    nr_ice_ctx_create(const_cast(name_.c_str()), flags, &ice_ctx_);
 
     if (nat_) {
-      nr_socket_factory *factory;
+      nr_socket_factory* factory;
       nat_->create_socket_factory(&factory);
       nr_ice_ctx_set_socket_factory(ice_ctx_, factory);
     }
@@ -97,10 +97,10 @@ class IcePeer {
     ice_handler_->obj = this;
 
     nr_ice_peer_ctx_create(ice_ctx_, ice_handler_,
-                           const_cast(name_.c_str()), &peer_ctx_);
+                           const_cast(name_.c_str()), &peer_ctx_);
 
-    nr_ice_add_media_stream(ice_ctx_, const_cast(name_.c_str()),
-                            "ufrag", "pass", 2, &ice_media_stream_);
+    nr_ice_add_media_stream(ice_ctx_, const_cast(name_.c_str()), "ufrag",
+                            "pass", 2, &ice_media_stream_);
     EXPECT_EQ(2UL, GetStreamAttributes().size());
 
     nr_ice_media_stream_initialize(ice_ctx_, ice_media_stream_);
@@ -140,7 +140,7 @@ class IcePeer {
   }
 
   std::vector GetStreamAttributes_s() {
-    char **attrs = nullptr;
+    char** attrs = nullptr;
     int attrct;
     std::vector ret;
 
@@ -166,7 +166,7 @@ class IcePeer {
   }
 
   std::vector GetGlobalAttributes_s() {
-    char **attrs = nullptr;
+    char** attrs = nullptr;
     int attrct;
     std::vector ret;
 
@@ -182,10 +182,10 @@ class IcePeer {
   }
 
   void ParseGlobalAttributes(std::vector attrs) {
-    std::vector attrs_in;
+    std::vector attrs_in;
     attrs_in.reserve(attrs.size());
-    for (auto &attr : attrs) {
-      attrs_in.push_back(const_cast(attr.c_str()));
+    for (auto& attr : attrs) {
+      attrs_in.push_back(const_cast(attr.c_str()));
     }
 
     int r = nr_ice_peer_ctx_parse_global_attributes(
@@ -206,10 +206,10 @@ class IcePeer {
   void SetRemoteAttributes_s(std::vector attributes) {
     int r;
 
-    std::vector attrs;
+    std::vector attrs;
     attrs.reserve(attributes.size());
-    for (auto &attr : attributes) {
-      attrs.push_back(const_cast(attr.c_str()));
+    for (auto& attr : attributes) {
+      attrs.push_back(const_cast(attr.c_str()));
     }
 
     if (!attrs.empty()) {
@@ -233,50 +233,50 @@ class IcePeer {
   }
 
   // Handler callbacks
-  static int select_pair(void *obj, nr_ice_media_stream *stream,
-                         int component_id, nr_ice_cand_pair **potentials,
+  static int select_pair(void* obj, nr_ice_media_stream* stream,
+                         int component_id, nr_ice_cand_pair** potentials,
                          int potential_ct) {
     return 0;
   }
 
-  static int stream_ready(void *obj, nr_ice_media_stream *stream) {
-    IcePeer *peer = static_cast(obj);
+  static int stream_ready(void* obj, nr_ice_media_stream* stream) {
+    IcePeer* peer = static_cast(obj);
     peer->stream_ready_ = true;
     return 0;
   }
 
-  static int stream_failed(void *obj, nr_ice_media_stream *stream) {
-    IcePeer *peer = static_cast(obj);
+  static int stream_failed(void* obj, nr_ice_media_stream* stream) {
+    IcePeer* peer = static_cast(obj);
     peer->stream_failed_ = true;
     return 0;
   }
 
-  static int ice_checking(void *obj, nr_ice_peer_ctx *pctx) {
-    IcePeer *peer = static_cast(obj);
+  static int ice_checking(void* obj, nr_ice_peer_ctx* pctx) {
+    IcePeer* peer = static_cast(obj);
     peer->ice_checking_ = true;
     return 0;
   }
 
-  static int ice_connected(void *obj, nr_ice_peer_ctx *pctx) {
-    IcePeer *peer = static_cast(obj);
+  static int ice_connected(void* obj, nr_ice_peer_ctx* pctx) {
+    IcePeer* peer = static_cast(obj);
     peer->ice_connected_ = true;
     return 0;
   }
 
-  static int ice_disconnected(void *obj, nr_ice_peer_ctx *pctx) {
-    IcePeer *peer = static_cast(obj);
+  static int ice_disconnected(void* obj, nr_ice_peer_ctx* pctx) {
+    IcePeer* peer = static_cast(obj);
     peer->ice_disconnected_ = true;
     return 0;
   }
 
-  static int msg_recvd(void *obj, nr_ice_peer_ctx *pctx,
-                       nr_ice_media_stream *stream, int component_id,
-                       UCHAR *msg, int len) {
+  static int msg_recvd(void* obj, nr_ice_peer_ctx* pctx,
+                       nr_ice_media_stream* stream, int component_id,
+                       UCHAR* msg, int len) {
     return 0;
   }
 
-  static void gather_cb(NR_SOCKET s, int h, void *arg) {
-    IcePeer *peer = static_cast(arg);
+  static void gather_cb(NR_SOCKET s, int h, void* arg) {
+    IcePeer* peer = static_cast(arg);
     peer->gather_cb_ = true;
   }
 
@@ -289,13 +289,13 @@ class IcePeer {
   bool stream_ready_;
   bool stream_failed_;
 
-  nr_ice_ctx *ice_ctx_;
-  nr_ice_handler *ice_handler_;
-  nr_ice_handler_vtbl *ice_handler_vtbl_;
-  nr_ice_media_stream *ice_media_stream_;
-  nr_ice_peer_ctx *peer_ctx_;
-  TestNat *nat_;
-  MtransportTestUtils *test_utils_;
+  nr_ice_ctx* ice_ctx_;
+  nr_ice_handler* ice_handler_;
+  nr_ice_handler_vtbl* ice_handler_vtbl_;
+  nr_ice_media_stream* ice_media_stream_;
+  nr_ice_peer_ctx* peer_ctx_;
+  TestNat* nat_;
+  MtransportTestUtils* test_utils_;
 };
 
 class TestNrSocketIceUnitTest : public ::testing::Test {
@@ -315,8 +315,8 @@ class TestNrSocketIceUnitTest : public ::testing::Test {
     delete test_utils2_;
   }
 
-  MtransportTestUtils *test_utils_;
-  MtransportTestUtils *test_utils2_;
+  MtransportTestUtils* test_utils_;
+  MtransportTestUtils* test_utils2_;
 };
 
 TEST_F(TestNrSocketIceUnitTest, TestIcePeer) {
@@ -367,12 +367,12 @@ TEST_F(TestNrSocketIceUnitTest, TestIcePeersPacketLoss) {
    public:
     NatDelegate() : messages(0) {}
 
-    int on_read(TestNat *nat, void *buf, size_t maxlen, size_t *len) override {
+    int on_read(TestNat* nat, void* buf, size_t maxlen, size_t* len) override {
       return 0;
     }
 
-    int on_sendto(TestNat *nat, const void *msg, size_t len, int flags,
-                  nr_transport_addr *to) override {
+    int on_sendto(TestNat* nat, const void* msg, size_t len, int flags,
+                  nr_transport_addr* to) override {
       ++messages;
       // 25% packet loss
       if (messages % 4 == 0) {
@@ -381,8 +381,8 @@ TEST_F(TestNrSocketIceUnitTest, TestIcePeersPacketLoss) {
       return 0;
     }
 
-    int on_write(TestNat *nat, const void *msg, size_t len,
-                 size_t *written) override {
+    int on_write(TestNat* nat, const void* msg, size_t len,
+                 size_t* written) override {
       return 0;
     }
 
diff --git a/media/mtransport/test/test_nr_socket_unittest.cpp b/media/mtransport/test/test_nr_socket_unittest.cpp
index bfe06bcd70a04..9a1d2720d0a1b 100644
--- a/media/mtransport/test/test_nr_socket_unittest.cpp
+++ b/media/mtransport/test/test_nr_socket_unittest.cpp
@@ -69,8 +69,8 @@ class TestNrSocketTest : public MtransportTest {
     sts_ = nullptr;
   }
 
-  RefPtr CreateTestNrSocket_s(const char *ip_str, int proto,
-                                            TestNat *nat) {
+  RefPtr CreateTestNrSocket_s(const char* ip_str, int proto,
+                                            TestNat* nat) {
     // If no nat is supplied, we create a default NAT which is disabled. This
     // is how we simulate a non-natted socket.
     RefPtr sock(new TestNrSocket(nat ? nat : new TestNat));
@@ -83,14 +83,14 @@ class TestNrSocketTest : public MtransportTest {
     return sock;
   }
 
-  void CreatePublicAddrs(size_t count, const char *ip_str = "127.0.0.1",
+  void CreatePublicAddrs(size_t count, const char* ip_str = "127.0.0.1",
                          int proto = IPPROTO_UDP) {
     sts_->Dispatch(WrapRunnable(this, &TestNrSocketTest::CreatePublicAddrs_s,
                                 count, ip_str, proto),
                    NS_DISPATCH_SYNC);
   }
 
-  void CreatePublicAddrs_s(size_t count, const char *ip_str, int proto) {
+  void CreatePublicAddrs_s(size_t count, const char* ip_str, int proto) {
     while (count--) {
       auto sock = CreateTestNrSocket_s(ip_str, proto, nullptr);
       ASSERT_TRUE(sock)
@@ -100,7 +100,7 @@ class TestNrSocketTest : public MtransportTest {
   }
 
   RefPtr CreatePrivateAddrs(size_t size,
-                                     const char *ip_str = "127.0.0.1",
+                                     const char* ip_str = "127.0.0.1",
                                      int proto = IPPROTO_UDP) {
     RefPtr result;
     sts_->Dispatch(
@@ -110,7 +110,7 @@ class TestNrSocketTest : public MtransportTest {
     return result;
   }
 
-  RefPtr CreatePrivateAddrs_s(size_t count, const char *ip_str,
+  RefPtr CreatePrivateAddrs_s(size_t count, const char* ip_str,
                                        int proto) {
     RefPtr nat(new TestNat);
     while (count--) {
@@ -127,8 +127,8 @@ class TestNrSocketTest : public MtransportTest {
   }
 
   bool CheckConnectivityVia(
-      TestNrSocket *from, TestNrSocket *to, const nr_transport_addr &via,
-      nr_transport_addr *sender_external_address = nullptr) {
+      TestNrSocket* from, TestNrSocket* to, const nr_transport_addr& via,
+      nr_transport_addr* sender_external_address = nullptr) {
     MOZ_ASSERT(from);
 
     if (!WaitForWriteable(from)) {
@@ -160,8 +160,8 @@ class TestNrSocketTest : public MtransportTest {
     return !result;
   }
 
-  bool CheckConnectivity(TestNrSocket *from, TestNrSocket *to,
-                         nr_transport_addr *sender_external_address = nullptr) {
+  bool CheckConnectivity(TestNrSocket* from, TestNrSocket* to,
+                         nr_transport_addr* sender_external_address = nullptr) {
     nr_transport_addr destination_address;
     int r = GetAddress(to, &destination_address);
     if (r) {
@@ -172,8 +172,8 @@ class TestNrSocketTest : public MtransportTest {
                                 sender_external_address);
   }
 
-  bool CheckTcpConnectivity(TestNrSocket *from, TestNrSocket *to) {
-    NrSocketBase *accepted_sock;
+  bool CheckTcpConnectivity(TestNrSocket* from, TestNrSocket* to) {
+    NrSocketBase* accepted_sock;
     if (!Connect(from, to, &accepted_sock)) {
       std::cerr << "Connect failed" << std::endl;
       return false;
@@ -236,7 +236,7 @@ class TestNrSocketTest : public MtransportTest {
     return true;
   }
 
-  int GetAddress(TestNrSocket *sock, nr_transport_addr_ *address) {
+  int GetAddress(TestNrSocket* sock, nr_transport_addr_* address) {
     MOZ_ASSERT(sock);
     MOZ_ASSERT(address);
     int r;
@@ -246,27 +246,27 @@ class TestNrSocketTest : public MtransportTest {
     return r;
   }
 
-  int GetAddress_s(TestNrSocket *sock, nr_transport_addr *address) {
+  int GetAddress_s(TestNrSocket* sock, nr_transport_addr* address) {
     return sock->getaddr(address);
   }
 
-  int SendData_s(TestNrSocket *from, const nr_transport_addr &to) {
+  int SendData_s(TestNrSocket* from, const nr_transport_addr& to) {
     // It is up to caller to ensure that |from| is writeable.
     const char buf[] = "foobajooba";
     return from->sendto(
         buf, sizeof(buf), 0,
         // TODO(bug 1170299): Remove const_cast when no longer necessary
-        const_cast(&to));
+        const_cast(&to));
   }
 
-  int SendDataTcp_s(NrSocketBase *from) {
+  int SendDataTcp_s(NrSocketBase* from) {
     // It is up to caller to ensure that |from| is writeable.
     const char buf[] = "foobajooba";
     size_t written;
     return from->write(buf, sizeof(buf), &written);
   }
 
-  int RecvData_s(TestNrSocket *to, nr_transport_addr *from) {
+  int RecvData_s(TestNrSocket* to, nr_transport_addr* from) {
     // It is up to caller to ensure that |to| is readable
     char buf[DATA_BUF_SIZE];
     size_t len;
@@ -278,7 +278,7 @@ class TestNrSocketTest : public MtransportTest {
     return r;
   }
 
-  int RecvDataTcp_s(NrSocketBase *to) {
+  int RecvDataTcp_s(NrSocketBase* to) {
     // It is up to caller to ensure that |to| is readable
     char buf[DATA_BUF_SIZE];
     size_t len;
@@ -290,7 +290,7 @@ class TestNrSocketTest : public MtransportTest {
     return r;
   }
 
-  int Listen_s(TestNrSocket *to) {
+  int Listen_s(TestNrSocket* to) {
     // listen on |to|
     int r = to->listen(1);
     if (r) {
@@ -299,7 +299,7 @@ class TestNrSocketTest : public MtransportTest {
     return 0;
   }
 
-  int Connect_s(TestNrSocket *from, TestNrSocket *to) {
+  int Connect_s(TestNrSocket* from, TestNrSocket* to) {
     // connect on |from|
     nr_transport_addr destination_address;
     int r = to->getaddr(&destination_address);
@@ -315,20 +315,20 @@ class TestNrSocketTest : public MtransportTest {
     return 0;
   }
 
-  int Accept_s(TestNrSocket *to, NrSocketBase **accepted_sock) {
-    nr_socket *sock;
+  int Accept_s(TestNrSocket* to, NrSocketBase** accepted_sock) {
+    nr_socket* sock;
     nr_transport_addr source_address;
     int r = to->accept(&source_address, &sock);
     if (r) {
       return r;
     }
 
-    *accepted_sock = reinterpret_cast(sock->obj);
+    *accepted_sock = reinterpret_cast(sock->obj);
     return 0;
   }
 
-  bool Connect(TestNrSocket *from, TestNrSocket *to,
-               NrSocketBase **accepted_sock) {
+  bool Connect(TestNrSocket* from, TestNrSocket* to,
+               NrSocketBase** accepted_sock) {
     int r;
     sts_->Dispatch(WrapRunnableRet(&r, this, &TestNrSocketTest::Listen_s, to),
                    NS_DISPATCH_SYNC);
@@ -361,7 +361,7 @@ class TestNrSocketTest : public MtransportTest {
     return true;
   }
 
-  bool WaitForSocketState(NrSocketBase *sock, int state) {
+  bool WaitForSocketState(NrSocketBase* sock, int state) {
     MOZ_ASSERT(sock);
     sts_->Dispatch(WrapRunnable(this, &TestNrSocketTest::WaitForSocketState_s,
                                 sock, state),
@@ -380,22 +380,22 @@ class TestNrSocketTest : public MtransportTest {
     return res;
   }
 
-  void WaitForSocketState_s(NrSocketBase *sock, int state) {
+  void WaitForSocketState_s(NrSocketBase* sock, int state) {
     NR_ASYNC_WAIT(sock, state, &WaitDone, this);
   }
 
-  void CancelWait_s(NrSocketBase *sock, int state) { sock->cancel(state); }
+  void CancelWait_s(NrSocketBase* sock, int state) { sock->cancel(state); }
 
-  bool WaitForReadable(NrSocketBase *sock) {
+  bool WaitForReadable(NrSocketBase* sock) {
     return WaitForSocketState(sock, NR_ASYNC_WAIT_READ);
   }
 
-  bool WaitForWriteable(NrSocketBase *sock) {
+  bool WaitForWriteable(NrSocketBase* sock) {
     return WaitForSocketState(sock, NR_ASYNC_WAIT_WRITE);
   }
 
-  static void WaitDone(void *sock, int how, void *test_fixture) {
-    TestNrSocketTest *test = static_cast(test_fixture);
+  static void WaitDone(void* sock, int how, void* test_fixture) {
+    TestNrSocketTest* test = static_cast(test_fixture);
     test->wait_done_for_main_ = true;
   }
 
diff --git a/media/mtransport/test/turn_unittest.cpp b/media/mtransport/test/turn_unittest.cpp
index de4a32214e60a..d24cb4fa39f68 100644
--- a/media/mtransport/test/turn_unittest.cpp
+++ b/media/mtransport/test/turn_unittest.cpp
@@ -134,8 +134,7 @@ class TurnClient : public MtransportTest {
     r = nr_socket_getfd(net_socket_, &net_fd_);
     ASSERT_EQ(0, r);
 
-    NR_ASYNC_WAIT(net_fd_, NR_ASYNC_WAIT_READ, socket_readable_cb,
-                  (void *)this);
+    NR_ASYNC_WAIT(net_fd_, NR_ASYNC_WAIT_READ, socket_readable_cb, (void*)this);
   }
 
   void TearDown_s() {
@@ -206,7 +205,7 @@ class TurnClient : public MtransportTest {
                   NS_DISPATCH_SYNC);
   }
 
-  void RequestPermission_s(const std::string &target) {
+  void RequestPermission_s(const std::string& target) {
     nr_transport_addr addr;
     int r;
 
@@ -227,13 +226,13 @@ class TurnClient : public MtransportTest {
     ASSERT_EQ(0, r);
   }
 
-  void RequestPermission(const std::string &target) {
+  void RequestPermission(const std::string& target) {
     RUN_ON_THREAD(test_utils_->sts_target(),
                   WrapRunnable(this, &TurnClient::RequestPermission_s, target),
                   NS_DISPATCH_SYNC);
   }
 
-  void Readable(NR_SOCKET s, int how, void *arg) {
+  void Readable(NR_SOCKET s, int how, void* arg) {
     // Re-arm
     std::cerr << "Socket is readable" << std::endl;
     NR_ASYNC_WAIT(s, how, socket_readable_cb, arg);
@@ -287,7 +286,7 @@ class TurnClient : public MtransportTest {
     }
   }
 
-  void SendTo_s(const std::string &target, int expect_return) {
+  void SendTo_s(const std::string& target, int expect_return) {
     nr_transport_addr addr;
     int r;
 
@@ -317,7 +316,7 @@ class TurnClient : public MtransportTest {
     }
   }
 
-  void SendTo(const std::string &target, int expect_return = 0) {
+  void SendTo(const std::string& target, int expect_return = 0) {
     RUN_ON_THREAD(
         test_utils_->sts_target(),
         WrapRunnable(this, &TurnClient::SendTo_s, target, expect_return),
@@ -326,21 +325,21 @@ class TurnClient : public MtransportTest {
 
   int received() const { return received_; }
 
-  static void socket_readable_cb(NR_SOCKET s, int how, void *arg) {
-    static_cast(arg)->Readable(s, how, arg);
+  static void socket_readable_cb(NR_SOCKET s, int how, void* arg) {
+    static_cast(arg)->Readable(s, how, arg);
   }
 
-  static void allocate_success_cb(NR_SOCKET s, int how, void *arg) {
-    static_cast(arg)->Allocated();
+  static void allocate_success_cb(NR_SOCKET s, int how, void* arg) {
+    static_cast(arg)->Allocated();
   }
 
  protected:
   std::string turn_server_;
-  nr_socket *real_socket_;
-  nr_socket *net_socket_;
-  nr_socket *buffered_socket_;
+  nr_socket* real_socket_;
+  nr_socket* net_socket_;
+  nr_socket* buffered_socket_;
   NR_SOCKET net_fd_;
-  nr_turn_client_ctx *turn_ctx_;
+  nr_turn_client_ctx* turn_ctx_;
   std::string relay_addr_;
   bool allocated_;
   int received_;
@@ -397,7 +396,7 @@ TEST_F(TurnClient, PermissionDenied) {
   PR_Sleep(1000);
 
   /* Fake a 403 response */
-  nr_turn_permission *perm;
+  nr_turn_permission* perm;
   perm = STAILQ_FIRST(&turn_ctx_->permissions);
   ASSERT_TRUE(perm);
   while (perm) {
diff --git a/media/mtransport/test/webrtcproxychannel_unittest.cpp b/media/mtransport/test/webrtcproxychannel_unittest.cpp
index 3e48f924001a4..854c69836ffe1 100644
--- a/media/mtransport/test/webrtcproxychannel_unittest.cpp
+++ b/media/mtransport/test/webrtcproxychannel_unittest.cpp
@@ -37,73 +37,73 @@ class FakeSocketTransportProvider : public nsISocketTransport {
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // nsISocketTransport
-  NS_IMETHOD GetHost(nsACString &aHost) override {
+  NS_IMETHOD GetHost(nsACString& aHost) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetPort(int32_t *aPort) override {
+  NS_IMETHOD GetPort(int32_t* aPort) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   NS_IMETHOD GetScriptableOriginAttributes(
-      JSContext *cx, JS::MutableHandleValue aOriginAttributes) override {
+      JSContext* cx, JS::MutableHandleValue aOriginAttributes) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   NS_IMETHOD SetScriptableOriginAttributes(
-      JSContext *cx, JS::HandleValue aOriginAttributes) override {
+      JSContext* cx, JS::HandleValue aOriginAttributes) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   virtual nsresult GetOriginAttributes(
-      mozilla::OriginAttributes *_retval) override {
+      mozilla::OriginAttributes* _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   virtual nsresult SetOriginAttributes(
-      const mozilla::OriginAttributes &aOriginAttrs) override {
+      const mozilla::OriginAttributes& aOriginAttrs) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetPeerAddr(mozilla::net::NetAddr *_retval) override {
+  NS_IMETHOD GetPeerAddr(mozilla::net::NetAddr* _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetSelfAddr(mozilla::net::NetAddr *_retval) override {
+  NS_IMETHOD GetSelfAddr(mozilla::net::NetAddr* _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD Bind(mozilla::net::NetAddr *aLocalAddr) override {
+  NS_IMETHOD Bind(mozilla::net::NetAddr* aLocalAddr) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetScriptablePeerAddr(nsINetAddr **_retval) override {
+  NS_IMETHOD GetScriptablePeerAddr(nsINetAddr** _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetScriptableSelfAddr(nsINetAddr **_retval) override {
+  NS_IMETHOD GetScriptableSelfAddr(nsINetAddr** _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo) override {
+  NS_IMETHOD GetSecurityInfo(nsISupports** aSecurityInfo) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   NS_IMETHOD GetSecurityCallbacks(
-      nsIInterfaceRequestor **aSecurityCallbacks) override {
+      nsIInterfaceRequestor** aSecurityCallbacks) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   NS_IMETHOD SetSecurityCallbacks(
-      nsIInterfaceRequestor *aSecurityCallbacks) override {
+      nsIInterfaceRequestor* aSecurityCallbacks) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD IsAlive(bool *_retval) override {
+  NS_IMETHOD IsAlive(bool* _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetTimeout(uint32_t aType, uint32_t *_retval) override {
+  NS_IMETHOD GetTimeout(uint32_t aType, uint32_t* _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
@@ -119,7 +119,7 @@ class FakeSocketTransportProvider : public nsISocketTransport {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetConnectionFlags(uint32_t *aConnectionFlags) override {
+  NS_IMETHOD GetConnectionFlags(uint32_t* aConnectionFlags) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
@@ -127,7 +127,7 @@ class FakeSocketTransportProvider : public nsISocketTransport {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetTlsFlags(uint32_t *aTlsFlags) override {
+  NS_IMETHOD GetTlsFlags(uint32_t* aTlsFlags) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
@@ -135,7 +135,7 @@ class FakeSocketTransportProvider : public nsISocketTransport {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetQoSBits(uint8_t *aQoSBits) override {
+  NS_IMETHOD GetQoSBits(uint8_t* aQoSBits) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
@@ -143,15 +143,15 @@ class FakeSocketTransportProvider : public nsISocketTransport {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetRecvBufferSize(uint32_t *aRecvBufferSize) override {
+  NS_IMETHOD GetRecvBufferSize(uint32_t* aRecvBufferSize) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetSendBufferSize(uint32_t *aSendBufferSize) override {
+  NS_IMETHOD GetSendBufferSize(uint32_t* aSendBufferSize) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetKeepaliveEnabled(bool *aKeepaliveEnabled) override {
+  NS_IMETHOD GetKeepaliveEnabled(bool* aKeepaliveEnabled) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
@@ -165,20 +165,20 @@ class FakeSocketTransportProvider : public nsISocketTransport {
     return NS_OK;
   }
   NS_IMETHOD SetFastOpenCallback(
-      mozilla::net::TCPFastOpen *aFastOpen) override {
+      mozilla::net::TCPFastOpen* aFastOpen) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetFirstRetryError(nsresult *aFirstRetryError) override {
+  NS_IMETHOD GetFirstRetryError(nsresult* aFirstRetryError) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   NS_IMETHOD GetResetIPFamilyPreference(
-      bool *aResetIPFamilyPreference) override {
+      bool* aResetIPFamilyPreference) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD GetEsniUsed(bool *aEsniUsed) override {
+  NS_IMETHOD GetEsniUsed(bool* aEsniUsed) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
@@ -186,18 +186,18 @@ class FakeSocketTransportProvider : public nsISocketTransport {
   // nsITransport
   NS_IMETHOD OpenInputStream(uint32_t aFlags, uint32_t aSegmentSize,
                              uint32_t aSegmentCount,
-                             nsIInputStream **_retval) override {
+                             nsIInputStream** _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   NS_IMETHOD OpenOutputStream(uint32_t aFlags, uint32_t aSegmentSize,
                               uint32_t aSegmentCount,
-                              nsIOutputStream **_retval) override {
+                              nsIOutputStream** _retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD SetEventSink(nsITransportEventSink *aSink,
-                          nsIEventTarget *aEventTarget) override {
+  NS_IMETHOD SetEventSink(nsITransportEventSink* aSink,
+                          nsIEventTarget* aEventTarget) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
@@ -229,7 +229,7 @@ class WebrtcProxyChannelTestStream {
 
   size_t DataLength();
   template 
-  void AppendElements(const T *aBuffer, size_t aLength);
+  void AppendElements(const T* aBuffer, size_t aLength);
 
  protected:
   virtual ~WebrtcProxyChannelTestStream() = default;
@@ -244,7 +244,7 @@ WebrtcProxyChannelTestStream::WebrtcProxyChannelTestStream()
     : mMustFail(false) {}
 
 template 
-void WebrtcProxyChannelTestStream::AppendElements(const T *aBuffer,
+void WebrtcProxyChannelTestStream::AppendElements(const T* aBuffer,
                                                   size_t aLength) {
   std::lock_guard guard(mDataMutex);
   mData.AppendElements(aBuffer, aLength);
@@ -266,7 +266,7 @@ class WebrtcProxyChannelTestInputStream : public nsIAsyncInputStream,
       : mMaxReadSize(1024 * 1024), mAllowCallbacks(false) {}
 
   void DoCallback();
-  void CallCallback(const nsCOMPtr &aCallback);
+  void CallCallback(const nsCOMPtr& aCallback);
   void AllowCallbacks() { mAllowCallbacks = true; }
 
   size_t mMaxReadSize;
@@ -285,8 +285,8 @@ NS_IMPL_ISUPPORTS(WebrtcProxyChannelTestInputStream, nsIAsyncInputStream,
                   nsIInputStream)
 
 nsresult WebrtcProxyChannelTestInputStream::AsyncWait(
-    nsIInputStreamCallback *aCallback, uint32_t aFlags,
-    uint32_t aRequestedCount, nsIEventTarget *aEventTarget) {
+    nsIInputStreamCallback* aCallback, uint32_t aFlags,
+    uint32_t aRequestedCount, nsIEventTarget* aEventTarget) {
   MOZ_ASSERT(!aEventTarget, "no event target should be set");
 
   mCallback = aCallback;
@@ -305,13 +305,13 @@ nsresult WebrtcProxyChannelTestInputStream::CloseWithStatus(nsresult aStatus) {
 
 nsresult WebrtcProxyChannelTestInputStream::Close() { return NS_OK; }
 
-nsresult WebrtcProxyChannelTestInputStream::Available(uint64_t *aAvailable) {
+nsresult WebrtcProxyChannelTestInputStream::Available(uint64_t* aAvailable) {
   *aAvailable = DataLength();
   return NS_OK;
 }
 
-nsresult WebrtcProxyChannelTestInputStream::Read(char *aBuffer, uint32_t aCount,
-                                                 uint32_t *aRead) {
+nsresult WebrtcProxyChannelTestInputStream::Read(char* aBuffer, uint32_t aCount,
+                                                 uint32_t* aRead) {
   std::lock_guard guard(mDataMutex);
   if (mMustFail) {
     return NS_ERROR_FAILURE;
@@ -323,27 +323,27 @@ nsresult WebrtcProxyChannelTestInputStream::Read(char *aBuffer, uint32_t aCount,
 }
 
 nsresult WebrtcProxyChannelTestInputStream::ReadSegments(
-    nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount,
-    uint32_t *_retval) {
+    nsWriteSegmentFun aWriter, void* aClosure, uint32_t aCount,
+    uint32_t* _retval) {
   MOZ_ASSERT(false);
   return NS_OK;
 }
 
 nsresult WebrtcProxyChannelTestInputStream::IsNonBlocking(
-    bool *aIsNonBlocking) {
+    bool* aIsNonBlocking) {
   *aIsNonBlocking = true;
   return NS_OK;
 }
 
 void WebrtcProxyChannelTestInputStream::CallCallback(
-    const nsCOMPtr &aCallback) {
+    const nsCOMPtr& aCallback) {
   aCallback->OnInputStreamReady(this);
 }
 
 void WebrtcProxyChannelTestInputStream::DoCallback() {
   if (mCallback) {
     mCallbackTarget->Dispatch(
-        NewRunnableMethod &>(
+        NewRunnableMethod&>(
             "WebrtcProxyChannelTestInputStream::DoCallback", this,
             &WebrtcProxyChannelTestInputStream::CallCallback,
             std::move(mCallback)));
@@ -362,7 +362,7 @@ class WebrtcProxyChannelTestOutputStream : public nsIAsyncOutputStream,
   WebrtcProxyChannelTestOutputStream() : mMaxWriteSize(1024 * 1024) {}
 
   void DoCallback();
-  void CallCallback(const nsCOMPtr &aCallback);
+  void CallCallback(const nsCOMPtr& aCallback);
 
   const std::string DataString();
 
@@ -380,8 +380,8 @@ NS_IMPL_ISUPPORTS(WebrtcProxyChannelTestOutputStream, nsIAsyncOutputStream,
                   nsIOutputStream)
 
 nsresult WebrtcProxyChannelTestOutputStream::AsyncWait(
-    nsIOutputStreamCallback *aCallback, uint32_t aFlags,
-    uint32_t aRequestedCount, nsIEventTarget *aEventTarget) {
+    nsIOutputStreamCallback* aCallback, uint32_t aFlags,
+    uint32_t aRequestedCount, nsIEventTarget* aEventTarget) {
   MOZ_ASSERT(!aEventTarget, "no event target should be set");
 
   mCallback = aCallback;
@@ -398,9 +398,9 @@ nsresult WebrtcProxyChannelTestOutputStream::Close() { return NS_OK; }
 
 nsresult WebrtcProxyChannelTestOutputStream::Flush() { return NS_OK; }
 
-nsresult WebrtcProxyChannelTestOutputStream::Write(const char *aBuffer,
+nsresult WebrtcProxyChannelTestOutputStream::Write(const char* aBuffer,
                                                    uint32_t aCount,
-                                                   uint32_t *aWrote) {
+                                                   uint32_t* aWrote) {
   if (mMustFail) {
     return NS_ERROR_FAILURE;
   }
@@ -410,33 +410,33 @@ nsresult WebrtcProxyChannelTestOutputStream::Write(const char *aBuffer,
 }
 
 nsresult WebrtcProxyChannelTestOutputStream::WriteSegments(
-    nsReadSegmentFun aReader, void *aClosure, uint32_t aCount,
-    uint32_t *_retval) {
+    nsReadSegmentFun aReader, void* aClosure, uint32_t aCount,
+    uint32_t* _retval) {
   MOZ_ASSERT(false);
   return NS_OK;
 }
 
 nsresult WebrtcProxyChannelTestOutputStream::WriteFrom(
-    nsIInputStream *aFromStream, uint32_t aCount, uint32_t *_retval) {
+    nsIInputStream* aFromStream, uint32_t aCount, uint32_t* _retval) {
   MOZ_ASSERT(false);
   return NS_OK;
 }
 
 nsresult WebrtcProxyChannelTestOutputStream::IsNonBlocking(
-    bool *aIsNonBlocking) {
+    bool* aIsNonBlocking) {
   *aIsNonBlocking = true;
   return NS_OK;
 }
 
 void WebrtcProxyChannelTestOutputStream::CallCallback(
-    const nsCOMPtr &aCallback) {
+    const nsCOMPtr& aCallback) {
   aCallback->OnOutputStreamReady(this);
 }
 
 void WebrtcProxyChannelTestOutputStream::DoCallback() {
   if (mCallback) {
     mCallbackTarget->Dispatch(
-        NewRunnableMethod &>(
+        NewRunnableMethod&>(
             "WebrtcProxyChannelTestOutputStream::CallCallback", this,
             &WebrtcProxyChannelTestOutputStream::CallCallback,
             std::move(mCallback)));
@@ -447,13 +447,13 @@ void WebrtcProxyChannelTestOutputStream::DoCallback() {
 
 const std::string WebrtcProxyChannelTestOutputStream::DataString() {
   std::lock_guard guard(mDataMutex);
-  return std::string((char *)mData.Elements(), mData.Length());
+  return std::string((char*)mData.Elements(), mData.Length());
 }
 
 // Fake as in not the real WebrtcProxyChannel but real enough
 class FakeWebrtcProxyChannel : public WebrtcProxyChannel {
  public:
-  explicit FakeWebrtcProxyChannel(WebrtcProxyChannelCallback *aCallback)
+  explicit FakeWebrtcProxyChannel(WebrtcProxyChannelCallback* aCallback)
       : WebrtcProxyChannel(aCallback) {}
 
  protected:
@@ -461,7 +461,7 @@ class FakeWebrtcProxyChannel : public WebrtcProxyChannel {
 
   void InvokeOnClose(nsresult aReason) override;
   void InvokeOnConnected() override;
-  void InvokeOnRead(nsTArray &&aReadData) override;
+  void InvokeOnRead(nsTArray&& aReadData) override;
 };
 
 void FakeWebrtcProxyChannel::InvokeOnClose(nsresult aReason) {
@@ -472,7 +472,7 @@ void FakeWebrtcProxyChannel::InvokeOnConnected() {
   mProxyCallbacks->OnConnected();
 }
 
-void FakeWebrtcProxyChannel::InvokeOnRead(nsTArray &&aReadData) {
+void FakeWebrtcProxyChannel::InvokeOnRead(nsTArray&& aReadData) {
   mProxyCallbacks->OnRead(std::move(aReadData));
 }
 
@@ -492,7 +492,7 @@ class WebrtcProxyChannelTest : public MtransportTest {
   // WebrtcProxyChannelCallback forwards from mCallback
   void OnClose(nsresult aReason);
   void OnConnected();
-  void OnRead(nsTArray &&aReadData);
+  void OnRead(nsTArray&& aReadData);
 
   void SetUp() override;
   void TearDown() override;
@@ -515,7 +515,7 @@ class WebrtcProxyChannelTest : public MtransportTest {
 
   size_t ReadDataLength();
   template 
-  void AppendReadData(const T *aBuffer, size_t aLength);
+  void AppendReadData(const T* aBuffer, size_t aLength);
 
  private:
   nsTArray mReadData;
@@ -527,19 +527,19 @@ class WebrtcProxyChannelTestCallback : public WebrtcProxyChannelCallback {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebrtcProxyChannelTestCallback,
                                         override)
 
-  explicit WebrtcProxyChannelTestCallback(WebrtcProxyChannelTest *aTest)
+  explicit WebrtcProxyChannelTestCallback(WebrtcProxyChannelTest* aTest)
       : mTest(aTest) {}
 
   // WebrtcProxyChannelCallback
   void OnClose(nsresult aReason) override;
   void OnConnected() override;
-  void OnRead(nsTArray &&aReadData) override;
+  void OnRead(nsTArray&& aReadData) override;
 
  protected:
   virtual ~WebrtcProxyChannelTestCallback() = default;
 
  private:
-  WebrtcProxyChannelTest *mTest;
+  WebrtcProxyChannelTest* mTest;
 };
 
 void WebrtcProxyChannelTest::SetUp() {
@@ -560,7 +560,7 @@ void WebrtcProxyChannelTest::SetUp() {
 void WebrtcProxyChannelTest::TearDown() {}
 
 // WebrtcProxyChannelCallback
-void WebrtcProxyChannelTest::OnRead(nsTArray &&aReadData) {
+void WebrtcProxyChannelTest::OnRead(nsTArray&& aReadData) {
   AppendReadData(aReadData.Elements(), aReadData.Length());
 }
 
@@ -587,7 +587,7 @@ void WebrtcProxyChannelTest::DoTransportAvailable() {
 
 const std::string WebrtcProxyChannelTest::ReadDataAsString() {
   std::lock_guard guard(mReadDataMutex);
-  return std::string((char *)mReadData.Elements(), mReadData.Length());
+  return std::string((char*)mReadData.Elements(), mReadData.Length());
 }
 
 const std::string WebrtcProxyChannelTest::GetDataLarge() {
@@ -600,7 +600,7 @@ const std::string WebrtcProxyChannelTest::GetDataLarge() {
 }
 
 template 
-void WebrtcProxyChannelTest::AppendReadData(const T *aBuffer, size_t aLength) {
+void WebrtcProxyChannelTest::AppendReadData(const T* aBuffer, size_t aLength) {
   std::lock_guard guard(mReadDataMutex);
   mReadData.AppendElements(aBuffer, aLength);
 }
@@ -616,7 +616,7 @@ void WebrtcProxyChannelTestCallback::OnClose(nsresult aReason) {
 
 void WebrtcProxyChannelTestCallback::OnConnected() { mTest->OnConnected(); }
 
-void WebrtcProxyChannelTestCallback::OnRead(nsTArray &&aReadData) {
+void WebrtcProxyChannelTestCallback::OnRead(nsTArray&& aReadData) {
   mTest->OnRead(std::move(aReadData));
 }
 
diff --git a/media/mtransport/test_nr_socket.cpp b/media/mtransport/test_nr_socket.cpp
index 53d5c8699df06..f8b03382524fc 100644
--- a/media/mtransport/test_nr_socket.cpp
+++ b/media/mtransport/test_nr_socket.cpp
@@ -97,16 +97,16 @@ extern "C" {
 
 namespace mozilla {
 
-static int test_nat_socket_create(void *obj, nr_transport_addr *addr,
-                                  nr_socket **sockp) {
-  RefPtr sock = new TestNrSocket(static_cast(obj));
+static int test_nat_socket_create(void* obj, nr_transport_addr* addr,
+                                  nr_socket** sockp) {
+  RefPtr sock = new TestNrSocket(static_cast(obj));
 
   int r, _status;
 
   r = sock->create(addr);
   if (r) ABORT(r);
 
-  r = nr_socket_create_int(static_cast(sock), sock->vtbl(), sockp);
+  r = nr_socket_create_int(static_cast(sock), sock->vtbl(), sockp);
   if (r) ABORT(r);
 
   _status = 0;
@@ -114,7 +114,7 @@ static int test_nat_socket_create(void *obj, nr_transport_addr *addr,
   {
     // We will release this reference in destroy(), not exactly the normal
     // ownership model, but it is what it is.
-    NrSocketBase *dummy = sock.forget().take();
+    NrSocketBase* dummy = sock.forget().take();
     (void)dummy;
   }
 
@@ -122,8 +122,8 @@ static int test_nat_socket_create(void *obj, nr_transport_addr *addr,
   return _status;
 }
 
-static int test_nat_socket_factory_destroy(void **obj) {
-  TestNat *nat = static_cast(*obj);
+static int test_nat_socket_factory_destroy(void** obj) {
+  TestNat* nat = static_cast(*obj);
   *obj = nullptr;
   nat->Release();
   return 0;
@@ -133,7 +133,7 @@ static nr_socket_factory_vtbl test_nat_socket_factory_vtbl = {
     test_nat_socket_create, test_nat_socket_factory_destroy};
 
 /* static */
-TestNat::NatBehavior TestNat::ToNatBehavior(const std::string &type) {
+TestNat::NatBehavior TestNat::ToNatBehavior(const std::string& type) {
   if (!type.compare("ENDPOINT_INDEPENDENT")) {
     return TestNat::ENDPOINT_INDEPENDENT;
   }
@@ -149,7 +149,7 @@ TestNat::NatBehavior TestNat::ToNatBehavior(const std::string &type) {
 }
 
 bool TestNat::has_port_mappings() const {
-  for (TestNrSocket *sock : sockets_) {
+  for (TestNrSocket* sock : sockets_) {
     if (sock->has_port_mappings()) {
       return true;
     }
@@ -157,8 +157,8 @@ bool TestNat::has_port_mappings() const {
   return false;
 }
 
-bool TestNat::is_my_external_tuple(const nr_transport_addr &addr) const {
-  for (TestNrSocket *sock : sockets_) {
+bool TestNat::is_my_external_tuple(const nr_transport_addr& addr) const {
+  for (TestNrSocket* sock : sockets_) {
     if (sock->is_my_external_tuple(addr)) {
       return true;
     }
@@ -167,15 +167,15 @@ bool TestNat::is_my_external_tuple(const nr_transport_addr &addr) const {
   return false;
 }
 
-bool TestNat::is_an_internal_tuple(const nr_transport_addr &addr) const {
-  for (TestNrSocket *sock : sockets_) {
+bool TestNat::is_an_internal_tuple(const nr_transport_addr& addr) const {
+  for (TestNrSocket* sock : sockets_) {
     nr_transport_addr addr_behind_nat;
     if (sock->getaddr(&addr_behind_nat)) {
       MOZ_CRASH("TestNrSocket::getaddr failed!");
     }
 
     // TODO(bug 1170299): Remove const_cast when no longer necessary
-    if (!nr_transport_addr_cmp(const_cast(&addr),
+    if (!nr_transport_addr_cmp(const_cast(&addr),
                                &addr_behind_nat,
                                NR_TRANSPORT_ADDR_CMP_MODE_ALL)) {
       return true;
@@ -184,7 +184,7 @@ bool TestNat::is_an_internal_tuple(const nr_transport_addr &addr) const {
   return false;
 }
 
-int TestNat::create_socket_factory(nr_socket_factory **factorypp) {
+int TestNat::create_socket_factory(nr_socket_factory** factorypp) {
   int r = nr_socket_factory_create_int(this, &test_nat_socket_factory_vtbl,
                                        factorypp);
   if (!r) {
@@ -193,7 +193,7 @@ int TestNat::create_socket_factory(nr_socket_factory **factorypp) {
   return r;
 }
 
-TestNrSocket::TestNrSocket(TestNat *nat)
+TestNrSocket::TestNrSocket(TestNat* nat)
     : nat_(nat), tls_(false), timer_handle_(nullptr) {
   nat_->insert_socket(this);
 }
@@ -201,7 +201,7 @@ TestNrSocket::TestNrSocket(TestNat *nat)
 TestNrSocket::~TestNrSocket() { nat_->erase_socket(this); }
 
 RefPtr TestNrSocket::create_external_socket(
-    const nr_transport_addr &dest_addr) const {
+    const nr_transport_addr& dest_addr) const {
   MOZ_ASSERT(nat_->enabled_);
   MOZ_ASSERT(!nat_->is_an_internal_tuple(dest_addr));
 
@@ -212,7 +212,7 @@ RefPtr TestNrSocket::create_external_socket(
   // TODO(bug 1170299): Remove const_cast when no longer necessary
   if ((r = nr_transport_addr_copy(
            &nat_external_addr,
-           const_cast(&internal_socket_->my_addr())))) {
+           const_cast(&internal_socket_->my_addr())))) {
     r_log(LOG_GENERIC, LOG_CRIT, "%s: Failure in nr_transport_addr_copy: %d",
           __FUNCTION__, r);
     return nullptr;
@@ -236,7 +236,7 @@ RefPtr TestNrSocket::create_external_socket(
   return external_socket;
 }
 
-int TestNrSocket::create(nr_transport_addr *addr) {
+int TestNrSocket::create(nr_transport_addr* addr) {
   if (addr->tls_host[0] != '\0') {
     tls_ = true;
   }
@@ -244,7 +244,7 @@ int TestNrSocket::create(nr_transport_addr *addr) {
   return NrSocketBase::CreateSocket(addr, &internal_socket_, nullptr);
 }
 
-int TestNrSocket::getaddr(nr_transport_addr *addrp) {
+int TestNrSocket::getaddr(nr_transport_addr* addrp) {
   return internal_socket_->getaddr(addrp);
 }
 
@@ -254,7 +254,7 @@ void TestNrSocket::close() {
     timer_handle_ = nullptr;
   }
   internal_socket_->close();
-  for (RefPtr &port_mapping : port_mappings_) {
+  for (RefPtr& port_mapping : port_mappings_) {
     port_mapping->external_socket_->close();
   }
 }
@@ -267,7 +267,7 @@ int TestNrSocket::listen(int backlog) {
   return internal_socket_->listen(backlog);
 }
 
-int TestNrSocket::accept(nr_transport_addr *addrp, nr_socket **sockp) {
+int TestNrSocket::accept(nr_transport_addr* addrp, nr_socket** sockp) {
   MOZ_ASSERT(internal_socket_->my_addr().protocol == IPPROTO_TCP);
   int r = internal_socket_->accept(addrp, sockp);
   if (r) {
@@ -282,8 +282,8 @@ int TestNrSocket::accept(nr_transport_addr *addrp, nr_socket **sockp) {
   return 0;
 }
 
-void TestNrSocket::process_delayed_cb(NR_SOCKET s, int how, void *cb_arg) {
-  DeferredPacket *op = static_cast(cb_arg);
+void TestNrSocket::process_delayed_cb(NR_SOCKET s, int how, void* cb_arg) {
+  DeferredPacket* op = static_cast(cb_arg);
   op->socket_->timer_handle_ = nullptr;
   r_log(LOG_GENERIC, LOG_DEBUG, "TestNrSocket %s sending delayed STUN response",
         op->internal_socket_->my_addr().as_string);
@@ -293,8 +293,8 @@ void TestNrSocket::process_delayed_cb(NR_SOCKET s, int how, void *cb_arg) {
   delete op;
 }
 
-int TestNrSocket::sendto(const void *msg, size_t len, int flags,
-                         nr_transport_addr *to) {
+int TestNrSocket::sendto(const void* msg, size_t len, int flags,
+                         nr_transport_addr* to) {
   MOZ_ASSERT(internal_socket_->my_addr().protocol != IPPROTO_TCP);
 
   if (nat_->nat_delegate_ &&
@@ -302,7 +302,7 @@ int TestNrSocket::sendto(const void *msg, size_t len, int flags,
     return 0;
   }
 
-  UCHAR *buf = static_cast(const_cast(msg));
+  UCHAR* buf = static_cast(const_cast(msg));
   if (nat_->block_stun_ && nr_is_stun_message(buf, len)) {
     return 0;
   }
@@ -327,12 +327,12 @@ int TestNrSocket::sendto(const void *msg, size_t len, int flags,
   }
 
   // Choose our port mapping based on our most selective criteria
-  PortMapping *port_mapping = get_port_mapping(
+  PortMapping* port_mapping = get_port_mapping(
       *to, std::max(nat_->filtering_type_, nat_->mapping_type_));
 
   if (!port_mapping) {
     // See if we have already made the external socket we need to use.
-    PortMapping *similar_port_mapping =
+    PortMapping* similar_port_mapping =
         get_port_mapping(*to, nat_->mapping_type_);
     RefPtr external_socket;
 
@@ -353,7 +353,7 @@ int TestNrSocket::sendto(const void *msg, size_t len, int flags,
       // Make sure the new port mapping is ready to receive traffic if the
       // TestNrSocket is already waiting.
       port_mapping->async_wait(NR_ASYNC_WAIT_READ, socket_readable_callback,
-                               this, (char *)__FUNCTION__, __LINE__);
+                               this, (char*)__FUNCTION__, __LINE__);
     }
   }
 
@@ -362,8 +362,8 @@ int TestNrSocket::sendto(const void *msg, size_t len, int flags,
   return port_mapping->sendto(msg, len, *to);
 }
 
-int TestNrSocket::recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-                           nr_transport_addr *from) {
+int TestNrSocket::recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+                           nr_transport_addr* from) {
   MOZ_ASSERT(internal_socket_->my_addr().protocol != IPPROTO_TCP);
 
   int r;
@@ -374,7 +374,7 @@ int TestNrSocket::recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
     r = readable_socket_->recvfrom(buf, maxlen, len, 0, from);
     readable_socket_ = nullptr;
     if (!r) {
-      PortMapping *port_mapping_used;
+      PortMapping* port_mapping_used;
       ingress_allowed = allow_ingress(*from, &port_mapping_used);
       if (ingress_allowed) {
         r_log(LOG_GENERIC, LOG_DEBUG, "TestNrSocket %s received from %s via %s",
@@ -420,8 +420,8 @@ int TestNrSocket::recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
   return r;
 }
 
-bool TestNrSocket::allow_ingress(const nr_transport_addr &from,
-                                 PortMapping **port_mapping_used) const {
+bool TestNrSocket::allow_ingress(const nr_transport_addr& from,
+                                 PortMapping** port_mapping_used) const {
   // This is only called for traffic arriving at a port mapping
   MOZ_ASSERT(nat_->enabled_);
   MOZ_ASSERT(!nat_->is_an_internal_tuple(from));
@@ -454,7 +454,7 @@ bool TestNrSocket::allow_ingress(const nr_transport_addr &from,
   return true;
 }
 
-int TestNrSocket::connect(nr_transport_addr *addr) {
+int TestNrSocket::connect(nr_transport_addr* addr) {
   if (connect_invoked_ || !port_mappings_.empty()) {
     MOZ_CRASH("TestNrSocket::connect() called more than once!");
     return R_INTERNAL;
@@ -474,7 +474,7 @@ int TestNrSocket::connect(nr_transport_addr *addr) {
     return R_INTERNAL;
   }
 
-  PortMapping *port_mapping = create_port_mapping(*addr, external_socket);
+  PortMapping* port_mapping = create_port_mapping(*addr, external_socket);
   port_mappings_.push_back(port_mapping);
   int r = port_mapping->external_socket_->connect(addr);
   if (r && r != R_WOULDBLOCK) {
@@ -486,14 +486,14 @@ int TestNrSocket::connect(nr_transport_addr *addr) {
   if (poll_flags() & PR_POLL_READ) {
     port_mapping->async_wait(NR_ASYNC_WAIT_READ,
                              port_mapping_tcp_passthrough_callback, this,
-                             (char *)__FUNCTION__, __LINE__);
+                             (char*)__FUNCTION__, __LINE__);
   }
 
   return r;
 }
 
-int TestNrSocket::write(const void *msg, size_t len, size_t *written) {
-  UCHAR *buf = static_cast(const_cast(msg));
+int TestNrSocket::write(const void* msg, size_t len, size_t* written) {
+  UCHAR* buf = static_cast(const_cast(msg));
 
   if (nat_->nat_delegate_ &&
       nat_->nat_delegate_->on_write(nat_, msg, len, written)) {
@@ -542,7 +542,7 @@ int TestNrSocket::write(const void *msg, size_t len, size_t *written) {
   return port_mappings_.front()->external_socket_->write(msg, len, written);
 }
 
-int TestNrSocket::read(void *buf, size_t maxlen, size_t *len) {
+int TestNrSocket::read(void* buf, size_t maxlen, size_t* len) {
   int r;
 
   if (port_mappings_.empty()) {
@@ -569,7 +569,7 @@ int TestNrSocket::read(void *buf, size_t maxlen, size_t *len) {
     return R_INTERNAL;
   }
 
-  UCHAR *cbuf = static_cast(const_cast(buf));
+  UCHAR* cbuf = static_cast(const_cast(buf));
   if (nat_->block_stun_ && nr_is_stun_message(cbuf, *len)) {
     // Should cause this socket to be abandoned
     return R_INTERNAL;
@@ -578,8 +578,8 @@ int TestNrSocket::read(void *buf, size_t maxlen, size_t *len) {
   return r;
 }
 
-int TestNrSocket::async_wait(int how, NR_async_cb cb, void *cb_arg,
-                             char *function, int line) {
+int TestNrSocket::async_wait(int how, NR_async_cb cb, void* cb_arg,
+                             char* function, int line) {
   r_log(LOG_GENERIC, LOG_DEBUG, "TestNrSocket %s waiting for %s",
         internal_socket_->my_addr().as_string,
         how == NR_ASYNC_WAIT_READ ? "read" : "write");
@@ -621,7 +621,7 @@ int TestNrSocket::async_wait(int how, NR_async_cb cb, void *cb_arg,
   }
   if (how == NR_ASYNC_WAIT_READ) {
     // For UDP port mappings, we decouple the writeable callbacks
-    for (PortMapping *port_mapping : port_mappings_) {
+    for (PortMapping* port_mapping : port_mappings_) {
       // Be ready to receive traffic on our port mappings
       r = port_mapping->async_wait(how, socket_readable_callback, this,
                                    function, line);
@@ -639,7 +639,7 @@ int TestNrSocket::async_wait(int how, NR_async_cb cb, void *cb_arg,
 }
 
 void TestNrSocket::cancel_port_mapping_async_wait(int how) {
-  for (PortMapping *port_mapping : port_mappings_) {
+  for (PortMapping* port_mapping : port_mappings_) {
     port_mapping->cancel(how);
   }
 }
@@ -660,15 +660,15 @@ int TestNrSocket::cancel(int how) {
 
 bool TestNrSocket::has_port_mappings() const { return !port_mappings_.empty(); }
 
-bool TestNrSocket::is_my_external_tuple(const nr_transport_addr &addr) const {
-  for (PortMapping *port_mapping : port_mappings_) {
+bool TestNrSocket::is_my_external_tuple(const nr_transport_addr& addr) const {
+  for (PortMapping* port_mapping : port_mappings_) {
     nr_transport_addr port_mapping_addr;
     if (port_mapping->external_socket_->getaddr(&port_mapping_addr)) {
       MOZ_CRASH("NrSocket::getaddr failed!");
     }
 
     // TODO(bug 1170299): Remove const_cast when no longer necessary
-    if (!nr_transport_addr_cmp(const_cast(&addr),
+    if (!nr_transport_addr_cmp(const_cast(&addr),
                                &port_mapping_addr,
                                NR_TRANSPORT_ADDR_CMP_MODE_ALL)) {
       return true;
@@ -678,7 +678,7 @@ bool TestNrSocket::is_my_external_tuple(const nr_transport_addr &addr) const {
 }
 
 bool TestNrSocket::is_port_mapping_stale(
-    const PortMapping &port_mapping) const {
+    const PortMapping& port_mapping) const {
   PRIntervalTime now = PR_IntervalNow();
   PRIntervalTime elapsed_ticks = now - port_mapping.last_used_;
   uint32_t idle_duration = PR_IntervalToMilliseconds(elapsed_ticks);
@@ -701,15 +701,15 @@ void TestNrSocket::destroy_stale_port_mappings() {
   }
 }
 
-void TestNrSocket::socket_readable_callback(void *real_sock_v, int how,
-                                            void *test_sock_v) {
-  TestNrSocket *test_socket = static_cast(test_sock_v);
-  NrSocketBase *real_socket = static_cast(real_sock_v);
+void TestNrSocket::socket_readable_callback(void* real_sock_v, int how,
+                                            void* test_sock_v) {
+  TestNrSocket* test_socket = static_cast(test_sock_v);
+  NrSocketBase* real_socket = static_cast(real_sock_v);
 
   test_socket->on_socket_readable(real_socket);
 }
 
-void TestNrSocket::on_socket_readable(NrSocketBase *real_socket) {
+void TestNrSocket::on_socket_readable(NrSocketBase* real_socket) {
   if (!readable_socket_ && (real_socket != internal_socket_)) {
     readable_socket_ = real_socket;
   }
@@ -724,19 +724,19 @@ void TestNrSocket::fire_readable_callback() {
   fire_callback(NR_ASYNC_WAIT_READ);
 }
 
-void TestNrSocket::port_mapping_writeable_callback(void *ext_sock_v, int how,
-                                                   void *test_sock_v) {
-  TestNrSocket *test_socket = static_cast(test_sock_v);
-  NrSocketBase *external_socket = static_cast(ext_sock_v);
+void TestNrSocket::port_mapping_writeable_callback(void* ext_sock_v, int how,
+                                                   void* test_sock_v) {
+  TestNrSocket* test_socket = static_cast(test_sock_v);
+  NrSocketBase* external_socket = static_cast(ext_sock_v);
 
   test_socket->write_to_port_mapping(external_socket);
 }
 
-void TestNrSocket::write_to_port_mapping(NrSocketBase *external_socket) {
+void TestNrSocket::write_to_port_mapping(NrSocketBase* external_socket) {
   MOZ_ASSERT(internal_socket_->my_addr().protocol != IPPROTO_TCP);
 
   int r = 0;
-  for (PortMapping *port_mapping : port_mappings_) {
+  for (PortMapping* port_mapping : port_mappings_) {
     if (port_mapping->external_socket_ == external_socket) {
       // If the send succeeds, or if there was nothing to send, we keep going
       r = port_mapping->send_from_queue();
@@ -753,10 +753,10 @@ void TestNrSocket::write_to_port_mapping(NrSocketBase *external_socket) {
   }
 }
 
-void TestNrSocket::port_mapping_tcp_passthrough_callback(void *ext_sock_v,
+void TestNrSocket::port_mapping_tcp_passthrough_callback(void* ext_sock_v,
                                                          int how,
-                                                         void *test_sock_v) {
-  TestNrSocket *test_socket = static_cast(test_sock_v);
+                                                         void* test_sock_v) {
+  TestNrSocket* test_socket = static_cast(test_sock_v);
   r_log(LOG_GENERIC, LOG_DEBUG, "TestNrSocket %s firing %s callback",
         test_socket->internal_socket_->my_addr().as_string,
         how == NR_ASYNC_WAIT_READ ? "readable" : "writeable");
@@ -769,8 +769,8 @@ bool TestNrSocket::is_tcp_connection_behind_nat() const {
          port_mappings_.empty();
 }
 
-TestNrSocket::PortMapping *TestNrSocket::get_port_mapping(
-    const nr_transport_addr &remote_address,
+TestNrSocket::PortMapping* TestNrSocket::get_port_mapping(
+    const nr_transport_addr& remote_address,
     TestNat::NatBehavior filter) const {
   int compare_flags;
   switch (filter) {
@@ -785,18 +785,18 @@ TestNrSocket::PortMapping *TestNrSocket::get_port_mapping(
       break;
   }
 
-  for (PortMapping *port_mapping : port_mappings_) {
+  for (PortMapping* port_mapping : port_mappings_) {
     // TODO(bug 1170299): Remove const_cast when no longer necessary
-    if (!nr_transport_addr_cmp(const_cast(&remote_address),
+    if (!nr_transport_addr_cmp(const_cast(&remote_address),
                                &port_mapping->remote_address_, compare_flags))
       return port_mapping;
   }
   return nullptr;
 }
 
-TestNrSocket::PortMapping *TestNrSocket::create_port_mapping(
-    const nr_transport_addr &remote_address,
-    const RefPtr &external_socket) const {
+TestNrSocket::PortMapping* TestNrSocket::create_port_mapping(
+    const nr_transport_addr& remote_address,
+    const RefPtr& external_socket) const {
   r_log(LOG_GENERIC, LOG_INFO, "TestNrSocket %s creating port mapping %s -> %s",
         internal_socket_->my_addr().as_string,
         external_socket->my_addr().as_string, remote_address.as_string);
@@ -805,12 +805,12 @@ TestNrSocket::PortMapping *TestNrSocket::create_port_mapping(
 }
 
 TestNrSocket::PortMapping::PortMapping(
-    const nr_transport_addr &remote_address,
-    const RefPtr &external_socket)
+    const nr_transport_addr& remote_address,
+    const RefPtr& external_socket)
     : external_socket_(external_socket) {
   // TODO(bug 1170299): Remove const_cast when no longer necessary
   nr_transport_addr_copy(&remote_address_,
-                         const_cast(&remote_address));
+                         const_cast(&remote_address));
 }
 
 int TestNrSocket::PortMapping::send_from_queue() {
@@ -818,7 +818,7 @@ int TestNrSocket::PortMapping::send_from_queue() {
   int r = 0;
 
   while (!send_queue_.empty()) {
-    UdpPacket &packet = *send_queue_.front();
+    UdpPacket& packet = *send_queue_.front();
     r_log(LOG_GENERIC, LOG_DEBUG,
           "PortMapping %s -> %s sending from queue to %s",
           external_socket_->my_addr().as_string, remote_address_.as_string,
@@ -844,8 +844,8 @@ int TestNrSocket::PortMapping::send_from_queue() {
   return r;
 }
 
-int TestNrSocket::PortMapping::sendto(const void *msg, size_t len,
-                                      const nr_transport_addr &to) {
+int TestNrSocket::PortMapping::sendto(const void* msg, size_t len,
+                                      const nr_transport_addr& to) {
   MOZ_ASSERT(remote_address_.protocol != IPPROTO_TCP);
   r_log(LOG_GENERIC, LOG_DEBUG, "PortMapping %s -> %s sending to %s",
         external_socket_->my_addr().as_string, remote_address_.as_string,
@@ -855,7 +855,7 @@ int TestNrSocket::PortMapping::sendto(const void *msg, size_t len,
   int r = external_socket_->sendto(
       msg, len, 0,
       // TODO(bug 1170299): Remove const_cast when no longer necessary
-      const_cast(&to));
+      const_cast(&to));
 
   if (r == R_WOULDBLOCK) {
     r_log(LOG_GENERIC, LOG_DEBUG, "Enqueueing UDP packet to %s", to.as_string);
@@ -869,8 +869,8 @@ int TestNrSocket::PortMapping::sendto(const void *msg, size_t len,
   return r;
 }
 
-int TestNrSocket::PortMapping::async_wait(int how, NR_async_cb cb, void *cb_arg,
-                                          char *function, int line) {
+int TestNrSocket::PortMapping::async_wait(int how, NR_async_cb cb, void* cb_arg,
+                                          char* function, int line) {
   r_log(LOG_GENERIC, LOG_DEBUG, "PortMapping %s -> %s waiting for %s",
         external_socket_->my_addr().as_string, remote_address_.as_string,
         how == NR_ASYNC_WAIT_READ ? "read" : "write");
diff --git a/media/mtransport/test_nr_socket.h b/media/mtransport/test_nr_socket.h
index 6646ebdfc8e30..bb8fb86273c0e 100644
--- a/media/mtransport/test_nr_socket.h
+++ b/media/mtransport/test_nr_socket.h
@@ -122,12 +122,12 @@ class TestNat {
    */
   class NatDelegate {
    public:
-    virtual int on_read(TestNat *nat, void *buf, size_t maxlen,
-                        size_t *len) = 0;
-    virtual int on_sendto(TestNat *nat, const void *msg, size_t len, int flags,
-                          nr_transport_addr *to) = 0;
-    virtual int on_write(TestNat *nat, const void *msg, size_t len,
-                         size_t *written) = 0;
+    virtual int on_read(TestNat* nat, void* buf, size_t maxlen,
+                        size_t* len) = 0;
+    virtual int on_sendto(TestNat* nat, const void* msg, size_t len, int flags,
+                          nr_transport_addr* to) = 0;
+    virtual int on_write(TestNat* nat, const void* msg, size_t len,
+                         size_t* written) = 0;
   };
 
   typedef enum {
@@ -163,18 +163,18 @@ class TestNat {
   bool has_port_mappings() const;
 
   // Helps determine whether we're hairpinning
-  bool is_my_external_tuple(const nr_transport_addr &addr) const;
-  bool is_an_internal_tuple(const nr_transport_addr &addr) const;
+  bool is_my_external_tuple(const nr_transport_addr& addr) const;
+  bool is_an_internal_tuple(const nr_transport_addr& addr) const;
 
-  int create_socket_factory(nr_socket_factory **factorypp);
+  int create_socket_factory(nr_socket_factory** factorypp);
 
-  void insert_socket(TestNrSocket *socket) { sockets_.insert(socket); }
+  void insert_socket(TestNrSocket* socket) { sockets_.insert(socket); }
 
-  void erase_socket(TestNrSocket *socket) { sockets_.erase(socket); }
+  void erase_socket(TestNrSocket* socket) { sockets_.erase(socket); }
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TestNat);
 
-  static NatBehavior ToNatBehavior(const std::string &type);
+  static NatBehavior ToNatBehavior(const std::string& type);
 
   bool enabled_;
   TestNat::NatBehavior filtering_type_;
@@ -188,10 +188,10 @@ class TestNat {
   /* Note: this can only delay a single response so far (bug 1253657) */
   uint32_t delay_stun_resp_ms_;
 
-  NatDelegate *nat_delegate_;
+  NatDelegate* nat_delegate_;
 
  private:
-  std::set sockets_;
+  std::set sockets_;
 
   ~TestNat() {}
 };
@@ -206,26 +206,26 @@ class TestNat {
  */
 class TestNrSocket : public NrSocketBase {
  public:
-  explicit TestNrSocket(TestNat *nat);
+  explicit TestNrSocket(TestNat* nat);
 
   bool has_port_mappings() const;
-  bool is_my_external_tuple(const nr_transport_addr &addr) const;
+  bool is_my_external_tuple(const nr_transport_addr& addr) const;
 
   // Overrides of NrSocketBase
-  int create(nr_transport_addr *addr) override;
-  int sendto(const void *msg, size_t len, int flags,
-             nr_transport_addr *to) override;
-  int recvfrom(void *buf, size_t maxlen, size_t *len, int flags,
-               nr_transport_addr *from) override;
-  int getaddr(nr_transport_addr *addrp) override;
+  int create(nr_transport_addr* addr) override;
+  int sendto(const void* msg, size_t len, int flags,
+             nr_transport_addr* to) override;
+  int recvfrom(void* buf, size_t maxlen, size_t* len, int flags,
+               nr_transport_addr* from) override;
+  int getaddr(nr_transport_addr* addrp) override;
   void close() override;
-  int connect(nr_transport_addr *addr) override;
-  int write(const void *msg, size_t len, size_t *written) override;
-  int read(void *buf, size_t maxlen, size_t *len) override;
+  int connect(nr_transport_addr* addr) override;
+  int write(const void* msg, size_t len, size_t* written) override;
+  int read(void* buf, size_t maxlen, size_t* len) override;
 
   int listen(int backlog) override;
-  int accept(nr_transport_addr *addrp, nr_socket **sockp) override;
-  int async_wait(int how, NR_async_cb cb, void *cb_arg, char *function,
+  int accept(nr_transport_addr* addrp, nr_socket** sockp) override;
+  int async_wait(int how, NR_async_cb cb, void* cb_arg, char* function,
                  int line) override;
   int cancel(int how) override;
 
@@ -237,12 +237,12 @@ class TestNrSocket : public NrSocketBase {
 
   class UdpPacket {
    public:
-    UdpPacket(const void *msg, size_t len, const nr_transport_addr &addr)
+    UdpPacket(const void* msg, size_t len, const nr_transport_addr& addr)
         : buffer_(new MediaPacket) {
-      buffer_->Copy(static_cast(msg), len);
+      buffer_->Copy(static_cast(msg), len);
       // TODO(bug 1170299): Remove const_cast when no longer necessary
       nr_transport_addr_copy(&remote_address_,
-                             const_cast(&addr));
+                             const_cast(&addr));
     }
 
     nr_transport_addr remote_address_;
@@ -256,11 +256,11 @@ class TestNrSocket : public NrSocketBase {
 
   class PortMapping {
    public:
-    PortMapping(const nr_transport_addr &remote_address,
-                const RefPtr &external_socket);
+    PortMapping(const nr_transport_addr& remote_address,
+                const RefPtr& external_socket);
 
-    int sendto(const void *msg, size_t len, const nr_transport_addr &to);
-    int async_wait(int how, NR_async_cb cb, void *cb_arg, char *function,
+    int sendto(const void* msg, size_t len, const nr_transport_addr& to);
+    int async_wait(int how, NR_async_cb cb, void* cb_arg, char* function,
                    int line);
     int cancel(int how);
     int send_from_queue();
@@ -281,52 +281,52 @@ class TestNrSocket : public NrSocketBase {
   };
 
   struct DeferredPacket {
-    DeferredPacket(TestNrSocket *sock, const void *data, size_t len, int flags,
-                   nr_transport_addr *addr,
+    DeferredPacket(TestNrSocket* sock, const void* data, size_t len, int flags,
+                   nr_transport_addr* addr,
                    RefPtr internal_socket)
         : socket_(sock),
           buffer_(),
           flags_(flags),
           internal_socket_(internal_socket) {
-      buffer_.Copy(reinterpret_cast(data), len);
+      buffer_.Copy(reinterpret_cast(data), len);
       nr_transport_addr_copy(&to_, addr);
     }
 
-    TestNrSocket *socket_;
+    TestNrSocket* socket_;
     MediaPacket buffer_;
     int flags_;
     nr_transport_addr to_;
     RefPtr internal_socket_;
   };
 
-  bool is_port_mapping_stale(const PortMapping &port_mapping) const;
-  bool allow_ingress(const nr_transport_addr &from,
-                     PortMapping **port_mapping_used) const;
+  bool is_port_mapping_stale(const PortMapping& port_mapping) const;
+  bool allow_ingress(const nr_transport_addr& from,
+                     PortMapping** port_mapping_used) const;
   void destroy_stale_port_mappings();
 
-  static void socket_readable_callback(void *real_sock_v, int how,
-                                       void *test_sock_v);
-  void on_socket_readable(NrSocketBase *external_or_internal_socket);
+  static void socket_readable_callback(void* real_sock_v, int how,
+                                       void* test_sock_v);
+  void on_socket_readable(NrSocketBase* external_or_internal_socket);
   void fire_readable_callback();
 
-  static void port_mapping_tcp_passthrough_callback(void *ext_sock_v, int how,
-                                                    void *test_sock_v);
+  static void port_mapping_tcp_passthrough_callback(void* ext_sock_v, int how,
+                                                    void* test_sock_v);
   void cancel_port_mapping_async_wait(int how);
 
-  static void port_mapping_writeable_callback(void *ext_sock_v, int how,
-                                              void *test_sock_v);
-  void write_to_port_mapping(NrSocketBase *external_socket);
+  static void port_mapping_writeable_callback(void* ext_sock_v, int how,
+                                              void* test_sock_v);
+  void write_to_port_mapping(NrSocketBase* external_socket);
   bool is_tcp_connection_behind_nat() const;
 
-  PortMapping *get_port_mapping(const nr_transport_addr &remote_addr,
+  PortMapping* get_port_mapping(const nr_transport_addr& remote_addr,
                                 TestNat::NatBehavior filter) const;
-  PortMapping *create_port_mapping(
-      const nr_transport_addr &remote_addr,
-      const RefPtr &external_socket) const;
+  PortMapping* create_port_mapping(
+      const nr_transport_addr& remote_addr,
+      const RefPtr& external_socket) const;
   RefPtr create_external_socket(
-      const nr_transport_addr &remote_addr) const;
+      const nr_transport_addr& remote_addr) const;
 
-  static void process_delayed_cb(NR_SOCKET s, int how, void *cb_arg);
+  static void process_delayed_cb(NR_SOCKET s, int how, void* cb_arg);
 
   RefPtr readable_socket_;
   // The socket for the "internal" address; used to talk to stuff behind the
@@ -340,7 +340,7 @@ class TestNrSocket : public NrSocketBase {
   // small anyway, we just brute-force it.
   std::list> port_mappings_;
 
-  void *timer_handle_;
+  void* timer_handle_;
 };
 
 }  // namespace mozilla
diff --git a/media/mtransport/transportflow.h b/media/mtransport/transportflow.h
index 83ed8ca3f3f9e..e6b26222a0b7c 100644
--- a/media/mtransport/transportflow.h
+++ b/media/mtransport/transportflow.h
@@ -51,11 +51,11 @@ namespace mozilla {
 class TransportFlow final : public nsISupports {
  public:
   TransportFlow()
-      : id_("(anonymous)"), layers_(new std::deque) {}
+      : id_("(anonymous)"), layers_(new std::deque) {}
   explicit TransportFlow(const std::string id)
-      : id_(id), layers_(new std::deque) {}
+      : id_(id), layers_(new std::deque) {}
 
-  const std::string &id() const { return id_; }
+  const std::string& id() const { return id_; }
 
   // Layer management. Note PushLayer() is not thread protected, so
   // either:
@@ -64,9 +64,9 @@ class TransportFlow final : public nsISupports {
   //
   // The flow takes ownership of the layers after a successful
   // push.
-  void PushLayer(TransportLayer *layer);
+  void PushLayer(TransportLayer* layer);
 
-  TransportLayer *GetLayer(const std::string &id) const;
+  TransportLayer* GetLayer(const std::string& id) const;
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
@@ -90,15 +90,15 @@ class TransportFlow final : public nsISupports {
     return on;
   }
 
-  void EnsureSameThread(TransportLayer *layer);
+  void EnsureSameThread(TransportLayer* layer);
 
-  static void DestroyFinal(nsAutoPtr> layers);
+  static void DestroyFinal(nsAutoPtr> layers);
 
   // Overload needed because we use deque internally and queue externally.
-  static void ClearLayers(std::deque *layers);
+  static void ClearLayers(std::deque* layers);
 
   std::string id_;
-  UniquePtr> layers_;
+  UniquePtr> layers_;
   nsCOMPtr target_;
 };
 
diff --git a/media/mtransport/transportlayer.cpp b/media/mtransport/transportlayer.cpp
index 44a4c70a1e893..619d2348aec47 100644
--- a/media/mtransport/transportlayer.cpp
+++ b/media/mtransport/transportlayer.cpp
@@ -29,7 +29,7 @@ nsresult TransportLayer::Init() {
   return NS_OK;
 }
 
-void TransportLayer::Chain(TransportLayer *downward) {
+void TransportLayer::Chain(TransportLayer* downward) {
   downward_ = downward;
   MOZ_MTLOG(ML_DEBUG, LAYER_INFO << "Inserted: downward='"
                                  << (downward ? downward->id() : "none")
@@ -38,7 +38,7 @@ void TransportLayer::Chain(TransportLayer *downward) {
   WasInserted();
 }
 
-void TransportLayer::SetState(State state, const char *file, unsigned line) {
+void TransportLayer::SetState(State state, const char* file, unsigned line) {
   if (state != state_) {
     MOZ_MTLOG(state == TS_ERROR ? ML_ERROR : ML_DEBUG,
               file << ":" << line << ": " << LAYER_INFO << "state " << state_
diff --git a/media/mtransport/transportlayer.h b/media/mtransport/transportlayer.h
index 19d9b297f9f13..3faef44fa53da 100644
--- a/media/mtransport/transportlayer.h
+++ b/media/mtransport/transportlayer.h
@@ -47,42 +47,42 @@ class TransportLayer : public sigslot::has_slots<> {
   nsresult Init();  // Called by Insert() to set up -- do not override
   virtual nsresult InitInternal() { return NS_OK; }  // Called by Init
 
-  void SetFlowId(const std::string &flow_id) { flow_id_ = flow_id; }
+  void SetFlowId(const std::string& flow_id) { flow_id_ = flow_id; }
 
-  virtual void Chain(TransportLayer *downward);
+  virtual void Chain(TransportLayer* downward);
 
   // Downward interface
-  TransportLayer *downward() { return downward_; }
+  TransportLayer* downward() { return downward_; }
 
   // Get the state
   State state() const { return state_; }
   // Must be implemented by derived classes
-  virtual TransportResult SendPacket(MediaPacket &packet) = 0;
+  virtual TransportResult SendPacket(MediaPacket& packet) = 0;
 
   // Get the thread.
   const nsCOMPtr GetThread() const { return target_; }
 
   // Event definitions that one can register for
   // State has changed
-  sigslot::signal2 SignalStateChange;
+  sigslot::signal2 SignalStateChange;
   // Data received on the flow
-  sigslot::signal2 SignalPacketReceived;
+  sigslot::signal2 SignalPacketReceived;
 
   // Return the layer id for this layer
   virtual const std::string id() const = 0;
 
   // The id of the flow
-  const std::string &flow_id() const { return flow_id_; }
+  const std::string& flow_id() const { return flow_id_; }
 
  protected:
   virtual void WasInserted() {}
-  virtual void SetState(State state, const char *file, unsigned line);
+  virtual void SetState(State state, const char* file, unsigned line);
   // Check if we are on the right thread
   void CheckThread() const { MOZ_ASSERT(CheckThreadInt(), "Wrong thread"); }
 
   State state_;
   std::string flow_id_;
-  TransportLayer *downward_;  // The next layer in the stack
+  TransportLayer* downward_;  // The next layer in the stack
   nsCOMPtr target_;
 
  private:
diff --git a/media/mtransport/transportlayerdtls.cpp b/media/mtransport/transportlayerdtls.cpp
index 752af3a05e407..ae22417642330 100644
--- a/media/mtransport/transportlayerdtls.cpp
+++ b/media/mtransport/transportlayerdtls.cpp
@@ -60,19 +60,19 @@ static PRDescIdentity transport_layer_identity = PR_INVALID_IO_LAYER;
 // All of this stuff is assumed to happen solely in a single thread
 // (generally the SocketTransportService thread)
 
-void TransportLayerNSPRAdapter::PacketReceived(MediaPacket &packet) {
+void TransportLayerNSPRAdapter::PacketReceived(MediaPacket& packet) {
   if (enabled_) {
     input_.push(new MediaPacket(std::move(packet)));
   }
 }
 
-int32_t TransportLayerNSPRAdapter::Recv(void *buf, int32_t buflen) {
+int32_t TransportLayerNSPRAdapter::Recv(void* buf, int32_t buflen) {
   if (input_.empty()) {
     PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
     return -1;
   }
 
-  MediaPacket *front = input_.front();
+  MediaPacket* front = input_.front();
   int32_t count = static_cast(front->len());
 
   if (buflen < count) {
@@ -89,7 +89,7 @@ int32_t TransportLayerNSPRAdapter::Recv(void *buf, int32_t buflen) {
   return count;
 }
 
-int32_t TransportLayerNSPRAdapter::Write(const void *buf, int32_t length) {
+int32_t TransportLayerNSPRAdapter::Write(const void* buf, int32_t length) {
   if (!enabled_) {
     MOZ_MTLOG(ML_WARNING, "Writing to disabled transport layer");
     return -1;
@@ -97,7 +97,7 @@ int32_t TransportLayerNSPRAdapter::Write(const void *buf, int32_t length) {
 
   MediaPacket packet;
   // Copies. Oh well.
-  packet.Copy(static_cast(buf), static_cast(length));
+  packet.Copy(static_cast(buf), static_cast(length));
   packet.SetType(MediaPacket::DTLS);
 
   TransportResult r = output_->SendPacket(packet);
@@ -115,100 +115,100 @@ int32_t TransportLayerNSPRAdapter::Write(const void *buf, int32_t length) {
 }
 
 // Implementation of NSPR methods
-static PRStatus TransportLayerClose(PRFileDesc *f) {
+static PRStatus TransportLayerClose(PRFileDesc* f) {
   f->dtor(f);
   return PR_SUCCESS;
 }
 
-static int32_t TransportLayerRead(PRFileDesc *f, void *buf, int32_t length) {
+static int32_t TransportLayerRead(PRFileDesc* f, void* buf, int32_t length) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static int32_t TransportLayerWrite(PRFileDesc *f, const void *buf,
+static int32_t TransportLayerWrite(PRFileDesc* f, const void* buf,
                                    int32_t length) {
-  TransportLayerNSPRAdapter *io =
-      reinterpret_cast(f->secret);
+  TransportLayerNSPRAdapter* io =
+      reinterpret_cast(f->secret);
   return io->Write(buf, length);
 }
 
-static int32_t TransportLayerAvailable(PRFileDesc *f) {
+static int32_t TransportLayerAvailable(PRFileDesc* f) {
   UNIMPLEMENTED;
   return -1;
 }
 
-int64_t TransportLayerAvailable64(PRFileDesc *f) {
+int64_t TransportLayerAvailable64(PRFileDesc* f) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static PRStatus TransportLayerSync(PRFileDesc *f) {
+static PRStatus TransportLayerSync(PRFileDesc* f) {
   UNIMPLEMENTED;
   return PR_FAILURE;
 }
 
-static int32_t TransportLayerSeek(PRFileDesc *f, int32_t offset,
+static int32_t TransportLayerSeek(PRFileDesc* f, int32_t offset,
                                   PRSeekWhence how) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static int64_t TransportLayerSeek64(PRFileDesc *f, int64_t offset,
+static int64_t TransportLayerSeek64(PRFileDesc* f, int64_t offset,
                                     PRSeekWhence how) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static PRStatus TransportLayerFileInfo(PRFileDesc *f, PRFileInfo *info) {
+static PRStatus TransportLayerFileInfo(PRFileDesc* f, PRFileInfo* info) {
   UNIMPLEMENTED;
   return PR_FAILURE;
 }
 
-static PRStatus TransportLayerFileInfo64(PRFileDesc *f, PRFileInfo64 *info) {
+static PRStatus TransportLayerFileInfo64(PRFileDesc* f, PRFileInfo64* info) {
   UNIMPLEMENTED;
   return PR_FAILURE;
 }
 
-static int32_t TransportLayerWritev(PRFileDesc *f, const PRIOVec *iov,
+static int32_t TransportLayerWritev(PRFileDesc* f, const PRIOVec* iov,
                                     int32_t iov_size, PRIntervalTime to) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static PRStatus TransportLayerConnect(PRFileDesc *f, const PRNetAddr *addr,
+static PRStatus TransportLayerConnect(PRFileDesc* f, const PRNetAddr* addr,
                                       PRIntervalTime to) {
   UNIMPLEMENTED;
   return PR_FAILURE;
 }
 
-static PRFileDesc *TransportLayerAccept(PRFileDesc *sd, PRNetAddr *addr,
+static PRFileDesc* TransportLayerAccept(PRFileDesc* sd, PRNetAddr* addr,
                                         PRIntervalTime to) {
   UNIMPLEMENTED;
   return nullptr;
 }
 
-static PRStatus TransportLayerBind(PRFileDesc *f, const PRNetAddr *addr) {
+static PRStatus TransportLayerBind(PRFileDesc* f, const PRNetAddr* addr) {
   UNIMPLEMENTED;
   return PR_FAILURE;
 }
 
-static PRStatus TransportLayerListen(PRFileDesc *f, int32_t depth) {
+static PRStatus TransportLayerListen(PRFileDesc* f, int32_t depth) {
   UNIMPLEMENTED;
   return PR_FAILURE;
 }
 
-static PRStatus TransportLayerShutdown(PRFileDesc *f, int32_t how) {
+static PRStatus TransportLayerShutdown(PRFileDesc* f, int32_t how) {
   // This is only called from NSS when we are the server and the client refuses
   // to provide a certificate.  In this case, the handshake is destined for
   // failure, so we will just let this pass.
-  TransportLayerNSPRAdapter *io =
-      reinterpret_cast(f->secret);
+  TransportLayerNSPRAdapter* io =
+      reinterpret_cast(f->secret);
   io->SetEnabled(false);
   return PR_SUCCESS;
 }
 
 // This function does not support peek, or waiting until `to`
-static int32_t TransportLayerRecv(PRFileDesc *f, void *buf, int32_t buflen,
+static int32_t TransportLayerRecv(PRFileDesc* f, void* buf, int32_t buflen,
                                   int32_t flags, PRIntervalTime to) {
   MOZ_ASSERT(flags == 0);
   if (flags != 0) {
@@ -216,55 +216,55 @@ static int32_t TransportLayerRecv(PRFileDesc *f, void *buf, int32_t buflen,
     return -1;
   }
 
-  TransportLayerNSPRAdapter *io =
-      reinterpret_cast(f->secret);
+  TransportLayerNSPRAdapter* io =
+      reinterpret_cast(f->secret);
   return io->Recv(buf, buflen);
 }
 
 // Note: this is always nonblocking and assumes a zero timeout.
-static int32_t TransportLayerSend(PRFileDesc *f, const void *buf,
+static int32_t TransportLayerSend(PRFileDesc* f, const void* buf,
                                   int32_t amount, int32_t flags,
                                   PRIntervalTime to) {
   int32_t written = TransportLayerWrite(f, buf, amount);
   return written;
 }
 
-static int32_t TransportLayerRecvfrom(PRFileDesc *f, void *buf, int32_t amount,
-                                      int32_t flags, PRNetAddr *addr,
+static int32_t TransportLayerRecvfrom(PRFileDesc* f, void* buf, int32_t amount,
+                                      int32_t flags, PRNetAddr* addr,
                                       PRIntervalTime to) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static int32_t TransportLayerSendto(PRFileDesc *f, const void *buf,
+static int32_t TransportLayerSendto(PRFileDesc* f, const void* buf,
                                     int32_t amount, int32_t flags,
-                                    const PRNetAddr *addr, PRIntervalTime to) {
+                                    const PRNetAddr* addr, PRIntervalTime to) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static int16_t TransportLayerPoll(PRFileDesc *f, int16_t in_flags,
-                                  int16_t *out_flags) {
+static int16_t TransportLayerPoll(PRFileDesc* f, int16_t in_flags,
+                                  int16_t* out_flags) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static int32_t TransportLayerAcceptRead(PRFileDesc *sd, PRFileDesc **nd,
-                                        PRNetAddr **raddr, void *buf,
+static int32_t TransportLayerAcceptRead(PRFileDesc* sd, PRFileDesc** nd,
+                                        PRNetAddr** raddr, void* buf,
                                         int32_t amount, PRIntervalTime t) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static int32_t TransportLayerTransmitFile(PRFileDesc *sd, PRFileDesc *f,
-                                          const void *headers, int32_t hlen,
+static int32_t TransportLayerTransmitFile(PRFileDesc* sd, PRFileDesc* f,
+                                          const void* headers, int32_t hlen,
                                           PRTransmitFileFlags flags,
                                           PRIntervalTime t) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static PRStatus TransportLayerGetpeername(PRFileDesc *f, PRNetAddr *addr) {
+static PRStatus TransportLayerGetpeername(PRFileDesc* f, PRNetAddr* addr) {
   // TODO: Modify to return unique names for each channel
   // somehow, as opposed to always the same static address. The current
   // implementation messes up the session cache, which is why it's off
@@ -276,13 +276,13 @@ static PRStatus TransportLayerGetpeername(PRFileDesc *f, PRNetAddr *addr) {
   return PR_SUCCESS;
 }
 
-static PRStatus TransportLayerGetsockname(PRFileDesc *f, PRNetAddr *addr) {
+static PRStatus TransportLayerGetsockname(PRFileDesc* f, PRNetAddr* addr) {
   UNIMPLEMENTED;
   return PR_FAILURE;
 }
 
-static PRStatus TransportLayerGetsockoption(PRFileDesc *f,
-                                            PRSocketOptionData *opt) {
+static PRStatus TransportLayerGetsockoption(PRFileDesc* f,
+                                            PRSocketOptionData* opt) {
   switch (opt->option) {
     case PR_SockOpt_Nonblocking:
       opt->value.non_blocking = PR_TRUE;
@@ -296,8 +296,8 @@ static PRStatus TransportLayerGetsockoption(PRFileDesc *f,
 }
 
 // Imitate setting socket options. These are mostly noops.
-static PRStatus TransportLayerSetsockoption(PRFileDesc *f,
-                                            const PRSocketOptionData *opt) {
+static PRStatus TransportLayerSetsockoption(PRFileDesc* f,
+                                            const PRSocketOptionData* opt) {
   switch (opt->option) {
     case PR_SockOpt_Nonblocking:
       return PR_SUCCESS;
@@ -311,19 +311,19 @@ static PRStatus TransportLayerSetsockoption(PRFileDesc *f,
   return PR_FAILURE;
 }
 
-static int32_t TransportLayerSendfile(PRFileDesc *out, PRSendFileData *in,
+static int32_t TransportLayerSendfile(PRFileDesc* out, PRSendFileData* in,
                                       PRTransmitFileFlags flags,
                                       PRIntervalTime to) {
   UNIMPLEMENTED;
   return -1;
 }
 
-static PRStatus TransportLayerConnectContinue(PRFileDesc *f, int16_t flags) {
+static PRStatus TransportLayerConnectContinue(PRFileDesc* f, int16_t flags) {
   UNIMPLEMENTED;
   return PR_FAILURE;
 }
 
-static int32_t TransportLayerReserved(PRFileDesc *f) {
+static int32_t TransportLayerReserved(PRFileDesc* f) {
   UNIMPLEMENTED;
   return -1;
 }
@@ -409,8 +409,8 @@ void TransportLayerDtls::WasInserted() {
 // if ALPN is not negotiated.
 // Note: we only support Unicode strings here, which are encoded into UTF-8,
 // even though ALPN ostensibly allows arbitrary octet sequences.
-nsresult TransportLayerDtls::SetAlpn(const std::set &alpn_allowed,
-                                     const std::string &alpn_default) {
+nsresult TransportLayerDtls::SetAlpn(const std::set& alpn_allowed,
+                                     const std::string& alpn_default) {
   alpn_allowed_ = alpn_allowed;
   alpn_default_ = alpn_default;
 
@@ -426,7 +426,7 @@ nsresult TransportLayerDtls::SetVerificationAllowAll() {
   return NS_OK;
 }
 
-nsresult TransportLayerDtls::SetVerificationDigest(const DtlsDigest &digest) {
+nsresult TransportLayerDtls::SetVerificationDigest(const DtlsDigest& digest) {
   // Defensive programming
   if (verification_mode_ != VERIFY_UNSET &&
       verification_mode_ != VERIFY_DIGEST) {
@@ -474,7 +474,7 @@ bool TransportLayerDtls::Setup() {
       PR_CreateIOLayerStub(transport_layer_identity, &TransportLayerMethods));
   MOZ_ASSERT(pr_fd != nullptr);
   if (!pr_fd) return false;
-  pr_fd->secret = reinterpret_cast(nspr_io_adapter_.get());
+  pr_fd->secret = reinterpret_cast(nspr_io_adapter_.get());
 
   UniquePRFileDesc ssl_fd(DTLS_ImportFD(nullptr, pr_fd.get()));
   MOZ_ASSERT(ssl_fd != nullptr);  // This should never happen
@@ -590,7 +590,7 @@ bool TransportLayerDtls::Setup() {
 
   // Certificate validation
   rv = SSL_AuthCertificateHook(ssl_fd.get(), AuthCertificateHook,
-                               reinterpret_cast(this));
+                               reinterpret_cast(this));
   if (rv != SECSuccess) {
     MOZ_MTLOG(ML_ERROR, "Couldn't set certificate validation hook");
     return false;
@@ -621,7 +621,7 @@ bool TransportLayerDtls::Setup() {
   return true;
 }
 
-bool TransportLayerDtls::SetupAlpn(UniquePRFileDesc &ssl_fd) const {
+bool TransportLayerDtls::SetupAlpn(UniquePRFileDesc& ssl_fd) const {
   if (alpn_allowed_.empty()) {
     return true;
   }
@@ -640,7 +640,7 @@ bool TransportLayerDtls::SetupAlpn(UniquePRFileDesc &ssl_fd) const {
 
   unsigned char buf[MAX_ALPN_LENGTH];
   size_t offset = 0;
-  for (const auto &tag : alpn_allowed_) {
+  for (const auto& tag : alpn_allowed_) {
     if ((offset + 1 + tag.length()) >= sizeof(buf)) {
       MOZ_MTLOG(ML_ERROR, "ALPN too long");
       return false;
@@ -728,7 +728,7 @@ static const uint32_t DisabledCiphers[] = {
     TLS_RSA_WITH_NULL_MD5,
 };
 
-bool TransportLayerDtls::SetupCipherSuites(UniquePRFileDesc &ssl_fd) {
+bool TransportLayerDtls::SetupCipherSuites(UniquePRFileDesc& ssl_fd) {
   SECStatus rv;
 
   // Set the SRTP ciphers
@@ -742,7 +742,7 @@ bool TransportLayerDtls::SetupCipherSuites(UniquePRFileDesc &ssl_fd) {
     }
   }
 
-  for (const auto &cipher : EnabledCiphers) {
+  for (const auto& cipher : EnabledCiphers) {
     MOZ_MTLOG(ML_DEBUG, LAYER_INFO << "Enabling: " << cipher);
     rv = SSL_CipherPrefSet(ssl_fd.get(), cipher, PR_TRUE);
     if (rv != SECSuccess) {
@@ -751,7 +751,7 @@ bool TransportLayerDtls::SetupCipherSuites(UniquePRFileDesc &ssl_fd) {
     }
   }
 
-  for (const auto &cipher : DisabledCiphers) {
+  for (const auto& cipher : DisabledCiphers) {
     MOZ_MTLOG(ML_DEBUG, LAYER_INFO << "Disabling: " << cipher);
 
     PRBool enabled = false;
@@ -774,7 +774,7 @@ bool TransportLayerDtls::SetupCipherSuites(UniquePRFileDesc &ssl_fd) {
   return true;
 }
 
-nsresult TransportLayerDtls::GetCipherSuite(uint16_t *cipherSuite) const {
+nsresult TransportLayerDtls::GetCipherSuite(uint16_t* cipherSuite) const {
   CheckThread();
   if (!cipherSuite) {
     MOZ_MTLOG(ML_ERROR, LAYER_INFO << "GetCipherSuite passed a nullptr");
@@ -810,7 +810,7 @@ std::vector TransportLayerDtls::GetDefaultSrtpCiphers() {
   return ciphers;
 }
 
-void TransportLayerDtls::StateChange(TransportLayer *layer, State state) {
+void TransportLayerDtls::StateChange(TransportLayer* layer, State state) {
   switch (state) {
     case TS_NONE:
       MOZ_ASSERT(false);  // Can't happen
@@ -914,7 +914,7 @@ void TransportLayerDtls::Handshake() {
         }
         break;
       default:
-        const char *err_msg = PR_ErrorToName(err);
+        const char* err_msg = PR_ErrorToName(err);
         MOZ_MTLOG(ML_ERROR, LAYER_INFO << "DTLS handshake error " << err << " ("
                                        << err_msg << ")");
         TL_SET_STATE(TS_ERROR);
@@ -935,7 +935,7 @@ bool TransportLayerDtls::CheckAlpn() {
   char chosenAlpn[MAX_ALPN_LENGTH];
   unsigned int chosenAlpnLen;
   SECStatus rv = SSL_GetNextProto(ssl_fd_.get(), &alpnState,
-                                  reinterpret_cast(chosenAlpn),
+                                  reinterpret_cast(chosenAlpn),
                                   &chosenAlpnLen, sizeof(chosenAlpn));
   if (rv != SECSuccess) {
     MOZ_MTLOG(ML_ERROR, LAYER_INFO << "ALPN error");
@@ -983,8 +983,8 @@ bool TransportLayerDtls::CheckAlpn() {
   return true;
 }
 
-void TransportLayerDtls::PacketReceived(TransportLayer *layer,
-                                        MediaPacket &packet) {
+void TransportLayerDtls::PacketReceived(TransportLayer* layer,
+                                        MediaPacket& packet) {
   CheckThread();
   MOZ_MTLOG(ML_DEBUG, LAYER_INFO << "PacketReceived(" << packet.len() << ")");
 
@@ -1048,7 +1048,7 @@ void TransportLayerDtls::GetDecryptedPackets() {
   }
 }
 
-void TransportLayerDtls::SetState(State state, const char *file,
+void TransportLayerDtls::SetState(State state, const char* file,
                                   unsigned line) {
   if (timer_) {
     switch (state) {
@@ -1073,7 +1073,7 @@ void TransportLayerDtls::SetState(State state, const char *file,
   TransportLayer::SetState(state, file, line);
 }
 
-TransportResult TransportLayerDtls::SendPacket(MediaPacket &packet) {
+TransportResult TransportLayerDtls::SendPacket(MediaPacket& packet) {
   CheckThread();
   if (state_ != TS_OPEN) {
     MOZ_MTLOG(ML_ERROR,
@@ -1109,11 +1109,11 @@ TransportResult TransportLayerDtls::SendPacket(MediaPacket &packet) {
 }
 
 SECStatus TransportLayerDtls::GetClientAuthDataHook(
-    void *arg, PRFileDesc *fd, CERTDistNames *caNames,
-    CERTCertificate **pRetCert, SECKEYPrivateKey **pRetKey) {
+    void* arg, PRFileDesc* fd, CERTDistNames* caNames,
+    CERTCertificate** pRetCert, SECKEYPrivateKey** pRetKey) {
   MOZ_MTLOG(ML_DEBUG, "Server requested client auth");
 
-  TransportLayerDtls *stream = reinterpret_cast(arg);
+  TransportLayerDtls* stream = reinterpret_cast(arg);
   stream->CheckThread();
 
   if (!stream->identity_) {
@@ -1140,12 +1140,12 @@ SECStatus TransportLayerDtls::GetClientAuthDataHook(
 }
 
 nsresult TransportLayerDtls::SetSrtpCiphers(
-    const std::vector &ciphers) {
+    const std::vector& ciphers) {
   enabled_srtp_ciphers_ = std::move(ciphers);
   return NS_OK;
 }
 
-nsresult TransportLayerDtls::GetSrtpCipher(uint16_t *cipher) const {
+nsresult TransportLayerDtls::GetSrtpCipher(uint16_t* cipher) const {
   CheckThread();
   if (srtp_cipher_ == 0) {
     return NS_ERROR_NOT_AVAILABLE;
@@ -1154,13 +1154,13 @@ nsresult TransportLayerDtls::GetSrtpCipher(uint16_t *cipher) const {
   return NS_OK;
 }
 
-static uint8_t *WriteUint16(uint8_t *cursor, uint16_t v) {
+static uint8_t* WriteUint16(uint8_t* cursor, uint16_t v) {
   *cursor++ = v >> 8;
   *cursor++ = v & 0xff;
   return cursor;
 }
 
-static SSLHandshakeType SrtpXtnServerMessage(PRFileDesc *fd) {
+static SSLHandshakeType SrtpXtnServerMessage(PRFileDesc* fd) {
   SSLPreliminaryChannelInfo preinfo;
   SECStatus rv = SSL_GetPreliminaryChannelInfo(fd, &preinfo, sizeof(preinfo));
   if (rv != SECSuccess) {
@@ -1173,11 +1173,11 @@ static SSLHandshakeType SrtpXtnServerMessage(PRFileDesc *fd) {
 }
 
 /* static */
-PRBool TransportLayerDtls::WriteSrtpXtn(PRFileDesc *fd,
-                                        SSLHandshakeType message, uint8_t *data,
-                                        unsigned int *len, unsigned int max_len,
-                                        void *arg) {
-  auto self = reinterpret_cast(arg);
+PRBool TransportLayerDtls::WriteSrtpXtn(PRFileDesc* fd,
+                                        SSLHandshakeType message, uint8_t* data,
+                                        unsigned int* len, unsigned int max_len,
+                                        void* arg) {
+  auto self = reinterpret_cast(arg);
 
   // ClientHello: send all supported versions.
   if (message == ssl_hs_client_hello) {
@@ -1189,7 +1189,7 @@ PRBool TransportLayerDtls::WriteSrtpXtn(PRFileDesc *fd,
       MOZ_ASSERT(false, "Not enough space to send SRTP extension");
       return false;
     }
-    uint8_t *cursor = WriteUint16(data, self->enabled_srtp_ciphers_.size() * 2);
+    uint8_t* cursor = WriteUint16(data, self->enabled_srtp_ciphers_.size() * 2);
     for (auto cs : self->enabled_srtp_ciphers_) {
       cursor = WriteUint16(cursor, cs);
     }
@@ -1209,7 +1209,7 @@ PRBool TransportLayerDtls::WriteSrtpXtn(PRFileDesc *fd,
       return false;
     }
 
-    uint8_t *cursor = WriteUint16(data, 2);  // Length = 2.
+    uint8_t* cursor = WriteUint16(data, 2);  // Length = 2.
     cursor = WriteUint16(cursor, self->srtp_cipher_);
     *cursor++ = 0;  // No MKI
     *len = cursor - data;
@@ -1221,14 +1221,14 @@ PRBool TransportLayerDtls::WriteSrtpXtn(PRFileDesc *fd,
 
 class TlsParser {
  public:
-  TlsParser(const uint8_t *data, size_t len) : cursor_(data), remaining_(len) {}
+  TlsParser(const uint8_t* data, size_t len) : cursor_(data), remaining_(len) {}
 
   bool error() const { return error_; }
   size_t remaining() const { return remaining_; }
 
   template ::value>::type>
-  void Read(T *v, size_t sz = sizeof(T)) {
+  void Read(T* v, size_t sz = sizeof(T)) {
     MOZ_ASSERT(sz <= sizeof(T),
                "Type is too small to hold the value requested");
     if (remaining_ < sz) {
@@ -1246,7 +1246,7 @@ class TlsParser {
 
   template ::value>::type>
-  void ReadVector(std::vector *v, size_t w) {
+  void ReadVector(std::vector* v, size_t w) {
     MOZ_ASSERT(v->empty(), "vector needs to be empty");
 
     uint32_t len;
@@ -1284,21 +1284,21 @@ class TlsParser {
   }
 
  private:
-  const uint8_t *cursor_;
+  const uint8_t* cursor_;
   size_t remaining_;
   bool error_ = false;
 };
 
 /* static */
 SECStatus TransportLayerDtls::HandleSrtpXtn(
-    PRFileDesc *fd, SSLHandshakeType message, const uint8_t *data,
-    unsigned int len, SSLAlertDescription *alert, void *arg) {
+    PRFileDesc* fd, SSLHandshakeType message, const uint8_t* data,
+    unsigned int len, SSLAlertDescription* alert, void* arg) {
   static const uint8_t kTlsAlertHandshakeFailure = 40;
   static const uint8_t kTlsAlertIllegalParameter = 47;
   static const uint8_t kTlsAlertDecodeError = 50;
   static const uint8_t kTlsAlertUnsupportedExtension = 110;
 
-  auto self = reinterpret_cast(arg);
+  auto self = reinterpret_cast(arg);
 
   // Parse the extension.
   TlsParser parser(data, len);
@@ -1346,10 +1346,10 @@ SECStatus TransportLayerDtls::HandleSrtpXtn(
   return SECFailure;
 }
 
-nsresult TransportLayerDtls::ExportKeyingMaterial(const std::string &label,
+nsresult TransportLayerDtls::ExportKeyingMaterial(const std::string& label,
                                                   bool use_context,
-                                                  const std::string &context,
-                                                  unsigned char *out,
+                                                  const std::string& context,
+                                                  unsigned char* out,
                                                   unsigned int outlen) {
   CheckThread();
   if (state_ != TS_OPEN) {
@@ -1358,7 +1358,7 @@ nsresult TransportLayerDtls::ExportKeyingMaterial(const std::string &label,
   }
   SECStatus rv = SSL_ExportKeyingMaterial(
       ssl_fd_.get(), label.c_str(), label.size(), use_context,
-      reinterpret_cast(context.c_str()), context.size(),
+      reinterpret_cast(context.c_str()), context.size(),
       out, outlen);
   if (rv != SECSuccess) {
     MOZ_MTLOG(ML_ERROR, "Couldn't export SSL keying material");
@@ -1368,16 +1368,16 @@ nsresult TransportLayerDtls::ExportKeyingMaterial(const std::string &label,
   return NS_OK;
 }
 
-SECStatus TransportLayerDtls::AuthCertificateHook(void *arg, PRFileDesc *fd,
+SECStatus TransportLayerDtls::AuthCertificateHook(void* arg, PRFileDesc* fd,
                                                   PRBool checksig,
                                                   PRBool isServer) {
-  TransportLayerDtls *stream = reinterpret_cast(arg);
+  TransportLayerDtls* stream = reinterpret_cast(arg);
   stream->CheckThread();
   return stream->AuthCertificateHook(fd, checksig, isServer);
 }
 
 SECStatus TransportLayerDtls::CheckDigest(
-    const DtlsDigest &digest, UniqueCERTCertificate &peer_cert) const {
+    const DtlsDigest& digest, UniqueCERTCertificate& peer_cert) const {
   DtlsDigest computed_digest(digest.algorithm_);
 
   MOZ_MTLOG(ML_DEBUG,
@@ -1400,7 +1400,7 @@ SECStatus TransportLayerDtls::CheckDigest(
   return SECSuccess;
 }
 
-SECStatus TransportLayerDtls::AuthCertificateHook(PRFileDesc *fd,
+SECStatus TransportLayerDtls::AuthCertificateHook(PRFileDesc* fd,
                                                   PRBool checksig,
                                                   PRBool isServer) {
   CheckThread();
@@ -1450,8 +1450,8 @@ SECStatus TransportLayerDtls::AuthCertificateHook(PRFileDesc *fd,
   return SECFailure;
 }
 
-void TransportLayerDtls::TimerCallback(nsITimer *timer, void *arg) {
-  TransportLayerDtls *dtls = reinterpret_cast(arg);
+void TransportLayerDtls::TimerCallback(nsITimer* timer, void* arg) {
+  TransportLayerDtls* dtls = reinterpret_cast(arg);
 
   MOZ_MTLOG(ML_DEBUG, "DTLS timer expired");
 
diff --git a/media/mtransport/transportlayerice.cpp b/media/mtransport/transportlayerice.cpp
index ea85885bb0b32..1dcd3b5eee29a 100644
--- a/media/mtransport/transportlayerice.cpp
+++ b/media/mtransport/transportlayerice.cpp
@@ -120,7 +120,7 @@ void TransportLayerIce::PostSetup() {
   }
 }
 
-TransportResult TransportLayerIce::SendPacket(MediaPacket &packet) {
+TransportResult TransportLayerIce::SendPacket(MediaPacket& packet) {
   CheckThread();
   SignalPacketSending(this, packet);
   nsresult res = stream_->SendPacket(component_, packet.data(), packet.len());
@@ -135,12 +135,12 @@ TransportResult TransportLayerIce::SendPacket(MediaPacket &packet) {
   return packet.len();
 }
 
-void TransportLayerIce::IceCandidate(NrIceMediaStream *stream,
-                                     const std::string &) {
+void TransportLayerIce::IceCandidate(NrIceMediaStream* stream,
+                                     const std::string&) {
   // NO-OP for now
 }
 
-void TransportLayerIce::IceReady(NrIceMediaStream *stream) {
+void TransportLayerIce::IceReady(NrIceMediaStream* stream) {
   CheckThread();
   // only handle the current stream (not the old stream during restart)
   if (stream != stream_) {
@@ -151,7 +151,7 @@ void TransportLayerIce::IceReady(NrIceMediaStream *stream) {
   TL_SET_STATE(TS_OPEN);
 }
 
-void TransportLayerIce::IceFailed(NrIceMediaStream *stream) {
+void TransportLayerIce::IceFailed(NrIceMediaStream* stream) {
   CheckThread();
   // only handle the current stream (not the old stream during restart)
   if (stream != stream_) {
@@ -162,9 +162,9 @@ void TransportLayerIce::IceFailed(NrIceMediaStream *stream) {
   TL_SET_STATE(TS_ERROR);
 }
 
-void TransportLayerIce::IcePacketReceived(NrIceMediaStream *stream,
+void TransportLayerIce::IcePacketReceived(NrIceMediaStream* stream,
                                           int component,
-                                          const unsigned char *data, int len) {
+                                          const unsigned char* data, int len) {
   CheckThread();
   // We get packets for both components, so ignore the ones that aren't
   // for us.
diff --git a/media/mtransport/transportlayerice.h b/media/mtransport/transportlayerice.h
index 7805b4a783a3b..194181e05c7da 100644
--- a/media/mtransport/transportlayerice.h
+++ b/media/mtransport/transportlayerice.h
@@ -40,17 +40,17 @@ class TransportLayerIce : public TransportLayer {
   void RestoreOldStream();  // called after unsuccessful ice restart
 
   // Transport layer overrides.
-  TransportResult SendPacket(MediaPacket &packet) override;
+  TransportResult SendPacket(MediaPacket& packet) override;
 
   // Slots for ICE
-  void IceCandidate(NrIceMediaStream *stream, const std::string &);
-  void IceReady(NrIceMediaStream *stream);
-  void IceFailed(NrIceMediaStream *stream);
-  void IcePacketReceived(NrIceMediaStream *stream, int component,
-                         const unsigned char *data, int len);
+  void IceCandidate(NrIceMediaStream* stream, const std::string&);
+  void IceReady(NrIceMediaStream* stream);
+  void IceFailed(NrIceMediaStream* stream);
+  void IcePacketReceived(NrIceMediaStream* stream, int component,
+                         const unsigned char* data, int len);
 
   // Useful for capturing encrypted packets
-  sigslot::signal2 SignalPacketSending;
+  sigslot::signal2 SignalPacketSending;
 
   TRANSPORT_LAYER_ID("ice")
 
diff --git a/media/mtransport/transportlayerloopback.h b/media/mtransport/transportlayerloopback.h
index 9725cee328ba6..7c31851eb2ee9 100644
--- a/media/mtransport/transportlayerloopback.h
+++ b/media/mtransport/transportlayerloopback.h
@@ -40,7 +40,7 @@ class TransportLayerLoopback : public TransportLayer {
 
   ~TransportLayerLoopback() {
     while (!packets_.empty()) {
-      MediaPacket *packet = packets_.front();
+      MediaPacket* packet = packets_.front();
       packets_.pop();
       delete packet;
     }
@@ -55,11 +55,11 @@ class TransportLayerLoopback : public TransportLayer {
   nsresult Init();
 
   // Connect to the other side
-  void Connect(TransportLayerLoopback *peer);
+  void Connect(TransportLayerLoopback* peer);
 
   // Disconnect
   void Disconnect() {
-    TransportLayerLoopback *peer = peer_;
+    TransportLayerLoopback* peer = peer_;
 
     peer_ = nullptr;
     if (peer) {
@@ -70,7 +70,7 @@ class TransportLayerLoopback : public TransportLayer {
   void CombinePackets(bool combine) { combinePackets_ = combine; }
 
   // Overrides for TransportLayer
-  TransportResult SendPacket(MediaPacket &packet) override;
+  TransportResult SendPacket(MediaPacket& packet) override;
 
   // Deliver queued packets
   void DeliverPackets();
@@ -84,7 +84,7 @@ class TransportLayerLoopback : public TransportLayer {
   // Fires every 100 ms
   class Deliverer : public nsITimerCallback, public nsINamed {
    public:
-    explicit Deliverer(TransportLayerLoopback *layer) : layer_(layer) {}
+    explicit Deliverer(TransportLayerLoopback* layer) : layer_(layer) {}
     void Detach() { layer_ = nullptr; }
 
     NS_DECL_THREADSAFE_ISUPPORTS
@@ -96,16 +96,16 @@ class TransportLayerLoopback : public TransportLayer {
 
     DISALLOW_COPY_ASSIGN(Deliverer);
 
-    TransportLayerLoopback *layer_;
+    TransportLayerLoopback* layer_;
   };
 
   // Queue a packet for delivery
-  nsresult QueuePacket(MediaPacket &packet);
+  nsresult QueuePacket(MediaPacket& packet);
 
-  TransportLayerLoopback *peer_;
+  TransportLayerLoopback* peer_;
   nsCOMPtr timer_;
-  std::queue packets_;
-  PRLock *packets_lock_;
+  std::queue packets_;
+  PRLock* packets_lock_;
   RefPtr deliverer_;
   bool combinePackets_;
 };
diff --git a/media/webrtc/signaling/fuzztest/sdp_parser_libfuzz.cpp b/media/webrtc/signaling/fuzztest/sdp_parser_libfuzz.cpp
index f05225d570f68..48272a8d32b79 100644
--- a/media/webrtc/signaling/fuzztest/sdp_parser_libfuzz.cpp
+++ b/media/webrtc/signaling/fuzztest/sdp_parser_libfuzz.cpp
@@ -17,10 +17,10 @@ using namespace mozilla;
 static mozilla::UniquePtr sdpPtr;
 static SipccSdpParser mParser;
 
-int FuzzingInitSdpParser(int *argc, char ***argv) { return 0; }
+int FuzzingInitSdpParser(int* argc, char*** argv) { return 0; }
 
-static int RunSdpParserFuzzing(const uint8_t *data, size_t size) {
-  std::string message(reinterpret_cast(data), size);
+static int RunSdpParserFuzzing(const uint8_t* data, size_t size) {
+  std::string message(reinterpret_cast(data), size);
 
   sdpPtr = mParser.Parse(message);
 
diff --git a/media/webrtc/signaling/src/common/NullDeleter.h b/media/webrtc/signaling/src/common/NullDeleter.h
index 7ea5ded736d30..76326c197e547 100644
--- a/media/webrtc/signaling/src/common/NullDeleter.h
+++ b/media/webrtc/signaling/src/common/NullDeleter.h
@@ -10,5 +10,5 @@
  * objects which are really raw pointers.
  */
 struct null_deleter {
-  void operator()(void const *) const {}
+  void operator()(void const*) const {}
 };
diff --git a/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp b/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
index b39a3c848cb0a..9cd5a833595aa 100644
--- a/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
+++ b/media/webrtc/signaling/src/common/browser_logging/WebRtcLog.cpp
@@ -23,8 +23,8 @@
 using mozilla::LogLevel;
 
 #if defined(ANDROID)
-static const char *default_tmp_dir = "/dev/null";
-static const char *default_log_name = "nspr";
+static const char* default_tmp_dir = "/dev/null";
+static const char* default_log_name = "nspr";
 #else  // Assume a POSIX environment
 NS_NAMED_LITERAL_CSTRING(default_log_name, "WebRTC.log");
 #endif
@@ -37,7 +37,7 @@ class LogSinkImpl : public rtc::LogSink {
   LogSinkImpl() {}
 
  private:
-  void OnLogMessage(const std::string &message) override {
+  void OnLogMessage(const std::string& message) override {
     MOZ_LOG(sWebRtcLog, LogLevel::Debug, ("%s", message.data()));
   }
 };
@@ -51,7 +51,7 @@ void GetWebRtcLogPrefs() {
 }
 
 mozilla::LogLevel CheckOverrides() {
-  mozilla::LogModule *log_info = sWebRtcLog;
+  mozilla::LogModule* log_info = sWebRtcLog;
   mozilla::LogLevel log_level = log_info->Level();
 
   log_info = sLogAEC;
diff --git a/media/webrtc/signaling/src/common/time_profiling/timecard.c b/media/webrtc/signaling/src/common/time_profiling/timecard.c
index a7a4ee309a7b2..c0218cb92d1ec 100644
--- a/media/webrtc/signaling/src/common/time_profiling/timecard.c
+++ b/media/webrtc/signaling/src/common/time_profiling/timecard.c
@@ -9,25 +9,25 @@
 #include "timecard.h"
 #include "mozilla/mozalloc.h"
 
-Timecard *create_timecard() {
-  Timecard *tc = moz_xcalloc(1, sizeof(Timecard));
+Timecard* create_timecard() {
+  Timecard* tc = moz_xcalloc(1, sizeof(Timecard));
   tc->entries_allocated = TIMECARD_INITIAL_TABLE_SIZE;
   tc->entries = moz_xcalloc(tc->entries_allocated, sizeof(TimecardEntry));
   tc->start_time = PR_Now();
   return tc;
 }
 
-void destroy_timecard(Timecard *tc) {
+void destroy_timecard(Timecard* tc) {
   free(tc->entries);
   free(tc);
 }
 
-void stamp_timecard(Timecard *tc, const char *event, const char *file,
-                    unsigned int line, const char *function) {
-  TimecardEntry *entry = NULL;
+void stamp_timecard(Timecard* tc, const char* event, const char* file,
+                    unsigned int line, const char* function) {
+  TimecardEntry* entry = NULL;
 
   /* Trim the path component from the filename */
-  const char *last_slash = file;
+  const char* last_slash = file;
   while (*file) {
     if (*file == '/' || *file == '\\') {
       last_slash = file;
@@ -56,9 +56,9 @@ void stamp_timecard(Timecard *tc, const char *event, const char *file,
   tc->curr_entry++;
 }
 
-void print_timecard(Timecard *tc) {
+void print_timecard(Timecard* tc) {
   size_t i;
-  TimecardEntry *entry;
+  TimecardEntry* entry;
   size_t event_width = 5;
   size_t file_width = 4;
   size_t function_width = 8;
diff --git a/media/webrtc/signaling/src/common/time_profiling/timecard.h b/media/webrtc/signaling/src/common/time_profiling/timecard.h
index 780c30dbfed06..38d4a8d1ec7b5 100644
--- a/media/webrtc/signaling/src/common/time_profiling/timecard.h
+++ b/media/webrtc/signaling/src/common/time_profiling/timecard.h
@@ -30,42 +30,42 @@ extern "C" {
 
 typedef struct {
   PRTime timestamp;
-  const char *event;
-  const char *file;
+  const char* event;
+  const char* file;
   unsigned int line;
-  const char *function;
+  const char* function;
 } TimecardEntry;
 
 typedef struct Timecard {
   size_t curr_entry;
   size_t entries_allocated;
-  TimecardEntry *entries;
+  TimecardEntry* entries;
   PRTime start_time;
 } Timecard;
 
 /**
  * Creates a new Timecard structure for tracking events.
  */
-Timecard *create_timecard();
+Timecard* create_timecard();
 
 /**
  * Frees the memory associated with a timecard. After returning, the
  * timecard pointed to by tc is no longer valid.
  */
-void destroy_timecard(Timecard *tc);
+void destroy_timecard(Timecard* tc);
 
 /**
  * Records a new event in the indicated timecard. This should not be
  * called directly; code should instead use the STAMP_TIMECARD macro,
  * above.
  */
-void stamp_timecard(Timecard *tc, const char *event, const char *file,
-                    unsigned int line, const char *function);
+void stamp_timecard(Timecard* tc, const char* event, const char* file,
+                    unsigned int line, const char* function);
 
 /**
  * Formats and outputs the contents of a timecard onto stdout.
  */
-void print_timecard(Timecard *tc);
+void print_timecard(Timecard* tc);
 
 #ifdef __cplusplus
 }
diff --git a/media/webrtc/signaling/src/sdp/SipccSdpParser.cpp b/media/webrtc/signaling/src/sdp/SipccSdpParser.cpp
index f03d6b1e6697b..e29bf81fe2b2f 100644
--- a/media/webrtc/signaling/src/sdp/SipccSdpParser.cpp
+++ b/media/webrtc/signaling/src/sdp/SipccSdpParser.cpp
@@ -16,19 +16,19 @@ namespace mozilla {
 
 extern "C" {
 
-void sipcc_sdp_parser_error_handler(void *context, uint32_t line,
-                                    const char *message) {
-  SdpErrorHolder *errorHolder = static_cast(context);
+void sipcc_sdp_parser_error_handler(void* context, uint32_t line,
+                                    const char* message) {
+  SdpErrorHolder* errorHolder = static_cast(context);
   std::string err(message);
   errorHolder->AddParseError(line, err);
 }
 
 }  // extern "C"
 
-UniquePtr SipccSdpParser::Parse(const std::string &sdpText) {
+UniquePtr SipccSdpParser::Parse(const std::string& sdpText) {
   ClearParseErrors();
 
-  sdp_conf_options_t *sipcc_config = sdp_init_config();
+  sdp_conf_options_t* sipcc_config = sdp_init_config();
   if (!sipcc_config) {
     return UniquePtr();
   }
@@ -53,13 +53,13 @@ UniquePtr SipccSdpParser::Parse(const std::string &sdpText) {
                                this);
 
   // Takes ownership of |sipcc_config| iff it succeeds
-  sdp_t *sdp = sdp_init_description(sipcc_config);
+  sdp_t* sdp = sdp_init_description(sipcc_config);
   if (!sdp) {
     sdp_free_config(sipcc_config);
     return UniquePtr();
   }
 
-  const char *rawString = sdpText.c_str();
+  const char* rawString = sdpText.c_str();
   sdp_result_e sdpres = sdp_parse(sdp, rawString, sdpText.length());
   if (sdpres != SDP_SUCCESS) {
     sdp_free_description(sdp);
diff --git a/memory/mozalloc/mozalloc_oom.cpp b/memory/mozalloc/mozalloc_oom.cpp
index 5e312a6a2928f..1b85027a895df 100644
--- a/memory/mozalloc/mozalloc_oom.cpp
+++ b/memory/mozalloc/mozalloc_oom.cpp
@@ -18,7 +18,7 @@ static mozalloc_oom_abort_handler gAbortHandler;
 #define OOM_MSG_LAST_DIGIT_OFFSET \
   sizeof(OOM_MSG_LEADER) + sizeof(OOM_MSG_DIGITS) - 3
 
-static const char *hex = "0123456789ABCDEF";
+static const char* hex = "0123456789ABCDEF";
 
 void mozalloc_handle_oom(size_t size) {
   char oomMsg[] = OOM_MSG_LEADER OOM_MSG_DIGITS OOM_MSG_TRAILER;
diff --git a/mfbt/MemoryChecking.h b/mfbt/MemoryChecking.h
index 29b0a9d03355f..eed75cd0586be 100644
--- a/mfbt/MemoryChecking.h
+++ b/mfbt/MemoryChecking.h
@@ -49,10 +49,10 @@ extern "C" {
 /* These definitions are usually provided through the
  * sanitizer/asan_interface.h header installed by ASan.
  */
-void MOZ_ASAN_VISIBILITY __asan_poison_memory_region(void const volatile *addr,
+void MOZ_ASAN_VISIBILITY __asan_poison_memory_region(void const volatile* addr,
                                                      size_t size);
 void MOZ_ASAN_VISIBILITY
-__asan_unpoison_memory_region(void const volatile *addr, size_t size);
+__asan_unpoison_memory_region(void const volatile* addr, size_t size);
 
 #  define MOZ_MAKE_MEM_NOACCESS(addr, size) \
     __asan_poison_memory_region((addr), (size))
@@ -67,7 +67,7 @@ __asan_unpoison_memory_region(void const volatile *addr, size_t size);
  * These definitions are usually provided through the
  * sanitizer/lsan_interface.h header installed by LSan.
  */
-void MOZ_EXPORT __lsan_ignore_object(const void *p);
+void MOZ_EXPORT __lsan_ignore_object(const void* p);
 }
 #elif defined(MOZ_MSAN)
 #  include 
@@ -78,8 +78,8 @@ extern "C" {
 /* These definitions are usually provided through the
  * sanitizer/msan_interface.h header installed by MSan.
  */
-void MOZ_EXPORT __msan_poison(void const volatile *addr, size_t size);
-void MOZ_EXPORT __msan_unpoison(void const volatile *addr, size_t size);
+void MOZ_EXPORT __msan_poison(void const volatile* addr, size_t size);
+void MOZ_EXPORT __msan_unpoison(void const volatile* addr, size_t size);
 
 #  define MOZ_MAKE_MEM_NOACCESS(addr, size) __msan_poison((addr), (size))
 
diff --git a/mobile/android/components/build/nsBrowserModule.cpp b/mobile/android/components/build/nsBrowserModule.cpp
index 87d55fb04c563..1429157d2c70f 100644
--- a/mobile/android/components/build/nsBrowserModule.cpp
+++ b/mobile/android/components/build/nsBrowserModule.cpp
@@ -24,8 +24,8 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsAndroidHistory,
                                          nsAndroidHistory::GetSingleton)
 NS_DEFINE_NAMED_CID(NS_ANDROIDHISTORY_CID);
 
-nsresult AndroidHistoryConstructor(nsISupports *aOuter, const nsIID &aIID,
-                                   void **aResult) {
+nsresult AndroidHistoryConstructor(nsISupports* aOuter, const nsIID& aIID,
+                                   void** aResult) {
   if (mozilla::jni::IsFennec()) {
     return nsAndroidHistoryConstructor(aOuter, aIID, aResult);
   }
diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp
index d83429a481c09..81ede83995675 100644
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -68,8 +68,8 @@ class nsJARInputThunk : public nsIInputStream {
   NS_DECL_THREADSAFE_ISUPPORTS_WITH_RECORDING(recordreplay::Behavior::Preserve)
   NS_DECL_NSIINPUTSTREAM
 
-  nsJARInputThunk(nsIZipReader *zipReader, nsIURI *fullJarURI,
-                  const nsACString &jarEntry, bool usingJarCache)
+  nsJARInputThunk(nsIZipReader* zipReader, nsIURI* fullJarURI,
+                  const nsACString& jarEntry, bool usingJarCache)
       : mUsingJarCache(usingJarCache),
         mJarReader(zipReader),
         mJarEntry(jarEntry),
@@ -122,7 +122,7 @@ nsresult nsJARInputThunk::Init() {
 
   // ask the JarStream for the content length
   uint64_t avail;
-  rv = mJarStream->Available((uint64_t *)&avail);
+  rv = mJarStream->Available((uint64_t*)&avail);
   if (NS_FAILED(rv)) return rv;
 
   mContentLength = avail < INT64_MAX ? (int64_t)avail : -1;
@@ -144,24 +144,24 @@ nsJARInputThunk::Close() {
 }
 
 NS_IMETHODIMP
-nsJARInputThunk::Available(uint64_t *avail) {
+nsJARInputThunk::Available(uint64_t* avail) {
   return mJarStream->Available(avail);
 }
 
 NS_IMETHODIMP
-nsJARInputThunk::Read(char *buf, uint32_t count, uint32_t *countRead) {
+nsJARInputThunk::Read(char* buf, uint32_t count, uint32_t* countRead) {
   return mJarStream->Read(buf, count, countRead);
 }
 
 NS_IMETHODIMP
-nsJARInputThunk::ReadSegments(nsWriteSegmentFun writer, void *closure,
-                              uint32_t count, uint32_t *countRead) {
+nsJARInputThunk::ReadSegments(nsWriteSegmentFun writer, void* closure,
+                              uint32_t count, uint32_t* countRead) {
   // stream transport does only calls Read()
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsJARInputThunk::IsNonBlocking(bool *nonBlocking) {
+nsJARInputThunk::IsNonBlocking(bool* nonBlocking) {
   *nonBlocking = false;
   return NS_OK;
 }
@@ -207,7 +207,7 @@ NS_IMPL_ISUPPORTS_INHERITED(nsJARChannel, nsHashPropertyBag, nsIRequest,
                             nsIThreadRetargetableRequest,
                             nsIThreadRetargetableStreamListener, nsIJARChannel)
 
-nsresult nsJARChannel::Init(nsIURI *uri) {
+nsresult nsJARChannel::Init(nsIURI* uri) {
   LOG(("nsJARChannel::Init [this=%p]\n", this));
   nsresult rv;
 
@@ -237,8 +237,8 @@ nsresult nsJARChannel::Init(nsIURI *uri) {
   return rv;
 }
 
-nsresult nsJARChannel::CreateJarInput(nsIZipReaderCache *jarCache,
-                                      nsJARInputThunk **resultInput) {
+nsresult nsJARChannel::CreateJarInput(nsIZipReaderCache* jarCache,
+                                      nsJARInputThunk** resultInput) {
   LOG(("nsJARChannel::CreateJarInput [this=%p]\n", this));
   MOZ_ASSERT(resultInput);
   MOZ_ASSERT(mJarFile);
@@ -341,10 +341,10 @@ nsresult nsJARChannel::LookupFile() {
   return rv;
 }
 
-nsresult CreateLocalJarInput(nsIZipReaderCache *aJarCache, nsIFile *aFile,
-                             const nsACString &aInnerJarEntry,
-                             nsIJARURI *aJarURI, const nsACString &aJarEntry,
-                             nsJARInputThunk **aResultInput) {
+nsresult CreateLocalJarInput(nsIZipReaderCache* aJarCache, nsIFile* aFile,
+                             const nsACString& aInnerJarEntry,
+                             nsIJARURI* aJarURI, const nsACString& aJarEntry,
+                             nsJARInputThunk** aResultInput) {
   LOG(("nsJARChannel::CreateLocalJarInput [aJarCache=%p, %s, %s]\n", aJarCache,
        PromiseFlatCString(aInnerJarEntry).get(),
        PromiseFlatCString(aJarEntry).get()));
@@ -447,7 +447,7 @@ nsresult nsJARChannel::OpenLocalFile() {
       }));
 }
 
-nsresult nsJARChannel::ContinueOpenLocalFile(nsJARInputThunk *aInput,
+nsresult nsJARChannel::ContinueOpenLocalFile(nsJARInputThunk* aInput,
                                              bool aIsSyncCall) {
   LOG(("nsJARChannel::ContinueOpenLocalFile [this=%p %p]\n", this, aInput));
 
@@ -546,16 +546,16 @@ void nsJARChannel::FireOnProgress(uint64_t aProgress) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsJARChannel::GetName(nsACString &result) { return mJarURI->GetSpec(result); }
+nsJARChannel::GetName(nsACString& result) { return mJarURI->GetSpec(result); }
 
 NS_IMETHODIMP
-nsJARChannel::IsPending(bool *result) {
+nsJARChannel::IsPending(bool* result) {
   *result = mIsPending;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetStatus(nsresult *status) {
+nsJARChannel::GetStatus(nsresult* status) {
   if (mPump && NS_SUCCEEDED(mStatus))
     mPump->GetStatus(status);
   else
@@ -603,7 +603,7 @@ nsJARChannel::Resume() {
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetLoadFlags(nsLoadFlags *aLoadFlags) {
+nsJARChannel::GetLoadFlags(nsLoadFlags* aLoadFlags) {
   *aLoadFlags = mLoadFlags;
   return NS_OK;
 }
@@ -615,18 +615,18 @@ nsJARChannel::SetLoadFlags(nsLoadFlags aLoadFlags) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetIsDocument(bool *aIsDocument) {
+nsJARChannel::GetIsDocument(bool* aIsDocument) {
   return NS_GetIsDocumentChannel(this, aIsDocument);
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) {
+nsJARChannel::GetLoadGroup(nsILoadGroup** aLoadGroup) {
   NS_IF_ADDREF(*aLoadGroup = mLoadGroup);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) {
+nsJARChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) {
   mLoadGroup = aLoadGroup;
   return NS_OK;
 }
@@ -636,28 +636,28 @@ nsJARChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsJARChannel::GetOriginalURI(nsIURI **aURI) {
+nsJARChannel::GetOriginalURI(nsIURI** aURI) {
   *aURI = mOriginalURI;
   NS_ADDREF(*aURI);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetOriginalURI(nsIURI *aURI) {
+nsJARChannel::SetOriginalURI(nsIURI* aURI) {
   NS_ENSURE_ARG_POINTER(aURI);
   mOriginalURI = aURI;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetURI(nsIURI **aURI) {
+nsJARChannel::GetURI(nsIURI** aURI) {
   NS_IF_ADDREF(*aURI = mJarURI);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetOwner(nsISupports **aOwner) {
+nsJARChannel::GetOwner(nsISupports** aOwner) {
   // JAR signatures are not processed to avoid main-thread network I/O (bug
   // 726125)
   *aOwner = mOwner;
@@ -666,45 +666,45 @@ nsJARChannel::GetOwner(nsISupports **aOwner) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetOwner(nsISupports *aOwner) {
+nsJARChannel::SetOwner(nsISupports* aOwner) {
   mOwner = aOwner;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) {
+nsJARChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) {
   NS_IF_ADDREF(*aLoadInfo = mLoadInfo);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
+nsJARChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) {
   MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
   mLoadInfo = aLoadInfo;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks) {
+nsJARChannel::GetNotificationCallbacks(nsIInterfaceRequestor** aCallbacks) {
   NS_IF_ADDREF(*aCallbacks = mCallbacks);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) {
+nsJARChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aCallbacks) {
   mCallbacks = aCallbacks;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetSecurityInfo(nsISupports **aSecurityInfo) {
+nsJARChannel::GetSecurityInfo(nsISupports** aSecurityInfo) {
   MOZ_ASSERT(aSecurityInfo, "Null out param");
   NS_IF_ADDREF(*aSecurityInfo = mSecurityInfo);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetContentType(nsACString &result) {
+nsJARChannel::GetContentType(nsACString& result) {
   // If the Jar file has not been open yet,
   // We return application/x-unknown-content-type
   if (!mOpened) {
@@ -733,7 +733,7 @@ nsJARChannel::GetContentType(nsACString &result) {
         }
       }
       if (ext) {
-        nsIMIMEService *mimeServ = gJarHandler->MimeService();
+        nsIMIMEService* mimeServ = gJarHandler->MimeService();
         if (mimeServ)
           mimeServ->GetTypeFromExtension(nsDependentCString(ext), mContentType);
       }
@@ -746,7 +746,7 @@ nsJARChannel::GetContentType(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetContentType(const nsACString &aContentType) {
+nsJARChannel::SetContentType(const nsACString& aContentType) {
   // If someone gives us a type hint we should just use that type instead of
   // doing our guessing.  So we don't care when this is being called.
 
@@ -756,7 +756,7 @@ nsJARChannel::SetContentType(const nsACString &aContentType) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetContentCharset(nsACString &aContentCharset) {
+nsJARChannel::GetContentCharset(nsACString& aContentCharset) {
   // If someone gives us a charset hint we should just use that charset.
   // So we don't care when this is being called.
   aContentCharset = mContentCharset;
@@ -764,13 +764,13 @@ nsJARChannel::GetContentCharset(nsACString &aContentCharset) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetContentCharset(const nsACString &aContentCharset) {
+nsJARChannel::SetContentCharset(const nsACString& aContentCharset) {
   mContentCharset = aContentCharset;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetContentDisposition(uint32_t *aContentDisposition) {
+nsJARChannel::GetContentDisposition(uint32_t* aContentDisposition) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
@@ -781,24 +781,24 @@ nsJARChannel::SetContentDisposition(uint32_t aContentDisposition) {
 
 NS_IMETHODIMP
 nsJARChannel::GetContentDispositionFilename(
-    nsAString &aContentDispositionFilename) {
+    nsAString& aContentDispositionFilename) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
 nsJARChannel::SetContentDispositionFilename(
-    const nsAString &aContentDispositionFilename) {
+    const nsAString& aContentDispositionFilename) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetContentDispositionHeader(
-    nsACString &aContentDispositionHeader) {
+    nsACString& aContentDispositionHeader) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetContentLength(int64_t *result) {
+nsJARChannel::GetContentLength(int64_t* result) {
   *result = mContentLength;
   return NS_OK;
 }
@@ -811,7 +811,7 @@ nsJARChannel::SetContentLength(int64_t aContentLength) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::Open(nsIInputStream **aStream) {
+nsJARChannel::Open(nsIInputStream** aStream) {
   LOG(("nsJARChannel::Open [this=%p]\n", this));
   nsCOMPtr listener;
   nsresult rv =
@@ -844,7 +844,7 @@ nsJARChannel::Open(nsIInputStream **aStream) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::AsyncOpen(nsIStreamListener *aListener) {
+nsJARChannel::AsyncOpen(nsIStreamListener* aListener) {
   LOG(("nsJARChannel::AsyncOpen [this=%p]\n", this));
   nsCOMPtr listener = aListener;
   nsresult rv =
@@ -904,13 +904,13 @@ nsJARChannel::AsyncOpen(nsIStreamListener *aListener) {
 // nsIJARChannel
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
-nsJARChannel::GetJarFile(nsIFile **aFile) {
+nsJARChannel::GetJarFile(nsIFile** aFile) {
   NS_IF_ADDREF(*aFile = mJarFile);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::SetJarFile(nsIFile *aFile) {
+nsJARChannel::SetJarFile(nsIFile* aFile) {
   if (mOpened) {
     return NS_ERROR_IN_PROGRESS;
   }
@@ -919,7 +919,7 @@ nsJARChannel::SetJarFile(nsIFile *aFile) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::EnsureCached(bool *aIsCached) {
+nsJARChannel::EnsureCached(bool* aIsCached) {
   nsresult rv;
   *aIsCached = false;
 
@@ -951,10 +951,10 @@ nsJARChannel::EnsureCached(bool *aIsCached) {
   rv = ioService->GetProtocolHandler("jar", getter_AddRefs(handler));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  auto jarHandler = static_cast(handler.get());
+  auto jarHandler = static_cast(handler.get());
   MOZ_ASSERT(jarHandler);
 
-  nsIZipReaderCache *jarCache = jarHandler->JarCache();
+  nsIZipReaderCache* jarCache = jarHandler->JarCache();
 
   rv = jarCache->GetZipIfCached(jarFile, getter_AddRefs(mPreCachedJarReader));
   if (rv == NS_ERROR_CACHE_KEY_NOT_FOUND) {
@@ -967,7 +967,7 @@ nsJARChannel::EnsureCached(bool *aIsCached) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetZipEntry(nsIZipEntry **aZipEntry) {
+nsJARChannel::GetZipEntry(nsIZipEntry** aZipEntry) {
   nsresult rv = LookupFile();
   if (NS_FAILED(rv)) return rv;
 
@@ -985,7 +985,7 @@ nsJARChannel::GetZipEntry(nsIZipEntry **aZipEntry) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsJARChannel::OnStartRequest(nsIRequest *req) {
+nsJARChannel::OnStartRequest(nsIRequest* req) {
   LOG(("nsJARChannel::OnStartRequest [this=%p %s]\n", this, mSpec.get()));
 
   mRequest = req;
@@ -1016,7 +1016,7 @@ nsJARChannel::OnStartRequest(nsIRequest *req) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::OnStopRequest(nsIRequest *req, nsresult status) {
+nsJARChannel::OnStopRequest(nsIRequest* req, nsresult status) {
   LOG(("nsJARChannel::OnStopRequest [this=%p %s status=%" PRIx32 "]\n", this,
        mSpec.get(), static_cast(status)));
 
@@ -1046,7 +1046,7 @@ nsJARChannel::OnStopRequest(nsIRequest *req, nsresult status) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::OnDataAvailable(nsIRequest *req, nsIInputStream *stream,
+nsJARChannel::OnDataAvailable(nsIRequest* req, nsIInputStream* stream,
                               uint64_t offset, uint32_t count) {
   LOG(("nsJARChannel::OnDataAvailable [this=%p %s]\n", this, mSpec.get()));
 
@@ -1071,7 +1071,7 @@ nsJARChannel::OnDataAvailable(nsIRequest *req, nsIInputStream *stream,
 }
 
 NS_IMETHODIMP
-nsJARChannel::RetargetDeliveryTo(nsIEventTarget *aEventTarget) {
+nsJARChannel::RetargetDeliveryTo(nsIEventTarget* aEventTarget) {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCOMPtr request = do_QueryInterface(mRequest);
@@ -1083,7 +1083,7 @@ nsJARChannel::RetargetDeliveryTo(nsIEventTarget *aEventTarget) {
 }
 
 NS_IMETHODIMP
-nsJARChannel::GetDeliveryTarget(nsIEventTarget **aEventTarget) {
+nsJARChannel::GetDeliveryTarget(nsIEventTarget** aEventTarget) {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCOMPtr request = do_QueryInterface(mRequest);
diff --git a/modules/libjar/nsJARChannel.h b/modules/libjar/nsJARChannel.h
index 8ad26cb5b48ab..7d496d6b79234 100644
--- a/modules/libjar/nsJARChannel.h
+++ b/modules/libjar/nsJARChannel.h
@@ -49,17 +49,17 @@ class nsJARChannel final : public nsIJARChannel,
 
   nsJARChannel();
 
-  nsresult Init(nsIURI *uri);
+  nsresult Init(nsIURI* uri);
 
-  void SetFile(nsIFile *file);
+  void SetFile(nsIFile* file);
 
  private:
   virtual ~nsJARChannel();
 
-  nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **);
+  nsresult CreateJarInput(nsIZipReaderCache*, nsJARInputThunk**);
   nsresult LookupFile();
   nsresult OpenLocalFile();
-  nsresult ContinueOpenLocalFile(nsJARInputThunk *aInput, bool aIsSyncCall);
+  nsresult ContinueOpenLocalFile(nsJARInputThunk* aInput, bool aIsSyncCall);
   nsresult OnOpenLocalFileComplete(nsresult aResult, bool aIsSyncCall);
   nsresult CheckPendingEvents();
   void NotifyError(nsresult aError);
diff --git a/modules/libjar/nsJARInputStream.cpp b/modules/libjar/nsJARInputStream.cpp
index 179d9d00970e0..1428635326f56 100644
--- a/modules/libjar/nsJARInputStream.cpp
+++ b/modules/libjar/nsJARInputStream.cpp
@@ -30,7 +30,7 @@ NS_IMPL_ISUPPORTS(nsJARInputStream, nsIInputStream)
  * nsJARInputStream implementation
  *--------------------------------------------------------*/
 
-nsresult nsJARInputStream::InitFile(nsJAR *aJar, nsZipItem *item) {
+nsresult nsJARInputStream::InitFile(nsJAR* aJar, nsZipItem* item) {
   nsresult rv = NS_OK;
   MOZ_ASSERT(aJar, "Argument may not be null");
   MOZ_ASSERT(item, "Argument may not be null");
@@ -68,7 +68,7 @@ nsresult nsJARInputStream::InitFile(nsJAR *aJar, nsZipItem *item) {
   // Must keep handle to filepointer and mmap structure as long as we need
   // access to the mmapped data
   mFd = aJar->mZip->GetFD();
-  mZs.next_in = (Bytef *)aJar->mZip->GetData(item);
+  mZs.next_in = (Bytef*)aJar->mZip->GetData(item);
   if (!mZs.next_in) {
     return NS_ERROR_FILE_CORRUPTED;
   }
@@ -78,9 +78,9 @@ nsresult nsJARInputStream::InitFile(nsJAR *aJar, nsZipItem *item) {
   return NS_OK;
 }
 
-nsresult nsJARInputStream::InitDirectory(nsJAR *aJar,
-                                         const nsACString &aJarDirSpec,
-                                         const char *aDir) {
+nsresult nsJARInputStream::InitDirectory(nsJAR* aJar,
+                                         const nsACString& aJarDirSpec,
+                                         const char* aDir) {
   MOZ_ASSERT(aJar, "Argument may not be null");
   MOZ_ASSERT(aDir, "Argument may not be null");
 
@@ -89,7 +89,7 @@ nsresult nsJARInputStream::InitDirectory(nsJAR *aJar,
 
   // Keep the zipReader for getting the actual zipItems
   mJar = aJar;
-  nsZipFind *find;
+  nsZipFind* find;
   nsresult rv;
   // We can get aDir's contents as strings via FindEntries
   // with the following pattern (see nsIZipReader.findEntries docs)
@@ -103,8 +103,8 @@ nsresult nsJARInputStream::InitDirectory(nsJAR *aJar,
   // which are special at the "top" level of the regexp so FindEntries
   // works correctly
   nsAutoCString escDirName;
-  const char *curr = dirName.BeginReading();
-  const char *end = dirName.EndReading();
+  const char* curr = dirName.BeginReading();
+  const char* end = dirName.EndReading();
   while (curr != end) {
     switch (*curr) {
       case '*':
@@ -129,7 +129,7 @@ nsresult nsJARInputStream::InitDirectory(nsJAR *aJar,
   rv = mJar->mZip->FindInit(pattern.get(), &find);
   if (NS_FAILED(rv)) return rv;
 
-  const char *name;
+  const char* name;
   uint16_t nameLen;
   while ((rv = find->FindNext(&name, &nameLen)) == NS_OK) {
     // Must copy, to make it zero-terminated
@@ -157,7 +157,7 @@ nsresult nsJARInputStream::InitDirectory(nsJAR *aJar,
 }
 
 NS_IMETHODIMP
-nsJARInputStream::Available(uint64_t *_retval) {
+nsJARInputStream::Available(uint64_t* _retval) {
   // A lot of callers don't check the error code.
   // They just use the _retval value.
   *_retval = 0;
@@ -186,7 +186,7 @@ nsJARInputStream::Available(uint64_t *_retval) {
 }
 
 NS_IMETHODIMP
-nsJARInputStream::Read(char *aBuffer, uint32_t aCount, uint32_t *aBytesRead) {
+nsJARInputStream::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytesRead) {
   NS_ENSURE_ARG_POINTER(aBuffer);
   NS_ENSURE_ARG_POINTER(aBytesRead);
 
@@ -240,14 +240,14 @@ nsJARInputStream::Read(char *aBuffer, uint32_t aCount, uint32_t *aBytesRead) {
 }
 
 NS_IMETHODIMP
-nsJARInputStream::ReadSegments(nsWriteSegmentFun writer, void *closure,
-                               uint32_t count, uint32_t *_retval) {
+nsJARInputStream::ReadSegments(nsWriteSegmentFun writer, void* closure,
+                               uint32_t count, uint32_t* _retval) {
   // don't have a buffer to read from, so this better not be called!
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsJARInputStream::IsNonBlocking(bool *aNonBlocking) {
+nsJARInputStream::IsNonBlocking(bool* aNonBlocking) {
   *aNonBlocking = false;
   return NS_OK;
 }
@@ -267,8 +267,8 @@ nsJARInputStream::Close() {
   return NS_OK;
 }
 
-nsresult nsJARInputStream::ContinueInflate(char *aBuffer, uint32_t aCount,
-                                           uint32_t *aBytesRead) {
+nsresult nsJARInputStream::ContinueInflate(char* aBuffer, uint32_t aCount,
+                                           uint32_t* aBytesRead) {
   bool finished = false;
 
   // No need to check the args, ::Read did that, but assert them at least
@@ -280,7 +280,7 @@ nsresult nsJARInputStream::ContinueInflate(char *aBuffer, uint32_t aCount,
 
   // make sure we aren't reading too much
   mZs.avail_out = std::min(aCount, (mOutSize - oldTotalOut));
-  mZs.next_out = (unsigned char *)aBuffer;
+  mZs.next_out = (unsigned char*)aBuffer;
 
 #ifndef MOZ_JAR_BROTLI
   MOZ_ASSERT(mMode == MODE_INFLATE);
@@ -303,7 +303,7 @@ nsresult nsJARInputStream::ContinueInflate(char *aBuffer, uint32_t aCount,
     size_t total_out = mZs.total_out;
     BrotliDecoderResult result = BrotliDecoderDecompressStream(
         mBrotliState, &avail_in,
-        const_cast(&mZs.next_in), &avail_out,
+        const_cast(&mZs.next_in), &avail_out,
         &mZs.next_out, &total_out);
     /* We don't need to update avail_out, it's not used outside this
      * function. */
@@ -319,7 +319,7 @@ nsresult nsJARInputStream::ContinueInflate(char *aBuffer, uint32_t aCount,
   *aBytesRead = (mZs.total_out - oldTotalOut);
 
   // Calculate the CRC on the output
-  mOutCrc = crc32(mOutCrc, (unsigned char *)aBuffer, *aBytesRead);
+  mOutCrc = crc32(mOutCrc, (unsigned char*)aBuffer, *aBytesRead);
 
   // be aggressive about ending the inflation
   // for some reason we don't always get Z_STREAM_END
@@ -337,8 +337,8 @@ nsresult nsJARInputStream::ContinueInflate(char *aBuffer, uint32_t aCount,
   return NS_OK;
 }
 
-nsresult nsJARInputStream::ReadDirectory(char *aBuffer, uint32_t aCount,
-                                         uint32_t *aBytesRead) {
+nsresult nsJARInputStream::ReadDirectory(char* aBuffer, uint32_t aCount,
+                                         uint32_t* aBytesRead) {
   // No need to check the args, ::Read did that, but assert them at least
   NS_ASSERTION(aBuffer, "aBuffer parameter must not be null");
   NS_ASSERTION(aBytesRead, "aBytesRead parameter must not be null");
@@ -356,9 +356,9 @@ nsresult nsJARInputStream::ReadDirectory(char *aBuffer, uint32_t aCount,
       // have we consumed all the directory contents?
       if (arrayLen <= mArrPos) break;
 
-      const char *entryName = mArray[mArrPos].get();
+      const char* entryName = mArray[mArrPos].get();
       uint32_t entryNameLen = mArray[mArrPos].Length();
-      nsZipItem *ze = mJar->mZip->GetItem(entryName);
+      nsZipItem* ze = mJar->mZip->GetItem(entryName);
       NS_ENSURE_TRUE(ze, NS_ERROR_FILE_TARGET_DOES_NOT_EXIST);
 
       // Last Modified Time
@@ -395,7 +395,7 @@ nsresult nsJARInputStream::ReadDirectory(char *aBuffer, uint32_t aCount,
   return NS_OK;
 }
 
-uint32_t nsJARInputStream::CopyDataToBuffer(char *&aBuffer, uint32_t &aCount) {
+uint32_t nsJARInputStream::CopyDataToBuffer(char*& aBuffer, uint32_t& aCount) {
   const uint32_t writeLength = std::min(aCount, mBuffer.Length() - mCurPos);
 
   if (writeLength > 0) {
diff --git a/modules/libjar/nsJARProtocolHandler.cpp b/modules/libjar/nsJARProtocolHandler.cpp
index 86dd2cf8835fb..9a7990f7769ad 100644
--- a/modules/libjar/nsJARProtocolHandler.cpp
+++ b/modules/libjar/nsJARProtocolHandler.cpp
@@ -41,7 +41,7 @@ nsresult nsJARProtocolHandler::Init() {
   return rv;
 }
 
-nsIMIMEService *nsJARProtocolHandler::MimeService() {
+nsIMIMEService* nsJARProtocolHandler::MimeService() {
   if (!mMimeService) mMimeService = do_GetService("@mozilla.org/mime;1");
 
   return mMimeService.get();
@@ -66,19 +66,19 @@ already_AddRefed nsJARProtocolHandler::GetSingleton() {
 // nsIProtocolHandler methods:
 
 NS_IMETHODIMP
-nsJARProtocolHandler::GetScheme(nsACString &result) {
+nsJARProtocolHandler::GetScheme(nsACString& result) {
   result.AssignLiteral("jar");
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARProtocolHandler::GetDefaultPort(int32_t *result) {
+nsJARProtocolHandler::GetDefaultPort(int32_t* result) {
   *result = -1;  // no port for JAR: URLs
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARProtocolHandler::GetProtocolFlags(uint32_t *result) {
+nsJARProtocolHandler::GetProtocolFlags(uint32_t* result) {
   // URI_LOADABLE_BY_ANYONE, since it's our inner URI that will matter
   // anyway.
   *result = URI_NORELATIVE | URI_NOAUTH | URI_LOADABLE_BY_ANYONE;
@@ -89,8 +89,8 @@ nsJARProtocolHandler::GetProtocolFlags(uint32_t *result) {
 }
 
 NS_IMETHODIMP
-nsJARProtocolHandler::NewURI(const nsACString &aSpec, const char *aCharset,
-                             nsIURI *aBaseURI, nsIURI **result) {
+nsJARProtocolHandler::NewURI(const nsACString& aSpec, const char* aCharset,
+                             nsIURI* aBaseURI, nsIURI** result) {
   nsCOMPtr base(aBaseURI);
   return NS_MutateURI(new nsJARURI::Mutator())
       .Apply(NS_MutatorMethod(&nsIJARURIMutator::SetSpecBaseCharset,
@@ -99,9 +99,9 @@ nsJARProtocolHandler::NewURI(const nsACString &aSpec, const char *aCharset,
 }
 
 NS_IMETHODIMP
-nsJARProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo,
-                                 nsIChannel **result) {
-  nsJARChannel *chan = new nsJARChannel();
+nsJARProtocolHandler::NewChannel(nsIURI* uri, nsILoadInfo* aLoadInfo,
+                                 nsIChannel** result) {
+  nsJARChannel* chan = new nsJARChannel();
   if (!chan) return NS_ERROR_OUT_OF_MEMORY;
   NS_ADDREF(chan);
 
@@ -123,8 +123,8 @@ nsJARProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo,
 }
 
 NS_IMETHODIMP
-nsJARProtocolHandler::AllowPort(int32_t port, const char *scheme,
-                                bool *_retval) {
+nsJARProtocolHandler::AllowPort(int32_t port, const char* scheme,
+                                bool* _retval) {
   // don't override anything.
   *_retval = false;
   return NS_OK;
diff --git a/modules/libjar/nsJARProtocolHandler.h b/modules/libjar/nsJARProtocolHandler.h
index ad617c7b24aec..427602cc6dc29 100644
--- a/modules/libjar/nsJARProtocolHandler.h
+++ b/modules/libjar/nsJARProtocolHandler.h
@@ -28,8 +28,8 @@ class nsJARProtocolHandler final : public nsIProtocolHandler,
   nsresult Init();
 
   // returns non addref'ed pointer.
-  nsIMIMEService *MimeService();
-  nsIZipReaderCache *JarCache() const { return mJARCache; }
+  nsIMIMEService* MimeService();
+  nsIZipReaderCache* JarCache() const { return mJARCache; }
 
  protected:
   virtual ~nsJARProtocolHandler();
diff --git a/modules/libjar/nsJARURI.cpp b/modules/libjar/nsJARURI.cpp
index cc461cb770261..973e45b9fd1b2 100644
--- a/modules/libjar/nsJARURI.cpp
+++ b/modules/libjar/nsJARURI.cpp
@@ -46,7 +46,7 @@ NS_INTERFACE_MAP_BEGIN(nsJARURI)
   NS_INTERFACE_MAP_ENTRY_CONCRETE(nsJARURI)
 NS_INTERFACE_MAP_END
 
-nsresult nsJARURI::Init(const char *charsetHint) {
+nsresult nsJARURI::Init(const char* charsetHint) {
   mCharsetHint = charsetHint;
   return NS_OK;
 }
@@ -57,7 +57,7 @@ nsresult nsJARURI::Init(const char *charsetHint) {
 
 // FormatSpec takes the entry spec (including the "x:///" at the
 // beginning) and gives us a full JAR spec.
-nsresult nsJARURI::FormatSpec(const nsACString &entrySpec, nsACString &result,
+nsresult nsJARURI::FormatSpec(const nsACString& entrySpec, nsACString& result,
                               bool aIncludeScheme) {
   // The entrySpec MUST start with "x:///"
   NS_ASSERTION(StringBeginsWith(entrySpec, NS_BOGUS_ENTRY_SCHEME),
@@ -77,8 +77,8 @@ nsresult nsJARURI::FormatSpec(const nsACString &entrySpec, nsACString &result,
   return NS_OK;
 }
 
-nsresult nsJARURI::CreateEntryURL(const nsACString &entryFilename,
-                                  const char *charset, nsIURL **url) {
+nsresult nsJARURI::CreateEntryURL(const nsACString& entryFilename,
+                                  const char* charset, nsIURL** url) {
   *url = nullptr;
   // Flatten the concatenation, just in case.  See bug 128288
   nsAutoCString spec(NS_BOGUS_ENTRY_SCHEME + entryFilename);
@@ -93,12 +93,12 @@ nsresult nsJARURI::CreateEntryURL(const nsACString &entryFilename,
 // nsISerializable methods:
 
 NS_IMETHODIMP
-nsJARURI::Read(nsIObjectInputStream *aStream) {
+nsJARURI::Read(nsIObjectInputStream* aStream) {
   MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-nsresult nsJARURI::ReadPrivate(nsIObjectInputStream *aInputStream) {
+nsresult nsJARURI::ReadPrivate(nsIObjectInputStream* aInputStream) {
   nsresult rv;
 
   nsCOMPtr supports;
@@ -119,7 +119,7 @@ nsresult nsJARURI::ReadPrivate(nsIObjectInputStream *aInputStream) {
 }
 
 NS_IMETHODIMP
-nsJARURI::Write(nsIObjectOutputStream *aOutputStream) {
+nsJARURI::Write(nsIObjectOutputStream* aOutputStream) {
   nsresult rv;
 
   rv = aOutputStream->WriteCompoundObject(mJARFile, NS_GET_IID(nsIURI), true);
@@ -136,44 +136,44 @@ nsJARURI::Write(nsIObjectOutputStream *aOutputStream) {
 // nsIClassInfo methods:
 
 NS_IMETHODIMP
-nsJARURI::GetInterfaces(nsTArray &array) {
+nsJARURI::GetInterfaces(nsTArray& array) {
   array.Clear();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetScriptableHelper(nsIXPCScriptable **_retval) {
+nsJARURI::GetScriptableHelper(nsIXPCScriptable** _retval) {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetContractID(nsACString &aContractID) {
+nsJARURI::GetContractID(nsACString& aContractID) {
   aContractID.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetClassDescription(nsACString &aClassDescription) {
+nsJARURI::GetClassDescription(nsACString& aClassDescription) {
   aClassDescription.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetClassID(nsCID **aClassID) {
-  *aClassID = (nsCID *)moz_xmalloc(sizeof(nsCID));
+nsJARURI::GetClassID(nsCID** aClassID) {
+  *aClassID = (nsCID*)moz_xmalloc(sizeof(nsCID));
   return GetClassIDNoAlloc(*aClassID);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetFlags(uint32_t *aFlags) {
+nsJARURI::GetFlags(uint32_t* aFlags) {
   // XXX We implement THREADSAFE addref/release, but probably shouldn't.
   *aFlags = nsIClassInfo::MAIN_THREAD_ONLY;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) {
+nsJARURI::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc) {
   *aClassIDNoAlloc = kJARURICID;
   return NS_OK;
 }
@@ -182,43 +182,43 @@ nsJARURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) {
 // nsIURI methods:
 
 NS_IMETHODIMP
-nsJARURI::GetSpec(nsACString &aSpec) {
+nsJARURI::GetSpec(nsACString& aSpec) {
   nsAutoCString entrySpec;
   mJAREntry->GetSpec(entrySpec);
   return FormatSpec(entrySpec, aSpec);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetSpecIgnoringRef(nsACString &aSpec) {
+nsJARURI::GetSpecIgnoringRef(nsACString& aSpec) {
   nsAutoCString entrySpec;
   mJAREntry->GetSpecIgnoringRef(entrySpec);
   return FormatSpec(entrySpec, aSpec);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetDisplaySpec(nsACString &aUnicodeSpec) {
+nsJARURI::GetDisplaySpec(nsACString& aUnicodeSpec) {
   return GetSpec(aUnicodeSpec);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetDisplayHostPort(nsACString &aUnicodeHostPort) {
+nsJARURI::GetDisplayHostPort(nsACString& aUnicodeHostPort) {
   return GetHostPort(aUnicodeHostPort);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetDisplayPrePath(nsACString &aPrePath) {
+nsJARURI::GetDisplayPrePath(nsACString& aPrePath) {
   return GetPrePath(aPrePath);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetDisplayHost(nsACString &aUnicodeHost) {
+nsJARURI::GetDisplayHost(nsACString& aUnicodeHost) {
   return GetHost(aUnicodeHost);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetHasRef(bool *result) { return mJAREntry->GetHasRef(result); }
+nsJARURI::GetHasRef(bool* result) { return mJAREntry->GetHasRef(result); }
 
-nsresult nsJARURI::SetSpecInternal(const nsACString &aSpec) {
+nsresult nsJARURI::SetSpecInternal(const nsACString& aSpec) {
   return SetSpecWithBase(aSpec, nullptr);
 }
 
@@ -228,8 +228,8 @@ NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsJARURI::Mutator, nsIURISetters, nsIURIMutator,
                                 nsIJARURIMutator)
 
 NS_IMETHODIMP
-nsJARURI::Mutator::SetFileName(const nsACString &aFileName,
-                               nsIURIMutator **aMutator) {
+nsJARURI::Mutator::SetFileName(const nsACString& aFileName,
+                               nsIURIMutator** aMutator) {
   if (!mURI) {
     return NS_ERROR_NULL_POINTER;
   }
@@ -241,8 +241,8 @@ nsJARURI::Mutator::SetFileName(const nsACString &aFileName,
 }
 
 NS_IMETHODIMP
-nsJARURI::Mutator::SetFileBaseName(const nsACString &aFileBaseName,
-                                   nsIURIMutator **aMutator) {
+nsJARURI::Mutator::SetFileBaseName(const nsACString& aFileBaseName,
+                                   nsIURIMutator** aMutator) {
   if (!mURI) {
     return NS_ERROR_NULL_POINTER;
   }
@@ -254,8 +254,8 @@ nsJARURI::Mutator::SetFileBaseName(const nsACString &aFileBaseName,
 }
 
 NS_IMETHODIMP
-nsJARURI::Mutator::SetFileExtension(const nsACString &aFileExtension,
-                                    nsIURIMutator **aMutator) {
+nsJARURI::Mutator::SetFileExtension(const nsACString& aFileExtension,
+                                    nsIURIMutator** aMutator) {
   if (!mURI) {
     return NS_ERROR_NULL_POINTER;
   }
@@ -267,7 +267,7 @@ nsJARURI::Mutator::SetFileExtension(const nsACString &aFileExtension,
 }
 
 NS_IMETHODIMP
-nsJARURI::Mutate(nsIURIMutator **aMutator) {
+nsJARURI::Mutate(nsIURIMutator** aMutator) {
   RefPtr mutator = new nsJARURI::Mutator();
   nsresult rv = mutator->InitFromURI(this);
   if (NS_FAILED(rv)) {
@@ -277,7 +277,7 @@ nsJARURI::Mutate(nsIURIMutator **aMutator) {
   return NS_OK;
 }
 
-nsresult nsJARURI::SetSpecWithBase(const nsACString &aSpec, nsIURI *aBaseURL) {
+nsresult nsJARURI::SetSpecWithBase(const nsACString& aSpec, nsIURI* aBaseURL) {
   nsresult rv;
 
   nsCOMPtr ioServ(do_GetIOService(&rv));
@@ -364,97 +364,97 @@ nsresult nsJARURI::SetSpecWithBase(const nsACString &aSpec, nsIURI *aBaseURL) {
 }
 
 NS_IMETHODIMP
-nsJARURI::GetPrePath(nsACString &prePath) {
+nsJARURI::GetPrePath(nsACString& prePath) {
   prePath = NS_JAR_SCHEME;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetScheme(nsACString &aScheme) {
+nsJARURI::GetScheme(nsACString& aScheme) {
   aScheme = "jar";
   return NS_OK;
 }
 
-nsresult nsJARURI::SetScheme(const nsACString &aScheme) {
+nsresult nsJARURI::SetScheme(const nsACString& aScheme) {
   // doesn't make sense to set the scheme of a jar: URL
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetUserPass(nsACString &aUserPass) { return NS_ERROR_FAILURE; }
+nsJARURI::GetUserPass(nsACString& aUserPass) { return NS_ERROR_FAILURE; }
 
-nsresult nsJARURI::SetUserPass(const nsACString &aUserPass) {
+nsresult nsJARURI::SetUserPass(const nsACString& aUserPass) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetUsername(nsACString &aUsername) { return NS_ERROR_FAILURE; }
+nsJARURI::GetUsername(nsACString& aUsername) { return NS_ERROR_FAILURE; }
 
-nsresult nsJARURI::SetUsername(const nsACString &aUsername) {
+nsresult nsJARURI::SetUsername(const nsACString& aUsername) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetPassword(nsACString &aPassword) { return NS_ERROR_FAILURE; }
+nsJARURI::GetPassword(nsACString& aPassword) { return NS_ERROR_FAILURE; }
 
-nsresult nsJARURI::SetPassword(const nsACString &aPassword) {
+nsresult nsJARURI::SetPassword(const nsACString& aPassword) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetHostPort(nsACString &aHostPort) { return NS_ERROR_FAILURE; }
+nsJARURI::GetHostPort(nsACString& aHostPort) { return NS_ERROR_FAILURE; }
 
-nsresult nsJARURI::SetHostPort(const nsACString &aHostPort) {
+nsresult nsJARURI::SetHostPort(const nsACString& aHostPort) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetHost(nsACString &aHost) { return NS_ERROR_FAILURE; }
+nsJARURI::GetHost(nsACString& aHost) { return NS_ERROR_FAILURE; }
 
-nsresult nsJARURI::SetHost(const nsACString &aHost) { return NS_ERROR_FAILURE; }
+nsresult nsJARURI::SetHost(const nsACString& aHost) { return NS_ERROR_FAILURE; }
 
 NS_IMETHODIMP
-nsJARURI::GetPort(int32_t *aPort) { return NS_ERROR_FAILURE; }
+nsJARURI::GetPort(int32_t* aPort) { return NS_ERROR_FAILURE; }
 
 nsresult nsJARURI::SetPort(int32_t aPort) { return NS_ERROR_FAILURE; }
 
-nsresult nsJARURI::GetPathQueryRef(nsACString &aPath) {
+nsresult nsJARURI::GetPathQueryRef(nsACString& aPath) {
   nsAutoCString entrySpec;
   mJAREntry->GetSpec(entrySpec);
   return FormatSpec(entrySpec, aPath, false);
 }
 
-nsresult nsJARURI::SetPathQueryRef(const nsACString &aPath) {
+nsresult nsJARURI::SetPathQueryRef(const nsACString& aPath) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetAsciiSpec(nsACString &aSpec) {
+nsJARURI::GetAsciiSpec(nsACString& aSpec) {
   // XXX Shouldn't this like... make sure it returns ASCII or something?
   return GetSpec(aSpec);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetAsciiHostPort(nsACString &aHostPort) { return NS_ERROR_FAILURE; }
+nsJARURI::GetAsciiHostPort(nsACString& aHostPort) { return NS_ERROR_FAILURE; }
 
 NS_IMETHODIMP
-nsJARURI::GetAsciiHost(nsACString &aHost) { return NS_ERROR_FAILURE; }
+nsJARURI::GetAsciiHost(nsACString& aHost) { return NS_ERROR_FAILURE; }
 
 NS_IMETHODIMP
-nsJARURI::Equals(nsIURI *other, bool *result) {
+nsJARURI::Equals(nsIURI* other, bool* result) {
   return EqualsInternal(other, eHonorRef, result);
 }
 
 NS_IMETHODIMP
-nsJARURI::EqualsExceptRef(nsIURI *other, bool *result) {
+nsJARURI::EqualsExceptRef(nsIURI* other, bool* result) {
   return EqualsInternal(other, eIgnoreRef, result);
 }
 
 // Helper method:
 /* virtual */
-nsresult nsJARURI::EqualsInternal(nsIURI *other,
+nsresult nsJARURI::EqualsInternal(nsIURI* other,
                                   nsJARURI::RefHandlingEnum refHandlingMode,
-                                  bool *result) {
+                                  bool* result) {
   *result = false;
 
   if (!other) return NS_OK;  // not equal
@@ -474,7 +474,7 @@ nsresult nsJARURI::EqualsInternal(nsIURI *other,
 }
 
 NS_IMETHODIMP
-nsJARURI::SchemeIs(const char *i_Scheme, bool *o_Equals) {
+nsJARURI::SchemeIs(const char* i_Scheme, bool* o_Equals) {
   MOZ_ASSERT(o_Equals);
   if (!i_Scheme) {
     *o_Equals = false;
@@ -485,7 +485,7 @@ nsJARURI::SchemeIs(const char *i_Scheme, bool *o_Equals) {
   return NS_OK;
 }
 
-nsresult nsJARURI::Clone(nsIURI **result) {
+nsresult nsJARURI::Clone(nsIURI** result) {
   RefPtr uri = new nsJARURI();
   uri->mJARFile = mJARFile;
   uri->mJAREntry = mJAREntry;
@@ -495,7 +495,7 @@ nsresult nsJARURI::Clone(nsIURI **result) {
 }
 
 NS_IMETHODIMP
-nsJARURI::Resolve(const nsACString &relativePath, nsACString &result) {
+nsJARURI::Resolve(const nsACString& relativePath, nsACString& result) {
   nsresult rv;
 
   nsCOMPtr ioServ(do_GetIOService(&rv));
@@ -519,46 +519,46 @@ nsJARURI::Resolve(const nsACString &relativePath, nsACString &result) {
 // nsIURL methods:
 
 NS_IMETHODIMP
-nsJARURI::GetFilePath(nsACString &filePath) {
+nsJARURI::GetFilePath(nsACString& filePath) {
   return mJAREntry->GetFilePath(filePath);
 }
 
-nsresult nsJARURI::SetFilePath(const nsACString &filePath) {
+nsresult nsJARURI::SetFilePath(const nsACString& filePath) {
   return NS_MutateURI(mJAREntry).SetFilePath(filePath).Finalize(mJAREntry);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetQuery(nsACString &query) { return mJAREntry->GetQuery(query); }
+nsJARURI::GetQuery(nsACString& query) { return mJAREntry->GetQuery(query); }
 
-nsresult nsJARURI::SetQuery(const nsACString &query) {
+nsresult nsJARURI::SetQuery(const nsACString& query) {
   return NS_MutateURI(mJAREntry).SetQuery(query).Finalize(mJAREntry);
 }
 
-nsresult nsJARURI::SetQueryWithEncoding(const nsACString &query,
-                                        const Encoding *encoding) {
+nsresult nsJARURI::SetQueryWithEncoding(const nsACString& query,
+                                        const Encoding* encoding) {
   return NS_MutateURI(mJAREntry)
       .SetQueryWithEncoding(query, encoding)
       .Finalize(mJAREntry);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetRef(nsACString &ref) { return mJAREntry->GetRef(ref); }
+nsJARURI::GetRef(nsACString& ref) { return mJAREntry->GetRef(ref); }
 
-nsresult nsJARURI::SetRef(const nsACString &ref) {
+nsresult nsJARURI::SetRef(const nsACString& ref) {
   return NS_MutateURI(mJAREntry).SetRef(ref).Finalize(mJAREntry);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetDirectory(nsACString &directory) {
+nsJARURI::GetDirectory(nsACString& directory) {
   return mJAREntry->GetDirectory(directory);
 }
 
 NS_IMETHODIMP
-nsJARURI::GetFileName(nsACString &fileName) {
+nsJARURI::GetFileName(nsACString& fileName) {
   return mJAREntry->GetFileName(fileName);
 }
 
-nsresult nsJARURI::SetFileNameInternal(const nsACString &fileName) {
+nsresult nsJARURI::SetFileNameInternal(const nsACString& fileName) {
   return NS_MutateURI(mJAREntry)
       .Apply(NS_MutatorMethod(&nsIURLMutator::SetFileName, nsCString(fileName),
                               nullptr))
@@ -566,11 +566,11 @@ nsresult nsJARURI::SetFileNameInternal(const nsACString &fileName) {
 }
 
 NS_IMETHODIMP
-nsJARURI::GetFileBaseName(nsACString &fileBaseName) {
+nsJARURI::GetFileBaseName(nsACString& fileBaseName) {
   return mJAREntry->GetFileBaseName(fileBaseName);
 }
 
-nsresult nsJARURI::SetFileBaseNameInternal(const nsACString &fileBaseName) {
+nsresult nsJARURI::SetFileBaseNameInternal(const nsACString& fileBaseName) {
   return NS_MutateURI(mJAREntry)
       .Apply(NS_MutatorMethod(&nsIURLMutator::SetFileBaseName,
                               nsCString(fileBaseName), nullptr))
@@ -578,11 +578,11 @@ nsresult nsJARURI::SetFileBaseNameInternal(const nsACString &fileBaseName) {
 }
 
 NS_IMETHODIMP
-nsJARURI::GetFileExtension(nsACString &fileExtension) {
+nsJARURI::GetFileExtension(nsACString& fileExtension) {
   return mJAREntry->GetFileExtension(fileExtension);
 }
 
-nsresult nsJARURI::SetFileExtensionInternal(const nsACString &fileExtension) {
+nsresult nsJARURI::SetFileExtensionInternal(const nsACString& fileExtension) {
   return NS_MutateURI(mJAREntry)
       .Apply(NS_MutatorMethod(&nsIURLMutator::SetFileExtension,
                               nsCString(fileExtension), nullptr))
@@ -590,7 +590,7 @@ nsresult nsJARURI::SetFileExtensionInternal(const nsACString &fileExtension) {
 }
 
 NS_IMETHODIMP
-nsJARURI::GetCommonBaseSpec(nsIURI *uriToCompare, nsACString &commonSpec) {
+nsJARURI::GetCommonBaseSpec(nsIURI* uriToCompare, nsACString& commonSpec) {
   commonSpec.Truncate();
 
   NS_ENSURE_ARG_POINTER(uriToCompare);
@@ -643,7 +643,7 @@ nsJARURI::GetCommonBaseSpec(nsIURI *uriToCompare, nsACString &commonSpec) {
 }
 
 NS_IMETHODIMP
-nsJARURI::GetRelativeSpec(nsIURI *uriToCompare, nsACString &relativeSpec) {
+nsJARURI::GetRelativeSpec(nsIURI* uriToCompare, nsACString& relativeSpec) {
   GetSpec(relativeSpec);
 
   NS_ENSURE_ARG_POINTER(uriToCompare);
@@ -691,10 +691,10 @@ nsJARURI::GetRelativeSpec(nsIURI *uriToCompare, nsACString &relativeSpec) {
 // nsIJARURI methods:
 
 NS_IMETHODIMP
-nsJARURI::GetJARFile(nsIURI **jarFile) { return GetInnerURI(jarFile); }
+nsJARURI::GetJARFile(nsIURI** jarFile) { return GetInnerURI(jarFile); }
 
 NS_IMETHODIMP
-nsJARURI::GetJAREntry(nsACString &entryPath) {
+nsJARURI::GetJAREntry(nsACString& entryPath) {
   nsAutoCString filePath;
   mJAREntry->GetFilePath(filePath);
   NS_ASSERTION(filePath.Length() > 0, "path should never be empty!");
@@ -703,7 +703,7 @@ nsJARURI::GetJAREntry(nsACString &entryPath) {
   return NS_OK;
 }
 
-nsresult nsJARURI::SetJAREntry(const nsACString &entryPath) {
+nsresult nsJARURI::SetJAREntry(const nsACString& entryPath) {
   return CreateEntryURL(entryPath, mCharsetHint.get(),
                         getter_AddRefs(mJAREntry));
 }
@@ -711,18 +711,18 @@ nsresult nsJARURI::SetJAREntry(const nsACString &entryPath) {
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_IMETHODIMP
-nsJARURI::GetInnerURI(nsIURI **aURI) {
+nsJARURI::GetInnerURI(nsIURI** aURI) {
   nsCOMPtr uri = mJARFile;
   uri.forget(aURI);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARURI::GetInnermostURI(nsIURI **uri) {
+nsJARURI::GetInnermostURI(nsIURI** uri) {
   return NS_ImplGetInnermostURI(this, uri);
 }
 
-void nsJARURI::Serialize(URIParams &aParams) {
+void nsJARURI::Serialize(URIParams& aParams) {
   JARURIParams params;
 
   SerializeURI(mJARFile, params.jarFile());
@@ -732,13 +732,13 @@ void nsJARURI::Serialize(URIParams &aParams) {
   aParams = params;
 }
 
-bool nsJARURI::Deserialize(const URIParams &aParams) {
+bool nsJARURI::Deserialize(const URIParams& aParams) {
   if (aParams.type() != URIParams::TJARURIParams) {
     NS_ERROR("Received unknown parameters from the other process!");
     return false;
   }
 
-  const JARURIParams ¶ms = aParams.get_JARURIParams();
+  const JARURIParams& params = aParams.get_JARURIParams();
 
   nsCOMPtr file = DeserializeURI(params.jarFile());
   if (!file) {
diff --git a/modules/libjar/nsJARURI.h b/modules/libjar/nsJARURI.h
index 5ab5fa3503b68..9668fc90fb569 100644
--- a/modules/libjar/nsJARURI.h
+++ b/modules/libjar/nsJARURI.h
@@ -52,25 +52,25 @@ class nsJARURI final : public nsIJARURI,
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_THIS_JARURI_IMPL_CID)
 
   // nsJARURI
-  nsresult FormatSpec(const nsACString &entryPath, nsACString &result,
+  nsresult FormatSpec(const nsACString& entryPath, nsACString& result,
                       bool aIncludeScheme = true);
-  nsresult CreateEntryURL(const nsACString &entryFilename, const char *charset,
-                          nsIURL **url);
+  nsresult CreateEntryURL(const nsACString& entryFilename, const char* charset,
+                          nsIURL** url);
 
  protected:
   nsJARURI();
   virtual ~nsJARURI();
-  nsresult SetJAREntry(const nsACString &entryPath);
-  nsresult Init(const char *charsetHint);
-  nsresult SetSpecWithBase(const nsACString &aSpec, nsIURI *aBaseURL);
+  nsresult SetJAREntry(const nsACString& entryPath);
+  nsresult Init(const char* charsetHint);
+  nsresult SetSpecWithBase(const nsACString& aSpec, nsIURI* aBaseURL);
 
   // enum used in a few places to specify how .ref attribute should be handled
   enum RefHandlingEnum { eIgnoreRef, eHonorRef, eReplaceRef };
 
   // Helper to share code between Equals methods.
-  virtual nsresult EqualsInternal(nsIURI *other,
+  virtual nsresult EqualsInternal(nsIURI* other,
                                   RefHandlingEnum refHandlingMode,
-                                  bool *result);
+                                  bool* result);
 
   nsCOMPtr mJARFile;
   // mJarEntry stored as a URL so that we can easily access things
@@ -79,27 +79,27 @@ class nsJARURI final : public nsIJARURI,
   nsCString mCharsetHint;
 
  private:
-  nsresult Clone(nsIURI **aURI);
-  nsresult SetSpecInternal(const nsACString &input);
-  nsresult SetScheme(const nsACString &input);
-  nsresult SetUserPass(const nsACString &input);
-  nsresult SetUsername(const nsACString &input);
-  nsresult SetPassword(const nsACString &input);
-  nsresult SetHostPort(const nsACString &aValue);
-  nsresult SetHost(const nsACString &input);
+  nsresult Clone(nsIURI** aURI);
+  nsresult SetSpecInternal(const nsACString& input);
+  nsresult SetScheme(const nsACString& input);
+  nsresult SetUserPass(const nsACString& input);
+  nsresult SetUsername(const nsACString& input);
+  nsresult SetPassword(const nsACString& input);
+  nsresult SetHostPort(const nsACString& aValue);
+  nsresult SetHost(const nsACString& input);
   nsresult SetPort(int32_t port);
-  nsresult SetPathQueryRef(const nsACString &input);
-  nsresult SetRef(const nsACString &input);
-  nsresult SetFilePath(const nsACString &input);
-  nsresult SetQuery(const nsACString &input);
-  nsresult SetQueryWithEncoding(const nsACString &input,
-                                const mozilla::Encoding *encoding);
-  bool Deserialize(const mozilla::ipc::URIParams &);
-  nsresult ReadPrivate(nsIObjectInputStream *aStream);
-
-  nsresult SetFileNameInternal(const nsACString &fileName);
-  nsresult SetFileBaseNameInternal(const nsACString &fileBaseName);
-  nsresult SetFileExtensionInternal(const nsACString &fileExtension);
+  nsresult SetPathQueryRef(const nsACString& input);
+  nsresult SetRef(const nsACString& input);
+  nsresult SetFilePath(const nsACString& input);
+  nsresult SetQuery(const nsACString& input);
+  nsresult SetQueryWithEncoding(const nsACString& input,
+                                const mozilla::Encoding* encoding);
+  bool Deserialize(const mozilla::ipc::URIParams&);
+  nsresult ReadPrivate(nsIObjectInputStream* aStream);
+
+  nsresult SetFileNameInternal(const nsACString& fileName);
+  nsresult SetFileBaseNameInternal(const nsACString& fileBaseName);
+  nsresult SetFileExtensionInternal(const nsACString& fileExtension);
 
  public:
   class Mutator final : public nsIURIMutator,
@@ -113,17 +113,17 @@ class nsJARURI final : public nsIJARURI,
     NS_DECL_NSIURLMUTATOR
 
     NS_IMETHOD
-    Write(nsIObjectOutputStream *aOutputStream) override {
+    Write(nsIObjectOutputStream* aOutputStream) override {
       return NS_ERROR_NOT_IMPLEMENTED;
     }
 
-    MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream *aStream) override {
+    MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream* aStream) override {
       return InitFromInputStream(aStream);
     }
 
     NS_IMETHOD
-    SetSpecBaseCharset(const nsACString &aSpec, nsIURI *aBaseURI,
-                       const char *aCharset) override {
+    SetSpecBaseCharset(const nsACString& aSpec, nsIURI* aBaseURI,
+                       const char* aCharset) override {
       RefPtr uri;
       if (mURI) {
         mURI.swap(uri);
diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp
index d02bbaed6329b..9b95b5d916418 100644
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -74,13 +74,13 @@ static const uint32_t kMaxNameLength = PATH_MAX; /* Maximum name length */
 static const uint16_t kSyntheticTime = 0;
 static const uint16_t kSyntheticDate = (1 + (1 << 5) + (0 << 9));
 
-static uint16_t xtoint(const uint8_t *ii);
-static uint32_t xtolong(const uint8_t *ll);
-static uint32_t HashName(const char *aName, uint16_t nameLen);
+static uint16_t xtoint(const uint8_t* ii);
+static uint32_t xtolong(const uint8_t* ll);
+static uint32_t HashName(const char* aName, uint16_t nameLen);
 
 class ZipArchiveLogger {
  public:
-  void Init(const char *env) {
+  void Init(const char* env) {
     if (!fd) {
       nsCOMPtr logFile;
       nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(env), false,
@@ -91,7 +91,7 @@ class ZipArchiveLogger {
       rv = logFile->Create(nsIFile::NORMAL_FILE_TYPE, 0644);
       if (NS_FAILED(rv)) return;
 
-      PRFileDesc *file;
+      PRFileDesc* file;
 #ifdef XP_WIN
       // PR_APPEND is racy on Windows, so open a handle ourselves with flags
       // that will work, and use PR_ImportFile to make it a PRFileDesc. This can
@@ -114,7 +114,7 @@ class ZipArchiveLogger {
     }
   }
 
-  void Write(const nsACString &zip, const char *entry) const {
+  void Write(const nsACString& zip, const char* entry) const {
     if (fd) {
       nsCString buf(zip);
       buf.Append(' ');
@@ -139,7 +139,7 @@ class ZipArchiveLogger {
 
  private:
   int refCnt;
-  PRFileDesc *fd;
+  PRFileDesc* fd;
 };
 
 static ZipArchiveLogger zipLog;
@@ -150,7 +150,7 @@ static ZipArchiveLogger zipLog;
 // malloc(32768 * 1)
 //***********************************************************
 
-nsresult gZlibInit(z_stream *zs) {
+nsresult gZlibInit(z_stream* zs) {
   memset(zs, 0, sizeof(z_stream));
   int zerr = inflateInit2(zs, -MAX_WBITS);
   if (zerr != Z_OK) return NS_ERROR_OUT_OF_MEMORY;
@@ -169,7 +169,7 @@ nsZipHandle::nsZipHandle()
 NS_IMPL_ADDREF(nsZipHandle)
 NS_IMPL_RELEASE(nsZipHandle)
 
-nsresult nsZipHandle::Init(nsIFile *file, nsZipHandle **ret, PRFileDesc **aFd) {
+nsresult nsZipHandle::Init(nsIFile* file, nsZipHandle** ret, PRFileDesc** aFd) {
   mozilla::AutoFDClose fd;
   int32_t flags = PR_RDONLY;
 #if defined(XP_WIN)
@@ -181,10 +181,10 @@ nsresult nsZipHandle::Init(nsIFile *file, nsZipHandle **ret, PRFileDesc **aFd) {
   int64_t size = PR_Available64(fd);
   if (size >= INT32_MAX) return NS_ERROR_FILE_TOO_BIG;
 
-  PRFileMap *map = PR_CreateFileMap(fd, size, PR_PROT_READONLY);
+  PRFileMap* map = PR_CreateFileMap(fd, size, PR_PROT_READONLY);
   if (!map) return NS_ERROR_FAILURE;
 
-  uint8_t *buf = (uint8_t *)PR_MemMap(map, 0, (uint32_t)size);
+  uint8_t* buf = (uint8_t*)PR_MemMap(map, 0, (uint32_t)size);
   // Bug 525755: PR_MemMap fails when fd points at something other than a normal
   // file.
   if (!buf) {
@@ -220,8 +220,8 @@ nsresult nsZipHandle::Init(nsIFile *file, nsZipHandle **ret, PRFileDesc **aFd) {
   return NS_OK;
 }
 
-nsresult nsZipHandle::Init(nsZipArchive *zip, const char *entry,
-                           nsZipHandle **ret) {
+nsresult nsZipHandle::Init(nsZipArchive* zip, const char* entry,
+                           nsZipHandle** ret) {
   RefPtr handle = new nsZipHandle();
   if (!handle) return NS_ERROR_OUT_OF_MEMORY;
 
@@ -242,8 +242,8 @@ nsresult nsZipHandle::Init(nsZipArchive *zip, const char *entry,
   return NS_OK;
 }
 
-nsresult nsZipHandle::Init(const uint8_t *aData, uint32_t aLen,
-                           nsZipHandle **aRet) {
+nsresult nsZipHandle::Init(const uint8_t* aData, uint32_t aLen,
+                           nsZipHandle** aRet) {
   RefPtr handle = new nsZipHandle();
 
   handle->mFileStart = aData;
@@ -280,7 +280,7 @@ nsresult nsZipHandle::findDataStart() {
 
   MOZ_WIN_MEM_TRY_BEGIN
   if (mTotalLen > CRXIntSize * 4 && xtolong(mFileStart) == kCRXMagic) {
-    const uint8_t *headerData = mFileStart;
+    const uint8_t* headerData = mFileStart;
     headerData += CRXIntSize * 2;  // Skip magic number and version number
     uint32_t pubKeyLength = xtolong(headerData);
     headerData += CRXIntSize;
@@ -300,7 +300,7 @@ nsresult nsZipHandle::findDataStart() {
 
 int64_t nsZipHandle::SizeOfMapping() { return mTotalLen; }
 
-nsresult nsZipHandle::GetNSPRFileDesc(PRFileDesc **aNSPRFileDesc) {
+nsresult nsZipHandle::GetNSPRFileDesc(PRFileDesc** aNSPRFileDesc) {
   if (!aNSPRFileDesc) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
@@ -315,7 +315,7 @@ nsresult nsZipHandle::GetNSPRFileDesc(PRFileDesc **aNSPRFileDesc) {
 
 nsZipHandle::~nsZipHandle() {
   if (mMap) {
-    PR_MemUnmap((void *)mFileStart, mTotalLen);
+    PR_MemUnmap((void*)mFileStart, mTotalLen);
     PR_CloseFileMap(mMap);
   }
   mFileStart = nullptr;
@@ -331,14 +331,14 @@ nsZipHandle::~nsZipHandle() {
 //---------------------------------------------
 //  nsZipArchive::OpenArchive
 //---------------------------------------------
-nsresult nsZipArchive::OpenArchive(nsZipHandle *aZipHandle, PRFileDesc *aFd) {
+nsresult nsZipArchive::OpenArchive(nsZipHandle* aZipHandle, PRFileDesc* aFd) {
   mFd = aZipHandle;
 
   //-- get table of contents for archive
   nsresult rv = BuildFileList(aFd);
   if (NS_SUCCEEDED(rv)) {
     if (aZipHandle->mFile && XRE_IsParentProcess()) {
-      static char *env = PR_GetEnv("MOZ_JAR_LOG_FILE");
+      static char* env = PR_GetEnv("MOZ_JAR_LOG_FILE");
       if (env) {
         zipLog.Init(env);
         // We only log accesses in jar/zip archives within the NS_GRE_DIR
@@ -387,7 +387,7 @@ nsresult nsZipArchive::OpenArchive(nsZipHandle *aZipHandle, PRFileDesc *aFd) {
   return rv;
 }
 
-nsresult nsZipArchive::OpenArchive(nsIFile *aFile) {
+nsresult nsZipArchive::OpenArchive(nsIFile* aFile) {
   RefPtr handle;
 #if defined(XP_WIN)
   mozilla::AutoFDClose fd;
@@ -407,8 +407,8 @@ nsresult nsZipArchive::OpenArchive(nsIFile *aFile) {
 //---------------------------------------------
 //  nsZipArchive::Test
 //---------------------------------------------
-nsresult nsZipArchive::Test(const char *aEntryName) {
-  nsZipItem *currItem;
+nsresult nsZipArchive::Test(const char* aEntryName) {
+  nsZipItem* currItem;
 
   if (aEntryName)  // only test specified item
   {
@@ -420,7 +420,7 @@ nsresult nsZipArchive::Test(const char *aEntryName) {
   }
 
   // test all items in archive
-  for (auto *item : mFiles) {
+  for (auto* item : mFiles) {
     for (currItem = item; currItem; currItem = currItem->next) {
       //-- don't test (synthetic) directory items
       if (currItem->IsDirectory()) continue;
@@ -456,7 +456,7 @@ nsresult nsZipArchive::CloseArchive() {
 //---------------------------------------------
 // nsZipArchive::GetItem
 //---------------------------------------------
-nsZipItem *nsZipArchive::GetItem(const char *aEntryName) {
+nsZipItem* nsZipArchive::GetItem(const char* aEntryName) {
   if (aEntryName) {
     uint32_t len = strlen(aEntryName);
     //-- If the request is for a directory, make sure that synthetic entries
@@ -467,7 +467,7 @@ nsZipItem *nsZipArchive::GetItem(const char *aEntryName) {
       }
     }
     MOZ_WIN_MEM_TRY_BEGIN
-    nsZipItem *item = mFiles[HashName(aEntryName, len)];
+    nsZipItem* item = mFiles[HashName(aEntryName, len)];
     while (item) {
       if ((len == item->nameLength) &&
           (!memcmp(aEntryName, item->Name(), len))) {
@@ -491,8 +491,8 @@ nsZipItem *nsZipArchive::GetItem(const char *aEntryName) {
 // If 'aFd' is null, it only tests the extraction.
 // On extraction error(s) it removes the file.
 //---------------------------------------------
-nsresult nsZipArchive::ExtractFile(nsZipItem *item, nsIFile *outFile,
-                                   PRFileDesc *aFd) {
+nsresult nsZipArchive::ExtractFile(nsZipItem* item, nsIFile* outFile,
+                                   PRFileDesc* aFd) {
   if (!item) return NS_ERROR_ILLEGAL_VALUE;
   if (!mFd) return NS_ERROR_FAILURE;
 
@@ -508,7 +508,7 @@ nsresult nsZipArchive::ExtractFile(nsZipItem *item, nsIFile *outFile,
 
   while (true) {
     uint32_t count = 0;
-    uint8_t *buf = cursor.Read(&count);
+    uint8_t* buf = cursor.Read(&count);
     if (!buf) {
       rv = NS_ERROR_FILE_CORRUPTED;
       break;
@@ -537,14 +537,14 @@ nsresult nsZipArchive::ExtractFile(nsZipItem *item, nsIFile *outFile,
 //---------------------------------------------
 // nsZipArchive::FindInit
 //---------------------------------------------
-nsresult nsZipArchive::FindInit(const char *aPattern, nsZipFind **aFind) {
+nsresult nsZipArchive::FindInit(const char* aPattern, nsZipFind** aFind) {
   if (!aFind) return NS_ERROR_ILLEGAL_VALUE;
 
   // null out param in case an error happens
   *aFind = nullptr;
 
   bool regExp = false;
-  char *pattern = 0;
+  char* pattern = 0;
 
   // Create synthetic directory entries on demand
   nsresult rv = BuildSynthetics();
@@ -552,7 +552,7 @@ nsresult nsZipArchive::FindInit(const char *aPattern, nsZipFind **aFind) {
 
   // validate the pattern
   if (aPattern) {
-    switch (NS_WildCardValid((char *)aPattern)) {
+    switch (NS_WildCardValid((char*)aPattern)) {
       case INVALID_SXP:
         return NS_ERROR_ILLEGAL_VALUE;
 
@@ -586,7 +586,7 @@ nsresult nsZipArchive::FindInit(const char *aPattern, nsZipFind **aFind) {
 //---------------------------------------------
 // nsZipFind::FindNext
 //---------------------------------------------
-nsresult nsZipFind::FindNext(const char **aResult, uint16_t *aNameLen) {
+nsresult nsZipFind::FindNext(const char** aResult, uint16_t* aNameLen) {
   if (!mArchive || !aResult || !aNameLen) return NS_ERROR_ILLEGAL_VALUE;
 
   *aResult = 0;
@@ -628,19 +628,19 @@ nsresult nsZipFind::FindNext(const char **aResult, uint16_t *aNameLen) {
 //---------------------------------------------
 //  nsZipArchive::CreateZipItem
 //---------------------------------------------
-nsZipItem *nsZipArchive::CreateZipItem() {
+nsZipItem* nsZipArchive::CreateZipItem() {
   // Arena allocate the nsZipItem
-  return (nsZipItem *)mArena.Allocate(sizeof(nsZipItem));
+  return (nsZipItem*)mArena.Allocate(sizeof(nsZipItem));
 }
 
 //---------------------------------------------
 //  nsZipArchive::BuildFileList
 //---------------------------------------------
-nsresult nsZipArchive::BuildFileList(PRFileDesc *aFd) {
+nsresult nsZipArchive::BuildFileList(PRFileDesc* aFd) {
   // Get archive size using end pos
-  const uint8_t *buf;
-  const uint8_t *startp = mFd->mFileData;
-  const uint8_t *endp = startp + mFd->mLen;
+  const uint8_t* buf;
+  const uint8_t* startp = mFd->mFileData;
+  const uint8_t* endp = startp + mFd->mLen;
   MOZ_WIN_MEM_TRY_BEGIN
   uint32_t centralOffset = 4;
   // Only perform readahead in the parent process. Children processes
@@ -651,11 +651,11 @@ nsresult nsZipArchive::BuildFileList(PRFileDesc *aFd) {
       xtolong(startp + centralOffset) == CENTRALSIG) {
     // Success means optimized jar layout from bug 559961 is in effect
     uint32_t readaheadLength = xtolong(startp);
-    mozilla::PrefetchMemory(const_cast(startp), readaheadLength);
+    mozilla::PrefetchMemory(const_cast(startp), readaheadLength);
   } else {
     for (buf = endp - ZIPEND_SIZE; buf > startp; buf--) {
       if (xtolong(buf) == ENDSIG) {
-        centralOffset = xtolong(((ZipEnd *)buf)->offset_central_dir);
+        centralOffset = xtolong(((ZipEnd*)buf)->offset_central_dir);
         break;
       }
     }
@@ -683,7 +683,7 @@ nsresult nsZipArchive::BuildFileList(PRFileDesc *aFd) {
     }
 
     // Read the fixed-size data.
-    ZipCentral *central = (ZipCentral *)buf;
+    ZipCentral* central = (ZipCentral*)buf;
 
     uint16_t namelen = xtoint(central->filename_len);
     uint16_t extralen = xtoint(central->extrafield_len);
@@ -703,7 +703,7 @@ nsresult nsZipArchive::BuildFileList(PRFileDesc *aFd) {
     // Point to the next item at the top of loop
     buf += diff;
 
-    nsZipItem *item = CreateZipItem();
+    nsZipItem* item = CreateZipItem();
     if (!item) return NS_ERROR_OUT_OF_MEMORY;
 
     item->central = central;
@@ -724,12 +724,12 @@ nsresult nsZipArchive::BuildFileList(PRFileDesc *aFd) {
 
   // Make the comment available for consumers.
   if ((endp >= buf) && (endp - buf >= ZIPEND_SIZE)) {
-    ZipEnd *zipend = (ZipEnd *)buf;
+    ZipEnd* zipend = (ZipEnd*)buf;
 
     buf += ZIPEND_SIZE;
     uint16_t commentlen = xtoint(zipend->commentfield_len);
     if (endp - buf >= commentlen) {
-      mCommentPtr = (const char *)buf;
+      mCommentPtr = (const char*)buf;
       mCommentLen = commentlen;
     }
   }
@@ -748,7 +748,7 @@ nsresult nsZipArchive::BuildSynthetics() {
   MOZ_WIN_MEM_TRY_BEGIN
   // Create synthetic entries for any missing directories.
   // Do this when all ziptable has scanned to prevent double entries.
-  for (auto *item : mFiles) {
+  for (auto* item : mFiles) {
     for (; item != nullptr; item = item->next) {
       if (item->isSynthetic) continue;
 
@@ -761,7 +761,7 @@ nsresult nsZipArchive::BuildSynthetics() {
       uint16_t namelen = item->nameLength;
       MOZ_ASSERT(namelen > 0,
                  "Attempt to build synthetic for zero-length entry name!");
-      const char *name = item->Name();
+      const char* name = item->Name();
       for (uint16_t dirlen = namelen - 1; dirlen > 0; dirlen--) {
         if (name[dirlen - 1] != '/') continue;
 
@@ -772,7 +772,7 @@ nsresult nsZipArchive::BuildSynthetics() {
         // Is the directory already in the file table?
         uint32_t hash = HashName(item->Name(), dirlen);
         bool found = false;
-        for (nsZipItem *zi = mFiles[hash]; zi != nullptr; zi = zi->next) {
+        for (nsZipItem* zi = mFiles[hash]; zi != nullptr; zi = zi->next) {
           if ((dirlen == zi->nameLength) &&
               (0 == memcmp(item->Name(), zi->Name(), dirlen))) {
             // we've already added this dir and all its parents
@@ -785,7 +785,7 @@ nsresult nsZipArchive::BuildSynthetics() {
         // are there -- otherwise, start creating the zip item
         if (found) break;
 
-        nsZipItem *diritem = CreateZipItem();
+        nsZipItem* diritem = CreateZipItem();
         if (!diritem) return NS_ERROR_OUT_OF_MEMORY;
 
         // Point to the central record of the original item for the name part.
@@ -803,7 +803,7 @@ nsresult nsZipArchive::BuildSynthetics() {
   return NS_OK;
 }
 
-nsZipHandle *nsZipArchive::GetFD() {
+nsZipHandle* nsZipArchive::GetFD() {
   if (!mFd) return nullptr;
   return mFd.get();
 }
@@ -811,19 +811,19 @@ nsZipHandle *nsZipArchive::GetFD() {
 //---------------------------------------------
 // nsZipArchive::GetDataOffset
 //---------------------------------------------
-uint32_t nsZipArchive::GetDataOffset(nsZipItem *aItem) {
+uint32_t nsZipArchive::GetDataOffset(nsZipItem* aItem) {
   MOZ_ASSERT(aItem);
   MOZ_WIN_MEM_TRY_BEGIN
   //-- read local header to get variable length values and calculate
   //-- the real data offset
   uint32_t len = mFd->mLen;
-  const uint8_t *data = mFd->mFileData;
+  const uint8_t* data = mFd->mFileData;
   uint32_t offset = aItem->LocalOffset();
   if (len < ZIPLOCAL_SIZE || offset > len - ZIPLOCAL_SIZE) return 0;
 
   // -- check signature before using the structure, in case the zip file is
   // corrupt
-  ZipLocal *Local = (ZipLocal *)(data + offset);
+  ZipLocal* Local = (ZipLocal*)(data + offset);
   if ((xtolong(Local->signature) != LOCALSIG)) return 0;
 
   //-- NOTE: extralen is different in central header and local header
@@ -839,7 +839,7 @@ uint32_t nsZipArchive::GetDataOffset(nsZipItem *aItem) {
 //---------------------------------------------
 // nsZipArchive::GetData
 //---------------------------------------------
-const uint8_t *nsZipArchive::GetData(nsZipItem *aItem) {
+const uint8_t* nsZipArchive::GetData(nsZipItem* aItem) {
   MOZ_ASSERT(aItem);
   MOZ_WIN_MEM_TRY_BEGIN
   uint32_t offset = GetDataOffset(aItem);
@@ -856,7 +856,7 @@ const uint8_t *nsZipArchive::GetData(nsZipItem *aItem) {
 }
 
 // nsZipArchive::GetComment
-bool nsZipArchive::GetComment(nsACString &aComment) {
+bool nsZipArchive::GetComment(nsACString& aComment) {
   MOZ_WIN_MEM_TRY_BEGIN
   aComment.Assign(mCommentPtr, mCommentLen);
   MOZ_WIN_MEM_TRY_CATCH(return false)
@@ -896,7 +896,7 @@ nsZipArchive::~nsZipArchive() {
 // nsZipFind constructor and destructor
 //------------------------------------------
 
-nsZipFind::nsZipFind(nsZipArchive *aZip, char *aPattern, bool aRegExp)
+nsZipFind::nsZipFind(nsZipArchive* aZip, char* aPattern, bool aRegExp)
     : mArchive(aZip),
       mPattern(aPattern),
       mItem(nullptr),
@@ -921,11 +921,11 @@ nsZipFind::~nsZipFind() {
  * returns a hash key for the entry name
  */
 MOZ_NO_SANITIZE_UNSIGNED_OVERFLOW
-static uint32_t HashName(const char *aName, uint16_t len) {
+static uint32_t HashName(const char* aName, uint16_t len) {
   MOZ_ASSERT(aName != 0);
 
-  const uint8_t *p = (const uint8_t *)aName;
-  const uint8_t *endp = p + len;
+  const uint8_t* p = (const uint8_t*)aName;
+  const uint8_t* endp = p + len;
   uint32_t val = 0;
   while (p != endp) {
     val = val * 37 + *p++;
@@ -940,7 +940,7 @@ static uint32_t HashName(const char *aName, uint16_t len) {
  *  Converts a two byte ugly endianed integer
  *  to our platform's integer.
  */
-static uint16_t xtoint(const uint8_t *ii) {
+static uint16_t xtoint(const uint8_t* ii) {
   return (uint16_t)((ii[0]) | (ii[1] << 8));
 }
 
@@ -950,7 +950,7 @@ static uint16_t xtoint(const uint8_t *ii) {
  *  Converts a four byte ugly endianed integer
  *  to our platform's integer.
  */
-static uint32_t xtolong(const uint8_t *ll) {
+static uint32_t xtolong(const uint8_t* ll) {
   return (uint32_t)((ll[0] << 0) | (ll[1] << 8) | (ll[2] << 16) |
                     (ll[3] << 24));
 }
@@ -1022,11 +1022,11 @@ uint16_t nsZipItem::Mode() {
   return ((uint16_t)(central->external_attributes[2]) | 0x100);
 }
 
-const uint8_t *nsZipItem::GetExtraField(uint16_t aTag, uint16_t *aBlockSize) {
+const uint8_t* nsZipItem::GetExtraField(uint16_t aTag, uint16_t* aBlockSize) {
   if (isSynthetic) return nullptr;
   MOZ_WIN_MEM_TRY_BEGIN
-  const unsigned char *buf =
-      ((const unsigned char *)central) + ZIPCENTRAL_SIZE + nameLength;
+  const unsigned char* buf =
+      ((const unsigned char*)central) + ZIPCENTRAL_SIZE + nameLength;
   uint32_t buflen = (uint32_t)xtoint(central->extrafield_len);
   uint32_t pos = 0;
   uint16_t tag, blocksize;
@@ -1052,7 +1052,7 @@ PRTime nsZipItem::LastModTime() {
 
   // Try to read timestamp from extra field
   uint16_t blocksize;
-  const uint8_t *tsField = GetExtraField(EXTENDED_TIMESTAMP_FIELD, &blocksize);
+  const uint8_t* tsField = GetExtraField(EXTENDED_TIMESTAMP_FIELD, &blocksize);
   if (tsField && blocksize >= 5 && tsField[4] & EXTENDED_TIMESTAMP_MODTIME) {
     return (PRTime)(xtolong(tsField + 5)) * PR_USEC_PER_SEC;
   }
@@ -1060,7 +1060,7 @@ PRTime nsZipItem::LastModTime() {
   return GetModTime(Date(), Time());
 }
 
-nsZipCursor::nsZipCursor(nsZipItem *item, nsZipArchive *aZip, uint8_t *aBuf,
+nsZipCursor::nsZipCursor(nsZipItem* item, nsZipArchive* aZip, uint8_t* aBuf,
                          uint32_t aBufSize, bool doCRC)
     : mItem(item),
       mBuf(aBuf),
@@ -1083,7 +1083,7 @@ nsZipCursor::nsZipCursor(nsZipItem *item, nsZipArchive *aZip, uint8_t *aBuf,
   }
 
   mZs.avail_in = item->Size();
-  mZs.next_in = (Bytef *)aZip->GetData(item);
+  mZs.next_in = (Bytef*)aZip->GetData(item);
 
 #ifdef MOZ_JAR_BROTLI
   if (mItem->Compression() == MOZ_JAR_BROTLI) {
@@ -1105,9 +1105,9 @@ nsZipCursor::~nsZipCursor() {
 #endif
 }
 
-uint8_t *nsZipCursor::ReadOrCopy(uint32_t *aBytesRead, bool aCopy) {
+uint8_t* nsZipCursor::ReadOrCopy(uint32_t* aBytesRead, bool aCopy) {
   int zerr;
-  uint8_t *buf = nullptr;
+  uint8_t* buf = nullptr;
   bool verifyCRC = true;
 
   if (!mZs.next_in) return nullptr;
@@ -1147,7 +1147,7 @@ uint8_t *nsZipCursor::ReadOrCopy(uint32_t *aBytesRead, bool aCopy) {
       size_t avail_in = mZs.avail_in;
       BrotliDecoderResult result = BrotliDecoderDecompressStream(
           mBrotliState, &avail_in,
-          const_cast(&mZs.next_in), &avail_out,
+          const_cast(&mZs.next_in), &avail_out,
           &mZs.next_out, nullptr);
       /* We don't need to update avail_out, it's not used outside this
        * function. */
@@ -1167,20 +1167,20 @@ uint8_t *nsZipCursor::ReadOrCopy(uint32_t *aBytesRead, bool aCopy) {
   }
 
   if (mDoCRC) {
-    mCRC = crc32(mCRC, (const unsigned char *)buf, *aBytesRead);
+    mCRC = crc32(mCRC, (const unsigned char*)buf, *aBytesRead);
     if (verifyCRC && mCRC != mItem->CRC32()) return nullptr;
   }
   MOZ_WIN_MEM_TRY_CATCH(return nullptr)
   return buf;
 }
 
-nsZipItemPtr_base::nsZipItemPtr_base(nsZipArchive *aZip, const char *aEntryName,
+nsZipItemPtr_base::nsZipItemPtr_base(nsZipArchive* aZip, const char* aEntryName,
                                      bool doCRC)
     : mReturnBuf(nullptr), mReadlen(0) {
   // make sure the ziparchive hangs around
   mZipHandle = aZip->GetFD();
 
-  nsZipItem *item = aZip->GetItem(aEntryName);
+  nsZipItem* item = aZip->GetItem(aEntryName);
   if (!item) return;
 
   uint32_t size = 0;
diff --git a/modules/libjar/zipwriter/StreamFunctions.cpp b/modules/libjar/zipwriter/StreamFunctions.cpp
index 00d92973ebfea..a16db2884497c 100644
--- a/modules/libjar/zipwriter/StreamFunctions.cpp
+++ b/modules/libjar/zipwriter/StreamFunctions.cpp
@@ -11,7 +11,7 @@
  * Fully reads the required amount of data. Keeps reading until all the
  * data is retrieved or an error is hit.
  */
-nsresult ZW_ReadData(nsIInputStream *aStream, char *aBuffer, uint32_t aCount) {
+nsresult ZW_ReadData(nsIInputStream* aStream, char* aBuffer, uint32_t aCount) {
   while (aCount > 0) {
     uint32_t read;
     nsresult rv = aStream->Read(aBuffer, aCount, &read);
@@ -29,7 +29,7 @@ nsresult ZW_ReadData(nsIInputStream *aStream, char *aBuffer, uint32_t aCount) {
  * Fully writes the required amount of data. Keeps writing until all the
  * data is written or an error is hit.
  */
-nsresult ZW_WriteData(nsIOutputStream *aStream, const char *aBuffer,
+nsresult ZW_WriteData(nsIOutputStream* aStream, const char* aBuffer,
                       uint32_t aCount) {
   while (aCount > 0) {
     uint32_t written;
diff --git a/modules/libjar/zipwriter/nsDeflateConverter.cpp b/modules/libjar/zipwriter/nsDeflateConverter.cpp
index 4c29caf5991c3..84aeae75ba974 100644
--- a/modules/libjar/zipwriter/nsDeflateConverter.cpp
+++ b/modules/libjar/zipwriter/nsDeflateConverter.cpp
@@ -60,18 +60,18 @@ nsresult nsDeflateConverter::Init() {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDeflateConverter::Convert(nsIInputStream *aFromStream,
-                                          const char *aFromType,
-                                          const char *aToType,
-                                          nsISupports *aCtxt,
-                                          nsIInputStream **_retval) {
+NS_IMETHODIMP nsDeflateConverter::Convert(nsIInputStream* aFromStream,
+                                          const char* aFromType,
+                                          const char* aToType,
+                                          nsISupports* aCtxt,
+                                          nsIInputStream** _retval) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP nsDeflateConverter::AsyncConvertData(const char *aFromType,
-                                                   const char *aToType,
-                                                   nsIStreamListener *aListener,
-                                                   nsISupports *aCtxt) {
+NS_IMETHODIMP nsDeflateConverter::AsyncConvertData(const char* aFromType,
+                                                   const char* aToType,
+                                                   nsIStreamListener* aListener,
+                                                   nsISupports* aCtxt) {
   if (mListener) return NS_ERROR_ALREADY_INITIALIZED;
 
   NS_ENSURE_ARG_POINTER(aListener);
@@ -92,8 +92,8 @@ NS_IMETHODIMP nsDeflateConverter::AsyncConvertData(const char *aFromType,
   return rv;
 }
 
-NS_IMETHODIMP nsDeflateConverter::OnDataAvailable(nsIRequest *aRequest,
-                                                  nsIInputStream *aInputStream,
+NS_IMETHODIMP nsDeflateConverter::OnDataAvailable(nsIRequest* aRequest,
+                                                  nsIInputStream* aInputStream,
                                                   uint64_t aOffset,
                                                   uint32_t aCount) {
   if (!mListener) return NS_ERROR_NOT_INITIALIZED;
@@ -106,7 +106,7 @@ NS_IMETHODIMP nsDeflateConverter::OnDataAvailable(nsIRequest *aRequest,
 
   // make sure we aren't reading too much
   mZstream.avail_in = aCount;
-  mZstream.next_in = (unsigned char *)buffer.get();
+  mZstream.next_in = (unsigned char*)buffer.get();
 
   int zerr = Z_OK;
   // deflate loop
@@ -124,13 +124,13 @@ NS_IMETHODIMP nsDeflateConverter::OnDataAvailable(nsIRequest *aRequest,
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDeflateConverter::OnStartRequest(nsIRequest *aRequest) {
+NS_IMETHODIMP nsDeflateConverter::OnStartRequest(nsIRequest* aRequest) {
   if (!mListener) return NS_ERROR_NOT_INITIALIZED;
 
   return mListener->OnStartRequest(aRequest);
 }
 
-NS_IMETHODIMP nsDeflateConverter::OnStopRequest(nsIRequest *aRequest,
+NS_IMETHODIMP nsDeflateConverter::OnStopRequest(nsIRequest* aRequest,
                                                 nsresult aStatusCode) {
   if (!mListener) return NS_ERROR_NOT_INITIALIZED;
 
@@ -148,8 +148,8 @@ NS_IMETHODIMP nsDeflateConverter::OnStopRequest(nsIRequest *aRequest,
   return mListener->OnStopRequest(aRequest, aStatusCode);
 }
 
-nsresult nsDeflateConverter::PushAvailableData(nsIRequest *aRequest,
-                                               nsISupports *aContext) {
+nsresult nsDeflateConverter::PushAvailableData(nsIRequest* aRequest,
+                                               nsISupports* aContext) {
   uint32_t bytesToWrite = sizeof(mWriteBuffer) - mZstream.avail_out;
   // We don't need to do anything if there isn't any data
   if (bytesToWrite == 0) return NS_OK;
@@ -157,7 +157,7 @@ nsresult nsDeflateConverter::PushAvailableData(nsIRequest *aRequest,
   MOZ_ASSERT(bytesToWrite <= INT32_MAX);
   nsCOMPtr stream;
   nsresult rv = NS_NewByteInputStream(
-      getter_AddRefs(stream), MakeSpan((char *)mWriteBuffer, bytesToWrite),
+      getter_AddRefs(stream), MakeSpan((char*)mWriteBuffer, bytesToWrite),
       NS_ASSIGNMENT_DEPEND);
   NS_ENSURE_SUCCESS(rv, rv);
 
diff --git a/modules/libjar/zipwriter/nsDeflateConverter.h b/modules/libjar/zipwriter/nsDeflateConverter.h
index 52571fb4a45c8..aa86dcaa48752 100644
--- a/modules/libjar/zipwriter/nsDeflateConverter.h
+++ b/modules/libjar/zipwriter/nsDeflateConverter.h
@@ -52,7 +52,7 @@ class nsDeflateConverter final : public nsIStreamConverter {
   unsigned char mWriteBuffer[kZipBufLen];
 
   nsresult Init();
-  nsresult PushAvailableData(nsIRequest *aRequest, nsISupports *aContext);
+  nsresult PushAvailableData(nsIRequest* aRequest, nsISupports* aContext);
 };
 
 #endif
diff --git a/modules/libjar/zipwriter/nsZipDataStream.cpp b/modules/libjar/zipwriter/nsZipDataStream.cpp
index 68c7aa7a9ea31..b3ba1f3754e84 100644
--- a/modules/libjar/zipwriter/nsZipDataStream.cpp
+++ b/modules/libjar/zipwriter/nsZipDataStream.cpp
@@ -26,8 +26,8 @@ using namespace mozilla;
  */
 NS_IMPL_ISUPPORTS(nsZipDataStream, nsIStreamListener, nsIRequestObserver)
 
-nsresult nsZipDataStream::Init(nsZipWriter *aWriter, nsIOutputStream *aStream,
-                               nsZipHeader *aHeader, int32_t aCompression) {
+nsresult nsZipDataStream::Init(nsZipWriter* aWriter, nsIOutputStream* aStream,
+                               nsZipHeader* aHeader, int32_t aCompression) {
   mWriter = aWriter;
   mHeader = aHeader;
   mStream = aStream;
@@ -55,8 +55,8 @@ nsresult nsZipDataStream::Init(nsZipWriter *aWriter, nsIOutputStream *aStream,
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipDataStream::OnDataAvailable(nsIRequest *aRequest,
-                                               nsIInputStream *aInputStream,
+NS_IMETHODIMP nsZipDataStream::OnDataAvailable(nsIRequest* aRequest,
+                                               nsIInputStream* aInputStream,
                                                uint64_t aOffset,
                                                uint32_t aCount) {
   if (!mOutput) return NS_ERROR_NOT_INITIALIZED;
@@ -70,13 +70,13 @@ NS_IMETHODIMP nsZipDataStream::OnDataAvailable(nsIRequest *aRequest,
   return ProcessData(aRequest, nullptr, buffer.get(), aOffset, aCount);
 }
 
-NS_IMETHODIMP nsZipDataStream::OnStartRequest(nsIRequest *aRequest) {
+NS_IMETHODIMP nsZipDataStream::OnStartRequest(nsIRequest* aRequest) {
   if (!mOutput) return NS_ERROR_NOT_INITIALIZED;
 
   return mOutput->OnStartRequest(aRequest);
 }
 
-NS_IMETHODIMP nsZipDataStream::OnStopRequest(nsIRequest *aRequest,
+NS_IMETHODIMP nsZipDataStream::OnStopRequest(nsIRequest* aRequest,
                                              nsresult aStatusCode) {
   if (!mOutput) return NS_ERROR_NOT_INITIALIZED;
 
@@ -109,11 +109,11 @@ inline nsresult nsZipDataStream::CompleteEntry() {
   return NS_OK;
 }
 
-nsresult nsZipDataStream::ProcessData(nsIRequest *aRequest,
-                                      nsISupports *aContext, char *aBuffer,
+nsresult nsZipDataStream::ProcessData(nsIRequest* aRequest,
+                                      nsISupports* aContext, char* aBuffer,
                                       uint64_t aOffset, uint32_t aCount) {
   mHeader->mCRC = crc32(
-      mHeader->mCRC, reinterpret_cast(aBuffer), aCount);
+      mHeader->mCRC, reinterpret_cast(aBuffer), aCount);
 
   MOZ_ASSERT(aCount <= INT32_MAX);
   nsCOMPtr stream;
@@ -127,7 +127,7 @@ nsresult nsZipDataStream::ProcessData(nsIRequest *aRequest,
   return rv;
 }
 
-nsresult nsZipDataStream::ReadStream(nsIInputStream *aStream) {
+nsresult nsZipDataStream::ReadStream(nsIInputStream* aStream) {
   if (!mOutput) return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv = OnStartRequest(nullptr);
diff --git a/modules/libjar/zipwriter/nsZipDataStream.h b/modules/libjar/zipwriter/nsZipDataStream.h
index ff74093054993..f850605f4e2f1 100644
--- a/modules/libjar/zipwriter/nsZipDataStream.h
+++ b/modules/libjar/zipwriter/nsZipDataStream.h
@@ -20,10 +20,10 @@ class nsZipDataStream final : public nsIStreamListener {
 
   nsZipDataStream() {}
 
-  nsresult Init(nsZipWriter *aWriter, nsIOutputStream *aStream,
-                nsZipHeader *aHeader, int32_t aCompression);
+  nsresult Init(nsZipWriter* aWriter, nsIOutputStream* aStream,
+                nsZipHeader* aHeader, int32_t aCompression);
 
-  nsresult ReadStream(nsIInputStream *aStream);
+  nsresult ReadStream(nsIInputStream* aStream);
 
  private:
   ~nsZipDataStream() {}
@@ -34,8 +34,8 @@ class nsZipDataStream final : public nsIStreamListener {
   RefPtr mHeader;
 
   nsresult CompleteEntry();
-  nsresult ProcessData(nsIRequest *aRequest, nsISupports *aContext,
-                       char *aBuffer, uint64_t aOffset, uint32_t aCount);
+  nsresult ProcessData(nsIRequest* aRequest, nsISupports* aContext,
+                       char* aBuffer, uint64_t aOffset, uint32_t aCount);
 };
 
 #endif
diff --git a/modules/libjar/zipwriter/nsZipHeader.cpp b/modules/libjar/zipwriter/nsZipHeader.cpp
index f4ed8781a5292..6d2164db5f057 100644
--- a/modules/libjar/zipwriter/nsZipHeader.cpp
+++ b/modules/libjar/zipwriter/nsZipHeader.cpp
@@ -25,35 +25,35 @@ using namespace mozilla;
  */
 NS_IMPL_ISUPPORTS(nsZipHeader, nsIZipEntry)
 
-NS_IMETHODIMP nsZipHeader::GetCompression(uint16_t *aCompression) {
+NS_IMETHODIMP nsZipHeader::GetCompression(uint16_t* aCompression) {
   NS_ASSERTION(mInited, "Not initalised");
 
   *aCompression = mMethod;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipHeader::GetSize(uint32_t *aSize) {
+NS_IMETHODIMP nsZipHeader::GetSize(uint32_t* aSize) {
   NS_ASSERTION(mInited, "Not initalised");
 
   *aSize = mCSize;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipHeader::GetRealSize(uint32_t *aRealSize) {
+NS_IMETHODIMP nsZipHeader::GetRealSize(uint32_t* aRealSize) {
   NS_ASSERTION(mInited, "Not initalised");
 
   *aRealSize = mUSize;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipHeader::GetCRC32(uint32_t *aCRC32) {
+NS_IMETHODIMP nsZipHeader::GetCRC32(uint32_t* aCRC32) {
   NS_ASSERTION(mInited, "Not initalised");
 
   *aCRC32 = mCRC;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipHeader::GetIsDirectory(bool *aIsDirectory) {
+NS_IMETHODIMP nsZipHeader::GetIsDirectory(bool* aIsDirectory) {
   NS_ASSERTION(mInited, "Not initalised");
 
   if (mName.Last() == '/')
@@ -63,12 +63,12 @@ NS_IMETHODIMP nsZipHeader::GetIsDirectory(bool *aIsDirectory) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipHeader::GetLastModifiedTime(PRTime *aLastModifiedTime) {
+NS_IMETHODIMP nsZipHeader::GetLastModifiedTime(PRTime* aLastModifiedTime) {
   NS_ASSERTION(mInited, "Not initalised");
 
   // Try to read timestamp from extra field
   uint16_t blocksize;
-  const uint8_t *tsField =
+  const uint8_t* tsField =
       GetExtraField(ZIP_EXTENDED_TIMESTAMP_FIELD, false, &blocksize);
   if (tsField && blocksize >= 5) {
     uint32_t pos = 4;
@@ -108,14 +108,14 @@ NS_IMETHODIMP nsZipHeader::GetLastModifiedTime(PRTime *aLastModifiedTime) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipHeader::GetIsSynthetic(bool *aIsSynthetic) {
+NS_IMETHODIMP nsZipHeader::GetIsSynthetic(bool* aIsSynthetic) {
   NS_ASSERTION(mInited, "Not initalised");
 
   *aIsSynthetic = false;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipHeader::GetPermissions(uint32_t *aPermissions) {
+NS_IMETHODIMP nsZipHeader::GetPermissions(uint32_t* aPermissions) {
   NS_ASSERTION(mInited, "Not initalised");
 
   // Always give user read access at least, this matches nsIZipReader's
@@ -124,7 +124,7 @@ NS_IMETHODIMP nsZipHeader::GetPermissions(uint32_t *aPermissions) {
   return NS_OK;
 }
 
-void nsZipHeader::Init(const nsACString &aPath, PRTime aDate, uint32_t aAttr,
+void nsZipHeader::Init(const nsACString& aPath, PRTime aDate, uint32_t aAttr,
                        uint32_t aOffset) {
   NS_ASSERTION(!mInited, "Already initalised");
 
@@ -169,7 +169,7 @@ uint32_t nsZipHeader::GetFileHeaderLength() {
   return ZIP_FILE_HEADER_SIZE + mName.Length() + mLocalFieldLength;
 }
 
-nsresult nsZipHeader::WriteFileHeader(nsIOutputStream *aStream) {
+nsresult nsZipHeader::WriteFileHeader(nsIOutputStream* aStream) {
   NS_ASSERTION(mInited, "Not initalised");
 
   uint8_t buf[ZIP_FILE_HEADER_SIZE];
@@ -186,14 +186,14 @@ nsresult nsZipHeader::WriteFileHeader(nsIOutputStream *aStream) {
   WRITE16(buf, &pos, mName.Length());
   WRITE16(buf, &pos, mLocalFieldLength);
 
-  nsresult rv = ZW_WriteData(aStream, (const char *)buf, pos);
+  nsresult rv = ZW_WriteData(aStream, (const char*)buf, pos);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = ZW_WriteData(aStream, mName.get(), mName.Length());
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (mLocalFieldLength) {
-    rv = ZW_WriteData(aStream, (const char *)mLocalExtraField.get(),
+    rv = ZW_WriteData(aStream, (const char*)mLocalExtraField.get(),
                       mLocalFieldLength);
     NS_ENSURE_SUCCESS(rv, rv);
   }
@@ -206,7 +206,7 @@ uint32_t nsZipHeader::GetCDSHeaderLength() {
          mFieldLength;
 }
 
-nsresult nsZipHeader::WriteCDSHeader(nsIOutputStream *aStream) {
+nsresult nsZipHeader::WriteCDSHeader(nsIOutputStream* aStream) {
   NS_ASSERTION(mInited, "Not initalised");
 
   uint8_t buf[ZIP_CDS_HEADER_SIZE];
@@ -229,24 +229,24 @@ nsresult nsZipHeader::WriteCDSHeader(nsIOutputStream *aStream) {
   WRITE32(buf, &pos, mEAttr);
   WRITE32(buf, &pos, mOffset);
 
-  nsresult rv = ZW_WriteData(aStream, (const char *)buf, pos);
+  nsresult rv = ZW_WriteData(aStream, (const char*)buf, pos);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = ZW_WriteData(aStream, mName.get(), mName.Length());
   NS_ENSURE_SUCCESS(rv, rv);
   if (mExtraField) {
-    rv = ZW_WriteData(aStream, (const char *)mExtraField.get(), mFieldLength);
+    rv = ZW_WriteData(aStream, (const char*)mExtraField.get(), mFieldLength);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return ZW_WriteData(aStream, mComment.get(), mComment.Length());
 }
 
-nsresult nsZipHeader::ReadCDSHeader(nsIInputStream *stream) {
+nsresult nsZipHeader::ReadCDSHeader(nsIInputStream* stream) {
   NS_ASSERTION(!mInited, "Already initalised");
 
   uint8_t buf[ZIP_CDS_HEADER_SIZE];
 
-  nsresult rv = ZW_ReadData(stream, (char *)buf, ZIP_CDS_HEADER_SIZE);
+  nsresult rv = ZW_ReadData(stream, (char*)buf, ZIP_CDS_HEADER_SIZE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint32_t pos = 0;
@@ -282,7 +282,7 @@ nsresult nsZipHeader::ReadCDSHeader(nsIInputStream *stream) {
   if (mFieldLength > 0) {
     mExtraField = MakeUnique(mFieldLength);
     NS_ENSURE_TRUE(mExtraField, NS_ERROR_OUT_OF_MEMORY);
-    rv = ZW_ReadData(stream, (char *)mExtraField.get(), mFieldLength);
+    rv = ZW_ReadData(stream, (char*)mExtraField.get(), mFieldLength);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
@@ -299,9 +299,9 @@ nsresult nsZipHeader::ReadCDSHeader(nsIInputStream *stream) {
   return NS_OK;
 }
 
-const uint8_t *nsZipHeader::GetExtraField(uint16_t aTag, bool aLocal,
-                                          uint16_t *aBlockSize) {
-  const uint8_t *buf = aLocal ? mLocalExtraField.get() : mExtraField.get();
+const uint8_t* nsZipHeader::GetExtraField(uint16_t aTag, bool aLocal,
+                                          uint16_t* aBlockSize) {
+  const uint8_t* buf = aLocal ? mLocalExtraField.get() : mExtraField.get();
   uint32_t buflen = aLocal ? mLocalFieldLength : mFieldLength;
   uint32_t pos = 0;
   uint16_t tag, blocksize;
diff --git a/modules/libjar/zipwriter/nsZipHeader.h b/modules/libjar/zipwriter/nsZipHeader.h
index e1502bd42d810..2b11dea1d0911 100644
--- a/modules/libjar/zipwriter/nsZipHeader.h
+++ b/modules/libjar/zipwriter/nsZipHeader.h
@@ -77,15 +77,15 @@ class nsZipHeader final : public nsIZipEntry {
   mozilla::UniquePtr mExtraField;
   mozilla::UniquePtr mLocalExtraField;
 
-  void Init(const nsACString &aPath, PRTime aDate, uint32_t aAttr,
+  void Init(const nsACString& aPath, PRTime aDate, uint32_t aAttr,
             uint32_t aOffset);
   uint32_t GetFileHeaderLength();
-  nsresult WriteFileHeader(nsIOutputStream *aStream);
+  nsresult WriteFileHeader(nsIOutputStream* aStream);
   uint32_t GetCDSHeaderLength();
-  nsresult WriteCDSHeader(nsIOutputStream *aStream);
-  nsresult ReadCDSHeader(nsIInputStream *aStream);
-  const uint8_t *GetExtraField(uint16_t aTag, bool aLocal,
-                               uint16_t *aBlockSize);
+  nsresult WriteCDSHeader(nsIOutputStream* aStream);
+  nsresult ReadCDSHeader(nsIInputStream* aStream);
+  const uint8_t* GetExtraField(uint16_t aTag, bool aLocal,
+                               uint16_t* aBlockSize);
   nsresult PadExtraField(uint32_t aOffset, uint16_t aAlignSize);
 };
 
diff --git a/modules/libjar/zipwriter/nsZipWriter.cpp b/modules/libjar/zipwriter/nsZipWriter.cpp
index 74187c2105272..0a3965b33daf8 100644
--- a/modules/libjar/zipwriter/nsZipWriter.cpp
+++ b/modules/libjar/zipwriter/nsZipWriter.cpp
@@ -56,14 +56,14 @@ nsZipWriter::~nsZipWriter() {
   if (mStream && !mInQueue) Close();
 }
 
-NS_IMETHODIMP nsZipWriter::GetComment(nsACString &aComment) {
+NS_IMETHODIMP nsZipWriter::GetComment(nsACString& aComment) {
   if (!mStream) return NS_ERROR_NOT_INITIALIZED;
 
   aComment = mComment;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipWriter::SetComment(const nsACString &aComment) {
+NS_IMETHODIMP nsZipWriter::SetComment(const nsACString& aComment) {
   if (!mStream) return NS_ERROR_NOT_INITIALIZED;
 
   mComment = aComment;
@@ -71,12 +71,12 @@ NS_IMETHODIMP nsZipWriter::SetComment(const nsACString &aComment) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipWriter::GetInQueue(bool *aInQueue) {
+NS_IMETHODIMP nsZipWriter::GetInQueue(bool* aInQueue) {
   *aInQueue = mInQueue;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipWriter::GetFile(nsIFile **aFile) {
+NS_IMETHODIMP nsZipWriter::GetFile(nsIFile** aFile) {
   if (!mFile) return NS_ERROR_NOT_INITIALIZED;
 
   nsCOMPtr file;
@@ -90,7 +90,7 @@ NS_IMETHODIMP nsZipWriter::GetFile(nsIFile **aFile) {
 /*
  * Reads file entries out of an existing zip file.
  */
-nsresult nsZipWriter::ReadFile(nsIFile *aFile) {
+nsresult nsZipWriter::ReadFile(nsIFile* aFile) {
   int64_t size;
   nsresult rv = aFile->GetFileSize(&size);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -120,7 +120,7 @@ nsresult nsZipWriter::ReadFile(nsIFile *aFile) {
       inputStream->Close();
       return rv;
     }
-    rv = ZW_ReadData(inputStream, (char *)buf, length);
+    rv = ZW_ReadData(inputStream, (char*)buf, length);
     if (NS_FAILED(rv)) {
       inputStream->Close();
       return rv;
@@ -146,7 +146,7 @@ nsresult nsZipWriter::ReadFile(nsIFile *aFile) {
         if (commentlen == 0)
           mComment.Truncate();
         else if (pos + commentlen <= length)
-          mComment.Assign((const char *)buf + pos, commentlen);
+          mComment.Assign((const char*)buf + pos, commentlen);
         else {
           if ((seek + pos + commentlen) > size) {
             inputStream->Close();
@@ -174,7 +174,7 @@ nsresult nsZipWriter::ReadFile(nsIFile *aFile) {
         }
 
         for (uint32_t entry = 0; entry < entries; entry++) {
-          nsZipHeader *header = new nsZipHeader();
+          nsZipHeader* header = new nsZipHeader();
           if (!header) {
             inputStream->Close();
             mEntryHash.Clear();
@@ -210,7 +210,7 @@ nsresult nsZipWriter::ReadFile(nsIFile *aFile) {
   return NS_ERROR_UNEXPECTED;
 }
 
-NS_IMETHODIMP nsZipWriter::Open(nsIFile *aFile, int32_t aIoFlags) {
+NS_IMETHODIMP nsZipWriter::Open(nsIFile* aFile, int32_t aIoFlags) {
   if (mStream) return NS_ERROR_ALREADY_INITIALIZED;
 
   NS_ENSURE_ARG_POINTER(aFile);
@@ -263,8 +263,8 @@ NS_IMETHODIMP nsZipWriter::Open(nsIFile *aFile, int32_t aIoFlags) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipWriter::GetEntry(const nsACString &aZipEntry,
-                                    nsIZipEntry **_retval) {
+NS_IMETHODIMP nsZipWriter::GetEntry(const nsACString& aZipEntry,
+                                    nsIZipEntry** _retval) {
   int32_t pos;
   if (mEntryHash.Get(aZipEntry, &pos))
     NS_ADDREF(*_retval = mHeaders[pos]);
@@ -274,14 +274,14 @@ NS_IMETHODIMP nsZipWriter::GetEntry(const nsACString &aZipEntry,
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipWriter::HasEntry(const nsACString &aZipEntry,
-                                    bool *_retval) {
+NS_IMETHODIMP nsZipWriter::HasEntry(const nsACString& aZipEntry,
+                                    bool* _retval) {
   *_retval = mEntryHash.Get(aZipEntry, nullptr);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipWriter::AddEntryDirectory(const nsACString &aZipEntry,
+NS_IMETHODIMP nsZipWriter::AddEntryDirectory(const nsACString& aZipEntry,
                                              PRTime aModTime, bool aQueue) {
   if (!mStream) return NS_ERROR_NOT_INITIALIZED;
 
@@ -299,8 +299,8 @@ NS_IMETHODIMP nsZipWriter::AddEntryDirectory(const nsACString &aZipEntry,
   return InternalAddEntryDirectory(aZipEntry, aModTime, PERMISSIONS_DIR);
 }
 
-NS_IMETHODIMP nsZipWriter::AddEntryFile(const nsACString &aZipEntry,
-                                        int32_t aCompression, nsIFile *aFile,
+NS_IMETHODIMP nsZipWriter::AddEntryFile(const nsACString& aZipEntry,
+                                        int32_t aCompression, nsIFile* aFile,
                                         bool aQueue) {
   NS_ENSURE_ARG_POINTER(aFile);
   if (!mStream) return NS_ERROR_NOT_INITIALIZED;
@@ -352,10 +352,10 @@ NS_IMETHODIMP nsZipWriter::AddEntryFile(const nsACString &aZipEntry,
   return inputStream->Close();
 }
 
-NS_IMETHODIMP nsZipWriter::AddEntryChannel(const nsACString &aZipEntry,
+NS_IMETHODIMP nsZipWriter::AddEntryChannel(const nsACString& aZipEntry,
                                            PRTime aModTime,
                                            int32_t aCompression,
-                                           nsIChannel *aChannel, bool aQueue) {
+                                           nsIChannel* aChannel, bool aQueue) {
   NS_ENSURE_ARG_POINTER(aChannel);
   if (!mStream) return NS_ERROR_NOT_INITIALIZED;
 
@@ -387,17 +387,17 @@ NS_IMETHODIMP nsZipWriter::AddEntryChannel(const nsACString &aZipEntry,
   return inputStream->Close();
 }
 
-NS_IMETHODIMP nsZipWriter::AddEntryStream(const nsACString &aZipEntry,
+NS_IMETHODIMP nsZipWriter::AddEntryStream(const nsACString& aZipEntry,
                                           PRTime aModTime, int32_t aCompression,
-                                          nsIInputStream *aStream,
+                                          nsIInputStream* aStream,
                                           bool aQueue) {
   return AddEntryStream(aZipEntry, aModTime, aCompression, aStream, aQueue,
                         PERMISSIONS_FILE);
 }
 
-nsresult nsZipWriter::AddEntryStream(const nsACString &aZipEntry,
+nsresult nsZipWriter::AddEntryStream(const nsACString& aZipEntry,
                                      PRTime aModTime, int32_t aCompression,
-                                     nsIInputStream *aStream, bool aQueue,
+                                     nsIInputStream* aStream, bool aQueue,
                                      uint32_t aPermissions) {
   NS_ENSURE_ARG_POINTER(aStream);
   if (!mStream) return NS_ERROR_NOT_INITIALIZED;
@@ -443,7 +443,7 @@ nsresult nsZipWriter::AddEntryStream(const nsACString &aZipEntry,
   return rv;
 }
 
-NS_IMETHODIMP nsZipWriter::RemoveEntry(const nsACString &aZipEntry,
+NS_IMETHODIMP nsZipWriter::RemoveEntry(const nsACString& aZipEntry,
                                        bool aQueue) {
   if (!mStream) return NS_ERROR_NOT_INITIALIZED;
 
@@ -530,8 +530,8 @@ NS_IMETHODIMP nsZipWriter::RemoveEntry(const nsACString &aZipEntry,
   return NS_ERROR_FILE_NOT_FOUND;
 }
 
-NS_IMETHODIMP nsZipWriter::ProcessQueue(nsIRequestObserver *aObserver,
-                                        nsISupports *aContext) {
+NS_IMETHODIMP nsZipWriter::ProcessQueue(nsIRequestObserver* aObserver,
+                                        nsISupports* aContext) {
   if (!mStream) return NS_ERROR_NOT_INITIALIZED;
   if (mInQueue) return NS_ERROR_IN_PROGRESS;
 
@@ -572,7 +572,7 @@ NS_IMETHODIMP nsZipWriter::Close() {
     WRITE32(buf, &pos, mCDSOffset);
     WRITE16(buf, &pos, mComment.Length());
 
-    nsresult rv = ZW_WriteData(mStream, (const char *)buf, pos);
+    nsresult rv = ZW_WriteData(mStream, (const char*)buf, pos);
     if (NS_FAILED(rv)) {
       Cleanup();
       return rv;
@@ -593,7 +593,7 @@ NS_IMETHODIMP nsZipWriter::Close() {
 
     // Go back and rewrite the file headers
     for (int32_t i = 0; i < mHeaders.Count(); i++) {
-      nsZipHeader *header = mHeaders[i];
+      nsZipHeader* header = mHeaders[i];
       if (!header->mWriteOnClose) continue;
 
       rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, header->mOffset);
@@ -619,11 +619,11 @@ NS_IMETHODIMP nsZipWriter::Close() {
 }
 
 // Our nsIRequestObserver monitors removal operations performed on the queue
-NS_IMETHODIMP nsZipWriter::OnStartRequest(nsIRequest *aRequest) {
+NS_IMETHODIMP nsZipWriter::OnStartRequest(nsIRequest* aRequest) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsZipWriter::OnStopRequest(nsIRequest *aRequest,
+NS_IMETHODIMP nsZipWriter::OnStopRequest(nsIRequest* aRequest,
                                          nsresult aStatusCode) {
   if (NS_FAILED(aStatusCode)) {
     FinishQueue(aStatusCode);
@@ -660,7 +660,7 @@ NS_IMETHODIMP nsZipWriter::AlignStoredFiles(uint16_t aAlignSize) {
   }
 
   for (int i = 0; i < mHeaders.Count(); i++) {
-    nsZipHeader *header = mHeaders[i];
+    nsZipHeader* header = mHeaders[i];
 
     // Check whether this entry is file and compression method is stored.
     bool isdir;
@@ -768,7 +768,7 @@ NS_IMETHODIMP nsZipWriter::AlignStoredFiles(uint16_t aAlignSize) {
   return NS_OK;
 }
 
-nsresult nsZipWriter::InternalAddEntryDirectory(const nsACString &aZipEntry,
+nsresult nsZipWriter::InternalAddEntryDirectory(const nsACString& aZipEntry,
                                                 PRTime aModTime,
                                                 uint32_t aPermissions) {
   RefPtr header = new nsZipHeader();
@@ -836,7 +836,7 @@ void nsZipWriter::Cleanup() {
 /*
  * Called when writing a file to the zip is complete.
  */
-nsresult nsZipWriter::EntryCompleteCallback(nsZipHeader *aHeader,
+nsresult nsZipWriter::EntryCompleteCallback(nsZipHeader* aHeader,
                                             nsresult aStatus) {
   if (NS_SUCCEEDED(aStatus)) {
     mEntryHash.Put(aHeader->mName, mHeaders.Count());
@@ -858,8 +858,8 @@ nsresult nsZipWriter::EntryCompleteCallback(nsZipHeader *aHeader,
   return rv;
 }
 
-inline nsresult nsZipWriter::BeginProcessingAddition(nsZipQueueItem *aItem,
-                                                     bool *complete) {
+inline nsresult nsZipWriter::BeginProcessingAddition(nsZipQueueItem* aItem,
+                                                     bool* complete) {
   if (aItem->mFile) {
     bool exists;
     nsresult rv = aItem->mFile->Exists(&exists);
diff --git a/modules/libjar/zipwriter/nsZipWriter.h b/modules/libjar/zipwriter/nsZipWriter.h
index 925eeca7f5e23..cb1e47b263975 100644
--- a/modules/libjar/zipwriter/nsZipWriter.h
+++ b/modules/libjar/zipwriter/nsZipWriter.h
@@ -46,7 +46,7 @@ class nsZipWriter final : public nsIZipWriter, public nsIRequestObserver {
   NS_DECL_NSIREQUESTOBSERVER
 
   nsZipWriter();
-  nsresult EntryCompleteCallback(nsZipHeader *aHeader, nsresult aStatus);
+  nsresult EntryCompleteCallback(nsZipHeader* aHeader, nsresult aStatus);
 
  private:
   ~nsZipWriter();
@@ -66,13 +66,13 @@ class nsZipWriter final : public nsIZipWriter, public nsIRequestObserver {
 
   nsresult SeekCDS();
   void Cleanup();
-  nsresult ReadFile(nsIFile *aFile);
-  nsresult InternalAddEntryDirectory(const nsACString &aZipEntry,
+  nsresult ReadFile(nsIFile* aFile);
+  nsresult InternalAddEntryDirectory(const nsACString& aZipEntry,
                                      PRTime aModTime, uint32_t aPermissions);
-  nsresult BeginProcessingAddition(nsZipQueueItem *aItem, bool *complete);
+  nsresult BeginProcessingAddition(nsZipQueueItem* aItem, bool* complete);
   nsresult BeginProcessingRemoval(int32_t aPos);
-  nsresult AddEntryStream(const nsACString &aZipEntry, PRTime aModTime,
-                          int32_t aCompression, nsIInputStream *aStream,
+  nsresult AddEntryStream(const nsACString& aZipEntry, PRTime aModTime,
+                          int32_t aCompression, nsIInputStream* aStream,
                           bool aQueue, uint32_t aPermissions);
   void BeginProcessingNextItem();
   void FinishQueue(nsresult aStatus);
diff --git a/mozglue/android/NSSBridge.h b/mozglue/android/NSSBridge.h
index 8cfa47d6c7c18..3ebe7ff033827 100644
--- a/mozglue/android/NSSBridge.h
+++ b/mozglue/android/NSSBridge.h
@@ -17,27 +17,27 @@
 
 #include 
 
-int setup_nss_functions(void *nss_handle, void *nssutil_handle,
-                        void *plc_handle);
+int setup_nss_functions(void* nss_handle, void* nssutil_handle,
+                        void* plc_handle);
 
 #define NSS_WRAPPER(name, return_type, args...) \
   typedef return_type (*name##_t)(args);        \
   extern name##_t f_##name;
 
-NSS_WRAPPER(NSS_Initialize, SECStatus, const char *, const char *, const char *,
-            const char *, uint32_t)
+NSS_WRAPPER(NSS_Initialize, SECStatus, const char*, const char*, const char*,
+            const char*, uint32_t)
 NSS_WRAPPER(NSS_Shutdown, void, void)
-NSS_WRAPPER(PK11SDR_Encrypt, SECStatus, SECItem *, SECItem *, SECItem *, void *)
-NSS_WRAPPER(PK11SDR_Decrypt, SECStatus, SECItem *, SECItem *, void *)
-NSS_WRAPPER(SECITEM_ZfreeItem, void, SECItem *, PRBool)
-NSS_WRAPPER(PR_ErrorToString, char *, PRErrorCode, PRLanguageCode)
+NSS_WRAPPER(PK11SDR_Encrypt, SECStatus, SECItem*, SECItem*, SECItem*, void*)
+NSS_WRAPPER(PK11SDR_Decrypt, SECStatus, SECItem*, SECItem*, void*)
+NSS_WRAPPER(SECITEM_ZfreeItem, void, SECItem*, PRBool)
+NSS_WRAPPER(PR_ErrorToString, char*, PRErrorCode, PRLanguageCode)
 NSS_WRAPPER(PR_GetError, PRErrorCode, void)
-NSS_WRAPPER(PR_Free, PRErrorCode, char *)
-NSS_WRAPPER(PL_Base64Encode, char *, const char *, uint32_t, char *)
-NSS_WRAPPER(PL_Base64Decode, char *, const char *, uint32_t, char *)
-NSS_WRAPPER(PL_strfree, void, char *)
-NSS_WRAPPER(PK11_GetInternalKeySlot, PK11SlotInfo *, void)
-NSS_WRAPPER(PK11_NeedUserInit, PRBool, PK11SlotInfo *)
-NSS_WRAPPER(PK11_InitPin, SECStatus, PK11SlotInfo *, const char *, const char *)
+NSS_WRAPPER(PR_Free, PRErrorCode, char*)
+NSS_WRAPPER(PL_Base64Encode, char*, const char*, uint32_t, char*)
+NSS_WRAPPER(PL_Base64Decode, char*, const char*, uint32_t, char*)
+NSS_WRAPPER(PL_strfree, void, char*)
+NSS_WRAPPER(PK11_GetInternalKeySlot, PK11SlotInfo*, void)
+NSS_WRAPPER(PK11_NeedUserInit, PRBool, PK11SlotInfo*)
+NSS_WRAPPER(PK11_InitPin, SECStatus, PK11SlotInfo*, const char*, const char*)
 
 #endif /* NSS_h */
diff --git a/mozglue/android/NativeCrypto.cpp b/mozglue/android/NativeCrypto.cpp
index b1695b9de4991..f24f6eb55c968 100644
--- a/mozglue/android/NativeCrypto.cpp
+++ b/mozglue/android/NativeCrypto.cpp
@@ -20,7 +20,7 @@
  */
 extern "C" JNIEXPORT jbyteArray MOZ_JNICALL
 Java_org_mozilla_gecko_background_nativecode_NativeCrypto_pbkdf2SHA256(
-    JNIEnv *env, jclass jc, jbyteArray jpassword, jbyteArray jsalt, jint c,
+    JNIEnv* env, jclass jc, jbyteArray jpassword, jbyteArray jsalt, jint c,
     jint dkLen) {
   if (dkLen < 0) {
     env->ThrowNew(env->FindClass("java/lang/IllegalArgumentException"),
@@ -28,14 +28,14 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_pbkdf2SHA256(
     return nullptr;
   }
 
-  jbyte *password = env->GetByteArrayElements(jpassword, nullptr);
+  jbyte* password = env->GetByteArrayElements(jpassword, nullptr);
   size_t passwordLen = env->GetArrayLength(jpassword);
 
-  jbyte *salt = env->GetByteArrayElements(jsalt, nullptr);
+  jbyte* salt = env->GetByteArrayElements(jsalt, nullptr);
   size_t saltLen = env->GetArrayLength(jsalt);
 
   uint8_t hashResult[dkLen];
-  PBKDF2_SHA256((uint8_t *)password, passwordLen, (uint8_t *)salt, saltLen,
+  PBKDF2_SHA256((uint8_t*)password, passwordLen, (uint8_t*)salt, saltLen,
                 (uint64_t)c, hashResult, (size_t)dkLen);
 
   env->ReleaseByteArrayElements(jpassword, password, JNI_ABORT);
@@ -45,7 +45,7 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_pbkdf2SHA256(
   if (out == nullptr) {
     return nullptr;
   }
-  env->SetByteArrayRegion(out, 0, dkLen, (jbyte *)hashResult);
+  env->SetByteArrayRegion(out, 0, dkLen, (jbyte*)hashResult);
 
   return out;
 }
@@ -57,13 +57,13 @@ using namespace mozilla;
  */
 extern "C" JNIEXPORT jbyteArray MOZ_JNICALL
 Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1(
-    JNIEnv *env, jclass jc, jbyteArray jstr) {
-  jbyte *str = env->GetByteArrayElements(jstr, nullptr);
+    JNIEnv* env, jclass jc, jbyteArray jstr) {
+  jbyte* str = env->GetByteArrayElements(jstr, nullptr);
   size_t strLen = env->GetArrayLength(jstr);
 
   SHA1Sum sha1;
   SHA1Sum::Hash hashResult;
-  sha1.update((void *)str, (uint32_t)strLen);
+  sha1.update((void*)str, (uint32_t)strLen);
   sha1.finish(hashResult);
 
   env->ReleaseByteArrayElements(jstr, str, JNI_ABORT);
@@ -72,7 +72,7 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1(
   if (out == nullptr) {
     return nullptr;
   }
-  env->SetByteArrayRegion(out, 0, SHA1Sum::kHashSize, (jbyte *)hashResult);
+  env->SetByteArrayRegion(out, 0, SHA1Sum::kHashSize, (jbyte*)hashResult);
 
   return out;
 }
@@ -82,17 +82,16 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1(
  */
 extern "C" JNIEXPORT jbyteArray MOZ_JNICALL
 Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256init(
-    JNIEnv *env, jclass jc) {
+    JNIEnv* env, jclass jc) {
   jbyteArray out = env->NewByteArray(sizeof(SHA256_CTX));
   if (nullptr == out) {
     return nullptr;
   }
 
-  SHA256_CTX *shaContext =
-      (SHA256_CTX *)env->GetByteArrayElements(out, nullptr);
+  SHA256_CTX* shaContext = (SHA256_CTX*)env->GetByteArrayElements(out, nullptr);
   SHA256_Init(shaContext);
 
-  env->ReleaseByteArrayElements(out, (jbyte *)shaContext, 0);
+  env->ReleaseByteArrayElements(out, (jbyte*)shaContext, 0);
 
   return out;
 }
@@ -102,16 +101,16 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256init(
  */
 extern "C" JNIEXPORT void MOZ_JNICALL
 Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256update(
-    JNIEnv *env, jclass jc, jbyteArray jctx, jbyteArray jstr, jint len) {
-  jbyte *str = env->GetByteArrayElements(jstr, nullptr);
+    JNIEnv* env, jclass jc, jbyteArray jctx, jbyteArray jstr, jint len) {
+  jbyte* str = env->GetByteArrayElements(jstr, nullptr);
 
-  SHA256_CTX *shaContext =
-      (SHA256_CTX *)env->GetByteArrayElements(jctx, nullptr);
+  SHA256_CTX* shaContext =
+      (SHA256_CTX*)env->GetByteArrayElements(jctx, nullptr);
 
-  SHA256_Update(shaContext, (void *)str, (size_t)len);
+  SHA256_Update(shaContext, (void*)str, (size_t)len);
 
   env->ReleaseByteArrayElements(jstr, str, JNI_ABORT);
-  env->ReleaseByteArrayElements(jctx, (jbyte *)shaContext, 0);
+  env->ReleaseByteArrayElements(jctx, (jbyte*)shaContext, 0);
 
   return;
 }
@@ -121,18 +120,18 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256update(
  */
 extern "C" JNIEXPORT jbyteArray MOZ_JNICALL
 Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256finalize(
-    JNIEnv *env, jclass jc, jbyteArray jctx) {
-  SHA256_CTX *shaContext =
-      (SHA256_CTX *)env->GetByteArrayElements(jctx, nullptr);
+    JNIEnv* env, jclass jc, jbyteArray jctx) {
+  SHA256_CTX* shaContext =
+      (SHA256_CTX*)env->GetByteArrayElements(jctx, nullptr);
 
-  unsigned char *digest = new unsigned char[32];
+  unsigned char* digest = new unsigned char[32];
   SHA256_Final(digest, shaContext);
 
-  env->ReleaseByteArrayElements(jctx, (jbyte *)shaContext, JNI_ABORT);
+  env->ReleaseByteArrayElements(jctx, (jbyte*)shaContext, JNI_ABORT);
 
   jbyteArray out = env->NewByteArray(32);
   if (nullptr != out) {
-    env->SetByteArrayRegion(out, 0, 32, (jbyte *)digest);
+    env->SetByteArrayRegion(out, 0, 32, (jbyte*)digest);
   }
 
   delete[] digest;
diff --git a/mozglue/android/NativeCrypto.h b/mozglue/android/NativeCrypto.h
index 3ce8be05ae5fb..e06145ef6bca7 100644
--- a/mozglue/android/NativeCrypto.h
+++ b/mozglue/android/NativeCrypto.h
@@ -14,7 +14,7 @@ extern "C" {
  */
 JNIEXPORT jbyteArray JNICALL
 Java_org_mozilla_gecko_background_nativecode_NativeCrypto_pbkdf2SHA256(
-    JNIEnv *, jclass, jbyteArray, jbyteArray, jint, jint);
+    JNIEnv*, jclass, jbyteArray, jbyteArray, jint, jint);
 
 /*
  * Class:     org_mozilla_gecko_background_nativecode_NativeCrypto
@@ -22,7 +22,7 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_pbkdf2SHA256(
  * Signature: ([B)[B
  */
 JNIEXPORT jbyteArray JNICALL
-Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1(JNIEnv *, jclass,
+Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1(JNIEnv*, jclass,
                                                                jbyteArray);
 
 /*
@@ -31,7 +31,7 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1(JNIEnv *, jclass,
  * Signature: ()[B
  */
 JNIEXPORT jbyteArray JNICALL
-Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256init(JNIEnv *,
+Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256init(JNIEnv*,
                                                                      jclass);
 
 /*
@@ -41,7 +41,7 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256init(JNIEnv *,
  */
 JNIEXPORT void JNICALL
 Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256update(
-    JNIEnv *, jclass, jbyteArray, jbyteArray, jint);
+    JNIEnv*, jclass, jbyteArray, jbyteArray, jint);
 
 /*
  * Class:     org_mozilla_gecko_background_nativecode_NativeCrypto
@@ -50,7 +50,7 @@ Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256update(
  */
 JNIEXPORT jbyteArray JNICALL
 Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256finalize(
-    JNIEnv *, jclass, jbyteArray);
+    JNIEnv*, jclass, jbyteArray);
 
 #  ifdef __cplusplus
 }
diff --git a/mozglue/android/SQLiteBridge.h b/mozglue/android/SQLiteBridge.h
index dae2ae1fce845..121ce2ab109de 100644
--- a/mozglue/android/SQLiteBridge.h
+++ b/mozglue/android/SQLiteBridge.h
@@ -7,30 +7,30 @@
 
 #include "sqlite3.h"
 
-void setup_sqlite_functions(void *sqlite_handle);
+void setup_sqlite_functions(void* sqlite_handle);
 
 #define SQLITE_WRAPPER(name, return_type, args...) \
   typedef return_type (*name##_t)(args);           \
   extern name##_t f_##name;
 
-SQLITE_WRAPPER(sqlite3_open, int, const char *, sqlite3 **)
-SQLITE_WRAPPER(sqlite3_errmsg, const char *, sqlite3 *)
-SQLITE_WRAPPER(sqlite3_prepare_v2, int, sqlite3 *, const char *, int,
-               sqlite3_stmt **, const char **)
-SQLITE_WRAPPER(sqlite3_bind_parameter_count, int, sqlite3_stmt *)
-SQLITE_WRAPPER(sqlite3_bind_text, int, sqlite3_stmt *, int, const char *, int,
-               void (*)(void *))
-SQLITE_WRAPPER(sqlite3_bind_null, int, sqlite3_stmt *, int)
-SQLITE_WRAPPER(sqlite3_step, int, sqlite3_stmt *)
-SQLITE_WRAPPER(sqlite3_column_count, int, sqlite3_stmt *)
-SQLITE_WRAPPER(sqlite3_finalize, int, sqlite3_stmt *)
-SQLITE_WRAPPER(sqlite3_close, int, sqlite3 *)
-SQLITE_WRAPPER(sqlite3_column_name, const char *, sqlite3_stmt *, int)
-SQLITE_WRAPPER(sqlite3_column_type, int, sqlite3_stmt *, int)
-SQLITE_WRAPPER(sqlite3_column_blob, const void *, sqlite3_stmt *, int)
-SQLITE_WRAPPER(sqlite3_column_bytes, int, sqlite3_stmt *, int)
-SQLITE_WRAPPER(sqlite3_column_text, const unsigned char *, sqlite3_stmt *, int)
-SQLITE_WRAPPER(sqlite3_changes, int, sqlite3 *)
-SQLITE_WRAPPER(sqlite3_last_insert_rowid, sqlite3_int64, sqlite3 *)
+SQLITE_WRAPPER(sqlite3_open, int, const char*, sqlite3**)
+SQLITE_WRAPPER(sqlite3_errmsg, const char*, sqlite3*)
+SQLITE_WRAPPER(sqlite3_prepare_v2, int, sqlite3*, const char*, int,
+               sqlite3_stmt**, const char**)
+SQLITE_WRAPPER(sqlite3_bind_parameter_count, int, sqlite3_stmt*)
+SQLITE_WRAPPER(sqlite3_bind_text, int, sqlite3_stmt*, int, const char*, int,
+               void (*)(void*))
+SQLITE_WRAPPER(sqlite3_bind_null, int, sqlite3_stmt*, int)
+SQLITE_WRAPPER(sqlite3_step, int, sqlite3_stmt*)
+SQLITE_WRAPPER(sqlite3_column_count, int, sqlite3_stmt*)
+SQLITE_WRAPPER(sqlite3_finalize, int, sqlite3_stmt*)
+SQLITE_WRAPPER(sqlite3_close, int, sqlite3*)
+SQLITE_WRAPPER(sqlite3_column_name, const char*, sqlite3_stmt*, int)
+SQLITE_WRAPPER(sqlite3_column_type, int, sqlite3_stmt*, int)
+SQLITE_WRAPPER(sqlite3_column_blob, const void*, sqlite3_stmt*, int)
+SQLITE_WRAPPER(sqlite3_column_bytes, int, sqlite3_stmt*, int)
+SQLITE_WRAPPER(sqlite3_column_text, const unsigned char*, sqlite3_stmt*, int)
+SQLITE_WRAPPER(sqlite3_changes, int, sqlite3*)
+SQLITE_WRAPPER(sqlite3_last_insert_rowid, sqlite3_int64, sqlite3*)
 
 #endif /* SQLiteBridge_h */
diff --git a/mozglue/android/nsGeckoUtils.cpp b/mozglue/android/nsGeckoUtils.cpp
index c032aff3beb98..d6fbf5c0d70e4 100644
--- a/mozglue/android/nsGeckoUtils.cpp
+++ b/mozglue/android/nsGeckoUtils.cpp
@@ -16,9 +16,9 @@
 #endif
 
 extern "C" __attribute__((visibility("default"))) void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv(JNIEnv *jenv, jclass,
+Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv(JNIEnv* jenv, jclass,
                                                   jstring map) {
-  const char *str;
+  const char* str;
   // XXX: java doesn't give us true UTF8, we should figure out something
   // better to do here
   str = jenv->GetStringUTFChars(map, nullptr);
@@ -28,9 +28,9 @@ Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv(JNIEnv *jenv, jclass,
 }
 
 extern "C" APKOPEN_EXPORT jboolean MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_verifyCRCs(JNIEnv *jenv, jclass,
+Java_org_mozilla_gecko_mozglue_GeckoLoader_verifyCRCs(JNIEnv* jenv, jclass,
                                                       jstring jApkName) {
-  const char *str;
+  const char* str;
   // XXX: java doesn't give us true UTF8, we should figure out something
   // better to do here
   str = jenv->GetStringUTFChars(jApkName, nullptr);
@@ -46,9 +46,9 @@ Java_org_mozilla_gecko_mozglue_GeckoLoader_verifyCRCs(JNIEnv *jenv, jclass,
 
 extern "C" __attribute__((visibility("default"))) jobject MOZ_JNICALL
 Java_org_mozilla_gecko_mozglue_DirectBufferAllocator_nativeAllocateDirectBuffer(
-    JNIEnv *jenv, jclass, jlong size) {
+    JNIEnv* jenv, jclass, jlong size) {
   jobject buffer = nullptr;
-  void *mem = malloc(size);
+  void* mem = malloc(size);
   if (mem) {
     buffer = jenv->NewDirectByteBuffer(mem, size);
     if (!buffer) free(mem);
@@ -58,14 +58,14 @@ Java_org_mozilla_gecko_mozglue_DirectBufferAllocator_nativeAllocateDirectBuffer(
 
 extern "C" __attribute__((visibility("default"))) void MOZ_JNICALL
 Java_org_mozilla_gecko_mozglue_DirectBufferAllocator_nativeFreeDirectBuffer(
-    JNIEnv *jenv, jclass, jobject buf) {
+    JNIEnv* jenv, jclass, jobject buf) {
   free(jenv->GetDirectBufferAddress(buf));
 }
 
 extern "C" __attribute__((visibility("default"))) jlong MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_NativeZip_getZip(JNIEnv *jenv, jclass,
+Java_org_mozilla_gecko_mozglue_NativeZip_getZip(JNIEnv* jenv, jclass,
                                                 jstring path) {
-  const char *str;
+  const char* str;
   str = jenv->GetStringUTFChars(path, nullptr);
   if (!str || !*str) {
     if (str) jenv->ReleaseStringUTFChars(path, str);
@@ -83,10 +83,10 @@ Java_org_mozilla_gecko_mozglue_NativeZip_getZip(JNIEnv *jenv, jclass,
 }
 
 extern "C" __attribute__((visibility("default"))) jlong MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_NativeZip_getZipFromByteBuffer(JNIEnv *jenv,
+Java_org_mozilla_gecko_mozglue_NativeZip_getZipFromByteBuffer(JNIEnv* jenv,
                                                               jclass,
                                                               jobject buffer) {
-  void *buf = jenv->GetDirectBufferAddress(buffer);
+  void* buf = jenv->GetDirectBufferAddress(buffer);
   size_t size = jenv->GetDirectBufferCapacity(buffer);
   RefPtr zip = Zip::Create(buf, size);
   if (!zip) {
@@ -97,19 +97,19 @@ Java_org_mozilla_gecko_mozglue_NativeZip_getZipFromByteBuffer(JNIEnv *jenv,
 }
 
 extern "C" __attribute__((visibility("default"))) void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_NativeZip__1release(JNIEnv *jenv, jclass,
+Java_org_mozilla_gecko_mozglue_NativeZip__1release(JNIEnv* jenv, jclass,
                                                    jlong obj) {
-  Zip *zip = (Zip *)obj;
+  Zip* zip = (Zip*)obj;
   zip->Release();
 }
 
 extern "C" __attribute__((visibility("default"))) jobject MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_NativeZip__1getInputStream(JNIEnv *jenv,
+Java_org_mozilla_gecko_mozglue_NativeZip__1getInputStream(JNIEnv* jenv,
                                                           jobject jzip,
                                                           jlong obj,
                                                           jstring path) {
-  Zip *zip = (Zip *)obj;
-  const char *str;
+  Zip* zip = (Zip*)obj;
+  const char* str;
   str = jenv->GetStringUTFChars(path, nullptr);
 
   Zip::Stream stream;
@@ -118,8 +118,8 @@ Java_org_mozilla_gecko_mozglue_NativeZip__1getInputStream(JNIEnv *jenv,
   if (!res) {
     return nullptr;
   }
-  jobject buf = jenv->NewDirectByteBuffer(
-      const_cast(stream.GetBuffer()), stream.GetSize());
+  jobject buf = jenv->NewDirectByteBuffer(const_cast(stream.GetBuffer()),
+                                          stream.GetSize());
   if (!buf) {
     JNI_Throw(jenv, "java/lang/RuntimeException",
               "Failed to create ByteBuffer");
@@ -139,8 +139,8 @@ Java_org_mozilla_gecko_mozglue_NativeZip__1getInputStream(JNIEnv *jenv,
 
 extern "C" __attribute__((visibility("default"))) jboolean MOZ_JNICALL
 Java_org_mozilla_gecko_mozglue_MinidumpAnalyzer_GenerateStacks(
-    JNIEnv *jenv, jclass, jstring minidumpPath, jboolean fullStacks) {
-  const char *str;
+    JNIEnv* jenv, jclass, jstring minidumpPath, jboolean fullStacks) {
+  const char* str;
   str = jenv->GetStringUTFChars(minidumpPath, nullptr);
 
   bool res = CrashReporter::GenerateStacks(str, fullStacks);
diff --git a/mozglue/android/pbkdf2_sha256.c b/mozglue/android/pbkdf2_sha256.c
index 30bf1c5986e70..119d24547627a 100644
--- a/mozglue/android/pbkdf2_sha256.c
+++ b/mozglue/android/pbkdf2_sha256.c
@@ -32,15 +32,15 @@
 
 #include "pbkdf2_sha256.h"
 
-static inline uint32_t be32dec(const void *pp) {
-  const uint8_t *p = (uint8_t const *)pp;
+static inline uint32_t be32dec(const void* pp) {
+  const uint8_t* p = (uint8_t const*)pp;
 
   return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
           ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
 }
 
-static inline void be32enc(void *pp, uint32_t x) {
-  uint8_t *p = (uint8_t *)pp;
+static inline void be32enc(void* pp, uint32_t x) {
+  uint8_t* p = (uint8_t*)pp;
 
   p[3] = x & 0xff;
   p[2] = (x >> 8) & 0xff;
@@ -52,7 +52,7 @@ static inline void be32enc(void *pp, uint32_t x) {
  * Encode a length len/4 vector of (uint32_t) into a length len vector of
  * (unsigned char) in big-endian form.  Assumes len is a multiple of 4.
  */
-static void be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len) {
+static void be32enc_vect(unsigned char* dst, const uint32_t* src, size_t len) {
   size_t i;
 
   for (i = 0; i < len / 4; i++) be32enc(dst + i * 4, src[i]);
@@ -62,7 +62,7 @@ static void be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len) {
  * Decode a big-endian length len vector of (unsigned char) into a length
  * len/4 vector of (uint32_t).  Assumes len is a multiple of 4.
  */
-static void be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len) {
+static void be32dec_vect(uint32_t* dst, const unsigned char* src, size_t len) {
   size_t i;
 
   for (i = 0; i < len / 4; i++) dst[i] = be32dec(src + i * 4);
@@ -95,7 +95,7 @@ static void be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len) {
  * SHA256 block compression function.  The 256-bit state is transformed via
  * the 512-bit input block to produce a new state.
  */
-static void SHA256_Transform(uint32_t *state, const unsigned char block[64]) {
+static void SHA256_Transform(uint32_t* state, const unsigned char block[64]) {
   uint32_t W[64];
   uint32_t S[8];
   uint32_t t0, t1;
@@ -190,7 +190,7 @@ static unsigned char PAD[64] = {
     0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
 /* Add padding and terminating bit-count. */
-static void SHA256_Pad(SHA256_CTX *ctx) {
+static void SHA256_Pad(SHA256_CTX* ctx) {
   unsigned char len[8];
   uint32_t r, plen;
 
@@ -210,7 +210,7 @@ static void SHA256_Pad(SHA256_CTX *ctx) {
 }
 
 /* SHA-256 initialization.  Begins a SHA-256 operation. */
-void SHA256_Init(SHA256_CTX *ctx) {
+void SHA256_Init(SHA256_CTX* ctx) {
   /* Zero bits processed so far. */
   ctx->count[0] = ctx->count[1] = 0;
 
@@ -226,10 +226,10 @@ void SHA256_Init(SHA256_CTX *ctx) {
 }
 
 /* Add bytes into the hash. */
-void SHA256_Update(SHA256_CTX *ctx, const void *in, size_t len) {
+void SHA256_Update(SHA256_CTX* ctx, const void* in, size_t len) {
   uint32_t bitlen[2];
   uint32_t r;
-  const unsigned char *src = in;
+  const unsigned char* src = in;
 
   /* Number of bytes left in the buffer from previous updates. */
   r = (ctx->count[1] >> 3) & 0x3f;
@@ -269,7 +269,7 @@ void SHA256_Update(SHA256_CTX *ctx, const void *in, size_t len) {
  * SHA-256 finalization.  Pads the input data, exports the hash value,
  * and clears the context state.
  */
-void SHA256_Final(unsigned char digest[32], SHA256_CTX *ctx) {
+void SHA256_Final(unsigned char digest[32], SHA256_CTX* ctx) {
   /* Add padding. */
   SHA256_Pad(ctx);
 
@@ -277,14 +277,14 @@ void SHA256_Final(unsigned char digest[32], SHA256_CTX *ctx) {
   be32enc_vect(digest, ctx->state, 32);
 
   /* Clear the context state. */
-  memset((void *)ctx, 0, sizeof(*ctx));
+  memset((void*)ctx, 0, sizeof(*ctx));
 }
 
 /* Initialize an HMAC-SHA256 operation with the given key. */
-void HMAC_SHA256_Init(HMAC_SHA256_CTX *ctx, const void *_K, size_t Klen) {
+void HMAC_SHA256_Init(HMAC_SHA256_CTX* ctx, const void* _K, size_t Klen) {
   unsigned char pad[64];
   unsigned char khash[32];
-  const unsigned char *K = _K;
+  const unsigned char* K = _K;
   size_t i;
 
   /* If Klen > 64, the key is really SHA256(K). */
@@ -313,13 +313,13 @@ void HMAC_SHA256_Init(HMAC_SHA256_CTX *ctx, const void *_K, size_t Klen) {
 }
 
 /* Add bytes to the HMAC-SHA256 operation. */
-void HMAC_SHA256_Update(HMAC_SHA256_CTX *ctx, const void *in, size_t len) {
+void HMAC_SHA256_Update(HMAC_SHA256_CTX* ctx, const void* in, size_t len) {
   /* Feed data to the inner SHA256 operation. */
   SHA256_Update(&ctx->ictx, in, len);
 }
 
 /* Finish an HMAC-SHA256 operation. */
-void HMAC_SHA256_Final(unsigned char digest[32], HMAC_SHA256_CTX *ctx) {
+void HMAC_SHA256_Final(unsigned char digest[32], HMAC_SHA256_CTX* ctx) {
   unsigned char ihash[32];
 
   /* Finish the inner SHA256 operation. */
@@ -340,8 +340,8 @@ void HMAC_SHA256_Final(unsigned char digest[32], HMAC_SHA256_CTX *ctx) {
  * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and
  * write the output to buf.  The value dkLen must be at most 32 * (2^32 - 1).
  */
-void PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, const uint8_t *salt,
-                   size_t saltlen, uint64_t c, uint8_t *buf, size_t dkLen) {
+void PBKDF2_SHA256(const uint8_t* passwd, size_t passwdlen, const uint8_t* salt,
+                   size_t saltlen, uint64_t c, uint8_t* buf, size_t dkLen) {
   HMAC_SHA256_CTX PShctx, hctx;
   size_t i;
   uint8_t ivec[4];
diff --git a/mozglue/android/pbkdf2_sha256.h b/mozglue/android/pbkdf2_sha256.h
index 0f2b79db9b407..80223ffcd51a6 100644
--- a/mozglue/android/pbkdf2_sha256.h
+++ b/mozglue/android/pbkdf2_sha256.h
@@ -48,20 +48,20 @@ typedef struct HMAC_SHA256Context {
   SHA256_CTX octx;
 } HMAC_SHA256_CTX;
 
-void SHA256_Init(SHA256_CTX *);
-void SHA256_Update(SHA256_CTX *, const void *, size_t);
-void SHA256_Final(unsigned char[32], SHA256_CTX *);
-void HMAC_SHA256_Init(HMAC_SHA256_CTX *, const void *, size_t);
-void HMAC_SHA256_Update(HMAC_SHA256_CTX *, const void *, size_t);
-void HMAC_SHA256_Final(unsigned char[32], HMAC_SHA256_CTX *);
+void SHA256_Init(SHA256_CTX*);
+void SHA256_Update(SHA256_CTX*, const void*, size_t);
+void SHA256_Final(unsigned char[32], SHA256_CTX*);
+void HMAC_SHA256_Init(HMAC_SHA256_CTX*, const void*, size_t);
+void HMAC_SHA256_Update(HMAC_SHA256_CTX*, const void*, size_t);
+void HMAC_SHA256_Final(unsigned char[32], HMAC_SHA256_CTX*);
 
 /**
  * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen):
  * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and
  * write the output to buf.  The value dkLen must be at most 32 * (2^32 - 1).
  */
-void PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t,
-                   uint8_t *, size_t);
+void PBKDF2_SHA256(const uint8_t*, size_t, const uint8_t*, size_t, uint64_t,
+                   uint8_t*, size_t);
 
 #ifdef __cplusplus
 }
diff --git a/mozglue/build/SSE.cpp b/mozglue/build/SSE.cpp
index 7432ce39071ca..403c653c817a7 100644
--- a/mozglue/build/SSE.cpp
+++ b/mozglue/build/SSE.cpp
@@ -110,10 +110,10 @@ static bool has_cpuid_bits(unsigned int level, CPUIDRegister reg,
                            unsigned int bits) {
   // Check that the level in question is supported.
   volatile int regs[4];
-  moz_cpuid((int *)regs, level & 0x80000000u);
+  moz_cpuid((int*)regs, level & 0x80000000u);
   if (unsigned(regs[0]) < level) return false;
 
-  moz_cpuid((int *)regs, level);
+  moz_cpuid((int*)regs, level);
   return (unsigned(regs[reg]) & bits) == bits;
 }
 
diff --git a/mozglue/build/arm.cpp b/mozglue/build/arm.cpp
index e29d5fca56774..a74a41f6c0e65 100644
--- a/mozglue/build/arm.cpp
+++ b/mozglue/build/arm.cpp
@@ -27,7 +27,7 @@ enum {
 
 static unsigned get_arm_cpu_flags(void) {
   unsigned flags;
-  FILE *fin;
+  FILE* fin;
   bool armv6_processor = false;
   flags = 0;
   /*Reading /proc/self/auxv would be easier, but that doesn't work reliably on
@@ -42,7 +42,7 @@ static unsigned get_arm_cpu_flags(void) {
     char buf[512];
     while (fgets(buf, 511, fin) != nullptr) {
       if (memcmp(buf, "Features", 8) == 0) {
-        char *p;
+        char* p;
         p = strstr(buf, " edsp");
         if (p != nullptr && (p[5] == ' ' || p[5] == '\n'))
           flags |= MOZILLA_HAS_EDSP_FLAG;
diff --git a/mozglue/build/mips.cpp b/mozglue/build/mips.cpp
index fa75d621e1615..7166080f5ea01 100644
--- a/mozglue/build/mips.cpp
+++ b/mozglue/build/mips.cpp
@@ -16,7 +16,7 @@ enum {
 
 static unsigned get_mips_cpu_flags(void) {
   unsigned flags = 0;
-  FILE *fin;
+  FILE* fin;
 
   fin = fopen("/proc/cpuinfo", "r");
   if (fin != nullptr) {
diff --git a/mozglue/linker/BaseElf.cpp b/mozglue/linker/BaseElf.cpp
index 4eca168b5236e..78542b38752fa 100644
--- a/mozglue/linker/BaseElf.cpp
+++ b/mozglue/linker/BaseElf.cpp
@@ -10,8 +10,8 @@
 
 using namespace Elf;
 
-unsigned long BaseElf::Hash(const char *symbol) {
-  const unsigned char *sym = reinterpret_cast(symbol);
+unsigned long BaseElf::Hash(const char* symbol) {
+  const unsigned char* sym = reinterpret_cast(symbol);
   unsigned long h = 0, g;
   while (*sym) {
     h = (h << 4) + *sym++;
@@ -22,20 +22,20 @@ unsigned long BaseElf::Hash(const char *symbol) {
   return h;
 }
 
-void *BaseElf::GetSymbolPtr(const char *symbol) const {
+void* BaseElf::GetSymbolPtr(const char* symbol) const {
   return GetSymbolPtr(symbol, Hash(symbol));
 }
 
-void *BaseElf::GetSymbolPtr(const char *symbol, unsigned long hash) const {
-  const Sym *sym = GetSymbol(symbol, hash);
-  void *ptr = nullptr;
+void* BaseElf::GetSymbolPtr(const char* symbol, unsigned long hash) const {
+  const Sym* sym = GetSymbol(symbol, hash);
+  void* ptr = nullptr;
   if (sym && sym->st_shndx != SHN_UNDEF) ptr = GetPtr(sym->st_value);
   DEBUG_LOG("BaseElf::GetSymbolPtr(%p [\"%s\"], \"%s\") = %p",
-            reinterpret_cast(this), GetPath(), symbol, ptr);
+            reinterpret_cast(this), GetPath(), symbol, ptr);
   return ptr;
 }
 
-const Sym *BaseElf::GetSymbol(const char *symbol, unsigned long hash) const {
+const Sym* BaseElf::GetSymbol(const char* symbol, unsigned long hash) const {
   /* Search symbol with the buckets and chains tables.
    * The hash computed from the symbol name gives an index in the buckets
    * table. The corresponding value in the bucket table is an index in the
@@ -52,10 +52,10 @@ const Sym *BaseElf::GetSymbol(const char *symbol, unsigned long hash) const {
   return nullptr;
 }
 
-bool BaseElf::Contains(void *addr) const { return base.Contains(addr); }
+bool BaseElf::Contains(void* addr) const { return base.Contains(addr); }
 
 #ifdef __ARM_EABI__
-const void *BaseElf::FindExidx(int *pcount) const {
+const void* BaseElf::FindExidx(int* pcount) const {
   if (arm_exidx) {
     *pcount = arm_exidx.numElements();
     return arm_exidx;
@@ -65,8 +65,8 @@ const void *BaseElf::FindExidx(int *pcount) const {
 }
 #endif
 
-already_AddRefed LoadedElf::Create(const char *path,
-                                              void *base_addr) {
+already_AddRefed LoadedElf::Create(const char* path,
+                                              void* base_addr) {
   DEBUG_LOG("LoadedElf::Create(\"%s\", %p) = ...", path, base_addr);
 
   uint8_t mapped;
@@ -77,22 +77,22 @@ already_AddRefed LoadedElf::Create(const char *path,
    * prelinked libraries on glibc unsupported. This is not an interesting
    * use case for now, so don't try supporting that case.
    */
-  if (mincore(const_cast(base_addr), PageSize(), &mapped))
+  if (mincore(const_cast(base_addr), PageSize(), &mapped))
     return nullptr;
 
   RefPtr elf = new LoadedElf(path);
 
-  const Ehdr *ehdr = Ehdr::validate(base_addr);
+  const Ehdr* ehdr = Ehdr::validate(base_addr);
   if (!ehdr) return nullptr;
 
   Addr min_vaddr = (Addr)-1;  // We want to find the lowest and biggest
   Addr max_vaddr = 0;         // virtual address used by this Elf.
-  const Phdr *dyn = nullptr;
+  const Phdr* dyn = nullptr;
 #ifdef __ARM_EABI__
-  const Phdr *arm_exidx_phdr = nullptr;
+  const Phdr* arm_exidx_phdr = nullptr;
 #endif
 
-  Array phdrs(reinterpret_cast(ehdr) + ehdr->e_phoff,
+  Array phdrs(reinterpret_cast(ehdr) + ehdr->e_phoff,
                     ehdr->e_phnum);
   for (auto phdr = phdrs.begin(); phdr < phdrs.end(); ++phdr) {
     switch (phdr->p_type) {
@@ -123,8 +123,8 @@ already_AddRefed LoadedElf::Create(const char *path,
    * can thus be adjusted accordingly.
    */
   if (min_vaddr != 0) {
-    void *min_vaddr_ptr =
-        reinterpret_cast(static_cast(min_vaddr));
+    void* min_vaddr_ptr =
+        reinterpret_cast(static_cast(min_vaddr));
     if (min_vaddr_ptr != base_addr) {
       LOG("%s: %p != %p", elf->GetPath(), min_vaddr_ptr, base_addr);
       return nullptr;
@@ -147,13 +147,13 @@ already_AddRefed LoadedElf::Create(const char *path,
 #endif
 
   DEBUG_LOG("LoadedElf::Create(\"%s\", %p) = %p", path, base_addr,
-            static_cast(elf));
+            static_cast(elf));
 
   ElfLoader::Singleton.Register(elf);
   return elf.forget();
 }
 
-bool LoadedElf::InitDyn(const Phdr *pt_dyn) {
+bool LoadedElf::InitDyn(const Phdr* pt_dyn) {
   Array dyns;
   dyns.InitSize(GetPtr(pt_dyn->p_vaddr), pt_dyn->p_filesz);
 
@@ -162,7 +162,7 @@ bool LoadedElf::InitDyn(const Phdr *pt_dyn) {
     switch (dyn->d_tag) {
       case DT_HASH: {
         DEBUG_LOG("%s 0x%08" PRIxPTR, "DT_HASH", uintptr_t(dyn->d_un.d_val));
-        const Elf::Word *hash_table_header = GetPtr(dyn->d_un.d_ptr);
+        const Elf::Word* hash_table_header = GetPtr(dyn->d_un.d_ptr);
         symnum = hash_table_header[1];
         buckets.Init(&hash_table_header[2], hash_table_header[0]);
         chains.Init(&*buckets.end());
diff --git a/mozglue/linker/BaseElf.h b/mozglue/linker/BaseElf.h
index 8c50dbe7a4286..9569dbc579ea1 100644
--- a/mozglue/linker/BaseElf.h
+++ b/mozglue/linker/BaseElf.h
@@ -17,21 +17,21 @@ class BaseElf : public LibHandle {
   /**
    * Hash function for symbol lookup, as defined in ELF standard for System V.
    */
-  static unsigned long Hash(const char *symbol);
+  static unsigned long Hash(const char* symbol);
 
   /**
    * Returns the address corresponding to the given symbol name (with a
    * pre-computed hash).
    */
-  void *GetSymbolPtr(const char *symbol, unsigned long hash) const;
+  void* GetSymbolPtr(const char* symbol, unsigned long hash) const;
 
   /**
    * Returns a pointer to the Elf Symbol in the Dynamic Symbol table
    * corresponding to the given symbol name (with a pre-computed hash).
    */
-  const Elf::Sym *GetSymbol(const char *symbol, unsigned long hash) const;
+  const Elf::Sym* GetSymbol(const char* symbol, unsigned long hash) const;
 
-  explicit BaseElf(const char *path, Mappable *mappable = nullptr)
+  explicit BaseElf(const char* path, Mappable* mappable = nullptr)
       : LibHandle(path), mappable(mappable) {}
 
  protected:
@@ -39,15 +39,15 @@ class BaseElf : public LibHandle {
    * Inherited from LibHandle. Those are temporary and are not supposed to
    * be used.
    */
-  virtual void *GetSymbolPtr(const char *symbol) const;
-  virtual bool Contains(void *addr) const;
-  virtual void *GetBase() const { return GetPtr(0); }
+  virtual void* GetSymbolPtr(const char* symbol) const;
+  virtual bool Contains(void* addr) const;
+  virtual void* GetBase() const { return GetPtr(0); }
 
 #ifdef __ARM_EABI__
-  virtual const void *FindExidx(int *pcount) const;
+  virtual const void* FindExidx(int* pcount) const;
 #endif
 
-  virtual Mappable *GetMappable() const { return NULL; };
+  virtual Mappable* GetMappable() const { return NULL; };
 
  public:
   /* private: */
@@ -55,9 +55,9 @@ class BaseElf : public LibHandle {
    * Returns a pointer relative to the base address where the library is
    * loaded.
    */
-  void *GetPtr(const Elf::Addr offset) const {
-    if (reinterpret_cast(offset) > base)
-      return reinterpret_cast(offset);
+  void* GetPtr(const Elf::Addr offset) const {
+    if (reinterpret_cast(offset) > base)
+      return reinterpret_cast(offset);
     return base + offset;
   }
 
@@ -65,10 +65,10 @@ class BaseElf : public LibHandle {
    * Like the above, but returns a typed (const) pointer
    */
   template 
-  const T *GetPtr(const Elf::Addr offset) const {
-    if (reinterpret_cast(offset) > base)
-      return reinterpret_cast(offset);
-    return reinterpret_cast(base + offset);
+  const T* GetPtr(const Elf::Addr offset) const {
+    if (reinterpret_cast(offset) > base)
+      return reinterpret_cast(offset);
+    return reinterpret_cast(base + offset);
   }
 
   /* Appropriated Mappable */
@@ -105,10 +105,10 @@ class LoadedElf : public BaseElf {
    * Returns a LoadedElf corresponding to the already loaded ELF
    * at the given base address.
    */
-  static already_AddRefed Create(const char *path, void *base_addr);
+  static already_AddRefed Create(const char* path, void* base_addr);
 
  private:
-  explicit LoadedElf(const char *path) : BaseElf(path) {}
+  explicit LoadedElf(const char* path) : BaseElf(path) {}
 
   ~LoadedElf() {
     /* Avoid base's destructor unmapping something that doesn't actually
@@ -122,7 +122,7 @@ class LoadedElf : public BaseElf {
    * PT_DYNAMIC header.
    * Returns whether this succeeded or failed.
    */
-  bool InitDyn(const Elf::Phdr *pt_dyn);
+  bool InitDyn(const Elf::Phdr* pt_dyn);
 };
 
 #endif /* BaseElf_h */
diff --git a/mozglue/linker/CustomElf.cpp b/mozglue/linker/CustomElf.cpp
index dd78445766801..10dc40d2b5b95 100644
--- a/mozglue/linker/CustomElf.cpp
+++ b/mozglue/linker/CustomElf.cpp
@@ -22,18 +22,18 @@ using namespace Elf;
  * crash reporter */
 #ifdef ANDROID
 extern "C" {
-void report_mapping(char *name, void *base, uint32_t len, uint32_t offset);
-void delete_mapping(const char *name);
+void report_mapping(char* name, void* base, uint32_t len, uint32_t offset);
+void delete_mapping(const char* name);
 }
 #else
 #  define report_mapping(...)
 #  define delete_mapping(...)
 #endif
 
-const Ehdr *Ehdr::validate(const void *buf) {
+const Ehdr* Ehdr::validate(const void* buf) {
   if (!buf || buf == MAP_FAILED) return nullptr;
 
-  const Ehdr *ehdr = reinterpret_cast(buf);
+  const Ehdr* ehdr = reinterpret_cast(buf);
 
   /* Only support ELF executables or libraries for the host system */
   if (memcmp(ELFMAG, &ehdr->e_ident, SELFMAG) ||
@@ -54,7 +54,7 @@ const Ehdr *Ehdr::validate(const void *buf) {
 
 namespace {
 
-void debug_phdr(const char *type, const Phdr *phdr) {
+void debug_phdr(const char* type, const Phdr* phdr) {
   DEBUG_LOG("%s @0x%08" PRIxPTR
             " ("
             "filesz: 0x%08" PRIxPTR
@@ -83,20 +83,20 @@ static int p_flags_to_mprot(Word flags) {
  */
 class Mappable1stPagePtr : public GenericMappedPtr {
  public:
-  explicit Mappable1stPagePtr(Mappable *mappable)
+  explicit Mappable1stPagePtr(Mappable* mappable)
       : GenericMappedPtr(
             mappable->mmap(nullptr, PageSize(), PROT_READ, MAP_PRIVATE, 0)),
         mappable(mappable) {}
 
  private:
   friend class GenericMappedPtr;
-  void munmap(void *buf, size_t length) { mappable->munmap(buf, length); }
+  void munmap(void* buf, size_t length) { mappable->munmap(buf, length); }
 
   RefPtr mappable;
 };
 
-already_AddRefed CustomElf::Load(Mappable *mappable,
-                                            const char *path, int flags) {
+already_AddRefed CustomElf::Load(Mappable* mappable,
+                                            const char* path, int flags) {
   DEBUG_LOG("CustomElf::Load(\"%s\", 0x%x) = ...", path, flags);
   if (!mappable) return nullptr;
   /* Keeping a RefPtr of the CustomElf is going to free the appropriate
@@ -106,23 +106,23 @@ already_AddRefed CustomElf::Load(Mappable *mappable,
   Mappable1stPagePtr ehdr_raw(mappable);
   if (ehdr_raw == MAP_FAILED) return nullptr;
 
-  const Ehdr *ehdr = Ehdr::validate(ehdr_raw);
+  const Ehdr* ehdr = Ehdr::validate(ehdr_raw);
   if (!ehdr) return nullptr;
 
   /* Scan Elf Program Headers and gather some information about them */
-  std::vector pt_loads;
+  std::vector pt_loads;
   Addr min_vaddr = (Addr)-1;  // We want to find the lowest and biggest
   Addr max_vaddr = 0;         // virtual address used by this Elf.
-  const Phdr *dyn = nullptr;
+  const Phdr* dyn = nullptr;
 
-  const Phdr *first_phdr = reinterpret_cast(
-      reinterpret_cast(ehdr) + ehdr->e_phoff);
-  const Phdr *end_phdr = &first_phdr[ehdr->e_phnum];
+  const Phdr* first_phdr = reinterpret_cast(
+      reinterpret_cast(ehdr) + ehdr->e_phoff);
+  const Phdr* end_phdr = &first_phdr[ehdr->e_phnum];
 #ifdef __ARM_EABI__
-  const Phdr *arm_exidx_phdr = nullptr;
+  const Phdr* arm_exidx_phdr = nullptr;
 #endif
 
-  for (const Phdr *phdr = first_phdr; phdr < end_phdr; phdr++) {
+  for (const Phdr* phdr = first_phdr; phdr < end_phdr; phdr++) {
     switch (phdr->p_type) {
       case PT_LOAD:
         debug_phdr("PT_LOAD", phdr);
@@ -200,14 +200,14 @@ already_AddRefed CustomElf::Load(Mappable *mappable,
   }
 
   /* Load and initialize library */
-  for (std::vector::iterator it = pt_loads.begin();
+  for (std::vector::iterator it = pt_loads.begin();
        it < pt_loads.end(); ++it)
     if (!elf->LoadSegment(*it)) return nullptr;
 
   /* We're not going to mmap anymore */
   mappable->finalize();
 
-  report_mapping(const_cast(elf->GetName()), elf->base,
+  report_mapping(const_cast(elf->GetName()), elf->base,
                  (max_vaddr + PAGE_SIZE - 1) & PAGE_MASK, 0);
 
   elf->l_addr = elf->base;
@@ -218,7 +218,7 @@ already_AddRefed CustomElf::Load(Mappable *mappable,
   if (!elf->InitDyn(dyn)) return nullptr;
 
   if (elf->has_text_relocs) {
-    for (std::vector::iterator it = pt_loads.begin();
+    for (std::vector::iterator it = pt_loads.begin();
          it < pt_loads.end(); ++it)
       mprotect(PageAlignedPtr(elf->GetPtr((*it)->p_vaddr)),
                PageAlignedEndPtr((*it)->p_memsz),
@@ -228,7 +228,7 @@ already_AddRefed CustomElf::Load(Mappable *mappable,
   if (!elf->Relocate() || !elf->RelocateJumps()) return nullptr;
 
   if (elf->has_text_relocs) {
-    for (std::vector::iterator it = pt_loads.begin();
+    for (std::vector::iterator it = pt_loads.begin();
          it < pt_loads.end(); ++it)
       mprotect(PageAlignedPtr(elf->GetPtr((*it)->p_vaddr)),
                PageAlignedEndPtr((*it)->p_memsz),
@@ -244,13 +244,13 @@ already_AddRefed CustomElf::Load(Mappable *mappable,
 #endif
 
   DEBUG_LOG("CustomElf::Load(\"%s\", 0x%x) = %p", path, flags,
-            static_cast(elf));
+            static_cast(elf));
   return elf.forget();
 }
 
 CustomElf::~CustomElf() {
-  DEBUG_LOG("CustomElf::~CustomElf(%p [\"%s\"])",
-            reinterpret_cast(this), GetPath());
+  DEBUG_LOG("CustomElf::~CustomElf(%p [\"%s\"])", reinterpret_cast(this),
+            GetPath());
   CallFini();
   /* Normally, __cxa_finalize is called by the .fini function. However,
    * Android NDK before r6b doesn't do that. Our wrapped cxa_finalize only
@@ -260,7 +260,7 @@ CustomElf::~CustomElf() {
   delete_mapping(GetName());
 }
 
-void *CustomElf::GetSymbolPtrInDeps(const char *symbol) const {
+void* CustomElf::GetSymbolPtrInDeps(const char* symbol) const {
   /* Resolve dlopen and related functions to point to ours */
   if (symbol[0] == 'd' && symbol[1] == 'l') {
     if (strcmp(symbol + 2, "open") == 0) return FunctionPtr(__wrap_dlopen);
@@ -282,7 +282,7 @@ void *CustomElf::GetSymbolPtrInDeps(const char *symbol) const {
     if (strcmp(symbol + 2, "cxa_finalize") == 0)
       return FunctionPtr(&ElfLoader::__wrap_cxa_finalize);
     if (strcmp(symbol + 2, "dso_handle") == 0)
-      return const_cast(this);
+      return const_cast(this);
 #ifdef __ARM_EABI__
     if (strcmp(symbol + 2, "gnu_Unwind_Find_exidx") == 0)
       return FunctionPtr(__wrap___gnu_Unwind_Find_exidx);
@@ -292,7 +292,7 @@ void *CustomElf::GetSymbolPtrInDeps(const char *symbol) const {
     if (strcmp(symbol + 2, "gaction") == 0) return FunctionPtr(sigaction);
   }
 
-  void *sym;
+  void* sym;
 
   unsigned long hash = Hash(symbol);
 
@@ -300,7 +300,7 @@ void *CustomElf::GetSymbolPtrInDeps(const char *symbol) const {
   if (ElfLoader::Singleton.self_elf) {
     /* We consider the library containing this code a permanent LD_PRELOAD,
      * so, check if the symbol exists here first. */
-    sym = static_cast(ElfLoader::Singleton.self_elf.get())
+    sym = static_cast(ElfLoader::Singleton.self_elf.get())
               ->GetSymbolPtr(symbol, hash);
     if (sym) return sym;
   }
@@ -317,7 +317,7 @@ void *CustomElf::GetSymbolPtrInDeps(const char *symbol) const {
     /* Skip if it's the library containing this code, since we've already
      * looked at it above. */
     if (*it == ElfLoader::Singleton.self_elf) continue;
-    if (BaseElf *be = (*it)->AsBaseElf()) {
+    if (BaseElf* be = (*it)->AsBaseElf()) {
       sym = be->GetSymbolPtr(symbol, hash);
     } else {
       sym = (*it)->GetSymbolPtr(symbol);
@@ -327,7 +327,7 @@ void *CustomElf::GetSymbolPtrInDeps(const char *symbol) const {
   return nullptr;
 }
 
-bool CustomElf::LoadSegment(const Phdr *pt_load) const {
+bool CustomElf::LoadSegment(const Phdr* pt_load) const {
   if (pt_load->p_type != PT_LOAD) {
     DEBUG_LOG("%s: Elf::LoadSegment only takes PT_LOAD program headers",
               GetPath());
@@ -383,7 +383,7 @@ bool CustomElf::LoadSegment(const Phdr *pt_load) const {
     Addr mem_end = pt_load->p_vaddr + pt_load->p_memsz;
     Addr next_page = PageAlignedEndPtr(file_end);
     if (next_page > file_end) {
-      void *ptr = GetPtr(file_end);
+      void* ptr = GetPtr(file_end);
       memset(ptr, 0, next_page - file_end);
     }
     if (mem_end > next_page) {
@@ -398,19 +398,19 @@ bool CustomElf::LoadSegment(const Phdr *pt_load) const {
 
 namespace {
 
-void debug_dyn(const char *type, const Dyn *dyn) {
+void debug_dyn(const char* type, const Dyn* dyn) {
   DEBUG_LOG("%s 0x%08" PRIxPTR, type, uintptr_t(dyn->d_un.d_val));
 }
 
 } /* anonymous namespace */
 
-bool CustomElf::InitDyn(const Phdr *pt_dyn) {
+bool CustomElf::InitDyn(const Phdr* pt_dyn) {
   /* Scan PT_DYNAMIC segment and gather some information */
-  const Dyn *first_dyn = GetPtr(pt_dyn->p_vaddr);
-  const Dyn *end_dyn = GetPtr(pt_dyn->p_vaddr + pt_dyn->p_filesz);
+  const Dyn* first_dyn = GetPtr(pt_dyn->p_vaddr);
+  const Dyn* end_dyn = GetPtr(pt_dyn->p_vaddr + pt_dyn->p_filesz);
   std::vector dt_needed;
   size_t symnum = 0;
-  for (const Dyn *dyn = first_dyn; dyn < end_dyn && dyn->d_tag; dyn++) {
+  for (const Dyn* dyn = first_dyn; dyn < end_dyn && dyn->d_tag; dyn++) {
     switch (dyn->d_tag) {
       case DT_NEEDED:
         debug_dyn("DT_NEEDED", dyn);
@@ -418,7 +418,7 @@ bool CustomElf::InitDyn(const Phdr *pt_dyn) {
         break;
       case DT_HASH: {
         debug_dyn("DT_HASH", dyn);
-        const Word *hash_table_header = GetPtr(dyn->d_un.d_ptr);
+        const Word* hash_table_header = GetPtr(dyn->d_un.d_ptr);
         symnum = hash_table_header[1];
         buckets.Init(&hash_table_header[2], hash_table_header[0]);
         chains.Init(&*buckets.end());
@@ -568,7 +568,7 @@ bool CustomElf::InitDyn(const Phdr *pt_dyn) {
 
   /* Load dependent libraries */
   for (size_t i = 0; i < dt_needed.size(); i++) {
-    const char *name = strtab.GetStringAt(dt_needed[i]);
+    const char* name = strtab.GetStringAt(dt_needed[i]);
     RefPtr handle =
         ElfLoader::Singleton.Load(name, RTLD_GLOBAL | RTLD_LAZY, this);
     if (!handle) return false;
@@ -579,17 +579,17 @@ bool CustomElf::InitDyn(const Phdr *pt_dyn) {
 }
 
 bool CustomElf::Relocate() {
-  DEBUG_LOG("Relocate %s @%p", GetPath(), static_cast(base));
+  DEBUG_LOG("Relocate %s @%p", GetPath(), static_cast(base));
   uint32_t symtab_index = (uint32_t)-1;
-  void *symptr = nullptr;
+  void* symptr = nullptr;
   for (Array::iterator rel = relocations.begin();
        rel < relocations.end(); ++rel) {
     /* Location of the relocation */
-    void *ptr = GetPtr(rel->r_offset);
+    void* ptr = GetPtr(rel->r_offset);
 
     /* R_*_RELATIVE relocations apply directly at the given location */
     if (ELF_R_TYPE(rel->r_info) == R_RELATIVE) {
-      *(void **)ptr = GetPtr(rel->GetAddend(base));
+      *(void**)ptr = GetPtr(rel->GetAddend(base));
       continue;
     }
     /* Other relocation types need a symbol resolution */
@@ -613,11 +613,11 @@ bool CustomElf::Relocate() {
     switch (ELF_R_TYPE(rel->r_info)) {
       case R_GLOB_DAT:
         /* R_*_GLOB_DAT relocations simply use the symbol value */
-        *(void **)ptr = symptr;
+        *(void**)ptr = symptr;
         break;
       case R_ABS:
         /* R_*_ABS* relocations add the relocation added to the symbol value */
-        *(const char **)ptr = (const char *)symptr + rel->GetAddend(base);
+        *(const char**)ptr = (const char*)symptr + rel->GetAddend(base);
         break;
       default:
         ERROR("%s: Unsupported relocation type: 0x%" PRIxPTR, GetPath(),
@@ -633,7 +633,7 @@ bool CustomElf::RelocateJumps() {
   for (Array::iterator rel = jumprels.begin(); rel < jumprels.end();
        ++rel) {
     /* Location of the relocation */
-    void *ptr = GetPtr(rel->r_offset);
+    void* ptr = GetPtr(rel->r_offset);
 
     /* Only R_*_JMP_SLOT relocations are expected */
     if (ELF_R_TYPE(rel->r_info) != R_JMP_SLOT) {
@@ -643,7 +643,7 @@ bool CustomElf::RelocateJumps() {
 
     /* TODO: Avoid code duplication with the relocations above */
     const Sym sym = symtab[ELF_R_SYM(rel->r_info)];
-    void *symptr;
+    void* symptr;
     if (sym.st_shndx != SHN_UNDEF)
       symptr = GetPtr(sym.st_value);
     else
@@ -662,7 +662,7 @@ bool CustomElf::RelocateJumps() {
       }
     }
     /* Apply relocation */
-    *(void **)ptr = symptr;
+    *(void**)ptr = symptr;
   }
   return true;
 }
@@ -670,10 +670,10 @@ bool CustomElf::RelocateJumps() {
 bool CustomElf::CallInit() {
   if (init) CallFunction(init);
 
-  for (Array::iterator it = init_array.begin(); it < init_array.end();
+  for (Array::iterator it = init_array.begin(); it < init_array.end();
        ++it) {
     /* Android x86 NDK wrongly puts 0xffffffff in INIT_ARRAY */
-    if (*it && *it != reinterpret_cast(-1)) CallFunction(*it);
+    if (*it && *it != reinterpret_cast(-1)) CallFunction(*it);
   }
   initialized = true;
   return true;
@@ -681,15 +681,15 @@ bool CustomElf::CallInit() {
 
 void CustomElf::CallFini() {
   if (!initialized) return;
-  for (Array::reverse_iterator it = fini_array.rbegin();
+  for (Array::reverse_iterator it = fini_array.rbegin();
        it < fini_array.rend(); ++it) {
     /* Android x86 NDK wrongly puts 0xffffffff in FINI_ARRAY */
-    if (*it && *it != reinterpret_cast(-1)) CallFunction(*it);
+    if (*it && *it != reinterpret_cast(-1)) CallFunction(*it);
   }
   if (fini) CallFunction(fini);
 }
 
-Mappable *CustomElf::GetMappable() const {
+Mappable* CustomElf::GetMappable() const {
   if (!mappable) return nullptr;
   if (mappable->GetKind() == Mappable::MAPPABLE_EXTRACT_FILE) return mappable;
   return ElfLoader::GetMappableFromPath(GetPath());
diff --git a/mozglue/linker/CustomElf.h b/mozglue/linker/CustomElf.h
index 35d70825c48b2..f7b116e9d38a5 100644
--- a/mozglue/linker/CustomElf.h
+++ b/mozglue/linker/CustomElf.h
@@ -28,7 +28,7 @@ class CustomElf : public BaseElf, private ElfLoader::link_map {
    * currently, none are supported and the behaviour is more or less that of
    * RTLD_GLOBAL | RTLD_BIND_NOW.
    */
-  static already_AddRefed Load(Mappable *mappable, const char *path,
+  static already_AddRefed Load(Mappable* mappable, const char* path,
                                           int flags);
 
   /**
@@ -37,14 +37,14 @@ class CustomElf : public BaseElf, private ElfLoader::link_map {
   virtual ~CustomElf();
 
  protected:
-  virtual Mappable *GetMappable() const;
+  virtual Mappable* GetMappable() const;
 
  public:
   /**
    * Returns the instance, casted as BaseElf. (short of a better way to do
    * this without RTTI)
    */
-  virtual BaseElf *AsBaseElf() { return this; }
+  virtual BaseElf* AsBaseElf() { return this; }
 
  private:
   /**
@@ -52,12 +52,12 @@ class CustomElf : public BaseElf, private ElfLoader::link_map {
    * given symbol name. This is used to find symbols that are undefined
    * in the Elf object.
    */
-  void *GetSymbolPtrInDeps(const char *symbol) const;
+  void* GetSymbolPtrInDeps(const char* symbol) const;
 
   /**
    * Private constructor
    */
-  CustomElf(Mappable *mappable, const char *path)
+  CustomElf(Mappable* mappable, const char* path)
       : BaseElf(path, mappable),
         link_map(),
         init(0),
@@ -69,14 +69,14 @@ class CustomElf : public BaseElf, private ElfLoader::link_map {
    * Loads an Elf segment defined by the given PT_LOAD header.
    * Returns whether this succeeded or failed.
    */
-  bool LoadSegment(const Elf::Phdr *pt_load) const;
+  bool LoadSegment(const Elf::Phdr* pt_load) const;
 
   /**
    * Initializes the library according to information found in the given
    * PT_DYNAMIC header.
    * Returns whether this succeeded or failed.
    */
-  bool InitDyn(const Elf::Phdr *pt_dyn);
+  bool InitDyn(const Elf::Phdr* pt_dyn);
 
   /**
    * Apply .rel.dyn/.rela.dyn relocations.
@@ -105,11 +105,11 @@ class CustomElf : public BaseElf, private ElfLoader::link_map {
   /**
    * Call a function given a pointer to its location.
    */
-  void CallFunction(void *ptr) const {
+  void CallFunction(void* ptr) const {
     /* C++ doesn't allow direct conversion between pointer-to-object
      * and pointer-to-function. */
     union {
-      void *ptr;
+      void* ptr;
       void (*func)(void);
     } f;
     f.ptr = ptr;
@@ -137,7 +137,7 @@ class CustomElf : public BaseElf, private ElfLoader::link_map {
 
   /* List of initialization and destruction functions
    * (.init_array/.fini_array) */
-  Array init_array, fini_array;
+  Array init_array, fini_array;
 
   bool initialized;
 
diff --git a/mozglue/linker/ElfLoader.cpp b/mozglue/linker/ElfLoader.cpp
index f93378da6dff0..67f3f6debfe3b 100644
--- a/mozglue/linker/ElfLoader.cpp
+++ b/mozglue/linker/ElfLoader.cpp
@@ -33,7 +33,7 @@ mozilla::Atomic gPageSize;
 
 extern "C" {
 
-inline int sigaltstack(const stack_t *ss, stack_t *oss) {
+inline int sigaltstack(const stack_t* ss, stack_t* oss) {
   return syscall(__NR_sigaltstack, ss, oss);
 }
 
@@ -42,14 +42,14 @@ inline int sigaltstack(const stack_t *ss, stack_t *oss) {
 #endif   /* ANDROID */
 
 #ifdef __ARM_EABI__
-extern "C" MOZ_EXPORT const void *__gnu_Unwind_Find_exidx(void *pc, int *pcount)
+extern "C" MOZ_EXPORT const void* __gnu_Unwind_Find_exidx(void* pc, int* pcount)
     __attribute__((weak));
 #endif
 
 /* Ideally we'd #include , but that's a world of pain
  * Moreover, not all versions of android support it, so we need a weak
  * reference. */
-extern "C" MOZ_EXPORT int dl_iterate_phdr(dl_phdr_cb callback, void *data)
+extern "C" MOZ_EXPORT int dl_iterate_phdr(dl_phdr_cb callback, void* data)
     __attribute__((weak));
 
 /* Pointer to the PT_DYNAMIC section of the executable or library
@@ -60,14 +60,14 @@ extern "C" Elf::Dyn _DYNAMIC[];
  * dlfcn.h replacements functions
  */
 
-void *__wrap_dlopen(const char *path, int flags) {
+void* __wrap_dlopen(const char* path, int flags) {
   RefPtr handle = ElfLoader::Singleton.Load(path, flags);
   if (handle) handle->AddDirectRef();
   return handle;
 }
 
-const char *__wrap_dlerror(void) {
-  const char *error = ElfLoader::Singleton.lastError.exchange(nullptr);
+const char* __wrap_dlerror(void) {
+  const char* error = ElfLoader::Singleton.lastError.exchange(nullptr);
   if (error) {
     // Return a custom error if available.
     return error;
@@ -76,13 +76,13 @@ const char *__wrap_dlerror(void) {
   return dlerror();
 }
 
-void *__wrap_dlsym(void *handle, const char *symbol) {
+void* __wrap_dlsym(void* handle, const char* symbol) {
   if (!handle) {
     ElfLoader::Singleton.lastError = "dlsym(NULL, sym) unsupported";
     return nullptr;
   }
   if (handle != RTLD_DEFAULT && handle != RTLD_NEXT) {
-    LibHandle *h = reinterpret_cast(handle);
+    LibHandle* h = reinterpret_cast(handle);
     return h->GetSymbolPtr(symbol);
   }
 
@@ -90,16 +90,16 @@ void *__wrap_dlsym(void *handle, const char *symbol) {
   return dlsym(handle, symbol);
 }
 
-int __wrap_dlclose(void *handle) {
+int __wrap_dlclose(void* handle) {
   if (!handle) {
     ElfLoader::Singleton.lastError = "No handle given to dlclose()";
     return -1;
   }
-  reinterpret_cast(handle)->ReleaseDirectRef();
+  reinterpret_cast(handle)->ReleaseDirectRef();
   return 0;
 }
 
-int __wrap_dladdr(void *addr, Dl_info *info) {
+int __wrap_dladdr(void* addr, Dl_info* info) {
   RefPtr handle = ElfLoader::Singleton.GetHandleByPtr(addr);
   if (!handle) {
     return dladdr(addr, info);
@@ -118,8 +118,8 @@ class DlIteratePhdrHelper {
     write_fd.reset(pipefd[1]);
   }
 
-  int fill_and_call(dl_phdr_cb callback, const void *l_addr, const char *l_name,
-                    void *data);
+  int fill_and_call(dl_phdr_cb callback, const void* l_addr, const char* l_name,
+                    void* data);
 
  private:
   bool valid_pipe;
@@ -130,8 +130,8 @@ class DlIteratePhdrHelper {
 // This function is called for each shared library iterated over by
 // dl_iterate_phdr, and is used to fill a dl_phdr_info which is then
 // sent through to the dl_iterate_phdr callback.
-int DlIteratePhdrHelper::fill_and_call(dl_phdr_cb callback, const void *l_addr,
-                                       const char *l_name, void *data) {
+int DlIteratePhdrHelper::fill_and_call(dl_phdr_cb callback, const void* l_addr,
+                                       const char* l_name, void* data) {
   dl_phdr_info info;
   info.dlpi_addr = reinterpret_cast(l_addr);
   info.dlpi_name = l_name;
@@ -185,10 +185,10 @@ int DlIteratePhdrHelper::fill_and_call(dl_phdr_cb callback, const void *l_addr,
   }
 
   if (valid_pipe && can_read) {
-    const Elf::Ehdr *ehdr = Elf::Ehdr::validate(l_addr);
+    const Elf::Ehdr* ehdr = Elf::Ehdr::validate(l_addr);
     if (ehdr) {
-      info.dlpi_phdr = reinterpret_cast(
-          reinterpret_cast(ehdr) + ehdr->e_phoff);
+      info.dlpi_phdr = reinterpret_cast(
+          reinterpret_cast(ehdr) + ehdr->e_phoff);
       info.dlpi_phnum = ehdr->e_phnum;
     }
   }
@@ -196,7 +196,7 @@ int DlIteratePhdrHelper::fill_and_call(dl_phdr_cb callback, const void *l_addr,
   return callback(&info, sizeof(dl_phdr_info), data);
 }
 
-int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void *data) {
+int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void* data) {
   DlIteratePhdrHelper helper;
   AutoLock lock(&ElfLoader::Singleton.handlesMutex);
 
@@ -204,7 +204,7 @@ int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void *data) {
     for (ElfLoader::LibHandleList::reverse_iterator it =
              ElfLoader::Singleton.handles.rbegin();
          it < ElfLoader::Singleton.handles.rend(); ++it) {
-      BaseElf *elf = (*it)->AsBaseElf();
+      BaseElf* elf = (*it)->AsBaseElf();
       if (!elf) {
         continue;
       }
@@ -230,7 +230,7 @@ int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void *data) {
 }
 
 #ifdef __ARM_EABI__
-const void *__wrap___gnu_Unwind_Find_exidx(void *pc, int *pcount) {
+const void* __wrap___gnu_Unwind_Find_exidx(void* pc, int* pcount) {
   RefPtr handle = ElfLoader::Singleton.GetHandleByPtr(pc);
   if (handle) return handle->FindExidx(pcount);
   if (__gnu_Unwind_Find_exidx) return __gnu_Unwind_Find_exidx(pc, pcount);
@@ -243,21 +243,21 @@ const void *__wrap___gnu_Unwind_Find_exidx(void *pc, int *pcount) {
  * faulty.lib public API
  */
 
-MFBT_API size_t __dl_get_mappable_length(void *handle) {
+MFBT_API size_t __dl_get_mappable_length(void* handle) {
   if (!handle) return 0;
-  return reinterpret_cast(handle)->GetMappableLength();
+  return reinterpret_cast(handle)->GetMappableLength();
 }
 
-MFBT_API void *__dl_mmap(void *handle, void *addr, size_t length,
+MFBT_API void* __dl_mmap(void* handle, void* addr, size_t length,
                          off_t offset) {
   if (!handle) return nullptr;
-  return reinterpret_cast(handle)->MappableMMap(addr, length,
-                                                             offset);
+  return reinterpret_cast(handle)->MappableMMap(addr, length,
+                                                            offset);
 }
 
-MFBT_API void __dl_munmap(void *handle, void *addr, size_t length) {
+MFBT_API void __dl_munmap(void* handle, void* addr, size_t length) {
   if (!handle) return;
-  return reinterpret_cast(handle)->MappableMUnmap(addr, length);
+  return reinterpret_cast(handle)->MappableMUnmap(addr, length);
 }
 
 MFBT_API bool IsSignalHandlingBroken() {
@@ -269,8 +269,8 @@ namespace {
 /**
  * Returns the part after the last '/' for the given path
  */
-const char *LeafName(const char *path) {
-  const char *lastSlash = strrchr(path, '/');
+const char* LeafName(const char* path) {
+  const char* lastSlash = strrchr(path, '/');
   if (lastSlash) return lastSlash + 1;
   return path;
 }
@@ -301,7 +301,7 @@ int GetAndroidSDKVersion() {
  * success.
  */
 template 
-static bool RunWithSystemLinkerLock(Lambda &&aLambda) {
+static bool RunWithSystemLinkerLock(Lambda&& aLambda) {
   if (!dl_iterate_phdr) {
     // No dl_iterate_phdr support.
     return false;
@@ -316,8 +316,8 @@ static bool RunWithSystemLinkerLock(Lambda &&aLambda) {
 #endif
 
   dl_iterate_phdr(
-      [](dl_phdr_info *, size_t, void *lambda) -> int {
-        (*static_cast(lambda))();
+      [](dl_phdr_info*, size_t, void* lambda) -> int {
+        (*static_cast(lambda))();
         // Return 1 to stop iterating.
         return 1;
       },
@@ -332,7 +332,7 @@ static bool RunWithSystemLinkerLock(Lambda &&aLambda) {
  */
 LibHandle::~LibHandle() { free(path); }
 
-const char *LibHandle::GetName() const {
+const char* LibHandle::GetName() const {
   return path ? LeafName(path) : nullptr;
 }
 
@@ -342,34 +342,34 @@ size_t LibHandle::GetMappableLength() const {
   return mappable->GetLength();
 }
 
-void *LibHandle::MappableMMap(void *addr, size_t length, off_t offset) const {
+void* LibHandle::MappableMMap(void* addr, size_t length, off_t offset) const {
   if (!mappable) mappable = GetMappable();
   if (!mappable) return MAP_FAILED;
-  void *mapped = mappable->mmap(addr, length, PROT_READ, MAP_PRIVATE, offset);
+  void* mapped = mappable->mmap(addr, length, PROT_READ, MAP_PRIVATE, offset);
   return mapped;
 }
 
-void LibHandle::MappableMUnmap(void *addr, size_t length) const {
+void LibHandle::MappableMUnmap(void* addr, size_t length) const {
   if (mappable) mappable->munmap(addr, length);
 }
 
 /**
  * SystemElf
  */
-already_AddRefed SystemElf::Load(const char *path, int flags) {
+already_AddRefed SystemElf::Load(const char* path, int flags) {
   /* The Android linker returns a handle when the file name matches an
    * already loaded library, even when the full path doesn't exist */
   if (path && path[0] == '/' && (access(path, F_OK) == -1)) {
-    DEBUG_LOG("dlopen(\"%s\", 0x%x) = %p", path, flags, (void *)nullptr);
+    DEBUG_LOG("dlopen(\"%s\", 0x%x) = %p", path, flags, (void*)nullptr);
     ElfLoader::Singleton.lastError = "Specified file does not exist";
     return nullptr;
   }
 
   ElfLoader::Singleton.lastError = nullptr;  // Use system dlerror.
-  void *handle = dlopen(path, flags);
+  void* handle = dlopen(path, flags);
   DEBUG_LOG("dlopen(\"%s\", 0x%x) = %p", path, flags, handle);
   if (handle) {
-    SystemElf *elf = new SystemElf(path, handle);
+    SystemElf* elf = new SystemElf(path, handle);
     ElfLoader::Singleton.Register(elf);
     RefPtr lib(elf);
     return lib.forget();
@@ -385,20 +385,20 @@ SystemElf::~SystemElf() {
   ElfLoader::Singleton.Forget(this);
 }
 
-void *SystemElf::GetSymbolPtr(const char *symbol) const {
+void* SystemElf::GetSymbolPtr(const char* symbol) const {
   ElfLoader::Singleton.lastError = nullptr;  // Use system dlerror.
-  void *sym = dlsym(dlhandle, symbol);
+  void* sym = dlsym(dlhandle, symbol);
   DEBUG_LOG("dlsym(%p [\"%s\"], \"%s\") = %p", dlhandle, GetPath(), symbol,
             sym);
   return sym;
 }
 
-Mappable *SystemElf::GetMappable() const {
-  const char *path = GetPath();
+Mappable* SystemElf::GetMappable() const {
+  const char* path = GetPath();
   if (!path) return nullptr;
 #ifdef ANDROID
   /* On Android, if we don't have the full path, try in /system/lib */
-  const char *name = LeafName(path);
+  const char* name = LeafName(path);
   std::string systemPath;
   if (name == path) {
     systemPath = "/system/lib/";
@@ -411,7 +411,7 @@ Mappable *SystemElf::GetMappable() const {
 }
 
 #ifdef __ARM_EABI__
-const void *SystemElf::FindExidx(int *pcount) const {
+const void* SystemElf::FindExidx(int* pcount) const {
   /* TODO: properly implement when ElfLoader::GetHandleByPtr
      does return SystemElf handles */
   *pcount = 0;
@@ -426,8 +426,8 @@ const void *SystemElf::FindExidx(int *pcount) const {
 /* Unique ElfLoader instance */
 ElfLoader ElfLoader::Singleton;
 
-already_AddRefed ElfLoader::Load(const char *path, int flags,
-                                            LibHandle *parent) {
+already_AddRefed ElfLoader::Load(const char* path, int flags,
+                                            LibHandle* parent) {
   /* Ensure logging is initialized or refresh if environment changed. */
   Logging::Init();
 
@@ -443,7 +443,7 @@ already_AddRefed ElfLoader::Load(const char *path, int flags,
   }
 
   /* TODO: Handle relative paths correctly */
-  const char *name = LeafName(path);
+  const char* name = LeafName(path);
 
   /* Search the list of handles we already have for a match. When the given
    * path is not absolute, compare file names, otherwise compare full paths. */
@@ -463,22 +463,22 @@ already_AddRefed ElfLoader::Load(const char *path, int flags,
       }
   }
 
-  char *abs_path = nullptr;
-  const char *requested_path = path;
+  char* abs_path = nullptr;
+  const char* requested_path = path;
 
   /* When the path is not absolute and the library is being loaded for
    * another, first try to load the library from the directory containing
    * that parent library. */
   if ((name == path) && parent) {
-    const char *parentPath = parent->GetPath();
+    const char* parentPath = parent->GetPath();
     abs_path = new char[strlen(parentPath) + strlen(path)];
     strcpy(abs_path, parentPath);
-    char *slash = strrchr(abs_path, '/');
+    char* slash = strrchr(abs_path, '/');
     strcpy(slash + 1, path);
     path = abs_path;
   }
 
-  Mappable *mappable = GetMappableFromPath(path);
+  Mappable* mappable = GetMappableFromPath(path);
 
   /* Try loading with the custom linker if we have a Mappable */
   if (mappable) handle = CustomElf::Load(mappable, path, flags);
@@ -492,13 +492,13 @@ already_AddRefed ElfLoader::Load(const char *path, int flags,
 
   delete[] abs_path;
   DEBUG_LOG("ElfLoader::Load(\"%s\", 0x%x, %p [\"%s\"]) = %p", requested_path,
-            flags, reinterpret_cast(parent),
-            parent ? parent->GetPath() : "", static_cast(handle));
+            flags, reinterpret_cast(parent),
+            parent ? parent->GetPath() : "", static_cast(handle));
 
   return handle.forget();
 }
 
-already_AddRefed ElfLoader::GetHandleByPtr(void *addr) {
+already_AddRefed ElfLoader::GetHandleByPtr(void* addr) {
   AutoLock lock(&handlesMutex);
   /* Scan the list of handles we already have for a match */
   for (LibHandleList::iterator it = handles.begin(); it < handles.end(); ++it) {
@@ -510,13 +510,13 @@ already_AddRefed ElfLoader::GetHandleByPtr(void *addr) {
   return nullptr;
 }
 
-Mappable *ElfLoader::GetMappableFromPath(const char *path) {
-  const char *name = LeafName(path);
-  Mappable *mappable = nullptr;
+Mappable* ElfLoader::GetMappableFromPath(const char* path) {
+  const char* name = LeafName(path);
+  Mappable* mappable = nullptr;
   RefPtr zip;
-  const char *subpath;
+  const char* subpath;
   if ((subpath = strchr(path, '!'))) {
-    char *zip_path = strndup(path, subpath - path);
+    char* zip_path = strndup(path, subpath - path);
     while (*(++subpath) == '/') {
     }
     zip = ZipCollection::GetZip(zip_path);
@@ -527,7 +527,7 @@ Mappable *ElfLoader::GetMappableFromPath(const char *path) {
        * compressed libraries are going to be (temporarily) extracted as
        * files, in the directory pointed by the MOZ_LINKER_CACHE
        * environment variable. */
-      const char *extract = getenv("MOZ_LINKER_EXTRACT");
+      const char* extract = getenv("MOZ_LINKER_EXTRACT");
       if (extract && !strncmp(extract, "1", 2 /* Including '\0' */))
         mappable = MappableExtractFile::Create(name, zip, &s);
       if (!mappable) {
@@ -543,13 +543,13 @@ Mappable *ElfLoader::GetMappableFromPath(const char *path) {
   return mappable;
 }
 
-void ElfLoader::Register(LibHandle *handle) {
+void ElfLoader::Register(LibHandle* handle) {
   AutoLock lock(&handlesMutex);
   handles.push_back(handle);
 }
 
-void ElfLoader::Register(CustomElf *handle) {
-  Register(static_cast(handle));
+void ElfLoader::Register(CustomElf* handle) {
+  Register(static_cast(handle));
   if (dbg) {
     // We could race with the system linker when modifying the debug map, so
     // only do so while holding the system linker's internal lock.
@@ -557,7 +557,7 @@ void ElfLoader::Register(CustomElf *handle) {
   }
 }
 
-void ElfLoader::Forget(LibHandle *handle) {
+void ElfLoader::Forget(LibHandle* handle) {
   /* Ensure logging is initialized or refresh if environment changed. */
   Logging::Init();
 
@@ -565,17 +565,17 @@ void ElfLoader::Forget(LibHandle *handle) {
   LibHandleList::iterator it =
       std::find(handles.begin(), handles.end(), handle);
   if (it != handles.end()) {
-    DEBUG_LOG("ElfLoader::Forget(%p [\"%s\"])",
-              reinterpret_cast(handle), handle->GetPath());
+    DEBUG_LOG("ElfLoader::Forget(%p [\"%s\"])", reinterpret_cast(handle),
+              handle->GetPath());
     handles.erase(it);
   } else {
     DEBUG_LOG("ElfLoader::Forget(%p [\"%s\"]): Handle not found",
-              reinterpret_cast(handle), handle->GetPath());
+              reinterpret_cast(handle), handle->GetPath());
   }
 }
 
-void ElfLoader::Forget(CustomElf *handle) {
-  Forget(static_cast(handle));
+void ElfLoader::Forget(CustomElf* handle) {
+  Forget(static_cast(handle));
   if (dbg) {
     // We could race with the system linker when modifying the debug map, so
     // only do so while holding the system linker's internal lock.
@@ -629,7 +629,7 @@ ElfLoader::~ElfLoader() {
   for (LibHandleList::reverse_iterator it = handles.rbegin();
        it < handles.rend(); ++it) {
     if ((*it)->DirectRefCount()) {
-      if (SystemElf *se = (*it)->AsSystemElf()) {
+      if (SystemElf* se = (*it)->AsSystemElf()) {
         se->Forget();
       } else {
         list.push_back(*it);
@@ -666,22 +666,22 @@ ElfLoader::~ElfLoader() {
 }
 
 #ifdef __ARM_EABI__
-int ElfLoader::__wrap_aeabi_atexit(void *that, ElfLoader::Destructor destructor,
-                                   void *dso_handle) {
+int ElfLoader::__wrap_aeabi_atexit(void* that, ElfLoader::Destructor destructor,
+                                   void* dso_handle) {
   Singleton.destructors.push_back(
       DestructorCaller(destructor, that, dso_handle));
   return 0;
 }
 #else
-int ElfLoader::__wrap_cxa_atexit(ElfLoader::Destructor destructor, void *that,
-                                 void *dso_handle) {
+int ElfLoader::__wrap_cxa_atexit(ElfLoader::Destructor destructor, void* that,
+                                 void* dso_handle) {
   Singleton.destructors.push_back(
       DestructorCaller(destructor, that, dso_handle));
   return 0;
 }
 #endif
 
-void ElfLoader::__wrap_cxa_finalize(void *dso_handle) {
+void ElfLoader::__wrap_cxa_finalize(void* dso_handle) {
   /* Call all destructors for the given DSO handle in reverse order they were
    * registered. */
   std::vector::reverse_iterator it;
@@ -738,7 +738,7 @@ ElfLoader::DebuggerHelper::DebuggerHelper()
   };
 
   /* Pointer to the environment variables list */
-  extern char **environ;
+  extern char** environ;
 
   /* The environment may have changed since the program started, in which
    * case the environ variables list isn't the list the kernel put on stack
@@ -747,7 +747,7 @@ ElfLoader::DebuggerHelper::DebuggerHelper()
    * modified environment variables point to two consecutive strings in memory,
    * so we assume that if two consecutive environment variables point to two
    * consecutive strings, we found strings the kernel put on stack. */
-  char **env;
+  char** env;
   for (env = environ; *env; env++)
     if (*env + strlen(*env) + 1 == env[1]) break;
   if (!*env) return;
@@ -756,8 +756,8 @@ ElfLoader::DebuggerHelper::DebuggerHelper()
    * strings we found above, which will give us the location of the original
    * envp list. As we are looking for pointers, we need to look at 32-bits or
    * 64-bits aligned values, depening on the architecture. */
-  char **scan = reinterpret_cast(reinterpret_cast(*env) &
-                                          ~(sizeof(void *) - 1));
+  char** scan = reinterpret_cast(reinterpret_cast(*env) &
+                                         ~(sizeof(void*) - 1));
   while (*env != *scan) scan--;
 
   /* Finally, scan forward to find the last environment variable pointer and
@@ -768,18 +768,18 @@ ElfLoader::DebuggerHelper::DebuggerHelper()
   /* Some platforms have more NULLs here, so skip them if we encounter them */
   while (!*scan) scan++;
 
-  AuxVector *auxv = reinterpret_cast(scan);
+  AuxVector* auxv = reinterpret_cast(scan);
 
   /* The two values of interest in the auxiliary vectors are AT_PHDR and
    * AT_PHNUM, which gives us the the location and size of the ELF program
    * headers. */
   Array phdrs;
-  char *base = nullptr;
+  char* base = nullptr;
   while (auxv->type) {
     if (auxv->type == AT_PHDR) {
-      phdrs.Init(reinterpret_cast(auxv->value));
+      phdrs.Init(reinterpret_cast(auxv->value));
       /* Assume the base address is the first byte of the same page */
-      base = reinterpret_cast(PageAlignedPtr(auxv->value));
+      base = reinterpret_cast(PageAlignedPtr(auxv->value));
     }
     if (auxv->type == AT_PHNUM) phdrs.Init(auxv->value);
     auxv++;
@@ -840,11 +840,11 @@ ElfLoader::DebuggerHelper::DebuggerHelper()
   /* Search for the DT_DEBUG information */
   for (Array::iterator dyn = dyns.begin(); dyn < dyns.end(); ++dyn) {
     if (dyn->d_tag == DT_DEBUG) {
-      dbg = reinterpret_cast(dyn->d_un.d_ptr);
+      dbg = reinterpret_cast(dyn->d_un.d_ptr);
       break;
     }
   }
-  DEBUG_LOG("DT_DEBUG points at %p", static_cast(dbg));
+  DEBUG_LOG("DT_DEBUG points at %p", static_cast(dbg));
 }
 
 /**
@@ -855,14 +855,14 @@ ElfLoader::DebuggerHelper::DebuggerHelper()
 class EnsureWritable {
  public:
   template 
-  explicit EnsureWritable(T *ptr, size_t length_ = sizeof(T)) {
+  explicit EnsureWritable(T* ptr, size_t length_ = sizeof(T)) {
     MOZ_ASSERT(length_ < PageSize());
     prot = -1;
     page = MAP_FAILED;
 
-    char *firstPage = PageAlignedPtr(reinterpret_cast(ptr));
-    char *lastPageEnd =
-        PageAlignedEndPtr(reinterpret_cast(ptr) + length_);
+    char* firstPage = PageAlignedPtr(reinterpret_cast(ptr));
+    char* lastPageEnd =
+        PageAlignedEndPtr(reinterpret_cast(ptr) + length_);
     length = lastPageEnd - firstPage;
     uintptr_t start = reinterpret_cast(firstPage);
     uintptr_t end;
@@ -893,7 +893,7 @@ class EnsureWritable {
   }
 
  private:
-  int getProt(uintptr_t addr, uintptr_t *end) {
+  int getProt(uintptr_t addr, uintptr_t* end) {
     /* The interesting part of the /proc/self/maps format looks like:
      * startAddr-endAddr rwxp */
     int result = 0;
@@ -924,7 +924,7 @@ class EnsureWritable {
   }
 
   int prot;
-  void *page;
+  void* page;
   size_t length;
   bool success;
 };
@@ -945,7 +945,7 @@ class EnsureWritable {
  * program executable, so the system linker should not be changing
  * r_debug::r_map.
  */
-void ElfLoader::DebuggerHelper::Add(ElfLoader::link_map *map) {
+void ElfLoader::DebuggerHelper::Add(ElfLoader::link_map* map) {
   if (!dbg->r_brk) return;
 
   dbg->r_state = r_debug::RT_ADD;
@@ -974,7 +974,7 @@ void ElfLoader::DebuggerHelper::Add(ElfLoader::link_map *map) {
   dbg->r_brk();
 }
 
-void ElfLoader::DebuggerHelper::Remove(ElfLoader::link_map *map) {
+void ElfLoader::DebuggerHelper::Remove(ElfLoader::link_map* map) {
   if (!dbg->r_brk) return;
 
   dbg->r_state = r_debug::RT_DELETE;
@@ -1021,14 +1021,14 @@ void ElfLoader::DebuggerHelper::Remove(ElfLoader::link_map *map) {
  */
 
 /* libc's sigaction */
-extern "C" int sigaction(int signum, const struct sigaction *act,
-                         struct sigaction *oldact);
+extern "C" int sigaction(int signum, const struct sigaction* act,
+                         struct sigaction* oldact);
 
 /* Simple reimplementation of sigaction. This is roughly equivalent
  * to the assembly that comes in bionic, but not quite equivalent to
  * glibc's implementation, so we only use this on Android. */
-int sys_sigaction(int signum, const struct sigaction *act,
-                  struct sigaction *oldact) {
+int sys_sigaction(int signum, const struct sigaction* act,
+                  struct sigaction* oldact) {
   return syscall(__NR_sigaction, signum, act, oldact);
 }
 
@@ -1036,14 +1036,14 @@ int sys_sigaction(int signum, const struct sigaction *act,
  * to the given new function. */
 template 
 static bool Divert(T func, T new_func) {
-  void *ptr = FunctionPtr(func);
+  void* ptr = FunctionPtr(func);
   uintptr_t addr = reinterpret_cast(ptr);
 
 #  if defined(__i386__)
   // A 32-bit jump is a 5 bytes instruction.
   EnsureWritable w(ptr, 5);
-  *reinterpret_cast(addr) = 0xe9;  // jmp
-  *reinterpret_cast(addr + 1) =
+  *reinterpret_cast(addr) = 0xe9;  // jmp
+  *reinterpret_cast(addr + 1) =
       reinterpret_cast(new_func) - addr - 5;  // target displacement
   return true;
 #  elif defined(__arm__) || defined(__aarch64__)
@@ -1065,7 +1065,7 @@ static bool Divert(T func, T new_func) {
                    // .word 
 #    endif
   };
-  const unsigned char *start;
+  const unsigned char* start;
 #    ifdef __arm__
   if (addr & 0x01) {
     /* Function is thumb, the actual address of the code is without the
@@ -1085,12 +1085,11 @@ static bool Divert(T func, T new_func) {
 #    endif
 
   size_t len = sizeof(trampoline) - (start - trampoline);
-  EnsureWritable w(reinterpret_cast(addr), len + sizeof(void *));
-  memcpy(reinterpret_cast(addr), start, len);
-  *reinterpret_cast(addr + len) = FunctionPtr(new_func);
-  __builtin___clear_cache(
-      reinterpret_cast(addr),
-      reinterpret_cast(addr + len + sizeof(void *)));
+  EnsureWritable w(reinterpret_cast(addr), len + sizeof(void*));
+  memcpy(reinterpret_cast(addr), start, len);
+  *reinterpret_cast(addr + len) = FunctionPtr(new_func);
+  __builtin___clear_cache(reinterpret_cast(addr),
+                          reinterpret_cast(addr + len + sizeof(void*)));
   return true;
 #  else
   return false;
@@ -1168,7 +1167,7 @@ SEGVHandler::SEGVHandler()
   if (stackPtr.get() == MAP_FAILED) return;
   if (sys_sigaction(SIGSEGV, &action, nullptr)) return;
 
-  TmpData *data = reinterpret_cast(stackPtr.get());
+  TmpData* data = reinterpret_cast(stackPtr.get());
   data->crash_timestamp = ProcessTimeStamp_Now();
   mprotect(stackPtr, stackPtr.GetLength(), PROT_NONE);
   data->crash_int = 123;
@@ -1184,8 +1183,8 @@ void SEGVHandler::FinishInitialization() {
 
   if (signalHandlingBroken || signalHandlingSlow) return;
 
-  typedef int (*sigaction_func)(int, const struct sigaction *,
-                                struct sigaction *);
+  typedef int (*sigaction_func)(int, const struct sigaction*,
+                                struct sigaction*);
 
   sigaction_func libc_sigaction;
 
@@ -1216,7 +1215,7 @@ void SEGVHandler::FinishInitialization() {
    * - Our handler redispatches according to whatever system library or
    *   faulty.lib-loaded library set with sigaction.
    */
-  void *libc = dlopen("libc.so", RTLD_GLOBAL | RTLD_LAZY);
+  void* libc = dlopen("libc.so", RTLD_GLOBAL | RTLD_LAZY);
   if (libc) {
     /*
      * Lollipop bionic only has a small trampoline in sigaction, with the real
@@ -1272,12 +1271,12 @@ SEGVHandler::~SEGVHandler() {
  * useful information is provided to signal handlers, particularly whether
  * si_addr is filled in properly, and whether the segfault handler is called
  * quickly enough. */
-void SEGVHandler::test_handler(int signum, siginfo_t *info, void *context) {
-  SEGVHandler &that = ElfLoader::Singleton;
+void SEGVHandler::test_handler(int signum, siginfo_t* info, void* context) {
+  SEGVHandler& that = ElfLoader::Singleton;
   if (signum == SIGSEGV && info && info->si_addr == that.stackPtr.get())
     that.signalHandlingBroken = false;
   mprotect(that.stackPtr, that.stackPtr.GetLength(), PROT_READ | PROT_WRITE);
-  TmpData *data = reinterpret_cast(that.stackPtr.get());
+  TmpData* data = reinterpret_cast(that.stackPtr.get());
   uint64_t latency = ProcessTimeStamp_Now() - data->crash_timestamp;
   DEBUG_LOG("SEGVHandler latency: %" PRIu64, latency);
   /* See bug 886736 for timings on different devices, 150 µs is reasonably above
@@ -1287,12 +1286,12 @@ void SEGVHandler::test_handler(int signum, siginfo_t *info, void *context) {
 }
 
 /* TODO: "properly" handle signal masks and flags */
-void SEGVHandler::handler(int signum, siginfo_t *info, void *context) {
+void SEGVHandler::handler(int signum, siginfo_t* info, void* context) {
   // ASSERT(signum == SIGSEGV);
   DEBUG_LOG("Caught segmentation fault @%p", info->si_addr);
 
   /* Redispatch to the registered handler */
-  SEGVHandler &that = ElfLoader::Singleton;
+  SEGVHandler& that = ElfLoader::Singleton;
   if (that.action.sa_flags & SA_SIGINFO) {
     DEBUG_LOG("Redispatching to registered handler @%p",
               FunctionPtr(that.action.sa_sigaction));
@@ -1311,9 +1310,9 @@ void SEGVHandler::handler(int signum, siginfo_t *info, void *context) {
   }
 }
 
-int SEGVHandler::__wrap_sigaction(int signum, const struct sigaction *act,
-                                  struct sigaction *oldact) {
-  SEGVHandler &that = ElfLoader::Singleton;
+int SEGVHandler::__wrap_sigaction(int signum, const struct sigaction* act,
+                                  struct sigaction* oldact) {
+  SEGVHandler& that = ElfLoader::Singleton;
 
   /* Use system sigaction() function for all but SIGSEGV signals. */
   if (!that.registeredHandler || (signum != SIGSEGV))
diff --git a/mozglue/linker/ElfLoader.h b/mozglue/linker/ElfLoader.h
index 38def2e0b58f0..8efa79e72422f 100644
--- a/mozglue/linker/ElfLoader.h
+++ b/mozglue/linker/ElfLoader.h
@@ -20,43 +20,43 @@
  * dlfcn.h replacement functions
  */
 extern "C" {
-void *__wrap_dlopen(const char *path, int flags);
-const char *__wrap_dlerror(void);
-void *__wrap_dlsym(void *handle, const char *symbol);
-int __wrap_dlclose(void *handle);
+void* __wrap_dlopen(const char* path, int flags);
+const char* __wrap_dlerror(void);
+void* __wrap_dlsym(void* handle, const char* symbol);
+int __wrap_dlclose(void* handle);
 
 #ifndef HAVE_DLADDR
 typedef struct {
-  const char *dli_fname;
-  void *dli_fbase;
-  const char *dli_sname;
-  void *dli_saddr;
+  const char* dli_fname;
+  void* dli_fbase;
+  const char* dli_sname;
+  void* dli_saddr;
 } Dl_info;
 #endif
-int __wrap_dladdr(void *addr, Dl_info *info);
+int __wrap_dladdr(void* addr, Dl_info* info);
 
 struct dl_phdr_info {
   Elf::Addr dlpi_addr;
-  const char *dlpi_name;
-  const Elf::Phdr *dlpi_phdr;
+  const char* dlpi_name;
+  const Elf::Phdr* dlpi_phdr;
   Elf::Half dlpi_phnum;
 };
 
-typedef int (*dl_phdr_cb)(struct dl_phdr_info *, size_t, void *);
-int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void *data);
+typedef int (*dl_phdr_cb)(struct dl_phdr_info*, size_t, void*);
+int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void* data);
 
 #ifdef __ARM_EABI__
-const void *__wrap___gnu_Unwind_Find_exidx(void *pc, int *pcount);
+const void* __wrap___gnu_Unwind_Find_exidx(void* pc, int* pcount);
 #endif
 
 /**
  * faulty.lib public API
  */
-MFBT_API size_t __dl_get_mappable_length(void *handle);
+MFBT_API size_t __dl_get_mappable_length(void* handle);
 
-MFBT_API void *__dl_mmap(void *handle, void *addr, size_t length, off_t offset);
+MFBT_API void* __dl_mmap(void* handle, void* addr, size_t length, off_t offset);
 
-MFBT_API void __dl_munmap(void *handle, void *addr, size_t length);
+MFBT_API void __dl_munmap(void* handle, void* addr, size_t length);
 
 MFBT_API bool IsSignalHandlingBroken();
 }
@@ -99,7 +99,7 @@ class LibHandle : public mozilla::external::AtomicRefCounted {
    * Constructor. Takes the path of the loaded library and will store a copy
    * of the leaf name.
    */
-  LibHandle(const char *path)
+  LibHandle(const char* path)
       : directRefCnt(0),
         path(path ? strdup(path) : nullptr),
         mappable(nullptr) {}
@@ -114,29 +114,29 @@ class LibHandle : public mozilla::external::AtomicRefCounted {
    * inside the library. It is not supposed to resolve the symbol in other
    * libraries, although in practice, it will for system libraries.
    */
-  virtual void *GetSymbolPtr(const char *symbol) const = 0;
+  virtual void* GetSymbolPtr(const char* symbol) const = 0;
 
   /**
    * Returns whether the given address is part of the virtual address space
    * covered by the loaded library.
    */
-  virtual bool Contains(void *addr) const = 0;
+  virtual bool Contains(void* addr) const = 0;
 
   /**
    * Returns the base address of the loaded library.
    */
-  virtual void *GetBase() const = 0;
+  virtual void* GetBase() const = 0;
 
   /**
    * Returns the file name of the library without the containing directory.
    */
-  const char *GetName() const;
+  const char* GetName() const;
 
   /**
    * Returns the full path of the library, when available. Otherwise, returns
    * the file name.
    */
-  const char *GetPath() const { return path; }
+  const char* GetPath() const { return path; }
 
   /**
    * Library handles can be referenced from other library handles or
@@ -177,27 +177,27 @@ class LibHandle : public mozilla::external::AtomicRefCounted {
    * Returns a memory mapping of the file or stream behind the library
    * handle.
    */
-  void *MappableMMap(void *addr, size_t length, off_t offset) const;
+  void* MappableMMap(void* addr, size_t length, off_t offset) const;
 
   /**
    * Unmaps a memory mapping of the file or stream behind the library
    * handle.
    */
-  void MappableMUnmap(void *addr, size_t length) const;
+  void MappableMUnmap(void* addr, size_t length) const;
 
 #ifdef __ARM_EABI__
   /**
    * Find the address and entry count of the ARM.exidx section
    * associated with the library
    */
-  virtual const void *FindExidx(int *pcount) const = 0;
+  virtual const void* FindExidx(int* pcount) const = 0;
 #endif
 
  protected:
   /**
    * Returns a mappable object for use by MappableMMap and related functions.
    */
-  virtual Mappable *GetMappable() const = 0;
+  virtual Mappable* GetMappable() const = 0;
 
   /**
    * Returns the instance, casted as the wanted type. Returns nullptr if
@@ -207,13 +207,13 @@ class LibHandle : public mozilla::external::AtomicRefCounted {
   friend class ElfLoader;
   friend class CustomElf;
   friend class SEGVHandler;
-  friend int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void *data);
-  virtual BaseElf *AsBaseElf() { return nullptr; }
-  virtual SystemElf *AsSystemElf() { return nullptr; }
+  friend int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void* data);
+  virtual BaseElf* AsBaseElf() { return nullptr; }
+  virtual SystemElf* AsSystemElf() { return nullptr; }
 
  private:
   mozilla::Atomic directRefCnt;
-  char *path;
+  char* path;
 
   /* Mappable object keeping the result of GetMappable() */
   mutable RefPtr mappable;
@@ -243,7 +243,7 @@ inline void RefCounted::Release() const {
 #else
       mRefCnt = 1;
 #endif
-      delete static_cast(this);
+      delete static_cast(this);
     }
   }
 }
@@ -260,29 +260,29 @@ class SystemElf : public LibHandle {
    * Returns a new SystemElf for the given path. The given flags are passed
    * to dlopen().
    */
-  static already_AddRefed Load(const char *path, int flags);
+  static already_AddRefed Load(const char* path, int flags);
 
   /**
    * Inherited from LibHandle
    */
   virtual ~SystemElf();
-  virtual void *GetSymbolPtr(const char *symbol) const;
-  virtual bool Contains(void *addr) const { return false; /* UNIMPLEMENTED */ }
-  virtual void *GetBase() const { return nullptr; /* UNIMPLEMENTED */ }
+  virtual void* GetSymbolPtr(const char* symbol) const;
+  virtual bool Contains(void* addr) const { return false; /* UNIMPLEMENTED */ }
+  virtual void* GetBase() const { return nullptr; /* UNIMPLEMENTED */ }
 
 #ifdef __ARM_EABI__
-  virtual const void *FindExidx(int *pcount) const;
+  virtual const void* FindExidx(int* pcount) const;
 #endif
 
  protected:
-  virtual Mappable *GetMappable() const;
+  virtual Mappable* GetMappable() const;
 
   /**
    * Returns the instance, casted as SystemElf. (short of a better way to do
    * this without RTTI)
    */
   friend class ElfLoader;
-  virtual SystemElf *AsSystemElf() { return this; }
+  virtual SystemElf* AsSystemElf() { return this; }
 
   /**
    * Remove the reference to the system linker handle. This avoids dlclose()
@@ -294,11 +294,11 @@ class SystemElf : public LibHandle {
   /**
    * Private constructor
    */
-  SystemElf(const char *path, void *handle)
+  SystemElf(const char* path, void* handle)
       : LibHandle(path), dlhandle(handle) {}
 
   /* Handle as returned by system dlopen() */
-  void *dlhandle;
+  void* dlhandle;
 };
 
 /**
@@ -316,8 +316,8 @@ class SEGVHandler {
 
   bool isSignalHandlingBroken() { return signalHandlingBroken; }
 
-  static int __wrap_sigaction(int signum, const struct sigaction *act,
-                              struct sigaction *oldact);
+  static int __wrap_sigaction(int signum, const struct sigaction* act,
+                              struct sigaction* oldact);
 
  protected:
   SEGVHandler();
@@ -338,12 +338,12 @@ class SEGVHandler {
   /**
    * ElfLoader SIGSEGV handler.
    */
-  static void handler(int signum, siginfo_t *info, void *context);
+  static void handler(int signum, siginfo_t* info, void* context);
 
   /**
    * Temporary test handler.
    */
-  static void test_handler(int signum, siginfo_t *info, void *context);
+  static void test_handler(int signum, siginfo_t* info, void* context);
 
   /**
    * Size of the alternative stack. The printf family requires more than 8KB
@@ -384,8 +384,8 @@ class ElfLoader : public SEGVHandler {
    * requesting the given library to be loaded. The loader may look in the
    * directory containing that parent library for the library to load.
    */
-  already_AddRefed Load(const char *path, int flags,
-                                   LibHandle *parent = nullptr);
+  already_AddRefed Load(const char* path, int flags,
+                                   LibHandle* parent = nullptr);
 
   /**
    * Returns the handle of the library containing the given address in
@@ -393,7 +393,7 @@ class ElfLoader : public SEGVHandler {
    * LibHandle::Contains returns true. Its purpose is to allow to
    * implement dladdr().
    */
-  already_AddRefed GetHandleByPtr(void *addr);
+  already_AddRefed GetHandleByPtr(void* addr);
 
   /**
    * Returns a Mappable object for the path. Paths in the form
@@ -401,7 +401,7 @@ class ElfLoader : public SEGVHandler {
    * try to load the directory/lib.so in /foo/bar/baz/archive, provided
    * that file is a Zip archive.
    */
-  static Mappable *GetMappableFromPath(const char *path);
+  static Mappable* GetMappableFromPath(const char* path);
 
   void ExpectShutdown(bool val) { expect_shutdown = val; }
   bool IsShutdownExpected() { return expect_shutdown; }
@@ -414,23 +414,23 @@ class ElfLoader : public SEGVHandler {
    * Registers the given handle. This method is meant to be called by
    * LibHandle subclass creators.
    */
-  void Register(LibHandle *handle);
-  void Register(CustomElf *handle);
+  void Register(LibHandle* handle);
+  void Register(CustomElf* handle);
 
   /**
    * Forget about the given handle. This method is meant to be called by
    * LibHandle subclass destructors.
    */
-  void Forget(LibHandle *handle);
-  void Forget(CustomElf *handle);
+  void Forget(LibHandle* handle);
+  void Forget(CustomElf* handle);
 
   friend class SystemElf;
-  friend const char *__wrap_dlerror(void);
-  friend void *__wrap_dlsym(void *handle, const char *symbol);
-  friend int __wrap_dlclose(void *handle);
+  friend const char* __wrap_dlerror(void);
+  friend void* __wrap_dlsym(void* handle, const char* symbol);
+  friend int __wrap_dlclose(void* handle);
   /* __wrap_dlerror() returns this custom last error if non-null or the system
    * dlerror() value if this is null. Must refer to a string constant. */
-  mozilla::Atomic lastError;
+  mozilla::Atomic lastError;
 
  private:
   ElfLoader() : expect_shutdown(true), lastError(nullptr) {
@@ -458,7 +458,7 @@ class ElfLoader : public SEGVHandler {
 #endif
 
   /* Bookkeeping */
-  typedef std::vector LibHandleList;
+  typedef std::vector LibHandleList;
   LibHandleList handles;
 
   pthread_mutex_t handlesMutex;
@@ -468,7 +468,7 @@ class ElfLoader : public SEGVHandler {
   friend class LoadedElf;
 
   /* Definition of static destructors as to be used for C++ ABI compatibility */
-  typedef void (*Destructor)(void *object);
+  typedef void (*Destructor)(void* object);
 
   /**
    * C++ ABI makes static initializers register destructors through a specific
@@ -487,14 +487,14 @@ class ElfLoader : public SEGVHandler {
    * DSO handle are called in the reverse order they were registered.
    */
 #ifdef __ARM_EABI__
-  static int __wrap_aeabi_atexit(void *that, Destructor destructor,
-                                 void *dso_handle);
+  static int __wrap_aeabi_atexit(void* that, Destructor destructor,
+                                 void* dso_handle);
 #else
-  static int __wrap_cxa_atexit(Destructor destructor, void *that,
-                               void *dso_handle);
+  static int __wrap_cxa_atexit(Destructor destructor, void* that,
+                               void* dso_handle);
 #endif
 
-  static void __wrap_cxa_finalize(void *dso_handle);
+  static void __wrap_cxa_finalize(void* dso_handle);
 
   /**
    * Registered destructor. Keeps track of the destructor function pointer,
@@ -502,7 +502,7 @@ class ElfLoader : public SEGVHandler {
    */
   class DestructorCaller {
    public:
-    DestructorCaller(Destructor destructor, void *object, void *dso_handle)
+    DestructorCaller(Destructor destructor, void* object, void* dso_handle)
         : destructor(destructor), object(object), dso_handle(dso_handle) {}
 
     /**
@@ -514,12 +514,12 @@ class ElfLoader : public SEGVHandler {
     /**
      * Returns whether the destructor is associated to the given DSO handle
      */
-    bool IsForHandle(void *handle) const { return handle == dso_handle; }
+    bool IsForHandle(void* handle) const { return handle == dso_handle; }
 
    private:
     Destructor destructor;
-    void *object;
-    void *dso_handle;
+    void* object;
+    void* dso_handle;
   };
 
  private:
@@ -533,11 +533,11 @@ class ElfLoader : public SEGVHandler {
   /* Loaded object descriptor for the debugger interface below*/
   struct link_map {
     /* Base address of the loaded object. */
-    const void *l_addr;
+    const void* l_addr;
     /* File name */
-    const char *l_name;
+    const char* l_name;
     /* Address of the PT_DYNAMIC segment. */
-    const void *l_ld;
+    const void* l_ld;
 
    private:
     friend class ElfLoader::DebuggerHelper;
@@ -554,7 +554,7 @@ class ElfLoader : public SEGVHandler {
     int r_version;
 
     /* Head of the linked list of loaded objects. */
-    link_map *r_map;
+    link_map* r_map;
 
     /* Function to be called when updates to the linked list of loaded objects
      * are going to occur. The function is to be called before and after
@@ -582,27 +582,27 @@ class ElfLoader : public SEGVHandler {
    public:
     DebuggerHelper();
 
-    void Init(AuxVector *auvx);
+    void Init(AuxVector* auvx);
 
     explicit operator bool() { return dbg; }
 
     /* Make the debugger aware of a new loaded object */
-    void Add(link_map *map);
+    void Add(link_map* map);
 
     /* Make the debugger aware of the unloading of an object */
-    void Remove(link_map *map);
+    void Remove(link_map* map);
 
     /* Iterates over all link_maps */
     class iterator {
      public:
-      const link_map *operator->() const { return item; }
+      const link_map* operator->() const { return item; }
 
-      const link_map &operator++() {
+      const link_map& operator++() {
         item = item->l_next;
         return *item;
       }
 
-      bool operator<(const iterator &other) const {
+      bool operator<(const iterator& other) const {
         if (other.item == nullptr) return item ? true : false;
         MOZ_CRASH(
             "DebuggerHelper::iterator::operator< called with something else "
@@ -611,10 +611,10 @@ class ElfLoader : public SEGVHandler {
 
      protected:
       friend class DebuggerHelper;
-      explicit iterator(const link_map *item) : item(item) {}
+      explicit iterator(const link_map* item) : item(item) {}
 
      private:
-      const link_map *item;
+      const link_map* item;
     };
 
     iterator begin() const { return iterator(dbg ? dbg->r_map : nullptr); }
@@ -622,10 +622,10 @@ class ElfLoader : public SEGVHandler {
     iterator end() const { return iterator(nullptr); }
 
    private:
-    r_debug *dbg;
-    link_map *firstAdded;
+    r_debug* dbg;
+    link_map* firstAdded;
   };
-  friend int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void *data);
+  friend int __wrap_dl_iterate_phdr(dl_phdr_cb callback, void* data);
   DebuggerHelper dbg;
 };
 
diff --git a/mozglue/linker/Elfxx.h b/mozglue/linker/Elfxx.h
index d606f4bb6ecfa..a8712802138c7 100644
--- a/mozglue/linker/Elfxx.h
+++ b/mozglue/linker/Elfxx.h
@@ -199,7 +199,7 @@ struct Ehdr : public Elf_(Ehdr) {
    * checking that this is indeed an Elf header and that the Elf type
    * corresponds to that of the system
    */
-  static const Ehdr *validate(const void *buf);
+  static const Ehdr* validate(const void* buf);
 };
 
 /**
@@ -210,7 +210,7 @@ class Strtab : public UnsizedArray {
   /**
    * Returns the string at the given index in the table
    */
-  const char *GetStringAt(off_t index) const {
+  const char* GetStringAt(off_t index) const {
     return &UnsizedArray::operator[](index);
   }
 };
@@ -223,9 +223,9 @@ struct Rel : public Elf_(Rel) {
    * Returns the addend for the relocation, which is the value stored
    * at r_offset.
    */
-  Addr GetAddend(void *base) const {
-    return *(reinterpret_cast(
-        reinterpret_cast(base) + r_offset));
+  Addr GetAddend(void* base) const {
+    return *(reinterpret_cast(reinterpret_cast(base) +
+                                           r_offset));
   }
 };
 
@@ -236,7 +236,7 @@ struct Rela : public Elf_(Rela) {
   /**
    * Returns the addend for the relocation.
    */
-  Addr GetAddend(void *base) const { return r_addend; }
+  Addr GetAddend(void* base) const { return r_addend; }
 };
 
 } /* namespace Elf */
diff --git a/mozglue/linker/Logging.h b/mozglue/linker/Logging.h
index 6664cee029b26..54e16ff091c12 100644
--- a/mozglue/linker/Logging.h
+++ b/mozglue/linker/Logging.h
@@ -53,7 +53,7 @@ class Logging {
 
  public:
   static void Init() {
-    const char *env = getenv("MOZ_DEBUG_LINKER");
+    const char* env = getenv("MOZ_DEBUG_LINKER");
     if (env && *env == '1') Singleton.verbose = true;
   }
 
diff --git a/mozglue/linker/Mappable.cpp b/mozglue/linker/Mappable.cpp
index e54ce5b381c67..9102f166edaaa 100644
--- a/mozglue/linker/Mappable.cpp
+++ b/mozglue/linker/Mappable.cpp
@@ -30,7 +30,7 @@ using mozilla::UniquePtr;
 
 class CacheValidator {
  public:
-  CacheValidator(const char *aCachedLibPath, Zip *aZip, Zip::Stream *aStream)
+  CacheValidator(const char* aCachedLibPath, Zip* aZip, Zip::Stream* aStream)
       : mCachedLibPath(aCachedLibPath) {
     static const char kChecksumSuffix[] = ".crc";
 
@@ -82,7 +82,7 @@ class CacheValidator {
     size_t written = 0;
     while (written < size) {
       ssize_t ret =
-          write(fd, reinterpret_cast(&mChecksum) + written,
+          write(fd, reinterpret_cast(&mChecksum) + written,
                 size - written);
       if (ret >= 0) {
         written += ret;
@@ -100,19 +100,19 @@ class CacheValidator {
   uint32_t mChecksum;
 };
 
-Mappable *MappableFile::Create(const char *path) {
+Mappable* MappableFile::Create(const char* path) {
   int fd = open(path, O_RDONLY);
   if (fd != -1) return new MappableFile(fd);
   return nullptr;
 }
 
-MemoryRange MappableFile::mmap(const void *addr, size_t length, int prot,
+MemoryRange MappableFile::mmap(const void* addr, size_t length, int prot,
                                int flags, off_t offset) {
   MOZ_ASSERT(fd != -1);
   MOZ_ASSERT(!(flags & MAP_SHARED));
   flags |= MAP_PRIVATE;
 
-  return MemoryRange::mmap(const_cast(addr), length, prot, flags, fd,
+  return MemoryRange::mmap(const_cast(addr), length, prot, flags, fd,
                            offset);
 }
 
@@ -126,11 +126,11 @@ size_t MappableFile::GetLength() const {
   return fstat(fd, &st) ? 0 : st.st_size;
 }
 
-Mappable *MappableExtractFile::Create(const char *name, Zip *zip,
-                                      Zip::Stream *stream) {
+Mappable* MappableExtractFile::Create(const char* name, Zip* zip,
+                                      Zip::Stream* stream) {
   MOZ_ASSERT(zip && stream);
 
-  const char *cachePath = getenv("MOZ_LINKER_CACHE");
+  const char* cachePath = getenv("MOZ_LINKER_CACHE");
   if (!cachePath || !*cachePath) {
     WARN(
         "MOZ_LINKER_EXTRACT is set, but not MOZ_LINKER_CACHE; "
@@ -147,10 +147,10 @@ Mappable *MappableExtractFile::Create(const char *name, Zip *zip,
 
   CacheValidator validator(path.get(), zip, stream);
   if (validator.IsValid()) {
-    DEBUG_LOG("Reusing %s", static_cast(path.get()));
+    DEBUG_LOG("Reusing %s", static_cast(path.get()));
     return MappableFile::Create(path.get());
   }
-  DEBUG_LOG("Extracting to %s", static_cast(path.get()));
+  DEBUG_LOG("Extracting to %s", static_cast(path.get()));
   AutoCloseFD fd;
   fd = open(path.get(), O_TRUNC | O_RDWR | O_CREAT | O_NOATIME,
             S_IRUSR | S_IWUSR);
@@ -239,7 +239,7 @@ class _MappableBuffer : public MappedPtr {
    * Returns a _MappableBuffer instance with the given name and the given
    * length.
    */
-  static _MappableBuffer *Create(const char *name, size_t length) {
+  static _MappableBuffer* Create(const char* name, size_t length) {
     AutoCloseFD fd;
 #ifdef ANDROID
     /* On Android, initialize an ashmem region with the given length */
@@ -258,10 +258,10 @@ class _MappableBuffer : public MappedPtr {
        */
 #  if defined(__arm__)
     // Address increases on ARM.
-    void *buf = ::mmap(nullptr, length + PAGE_SIZE, PROT_READ | PROT_WRITE,
+    void* buf = ::mmap(nullptr, length + PAGE_SIZE, PROT_READ | PROT_WRITE,
                        MAP_SHARED, fd, 0);
     if (buf != MAP_FAILED) {
-      ::mmap(AlignedEndPtr(reinterpret_cast(buf) + length, PAGE_SIZE),
+      ::mmap(AlignedEndPtr(reinterpret_cast(buf) + length, PAGE_SIZE),
              PAGE_SIZE, PROT_NONE, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1,
              0);
       DEBUG_LOG("Decompression buffer of size 0x%" PRIxPTR
@@ -272,13 +272,13 @@ class _MappableBuffer : public MappedPtr {
 #  elif defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
     // Address decreases on x86, x86-64, and AArch64.
     size_t anon_mapping_length = length + PAGE_SIZE;
-    void *buf = ::mmap(nullptr, anon_mapping_length, PROT_NONE,
+    void* buf = ::mmap(nullptr, anon_mapping_length, PROT_NONE,
                        MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
     if (buf != MAP_FAILED) {
-      char *first_page = reinterpret_cast(buf);
-      char *map_page = first_page + PAGE_SIZE;
+      char* first_page = reinterpret_cast(buf);
+      char* map_page = first_page + PAGE_SIZE;
 
-      void *actual_buf = ::mmap(map_page, length, PROT_READ | PROT_WRITE,
+      void* actual_buf = ::mmap(map_page, length, PROT_READ | PROT_WRITE,
                                 MAP_FIXED | MAP_SHARED, fd, 0);
       if (actual_buf == MAP_FAILED) {
         ::munmap(buf, anon_mapping_length);
@@ -306,7 +306,7 @@ class _MappableBuffer : public MappedPtr {
     unlink(path);
     ftruncate(fd, length);
 
-    void *buf =
+    void* buf =
         ::mmap(nullptr, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
     if (buf != MAP_FAILED) {
       DEBUG_LOG("Decompression buffer of size %ld in \"%s\", mapped @%p",
@@ -317,7 +317,7 @@ class _MappableBuffer : public MappedPtr {
     return nullptr;
   }
 
-  void *mmap(const void *addr, size_t length, int prot, int flags,
+  void* mmap(const void* addr, size_t length, int prot, int flags,
              off_t offset) {
     MOZ_ASSERT(fd != -1);
 #ifdef ANDROID
@@ -328,7 +328,7 @@ class _MappableBuffer : public MappedPtr {
       flags |= MAP_SHARED;
     }
 #endif
-    return ::mmap(const_cast(addr), length, prot, flags, fd, offset);
+    return ::mmap(const_cast(addr), length, prot, flags, fd, offset);
   }
 
 #ifdef ANDROID
@@ -345,29 +345,29 @@ class _MappableBuffer : public MappedPtr {
 #endif
 
  private:
-  _MappableBuffer(int fd, void *buf, size_t length)
+  _MappableBuffer(int fd, void* buf, size_t length)
       : MappedPtr(buf, length), fd(fd) {}
 
   /* File descriptor for the temporary file or ashmem */
   AutoCloseFD fd;
 };
 
-Mappable *MappableDeflate::Create(const char *name, Zip *zip,
-                                  Zip::Stream *stream) {
+Mappable* MappableDeflate::Create(const char* name, Zip* zip,
+                                  Zip::Stream* stream) {
   MOZ_ASSERT(stream->GetType() == Zip::Stream::DEFLATE);
-  _MappableBuffer *buf =
+  _MappableBuffer* buf =
       _MappableBuffer::Create(name, stream->GetUncompressedSize());
   if (buf) return new MappableDeflate(buf, zip, stream);
   return nullptr;
 }
 
-MappableDeflate::MappableDeflate(_MappableBuffer *buf, Zip *zip,
-                                 Zip::Stream *stream)
+MappableDeflate::MappableDeflate(_MappableBuffer* buf, Zip* zip,
+                                 Zip::Stream* stream)
     : zip(zip), buffer(buf), zStream(stream->GetZStream(*buf)) {}
 
 MappableDeflate::~MappableDeflate() {}
 
-MemoryRange MappableDeflate::mmap(const void *addr, size_t length, int prot,
+MemoryRange MappableDeflate::mmap(const void* addr, size_t length, int prot,
                                   int flags, off_t offset) {
   MOZ_ASSERT(buffer);
   MOZ_ASSERT(!(flags & MAP_SHARED));
diff --git a/mozglue/linker/Mappable.h b/mozglue/linker/Mappable.h
index 02af41eea872e..8468aaaccb124 100644
--- a/mozglue/linker/Mappable.h
+++ b/mozglue/linker/Mappable.h
@@ -21,7 +21,7 @@ class Mappable : public mozilla::RefCounted {
   MOZ_DECLARE_REFCOUNTED_TYPENAME(Mappable)
   virtual ~Mappable() {}
 
-  virtual MemoryRange mmap(const void *addr, size_t length, int prot, int flags,
+  virtual MemoryRange mmap(const void* addr, size_t length, int prot, int flags,
                            off_t offset) = 0;
 
   enum Kind {
@@ -34,7 +34,7 @@ class Mappable : public mozilla::RefCounted {
   virtual Kind GetKind() const = 0;
 
  private:
-  virtual void munmap(void *addr, size_t length) { ::munmap(addr, length); }
+  virtual void munmap(void* addr, size_t length) { ::munmap(addr, length); }
   /* Limit use of Mappable::munmap to classes that keep track of the address
    * and size of the mapping. This allows to ignore ::munmap return value. */
   friend class Mappable1stPagePtr;
@@ -63,10 +63,10 @@ class MappableFile : public Mappable {
   /**
    * Create a MappableFile instance for the given file path.
    */
-  static Mappable *Create(const char *path);
+  static Mappable* Create(const char* path);
 
   /* Inherited from Mappable */
-  virtual MemoryRange mmap(const void *addr, size_t length, int prot, int flags,
+  virtual MemoryRange mmap(const void* addr, size_t length, int prot, int flags,
                            off_t offset);
   virtual void finalize();
   virtual size_t GetLength() const;
@@ -93,7 +93,7 @@ class MappableExtractFile : public MappableFile {
    * Create a MappableExtractFile instance for the given Zip stream. The name
    * argument is used to create the cache file in the cache directory.
    */
-  static Mappable *Create(const char *name, Zip *zip, Zip::Stream *stream);
+  static Mappable* Create(const char* name, Zip* zip, Zip::Stream* stream);
 
   /* Override finalize from MappableFile */
   virtual void finalize() {}
@@ -106,14 +106,14 @@ class MappableExtractFile : public MappableFile {
    * when the instance is destroyed.
    */
   struct UnlinkFile {
-    void operator()(char *value) {
+    void operator()(char* value) {
       unlink(value);
       delete[] value;
     }
   };
   typedef mozilla::UniquePtr AutoUnlinkFile;
 
-  MappableExtractFile(int fd, const char *path)
+  MappableExtractFile(int fd, const char* path)
       : MappableFile(fd), path(path) {}
 
   /* Extracted file path */
@@ -135,10 +135,10 @@ class MappableDeflate : public Mappable {
    * argument is used for an appropriately named temporary file, and the Zip
    * instance is given for the MappableDeflate to keep a reference of it.
    */
-  static Mappable *Create(const char *name, Zip *zip, Zip::Stream *stream);
+  static Mappable* Create(const char* name, Zip* zip, Zip::Stream* stream);
 
   /* Inherited from Mappable */
-  virtual MemoryRange mmap(const void *addr, size_t length, int prot, int flags,
+  virtual MemoryRange mmap(const void* addr, size_t length, int prot, int flags,
                            off_t offset);
   virtual void finalize();
   virtual size_t GetLength() const;
@@ -146,7 +146,7 @@ class MappableDeflate : public Mappable {
   virtual Kind GetKind() const { return MAPPABLE_DEFLATE; };
 
  private:
-  MappableDeflate(_MappableBuffer *buf, Zip *zip, Zip::Stream *stream);
+  MappableDeflate(_MappableBuffer* buf, Zip* zip, Zip::Stream* stream);
 
   /* Zip reference */
   RefPtr zip;
diff --git a/mozglue/linker/Utils.h b/mozglue/linker/Utils.h
index 686afd073c4ac..d3827f1f41456 100644
--- a/mozglue/linker/Utils.h
+++ b/mozglue/linker/Utils.h
@@ -49,20 +49,20 @@ class le_to_cpu {
 
   operator Type() const { return (b << (sizeof(T) * 8)) | a; }
 
-  const le_to_cpu &operator=(const Type &v) {
+  const le_to_cpu& operator=(const Type& v) {
     a = v & ((1 << (sizeof(T) * 8)) - 1);
     b = v >> (sizeof(T) * 8);
     return *this;
   }
 
   le_to_cpu() {}
-  explicit le_to_cpu(const Type &v) { operator=(v); }
+  explicit le_to_cpu(const Type& v) { operator=(v); }
 
-  const le_to_cpu &operator+=(const Type &v) {
+  const le_to_cpu& operator+=(const Type& v) {
     return operator=(operator Type() + v);
   }
 
-  const le_to_cpu &operator++(int) { return operator=(operator Type() + 1); }
+  const le_to_cpu& operator++(int) { return operator=(operator Type() + 1); }
 
  private:
   T a, b;
@@ -91,9 +91,9 @@ typedef mozilla::Scoped AutoCloseFD;
  * AutoCloseFILE is a RAII wrapper for POSIX streams
  */
 struct AutoCloseFILETraits {
-  typedef FILE *type;
-  static FILE *empty() { return nullptr; }
-  static void release(FILE *f) {
+  typedef FILE* type;
+  static FILE* empty() { return nullptr; }
+  static void release(FILE* f) {
     if (f) fclose(f);
   }
 };
@@ -117,8 +117,8 @@ static inline uintptr_t AlignedPtr(uintptr_t ptr, size_t alignment) {
 }
 
 template 
-static inline T *AlignedPtr(T *ptr, size_t alignment) {
-  return reinterpret_cast(
+static inline T* AlignedPtr(T* ptr, size_t alignment) {
+  return reinterpret_cast(
       AlignedPtr(reinterpret_cast(ptr), alignment));
 }
 
@@ -132,8 +132,8 @@ static inline uintptr_t AlignedEndPtr(uintptr_t ptr, size_t alignment) {
 }
 
 template 
-static inline T *AlignedEndPtr(T *ptr, size_t alignment) {
-  return reinterpret_cast(
+static inline T* AlignedEndPtr(T* ptr, size_t alignment) {
+  return reinterpret_cast(
       AlignedEndPtr(reinterpret_cast(ptr), alignment));
 }
 
@@ -155,7 +155,7 @@ static inline bool IsAlignedPtr(uintptr_t ptr, size_t alignment) {
 }
 
 template 
-static inline bool IsAlignedPtr(T *ptr, size_t alignment) {
+static inline bool IsAlignedPtr(T* ptr, size_t alignment) {
   return IsAlignedPtr(reinterpret_cast(ptr), alignment);
 }
 
@@ -181,39 +181,39 @@ static inline size_t PageNumber(size_t size) {
  */
 class MemoryRange {
  public:
-  MemoryRange(void *buf, size_t length) : buf(buf), length(length) {}
+  MemoryRange(void* buf, size_t length) : buf(buf), length(length) {}
 
-  void Assign(void *b, size_t len) {
+  void Assign(void* b, size_t len) {
     buf = b;
     length = len;
   }
 
-  void Assign(const MemoryRange &other) {
+  void Assign(const MemoryRange& other) {
     buf = other.buf;
     length = other.length;
   }
 
-  void *get() const { return buf; }
+  void* get() const { return buf; }
 
-  operator void *() const { return buf; }
+  operator void*() const { return buf; }
 
-  operator unsigned char *() const {
-    return reinterpret_cast(buf);
+  operator unsigned char*() const {
+    return reinterpret_cast(buf);
   }
 
-  bool operator==(void *ptr) const { return buf == ptr; }
+  bool operator==(void* ptr) const { return buf == ptr; }
 
-  bool operator==(unsigned char *ptr) const { return buf == ptr; }
+  bool operator==(unsigned char* ptr) const { return buf == ptr; }
 
-  void *operator+(off_t offset) const {
-    return reinterpret_cast(buf) + offset;
+  void* operator+(off_t offset) const {
+    return reinterpret_cast(buf) + offset;
   }
 
   /**
    * Returns whether the given address is within the mapped range
    */
-  bool Contains(void *ptr) const {
-    return (ptr >= buf) && (ptr < reinterpret_cast(buf) + length);
+  bool Contains(void* ptr) const {
+    return (ptr >= buf) && (ptr < reinterpret_cast(buf) + length);
   }
 
   /**
@@ -221,13 +221,13 @@ class MemoryRange {
    */
   size_t GetLength() const { return length; }
 
-  static MemoryRange mmap(void *addr, size_t length, int prot, int flags,
+  static MemoryRange mmap(void* addr, size_t length, int prot, int flags,
                           int fd, off_t offset) {
     return MemoryRange(::mmap(addr, length, prot, flags, fd, offset), length);
   }
 
  private:
-  void *buf;
+  void* buf;
   size_t length;
 };
 
@@ -241,36 +241,36 @@ class MemoryRange {
 template 
 class GenericMappedPtr : public MemoryRange {
  public:
-  GenericMappedPtr(void *buf, size_t length) : MemoryRange(buf, length) {}
-  explicit GenericMappedPtr(const MemoryRange &other) : MemoryRange(other) {}
+  GenericMappedPtr(void* buf, size_t length) : MemoryRange(buf, length) {}
+  explicit GenericMappedPtr(const MemoryRange& other) : MemoryRange(other) {}
   GenericMappedPtr() : MemoryRange(MAP_FAILED, 0) {}
 
-  void Assign(void *b, size_t len) {
-    if (get() != MAP_FAILED) static_cast(this)->munmap(get(), GetLength());
+  void Assign(void* b, size_t len) {
+    if (get() != MAP_FAILED) static_cast(this)->munmap(get(), GetLength());
     MemoryRange::Assign(b, len);
   }
 
-  void Assign(const MemoryRange &other) {
+  void Assign(const MemoryRange& other) {
     Assign(other.get(), other.GetLength());
   }
 
   ~GenericMappedPtr() {
-    if (get() != MAP_FAILED) static_cast(this)->munmap(get(), GetLength());
+    if (get() != MAP_FAILED) static_cast(this)->munmap(get(), GetLength());
   }
 
   void release() { MemoryRange::Assign(MAP_FAILED, 0); }
 };
 
 struct MappedPtr : public GenericMappedPtr {
-  MappedPtr(void *buf, size_t length)
+  MappedPtr(void* buf, size_t length)
       : GenericMappedPtr(buf, length) {}
-  MOZ_IMPLICIT MappedPtr(const MemoryRange &other)
+  MOZ_IMPLICIT MappedPtr(const MemoryRange& other)
       : GenericMappedPtr(other) {}
   MappedPtr() : GenericMappedPtr() {}
 
  private:
   friend class GenericMappedPtr;
-  void munmap(void *buf, size_t length) { ::munmap(buf, length); }
+  void munmap(void* buf, size_t length) { ::munmap(buf, length); }
 };
 
 /**
@@ -296,30 +296,30 @@ class UnsizedArray {
    * Constructors and Initializers
    */
   UnsizedArray() : contents(nullptr) {}
-  explicit UnsizedArray(const void *buf)
-      : contents(reinterpret_cast(buf)) {}
+  explicit UnsizedArray(const void* buf)
+      : contents(reinterpret_cast(buf)) {}
 
-  void Init(const void *buf) {
+  void Init(const void* buf) {
     MOZ_ASSERT(contents == nullptr);
-    contents = reinterpret_cast(buf);
+    contents = reinterpret_cast(buf);
   }
 
   /**
    * Returns the nth element of the array
    */
-  const T &operator[](const idx_t index) const {
+  const T& operator[](const idx_t index) const {
     MOZ_ASSERT(contents);
     return contents[index];
   }
 
-  operator const T *() const { return contents; }
+  operator const T*() const { return contents; }
   /**
    * Returns whether the array points somewhere
    */
   explicit operator bool() const { return contents != nullptr; }
 
  private:
-  const T *contents;
+  const T* contents;
 };
 
 /**
@@ -353,10 +353,10 @@ class Array : public UnsizedArray {
    * Constructors and Initializers
    */
   Array() : UnsizedArray(), length(0) {}
-  Array(const void *buf, const idx_t length)
+  Array(const void* buf, const idx_t length)
       : UnsizedArray(buf), length(length) {}
 
-  void Init(const void *buf) { UnsizedArray::Init(buf); }
+  void Init(const void* buf) { UnsizedArray::Init(buf); }
 
   void Init(const idx_t len) {
     MOZ_ASSERT(length == 0);
@@ -365,12 +365,12 @@ class Array : public UnsizedArray {
 
   void InitSize(const idx_t size) { Init(size / sizeof(T)); }
 
-  void Init(const void *buf, const idx_t len) {
+  void Init(const void* buf, const idx_t len) {
     UnsizedArray::Init(buf);
     Init(len);
   }
 
-  void InitSize(const void *buf, const idx_t size) {
+  void InitSize(const void* buf, const idx_t size) {
     UnsizedArray::Init(buf);
     InitSize(size);
   }
@@ -378,7 +378,7 @@ class Array : public UnsizedArray {
   /**
    * Returns the nth element of the array
    */
-  const T &operator[](const idx_t index) const {
+  const T& operator[](const idx_t index) const {
     MOZ_ASSERT(index < length);
     MOZ_ASSERT(operator bool());
     return UnsizedArray::operator[](index);
@@ -409,23 +409,23 @@ class Array : public UnsizedArray {
    public:
     iterator() : item(nullptr) {}
 
-    const T &operator*() const { return *item; }
+    const T& operator*() const { return *item; }
 
-    const T *operator->() const { return item; }
+    const T* operator->() const { return item; }
 
-    iterator &operator++() {
+    iterator& operator++() {
       ++item;
       return *this;
     }
 
-    bool operator<(const iterator &other) const { return item < other.item; }
+    bool operator<(const iterator& other) const { return item < other.item; }
 
    protected:
     friend class Array;
-    explicit iterator(const T &item) : item(&item) {}
+    explicit iterator(const T& item) : item(&item) {}
 
    private:
-    const T *item;
+    const T* item;
   };
 
   /**
@@ -458,28 +458,28 @@ class Array : public UnsizedArray {
    public:
     reverse_iterator() : item(nullptr) {}
 
-    const T &operator*() const {
-      const T *tmp = item;
+    const T& operator*() const {
+      const T* tmp = item;
       return *--tmp;
     }
 
-    const T *operator->() const { return &operator*(); }
+    const T* operator->() const { return &operator*(); }
 
-    reverse_iterator &operator++() {
+    reverse_iterator& operator++() {
       --item;
       return *this;
     }
 
-    bool operator<(const reverse_iterator &other) const {
+    bool operator<(const reverse_iterator& other) const {
       return item > other.item;
     }
 
    protected:
     friend class Array;
-    explicit reverse_iterator(const T &item) : item(&item) {}
+    explicit reverse_iterator(const T& item) : item(&item) {}
 
    private:
-    const T *item;
+    const T* item;
   };
 
   /**
@@ -507,9 +507,9 @@ class Array : public UnsizedArray {
  * same address.
  */
 template 
-void *FunctionPtr(T func) {
+void* FunctionPtr(T func) {
   union {
-    void *ptr;
+    void* ptr;
     T func;
   } f;
   f.func = func;
@@ -518,7 +518,7 @@ void *FunctionPtr(T func) {
 
 class AutoLock {
  public:
-  explicit AutoLock(pthread_mutex_t *mutex) : mutex(mutex) {
+  explicit AutoLock(pthread_mutex_t* mutex) : mutex(mutex) {
     if (pthread_mutex_lock(mutex)) MOZ_CRASH("pthread_mutex_lock failed");
   }
   ~AutoLock() {
@@ -526,7 +526,7 @@ class AutoLock {
   }
 
  private:
-  pthread_mutex_t *mutex;
+  pthread_mutex_t* mutex;
 };
 
 #endif /* Utils_h */
diff --git a/mozglue/linker/Zip.cpp b/mozglue/linker/Zip.cpp
index 531fe0f9d5571..7ecc6b9a7426a 100644
--- a/mozglue/linker/Zip.cpp
+++ b/mozglue/linker/Zip.cpp
@@ -12,7 +12,7 @@
 #include "Logging.h"
 #include "Zip.h"
 
-already_AddRefed Zip::Create(const char *filename) {
+already_AddRefed Zip::Create(const char* filename) {
   /* Open and map the file in memory */
   AutoCloseFD fd(open(filename, O_RDONLY));
   if (fd == -1) {
@@ -29,7 +29,7 @@ already_AddRefed Zip::Create(const char *filename) {
     ERROR("Error reading %s: too short", filename);
     return nullptr;
   }
-  void *mapped = mmap(nullptr, size, PROT_READ, MAP_SHARED, fd, 0);
+  void* mapped = mmap(nullptr, size, PROT_READ, MAP_SHARED, fd, 0);
   if (mapped == MAP_FAILED) {
     ERROR("Error mmapping %s: %s", filename, strerror(errno));
     return nullptr;
@@ -39,7 +39,7 @@ already_AddRefed Zip::Create(const char *filename) {
   return Create(filename, mapped, size);
 }
 
-already_AddRefed Zip::Create(const char *filename, void *mapped,
+already_AddRefed Zip::Create(const char* filename, void* mapped,
                                   size_t size) {
   RefPtr zip = new Zip(filename, mapped, size);
 
@@ -54,7 +54,7 @@ already_AddRefed Zip::Create(const char *filename, void *mapped,
   return zip.forget();
 }
 
-Zip::Zip(const char *filename, void *mapped, size_t size)
+Zip::Zip(const char* filename, void* mapped, size_t size)
     : name(filename ? strdup(filename) : nullptr),
       mapped(mapped),
       size(size),
@@ -77,7 +77,7 @@ Zip::~Zip() {
   pthread_mutex_destroy(&mutex);
 }
 
-bool Zip::GetStream(const char *path, Zip::Stream *out) const {
+bool Zip::GetStream(const char* path, Zip::Stream* out) const {
   AutoLock lock(&mutex);
 
   DEBUG_LOG("%s - GetFile %s", name, path);
@@ -95,7 +95,7 @@ bool Zip::GetStream(const char *path, Zip::Stream *out) const {
       (nextFile->compressedSize != 0)) {
     DEBUG_LOG("%s - %s was next file: fast path", name, path);
     /* Fill Stream info from Local File header content */
-    const char *data = reinterpret_cast(nextFile->GetData());
+    const char* data = reinterpret_cast(nextFile->GetData());
     out->compressedBuf = data;
     out->compressedSize = nextFile->compressedSize;
     out->uncompressedSize = nextFile->uncompressedSize;
@@ -116,7 +116,7 @@ bool Zip::GetStream(const char *path, Zip::Stream *out) const {
   /* If the directory entry we have in store doesn't match, scan the Central
    * Directory for the entry corresponding to the given path */
   if (!nextDir || !nextDir->GetName().Equals(path)) {
-    const DirectoryEntry *entry = GetFirstEntry();
+    const DirectoryEntry* entry = GetFirstEntry();
     DEBUG_LOG("%s - Scan directory entries in search for %s", name, path);
     while (entry && !entry->GetName().Equals(path)) {
       entry = entry->GetNext();
@@ -131,14 +131,14 @@ bool Zip::GetStream(const char *path, Zip::Stream *out) const {
   /* Find the Local File header corresponding to the Directory entry that
    * was found. */
   nextFile =
-      LocalFile::validate(static_cast(mapped) + nextDir->offset);
+      LocalFile::validate(static_cast(mapped) + nextDir->offset);
   if (!nextFile) {
     ERROR("%s - Couldn't find the Local File header for %s", name, path);
     return false;
   }
 
   /* Fill Stream info from Directory entry content */
-  const char *data = reinterpret_cast(nextFile->GetData());
+  const char* data = reinterpret_cast(nextFile->GetData());
   out->compressedBuf = data;
   out->compressedSize = nextDir->compressedSize;
   out->uncompressedSize = nextDir->uncompressedSize;
@@ -151,12 +151,12 @@ bool Zip::GetStream(const char *path, Zip::Stream *out) const {
   return true;
 }
 
-const Zip::DirectoryEntry *Zip::GetFirstEntry() const {
+const Zip::DirectoryEntry* Zip::GetFirstEntry() const {
   if (entries) return entries;
 
-  const CentralDirectoryEnd *end = nullptr;
-  const char *_end =
-      static_cast(mapped) + size - sizeof(CentralDirectoryEnd);
+  const CentralDirectoryEnd* end = nullptr;
+  const char* _end =
+      static_cast(mapped) + size - sizeof(CentralDirectoryEnd);
 
   /* Scan for the Central Directory End */
   for (; _end > mapped && !end; _end--)
@@ -167,7 +167,7 @@ const Zip::DirectoryEntry *Zip::GetFirstEntry() const {
   }
 
   entries =
-      DirectoryEntry::validate(static_cast(mapped) + end->offset);
+      DirectoryEntry::validate(static_cast(mapped) + end->offset);
   if (!entries) {
     ERROR("%s - Couldn't find central directory record", name);
   }
@@ -177,18 +177,18 @@ const Zip::DirectoryEntry *Zip::GetFirstEntry() const {
 bool Zip::VerifyCRCs() const {
   AutoLock lock(&mutex);
 
-  for (const DirectoryEntry *entry = GetFirstEntry(); entry;
+  for (const DirectoryEntry* entry = GetFirstEntry(); entry;
        entry = entry->GetNext()) {
-    const LocalFile *file =
-        LocalFile::validate(static_cast(mapped) + entry->offset);
+    const LocalFile* file =
+        LocalFile::validate(static_cast(mapped) + entry->offset);
     uint32_t crc = crc32(0, nullptr, 0);
 
     DEBUG_LOG("%.*s: crc=%08x", int(entry->filenameSize),
-              reinterpret_cast(entry) + sizeof(*entry),
+              reinterpret_cast(entry) + sizeof(*entry),
               uint32_t(entry->CRC32));
 
     if (entry->compression == Stream::Type::STORE) {
-      crc = crc32(crc, static_cast(file->GetData()),
+      crc = crc32(crc, static_cast(file->GetData()),
                   entry->compressedSize);
       DEBUG_LOG(" STORE size=%d crc=%08x", int(entry->compressedSize), crc);
 
@@ -197,7 +197,7 @@ bool Zip::VerifyCRCs() const {
       Bytef buffer[1024];
       zstream.avail_in = entry->compressedSize;
       zstream.next_in =
-          reinterpret_cast(const_cast(file->GetData()));
+          reinterpret_cast(const_cast(file->GetData()));
       zstream.zalloc = nullptr;
       zstream.zfree = nullptr;
       zstream.opaque = nullptr;
@@ -240,11 +240,11 @@ ZipCollection ZipCollection::Singleton;
 
 static pthread_mutex_t sZipCollectionMutex = PTHREAD_MUTEX_INITIALIZER;
 
-already_AddRefed ZipCollection::GetZip(const char *path) {
+already_AddRefed ZipCollection::GetZip(const char* path) {
   {
     AutoLock lock(&sZipCollectionMutex);
     /* Search the list of Zips we already have for a match */
-    for (const auto &zip : Singleton.zips) {
+    for (const auto& zip : Singleton.zips) {
       if (zip->GetName() && (strcmp(zip->GetName(), path) == 0)) {
         return RefPtr(zip).forget();
       }
@@ -253,13 +253,13 @@ already_AddRefed ZipCollection::GetZip(const char *path) {
   return Zip::Create(path);
 }
 
-void ZipCollection::Register(Zip *zip) {
+void ZipCollection::Register(Zip* zip) {
   AutoLock lock(&sZipCollectionMutex);
   DEBUG_LOG("ZipCollection::Register(\"%s\")", zip->GetName());
   Singleton.zips.push_back(zip);
 }
 
-void ZipCollection::Forget(const Zip *zip) {
+void ZipCollection::Forget(const Zip* zip) {
   AutoLock lock(&sZipCollectionMutex);
   if (zip->refCount() > 1) {
     // Someone has acquired a reference before we had acquired the lock,
diff --git a/mozglue/linker/Zip.h b/mozglue/linker/Zip.h
index a0906e2ca6fc1..d109d05fc358e 100644
--- a/mozglue/linker/Zip.h
+++ b/mozglue/linker/Zip.h
@@ -36,23 +36,23 @@ class Zip : public mozilla::external::AtomicRefCounted {
    * Create a Zip instance for the given file name. Returns nullptr in case
    * of failure.
    */
-  static already_AddRefed Create(const char *filename);
+  static already_AddRefed Create(const char* filename);
 
   /**
    * Create a Zip instance using the given buffer.
    */
-  static already_AddRefed Create(void *buffer, size_t size) {
+  static already_AddRefed Create(void* buffer, size_t size) {
     return Create(nullptr, buffer, size);
   }
 
  private:
-  static already_AddRefed Create(const char *filename, void *buffer,
+  static already_AddRefed Create(const char* filename, void* buffer,
                                       size_t size);
 
   /**
    * Private constructor
    */
-  Zip(const char *filename, void *buffer, size_t size);
+  Zip(const char* filename, void* buffer, size_t size);
 
  public:
   /**
@@ -83,7 +83,7 @@ class Zip : public mozilla::external::AtomicRefCounted {
     /**
      * Getters
      */
-    const void *GetBuffer() { return compressedBuf; }
+    const void* GetBuffer() { return compressedBuf; }
     size_t GetSize() { return compressedSize; }
     size_t GetUncompressedSize() { return uncompressedSize; }
     size_t GetCRC32() { return CRC32; }
@@ -94,13 +94,13 @@ class Zip : public mozilla::external::AtomicRefCounted {
      * buffer as inflate output. The caller is expected to allocate enough
      * memory for the Stream uncompressed size.
      */
-    z_stream GetZStream(void *buf) {
+    z_stream GetZStream(void* buf) {
       z_stream zStream;
       zStream.avail_in = compressedSize;
       zStream.next_in =
-          reinterpret_cast(const_cast(compressedBuf));
+          reinterpret_cast(const_cast(compressedBuf));
       zStream.avail_out = uncompressedSize;
-      zStream.next_out = static_cast(buf);
+      zStream.next_out = static_cast(buf);
       zStream.zalloc = nullptr;
       zStream.zfree = nullptr;
       zStream.opaque = nullptr;
@@ -109,7 +109,7 @@ class Zip : public mozilla::external::AtomicRefCounted {
 
    protected:
     friend class Zip;
-    const void *compressedBuf;
+    const void* compressedBuf;
     size_t compressedSize;
     size_t uncompressedSize;
     size_t CRC32;
@@ -119,12 +119,12 @@ class Zip : public mozilla::external::AtomicRefCounted {
   /**
    * Returns a stream from the Zip archive.
    */
-  bool GetStream(const char *path, Stream *out) const;
+  bool GetStream(const char* path, Stream* out) const;
 
   /**
    * Returns the file name of the archive
    */
-  const char *GetName() const { return name; }
+  const char* GetName() const { return name; }
 
   /**
    * Returns whether all files have correct CRC checksum.
@@ -133,9 +133,9 @@ class Zip : public mozilla::external::AtomicRefCounted {
 
  private:
   /* File name of the archive */
-  char *name;
+  char* name;
   /* Address where the Zip archive is mapped */
-  void *mapped;
+  void* mapped;
   /* Size of the archive */
   size_t size;
 
@@ -148,18 +148,18 @@ class Zip : public mozilla::external::AtomicRefCounted {
     /**
      * Constructor
      */
-    StringBuf(const char *buf, size_t length) : buf(buf), length(length) {}
+    StringBuf(const char* buf, size_t length) : buf(buf), length(length) {}
 
     /**
      * Returns whether the string has the same content as the given zero
      * terminated string.
      */
-    bool Equals(const char *str) const {
+    bool Equals(const char* str) const {
       return (strncmp(str, buf, length) == 0 && str[length] == '\0');
     }
 
    private:
-    const char *buf;
+    const char* buf;
     size_t length;
   };
 
@@ -178,8 +178,8 @@ class Zip : public mozilla::external::AtomicRefCounted {
      * Equivalent to reinterpret_cast(buf), with an additional
      * check of the signature.
      */
-    static const T *validate(const void *buf) {
-      const T *ret = static_cast(buf);
+    static const T* validate(const void* buf) {
+      const T* ret = static_cast(buf);
       if (ret->signature == T::magic) return ret;
       return nullptr;
     }
@@ -203,15 +203,15 @@ class Zip : public mozilla::external::AtomicRefCounted {
      * Returns the file name
      */
     StringBuf GetName() const {
-      return StringBuf(reinterpret_cast(this) + sizeof(*this),
+      return StringBuf(reinterpret_cast(this) + sizeof(*this),
                        filenameSize);
     }
 
     /**
      * Returns a pointer to the data associated with this header
      */
-    const void *GetData() const {
-      return reinterpret_cast(this) + sizeof(*this) +
+    const void* GetData() const {
+      return reinterpret_cast(this) + sizeof(*this) +
              filenameSize + extraFieldSize;
     }
 
@@ -254,15 +254,15 @@ class Zip : public mozilla::external::AtomicRefCounted {
      * Returns the file name
      */
     StringBuf GetName() const {
-      return StringBuf(reinterpret_cast(this) + sizeof(*this),
+      return StringBuf(reinterpret_cast(this) + sizeof(*this),
                        filenameSize);
     }
 
     /**
      * Returns  the Central Directory Entry following this one.
      */
-    const DirectoryEntry *GetNext() const {
-      return validate(reinterpret_cast(this) + sizeof(*this) +
+    const DirectoryEntry* GetNext() const {
+      return validate(reinterpret_cast(this) + sizeof(*this) +
                       filenameSize + extraFieldSize + fileCommentSize);
     }
 
@@ -304,18 +304,18 @@ class Zip : public mozilla::external::AtomicRefCounted {
   /**
    * Returns the first Directory entry
    */
-  const DirectoryEntry *GetFirstEntry() const;
+  const DirectoryEntry* GetFirstEntry() const;
 
   /* Pointer to the Local File Entry following the last one GetStream() used.
    * This is used by GetStream to avoid scanning the Directory Entries when the
    * requested entry is that one. */
-  mutable const LocalFile *nextFile;
+  mutable const LocalFile* nextFile;
 
   /* Likewise for the next Directory entry */
-  mutable const DirectoryEntry *nextDir;
+  mutable const DirectoryEntry* nextDir;
 
   /* Pointer to the Directory entries */
-  mutable const DirectoryEntry *entries;
+  mutable const DirectoryEntry* entries;
 
   mutable pthread_mutex_t mutex;
 };
@@ -331,7 +331,7 @@ class ZipCollection {
    * Get a Zip instance for the given path. If there is an existing one
    * already, return that one, otherwise create a new one.
    */
-  static already_AddRefed GetZip(const char *path);
+  static already_AddRefed GetZip(const char* path);
 
  protected:
   friend class Zip;
@@ -342,13 +342,13 @@ class ZipCollection {
    * Register the given Zip instance. This method is meant to be called
    * by Zip::Create.
    */
-  static void Register(Zip *zip);
+  static void Register(Zip* zip);
 
   /**
    * Forget about the given Zip instance. This method is meant to be called
    * by the Zip destructor.
    */
-  static void Forget(const Zip *zip);
+  static void Forget(const Zip* zip);
 
  private:
   /* Zip instances bookkept in this collection */
@@ -366,12 +366,12 @@ inline void RefCounted::Release() const {
     // No external references are left, attempt to remove it from the
     // collection. If it's successfully removed from the collection, Release()
     // will be called with mRefCnt = 1, which will finally delete this zip.
-    ZipCollection::Forget(static_cast(this));
+    ZipCollection::Forget(static_cast(this));
   } else if (count == 0) {
 #ifdef DEBUG
     mRefCnt = detail::DEAD;
 #endif
-    delete static_cast(this);
+    delete static_cast(this);
   }
 }
 
diff --git a/mozglue/linker/tests/TestZip.cpp b/mozglue/linker/tests/TestZip.cpp
index 570391819953a..ac5372a113652 100644
--- a/mozglue/linker/tests/TestZip.cpp
+++ b/mozglue/linker/tests/TestZip.cpp
@@ -42,7 +42,7 @@ Logging Logging::Singleton;
  * The entries are going to be read out of order.
  */
 ZIP_DATA(TEST_ZIP, "test.zip");
-const char *test_entries[] = {"baz", "foo", "bar", "qux"};
+const char* test_entries[] = {"baz", "foo", "bar", "qux"};
 
 /**
  * no_central_dir.zip is a hand crafted test zip with no central directory
@@ -59,13 +59,13 @@ const char *test_entries[] = {"baz", "foo", "bar", "qux"};
  * - Fourth entry is a file "d", STOREd.
  */
 ZIP_DATA(NO_CENTRAL_DIR_ZIP, "no_central_dir.zip");
-const char *no_central_dir_entries[] = {"a", "b", "c", "d"};
+const char* no_central_dir_entries[] = {"a", "b", "c", "d"};
 
 TEST(Zip, TestZip)
 {
   Zip::Stream s;
-  RefPtr z = Zip::Create((void *)TEST_ZIP, TEST_ZIP_SIZE);
-  for (auto &entry : test_entries) {
+  RefPtr z = Zip::Create((void*)TEST_ZIP, TEST_ZIP_SIZE);
+  for (auto& entry : test_entries) {
     ASSERT_TRUE(z->GetStream(entry, &s))
     << "Could not get entry \"" << entry << "\"";
   }
@@ -75,8 +75,8 @@ TEST(Zip, NoCentralDir)
 {
   Zip::Stream s;
   RefPtr z =
-      Zip::Create((void *)NO_CENTRAL_DIR_ZIP, NO_CENTRAL_DIR_ZIP_SIZE);
-  for (auto &entry : no_central_dir_entries) {
+      Zip::Create((void*)NO_CENTRAL_DIR_ZIP, NO_CENTRAL_DIR_ZIP_SIZE);
+  for (auto& entry : no_central_dir_entries) {
     ASSERT_TRUE(z->GetStream(entry, &s))
     << "Could not get entry \"" << entry << "\"";
   }
diff --git a/mozglue/misc/Debug.h b/mozglue/misc/Debug.h
index 53011fa15542d..adc8d02c7be64 100644
--- a/mozglue/misc/Debug.h
+++ b/mozglue/misc/Debug.h
@@ -33,7 +33,7 @@
 extern "C" {
 #endif  // __cplusplus
 
-inline void printf_stderr(const char *fmt, ...) MOZ_FORMAT_PRINTF(1, 2) {
+inline void printf_stderr(const char* fmt, ...) MOZ_FORMAT_PRINTF(1, 2) {
 #if defined(XP_WIN)
   if (IsDebuggerPresent()) {
     char buf[2048];
@@ -45,7 +45,7 @@ inline void printf_stderr(const char *fmt, ...) MOZ_FORMAT_PRINTF(1, 2) {
   }
 #endif  // defined(XP_WIN)
 
-  FILE *fp = _fdopen(_dup(2), "a");
+  FILE* fp = _fdopen(_dup(2), "a");
   if (!fp) return;
 
   va_list args;
diff --git a/mozglue/tests/TestPrintf.cpp b/mozglue/tests/TestPrintf.cpp
index cd91d11120e73..a23aa1b261b3b 100644
--- a/mozglue/tests/TestPrintf.cpp
+++ b/mozglue/tests/TestPrintf.cpp
@@ -13,7 +13,7 @@
 // PrintfTarget::print.
 class TestPrintfTarget : public mozilla::PrintfTarget {
  public:
-  static const char *test_string;
+  static const char* test_string;
 
   TestPrintfTarget() : mOut(0) { memset(mBuffer, '\0', sizeof(mBuffer)); }
 
@@ -22,7 +22,7 @@ class TestPrintfTarget : public mozilla::PrintfTarget {
     MOZ_RELEASE_ASSERT(strncmp(mBuffer, test_string, strlen(test_string)) == 0);
   }
 
-  bool append(const char *sp, size_t len) override {
+  bool append(const char* sp, size_t len) override {
     if (mOut + len < sizeof(mBuffer)) {
       memcpy(&mBuffer[mOut], sp, len);
     }
@@ -35,7 +35,7 @@ class TestPrintfTarget : public mozilla::PrintfTarget {
   size_t mOut;
 };
 
-const char *TestPrintfTarget::test_string = "test string";
+const char* TestPrintfTarget::test_string = "test string";
 
 static void TestPrintfTargetPrint() {
   TestPrintfTarget checker;
@@ -43,7 +43,7 @@ static void TestPrintfTargetPrint() {
 }
 
 static bool MOZ_FORMAT_PRINTF(2, 3)
-    print_one(const char *expect, const char *fmt, ...) {
+    print_one(const char* expect, const char* fmt, ...) {
   va_list ap;
 
   va_start(ap, fmt);
@@ -53,7 +53,7 @@ static bool MOZ_FORMAT_PRINTF(2, 3)
   return output && !strcmp(output.get(), expect);
 }
 
-static const char *zero() { return nullptr; }
+static const char* zero() { return nullptr; }
 
 static void TestPrintfFormats() {
   MOZ_RELEASE_ASSERT(print_one("0", "%d", 0));
@@ -103,7 +103,7 @@ static void TestPrintfFormats() {
   MOZ_RELEASE_ASSERT(print_one("hello", "%.*s", 5, "hello there"));
   MOZ_RELEASE_ASSERT(print_one("", "%.*s", 0, "hello there"));
   MOZ_RELEASE_ASSERT(print_one("%%", "%%%%"));
-  MOZ_RELEASE_ASSERT(print_one("0", "%p", (char *)0));
+  MOZ_RELEASE_ASSERT(print_one("0", "%p", (char*)0));
   MOZ_RELEASE_ASSERT(print_one("h", "%c", 'h'));
   MOZ_RELEASE_ASSERT(print_one("1.500000", "%f", 1.5f));
   MOZ_RELEASE_ASSERT(print_one("1.5", "%g", 1.5));
diff --git a/netwerk/base/ADivertableParentChannel.h b/netwerk/base/ADivertableParentChannel.h
index 748236fbc9703..2b29a4fbb48d2 100644
--- a/netwerk/base/ADivertableParentChannel.h
+++ b/netwerk/base/ADivertableParentChannel.h
@@ -25,7 +25,7 @@ class ADivertableParentChannel : public nsISupports {
   // i.e. OnStartRequest, OnDataAvailable and OnStopRequest, as if it had been
   // passed to AsyncOpen for the channel. A reference to the listener will be
   // added and kept until OnStopRequest has completed.
-  virtual void DivertTo(nsIStreamListener *aListener) = 0;
+  virtual void DivertTo(nsIStreamListener* aListener) = 0;
 
   // Called to suspend parent channel in ChannelDiverterParent constructor.
   virtual nsresult SuspendForDiversion() = 0;
diff --git a/netwerk/base/ArrayBufferInputStream.cpp b/netwerk/base/ArrayBufferInputStream.cpp
index e75d3ebf4e50a..d5102051bc30a 100644
--- a/netwerk/base/ArrayBufferInputStream.cpp
+++ b/netwerk/base/ArrayBufferInputStream.cpp
@@ -28,7 +28,7 @@ ArrayBufferInputStream::SetData(JS::Handle aBuffer,
   if (!aBuffer.isObject()) {
     return NS_ERROR_FAILURE;
   }
-  JS::Rooted arrayBuffer(RootingCx(), &aBuffer.toObject());
+  JS::Rooted arrayBuffer(RootingCx(), &aBuffer.toObject());
   if (!JS::IsArrayBufferObject(arrayBuffer)) {
     return NS_ERROR_FAILURE;
   }
@@ -46,8 +46,8 @@ ArrayBufferInputStream::SetData(JS::Handle aBuffer,
 
   JS::AutoCheckCannotGC nogc;
   bool isShared;
-  char *src =
-      (char *)JS::GetArrayBufferData(arrayBuffer, &isShared, nogc) + offset;
+  char* src =
+      (char*)JS::GetArrayBufferData(arrayBuffer, &isShared, nogc) + offset;
   memcpy(&mArrayBuffer[0], src, mBufferLength);
   return NS_OK;
 }
@@ -59,7 +59,7 @@ ArrayBufferInputStream::Close() {
 }
 
 NS_IMETHODIMP
-ArrayBufferInputStream::Available(uint64_t *aCount) {
+ArrayBufferInputStream::Available(uint64_t* aCount) {
   if (mClosed) {
     return NS_BASE_STREAM_CLOSED;
   }
@@ -72,14 +72,14 @@ ArrayBufferInputStream::Available(uint64_t *aCount) {
 }
 
 NS_IMETHODIMP
-ArrayBufferInputStream::Read(char *aBuf, uint32_t aCount,
-                             uint32_t *aReadCount) {
+ArrayBufferInputStream::Read(char* aBuf, uint32_t aCount,
+                             uint32_t* aReadCount) {
   return ReadSegments(NS_CopySegmentToBuffer, aBuf, aCount, aReadCount);
 }
 
 NS_IMETHODIMP
-ArrayBufferInputStream::ReadSegments(nsWriteSegmentFun writer, void *closure,
-                                     uint32_t aCount, uint32_t *result) {
+ArrayBufferInputStream::ReadSegments(nsWriteSegmentFun writer, void* closure,
+                                     uint32_t aCount, uint32_t* result) {
   NS_ASSERTION(result, "null ptr");
   NS_ASSERTION(mBufferLength >= mPos, "bad stream state");
 
@@ -119,7 +119,7 @@ ArrayBufferInputStream::ReadSegments(nsWriteSegmentFun writer, void *closure,
 }
 
 NS_IMETHODIMP
-ArrayBufferInputStream::IsNonBlocking(bool *aNonBlocking) {
+ArrayBufferInputStream::IsNonBlocking(bool* aNonBlocking) {
   *aNonBlocking = true;
   return NS_OK;
 }
diff --git a/netwerk/base/AutoClose.h b/netwerk/base/AutoClose.h
index 59927f3025664..5320d9ce7b636 100644
--- a/netwerk/base/AutoClose.h
+++ b/netwerk/base/AutoClose.h
@@ -32,12 +32,12 @@ class AutoClose {
     return mPtr.forget();
   }
 
-  void takeOver(nsCOMPtr &rhs) { TakeOverInternal(rhs.forget()); }
+  void takeOver(nsCOMPtr& rhs) { TakeOverInternal(rhs.forget()); }
 
   void CloseAndRelease() { TakeOverInternal(nullptr); }
 
  private:
-  void TakeOverInternal(already_AddRefed &&aOther) {
+  void TakeOverInternal(already_AddRefed&& aOther) {
     nsCOMPtr ptr(std::move(aOther));
     {
       MutexAutoLock lock(mMutex);
@@ -49,8 +49,8 @@ class AutoClose {
     }
   }
 
-  void operator=(const AutoClose &) = delete;
-  AutoClose(const AutoClose &) = delete;
+  void operator=(const AutoClose&) = delete;
+  AutoClose(const AutoClose&) = delete;
 
   nsCOMPtr mPtr;
   Mutex mMutex;
diff --git a/netwerk/base/BackgroundFileSaver.cpp b/netwerk/base/BackgroundFileSaver.cpp
index 1e8d63344afa7..b44e6c504d6a7 100644
--- a/netwerk/base/BackgroundFileSaver.cpp
+++ b/netwerk/base/BackgroundFileSaver.cpp
@@ -65,7 +65,7 @@ static LazyLogModule prlog("BackgroundFileSaver");
  */
 class NotifyTargetChangeRunnable final : public Runnable {
  public:
-  NotifyTargetChangeRunnable(BackgroundFileSaver *aSaver, nsIFile *aTarget)
+  NotifyTargetChangeRunnable(BackgroundFileSaver* aSaver, nsIFile* aTarget)
       : Runnable("net::NotifyTargetChangeRunnable"),
         mSaver(aSaver),
         mTarget(aTarget) {}
@@ -139,7 +139,7 @@ nsresult BackgroundFileSaver::Init() {
 
 // Called on the control thread.
 NS_IMETHODIMP
-BackgroundFileSaver::GetObserver(nsIBackgroundFileSaverObserver **aObserver) {
+BackgroundFileSaver::GetObserver(nsIBackgroundFileSaverObserver** aObserver) {
   NS_ENSURE_ARG_POINTER(aObserver);
   *aObserver = mObserver;
   NS_IF_ADDREF(*aObserver);
@@ -148,7 +148,7 @@ BackgroundFileSaver::GetObserver(nsIBackgroundFileSaverObserver **aObserver) {
 
 // Called on the control thread.
 NS_IMETHODIMP
-BackgroundFileSaver::SetObserver(nsIBackgroundFileSaverObserver *aObserver) {
+BackgroundFileSaver::SetObserver(nsIBackgroundFileSaverObserver* aObserver) {
   mObserver = aObserver;
   return NS_OK;
 }
@@ -166,7 +166,7 @@ BackgroundFileSaver::EnableAppend() {
 
 // Called on the control thread.
 NS_IMETHODIMP
-BackgroundFileSaver::SetTarget(nsIFile *aTarget, bool aKeepPartial) {
+BackgroundFileSaver::SetTarget(nsIFile* aTarget, bool aKeepPartial) {
   NS_ENSURE_ARG(aTarget);
   {
     MutexAutoLock lock(mLock);
@@ -226,7 +226,7 @@ BackgroundFileSaver::EnableSha256() {
 }
 
 NS_IMETHODIMP
-BackgroundFileSaver::GetSha256Hash(nsACString &aHash) {
+BackgroundFileSaver::GetSha256Hash(nsACString& aHash) {
   MOZ_ASSERT(NS_IsMainThread(), "Can't inspect sha256 off the main thread");
   // We acquire a lock because mSha256 is written on the worker thread.
   MutexAutoLock lock(mLock);
@@ -250,7 +250,7 @@ BackgroundFileSaver::EnableSignatureInfo() {
 }
 
 NS_IMETHODIMP
-BackgroundFileSaver::GetSignatureInfo(nsIArray **aSignatureInfo) {
+BackgroundFileSaver::GetSignatureInfo(nsIArray** aSignatureInfo) {
   MOZ_ASSERT(NS_IsMainThread(), "Can't inspect signature off the main thread");
   // We acquire a lock because mSignatureInfo is written on the worker thread.
   MutexAutoLock lock(mLock);
@@ -308,12 +308,12 @@ nsresult BackgroundFileSaver::GetWorkerThreadAttention(
 
 // Called on the worker thread.
 // static
-void BackgroundFileSaver::AsyncCopyCallback(void *aClosure, nsresult aStatus) {
+void BackgroundFileSaver::AsyncCopyCallback(void* aClosure, nsresult aStatus) {
   // We called NS_ADDREF_THIS when NS_AsyncCopy started, to keep the object
   // alive even if other references disappeared.  At the end of this method,
   // we've finished using the object and can safely release our reference.
   RefPtr self =
-      dont_AddRef((BackgroundFileSaver *)aClosure);
+      dont_AddRef((BackgroundFileSaver*)aClosure);
   {
     MutexAutoLock lock(self->mLock);
 
@@ -540,7 +540,7 @@ nsresult BackgroundFileSaver::ProcessStateChange() {
 
         nsresult rv = MapSECStatus(
             PK11_DigestOp(mDigestContext.get(),
-                          BitwiseCast(buffer), count));
+                          BitwiseCast(buffer), count));
         NS_ENSURE_SUCCESS(rv, rv);
       }
 
@@ -674,7 +674,7 @@ bool BackgroundFileSaver::CheckCompletion() {
     if (NS_SUCCEEDED(rv)) {
       MutexAutoLock lock(mLock);
       mSha256 = nsDependentCSubstring(
-          BitwiseCast(d.get().data), d.get().len);
+          BitwiseCast(d.get().data), d.get().len);
     }
   }
 
@@ -703,7 +703,7 @@ bool BackgroundFileSaver::CheckCompletion() {
 }
 
 // Called on the control thread.
-nsresult BackgroundFileSaver::NotifyTargetChange(nsIFile *aTarget) {
+nsresult BackgroundFileSaver::NotifyTargetChange(nsIFile* aTarget) {
   if (mObserver) {
     (void)mObserver->OnTargetChange(this, aTarget);
   }
@@ -753,7 +753,7 @@ nsresult BackgroundFileSaver::NotifySaveComplete() {
   return NS_OK;
 }
 
-nsresult BackgroundFileSaver::ExtractSignatureInfo(const nsAString &filePath) {
+nsresult BackgroundFileSaver::ExtractSignatureInfo(const nsAString& filePath) {
   MOZ_ASSERT(!NS_IsMainThread(), "Cannot extract signature on main thread");
   {
     MutexAutoLock lock(mLock);
@@ -796,7 +796,7 @@ nsresult BackgroundFileSaver::ExtractSignatureInfo(const nsAString &filePath) {
   // Check if the file is signed by something that is trusted. If the file is
   // not signed, this is a no-op.
   LONG ret = WinVerifyTrust(nullptr, &policyGUID, &trustData);
-  CRYPT_PROVIDER_DATA *cryptoProviderData = nullptr;
+  CRYPT_PROVIDER_DATA* cryptoProviderData = nullptr;
   // According to the Windows documentation, we should check against 0 instead
   // of ERROR_SUCCESS, which is an HRESULT.
   if (ret == 0) {
@@ -809,13 +809,13 @@ nsresult BackgroundFileSaver::ExtractSignatureInfo(const nsAString &filePath) {
     // A binary may have multiple signers. Each signer may have multiple certs
     // in the chain.
     for (DWORD i = 0; i < cryptoProviderData->csSigners; ++i) {
-      const CERT_CHAIN_CONTEXT *certChainContext =
+      const CERT_CHAIN_CONTEXT* certChainContext =
           cryptoProviderData->pasSigners[i].pChainContext;
       if (!certChainContext) {
         break;
       }
       for (DWORD j = 0; j < certChainContext->cChain; ++j) {
-        const CERT_SIMPLE_CHAIN *certSimpleChain =
+        const CERT_SIMPLE_CHAIN* certSimpleChain =
             certChainContext->rgpChain[j];
         if (!certSimpleChain) {
           break;
@@ -827,14 +827,14 @@ nsresult BackgroundFileSaver::ExtractSignatureInfo(const nsAString &filePath) {
         }
         bool extractionSuccess = true;
         for (DWORD k = 0; k < certSimpleChain->cElement; ++k) {
-          CERT_CHAIN_ELEMENT *certChainElement = certSimpleChain->rgpElement[k];
+          CERT_CHAIN_ELEMENT* certChainElement = certSimpleChain->rgpElement[k];
           if (certChainElement->pCertContext->dwCertEncodingType !=
               X509_ASN_ENCODING) {
             continue;
           }
           nsCOMPtr nssCert = nullptr;
           nsDependentCSubstring certDER(
-              reinterpret_cast(
+              reinterpret_cast(
                   certChainElement->pCertContext->pbCertEncoded),
               certChainElement->pCertContext->cbCertEncoded);
           rv = certDB->ConstructX509(certDER, getter_AddRefs(nssCert));
@@ -892,26 +892,26 @@ NS_IMETHODIMP
 BackgroundFileSaverOutputStream::Flush() { return mPipeOutputStream->Flush(); }
 
 NS_IMETHODIMP
-BackgroundFileSaverOutputStream::Write(const char *aBuf, uint32_t aCount,
-                                       uint32_t *_retval) {
+BackgroundFileSaverOutputStream::Write(const char* aBuf, uint32_t aCount,
+                                       uint32_t* _retval) {
   return mPipeOutputStream->Write(aBuf, aCount, _retval);
 }
 
 NS_IMETHODIMP
-BackgroundFileSaverOutputStream::WriteFrom(nsIInputStream *aFromStream,
-                                           uint32_t aCount, uint32_t *_retval) {
+BackgroundFileSaverOutputStream::WriteFrom(nsIInputStream* aFromStream,
+                                           uint32_t aCount, uint32_t* _retval) {
   return mPipeOutputStream->WriteFrom(aFromStream, aCount, _retval);
 }
 
 NS_IMETHODIMP
 BackgroundFileSaverOutputStream::WriteSegments(nsReadSegmentFun aReader,
-                                               void *aClosure, uint32_t aCount,
-                                               uint32_t *_retval) {
+                                               void* aClosure, uint32_t aCount,
+                                               uint32_t* _retval) {
   return mPipeOutputStream->WriteSegments(aReader, aClosure, aCount, _retval);
 }
 
 NS_IMETHODIMP
-BackgroundFileSaverOutputStream::IsNonBlocking(bool *_retval) {
+BackgroundFileSaverOutputStream::IsNonBlocking(bool* _retval) {
   return mPipeOutputStream->IsNonBlocking(_retval);
 }
 
@@ -921,10 +921,10 @@ BackgroundFileSaverOutputStream::CloseWithStatus(nsresult reason) {
 }
 
 NS_IMETHODIMP
-BackgroundFileSaverOutputStream::AsyncWait(nsIOutputStreamCallback *aCallback,
+BackgroundFileSaverOutputStream::AsyncWait(nsIOutputStreamCallback* aCallback,
                                            uint32_t aFlags,
                                            uint32_t aRequestedCount,
-                                           nsIEventTarget *aEventTarget) {
+                                           nsIEventTarget* aEventTarget) {
   NS_ENSURE_STATE(!mAsyncWaitCallback);
 
   mAsyncWaitCallback = aCallback;
@@ -935,7 +935,7 @@ BackgroundFileSaverOutputStream::AsyncWait(nsIOutputStreamCallback *aCallback,
 
 NS_IMETHODIMP
 BackgroundFileSaverOutputStream::OnOutputStreamReady(
-    nsIAsyncOutputStream *aStream) {
+    nsIAsyncOutputStream* aStream) {
   NS_ENSURE_STATE(mAsyncWaitCallback);
 
   nsCOMPtr asyncWaitCallback = nullptr;
@@ -965,14 +965,14 @@ BackgroundFileSaverStreamListener::GetProgressCallback() {
 }
 
 NS_IMETHODIMP
-BackgroundFileSaverStreamListener::OnStartRequest(nsIRequest *aRequest) {
+BackgroundFileSaverStreamListener::OnStartRequest(nsIRequest* aRequest) {
   NS_ENSURE_ARG(aRequest);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-BackgroundFileSaverStreamListener::OnStopRequest(nsIRequest *aRequest,
+BackgroundFileSaverStreamListener::OnStopRequest(nsIRequest* aRequest,
                                                  nsresult aStatusCode) {
   // If an error occurred, cancel the operation immediately.  On success, wait
   // until the caller has determined whether the file should be renamed.
@@ -984,8 +984,8 @@ BackgroundFileSaverStreamListener::OnStopRequest(nsIRequest *aRequest,
 }
 
 NS_IMETHODIMP
-BackgroundFileSaverStreamListener::OnDataAvailable(nsIRequest *aRequest,
-                                                   nsIInputStream *aInputStream,
+BackgroundFileSaverStreamListener::OnDataAvailable(nsIRequest* aRequest,
+                                                   nsIInputStream* aInputStream,
                                                    uint64_t aOffset,
                                                    uint32_t aCount) {
   nsresult rv;
@@ -1031,9 +1031,9 @@ BackgroundFileSaverStreamListener::OnDataAvailable(nsIRequest *aRequest,
 // Called on the worker thread.
 // static
 void BackgroundFileSaverStreamListener::AsyncCopyProgressCallback(
-    void *aClosure, uint32_t aCount) {
-  BackgroundFileSaverStreamListener *self =
-      (BackgroundFileSaverStreamListener *)aClosure;
+    void* aClosure, uint32_t aCount) {
+  BackgroundFileSaverStreamListener* self =
+      (BackgroundFileSaverStreamListener*)aClosure;
 
   // Wait if the control thread is in the process of suspending or resuming.
   MutexAutoLock lock(self->mSuspensionLock);
@@ -1092,8 +1092,8 @@ nsresult BackgroundFileSaverStreamListener::NotifySuspendOrResume() {
 //// DigestOutputStream
 NS_IMPL_ISUPPORTS(DigestOutputStream, nsIOutputStream)
 
-DigestOutputStream::DigestOutputStream(nsIOutputStream *aStream,
-                                       PK11Context *aContext)
+DigestOutputStream::DigestOutputStream(nsIOutputStream* aStream,
+                                       PK11Context* aContext)
     : mOutputStream(aStream), mDigestContext(aContext) {
   MOZ_ASSERT(mDigestContext, "Can't have null digest context");
   MOZ_ASSERT(mOutputStream, "Can't have null output stream");
@@ -1106,9 +1106,9 @@ NS_IMETHODIMP
 DigestOutputStream::Flush() { return mOutputStream->Flush(); }
 
 NS_IMETHODIMP
-DigestOutputStream::Write(const char *aBuf, uint32_t aCount, uint32_t *retval) {
+DigestOutputStream::Write(const char* aBuf, uint32_t aCount, uint32_t* retval) {
   nsresult rv = MapSECStatus(PK11_DigestOp(
-      mDigestContext, BitwiseCast(aBuf),
+      mDigestContext, BitwiseCast(aBuf),
       aCount));
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -1116,8 +1116,8 @@ DigestOutputStream::Write(const char *aBuf, uint32_t aCount, uint32_t *retval) {
 }
 
 NS_IMETHODIMP
-DigestOutputStream::WriteFrom(nsIInputStream *aFromStream, uint32_t aCount,
-                              uint32_t *retval) {
+DigestOutputStream::WriteFrom(nsIInputStream* aFromStream, uint32_t aCount,
+                              uint32_t* retval) {
   // Not supported. We could read the stream to a buf, call DigestOp on the
   // result, seek back and pass the stream on, but it's not worth it since our
   // application (NS_AsyncCopy) doesn't invoke this on the sink.
@@ -1125,13 +1125,13 @@ DigestOutputStream::WriteFrom(nsIInputStream *aFromStream, uint32_t aCount,
 }
 
 NS_IMETHODIMP
-DigestOutputStream::WriteSegments(nsReadSegmentFun aReader, void *aClosure,
-                                  uint32_t aCount, uint32_t *retval) {
+DigestOutputStream::WriteSegments(nsReadSegmentFun aReader, void* aClosure,
+                                  uint32_t aCount, uint32_t* retval) {
   MOZ_CRASH("DigestOutputStream::WriteSegments not implemented");
 }
 
 NS_IMETHODIMP
-DigestOutputStream::IsNonBlocking(bool *retval) {
+DigestOutputStream::IsNonBlocking(bool* retval) {
   return mOutputStream->IsNonBlocking(retval);
 }
 
diff --git a/netwerk/base/CaptivePortalService.cpp b/netwerk/base/CaptivePortalService.cpp
index 555e134136d23..425467388fb3a 100644
--- a/netwerk/base/CaptivePortalService.cpp
+++ b/netwerk/base/CaptivePortalService.cpp
@@ -226,7 +226,7 @@ void CaptivePortalService::SetStateInChild(int32_t aState) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-CaptivePortalService::GetState(int32_t *aState) {
+CaptivePortalService::GetState(int32_t* aState) {
   *aState = mState;
   return NS_OK;
 }
@@ -251,7 +251,7 @@ CaptivePortalService::RecheckCaptivePortal() {
 }
 
 NS_IMETHODIMP
-CaptivePortalService::GetLastChecked(uint64_t *aLastChecked) {
+CaptivePortalService::GetLastChecked(uint64_t* aLastChecked) {
   double duration = (TimeStamp::Now() - mLastChecked).ToMilliseconds();
   *aLastChecked = static_cast(duration);
   return NS_OK;
@@ -263,7 +263,7 @@ CaptivePortalService::GetLastChecked(uint64_t *aLastChecked) {
 // It issues a checkCaptivePortal operation if one isn't already in progress
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
-CaptivePortalService::Notify(nsITimer *aTimer) {
+CaptivePortalService::Notify(nsITimer* aTimer) {
   LOG(("CaptivePortalService::Notify\n"));
   MOZ_ASSERT(aTimer == mTimer);
   MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
@@ -292,7 +292,7 @@ CaptivePortalService::Notify(nsITimer *aTimer) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-CaptivePortalService::GetName(nsACString &aName) {
+CaptivePortalService::GetName(nsACString& aName) {
   aName.AssignLiteral("CaptivePortalService");
   return NS_OK;
 }
@@ -301,8 +301,8 @@ CaptivePortalService::GetName(nsACString &aName) {
 // CaptivePortalService::nsIObserver
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
-CaptivePortalService::Observe(nsISupports *aSubject, const char *aTopic,
-                              const char16_t *aData) {
+CaptivePortalService::Observe(nsISupports* aSubject, const char* aTopic,
+                              const char16_t* aData) {
   if (XRE_GetProcessType() != GeckoProcessType_Default) {
     // Doesn't do anything if called in the content process.
     return NS_OK;
diff --git a/netwerk/base/Dashboard.cpp b/netwerk/base/Dashboard.cpp
index 78ca0780fc3a6..abfe656bcd882 100644
--- a/netwerk/base/Dashboard.cpp
+++ b/netwerk/base/Dashboard.cpp
@@ -44,13 +44,13 @@ class SocketData : public nsISupports {
   uint64_t mTotalRecv;
   nsTArray mData;
   nsMainThreadPtrHandle mCallback;
-  nsIEventTarget *mEventTarget;
+  nsIEventTarget* mEventTarget;
 
  private:
   virtual ~SocketData() = default;
 };
 
-static void GetErrorString(nsresult rv, nsAString &errorString);
+static void GetErrorString(nsresult rv, nsAString& errorString);
 
 NS_IMPL_ISUPPORTS0(SocketData)
 
@@ -64,7 +64,7 @@ class HttpData : public nsISupports {
 
   nsTArray mData;
   nsMainThreadPtrHandle mCallback;
-  nsIEventTarget *mEventTarget;
+  nsIEventTarget* mEventTarget;
 };
 
 NS_IMPL_ISUPPORTS0(HttpData)
@@ -78,7 +78,7 @@ class WebSocketRequest : public nsISupports {
   WebSocketRequest() { mEventTarget = nullptr; }
 
   nsMainThreadPtrHandle mCallback;
-  nsIEventTarget *mEventTarget;
+  nsIEventTarget* mEventTarget;
 };
 
 NS_IMPL_ISUPPORTS0(WebSocketRequest)
@@ -93,7 +93,7 @@ class DnsData : public nsISupports {
 
   nsTArray mData;
   nsMainThreadPtrHandle mCallback;
-  nsIEventTarget *mEventTarget;
+  nsIEventTarget* mEventTarget;
 };
 
 NS_IMPL_ISUPPORTS0(DnsData)
@@ -112,7 +112,7 @@ class ConnectionData : public nsITransportEventSink,
   NS_DECL_NSITRANSPORTEVENTSINK
   NS_DECL_NSITIMERCALLBACK
 
-  NS_IMETHOD GetName(nsACString &aName) override {
+  NS_IMETHOD GetName(nsACString& aName) override {
     aName.AssignLiteral("net::ConnectionData");
     return NS_OK;
   }
@@ -120,7 +120,7 @@ class ConnectionData : public nsITransportEventSink,
   void StartTimer(uint32_t aTimeout);
   void StopTimer();
 
-  explicit ConnectionData(Dashboard *target)
+  explicit ConnectionData(Dashboard* target)
       : mPort(0), mProtocol(nullptr), mTimeout(0) {
     mEventTarget = nullptr;
     mDashboard = target;
@@ -130,12 +130,12 @@ class ConnectionData : public nsITransportEventSink,
   nsCOMPtr mStreamIn;
   nsCOMPtr mTimer;
   nsMainThreadPtrHandle mCallback;
-  nsIEventTarget *mEventTarget;
-  Dashboard *mDashboard;
+  nsIEventTarget* mEventTarget;
+  Dashboard* mDashboard;
 
   nsCString mHost;
   uint32_t mPort;
-  const char *mProtocol;
+  const char* mProtocol;
   uint32_t mTimeout;
 
   nsString mStatus;
@@ -153,13 +153,13 @@ class RcwnData : public nsISupports {
   RcwnData() { mEventTarget = nullptr; }
 
   nsMainThreadPtrHandle mCallback;
-  nsIEventTarget *mEventTarget;
+  nsIEventTarget* mEventTarget;
 };
 
 NS_IMPL_ISUPPORTS0(RcwnData)
 
 NS_IMETHODIMP
-ConnectionData::OnTransportStatus(nsITransport *aTransport, nsresult aStatus,
+ConnectionData::OnTransportStatus(nsITransport* aTransport, nsresult aStatus,
                                   int64_t aProgress, int64_t aProgressMax) {
   if (aStatus == NS_NET_STATUS_CONNECTED_TO) {
     StopTimer();
@@ -175,7 +175,7 @@ ConnectionData::OnTransportStatus(nsITransport *aTransport, nsresult aStatus,
 }
 
 NS_IMETHODIMP
-ConnectionData::Notify(nsITimer *aTimer) {
+ConnectionData::Notify(nsITimer* aTimer) {
   MOZ_ASSERT(aTimer == mTimer);
 
   if (mSocket) {
@@ -218,7 +218,7 @@ class LookupArgument : public nsISupports {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  LookupArgument(nsIDNSRecord *aRecord, LookupHelper *aHelper) {
+  LookupArgument(nsIDNSRecord* aRecord, LookupHelper* aHelper) {
     mRecord = aRecord;
     mHelper = aHelper;
   }
@@ -242,19 +242,19 @@ class LookupHelper final : public nsIDNSListener {
 
   LookupHelper() : mEventTarget{nullptr}, mStatus{NS_ERROR_NOT_INITIALIZED} {}
 
-  nsresult ConstructAnswer(LookupArgument *aArgument);
+  nsresult ConstructAnswer(LookupArgument* aArgument);
 
  public:
   nsCOMPtr mCancel;
   nsMainThreadPtrHandle mCallback;
-  nsIEventTarget *mEventTarget;
+  nsIEventTarget* mEventTarget;
   nsresult mStatus;
 };
 
 NS_IMPL_ISUPPORTS(LookupHelper, nsIDNSListener)
 
 NS_IMETHODIMP
-LookupHelper::OnLookupComplete(nsICancelable *aRequest, nsIDNSRecord *aRecord,
+LookupHelper::OnLookupComplete(nsICancelable* aRequest, nsIDNSRecord* aRecord,
                                nsresult aStatus) {
   MOZ_ASSERT(aRequest == mCancel);
   mCancel = nullptr;
@@ -270,27 +270,27 @@ LookupHelper::OnLookupComplete(nsICancelable *aRequest, nsIDNSRecord *aRecord,
 }
 
 NS_IMETHODIMP
-LookupHelper::OnLookupByTypeComplete(nsICancelable *aRequest,
-                                     nsIDNSByTypeRecord *aRes,
+LookupHelper::OnLookupByTypeComplete(nsICancelable* aRequest,
+                                     nsIDNSByTypeRecord* aRes,
                                      nsresult aStatus) {
   return NS_OK;
 }
 
-nsresult LookupHelper::ConstructAnswer(LookupArgument *aArgument) {
-  nsIDNSRecord *aRecord = aArgument->mRecord;
+nsresult LookupHelper::ConstructAnswer(LookupArgument* aArgument) {
+  nsIDNSRecord* aRecord = aArgument->mRecord;
   AutoSafeJSContext cx;
 
   mozilla::dom::DNSLookupDict dict;
   dict.mAddress.Construct();
 
-  Sequence &addresses = dict.mAddress.Value();
+  Sequence& addresses = dict.mAddress.Value();
 
   if (NS_SUCCEEDED(mStatus)) {
     dict.mAnswer = true;
     bool hasMore;
     aRecord->HasMore(&hasMore);
     while (hasMore) {
-      nsString *nextAddress = addresses.AppendElement(fallible);
+      nsString* nextAddress = addresses.AppendElement(fallible);
       if (!nextAddress) {
         return NS_ERROR_OUT_OF_MEMORY;
       }
@@ -320,7 +320,7 @@ NS_IMPL_ISUPPORTS(Dashboard, nsIDashboard, nsIDashboardEventNotifier)
 Dashboard::Dashboard() { mEnableLogging = false; }
 
 NS_IMETHODIMP
-Dashboard::RequestSockets(nsINetDashboardCallback *aCallback) {
+Dashboard::RequestSockets(nsINetDashboardCallback* aCallback) {
   RefPtr socketData = new SocketData();
   socketData->mCallback = new nsMainThreadPtrHolder(
       "nsINetDashboardCallback", aCallback, true);
@@ -333,7 +333,7 @@ Dashboard::RequestSockets(nsINetDashboardCallback *aCallback) {
   return NS_OK;
 }
 
-nsresult Dashboard::GetSocketsDispatch(SocketData *aSocketData) {
+nsresult Dashboard::GetSocketsDispatch(SocketData* aSocketData) {
   RefPtr socketData = aSocketData;
   if (gSocketTransportService) {
     gSocketTransportService->GetSocketConnections(&socketData->mData);
@@ -347,7 +347,7 @@ nsresult Dashboard::GetSocketsDispatch(SocketData *aSocketData) {
   return NS_OK;
 }
 
-nsresult Dashboard::GetSockets(SocketData *aSocketData) {
+nsresult Dashboard::GetSockets(SocketData* aSocketData) {
   RefPtr socketData = aSocketData;
   AutoSafeJSContext cx;
 
@@ -356,7 +356,7 @@ nsresult Dashboard::GetSockets(SocketData *aSocketData) {
   dict.mSent = 0;
   dict.mReceived = 0;
 
-  Sequence &sockets = dict.mSockets.Value();
+  Sequence& sockets = dict.mSockets.Value();
 
   uint32_t length = socketData->mData.Length();
   if (!sockets.SetCapacity(length, fallible)) {
@@ -365,7 +365,7 @@ nsresult Dashboard::GetSockets(SocketData *aSocketData) {
   }
 
   for (uint32_t i = 0; i < socketData->mData.Length(); i++) {
-    dom::SocketElement &mSocket = *sockets.AppendElement(fallible);
+    dom::SocketElement& mSocket = *sockets.AppendElement(fallible);
     CopyASCIItoUTF16(socketData->mData[i].host, mSocket.mHost);
     mSocket.mPort = socketData->mData[i].port;
     mSocket.mActive = socketData->mData[i].active;
@@ -386,7 +386,7 @@ nsresult Dashboard::GetSockets(SocketData *aSocketData) {
 }
 
 NS_IMETHODIMP
-Dashboard::RequestHttpConnections(nsINetDashboardCallback *aCallback) {
+Dashboard::RequestHttpConnections(nsINetDashboardCallback* aCallback) {
   RefPtr httpData = new HttpData();
   httpData->mCallback = new nsMainThreadPtrHolder(
       "nsINetDashboardCallback", aCallback, true);
@@ -399,7 +399,7 @@ Dashboard::RequestHttpConnections(nsINetDashboardCallback *aCallback) {
   return NS_OK;
 }
 
-nsresult Dashboard::GetHttpDispatch(HttpData *aHttpData) {
+nsresult Dashboard::GetHttpDispatch(HttpData* aHttpData) {
   RefPtr httpData = aHttpData;
   HttpInfo::GetHttpConnectionData(&httpData->mData);
   httpData->mEventTarget->Dispatch(
@@ -410,7 +410,7 @@ nsresult Dashboard::GetHttpDispatch(HttpData *aHttpData) {
   return NS_OK;
 }
 
-nsresult Dashboard::GetHttpConnections(HttpData *aHttpData) {
+nsresult Dashboard::GetHttpConnections(HttpData* aHttpData) {
   RefPtr httpData = aHttpData;
   AutoSafeJSContext cx;
 
@@ -420,7 +420,7 @@ nsresult Dashboard::GetHttpConnections(HttpData *aHttpData) {
   using mozilla::dom::HalfOpenInfoDict;
   using mozilla::dom::HttpConnectionElement;
   using mozilla::dom::HttpConnInfo;
-  Sequence &connections = dict.mConnections.Value();
+  Sequence& connections = dict.mConnections.Value();
 
   uint32_t length = httpData->mData.Length();
   if (!connections.SetCapacity(length, fallible)) {
@@ -429,7 +429,7 @@ nsresult Dashboard::GetHttpConnections(HttpData *aHttpData) {
   }
 
   for (uint32_t i = 0; i < httpData->mData.Length(); i++) {
-    HttpConnectionElement &connection = *connections.AppendElement(fallible);
+    HttpConnectionElement& connection = *connections.AppendElement(fallible);
 
     CopyASCIItoUTF16(httpData->mData[i].host, connection.mHost);
     connection.mPort = httpData->mData[i].port;
@@ -440,9 +440,9 @@ nsresult Dashboard::GetHttpConnections(HttpData *aHttpData) {
     connection.mIdle.Construct();
     connection.mHalfOpens.Construct();
 
-    Sequence &active = connection.mActive.Value();
-    Sequence &idle = connection.mIdle.Value();
-    Sequence &halfOpens = connection.mHalfOpens.Value();
+    Sequence& active = connection.mActive.Value();
+    Sequence& idle = connection.mIdle.Value();
+    Sequence& halfOpens = connection.mHalfOpens.Value();
 
     if (!active.SetCapacity(httpData->mData[i].active.Length(), fallible) ||
         !idle.SetCapacity(httpData->mData[i].idle.Length(), fallible) ||
@@ -453,21 +453,21 @@ nsresult Dashboard::GetHttpConnections(HttpData *aHttpData) {
     }
 
     for (uint32_t j = 0; j < httpData->mData[i].active.Length(); j++) {
-      HttpConnInfo &info = *active.AppendElement(fallible);
+      HttpConnInfo& info = *active.AppendElement(fallible);
       info.mRtt = httpData->mData[i].active[j].rtt;
       info.mTtl = httpData->mData[i].active[j].ttl;
       info.mProtocolVersion = httpData->mData[i].active[j].protocolVersion;
     }
 
     for (uint32_t j = 0; j < httpData->mData[i].idle.Length(); j++) {
-      HttpConnInfo &info = *idle.AppendElement(fallible);
+      HttpConnInfo& info = *idle.AppendElement(fallible);
       info.mRtt = httpData->mData[i].idle[j].rtt;
       info.mTtl = httpData->mData[i].idle[j].ttl;
       info.mProtocolVersion = httpData->mData[i].idle[j].protocolVersion;
     }
 
     for (uint32_t j = 0; j < httpData->mData[i].halfOpens.Length(); j++) {
-      HalfOpenInfoDict &info = *halfOpens.AppendElement(fallible);
+      HalfOpenInfoDict& info = *halfOpens.AppendElement(fallible);
       info.mSpeculative = httpData->mData[i].halfOpens[j].speculative;
     }
   }
@@ -483,7 +483,7 @@ nsresult Dashboard::GetHttpConnections(HttpData *aHttpData) {
 }
 
 NS_IMETHODIMP
-Dashboard::GetEnableLogging(bool *value) {
+Dashboard::GetEnableLogging(bool* value) {
   *value = mEnableLogging;
   return NS_OK;
 }
@@ -495,7 +495,7 @@ Dashboard::SetEnableLogging(const bool value) {
 }
 
 NS_IMETHODIMP
-Dashboard::AddHost(const nsACString &aHost, uint32_t aSerial, bool aEncrypted) {
+Dashboard::AddHost(const nsACString& aHost, uint32_t aSerial, bool aEncrypted) {
   if (mEnableLogging) {
     mozilla::MutexAutoLock lock(mWs.lock);
     LogData mData(nsCString(aHost), aSerial, aEncrypted);
@@ -511,7 +511,7 @@ Dashboard::AddHost(const nsACString &aHost, uint32_t aSerial, bool aEncrypted) {
 }
 
 NS_IMETHODIMP
-Dashboard::RemoveHost(const nsACString &aHost, uint32_t aSerial) {
+Dashboard::RemoveHost(const nsACString& aHost, uint32_t aSerial) {
   if (mEnableLogging) {
     mozilla::MutexAutoLock lock(mWs.lock);
     int32_t index = mWs.IndexOf(nsCString(aHost), aSerial);
@@ -523,7 +523,7 @@ Dashboard::RemoveHost(const nsACString &aHost, uint32_t aSerial) {
 }
 
 NS_IMETHODIMP
-Dashboard::NewMsgSent(const nsACString &aHost, uint32_t aSerial,
+Dashboard::NewMsgSent(const nsACString& aHost, uint32_t aSerial,
                       uint32_t aLength) {
   if (mEnableLogging) {
     mozilla::MutexAutoLock lock(mWs.lock);
@@ -537,7 +537,7 @@ Dashboard::NewMsgSent(const nsACString &aHost, uint32_t aSerial,
 }
 
 NS_IMETHODIMP
-Dashboard::NewMsgReceived(const nsACString &aHost, uint32_t aSerial,
+Dashboard::NewMsgReceived(const nsACString& aHost, uint32_t aSerial,
                           uint32_t aLength) {
   if (mEnableLogging) {
     mozilla::MutexAutoLock lock(mWs.lock);
@@ -551,7 +551,7 @@ Dashboard::NewMsgReceived(const nsACString &aHost, uint32_t aSerial,
 }
 
 NS_IMETHODIMP
-Dashboard::RequestWebsocketConnections(nsINetDashboardCallback *aCallback) {
+Dashboard::RequestWebsocketConnections(nsINetDashboardCallback* aCallback) {
   RefPtr wsRequest = new WebSocketRequest();
   wsRequest->mCallback = new nsMainThreadPtrHolder(
       "nsINetDashboardCallback", aCallback, true);
@@ -565,13 +565,13 @@ Dashboard::RequestWebsocketConnections(nsINetDashboardCallback *aCallback) {
   return NS_OK;
 }
 
-nsresult Dashboard::GetWebSocketConnections(WebSocketRequest *aWsRequest) {
+nsresult Dashboard::GetWebSocketConnections(WebSocketRequest* aWsRequest) {
   RefPtr wsRequest = aWsRequest;
   AutoSafeJSContext cx;
 
   mozilla::dom::WebSocketDict dict;
   dict.mWebsockets.Construct();
-  Sequence &websockets =
+  Sequence& websockets =
       dict.mWebsockets.Value();
 
   mozilla::MutexAutoLock lock(mWs.lock);
@@ -582,7 +582,7 @@ nsresult Dashboard::GetWebSocketConnections(WebSocketRequest *aWsRequest) {
   }
 
   for (uint32_t i = 0; i < mWs.data.Length(); i++) {
-    dom::WebSocketElement &websocket = *websockets.AppendElement(fallible);
+    dom::WebSocketElement& websocket = *websockets.AppendElement(fallible);
     CopyASCIItoUTF16(mWs.data[i].mHost, websocket.mHostport);
     websocket.mMsgsent = mWs.data[i].mMsgSent;
     websocket.mMsgreceived = mWs.data[i].mMsgReceived;
@@ -601,7 +601,7 @@ nsresult Dashboard::GetWebSocketConnections(WebSocketRequest *aWsRequest) {
 }
 
 NS_IMETHODIMP
-Dashboard::RequestDNSInfo(nsINetDashboardCallback *aCallback) {
+Dashboard::RequestDNSInfo(nsINetDashboardCallback* aCallback) {
   RefPtr dnsData = new DnsData();
   dnsData->mCallback = new nsMainThreadPtrHolder(
       "nsINetDashboardCallback", aCallback, true);
@@ -625,7 +625,7 @@ Dashboard::RequestDNSInfo(nsINetDashboardCallback *aCallback) {
   return NS_OK;
 }
 
-nsresult Dashboard::GetDnsInfoDispatch(DnsData *aDnsData) {
+nsresult Dashboard::GetDnsInfoDispatch(DnsData* aDnsData) {
   RefPtr dnsData = aDnsData;
   if (mDnsService) {
     mDnsService->GetDNSCacheEntries(&dnsData->mData);
@@ -638,12 +638,12 @@ nsresult Dashboard::GetDnsInfoDispatch(DnsData *aDnsData) {
   return NS_OK;
 }
 
-nsresult Dashboard::GetDNSCacheEntries(DnsData *dnsData) {
+nsresult Dashboard::GetDNSCacheEntries(DnsData* dnsData) {
   AutoSafeJSContext cx;
 
   mozilla::dom::DNSCacheDict dict;
   dict.mEntries.Construct();
-  Sequence &entries = dict.mEntries.Value();
+  Sequence& entries = dict.mEntries.Value();
 
   uint32_t length = dnsData->mData.Length();
   if (!entries.SetCapacity(length, fallible)) {
@@ -652,10 +652,10 @@ nsresult Dashboard::GetDNSCacheEntries(DnsData *dnsData) {
   }
 
   for (uint32_t i = 0; i < dnsData->mData.Length(); i++) {
-    dom::DnsCacheEntry &entry = *entries.AppendElement(fallible);
+    dom::DnsCacheEntry& entry = *entries.AppendElement(fallible);
     entry.mHostaddr.Construct();
 
-    Sequence &addrs = entry.mHostaddr.Value();
+    Sequence& addrs = entry.mHostaddr.Value();
     if (!addrs.SetCapacity(dnsData->mData[i].hostaddr.Length(), fallible)) {
       JS_ReportOutOfMemory(cx);
       return NS_ERROR_OUT_OF_MEMORY;
@@ -666,7 +666,7 @@ nsresult Dashboard::GetDNSCacheEntries(DnsData *dnsData) {
     entry.mTrr = dnsData->mData[i].TRR;
 
     for (uint32_t j = 0; j < dnsData->mData[i].hostaddr.Length(); j++) {
-      nsString *addr = addrs.AppendElement(fallible);
+      nsString* addr = addrs.AppendElement(fallible);
       if (!addr) {
         JS_ReportOutOfMemory(cx);
         return NS_ERROR_OUT_OF_MEMORY;
@@ -691,8 +691,8 @@ nsresult Dashboard::GetDNSCacheEntries(DnsData *dnsData) {
 }
 
 NS_IMETHODIMP
-Dashboard::RequestDNSLookup(const nsACString &aHost,
-                            nsINetDashboardCallback *aCallback) {
+Dashboard::RequestDNSLookup(const nsACString& aHost,
+                            nsINetDashboardCallback* aCallback) {
   nsresult rv;
 
   if (!mDnsService) {
@@ -714,7 +714,7 @@ Dashboard::RequestDNSLookup(const nsACString &aHost,
 }
 
 NS_IMETHODIMP
-Dashboard::RequestRcwnStats(nsINetDashboardCallback *aCallback) {
+Dashboard::RequestRcwnStats(nsINetDashboardCallback* aCallback) {
   RefPtr rcwnData = new RcwnData();
   rcwnData->mEventTarget = GetCurrentThreadEventTarget();
   rcwnData->mCallback = new nsMainThreadPtrHolder(
@@ -726,7 +726,7 @@ Dashboard::RequestRcwnStats(nsINetDashboardCallback *aCallback) {
       NS_DISPATCH_NORMAL);
 }
 
-nsresult Dashboard::GetRcwnData(RcwnData *aData) {
+nsresult Dashboard::GetRcwnData(RcwnData* aData) {
   AutoSafeJSContext cx;
   mozilla::dom::RcwnStatus dict;
 
@@ -740,7 +740,7 @@ nsresult Dashboard::GetRcwnData(RcwnData *aData) {
   dict.mCacheNotSlowCount = cacheNotSlow;
 
   dict.mPerfStats.Construct();
-  Sequence &perfStats = dict.mPerfStats.Value();
+  Sequence& perfStats = dict.mPerfStats.Value();
   uint32_t length = CacheFileUtils::CachePerfStats::LAST;
   if (!perfStats.SetCapacity(length, fallible)) {
     JS_ReportOutOfMemory(cx);
@@ -750,7 +750,7 @@ nsresult Dashboard::GetRcwnData(RcwnData *aData) {
   for (uint32_t i = 0; i < length; i++) {
     CacheFileUtils::CachePerfStats::EDataType perfType =
         static_cast(i);
-    dom::RcwnPerfStats &elem = *perfStats.AppendElement(fallible);
+    dom::RcwnPerfStats& elem = *perfStats.AppendElement(fallible);
     elem.mAvgShort =
         CacheFileUtils::CachePerfStats::GetAverage(perfType, false);
     elem.mAvgLong = CacheFileUtils::CachePerfStats::GetAverage(perfType, true);
@@ -793,7 +793,7 @@ void HttpConnInfo::SetHTTP2ProtocolVersion(SpdyVersion pv) {
 }
 
 NS_IMETHODIMP
-Dashboard::GetLogPath(nsACString &aLogPath) {
+Dashboard::GetLogPath(nsACString& aLogPath) {
   aLogPath.SetLength(2048);
   uint32_t len = LogModule::GetLogFile(aLogPath.BeginWriting(), 2048);
   aLogPath.SetLength(len);
@@ -801,9 +801,9 @@ Dashboard::GetLogPath(nsACString &aLogPath) {
 }
 
 NS_IMETHODIMP
-Dashboard::RequestConnection(const nsACString &aHost, uint32_t aPort,
-                             const char *aProtocol, uint32_t aTimeout,
-                             nsINetDashboardCallback *aCallback) {
+Dashboard::RequestConnection(const nsACString& aHost, uint32_t aPort,
+                             const char* aProtocol, uint32_t aTimeout,
+                             nsINetDashboardCallback* aCallback) {
   nsresult rv;
   RefPtr connectionData = new ConnectionData(this);
   connectionData->mHost = aHost;
@@ -830,7 +830,7 @@ Dashboard::RequestConnection(const nsACString &aHost, uint32_t aPort,
   return NS_OK;
 }
 
-nsresult Dashboard::GetConnectionStatus(ConnectionData *aConnectionData) {
+nsresult Dashboard::GetConnectionStatus(ConnectionData* aConnectionData) {
   RefPtr connectionData = aConnectionData;
   AutoSafeJSContext cx;
 
@@ -845,7 +845,7 @@ nsresult Dashboard::GetConnectionStatus(ConnectionData *aConnectionData) {
   return NS_OK;
 }
 
-nsresult Dashboard::TestNewConnection(ConnectionData *aConnectionData) {
+nsresult Dashboard::TestNewConnection(ConnectionData* aConnectionData) {
   RefPtr connectionData = aConnectionData;
 
   nsresult rv;
@@ -889,7 +889,7 @@ nsresult Dashboard::TestNewConnection(ConnectionData *aConnectionData) {
 
 typedef struct {
   nsresult key;
-  const char *error;
+  const char* error;
 } ErrorEntry;
 
 #undef ERROR
@@ -909,8 +909,8 @@ ErrorEntry socketTransportStatuses[] = {
 };
 #undef ERROR
 
-static void GetErrorString(nsresult rv, nsAString &errorString) {
-  for (auto &socketTransportStatus : socketTransportStatuses) {
+static void GetErrorString(nsresult rv, nsAString& errorString) {
+  for (auto& socketTransportStatus : socketTransportStatuses) {
     if (socketTransportStatus.key == rv) {
       errorString.AssignASCII(socketTransportStatus.error);
       return;
diff --git a/netwerk/base/Dashboard.h b/netwerk/base/Dashboard.h
index f3d7799b0d456..d0f47896457e4 100644
--- a/netwerk/base/Dashboard.h
+++ b/netwerk/base/Dashboard.h
@@ -33,8 +33,8 @@ class Dashboard final : public nsIDashboard, public nsIDashboardEventNotifier {
   NS_DECL_NSIDASHBOARDEVENTNOTIFIER
 
   Dashboard();
-  static const char *GetErrorString(nsresult rv);
-  nsresult GetConnectionStatus(ConnectionData *aConnectionData);
+  static const char* GetErrorString(nsresult rv);
+  nsresult GetConnectionStatus(ConnectionData* aConnectionData);
 
  private:
   struct LogData {
@@ -53,14 +53,14 @@ class Dashboard final : public nsIDashboard, public nsIDashboardEventNotifier {
     uint64_t mSizeSent;
     uint64_t mSizeReceived;
     bool mEncrypted;
-    bool operator==(const LogData &a) const {
+    bool operator==(const LogData& a) const {
       return mHost.Equals(a.mHost) && (mSerial == a.mSerial);
     }
   };
 
   struct WebSocketData {
     WebSocketData() : lock("Dashboard.webSocketData") {}
-    uint32_t IndexOf(const nsCString &hostname, uint32_t mSerial) {
+    uint32_t IndexOf(const nsCString& hostname, uint32_t mSerial) {
       LogData temp(hostname, mSerial, false);
       return data.IndexOf(temp);
     }
@@ -74,17 +74,17 @@ class Dashboard final : public nsIDashboard, public nsIDashboardEventNotifier {
  private:
   virtual ~Dashboard() = default;
 
-  nsresult GetSocketsDispatch(SocketData *);
-  nsresult GetHttpDispatch(HttpData *);
-  nsresult GetDnsInfoDispatch(DnsData *);
-  nsresult TestNewConnection(ConnectionData *);
+  nsresult GetSocketsDispatch(SocketData*);
+  nsresult GetHttpDispatch(HttpData*);
+  nsresult GetDnsInfoDispatch(DnsData*);
+  nsresult TestNewConnection(ConnectionData*);
 
   /* Helper methods that pass the JSON to the callback function. */
-  nsresult GetSockets(SocketData *);
-  nsresult GetHttpConnections(HttpData *);
-  nsresult GetDNSCacheEntries(DnsData *);
-  nsresult GetWebSocketConnections(WebSocketRequest *);
-  nsresult GetRcwnData(RcwnData *);
+  nsresult GetSockets(SocketData*);
+  nsresult GetHttpConnections(HttpData*);
+  nsresult GetDNSCacheEntries(DnsData*);
+  nsresult GetWebSocketConnections(WebSocketRequest*);
+  nsresult GetRcwnData(RcwnData*);
 
   nsCOMPtr mDnsService;
 };
diff --git a/netwerk/base/EventTokenBucket.cpp b/netwerk/base/EventTokenBucket.cpp
index d88c5ab73e77e..64ba316840780 100644
--- a/netwerk/base/EventTokenBucket.cpp
+++ b/netwerk/base/EventTokenBucket.cpp
@@ -33,19 +33,19 @@ class TokenBucketCancelable : public nsICancelable {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICANCELABLE
 
-  explicit TokenBucketCancelable(class ATokenBucketEvent *event);
+  explicit TokenBucketCancelable(class ATokenBucketEvent* event);
   void Fire();
 
  private:
   virtual ~TokenBucketCancelable() = default;
 
   friend class EventTokenBucket;
-  ATokenBucketEvent *mEvent;
+  ATokenBucketEvent* mEvent;
 };
 
 NS_IMPL_ISUPPORTS(TokenBucketCancelable, nsICancelable)
 
-TokenBucketCancelable::TokenBucketCancelable(ATokenBucketEvent *event)
+TokenBucketCancelable::TokenBucketCancelable(ATokenBucketEvent* event)
     : mEvent(event) {}
 
 NS_IMETHODIMP
@@ -58,7 +58,7 @@ TokenBucketCancelable::Cancel(nsresult reason) {
 void TokenBucketCancelable::Fire() {
   if (!mEvent) return;
 
-  ATokenBucketEvent *event = mEvent;
+  ATokenBucketEvent* event = mEvent;
   mEvent = nullptr;
   event->OnTokenBucketAdmitted();
 }
@@ -105,7 +105,7 @@ EventTokenBucket::~EventTokenBucket() {
   // Complete any queued events to prevent hangs
   while (mEvents.GetSize()) {
     RefPtr cancelable =
-        dont_AddRef(static_cast(mEvents.PopFront()));
+        dont_AddRef(static_cast(mEvents.PopFront()));
     cancelable->Fire();
   }
 }
@@ -198,13 +198,13 @@ void EventTokenBucket::Stop() {
   // Complete any queued events to prevent hangs
   while (mEvents.GetSize()) {
     RefPtr cancelable =
-        dont_AddRef(static_cast(mEvents.PopFront()));
+        dont_AddRef(static_cast(mEvents.PopFront()));
     cancelable->Fire();
   }
 }
 
-nsresult EventTokenBucket::SubmitEvent(ATokenBucketEvent *event,
-                                       nsICancelable **cancelable) {
+nsresult EventTokenBucket::SubmitEvent(ATokenBucketEvent* event,
+                                       nsICancelable** cancelable) {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
   SOCKET_LOG(("EventTokenBucket::SubmitEvent %p\n", this));
 
@@ -230,7 +230,7 @@ nsresult EventTokenBucket::SubmitEvent(ATokenBucketEvent *event,
   return NS_OK;
 }
 
-bool EventTokenBucket::TryImmediateDispatch(TokenBucketCancelable *cancelable) {
+bool EventTokenBucket::TryImmediateDispatch(TokenBucketCancelable* cancelable) {
   if (mCredit < mUnitCost) return false;
 
   mCredit -= mUnitCost;
@@ -245,7 +245,7 @@ void EventTokenBucket::DispatchEvents() {
 
   while (mEvents.GetSize() && mUnitCost <= mCredit) {
     RefPtr cancelable =
-        dont_AddRef(static_cast(mEvents.PopFront()));
+        dont_AddRef(static_cast(mEvents.PopFront()));
     if (cancelable->mEvent) {
       SOCKET_LOG(
           ("EventTokenBucket::DispachEvents [%p] "
@@ -293,7 +293,7 @@ void EventTokenBucket::UpdateTimer() {
 }
 
 NS_IMETHODIMP
-EventTokenBucket::Notify(nsITimer *timer) {
+EventTokenBucket::Notify(nsITimer* timer) {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
 #ifdef XP_WIN
@@ -315,7 +315,7 @@ EventTokenBucket::Notify(nsITimer *timer) {
 }
 
 NS_IMETHODIMP
-EventTokenBucket::GetName(nsACString &aName) {
+EventTokenBucket::GetName(nsACString& aName) {
   aName.AssignLiteral("EventTokenBucket");
   return NS_OK;
 }
diff --git a/netwerk/base/EventTokenBucket.h b/netwerk/base/EventTokenBucket.h
index a356c4b46fa93..a716e739e3f80 100644
--- a/netwerk/base/EventTokenBucket.h
+++ b/netwerk/base/EventTokenBucket.h
@@ -94,7 +94,7 @@ class EventTokenBucket : public nsITimerCallback,
   void Stop();
 
   // The returned cancelable event can only be canceled from the socket thread
-  nsresult SubmitEvent(ATokenBucketEvent *event, nsICancelable **cancelable);
+  nsresult SubmitEvent(ATokenBucketEvent* event, nsICancelable** cancelable);
 
  private:
   virtual ~EventTokenBucket();
@@ -103,7 +103,7 @@ class EventTokenBucket : public nsITimerCallback,
   friend class RunNotifyEvent;
   friend class SetTimerEvent;
 
-  bool TryImmediateDispatch(TokenBucketCancelable *event);
+  bool TryImmediateDispatch(TokenBucketCancelable* event);
   void SetRate(uint32_t eventsPerSecond, uint32_t burstSize);
 
   void DispatchEvents();
diff --git a/netwerk/base/FuzzyLayer.cpp b/netwerk/base/FuzzyLayer.cpp
index 979b1911dccaf..b4374f1cc908f 100644
--- a/netwerk/base/FuzzyLayer.cpp
+++ b/netwerk/base/FuzzyLayer.cpp
@@ -18,7 +18,7 @@ LazyLogModule gFuzzingLog("nsFuzzingNecko");
   MOZ_LOG(mozilla::net::gFuzzingLog, mozilla::LogLevel::Verbose, args)
 
 // These will be set by setNetworkFuzzingBuffer below
-static Atomic gFuzzingBuf(NULL);
+static Atomic gFuzzingBuf(NULL);
 static Atomic gFuzzingSize(0);
 
 /*
@@ -39,7 +39,7 @@ Atomic gFuzzingConnClosed(true);
 Atomic gFuzzingAllowNewConn(false);
 Atomic gFuzzingAllowRead(false);
 
-void setNetworkFuzzingBuffer(const uint8_t *data, size_t size) {
+void setNetworkFuzzingBuffer(const uint8_t* data, size_t size) {
   if (size > INT32_MAX) {
     MOZ_CRASH("Unsupported buffer size");
   }
@@ -51,10 +51,10 @@ void setNetworkFuzzingBuffer(const uint8_t *data, size_t size) {
 
 static PRDescIdentity sFuzzyLayerIdentity;
 static PRIOMethods sFuzzyLayerMethods;
-static PRIOMethods *sFuzzyLayerMethodsPtr = nullptr;
+static PRIOMethods* sFuzzyLayerMethodsPtr = nullptr;
 
-static PRInt16 PR_CALLBACK FuzzyPoll(PRFileDesc *fd, PRInt16 in_flags,
-                                     PRInt16 *out_flags) {
+static PRInt16 PR_CALLBACK FuzzyPoll(PRFileDesc* fd, PRInt16 in_flags,
+                                     PRInt16* out_flags) {
   *out_flags = 0;
 
   if (in_flags & PR_POLL_READ && gFuzzingAllowRead) {
@@ -70,7 +70,7 @@ static PRInt16 PR_CALLBACK FuzzyPoll(PRFileDesc *fd, PRInt16 in_flags,
   return in_flags;
 }
 
-static PRStatus FuzzyConnect(PRFileDesc *fd, const PRNetAddr *addr,
+static PRStatus FuzzyConnect(PRFileDesc* fd, const PRNetAddr* addr,
                              PRIntervalTime timeout) {
   MOZ_RELEASE_ASSERT(fd->identity == sFuzzyLayerIdentity);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
@@ -88,7 +88,7 @@ static PRStatus FuzzyConnect(PRFileDesc *fd, const PRNetAddr *addr,
   return PR_SUCCESS;
 }
 
-static PRInt32 FuzzySend(PRFileDesc *fd, const void *buf, PRInt32 amount,
+static PRInt32 FuzzySend(PRFileDesc* fd, const void* buf, PRInt32 amount,
                          PRIntn flags, PRIntervalTime timeout) {
   MOZ_RELEASE_ASSERT(fd->identity == sFuzzyLayerIdentity);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
@@ -102,11 +102,11 @@ static PRInt32 FuzzySend(PRFileDesc *fd, const void *buf, PRInt32 amount,
   return amount;
 }
 
-static PRInt32 FuzzyWrite(PRFileDesc *fd, const void *buf, PRInt32 amount) {
+static PRInt32 FuzzyWrite(PRFileDesc* fd, const void* buf, PRInt32 amount) {
   return FuzzySend(fd, buf, amount, 0, PR_INTERVAL_NO_WAIT);
 }
 
-static PRInt32 FuzzyRecv(PRFileDesc *fd, void *buf, PRInt32 amount,
+static PRInt32 FuzzyRecv(PRFileDesc* fd, void* buf, PRInt32 amount,
                          PRIntn flags, PRIntervalTime timeout) {
   MOZ_RELEASE_ASSERT(fd->identity == sFuzzyLayerIdentity);
 
@@ -134,15 +134,15 @@ static PRInt32 FuzzyRecv(PRFileDesc *fd, void *buf, PRInt32 amount,
   return amount;
 }
 
-static PRInt32 FuzzyRead(PRFileDesc *fd, void *buf, PRInt32 amount) {
+static PRInt32 FuzzyRead(PRFileDesc* fd, void* buf, PRInt32 amount) {
   return FuzzyRecv(fd, buf, amount, 0, PR_INTERVAL_NO_WAIT);
 }
 
-static PRStatus FuzzyClose(PRFileDesc *fd) {
+static PRStatus FuzzyClose(PRFileDesc* fd) {
   if (!fd) {
     return PR_FAILURE;
   }
-  PRFileDesc *layer = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
+  PRFileDesc* layer = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
   MOZ_RELEASE_ASSERT(layer && layer->identity == sFuzzyLayerIdentity,
                      "Fuzzy Layer not on top of stack");
 
@@ -162,7 +162,7 @@ static PRStatus FuzzyClose(PRFileDesc *fd) {
   return ret;
 }
 
-nsresult AttachFuzzyIOLayer(PRFileDesc *fd) {
+nsresult AttachFuzzyIOLayer(PRFileDesc* fd) {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
   if (!sFuzzyLayerMethodsPtr) {
@@ -178,7 +178,7 @@ nsresult AttachFuzzyIOLayer(PRFileDesc *fd) {
     sFuzzyLayerMethodsPtr = &sFuzzyLayerMethods;
   }
 
-  PRFileDesc *layer =
+  PRFileDesc* layer =
       PR_CreateIOLayerStub(sFuzzyLayerIdentity, sFuzzyLayerMethodsPtr);
 
   if (!layer) {
diff --git a/netwerk/base/FuzzyLayer.h b/netwerk/base/FuzzyLayer.h
index 79b3f00dcdf80..605972621f823 100644
--- a/netwerk/base/FuzzyLayer.h
+++ b/netwerk/base/FuzzyLayer.h
@@ -12,7 +12,7 @@
 namespace mozilla {
 namespace net {
 
-nsresult AttachFuzzyIOLayer(PRFileDesc *fd);
+nsresult AttachFuzzyIOLayer(PRFileDesc* fd);
 
 }  // namespace net
 }  // namespace mozilla
diff --git a/netwerk/base/IOActivityMonitor.cpp b/netwerk/base/IOActivityMonitor.cpp
index fc86a3dbb1fca..7c28d4a8e0149 100644
--- a/netwerk/base/IOActivityMonitor.cpp
+++ b/netwerk/base/IOActivityMonitor.cpp
@@ -22,7 +22,7 @@ using namespace mozilla::net;
 mozilla::StaticRefPtr gInstance;
 static PRDescIdentity sNetActivityMonitorLayerIdentity;
 static PRIOMethods sNetActivityMonitorLayerMethods;
-static PRIOMethods *sNetActivityMonitorLayerMethodsPtr = nullptr;
+static PRIOMethods* sNetActivityMonitorLayerMethodsPtr = nullptr;
 
 // Maximum number of activities entries in the monitoring class
 #define MAX_ACTIVITY_ENTRIES 1000
@@ -38,13 +38,13 @@ static PRIOMethods *sNetActivityMonitorLayerMethodsPtr = nullptr;
 class ActivityMonitorSecret final {
  public:
   // constructor used for sockets
-  explicit ActivityMonitorSecret(PRFileDesc *aFd) {
+  explicit ActivityMonitorSecret(PRFileDesc* aFd) {
     mFd = aFd;
     mLocationSet = false;
   }
 
   // constructor used for files
-  explicit ActivityMonitorSecret(PRFileDesc *aFd, const char *aLocation) {
+  explicit ActivityMonitorSecret(PRFileDesc* aFd, const char* aLocation) {
     mFd = aFd;
     mLocation.AppendPrintf("file://%s", aLocation);
     mLocationSet = true;
@@ -66,7 +66,7 @@ class ActivityMonitorSecret final {
   // constructor.
   void LazySetLocation() {
     mLocationSet = true;
-    PRFileDesc *extract = mFd;
+    PRFileDesc* extract = mFd;
     while (PR_GetDescType(extract) == PR_DESC_LAYERED) {
       if (!extract->lower) {
         break;
@@ -118,21 +118,21 @@ class ActivityMonitorSecret final {
  private:
   nsCString mLocation;
   bool mLocationSet;
-  PRFileDesc *mFd;
+  PRFileDesc* mFd;
 };
 
 // FileDesc2Location converts a PRFileDesc into a "location" by
 // grabbing the ActivityMonitorSecret in layer->secret
-static nsAutoCString FileDesc2Location(PRFileDesc *fd) {
+static nsAutoCString FileDesc2Location(PRFileDesc* fd) {
   nsAutoCString location;
-  PRFileDesc *monitorLayer =
+  PRFileDesc* monitorLayer =
       PR_GetIdentitiesLayer(fd, sNetActivityMonitorLayerIdentity);
   if (!monitorLayer) {
     location.AppendPrintf("unknown");
     return location;
   }
 
-  ActivityMonitorSecret *secret = (ActivityMonitorSecret *)monitorLayer->secret;
+  ActivityMonitorSecret* secret = (ActivityMonitorSecret*)monitorLayer->secret;
   location.AppendPrintf("%s", secret->getLocation().get());
   return location;
 }
@@ -140,29 +140,29 @@ static nsAutoCString FileDesc2Location(PRFileDesc *fd) {
 //
 // Wrappers around the socket APIS
 //
-static PRStatus nsNetMon_Connect(PRFileDesc *fd, const PRNetAddr *addr,
+static PRStatus nsNetMon_Connect(PRFileDesc* fd, const PRNetAddr* addr,
                                  PRIntervalTime timeout) {
   return fd->lower->methods->connect(fd->lower, addr, timeout);
 }
 
-static PRStatus nsNetMon_Close(PRFileDesc *fd) {
+static PRStatus nsNetMon_Close(PRFileDesc* fd) {
   if (!fd) {
     return PR_FAILURE;
   }
-  PRFileDesc *layer = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
+  PRFileDesc* layer = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
   MOZ_RELEASE_ASSERT(
       layer && layer->identity == sNetActivityMonitorLayerIdentity,
       "NetActivityMonitor Layer not on top of stack");
 
   if (layer->secret) {
-    delete (ActivityMonitorSecret *)layer->secret;
+    delete (ActivityMonitorSecret*)layer->secret;
     layer->secret = nullptr;
   }
   layer->dtor(layer);
   return fd->methods->close(fd);
 }
 
-static int32_t nsNetMon_Read(PRFileDesc *fd, void *buf, int32_t len) {
+static int32_t nsNetMon_Read(PRFileDesc* fd, void* buf, int32_t len) {
   int32_t ret = fd->lower->methods->read(fd->lower, buf, len);
   if (ret >= 0) {
     IOActivityMonitor::Read(fd, len);
@@ -170,7 +170,7 @@ static int32_t nsNetMon_Read(PRFileDesc *fd, void *buf, int32_t len) {
   return ret;
 }
 
-static int32_t nsNetMon_Write(PRFileDesc *fd, const void *buf, int32_t len) {
+static int32_t nsNetMon_Write(PRFileDesc* fd, const void* buf, int32_t len) {
   int32_t ret = fd->lower->methods->write(fd->lower, buf, len);
   if (ret > 0) {
     IOActivityMonitor::Write(fd, len);
@@ -178,7 +178,7 @@ static int32_t nsNetMon_Write(PRFileDesc *fd, const void *buf, int32_t len) {
   return ret;
 }
 
-static int32_t nsNetMon_Writev(PRFileDesc *fd, const PRIOVec *iov, int32_t size,
+static int32_t nsNetMon_Writev(PRFileDesc* fd, const PRIOVec* iov, int32_t size,
                                PRIntervalTime timeout) {
   int32_t ret = fd->lower->methods->writev(fd->lower, iov, size, timeout);
   if (ret > 0) {
@@ -187,7 +187,7 @@ static int32_t nsNetMon_Writev(PRFileDesc *fd, const PRIOVec *iov, int32_t size,
   return ret;
 }
 
-static int32_t nsNetMon_Recv(PRFileDesc *fd, void *buf, int32_t amount,
+static int32_t nsNetMon_Recv(PRFileDesc* fd, void* buf, int32_t amount,
                              int flags, PRIntervalTime timeout) {
   int32_t ret =
       fd->lower->methods->recv(fd->lower, buf, amount, flags, timeout);
@@ -197,7 +197,7 @@ static int32_t nsNetMon_Recv(PRFileDesc *fd, void *buf, int32_t amount,
   return ret;
 }
 
-static int32_t nsNetMon_Send(PRFileDesc *fd, const void *buf, int32_t amount,
+static int32_t nsNetMon_Send(PRFileDesc* fd, const void* buf, int32_t amount,
                              int flags, PRIntervalTime timeout) {
   int32_t ret =
       fd->lower->methods->send(fd->lower, buf, amount, flags, timeout);
@@ -207,8 +207,8 @@ static int32_t nsNetMon_Send(PRFileDesc *fd, const void *buf, int32_t amount,
   return ret;
 }
 
-static int32_t nsNetMon_RecvFrom(PRFileDesc *fd, void *buf, int32_t amount,
-                                 int flags, PRNetAddr *addr,
+static int32_t nsNetMon_RecvFrom(PRFileDesc* fd, void* buf, int32_t amount,
+                                 int flags, PRNetAddr* addr,
                                  PRIntervalTime timeout) {
   int32_t ret = fd->lower->methods->recvfrom(fd->lower, buf, amount, flags,
                                              addr, timeout);
@@ -218,8 +218,8 @@ static int32_t nsNetMon_RecvFrom(PRFileDesc *fd, void *buf, int32_t amount,
   return ret;
 }
 
-static int32_t nsNetMon_SendTo(PRFileDesc *fd, const void *buf, int32_t amount,
-                               int flags, const PRNetAddr *addr,
+static int32_t nsNetMon_SendTo(PRFileDesc* fd, const void* buf, int32_t amount,
+                               int flags, const PRNetAddr* addr,
                                PRIntervalTime timeout) {
   int32_t ret =
       fd->lower->methods->sendto(fd->lower, buf, amount, flags, addr, timeout);
@@ -229,9 +229,9 @@ static int32_t nsNetMon_SendTo(PRFileDesc *fd, const void *buf, int32_t amount,
   return ret;
 }
 
-static int32_t nsNetMon_AcceptRead(PRFileDesc *listenSock,
-                                   PRFileDesc **acceptedSock,
-                                   PRNetAddr **peerAddr, void *buf,
+static int32_t nsNetMon_AcceptRead(PRFileDesc* listenSock,
+                                   PRFileDesc** acceptedSock,
+                                   PRNetAddr** peerAddr, void* buf,
                                    int32_t amount, PRIntervalTime timeout) {
   int32_t ret = listenSock->lower->methods->acceptread(
       listenSock->lower, acceptedSock, peerAddr, buf, amount, timeout);
@@ -252,7 +252,7 @@ IOActivityMonitor::IOActivityMonitor() : mLock("IOActivityMonitor::mLock") {
 }
 
 // static
-void IOActivityMonitor::RequestActivities(dom::Promise *aPromise) {
+void IOActivityMonitor::RequestActivities(dom::Promise* aPromise) {
   MOZ_ASSERT(aPromise);
   RefPtr mon(gInstance);
   if (!IsActive()) {
@@ -262,7 +262,7 @@ void IOActivityMonitor::RequestActivities(dom::Promise *aPromise) {
   mon->RequestActivitiesInternal(aPromise);
 }
 
-void IOActivityMonitor::RequestActivitiesInternal(dom::Promise *aPromise) {
+void IOActivityMonitor::RequestActivitiesInternal(dom::Promise* aPromise) {
   nsresult result = NS_OK;
   FallibleTArray activities;
 
@@ -270,7 +270,7 @@ void IOActivityMonitor::RequestActivitiesInternal(dom::Promise *aPromise) {
     mozilla::MutexAutoLock lock(mLock);
     // Remove inactive activities
     for (auto iter = mActivities.Iter(); !iter.Done(); iter.Next()) {
-      dom::IOActivityDataDictionary *activity = &iter.Data();
+      dom::IOActivityDataDictionary* activity = &iter.Data();
       if (activity->mRx == 0 && activity->mTx == 0) {
         iter.Remove();
       } else {
@@ -291,7 +291,7 @@ void IOActivityMonitor::RequestActivitiesInternal(dom::Promise *aPromise) {
 
 // static
 NS_IMETHODIMP
-IOActivityMonitor::GetName(nsACString &aName) {
+IOActivityMonitor::GetName(nsACString& aName) {
   aName.AssignLiteral("IOActivityMonitor");
   return NS_OK;
 }
@@ -347,12 +347,12 @@ nsresult IOActivityMonitor::ShutdownInternal() {
   return NS_OK;
 }
 
-nsresult IOActivityMonitor::MonitorSocket(PRFileDesc *aFd) {
+nsresult IOActivityMonitor::MonitorSocket(PRFileDesc* aFd) {
   RefPtr mon(gInstance);
   if (!IsActive()) {
     return NS_OK;
   }
-  PRFileDesc *layer;
+  PRFileDesc* layer;
   PRStatus status;
   layer = PR_CreateIOLayerStub(sNetActivityMonitorLayerIdentity,
                                sNetActivityMonitorLayerMethodsPtr);
@@ -360,8 +360,8 @@ nsresult IOActivityMonitor::MonitorSocket(PRFileDesc *aFd) {
     return NS_ERROR_FAILURE;
   }
 
-  ActivityMonitorSecret *secret = new ActivityMonitorSecret(aFd);
-  layer->secret = reinterpret_cast(secret);
+  ActivityMonitorSecret* secret = new ActivityMonitorSecret(aFd);
+  layer->secret = reinterpret_cast(secret);
   status = PR_PushIOLayer(aFd, PR_NSPR_IO_LAYER, layer);
 
   if (status == PR_FAILURE) {
@@ -372,12 +372,12 @@ nsresult IOActivityMonitor::MonitorSocket(PRFileDesc *aFd) {
   return NS_OK;
 }
 
-nsresult IOActivityMonitor::MonitorFile(PRFileDesc *aFd, const char *aPath) {
+nsresult IOActivityMonitor::MonitorFile(PRFileDesc* aFd, const char* aPath) {
   RefPtr mon(gInstance);
   if (!IsActive()) {
     return NS_OK;
   }
-  PRFileDesc *layer;
+  PRFileDesc* layer;
   PRStatus status;
   layer = PR_CreateIOLayerStub(sNetActivityMonitorLayerIdentity,
                                sNetActivityMonitorLayerMethodsPtr);
@@ -385,8 +385,8 @@ nsresult IOActivityMonitor::MonitorFile(PRFileDesc *aFd, const char *aPath) {
     return NS_ERROR_FAILURE;
   }
 
-  ActivityMonitorSecret *secret = new ActivityMonitorSecret(aFd, aPath);
-  layer->secret = reinterpret_cast(secret);
+  ActivityMonitorSecret* secret = new ActivityMonitorSecret(aFd, aPath);
+  layer->secret = reinterpret_cast(secret);
 
   status = PR_PushIOLayer(aFd, PR_NSPR_IO_LAYER, layer);
   if (status == PR_FAILURE) {
@@ -398,7 +398,7 @@ nsresult IOActivityMonitor::MonitorFile(PRFileDesc *aFd, const char *aPath) {
   return NS_OK;
 }
 
-bool IOActivityMonitor::IncrementActivity(const nsACString &aLocation,
+bool IOActivityMonitor::IncrementActivity(const nsACString& aLocation,
                                           uint32_t aRx, uint32_t aTx) {
   mLock.AssertCurrentThreadOwns();
   if (auto entry = mActivities.Lookup(aLocation)) {
@@ -424,7 +424,7 @@ bool IOActivityMonitor::IncrementActivity(const nsACString &aLocation,
   return true;
 }
 
-nsresult IOActivityMonitor::Write(const nsACString &aLocation,
+nsresult IOActivityMonitor::Write(const nsACString& aLocation,
                                   uint32_t aAmount) {
   RefPtr mon(gInstance);
   if (!mon) {
@@ -433,7 +433,7 @@ nsresult IOActivityMonitor::Write(const nsACString &aLocation,
   return mon->WriteInternal(aLocation, aAmount);
 }
 
-nsresult IOActivityMonitor::Write(PRFileDesc *fd, uint32_t aAmount) {
+nsresult IOActivityMonitor::Write(PRFileDesc* fd, uint32_t aAmount) {
   RefPtr mon(gInstance);
   if (!mon) {
     return NS_ERROR_FAILURE;
@@ -441,7 +441,7 @@ nsresult IOActivityMonitor::Write(PRFileDesc *fd, uint32_t aAmount) {
   return mon->Write(FileDesc2Location(fd), aAmount);
 }
 
-nsresult IOActivityMonitor::WriteInternal(const nsACString &aLocation,
+nsresult IOActivityMonitor::WriteInternal(const nsACString& aLocation,
                                           uint32_t aAmount) {
   mozilla::MutexAutoLock lock(mLock);
   if (!IncrementActivity(aLocation, aAmount, 0)) {
@@ -450,7 +450,7 @@ nsresult IOActivityMonitor::WriteInternal(const nsACString &aLocation,
   return NS_OK;
 }
 
-nsresult IOActivityMonitor::Read(PRFileDesc *fd, uint32_t aAmount) {
+nsresult IOActivityMonitor::Read(PRFileDesc* fd, uint32_t aAmount) {
   RefPtr mon(gInstance);
   if (!mon) {
     return NS_ERROR_FAILURE;
@@ -458,7 +458,7 @@ nsresult IOActivityMonitor::Read(PRFileDesc *fd, uint32_t aAmount) {
   return mon->Read(FileDesc2Location(fd), aAmount);
 }
 
-nsresult IOActivityMonitor::Read(const nsACString &aLocation,
+nsresult IOActivityMonitor::Read(const nsACString& aLocation,
                                  uint32_t aAmount) {
   RefPtr mon(gInstance);
   if (!mon) {
@@ -467,7 +467,7 @@ nsresult IOActivityMonitor::Read(const nsACString &aLocation,
   return mon->ReadInternal(aLocation, aAmount);
 }
 
-nsresult IOActivityMonitor::ReadInternal(const nsACString &aLocation,
+nsresult IOActivityMonitor::ReadInternal(const nsACString& aLocation,
                                          uint32_t aAmount) {
   mozilla::MutexAutoLock lock(mLock);
   if (!IncrementActivity(aLocation, 0, aAmount)) {
diff --git a/netwerk/base/LoadContextInfo.cpp b/netwerk/base/LoadContextInfo.cpp
index a96734b89dd2b..9410f2d8d8080 100644
--- a/netwerk/base/LoadContextInfo.cpp
+++ b/netwerk/base/LoadContextInfo.cpp
@@ -24,22 +24,22 @@ LoadContextInfo::LoadContextInfo(bool aIsAnonymous,
     : mIsAnonymous(aIsAnonymous),
       mOriginAttributes(std::move(aOriginAttributes)) {}
 
-NS_IMETHODIMP LoadContextInfo::GetIsPrivate(bool *aIsPrivate) {
+NS_IMETHODIMP LoadContextInfo::GetIsPrivate(bool* aIsPrivate) {
   *aIsPrivate = mOriginAttributes.mPrivateBrowsingId > 0;
   return NS_OK;
 }
 
-NS_IMETHODIMP LoadContextInfo::GetIsAnonymous(bool *aIsAnonymous) {
+NS_IMETHODIMP LoadContextInfo::GetIsAnonymous(bool* aIsAnonymous) {
   *aIsAnonymous = mIsAnonymous;
   return NS_OK;
 }
 
-OriginAttributes const *LoadContextInfo::OriginAttributesPtr() {
+OriginAttributes const* LoadContextInfo::OriginAttributesPtr() {
   return &mOriginAttributes;
 }
 
 NS_IMETHODIMP LoadContextInfo::GetOriginAttributes(
-    JSContext *aCx, JS::MutableHandle aVal) {
+    JSContext* aCx, JS::MutableHandle aVal) {
   if (NS_WARN_IF(!ToJSValue(aCx, mOriginAttributes, aVal))) {
     return NS_ERROR_FAILURE;
   }
@@ -51,7 +51,7 @@ NS_IMETHODIMP LoadContextInfo::GetOriginAttributes(
 NS_IMPL_ISUPPORTS(LoadContextInfoFactory, nsILoadContextInfoFactory)
 
 NS_IMETHODIMP LoadContextInfoFactory::GetDefault(
-    nsILoadContextInfo **aDefault) {
+    nsILoadContextInfo** aDefault) {
   nsCOMPtr info =
       GetLoadContextInfo(false, OriginAttributes());
   info.forget(aDefault);
@@ -59,7 +59,7 @@ NS_IMETHODIMP LoadContextInfoFactory::GetDefault(
 }
 
 NS_IMETHODIMP LoadContextInfoFactory::GetPrivate(
-    nsILoadContextInfo **aPrivate) {
+    nsILoadContextInfo** aPrivate) {
   OriginAttributes attrs;
   attrs.SyncAttributesWithPrivateBrowsing(true);
   nsCOMPtr info = GetLoadContextInfo(false, attrs);
@@ -68,7 +68,7 @@ NS_IMETHODIMP LoadContextInfoFactory::GetPrivate(
 }
 
 NS_IMETHODIMP LoadContextInfoFactory::GetAnonymous(
-    nsILoadContextInfo **aAnonymous) {
+    nsILoadContextInfo** aAnonymous) {
   nsCOMPtr info =
       GetLoadContextInfo(true, OriginAttributes());
   info.forget(aAnonymous);
@@ -77,8 +77,8 @@ NS_IMETHODIMP LoadContextInfoFactory::GetAnonymous(
 
 NS_IMETHODIMP LoadContextInfoFactory::Custom(bool aAnonymous,
                                              JS::HandleValue aOriginAttributes,
-                                             JSContext *cx,
-                                             nsILoadContextInfo **_retval) {
+                                             JSContext* cx,
+                                             nsILoadContextInfo** _retval) {
   OriginAttributes attrs;
   bool status = attrs.Init(cx, aOriginAttributes);
   NS_ENSURE_TRUE(status, NS_ERROR_FAILURE);
@@ -89,17 +89,17 @@ NS_IMETHODIMP LoadContextInfoFactory::Custom(bool aAnonymous,
 }
 
 NS_IMETHODIMP LoadContextInfoFactory::FromLoadContext(
-    nsILoadContext *aLoadContext, bool aAnonymous,
-    nsILoadContextInfo **_retval) {
+    nsILoadContext* aLoadContext, bool aAnonymous,
+    nsILoadContextInfo** _retval) {
   nsCOMPtr info =
       GetLoadContextInfo(aLoadContext, aAnonymous);
   info.forget(_retval);
   return NS_OK;
 }
 
-NS_IMETHODIMP LoadContextInfoFactory::FromWindow(nsIDOMWindow *aWindow,
+NS_IMETHODIMP LoadContextInfoFactory::FromWindow(nsIDOMWindow* aWindow,
                                                  bool aAnonymous,
-                                                 nsILoadContextInfo **_retval) {
+                                                 nsILoadContextInfo** _retval) {
   nsCOMPtr info = GetLoadContextInfo(aWindow, aAnonymous);
   info.forget(_retval);
   return NS_OK;
@@ -107,7 +107,7 @@ NS_IMETHODIMP LoadContextInfoFactory::FromWindow(nsIDOMWindow *aWindow,
 
 // Helper functions
 
-LoadContextInfo *GetLoadContextInfo(nsIChannel *aChannel) {
+LoadContextInfo* GetLoadContextInfo(nsIChannel* aChannel) {
   nsresult rv;
 
   DebugOnly pb = NS_UsePrivateBrowsing(aChannel);
@@ -126,7 +126,7 @@ LoadContextInfo *GetLoadContextInfo(nsIChannel *aChannel) {
   return new LoadContextInfo(anon, oa);
 }
 
-LoadContextInfo *GetLoadContextInfo(nsILoadContext *aLoadContext,
+LoadContextInfo* GetLoadContextInfo(nsILoadContext* aLoadContext,
                                     bool aIsAnonymous) {
   if (!aLoadContext) {
     return new LoadContextInfo(aIsAnonymous, OriginAttributes());
@@ -146,20 +146,20 @@ LoadContextInfo *GetLoadContextInfo(nsILoadContext *aLoadContext,
   return new LoadContextInfo(aIsAnonymous, oa);
 }
 
-LoadContextInfo *GetLoadContextInfo(nsIDOMWindow *aWindow, bool aIsAnonymous) {
+LoadContextInfo* GetLoadContextInfo(nsIDOMWindow* aWindow, bool aIsAnonymous) {
   nsCOMPtr webNav = do_GetInterface(aWindow);
   nsCOMPtr loadContext = do_QueryInterface(webNav);
 
   return GetLoadContextInfo(loadContext, aIsAnonymous);
 }
 
-LoadContextInfo *GetLoadContextInfo(nsILoadContextInfo *aInfo) {
+LoadContextInfo* GetLoadContextInfo(nsILoadContextInfo* aInfo) {
   return new LoadContextInfo(aInfo->IsAnonymous(),
                              *aInfo->OriginAttributesPtr());
 }
 
-LoadContextInfo *GetLoadContextInfo(bool const aIsAnonymous,
-                                    OriginAttributes const &aOriginAttributes) {
+LoadContextInfo* GetLoadContextInfo(bool const aIsAnonymous,
+                                    OriginAttributes const& aOriginAttributes) {
   return new LoadContextInfo(aIsAnonymous, aOriginAttributes);
 }
 
diff --git a/netwerk/base/NetworkConnectivityService.cpp b/netwerk/base/NetworkConnectivityService.cpp
index 49e51e4f444a5..5b9642e32f7c4 100644
--- a/netwerk/base/NetworkConnectivityService.cpp
+++ b/netwerk/base/NetworkConnectivityService.cpp
@@ -45,28 +45,28 @@ nsresult NetworkConnectivityService::Init() {
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::GetDNSv4(ConnectivityState *aState) {
+NetworkConnectivityService::GetDNSv4(ConnectivityState* aState) {
   NS_ENSURE_ARG(aState);
   *aState = mDNSv4;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::GetDNSv6(ConnectivityState *aState) {
+NetworkConnectivityService::GetDNSv6(ConnectivityState* aState) {
   NS_ENSURE_ARG(aState);
   *aState = mDNSv6;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::GetIPv4(ConnectivityState *aState) {
+NetworkConnectivityService::GetIPv4(ConnectivityState* aState) {
   NS_ENSURE_ARG(aState);
   *aState = mIPv4;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::GetIPv6(ConnectivityState *aState) {
+NetworkConnectivityService::GetIPv6(ConnectivityState* aState) {
   NS_ENSURE_ARG(aState);
   *aState = mIPv6;
   return NS_OK;
@@ -83,14 +83,14 @@ void NetworkConnectivityService::PerformChecks() {
   RecheckIPConnectivity();
 }
 
-static inline void NotifyObservers(const char *aTopic) {
+static inline void NotifyObservers(const char* aTopic) {
   nsCOMPtr obs = mozilla::services::GetObserverService();
   obs->NotifyObservers(nullptr, aTopic, nullptr);
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::OnLookupComplete(nsICancelable *aRequest,
-                                             nsIDNSRecord *aRecord,
+NetworkConnectivityService::OnLookupComplete(nsICancelable* aRequest,
+                                             nsIDNSRecord* aRecord,
                                              nsresult aStatus) {
   ConnectivityState state = aRecord ? OK : NOT_AVAILABLE;
 
@@ -109,8 +109,8 @@ NetworkConnectivityService::OnLookupComplete(nsICancelable *aRequest,
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::OnLookupByTypeComplete(nsICancelable *aRequest,
-                                                   nsIDNSByTypeRecord *aRes,
+NetworkConnectivityService::OnLookupByTypeComplete(nsICancelable* aRequest,
+                                                   nsIDNSByTypeRecord* aRes,
                                                    nsresult aStatus) {
   return NS_OK;
 }
@@ -142,8 +142,8 @@ NetworkConnectivityService::RecheckDNS() {
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::Observe(nsISupports *aSubject, const char *aTopic,
-                                    const char16_t *aData) {
+NetworkConnectivityService::Observe(nsISupports* aSubject, const char* aTopic,
+                                    const char16_t* aData) {
   if (!strcmp(aTopic, "network:captive-portal-connectivity")) {
     // Captive portal is cleared, so we redo the checks.
     PerformChecks();
@@ -252,12 +252,12 @@ NetworkConnectivityService::RecheckIPConnectivity() {
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::OnStartRequest(nsIRequest *aRequest) {
+NetworkConnectivityService::OnStartRequest(nsIRequest* aRequest) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::OnStopRequest(nsIRequest *aRequest,
+NetworkConnectivityService::OnStopRequest(nsIRequest* aRequest,
                                           nsresult aStatusCode) {
   if (aStatusCode == NS_ERROR_ABORT) {
     return NS_OK;
@@ -292,8 +292,8 @@ NetworkConnectivityService::OnStopRequest(nsIRequest *aRequest,
 }
 
 NS_IMETHODIMP
-NetworkConnectivityService::OnDataAvailable(nsIRequest *aRequest,
-                                            nsIInputStream *aInputStream,
+NetworkConnectivityService::OnDataAvailable(nsIRequest* aRequest,
+                                            nsIInputStream* aInputStream,
                                             uint64_t aOffset, uint32_t aCount) {
   nsAutoCString data;
   Unused << NS_ReadInputStreamToString(aInputStream, data, aCount);
diff --git a/netwerk/base/PollableEvent.cpp b/netwerk/base/PollableEvent.cpp
index d3ed1124c309b..b483ee6cd0409 100644
--- a/netwerk/base/PollableEvent.cpp
+++ b/netwerk/base/PollableEvent.cpp
@@ -27,7 +27,7 @@ namespace net {
 #ifndef USEPIPE
 static PRDescIdentity sPollableEventLayerIdentity;
 static PRIOMethods sPollableEventLayerMethods;
-static PRIOMethods *sPollableEventLayerMethodsPtr = nullptr;
+static PRIOMethods* sPollableEventLayerMethodsPtr = nullptr;
 
 static void LazyInitSocket() {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
@@ -39,7 +39,7 @@ static void LazyInitSocket() {
   sPollableEventLayerMethodsPtr = &sPollableEventLayerMethods;
 }
 
-static bool NewTCPSocketPair(PRFileDesc *fd[], bool aSetRecvBuff) {
+static bool NewTCPSocketPair(PRFileDesc* fd[], bool aSetRecvBuff) {
   // this is a replacement for PR_NewTCPSocketPair that manually
   // sets the recv buffer to 64K. A windows bug (1248358)
   // can result in using an incompatible rwin and window
@@ -48,9 +48,9 @@ static bool NewTCPSocketPair(PRFileDesc *fd[], bool aSetRecvBuff) {
   SOCKET_LOG(("NewTCPSocketPair %s a recv buffer tuning\n",
               aSetRecvBuff ? "with" : "without"));
 
-  PRFileDesc *listener = nullptr;
-  PRFileDesc *writer = nullptr;
-  PRFileDesc *reader = nullptr;
+  PRFileDesc* listener = nullptr;
+  PRFileDesc* writer = nullptr;
+  PRFileDesc* reader = nullptr;
   PRSocketOptionData recvBufferOpt;
   recvBufferOpt.option = PR_SockOpt_RecvBufferSize;
   recvBufferOpt.value.recv_buffer_size = 65535;
@@ -166,7 +166,7 @@ PollableEvent::PollableEvent()
   }
 #else
   SOCKET_LOG(("PollableEvent() using socket pair\n"));
-  PRFileDesc *fd[2];
+  PRFileDesc* fd[2];
   LazyInitSocket();
 
   // Try with a increased recv buffer first (bug 1248358).
@@ -200,7 +200,7 @@ PollableEvent::PollableEvent()
     // compatibility with LSPs such as McAfee that assume a NSPR
     // layer for read ala the nspr Pollable Event - Bug 698882. This layer is a
     // nop.
-    PRFileDesc *topLayer = PR_CreateIOLayerStub(sPollableEventLayerIdentity,
+    PRFileDesc* topLayer = PR_CreateIOLayerStub(sPollableEventLayerIdentity,
                                                 sPollableEventLayerMethodsPtr);
     if (topLayer) {
       if (PR_PushIOLayer(fd[0], PR_TOP_IO_LAYER, topLayer) == PR_FAILURE) {
@@ -376,7 +376,7 @@ void PollableEvent::AdjustFirstSignalTimestamp() {
   }
 }
 
-bool PollableEvent::IsSignallingAlive(TimeDuration const &timeout) {
+bool PollableEvent::IsSignallingAlive(TimeDuration const& timeout) {
   if (mWriteFailed) {
     return false;
   }
diff --git a/netwerk/base/PollableEvent.h b/netwerk/base/PollableEvent.h
index 6a9afe8116023..c62940c4918d6 100644
--- a/netwerk/base/PollableEvent.h
+++ b/netwerk/base/PollableEvent.h
@@ -39,13 +39,13 @@ class PollableEvent {
   // - PR_Write has failed
   // - no out_flags were signalled on the socket pair for too long after
   //   the earliest Signal()
-  bool IsSignallingAlive(TimeDuration const &timeout);
+  bool IsSignallingAlive(TimeDuration const& timeout);
 
-  PRFileDesc *PollableFD() { return mReadFD; }
+  PRFileDesc* PollableFD() { return mReadFD; }
 
  private:
-  PRFileDesc *mWriteFD;
-  PRFileDesc *mReadFD;
+  PRFileDesc* mWriteFD;
+  PRFileDesc* mReadFD;
   bool mSignaled;
   // true when PR_Write to the socket pair has failed (status < 1)
   bool mWriteFailed;
diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp
index 0478714b37049..611348095173d 100644
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -59,7 +59,7 @@ using namespace mozilla;
 namespace mozilla {
 namespace net {
 
-Predictor *Predictor::sSelf = nullptr;
+Predictor* Predictor::sSelf = nullptr;
 
 static LazyLogModule gPredictorLog("NetworkPredictor");
 
@@ -107,8 +107,8 @@ static bool sEsniEnabled = false;
 
 // Get the full origin (scheme, host, port) out of a URI (maybe should be part
 // of nsIURI instead?)
-static nsresult ExtractOrigin(nsIURI *uri, nsIURI **originUri,
-                              nsIIOService *ioService) {
+static nsresult ExtractOrigin(nsIURI* uri, nsIURI** originUri,
+                              nsIIOService* ioService) {
   nsAutoCString s;
   s.Truncate();
   nsresult rv = nsContentUtils::GetASCIIOrigin(uri, s);
@@ -119,7 +119,7 @@ static nsresult ExtractOrigin(nsIURI *uri, nsIURI **originUri,
 
 // All URIs we get passed *must* be http or https if they're not null. This
 // helps ensure that.
-static bool IsNullOrHttp(nsIURI *uri) {
+static bool IsNullOrHttp(nsIURI* uri) {
   if (!uri) {
     return true;
   }
@@ -141,14 +141,14 @@ static bool IsNullOrHttp(nsIURI *uri) {
 NS_IMPL_ISUPPORTS(Predictor::DNSListener, nsIDNSListener);
 
 NS_IMETHODIMP
-Predictor::DNSListener::OnLookupComplete(nsICancelable *request,
-                                         nsIDNSRecord *rec, nsresult status) {
+Predictor::DNSListener::OnLookupComplete(nsICancelable* request,
+                                         nsIDNSRecord* rec, nsresult status) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Predictor::DNSListener::OnLookupByTypeComplete(nsICancelable *request,
-                                               nsIDNSByTypeRecord *res,
+Predictor::DNSListener::OnLookupByTypeComplete(nsICancelable* request,
+                                               nsIDNSByTypeRecord* res,
                                                nsresult status) {
   return NS_OK;
 }
@@ -160,9 +160,9 @@ Predictor::DNSListener::OnLookupByTypeComplete(nsICancelable *request,
 NS_IMPL_ISUPPORTS(Predictor::Action, nsICacheEntryOpenCallback);
 
 Predictor::Action::Action(bool fullUri, bool predict, Predictor::Reason reason,
-                          nsIURI *targetURI, nsIURI *sourceURI,
-                          nsINetworkPredictorVerifier *verifier,
-                          Predictor *predictor)
+                          nsIURI* targetURI, nsIURI* sourceURI,
+                          nsINetworkPredictorVerifier* verifier,
+                          Predictor* predictor)
     : mFullUri(fullUri),
       mPredict(predict),
       mTargetURI(targetURI),
@@ -179,9 +179,9 @@ Predictor::Action::Action(bool fullUri, bool predict, Predictor::Reason reason,
 }
 
 Predictor::Action::Action(bool fullUri, bool predict, Predictor::Reason reason,
-                          nsIURI *targetURI, nsIURI *sourceURI,
-                          nsINetworkPredictorVerifier *verifier,
-                          Predictor *predictor, uint8_t stackCount)
+                          nsIURI* targetURI, nsIURI* sourceURI,
+                          nsINetworkPredictorVerifier* verifier,
+                          Predictor* predictor, uint8_t stackCount)
     : mFullUri(fullUri),
       mPredict(predict),
       mTargetURI(targetURI),
@@ -198,16 +198,16 @@ Predictor::Action::Action(bool fullUri, bool predict, Predictor::Reason reason,
 }
 
 NS_IMETHODIMP
-Predictor::Action::OnCacheEntryCheck(nsICacheEntry *entry,
-                                     nsIApplicationCache *appCache,
-                                     uint32_t *result) {
+Predictor::Action::OnCacheEntryCheck(nsICacheEntry* entry,
+                                     nsIApplicationCache* appCache,
+                                     uint32_t* result) {
   *result = nsICacheEntryOpenCallback::ENTRY_WANTED;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Predictor::Action::OnCacheEntryAvailable(nsICacheEntry *entry, bool isNew,
-                                         nsIApplicationCache *appCache,
+Predictor::Action::OnCacheEntryAvailable(nsICacheEntry* entry, bool isNew,
+                                         nsIApplicationCache* appCache,
                                          nsresult result) {
   MOZ_ASSERT(NS_IsMainThread(), "Got cache entry off main thread!");
 
@@ -313,8 +313,8 @@ void Predictor::RemoveObserver() {
 }
 
 NS_IMETHODIMP
-Predictor::Observe(nsISupports *subject, const char *topic,
-                   const char16_t *data_unicode) {
+Predictor::Observe(nsISupports* subject, const char* topic,
+                   const char16_t* data_unicode) {
   nsresult rv = NS_OK;
   MOZ_ASSERT(NS_IsMainThread(),
              "Predictor observing something off main thread!");
@@ -332,26 +332,26 @@ Predictor::Observe(nsISupports *subject, const char *topic,
 // Predictor::nsISpeculativeConnectionOverrider
 
 NS_IMETHODIMP
-Predictor::GetIgnoreIdle(bool *ignoreIdle) {
+Predictor::GetIgnoreIdle(bool* ignoreIdle) {
   *ignoreIdle = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 Predictor::GetParallelSpeculativeConnectLimit(
-    uint32_t *parallelSpeculativeConnectLimit) {
+    uint32_t* parallelSpeculativeConnectLimit) {
   *parallelSpeculativeConnectLimit = 6;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Predictor::GetIsFromPredictor(bool *isFromPredictor) {
+Predictor::GetIsFromPredictor(bool* isFromPredictor) {
   *isFromPredictor = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Predictor::GetAllow1918(bool *allow1918) {
+Predictor::GetAllow1918(bool* allow1918) {
   *allow1918 = false;
   return NS_OK;
 }
@@ -359,7 +359,7 @@ Predictor::GetAllow1918(bool *allow1918) {
 // Predictor::nsIInterfaceRequestor
 
 NS_IMETHODIMP
-Predictor::GetInterface(const nsIID &iid, void **result) {
+Predictor::GetInterface(const nsIID& iid, void** result) {
   return QueryInterface(iid, result);
 }
 
@@ -369,15 +369,15 @@ Predictor::GetInterface(const nsIID &iid, void **result) {
 #define RESOURCE_META_DATA "predictor::resource-count"
 #define META_DATA_PREFIX "predictor::"
 
-static bool IsURIMetadataElement(const char *key) {
+static bool IsURIMetadataElement(const char* key) {
   return StringBeginsWith(nsDependentCString(key),
                           NS_LITERAL_CSTRING(META_DATA_PREFIX)) &&
          !NS_LITERAL_CSTRING(SEEN_META_DATA).Equals(key) &&
          !NS_LITERAL_CSTRING(RESOURCE_META_DATA).Equals(key);
 }
 
-nsresult Predictor::OnMetaDataElement(const char *asciiKey,
-                                      const char *asciiValue) {
+nsresult Predictor::OnMetaDataElement(const char* asciiKey,
+                                      const char* asciiValue) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsURIMetadataElement(asciiKey)) {
@@ -442,7 +442,7 @@ nsresult Predictor::Init() {
 namespace {
 class PredictorThreadShutdownRunner : public Runnable {
  public:
-  PredictorThreadShutdownRunner(nsIThread *ioThread, bool success)
+  PredictorThreadShutdownRunner(nsIThread* ioThread, bool success)
       : Runnable("net::PredictorThreadShutdownRunner"),
         mIOThread(ioThread),
         mSuccess(success) {}
@@ -465,7 +465,7 @@ class PredictorThreadShutdownRunner : public Runnable {
 
 class PredictorOldCleanupRunner : public Runnable {
  public:
-  PredictorOldCleanupRunner(nsIThread *ioThread, nsIFile *dbFile)
+  PredictorOldCleanupRunner(nsIThread* ioThread, nsIFile* dbFile)
       : Runnable("net::PredictorOldCleanupRunner"),
         mIOThread(ioThread),
         mDBFile(dbFile) {}
@@ -516,9 +516,9 @@ class PredictorOldCleanupRunner : public Runnable {
 
 class PredictorLearnRunnable final : public Runnable {
  public:
-  PredictorLearnRunnable(nsIURI *targetURI, nsIURI *sourceURI,
+  PredictorLearnRunnable(nsIURI* targetURI, nsIURI* sourceURI,
                          PredictorLearnReason reason,
-                         const OriginAttributes &oa)
+                         const OriginAttributes& oa)
       : Runnable("PredictorLearnRunnable"),
         mTargetURI(targetURI),
         mSourceURI(sourceURI),
@@ -595,8 +595,8 @@ void Predictor::Shutdown() {
   mInitialized = false;
 }
 
-nsresult Predictor::Create(nsISupports *aOuter, const nsIID &aIID,
-                           void **aResult) {
+nsresult Predictor::Create(nsISupports* aOuter, const nsIID& aIID,
+                           void** aResult) {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsresult rv;
@@ -628,10 +628,10 @@ nsresult Predictor::Create(nsISupports *aOuter, const nsIID &aIID,
 }
 
 NS_IMETHODIMP
-Predictor::Predict(nsIURI *targetURI, nsIURI *sourceURI,
+Predictor::Predict(nsIURI* targetURI, nsIURI* sourceURI,
                    PredictorPredictReason reason,
                    JS::HandleValue originAttributes,
-                   nsINetworkPredictorVerifier *verifier, JSContext *aCx) {
+                   nsINetworkPredictorVerifier* verifier, JSContext* aCx) {
   OriginAttributes attrs;
 
   if (!originAttributes.isObject() || !attrs.Init(aCx, originAttributes)) {
@@ -643,10 +643,10 @@ Predictor::Predict(nsIURI *targetURI, nsIURI *sourceURI,
 
 // Called from the main thread to initiate predictive actions
 NS_IMETHODIMP
-Predictor::PredictNative(nsIURI *targetURI, nsIURI *sourceURI,
+Predictor::PredictNative(nsIURI* targetURI, nsIURI* sourceURI,
                          PredictorPredictReason reason,
-                         const OriginAttributes &originAttributes,
-                         nsINetworkPredictorVerifier *verifier) {
+                         const OriginAttributes& originAttributes,
+                         nsINetworkPredictorVerifier* verifier) {
   MOZ_ASSERT(NS_IsMainThread(),
              "Predictor interface methods must be called on the main thread");
 
@@ -785,9 +785,9 @@ Predictor::PredictNative(nsIURI *targetURI, nsIURI *sourceURI,
 }
 
 bool Predictor::PredictInternal(PredictorPredictReason reason,
-                                nsICacheEntry *entry, bool isNew, bool fullUri,
-                                nsIURI *targetURI,
-                                nsINetworkPredictorVerifier *verifier,
+                                nsICacheEntry* entry, bool isNew, bool fullUri,
+                                nsIURI* targetURI,
+                                nsINetworkPredictorVerifier* verifier,
                                 uint8_t stackCount) {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -826,9 +826,9 @@ bool Predictor::PredictInternal(PredictorPredictReason reason,
   return rv;
 }
 
-void Predictor::PredictForLink(nsIURI *targetURI, nsIURI *sourceURI,
-                               const OriginAttributes &originAttributes,
-                               nsINetworkPredictorVerifier *verifier) {
+void Predictor::PredictForLink(nsIURI* targetURI, nsIURI* sourceURI,
+                               const OriginAttributes& originAttributes,
+                               nsINetworkPredictorVerifier* verifier) {
   MOZ_ASSERT(NS_IsMainThread());
 
   PREDICTOR_LOG(("Predictor::PredictForLink"));
@@ -859,9 +859,9 @@ void Predictor::PredictForLink(nsIURI *targetURI, nsIURI *sourceURI,
 
 // This is the driver for prediction based on a new pageload.
 static const uint8_t MAX_PAGELOAD_DEPTH = 10;
-bool Predictor::PredictForPageload(nsICacheEntry *entry, nsIURI *targetURI,
+bool Predictor::PredictForPageload(nsICacheEntry* entry, nsIURI* targetURI,
                                    uint8_t stackCount, bool fullUri,
-                                   nsINetworkPredictorVerifier *verifier) {
+                                   nsINetworkPredictorVerifier* verifier) {
   MOZ_ASSERT(NS_IsMainThread());
 
   PREDICTOR_LOG(("Predictor::PredictForPageload"));
@@ -923,8 +923,8 @@ bool Predictor::PredictForPageload(nsICacheEntry *entry, nsIURI *targetURI,
 
 // This is the driver for predicting at browser startup time based on pages that
 // have previously been loaded close to startup.
-bool Predictor::PredictForStartup(nsICacheEntry *entry, bool fullUri,
-                                  nsINetworkPredictorVerifier *verifier) {
+bool Predictor::PredictForStartup(nsICacheEntry* entry, bool fullUri,
+                                  nsINetworkPredictorVerifier* verifier) {
   MOZ_ASSERT(NS_IsMainThread());
 
   PREDICTOR_LOG(("Predictor::PredictForStartup"));
@@ -1042,7 +1042,7 @@ int32_t Predictor::CalculateConfidence(uint32_t hitCount, uint32_t hitsPossible,
 }
 
 static void MakeMetadataEntry(const uint32_t hitCount, const uint32_t lastHit,
-                              const uint32_t flags, nsCString &newValue) {
+                              const uint32_t flags, nsCString& newValue) {
   newValue.Truncate();
   newValue.AppendInt(METADATA_VERSION);
   newValue.Append(',');
@@ -1061,8 +1061,8 @@ static void MakeMetadataEntry(const uint32_t hitCount, const uint32_t lastHit,
 // particular subresource has been seen. The rolling window is kept in the upper
 // 20 bits of the flags element of the metadata. This saves 12 bits for regular
 // old flags.
-void Predictor::UpdateRollingLoadCount(nsICacheEntry *entry,
-                                       const uint32_t flags, const char *key,
+void Predictor::UpdateRollingLoadCount(nsICacheEntry* entry,
+                                       const uint32_t flags, const char* key,
                                        const uint32_t hitCount,
                                        const uint32_t lastHit) {
   // Extract just the rolling load count from the flags, shift it to clear the
@@ -1088,7 +1088,7 @@ uint32_t Predictor::ClampedPrefetchRollingLoadCount() {
   return n;
 }
 
-void Predictor::CalculatePredictions(nsICacheEntry *entry, nsIURI *referrer,
+void Predictor::CalculatePredictions(nsICacheEntry* entry, nsIURI* referrer,
                                      uint32_t lastLoad, uint32_t loadCount,
                                      int32_t globalDegradation, bool fullUri) {
   MOZ_ASSERT(NS_IsMainThread());
@@ -1102,8 +1102,8 @@ void Predictor::CalculatePredictions(nsICacheEntry *entry, nsIURI *referrer,
 
   MOZ_ASSERT(keysToOperateOn.Length() == valuesToOperateOn.Length());
   for (size_t i = 0; i < keysToOperateOn.Length(); ++i) {
-    const char *key = keysToOperateOn[i].BeginReading();
-    const char *value = valuesToOperateOn[i].BeginReading();
+    const char* key = keysToOperateOn[i].BeginReading();
+    const char* value = valuesToOperateOn[i].BeginReading();
 
     nsCString uri;
     uint32_t hitCount, lastHit, flags;
@@ -1163,7 +1163,7 @@ void Predictor::CalculatePredictions(nsICacheEntry *entry, nsIURI *referrer,
 // (Maybe) adds a predictive action to the prediction runner, based on our
 // calculated confidence for the subresource in question.
 void Predictor::SetupPrediction(int32_t confidence, uint32_t flags,
-                                const nsCString &uri,
+                                const nsCString& uri,
                                 PrefetchIgnoreReason earlyReason) {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -1234,9 +1234,9 @@ void Predictor::SetupPrediction(int32_t confidence, uint32_t flags,
   }
 }
 
-nsresult Predictor::Prefetch(nsIURI *uri, nsIURI *referrer,
-                             const OriginAttributes &originAttributes,
-                             nsINetworkPredictorVerifier *verifier) {
+nsresult Predictor::Prefetch(nsIURI* uri, nsIURI* referrer,
+                             const OriginAttributes& originAttributes,
+                             nsINetworkPredictorVerifier* verifier) {
   nsAutoCString strUri, strReferrer;
   uri->GetAsciiSpec(strUri);
   referrer->GetAsciiSpec(strReferrer);
@@ -1293,9 +1293,9 @@ nsresult Predictor::Prefetch(nsIURI *uri, nsIURI *referrer,
 }
 
 // Runs predictions that have been set up.
-bool Predictor::RunPredictions(nsIURI *referrer,
-                               const OriginAttributes &originAttributes,
-                               nsINetworkPredictorVerifier *verifier) {
+bool Predictor::RunPredictions(nsIURI* referrer,
+                               const OriginAttributes& originAttributes,
+                               nsINetworkPredictorVerifier* verifier) {
   MOZ_ASSERT(NS_IsMainThread(), "Running prediction off main thread");
 
   PREDICTOR_LOG(("Predictor::RunPredictions"));
@@ -1384,9 +1384,9 @@ bool Predictor::RunPredictions(nsIURI *referrer,
 }
 
 // Find out if a top-level page is likely to redirect.
-bool Predictor::WouldRedirect(nsICacheEntry *entry, uint32_t loadCount,
+bool Predictor::WouldRedirect(nsICacheEntry* entry, uint32_t loadCount,
                               uint32_t lastLoad, int32_t globalDegradation,
-                              nsIURI **redirectURI) {
+                              nsIURI** redirectURI) {
   // TODO - not doing redirects for first go around
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -1394,9 +1394,9 @@ bool Predictor::WouldRedirect(nsICacheEntry *entry, uint32_t loadCount,
 }
 
 NS_IMETHODIMP
-Predictor::Learn(nsIURI *targetURI, nsIURI *sourceURI,
+Predictor::Learn(nsIURI* targetURI, nsIURI* sourceURI,
                  PredictorLearnReason reason, JS::HandleValue originAttributes,
-                 JSContext *aCx) {
+                 JSContext* aCx) {
   OriginAttributes attrs;
 
   if (!originAttributes.isObject() || !attrs.Init(aCx, originAttributes)) {
@@ -1408,9 +1408,9 @@ Predictor::Learn(nsIURI *targetURI, nsIURI *sourceURI,
 
 // Called from the main thread to update the database
 NS_IMETHODIMP
-Predictor::LearnNative(nsIURI *targetURI, nsIURI *sourceURI,
+Predictor::LearnNative(nsIURI* targetURI, nsIURI* sourceURI,
                        PredictorLearnReason reason,
-                       const OriginAttributes &originAttributes) {
+                       const OriginAttributes& originAttributes) {
   MOZ_ASSERT(NS_IsMainThread(),
              "Predictor interface methods must be called on the main thread");
 
@@ -1576,9 +1576,9 @@ Predictor::LearnNative(nsIURI *targetURI, nsIURI *sourceURI,
   return NS_OK;
 }
 
-void Predictor::LearnInternal(PredictorLearnReason reason, nsICacheEntry *entry,
-                              bool isNew, bool fullUri, nsIURI *targetURI,
-                              nsIURI *sourceURI) {
+void Predictor::LearnInternal(PredictorLearnReason reason, nsICacheEntry* entry,
+                              bool isNew, bool fullUri, nsIURI* targetURI,
+                              nsIURI* sourceURI) {
   MOZ_ASSERT(NS_IsMainThread());
 
   PREDICTOR_LOG(("Predictor::LearnInternal"));
@@ -1624,8 +1624,8 @@ void Predictor::LearnInternal(PredictorLearnReason reason, nsICacheEntry *entry,
 
         MOZ_ASSERT(keysToOperateOn.Length() == valuesToOperateOn.Length());
         for (size_t i = 0; i < keysToOperateOn.Length(); ++i) {
-          const char *key = keysToOperateOn[i].BeginReading();
-          const char *value = valuesToOperateOn[i].BeginReading();
+          const char* key = keysToOperateOn[i].BeginReading();
+          const char* value = valuesToOperateOn[i].BeginReading();
 
           nsCString uri;
           uint32_t hitCount, lastHit, flags;
@@ -1660,7 +1660,7 @@ void Predictor::LearnInternal(PredictorLearnReason reason, nsICacheEntry *entry,
 NS_IMPL_ISUPPORTS(Predictor::SpaceCleaner, nsICacheEntryMetaDataVisitor)
 
 NS_IMETHODIMP
-Predictor::SpaceCleaner::OnMetaDataElement(const char *key, const char *value) {
+Predictor::SpaceCleaner::OnMetaDataElement(const char* key, const char* value) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsURIMetadataElement(key)) {
@@ -1699,7 +1699,7 @@ Predictor::SpaceCleaner::OnMetaDataElement(const char *key, const char *value) {
   return NS_OK;
 }
 
-void Predictor::SpaceCleaner::Finalize(nsICacheEntry *entry) {
+void Predictor::SpaceCleaner::Finalize(nsICacheEntry* entry) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (mLRUKeyToDelete) {
@@ -1713,7 +1713,7 @@ void Predictor::SpaceCleaner::Finalize(nsICacheEntry *entry) {
 
 // Called when a subresource has been hit from a top-level load. Uses the two
 // helper functions above to update the database appropriately.
-void Predictor::LearnForSubresource(nsICacheEntry *entry, nsIURI *targetURI) {
+void Predictor::LearnForSubresource(nsICacheEntry* entry, nsIURI* targetURI) {
   MOZ_ASSERT(NS_IsMainThread());
 
   PREDICTOR_LOG(("Predictor::LearnForSubresource"));
@@ -1805,7 +1805,7 @@ void Predictor::LearnForSubresource(nsICacheEntry *entry, nsIURI *targetURI) {
 
 // This is called when a top-level loaded ended up redirecting to a different
 // URI so we can keep track of that fact.
-void Predictor::LearnForRedirect(nsICacheEntry *entry, nsIURI *targetURI) {
+void Predictor::LearnForRedirect(nsICacheEntry* entry, nsIURI* targetURI) {
   MOZ_ASSERT(NS_IsMainThread());
 
   // TODO - not doing redirects for first go around
@@ -1814,8 +1814,8 @@ void Predictor::LearnForRedirect(nsICacheEntry *entry, nsIURI *targetURI) {
 
 // This will add a page to our list of startup pages if it's being loaded
 // before our startup window has expired.
-void Predictor::MaybeLearnForStartup(nsIURI *uri, bool fullUri,
-                                     const OriginAttributes &originAttributes) {
+void Predictor::MaybeLearnForStartup(nsIURI* uri, bool fullUri,
+                                     const OriginAttributes& originAttributes) {
   MOZ_ASSERT(NS_IsMainThread());
 
   // TODO - not doing startup for first go around
@@ -1823,7 +1823,7 @@ void Predictor::MaybeLearnForStartup(nsIURI *uri, bool fullUri,
 }
 
 // Add information about a top-level load to our list of startup pages
-void Predictor::LearnForStartup(nsICacheEntry *entry, nsIURI *targetURI) {
+void Predictor::LearnForStartup(nsICacheEntry* entry, nsIURI* targetURI) {
   MOZ_ASSERT(NS_IsMainThread());
 
   // These actually do the same set of work, just on different entries, so we
@@ -1832,15 +1832,15 @@ void Predictor::LearnForStartup(nsICacheEntry *entry, nsIURI *targetURI) {
   LearnForSubresource(entry, targetURI);
 }
 
-bool Predictor::ParseMetaDataEntry(const char *key, const char *value,
-                                   nsCString &uri, uint32_t &hitCount,
-                                   uint32_t &lastHit, uint32_t &flags) {
+bool Predictor::ParseMetaDataEntry(const char* key, const char* value,
+                                   nsCString& uri, uint32_t& hitCount,
+                                   uint32_t& lastHit, uint32_t& flags) {
   MOZ_ASSERT(NS_IsMainThread());
 
   PREDICTOR_LOG(
       ("Predictor::ParseMetaDataEntry key=%s value=%s", key ? key : "", value));
 
-  const char *comma = strchr(value, ',');
+  const char* comma = strchr(value, ',');
   if (!comma) {
     PREDICTOR_LOG(("    could not find first comma"));
     return false;
@@ -1880,7 +1880,7 @@ bool Predictor::ParseMetaDataEntry(const char *key, const char *value,
   PREDICTOR_LOG(("    flags -> %u", flags));
 
   if (key) {
-    const char *uriStart = key + (sizeof(META_DATA_PREFIX) - 1);
+    const char* uriStart = key + (sizeof(META_DATA_PREFIX) - 1);
     uri.AssignASCII(uriStart);
     PREDICTOR_LOG(("    uri -> %s", uriStart));
   } else {
@@ -1928,20 +1928,20 @@ Predictor::Reset() {
 NS_IMPL_ISUPPORTS(Predictor::Resetter, nsICacheEntryOpenCallback,
                   nsICacheEntryMetaDataVisitor, nsICacheStorageVisitor);
 
-Predictor::Resetter::Resetter(Predictor *predictor)
+Predictor::Resetter::Resetter(Predictor* predictor)
     : mEntriesToVisit(0), mPredictor(predictor) {}
 
 NS_IMETHODIMP
-Predictor::Resetter::OnCacheEntryCheck(nsICacheEntry *entry,
-                                       nsIApplicationCache *appCache,
-                                       uint32_t *result) {
+Predictor::Resetter::OnCacheEntryCheck(nsICacheEntry* entry,
+                                       nsIApplicationCache* appCache,
+                                       uint32_t* result) {
   *result = nsICacheEntryOpenCallback::ENTRY_WANTED;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Predictor::Resetter::OnCacheEntryAvailable(nsICacheEntry *entry, bool isNew,
-                                           nsIApplicationCache *appCache,
+Predictor::Resetter::OnCacheEntryAvailable(nsICacheEntry* entry, bool isNew,
+                                           nsIApplicationCache* appCache,
                                            nsresult result) {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -1961,7 +1961,7 @@ Predictor::Resetter::OnCacheEntryAvailable(nsICacheEntry *entry, bool isNew,
   keysToDelete.SwapElements(mKeysToDelete);
 
   for (size_t i = 0; i < keysToDelete.Length(); ++i) {
-    const char *key = keysToDelete[i].BeginReading();
+    const char* key = keysToDelete[i].BeginReading();
     entry->SetMetaDataElement(key, nullptr);
   }
 
@@ -1974,8 +1974,8 @@ Predictor::Resetter::OnCacheEntryAvailable(nsICacheEntry *entry, bool isNew,
 }
 
 NS_IMETHODIMP
-Predictor::Resetter::OnMetaDataElement(const char *asciiKey,
-                                       const char *asciiValue) {
+Predictor::Resetter::OnMetaDataElement(const char* asciiKey,
+                                       const char* asciiValue) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!StringBeginsWith(nsDependentCString(asciiKey),
@@ -1994,18 +1994,18 @@ Predictor::Resetter::OnMetaDataElement(const char *asciiKey,
 NS_IMETHODIMP
 Predictor::Resetter::OnCacheStorageInfo(uint32_t entryCount,
                                         uint64_t consumption, uint64_t capacity,
-                                        nsIFile *diskDirectory) {
+                                        nsIFile* diskDirectory) {
   MOZ_ASSERT(NS_IsMainThread());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Predictor::Resetter::OnCacheEntryInfo(nsIURI *uri, const nsACString &idEnhance,
+Predictor::Resetter::OnCacheEntryInfo(nsIURI* uri, const nsACString& idEnhance,
                                       int64_t dataSize, int32_t fetchCount,
                                       uint32_t lastModifiedTime,
                                       uint32_t expirationTime, bool aPinned,
-                                      nsILoadContextInfo *aInfo) {
+                                      nsILoadContextInfo* aInfo) {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsresult rv;
@@ -2092,7 +2092,7 @@ void Predictor::Resetter::Complete() {
 
 static StaticRefPtr sPredictor;
 
-static nsresult EnsureGlobalPredictor(nsINetworkPredictor **aPredictor) {
+static nsresult EnsureGlobalPredictor(nsINetworkPredictor** aPredictor) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!sPredictor) {
@@ -2109,10 +2109,10 @@ static nsresult EnsureGlobalPredictor(nsINetworkPredictor **aPredictor) {
   return NS_OK;
 }
 
-nsresult PredictorPredict(nsIURI *targetURI, nsIURI *sourceURI,
+nsresult PredictorPredict(nsIURI* targetURI, nsIURI* sourceURI,
                           PredictorPredictReason reason,
-                          const OriginAttributes &originAttributes,
-                          nsINetworkPredictorVerifier *verifier) {
+                          const OriginAttributes& originAttributes,
+                          nsINetworkPredictorVerifier* verifier) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsNullOrHttp(targetURI) || !IsNullOrHttp(sourceURI)) {
@@ -2127,9 +2127,9 @@ nsresult PredictorPredict(nsIURI *targetURI, nsIURI *sourceURI,
                                   originAttributes, verifier);
 }
 
-nsresult PredictorLearn(nsIURI *targetURI, nsIURI *sourceURI,
+nsresult PredictorLearn(nsIURI* targetURI, nsIURI* sourceURI,
                         PredictorLearnReason reason,
-                        const OriginAttributes &originAttributes) {
+                        const OriginAttributes& originAttributes) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsNullOrHttp(targetURI) || !IsNullOrHttp(sourceURI)) {
@@ -2143,8 +2143,8 @@ nsresult PredictorLearn(nsIURI *targetURI, nsIURI *sourceURI,
   return predictor->LearnNative(targetURI, sourceURI, reason, originAttributes);
 }
 
-nsresult PredictorLearn(nsIURI *targetURI, nsIURI *sourceURI,
-                        PredictorLearnReason reason, nsILoadGroup *loadGroup) {
+nsresult PredictorLearn(nsIURI* targetURI, nsIURI* sourceURI,
+                        PredictorLearnReason reason, nsILoadGroup* loadGroup) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsNullOrHttp(targetURI) || !IsNullOrHttp(sourceURI)) {
@@ -2173,8 +2173,8 @@ nsresult PredictorLearn(nsIURI *targetURI, nsIURI *sourceURI,
   return predictor->LearnNative(targetURI, sourceURI, reason, originAttributes);
 }
 
-nsresult PredictorLearn(nsIURI *targetURI, nsIURI *sourceURI,
-                        PredictorLearnReason reason, dom::Document *document) {
+nsresult PredictorLearn(nsIURI* targetURI, nsIURI* sourceURI,
+                        PredictorLearnReason reason, dom::Document* document) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsNullOrHttp(targetURI) || !IsNullOrHttp(sourceURI)) {
@@ -2198,8 +2198,8 @@ nsresult PredictorLearn(nsIURI *targetURI, nsIURI *sourceURI,
   return predictor->LearnNative(targetURI, sourceURI, reason, originAttributes);
 }
 
-nsresult PredictorLearnRedirect(nsIURI *targetURI, nsIChannel *channel,
-                                const OriginAttributes &originAttributes) {
+nsresult PredictorLearnRedirect(nsIURI* targetURI, nsIChannel* channel,
+                                const OriginAttributes& originAttributes) {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCOMPtr sourceURI;
@@ -2233,7 +2233,7 @@ nsresult PredictorLearnRedirect(nsIURI *targetURI, nsIChannel *channel,
  * Call through to the child's verifier (only during tests)
  */
 NS_IMETHODIMP
-Predictor::OnPredictPrefetch(nsIURI *aURI, uint32_t httpStatus) {
+Predictor::OnPredictPrefetch(nsIURI* aURI, uint32_t httpStatus) {
   if (IsNeckoChild()) {
     if (mChildVerifier) {
       // Ideally, we'd assert here. But since we're slowly moving towards a
@@ -2247,8 +2247,8 @@ Predictor::OnPredictPrefetch(nsIURI *aURI, uint32_t httpStatus) {
   ipc::URIParams serURI;
   SerializeURI(aURI, serURI);
 
-  for (auto *cp : ContentParent::AllProcesses(ContentParent::eLive)) {
-    PNeckoParent *neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent());
+  for (auto* cp : ContentParent::AllProcesses(ContentParent::eLive)) {
+    PNeckoParent* neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent());
     if (!neckoParent) {
       continue;
     }
@@ -2261,7 +2261,7 @@ Predictor::OnPredictPrefetch(nsIURI *aURI, uint32_t httpStatus) {
 }
 
 NS_IMETHODIMP
-Predictor::OnPredictPreconnect(nsIURI *aURI) {
+Predictor::OnPredictPreconnect(nsIURI* aURI) {
   if (IsNeckoChild()) {
     if (mChildVerifier) {
       // Ideally, we'd assert here. But since we're slowly moving towards a
@@ -2275,8 +2275,8 @@ Predictor::OnPredictPreconnect(nsIURI *aURI) {
   ipc::URIParams serURI;
   SerializeURI(aURI, serURI);
 
-  for (auto *cp : ContentParent::AllProcesses(ContentParent::eLive)) {
-    PNeckoParent *neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent());
+  for (auto* cp : ContentParent::AllProcesses(ContentParent::eLive)) {
+    PNeckoParent* neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent());
     if (!neckoParent) {
       continue;
     }
@@ -2289,7 +2289,7 @@ Predictor::OnPredictPreconnect(nsIURI *aURI) {
 }
 
 NS_IMETHODIMP
-Predictor::OnPredictDNS(nsIURI *aURI) {
+Predictor::OnPredictDNS(nsIURI* aURI) {
   if (IsNeckoChild()) {
     if (mChildVerifier) {
       // Ideally, we'd assert here. But since we're slowly moving towards a
@@ -2303,8 +2303,8 @@ Predictor::OnPredictDNS(nsIURI *aURI) {
   ipc::URIParams serURI;
   SerializeURI(aURI, serURI);
 
-  for (auto *cp : ContentParent::AllProcesses(ContentParent::eLive)) {
-    PNeckoParent *neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent());
+  for (auto* cp : ContentParent::AllProcesses(ContentParent::eLive)) {
+    PNeckoParent* neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent());
     if (!neckoParent) {
       continue;
     }
@@ -2323,13 +2323,13 @@ NS_IMPL_ISUPPORTS(Predictor::PrefetchListener, nsIStreamListener,
 
 // nsIRequestObserver
 NS_IMETHODIMP
-Predictor::PrefetchListener::OnStartRequest(nsIRequest *aRequest) {
+Predictor::PrefetchListener::OnStartRequest(nsIRequest* aRequest) {
   mStartTime = TimeStamp::Now();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Predictor::PrefetchListener::OnStopRequest(nsIRequest *aRequest,
+Predictor::PrefetchListener::OnStopRequest(nsIRequest* aRequest,
                                            nsresult aStatusCode) {
   PREDICTOR_LOG(("OnStopRequest this=%p aStatusCode=0x%" PRIX32, this,
                  static_cast(aStatusCode)));
@@ -2383,8 +2383,8 @@ Predictor::PrefetchListener::OnStopRequest(nsIRequest *aRequest,
 
 // nsIStreamListener
 NS_IMETHODIMP
-Predictor::PrefetchListener::OnDataAvailable(nsIRequest *aRequest,
-                                             nsIInputStream *aInputStream,
+Predictor::PrefetchListener::OnDataAvailable(nsIRequest* aRequest,
+                                             nsIInputStream* aInputStream,
                                              uint64_t aOffset,
                                              const uint32_t aCount) {
   uint32_t result;
@@ -2394,11 +2394,11 @@ Predictor::PrefetchListener::OnDataAvailable(nsIRequest *aRequest,
 
 // Miscellaneous Predictor
 
-void Predictor::UpdateCacheability(nsIURI *sourceURI, nsIURI *targetURI,
+void Predictor::UpdateCacheability(nsIURI* sourceURI, nsIURI* targetURI,
                                    uint32_t httpStatus,
-                                   nsHttpRequestHead &requestHead,
-                                   nsHttpResponseHead *responseHead,
-                                   nsILoadContextInfo *lci, bool isTracking) {
+                                   nsHttpRequestHead& requestHead,
+                                   nsHttpResponseHead* responseHead,
+                                   nsILoadContextInfo* lci, bool isTracking) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (lci && lci->IsPrivate()) {
@@ -2437,8 +2437,8 @@ void Predictor::UpdateCacheability(nsIURI *sourceURI, nsIURI *targetURI,
 }
 
 void Predictor::UpdateCacheabilityInternal(
-    nsIURI *sourceURI, nsIURI *targetURI, uint32_t httpStatus,
-    const nsCString &method, const OriginAttributes &originAttributes,
+    nsIURI* sourceURI, nsIURI* targetURI, uint32_t httpStatus,
+    const nsCString& method, const OriginAttributes& originAttributes,
     bool isTracking, bool couldVary, bool isNoStore) {
   PREDICTOR_LOG(("Predictor::UpdateCacheability httpStatus=%u", httpStatus));
 
@@ -2481,9 +2481,9 @@ NS_IMPL_ISUPPORTS(Predictor::CacheabilityAction, nsICacheEntryOpenCallback,
                   nsICacheEntryMetaDataVisitor);
 
 NS_IMETHODIMP
-Predictor::CacheabilityAction::OnCacheEntryCheck(nsICacheEntry *entry,
-                                                 nsIApplicationCache *appCache,
-                                                 uint32_t *result) {
+Predictor::CacheabilityAction::OnCacheEntryCheck(nsICacheEntry* entry,
+                                                 nsIApplicationCache* appCache,
+                                                 uint32_t* result) {
   *result = nsICacheEntryOpenCallback::ENTRY_WANTED;
   return NS_OK;
 }
@@ -2502,7 +2502,7 @@ enum PrefetchDecisionReason {
 
 NS_IMETHODIMP
 Predictor::CacheabilityAction::OnCacheEntryAvailable(
-    nsICacheEntry *entry, bool isNew, nsIApplicationCache *appCache,
+    nsICacheEntry* entry, bool isNew, nsIApplicationCache* appCache,
     nsresult result) {
   MOZ_ASSERT(NS_IsMainThread());
   // This is being opened read-only, so isNew should always be false
@@ -2543,8 +2543,8 @@ Predictor::CacheabilityAction::OnCacheEntryAvailable(
 
   MOZ_ASSERT(keysToCheck.Length() == valuesToCheck.Length());
   for (size_t i = 0; i < keysToCheck.Length(); ++i) {
-    const char *key = keysToCheck[i].BeginReading();
-    const char *value = valuesToCheck[i].BeginReading();
+    const char* key = keysToCheck[i].BeginReading();
+    const char* value = valuesToCheck[i].BeginReading();
     nsCString uri;
     uint32_t hitCount, lastHit, flags;
 
@@ -2600,8 +2600,8 @@ Predictor::CacheabilityAction::OnCacheEntryAvailable(
 }
 
 NS_IMETHODIMP
-Predictor::CacheabilityAction::OnMetaDataElement(const char *asciiKey,
-                                                 const char *asciiValue) {
+Predictor::CacheabilityAction::OnMetaDataElement(const char* asciiKey,
+                                                 const char* asciiValue) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!IsURIMetadataElement(asciiKey)) {
diff --git a/netwerk/base/Predictor.h b/netwerk/base/Predictor.h
index 63880bf08f9cb..b4dc9e67172be 100644
--- a/netwerk/base/Predictor.h
+++ b/netwerk/base/Predictor.h
@@ -56,16 +56,16 @@ class Predictor final : public nsINetworkPredictor,
 
   nsresult Init();
   void Shutdown();
-  static nsresult Create(nsISupports *outer, const nsIID &iid, void **result);
+  static nsresult Create(nsISupports* outer, const nsIID& iid, void** result);
 
   // Used to update whether a particular URI was cacheable or not.
   // sourceURI and targetURI are the same as the arguments to Learn
   // and httpStatus is the status code we got while loading targetURI.
-  static void UpdateCacheability(nsIURI *sourceURI, nsIURI *targetURI,
+  static void UpdateCacheability(nsIURI* sourceURI, nsIURI* targetURI,
                                  uint32_t httpStatus,
-                                 nsHttpRequestHead &requestHead,
-                                 nsHttpResponseHead *reqponseHead,
-                                 nsILoadContextInfo *lci, bool isTracking);
+                                 nsHttpRequestHead& requestHead,
+                                 nsHttpResponseHead* reqponseHead,
+                                 nsILoadContextInfo* lci, bool isTracking);
 
  private:
   virtual ~Predictor();
@@ -94,12 +94,12 @@ class Predictor final : public nsINetworkPredictor,
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSICACHEENTRYOPENCALLBACK
 
-    Action(bool fullUri, bool predict, Reason reason, nsIURI *targetURI,
-           nsIURI *sourceURI, nsINetworkPredictorVerifier *verifier,
-           Predictor *predictor);
-    Action(bool fullUri, bool predict, Reason reason, nsIURI *targetURI,
-           nsIURI *sourceURI, nsINetworkPredictorVerifier *verifier,
-           Predictor *predictor, uint8_t stackCount);
+    Action(bool fullUri, bool predict, Reason reason, nsIURI* targetURI,
+           nsIURI* sourceURI, nsINetworkPredictorVerifier* verifier,
+           Predictor* predictor);
+    Action(bool fullUri, bool predict, Reason reason, nsIURI* targetURI,
+           nsIURI* sourceURI, nsINetworkPredictorVerifier* verifier,
+           Predictor* predictor, uint8_t stackCount);
 
     static const bool IS_FULL_URI = true;
     static const bool IS_ORIGIN = false;
@@ -131,9 +131,9 @@ class Predictor final : public nsINetworkPredictor,
     NS_DECL_NSICACHEENTRYOPENCALLBACK
     NS_DECL_NSICACHEENTRYMETADATAVISITOR
 
-    CacheabilityAction(nsIURI *targetURI, uint32_t httpStatus,
-                       const nsCString &method, bool isTracking, bool couldVary,
-                       bool isNoStore, Predictor *predictor)
+    CacheabilityAction(nsIURI* targetURI, uint32_t httpStatus,
+                       const nsCString& method, bool isTracking, bool couldVary,
+                       bool isNoStore, Predictor* predictor)
         : mTargetURI(targetURI),
           mHttpStatus(httpStatus),
           mMethod(method),
@@ -165,7 +165,7 @@ class Predictor final : public nsINetworkPredictor,
     NS_DECL_NSICACHEENTRYMETADATAVISITOR
     NS_DECL_NSICACHESTORAGEVISITOR
 
-    explicit Resetter(Predictor *predictor);
+    explicit Resetter(Predictor* predictor);
 
    private:
     virtual ~Resetter() = default;
@@ -184,15 +184,15 @@ class Predictor final : public nsINetworkPredictor,
     NS_DECL_ISUPPORTS
     NS_DECL_NSICACHEENTRYMETADATAVISITOR
 
-    explicit SpaceCleaner(Predictor *predictor)
+    explicit SpaceCleaner(Predictor* predictor)
         : mLRUStamp(0), mLRUKeyToDelete(nullptr), mPredictor(predictor) {}
 
-    void Finalize(nsICacheEntry *entry);
+    void Finalize(nsICacheEntry* entry);
 
    private:
     virtual ~SpaceCleaner() = default;
     uint32_t mLRUStamp;
-    const char *mLRUKeyToDelete;
+    const char* mLRUKeyToDelete;
     nsTArray mLongKeysToDelete;
     RefPtr mPredictor;
   };
@@ -203,8 +203,8 @@ class Predictor final : public nsINetworkPredictor,
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
 
-    PrefetchListener(nsINetworkPredictorVerifier *verifier, nsIURI *uri,
-                     Predictor *predictor)
+    PrefetchListener(nsINetworkPredictorVerifier* verifier, nsIURI* uri,
+                     Predictor* predictor)
         : mVerifier(verifier), mURI(uri), mPredictor(predictor) {}
 
    private:
@@ -238,9 +238,9 @@ class Predictor final : public nsINetworkPredictor,
   //   * verifier - used for testing to verify the expected predictions happen
   //   * stackCount - used to ensure we don't recurse too far trying to find the
   //                  final redirection in a redirect chain
-  bool PredictInternal(PredictorPredictReason reason, nsICacheEntry *entry,
-                       bool isNew, bool fullUri, nsIURI *targetURI,
-                       nsINetworkPredictorVerifier *verifier,
+  bool PredictInternal(PredictorPredictReason reason, nsICacheEntry* entry,
+                       bool isNew, bool fullUri, nsIURI* targetURI,
+                       nsINetworkPredictorVerifier* verifier,
                        uint8_t stackCount);
 
   // Used when predicting because the user's mouse hovered over a link
@@ -248,22 +248,22 @@ class Predictor final : public nsINetworkPredictor,
   //   * sourceURI - the URI of the page on which the link appears
   //   * originAttributes - the originAttributes for this prediction
   //   * verifier - used for testing to verify the expected predictions happen
-  void PredictForLink(nsIURI *targetURI, nsIURI *sourceURI,
-                      const OriginAttributes &originAttributes,
-                      nsINetworkPredictorVerifier *verifier);
+  void PredictForLink(nsIURI* targetURI, nsIURI* sourceURI,
+                      const OriginAttributes& originAttributes,
+                      nsINetworkPredictorVerifier* verifier);
 
   // Used when predicting because a page is being loaded (which may include
   // being the target of a redirect). All arguments are the same as for
   // PredictInternal. Returns true if any predictions were queued up.
-  bool PredictForPageload(nsICacheEntry *entry, nsIURI *targetURI,
+  bool PredictForPageload(nsICacheEntry* entry, nsIURI* targetURI,
                           uint8_t stackCount, bool fullUri,
-                          nsINetworkPredictorVerifier *verifier);
+                          nsINetworkPredictorVerifier* verifier);
 
   // Used when predicting pages that will be used near browser startup. All
   // arguments are the same as for PredictInternal. Returns true if any
   // predictions were queued up.
-  bool PredictForStartup(nsICacheEntry *entry, bool fullUri,
-                         nsINetworkPredictorVerifier *verifier);
+  bool PredictForStartup(nsICacheEntry* entry, bool fullUri,
+                         nsINetworkPredictorVerifier* verifier);
 
   // Utilities related to prediction
 
@@ -275,8 +275,8 @@ class Predictor final : public nsINetworkPredictor,
   //   * key - metadata key that we will update on entry
   //   * hitCount - part of the metadata we need to preserve
   //   * lastHit - part of the metadata we need to preserve
-  void UpdateRollingLoadCount(nsICacheEntry *entry, const uint32_t flags,
-                              const char *key, const uint32_t hitCount,
+  void UpdateRollingLoadCount(nsICacheEntry* entry, const uint32_t flags,
+                              const char* key, const uint32_t hitCount,
                               const uint32_t lastHit);
 
   // Used to calculate how much to degrade our confidence for all resources
@@ -309,7 +309,7 @@ class Predictor final : public nsINetworkPredictor,
   //   * gloablDegradation - value calculated by CalculateGlobalDegradation for
   //                         this page
   //   * fullUri - whether we're predicting for a full URI or origin-only
-  void CalculatePredictions(nsICacheEntry *entry, nsIURI *referrer,
+  void CalculatePredictions(nsICacheEntry* entry, nsIURI* referrer,
                             uint32_t lastLoad, uint32_t loadCount,
                             int32_t globalDegradation, bool fullUri);
 
@@ -327,7 +327,7 @@ class Predictor final : public nsINetworkPredictor,
   //   * confidence - value calculated by CalculateConfidence for this resource
   //   * flags - the flags taken from the resource
   //   * uri - the ascii spec of the URI of the resource
-  void SetupPrediction(int32_t confidence, uint32_t flags, const nsCString &uri,
+  void SetupPrediction(int32_t confidence, uint32_t flags, const nsCString& uri,
                        PrefetchIgnoreReason reason);
 
   // Used to kick off a prefetch from RunPredictions if necessary
@@ -335,18 +335,18 @@ class Predictor final : public nsINetworkPredictor,
   //   * referrer - the URI of the referring page
   //   * originAttributes - the originAttributes of this prefetch
   //   * verifier - used for testing to ensure the expected prefetch happens
-  nsresult Prefetch(nsIURI *uri, nsIURI *referrer,
-                    const OriginAttributes &originAttributes,
-                    nsINetworkPredictorVerifier *verifier);
+  nsresult Prefetch(nsIURI* uri, nsIURI* referrer,
+                    const OriginAttributes& originAttributes,
+                    nsINetworkPredictorVerifier* verifier);
 
   // Used to actually perform any predictions set up via SetupPrediction.
   // Returns true if any predictions were performed.
   //   * referrer - the URI we are predicting from
   //   * originAttributs - the originAttributes we are predicting from
   //   * verifier - used for testing to ensure the expected predictions happen
-  bool RunPredictions(nsIURI *referrer,
-                      const OriginAttributes &originAttributes,
-                      nsINetworkPredictorVerifier *verifier);
+  bool RunPredictions(nsIURI* referrer,
+                      const OriginAttributes& originAttributes,
+                      nsINetworkPredictorVerifier* verifier);
 
   // Used to guess whether a page will redirect to another page or not. Returns
   // true if a redirection is likely.
@@ -357,9 +357,9 @@ class Predictor final : public nsINetworkPredictor,
   //                         this page
   //   * redirectURI - if this returns true, the URI that is likely to be
   //                   redirected to, otherwise null
-  bool WouldRedirect(nsICacheEntry *entry, uint32_t loadCount,
+  bool WouldRedirect(nsICacheEntry* entry, uint32_t loadCount,
                      uint32_t lastLoad, int32_t globalDegradation,
-                     nsIURI **redirectURI);
+                     nsIURI** redirectURI);
 
   // The guts of learning information
 
@@ -374,19 +374,19 @@ class Predictor final : public nsINetworkPredictor,
   //                 resource loaded by a page the user navigated to
   //   * sourceURI - the URI that caused targetURI to be loaded, usually the
   //                 page the user navigated to
-  void LearnInternal(PredictorLearnReason reason, nsICacheEntry *entry,
-                     bool isNew, bool fullUri, nsIURI *targetURI,
-                     nsIURI *sourceURI);
+  void LearnInternal(PredictorLearnReason reason, nsICacheEntry* entry,
+                     bool isNew, bool fullUri, nsIURI* targetURI,
+                     nsIURI* sourceURI);
 
   // Used when learning about a resource loaded by a page
   //   * entry - the cache entry with information that needs updating
   //   * targetURI - the URI of the resource that was loaded by the page
-  void LearnForSubresource(nsICacheEntry *entry, nsIURI *targetURI);
+  void LearnForSubresource(nsICacheEntry* entry, nsIURI* targetURI);
 
   // Used when learning about a redirect from one page to another
   //   * entry - the cache entry of the page that was redirected from
   //   * targetURI - the URI of the redirect target
-  void LearnForRedirect(nsICacheEntry *entry, nsIURI *targetURI);
+  void LearnForRedirect(nsICacheEntry* entry, nsIURI* targetURI);
 
   // Used to learn about pages loaded close to browser startup. This results in
   // LearnForStartup being called if we are, in fact, near browser startup
@@ -394,14 +394,14 @@ class Predictor final : public nsINetworkPredictor,
   //           browser startup)
   //   * fullUri - true if this is a full page uri, false if it's an origin
   //   * originAttributes - the originAttributes for this learning.
-  void MaybeLearnForStartup(nsIURI *uri, bool fullUri,
-                            const OriginAttributes &originAttributes);
+  void MaybeLearnForStartup(nsIURI* uri, bool fullUri,
+                            const OriginAttributes& originAttributes);
 
   // Used in conjunction with MaybeLearnForStartup to learn about pages loaded
   // close to browser startup
   //   * entry - the cache entry that stores the startup page list
   //   * targetURI - the URI of a page that was loaded near browser startup
-  void LearnForStartup(nsICacheEntry *entry, nsIURI *targetURI);
+  void LearnForStartup(nsICacheEntry* entry, nsIURI* targetURI);
 
   // Used to parse the data we store in cache metadata
   //   * key - the cache metadata key
@@ -410,16 +410,16 @@ class Predictor final : public nsINetworkPredictor,
   //   * hitCount - (out) the number of times this URI has been seen
   //   * lastHit - (out) timestamp of the last time this URI was seen
   //   * flags - (out) flags for this metadata entry
-  bool ParseMetaDataEntry(const char *key, const char *value, nsCString &uri,
-                          uint32_t &hitCount, uint32_t &lastHit,
-                          uint32_t &flags);
+  bool ParseMetaDataEntry(const char* key, const char* value, nsCString& uri,
+                          uint32_t& hitCount, uint32_t& lastHit,
+                          uint32_t& flags);
 
   // Used to update whether a particular URI was cacheable or not.
   // sourceURI and targetURI are the same as the arguments to Learn
   // and httpStatus is the status code we got while loading targetURI.
-  void UpdateCacheabilityInternal(nsIURI *sourceURI, nsIURI *targetURI,
-                                  uint32_t httpStatus, const nsCString &method,
-                                  const OriginAttributes &originAttributes,
+  void UpdateCacheabilityInternal(nsIURI* sourceURI, nsIURI* targetURI,
+                                  uint32_t httpStatus, const nsCString& method,
+                                  const OriginAttributes& originAttributes,
                                   bool isTracking, bool couldVary,
                                   bool isNoStore);
 
@@ -453,7 +453,7 @@ class Predictor final : public nsINetworkPredictor,
   nsTArray> mPreconnects;
   nsTArray> mPreresolves;
 
-  static Predictor *sSelf;
+  static Predictor* sSelf;
 };
 
 }  // namespace net
diff --git a/netwerk/base/ProxyAutoConfig.cpp b/netwerk/base/ProxyAutoConfig.cpp
index 6e0950042b854..6469c0a626972 100644
--- a/netwerk/base/ProxyAutoConfig.cpp
+++ b/netwerk/base/ProxyAutoConfig.cpp
@@ -277,12 +277,12 @@ static const char sAsciiPacUtils[] =
 // Javascript engine is running and the PAC object cannot be deleted
 // or reset.
 static uint32_t sRunningIndex = 0xdeadbeef;
-static ProxyAutoConfig *GetRunning() {
+static ProxyAutoConfig* GetRunning() {
   MOZ_ASSERT(sRunningIndex != 0xdeadbeef);
-  return static_cast(PR_GetThreadPrivate(sRunningIndex));
+  return static_cast(PR_GetThreadPrivate(sRunningIndex));
 }
 
-static void SetRunning(ProxyAutoConfig *arg) {
+static void SetRunning(ProxyAutoConfig* arg) {
   MOZ_ASSERT(sRunningIndex != 0xdeadbeef);
   PR_SetThreadPrivate(sRunningIndex, arg);
 }
@@ -294,11 +294,11 @@ class PACResolver final : public nsIDNSListener,
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  explicit PACResolver(nsIEventTarget *aTarget)
+  explicit PACResolver(nsIEventTarget* aTarget)
       : mStatus(NS_ERROR_FAILURE), mMainThreadEventTarget(aTarget) {}
 
   // nsIDNSListener
-  NS_IMETHOD OnLookupComplete(nsICancelable *request, nsIDNSRecord *record,
+  NS_IMETHOD OnLookupComplete(nsICancelable* request, nsIDNSRecord* record,
                               nsresult status) override {
     if (mTimer) {
       mTimer->Cancel();
@@ -311,14 +311,14 @@ class PACResolver final : public nsIDNSListener,
     return NS_OK;
   }
 
-  NS_IMETHOD OnLookupByTypeComplete(nsICancelable *request,
-                                    nsIDNSByTypeRecord *res,
+  NS_IMETHOD OnLookupByTypeComplete(nsICancelable* request,
+                                    nsIDNSByTypeRecord* res,
                                     nsresult status) override {
     return NS_OK;
   }
 
   // nsITimerCallback
-  NS_IMETHOD Notify(nsITimer *timer) override {
+  NS_IMETHOD Notify(nsITimer* timer) override {
     nsCOMPtr request(mRequest);
     if (request) request->Cancel(NS_ERROR_NET_TIMEOUT);
     mTimer = nullptr;
@@ -326,7 +326,7 @@ class PACResolver final : public nsIDNSListener,
   }
 
   // nsINamed
-  NS_IMETHOD GetName(nsACString &aName) override {
+  NS_IMETHOD GetName(nsACString& aName) override {
     aName.AssignLiteral("PACResolver");
     return NS_OK;
   }
@@ -342,7 +342,7 @@ class PACResolver final : public nsIDNSListener,
 };
 NS_IMPL_ISUPPORTS(PACResolver, nsIDNSListener, nsITimerCallback, nsINamed)
 
-static void PACLogToConsole(nsString &aMessage) {
+static void PACLogToConsole(nsString& aMessage) {
   nsCOMPtr consoleService =
       do_GetService(NS_CONSOLESERVICE_CONTRACTID);
   if (!consoleService) return;
@@ -351,8 +351,8 @@ static void PACLogToConsole(nsString &aMessage) {
 }
 
 // Javascript errors and warnings are logged to the main error console
-static void PACLogErrorOrWarning(const nsAString &aKind,
-                                 JSErrorReport *aReport) {
+static void PACLogErrorOrWarning(const nsAString& aKind,
+                                 JSErrorReport* aReport) {
   nsString formattedMessage(NS_LITERAL_STRING("PAC Execution "));
   formattedMessage += aKind;
   formattedMessage += NS_LITERAL_STRING(": ");
@@ -364,7 +364,7 @@ static void PACLogErrorOrWarning(const nsAString &aKind,
   PACLogToConsole(formattedMessage);
 }
 
-static void PACWarningReporter(JSContext *aCx, JSErrorReport *aReport) {
+static void PACWarningReporter(JSContext* aCx, JSErrorReport* aReport) {
   MOZ_ASSERT(aReport);
   MOZ_ASSERT(JSREPORT_IS_WARNING(aReport->flags));
 
@@ -372,10 +372,10 @@ static void PACWarningReporter(JSContext *aCx, JSErrorReport *aReport) {
 }
 
 class MOZ_STACK_CLASS AutoPACErrorReporter {
-  JSContext *mCx;
+  JSContext* mCx;
 
  public:
-  explicit AutoPACErrorReporter(JSContext *aCx) : mCx(aCx) {}
+  explicit AutoPACErrorReporter(JSContext* aCx) : mCx(aCx) {}
   ~AutoPACErrorReporter() {
     if (!JS_IsExceptionPending(mCx)) {
       return;
@@ -398,7 +398,7 @@ class MOZ_STACK_CLASS AutoPACErrorReporter {
 
 // timeout of 0 means the normal necko timeout strategy, otherwise the dns
 // request will be canceled after aTimeout milliseconds
-static bool PACResolve(const nsCString &aHostName, NetAddr *aNetAddr,
+static bool PACResolve(const nsCString& aHostName, NetAddr* aNetAddr,
                        unsigned int aTimeout) {
   if (!GetRunning()) {
     NS_WARNING("PACResolve without a running ProxyAutoConfig object");
@@ -417,8 +417,8 @@ ProxyAutoConfig::ProxyAutoConfig()
   MOZ_COUNT_CTOR(ProxyAutoConfig);
 }
 
-bool ProxyAutoConfig::ResolveAddress(const nsCString &aHostName,
-                                     NetAddr *aNetAddr, unsigned int aTimeout) {
+bool ProxyAutoConfig::ResolveAddress(const nsCString& aHostName,
+                                     NetAddr* aNetAddr, unsigned int aTimeout) {
   nsCOMPtr dns = do_GetService(NS_DNSSERVICE_CONTRACTID);
   if (!dns) return false;
 
@@ -461,8 +461,8 @@ bool ProxyAutoConfig::ResolveAddress(const nsCString &aHostName,
   return true;
 }
 
-static bool PACResolveToString(const nsCString &aHostName,
-                               nsCString &aDottedDecimal,
+static bool PACResolveToString(const nsCString& aHostName,
+                               nsCString& aDottedDecimal,
                                unsigned int aTimeout) {
   NetAddr netAddr;
   if (!PACResolve(aHostName, &netAddr, aTimeout)) return false;
@@ -476,7 +476,7 @@ static bool PACResolveToString(const nsCString &aHostName,
 }
 
 // dnsResolve(host) javascript implementation
-static bool PACDnsResolve(JSContext *cx, unsigned int argc, JS::Value *vp) {
+static bool PACDnsResolve(JSContext* cx, unsigned int argc, JS::Value* vp) {
   JS::CallArgs args = CallArgsFromVp(argc, vp);
 
   if (NS_IsMainThread()) {
@@ -486,7 +486,7 @@ static bool PACDnsResolve(JSContext *cx, unsigned int argc, JS::Value *vp) {
 
   if (!args.requireAtLeast(cx, "dnsResolve", 1)) return false;
 
-  JS::Rooted arg1(cx, JS::ToString(cx, args[0]));
+  JS::Rooted arg1(cx, JS::ToString(cx, args[0]));
   if (!arg1) return false;
 
   nsAutoJSString hostName;
@@ -494,7 +494,7 @@ static bool PACDnsResolve(JSContext *cx, unsigned int argc, JS::Value *vp) {
 
   if (!hostName.init(cx, arg1)) return false;
   if (PACResolveToString(NS_ConvertUTF16toUTF8(hostName), dottedDecimal, 0)) {
-    JSString *dottedDecimalString = JS_NewStringCopyZ(cx, dottedDecimal.get());
+    JSString* dottedDecimalString = JS_NewStringCopyZ(cx, dottedDecimal.get());
     if (!dottedDecimalString) {
       return false;
     }
@@ -508,7 +508,7 @@ static bool PACDnsResolve(JSContext *cx, unsigned int argc, JS::Value *vp) {
 }
 
 // myIpAddress() javascript implementation
-static bool PACMyIpAddress(JSContext *cx, unsigned int argc, JS::Value *vp) {
+static bool PACMyIpAddress(JSContext* cx, unsigned int argc, JS::Value* vp) {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 
   if (NS_IsMainThread()) {
@@ -525,12 +525,12 @@ static bool PACMyIpAddress(JSContext *cx, unsigned int argc, JS::Value *vp) {
 }
 
 // proxyAlert(msg) javascript implementation
-static bool PACProxyAlert(JSContext *cx, unsigned int argc, JS::Value *vp) {
+static bool PACProxyAlert(JSContext* cx, unsigned int argc, JS::Value* vp) {
   JS::CallArgs args = CallArgsFromVp(argc, vp);
 
   if (!args.requireAtLeast(cx, "alert", 1)) return false;
 
-  JS::Rooted arg1(cx, JS::ToString(cx, args[0]));
+  JS::Rooted arg1(cx, JS::ToString(cx, args[0]));
   if (!arg1) return false;
 
   nsAutoJSString message;
@@ -557,11 +557,11 @@ static const JSFunctionSpec PACGlobalFunctions[] = {
 // used on the PAC thread. It is initialized and destroyed on the PAC thread.
 class JSContextWrapper {
  public:
-  static JSContextWrapper *Create(uint32_t aExtraHeapSize) {
-    JSContext *cx = JS_NewContext(sContextHeapSize + aExtraHeapSize);
+  static JSContextWrapper* Create(uint32_t aExtraHeapSize) {
+    JSContext* cx = JS_NewContext(sContextHeapSize + aExtraHeapSize);
     if (NS_WARN_IF(!cx)) return nullptr;
 
-    JSContextWrapper *entry = new JSContextWrapper(cx);
+    JSContextWrapper* entry = new JSContextWrapper(cx);
     if (NS_FAILED(entry->Init())) {
       delete entry;
       return nullptr;
@@ -570,9 +570,9 @@ class JSContextWrapper {
     return entry;
   }
 
-  JSContext *Context() const { return mContext; }
+  JSContext* Context() const { return mContext; }
 
-  JSObject *Global() const { return mGlobal; }
+  JSObject* Global() const { return mGlobal; }
 
   ~JSContextWrapper() {
     mGlobal = nullptr;
@@ -591,13 +591,13 @@ class JSContextWrapper {
  private:
   static const uint32_t sContextHeapSize = 4 << 20;  // 4 MB
 
-  JSContext *mContext;
-  JS::PersistentRooted mGlobal;
+  JSContext* mContext;
+  JS::PersistentRooted mGlobal;
   bool mOK;
 
   static const JSClass sGlobalClass;
 
-  explicit JSContextWrapper(JSContext *cx)
+  explicit JSContextWrapper(JSContext* cx)
       : mContext(cx), mGlobal(cx, nullptr), mOK(false) {
     MOZ_COUNT_CTOR(JSContextWrapper);
   }
@@ -623,7 +623,7 @@ class JSContextWrapper {
       JS_ClearPendingException(mContext);
       return NS_ERROR_OUT_OF_MEMORY;
     }
-    JS::Rooted global(mContext, mGlobal);
+    JS::Rooted global(mContext, mGlobal);
 
     JSAutoRealm ar(mContext, global);
     AutoPACErrorReporter aper(mContext);
@@ -645,10 +645,10 @@ void ProxyAutoConfig::SetThreadLocalIndex(uint32_t index) {
   sRunningIndex = index;
 }
 
-nsresult ProxyAutoConfig::Init(const nsCString &aPACURI,
-                               const nsCString &aPACScriptData,
+nsresult ProxyAutoConfig::Init(const nsCString& aPACURI,
+                               const nsCString& aPACScriptData,
                                bool aIncludePath, uint32_t aExtraHeapSize,
-                               nsIEventTarget *aEventTarget) {
+                               nsIEventTarget* aEventTarget) {
   mShutdown = false;  // Shutdown needs to be called prior to destruction
 
   mPACURI = aPACURI;
@@ -692,7 +692,7 @@ nsresult ProxyAutoConfig::SetupJS() {
   mJSContext = JSContextWrapper::Create(mExtraHeapSize);
   if (!mJSContext) return NS_ERROR_FAILURE;
 
-  JSContext *cx = mJSContext->Context();
+  JSContext* cx = mJSContext->Context();
   JSAutoRealm ar(cx, mJSContext->Global());
   AutoPACErrorReporter aper(cx);
 
@@ -704,15 +704,15 @@ nsresult ProxyAutoConfig::SetupJS() {
 
   SetRunning(this);
 
-  JS::Rooted global(cx, mJSContext->Global());
+  JS::Rooted global(cx, mJSContext->Global());
 
-  auto CompilePACScript = [this](JSContext *cx) -> JSScript * {
+  auto CompilePACScript = [this](JSContext* cx) -> JSScript* {
     JS::CompileOptions options(cx);
     options.setFileAndLine(this->mPACURI.get(), 1);
 
     // Per ProxyAutoConfig::Init, compile as UTF-8 if the full data is UTF-8,
     // and otherwise inflate Latin-1 to UTF-16 and compile that.
-    const char *scriptData = this->mConcatenatedPACData.get();
+    const char* scriptData = this->mConcatenatedPACData.get();
     size_t scriptLength = this->mConcatenatedPACData.Length();
     if (mozilla::IsValidUtf8(scriptData, scriptLength)) {
       JS::SourceText srcBuf;
@@ -737,7 +737,7 @@ nsresult ProxyAutoConfig::SetupJS() {
     return JS::Compile(cx, options, source);
   };
 
-  JS::Rooted script(cx, CompilePACScript(cx));
+  JS::Rooted script(cx, CompilePACScript(cx));
   if (!script || !JS_ExecuteScript(cx, script)) {
     nsString alertMessage(
         NS_LITERAL_STRING("PAC file failed to install from "));
@@ -768,14 +768,14 @@ nsresult ProxyAutoConfig::SetupJS() {
   return NS_OK;
 }
 
-nsresult ProxyAutoConfig::GetProxyForURI(const nsCString &aTestURI,
-                                         const nsCString &aTestHost,
-                                         nsACString &result) {
+nsresult ProxyAutoConfig::GetProxyForURI(const nsCString& aTestURI,
+                                         const nsCString& aTestHost,
+                                         nsACString& result) {
   if (mJSNeedsSetup) SetupJS();
 
   if (!mJSContext || !mJSContext->IsOK()) return NS_ERROR_NOT_AVAILABLE;
 
-  JSContext *cx = mJSContext->Context();
+  JSContext* cx = mJSContext->Context();
   JSAutoRealm ar(cx, mJSContext->Global());
   AutoPACErrorReporter aper(cx);
 
@@ -819,7 +819,7 @@ nsresult ProxyAutoConfig::GetProxyForURI(const nsCString &aTestURI,
     args[1].setString(hostString);
 
     JS::Rooted rval(cx);
-    JS::Rooted global(cx, mJSContext->Global());
+    JS::Rooted global(cx, mJSContext->Global());
     bool ok = JS_CallFunctionName(cx, global, "FindProxyForURL", args, &rval);
 
     if (ok && rval.isString()) {
@@ -863,9 +863,9 @@ void ProxyAutoConfig::Shutdown() {
   mJSContext = nullptr;
 }
 
-bool ProxyAutoConfig::SrcAddress(const NetAddr *remoteAddress,
-                                 nsCString &localAddress) {
-  PRFileDesc *fd;
+bool ProxyAutoConfig::SrcAddress(const NetAddr* remoteAddress,
+                                 nsCString& localAddress) {
+  PRFileDesc* fd;
   fd = PR_OpenUDPSocket(remoteAddress->raw.family);
   if (!fd) return false;
 
@@ -898,19 +898,19 @@ bool ProxyAutoConfig::SrcAddress(const NetAddr *remoteAddress,
 // to the result. If that all works, the local IP address of the socket is
 // returned to the javascript caller and |*aResult| is set to true. Otherwise
 // |*aResult| is set to false.
-bool ProxyAutoConfig::MyIPAddressTryHost(const nsCString &hostName,
+bool ProxyAutoConfig::MyIPAddressTryHost(const nsCString& hostName,
                                          unsigned int timeout,
-                                         const JS::CallArgs &aArgs,
-                                         bool *aResult) {
+                                         const JS::CallArgs& aArgs,
+                                         bool* aResult) {
   *aResult = false;
 
   NetAddr remoteAddress;
   nsAutoCString localDottedDecimal;
-  JSContext *cx = mJSContext->Context();
+  JSContext* cx = mJSContext->Context();
 
   if (PACResolve(hostName, &remoteAddress, timeout) &&
       SrcAddress(&remoteAddress, localDottedDecimal)) {
-    JSString *dottedDecimalString =
+    JSString* dottedDecimalString =
         JS_NewStringCopyZ(cx, localDottedDecimal.get());
     if (!dottedDecimalString) {
       return false;
@@ -922,12 +922,12 @@ bool ProxyAutoConfig::MyIPAddressTryHost(const nsCString &hostName,
   return true;
 }
 
-bool ProxyAutoConfig::MyIPAddress(const JS::CallArgs &aArgs) {
+bool ProxyAutoConfig::MyIPAddress(const JS::CallArgs& aArgs) {
   nsAutoCString remoteDottedDecimal;
   nsAutoCString localDottedDecimal;
-  JSContext *cx = mJSContext->Context();
+  JSContext* cx = mJSContext->Context();
   JS::RootedValue v(cx);
-  JS::Rooted global(cx, mJSContext->Global());
+  JS::Rooted global(cx, mJSContext->Global());
 
   bool useMultihomedDNS =
       JS_GetProperty(cx, global, "pacUseMultihomedDNS", &v) &&
@@ -971,7 +971,7 @@ bool ProxyAutoConfig::MyIPAddress(const JS::CallArgs &aArgs) {
   uint32_t timeout = useMultihomedDNS ? kTimeout : 1;
   if (dns && NS_SUCCEEDED(dns->GetMyHostName(hostName)) &&
       PACResolveToString(hostName, localDottedDecimal, timeout)) {
-    JSString *dottedDecimalString =
+    JSString* dottedDecimalString =
         JS_NewStringCopyZ(cx, localDottedDecimal.get());
     if (!dottedDecimalString) {
       return false;
@@ -998,7 +998,7 @@ bool ProxyAutoConfig::MyIPAddress(const JS::CallArgs &aArgs) {
 
   // who knows? let's fallback to localhost
   localDottedDecimal.AssignLiteral("127.0.0.1");
-  JSString *dottedDecimalString =
+  JSString* dottedDecimalString =
       JS_NewStringCopyZ(cx, localDottedDecimal.get());
   if (!dottedDecimalString) {
     return false;
diff --git a/netwerk/base/ProxyAutoConfig.h b/netwerk/base/ProxyAutoConfig.h
index 191d789227fb8..33f7c8c85d6c7 100644
--- a/netwerk/base/ProxyAutoConfig.h
+++ b/netwerk/base/ProxyAutoConfig.h
@@ -31,14 +31,14 @@ class ProxyAutoConfig {
   ProxyAutoConfig();
   ~ProxyAutoConfig();
 
-  nsresult Init(const nsCString &aPACURI, const nsCString &aPACScriptData,
+  nsresult Init(const nsCString& aPACURI, const nsCString& aPACScriptData,
                 bool aIncludePath, uint32_t aExtraHeapSize,
-                nsIEventTarget *aEventTarget);
+                nsIEventTarget* aEventTarget);
   void SetThreadLocalIndex(uint32_t index);
   void Shutdown();
   void GC();
-  bool MyIPAddress(const JS::CallArgs &aArgs);
-  bool ResolveAddress(const nsCString &aHostName, NetAddr *aNetAddr,
+  bool MyIPAddress(const JS::CallArgs& aArgs);
+  bool ResolveAddress(const nsCString& aHostName, NetAddr* aNetAddr,
                       unsigned int aTimeout);
 
   /**
@@ -75,8 +75,8 @@ class ProxyAutoConfig {
    * @param result
    *        result string as defined above.
    */
-  nsresult GetProxyForURI(const nsCString &aTestURI, const nsCString &aTestHost,
-                          nsACString &result);
+  nsresult GetProxyForURI(const nsCString& aTestURI, const nsCString& aTestHost,
+                          nsACString& result);
 
  private:
   // allow 665ms for myipaddress dns queries. That's 95th percentile.
@@ -85,11 +85,11 @@ class ProxyAutoConfig {
   // used to compile the PAC file and setup the execution context
   nsresult SetupJS();
 
-  bool SrcAddress(const NetAddr *remoteAddress, nsCString &localAddress);
-  bool MyIPAddressTryHost(const nsCString &hostName, unsigned int timeout,
-                          const JS::CallArgs &aArgs, bool *aResult);
+  bool SrcAddress(const NetAddr* remoteAddress, nsCString& localAddress);
+  bool MyIPAddressTryHost(const nsCString& hostName, unsigned int timeout,
+                          const JS::CallArgs& aArgs, bool* aResult);
 
-  JSContextWrapper *mJSContext;
+  JSContextWrapper* mJSContext;
   bool mJSNeedsSetup;
   bool mShutdown;
   nsCString mConcatenatedPACData;
diff --git a/netwerk/base/RedirectChannelRegistrar.cpp b/netwerk/base/RedirectChannelRegistrar.cpp
index 64f45bb64a81d..18052df7f93c7 100644
--- a/netwerk/base/RedirectChannelRegistrar.cpp
+++ b/netwerk/base/RedirectChannelRegistrar.cpp
@@ -38,8 +38,8 @@ void RedirectChannelRegistrar::Shutdown() {
 }
 
 NS_IMETHODIMP
-RedirectChannelRegistrar::RegisterChannel(nsIChannel *channel,
-                                          uint32_t *_retval) {
+RedirectChannelRegistrar::RegisterChannel(nsIChannel* channel,
+                                          uint32_t* _retval) {
   MutexAutoLock lock(mLock);
 
   mRealChannels.Put(mId, channel);
@@ -55,7 +55,7 @@ RedirectChannelRegistrar::RegisterChannel(nsIChannel *channel,
 
 NS_IMETHODIMP
 RedirectChannelRegistrar::GetRegisteredChannel(uint32_t id,
-                                               nsIChannel **_retval) {
+                                               nsIChannel** _retval) {
   MutexAutoLock lock(mLock);
 
   if (!mRealChannels.Get(id, _retval)) return NS_ERROR_NOT_AVAILABLE;
@@ -64,8 +64,8 @@ RedirectChannelRegistrar::GetRegisteredChannel(uint32_t id,
 }
 
 NS_IMETHODIMP
-RedirectChannelRegistrar::LinkChannels(uint32_t id, nsIParentChannel *channel,
-                                       nsIChannel **_retval) {
+RedirectChannelRegistrar::LinkChannels(uint32_t id, nsIParentChannel* channel,
+                                       nsIChannel** _retval) {
   MutexAutoLock lock(mLock);
 
   if (!mRealChannels.Get(id, _retval)) return NS_ERROR_NOT_AVAILABLE;
@@ -76,7 +76,7 @@ RedirectChannelRegistrar::LinkChannels(uint32_t id, nsIParentChannel *channel,
 
 NS_IMETHODIMP
 RedirectChannelRegistrar::GetParentChannel(uint32_t id,
-                                           nsIParentChannel **_retval) {
+                                           nsIParentChannel** _retval) {
   MutexAutoLock lock(mLock);
 
   if (!mParentChannels.Get(id, _retval)) return NS_ERROR_NOT_AVAILABLE;
diff --git a/netwerk/base/RequestContextService.cpp b/netwerk/base/RequestContextService.cpp
index 01e43496f8d8f..365087884e194 100644
--- a/netwerk/base/RequestContextService.cpp
+++ b/netwerk/base/RequestContextService.cpp
@@ -55,7 +55,7 @@ class RequestContext final : public nsIRequestContext, public nsITimerCallback {
   // Reschedules the timer if needed
   void ScheduleUnblock();
   // Hard-reschedules the timer
-  void RescheduleUntailTimer(TimeStamp const &now);
+  void RescheduleUntailTimer(TimeStamp const& now);
 
   uint64_t mID;
   Atomic mBlockingTransactionCount;
@@ -155,7 +155,7 @@ RequestContext::DOMContentLoaded() {
 
 NS_IMETHODIMP
 RequestContext::GetBlockingTransactionCount(
-    uint32_t *aBlockingTransactionCount) {
+    uint32_t* aBlockingTransactionCount) {
   NS_ENSURE_ARG_POINTER(aBlockingTransactionCount);
   *aBlockingTransactionCount = mBlockingTransactionCount;
   return NS_OK;
@@ -170,7 +170,7 @@ RequestContext::AddBlockingTransaction() {
 }
 
 NS_IMETHODIMP
-RequestContext::RemoveBlockingTransaction(uint32_t *outval) {
+RequestContext::RemoveBlockingTransaction(uint32_t* outval) {
   NS_ENSURE_ARG_POINTER(outval);
   mBlockingTransactionCount--;
   LOG(("RequestContext::RemoveBlockingTransaction this=%p blockers=%u", this,
@@ -179,20 +179,20 @@ RequestContext::RemoveBlockingTransaction(uint32_t *outval) {
   return NS_OK;
 }
 
-SpdyPushCache *RequestContext::GetSpdyPushCache() { return mSpdyCache; }
+SpdyPushCache* RequestContext::GetSpdyPushCache() { return mSpdyCache; }
 
-void RequestContext::SetSpdyPushCache(SpdyPushCache *aSpdyPushCache) {
+void RequestContext::SetSpdyPushCache(SpdyPushCache* aSpdyPushCache) {
   mSpdyCache = aSpdyPushCache;
 }
 
 uint64_t RequestContext::GetID() { return mID; }
 
-const nsACString &RequestContext::GetUserAgentOverride() {
+const nsACString& RequestContext::GetUserAgentOverride() {
   return mUserAgentOverride;
 }
 
 void RequestContext::SetUserAgentOverride(
-    const nsACString &aUserAgentOverride) {
+    const nsACString& aUserAgentOverride) {
   mUserAgentOverride = aUserAgentOverride;
 }
 
@@ -278,7 +278,7 @@ void RequestContext::ScheduleUnblock() {
   }
 }
 
-void RequestContext::RescheduleUntailTimer(TimeStamp const &now) {
+void RequestContext::RescheduleUntailTimer(TimeStamp const& now) {
   MOZ_ASSERT(mUntailAt >= now);
 
   if (mUntailTimer) {
@@ -311,7 +311,7 @@ void RequestContext::RescheduleUntailTimer(TimeStamp const &now) {
 }
 
 NS_IMETHODIMP
-RequestContext::Notify(nsITimer *timer) {
+RequestContext::Notify(nsITimer* timer) {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(timer == mUntailTimer);
   MOZ_ASSERT(!mTimerScheduledAt.IsNull());
@@ -335,8 +335,8 @@ RequestContext::Notify(nsITimer *timer) {
 }
 
 NS_IMETHODIMP
-RequestContext::IsContextTailBlocked(nsIRequestTailUnblockCallback *aRequest,
-                                     bool *aBlocked) {
+RequestContext::IsContextTailBlocked(nsIRequestTailUnblockCallback* aRequest,
+                                     bool* aBlocked) {
   MOZ_ASSERT(NS_IsMainThread());
 
   LOG(("RequestContext::IsContextTailBlocked this=%p, request=%p, queued=%zu",
@@ -377,7 +377,7 @@ RequestContext::IsContextTailBlocked(nsIRequestTailUnblockCallback *aRequest,
 }
 
 NS_IMETHODIMP
-RequestContext::CancelTailedRequest(nsIRequestTailUnblockCallback *aRequest) {
+RequestContext::CancelTailedRequest(nsIRequestTailUnblockCallback* aRequest) {
   MOZ_ASSERT(NS_IsMainThread());
 
   bool removed = mTailQueue.RemoveElement(aRequest);
@@ -414,7 +414,7 @@ void RequestContext::ProcessTailQueue(nsresult aResult) {
   nsTArray queue;
   queue.SwapElements(mTailQueue);
 
-  for (const auto &request : queue) {
+  for (const auto& request : queue) {
     LOG(("  untailing %p", request.get()));
     request->OnTailUnblock(aResult);
   }
@@ -430,7 +430,7 @@ RequestContext::CancelTailPendingRequests(nsresult aResult) {
 }
 
 // nsIRequestContextService
-RequestContextService *RequestContextService::sSelf = nullptr;
+RequestContextService* RequestContextService::sSelf = nullptr;
 
 NS_IMPL_ISUPPORTS(RequestContextService, nsIRequestContextService, nsIObserver)
 
@@ -503,7 +503,7 @@ RequestContextService::GetOrCreate() {
 
 NS_IMETHODIMP
 RequestContextService::GetRequestContext(const uint64_t rcID,
-                                         nsIRequestContext **rc) {
+                                         nsIRequestContext** rc) {
   MOZ_ASSERT(NS_IsMainThread());
   NS_ENSURE_ARG_POINTER(rc);
   *rc = nullptr;
@@ -522,8 +522,8 @@ RequestContextService::GetRequestContext(const uint64_t rcID,
 }
 
 NS_IMETHODIMP
-RequestContextService::GetRequestContextFromLoadGroup(nsILoadGroup *aLoadGroup,
-                                                      nsIRequestContext **rc) {
+RequestContextService::GetRequestContextFromLoadGroup(nsILoadGroup* aLoadGroup,
+                                                      nsIRequestContext** rc) {
   nsresult rv;
 
   uint64_t rcID;
@@ -536,7 +536,7 @@ RequestContextService::GetRequestContextFromLoadGroup(nsILoadGroup *aLoadGroup,
 }
 
 NS_IMETHODIMP
-RequestContextService::NewRequestContext(nsIRequestContext **rc) {
+RequestContextService::NewRequestContext(nsIRequestContext** rc) {
   MOZ_ASSERT(NS_IsMainThread());
   NS_ENSURE_ARG_POINTER(rc);
   *rc = nullptr;
@@ -568,8 +568,8 @@ RequestContextService::RemoveRequestContext(const uint64_t rcID) {
 }
 
 NS_IMETHODIMP
-RequestContextService::Observe(nsISupports *subject, const char *topic,
-                               const char16_t *data_unicode) {
+RequestContextService::Observe(nsISupports* subject, const char* topic,
+                               const char16_t* data_unicode) {
   MOZ_ASSERT(NS_IsMainThread());
   if (!strcmp(NS_XPCOM_SHUTDOWN_OBSERVER_ID, topic)) {
     Shutdown();
@@ -584,7 +584,7 @@ RequestContextService::Observe(nsISupports *subject, const char *topic,
     if (!document) {
       return NS_OK;
     }
-    nsIDocShell *ds = document->GetDocShell();
+    nsIDocShell* ds = document->GetDocShell();
     // XML documents don't always have a docshell assigned
     if (!ds) {
       return NS_OK;
diff --git a/netwerk/base/RequestContextService.h b/netwerk/base/RequestContextService.h
index 81fe63427d82c..e862969ff183f 100644
--- a/netwerk/base/RequestContextService.h
+++ b/netwerk/base/RequestContextService.h
@@ -31,7 +31,7 @@ class RequestContextService final : public nsIRequestContextService,
   nsresult Init();
   void Shutdown();
 
-  static RequestContextService *sSelf;
+  static RequestContextService* sSelf;
 
   nsInterfaceHashtable mTable;
   uint32_t mRCIDNamespace;
diff --git a/netwerk/base/ShutdownLayer.cpp b/netwerk/base/ShutdownLayer.cpp
index d8fd4e7f9f7a4..db62ea691d23e 100644
--- a/netwerk/base/ShutdownLayer.cpp
+++ b/netwerk/base/ShutdownLayer.cpp
@@ -13,7 +13,7 @@
 
 static PRDescIdentity sWinSockShutdownLayerIdentity;
 static PRIOMethods sWinSockShutdownLayerMethods;
-static PRIOMethods *sWinSockShutdownLayerMethodsPtr = nullptr;
+static PRIOMethods* sWinSockShutdownLayerMethodsPtr = nullptr;
 
 namespace mozilla {
 namespace net {
@@ -23,7 +23,7 @@ extern PRDescIdentity nsNamedPipeLayerIdentity;
 }  // namespace net
 }  // namespace mozilla
 
-PRStatus WinSockClose(PRFileDesc *aFd) {
+PRStatus WinSockClose(PRFileDesc* aFd) {
   MOZ_RELEASE_ASSERT(aFd->identity == sWinSockShutdownLayerIdentity,
                      "Windows shutdown layer not on the top of the stack");
 
@@ -41,7 +41,7 @@ PRStatus WinSockClose(PRFileDesc *aFd) {
   }
 }
 
-nsresult mozilla::net::AttachShutdownLayer(PRFileDesc *aFd) {
+nsresult mozilla::net::AttachShutdownLayer(PRFileDesc* aFd) {
   if (!sWinSockShutdownLayerMethodsPtr) {
     sWinSockShutdownLayerIdentity =
         PR_GetUniqueIdentity("windows shutdown call layer");
@@ -57,7 +57,7 @@ nsresult mozilla::net::AttachShutdownLayer(PRFileDesc *aFd) {
     return NS_OK;
   }
 
-  PRFileDesc *layer;
+  PRFileDesc* layer;
   PRStatus status;
 
   layer = PR_CreateIOLayerStub(sWinSockShutdownLayerIdentity,
diff --git a/netwerk/base/ShutdownLayer.h b/netwerk/base/ShutdownLayer.h
index 9c2804a730108..2bf68fdcdc9f8 100644
--- a/netwerk/base/ShutdownLayer.h
+++ b/netwerk/base/ShutdownLayer.h
@@ -15,7 +15,7 @@ namespace net {
 
 // This is only for windows. This layer will be attached jus before PR_CLose
 // is call and it will only call shutdown(sock).
-extern nsresult AttachShutdownLayer(PRFileDesc *fd);
+extern nsresult AttachShutdownLayer(PRFileDesc* fd);
 
 }  // namespace net
 }  // namespace mozilla
diff --git a/netwerk/base/SimpleBuffer.cpp b/netwerk/base/SimpleBuffer.cpp
index 204ee07bdc110..1791a34b5990b 100644
--- a/netwerk/base/SimpleBuffer.cpp
+++ b/netwerk/base/SimpleBuffer.cpp
@@ -12,14 +12,14 @@ namespace net {
 
 SimpleBuffer::SimpleBuffer() : mStatus(NS_OK), mAvailable(0) {}
 
-nsresult SimpleBuffer::Write(char *src, size_t len) {
+nsresult SimpleBuffer::Write(char* src, size_t len) {
   NS_ASSERT_OWNINGTHREAD(SimpleBuffer);
   if (NS_FAILED(mStatus)) {
     return mStatus;
   }
 
   while (len > 0) {
-    SimpleBufferPage *p = mBufferList.getLast();
+    SimpleBufferPage* p = mBufferList.getLast();
     if (p && (p->mWriteOffset == SimpleBufferPage::kSimpleBufferPageSize)) {
       // no room.. make a new page
       p = nullptr;
@@ -44,14 +44,14 @@ nsresult SimpleBuffer::Write(char *src, size_t len) {
   return NS_OK;
 }
 
-size_t SimpleBuffer::Read(char *dest, size_t maxLen) {
+size_t SimpleBuffer::Read(char* dest, size_t maxLen) {
   NS_ASSERT_OWNINGTHREAD(SimpleBuffer);
   if (NS_FAILED(mStatus)) {
     return 0;
   }
 
   size_t rv = 0;
-  for (SimpleBufferPage *p = mBufferList.getFirst(); p && (rv < maxLen);
+  for (SimpleBufferPage* p = mBufferList.getFirst(); p && (rv < maxLen);
        p = mBufferList.getFirst()) {
     size_t avail = p->mWriteOffset - p->mReadOffset;
     size_t toRead = std::min(avail, (maxLen - rv));
@@ -76,7 +76,7 @@ size_t SimpleBuffer::Available() {
 
 void SimpleBuffer::Clear() {
   NS_ASSERT_OWNINGTHREAD(SimpleBuffer);
-  SimpleBufferPage *p;
+  SimpleBufferPage* p;
   while ((p = mBufferList.popFirst())) {
     delete p;
   }
diff --git a/netwerk/base/SimpleBuffer.h b/netwerk/base/SimpleBuffer.h
index 75de27596cb77..9d2cd28461797 100644
--- a/netwerk/base/SimpleBuffer.h
+++ b/netwerk/base/SimpleBuffer.h
@@ -37,8 +37,8 @@ class SimpleBuffer {
   SimpleBuffer();
   ~SimpleBuffer() = default;
 
-  nsresult Write(char *stc, size_t len);   // return OK or OUT_OF_MEMORY
-  size_t Read(char *dest, size_t maxLen);  // return bytes read
+  nsresult Write(char* stc, size_t len);   // return OK or OUT_OF_MEMORY
+  size_t Read(char* dest, size_t maxLen);  // return bytes read
   size_t Available();
   void Clear();
 
diff --git a/netwerk/base/TCPFastOpenLayer.cpp b/netwerk/base/TCPFastOpenLayer.cpp
index bf5d8277f4688..ea5e5f11d6314 100644
--- a/netwerk/base/TCPFastOpenLayer.cpp
+++ b/netwerk/base/TCPFastOpenLayer.cpp
@@ -14,7 +14,7 @@ namespace net {
 
 static PRDescIdentity sTCPFastOpenLayerIdentity;
 static PRIOMethods sTCPFastOpenLayerMethods;
-static PRIOMethods *sTCPFastOpenLayerMethodsPtr = nullptr;
+static PRIOMethods* sTCPFastOpenLayerMethodsPtr = nullptr;
 
 #define TFO_MAX_PACKET_SIZE_IPV4 1460
 #define TFO_MAX_PACKET_SIZE_IPV6 1440
@@ -79,12 +79,12 @@ class TCPFastOpenSecret {
   PRErrorCode mCondition;
 };
 
-static PRStatus TCPFastOpenConnect(PRFileDesc *fd, const PRNetAddr *addr,
+static PRStatus TCPFastOpenConnect(PRFileDesc* fd, const PRNetAddr* addr,
                                    PRIntervalTime timeout) {
   MOZ_RELEASE_ASSERT(fd->identity == sTCPFastOpenLayerIdentity);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
-  TCPFastOpenSecret *secret = reinterpret_cast(fd->secret);
+  TCPFastOpenSecret* secret = reinterpret_cast(fd->secret);
 
   SOCKET_LOG(("TCPFastOpenConnect state=%d.\n", secret->mState));
 
@@ -100,12 +100,12 @@ static PRStatus TCPFastOpenConnect(PRFileDesc *fd, const PRNetAddr *addr,
   return PR_SUCCESS;
 }
 
-static PRInt32 TCPFastOpenSend(PRFileDesc *fd, const void *buf, PRInt32 amount,
+static PRInt32 TCPFastOpenSend(PRFileDesc* fd, const void* buf, PRInt32 amount,
                                PRIntn flags, PRIntervalTime timeout) {
   MOZ_RELEASE_ASSERT(fd->identity == sTCPFastOpenLayerIdentity);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
-  TCPFastOpenSecret *secret = reinterpret_cast(fd->secret);
+  TCPFastOpenSecret* secret = reinterpret_cast(fd->secret);
 
   SOCKET_LOG(("TCPFastOpenSend state=%d.\n", secret->mState));
 
@@ -172,16 +172,16 @@ static PRInt32 TCPFastOpenSend(PRFileDesc *fd, const void *buf, PRInt32 amount,
   return PR_FAILURE;
 }
 
-static PRInt32 TCPFastOpenWrite(PRFileDesc *fd, const void *buf,
+static PRInt32 TCPFastOpenWrite(PRFileDesc* fd, const void* buf,
                                 PRInt32 amount) {
   return TCPFastOpenSend(fd, buf, amount, 0, PR_INTERVAL_NO_WAIT);
 }
 
-static PRInt32 TCPFastOpenRecv(PRFileDesc *fd, void *buf, PRInt32 amount,
+static PRInt32 TCPFastOpenRecv(PRFileDesc* fd, void* buf, PRInt32 amount,
                                PRIntn flags, PRIntervalTime timeout) {
   MOZ_RELEASE_ASSERT(fd->identity == sTCPFastOpenLayerIdentity);
 
-  TCPFastOpenSecret *secret = reinterpret_cast(fd->secret);
+  TCPFastOpenSecret* secret = reinterpret_cast(fd->secret);
 
   PRInt32 rv = -1;
   switch (secret->mState) {
@@ -223,14 +223,14 @@ static PRInt32 TCPFastOpenRecv(PRFileDesc *fd, void *buf, PRInt32 amount,
   return rv;
 }
 
-static PRInt32 TCPFastOpenRead(PRFileDesc *fd, void *buf, PRInt32 amount) {
+static PRInt32 TCPFastOpenRead(PRFileDesc* fd, void* buf, PRInt32 amount) {
   return TCPFastOpenRecv(fd, buf, amount, 0, PR_INTERVAL_NO_WAIT);
 }
 
-static PRStatus TCPFastOpenConnectContinue(PRFileDesc *fd, PRInt16 out_flags) {
+static PRStatus TCPFastOpenConnectContinue(PRFileDesc* fd, PRInt16 out_flags) {
   MOZ_RELEASE_ASSERT(fd->identity == sTCPFastOpenLayerIdentity);
 
-  TCPFastOpenSecret *secret = reinterpret_cast(fd->secret);
+  TCPFastOpenSecret* secret = reinterpret_cast(fd->secret);
 
   PRStatus rv = PR_FAILURE;
   switch (secret->mState) {
@@ -255,31 +255,31 @@ static PRStatus TCPFastOpenConnectContinue(PRFileDesc *fd, PRInt16 out_flags) {
   return rv;
 }
 
-static PRStatus TCPFastOpenClose(PRFileDesc *fd) {
+static PRStatus TCPFastOpenClose(PRFileDesc* fd) {
   if (!fd) {
     return PR_FAILURE;
   }
 
-  PRFileDesc *layer = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
+  PRFileDesc* layer = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
 
   MOZ_RELEASE_ASSERT(layer && layer->identity == sTCPFastOpenLayerIdentity,
                      "TCP Fast Open Layer not on top of stack");
 
-  TCPFastOpenSecret *secret =
-      reinterpret_cast(layer->secret);
+  TCPFastOpenSecret* secret =
+      reinterpret_cast(layer->secret);
   layer->secret = nullptr;
   layer->dtor(layer);
   delete secret;
   return fd->methods->close(fd);
 }
 
-static PRStatus TCPFastOpenGetpeername(PRFileDesc *fd, PRNetAddr *addr) {
+static PRStatus TCPFastOpenGetpeername(PRFileDesc* fd, PRNetAddr* addr) {
   MOZ_RELEASE_ASSERT(fd);
   MOZ_RELEASE_ASSERT(addr);
 
   MOZ_RELEASE_ASSERT(fd->identity == sTCPFastOpenLayerIdentity);
 
-  TCPFastOpenSecret *secret = reinterpret_cast(fd->secret);
+  TCPFastOpenSecret* secret = reinterpret_cast(fd->secret);
   if (secret->mState == TCPFastOpenSecret::WAITING_FOR_CONNECT) {
     PR_SetError(PR_NOT_CONNECTED_ERROR, 0);
     return PR_FAILURE;
@@ -289,12 +289,12 @@ static PRStatus TCPFastOpenGetpeername(PRFileDesc *fd, PRNetAddr *addr) {
   return PR_SUCCESS;
 }
 
-static PRInt16 TCPFastOpenPoll(PRFileDesc *fd, PRInt16 how_flags,
-                               PRInt16 *p_out_flags) {
+static PRInt16 TCPFastOpenPoll(PRFileDesc* fd, PRInt16 how_flags,
+                               PRInt16* p_out_flags) {
   MOZ_RELEASE_ASSERT(fd);
   MOZ_RELEASE_ASSERT(fd->identity == sTCPFastOpenLayerIdentity);
 
-  TCPFastOpenSecret *secret = reinterpret_cast(fd->secret);
+  TCPFastOpenSecret* secret = reinterpret_cast(fd->secret);
   if (secret->mFirstPacketBufLen) {
     how_flags |= PR_POLL_WRITE;
   }
@@ -302,7 +302,7 @@ static PRInt16 TCPFastOpenPoll(PRFileDesc *fd, PRInt16 how_flags,
   return fd->lower->methods->poll(fd->lower, how_flags, p_out_flags);
 }
 
-nsresult AttachTCPFastOpenIOLayer(PRFileDesc *fd) {
+nsresult AttachTCPFastOpenIOLayer(PRFileDesc* fd) {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
   if (!sTCPFastOpenLayerMethodsPtr) {
@@ -320,16 +320,16 @@ nsresult AttachTCPFastOpenIOLayer(PRFileDesc *fd) {
     sTCPFastOpenLayerMethodsPtr = &sTCPFastOpenLayerMethods;
   }
 
-  PRFileDesc *layer = PR_CreateIOLayerStub(sTCPFastOpenLayerIdentity,
+  PRFileDesc* layer = PR_CreateIOLayerStub(sTCPFastOpenLayerIdentity,
                                            sTCPFastOpenLayerMethodsPtr);
 
   if (!layer) {
     return NS_ERROR_FAILURE;
   }
 
-  TCPFastOpenSecret *secret = new TCPFastOpenSecret();
+  TCPFastOpenSecret* secret = new TCPFastOpenSecret();
 
-  layer->secret = reinterpret_cast(secret);
+  layer->secret = reinterpret_cast(secret);
 
   PRStatus status = PR_PushIOLayer(fd, PR_NSPR_IO_LAYER, layer);
 
@@ -341,14 +341,14 @@ nsresult AttachTCPFastOpenIOLayer(PRFileDesc *fd) {
   return NS_OK;
 }
 
-void TCPFastOpenFinish(PRFileDesc *fd, PRErrorCode &err,
-                       bool &fastOpenNotSupported, uint8_t &tfoStatus) {
-  PRFileDesc *tfoFd = PR_GetIdentitiesLayer(fd, sTCPFastOpenLayerIdentity);
+void TCPFastOpenFinish(PRFileDesc* fd, PRErrorCode& err,
+                       bool& fastOpenNotSupported, uint8_t& tfoStatus) {
+  PRFileDesc* tfoFd = PR_GetIdentitiesLayer(fd, sTCPFastOpenLayerIdentity);
   MOZ_RELEASE_ASSERT(tfoFd);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
-  TCPFastOpenSecret *secret =
-      reinterpret_cast(tfoFd->secret);
+  TCPFastOpenSecret* secret =
+      reinterpret_cast(tfoFd->secret);
 
   MOZ_ASSERT(secret->mState ==
              TCPFastOpenSecret::COLLECT_DATA_FOR_FIRST_PACKET);
@@ -448,13 +448,13 @@ void TCPFastOpenFinish(PRFileDesc *fd, PRErrorCode &err,
  * tls-early-data can be rejected and than we still need to send the rest of the
  * record.
  */
-int32_t TCPFastOpenGetBufferSizeLeft(PRFileDesc *fd) {
-  PRFileDesc *tfoFd = PR_GetIdentitiesLayer(fd, sTCPFastOpenLayerIdentity);
+int32_t TCPFastOpenGetBufferSizeLeft(PRFileDesc* fd) {
+  PRFileDesc* tfoFd = PR_GetIdentitiesLayer(fd, sTCPFastOpenLayerIdentity);
   MOZ_RELEASE_ASSERT(tfoFd);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
-  TCPFastOpenSecret *secret =
-      reinterpret_cast(tfoFd->secret);
+  TCPFastOpenSecret* secret =
+      reinterpret_cast(tfoFd->secret);
 
   if (secret->mState != TCPFastOpenSecret::COLLECT_DATA_FOR_FIRST_PACKET) {
     return 0;
@@ -473,24 +473,24 @@ int32_t TCPFastOpenGetBufferSizeLeft(PRFileDesc *fd) {
              : 0;
 }
 
-bool TCPFastOpenGetCurrentBufferSize(PRFileDesc *fd) {
-  PRFileDesc *tfoFd = PR_GetIdentitiesLayer(fd, sTCPFastOpenLayerIdentity);
+bool TCPFastOpenGetCurrentBufferSize(PRFileDesc* fd) {
+  PRFileDesc* tfoFd = PR_GetIdentitiesLayer(fd, sTCPFastOpenLayerIdentity);
   MOZ_RELEASE_ASSERT(tfoFd);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
-  TCPFastOpenSecret *secret =
-      reinterpret_cast(tfoFd->secret);
+  TCPFastOpenSecret* secret =
+      reinterpret_cast(tfoFd->secret);
 
   return secret->mFirstPacketBufLen;
 }
 
-bool TCPFastOpenFlushBuffer(PRFileDesc *fd) {
-  PRFileDesc *tfoFd = PR_GetIdentitiesLayer(fd, sTCPFastOpenLayerIdentity);
+bool TCPFastOpenFlushBuffer(PRFileDesc* fd) {
+  PRFileDesc* tfoFd = PR_GetIdentitiesLayer(fd, sTCPFastOpenLayerIdentity);
   MOZ_RELEASE_ASSERT(tfoFd);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
-  TCPFastOpenSecret *secret =
-      reinterpret_cast(tfoFd->secret);
+  TCPFastOpenSecret* secret =
+      reinterpret_cast(tfoFd->secret);
   MOZ_ASSERT(secret->mState == TCPFastOpenSecret::CONNECTED);
 
   if (secret->mFirstPacketBufLen) {
diff --git a/netwerk/base/TCPFastOpenLayer.h b/netwerk/base/TCPFastOpenLayer.h
index 9b80ba339a1e0..597615cabef5c 100644
--- a/netwerk/base/TCPFastOpenLayer.h
+++ b/netwerk/base/TCPFastOpenLayer.h
@@ -78,16 +78,16 @@ typedef enum {
   TFO_HTTP  // TFO is disabled for non-secure connections.
 } TFOResult;
 
-nsresult AttachTCPFastOpenIOLayer(PRFileDesc *fd);
+nsresult AttachTCPFastOpenIOLayer(PRFileDesc* fd);
 
 // Get the result of TCP Fast Open.
-void TCPFastOpenFinish(PRFileDesc *fd, PRErrorCode &err,
-                       bool &fastOpenNotSupported, uint8_t &tfoStatus);
+void TCPFastOpenFinish(PRFileDesc* fd, PRErrorCode& err,
+                       bool& fastOpenNotSupported, uint8_t& tfoStatus);
 
-int32_t TCPFastOpenGetBufferSizeLeft(PRFileDesc *fd);
+int32_t TCPFastOpenGetBufferSizeLeft(PRFileDesc* fd);
 
-bool TCPFastOpenGetCurrentBufferSize(PRFileDesc *fd);
-bool TCPFastOpenFlushBuffer(PRFileDesc *fd);
+bool TCPFastOpenGetCurrentBufferSize(PRFileDesc* fd);
+bool TCPFastOpenFlushBuffer(PRFileDesc* fd);
 }  // namespace net
 }  // namespace mozilla
 
diff --git a/netwerk/base/Tickler.cpp b/netwerk/base/Tickler.cpp
index 2ae30f3c933c8..8f67035c72c99 100644
--- a/netwerk/base/Tickler.cpp
+++ b/netwerk/base/Tickler.cpp
@@ -175,12 +175,12 @@ class TicklerTimer final : public nsITimerCallback, public nsINamed {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
 
-  explicit TicklerTimer(Tickler *aTickler) {
+  explicit TicklerTimer(Tickler* aTickler) {
     mTickler = do_GetWeakReference(aTickler);
   }
 
   // nsINamed
-  NS_IMETHOD GetName(nsACString &aName) override {
+  NS_IMETHOD GetName(nsACString& aName) override {
     aName.AssignLiteral("TicklerTimer");
     return NS_OK;
   }
@@ -211,7 +211,7 @@ void Tickler::SetIPV4Port(uint16_t port) { mAddr.inet.port = port; }
 
 NS_IMPL_ISUPPORTS(TicklerTimer, nsITimerCallback, nsINamed)
 
-NS_IMETHODIMP TicklerTimer::Notify(nsITimer *timer) {
+NS_IMETHODIMP TicklerTimer::Notify(nsITimer* timer) {
   RefPtr tickler = do_QueryReferent(mTickler);
   if (!tickler) return NS_ERROR_FAILURE;
   MutexAutoLock lock(tickler->mLock);
diff --git a/netwerk/base/nsASocketHandler.h b/netwerk/base/nsASocketHandler.h
index cd476cc034044..95c847cdb064e 100644
--- a/netwerk/base/nsASocketHandler.h
+++ b/netwerk/base/nsASocketHandler.h
@@ -52,7 +52,7 @@ class nsASocketHandler : public nsISupports {
   //   outFlags  - value of PR_PollDesc::out_flags after PR_Poll returns
   //               or -1 if a timeout occurred
   //
-  virtual void OnSocketReady(PRFileDesc *fd, int16_t outFlags) = 0;
+  virtual void OnSocketReady(PRFileDesc* fd, int16_t outFlags) = 0;
 
   //
   // called when a socket is no longer under the control of the socket
@@ -60,21 +60,21 @@ class nsASocketHandler : public nsISupports {
   // point.  after this call returns, the handler will no longer be owned
   // by the socket transport service.
   //
-  virtual void OnSocketDetached(PRFileDesc *fd) = 0;
+  virtual void OnSocketDetached(PRFileDesc* fd) = 0;
 
   //
   // called to determine if the socket is for a local peer.
   // when used for server sockets, indicates if it only accepts local
   // connections.
   //
-  virtual void IsLocal(bool *aIsLocal) = 0;
+  virtual void IsLocal(bool* aIsLocal) = 0;
 
   //
   // called to determine if this socket should not be terminated when Gecko
   // is turned offline. This is mostly useful for the debugging server
   // socket.
   //
-  virtual void KeepWhenOffline(bool *aKeepWhenOffline) {
+  virtual void KeepWhenOffline(bool* aKeepWhenOffline) {
     *aKeepWhenOffline = false;
   }
 
diff --git a/netwerk/base/nsAsyncStreamCopier.cpp b/netwerk/base/nsAsyncStreamCopier.cpp
index ff425a8e3acb5..faa4c5f09a994 100644
--- a/netwerk/base/nsAsyncStreamCopier.cpp
+++ b/netwerk/base/nsAsyncStreamCopier.cpp
@@ -32,7 +32,7 @@ class AsyncApplyBufferingPolicyEvent final : public Runnable {
    * @param aCopier
    *        The nsAsyncStreamCopier requesting the information.
    */
-  explicit AsyncApplyBufferingPolicyEvent(nsAsyncStreamCopier *aCopier)
+  explicit AsyncApplyBufferingPolicyEvent(nsAsyncStreamCopier* aCopier)
       : mozilla::Runnable("AsyncApplyBufferingPolicyEvent"),
         mCopier(aCopier),
         mTarget(GetCurrentThreadEventTarget()) {}
@@ -79,14 +79,14 @@ nsAsyncStreamCopier::~nsAsyncStreamCopier() {
   LOG(("Destroying nsAsyncStreamCopier @%p\n", this));
 }
 
-bool nsAsyncStreamCopier::IsComplete(nsresult *status) {
+bool nsAsyncStreamCopier::IsComplete(nsresult* status) {
   MutexAutoLock lock(mLock);
   if (status) *status = mStatus;
   return !mIsPending;
 }
 
-nsIRequest *nsAsyncStreamCopier::AsRequest() {
-  return static_cast(static_cast(this));
+nsIRequest* nsAsyncStreamCopier::AsRequest() {
+  return static_cast(static_cast(this));
 }
 
 void nsAsyncStreamCopier::Complete(nsresult status) {
@@ -116,10 +116,9 @@ void nsAsyncStreamCopier::Complete(nsresult status) {
   }
 }
 
-void nsAsyncStreamCopier::OnAsyncCopyComplete(void *closure, nsresult status) {
+void nsAsyncStreamCopier::OnAsyncCopyComplete(void* closure, nsresult status) {
   // AddRef'd in AsyncCopy. Will be released at the end of the method.
-  RefPtr self =
-      dont_AddRef((nsAsyncStreamCopier *)closure);
+  RefPtr self = dont_AddRef((nsAsyncStreamCopier*)closure);
   self->Complete(status);
 }
 
@@ -146,19 +145,19 @@ NS_INTERFACE_TABLE_TAIL
 // nsIRequest
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::GetName(nsACString &name) {
+nsAsyncStreamCopier::GetName(nsACString& name) {
   name.Truncate();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::IsPending(bool *result) {
+nsAsyncStreamCopier::IsPending(bool* result) {
   *result = !IsComplete();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::GetStatus(nsresult *status) {
+nsAsyncStreamCopier::GetStatus(nsresult* status) {
   IsComplete(status);
   return NS_OK;
 }
@@ -195,7 +194,7 @@ nsAsyncStreamCopier::Resume() {
 }
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::GetLoadFlags(nsLoadFlags *aLoadFlags) {
+nsAsyncStreamCopier::GetLoadFlags(nsLoadFlags* aLoadFlags) {
   *aLoadFlags = LOAD_NORMAL;
   return NS_OK;
 }
@@ -204,17 +203,17 @@ NS_IMETHODIMP
 nsAsyncStreamCopier::SetLoadFlags(nsLoadFlags aLoadFlags) { return NS_OK; }
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::GetLoadGroup(nsILoadGroup **aLoadGroup) {
+nsAsyncStreamCopier::GetLoadGroup(nsILoadGroup** aLoadGroup) {
   *aLoadGroup = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::SetLoadGroup(nsILoadGroup *aLoadGroup) { return NS_OK; }
+nsAsyncStreamCopier::SetLoadGroup(nsILoadGroup* aLoadGroup) { return NS_OK; }
 
-nsresult nsAsyncStreamCopier::InitInternal(nsIInputStream *source,
-                                           nsIOutputStream *sink,
-                                           nsIEventTarget *target,
+nsresult nsAsyncStreamCopier::InitInternal(nsIInputStream* source,
+                                           nsIOutputStream* sink,
+                                           nsIEventTarget* target,
                                            uint32_t chunkSize, bool closeSource,
                                            bool closeSink) {
   NS_ASSERTION(!mSource && !mSink, "Init() called more than once");
@@ -245,8 +244,8 @@ nsresult nsAsyncStreamCopier::InitInternal(nsIInputStream *source,
 // nsIAsyncStreamCopier
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::Init(nsIInputStream *source, nsIOutputStream *sink,
-                          nsIEventTarget *target, bool sourceBuffered,
+nsAsyncStreamCopier::Init(nsIInputStream* source, nsIOutputStream* sink,
+                          nsIEventTarget* target, bool sourceBuffered,
                           bool sinkBuffered, uint32_t chunkSize,
                           bool closeSource, bool closeSink) {
   NS_ASSERTION(sourceBuffered || sinkBuffered,
@@ -261,8 +260,8 @@ nsAsyncStreamCopier::Init(nsIInputStream *source, nsIOutputStream *sink,
 // nsIAsyncStreamCopier2
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::Init(nsIInputStream *source, nsIOutputStream *sink,
-                          nsIEventTarget *target, uint32_t chunkSize,
+nsAsyncStreamCopier::Init(nsIInputStream* source, nsIOutputStream* sink,
+                          nsIEventTarget* target, uint32_t chunkSize,
                           bool closeSource, bool closeSink) {
   mShouldSniffBuffering = true;
 
@@ -311,7 +310,7 @@ nsresult nsAsyncStreamCopier::ApplyBufferingPolicy() {
 // Both nsIAsyncStreamCopier and nsIAsyncStreamCopier2
 
 NS_IMETHODIMP
-nsAsyncStreamCopier::AsyncCopy(nsIRequestObserver *observer, nsISupports *ctx) {
+nsAsyncStreamCopier::AsyncCopy(nsIRequestObserver* observer, nsISupports* ctx) {
   LOG(("nsAsyncStreamCopier::AsyncCopy [this=%p observer=%p]\n", this,
        observer));
 
diff --git a/netwerk/base/nsAsyncStreamCopier.h b/netwerk/base/nsAsyncStreamCopier.h
index c5c575ad60d2f..fe3a15c46dc53 100644
--- a/netwerk/base/nsAsyncStreamCopier.h
+++ b/netwerk/base/nsAsyncStreamCopier.h
@@ -25,8 +25,8 @@ class nsAsyncStreamCopier final : public nsIAsyncStreamCopier,
   // nsIAsyncStreamCopier2
   // We declare it by hand instead of NS_DECL_NSIASYNCSTREAMCOPIER2
   // as nsIAsyncStreamCopier2 duplicates methods of nsIAsyncStreamCopier
-  NS_IMETHOD Init(nsIInputStream *aSource, nsIOutputStream *aSink,
-                  nsIEventTarget *aTarget, uint32_t aChunkSize,
+  NS_IMETHOD Init(nsIInputStream* aSource, nsIOutputStream* aSink,
+                  nsIEventTarget* aTarget, uint32_t aChunkSize,
                   bool aCloseSource, bool aCloseSink) override;
 
   nsAsyncStreamCopier();
@@ -34,21 +34,21 @@ class nsAsyncStreamCopier final : public nsIAsyncStreamCopier,
   //-------------------------------------------------------------------------
   // these methods may be called on any thread
 
-  bool IsComplete(nsresult *status = nullptr);
+  bool IsComplete(nsresult* status = nullptr);
   void Complete(nsresult status);
 
  private:
   virtual ~nsAsyncStreamCopier();
 
-  nsresult InitInternal(nsIInputStream *source, nsIOutputStream *sink,
-                        nsIEventTarget *target, uint32_t chunkSize,
+  nsresult InitInternal(nsIInputStream* source, nsIOutputStream* sink,
+                        nsIEventTarget* target, uint32_t chunkSize,
                         bool closeSource, bool closeSink);
 
-  static void OnAsyncCopyComplete(void *, nsresult);
+  static void OnAsyncCopyComplete(void*, nsresult);
 
   void AsyncCopyInternal();
   nsresult ApplyBufferingPolicy();
-  nsIRequest *AsRequest();
+  nsIRequest* AsRequest();
 
   nsCOMPtr mSource;
   nsCOMPtr mSink;
diff --git a/netwerk/base/nsBaseChannel.cpp b/netwerk/base/nsBaseChannel.cpp
index 1a47c0e5d9156..d8798bc5d7ac9 100644
--- a/netwerk/base/nsBaseChannel.cpp
+++ b/netwerk/base/nsBaseChannel.cpp
@@ -27,7 +27,7 @@
 // This class is used to suspend a request across a function scope.
 class ScopedRequestSuspender {
  public:
-  explicit ScopedRequestSuspender(nsIRequest *request) : mRequest(request) {
+  explicit ScopedRequestSuspender(nsIRequest* request) : mRequest(request) {
     if (mRequest && NS_FAILED(mRequest->Suspend())) {
       NS_WARNING("Couldn't suspend pump");
       mRequest = nullptr;
@@ -38,7 +38,7 @@ class ScopedRequestSuspender {
   }
 
  private:
-  nsIRequest *mRequest;
+  nsIRequest* mRequest;
 };
 
 // Used to suspend data events from mRequest within a function scope.  This is
@@ -71,7 +71,7 @@ nsBaseChannel::~nsBaseChannel() {
                                     mLoadInfo.forget());
 }
 
-nsresult nsBaseChannel::Redirect(nsIChannel *newChannel, uint32_t redirectFlags,
+nsresult nsBaseChannel::Redirect(nsIChannel* newChannel, uint32_t redirectFlags,
                                  bool openNewChannel) {
   SUSPEND_PUMP_FOR_SCOPE();
 
@@ -86,11 +86,11 @@ nsresult nsBaseChannel::Redirect(nsIChannel *newChannel, uint32_t redirectFlags,
   nsSecurityFlags secFlags =
       mLoadInfo->GetSecurityFlags() & ~nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
   nsCOMPtr newLoadInfo =
-      static_cast(mLoadInfo.get())
+      static_cast(mLoadInfo.get())
           ->CloneWithNewSecFlags(secFlags);
 
   nsCOMPtr uriPrincipal;
-  nsIScriptSecurityManager *sm = nsContentUtils::GetSecurityManager();
+  nsIScriptSecurityManager* sm = nsContentUtils::GetSecurityManager();
   sm->GetChannelURIPrincipal(this, getter_AddRefs(uriPrincipal));
   bool isInternalRedirect =
       (redirectFlags & (nsIChannelEventSink::REDIRECT_INTERNAL |
@@ -190,10 +190,10 @@ bool nsBaseChannel::HasContentTypeHint() const {
   return !mContentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE);
 }
 
-nsresult nsBaseChannel::PushStreamConverter(const char *fromType,
-                                            const char *toType,
+nsresult nsBaseChannel::PushStreamConverter(const char* fromType,
+                                            const char* toType,
                                             bool invalidatesContentLength,
-                                            nsIStreamListener **result) {
+                                            nsIStreamListener** result) {
   NS_ASSERTION(mListener, "no listener");
 
   nsresult rv;
@@ -292,7 +292,7 @@ nsresult nsBaseChannel::BeginPumpingData() {
   return NS_OK;
 }
 
-void nsBaseChannel::HandleAsyncRedirect(nsIChannel *newChannel) {
+void nsBaseChannel::HandleAsyncRedirect(nsIChannel* newChannel) {
   NS_ASSERTION(!mPumpingData, "Shouldn't have gotten here");
 
   nsresult rv = mStatus;
@@ -358,7 +358,7 @@ NS_IMPL_ISUPPORTS_INHERITED(nsBaseChannel, nsHashPropertyBag, nsIRequest,
 // nsBaseChannel::nsIRequest
 
 NS_IMETHODIMP
-nsBaseChannel::GetName(nsACString &result) {
+nsBaseChannel::GetName(nsACString& result) {
   if (!mURI) {
     result.Truncate();
     return NS_OK;
@@ -367,13 +367,13 @@ nsBaseChannel::GetName(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::IsPending(bool *result) {
+nsBaseChannel::IsPending(bool* result) {
   *result = Pending();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetStatus(nsresult *status) {
+nsBaseChannel::GetStatus(nsresult* status) {
   if (mRequest && NS_SUCCEEDED(mStatus)) {
     mRequest->GetStatus(status);
   } else {
@@ -409,7 +409,7 @@ nsBaseChannel::Resume() {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetLoadFlags(nsLoadFlags *aLoadFlags) {
+nsBaseChannel::GetLoadFlags(nsLoadFlags* aLoadFlags) {
   *aLoadFlags = mLoadFlags;
   return NS_OK;
 }
@@ -421,13 +421,13 @@ nsBaseChannel::SetLoadFlags(nsLoadFlags aLoadFlags) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) {
+nsBaseChannel::GetLoadGroup(nsILoadGroup** aLoadGroup) {
   NS_IF_ADDREF(*aLoadGroup = mLoadGroup);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) {
+nsBaseChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) {
   if (!CanSetLoadGroup(aLoadGroup)) {
     return NS_ERROR_FAILURE;
   }
@@ -442,39 +442,39 @@ nsBaseChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) {
 // nsBaseChannel::nsIChannel
 
 NS_IMETHODIMP
-nsBaseChannel::GetOriginalURI(nsIURI **aURI) {
+nsBaseChannel::GetOriginalURI(nsIURI** aURI) {
   *aURI = OriginalURI();
   NS_ADDREF(*aURI);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::SetOriginalURI(nsIURI *aURI) {
+nsBaseChannel::SetOriginalURI(nsIURI* aURI) {
   NS_ENSURE_ARG_POINTER(aURI);
   mOriginalURI = aURI;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetURI(nsIURI **aURI) {
+nsBaseChannel::GetURI(nsIURI** aURI) {
   NS_IF_ADDREF(*aURI = mURI);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetOwner(nsISupports **aOwner) {
+nsBaseChannel::GetOwner(nsISupports** aOwner) {
   NS_IF_ADDREF(*aOwner = mOwner);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::SetOwner(nsISupports *aOwner) {
+nsBaseChannel::SetOwner(nsISupports* aOwner) {
   mOwner = aOwner;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
+nsBaseChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) {
   MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null");
   mLoadInfo = aLoadInfo;
 
@@ -484,24 +484,24 @@ nsBaseChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) {
+nsBaseChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) {
   NS_IF_ADDREF(*aLoadInfo = mLoadInfo);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetIsDocument(bool *aIsDocument) {
+nsBaseChannel::GetIsDocument(bool* aIsDocument) {
   return NS_GetIsDocumentChannel(this, aIsDocument);
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks) {
+nsBaseChannel::GetNotificationCallbacks(nsIInterfaceRequestor** aCallbacks) {
   NS_IF_ADDREF(*aCallbacks = mCallbacks);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) {
+nsBaseChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aCallbacks) {
   if (!CanSetCallbacks(aCallbacks)) {
     return NS_ERROR_FAILURE;
   }
@@ -513,19 +513,19 @@ nsBaseChannel::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetSecurityInfo(nsISupports **aSecurityInfo) {
+nsBaseChannel::GetSecurityInfo(nsISupports** aSecurityInfo) {
   NS_IF_ADDREF(*aSecurityInfo = mSecurityInfo);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetContentType(nsACString &aContentType) {
+nsBaseChannel::GetContentType(nsACString& aContentType) {
   aContentType = mContentType;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::SetContentType(const nsACString &aContentType) {
+nsBaseChannel::SetContentType(const nsACString& aContentType) {
   // mContentCharset is unchanged if not parsed
   bool dummy;
   net_ParseContentType(aContentType, mContentType, mContentCharset, &dummy);
@@ -533,19 +533,19 @@ nsBaseChannel::SetContentType(const nsACString &aContentType) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetContentCharset(nsACString &aContentCharset) {
+nsBaseChannel::GetContentCharset(nsACString& aContentCharset) {
   aContentCharset = mContentCharset;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::SetContentCharset(const nsACString &aContentCharset) {
+nsBaseChannel::SetContentCharset(const nsACString& aContentCharset) {
   mContentCharset = aContentCharset;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetContentDisposition(uint32_t *aContentDisposition) {
+nsBaseChannel::GetContentDisposition(uint32_t* aContentDisposition) {
   // preserve old behavior, fail unless explicitly set.
   if (mContentDispositionHint == UINT32_MAX) {
     return NS_ERROR_NOT_AVAILABLE;
@@ -563,7 +563,7 @@ nsBaseChannel::SetContentDisposition(uint32_t aContentDisposition) {
 
 NS_IMETHODIMP
 nsBaseChannel::GetContentDispositionFilename(
-    nsAString &aContentDispositionFilename) {
+    nsAString& aContentDispositionFilename) {
   if (!mContentDispositionFilename) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -574,19 +574,19 @@ nsBaseChannel::GetContentDispositionFilename(
 
 NS_IMETHODIMP
 nsBaseChannel::SetContentDispositionFilename(
-    const nsAString &aContentDispositionFilename) {
+    const nsAString& aContentDispositionFilename) {
   mContentDispositionFilename = new nsString(aContentDispositionFilename);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsBaseChannel::GetContentDispositionHeader(
-    nsACString &aContentDispositionHeader) {
+    nsACString& aContentDispositionHeader) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetContentLength(int64_t *aContentLength) {
+nsBaseChannel::GetContentLength(int64_t* aContentLength) {
   *aContentLength = mContentLength;
   return NS_OK;
 }
@@ -598,7 +598,7 @@ nsBaseChannel::SetContentLength(int64_t aContentLength) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::Open(nsIInputStream **aStream) {
+nsBaseChannel::Open(nsIInputStream** aStream) {
   nsCOMPtr listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
@@ -627,7 +627,7 @@ nsBaseChannel::Open(nsIInputStream **aStream) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::AsyncOpen(nsIStreamListener *aListener) {
+nsBaseChannel::AsyncOpen(nsIStreamListener* aListener) {
   nsCOMPtr listener = aListener;
 
   nsresult rv =
@@ -702,7 +702,7 @@ nsBaseChannel::AsyncOpen(nsIStreamListener *aListener) {
 // nsBaseChannel::nsITransportEventSink
 
 NS_IMETHODIMP
-nsBaseChannel::OnTransportStatus(nsITransport *transport, nsresult status,
+nsBaseChannel::OnTransportStatus(nsITransport* transport, nsresult status,
                                  int64_t progress, int64_t progressMax) {
   // In some cases, we may wish to suppress transport-layer status events.
 
@@ -742,7 +742,7 @@ nsBaseChannel::OnTransportStatus(nsITransport *transport, nsresult status,
 // nsBaseChannel::nsIInterfaceRequestor
 
 NS_IMETHODIMP
-nsBaseChannel::GetInterface(const nsIID &iid, void **result) {
+nsBaseChannel::GetInterface(const nsIID& iid, void** result) {
   NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, iid, result);
   return *result ? NS_OK : NS_ERROR_NO_INTERFACE;
 }
@@ -750,9 +750,9 @@ nsBaseChannel::GetInterface(const nsIID &iid, void **result) {
 //-----------------------------------------------------------------------------
 // nsBaseChannel::nsIRequestObserver
 
-static void CallTypeSniffers(void *aClosure, const uint8_t *aData,
+static void CallTypeSniffers(void* aClosure, const uint8_t* aData,
                              uint32_t aCount) {
-  nsIChannel *chan = static_cast(aClosure);
+  nsIChannel* chan = static_cast(aClosure);
 
   nsAutoCString newType;
   NS_SniffContent(NS_CONTENT_SNIFFER_CATEGORY, chan, aData, aCount, newType);
@@ -761,9 +761,9 @@ static void CallTypeSniffers(void *aClosure, const uint8_t *aData,
   }
 }
 
-static void CallUnknownTypeSniffer(void *aClosure, const uint8_t *aData,
+static void CallUnknownTypeSniffer(void* aClosure, const uint8_t* aData,
                                    uint32_t aCount) {
-  nsIChannel *chan = static_cast(aClosure);
+  nsIChannel* chan = static_cast(aClosure);
 
   RefPtr sniffer = new nsUnknownDecoder();
 
@@ -773,7 +773,7 @@ static void CallUnknownTypeSniffer(void *aClosure, const uint8_t *aData,
 }
 
 NS_IMETHODIMP
-nsBaseChannel::OnStartRequest(nsIRequest *request) {
+nsBaseChannel::OnStartRequest(nsIRequest* request) {
   MOZ_ASSERT_IF(mRequest, request == mRequest);
 
   if (mPump) {
@@ -782,13 +782,12 @@ nsBaseChannel::OnStartRequest(nsIRequest *request) {
     // keep going as-is.
     if (NS_SUCCEEDED(mStatus) &&
         mContentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) {
-      mPump->PeekStream(CallUnknownTypeSniffer,
-                        static_cast(this));
+      mPump->PeekStream(CallUnknownTypeSniffer, static_cast(this));
     }
 
     // Now, the general type sniffers. Skip this if we have none.
     if (mLoadFlags & LOAD_CALL_CONTENT_SNIFFERS)
-      mPump->PeekStream(CallTypeSniffers, static_cast(this));
+      mPump->PeekStream(CallTypeSniffers, static_cast(this));
   }
 
   SUSPEND_PUMP_FOR_SCOPE();
@@ -799,7 +798,7 @@ nsBaseChannel::OnStartRequest(nsIRequest *request) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::OnStopRequest(nsIRequest *request, nsresult status) {
+nsBaseChannel::OnStopRequest(nsIRequest* request, nsresult status) {
   // If both mStatus and status are failure codes, we keep mStatus as-is since
   // that is consistent with our GetStatus and Cancel methods.
   if (NS_SUCCEEDED(mStatus)) mStatus = status;
@@ -829,7 +828,7 @@ nsBaseChannel::OnStopRequest(nsIRequest *request, nsresult status) {
 // nsBaseChannel::nsIStreamListener
 
 NS_IMETHODIMP
-nsBaseChannel::OnDataAvailable(nsIRequest *request, nsIInputStream *stream,
+nsBaseChannel::OnDataAvailable(nsIRequest* request, nsIInputStream* stream,
                                uint64_t offset, uint32_t count) {
   SUSPEND_PUMP_FOR_SCOPE();
 
@@ -845,7 +844,7 @@ nsBaseChannel::OnDataAvailable(nsIRequest *request, nsIInputStream *stream,
         int64_t mContentLength;
 
        public:
-        OnTransportStatusAsyncEvent(nsBaseChannel *aChannel, int64_t aProgress,
+        OnTransportStatusAsyncEvent(nsBaseChannel* aChannel, int64_t aProgress,
                                     int64_t aContentLength)
             : mozilla::Runnable("OnTransportStatusAsyncEvent"),
               mChannel(aChannel),
@@ -882,7 +881,7 @@ nsBaseChannel::OnRedirectVerifyCallback(nsresult result) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::RetargetDeliveryTo(nsIEventTarget *aEventTarget) {
+nsBaseChannel::RetargetDeliveryTo(nsIEventTarget* aEventTarget) {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ENSURE_TRUE(mRequest, NS_ERROR_NOT_INITIALIZED);
@@ -898,7 +897,7 @@ nsBaseChannel::RetargetDeliveryTo(nsIEventTarget *aEventTarget) {
 }
 
 NS_IMETHODIMP
-nsBaseChannel::GetDeliveryTarget(nsIEventTarget **aEventTarget) {
+nsBaseChannel::GetDeliveryTarget(nsIEventTarget** aEventTarget) {
   MOZ_ASSERT(NS_IsMainThread());
 
   NS_ENSURE_TRUE(mRequest, NS_ERROR_NOT_INITIALIZED);
diff --git a/netwerk/base/nsBaseChannel.h b/netwerk/base/nsBaseChannel.h
index c815476010478..d1f0c200d6bed 100644
--- a/netwerk/base/nsBaseChannel.h
+++ b/netwerk/base/nsBaseChannel.h
@@ -92,8 +92,8 @@ class nsBaseChannel
   // That case will be treated as a redirect to the new channel.  By default
   // *channel will be set to null by the caller, so callees who don't want to
   // return one an just not touch it.
-  virtual nsresult OpenContentStream(bool async, nsIInputStream **stream,
-                                     nsIChannel **channel) = 0;
+  virtual nsresult OpenContentStream(bool async, nsIInputStream** stream,
+                                     nsIChannel** channel) = 0;
 
   // Implemented by subclass to begin pumping data for an async channel, in
   // lieu of returning a stream. If implemented, OpenContentStream will never
@@ -104,8 +104,8 @@ class nsBaseChannel
   // and at some point call OnStartRequest followed by OnStopRequest.
   // Additionally, it may provide a request object which may be used to
   // suspend, resume, and cancel the underlying request.
-  virtual nsresult BeginAsyncRead(nsIStreamListener *listener,
-                                  nsIRequest **request) {
+  virtual nsresult BeginAsyncRead(nsIStreamListener* listener,
+                                  nsIRequest** request) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
@@ -117,7 +117,7 @@ class nsBaseChannel
   // to finish prior calling OnStartRequest of the listener.  This method is
   // called right after OpenContentStream() with async == true, after the input
   // stream pump has already been called asyncRead().
-  virtual nsresult ListenerBlockingPromise(BlockingPromise **aPromise) {
+  virtual nsresult ListenerBlockingPromise(BlockingPromise** aPromise) {
     NS_ENSURE_ARG(aPromise);
     *aPromise = nullptr;
     return NS_OK;
@@ -131,7 +131,7 @@ class nsBaseChannel
   // to pass to the OnStatus method.  By default, OnStatus messages are
   // suppressed.  The status parameter passed to this method is the status value
   // from the OnTransportStatus method.
-  virtual bool GetStatusArg(nsresult status, nsString &statusArg) {
+  virtual bool GetStatusArg(nsresult status, nsString& statusArg) {
     return false;
   }
 
@@ -152,7 +152,7 @@ class nsBaseChannel
   // redirect could not be performed (no channel was opened; this channel
   // wasn't canceled.)  The redirectFlags parameter consists of the flag values
   // defined on nsIChannelEventSink.
-  nsresult Redirect(nsIChannel *newChannel, uint32_t redirectFlags,
+  nsresult Redirect(nsIChannel* newChannel, uint32_t redirectFlags,
                     bool openNewChannel);
 
   // Tests whether a type hint was set. Subclasses can use this to decide
@@ -163,20 +163,20 @@ class nsBaseChannel
 
   // The URI member should be initialized before the channel is used, and then
   // it should never be changed again until the channel is destroyed.
-  nsIURI *URI() { return mURI; }
-  void SetURI(nsIURI *uri) {
+  nsIURI* URI() { return mURI; }
+  void SetURI(nsIURI* uri) {
     NS_ASSERTION(uri, "must specify a non-null URI");
     NS_ASSERTION(!mURI, "must not modify URI");
     NS_ASSERTION(!mOriginalURI, "how did that get set so early?");
     mURI = uri;
     mOriginalURI = uri;
   }
-  nsIURI *OriginalURI() { return mOriginalURI; }
+  nsIURI* OriginalURI() { return mOriginalURI; }
 
   // The security info is a property of the transport-layer, which should be
   // assigned by the subclass.
-  nsISupports *SecurityInfo() { return mSecurityInfo; }
-  void SetSecurityInfo(nsISupports *info) { mSecurityInfo = info; }
+  nsISupports* SecurityInfo() { return mSecurityInfo; }
+  void SetSecurityInfo(nsISupports* info) { mSecurityInfo = info; }
 
   // Test the load flags
   bool HasLoadFlag(uint32_t flag) { return (mLoadFlags & flag) != 0; }
@@ -188,7 +188,7 @@ class nsBaseChannel
 
   // Helper function for querying the channel's notification callbacks.
   template 
-  void GetCallback(nsCOMPtr &result) {
+  void GetCallback(nsCOMPtr& result) {
     GetInterface(NS_GET_TEMPLATE_IID(T), getter_AddRefs(result));
   }
 
@@ -202,8 +202,8 @@ class nsBaseChannel
 
   // Some subclasses may wish to manually insert a stream listener between this
   // and the channel's listener.  The following methods make that possible.
-  void SetStreamListener(nsIStreamListener *listener) { mListener = listener; }
-  nsIStreamListener *StreamListener() { return mListener; }
+  void SetStreamListener(nsIStreamListener* listener) { mListener = listener; }
+  nsIStreamListener* StreamListener() { return mListener; }
 
   // Pushes a new stream converter in front of the channel's stream listener.
   // The fromType and toType values are passed to nsIStreamConverterService's
@@ -212,9 +212,9 @@ class nsBaseChannel
   // necessary when the converter changes the length of the resulting data
   // stream, which is almost always the case for a "stream converter" ;-)
   // This function optionally returns a reference to the new converter.
-  nsresult PushStreamConverter(const char *fromType, const char *toType,
+  nsresult PushStreamConverter(const char* fromType, const char* toType,
                                bool invalidatesContentLength = true,
-                               nsIStreamListener **converter = nullptr);
+                               nsIStreamListener** converter = nullptr);
 
  protected:
   void DisallowThreadRetargeting() { mAllowThreadRetargeting = false; }
@@ -244,7 +244,7 @@ class nsBaseChannel
 
   // Handle an async redirect callback.  This will only be called if we
   // returned success from AsyncOpen while posting a redirect runnable.
-  void HandleAsyncRedirect(nsIChannel *newChannel);
+  void HandleAsyncRedirect(nsIChannel* newChannel);
   void ContinueHandleAsyncRedirect(nsresult result);
   nsresult ContinueRedirect();
 
@@ -253,7 +253,7 @@ class nsBaseChannel
 
   class RedirectRunnable : public mozilla::Runnable {
    public:
-    RedirectRunnable(nsBaseChannel *chan, nsIChannel *newChannel)
+    RedirectRunnable(nsBaseChannel* chan, nsIChannel* newChannel)
         : mozilla::Runnable("nsBaseChannel::RedirectRunnable"),
           mChannel(chan),
           mNewChannel(newChannel) {
diff --git a/netwerk/base/nsBaseContentStream.cpp b/netwerk/base/nsBaseContentStream.cpp
index ad9323fab5960..e2d7cfc8d5b25 100644
--- a/netwerk/base/nsBaseContentStream.cpp
+++ b/netwerk/base/nsBaseContentStream.cpp
@@ -49,19 +49,19 @@ nsBaseContentStream::Close() {
 }
 
 NS_IMETHODIMP
-nsBaseContentStream::Available(uint64_t *result) {
+nsBaseContentStream::Available(uint64_t* result) {
   *result = 0;
   return mStatus;
 }
 
 NS_IMETHODIMP
-nsBaseContentStream::Read(char *buf, uint32_t count, uint32_t *result) {
+nsBaseContentStream::Read(char* buf, uint32_t count, uint32_t* result) {
   return ReadSegments(NS_CopySegmentToBuffer, buf, count, result);
 }
 
 NS_IMETHODIMP
-nsBaseContentStream::ReadSegments(nsWriteSegmentFun fun, void *closure,
-                                  uint32_t count, uint32_t *result) {
+nsBaseContentStream::ReadSegments(nsWriteSegmentFun fun, void* closure,
+                                  uint32_t count, uint32_t* result) {
   *result = 0;
 
   if (mStatus == NS_BASE_STREAM_CLOSED) return NS_OK;
@@ -73,7 +73,7 @@ nsBaseContentStream::ReadSegments(nsWriteSegmentFun fun, void *closure,
 }
 
 NS_IMETHODIMP
-nsBaseContentStream::IsNonBlocking(bool *result) {
+nsBaseContentStream::IsNonBlocking(bool* result) {
   *result = mNonBlocking;
   return NS_OK;
 }
@@ -93,9 +93,9 @@ nsBaseContentStream::CloseWithStatus(nsresult status) {
 }
 
 NS_IMETHODIMP
-nsBaseContentStream::AsyncWait(nsIInputStreamCallback *callback, uint32_t flags,
+nsBaseContentStream::AsyncWait(nsIInputStreamCallback* callback, uint32_t flags,
                                uint32_t requestedCount,
-                               nsIEventTarget *target) {
+                               nsIEventTarget* target) {
   // Our _only_ consumer is nsInputStreamPump, so we simplify things here by
   // making assumptions about how we will be called.
   NS_ASSERTION(target, "unexpected parameter");
diff --git a/netwerk/base/nsBaseContentStream.h b/netwerk/base/nsBaseContentStream.h
index 1de75e2b3123d..13a3766857c4c 100644
--- a/netwerk/base/nsBaseContentStream.h
+++ b/netwerk/base/nsBaseContentStream.h
@@ -50,7 +50,7 @@ class nsBaseContentStream : public nsIAsyncInputStream {
   bool HasPendingCallback() { return mCallback != nullptr; }
 
   // The current dispatch target (may be null) for the pending callback if any.
-  nsIEventTarget *CallbackTarget() { return mCallbackTarget; }
+  nsIEventTarget* CallbackTarget() { return mCallbackTarget; }
 
   // Called to dispatch a pending callback.  If there is no pending callback,
   // then this function does nothing.  Pass true to this function to cause the
diff --git a/netwerk/base/nsDNSPrefetch.cpp b/netwerk/base/nsDNSPrefetch.cpp
index 2d11cf71e9ec9..69325b53c2988 100644
--- a/netwerk/base/nsDNSPrefetch.cpp
+++ b/netwerk/base/nsDNSPrefetch.cpp
@@ -14,10 +14,10 @@
 #include "nsIURI.h"
 #include "mozilla/Preferences.h"
 
-static nsIDNSService *sDNSService = nullptr;
+static nsIDNSService* sDNSService = nullptr;
 static bool sESNIEnabled = false;
 
-nsresult nsDNSPrefetch::Initialize(nsIDNSService *aDNSService) {
+nsresult nsDNSPrefetch::Initialize(nsIDNSService* aDNSService) {
   NS_IF_RELEASE(sDNSService);
   sDNSService = aDNSService;
   NS_IF_ADDREF(sDNSService);
@@ -31,9 +31,9 @@ nsresult nsDNSPrefetch::Shutdown() {
   return NS_OK;
 }
 
-nsDNSPrefetch::nsDNSPrefetch(nsIURI *aURI,
-                             mozilla::OriginAttributes &aOriginAttributes,
-                             nsIDNSListener *aListener, bool storeTiming)
+nsDNSPrefetch::nsDNSPrefetch(nsIURI* aURI,
+                             mozilla::OriginAttributes& aOriginAttributes,
+                             nsIDNSListener* aListener, bool storeTiming)
     : mOriginAttributes(aOriginAttributes),
       mStoreTiming(storeTiming),
       mListener(do_GetWeakReference(aListener)) {
@@ -99,7 +99,7 @@ nsresult nsDNSPrefetch::PrefetchHigh(bool refreshDNS) {
 NS_IMPL_ISUPPORTS(nsDNSPrefetch, nsIDNSListener)
 
 NS_IMETHODIMP
-nsDNSPrefetch::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec,
+nsDNSPrefetch::OnLookupComplete(nsICancelable* request, nsIDNSRecord* rec,
                                 nsresult status) {
   MOZ_ASSERT(NS_IsMainThread(), "Expecting DNS callback on main thread.");
 
@@ -114,8 +114,8 @@ nsDNSPrefetch::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec,
 }
 
 NS_IMETHODIMP
-nsDNSPrefetch::OnLookupByTypeComplete(nsICancelable *request,
-                                      nsIDNSByTypeRecord *res,
+nsDNSPrefetch::OnLookupByTypeComplete(nsICancelable* request,
+                                      nsIDNSByTypeRecord* res,
                                       nsresult status) {
   MOZ_ASSERT(NS_IsMainThread(), "Expecting DNS callback on main thread.");
 
diff --git a/netwerk/base/nsDownloader.cpp b/netwerk/base/nsDownloader.cpp
index 97211b4d44836..038778dec3fb3 100644
--- a/netwerk/base/nsDownloader.cpp
+++ b/netwerk/base/nsDownloader.cpp
@@ -29,14 +29,14 @@ NS_IMPL_ISUPPORTS(nsDownloader, nsIDownloader, nsIStreamListener,
                   nsIRequestObserver)
 
 NS_IMETHODIMP
-nsDownloader::Init(nsIDownloadObserver *observer, nsIFile *location) {
+nsDownloader::Init(nsIDownloadObserver* observer, nsIFile* location) {
   mObserver = observer;
   mLocation = location;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDownloader::OnStartRequest(nsIRequest *request) {
+nsDownloader::OnStartRequest(nsIRequest* request) {
   nsresult rv;
   if (!mLocation) {
     nsCOMPtr location;
@@ -67,7 +67,7 @@ nsDownloader::OnStartRequest(nsIRequest *request) {
 }
 
 NS_IMETHODIMP
-nsDownloader::OnStopRequest(nsIRequest *request, nsresult status) {
+nsDownloader::OnStopRequest(nsIRequest* request, nsresult status) {
   if (mSink) {
     mSink->Close();
     mSink = nullptr;
@@ -79,11 +79,11 @@ nsDownloader::OnStopRequest(nsIRequest *request, nsresult status) {
   return NS_OK;
 }
 
-nsresult nsDownloader::ConsumeData(nsIInputStream *in, void *closure,
-                                   const char *fromRawSegment,
+nsresult nsDownloader::ConsumeData(nsIInputStream* in, void* closure,
+                                   const char* fromRawSegment,
                                    uint32_t toOffset, uint32_t count,
-                                   uint32_t *writeCount) {
-  nsDownloader *self = (nsDownloader *)closure;
+                                   uint32_t* writeCount) {
+  nsDownloader* self = (nsDownloader*)closure;
   if (self->mSink) return self->mSink->Write(fromRawSegment, count, writeCount);
 
   *writeCount = count;
@@ -91,7 +91,7 @@ nsresult nsDownloader::ConsumeData(nsIInputStream *in, void *closure,
 }
 
 NS_IMETHODIMP
-nsDownloader::OnDataAvailable(nsIRequest *request, nsIInputStream *inStr,
+nsDownloader::OnDataAvailable(nsIRequest* request, nsIInputStream* inStr,
                               uint64_t sourceOffset, uint32_t count) {
   uint32_t n;
   return inStr->ReadSegments(ConsumeData, this, count, &n);
diff --git a/netwerk/base/nsDownloader.h b/netwerk/base/nsDownloader.h
index 4060b438f5a39..1e6879d6019ee 100644
--- a/netwerk/base/nsDownloader.h
+++ b/netwerk/base/nsDownloader.h
@@ -23,9 +23,9 @@ class nsDownloader : public nsIDownloader {
  protected:
   virtual ~nsDownloader();
 
-  static nsresult ConsumeData(nsIInputStream *in, void *closure,
-                              const char *fromRawSegment, uint32_t toOffset,
-                              uint32_t count, uint32_t *writeCount);
+  static nsresult ConsumeData(nsIInputStream* in, void* closure,
+                              const char* fromRawSegment, uint32_t toOffset,
+                              uint32_t count, uint32_t* writeCount);
 
   nsCOMPtr mObserver;
   nsCOMPtr mLocation;
diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp
index 02cfedf6e4f61..59cf32f10db5d 100644
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -84,7 +84,7 @@ using mozilla::dom::ServiceWorkerDescriptor;
 
 #define MAX_RECURSION_COUNT 50
 
-nsIOService *gIOService;
+nsIOService* gIOService;
 static bool gHasWarnedUploadChannel2;
 static bool gCaptivePortalEnabled = false;
 static LazyLogModule gIOServiceLog("nsIOService");
@@ -207,7 +207,7 @@ nsIOService::nsIOService()
       mNetTearingDownStarted(0),
       mSocketProcess(nullptr) {}
 
-static const char *gCallbackPrefs[] = {
+static const char* gCallbackPrefs[] = {
     PORT_PREF_PREFIX,
     MANAGE_OFFLINE_STATUS_PREF,
     NECKO_BUFFER_CACHE_COUNT_PREF,
@@ -217,7 +217,7 @@ static const char *gCallbackPrefs[] = {
     nullptr,
 };
 
-static const char *gCallbackPrefsForSocketProcess[] = {
+static const char* gCallbackPrefsForSocketProcess[] = {
     WEBRTC_PREF_PREFIX,
     nullptr,
 };
@@ -288,7 +288,7 @@ nsresult nsIOService::InitializeCaptivePortalService() {
 
   mCaptivePortalService = do_GetService(NS_CAPTIVEPORTAL_CID);
   if (mCaptivePortalService) {
-    return static_cast(mCaptivePortalService.get())
+    return static_cast(mCaptivePortalService.get())
         ->Initialize();
   }
 
@@ -370,7 +370,7 @@ already_AddRefed nsIOService::GetInstance() {
 class SocketProcessListenerProxy : public SocketProcessHost::Listener {
  public:
   SocketProcessListenerProxy() = default;
-  void OnProcessLaunchComplete(SocketProcessHost *aHost, bool aSucceeded) {
+  void OnProcessLaunchComplete(SocketProcessHost* aHost, bool aSucceeded) {
     if (!gIOService) {
       return;
     }
@@ -378,7 +378,7 @@ class SocketProcessListenerProxy : public SocketProcessHost::Listener {
     gIOService->OnProcessLaunchComplete(aHost, aSucceeded);
   }
 
-  void OnProcessUnexpectedShutdown(SocketProcessHost *aHost) {
+  void OnProcessUnexpectedShutdown(SocketProcessHost* aHost) {
     if (!gIOService) {
       return;
     }
@@ -439,7 +439,7 @@ bool nsIOService::SocketProcessReady() {
   return mSocketProcess && mSocketProcess->IsConnected();
 }
 
-void nsIOService::NotifySocketProcessPrefsChanged(const char *aName) {
+void nsIOService::NotifySocketProcessPrefsChanged(const char* aName) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!XRE_IsParentProcess()) {
@@ -455,7 +455,7 @@ void nsIOService::NotifySocketProcessPrefsChanged(const char *aName) {
   CallOrWaitForSocketProcess(sendPrefUpdate);
 }
 
-void nsIOService::OnProcessLaunchComplete(SocketProcessHost *aHost,
+void nsIOService::OnProcessLaunchComplete(SocketProcessHost* aHost,
                                           bool aSucceeded) {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -470,14 +470,14 @@ void nsIOService::OnProcessLaunchComplete(SocketProcessHost *aHost,
   if (!mPendingEvents.IsEmpty()) {
     nsTArray> pendingEvents;
     mPendingEvents.SwapElements(pendingEvents);
-    for (auto &func : pendingEvents) {
+    for (auto& func : pendingEvents) {
       func();
     }
   }
 }
 
 void nsIOService::CallOrWaitForSocketProcess(
-    const std::function &aFunc) {
+    const std::function& aFunc) {
   MOZ_ASSERT(NS_IsMainThread());
   if (IsSocketProcessLaunchComplete() && SocketProcessReady()) {
     aFunc();
@@ -490,7 +490,7 @@ int32_t nsIOService::SocketProcessPid() {
   if (!mSocketProcess) {
     return 0;
   }
-  if (SocketProcessParent *actor = mSocketProcess->GetActor()) {
+  if (SocketProcessParent* actor = mSocketProcess->GetActor()) {
     return (int32_t)actor->OtherPid();
   }
   return 0;
@@ -501,7 +501,7 @@ bool nsIOService::IsSocketProcessLaunchComplete() {
   return mSocketProcessLaunchComplete;
 }
 
-void nsIOService::OnProcessUnexpectedShutdown(SocketProcessHost *aHost) {
+void nsIOService::OnProcessUnexpectedShutdown(SocketProcessHost* aHost) {
   MOZ_ASSERT(NS_IsMainThread());
 
   LOG(("nsIOService::OnProcessUnexpectedShutdown\n"));
@@ -544,7 +544,7 @@ nsresult nsIOService::RecheckCaptivePortal() {
   return NS_DispatchToMainThread(task);
 }
 
-nsresult nsIOService::RecheckCaptivePortalIfLocalRedirect(nsIChannel *newChan) {
+nsresult nsIOService::RecheckCaptivePortalIfLocalRedirect(nsIChannel* newChan) {
   nsresult rv;
 
   if (!mCaptivePortalService) {
@@ -581,8 +581,8 @@ nsresult nsIOService::RecheckCaptivePortalIfLocalRedirect(nsIChannel *newChan) {
 }
 
 nsresult nsIOService::AsyncOnChannelRedirect(
-    nsIChannel *oldChan, nsIChannel *newChan, uint32_t flags,
-    nsAsyncRedirectVerifyHelper *helper) {
+    nsIChannel* oldChan, nsIChannel* newChan, uint32_t flags,
+    nsAsyncRedirectVerifyHelper* helper) {
   // If a redirect to a local network address occurs, then chances are we
   // are in a captive portal, so we trigger a recheck.
   RecheckCaptivePortalIfLocalRedirect(newChan);
@@ -610,8 +610,8 @@ nsresult nsIOService::AsyncOnChannelRedirect(
   return NS_OK;
 }
 
-nsresult nsIOService::CacheProtocolHandler(const char *scheme,
-                                           nsIProtocolHandler *handler) {
+nsresult nsIOService::CacheProtocolHandler(const char* scheme,
+                                           nsIProtocolHandler* handler) {
   MOZ_ASSERT(NS_IsMainThread());
 
   for (unsigned int i = 0; i < NS_N(gScheme); i++) {
@@ -638,8 +638,8 @@ nsresult nsIOService::CacheProtocolHandler(const char *scheme,
   return NS_ERROR_FAILURE;
 }
 
-nsresult nsIOService::GetCachedProtocolHandler(const char *scheme,
-                                               nsIProtocolHandler **result,
+nsresult nsIOService::GetCachedProtocolHandler(const char* scheme,
+                                               nsIProtocolHandler** result,
                                                uint32_t start, uint32_t end) {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -658,7 +658,7 @@ nsresult nsIOService::GetCachedProtocolHandler(const char *scheme,
   return NS_ERROR_FAILURE;
 }
 
-static bool UsesExternalProtocolHandler(const char *aScheme) {
+static bool UsesExternalProtocolHandler(const char* aScheme) {
   if (NS_LITERAL_CSTRING("file").Equals(aScheme) ||
       NS_LITERAL_CSTRING("chrome").Equals(aScheme) ||
       NS_LITERAL_CSTRING("resource").Equals(aScheme)) {
@@ -668,7 +668,7 @@ static bool UsesExternalProtocolHandler(const char *aScheme) {
     return false;
   }
 
-  for (const auto &forcedExternalScheme : gForcedExternalSchemes) {
+  for (const auto& forcedExternalScheme : gForcedExternalSchemes) {
     if (!nsCRT::strcasecmp(forcedExternalScheme, aScheme)) {
       return true;
     }
@@ -681,8 +681,8 @@ static bool UsesExternalProtocolHandler(const char *aScheme) {
 }
 
 NS_IMETHODIMP
-nsIOService::GetProtocolHandler(const char *scheme,
-                                nsIProtocolHandler **result) {
+nsIOService::GetProtocolHandler(const char* scheme,
+                                nsIProtocolHandler** result) {
   nsresult rv;
 
   NS_ENSURE_ARG_POINTER(scheme);
@@ -739,12 +739,12 @@ nsIOService::GetProtocolHandler(const char *scheme,
 }
 
 NS_IMETHODIMP
-nsIOService::ExtractScheme(const nsACString &inURI, nsACString &scheme) {
+nsIOService::ExtractScheme(const nsACString& inURI, nsACString& scheme) {
   return net_ExtractURLScheme(inURI, scheme);
 }
 
 NS_IMETHODIMP
-nsIOService::HostnameIsLocalIPAddress(nsIURI *aURI, bool *aResult) {
+nsIOService::HostnameIsLocalIPAddress(nsIURI* aURI, bool* aResult) {
   NS_ENSURE_ARG_POINTER(aURI);
 
   nsCOMPtr innerURI = NS_GetInnermostURI(aURI);
@@ -772,7 +772,7 @@ nsIOService::HostnameIsLocalIPAddress(nsIURI *aURI, bool *aResult) {
 }
 
 NS_IMETHODIMP
-nsIOService::GetProtocolFlags(const char *scheme, uint32_t *flags) {
+nsIOService::GetProtocolFlags(const char* scheme, uint32_t* flags) {
   nsCOMPtr handler;
   nsresult rv = GetProtocolHandler(scheme, getter_AddRefs(handler));
   if (NS_FAILED(rv)) return rv;
@@ -790,15 +790,15 @@ nsIOService::GetProtocolFlags(const char *scheme, uint32_t *flags) {
 
 class AutoIncrement {
  public:
-  explicit AutoIncrement(uint32_t *var) : mVar(var) { ++*var; }
+  explicit AutoIncrement(uint32_t* var) : mVar(var) { ++*var; }
   ~AutoIncrement() { --*mVar; }
 
  private:
-  uint32_t *mVar;
+  uint32_t* mVar;
 };
 
-nsresult nsIOService::NewURI(const nsACString &aSpec, const char *aCharset,
-                             nsIURI *aBaseURI, nsIURI **result) {
+nsresult nsIOService::NewURI(const nsACString& aSpec, const char* aCharset,
+                             nsIURI* aBaseURI, nsIURI** result) {
   NS_ASSERTION(NS_IsMainThread(), "wrong thread");
 
   static uint32_t recursionCount = 0;
@@ -830,7 +830,7 @@ nsresult nsIOService::NewURI(const nsACString &aSpec, const char *aCharset,
 }
 
 NS_IMETHODIMP
-nsIOService::NewFileURI(nsIFile *file, nsIURI **result) {
+nsIOService::NewFileURI(nsIFile* file, nsIURI** result) {
   nsresult rv;
   NS_ENSURE_ARG_POINTER(file);
 
@@ -846,12 +846,12 @@ nsIOService::NewFileURI(nsIFile *file, nsIURI **result) {
 }
 
 NS_IMETHODIMP
-nsIOService::NewChannelFromURI(nsIURI *aURI, nsINode *aLoadingNode,
-                               nsIPrincipal *aLoadingPrincipal,
-                               nsIPrincipal *aTriggeringPrincipal,
+nsIOService::NewChannelFromURI(nsIURI* aURI, nsINode* aLoadingNode,
+                               nsIPrincipal* aLoadingPrincipal,
+                               nsIPrincipal* aTriggeringPrincipal,
                                uint32_t aSecurityFlags,
                                uint32_t aContentPolicyType,
-                               nsIChannel **result) {
+                               nsIChannel** result) {
   return NewChannelFromURIWithProxyFlags(aURI,
                                          nullptr,  // aProxyURI
                                          0,        // aProxyFlags
@@ -860,11 +860,11 @@ nsIOService::NewChannelFromURI(nsIURI *aURI, nsINode *aLoadingNode,
                                          aContentPolicyType, result);
 }
 nsresult nsIOService::NewChannelFromURIWithClientAndController(
-    nsIURI *aURI, nsINode *aLoadingNode, nsIPrincipal *aLoadingPrincipal,
-    nsIPrincipal *aTriggeringPrincipal,
-    const Maybe &aLoadingClientInfo,
-    const Maybe &aController, uint32_t aSecurityFlags,
-    uint32_t aContentPolicyType, nsIChannel **aResult) {
+    nsIURI* aURI, nsINode* aLoadingNode, nsIPrincipal* aLoadingPrincipal,
+    nsIPrincipal* aTriggeringPrincipal,
+    const Maybe& aLoadingClientInfo,
+    const Maybe& aController, uint32_t aSecurityFlags,
+    uint32_t aContentPolicyType, nsIChannel** aResult) {
   return NewChannelFromURIWithProxyFlagsInternal(
       aURI,
       nullptr,  // aProxyURI
@@ -874,8 +874,8 @@ nsresult nsIOService::NewChannelFromURIWithClientAndController(
 }
 
 NS_IMETHODIMP
-nsIOService::NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo,
-                                           nsIChannel **result) {
+nsIOService::NewChannelFromURIWithLoadInfo(nsIURI* aURI, nsILoadInfo* aLoadInfo,
+                                           nsIChannel** result) {
   return NewChannelFromURIWithProxyFlagsInternal(aURI,
                                                  nullptr,  // aProxyURI
                                                  0,        // aProxyFlags
@@ -883,12 +883,12 @@ nsIOService::NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo,
 }
 
 nsresult nsIOService::NewChannelFromURIWithProxyFlagsInternal(
-    nsIURI *aURI, nsIURI *aProxyURI, uint32_t aProxyFlags,
-    nsINode *aLoadingNode, nsIPrincipal *aLoadingPrincipal,
-    nsIPrincipal *aTriggeringPrincipal,
-    const Maybe &aLoadingClientInfo,
-    const Maybe &aController, uint32_t aSecurityFlags,
-    uint32_t aContentPolicyType, nsIChannel **result) {
+    nsIURI* aURI, nsIURI* aProxyURI, uint32_t aProxyFlags,
+    nsINode* aLoadingNode, nsIPrincipal* aLoadingPrincipal,
+    nsIPrincipal* aTriggeringPrincipal,
+    const Maybe& aLoadingClientInfo,
+    const Maybe& aController, uint32_t aSecurityFlags,
+    uint32_t aContentPolicyType, nsIChannel** result) {
   // Ideally all callers of NewChannelFromURIWithProxyFlagsInternal provide
   // the necessary arguments to create a loadinfo.
   //
@@ -909,7 +909,7 @@ nsresult nsIOService::NewChannelFromURIWithProxyFlagsInternal(
                             aLoadingClientInfo, aController);
   }
   if (!loadInfo) {
-    JSContext *cx = nsContentUtils::GetCurrentJSContext();
+    JSContext* cx = nsContentUtils::GetCurrentJSContext();
     // if coming from JS we like to know the JS stack, otherwise
     // we just assert that we are able to create a valid loadinfo!
     if (cx) {
@@ -930,8 +930,8 @@ nsresult nsIOService::NewChannelFromURIWithProxyFlagsInternal(
 }
 
 nsresult nsIOService::NewChannelFromURIWithProxyFlagsInternal(
-    nsIURI *aURI, nsIURI *aProxyURI, uint32_t aProxyFlags,
-    nsILoadInfo *aLoadInfo, nsIChannel **result) {
+    nsIURI* aURI, nsIURI* aProxyURI, uint32_t aProxyFlags,
+    nsILoadInfo* aLoadInfo, nsIChannel** result) {
   nsresult rv;
   NS_ENSURE_ARG_POINTER(aURI);
 
@@ -1003,10 +1003,10 @@ nsresult nsIOService::NewChannelFromURIWithProxyFlagsInternal(
 
 NS_IMETHODIMP
 nsIOService::NewChannelFromURIWithProxyFlags(
-    nsIURI *aURI, nsIURI *aProxyURI, uint32_t aProxyFlags,
-    nsINode *aLoadingNode, nsIPrincipal *aLoadingPrincipal,
-    nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags,
-    uint32_t aContentPolicyType, nsIChannel **result) {
+    nsIURI* aURI, nsIURI* aProxyURI, uint32_t aProxyFlags,
+    nsINode* aLoadingNode, nsIPrincipal* aLoadingPrincipal,
+    nsIPrincipal* aTriggeringPrincipal, uint32_t aSecurityFlags,
+    uint32_t aContentPolicyType, nsIChannel** result) {
   return NewChannelFromURIWithProxyFlagsInternal(
       aURI, aProxyURI, aProxyFlags, aLoadingNode, aLoadingPrincipal,
       aTriggeringPrincipal, Maybe(),
@@ -1015,12 +1015,12 @@ nsIOService::NewChannelFromURIWithProxyFlags(
 }
 
 NS_IMETHODIMP
-nsIOService::NewChannel(const nsACString &aSpec, const char *aCharset,
-                        nsIURI *aBaseURI, nsINode *aLoadingNode,
-                        nsIPrincipal *aLoadingPrincipal,
-                        nsIPrincipal *aTriggeringPrincipal,
+nsIOService::NewChannel(const nsACString& aSpec, const char* aCharset,
+                        nsIURI* aBaseURI, nsINode* aLoadingNode,
+                        nsIPrincipal* aLoadingPrincipal,
+                        nsIPrincipal* aTriggeringPrincipal,
                         uint32_t aSecurityFlags, uint32_t aContentPolicyType,
-                        nsIChannel **result) {
+                        nsIChannel** result) {
   nsresult rv;
   nsCOMPtr uri;
   rv = NewURI(aSpec, aCharset, aBaseURI, getter_AddRefs(uri));
@@ -1050,7 +1050,7 @@ bool nsIOService::IsLinkUp() {
 }
 
 NS_IMETHODIMP
-nsIOService::GetOffline(bool *offline) {
+nsIOService::GetOffline(bool* offline) {
   if (mOfflineMirrorsConnectivity) {
     *offline = mOffline || !mConnectivity;
   } else {
@@ -1090,7 +1090,7 @@ nsIOService::SetOffline(bool offline) {
     }
   }
 
-  nsIIOService *subject = static_cast(this);
+  nsIIOService* subject = static_cast(this);
   while (mSetOfflineValue != mOffline) {
     offline = mSetOfflineValue;
 
@@ -1142,7 +1142,7 @@ nsIOService::SetOffline(bool offline) {
 }
 
 NS_IMETHODIMP
-nsIOService::GetConnectivity(bool *aConnectivity) {
+nsIOService::GetConnectivity(bool* aConnectivity) {
   *aConnectivity = mConnectivity;
   return NS_OK;
 }
@@ -1174,9 +1174,9 @@ nsresult nsIOService::SetConnectivityInternal(bool aConnectivity) {
   if (mCaptivePortalService) {
     if (aConnectivity && gCaptivePortalEnabled) {
       // This will also trigger a captive portal check for the new network
-      static_cast(mCaptivePortalService.get())->Start();
+      static_cast(mCaptivePortalService.get())->Start();
     } else {
-      static_cast(mCaptivePortalService.get())->Stop();
+      static_cast(mCaptivePortalService.get())->Stop();
     }
   }
 
@@ -1199,16 +1199,16 @@ nsresult nsIOService::SetConnectivityInternal(bool aConnectivity) {
   if (aConnectivity) {
     // If we were previously offline due to connectivity=false,
     // send the ONLINE notification
-    observerService->NotifyObservers(static_cast(this),
+    observerService->NotifyObservers(static_cast(this),
                                      NS_IOSERVICE_OFFLINE_STATUS_TOPIC,
                                      (u"" NS_IOSERVICE_ONLINE));
   } else {
     // If we were previously online and lost connectivity
     // send the OFFLINE notification
-    observerService->NotifyObservers(static_cast(this),
+    observerService->NotifyObservers(static_cast(this),
                                      NS_IOSERVICE_GOING_OFFLINE_TOPIC,
                                      u"" NS_IOSERVICE_OFFLINE);
-    observerService->NotifyObservers(static_cast(this),
+    observerService->NotifyObservers(static_cast(this),
                                      NS_IOSERVICE_OFFLINE_STATUS_TOPIC,
                                      u"" NS_IOSERVICE_OFFLINE);
   }
@@ -1216,7 +1216,7 @@ nsresult nsIOService::SetConnectivityInternal(bool aConnectivity) {
 }
 
 NS_IMETHODIMP
-nsIOService::AllowPort(int32_t inPort, const char *scheme, bool *_retval) {
+nsIOService::AllowPort(int32_t inPort, const char* scheme, bool* _retval) {
   int16_t port = inPort;
   if (port == -1) {
     *_retval = true;
@@ -1252,7 +1252,7 @@ nsIOService::AllowPort(int32_t inPort, const char *scheme, bool *_retval) {
 
 ////////////////////////////////////////////////////////////////////////////////
 
-void nsIOService::PrefsChanged(const char *pref) {
+void nsIOService::PrefsChanged(const char* pref) {
   // Look for extra ports to block
   if (!pref || strcmp(pref, PORT_PREF("banned")) == 0)
     ParsePortList(PORT_PREF("banned"), false);
@@ -1306,17 +1306,16 @@ void nsIOService::PrefsChanged(const char *pref) {
                                        &gCaptivePortalEnabled);
     if (NS_SUCCEEDED(rv) && mCaptivePortalService) {
       if (gCaptivePortalEnabled) {
-        static_cast(mCaptivePortalService.get())
+        static_cast(mCaptivePortalService.get())
             ->Start();
       } else {
-        static_cast(mCaptivePortalService.get())
-            ->Stop();
+        static_cast(mCaptivePortalService.get())->Stop();
       }
     }
   }
 }
 
-void nsIOService::ParsePortList(const char *pref, bool remove) {
+void nsIOService::ParsePortList(const char* pref, bool remove) {
   nsAutoCString portList;
 
   // Get a pref string and chop it up into a list of ports.
@@ -1357,7 +1356,7 @@ void nsIOService::ParsePortList(const char *pref, bool remove) {
 
 class nsWakeupNotifier : public Runnable {
  public:
-  explicit nsWakeupNotifier(nsIIOServiceInternal *ioService)
+  explicit nsWakeupNotifier(nsIIOServiceInternal* ioService)
       : Runnable("net::nsWakeupNotifier"), mIOService(ioService) {}
 
   NS_IMETHOD Run() override { return mIOService->NotifyWakeup(); }
@@ -1392,8 +1391,8 @@ void nsIOService::SetHttpHandlerAlreadyShutingDown() {
 
 // nsIObserver interface
 NS_IMETHODIMP
-nsIOService::Observe(nsISupports *subject, const char *topic,
-                     const char16_t *data) {
+nsIOService::Observe(nsISupports* subject, const char* topic,
+                     const char16_t* data) {
   if (!strcmp(topic, kProfileChangeNetTeardownTopic)) {
     if (!mHttpHandlerAlreadyShutingDown) {
       mNetTearingDownStarted = PR_IntervalNow();
@@ -1445,7 +1444,7 @@ nsIOService::Observe(nsISupports *subject, const char *topic,
     SetOffline(true);
 
     if (mCaptivePortalService) {
-      static_cast(mCaptivePortalService.get())->Stop();
+      static_cast(mCaptivePortalService.get())->Stop();
       mCaptivePortalService = nullptr;
     }
 
@@ -1469,24 +1468,24 @@ nsIOService::Observe(nsISupports *subject, const char *topic,
 
 // nsINetUtil interface
 NS_IMETHODIMP
-nsIOService::ParseRequestContentType(const nsACString &aTypeHeader,
-                                     nsACString &aCharset, bool *aHadCharset,
-                                     nsACString &aContentType) {
+nsIOService::ParseRequestContentType(const nsACString& aTypeHeader,
+                                     nsACString& aCharset, bool* aHadCharset,
+                                     nsACString& aContentType) {
   net_ParseRequestContentType(aTypeHeader, aContentType, aCharset, aHadCharset);
   return NS_OK;
 }
 
 // nsINetUtil interface
 NS_IMETHODIMP
-nsIOService::ParseResponseContentType(const nsACString &aTypeHeader,
-                                      nsACString &aCharset, bool *aHadCharset,
-                                      nsACString &aContentType) {
+nsIOService::ParseResponseContentType(const nsACString& aTypeHeader,
+                                      nsACString& aCharset, bool* aHadCharset,
+                                      nsACString& aContentType) {
   net_ParseContentType(aTypeHeader, aContentType, aCharset, aHadCharset);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIOService::ProtocolHasFlags(nsIURI *uri, uint32_t flags, bool *result) {
+nsIOService::ProtocolHasFlags(nsIURI* uri, uint32_t flags, bool* result) {
   NS_ENSURE_ARG(uri);
 
   *result = false;
@@ -1507,7 +1506,7 @@ nsIOService::ProtocolHasFlags(nsIURI *uri, uint32_t flags, bool *result) {
 }
 
 NS_IMETHODIMP
-nsIOService::URIChainHasFlags(nsIURI *uri, uint32_t flags, bool *result) {
+nsIOService::URIChainHasFlags(nsIURI* uri, uint32_t flags, bool* result) {
   nsresult rv = ProtocolHasFlags(uri, flags, result);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -1555,13 +1554,13 @@ nsIOService::SetManageOfflineStatus(bool aManage) {
 }
 
 NS_IMETHODIMP
-nsIOService::GetManageOfflineStatus(bool *aManage) {
+nsIOService::GetManageOfflineStatus(bool* aManage) {
   *aManage = mManageLinkStatus;
   return NS_OK;
 }
 
 // input argument 'data' is already UTF8'ed
-nsresult nsIOService::OnNetworkLinkEvent(const char *data) {
+nsresult nsIOService::OnNetworkLinkEvent(const char* data) {
   if (IsNeckoChild() || IsSocketProcessChild()) {
     // There is nothing IO service could do on the child process
     // with this at the moment.  Feel free to add functionality
@@ -1574,9 +1573,9 @@ nsresult nsIOService::OnNetworkLinkEvent(const char *data) {
   }
 
   nsCString dataAsString(data);
-  for (auto *cp : mozilla::dom::ContentParent::AllProcesses(
+  for (auto* cp : mozilla::dom::ContentParent::AllProcesses(
            mozilla::dom::ContentParent::eLive)) {
-    PNeckoParent *neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent());
+    PNeckoParent* neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent());
     if (!neckoParent) {
       continue;
     }
@@ -1617,8 +1616,8 @@ nsresult nsIOService::OnNetworkLinkEvent(const char *data) {
 }
 
 NS_IMETHODIMP
-nsIOService::EscapeString(const nsACString &aString, uint32_t aEscapeType,
-                          nsACString &aResult) {
+nsIOService::EscapeString(const nsACString& aString, uint32_t aEscapeType,
+                          nsACString& aResult) {
   NS_ENSURE_ARG_MAX(aEscapeType, 4);
 
   nsAutoCString stringCopy(aString);
@@ -1633,8 +1632,8 @@ nsIOService::EscapeString(const nsACString &aString, uint32_t aEscapeType,
 }
 
 NS_IMETHODIMP
-nsIOService::EscapeURL(const nsACString &aStr, uint32_t aFlags,
-                       nsACString &aResult) {
+nsIOService::EscapeURL(const nsACString& aStr, uint32_t aFlags,
+                       nsACString& aResult) {
   aResult.Truncate();
   NS_EscapeURL(aStr.BeginReading(), aStr.Length(), aFlags | esc_AlwaysCopy,
                aResult);
@@ -1642,8 +1641,8 @@ nsIOService::EscapeURL(const nsACString &aStr, uint32_t aFlags,
 }
 
 NS_IMETHODIMP
-nsIOService::UnescapeString(const nsACString &aStr, uint32_t aFlags,
-                            nsACString &aResult) {
+nsIOService::UnescapeString(const nsACString& aStr, uint32_t aFlags,
+                            nsACString& aResult) {
   aResult.Truncate();
   NS_UnescapeURL(aStr.BeginReading(), aStr.Length(), aFlags | esc_AlwaysCopy,
                  aResult);
@@ -1651,11 +1650,11 @@ nsIOService::UnescapeString(const nsACString &aStr, uint32_t aFlags,
 }
 
 NS_IMETHODIMP
-nsIOService::ExtractCharsetFromContentType(const nsACString &aTypeHeader,
-                                           nsACString &aCharset,
-                                           int32_t *aCharsetStart,
-                                           int32_t *aCharsetEnd,
-                                           bool *aHadCharset) {
+nsIOService::ExtractCharsetFromContentType(const nsACString& aTypeHeader,
+                                           nsACString& aCharset,
+                                           int32_t* aCharsetStart,
+                                           int32_t* aCharsetEnd,
+                                           bool* aHadCharset) {
   nsAutoCString ignored;
   net_ParseContentType(aTypeHeader, ignored, aCharset, aHadCharset,
                        aCharsetStart, aCharsetEnd);
@@ -1667,15 +1666,15 @@ nsIOService::ExtractCharsetFromContentType(const nsACString &aTypeHeader,
 
 // parse policyString to policy enum value (see ReferrerPolicy.h)
 NS_IMETHODIMP
-nsIOService::ParseAttributePolicyString(const nsAString &policyString,
-                                        uint32_t *outPolicyEnum) {
+nsIOService::ParseAttributePolicyString(const nsAString& policyString,
+                                        uint32_t* outPolicyEnum) {
   NS_ENSURE_ARG(outPolicyEnum);
   *outPolicyEnum = (uint32_t)AttributeReferrerPolicyFromString(policyString);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIOService::GetReferrerPolicyString(uint32_t aPolicy, nsACString &aResult) {
+nsIOService::GetReferrerPolicyString(uint32_t aPolicy, nsACString& aResult) {
   if (aPolicy >= ArrayLength(kReferrerPolicyString)) {
     aResult.AssignLiteral("unknown");
     return NS_ERROR_INVALID_ARG;
@@ -1694,8 +1693,8 @@ class IOServiceProxyCallback final : public nsIProtocolProxyCallback {
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPROTOCOLPROXYCALLBACK
 
-  IOServiceProxyCallback(nsIInterfaceRequestor *aCallbacks,
-                         nsIOService *aIOService)
+  IOServiceProxyCallback(nsIInterfaceRequestor* aCallbacks,
+                         nsIOService* aIOService)
       : mCallbacks(aCallbacks), mIOService(aIOService) {}
 
  private:
@@ -1706,8 +1705,8 @@ class IOServiceProxyCallback final : public nsIProtocolProxyCallback {
 NS_IMPL_ISUPPORTS(IOServiceProxyCallback, nsIProtocolProxyCallback)
 
 NS_IMETHODIMP
-IOServiceProxyCallback::OnProxyAvailable(nsICancelable *request,
-                                         nsIChannel *channel, nsIProxyInfo *pi,
+IOServiceProxyCallback::OnProxyAvailable(nsICancelable* request,
+                                         nsIChannel* channel, nsIProxyInfo* pi,
                                          nsresult status) {
   // Checking proxy status for speculative connect
   nsAutoCString type;
@@ -1750,7 +1749,7 @@ IOServiceProxyCallback::OnProxyAvailable(nsICancelable *request,
 }
 
 nsresult nsIOService::SpeculativeConnectInternal(
-    nsIURI *aURI, nsIPrincipal *aPrincipal, nsIInterfaceRequestor *aCallbacks,
+    nsIURI* aURI, nsIPrincipal* aPrincipal, nsIInterfaceRequestor* aCallbacks,
     bool aAnonymous) {
   NS_ENSURE_ARG(aURI);
 
@@ -1821,14 +1820,14 @@ nsresult nsIOService::SpeculativeConnectInternal(
 }
 
 NS_IMETHODIMP
-nsIOService::SpeculativeConnect(nsIURI *aURI, nsIPrincipal *aPrincipal,
-                                nsIInterfaceRequestor *aCallbacks) {
+nsIOService::SpeculativeConnect(nsIURI* aURI, nsIPrincipal* aPrincipal,
+                                nsIInterfaceRequestor* aCallbacks) {
   return SpeculativeConnectInternal(aURI, aPrincipal, aCallbacks, false);
 }
 
 NS_IMETHODIMP
-nsIOService::SpeculativeAnonymousConnect(nsIURI *aURI, nsIPrincipal *aPrincipal,
-                                         nsIInterfaceRequestor *aCallbacks) {
+nsIOService::SpeculativeAnonymousConnect(nsIURI* aURI, nsIPrincipal* aPrincipal,
+                                         nsIInterfaceRequestor* aCallbacks) {
   return SpeculativeConnectInternal(aURI, aPrincipal, aCallbacks, true);
 }
 
diff --git a/netwerk/base/nsIncrementalDownload.cpp b/netwerk/base/nsIncrementalDownload.cpp
index 9a94c7906c086..f70141b7418e1 100644
--- a/netwerk/base/nsIncrementalDownload.cpp
+++ b/netwerk/base/nsIncrementalDownload.cpp
@@ -44,9 +44,9 @@ using namespace mozilla::net;
 
 //-----------------------------------------------------------------------------
 
-static nsresult WriteToFile(nsIFile *lf, const char *data, uint32_t len,
+static nsresult WriteToFile(nsIFile* lf, const char* data, uint32_t len,
                             int32_t flags) {
-  PRFileDesc *fd;
+  PRFileDesc* fd;
   int32_t mode = 0600;
   nsresult rv;
   rv = lf->OpenNSPRFileDesc(flags, mode, &fd);
@@ -59,15 +59,15 @@ static nsresult WriteToFile(nsIFile *lf, const char *data, uint32_t len,
   return rv;
 }
 
-static nsresult AppendToFile(nsIFile *lf, const char *data, uint32_t len) {
+static nsresult AppendToFile(nsIFile* lf, const char* data, uint32_t len) {
   int32_t flags = PR_WRONLY | PR_CREATE_FILE | PR_APPEND;
   return WriteToFile(lf, data, len, flags);
 }
 
 // maxSize may be -1 if unknown
-static void MakeRangeSpec(const int64_t &size, const int64_t &maxSize,
+static void MakeRangeSpec(const int64_t& size, const int64_t& maxSize,
                           int32_t chunkSize, bool fetchRemaining,
-                          nsCString &rangeSpec) {
+                          nsCString& rangeSpec) {
   rangeSpec.AssignLiteral("bytes=");
   rangeSpec.AppendInt(int64_t(size));
   rangeSpec.Append('-');
@@ -112,7 +112,7 @@ class nsIncrementalDownload final : public nsIIncrementalDownload,
   nsresult StartTimer(int32_t interval);
   nsresult ProcessTimeout();
   nsresult ReadCurrentSize();
-  nsresult ClearRequestHeader(nsIHttpChannel *channel);
+  nsresult ClearRequestHeader(nsIHttpChannel* channel);
 
   nsCOMPtr mObserver;
   nsCOMPtr mObserverContext;
@@ -288,7 +288,7 @@ nsresult nsIncrementalDownload::ProcessTimeout() {
 // Reads the current file size and validates it.
 nsresult nsIncrementalDownload::ReadCurrentSize() {
   int64_t size;
-  nsresult rv = mDest->GetFileSize((int64_t *)&size);
+  nsresult rv = mDest->GetFileSize((int64_t*)&size);
   if (rv == NS_ERROR_FILE_NOT_FOUND ||
       rv == NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) {
     mCurrentSize = 0;
@@ -310,20 +310,20 @@ NS_IMPL_ISUPPORTS(nsIncrementalDownload, nsIIncrementalDownload, nsIRequest,
 // nsIRequest
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetName(nsACString &name) {
+nsIncrementalDownload::GetName(nsACString& name) {
   NS_ENSURE_TRUE(mURI, NS_ERROR_NOT_INITIALIZED);
 
   return mURI->GetSpec(name);
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::IsPending(bool *isPending) {
+nsIncrementalDownload::IsPending(bool* isPending) {
   *isPending = mIsPending;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetStatus(nsresult *status) {
+nsIncrementalDownload::GetStatus(nsresult* status) {
   *status = mStatus;
   return NS_OK;
 }
@@ -360,7 +360,7 @@ NS_IMETHODIMP
 nsIncrementalDownload::Resume() { return NS_ERROR_NOT_IMPLEMENTED; }
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetLoadFlags(nsLoadFlags *loadFlags) {
+nsIncrementalDownload::GetLoadFlags(nsLoadFlags* loadFlags) {
   *loadFlags = mLoadFlags;
   return NS_OK;
 }
@@ -372,19 +372,19 @@ nsIncrementalDownload::SetLoadFlags(nsLoadFlags loadFlags) {
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetLoadGroup(nsILoadGroup **loadGroup) {
+nsIncrementalDownload::GetLoadGroup(nsILoadGroup** loadGroup) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::SetLoadGroup(nsILoadGroup *loadGroup) {
+nsIncrementalDownload::SetLoadGroup(nsILoadGroup* loadGroup) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 // nsIIncrementalDownload
 
 NS_IMETHODIMP
-nsIncrementalDownload::Init(nsIURI *uri, nsIFile *dest, int32_t chunkSize,
+nsIncrementalDownload::Init(nsIURI* uri, nsIFile* dest, int32_t chunkSize,
                             int32_t interval) {
   // Keep it simple: only allow initialization once
   NS_ENSURE_FALSE(mURI, NS_ERROR_ALREADY_INITIALIZED);
@@ -401,21 +401,21 @@ nsIncrementalDownload::Init(nsIURI *uri, nsIFile *dest, int32_t chunkSize,
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetURI(nsIURI **result) {
+nsIncrementalDownload::GetURI(nsIURI** result) {
   nsCOMPtr uri = mURI;
   uri.forget(result);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetFinalURI(nsIURI **result) {
+nsIncrementalDownload::GetFinalURI(nsIURI** result) {
   nsCOMPtr uri = mFinalURI;
   uri.forget(result);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetDestination(nsIFile **result) {
+nsIncrementalDownload::GetDestination(nsIFile** result) {
   if (!mDest) {
     *result = nullptr;
     return NS_OK;
@@ -427,20 +427,20 @@ nsIncrementalDownload::GetDestination(nsIFile **result) {
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetTotalSize(int64_t *result) {
+nsIncrementalDownload::GetTotalSize(int64_t* result) {
   *result = mTotalSize;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetCurrentSize(int64_t *result) {
+nsIncrementalDownload::GetCurrentSize(int64_t* result) {
   *result = mCurrentSize;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::Start(nsIRequestObserver *observer,
-                             nsISupports *context) {
+nsIncrementalDownload::Start(nsIRequestObserver* observer,
+                             nsISupports* context) {
   NS_ENSURE_ARG(observer);
   NS_ENSURE_FALSE(mIsPending, NS_ERROR_IN_PROGRESS);
 
@@ -468,7 +468,7 @@ nsIncrementalDownload::Start(nsIRequestObserver *observer,
 // nsIRequestObserver
 
 NS_IMETHODIMP
-nsIncrementalDownload::OnStartRequest(nsIRequest *request) {
+nsIncrementalDownload::OnStartRequest(nsIRequest* request) {
   nsresult rv;
 
   nsCOMPtr http = do_QueryInterface(request, &rv);
@@ -533,8 +533,8 @@ nsIncrementalDownload::OnStartRequest(nsIRequest *request) {
       // first look for the starting point of the content-range
       // to make sure it is what we expect
       if (p != -1) {
-        char *endptr = nullptr;
-        const char *s = buf.get() + p + 6;
+        char* endptr = nullptr;
+        const char* s = buf.get() + p + 6;
         while (*s && *s == ' ') s++;
         startByte = strtol(s, &endptr, 10);
 
@@ -550,7 +550,7 @@ nsIncrementalDownload::OnStartRequest(nsIRequest *request) {
             int64_t rangeSize = 0;
             if (slash != kNotFound &&
                 (PR_sscanf(buf.get() + slash + 1, "%lld",
-                           (int64_t *)&rangeSize) == 1) &&
+                           (int64_t*)&rangeSize) == 1) &&
                 rangeSize == mTotalSize) {
               confirmedOK = true;
             }
@@ -603,7 +603,7 @@ nsIncrementalDownload::OnStartRequest(nsIRequest *request) {
         NS_WARNING("server returned invalid Content-Range header!");
         return NS_ERROR_UNEXPECTED;
       }
-      if (PR_sscanf(buf.get() + slash + 1, "%lld", (int64_t *)&mTotalSize) != 1)
+      if (PR_sscanf(buf.get() + slash + 1, "%lld", (int64_t*)&mTotalSize) != 1)
         return NS_ERROR_UNEXPECTED;
     } else {
       rv = http->GetContentLength(&mTotalSize);
@@ -640,7 +640,7 @@ nsIncrementalDownload::OnStartRequest(nsIRequest *request) {
 }
 
 NS_IMETHODIMP
-nsIncrementalDownload::OnStopRequest(nsIRequest *request, nsresult status) {
+nsIncrementalDownload::OnStopRequest(nsIRequest* request, nsresult status) {
   // Not a real error; just a trick to kill off the channel without our
   // listener having to care.
   if (status == NS_ERROR_DOWNLOAD_NOT_PARTIAL) return NS_OK;
@@ -672,8 +672,8 @@ nsIncrementalDownload::OnStopRequest(nsIRequest *request, nsresult status) {
 // nsIStreamListener
 
 NS_IMETHODIMP
-nsIncrementalDownload::OnDataAvailable(nsIRequest *request,
-                                       nsIInputStream *input, uint64_t offset,
+nsIncrementalDownload::OnDataAvailable(nsIRequest* request,
+                                       nsIInputStream* input, uint64_t offset,
                                        uint32_t count) {
   while (count) {
     uint32_t space = mChunkSize - mChunkLen;
@@ -701,8 +701,8 @@ nsIncrementalDownload::OnDataAvailable(nsIRequest *request,
 // nsIObserver
 
 NS_IMETHODIMP
-nsIncrementalDownload::Observe(nsISupports *subject, const char *topic,
-                               const char16_t *data) {
+nsIncrementalDownload::Observe(nsISupports* subject, const char* topic,
+                               const char16_t* data) {
   if (strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
     Cancel(NS_ERROR_ABORT);
 
@@ -721,10 +721,10 @@ nsIncrementalDownload::Observe(nsISupports *subject, const char *topic,
 // nsIInterfaceRequestor
 
 NS_IMETHODIMP
-nsIncrementalDownload::GetInterface(const nsIID &iid, void **result) {
+nsIncrementalDownload::GetInterface(const nsIID& iid, void** result) {
   if (iid.Equals(NS_GET_IID(nsIChannelEventSink))) {
     NS_ADDREF_THIS();
-    *result = static_cast(this);
+    *result = static_cast(this);
     return NS_OK;
   }
 
@@ -734,7 +734,7 @@ nsIncrementalDownload::GetInterface(const nsIID &iid, void **result) {
   return NS_ERROR_NO_INTERFACE;
 }
 
-nsresult nsIncrementalDownload::ClearRequestHeader(nsIHttpChannel *channel) {
+nsresult nsIncrementalDownload::ClearRequestHeader(nsIHttpChannel* channel) {
   NS_ENSURE_ARG(channel);
 
   // We don't support encodings -- they make the Content-Length not equal
@@ -747,8 +747,8 @@ nsresult nsIncrementalDownload::ClearRequestHeader(nsIHttpChannel *channel) {
 
 NS_IMETHODIMP
 nsIncrementalDownload::AsyncOnChannelRedirect(
-    nsIChannel *oldChannel, nsIChannel *newChannel, uint32_t flags,
-    nsIAsyncVerifyRedirectCallback *cb) {
+    nsIChannel* oldChannel, nsIChannel* newChannel, uint32_t flags,
+    nsIAsyncVerifyRedirectCallback* cb) {
   // In response to a redirect, we need to propagate the Range header.  See bug
   // 311595.  Any failure code returned from this function aborts the redirect.
 
@@ -824,8 +824,8 @@ nsIncrementalDownload::OnRedirectVerifyCallback(nsresult result) {
   return NS_OK;
 }
 
-extern nsresult net_NewIncrementalDownload(nsISupports *outer, const nsIID &iid,
-                                           void **result) {
+extern nsresult net_NewIncrementalDownload(nsISupports* outer, const nsIID& iid,
+                                           void** result) {
   if (outer) return NS_ERROR_NO_AGGREGATION;
 
   RefPtr d = new nsIncrementalDownload();
diff --git a/netwerk/base/nsIncrementalStreamLoader.cpp b/netwerk/base/nsIncrementalStreamLoader.cpp
index 95cec16847c27..007f0a3bb5c2d 100644
--- a/netwerk/base/nsIncrementalStreamLoader.cpp
+++ b/netwerk/base/nsIncrementalStreamLoader.cpp
@@ -15,14 +15,14 @@ nsIncrementalStreamLoader::nsIncrementalStreamLoader()
     : mData(), mBytesConsumed(0) {}
 
 NS_IMETHODIMP
-nsIncrementalStreamLoader::Init(nsIIncrementalStreamLoaderObserver *observer) {
+nsIncrementalStreamLoader::Init(nsIIncrementalStreamLoaderObserver* observer) {
   NS_ENSURE_ARG_POINTER(observer);
   mObserver = observer;
   return NS_OK;
 }
 
-nsresult nsIncrementalStreamLoader::Create(nsISupports *aOuter, REFNSIID aIID,
-                                           void **aResult) {
+nsresult nsIncrementalStreamLoader::Create(nsISupports* aOuter, REFNSIID aIID,
+                                           void** aResult) {
   if (aOuter) return NS_ERROR_NO_AGGREGATION;
 
   RefPtr it = new nsIncrementalStreamLoader();
@@ -34,20 +34,20 @@ NS_IMPL_ISUPPORTS(nsIncrementalStreamLoader, nsIIncrementalStreamLoader,
                   nsIThreadRetargetableStreamListener)
 
 NS_IMETHODIMP
-nsIncrementalStreamLoader::GetNumBytesRead(uint32_t *aNumBytes) {
+nsIncrementalStreamLoader::GetNumBytesRead(uint32_t* aNumBytes) {
   *aNumBytes = mBytesConsumed + mData.length();
   return NS_OK;
 }
 
 /* readonly attribute nsIRequest request; */
 NS_IMETHODIMP
-nsIncrementalStreamLoader::GetRequest(nsIRequest **aRequest) {
+nsIncrementalStreamLoader::GetRequest(nsIRequest** aRequest) {
   NS_IF_ADDREF(*aRequest = mRequest);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIncrementalStreamLoader::OnStartRequest(nsIRequest *request) {
+nsIncrementalStreamLoader::OnStartRequest(nsIRequest* request) {
   nsCOMPtr chan(do_QueryInterface(request));
   if (chan) {
     int64_t contentLength = -1;
@@ -72,7 +72,7 @@ nsIncrementalStreamLoader::OnStartRequest(nsIRequest *request) {
 }
 
 NS_IMETHODIMP
-nsIncrementalStreamLoader::OnStopRequest(nsIRequest *request,
+nsIncrementalStreamLoader::OnStopRequest(nsIRequest* request,
                                          nsresult aStatus) {
   AUTO_PROFILER_LABEL("nsIncrementalStreamLoader::OnStopRequest", NETWORK);
 
@@ -81,7 +81,7 @@ nsIncrementalStreamLoader::OnStopRequest(nsIRequest *request,
     // OnStreamComplete
     mRequest = request;
     size_t length = mData.length();
-    uint8_t *elems = mData.extractOrCopyRawBuffer();
+    uint8_t* elems = mData.extractOrCopyRawBuffer();
     nsresult rv =
         mObserver->OnStreamComplete(this, mContext, aStatus, length, elems);
     if (rv != NS_SUCCESS_ADOPTED_DATA) {
@@ -98,11 +98,11 @@ nsIncrementalStreamLoader::OnStopRequest(nsIRequest *request,
 }
 
 nsresult nsIncrementalStreamLoader::WriteSegmentFun(
-    nsIInputStream *inStr, void *closure, const char *fromSegment,
-    uint32_t toOffset, uint32_t count, uint32_t *writeCount) {
-  nsIncrementalStreamLoader *self = (nsIncrementalStreamLoader *)closure;
+    nsIInputStream* inStr, void* closure, const char* fromSegment,
+    uint32_t toOffset, uint32_t count, uint32_t* writeCount) {
+  nsIncrementalStreamLoader* self = (nsIncrementalStreamLoader*)closure;
 
-  const uint8_t *data = reinterpret_cast(fromSegment);
+  const uint8_t* data = reinterpret_cast(fromSegment);
   uint32_t consumedCount = 0;
   nsresult rv;
   if (self->mData.empty()) {
@@ -134,7 +134,7 @@ nsresult nsIncrementalStreamLoader::WriteSegmentFun(
     }
     size_t length = self->mData.length();
     uint32_t reportCount = length > UINT32_MAX ? UINT32_MAX : (uint32_t)length;
-    uint8_t *elems = self->mData.extractOrCopyRawBuffer();
+    uint8_t* elems = self->mData.extractOrCopyRawBuffer();
 
     rv = self->mObserver->OnIncrementalData(self, self->mContext, reportCount,
                                             elems, &consumedCount);
@@ -168,8 +168,8 @@ nsresult nsIncrementalStreamLoader::WriteSegmentFun(
 }
 
 NS_IMETHODIMP
-nsIncrementalStreamLoader::OnDataAvailable(nsIRequest *request,
-                                           nsIInputStream *inStr,
+nsIncrementalStreamLoader::OnDataAvailable(nsIRequest* request,
+                                           nsIInputStream* inStr,
                                            uint64_t sourceOffset,
                                            uint32_t count) {
   if (mObserver) {
diff --git a/netwerk/base/nsIncrementalStreamLoader.h b/netwerk/base/nsIncrementalStreamLoader.h
index 06fbea4953288..0b6e6b5167a5b 100644
--- a/netwerk/base/nsIncrementalStreamLoader.h
+++ b/netwerk/base/nsIncrementalStreamLoader.h
@@ -26,13 +26,13 @@ class nsIncrementalStreamLoader final
 
   nsIncrementalStreamLoader();
 
-  static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
+  static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
 
  protected:
   ~nsIncrementalStreamLoader() = default;
 
-  static nsresult WriteSegmentFun(nsIInputStream *, void *, const char *,
-                                  uint32_t, uint32_t, uint32_t *);
+  static nsresult WriteSegmentFun(nsIInputStream*, void*, const char*, uint32_t,
+                                  uint32_t, uint32_t*);
 
   // Utility method to free mData, if present, and update other state to
   // reflect that no data has been allocated.
diff --git a/netwerk/base/nsInputStreamPump.cpp b/netwerk/base/nsInputStreamPump.cpp
index 72b064bca3920..331ff90a84533 100644
--- a/netwerk/base/nsInputStreamPump.cpp
+++ b/netwerk/base/nsInputStreamPump.cpp
@@ -52,10 +52,10 @@ nsInputStreamPump::nsInputStreamPump()
       mAsyncStreamIsBuffered(false),
       mMutex("nsInputStreamPump") {}
 
-nsresult nsInputStreamPump::Create(nsInputStreamPump **result,
-                                   nsIInputStream *stream, uint32_t segsize,
+nsresult nsInputStreamPump::Create(nsInputStreamPump** result,
+                                   nsIInputStream* stream, uint32_t segsize,
                                    uint32_t segcount, bool closeWhenDone,
-                                   nsIEventTarget *mainThreadTarget) {
+                                   nsIEventTarget* mainThreadTarget) {
   nsresult rv = NS_ERROR_OUT_OF_MEMORY;
   RefPtr pump = new nsInputStreamPump();
   if (pump) {
@@ -68,26 +68,26 @@ nsresult nsInputStreamPump::Create(nsInputStreamPump **result,
 }
 
 struct PeekData {
-  PeekData(nsInputStreamPump::PeekSegmentFun fun, void *closure)
+  PeekData(nsInputStreamPump::PeekSegmentFun fun, void* closure)
       : mFunc(fun), mClosure(closure) {}
 
   nsInputStreamPump::PeekSegmentFun mFunc;
-  void *mClosure;
+  void* mClosure;
 };
 
-static nsresult CallPeekFunc(nsIInputStream *aInStream, void *aClosure,
-                             const char *aFromSegment, uint32_t aToOffset,
-                             uint32_t aCount, uint32_t *aWriteCount) {
+static nsresult CallPeekFunc(nsIInputStream* aInStream, void* aClosure,
+                             const char* aFromSegment, uint32_t aToOffset,
+                             uint32_t aCount, uint32_t* aWriteCount) {
   NS_ASSERTION(aToOffset == 0, "Called more than once?");
   NS_ASSERTION(aCount > 0, "Called without data?");
 
-  PeekData *data = static_cast(aClosure);
-  data->mFunc(data->mClosure, reinterpret_cast(aFromSegment),
+  PeekData* data = static_cast(aClosure);
+  data->mFunc(data->mClosure, reinterpret_cast(aFromSegment),
               aCount);
   return NS_BINDING_ABORTED;
 }
 
-nsresult nsInputStreamPump::PeekStream(PeekSegmentFun callback, void *closure) {
+nsresult nsInputStreamPump::PeekStream(PeekSegmentFun callback, void* closure) {
   RecursiveMutexAutoLock lock(mMutex);
 
   MOZ_ASSERT(mAsyncStream, "PeekStream called without stream");
@@ -151,7 +151,7 @@ NS_IMPL_ISUPPORTS(nsInputStreamPump, nsIRequest, nsIThreadRetargetableRequest,
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsInputStreamPump::GetName(nsACString &result) {
+nsInputStreamPump::GetName(nsACString& result) {
   RecursiveMutexAutoLock lock(mMutex);
 
   result.Truncate();
@@ -159,7 +159,7 @@ nsInputStreamPump::GetName(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsInputStreamPump::IsPending(bool *result) {
+nsInputStreamPump::IsPending(bool* result) {
   RecursiveMutexAutoLock lock(mMutex);
 
   *result = (mState != STATE_IDLE);
@@ -167,7 +167,7 @@ nsInputStreamPump::IsPending(bool *result) {
 }
 
 NS_IMETHODIMP
-nsInputStreamPump::GetStatus(nsresult *status) {
+nsInputStreamPump::GetStatus(nsresult* status) {
   RecursiveMutexAutoLock lock(mMutex);
 
   *status = mStatus;
@@ -229,7 +229,7 @@ nsInputStreamPump::Resume() {
 }
 
 NS_IMETHODIMP
-nsInputStreamPump::GetLoadFlags(nsLoadFlags *aLoadFlags) {
+nsInputStreamPump::GetLoadFlags(nsLoadFlags* aLoadFlags) {
   RecursiveMutexAutoLock lock(mMutex);
 
   *aLoadFlags = mLoadFlags;
@@ -245,7 +245,7 @@ nsInputStreamPump::SetLoadFlags(nsLoadFlags aLoadFlags) {
 }
 
 NS_IMETHODIMP
-nsInputStreamPump::GetLoadGroup(nsILoadGroup **aLoadGroup) {
+nsInputStreamPump::GetLoadGroup(nsILoadGroup** aLoadGroup) {
   RecursiveMutexAutoLock lock(mMutex);
 
   NS_IF_ADDREF(*aLoadGroup = mLoadGroup);
@@ -253,7 +253,7 @@ nsInputStreamPump::GetLoadGroup(nsILoadGroup **aLoadGroup) {
 }
 
 NS_IMETHODIMP
-nsInputStreamPump::SetLoadGroup(nsILoadGroup *aLoadGroup) {
+nsInputStreamPump::SetLoadGroup(nsILoadGroup* aLoadGroup) {
   RecursiveMutexAutoLock lock(mMutex);
 
   mLoadGroup = aLoadGroup;
@@ -265,9 +265,9 @@ nsInputStreamPump::SetLoadGroup(nsILoadGroup *aLoadGroup) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsInputStreamPump::Init(nsIInputStream *stream, uint32_t segsize,
+nsInputStreamPump::Init(nsIInputStream* stream, uint32_t segsize,
                         uint32_t segcount, bool closeWhenDone,
-                        nsIEventTarget *mainThreadTarget) {
+                        nsIEventTarget* mainThreadTarget) {
   NS_ENSURE_TRUE(mState == STATE_IDLE, NS_ERROR_IN_PROGRESS);
 
   mStream = stream;
@@ -280,7 +280,7 @@ nsInputStreamPump::Init(nsIInputStream *stream, uint32_t segsize,
 }
 
 NS_IMETHODIMP
-nsInputStreamPump::AsyncRead(nsIStreamListener *listener, nsISupports *ctxt) {
+nsInputStreamPump::AsyncRead(nsIStreamListener* listener, nsISupports* ctxt) {
   RecursiveMutexAutoLock lock(mMutex);
 
   NS_ENSURE_TRUE(mState == STATE_IDLE, NS_ERROR_IN_PROGRESS);
@@ -361,7 +361,7 @@ nsInputStreamPump::AsyncRead(nsIStreamListener *listener, nsISupports *ctxt) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *stream) {
+nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream* stream) {
   LOG(("nsInputStreamPump::OnInputStreamReady [this=%p]\n", this));
 
   AUTO_PROFILER_LABEL("nsInputStreamPump::OnInputStreamReady", NETWORK);
@@ -692,7 +692,7 @@ nsresult nsInputStreamPump::CreateBufferedStreamIfNeeded() {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsInputStreamPump::RetargetDeliveryTo(nsIEventTarget *aNewTarget) {
+nsInputStreamPump::RetargetDeliveryTo(nsIEventTarget* aNewTarget) {
   RecursiveMutexAutoLock lock(mMutex);
 
   NS_ENSURE_ARG(aNewTarget);
@@ -725,12 +725,12 @@ nsInputStreamPump::RetargetDeliveryTo(nsIEventTarget *aNewTarget) {
       ("nsInputStreamPump::RetargetDeliveryTo [this=%p aNewTarget=%p] "
        "%s listener [%p] rv[%" PRIx32 "]",
        this, aNewTarget, (mTargetThread == aNewTarget ? "success" : "failure"),
-       (nsIStreamListener *)mListener, static_cast(rv)));
+       (nsIStreamListener*)mListener, static_cast(rv)));
   return rv;
 }
 
 NS_IMETHODIMP
-nsInputStreamPump::GetDeliveryTarget(nsIEventTarget **aNewTarget) {
+nsInputStreamPump::GetDeliveryTarget(nsIEventTarget** aNewTarget) {
   RecursiveMutexAutoLock lock(mMutex);
 
   nsCOMPtr target = mTargetThread;
diff --git a/netwerk/base/nsInputStreamPump.h b/netwerk/base/nsInputStreamPump.h
index e66ba7f928175..e24d41d265ff9 100644
--- a/netwerk/base/nsInputStreamPump.h
+++ b/netwerk/base/nsInputStreamPump.h
@@ -33,12 +33,12 @@ class nsInputStreamPump final : public nsIInputStreamPump,
 
   nsInputStreamPump();
 
-  static nsresult Create(nsInputStreamPump **result, nsIInputStream *stream,
+  static nsresult Create(nsInputStreamPump** result, nsIInputStream* stream,
                          uint32_t segsize = 0, uint32_t segcount = 0,
                          bool closeWhenDone = false,
-                         nsIEventTarget *mainThreadTarget = nullptr);
+                         nsIEventTarget* mainThreadTarget = nullptr);
 
-  typedef void (*PeekSegmentFun)(void *closure, const uint8_t *buf,
+  typedef void (*PeekSegmentFun)(void* closure, const uint8_t* buf,
                                  uint32_t bufLen);
   /**
    * Peek into the first chunk of data that's in the stream. Note that this
@@ -50,7 +50,7 @@ class nsInputStreamPump final : public nsIInputStreamPump,
    *
    * Do not call before asyncRead. Do not call after onStopRequest.
    */
-  nsresult PeekStream(PeekSegmentFun callback, void *closure);
+  nsresult PeekStream(PeekSegmentFun callback, void* closure);
 
   /**
    * Dispatched (to the main thread) by OnStateStop if it's called off main
diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp
index 23462c7fc8c90..895fdc1582546 100644
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -46,29 +46,29 @@ static LazyLogModule gLoadGroupLog("LoadGroup");
 
 class RequestMapEntry : public PLDHashEntryHdr {
  public:
-  explicit RequestMapEntry(nsIRequest *aRequest) : mKey(aRequest) {}
+  explicit RequestMapEntry(nsIRequest* aRequest) : mKey(aRequest) {}
 
   nsCOMPtr mKey;
 };
 
-static bool RequestHashMatchEntry(const PLDHashEntryHdr *entry,
-                                  const void *key) {
-  const RequestMapEntry *e = static_cast(entry);
-  const nsIRequest *request = static_cast(key);
+static bool RequestHashMatchEntry(const PLDHashEntryHdr* entry,
+                                  const void* key) {
+  const RequestMapEntry* e = static_cast(entry);
+  const nsIRequest* request = static_cast(key);
 
   return e->mKey == request;
 }
 
-static void RequestHashClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry) {
-  RequestMapEntry *e = static_cast(entry);
+static void RequestHashClearEntry(PLDHashTable* table, PLDHashEntryHdr* entry) {
+  RequestMapEntry* e = static_cast(entry);
 
   // An entry is being cleared, let the entry do its own cleanup.
   e->~RequestMapEntry();
 }
 
-static void RequestHashInitEntry(PLDHashEntryHdr *entry, const void *key) {
-  const nsIRequest *const_request = static_cast(key);
-  nsIRequest *request = const_cast(const_request);
+static void RequestHashInitEntry(PLDHashEntryHdr* entry, const void* key) {
+  const nsIRequest* const_request = static_cast(key);
+  nsIRequest* request = const_cast(const_request);
 
   // Initialize the entry with placement new
   new (entry) RequestMapEntry(request);
@@ -78,7 +78,7 @@ static const PLDHashTableOps sRequestHashOps = {
     PLDHashTable::HashVoidPtrKeyStub, RequestHashMatchEntry,
     PLDHashTable::MoveEntryStub, RequestHashClearEntry, RequestHashInitEntry};
 
-static void RescheduleRequest(nsIRequest *aRequest, int32_t delta) {
+static void RescheduleRequest(nsIRequest* aRequest, int32_t delta) {
   nsCOMPtr p = do_QueryInterface(aRequest);
   if (p) p->AdjustPriority(delta);
 }
@@ -120,7 +120,7 @@ NS_IMPL_ISUPPORTS(nsLoadGroup, nsILoadGroup, nsILoadGroupChild, nsIRequest,
 // nsIRequest methods:
 
 NS_IMETHODIMP
-nsLoadGroup::GetName(nsACString &result) {
+nsLoadGroup::GetName(nsACString& result) {
   // XXX is this the right "name" for a load group?
 
   if (!mDefaultLoadRequest) {
@@ -132,13 +132,13 @@ nsLoadGroup::GetName(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::IsPending(bool *aResult) {
+nsLoadGroup::IsPending(bool* aResult) {
   *aResult = (mForegroundCount > 0) ? true : false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetStatus(nsresult *status) {
+nsLoadGroup::GetStatus(nsresult* status) {
   if (NS_SUCCEEDED(mStatus) && mDefaultLoadRequest)
     return mDefaultLoadRequest->GetStatus(status);
 
@@ -146,11 +146,11 @@ nsLoadGroup::GetStatus(nsresult *status) {
   return NS_OK;
 }
 
-static bool AppendRequestsToArray(PLDHashTable *aTable,
-                                  nsTArray *aArray) {
+static bool AppendRequestsToArray(PLDHashTable* aTable,
+                                  nsTArray* aArray) {
   for (auto iter = aTable->Iter(); !iter.Done(); iter.Next()) {
-    auto e = static_cast(iter.Get());
-    nsIRequest *request = e->mKey;
+    auto e = static_cast(iter.Get());
+    nsIRequest* request = e->mKey;
     NS_ASSERTION(request, "What? Null key in PLDHashTable entry?");
 
     bool ok = !!aArray->AppendElement(request);
@@ -177,7 +177,7 @@ nsLoadGroup::Cancel(nsresult status) {
   nsresult rv;
   uint32_t count = mRequests.EntryCount();
 
-  AutoTArray requests;
+  AutoTArray requests;
 
   if (!AppendRequestsToArray(&mRequests, &requests)) {
     return NS_ERROR_OUT_OF_MEMORY;
@@ -247,7 +247,7 @@ nsLoadGroup::Suspend() {
   nsresult rv, firstError;
   uint32_t count = mRequests.EntryCount();
 
-  AutoTArray requests;
+  AutoTArray requests;
 
   if (!AppendRequestsToArray(&mRequests, &requests)) {
     return NS_ERROR_OUT_OF_MEMORY;
@@ -286,7 +286,7 @@ nsLoadGroup::Resume() {
   nsresult rv, firstError;
   uint32_t count = mRequests.EntryCount();
 
-  AutoTArray requests;
+  AutoTArray requests;
 
   if (!AppendRequestsToArray(&mRequests, &requests)) {
     return NS_ERROR_OUT_OF_MEMORY;
@@ -321,7 +321,7 @@ nsLoadGroup::Resume() {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetLoadFlags(uint32_t *aLoadFlags) {
+nsLoadGroup::GetLoadFlags(uint32_t* aLoadFlags) {
   *aLoadFlags = mLoadFlags;
   return NS_OK;
 }
@@ -333,14 +333,14 @@ nsLoadGroup::SetLoadFlags(uint32_t aLoadFlags) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetLoadGroup(nsILoadGroup **loadGroup) {
+nsLoadGroup::GetLoadGroup(nsILoadGroup** loadGroup) {
   nsCOMPtr result = mLoadGroup;
   result.forget(loadGroup);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::SetLoadGroup(nsILoadGroup *loadGroup) {
+nsLoadGroup::SetLoadGroup(nsILoadGroup* loadGroup) {
   mLoadGroup = loadGroup;
   return NS_OK;
 }
@@ -349,14 +349,14 @@ nsLoadGroup::SetLoadGroup(nsILoadGroup *loadGroup) {
 // nsILoadGroup methods:
 
 NS_IMETHODIMP
-nsLoadGroup::GetDefaultLoadRequest(nsIRequest **aRequest) {
+nsLoadGroup::GetDefaultLoadRequest(nsIRequest** aRequest) {
   nsCOMPtr result = mDefaultLoadRequest;
   result.forget(aRequest);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::SetDefaultLoadRequest(nsIRequest *aRequest) {
+nsLoadGroup::SetDefaultLoadRequest(nsIRequest* aRequest) {
   LOG(("nsLoadGroup::SetDefaultLoadRequest this=%p default-request=%p", this,
        aRequest));
 
@@ -382,7 +382,7 @@ nsLoadGroup::SetDefaultLoadRequest(nsIRequest *aRequest) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::AddRequest(nsIRequest *request, nsISupports *ctxt) {
+nsLoadGroup::AddRequest(nsIRequest* request, nsISupports* ctxt) {
   nsresult rv;
 
   if (MOZ_LOG_TEST(gLoadGroupLog, LogLevel::Debug)) {
@@ -422,7 +422,7 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports *ctxt) {
   // Add the request to the list of active requests...
   //
 
-  auto entry = static_cast(mRequests.Add(request, fallible));
+  auto entry = static_cast(mRequests.Add(request, fallible));
   if (!entry) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
@@ -476,7 +476,7 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports *ctxt) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports *ctxt,
+nsLoadGroup::RemoveRequest(nsIRequest* request, nsISupports* ctxt,
                            nsresult aStatus) {
   NS_ENSURE_ARG_POINTER(request);
   nsresult rv;
@@ -500,7 +500,7 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports *ctxt,
   // the request was *not* in the group so do not update the foreground
   // count or it will get messed up...
   //
-  auto entry = static_cast(mRequests.Search(request));
+  auto entry = static_cast(mRequests.Search(request));
 
   if (!entry) {
     LOG(("LOADGROUP [%p]: Unable to remove request %p. Not in group!\n", this,
@@ -583,12 +583,12 @@ nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports *ctxt,
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetRequests(nsISimpleEnumerator **aRequests) {
+nsLoadGroup::GetRequests(nsISimpleEnumerator** aRequests) {
   nsCOMArray requests;
   requests.SetCapacity(mRequests.EntryCount());
 
   for (auto iter = mRequests.Iter(); !iter.Done(); iter.Next()) {
-    auto e = static_cast(iter.Get());
+    auto e = static_cast(iter.Get());
     requests.AppendObject(e->mKey);
   }
 
@@ -596,26 +596,26 @@ nsLoadGroup::GetRequests(nsISimpleEnumerator **aRequests) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::SetGroupObserver(nsIRequestObserver *aObserver) {
+nsLoadGroup::SetGroupObserver(nsIRequestObserver* aObserver) {
   mObserver = do_GetWeakReference(aObserver);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetGroupObserver(nsIRequestObserver **aResult) {
+nsLoadGroup::GetGroupObserver(nsIRequestObserver** aResult) {
   nsCOMPtr observer = do_QueryReferent(mObserver);
   observer.forget(aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetActiveCount(uint32_t *aResult) {
+nsLoadGroup::GetActiveCount(uint32_t* aResult) {
   *aResult = mForegroundCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks) {
+nsLoadGroup::GetNotificationCallbacks(nsIInterfaceRequestor** aCallbacks) {
   NS_ENSURE_ARG_POINTER(aCallbacks);
   nsCOMPtr callbacks = mCallbacks;
   callbacks.forget(aCallbacks);
@@ -623,13 +623,13 @@ nsLoadGroup::GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) {
+nsLoadGroup::SetNotificationCallbacks(nsIInterfaceRequestor* aCallbacks) {
   mCallbacks = aCallbacks;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetRequestContextID(uint64_t *aRCID) {
+nsLoadGroup::GetRequestContextID(uint64_t* aRCID) {
   if (!mRequestContext) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -641,7 +641,7 @@ nsLoadGroup::GetRequestContextID(uint64_t *aRCID) {
 // nsILoadGroupChild methods:
 
 NS_IMETHODIMP
-nsLoadGroup::GetParentLoadGroup(nsILoadGroup **aParentLoadGroup) {
+nsLoadGroup::GetParentLoadGroup(nsILoadGroup** aParentLoadGroup) {
   *aParentLoadGroup = nullptr;
   nsCOMPtr parent = do_QueryReferent(mParentLoadGroup);
   if (!parent) return NS_OK;
@@ -650,19 +650,19 @@ nsLoadGroup::GetParentLoadGroup(nsILoadGroup **aParentLoadGroup) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::SetParentLoadGroup(nsILoadGroup *aParentLoadGroup) {
+nsLoadGroup::SetParentLoadGroup(nsILoadGroup* aParentLoadGroup) {
   mParentLoadGroup = do_GetWeakReference(aParentLoadGroup);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetChildLoadGroup(nsILoadGroup **aChildLoadGroup) {
+nsLoadGroup::GetChildLoadGroup(nsILoadGroup** aChildLoadGroup) {
   NS_ADDREF(*aChildLoadGroup = this);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetRootLoadGroup(nsILoadGroup **aRootLoadGroup) {
+nsLoadGroup::GetRootLoadGroup(nsILoadGroup** aRootLoadGroup) {
   // first recursively try the root load group of our parent
   nsCOMPtr ancestor = do_QueryReferent(mParentLoadGroup);
   if (ancestor) return ancestor->GetRootLoadGroup(aRootLoadGroup);
@@ -680,7 +680,7 @@ nsLoadGroup::GetRootLoadGroup(nsILoadGroup **aRootLoadGroup) {
 // nsISupportsPriority methods:
 
 NS_IMETHODIMP
-nsLoadGroup::GetPriority(int32_t *aValue) {
+nsLoadGroup::GetPriority(int32_t* aValue) {
   *aValue = mPriority;
   return NS_OK;
 }
@@ -696,7 +696,7 @@ nsLoadGroup::AdjustPriority(int32_t aDelta) {
   if (aDelta != 0) {
     mPriority += aDelta;
     for (auto iter = mRequests.Iter(); !iter.Done(); iter.Next()) {
-      auto e = static_cast(iter.Get());
+      auto e = static_cast(iter.Get());
       RescheduleRequest(e->mKey, aDelta);
     }
   }
@@ -704,7 +704,7 @@ nsLoadGroup::AdjustPriority(int32_t aDelta) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetDefaultLoadFlags(uint32_t *aFlags) {
+nsLoadGroup::GetDefaultLoadFlags(uint32_t* aFlags) {
   *aFlags = mDefaultLoadFlags;
   return NS_OK;
 }
@@ -716,14 +716,14 @@ nsLoadGroup::SetDefaultLoadFlags(uint32_t aFlags) {
 }
 
 NS_IMETHODIMP
-nsLoadGroup::GetUserAgentOverrideCache(nsACString &aUserAgentOverrideCache) {
+nsLoadGroup::GetUserAgentOverrideCache(nsACString& aUserAgentOverrideCache) {
   aUserAgentOverrideCache = mUserAgentOverrideCache;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsLoadGroup::SetUserAgentOverrideCache(
-    const nsACString &aUserAgentOverrideCache) {
+    const nsACString& aUserAgentOverrideCache) {
   mUserAgentOverrideCache = aUserAgentOverrideCache;
   return NS_OK;
 }
@@ -754,7 +754,7 @@ void nsLoadGroup::TelemetryReport() {
   mDefaultLoadIsTimed = false;
 }
 
-void nsLoadGroup::TelemetryReportChannel(nsITimedChannel *aTimedChannel,
+void nsLoadGroup::TelemetryReportChannel(nsITimedChannel* aTimedChannel,
                                          bool aDefaultRequest) {
   nsresult rv;
   bool timingEnabled;
@@ -881,8 +881,8 @@ void nsLoadGroup::TelemetryReportChannel(nsITimedChannel *aTimedChannel,
 #undef HTTP_REQUEST_HISTOGRAMS
 }
 
-nsresult nsLoadGroup::MergeLoadFlags(nsIRequest *aRequest,
-                                     nsLoadFlags &outFlags) {
+nsresult nsLoadGroup::MergeLoadFlags(nsIRequest* aRequest,
+                                     nsLoadFlags& outFlags) {
   nsresult rv;
   nsLoadFlags flags, oldFlags;
 
@@ -909,8 +909,8 @@ nsresult nsLoadGroup::MergeLoadFlags(nsIRequest *aRequest,
   return rv;
 }
 
-nsresult nsLoadGroup::MergeDefaultLoadFlags(nsIRequest *aRequest,
-                                            nsLoadFlags &outFlags) {
+nsresult nsLoadGroup::MergeDefaultLoadFlags(nsIRequest* aRequest,
+                                            nsLoadFlags& outFlags) {
   nsresult rv;
   nsLoadFlags flags, oldFlags;
 
diff --git a/netwerk/base/nsMIMEInputStream.h b/netwerk/base/nsMIMEInputStream.h
index 7084ceda0b33d..48cad0f3b1dd9 100644
--- a/netwerk/base/nsMIMEInputStream.h
+++ b/netwerk/base/nsMIMEInputStream.h
@@ -21,7 +21,7 @@
     }                                                \
   }
 
-extern nsresult nsMIMEInputStreamConstructor(nsISupports *outer, REFNSIID iid,
-                                             void **result);
+extern nsresult nsMIMEInputStreamConstructor(nsISupports* outer, REFNSIID iid,
+                                             void** result);
 
 #endif  // _nsMIMEInputStream_h_
diff --git a/netwerk/base/nsNetAddr.cpp b/netwerk/base/nsNetAddr.cpp
index f0d8cf354e3ea..e64ab9c4a64d2 100644
--- a/netwerk/base/nsNetAddr.cpp
+++ b/netwerk/base/nsNetAddr.cpp
@@ -13,12 +13,12 @@ using namespace mozilla::net;
 NS_IMPL_ISUPPORTS(nsNetAddr, nsINetAddr)
 
 /* Makes a copy of |addr| */
-nsNetAddr::nsNetAddr(NetAddr *addr) {
+nsNetAddr::nsNetAddr(NetAddr* addr) {
   NS_ASSERTION(addr, "null addr");
   mAddr = *addr;
 }
 
-NS_IMETHODIMP nsNetAddr::GetFamily(uint16_t *aFamily) {
+NS_IMETHODIMP nsNetAddr::GetFamily(uint16_t* aFamily) {
   switch (mAddr.raw.family) {
     case AF_INET:
       *aFamily = nsINetAddr::FAMILY_INET;
@@ -38,7 +38,7 @@ NS_IMETHODIMP nsNetAddr::GetFamily(uint16_t *aFamily) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsNetAddr::GetAddress(nsACString &aAddress) {
+NS_IMETHODIMP nsNetAddr::GetAddress(nsACString& aAddress) {
   switch (mAddr.raw.family) {
     /* PR_NetAddrToString can handle INET and INET6, but not LOCAL. */
     case AF_INET:
@@ -64,7 +64,7 @@ NS_IMETHODIMP nsNetAddr::GetAddress(nsACString &aAddress) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsNetAddr::GetPort(uint16_t *aPort) {
+NS_IMETHODIMP nsNetAddr::GetPort(uint16_t* aPort) {
   switch (mAddr.raw.family) {
     case AF_INET:
       *aPort = ntohs(mAddr.inet.port);
@@ -84,7 +84,7 @@ NS_IMETHODIMP nsNetAddr::GetPort(uint16_t *aPort) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsNetAddr::GetFlow(uint32_t *aFlow) {
+NS_IMETHODIMP nsNetAddr::GetFlow(uint32_t* aFlow) {
   switch (mAddr.raw.family) {
     case AF_INET6:
       *aFlow = ntohl(mAddr.inet6.flowinfo);
@@ -102,7 +102,7 @@ NS_IMETHODIMP nsNetAddr::GetFlow(uint32_t *aFlow) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsNetAddr::GetScope(uint32_t *aScope) {
+NS_IMETHODIMP nsNetAddr::GetScope(uint32_t* aScope) {
   switch (mAddr.raw.family) {
     case AF_INET6:
       *aScope = ntohl(mAddr.inet6.scope_id);
@@ -120,7 +120,7 @@ NS_IMETHODIMP nsNetAddr::GetScope(uint32_t *aScope) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsNetAddr::GetIsV4Mapped(bool *aIsV4Mapped) {
+NS_IMETHODIMP nsNetAddr::GetIsV4Mapped(bool* aIsV4Mapped) {
   switch (mAddr.raw.family) {
     case AF_INET6:
       *aIsV4Mapped = IPv6ADDR_IS_V4MAPPED(&mAddr.inet6.ip);
@@ -138,7 +138,7 @@ NS_IMETHODIMP nsNetAddr::GetIsV4Mapped(bool *aIsV4Mapped) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsNetAddr::GetNetAddr(NetAddr *aResult) {
+NS_IMETHODIMP nsNetAddr::GetNetAddr(NetAddr* aResult) {
   memcpy(aResult, &mAddr, sizeof(mAddr));
   return NS_OK;
 }
diff --git a/netwerk/base/nsNetSegmentUtils.h b/netwerk/base/nsNetSegmentUtils.h
index f85e57de3ee26..a65defdb50a26 100644
--- a/netwerk/base/nsNetSegmentUtils.h
+++ b/netwerk/base/nsNetSegmentUtils.h
@@ -10,8 +10,8 @@
 /**
  * applies defaults to segment params in a consistent way.
  */
-static inline void net_ResolveSegmentParams(uint32_t &segsize,
-                                            uint32_t &segcount) {
+static inline void net_ResolveSegmentParams(uint32_t& segsize,
+                                            uint32_t& segcount) {
   if (!segsize) segsize = mozilla::net::nsIOService::gDefaultSegmentSize;
 
   if (!segcount) segcount = mozilla::net::nsIOService::gDefaultSegmentCount;
diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp
index 20421d82bb555..e23b6e6a09266 100644
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -111,13 +111,13 @@ static uint32_t sDefaultTrackerRp = DEFAULT_TRACKER_RP;
 static uint32_t defaultPrivateRp = DEFAULT_PRIVATE_RP;
 static uint32_t defaultTrackerPrivateRp = DEFAULT_TRACKER_PRIVATE_RP;
 
-already_AddRefed do_GetIOService(nsresult *error /* = 0 */) {
+already_AddRefed do_GetIOService(nsresult* error /* = 0 */) {
   nsCOMPtr io = mozilla::services::GetIOService();
   if (error) *error = io ? NS_OK : NS_ERROR_FAILURE;
   return io.forget();
 }
 
-nsresult NS_NewLocalFileInputStream(nsIInputStream **result, nsIFile *file,
+nsresult NS_NewLocalFileInputStream(nsIInputStream** result, nsIFile* file,
                                     int32_t ioFlags /* = -1 */,
                                     int32_t perm /* = -1 */,
                                     int32_t behaviorFlags /* = 0 */) {
@@ -131,7 +131,7 @@ nsresult NS_NewLocalFileInputStream(nsIInputStream **result, nsIFile *file,
   return rv;
 }
 
-nsresult NS_NewLocalFileOutputStream(nsIOutputStream **result, nsIFile *file,
+nsresult NS_NewLocalFileOutputStream(nsIOutputStream** result, nsIFile* file,
                                      int32_t ioFlags /* = -1 */,
                                      int32_t perm /* = -1 */,
                                      int32_t behaviorFlags /* = 0 */) {
@@ -145,7 +145,7 @@ nsresult NS_NewLocalFileOutputStream(nsIOutputStream **result, nsIFile *file,
   return rv;
 }
 
-nsresult net_EnsureIOService(nsIIOService **ios, nsCOMPtr &grip) {
+nsresult net_EnsureIOService(nsIIOService** ios, nsCOMPtr& grip) {
   nsresult rv = NS_OK;
   if (!*ios) {
     grip = do_GetIOService(&rv);
@@ -155,9 +155,9 @@ nsresult net_EnsureIOService(nsIIOService **ios, nsCOMPtr &grip) {
 }
 
 nsresult NS_NewFileURI(
-    nsIURI **result, nsIFile *spec,
-    nsIIOService
-        *ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
+    nsIURI** result, nsIFile* spec,
+    nsIIOService*
+        ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
 {
   nsresult rv;
   nsCOMPtr grip;
@@ -166,8 +166,8 @@ nsresult NS_NewFileURI(
   return rv;
 }
 
-nsresult NS_GetURIWithNewRef(nsIURI *aInput, const nsACString &aRef,
-                             nsIURI **aOutput) {
+nsresult NS_GetURIWithNewRef(nsIURI* aInput, const nsACString& aRef,
+                             nsIURI** aOutput) {
   if (NS_WARN_IF(!aInput || !aOutput)) {
     return NS_ERROR_INVALID_ARG;
   }
@@ -194,17 +194,17 @@ nsresult NS_GetURIWithNewRef(nsIURI *aInput, const nsACString &aRef,
   return NS_MutateURI(aInput).SetRef(aRef).Finalize(aOutput);
 }
 
-nsresult NS_GetURIWithoutRef(nsIURI *aInput, nsIURI **aOutput) {
+nsresult NS_GetURIWithoutRef(nsIURI* aInput, nsIURI** aOutput) {
   return NS_GetURIWithNewRef(aInput, EmptyCString(), aOutput);
 }
 
 nsresult NS_NewChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri, nsILoadInfo *aLoadInfo,
-    PerformanceStorage *aPerformanceStorage /* = nullptr */,
-    nsILoadGroup *aLoadGroup /* = nullptr */,
-    nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+    nsIChannel** outChannel, nsIURI* aUri, nsILoadInfo* aLoadInfo,
+    PerformanceStorage* aPerformanceStorage /* = nullptr */,
+    nsILoadGroup* aLoadGroup /* = nullptr */,
+    nsIInterfaceRequestor* aCallbacks /* = nullptr */,
     nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-    nsIIOService *aIoService /* = nullptr */) {
+    nsIIOService* aIoService /* = nullptr */) {
   // NS_NewChannelInternal is mostly called for channel redirects. We should
   // allow the creation of a channel even if the original channel did not have a
   // loadinfo attached.
@@ -255,7 +255,7 @@ nsresult NS_NewChannelInternal(
 namespace {
 
 void AssertLoadingPrincipalAndClientInfoMatch(
-    nsIPrincipal *aLoadingPrincipal, const ClientInfo &aLoadingClientInfo,
+    nsIPrincipal* aLoadingPrincipal, const ClientInfo& aLoadingClientInfo,
     nsContentPolicyType aType) {
 #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
   // Verify that the provided loading ClientInfo matches the loading
@@ -300,16 +300,16 @@ void AssertLoadingPrincipalAndClientInfoMatch(
 
 }  // namespace
 
-nsresult NS_NewChannel(nsIChannel **outChannel, nsIURI *aUri,
-                       nsIPrincipal *aLoadingPrincipal,
+nsresult NS_NewChannel(nsIChannel** outChannel, nsIURI* aUri,
+                       nsIPrincipal* aLoadingPrincipal,
                        nsSecurityFlags aSecurityFlags,
                        nsContentPolicyType aContentPolicyType,
-                       nsICookieSettings *aCookieSettings /* = nullptr */,
-                       PerformanceStorage *aPerformanceStorage /* = nullptr */,
-                       nsILoadGroup *aLoadGroup /* = nullptr */,
-                       nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+                       nsICookieSettings* aCookieSettings /* = nullptr */,
+                       PerformanceStorage* aPerformanceStorage /* = nullptr */,
+                       nsILoadGroup* aLoadGroup /* = nullptr */,
+                       nsIInterfaceRequestor* aCallbacks /* = nullptr */,
                        nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-                       nsIIOService *aIoService /* = nullptr */) {
+                       nsIIOService* aIoService /* = nullptr */) {
   return NS_NewChannelInternal(
       outChannel, aUri,
       nullptr,  // aLoadingNode,
@@ -320,18 +320,18 @@ nsresult NS_NewChannel(nsIChannel **outChannel, nsIURI *aUri,
       aCallbacks, aLoadFlags, aIoService);
 }
 
-nsresult NS_NewChannel(nsIChannel **outChannel, nsIURI *aUri,
-                       nsIPrincipal *aLoadingPrincipal,
-                       const ClientInfo &aLoadingClientInfo,
-                       const Maybe &aController,
+nsresult NS_NewChannel(nsIChannel** outChannel, nsIURI* aUri,
+                       nsIPrincipal* aLoadingPrincipal,
+                       const ClientInfo& aLoadingClientInfo,
+                       const Maybe& aController,
                        nsSecurityFlags aSecurityFlags,
                        nsContentPolicyType aContentPolicyType,
-                       nsICookieSettings *aCookieSettings /* = nullptr */,
-                       PerformanceStorage *aPerformanceStorage /* = nullptr */,
-                       nsILoadGroup *aLoadGroup /* = nullptr */,
-                       nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+                       nsICookieSettings* aCookieSettings /* = nullptr */,
+                       PerformanceStorage* aPerformanceStorage /* = nullptr */,
+                       nsILoadGroup* aLoadGroup /* = nullptr */,
+                       nsIInterfaceRequestor* aCallbacks /* = nullptr */,
                        nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-                       nsIIOService *aIoService /* = nullptr */) {
+                       nsIIOService* aIoService /* = nullptr */) {
   AssertLoadingPrincipalAndClientInfoMatch(
       aLoadingPrincipal, aLoadingClientInfo, aContentPolicyType);
 
@@ -349,17 +349,17 @@ nsresult NS_NewChannel(nsIChannel **outChannel, nsIURI *aUri,
 }
 
 nsresult NS_NewChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri, nsINode *aLoadingNode,
-    nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal,
-    const Maybe &aLoadingClientInfo,
-    const Maybe &aController,
+    nsIChannel** outChannel, nsIURI* aUri, nsINode* aLoadingNode,
+    nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
+    const Maybe& aLoadingClientInfo,
+    const Maybe& aController,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    nsICookieSettings *aCookieSettings /* = nullptr */,
-    PerformanceStorage *aPerformanceStorage /* = nullptr */,
-    nsILoadGroup *aLoadGroup /* = nullptr */,
-    nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+    nsICookieSettings* aCookieSettings /* = nullptr */,
+    PerformanceStorage* aPerformanceStorage /* = nullptr */,
+    nsILoadGroup* aLoadGroup /* = nullptr */,
+    nsIInterfaceRequestor* aCallbacks /* = nullptr */,
     nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-    nsIIOService *aIoService /* = nullptr */) {
+    nsIIOService* aIoService /* = nullptr */) {
   NS_ENSURE_ARG_POINTER(outChannel);
 
   nsCOMPtr grip;
@@ -417,14 +417,14 @@ nsresult NS_NewChannelInternal(
 
 nsresult /*NS_NewChannelWithNodeAndTriggeringPrincipal */
 NS_NewChannelWithTriggeringPrincipal(
-    nsIChannel **outChannel, nsIURI *aUri, nsINode *aLoadingNode,
-    nsIPrincipal *aTriggeringPrincipal, nsSecurityFlags aSecurityFlags,
+    nsIChannel** outChannel, nsIURI* aUri, nsINode* aLoadingNode,
+    nsIPrincipal* aTriggeringPrincipal, nsSecurityFlags aSecurityFlags,
     nsContentPolicyType aContentPolicyType,
-    PerformanceStorage *aPerformanceStorage /* = nullptr */,
-    nsILoadGroup *aLoadGroup /* = nullptr */,
-    nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+    PerformanceStorage* aPerformanceStorage /* = nullptr */,
+    nsILoadGroup* aLoadGroup /* = nullptr */,
+    nsIInterfaceRequestor* aCallbacks /* = nullptr */,
     nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-    nsIIOService *aIoService /* = nullptr */) {
+    nsIIOService* aIoService /* = nullptr */) {
   MOZ_ASSERT(aLoadingNode);
   NS_ASSERTION(aTriggeringPrincipal,
                "Can not create channel without a triggering Principal!");
@@ -438,15 +438,15 @@ NS_NewChannelWithTriggeringPrincipal(
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult NS_NewChannelWithTriggeringPrincipal(
-    nsIChannel **outChannel, nsIURI *aUri, nsIPrincipal *aLoadingPrincipal,
-    nsIPrincipal *aTriggeringPrincipal, nsSecurityFlags aSecurityFlags,
+    nsIChannel** outChannel, nsIURI* aUri, nsIPrincipal* aLoadingPrincipal,
+    nsIPrincipal* aTriggeringPrincipal, nsSecurityFlags aSecurityFlags,
     nsContentPolicyType aContentPolicyType,
-    nsICookieSettings *aCookieSettings /* = nullptr */,
-    PerformanceStorage *aPerformanceStorage /* = nullptr */,
-    nsILoadGroup *aLoadGroup /* = nullptr */,
-    nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+    nsICookieSettings* aCookieSettings /* = nullptr */,
+    PerformanceStorage* aPerformanceStorage /* = nullptr */,
+    nsILoadGroup* aLoadGroup /* = nullptr */,
+    nsIInterfaceRequestor* aCallbacks /* = nullptr */,
     nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-    nsIIOService *aIoService /* = nullptr */) {
+    nsIIOService* aIoService /* = nullptr */) {
   NS_ASSERTION(aLoadingPrincipal,
                "Can not create channel without a loading Principal!");
   return NS_NewChannelInternal(
@@ -460,16 +460,16 @@ nsresult NS_NewChannelWithTriggeringPrincipal(
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult NS_NewChannelWithTriggeringPrincipal(
-    nsIChannel **outChannel, nsIURI *aUri, nsIPrincipal *aLoadingPrincipal,
-    nsIPrincipal *aTriggeringPrincipal, const ClientInfo &aLoadingClientInfo,
-    const Maybe &aController,
+    nsIChannel** outChannel, nsIURI* aUri, nsIPrincipal* aLoadingPrincipal,
+    nsIPrincipal* aTriggeringPrincipal, const ClientInfo& aLoadingClientInfo,
+    const Maybe& aController,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    nsICookieSettings *aCookieSettings /* = nullptr */,
-    PerformanceStorage *aPerformanceStorage /* = nullptr */,
-    nsILoadGroup *aLoadGroup /* = nullptr */,
-    nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+    nsICookieSettings* aCookieSettings /* = nullptr */,
+    PerformanceStorage* aPerformanceStorage /* = nullptr */,
+    nsILoadGroup* aLoadGroup /* = nullptr */,
+    nsIInterfaceRequestor* aCallbacks /* = nullptr */,
     nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-    nsIIOService *aIoService /* = nullptr */) {
+    nsIIOService* aIoService /* = nullptr */) {
   AssertLoadingPrincipalAndClientInfoMatch(
       aLoadingPrincipal, aLoadingClientInfo, aContentPolicyType);
 
@@ -484,14 +484,14 @@ nsresult NS_NewChannelWithTriggeringPrincipal(
       aLoadGroup, aCallbacks, aLoadFlags, aIoService);
 }
 
-nsresult NS_NewChannel(nsIChannel **outChannel, nsIURI *aUri,
-                       nsINode *aLoadingNode, nsSecurityFlags aSecurityFlags,
+nsresult NS_NewChannel(nsIChannel** outChannel, nsIURI* aUri,
+                       nsINode* aLoadingNode, nsSecurityFlags aSecurityFlags,
                        nsContentPolicyType aContentPolicyType,
-                       PerformanceStorage *aPerformanceStorage /* = nullptr */,
-                       nsILoadGroup *aLoadGroup /* = nullptr */,
-                       nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+                       PerformanceStorage* aPerformanceStorage /* = nullptr */,
+                       nsILoadGroup* aLoadGroup /* = nullptr */,
+                       nsIInterfaceRequestor* aCallbacks /* = nullptr */,
                        nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-                       nsIIOService *aIoService /* = nullptr */) {
+                       nsIIOService* aIoService /* = nullptr */) {
   NS_ASSERTION(aLoadingNode, "Can not create channel without a loading Node!");
   return NS_NewChannelInternal(
       outChannel, aUri, aLoadingNode, aLoadingNode->NodePrincipal(),
@@ -501,7 +501,7 @@ nsresult NS_NewChannel(nsIChannel **outChannel, nsIURI *aUri,
       aPerformanceStorage, aLoadGroup, aCallbacks, aLoadFlags, aIoService);
 }
 
-nsresult NS_GetIsDocumentChannel(nsIChannel *aChannel, bool *aIsDocument) {
+nsresult NS_GetIsDocumentChannel(nsIChannel* aChannel, bool* aIsDocument) {
   // Check if this channel is going to be used to create a document. If it has
   // LOAD_DOCUMENT_URI set it is trivially creating a document. If
   // LOAD_HTML_OBJECT_DATA is set it may or may not be used to create a
@@ -538,8 +538,8 @@ nsresult NS_GetIsDocumentChannel(nsIChannel *aChannel, bool *aIsDocument) {
   return NS_OK;
 }
 
-nsresult NS_MakeAbsoluteURI(nsACString &result, const nsACString &spec,
-                            nsIURI *baseURI) {
+nsresult NS_MakeAbsoluteURI(nsACString& result, const nsACString& spec,
+                            nsIURI* baseURI) {
   nsresult rv;
   if (!baseURI) {
     NS_WARNING("It doesn't make sense to not supply a base URI");
@@ -552,7 +552,7 @@ nsresult NS_MakeAbsoluteURI(nsACString &result, const nsACString &spec,
   return rv;
 }
 
-nsresult NS_MakeAbsoluteURI(char **result, const char *spec, nsIURI *baseURI) {
+nsresult NS_MakeAbsoluteURI(char** result, const char* spec, nsIURI* baseURI) {
   nsresult rv;
   nsAutoCString resultBuf;
   rv = NS_MakeAbsoluteURI(resultBuf, nsDependentCString(spec), baseURI);
@@ -563,8 +563,8 @@ nsresult NS_MakeAbsoluteURI(char **result, const char *spec, nsIURI *baseURI) {
   return rv;
 }
 
-nsresult NS_MakeAbsoluteURI(nsAString &result, const nsAString &spec,
-                            nsIURI *baseURI) {
+nsresult NS_MakeAbsoluteURI(nsAString& result, const nsAString& spec,
+                            nsIURI* baseURI) {
   nsresult rv;
   if (!baseURI) {
     NS_WARNING("It doesn't make sense to not supply a base URI");
@@ -581,8 +581,8 @@ nsresult NS_MakeAbsoluteURI(nsAString &result, const nsAString &spec,
   return rv;
 }
 
-int32_t NS_GetDefaultPort(const char *scheme,
-                          nsIIOService *ioService /* = nullptr */) {
+int32_t NS_GetDefaultPort(const char* scheme,
+                          nsIIOService* ioService /* = nullptr */) {
   nsresult rv;
 
   // Getting the default port through the protocol handler has a lot of XPCOM
@@ -613,7 +613,7 @@ int32_t NS_GetDefaultPort(const char *scheme,
  * This function is a helper function to apply the ToAscii conversion
  * to a string
  */
-bool NS_StringToACE(const nsACString &idn, nsACString &result) {
+bool NS_StringToACE(const nsACString& idn, nsACString& result) {
   nsCOMPtr idnSrv = do_GetService(NS_IDNSERVICE_CONTRACTID);
   if (!idnSrv) return false;
   nsresult rv = idnSrv->ConvertUTF8toACE(idn, result);
@@ -622,7 +622,7 @@ bool NS_StringToACE(const nsACString &idn, nsACString &result) {
   return true;
 }
 
-int32_t NS_GetRealPort(nsIURI *aURI) {
+int32_t NS_GetRealPort(nsIURI* aURI) {
   int32_t port;
   nsresult rv = aURI->GetPort(&port);
   if (NS_FAILED(rv)) return -1;
@@ -640,9 +640,9 @@ int32_t NS_GetRealPort(nsIURI *aURI) {
 }
 
 nsresult NS_NewInputStreamChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri,
-    already_AddRefed aStream, const nsACString &aContentType,
-    const nsACString &aContentCharset, nsILoadInfo *aLoadInfo) {
+    nsIChannel** outChannel, nsIURI* aUri,
+    already_AddRefed aStream, const nsACString& aContentType,
+    const nsACString& aContentCharset, nsILoadInfo* aLoadInfo) {
   nsresult rv;
   nsCOMPtr isc =
       do_CreateInstance(NS_INPUTSTREAMCHANNEL_CONTRACTID, &rv);
@@ -681,10 +681,10 @@ nsresult NS_NewInputStreamChannelInternal(
 }
 
 nsresult NS_NewInputStreamChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri,
-    already_AddRefed aStream, const nsACString &aContentType,
-    const nsACString &aContentCharset, nsINode *aLoadingNode,
-    nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal,
+    nsIChannel** outChannel, nsIURI* aUri,
+    already_AddRefed aStream, const nsACString& aContentType,
+    const nsACString& aContentCharset, nsINode* aLoadingNode,
+    nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType) {
   nsCOMPtr loadInfo = new mozilla::net::LoadInfo(
       aLoadingPrincipal, aTriggeringPrincipal, aLoadingNode, aSecurityFlags,
@@ -701,11 +701,11 @@ nsresult NS_NewInputStreamChannelInternal(
 }
 
 nsresult NS_NewInputStreamChannel(
-    nsIChannel **outChannel, nsIURI *aUri,
-    already_AddRefed aStream, nsIPrincipal *aLoadingPrincipal,
+    nsIChannel** outChannel, nsIURI* aUri,
+    already_AddRefed aStream, nsIPrincipal* aLoadingPrincipal,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    const nsACString &aContentType /* = EmptyCString() */,
-    const nsACString &aContentCharset /* = EmptyCString() */) {
+    const nsACString& aContentType /* = EmptyCString() */,
+    const nsACString& aContentCharset /* = EmptyCString() */) {
   nsCOMPtr stream = aStream;
   return NS_NewInputStreamChannelInternal(outChannel, aUri, stream.forget(),
                                           aContentType, aContentCharset,
@@ -715,10 +715,10 @@ nsresult NS_NewInputStreamChannel(
                                           aSecurityFlags, aContentPolicyType);
 }
 
-nsresult NS_NewInputStreamChannelInternal(nsIChannel **outChannel, nsIURI *aUri,
-                                          const nsAString &aData,
-                                          const nsACString &aContentType,
-                                          nsILoadInfo *aLoadInfo,
+nsresult NS_NewInputStreamChannelInternal(nsIChannel** outChannel, nsIURI* aUri,
+                                          const nsAString& aData,
+                                          const nsACString& aContentType,
+                                          nsILoadInfo* aLoadInfo,
                                           bool aIsSrcdocChannel /* = false */) {
   nsresult rv;
   nsCOMPtr stream;
@@ -726,7 +726,7 @@ nsresult NS_NewInputStreamChannelInternal(nsIChannel **outChannel, nsIURI *aUri,
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint32_t len;
-  char *utf8Bytes = ToNewUTF8String(aData, &len);
+  char* utf8Bytes = ToNewUTF8String(aData, &len);
   rv = stream->AdoptData(utf8Bytes, len);
 
   nsCOMPtr channel;
@@ -746,9 +746,9 @@ nsresult NS_NewInputStreamChannelInternal(nsIChannel **outChannel, nsIURI *aUri,
 }
 
 nsresult NS_NewInputStreamChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri, const nsAString &aData,
-    const nsACString &aContentType, nsINode *aLoadingNode,
-    nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal,
+    nsIChannel** outChannel, nsIURI* aUri, const nsAString& aData,
+    const nsACString& aContentType, nsINode* aLoadingNode,
+    nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
     bool aIsSrcdocChannel /* = false */) {
   nsCOMPtr loadInfo = new mozilla::net::LoadInfo(
@@ -758,10 +758,10 @@ nsresult NS_NewInputStreamChannelInternal(
                                           loadInfo, aIsSrcdocChannel);
 }
 
-nsresult NS_NewInputStreamChannel(nsIChannel **outChannel, nsIURI *aUri,
-                                  const nsAString &aData,
-                                  const nsACString &aContentType,
-                                  nsIPrincipal *aLoadingPrincipal,
+nsresult NS_NewInputStreamChannel(nsIChannel** outChannel, nsIURI* aUri,
+                                  const nsAString& aData,
+                                  const nsACString& aContentType,
+                                  nsIPrincipal* aLoadingPrincipal,
                                   nsSecurityFlags aSecurityFlags,
                                   nsContentPolicyType aContentPolicyType,
                                   bool aIsSrcdocChannel /* = false */) {
@@ -774,10 +774,10 @@ nsresult NS_NewInputStreamChannel(nsIChannel **outChannel, nsIURI *aUri,
 }
 
 nsresult NS_NewInputStreamPump(
-    nsIInputStreamPump **aResult, already_AddRefed aStream,
+    nsIInputStreamPump** aResult, already_AddRefed aStream,
     uint32_t aSegsize /* = 0 */, uint32_t aSegcount /* = 0 */,
     bool aCloseWhenDone /* = false */,
-    nsIEventTarget *aMainThreadTarget /* = nullptr */) {
+    nsIEventTarget* aMainThreadTarget /* = nullptr */) {
   nsCOMPtr stream = std::move(aStream);
 
   nsresult rv;
@@ -794,7 +794,7 @@ nsresult NS_NewInputStreamPump(
   return rv;
 }
 
-nsresult NS_NewLoadGroup(nsILoadGroup **result, nsIRequestObserver *obs) {
+nsresult NS_NewLoadGroup(nsILoadGroup** result, nsIRequestObserver* obs) {
   nsresult rv;
   nsCOMPtr group =
       do_CreateInstance(NS_LOADGROUP_CONTRACTID, &rv);
@@ -808,19 +808,19 @@ nsresult NS_NewLoadGroup(nsILoadGroup **result, nsIRequestObserver *obs) {
   return rv;
 }
 
-bool NS_IsReasonableHTTPHeaderValue(const nsACString &aValue) {
+bool NS_IsReasonableHTTPHeaderValue(const nsACString& aValue) {
   return mozilla::net::nsHttp::IsReasonableHeaderValue(aValue);
 }
 
-bool NS_IsValidHTTPToken(const nsACString &aToken) {
+bool NS_IsValidHTTPToken(const nsACString& aToken) {
   return mozilla::net::nsHttp::IsValidToken(aToken);
 }
 
-void NS_TrimHTTPWhitespace(const nsACString &aSource, nsACString &aDest) {
+void NS_TrimHTTPWhitespace(const nsACString& aSource, nsACString& aDest) {
   mozilla::net::nsHttp::TrimHTTPWhitespace(aSource, aDest);
 }
 
-nsresult NS_NewLoadGroup(nsILoadGroup **aResult, nsIPrincipal *aPrincipal) {
+nsresult NS_NewLoadGroup(nsILoadGroup** aResult, nsIPrincipal* aPrincipal) {
   using mozilla::LoadContext;
   nsresult rv;
 
@@ -836,8 +836,8 @@ nsresult NS_NewLoadGroup(nsILoadGroup **aResult, nsIPrincipal *aPrincipal) {
   return rv;
 }
 
-bool NS_LoadGroupMatchesPrincipal(nsILoadGroup *aLoadGroup,
-                                  nsIPrincipal *aPrincipal) {
+bool NS_LoadGroupMatchesPrincipal(nsILoadGroup* aLoadGroup,
+                                  nsIPrincipal* aPrincipal) {
   if (!aPrincipal) {
     return false;
   }
@@ -868,9 +868,9 @@ bool NS_LoadGroupMatchesPrincipal(nsILoadGroup *aLoadGroup,
          aPrincipal->GetIsInIsolatedMozBrowserElement();
 }
 
-nsresult NS_NewDownloader(nsIStreamListener **result,
-                          nsIDownloadObserver *observer,
-                          nsIFile *downloadLocation /* = nullptr */) {
+nsresult NS_NewDownloader(nsIStreamListener** result,
+                          nsIDownloadObserver* observer,
+                          nsIFile* downloadLocation /* = nullptr */) {
   nsresult rv;
   nsCOMPtr downloader =
       do_CreateInstance(NS_DOWNLOADER_CONTRACTID, &rv);
@@ -884,8 +884,8 @@ nsresult NS_NewDownloader(nsIStreamListener **result,
 }
 
 nsresult NS_NewIncrementalStreamLoader(
-    nsIIncrementalStreamLoader **result,
-    nsIIncrementalStreamLoaderObserver *observer) {
+    nsIIncrementalStreamLoader** result,
+    nsIIncrementalStreamLoaderObserver* observer) {
   nsresult rv;
   nsCOMPtr loader =
       do_CreateInstance(NS_INCREMENTALSTREAMLOADER_CONTRACTID, &rv);
@@ -900,8 +900,8 @@ nsresult NS_NewIncrementalStreamLoader(
 }
 
 nsresult NS_NewStreamLoader(
-    nsIStreamLoader **result, nsIStreamLoaderObserver *observer,
-    nsIRequestObserver *requestObserver /* = nullptr */) {
+    nsIStreamLoader** result, nsIStreamLoaderObserver* observer,
+    nsIRequestObserver* requestObserver /* = nullptr */) {
   nsresult rv;
   nsCOMPtr loader =
       do_CreateInstance(NS_STREAMLOADER_CONTRACTID, &rv);
@@ -916,14 +916,14 @@ nsresult NS_NewStreamLoader(
 }
 
 nsresult NS_NewStreamLoaderInternal(
-    nsIStreamLoader **outStream, nsIURI *aUri,
-    nsIStreamLoaderObserver *aObserver, nsINode *aLoadingNode,
-    nsIPrincipal *aLoadingPrincipal, nsSecurityFlags aSecurityFlags,
+    nsIStreamLoader** outStream, nsIURI* aUri,
+    nsIStreamLoaderObserver* aObserver, nsINode* aLoadingNode,
+    nsIPrincipal* aLoadingPrincipal, nsSecurityFlags aSecurityFlags,
     nsContentPolicyType aContentPolicyType,
-    nsILoadGroup *aLoadGroup /* = nullptr */,
-    nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+    nsILoadGroup* aLoadGroup /* = nullptr */,
+    nsIInterfaceRequestor* aCallbacks /* = nullptr */,
     nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-    nsIURI *aReferrer /* = nullptr */) {
+    nsIURI* aReferrer /* = nullptr */) {
   nsCOMPtr channel;
   nsresult rv = NS_NewChannelInternal(
       getter_AddRefs(channel), aUri, aLoadingNode, aLoadingPrincipal,
@@ -946,13 +946,13 @@ nsresult NS_NewStreamLoaderInternal(
 }
 
 nsresult NS_NewStreamLoader(
-    nsIStreamLoader **outStream, nsIURI *aUri,
-    nsIStreamLoaderObserver *aObserver, nsINode *aLoadingNode,
+    nsIStreamLoader** outStream, nsIURI* aUri,
+    nsIStreamLoaderObserver* aObserver, nsINode* aLoadingNode,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    nsILoadGroup *aLoadGroup /* = nullptr */,
-    nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+    nsILoadGroup* aLoadGroup /* = nullptr */,
+    nsIInterfaceRequestor* aCallbacks /* = nullptr */,
     nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-    nsIURI *aReferrer /* = nullptr */) {
+    nsIURI* aReferrer /* = nullptr */) {
   NS_ASSERTION(aLoadingNode,
                "Can not create stream loader without a loading Node!");
   return NS_NewStreamLoaderInternal(
@@ -962,13 +962,13 @@ nsresult NS_NewStreamLoader(
 }
 
 nsresult NS_NewStreamLoader(
-    nsIStreamLoader **outStream, nsIURI *aUri,
-    nsIStreamLoaderObserver *aObserver, nsIPrincipal *aLoadingPrincipal,
+    nsIStreamLoader** outStream, nsIURI* aUri,
+    nsIStreamLoaderObserver* aObserver, nsIPrincipal* aLoadingPrincipal,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    nsILoadGroup *aLoadGroup /* = nullptr */,
-    nsIInterfaceRequestor *aCallbacks /* = nullptr */,
+    nsILoadGroup* aLoadGroup /* = nullptr */,
+    nsIInterfaceRequestor* aCallbacks /* = nullptr */,
     nsLoadFlags aLoadFlags /* = nsIRequest::LOAD_NORMAL */,
-    nsIURI *aReferrer /* = nullptr */) {
+    nsIURI* aReferrer /* = nullptr */) {
   return NS_NewStreamLoaderInternal(outStream, aUri, aObserver,
                                     nullptr,  // aLoadingNode
                                     aLoadingPrincipal, aSecurityFlags,
@@ -976,8 +976,8 @@ nsresult NS_NewStreamLoader(
                                     aLoadFlags, aReferrer);
 }
 
-nsresult NS_NewSyncStreamListener(nsIStreamListener **result,
-                                  nsIInputStream **stream) {
+nsresult NS_NewSyncStreamListener(nsIStreamListener** result,
+                                  nsIInputStream** stream) {
   nsCOMPtr listener = nsSyncStreamListener::Create();
   if (listener) {
     nsresult rv = listener->GetInputStream(stream);
@@ -989,7 +989,7 @@ nsresult NS_NewSyncStreamListener(nsIStreamListener **result,
   return NS_ERROR_FAILURE;
 }
 
-nsresult NS_ImplementChannelOpen(nsIChannel *channel, nsIInputStream **result) {
+nsresult NS_ImplementChannelOpen(nsIChannel* channel, nsIInputStream** result) {
   nsCOMPtr listener;
   nsCOMPtr stream;
   nsresult rv = NS_NewSyncStreamListener(getter_AddRefs(listener),
@@ -1010,9 +1010,9 @@ nsresult NS_ImplementChannelOpen(nsIChannel *channel, nsIInputStream **result) {
   return NS_OK;
 }
 
-nsresult NS_NewRequestObserverProxy(nsIRequestObserver **result,
-                                    nsIRequestObserver *observer,
-                                    nsISupports *context) {
+nsresult NS_NewRequestObserverProxy(nsIRequestObserver** result,
+                                    nsIRequestObserver* observer,
+                                    nsISupports* context) {
   nsCOMPtr proxy = new nsRequestObserverProxy();
   nsresult rv = proxy->Init(observer, context);
   if (NS_SUCCEEDED(rv)) {
@@ -1022,8 +1022,8 @@ nsresult NS_NewRequestObserverProxy(nsIRequestObserver **result,
 }
 
 nsresult NS_NewSimpleStreamListener(
-    nsIStreamListener **result, nsIOutputStream *sink,
-    nsIRequestObserver *observer /* = nullptr */) {
+    nsIStreamListener** result, nsIOutputStream* sink,
+    nsIRequestObserver* observer /* = nullptr */) {
   nsresult rv;
   nsCOMPtr listener =
       do_CreateInstance(NS_SIMPLESTREAMLISTENER_CONTRACTID, &rv);
@@ -1036,8 +1036,8 @@ nsresult NS_NewSimpleStreamListener(
   return rv;
 }
 
-nsresult NS_CheckPortSafety(int32_t port, const char *scheme,
-                            nsIIOService *ioService /* = nullptr */) {
+nsresult NS_CheckPortSafety(int32_t port, const char* scheme,
+                            nsIIOService* ioService /* = nullptr */) {
   nsresult rv;
   nsCOMPtr grip;
   rv = net_EnsureIOService(&ioService, grip);
@@ -1052,7 +1052,7 @@ nsresult NS_CheckPortSafety(int32_t port, const char *scheme,
   return rv;
 }
 
-nsresult NS_CheckPortSafety(nsIURI *uri) {
+nsresult NS_CheckPortSafety(nsIURI* uri) {
   int32_t port;
   nsresult rv = uri->GetPort(&port);
   if (NS_FAILED(rv) || port == -1)  // port undefined or default-valued
@@ -1062,8 +1062,8 @@ nsresult NS_CheckPortSafety(nsIURI *uri) {
   return NS_CheckPortSafety(port, scheme.get());
 }
 
-nsresult NS_NewProxyInfo(const nsACString &type, const nsACString &host,
-                         int32_t port, uint32_t flags, nsIProxyInfo **result) {
+nsresult NS_NewProxyInfo(const nsACString& type, const nsACString& host,
+                         int32_t port, uint32_t flags, nsIProxyInfo** result) {
   nsresult rv;
   nsCOMPtr pps =
       do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID, &rv);
@@ -1073,8 +1073,8 @@ nsresult NS_NewProxyInfo(const nsACString &type, const nsACString &host,
   return rv;
 }
 
-nsresult NS_GetFileProtocolHandler(nsIFileProtocolHandler **result,
-                                   nsIIOService *ioService /* = nullptr */) {
+nsresult NS_GetFileProtocolHandler(nsIFileProtocolHandler** result,
+                                   nsIIOService* ioService /* = nullptr */) {
   nsresult rv;
   nsCOMPtr grip;
   rv = net_EnsureIOService(&ioService, grip);
@@ -1086,8 +1086,8 @@ nsresult NS_GetFileProtocolHandler(nsIFileProtocolHandler **result,
   return rv;
 }
 
-nsresult NS_GetFileFromURLSpec(const nsACString &inURL, nsIFile **result,
-                               nsIIOService *ioService /* = nullptr */) {
+nsresult NS_GetFileFromURLSpec(const nsACString& inURL, nsIFile** result,
+                               nsIIOService* ioService /* = nullptr */) {
   nsresult rv;
   nsCOMPtr fileHandler;
   rv = NS_GetFileProtocolHandler(getter_AddRefs(fileHandler), ioService);
@@ -1095,8 +1095,8 @@ nsresult NS_GetFileFromURLSpec(const nsACString &inURL, nsIFile **result,
   return rv;
 }
 
-nsresult NS_GetURLSpecFromFile(nsIFile *file, nsACString &url,
-                               nsIIOService *ioService /* = nullptr */) {
+nsresult NS_GetURLSpecFromFile(nsIFile* file, nsACString& url,
+                               nsIIOService* ioService /* = nullptr */) {
   nsresult rv;
   nsCOMPtr fileHandler;
   rv = NS_GetFileProtocolHandler(getter_AddRefs(fileHandler), ioService);
@@ -1104,8 +1104,8 @@ nsresult NS_GetURLSpecFromFile(nsIFile *file, nsACString &url,
   return rv;
 }
 
-nsresult NS_GetURLSpecFromActualFile(nsIFile *file, nsACString &url,
-                                     nsIIOService *ioService /* = nullptr */) {
+nsresult NS_GetURLSpecFromActualFile(nsIFile* file, nsACString& url,
+                                     nsIIOService* ioService /* = nullptr */) {
   nsresult rv;
   nsCOMPtr fileHandler;
   rv = NS_GetFileProtocolHandler(getter_AddRefs(fileHandler), ioService);
@@ -1113,8 +1113,8 @@ nsresult NS_GetURLSpecFromActualFile(nsIFile *file, nsACString &url,
   return rv;
 }
 
-nsresult NS_GetURLSpecFromDir(nsIFile *file, nsACString &url,
-                              nsIIOService *ioService /* = nullptr */) {
+nsresult NS_GetURLSpecFromDir(nsIFile* file, nsACString& url,
+                              nsIIOService* ioService /* = nullptr */) {
   nsresult rv;
   nsCOMPtr fileHandler;
   rv = NS_GetFileProtocolHandler(getter_AddRefs(fileHandler), ioService);
@@ -1122,7 +1122,7 @@ nsresult NS_GetURLSpecFromDir(nsIFile *file, nsACString &url,
   return rv;
 }
 
-nsresult NS_GetReferrerFromChannel(nsIChannel *channel, nsIURI **referrer) {
+nsresult NS_GetReferrerFromChannel(nsIChannel* channel, nsIURI** referrer) {
   nsresult rv = NS_ERROR_NOT_AVAILABLE;
   *referrer = nullptr;
 
@@ -1133,7 +1133,7 @@ nsresult NS_GetReferrerFromChannel(nsIChannel *channel, nsIURI **referrer) {
     // an http page with an https referrer).
     rv = props->GetPropertyAsInterface(
         NS_LITERAL_STRING("docshell.internalReferrer"), NS_GET_IID(nsIURI),
-        reinterpret_cast(referrer));
+        reinterpret_cast(referrer));
     if (NS_FAILED(rv)) *referrer = nullptr;
   }
 
@@ -1149,7 +1149,7 @@ nsresult NS_GetReferrerFromChannel(nsIChannel *channel, nsIURI **referrer) {
   return rv;
 }
 
-already_AddRefed do_GetNetUtil(nsresult *error /* = 0 */) {
+already_AddRefed do_GetNetUtil(nsresult* error /* = 0 */) {
   nsCOMPtr io = mozilla::services::GetIOService();
   nsCOMPtr util;
   if (io) util = do_QueryInterface(io);
@@ -1158,9 +1158,9 @@ already_AddRefed do_GetNetUtil(nsresult *error /* = 0 */) {
   return util.forget();
 }
 
-nsresult NS_ParseRequestContentType(const nsACString &rawContentType,
-                                    nsCString &contentType,
-                                    nsCString &contentCharset) {
+nsresult NS_ParseRequestContentType(const nsACString& rawContentType,
+                                    nsCString& contentType,
+                                    nsCString& contentCharset) {
   // contentCharset is left untouched if not present in rawContentType
   nsresult rv;
   nsCOMPtr util = do_GetNetUtil(&rv);
@@ -1173,9 +1173,9 @@ nsresult NS_ParseRequestContentType(const nsACString &rawContentType,
   return rv;
 }
 
-nsresult NS_ParseResponseContentType(const nsACString &rawContentType,
-                                     nsCString &contentType,
-                                     nsCString &contentCharset) {
+nsresult NS_ParseResponseContentType(const nsACString& rawContentType,
+                                     nsCString& contentType,
+                                     nsCString& contentCharset) {
   // contentCharset is left untouched if not present in rawContentType
   nsresult rv;
   nsCOMPtr util = do_GetNetUtil(&rv);
@@ -1188,11 +1188,11 @@ nsresult NS_ParseResponseContentType(const nsACString &rawContentType,
   return rv;
 }
 
-nsresult NS_ExtractCharsetFromContentType(const nsACString &rawContentType,
-                                          nsCString &contentCharset,
-                                          bool *hadCharset,
-                                          int32_t *charsetStart,
-                                          int32_t *charsetEnd) {
+nsresult NS_ExtractCharsetFromContentType(const nsACString& rawContentType,
+                                          nsCString& contentCharset,
+                                          bool* hadCharset,
+                                          int32_t* charsetStart,
+                                          int32_t* charsetEnd) {
   // contentCharset is left untouched if not present in rawContentType
   nsresult rv;
   nsCOMPtr util = do_GetNetUtil(&rv);
@@ -1202,7 +1202,7 @@ nsresult NS_ExtractCharsetFromContentType(const nsACString &rawContentType,
       rawContentType, contentCharset, charsetStart, charsetEnd, hadCharset);
 }
 
-nsresult NS_NewAtomicFileOutputStream(nsIOutputStream **result, nsIFile *file,
+nsresult NS_NewAtomicFileOutputStream(nsIOutputStream** result, nsIFile* file,
                                       int32_t ioFlags /* = -1 */,
                                       int32_t perm /* = -1 */,
                                       int32_t behaviorFlags /* = 0 */) {
@@ -1216,8 +1216,8 @@ nsresult NS_NewAtomicFileOutputStream(nsIOutputStream **result, nsIFile *file,
   return rv;
 }
 
-nsresult NS_NewSafeLocalFileOutputStream(nsIOutputStream **result,
-                                         nsIFile *file,
+nsresult NS_NewSafeLocalFileOutputStream(nsIOutputStream** result,
+                                         nsIFile* file,
                                          int32_t ioFlags /* = -1 */,
                                          int32_t perm /* = -1 */,
                                          int32_t behaviorFlags /* = 0 */) {
@@ -1231,7 +1231,7 @@ nsresult NS_NewSafeLocalFileOutputStream(nsIOutputStream **result,
   return rv;
 }
 
-nsresult NS_NewLocalFileStream(nsIFileStream **result, nsIFile *file,
+nsresult NS_NewLocalFileStream(nsIFileStream** result, nsIFile* file,
                                int32_t ioFlags /* = -1 */,
                                int32_t perm /* = -1 */,
                                int32_t behaviorFlags /* = 0 */) {
@@ -1244,7 +1244,7 @@ nsresult NS_NewLocalFileStream(nsIFileStream **result, nsIFile *file,
 }
 
 nsresult NS_NewBufferedOutputStream(
-    nsIOutputStream **aResult, already_AddRefed aOutputStream,
+    nsIOutputStream** aResult, already_AddRefed aOutputStream,
     uint32_t aBufferSize) {
   nsCOMPtr outputStream = std::move(aOutputStream);
 
@@ -1261,7 +1261,7 @@ nsresult NS_NewBufferedOutputStream(
 }
 
 MOZ_MUST_USE nsresult NS_NewBufferedInputStream(
-    nsIInputStream **aResult, already_AddRefed aInputStream,
+    nsIInputStream** aResult, already_AddRefed aInputStream,
     uint32_t aBufferSize) {
   nsCOMPtr inputStream = std::move(aInputStream);
 
@@ -1285,7 +1285,7 @@ class BufferWriter final : public nsIInputStreamCallback {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  BufferWriter(nsIInputStream *aInputStream, void *aBuffer, int64_t aCount)
+  BufferWriter(nsIInputStream* aInputStream, void* aBuffer, int64_t aCount)
       : mMonitor("BufferWriter.mMonitor"),
         mInputStream(aInputStream),
         mBuffer(aBuffer),
@@ -1328,11 +1328,11 @@ class BufferWriter final : public nsIInputStreamCallback {
     return mWrittenData;
   }
 
-  void *StealBuffer() {
+  void* StealBuffer() {
     NS_ASSERT_OWNINGTHREAD(BufferWriter);
     MOZ_ASSERT(mBufferType == eInternal);
 
-    void *buffer = mBuffer;
+    void* buffer = mBuffer;
 
     mBuffer = nullptr;
     mBufferSize = 0;
@@ -1403,7 +1403,7 @@ class BufferWriter final : public nsIInputStreamCallback {
       // Let's try to read data directly.
       uint32_t writtenData;
       nsresult rv = mAsyncInputStream->ReadSegments(
-          NS_CopySegmentToBuffer, static_cast(mBuffer) + offset, length,
+          NS_CopySegmentToBuffer, static_cast(mBuffer) + offset, length,
           &writtenData);
 
       // Operation completed. Nothing more to read.
@@ -1470,7 +1470,7 @@ class BufferWriter final : public nsIInputStreamCallback {
   }
 
   NS_IMETHOD
-  OnInputStreamReady(nsIAsyncInputStream *aStream) override {
+  OnInputStreamReady(nsIAsyncInputStream* aStream) override {
     MOZ_ASSERT(!NS_IsMainThread());
 
     // We have something to read. Let's unlock the main-thread.
@@ -1500,7 +1500,7 @@ class BufferWriter final : public nsIInputStreamCallback {
       return false;
     }
 
-    void *buffer = realloc(mBuffer, bufferSize.value());
+    void* buffer = realloc(mBuffer, bufferSize.value());
     if (!buffer) {
       return false;
     }
@@ -1519,7 +1519,7 @@ class BufferWriter final : public nsIInputStreamCallback {
 
   RefPtr mTaskQueue;
 
-  void *mBuffer;
+  void* mBuffer;
   int64_t mCount;
   uint64_t mWrittenData;
 
@@ -1540,8 +1540,8 @@ NS_IMPL_ISUPPORTS(BufferWriter, nsIInputStreamCallback)
 
 }  // anonymous namespace
 
-nsresult NS_ReadInputStreamToBuffer(nsIInputStream *aInputStream, void **aDest,
-                                    int64_t aCount, uint64_t *aWritten) {
+nsresult NS_ReadInputStreamToBuffer(nsIInputStream* aInputStream, void** aDest,
+                                    int64_t aCount, uint64_t* aWritten) {
   MOZ_ASSERT(aInputStream);
   MOZ_ASSERT(aCount >= -1);
 
@@ -1570,9 +1570,9 @@ nsresult NS_ReadInputStreamToBuffer(nsIInputStream *aInputStream, void **aDest,
   return NS_OK;
 }
 
-nsresult NS_ReadInputStreamToString(nsIInputStream *aInputStream,
-                                    nsACString &aDest, int64_t aCount,
-                                    uint64_t *aWritten) {
+nsresult NS_ReadInputStreamToString(nsIInputStream* aInputStream,
+                                    nsACString& aDest, int64_t aCount,
+                                    uint64_t* aWritten) {
   uint64_t dummyWritten;
   if (!aWritten) {
     aWritten = &dummyWritten;
@@ -1592,7 +1592,7 @@ nsresult NS_ReadInputStreamToString(nsIInputStream *aInputStream,
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
-    void *dest = aDest.BeginWriting();
+    void* dest = aDest.BeginWriting();
     nsresult rv =
         NS_ReadInputStreamToBuffer(aInputStream, &dest, aCount, aWritten);
     NS_ENSURE_SUCCESS(rv, rv);
@@ -1605,7 +1605,7 @@ nsresult NS_ReadInputStreamToString(nsIInputStream *aInputStream,
   }
 
   // If the size is unknown, BufferWriter will allocate the buffer.
-  void *dest = nullptr;
+  void* dest = nullptr;
   nsresult rv =
       NS_ReadInputStreamToBuffer(aInputStream, &dest, aCount, aWritten);
   MOZ_ASSERT_IF(NS_FAILED(rv), dest == nullptr);
@@ -1617,15 +1617,15 @@ nsresult NS_ReadInputStreamToString(nsIInputStream *aInputStream,
     return NS_OK;
   }
 
-  aDest.Adopt(reinterpret_cast(dest), *aWritten);
+  aDest.Adopt(reinterpret_cast(dest), *aWritten);
   return NS_OK;
 }
 
 nsresult NS_NewURI(
-    nsIURI **result, const nsACString &spec,
-    const char *charset /* = nullptr */, nsIURI *baseURI /* = nullptr */,
-    nsIIOService
-        *ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
+    nsIURI** result, const nsACString& spec,
+    const char* charset /* = nullptr */, nsIURI* baseURI /* = nullptr */,
+    nsIIOService*
+        ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
 {
   nsresult rv;
   nsCOMPtr grip;
@@ -1635,10 +1635,10 @@ nsresult NS_NewURI(
 }
 
 nsresult NS_NewURI(
-    nsIURI **result, const nsACString &spec, NotNull encoding,
-    nsIURI *baseURI /* = nullptr */,
-    nsIIOService
-        *ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
+    nsIURI** result, const nsACString& spec, NotNull encoding,
+    nsIURI* baseURI /* = nullptr */,
+    nsIIOService*
+        ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
 {
   nsAutoCString charset;
   encoding->Name(charset);
@@ -1646,10 +1646,10 @@ nsresult NS_NewURI(
 }
 
 nsresult NS_NewURI(
-    nsIURI **result, const nsAString &aSpec,
-    const char *charset /* = nullptr */, nsIURI *baseURI /* = nullptr */,
-    nsIIOService
-        *ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
+    nsIURI** result, const nsAString& aSpec,
+    const char* charset /* = nullptr */, nsIURI* baseURI /* = nullptr */,
+    nsIIOService*
+        ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
 {
   nsAutoCString spec;
   if (!AppendUTF16toUTF8(aSpec, spec, mozilla::fallible)) {
@@ -1659,10 +1659,10 @@ nsresult NS_NewURI(
 }
 
 nsresult NS_NewURI(
-    nsIURI **result, const nsAString &aSpec, NotNull encoding,
-    nsIURI *baseURI /* = nullptr */,
-    nsIIOService
-        *ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
+    nsIURI** result, const nsAString& aSpec, NotNull encoding,
+    nsIURI* baseURI /* = nullptr */,
+    nsIIOService*
+        ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
 {
   nsAutoCString spec;
   if (!AppendUTF16toUTF8(aSpec, spec, mozilla::fallible)) {
@@ -1672,17 +1672,17 @@ nsresult NS_NewURI(
 }
 
 nsresult NS_NewURI(
-    nsIURI **result, const char *spec, nsIURI *baseURI /* = nullptr */,
-    nsIIOService
-        *ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
+    nsIURI** result, const char* spec, nsIURI* baseURI /* = nullptr */,
+    nsIIOService*
+        ioService /* = nullptr */)  // pass in nsIIOService to optimize callers
 {
   return NS_NewURI(result, nsDependentCString(spec), nullptr, baseURI,
                    ioService);
 }
 
-static nsresult NewStandardURI(const nsACString &aSpec, const char *aCharset,
-                               nsIURI *aBaseURI, int32_t aDefaultPort,
-                               nsIURI **aURI) {
+static nsresult NewStandardURI(const nsACString& aSpec, const char* aCharset,
+                               nsIURI* aBaseURI, int32_t aDefaultPort,
+                               nsIURI** aURI) {
   nsCOMPtr base(aBaseURI);
   return NS_MutateURI(new nsStandardURL::Mutator())
       .Apply(NS_MutatorMethod(&nsIStandardURLMutator::Init,
@@ -1696,7 +1696,7 @@ extern MOZ_THREAD_LOCAL(uint32_t) gTlsURLRecursionCount;
 template 
 class TlsAutoIncrement {
  public:
-  explicit TlsAutoIncrement(T &var) : mVar(var) {
+  explicit TlsAutoIncrement(T& var) : mVar(var) {
     mValue = mVar.get();
     mVar.set(mValue + 1);
   }
@@ -1710,13 +1710,13 @@ class TlsAutoIncrement {
 
  private:
   typename T::Type mValue;
-  T &mVar;
+  T& mVar;
 };
 
-nsresult NS_NewURIOnAnyThread(nsIURI **aURI, const nsACString &aSpec,
-                              const char *aCharset /* = nullptr */,
-                              nsIURI *aBaseURI /* = nullptr */,
-                              nsIIOService *aIOService /* = nullptr */) {
+nsresult NS_NewURIOnAnyThread(nsIURI** aURI, const nsACString& aSpec,
+                              const char* aCharset /* = nullptr */,
+                              nsIURI* aBaseURI /* = nullptr */,
+                              nsIIOService* aIOService /* = nullptr */) {
   TlsAutoIncrement inc(gTlsURLRecursionCount);
   if (inc.value() >= MAX_RECURSION_COUNT) {
     return NS_ERROR_MALFORMED_URI;
@@ -1807,8 +1807,8 @@ nsresult NS_NewURIOnAnyThread(nsIURI **aURI, const nsACString &aSpec,
   return NS_ERROR_UNKNOWN_PROTOCOL;
 }
 
-nsresult NS_GetSanitizedURIStringFromURI(nsIURI *aUri,
-                                         nsAString &aSanitizedSpec) {
+nsresult NS_GetSanitizedURIStringFromURI(nsIURI* aUri,
+                                         nsAString& aSanitizedSpec) {
   aSanitizedSpec.Truncate();
 
   nsCOMPtr safeUri = do_QueryInterface(aUri);
@@ -1827,7 +1827,7 @@ nsresult NS_GetSanitizedURIStringFromURI(nsIURI *aUri,
 }
 
 nsresult NS_LoadPersistentPropertiesFromURISpec(
-    nsIPersistentProperties **outResult, const nsACString &aSpec) {
+    nsIPersistentProperties** outResult, const nsACString& aSpec) {
   nsCOMPtr uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), aSpec);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1850,15 +1850,15 @@ nsresult NS_LoadPersistentPropertiesFromURISpec(
   return NS_OK;
 }
 
-bool NS_UsePrivateBrowsing(nsIChannel *channel) {
+bool NS_UsePrivateBrowsing(nsIChannel* channel) {
   OriginAttributes attrs;
   bool result = NS_GetOriginAttributes(channel, attrs, false);
   NS_ENSURE_TRUE(result, result);
   return attrs.mPrivateBrowsingId > 0;
 }
 
-bool NS_GetOriginAttributes(nsIChannel *aChannel,
-                            mozilla::OriginAttributes &aAttributes,
+bool NS_GetOriginAttributes(nsIChannel* aChannel,
+                            mozilla::OriginAttributes& aAttributes,
                             bool aUsingStoragePrincipal) {
   nsCOMPtr loadInfo = aChannel->LoadInfo();
   loadInfo->GetOriginAttributes(&aAttributes);
@@ -1882,7 +1882,7 @@ bool NS_GetOriginAttributes(nsIChannel *aChannel,
   return true;
 }
 
-bool NS_HasBeenCrossOrigin(nsIChannel *aChannel, bool aReport) {
+bool NS_HasBeenCrossOrigin(nsIChannel* aChannel, bool aReport) {
   nsCOMPtr loadInfo = aChannel->LoadInfo();
   // TYPE_DOCUMENT loads have a null LoadingPrincipal and can not be cross
   // origin.
@@ -1904,7 +1904,7 @@ bool NS_HasBeenCrossOrigin(nsIChannel *aChannel, bool aReport) {
 
   bool aboutBlankInherits = dataInherits && loadInfo->GetAboutBlankInherits();
 
-  for (nsIRedirectHistoryEntry *redirectHistoryEntry :
+  for (nsIRedirectHistoryEntry* redirectHistoryEntry :
        loadInfo->RedirectChain()) {
     nsCOMPtr principal;
     redirectHistoryEntry->GetPrincipal(getter_AddRefs(principal));
@@ -1940,7 +1940,7 @@ bool NS_HasBeenCrossOrigin(nsIChannel *aChannel, bool aReport) {
   return NS_FAILED(loadingPrincipal->CheckMayLoad(uri, aReport, dataInherits));
 }
 
-bool NS_IsSafeTopLevelNav(nsIChannel *aChannel) {
+bool NS_IsSafeTopLevelNav(nsIChannel* aChannel) {
   if (!aChannel) {
     return false;
   }
@@ -1953,14 +1953,14 @@ bool NS_IsSafeTopLevelNav(nsIChannel *aChannel) {
   if (!baseChan) {
     return false;
   }
-  nsHttpRequestHead *requestHead = baseChan->GetRequestHead();
+  nsHttpRequestHead* requestHead = baseChan->GetRequestHead();
   if (!requestHead) {
     return false;
   }
   return requestHead->IsSafeMethod();
 }
 
-bool NS_IsSameSiteForeign(nsIChannel *aChannel, nsIURI *aHostURI) {
+bool NS_IsSameSiteForeign(nsIChannel* aChannel, nsIURI* aHostURI) {
   if (!aChannel) {
     return false;
   }
@@ -2021,7 +2021,7 @@ bool NS_IsSameSiteForeign(nsIChannel *aChannel, nsIURI *aHostURI) {
 
   nsCOMPtr redirectPrincipal;
   nsCOMPtr redirectURI;
-  for (nsIRedirectHistoryEntry *entry : loadInfo->RedirectChain()) {
+  for (nsIRedirectHistoryEntry* entry : loadInfo->RedirectChain()) {
     entry->GetPrincipal(getter_AddRefs(redirectPrincipal));
     if (redirectPrincipal) {
       redirectPrincipal->GetURI(getter_AddRefs(redirectURI));
@@ -2036,7 +2036,7 @@ bool NS_IsSameSiteForeign(nsIChannel *aChannel, nsIURI *aHostURI) {
   return isForeign;
 }
 
-bool NS_ShouldCheckAppCache(nsIPrincipal *aPrincipal) {
+bool NS_ShouldCheckAppCache(nsIPrincipal* aPrincipal) {
   uint32_t privateBrowsingId = 0;
   nsresult rv = aPrincipal->GetPrivateBrowsingId(&privateBrowsingId);
   if (NS_SUCCEEDED(rv) && (privateBrowsingId > 0)) {
@@ -2054,8 +2054,8 @@ bool NS_ShouldCheckAppCache(nsIPrincipal *aPrincipal) {
   return NS_SUCCEEDED(rv) && allowed;
 }
 
-void NS_WrapAuthPrompt(nsIAuthPrompt *aAuthPrompt,
-                       nsIAuthPrompt2 **aAuthPrompt2) {
+void NS_WrapAuthPrompt(nsIAuthPrompt* aAuthPrompt,
+                       nsIAuthPrompt2** aAuthPrompt2) {
   nsCOMPtr factory =
       do_GetService(NS_AUTHPROMPT_ADAPTER_FACTORY_CONTRACTID);
   if (!factory) return;
@@ -2064,8 +2064,8 @@ void NS_WrapAuthPrompt(nsIAuthPrompt *aAuthPrompt,
   factory->CreateAdapter(aAuthPrompt, aAuthPrompt2);
 }
 
-void NS_QueryAuthPrompt2(nsIInterfaceRequestor *aCallbacks,
-                         nsIAuthPrompt2 **aAuthPrompt) {
+void NS_QueryAuthPrompt2(nsIInterfaceRequestor* aCallbacks,
+                         nsIAuthPrompt2** aAuthPrompt) {
   CallGetInterface(aCallbacks, aAuthPrompt);
   if (*aAuthPrompt) return;
 
@@ -2076,7 +2076,7 @@ void NS_QueryAuthPrompt2(nsIInterfaceRequestor *aCallbacks,
   NS_WrapAuthPrompt(prompt, aAuthPrompt);
 }
 
-void NS_QueryAuthPrompt2(nsIChannel *aChannel, nsIAuthPrompt2 **aAuthPrompt) {
+void NS_QueryAuthPrompt2(nsIChannel* aChannel, nsIAuthPrompt2** aAuthPrompt) {
   *aAuthPrompt = nullptr;
 
   // We want to use any auth prompt we can find on the channel's callbacks,
@@ -2101,21 +2101,21 @@ void NS_QueryAuthPrompt2(nsIChannel *aChannel, nsIAuthPrompt2 **aAuthPrompt) {
 }
 
 nsresult NS_NewNotificationCallbacksAggregation(
-    nsIInterfaceRequestor *callbacks, nsILoadGroup *loadGroup,
-    nsIEventTarget *target, nsIInterfaceRequestor **result) {
+    nsIInterfaceRequestor* callbacks, nsILoadGroup* loadGroup,
+    nsIEventTarget* target, nsIInterfaceRequestor** result) {
   nsCOMPtr cbs;
   if (loadGroup) loadGroup->GetNotificationCallbacks(getter_AddRefs(cbs));
   return NS_NewInterfaceRequestorAggregation(callbacks, cbs, target, result);
 }
 
 nsresult NS_NewNotificationCallbacksAggregation(
-    nsIInterfaceRequestor *callbacks, nsILoadGroup *loadGroup,
-    nsIInterfaceRequestor **result) {
+    nsIInterfaceRequestor* callbacks, nsILoadGroup* loadGroup,
+    nsIInterfaceRequestor** result) {
   return NS_NewNotificationCallbacksAggregation(callbacks, loadGroup, nullptr,
                                                 result);
 }
 
-nsresult NS_DoImplGetInnermostURI(nsINestedURI *nestedURI, nsIURI **result) {
+nsresult NS_DoImplGetInnermostURI(nsINestedURI* nestedURI, nsIURI** result) {
   MOZ_ASSERT(nestedURI, "Must have a nested URI!");
   MOZ_ASSERT(!*result, "Must have null *result");
 
@@ -2138,14 +2138,14 @@ nsresult NS_DoImplGetInnermostURI(nsINestedURI *nestedURI, nsIURI **result) {
   return rv;
 }
 
-nsresult NS_ImplGetInnermostURI(nsINestedURI *nestedURI, nsIURI **result) {
+nsresult NS_ImplGetInnermostURI(nsINestedURI* nestedURI, nsIURI** result) {
   // Make it safe to use swap()
   *result = nullptr;
 
   return NS_DoImplGetInnermostURI(nestedURI, result);
 }
 
-already_AddRefed NS_GetInnermostURI(nsIURI *aURI) {
+already_AddRefed NS_GetInnermostURI(nsIURI* aURI) {
   MOZ_ASSERT(aURI, "Must have URI");
 
   nsCOMPtr uri = aURI;
@@ -2163,7 +2163,7 @@ already_AddRefed NS_GetInnermostURI(nsIURI *aURI) {
   return uri.forget();
 }
 
-nsresult NS_GetFinalChannelURI(nsIChannel *channel, nsIURI **uri) {
+nsresult NS_GetFinalChannelURI(nsIChannel* channel, nsIURI** uri) {
   *uri = nullptr;
 
   nsCOMPtr loadInfo = channel->LoadInfo();
@@ -2176,7 +2176,7 @@ nsresult NS_GetFinalChannelURI(nsIChannel *channel, nsIURI **uri) {
   return channel->GetOriginalURI(uri);
 }
 
-nsresult NS_URIChainHasFlags(nsIURI *uri, uint32_t flags, bool *result) {
+nsresult NS_URIChainHasFlags(nsIURI* uri, uint32_t flags, bool* result) {
   nsresult rv;
   nsCOMPtr util = do_GetNetUtil(&rv);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -2184,7 +2184,7 @@ nsresult NS_URIChainHasFlags(nsIURI *uri, uint32_t flags, bool *result) {
   return util->URIChainHasFlags(uri, flags, result);
 }
 
-uint32_t NS_SecurityHashURI(nsIURI *aURI) {
+uint32_t NS_SecurityHashURI(nsIURI* aURI) {
   nsCOMPtr baseURI = NS_GetInnermostURI(aURI);
 
   nsAutoCString scheme;
@@ -2219,7 +2219,7 @@ uint32_t NS_SecurityHashURI(nsIURI *aURI) {
   return mozilla::AddToHash(schemeHash, hostHash, NS_GetRealPort(baseURI));
 }
 
-bool NS_SecurityCompareURIs(nsIURI *aSourceURI, nsIURI *aTargetURI,
+bool NS_SecurityCompareURIs(nsIURI* aSourceURI, nsIURI* aTargetURI,
                             bool aStrictFileOriginPolicy) {
   nsresult rv;
 
@@ -2356,7 +2356,7 @@ bool NS_SecurityCompareURIs(nsIURI *aSourceURI, nsIURI *aTargetURI,
   return NS_GetRealPort(targetBaseURI) == NS_GetRealPort(sourceBaseURI);
 }
 
-bool NS_URIIsLocalFile(nsIURI *aURI) {
+bool NS_URIIsLocalFile(nsIURI* aURI) {
   nsCOMPtr util = do_GetNetUtil();
 
   bool isFile;
@@ -2366,7 +2366,7 @@ bool NS_URIIsLocalFile(nsIURI *aURI) {
          isFile;
 }
 
-bool NS_RelaxStrictFileOriginPolicy(nsIURI *aTargetURI, nsIURI *aSourceURI,
+bool NS_RelaxStrictFileOriginPolicy(nsIURI* aTargetURI, nsIURI* aSourceURI,
                                     bool aAllowDirectoryTarget /* = false */) {
   if (!NS_URIIsLocalFile(aTargetURI)) {
     // This is probably not what the caller intended
@@ -2439,8 +2439,8 @@ bool NS_RelaxStrictFileOriginPolicy(nsIURI *aTargetURI, nsIURI *aSourceURI,
   return false;
 }
 
-bool NS_IsInternalSameURIRedirect(nsIChannel *aOldChannel,
-                                  nsIChannel *aNewChannel, uint32_t aFlags) {
+bool NS_IsInternalSameURIRedirect(nsIChannel* aOldChannel,
+                                  nsIChannel* aNewChannel, uint32_t aFlags) {
   if (!(aFlags & nsIChannelEventSink::REDIRECT_INTERNAL)) {
     return false;
   }
@@ -2457,7 +2457,7 @@ bool NS_IsInternalSameURIRedirect(nsIChannel *aOldChannel,
   return NS_SUCCEEDED(oldURI->Equals(newURI, &res)) && res;
 }
 
-bool NS_IsHSTSUpgradeRedirect(nsIChannel *aOldChannel, nsIChannel *aNewChannel,
+bool NS_IsHSTSUpgradeRedirect(nsIChannel* aOldChannel, nsIChannel* aNewChannel,
                               uint32_t aFlags) {
   if (!(aFlags & nsIChannelEventSink::REDIRECT_STS_UPGRADE)) {
     return false;
@@ -2487,8 +2487,8 @@ bool NS_IsHSTSUpgradeRedirect(nsIChannel *aOldChannel, nsIChannel *aNewChannel,
 }
 
 nsresult NS_LinkRedirectChannels(uint32_t channelId,
-                                 nsIParentChannel *parentChannel,
-                                 nsIChannel **_result) {
+                                 nsIParentChannel* parentChannel,
+                                 nsIChannel** _result) {
   nsCOMPtr registrar =
       RedirectChannelRegistrar::GetOrCreate();
   MOZ_ASSERT(registrar);
@@ -2496,14 +2496,14 @@ nsresult NS_LinkRedirectChannels(uint32_t channelId,
   return registrar->LinkChannels(channelId, parentChannel, _result);
 }
 
-nsresult NS_MaybeOpenChannelUsingOpen(nsIChannel *aChannel,
-                                      nsIInputStream **aStream) {
+nsresult NS_MaybeOpenChannelUsingOpen(nsIChannel* aChannel,
+                                      nsIInputStream** aStream) {
   nsCOMPtr loadInfo = aChannel->LoadInfo();
   return aChannel->Open(aStream);
 }
 
-nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel *aChannel,
-                                           nsIStreamListener *aListener) {
+nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel* aChannel,
+                                           nsIStreamListener* aListener) {
   nsCOMPtr loadInfo = aChannel->LoadInfo();
   return aChannel->AsyncOpen(aListener);
 }
@@ -2512,7 +2512,7 @@ nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel *aChannel,
  * tell whether it indicates the content is inline or attachment
  * @param aDispToken the disposition token from the content-disposition header
  */
-uint32_t NS_GetContentDispositionFromToken(const nsAString &aDispToken) {
+uint32_t NS_GetContentDispositionFromToken(const nsAString& aDispToken) {
   // RFC 2183, section 2.8 says that an unknown disposition
   // value should be treated as "attachment"
   // If all of these tests eval to false, then we have a content-disposition of
@@ -2527,8 +2527,8 @@ uint32_t NS_GetContentDispositionFromToken(const nsAString &aDispToken) {
   return nsIChannel::DISPOSITION_ATTACHMENT;
 }
 
-uint32_t NS_GetContentDispositionFromHeader(const nsACString &aHeader,
-                                            nsIChannel *aChan /* = nullptr */) {
+uint32_t NS_GetContentDispositionFromHeader(const nsACString& aHeader,
+                                            nsIChannel* aChan /* = nullptr */) {
   nsresult rv;
   nsCOMPtr mimehdrpar =
       do_GetService(NS_MIMEHEADERPARAM_CONTRACTID, &rv);
@@ -2548,9 +2548,9 @@ uint32_t NS_GetContentDispositionFromHeader(const nsACString &aHeader,
   return NS_GetContentDispositionFromToken(dispToken);
 }
 
-nsresult NS_GetFilenameFromDisposition(nsAString &aFilename,
-                                       const nsACString &aDisposition,
-                                       nsIURI *aURI /* = nullptr */) {
+nsresult NS_GetFilenameFromDisposition(nsAString& aFilename,
+                                       const nsACString& aDisposition,
+                                       nsIURI* aURI /* = nullptr */) {
   aFilename.Truncate();
 
   nsresult rv;
@@ -2582,7 +2582,7 @@ void net_EnsurePSMInit() {
   nsCOMPtr cos = do_GetService(NS_CERTOVERRIDE_CONTRACTID);
 }
 
-bool NS_IsAboutBlank(nsIURI *uri) {
+bool NS_IsAboutBlank(nsIURI* uri) {
   // GetSpec can be expensive for some URIs, so check the scheme first.
   bool isAbout = false;
   if (NS_FAILED(uri->SchemeIs("about", &isAbout)) || !isAbout) {
@@ -2592,8 +2592,8 @@ bool NS_IsAboutBlank(nsIURI *uri) {
   return uri->GetSpecOrDefault().EqualsLiteral("about:blank");
 }
 
-nsresult NS_GenerateHostPort(const nsCString &host, int32_t port,
-                             nsACString &hostLine) {
+nsresult NS_GenerateHostPort(const nsCString& host, int32_t port,
+                             nsACString& hostLine) {
   if (strchr(host.get(), ':')) {
     // host is an IPv6 address literal and must be encapsulated in []'s
     hostLine.Assign('[');
@@ -2615,13 +2615,13 @@ nsresult NS_GenerateHostPort(const nsCString &host, int32_t port,
   return NS_OK;
 }
 
-void NS_SniffContent(const char *aSnifferType, nsIRequest *aRequest,
-                     const uint8_t *aData, uint32_t aLength,
-                     nsACString &aSniffedType) {
+void NS_SniffContent(const char* aSnifferType, nsIRequest* aRequest,
+                     const uint8_t* aData, uint32_t aLength,
+                     nsACString& aSniffedType) {
   typedef nsCategoryCache ContentSnifferCache;
-  extern ContentSnifferCache *gNetSniffers;
-  extern ContentSnifferCache *gDataSniffers;
-  ContentSnifferCache *cache = nullptr;
+  extern ContentSnifferCache* gNetSniffers;
+  extern ContentSnifferCache* gDataSniffers;
+  ContentSnifferCache* cache = nullptr;
   if (!strcmp(aSnifferType, NS_CONTENT_SNIFFER_CATEGORY)) {
     if (!gNetSniffers) {
       gNetSniffers = new ContentSnifferCache(NS_CONTENT_SNIFFER_CATEGORY);
@@ -2651,7 +2651,7 @@ void NS_SniffContent(const char *aSnifferType, nsIRequest *aRequest,
   aSniffedType.Truncate();
 }
 
-bool NS_IsSrcdocChannel(nsIChannel *aChannel) {
+bool NS_IsSrcdocChannel(nsIChannel* aChannel) {
   bool isSrcdoc;
   nsCOMPtr isr = do_QueryInterface(aChannel);
   if (isr) {
@@ -2669,11 +2669,11 @@ bool NS_IsSrcdocChannel(nsIChannel *aChannel) {
 }
 
 nsresult NS_ShouldSecureUpgrade(
-    nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIPrincipal *aChannelResultPrincipal,
+    nsIURI* aURI, nsILoadInfo* aLoadInfo, nsIPrincipal* aChannelResultPrincipal,
     bool aPrivateBrowsing, bool aAllowSTS,
-    const OriginAttributes &aOriginAttributes, bool &aShouldUpgrade,
-    std::function &&aResultCallback,
-    bool &aWillCallback) {
+    const OriginAttributes& aOriginAttributes, bool& aShouldUpgrade,
+    std::function&& aResultCallback,
+    bool& aWillCallback) {
   aWillCallback = false;
 
   // Even if we're in private browsing mode, we still enforce existing STS
@@ -2702,7 +2702,7 @@ nsresult NS_ShouldSecureUpgrade(
         NS_ConvertUTF8toUTF16 reportScheme(scheme);
 
         if (aLoadInfo->GetUpgradeInsecureRequests()) {
-          const char16_t *params[] = {reportSpec.get(), reportScheme.get()};
+          const char16_t* params[] = {reportSpec.get(), reportScheme.get()};
           uint32_t innerWindowId = aLoadInfo->GetInnerWindowID();
           CSP_LogLocalizedStr(
               "upgradeInsecureRequest", params, ArrayLength(params),
@@ -2717,7 +2717,7 @@ nsresult NS_ShouldSecureUpgrade(
               Telemetry::LABELS_HTTP_SCHEME_UPGRADE_TYPE::CSP);
         } else {
           RefPtr doc;
-          nsINode *node = aLoadInfo->LoadingNode();
+          nsINode* node = aLoadInfo->LoadingNode();
           if (node) {
             doc = node->OwnerDoc();
           }
@@ -2726,7 +2726,7 @@ nsresult NS_ShouldSecureUpgrade(
           nsresult rv = nsContentUtils::GetLocalizedString(
               nsContentUtils::eBRAND_PROPERTIES, "brandShortName", brandName);
           if (NS_SUCCEEDED(rv)) {
-            const char16_t *params[] = {brandName.get(), reportSpec.get(),
+            const char16_t* params[] = {brandName.get(), reportSpec.get(),
                                         reportScheme.get()};
             nsContentUtils::ReportToConsole(
                 nsIScriptError::warningFlag,
@@ -2745,7 +2745,7 @@ nsresult NS_ShouldSecureUpgrade(
     }
 
     // enforce Strict-Transport-Security
-    nsISiteSecurityService *sss = gHttpHandler->GetSSService();
+    nsISiteSecurityService* sss = gHttpHandler->GetSSService();
     NS_ENSURE_TRUE(sss, NS_ERROR_OUT_OF_MEMORY);
 
     bool isStsHost = false;
@@ -2838,7 +2838,7 @@ nsresult NS_ShouldSecureUpgrade(
   return NS_OK;
 }
 
-nsresult NS_GetSecureUpgradedURI(nsIURI *aURI, nsIURI **aUpgradedURI) {
+nsresult NS_GetSecureUpgradedURI(nsIURI* aURI, nsIURI** aUpgradedURI) {
   NS_MutateURI mutator(aURI);
   mutator.SetScheme(
       NS_LITERAL_CSTRING("https"));  // Change the scheme to HTTPS:
@@ -2872,7 +2872,7 @@ nsresult NS_GetSecureUpgradedURI(nsIURI *aURI, nsIURI **aUpgradedURI) {
   return mutator.Finalize(aUpgradedURI);
 }
 
-nsresult NS_CompareLoadInfoAndLoadContext(nsIChannel *aChannel) {
+nsresult NS_CompareLoadInfoAndLoadContext(nsIChannel* aChannel) {
   nsCOMPtr loadInfo = aChannel->LoadInfo();
 
   nsCOMPtr loadContext;
@@ -2885,9 +2885,9 @@ nsresult NS_CompareLoadInfoAndLoadContext(nsIChannel *aChannel) {
   // about:newtab will use SystemPrincipal to download thumbnails through
   // https:// and blob URLs.
   bool isAboutPage = false;
-  nsINode *node = loadInfo->LoadingNode();
+  nsINode* node = loadInfo->LoadingNode();
   if (node) {
-    nsIURI *uri = node->OwnerDoc()->GetDocumentURI();
+    nsIURI* uri = node->OwnerDoc()->GetDocumentURI();
     nsresult rv = uri->SchemeIs("about", &isAboutPage);
     NS_ENSURE_SUCCESS(rv, rv);
   }
@@ -2945,7 +2945,7 @@ nsresult NS_CompareLoadInfoAndLoadContext(nsIChannel *aChannel) {
   return NS_OK;
 }
 
-uint32_t NS_GetDefaultReferrerPolicy(nsIHttpChannel *aChannel, nsIURI *aURI,
+uint32_t NS_GetDefaultReferrerPolicy(nsIHttpChannel* aChannel, nsIURI* aURI,
                                      bool privateBrowsing) {
   static bool preferencesInitialized = false;
 
@@ -3069,7 +3069,7 @@ bool NS_IsOffline() {
  * 2. nsIChannel::LOAD_BYPASS_URL_CLASSIFIER, channel's opener can use this
  *    flag to enforce bypassing the URL classifier check.
  */
-bool NS_ShouldClassifyChannel(nsIChannel *aChannel) {
+bool NS_ShouldClassifyChannel(nsIChannel* aChannel) {
   nsLoadFlags loadFlags;
   Unused << aChannel->GetLoadFlags(&loadFlags);
   //  If our load flags dictate that we must let this channel through without
@@ -3116,63 +3116,63 @@ bool InScriptableRange(int64_t val) {
 
 bool InScriptableRange(uint64_t val) { return val <= kJS_MAX_SAFE_UINTEGER; }
 
-nsresult GetParameterHTTP(const nsACString &aHeaderVal, const char *aParamName,
-                          nsAString &aResult) {
+nsresult GetParameterHTTP(const nsACString& aHeaderVal, const char* aParamName,
+                          nsAString& aResult) {
   return nsMIMEHeaderParamImpl::GetParameterHTTP(aHeaderVal, aParamName,
                                                  aResult);
 }
 
-bool SchemeIsHTTP(nsIURI *aURI) {
+bool SchemeIsHTTP(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("http");
 }
 
-bool SchemeIsHTTPS(nsIURI *aURI) {
+bool SchemeIsHTTPS(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("https");
 }
 
-bool SchemeIsJavascript(nsIURI *aURI) {
+bool SchemeIsJavascript(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("javascript");
 }
 
-bool SchemeIsChrome(nsIURI *aURI) {
+bool SchemeIsChrome(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("chrome");
 }
 
-bool SchemeIsAbout(nsIURI *aURI) {
+bool SchemeIsAbout(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("about");
 }
 
-bool SchemeIsBlob(nsIURI *aURI) {
+bool SchemeIsBlob(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("blob");
 }
 
-bool SchemeIsFile(nsIURI *aURI) {
+bool SchemeIsFile(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("file");
 }
 
-bool SchemeIsData(nsIURI *aURI) {
+bool SchemeIsData(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("data");
 }
 
-bool SchemeIsViewSource(nsIURI *aURI) {
+bool SchemeIsViewSource(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("view-source");
 }
 
-bool SchemeIsResource(nsIURI *aURI) {
+bool SchemeIsResource(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("resource");
 }
 
-bool SchemeIsFTP(nsIURI *aURI) {
+bool SchemeIsFTP(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   return aURI->SchemeIs("ftp");
 }
diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h
index 4415288c16864..0ac4f5d4dfe08 100644
--- a/netwerk/base/nsNetUtil.h
+++ b/netwerk/base/nsNetUtil.h
@@ -68,37 +68,37 @@ class nsCOMPtr;
 template 
 struct already_AddRefed;
 
-already_AddRefed do_GetIOService(nsresult *error = nullptr);
+already_AddRefed do_GetIOService(nsresult* error = nullptr);
 
-already_AddRefed do_GetNetUtil(nsresult *error = nullptr);
+already_AddRefed do_GetNetUtil(nsresult* error = nullptr);
 
 // private little helper function... don't call this directly!
-nsresult net_EnsureIOService(nsIIOService **ios, nsCOMPtr &grip);
+nsresult net_EnsureIOService(nsIIOService** ios, nsCOMPtr& grip);
 
-nsresult NS_NewURI(nsIURI **result, const nsACString &spec,
-                   const char *charset = nullptr, nsIURI *baseURI = nullptr,
-                   nsIIOService *ioService =
+nsresult NS_NewURI(nsIURI** result, const nsACString& spec,
+                   const char* charset = nullptr, nsIURI* baseURI = nullptr,
+                   nsIIOService* ioService =
                        nullptr);  // pass in nsIIOService to optimize callers
 
-nsresult NS_NewURI(nsIURI **result, const nsACString &spec,
-                   mozilla::NotNull encoding,
-                   nsIURI *baseURI = nullptr,
-                   nsIIOService *ioService =
+nsresult NS_NewURI(nsIURI** result, const nsACString& spec,
+                   mozilla::NotNull encoding,
+                   nsIURI* baseURI = nullptr,
+                   nsIIOService* ioService =
                        nullptr);  // pass in nsIIOService to optimize callers
 
-nsresult NS_NewURI(nsIURI **result, const nsAString &spec,
-                   const char *charset = nullptr, nsIURI *baseURI = nullptr,
-                   nsIIOService *ioService =
+nsresult NS_NewURI(nsIURI** result, const nsAString& spec,
+                   const char* charset = nullptr, nsIURI* baseURI = nullptr,
+                   nsIIOService* ioService =
                        nullptr);  // pass in nsIIOService to optimize callers
 
-nsresult NS_NewURI(nsIURI **result, const nsAString &spec,
-                   mozilla::NotNull encoding,
-                   nsIURI *baseURI = nullptr,
-                   nsIIOService *ioService =
+nsresult NS_NewURI(nsIURI** result, const nsAString& spec,
+                   mozilla::NotNull encoding,
+                   nsIURI* baseURI = nullptr,
+                   nsIIOService* ioService =
                        nullptr);  // pass in nsIIOService to optimize callers
 
-nsresult NS_NewURI(nsIURI **result, const char *spec, nsIURI *baseURI = nullptr,
-                   nsIIOService *ioService =
+nsresult NS_NewURI(nsIURI** result, const char* spec, nsIURI* baseURI = nullptr,
+                   nsIIOService* ioService =
                        nullptr);  // pass in nsIIOService to optimize callers
 
 // This function attempts to create an nsIURI on any thread. This implies we
@@ -109,14 +109,14 @@ nsresult NS_NewURI(nsIURI **result, const char *spec, nsIURI *baseURI = nullptr,
 // NS_ERROR_UNKNOWN_PROTOCOL. The caller may retry on the main thread.
 // When called on the main thread, this function will fall back on calling
 // nsIProtocolHandler.newURI
-nsresult NS_NewURIOnAnyThread(nsIURI **aResult, const nsACString &aSpec,
-                              const char *aCharset = nullptr,
-                              nsIURI *aBaseURI = nullptr,
-                              nsIIOService *aIOService = nullptr);
+nsresult NS_NewURIOnAnyThread(nsIURI** aResult, const nsACString& aSpec,
+                              const char* aCharset = nullptr,
+                              nsIURI* aBaseURI = nullptr,
+                              nsIIOService* aIOService = nullptr);
 
 nsresult NS_NewFileURI(
-    nsIURI **result, nsIFile *spec,
-    nsIIOService *ioService =
+    nsIURI** result, nsIFile* spec,
+    nsIIOService* ioService =
         nullptr);  // pass in nsIIOService to optimize callers
 
 // These methods will only mutate the URI if the ref of aInput doesn't already
@@ -126,12 +126,12 @@ nsresult NS_NewFileURI(
 // as aInput. The same is true if aRef is already equal to the ref of aInput.
 // This is OK because URIs are immutable and threadsafe.
 // If the URI doesn't support ref fragments aOutput will be the same as aInput.
-nsresult NS_GetURIWithNewRef(nsIURI *aInput, const nsACString &aRef,
-                             nsIURI **aOutput);
-nsresult NS_GetURIWithoutRef(nsIURI *aInput, nsIURI **aOutput);
+nsresult NS_GetURIWithNewRef(nsIURI* aInput, const nsACString& aRef,
+                             nsIURI** aOutput);
+nsresult NS_GetURIWithoutRef(nsIURI* aInput, nsIURI** aOutput);
 
-nsresult NS_GetSanitizedURIStringFromURI(nsIURI *aUri,
-                                         nsAString &aSanitizedSpec);
+nsresult NS_GetSanitizedURIStringFromURI(nsIURI* aUri,
+                                         nsAString& aSanitizedSpec);
 
 /*
  * How to create a new Channel, using NS_NewChannel,
@@ -176,178 +176,178 @@ nsresult NS_GetSanitizedURIStringFromURI(nsIURI *aUri,
  * systemPrincipal as the loadingPrincipal.
  */
 nsresult NS_NewChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri, nsINode *aLoadingNode,
-    nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal,
-    const mozilla::Maybe &aLoadingClientInfo,
-    const mozilla::Maybe &aController,
+    nsIChannel** outChannel, nsIURI* aUri, nsINode* aLoadingNode,
+    nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
+    const mozilla::Maybe& aLoadingClientInfo,
+    const mozilla::Maybe& aController,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    nsICookieSettings *aCookieSettings = nullptr,
-    mozilla::dom::PerformanceStorage *aPerformanceStorage = nullptr,
-    nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    nsICookieSettings* aCookieSettings = nullptr,
+    mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr,
+    nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIIOService *aIoService = nullptr);
+    nsIIOService* aIoService = nullptr);
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult NS_NewChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri, nsILoadInfo *aLoadInfo,
-    mozilla::dom::PerformanceStorage *aPerformanceStorage = nullptr,
-    nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    nsIChannel** outChannel, nsIURI* aUri, nsILoadInfo* aLoadInfo,
+    mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr,
+    nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIIOService *aIoService = nullptr);
+    nsIIOService* aIoService = nullptr);
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult /*NS_NewChannelWithNodeAndTriggeringPrincipal */
 NS_NewChannelWithTriggeringPrincipal(
-    nsIChannel **outChannel, nsIURI *aUri, nsINode *aLoadingNode,
-    nsIPrincipal *aTriggeringPrincipal, nsSecurityFlags aSecurityFlags,
+    nsIChannel** outChannel, nsIURI* aUri, nsINode* aLoadingNode,
+    nsIPrincipal* aTriggeringPrincipal, nsSecurityFlags aSecurityFlags,
     nsContentPolicyType aContentPolicyType,
-    mozilla::dom::PerformanceStorage *aPerformanceStorage = nullptr,
-    nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr,
+    nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIIOService *aIoService = nullptr);
+    nsIIOService* aIoService = nullptr);
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult NS_NewChannelWithTriggeringPrincipal(
-    nsIChannel **outChannel, nsIURI *aUri, nsIPrincipal *aLoadingPrincipal,
-    nsIPrincipal *aTriggeringPrincipal, nsSecurityFlags aSecurityFlags,
+    nsIChannel** outChannel, nsIURI* aUri, nsIPrincipal* aLoadingPrincipal,
+    nsIPrincipal* aTriggeringPrincipal, nsSecurityFlags aSecurityFlags,
     nsContentPolicyType aContentPolicyType,
-    nsICookieSettings *aCookieSettings = nullptr,
-    mozilla::dom::PerformanceStorage *aPerformanceStorage = nullptr,
-    nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    nsICookieSettings* aCookieSettings = nullptr,
+    mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr,
+    nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIIOService *aIoService = nullptr);
+    nsIIOService* aIoService = nullptr);
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult NS_NewChannelWithTriggeringPrincipal(
-    nsIChannel **outChannel, nsIURI *aUri, nsIPrincipal *aLoadingPrincipal,
-    nsIPrincipal *aTriggeringPrincipal,
-    const mozilla::dom::ClientInfo &aLoadingClientInfo,
-    const mozilla::Maybe &aController,
+    nsIChannel** outChannel, nsIURI* aUri, nsIPrincipal* aLoadingPrincipal,
+    nsIPrincipal* aTriggeringPrincipal,
+    const mozilla::dom::ClientInfo& aLoadingClientInfo,
+    const mozilla::Maybe& aController,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    nsICookieSettings *aCookieSettings = nullptr,
-    mozilla::dom::PerformanceStorage *aPerformanceStorage = nullptr,
-    nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    nsICookieSettings* aCookieSettings = nullptr,
+    mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr,
+    nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIIOService *aIoService = nullptr);
+    nsIIOService* aIoService = nullptr);
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult NS_NewChannel(
-    nsIChannel **outChannel, nsIURI *aUri, nsINode *aLoadingNode,
+    nsIChannel** outChannel, nsIURI* aUri, nsINode* aLoadingNode,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    mozilla::dom::PerformanceStorage *aPerformanceStorage = nullptr,
-    nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr,
+    nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIIOService *aIoService = nullptr);
+    nsIIOService* aIoService = nullptr);
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult NS_NewChannel(
-    nsIChannel **outChannel, nsIURI *aUri, nsIPrincipal *aLoadingPrincipal,
+    nsIChannel** outChannel, nsIURI* aUri, nsIPrincipal* aLoadingPrincipal,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    nsICookieSettings *aCookieSettings = nullptr,
-    mozilla::dom::PerformanceStorage *aPerformanceStorage = nullptr,
-    nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    nsICookieSettings* aCookieSettings = nullptr,
+    mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr,
+    nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIIOService *aIoService = nullptr);
+    nsIIOService* aIoService = nullptr);
 
 // See NS_NewChannelInternal for usage and argument description
 nsresult NS_NewChannel(
-    nsIChannel **outChannel, nsIURI *aUri, nsIPrincipal *aLoadingPrincipal,
-    const mozilla::dom::ClientInfo &aLoadingClientInfo,
-    const mozilla::Maybe &aController,
+    nsIChannel** outChannel, nsIURI* aUri, nsIPrincipal* aLoadingPrincipal,
+    const mozilla::dom::ClientInfo& aLoadingClientInfo,
+    const mozilla::Maybe& aController,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    nsICookieSettings *aCookieSettings = nullptr,
-    mozilla::dom::PerformanceStorage *aPerformanceStorage = nullptr,
-    nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    nsICookieSettings* aCookieSettings = nullptr,
+    mozilla::dom::PerformanceStorage* aPerformanceStorage = nullptr,
+    nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIIOService *aIoService = nullptr);
+    nsIIOService* aIoService = nullptr);
 
-nsresult NS_GetIsDocumentChannel(nsIChannel *aChannel, bool *aIsDocument);
+nsresult NS_GetIsDocumentChannel(nsIChannel* aChannel, bool* aIsDocument);
 
-nsresult NS_MakeAbsoluteURI(nsACString &result, const nsACString &spec,
-                            nsIURI *baseURI);
+nsresult NS_MakeAbsoluteURI(nsACString& result, const nsACString& spec,
+                            nsIURI* baseURI);
 
-nsresult NS_MakeAbsoluteURI(char **result, const char *spec, nsIURI *baseURI);
+nsresult NS_MakeAbsoluteURI(char** result, const char* spec, nsIURI* baseURI);
 
-nsresult NS_MakeAbsoluteURI(nsAString &result, const nsAString &spec,
-                            nsIURI *baseURI);
+nsresult NS_MakeAbsoluteURI(nsAString& result, const nsAString& spec,
+                            nsIURI* baseURI);
 
 /**
  * This function is a helper function to get a scheme's default port.
  */
-int32_t NS_GetDefaultPort(const char *scheme,
-                          nsIIOService *ioService = nullptr);
+int32_t NS_GetDefaultPort(const char* scheme,
+                          nsIIOService* ioService = nullptr);
 
 /**
  * This function is a helper function to apply the ToAscii conversion
  * to a string
  */
-bool NS_StringToACE(const nsACString &idn, nsACString &result);
+bool NS_StringToACE(const nsACString& idn, nsACString& result);
 
 /**
  * This function is a helper function to get a protocol's default port if the
  * URI does not specify a port explicitly. Returns -1 if this protocol has no
  * concept of ports or if there was an error getting the port.
  */
-int32_t NS_GetRealPort(nsIURI *aURI);
+int32_t NS_GetRealPort(nsIURI* aURI);
 
 nsresult NS_NewInputStreamChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri,
-    already_AddRefed aStream, const nsACString &aContentType,
-    const nsACString &aContentCharset, nsILoadInfo *aLoadInfo);
+    nsIChannel** outChannel, nsIURI* aUri,
+    already_AddRefed aStream, const nsACString& aContentType,
+    const nsACString& aContentCharset, nsILoadInfo* aLoadInfo);
 
 nsresult NS_NewInputStreamChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri,
-    already_AddRefed aStream, const nsACString &aContentType,
-    const nsACString &aContentCharset, nsINode *aLoadingNode,
-    nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal,
+    nsIChannel** outChannel, nsIURI* aUri,
+    already_AddRefed aStream, const nsACString& aContentType,
+    const nsACString& aContentCharset, nsINode* aLoadingNode,
+    nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType);
 
 nsresult NS_NewInputStreamChannel(
-    nsIChannel **outChannel, nsIURI *aUri,
-    already_AddRefed aStream, nsIPrincipal *aLoadingPrincipal,
+    nsIChannel** outChannel, nsIURI* aUri,
+    already_AddRefed aStream, nsIPrincipal* aLoadingPrincipal,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
-    const nsACString &aContentType = EmptyCString(),
-    const nsACString &aContentCharset = EmptyCString());
+    const nsACString& aContentType = EmptyCString(),
+    const nsACString& aContentCharset = EmptyCString());
 
 nsresult NS_NewInputStreamChannelInternal(
-    nsIChannel **outChannel, nsIURI *aUri, const nsAString &aData,
-    const nsACString &aContentType, nsINode *aLoadingNode,
-    nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal,
+    nsIChannel** outChannel, nsIURI* aUri, const nsAString& aData,
+    const nsACString& aContentType, nsINode* aLoadingNode,
+    nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
     bool aIsSrcdocChannel = false);
 
-nsresult NS_NewInputStreamChannelInternal(nsIChannel **outChannel, nsIURI *aUri,
-                                          const nsAString &aData,
-                                          const nsACString &aContentType,
-                                          nsILoadInfo *aLoadInfo,
+nsresult NS_NewInputStreamChannelInternal(nsIChannel** outChannel, nsIURI* aUri,
+                                          const nsAString& aData,
+                                          const nsACString& aContentType,
+                                          nsILoadInfo* aLoadInfo,
                                           bool aIsSrcdocChannel = false);
 
-nsresult NS_NewInputStreamChannel(nsIChannel **outChannel, nsIURI *aUri,
-                                  const nsAString &aData,
-                                  const nsACString &aContentType,
-                                  nsIPrincipal *aLoadingPrincipal,
+nsresult NS_NewInputStreamChannel(nsIChannel** outChannel, nsIURI* aUri,
+                                  const nsAString& aData,
+                                  const nsACString& aContentType,
+                                  nsIPrincipal* aLoadingPrincipal,
                                   nsSecurityFlags aSecurityFlags,
                                   nsContentPolicyType aContentPolicyType,
                                   bool aIsSrcdocChannel = false);
 
-nsresult NS_NewInputStreamPump(nsIInputStreamPump **aResult,
+nsresult NS_NewInputStreamPump(nsIInputStreamPump** aResult,
                                already_AddRefed aStream,
                                uint32_t aSegsize = 0, uint32_t aSegcount = 0,
                                bool aCloseWhenDone = false,
-                               nsIEventTarget *aMainThreadTarget = nullptr);
+                               nsIEventTarget* aMainThreadTarget = nullptr);
 
-nsresult NS_NewLoadGroup(nsILoadGroup **result, nsIRequestObserver *obs);
+nsresult NS_NewLoadGroup(nsILoadGroup** result, nsIRequestObserver* obs);
 
 // Create a new nsILoadGroup that will match the given principal.
-nsresult NS_NewLoadGroup(nsILoadGroup **aResult, nsIPrincipal *aPrincipal);
+nsresult NS_NewLoadGroup(nsILoadGroup** aResult, nsIPrincipal* aPrincipal);
 
 // Determine if the given loadGroup/principal pair will produce a principal
 // with similar permissions when passed to NS_NewChannel().  This checks for
@@ -355,52 +355,52 @@ nsresult NS_NewLoadGroup(nsILoadGroup **aResult, nsIPrincipal *aPrincipal);
 // an appropriate load group these values can be lost when getting the result
 // principal back out of the channel.  Null principals are also always allowed
 // as they do not have permissions to actually use the load group.
-bool NS_LoadGroupMatchesPrincipal(nsILoadGroup *aLoadGroup,
-                                  nsIPrincipal *aPrincipal);
+bool NS_LoadGroupMatchesPrincipal(nsILoadGroup* aLoadGroup,
+                                  nsIPrincipal* aPrincipal);
 
-nsresult NS_NewDownloader(nsIStreamListener **result,
-                          nsIDownloadObserver *observer,
-                          nsIFile *downloadLocation = nullptr);
+nsresult NS_NewDownloader(nsIStreamListener** result,
+                          nsIDownloadObserver* observer,
+                          nsIFile* downloadLocation = nullptr);
 
-nsresult NS_NewStreamLoader(nsIStreamLoader **result,
-                            nsIStreamLoaderObserver *observer,
-                            nsIRequestObserver *requestObserver = nullptr);
+nsresult NS_NewStreamLoader(nsIStreamLoader** result,
+                            nsIStreamLoaderObserver* observer,
+                            nsIRequestObserver* requestObserver = nullptr);
 
 nsresult NS_NewIncrementalStreamLoader(
-    nsIIncrementalStreamLoader **result,
-    nsIIncrementalStreamLoaderObserver *observer);
+    nsIIncrementalStreamLoader** result,
+    nsIIncrementalStreamLoaderObserver* observer);
 
 nsresult NS_NewStreamLoaderInternal(
-    nsIStreamLoader **outStream, nsIURI *aUri,
-    nsIStreamLoaderObserver *aObserver, nsINode *aLoadingNode,
-    nsIPrincipal *aLoadingPrincipal, nsSecurityFlags aSecurityFlags,
-    nsContentPolicyType aContentPolicyType, nsILoadGroup *aLoadGroup = nullptr,
-    nsIInterfaceRequestor *aCallbacks = nullptr,
+    nsIStreamLoader** outStream, nsIURI* aUri,
+    nsIStreamLoaderObserver* aObserver, nsINode* aLoadingNode,
+    nsIPrincipal* aLoadingPrincipal, nsSecurityFlags aSecurityFlags,
+    nsContentPolicyType aContentPolicyType, nsILoadGroup* aLoadGroup = nullptr,
+    nsIInterfaceRequestor* aCallbacks = nullptr,
     nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-    nsIURI *aReferrer = nullptr);
+    nsIURI* aReferrer = nullptr);
 
-nsresult NS_NewStreamLoader(nsIStreamLoader **outStream, nsIURI *aUri,
-                            nsIStreamLoaderObserver *aObserver,
-                            nsINode *aLoadingNode,
+nsresult NS_NewStreamLoader(nsIStreamLoader** outStream, nsIURI* aUri,
+                            nsIStreamLoaderObserver* aObserver,
+                            nsINode* aLoadingNode,
                             nsSecurityFlags aSecurityFlags,
                             nsContentPolicyType aContentPolicyType,
-                            nsILoadGroup *aLoadGroup = nullptr,
-                            nsIInterfaceRequestor *aCallbacks = nullptr,
+                            nsILoadGroup* aLoadGroup = nullptr,
+                            nsIInterfaceRequestor* aCallbacks = nullptr,
                             nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-                            nsIURI *aReferrer = nullptr);
+                            nsIURI* aReferrer = nullptr);
 
-nsresult NS_NewStreamLoader(nsIStreamLoader **outStream, nsIURI *aUri,
-                            nsIStreamLoaderObserver *aObserver,
-                            nsIPrincipal *aLoadingPrincipal,
+nsresult NS_NewStreamLoader(nsIStreamLoader** outStream, nsIURI* aUri,
+                            nsIStreamLoaderObserver* aObserver,
+                            nsIPrincipal* aLoadingPrincipal,
                             nsSecurityFlags aSecurityFlags,
                             nsContentPolicyType aContentPolicyType,
-                            nsILoadGroup *aLoadGroup = nullptr,
-                            nsIInterfaceRequestor *aCallbacks = nullptr,
+                            nsILoadGroup* aLoadGroup = nullptr,
+                            nsIInterfaceRequestor* aCallbacks = nullptr,
                             nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
-                            nsIURI *aReferrer = nullptr);
+                            nsIURI* aReferrer = nullptr);
 
-nsresult NS_NewSyncStreamListener(nsIStreamListener **result,
-                                  nsIInputStream **stream);
+nsresult NS_NewSyncStreamListener(nsIStreamListener** result,
+                                  nsIInputStream** stream);
 
 /**
  * Implement the nsIChannel::Open(nsIInputStream**) method using the channel's
@@ -409,33 +409,33 @@ nsresult NS_NewSyncStreamListener(nsIStreamListener **result,
  * NOTE: Reading from the returned nsIInputStream may spin the current
  * thread's event queue, which could result in any event being processed.
  */
-nsresult NS_ImplementChannelOpen(nsIChannel *channel, nsIInputStream **result);
+nsresult NS_ImplementChannelOpen(nsIChannel* channel, nsIInputStream** result);
 
-nsresult NS_NewRequestObserverProxy(nsIRequestObserver **result,
-                                    nsIRequestObserver *observer,
-                                    nsISupports *context);
+nsresult NS_NewRequestObserverProxy(nsIRequestObserver** result,
+                                    nsIRequestObserver* observer,
+                                    nsISupports* context);
 
-nsresult NS_NewSimpleStreamListener(nsIStreamListener **result,
-                                    nsIOutputStream *sink,
-                                    nsIRequestObserver *observer = nullptr);
+nsresult NS_NewSimpleStreamListener(nsIStreamListener** result,
+                                    nsIOutputStream* sink,
+                                    nsIRequestObserver* observer = nullptr);
 
-nsresult NS_CheckPortSafety(int32_t port, const char *scheme,
-                            nsIIOService *ioService = nullptr);
+nsresult NS_CheckPortSafety(int32_t port, const char* scheme,
+                            nsIIOService* ioService = nullptr);
 
 // Determine if this URI is using a safe port.
-nsresult NS_CheckPortSafety(nsIURI *uri);
+nsresult NS_CheckPortSafety(nsIURI* uri);
 
-nsresult NS_NewProxyInfo(const nsACString &type, const nsACString &host,
-                         int32_t port, uint32_t flags, nsIProxyInfo **result);
+nsresult NS_NewProxyInfo(const nsACString& type, const nsACString& host,
+                         int32_t port, uint32_t flags, nsIProxyInfo** result);
 
-nsresult NS_GetFileProtocolHandler(nsIFileProtocolHandler **result,
-                                   nsIIOService *ioService = nullptr);
+nsresult NS_GetFileProtocolHandler(nsIFileProtocolHandler** result,
+                                   nsIIOService* ioService = nullptr);
 
-nsresult NS_GetFileFromURLSpec(const nsACString &inURL, nsIFile **result,
-                               nsIIOService *ioService = nullptr);
+nsresult NS_GetFileFromURLSpec(const nsACString& inURL, nsIFile** result,
+                               nsIIOService* ioService = nullptr);
 
-nsresult NS_GetURLSpecFromFile(nsIFile *file, nsACString &url,
-                               nsIIOService *ioService = nullptr);
+nsresult NS_GetURLSpecFromFile(nsIFile* file, nsACString& url,
+                               nsIIOService* ioService = nullptr);
 
 /**
  * Converts the nsIFile to the corresponding URL string.
@@ -444,8 +444,8 @@ nsresult NS_GetURLSpecFromFile(nsIFile *file, nsACString &url,
  * usually more efficient.
  * Warning: this restriction may not be enforced at runtime!
  */
-nsresult NS_GetURLSpecFromActualFile(nsIFile *file, nsACString &url,
-                                     nsIIOService *ioService = nullptr);
+nsresult NS_GetURLSpecFromActualFile(nsIFile* file, nsACString& url,
+                                     nsIIOService* ioService = nullptr);
 
 /**
  * Converts the nsIFile to the corresponding URL string.
@@ -454,8 +454,8 @@ nsresult NS_GetURLSpecFromActualFile(nsIFile *file, nsACString &url,
  * usually more efficient.
  * Warning: this restriction may not be enforced at runtime!
  */
-nsresult NS_GetURLSpecFromDir(nsIFile *file, nsACString &url,
-                              nsIIOService *ioService = nullptr);
+nsresult NS_GetURLSpecFromDir(nsIFile* file, nsACString& url,
+                              nsIIOService* ioService = nullptr);
 
 /**
  * Obtains the referrer for a given channel.  This first tries to obtain the
@@ -464,53 +464,53 @@ nsresult NS_GetURLSpecFromDir(nsIFile *file, nsACString &url,
  *
  * @returns NS_ERROR_NOT_AVAILABLE if no referrer is available.
  */
-nsresult NS_GetReferrerFromChannel(nsIChannel *channel, nsIURI **referrer);
+nsresult NS_GetReferrerFromChannel(nsIChannel* channel, nsIURI** referrer);
 
-nsresult NS_ParseRequestContentType(const nsACString &rawContentType,
-                                    nsCString &contentType,
-                                    nsCString &contentCharset);
+nsresult NS_ParseRequestContentType(const nsACString& rawContentType,
+                                    nsCString& contentType,
+                                    nsCString& contentCharset);
 
-nsresult NS_ParseResponseContentType(const nsACString &rawContentType,
-                                     nsCString &contentType,
-                                     nsCString &contentCharset);
+nsresult NS_ParseResponseContentType(const nsACString& rawContentType,
+                                     nsCString& contentType,
+                                     nsCString& contentCharset);
 
-nsresult NS_ExtractCharsetFromContentType(const nsACString &rawContentType,
-                                          nsCString &contentCharset,
-                                          bool *hadCharset,
-                                          int32_t *charsetStart,
-                                          int32_t *charsetEnd);
+nsresult NS_ExtractCharsetFromContentType(const nsACString& rawContentType,
+                                          nsCString& contentCharset,
+                                          bool* hadCharset,
+                                          int32_t* charsetStart,
+                                          int32_t* charsetEnd);
 
-nsresult NS_NewLocalFileInputStream(nsIInputStream **result, nsIFile *file,
+nsresult NS_NewLocalFileInputStream(nsIInputStream** result, nsIFile* file,
                                     int32_t ioFlags = -1, int32_t perm = -1,
                                     int32_t behaviorFlags = 0);
 
-nsresult NS_NewLocalFileOutputStream(nsIOutputStream **result, nsIFile *file,
+nsresult NS_NewLocalFileOutputStream(nsIOutputStream** result, nsIFile* file,
                                      int32_t ioFlags = -1, int32_t perm = -1,
                                      int32_t behaviorFlags = 0);
 
 // returns a file output stream which can be QI'ed to nsISafeOutputStream.
-nsresult NS_NewAtomicFileOutputStream(nsIOutputStream **result, nsIFile *file,
+nsresult NS_NewAtomicFileOutputStream(nsIOutputStream** result, nsIFile* file,
                                       int32_t ioFlags = -1, int32_t perm = -1,
                                       int32_t behaviorFlags = 0);
 
 // returns a file output stream which can be QI'ed to nsISafeOutputStream.
-nsresult NS_NewSafeLocalFileOutputStream(nsIOutputStream **result,
-                                         nsIFile *file, int32_t ioFlags = -1,
+nsresult NS_NewSafeLocalFileOutputStream(nsIOutputStream** result,
+                                         nsIFile* file, int32_t ioFlags = -1,
                                          int32_t perm = -1,
                                          int32_t behaviorFlags = 0);
 
-nsresult NS_NewLocalFileStream(nsIFileStream **result, nsIFile *file,
+nsresult NS_NewLocalFileStream(nsIFileStream** result, nsIFile* file,
                                int32_t ioFlags = -1, int32_t perm = -1,
                                int32_t behaviorFlags = 0);
 
 MOZ_MUST_USE nsresult NS_NewBufferedInputStream(
-    nsIInputStream **aResult, already_AddRefed aInputStream,
+    nsIInputStream** aResult, already_AddRefed aInputStream,
     uint32_t aBufferSize);
 
 // note: the resulting stream can be QI'ed to nsISafeOutputStream iff the
 // provided stream supports it.
 nsresult NS_NewBufferedOutputStream(
-    nsIOutputStream **aResult, already_AddRefed aOutputStream,
+    nsIOutputStream** aResult, already_AddRefed aOutputStream,
     uint32_t aBufferSize);
 
 /**
@@ -528,19 +528,19 @@ nsresult NS_NewBufferedOutputStream(
  * @param aWritten this pointer will be used to store the number of data
  *                 written in the buffer. If you don't need, pass nullptr.
  */
-nsresult NS_ReadInputStreamToBuffer(nsIInputStream *aInputStream, void **aDest,
+nsresult NS_ReadInputStreamToBuffer(nsIInputStream* aInputStream, void** aDest,
                                     int64_t aCount,
-                                    uint64_t *aWritten = nullptr);
+                                    uint64_t* aWritten = nullptr);
 
 /**
  * See the comment for NS_ReadInputStreamToBuffer
  */
-nsresult NS_ReadInputStreamToString(nsIInputStream *aInputStream,
-                                    nsACString &aDest, int64_t aCount,
-                                    uint64_t *aWritten = nullptr);
+nsresult NS_ReadInputStreamToString(nsIInputStream* aInputStream,
+                                    nsACString& aDest, int64_t aCount,
+                                    uint64_t* aWritten = nullptr);
 
 nsresult NS_LoadPersistentPropertiesFromURISpec(
-    nsIPersistentProperties **outResult, const nsACString &aSpec);
+    nsIPersistentProperties** outResult, const nsACString& aSpec);
 
 /**
  * NS_QueryNotificationCallbacks implements the canonical algorithm for
@@ -553,8 +553,8 @@ nsresult NS_LoadPersistentPropertiesFromURISpec(
  * nsIChannel.
  */
 template 
-inline void NS_QueryNotificationCallbacks(T *channel, const nsIID &iid,
-                                          void **result) {
+inline void NS_QueryNotificationCallbacks(T* channel, const nsIID& iid,
+                                          void** result) {
   MOZ_ASSERT(channel, "null channel");
   *result = nullptr;
 
@@ -577,7 +577,7 @@ inline void NS_QueryNotificationCallbacks(T *channel, const nsIID &iid,
 // an nsIChannel.
 
 template 
-inline void NS_QueryNotificationCallbacks(C *channel, nsCOMPtr &result) {
+inline void NS_QueryNotificationCallbacks(C* channel, nsCOMPtr& result) {
   NS_QueryNotificationCallbacks(channel, NS_GET_TEMPLATE_IID(T),
                                 getter_AddRefs(result));
 }
@@ -586,9 +586,9 @@ inline void NS_QueryNotificationCallbacks(C *channel, nsCOMPtr &result) {
  * Alternate form of NS_QueryNotificationCallbacks designed for use by
  * nsIChannel implementations.
  */
-inline void NS_QueryNotificationCallbacks(nsIInterfaceRequestor *callbacks,
-                                          nsILoadGroup *loadGroup,
-                                          const nsIID &iid, void **result) {
+inline void NS_QueryNotificationCallbacks(nsIInterfaceRequestor* callbacks,
+                                          nsILoadGroup* loadGroup,
+                                          const nsIID& iid, void** result) {
   *result = nullptr;
 
   if (callbacks) callbacks->GetInterface(iid, result);
@@ -606,34 +606,34 @@ inline void NS_QueryNotificationCallbacks(nsIInterfaceRequestor *callbacks,
  * Returns true if channel is using Private Browsing, or false if not.
  * Returns false if channel's callbacks don't implement nsILoadContext.
  */
-bool NS_UsePrivateBrowsing(nsIChannel *channel);
+bool NS_UsePrivateBrowsing(nsIChannel* channel);
 
 /**
  * Extract the OriginAttributes from the channel's triggering principal.
  * If aUsingStoragePrincipal is set to true, the originAttributes could have
  * first-party isolation domain set to the top-level URI.
  */
-bool NS_GetOriginAttributes(nsIChannel *aChannel,
-                            mozilla::OriginAttributes &aAttributes,
+bool NS_GetOriginAttributes(nsIChannel* aChannel,
+                            mozilla::OriginAttributes& aAttributes,
                             bool aUsingStoragePrincipal = false);
 
 /**
  * Returns true if the channel has visited any cross-origin URLs on any
  * URLs that it was redirected through.
  */
-bool NS_HasBeenCrossOrigin(nsIChannel *aChannel, bool aReport = false);
+bool NS_HasBeenCrossOrigin(nsIChannel* aChannel, bool aReport = false);
 
 /**
  * Returns true if the channel is a safe top-level navigation.
  */
-bool NS_IsSafeTopLevelNav(nsIChannel *aChannel);
+bool NS_IsSafeTopLevelNav(nsIChannel* aChannel);
 
 /**
  * Returns true if the channel is a foreign with respect to the host-uri.
  * For loads of TYPE_DOCUMENT, this function returns true if it's a
  * cross origin navigation.
  */
-bool NS_IsSameSiteForeign(nsIChannel *aChannel, nsIURI *aHostURI);
+bool NS_IsSameSiteForeign(nsIChannel* aChannel, nsIURI* aHostURI);
 
 // Constants duplicated from nsIScriptSecurityManager so we avoid having necko
 // know about script security manager.
@@ -653,7 +653,7 @@ bool NS_IsSameSiteForeign(nsIChannel *aChannel, nsIURI *aHostURI);
 /**
  * Determines whether appcache should be checked for a given principal.
  */
-bool NS_ShouldCheckAppCache(nsIPrincipal *aPrincipal);
+bool NS_ShouldCheckAppCache(nsIPrincipal* aPrincipal);
 
 /**
  * Wraps an nsIAuthPrompt so that it can be used as an nsIAuthPrompt2. This
@@ -661,27 +661,27 @@ bool NS_ShouldCheckAppCache(nsIPrincipal *aPrincipal);
  *
  * *aAuthPrompt2 should be set to null before calling this function.
  */
-void NS_WrapAuthPrompt(nsIAuthPrompt *aAuthPrompt,
-                       nsIAuthPrompt2 **aAuthPrompt2);
+void NS_WrapAuthPrompt(nsIAuthPrompt* aAuthPrompt,
+                       nsIAuthPrompt2** aAuthPrompt2);
 
 /**
  * Gets an auth prompt from an interface requestor. This takes care of wrapping
  * an nsIAuthPrompt so that it can be used as an nsIAuthPrompt2.
  */
-void NS_QueryAuthPrompt2(nsIInterfaceRequestor *aCallbacks,
-                         nsIAuthPrompt2 **aAuthPrompt);
+void NS_QueryAuthPrompt2(nsIInterfaceRequestor* aCallbacks,
+                         nsIAuthPrompt2** aAuthPrompt);
 
 /**
  * Gets an nsIAuthPrompt2 from a channel. Use this instead of
  * NS_QueryNotificationCallbacks for better backwards compatibility.
  */
-void NS_QueryAuthPrompt2(nsIChannel *aChannel, nsIAuthPrompt2 **aAuthPrompt);
+void NS_QueryAuthPrompt2(nsIChannel* aChannel, nsIAuthPrompt2** aAuthPrompt);
 
 /* template helper */
 template 
-inline void NS_QueryNotificationCallbacks(nsIInterfaceRequestor *callbacks,
-                                          nsILoadGroup *loadGroup,
-                                          nsCOMPtr &result) {
+inline void NS_QueryNotificationCallbacks(nsIInterfaceRequestor* callbacks,
+                                          nsILoadGroup* loadGroup,
+                                          nsCOMPtr& result) {
   NS_QueryNotificationCallbacks(callbacks, loadGroup, NS_GET_TEMPLATE_IID(T),
                                 getter_AddRefs(result));
 }
@@ -689,15 +689,15 @@ inline void NS_QueryNotificationCallbacks(nsIInterfaceRequestor *callbacks,
 /* template helper */
 template 
 inline void NS_QueryNotificationCallbacks(
-    const nsCOMPtr &aCallbacks,
-    const nsCOMPtr &aLoadGroup, nsCOMPtr &aResult) {
+    const nsCOMPtr& aCallbacks,
+    const nsCOMPtr& aLoadGroup, nsCOMPtr& aResult) {
   NS_QueryNotificationCallbacks(aCallbacks.get(), aLoadGroup.get(), aResult);
 }
 
 /* template helper */
 template 
-inline void NS_QueryNotificationCallbacks(const nsCOMPtr &aChannel,
-                                          nsCOMPtr &aResult) {
+inline void NS_QueryNotificationCallbacks(const nsCOMPtr& aChannel,
+                                          nsCOMPtr& aResult) {
   NS_QueryNotificationCallbacks(aChannel.get(), aResult);
 }
 
@@ -707,12 +707,12 @@ inline void NS_QueryNotificationCallbacks(const nsCOMPtr &aChannel,
  * as the value for nsISocketTransport::securityCallbacks.
  */
 nsresult NS_NewNotificationCallbacksAggregation(
-    nsIInterfaceRequestor *callbacks, nsILoadGroup *loadGroup,
-    nsIEventTarget *target, nsIInterfaceRequestor **result);
+    nsIInterfaceRequestor* callbacks, nsILoadGroup* loadGroup,
+    nsIEventTarget* target, nsIInterfaceRequestor** result);
 
 nsresult NS_NewNotificationCallbacksAggregation(
-    nsIInterfaceRequestor *callbacks, nsILoadGroup *loadGroup,
-    nsIInterfaceRequestor **result);
+    nsIInterfaceRequestor* callbacks, nsILoadGroup* loadGroup,
+    nsIInterfaceRequestor** result);
 
 /**
  * Helper function for testing online/offline state of the browser.
@@ -725,28 +725,28 @@ bool NS_IsOffline();
  * Note that NS_DoImplGetInnermostURI is "private" -- call
  * NS_ImplGetInnermostURI instead.
  */
-nsresult NS_DoImplGetInnermostURI(nsINestedURI *nestedURI, nsIURI **result);
+nsresult NS_DoImplGetInnermostURI(nsINestedURI* nestedURI, nsIURI** result);
 
-nsresult NS_ImplGetInnermostURI(nsINestedURI *nestedURI, nsIURI **result);
+nsresult NS_ImplGetInnermostURI(nsINestedURI* nestedURI, nsIURI** result);
 
 /**
  * Helper function for testing whether the given URI, or any of its
  * inner URIs, has all the given protocol flags.
  */
-nsresult NS_URIChainHasFlags(nsIURI *uri, uint32_t flags, bool *result);
+nsresult NS_URIChainHasFlags(nsIURI* uri, uint32_t flags, bool* result);
 
 /**
  * Helper function for getting the innermost URI for a given URI.  The return
  * value could be just the object passed in if it's not a nested URI.
  */
-already_AddRefed NS_GetInnermostURI(nsIURI *aURI);
+already_AddRefed NS_GetInnermostURI(nsIURI* aURI);
 
 /**
  * Helper function for getting the host name of the innermost URI for a given
  * URI.  The return value could be the host name of the URI passed in if it's
  * not a nested URI.
  */
-inline nsresult NS_GetInnermostURIHost(nsIURI *aURI, nsACString &aHost) {
+inline nsresult NS_GetInnermostURIHost(nsIURI* aURI, nsACString& aHost) {
   aHost.Truncate();
 
   // This block is optimized in order to avoid the overhead of calling
@@ -782,18 +782,18 @@ inline nsresult NS_GetInnermostURIHost(nsIURI *aURI, nsACString &aHost) {
  * load info resultPrincipalURI, if set, corresponds to URI of the channel if
  * it's required to represent the actual principal for the channel.
  */
-nsresult NS_GetFinalChannelURI(nsIChannel *channel, nsIURI **uri);
+nsresult NS_GetFinalChannelURI(nsIChannel* channel, nsIURI** uri);
 
 // NS_SecurityHashURI must return the same hash value for any two URIs that
 // compare equal according to NS_SecurityCompareURIs.  Unfortunately, in the
 // case of files, it's not clear we can do anything better than returning
 // the schemeHash, so hashing files degenerates to storing them in a list.
-uint32_t NS_SecurityHashURI(nsIURI *aURI);
+uint32_t NS_SecurityHashURI(nsIURI* aURI);
 
-bool NS_SecurityCompareURIs(nsIURI *aSourceURI, nsIURI *aTargetURI,
+bool NS_SecurityCompareURIs(nsIURI* aSourceURI, nsIURI* aTargetURI,
                             bool aStrictFileOriginPolicy);
 
-bool NS_URIIsLocalFile(nsIURI *aURI);
+bool NS_URIIsLocalFile(nsIURI* aURI);
 
 // When strict file origin policy is enabled, SecurityCompareURIs will fail for
 // file URIs that do not point to the same local file. This call provides an
@@ -801,48 +801,48 @@ bool NS_URIIsLocalFile(nsIURI *aURI);
 // contained in the same directory as the source.
 //
 // https://developer.mozilla.org/en-US/docs/Same-origin_policy_for_file:_URIs
-bool NS_RelaxStrictFileOriginPolicy(nsIURI *aTargetURI, nsIURI *aSourceURI,
+bool NS_RelaxStrictFileOriginPolicy(nsIURI* aTargetURI, nsIURI* aSourceURI,
                                     bool aAllowDirectoryTarget = false);
 
-bool NS_IsInternalSameURIRedirect(nsIChannel *aOldChannel,
-                                  nsIChannel *aNewChannel, uint32_t aFlags);
+bool NS_IsInternalSameURIRedirect(nsIChannel* aOldChannel,
+                                  nsIChannel* aNewChannel, uint32_t aFlags);
 
-bool NS_IsHSTSUpgradeRedirect(nsIChannel *aOldChannel, nsIChannel *aNewChannel,
+bool NS_IsHSTSUpgradeRedirect(nsIChannel* aOldChannel, nsIChannel* aNewChannel,
                               uint32_t aFlags);
 
 nsresult NS_LinkRedirectChannels(uint32_t channelId,
-                                 nsIParentChannel *parentChannel,
-                                 nsIChannel **_result);
+                                 nsIParentChannel* parentChannel,
+                                 nsIChannel** _result);
 
 /**
  * Helper function which checks whether the channel can be
  * openend using Open() or has to fall back to opening
  * the channel using Open().
  */
-nsresult NS_MaybeOpenChannelUsingOpen(nsIChannel *aChannel,
-                                      nsIInputStream **aStream);
+nsresult NS_MaybeOpenChannelUsingOpen(nsIChannel* aChannel,
+                                      nsIInputStream** aStream);
 
 /**
  * Helper function which checks whether the channel can be
  * openend using AsyncOpen() or has to fall back to opening
  * the channel using AsyncOpen().
  */
-nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel *aChannel,
-                                           nsIStreamListener *aListener);
+nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel* aChannel,
+                                           nsIStreamListener* aListener);
 
 /** Given the first (disposition) token from a Content-Disposition header,
  * tell whether it indicates the content is inline or attachment
  * @param aDispToken the disposition token from the content-disposition header
  */
-uint32_t NS_GetContentDispositionFromToken(const nsAString &aDispToken);
+uint32_t NS_GetContentDispositionFromToken(const nsAString& aDispToken);
 
 /** Determine the disposition (inline/attachment) of the content based on the
  * Content-Disposition header
  * @param aHeader the content-disposition header (full value)
  * @param aChan the channel the header came from
  */
-uint32_t NS_GetContentDispositionFromHeader(const nsACString &aHeader,
-                                            nsIChannel *aChan = nullptr);
+uint32_t NS_GetContentDispositionFromHeader(const nsACString& aHeader,
+                                            nsIChannel* aChan = nullptr);
 
 /** Extracts the filename out of a content-disposition header
  * @param aFilename [out] The filename. Can be empty on error.
@@ -850,9 +850,9 @@ uint32_t NS_GetContentDispositionFromHeader(const nsACString &aHeader,
  * @param aURI Optional. Will be used to get a fallback charset for the
  *        filename, if it is QI'able to nsIURL
  */
-nsresult NS_GetFilenameFromDisposition(nsAString &aFilename,
-                                       const nsACString &aDisposition,
-                                       nsIURI *aURI = nullptr);
+nsresult NS_GetFilenameFromDisposition(nsAString& aFilename,
+                                       const nsACString& aDisposition,
+                                       nsIURI* aURI = nullptr);
 
 /**
  * Make sure Personal Security Manager is initialized
@@ -862,10 +862,10 @@ void net_EnsurePSMInit();
 /**
  * Test whether a URI is "about:blank".  |uri| must not be null
  */
-bool NS_IsAboutBlank(nsIURI *uri);
+bool NS_IsAboutBlank(nsIURI* uri);
 
-nsresult NS_GenerateHostPort(const nsCString &host, int32_t port,
-                             nsACString &hostLine);
+nsresult NS_GenerateHostPort(const nsCString& host, int32_t port,
+                             nsACString& hostLine);
 
 /**
  * Sniff the content type for a given request or a given buffer.
@@ -875,16 +875,16 @@ nsresult NS_GenerateHostPort(const nsCString &host, int32_t port,
  * in the aSniffedType argument.  This argument will not be modified if the
  * content type could not be sniffed.
  */
-void NS_SniffContent(const char *aSnifferType, nsIRequest *aRequest,
-                     const uint8_t *aData, uint32_t aLength,
-                     nsACString &aSniffedType);
+void NS_SniffContent(const char* aSnifferType, nsIRequest* aRequest,
+                     const uint8_t* aData, uint32_t aLength,
+                     nsACString& aSniffedType);
 
 /**
  * Whether the channel was created to load a srcdoc document.
  * Note that view-source:about:srcdoc is classified as a srcdoc document by
  * this function, which may not be applicable everywhere.
  */
-bool NS_IsSrcdocChannel(nsIChannel *aChannel);
+bool NS_IsSrcdocChannel(nsIChannel* aChannel);
 
 /**
  * Return true if the given string is a reasonable HTTP header value given the
@@ -892,18 +892,18 @@ bool NS_IsSrcdocChannel(nsIChannel *aChannel);
  * full, sctrict validation here since it would require fulling parsing the
  * value.
  */
-bool NS_IsReasonableHTTPHeaderValue(const nsACString &aValue);
+bool NS_IsReasonableHTTPHeaderValue(const nsACString& aValue);
 
 /**
  * Return true if the given string is a valid HTTP token per RFC 2616 section
  * 2.2.
  */
-bool NS_IsValidHTTPToken(const nsACString &aToken);
+bool NS_IsValidHTTPToken(const nsACString& aToken);
 
 /**
  * Strip the leading or trailing HTTP whitespace per fetch spec section 2.2.
  */
-void NS_TrimHTTPWhitespace(const nsACString &aSource, nsACString &aDest);
+void NS_TrimHTTPWhitespace(const nsACString& aSource, nsACString& aDest);
 
 /**
  * Return true if the given request must be upgraded to HTTPS.
@@ -913,17 +913,17 @@ void NS_TrimHTTPWhitespace(const nsACString &aSource, nsACString &aDest);
  * |aWillCallback| is false.
  */
 nsresult NS_ShouldSecureUpgrade(
-    nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIPrincipal *aChannelResultPrincipal,
+    nsIURI* aURI, nsILoadInfo* aLoadInfo, nsIPrincipal* aChannelResultPrincipal,
     bool aPrivateBrowsing, bool aAllowSTS,
-    const mozilla::OriginAttributes &aOriginAttributes, bool &aShouldUpgrade,
-    std::function &&aResultCallback, bool &aWillCallback);
+    const mozilla::OriginAttributes& aOriginAttributes, bool& aShouldUpgrade,
+    std::function&& aResultCallback, bool& aWillCallback);
 
 /**
  * Returns an https URI for channels that need to go through secure upgrades.
  */
-nsresult NS_GetSecureUpgradedURI(nsIURI *aURI, nsIURI **aUpgradedURI);
+nsresult NS_GetSecureUpgradedURI(nsIURI* aURI, nsIURI** aUpgradedURI);
 
-nsresult NS_CompareLoadInfoAndLoadContext(nsIChannel *aChannel);
+nsresult NS_CompareLoadInfoAndLoadContext(nsIChannel* aChannel);
 
 /**
  * Return default referrer policy which is controlled by user
@@ -935,14 +935,14 @@ nsresult NS_CompareLoadInfoAndLoadContext(nsIChannel *aChannel);
  * network.http.referer.defaultPolicy.trackers.pbmode for third-party trackers
  * in private mode
  */
-uint32_t NS_GetDefaultReferrerPolicy(nsIHttpChannel *aChannel = nullptr,
-                                     nsIURI *aURI = nullptr,
+uint32_t NS_GetDefaultReferrerPolicy(nsIHttpChannel* aChannel = nullptr,
+                                     nsIURI* aURI = nullptr,
                                      bool privateBrowsing = false);
 
 /**
  * Return true if this channel should be classified by the URL classifier.
  */
-bool NS_ShouldClassifyChannel(nsIChannel *aChannel);
+bool NS_ShouldClassifyChannel(nsIChannel* aChannel);
 
 /**
  * Helper to set the blocking reason on loadinfo of the channel.
@@ -978,25 +978,25 @@ bool InScriptableRange(uint64_t val);
  *                           returns the first (possibly) _unnamed_ 'parameter'.
  * @return the value of aParamName in Unichar(UTF-16).
  */
-nsresult GetParameterHTTP(const nsACString &aHeaderVal, const char *aParamName,
-                          nsAString &aResult);
+nsresult GetParameterHTTP(const nsACString& aHeaderVal, const char* aParamName,
+                          nsAString& aResult);
 
 /**
  * Convenience functions for verifying nsIURI schemes. These functions simply
  * wrap aURI->SchemeIs(), but specify the protocol as part of the function name.
  */
 
-bool SchemeIsHTTP(nsIURI *aURI);
-bool SchemeIsHTTPS(nsIURI *aURI);
-bool SchemeIsJavascript(nsIURI *aURI);
-bool SchemeIsChrome(nsIURI *aURI);
-bool SchemeIsAbout(nsIURI *aURI);
-bool SchemeIsBlob(nsIURI *aURI);
-bool SchemeIsFile(nsIURI *aURI);
-bool SchemeIsData(nsIURI *aURI);
-bool SchemeIsViewSource(nsIURI *aURI);
-bool SchemeIsResource(nsIURI *aURI);
-bool SchemeIsFTP(nsIURI *aURI);
+bool SchemeIsHTTP(nsIURI* aURI);
+bool SchemeIsHTTPS(nsIURI* aURI);
+bool SchemeIsJavascript(nsIURI* aURI);
+bool SchemeIsChrome(nsIURI* aURI);
+bool SchemeIsAbout(nsIURI* aURI);
+bool SchemeIsBlob(nsIURI* aURI);
+bool SchemeIsFile(nsIURI* aURI);
+bool SchemeIsData(nsIURI* aURI);
+bool SchemeIsViewSource(nsIURI* aURI);
+bool SchemeIsResource(nsIURI* aURI);
+bool SchemeIsFTP(nsIURI* aURI);
 }  // namespace net
 }  // namespace mozilla
 
diff --git a/netwerk/base/nsPACMan.cpp b/netwerk/base/nsPACMan.cpp
index e8b9c394e7367..be95029323292 100644
--- a/netwerk/base/nsPACMan.cpp
+++ b/netwerk/base/nsPACMan.cpp
@@ -40,7 +40,7 @@ LazyLogModule gProxyLog("proxy");
 
 // Check to see if the underlying request was not an error page in the case of
 // a HTTP request.  For other types of channels, just return true.
-static bool HttpRequestSucceeded(nsIStreamLoader *loader) {
+static bool HttpRequestSucceeded(nsIStreamLoader* loader) {
   nsCOMPtr request;
   loader->GetRequest(getter_AddRefs(request));
 
@@ -81,7 +81,7 @@ static uint32_t GetExtraJSContextHeapSize() {
 
 // Read network proxy type from preference
 // Used to verify that the preference is WPAD in nsPACMan::ConfigureWPAD
-nsresult GetNetworkProxyTypeFromPref(int32_t *type) {
+nsresult GetNetworkProxyTypeFromPref(int32_t* type) {
   *type = 0;
   nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
 
@@ -106,14 +106,14 @@ nsresult GetNetworkProxyTypeFromPref(int32_t *type) {
 
 class ExecuteCallback final : public Runnable {
  public:
-  ExecuteCallback(nsPACManCallback *aCallback, nsresult status)
+  ExecuteCallback(nsPACManCallback* aCallback, nsresult status)
       : Runnable("net::ExecuteCallback"),
         mCallback(aCallback),
         mStatus(status) {}
 
-  void SetPACString(const nsACString &pacString) { mPACString = pacString; }
+  void SetPACString(const nsACString& pacString) { mPACString = pacString; }
 
-  void SetPACURL(const nsACString &pacURL) { mPACURL = pacURL; }
+  void SetPACURL(const nsACString& pacURL) { mPACURL = pacURL; }
 
   NS_IMETHOD Run() override {
     mCallback->OnQueryComplete(mStatus, mPACString, mPACURL);
@@ -136,7 +136,7 @@ class ExecuteCallback final : public Runnable {
 
 class ShutdownThread final : public Runnable {
  public:
-  explicit ShutdownThread(nsIThread *thread)
+  explicit ShutdownThread(nsIThread* thread)
       : Runnable("net::ShutdownThread"), mThread(thread) {}
 
   NS_IMETHOD Run() override {
@@ -153,7 +153,7 @@ class ShutdownThread final : public Runnable {
 
 class WaitForThreadShutdown final : public Runnable {
  public:
-  explicit WaitForThreadShutdown(nsPACMan *aPACMan)
+  explicit WaitForThreadShutdown(nsPACMan* aPACMan)
       : Runnable("net::WaitForThreadShutdown"), mPACMan(aPACMan) {}
 
   NS_IMETHOD Run() override {
@@ -177,7 +177,7 @@ class WaitForThreadShutdown final : public Runnable {
 
 class PACLoadComplete final : public Runnable {
  public:
-  explicit PACLoadComplete(nsPACMan *aPACMan)
+  explicit PACLoadComplete(nsPACMan* aPACMan)
       : Runnable("net::PACLoadComplete"), mPACMan(aPACMan) {}
 
   NS_IMETHOD Run() override {
@@ -197,7 +197,7 @@ class PACLoadComplete final : public Runnable {
 // the URL for the PAC file has been found
 class ConfigureWPADComplete final : public Runnable {
  public:
-  ConfigureWPADComplete(nsPACMan *aPACMan, const nsACString &aPACURISpec)
+  ConfigureWPADComplete(nsPACMan* aPACMan, const nsACString& aPACURISpec)
       : Runnable("net::ConfigureWPADComplete"),
         mPACMan(aPACMan),
         mPACURISpec(aPACURISpec) {}
@@ -224,7 +224,7 @@ class ConfigureWPADComplete final : public Runnable {
 class ExecutePACThreadAction final : public Runnable {
  public:
   // by default we just process the queue
-  explicit ExecutePACThreadAction(nsPACMan *aPACMan)
+  explicit ExecutePACThreadAction(nsPACMan* aPACMan)
       : Runnable("net::ExecutePACThreadAction"),
         mPACMan(aPACMan),
         mCancel(false),
@@ -240,7 +240,7 @@ class ExecutePACThreadAction final : public Runnable {
     mShutdown = aShutdown;
   }
 
-  void SetupPAC(const char *data, uint32_t dataLen, const nsACString &pacURI,
+  void SetupPAC(const char* data, uint32_t dataLen, const nsACString& pacURI,
                 uint32_t extraHeapSize) {
     mSetupPAC = true;
     mSetupPACData.Assign(data, dataLen);
@@ -300,8 +300,8 @@ class ExecutePACThreadAction final : public Runnable {
 
 //-----------------------------------------------------------------------------
 
-PendingPACQuery::PendingPACQuery(nsPACMan *pacMan, nsIURI *uri,
-                                 nsPACManCallback *callback,
+PendingPACQuery::PendingPACQuery(nsPACMan* pacMan, nsIURI* uri,
+                                 nsPACManCallback* callback,
                                  bool mainThreadResponse)
     : Runnable("net::PendingPACQuery"),
       mPort(0),
@@ -314,7 +314,7 @@ PendingPACQuery::PendingPACQuery(nsPACMan *pacMan, nsIURI *uri,
   uri->GetPort(&mPort);
 }
 
-void PendingPACQuery::Complete(nsresult status, const nsACString &pacString) {
+void PendingPACQuery::Complete(nsresult status, const nsACString& pacString) {
   if (!mCallback) return;
   RefPtr runnable = new ExecuteCallback(mCallback, status);
   runnable->SetPACString(pacString);
@@ -324,7 +324,7 @@ void PendingPACQuery::Complete(nsresult status, const nsACString &pacString) {
     runnable->Run();
 }
 
-void PendingPACQuery::UseAlternatePACFile(const nsACString &pacURL) {
+void PendingPACQuery::UseAlternatePACFile(const nsACString& pacURL) {
   if (!mCallback) return;
 
   RefPtr runnable = new ExecuteCallback(mCallback, NS_OK);
@@ -347,10 +347,10 @@ PendingPACQuery::Run() {
 static bool sThreadLocalSetup = false;
 static uint32_t sThreadLocalIndex = 0xdeadbeef;  // out of range
 
-static const char *kPACIncludePath =
+static const char* kPACIncludePath =
     "network.proxy.autoconfig_url.include_path";
 
-nsPACMan::nsPACMan(nsIEventTarget *mainThreadEventTarget)
+nsPACMan::nsPACMan(nsIEventTarget* mainThreadEventTarget)
     : NeckoTargetHolder(mainThreadEventTarget),
       mLoadPending(false),
       mShutdown(false),
@@ -427,7 +427,7 @@ nsresult nsPACMan::DispatchToPAC(already_AddRefed aEvent,
       aSync ? nsIEventTarget::DISPATCH_SYNC : nsIEventTarget::DISPATCH_NORMAL);
 }
 
-nsresult nsPACMan::AsyncGetProxyForURI(nsIURI *uri, nsPACManCallback *callback,
+nsresult nsPACMan::AsyncGetProxyForURI(nsIURI* uri, nsPACManCallback* callback,
                                        bool mainThreadResponse) {
   MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
   if (mShutdown) return NS_ERROR_NOT_AVAILABLE;
@@ -452,7 +452,7 @@ nsresult nsPACMan::AsyncGetProxyForURI(nsIURI *uri, nsPACManCallback *callback,
   return DispatchToPAC(query.forget());
 }
 
-nsresult nsPACMan::PostQuery(PendingPACQuery *query) {
+nsresult nsPACMan::PostQuery(PendingPACQuery* query) {
   MOZ_ASSERT(!NS_IsMainThread(), "wrong thread");
 
   if (mShutdown) {
@@ -467,11 +467,11 @@ nsresult nsPACMan::PostQuery(PendingPACQuery *query) {
   return NS_OK;
 }
 
-nsresult nsPACMan::LoadPACFromURI(const nsACString &aSpec) {
+nsresult nsPACMan::LoadPACFromURI(const nsACString& aSpec) {
   return LoadPACFromURI(aSpec, true);
 }
 
-nsresult nsPACMan::LoadPACFromURI(const nsACString &aSpec,
+nsresult nsPACMan::LoadPACFromURI(const nsACString& aSpec,
                                   bool aResetLoadFailureCount) {
   NS_ENSURE_STATE(!mShutdown);
 
@@ -530,7 +530,7 @@ nsresult nsPACMan::LoadPACFromURI(const nsACString &aSpec,
   return NS_OK;
 }
 
-nsresult nsPACMan::GetPACFromDHCP(nsACString &aSpec) {
+nsresult nsPACMan::GetPACFromDHCP(nsACString& aSpec) {
   MOZ_ASSERT(!NS_IsMainThread(), "wrong thread");
   if (!mDHCPClient) {
     LOG(
@@ -554,7 +554,7 @@ nsresult nsPACMan::GetPACFromDHCP(nsACString &aSpec) {
   return rv;
 }
 
-nsresult nsPACMan::ConfigureWPAD(nsACString &aSpec) {
+nsresult nsPACMan::ConfigureWPAD(nsACString& aSpec) {
   MOZ_ASSERT(!NS_IsMainThread(), "wrong thread");
 
   if (mProxyConfigType != nsIProtocolProxyService::PROXYCONFIG_WPAD) {
@@ -581,7 +581,7 @@ nsresult nsPACMan::ConfigureWPAD(nsACString &aSpec) {
   return NS_OK;
 }
 
-void nsPACMan::AssignPACURISpec(const nsACString &aSpec) {
+void nsPACMan::AssignPACURISpec(const nsACString& aSpec) {
   MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
   mPACURISpec.Assign(aSpec);
 }
@@ -787,9 +787,9 @@ NS_IMPL_ISUPPORTS(nsPACMan, nsIStreamLoaderObserver, nsIInterfaceRequestor,
                   nsIChannelEventSink)
 
 NS_IMETHODIMP
-nsPACMan::OnStreamComplete(nsIStreamLoader *loader, nsISupports *context,
+nsPACMan::OnStreamComplete(nsIStreamLoader* loader, nsISupports* context,
                            nsresult status, uint32_t dataLen,
-                           const uint8_t *data) {
+                           const uint8_t* data) {
   MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
   if (mLoader != loader) {
     // If this happens, then it means that LoadPACFromURI was called more
@@ -821,7 +821,7 @@ nsPACMan::OnStreamComplete(nsIStreamLoader *loader, nsISupports *context,
     // the PAC evaluator (NS_PROXYAUTOCONFIG_CONTRACTID) on the PAC thread,
     // because that's where it will be used.
     RefPtr pending = new ExecutePACThreadAction(this);
-    pending->SetupPAC(reinterpret_cast(data), dataLen, pacURI,
+    pending->SetupPAC(reinterpret_cast(data), dataLen, pacURI,
                       GetExtraJSContextHeapSize());
     DispatchToPAC(pending.forget());
 
@@ -846,20 +846,19 @@ nsPACMan::OnStreamComplete(nsIStreamLoader *loader, nsISupports *context,
 }
 
 NS_IMETHODIMP
-nsPACMan::GetInterface(const nsIID &iid, void **result) {
+nsPACMan::GetInterface(const nsIID& iid, void** result) {
   // In case loading the PAC file requires authentication.
   if (iid.Equals(NS_GET_IID(nsIAuthPrompt))) {
     nsCOMPtr promptFac =
         do_GetService("@mozilla.org/prompter;1");
     NS_ENSURE_TRUE(promptFac, NS_ERROR_FAILURE);
-    return promptFac->GetPrompt(nullptr, iid,
-                                reinterpret_cast(result));
+    return promptFac->GetPrompt(nullptr, iid, reinterpret_cast(result));
   }
 
   // In case loading the PAC file results in a redirect.
   if (iid.Equals(NS_GET_IID(nsIChannelEventSink))) {
     NS_ADDREF_THIS();
-    *result = static_cast(this);
+    *result = static_cast(this);
     return NS_OK;
   }
 
@@ -867,9 +866,9 @@ nsPACMan::GetInterface(const nsIID &iid, void **result) {
 }
 
 NS_IMETHODIMP
-nsPACMan::AsyncOnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel,
+nsPACMan::AsyncOnChannelRedirect(nsIChannel* oldChannel, nsIChannel* newChannel,
                                  uint32_t flags,
-                                 nsIAsyncVerifyRedirectCallback *callback) {
+                                 nsIAsyncVerifyRedirectCallback* callback) {
   MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
 
   nsresult rv = NS_OK;
@@ -892,7 +891,7 @@ nsPACMan::AsyncOnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel,
   return NS_OK;
 }
 
-nsresult nsPACMan::Init(nsISystemProxySettings *systemProxySettings) {
+nsresult nsPACMan::Init(nsISystemProxySettings* systemProxySettings) {
   mSystemProxySettings = systemProxySettings;
   mDHCPClient = do_GetService(NS_DHCPCLIENT_CONTRACTID);
   return NS_OK;
diff --git a/netwerk/base/nsPACMan.h b/netwerk/base/nsPACMan.h
index 704f105b7f8d9..a6125159c0226 100644
--- a/netwerk/base/nsPACMan.h
+++ b/netwerk/base/nsPACMan.h
@@ -51,19 +51,19 @@ class NS_NO_VTABLE nsPACManCallback : public nsISupports {
    *        before the query is evaluated again. At least one of pacString and
    *        newPACURL should be 0 length.
    */
-  virtual void OnQueryComplete(nsresult status, const nsACString &pacString,
-                               const nsACString &newPACURL) = 0;
+  virtual void OnQueryComplete(nsresult status, const nsACString& pacString,
+                               const nsACString& newPACURL) = 0;
 };
 
 class PendingPACQuery final : public Runnable,
                               public LinkedListElement {
  public:
-  PendingPACQuery(nsPACMan *pacMan, nsIURI *uri, nsPACManCallback *callback,
+  PendingPACQuery(nsPACMan* pacMan, nsIURI* uri, nsPACManCallback* callback,
                   bool mainThreadResponse);
 
   // can be called from either thread
-  void Complete(nsresult status, const nsACString &pacString);
-  void UseAlternatePACFile(const nsACString &pacURL);
+  void Complete(nsresult status, const nsACString& pacString);
+  void UseAlternatePACFile(const nsACString& pacURL);
 
   nsCString mSpec;
   nsCString mScheme;
@@ -73,7 +73,7 @@ class PendingPACQuery final : public Runnable,
   NS_IMETHOD Run(void) override; /* Runnable */
 
  private:
-  nsPACMan *mPACMan;  // weak reference
+  nsPACMan* mPACMan;  // weak reference
 
  private:
   RefPtr mCallback;
@@ -92,7 +92,7 @@ class nsPACMan final : public nsIStreamLoaderObserver,
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  explicit nsPACMan(nsIEventTarget *mainThreadEventTarget);
+  explicit nsPACMan(nsIEventTarget* mainThreadEventTarget);
 
   /**
    * This method may be called to shutdown the PAC manager.  Any async queries
@@ -114,7 +114,7 @@ class nsPACMan final : public nsIStreamLoaderObserver,
    * @param mustCallbackOnMainThread
    *        If set to false the callback can be made from the PAC thread
    */
-  nsresult AsyncGetProxyForURI(nsIURI *uri, nsPACManCallback *callback,
+  nsresult AsyncGetProxyForURI(nsIURI* uri, nsPACManCallback* callback,
                                bool mustCallbackOnMainThread);
 
   /**
@@ -126,7 +126,7 @@ class nsPACMan final : public nsIStreamLoaderObserver,
    *        The non normalized uri spec of this URI used for comparison with
    *        system proxy settings to determine if the PAC uri has changed.
    */
-  nsresult LoadPACFromURI(const nsACString &aSpec);
+  nsresult LoadPACFromURI(const nsACString& aSpec);
 
   /**
    * Returns true if we are currently loading the PAC file.
@@ -141,12 +141,12 @@ class nsPACMan final : public nsIStreamLoaderObserver,
    * should bypass the proxy (to fetch the pac file) or if the pac
    * configuration has changed (and we should reload the pac file)
    */
-  bool IsPACURI(const nsACString &spec) {
+  bool IsPACURI(const nsACString& spec) {
     return mPACURISpec.Equals(spec) || mPACURIRedirectSpec.Equals(spec) ||
            mNormalPACURISpec.Equals(spec);
   }
 
-  bool IsPACURI(nsIURI *uri) {
+  bool IsPACURI(nsIURI* uri) {
     if (mPACURISpec.IsEmpty() && mPACURIRedirectSpec.IsEmpty()) {
       return false;
     }
@@ -162,8 +162,8 @@ class nsPACMan final : public nsIStreamLoaderObserver,
 
   bool IsUsingWPAD() { return mAutoDetect; }
 
-  nsresult Init(nsISystemProxySettings *);
-  static nsPACMan *sInstance;
+  nsresult Init(nsISystemProxySettings*);
+  static nsPACMan* sInstance;
 
   // PAC thread operations only
   void ProcessPendingQ();
@@ -212,7 +212,7 @@ class nsPACMan final : public nsIStreamLoaderObserver,
    *        A flag saying whether the exponential back-off for attempting to
    * reload the PAC should be reset.
    */
-  nsresult LoadPACFromURI(const nsACString &aSpec, bool aResetLoadFailureCount);
+  nsresult LoadPACFromURI(const nsACString& aSpec, bool aResetLoadFailureCount);
 
   /**
    * Reload the PAC file if there is reason to.
@@ -229,18 +229,18 @@ class nsPACMan final : public nsIStreamLoaderObserver,
    * place a pendingPACQuery into the queue and potentially
    * execute the queue if it was otherwise empty
    */
-  nsresult PostQuery(PendingPACQuery *query);
+  nsresult PostQuery(PendingPACQuery* query);
 
   // Having found the PAC URI on the PAC thread, copy it to a string which
   // can be altered on the main thread.
-  void AssignPACURISpec(const nsACString &aSpec);
+  void AssignPACURISpec(const nsACString& aSpec);
 
   // PAC thread operations only
   void PostProcessPendingQ();
   void PostCancelPendingQ(nsresult, bool aShutdown = false);
   bool ProcessPending();
-  nsresult GetPACFromDHCP(nsACString &aSpec);
-  nsresult ConfigureWPAD(nsACString &aSpec);
+  nsresult GetPACFromDHCP(nsACString& aSpec);
+  nsresult ConfigureWPAD(nsACString& aSpec);
 
  private:
   /**
diff --git a/netwerk/base/nsPreloadedStream.cpp b/netwerk/base/nsPreloadedStream.cpp
index 233d9fd865261..4effa08066ad3 100644
--- a/netwerk/base/nsPreloadedStream.cpp
+++ b/netwerk/base/nsPreloadedStream.cpp
@@ -14,10 +14,10 @@ namespace net {
 
 NS_IMPL_ISUPPORTS(nsPreloadedStream, nsIInputStream, nsIAsyncInputStream)
 
-nsPreloadedStream::nsPreloadedStream(nsIAsyncInputStream *aStream,
-                                     const char *data, uint32_t datalen)
+nsPreloadedStream::nsPreloadedStream(nsIAsyncInputStream* aStream,
+                                     const char* data, uint32_t datalen)
     : mStream(aStream), mOffset(0), mLen(datalen) {
-  mBuf = (char *)moz_xmalloc(datalen);
+  mBuf = (char*)moz_xmalloc(datalen);
   memcpy(mBuf, data, datalen);
 }
 
@@ -30,7 +30,7 @@ nsPreloadedStream::Close() {
 }
 
 NS_IMETHODIMP
-nsPreloadedStream::Available(uint64_t *_retval) {
+nsPreloadedStream::Available(uint64_t* _retval) {
   uint64_t avail = 0;
 
   nsresult rv = mStream->Available(&avail);
@@ -40,7 +40,7 @@ nsPreloadedStream::Available(uint64_t *_retval) {
 }
 
 NS_IMETHODIMP
-nsPreloadedStream::Read(char *aBuf, uint32_t aCount, uint32_t *_retval) {
+nsPreloadedStream::Read(char* aBuf, uint32_t aCount, uint32_t* _retval) {
   if (!mLen) return mStream->Read(aBuf, aCount, _retval);
 
   uint32_t toRead = std::min(mLen, aCount);
@@ -52,8 +52,8 @@ nsPreloadedStream::Read(char *aBuf, uint32_t aCount, uint32_t *_retval) {
 }
 
 NS_IMETHODIMP
-nsPreloadedStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure,
-                                uint32_t aCount, uint32_t *result) {
+nsPreloadedStream::ReadSegments(nsWriteSegmentFun aWriter, void* aClosure,
+                                uint32_t aCount, uint32_t* result) {
   if (!mLen) return mStream->ReadSegments(aWriter, aClosure, aCount, result);
 
   *result = 0;
@@ -76,7 +76,7 @@ nsPreloadedStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure,
 }
 
 NS_IMETHODIMP
-nsPreloadedStream::IsNonBlocking(bool *_retval) {
+nsPreloadedStream::IsNonBlocking(bool* _retval) {
   return mStream->IsNonBlocking(_retval);
 }
 
@@ -88,7 +88,7 @@ nsPreloadedStream::CloseWithStatus(nsresult aStatus) {
 
 class RunOnThread : public Runnable {
  public:
-  RunOnThread(nsIAsyncInputStream *aStream, nsIInputStreamCallback *aCallback)
+  RunOnThread(nsIAsyncInputStream* aStream, nsIInputStreamCallback* aCallback)
       : Runnable("net::RunOnThread"), mStream(aStream), mCallback(aCallback) {}
 
   virtual ~RunOnThread() = default;
@@ -104,9 +104,9 @@ class RunOnThread : public Runnable {
 };
 
 NS_IMETHODIMP
-nsPreloadedStream::AsyncWait(nsIInputStreamCallback *aCallback, uint32_t aFlags,
+nsPreloadedStream::AsyncWait(nsIInputStreamCallback* aCallback, uint32_t aFlags,
                              uint32_t aRequestedCount,
-                             nsIEventTarget *aEventTarget) {
+                             nsIEventTarget* aEventTarget) {
   if (!mLen)
     return mStream->AsyncWait(aCallback, aFlags, aRequestedCount, aEventTarget);
 
diff --git a/netwerk/base/nsPreloadedStream.h b/netwerk/base/nsPreloadedStream.h
index 95343ad8c797d..368cfbbe1eec4 100644
--- a/netwerk/base/nsPreloadedStream.h
+++ b/netwerk/base/nsPreloadedStream.h
@@ -33,7 +33,7 @@ class nsPreloadedStream final : public nsIAsyncInputStream {
   NS_DECL_NSIINPUTSTREAM
   NS_DECL_NSIASYNCINPUTSTREAM
 
-  nsPreloadedStream(nsIAsyncInputStream *aStream, const char *data,
+  nsPreloadedStream(nsIAsyncInputStream* aStream, const char* data,
                     uint32_t datalen);
 
  private:
@@ -41,7 +41,7 @@ class nsPreloadedStream final : public nsIAsyncInputStream {
 
   nsCOMPtr mStream;
 
-  char *mBuf;
+  char* mBuf;
   uint32_t mOffset;
   uint32_t mLen;
 };
diff --git a/netwerk/base/nsProtocolProxyService.cpp b/netwerk/base/nsProtocolProxyService.cpp
index d66645c020a31..abd537bfff0fd 100644
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -75,7 +75,7 @@ struct nsProtocolInfo {
 
 // Return the channel's proxy URI, or if it doesn't exist, the
 // channel's main URI.
-static nsresult GetProxyURI(nsIChannel *channel, nsIURI **aOut) {
+static nsresult GetProxyURI(nsIChannel* channel, nsIURI** aOut) {
   nsresult rv = NS_OK;
   nsCOMPtr proxyURI;
   nsCOMPtr httpChannel(do_QueryInterface(channel));
@@ -95,13 +95,13 @@ static nsresult GetProxyURI(nsIChannel *channel, nsIURI **aOut) {
 //-----------------------------------------------------------------------------
 
 nsProtocolProxyService::FilterLink::FilterLink(uint32_t p,
-                                               nsIProtocolProxyFilter *f)
+                                               nsIProtocolProxyFilter* f)
     : position(p), filter(f), channelFilter(nullptr) {
   LOG(("nsProtocolProxyService::FilterLink::FilterLink %p, filter=%p", this,
        f));
 }
 nsProtocolProxyService::FilterLink::FilterLink(
-    uint32_t p, nsIProtocolProxyChannelFilter *cf)
+    uint32_t p, nsIProtocolProxyChannelFilter* cf)
     : position(p), filter(nullptr), channelFilter(cf) {
   LOG(("nsProtocolProxyService::FilterLink::FilterLink %p, channel-filter=%p",
        this, cf));
@@ -122,9 +122,9 @@ class nsAsyncResolveRequest final : public nsIRunnable,
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  nsAsyncResolveRequest(nsProtocolProxyService *pps, nsIChannel *channel,
+  nsAsyncResolveRequest(nsProtocolProxyService* pps, nsIChannel* channel,
                         uint32_t aResolveFlags,
-                        nsIProtocolProxyCallback *callback)
+                        nsIProtocolProxyCallback* callback)
       : mStatus(NS_OK),
         mDispatched(false),
         mResolveFlags(aResolveFlags),
@@ -178,12 +178,11 @@ class nsAsyncResolveRequest final : public nsIRunnable,
     NS_DECL_NSIRUNNABLE
     NS_DECL_NSICANCELABLE
 
-    typedef std::function
+    typedef std::function
         Callback;
 
-    explicit AsyncApplyFilters(nsProtocolInfo &aInfo,
-                               Callback const &aCallback);
+    explicit AsyncApplyFilters(nsProtocolInfo& aInfo,
+                               Callback const& aCallback);
     // This method starts the processing or filters.  If all of them
     // answer synchronously (call back from within applyFilters) this method
     // will return immediately and the returning result will carry return
@@ -192,7 +191,7 @@ class nsAsyncResolveRequest final : public nsIRunnable,
     // locally) as long as an answer from a filter is obtained synchronously.
     // Note that filters are processed serially to let them build a list
     // of proxy info.
-    nsresult AsyncProcess(nsAsyncResolveRequest *aRequest);
+    nsresult AsyncProcess(nsAsyncResolveRequest* aRequest);
 
    private:
     typedef nsProtocolProxyService::FilterLink FilterLink;
@@ -232,12 +231,12 @@ class nsAsyncResolveRequest final : public nsIRunnable,
   };
 
  public:
-  nsresult ProcessLocally(nsProtocolInfo &info, nsIProxyInfo *pi,
+  nsresult ProcessLocally(nsProtocolInfo& info, nsIProxyInfo* pi,
                           bool isSyncOK) {
     SetResult(NS_OK, pi);
 
-    auto consumeFiltersResult = [isSyncOK](nsAsyncResolveRequest *ctx,
-                                           nsIProxyInfo *pi,
+    auto consumeFiltersResult = [isSyncOK](nsAsyncResolveRequest* ctx,
+                                           nsIProxyInfo* pi,
                                            bool aCalledAsync) -> nsresult {
       ctx->SetResult(NS_OK, pi);
       if (isSyncOK || aCalledAsync) {
@@ -253,7 +252,7 @@ class nsAsyncResolveRequest final : public nsIRunnable,
     return mAsyncFilterApplier->AsyncProcess(this);
   }
 
-  void SetResult(nsresult status, nsIProxyInfo *pi) {
+  void SetResult(nsresult status, nsIProxyInfo* pi) {
     mStatus = status;
     mProxyInfo = pi;
   }
@@ -296,8 +295,8 @@ class nsAsyncResolveRequest final : public nsIRunnable,
  private:
   // Called asynchronously, so we do not need to post another PLEvent
   // before calling DoCallback.
-  void OnQueryComplete(nsresult status, const nsACString &pacString,
-                       const nsACString &newPACURL) override {
+  void OnQueryComplete(nsresult status, const nsACString& pacString,
+                       const nsACString& newPACURL) override {
     // If we've already called DoCallback then, nothing more to do.
     if (!mCallback) return;
 
@@ -338,8 +337,8 @@ class nsAsyncResolveRequest final : public nsIRunnable,
       nsProtocolInfo info;
       mStatus = mPPS->GetProtocolInfo(proxyURI, &info);
 
-      auto consumeFiltersResult = [pacAvailable](nsAsyncResolveRequest *self,
-                                                 nsIProxyInfo *pi,
+      auto consumeFiltersResult = [pacAvailable](nsAsyncResolveRequest* self,
+                                                 nsIProxyInfo* pi,
                                                  bool async) -> nsresult {
         LOG(("DoCallback::consumeFiltersResult this=%p, pi=%p, async=%d", self,
              pi, async));
@@ -413,7 +412,7 @@ class nsAsyncResolveRequest final : public nsIRunnable,
   bool mDispatched;
   uint32_t mResolveFlags;
 
-  nsProtocolProxyService *mPPS;
+  nsProtocolProxyService* mPPS;
   nsCOMPtr mXPComPPS;
   nsCOMPtr mChannel;
   nsCOMPtr mCallback;
@@ -428,7 +427,7 @@ NS_IMPL_ISUPPORTS(nsAsyncResolveRequest::AsyncApplyFilters,
                   nsIProxyProtocolFilterResult, nsICancelable, nsIRunnable)
 
 nsAsyncResolveRequest::AsyncApplyFilters::AsyncApplyFilters(
-    nsProtocolInfo &aInfo, Callback const &aCallback)
+    nsProtocolInfo& aInfo, Callback const& aCallback)
     : mInfo(aInfo),
       mCallback(aCallback),
       mNextFilterIndex(0),
@@ -446,7 +445,7 @@ nsAsyncResolveRequest::AsyncApplyFilters::~AsyncApplyFilters() {
 }
 
 nsresult nsAsyncResolveRequest::AsyncApplyFilters::AsyncProcess(
-    nsAsyncResolveRequest *aRequest) {
+    nsAsyncResolveRequest* aRequest) {
   LOG(("AsyncApplyFilters::AsyncProcess %p for req %p", this, aRequest));
 
   MOZ_ASSERT(!mRequest, "AsyncApplyFilters started more than once!");
@@ -522,7 +521,7 @@ nsresult nsAsyncResolveRequest::AsyncApplyFilters::ProcessNextFilter() {
 
 NS_IMETHODIMP
 nsAsyncResolveRequest::AsyncApplyFilters::OnProxyFilterResult(
-    nsIProxyInfo *aProxyInfo) {
+    nsIProxyInfo* aProxyInfo) {
   LOG(("AsyncApplyFilters::OnProxyFilterResult %p pi=%p", this, aProxyInfo));
 
   MOZ_ASSERT(mProcessingThread && mProcessingThread->IsOnCurrentThread());
@@ -612,11 +611,11 @@ class AsyncGetPACURIRequest final : public nsIRunnable {
 
   using CallbackFunc = nsresult (nsProtocolProxyService::*)(bool, bool,
                                                             nsresult,
-                                                            const nsACString &);
+                                                            const nsACString&);
 
-  AsyncGetPACURIRequest(nsProtocolProxyService *aService,
+  AsyncGetPACURIRequest(nsProtocolProxyService* aService,
                         CallbackFunc aCallback,
-                        nsISystemProxySettings *aSystemProxySettings,
+                        nsISystemProxySettings* aSystemProxySettings,
                         bool aMainThreadOnly, bool aForceReload,
                         bool aResetPACThread)
       : mIsMainThreadOnly(aMainThreadOnly),
@@ -652,7 +651,7 @@ class AsyncGetPACURIRequest final : public nsIRunnable {
 
   bool mIsMainThreadOnly;
 
-  nsProtocolProxyService *mService;  // ref-count is hold by mServiceHolder
+  nsProtocolProxyService* mService;  // ref-count is hold by mServiceHolder
   nsCOMPtr mServiceHolder;
   CallbackFunc mCallback;
   nsCOMPtr mSystemProxySettings;
@@ -670,7 +669,7 @@ NS_IMPL_ISUPPORTS(AsyncGetPACURIRequest, nsIRunnable)
 //
 // NOTE: we do the byte swapping here to minimize overall swapping.
 //
-static void proxy_MaskIPv6Addr(PRIPv6Addr &addr, uint16_t mask_len) {
+static void proxy_MaskIPv6Addr(PRIPv6Addr& addr, uint16_t mask_len) {
   if (mask_len == 128) return;
 
   if (mask_len > 96) {
@@ -694,8 +693,8 @@ static void proxy_MaskIPv6Addr(PRIPv6Addr &addr, uint16_t mask_len) {
   }
 }
 
-static void proxy_GetStringPref(nsIPrefBranch *aPrefBranch, const char *aPref,
-                                nsCString &aResult) {
+static void proxy_GetStringPref(nsIPrefBranch* aPrefBranch, const char* aPref,
+                                nsCString& aResult) {
   nsAutoCString temp;
   nsresult rv = aPrefBranch->GetCharPref(aPref, temp);
   if (NS_FAILED(rv))
@@ -708,8 +707,8 @@ static void proxy_GetStringPref(nsIPrefBranch *aPrefBranch, const char *aPref,
   }
 }
 
-static void proxy_GetIntPref(nsIPrefBranch *aPrefBranch, const char *aPref,
-                             int32_t &aResult) {
+static void proxy_GetIntPref(nsIPrefBranch* aPrefBranch, const char* aPref,
+                             int32_t& aResult) {
   int32_t temp;
   nsresult rv = aPrefBranch->GetIntPref(aPref, &temp);
   if (NS_FAILED(rv))
@@ -718,8 +717,8 @@ static void proxy_GetIntPref(nsIPrefBranch *aPrefBranch, const char *aPref,
     aResult = temp;
 }
 
-static void proxy_GetBoolPref(nsIPrefBranch *aPrefBranch, const char *aPref,
-                              bool &aResult) {
+static void proxy_GetBoolPref(nsIPrefBranch* aPrefBranch, const char* aPref,
+                              bool& aResult) {
   bool temp;
   nsresult rv = aPrefBranch->GetBoolPref(aPref, &temp);
   if (NS_FAILED(rv))
@@ -871,7 +870,7 @@ nsresult nsProtocolProxyService::AsyncConfigureFromPAC(bool aForceReload,
 nsresult nsProtocolProxyService::OnAsyncGetPACURI(bool aForceReload,
                                                   bool aResetPACThread,
                                                   nsresult aResult,
-                                                  const nsACString &aUri) {
+                                                  const nsACString& aUri) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (aResetPACThread) {
@@ -886,8 +885,8 @@ nsresult nsProtocolProxyService::OnAsyncGetPACURI(bool aForceReload,
 }
 
 NS_IMETHODIMP
-nsProtocolProxyService::Observe(nsISupports *aSubject, const char *aTopic,
-                                const char16_t *aData) {
+nsProtocolProxyService::Observe(nsISupports* aSubject, const char* aTopic,
+                                const char16_t* aData) {
   if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
     mIsShutdown = true;
     // cleanup
@@ -911,7 +910,7 @@ nsProtocolProxyService::Observe(nsISupports *aSubject, const char *aTopic,
 
   } else if (strcmp(aTopic, NS_NETWORK_LINK_TOPIC) == 0) {
     nsCString converted = NS_ConvertUTF16toUTF8(aData);
-    const char *state = converted.get();
+    const char* state = converted.get();
     if (!strcmp(state, NS_NETWORK_LINK_DATA_CHANGED)) {
       ReloadNetworkPAC();
     }
@@ -924,8 +923,8 @@ nsProtocolProxyService::Observe(nsISupports *aSubject, const char *aTopic,
   return NS_OK;
 }
 
-void nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch,
-                                          const char *pref) {
+void nsProtocolProxyService::PrefsChanged(nsIPrefBranch* prefBranch,
+                                          const char* pref) {
   nsresult rv = NS_OK;
   bool reloadPAC = false;
   nsAutoCString tempString;
@@ -1057,7 +1056,7 @@ void nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch,
   }
 }
 
-bool nsProtocolProxyService::CanUseProxy(nsIURI *aURI, int32_t defaultPort) {
+bool nsProtocolProxyService::CanUseProxy(nsIURI* aURI, int32_t defaultPort) {
   int32_t port;
   nsAutoCString host;
 
@@ -1097,7 +1096,7 @@ bool nsProtocolProxyService::CanUseProxy(nsIURI *aURI, int32_t defaultPort) {
 
   int32_t index = -1;
   while (++index < int32_t(mHostFiltersArray.Length())) {
-    HostInfo *hinfo = mHostFiltersArray[index];
+    HostInfo* hinfo = mHostFiltersArray[index];
 
     if (is_ipaddr != hinfo->is_ipaddr) continue;
     if (hinfo->port && hinfo->port != port) continue;
@@ -1119,7 +1118,7 @@ bool nsProtocolProxyService::CanUseProxy(nsIURI *aURI, int32_t defaultPort) {
         //
         // compare last |filter_host_len| bytes of target hostname.
         //
-        const char *host_tail = host.get() + host_len - filter_host_len;
+        const char* host_tail = host.get() + host_len - filter_host_len;
         if (!PL_strncasecmp(host_tail, hinfo->name.host, filter_host_len)) {
           // If the tail of the host string matches the filter
 
@@ -1165,24 +1164,24 @@ const char kProxyType_SOCKS4[] = "socks4";
 const char kProxyType_SOCKS5[] = "socks5";
 const char kProxyType_DIRECT[] = "direct";
 
-const char *nsProtocolProxyService::ExtractProxyInfo(const char *start,
+const char* nsProtocolProxyService::ExtractProxyInfo(const char* start,
                                                      uint32_t aResolveFlags,
-                                                     nsProxyInfo **result) {
+                                                     nsProxyInfo** result) {
   *result = nullptr;
   uint32_t flags = 0;
 
   // see BNF in ProxyAutoConfig.h and notes in nsISystemProxySettings.idl
 
   // find end of proxy info delimiter
-  const char *end = start;
+  const char* end = start;
   while (*end && *end != ';') ++end;
 
   // find end of proxy type delimiter
-  const char *sp = start;
+  const char* sp = start;
   while (sp < end && *sp != ' ' && *sp != '\t') ++sp;
 
   uint32_t len = sp - start;
-  const char *type = nullptr;
+  const char* type = nullptr;
   switch (len) {
     case 4:
       if (PL_strncasecmp(start, kProxyType_HTTP, 5) == 0) {
@@ -1232,7 +1231,7 @@ const char *nsProtocolProxyService::ExtractProxyInfo(const char *start,
       port = 1080;
     }
 
-    nsProxyInfo *pi = new nsProxyInfo();
+    nsProxyInfo* pi = new nsProxyInfo();
     pi->mType = type;
     pi->mFlags = flags;
     pi->mResolveFlags = aResolveFlags;
@@ -1279,7 +1278,7 @@ const char *nsProtocolProxyService::ExtractProxyInfo(const char *start,
   return end;
 }
 
-void nsProtocolProxyService::GetProxyKey(nsProxyInfo *pi, nsCString &key) {
+void nsProtocolProxyService::GetProxyKey(nsProxyInfo* pi, nsCString& key) {
   key.AssignASCII(pi->mType);
   if (!pi->mHost.IsEmpty()) {
     key.Append(' ');
@@ -1302,13 +1301,13 @@ uint32_t nsProtocolProxyService::SecondsSinceSessionStart() {
   return uint32_t(diff);
 }
 
-void nsProtocolProxyService::EnableProxy(nsProxyInfo *pi) {
+void nsProtocolProxyService::EnableProxy(nsProxyInfo* pi) {
   nsAutoCString key;
   GetProxyKey(pi, key);
   mFailedProxies.Remove(key);
 }
 
-void nsProtocolProxyService::DisableProxy(nsProxyInfo *pi) {
+void nsProtocolProxyService::DisableProxy(nsProxyInfo* pi) {
   nsAutoCString key;
   GetProxyKey(pi, key);
 
@@ -1333,7 +1332,7 @@ void nsProtocolProxyService::DisableProxy(nsProxyInfo *pi) {
   mFailedProxies.Put(key, dsec);
 }
 
-bool nsProtocolProxyService::IsProxyDisabled(nsProxyInfo *pi) {
+bool nsProtocolProxyService::IsProxyDisabled(nsProxyInfo* pi) {
   nsAutoCString key;
   GetProxyKey(pi, key);
 
@@ -1352,7 +1351,7 @@ bool nsProtocolProxyService::IsProxyDisabled(nsProxyInfo *pi) {
 }
 
 nsresult nsProtocolProxyService::SetupPACThread(
-    nsIEventTarget *mainThreadEventTarget) {
+    nsIEventTarget* mainThreadEventTarget) {
   if (mIsShutdown) {
     return NS_ERROR_FAILURE;
   }
@@ -1385,7 +1384,7 @@ nsresult nsProtocolProxyService::ResetPACThread() {
   return SetupPACThread();
 }
 
-nsresult nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec,
+nsresult nsProtocolProxyService::ConfigureFromPAC(const nsCString& spec,
                                                   bool forceReload) {
   nsresult rv = SetupPACThread();
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1402,15 +1401,15 @@ nsresult nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec,
   return mPACMan->LoadPACFromURI(spec);
 }
 
-void nsProtocolProxyService::ProcessPACString(const nsCString &pacString,
+void nsProtocolProxyService::ProcessPACString(const nsCString& pacString,
                                               uint32_t aResolveFlags,
-                                              nsIProxyInfo **result) {
+                                              nsIProxyInfo** result) {
   if (pacString.IsEmpty()) {
     *result = nullptr;
     return;
   }
 
-  const char *proxies = pacString.get();
+  const char* proxies = pacString.get();
 
   nsProxyInfo *pi = nullptr, *first = nullptr, *last = nullptr;
   while (*proxies) {
@@ -1473,8 +1472,8 @@ class nsAsyncBridgeRequest final : public nsPACManCallback {
         mStatus(NS_OK),
         mCompleted(false) {}
 
-  void OnQueryComplete(nsresult status, const nsACString &pacString,
-                       const nsACString &newPACURL) override {
+  void OnQueryComplete(nsresult status, const nsACString& pacString,
+                       const nsACString& newPACURL) override {
     MutexAutoLock lock(mMutex);
     mCompleted = true;
     mStatus = status;
@@ -1503,9 +1502,9 @@ class nsAsyncBridgeRequest final : public nsPACManCallback {
 NS_IMPL_ISUPPORTS0(nsAsyncBridgeRequest)
 
 nsresult nsProtocolProxyService::AsyncResolveInternal(
-    nsIChannel *channel, uint32_t flags, nsIProtocolProxyCallback *callback,
-    nsICancelable **result, bool isSyncOK,
-    nsIEventTarget *mainThreadEventTarget) {
+    nsIChannel* channel, uint32_t flags, nsIProtocolProxyCallback* callback,
+    nsICancelable** result, bool isSyncOK,
+    nsIEventTarget* mainThreadEventTarget) {
   NS_ENSURE_ARG_POINTER(channel);
   NS_ENSURE_ARG_POINTER(callback);
 
@@ -1565,19 +1564,19 @@ nsresult nsProtocolProxyService::AsyncResolveInternal(
 
 // nsIProtocolProxyService
 NS_IMETHODIMP
-nsProtocolProxyService::AsyncResolve2(nsIChannel *channel, uint32_t flags,
-                                      nsIProtocolProxyCallback *callback,
-                                      nsIEventTarget *mainThreadEventTarget,
-                                      nsICancelable **result) {
+nsProtocolProxyService::AsyncResolve2(nsIChannel* channel, uint32_t flags,
+                                      nsIProtocolProxyCallback* callback,
+                                      nsIEventTarget* mainThreadEventTarget,
+                                      nsICancelable** result) {
   return AsyncResolveInternal(channel, flags, callback, result, true,
                               mainThreadEventTarget);
 }
 
 NS_IMETHODIMP
-nsProtocolProxyService::AsyncResolve(nsISupports *channelOrURI, uint32_t flags,
-                                     nsIProtocolProxyCallback *callback,
-                                     nsIEventTarget *mainThreadEventTarget,
-                                     nsICancelable **result) {
+nsProtocolProxyService::AsyncResolve(nsISupports* channelOrURI, uint32_t flags,
+                                     nsIProtocolProxyCallback* callback,
+                                     nsIEventTarget* mainThreadEventTarget,
+                                     nsICancelable** result) {
   nsresult rv;
   // Check if we got a channel:
   nsCOMPtr channel = do_QueryInterface(channelOrURI);
@@ -1602,11 +1601,11 @@ nsProtocolProxyService::AsyncResolve(nsISupports *channelOrURI, uint32_t flags,
 }
 
 NS_IMETHODIMP
-nsProtocolProxyService::NewProxyInfo(const nsACString &aType,
-                                     const nsACString &aHost, int32_t aPort,
+nsProtocolProxyService::NewProxyInfo(const nsACString& aType,
+                                     const nsACString& aHost, int32_t aPort,
                                      uint32_t aFlags, uint32_t aFailoverTimeout,
-                                     nsIProxyInfo *aFailoverProxy,
-                                     nsIProxyInfo **aResult) {
+                                     nsIProxyInfo* aFailoverProxy,
+                                     nsIProxyInfo** aResult) {
   return NewProxyInfoWithAuth(aType, aHost, aPort, EmptyCString(),
                               EmptyCString(), aFlags, aFailoverTimeout,
                               aFailoverProxy, aResult);
@@ -1614,18 +1613,18 @@ nsProtocolProxyService::NewProxyInfo(const nsACString &aType,
 
 NS_IMETHODIMP
 nsProtocolProxyService::NewProxyInfoWithAuth(
-    const nsACString &aType, const nsACString &aHost, int32_t aPort,
-    const nsACString &aUsername, const nsACString &aPassword, uint32_t aFlags,
-    uint32_t aFailoverTimeout, nsIProxyInfo *aFailoverProxy,
-    nsIProxyInfo **aResult) {
-  static const char *types[] = {kProxyType_HTTP, kProxyType_HTTPS,
+    const nsACString& aType, const nsACString& aHost, int32_t aPort,
+    const nsACString& aUsername, const nsACString& aPassword, uint32_t aFlags,
+    uint32_t aFailoverTimeout, nsIProxyInfo* aFailoverProxy,
+    nsIProxyInfo** aResult) {
+  static const char* types[] = {kProxyType_HTTP, kProxyType_HTTPS,
                                 kProxyType_SOCKS, kProxyType_SOCKS4,
                                 kProxyType_DIRECT};
 
   // resolve type; this allows us to avoid copying the type string into each
   // proxy info instance.  we just reference the string literals directly :)
-  const char *type = nullptr;
-  for (auto &t : types) {
+  const char* type = nullptr;
+  for (auto& t : types) {
     if (aType.LowerCaseEqualsASCII(t)) {
       type = t;
       break;
@@ -1645,9 +1644,9 @@ nsProtocolProxyService::NewProxyInfoWithAuth(
 }
 
 NS_IMETHODIMP
-nsProtocolProxyService::GetFailoverForProxy(nsIProxyInfo *aProxy, nsIURI *aURI,
+nsProtocolProxyService::GetFailoverForProxy(nsIProxyInfo* aProxy, nsIURI* aURI,
                                             nsresult aStatus,
-                                            nsIProxyInfo **aResult) {
+                                            nsIProxyInfo** aResult) {
   // We only support failover when a PAC file is configured, either
   // directly or via system settings
   if (mProxyConfig != PROXYCONFIG_PAC && mProxyConfig != PROXYCONFIG_WPAD &&
@@ -1681,10 +1680,10 @@ class ProxyFilterPositionComparator {
   typedef RefPtr FilterLinkRef;
 
  public:
-  bool Equals(const FilterLinkRef &a, const FilterLinkRef &b) const {
+  bool Equals(const FilterLinkRef& a, const FilterLinkRef& b) const {
     return a->position == b->position;
   }
-  bool LessThan(const FilterLinkRef &a, const FilterLinkRef &b) const {
+  bool LessThan(const FilterLinkRef& a, const FilterLinkRef& b) const {
     return a->position < b->position;
   }
 };
@@ -1693,7 +1692,7 @@ class ProxyFilterObjectComparator {
   typedef RefPtr FilterLinkRef;
 
  public:
-  bool Equals(const FilterLinkRef &link, const nsISupports *obj) const {
+  bool Equals(const FilterLinkRef& link, const nsISupports* obj) const {
     return obj == nsCOMPtr(do_QueryInterface(link->filter)) ||
            obj == nsCOMPtr(do_QueryInterface(link->channelFilter));
   }
@@ -1701,7 +1700,7 @@ class ProxyFilterObjectComparator {
 
 }  // namespace
 
-nsresult nsProtocolProxyService::InsertFilterLink(RefPtr &&link) {
+nsresult nsProtocolProxyService::InsertFilterLink(RefPtr&& link) {
   LOG(("nsProtocolProxyService::InsertFilterLink filter=%p", link.get()));
 
   if (mIsShutdown) {
@@ -1714,7 +1713,7 @@ nsresult nsProtocolProxyService::InsertFilterLink(RefPtr &&link) {
 }
 
 NS_IMETHODIMP
-nsProtocolProxyService::RegisterFilter(nsIProtocolProxyFilter *filter,
+nsProtocolProxyService::RegisterFilter(nsIProtocolProxyFilter* filter,
                                        uint32_t position) {
   UnregisterFilter(filter);  // remove this filter if we already have it
 
@@ -1724,7 +1723,7 @@ nsProtocolProxyService::RegisterFilter(nsIProtocolProxyFilter *filter,
 
 NS_IMETHODIMP
 nsProtocolProxyService::RegisterChannelFilter(
-    nsIProtocolProxyChannelFilter *channelFilter, uint32_t position) {
+    nsIProtocolProxyChannelFilter* channelFilter, uint32_t position) {
   UnregisterChannelFilter(
       channelFilter);  // remove this filter if we already have it
 
@@ -1732,7 +1731,7 @@ nsProtocolProxyService::RegisterChannelFilter(
   return InsertFilterLink(std::move(link));
 }
 
-nsresult nsProtocolProxyService::RemoveFilterLink(nsISupports *givenObject) {
+nsresult nsProtocolProxyService::RemoveFilterLink(nsISupports* givenObject) {
   LOG(("nsProtocolProxyService::RemoveFilterLink target=%p", givenObject));
 
   return mFilters.RemoveElement(givenObject, ProxyFilterObjectComparator())
@@ -1741,7 +1740,7 @@ nsresult nsProtocolProxyService::RemoveFilterLink(nsISupports *givenObject) {
 }
 
 NS_IMETHODIMP
-nsProtocolProxyService::UnregisterFilter(nsIProtocolProxyFilter *filter) {
+nsProtocolProxyService::UnregisterFilter(nsIProtocolProxyFilter* filter) {
   // QI to nsISupports so we can safely test object identity.
   nsCOMPtr givenObject = do_QueryInterface(filter);
   return RemoveFilterLink(givenObject);
@@ -1749,19 +1748,19 @@ nsProtocolProxyService::UnregisterFilter(nsIProtocolProxyFilter *filter) {
 
 NS_IMETHODIMP
 nsProtocolProxyService::UnregisterChannelFilter(
-    nsIProtocolProxyChannelFilter *channelFilter) {
+    nsIProtocolProxyChannelFilter* channelFilter) {
   // QI to nsISupports so we can safely test object identity.
   nsCOMPtr givenObject = do_QueryInterface(channelFilter);
   return RemoveFilterLink(givenObject);
 }
 
 NS_IMETHODIMP
-nsProtocolProxyService::GetProxyConfigType(uint32_t *aProxyConfigType) {
+nsProtocolProxyService::GetProxyConfigType(uint32_t* aProxyConfigType) {
   *aProxyConfigType = mProxyConfig;
   return NS_OK;
 }
 
-void nsProtocolProxyService::LoadHostFilters(const nsACString &aFilters) {
+void nsProtocolProxyService::LoadHostFilters(const nsACString& aFilters) {
   if (mIsShutdown) {
     return;
   }
@@ -1864,7 +1863,7 @@ void nsProtocolProxyService::LoadHostFilters(const nsACString &aFilters) {
     }
 
     // For all other host filters, create HostInfo object and add to list
-    HostInfo *hinfo = new HostInfo();
+    HostInfo* hinfo = new HostInfo();
     nsresult rv = NS_OK;
 
     int32_t port = portStr.ToInteger(&rv);
@@ -1961,8 +1960,8 @@ void nsProtocolProxyService::LoadHostFilters(const nsACString &aFilters) {
   }
 }
 
-nsresult nsProtocolProxyService::GetProtocolInfo(nsIURI *uri,
-                                                 nsProtocolInfo *info) {
+nsresult nsProtocolProxyService::GetProtocolInfo(nsIURI* uri,
+                                                 nsProtocolInfo* info) {
   MOZ_ASSERT(uri, "URI is null");
   MOZ_ASSERT(info, "info is null");
 
@@ -1986,10 +1985,10 @@ nsresult nsProtocolProxyService::GetProtocolInfo(nsIURI *uri,
 }
 
 nsresult nsProtocolProxyService::NewProxyInfo_Internal(
-    const char *aType, const nsACString &aHost, int32_t aPort,
-    const nsACString &aUsername, const nsACString &aPassword, uint32_t aFlags,
-    uint32_t aFailoverTimeout, nsIProxyInfo *aFailoverProxy,
-    uint32_t aResolveFlags, nsIProxyInfo **aResult) {
+    const char* aType, const nsACString& aHost, int32_t aPort,
+    const nsACString& aUsername, const nsACString& aPassword, uint32_t aFlags,
+    uint32_t aFailoverTimeout, nsIProxyInfo* aFailoverProxy,
+    uint32_t aResolveFlags, nsIProxyInfo** aResult) {
   if (aPort <= 0) aPort = -1;
 
   nsCOMPtr failover;
@@ -1998,7 +1997,7 @@ nsresult nsProtocolProxyService::NewProxyInfo_Internal(
     NS_ENSURE_ARG(failover);
   }
 
-  nsProxyInfo *proxyInfo = new nsProxyInfo();
+  nsProxyInfo* proxyInfo = new nsProxyInfo();
   if (!proxyInfo) return NS_ERROR_OUT_OF_MEMORY;
 
   proxyInfo->mType = aType;
@@ -2016,11 +2015,11 @@ nsresult nsProtocolProxyService::NewProxyInfo_Internal(
   return NS_OK;
 }
 
-nsresult nsProtocolProxyService::Resolve_Internal(nsIChannel *channel,
-                                                  const nsProtocolInfo &info,
+nsresult nsProtocolProxyService::Resolve_Internal(nsIChannel* channel,
+                                                  const nsProtocolInfo& info,
                                                   uint32_t flags,
-                                                  bool *usePACThread,
-                                                  nsIProxyInfo **result) {
+                                                  bool* usePACThread,
+                                                  nsIProxyInfo** result) {
   NS_ENSURE_ARG_POINTER(channel);
 
   *usePACThread = false;
@@ -2124,8 +2123,8 @@ nsresult nsProtocolProxyService::Resolve_Internal(nsIChannel *channel,
   if (mProxyConfig != PROXYCONFIG_MANUAL) return NS_OK;
 
   // proxy info values for manual configuration mode
-  const char *type = nullptr;
-  const nsACString *host = nullptr;
+  const char* type = nullptr;
+  const nsACString* host = nullptr;
   int32_t port = -1;
 
   uint32_t proxyFlags = 0;
@@ -2185,7 +2184,7 @@ nsresult nsProtocolProxyService::Resolve_Internal(nsIChannel *channel,
   return NS_OK;
 }
 
-void nsProtocolProxyService::MaybeDisableDNSPrefetch(nsIProxyInfo *aProxy) {
+void nsProtocolProxyService::MaybeDisableDNSPrefetch(nsIProxyInfo* aProxy) {
   // Disable Prefetch in the DNS service if a proxy is in use.
   if (!aProxy) return;
 
@@ -2201,15 +2200,15 @@ void nsProtocolProxyService::MaybeDisableDNSPrefetch(nsIProxyInfo *aProxy) {
   pdns->SetPrefetchEnabled(false);
 }
 
-void nsProtocolProxyService::CopyFilters(nsTArray> &aCopy) {
+void nsProtocolProxyService::CopyFilters(nsTArray>& aCopy) {
   MOZ_ASSERT(aCopy.Length() == 0);
   aCopy.AppendElements(mFilters);
 }
 
 bool nsProtocolProxyService::ApplyFilter(
-    FilterLink const *filterLink, nsIChannel *channel,
-    const nsProtocolInfo &info, nsCOMPtr list,
-    nsIProxyProtocolFilterResult *callback) {
+    FilterLink const* filterLink, nsIChannel* channel,
+    const nsProtocolInfo& info, nsCOMPtr list,
+    nsIProxyProtocolFilterResult* callback) {
   nsresult rv;
 
   // We prune the proxy list prior to invoking each filter.  This may be
@@ -2236,13 +2235,13 @@ bool nsProtocolProxyService::ApplyFilter(
   return false;
 }
 
-void nsProtocolProxyService::PruneProxyInfo(const nsProtocolInfo &info,
-                                            nsIProxyInfo **list) {
+void nsProtocolProxyService::PruneProxyInfo(const nsProtocolInfo& info,
+                                            nsIProxyInfo** list) {
   if (!*list) return;
 
   LOG(("nsProtocolProxyService::PruneProxyInfo ENTER list=%p", *list));
 
-  nsProxyInfo *head = nullptr;
+  nsProxyInfo* head = nullptr;
   CallQueryInterface(*list, &head);
   if (!head) {
     MOZ_ASSERT_UNREACHABLE("nsIProxyInfo must QI to nsProxyInfo");
@@ -2268,7 +2267,7 @@ void nsProtocolProxyService::PruneProxyInfo(const nsProtocolInfo &info,
           last->mNext = iter->mNext;
         else
           head = iter->mNext;
-        nsProxyInfo *next = iter->mNext;
+        nsProxyInfo* next = iter->mNext;
         iter->mNext = nullptr;
         iter->Release();
         iter = next;
@@ -2288,7 +2287,7 @@ void nsProtocolProxyService::PruneProxyInfo(const nsProtocolInfo &info,
 
   bool allNonDirectProxiesDisabled = true;
 
-  nsProxyInfo *iter;
+  nsProxyInfo* iter;
   for (iter = head; iter; iter = iter->mNext) {
     if (!IsProxyDisabled(iter) && iter->mType != kProxyType_DIRECT) {
       allNonDirectProxiesDisabled = false;
@@ -2300,11 +2299,11 @@ void nsProtocolProxyService::PruneProxyInfo(const nsProtocolInfo &info,
     LOG(("All proxies are disabled, so trying all again"));
   } else {
     // remove any disabled proxies.
-    nsProxyInfo *last = nullptr;
+    nsProxyInfo* last = nullptr;
     for (iter = head; iter;) {
       if (IsProxyDisabled(iter)) {
         // reject!
-        nsProxyInfo *reject = iter;
+        nsProxyInfo* reject = iter;
 
         iter = iter->mNext;
         if (last)
diff --git a/netwerk/base/nsProtocolProxyService.h b/netwerk/base/nsProtocolProxyService.h
index 7367427ed3de6..aef9671873bbe 100644
--- a/netwerk/base/nsProtocolProxyService.h
+++ b/netwerk/base/nsProtocolProxyService.h
@@ -66,8 +66,8 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
     nsCOMPtr filter;
     nsCOMPtr channelFilter;
 
-    FilterLink(uint32_t p, nsIProtocolProxyFilter *f);
-    FilterLink(uint32_t p, nsIProtocolProxyChannelFilter *cf);
+    FilterLink(uint32_t p, nsIProtocolProxyFilter* f);
+    FilterLink(uint32_t p, nsIProtocolProxyChannelFilter* cf);
 
    private:
     ~FilterLink();
@@ -89,7 +89,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    *        This can be the name of a fully-qualified preference, or it can
    *        be null, in which case all preferences will be initialized.
    */
-  void PrefsChanged(nsIPrefBranch *prefs, const char *name);
+  void PrefsChanged(nsIPrefBranch* prefs, const char* name);
 
   /**
    * This method is called to create a nsProxyInfo instance from the given
@@ -107,8 +107,8 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    *
    * @return A pointer beyond the parsed proxy string (never null).
    */
-  const char *ExtractProxyInfo(const char *proxy, uint32_t aResolveFlags,
-                               nsProxyInfo **result);
+  const char* ExtractProxyInfo(const char* proxy, uint32_t aResolveFlags,
+                               nsProxyInfo** result);
 
   /**
    * Load the specified PAC file.
@@ -116,7 +116,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param pacURI
    *        The URI spec of the PAC file to load.
    */
-  nsresult ConfigureFromPAC(const nsCString &pacURI, bool forceReload);
+  nsresult ConfigureFromPAC(const nsCString& pacURI, bool forceReload);
 
   /**
    * This method builds a list of nsProxyInfo objects from the given PAC-
@@ -130,8 +130,8 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param result
    *        The resulting list of proxy info objects.
    */
-  void ProcessPACString(const nsCString &pacString, uint32_t aResolveFlags,
-                        nsIProxyInfo **result);
+  void ProcessPACString(const nsCString& pacString, uint32_t aResolveFlags,
+                        nsIProxyInfo** result);
 
   /**
    * This method generates a string valued identifier for the given
@@ -142,7 +142,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param result
    *        Upon return, this parameter holds the generated key.
    */
-  void GetProxyKey(nsProxyInfo *pi, nsCString &result);
+  void GetProxyKey(nsProxyInfo* pi, nsCString& result);
 
   /**
    * @return Seconds since start of session.
@@ -155,7 +155,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param pi
    *        The nsProxyInfo object identifying the proxy to enable.
    */
-  void EnableProxy(nsProxyInfo *pi);
+  void EnableProxy(nsProxyInfo* pi);
 
   /**
    * This method adds the specified proxy to the disabled list.
@@ -163,7 +163,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param pi
    *        The nsProxyInfo object identifying the proxy to disable.
    */
-  void DisableProxy(nsProxyInfo *pi);
+  void DisableProxy(nsProxyInfo* pi);
 
   /**
    * This method tests to see if the given proxy is disabled.
@@ -173,7 +173,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    *
    * @return True if the specified proxy is disabled.
    */
-  bool IsProxyDisabled(nsProxyInfo *pi);
+  bool IsProxyDisabled(nsProxyInfo* pi);
 
   /**
    * This method queries the protocol handler for the given scheme to check
@@ -186,7 +186,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    *        of structure when you call this method.  This parameter must not
    *        be null.
    */
-  nsresult GetProtocolInfo(nsIURI *uri, nsProtocolInfo *result);
+  nsresult GetProtocolInfo(nsIURI* uri, nsProtocolInfo* result);
 
   /**
    * This method is an internal version nsIProtocolProxyService::newProxyInfo
@@ -213,11 +213,11 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param result
    *        The resulting nsIProxyInfo object.
    */
-  nsresult NewProxyInfo_Internal(const char *type, const nsACString &host,
-                                 int32_t port, const nsACString &username,
-                                 const nsACString &password, uint32_t flags,
-                                 uint32_t timeout, nsIProxyInfo *next,
-                                 uint32_t aResolveFlags, nsIProxyInfo **result);
+  nsresult NewProxyInfo_Internal(const char* type, const nsACString& host,
+                                 int32_t port, const nsACString& username,
+                                 const nsACString& password, uint32_t flags,
+                                 uint32_t timeout, nsIProxyInfo* next,
+                                 uint32_t aResolveFlags, nsIProxyInfo** result);
 
   /**
    * This method is an internal version of Resolve that does not query PAC.
@@ -237,25 +237,25 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param result
    *        The resulting proxy info or null.
    */
-  nsresult Resolve_Internal(nsIChannel *channel, const nsProtocolInfo &info,
-                            uint32_t flags, bool *usePAC,
-                            nsIProxyInfo **result);
+  nsresult Resolve_Internal(nsIChannel* channel, const nsProtocolInfo& info,
+                            uint32_t flags, bool* usePAC,
+                            nsIProxyInfo** result);
 
   /**
    * Shallow copy of the current list of registered filters so that
    * we can safely let them asynchronously process a single proxy
    * resolution request.
    */
-  void CopyFilters(nsTArray> &aCopy);
+  void CopyFilters(nsTArray>& aCopy);
 
   /**
    * This method applies the provided filter to the given proxy info
    * list, and expects |callback| be called on (synchronously or
    * asynchronously) to provide the updated proxyinfo list.
    */
-  bool ApplyFilter(FilterLink const *filterLink, nsIChannel *channel,
-                   const nsProtocolInfo &info, nsCOMPtr proxyInfo,
-                   nsIProxyProtocolFilterResult *callback);
+  bool ApplyFilter(FilterLink const* filterLink, nsIChannel* channel,
+                   const nsProtocolInfo& info, nsCOMPtr proxyInfo,
+                   nsIProxyProtocolFilterResult* callback);
 
   /**
    * This method prunes out disabled and disallowed proxies from a given
@@ -266,15 +266,15 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param proxyInfo
    *        The proxy info list to be modified.  This is an inout param.
    */
-  void PruneProxyInfo(const nsProtocolInfo &info, nsIProxyInfo **proxyInfo);
+  void PruneProxyInfo(const nsProtocolInfo& info, nsIProxyInfo** proxyInfo);
 
   /**
    * This method is a simple wrapper around PruneProxyInfo that takes the
    * proxy info list inout param as a nsCOMPtr.
    */
-  void PruneProxyInfo(const nsProtocolInfo &info,
-                      nsCOMPtr &proxyInfo) {
-    nsIProxyInfo *pi = nullptr;
+  void PruneProxyInfo(const nsProtocolInfo& info,
+                      nsCOMPtr& proxyInfo) {
+    nsIProxyInfo* pi = nullptr;
     proxyInfo.swap(pi);
     PruneProxyInfo(info, &pi);
     proxyInfo.swap(pi);
@@ -286,7 +286,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param hostFilters
    *        A "no-proxy-for" exclusion list.
    */
-  void LoadHostFilters(const nsACString &hostFilters);
+  void LoadHostFilters(const nsACString& hostFilters);
 
   /**
    * This method checks the given URI against mHostFiltersArray.
@@ -298,7 +298,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    *
    * @return True if the URI can use the specified proxy.
    */
-  bool CanUseProxy(nsIURI *uri, int32_t defaultPort);
+  bool CanUseProxy(nsIURI* uri, int32_t defaultPort);
 
   /**
    * Disable Prefetch in the DNS service if a proxy is in use.
@@ -306,16 +306,16 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
    * @param aProxy
    *        The proxy information
    */
-  void MaybeDisableDNSPrefetch(nsIProxyInfo *aProxy);
+  void MaybeDisableDNSPrefetch(nsIProxyInfo* aProxy);
 
  private:
-  nsresult SetupPACThread(nsIEventTarget *mainThreadEventTarget = nullptr);
+  nsresult SetupPACThread(nsIEventTarget* mainThreadEventTarget = nullptr);
   nsresult ResetPACThread();
   nsresult ReloadNetworkPAC();
 
   nsresult AsyncConfigureFromPAC(bool aForceReload, bool aResetPACThread);
   nsresult OnAsyncGetPACURI(bool aForceReload, bool aResetPACThread,
-                            nsresult aResult, const nsACString &aUri);
+                            nsresult aResult, const nsACString& aUri);
 
  public:
   // The Sun Forte compiler and others implement older versions of the
@@ -329,7 +329,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
   };
 
   struct HostInfoName {
-    char *host;
+    char* host;
     uint32_t host_len;
   };
 
@@ -354,8 +354,8 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
 
  private:
   // Private methods to insert and remove FilterLinks from the FilterLink chain.
-  nsresult InsertFilterLink(RefPtr &&link);
-  nsresult RemoveFilterLink(nsISupports *givenObject);
+  nsresult InsertFilterLink(RefPtr&& link);
+  nsresult RemoveFilterLink(nsISupports* givenObject);
 
  protected:
   // Indicates if local hosts (plain hostnames, no dots) should use the proxy
@@ -396,10 +396,10 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2,
   int32_t mFailedProxyTimeout;
 
  private:
-  nsresult AsyncResolveInternal(nsIChannel *channel, uint32_t flags,
-                                nsIProtocolProxyCallback *callback,
-                                nsICancelable **result, bool isSyncOK,
-                                nsIEventTarget *mainThreadEventTarget);
+  nsresult AsyncResolveInternal(nsIChannel* channel, uint32_t flags,
+                                nsIProtocolProxyCallback* callback,
+                                nsICancelable** result, bool isSyncOK,
+                                nsIEventTarget* mainThreadEventTarget);
   bool mIsShutdown;
   nsCOMPtr mProxySettingTarget;
 };
diff --git a/netwerk/base/nsProxyInfo.cpp b/netwerk/base/nsProxyInfo.cpp
index 4422c0c3fcde7..c9c53b393b4c0 100644
--- a/netwerk/base/nsProxyInfo.cpp
+++ b/netwerk/base/nsProxyInfo.cpp
@@ -14,61 +14,61 @@ namespace net {
 NS_IMPL_ISUPPORTS(nsProxyInfo, nsProxyInfo, nsIProxyInfo)
 
 NS_IMETHODIMP
-nsProxyInfo::GetHost(nsACString &result) {
+nsProxyInfo::GetHost(nsACString& result) {
   result = mHost;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::GetPort(int32_t *result) {
+nsProxyInfo::GetPort(int32_t* result) {
   *result = mPort;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::GetType(nsACString &result) {
+nsProxyInfo::GetType(nsACString& result) {
   result = mType;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::GetFlags(uint32_t *result) {
+nsProxyInfo::GetFlags(uint32_t* result) {
   *result = mFlags;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::GetResolveFlags(uint32_t *result) {
+nsProxyInfo::GetResolveFlags(uint32_t* result) {
   *result = mResolveFlags;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::GetUsername(nsACString &result) {
+nsProxyInfo::GetUsername(nsACString& result) {
   result = mUsername;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::GetPassword(nsACString &result) {
+nsProxyInfo::GetPassword(nsACString& result) {
   result = mPassword;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::GetFailoverTimeout(uint32_t *result) {
+nsProxyInfo::GetFailoverTimeout(uint32_t* result) {
   *result = mTimeout;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::GetFailoverProxy(nsIProxyInfo **result) {
+nsProxyInfo::GetFailoverProxy(nsIProxyInfo** result) {
   NS_IF_ADDREF(*result = mNext);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsProxyInfo::SetFailoverProxy(nsIProxyInfo *proxy) {
+nsProxyInfo::SetFailoverProxy(nsIProxyInfo* proxy) {
   nsCOMPtr pi = do_QueryInterface(proxy);
   NS_ENSURE_ARG(pi);
 
diff --git a/netwerk/base/nsProxyInfo.h b/netwerk/base/nsProxyInfo.h
index 178157732c66b..7382a74f3a3d9 100644
--- a/netwerk/base/nsProxyInfo.h
+++ b/netwerk/base/nsProxyInfo.h
@@ -32,12 +32,12 @@ class nsProxyInfo final : public nsIProxyInfo {
   NS_DECL_NSIPROXYINFO
 
   // Cheap accessors for use within Necko
-  const nsCString &Host() { return mHost; }
+  const nsCString& Host() { return mHost; }
   int32_t Port() { return mPort; }
-  const char *Type() { return mType; }
+  const char* Type() { return mType; }
   uint32_t Flags() { return mFlags; }
-  const nsCString &Username() { return mUsername; }
-  const nsCString &Password() { return mPassword; }
+  const nsCString& Username() { return mUsername; }
+  const nsCString& Password() { return mPassword; }
 
   bool IsDirect();
   bool IsHTTP();
@@ -47,7 +47,7 @@ class nsProxyInfo final : public nsIProxyInfo {
  private:
   friend class nsProtocolProxyService;
 
-  explicit nsProxyInfo(const char *type = nullptr)
+  explicit nsProxyInfo(const char* type = nullptr)
       : mType(type),
         mPort(-1),
         mFlags(0),
@@ -57,7 +57,7 @@ class nsProxyInfo final : public nsIProxyInfo {
 
   ~nsProxyInfo() { NS_IF_RELEASE(mNext); }
 
-  const char *mType;  // pointer to statically allocated value
+  const char* mType;  // pointer to statically allocated value
   nsCString mHost;
   nsCString mUsername;
   nsCString mPassword;
@@ -65,7 +65,7 @@ class nsProxyInfo final : public nsIProxyInfo {
   uint32_t mFlags;
   uint32_t mResolveFlags;
   uint32_t mTimeout;
-  nsProxyInfo *mNext;
+  nsProxyInfo* mNext;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsProxyInfo, NS_PROXYINFO_IID)
diff --git a/netwerk/base/nsRequestObserverProxy.cpp b/netwerk/base/nsRequestObserverProxy.cpp
index 1fd48cdfc91f9..c5852b9e8e2ff 100644
--- a/netwerk/base/nsRequestObserverProxy.cpp
+++ b/netwerk/base/nsRequestObserverProxy.cpp
@@ -24,7 +24,7 @@ static LazyLogModule gRequestObserverProxyLog("nsRequestObserverProxy");
 // nsARequestObserverEvent internal class...
 //-----------------------------------------------------------------------------
 
-nsARequestObserverEvent::nsARequestObserverEvent(nsIRequest *request)
+nsARequestObserverEvent::nsARequestObserverEvent(nsIRequest* request)
     : Runnable("net::nsARequestObserverEvent"), mRequest(request) {
   MOZ_ASSERT(mRequest, "null pointer");
 }
@@ -37,7 +37,7 @@ class nsOnStartRequestEvent : public nsARequestObserverEvent {
   RefPtr mProxy;
 
  public:
-  nsOnStartRequestEvent(nsRequestObserverProxy *proxy, nsIRequest *request)
+  nsOnStartRequestEvent(nsRequestObserverProxy* proxy, nsIRequest* request)
       : nsARequestObserverEvent(request), mProxy(proxy) {
     MOZ_ASSERT(mProxy, "null pointer");
   }
@@ -75,7 +75,7 @@ class nsOnStopRequestEvent : public nsARequestObserverEvent {
   RefPtr mProxy;
 
  public:
-  nsOnStopRequestEvent(nsRequestObserverProxy *proxy, nsIRequest *request)
+  nsOnStopRequestEvent(nsRequestObserverProxy* proxy, nsIRequest* request)
       : nsARequestObserverEvent(request), mProxy(proxy) {
     MOZ_ASSERT(mProxy, "null pointer");
   }
@@ -118,11 +118,11 @@ NS_IMPL_ISUPPORTS(nsRequestObserverProxy, nsIRequestObserver,
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsRequestObserverProxy::OnStartRequest(nsIRequest *request) {
+nsRequestObserverProxy::OnStartRequest(nsIRequest* request) {
   LOG(("nsRequestObserverProxy::OnStartRequest [this=%p req=%p]\n", this,
        request));
 
-  nsOnStartRequestEvent *ev = new nsOnStartRequestEvent(this, request);
+  nsOnStartRequestEvent* ev = new nsOnStartRequestEvent(this, request);
   if (!ev) return NS_ERROR_OUT_OF_MEMORY;
 
   LOG(("post startevent=%p\n", ev));
@@ -132,7 +132,7 @@ nsRequestObserverProxy::OnStartRequest(nsIRequest *request) {
 }
 
 NS_IMETHODIMP
-nsRequestObserverProxy::OnStopRequest(nsIRequest *request, nsresult status) {
+nsRequestObserverProxy::OnStopRequest(nsIRequest* request, nsresult status) {
   LOG(("nsRequestObserverProxy: OnStopRequest [this=%p req=%p status=%" PRIx32
        "]\n",
        this, request, static_cast(status)));
@@ -142,7 +142,7 @@ nsRequestObserverProxy::OnStopRequest(nsIRequest *request, nsresult status) {
   // To make sure that an accurate status code is always used, GetStatus() is
   // called when the OnStopRequestEvent is actually processed (see above).
 
-  nsOnStopRequestEvent *ev = new nsOnStopRequestEvent(this, request);
+  nsOnStopRequestEvent* ev = new nsOnStopRequestEvent(this, request);
   if (!ev) return NS_ERROR_OUT_OF_MEMORY;
 
   LOG(("post stopevent=%p\n", ev));
@@ -156,8 +156,8 @@ nsRequestObserverProxy::OnStopRequest(nsIRequest *request, nsresult status) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsRequestObserverProxy::Init(nsIRequestObserver *observer,
-                             nsISupports *context) {
+nsRequestObserverProxy::Init(nsIRequestObserver* observer,
+                             nsISupports* context) {
   NS_ENSURE_ARG_POINTER(observer);
   mObserver = new nsMainThreadPtrHolder(
       "nsRequestObserverProxy::mObserver", observer);
@@ -171,7 +171,7 @@ nsRequestObserverProxy::Init(nsIRequestObserver *observer,
 // nsRequestObserverProxy implementation...
 //-----------------------------------------------------------------------------
 
-nsresult nsRequestObserverProxy::FireEvent(nsARequestObserverEvent *event) {
+nsresult nsRequestObserverProxy::FireEvent(nsARequestObserverEvent* event) {
   nsCOMPtr mainThread(GetMainThreadEventTarget());
   return mainThread->Dispatch(event, NS_DISPATCH_NORMAL);
 }
diff --git a/netwerk/base/nsRequestObserverProxy.h b/netwerk/base/nsRequestObserverProxy.h
index e27310c95e1b0..e1ccec0c4ce2e 100644
--- a/netwerk/base/nsRequestObserverProxy.h
+++ b/netwerk/base/nsRequestObserverProxy.h
@@ -28,9 +28,9 @@ class nsRequestObserverProxy final : public nsIRequestObserverProxy {
 
   nsRequestObserverProxy() = default;
 
-  nsIRequestObserver *Observer() { return mObserver; }
+  nsIRequestObserver* Observer() { return mObserver; }
 
-  nsresult FireEvent(nsARequestObserverEvent *);
+  nsresult FireEvent(nsARequestObserverEvent*);
 
  protected:
   nsMainThreadPtrHandle mObserver;
@@ -42,7 +42,7 @@ class nsRequestObserverProxy final : public nsIRequestObserverProxy {
 
 class nsARequestObserverEvent : public Runnable {
  public:
-  explicit nsARequestObserverEvent(nsIRequest *);
+  explicit nsARequestObserverEvent(nsIRequest*);
 
  protected:
   virtual ~nsARequestObserverEvent() = default;
diff --git a/netwerk/base/nsServerSocket.cpp b/netwerk/base/nsServerSocket.cpp
index 55fa81b98fc46..4f32096755d58 100644
--- a/netwerk/base/nsServerSocket.cpp
+++ b/netwerk/base/nsServerSocket.cpp
@@ -25,7 +25,7 @@ namespace net {
 
 typedef void (nsServerSocket::*nsServerSocketFunc)(void);
 
-static nsresult PostEvent(nsServerSocket *s, nsServerSocketFunc func) {
+static nsresult PostEvent(nsServerSocket* s, nsServerSocketFunc func) {
   nsCOMPtr ev = NewRunnableMethod("net::PostEvent", s, func);
   if (!gSocketTransportService) return NS_ERROR_FAILURE;
 
@@ -65,7 +65,7 @@ nsServerSocket::~nsServerSocket() {
   Close();  // just in case :)
 
   // release our reference to the STS
-  nsSocketTransportService *serv = gSocketTransportService;
+  nsSocketTransportService* serv = gSocketTransportService;
   NS_IF_RELEASE(serv);
 }
 
@@ -137,8 +137,8 @@ nsresult nsServerSocket::TryAttach() {
   return NS_OK;
 }
 
-void nsServerSocket::CreateClientTransport(PRFileDesc *aClientFD,
-                                           const NetAddr &aClientAddr) {
+void nsServerSocket::CreateClientTransport(PRFileDesc* aClientFD,
+                                           const NetAddr& aClientAddr) {
   RefPtr trans = new nsSocketTransport;
   if (NS_WARN_IF(!trans)) {
     mCondition = NS_ERROR_OUT_OF_MEMORY;
@@ -158,7 +158,7 @@ void nsServerSocket::CreateClientTransport(PRFileDesc *aClientFD,
 // nsServerSocket::nsASocketHandler
 //-----------------------------------------------------------------------------
 
-void nsServerSocket::OnSocketReady(PRFileDesc *fd, int16_t outFlags) {
+void nsServerSocket::OnSocketReady(PRFileDesc* fd, int16_t outFlags) {
   NS_ASSERTION(NS_SUCCEEDED(mCondition), "oops");
   NS_ASSERTION(mFD == fd, "wrong file descriptor");
   NS_ASSERTION(outFlags != -1, "unexpected timeout condition reached");
@@ -169,7 +169,7 @@ void nsServerSocket::OnSocketReady(PRFileDesc *fd, int16_t outFlags) {
     return;
   }
 
-  PRFileDesc *clientFD;
+  PRFileDesc* clientFD;
   PRNetAddr prClientAddr;
   NetAddr clientAddr;
 
@@ -192,7 +192,7 @@ void nsServerSocket::OnSocketReady(PRFileDesc *fd, int16_t outFlags) {
   CreateClientTransport(clientFD, clientAddr);
 }
 
-void nsServerSocket::OnSocketDetached(PRFileDesc *fd) {
+void nsServerSocket::OnSocketDetached(PRFileDesc* fd) {
   // force a failure condition if none set; maybe the STS is shutting down :-/
   if (NS_SUCCEEDED(mCondition)) mCondition = NS_ERROR_ABORT;
 
@@ -221,7 +221,7 @@ void nsServerSocket::OnSocketDetached(PRFileDesc *fd) {
   }
 }
 
-void nsServerSocket::IsLocal(bool *aIsLocal) {
+void nsServerSocket::IsLocal(bool* aIsLocal) {
 #if defined(XP_UNIX)
   // Unix-domain sockets are always local.
   if (mAddr.raw.family == PR_AF_LOCAL) {
@@ -234,7 +234,7 @@ void nsServerSocket::IsLocal(bool *aIsLocal) {
   *aIsLocal = PR_IsNetAddrType(&mAddr, PR_IpAddrLoopback);
 }
 
-void nsServerSocket::KeepWhenOffline(bool *aKeepWhenOffline) {
+void nsServerSocket::KeepWhenOffline(bool* aKeepWhenOffline) {
   *aKeepWhenOffline = mKeepWhenOffline;
 }
 
@@ -274,7 +274,7 @@ nsServerSocket::InitIPv6(int32_t aPort, bool aLoopbackOnly, int32_t aBackLog) {
 }
 
 NS_IMETHODIMP
-nsServerSocket::InitWithFilename(nsIFile *aPath, uint32_t aPermissions,
+nsServerSocket::InitWithFilename(nsIFile* aPath, uint32_t aPermissions,
                                  int32_t aBacklog) {
 #if defined(XP_UNIX)
   nsresult rv;
@@ -301,7 +301,7 @@ nsServerSocket::InitWithFilename(nsIFile *aPath, uint32_t aPermissions,
 }
 
 NS_IMETHODIMP
-nsServerSocket::InitWithAbstractAddress(const nsACString &aName,
+nsServerSocket::InitWithAbstractAddress(const nsACString& aName,
                                         int32_t aBacklog) {
   // Abstract socket address is supported on Linux and Android only.
   // If not Linux, we should return error.
@@ -340,7 +340,7 @@ nsServerSocket::InitSpecialConnection(int32_t aPort, nsServerSocketFlag aFlags,
 }
 
 NS_IMETHODIMP
-nsServerSocket::InitWithAddress(const PRNetAddr *aAddr, int32_t aBackLog) {
+nsServerSocket::InitWithAddress(const PRNetAddr* aAddr, int32_t aBackLog) {
   NS_ENSURE_TRUE(mFD == nullptr, NS_ERROR_ALREADY_INITIALIZED);
   nsresult rv;
 
@@ -422,7 +422,7 @@ class ServerSocketListenerProxy final : public nsIServerSocketListener {
   ~ServerSocketListenerProxy() = default;
 
  public:
-  explicit ServerSocketListenerProxy(nsIServerSocketListener *aListener)
+  explicit ServerSocketListenerProxy(nsIServerSocketListener* aListener)
       : mListener(new nsMainThreadPtrHolder(
             "ServerSocketListenerProxy::mListener", aListener)),
         mTarget(GetCurrentThreadEventTarget()) {}
@@ -433,8 +433,8 @@ class ServerSocketListenerProxy final : public nsIServerSocketListener {
   class OnSocketAcceptedRunnable : public Runnable {
    public:
     OnSocketAcceptedRunnable(
-        const nsMainThreadPtrHandle &aListener,
-        nsIServerSocket *aServ, nsISocketTransport *aTransport)
+        const nsMainThreadPtrHandle& aListener,
+        nsIServerSocket* aServ, nsISocketTransport* aTransport)
         : Runnable("net::ServerSocketListenerProxy::OnSocketAcceptedRunnable"),
           mListener(aListener),
           mServ(aServ),
@@ -451,8 +451,8 @@ class ServerSocketListenerProxy final : public nsIServerSocketListener {
   class OnStopListeningRunnable : public Runnable {
    public:
     OnStopListeningRunnable(
-        const nsMainThreadPtrHandle &aListener,
-        nsIServerSocket *aServ, nsresult aStatus)
+        const nsMainThreadPtrHandle& aListener,
+        nsIServerSocket* aServ, nsresult aStatus)
         : Runnable("net::ServerSocketListenerProxy::OnStopListeningRunnable"),
           mListener(aListener),
           mServ(aServ),
@@ -474,15 +474,15 @@ class ServerSocketListenerProxy final : public nsIServerSocketListener {
 NS_IMPL_ISUPPORTS(ServerSocketListenerProxy, nsIServerSocketListener)
 
 NS_IMETHODIMP
-ServerSocketListenerProxy::OnSocketAccepted(nsIServerSocket *aServ,
-                                            nsISocketTransport *aTransport) {
+ServerSocketListenerProxy::OnSocketAccepted(nsIServerSocket* aServ,
+                                            nsISocketTransport* aTransport) {
   RefPtr r =
       new OnSocketAcceptedRunnable(mListener, aServ, aTransport);
   return mTarget->Dispatch(r, NS_DISPATCH_NORMAL);
 }
 
 NS_IMETHODIMP
-ServerSocketListenerProxy::OnStopListening(nsIServerSocket *aServ,
+ServerSocketListenerProxy::OnStopListening(nsIServerSocket* aServ,
                                            nsresult aStatus) {
   RefPtr r =
       new OnStopListeningRunnable(mListener, aServ, aStatus);
@@ -504,7 +504,7 @@ ServerSocketListenerProxy::OnStopListeningRunnable::Run() {
 }  // namespace
 
 NS_IMETHODIMP
-nsServerSocket::AsyncListen(nsIServerSocketListener *aListener) {
+nsServerSocket::AsyncListen(nsIServerSocketListener* aListener) {
   // ensuring mFD implies ensuring mLock
   NS_ENSURE_TRUE(mFD, NS_ERROR_NOT_INITIALIZED);
   NS_ENSURE_TRUE(mListener == nullptr, NS_ERROR_IN_PROGRESS);
@@ -524,7 +524,7 @@ nsServerSocket::AsyncListen(nsIServerSocketListener *aListener) {
 }
 
 NS_IMETHODIMP
-nsServerSocket::GetPort(int32_t *aResult) {
+nsServerSocket::GetPort(int32_t* aResult) {
   // no need to enter the lock here
   uint16_t port;
   if (mAddr.raw.family == PR_AF_INET)
@@ -539,7 +539,7 @@ nsServerSocket::GetPort(int32_t *aResult) {
 }
 
 NS_IMETHODIMP
-nsServerSocket::GetAddress(PRNetAddr *aResult) {
+nsServerSocket::GetAddress(PRNetAddr* aResult) {
   // no need to enter the lock here
   memcpy(aResult, &mAddr, sizeof(mAddr));
   return NS_OK;
diff --git a/netwerk/base/nsServerSocket.h b/netwerk/base/nsServerSocket.h
index fd6b7bc51fd9f..3690a99a9dc15 100644
--- a/netwerk/base/nsServerSocket.h
+++ b/netwerk/base/nsServerSocket.h
@@ -24,23 +24,23 @@ class nsServerSocket : public nsASocketHandler, public nsIServerSocket {
   NS_DECL_NSISERVERSOCKET
 
   // nsASocketHandler methods:
-  virtual void OnSocketReady(PRFileDesc *fd, int16_t outFlags) override;
-  virtual void OnSocketDetached(PRFileDesc *fd) override;
-  virtual void IsLocal(bool *aIsLocal) override;
-  virtual void KeepWhenOffline(bool *aKeepWhenOffline) override;
+  virtual void OnSocketReady(PRFileDesc* fd, int16_t outFlags) override;
+  virtual void OnSocketDetached(PRFileDesc* fd) override;
+  virtual void IsLocal(bool* aIsLocal) override;
+  virtual void KeepWhenOffline(bool* aKeepWhenOffline) override;
 
   virtual uint64_t ByteCountSent() override { return 0; }
   virtual uint64_t ByteCountReceived() override { return 0; }
   nsServerSocket();
 
-  virtual void CreateClientTransport(PRFileDesc *clientFD,
-                                     const mozilla::net::NetAddr &clientAddr);
+  virtual void CreateClientTransport(PRFileDesc* clientFD,
+                                     const mozilla::net::NetAddr& clientAddr);
   virtual nsresult SetSocketDefaults() { return NS_OK; }
   virtual nsresult OnSocketListen() { return NS_OK; }
 
  protected:
   virtual ~nsServerSocket();
-  PRFileDesc *mFD;
+  PRFileDesc* mFD;
   nsCOMPtr mListener;
 
  private:
diff --git a/netwerk/base/nsSimpleStreamListener.cpp b/netwerk/base/nsSimpleStreamListener.cpp
index 909b449a1babd..beed8a9f401cf 100644
--- a/netwerk/base/nsSimpleStreamListener.cpp
+++ b/netwerk/base/nsSimpleStreamListener.cpp
@@ -22,12 +22,12 @@ NS_IMPL_ISUPPORTS(nsSimpleStreamListener, nsISimpleStreamListener,
 //----------------------------------------------------------------------------
 //
 NS_IMETHODIMP
-nsSimpleStreamListener::OnStartRequest(nsIRequest *aRequest) {
+nsSimpleStreamListener::OnStartRequest(nsIRequest* aRequest) {
   return mObserver ? mObserver->OnStartRequest(aRequest) : NS_OK;
 }
 
 NS_IMETHODIMP
-nsSimpleStreamListener::OnStopRequest(nsIRequest *request, nsresult aStatus) {
+nsSimpleStreamListener::OnStopRequest(nsIRequest* request, nsresult aStatus) {
   return mObserver ? mObserver->OnStopRequest(request, aStatus) : NS_OK;
 }
 
@@ -37,8 +37,8 @@ nsSimpleStreamListener::OnStopRequest(nsIRequest *request, nsresult aStatus) {
 //----------------------------------------------------------------------------
 //
 NS_IMETHODIMP
-nsSimpleStreamListener::OnDataAvailable(nsIRequest *request,
-                                        nsIInputStream *aSource,
+nsSimpleStreamListener::OnDataAvailable(nsIRequest* request,
+                                        nsIInputStream* aSource,
                                         uint64_t aOffset, uint32_t aCount) {
   uint32_t writeCount;
   nsresult rv = mSink->WriteFrom(aSource, aCount, &writeCount);
@@ -55,8 +55,8 @@ nsSimpleStreamListener::OnDataAvailable(nsIRequest *request,
 //----------------------------------------------------------------------------
 //
 NS_IMETHODIMP
-nsSimpleStreamListener::Init(nsIOutputStream *aSink,
-                             nsIRequestObserver *aObserver) {
+nsSimpleStreamListener::Init(nsIOutputStream* aSink,
+                             nsIRequestObserver* aObserver) {
   MOZ_ASSERT(aSink, "null output stream");
 
   mSink = aSink;
diff --git a/netwerk/base/nsSimpleURI.cpp b/netwerk/base/nsSimpleURI.cpp
index 7afc9597bbcc0..70c00526e8dc2 100644
--- a/netwerk/base/nsSimpleURI.cpp
+++ b/netwerk/base/nsSimpleURI.cpp
@@ -32,7 +32,7 @@ static NS_DEFINE_CID(kThisSimpleURIImplementationCID,
 static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID);
 
 /* static */
-already_AddRefed nsSimpleURI::From(nsIURI *aURI) {
+already_AddRefed nsSimpleURI::From(nsIURI* aURI) {
   RefPtr uri;
   nsresult rv = aURI->QueryInterface(kThisSimpleURIImplementationCID,
                                      getter_AddRefs(uri));
@@ -54,7 +54,7 @@ NS_INTERFACE_TABLE_HEAD(nsSimpleURI)
   NS_INTERFACE_TABLE(nsSimpleURI, nsIURI, nsISerializable, nsIClassInfo)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE
   if (aIID.Equals(kThisSimpleURIImplementationCID))
-    foundInterface = static_cast(this);
+    foundInterface = static_cast(this);
   else
     NS_INTERFACE_MAP_ENTRY(nsISizeOf)
 NS_INTERFACE_MAP_END
@@ -63,12 +63,12 @@ NS_INTERFACE_MAP_END
 // nsISerializable methods:
 
 NS_IMETHODIMP
-nsSimpleURI::Read(nsIObjectInputStream *aStream) {
+nsSimpleURI::Read(nsIObjectInputStream* aStream) {
   MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-nsresult nsSimpleURI::ReadPrivate(nsIObjectInputStream *aStream) {
+nsresult nsSimpleURI::ReadPrivate(nsIObjectInputStream* aStream) {
   nsresult rv;
 
   bool isMutable;
@@ -110,7 +110,7 @@ nsresult nsSimpleURI::ReadPrivate(nsIObjectInputStream *aStream) {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::Write(nsIObjectOutputStream *aStream) {
+nsSimpleURI::Write(nsIObjectOutputStream* aStream) {
   nsresult rv;
 
   rv = aStream->WriteBoolean(false);  // former mMutable
@@ -141,7 +141,7 @@ nsSimpleURI::Write(nsIObjectOutputStream *aStream) {
   return NS_OK;
 }
 
-void nsSimpleURI::Serialize(URIParams &aParams) {
+void nsSimpleURI::Serialize(URIParams& aParams) {
   SimpleURIParams params;
 
   params.scheme() = mScheme;
@@ -162,13 +162,13 @@ void nsSimpleURI::Serialize(URIParams &aParams) {
   aParams = params;
 }
 
-bool nsSimpleURI::Deserialize(const URIParams &aParams) {
+bool nsSimpleURI::Deserialize(const URIParams& aParams) {
   if (aParams.type() != URIParams::TSimpleURIParams) {
     NS_ERROR("Received unknown parameters from the other process!");
     return false;
   }
 
-  const SimpleURIParams ¶ms = aParams.get_SimpleURIParams();
+  const SimpleURIParams& params = aParams.get_SimpleURIParams();
 
   mScheme = params.scheme();
   mPath = params.path();
@@ -196,7 +196,7 @@ bool nsSimpleURI::Deserialize(const URIParams &aParams) {
 // nsIURI methods:
 
 NS_IMETHODIMP
-nsSimpleURI::GetSpec(nsACString &result) {
+nsSimpleURI::GetSpec(nsACString& result) {
   if (!result.Assign(mScheme, fallible) ||
       !result.Append(NS_LITERAL_CSTRING(":"), fallible) ||
       !result.Append(mPath, fallible)) {
@@ -226,7 +226,7 @@ nsSimpleURI::GetSpec(nsACString &result) {
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsSimpleURI::GetSpecIgnoringRef(nsACString &result) {
+nsSimpleURI::GetSpecIgnoringRef(nsACString& result) {
   result = mScheme + NS_LITERAL_CSTRING(":") + mPath;
   if (mIsQueryValid) {
     result += NS_LITERAL_CSTRING("?") + mQuery;
@@ -235,32 +235,32 @@ nsSimpleURI::GetSpecIgnoringRef(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetDisplaySpec(nsACString &aUnicodeSpec) {
+nsSimpleURI::GetDisplaySpec(nsACString& aUnicodeSpec) {
   return GetSpec(aUnicodeSpec);
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetDisplayHostPort(nsACString &aUnicodeHostPort) {
+nsSimpleURI::GetDisplayHostPort(nsACString& aUnicodeHostPort) {
   return GetHostPort(aUnicodeHostPort);
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetDisplayHost(nsACString &aUnicodeHost) {
+nsSimpleURI::GetDisplayHost(nsACString& aUnicodeHost) {
   return GetHost(aUnicodeHost);
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetDisplayPrePath(nsACString &aPrePath) {
+nsSimpleURI::GetDisplayPrePath(nsACString& aPrePath) {
   return GetPrePath(aPrePath);
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetHasRef(bool *result) {
+nsSimpleURI::GetHasRef(bool* result) {
   *result = mIsRefValid;
   return NS_OK;
 }
 
-nsresult nsSimpleURI::SetSpecInternal(const nsACString &aSpec) {
+nsresult nsSimpleURI::SetSpecInternal(const nsACString& aSpec) {
   nsresult rv = net_ExtractURLScheme(aSpec, mScheme);
   if (NS_FAILED(rv)) {
     return rv;
@@ -280,13 +280,13 @@ nsresult nsSimpleURI::SetSpecInternal(const nsACString &aSpec) {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetScheme(nsACString &result) {
+nsSimpleURI::GetScheme(nsACString& result) {
   result = mScheme;
   return NS_OK;
 }
 
-nsresult nsSimpleURI::SetScheme(const nsACString &scheme) {
-  const nsPromiseFlatCString &flat = PromiseFlatCString(scheme);
+nsresult nsSimpleURI::SetScheme(const nsACString& scheme) {
+  const nsPromiseFlatCString& flat = PromiseFlatCString(scheme);
   if (!net_IsValidScheme(flat)) {
     NS_WARNING("the given url scheme contains invalid characters");
     return NS_ERROR_MALFORMED_URI;
@@ -298,57 +298,57 @@ nsresult nsSimpleURI::SetScheme(const nsACString &scheme) {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetPrePath(nsACString &result) {
+nsSimpleURI::GetPrePath(nsACString& result) {
   result = mScheme + NS_LITERAL_CSTRING(":");
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetUserPass(nsACString &result) { return NS_ERROR_FAILURE; }
+nsSimpleURI::GetUserPass(nsACString& result) { return NS_ERROR_FAILURE; }
 
-nsresult nsSimpleURI::SetUserPass(const nsACString &userPass) {
+nsresult nsSimpleURI::SetUserPass(const nsACString& userPass) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetUsername(nsACString &result) { return NS_ERROR_FAILURE; }
+nsSimpleURI::GetUsername(nsACString& result) { return NS_ERROR_FAILURE; }
 
-nsresult nsSimpleURI::SetUsername(const nsACString &userName) {
+nsresult nsSimpleURI::SetUsername(const nsACString& userName) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetPassword(nsACString &result) { return NS_ERROR_FAILURE; }
+nsSimpleURI::GetPassword(nsACString& result) { return NS_ERROR_FAILURE; }
 
-nsresult nsSimpleURI::SetPassword(const nsACString &password) {
+nsresult nsSimpleURI::SetPassword(const nsACString& password) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetHostPort(nsACString &result) {
+nsSimpleURI::GetHostPort(nsACString& result) {
   // Note: Audit all callers before changing this to return an empty
   // string -- CAPS and UI code may depend on this throwing.
   // Note: If this is changed, change GetAsciiHostPort as well.
   return NS_ERROR_FAILURE;
 }
 
-nsresult nsSimpleURI::SetHostPort(const nsACString &result) {
+nsresult nsSimpleURI::SetHostPort(const nsACString& result) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetHost(nsACString &result) {
+nsSimpleURI::GetHost(nsACString& result) {
   // Note: Audit all callers before changing this to return an empty
   // string -- CAPS and UI code depend on this throwing.
   return NS_ERROR_FAILURE;
 }
 
-nsresult nsSimpleURI::SetHost(const nsACString &host) {
+nsresult nsSimpleURI::SetHost(const nsACString& host) {
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetPort(int32_t *result) {
+nsSimpleURI::GetPort(int32_t* result) {
   // Note: Audit all callers before changing this to return an empty
   // string -- CAPS and UI code may depend on this throwing.
   return NS_ERROR_FAILURE;
@@ -357,7 +357,7 @@ nsSimpleURI::GetPort(int32_t *result) {
 nsresult nsSimpleURI::SetPort(int32_t port) { return NS_ERROR_FAILURE; }
 
 NS_IMETHODIMP
-nsSimpleURI::GetPathQueryRef(nsACString &result) {
+nsSimpleURI::GetPathQueryRef(nsACString& result) {
   result = mPath;
   if (mIsQueryValid) {
     result += NS_LITERAL_CSTRING("?") + mQuery;
@@ -369,10 +369,10 @@ nsSimpleURI::GetPathQueryRef(nsACString &result) {
   return NS_OK;
 }
 
-nsresult nsSimpleURI::SetPathQueryRef(const nsACString &aPath) {
+nsresult nsSimpleURI::SetPathQueryRef(const nsACString& aPath) {
   return SetPathQueryRefEscaped(aPath, true);
 }
-nsresult nsSimpleURI::SetPathQueryRefEscaped(const nsACString &aPath,
+nsresult nsSimpleURI::SetPathQueryRefEscaped(const nsACString& aPath,
                                              bool aNeedsEscape) {
   nsresult rv;
   nsAutoCString path;
@@ -433,7 +433,7 @@ nsresult nsSimpleURI::SetPathQueryRefEscaped(const nsACString &aPath,
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetRef(nsACString &result) {
+nsSimpleURI::GetRef(nsACString& result) {
   if (!mIsRefValid) {
     MOZ_ASSERT(mRef.IsEmpty(), "mIsRefValid/mRef invariant broken");
     result.Truncate();
@@ -446,7 +446,7 @@ nsSimpleURI::GetRef(nsACString &result) {
 
 // NOTE: SetRef("") removes our ref, whereas SetRef("#") sets it to the empty
 // string (and will result in .spec and .path having a terminal #).
-nsresult nsSimpleURI::SetRef(const nsACString &aRef) {
+nsresult nsSimpleURI::SetRef(const nsACString& aRef) {
   nsAutoCString ref;
   nsresult rv =
       NS_EscapeURL(aRef, esc_OnlyNonASCII | esc_Spaces, ref, fallible);
@@ -474,18 +474,18 @@ nsresult nsSimpleURI::SetRef(const nsACString &aRef) {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::Equals(nsIURI *other, bool *result) {
+nsSimpleURI::Equals(nsIURI* other, bool* result) {
   return EqualsInternal(other, eHonorRef, result);
 }
 
 NS_IMETHODIMP
-nsSimpleURI::EqualsExceptRef(nsIURI *other, bool *result) {
+nsSimpleURI::EqualsExceptRef(nsIURI* other, bool* result) {
   return EqualsInternal(other, eIgnoreRef, result);
 }
 
 /* virtual */
 nsresult nsSimpleURI::EqualsInternal(
-    nsIURI *other, nsSimpleURI::RefHandlingEnum refHandlingMode, bool *result) {
+    nsIURI* other, nsSimpleURI::RefHandlingEnum refHandlingMode, bool* result) {
   NS_ENSURE_ARG_POINTER(other);
   MOZ_ASSERT(result, "null pointer");
 
@@ -501,7 +501,7 @@ nsresult nsSimpleURI::EqualsInternal(
   return NS_OK;
 }
 
-bool nsSimpleURI::EqualsInternal(nsSimpleURI *otherUri,
+bool nsSimpleURI::EqualsInternal(nsSimpleURI* otherUri,
                                  RefHandlingEnum refHandlingMode) {
   bool result = (mScheme == otherUri->mScheme && mPath == otherUri->mPath);
 
@@ -519,14 +519,14 @@ bool nsSimpleURI::EqualsInternal(nsSimpleURI *otherUri,
 }
 
 NS_IMETHODIMP
-nsSimpleURI::SchemeIs(const char *i_Scheme, bool *o_Equals) {
+nsSimpleURI::SchemeIs(const char* i_Scheme, bool* o_Equals) {
   MOZ_ASSERT(o_Equals, "null pointer");
   if (!i_Scheme) {
     *o_Equals = false;
     return NS_OK;
   }
 
-  const char *this_scheme = mScheme.get();
+  const char* this_scheme = mScheme.get();
 
   // mScheme is guaranteed to be lower case.
   if (*i_Scheme == *this_scheme || *i_Scheme == (*this_scheme - ('a' - 'A'))) {
@@ -538,17 +538,17 @@ nsSimpleURI::SchemeIs(const char *i_Scheme, bool *o_Equals) {
   return NS_OK;
 }
 
-/* virtual */ nsSimpleURI *nsSimpleURI::StartClone(
-    nsSimpleURI::RefHandlingEnum refHandlingMode, const nsACString &newRef) {
-  nsSimpleURI *url = new nsSimpleURI();
+/* virtual */ nsSimpleURI* nsSimpleURI::StartClone(
+    nsSimpleURI::RefHandlingEnum refHandlingMode, const nsACString& newRef) {
+  nsSimpleURI* url = new nsSimpleURI();
   SetRefOnClone(url, refHandlingMode, newRef);
   return url;
 }
 
 /* virtual */
-void nsSimpleURI::SetRefOnClone(nsSimpleURI *url,
+void nsSimpleURI::SetRefOnClone(nsSimpleURI* url,
                                 nsSimpleURI::RefHandlingEnum refHandlingMode,
-                                const nsACString &newRef) {
+                                const nsACString& newRef) {
   if (refHandlingMode == eHonorRef) {
     url->mRef = mRef;
     url->mIsRefValid = mIsRefValid;
@@ -557,13 +557,13 @@ void nsSimpleURI::SetRefOnClone(nsSimpleURI *url,
   }
 }
 
-nsresult nsSimpleURI::Clone(nsIURI **result) {
+nsresult nsSimpleURI::Clone(nsIURI** result) {
   return CloneInternal(eHonorRef, EmptyCString(), result);
 }
 
 nsresult nsSimpleURI::CloneInternal(
-    nsSimpleURI::RefHandlingEnum refHandlingMode, const nsACString &newRef,
-    nsIURI **result) {
+    nsSimpleURI::RefHandlingEnum refHandlingMode, const nsACString& newRef,
+    nsIURI** result) {
   RefPtr url = StartClone(refHandlingMode, newRef);
   if (!url) return NS_ERROR_OUT_OF_MEMORY;
 
@@ -580,13 +580,13 @@ nsresult nsSimpleURI::CloneInternal(
 }
 
 NS_IMETHODIMP
-nsSimpleURI::Resolve(const nsACString &relativePath, nsACString &result) {
+nsSimpleURI::Resolve(const nsACString& relativePath, nsACString& result) {
   result = relativePath;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetAsciiSpec(nsACString &aResult) {
+nsSimpleURI::GetAsciiSpec(nsACString& aResult) {
   nsresult rv = GetSpec(aResult);
   if (NS_FAILED(rv)) return rv;
   MOZ_ASSERT(IsASCII(aResult), "The spec should be ASCII");
@@ -594,13 +594,13 @@ nsSimpleURI::GetAsciiSpec(nsACString &aResult) {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetAsciiHostPort(nsACString &result) {
+nsSimpleURI::GetAsciiHostPort(nsACString& result) {
   // XXX This behavior mimics GetHostPort.
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetAsciiHost(nsACString &result) {
+nsSimpleURI::GetAsciiHost(nsACString& result) {
   result.Truncate();
   return NS_OK;
 }
@@ -610,19 +610,19 @@ nsSimpleURI::GetAsciiHost(nsACString &result) {
 //----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsSimpleURI::GetInterfaces(nsTArray &array) {
+nsSimpleURI::GetInterfaces(nsTArray& array) {
   array.Clear();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetScriptableHelper(nsIXPCScriptable **_retval) {
+nsSimpleURI::GetScriptableHelper(nsIXPCScriptable** _retval) {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetContractID(nsACString &aContractID) {
+nsSimpleURI::GetContractID(nsACString& aContractID) {
   // Make sure to modify any subclasses as needed if this ever
   // changes.
   aContractID.SetIsVoid(true);
@@ -630,27 +630,27 @@ nsSimpleURI::GetContractID(nsACString &aContractID) {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetClassDescription(nsACString &aClassDescription) {
+nsSimpleURI::GetClassDescription(nsACString& aClassDescription) {
   aClassDescription.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetClassID(nsCID **aClassID) {
+nsSimpleURI::GetClassID(nsCID** aClassID) {
   // Make sure to modify any subclasses as needed if this ever
   // changes to not call the virtual GetClassIDNoAlloc.
-  *aClassID = (nsCID *)moz_xmalloc(sizeof(nsCID));
+  *aClassID = (nsCID*)moz_xmalloc(sizeof(nsCID));
   return GetClassIDNoAlloc(*aClassID);
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetFlags(uint32_t *aFlags) {
+nsSimpleURI::GetFlags(uint32_t* aFlags) {
   *aFlags = nsIClassInfo::MAIN_THREAD_ONLY;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) {
+nsSimpleURI::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc) {
   *aClassIDNoAlloc = kSimpleURICID;
   return NS_OK;
 }
@@ -671,18 +671,18 @@ size_t nsSimpleURI::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetFilePath(nsACString &aFilePath) {
+nsSimpleURI::GetFilePath(nsACString& aFilePath) {
   aFilePath = mPath;
   return NS_OK;
 }
 
-nsresult nsSimpleURI::SetFilePath(const nsACString &aFilePath) {
+nsresult nsSimpleURI::SetFilePath(const nsACString& aFilePath) {
   if (mPath.IsEmpty() || mPath.First() != '/') {
     // cannot-be-a-base
     return NS_ERROR_MALFORMED_URI;
   }
-  const char *current = aFilePath.BeginReading();
-  const char *end = aFilePath.EndReading();
+  const char* current = aFilePath.BeginReading();
+  const char* end = aFilePath.EndReading();
 
   // Only go up to the first ? or # symbol
   for (; current < end; ++current) {
@@ -695,7 +695,7 @@ nsresult nsSimpleURI::SetFilePath(const nsACString &aFilePath) {
 }
 
 NS_IMETHODIMP
-nsSimpleURI::GetQuery(nsACString &aQuery) {
+nsSimpleURI::GetQuery(nsACString& aQuery) {
   if (!mIsQueryValid) {
     MOZ_ASSERT(mQuery.IsEmpty(), "mIsQueryValid/mQuery invariant broken");
     aQuery.Truncate();
@@ -705,7 +705,7 @@ nsSimpleURI::GetQuery(nsACString &aQuery) {
   return NS_OK;
 }
 
-nsresult nsSimpleURI::SetQuery(const nsACString &aQuery) {
+nsresult nsSimpleURI::SetQuery(const nsACString& aQuery) {
   nsAutoCString query;
   nsresult rv = NS_EscapeURL(aQuery, esc_OnlyNonASCII, query, fallible);
   if (NS_FAILED(rv)) {
@@ -731,8 +731,8 @@ nsresult nsSimpleURI::SetQuery(const nsACString &aQuery) {
   return NS_OK;
 }
 
-nsresult nsSimpleURI::SetQueryWithEncoding(const nsACString &aQuery,
-                                           const Encoding *aEncoding) {
+nsresult nsSimpleURI::SetQueryWithEncoding(const nsACString& aQuery,
+                                           const Encoding* aEncoding) {
   return SetQuery(aQuery);
 }
 
@@ -741,7 +741,7 @@ NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsSimpleURI::Mutator, nsIURISetters,
                                 nsIURIMutator, nsISerializable)
 
 NS_IMETHODIMP
-nsSimpleURI::Mutate(nsIURIMutator **aMutator) {
+nsSimpleURI::Mutate(nsIURIMutator** aMutator) {
   RefPtr mutator = new nsSimpleURI::Mutator();
   nsresult rv = mutator->InitFromURI(this);
   if (NS_FAILED(rv)) {
diff --git a/netwerk/base/nsSimpleURI.h b/netwerk/base/nsSimpleURI.h
index 94cdaa60e0cde..6ac806aab08a4 100644
--- a/netwerk/base/nsSimpleURI.h
+++ b/netwerk/base/nsSimpleURI.h
@@ -38,11 +38,11 @@ class nsSimpleURI : public nsIURI,
   NS_DECL_NSISERIALIZABLE
   NS_DECL_NSICLASSINFO
 
-  static already_AddRefed From(nsIURI *aURI);
+  static already_AddRefed From(nsIURI* aURI);
 
   // nsSimpleURI methods:
 
-  bool Equals(nsSimpleURI *aOther) { return EqualsInternal(aOther, eHonorRef); }
+  bool Equals(nsSimpleURI* aOther) { return EqualsInternal(aOther, eHonorRef); }
 
   // nsISizeOf
   // Among the sub-classes that inherit (directly or indirectly) from
@@ -58,51 +58,51 @@ class nsSimpleURI : public nsIURI,
   // enum used in a few places to specify how .ref attribute should be handled
   enum RefHandlingEnum { eIgnoreRef, eHonorRef, eReplaceRef };
 
-  virtual nsresult Clone(nsIURI **aURI);
-  virtual nsresult SetSpecInternal(const nsACString &input);
-  virtual nsresult SetScheme(const nsACString &input);
-  virtual nsresult SetUserPass(const nsACString &input);
-  nsresult SetUsername(const nsACString &input);
-  virtual nsresult SetPassword(const nsACString &input);
-  virtual nsresult SetHostPort(const nsACString &aValue);
-  virtual nsresult SetHost(const nsACString &input);
+  virtual nsresult Clone(nsIURI** aURI);
+  virtual nsresult SetSpecInternal(const nsACString& input);
+  virtual nsresult SetScheme(const nsACString& input);
+  virtual nsresult SetUserPass(const nsACString& input);
+  nsresult SetUsername(const nsACString& input);
+  virtual nsresult SetPassword(const nsACString& input);
+  virtual nsresult SetHostPort(const nsACString& aValue);
+  virtual nsresult SetHost(const nsACString& input);
   virtual nsresult SetPort(int32_t port);
-  virtual nsresult SetPathQueryRef(const nsACString &input);
-  virtual nsresult SetRef(const nsACString &input);
-  virtual nsresult SetFilePath(const nsACString &input);
-  virtual nsresult SetQuery(const nsACString &input);
-  virtual nsresult SetQueryWithEncoding(const nsACString &input,
-                                        const Encoding *encoding);
-  nsresult ReadPrivate(nsIObjectInputStream *stream);
+  virtual nsresult SetPathQueryRef(const nsACString& input);
+  virtual nsresult SetRef(const nsACString& input);
+  virtual nsresult SetFilePath(const nsACString& input);
+  virtual nsresult SetQuery(const nsACString& input);
+  virtual nsresult SetQueryWithEncoding(const nsACString& input,
+                                        const Encoding* encoding);
+  nsresult ReadPrivate(nsIObjectInputStream* stream);
 
   // Helper to share code between Equals methods.
-  virtual nsresult EqualsInternal(nsIURI *other,
+  virtual nsresult EqualsInternal(nsIURI* other,
                                   RefHandlingEnum refHandlingMode,
-                                  bool *result);
+                                  bool* result);
 
   // Helper to be used by inherited classes who want to test
   // equality given an assumed nsSimpleURI.  This must NOT check
   // the passed-in other for QI to our CID.
-  bool EqualsInternal(nsSimpleURI *otherUri, RefHandlingEnum refHandlingMode);
+  bool EqualsInternal(nsSimpleURI* otherUri, RefHandlingEnum refHandlingMode);
 
   // Used by StartClone (and versions of StartClone in subclasses) to
   // handle the ref in the right way for clones.
-  void SetRefOnClone(nsSimpleURI *url, RefHandlingEnum refHandlingMode,
-                     const nsACString &newRef);
+  void SetRefOnClone(nsSimpleURI* url, RefHandlingEnum refHandlingMode,
+                     const nsACString& newRef);
 
   // NOTE: This takes the refHandlingMode as an argument because
   // nsSimpleNestedURI's specialized version needs to know how to clone
   // its inner URI.
-  virtual nsSimpleURI *StartClone(RefHandlingEnum refHandlingMode,
-                                  const nsACString &newRef);
+  virtual nsSimpleURI* StartClone(RefHandlingEnum refHandlingMode,
+                                  const nsACString& newRef);
 
   // Helper to share code between Clone methods.
   virtual nsresult CloneInternal(RefHandlingEnum refHandlingMode,
-                                 const nsACString &newRef, nsIURI **clone);
+                                 const nsACString& newRef, nsIURI** clone);
 
-  nsresult SetPathQueryRefEscaped(const nsACString &aPath, bool aNeedsEscape);
+  nsresult SetPathQueryRefEscaped(const nsACString& aPath, bool aNeedsEscape);
 
-  bool Deserialize(const mozilla::ipc::URIParams &);
+  bool Deserialize(const mozilla::ipc::URIParams&);
 
   nsCString mScheme;
   nsCString mPath;  // NOTE: mPath does not include ref, as an optimization
@@ -122,11 +122,11 @@ class nsSimpleURI : public nsIURI,
     NS_DEFINE_NSIMUTATOR_COMMON
 
     NS_IMETHOD
-    Write(nsIObjectOutputStream *aOutputStream) override {
+    Write(nsIObjectOutputStream* aOutputStream) override {
       return NS_ERROR_NOT_IMPLEMENTED;
     }
 
-    MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream *aStream) override {
+    MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream* aStream) override {
       return InitFromInputStream(aStream);
     }
 
diff --git a/netwerk/base/nsSocketTransport2.cpp b/netwerk/base/nsSocketTransport2.cpp
index 6b8808b6e0f14..b38fe49c6a6a6 100644
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -77,8 +77,8 @@ namespace net {
 
 class nsSocketEvent : public Runnable {
  public:
-  nsSocketEvent(nsSocketTransport *transport, uint32_t type,
-                nsresult status = NS_OK, nsISupports *param = nullptr)
+  nsSocketEvent(nsSocketTransport* transport, uint32_t type,
+                nsresult status = NS_OK, nsISupports* param = nullptr)
       : Runnable("net::nsSocketEvent"),
         mTransport(transport),
         mType(type),
@@ -112,7 +112,7 @@ static PRErrorCode RandomizeConnectError(PRErrorCode code) {
   if (n > RAND_MAX / 2) {
     struct {
       PRErrorCode err_code;
-      const char *err_name;
+      const char* err_name;
     } errors[] = {
         //
         // These errors should be recoverable provided there is another
@@ -247,7 +247,7 @@ nsresult ErrorAccordingToNSPR(PRErrorCode errorCode) {
 // socket input stream impl
 //-----------------------------------------------------------------------------
 
-nsSocketInputStream::nsSocketInputStream(nsSocketTransport *trans)
+nsSocketInputStream::nsSocketInputStream(nsSocketTransport* trans)
     : mTransport(trans),
       mReaderRefCnt(0),
       mCondition(NS_OK),
@@ -301,12 +301,12 @@ NS_IMETHODIMP
 nsSocketInputStream::Close() { return CloseWithStatus(NS_BASE_STREAM_CLOSED); }
 
 NS_IMETHODIMP
-nsSocketInputStream::Available(uint64_t *avail) {
+nsSocketInputStream::Available(uint64_t* avail) {
   SOCKET_LOG(("nsSocketInputStream::Available [this=%p]\n", this));
 
   *avail = 0;
 
-  PRFileDesc *fd;
+  PRFileDesc* fd;
   {
     MutexAutoLock lock(mTransport->mLock);
 
@@ -353,12 +353,12 @@ nsSocketInputStream::Available(uint64_t *avail) {
 }
 
 NS_IMETHODIMP
-nsSocketInputStream::Read(char *buf, uint32_t count, uint32_t *countRead) {
+nsSocketInputStream::Read(char* buf, uint32_t count, uint32_t* countRead) {
   SOCKET_LOG(("nsSocketInputStream::Read [this=%p count=%u]\n", this, count));
 
   *countRead = 0;
 
-  PRFileDesc *fd = nullptr;
+  PRFileDesc* fd = nullptr;
   {
     MutexAutoLock lock(mTransport->mLock);
 
@@ -406,14 +406,14 @@ nsSocketInputStream::Read(char *buf, uint32_t count, uint32_t *countRead) {
 }
 
 NS_IMETHODIMP
-nsSocketInputStream::ReadSegments(nsWriteSegmentFun writer, void *closure,
-                                  uint32_t count, uint32_t *countRead) {
+nsSocketInputStream::ReadSegments(nsWriteSegmentFun writer, void* closure,
+                                  uint32_t count, uint32_t* countRead) {
   // socket stream is unbuffered
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsSocketInputStream::IsNonBlocking(bool *nonblocking) {
+nsSocketInputStream::IsNonBlocking(bool* nonblocking) {
   *nonblocking = true;
   return NS_OK;
 }
@@ -440,8 +440,8 @@ nsSocketInputStream::CloseWithStatus(nsresult reason) {
 }
 
 NS_IMETHODIMP
-nsSocketInputStream::AsyncWait(nsIInputStreamCallback *callback, uint32_t flags,
-                               uint32_t amount, nsIEventTarget *target) {
+nsSocketInputStream::AsyncWait(nsIInputStreamCallback* callback, uint32_t flags,
+                               uint32_t amount, nsIEventTarget* target) {
   SOCKET_LOG(("nsSocketInputStream::AsyncWait [this=%p]\n", this));
 
   bool hasError = false;
@@ -478,7 +478,7 @@ nsSocketInputStream::AsyncWait(nsIInputStreamCallback *callback, uint32_t flags,
 // socket output stream impl
 //-----------------------------------------------------------------------------
 
-nsSocketOutputStream::nsSocketOutputStream(nsSocketTransport *trans)
+nsSocketOutputStream::nsSocketOutputStream(nsSocketTransport* trans)
     : mTransport(trans),
       mWriterRefCnt(0),
       mCondition(NS_OK),
@@ -536,8 +536,8 @@ NS_IMETHODIMP
 nsSocketOutputStream::Flush() { return NS_OK; }
 
 NS_IMETHODIMP
-nsSocketOutputStream::Write(const char *buf, uint32_t count,
-                            uint32_t *countWritten) {
+nsSocketOutputStream::Write(const char* buf, uint32_t count,
+                            uint32_t* countWritten) {
   SOCKET_LOG(("nsSocketOutputStream::Write [this=%p count=%u]\n", this, count));
 
   *countWritten = 0;
@@ -545,7 +545,7 @@ nsSocketOutputStream::Write(const char *buf, uint32_t count,
   // A write of 0 bytes can be used to force the initial SSL handshake, so do
   // not reject that.
 
-  PRFileDesc *fd = nullptr;
+  PRFileDesc* fd = nullptr;
   bool fastOpenInProgress;
   {
     MutexAutoLock lock(mTransport->mLock);
@@ -617,27 +617,27 @@ nsSocketOutputStream::Write(const char *buf, uint32_t count,
 }
 
 NS_IMETHODIMP
-nsSocketOutputStream::WriteSegments(nsReadSegmentFun reader, void *closure,
-                                    uint32_t count, uint32_t *countRead) {
+nsSocketOutputStream::WriteSegments(nsReadSegmentFun reader, void* closure,
+                                    uint32_t count, uint32_t* countRead) {
   // socket stream is unbuffered
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult nsSocketOutputStream::WriteFromSegments(
-    nsIInputStream *input, void *closure, const char *fromSegment,
-    uint32_t offset, uint32_t count, uint32_t *countRead) {
-  nsSocketOutputStream *self = (nsSocketOutputStream *)closure;
+    nsIInputStream* input, void* closure, const char* fromSegment,
+    uint32_t offset, uint32_t count, uint32_t* countRead) {
+  nsSocketOutputStream* self = (nsSocketOutputStream*)closure;
   return self->Write(fromSegment, count, countRead);
 }
 
 NS_IMETHODIMP
-nsSocketOutputStream::WriteFrom(nsIInputStream *stream, uint32_t count,
-                                uint32_t *countRead) {
+nsSocketOutputStream::WriteFrom(nsIInputStream* stream, uint32_t count,
+                                uint32_t* countRead) {
   return stream->ReadSegments(WriteFromSegments, this, count, countRead);
 }
 
 NS_IMETHODIMP
-nsSocketOutputStream::IsNonBlocking(bool *nonblocking) {
+nsSocketOutputStream::IsNonBlocking(bool* nonblocking) {
   *nonblocking = true;
   return NS_OK;
 }
@@ -664,9 +664,9 @@ nsSocketOutputStream::CloseWithStatus(nsresult reason) {
 }
 
 NS_IMETHODIMP
-nsSocketOutputStream::AsyncWait(nsIOutputStreamCallback *callback,
+nsSocketOutputStream::AsyncWait(nsIOutputStreamCallback* callback,
                                 uint32_t flags, uint32_t amount,
-                                nsIEventTarget *target) {
+                                nsIEventTarget* target) {
   SOCKET_LOG(("nsSocketOutputStream::AsyncWait [this=%p]\n", this));
 
   {
@@ -762,11 +762,11 @@ void nsSocketTransport::CleanupTypes() {
   mTypeCount = 0;
 }
 
-nsresult nsSocketTransport::Init(const char **types, uint32_t typeCount,
-                                 const nsACString &host, uint16_t port,
-                                 const nsACString &hostRoute,
+nsresult nsSocketTransport::Init(const char** types, uint32_t typeCount,
+                                 const nsACString& host, uint16_t port,
+                                 const nsACString& hostRoute,
                                  uint16_t portRoute,
-                                 nsIProxyInfo *givenProxyInfo) {
+                                 nsIProxyInfo* givenProxyInfo) {
   nsCOMPtr proxyInfo;
   if (givenProxyInfo) {
     proxyInfo = do_QueryInterface(givenProxyInfo);
@@ -789,7 +789,7 @@ nsresult nsSocketTransport::Init(const char **types, uint32_t typeCount,
     mHttpsProxy = proxyInfo->IsHTTPS();
   }
 
-  const char *proxyType = nullptr;
+  const char* proxyType = nullptr;
   mProxyInfo = proxyInfo;
   if (proxyInfo) {
     mProxyPort = proxyInfo->Port();
@@ -818,7 +818,7 @@ nsresult nsSocketTransport::Init(const char **types, uint32_t typeCount,
   nsCOMPtr spserv =
       nsSocketProviderService::GetOrCreate();
 
-  mTypes = (char **)malloc(mTypeCount * sizeof(char *));
+  mTypes = (char**)malloc(mTypeCount * sizeof(char*));
   if (!mTypes) return NS_ERROR_OUT_OF_MEMORY;
 
   // now verify that each socket type has a registered socket provider.
@@ -858,11 +858,11 @@ nsresult nsSocketTransport::Init(const char **types, uint32_t typeCount,
 }
 
 #if defined(XP_UNIX)
-nsresult nsSocketTransport::InitWithFilename(const char *filename) {
+nsresult nsSocketTransport::InitWithFilename(const char* filename) {
   return InitWithName(filename, strlen(filename));
 }
 
-nsresult nsSocketTransport::InitWithName(const char *name, size_t length) {
+nsresult nsSocketTransport::InitWithName(const char* name, size_t length) {
   if (length > sizeof(mNetAddr.local.path) - 1) {
     return NS_ERROR_FILE_NAME_TOO_LONG;
   }
@@ -891,8 +891,8 @@ nsresult nsSocketTransport::InitWithName(const char *name, size_t length) {
 }
 #endif
 
-nsresult nsSocketTransport::InitWithConnectedSocket(PRFileDesc *fd,
-                                                    const NetAddr *addr) {
+nsresult nsSocketTransport::InitWithConnectedSocket(PRFileDesc* fd,
+                                                    const NetAddr* addr) {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
   NS_ASSERTION(!mFD.IsInitialized(), "already initialized");
 
@@ -939,15 +939,15 @@ nsresult nsSocketTransport::InitWithConnectedSocket(PRFileDesc *fd,
   return PostEvent(MSG_RETRY_INIT_SOCKET);
 }
 
-nsresult nsSocketTransport::InitWithConnectedSocket(PRFileDesc *aFD,
-                                                    const NetAddr *aAddr,
-                                                    nsISupports *aSecInfo) {
+nsresult nsSocketTransport::InitWithConnectedSocket(PRFileDesc* aFD,
+                                                    const NetAddr* aAddr,
+                                                    nsISupports* aSecInfo) {
   mSecInfo = aSecInfo;
   return InitWithConnectedSocket(aFD, aAddr);
 }
 
 nsresult nsSocketTransport::PostEvent(uint32_t type, nsresult status,
-                                      nsISupports *param) {
+                                      nsISupports* param) {
   SOCKET_LOG(("nsSocketTransport::PostEvent [this=%p type=%u status=%" PRIx32
               " param=%p]\n",
               this, type, static_cast(status), param));
@@ -1100,8 +1100,8 @@ nsresult nsSocketTransport::ResolveHost() {
   return rv;
 }
 
-nsresult nsSocketTransport::BuildSocket(PRFileDesc *&fd, bool &proxyTransparent,
-                                        bool &usingSSL) {
+nsresult nsSocketTransport::BuildSocket(PRFileDesc*& fd, bool& proxyTransparent,
+                                        bool& usingSSL) {
   SOCKET_LOG(("nsSocketTransport::BuildSocket [this=%p]\n", this));
 
   nsresult rv;
@@ -1126,7 +1126,7 @@ nsresult nsSocketTransport::BuildSocket(PRFileDesc *&fd, bool &proxyTransparent,
     // by setting host to mOriginHost, instead of mHost we send the
     // SocketProvider (e.g. PSM) the origin hostname but can still do DNS
     // on an explicit alternate service host name
-    const char *host = mOriginHost.get();
+    const char* host = mOriginHost.get();
     int32_t port = (int32_t)mOriginPort;
     nsCOMPtr proxyInfo = mProxyInfo;
     uint32_t controlFlags = 0;
@@ -1166,7 +1166,7 @@ nsresult nsSocketTransport::BuildSocket(PRFileDesc *&fd, bool &proxyTransparent,
         // taken care of via DNS. However, SOCKS is a special case as there is
         // no DNS. in the case of SOCKS and PSM the PSM is a separate layer
         // and receives the origin name.
-        const char *socketProviderHost = host;
+        const char* socketProviderHost = host;
         int32_t socketProviderPort = port;
         if (mProxyTransparentResolvesHost &&
             (!strcmp(mTypes[0], "socks") || !strcmp(mTypes[0], "socks4"))) {
@@ -1339,7 +1339,7 @@ nsresult nsSocketTransport::InitiateSocket() {
   //
   // create new socket fd, push io layers, etc.
   //
-  PRFileDesc *fd;
+  PRFileDesc* fd;
   bool proxyTransparent;
   bool usingSSL;
 
@@ -1486,7 +1486,7 @@ nsresult nsSocketTransport::InitiateSocket() {
 #ifdef XP_WIN
   // Find the real tcp socket and set non-blocking once again!
   // Bug 1158189.
-  PRFileDesc *bottom = PR_GetIdentitiesLayer(fd, PR_NSPR_IO_LAYER);
+  PRFileDesc* bottom = PR_GetIdentitiesLayer(fd, PR_NSPR_IO_LAYER);
   if (bottom) {
     PROsfd osfd = PR_FileDesc2NativeHandle(bottom);
     u_long nonblocking = 1;
@@ -1937,7 +1937,7 @@ void nsSocketTransport::OnSocketConnected() {
   SendStatus(NS_NET_STATUS_CONNECTED_TO);
 }
 
-void nsSocketTransport::SetSocketName(PRFileDesc *fd) {
+void nsSocketTransport::SetSocketName(PRFileDesc* fd) {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
   if (mSelfAddrIsSet) {
     return;
@@ -1951,7 +1951,7 @@ void nsSocketTransport::SetSocketName(PRFileDesc *fd) {
   }
 }
 
-PRFileDesc *nsSocketTransport::GetFD_Locked() {
+PRFileDesc* nsSocketTransport::GetFD_Locked() {
   mLock.AssertCurrentThreadOwns();
 
   // mFD is not available to the streams while disconnected.
@@ -1962,7 +1962,7 @@ PRFileDesc *nsSocketTransport::GetFD_Locked() {
   return mFD;
 }
 
-PRFileDesc *nsSocketTransport::GetFD_LockedAlsoDuringFastOpen() {
+PRFileDesc* nsSocketTransport::GetFD_LockedAlsoDuringFastOpen() {
   mLock.AssertCurrentThreadOwns();
 
   // mFD is not available to the streams while disconnected.
@@ -1984,7 +1984,7 @@ bool nsSocketTransport::FastOpenInProgress() {
 
 class ThunkPRClose : public Runnable {
  public:
-  explicit ThunkPRClose(PRFileDesc *fd)
+  explicit ThunkPRClose(PRFileDesc* fd)
       : Runnable("net::ThunkPRClose"), mFD(fd) {}
 
   NS_IMETHOD Run() override {
@@ -1994,10 +1994,10 @@ class ThunkPRClose : public Runnable {
   }
 
  private:
-  PRFileDesc *mFD;
+  PRFileDesc* mFD;
 };
 
-void STS_PRCloseOnSocketTransport(PRFileDesc *fd, bool lingerPolarity,
+void STS_PRCloseOnSocketTransport(PRFileDesc* fd, bool lingerPolarity,
                                   int16_t lingerTimeout) {
   if (gSocketTransportService) {
     // Can't PR_Close() a socket off STS thread. Thunk it to STS to die
@@ -2008,7 +2008,7 @@ void STS_PRCloseOnSocketTransport(PRFileDesc *fd, bool lingerPolarity,
   }
 }
 
-void nsSocketTransport::ReleaseFD_Locked(PRFileDesc *fd) {
+void nsSocketTransport::ReleaseFD_Locked(PRFileDesc* fd) {
   mLock.AssertCurrentThreadOwns();
 
   NS_ASSERTION(mFD == fd, "wrong fd");
@@ -2044,7 +2044,7 @@ void nsSocketTransport::ReleaseFD_Locked(PRFileDesc *fd) {
 // socket event handler impl
 
 void nsSocketTransport::OnSocketEvent(uint32_t type, nsresult status,
-                                      nsISupports *param) {
+                                      nsISupports* param) {
   SOCKET_LOG(
       ("nsSocketTransport::OnSocketEvent [this=%p type=%u status=%" PRIx32
        " param=%p]\n",
@@ -2159,7 +2159,7 @@ void nsSocketTransport::OnSocketEvent(uint32_t type, nsresult status,
 //-----------------------------------------------------------------------------
 // socket handler impl
 
-void nsSocketTransport::OnSocketReady(PRFileDesc *fd, int16_t outFlags) {
+void nsSocketTransport::OnSocketReady(PRFileDesc* fd, int16_t outFlags) {
   SOCKET_LOG1(("nsSocketTransport::OnSocketReady [this=%p outFlags=%hd]\n",
                this, outFlags));
 
@@ -2228,7 +2228,7 @@ void nsSocketTransport::OnSocketReady(PRFileDesc *fd, int16_t outFlags) {
       BOOL option = 0;
       int len = sizeof(option);
       PRInt32 rv = getsockopt((SOCKET)osfd, IPPROTO_TCP, TCP_FASTOPEN,
-                              (char *)&option, &len);
+                              (char*)&option, &len);
       if (!rv && !option) {
         // On error, I will let the normal necko paths pickup the error.
         mFastOpenCallback->SetFastOpenStatus(TFO_DATA_COOKIE_NOT_ACCEPTED);
@@ -2312,7 +2312,7 @@ void nsSocketTransport::OnSocketReady(PRFileDesc *fd, int16_t outFlags) {
 }
 
 // called on the socket thread only
-void nsSocketTransport::OnSocketDetached(PRFileDesc *fd) {
+void nsSocketTransport::OnSocketDetached(PRFileDesc* fd) {
   SOCKET_LOG(("nsSocketTransport::OnSocketDetached [this=%p cond=%" PRIx32
               "]\n",
               this, static_cast(mCondition)));
@@ -2418,7 +2418,7 @@ void nsSocketTransport::OnSocketDetached(PRFileDesc *fd) {
   }
 }
 
-void nsSocketTransport::IsLocal(bool *aIsLocal) {
+void nsSocketTransport::IsLocal(bool* aIsLocal) {
   {
     MutexAutoLock lock(mLock);
 
@@ -2444,7 +2444,7 @@ NS_IMPL_CI_INTERFACE_GETTER(nsSocketTransport, nsISocketTransport, nsITransport,
 
 NS_IMETHODIMP
 nsSocketTransport::OpenInputStream(uint32_t flags, uint32_t segsize,
-                                   uint32_t segcount, nsIInputStream **result) {
+                                   uint32_t segcount, nsIInputStream** result) {
   SOCKET_LOG(
       ("nsSocketTransport::OpenInputStream [this=%p flags=%x]\n", this, flags));
 
@@ -2488,7 +2488,7 @@ nsSocketTransport::OpenInputStream(uint32_t flags, uint32_t segsize,
 NS_IMETHODIMP
 nsSocketTransport::OpenOutputStream(uint32_t flags, uint32_t segsize,
                                     uint32_t segcount,
-                                    nsIOutputStream **result) {
+                                    nsIOutputStream** result) {
   SOCKET_LOG(("nsSocketTransport::OpenOutputStream [this=%p flags=%x]\n", this,
               flags));
 
@@ -2548,21 +2548,21 @@ nsSocketTransport::Close(nsresult reason) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetSecurityInfo(nsISupports **secinfo) {
+nsSocketTransport::GetSecurityInfo(nsISupports** secinfo) {
   MutexAutoLock lock(mLock);
   NS_IF_ADDREF(*secinfo = mSecInfo);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetSecurityCallbacks(nsIInterfaceRequestor **callbacks) {
+nsSocketTransport::GetSecurityCallbacks(nsIInterfaceRequestor** callbacks) {
   MutexAutoLock lock(mLock);
   NS_IF_ADDREF(*callbacks = mCallbacks);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::SetSecurityCallbacks(nsIInterfaceRequestor *callbacks) {
+nsSocketTransport::SetSecurityCallbacks(nsIInterfaceRequestor* callbacks) {
   nsCOMPtr threadsafeCallbacks;
   NS_NewNotificationCallbacksAggregation(callbacks, nullptr,
                                          GetCurrentThreadEventTarget(),
@@ -2586,8 +2586,8 @@ nsSocketTransport::SetSecurityCallbacks(nsIInterfaceRequestor *callbacks) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::SetEventSink(nsITransportEventSink *sink,
-                                nsIEventTarget *target) {
+nsSocketTransport::SetEventSink(nsITransportEventSink* sink,
+                                nsIEventTarget* target) {
   nsCOMPtr temp;
   if (target) {
     nsresult rv =
@@ -2602,7 +2602,7 @@ nsSocketTransport::SetEventSink(nsITransportEventSink *sink,
 }
 
 NS_IMETHODIMP
-nsSocketTransport::IsAlive(bool *result) {
+nsSocketTransport::IsAlive(bool* result) {
   *result = false;
 
   // During Fast Open we need to return true here.
@@ -2629,20 +2629,20 @@ nsSocketTransport::IsAlive(bool *result) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetHost(nsACString &host) {
+nsSocketTransport::GetHost(nsACString& host) {
   host = SocketHost();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetPort(int32_t *port) {
+nsSocketTransport::GetPort(int32_t* port) {
   *port = (int32_t)SocketPort();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSocketTransport::GetScriptableOriginAttributes(
-    JSContext *aCx, JS::MutableHandle aOriginAttributes) {
+    JSContext* aCx, JS::MutableHandle aOriginAttributes) {
   if (NS_WARN_IF(!ToJSValue(aCx, mOriginAttributes, aOriginAttributes))) {
     return NS_ERROR_FAILURE;
   }
@@ -2651,7 +2651,7 @@ nsSocketTransport::GetScriptableOriginAttributes(
 
 NS_IMETHODIMP
 nsSocketTransport::SetScriptableOriginAttributes(
-    JSContext *aCx, JS::Handle aOriginAttributes) {
+    JSContext* aCx, JS::Handle aOriginAttributes) {
   MutexAutoLock lock(mLock);
   NS_ENSURE_FALSE(mFD.IsInitialized(), NS_ERROR_FAILURE);
 
@@ -2665,14 +2665,14 @@ nsSocketTransport::SetScriptableOriginAttributes(
 }
 
 nsresult nsSocketTransport::GetOriginAttributes(
-    OriginAttributes *aOriginAttributes) {
+    OriginAttributes* aOriginAttributes) {
   NS_ENSURE_ARG(aOriginAttributes);
   *aOriginAttributes = mOriginAttributes;
   return NS_OK;
 }
 
 nsresult nsSocketTransport::SetOriginAttributes(
-    const OriginAttributes &aOriginAttributes) {
+    const OriginAttributes& aOriginAttributes) {
   MutexAutoLock lock(mLock);
   NS_ENSURE_FALSE(mFD.IsInitialized(), NS_ERROR_FAILURE);
 
@@ -2681,7 +2681,7 @@ nsresult nsSocketTransport::SetOriginAttributes(
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetPeerAddr(NetAddr *addr) {
+nsSocketTransport::GetPeerAddr(NetAddr* addr) {
   // once we are in the connected state, mNetAddr will not change.
   // so if we can verify that we are in the connected state, then
   // we can freely access mNetAddr from any thread without being
@@ -2700,7 +2700,7 @@ nsSocketTransport::GetPeerAddr(NetAddr *addr) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetSelfAddr(NetAddr *addr) {
+nsSocketTransport::GetSelfAddr(NetAddr* addr) {
   // once we are in the connected state, mSelfAddr will not change.
   // so if we can verify that we are in the connected state, then
   // we can freely access mSelfAddr from any thread without being
@@ -2719,7 +2719,7 @@ nsSocketTransport::GetSelfAddr(NetAddr *addr) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::Bind(NetAddr *aLocalAddr) {
+nsSocketTransport::Bind(NetAddr* aLocalAddr) {
   NS_ENSURE_ARG(aLocalAddr);
 
   MutexAutoLock lock(mLock);
@@ -2734,7 +2734,7 @@ nsSocketTransport::Bind(NetAddr *aLocalAddr) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetScriptablePeerAddr(nsINetAddr **addr) {
+nsSocketTransport::GetScriptablePeerAddr(nsINetAddr** addr) {
   NetAddr rawAddr;
 
   nsresult rv;
@@ -2747,7 +2747,7 @@ nsSocketTransport::GetScriptablePeerAddr(nsINetAddr **addr) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetScriptableSelfAddr(nsINetAddr **addr) {
+nsSocketTransport::GetScriptableSelfAddr(nsINetAddr** addr) {
   NetAddr rawAddr;
 
   nsresult rv;
@@ -2760,7 +2760,7 @@ nsSocketTransport::GetScriptableSelfAddr(nsINetAddr **addr) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetTimeout(uint32_t type, uint32_t *value) {
+nsSocketTransport::GetTimeout(uint32_t type, uint32_t* value) {
   NS_ENSURE_ARG_MAX(type, nsISocketTransport::TIMEOUT_READ_WRITE);
   *value = (uint32_t)mTimeouts[type];
   return NS_OK;
@@ -2808,13 +2808,13 @@ nsSocketTransport::SetQoSBits(uint8_t aQoSBits) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetQoSBits(uint8_t *aQoSBits) {
+nsSocketTransport::GetQoSBits(uint8_t* aQoSBits) {
   *aQoSBits = mQoSBits;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetRecvBufferSize(uint32_t *aSize) {
+nsSocketTransport::GetRecvBufferSize(uint32_t* aSize) {
   PRFileDescAutoLock fd(this, false);
   if (!fd.IsInitialized()) return NS_ERROR_NOT_CONNECTED;
 
@@ -2830,7 +2830,7 @@ nsSocketTransport::GetRecvBufferSize(uint32_t *aSize) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetSendBufferSize(uint32_t *aSize) {
+nsSocketTransport::GetSendBufferSize(uint32_t* aSize) {
   PRFileDescAutoLock fd(this, false);
   if (!fd.IsInitialized()) return NS_ERROR_NOT_CONNECTED;
 
@@ -2874,7 +2874,7 @@ nsSocketTransport::SetSendBufferSize(uint32_t aSize) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec,
+nsSocketTransport::OnLookupComplete(nsICancelable* request, nsIDNSRecord* rec,
                                     nsresult status) {
   SOCKET_LOG(("nsSocketTransport::OnLookupComplete: this=%p status %" PRIx32
               ".",
@@ -2882,7 +2882,7 @@ nsSocketTransport::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec,
   if (NS_FAILED(status) && mDNSTxtRequest) {
     mDNSTxtRequest->Cancel(NS_ERROR_ABORT);
   } else if (NS_SUCCEEDED(status)) {
-    mDNSRecord = static_cast(rec);
+    mDNSRecord = static_cast(rec);
   }
 
   // flag host lookup complete for the benefit of the ResolveHost method.
@@ -2911,8 +2911,8 @@ nsSocketTransport::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec,
 }
 
 NS_IMETHODIMP
-nsSocketTransport::OnLookupByTypeComplete(nsICancelable *request,
-                                          nsIDNSByTypeRecord *txtResponse,
+nsSocketTransport::OnLookupByTypeComplete(nsICancelable* request,
+                                          nsIDNSByTypeRecord* txtResponse,
                                           nsresult status) {
   SOCKET_LOG(
       ("nsSocketTransport::OnLookupByTypeComplete: "
@@ -2952,7 +2952,7 @@ nsSocketTransport::OnLookupByTypeComplete(nsICancelable *request,
 
 // nsIInterfaceRequestor
 NS_IMETHODIMP
-nsSocketTransport::GetInterface(const nsIID &iid, void **result) {
+nsSocketTransport::GetInterface(const nsIID& iid, void** result) {
   if (iid.Equals(NS_GET_IID(nsIDNSRecord))) {
     return mDNSRecord ? mDNSRecord->QueryInterface(iid, result)
                       : NS_ERROR_NO_INTERFACE;
@@ -2961,47 +2961,47 @@ nsSocketTransport::GetInterface(const nsIID &iid, void **result) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetInterfaces(nsTArray &array) {
+nsSocketTransport::GetInterfaces(nsTArray& array) {
   return NS_CI_INTERFACE_GETTER_NAME(nsSocketTransport)(array);
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetScriptableHelper(nsIXPCScriptable **_retval) {
+nsSocketTransport::GetScriptableHelper(nsIXPCScriptable** _retval) {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetContractID(nsACString &aContractID) {
+nsSocketTransport::GetContractID(nsACString& aContractID) {
   aContractID.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetClassDescription(nsACString &aClassDescription) {
+nsSocketTransport::GetClassDescription(nsACString& aClassDescription) {
   aClassDescription.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetClassID(nsCID **aClassID) {
+nsSocketTransport::GetClassID(nsCID** aClassID) {
   *aClassID = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetFlags(uint32_t *aFlags) {
+nsSocketTransport::GetFlags(uint32_t* aFlags) {
   *aFlags = nsIClassInfo::THREADSAFE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) {
+nsSocketTransport::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetConnectionFlags(uint32_t *value) {
+nsSocketTransport::GetConnectionFlags(uint32_t* value) {
   *value = mConnectionFlags;
   return NS_OK;
 }
@@ -3018,7 +3018,7 @@ nsSocketTransport::SetConnectionFlags(uint32_t value) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetTlsFlags(uint32_t *value) {
+nsSocketTransport::GetTlsFlags(uint32_t* value) {
   *value = mTlsFlags;
   return NS_OK;
 }
@@ -3077,7 +3077,7 @@ nsresult nsSocketTransport::SetKeepaliveEnabledInternal(bool aEnable) {
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetKeepaliveEnabled(bool *aResult) {
+nsSocketTransport::GetKeepaliveEnabled(bool* aResult) {
   MOZ_ASSERT(aResult);
 
   *aResult = mKeepaliveEnabled;
@@ -3222,22 +3222,22 @@ nsSocketTransport::SetKeepaliveVals(int32_t aIdleTime, int32_t aRetryInterval) {
 #  include 
 #  include "prenv.h"
 
-static void DumpBytesToFile(const char *path, const char *header,
-                            const char *buf, int32_t n) {
-  FILE *fp = fopen(path, "a");
+static void DumpBytesToFile(const char* path, const char* header,
+                            const char* buf, int32_t n) {
+  FILE* fp = fopen(path, "a");
 
   fprintf(fp, "\n%s [%d bytes]\n", header, n);
 
-  const unsigned char *p;
+  const unsigned char* p;
   while (n) {
-    p = (const unsigned char *)buf;
+    p = (const unsigned char*)buf;
 
     int32_t i, row_max = std::min(16, n);
 
     for (i = 0; i < row_max; ++i) fprintf(fp, "%02x  ", *p++);
     for (i = row_max; i < 16; ++i) fprintf(fp, "    ");
 
-    p = (const unsigned char *)buf;
+    p = (const unsigned char*)buf;
     for (i = 0; i < row_max; ++i, ++p) {
       if (isprint(*p))
         fprintf(fp, "%c", *p);
@@ -3254,8 +3254,8 @@ static void DumpBytesToFile(const char *path, const char *header,
   fclose(fp);
 }
 
-void nsSocketTransport::TraceInBuf(const char *buf, int32_t n) {
-  char *val = PR_GetEnv("NECKO_SOCKET_TRACE_LOG");
+void nsSocketTransport::TraceInBuf(const char* buf, int32_t n) {
+  char* val = PR_GetEnv("NECKO_SOCKET_TRACE_LOG");
   if (!val || !*val) return;
 
   nsAutoCString header;
@@ -3267,8 +3267,8 @@ void nsSocketTransport::TraceInBuf(const char *buf, int32_t n) {
   DumpBytesToFile(val, header.get(), buf, n);
 }
 
-void nsSocketTransport::TraceOutBuf(const char *buf, int32_t n) {
-  char *val = PR_GetEnv("NECKO_SOCKET_TRACE_LOG");
+void nsSocketTransport::TraceOutBuf(const char* buf, int32_t n) {
+  char* val = PR_GetEnv("NECKO_SOCKET_TRACE_LOG");
   if (!val || !*val) return;
 
   nsAutoCString header;
@@ -3282,7 +3282,7 @@ void nsSocketTransport::TraceOutBuf(const char *buf, int32_t n) {
 
 #endif
 
-static void LogNSPRError(const char *aPrefix, const void *aObjPtr) {
+static void LogNSPRError(const char* aPrefix, const void* aObjPtr) {
 #if defined(DEBUG)
   PRErrorCode errCode = PR_GetError();
   int errLen = PR_GetErrorTextLength();
@@ -3321,7 +3321,7 @@ nsresult nsSocketTransport::PRFileDescAutoLock::SetKeepaliveEnabled(
   return NS_OK;
 }
 
-static void LogOSError(const char *aPrefix, const void *aObjPtr) {
+static void LogOSError(const char* aPrefix, const void* aObjPtr) {
 #if defined(DEBUG)
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
@@ -3334,7 +3334,7 @@ static void LogOSError(const char *aPrefix, const void *aObjPtr) {
                 (LPTSTR)&errMessage, 0, NULL);
 #  else
   int errCode = errno;
-  char *errMessage = strerror(errno);
+  char* errMessage = strerror(errno);
 #  endif
   NS_WARNING(nsPrintfCString("%s [%p] OS error[0x%x] %s",
                              aPrefix ? aPrefix : "nsSocketTransport", aObjPtr,
@@ -3448,7 +3448,7 @@ nsresult nsSocketTransport::PRFileDescAutoLock::SetKeepaliveVals(
 #endif
 }
 
-void nsSocketTransport::CloseSocket(PRFileDesc *aFd, bool aTelemetryEnabled) {
+void nsSocketTransport::CloseSocket(PRFileDesc* aFd, bool aTelemetryEnabled) {
 #if defined(XP_WIN)
   AttachShutdownLayer(aFd);
 #endif
@@ -3500,25 +3500,25 @@ void nsSocketTransport::SendPRBlockingTelemetry(
 }
 
 NS_IMETHODIMP
-nsSocketTransport::SetFastOpenCallback(TCPFastOpen *aFastOpen) {
+nsSocketTransport::SetFastOpenCallback(TCPFastOpen* aFastOpen) {
   mFastOpenCallback = aFastOpen;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetFirstRetryError(nsresult *aFirstRetryError) {
+nsSocketTransport::GetFirstRetryError(nsresult* aFirstRetryError) {
   *aFirstRetryError = mFirstRetryError;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetResetIPFamilyPreference(bool *aReset) {
+nsSocketTransport::GetResetIPFamilyPreference(bool* aReset) {
   *aReset = mResetFamilyPreference;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransport::GetEsniUsed(bool *aEsniUsed) {
+nsSocketTransport::GetEsniUsed(bool* aEsniUsed) {
   *aEsniUsed = mEsniUsed;
   return NS_OK;
 }
diff --git a/netwerk/base/nsSocketTransport2.h b/netwerk/base/nsSocketTransport2.h
index 904a241557c0c..e50d9fe636d08 100644
--- a/netwerk/base/nsSocketTransport2.h
+++ b/netwerk/base/nsSocketTransport2.h
@@ -52,7 +52,7 @@ class nsSocketInputStream : public nsIAsyncInputStream {
   NS_DECL_NSIINPUTSTREAM
   NS_DECL_NSIASYNCINPUTSTREAM
 
-  explicit nsSocketInputStream(nsSocketTransport *);
+  explicit nsSocketInputStream(nsSocketTransport*);
   virtual ~nsSocketInputStream() = default;
 
   bool IsReferenced() { return mReaderRefCnt > 0; }
@@ -63,7 +63,7 @@ class nsSocketInputStream : public nsIAsyncInputStream {
   void OnSocketReady(nsresult condition);
 
  private:
-  nsSocketTransport *mTransport;
+  nsSocketTransport* mTransport;
   ThreadSafeAutoRefCnt mReaderRefCnt;
 
   // access to these is protected by mTransport->mLock
@@ -81,7 +81,7 @@ class nsSocketOutputStream : public nsIAsyncOutputStream {
   NS_DECL_NSIOUTPUTSTREAM
   NS_DECL_NSIASYNCOUTPUTSTREAM
 
-  explicit nsSocketOutputStream(nsSocketTransport *);
+  explicit nsSocketOutputStream(nsSocketTransport*);
   virtual ~nsSocketOutputStream() = default;
 
   bool IsReferenced() { return mWriterRefCnt > 0; }
@@ -92,11 +92,11 @@ class nsSocketOutputStream : public nsIAsyncOutputStream {
   void OnSocketReady(nsresult condition);
 
  private:
-  static nsresult WriteFromSegments(nsIInputStream *, void *, const char *,
+  static nsresult WriteFromSegments(nsIInputStream*, void*, const char*,
                                     uint32_t offset, uint32_t count,
-                                    uint32_t *countRead);
+                                    uint32_t* countRead);
 
-  nsSocketTransport *mTransport;
+  nsSocketTransport* mTransport;
   ThreadSafeAutoRefCnt mWriterRefCnt;
 
   // access to these is protected by mTransport->mLock
@@ -125,46 +125,46 @@ class nsSocketTransport final : public nsASocketHandler,
 
   // this method instructs the socket transport to open a socket of the
   // given type(s) to the given host or proxy.
-  nsresult Init(const char **socketTypes, uint32_t typeCount,
-                const nsACString &host, uint16_t port,
-                const nsACString &hostRoute, uint16_t portRoute,
-                nsIProxyInfo *proxyInfo);
+  nsresult Init(const char** socketTypes, uint32_t typeCount,
+                const nsACString& host, uint16_t port,
+                const nsACString& hostRoute, uint16_t portRoute,
+                nsIProxyInfo* proxyInfo);
 
   // this method instructs the socket transport to use an already connected
   // socket with the given address.
-  nsresult InitWithConnectedSocket(PRFileDesc *socketFD, const NetAddr *addr);
+  nsresult InitWithConnectedSocket(PRFileDesc* socketFD, const NetAddr* addr);
 
   // this method instructs the socket transport to use an already connected
   // socket with the given address, and additionally supplies security info.
-  nsresult InitWithConnectedSocket(PRFileDesc *aSocketFD, const NetAddr *aAddr,
-                                   nsISupports *aSecInfo);
+  nsresult InitWithConnectedSocket(PRFileDesc* aSocketFD, const NetAddr* aAddr,
+                                   nsISupports* aSecInfo);
 
 #ifdef XP_UNIX
   // This method instructs the socket transport to open a socket
   // connected to the given Unix domain address. We can only create
   // unlayered, simple, stream sockets.
-  nsresult InitWithFilename(const char *filename);
+  nsresult InitWithFilename(const char* filename);
 
   // This method instructs the socket transport to open a socket
   // connected to the given Unix domain address that includes abstract
   // socket address. If using abstract socket address, first character of
   // name parameter has to be \0.
   // We can only create unlayered, simple, stream sockets.
-  nsresult InitWithName(const char *name, size_t len);
+  nsresult InitWithName(const char* name, size_t len);
 #endif
 
   // nsASocketHandler methods:
-  void OnSocketReady(PRFileDesc *, int16_t outFlags) override;
-  void OnSocketDetached(PRFileDesc *) override;
-  void IsLocal(bool *aIsLocal) override;
+  void OnSocketReady(PRFileDesc*, int16_t outFlags) override;
+  void OnSocketDetached(PRFileDesc*) override;
+  void IsLocal(bool* aIsLocal) override;
   void OnKeepaliveEnabledPrefChange(bool aEnabled) final;
 
   // called when a socket event is handled
-  void OnSocketEvent(uint32_t type, nsresult status, nsISupports *param);
+  void OnSocketEvent(uint32_t type, nsresult status, nsISupports* param);
 
   uint64_t ByteCountReceived() override { return mInput.ByteCount(); }
   uint64_t ByteCountSent() override { return mOutput.ByteCount(); }
-  static void CloseSocket(PRFileDesc *aFd, bool aTelemetryEnabled);
+  static void CloseSocket(PRFileDesc* aFd, bool aTelemetryEnabled);
   static void SendPRBlockingTelemetry(
       PRIntervalTime aStart, Telemetry::HistogramID aIDNormal,
       Telemetry::HistogramID aIDShutdown,
@@ -188,7 +188,7 @@ class nsSocketTransport final : public nsASocketHandler,
     MSG_OUTPUT_PENDING
   };
   nsresult PostEvent(uint32_t type, nsresult status = NS_OK,
-                     nsISupports *param = nullptr);
+                     nsISupports* param = nullptr);
 
   enum {
     STATE_CLOSED,
@@ -201,9 +201,9 @@ class nsSocketTransport final : public nsASocketHandler,
   // Safer way to get and automatically release PRFileDesc objects.
   class MOZ_STACK_CLASS PRFileDescAutoLock {
    public:
-    explicit PRFileDescAutoLock(nsSocketTransport *aSocketTransport,
+    explicit PRFileDescAutoLock(nsSocketTransport* aSocketTransport,
                                 bool aAlsoDuringFastOpen,
-                                nsresult *aConditionWhileLocked = nullptr)
+                                nsresult* aConditionWhileLocked = nullptr)
         : mSocketTransport(aSocketTransport), mFd(nullptr) {
       MOZ_ASSERT(aSocketTransport);
       MutexAutoLock lock(mSocketTransport->mLock);
@@ -226,49 +226,49 @@ class nsSocketTransport final : public nsASocketHandler,
       }
     }
     bool IsInitialized() { return mFd; }
-    operator PRFileDesc *() { return mFd; }
+    operator PRFileDesc*() { return mFd; }
     nsresult SetKeepaliveEnabled(bool aEnable);
     nsresult SetKeepaliveVals(bool aEnabled, int aIdleTime, int aRetryInterval,
                               int aProbeCount);
 
    private:
-    operator PRFileDescAutoLock *() { return nullptr; }
+    operator PRFileDescAutoLock*() { return nullptr; }
 
     // Weak ptr to nsSocketTransport since this is a stack class only.
-    nsSocketTransport *mSocketTransport;
-    PRFileDesc *mFd;
+    nsSocketTransport* mSocketTransport;
+    PRFileDesc* mFd;
   };
   friend class PRFileDescAutoLock;
 
   class LockedPRFileDesc {
    public:
-    explicit LockedPRFileDesc(nsSocketTransport *aSocketTransport)
+    explicit LockedPRFileDesc(nsSocketTransport* aSocketTransport)
         : mSocketTransport(aSocketTransport), mFd(nullptr) {
       MOZ_ASSERT(aSocketTransport);
     }
     ~LockedPRFileDesc() = default;
     bool IsInitialized() { return mFd; }
-    LockedPRFileDesc &operator=(PRFileDesc *aFd) {
+    LockedPRFileDesc& operator=(PRFileDesc* aFd) {
       mSocketTransport->mLock.AssertCurrentThreadOwns();
       mFd = aFd;
       return *this;
     }
-    operator PRFileDesc *() {
+    operator PRFileDesc*() {
       if (mSocketTransport->mAttached) {
         mSocketTransport->mLock.AssertCurrentThreadOwns();
       }
       return mFd;
     }
-    bool operator==(PRFileDesc *aFd) {
+    bool operator==(PRFileDesc* aFd) {
       mSocketTransport->mLock.AssertCurrentThreadOwns();
       return mFd == aFd;
     }
 
    private:
-    operator LockedPRFileDesc *() { return nullptr; }
+    operator LockedPRFileDesc*() { return nullptr; }
     // Weak ptr to nsSocketTransport since it owns this class.
-    nsSocketTransport *mSocketTransport;
-    PRFileDesc *mFd;
+    nsSocketTransport* mSocketTransport;
+    PRFileDesc* mFd;
   };
   friend class LockedPRFileDesc;
 
@@ -278,7 +278,7 @@ class nsSocketTransport final : public nsASocketHandler,
   //-------------------------------------------------------------------------
 
   // socket type info:
-  char **mTypes;
+  char** mTypes;
   uint32_t mTypeCount;
   nsCString mHost;
   nsCString mProxyHost;
@@ -307,7 +307,7 @@ class nsSocketTransport final : public nsASocketHandler,
   uint16_t SocketPort() {
     return (!mProxyHost.IsEmpty() && !mProxyTransparent) ? mProxyPort : mPort;
   }
-  const nsCString &SocketHost() {
+  const nsCString& SocketHost() {
     return (!mProxyHost.IsEmpty() && !mProxyTransparent) ? mProxyHost : mHost;
   }
 
@@ -338,7 +338,7 @@ class nsSocketTransport final : public nsASocketHandler,
 
   // mNetAddr/mSelfAddr is valid from GetPeerAddr()/GetSelfAddr() once we have
   // reached STATE_TRANSFERRING. It must not change after that.
-  void SetSocketName(PRFileDesc *fd);
+  void SetSocketName(PRFileDesc* fd);
   NetAddr mNetAddr;
   NetAddr mSelfAddr;  // getsockname()
   Atomic mNetAddrIsSet;
@@ -350,7 +350,7 @@ class nsSocketTransport final : public nsASocketHandler,
 
   void SendStatus(nsresult status);
   nsresult ResolveHost();
-  nsresult BuildSocket(PRFileDesc *&, bool &, bool &);
+  nsresult BuildSocket(PRFileDesc*&, bool&, bool&);
   nsresult InitiateSocket();
   bool RecoverFromError();
 
@@ -408,9 +408,9 @@ class nsSocketTransport final : public nsASocketHandler,
   //
   // mFD access methods: called with mLock held.
   //
-  PRFileDesc *GetFD_Locked();
-  PRFileDesc *GetFD_LockedAlsoDuringFastOpen();
-  void ReleaseFD_Locked(PRFileDesc *fd);
+  PRFileDesc* GetFD_Locked();
+  PRFileDesc* GetFD_LockedAlsoDuringFastOpen();
+  void ReleaseFD_Locked(PRFileDesc* fd);
   bool FastOpenInProgress();
 
   //
@@ -446,8 +446,8 @@ class nsSocketTransport final : public nsASocketHandler,
   }
 
 #ifdef ENABLE_SOCKET_TRACING
-  void TraceInBuf(const char *buf, int32_t n);
-  void TraceOutBuf(const char *buf, int32_t n);
+  void TraceInBuf(const char* buf, int32_t n);
+  void TraceOutBuf(const char* buf, int32_t n);
 #endif
 
   // Reads prefs to get default keepalive config.
@@ -466,7 +466,7 @@ class nsSocketTransport final : public nsASocketHandler,
   int32_t mKeepaliveProbeCount;
 
   // A Fast Open callback.
-  TCPFastOpen *mFastOpenCallback;
+  TCPFastOpen* mFastOpenCallback;
   bool mFastOpenLayerHasBufferedData;
   uint8_t mFastOpenStatus;
   nsresult mFirstRetryError;
diff --git a/netwerk/base/nsSocketTransportService2.cpp b/netwerk/base/nsSocketTransportService2.cpp
index c3dec5030e023..2715b252d49bc 100644
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -39,8 +39,8 @@ LazyLogModule gSocketTransportLog("nsSocketTransport");
 LazyLogModule gUDPSocketLog("UDPSocket");
 LazyLogModule gTCPSocketLog("TCPSocket");
 
-nsSocketTransportService *gSocketTransportService = nullptr;
-static Atomic gSocketThread;
+nsSocketTransportService* gSocketTransportService = nullptr;
+static Atomic gSocketThread;
 
 #define SEND_BUFFER_PREF "network.tcp.sendbuffer"
 #define KEEPALIVE_ENABLED_PREF "network.tcp.keepalive.enabled"
@@ -159,11 +159,11 @@ nsSocketTransportService::nsSocketTransportService()
 
   PR_CallOnce(&gMaxCountInitOnce, DiscoverMaxCount);
   mActiveList =
-      (SocketContext *)moz_xmalloc(sizeof(SocketContext) * mActiveListSize);
+      (SocketContext*)moz_xmalloc(sizeof(SocketContext) * mActiveListSize);
   mIdleList =
-      (SocketContext *)moz_xmalloc(sizeof(SocketContext) * mIdleListSize);
+      (SocketContext*)moz_xmalloc(sizeof(SocketContext) * mIdleListSize);
   mPollList =
-      (PRPollDesc *)moz_xmalloc(sizeof(PRPollDesc) * (mActiveListSize + 1));
+      (PRPollDesc*)moz_xmalloc(sizeof(PRPollDesc) * (mActiveListSize + 1));
 
   NS_ASSERTION(!gSocketTransportService, "must not instantiate twice");
   gSocketTransportService = this;
@@ -189,7 +189,7 @@ already_AddRefed nsSocketTransportService::GetThreadSafely() {
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::DispatchFromScript(nsIRunnable *event,
+nsSocketTransportService::DispatchFromScript(nsIRunnable* event,
                                              uint32_t flags) {
   nsCOMPtr event_ref(event);
   return Dispatch(event_ref.forget(), flags);
@@ -220,7 +220,7 @@ nsSocketTransportService::DelayedDispatch(already_AddRefed,
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::IsOnCurrentThread(bool *result) {
+nsSocketTransportService::IsOnCurrentThread(bool* result) {
   nsCOMPtr thread = GetThreadSafely();
   NS_ENSURE_TRUE(thread, NS_ERROR_NOT_INITIALIZED);
   return thread->IsOnCurrentThread(result);
@@ -237,7 +237,7 @@ nsSocketTransportService::IsOnCurrentThreadInfallible() {
 // socket api (socket thread only)
 
 NS_IMETHODIMP
-nsSocketTransportService::NotifyWhenCanAttachSocket(nsIRunnable *event) {
+nsSocketTransportService::NotifyWhenCanAttachSocket(nsIRunnable* event) {
   SOCKET_LOG(("nsSocketTransportService::NotifyWhenCanAttachSocket\n"));
 
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
@@ -246,14 +246,14 @@ nsSocketTransportService::NotifyWhenCanAttachSocket(nsIRunnable *event) {
     return Dispatch(event, NS_DISPATCH_NORMAL);
   }
 
-  auto *runnable = new LinkedRunnableEvent(event);
+  auto* runnable = new LinkedRunnableEvent(event);
   mPendingSocketQueue.insertBack(runnable);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::AttachSocket(PRFileDesc *fd,
-                                       nsASocketHandler *handler) {
+nsSocketTransportService::AttachSocket(PRFileDesc* fd,
+                                       nsASocketHandler* handler) {
   SOCKET_LOG(
       ("nsSocketTransportService::AttachSocket [handler=%p]\n", handler));
 
@@ -294,8 +294,8 @@ bool nsSocketTransportService::CanAttachSocket() {
   return rv;
 }
 
-nsresult nsSocketTransportService::DetachSocket(SocketContext *listHead,
-                                                SocketContext *sock) {
+nsresult nsSocketTransportService::DetachSocket(SocketContext* listHead,
+                                                SocketContext* sock) {
   SOCKET_LOG(("nsSocketTransportService::DetachSocket [handler=%p]\n",
               sock->mHandler));
   MOZ_ASSERT((listHead == mActiveList) || (listHead == mIdleList),
@@ -327,7 +327,7 @@ nsresult nsSocketTransportService::DetachSocket(SocketContext *listHead,
   // notify the first element on the pending socket queue...
   //
   nsCOMPtr event;
-  LinkedRunnableEvent *runnable = mPendingSocketQueue.getFirst();
+  LinkedRunnableEvent* runnable = mPendingSocketQueue.getFirst();
   if (runnable) {
     event = runnable->TakeEvent();
     runnable->remove();
@@ -340,7 +340,7 @@ nsresult nsSocketTransportService::DetachSocket(SocketContext *listHead,
   return NS_OK;
 }
 
-nsresult nsSocketTransportService::AddToPollList(SocketContext *sock) {
+nsresult nsSocketTransportService::AddToPollList(SocketContext* sock) {
   MOZ_ASSERT(!(static_cast(sock - mActiveList) < mActiveListSize),
              "AddToPollList Socket Already Active");
 
@@ -375,7 +375,7 @@ nsresult nsSocketTransportService::AddToPollList(SocketContext *sock) {
   return NS_OK;
 }
 
-void nsSocketTransportService::RemoveFromPollList(SocketContext *sock) {
+void nsSocketTransportService::RemoveFromPollList(SocketContext* sock) {
   SOCKET_LOG(("nsSocketTransportService::RemoveFromPollList [handler=%p]\n",
               sock->mHandler));
 
@@ -393,7 +393,7 @@ void nsSocketTransportService::RemoveFromPollList(SocketContext *sock) {
   SOCKET_LOG(("  active=%u idle=%u\n", mActiveCount, mIdleCount));
 }
 
-nsresult nsSocketTransportService::AddToIdleList(SocketContext *sock) {
+nsresult nsSocketTransportService::AddToIdleList(SocketContext* sock) {
   MOZ_ASSERT(!(static_cast(sock - mIdleList) < mIdleListSize),
              "AddToIdlelList Socket Already Idle");
 
@@ -414,7 +414,7 @@ nsresult nsSocketTransportService::AddToIdleList(SocketContext *sock) {
   return NS_OK;
 }
 
-void nsSocketTransportService::RemoveFromIdleList(SocketContext *sock) {
+void nsSocketTransportService::RemoveFromIdleList(SocketContext* sock) {
   SOCKET_LOG(("nsSocketTransportService::RemoveFromIdleList [handler=%p]\n",
               sock->mHandler));
 
@@ -427,7 +427,7 @@ void nsSocketTransportService::RemoveFromIdleList(SocketContext *sock) {
   SOCKET_LOG(("  active=%u idle=%u\n", mActiveCount, mIdleCount));
 }
 
-void nsSocketTransportService::MoveToIdleList(SocketContext *sock) {
+void nsSocketTransportService::MoveToIdleList(SocketContext* sock) {
   nsresult rv = AddToIdleList(sock);
   if (NS_FAILED(rv))
     DetachSocket(mActiveList, sock);
@@ -435,7 +435,7 @@ void nsSocketTransportService::MoveToIdleList(SocketContext *sock) {
     RemoveFromPollList(sock);
 }
 
-void nsSocketTransportService::MoveToPollList(SocketContext *sock) {
+void nsSocketTransportService::MoveToPollList(SocketContext* sock) {
   nsresult rv = AddToPollList(sock);
   if (NS_FAILED(rv))
     DetachSocket(mIdleList, sock);
@@ -453,9 +453,9 @@ bool nsSocketTransportService::GrowActiveList() {
   }
 
   mActiveListSize += toAdd;
-  mActiveList = (SocketContext *)moz_xrealloc(
+  mActiveList = (SocketContext*)moz_xrealloc(
       mActiveList, sizeof(SocketContext) * mActiveListSize);
-  mPollList = (PRPollDesc *)moz_xrealloc(
+  mPollList = (PRPollDesc*)moz_xrealloc(
       mPollList, sizeof(PRPollDesc) * (mActiveListSize + 1));
   return true;
 }
@@ -470,7 +470,7 @@ bool nsSocketTransportService::GrowIdleList() {
   }
 
   mIdleListSize += toAdd;
-  mIdleList = (SocketContext *)moz_xrealloc(
+  mIdleList = (SocketContext*)moz_xrealloc(
       mIdleList, sizeof(SocketContext) * mIdleListSize);
   return true;
 }
@@ -483,7 +483,7 @@ PRIntervalTime nsSocketTransportService::PollTimeout(PRIntervalTime now) {
   // compute minimum time before any socket timeout expires.
   PRIntervalTime minR = NS_SOCKET_POLL_TIMEOUT;
   for (uint32_t i = 0; i < mActiveCount; ++i) {
-    const SocketContext &s = mActiveList[i];
+    const SocketContext& s = mActiveList[i];
     PRIntervalTime r = s.TimeoutIn(now);
     if (r < minR) {
       minR = r;
@@ -497,9 +497,9 @@ PRIntervalTime nsSocketTransportService::PollTimeout(PRIntervalTime now) {
   return minR;
 }
 
-int32_t nsSocketTransportService::Poll(TimeDuration *pollDuration,
+int32_t nsSocketTransportService::Poll(TimeDuration* pollDuration,
                                        PRIntervalTime ts) {
-  PRPollDesc *pollList;
+  PRPollDesc* pollList;
   uint32_t pollCount;
   PRIntervalTime pollTimeout;
   *pollDuration = nullptr;
@@ -572,7 +572,7 @@ NS_IMPL_ISUPPORTS(nsSocketTransportService, nsISocketTransportService,
                   nsISerialEventTarget, nsIThreadObserver, nsIRunnable,
                   nsPISocketTransportService, nsIObserver)
 
-static const char *gCallbackPrefs[] = {
+static const char* gCallbackPrefs[] = {
     SEND_BUFFER_PREF,
     KEEPALIVE_ENABLED_PREF,
     KEEPALIVE_IDLE_TIME_PREF,
@@ -587,8 +587,8 @@ static const char *gCallbackPrefs[] = {
 };
 
 /* static */
-void nsSocketTransportService::PrefCallback(const char *aPref,
-                                            nsSocketTransportService *aSelf) {
+void nsSocketTransportService::PrefCallback(const char* aPref,
+                                            nsSocketTransportService* aSelf) {
   aSelf->UpdatePrefs();
 }
 
@@ -703,7 +703,7 @@ nsresult nsSocketTransportService::ShutdownThread() {
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::GetOffline(bool *offline) {
+nsSocketTransportService::GetOffline(bool* offline) {
   *offline = mOffline;
   return NS_OK;
 }
@@ -726,7 +726,7 @@ nsSocketTransportService::SetOffline(bool offline) {
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::GetKeepaliveIdleTime(int32_t *aKeepaliveIdleTimeS) {
+nsSocketTransportService::GetKeepaliveIdleTime(int32_t* aKeepaliveIdleTimeS) {
   MOZ_ASSERT(aKeepaliveIdleTimeS);
   if (NS_WARN_IF(!aKeepaliveIdleTimeS)) {
     return NS_ERROR_NULL_POINTER;
@@ -737,7 +737,7 @@ nsSocketTransportService::GetKeepaliveIdleTime(int32_t *aKeepaliveIdleTimeS) {
 
 NS_IMETHODIMP
 nsSocketTransportService::GetKeepaliveRetryInterval(
-    int32_t *aKeepaliveRetryIntervalS) {
+    int32_t* aKeepaliveRetryIntervalS) {
   MOZ_ASSERT(aKeepaliveRetryIntervalS);
   if (NS_WARN_IF(!aKeepaliveRetryIntervalS)) {
     return NS_ERROR_NULL_POINTER;
@@ -748,7 +748,7 @@ nsSocketTransportService::GetKeepaliveRetryInterval(
 
 NS_IMETHODIMP
 nsSocketTransportService::GetKeepaliveProbeCount(
-    int32_t *aKeepaliveProbeCount) {
+    int32_t* aKeepaliveProbeCount) {
   MOZ_ASSERT(aKeepaliveProbeCount);
   if (NS_WARN_IF(!aKeepaliveProbeCount)) {
     return NS_ERROR_NULL_POINTER;
@@ -758,20 +758,20 @@ nsSocketTransportService::GetKeepaliveProbeCount(
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::CreateTransport(const char **types,
+nsSocketTransportService::CreateTransport(const char** types,
                                           uint32_t typeCount,
-                                          const nsACString &host, int32_t port,
-                                          nsIProxyInfo *proxyInfo,
-                                          nsISocketTransport **result) {
+                                          const nsACString& host, int32_t port,
+                                          nsIProxyInfo* proxyInfo,
+                                          nsISocketTransport** result) {
   return CreateRoutedTransport(types, typeCount, host, port,
                                NS_LITERAL_CSTRING(""), 0, proxyInfo, result);
 }
 
 NS_IMETHODIMP
 nsSocketTransportService::CreateRoutedTransport(
-    const char **types, uint32_t typeCount, const nsACString &host,
-    int32_t port, const nsACString &hostRoute, int32_t portRoute,
-    nsIProxyInfo *proxyInfo, nsISocketTransport **result) {
+    const char** types, uint32_t typeCount, const nsACString& host,
+    int32_t port, const nsACString& hostRoute, int32_t portRoute,
+    nsIProxyInfo* proxyInfo, nsISocketTransport** result) {
   NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_INITIALIZED);
   NS_ENSURE_TRUE(port >= 0 && port <= 0xFFFF, NS_ERROR_ILLEGAL_VALUE);
 
@@ -788,7 +788,7 @@ nsSocketTransportService::CreateRoutedTransport(
 
 NS_IMETHODIMP
 nsSocketTransportService::CreateUnixDomainTransport(
-    nsIFile *aPath, nsISocketTransport **result) {
+    nsIFile* aPath, nsISocketTransport** result) {
 #ifdef XP_UNIX
   nsresult rv;
 
@@ -812,7 +812,7 @@ nsSocketTransportService::CreateUnixDomainTransport(
 
 NS_IMETHODIMP
 nsSocketTransportService::CreateUnixDomainAbstractAddressTransport(
-    const nsACString &aName, nsISocketTransport **result) {
+    const nsACString& aName, nsISocketTransport** result) {
   // Abstract socket address is supported on Linux only
 #ifdef XP_LINUX
   RefPtr trans = new nsSocketTransport();
@@ -865,13 +865,13 @@ nsSocketTransportService::OnDispatchedEvent() {
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::OnProcessNextEvent(nsIThreadInternal *thread,
+nsSocketTransportService::OnProcessNextEvent(nsIThreadInternal* thread,
                                              bool mayWait) {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::AfterProcessNextEvent(nsIThreadInternal *thread,
+nsSocketTransportService::AfterProcessNextEvent(nsIThreadInternal* thread,
                                                 bool eventWasProcessed) {
   return NS_OK;
 }
@@ -1078,7 +1078,7 @@ nsSocketTransportService::Run() {
 }
 
 void nsSocketTransportService::DetachSocketWithGuard(bool aGuardLocals,
-                                                     SocketContext *socketList,
+                                                     SocketContext* socketList,
                                                      int32_t index) {
   bool isGuarded = false;
   if (aGuardLocals) {
@@ -1099,7 +1099,7 @@ void nsSocketTransportService::Reset(bool aGuardLocals) {
   }
 }
 
-nsresult nsSocketTransportService::DoPollIteration(TimeDuration *pollDuration) {
+nsresult nsSocketTransportService::DoPollIteration(TimeDuration* pollDuration) {
   SOCKET_LOG(("STS poll iter\n"));
 
   PRIntervalTime now = PR_IntervalNow();
@@ -1200,8 +1200,8 @@ nsresult nsSocketTransportService::DoPollIteration(TimeDuration *pollDuration) {
     //
     uint32_t numberOfOnSocketReadyCalls = 0;
     for (i = 0; i < int32_t(mActiveCount); ++i) {
-      PRPollDesc &desc = mPollList[i + 1];
-      SocketContext &s = mActiveList[i];
+      PRPollDesc& desc = mPollList[i + 1];
+      SocketContext& s = mActiveList[i];
       if (n > 0 && desc.out_flags != 0) {
 #ifdef MOZ_TASK_TRACER
         tasktracer::AutoSourceEvent taskTracerEvent(
@@ -1383,7 +1383,7 @@ void nsSocketTransportService::OnKeepaliveEnabledPrefChange() {
 }
 
 void nsSocketTransportService::NotifyKeepaliveEnabledPrefChange(
-    SocketContext *sock) {
+    SocketContext* sock) {
   MOZ_ASSERT(sock, "SocketContext cannot be null!");
   MOZ_ASSERT(sock->mHandler, "SocketContext does not have a handler!");
 
@@ -1399,8 +1399,8 @@ void nsSocketTransportService::NotifyKeepaliveEnabledPrefChange(
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::Observe(nsISupports *subject, const char *topic,
-                                  const char16_t *data) {
+nsSocketTransportService::Observe(nsISupports* subject, const char* topic,
+                                  const char16_t* data) {
   SOCKET_LOG(("nsSocketTransportService::Observe topic=%s", topic));
 
   if (!strcmp(topic, "profile-initial-state")) {
@@ -1475,7 +1475,7 @@ void nsSocketTransportService::ClosePrivateConnections() {
 }
 
 NS_IMETHODIMP
-nsSocketTransportService::GetSendBufferSize(int32_t *value) {
+nsSocketTransportService::GetSendBufferSize(int32_t* value) {
   *value = mSendBufferSize;
   return NS_OK;
 }
@@ -1596,13 +1596,13 @@ PRStatus nsSocketTransportService::DiscoverMaxCount() {
 }
 
 // Used to return connection info to Dashboard.cpp
-void nsSocketTransportService::AnalyzeConnection(nsTArray *data,
-                                                 struct SocketContext *context,
+void nsSocketTransportService::AnalyzeConnection(nsTArray* data,
+                                                 struct SocketContext* context,
                                                  bool aActive) {
   if (context->mHandler->mIsPrivate) return;
-  PRFileDesc *aFD = context->mFD;
+  PRFileDesc* aFD = context->mFD;
 
-  PRFileDesc *idLayer = PR_GetIdentitiesLayer(aFD, PR_NSPR_IO_LAYER);
+  PRFileDesc* idLayer = PR_GetIdentitiesLayer(aFD, PR_NSPR_IO_LAYER);
 
   NS_ENSURE_TRUE_VOID(idLayer);
 
@@ -1631,7 +1631,7 @@ void nsSocketTransportService::AnalyzeConnection(nsTArray *data,
 }
 
 void nsSocketTransportService::GetSocketConnections(
-    nsTArray *data) {
+    nsTArray* data) {
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
   for (uint32_t i = 0; i < mActiveCount; i++)
     AnalyzeConnection(data, &mActiveList[i], true);
diff --git a/netwerk/base/nsSocketTransportService2.h b/netwerk/base/nsSocketTransportService2.h
index 5ba8555a89edd..f1204eac98dd2 100644
--- a/netwerk/base/nsSocketTransportService2.h
+++ b/netwerk/base/nsSocketTransportService2.h
@@ -69,7 +69,7 @@ static const int32_t kDefaultTCPKeepCount =
 class LinkedRunnableEvent final
     : public LinkedListElement {
  public:
-  explicit LinkedRunnableEvent(nsIRunnable *event) : mEvent(event) {}
+  explicit LinkedRunnableEvent(nsIRunnable* event) : mEvent(event) {}
   ~LinkedRunnableEvent() = default;
 
   already_AddRefed TakeEvent() { return mEvent.forget(); }
@@ -107,7 +107,7 @@ class nsSocketTransportService final : public nsPISocketTransportService,
 
   // Called by the networking dashboard on the socket thread only
   // Fills the passed array with socket information
-  void GetSocketConnections(nsTArray *);
+  void GetSocketConnections(nsTArray*);
   uint64_t GetSentBytes() { return mSentBytesCount; }
   uint64_t GetReceivedBytes() { return mReceivedBytesCount; }
 
@@ -166,8 +166,8 @@ class nsSocketTransportService final : public nsPISocketTransportService,
   //-------------------------------------------------------------------------
 
   struct SocketContext {
-    PRFileDesc *mFD;
-    nsASocketHandler *mHandler;
+    PRFileDesc* mFD;
+    nsASocketHandler* mHandler;
     PRIntervalTime mPollStartEpoch;  // time we started to poll this socket
 
    public:
@@ -191,22 +191,22 @@ class nsSocketTransportService final : public nsPISocketTransportService,
     void MaybeResetEpoch();
   };
 
-  SocketContext *mActiveList; /* mListSize entries */
-  SocketContext *mIdleList;   /* mListSize entries */
-  nsIThread *mRawThread;
+  SocketContext* mActiveList; /* mListSize entries */
+  SocketContext* mIdleList;   /* mListSize entries */
+  nsIThread* mRawThread;
 
   uint32_t mActiveListSize;
   uint32_t mIdleListSize;
   uint32_t mActiveCount;
   uint32_t mIdleCount;
 
-  nsresult DetachSocket(SocketContext *, SocketContext *);
-  nsresult AddToIdleList(SocketContext *);
-  nsresult AddToPollList(SocketContext *);
-  void RemoveFromIdleList(SocketContext *);
-  void RemoveFromPollList(SocketContext *);
-  void MoveToIdleList(SocketContext *sock);
-  void MoveToPollList(SocketContext *sock);
+  nsresult DetachSocket(SocketContext*, SocketContext*);
+  nsresult AddToIdleList(SocketContext*);
+  nsresult AddToPollList(SocketContext*);
+  void RemoveFromIdleList(SocketContext*);
+  void RemoveFromPollList(SocketContext*);
+  void MoveToIdleList(SocketContext* sock);
+  void MoveToPollList(SocketContext* sock);
 
   bool GrowActiveList();
   bool GrowIdleList();
@@ -222,13 +222,13 @@ class nsSocketTransportService final : public nsPISocketTransportService,
   // event cannot be created).
   //-------------------------------------------------------------------------
 
-  PRPollDesc *mPollList; /* mListSize + 1 entries */
+  PRPollDesc* mPollList; /* mListSize + 1 entries */
 
   PRIntervalTime PollTimeout(
       PRIntervalTime now);  // computes ideal poll timeout
-  nsresult DoPollIteration(TimeDuration *pollDuration);
+  nsresult DoPollIteration(TimeDuration* pollDuration);
   // perfoms a single poll iteration
-  int32_t Poll(TimeDuration *pollDuration, PRIntervalTime now);
+  int32_t Poll(TimeDuration* pollDuration, PRIntervalTime now);
   // calls PR_Poll.  the out param
   // interval indicates the poll
   // duration in seconds.
@@ -242,7 +242,7 @@ class nsSocketTransportService final : public nsPISocketTransportService,
 
   // Preference Monitor for SendBufferSize and Keepalive prefs.
   nsresult UpdatePrefs();
-  static void PrefCallback(const char *aPref, nsSocketTransportService *aSelf);
+  static void PrefCallback(const char* aPref, nsSocketTransportService* aSelf);
   void UpdateSendBufferPref();
   int32_t mSendBufferSize;
   // Number of seconds of connection is idle before first keepalive ping.
@@ -275,7 +275,7 @@ class nsSocketTransportService final : public nsPISocketTransportService,
   nsCOMPtr mAfterWakeUpTimer;
 
   void OnKeepaliveEnabledPrefChange();
-  void NotifyKeepaliveEnabledPrefChange(SocketContext *sock);
+  void NotifyKeepaliveEnabledPrefChange(SocketContext* sock);
 
   // Socket thread only for dynamically adjusting max socket size
 #if defined(XP_WIN)
@@ -283,11 +283,11 @@ class nsSocketTransportService final : public nsPISocketTransportService,
 #endif
   bool mProbedMaxCount;
 
-  void AnalyzeConnection(nsTArray *data, SocketContext *context,
+  void AnalyzeConnection(nsTArray* data, SocketContext* context,
                          bool aActive);
 
   void ClosePrivateConnections();
-  void DetachSocketWithGuard(bool aGuardLocals, SocketContext *socketList,
+  void DetachSocketWithGuard(bool aGuardLocals, SocketContext* socketList,
                              int32_t index);
 
   void MarkTheLastElementOfPendingQueue();
@@ -308,7 +308,7 @@ class nsSocketTransportService final : public nsPISocketTransportService,
   bool mNotTrustedMitmDetected;
 };
 
-extern nsSocketTransportService *gSocketTransportService;
+extern nsSocketTransportService* gSocketTransportService;
 bool OnSocketThread();
 
 }  // namespace net
diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp
index 71b25ee759134..58ce46ea6d2c7 100644
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -83,7 +83,7 @@ constexpr ASCIIMaskArray sInvalidHostChars =
 // nsStandardURL::nsSegmentEncoder
 //----------------------------------------------------------------------------
 
-nsStandardURL::nsSegmentEncoder::nsSegmentEncoder(const Encoding *encoding)
+nsStandardURL::nsSegmentEncoder::nsSegmentEncoder(const Encoding* encoding)
     : mEncoding(encoding) {
   if (mEncoding == UTF_8_ENCODING) {
     mEncoding = nullptr;
@@ -91,8 +91,8 @@ nsStandardURL::nsSegmentEncoder::nsSegmentEncoder(const Encoding *encoding)
 }
 
 int32_t nsStandardURL::nsSegmentEncoder::EncodeSegmentCount(
-    const char *aStr, const URLSegment &aSeg, int16_t aMask, nsCString &aOut,
-    bool &aAppended, uint32_t aExtraLen) {
+    const char* aStr, const URLSegment& aSeg, int16_t aMask, nsCString& aOut,
+    bool& aAppended, uint32_t aExtraLen) {
   // aExtraLen is characters outside the segment that will be
   // added when the segment is not empty (like the @ following
   // a username).
@@ -177,9 +177,9 @@ int32_t nsStandardURL::nsSegmentEncoder::EncodeSegmentCount(
   return span.Length() + aExtraLen;
 }
 
-const nsACString &nsStandardURL::nsSegmentEncoder::EncodeSegment(
-    const nsACString &str, int16_t mask, nsCString &result) {
-  const char *text;
+const nsACString& nsStandardURL::nsSegmentEncoder::EncodeSegment(
+    const nsACString& str, int16_t mask, nsCString& result) {
+  const char* text;
   bool encoded;
   EncodeSegmentCount(str.BeginReading(text), URLSegment(0, str.Length()), mask,
                      result, encoded);
@@ -334,9 +334,9 @@ void nsStandardURL::InvalidateCache(bool invalidateCachedFile) {
 // length is assumed to be <= host.Length(); the callers is responsible for that
 //
 // Note that the value returned is guaranteed to be in [-1, 3] range.
-inline int32_t ValidateIPv4Number(const nsACString &host, int32_t bases[4],
-                                  int32_t dotIndex[3], bool &onlyBase10,
-                                  int32_t &length) {
+inline int32_t ValidateIPv4Number(const nsACString& host, int32_t bases[4],
+                                  int32_t dotIndex[3], bool& onlyBase10,
+                                  int32_t& length) {
   MOZ_ASSERT(length <= (int32_t)host.Length());
   if (length <= 0) {
     return -1;
@@ -415,11 +415,11 @@ inline int32_t ValidateIPv4Number(const nsACString &host, int32_t bases[4],
   return dotCount;
 }
 
-inline nsresult ParseIPv4Number10(const nsACString &input, uint32_t &number,
+inline nsresult ParseIPv4Number10(const nsACString& input, uint32_t& number,
                                   uint32_t maxNumber) {
   uint64_t value = 0;
-  const char *current = input.BeginReading();
-  const char *end = input.EndReading();
+  const char* current = input.BeginReading();
+  const char* end = input.EndReading();
   for (; current < end; ++current) {
     char c = *current;
     MOZ_ASSERT(c >= '0' && c <= '9');
@@ -436,12 +436,12 @@ inline nsresult ParseIPv4Number10(const nsACString &input, uint32_t &number,
   return NS_ERROR_FAILURE;
 }
 
-inline nsresult ParseIPv4Number(const nsACString &input, int32_t base,
-                                uint32_t &number, uint32_t maxNumber) {
+inline nsresult ParseIPv4Number(const nsACString& input, int32_t base,
+                                uint32_t& number, uint32_t maxNumber) {
   // Accumulate in the 64-bit value
   uint64_t value = 0;
-  const char *current = input.BeginReading();
-  const char *end = input.EndReading();
+  const char* current = input.BeginReading();
+  const char* end = input.EndReading();
   switch (base) {
     case 16:
       ++current;
@@ -480,8 +480,8 @@ inline nsresult ParseIPv4Number(const nsACString &input, int32_t base,
 
 // IPv4 parser spec: https://url.spec.whatwg.org/#concept-ipv4-parser
 /* static */
-nsresult nsStandardURL::NormalizeIPv4(const nsACString &host,
-                                      nsCString &result) {
+nsresult nsStandardURL::NormalizeIPv4(const nsACString& host,
+                                      nsCString& result) {
   int32_t bases[4] = {10, 10, 10, 10};
   bool onlyBase10 = true;  // Track this as a special case
   int32_t dotIndex[3];     // The positions of the dots in the string
@@ -535,8 +535,8 @@ nsresult nsStandardURL::NormalizeIPv4(const nsACString &host,
   return NS_OK;
 }
 
-nsresult nsStandardURL::NormalizeIDN(const nsACString &host,
-                                     nsCString &result) {
+nsresult nsStandardURL::NormalizeIDN(const nsACString& host,
+                                     nsCString& result) {
   // If host is ACE, then convert to UTF-8.  Else, if host is already UTF-8,
   // then make sure it is normalized per IDN.
 
@@ -575,7 +575,7 @@ nsresult nsStandardURL::NormalizeIDN(const nsACString &host,
   return NS_OK;
 }
 
-bool nsStandardURL::ValidIPv6orHostname(const char *host, uint32_t length) {
+bool nsStandardURL::ValidIPv6orHostname(const char* host, uint32_t length) {
   if (!host || !*host) {
     // Should not be NULL or empty string
     return false;
@@ -598,8 +598,8 @@ bool nsStandardURL::ValidIPv6orHostname(const char *host, uint32_t length) {
     return false;
   }
 
-  const char *end = host + length;
-  const char *iter = host;
+  const char* end = host + length;
+  const char* iter = host;
   for (; iter != end && *iter; ++iter) {
     if (ASCIIMask::IsMasked(sInvalidHostChars, *iter)) {
       return false;
@@ -608,7 +608,7 @@ bool nsStandardURL::ValidIPv6orHostname(const char *host, uint32_t length) {
   return true;
 }
 
-void nsStandardURL::CoalescePath(netCoalesceFlags coalesceFlag, char *path) {
+void nsStandardURL::CoalescePath(netCoalesceFlags coalesceFlag, char* path) {
   net_CoalesceDirs(coalesceFlag, path);
   int32_t newLen = strlen(path);
   if (newLen < mPath.mLen) {
@@ -620,12 +620,12 @@ void nsStandardURL::CoalescePath(netCoalesceFlags coalesceFlag, char *path) {
   }
 }
 
-uint32_t nsStandardURL::AppendSegmentToBuf(char *buf, uint32_t i,
-                                           const char *str,
-                                           const URLSegment &segInput,
-                                           URLSegment &segOutput,
-                                           const nsCString *escapedStr,
-                                           bool useEscaped, int32_t *diff) {
+uint32_t nsStandardURL::AppendSegmentToBuf(char* buf, uint32_t i,
+                                           const char* str,
+                                           const URLSegment& segInput,
+                                           URLSegment& segOutput,
+                                           const nsCString* escapedStr,
+                                           bool useEscaped, int32_t* diff) {
   MOZ_ASSERT(segInput.mLen == segOutput.mLen);
 
   if (diff) *diff = 0;
@@ -647,7 +647,7 @@ uint32_t nsStandardURL::AppendSegmentToBuf(char *buf, uint32_t i,
   return i;
 }
 
-uint32_t nsStandardURL::AppendToBuf(char *buf, uint32_t i, const char *str,
+uint32_t nsStandardURL::AppendToBuf(char* buf, uint32_t i, const char* str,
                                     uint32_t len) {
   memcpy(buf + i, str, len);
   return i + len;
@@ -658,8 +658,8 @@ uint32_t nsStandardURL::AppendToBuf(char *buf, uint32_t i, const char *str,
 //  2- allocate spec buffer
 //  3- write url segments
 //  4- update url segment positions and lengths
-nsresult nsStandardURL::BuildNormalizedSpec(const char *spec,
-                                            const Encoding *encoding) {
+nsresult nsStandardURL::BuildNormalizedSpec(const char* spec,
+                                            const Encoding* encoding) {
   // Assumptions: all member URLSegments must be relative the |spec| argument
   // passed to this function.
 
@@ -804,7 +804,7 @@ nsresult nsStandardURL::BuildNormalizedSpec(const char *spec,
   if (!mSpec.SetLength(approxLen + 1,
                        fallible))  // buf needs a trailing '\0' below
     return NS_ERROR_OUT_OF_MEMORY;
-  char *buf = mSpec.BeginWriting();
+  char* buf = mSpec.BeginWriting();
   uint32_t i = 0;
   int32_t diff = 0;
 
@@ -933,7 +933,7 @@ nsresult nsStandardURL::BuildNormalizedSpec(const char *spec,
   // https://url.spec.whatwg.org/#path-state (1.4.1.2)
   // https://url.spec.whatwg.org/#windows-drive-letter
   if (SegmentIs(buf, mScheme, "file")) {
-    char *path = &buf[mPath.mPos];
+    char* path = &buf[mPath.mPos];
     if (mPath.mLen >= 3 && path[0] == '/' && IsAsciiAlpha(path[1]) &&
         path[2] == '|') {
       buf[mPath.mPos + 2] = ':';
@@ -959,7 +959,7 @@ nsresult nsStandardURL::BuildNormalizedSpec(const char *spec,
   return NS_OK;
 }
 
-bool nsStandardURL::SegmentIs(const URLSegment &seg, const char *val,
+bool nsStandardURL::SegmentIs(const URLSegment& seg, const char* val,
                               bool ignoreCase) {
   // one or both may be null
   if (!val || mSpec.IsEmpty())
@@ -975,8 +975,8 @@ bool nsStandardURL::SegmentIs(const URLSegment &seg, const char *val,
          (val[seg.mLen] == '\0');
 }
 
-bool nsStandardURL::SegmentIs(const char *spec, const URLSegment &seg,
-                              const char *val, bool ignoreCase) {
+bool nsStandardURL::SegmentIs(const char* spec, const URLSegment& seg,
+                              const char* val, bool ignoreCase) {
   // one or both may be null
   if (!val || !spec) return (!val && (!spec || seg.mLen < 0));
   if (seg.mLen < 0) return false;
@@ -989,8 +989,8 @@ bool nsStandardURL::SegmentIs(const char *spec, const URLSegment &seg,
   return !strncmp(spec + seg.mPos, val, seg.mLen) && (val[seg.mLen] == '\0');
 }
 
-bool nsStandardURL::SegmentIs(const URLSegment &seg1, const char *val,
-                              const URLSegment &seg2, bool ignoreCase) {
+bool nsStandardURL::SegmentIs(const URLSegment& seg1, const char* val,
+                              const URLSegment& seg2, bool ignoreCase) {
   if (seg1.mLen != seg2.mLen) return false;
   if (seg1.mLen == -1 || (!val && mSpec.IsEmpty()))
     return true;  // both are empty
@@ -1002,7 +1002,7 @@ bool nsStandardURL::SegmentIs(const URLSegment &seg1, const char *val,
 }
 
 int32_t nsStandardURL::ReplaceSegment(uint32_t pos, uint32_t len,
-                                      const char *val, uint32_t valLen) {
+                                      const char* val, uint32_t valLen) {
   if (val && valLen) {
     if (len == 0)
       mSpec.Insert(val, pos, valLen);
@@ -1017,7 +1017,7 @@ int32_t nsStandardURL::ReplaceSegment(uint32_t pos, uint32_t len,
 }
 
 int32_t nsStandardURL::ReplaceSegment(uint32_t pos, uint32_t len,
-                                      const nsACString &val) {
+                                      const nsACString& val) {
   if (len == 0)
     mSpec.Insert(val, pos);
   else
@@ -1025,7 +1025,7 @@ int32_t nsStandardURL::ReplaceSegment(uint32_t pos, uint32_t len,
   return val.Length() - len;
 }
 
-nsresult nsStandardURL::ParseURL(const char *spec, int32_t specLen) {
+nsresult nsStandardURL::ParseURL(const char* spec, int32_t specLen) {
   nsresult rv;
 
   if (specLen > net_GetURLMaxLength()) {
@@ -1067,7 +1067,7 @@ nsresult nsStandardURL::ParseURL(const char *spec, int32_t specLen) {
   return rv;
 }
 
-nsresult nsStandardURL::ParsePath(const char *spec, uint32_t pathPos,
+nsresult nsStandardURL::ParsePath(const char* spec, uint32_t pathPos,
                                   int32_t pathLen) {
   LOG(("ParsePath: %s pathpos %d len %d\n", spec, pathPos, pathLen));
 
@@ -1098,8 +1098,8 @@ nsresult nsStandardURL::ParsePath(const char *spec, uint32_t pathPos,
   return NS_OK;
 }
 
-char *nsStandardURL::AppendToSubstring(uint32_t pos, int32_t len,
-                                       const char *tail) {
+char* nsStandardURL::AppendToSubstring(uint32_t pos, int32_t len,
+                                       const char* tail) {
   // Verify pos and length are within boundaries
   if (pos > mSpec.Length()) return nullptr;
   if (len < 0) return nullptr;
@@ -1111,28 +1111,28 @@ char *nsStandardURL::AppendToSubstring(uint32_t pos, int32_t len,
   // Check for int overflow for proposed length of combined string
   if (UINT32_MAX - ((uint32_t)len + 1) < tailLen) return nullptr;
 
-  char *result = (char *)moz_xmalloc(len + tailLen + 1);
+  char* result = (char*)moz_xmalloc(len + tailLen + 1);
   memcpy(result, mSpec.get() + pos, len);
   memcpy(result + len, tail, tailLen);
   result[len + tailLen] = '\0';
   return result;
 }
 
-nsresult nsStandardURL::ReadSegment(nsIBinaryInputStream *stream,
-                                    URLSegment &seg) {
+nsresult nsStandardURL::ReadSegment(nsIBinaryInputStream* stream,
+                                    URLSegment& seg) {
   nsresult rv;
 
   rv = stream->Read32(&seg.mPos);
   if (NS_FAILED(rv)) return rv;
 
-  rv = stream->Read32((uint32_t *)&seg.mLen);
+  rv = stream->Read32((uint32_t*)&seg.mLen);
   if (NS_FAILED(rv)) return rv;
 
   return NS_OK;
 }
 
-nsresult nsStandardURL::WriteSegment(nsIBinaryOutputStream *stream,
-                                     const URLSegment &seg) {
+nsresult nsStandardURL::WriteSegment(nsIBinaryOutputStream* stream,
+                                     const URLSegment& seg) {
   nsresult rv;
 
   rv = stream->Write32(seg.mPos);
@@ -1193,7 +1193,7 @@ NS_INTERFACE_MAP_BEGIN(nsStandardURL)
   NS_INTERFACE_MAP_ENTRY(nsISensitiveInfoHiddenURI)
   // see nsStandardURL::Equals
   if (aIID.Equals(kThisImplCID))
-    foundInterface = static_cast(this);
+    foundInterface = static_cast(this);
   else
     NS_INTERFACE_MAP_ENTRY(nsISizeOf)
 NS_INTERFACE_MAP_END
@@ -1204,7 +1204,7 @@ NS_INTERFACE_MAP_END
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetSpec(nsACString &result) {
+nsStandardURL::GetSpec(nsACString& result) {
   MOZ_ASSERT(mSpec.Length() <= (uint32_t)net_GetURLMaxLength(),
              "The spec should never be this long, we missed a check.");
   nsresult rv = NS_OK;
@@ -1218,7 +1218,7 @@ nsStandardURL::GetSpec(nsACString &result) {
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetSensitiveInfoHiddenSpec(nsACString &result) {
+nsStandardURL::GetSensitiveInfoHiddenSpec(nsACString& result) {
   nsresult rv = GetSpec(result);
   if (NS_FAILED(rv)) {
     return rv;
@@ -1231,7 +1231,7 @@ nsStandardURL::GetSensitiveInfoHiddenSpec(nsACString &result) {
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetSpecIgnoringRef(nsACString &result) {
+nsStandardURL::GetSpecIgnoringRef(nsACString& result) {
   // URI without ref is 0 to one char before ref
   if (mRef.mLen < 0) {
     return GetSpec(result);
@@ -1277,7 +1277,7 @@ nsresult nsStandardURL::CheckIfHostIsAscii() {
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetDisplaySpec(nsACString &aUnicodeSpec) {
+nsStandardURL::GetDisplaySpec(nsACString& aUnicodeSpec) {
   aUnicodeSpec.Assign(mSpec);
   MOZ_ASSERT(mCheckedIfHostA);
   if (!mDisplayHost.IsEmpty()) {
@@ -1288,7 +1288,7 @@ nsStandardURL::GetDisplaySpec(nsACString &aUnicodeSpec) {
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetDisplayHostPort(nsACString &aUnicodeHostPort) {
+nsStandardURL::GetDisplayHostPort(nsACString& aUnicodeHostPort) {
   nsAutoCString unicodeHostPort;
 
   nsresult rv = GetDisplayHost(unicodeHostPort);
@@ -1312,7 +1312,7 @@ nsStandardURL::GetDisplayHostPort(nsACString &aUnicodeHostPort) {
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetDisplayHost(nsACString &aUnicodeHost) {
+nsStandardURL::GetDisplayHost(nsACString& aUnicodeHost) {
   MOZ_ASSERT(mCheckedIfHostA);
   if (mDisplayHost.IsEmpty()) {
     return GetAsciiHost(aUnicodeHost);
@@ -1324,7 +1324,7 @@ nsStandardURL::GetDisplayHost(nsACString &aUnicodeHost) {
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetPrePath(nsACString &result) {
+nsStandardURL::GetPrePath(nsACString& result) {
   result = Prepath();
   MOZ_ASSERT(mCheckedIfHostA);
   if (!gPunycodeHost && !mDisplayHost.IsEmpty()) {
@@ -1335,7 +1335,7 @@ nsStandardURL::GetPrePath(nsACString &result) {
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetDisplayPrePath(nsACString &result) {
+nsStandardURL::GetDisplayPrePath(nsACString& result) {
   result = Prepath();
   MOZ_ASSERT(mCheckedIfHostA);
   if (!mDisplayHost.IsEmpty()) {
@@ -1346,34 +1346,34 @@ nsStandardURL::GetDisplayPrePath(nsACString &result) {
 
 // result is strictly US-ASCII
 NS_IMETHODIMP
-nsStandardURL::GetScheme(nsACString &result) {
+nsStandardURL::GetScheme(nsACString& result) {
   result = Scheme();
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetUserPass(nsACString &result) {
+nsStandardURL::GetUserPass(nsACString& result) {
   result = Userpass();
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetUsername(nsACString &result) {
+nsStandardURL::GetUsername(nsACString& result) {
   result = Username();
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetPassword(nsACString &result) {
+nsStandardURL::GetPassword(nsACString& result) {
   result = Password();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetHostPort(nsACString &result) {
+nsStandardURL::GetHostPort(nsACString& result) {
   nsresult rv;
   if (gPunycodeHost) {
     rv = GetAsciiHostPort(result);
@@ -1384,7 +1384,7 @@ nsStandardURL::GetHostPort(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetHost(nsACString &result) {
+nsStandardURL::GetHost(nsACString& result) {
   nsresult rv;
   if (gPunycodeHost) {
     rv = GetAsciiHost(result);
@@ -1395,7 +1395,7 @@ nsStandardURL::GetHost(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetPort(int32_t *result) {
+nsStandardURL::GetPort(int32_t* result) {
   // should never be more than 16 bit
   MOZ_ASSERT(mPort <= std::numeric_limits::max());
   *result = mPort;
@@ -1404,33 +1404,33 @@ nsStandardURL::GetPort(int32_t *result) {
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetPathQueryRef(nsACString &result) {
+nsStandardURL::GetPathQueryRef(nsACString& result) {
   result = Path();
   return NS_OK;
 }
 
 // result is ASCII
 NS_IMETHODIMP
-nsStandardURL::GetAsciiSpec(nsACString &result) {
+nsStandardURL::GetAsciiSpec(nsACString& result) {
   result = mSpec;
   return NS_OK;
 }
 
 // result is ASCII
 NS_IMETHODIMP
-nsStandardURL::GetAsciiHostPort(nsACString &result) {
+nsStandardURL::GetAsciiHostPort(nsACString& result) {
   result = Hostport();
   return NS_OK;
 }
 
 // result is ASCII
 NS_IMETHODIMP
-nsStandardURL::GetAsciiHost(nsACString &result) {
+nsStandardURL::GetAsciiHost(nsACString& result) {
   result = Host();
   return NS_OK;
 }
 
-static bool IsSpecialProtocol(const nsACString &input) {
+static bool IsSpecialProtocol(const nsACString& input) {
   nsACString::const_iterator start, end;
   input.BeginReading(start);
   nsACString::const_iterator iterator(start);
@@ -1451,13 +1451,13 @@ static bool IsSpecialProtocol(const nsACString &input) {
          protocol.LowerCaseEqualsLiteral("gopher");
 }
 
-nsresult nsStandardURL::SetSpecInternal(const nsACString &input) {
+nsresult nsStandardURL::SetSpecInternal(const nsACString& input) {
   return SetSpecWithEncoding(input, nullptr);
 }
 
-nsresult nsStandardURL::SetSpecWithEncoding(const nsACString &input,
-                                            const Encoding *encoding) {
-  const nsPromiseFlatCString &flat = PromiseFlatCString(input);
+nsresult nsStandardURL::SetSpecWithEncoding(const nsACString& input,
+                                            const Encoding* encoding) {
+  const nsPromiseFlatCString& flat = PromiseFlatCString(input);
   LOG(("nsStandardURL::SetSpec [spec=%s]\n", flat.get()));
 
   if (input.Length() > (uint32_t)net_GetURLMaxLength()) {
@@ -1493,7 +1493,7 @@ nsresult nsStandardURL::SetSpecWithEncoding(const nsACString &input,
     }
   }
 
-  const char *spec = filteredURI.get();
+  const char* spec = filteredURI.get();
   int32_t specLength = filteredURI.Length();
 
   // parse the given URL...
@@ -1537,8 +1537,8 @@ nsresult nsStandardURL::SetSpecWithEncoding(const nsACString &input,
   return rv;
 }
 
-nsresult nsStandardURL::SetScheme(const nsACString &input) {
-  const nsPromiseFlatCString &scheme = PromiseFlatCString(input);
+nsresult nsStandardURL::SetScheme(const nsACString& input) {
+  const nsPromiseFlatCString& scheme = PromiseFlatCString(input);
 
   LOG(("nsStandardURL::SetScheme [scheme=%s]\n", scheme.get()));
 
@@ -1574,12 +1574,12 @@ nsresult nsStandardURL::SetScheme(const nsACString &input) {
   //
   // XXX the string code unfortunately doesn't provide a ToLowerCase
   //     that operates on a substring.
-  net_ToLowerCase((char *)mSpec.get(), mScheme.mLen);
+  net_ToLowerCase((char*)mSpec.get(), mScheme.mLen);
   return NS_OK;
 }
 
-nsresult nsStandardURL::SetUserPass(const nsACString &input) {
-  const nsPromiseFlatCString &userpass = PromiseFlatCString(input);
+nsresult nsStandardURL::SetUserPass(const nsACString& input) {
+  const nsPromiseFlatCString& userpass = PromiseFlatCString(input);
 
   LOG(("nsStandardURL::SetUserPass [userpass=%s]\n", userpass.get()));
 
@@ -1677,8 +1677,8 @@ nsresult nsStandardURL::SetUserPass(const nsACString &input) {
   return NS_OK;
 }
 
-nsresult nsStandardURL::SetUsername(const nsACString &input) {
-  const nsPromiseFlatCString &username = PromiseFlatCString(input);
+nsresult nsStandardURL::SetUsername(const nsACString& input) {
+  const nsPromiseFlatCString& username = PromiseFlatCString(input);
 
   LOG(("nsStandardURL::SetUsername [username=%s]\n", username.get()));
 
@@ -1698,7 +1698,7 @@ nsresult nsStandardURL::SetUsername(const nsACString &input) {
   // escape username if necessary
   nsAutoCString buf;
   nsSegmentEncoder encoder;
-  const nsACString &escUsername =
+  const nsACString& escUsername =
       encoder.EncodeSegment(username, esc_Username, buf);
 
   int32_t shift = 0;
@@ -1733,8 +1733,8 @@ nsresult nsStandardURL::SetUsername(const nsACString &input) {
   return NS_OK;
 }
 
-nsresult nsStandardURL::SetPassword(const nsACString &input) {
-  const nsPromiseFlatCString &password = PromiseFlatCString(input);
+nsresult nsStandardURL::SetPassword(const nsACString& input) {
+  const nsPromiseFlatCString& password = PromiseFlatCString(input);
 
   auto clearedPassword = MakeScopeExit([&password, this]() {
     // Check that if this method is called with the empty string then the
@@ -1780,7 +1780,7 @@ nsresult nsStandardURL::SetPassword(const nsACString &input) {
   // escape password if necessary
   nsAutoCString buf;
   nsSegmentEncoder encoder;
-  const nsACString &escPassword =
+  const nsACString& escPassword =
       encoder.EncodeSegment(password, esc_Password, buf);
 
   int32_t shift;
@@ -1810,8 +1810,8 @@ nsresult nsStandardURL::SetPassword(const nsACString &input) {
   return NS_OK;
 }
 
-void nsStandardURL::FindHostLimit(nsACString::const_iterator &aStart,
-                                  nsACString::const_iterator &aEnd) {
+void nsStandardURL::FindHostLimit(nsACString::const_iterator& aStart,
+                                  nsACString::const_iterator& aEnd) {
   for (int32_t i = 0; gHostLimitDigits[i]; ++i) {
     nsACString::const_iterator c(aStart);
     if (FindCharInReadable(gHostLimitDigits[i], c, aEnd)) {
@@ -1822,7 +1822,7 @@ void nsStandardURL::FindHostLimit(nsACString::const_iterator &aStart,
 
 // If aValue only has a host part and no port number, the port
 // will not be reset!!!
-nsresult nsStandardURL::SetHostPort(const nsACString &aValue) {
+nsresult nsStandardURL::SetHostPort(const nsACString& aValue) {
   // We cannot simply call nsIURI::SetHost because that would treat the name as
   // an IPv6 address (like http:://[server:443]/).  We also cannot call
   // nsIURI::SetHostPort because that isn't implemented.  Sadfaces.
@@ -1887,8 +1887,8 @@ nsresult nsStandardURL::SetHostPort(const nsACString &aValue) {
   return NS_OK;
 }
 
-nsresult nsStandardURL::SetHost(const nsACString &input) {
-  const nsPromiseFlatCString &hostname = PromiseFlatCString(input);
+nsresult nsStandardURL::SetHost(const nsACString& input) {
+  const nsPromiseFlatCString& hostname = PromiseFlatCString(input);
 
   nsACString::const_iterator start, end;
   hostname.BeginReading(start);
@@ -1901,7 +1901,7 @@ nsresult nsStandardURL::SetHost(const nsACString &input) {
   nsAutoCString flat;
   NS_UnescapeURL(unescapedHost.BeginReading(), unescapedHost.Length(),
                  esc_AlwaysCopy | esc_Host, flat);
-  const char *host = flat.get();
+  const char* host = flat.get();
 
   LOG(("nsStandardURL::SetHost [host=%s]\n", host));
 
@@ -2056,8 +2056,8 @@ void nsStandardURL::ReplacePortInSpec(int32_t aNewPort) {
   ShiftFromPath(shift);
 }
 
-nsresult nsStandardURL::SetPathQueryRef(const nsACString &input) {
-  const nsPromiseFlatCString &path = PromiseFlatCString(input);
+nsresult nsStandardURL::SetPathQueryRef(const nsACString& input) {
+  const nsPromiseFlatCString& path = PromiseFlatCString(input);
   LOG(("nsStandardURL::SetPathQueryRef [path=%s]\n", path.get()));
 
   InvalidateCache();
@@ -2094,7 +2094,7 @@ NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsStandardURL::Mutator, nsIURISetters,
                                 nsISerializable)
 
 NS_IMETHODIMP
-nsStandardURL::Mutate(nsIURIMutator **aMutator) {
+nsStandardURL::Mutate(nsIURIMutator** aMutator) {
   RefPtr mutator = new nsStandardURL::Mutator();
   nsresult rv = mutator->InitFromURI(this);
   if (NS_FAILED(rv)) {
@@ -2105,18 +2105,18 @@ nsStandardURL::Mutate(nsIURIMutator **aMutator) {
 }
 
 NS_IMETHODIMP
-nsStandardURL::Equals(nsIURI *unknownOther, bool *result) {
+nsStandardURL::Equals(nsIURI* unknownOther, bool* result) {
   return EqualsInternal(unknownOther, eHonorRef, result);
 }
 
 NS_IMETHODIMP
-nsStandardURL::EqualsExceptRef(nsIURI *unknownOther, bool *result) {
+nsStandardURL::EqualsExceptRef(nsIURI* unknownOther, bool* result) {
   return EqualsInternal(unknownOther, eIgnoreRef, result);
 }
 
 nsresult nsStandardURL::EqualsInternal(
-    nsIURI *unknownOther, nsStandardURL::RefHandlingEnum refHandlingMode,
-    bool *result) {
+    nsIURI* unknownOther, nsStandardURL::RefHandlingEnum refHandlingMode,
+    bool* result) {
   NS_ENSURE_ARG_POINTER(unknownOther);
   MOZ_ASSERT(result, "null pointer");
 
@@ -2205,7 +2205,7 @@ nsresult nsStandardURL::EqualsInternal(
 }
 
 NS_IMETHODIMP
-nsStandardURL::SchemeIs(const char *scheme, bool *result) {
+nsStandardURL::SchemeIs(const char* scheme, bool* result) {
   MOZ_ASSERT(result, "null pointer");
   if (!scheme) {
     *result = false;
@@ -2216,18 +2216,18 @@ nsStandardURL::SchemeIs(const char *scheme, bool *result) {
   return NS_OK;
 }
 
-/* virtual */ nsStandardURL *nsStandardURL::StartClone() {
-  nsStandardURL *clone = new nsStandardURL();
+/* virtual */ nsStandardURL* nsStandardURL::StartClone() {
+  nsStandardURL* clone = new nsStandardURL();
   return clone;
 }
 
-nsresult nsStandardURL::Clone(nsIURI **result) {
+nsresult nsStandardURL::Clone(nsIURI** result) {
   return CloneInternal(eHonorRef, EmptyCString(), result);
 }
 
 nsresult nsStandardURL::CloneInternal(
-    nsStandardURL::RefHandlingEnum refHandlingMode, const nsACString &newRef,
-    nsIURI **result)
+    nsStandardURL::RefHandlingEnum refHandlingMode, const nsACString& newRef,
+    nsIURI** result)
 
 {
   RefPtr clone = StartClone();
@@ -2242,8 +2242,8 @@ nsresult nsStandardURL::CloneInternal(
 }
 
 nsresult nsStandardURL::CopyMembers(
-    nsStandardURL *source, nsStandardURL::RefHandlingEnum refHandlingMode,
-    const nsACString &newRef, bool copyCached) {
+    nsStandardURL* source, nsStandardURL::RefHandlingEnum refHandlingMode,
+    const nsACString& newRef, bool copyCached) {
   mSpec = source->mSpec;
   mDefaultPort = source->mDefaultPort;
   mPort = source->mPort;
@@ -2281,16 +2281,16 @@ nsresult nsStandardURL::CopyMembers(
 }
 
 NS_IMETHODIMP
-nsStandardURL::Resolve(const nsACString &in, nsACString &out) {
-  const nsPromiseFlatCString &flat = PromiseFlatCString(in);
+nsStandardURL::Resolve(const nsACString& in, nsACString& out) {
+  const nsPromiseFlatCString& flat = PromiseFlatCString(in);
   // filter out unexpected chars "\r\n\t" if necessary
   nsAutoCString buf;
   net_FilterURIString(flat, buf);
 
-  const char *relpath = buf.get();
+  const char* relpath = buf.get();
   int32_t relpathLen = buf.Length();
 
-  char *result = nullptr;
+  char* result = nullptr;
 
   LOG(("nsStandardURL::Resolve [this=%p spec=%s relpath=%s]\n", this,
        mSpec.get(), relpath));
@@ -2308,7 +2308,7 @@ nsStandardURL::Resolve(const nsACString &in, nsACString &out) {
 
   nsresult rv;
   URLSegment scheme;
-  char *resultPath = nullptr;
+  char* resultPath = nullptr;
   bool relative = false;
   uint32_t offset = 0;
   netCoalesceFlags coalesceFlag = NET_COALESCE_NORMAL;
@@ -2392,7 +2392,7 @@ nsStandardURL::Resolve(const nsACString &in, nsACString &out) {
   }
   if (relative) {
     uint32_t len = 0;
-    const char *realrelpath = relpath + offset;
+    const char* realrelpath = relpath + offset;
     switch (*realrelpath) {
       case '/':
         // overwrite everything after the authority
@@ -2454,7 +2454,7 @@ nsStandardURL::Resolve(const nsACString &in, nsACString &out) {
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetCommonBaseSpec(nsIURI *uri2, nsACString &aResult) {
+nsStandardURL::GetCommonBaseSpec(nsIURI* uri2, nsACString& aResult) {
   NS_ENSURE_ARG_POINTER(uri2);
 
   // if uri's are equal, then return uri as is
@@ -2499,7 +2499,7 @@ nsStandardURL::GetCommonBaseSpec(nsIURI *uri2, nsACString &aResult) {
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetRelativeSpec(nsIURI *uri2, nsACString &aResult) {
+nsStandardURL::GetRelativeSpec(nsIURI* uri2, nsACString& aResult) {
   NS_ENSURE_ARG_POINTER(uri2);
 
   aResult.Truncate();
@@ -2559,7 +2559,7 @@ nsStandardURL::GetRelativeSpec(nsIURI *uri2, nsACString &aResult) {
   // todo:  also check for file matches with '#' and '?'
   while ((*(thatIndex - 1) != '/') && (thatIndex != startCharPos)) thatIndex--;
 
-  const char *limit = mSpec.get() + mFilepath.mPos + mFilepath.mLen;
+  const char* limit = mSpec.get() + mFilepath.mPos + mFilepath.mLen;
 
   // need to account for slashes and add corresponding "../"
   for (; thisIndex <= limit && *thisIndex; ++thisIndex) {
@@ -2580,62 +2580,62 @@ nsStandardURL::GetRelativeSpec(nsIURI *uri2, nsACString &aResult) {
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetFilePath(nsACString &result) {
+nsStandardURL::GetFilePath(nsACString& result) {
   result = Filepath();
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetQuery(nsACString &result) {
+nsStandardURL::GetQuery(nsACString& result) {
   result = Query();
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetRef(nsACString &result) {
+nsStandardURL::GetRef(nsACString& result) {
   result = Ref();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetHasRef(bool *result) {
+nsStandardURL::GetHasRef(bool* result) {
   *result = (mRef.mLen >= 0);
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetDirectory(nsACString &result) {
+nsStandardURL::GetDirectory(nsACString& result) {
   result = Directory();
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetFileName(nsACString &result) {
+nsStandardURL::GetFileName(nsACString& result) {
   result = Filename();
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetFileBaseName(nsACString &result) {
+nsStandardURL::GetFileBaseName(nsACString& result) {
   result = Basename();
   return NS_OK;
 }
 
 // result may contain unescaped UTF-8 characters
 NS_IMETHODIMP
-nsStandardURL::GetFileExtension(nsACString &result) {
+nsStandardURL::GetFileExtension(nsACString& result) {
   result = Extension();
   return NS_OK;
 }
 
-nsresult nsStandardURL::SetFilePath(const nsACString &input) {
-  const nsPromiseFlatCString &flat = PromiseFlatCString(input);
-  const char *filepath = flat.get();
+nsresult nsStandardURL::SetFilePath(const nsACString& input) {
+  const nsPromiseFlatCString& flat = PromiseFlatCString(input);
+  const char* filepath = flat.get();
 
   LOG(("nsStandardURL::SetFilePath [filepath=%s]\n", filepath));
 
@@ -2702,19 +2702,19 @@ nsresult nsStandardURL::SetFilePath(const nsACString &input) {
   return NS_OK;
 }
 
-inline bool IsUTFEncoding(const Encoding *aEncoding) {
+inline bool IsUTFEncoding(const Encoding* aEncoding) {
   return aEncoding == UTF_8_ENCODING || aEncoding == UTF_16BE_ENCODING ||
          aEncoding == UTF_16LE_ENCODING;
 }
 
-nsresult nsStandardURL::SetQuery(const nsACString &input) {
+nsresult nsStandardURL::SetQuery(const nsACString& input) {
   return SetQueryWithEncoding(input, nullptr);
 }
 
-nsresult nsStandardURL::SetQueryWithEncoding(const nsACString &input,
-                                             const Encoding *encoding) {
-  const nsPromiseFlatCString &flat = PromiseFlatCString(input);
-  const char *query = flat.get();
+nsresult nsStandardURL::SetQueryWithEncoding(const nsACString& input,
+                                             const Encoding* encoding) {
+  const nsPromiseFlatCString& flat = PromiseFlatCString(input);
+  const char* query = flat.get();
 
   LOG(("nsStandardURL::SetQuery [query=%s]\n", query));
 
@@ -2784,9 +2784,9 @@ nsresult nsStandardURL::SetQueryWithEncoding(const nsACString &input,
   return NS_OK;
 }
 
-nsresult nsStandardURL::SetRef(const nsACString &input) {
-  const nsPromiseFlatCString &flat = PromiseFlatCString(input);
-  const char *ref = flat.get();
+nsresult nsStandardURL::SetRef(const nsACString& input) {
+  const nsPromiseFlatCString& flat = PromiseFlatCString(input);
+  const char* ref = flat.get();
 
   LOG(("nsStandardURL::SetRef [ref=%s]\n", ref));
 
@@ -2842,9 +2842,9 @@ nsresult nsStandardURL::SetRef(const nsACString &input) {
   return NS_OK;
 }
 
-nsresult nsStandardURL::SetFileNameInternal(const nsACString &input) {
-  const nsPromiseFlatCString &flat = PromiseFlatCString(input);
-  const char *filename = flat.get();
+nsresult nsStandardURL::SetFileNameInternal(const nsACString& input) {
+  const nsPromiseFlatCString& flat = PromiseFlatCString(input);
+  const char* filename = flat.get();
 
   LOG(("nsStandardURL::SetFileNameInternal [filename=%s]\n", filename));
 
@@ -2927,7 +2927,7 @@ nsresult nsStandardURL::SetFileNameInternal(const nsACString &input) {
   return NS_OK;
 }
 
-nsresult nsStandardURL::SetFileBaseNameInternal(const nsACString &input) {
+nsresult nsStandardURL::SetFileBaseNameInternal(const nsACString& input) {
   nsAutoCString extension;
   nsresult rv = GetFileExtension(extension);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -2942,7 +2942,7 @@ nsresult nsStandardURL::SetFileBaseNameInternal(const nsACString &input) {
   return SetFileNameInternal(newFileName);
 }
 
-nsresult nsStandardURL::SetFileExtensionInternal(const nsACString &input) {
+nsresult nsStandardURL::SetFileExtensionInternal(const nsACString& input) {
   nsAutoCString newFileName;
   nsresult rv = GetFileBaseName(newFileName);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -2983,7 +2983,7 @@ nsresult nsStandardURL::EnsureFile() {
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetFile(nsIFile **result) {
+nsStandardURL::GetFile(nsIFile** result) {
   MOZ_ASSERT(mSupportsFileURL,
              "GetFile() called on a URL that doesn't support files!");
 
@@ -3004,7 +3004,7 @@ nsStandardURL::GetFile(nsIFile **result) {
   return mFile->Clone(result);
 }
 
-nsresult nsStandardURL::SetFile(nsIFile *file) {
+nsresult nsStandardURL::SetFile(nsIFile* file) {
   NS_ENSURE_ARG_POINTER(file);
 
   nsresult rv;
@@ -3040,8 +3040,8 @@ nsresult nsStandardURL::SetFile(nsIFile *file) {
 //----------------------------------------------------------------------------
 
 nsresult nsStandardURL::Init(uint32_t urlType, int32_t defaultPort,
-                             const nsACString &spec, const char *charset,
-                             nsIURI *baseURI) {
+                             const nsACString& spec, const char* charset,
+                             nsIURI* baseURI) {
   if (spec.Length() > (uint32_t)net_GetURLMaxLength() ||
       defaultPort > std::numeric_limits::max()) {
     return NS_ERROR_MALFORMED_URI;
@@ -3114,12 +3114,12 @@ nsresult nsStandardURL::SetDefaultPort(int32_t aNewDefaultPort) {
 //----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsStandardURL::Read(nsIObjectInputStream *stream) {
+nsStandardURL::Read(nsIObjectInputStream* stream) {
   MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-nsresult nsStandardURL::ReadPrivate(nsIObjectInputStream *stream) {
+nsresult nsStandardURL::ReadPrivate(nsIObjectInputStream* stream) {
   MOZ_ASSERT(mDisplayHost.IsEmpty(), "Shouldn't have cached unicode host");
 
   nsresult rv;
@@ -3143,10 +3143,10 @@ nsresult nsStandardURL::ReadPrivate(nsIObjectInputStream *stream) {
       return NS_ERROR_FAILURE;
   }
 
-  rv = stream->Read32((uint32_t *)&mPort);
+  rv = stream->Read32((uint32_t*)&mPort);
   if (NS_FAILED(rv)) return rv;
 
-  rv = stream->Read32((uint32_t *)&mDefaultPort);
+  rv = stream->Read32((uint32_t*)&mDefaultPort);
   if (NS_FAILED(rv)) return rv;
 
   rv = NS_ReadOptionalCString(stream, mSpec);
@@ -3228,7 +3228,7 @@ nsresult nsStandardURL::ReadPrivate(nsIObjectInputStream *stream) {
 }
 
 NS_IMETHODIMP
-nsStandardURL::Write(nsIObjectOutputStream *stream) {
+nsStandardURL::Write(nsIObjectOutputStream* stream) {
   MOZ_ASSERT(mSpec.Length() <= (uint32_t)net_GetURLMaxLength(),
              "The spec should never be this long, we missed a check.");
   nsresult rv;
@@ -3306,13 +3306,13 @@ nsStandardURL::Write(nsIObjectOutputStream *stream) {
 }
 
 inline ipc::StandardURLSegment ToIPCSegment(
-    const nsStandardURL::URLSegment &aSegment) {
+    const nsStandardURL::URLSegment& aSegment) {
   return ipc::StandardURLSegment(aSegment.mPos, aSegment.mLen);
 }
 
-inline MOZ_MUST_USE bool FromIPCSegment(const nsACString &aSpec,
-                                        const ipc::StandardURLSegment &aSegment,
-                                        nsStandardURL::URLSegment &aTarget) {
+inline MOZ_MUST_USE bool FromIPCSegment(const nsACString& aSpec,
+                                        const ipc::StandardURLSegment& aSegment,
+                                        nsStandardURL::URLSegment& aTarget) {
   // This seems to be just an empty segment.
   if (aSegment.length() == -1) {
     aTarget = nsStandardURL::URLSegment();
@@ -3338,7 +3338,7 @@ inline MOZ_MUST_USE bool FromIPCSegment(const nsACString &aSpec,
   return true;
 }
 
-void nsStandardURL::Serialize(URIParams &aParams) {
+void nsStandardURL::Serialize(URIParams& aParams) {
   MOZ_ASSERT(mSpec.Length() <= (uint32_t)net_GetURLMaxLength(),
              "The spec should never be this long, we missed a check.");
   StandardURLParams params;
@@ -3365,7 +3365,7 @@ void nsStandardURL::Serialize(URIParams &aParams) {
   aParams = params;
 }
 
-bool nsStandardURL::Deserialize(const URIParams &aParams) {
+bool nsStandardURL::Deserialize(const URIParams& aParams) {
   MOZ_ASSERT(mDisplayHost.IsEmpty(), "Shouldn't have cached unicode host");
   MOZ_ASSERT(!mFile, "Shouldn't have cached file");
 
@@ -3374,7 +3374,7 @@ bool nsStandardURL::Deserialize(const URIParams &aParams) {
     return false;
   }
 
-  const StandardURLParams ¶ms = aParams.get_StandardURLParams();
+  const StandardURLParams& params = aParams.get_StandardURLParams();
 
   mURLType = params.urlType();
   switch (mURLType) {
@@ -3442,43 +3442,43 @@ bool nsStandardURL::Deserialize(const URIParams &aParams) {
 //----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsStandardURL::GetInterfaces(nsTArray &array) {
+nsStandardURL::GetInterfaces(nsTArray& array) {
   array.Clear();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetScriptableHelper(nsIXPCScriptable **_retval) {
+nsStandardURL::GetScriptableHelper(nsIXPCScriptable** _retval) {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetContractID(nsACString &aContractID) {
+nsStandardURL::GetContractID(nsACString& aContractID) {
   aContractID.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetClassDescription(nsACString &aClassDescription) {
+nsStandardURL::GetClassDescription(nsACString& aClassDescription) {
   aClassDescription.SetIsVoid(true);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetClassID(nsCID **aClassID) {
-  *aClassID = (nsCID *)moz_xmalloc(sizeof(nsCID));
+nsStandardURL::GetClassID(nsCID** aClassID) {
+  *aClassID = (nsCID*)moz_xmalloc(sizeof(nsCID));
   return GetClassIDNoAlloc(*aClassID);
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetFlags(uint32_t *aFlags) {
+nsStandardURL::GetFlags(uint32_t* aFlags) {
   *aFlags = nsIClassInfo::MAIN_THREAD_ONLY;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStandardURL::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) {
+nsStandardURL::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc) {
   *aClassIDNoAlloc = kStandardURLCID;
   return NS_OK;
 }
@@ -3505,6 +3505,6 @@ size_t nsStandardURL::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
 }  // namespace mozilla
 
 // For unit tests.  Including nsStandardURL.h seems to cause problems
-nsresult Test_NormalizeIPv4(const nsACString &host, nsCString &result) {
+nsresult Test_NormalizeIPv4(const nsACString& host, nsCString& result) {
   return mozilla::net::nsStandardURL::NormalizeIPv4(host, result);
 }
diff --git a/netwerk/base/nsStandardURL.h b/netwerk/base/nsStandardURL.h
index 2fbc676f568cf..0c0b1c999740b 100644
--- a/netwerk/base/nsStandardURL.h
+++ b/netwerk/base/nsStandardURL.h
@@ -83,7 +83,7 @@ class nsStandardURL : public nsIFileURL,
 
     URLSegment() : mPos(0), mLen(-1) {}
     URLSegment(uint32_t pos, int32_t len) : mPos(pos), mLen(len) {}
-    URLSegment(const URLSegment &aCopy) = default;
+    URLSegment(const URLSegment& aCopy) = default;
     void Reset() {
       mPos = 0;
       mLen = -1;
@@ -91,8 +91,8 @@ class nsStandardURL : public nsIFileURL,
     // Merge another segment following this one to it if they're contiguous
     // Assumes we have something like "foo;bar" where this object is 'foo' and
     // right is 'bar'.
-    void Merge(const nsCString &spec, const char separator,
-               const URLSegment &right) {
+    void Merge(const nsCString& spec, const char separator,
+               const URLSegment& right) {
       if (mLen >= 0 && *(spec.get() + mPos + mLen) == separator &&
           mPos + mLen + 1 == right.mPos) {
         mLen += 1 + right.mLen;
@@ -105,27 +105,27 @@ class nsStandardURL : public nsIFileURL,
   //
   class nsSegmentEncoder {
    public:
-    explicit nsSegmentEncoder(const Encoding *encoding = nullptr);
+    explicit nsSegmentEncoder(const Encoding* encoding = nullptr);
 
     // Encode the given segment if necessary, and return the length of
     // the encoded segment.  The encoded segment is appended to |buf|
     // if and only if encoding is required.
-    int32_t EncodeSegmentCount(const char *str, const URLSegment &segment,
-                               int16_t mask, nsCString &buf, bool &appended,
+    int32_t EncodeSegmentCount(const char* str, const URLSegment& segment,
+                               int16_t mask, nsCString& buf, bool& appended,
                                uint32_t extraLen = 0);
 
     // Encode the given string if necessary, and return a reference to
     // the encoded string.  Returns a reference to |buf| if encoding
     // is required.  Otherwise, a reference to |str| is returned.
-    const nsACString &EncodeSegment(const nsACString &str, int16_t mask,
-                                    nsCString &buf);
+    const nsACString& EncodeSegment(const nsACString& str, int16_t mask,
+                                    nsCString& buf);
 
    private:
-    const Encoding *mEncoding;
+    const Encoding* mEncoding;
   };
   friend class nsSegmentEncoder;
 
-  static nsresult NormalizeIPv4(const nsACString &host, nsCString &result);
+  static nsresult NormalizeIPv4(const nsACString& host, nsCString& result);
 
  protected:
   // enum used in a few places to specify how .ref attribute should be handled
@@ -133,18 +133,18 @@ class nsStandardURL : public nsIFileURL,
 
   // Helper to share code between Equals and EqualsExceptRef
   // NOTE: *not* virtual, because no one needs to override this so far...
-  nsresult EqualsInternal(nsIURI *unknownOther, RefHandlingEnum refHandlingMode,
-                          bool *result);
+  nsresult EqualsInternal(nsIURI* unknownOther, RefHandlingEnum refHandlingMode,
+                          bool* result);
 
-  virtual nsStandardURL *StartClone();
+  virtual nsStandardURL* StartClone();
 
   // Helper to share code between Clone methods.
   nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
-                         const nsACString &newRef, nsIURI **aClone);
+                         const nsACString& newRef, nsIURI** aClone);
   // Helper method that copies member variables from the source StandardURL
   // if copyCached = true, it will also copy mFile and mDisplayHost
-  nsresult CopyMembers(nsStandardURL *source, RefHandlingEnum mode,
-                       const nsACString &newRef, bool copyCached = false);
+  nsresult CopyMembers(nsStandardURL* source, RefHandlingEnum mode,
+                       const nsACString& newRef, bool copyCached = false);
 
   // Helper for subclass implementation of GetFile().  Subclasses that map
   // URIs to files in a special way should implement this method.  It should
@@ -152,33 +152,33 @@ class nsStandardURL : public nsIFileURL,
   // returns NS_ERROR_NO_INTERFACE if the url does not map to a file
   virtual nsresult EnsureFile();
 
-  virtual nsresult Clone(nsIURI **aURI);
-  virtual nsresult SetSpecInternal(const nsACString &input);
-  virtual nsresult SetScheme(const nsACString &input);
-  virtual nsresult SetUserPass(const nsACString &input);
-  virtual nsresult SetUsername(const nsACString &input);
-  virtual nsresult SetPassword(const nsACString &input);
-  virtual nsresult SetHostPort(const nsACString &aValue);
-  virtual nsresult SetHost(const nsACString &input);
+  virtual nsresult Clone(nsIURI** aURI);
+  virtual nsresult SetSpecInternal(const nsACString& input);
+  virtual nsresult SetScheme(const nsACString& input);
+  virtual nsresult SetUserPass(const nsACString& input);
+  virtual nsresult SetUsername(const nsACString& input);
+  virtual nsresult SetPassword(const nsACString& input);
+  virtual nsresult SetHostPort(const nsACString& aValue);
+  virtual nsresult SetHost(const nsACString& input);
   virtual nsresult SetPort(int32_t port);
-  virtual nsresult SetPathQueryRef(const nsACString &input);
-  virtual nsresult SetRef(const nsACString &input);
-  virtual nsresult SetFilePath(const nsACString &input);
-  virtual nsresult SetQuery(const nsACString &input);
-  virtual nsresult SetQueryWithEncoding(const nsACString &input,
-                                        const Encoding *encoding);
-  bool Deserialize(const mozilla::ipc::URIParams &);
-  nsresult ReadPrivate(nsIObjectInputStream *stream);
+  virtual nsresult SetPathQueryRef(const nsACString& input);
+  virtual nsresult SetRef(const nsACString& input);
+  virtual nsresult SetFilePath(const nsACString& input);
+  virtual nsresult SetQuery(const nsACString& input);
+  virtual nsresult SetQueryWithEncoding(const nsACString& input,
+                                        const Encoding* encoding);
+  bool Deserialize(const mozilla::ipc::URIParams&);
+  nsresult ReadPrivate(nsIObjectInputStream* stream);
 
  private:
-  nsresult Init(uint32_t urlType, int32_t defaultPort, const nsACString &spec,
-                const char *charset, nsIURI *baseURI);
+  nsresult Init(uint32_t urlType, int32_t defaultPort, const nsACString& spec,
+                const char* charset, nsIURI* baseURI);
   nsresult SetDefaultPort(int32_t aNewDefaultPort);
-  nsresult SetFile(nsIFile *file);
+  nsresult SetFile(nsIFile* file);
 
-  nsresult SetFileNameInternal(const nsACString &input);
-  nsresult SetFileBaseNameInternal(const nsACString &input);
-  nsresult SetFileExtensionInternal(const nsACString &input);
+  nsresult SetFileNameInternal(const nsACString& input);
+  nsresult SetFileBaseNameInternal(const nsACString& input);
+  nsresult SetFileExtensionInternal(const nsACString& input);
 
   int32_t Port() { return mPort == -1 ? mDefaultPort : mPort; }
 
@@ -186,41 +186,41 @@ class nsStandardURL : public nsIFileURL,
   void Clear();
   void InvalidateCache(bool invalidateCachedFile = true);
 
-  bool ValidIPv6orHostname(const char *host, uint32_t aLen);
+  bool ValidIPv6orHostname(const char* host, uint32_t aLen);
   static bool IsValidOfBase(unsigned char c, const uint32_t base);
-  nsresult NormalizeIDN(const nsACString &host, nsCString &result);
+  nsresult NormalizeIDN(const nsACString& host, nsCString& result);
   nsresult CheckIfHostIsAscii();
-  void CoalescePath(netCoalesceFlags coalesceFlag, char *path);
+  void CoalescePath(netCoalesceFlags coalesceFlag, char* path);
 
-  uint32_t AppendSegmentToBuf(char *, uint32_t, const char *,
-                              const URLSegment &input, URLSegment &output,
-                              const nsCString *esc = nullptr,
-                              bool useEsc = false, int32_t *diff = nullptr);
-  uint32_t AppendToBuf(char *, uint32_t, const char *, uint32_t);
+  uint32_t AppendSegmentToBuf(char*, uint32_t, const char*,
+                              const URLSegment& input, URLSegment& output,
+                              const nsCString* esc = nullptr,
+                              bool useEsc = false, int32_t* diff = nullptr);
+  uint32_t AppendToBuf(char*, uint32_t, const char*, uint32_t);
 
-  nsresult BuildNormalizedSpec(const char *spec, const Encoding *encoding);
-  nsresult SetSpecWithEncoding(const nsACString &input,
-                               const Encoding *encoding);
+  nsresult BuildNormalizedSpec(const char* spec, const Encoding* encoding);
+  nsresult SetSpecWithEncoding(const nsACString& input,
+                               const Encoding* encoding);
 
-  bool SegmentIs(const URLSegment &s1, const char *val,
+  bool SegmentIs(const URLSegment& s1, const char* val,
                  bool ignoreCase = false);
-  bool SegmentIs(const char *spec, const URLSegment &s1, const char *val,
+  bool SegmentIs(const char* spec, const URLSegment& s1, const char* val,
                  bool ignoreCase = false);
-  bool SegmentIs(const URLSegment &s1, const char *val, const URLSegment &s2,
+  bool SegmentIs(const URLSegment& s1, const char* val, const URLSegment& s2,
                  bool ignoreCase = false);
 
-  int32_t ReplaceSegment(uint32_t pos, uint32_t len, const char *val,
+  int32_t ReplaceSegment(uint32_t pos, uint32_t len, const char* val,
                          uint32_t valLen);
-  int32_t ReplaceSegment(uint32_t pos, uint32_t len, const nsACString &val);
+  int32_t ReplaceSegment(uint32_t pos, uint32_t len, const nsACString& val);
 
-  nsresult ParseURL(const char *spec, int32_t specLen);
-  nsresult ParsePath(const char *spec, uint32_t pathPos, int32_t pathLen = -1);
+  nsresult ParseURL(const char* spec, int32_t specLen);
+  nsresult ParsePath(const char* spec, uint32_t pathPos, int32_t pathLen = -1);
 
-  char *AppendToSubstring(uint32_t pos, int32_t len, const char *tail);
+  char* AppendToSubstring(uint32_t pos, int32_t len, const char* tail);
 
   // dependent substring helpers
   const nsDependentCSubstring Segment(uint32_t pos, int32_t len);  // see below
-  const nsDependentCSubstring Segment(const URLSegment &s) {
+  const nsDependentCSubstring Segment(const URLSegment& s) {
     return Segment(s.mPos, s.mLen);
   }
 
@@ -255,11 +255,11 @@ class nsStandardURL : public nsIFileURL,
   void ShiftFromRef(int32_t diff);
 
   // fastload helper functions
-  nsresult ReadSegment(nsIBinaryInputStream *, URLSegment &);
-  nsresult WriteSegment(nsIBinaryOutputStream *, const URLSegment &);
+  nsresult ReadSegment(nsIBinaryInputStream*, URLSegment&);
+  nsresult WriteSegment(nsIBinaryOutputStream*, const URLSegment&);
 
-  void FindHostLimit(nsACString::const_iterator &aStart,
-                     nsACString::const_iterator &aEnd);
+  void FindHostLimit(nsACString::const_iterator& aStart,
+                     nsACString::const_iterator& aEnd);
 
   // mSpec contains the normalized version of the URL spec (UTF-8 encoded).
   nsCString mSpec;
@@ -322,27 +322,27 @@ class nsStandardURL : public nsIFileURL,
     NS_FORWARD_SAFE_NSIURISETTERS_RET(BaseURIMutator::mURI)
 
     MOZ_MUST_USE NS_IMETHOD
-    Deserialize(const mozilla::ipc::URIParams &aParams) override {
+    Deserialize(const mozilla::ipc::URIParams& aParams) override {
       return BaseURIMutator::InitFromIPCParams(aParams);
     }
 
     NS_IMETHOD
-    Write(nsIObjectOutputStream *aOutputStream) override {
+    Write(nsIObjectOutputStream* aOutputStream) override {
       MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead");
       return NS_ERROR_NOT_IMPLEMENTED;
     }
 
-    MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream *aStream) override {
+    MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream* aStream) override {
       return BaseURIMutator::InitFromInputStream(aStream);
     }
 
-    MOZ_MUST_USE NS_IMETHOD Finalize(nsIURI **aURI) override {
+    MOZ_MUST_USE NS_IMETHOD Finalize(nsIURI** aURI) override {
       BaseURIMutator::mURI.forget(aURI);
       return NS_OK;
     }
 
-    MOZ_MUST_USE NS_IMETHOD SetSpec(const nsACString &aSpec,
-                                    nsIURIMutator **aMutator) override {
+    MOZ_MUST_USE NS_IMETHOD SetSpec(const nsACString& aSpec,
+                                    nsIURIMutator** aMutator) override {
       if (aMutator) {
         nsCOMPtr mutator = this;
         mutator.forget(aMutator);
@@ -351,9 +351,9 @@ class nsStandardURL : public nsIFileURL,
     }
 
     MOZ_MUST_USE NS_IMETHOD Init(uint32_t aURLType, int32_t aDefaultPort,
-                                 const nsACString &aSpec, const char *aCharset,
-                                 nsIURI *aBaseURI,
-                                 nsIURIMutator **aMutator) override {
+                                 const nsACString& aSpec, const char* aCharset,
+                                 nsIURI* aBaseURI,
+                                 nsIURIMutator** aMutator) override {
       if (aMutator) {
         nsCOMPtr mutator = this;
         mutator.forget(aMutator);
@@ -375,7 +375,7 @@ class nsStandardURL : public nsIFileURL,
     }
 
     MOZ_MUST_USE NS_IMETHODIMP
-    SetDefaultPort(int32_t aNewDefaultPort, nsIURIMutator **aMutator) override {
+    SetDefaultPort(int32_t aNewDefaultPort, nsIURIMutator** aMutator) override {
       if (!BaseURIMutator::mURI) {
         return NS_ERROR_NULL_POINTER;
       }
@@ -386,8 +386,8 @@ class nsStandardURL : public nsIFileURL,
       return BaseURIMutator::mURI->SetDefaultPort(aNewDefaultPort);
     }
 
-    MOZ_MUST_USE NS_IMETHOD SetFileName(const nsACString &aFileName,
-                                        nsIURIMutator **aMutator) override {
+    MOZ_MUST_USE NS_IMETHOD SetFileName(const nsACString& aFileName,
+                                        nsIURIMutator** aMutator) override {
       if (!BaseURIMutator::mURI) {
         return NS_ERROR_NULL_POINTER;
       }
@@ -398,8 +398,8 @@ class nsStandardURL : public nsIFileURL,
       return BaseURIMutator::mURI->SetFileNameInternal(aFileName);
     }
 
-    MOZ_MUST_USE NS_IMETHOD SetFileBaseName(const nsACString &aFileBaseName,
-                                            nsIURIMutator **aMutator) override {
+    MOZ_MUST_USE NS_IMETHOD SetFileBaseName(const nsACString& aFileBaseName,
+                                            nsIURIMutator** aMutator) override {
       if (!BaseURIMutator::mURI) {
         return NS_ERROR_NULL_POINTER;
       }
@@ -411,7 +411,7 @@ class nsStandardURL : public nsIFileURL,
     }
 
     MOZ_MUST_USE NS_IMETHOD SetFileExtension(
-        const nsACString &aFileExtension, nsIURIMutator **aMutator) override {
+        const nsACString& aFileExtension, nsIURIMutator** aMutator) override {
       if (!BaseURIMutator::mURI) {
         return NS_ERROR_NULL_POINTER;
       }
@@ -422,14 +422,14 @@ class nsStandardURL : public nsIFileURL,
       return BaseURIMutator::mURI->SetFileExtensionInternal(aFileExtension);
     }
 
-    T *Create() override { return new T(mMarkedFileURL); }
+    T* Create() override { return new T(mMarkedFileURL); }
 
     MOZ_MUST_USE NS_IMETHOD MarkFileURL() override {
       mMarkedFileURL = true;
       return NS_OK;
     }
 
-    MOZ_MUST_USE NS_IMETHOD SetFile(nsIFile *aFile) override {
+    MOZ_MUST_USE NS_IMETHOD SetFile(nsIFile* aFile) override {
       RefPtr uri;
       if (BaseURIMutator::mURI) {
         // We don't need a new URI object if we already have one
diff --git a/netwerk/base/nsStreamListenerTee.cpp b/netwerk/base/nsStreamListenerTee.cpp
index d26810e8ae841..566ba029b3b35 100644
--- a/netwerk/base/nsStreamListenerTee.cpp
+++ b/netwerk/base/nsStreamListenerTee.cpp
@@ -12,7 +12,7 @@ NS_IMPL_ISUPPORTS(nsStreamListenerTee, nsIStreamListener, nsIRequestObserver,
                   nsIStreamListenerTee, nsIThreadRetargetableStreamListener)
 
 NS_IMETHODIMP
-nsStreamListenerTee::OnStartRequest(nsIRequest *request) {
+nsStreamListenerTee::OnStartRequest(nsIRequest* request) {
   NS_ENSURE_TRUE(mListener, NS_ERROR_NOT_INITIALIZED);
   nsresult rv1 = mListener->OnStartRequest(request);
   nsresult rv2 = NS_OK;
@@ -23,7 +23,7 @@ nsStreamListenerTee::OnStartRequest(nsIRequest *request) {
 }
 
 NS_IMETHODIMP
-nsStreamListenerTee::OnStopRequest(nsIRequest *request, nsresult status) {
+nsStreamListenerTee::OnStopRequest(nsIRequest* request, nsresult status) {
   NS_ENSURE_TRUE(mListener, NS_ERROR_NOT_INITIALIZED);
   // it is critical that we close out the input stream tee
   if (mInputTee) {
@@ -45,7 +45,7 @@ nsStreamListenerTee::OnStopRequest(nsIRequest *request, nsresult status) {
 }
 
 NS_IMETHODIMP
-nsStreamListenerTee::OnDataAvailable(nsIRequest *request, nsIInputStream *input,
+nsStreamListenerTee::OnDataAvailable(nsIRequest* request, nsIInputStream* input,
                                      uint64_t offset, uint32_t count) {
   NS_ENSURE_TRUE(mListener, NS_ERROR_NOT_INITIALIZED);
   NS_ENSURE_TRUE(mSink, NS_ERROR_NOT_INITIALIZED);
@@ -97,8 +97,8 @@ nsStreamListenerTee::CheckListenerChain() {
 }
 
 NS_IMETHODIMP
-nsStreamListenerTee::Init(nsIStreamListener *listener, nsIOutputStream *sink,
-                          nsIRequestObserver *requestObserver) {
+nsStreamListenerTee::Init(nsIStreamListener* listener, nsIOutputStream* sink,
+                          nsIRequestObserver* requestObserver) {
   NS_ENSURE_ARG_POINTER(listener);
   NS_ENSURE_ARG_POINTER(sink);
   mListener = listener;
@@ -108,10 +108,10 @@ nsStreamListenerTee::Init(nsIStreamListener *listener, nsIOutputStream *sink,
 }
 
 NS_IMETHODIMP
-nsStreamListenerTee::InitAsync(nsIStreamListener *listener,
-                               nsIEventTarget *eventTarget,
-                               nsIOutputStream *sink,
-                               nsIRequestObserver *requestObserver) {
+nsStreamListenerTee::InitAsync(nsIStreamListener* listener,
+                               nsIEventTarget* eventTarget,
+                               nsIOutputStream* sink,
+                               nsIRequestObserver* requestObserver) {
   NS_ENSURE_ARG_POINTER(eventTarget);
   mEventTarget = eventTarget;
   return Init(listener, sink, requestObserver);
diff --git a/netwerk/base/nsStreamListenerWrapper.h b/netwerk/base/nsStreamListenerWrapper.h
index 4740fad4905da..548c798e7110d 100644
--- a/netwerk/base/nsStreamListenerWrapper.h
+++ b/netwerk/base/nsStreamListenerWrapper.h
@@ -20,7 +20,7 @@ class nsStreamListenerWrapper final
     : public nsIStreamListener,
       public nsIThreadRetargetableStreamListener {
  public:
-  explicit nsStreamListenerWrapper(nsIStreamListener *listener)
+  explicit nsStreamListenerWrapper(nsIStreamListener* listener)
       : mListener(listener) {
     MOZ_ASSERT(mListener, "no stream listener specified");
   }
diff --git a/netwerk/base/nsStreamLoader.cpp b/netwerk/base/nsStreamLoader.cpp
index 2d207c5d41469..5dadfd8c3aef9 100644
--- a/netwerk/base/nsStreamLoader.cpp
+++ b/netwerk/base/nsStreamLoader.cpp
@@ -17,16 +17,16 @@ namespace net {
 nsStreamLoader::nsStreamLoader() : mData() {}
 
 NS_IMETHODIMP
-nsStreamLoader::Init(nsIStreamLoaderObserver *aStreamObserver,
-                     nsIRequestObserver *aRequestObserver) {
+nsStreamLoader::Init(nsIStreamLoaderObserver* aStreamObserver,
+                     nsIRequestObserver* aRequestObserver) {
   NS_ENSURE_ARG_POINTER(aStreamObserver);
   mObserver = aStreamObserver;
   mRequestObserver = aRequestObserver;
   return NS_OK;
 }
 
-nsresult nsStreamLoader::Create(nsISupports *aOuter, REFNSIID aIID,
-                                void **aResult) {
+nsresult nsStreamLoader::Create(nsISupports* aOuter, REFNSIID aIID,
+                                void** aResult) {
   if (aOuter) return NS_ERROR_NO_AGGREGATION;
 
   RefPtr it = new nsStreamLoader();
@@ -37,20 +37,20 @@ NS_IMPL_ISUPPORTS(nsStreamLoader, nsIStreamLoader, nsIRequestObserver,
                   nsIStreamListener, nsIThreadRetargetableStreamListener)
 
 NS_IMETHODIMP
-nsStreamLoader::GetNumBytesRead(uint32_t *aNumBytes) {
+nsStreamLoader::GetNumBytesRead(uint32_t* aNumBytes) {
   *aNumBytes = mData.length();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStreamLoader::GetRequest(nsIRequest **aRequest) {
+nsStreamLoader::GetRequest(nsIRequest** aRequest) {
   nsCOMPtr req = mRequest;
   req.forget(aRequest);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsStreamLoader::OnStartRequest(nsIRequest *request) {
+nsStreamLoader::OnStartRequest(nsIRequest* request) {
   nsCOMPtr chan(do_QueryInterface(request));
   if (chan) {
     int64_t contentLength = -1;
@@ -77,14 +77,14 @@ nsStreamLoader::OnStartRequest(nsIRequest *request) {
 }
 
 NS_IMETHODIMP
-nsStreamLoader::OnStopRequest(nsIRequest *request, nsresult aStatus) {
+nsStreamLoader::OnStopRequest(nsIRequest* request, nsresult aStatus) {
   AUTO_PROFILER_LABEL("nsStreamLoader::OnStopRequest", NETWORK);
 
   if (mObserver) {
     // provide nsIStreamLoader::request during call to OnStreamComplete
     mRequest = request;
     size_t length = mData.length();
-    uint8_t *elems = mData.extractOrCopyRawBuffer();
+    uint8_t* elems = mData.extractOrCopyRawBuffer();
     nsresult rv =
         mObserver->OnStreamComplete(this, mContext, aStatus, length, elems);
     if (rv != NS_SUCCESS_ADOPTED_DATA) {
@@ -106,11 +106,11 @@ nsStreamLoader::OnStopRequest(nsIRequest *request, nsresult aStatus) {
   return NS_OK;
 }
 
-nsresult nsStreamLoader::WriteSegmentFun(nsIInputStream *inStr, void *closure,
-                                         const char *fromSegment,
+nsresult nsStreamLoader::WriteSegmentFun(nsIInputStream* inStr, void* closure,
+                                         const char* fromSegment,
                                          uint32_t toOffset, uint32_t count,
-                                         uint32_t *writeCount) {
-  nsStreamLoader *self = (nsStreamLoader *)closure;
+                                         uint32_t* writeCount) {
+  nsStreamLoader* self = (nsStreamLoader*)closure;
 
   if (!self->mData.append(fromSegment, count)) {
     self->mData.clearAndFree();
@@ -123,7 +123,7 @@ nsresult nsStreamLoader::WriteSegmentFun(nsIInputStream *inStr, void *closure,
 }
 
 NS_IMETHODIMP
-nsStreamLoader::OnDataAvailable(nsIRequest *request, nsIInputStream *inStr,
+nsStreamLoader::OnDataAvailable(nsIRequest* request, nsIInputStream* inStr,
                                 uint64_t sourceOffset, uint32_t count) {
   uint32_t countRead;
   return inStr->ReadSegments(WriteSegmentFun, this, count, &countRead);
diff --git a/netwerk/base/nsStreamLoader.h b/netwerk/base/nsStreamLoader.h
index e98f0027022c2..c0f8cc9e9d5b7 100644
--- a/netwerk/base/nsStreamLoader.h
+++ b/netwerk/base/nsStreamLoader.h
@@ -28,13 +28,13 @@ class nsStreamLoader final : public nsIStreamLoader,
 
   nsStreamLoader();
 
-  static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
+  static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
 
  protected:
   ~nsStreamLoader() = default;
 
-  static nsresult WriteSegmentFun(nsIInputStream *, void *, const char *,
-                                  uint32_t, uint32_t, uint32_t *);
+  static nsresult WriteSegmentFun(nsIInputStream*, void*, const char*, uint32_t,
+                                  uint32_t, uint32_t*);
 
   // Utility method to free mData, if present, and update other state to
   // reflect that no data has been allocated.
diff --git a/netwerk/base/nsStreamTransportService.cpp b/netwerk/base/nsStreamTransportService.cpp
index b01fd52a8cf1f..710463d679d39 100644
--- a/netwerk/base/nsStreamTransportService.cpp
+++ b/netwerk/base/nsStreamTransportService.cpp
@@ -38,7 +38,7 @@ class nsInputStreamTransport : public nsITransport, public nsIInputStream {
   NS_DECL_NSITRANSPORT
   NS_DECL_NSIINPUTSTREAM
 
-  nsInputStreamTransport(nsIInputStream *source, bool closeWhenDone)
+  nsInputStreamTransport(nsIInputStream* source, bool closeWhenDone)
       : mSource(source),
         mOffset(0),
         mCloseWhenDone(closeWhenDone),
@@ -68,7 +68,7 @@ NS_IMPL_ISUPPORTS(nsInputStreamTransport, nsITransport, nsIInputStream)
 NS_IMETHODIMP
 nsInputStreamTransport::OpenInputStream(uint32_t flags, uint32_t segsize,
                                         uint32_t segcount,
-                                        nsIInputStream **result) {
+                                        nsIInputStream** result) {
   NS_ENSURE_TRUE(!mInProgress, NS_ERROR_IN_PROGRESS);
 
   nsresult rv;
@@ -102,7 +102,7 @@ nsInputStreamTransport::OpenInputStream(uint32_t flags, uint32_t segsize,
 NS_IMETHODIMP
 nsInputStreamTransport::OpenOutputStream(uint32_t flags, uint32_t segsize,
                                          uint32_t segcount,
-                                         nsIOutputStream **result) {
+                                         nsIOutputStream** result) {
   // this transport only supports reading!
   MOZ_ASSERT_UNREACHABLE("nsInputStreamTransport::OpenOutputStream");
   return NS_ERROR_UNEXPECTED;
@@ -116,8 +116,8 @@ nsInputStreamTransport::Close(nsresult reason) {
 }
 
 NS_IMETHODIMP
-nsInputStreamTransport::SetEventSink(nsITransportEventSink *sink,
-                                     nsIEventTarget *target) {
+nsInputStreamTransport::SetEventSink(nsITransportEventSink* sink,
+                                     nsIEventTarget* target) {
   NS_ENSURE_TRUE(!mInProgress, NS_ERROR_IN_PROGRESS);
 
   if (target)
@@ -140,12 +140,12 @@ nsInputStreamTransport::Close() {
 }
 
 NS_IMETHODIMP
-nsInputStreamTransport::Available(uint64_t *result) {
+nsInputStreamTransport::Available(uint64_t* result) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsInputStreamTransport::Read(char *buf, uint32_t count, uint32_t *result) {
+nsInputStreamTransport::Read(char* buf, uint32_t count, uint32_t* result) {
   nsresult rv = mSource->Read(buf, count, result);
 
   if (NS_SUCCEEDED(rv)) {
@@ -157,13 +157,13 @@ nsInputStreamTransport::Read(char *buf, uint32_t count, uint32_t *result) {
 }
 
 NS_IMETHODIMP
-nsInputStreamTransport::ReadSegments(nsWriteSegmentFun writer, void *closure,
-                                     uint32_t count, uint32_t *result) {
+nsInputStreamTransport::ReadSegments(nsWriteSegmentFun writer, void* closure,
+                                     uint32_t count, uint32_t* result) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsInputStreamTransport::IsNonBlocking(bool *result) {
+nsInputStreamTransport::IsNonBlocking(bool* result) {
   *result = false;
   return NS_OK;
 }
@@ -195,7 +195,7 @@ NS_IMPL_ISUPPORTS(nsStreamTransportService, nsIStreamTransportService,
                   nsIEventTarget, nsIObserver)
 
 NS_IMETHODIMP
-nsStreamTransportService::DispatchFromScript(nsIRunnable *task,
+nsStreamTransportService::DispatchFromScript(nsIRunnable* task,
                                              uint32_t flags) {
   nsCOMPtr event(task);
   return Dispatch(event.forget(), flags);
@@ -237,7 +237,7 @@ nsStreamTransportService::IsOnCurrentThreadInfallible() {
 }
 
 NS_IMETHODIMP
-nsStreamTransportService::IsOnCurrentThread(bool *result) {
+nsStreamTransportService::IsOnCurrentThread(bool* result) {
   nsCOMPtr pool;
   {
     mozilla::MutexAutoLock lock(mShutdownLock);
@@ -251,10 +251,10 @@ nsStreamTransportService::IsOnCurrentThread(bool *result) {
 }
 
 NS_IMETHODIMP
-nsStreamTransportService::CreateInputTransport(nsIInputStream *stream,
+nsStreamTransportService::CreateInputTransport(nsIInputStream* stream,
                                                bool closeWhenDone,
-                                               nsITransport **result) {
-  nsInputStreamTransport *trans =
+                                               nsITransport** result) {
+  nsInputStreamTransport* trans =
       new nsInputStreamTransport(stream, closeWhenDone);
   if (!trans) return NS_ERROR_OUT_OF_MEMORY;
   NS_ADDREF(*result = trans);
@@ -262,8 +262,8 @@ nsStreamTransportService::CreateInputTransport(nsIInputStream *stream,
 }
 
 NS_IMETHODIMP
-nsStreamTransportService::Observe(nsISupports *subject, const char *topic,
-                                  const char16_t *data) {
+nsStreamTransportService::Observe(nsISupports* subject, const char* topic,
+                                  const char16_t* data) {
   NS_ASSERTION(strcmp(topic, "xpcom-shutdown-threads") == 0, "oops");
 
   {
@@ -280,7 +280,7 @@ nsStreamTransportService::Observe(nsISupports *subject, const char *topic,
 
 class AvailableEvent final : public Runnable {
  public:
-  AvailableEvent(nsIInputStream *stream, nsIInputAvailableCallback *callback)
+  AvailableEvent(nsIInputStream* stream, nsIInputAvailableCallback* callback)
       : Runnable("net::AvailableEvent"),
         mStream(stream),
         mCallback(callback),
@@ -320,8 +320,8 @@ class AvailableEvent final : public Runnable {
 };
 
 NS_IMETHODIMP
-nsStreamTransportService::InputAvailable(nsIInputStream *stream,
-                                         nsIInputAvailableCallback *callback) {
+nsStreamTransportService::InputAvailable(nsIInputStream* stream,
+                                         nsIInputAvailableCallback* callback) {
   nsCOMPtr pool;
   {
     mozilla::MutexAutoLock lock(mShutdownLock);
diff --git a/netwerk/base/nsSyncStreamListener.cpp b/netwerk/base/nsSyncStreamListener.cpp
index 9b21703551207..53e9af307a024 100644
--- a/netwerk/base/nsSyncStreamListener.cpp
+++ b/netwerk/base/nsSyncStreamListener.cpp
@@ -50,7 +50,7 @@ NS_IMPL_ISUPPORTS(nsSyncStreamListener, nsIStreamListener, nsIRequestObserver,
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsSyncStreamListener::GetInputStream(nsIInputStream **result) {
+nsSyncStreamListener::GetInputStream(nsIInputStream** result) {
   NS_ADDREF(*result = this);
   return NS_OK;
 }
@@ -60,11 +60,11 @@ nsSyncStreamListener::GetInputStream(nsIInputStream **result) {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsSyncStreamListener::OnStartRequest(nsIRequest *request) { return NS_OK; }
+nsSyncStreamListener::OnStartRequest(nsIRequest* request) { return NS_OK; }
 
 NS_IMETHODIMP
-nsSyncStreamListener::OnDataAvailable(nsIRequest *request,
-                                      nsIInputStream *stream, uint64_t offset,
+nsSyncStreamListener::OnDataAvailable(nsIRequest* request,
+                                      nsIInputStream* stream, uint64_t offset,
                                       uint32_t count) {
   uint32_t bytesWritten;
 
@@ -85,7 +85,7 @@ nsSyncStreamListener::OnDataAvailable(nsIRequest *request,
 }
 
 NS_IMETHODIMP
-nsSyncStreamListener::OnStopRequest(nsIRequest *request, nsresult status) {
+nsSyncStreamListener::OnStopRequest(nsIRequest* request, nsresult status) {
   mStatus = status;
   mKeepWaiting = false;  // unblock Read
   mDone = true;
@@ -112,7 +112,7 @@ nsSyncStreamListener::Close() {
 }
 
 NS_IMETHODIMP
-nsSyncStreamListener::Available(uint64_t *result) {
+nsSyncStreamListener::Available(uint64_t* result) {
   if (NS_FAILED(mStatus)) return mStatus;
 
   mStatus = mPipeIn->Available(result);
@@ -124,7 +124,7 @@ nsSyncStreamListener::Available(uint64_t *result) {
 }
 
 NS_IMETHODIMP
-nsSyncStreamListener::Read(char *buf, uint32_t bufLen, uint32_t *result) {
+nsSyncStreamListener::Read(char* buf, uint32_t bufLen, uint32_t* result) {
   if (mStatus == NS_BASE_STREAM_CLOSED) {
     *result = 0;
     return NS_OK;
@@ -139,8 +139,8 @@ nsSyncStreamListener::Read(char *buf, uint32_t bufLen, uint32_t *result) {
 }
 
 NS_IMETHODIMP
-nsSyncStreamListener::ReadSegments(nsWriteSegmentFun writer, void *closure,
-                                   uint32_t count, uint32_t *result) {
+nsSyncStreamListener::ReadSegments(nsWriteSegmentFun writer, void* closure,
+                                   uint32_t count, uint32_t* result) {
   if (mStatus == NS_BASE_STREAM_CLOSED) {
     *result = 0;
     return NS_OK;
@@ -155,7 +155,7 @@ nsSyncStreamListener::ReadSegments(nsWriteSegmentFun writer, void *closure,
 }
 
 NS_IMETHODIMP
-nsSyncStreamListener::IsNonBlocking(bool *result) {
+nsSyncStreamListener::IsNonBlocking(bool* result) {
   *result = false;
   return NS_OK;
 }
diff --git a/netwerk/base/nsTransportUtils.cpp b/netwerk/base/nsTransportUtils.cpp
index 4f54d04da14c1..629cf0a3b3c66 100644
--- a/netwerk/base/nsTransportUtils.cpp
+++ b/netwerk/base/nsTransportUtils.cpp
@@ -21,7 +21,7 @@ class nsTransportEventSinkProxy : public nsITransportEventSink {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITRANSPORTEVENTSINK
 
-  nsTransportEventSinkProxy(nsITransportEventSink *sink, nsIEventTarget *target)
+  nsTransportEventSinkProxy(nsITransportEventSink* sink, nsIEventTarget* target)
       : mSink(sink),
         mTarget(target),
         mLock("nsTransportEventSinkProxy.mLock"),
@@ -38,16 +38,16 @@ class nsTransportEventSinkProxy : public nsITransportEventSink {
   }
 
  public:
-  nsITransportEventSink *mSink;
+  nsITransportEventSink* mSink;
   nsCOMPtr mTarget;
   Mutex mLock;
-  nsTransportStatusEvent *mLastEvent;
+  nsTransportStatusEvent* mLastEvent;
 };
 
 class nsTransportStatusEvent : public Runnable {
  public:
-  nsTransportStatusEvent(nsTransportEventSinkProxy *proxy,
-                         nsITransport *transport, nsresult status,
+  nsTransportStatusEvent(nsTransportEventSinkProxy* proxy,
+                         nsITransport* transport, nsresult status,
                          int64_t progress, int64_t progressMax)
       : Runnable("nsTransportStatusEvent"),
         mProxy(proxy),
@@ -83,7 +83,7 @@ class nsTransportStatusEvent : public Runnable {
 NS_IMPL_ISUPPORTS(nsTransportEventSinkProxy, nsITransportEventSink)
 
 NS_IMETHODIMP
-nsTransportEventSinkProxy::OnTransportStatus(nsITransport *transport,
+nsTransportEventSinkProxy::OnTransportStatus(nsITransport* transport,
                                              nsresult status, int64_t progress,
                                              int64_t progressMax) {
   nsresult rv = NS_OK;
@@ -117,9 +117,9 @@ nsTransportEventSinkProxy::OnTransportStatus(nsITransport *transport,
 
 //-----------------------------------------------------------------------------
 
-nsresult net_NewTransportEventSinkProxy(nsITransportEventSink **result,
-                                        nsITransportEventSink *sink,
-                                        nsIEventTarget *target) {
+nsresult net_NewTransportEventSinkProxy(nsITransportEventSink** result,
+                                        nsITransportEventSink* sink,
+                                        nsIEventTarget* target) {
   *result = new nsTransportEventSinkProxy(sink, target);
   if (!*result) return NS_ERROR_OUT_OF_MEMORY;
   NS_ADDREF(*result);
diff --git a/netwerk/base/nsTransportUtils.h b/netwerk/base/nsTransportUtils.h
index 60ea61c69c191..141b9e4edaba5 100644
--- a/netwerk/base/nsTransportUtils.h
+++ b/netwerk/base/nsTransportUtils.h
@@ -18,8 +18,8 @@
  * Coalescing events can help prevent a backlog of unprocessed transport
  * events in the case that the target thread is overworked.
  */
-nsresult net_NewTransportEventSinkProxy(nsITransportEventSink **aResult,
-                                        nsITransportEventSink *aSink,
-                                        nsIEventTarget *aTarget);
+nsresult net_NewTransportEventSinkProxy(nsITransportEventSink** aResult,
+                                        nsITransportEventSink* aSink,
+                                        nsIEventTarget* aTarget);
 
 #endif  // nsTransportUtils_h__
diff --git a/netwerk/base/nsURLHelper.cpp b/netwerk/base/nsURLHelper.cpp
index fa49dc01bad9f..dc55769bc2452 100644
--- a/netwerk/base/nsURLHelper.cpp
+++ b/netwerk/base/nsURLHelper.cpp
@@ -30,9 +30,9 @@ using namespace mozilla;
 //----------------------------------------------------------------------------
 
 static bool gInitialized = false;
-static nsIURLParser *gNoAuthURLParser = nullptr;
-static nsIURLParser *gAuthURLParser = nullptr;
-static nsIURLParser *gStdURLParser = nullptr;
+static nsIURLParser* gNoAuthURLParser = nullptr;
+static nsIURLParser* gAuthURLParser = nullptr;
+static nsIURLParser* gStdURLParser = nullptr;
 static int32_t gMaxLength = 1048576;  // Default: 1MB
 
 static void InitGlobals() {
@@ -79,17 +79,17 @@ int32_t net_GetURLMaxLength() { return gMaxLength; }
 // nsIURLParser getters
 //----------------------------------------------------------------------------
 
-nsIURLParser *net_GetAuthURLParser() {
+nsIURLParser* net_GetAuthURLParser() {
   if (!gInitialized) InitGlobals();
   return gAuthURLParser;
 }
 
-nsIURLParser *net_GetNoAuthURLParser() {
+nsIURLParser* net_GetNoAuthURLParser() {
   if (!gInitialized) InitGlobals();
   return gNoAuthURLParser;
 }
 
-nsIURLParser *net_GetStdURLParser() {
+nsIURLParser* net_GetStdURLParser() {
   if (!gInitialized) InitGlobals();
   return gStdURLParser;
 }
@@ -97,7 +97,7 @@ nsIURLParser *net_GetStdURLParser() {
 //---------------------------------------------------------------------------
 // GetFileFromURLSpec implementations
 //---------------------------------------------------------------------------
-nsresult net_GetURLSpecFromDir(nsIFile *aFile, nsACString &result) {
+nsresult net_GetURLSpecFromDir(nsIFile* aFile, nsACString& result) {
   nsAutoCString escPath;
   nsresult rv = net_GetURLSpecFromActualFile(aFile, escPath);
   if (NS_FAILED(rv)) return rv;
@@ -110,7 +110,7 @@ nsresult net_GetURLSpecFromDir(nsIFile *aFile, nsACString &result) {
   return NS_OK;
 }
 
-nsresult net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result) {
+nsresult net_GetURLSpecFromFile(nsIFile* aFile, nsACString& result) {
   nsAutoCString escPath;
   nsresult rv = net_GetURLSpecFromActualFile(aFile, escPath);
   if (NS_FAILED(rv)) return rv;
@@ -134,9 +134,9 @@ nsresult net_GetURLSpecFromFile(nsIFile *aFile, nsACString &result) {
 // file:// URL parsing
 //----------------------------------------------------------------------------
 
-nsresult net_ParseFileURL(const nsACString &inURL, nsACString &outDirectory,
-                          nsACString &outFileBaseName,
-                          nsACString &outFileExtension) {
+nsresult net_ParseFileURL(const nsACString& inURL, nsACString& outDirectory,
+                          nsACString& outFileBaseName,
+                          nsACString& outFileExtension) {
   nsresult rv;
 
   if (inURL.Length() > (uint32_t)gMaxLength) {
@@ -147,8 +147,8 @@ nsresult net_ParseFileURL(const nsACString &inURL, nsACString &outDirectory,
   outFileBaseName.Truncate();
   outFileExtension.Truncate();
 
-  const nsPromiseFlatCString &flatURL = PromiseFlatCString(inURL);
-  const char *url = flatURL.get();
+  const nsPromiseFlatCString& flatURL = PromiseFlatCString(inURL);
+  const char* url = flatURL.get();
 
   nsAutoCString scheme;
   rv = net_ExtractURLScheme(flatURL, scheme);
@@ -159,7 +159,7 @@ nsresult net_ParseFileURL(const nsACString &inURL, nsACString &outDirectory,
     return NS_ERROR_UNEXPECTED;
   }
 
-  nsIURLParser *parser = net_GetNoAuthURLParser();
+  nsIURLParser* parser = net_GetNoAuthURLParser();
   NS_ENSURE_TRUE(parser, NS_ERROR_UNEXPECTED);
 
   uint32_t pathPos, filepathPos, directoryPos, basenamePos, extensionPos;
@@ -205,16 +205,16 @@ nsresult net_ParseFileURL(const nsACString &inURL, nsACString &outDirectory,
 
 // Replace all /./ with a / while resolving URLs
 // But only till #?
-void net_CoalesceDirs(netCoalesceFlags flags, char *path) {
+void net_CoalesceDirs(netCoalesceFlags flags, char* path) {
   /* Stolen from the old netlib's mkparse.c.
    *
    * modifies a url of the form   /foo/../foo1  ->  /foo1
    *                       and    /foo/./foo1   ->  /foo/foo1
    *                       and    /foo/foo1/..  ->  /foo/
    */
-  char *fwdPtr = path;
-  char *urlPtr = path;
-  char *lastslash = path;
+  char* fwdPtr = path;
+  char* urlPtr = path;
+  char* lastslash = path;
   uint32_t traversal = 0;
   uint32_t special_ftp_len = 0;
 
@@ -346,9 +346,9 @@ void net_CoalesceDirs(netCoalesceFlags flags, char *path) {
   *urlPtr = '\0';  // terminate the url
 }
 
-nsresult net_ResolveRelativePath(const nsACString &relativePath,
-                                 const nsACString &basePath,
-                                 nsACString &result) {
+nsresult net_ResolveRelativePath(const nsACString& relativePath,
+                                 const nsACString& basePath,
+                                 nsACString& result) {
   nsAutoCString name;
   nsAutoCString path(basePath);
   bool needsDelim = false;
@@ -423,7 +423,7 @@ static bool net_IsValidSchemeChar(const char aChar) {
 }
 
 /* Extract URI-Scheme if possible */
-nsresult net_ExtractURLScheme(const nsACString &inURI, nsACString &scheme) {
+nsresult net_ExtractURLScheme(const nsACString& inURI, nsACString& scheme) {
   nsACString::const_iterator start, end;
   inURI.BeginReading(start);
   inURI.EndReading(end);
@@ -457,7 +457,7 @@ nsresult net_ExtractURLScheme(const nsACString &inURI, nsACString &scheme) {
   return NS_OK;
 }
 
-bool net_IsValidScheme(const char *scheme, uint32_t schemeLen) {
+bool net_IsValidScheme(const char* scheme, uint32_t schemeLen) {
   // first char must be alpha
   if (!IsAsciiAlpha(*scheme)) return false;
 
@@ -471,7 +471,7 @@ bool net_IsValidScheme(const char *scheme, uint32_t schemeLen) {
   return true;
 }
 
-bool net_IsAbsoluteURL(const nsACString &uri) {
+bool net_IsAbsoluteURL(const nsACString& uri) {
   nsACString::const_iterator start, end;
   uri.BeginReading(start);
   uri.EndReading(end);
@@ -511,7 +511,7 @@ bool net_IsAbsoluteURL(const nsACString &uri) {
   return false;
 }
 
-void net_FilterURIString(const nsACString &input, nsACString &result) {
+void net_FilterURIString(const nsACString& input, nsACString& result) {
   result.Truncate();
 
   auto start = input.BeginReading();
@@ -528,7 +528,7 @@ void net_FilterURIString(const nsACString &input, nsACString &result) {
 
   // Check if chars need to be stripped.
   bool needsStrip = false;
-  const ASCIIMaskArray &mask = ASCIIMask::MaskCRLFTab();
+  const ASCIIMaskArray& mask = ASCIIMask::MaskCRLFTab();
   for (auto itr = start; itr != end; ++itr) {
     if (ASCIIMask::IsMasked(mask, *itr)) {
       needsStrip = true;
@@ -549,8 +549,8 @@ void net_FilterURIString(const nsACString &input, nsACString &result) {
   }
 }
 
-nsresult net_FilterAndEscapeURI(const nsACString &aInput, uint32_t aFlags,
-                                nsACString &aResult) {
+nsresult net_FilterAndEscapeURI(const nsACString& aInput, uint32_t aFlags,
+                                nsACString& aResult) {
   aResult.Truncate();
 
   auto start = aInput.BeginReading();
@@ -565,13 +565,13 @@ nsresult net_FilterAndEscapeURI(const nsACString &aInput, uint32_t aFlags,
                    charFilter)
           .base();
 
-  const ASCIIMaskArray &mask = ASCIIMask::MaskCRLFTab();
+  const ASCIIMaskArray& mask = ASCIIMask::MaskCRLFTab();
   return NS_EscapeAndFilterURL(Substring(newStart, newEnd), aFlags, &mask,
                                aResult, fallible);
 }
 
 #if defined(XP_WIN)
-bool net_NormalizeFileURL(const nsACString &aURL, nsCString &aResultBuf) {
+bool net_NormalizeFileURL(const nsACString& aURL, nsCString& aResultBuf) {
   bool writing = false;
 
   nsACString::const_iterator beginIter, endIter;
@@ -598,60 +598,60 @@ bool net_NormalizeFileURL(const nsACString &aURL, nsCString &aResultBuf) {
 // miscellaneous (i.e., stuff that should really be elsewhere)
 //----------------------------------------------------------------------------
 
-static inline void ToLower(char &c) {
+static inline void ToLower(char& c) {
   if ((unsigned)(c - 'A') <= (unsigned)('Z' - 'A')) c += 'a' - 'A';
 }
 
-void net_ToLowerCase(char *str, uint32_t length) {
-  for (char *end = str + length; str < end; ++str) ToLower(*str);
+void net_ToLowerCase(char* str, uint32_t length) {
+  for (char* end = str + length; str < end; ++str) ToLower(*str);
 }
 
-void net_ToLowerCase(char *str) {
+void net_ToLowerCase(char* str) {
   for (; *str; ++str) ToLower(*str);
 }
 
-char *net_FindCharInSet(const char *iter, const char *stop, const char *set) {
+char* net_FindCharInSet(const char* iter, const char* stop, const char* set) {
   for (; iter != stop && *iter; ++iter) {
-    for (const char *s = set; *s; ++s) {
-      if (*iter == *s) return (char *)iter;
+    for (const char* s = set; *s; ++s) {
+      if (*iter == *s) return (char*)iter;
     }
   }
-  return (char *)iter;
+  return (char*)iter;
 }
 
-char *net_FindCharNotInSet(const char *iter, const char *stop,
-                           const char *set) {
+char* net_FindCharNotInSet(const char* iter, const char* stop,
+                           const char* set) {
 repeat:
-  for (const char *s = set; *s; ++s) {
+  for (const char* s = set; *s; ++s) {
     if (*iter == *s) {
       if (++iter == stop) break;
       goto repeat;
     }
   }
-  return (char *)iter;
+  return (char*)iter;
 }
 
-char *net_RFindCharNotInSet(const char *stop, const char *iter,
-                            const char *set) {
+char* net_RFindCharNotInSet(const char* stop, const char* iter,
+                            const char* set) {
   --iter;
   --stop;
 
-  if (iter == stop) return (char *)iter;
+  if (iter == stop) return (char*)iter;
 
 repeat:
-  for (const char *s = set; *s; ++s) {
+  for (const char* s = set; *s; ++s) {
     if (*iter == *s) {
       if (--iter == stop) break;
       goto repeat;
     }
   }
-  return (char *)iter;
+  return (char*)iter;
 }
 
 #define HTTP_LWS " \t"
 
 // Return the index of the closing quote of the string, if any
-static uint32_t net_FindStringEnd(const nsCString &flatStr,
+static uint32_t net_FindStringEnd(const nsCString& flatStr,
                                   uint32_t stringStart, char stringDelim) {
   NS_ASSERTION(stringStart < flatStr.Length() &&
                    flatStr.CharAt(stringStart) == stringDelim &&
@@ -686,7 +686,7 @@ static uint32_t net_FindStringEnd(const nsCString &flatStr,
   return flatStr.Length();
 }
 
-static uint32_t net_FindMediaDelimiter(const nsCString &flatStr,
+static uint32_t net_FindMediaDelimiter(const nsCString& flatStr,
                                        uint32_t searchStart, char delimiter) {
   do {
     // searchStart points to the spot from which we should start looking
@@ -718,23 +718,23 @@ static uint32_t net_FindMediaDelimiter(const nsCString &flatStr,
 
 // aOffset should be added to aCharsetStart and aCharsetEnd if this
 // function sets them.
-static void net_ParseMediaType(const nsACString &aMediaTypeStr,
-                               nsACString &aContentType,
-                               nsACString &aContentCharset, int32_t aOffset,
-                               bool *aHadCharset, int32_t *aCharsetStart,
-                               int32_t *aCharsetEnd, bool aStrict) {
-  const nsCString &flatStr = PromiseFlatCString(aMediaTypeStr);
-  const char *start = flatStr.get();
-  const char *end = start + flatStr.Length();
+static void net_ParseMediaType(const nsACString& aMediaTypeStr,
+                               nsACString& aContentType,
+                               nsACString& aContentCharset, int32_t aOffset,
+                               bool* aHadCharset, int32_t* aCharsetStart,
+                               int32_t* aCharsetEnd, bool aStrict) {
+  const nsCString& flatStr = PromiseFlatCString(aMediaTypeStr);
+  const char* start = flatStr.get();
+  const char* end = start + flatStr.Length();
 
   // Trim LWS leading and trailing whitespace from type.  We include '(' in
   // the trailing trim set to catch media-type comments, which are not at all
   // standard, but may occur in rare cases.
-  const char *type = net_FindCharNotInSet(start, end, HTTP_LWS);
-  const char *typeEnd = net_FindCharInSet(type, end, HTTP_LWS ";(");
+  const char* type = net_FindCharNotInSet(start, end, HTTP_LWS);
+  const char* typeEnd = net_FindCharInSet(type, end, HTTP_LWS ";(");
 
-  const char *charset = "";
-  const char *charsetEnd = charset;
+  const char* charset = "";
+  const char* charsetEnd = charset;
   int32_t charsetParamStart = 0;
   int32_t charsetParamEnd = 0;
 
@@ -750,7 +750,7 @@ static void net_ParseMediaType(const nsACString &aMediaTypeStr,
       uint32_t curParamEnd =
           net_FindMediaDelimiter(flatStr, curParamStart, ';');
 
-      const char *paramName = net_FindCharNotInSet(
+      const char* paramName = net_FindCharNotInSet(
           start + curParamStart, start + curParamEnd, HTTP_LWS);
       static const char charsetStr[] = "charset=";
       if (PL_strncasecmp(paramName, charsetStr, sizeof(charsetStr) - 1) == 0) {
@@ -809,7 +809,7 @@ static void net_ParseMediaType(const nsACString &aMediaTypeStr,
         // parameters using the "quoted-string" syntax need
         // backslash-escapes to be unescaped (see RFC 2616 Section 2.2)
         aContentCharset.Truncate();
-        for (const char *c = charset; c != charsetEnd; c++) {
+        for (const char* c = charset; c != charsetEnd; c++) {
           if (*c == '\\' && c + 1 != charsetEnd) {
             // eat escape
             c++;
@@ -839,18 +839,18 @@ static void net_ParseMediaType(const nsACString &aMediaTypeStr,
 
 #undef HTTP_LWS
 
-void net_ParseContentType(const nsACString &aHeaderStr,
-                          nsACString &aContentType, nsACString &aContentCharset,
-                          bool *aHadCharset) {
+void net_ParseContentType(const nsACString& aHeaderStr,
+                          nsACString& aContentType, nsACString& aContentCharset,
+                          bool* aHadCharset) {
   int32_t dummy1, dummy2;
   net_ParseContentType(aHeaderStr, aContentType, aContentCharset, aHadCharset,
                        &dummy1, &dummy2);
 }
 
-void net_ParseContentType(const nsACString &aHeaderStr,
-                          nsACString &aContentType, nsACString &aContentCharset,
-                          bool *aHadCharset, int32_t *aCharsetStart,
-                          int32_t *aCharsetEnd) {
+void net_ParseContentType(const nsACString& aHeaderStr,
+                          nsACString& aContentType, nsACString& aContentCharset,
+                          bool* aHadCharset, int32_t* aCharsetStart,
+                          int32_t* aCharsetEnd) {
   //
   // Augmented BNF (from RFC 2616 section 3.7):
   //
@@ -875,7 +875,7 @@ void net_ParseContentType(const nsACString &aHeaderStr,
   //
 
   *aHadCharset = false;
-  const nsCString &flatStr = PromiseFlatCString(aHeaderStr);
+  const nsCString& flatStr = PromiseFlatCString(aHeaderStr);
 
   // iterate over media-types.  Note that ',' characters can happen
   // inside quoted strings, so we need to watch out for that.
@@ -897,10 +897,10 @@ void net_ParseContentType(const nsACString &aHeaderStr,
   } while (curTypeStart < flatStr.Length());
 }
 
-void net_ParseRequestContentType(const nsACString &aHeaderStr,
-                                 nsACString &aContentType,
-                                 nsACString &aContentCharset,
-                                 bool *aHadCharset) {
+void net_ParseRequestContentType(const nsACString& aHeaderStr,
+                                 nsACString& aContentType,
+                                 nsACString& aContentCharset,
+                                 bool* aHadCharset) {
   //
   // Augmented BNF (from RFC 7231 section 3.1.1.1):
   //
@@ -920,7 +920,7 @@ void net_ParseRequestContentType(const nsACString &aHeaderStr,
   aContentType.Truncate();
   aContentCharset.Truncate();
   *aHadCharset = false;
-  const nsCString &flatStr = PromiseFlatCString(aHeaderStr);
+  const nsCString& flatStr = PromiseFlatCString(aHeaderStr);
 
   // At this point curTypeEnd points to the spot where the media-type
   // starting at curTypeEnd ends.  Time to parse that!
@@ -941,8 +941,8 @@ void net_ParseRequestContentType(const nsACString &aHeaderStr,
   *aHadCharset = hadCharset;
 }
 
-bool net_IsValidHostName(const nsACString &host) {
-  const char *end = host.EndReading();
+bool net_IsValidHostName(const nsACString& host) {
+  const char* end = host.EndReading();
   // Use explicit whitelists to select which characters we are
   // willing to send to lower-level DNS logic. This is more
   // self-documenting, and can also be slightly faster than the
@@ -965,10 +965,10 @@ bool net_IsValidHostName(const nsACString &host) {
   return PR_StringToNetAddr(strhost.get(), &addr) == PR_SUCCESS;
 }
 
-bool net_IsValidIPv4Addr(const nsACString &aAddr) {
+bool net_IsValidIPv4Addr(const nsACString& aAddr) {
   return rust_net_is_valid_ipv4_addr(aAddr);
 }
 
-bool net_IsValidIPv6Addr(const nsACString &aAddr) {
+bool net_IsValidIPv6Addr(const nsACString& aAddr) {
   return rust_net_is_valid_ipv6_addr(aAddr);
 }
diff --git a/netwerk/base/nsURLHelper.h b/netwerk/base/nsURLHelper.h
index a3d7fac41856c..ebf6e3ea4dc4d 100644
--- a/netwerk/base/nsURLHelper.h
+++ b/netwerk/base/nsURLHelper.h
@@ -39,26 +39,26 @@ void net_ShutdownURLHelperOSX();
 #endif
 
 /* access URL parsers */
-nsIURLParser *net_GetAuthURLParser();
-nsIURLParser *net_GetNoAuthURLParser();
-nsIURLParser *net_GetStdURLParser();
+nsIURLParser* net_GetAuthURLParser();
+nsIURLParser* net_GetNoAuthURLParser();
+nsIURLParser* net_GetStdURLParser();
 
 /* convert between nsIFile and file:// URL spec
  * net_GetURLSpecFromFile does an extra stat, so callers should
  * avoid it if possible in favor of net_GetURLSpecFromActualFile
  * and net_GetURLSpecFromDir */
-nsresult net_GetURLSpecFromFile(nsIFile *, nsACString &);
-nsresult net_GetURLSpecFromDir(nsIFile *, nsACString &);
-nsresult net_GetURLSpecFromActualFile(nsIFile *, nsACString &);
-nsresult net_GetFileFromURLSpec(const nsACString &, nsIFile **);
+nsresult net_GetURLSpecFromFile(nsIFile*, nsACString&);
+nsresult net_GetURLSpecFromDir(nsIFile*, nsACString&);
+nsresult net_GetURLSpecFromActualFile(nsIFile*, nsACString&);
+nsresult net_GetFileFromURLSpec(const nsACString&, nsIFile**);
 
 /* extract file path components from file:// URL */
-nsresult net_ParseFileURL(const nsACString &inURL, nsACString &outDirectory,
-                          nsACString &outFileBaseName,
-                          nsACString &outFileExtension);
+nsresult net_ParseFileURL(const nsACString& inURL, nsACString& outDirectory,
+                          nsACString& outFileBaseName,
+                          nsACString& outFileExtension);
 
 /* handle .. in dirs while resolving URLs (path is UTF-8) */
-void net_CoalesceDirs(netCoalesceFlags flags, char *path);
+void net_CoalesceDirs(netCoalesceFlags flags, char* path);
 
 /**
  * Resolves a relative path string containing "." and ".."
@@ -73,9 +73,9 @@ void net_CoalesceDirs(netCoalesceFlags flags, char *path);
  *
  * @return a new string, representing canonical uri
  */
-nsresult net_ResolveRelativePath(const nsACString &relativePath,
-                                 const nsACString &basePath,
-                                 nsACString &result);
+nsresult net_ResolveRelativePath(const nsACString& relativePath,
+                                 const nsACString& basePath,
+                                 nsACString& result);
 
 /**
  * Check if a URL is absolute
@@ -83,7 +83,7 @@ nsresult net_ResolveRelativePath(const nsACString &relativePath,
  * @param inURL     URL spec
  * @return true if the given spec represents an absolute URL
  */
-bool net_IsAbsoluteURL(const nsACString &inURL);
+bool net_IsAbsoluteURL(const nsACString& inURL);
 
 /**
  * Extract URI-Scheme if possible
@@ -91,12 +91,12 @@ bool net_IsAbsoluteURL(const nsACString &inURL);
  * @param inURI     URI spec
  * @param scheme    scheme copied to this buffer on return. Is lowercase.
  */
-nsresult net_ExtractURLScheme(const nsACString &inURI, nsACString &scheme);
+nsresult net_ExtractURLScheme(const nsACString& inURI, nsACString& scheme);
 
 /* check that the given scheme conforms to RFC 2396 */
-bool net_IsValidScheme(const char *scheme, uint32_t schemeLen);
+bool net_IsValidScheme(const char* scheme, uint32_t schemeLen);
 
-inline bool net_IsValidScheme(const nsCString &scheme) {
+inline bool net_IsValidScheme(const nsCString& scheme) {
   return net_IsValidScheme(scheme.get(), scheme.Length());
 }
 
@@ -109,7 +109,7 @@ inline bool net_IsValidScheme(const nsCString &scheme) {
  * @param input the URL spec we want to filter
  * @param result the out param to write to if filtering happens
  */
-void net_FilterURIString(const nsACString &input, nsACString &result);
+void net_FilterURIString(const nsACString& input, nsACString& result);
 
 /**
  * This function performs character stripping just like net_FilterURIString,
@@ -121,8 +121,8 @@ void net_FilterURIString(const nsACString &input, nsACString &result);
  * @param aFlags the flags which control which characters we escape
  * @param aResult the out param to write to if filtering happens
  */
-nsresult net_FilterAndEscapeURI(const nsACString &aInput, uint32_t aFlags,
-                                nsACString &aResult);
+nsresult net_FilterAndEscapeURI(const nsACString& aInput, uint32_t aFlags,
+                                nsACString& aResult);
 
 #if defined(XP_WIN)
 /**
@@ -138,7 +138,7 @@ nsresult net_FilterAndEscapeURI(const nsACString &aInput, uint32_t aFlags,
  *
  * @returns false if aURL is already normalized.  Otherwise, returns true.
  */
-bool net_NormalizeFileURL(const nsACString &aURL, nsCString &aResultBuf);
+bool net_NormalizeFileURL(const nsACString& aURL, nsCString& aResultBuf);
 #endif
 
 /*****************************************************************************
@@ -146,15 +146,15 @@ bool net_NormalizeFileURL(const nsACString &aURL, nsCString &aResultBuf);
  */
 
 /* convert to lower case */
-void net_ToLowerCase(char *str, uint32_t length);
-void net_ToLowerCase(char *str);
+void net_ToLowerCase(char* str, uint32_t length);
+void net_ToLowerCase(char* str);
 
 /**
  * returns pointer to first character of |str| in the given set.  if not found,
  * then |end| is returned.  stops prematurely if a null byte is encountered,
  * and returns the address of the null byte.
  */
-char *net_FindCharInSet(const char *str, const char *end, const char *set);
+char* net_FindCharInSet(const char* str, const char* end, const char* set);
 
 /**
  * returns pointer to first character of |str| NOT in the given set.  if all
@@ -162,13 +162,13 @@ char *net_FindCharInSet(const char *str, const char *end, const char *set);
  * included in |set|, then stops prematurely if a null byte is encountered,
  * and returns the address of the null byte.
  */
-char *net_FindCharNotInSet(const char *str, const char *end, const char *set);
+char* net_FindCharNotInSet(const char* str, const char* end, const char* set);
 
 /**
  * returns pointer to last character of |str| NOT in the given set.  if all
  * characters are in the given set, then |str - 1| is returned.
  */
-char *net_RFindCharNotInSet(const char *str, const char *end, const char *set);
+char* net_RFindCharNotInSet(const char* str, const char* end, const char* set);
 
 /**
  * Parses a content-type header and returns the content type and
@@ -181,10 +181,10 @@ char *net_RFindCharNotInSet(const char *str, const char *end, const char *set);
  * This parsing is suitable for HTTP request.  Use net_ParseContentType
  * for parsing this header in HTTP responses.
  */
-void net_ParseRequestContentType(const nsACString &aHeaderStr,
-                                 nsACString &aContentType,
-                                 nsACString &aContentCharset,
-                                 bool *aHadCharset);
+void net_ParseRequestContentType(const nsACString& aHeaderStr,
+                                 nsACString& aContentType,
+                                 nsACString& aContentCharset,
+                                 bool* aHadCharset);
 
 /**
  * Parses a content-type header and returns the content type and
@@ -194,9 +194,9 @@ void net_ParseRequestContentType(const nsACString &aHeaderStr,
  * true.  Note that aContentCharset can be empty even if aHadCharset
  * is true.
  */
-void net_ParseContentType(const nsACString &aHeaderStr,
-                          nsACString &aContentType, nsACString &aContentCharset,
-                          bool *aHadCharset);
+void net_ParseContentType(const nsACString& aHeaderStr,
+                          nsACString& aContentType, nsACString& aContentCharset,
+                          bool* aHadCharset);
 /**
  * As above, but also returns the start and end indexes for the charset
  * parameter in aHeaderStr.  These are indices for the entire parameter, NOT
@@ -206,23 +206,23 @@ void net_ParseContentType(const nsACString &aHeaderStr,
  * it's possible to have aContentCharset empty and *aHadCharset true when
  * *aCharsetStart is nonnegative; this corresponds to charset="".
  */
-void net_ParseContentType(const nsACString &aHeaderStr,
-                          nsACString &aContentType, nsACString &aContentCharset,
-                          bool *aHadCharset, int32_t *aCharsetStart,
-                          int32_t *aCharsetEnd);
+void net_ParseContentType(const nsACString& aHeaderStr,
+                          nsACString& aContentType, nsACString& aContentCharset,
+                          bool* aHadCharset, int32_t* aCharsetStart,
+                          int32_t* aCharsetEnd);
 
 /* inline versions */
 
 /* remember the 64-bit platforms ;-) */
-#define NET_MAX_ADDRESS ((char *)UINTPTR_MAX)
+#define NET_MAX_ADDRESS ((char*)UINTPTR_MAX)
 
-inline char *net_FindCharInSet(const char *str, const char *set) {
+inline char* net_FindCharInSet(const char* str, const char* set) {
   return net_FindCharInSet(str, NET_MAX_ADDRESS, set);
 }
-inline char *net_FindCharNotInSet(const char *str, const char *set) {
+inline char* net_FindCharNotInSet(const char* str, const char* set) {
   return net_FindCharNotInSet(str, NET_MAX_ADDRESS, set);
 }
-inline char *net_RFindCharNotInSet(const char *str, const char *set) {
+inline char* net_RFindCharNotInSet(const char* str, const char* set) {
   return net_RFindCharNotInSet(str, str + strlen(str), set);
 }
 
@@ -230,17 +230,17 @@ inline char *net_RFindCharNotInSet(const char *str, const char *set) {
  * This function returns true if the given hostname does not include any
  * restricted characters.  Otherwise, false is returned.
  */
-bool net_IsValidHostName(const nsACString &host);
+bool net_IsValidHostName(const nsACString& host);
 
 /**
  * Checks whether the IPv4 address is valid according to RFC 3986 section 3.2.2.
  */
-bool net_IsValidIPv4Addr(const nsACString &aAddr);
+bool net_IsValidIPv4Addr(const nsACString& aAddr);
 
 /**
  * Checks whether the IPv6 address is valid according to RFC 3986 section 3.2.2.
  */
-bool net_IsValidIPv6Addr(const nsACString &aAddr);
+bool net_IsValidIPv6Addr(const nsACString& aAddr);
 
 /**
  * Returns the max length of a URL. The default is 1048576 (1 MB).
diff --git a/netwerk/base/nsURLHelperOSX.cpp b/netwerk/base/nsURLHelperOSX.cpp
index 7a4665f59f1d2..7219cc1fa5897 100644
--- a/netwerk/base/nsURLHelperOSX.cpp
+++ b/netwerk/base/nsURLHelperOSX.cpp
@@ -12,10 +12,10 @@
 #include "nsReadableUtils.h"
 #include 
 
-static nsTArray *gVolumeList = nullptr;
+static nsTArray* gVolumeList = nullptr;
 
-static bool pathBeginsWithVolName(const nsACString &path,
-                                  nsACString &firstPathComponent) {
+static bool pathBeginsWithVolName(const nsACString& path,
+                                  nsACString& firstPathComponent) {
   // Return whether the 1st path component in path (escaped) is equal to the
   // name of a mounted volume. Return the 1st path component (unescaped) in any
   // case. This needs to be done as quickly as possible, so we cache a list of
@@ -41,8 +41,8 @@ static bool pathBeginsWithVolName(const nsACString &path,
                               &volName, &rootDirectory);
       if (err == noErr) {
         NS_ConvertUTF16toUTF8 volNameStr(
-            Substring((char16_t *)volName.unicode,
-                      (char16_t *)volName.unicode + volName.length));
+            Substring((char16_t*)volName.unicode,
+                      (char16_t*)volName.unicode + volName.length));
         gVolumeList->AppendElement(volNameStr);
         volumeIndex++;
       }
@@ -70,8 +70,8 @@ void net_ShutdownURLHelperOSX() {
   gVolumeList = nullptr;
 }
 
-static nsresult convertHFSPathtoPOSIX(const nsACString &hfsPath,
-                                      nsACString &posixPath) {
+static nsresult convertHFSPathtoPOSIX(const nsACString& hfsPath,
+                                      nsACString& posixPath) {
   // Use CFURL to do the conversion. We don't want to do this by simply
   // using SwapSlashColon - we need the charset mapped from MacRoman
   // to UTF-8, and we need "/Volumes" (or whatever - Apple says this is subject
@@ -88,7 +88,7 @@ static nsresult convertHFSPathtoPOSIX(const nsACString &hfsPath,
     UInt8 pathBuf[PATH_MAX];
     if (CFURLGetFileSystemRepresentation(urlRef, true, pathBuf,
                                          sizeof(pathBuf))) {
-      posixPath = (char *)pathBuf;
+      posixPath = (char*)pathBuf;
       rv = NS_OK;
     }
   }
@@ -97,7 +97,7 @@ static nsresult convertHFSPathtoPOSIX(const nsACString &hfsPath,
   return rv;
 }
 
-static void SwapSlashColon(char *s) {
+static void SwapSlashColon(char* s) {
   while (*s) {
     if (*s == '/')
       *s = ':';
@@ -107,7 +107,7 @@ static void SwapSlashColon(char *s) {
   }
 }
 
-nsresult net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) {
+nsresult net_GetURLSpecFromActualFile(nsIFile* aFile, nsACString& result) {
   // NOTE: This is identical to the implementation in nsURLHelperUnix.cpp
 
   nsresult rv;
@@ -136,7 +136,7 @@ nsresult net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) {
   return NS_OK;
 }
 
-nsresult net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) {
+nsresult net_GetFileFromURLSpec(const nsACString& aURL, nsIFile** result) {
   // NOTE: See also the implementation in nsURLHelperUnix.cpp
   // This matches it except for the HFS path handling.
 
@@ -168,7 +168,7 @@ nsresult net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) {
       // directory doesn't exist, we'll assume this is an HFS path.
       FSRef testRef;
       possibleVolName.InsertLiteral("/", 0);
-      if (::FSPathMakeRef((UInt8 *)possibleVolName.get(), &testRef, nullptr) !=
+      if (::FSPathMakeRef((UInt8*)possibleVolName.get(), &testRef, nullptr) !=
           noErr)
         bHFSPath = true;
     }
@@ -179,7 +179,7 @@ nsresult net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) {
       // can reply on SwapSlashColon() to do what we need
       path.ReplaceSubstring("%2F", ":");
       path.Cut(0, 1);  // directory begins with '/'
-      SwapSlashColon((char *)path.get());
+      SwapSlashColon((char*)path.get());
       // At this point, path is an HFS path made using the same
       // algorithm as nsURLHelperMac. We'll convert to POSIX below.
     }
diff --git a/netwerk/base/nsURLHelperUnix.cpp b/netwerk/base/nsURLHelperUnix.cpp
index 4cceb7d462d77..d0200cd5fa4f7 100644
--- a/netwerk/base/nsURLHelperUnix.cpp
+++ b/netwerk/base/nsURLHelperUnix.cpp
@@ -10,7 +10,7 @@
 #include "nsIFile.h"
 #include "nsNativeCharsetUtils.h"
 
-nsresult net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) {
+nsresult net_GetURLSpecFromActualFile(nsIFile* aFile, nsACString& result) {
   nsresult rv;
   nsAutoCString nativePath, ePath;
   nsAutoString path;
@@ -45,7 +45,7 @@ nsresult net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) {
   return NS_OK;
 }
 
-nsresult net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) {
+nsresult net_GetFileFromURLSpec(const nsACString& aURL, nsIFile** result) {
   // NOTE: See also the implementation in nsURLHelperOSX.cpp,
   // which is based on this.
 
diff --git a/netwerk/base/nsURLHelperWin.cpp b/netwerk/base/nsURLHelperWin.cpp
index fa53eaa60d31f..3af177e494422 100644
--- a/netwerk/base/nsURLHelperWin.cpp
+++ b/netwerk/base/nsURLHelperWin.cpp
@@ -10,7 +10,7 @@
 #include "nsIFile.h"
 #include 
 
-nsresult net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) {
+nsresult net_GetURLSpecFromActualFile(nsIFile* aFile, nsACString& result) {
   nsresult rv;
   nsAutoString path;
 
@@ -44,7 +44,7 @@ nsresult net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result) {
   return NS_OK;
 }
 
-nsresult net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) {
+nsresult net_GetFileFromURLSpec(const nsACString& aURL, nsIFile** result) {
   nsresult rv;
 
   if (aURL.Length() > (uint32_t)net_GetURLMaxLength()) {
@@ -59,7 +59,7 @@ nsresult net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result) {
 
   localFile->SetFollowLinks(true);
 
-  const nsACString *specPtr;
+  const nsACString* specPtr;
 
   nsAutoCString buf;
   if (net_NormalizeFileURL(aURL, buf))
diff --git a/netwerk/base/nsURLParsers.cpp b/netwerk/base/nsURLParsers.cpp
index c949af2a442da..3963f5b3657ef 100644
--- a/netwerk/base/nsURLParsers.cpp
+++ b/netwerk/base/nsURLParsers.cpp
@@ -17,7 +17,7 @@ using namespace mozilla;
 
 //----------------------------------------------------------------------------
 
-static uint32_t CountConsecutiveSlashes(const char *str, int32_t len) {
+static uint32_t CountConsecutiveSlashes(const char* str, int32_t len) {
   RangedPtr p(str, len);
   uint32_t count = 0;
   while (len-- && *p++ == '/') ++count;
@@ -43,20 +43,20 @@ NS_IMPL_ISUPPORTS(nsNoAuthURLParser, nsIURLParser)
   PR_END_MACRO
 
 NS_IMETHODIMP
-nsBaseURLParser::ParseURL(const char *spec, int32_t specLen,
-                          uint32_t *schemePos, int32_t *schemeLen,
-                          uint32_t *authorityPos, int32_t *authorityLen,
-                          uint32_t *pathPos, int32_t *pathLen) {
+nsBaseURLParser::ParseURL(const char* spec, int32_t specLen,
+                          uint32_t* schemePos, int32_t* schemeLen,
+                          uint32_t* authorityPos, int32_t* authorityLen,
+                          uint32_t* pathPos, int32_t* pathLen) {
   if (NS_WARN_IF(!spec)) {
     return NS_ERROR_INVALID_POINTER;
   }
 
   if (specLen < 0) specLen = strlen(spec);
 
-  const char *stop = nullptr;
-  const char *colon = nullptr;
-  const char *slash = nullptr;
-  const char *p = spec;
+  const char* stop = nullptr;
+  const char* colon = nullptr;
+  const char* slash = nullptr;
+  const char* p = spec;
   uint32_t offset = 0;
   int32_t len = specLen;
 
@@ -151,11 +151,11 @@ nsBaseURLParser::ParseURL(const char *spec, int32_t specLen,
 }
 
 NS_IMETHODIMP
-nsBaseURLParser::ParseAuthority(const char *auth, int32_t authLen,
-                                uint32_t *usernamePos, int32_t *usernameLen,
-                                uint32_t *passwordPos, int32_t *passwordLen,
-                                uint32_t *hostnamePos, int32_t *hostnameLen,
-                                int32_t *port) {
+nsBaseURLParser::ParseAuthority(const char* auth, int32_t authLen,
+                                uint32_t* usernamePos, int32_t* usernameLen,
+                                uint32_t* passwordPos, int32_t* passwordLen,
+                                uint32_t* hostnamePos, int32_t* hostnameLen,
+                                int32_t* port) {
   if (NS_WARN_IF(!auth)) {
     return NS_ERROR_INVALID_POINTER;
   }
@@ -170,28 +170,28 @@ nsBaseURLParser::ParseAuthority(const char *auth, int32_t authLen,
 }
 
 NS_IMETHODIMP
-nsBaseURLParser::ParseUserInfo(const char *userinfo, int32_t userinfoLen,
-                               uint32_t *usernamePos, int32_t *usernameLen,
-                               uint32_t *passwordPos, int32_t *passwordLen) {
+nsBaseURLParser::ParseUserInfo(const char* userinfo, int32_t userinfoLen,
+                               uint32_t* usernamePos, int32_t* usernameLen,
+                               uint32_t* passwordPos, int32_t* passwordLen) {
   SET_RESULT(username, 0, -1);
   SET_RESULT(password, 0, -1);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseURLParser::ParseServerInfo(const char *serverinfo, int32_t serverinfoLen,
-                                 uint32_t *hostnamePos, int32_t *hostnameLen,
-                                 int32_t *port) {
+nsBaseURLParser::ParseServerInfo(const char* serverinfo, int32_t serverinfoLen,
+                                 uint32_t* hostnamePos, int32_t* hostnameLen,
+                                 int32_t* port) {
   SET_RESULT(hostname, 0, -1);
   if (port) *port = -1;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseURLParser::ParsePath(const char *path, int32_t pathLen,
-                           uint32_t *filepathPos, int32_t *filepathLen,
-                           uint32_t *queryPos, int32_t *queryLen,
-                           uint32_t *refPos, int32_t *refLen) {
+nsBaseURLParser::ParsePath(const char* path, int32_t pathLen,
+                           uint32_t* filepathPos, int32_t* filepathLen,
+                           uint32_t* queryPos, int32_t* queryLen,
+                           uint32_t* refPos, int32_t* refLen) {
   if (NS_WARN_IF(!path)) {
     return NS_ERROR_INVALID_POINTER;
   }
@@ -204,8 +204,8 @@ nsBaseURLParser::ParsePath(const char *path, int32_t pathLen,
 
   // search for first occurrence of either ? or #
   const char *query_beg = nullptr, *query_end = nullptr;
-  const char *ref_beg = nullptr;
-  const char *p = nullptr;
+  const char* ref_beg = nullptr;
+  const char* p = nullptr;
   for (p = path; p < path + pathLen; ++p) {
     // only match the query string if it precedes the reference fragment
     if (!ref_beg && !query_beg && *p == '?')
@@ -230,7 +230,7 @@ nsBaseURLParser::ParsePath(const char *path, int32_t pathLen,
   else
     SET_RESULT(ref, 0, -1);
 
-  const char *end;
+  const char* end;
   if (query_beg)
     end = query_beg - 1;
   else if (ref_beg)
@@ -247,10 +247,10 @@ nsBaseURLParser::ParsePath(const char *path, int32_t pathLen,
 }
 
 NS_IMETHODIMP
-nsBaseURLParser::ParseFilePath(const char *filepath, int32_t filepathLen,
-                               uint32_t *directoryPos, int32_t *directoryLen,
-                               uint32_t *basenamePos, int32_t *basenameLen,
-                               uint32_t *extensionPos, int32_t *extensionLen) {
+nsBaseURLParser::ParseFilePath(const char* filepath, int32_t filepathLen,
+                               uint32_t* directoryPos, int32_t* directoryLen,
+                               uint32_t* basenamePos, int32_t* basenameLen,
+                               uint32_t* extensionPos, int32_t* extensionLen) {
   if (NS_WARN_IF(!filepath)) {
     return NS_ERROR_INVALID_POINTER;
   }
@@ -264,8 +264,8 @@ nsBaseURLParser::ParseFilePath(const char *filepath, int32_t filepathLen,
     return NS_OK;
   }
 
-  const char *p;
-  const char *end = filepath + filepathLen;
+  const char* p;
+  const char* end = filepath + filepathLen;
 
   // search backwards for filename
   for (p = end - 1; *p != '/' && p > filepath; --p)
@@ -291,8 +291,8 @@ nsBaseURLParser::ParseFilePath(const char *filepath, int32_t filepathLen,
 }
 
 nsresult nsBaseURLParser::ParseFileName(
-    const char *filename, int32_t filenameLen, uint32_t *basenamePos,
-    int32_t *basenameLen, uint32_t *extensionPos, int32_t *extensionLen) {
+    const char* filename, int32_t filenameLen, uint32_t* basenamePos,
+    int32_t* basenameLen, uint32_t* extensionPos, int32_t* extensionLen) {
   if (NS_WARN_IF(!filename)) {
     return NS_ERROR_INVALID_POINTER;
   }
@@ -302,7 +302,7 @@ nsresult nsBaseURLParser::ParseFileName(
   // no extension if filename ends with a '.'
   if (filename[filenameLen - 1] != '.') {
     // ignore '.' at the beginning
-    for (const char *p = filename + filenameLen - 1; p > filename; --p) {
+    for (const char* p = filename + filenameLen - 1; p > filename; --p) {
       if (*p == '.') {
         // filename = 
         SET_RESULT(basename, 0, p - filename);
@@ -323,18 +323,18 @@ nsresult nsBaseURLParser::ParseFileName(
 //----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsNoAuthURLParser::ParseAuthority(const char *auth, int32_t authLen,
-                                  uint32_t *usernamePos, int32_t *usernameLen,
-                                  uint32_t *passwordPos, int32_t *passwordLen,
-                                  uint32_t *hostnamePos, int32_t *hostnameLen,
-                                  int32_t *port) {
+nsNoAuthURLParser::ParseAuthority(const char* auth, int32_t authLen,
+                                  uint32_t* usernamePos, int32_t* usernameLen,
+                                  uint32_t* passwordPos, int32_t* passwordLen,
+                                  uint32_t* hostnamePos, int32_t* hostnameLen,
+                                  int32_t* port) {
   MOZ_ASSERT_UNREACHABLE("Shouldn't parse auth in a NoAuthURL!");
   return NS_ERROR_UNEXPECTED;
 }
 
-void nsNoAuthURLParser::ParseAfterScheme(const char *spec, int32_t specLen,
-                                         uint32_t *authPos, int32_t *authLen,
-                                         uint32_t *pathPos, int32_t *pathLen) {
+void nsNoAuthURLParser::ParseAfterScheme(const char* spec, int32_t specLen,
+                                         uint32_t* authPos, int32_t* authLen,
+                                         uint32_t* pathPos, int32_t* pathLen) {
   MOZ_ASSERT(specLen >= 0, "unexpected");
 
   // everything is the path
@@ -344,7 +344,7 @@ void nsNoAuthURLParser::ParseAfterScheme(const char *spec, int32_t specLen,
     case 1:
       break;
     case 2: {
-      const char *p = nullptr;
+      const char* p = nullptr;
       if (specLen > 2) {
         // looks like there is an authority section
 
@@ -380,11 +380,11 @@ void nsNoAuthURLParser::ParseAfterScheme(const char *spec, int32_t specLen,
 
 #if defined(XP_WIN)
 NS_IMETHODIMP
-nsNoAuthURLParser::ParseFilePath(const char *filepath, int32_t filepathLen,
-                                 uint32_t *directoryPos, int32_t *directoryLen,
-                                 uint32_t *basenamePos, int32_t *basenameLen,
-                                 uint32_t *extensionPos,
-                                 int32_t *extensionLen) {
+nsNoAuthURLParser::ParseFilePath(const char* filepath, int32_t filepathLen,
+                                 uint32_t* directoryPos, int32_t* directoryLen,
+                                 uint32_t* basenamePos, int32_t* basenameLen,
+                                 uint32_t* extensionPos,
+                                 int32_t* extensionLen) {
   if (NS_WARN_IF(!filepath)) {
     return NS_ERROR_INVALID_POINTER;
   }
@@ -394,8 +394,8 @@ nsNoAuthURLParser::ParseFilePath(const char *filepath, int32_t filepathLen,
   // look for a filepath consisting of only a drive number, which may or
   // may not have a leading slash.
   if (filepathLen > 1 && filepathLen < 4) {
-    const char *end = filepath + filepathLen;
-    const char *p = filepath;
+    const char* end = filepath + filepathLen;
+    const char* p = filepath;
     if (*p == '/') p++;
     if ((end - p == 2) && (p[1] == ':' || p[1] == '|') && IsAsciiAlpha(*p)) {
       // filepath = :
@@ -418,11 +418,11 @@ nsNoAuthURLParser::ParseFilePath(const char *filepath, int32_t filepathLen,
 //----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsAuthURLParser::ParseAuthority(const char *auth, int32_t authLen,
-                                uint32_t *usernamePos, int32_t *usernameLen,
-                                uint32_t *passwordPos, int32_t *passwordLen,
-                                uint32_t *hostnamePos, int32_t *hostnameLen,
-                                int32_t *port) {
+nsAuthURLParser::ParseAuthority(const char* auth, int32_t authLen,
+                                uint32_t* usernamePos, int32_t* usernameLen,
+                                uint32_t* passwordPos, int32_t* passwordLen,
+                                uint32_t* hostnamePos, int32_t* hostnameLen,
+                                int32_t* port) {
   nsresult rv;
 
   if (NS_WARN_IF(!auth)) {
@@ -440,7 +440,7 @@ nsAuthURLParser::ParseAuthority(const char *auth, int32_t authLen,
   }
 
   // search backwards for @
-  const char *p = auth + authLen - 1;
+  const char* p = auth + authLen - 1;
   for (; (*p != '@') && (p > auth); --p) {
   }
   if (*p == '@') {
@@ -469,9 +469,9 @@ nsAuthURLParser::ParseAuthority(const char *auth, int32_t authLen,
 }
 
 NS_IMETHODIMP
-nsAuthURLParser::ParseUserInfo(const char *userinfo, int32_t userinfoLen,
-                               uint32_t *usernamePos, int32_t *usernameLen,
-                               uint32_t *passwordPos, int32_t *passwordLen) {
+nsAuthURLParser::ParseUserInfo(const char* userinfo, int32_t userinfoLen,
+                               uint32_t* usernamePos, int32_t* usernameLen,
+                               uint32_t* passwordPos, int32_t* passwordLen) {
   if (NS_WARN_IF(!userinfo)) {
     return NS_ERROR_INVALID_POINTER;
   }
@@ -484,7 +484,7 @@ nsAuthURLParser::ParseUserInfo(const char *userinfo, int32_t userinfoLen,
     return NS_OK;
   }
 
-  const char *p = (const char *)memchr(userinfo, ':', userinfoLen);
+  const char* p = (const char*)memchr(userinfo, ':', userinfoLen);
   if (p) {
     // userinfo = 
     SET_RESULT(username, 0, p - userinfo);
@@ -498,9 +498,9 @@ nsAuthURLParser::ParseUserInfo(const char *userinfo, int32_t userinfoLen,
 }
 
 NS_IMETHODIMP
-nsAuthURLParser::ParseServerInfo(const char *serverinfo, int32_t serverinfoLen,
-                                 uint32_t *hostnamePos, int32_t *hostnameLen,
-                                 int32_t *port) {
+nsAuthURLParser::ParseServerInfo(const char* serverinfo, int32_t serverinfoLen,
+                                 uint32_t* hostnamePos, int32_t* hostnameLen,
+                                 int32_t* port) {
   if (NS_WARN_IF(!serverinfo)) {
     return NS_ERROR_INVALID_POINTER;
   }
@@ -515,7 +515,7 @@ nsAuthURLParser::ParseServerInfo(const char *serverinfo, int32_t serverinfoLen,
 
   // search backwards for a ':' but stop on ']' (IPv6 address literal
   // delimiter).  check for illegal characters in the hostname.
-  const char *p = serverinfo + serverinfoLen - 1;
+  const char* p = serverinfo + serverinfoLen - 1;
   const char *colon = nullptr, *bracket = nullptr;
   for (; p > serverinfo; --p) {
     switch (*p) {
@@ -540,7 +540,7 @@ nsAuthURLParser::ParseServerInfo(const char *serverinfo, int32_t serverinfoLen,
       if (buf.Length() == 0) {
         *port = -1;
       } else {
-        const char *nondigit = NS_strspnp("0123456789", buf.get());
+        const char* nondigit = NS_strspnp("0123456789", buf.get());
         if (nondigit && *nondigit) return NS_ERROR_MALFORMED_URI;
 
         nsresult err;
@@ -566,16 +566,16 @@ nsAuthURLParser::ParseServerInfo(const char *serverinfo, int32_t serverinfoLen,
   return NS_OK;
 }
 
-void nsAuthURLParser::ParseAfterScheme(const char *spec, int32_t specLen,
-                                       uint32_t *authPos, int32_t *authLen,
-                                       uint32_t *pathPos, int32_t *pathLen) {
+void nsAuthURLParser::ParseAfterScheme(const char* spec, int32_t specLen,
+                                       uint32_t* authPos, int32_t* authLen,
+                                       uint32_t* pathPos, int32_t* pathLen) {
   MOZ_ASSERT(specLen >= 0, "unexpected");
 
   uint32_t nslash = CountConsecutiveSlashes(spec, specLen);
 
   // search for the end of the authority section
-  const char *end = spec + specLen;
-  const char *p;
+  const char* end = spec + specLen;
+  const char* p;
   for (p = spec + nslash; p < end; ++p) {
     if (*p == '/' || *p == '?' || *p == '#') break;
   }
@@ -594,16 +594,16 @@ void nsAuthURLParser::ParseAfterScheme(const char *spec, int32_t specLen,
 // nsStdURLParser implementation
 //----------------------------------------------------------------------------
 
-void nsStdURLParser::ParseAfterScheme(const char *spec, int32_t specLen,
-                                      uint32_t *authPos, int32_t *authLen,
-                                      uint32_t *pathPos, int32_t *pathLen) {
+void nsStdURLParser::ParseAfterScheme(const char* spec, int32_t specLen,
+                                      uint32_t* authPos, int32_t* authLen,
+                                      uint32_t* pathPos, int32_t* pathLen) {
   MOZ_ASSERT(specLen >= 0, "unexpected");
 
   uint32_t nslash = CountConsecutiveSlashes(spec, specLen);
 
   // search for the end of the authority section
-  const char *end = spec + specLen;
-  const char *p;
+  const char* end = spec + specLen;
+  const char* p;
   for (p = spec + nslash; p < end; ++p) {
     if (strchr("/?#;", *p)) break;
   }
diff --git a/netwerk/base/nsURLParsers.h b/netwerk/base/nsURLParsers.h
index b7ce3d79e8dd4..3143022b900f4 100644
--- a/netwerk/base/nsURLParsers.h
+++ b/netwerk/base/nsURLParsers.h
@@ -21,9 +21,9 @@ class nsBaseURLParser : public nsIURLParser {
 
  protected:
   // implemented by subclasses
-  virtual void ParseAfterScheme(const char *spec, int32_t specLen,
-                                uint32_t *authPos, int32_t *authLen,
-                                uint32_t *pathPos, int32_t *pathLen) = 0;
+  virtual void ParseAfterScheme(const char* spec, int32_t specLen,
+                                uint32_t* authPos, int32_t* authLen,
+                                uint32_t* pathPos, int32_t* pathLen) = 0;
 };
 
 //----------------------------------------------------------------------------
@@ -46,20 +46,19 @@ class nsNoAuthURLParser final : public nsBaseURLParser {
   NS_DECL_THREADSAFE_ISUPPORTS
 
 #if defined(XP_WIN)
-  NS_IMETHOD ParseFilePath(const char *, int32_t, uint32_t *, int32_t *,
-                           uint32_t *, int32_t *, uint32_t *,
-                           int32_t *) override;
+  NS_IMETHOD ParseFilePath(const char*, int32_t, uint32_t*, int32_t*, uint32_t*,
+                           int32_t*, uint32_t*, int32_t*) override;
 #endif
 
-  NS_IMETHOD ParseAuthority(const char *auth, int32_t authLen,
-                            uint32_t *usernamePos, int32_t *usernameLen,
-                            uint32_t *passwordPos, int32_t *passwordLen,
-                            uint32_t *hostnamePos, int32_t *hostnameLen,
-                            int32_t *port) override;
+  NS_IMETHOD ParseAuthority(const char* auth, int32_t authLen,
+                            uint32_t* usernamePos, int32_t* usernameLen,
+                            uint32_t* passwordPos, int32_t* passwordLen,
+                            uint32_t* hostnamePos, int32_t* hostnameLen,
+                            int32_t* port) override;
 
-  void ParseAfterScheme(const char *spec, int32_t specLen, uint32_t *authPos,
-                        int32_t *authLen, uint32_t *pathPos,
-                        int32_t *pathLen) override;
+  void ParseAfterScheme(const char* spec, int32_t specLen, uint32_t* authPos,
+                        int32_t* authLen, uint32_t* pathPos,
+                        int32_t* pathLen) override;
 };
 
 //----------------------------------------------------------------------------
@@ -78,24 +77,24 @@ class nsAuthURLParser : public nsBaseURLParser {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  NS_IMETHOD ParseAuthority(const char *auth, int32_t authLen,
-                            uint32_t *usernamePos, int32_t *usernameLen,
-                            uint32_t *passwordPos, int32_t *passwordLen,
-                            uint32_t *hostnamePos, int32_t *hostnameLen,
-                            int32_t *port) override;
+  NS_IMETHOD ParseAuthority(const char* auth, int32_t authLen,
+                            uint32_t* usernamePos, int32_t* usernameLen,
+                            uint32_t* passwordPos, int32_t* passwordLen,
+                            uint32_t* hostnamePos, int32_t* hostnameLen,
+                            int32_t* port) override;
 
-  NS_IMETHOD ParseUserInfo(const char *userinfo, int32_t userinfoLen,
-                           uint32_t *usernamePos, int32_t *usernameLen,
-                           uint32_t *passwordPos,
-                           int32_t *passwordLen) override;
+  NS_IMETHOD ParseUserInfo(const char* userinfo, int32_t userinfoLen,
+                           uint32_t* usernamePos, int32_t* usernameLen,
+                           uint32_t* passwordPos,
+                           int32_t* passwordLen) override;
 
-  NS_IMETHOD ParseServerInfo(const char *serverinfo, int32_t serverinfoLen,
-                             uint32_t *hostnamePos, int32_t *hostnameLen,
-                             int32_t *port) override;
+  NS_IMETHOD ParseServerInfo(const char* serverinfo, int32_t serverinfoLen,
+                             uint32_t* hostnamePos, int32_t* hostnameLen,
+                             int32_t* port) override;
 
-  void ParseAfterScheme(const char *spec, int32_t specLen, uint32_t *authPos,
-                        int32_t *authLen, uint32_t *pathPos,
-                        int32_t *pathLen) override;
+  void ParseAfterScheme(const char* spec, int32_t specLen, uint32_t* authPos,
+                        int32_t* authLen, uint32_t* pathPos,
+                        int32_t* pathLen) override;
 };
 
 //----------------------------------------------------------------------------
@@ -112,9 +111,9 @@ class nsStdURLParser : public nsAuthURLParser {
   virtual ~nsStdURLParser() = default;
 
  public:
-  void ParseAfterScheme(const char *spec, int32_t specLen, uint32_t *authPos,
-                        int32_t *authLen, uint32_t *pathPos,
-                        int32_t *pathLen) override;
+  void ParseAfterScheme(const char* spec, int32_t specLen, uint32_t* authPos,
+                        int32_t* authLen, uint32_t* pathPos,
+                        int32_t* pathLen) override;
 };
 
 #endif  // nsURLParsers_h__
diff --git a/netwerk/cache/nsApplicationCache.h b/netwerk/cache/nsApplicationCache.h
index 4826a4b537608..37e3bc14e45f8 100644
--- a/netwerk/cache/nsApplicationCache.h
+++ b/netwerk/cache/nsApplicationCache.h
@@ -16,8 +16,8 @@ class nsApplicationCache : public nsIApplicationCache,
   NS_DECL_ISUPPORTS
   NS_DECL_NSIAPPLICATIONCACHE
 
-  nsApplicationCache(nsOfflineCacheDevice *device, const nsACString &group,
-                     const nsACString &clientID);
+  nsApplicationCache(nsOfflineCacheDevice* device, const nsACString& group,
+                     const nsACString& clientID);
 
   nsApplicationCache();
 
diff --git a/netwerk/cache/nsApplicationCacheService.cpp b/netwerk/cache/nsApplicationCacheService.cpp
index 5e34b248a93ac..14f5d9bcb8c33 100644
--- a/netwerk/cache/nsApplicationCacheService.cpp
+++ b/netwerk/cache/nsApplicationCacheService.cpp
@@ -30,8 +30,8 @@ nsApplicationCacheService::nsApplicationCacheService() {
 
 NS_IMETHODIMP
 nsApplicationCacheService::BuildGroupIDForInfo(
-    nsIURI *aManifestURL, nsILoadContextInfo *aLoadContextInfo,
-    nsACString &_result) {
+    nsIURI* aManifestURL, nsILoadContextInfo* aLoadContextInfo,
+    nsACString& _result) {
   nsresult rv;
 
   nsAutoCString originSuffix;
@@ -48,8 +48,8 @@ nsApplicationCacheService::BuildGroupIDForInfo(
 
 NS_IMETHODIMP
 nsApplicationCacheService::BuildGroupIDForSuffix(
-    nsIURI *aManifestURL, nsACString const &aOriginSuffix,
-    nsACString &_result) {
+    nsIURI* aManifestURL, nsACString const& aOriginSuffix,
+    nsACString& _result) {
   nsresult rv;
 
   rv = nsOfflineCacheDevice::BuildApplicationCacheGroupID(
@@ -60,8 +60,8 @@ nsApplicationCacheService::BuildGroupIDForSuffix(
 }
 
 NS_IMETHODIMP
-nsApplicationCacheService::CreateApplicationCache(const nsACString &group,
-                                                  nsIApplicationCache **out) {
+nsApplicationCacheService::CreateApplicationCache(const nsACString& group,
+                                                  nsIApplicationCache** out) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -72,8 +72,8 @@ nsApplicationCacheService::CreateApplicationCache(const nsACString &group,
 
 NS_IMETHODIMP
 nsApplicationCacheService::CreateCustomApplicationCache(
-    const nsACString &group, nsIFile *profileDir, int32_t quota,
-    nsIApplicationCache **out) {
+    const nsACString& group, nsIFile* profileDir, int32_t quota,
+    nsIApplicationCache** out) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -84,8 +84,8 @@ nsApplicationCacheService::CreateCustomApplicationCache(
 }
 
 NS_IMETHODIMP
-nsApplicationCacheService::GetApplicationCache(const nsACString &clientID,
-                                               nsIApplicationCache **out) {
+nsApplicationCacheService::GetApplicationCache(const nsACString& clientID,
+                                               nsIApplicationCache** out) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -95,8 +95,8 @@ nsApplicationCacheService::GetApplicationCache(const nsACString &clientID,
 }
 
 NS_IMETHODIMP
-nsApplicationCacheService::GetActiveCache(const nsACString &group,
-                                          nsIApplicationCache **out) {
+nsApplicationCacheService::GetActiveCache(const nsACString& group,
+                                          nsIApplicationCache** out) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -106,7 +106,7 @@ nsApplicationCacheService::GetActiveCache(const nsACString &group,
 }
 
 NS_IMETHODIMP
-nsApplicationCacheService::DeactivateGroup(const nsACString &group) {
+nsApplicationCacheService::DeactivateGroup(const nsACString& group) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -117,8 +117,8 @@ nsApplicationCacheService::DeactivateGroup(const nsACString &group) {
 
 NS_IMETHODIMP
 nsApplicationCacheService::ChooseApplicationCache(
-    const nsACString &key, nsILoadContextInfo *aLoadContextInfo,
-    nsIApplicationCache **out) {
+    const nsACString& key, nsILoadContextInfo* aLoadContextInfo,
+    nsIApplicationCache** out) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -129,8 +129,8 @@ nsApplicationCacheService::ChooseApplicationCache(
 }
 
 NS_IMETHODIMP
-nsApplicationCacheService::CacheOpportunistically(nsIApplicationCache *cache,
-                                                  const nsACString &key) {
+nsApplicationCacheService::CacheOpportunistically(nsIApplicationCache* cache,
+                                                  const nsACString& key) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -140,7 +140,7 @@ nsApplicationCacheService::CacheOpportunistically(nsIApplicationCache *cache,
 }
 
 NS_IMETHODIMP
-nsApplicationCacheService::Evict(nsILoadContextInfo *aInfo) {
+nsApplicationCacheService::Evict(nsILoadContextInfo* aInfo) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -151,7 +151,7 @@ nsApplicationCacheService::Evict(nsILoadContextInfo *aInfo) {
 
 NS_IMETHODIMP
 nsApplicationCacheService::EvictMatchingOriginAttributes(
-    nsAString const &aPattern) {
+    nsAString const& aPattern) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -170,7 +170,7 @@ nsApplicationCacheService::EvictMatchingOriginAttributes(
 }
 
 NS_IMETHODIMP
-nsApplicationCacheService::GetGroups(uint32_t *count, char ***keys) {
+nsApplicationCacheService::GetGroups(uint32_t* count, char*** keys) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -180,7 +180,7 @@ nsApplicationCacheService::GetGroups(uint32_t *count, char ***keys) {
 }
 
 NS_IMETHODIMP
-nsApplicationCacheService::GetGroupsTimeOrdered(uint32_t *count, char ***keys) {
+nsApplicationCacheService::GetGroupsTimeOrdered(uint32_t* count, char*** keys) {
   if (!mCacheService) return NS_ERROR_UNEXPECTED;
 
   RefPtr device;
@@ -202,8 +202,8 @@ class AppCacheClearDataObserver final : public nsIObserver {
 
   // nsIObserver implementation.
   NS_IMETHOD
-  Observe(nsISupports *aSubject, const char *aTopic,
-          const char16_t *aData) override {
+  Observe(nsISupports* aSubject, const char* aTopic,
+          const char16_t* aData) override {
     MOZ_ASSERT(!nsCRT::strcmp(aTopic, "clear-origin-attributes-data"));
 
     nsresult rv;
diff --git a/netwerk/cache/nsCacheDevice.h b/netwerk/cache/nsCacheDevice.h
index 3ea9a7417b88b..5b07ce9da0e3a 100644
--- a/netwerk/cache/nsCacheDevice.h
+++ b/netwerk/cache/nsCacheDevice.h
@@ -29,35 +29,35 @@ class nsCacheDevice {
   virtual nsresult Init() = 0;
   virtual nsresult Shutdown() = 0;
 
-  virtual const char *GetDeviceID(void) = 0;
-  virtual nsCacheEntry *FindEntry(nsCString *key, bool *collision) = 0;
+  virtual const char* GetDeviceID(void) = 0;
+  virtual nsCacheEntry* FindEntry(nsCString* key, bool* collision) = 0;
 
-  virtual nsresult DeactivateEntry(nsCacheEntry *entry) = 0;
-  virtual nsresult BindEntry(nsCacheEntry *entry) = 0;
-  virtual void DoomEntry(nsCacheEntry *entry) = 0;
+  virtual nsresult DeactivateEntry(nsCacheEntry* entry) = 0;
+  virtual nsresult BindEntry(nsCacheEntry* entry) = 0;
+  virtual void DoomEntry(nsCacheEntry* entry) = 0;
 
-  virtual nsresult OpenInputStreamForEntry(nsCacheEntry *entry,
+  virtual nsresult OpenInputStreamForEntry(nsCacheEntry* entry,
                                            nsCacheAccessMode mode,
                                            uint32_t offset,
-                                           nsIInputStream **result) = 0;
+                                           nsIInputStream** result) = 0;
 
-  virtual nsresult OpenOutputStreamForEntry(nsCacheEntry *entry,
+  virtual nsresult OpenOutputStreamForEntry(nsCacheEntry* entry,
                                             nsCacheAccessMode mode,
                                             uint32_t offset,
-                                            nsIOutputStream **result) = 0;
+                                            nsIOutputStream** result) = 0;
 
-  virtual nsresult GetFileForEntry(nsCacheEntry *entry, nsIFile **result) = 0;
+  virtual nsresult GetFileForEntry(nsCacheEntry* entry, nsIFile** result) = 0;
 
-  virtual nsresult OnDataSizeChange(nsCacheEntry *entry, int32_t deltaSize) = 0;
+  virtual nsresult OnDataSizeChange(nsCacheEntry* entry, int32_t deltaSize) = 0;
 
-  virtual nsresult Visit(nsICacheVisitor *visitor) = 0;
+  virtual nsresult Visit(nsICacheVisitor* visitor) = 0;
 
   /**
    * Device must evict entries associated with clientID.  If clientID ==
    * nullptr, all entries must be evicted.  Active entries must be doomed,
    * rather than evicted.
    */
-  virtual nsresult EvictEntries(const char *clientID) = 0;
+  virtual nsresult EvictEntries(const char* clientID) = 0;
 };
 
 #endif  // _nsCacheDevice_h_
diff --git a/netwerk/cache/nsCacheEntry.cpp b/netwerk/cache/nsCacheEntry.cpp
index 3596b9f37e9ec..89d6b7e6d841f 100644
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -19,7 +19,7 @@
 
 using namespace mozilla;
 
-nsCacheEntry::nsCacheEntry(const nsACString &key, bool streamBased,
+nsCacheEntry::nsCacheEntry(const nsACString& key, bool streamBased,
                            nsCacheStoragePolicy storagePolicy)
     : mKey(key),
       mFetchCount(0),
@@ -52,10 +52,10 @@ nsCacheEntry::~nsCacheEntry() {
   if (mData) nsCacheService::ReleaseObject_Locked(mData, mEventTarget);
 }
 
-nsresult nsCacheEntry::Create(const char *key, bool streamBased,
+nsresult nsCacheEntry::Create(const char* key, bool streamBased,
                               nsCacheStoragePolicy storagePolicy,
-                              nsCacheDevice *device, nsCacheEntry **result) {
-  nsCacheEntry *entry =
+                              nsCacheDevice* device, nsCacheEntry** result) {
+  nsCacheEntry* entry =
       new nsCacheEntry(nsCString(key), streamBased, storagePolicy);
   entry->SetCacheDevice(device);
   *result = entry;
@@ -68,7 +68,7 @@ void nsCacheEntry::Fetched() {
   MarkEntryDirty();
 }
 
-const char *nsCacheEntry::GetDeviceID() {
+const char* nsCacheEntry::GetDeviceID() {
   if (mCacheDevice) return mCacheDevice->GetDeviceID();
   return nullptr;
 }
@@ -78,7 +78,7 @@ void nsCacheEntry::TouchData() {
   MarkDataDirty();
 }
 
-void nsCacheEntry::SetData(nsISupports *data) {
+void nsCacheEntry::SetData(nsISupports* data) {
   if (mData) {
     nsCacheService::ReleaseObject_Locked(mData, mEventTarget);
     mData = nullptr;
@@ -104,8 +104,8 @@ void nsCacheEntry::TouchMetaData() {
  *                    doomed)
  */
 
-nsresult nsCacheEntry::RequestAccess(nsCacheRequest *request,
-                                     nsCacheAccessMode *accessGranted) {
+nsresult nsCacheEntry::RequestAccess(nsCacheRequest* request,
+                                     nsCacheAccessMode* accessGranted) {
   nsresult rv = NS_OK;
 
   if (IsDoomed()) return NS_ERROR_CACHE_ENTRY_DOOMED;
@@ -145,12 +145,12 @@ nsresult nsCacheEntry::RequestAccess(nsCacheRequest *request,
   return rv;
 }
 
-nsresult nsCacheEntry::CreateDescriptor(nsCacheRequest *request,
+nsresult nsCacheEntry::CreateDescriptor(nsCacheRequest* request,
                                         nsCacheAccessMode accessGranted,
-                                        nsICacheEntryDescriptor **result) {
+                                        nsICacheEntryDescriptor** result) {
   NS_ENSURE_ARG_POINTER(request && result);
 
-  nsCacheEntryDescriptor *descriptor =
+  nsCacheEntryDescriptor* descriptor =
       new nsCacheEntryDescriptor(this, accessGranted);
 
   // XXX check request is on q
@@ -167,7 +167,7 @@ nsresult nsCacheEntry::CreateDescriptor(nsCacheRequest *request,
   return NS_OK;
 }
 
-bool nsCacheEntry::RemoveRequest(nsCacheRequest *request) {
+bool nsCacheEntry::RemoveRequest(nsCacheRequest* request) {
   // XXX if debug: verify this request belongs to this entry
   PR_REMOVE_AND_INIT_LINK(request);
 
@@ -176,8 +176,8 @@ bool nsCacheEntry::RemoveRequest(nsCacheRequest *request) {
            (PR_CLIST_IS_EMPTY(&mDescriptorQ)));
 }
 
-bool nsCacheEntry::RemoveDescriptor(nsCacheEntryDescriptor *descriptor,
-                                    bool *doomEntry) {
+bool nsCacheEntry::RemoveDescriptor(nsCacheEntryDescriptor* descriptor,
+                                    bool* doomEntry) {
   NS_ASSERTION(descriptor->CacheEntry() == this, "### Wrong cache entry!!");
 
   *doomEntry = descriptor->ClearCacheEntry();
@@ -194,12 +194,12 @@ bool nsCacheEntry::RemoveDescriptor(nsCacheEntryDescriptor *descriptor,
 }
 
 void nsCacheEntry::DetachDescriptors() {
-  nsCacheEntryDescriptor *descriptor =
-      (nsCacheEntryDescriptor *)PR_LIST_HEAD(&mDescriptorQ);
+  nsCacheEntryDescriptor* descriptor =
+      (nsCacheEntryDescriptor*)PR_LIST_HEAD(&mDescriptorQ);
 
   while (descriptor != &mDescriptorQ) {
-    nsCacheEntryDescriptor *nextDescriptor =
-        (nsCacheEntryDescriptor *)PR_NEXT_LINK(descriptor);
+    nsCacheEntryDescriptor* nextDescriptor =
+        (nsCacheEntryDescriptor*)PR_NEXT_LINK(descriptor);
 
     descriptor->ClearCacheEntry();
     PR_REMOVE_AND_INIT_LINK(descriptor);
@@ -208,13 +208,13 @@ void nsCacheEntry::DetachDescriptors() {
 }
 
 void nsCacheEntry::GetDescriptors(
-    nsTArray > &outDescriptors) {
-  nsCacheEntryDescriptor *descriptor =
-      (nsCacheEntryDescriptor *)PR_LIST_HEAD(&mDescriptorQ);
+    nsTArray >& outDescriptors) {
+  nsCacheEntryDescriptor* descriptor =
+      (nsCacheEntryDescriptor*)PR_LIST_HEAD(&mDescriptorQ);
 
   while (descriptor != &mDescriptorQ) {
-    nsCacheEntryDescriptor *nextDescriptor =
-        (nsCacheEntryDescriptor *)PR_NEXT_LINK(descriptor);
+    nsCacheEntryDescriptor* nextDescriptor =
+        (nsCacheEntryDescriptor*)PR_NEXT_LINK(descriptor);
 
     outDescriptors.AppendElement(descriptor);
     descriptor = nextDescriptor;
@@ -228,7 +228,7 @@ void nsCacheEntry::GetDescriptors(
 NS_IMPL_ISUPPORTS(nsCacheEntryInfo, nsICacheEntryInfo)
 
 NS_IMETHODIMP
-nsCacheEntryInfo::GetClientID(nsACString &aClientID) {
+nsCacheEntryInfo::GetClientID(nsACString& aClientID) {
   if (!mCacheEntry) {
     aClientID.Truncate();
     return NS_ERROR_NOT_AVAILABLE;
@@ -238,7 +238,7 @@ nsCacheEntryInfo::GetClientID(nsACString &aClientID) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryInfo::GetDeviceID(nsACString &aDeviceID) {
+nsCacheEntryInfo::GetDeviceID(nsACString& aDeviceID) {
   if (!mCacheEntry) {
     aDeviceID.Truncate();
     return NS_ERROR_NOT_AVAILABLE;
@@ -249,14 +249,14 @@ nsCacheEntryInfo::GetDeviceID(nsACString &aDeviceID) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryInfo::GetKey(nsACString &key) {
+nsCacheEntryInfo::GetKey(nsACString& key) {
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
   return ClientKeyFromCacheKey(*mCacheEntry->Key(), key);
 }
 
 NS_IMETHODIMP
-nsCacheEntryInfo::GetFetchCount(int32_t *fetchCount) {
+nsCacheEntryInfo::GetFetchCount(int32_t* fetchCount) {
   NS_ENSURE_ARG_POINTER(fetchCount);
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
@@ -265,7 +265,7 @@ nsCacheEntryInfo::GetFetchCount(int32_t *fetchCount) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryInfo::GetLastFetched(uint32_t *lastFetched) {
+nsCacheEntryInfo::GetLastFetched(uint32_t* lastFetched) {
   NS_ENSURE_ARG_POINTER(lastFetched);
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
@@ -274,7 +274,7 @@ nsCacheEntryInfo::GetLastFetched(uint32_t *lastFetched) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryInfo::GetLastModified(uint32_t *lastModified) {
+nsCacheEntryInfo::GetLastModified(uint32_t* lastModified) {
   NS_ENSURE_ARG_POINTER(lastModified);
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
@@ -283,7 +283,7 @@ nsCacheEntryInfo::GetLastModified(uint32_t *lastModified) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryInfo::GetExpirationTime(uint32_t *expirationTime) {
+nsCacheEntryInfo::GetExpirationTime(uint32_t* expirationTime) {
   NS_ENSURE_ARG_POINTER(expirationTime);
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
@@ -292,7 +292,7 @@ nsCacheEntryInfo::GetExpirationTime(uint32_t *expirationTime) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryInfo::GetDataSize(uint32_t *dataSize) {
+nsCacheEntryInfo::GetDataSize(uint32_t* dataSize) {
   NS_ENSURE_ARG_POINTER(dataSize);
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
@@ -301,7 +301,7 @@ nsCacheEntryInfo::GetDataSize(uint32_t *dataSize) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryInfo::IsStreamBased(bool *result) {
+nsCacheEntryInfo::IsStreamBased(bool* result) {
   NS_ENSURE_ARG_POINTER(result);
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
@@ -339,17 +339,17 @@ void nsCacheEntryHashTable::Shutdown() {
   }
 }
 
-nsCacheEntry *nsCacheEntryHashTable::GetEntry(const nsCString *key) const {
+nsCacheEntry* nsCacheEntryHashTable::GetEntry(const nsCString* key) const {
   NS_ASSERTION(initialized, "nsCacheEntryHashTable not initialized");
   if (!initialized) return nullptr;
 
-  PLDHashEntryHdr *hashEntry = table.Search(key);
-  return hashEntry ? ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry
+  PLDHashEntryHdr* hashEntry = table.Search(key);
+  return hashEntry ? ((nsCacheEntryHashTableEntry*)hashEntry)->cacheEntry
                    : nullptr;
 }
 
-nsresult nsCacheEntryHashTable::AddEntry(nsCacheEntry *cacheEntry) {
-  PLDHashEntryHdr *hashEntry;
+nsresult nsCacheEntryHashTable::AddEntry(nsCacheEntry* cacheEntry) {
+  PLDHashEntryHdr* hashEntry;
 
   NS_ASSERTION(initialized, "nsCacheEntryHashTable not initialized");
   if (!initialized) return NS_ERROR_NOT_INITIALIZED;
@@ -358,14 +358,14 @@ nsresult nsCacheEntryHashTable::AddEntry(nsCacheEntry *cacheEntry) {
   hashEntry = table.Add(&(cacheEntry->mKey), fallible);
 
   if (!hashEntry) return NS_ERROR_FAILURE;
-  NS_ASSERTION(((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry == nullptr,
+  NS_ASSERTION(((nsCacheEntryHashTableEntry*)hashEntry)->cacheEntry == nullptr,
                "### nsCacheEntryHashTable::AddEntry - entry already used");
-  ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry = cacheEntry;
+  ((nsCacheEntryHashTableEntry*)hashEntry)->cacheEntry = cacheEntry;
 
   return NS_OK;
 }
 
-void nsCacheEntryHashTable::RemoveEntry(nsCacheEntry *cacheEntry) {
+void nsCacheEntryHashTable::RemoveEntry(nsCacheEntry* cacheEntry) {
   NS_ASSERTION(initialized, "nsCacheEntryHashTable not initialized");
   NS_ASSERTION(cacheEntry, "### cacheEntry == nullptr");
 
@@ -373,7 +373,7 @@ void nsCacheEntryHashTable::RemoveEntry(nsCacheEntry *cacheEntry) {
 
 #if DEBUG
   // XXX debug code to make sure we have the entry we're trying to remove
-  nsCacheEntry *check = GetEntry(&(cacheEntry->mKey));
+  nsCacheEntry* check = GetEntry(&(cacheEntry->mKey));
   NS_ASSERTION(check == cacheEntry,
                "### Attempting to remove unknown cache entry!!!");
 #endif
@@ -388,29 +388,29 @@ PLDHashTable::Iterator nsCacheEntryHashTable::Iter() {
  *  hash table operation callback functions
  */
 
-PLDHashNumber nsCacheEntryHashTable::HashKey(const void *key) {
-  return HashString(*static_cast(key));
+PLDHashNumber nsCacheEntryHashTable::HashKey(const void* key) {
+  return HashString(*static_cast(key));
 }
 
-bool nsCacheEntryHashTable::MatchEntry(const PLDHashEntryHdr *hashEntry,
-                                       const void *key) {
+bool nsCacheEntryHashTable::MatchEntry(const PLDHashEntryHdr* hashEntry,
+                                       const void* key) {
   NS_ASSERTION(key != nullptr,
                "### nsCacheEntryHashTable::MatchEntry : null key");
-  nsCacheEntry *cacheEntry =
-      ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry;
+  nsCacheEntry* cacheEntry =
+      ((nsCacheEntryHashTableEntry*)hashEntry)->cacheEntry;
 
-  return cacheEntry->mKey.Equals(*(nsCString *)key);
+  return cacheEntry->mKey.Equals(*(nsCString*)key);
 }
 
-void nsCacheEntryHashTable::MoveEntry(PLDHashTable * /* table */,
-                                      const PLDHashEntryHdr *from,
-                                      PLDHashEntryHdr *to) {
+void nsCacheEntryHashTable::MoveEntry(PLDHashTable* /* table */,
+                                      const PLDHashEntryHdr* from,
+                                      PLDHashEntryHdr* to) {
   new (KnownNotNull, to) nsCacheEntryHashTableEntry(
-      std::move(*((nsCacheEntryHashTableEntry *)from)));
+      std::move(*((nsCacheEntryHashTableEntry*)from)));
   // No need to destroy `from`.
 }
 
-void nsCacheEntryHashTable::ClearEntry(PLDHashTable * /* table */,
-                                       PLDHashEntryHdr *hashEntry) {
-  ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry = nullptr;
+void nsCacheEntryHashTable::ClearEntry(PLDHashTable* /* table */,
+                                       PLDHashEntryHdr* hashEntry) {
+  ((nsCacheEntryHashTableEntry*)hashEntry)->cacheEntry = nullptr;
 }
diff --git a/netwerk/cache/nsCacheEntry.h b/netwerk/cache/nsCacheEntry.h
index ac4f766ca718b..04825b2d74dc4 100644
--- a/netwerk/cache/nsCacheEntry.h
+++ b/netwerk/cache/nsCacheEntry.h
@@ -30,15 +30,15 @@ class nsCacheEntryDescriptor;
  *******************************************************************************/
 class nsCacheEntry : public PRCList {
  public:
-  nsCacheEntry(const nsACString &key, bool streamBased,
+  nsCacheEntry(const nsACString& key, bool streamBased,
                nsCacheStoragePolicy storagePolicy);
   ~nsCacheEntry();
 
-  static nsresult Create(const char *key, bool streamBased,
+  static nsresult Create(const char* key, bool streamBased,
                          nsCacheStoragePolicy storagePolicy,
-                         nsCacheDevice *device, nsCacheEntry **result);
+                         nsCacheDevice* device, nsCacheEntry** result);
 
-  nsCString *Key() { return &mKey; }
+  nsCString* Key() { return &mKey; }
 
   int32_t FetchCount() { return mFetchCount; }
   void SetFetchCount(int32_t count) { mFetchCount = count; }
@@ -55,17 +55,17 @@ class nsCacheEntry : public PRCList {
 
   uint32_t Size() { return mDataSize + mMetaData.Size() + mKey.Length(); }
 
-  nsCacheDevice *CacheDevice() { return mCacheDevice; }
-  void SetCacheDevice(nsCacheDevice *device) { mCacheDevice = device; }
-  void SetCustomCacheDevice(nsCacheDevice *device) { mCustomDevice = device; }
-  nsCacheDevice *CustomCacheDevice() { return mCustomDevice; }
-  const char *GetDeviceID();
+  nsCacheDevice* CacheDevice() { return mCacheDevice; }
+  void SetCacheDevice(nsCacheDevice* device) { mCacheDevice = device; }
+  void SetCustomCacheDevice(nsCacheDevice* device) { mCustomDevice = device; }
+  nsCacheDevice* CustomCacheDevice() { return mCustomDevice; }
+  const char* GetDeviceID();
 
   /**
    * Data accessors
    */
-  nsISupports *Data() { return mData; }
-  void SetData(nsISupports *data);
+  nsISupports* Data() { return mData; }
+  void SetData(nsISupports* data);
 
   int64_t PredictedDataSize() { return mPredictedDataSize; }
   void SetPredictedDataSize(int64_t size) { mPredictedDataSize = size; }
@@ -78,19 +78,19 @@ class nsCacheEntry : public PRCList {
   /**
    * Meta data accessors
    */
-  const char *GetMetaDataElement(const char *key) {
+  const char* GetMetaDataElement(const char* key) {
     return mMetaData.GetElement(key);
   }
-  nsresult SetMetaDataElement(const char *key, const char *value) {
+  nsresult SetMetaDataElement(const char* key, const char* value) {
     return mMetaData.SetElement(key, value);
   }
-  nsresult VisitMetaDataElements(nsICacheMetaDataVisitor *visitor) {
+  nsresult VisitMetaDataElements(nsICacheMetaDataVisitor* visitor) {
     return mMetaData.VisitElements(visitor);
   }
-  nsresult FlattenMetaData(char *buffer, uint32_t bufSize) {
+  nsresult FlattenMetaData(char* buffer, uint32_t bufSize) {
     return mMetaData.FlattenMetaData(buffer, bufSize);
   }
-  nsresult UnflattenMetaData(const char *buffer, uint32_t bufSize) {
+  nsresult UnflattenMetaData(const char* buffer, uint32_t bufSize) {
     return mMetaData.UnflattenMetaData(buffer, bufSize);
   }
   uint32_t MetaDataSize() { return mMetaData.Size(); }
@@ -100,8 +100,8 @@ class nsCacheEntry : public PRCList {
   /**
    * Security Info accessors
    */
-  nsISupports *SecurityInfo() { return mSecurityInfo; }
-  void SetSecurityInfo(nsISupports *info) { mSecurityInfo = info; }
+  nsISupports* SecurityInfo() { return mSecurityInfo; }
+  void SetSecurityInfo(nsISupports* info) { mSecurityInfo = info; }
 
   // XXX enumerate MetaData method
 
@@ -178,17 +178,17 @@ class nsCacheEntry : public PRCList {
   }
 
   // methods for nsCacheService
-  nsresult RequestAccess(nsCacheRequest *request,
-                         nsCacheAccessMode *accessGranted);
-  nsresult CreateDescriptor(nsCacheRequest *request,
+  nsresult RequestAccess(nsCacheRequest* request,
+                         nsCacheAccessMode* accessGranted);
+  nsresult CreateDescriptor(nsCacheRequest* request,
                             nsCacheAccessMode accessGranted,
-                            nsICacheEntryDescriptor **result);
+                            nsICacheEntryDescriptor** result);
 
-  bool RemoveRequest(nsCacheRequest *request);
-  bool RemoveDescriptor(nsCacheEntryDescriptor *descriptor, bool *doomEntry);
+  bool RemoveRequest(nsCacheRequest* request);
+  bool RemoveDescriptor(nsCacheEntryDescriptor* descriptor, bool* doomEntry);
 
   void GetDescriptors(
-      nsTArray > &outDescriptors);
+      nsTArray >& outDescriptors);
 
  private:
   friend class nsCacheEntryHashTable;
@@ -212,10 +212,10 @@ class nsCacheEntry : public PRCList {
   uint32_t mFlags;                      // 4
   int64_t mPredictedDataSize;           // Size given by ContentLength.
   uint32_t mDataSize;                   // 4
-  nsCacheDevice *mCacheDevice;          // 4
-  nsCacheDevice *mCustomDevice;         // 4
+  nsCacheDevice* mCacheDevice;          // 4
+  nsCacheDevice* mCustomDevice;         // 4
   nsCOMPtr mSecurityInfo;  //
-  nsISupports *mData;                   // strong ref
+  nsISupports* mData;                   // strong ref
   nsCOMPtr mEventTarget;
   nsCacheMetaData mMetaData;  // 4
   PRCList mRequestQ;          // 8
@@ -230,12 +230,12 @@ class nsCacheEntryInfo : public nsICacheEntryInfo {
   NS_DECL_ISUPPORTS
   NS_DECL_NSICACHEENTRYINFO
 
-  explicit nsCacheEntryInfo(nsCacheEntry *entry) : mCacheEntry(entry) {}
+  explicit nsCacheEntryInfo(nsCacheEntry* entry) : mCacheEntry(entry) {}
 
   void DetachEntry() { mCacheEntry = nullptr; }
 
  private:
-  nsCacheEntry *mCacheEntry;
+  nsCacheEntry* mCacheEntry;
 
   virtual ~nsCacheEntryInfo() = default;
 };
@@ -245,7 +245,7 @@ class nsCacheEntryInfo : public nsICacheEntryInfo {
  *******************************************************************************/
 
 struct nsCacheEntryHashTableEntry : public PLDHashEntryHdr {
-  nsCacheEntry *cacheEntry;
+  nsCacheEntry* cacheEntry;
 };
 
 class nsCacheEntryHashTable {
@@ -256,24 +256,24 @@ class nsCacheEntryHashTable {
   void Init();
   void Shutdown();
 
-  nsCacheEntry *GetEntry(const nsCString *key) const;
-  nsresult AddEntry(nsCacheEntry *entry);
-  void RemoveEntry(nsCacheEntry *entry);
+  nsCacheEntry* GetEntry(const nsCString* key) const;
+  nsresult AddEntry(nsCacheEntry* entry);
+  void RemoveEntry(nsCacheEntry* entry);
 
   PLDHashTable::Iterator Iter();
 
  private:
   // PLDHashTable operation callbacks
-  static PLDHashNumber HashKey(const void *key);
+  static PLDHashNumber HashKey(const void* key);
 
-  static bool MatchEntry(const PLDHashEntryHdr *entry, const void *key);
+  static bool MatchEntry(const PLDHashEntryHdr* entry, const void* key);
 
-  static void MoveEntry(PLDHashTable *table, const PLDHashEntryHdr *from,
-                        PLDHashEntryHdr *to);
+  static void MoveEntry(PLDHashTable* table, const PLDHashEntryHdr* from,
+                        PLDHashEntryHdr* to);
 
-  static void ClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry);
+  static void ClearEntry(PLDHashTable* table, PLDHashEntryHdr* entry);
 
-  static void Finalize(PLDHashTable *table);
+  static void Finalize(PLDHashTable* table);
 
   // member variables
   static const PLDHashTableOps ops;
diff --git a/netwerk/cache/nsCacheEntryDescriptor.cpp b/netwerk/cache/nsCacheEntryDescriptor.cpp
index 4701eeb20a307..e97bd4e603ee9 100644
--- a/netwerk/cache/nsCacheEntryDescriptor.cpp
+++ b/netwerk/cache/nsCacheEntryDescriptor.cpp
@@ -25,8 +25,8 @@
 
 class nsAsyncDoomEvent : public mozilla::Runnable {
  public:
-  nsAsyncDoomEvent(nsCacheEntryDescriptor *descriptor,
-                   nsICacheListener *listener)
+  nsAsyncDoomEvent(nsCacheEntryDescriptor* descriptor,
+                   nsICacheListener* listener)
       : mozilla::Runnable("nsAsyncDoomEvent") {
     mDescriptor = descriptor;
     mListener = listener;
@@ -64,14 +64,14 @@ class nsAsyncDoomEvent : public mozilla::Runnable {
 
  private:
   RefPtr mDescriptor;
-  nsICacheListener *mListener;
+  nsICacheListener* mListener;
   nsCOMPtr mEventTarget;
 };
 
 NS_IMPL_ISUPPORTS(nsCacheEntryDescriptor, nsICacheEntryDescriptor,
                   nsICacheEntryInfo)
 
-nsCacheEntryDescriptor::nsCacheEntryDescriptor(nsCacheEntry *entry,
+nsCacheEntryDescriptor::nsCacheEntryDescriptor(nsCacheEntry* entry,
                                                nsCacheAccessMode accessGranted)
     : mCacheEntry(entry),
       mAccessGranted(accessGranted),
@@ -99,7 +99,7 @@ nsCacheEntryDescriptor::~nsCacheEntryDescriptor() {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetClientID(nsACString &aClientID) {
+nsCacheEntryDescriptor::GetClientID(nsACString& aClientID) {
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETCLIENTID));
   if (!mCacheEntry) {
     aClientID.Truncate();
@@ -110,7 +110,7 @@ nsCacheEntryDescriptor::GetClientID(nsACString &aClientID) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetDeviceID(nsACString &aDeviceID) {
+nsCacheEntryDescriptor::GetDeviceID(nsACString& aDeviceID) {
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETDEVICEID));
   if (!mCacheEntry) {
     aDeviceID.Truncate();
@@ -122,7 +122,7 @@ nsCacheEntryDescriptor::GetDeviceID(nsACString &aDeviceID) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetKey(nsACString &result) {
+nsCacheEntryDescriptor::GetKey(nsACString& result) {
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETKEY));
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
@@ -130,7 +130,7 @@ nsCacheEntryDescriptor::GetKey(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetFetchCount(int32_t *result) {
+nsCacheEntryDescriptor::GetFetchCount(int32_t* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETFETCHCOUNT));
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
@@ -140,7 +140,7 @@ nsCacheEntryDescriptor::GetFetchCount(int32_t *result) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetLastFetched(uint32_t *result) {
+nsCacheEntryDescriptor::GetLastFetched(uint32_t* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETLASTFETCHED));
@@ -151,7 +151,7 @@ nsCacheEntryDescriptor::GetLastFetched(uint32_t *result) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetLastModified(uint32_t *result) {
+nsCacheEntryDescriptor::GetLastModified(uint32_t* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETLASTMODIFIED));
@@ -162,7 +162,7 @@ nsCacheEntryDescriptor::GetLastModified(uint32_t *result) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetExpirationTime(uint32_t *result) {
+nsCacheEntryDescriptor::GetExpirationTime(uint32_t* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETEXPIRATIONTIME));
@@ -183,7 +183,7 @@ nsCacheEntryDescriptor::SetExpirationTime(uint32_t expirationTime) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsCacheEntryDescriptor::IsStreamBased(bool *result) {
+NS_IMETHODIMP nsCacheEntryDescriptor::IsStreamBased(bool* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_ISSTREAMBASED));
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
@@ -192,7 +192,7 @@ NS_IMETHODIMP nsCacheEntryDescriptor::IsStreamBased(bool *result) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsCacheEntryDescriptor::GetPredictedDataSize(int64_t *result) {
+NS_IMETHODIMP nsCacheEntryDescriptor::GetPredictedDataSize(int64_t* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETPREDICTEDDATASIZE));
@@ -212,12 +212,12 @@ NS_IMETHODIMP nsCacheEntryDescriptor::SetPredictedDataSize(
   return NS_OK;
 }
 
-NS_IMETHODIMP nsCacheEntryDescriptor::GetDataSize(uint32_t *result) {
+NS_IMETHODIMP nsCacheEntryDescriptor::GetDataSize(uint32_t* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETDATASIZE));
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
-  const char *val = mCacheEntry->GetMetaDataElement("uncompressed-len");
+  const char* val = mCacheEntry->GetMetaDataElement("uncompressed-len");
   if (!val) {
     *result = mCacheEntry->DataSize();
   } else {
@@ -227,7 +227,7 @@ NS_IMETHODIMP nsCacheEntryDescriptor::GetDataSize(uint32_t *result) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsCacheEntryDescriptor::GetStorageDataSize(uint32_t *result) {
+NS_IMETHODIMP nsCacheEntryDescriptor::GetStorageDataSize(uint32_t* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETSTORAGEDATASIZE));
@@ -280,7 +280,7 @@ nsCacheEntryDescriptor::SetDataSize(uint32_t dataSize) {
 
 NS_IMETHODIMP
 nsCacheEntryDescriptor::OpenInputStream(uint32_t offset,
-                                        nsIInputStream **result) {
+                                        nsIInputStream** result) {
   NS_ENSURE_ARG_POINTER(result);
 
   RefPtr cacheInput;
@@ -298,7 +298,7 @@ nsCacheEntryDescriptor::OpenInputStream(uint32_t offset,
     if (!(mAccessGranted & nsICache::ACCESS_READ))
       return NS_ERROR_CACHE_READ_ACCESS_DENIED;
 
-    const char *val;
+    const char* val;
     val = mCacheEntry->GetMetaDataElement("uncompressed-len");
     if (val) {
       cacheInput = new nsDecompressInputStreamWrapper(this, offset);
@@ -316,7 +316,7 @@ nsCacheEntryDescriptor::OpenInputStream(uint32_t offset,
 
 NS_IMETHODIMP
 nsCacheEntryDescriptor::OpenOutputStream(uint32_t offset,
-                                         nsIOutputStream **result) {
+                                         nsIOutputStream** result) {
   NS_ENSURE_ARG_POINTER(result);
 
   RefPtr cacheOutput;
@@ -335,7 +335,7 @@ nsCacheEntryDescriptor::OpenOutputStream(uint32_t offset,
       return NS_ERROR_CACHE_WRITE_ACCESS_DENIED;
 
     int32_t compressionLevel = nsCacheService::CacheCompressionLevel();
-    const char *val;
+    const char* val;
     val = mCacheEntry->GetMetaDataElement("uncompressed-len");
     if ((compressionLevel > 0) && val) {
       cacheOutput = new nsCompressOutputStreamWrapper(this, offset);
@@ -356,7 +356,7 @@ nsCacheEntryDescriptor::OpenOutputStream(uint32_t offset,
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetCacheElement(nsISupports **result) {
+nsCacheEntryDescriptor::GetCacheElement(nsISupports** result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETCACHEELEMENT));
@@ -368,7 +368,7 @@ nsCacheEntryDescriptor::GetCacheElement(nsISupports **result) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::SetCacheElement(nsISupports *cacheElement) {
+nsCacheEntryDescriptor::SetCacheElement(nsISupports* cacheElement) {
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_SETCACHEELEMENT));
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
@@ -378,14 +378,14 @@ nsCacheEntryDescriptor::SetCacheElement(nsISupports *cacheElement) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetAccessGranted(nsCacheAccessMode *result) {
+nsCacheEntryDescriptor::GetAccessGranted(nsCacheAccessMode* result) {
   NS_ENSURE_ARG_POINTER(result);
   *result = mAccessGranted;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetStoragePolicy(nsCacheStoragePolicy *result) {
+nsCacheEntryDescriptor::GetStoragePolicy(nsCacheStoragePolicy* result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETSTORAGEPOLICY));
@@ -420,7 +420,7 @@ nsCacheEntryDescriptor::SetStoragePolicy(nsCacheStoragePolicy policy) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetFile(nsIFile **result) {
+nsCacheEntryDescriptor::GetFile(nsIFile** result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETFILE));
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
@@ -429,7 +429,7 @@ nsCacheEntryDescriptor::GetFile(nsIFile **result) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetSecurityInfo(nsISupports **result) {
+nsCacheEntryDescriptor::GetSecurityInfo(nsISupports** result) {
   NS_ENSURE_ARG_POINTER(result);
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETSECURITYINFO));
@@ -441,7 +441,7 @@ nsCacheEntryDescriptor::GetSecurityInfo(nsISupports **result) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::SetSecurityInfo(nsISupports *securityInfo) {
+nsCacheEntryDescriptor::SetSecurityInfo(nsISupports* securityInfo) {
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_SETSECURITYINFO));
   if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE;
@@ -469,7 +469,7 @@ nsCacheEntryDescriptor::DoomAndFailPendingRequests(nsresult status) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::AsyncDoom(nsICacheListener *listener) {
+nsCacheEntryDescriptor::AsyncDoom(nsICacheListener* listener) {
   bool asyncDoomPending;
   {
     mozilla::MutexAutoLock lock(mLock);
@@ -547,7 +547,7 @@ nsCacheEntryDescriptor::Close() {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::GetMetaDataElement(const char *key, char **result) {
+nsCacheEntryDescriptor::GetMetaDataElement(const char* key, char** result) {
   NS_ENSURE_ARG_POINTER(key);
   *result = nullptr;
 
@@ -555,7 +555,7 @@ nsCacheEntryDescriptor::GetMetaDataElement(const char *key, char **result) {
       LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_GETMETADATAELEMENT));
   NS_ENSURE_TRUE(mCacheEntry, NS_ERROR_NOT_AVAILABLE);
 
-  const char *value;
+  const char* value;
 
   value = mCacheEntry->GetMetaDataElement(key);
   if (!value) return NS_ERROR_NOT_AVAILABLE;
@@ -566,7 +566,7 @@ nsCacheEntryDescriptor::GetMetaDataElement(const char *key, char **result) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::SetMetaDataElement(const char *key, const char *value) {
+nsCacheEntryDescriptor::SetMetaDataElement(const char* key, const char* value) {
   NS_ENSURE_ARG_POINTER(key);
 
   nsCacheServiceAutoLock lock(
@@ -581,7 +581,7 @@ nsCacheEntryDescriptor::SetMetaDataElement(const char *key, const char *value) {
 }
 
 NS_IMETHODIMP
-nsCacheEntryDescriptor::VisitMetaData(nsICacheMetaDataVisitor *visitor) {
+nsCacheEntryDescriptor::VisitMetaData(nsICacheMetaDataVisitor* visitor) {
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHEENTRYDESCRIPTOR_VISITMETADATA));
   // XXX check callers, we're calling out of module
   NS_ENSURE_ARG_POINTER(visitor);
@@ -652,7 +652,7 @@ nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::LazyInit() {
 
   NS_ENSURE_TRUE(mode & nsICache::ACCESS_READ, NS_ERROR_UNEXPECTED);
 
-  nsCacheEntry *cacheEntry = mDescriptor->CacheEntry();
+  nsCacheEntry* cacheEntry = mDescriptor->CacheEntry();
   if (!cacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
   rv = nsCacheService::OpenInputStreamForEntry(cacheEntry, mode, mStartOffset,
@@ -718,7 +718,7 @@ nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::Close_Locked() {
 }
 
 nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::Available(
-    uint64_t *avail) {
+    uint64_t* avail) {
   mozilla::MutexAutoLock lock(mLock);
 
   nsresult rv = EnsureInit();
@@ -728,14 +728,14 @@ nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::Available(
 }
 
 nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::Read(
-    char *buf, uint32_t count, uint32_t *countRead) {
+    char* buf, uint32_t count, uint32_t* countRead) {
   mozilla::MutexAutoLock lock(mLock);
 
   return Read_Locked(buf, count, countRead);
 }
 
 nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::Read_Locked(
-    char *buf, uint32_t count, uint32_t *countRead) {
+    char* buf, uint32_t count, uint32_t* countRead) {
   nsresult rv = EnsureInit();
   if (NS_SUCCEEDED(rv)) rv = mInput->Read(buf, count, countRead);
 
@@ -748,14 +748,14 @@ nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::Read_Locked(
 }
 
 nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::ReadSegments(
-    nsWriteSegmentFun writer, void *closure, uint32_t count,
-    uint32_t *countRead) {
+    nsWriteSegmentFun writer, void* closure, uint32_t count,
+    uint32_t* countRead) {
   // cache stream not buffered
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult nsCacheEntryDescriptor::nsInputStreamWrapper::IsNonBlocking(
-    bool *result) {
+    bool* result) {
   // cache streams will never return NS_BASE_STREAM_WOULD_BLOCK
   *result = false;
   return NS_OK;
@@ -812,7 +812,7 @@ NS_INTERFACE_MAP_BEGIN(nsCacheEntryDescriptor::nsDecompressInputStreamWrapper)
 NS_INTERFACE_MAP_END
 
 NS_IMETHODIMP nsCacheEntryDescriptor::nsDecompressInputStreamWrapper::Read(
-    char *buf, uint32_t count, uint32_t *countRead) {
+    char* buf, uint32_t count, uint32_t* countRead) {
   mozilla::MutexAutoLock lock(mLock);
 
   int zerr = Z_OK;
@@ -825,7 +825,7 @@ NS_IMETHODIMP nsCacheEntryDescriptor::nsDecompressInputStreamWrapper::Read(
     }
   }
 
-  mZstream.next_out = (Bytef *)buf;
+  mZstream.next_out = (Bytef*)buf;
   mZstream.avail_out = count;
 
   if (mReadBufferLen < count) {
@@ -835,7 +835,7 @@ NS_IMETHODIMP nsCacheEntryDescriptor::nsDecompressInputStreamWrapper::Read(
     // to the request size is not necessary, but helps minimize the
     // number of read requests to the input stream.
     uint32_t newBufLen = std::max(count, (uint32_t)kMinDecompressReadBufLen);
-    mReadBuffer = (unsigned char *)moz_xrealloc(mReadBuffer, newBufLen);
+    mReadBuffer = (unsigned char*)moz_xrealloc(mReadBuffer, newBufLen);
     mReadBufferLen = newBufLen;
     if (!mReadBuffer) {
       mReadBufferLen = 0;
@@ -848,8 +848,8 @@ NS_IMETHODIMP nsCacheEntryDescriptor::nsDecompressInputStreamWrapper::Read(
   while (NS_SUCCEEDED(rv) && zerr == Z_OK && mZstream.avail_out > 0 &&
          count > 0) {
     if (mZstream.avail_in == 0) {
-      rv = nsInputStreamWrapper::Read_Locked(
-          (char *)mReadBuffer, mReadBufferLen, &mZstream.avail_in);
+      rv = nsInputStreamWrapper::Read_Locked((char*)mReadBuffer, mReadBufferLen,
+                                             &mZstream.avail_in);
       if (NS_FAILED(rv) || !mZstream.avail_in) {
         break;
       }
@@ -861,9 +861,9 @@ NS_IMETHODIMP nsCacheEntryDescriptor::nsDecompressInputStreamWrapper::Read(
       // chunks/streams. To allow for this case, re-initialize
       // the inflate stream and continue decompressing from
       // the next byte.
-      Bytef *saveNextIn = mZstream.next_in;
+      Bytef* saveNextIn = mZstream.next_in;
       unsigned int saveAvailIn = mZstream.avail_in;
-      Bytef *saveNextOut = mZstream.next_out;
+      Bytef* saveNextOut = mZstream.next_out;
       unsigned int saveAvailOut = mZstream.avail_out;
       inflateReset(&mZstream);
       mZstream.next_in = saveNextIn;
@@ -983,7 +983,7 @@ nsresult nsCacheEntryDescriptor::nsOutputStreamWrapper::LazyInit() {
 
   NS_ENSURE_TRUE(mode & nsICache::ACCESS_WRITE, NS_ERROR_UNEXPECTED);
 
-  nsCacheEntry *cacheEntry = mDescriptor->CacheEntry();
+  nsCacheEntry* cacheEntry = mDescriptor->CacheEntry();
   if (!cacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
   NS_ASSERTION(mOutput == nullptr, "mOutput set in LazyInit");
@@ -993,7 +993,7 @@ nsresult nsCacheEntryDescriptor::nsOutputStreamWrapper::LazyInit() {
                                                 getter_AddRefs(stream));
   if (NS_FAILED(rv)) return rv;
 
-  nsCacheDevice *device = cacheEntry->CacheDevice();
+  nsCacheDevice* device = cacheEntry->CacheDevice();
   if (device) {
     // the entry has been truncated to mStartOffset bytes, inform device
     int32_t size = cacheEntry->DataSize();
@@ -1083,13 +1083,13 @@ NS_IMETHODIMP nsCacheEntryDescriptor::nsOutputStreamWrapper::Flush() {
 }
 
 NS_IMETHODIMP nsCacheEntryDescriptor::nsOutputStreamWrapper::Write(
-    const char *buf, uint32_t count, uint32_t *result) {
+    const char* buf, uint32_t count, uint32_t* result) {
   mozilla::MutexAutoLock lock(mLock);
   return Write_Locked(buf, count, result);
 }
 
 nsresult nsCacheEntryDescriptor::nsOutputStreamWrapper::Write_Locked(
-    const char *buf, uint32_t count, uint32_t *result) {
+    const char* buf, uint32_t count, uint32_t* result) {
   nsresult rv = EnsureInit();
   if (NS_FAILED(rv)) return rv;
 
@@ -1100,17 +1100,17 @@ nsresult nsCacheEntryDescriptor::nsOutputStreamWrapper::Write_Locked(
 }
 
 NS_IMETHODIMP nsCacheEntryDescriptor::nsOutputStreamWrapper::WriteFrom(
-    nsIInputStream *inStr, uint32_t count, uint32_t *result) {
+    nsIInputStream* inStr, uint32_t count, uint32_t* result) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsCacheEntryDescriptor::nsOutputStreamWrapper::WriteSegments(
-    nsReadSegmentFun reader, void *closure, uint32_t count, uint32_t *result) {
+    nsReadSegmentFun reader, void* closure, uint32_t count, uint32_t* result) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP nsCacheEntryDescriptor::nsOutputStreamWrapper::IsNonBlocking(
-    bool *result) {
+    bool* result) {
   // cache streams will never return NS_BASE_STREAM_WOULD_BLOCK
   *result = false;
   return NS_OK;
@@ -1164,7 +1164,7 @@ NS_INTERFACE_MAP_BEGIN(nsCacheEntryDescriptor::nsCompressOutputStreamWrapper)
 NS_INTERFACE_MAP_END
 
 NS_IMETHODIMP nsCacheEntryDescriptor::nsCompressOutputStreamWrapper::Write(
-    const char *buf, uint32_t count, uint32_t *result) {
+    const char* buf, uint32_t count, uint32_t* result) {
   mozilla::MutexAutoLock lock(mLock);
 
   int zerr = Z_OK;
@@ -1182,7 +1182,7 @@ NS_IMETHODIMP nsCacheEntryDescriptor::nsCompressOutputStreamWrapper::Write(
     // cannot be grown. We use 2x(initial write request) to approximate
     // a stream buffer size proportional to request buffers.
     mWriteBufferLen = std::max(count * 2, (uint32_t)kMinCompressWriteBufLen);
-    mWriteBuffer = (unsigned char *)moz_xmalloc(mWriteBufferLen);
+    mWriteBuffer = (unsigned char*)moz_xmalloc(mWriteBufferLen);
     mZstream.next_out = mWriteBuffer;
     mZstream.avail_out = mWriteBufferLen;
   }
@@ -1190,7 +1190,7 @@ NS_IMETHODIMP nsCacheEntryDescriptor::nsCompressOutputStreamWrapper::Write(
   // Compress (deflate) the requested buffer. Keep going
   // until the entire buffer has been deflated.
   mZstream.avail_in = count;
-  mZstream.next_in = (Bytef *)buf;
+  mZstream.next_in = (Bytef*)buf;
   while (mZstream.avail_in > 0) {
     zerr = deflate(&mZstream, Z_NO_FLUSH);
     if (zerr == Z_STREAM_ERROR) {
@@ -1300,7 +1300,7 @@ nsresult nsCacheEntryDescriptor::nsCompressOutputStreamWrapper::WriteBuffer() {
   uint32_t bytesToWrite = mWriteBufferLen - mZstream.avail_out;
   uint32_t result = 0;
   nsresult rv = nsCacheEntryDescriptor::nsOutputStreamWrapper::Write_Locked(
-      (const char *)mWriteBuffer, bytesToWrite, &result);
+      (const char*)mWriteBuffer, bytesToWrite, &result);
   mZstream.next_out = mWriteBuffer;
   mZstream.avail_out = mWriteBufferLen;
   return rv;
diff --git a/netwerk/cache/nsCacheMetaData.cpp b/netwerk/cache/nsCacheMetaData.cpp
index 0bc076a1ec46d..5ad0b0cd6429c 100644
--- a/netwerk/cache/nsCacheMetaData.cpp
+++ b/netwerk/cache/nsCacheMetaData.cpp
@@ -7,13 +7,13 @@
 #include "nsCacheMetaData.h"
 #include "nsICacheEntryDescriptor.h"
 
-const char *nsCacheMetaData::GetElement(const char *key) {
-  const char *data = mBuffer;
-  const char *limit = mBuffer + mMetaSize;
+const char* nsCacheMetaData::GetElement(const char* key) {
+  const char* data = mBuffer;
+  const char* limit = mBuffer + mMetaSize;
 
   while (data < limit) {
     // Point to the value part
-    const char *value = data + strlen(data) + 1;
+    const char* value = data + strlen(data) + 1;
     MOZ_ASSERT(value < limit, "Cache Metadata corrupted");
     if (strcmp(data, key) == 0) return value;
 
@@ -24,9 +24,9 @@ const char *nsCacheMetaData::GetElement(const char *key) {
   return nullptr;
 }
 
-nsresult nsCacheMetaData::SetElement(const char *key, const char *value) {
+nsresult nsCacheMetaData::SetElement(const char* key, const char* value) {
   const uint32_t keySize = strlen(key) + 1;
-  char *pos = (char *)GetElement(key);
+  char* pos = (char*)GetElement(key);
 
   if (!value) {
     // No value means remove the key/value pair completely, if existing
@@ -75,7 +75,7 @@ nsresult nsCacheMetaData::SetElement(const char *key, const char *value) {
   return NS_OK;
 }
 
-nsresult nsCacheMetaData::FlattenMetaData(char *buffer, uint32_t bufSize) {
+nsresult nsCacheMetaData::FlattenMetaData(char* buffer, uint32_t bufSize) {
   if (mMetaSize > bufSize) {
     NS_ERROR("buffer size too small for meta data.");
     return NS_ERROR_OUT_OF_MEMORY;
@@ -85,7 +85,7 @@ nsresult nsCacheMetaData::FlattenMetaData(char *buffer, uint32_t bufSize) {
   return NS_OK;
 }
 
-nsresult nsCacheMetaData::UnflattenMetaData(const char *data, uint32_t size) {
+nsresult nsCacheMetaData::UnflattenMetaData(const char* data, uint32_t size) {
   if (data && size) {
     // Check if the metadata ends with a zero byte.
     if (data[size - 1] != '\0') {
@@ -112,12 +112,12 @@ nsresult nsCacheMetaData::UnflattenMetaData(const char *data, uint32_t size) {
   return NS_OK;
 }
 
-nsresult nsCacheMetaData::VisitElements(nsICacheMetaDataVisitor *visitor) {
-  const char *data = mBuffer;
-  const char *limit = mBuffer + mMetaSize;
+nsresult nsCacheMetaData::VisitElements(nsICacheMetaDataVisitor* visitor) {
+  const char* data = mBuffer;
+  const char* limit = mBuffer + mMetaSize;
 
   while (data < limit) {
-    const char *key = data;
+    const char* key = data;
     // Skip key part
     data += strlen(data) + 1;
     MOZ_ASSERT(data < limit, "Metadata corrupted");
@@ -134,7 +134,7 @@ nsresult nsCacheMetaData::VisitElements(nsICacheMetaDataVisitor *visitor) {
 
 nsresult nsCacheMetaData::EnsureBuffer(uint32_t bufSize) {
   if (mBufferSize < bufSize) {
-    char *buf = (char *)realloc(mBuffer, bufSize);
+    char* buf = (char*)realloc(mBuffer, bufSize);
     if (!buf) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp
index e00e425666546..2c36c44d08671 100644
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -56,12 +56,12 @@ using namespace mozilla::net;
 
 #define CACHE_COMPRESSION_LEVEL 1
 
-static const char *observerList[] = {
+static const char* observerList[] = {
     "profile-before-change",        "profile-do-change",
     NS_XPCOM_SHUTDOWN_OBSERVER_ID,  "last-pb-context-exited",
     "suspend_process_notification", "resume_process_notification"};
 
-static const char *prefList[] = {
+static const char* prefList[] = {
     OFFLINE_CACHE_ENABLE_PREF,
     OFFLINE_CACHE_CAPACITY_PREF,
     OFFLINE_CACHE_DIR_PREF,
@@ -85,13 +85,13 @@ class nsCacheProfilePrefObserver : public nsIObserver {
 
   nsresult Install();
   void Remove();
-  nsresult ReadPrefs(nsIPrefBranch *branch);
+  nsresult ReadPrefs(nsIPrefBranch* branch);
 
-  nsIFile *DiskCacheParentDirectory() { return mDiskCacheParentDirectory; }
+  nsIFile* DiskCacheParentDirectory() { return mDiskCacheParentDirectory; }
 
   bool OfflineCacheEnabled();
   int32_t OfflineCacheCapacity() { return mOfflineCacheCapacity; }
-  nsIFile *OfflineCacheParentDirectory() {
+  nsIFile* OfflineCacheParentDirectory() {
     return mOfflineCacheParentDirectory;
   }
 
@@ -101,7 +101,7 @@ class nsCacheProfilePrefObserver : public nsIObserver {
     return mSanitizeOnShutdown && mClearCacheOnShutdown;
   }
 
-  void PrefChanged(const char *aPref);
+  void PrefChanged(const char* aPref);
 
  private:
   bool mHaveProfile;
@@ -140,7 +140,7 @@ nsresult nsCacheProfilePrefObserver::Install() {
   if (!observerService) return NS_ERROR_FAILURE;
 
   nsresult rv, rv2 = NS_OK;
-  for (auto &observer : observerList) {
+  for (auto& observer : observerList) {
     rv = observerService->AddObserver(this, observer, false);
     if (NS_FAILED(rv)) rv2 = rv;
   }
@@ -175,7 +175,7 @@ void nsCacheProfilePrefObserver::Remove() {
   // remove Observer Service observers
   nsCOMPtr obs = mozilla::services::GetObserverService();
   if (obs) {
-    for (auto &observer : observerList) {
+    for (auto& observer : observerList) {
       obs->RemoveObserver(this, observer);
     }
   }
@@ -189,8 +189,8 @@ void nsCacheProfilePrefObserver::Remove() {
 }
 
 NS_IMETHODIMP
-nsCacheProfilePrefObserver::Observe(nsISupports *subject, const char *topic,
-                                    const char16_t *data_unicode) {
+nsCacheProfilePrefObserver::Observe(nsISupports* subject, const char* topic,
+                                    const char16_t* data_unicode) {
   NS_ConvertUTF16toUTF8 data(data_unicode);
   CACHE_LOG_INFO(("Observe [topic=%s data=%s]\n", topic, data.get()));
 
@@ -232,7 +232,7 @@ nsCacheProfilePrefObserver::Observe(nsISupports *subject, const char *topic,
   return NS_OK;
 }
 
-void nsCacheProfilePrefObserver::PrefChanged(const char *aPref) {
+void nsCacheProfilePrefObserver::PrefChanged(const char* aPref) {
   // ignore pref changes until we're done switch profiles
   if (!mHaveProfile) return;
   // which preference changed?
@@ -258,7 +258,7 @@ void nsCacheProfilePrefObserver::PrefChanged(const char *aPref) {
   }
 }
 
-nsresult nsCacheProfilePrefObserver::ReadPrefs(nsIPrefBranch *branch) {
+nsresult nsCacheProfilePrefObserver::ReadPrefs(nsIPrefBranch* branch) {
   nsresult rv = NS_OK;
 
   if (!mDiskCacheParentDirectory) {
@@ -337,7 +337,7 @@ nsresult nsCacheProfilePrefObserver::ReadPrefs(nsIPrefBranch *branch) {
   return rv;
 }
 
-nsresult nsCacheService::DispatchToCacheIOThread(nsIRunnable *event) {
+nsresult nsCacheService::DispatchToCacheIOThread(nsIRunnable* event) {
   if (!gService || !gService->mCacheIOThread) return NS_ERROR_NOT_AVAILABLE;
   return gService->mCacheIOThread->Dispatch(event, NS_DISPATCH_NORMAL);
 }
@@ -381,7 +381,7 @@ int32_t nsCacheProfilePrefObserver::CacheCompressionLevel() {
 
 class nsProcessRequestEvent : public Runnable {
  public:
-  explicit nsProcessRequestEvent(nsCacheRequest *aRequest)
+  explicit nsProcessRequestEvent(nsCacheRequest* aRequest)
       : mozilla::Runnable("nsProcessRequestEvent") {
     mRequest = aRequest;
   }
@@ -406,7 +406,7 @@ class nsProcessRequestEvent : public Runnable {
   virtual ~nsProcessRequestEvent() = default;
 
  private:
-  nsCacheRequest *mRequest;
+  nsCacheRequest* mRequest;
 };
 
 /******************************************************************************
@@ -415,8 +415,8 @@ class nsProcessRequestEvent : public Runnable {
 
 class nsDoomEvent : public Runnable {
  public:
-  nsDoomEvent(nsCacheSession *session, const nsACString &key,
-              nsICacheListener *listener)
+  nsDoomEvent(nsCacheSession* session, const nsACString& key,
+              nsICacheListener* listener)
       : mozilla::Runnable("nsDoomEvent") {
     mKey = *session->ClientID();
     mKey.Append(':');
@@ -436,7 +436,7 @@ class nsDoomEvent : public Runnable {
 
     bool foundActive = true;
     nsresult status = NS_ERROR_NOT_AVAILABLE;
-    nsCacheEntry *entry;
+    nsCacheEntry* entry;
     entry = nsCacheService::gService->mActiveEntries.GetEntry(&mKey);
     if (!entry) {
       bool collision = false;
@@ -463,14 +463,14 @@ class nsDoomEvent : public Runnable {
  private:
   nsCString mKey;
   nsCacheStoragePolicy mStoragePolicy;
-  nsICacheListener *mListener;
+  nsICacheListener* mListener;
   nsCOMPtr mEventTarget;
 };
 
 /******************************************************************************
  * nsCacheService
  *****************************************************************************/
-nsCacheService *nsCacheService::gService = nullptr;
+nsCacheService* nsCacheService::gService = nullptr;
 
 NS_IMPL_ISUPPORTS(nsCacheService, nsICacheService, nsICacheServiceInternal)
 
@@ -636,8 +636,8 @@ void nsCacheService::Shutdown() {
   }
 }
 
-nsresult nsCacheService::Create(nsISupports *aOuter, const nsIID &aIID,
-                                void **aResult) {
+nsresult nsCacheService::Create(nsISupports* aOuter, const nsIID& aIID,
+                                void** aResult) {
   nsresult rv;
 
   if (aOuter != nullptr) return NS_ERROR_NO_AGGREGATION;
@@ -651,17 +651,17 @@ nsresult nsCacheService::Create(nsISupports *aOuter, const nsIID &aIID,
 }
 
 NS_IMETHODIMP
-nsCacheService::CreateSession(const char *clientID,
+nsCacheService::CreateSession(const char* clientID,
                               nsCacheStoragePolicy storagePolicy,
-                              bool streamBased, nsICacheSession **result) {
+                              bool streamBased, nsICacheSession** result) {
   *result = nullptr;
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult nsCacheService::CreateSessionInternal(
-    const char *clientID, nsCacheStoragePolicy storagePolicy, bool streamBased,
-    nsICacheSession **result) {
+    const char* clientID, nsCacheStoragePolicy storagePolicy, bool streamBased,
+    nsICacheSession** result) {
   RefPtr session =
       new nsCacheSession(clientID, storagePolicy, streamBased);
   session.forget(result);
@@ -669,7 +669,7 @@ nsresult nsCacheService::CreateSessionInternal(
   return NS_OK;
 }
 
-nsresult nsCacheService::EvictEntriesForSession(nsCacheSession *session) {
+nsresult nsCacheService::EvictEntriesForSession(nsCacheSession* session) {
   NS_ASSERTION(gService, "nsCacheService::gService is null.");
   return gService->EvictEntriesForClient(session->ClientID()->get(),
                                          session->StoragePolicy());
@@ -679,7 +679,7 @@ namespace {
 
 class EvictionNotifierRunnable : public Runnable {
  public:
-  explicit EvictionNotifierRunnable(nsISupports *aSubject)
+  explicit EvictionNotifierRunnable(nsISupports* aSubject)
       : mozilla::Runnable("EvictionNotifierRunnable"), mSubject(aSubject) {}
 
   NS_DECL_NSIRUNNABLE
@@ -701,9 +701,9 @@ EvictionNotifierRunnable::Run() {
 }  // namespace
 
 nsresult nsCacheService::EvictEntriesForClient(
-    const char *clientID, nsCacheStoragePolicy storagePolicy) {
+    const char* clientID, nsCacheStoragePolicy storagePolicy) {
   RefPtr r =
-      new EvictionNotifierRunnable(NS_ISUPPORTS_CAST(nsICacheService *, this));
+      new EvictionNotifierRunnable(NS_ISUPPORTS_CAST(nsICacheService*, this));
   NS_DispatchToMainThread(r);
 
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHESERVICE_EVICTENTRIESFORCLIENT));
@@ -723,7 +723,7 @@ nsresult nsCacheService::EvictEntriesForClient(
 }
 
 nsresult nsCacheService::IsStorageEnabledForPolicy(
-    nsCacheStoragePolicy storagePolicy, bool *result) {
+    nsCacheStoragePolicy storagePolicy, bool* result) {
   if (gService == nullptr) return NS_ERROR_NOT_AVAILABLE;
   nsCacheServiceAutoLock lock(
       LOCK_TELEM(NSCACHESERVICE_ISSTORAGEENABLEDFORPOLICY));
@@ -732,9 +732,9 @@ nsresult nsCacheService::IsStorageEnabledForPolicy(
   return NS_OK;
 }
 
-nsresult nsCacheService::DoomEntry(nsCacheSession *session,
-                                   const nsACString &key,
-                                   nsICacheListener *listener) {
+nsresult nsCacheService::DoomEntry(nsCacheSession* session,
+                                   const nsACString& key,
+                                   nsICacheListener* listener) {
   CACHE_LOG_DEBUG(("Dooming entry for session %p, key %s\n", session,
                    PromiseFlatCString(key).get()));
   if (!gService || !gService->mInitialized) return NS_ERROR_NOT_INITIALIZED;
@@ -752,11 +752,11 @@ bool nsCacheService::IsStorageEnabledForPolicy_Locked(
   return false;
 }
 
-NS_IMETHODIMP nsCacheService::VisitEntries(nsICacheVisitor *visitor) {
+NS_IMETHODIMP nsCacheService::VisitEntries(nsICacheVisitor* visitor) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-nsresult nsCacheService::VisitEntriesInternal(nsICacheVisitor *visitor) {
+nsresult nsCacheService::VisitEntriesInternal(nsICacheVisitor* visitor) {
   NS_ENSURE_ARG_POINTER(visitor);
 
   nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHESERVICE_VISITENTRIES));
@@ -817,7 +817,7 @@ nsresult nsCacheService::EvictEntriesInternal(
 }
 
 NS_IMETHODIMP nsCacheService::GetCacheIOTarget(
-    nsIEventTarget **aCacheIOTarget) {
+    nsIEventTarget** aCacheIOTarget) {
   NS_ENSURE_ARG_POINTER(aCacheIOTarget);
 
   // Because mCacheIOThread can only be changed on the main thread, it can be
@@ -843,7 +843,7 @@ NS_IMETHODIMP nsCacheService::GetCacheIOTarget(
   return rv;
 }
 
-NS_IMETHODIMP nsCacheService::GetLockHeldTime(double *aLockHeldTime) {
+NS_IMETHODIMP nsCacheService::GetLockHeldTime(double* aLockHeldTime) {
   MutexAutoLock lock(mTimeStampLock);
 
   if (mLockAcquiredTimeStamp.IsNull()) {
@@ -859,7 +859,7 @@ NS_IMETHODIMP nsCacheService::GetLockHeldTime(double *aLockHeldTime) {
 /**
  * Internal Methods
  */
-nsresult nsCacheService::GetOfflineDevice(nsOfflineCacheDevice **aDevice) {
+nsresult nsCacheService::GetOfflineDevice(nsOfflineCacheDevice** aDevice) {
   if (!mOfflineDevice) {
     nsresult rv = CreateOfflineDevice();
     NS_ENSURE_SUCCESS(rv, rv);
@@ -870,7 +870,7 @@ nsresult nsCacheService::GetOfflineDevice(nsOfflineCacheDevice **aDevice) {
 }
 
 nsresult nsCacheService::GetCustomOfflineDevice(
-    nsIFile *aProfileDir, int32_t aQuota, nsOfflineCacheDevice **aDevice) {
+    nsIFile* aProfileDir, int32_t aQuota, nsOfflineCacheDevice** aDevice) {
   nsresult rv;
 
   nsAutoString profilePath;
@@ -905,7 +905,7 @@ nsresult nsCacheService::CreateOfflineDevice() {
 }
 
 nsresult nsCacheService::CreateCustomOfflineDevice(
-    nsIFile *aProfileDir, int32_t aQuota, nsOfflineCacheDevice **aDevice) {
+    nsIFile* aProfileDir, int32_t aQuota, nsOfflineCacheDevice** aDevice) {
   NS_ENSURE_ARG(aProfileDir);
 
   if (MOZ_LOG_TEST(gCacheLog, LogLevel::Info)) {
@@ -936,7 +936,7 @@ nsresult nsCacheService::CreateCustomOfflineDevice(
 }
 
 nsresult nsCacheService::RemoveCustomOfflineDevice(
-    nsOfflineCacheDevice *aDevice) {
+    nsOfflineCacheDevice* aDevice) {
   nsCOMPtr profileDir = aDevice->BaseDirectory();
   if (!profileDir) return NS_ERROR_UNEXPECTED;
 
@@ -948,12 +948,12 @@ nsresult nsCacheService::RemoveCustomOfflineDevice(
   return NS_OK;
 }
 
-nsresult nsCacheService::CreateRequest(nsCacheSession *session,
-                                       const nsACString &clientKey,
+nsresult nsCacheService::CreateRequest(nsCacheSession* session,
+                                       const nsACString& clientKey,
                                        nsCacheAccessMode accessRequested,
                                        bool blockingMode,
-                                       nsICacheListener *listener,
-                                       nsCacheRequest **request) {
+                                       nsICacheListener* listener,
+                                       nsCacheRequest** request) {
   NS_ASSERTION(request, "CreateRequest: request is null");
 
   nsAutoCString key(*session->ClientID());
@@ -976,8 +976,8 @@ nsresult nsCacheService::CreateRequest(nsCacheSession *session,
 
 class nsCacheListenerEvent : public Runnable {
  public:
-  nsCacheListenerEvent(nsICacheListener *listener,
-                       nsICacheEntryDescriptor *descriptor,
+  nsCacheListenerEvent(nsICacheListener* listener,
+                       nsICacheEntryDescriptor* descriptor,
                        nsCacheAccessMode accessGranted, nsresult status)
       : mozilla::Runnable("nsCacheListenerEvent"),
         mListener(listener)  // transfers reference
@@ -1000,20 +1000,20 @@ class nsCacheListenerEvent : public Runnable {
   // because otherwise we cannot guarantee that they are destroyed on
   // the right thread.
 
-  nsICacheListener *mListener;
-  nsICacheEntryDescriptor *mDescriptor;
+  nsICacheListener* mListener;
+  nsICacheEntryDescriptor* mDescriptor;
   nsCacheAccessMode mAccessGranted;
   nsresult mStatus;
 };
 
-nsresult nsCacheService::NotifyListener(nsCacheRequest *request,
-                                        nsICacheEntryDescriptor *descriptor,
+nsresult nsCacheService::NotifyListener(nsCacheRequest* request,
+                                        nsICacheEntryDescriptor* descriptor,
                                         nsCacheAccessMode accessGranted,
                                         nsresult status) {
   NS_ASSERTION(request->mEventTarget, "no thread set in async request!");
 
   // Swap ownership, and release listener on target thread...
-  nsICacheListener *listener = request->mListener;
+  nsICacheListener* listener = request->mListener;
   request->mListener = nullptr;
 
   nsCOMPtr ev =
@@ -1028,13 +1028,13 @@ nsresult nsCacheService::NotifyListener(nsCacheRequest *request,
   return request->mEventTarget->Dispatch(ev, NS_DISPATCH_NORMAL);
 }
 
-nsresult nsCacheService::ProcessRequest(nsCacheRequest *request,
+nsresult nsCacheService::ProcessRequest(nsCacheRequest* request,
                                         bool calledFromOpenCacheEntry,
-                                        nsICacheEntryDescriptor **result) {
+                                        nsICacheEntryDescriptor** result) {
   // !!! must be called with mLock held !!!
   nsresult rv;
-  nsCacheEntry *entry = nullptr;
-  nsCacheEntry *doomedEntry = nullptr;
+  nsCacheEntry* entry = nullptr;
+  nsCacheEntry* doomedEntry = nullptr;
   nsCacheAccessMode accessGranted = nsICache::ACCESS_NONE;
   if (result) *result = nullptr;
 
@@ -1088,7 +1088,7 @@ nsresult nsCacheService::ProcessRequest(nsCacheRequest *request,
     }
   }
 
-  nsICacheEntryDescriptor *descriptor = nullptr;
+  nsICacheEntryDescriptor* descriptor = nullptr;
 
   if (NS_SUCCEEDED(rv))
     rv = entry->CreateDescriptor(request, accessGranted, &descriptor);
@@ -1126,12 +1126,12 @@ nsresult nsCacheService::ProcessRequest(nsCacheRequest *request,
   return rv;
 }
 
-nsresult nsCacheService::OpenCacheEntry(nsCacheSession *session,
-                                        const nsACString &key,
+nsresult nsCacheService::OpenCacheEntry(nsCacheSession* session,
+                                        const nsACString& key,
                                         nsCacheAccessMode accessRequested,
                                         bool blockingMode,
-                                        nsICacheListener *listener,
-                                        nsICacheEntryDescriptor **result) {
+                                        nsICacheListener* listener,
+                                        nsICacheEntryDescriptor** result) {
   CACHE_LOG_DEBUG(
       ("Opening entry for session %p, key %s, mode %d, blocking %d\n", session,
        PromiseFlatCString(key).get(), accessRequested, blockingMode));
@@ -1139,7 +1139,7 @@ nsresult nsCacheService::OpenCacheEntry(nsCacheSession *session,
 
   if (!gService || !gService->mInitialized) return NS_ERROR_NOT_INITIALIZED;
 
-  nsCacheRequest *request = nullptr;
+  nsCacheRequest* request = nullptr;
 
   nsresult rv = gService->CreateRequest(session, key, accessRequested,
                                         blockingMode, listener, &request);
@@ -1168,9 +1168,9 @@ nsresult nsCacheService::OpenCacheEntry(nsCacheSession *session,
   return rv;
 }
 
-nsresult nsCacheService::ActivateEntry(nsCacheRequest *request,
-                                       nsCacheEntry **result,
-                                       nsCacheEntry **doomedEntry) {
+nsresult nsCacheService::ActivateEntry(nsCacheRequest* request,
+                                       nsCacheEntry** result,
+                                       nsCacheEntry** doomedEntry) {
   CACHE_LOG_DEBUG(("Activate entry for request %p\n", request));
   if (!mInitialized || mClearingEntries) return NS_ERROR_NOT_AVAILABLE;
 
@@ -1187,7 +1187,7 @@ nsresult nsCacheService::ActivateEntry(nsCacheRequest *request,
     return NS_ERROR_FAILURE;
 
   // search active entries (including those not bound to device)
-  nsCacheEntry *entry = mActiveEntries.GetEntry(&(request->mKey));
+  nsCacheEntry* entry = mActiveEntries.GetEntry(&(request->mKey));
   CACHE_LOG_DEBUG(("Active entry for request %p is %p\n", request, entry));
 
   if (!entry) {
@@ -1264,11 +1264,11 @@ nsresult nsCacheService::ActivateEntry(nsCacheRequest *request,
   return rv;
 }
 
-nsCacheEntry *nsCacheService::SearchCacheDevices(nsCString *key,
+nsCacheEntry* nsCacheService::SearchCacheDevices(nsCString* key,
                                                  nsCacheStoragePolicy policy,
-                                                 bool *collision) {
+                                                 bool* collision) {
   Telemetry::AutoTimer timer;
-  nsCacheEntry *entry = nullptr;
+  nsCacheEntry* entry = nullptr;
 
   *collision = false;
   if (policy == nsICache::STORE_OFFLINE ||
@@ -1286,8 +1286,8 @@ nsCacheEntry *nsCacheService::SearchCacheDevices(nsCString *key,
   return entry;
 }
 
-nsCacheDevice *nsCacheService::EnsureEntryHasDevice(nsCacheEntry *entry) {
-  nsCacheDevice *device = entry->CacheDevice();
+nsCacheDevice* nsCacheService::EnsureEntryHasDevice(nsCacheEntry* entry) {
+  nsCacheDevice* device = entry->CacheDevice();
   // return device if found, possibly null if the entry is doomed i.e prevent
   // doomed entries to bind to a device (see e.g. bugs #548406 and #596443)
   if (device || entry->IsDoomed()) return device;
@@ -1314,11 +1314,11 @@ nsCacheDevice *nsCacheService::EnsureEntryHasDevice(nsCacheEntry *entry) {
   return device;
 }
 
-nsresult nsCacheService::DoomEntry(nsCacheEntry *entry) {
+nsresult nsCacheService::DoomEntry(nsCacheEntry* entry) {
   return gService->DoomEntry_Internal(entry, true);
 }
 
-nsresult nsCacheService::DoomEntry_Internal(nsCacheEntry *entry,
+nsresult nsCacheService::DoomEntry_Internal(nsCacheEntry* entry,
                                             bool doProcessPendingRequests) {
   if (entry->IsDoomed()) return NS_OK;
 
@@ -1327,7 +1327,7 @@ nsresult nsCacheService::DoomEntry_Internal(nsCacheEntry *entry,
   entry->MarkDoomed();
 
   NS_ASSERTION(!entry->IsBinding(), "Dooming entry while binding device.");
-  nsCacheDevice *device = entry->CacheDevice();
+  nsCacheDevice* device = entry->CacheDevice();
   if (device) device->DoomEntry(entry);
 
   if (entry->IsActive()) {
@@ -1441,9 +1441,9 @@ void nsCacheService::SetOfflineCacheCapacity(int32_t capacity) {
 /******************************************************************************
  * static methods for nsCacheEntryDescriptor
  *****************************************************************************/
-void nsCacheService::CloseDescriptor(nsCacheEntryDescriptor *descriptor) {
+void nsCacheService::CloseDescriptor(nsCacheEntryDescriptor* descriptor) {
   // ask entry to remove descriptor
-  nsCacheEntry *entry = descriptor->CacheEntry();
+  nsCacheEntry* entry = descriptor->CacheEntry();
   bool doomEntry;
   bool stillActive = entry->RemoveDescriptor(descriptor, &doomEntry);
 
@@ -1461,37 +1461,37 @@ void nsCacheService::CloseDescriptor(nsCacheEntryDescriptor *descriptor) {
   }
 }
 
-nsresult nsCacheService::GetFileForEntry(nsCacheEntry *entry,
-                                         nsIFile **result) {
-  nsCacheDevice *device = gService->EnsureEntryHasDevice(entry);
+nsresult nsCacheService::GetFileForEntry(nsCacheEntry* entry,
+                                         nsIFile** result) {
+  nsCacheDevice* device = gService->EnsureEntryHasDevice(entry);
   if (!device) return NS_ERROR_UNEXPECTED;
 
   return device->GetFileForEntry(entry, result);
 }
 
-nsresult nsCacheService::OpenInputStreamForEntry(nsCacheEntry *entry,
+nsresult nsCacheService::OpenInputStreamForEntry(nsCacheEntry* entry,
                                                  nsCacheAccessMode mode,
                                                  uint32_t offset,
-                                                 nsIInputStream **result) {
-  nsCacheDevice *device = gService->EnsureEntryHasDevice(entry);
+                                                 nsIInputStream** result) {
+  nsCacheDevice* device = gService->EnsureEntryHasDevice(entry);
   if (!device) return NS_ERROR_UNEXPECTED;
 
   return device->OpenInputStreamForEntry(entry, mode, offset, result);
 }
 
-nsresult nsCacheService::OpenOutputStreamForEntry(nsCacheEntry *entry,
+nsresult nsCacheService::OpenOutputStreamForEntry(nsCacheEntry* entry,
                                                   nsCacheAccessMode mode,
                                                   uint32_t offset,
-                                                  nsIOutputStream **result) {
-  nsCacheDevice *device = gService->EnsureEntryHasDevice(entry);
+                                                  nsIOutputStream** result) {
+  nsCacheDevice* device = gService->EnsureEntryHasDevice(entry);
   if (!device) return NS_ERROR_UNEXPECTED;
 
   return device->OpenOutputStreamForEntry(entry, mode, offset, result);
 }
 
-nsresult nsCacheService::OnDataSizeChange(nsCacheEntry *entry,
+nsresult nsCacheService::OnDataSizeChange(nsCacheEntry* entry,
                                           int32_t deltaSize) {
-  nsCacheDevice *device = gService->EnsureEntryHasDevice(entry);
+  nsCacheDevice* device = gService->EnsureEntryHasDevice(entry);
   if (!device) return NS_ERROR_UNEXPECTED;
 
   return device->OnDataSizeChange(entry, deltaSize);
@@ -1541,7 +1541,7 @@ void nsCacheService::Lock(mozilla::Telemetry::HistogramID mainThreadLockerID) {
 void nsCacheService::Unlock() {
   gService->mLock.AssertCurrentThreadOwns();
 
-  nsTArray doomed;
+  nsTArray doomed;
   doomed.SwapElements(gService->mDoomedObjects);
 
   gService->LockReleased();
@@ -1550,8 +1550,8 @@ void nsCacheService::Unlock() {
   for (uint32_t i = 0; i < doomed.Length(); ++i) doomed[i]->Release();
 }
 
-void nsCacheService::ReleaseObject_Locked(nsISupports *obj,
-                                          nsIEventTarget *target) {
+void nsCacheService::ReleaseObject_Locked(nsISupports* obj,
+                                          nsIEventTarget* target) {
   gService->mLock.AssertCurrentThreadOwns();
 
   bool isCur;
@@ -1563,15 +1563,15 @@ void nsCacheService::ReleaseObject_Locked(nsISupports *obj,
   }
 }
 
-nsresult nsCacheService::SetCacheElement(nsCacheEntry *entry,
-                                         nsISupports *element) {
+nsresult nsCacheService::SetCacheElement(nsCacheEntry* entry,
+                                         nsISupports* element) {
   entry->SetData(element);
   entry->TouchData();
   return NS_OK;
 }
 
-nsresult nsCacheService::ValidateEntry(nsCacheEntry *entry) {
-  nsCacheDevice *device = gService->EnsureEntryHasDevice(entry);
+nsresult nsCacheService::ValidateEntry(nsCacheEntry* entry) {
+  nsCacheDevice* device = gService->EnsureEntryHasDevice(entry);
   if (!device) return NS_ERROR_UNEXPECTED;
 
   entry->MarkValid();
@@ -1587,11 +1587,11 @@ int32_t nsCacheService::CacheCompressionLevel() {
   return level;
 }
 
-void nsCacheService::DeactivateEntry(nsCacheEntry *entry) {
+void nsCacheService::DeactivateEntry(nsCacheEntry* entry) {
   CACHE_LOG_DEBUG(("Deactivating entry %p\n", entry));
   nsresult rv = NS_OK;
   NS_ASSERTION(entry->IsNotInUse(), "### deactivating an entry while in use!");
-  nsCacheDevice *device = nullptr;
+  nsCacheDevice* device = nullptr;
 
   if (mMaxDataSize < entry->DataSize()) mMaxDataSize = entry->DataSize();
   if (mMaxMetaSize < entry->MetaDataSize())
@@ -1637,10 +1637,10 @@ void nsCacheService::DeactivateEntry(nsCacheEntry *entry) {
   }
 }
 
-nsresult nsCacheService::ProcessPendingRequests(nsCacheEntry *entry) {
+nsresult nsCacheService::ProcessPendingRequests(nsCacheEntry* entry) {
   nsresult rv = NS_OK;
-  nsCacheRequest *request = (nsCacheRequest *)PR_LIST_HEAD(&entry->mRequestQ);
-  nsCacheRequest *nextRequest;
+  nsCacheRequest* request = (nsCacheRequest*)PR_LIST_HEAD(&entry->mRequestQ);
+  nsCacheRequest* nextRequest;
   bool newWriter = false;
 
   CACHE_LOG_DEBUG((
@@ -1660,9 +1660,9 @@ nsresult nsCacheService::ProcessPendingRequests(nsCacheEntry *entry) {
     while (request != &entry->mRequestQ) {
       NS_ASSERTION(request->AccessRequested() != nsICache::ACCESS_WRITE,
                    "ACCESS_WRITE request should have been given a new entry");
-      request = (nsCacheRequest *)PR_NEXT_LINK(request);
+      request = (nsCacheRequest*)PR_NEXT_LINK(request);
     }
-    request = (nsCacheRequest *)PR_LIST_HEAD(&entry->mRequestQ);
+    request = (nsCacheRequest*)PR_LIST_HEAD(&entry->mRequestQ);
 #endif
     // find first request with ACCESS_READ_WRITE (if any) and promote it to 1st
     // writer
@@ -1673,12 +1673,12 @@ nsresult nsCacheService::ProcessPendingRequests(nsCacheEntry *entry) {
         break;
       }
 
-      request = (nsCacheRequest *)PR_NEXT_LINK(request);
+      request = (nsCacheRequest*)PR_NEXT_LINK(request);
     }
 
     if (request == &entry->mRequestQ)  // no requests asked for
                                        // ACCESS_READ_WRITE, back to top
-      request = (nsCacheRequest *)PR_LIST_HEAD(&entry->mRequestQ);
+      request = (nsCacheRequest*)PR_LIST_HEAD(&entry->mRequestQ);
 
     // XXX what should we do if there are only READ requests in queue?
     // XXX serialize their accesses, give them only read access, but force them
@@ -1690,7 +1690,7 @@ nsresult nsCacheService::ProcessPendingRequests(nsCacheEntry *entry) {
   nsCacheAccessMode accessGranted = nsICache::ACCESS_NONE;
 
   while (request != &entry->mRequestQ) {
-    nextRequest = (nsCacheRequest *)PR_NEXT_LINK(request);
+    nextRequest = (nsCacheRequest*)PR_NEXT_LINK(request);
     CACHE_LOG_DEBUG(("  %sync request %p for %p\n",
                      (request->mListener ? "As" : "S"), request, entry));
 
@@ -1718,7 +1718,7 @@ nsresult nsCacheService::ProcessPendingRequests(nsCacheEntry *entry) {
         //     }
 
         // entry->CreateDescriptor dequeues request, and queues descriptor
-        nsICacheEntryDescriptor *descriptor = nullptr;
+        nsICacheEntryDescriptor* descriptor = nullptr;
         rv = entry->CreateDescriptor(request, accessGranted, &descriptor);
 
         // post call to listener to report error or descriptor
@@ -1750,15 +1750,15 @@ nsresult nsCacheService::ProcessPendingRequests(nsCacheEntry *entry) {
 }
 
 bool nsCacheService::IsDoomListEmpty() {
-  nsCacheEntry *entry = (nsCacheEntry *)PR_LIST_HEAD(&mDoomedEntries);
+  nsCacheEntry* entry = (nsCacheEntry*)PR_LIST_HEAD(&mDoomedEntries);
   return &mDoomedEntries == entry;
 }
 
 void nsCacheService::ClearDoomList() {
-  nsCacheEntry *entry = (nsCacheEntry *)PR_LIST_HEAD(&mDoomedEntries);
+  nsCacheEntry* entry = (nsCacheEntry*)PR_LIST_HEAD(&mDoomedEntries);
 
   while (entry != &mDoomedEntries) {
-    nsCacheEntry *next = (nsCacheEntry *)PR_NEXT_LINK(entry);
+    nsCacheEntry* next = (nsCacheEntry*)PR_NEXT_LINK(entry);
 
     entry->DetachDescriptors();
     DeactivateEntry(entry);
@@ -1767,11 +1767,11 @@ void nsCacheService::ClearDoomList() {
 }
 
 void nsCacheService::DoomActiveEntries(DoomCheckFn check) {
-  AutoTArray array;
+  AutoTArray array;
 
   for (auto iter = mActiveEntries.Iter(); !iter.Done(); iter.Next()) {
-    nsCacheEntry *entry =
-        static_cast(iter.Get())->cacheEntry;
+    nsCacheEntry* entry =
+        static_cast(iter.Get())->cacheEntry;
 
     if (check && !check(entry)) {
       continue;
@@ -1797,21 +1797,21 @@ void nsCacheService::CloseAllStreams() {
   {
     nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHESERVICE_CLOSEALLSTREAMS));
 
-    nsTArray entries;
+    nsTArray entries;
 
 #if DEBUG
     // make sure there is no active entry
     for (auto iter = mActiveEntries.Iter(); !iter.Done(); iter.Next()) {
-      auto entry = static_cast(iter.Get());
+      auto entry = static_cast(iter.Get());
       entries.AppendElement(entry->cacheEntry);
     }
     NS_ASSERTION(entries.IsEmpty(), "Bad state");
 #endif
 
     // Get doomed entries
-    nsCacheEntry *entry = (nsCacheEntry *)PR_LIST_HEAD(&mDoomedEntries);
+    nsCacheEntry* entry = (nsCacheEntry*)PR_LIST_HEAD(&mDoomedEntries);
     while (entry != &mDoomedEntries) {
-      nsCacheEntry *next = (nsCacheEntry *)PR_NEXT_LINK(entry);
+      nsCacheEntry* next = (nsCacheEntry*)PR_NEXT_LINK(entry);
       entries.AppendElement(entry);
       entry = next;
     }
@@ -1845,7 +1845,7 @@ bool nsCacheService::GetClearingEntries() {
 }
 
 // static
-void nsCacheService::GetCacheBaseDirectoty(nsIFile **result) {
+void nsCacheService::GetCacheBaseDirectoty(nsIFile** result) {
   *result = nullptr;
   if (!gService || !gService->mObserver) return;
 
@@ -1856,7 +1856,7 @@ void nsCacheService::GetCacheBaseDirectoty(nsIFile **result) {
 }
 
 // static
-void nsCacheService::GetDiskCacheDirectory(nsIFile **result) {
+void nsCacheService::GetDiskCacheDirectory(nsIFile** result) {
   nsCOMPtr directory;
   GetCacheBaseDirectoty(getter_AddRefs(directory));
   if (!directory) return;
@@ -1868,7 +1868,7 @@ void nsCacheService::GetDiskCacheDirectory(nsIFile **result) {
 }
 
 // static
-void nsCacheService::GetAppCacheDirectory(nsIFile **result) {
+void nsCacheService::GetAppCacheDirectory(nsIFile** result) {
   nsCOMPtr directory;
   GetCacheBaseDirectoty(getter_AddRefs(directory));
   if (!directory) return;
@@ -1900,9 +1900,9 @@ void nsCacheService::LogCacheStatistics() {
       ("    Deactivated Unbound Entries = %d\n", mDeactivatedUnboundEntries));
 }
 
-void nsCacheService::MoveOrRemoveDiskCache(nsIFile *aOldCacheDir,
-                                           nsIFile *aNewCacheDir,
-                                           const char *aCacheSubdir) {
+void nsCacheService::MoveOrRemoveDiskCache(nsIFile* aOldCacheDir,
+                                           nsIFile* aNewCacheDir,
+                                           const char* aCacheSubdir) {
   bool same;
   if (NS_FAILED(aOldCacheDir->Equals(aNewCacheDir, &same)) || same) return;
 
@@ -1946,7 +1946,7 @@ void nsCacheService::MoveOrRemoveDiskCache(nsIFile *aOldCacheDir,
   nsDeleteDir::DeleteDir(aOldCacheSubdir, false, 60000);
 }
 
-static bool IsEntryPrivate(nsCacheEntry *entry) { return entry->IsPrivate(); }
+static bool IsEntryPrivate(nsCacheEntry* entry) { return entry->IsPrivate(); }
 
 void nsCacheService::LeavePrivateBrowsing() {
   nsCacheServiceAutoLock lock;
diff --git a/netwerk/cache/nsCacheService.h b/netwerk/cache/nsCacheService.h
index 419658738fd4c..27565a218f88d 100644
--- a/netwerk/cache/nsCacheService.h
+++ b/netwerk/cache/nsCacheService.h
@@ -36,7 +36,7 @@ class mozIStorageService;
 
 class nsNotifyDoomListener : public mozilla::Runnable {
  public:
-  nsNotifyDoomListener(nsICacheListener *listener, nsresult status)
+  nsNotifyDoomListener(nsICacheListener* listener, nsresult status)
       : mozilla::Runnable("nsNotifyDoomListener"),
         mListener(listener)  // transfers reference
         ,
@@ -49,7 +49,7 @@ class nsNotifyDoomListener : public mozilla::Runnable {
   }
 
  private:
-  nsICacheListener *mListener;
+  nsICacheListener* mListener;
   nsresult mStatus;
 };
 
@@ -68,63 +68,63 @@ class nsCacheService final : public nsICacheServiceInternal {
   nsCacheService();
 
   // Define a Create method to be used with a factory:
-  static nsresult Create(nsISupports *outer, const nsIID &iid, void **result);
+  static nsresult Create(nsISupports* outer, const nsIID& iid, void** result);
 
   /**
    * Methods called by nsCacheSession
    */
-  static nsresult OpenCacheEntry(nsCacheSession *session, const nsACString &key,
+  static nsresult OpenCacheEntry(nsCacheSession* session, const nsACString& key,
                                  nsCacheAccessMode accessRequested,
-                                 bool blockingMode, nsICacheListener *listener,
-                                 nsICacheEntryDescriptor **result);
+                                 bool blockingMode, nsICacheListener* listener,
+                                 nsICacheEntryDescriptor** result);
 
-  static nsresult EvictEntriesForSession(nsCacheSession *session);
+  static nsresult EvictEntriesForSession(nsCacheSession* session);
 
   static nsresult IsStorageEnabledForPolicy(nsCacheStoragePolicy storagePolicy,
-                                            bool *result);
+                                            bool* result);
 
-  static nsresult DoomEntry(nsCacheSession *session, const nsACString &key,
-                            nsICacheListener *listener);
+  static nsresult DoomEntry(nsCacheSession* session, const nsACString& key,
+                            nsICacheListener* listener);
 
   /**
    * Methods called by nsCacheEntryDescriptor
    */
 
-  static void CloseDescriptor(nsCacheEntryDescriptor *descriptor);
+  static void CloseDescriptor(nsCacheEntryDescriptor* descriptor);
 
-  static nsresult GetFileForEntry(nsCacheEntry *entry, nsIFile **result);
+  static nsresult GetFileForEntry(nsCacheEntry* entry, nsIFile** result);
 
-  static nsresult OpenInputStreamForEntry(nsCacheEntry *entry,
+  static nsresult OpenInputStreamForEntry(nsCacheEntry* entry,
                                           nsCacheAccessMode mode,
                                           uint32_t offset,
-                                          nsIInputStream **result);
+                                          nsIInputStream** result);
 
-  static nsresult OpenOutputStreamForEntry(nsCacheEntry *entry,
+  static nsresult OpenOutputStreamForEntry(nsCacheEntry* entry,
                                            nsCacheAccessMode mode,
                                            uint32_t offset,
-                                           nsIOutputStream **result);
+                                           nsIOutputStream** result);
 
-  static nsresult OnDataSizeChange(nsCacheEntry *entry, int32_t deltaSize);
+  static nsresult OnDataSizeChange(nsCacheEntry* entry, int32_t deltaSize);
 
-  static nsresult SetCacheElement(nsCacheEntry *entry, nsISupports *element);
+  static nsresult SetCacheElement(nsCacheEntry* entry, nsISupports* element);
 
-  static nsresult ValidateEntry(nsCacheEntry *entry);
+  static nsresult ValidateEntry(nsCacheEntry* entry);
 
   static int32_t CacheCompressionLevel();
 
   static bool GetClearingEntries();
 
-  static void GetCacheBaseDirectoty(nsIFile **result);
-  static void GetDiskCacheDirectory(nsIFile **result);
-  static void GetAppCacheDirectory(nsIFile **result);
+  static void GetCacheBaseDirectoty(nsIFile** result);
+  static void GetDiskCacheDirectory(nsIFile** result);
+  static void GetAppCacheDirectory(nsIFile** result);
 
   /**
    * Methods called by any cache classes
    */
 
-  static nsCacheService *GlobalInstance() { return gService; }
+  static nsCacheService* GlobalInstance() { return gService; }
 
-  static nsresult DoomEntry(nsCacheEntry *entry);
+  static nsresult DoomEntry(nsCacheEntry* entry);
 
   static bool IsStorageEnabledForPolicy_Locked(nsCacheStoragePolicy policy);
 
@@ -132,25 +132,25 @@ class nsCacheService final : public nsICacheServiceInternal {
    * Methods called by nsApplicationCacheService
    */
 
-  nsresult GetOfflineDevice(nsOfflineCacheDevice **aDevice);
+  nsresult GetOfflineDevice(nsOfflineCacheDevice** aDevice);
 
   /**
    * Creates an offline cache device that works over a specific profile
    * directory. A tool to preload offline cache for profiles different from the
    * current application's profile directory.
    */
-  nsresult GetCustomOfflineDevice(nsIFile *aProfileDir, int32_t aQuota,
-                                  nsOfflineCacheDevice **aDevice);
+  nsresult GetCustomOfflineDevice(nsIFile* aProfileDir, int32_t aQuota,
+                                  nsOfflineCacheDevice** aDevice);
 
   // This method may be called to release an object while the cache service
   // lock is being held.  If a non-null target is specified and the target
   // does not correspond to the current thread, then the release will be
   // proxied to the specified target.  Otherwise, the object will be added to
   // the list of objects to be released when the cache service is unlocked.
-  static void ReleaseObject_Locked(nsISupports *object,
-                                   nsIEventTarget *target = nullptr);
+  static void ReleaseObject_Locked(nsISupports* object,
+                                   nsIEventTarget* target = nullptr);
 
-  static nsresult DispatchToCacheIOThread(nsIRunnable *event);
+  static nsresult DispatchToCacheIOThread(nsIRunnable* event);
 
   // Calling this method will block the calling thread until all pending
   // events on the cache-io thread has finished. The calling thread must
@@ -167,9 +167,9 @@ class nsCacheService final : public nsICacheServiceInternal {
   // Sets the offline cache capacity (in kilobytes)
   static void SetOfflineCacheCapacity(int32_t capacity);
 
-  static void MoveOrRemoveDiskCache(nsIFile *aOldCacheDir,
-                                    nsIFile *aNewCacheDir,
-                                    const char *aCacheSubdir);
+  static void MoveOrRemoveDiskCache(nsIFile* aOldCacheDir,
+                                    nsIFile* aNewCacheDir,
+                                    const char* aCacheSubdir);
 
   nsresult Init();
   void Shutdown();
@@ -186,13 +186,13 @@ class nsCacheService final : public nsICacheServiceInternal {
   static void LeavePrivateBrowsing();
   bool IsDoomListEmpty();
 
-  typedef bool (*DoomCheckFn)(nsCacheEntry *entry);
+  typedef bool (*DoomCheckFn)(nsCacheEntry* entry);
 
   // Accessors to the disabled functionality
-  nsresult CreateSessionInternal(const char *clientID,
+  nsresult CreateSessionInternal(const char* clientID,
                                  nsCacheStoragePolicy storagePolicy,
-                                 bool streamBased, nsICacheSession **result);
-  nsresult VisitEntriesInternal(nsICacheVisitor *visitor);
+                                 bool streamBased, nsICacheSession** result);
+  nsresult VisitEntriesInternal(nsICacheVisitor* visitor);
   nsresult EvictEntriesInternal(nsCacheStoragePolicy storagePolicy);
 
  private:
@@ -216,44 +216,44 @@ class nsCacheService final : public nsICacheServiceInternal {
 
   nsresult CreateDiskDevice();
   nsresult CreateOfflineDevice();
-  nsresult CreateCustomOfflineDevice(nsIFile *aProfileDir, int32_t aQuota,
-                                     nsOfflineCacheDevice **aDevice);
+  nsresult CreateCustomOfflineDevice(nsIFile* aProfileDir, int32_t aQuota,
+                                     nsOfflineCacheDevice** aDevice);
   nsresult CreateMemoryDevice();
 
-  nsresult RemoveCustomOfflineDevice(nsOfflineCacheDevice *aDevice);
+  nsresult RemoveCustomOfflineDevice(nsOfflineCacheDevice* aDevice);
 
-  nsresult CreateRequest(nsCacheSession *session, const nsACString &clientKey,
+  nsresult CreateRequest(nsCacheSession* session, const nsACString& clientKey,
                          nsCacheAccessMode accessRequested, bool blockingMode,
-                         nsICacheListener *listener, nsCacheRequest **request);
+                         nsICacheListener* listener, nsCacheRequest** request);
 
-  nsresult DoomEntry_Internal(nsCacheEntry *entry,
+  nsresult DoomEntry_Internal(nsCacheEntry* entry,
                               bool doProcessPendingRequests);
 
-  nsresult EvictEntriesForClient(const char *clientID,
+  nsresult EvictEntriesForClient(const char* clientID,
                                  nsCacheStoragePolicy storagePolicy);
 
   // Notifies request listener asynchronously on the request's thread, and
   // releases the descriptor on the request's thread.  If this method fails,
   // the descriptor is not released.
-  nsresult NotifyListener(nsCacheRequest *request,
-                          nsICacheEntryDescriptor *descriptor,
+  nsresult NotifyListener(nsCacheRequest* request,
+                          nsICacheEntryDescriptor* descriptor,
                           nsCacheAccessMode accessGranted, nsresult error);
 
-  nsresult ActivateEntry(nsCacheRequest *request, nsCacheEntry **entry,
-                         nsCacheEntry **doomedEntry);
+  nsresult ActivateEntry(nsCacheRequest* request, nsCacheEntry** entry,
+                         nsCacheEntry** doomedEntry);
 
-  nsCacheDevice *EnsureEntryHasDevice(nsCacheEntry *entry);
+  nsCacheDevice* EnsureEntryHasDevice(nsCacheEntry* entry);
 
-  nsCacheEntry *SearchCacheDevices(nsCString *key, nsCacheStoragePolicy policy,
-                                   bool *collision);
+  nsCacheEntry* SearchCacheDevices(nsCString* key, nsCacheStoragePolicy policy,
+                                   bool* collision);
 
-  void DeactivateEntry(nsCacheEntry *entry);
+  void DeactivateEntry(nsCacheEntry* entry);
 
-  nsresult ProcessRequest(nsCacheRequest *request,
+  nsresult ProcessRequest(nsCacheRequest* request,
                           bool calledFromOpenCacheEntry,
-                          nsICacheEntryDescriptor **result);
+                          nsICacheEntryDescriptor** result);
 
-  nsresult ProcessPendingRequests(nsCacheEntry *entry);
+  nsresult ProcessPendingRequests(nsCacheEntry* entry);
 
   void ClearDoomList(void);
   void DoomActiveEntries(DoomCheckFn check);
@@ -266,11 +266,11 @@ class nsCacheService final : public nsICacheServiceInternal {
    *  Data Members
    */
 
-  static nsCacheService *gService;  // there can be only one...
+  static nsCacheService* gService;  // there can be only one...
 
   nsCOMPtr mStorageService;
 
-  nsCacheProfilePrefObserver *mObserver;
+  nsCacheProfilePrefObserver* mObserver;
 
   mozilla::Mutex mLock;
   mozilla::CondVar mCondVar;
@@ -281,14 +281,14 @@ class nsCacheService final : public nsICacheServiceInternal {
 
   nsCOMPtr mCacheIOThread;
 
-  nsTArray mDoomedObjects;
+  nsTArray mDoomedObjects;
 
   bool mInitialized;
   bool mClearingEntries;
 
   bool mEnableOfflineDevice;
 
-  nsOfflineCacheDevice *mOfflineDevice;
+  nsOfflineCacheDevice* mOfflineDevice;
 
   nsRefPtrHashtable
       mCustomOfflineDevices;
diff --git a/netwerk/cache/nsCacheSession.cpp b/netwerk/cache/nsCacheSession.cpp
index 6bdaefcdbf31e..c4d92c6f225f0 100644
--- a/netwerk/cache/nsCacheSession.cpp
+++ b/netwerk/cache/nsCacheSession.cpp
@@ -11,7 +11,7 @@
 
 NS_IMPL_ISUPPORTS(nsCacheSession, nsICacheSession)
 
-nsCacheSession::nsCacheSession(const char *clientID,
+nsCacheSession::nsCacheSession(const char* clientID,
                                nsCacheStoragePolicy storagePolicy,
                                bool streamBased)
     : mClientID(clientID), mInfo(0) {
@@ -32,13 +32,13 @@ nsCacheSession::~nsCacheSession() {
   // notify service we are going away?
 }
 
-NS_IMETHODIMP nsCacheSession::GetDoomEntriesIfExpired(bool *result) {
+NS_IMETHODIMP nsCacheSession::GetDoomEntriesIfExpired(bool* result) {
   NS_ENSURE_ARG_POINTER(result);
   *result = WillDoomEntriesIfExpired();
   return NS_OK;
 }
 
-NS_IMETHODIMP nsCacheSession::SetProfileDirectory(nsIFile *profileDir) {
+NS_IMETHODIMP nsCacheSession::SetProfileDirectory(nsIFile* profileDir) {
   if (StoragePolicy() != nsICache::STORE_OFFLINE && profileDir) {
     // Profile directory override is currently implemented only for
     // offline cache.  This is an early failure to prevent the request
@@ -51,7 +51,7 @@ NS_IMETHODIMP nsCacheSession::SetProfileDirectory(nsIFile *profileDir) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsCacheSession::GetProfileDirectory(nsIFile **profileDir) {
+NS_IMETHODIMP nsCacheSession::GetProfileDirectory(nsIFile** profileDir) {
   if (mProfileDir)
     NS_ADDREF(*profileDir = mProfileDir);
   else
@@ -70,10 +70,10 @@ NS_IMETHODIMP nsCacheSession::SetDoomEntriesIfExpired(
 }
 
 NS_IMETHODIMP
-nsCacheSession::OpenCacheEntry(const nsACString &key,
+nsCacheSession::OpenCacheEntry(const nsACString& key,
                                nsCacheAccessMode accessRequested,
                                bool blockingMode,
-                               nsICacheEntryDescriptor **result) {
+                               nsICacheEntryDescriptor** result) {
   nsresult rv;
 
   if (NS_IsMainThread())
@@ -87,8 +87,8 @@ nsCacheSession::OpenCacheEntry(const nsACString &key,
 }
 
 NS_IMETHODIMP nsCacheSession::AsyncOpenCacheEntry(
-    const nsACString &key, nsCacheAccessMode accessRequested,
-    nsICacheListener *listener, bool noWait) {
+    const nsACString& key, nsCacheAccessMode accessRequested,
+    nsICacheListener* listener, bool noWait) {
   nsresult rv;
   rv = nsCacheService::OpenCacheEntry(this, key, accessRequested, !noWait,
                                       listener,
@@ -102,16 +102,16 @@ NS_IMETHODIMP nsCacheSession::EvictEntries() {
   return nsCacheService::EvictEntriesForSession(this);
 }
 
-NS_IMETHODIMP nsCacheSession::IsStorageEnabled(bool *result) {
+NS_IMETHODIMP nsCacheSession::IsStorageEnabled(bool* result) {
   return nsCacheService::IsStorageEnabledForPolicy(StoragePolicy(), result);
 }
 
-NS_IMETHODIMP nsCacheSession::DoomEntry(const nsACString &key,
-                                        nsICacheListener *listener) {
+NS_IMETHODIMP nsCacheSession::DoomEntry(const nsACString& key,
+                                        nsICacheListener* listener) {
   return nsCacheService::DoomEntry(this, key, listener);
 }
 
-NS_IMETHODIMP nsCacheSession::GetIsPrivate(bool *aPrivate) {
+NS_IMETHODIMP nsCacheSession::GetIsPrivate(bool* aPrivate) {
   *aPrivate = IsPrivate();
   return NS_OK;
 }
diff --git a/netwerk/cache/nsCacheUtils.h b/netwerk/cache/nsCacheUtils.h
index 1f8dca4eb76f1..71f3056f89dc7 100644
--- a/netwerk/cache/nsCacheUtils.h
+++ b/netwerk/cache/nsCacheUtils.h
@@ -18,7 +18,7 @@ class nsIThread;
  */
 class nsShutdownThread : public mozilla::Runnable {
  public:
-  explicit nsShutdownThread(nsIThread *aThread);
+  explicit nsShutdownThread(nsIThread* aThread);
   ~nsShutdownThread() = default;
 
   NS_IMETHOD Run() override;
@@ -26,14 +26,14 @@ class nsShutdownThread : public mozilla::Runnable {
   /**
    * Shutdown ensures that aThread->Shutdown() is called on a main thread
    */
-  static nsresult Shutdown(nsIThread *aThread);
+  static nsresult Shutdown(nsIThread* aThread);
 
   /**
    * BlockingShutdown ensures that by the time it returns, aThread->Shutdown()
    * has been called and no pending events have been processed on the current
    * thread.
    */
-  static nsresult BlockingShutdown(nsIThread *aThread);
+  static nsresult BlockingShutdown(nsIThread* aThread);
 
  private:
   mozilla::Monitor mMonitor;
diff --git a/netwerk/cache/nsDeleteDir.cpp b/netwerk/cache/nsDeleteDir.cpp
index 5ae1029d51008..86a6fc0eb0b75 100644
--- a/netwerk/cache/nsDeleteDir.cpp
+++ b/netwerk/cache/nsDeleteDir.cpp
@@ -31,7 +31,7 @@ class nsBlockOnBackgroundThreadEvent : public Runnable {
   }
 };
 
-nsDeleteDir *nsDeleteDir::gInstance = nullptr;
+nsDeleteDir* nsDeleteDir::gInstance = nullptr;
 
 nsDeleteDir::nsDeleteDir()
     : mLock("nsDeleteDir.mLock"),
@@ -69,8 +69,8 @@ nsresult nsDeleteDir::Shutdown(bool finishDeleting) {
       nsCOMPtr timer = gInstance->mTimers[i - 1];
       gInstance->mTimers.RemoveObjectAt(i - 1);
 
-      nsCOMArray *arg;
-      timer->GetClosure((reinterpret_cast(&arg)));
+      nsCOMArray* arg;
+      timer->GetClosure((reinterpret_cast(&arg)));
       timer->Cancel();
 
       if (finishDeleting) dirsToRemove.AppendObjects(*arg);
@@ -133,7 +133,7 @@ void nsDeleteDir::DestroyThread() {
   mThread = nullptr;
 }
 
-void nsDeleteDir::TimerCallback(nsITimer *aTimer, void *arg) {
+void nsDeleteDir::TimerCallback(nsITimer* aTimer, void* arg) {
   Telemetry::AutoTimer timer;
   {
     MutexAutoLock lock(gInstance->mLock);
@@ -148,7 +148,7 @@ void nsDeleteDir::TimerCallback(nsITimer *aTimer, void *arg) {
   }
 
   nsAutoPtr > dirList;
-  dirList = static_cast *>(arg);
+  dirList = static_cast*>(arg);
 
   bool shuttingDown = false;
 
@@ -169,7 +169,7 @@ void nsDeleteDir::TimerCallback(nsITimer *aTimer, void *arg) {
   }
 }
 
-nsresult nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash,
+nsresult nsDeleteDir::DeleteDir(nsIFile* dirIn, bool moveToTrash,
                                 uint32_t delay) {
   Telemetry::AutoTimer timer;
 
@@ -237,11 +237,11 @@ nsresult nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash,
   return NS_OK;
 }
 
-nsresult nsDeleteDir::GetTrashDir(nsIFile *target, nsCOMPtr *result) {
+nsresult nsDeleteDir::GetTrashDir(nsIFile* target, nsCOMPtr* result) {
   nsresult rv;
 #if defined(MOZ_WIDGET_ANDROID)
   // Try to use the app cache folder for cache trash on Android
-  char *cachePath = getenv("CACHE_DIRECTORY");
+  char* cachePath = getenv("CACHE_DIRECTORY");
   if (cachePath) {
     rv = NS_NewNativeLocalFile(nsDependentCString(cachePath), true,
                                getter_AddRefs(*result));
@@ -266,7 +266,7 @@ nsresult nsDeleteDir::GetTrashDir(nsIFile *target, nsCOMPtr *result) {
   return (*result)->SetNativeLeafName(leaf);
 }
 
-nsresult nsDeleteDir::RemoveOldTrashes(nsIFile *cacheDir) {
+nsresult nsDeleteDir::RemoveOldTrashes(nsIFile* cacheDir) {
   if (!gInstance) return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv;
@@ -316,7 +316,7 @@ nsresult nsDeleteDir::RemoveOldTrashes(nsIFile *cacheDir) {
   return NS_OK;
 }
 
-nsresult nsDeleteDir::PostTimer(void *arg, uint32_t delay) {
+nsresult nsDeleteDir::PostTimer(void* arg, uint32_t delay) {
   nsresult rv;
 
   MutexAutoLock lock(mLock);
@@ -334,7 +334,7 @@ nsresult nsDeleteDir::PostTimer(void *arg, uint32_t delay) {
   return NS_OK;
 }
 
-nsresult nsDeleteDir::RemoveDir(nsIFile *file, bool *stopDeleting) {
+nsresult nsDeleteDir::RemoveDir(nsIFile* file, bool* stopDeleting) {
   nsresult rv;
   bool isLink;
 
diff --git a/netwerk/cache/nsDeleteDir.h b/netwerk/cache/nsDeleteDir.h
index 703e8eb9cff48..a5b3013c6cd06 100644
--- a/netwerk/cache/nsDeleteDir.h
+++ b/netwerk/cache/nsDeleteDir.h
@@ -42,20 +42,20 @@ class nsDeleteDir {
    * renamed immediately if 'moveToTrash' is passed, so upon return it is safe
    * to create a directory with the same name).
    */
-  static nsresult DeleteDir(nsIFile *dir, bool moveToTrash, uint32_t delay = 0);
+  static nsresult DeleteDir(nsIFile* dir, bool moveToTrash, uint32_t delay = 0);
 
   /**
    * Returns the trash directory corresponding to the given directory.
    */
-  static nsresult GetTrashDir(nsIFile *dir, nsCOMPtr *result);
+  static nsresult GetTrashDir(nsIFile* dir, nsCOMPtr* result);
 
   /**
    * Remove all trashes left from previous run. This function does nothing when
    * called second and more times.
    */
-  static nsresult RemoveOldTrashes(nsIFile *cacheDir);
+  static nsresult RemoveOldTrashes(nsIFile* cacheDir);
 
-  static void TimerCallback(nsITimer *aTimer, void *arg);
+  static void TimerCallback(nsITimer* aTimer, void* arg);
 
  private:
   friend class nsBlockOnBackgroundThreadEvent;
@@ -63,10 +63,10 @@ class nsDeleteDir {
 
   nsresult InitThread();
   void DestroyThread();
-  nsresult PostTimer(void *arg, uint32_t delay);
-  nsresult RemoveDir(nsIFile *file, bool *stopDeleting);
+  nsresult PostTimer(void* arg, uint32_t delay);
+  nsresult RemoveDir(nsIFile* file, bool* stopDeleting);
 
-  static nsDeleteDir *gInstance;
+  static nsDeleteDir* gInstance;
   mozilla::Mutex mLock;
   mozilla::CondVar mCondVar;
   bool mNotified;
diff --git a/netwerk/cache/nsDiskCacheDeviceSQL.cpp b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
index 42e28b73ba8bb..febcfa11e9735 100644
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -67,7 +67,7 @@ static uint32_t gNextTemporaryClientID = 0;
  * helpers
  */
 
-static nsresult EnsureDir(nsIFile *dir) {
+static nsresult EnsureDir(nsIFile* dir) {
   bool exists;
   nsresult rv = dir->Exists(&exists);
   if (NS_SUCCEEDED(rv) && !exists)
@@ -75,8 +75,8 @@ static nsresult EnsureDir(nsIFile *dir) {
   return rv;
 }
 
-static bool DecomposeCacheEntryKey(const nsCString *fullKey, const char **cid,
-                                   const char **key, nsCString &buf) {
+static bool DecomposeCacheEntryKey(const nsCString* fullKey, const char** cid,
+                                   const char** key, nsCString& buf) {
   buf = *fullKey;
 
   int32_t colon = buf.FindChar(':');
@@ -94,20 +94,20 @@ static bool DecomposeCacheEntryKey(const nsCString *fullKey, const char **cid,
 
 class AutoResetStatement {
  public:
-  explicit AutoResetStatement(mozIStorageStatement *s) : mStatement(s) {}
+  explicit AutoResetStatement(mozIStorageStatement* s) : mStatement(s) {}
   ~AutoResetStatement() { mStatement->Reset(); }
-  mozIStorageStatement *operator->() MOZ_NO_ADDREF_RELEASE_ON_RETURN {
+  mozIStorageStatement* operator->() MOZ_NO_ADDREF_RELEASE_ON_RETURN {
     return mStatement;
   }
 
  private:
-  mozIStorageStatement *mStatement;
+  mozIStorageStatement* mStatement;
 };
 
 class EvictionObserver {
  public:
-  EvictionObserver(mozIStorageConnection *db,
-                   nsOfflineCacheEvictionFunction *evictionFunction)
+  EvictionObserver(mozIStorageConnection* db,
+                   nsOfflineCacheEvictionFunction* evictionFunction)
       : mDB(db), mEvictionFunction(evictionFunction) {
     mEvictionFunction->Init();
     mDB->ExecuteSimpleSQL(
@@ -126,7 +126,7 @@ class EvictionObserver {
   void Apply() { return mEvictionFunction->Apply(); }
 
  private:
-  mozIStorageConnection *mDB;
+  mozIStorageConnection* mDB;
   RefPtr mEvictionFunction;
 };
 
@@ -141,7 +141,7 @@ class EvictionObserver {
  *  map files may become invalid, and therefore the kCurrentVersion needs
  *  to be revised.
  */
-static uint64_t DCacheHash(const char *key) {
+static uint64_t DCacheHash(const char* key) {
   // initval 0x7416f295 was chosen randomly
   return (uint64_t(CacheHash::Hash(key, strlen(key), 0)) << 32) |
          CacheHash::Hash(key, strlen(key), 0x7416f295);
@@ -155,8 +155,8 @@ NS_IMPL_ISUPPORTS(nsOfflineCacheEvictionFunction, mozIStorageFunction)
 
 // helper function for directly exposing the same data file binding
 // path algorithm used in nsOfflineCacheBinding::Create
-static nsresult GetCacheDataFile(nsIFile *cacheDir, const char *key,
-                                 int generation, nsCOMPtr &file) {
+static nsresult GetCacheDataFile(nsIFile* cacheDir, const char* key,
+                                 int generation, nsCOMPtr& file) {
   cacheDir->Clone(getter_AddRefs(file));
   if (!file) return NS_ERROR_OUT_OF_MEMORY;
 
@@ -178,13 +178,13 @@ static nsresult GetCacheDataFile(nsIFile *cacheDir, const char *key,
 namespace appcachedetail {
 
 typedef nsCOMArray FileArray;
-static MOZ_THREAD_LOCAL(FileArray *) tlsEvictionItems;
+static MOZ_THREAD_LOCAL(FileArray*) tlsEvictionItems;
 
 }  // namespace appcachedetail
 
 NS_IMETHODIMP
-nsOfflineCacheEvictionFunction::OnFunctionCall(mozIStorageValueArray *values,
-                                               nsIVariant **_retval) {
+nsOfflineCacheEvictionFunction::OnFunctionCall(mozIStorageValueArray* values,
+                                               nsIVariant** _retval) {
   LOG(("nsOfflineCacheEvictionFunction::OnFunctionCall\n"));
 
   *_retval = nullptr;
@@ -195,8 +195,8 @@ nsOfflineCacheEvictionFunction::OnFunctionCall(mozIStorageValueArray *values,
   NS_ASSERTION(numEntries == 3, "unexpected number of arguments");
 
   uint32_t valueLen;
-  const char *clientID = values->AsSharedUTF8String(0, &valueLen);
-  const char *key = values->AsSharedUTF8String(1, &valueLen);
+  const char* clientID = values->AsSharedUTF8String(0, &valueLen);
+  const char* key = values->AsSharedUTF8String(1, &valueLen);
   nsAutoCString fullKey(clientID);
   fullKey.Append(':');
   fullKey.Append(key);
@@ -218,7 +218,7 @@ nsOfflineCacheEvictionFunction::OnFunctionCall(mozIStorageValueArray *values,
     return rv;
   }
 
-  appcachedetail::FileArray *items = appcachedetail::tlsEvictionItems.get();
+  appcachedetail::FileArray* items = appcachedetail::tlsEvictionItems.get();
   MOZ_ASSERT(items);
   if (items) {
     items->AppendObject(file);
@@ -228,7 +228,7 @@ nsOfflineCacheEvictionFunction::OnFunctionCall(mozIStorageValueArray *values,
 }
 
 nsOfflineCacheEvictionFunction::nsOfflineCacheEvictionFunction(
-    nsOfflineCacheDevice *device)
+    nsOfflineCacheDevice* device)
     : mDevice(device) {
   mTLSInited = appcachedetail::tlsEvictionItems.init();
 }
@@ -244,7 +244,7 @@ void nsOfflineCacheEvictionFunction::Reset() {
     return;
   }
 
-  appcachedetail::FileArray *items = appcachedetail::tlsEvictionItems.get();
+  appcachedetail::FileArray* items = appcachedetail::tlsEvictionItems.get();
   if (!items) {
     return;
   }
@@ -260,7 +260,7 @@ void nsOfflineCacheEvictionFunction::Apply() {
     return;
   }
 
-  appcachedetail::FileArray *pitems = appcachedetail::tlsEvictionItems.get();
+  appcachedetail::FileArray* pitems = appcachedetail::tlsEvictionItems.get();
   if (!pitems) {
     return;
   }
@@ -279,8 +279,8 @@ void nsOfflineCacheEvictionFunction::Apply() {
 
 class nsOfflineCacheDiscardCache : public Runnable {
  public:
-  nsOfflineCacheDiscardCache(nsOfflineCacheDevice *device, nsCString &group,
-                             nsCString &clientID)
+  nsOfflineCacheDiscardCache(nsOfflineCacheDevice* device, nsCString& group,
+                             nsCString& clientID)
       : mozilla::Runnable("nsOfflineCacheDiscardCache"),
         mDevice(device),
         mGroup(group),
@@ -309,31 +309,31 @@ class nsOfflineCacheDeviceInfo final : public nsICacheDeviceInfo {
   NS_DECL_ISUPPORTS
   NS_DECL_NSICACHEDEVICEINFO
 
-  explicit nsOfflineCacheDeviceInfo(nsOfflineCacheDevice *device)
+  explicit nsOfflineCacheDeviceInfo(nsOfflineCacheDevice* device)
       : mDevice(device) {}
 
  private:
   ~nsOfflineCacheDeviceInfo() = default;
 
-  nsOfflineCacheDevice *mDevice;
+  nsOfflineCacheDevice* mDevice;
 };
 
 NS_IMPL_ISUPPORTS(nsOfflineCacheDeviceInfo, nsICacheDeviceInfo)
 
 NS_IMETHODIMP
-nsOfflineCacheDeviceInfo::GetDescription(nsACString &aDescription) {
+nsOfflineCacheDeviceInfo::GetDescription(nsACString& aDescription) {
   aDescription.AssignLiteral("Offline cache device");
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheDeviceInfo::GetUsageReport(nsACString &aUsageReport) {
+nsOfflineCacheDeviceInfo::GetUsageReport(nsACString& aUsageReport) {
   nsAutoCString buffer;
   buffer.AssignLiteral(
       "  \n"
       "    Cache Directory:\n"
       "    ");
-  nsIFile *cacheDir = mDevice->CacheDirectory();
+  nsIFile* cacheDir = mDevice->CacheDirectory();
   if (!cacheDir) return NS_OK;
 
   nsAutoString path;
@@ -352,19 +352,19 @@ nsOfflineCacheDeviceInfo::GetUsageReport(nsACString &aUsageReport) {
 }
 
 NS_IMETHODIMP
-nsOfflineCacheDeviceInfo::GetEntryCount(uint32_t *aEntryCount) {
+nsOfflineCacheDeviceInfo::GetEntryCount(uint32_t* aEntryCount) {
   *aEntryCount = mDevice->EntryCount();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheDeviceInfo::GetTotalSize(uint32_t *aTotalSize) {
+nsOfflineCacheDeviceInfo::GetTotalSize(uint32_t* aTotalSize) {
   *aTotalSize = mDevice->CacheSize();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheDeviceInfo::GetMaximumSize(uint32_t *aMaximumSize) {
+nsOfflineCacheDeviceInfo::GetMaximumSize(uint32_t* aMaximumSize) {
   *aMaximumSize = mDevice->CacheCapacity();
   return NS_OK;
 }
@@ -379,7 +379,7 @@ class nsOfflineCacheBinding final : public nsISupports {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  static nsOfflineCacheBinding *Create(nsIFile *cacheDir, const nsCString *key,
+  static nsOfflineCacheBinding* Create(nsIFile* cacheDir, const nsCString* key,
                                        int generation);
 
   enum { FLAG_NEW_ENTRY = 1 };
@@ -395,8 +395,8 @@ class nsOfflineCacheBinding final : public nsISupports {
 
 NS_IMPL_ISUPPORTS0(nsOfflineCacheBinding)
 
-nsOfflineCacheBinding *nsOfflineCacheBinding::Create(nsIFile *cacheDir,
-                                                     const nsCString *fullKey,
+nsOfflineCacheBinding* nsOfflineCacheBinding::Create(nsIFile* cacheDir,
+                                                     const nsCString* fullKey,
                                                      int generation) {
   nsCOMPtr file;
   cacheDir->Clone(getter_AddRefs(file));
@@ -442,7 +442,7 @@ nsOfflineCacheBinding *nsOfflineCacheBinding::Create(nsIFile *cacheDir,
     if (NS_FAILED(rv)) return nullptr;
   }
 
-  nsOfflineCacheBinding *binding = new nsOfflineCacheBinding;
+  nsOfflineCacheBinding* binding = new nsOfflineCacheBinding;
   if (!binding) return nullptr;
 
   binding->mDataFile.swap(file);
@@ -456,9 +456,9 @@ nsOfflineCacheBinding *nsOfflineCacheBinding::Create(nsIFile *cacheDir,
  */
 
 struct nsOfflineCacheRecord {
-  const char *clientID;
-  const char *key;
-  const uint8_t *metaData;
+  const char* clientID;
+  const char* key;
+  const uint8_t* metaData;
   uint32_t metaDataLen;
   int32_t generation;
   int32_t dataSize;
@@ -468,10 +468,10 @@ struct nsOfflineCacheRecord {
   int64_t expirationTime;
 };
 
-static nsCacheEntry *CreateCacheEntry(nsOfflineCacheDevice *device,
-                                      const nsCString *fullKey,
-                                      const nsOfflineCacheRecord &rec) {
-  nsCacheEntry *entry;
+static nsCacheEntry* CreateCacheEntry(nsOfflineCacheDevice* device,
+                                      const nsCString* fullKey,
+                                      const nsOfflineCacheRecord& rec) {
+  nsCacheEntry* entry;
 
   if (device->IsLocked(*fullKey)) {
     return nullptr;
@@ -488,10 +488,10 @@ static nsCacheEntry *CreateCacheEntry(nsOfflineCacheDevice *device,
   entry->SetExpirationTime(SecondsFromPRTime(rec.expirationTime));
   entry->SetDataSize((uint32_t)rec.dataSize);
 
-  entry->UnflattenMetaData((const char *)rec.metaData, rec.metaDataLen);
+  entry->UnflattenMetaData((const char*)rec.metaData, rec.metaDataLen);
 
   // Restore security info, if present
-  const char *info = entry->GetMetaDataElement("security-info");
+  const char* info = entry->GetMetaDataElement("security-info");
   if (info) {
     nsCOMPtr infoObj;
     rv =
@@ -504,7 +504,7 @@ static nsCacheEntry *CreateCacheEntry(nsOfflineCacheDevice *device,
   }
 
   // create a binding object for this entry
-  nsOfflineCacheBinding *binding = nsOfflineCacheBinding::Create(
+  nsOfflineCacheBinding* binding = nsOfflineCacheBinding::Create(
       device->CacheDirectory(), fullKey, rec.generation);
   if (!binding) {
     delete entry;
@@ -526,61 +526,61 @@ class nsOfflineCacheEntryInfo final : public nsICacheEntryInfo {
   NS_DECL_ISUPPORTS
   NS_DECL_NSICACHEENTRYINFO
 
-  nsOfflineCacheRecord *mRec;
+  nsOfflineCacheRecord* mRec;
 };
 
 NS_IMPL_ISUPPORTS(nsOfflineCacheEntryInfo, nsICacheEntryInfo)
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::GetClientID(nsACString &aClientID) {
+nsOfflineCacheEntryInfo::GetClientID(nsACString& aClientID) {
   aClientID.Assign(mRec->clientID);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::GetDeviceID(nsACString &aDeviceID) {
+nsOfflineCacheEntryInfo::GetDeviceID(nsACString& aDeviceID) {
   aDeviceID.Assign(OFFLINE_CACHE_DEVICE_ID);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::GetKey(nsACString &clientKey) {
+nsOfflineCacheEntryInfo::GetKey(nsACString& clientKey) {
   clientKey.Assign(mRec->key);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::GetFetchCount(int32_t *aFetchCount) {
+nsOfflineCacheEntryInfo::GetFetchCount(int32_t* aFetchCount) {
   *aFetchCount = mRec->fetchCount;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::GetLastFetched(uint32_t *aLastFetched) {
+nsOfflineCacheEntryInfo::GetLastFetched(uint32_t* aLastFetched) {
   *aLastFetched = SecondsFromPRTime(mRec->lastFetched);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::GetLastModified(uint32_t *aLastModified) {
+nsOfflineCacheEntryInfo::GetLastModified(uint32_t* aLastModified) {
   *aLastModified = SecondsFromPRTime(mRec->lastModified);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::GetExpirationTime(uint32_t *aExpirationTime) {
+nsOfflineCacheEntryInfo::GetExpirationTime(uint32_t* aExpirationTime) {
   *aExpirationTime = SecondsFromPRTime(mRec->expirationTime);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::IsStreamBased(bool *aStreamBased) {
+nsOfflineCacheEntryInfo::IsStreamBased(bool* aStreamBased) {
   *aStreamBased = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsOfflineCacheEntryInfo::GetDataSize(uint32_t *aDataSize) {
+nsOfflineCacheEntryInfo::GetDataSize(uint32_t* aDataSize) {
   *aDataSize = mRec->dataSize;
   return NS_OK;
 }
@@ -593,8 +593,8 @@ NS_IMPL_ISUPPORTS(nsApplicationCacheNamespace, nsIApplicationCacheNamespace)
 
 NS_IMETHODIMP
 nsApplicationCacheNamespace::Init(uint32_t itemType,
-                                  const nsACString &namespaceSpec,
-                                  const nsACString &data) {
+                                  const nsACString& namespaceSpec,
+                                  const nsACString& data) {
   mItemType = itemType;
   mNamespaceSpec = namespaceSpec;
   mData = data;
@@ -602,19 +602,19 @@ nsApplicationCacheNamespace::Init(uint32_t itemType,
 }
 
 NS_IMETHODIMP
-nsApplicationCacheNamespace::GetItemType(uint32_t *out) {
+nsApplicationCacheNamespace::GetItemType(uint32_t* out) {
   *out = mItemType;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsApplicationCacheNamespace::GetNamespaceSpec(nsACString &out) {
+nsApplicationCacheNamespace::GetNamespaceSpec(nsACString& out) {
   out = mNamespaceSpec;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsApplicationCacheNamespace::GetData(nsACString &out) {
+nsApplicationCacheNamespace::GetData(nsACString& out) {
   out = mData;
   return NS_OK;
 }
@@ -628,9 +628,9 @@ NS_IMPL_ISUPPORTS(nsApplicationCache, nsIApplicationCache,
 
 nsApplicationCache::nsApplicationCache() : mDevice(nullptr), mValid(true) {}
 
-nsApplicationCache::nsApplicationCache(nsOfflineCacheDevice *device,
-                                       const nsACString &group,
-                                       const nsACString &clientID)
+nsApplicationCache::nsApplicationCache(nsOfflineCacheDevice* device,
+                                       const nsACString& group,
+                                       const nsACString& clientID)
     : mDevice(device), mGroup(group), mClientID(clientID), mValid(true) {}
 
 nsApplicationCache::~nsApplicationCache() {
@@ -648,8 +648,8 @@ nsApplicationCache::~nsApplicationCache() {
 void nsApplicationCache::MarkInvalid() { mValid = false; }
 
 NS_IMETHODIMP
-nsApplicationCache::InitAsHandle(const nsACString &groupId,
-                                 const nsACString &clientId) {
+nsApplicationCache::InitAsHandle(const nsACString& groupId,
+                                 const nsACString& clientId) {
   NS_ENSURE_FALSE(mDevice, NS_ERROR_ALREADY_INITIALIZED);
   NS_ENSURE_TRUE(mGroup.IsEmpty(), NS_ERROR_ALREADY_INITIALIZED);
 
@@ -659,7 +659,7 @@ nsApplicationCache::InitAsHandle(const nsACString &groupId,
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GetManifestURI(nsIURI **out) {
+nsApplicationCache::GetManifestURI(nsIURI** out) {
   nsCOMPtr uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), mGroup);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -671,19 +671,19 @@ nsApplicationCache::GetManifestURI(nsIURI **out) {
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GetGroupID(nsACString &out) {
+nsApplicationCache::GetGroupID(nsACString& out) {
   out = mGroup;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GetClientID(nsACString &out) {
+nsApplicationCache::GetClientID(nsACString& out) {
   out = mClientID;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GetProfileDirectory(nsIFile **out) {
+nsApplicationCache::GetProfileDirectory(nsIFile** out) {
   if (mDevice->BaseDirectory())
     NS_ADDREF(*out = mDevice->BaseDirectory());
   else
@@ -693,7 +693,7 @@ nsApplicationCache::GetProfileDirectory(nsIFile **out) {
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GetActive(bool *out) {
+nsApplicationCache::GetActive(bool* out) {
   NS_ENSURE_TRUE(mDevice, NS_ERROR_NOT_AVAILABLE);
 
   *out = mDevice->IsActiveCache(mGroup, mClientID);
@@ -726,7 +726,7 @@ nsApplicationCache::Discard() {
 }
 
 NS_IMETHODIMP
-nsApplicationCache::MarkEntry(const nsACString &key, uint32_t typeBits) {
+nsApplicationCache::MarkEntry(const nsACString& key, uint32_t typeBits) {
   NS_ENSURE_TRUE(mValid, NS_ERROR_NOT_AVAILABLE);
   NS_ENSURE_TRUE(mDevice, NS_ERROR_NOT_AVAILABLE);
 
@@ -734,7 +734,7 @@ nsApplicationCache::MarkEntry(const nsACString &key, uint32_t typeBits) {
 }
 
 NS_IMETHODIMP
-nsApplicationCache::UnmarkEntry(const nsACString &key, uint32_t typeBits) {
+nsApplicationCache::UnmarkEntry(const nsACString& key, uint32_t typeBits) {
   NS_ENSURE_TRUE(mValid, NS_ERROR_NOT_AVAILABLE);
   NS_ENSURE_TRUE(mDevice, NS_ERROR_NOT_AVAILABLE);
 
@@ -742,7 +742,7 @@ nsApplicationCache::UnmarkEntry(const nsACString &key, uint32_t typeBits) {
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GetTypes(const nsACString &key, uint32_t *typeBits) {
+nsApplicationCache::GetTypes(const nsACString& key, uint32_t* typeBits) {
   NS_ENSURE_TRUE(mValid, NS_ERROR_NOT_AVAILABLE);
   NS_ENSURE_TRUE(mDevice, NS_ERROR_NOT_AVAILABLE);
 
@@ -750,8 +750,8 @@ nsApplicationCache::GetTypes(const nsACString &key, uint32_t *typeBits) {
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GatherEntries(uint32_t typeBits, uint32_t *count,
-                                  char ***keys) {
+nsApplicationCache::GatherEntries(uint32_t typeBits, uint32_t* count,
+                                  char*** keys) {
   NS_ENSURE_TRUE(mValid, NS_ERROR_NOT_AVAILABLE);
   NS_ENSURE_TRUE(mDevice, NS_ERROR_NOT_AVAILABLE);
 
@@ -759,7 +759,7 @@ nsApplicationCache::GatherEntries(uint32_t typeBits, uint32_t *count,
 }
 
 NS_IMETHODIMP
-nsApplicationCache::AddNamespaces(nsIArray *namespaces) {
+nsApplicationCache::AddNamespaces(nsIArray* namespaces) {
   NS_ENSURE_TRUE(mValid, NS_ERROR_NOT_AVAILABLE);
   NS_ENSURE_TRUE(mDevice, NS_ERROR_NOT_AVAILABLE);
 
@@ -787,8 +787,8 @@ nsApplicationCache::AddNamespaces(nsIArray *namespaces) {
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GetMatchingNamespace(const nsACString &key,
-                                         nsIApplicationCacheNamespace **out)
+nsApplicationCache::GetMatchingNamespace(const nsACString& key,
+                                         nsIApplicationCacheNamespace** out)
 
 {
   NS_ENSURE_TRUE(mValid, NS_ERROR_NOT_AVAILABLE);
@@ -798,7 +798,7 @@ nsApplicationCache::GetMatchingNamespace(const nsACString &key,
 }
 
 NS_IMETHODIMP
-nsApplicationCache::GetUsage(uint32_t *usage) {
+nsApplicationCache::GetUsage(uint32_t* usage) {
   NS_ENSURE_TRUE(mValid, NS_ERROR_NOT_AVAILABLE);
   NS_ENSURE_TRUE(mDevice, NS_ERROR_NOT_AVAILABLE);
 
@@ -811,7 +811,7 @@ nsApplicationCache::GetUsage(uint32_t *usage) {
 
 class nsCloseDBEvent : public Runnable {
  public:
-  explicit nsCloseDBEvent(mozIStorageConnection *aDB)
+  explicit nsCloseDBEvent(mozIStorageConnection* aDB)
       : mozilla::Runnable("nsCloseDBEvent") {
     mDB = aDB;
   }
@@ -880,7 +880,7 @@ uint32_t nsOfflineCacheDevice::EntryCount() {
   return (uint32_t)statement->AsInt32(0);
 }
 
-nsresult nsOfflineCacheDevice::UpdateEntry(nsCacheEntry *entry) {
+nsresult nsOfflineCacheDevice::UpdateEntry(nsCacheEntry* entry) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   // Decompose the key into "ClientID" and "Key"
@@ -907,11 +907,11 @@ nsresult nsOfflineCacheDevice::UpdateEntry(nsCacheEntry *entry) {
   nsCString metaDataBuf;
   uint32_t mdSize = entry->MetaDataSize();
   if (!metaDataBuf.SetLength(mdSize, fallible)) return NS_ERROR_OUT_OF_MEMORY;
-  char *md = metaDataBuf.BeginWriting();
+  char* md = metaDataBuf.BeginWriting();
   entry->FlattenMetaData(md, mdSize);
 
   nsOfflineCacheRecord rec;
-  rec.metaData = (const uint8_t *)md;
+  rec.metaData = (const uint8_t*)md;
   rec.metaDataLen = mdSize;
   rec.dataSize = entry->DataSize();
   rec.fetchCount = entry->FetchCount();
@@ -961,7 +961,7 @@ nsresult nsOfflineCacheDevice::UpdateEntry(nsCacheEntry *entry) {
   return rv;
 }
 
-nsresult nsOfflineCacheDevice::UpdateEntrySize(nsCacheEntry *entry,
+nsresult nsOfflineCacheDevice::UpdateEntrySize(nsCacheEntry* entry,
                                                uint32_t newSize) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
@@ -992,7 +992,7 @@ nsresult nsOfflineCacheDevice::UpdateEntrySize(nsCacheEntry *entry,
   return rv;
 }
 
-nsresult nsOfflineCacheDevice::DeleteEntry(nsCacheEntry *entry,
+nsresult nsOfflineCacheDevice::DeleteEntry(nsCacheEntry* entry,
                                            bool deleteData) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
@@ -1022,8 +1022,8 @@ nsresult nsOfflineCacheDevice::DeleteEntry(nsCacheEntry *entry,
   return rv;
 }
 
-nsresult nsOfflineCacheDevice::DeleteData(nsCacheEntry *entry) {
-  nsOfflineCacheBinding *binding = (nsOfflineCacheBinding *)entry->Data();
+nsresult nsOfflineCacheDevice::DeleteData(nsCacheEntry* entry) {
+  nsOfflineCacheBinding* binding = (nsOfflineCacheBinding*)entry->Data();
   NS_ENSURE_STATE(binding);
 
   return binding->mDataFile->Remove(false);
@@ -1037,9 +1037,9 @@ nsresult nsOfflineCacheDevice::DeleteData(nsCacheEntry *entry) {
 // allow a template (mozilla::ArrayLength) to be instantiated based on a local
 // type.  Boo-urns!
 struct StatementSql {
-  nsCOMPtr &statement;
-  const char *sql;
-  StatementSql(nsCOMPtr &aStatement, const char *aSql)
+  nsCOMPtr& statement;
+  const char* sql;
+  StatementSql(nsCOMPtr& aStatement, const char* aSql)
       : statement(aStatement), sql(aSql) {}
 };
 
@@ -1048,7 +1048,7 @@ nsresult nsOfflineCacheDevice::Init() {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-nsresult nsOfflineCacheDevice::InitWithSqlite(mozIStorageService *ss) {
+nsresult nsOfflineCacheDevice::InitWithSqlite(mozIStorageService* ss) {
   NS_ENSURE_TRUE(!mDB, NS_ERROR_ALREADY_INITIALIZED);
 
   // SetCacheParentDirectory must have been called
@@ -1224,7 +1224,7 @@ nsresult nsOfflineCacheDevice::InitWithSqlite(mozIStorageService *ss) {
 
 namespace {
 
-nsresult GetGroupForCache(const nsACString &clientID, nsCString &group) {
+nsresult GetGroupForCache(const nsACString& clientID, nsCString& group) {
   group.Assign(clientID);
   group.Truncate(group.FindChar('|'));
   NS_UnescapeURL(group);
@@ -1236,8 +1236,8 @@ nsresult GetGroupForCache(const nsACString &clientID, nsCString &group) {
 
 // static
 nsresult nsOfflineCacheDevice::BuildApplicationCacheGroupID(
-    nsIURI *aManifestURL, nsACString const &aOriginSuffix,
-    nsACString &_result) {
+    nsIURI* aManifestURL, nsACString const& aOriginSuffix,
+    nsACString& _result) {
   nsCOMPtr newURI;
   nsresult rv =
       NS_GetURIWithNewRef(aManifestURL, EmptyCString(), getter_AddRefs(newURI));
@@ -1289,7 +1289,7 @@ nsresult nsOfflineCacheDevice::Shutdown() {
     for (auto iter = mCaches.Iter(); !iter.Done(); iter.Next()) {
       nsCOMPtr obj = do_QueryReferent(iter.UserData());
       if (obj) {
-        auto appCache = static_cast(obj.get());
+        auto appCache = static_cast(obj.get());
         appCache->MarkInvalid();
       }
     }
@@ -1370,12 +1370,12 @@ nsresult nsOfflineCacheDevice::Shutdown() {
   return NS_OK;
 }
 
-const char *nsOfflineCacheDevice::GetDeviceID() {
+const char* nsOfflineCacheDevice::GetDeviceID() {
   return OFFLINE_CACHE_DEVICE_ID;
 }
 
-nsCacheEntry *nsOfflineCacheDevice::FindEntry(nsCString *fullKey,
-                                              bool *collision) {
+nsCacheEntry* nsOfflineCacheDevice::FindEntry(nsCString* fullKey,
+                                              bool* collision) {
   NS_ENSURE_TRUE(Initialized(), nullptr);
 
   mozilla::Telemetry::AutoTimer
@@ -1401,8 +1401,7 @@ nsCacheEntry *nsOfflineCacheDevice::FindEntry(nsCString *fullKey,
   if (NS_FAILED(rv) || !hasRows) return nullptr;  // entry not found
 
   nsOfflineCacheRecord rec;
-  statement->GetSharedBlob(0, &rec.metaDataLen,
-                           (const uint8_t **)&rec.metaData);
+  statement->GetSharedBlob(0, &rec.metaDataLen, (const uint8_t**)&rec.metaData);
   rec.generation = statement->AsInt32(1);
   rec.dataSize = statement->AsInt32(2);
   rec.fetchCount = statement->AsInt32(3);
@@ -1414,11 +1413,11 @@ nsCacheEntry *nsOfflineCacheDevice::FindEntry(nsCString *fullKey,
        rec.metaDataLen, rec.generation, rec.dataSize, rec.fetchCount,
        rec.lastFetched, rec.lastModified, rec.expirationTime));
 
-  nsCacheEntry *entry = CreateCacheEntry(this, fullKey, rec);
+  nsCacheEntry* entry = CreateCacheEntry(this, fullKey, rec);
 
   if (entry) {
     // make sure that the data file exists
-    nsOfflineCacheBinding *binding = (nsOfflineCacheBinding *)entry->Data();
+    nsOfflineCacheBinding* binding = (nsOfflineCacheBinding*)entry->Data();
     bool isFile;
     rv = binding->mDataFile->IsFile(&isFile);
     if (NS_FAILED(rv) || !isFile) {
@@ -1434,7 +1433,7 @@ nsCacheEntry *nsOfflineCacheDevice::FindEntry(nsCString *fullKey,
   return entry;
 }
 
-nsresult nsOfflineCacheDevice::DeactivateEntry(nsCacheEntry *entry) {
+nsresult nsOfflineCacheDevice::DeactivateEntry(nsCacheEntry* entry) {
   LOG(("nsOfflineCacheDevice::DeactivateEntry [key=%s]\n",
        entry->Key()->get()));
 
@@ -1449,7 +1448,7 @@ nsresult nsOfflineCacheDevice::DeactivateEntry(nsCacheEntry *entry) {
     // that happened.  otherwise, all we have to do here is delete the file
     // on disk.
     DeleteData(entry);
-  } else if (((nsOfflineCacheBinding *)entry->Data())->IsNewEntry()) {
+  } else if (((nsOfflineCacheBinding*)entry->Data())->IsNewEntry()) {
     // UPDATE the database row
 
     // Only new entries are updated, since offline cache is updated in
@@ -1472,7 +1471,7 @@ nsresult nsOfflineCacheDevice::DeactivateEntry(nsCacheEntry *entry) {
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::BindEntry(nsCacheEntry *entry) {
+nsresult nsOfflineCacheDevice::BindEntry(nsCacheEntry* entry) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   LOG(("nsOfflineCacheDevice::BindEntry [key=%s]\n", entry->Key()->get()));
@@ -1565,7 +1564,7 @@ nsresult nsOfflineCacheDevice::BindEntry(nsCacheEntry *entry) {
   return NS_OK;
 }
 
-void nsOfflineCacheDevice::DoomEntry(nsCacheEntry *entry) {
+void nsOfflineCacheDevice::DoomEntry(nsCacheEntry* entry) {
   LOG(("nsOfflineCacheDevice::DoomEntry [key=%s]\n", entry->Key()->get()));
 
   // This method is called to inform us that we should mark the entry to be
@@ -1580,8 +1579,8 @@ void nsOfflineCacheDevice::DoomEntry(nsCacheEntry *entry) {
 }
 
 nsresult nsOfflineCacheDevice::OpenInputStreamForEntry(
-    nsCacheEntry *entry, nsCacheAccessMode mode, uint32_t offset,
-    nsIInputStream **result) {
+    nsCacheEntry* entry, nsCacheAccessMode mode, uint32_t offset,
+    nsIInputStream** result) {
   LOG(("nsOfflineCacheDevice::OpenInputStreamForEntry [key=%s]\n",
        entry->Key()->get()));
 
@@ -1592,7 +1591,7 @@ nsresult nsOfflineCacheDevice::OpenInputStreamForEntry(
   // return an input stream to the entry's data file.  the stream
   // may be read on a background thread.
 
-  nsOfflineCacheBinding *binding = (nsOfflineCacheBinding *)entry->Data();
+  nsOfflineCacheBinding* binding = (nsOfflineCacheBinding*)entry->Data();
   NS_ENSURE_STATE(binding);
 
   nsCOMPtr in;
@@ -1612,8 +1611,8 @@ nsresult nsOfflineCacheDevice::OpenInputStreamForEntry(
 }
 
 nsresult nsOfflineCacheDevice::OpenOutputStreamForEntry(
-    nsCacheEntry *entry, nsCacheAccessMode mode, uint32_t offset,
-    nsIOutputStream **result) {
+    nsCacheEntry* entry, nsCacheAccessMode mode, uint32_t offset,
+    nsIOutputStream** result) {
   LOG(("nsOfflineCacheDevice::OpenOutputStreamForEntry [key=%s]\n",
        entry->Key()->get()));
 
@@ -1624,7 +1623,7 @@ nsresult nsOfflineCacheDevice::OpenOutputStreamForEntry(
   // return an output stream to the entry's data file.  we can assume
   // that the output stream will only be used on the main thread.
 
-  nsOfflineCacheBinding *binding = (nsOfflineCacheBinding *)entry->Data();
+  nsOfflineCacheBinding* binding = (nsOfflineCacheBinding*)entry->Data();
   NS_ENSURE_STATE(binding);
 
   nsCOMPtr out;
@@ -1649,19 +1648,19 @@ nsresult nsOfflineCacheDevice::OpenOutputStreamForEntry(
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::GetFileForEntry(nsCacheEntry *entry,
-                                               nsIFile **result) {
+nsresult nsOfflineCacheDevice::GetFileForEntry(nsCacheEntry* entry,
+                                               nsIFile** result) {
   LOG(("nsOfflineCacheDevice::GetFileForEntry [key=%s]\n",
        entry->Key()->get()));
 
-  nsOfflineCacheBinding *binding = (nsOfflineCacheBinding *)entry->Data();
+  nsOfflineCacheBinding* binding = (nsOfflineCacheBinding*)entry->Data();
   NS_ENSURE_STATE(binding);
 
   NS_IF_ADDREF(*result = binding->mDataFile);
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::OnDataSizeChange(nsCacheEntry *entry,
+nsresult nsOfflineCacheDevice::OnDataSizeChange(nsCacheEntry* entry,
                                                 int32_t deltaSize) {
   LOG(("nsOfflineCacheDevice::OnDataSizeChange [key=%s delta=%d]\n",
        entry->Key()->get(), deltaSize));
@@ -1696,7 +1695,7 @@ nsresult nsOfflineCacheDevice::OnDataSizeChange(nsCacheEntry *entry,
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::Visit(nsICacheVisitor *visitor) {
+nsresult nsOfflineCacheDevice::Visit(nsICacheVisitor* visitor) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   // called to enumerate the offline cache.
@@ -1731,7 +1730,7 @@ nsresult nsOfflineCacheDevice::Visit(nsICacheVisitor *visitor) {
     statement->GetSharedUTF8String(0, nullptr, &rec.clientID);
     statement->GetSharedUTF8String(1, nullptr, &rec.key);
     statement->GetSharedBlob(2, &rec.metaDataLen,
-                             (const uint8_t **)&rec.metaData);
+                             (const uint8_t**)&rec.metaData);
     rec.generation = statement->AsInt32(3);
     rec.dataSize = statement->AsInt32(4);
     rec.fetchCount = statement->AsInt32(5);
@@ -1748,7 +1747,7 @@ nsresult nsOfflineCacheDevice::Visit(nsICacheVisitor *visitor) {
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::EvictEntries(const char *clientID) {
+nsresult nsOfflineCacheDevice::EvictEntries(const char* clientID) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   LOG(("nsOfflineCacheDevice::EvictEntries [cid=%s]\n",
@@ -1835,8 +1834,8 @@ nsresult nsOfflineCacheDevice::EvictEntries(const char *clientID) {
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::MarkEntry(const nsCString &clientID,
-                                         const nsACString &key,
+nsresult nsOfflineCacheDevice::MarkEntry(const nsCString& clientID,
+                                         const nsACString& key,
                                          uint32_t typeBits) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
@@ -1857,8 +1856,8 @@ nsresult nsOfflineCacheDevice::MarkEntry(const nsCString &clientID,
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::UnmarkEntry(const nsCString &clientID,
-                                           const nsACString &key,
+nsresult nsOfflineCacheDevice::UnmarkEntry(const nsCString& clientID,
+                                           const nsACString& key,
                                            uint32_t typeBits) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
@@ -1895,8 +1894,8 @@ nsresult nsOfflineCacheDevice::UnmarkEntry(const nsCString &clientID,
 }
 
 nsresult nsOfflineCacheDevice::GetMatchingNamespace(
-    const nsCString &clientID, const nsACString &key,
-    nsIApplicationCacheNamespace **out) {
+    const nsCString& clientID, const nsACString& key,
+    nsIApplicationCacheNamespace** out) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   LOG(("nsOfflineCacheDevice::GetMatchingNamespace [cid=%s, key=%s]\n",
@@ -1956,17 +1955,17 @@ nsresult nsOfflineCacheDevice::GetMatchingNamespace(
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::CacheOpportunistically(const nsCString &clientID,
-                                                      const nsACString &key) {
+nsresult nsOfflineCacheDevice::CacheOpportunistically(const nsCString& clientID,
+                                                      const nsACString& key) {
   // XXX: We should also be propagating this cache entry to other matching
   // caches.  See bug 444807.
 
   return MarkEntry(clientID, key, nsIApplicationCache::ITEM_OPPORTUNISTIC);
 }
 
-nsresult nsOfflineCacheDevice::GetTypes(const nsCString &clientID,
-                                        const nsACString &key,
-                                        uint32_t *typeBits) {
+nsresult nsOfflineCacheDevice::GetTypes(const nsCString& clientID,
+                                        const nsACString& key,
+                                        uint32_t* typeBits) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   LOG(("nsOfflineCacheDevice::GetTypes [cid=%s, key=%s]\n", clientID.get(),
@@ -1989,9 +1988,9 @@ nsresult nsOfflineCacheDevice::GetTypes(const nsCString &clientID,
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::GatherEntries(const nsCString &clientID,
-                                             uint32_t typeBits, uint32_t *count,
-                                             char ***keys) {
+nsresult nsOfflineCacheDevice::GatherEntries(const nsCString& clientID,
+                                             uint32_t typeBits, uint32_t* count,
+                                             char*** keys) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   LOG(("nsOfflineCacheDevice::GatherEntries [cid=%s, typeBits=%X]\n",
@@ -2007,8 +2006,8 @@ nsresult nsOfflineCacheDevice::GatherEntries(const nsCString &clientID,
   return RunSimpleQuery(mStatement_GatherEntries, 0, count, keys);
 }
 
-nsresult nsOfflineCacheDevice::AddNamespace(const nsCString &clientID,
-                                            nsIApplicationCacheNamespace *ns) {
+nsresult nsOfflineCacheDevice::AddNamespace(const nsCString& clientID,
+                                            nsIApplicationCacheNamespace* ns) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   nsCString namespaceSpec;
@@ -2046,8 +2045,8 @@ nsresult nsOfflineCacheDevice::AddNamespace(const nsCString &clientID,
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::GetUsage(const nsACString &clientID,
-                                        uint32_t *usage) {
+nsresult nsOfflineCacheDevice::GetUsage(const nsACString& clientID,
+                                        uint32_t* usage) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   LOG(("nsOfflineCacheDevice::GetUsage [cid=%s]\n",
@@ -2071,7 +2070,7 @@ nsresult nsOfflineCacheDevice::GetUsage(const nsACString &clientID,
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::GetGroups(uint32_t *count, char ***keys) {
+nsresult nsOfflineCacheDevice::GetGroups(uint32_t* count, char*** keys) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   LOG(("nsOfflineCacheDevice::GetGroups"));
@@ -2079,8 +2078,8 @@ nsresult nsOfflineCacheDevice::GetGroups(uint32_t *count, char ***keys) {
   return RunSimpleQuery(mStatement_EnumerateGroups, 0, count, keys);
 }
 
-nsresult nsOfflineCacheDevice::GetGroupsTimeOrdered(uint32_t *count,
-                                                    char ***keys) {
+nsresult nsOfflineCacheDevice::GetGroupsTimeOrdered(uint32_t* count,
+                                                    char*** keys) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   LOG(("nsOfflineCacheDevice::GetGroupsTimeOrder"));
@@ -2088,24 +2087,24 @@ nsresult nsOfflineCacheDevice::GetGroupsTimeOrdered(uint32_t *count,
   return RunSimpleQuery(mStatement_EnumerateGroupsTimeOrder, 0, count, keys);
 }
 
-bool nsOfflineCacheDevice::IsLocked(const nsACString &key) {
+bool nsOfflineCacheDevice::IsLocked(const nsACString& key) {
   MutexAutoLock lock(mLock);
   return mLockedEntries.GetEntry(key);
 }
 
-void nsOfflineCacheDevice::Lock(const nsACString &key) {
+void nsOfflineCacheDevice::Lock(const nsACString& key) {
   MutexAutoLock lock(mLock);
   mLockedEntries.PutEntry(key);
 }
 
-void nsOfflineCacheDevice::Unlock(const nsACString &key) {
+void nsOfflineCacheDevice::Unlock(const nsACString& key) {
   MutexAutoLock lock(mLock);
   mLockedEntries.RemoveEntry(key);
 }
 
-nsresult nsOfflineCacheDevice::RunSimpleQuery(mozIStorageStatement *statement,
+nsresult nsOfflineCacheDevice::RunSimpleQuery(mozIStorageStatement* statement,
                                               uint32_t resultIndex,
-                                              uint32_t *count, char ***values) {
+                                              uint32_t* count, char*** values) {
   bool hasRows;
   nsresult rv = statement->ExecuteStep(&hasRows);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -2121,7 +2120,7 @@ nsresult nsOfflineCacheDevice::RunSimpleQuery(mozIStorageStatement *statement,
   }
 
   *count = valArray.Length();
-  char **ret = static_cast(moz_xmalloc(*count * sizeof(char *)));
+  char** ret = static_cast(moz_xmalloc(*count * sizeof(char*)));
 
   for (uint32_t i = 0; i < *count; i++) {
     ret[i] = NS_xstrdup(valArray[i].get());
@@ -2133,7 +2132,7 @@ nsresult nsOfflineCacheDevice::RunSimpleQuery(mozIStorageStatement *statement,
 }
 
 nsresult nsOfflineCacheDevice::CreateApplicationCache(
-    const nsACString &group, nsIApplicationCache **out) {
+    const nsACString& group, nsIApplicationCache** out) {
   *out = nullptr;
 
   nsCString clientID;
@@ -2165,14 +2164,14 @@ nsresult nsOfflineCacheDevice::CreateApplicationCache(
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::GetApplicationCache(const nsACString &clientID,
-                                                   nsIApplicationCache **out) {
+nsresult nsOfflineCacheDevice::GetApplicationCache(const nsACString& clientID,
+                                                   nsIApplicationCache** out) {
   MutexAutoLock lock(mLock);
   return GetApplicationCache_Unlocked(clientID, out);
 }
 
 nsresult nsOfflineCacheDevice::GetApplicationCache_Unlocked(
-    const nsACString &clientID, nsIApplicationCache **out) {
+    const nsACString& clientID, nsIApplicationCache** out) {
   *out = nullptr;
 
   nsCOMPtr cache;
@@ -2202,23 +2201,23 @@ nsresult nsOfflineCacheDevice::GetApplicationCache_Unlocked(
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::GetActiveCache(const nsACString &group,
-                                              nsIApplicationCache **out) {
+nsresult nsOfflineCacheDevice::GetActiveCache(const nsACString& group,
+                                              nsIApplicationCache** out) {
   *out = nullptr;
 
   MutexAutoLock lock(mLock);
 
-  nsCString *clientID;
+  nsCString* clientID;
   if (mActiveCachesByGroup.Get(group, &clientID))
     return GetApplicationCache_Unlocked(*clientID, out);
 
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::DeactivateGroup(const nsACString &group) {
+nsresult nsOfflineCacheDevice::DeactivateGroup(const nsACString& group) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
-  nsCString *active = nullptr;
+  nsCString* active = nullptr;
 
   AutoResetStatement statement(mStatement_DeactivateGroup);
   nsresult rv = statement->BindUTF8StringByIndex(0, group);
@@ -2238,14 +2237,14 @@ nsresult nsOfflineCacheDevice::DeactivateGroup(const nsACString &group) {
   return NS_OK;
 }
 
-nsresult nsOfflineCacheDevice::Evict(nsILoadContextInfo *aInfo) {
+nsresult nsOfflineCacheDevice::Evict(nsILoadContextInfo* aInfo) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   NS_ENSURE_ARG(aInfo);
 
   nsresult rv;
 
-  mozilla::OriginAttributes const *oa = aInfo->OriginAttributesPtr();
+  mozilla::OriginAttributes const* oa = aInfo->OriginAttributesPtr();
 
   if (oa->mInIsolatedMozBrowser == false) {
     nsCOMPtr serv = do_GetService(kCacheServiceCID, &rv);
@@ -2301,15 +2300,15 @@ class OriginMatch final : public mozIStorageFunction {
 
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGEFUNCTION
-  explicit OriginMatch(mozilla::OriginAttributesPattern const &aPattern)
+  explicit OriginMatch(mozilla::OriginAttributesPattern const& aPattern)
       : mPattern(aPattern) {}
 };
 
 NS_IMPL_ISUPPORTS(OriginMatch, mozIStorageFunction)
 
 NS_IMETHODIMP
-OriginMatch::OnFunctionCall(mozIStorageValueArray *aFunctionArguments,
-                            nsIVariant **aResult) {
+OriginMatch::OnFunctionCall(mozIStorageValueArray* aFunctionArguments,
+                            nsIVariant** aResult) {
   nsresult rv;
 
   nsAutoCString groupId;
@@ -2344,7 +2343,7 @@ OriginMatch::OnFunctionCall(mozIStorageValueArray *aFunctionArguments,
 }  // namespace
 
 nsresult nsOfflineCacheDevice::Evict(
-    mozilla::OriginAttributesPattern const &aPattern) {
+    mozilla::OriginAttributesPattern const& aPattern) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   nsresult rv;
@@ -2355,8 +2354,8 @@ nsresult nsOfflineCacheDevice::Evict(
 
   class AutoRemoveFunc {
    public:
-    mozIStorageConnection *mDB;
-    explicit AutoRemoveFunc(mozIStorageConnection *aDB) : mDB(aDB) {}
+    mozIStorageConnection* mDB;
+    explicit AutoRemoveFunc(mozIStorageConnection* aDB) : mDB(aDB) {}
     ~AutoRemoveFunc() {
       mDB->RemoveFunction(NS_LITERAL_CSTRING("ORIGIN_MATCH"));
     }
@@ -2398,9 +2397,9 @@ nsresult nsOfflineCacheDevice::Evict(
   return NS_OK;
 }
 
-bool nsOfflineCacheDevice::CanUseCache(nsIURI *keyURI,
-                                       const nsACString &clientID,
-                                       nsILoadContextInfo *loadContextInfo) {
+bool nsOfflineCacheDevice::CanUseCache(nsIURI* keyURI,
+                                       const nsACString& clientID,
+                                       nsILoadContextInfo* loadContextInfo) {
   {
     MutexAutoLock lock(mLock);
     if (!mActiveCaches.Contains(clientID)) return false;
@@ -2445,8 +2444,8 @@ bool nsOfflineCacheDevice::CanUseCache(nsIURI *keyURI,
 }
 
 nsresult nsOfflineCacheDevice::ChooseApplicationCache(
-    const nsACString &key, nsILoadContextInfo *loadContextInfo,
-    nsIApplicationCache **out) {
+    const nsACString& key, nsILoadContextInfo* loadContextInfo,
+    nsIApplicationCache** out) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   NS_ENSURE_ARG(loadContextInfo);
@@ -2522,7 +2521,7 @@ nsresult nsOfflineCacheDevice::ChooseApplicationCache(
 }
 
 nsresult nsOfflineCacheDevice::CacheOpportunistically(
-    nsIApplicationCache *cache, const nsACString &key) {
+    nsIApplicationCache* cache, const nsACString& key) {
   NS_ENSURE_ARG_POINTER(cache);
 
   nsresult rv;
@@ -2534,8 +2533,8 @@ nsresult nsOfflineCacheDevice::CacheOpportunistically(
   return CacheOpportunistically(clientID, key);
 }
 
-nsresult nsOfflineCacheDevice::ActivateCache(const nsACString &group,
-                                             const nsACString &clientID) {
+nsresult nsOfflineCacheDevice::ActivateCache(const nsACString& group,
+                                             const nsACString& clientID) {
   NS_ENSURE_TRUE(Initialized(), NS_ERROR_NOT_INITIALIZED);
 
   AutoResetStatement statement(mStatement_ActivateClient);
@@ -2551,7 +2550,7 @@ nsresult nsOfflineCacheDevice::ActivateCache(const nsACString &group,
 
   MutexAutoLock lock(mLock);
 
-  nsCString *active;
+  nsCString* active;
   if (mActiveCachesByGroup.Get(group, &active)) {
     mActiveCaches.RemoveEntry(*active);
     mActiveCachesByGroup.Remove(group);
@@ -2566,9 +2565,9 @@ nsresult nsOfflineCacheDevice::ActivateCache(const nsACString &group,
   return NS_OK;
 }
 
-bool nsOfflineCacheDevice::IsActiveCache(const nsACString &group,
-                                         const nsACString &clientID) {
-  nsCString *active = nullptr;
+bool nsOfflineCacheDevice::IsActiveCache(const nsACString& group,
+                                         const nsACString& clientID) {
+  nsCString* active = nullptr;
   MutexAutoLock lock(mLock);
   return mActiveCachesByGroup.Get(group, &active) && *active == clientID;
 }
@@ -2577,7 +2576,7 @@ bool nsOfflineCacheDevice::IsActiveCache(const nsACString &group,
  * Preference accessors
  */
 
-void nsOfflineCacheDevice::SetCacheParentDirectory(nsIFile *parentDir) {
+void nsOfflineCacheDevice::SetCacheParentDirectory(nsIFile* parentDir) {
   if (Initialized()) {
     NS_ERROR("cannot switch cache directory once initialized");
     return;
@@ -2611,7 +2610,7 @@ void nsOfflineCacheDevice::SetCapacity(uint32_t capacity) {
   mCacheCapacity = capacity * 1024;
 }
 
-bool nsOfflineCacheDevice::AutoShutdown(nsIApplicationCache *aAppCache) {
+bool nsOfflineCacheDevice::AutoShutdown(nsIApplicationCache* aAppCache) {
   if (!mAutoShutdown) return false;
 
   mAutoShutdown = false;
diff --git a/netwerk/cache/nsDiskCacheDeviceSQL.h b/netwerk/cache/nsDiskCacheDeviceSQL.h
index 106b2eaea71ef..2ed4e59daeca8 100644
--- a/netwerk/cache/nsDiskCacheDeviceSQL.h
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.h
@@ -50,7 +50,7 @@ class nsOfflineCacheEvictionFunction final : public mozIStorageFunction {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_MOZISTORAGEFUNCTION
 
-  explicit nsOfflineCacheEvictionFunction(nsOfflineCacheDevice *device);
+  explicit nsOfflineCacheEvictionFunction(nsOfflineCacheDevice* device);
 
   void Init();
   void Reset();
@@ -59,7 +59,7 @@ class nsOfflineCacheEvictionFunction final : public mozIStorageFunction {
  private:
   ~nsOfflineCacheEvictionFunction() = default;
 
-  nsOfflineCacheDevice *mDevice;
+  nsOfflineCacheDevice* mDevice;
   bool mTLSInited;
 };
 
@@ -74,105 +74,105 @@ class nsOfflineCacheDevice final : public nsCacheDevice, public nsISupports {
    */
 
   virtual nsresult Init() override;
-  nsresult InitWithSqlite(mozIStorageService *ss);
+  nsresult InitWithSqlite(mozIStorageService* ss);
   virtual nsresult Shutdown() override;
 
-  virtual const char *GetDeviceID(void) override;
-  virtual nsCacheEntry *FindEntry(nsCString *key, bool *collision) override;
-  virtual nsresult DeactivateEntry(nsCacheEntry *entry) override;
-  virtual nsresult BindEntry(nsCacheEntry *entry) override;
-  virtual void DoomEntry(nsCacheEntry *entry) override;
+  virtual const char* GetDeviceID(void) override;
+  virtual nsCacheEntry* FindEntry(nsCString* key, bool* collision) override;
+  virtual nsresult DeactivateEntry(nsCacheEntry* entry) override;
+  virtual nsresult BindEntry(nsCacheEntry* entry) override;
+  virtual void DoomEntry(nsCacheEntry* entry) override;
 
-  virtual nsresult OpenInputStreamForEntry(nsCacheEntry *entry,
+  virtual nsresult OpenInputStreamForEntry(nsCacheEntry* entry,
                                            nsCacheAccessMode mode,
                                            uint32_t offset,
-                                           nsIInputStream **result) override;
+                                           nsIInputStream** result) override;
 
-  virtual nsresult OpenOutputStreamForEntry(nsCacheEntry *entry,
+  virtual nsresult OpenOutputStreamForEntry(nsCacheEntry* entry,
                                             nsCacheAccessMode mode,
                                             uint32_t offset,
-                                            nsIOutputStream **result) override;
+                                            nsIOutputStream** result) override;
 
-  virtual nsresult GetFileForEntry(nsCacheEntry *entry,
-                                   nsIFile **result) override;
+  virtual nsresult GetFileForEntry(nsCacheEntry* entry,
+                                   nsIFile** result) override;
 
-  virtual nsresult OnDataSizeChange(nsCacheEntry *entry,
+  virtual nsresult OnDataSizeChange(nsCacheEntry* entry,
                                     int32_t deltaSize) override;
 
-  virtual nsresult Visit(nsICacheVisitor *visitor) override;
+  virtual nsresult Visit(nsICacheVisitor* visitor) override;
 
-  virtual nsresult EvictEntries(const char *clientID) override;
+  virtual nsresult EvictEntries(const char* clientID) override;
 
   /* Entry ownership */
-  nsresult GetOwnerDomains(const char *clientID, uint32_t *count,
-                           char ***domains);
-  nsresult GetOwnerURIs(const char *clientID, const nsACString &ownerDomain,
-                        uint32_t *count, char ***uris);
-  nsresult SetOwnedKeys(const char *clientID, const nsACString &ownerDomain,
-                        const nsACString &ownerUrl, uint32_t count,
-                        const char **keys);
-  nsresult GetOwnedKeys(const char *clientID, const nsACString &ownerDomain,
-                        const nsACString &ownerUrl, uint32_t *count,
-                        char ***keys);
-  nsresult AddOwnedKey(const char *clientID, const nsACString &ownerDomain,
-                       const nsACString &ownerURI, const nsACString &key);
-  nsresult RemoveOwnedKey(const char *clientID, const nsACString &ownerDomain,
-                          const nsACString &ownerURI, const nsACString &key);
-  nsresult KeyIsOwned(const char *clientID, const nsACString &ownerDomain,
-                      const nsACString &ownerURI, const nsACString &key,
-                      bool *isOwned);
-
-  nsresult ClearKeysOwnedByDomain(const char *clientID,
-                                  const nsACString &ownerDomain);
-  nsresult EvictUnownedEntries(const char *clientID);
-
-  static nsresult BuildApplicationCacheGroupID(nsIURI *aManifestURL,
-                                               nsACString const &aOriginSuffix,
-                                               nsACString &_result);
-
-  nsresult ActivateCache(const nsACString &group, const nsACString &clientID);
-  bool IsActiveCache(const nsACString &group, const nsACString &clientID);
-  nsresult CreateApplicationCache(const nsACString &group,
-                                  nsIApplicationCache **out);
-
-  nsresult GetApplicationCache(const nsACString &clientID,
-                               nsIApplicationCache **out);
-  nsresult GetApplicationCache_Unlocked(const nsACString &clientID,
-                                        nsIApplicationCache **out);
-
-  nsresult GetActiveCache(const nsACString &group, nsIApplicationCache **out);
-
-  nsresult DeactivateGroup(const nsACString &group);
-
-  nsresult ChooseApplicationCache(const nsACString &key,
-                                  nsILoadContextInfo *loadContext,
-                                  nsIApplicationCache **out);
-
-  nsresult CacheOpportunistically(nsIApplicationCache *cache,
-                                  const nsACString &key);
-
-  nsresult Evict(nsILoadContextInfo *aInfo);
-  nsresult Evict(mozilla::OriginAttributesPattern const &aPattern);
-
-  nsresult GetGroups(uint32_t *count, char ***keys);
-
-  nsresult GetGroupsTimeOrdered(uint32_t *count, char ***keys);
-
-  bool IsLocked(const nsACString &key);
-  void Lock(const nsACString &key);
-  void Unlock(const nsACString &key);
+  nsresult GetOwnerDomains(const char* clientID, uint32_t* count,
+                           char*** domains);
+  nsresult GetOwnerURIs(const char* clientID, const nsACString& ownerDomain,
+                        uint32_t* count, char*** uris);
+  nsresult SetOwnedKeys(const char* clientID, const nsACString& ownerDomain,
+                        const nsACString& ownerUrl, uint32_t count,
+                        const char** keys);
+  nsresult GetOwnedKeys(const char* clientID, const nsACString& ownerDomain,
+                        const nsACString& ownerUrl, uint32_t* count,
+                        char*** keys);
+  nsresult AddOwnedKey(const char* clientID, const nsACString& ownerDomain,
+                       const nsACString& ownerURI, const nsACString& key);
+  nsresult RemoveOwnedKey(const char* clientID, const nsACString& ownerDomain,
+                          const nsACString& ownerURI, const nsACString& key);
+  nsresult KeyIsOwned(const char* clientID, const nsACString& ownerDomain,
+                      const nsACString& ownerURI, const nsACString& key,
+                      bool* isOwned);
+
+  nsresult ClearKeysOwnedByDomain(const char* clientID,
+                                  const nsACString& ownerDomain);
+  nsresult EvictUnownedEntries(const char* clientID);
+
+  static nsresult BuildApplicationCacheGroupID(nsIURI* aManifestURL,
+                                               nsACString const& aOriginSuffix,
+                                               nsACString& _result);
+
+  nsresult ActivateCache(const nsACString& group, const nsACString& clientID);
+  bool IsActiveCache(const nsACString& group, const nsACString& clientID);
+  nsresult CreateApplicationCache(const nsACString& group,
+                                  nsIApplicationCache** out);
+
+  nsresult GetApplicationCache(const nsACString& clientID,
+                               nsIApplicationCache** out);
+  nsresult GetApplicationCache_Unlocked(const nsACString& clientID,
+                                        nsIApplicationCache** out);
+
+  nsresult GetActiveCache(const nsACString& group, nsIApplicationCache** out);
+
+  nsresult DeactivateGroup(const nsACString& group);
+
+  nsresult ChooseApplicationCache(const nsACString& key,
+                                  nsILoadContextInfo* loadContext,
+                                  nsIApplicationCache** out);
+
+  nsresult CacheOpportunistically(nsIApplicationCache* cache,
+                                  const nsACString& key);
+
+  nsresult Evict(nsILoadContextInfo* aInfo);
+  nsresult Evict(mozilla::OriginAttributesPattern const& aPattern);
+
+  nsresult GetGroups(uint32_t* count, char*** keys);
+
+  nsresult GetGroupsTimeOrdered(uint32_t* count, char*** keys);
+
+  bool IsLocked(const nsACString& key);
+  void Lock(const nsACString& key);
+  void Unlock(const nsACString& key);
 
   /**
    * Preference accessors
    */
 
-  void SetCacheParentDirectory(nsIFile *parentDir);
+  void SetCacheParentDirectory(nsIFile* parentDir);
   void SetCapacity(uint32_t capacity);
   void SetAutoShutdown() { mAutoShutdown = true; }
-  bool AutoShutdown(nsIApplicationCache *aAppCache);
+  bool AutoShutdown(nsIApplicationCache* aAppCache);
 
-  nsIFile *BaseDirectory() { return mBaseDirectory; }
-  nsIFile *CacheDirectory() { return mCacheDirectory; }
+  nsIFile* BaseDirectory() { return mBaseDirectory; }
+  nsIFile* CacheDirectory() { return mCacheDirectory; }
   uint32_t CacheCapacity() { return mCacheCapacity; }
   uint32_t CacheSize();
   uint32_t EntryCount();
@@ -187,38 +187,38 @@ class nsOfflineCacheDevice final : public nsCacheDevice, public nsISupports {
   bool Initialized() { return mDB != nullptr; }
 
   nsresult InitActiveCaches();
-  nsresult UpdateEntry(nsCacheEntry *entry);
-  nsresult UpdateEntrySize(nsCacheEntry *entry, uint32_t newSize);
-  nsresult DeleteEntry(nsCacheEntry *entry, bool deleteData);
-  nsresult DeleteData(nsCacheEntry *entry);
+  nsresult UpdateEntry(nsCacheEntry* entry);
+  nsresult UpdateEntrySize(nsCacheEntry* entry, uint32_t newSize);
+  nsresult DeleteEntry(nsCacheEntry* entry, bool deleteData);
+  nsresult DeleteData(nsCacheEntry* entry);
   nsresult EnableEvictionObserver();
   nsresult DisableEvictionObserver();
 
-  bool CanUseCache(nsIURI *keyURI, const nsACString &clientID,
-                   nsILoadContextInfo *loadContext);
+  bool CanUseCache(nsIURI* keyURI, const nsACString& clientID,
+                   nsILoadContextInfo* loadContext);
 
-  nsresult MarkEntry(const nsCString &clientID, const nsACString &key,
+  nsresult MarkEntry(const nsCString& clientID, const nsACString& key,
                      uint32_t typeBits);
-  nsresult UnmarkEntry(const nsCString &clientID, const nsACString &key,
+  nsresult UnmarkEntry(const nsCString& clientID, const nsACString& key,
                        uint32_t typeBits);
 
-  nsresult CacheOpportunistically(const nsCString &clientID,
-                                  const nsACString &key);
-  nsresult GetTypes(const nsCString &clientID, const nsACString &key,
-                    uint32_t *typeBits);
+  nsresult CacheOpportunistically(const nsCString& clientID,
+                                  const nsACString& key);
+  nsresult GetTypes(const nsCString& clientID, const nsACString& key,
+                    uint32_t* typeBits);
 
-  nsresult GetMatchingNamespace(const nsCString &clientID,
-                                const nsACString &key,
-                                nsIApplicationCacheNamespace **out);
-  nsresult GatherEntries(const nsCString &clientID, uint32_t typeBits,
-                         uint32_t *count, char ***values);
-  nsresult AddNamespace(const nsCString &clientID,
-                        nsIApplicationCacheNamespace *ns);
+  nsresult GetMatchingNamespace(const nsCString& clientID,
+                                const nsACString& key,
+                                nsIApplicationCacheNamespace** out);
+  nsresult GatherEntries(const nsCString& clientID, uint32_t typeBits,
+                         uint32_t* count, char*** values);
+  nsresult AddNamespace(const nsCString& clientID,
+                        nsIApplicationCacheNamespace* ns);
 
-  nsresult GetUsage(const nsACString &clientID, uint32_t *usage);
+  nsresult GetUsage(const nsACString& clientID, uint32_t* usage);
 
-  nsresult RunSimpleQuery(mozIStorageStatement *statment, uint32_t resultIndex,
-                          uint32_t *count, char ***values);
+  nsresult RunSimpleQuery(mozIStorageStatement* statment, uint32_t resultIndex,
+                          uint32_t* count, char*** values);
 
   nsCOMPtr mDB;
   RefPtr mEvictionFunction;
diff --git a/netwerk/cache2/AppCacheStorage.cpp b/netwerk/cache2/AppCacheStorage.cpp
index 1728bca601cc2..c81258dce4db6 100644
--- a/netwerk/cache2/AppCacheStorage.cpp
+++ b/netwerk/cache2/AppCacheStorage.cpp
@@ -22,8 +22,8 @@
 namespace mozilla {
 namespace net {
 
-AppCacheStorage::AppCacheStorage(nsILoadContextInfo *aInfo,
-                                 nsIApplicationCache *aAppCache)
+AppCacheStorage::AppCacheStorage(nsILoadContextInfo* aInfo,
+                                 nsIApplicationCache* aAppCache)
     : CacheStorage(aInfo, true /* disk */, false /* lookup app cache */,
                    false /* skip size check */, false /* pin */),
       mAppCache(aAppCache) {}
@@ -33,8 +33,8 @@ AppCacheStorage::~AppCacheStorage() {
 }
 
 NS_IMETHODIMP AppCacheStorage::AsyncOpenURI(
-    nsIURI *aURI, const nsACString &aIdExtension, uint32_t aFlags,
-    nsICacheEntryOpenCallback *aCallback) {
+    nsIURI* aURI, const nsACString& aIdExtension, uint32_t aFlags,
+    nsICacheEntryOpenCallback* aCallback) {
   if (!CacheStorageService::Self()) return NS_ERROR_NOT_INITIALIZED;
 
   NS_ENSURE_ARG(aURI);
@@ -86,22 +86,22 @@ NS_IMETHODIMP AppCacheStorage::AsyncOpenURI(
   return NS_OK;
 }
 
-NS_IMETHODIMP AppCacheStorage::OpenTruncate(nsIURI *aURI,
-                                            const nsACString &aIdExtension,
-                                            nsICacheEntry **aCacheEntry) {
+NS_IMETHODIMP AppCacheStorage::OpenTruncate(nsIURI* aURI,
+                                            const nsACString& aIdExtension,
+                                            nsICacheEntry** aCacheEntry) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP AppCacheStorage::Exists(nsIURI *aURI,
-                                      const nsACString &aIdExtension,
-                                      bool *aResult) {
+NS_IMETHODIMP AppCacheStorage::Exists(nsIURI* aURI,
+                                      const nsACString& aIdExtension,
+                                      bool* aResult) {
   *aResult = false;
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP AppCacheStorage::AsyncDoomURI(
-    nsIURI *aURI, const nsACString &aIdExtension,
-    nsICacheEntryDoomCallback *aCallback) {
+    nsIURI* aURI, const nsACString& aIdExtension,
+    nsICacheEntryDoomCallback* aCallback) {
   if (!CacheStorageService::Self()) return NS_ERROR_NOT_INITIALIZED;
 
   if (!mAppCache) {
@@ -114,7 +114,7 @@ NS_IMETHODIMP AppCacheStorage::AsyncDoomURI(
 }
 
 NS_IMETHODIMP AppCacheStorage::AsyncEvictStorage(
-    nsICacheEntryDoomCallback *aCallback) {
+    nsICacheEntryDoomCallback* aCallback) {
   if (!CacheStorageService::Self()) return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv;
@@ -143,7 +143,7 @@ NS_IMETHODIMP AppCacheStorage::AsyncEvictStorage(
 }
 
 NS_IMETHODIMP AppCacheStorage::AsyncVisitStorage(
-    nsICacheStorageVisitor *aVisitor, bool aVisitEntries) {
+    nsICacheStorageVisitor* aVisitor, bool aVisitEntries) {
   if (!CacheStorageService::Self()) return NS_ERROR_NOT_INITIALIZED;
 
   LOG(("AppCacheStorage::AsyncVisitStorage [this=%p, cb=%p]", this, aVisitor));
@@ -163,8 +163,8 @@ NS_IMETHODIMP AppCacheStorage::AsyncVisitStorage(
 }
 
 NS_IMETHODIMP AppCacheStorage::GetCacheIndexEntryAttrs(
-    nsIURI *aURI, const nsACString &aIdExtension, bool *aHasAltData,
-    uint32_t *aSizeInKB) {
+    nsIURI* aURI, const nsACString& aIdExtension, bool* aHasAltData,
+    uint32_t* aSizeInKB) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
diff --git a/netwerk/cache2/CacheEntry.cpp b/netwerk/cache2/CacheEntry.cpp
index 472d83080f10e..82ced7540b888 100644
--- a/netwerk/cache2/CacheEntry.cpp
+++ b/netwerk/cache2/CacheEntry.cpp
@@ -45,7 +45,7 @@ NS_IMPL_ISUPPORTS(CacheEntryHandle, nsICacheEntry)
 
 // CacheEntryHandle
 
-CacheEntryHandle::CacheEntryHandle(CacheEntry *aEntry)
+CacheEntryHandle::CacheEntryHandle(CacheEntry* aEntry)
     : mEntry(aEntry), mClosed(false) {
 #ifdef DEBUG
   if (!mEntry->HandlesCount()) {
@@ -82,8 +82,8 @@ CacheEntryHandle::~CacheEntryHandle() {
 
 // CacheEntry::Callback
 
-CacheEntry::Callback::Callback(CacheEntry *aEntry,
-                               nsICacheEntryOpenCallback *aCallback,
+CacheEntry::Callback::Callback(CacheEntry* aEntry,
+                               nsICacheEntryOpenCallback* aCallback,
                                bool aReadOnly, bool aCheckOnAnyThread,
                                bool aSecret)
     : mEntry(aEntry),
@@ -105,7 +105,7 @@ CacheEntry::Callback::Callback(CacheEntry *aEntry,
   mEntry->AddHandleRef();
 }
 
-CacheEntry::Callback::Callback(CacheEntry *aEntry,
+CacheEntry::Callback::Callback(CacheEntry* aEntry,
                                bool aDoomWhenFoundInPinStatus)
     : mEntry(aEntry),
       mReadOnly(false),
@@ -121,7 +121,7 @@ CacheEntry::Callback::Callback(CacheEntry *aEntry,
   mEntry->AddHandleRef();
 }
 
-CacheEntry::Callback::Callback(CacheEntry::Callback const &aThat)
+CacheEntry::Callback::Callback(CacheEntry::Callback const& aThat)
     : mEntry(aThat.mEntry),
       mCallback(aThat.mCallback),
       mTarget(aThat.mTarget),
@@ -148,7 +148,7 @@ CacheEntry::Callback::~Callback() {
   MOZ_COUNT_DTOR(CacheEntry::Callback);
 }
 
-void CacheEntry::Callback::ExchangeEntry(CacheEntry *aEntry) {
+void CacheEntry::Callback::ExchangeEntry(CacheEntry* aEntry) {
   if (mEntry == aEntry) return;
 
   // The counter may go from zero to non-null only under the service lock
@@ -159,7 +159,7 @@ void CacheEntry::Callback::ExchangeEntry(CacheEntry *aEntry) {
   mEntry = aEntry;
 }
 
-bool CacheEntry::Callback::DeferDoom(bool *aDoom) const {
+bool CacheEntry::Callback::DeferDoom(bool* aDoom) const {
   MOZ_ASSERT(mEntry->mPinningKnown);
 
   if (MOZ_UNLIKELY(mDoomWhenFoundNonPinned) ||
@@ -175,7 +175,7 @@ bool CacheEntry::Callback::DeferDoom(bool *aDoom) const {
   return false;
 }
 
-nsresult CacheEntry::Callback::OnCheckThread(bool *aOnCheckThread) const {
+nsresult CacheEntry::Callback::OnCheckThread(bool* aOnCheckThread) const {
   if (!mCheckOnAnyThread) {
     // Check we are on the target
     return mTarget->IsOnCurrentThread(aOnCheckThread);
@@ -186,7 +186,7 @@ nsresult CacheEntry::Callback::OnCheckThread(bool *aOnCheckThread) const {
   return NS_OK;
 }
 
-nsresult CacheEntry::Callback::OnAvailThread(bool *aOnAvailThread) const {
+nsresult CacheEntry::Callback::OnAvailThread(bool* aOnAvailThread) const {
   return mTarget->IsOnCurrentThread(aOnAvailThread);
 }
 
@@ -200,8 +200,8 @@ uint64_t CacheEntry::GetNextId() {
   return ++id;
 }
 
-CacheEntry::CacheEntry(const nsACString &aStorageID, const nsACString &aURI,
-                       const nsACString &aEnhanceID, bool aUseDisk,
+CacheEntry::CacheEntry(const nsACString& aStorageID, const nsACString& aURI,
+                       const nsACString& aEnhanceID, bool aUseDisk,
                        bool aSkipSizeCheck, bool aPin)
     : mFrecency(0),
       mSortingExpirationTime(uint32_t(-1)),
@@ -233,7 +233,7 @@ CacheEntry::CacheEntry(const nsACString &aStorageID, const nsACString &aURI,
 
 CacheEntry::~CacheEntry() { LOG(("CacheEntry::~CacheEntry [this=%p]", this)); }
 
-char const *CacheEntry::StateString(uint32_t aState) {
+char const* CacheEntry::StateString(uint32_t aState) {
   switch (aState) {
     case NOTLOADED:
       return "NOTLOADED";
@@ -252,18 +252,18 @@ char const *CacheEntry::StateString(uint32_t aState) {
   return "?";
 }
 
-nsresult CacheEntry::HashingKeyWithStorage(nsACString &aResult) const {
+nsresult CacheEntry::HashingKeyWithStorage(nsACString& aResult) const {
   return HashingKey(mStorageID, mEnhanceID, mURI, aResult);
 }
 
-nsresult CacheEntry::HashingKey(nsACString &aResult) const {
+nsresult CacheEntry::HashingKey(nsACString& aResult) const {
   return HashingKey(EmptyCString(), mEnhanceID, mURI, aResult);
 }
 
 // static
-nsresult CacheEntry::HashingKey(const nsACString &aStorageID,
-                                const nsACString &aEnhanceID, nsIURI *aURI,
-                                nsACString &aResult) {
+nsresult CacheEntry::HashingKey(const nsACString& aStorageID,
+                                const nsACString& aEnhanceID, nsIURI* aURI,
+                                nsACString& aResult) {
   nsAutoCString spec;
   nsresult rv = aURI->GetAsciiSpec(spec);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -272,10 +272,10 @@ nsresult CacheEntry::HashingKey(const nsACString &aStorageID,
 }
 
 // static
-nsresult CacheEntry::HashingKey(const nsACString &aStorageID,
-                                const nsACString &aEnhanceID,
-                                const nsACString &aURISpec,
-                                nsACString &aResult) {
+nsresult CacheEntry::HashingKey(const nsACString& aStorageID,
+                                const nsACString& aEnhanceID,
+                                const nsACString& aURISpec,
+                                nsACString& aResult) {
   /**
    * This key is used to salt hash that is a base for disk file name.
    * Changing it will cause we will not be able to find files on disk.
@@ -294,7 +294,7 @@ nsresult CacheEntry::HashingKey(const nsACString &aStorageID,
   return NS_OK;
 }
 
-void CacheEntry::AsyncOpen(nsICacheEntryOpenCallback *aCallback,
+void CacheEntry::AsyncOpen(nsICacheEntryOpenCallback* aCallback,
                            uint32_t aFlags) {
   LOG(("CacheEntry::AsyncOpen [this=%p, state=%s, flags=%d, callback=%p]", this,
        StateString(mState), aFlags, aCallback));
@@ -320,7 +320,7 @@ void CacheEntry::AsyncOpen(nsICacheEntryOpenCallback *aCallback,
   }
 }
 
-bool CacheEntry::Open(Callback &aCallback, bool aTruncate, bool aPriority,
+bool CacheEntry::Open(Callback& aCallback, bool aTruncate, bool aPriority,
                       bool aBypassIfBusy) {
   mozilla::MutexAutoLock lock(mLock);
 
@@ -511,7 +511,7 @@ NS_IMETHODIMP CacheEntry::OnFileDoomed(nsresult aResult) {
 }
 
 already_AddRefed CacheEntry::ReopenTruncated(
-    bool aMemoryOnly, nsICacheEntryOpenCallback *aCallback) {
+    bool aMemoryOnly, nsICacheEntryOpenCallback* aCallback) {
   LOG(("CacheEntry::ReopenTruncated [this=%p]", this));
 
   mLock.AssertCurrentThreadOwns();
@@ -567,7 +567,7 @@ already_AddRefed CacheEntry::ReopenTruncated(
   return writeHandle.forget();
 }
 
-void CacheEntry::TransferCallbacks(CacheEntry &aFromEntry) {
+void CacheEntry::TransferCallbacks(CacheEntry& aFromEntry) {
   mozilla::MutexAutoLock lock(mLock);
 
   LOG(("CacheEntry::TransferCallbacks [entry=%p, from=%p]", this, &aFromEntry));
@@ -587,7 +587,7 @@ void CacheEntry::TransferCallbacks(CacheEntry &aFromEntry) {
   }
 }
 
-void CacheEntry::RememberCallback(Callback &aCallback) {
+void CacheEntry::RememberCallback(Callback& aCallback) {
   mLock.AssertCurrentThreadOwns();
 
   LOG(("CacheEntry::RememberCallback [this=%p, cb=%p, state=%s]", this,
@@ -687,7 +687,7 @@ bool CacheEntry::InvokeCallbacks(bool aReadOnly) {
   return true;
 }
 
-bool CacheEntry::InvokeCallback(Callback &aCallback) {
+bool CacheEntry::InvokeCallback(Callback& aCallback) {
   LOG(("CacheEntry::InvokeCallback [this=%p, state=%s, cb=%p]", this,
        StateString(mState), aCallback.mCallback.get()));
 
@@ -809,7 +809,7 @@ bool CacheEntry::InvokeCallback(Callback &aCallback) {
   return true;
 }
 
-void CacheEntry::InvokeAvailableCallback(Callback const &aCallback) {
+void CacheEntry::InvokeAvailableCallback(Callback const& aCallback) {
   LOG(
       ("CacheEntry::InvokeAvailableCallback [this=%p, state=%s, cb=%p, r/o=%d, "
        "n/w=%d]",
@@ -901,16 +901,16 @@ void CacheEntry::InvokeAvailableCallback(Callback const &aCallback) {
   LOG(("  writing/revalidating"));
 }
 
-void CacheEntry::OnFetched(Callback const &aCallback) {
+void CacheEntry::OnFetched(Callback const& aCallback) {
   if (NS_SUCCEEDED(mFileStatus) && !aCallback.mSecret) {
     // Let the last-fetched and fetch-count properties be updated.
     mFile->OnFetched();
   }
 }
 
-CacheEntryHandle *CacheEntry::NewHandle() { return new CacheEntryHandle(this); }
+CacheEntryHandle* CacheEntry::NewHandle() { return new CacheEntryHandle(this); }
 
-CacheEntryHandle *CacheEntry::NewWriteHandle() {
+CacheEntryHandle* CacheEntry::NewWriteHandle() {
   mozilla::MutexAutoLock lock(mLock);
 
   // Ignore the OPEN_SECRETLY flag on purpose here, which should actually be
@@ -920,7 +920,7 @@ CacheEntryHandle *CacheEntry::NewWriteHandle() {
   return (mWriter = NewHandle());
 }
 
-void CacheEntry::OnHandleClosed(CacheEntryHandle const *aHandle) {
+void CacheEntry::OnHandleClosed(CacheEntryHandle const* aHandle) {
   LOG(("CacheEntry::OnHandleClosed [this=%p, state=%s, handle=%p]", this,
        StateString(mState), aHandle));
 
@@ -1022,7 +1022,7 @@ uint32_t CacheEntry::GetMetadataMemoryConsumption() {
 
 // nsICacheEntry
 
-nsresult CacheEntry::GetPersistent(bool *aPersistToDisk) {
+nsresult CacheEntry::GetPersistent(bool* aPersistToDisk) {
   // No need to sync when only reading.
   // When consumer needs to be consistent with state of the memory storage
   // entries table, then let it use GetUseDisk getter that must be called under
@@ -1031,46 +1031,46 @@ nsresult CacheEntry::GetPersistent(bool *aPersistToDisk) {
   return NS_OK;
 }
 
-nsresult CacheEntry::GetKey(nsACString &aKey) {
+nsresult CacheEntry::GetKey(nsACString& aKey) {
   aKey.Assign(mURI);
   return NS_OK;
 }
 
-nsresult CacheEntry::GetCacheEntryId(uint64_t *aCacheEntryId) {
+nsresult CacheEntry::GetCacheEntryId(uint64_t* aCacheEntryId) {
   *aCacheEntryId = mCacheEntryId;
   return NS_OK;
 }
 
-nsresult CacheEntry::GetFetchCount(int32_t *aFetchCount) {
+nsresult CacheEntry::GetFetchCount(int32_t* aFetchCount) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
 
-  return mFile->GetFetchCount(reinterpret_cast(aFetchCount));
+  return mFile->GetFetchCount(reinterpret_cast(aFetchCount));
 }
 
-nsresult CacheEntry::GetLastFetched(uint32_t *aLastFetched) {
+nsresult CacheEntry::GetLastFetched(uint32_t* aLastFetched) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
 
   return mFile->GetLastFetched(aLastFetched);
 }
 
-nsresult CacheEntry::GetLastModified(uint32_t *aLastModified) {
+nsresult CacheEntry::GetLastModified(uint32_t* aLastModified) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
 
   return mFile->GetLastModified(aLastModified);
 }
 
-nsresult CacheEntry::GetExpirationTime(uint32_t *aExpirationTime) {
+nsresult CacheEntry::GetExpirationTime(uint32_t* aExpirationTime) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
 
   return mFile->GetExpirationTime(aExpirationTime);
 }
 
-nsresult CacheEntry::GetOnStartTime(uint64_t *aTime) {
+nsresult CacheEntry::GetOnStartTime(uint64_t* aTime) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
   return mFile->GetOnStartTime(aTime);
 }
 
-nsresult CacheEntry::GetOnStopTime(uint64_t *aTime) {
+nsresult CacheEntry::GetOnStopTime(uint64_t* aTime) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
   return mFile->GetOnStopTime(aTime);
 }
@@ -1099,7 +1099,7 @@ nsresult CacheEntry::AddBaseDomainAccess(uint32_t aSiteID) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-nsresult CacheEntry::GetIsForcedValid(bool *aIsForcedValid) {
+nsresult CacheEntry::GetIsForcedValid(bool* aIsForcedValid) {
   NS_ENSURE_ARG(aIsForcedValid);
 
   MOZ_ASSERT(mState > LOADING);
@@ -1150,21 +1150,21 @@ nsresult CacheEntry::SetExpirationTime(uint32_t aExpirationTime) {
   return NS_OK;
 }
 
-nsresult CacheEntry::OpenInputStream(int64_t offset, nsIInputStream **_retval) {
+nsresult CacheEntry::OpenInputStream(int64_t offset, nsIInputStream** _retval) {
   LOG(("CacheEntry::OpenInputStream [this=%p]", this));
   return OpenInputStreamInternal(offset, nullptr, _retval);
 }
 
-nsresult CacheEntry::OpenAlternativeInputStream(const nsACString &type,
-                                                nsIInputStream **_retval) {
+nsresult CacheEntry::OpenAlternativeInputStream(const nsACString& type,
+                                                nsIInputStream** _retval) {
   LOG(("CacheEntry::OpenAlternativeInputStream [this=%p, type=%s]", this,
        PromiseFlatCString(type).get()));
   return OpenInputStreamInternal(0, PromiseFlatCString(type).get(), _retval);
 }
 
 nsresult CacheEntry::OpenInputStreamInternal(int64_t offset,
-                                             const char *aAltDataType,
-                                             nsIInputStream **_retval) {
+                                             const char* aAltDataType,
+                                             nsIInputStream** _retval) {
   LOG(("CacheEntry::OpenInputStreamInternal [this=%p]", this));
 
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
@@ -1208,7 +1208,7 @@ nsresult CacheEntry::OpenInputStreamInternal(int64_t offset,
 }
 
 nsresult CacheEntry::OpenOutputStream(int64_t offset, int64_t predictedSize,
-                                      nsIOutputStream **_retval) {
+                                      nsIOutputStream** _retval) {
   LOG(("CacheEntry::OpenOutputStream [this=%p]", this));
 
   nsresult rv;
@@ -1240,8 +1240,8 @@ nsresult CacheEntry::OpenOutputStream(int64_t offset, int64_t predictedSize,
 }
 
 nsresult CacheEntry::OpenAlternativeOutputStream(
-    const nsACString &type, int64_t predictedSize,
-    nsIAsyncOutputStream **_retval) {
+    const nsACString& type, int64_t predictedSize,
+    nsIAsyncOutputStream** _retval) {
   LOG(("CacheEntry::OpenAlternativeOutputStream [this=%p, type=%s]", this,
        PromiseFlatCString(type).get()));
 
@@ -1274,7 +1274,7 @@ nsresult CacheEntry::OpenAlternativeOutputStream(
 }
 
 nsresult CacheEntry::OpenOutputStreamInternal(int64_t offset,
-                                              nsIOutputStream **_retval) {
+                                              nsIOutputStream** _retval) {
   LOG(("CacheEntry::OpenOutputStreamInternal [this=%p]", this));
 
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
@@ -1317,7 +1317,7 @@ nsresult CacheEntry::OpenOutputStreamInternal(int64_t offset,
   return NS_OK;
 }
 
-nsresult CacheEntry::GetSecurityInfo(nsISupports **aSecurityInfo) {
+nsresult CacheEntry::GetSecurityInfo(nsISupports** aSecurityInfo) {
   {
     mozilla::MutexAutoLock lock(mLock);
     if (mSecurityInfoLoaded) {
@@ -1351,7 +1351,7 @@ nsresult CacheEntry::GetSecurityInfo(nsISupports **aSecurityInfo) {
 
   return NS_OK;
 }
-nsresult CacheEntry::SetSecurityInfo(nsISupports *aSecurityInfo) {
+nsresult CacheEntry::SetSecurityInfo(nsISupports* aSecurityInfo) {
   nsresult rv;
 
   NS_ENSURE_SUCCESS(mFileStatus, mFileStatus);
@@ -1378,7 +1378,7 @@ nsresult CacheEntry::SetSecurityInfo(nsISupports *aSecurityInfo) {
   return NS_OK;
 }
 
-nsresult CacheEntry::GetStorageDataSize(uint32_t *aStorageDataSize) {
+nsresult CacheEntry::GetStorageDataSize(uint32_t* aStorageDataSize) {
   NS_ENSURE_ARG(aStorageDataSize);
 
   int64_t dataSize;
@@ -1390,7 +1390,7 @@ nsresult CacheEntry::GetStorageDataSize(uint32_t *aStorageDataSize) {
   return NS_OK;
 }
 
-nsresult CacheEntry::AsyncDoom(nsICacheEntryDoomCallback *aCallback) {
+nsresult CacheEntry::AsyncDoom(nsICacheEntryDoomCallback* aCallback) {
   LOG(("CacheEntry::AsyncDoom [this=%p]", this));
 
   {
@@ -1415,19 +1415,19 @@ nsresult CacheEntry::AsyncDoom(nsICacheEntryDoomCallback *aCallback) {
   return NS_OK;
 }
 
-nsresult CacheEntry::GetMetaDataElement(const char *aKey, char **aRetval) {
+nsresult CacheEntry::GetMetaDataElement(const char* aKey, char** aRetval) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
 
   return mFile->GetElement(aKey, aRetval);
 }
 
-nsresult CacheEntry::SetMetaDataElement(const char *aKey, const char *aValue) {
+nsresult CacheEntry::SetMetaDataElement(const char* aKey, const char* aValue) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
 
   return mFile->SetElement(aKey, aValue);
 }
 
-nsresult CacheEntry::VisitMetaData(nsICacheEntryMetaDataVisitor *aVisitor) {
+nsresult CacheEntry::VisitMetaData(nsICacheEntryMetaDataVisitor* aVisitor) {
   NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
 
   return mFile->VisitMetaData(aVisitor);
@@ -1474,7 +1474,7 @@ nsresult CacheEntry::SetValid() {
   return NS_OK;
 }
 
-nsresult CacheEntry::Recreate(bool aMemoryOnly, nsICacheEntry **_retval) {
+nsresult CacheEntry::Recreate(bool aMemoryOnly, nsICacheEntry** _retval) {
   LOG(("CacheEntry::Recreate [this=%p, state=%s]", this, StateString(mState)));
 
   mozilla::MutexAutoLock lock(mLock);
@@ -1489,7 +1489,7 @@ nsresult CacheEntry::Recreate(bool aMemoryOnly, nsICacheEntry **_retval) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-nsresult CacheEntry::GetDataSize(int64_t *aDataSize) {
+nsresult CacheEntry::GetDataSize(int64_t* aDataSize) {
   LOG(("CacheEntry::GetDataSize [this=%p]", this));
   *aDataSize = 0;
 
@@ -1514,7 +1514,7 @@ nsresult CacheEntry::GetDataSize(int64_t *aDataSize) {
   return NS_OK;
 }
 
-nsresult CacheEntry::GetAltDataSize(int64_t *aDataSize) {
+nsresult CacheEntry::GetAltDataSize(int64_t* aDataSize) {
   LOG(("CacheEntry::GetAltDataSize [this=%p]", this));
   if (NS_FAILED(mFileStatus)) {
     return mFileStatus;
@@ -1522,7 +1522,7 @@ nsresult CacheEntry::GetAltDataSize(int64_t *aDataSize) {
   return mFile->GetAltDataSize(aDataSize);
 }
 
-nsresult CacheEntry::GetAltDataType(nsACString &aType) {
+nsresult CacheEntry::GetAltDataType(nsACString& aType) {
   LOG(("CacheEntry::GetAltDataType [this=%p]", this));
   if (NS_FAILED(mFileStatus)) {
     return mFileStatus;
@@ -1540,7 +1540,7 @@ nsresult CacheEntry::MaybeMarkValid() {
   return NS_OK;
 }
 
-nsresult CacheEntry::HasWriteAccess(bool aWriteAllowed, bool *aWriteAccess) {
+nsresult CacheEntry::HasWriteAccess(bool aWriteAllowed, bool* aWriteAccess) {
   *aWriteAccess = aWriteAllowed;
   return NS_OK;
 }
@@ -1550,7 +1550,7 @@ nsresult CacheEntry::Close() {
   return NS_OK;
 }
 
-nsresult CacheEntry::GetDiskStorageSizeInKB(uint32_t *aDiskStorageSize) {
+nsresult CacheEntry::GetDiskStorageSizeInKB(uint32_t* aDiskStorageSize) {
   if (NS_FAILED(mFileStatus)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -1558,7 +1558,7 @@ nsresult CacheEntry::GetDiskStorageSizeInKB(uint32_t *aDiskStorageSize) {
   return mFile->GetDiskStorageSizeInKB(aDiskStorageSize);
 }
 
-nsresult CacheEntry::GetLoadContextInfo(nsILoadContextInfo **aInfo) {
+nsresult CacheEntry::GetLoadContextInfo(nsILoadContextInfo** aInfo) {
   nsCOMPtr info = CacheFileUtils::ParseKey(mStorageID);
   if (!info) {
     return NS_ERROR_FAILURE;
@@ -1861,7 +1861,7 @@ void CacheEntry::StoreFrecency(double aFrecency) {
 
 // CacheOutputCloseListener
 
-CacheOutputCloseListener::CacheOutputCloseListener(CacheEntry *aEntry)
+CacheOutputCloseListener::CacheOutputCloseListener(CacheEntry* aEntry)
     : Runnable("net::CacheOutputCloseListener"), mEntry(aEntry) {}
 
 void CacheOutputCloseListener::OnOutputClosed() {
diff --git a/netwerk/cache2/CacheEntry.h b/netwerk/cache2/CacheEntry.h
index eda07bfbe9a0c..724d26e81fe8a 100644
--- a/netwerk/cache2/CacheEntry.h
+++ b/netwerk/cache2/CacheEntry.h
@@ -50,66 +50,66 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
 
   static uint64_t GetNextId();
 
-  CacheEntry(const nsACString &aStorageID, const nsACString &aURI,
-             const nsACString &aEnhanceID, bool aUseDisk, bool aSkipSizeCheck,
+  CacheEntry(const nsACString& aStorageID, const nsACString& aURI,
+             const nsACString& aEnhanceID, bool aUseDisk, bool aSkipSizeCheck,
              bool aPin);
 
-  void AsyncOpen(nsICacheEntryOpenCallback *aCallback, uint32_t aFlags);
+  void AsyncOpen(nsICacheEntryOpenCallback* aCallback, uint32_t aFlags);
 
-  CacheEntryHandle *NewHandle();
+  CacheEntryHandle* NewHandle();
   // For a new and recreated entry w/o a callback, we need to wrap it
   // with a handle to detect writing consumer is gone.
-  CacheEntryHandle *NewWriteHandle();
+  CacheEntryHandle* NewWriteHandle();
 
   // Forwarded to from CacheEntryHandle : nsICacheEntry
-  nsresult GetKey(nsACString &aKey);
-  nsresult GetCacheEntryId(uint64_t *aCacheEntryId);
-  nsresult GetPersistent(bool *aPersistent);
-  nsresult GetFetchCount(int32_t *aFetchCount);
-  nsresult GetLastFetched(uint32_t *aLastFetched);
-  nsresult GetLastModified(uint32_t *aLastModified);
-  nsresult GetExpirationTime(uint32_t *aExpirationTime);
+  nsresult GetKey(nsACString& aKey);
+  nsresult GetCacheEntryId(uint64_t* aCacheEntryId);
+  nsresult GetPersistent(bool* aPersistent);
+  nsresult GetFetchCount(int32_t* aFetchCount);
+  nsresult GetLastFetched(uint32_t* aLastFetched);
+  nsresult GetLastModified(uint32_t* aLastModified);
+  nsresult GetExpirationTime(uint32_t* aExpirationTime);
   nsresult SetExpirationTime(uint32_t expirationTime);
-  nsresult GetOnStartTime(uint64_t *aOnStartTime);
-  nsresult GetOnStopTime(uint64_t *aOnStopTime);
+  nsresult GetOnStartTime(uint64_t* aOnStartTime);
+  nsresult GetOnStopTime(uint64_t* aOnStopTime);
   nsresult SetNetworkTimes(uint64_t onStartTime, uint64_t onStopTime);
   nsresult SetContentType(uint8_t aContentType);
   nsresult AddBaseDomainAccess(uint32_t aSiteID);
   nsresult ForceValidFor(uint32_t aSecondsToTheFuture);
-  nsresult GetIsForcedValid(bool *aIsForcedValid);
-  nsresult OpenInputStream(int64_t offset, nsIInputStream **_retval);
+  nsresult GetIsForcedValid(bool* aIsForcedValid);
+  nsresult OpenInputStream(int64_t offset, nsIInputStream** _retval);
   nsresult OpenOutputStream(int64_t offset, int64_t predictedSize,
-                            nsIOutputStream **_retval);
-  nsresult GetSecurityInfo(nsISupports **aSecurityInfo);
-  nsresult SetSecurityInfo(nsISupports *aSecurityInfo);
-  nsresult GetStorageDataSize(uint32_t *aStorageDataSize);
-  nsresult AsyncDoom(nsICacheEntryDoomCallback *listener);
-  nsresult GetMetaDataElement(const char *key, char **_retval);
-  nsresult SetMetaDataElement(const char *key, const char *value);
-  nsresult VisitMetaData(nsICacheEntryMetaDataVisitor *visitor);
+                            nsIOutputStream** _retval);
+  nsresult GetSecurityInfo(nsISupports** aSecurityInfo);
+  nsresult SetSecurityInfo(nsISupports* aSecurityInfo);
+  nsresult GetStorageDataSize(uint32_t* aStorageDataSize);
+  nsresult AsyncDoom(nsICacheEntryDoomCallback* listener);
+  nsresult GetMetaDataElement(const char* key, char** _retval);
+  nsresult SetMetaDataElement(const char* key, const char* value);
+  nsresult VisitMetaData(nsICacheEntryMetaDataVisitor* visitor);
   nsresult MetaDataReady(void);
   nsresult SetValid(void);
-  nsresult GetDiskStorageSizeInKB(uint32_t *aDiskStorageSizeInKB);
-  nsresult Recreate(bool aMemoryOnly, nsICacheEntry **_retval);
-  nsresult GetDataSize(int64_t *aDataSize);
-  nsresult GetAltDataSize(int64_t *aAltDataSize);
-  nsresult GetAltDataType(nsACString &aAltDataType);
-  nsresult OpenAlternativeOutputStream(const nsACString &type,
+  nsresult GetDiskStorageSizeInKB(uint32_t* aDiskStorageSizeInKB);
+  nsresult Recreate(bool aMemoryOnly, nsICacheEntry** _retval);
+  nsresult GetDataSize(int64_t* aDataSize);
+  nsresult GetAltDataSize(int64_t* aAltDataSize);
+  nsresult GetAltDataType(nsACString& aAltDataType);
+  nsresult OpenAlternativeOutputStream(const nsACString& type,
                                        int64_t predictedSize,
-                                       nsIAsyncOutputStream **_retval);
-  nsresult OpenAlternativeInputStream(const nsACString &type,
-                                      nsIInputStream **_retval);
-  nsresult GetLoadContextInfo(nsILoadContextInfo **aLoadContextInfo);
+                                       nsIAsyncOutputStream** _retval);
+  nsresult OpenAlternativeInputStream(const nsACString& type,
+                                      nsIInputStream** _retval);
+  nsresult GetLoadContextInfo(nsILoadContextInfo** aLoadContextInfo);
   nsresult Close(void);
   nsresult MarkValid(void);
   nsresult MaybeMarkValid(void);
-  nsresult HasWriteAccess(bool aWriteAllowed, bool *_retval);
+  nsresult HasWriteAccess(bool aWriteAllowed, bool* _retval);
 
  public:
   uint32_t GetMetadataMemoryConsumption();
-  nsCString const &GetStorageID() const { return mStorageID; }
-  nsCString const &GetEnhanceID() const { return mEnhanceID; }
-  nsCString const &GetURI() const { return mURI; }
+  nsCString const& GetStorageID() const { return mStorageID; }
+  nsCString const& GetEnhanceID() const { return mEnhanceID; }
+  nsCString const& GetURI() const { return mURI; }
   // Accessible at any time
   bool IsUsingDisk() const { return mUseDisk; }
   bool IsReferenced() const;
@@ -129,7 +129,7 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
   bool CanRegister() const;
   void SetRegistered(bool aRegistered);
 
-  TimeStamp const &LoadStart() const { return mLoadStart; }
+  TimeStamp const& LoadStart() const { return mLoadStart; }
 
   enum EPurge {
     PURGE_DATA_ONLY_DISK_BACKED,
@@ -142,16 +142,16 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
   void PurgeAndDoom();
   void DoomAlreadyRemoved();
 
-  nsresult HashingKeyWithStorage(nsACString &aResult) const;
-  nsresult HashingKey(nsACString &aResult) const;
+  nsresult HashingKeyWithStorage(nsACString& aResult) const;
+  nsresult HashingKey(nsACString& aResult) const;
 
-  static nsresult HashingKey(const nsACString &aStorageID,
-                             const nsACString &aEnhanceID, nsIURI *aURI,
-                             nsACString &aResult);
+  static nsresult HashingKey(const nsACString& aStorageID,
+                             const nsACString& aEnhanceID, nsIURI* aURI,
+                             nsACString& aResult);
 
-  static nsresult HashingKey(const nsACString &aStorageID,
-                             const nsACString &aEnhanceID,
-                             const nsACString &aURISpec, nsACString &aResult);
+  static nsresult HashingKey(const nsACString& aStorageID,
+                             const nsACString& aEnhanceID,
+                             const nsACString& aURISpec, nsACString& aResult);
 
   // Accessed only on the service management thread
   double mFrecency;
@@ -176,21 +176,21 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
   // waiting callbacks to not break the chain.
   class Callback {
    public:
-    Callback(CacheEntry *aEntry, nsICacheEntryOpenCallback *aCallback,
+    Callback(CacheEntry* aEntry, nsICacheEntryOpenCallback* aCallback,
              bool aReadOnly, bool aCheckOnAnyThread, bool aSecret);
     // Special constructor for Callback objects added to the chain
     // just to ensure proper defer dooming (recreation) of this entry.
-    Callback(CacheEntry *aEntry, bool aDoomWhenFoundInPinStatus);
-    Callback(Callback const &aThat);
+    Callback(CacheEntry* aEntry, bool aDoomWhenFoundInPinStatus);
+    Callback(Callback const& aThat);
     ~Callback();
 
     // Called when this callback record changes it's owning entry,
     // mainly during recreation.
-    void ExchangeEntry(CacheEntry *aEntry);
+    void ExchangeEntry(CacheEntry* aEntry);
 
     // Returns true when an entry is about to be "defer" doomed and this is
     // a "defer" callback.
-    bool DeferDoom(bool *aDoom) const;
+    bool DeferDoom(bool* aDoom) const;
 
     // We are raising reference count here to take into account the pending
     // callback (that virtually holds a ref to this entry before it gets
@@ -212,15 +212,15 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
     bool mDoomWhenFoundPinned : 1;
     bool mDoomWhenFoundNonPinned : 1;
 
-    nsresult OnCheckThread(bool *aOnCheckThread) const;
-    nsresult OnAvailThread(bool *aOnAvailThread) const;
+    nsresult OnCheckThread(bool* aOnCheckThread) const;
+    nsresult OnAvailThread(bool* aOnAvailThread) const;
   };
 
   // Since OnCacheEntryAvailable must be invoked on the main thread
   // we need a runnable for it...
   class AvailableCallbackRunnable : public Runnable {
    public:
-    AvailableCallbackRunnable(CacheEntry *aEntry, Callback const &aCallback)
+    AvailableCallbackRunnable(CacheEntry* aEntry, Callback const& aCallback)
         : Runnable("CacheEntry::AvailableCallbackRunnable"),
           mEntry(aEntry),
           mCallback(aCallback) {}
@@ -239,7 +239,7 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
   // we need a runnable for it...
   class DoomCallbackRunnable : public Runnable {
    public:
-    DoomCallbackRunnable(CacheEntry *aEntry, nsresult aRv)
+    DoomCallbackRunnable(CacheEntry* aEntry, nsresult aRv)
         : Runnable("net::CacheEntry::DoomCallbackRunnable"),
           mEntry(aEntry),
           mRv(aRv) {}
@@ -262,24 +262,24 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
 
   // Starts the load or just invokes the callback, bypasses (when required)
   // if busy.  Returns true on job done, false on bypass.
-  bool Open(Callback &aCallback, bool aTruncate, bool aPriority,
+  bool Open(Callback& aCallback, bool aTruncate, bool aPriority,
             bool aBypassIfBusy);
   // Loads from disk asynchronously
   bool Load(bool aTruncate, bool aPriority);
 
-  void RememberCallback(Callback &aCallback);
+  void RememberCallback(Callback& aCallback);
   void InvokeCallbacksLock();
   void InvokeCallbacks();
   bool InvokeCallbacks(bool aReadOnly);
-  bool InvokeCallback(Callback &aCallback);
-  void InvokeAvailableCallback(Callback const &aCallback);
-  void OnFetched(Callback const &aCallback);
+  bool InvokeCallback(Callback& aCallback);
+  void InvokeAvailableCallback(Callback const& aCallback);
+  void OnFetched(Callback const& aCallback);
 
-  nsresult OpenOutputStreamInternal(int64_t offset, nsIOutputStream **_retval);
-  nsresult OpenInputStreamInternal(int64_t offset, const char *aAltDataType,
-                                   nsIInputStream **_retval);
+  nsresult OpenOutputStreamInternal(int64_t offset, nsIOutputStream** _retval);
+  nsresult OpenInputStreamInternal(int64_t offset, const char* aAltDataType,
+                                   nsIInputStream** _retval);
 
-  void OnHandleClosed(CacheEntryHandle const *aHandle);
+  void OnHandleClosed(CacheEntryHandle const* aHandle);
 
  private:
   friend class CacheEntryHandle;
@@ -307,8 +307,8 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
   void RemoveForcedValidity();
 
   already_AddRefed ReopenTruncated(
-      bool aMemoryOnly, nsICacheEntryOpenCallback *aCallback);
-  void TransferCallbacks(CacheEntry &aFromEntry);
+      bool aMemoryOnly, nsICacheEntryOpenCallback* aCallback);
+  void TransferCallbacks(CacheEntry& aFromEntry);
 
   mozilla::Mutex mLock;
 
@@ -359,7 +359,7 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
   // of the cache file)
   bool mPinningKnown : 1;
 
-  static char const *StateString(uint32_t aState);
+  static char const* StateString(uint32_t aState);
 
   enum EState {       // transiting to:
     NOTLOADED = 0,    // -> LOADING | EMPTY
@@ -392,7 +392,7 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
   // Weak reference to the current writter.  There can be more then one
   // writer at a time and OnHandleClosed() must be processed only for the
   // current one.
-  CacheEntryHandle *mWriter;
+  CacheEntryHandle* mWriter;
 
   // Background thread scheduled operation.  Set (under the lock) one
   // of this flags to tell the background thread what to do.
@@ -428,38 +428,38 @@ class CacheEntry final : public nsIRunnable, public CacheFileListener {
 
 class CacheEntryHandle final : public nsICacheEntry {
  public:
-  explicit CacheEntryHandle(CacheEntry *aEntry);
-  CacheEntry *Entry() const { return mEntry; }
+  explicit CacheEntryHandle(CacheEntry* aEntry);
+  CacheEntry* Entry() const { return mEntry; }
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // Default implementation is simply safely forwarded.
-  NS_IMETHOD GetKey(nsACString &aKey) override { return mEntry->GetKey(aKey); }
-  NS_IMETHOD GetCacheEntryId(uint64_t *aCacheEntryId) override {
+  NS_IMETHOD GetKey(nsACString& aKey) override { return mEntry->GetKey(aKey); }
+  NS_IMETHOD GetCacheEntryId(uint64_t* aCacheEntryId) override {
     return mEntry->GetCacheEntryId(aCacheEntryId);
   }
-  NS_IMETHOD GetPersistent(bool *aPersistent) override {
+  NS_IMETHOD GetPersistent(bool* aPersistent) override {
     return mEntry->GetPersistent(aPersistent);
   }
-  NS_IMETHOD GetFetchCount(int32_t *aFetchCount) override {
+  NS_IMETHOD GetFetchCount(int32_t* aFetchCount) override {
     return mEntry->GetFetchCount(aFetchCount);
   }
-  NS_IMETHOD GetLastFetched(uint32_t *aLastFetched) override {
+  NS_IMETHOD GetLastFetched(uint32_t* aLastFetched) override {
     return mEntry->GetLastFetched(aLastFetched);
   }
-  NS_IMETHOD GetLastModified(uint32_t *aLastModified) override {
+  NS_IMETHOD GetLastModified(uint32_t* aLastModified) override {
     return mEntry->GetLastModified(aLastModified);
   }
-  NS_IMETHOD GetExpirationTime(uint32_t *aExpirationTime) override {
+  NS_IMETHOD GetExpirationTime(uint32_t* aExpirationTime) override {
     return mEntry->GetExpirationTime(aExpirationTime);
   }
   NS_IMETHOD SetExpirationTime(uint32_t expirationTime) override {
     return mEntry->SetExpirationTime(expirationTime);
   }
-  NS_IMETHOD GetOnStartTime(uint64_t *aOnStartTime) override {
+  NS_IMETHOD GetOnStartTime(uint64_t* aOnStartTime) override {
     return mEntry->GetOnStartTime(aOnStartTime);
   }
-  NS_IMETHOD GetOnStopTime(uint64_t *aOnStopTime) override {
+  NS_IMETHOD GetOnStopTime(uint64_t* aOnStopTime) override {
     return mEntry->GetOnStopTime(aOnStopTime);
   }
   NS_IMETHOD SetNetworkTimes(uint64_t onStartTime,
@@ -475,72 +475,72 @@ class CacheEntryHandle final : public nsICacheEntry {
   NS_IMETHOD ForceValidFor(uint32_t aSecondsToTheFuture) override {
     return mEntry->ForceValidFor(aSecondsToTheFuture);
   }
-  NS_IMETHOD GetIsForcedValid(bool *aIsForcedValid) override {
+  NS_IMETHOD GetIsForcedValid(bool* aIsForcedValid) override {
     return mEntry->GetIsForcedValid(aIsForcedValid);
   }
   NS_IMETHOD OpenInputStream(int64_t offset,
-                             nsIInputStream **_retval) override {
+                             nsIInputStream** _retval) override {
     return mEntry->OpenInputStream(offset, _retval);
   }
   NS_IMETHOD OpenOutputStream(int64_t offset, int64_t predictedSize,
-                              nsIOutputStream **_retval) override {
+                              nsIOutputStream** _retval) override {
     return mEntry->OpenOutputStream(offset, predictedSize, _retval);
   }
-  NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo) override {
+  NS_IMETHOD GetSecurityInfo(nsISupports** aSecurityInfo) override {
     return mEntry->GetSecurityInfo(aSecurityInfo);
   }
-  NS_IMETHOD SetSecurityInfo(nsISupports *aSecurityInfo) override {
+  NS_IMETHOD SetSecurityInfo(nsISupports* aSecurityInfo) override {
     return mEntry->SetSecurityInfo(aSecurityInfo);
   }
-  NS_IMETHOD GetStorageDataSize(uint32_t *aStorageDataSize) override {
+  NS_IMETHOD GetStorageDataSize(uint32_t* aStorageDataSize) override {
     return mEntry->GetStorageDataSize(aStorageDataSize);
   }
-  NS_IMETHOD AsyncDoom(nsICacheEntryDoomCallback *listener) override {
+  NS_IMETHOD AsyncDoom(nsICacheEntryDoomCallback* listener) override {
     return mEntry->AsyncDoom(listener);
   }
-  NS_IMETHOD GetMetaDataElement(const char *key, char **_retval) override {
+  NS_IMETHOD GetMetaDataElement(const char* key, char** _retval) override {
     return mEntry->GetMetaDataElement(key, _retval);
   }
-  NS_IMETHOD SetMetaDataElement(const char *key, const char *value) override {
+  NS_IMETHOD SetMetaDataElement(const char* key, const char* value) override {
     return mEntry->SetMetaDataElement(key, value);
   }
-  NS_IMETHOD VisitMetaData(nsICacheEntryMetaDataVisitor *visitor) override {
+  NS_IMETHOD VisitMetaData(nsICacheEntryMetaDataVisitor* visitor) override {
     return mEntry->VisitMetaData(visitor);
   }
   NS_IMETHOD MetaDataReady(void) override { return mEntry->MetaDataReady(); }
   NS_IMETHOD SetValid(void) override { return mEntry->SetValid(); }
-  NS_IMETHOD GetDiskStorageSizeInKB(uint32_t *aDiskStorageSizeInKB) override {
+  NS_IMETHOD GetDiskStorageSizeInKB(uint32_t* aDiskStorageSizeInKB) override {
     return mEntry->GetDiskStorageSizeInKB(aDiskStorageSizeInKB);
   }
-  NS_IMETHOD Recreate(bool aMemoryOnly, nsICacheEntry **_retval) override {
+  NS_IMETHOD Recreate(bool aMemoryOnly, nsICacheEntry** _retval) override {
     return mEntry->Recreate(aMemoryOnly, _retval);
   }
-  NS_IMETHOD GetDataSize(int64_t *aDataSize) override {
+  NS_IMETHOD GetDataSize(int64_t* aDataSize) override {
     return mEntry->GetDataSize(aDataSize);
   }
-  NS_IMETHOD GetAltDataSize(int64_t *aAltDataSize) override {
+  NS_IMETHOD GetAltDataSize(int64_t* aAltDataSize) override {
     return mEntry->GetAltDataSize(aAltDataSize);
   }
-  NS_IMETHOD GetAltDataType(nsACString &aType) override {
+  NS_IMETHOD GetAltDataType(nsACString& aType) override {
     return mEntry->GetAltDataType(aType);
   }
   NS_IMETHOD OpenAlternativeOutputStream(
-      const nsACString &type, int64_t predictedSize,
-      nsIAsyncOutputStream **_retval) override {
+      const nsACString& type, int64_t predictedSize,
+      nsIAsyncOutputStream** _retval) override {
     return mEntry->OpenAlternativeOutputStream(type, predictedSize, _retval);
   }
-  NS_IMETHOD OpenAlternativeInputStream(const nsACString &type,
-                                        nsIInputStream **_retval) override {
+  NS_IMETHOD OpenAlternativeInputStream(const nsACString& type,
+                                        nsIInputStream** _retval) override {
     return mEntry->OpenAlternativeInputStream(type, _retval);
   }
   NS_IMETHOD GetLoadContextInfo(
-      nsILoadContextInfo **aLoadContextInfo) override {
+      nsILoadContextInfo** aLoadContextInfo) override {
     return mEntry->GetLoadContextInfo(aLoadContextInfo);
   }
   NS_IMETHOD Close(void) override { return mEntry->Close(); }
   NS_IMETHOD MarkValid(void) override { return mEntry->MarkValid(); }
   NS_IMETHOD MaybeMarkValid(void) override { return mEntry->MaybeMarkValid(); }
-  NS_IMETHOD HasWriteAccess(bool aWriteAllowed, bool *_retval) override {
+  NS_IMETHOD HasWriteAccess(bool aWriteAllowed, bool* _retval) override {
     return mEntry->HasWriteAccess(aWriteAllowed, _retval);
   }
 
@@ -566,7 +566,7 @@ class CacheOutputCloseListener final : public Runnable {
   virtual ~CacheOutputCloseListener() = default;
 
   NS_DECL_NSIRUNNABLE
-  explicit CacheOutputCloseListener(CacheEntry *aEntry);
+  explicit CacheOutputCloseListener(CacheEntry* aEntry);
 
  private:
   RefPtr mEntry;
diff --git a/netwerk/cache2/CacheFile.cpp b/netwerk/cache2/CacheFile.cpp
index d0288e1d8792e..b26bbb0da77f7 100644
--- a/netwerk/cache2/CacheFile.cpp
+++ b/netwerk/cache2/CacheFile.cpp
@@ -30,7 +30,7 @@ namespace net {
 
 class NotifyCacheFileListenerEvent : public Runnable {
  public:
-  NotifyCacheFileListenerEvent(CacheFileListener *aCallback, nsresult aResult,
+  NotifyCacheFileListenerEvent(CacheFileListener* aCallback, nsresult aResult,
                                bool aIsNew)
       : Runnable("net::NotifyCacheFileListenerEvent"),
         mCallback(aCallback),
@@ -66,8 +66,8 @@ class NotifyCacheFileListenerEvent : public Runnable {
 
 class NotifyChunkListenerEvent : public Runnable {
  public:
-  NotifyChunkListenerEvent(CacheFileChunkListener *aCallback, nsresult aResult,
-                           uint32_t aChunkIdx, CacheFileChunk *aChunk)
+  NotifyChunkListenerEvent(CacheFileChunkListener* aCallback, nsresult aResult,
+                           uint32_t aChunkIdx, CacheFileChunk* aChunk)
       : Runnable("net::NotifyChunkListenerEvent"),
         mCallback(aCallback),
         mRV(aResult),
@@ -102,37 +102,37 @@ class DoomFileHelper : public CacheFileIOListener {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  explicit DoomFileHelper(CacheFileListener *aListener)
+  explicit DoomFileHelper(CacheFileListener* aListener)
       : mListener(aListener) {}
 
-  NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) override {
+  NS_IMETHOD OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) override {
     MOZ_CRASH("DoomFileHelper::OnFileOpened should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
 
-  NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+  NS_IMETHOD OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                            nsresult aResult) override {
     MOZ_CRASH("DoomFileHelper::OnDataWritten should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
 
-  NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+  NS_IMETHOD OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                         nsresult aResult) override {
     MOZ_CRASH("DoomFileHelper::OnDataRead should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
 
-  NS_IMETHOD OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) override {
+  NS_IMETHOD OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) override {
     if (mListener) mListener->OnFileDoomed(aResult);
     return NS_OK;
   }
 
-  NS_IMETHOD OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) override {
+  NS_IMETHOD OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) override {
     MOZ_CRASH("DoomFileHelper::OnEOFSet should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
 
-  NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle,
+  NS_IMETHOD OnFileRenamed(CacheFileHandle* aHandle,
                            nsresult aResult) override {
     MOZ_CRASH("DoomFileHelper::OnFileRenamed should not be called!");
     return NS_ERROR_UNEXPECTED;
@@ -188,9 +188,9 @@ CacheFile::~CacheFile() {
   }
 }
 
-nsresult CacheFile::Init(const nsACString &aKey, bool aCreateNew,
+nsresult CacheFile::Init(const nsACString& aKey, bool aCreateNew,
                          bool aMemoryOnly, bool aSkipSizeCheck, bool aPriority,
-                         bool aPinned, CacheFileListener *aCallback) {
+                         bool aPinned, CacheFileListener* aCallback) {
   MOZ_ASSERT(!mListener);
   MOZ_ASSERT(!mHandle);
 
@@ -299,7 +299,7 @@ nsresult CacheFile::Init(const nsACString &aKey, bool aCreateNew,
   return NS_OK;
 }
 
-nsresult CacheFile::OnChunkRead(nsresult aResult, CacheFileChunk *aChunk) {
+nsresult CacheFile::OnChunkRead(nsresult aResult, CacheFileChunk* aChunk) {
   CacheFileAutoLock lock(this);
 
   nsresult rv;
@@ -335,7 +335,7 @@ nsresult CacheFile::OnChunkRead(nsresult aResult, CacheFileChunk *aChunk) {
   return NS_OK;
 }
 
-nsresult CacheFile::OnChunkWritten(nsresult aResult, CacheFileChunk *aChunk) {
+nsresult CacheFile::OnChunkWritten(nsresult aResult, CacheFileChunk* aChunk) {
   // In case the chunk was reused, made dirty and released between calls to
   // CacheFileChunk::Write() and CacheFile::OnChunkWritten(), we must write
   // the chunk to the disk again. When the chunk is unused and is dirty simply
@@ -426,24 +426,24 @@ nsresult CacheFile::OnChunkWritten(nsresult aResult, CacheFileChunk *aChunk) {
 }
 
 nsresult CacheFile::OnChunkAvailable(nsresult aResult, uint32_t aChunkIdx,
-                                     CacheFileChunk *aChunk) {
+                                     CacheFileChunk* aChunk) {
   MOZ_CRASH("CacheFile::OnChunkAvailable should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFile::OnChunkUpdated(CacheFileChunk *aChunk) {
+nsresult CacheFile::OnChunkUpdated(CacheFileChunk* aChunk) {
   MOZ_CRASH("CacheFile::OnChunkUpdated should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFile::OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheFile::OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) {
   nsresult rv;
 
   // Using an 'auto' class to perform doom or fail the listener
   // outside the CacheFile's lock.
   class AutoFailDoomListener {
    public:
-    explicit AutoFailDoomListener(CacheFileHandle *aHandle)
+    explicit AutoFailDoomListener(CacheFileHandle* aHandle)
         : mHandle(aHandle), mAlreadyDoomed(false) {}
     ~AutoFailDoomListener() {
       if (!mListener) return;
@@ -459,7 +459,7 @@ nsresult CacheFile::OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) {
       }
     }
 
-    CacheFileHandle *mHandle;
+    CacheFileHandle* mHandle;
     nsCOMPtr mListener;
     bool mAlreadyDoomed;
   } autoDoom(aHandle);
@@ -549,7 +549,7 @@ nsresult CacheFile::OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) {
         // Write all cached chunks, otherwise they may stay unwritten.
         for (auto iter = mCachedChunks.Iter(); !iter.Done(); iter.Next()) {
           uint32_t idx = iter.Key();
-          const RefPtr &chunk = iter.Data();
+          const RefPtr& chunk = iter.Data();
 
           LOG(("CacheFile::OnFileOpened() - write [this=%p, idx=%u, chunk=%p]",
                this, idx, chunk.get()));
@@ -592,13 +592,13 @@ nsresult CacheFile::OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) {
   return NS_OK;
 }
 
-nsresult CacheFile::OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+nsresult CacheFile::OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                                   nsresult aResult) {
   MOZ_CRASH("CacheFile::OnDataWritten should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFile::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+nsresult CacheFile::OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                                nsresult aResult) {
   MOZ_CRASH("CacheFile::OnDataRead should not be called!");
   return NS_ERROR_UNEXPECTED;
@@ -619,7 +619,7 @@ nsresult CacheFile::OnMetadataRead(nsresult aResult) {
       isNew = true;
       mMetadata->MarkDirty();
     } else {
-      const char *altData = mMetadata->GetElement(CacheFileUtils::kAltDataKey);
+      const char* altData = mMetadata->GetElement(CacheFileUtils::kAltDataKey);
       if (altData && (NS_FAILED(CacheFileUtils::ParseAlternativeDataInfo(
                           altData, &mAltDataOffset, &mAltDataType)) ||
                       (mAltDataOffset > mDataSize))) {
@@ -674,7 +674,7 @@ nsresult CacheFile::OnMetadataWritten(nsresult aResult) {
   return NS_OK;
 }
 
-nsresult CacheFile::OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheFile::OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) {
   nsCOMPtr listener;
 
   {
@@ -692,12 +692,12 @@ nsresult CacheFile::OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) {
   return NS_OK;
 }
 
-nsresult CacheFile::OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheFile::OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) {
   MOZ_CRASH("CacheFile::OnEOFSet should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFile::OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheFile::OnFileRenamed(CacheFileHandle* aHandle, nsresult aResult) {
   MOZ_CRASH("CacheFile::OnFileRenamed should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
@@ -711,8 +711,8 @@ bool CacheFile::IsKilled() {
   return killed;
 }
 
-nsresult CacheFile::OpenInputStream(nsICacheEntry *aEntryHandle,
-                                    nsIInputStream **_retval) {
+nsresult CacheFile::OpenInputStream(nsICacheEntry* aEntryHandle,
+                                    nsIInputStream** _retval) {
   CacheFileAutoLock lock(this);
 
   MOZ_ASSERT(mHandle || mMemoryOnly || mOpeningFile);
@@ -744,7 +744,7 @@ nsresult CacheFile::OpenInputStream(nsICacheEntry *aEntryHandle,
   // the last input stream is closed.
   mPreloadWithoutInputStreams = false;
 
-  CacheFileInputStream *input =
+  CacheFileInputStream* input =
       new CacheFileInputStream(this, aEntryHandle, false);
   LOG(("CacheFile::OpenInputStream() - Creating new input stream %p [this=%p]",
        input, this));
@@ -757,9 +757,9 @@ nsresult CacheFile::OpenInputStream(nsICacheEntry *aEntryHandle,
   return NS_OK;
 }
 
-nsresult CacheFile::OpenAlternativeInputStream(nsICacheEntry *aEntryHandle,
-                                               const char *aAltDataType,
-                                               nsIInputStream **_retval) {
+nsresult CacheFile::OpenAlternativeInputStream(nsICacheEntry* aEntryHandle,
+                                               const char* aAltDataType,
+                                               nsIInputStream** _retval) {
   CacheFileAutoLock lock(this);
 
   MOZ_ASSERT(mHandle || mMemoryOnly || mOpeningFile);
@@ -809,7 +809,7 @@ nsresult CacheFile::OpenAlternativeInputStream(nsICacheEntry *aEntryHandle,
   // the last input stream is closed.
   mPreloadWithoutInputStreams = false;
 
-  CacheFileInputStream *input =
+  CacheFileInputStream* input =
       new CacheFileInputStream(this, aEntryHandle, true);
 
   LOG(
@@ -825,8 +825,8 @@ nsresult CacheFile::OpenAlternativeInputStream(nsICacheEntry *aEntryHandle,
   return NS_OK;
 }
 
-nsresult CacheFile::OpenOutputStream(CacheOutputCloseListener *aCloseListener,
-                                     nsIOutputStream **_retval) {
+nsresult CacheFile::OpenOutputStream(CacheOutputCloseListener* aCloseListener,
+                                     nsIOutputStream** _retval) {
   CacheFileAutoLock lock(this);
 
   MOZ_ASSERT(mHandle || mMemoryOnly || mOpeningFile);
@@ -901,8 +901,8 @@ nsresult CacheFile::OpenOutputStream(CacheOutputCloseListener *aCloseListener,
 }
 
 nsresult CacheFile::OpenAlternativeOutputStream(
-    CacheOutputCloseListener *aCloseListener, const char *aAltDataType,
-    nsIAsyncOutputStream **_retval) {
+    CacheOutputCloseListener* aCloseListener, const char* aAltDataType,
+    nsIAsyncOutputStream** _retval) {
   CacheFileAutoLock lock(this);
 
   MOZ_ASSERT(mHandle || mMemoryOnly || mOpeningFile);
@@ -1016,7 +1016,7 @@ nsresult CacheFile::SetMemoryOnly() {
   return NS_OK;
 }
 
-nsresult CacheFile::Doom(CacheFileListener *aCallback) {
+nsresult CacheFile::Doom(CacheFileListener* aCallback) {
   LOG(("CacheFile::Doom() [this=%p, listener=%p]", this, aCallback));
 
   CacheFileAutoLock lock(this);
@@ -1024,7 +1024,7 @@ nsresult CacheFile::Doom(CacheFileListener *aCallback) {
   return DoomLocked(aCallback);
 }
 
-nsresult CacheFile::DoomLocked(CacheFileListener *aCallback) {
+nsresult CacheFile::DoomLocked(CacheFileListener* aCallback) {
   MOZ_ASSERT(mHandle || mMemoryOnly || mOpeningFile);
 
   LOG(("CacheFile::DoomLocked() [this=%p, listener=%p]", this, aCallback));
@@ -1088,12 +1088,12 @@ nsresult CacheFile::ThrowMemoryCachedData() {
   return NS_OK;
 }
 
-nsresult CacheFile::GetElement(const char *aKey, char **_retval) {
+nsresult CacheFile::GetElement(const char* aKey, char** _retval) {
   CacheFileAutoLock lock(this);
   MOZ_ASSERT(mMetadata);
   NS_ENSURE_TRUE(mMetadata, NS_ERROR_UNEXPECTED);
 
-  const char *value;
+  const char* value;
   value = mMetadata->GetElement(aKey);
   if (!value) return NS_ERROR_NOT_AVAILABLE;
 
@@ -1101,7 +1101,7 @@ nsresult CacheFile::GetElement(const char *aKey, char **_retval) {
   return NS_OK;
 }
 
-nsresult CacheFile::SetElement(const char *aKey, const char *aValue) {
+nsresult CacheFile::SetElement(const char* aKey, const char* aValue) {
   CacheFileAutoLock lock(this);
 
   LOG(("CacheFile::SetElement() this=%p", this));
@@ -1120,7 +1120,7 @@ nsresult CacheFile::SetElement(const char *aKey, const char *aValue) {
   return mMetadata->SetElement(aKey, aValue);
 }
 
-nsresult CacheFile::VisitMetaData(nsICacheEntryMetaDataVisitor *aVisitor) {
+nsresult CacheFile::VisitMetaData(nsICacheEntryMetaDataVisitor* aVisitor) {
   CacheFileAutoLock lock(this);
   MOZ_ASSERT(mMetadata);
   MOZ_ASSERT(mReady);
@@ -1129,7 +1129,7 @@ nsresult CacheFile::VisitMetaData(nsICacheEntryMetaDataVisitor *aVisitor) {
   return mMetadata->Visit(aVisitor);
 }
 
-nsresult CacheFile::ElementsSize(uint32_t *_retval) {
+nsresult CacheFile::ElementsSize(uint32_t* _retval) {
   CacheFileAutoLock lock(this);
 
   if (!mMetadata) return NS_ERROR_NOT_AVAILABLE;
@@ -1152,7 +1152,7 @@ nsresult CacheFile::SetExpirationTime(uint32_t aExpirationTime) {
   return mMetadata->SetExpirationTime(aExpirationTime);
 }
 
-nsresult CacheFile::GetExpirationTime(uint32_t *_retval) {
+nsresult CacheFile::GetExpirationTime(uint32_t* _retval) {
   CacheFileAutoLock lock(this);
   MOZ_ASSERT(mMetadata);
   NS_ENSURE_TRUE(mMetadata, NS_ERROR_UNEXPECTED);
@@ -1177,7 +1177,7 @@ nsresult CacheFile::SetFrecency(uint32_t aFrecency) {
   return mMetadata->SetFrecency(aFrecency);
 }
 
-nsresult CacheFile::GetFrecency(uint32_t *_retval) {
+nsresult CacheFile::GetFrecency(uint32_t* _retval) {
   CacheFileAutoLock lock(this);
   MOZ_ASSERT(mMetadata);
   NS_ENSURE_TRUE(mMetadata, NS_ERROR_UNEXPECTED);
@@ -1227,11 +1227,11 @@ nsresult CacheFile::SetNetworkTimes(uint64_t aOnStartTime,
   return NS_OK;
 }
 
-nsresult CacheFile::GetOnStartTime(uint64_t *_retval) {
+nsresult CacheFile::GetOnStartTime(uint64_t* _retval) {
   CacheFileAutoLock lock(this);
 
   MOZ_ASSERT(mMetadata);
-  const char *onStartTimeStr =
+  const char* onStartTimeStr =
       mMetadata->GetElement("net-response-time-onstart");
   if (!onStartTimeStr) {
     return NS_ERROR_NOT_AVAILABLE;
@@ -1242,11 +1242,11 @@ nsresult CacheFile::GetOnStartTime(uint64_t *_retval) {
   return NS_OK;
 }
 
-nsresult CacheFile::GetOnStopTime(uint64_t *_retval) {
+nsresult CacheFile::GetOnStopTime(uint64_t* _retval) {
   CacheFileAutoLock lock(this);
 
   MOZ_ASSERT(mMetadata);
-  const char *onStopTimeStr = mMetadata->GetElement("net-response-time-onstop");
+  const char* onStopTimeStr = mMetadata->GetElement("net-response-time-onstop");
   if (!onStopTimeStr) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -1295,7 +1295,7 @@ nsresult CacheFile::AddBaseDomainAccess(uint32_t aSiteID) {
   uint32_t trID = CacheObserver::TelemetryReportID();
   uint16_t siteIDCount = 0;
   bool siteIDFound = false;
-  const char *elem = mMetadata->GetElement("eTLD1Access");
+  const char* elem = mMetadata->GetElement("eTLD1Access");
   if (elem) {
     rv = CacheFileUtils::ParseBaseDomainAccessInfo(elem, trID, &aSiteID,
                                                    &siteIDFound, &siteIDCount);
@@ -1329,7 +1329,7 @@ nsresult CacheFile::AddBaseDomainAccess(uint32_t aSiteID) {
   return NS_OK;
 }
 
-nsresult CacheFile::SetAltMetadata(const char *aAltMetadata) {
+nsresult CacheFile::SetAltMetadata(const char* aAltMetadata) {
   AssertOwnsLock();
   LOG(("CacheFile::SetAltMetadata() this=%p, aAltMetadata=%s", this,
        aAltMetadata ? aAltMetadata : ""));
@@ -1359,7 +1359,7 @@ nsresult CacheFile::SetAltMetadata(const char *aAltMetadata) {
   return rv;
 }
 
-nsresult CacheFile::GetLastModified(uint32_t *_retval) {
+nsresult CacheFile::GetLastModified(uint32_t* _retval) {
   CacheFileAutoLock lock(this);
   MOZ_ASSERT(mMetadata);
   NS_ENSURE_TRUE(mMetadata, NS_ERROR_UNEXPECTED);
@@ -1367,7 +1367,7 @@ nsresult CacheFile::GetLastModified(uint32_t *_retval) {
   return mMetadata->GetLastModified(_retval);
 }
 
-nsresult CacheFile::GetLastFetched(uint32_t *_retval) {
+nsresult CacheFile::GetLastFetched(uint32_t* _retval) {
   CacheFileAutoLock lock(this);
   MOZ_ASSERT(mMetadata);
   NS_ENSURE_TRUE(mMetadata, NS_ERROR_UNEXPECTED);
@@ -1375,7 +1375,7 @@ nsresult CacheFile::GetLastFetched(uint32_t *_retval) {
   return mMetadata->GetLastFetched(_retval);
 }
 
-nsresult CacheFile::GetFetchCount(uint32_t *_retval) {
+nsresult CacheFile::GetFetchCount(uint32_t* _retval) {
   CacheFileAutoLock lock(this);
   MOZ_ASSERT(mMetadata);
   NS_ENSURE_TRUE(mMetadata, NS_ERROR_UNEXPECTED);
@@ -1383,7 +1383,7 @@ nsresult CacheFile::GetFetchCount(uint32_t *_retval) {
   return mMetadata->GetFetchCount(_retval);
 }
 
-nsresult CacheFile::GetDiskStorageSizeInKB(uint32_t *aDiskStorageSize) {
+nsresult CacheFile::GetDiskStorageSizeInKB(uint32_t* aDiskStorageSize) {
   if (!mHandle) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -1425,8 +1425,8 @@ void CacheFile::ReleaseOutsideLock(RefPtr aObject) {
 }
 
 nsresult CacheFile::GetChunkLocked(uint32_t aIndex, ECallerType aCaller,
-                                   CacheFileChunkListener *aCallback,
-                                   CacheFileChunk **_retval) {
+                                   CacheFileChunkListener* aCallback,
+                                   CacheFileChunk** _retval) {
   AssertOwnsLock();
 
   LOG(("CacheFile::GetChunkLocked() [this=%p, idx=%u, caller=%d, listener=%p]",
@@ -1730,7 +1730,7 @@ bool CacheFile::MustKeepCachedChunk(uint32_t aIndex) {
   return false;
 }
 
-nsresult CacheFile::DeactivateChunk(CacheFileChunk *aChunk) {
+nsresult CacheFile::DeactivateChunk(CacheFileChunk* aChunk) {
   nsresult rv;
 
   // Avoid lock reentrancy by increasing the RefCnt
@@ -1775,7 +1775,7 @@ nsresult CacheFile::DeactivateChunk(CacheFileChunk *aChunk) {
       MOZ_ASSERT(chunkCheck == chunk);
 
       // We also shouldn't have any queued listener for this chunk
-      ChunkListeners *listeners;
+      ChunkListeners* listeners;
       mChunkListeners.Get(chunk->Index(), &listeners);
       MOZ_ASSERT(!listeners);
     }
@@ -1838,7 +1838,7 @@ nsresult CacheFile::DeactivateChunk(CacheFileChunk *aChunk) {
   return NS_OK;
 }
 
-void CacheFile::RemoveChunkInternal(CacheFileChunk *aChunk, bool aCacheChunk) {
+void CacheFile::RemoveChunkInternal(CacheFileChunk* aChunk, bool aCacheChunk) {
   AssertOwnsLock();
 
   aChunk->mActiveChunk = false;
@@ -1900,7 +1900,7 @@ int64_t CacheFile::BytesFromChunk(uint32_t aIndex, bool aAlternativeData) {
 
   uint32_t i;
   for (i = aIndex; i <= maxPreloadedChunk; ++i) {
-    CacheFileChunk *chunk;
+    CacheFileChunk* chunk;
 
     chunk = mChunks.GetWeak(i);
     if (chunk) {
@@ -2006,7 +2006,7 @@ nsresult CacheFile::Truncate(int64_t aOffset) {
     uint32_t idx = iter.Key();
 
     if (idx > newLastChunk) {
-      RefPtr &chunk = iter.Data();
+      RefPtr& chunk = iter.Data();
       LOG(("CacheFile::Truncate() - discarding chunk [idx=%u, chunk=%p]", idx,
            chunk.get()));
 
@@ -2118,7 +2118,7 @@ static uint32_t StatusToTelemetryEnum(nsresult aStatus) {
   MOZ_ASSERT_UNREACHABLE("We should never get here");
 }
 
-nsresult CacheFile::RemoveInput(CacheFileInputStream *aInput,
+nsresult CacheFile::RemoveInput(CacheFileInputStream* aInput,
                                 nsresult aStatus) {
   CacheFileAutoLock lock(this);
 
@@ -2130,7 +2130,7 @@ nsresult CacheFile::RemoveInput(CacheFileInputStream *aInput,
   MOZ_ASSERT(found);
 
   ReleaseOutsideLock(
-      already_AddRefed(static_cast(aInput)));
+      already_AddRefed(static_cast(aInput)));
 
   if (!mMemoryOnly) WriteMetadataIfNeededLocked();
 
@@ -2144,7 +2144,7 @@ nsresult CacheFile::RemoveInput(CacheFileInputStream *aInput,
   return NS_OK;
 }
 
-nsresult CacheFile::RemoveOutput(CacheFileOutputStream *aOutput,
+nsresult CacheFile::RemoveOutput(CacheFileOutputStream* aOutput,
                                  nsresult aStatus) {
   AssertOwnsLock();
 
@@ -2214,10 +2214,10 @@ nsresult CacheFile::RemoveOutput(CacheFileOutputStream *aOutput,
   return NS_OK;
 }
 
-nsresult CacheFile::NotifyChunkListener(CacheFileChunkListener *aCallback,
-                                        nsIEventTarget *aTarget,
+nsresult CacheFile::NotifyChunkListener(CacheFileChunkListener* aCallback,
+                                        nsIEventTarget* aTarget,
                                         nsresult aResult, uint32_t aChunkIdx,
-                                        CacheFileChunk *aChunk) {
+                                        CacheFileChunk* aChunk) {
   LOG(
       ("CacheFile::NotifyChunkListener() [this=%p, listener=%p, target=%p, "
        "rv=0x%08" PRIx32 ", idx=%u, chunk=%p]",
@@ -2237,7 +2237,7 @@ nsresult CacheFile::NotifyChunkListener(CacheFileChunkListener *aCallback,
 }
 
 nsresult CacheFile::QueueChunkListener(uint32_t aIndex,
-                                       CacheFileChunkListener *aCallback) {
+                                       CacheFileChunkListener* aCallback) {
   LOG(("CacheFile::QueueChunkListener() [this=%p, idx=%u, listener=%p]", this,
        aIndex, aCallback));
 
@@ -2245,7 +2245,7 @@ nsresult CacheFile::QueueChunkListener(uint32_t aIndex,
 
   MOZ_ASSERT(aCallback);
 
-  ChunkListenerItem *item = new ChunkListenerItem();
+  ChunkListenerItem* item = new ChunkListenerItem();
   item->mTarget = CacheFileIOManager::IOTarget();
   if (!item->mTarget) {
     LOG(
@@ -2255,7 +2255,7 @@ nsresult CacheFile::QueueChunkListener(uint32_t aIndex,
   }
   item->mCallback = aCallback;
 
-  ChunkListeners *listeners;
+  ChunkListeners* listeners;
   if (!mChunkListeners.Get(aIndex, &listeners)) {
     listeners = new ChunkListeners();
     mChunkListeners.Put(aIndex, listeners);
@@ -2266,7 +2266,7 @@ nsresult CacheFile::QueueChunkListener(uint32_t aIndex,
 }
 
 nsresult CacheFile::NotifyChunkListeners(uint32_t aIndex, nsresult aResult,
-                                         CacheFileChunk *aChunk) {
+                                         CacheFileChunk* aChunk) {
   LOG(("CacheFile::NotifyChunkListeners() [this=%p, idx=%u, rv=0x%08" PRIx32
        ", "
        "chunk=%p]",
@@ -2276,13 +2276,13 @@ nsresult CacheFile::NotifyChunkListeners(uint32_t aIndex, nsresult aResult,
 
   nsresult rv, rv2;
 
-  ChunkListeners *listeners;
+  ChunkListeners* listeners;
   mChunkListeners.Get(aIndex, &listeners);
   MOZ_ASSERT(listeners);
 
   rv = NS_OK;
   for (uint32_t i = 0; i < listeners->mItems.Length(); i++) {
-    ChunkListenerItem *item = listeners->mItems[i];
+    ChunkListenerItem* item = listeners->mItems[i];
     rv2 = NotifyChunkListener(item->mCallback, item->mTarget, aResult, aIndex,
                               aChunk);
     if (NS_FAILED(rv2) && NS_SUCCEEDED(rv)) rv = rv2;
@@ -2295,7 +2295,7 @@ nsresult CacheFile::NotifyChunkListeners(uint32_t aIndex, nsresult aResult,
 }
 
 bool CacheFile::HaveChunkListeners(uint32_t aIndex) {
-  ChunkListeners *listeners;
+  ChunkListeners* listeners;
   mChunkListeners.Get(aIndex, &listeners);
   return !!listeners;
 }
@@ -2308,7 +2308,7 @@ void CacheFile::NotifyListenersAboutOutputRemoval() {
   // First fail all chunk listeners that wait for non-existent chunk
   for (auto iter = mChunkListeners.Iter(); !iter.Done(); iter.Next()) {
     uint32_t idx = iter.Key();
-    nsAutoPtr &listeners = iter.Data();
+    nsAutoPtr& listeners = iter.Data();
 
     LOG(
         ("CacheFile::NotifyListenersAboutOutputRemoval() - fail "
@@ -2323,7 +2323,7 @@ void CacheFile::NotifyListenersAboutOutputRemoval() {
     }
 
     for (uint32_t i = 0; i < listeners->mItems.Length(); i++) {
-      ChunkListenerItem *item = listeners->mItems[i];
+      ChunkListenerItem* item = listeners->mItems[i];
       NotifyChunkListener(item->mCallback, item->mTarget,
                           NS_ERROR_NOT_AVAILABLE, idx, nullptr);
       delete item;
@@ -2334,7 +2334,7 @@ void CacheFile::NotifyListenersAboutOutputRemoval() {
 
   // Fail all update listeners
   for (auto iter = mChunks.Iter(); !iter.Done(); iter.Next()) {
-    const RefPtr &chunk = iter.Data();
+    const RefPtr& chunk = iter.Data();
     LOG(
         ("CacheFile::NotifyListenersAboutOutputRemoval() - fail2 "
          "[this=%p, idx=%u]",
@@ -2346,7 +2346,7 @@ void CacheFile::NotifyListenersAboutOutputRemoval() {
   }
 }
 
-bool CacheFile::DataSize(int64_t *aSize) {
+bool CacheFile::DataSize(int64_t* aSize) {
   CacheFileAutoLock lock(this);
 
   if (OutputStreamExists(false)) {
@@ -2362,7 +2362,7 @@ bool CacheFile::DataSize(int64_t *aSize) {
   return true;
 }
 
-nsresult CacheFile::GetAltDataSize(int64_t *aSize) {
+nsresult CacheFile::GetAltDataSize(int64_t* aSize) {
   CacheFileAutoLock lock(this);
   if (mOutput) {
     return NS_ERROR_IN_PROGRESS;
@@ -2376,7 +2376,7 @@ nsresult CacheFile::GetAltDataSize(int64_t *aSize) {
   return NS_OK;
 }
 
-nsresult CacheFile::GetAltDataType(nsACString &aType) {
+nsresult CacheFile::GetAltDataType(nsACString& aType) {
   CacheFileAutoLock lock(this);
 
   if (mAltDataOffset == -1) {
@@ -2496,7 +2496,7 @@ void CacheFile::PostWriteTimer() {
 void CacheFile::CleanUpCachedChunks() {
   for (auto iter = mCachedChunks.Iter(); !iter.Done(); iter.Next()) {
     uint32_t idx = iter.Key();
-    const RefPtr &chunk = iter.Data();
+    const RefPtr& chunk = iter.Data();
 
     LOG(("CacheFile::CleanUpCachedChunks() [this=%p, idx=%u, chunk=%p]", this,
          idx, chunk.get()));
@@ -2573,7 +2573,7 @@ nsresult CacheFile::InitIndexEntry() {
   bool hasAltData =
       mMetadata->GetElement(CacheFileUtils::kAltDataKey) ? true : false;
 
-  static auto toUint16 = [](const char *s) -> uint16_t {
+  static auto toUint16 = [](const char* s) -> uint16_t {
     if (s) {
       nsresult rv;
       uint64_t n64 = nsDependentCString(s).ToInteger64(&rv);
@@ -2583,14 +2583,14 @@ nsresult CacheFile::InitIndexEntry() {
     return kIndexTimeNotAvailable;
   };
 
-  const char *onStartTimeStr =
+  const char* onStartTimeStr =
       mMetadata->GetElement("net-response-time-onstart");
   uint16_t onStartTime = toUint16(onStartTimeStr);
 
-  const char *onStopTimeStr = mMetadata->GetElement("net-response-time-onstop");
+  const char* onStopTimeStr = mMetadata->GetElement("net-response-time-onstop");
   uint16_t onStopTime = toUint16(onStopTimeStr);
 
-  const char *contentTypeStr = mMetadata->GetElement("ctid");
+  const char* contentTypeStr = mMetadata->GetElement("ctid");
   uint8_t contentType = nsICacheEntry::CONTENT_TYPE_UNKNOWN;
   if (contentTypeStr) {
     int64_t n64 = nsDependentCString(contentTypeStr).ToInteger64(&rv);
@@ -2602,7 +2602,7 @@ nsresult CacheFile::InitIndexEntry() {
   }
 
   uint32_t trID = CacheObserver::TelemetryReportID();
-  const char *siteIDInfo = mMetadata->GetElement("eTLD1Access");
+  const char* siteIDInfo = mMetadata->GetElement("eTLD1Access");
   uint16_t siteIDCount = 0;
   if (siteIDInfo) {
     CacheFileUtils::ParseBaseDomainAccessInfo(siteIDInfo, trID, nullptr,
@@ -2619,7 +2619,7 @@ nsresult CacheFile::InitIndexEntry() {
 
 size_t CacheFile::SizeOfExcludingThis(
     mozilla::MallocSizeOf mallocSizeOf) const {
-  CacheFileAutoLock lock(const_cast(this));
+  CacheFileAutoLock lock(const_cast(this));
 
   size_t n = 0;
   n += mKey.SizeOfExcludingThisIfUnshared(mallocSizeOf);
diff --git a/netwerk/cache2/CacheFile.h b/netwerk/cache2/CacheFile.h
index 76ed6e3857cc2..f5a9dd8f91e59 100644
--- a/netwerk/cache2/CacheFile.h
+++ b/netwerk/cache2/CacheFile.h
@@ -49,72 +49,72 @@ class CacheFile final : public CacheFileChunkListener,
 
   CacheFile();
 
-  nsresult Init(const nsACString &aKey, bool aCreateNew, bool aMemoryOnly,
+  nsresult Init(const nsACString& aKey, bool aCreateNew, bool aMemoryOnly,
                 bool aSkipSizeCheck, bool aPriority, bool aPinned,
-                CacheFileListener *aCallback);
+                CacheFileListener* aCallback);
 
-  NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk *aChunk) override;
-  NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk *aChunk) override;
+  NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk* aChunk) override;
+  NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk* aChunk) override;
   NS_IMETHOD OnChunkAvailable(nsresult aResult, uint32_t aChunkIdx,
-                              CacheFileChunk *aChunk) override;
-  NS_IMETHOD OnChunkUpdated(CacheFileChunk *aChunk) override;
+                              CacheFileChunk* aChunk) override;
+  NS_IMETHOD OnChunkUpdated(CacheFileChunk* aChunk) override;
 
-  NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+  NS_IMETHOD OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                            nsresult aResult) override;
-  NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+  NS_IMETHOD OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                         nsresult aResult) override;
-  NS_IMETHOD OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) override;
+  NS_IMETHOD OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnFileRenamed(CacheFileHandle* aHandle, nsresult aResult) override;
   virtual bool IsKilled() override;
 
   NS_IMETHOD OnMetadataRead(nsresult aResult) override;
   NS_IMETHOD OnMetadataWritten(nsresult aResult) override;
 
-  NS_IMETHOD OpenInputStream(nsICacheEntry *aCacheEntryHandle,
-                             nsIInputStream **_retval);
-  NS_IMETHOD OpenAlternativeInputStream(nsICacheEntry *aCacheEntryHandle,
-                                        const char *aAltDataType,
-                                        nsIInputStream **_retval);
-  NS_IMETHOD OpenOutputStream(CacheOutputCloseListener *aCloseListener,
-                              nsIOutputStream **_retval);
+  NS_IMETHOD OpenInputStream(nsICacheEntry* aCacheEntryHandle,
+                             nsIInputStream** _retval);
+  NS_IMETHOD OpenAlternativeInputStream(nsICacheEntry* aCacheEntryHandle,
+                                        const char* aAltDataType,
+                                        nsIInputStream** _retval);
+  NS_IMETHOD OpenOutputStream(CacheOutputCloseListener* aCloseListener,
+                              nsIOutputStream** _retval);
   NS_IMETHOD OpenAlternativeOutputStream(
-      CacheOutputCloseListener *aCloseListener, const char *aAltDataType,
-      nsIAsyncOutputStream **_retval);
+      CacheOutputCloseListener* aCloseListener, const char* aAltDataType,
+      nsIAsyncOutputStream** _retval);
   NS_IMETHOD SetMemoryOnly();
-  NS_IMETHOD Doom(CacheFileListener *aCallback);
+  NS_IMETHOD Doom(CacheFileListener* aCallback);
 
   void Kill() { mKill = true; }
   nsresult ThrowMemoryCachedData();
 
-  nsresult GetAltDataSize(int64_t *aSize);
-  nsresult GetAltDataType(nsACString &aType);
+  nsresult GetAltDataSize(int64_t* aSize);
+  nsresult GetAltDataType(nsACString& aType);
 
   // metadata forwarders
-  nsresult GetElement(const char *aKey, char **_retval);
-  nsresult SetElement(const char *aKey, const char *aValue);
-  nsresult VisitMetaData(nsICacheEntryMetaDataVisitor *aVisitor);
-  nsresult ElementsSize(uint32_t *_retval);
+  nsresult GetElement(const char* aKey, char** _retval);
+  nsresult SetElement(const char* aKey, const char* aValue);
+  nsresult VisitMetaData(nsICacheEntryMetaDataVisitor* aVisitor);
+  nsresult ElementsSize(uint32_t* _retval);
   nsresult SetExpirationTime(uint32_t aExpirationTime);
-  nsresult GetExpirationTime(uint32_t *_retval);
+  nsresult GetExpirationTime(uint32_t* _retval);
   nsresult SetFrecency(uint32_t aFrecency);
-  nsresult GetFrecency(uint32_t *_retval);
+  nsresult GetFrecency(uint32_t* _retval);
   nsresult SetNetworkTimes(uint64_t aOnStartTime, uint64_t aOnStopTime);
   nsresult SetContentType(uint8_t aContentType);
   nsresult AddBaseDomainAccess(uint32_t aSiteID);
-  nsresult GetOnStartTime(uint64_t *_retval);
-  nsresult GetOnStopTime(uint64_t *_retval);
-  nsresult GetLastModified(uint32_t *_retval);
-  nsresult GetLastFetched(uint32_t *_retval);
-  nsresult GetFetchCount(uint32_t *_retval);
-  nsresult GetDiskStorageSizeInKB(uint32_t *aDiskStorageSize);
+  nsresult GetOnStartTime(uint64_t* _retval);
+  nsresult GetOnStopTime(uint64_t* _retval);
+  nsresult GetLastModified(uint32_t* _retval);
+  nsresult GetLastFetched(uint32_t* _retval);
+  nsresult GetFetchCount(uint32_t* _retval);
+  nsresult GetDiskStorageSizeInKB(uint32_t* aDiskStorageSize);
   // Called by upper layers to indicated the entry has been fetched,
   // i.e. delivered to the consumer.
   nsresult OnFetched();
 
-  bool DataSize(int64_t *aSize);
-  void Key(nsACString &aKey) { aKey = mKey; }
+  bool DataSize(int64_t* aSize);
+  void Key(nsACString& aKey) { aKey = mKey; }
   bool IsDoomed();
   bool IsPinned() const { return mPinned; }
   bool IsWriteInProgress();
@@ -141,18 +141,18 @@ class CacheFile final : public CacheFileChunkListener,
 
   enum ECallerType { READER = 0, WRITER = 1, PRELOADER = 2 };
 
-  nsresult DoomLocked(CacheFileListener *aCallback);
+  nsresult DoomLocked(CacheFileListener* aCallback);
 
   nsresult GetChunkLocked(uint32_t aIndex, ECallerType aCaller,
-                          CacheFileChunkListener *aCallback,
-                          CacheFileChunk **_retval);
+                          CacheFileChunkListener* aCallback,
+                          CacheFileChunk** _retval);
 
   void PreloadChunks(uint32_t aIndex);
   bool ShouldCacheChunk(uint32_t aIndex);
   bool MustKeepCachedChunk(uint32_t aIndex);
 
-  nsresult DeactivateChunk(CacheFileChunk *aChunk);
-  void RemoveChunkInternal(CacheFileChunk *aChunk, bool aCacheChunk);
+  nsresult DeactivateChunk(CacheFileChunk* aChunk);
+  void RemoveChunkInternal(CacheFileChunk* aChunk, bool aCacheChunk);
 
   bool OutputStreamExists(bool aAlternativeData);
   // Returns number of bytes that are available and can be read by input stream
@@ -162,15 +162,15 @@ class CacheFile final : public CacheFileChunkListener,
   int64_t BytesFromChunk(uint32_t aIndex, bool aAlternativeData);
   nsresult Truncate(int64_t aOffset);
 
-  nsresult RemoveInput(CacheFileInputStream *aInput, nsresult aStatus);
-  nsresult RemoveOutput(CacheFileOutputStream *aOutput, nsresult aStatus);
-  nsresult NotifyChunkListener(CacheFileChunkListener *aCallback,
-                               nsIEventTarget *aTarget, nsresult aResult,
-                               uint32_t aChunkIdx, CacheFileChunk *aChunk);
+  nsresult RemoveInput(CacheFileInputStream* aInput, nsresult aStatus);
+  nsresult RemoveOutput(CacheFileOutputStream* aOutput, nsresult aStatus);
+  nsresult NotifyChunkListener(CacheFileChunkListener* aCallback,
+                               nsIEventTarget* aTarget, nsresult aResult,
+                               uint32_t aChunkIdx, CacheFileChunk* aChunk);
   nsresult QueueChunkListener(uint32_t aIndex,
-                              CacheFileChunkListener *aCallback);
+                              CacheFileChunkListener* aCallback);
   nsresult NotifyChunkListeners(uint32_t aIndex, nsresult aResult,
-                                CacheFileChunk *aChunk);
+                                CacheFileChunk* aChunk);
   bool HaveChunkListeners(uint32_t aIndex);
   void NotifyListenersAboutOutputRemoval();
 
@@ -184,7 +184,7 @@ class CacheFile final : public CacheFileChunkListener,
   nsresult PadChunkWithZeroes(uint32_t aChunkIdx);
 
   void SetError(nsresult aStatus);
-  nsresult SetAltMetadata(const char *aAltMetadata);
+  nsresult SetAltMetadata(const char* aAltMetadata);
 
   nsresult InitIndexEntry();
 
@@ -229,15 +229,15 @@ class CacheFile final : public CacheFileChunkListener,
   // and mark it as discarded.
   nsTArray> mDiscardedChunks;
 
-  nsTArray mInputs;
-  CacheFileOutputStream *mOutput;
+  nsTArray mInputs;
+  CacheFileOutputStream* mOutput;
 
   nsTArray> mObjsToRelease;
 };
 
 class CacheFileAutoLock {
  public:
-  explicit CacheFileAutoLock(CacheFile *aFile) : mFile(aFile), mLocked(true) {
+  explicit CacheFileAutoLock(CacheFile* aFile) : mFile(aFile), mLocked(true) {
     mFile->Lock();
   }
   ~CacheFileAutoLock() {
diff --git a/netwerk/cache2/CacheFileChunk.cpp b/netwerk/cache2/CacheFileChunk.cpp
index f890d19b80067..d10d41c822b42 100644
--- a/netwerk/cache2/CacheFileChunk.cpp
+++ b/netwerk/cache2/CacheFileChunk.cpp
@@ -15,7 +15,7 @@ namespace net {
 
 #define kMinBufSize 512
 
-CacheFileChunkBuffer::CacheFileChunkBuffer(CacheFileChunk *aChunk)
+CacheFileChunkBuffer::CacheFileChunkBuffer(CacheFileChunk* aChunk)
     : mChunk(aChunk),
       mBuf(nullptr),
       mBufSize(0),
@@ -32,14 +32,14 @@ CacheFileChunkBuffer::~CacheFileChunkBuffer() {
   }
 }
 
-void CacheFileChunkBuffer::CopyFrom(CacheFileChunkBuffer *aOther) {
+void CacheFileChunkBuffer::CopyFrom(CacheFileChunkBuffer* aOther) {
   MOZ_RELEASE_ASSERT(mBufSize >= aOther->mDataSize);
   mDataSize = aOther->mDataSize;
   memcpy(mBuf, aOther->mBuf, mDataSize);
 }
 
 nsresult CacheFileChunkBuffer::FillInvalidRanges(
-    CacheFileChunkBuffer *aOther, CacheFileUtils::ValidityMap *aMap) {
+    CacheFileChunkBuffer* aOther, CacheFileUtils::ValidityMap* aMap) {
   nsresult rv;
 
   rv = EnsureBufSize(aOther->mDataSize);
@@ -95,7 +95,7 @@ MOZ_MUST_USE nsresult CacheFileChunkBuffer::EnsureBufSize(uint32_t aBufSize) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  char *newBuf = static_cast(realloc(mBuf, aBufSize));
+  char* newBuf = static_cast(realloc(mBuf, aBufSize));
   if (!newBuf) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
@@ -167,7 +167,7 @@ uint32_t CacheFileChunkHandle::Offset() {
   return mBuf->mChunk->Index() * kChunkSize;
 }
 
-CacheFileChunkReadHandle::CacheFileChunkReadHandle(CacheFileChunkBuffer *aBuf) {
+CacheFileChunkReadHandle::CacheFileChunkReadHandle(CacheFileChunkBuffer* aBuf) {
   mBuf = aBuf;
   mBuf->mReadHandlesCount++;
 }
@@ -176,10 +176,10 @@ CacheFileChunkReadHandle::~CacheFileChunkReadHandle() {
   mBuf->RemoveReadHandle();
 }
 
-const char *CacheFileChunkReadHandle::Buf() { return mBuf->mBuf; }
+const char* CacheFileChunkReadHandle::Buf() { return mBuf->mBuf; }
 
 CacheFileChunkWriteHandle::CacheFileChunkWriteHandle(
-    CacheFileChunkBuffer *aBuf) {
+    CacheFileChunkBuffer* aBuf) {
   mBuf = aBuf;
   if (mBuf) {
     MOZ_ASSERT(!mBuf->mWriteHandleExists);
@@ -193,7 +193,7 @@ CacheFileChunkWriteHandle::~CacheFileChunkWriteHandle() {
   }
 }
 
-char *CacheFileChunkWriteHandle::Buf() { return mBuf ? mBuf->mBuf : nullptr; }
+char* CacheFileChunkWriteHandle::Buf() { return mBuf ? mBuf->mBuf : nullptr; }
 
 void CacheFileChunkWriteHandle::UpdateDataSize(uint32_t aOffset,
                                                uint32_t aLen) {
@@ -210,8 +210,8 @@ void CacheFileChunkWriteHandle::UpdateDataSize(uint32_t aOffset,
 
 class NotifyUpdateListenerEvent : public Runnable {
  public:
-  NotifyUpdateListenerEvent(CacheFileChunkListener *aCallback,
-                            CacheFileChunk *aChunk)
+  NotifyUpdateListenerEvent(CacheFileChunkListener* aCallback,
+                            CacheFileChunk* aChunk)
       : Runnable("net::NotifyUpdateListenerEvent"),
         mCallback(aCallback),
         mChunk(aChunk) {
@@ -290,7 +290,7 @@ NS_INTERFACE_MAP_BEGIN(CacheFileChunk)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-CacheFileChunk::CacheFileChunk(CacheFile *aFile, uint32_t aIndex,
+CacheFileChunk::CacheFileChunk(CacheFile* aFile, uint32_t aIndex,
                                bool aInitByWriter)
     : CacheMemoryConsumer(aFile->mOpenAsMemoryOnly ? MEMORY_ONLY : DONT_REPORT),
       mIndex(aIndex),
@@ -331,9 +331,9 @@ void CacheFileChunk::InitNew() {
   mState = READY;
 }
 
-nsresult CacheFileChunk::Read(CacheFileHandle *aHandle, uint32_t aLen,
+nsresult CacheFileChunk::Read(CacheFileHandle* aHandle, uint32_t aLen,
                               CacheHash::Hash16_t aHash,
-                              CacheFileChunkListener *aCallback) {
+                              CacheFileChunkListener* aCallback) {
   AssertOwnsLock();
 
   LOG(("CacheFileChunk::Read() [this=%p, handle=%p, len=%d, listener=%p]", this,
@@ -378,8 +378,8 @@ nsresult CacheFileChunk::Read(CacheFileHandle *aHandle, uint32_t aLen,
   return rv;
 }
 
-nsresult CacheFileChunk::Write(CacheFileHandle *aHandle,
-                               CacheFileChunkListener *aCallback) {
+nsresult CacheFileChunk::Write(CacheFileHandle* aHandle,
+                               CacheFileChunkListener* aCallback) {
   AssertOwnsLock();
 
   LOG(("CacheFileChunk::Write() [this=%p, handle=%p, listener=%p]", this,
@@ -411,7 +411,7 @@ nsresult CacheFileChunk::Write(CacheFileHandle *aHandle,
   return rv;
 }
 
-void CacheFileChunk::WaitForUpdate(CacheFileChunkListener *aCallback) {
+void CacheFileChunk::WaitForUpdate(CacheFileChunkListener* aCallback) {
   AssertOwnsLock();
 
   LOG(("CacheFileChunk::WaitForUpdate() [this=%p, listener=%p]", this,
@@ -426,7 +426,7 @@ void CacheFileChunk::WaitForUpdate(CacheFileChunkListener *aCallback) {
   }
 #endif
 
-  ChunkListenerItem *item = new ChunkListenerItem();
+  ChunkListenerItem* item = new ChunkListenerItem();
   item->mTarget = CacheFileIOManager::IOTarget();
   if (!item->mTarget) {
     LOG(
@@ -441,7 +441,7 @@ void CacheFileChunk::WaitForUpdate(CacheFileChunkListener *aCallback) {
   mUpdateListeners.AppendElement(item);
 }
 
-nsresult CacheFileChunk::CancelWait(CacheFileChunkListener *aCallback) {
+nsresult CacheFileChunk::CancelWait(CacheFileChunkListener* aCallback) {
   AssertOwnsLock();
 
   LOG(("CacheFileChunk::CancelWait() [this=%p, listener=%p]", this, aCallback));
@@ -450,7 +450,7 @@ nsresult CacheFileChunk::CancelWait(CacheFileChunkListener *aCallback) {
 
   uint32_t i;
   for (i = 0; i < mUpdateListeners.Length(); i++) {
-    ChunkListenerItem *item = mUpdateListeners[i];
+    ChunkListenerItem* item = mUpdateListeners[i];
 
     if (item->mCallback == aCallback) {
       mUpdateListeners.RemoveElementAt(i);
@@ -479,7 +479,7 @@ nsresult CacheFileChunk::NotifyUpdateListeners() {
 
   rv = NS_OK;
   for (uint32_t i = 0; i < mUpdateListeners.Length(); i++) {
-    ChunkListenerItem *item = mUpdateListeners[i];
+    ChunkListenerItem* item = mUpdateListeners[i];
 
     LOG(
         ("CacheFileChunk::NotifyUpdateListeners() - Notifying listener %p "
@@ -561,14 +561,14 @@ nsresult CacheFileChunk::Truncate(uint32_t aOffset) {
   return NS_OK;
 }
 
-nsresult CacheFileChunk::OnFileOpened(CacheFileHandle *aHandle,
+nsresult CacheFileChunk::OnFileOpened(CacheFileHandle* aHandle,
                                       nsresult aResult) {
   MOZ_CRASH("CacheFileChunk::OnFileOpened should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFileChunk::OnDataWritten(CacheFileHandle *aHandle,
-                                       const char *aBuf, nsresult aResult) {
+nsresult CacheFileChunk::OnDataWritten(CacheFileHandle* aHandle,
+                                       const char* aBuf, nsresult aResult) {
   LOG((
       "CacheFileChunk::OnDataWritten() [this=%p, handle=%p, result=0x%08" PRIx32
       "]",
@@ -597,7 +597,7 @@ nsresult CacheFileChunk::OnDataWritten(CacheFileHandle *aHandle,
   return NS_OK;
 }
 
-nsresult CacheFileChunk::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+nsresult CacheFileChunk::OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                                     nsresult aResult) {
   LOG(("CacheFileChunk::OnDataRead() [this=%p, handle=%p, result=0x%08" PRIx32
        "]",
@@ -661,18 +661,18 @@ nsresult CacheFileChunk::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
   return NS_OK;
 }
 
-nsresult CacheFileChunk::OnFileDoomed(CacheFileHandle *aHandle,
+nsresult CacheFileChunk::OnFileDoomed(CacheFileHandle* aHandle,
                                       nsresult aResult) {
   MOZ_CRASH("CacheFileChunk::OnFileDoomed should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFileChunk::OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheFileChunk::OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) {
   MOZ_CRASH("CacheFileChunk::OnEOFSet should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFileChunk::OnFileRenamed(CacheFileHandle *aHandle,
+nsresult CacheFileChunk::OnFileRenamed(CacheFileHandle* aHandle,
                                        nsresult aResult) {
   MOZ_CRASH("CacheFileChunk::OnFileRenamed should not be called!");
   return NS_ERROR_UNEXPECTED;
@@ -832,7 +832,7 @@ void CacheFileChunk::BuffersAllocationChanged(uint32_t aFreed,
        static_cast(ChunksMemoryUsage()), this));
 }
 
-mozilla::Atomic &CacheFileChunk::ChunksMemoryUsage()
+mozilla::Atomic& CacheFileChunk::ChunksMemoryUsage()
     const {
   static mozilla::Atomic chunksMemoryUsage(0);
   static mozilla::Atomic prioChunksMemoryUsage(0);
diff --git a/netwerk/cache2/CacheFileChunk.h b/netwerk/cache2/CacheFileChunk.h
index 7d5c26a04278f..3028b7266f6fe 100644
--- a/netwerk/cache2/CacheFileChunk.h
+++ b/netwerk/cache2/CacheFileChunk.h
@@ -25,15 +25,15 @@ class CacheFileChunkBuffer {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CacheFileChunkBuffer)
 
-  explicit CacheFileChunkBuffer(CacheFileChunk *aChunk);
+  explicit CacheFileChunkBuffer(CacheFileChunk* aChunk);
 
   nsresult EnsureBufSize(uint32_t aSize);
-  void CopyFrom(CacheFileChunkBuffer *aOther);
-  nsresult FillInvalidRanges(CacheFileChunkBuffer *aOther,
-                             CacheFileUtils::ValidityMap *aMap);
+  void CopyFrom(CacheFileChunkBuffer* aOther);
+  nsresult FillInvalidRanges(CacheFileChunkBuffer* aOther,
+                             CacheFileUtils::ValidityMap* aMap);
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
 
-  char *Buf() const { return mBuf; }
+  char* Buf() const { return mBuf; }
   void SetDataSize(uint32_t aDataSize);
   uint32_t DataSize() const { return mDataSize; }
   uint32_t ReadHandlesCount() const { return mReadHandlesCount; }
@@ -55,8 +55,8 @@ class CacheFileChunkBuffer {
   // buffer is referenced only by chunk and handles. Handles are always
   // destroyed before the chunk so it is guaranteed that mChunk is a valid
   // pointer for the whole buffer's lifetime.
-  CacheFileChunk *mChunk;
-  char *mBuf;
+  CacheFileChunk* mChunk;
+  char* mBuf;
   uint32_t mBufSize;
   uint32_t mDataSize;
   uint32_t mReadHandlesCount;
@@ -74,18 +74,18 @@ class CacheFileChunkHandle {
 
 class CacheFileChunkReadHandle : public CacheFileChunkHandle {
  public:
-  explicit CacheFileChunkReadHandle(CacheFileChunkBuffer *aBuf);
+  explicit CacheFileChunkReadHandle(CacheFileChunkBuffer* aBuf);
   ~CacheFileChunkReadHandle();
 
-  const char *Buf();
+  const char* Buf();
 };
 
 class CacheFileChunkWriteHandle : public CacheFileChunkHandle {
  public:
-  explicit CacheFileChunkWriteHandle(CacheFileChunkBuffer *aBuf);
+  explicit CacheFileChunkWriteHandle(CacheFileChunkBuffer* aBuf);
   ~CacheFileChunkWriteHandle();
 
-  char *Buf();
+  char* Buf();
   void UpdateDataSize(uint32_t aOffset, uint32_t aLen);
 };
 
@@ -100,11 +100,11 @@ class CacheFileChunkListener : public nsISupports {
  public:
   NS_DECLARE_STATIC_IID_ACCESSOR(CACHEFILECHUNKLISTENER_IID)
 
-  NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk *aChunk) = 0;
-  NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk *aChunk) = 0;
+  NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk* aChunk) = 0;
+  NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk* aChunk) = 0;
   NS_IMETHOD OnChunkAvailable(nsresult aResult, uint32_t aChunkIdx,
-                              CacheFileChunk *aChunk) = 0;
-  NS_IMETHOD OnChunkUpdated(CacheFileChunk *aChunk) = 0;
+                              CacheFileChunk* aChunk) = 0;
+  NS_IMETHOD OnChunkUpdated(CacheFileChunk* aChunk) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(CacheFileChunkListener,
@@ -124,7 +124,7 @@ class ChunkListeners {
   ChunkListeners() { MOZ_COUNT_CTOR(ChunkListeners); }
   ~ChunkListeners() { MOZ_COUNT_DTOR(ChunkListeners); }
 
-  nsTArray mItems;
+  nsTArray mItems;
 };
 
 class CacheFileChunk final : public CacheFileIOListener,
@@ -133,28 +133,28 @@ class CacheFileChunk final : public CacheFileIOListener,
   NS_DECL_THREADSAFE_ISUPPORTS
   bool DispatchRelease();
 
-  CacheFileChunk(CacheFile *aFile, uint32_t aIndex, bool aInitByWriter);
+  CacheFileChunk(CacheFile* aFile, uint32_t aIndex, bool aInitByWriter);
 
   void InitNew();
-  nsresult Read(CacheFileHandle *aHandle, uint32_t aLen,
-                CacheHash::Hash16_t aHash, CacheFileChunkListener *aCallback);
-  nsresult Write(CacheFileHandle *aHandle, CacheFileChunkListener *aCallback);
-  void WaitForUpdate(CacheFileChunkListener *aCallback);
-  nsresult CancelWait(CacheFileChunkListener *aCallback);
+  nsresult Read(CacheFileHandle* aHandle, uint32_t aLen,
+                CacheHash::Hash16_t aHash, CacheFileChunkListener* aCallback);
+  nsresult Write(CacheFileHandle* aHandle, CacheFileChunkListener* aCallback);
+  void WaitForUpdate(CacheFileChunkListener* aCallback);
+  nsresult CancelWait(CacheFileChunkListener* aCallback);
   nsresult NotifyUpdateListeners();
 
   uint32_t Index() const;
   CacheHash::Hash16_t Hash() const;
   uint32_t DataSize() const;
 
-  NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+  NS_IMETHOD OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                            nsresult aResult) override;
-  NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+  NS_IMETHOD OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                         nsresult aResult) override;
-  NS_IMETHOD OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) override;
+  NS_IMETHOD OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnFileRenamed(CacheFileHandle* aHandle, nsresult aResult) override;
   virtual bool IsKilled() override;
 
   bool IsReady() const;
@@ -187,7 +187,7 @@ class CacheFileChunk final : public CacheFileIOListener,
   bool CanAllocate(uint32_t aSize) const;
   void BuffersAllocationChanged(uint32_t aFreed, uint32_t aAllocated);
 
-  mozilla::Atomic &ChunksMemoryUsage() const;
+  mozilla::Atomic& ChunksMemoryUsage() const;
 
   enum EState { INITIAL = 0, READING = 1, WRITING = 2, READY = 3 };
 
@@ -228,7 +228,7 @@ class CacheFileChunk final : public CacheFileIOListener,
   RefPtr mFile;  // is null if chunk is cached to
                             // prevent reference cycles
   nsCOMPtr mListener;
-  nsTArray mUpdateListeners;
+  nsTArray mUpdateListeners;
   CacheFileUtils::ValidityMap mValidityMap;
 };
 
diff --git a/netwerk/cache2/CacheFileContextEvictor.cpp b/netwerk/cache2/CacheFileContextEvictor.cpp
index 46bac0f82e270..b2cb27b34ecdb 100644
--- a/netwerk/cache2/CacheFileContextEvictor.cpp
+++ b/netwerk/cache2/CacheFileContextEvictor.cpp
@@ -36,7 +36,7 @@ CacheFileContextEvictor::~CacheFileContextEvictor() {
   LOG(("CacheFileContextEvictor::~CacheFileContextEvictor() [this=%p]", this));
 }
 
-nsresult CacheFileContextEvictor::Init(nsIFile *aCacheDirectory) {
+nsresult CacheFileContextEvictor::Init(nsIFile* aCacheDirectory) {
   LOG(("CacheFileContextEvictor::Init()"));
 
   nsresult rv;
@@ -83,8 +83,8 @@ uint32_t CacheFileContextEvictor::ContextsCount() {
 }
 
 nsresult CacheFileContextEvictor::AddContext(
-    nsILoadContextInfo *aLoadContextInfo, bool aPinned,
-    const nsAString &aOrigin) {
+    nsILoadContextInfo* aLoadContextInfo, bool aPinned,
+    const nsAString& aOrigin) {
   LOG(
       ("CacheFileContextEvictor::AddContext() [this=%p, loadContextInfo=%p, "
        "pinned=%d]",
@@ -94,7 +94,7 @@ nsresult CacheFileContextEvictor::AddContext(
 
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThread());
 
-  CacheFileContextEvictorEntry *entry = nullptr;
+  CacheFileContextEvictorEntry* entry = nullptr;
   if (aLoadContextInfo) {
     for (uint32_t i = 0; i < mEntries.Length(); ++i) {
       if (mEntries[i]->mInfo && mEntries[i]->mInfo->Equals(aLoadContextInfo) &&
@@ -201,10 +201,10 @@ nsresult CacheFileContextEvictor::CacheIndexStateChanged() {
   return NS_OK;
 }
 
-nsresult CacheFileContextEvictor::WasEvicted(const nsACString &aKey,
-                                             nsIFile *aFile,
-                                             bool *aEvictedAsPinned,
-                                             bool *aEvictedAsNonPinned) {
+nsresult CacheFileContextEvictor::WasEvicted(const nsACString& aKey,
+                                             nsIFile* aFile,
+                                             bool* aEvictedAsPinned,
+                                             bool* aEvictedAsNonPinned) {
   LOG(("CacheFileContextEvictor::WasEvicted() [key=%s]",
        PromiseFlatCString(aKey).get()));
 
@@ -223,7 +223,7 @@ nsresult CacheFileContextEvictor::WasEvicted(const nsACString &aKey,
   }
 
   for (uint32_t i = 0; i < mEntries.Length(); ++i) {
-    CacheFileContextEvictorEntry *entry = mEntries[i];
+    CacheFileContextEvictorEntry* entry = mEntries[i];
 
     if (entry->mInfo && !info->Equals(entry->mInfo)) {
       continue;
@@ -260,8 +260,8 @@ nsresult CacheFileContextEvictor::WasEvicted(const nsACString &aKey,
 }
 
 nsresult CacheFileContextEvictor::PersistEvictionInfoToDisk(
-    nsILoadContextInfo *aLoadContextInfo, bool aPinned,
-    const nsAString &aOrigin) {
+    nsILoadContextInfo* aLoadContextInfo, bool aPinned,
+    const nsAString& aOrigin) {
   LOG(
       ("CacheFileContextEvictor::PersistEvictionInfoToDisk() [this=%p, "
        "loadContextInfo=%p]",
@@ -279,7 +279,7 @@ nsresult CacheFileContextEvictor::PersistEvictionInfoToDisk(
 
   nsCString path = file->HumanReadablePath();
 
-  PRFileDesc *fd;
+  PRFileDesc* fd;
   rv =
       file->OpenNSPRFileDesc(PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE, 0600, &fd);
   if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -301,8 +301,8 @@ nsresult CacheFileContextEvictor::PersistEvictionInfoToDisk(
 }
 
 nsresult CacheFileContextEvictor::RemoveEvictInfoFromDisk(
-    nsILoadContextInfo *aLoadContextInfo, bool aPinned,
-    const nsAString &aOrigin) {
+    nsILoadContextInfo* aLoadContextInfo, bool aPinned,
+    const nsAString& aOrigin) {
   LOG(
       ("CacheFileContextEvictor::RemoveEvictInfoFromDisk() [this=%p, "
        "loadContextInfo=%p]",
@@ -433,7 +433,7 @@ nsresult CacheFileContextEvictor::LoadEvictInfoFromDisk() {
       continue;
     }
 
-    CacheFileContextEvictorEntry *entry = new CacheFileContextEvictorEntry();
+    CacheFileContextEvictorEntry* entry = new CacheFileContextEvictorEntry();
     entry->mInfo = info;
     entry->mPinned = pinned;
     CopyUTF8toUTF16(origin, entry->mOrigin);
@@ -445,8 +445,8 @@ nsresult CacheFileContextEvictor::LoadEvictInfoFromDisk() {
 }
 
 nsresult CacheFileContextEvictor::GetContextFile(
-    nsILoadContextInfo *aLoadContextInfo, bool aPinned,
-    const nsAString &aOrigin, nsIFile **_retval) {
+    nsILoadContextInfo* aLoadContextInfo, bool aPinned,
+    const nsAString& aOrigin, nsIFile** _retval) {
   nsresult rv;
 
   nsAutoCString leafName;
@@ -648,7 +648,7 @@ nsresult CacheFileContextEvictor::EvictEntries() {
 
     CacheIndex::EntryStatus status;
     bool pinned = false;
-    auto callback = [&pinned](const CacheIndexEntry *aEntry) {
+    auto callback = [&pinned](const CacheIndexEntry* aEntry) {
       pinned = aEntry->IsPinned();
     };
     rv = CacheIndex::HasEntry(hash, &status, callback);
diff --git a/netwerk/cache2/CacheFileContextEvictor.h b/netwerk/cache2/CacheFileContextEvictor.h
index 16442fb97cbbb..becacef152af5 100644
--- a/netwerk/cache2/CacheFileContextEvictor.h
+++ b/netwerk/cache2/CacheFileContextEvictor.h
@@ -35,14 +35,14 @@ class CacheFileContextEvictor {
   virtual ~CacheFileContextEvictor();
 
  public:
-  nsresult Init(nsIFile *aCacheDirectory);
+  nsresult Init(nsIFile* aCacheDirectory);
   void Shutdown();
 
   // Returns number of contexts that are being evicted.
   uint32_t ContextsCount();
   // Start evicting given context and an origin, if not empty.
-  nsresult AddContext(nsILoadContextInfo *aLoadContextInfo, bool aPinned,
-                      const nsAString &aOrigin);
+  nsresult AddContext(nsILoadContextInfo* aLoadContextInfo, bool aPinned,
+                      const nsAString& aOrigin);
   // CacheFileIOManager calls this method when CacheIndex's state changes. We
   // check whether the index is up to date and start or stop evicting according
   // to index's state.
@@ -52,25 +52,25 @@ class CacheFileContextEvictor {
   // info to the given key and the last modified time of the entry file is
   // earlier than the time stamp of the time when the context was added to the
   // evictor.
-  nsresult WasEvicted(const nsACString &aKey, nsIFile *aFile,
-                      bool *aEvictedAsPinned, bool *aEvictedAsNonPinned);
+  nsresult WasEvicted(const nsACString& aKey, nsIFile* aFile,
+                      bool* aEvictedAsPinned, bool* aEvictedAsNonPinned);
 
  private:
   // Writes information about eviction of the given context to the disk. This is
   // done for every context added to the evictor to be able to recover eviction
   // after a shutdown or crash. When the context file is found after startup, we
   // restore mTimeStamp from the last modified time of the file.
-  nsresult PersistEvictionInfoToDisk(nsILoadContextInfo *aLoadContextInfo,
-                                     bool aPinned, const nsAString &aOrigin);
+  nsresult PersistEvictionInfoToDisk(nsILoadContextInfo* aLoadContextInfo,
+                                     bool aPinned, const nsAString& aOrigin);
   // Once we are done with eviction for the given context, the eviction info is
   // removed from the disk.
-  nsresult RemoveEvictInfoFromDisk(nsILoadContextInfo *aLoadContextInfo,
-                                   bool aPinned, const nsAString &aOrigin);
+  nsresult RemoveEvictInfoFromDisk(nsILoadContextInfo* aLoadContextInfo,
+                                   bool aPinned, const nsAString& aOrigin);
   // Tries to load all contexts from the disk. This method is called just once
   // after startup.
   nsresult LoadEvictInfoFromDisk();
-  nsresult GetContextFile(nsILoadContextInfo *aLoadContextInfo, bool aPinned,
-                          const nsAString &aOrigin, nsIFile **_retval);
+  nsresult GetContextFile(nsILoadContextInfo* aLoadContextInfo, bool aPinned,
+                          const nsAString& aOrigin, nsIFile** _retval);
 
   void CreateIterators();
   void CloseIterators();
diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp
index 47230503f705d..dddd82c103f3b 100644
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -109,7 +109,7 @@ NS_INTERFACE_MAP_BEGIN(CacheFileHandle)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-CacheFileHandle::CacheFileHandle(const SHA1Sum::Hash *aHash, bool aPriority,
+CacheFileHandle::CacheFileHandle(const SHA1Sum::Hash* aHash, bool aPriority,
                                  PinningStatus aPinning)
     : mHash(aHash),
       mIsDoomed(false),
@@ -134,7 +134,7 @@ CacheFileHandle::CacheFileHandle(const SHA1Sum::Hash *aHash, bool aPriority,
       this, LOGSHA1(aHash)));
 }
 
-CacheFileHandle::CacheFileHandle(const nsACString &aKey, bool aPriority,
+CacheFileHandle::CacheFileHandle(const nsACString& aKey, bool aPriority,
                                  PinningStatus aPinning)
     : mHash(nullptr),
       mIsDoomed(false),
@@ -262,13 +262,13 @@ size_t CacheFileHandle::SizeOfIncludingThis(
  *  CacheFileHandles::HandleHashKey
  *****************************************************************************/
 
-void CacheFileHandles::HandleHashKey::AddHandle(CacheFileHandle *aHandle) {
+void CacheFileHandles::HandleHashKey::AddHandle(CacheFileHandle* aHandle) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
 
   mHandles.InsertElementAt(0, aHandle);
 }
 
-void CacheFileHandles::HandleHashKey::RemoveHandle(CacheFileHandle *aHandle) {
+void CacheFileHandles::HandleHashKey::RemoveHandle(CacheFileHandle* aHandle) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
 
   DebugOnly found;
@@ -289,11 +289,11 @@ CacheFileHandles::HandleHashKey::GetNewestHandle() {
 }
 
 void CacheFileHandles::HandleHashKey::GetHandles(
-    nsTArray > &aResult) {
+    nsTArray >& aResult) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
 
   for (uint32_t i = 0; i < mHandles.Length(); ++i) {
-    CacheFileHandle *handle = mHandles[i];
+    CacheFileHandle* handle = mHandles[i];
     aResult.AppendElement(handle);
   }
 }
@@ -302,7 +302,7 @@ void CacheFileHandles::HandleHashKey::GetHandles(
 
 void CacheFileHandles::HandleHashKey::AssertHandlesState() {
   for (uint32_t i = 0; i < mHandles.Length(); ++i) {
-    CacheFileHandle *handle = mHandles[i];
+    CacheFileHandle* handle = mHandles[i];
     MOZ_ASSERT(handle->IsDoomed());
   }
 }
@@ -336,8 +336,8 @@ CacheFileHandles::~CacheFileHandles() {
   MOZ_COUNT_DTOR(CacheFileHandles);
 }
 
-nsresult CacheFileHandles::GetHandle(const SHA1Sum::Hash *aHash,
-                                     CacheFileHandle **_retval) {
+nsresult CacheFileHandles::GetHandle(const SHA1Sum::Hash* aHash,
+                                     CacheFileHandle** _retval) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
   MOZ_ASSERT(aHash);
 
@@ -347,7 +347,7 @@ nsresult CacheFileHandles::GetHandle(const SHA1Sum::Hash *aHash,
 #endif
 
   // find hash entry for key
-  HandleHashKey *entry = mTable.GetEntry(*aHash);
+  HandleHashKey* entry = mTable.GetEntry(*aHash);
   if (!entry) {
     LOG(
         ("CacheFileHandles::GetHandle() hash=%08x%08x%08x%08x%08x "
@@ -387,9 +387,9 @@ nsresult CacheFileHandles::GetHandle(const SHA1Sum::Hash *aHash,
   return NS_OK;
 }
 
-nsresult CacheFileHandles::NewHandle(const SHA1Sum::Hash *aHash, bool aPriority,
+nsresult CacheFileHandles::NewHandle(const SHA1Sum::Hash* aHash, bool aPriority,
                                      CacheFileHandle::PinningStatus aPinning,
-                                     CacheFileHandle **_retval) {
+                                     CacheFileHandle** _retval) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
   MOZ_ASSERT(aHash);
 
@@ -399,7 +399,7 @@ nsresult CacheFileHandles::NewHandle(const SHA1Sum::Hash *aHash, bool aPriority,
 #endif
 
   // find hash entry for key
-  HandleHashKey *entry = mTable.PutEntry(*aHash);
+  HandleHashKey* entry = mTable.PutEntry(*aHash);
 
 #ifdef DEBUG_HANDLES
   Log(entry);
@@ -422,7 +422,7 @@ nsresult CacheFileHandles::NewHandle(const SHA1Sum::Hash *aHash, bool aPriority,
   return NS_OK;
 }
 
-void CacheFileHandles::RemoveHandle(CacheFileHandle *aHandle) {
+void CacheFileHandles::RemoveHandle(CacheFileHandle* aHandle) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
   MOZ_ASSERT(aHandle);
 
@@ -437,7 +437,7 @@ void CacheFileHandles::RemoveHandle(CacheFileHandle *aHandle) {
 #endif
 
   // find hash entry for key
-  HandleHashKey *entry = mTable.GetEntry(*aHandle->Hash());
+  HandleHashKey* entry = mTable.GetEntry(*aHandle->Hash());
   if (!entry) {
     MOZ_ASSERT(CacheFileIOManager::IsShutdown(),
                "Should find entry when removing a handle before shutdown");
@@ -469,7 +469,7 @@ void CacheFileHandles::RemoveHandle(CacheFileHandle *aHandle) {
 }
 
 void CacheFileHandles::GetAllHandles(
-    nsTArray > *_retval) {
+    nsTArray >* _retval) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
   for (auto iter = mTable.Iter(); !iter.Done(); iter.Next()) {
     iter.Get()->GetHandles(*_retval);
@@ -477,7 +477,7 @@ void CacheFileHandles::GetAllHandles(
 }
 
 void CacheFileHandles::GetActiveHandles(
-    nsTArray > *_retval) {
+    nsTArray >* _retval) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
   for (auto iter = mTable.Iter(); !iter.Done(); iter.Next()) {
     RefPtr handle = iter.Get()->GetNewestHandle();
@@ -497,14 +497,14 @@ void CacheFileHandles::ClearAll() {
 uint32_t CacheFileHandles::HandleCount() { return mTable.Count(); }
 
 #ifdef DEBUG_HANDLES
-void CacheFileHandles::Log(CacheFileHandlesEntry *entry) {
+void CacheFileHandles::Log(CacheFileHandlesEntry* entry) {
   LOG(("CacheFileHandles::Log() BEGIN [entry=%p]", entry));
 
   nsTArray > array;
   aEntry->GetHandles(array);
 
   for (uint32_t i = 0; i < array.Length(); ++i) {
-    CacheFileHandle *handle = array[i];
+    CacheFileHandle* handle = array[i];
     handle->Log();
   }
 
@@ -577,12 +577,12 @@ class IOPerfReportEvent {
   explicit IOPerfReportEvent(CacheFileUtils::CachePerfStats::EDataType aType)
       : mType(aType), mEventCounter(0) {}
 
-  void Start(CacheIOThread *aIOThread) {
+  void Start(CacheIOThread* aIOThread) {
     mStartTime = TimeStamp::Now();
     mEventCounter = aIOThread->EventCounter();
   }
 
-  void Report(CacheIOThread *aIOThread) {
+  void Report(CacheIOThread* aIOThread) {
     if (mStartTime.IsNull()) {
       return;
     }
@@ -608,8 +608,8 @@ class IOPerfReportEvent {
 
 class OpenFileEvent : public Runnable, public IOPerfReportEvent {
  public:
-  OpenFileEvent(const nsACString &aKey, uint32_t aFlags,
-                CacheFileIOListener *aCallback)
+  OpenFileEvent(const nsACString& aKey, uint32_t aFlags,
+                CacheFileIOListener* aCallback)
       : Runnable("net::OpenFileEvent"),
         IOPerfReportEvent(CacheFileUtils::CachePerfStats::IO_OPEN),
         mFlags(aFlags),
@@ -670,8 +670,8 @@ class OpenFileEvent : public Runnable, public IOPerfReportEvent {
 
 class ReadEvent : public Runnable, public IOPerfReportEvent {
  public:
-  ReadEvent(CacheFileHandle *aHandle, int64_t aOffset, char *aBuf,
-            int32_t aCount, CacheFileIOListener *aCallback)
+  ReadEvent(CacheFileHandle* aHandle, int64_t aOffset, char* aBuf,
+            int32_t aCount, CacheFileIOListener* aCallback)
       : Runnable("net::ReadEvent"),
         IOPerfReportEvent(CacheFileUtils::CachePerfStats::IO_READ),
         mHandle(aHandle),
@@ -708,16 +708,16 @@ class ReadEvent : public Runnable, public IOPerfReportEvent {
  protected:
   RefPtr mHandle;
   int64_t mOffset;
-  char *mBuf;
+  char* mBuf;
   int32_t mCount;
   nsCOMPtr mCallback;
 };
 
 class WriteEvent : public Runnable, public IOPerfReportEvent {
  public:
-  WriteEvent(CacheFileHandle *aHandle, int64_t aOffset, const char *aBuf,
+  WriteEvent(CacheFileHandle* aHandle, int64_t aOffset, const char* aBuf,
              int32_t aCount, bool aValidate, bool aTruncate,
-             CacheFileIOListener *aCallback)
+             CacheFileIOListener* aCallback)
       : Runnable("net::WriteEvent"),
         IOPerfReportEvent(CacheFileUtils::CachePerfStats::IO_WRITE),
         mHandle(aHandle),
@@ -735,7 +735,7 @@ class WriteEvent : public Runnable, public IOPerfReportEvent {
  protected:
   ~WriteEvent() {
     if (!mCallback && mBuf) {
-      free(const_cast(mBuf));
+      free(const_cast(mBuf));
     }
   }
 
@@ -765,7 +765,7 @@ class WriteEvent : public Runnable, public IOPerfReportEvent {
     if (mCallback) {
       mCallback->OnDataWritten(mHandle, mBuf, rv);
     } else {
-      free(const_cast(mBuf));
+      free(const_cast(mBuf));
       mBuf = nullptr;
     }
 
@@ -775,7 +775,7 @@ class WriteEvent : public Runnable, public IOPerfReportEvent {
  protected:
   RefPtr mHandle;
   int64_t mOffset;
-  const char *mBuf;
+  const char* mBuf;
   int32_t mCount;
   bool mValidate : 1;
   bool mTruncate : 1;
@@ -784,7 +784,7 @@ class WriteEvent : public Runnable, public IOPerfReportEvent {
 
 class DoomFileEvent : public Runnable {
  public:
-  DoomFileEvent(CacheFileHandle *aHandle, CacheFileIOListener *aCallback)
+  DoomFileEvent(CacheFileHandle* aHandle, CacheFileIOListener* aCallback)
       : Runnable("net::DoomFileEvent"),
         mCallback(aCallback),
         mHandle(aHandle) {}
@@ -817,7 +817,7 @@ class DoomFileEvent : public Runnable {
 
 class DoomFileByKeyEvent : public Runnable {
  public:
-  DoomFileByKeyEvent(const nsACString &aKey, CacheFileIOListener *aCallback)
+  DoomFileByKeyEvent(const nsACString& aKey, CacheFileIOListener* aCallback)
       : Runnable("net::DoomFileByKeyEvent"), mCallback(aCallback) {
     SHA1Sum sum;
     sum.update(aKey.BeginReading(), aKey.Length());
@@ -855,7 +855,7 @@ class DoomFileByKeyEvent : public Runnable {
 
 class ReleaseNSPRHandleEvent : public Runnable {
  public:
-  explicit ReleaseNSPRHandleEvent(CacheFileHandle *aHandle)
+  explicit ReleaseNSPRHandleEvent(CacheFileHandle* aHandle)
       : Runnable("net::ReleaseNSPRHandleEvent"), mHandle(aHandle) {}
 
  protected:
@@ -876,8 +876,8 @@ class ReleaseNSPRHandleEvent : public Runnable {
 
 class TruncateSeekSetEOFEvent : public Runnable {
  public:
-  TruncateSeekSetEOFEvent(CacheFileHandle *aHandle, int64_t aTruncatePos,
-                          int64_t aEOFPos, CacheFileIOListener *aCallback)
+  TruncateSeekSetEOFEvent(CacheFileHandle* aHandle, int64_t aTruncatePos,
+                          int64_t aEOFPos, CacheFileIOListener* aCallback)
       : Runnable("net::TruncateSeekSetEOFEvent"),
         mHandle(aHandle),
         mTruncatePos(aTruncatePos),
@@ -914,8 +914,8 @@ class TruncateSeekSetEOFEvent : public Runnable {
 
 class RenameFileEvent : public Runnable {
  public:
-  RenameFileEvent(CacheFileHandle *aHandle, const nsACString &aNewName,
-                  CacheFileIOListener *aCallback)
+  RenameFileEvent(CacheFileHandle* aHandle, const nsACString& aNewName,
+                  CacheFileIOListener* aCallback)
       : Runnable("net::RenameFileEvent"),
         mHandle(aHandle),
         mNewName(aNewName),
@@ -949,7 +949,7 @@ class RenameFileEvent : public Runnable {
 
 class InitIndexEntryEvent : public Runnable {
  public:
-  InitIndexEntryEvent(CacheFileHandle *aHandle,
+  InitIndexEntryEvent(CacheFileHandle* aHandle,
                       OriginAttrsHash aOriginAttrsHash, bool aAnonymous,
                       bool aPinning)
       : Runnable("net::InitIndexEntryEvent"),
@@ -990,11 +990,11 @@ class InitIndexEntryEvent : public Runnable {
 
 class UpdateIndexEntryEvent : public Runnable {
  public:
-  UpdateIndexEntryEvent(CacheFileHandle *aHandle, const uint32_t *aFrecency,
-                        const bool *aHasAltData, const uint16_t *aOnStartTime,
-                        const uint16_t *aOnStopTime,
-                        const uint8_t *aContentType,
-                        const uint16_t *aBaseDomainAccessCount,
+  UpdateIndexEntryEvent(CacheFileHandle* aHandle, const uint32_t* aFrecency,
+                        const bool* aHasAltData, const uint16_t* aOnStartTime,
+                        const uint16_t* aOnStopTime,
+                        const uint8_t* aContentType,
+                        const uint16_t* aBaseDomainAccessCount,
                         const uint32_t aTelemetryReportID)
       : Runnable("net::UpdateIndexEntryEvent"),
         mHandle(aHandle),
@@ -1083,7 +1083,7 @@ class MetadataWriteScheduleEvent : public Runnable {
   RefPtr mFile;
   RefPtr mIOMan;
 
-  MetadataWriteScheduleEvent(CacheFileIOManager *aManager, CacheFile *aFile,
+  MetadataWriteScheduleEvent(CacheFileIOManager* aManager, CacheFile* aFile,
                              EMode aMode)
       : Runnable("net::MetadataWriteScheduleEvent"),
         mMode(aMode),
@@ -1226,7 +1226,7 @@ nsresult CacheFileIOManager::ShutdownInternal() {
   handles.AppendElements(mSpecialHandles);
 
   for (uint32_t i = 0; i < handles.Length(); i++) {
-    CacheFileHandle *h = handles[i];
+    CacheFileHandle* h = handles[i];
     h->mClosed = true;
 
     h->Log();
@@ -1298,7 +1298,7 @@ nsresult CacheFileIOManager::OnProfile() {
 
 #if defined(MOZ_WIDGET_ANDROID)
   nsCOMPtr profilelessDirectory;
-  char *cachePath = getenv("CACHE_DIRECTORY");
+  char* cachePath = getenv("CACHE_DIRECTORY");
   if (!directory && cachePath && *cachePath) {
     rv = NS_NewNativeLocalFile(nsDependentCString(cachePath), true,
                                getter_AddRefs(directory));
@@ -1411,7 +1411,7 @@ bool CacheFileIOManager::IsShutdown() {
 }
 
 // static
-nsresult CacheFileIOManager::ScheduleMetadataWrite(CacheFile *aFile) {
+nsresult CacheFileIOManager::ScheduleMetadataWrite(CacheFile* aFile) {
   RefPtr ioMan = gInstance;
   NS_ENSURE_TRUE(ioMan, NS_ERROR_NOT_INITIALIZED);
 
@@ -1424,7 +1424,7 @@ nsresult CacheFileIOManager::ScheduleMetadataWrite(CacheFile *aFile) {
   return target->Dispatch(event, nsIEventTarget::DISPATCH_NORMAL);
 }
 
-nsresult CacheFileIOManager::ScheduleMetadataWriteInternal(CacheFile *aFile) {
+nsresult CacheFileIOManager::ScheduleMetadataWriteInternal(CacheFile* aFile) {
   MOZ_ASSERT(IsOnIOThreadOrCeased());
 
   nsresult rv;
@@ -1446,7 +1446,7 @@ nsresult CacheFileIOManager::ScheduleMetadataWriteInternal(CacheFile *aFile) {
 }
 
 // static
-nsresult CacheFileIOManager::UnscheduleMetadataWrite(CacheFile *aFile) {
+nsresult CacheFileIOManager::UnscheduleMetadataWrite(CacheFile* aFile) {
   RefPtr ioMan = gInstance;
   NS_ENSURE_TRUE(ioMan, NS_ERROR_NOT_INITIALIZED);
 
@@ -1459,7 +1459,7 @@ nsresult CacheFileIOManager::UnscheduleMetadataWrite(CacheFile *aFile) {
   return target->Dispatch(event, nsIEventTarget::DISPATCH_NORMAL);
 }
 
-nsresult CacheFileIOManager::UnscheduleMetadataWriteInternal(CacheFile *aFile) {
+nsresult CacheFileIOManager::UnscheduleMetadataWriteInternal(CacheFile* aFile) {
   MOZ_ASSERT(IsOnIOThreadOrCeased());
 
   mScheduledMetadataWrites.RemoveElement(aFile);
@@ -1490,7 +1490,7 @@ nsresult CacheFileIOManager::ShutdownMetadataWriteSchedulingInternal() {
   nsTArray > files;
   files.SwapElements(mScheduledMetadataWrites);
   for (uint32_t i = 0; i < files.Length(); ++i) {
-    CacheFile *file = files[i];
+    CacheFile* file = files[i];
     file->WriteMetadataIfNeeded();
   }
 
@@ -1503,7 +1503,7 @@ nsresult CacheFileIOManager::ShutdownMetadataWriteSchedulingInternal() {
 }
 
 NS_IMETHODIMP
-CacheFileIOManager::Notify(nsITimer *aTimer) {
+CacheFileIOManager::Notify(nsITimer* aTimer) {
   MOZ_ASSERT(IsOnIOThreadOrCeased());
   MOZ_ASSERT(mMetadataWritesTimer == aTimer);
 
@@ -1512,7 +1512,7 @@ CacheFileIOManager::Notify(nsITimer *aTimer) {
   nsTArray > files;
   files.SwapElements(mScheduledMetadataWrites);
   for (uint32_t i = 0; i < files.Length(); ++i) {
-    CacheFile *file = files[i];
+    CacheFile* file = files[i];
     file->WriteMetadataIfNeeded();
   }
 
@@ -1520,14 +1520,14 @@ CacheFileIOManager::Notify(nsITimer *aTimer) {
 }
 
 NS_IMETHODIMP
-CacheFileIOManager::GetName(nsACString &aName) {
+CacheFileIOManager::GetName(nsACString& aName) {
   aName.AssignLiteral("CacheFileIOManager");
   return NS_OK;
 }
 
 // static
-nsresult CacheFileIOManager::OpenFile(const nsACString &aKey, uint32_t aFlags,
-                                      CacheFileIOListener *aCallback) {
+nsresult CacheFileIOManager::OpenFile(const nsACString& aKey, uint32_t aFlags,
+                                      CacheFileIOListener* aCallback) {
   LOG(("CacheFileIOManager::OpenFile() [key=%s, flags=%d, listener=%p]",
        PromiseFlatCString(aKey).get(), aFlags, aCallback));
 
@@ -1547,10 +1547,10 @@ nsresult CacheFileIOManager::OpenFile(const nsACString &aKey, uint32_t aFlags,
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::OpenFileInternal(const SHA1Sum::Hash *aHash,
-                                              const nsACString &aKey,
+nsresult CacheFileIOManager::OpenFileInternal(const SHA1Sum::Hash* aHash,
+                                              const nsACString& aKey,
                                               uint32_t aFlags,
-                                              CacheFileHandle **_retval) {
+                                              CacheFileHandle** _retval) {
   LOG(
       ("CacheFileIOManager::OpenFileInternal() [hash=%08x%08x%08x%08x%08x, "
        "key=%s, flags=%d]",
@@ -1684,7 +1684,7 @@ nsresult CacheFileIOManager::OpenFileInternal(const SHA1Sum::Hash *aHash,
 }
 
 nsresult CacheFileIOManager::OpenSpecialFileInternal(
-    const nsACString &aKey, uint32_t aFlags, CacheFileHandle **_retval) {
+    const nsACString& aKey, uint32_t aFlags, CacheFileHandle** _retval) {
   LOG(("CacheFileIOManager::OpenSpecialFileInternal() [key=%s, flags=%d]",
        PromiseFlatCString(aKey).get(), aFlags));
 
@@ -1777,7 +1777,7 @@ nsresult CacheFileIOManager::OpenSpecialFileInternal(
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::CloseHandleInternal(CacheFileHandle *aHandle) {
+nsresult CacheFileIOManager::CloseHandleInternal(CacheFileHandle* aHandle) {
   nsresult rv;
 
   LOG(("CacheFileIOManager::CloseHandleInternal() [handle=%p]", aHandle));
@@ -1828,9 +1828,9 @@ nsresult CacheFileIOManager::CloseHandleInternal(CacheFileHandle *aHandle) {
 }
 
 // static
-nsresult CacheFileIOManager::Read(CacheFileHandle *aHandle, int64_t aOffset,
-                                  char *aBuf, int32_t aCount,
-                                  CacheFileIOListener *aCallback) {
+nsresult CacheFileIOManager::Read(CacheFileHandle* aHandle, int64_t aOffset,
+                                  char* aBuf, int32_t aCount,
+                                  CacheFileIOListener* aCallback) {
   LOG(("CacheFileIOManager::Read() [handle=%p, offset=%" PRId64 ", count=%d, "
        "listener=%p]",
        aHandle, aOffset, aCount, aCallback));
@@ -1857,8 +1857,8 @@ nsresult CacheFileIOManager::Read(CacheFileHandle *aHandle, int64_t aOffset,
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::ReadInternal(CacheFileHandle *aHandle,
-                                          int64_t aOffset, char *aBuf,
+nsresult CacheFileIOManager::ReadInternal(CacheFileHandle* aHandle,
+                                          int64_t aOffset, char* aBuf,
                                           int32_t aCount) {
   LOG(("CacheFileIOManager::ReadInternal() [handle=%p, offset=%" PRId64
        ", count=%d]",
@@ -1905,10 +1905,10 @@ nsresult CacheFileIOManager::ReadInternal(CacheFileHandle *aHandle,
 }
 
 // static
-nsresult CacheFileIOManager::Write(CacheFileHandle *aHandle, int64_t aOffset,
-                                   const char *aBuf, int32_t aCount,
+nsresult CacheFileIOManager::Write(CacheFileHandle* aHandle, int64_t aOffset,
+                                   const char* aBuf, int32_t aCount,
                                    bool aValidate, bool aTruncate,
-                                   CacheFileIOListener *aCallback) {
+                                   CacheFileIOListener* aCallback) {
   LOG(("CacheFileIOManager::Write() [handle=%p, offset=%" PRId64 ", count=%d, "
        "validate=%d, truncate=%d, listener=%p]",
        aHandle, aOffset, aCount, aValidate, aTruncate, aCallback));
@@ -1920,7 +1920,7 @@ nsresult CacheFileIOManager::Write(CacheFileHandle *aHandle, int64_t aOffset,
     if (!aCallback) {
       // When no callback is provided, CacheFileIOManager is responsible for
       // releasing the buffer. We must release it even in case of failure.
-      free(const_cast(aBuf));
+      free(const_cast(aBuf));
     }
     return NS_ERROR_NOT_INITIALIZED;
   }
@@ -1935,7 +1935,7 @@ nsresult CacheFileIOManager::Write(CacheFileHandle *aHandle, int64_t aOffset,
   return NS_OK;
 }
 
-static nsresult TruncFile(PRFileDesc *aFD, int64_t aEOF) {
+static nsresult TruncFile(PRFileDesc* aFD, int64_t aEOF) {
 #if defined(XP_UNIX)
   if (ftruncate(PR_FileDesc2NativeHandle(aFD), aEOF) != 0) {
     NS_ERROR("ftruncate failed");
@@ -1958,8 +1958,8 @@ static nsresult TruncFile(PRFileDesc *aFD, int64_t aEOF) {
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::WriteInternal(CacheFileHandle *aHandle,
-                                           int64_t aOffset, const char *aBuf,
+nsresult CacheFileIOManager::WriteInternal(CacheFileHandle* aHandle,
+                                           int64_t aOffset, const char* aBuf,
                                            int32_t aCount, bool aValidate,
                                            bool aTruncate) {
   LOG(("CacheFileIOManager::WriteInternal() [handle=%p, offset=%" PRId64
@@ -2089,8 +2089,8 @@ nsresult CacheFileIOManager::WriteInternal(CacheFileHandle *aHandle,
 }
 
 // static
-nsresult CacheFileIOManager::DoomFile(CacheFileHandle *aHandle,
-                                      CacheFileIOListener *aCallback) {
+nsresult CacheFileIOManager::DoomFile(CacheFileHandle* aHandle,
+                                      CacheFileIOListener* aCallback) {
   LOG(("CacheFileIOManager::DoomFile() [handle=%p, listener=%p]", aHandle,
        aCallback));
 
@@ -2111,7 +2111,7 @@ nsresult CacheFileIOManager::DoomFile(CacheFileHandle *aHandle,
 }
 
 nsresult CacheFileIOManager::DoomFileInternal(
-    CacheFileHandle *aHandle, PinningDoomRestriction aPinningDoomRestriction) {
+    CacheFileHandle* aHandle, PinningDoomRestriction aPinningDoomRestriction) {
   LOG(("CacheFileIOManager::DoomFileInternal() [handle=%p]", aHandle));
   aHandle->Log();
 
@@ -2210,8 +2210,8 @@ nsresult CacheFileIOManager::DoomFileInternal(
 }
 
 // static
-nsresult CacheFileIOManager::DoomFileByKey(const nsACString &aKey,
-                                           CacheFileIOListener *aCallback) {
+nsresult CacheFileIOManager::DoomFileByKey(const nsACString& aKey,
+                                           CacheFileIOListener* aCallback) {
   LOG(("CacheFileIOManager::DoomFileByKey() [key=%s, listener=%p]",
        PromiseFlatCString(aKey).get(), aCallback));
 
@@ -2229,7 +2229,7 @@ nsresult CacheFileIOManager::DoomFileByKey(const nsACString &aKey,
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::DoomFileByKeyInternal(const SHA1Sum::Hash *aHash) {
+nsresult CacheFileIOManager::DoomFileByKeyInternal(const SHA1Sum::Hash* aHash) {
   LOG((
       "CacheFileIOManager::DoomFileByKeyInternal() [hash=%08x%08x%08x%08x%08x]",
       LOGSHA1(aHash)));
@@ -2289,7 +2289,7 @@ nsresult CacheFileIOManager::DoomFileByKeyInternal(const SHA1Sum::Hash *aHash) {
 }
 
 // static
-nsresult CacheFileIOManager::ReleaseNSPRHandle(CacheFileHandle *aHandle) {
+nsresult CacheFileIOManager::ReleaseNSPRHandle(CacheFileHandle* aHandle) {
   LOG(("CacheFileIOManager::ReleaseNSPRHandle() [handle=%p]", aHandle));
 
   nsresult rv;
@@ -2309,7 +2309,7 @@ nsresult CacheFileIOManager::ReleaseNSPRHandle(CacheFileHandle *aHandle) {
 }
 
 nsresult CacheFileIOManager::MaybeReleaseNSPRHandleInternal(
-    CacheFileHandle *aHandle, bool aIgnoreShutdownLag) {
+    CacheFileHandle* aHandle, bool aIgnoreShutdownLag) {
   LOG(
       ("CacheFileIOManager::MaybeReleaseNSPRHandleInternal() [handle=%p, "
        "ignore shutdown=%d]",
@@ -2323,7 +2323,7 @@ nsresult CacheFileIOManager::MaybeReleaseNSPRHandleInternal(
     MOZ_ASSERT(found);
   }
 
-  PRFileDesc *fd = aHandle->mFD;
+  PRFileDesc* fd = aHandle->mFD;
   aHandle->mFD = nullptr;
 
   // Leak invalid (w/o metadata) and doomed handles immediately after shutdown.
@@ -2369,8 +2369,8 @@ nsresult CacheFileIOManager::MaybeReleaseNSPRHandleInternal(
 
 // static
 nsresult CacheFileIOManager::TruncateSeekSetEOF(
-    CacheFileHandle *aHandle, int64_t aTruncatePos, int64_t aEOFPos,
-    CacheFileIOListener *aCallback) {
+    CacheFileHandle* aHandle, int64_t aTruncatePos, int64_t aEOFPos,
+    CacheFileIOListener* aCallback) {
   LOG(
       ("CacheFileIOManager::TruncateSeekSetEOF() [handle=%p, "
        "truncatePos=%" PRId64 ", "
@@ -2395,7 +2395,7 @@ nsresult CacheFileIOManager::TruncateSeekSetEOF(
 }
 
 // static
-void CacheFileIOManager::GetCacheDirectory(nsIFile **result) {
+void CacheFileIOManager::GetCacheDirectory(nsIFile** result) {
   *result = nullptr;
 
   RefPtr ioMan = gInstance;
@@ -2409,7 +2409,7 @@ void CacheFileIOManager::GetCacheDirectory(nsIFile **result) {
 #if defined(MOZ_WIDGET_ANDROID)
 
 // static
-void CacheFileIOManager::GetProfilelessCacheDirectory(nsIFile **result) {
+void CacheFileIOManager::GetProfilelessCacheDirectory(nsIFile** result) {
   *result = nullptr;
 
   RefPtr ioMan = gInstance;
@@ -2424,8 +2424,8 @@ void CacheFileIOManager::GetProfilelessCacheDirectory(nsIFile **result) {
 
 // static
 nsresult CacheFileIOManager::GetEntryInfo(
-    const SHA1Sum::Hash *aHash,
-    CacheStorageService::EntryInfoCallback *aCallback) {
+    const SHA1Sum::Hash* aHash,
+    CacheStorageService::EntryInfoCallback* aCallback) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThread());
 
   nsresult rv;
@@ -2508,7 +2508,7 @@ nsresult CacheFileIOManager::GetEntryInfo(
 }
 
 nsresult CacheFileIOManager::TruncateSeekSetEOFInternal(
-    CacheFileHandle *aHandle, int64_t aTruncatePos, int64_t aEOFPos) {
+    CacheFileHandle* aHandle, int64_t aTruncatePos, int64_t aEOFPos) {
   LOG(
       ("CacheFileIOManager::TruncateSeekSetEOFInternal() [handle=%p, "
        "truncatePos=%" PRId64 ", EOFPos=%" PRId64 "]",
@@ -2605,9 +2605,9 @@ nsresult CacheFileIOManager::TruncateSeekSetEOFInternal(
 }
 
 // static
-nsresult CacheFileIOManager::RenameFile(CacheFileHandle *aHandle,
-                                        const nsACString &aNewName,
-                                        CacheFileIOListener *aCallback) {
+nsresult CacheFileIOManager::RenameFile(CacheFileHandle* aHandle,
+                                        const nsACString& aNewName,
+                                        CacheFileIOListener* aCallback) {
   LOG(("CacheFileIOManager::RenameFile() [handle=%p, newName=%s, listener=%p]",
        aHandle, PromiseFlatCString(aNewName).get(), aCallback));
 
@@ -2632,8 +2632,8 @@ nsresult CacheFileIOManager::RenameFile(CacheFileHandle *aHandle,
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::RenameFileInternal(CacheFileHandle *aHandle,
-                                                const nsACString &aNewName) {
+nsresult CacheFileIOManager::RenameFileInternal(CacheFileHandle* aHandle,
+                                                const nsACString& aNewName) {
   LOG(("CacheFileIOManager::RenameFileInternal() [handle=%p, newName=%s]",
        aHandle, PromiseFlatCString(aNewName).get()));
 
@@ -3043,8 +3043,8 @@ nsresult CacheFileIOManager::EvictAllInternal() {
 
 // static
 nsresult CacheFileIOManager::EvictByContext(
-    nsILoadContextInfo *aLoadContextInfo, bool aPinned,
-    const nsAString &aOrigin) {
+    nsILoadContextInfo* aLoadContextInfo, bool aPinned,
+    const nsAString& aOrigin) {
   LOG(("CacheFileIOManager::EvictByContext() [loadContextInfo=%p]",
        aLoadContextInfo));
 
@@ -3070,8 +3070,8 @@ nsresult CacheFileIOManager::EvictByContext(
 }
 
 nsresult CacheFileIOManager::EvictByContextInternal(
-    nsILoadContextInfo *aLoadContextInfo, bool aPinned,
-    const nsAString &aOrigin) {
+    nsILoadContextInfo* aLoadContextInfo, bool aPinned,
+    const nsAString& aOrigin) {
   LOG(
       ("CacheFileIOManager::EvictByContextInternal() [loadContextInfo=%p, "
        "pinned=%d]",
@@ -3123,7 +3123,7 @@ nsresult CacheFileIOManager::EvictByContextInternal(
   mHandles.GetActiveHandles(&handles);
 
   for (uint32_t i = 0; i < handles.Length(); ++i) {
-    CacheFileHandle *handle = handles[i];
+    CacheFileHandle* handle = handles[i];
 
     nsAutoCString uriSpec;
     RefPtr info =
@@ -3225,7 +3225,7 @@ nsresult CacheFileIOManager::CacheIndexStateChangedInternal() {
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::TrashDirectory(nsIFile *aFile) {
+nsresult CacheFileIOManager::TrashDirectory(nsIFile* aFile) {
   LOG(("CacheFileIOManager::TrashDirectory() [file=%s]",
        aFile->HumanReadablePath().get()));
 
@@ -3308,7 +3308,7 @@ nsresult CacheFileIOManager::TrashDirectory(nsIFile *aFile) {
 }
 
 // static
-void CacheFileIOManager::OnTrashTimer(nsITimer *aTimer, void *aClosure) {
+void CacheFileIOManager::OnTrashTimer(nsITimer* aTimer, void* aClosure) {
   LOG(("CacheFileIOManager::OnTrashTimer() [timer=%p, closure=%p]", aTimer,
        aClosure));
 
@@ -3531,7 +3531,7 @@ nsresult CacheFileIOManager::FindTrashDirToRemove() {
 }
 
 // static
-nsresult CacheFileIOManager::InitIndexEntry(CacheFileHandle *aHandle,
+nsresult CacheFileIOManager::InitIndexEntry(CacheFileHandle* aHandle,
                                             OriginAttrsHash aOriginAttrsHash,
                                             bool aAnonymous, bool aPinning) {
   LOG(
@@ -3563,10 +3563,10 @@ nsresult CacheFileIOManager::InitIndexEntry(CacheFileHandle *aHandle,
 
 // static
 nsresult CacheFileIOManager::UpdateIndexEntry(
-    CacheFileHandle *aHandle, const uint32_t *aFrecency,
-    const bool *aHasAltData, const uint16_t *aOnStartTime,
-    const uint16_t *aOnStopTime, const uint8_t *aContentType,
-    const uint16_t *aBaseDomainAccessCount, const uint32_t aTelemetryReportID) {
+    CacheFileHandle* aHandle, const uint32_t* aFrecency,
+    const bool* aHasAltData, const uint16_t* aOnStartTime,
+    const uint16_t* aOnStopTime, const uint8_t* aContentType,
+    const uint16_t* aBaseDomainAccessCount, const uint32_t aTelemetryReportID) {
   LOG(
       ("CacheFileIOManager::UpdateIndexEntry() [handle=%p, frecency=%s, "
        "hasAltData=%s, onStartTime=%s, onStopTime=%s, contentType=%s, "
@@ -3603,7 +3603,7 @@ nsresult CacheFileIOManager::UpdateIndexEntry(
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::CreateFile(CacheFileHandle *aHandle) {
+nsresult CacheFileIOManager::CreateFile(CacheFileHandle* aHandle) {
   MOZ_ASSERT(!aHandle->mFD);
   MOZ_ASSERT(aHandle->mFile);
 
@@ -3631,8 +3631,8 @@ nsresult CacheFileIOManager::CreateFile(CacheFileHandle *aHandle) {
 }
 
 // static
-void CacheFileIOManager::HashToStr(const SHA1Sum::Hash *aHash,
-                                   nsACString &_retval) {
+void CacheFileIOManager::HashToStr(const SHA1Sum::Hash* aHash,
+                                   nsACString& _retval) {
   _retval.Truncate();
   const char hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7',
                            '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
@@ -3643,8 +3643,8 @@ void CacheFileIOManager::HashToStr(const SHA1Sum::Hash *aHash,
 }
 
 // static
-nsresult CacheFileIOManager::StrToHash(const nsACString &aHash,
-                                       SHA1Sum::Hash *_retval) {
+nsresult CacheFileIOManager::StrToHash(const nsACString& aHash,
+                                       SHA1Sum::Hash* _retval) {
   if (aHash.Length() != 2 * sizeof(SHA1Sum::Hash)) {
     return NS_ERROR_INVALID_ARG;
   }
@@ -3663,17 +3663,17 @@ nsresult CacheFileIOManager::StrToHash(const nsACString &aHash,
     }
 
     if (i % 2 == 0) {
-      (reinterpret_cast(_retval))[i / 2] = value << 4;
+      (reinterpret_cast(_retval))[i / 2] = value << 4;
     } else {
-      (reinterpret_cast(_retval))[i / 2] += value;
+      (reinterpret_cast(_retval))[i / 2] += value;
     }
   }
 
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::GetFile(const SHA1Sum::Hash *aHash,
-                                     nsIFile **_retval) {
+nsresult CacheFileIOManager::GetFile(const SHA1Sum::Hash* aHash,
+                                     nsIFile** _retval) {
   nsresult rv;
   nsCOMPtr file;
   rv = mCacheDirectory->Clone(getter_AddRefs(file));
@@ -3692,8 +3692,8 @@ nsresult CacheFileIOManager::GetFile(const SHA1Sum::Hash *aHash,
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::GetSpecialFile(const nsACString &aKey,
-                                            nsIFile **_retval) {
+nsresult CacheFileIOManager::GetSpecialFile(const nsACString& aKey,
+                                            nsIFile** _retval) {
   nsresult rv;
   nsCOMPtr file;
   rv = mCacheDirectory->Clone(getter_AddRefs(file));
@@ -3706,7 +3706,7 @@ nsresult CacheFileIOManager::GetSpecialFile(const nsACString &aKey,
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::GetDoomedFile(nsIFile **_retval) {
+nsresult CacheFileIOManager::GetDoomedFile(nsIFile** _retval) {
   nsresult rv;
   nsCOMPtr file;
   rv = mCacheDirectory->Clone(getter_AddRefs(file));
@@ -3746,7 +3746,7 @@ nsresult CacheFileIOManager::GetDoomedFile(nsIFile **_retval) {
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::IsEmptyDirectory(nsIFile *aFile, bool *_retval) {
+nsresult CacheFileIOManager::IsEmptyDirectory(nsIFile* aFile, bool* _retval) {
   MOZ_ASSERT(mIOThread->IsCurrentThread());
 
   nsresult rv;
@@ -3763,7 +3763,7 @@ nsresult CacheFileIOManager::IsEmptyDirectory(nsIFile *aFile, bool *_retval) {
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::CheckAndCreateDir(nsIFile *aFile, const char *aDir,
+nsresult CacheFileIOManager::CheckAndCreateDir(nsIFile* aFile, const char* aDir,
                                                bool aEnsureEmptyDir) {
   nsresult rv;
 
@@ -3908,7 +3908,7 @@ nsresult CacheFileIOManager::CreateCacheTree() {
   return NS_OK;
 }
 
-nsresult CacheFileIOManager::OpenNSPRHandle(CacheFileHandle *aHandle,
+nsresult CacheFileIOManager::OpenNSPRHandle(CacheFileHandle* aHandle,
                                             bool aCreate) {
   LOG(("CacheFileIOManager::OpenNSPRHandle BEGIN, handle=%p", aHandle));
 
@@ -4001,7 +4001,7 @@ nsresult CacheFileIOManager::OpenNSPRHandle(CacheFileHandle *aHandle,
   return NS_OK;
 }
 
-void CacheFileIOManager::NSPRHandleUsed(CacheFileHandle *aHandle) {
+void CacheFileIOManager::NSPRHandleUsed(CacheFileHandle* aHandle) {
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThreadOrCeased());
   MOZ_ASSERT(aHandle->mFD);
 
@@ -4012,7 +4012,7 @@ void CacheFileIOManager::NSPRHandleUsed(CacheFileHandle *aHandle) {
   mHandlesByLastUsed.AppendElement(aHandle);
 }
 
-nsresult CacheFileIOManager::SyncRemoveDir(nsIFile *aFile, const char *aDir) {
+nsresult CacheFileIOManager::SyncRemoveDir(nsIFile* aFile, const char* aDir) {
   nsresult rv;
   nsCOMPtr file;
 
@@ -4192,8 +4192,8 @@ namespace {
 class SizeOfHandlesRunnable : public Runnable {
  public:
   SizeOfHandlesRunnable(mozilla::MallocSizeOf mallocSizeOf,
-                        CacheFileHandles const &handles,
-                        nsTArray const &specialHandles)
+                        CacheFileHandles const& handles,
+                        nsTArray const& specialHandles)
       : Runnable("net::SizeOfHandlesRunnable"),
         mMonitor("SizeOfHandlesRunnable.mMonitor"),
         mMonitorNotified(false),
@@ -4202,7 +4202,7 @@ class SizeOfHandlesRunnable : public Runnable {
         mSpecialHandles(specialHandles),
         mSize(0) {}
 
-  size_t Get(CacheIOThread *thread) {
+  size_t Get(CacheIOThread* thread) {
     nsCOMPtr target = thread->Target();
     if (!target) {
       NS_ERROR("If we have the I/O thread we also must have the I/O target");
@@ -4241,8 +4241,8 @@ class SizeOfHandlesRunnable : public Runnable {
   mozilla::Monitor mMonitor;
   bool mMonitorNotified;
   mozilla::MallocSizeOf mMallocSizeOf;
-  CacheFileHandles const &mHandles;
-  nsTArray const &mSpecialHandles;
+  CacheFileHandles const& mHandles;
+  nsTArray const& mSpecialHandles;
   size_t mSize;
 };
 
diff --git a/netwerk/cache2/CacheFileIOManager.h b/netwerk/cache2/CacheFileIOManager.h
index bee1302baec2d..dae333d026d3f 100644
--- a/netwerk/cache2/CacheFileIOManager.h
+++ b/netwerk/cache2/CacheFileIOManager.h
@@ -49,20 +49,20 @@ class CacheFileHandle final : public nsISupports {
   NS_DECL_THREADSAFE_ISUPPORTS
   bool DispatchRelease();
 
-  CacheFileHandle(const SHA1Sum::Hash *aHash, bool aPriority,
+  CacheFileHandle(const SHA1Sum::Hash* aHash, bool aPriority,
                   PinningStatus aPinning);
-  CacheFileHandle(const nsACString &aKey, bool aPriority,
+  CacheFileHandle(const nsACString& aKey, bool aPriority,
                   PinningStatus aPinning);
   void Log();
   bool IsDoomed() const { return mIsDoomed; }
-  const SHA1Sum::Hash *Hash() const { return mHash; }
+  const SHA1Sum::Hash* Hash() const { return mHash; }
   int64_t FileSize() const { return mFileSize; }
   uint32_t FileSizeInK() const;
   bool IsPriority() const { return mPriority; }
   bool FileExists() const { return mFileExists; }
   bool IsClosed() const { return mClosed; }
   bool IsSpecialFile() const { return mSpecialFile; }
-  nsCString &Key() { return mKey; }
+  nsCString& Key() { return mKey; }
 
   // Returns false when this handle has been doomed based on the pinning state
   // update.
@@ -80,7 +80,7 @@ class CacheFileHandle final : public nsISupports {
 
   virtual ~CacheFileHandle();
 
-  const SHA1Sum::Hash *mHash;
+  const SHA1Sum::Hash* mHash;
   mozilla::Atomic mIsDoomed;
   mozilla::Atomic mClosed;
 
@@ -123,7 +123,7 @@ class CacheFileHandle final : public nsISupports {
 
   nsCOMPtr mFile;
   int64_t mFileSize;
-  PRFileDesc *mFD;  // if null then the file doesn't exists on the disk
+  PRFileDesc* mFD;  // if null then the file doesn't exists on the disk
   nsCString mKey;
 };
 
@@ -132,18 +132,18 @@ class CacheFileHandles {
   CacheFileHandles();
   ~CacheFileHandles();
 
-  nsresult GetHandle(const SHA1Sum::Hash *aHash, CacheFileHandle **_retval);
-  nsresult NewHandle(const SHA1Sum::Hash *aHash, bool aPriority,
+  nsresult GetHandle(const SHA1Sum::Hash* aHash, CacheFileHandle** _retval);
+  nsresult NewHandle(const SHA1Sum::Hash* aHash, bool aPriority,
                      CacheFileHandle::PinningStatus aPinning,
-                     CacheFileHandle **_retval);
-  void RemoveHandle(CacheFileHandle *aHandlle);
-  void GetAllHandles(nsTArray > *_retval);
-  void GetActiveHandles(nsTArray > *_retval);
+                     CacheFileHandle** _retval);
+  void RemoveHandle(CacheFileHandle* aHandlle);
+  void GetAllHandles(nsTArray >* _retval);
+  void GetActiveHandles(nsTArray >* _retval);
   void ClearAll();
   uint32_t HandleCount();
 
 #ifdef DEBUG_HANDLES
-  void Log(CacheFileHandlesEntry *entry);
+  void Log(CacheFileHandlesEntry* entry);
 #endif
 
   // Memory reporting
@@ -152,15 +152,15 @@ class CacheFileHandles {
 
   class HandleHashKey : public PLDHashEntryHdr {
    public:
-    typedef const SHA1Sum::Hash &KeyType;
-    typedef const SHA1Sum::Hash *KeyTypePointer;
+    typedef const SHA1Sum::Hash& KeyType;
+    typedef const SHA1Sum::Hash* KeyTypePointer;
 
     explicit HandleHashKey(KeyTypePointer aKey) {
       MOZ_COUNT_CTOR(HandleHashKey);
       mHash = MakeUnique(SHA1Sum::kHashSize);
       memcpy(mHash.get(), aKey, sizeof(SHA1Sum::Hash));
     }
-    HandleHashKey(const HandleHashKey &aOther) {
+    HandleHashKey(const HandleHashKey& aOther) {
       MOZ_ASSERT_UNREACHABLE("HandleHashKey copy constructor is forbidden!");
     }
     ~HandleHashKey() { MOZ_COUNT_DTOR(HandleHashKey); }
@@ -170,16 +170,16 @@ class CacheFileHandles {
     }
     static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
     static PLDHashNumber HashKey(KeyTypePointer aKey) {
-      return (reinterpret_cast(aKey))[0];
+      return (reinterpret_cast(aKey))[0];
     }
 
-    void AddHandle(CacheFileHandle *aHandle);
-    void RemoveHandle(CacheFileHandle *aHandle);
+    void AddHandle(CacheFileHandle* aHandle);
+    void RemoveHandle(CacheFileHandle* aHandle);
     already_AddRefed GetNewestHandle();
-    void GetHandles(nsTArray > &aResult);
+    void GetHandles(nsTArray >& aResult);
 
-    SHA1Sum::Hash *Hash() const {
-      return reinterpret_cast(mHash.get());
+    SHA1Sum::Hash* Hash() const {
+      return reinterpret_cast(mHash.get());
     }
     bool IsEmpty() const { return mHandles.Length() == 0; }
 
@@ -203,7 +203,7 @@ class CacheFileHandles {
     // only and CacheFileHandle removes itself from this table in its dtor
     // that may only be called on the same thread as we work with the hashtable
     // since we dispatch its Release() to this thread.
-    nsTArray mHandles;
+    nsTArray mHandles;
   };
 
  private:
@@ -229,14 +229,14 @@ class CacheFileIOListener : public nsISupports {
  public:
   NS_DECLARE_STATIC_IID_ACCESSOR(CACHEFILEIOLISTENER_IID)
 
-  NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) = 0;
-  NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+  NS_IMETHOD OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) = 0;
+  NS_IMETHOD OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                            nsresult aResult) = 0;
-  NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+  NS_IMETHOD OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                         nsresult aResult) = 0;
-  NS_IMETHOD OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) = 0;
-  NS_IMETHOD OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) = 0;
-  NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) = 0;
+  NS_IMETHOD OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) = 0;
+  NS_IMETHOD OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) = 0;
+  NS_IMETHOD OnFileRenamed(CacheFileHandle* aHandle, nsresult aResult) = 0;
 
   virtual bool IsKilled() { return false; }
 };
@@ -271,20 +271,20 @@ class CacheFileIOManager final : public nsITimerCallback, public nsINamed {
 
   // Make aFile's WriteMetadataIfNeeded be called automatically after
   // a short interval.
-  static nsresult ScheduleMetadataWrite(CacheFile *aFile);
+  static nsresult ScheduleMetadataWrite(CacheFile* aFile);
   // Remove aFile from the scheduling registry array.
   // WriteMetadataIfNeeded will not be automatically called.
-  static nsresult UnscheduleMetadataWrite(CacheFile *aFile);
+  static nsresult UnscheduleMetadataWrite(CacheFile* aFile);
   // Shuts the scheduling off and flushes all pending metadata writes.
   static nsresult ShutdownMetadataWriteScheduling();
 
-  static nsresult OpenFile(const nsACString &aKey, uint32_t aFlags,
-                           CacheFileIOListener *aCallback);
-  static nsresult Read(CacheFileHandle *aHandle, int64_t aOffset, char *aBuf,
-                       int32_t aCount, CacheFileIOListener *aCallback);
-  static nsresult Write(CacheFileHandle *aHandle, int64_t aOffset,
-                        const char *aBuf, int32_t aCount, bool aValidate,
-                        bool aTruncate, CacheFileIOListener *aCallback);
+  static nsresult OpenFile(const nsACString& aKey, uint32_t aFlags,
+                           CacheFileIOListener* aCallback);
+  static nsresult Read(CacheFileHandle* aHandle, int64_t aOffset, char* aBuf,
+                       int32_t aCount, CacheFileIOListener* aCallback);
+  static nsresult Write(CacheFileHandle* aHandle, int64_t aOffset,
+                        const char* aBuf, int32_t aCount, bool aValidate,
+                        bool aTruncate, CacheFileIOListener* aCallback);
   // PinningDoomRestriction:
   // NO_RESTRICTION
   //    no restriction is checked, the file is simply always doomed
@@ -299,41 +299,41 @@ class CacheFileIOManager final : public nsITimerCallback, public nsINamed {
     DOOM_WHEN_NON_PINNED,
     DOOM_WHEN_PINNED
   };
-  static nsresult DoomFile(CacheFileHandle *aHandle,
-                           CacheFileIOListener *aCallback);
-  static nsresult DoomFileByKey(const nsACString &aKey,
-                                CacheFileIOListener *aCallback);
-  static nsresult ReleaseNSPRHandle(CacheFileHandle *aHandle);
-  static nsresult TruncateSeekSetEOF(CacheFileHandle *aHandle,
+  static nsresult DoomFile(CacheFileHandle* aHandle,
+                           CacheFileIOListener* aCallback);
+  static nsresult DoomFileByKey(const nsACString& aKey,
+                                CacheFileIOListener* aCallback);
+  static nsresult ReleaseNSPRHandle(CacheFileHandle* aHandle);
+  static nsresult TruncateSeekSetEOF(CacheFileHandle* aHandle,
                                      int64_t aTruncatePos, int64_t aEOFPos,
-                                     CacheFileIOListener *aCallback);
-  static nsresult RenameFile(CacheFileHandle *aHandle,
-                             const nsACString &aNewName,
-                             CacheFileIOListener *aCallback);
+                                     CacheFileIOListener* aCallback);
+  static nsresult RenameFile(CacheFileHandle* aHandle,
+                             const nsACString& aNewName,
+                             CacheFileIOListener* aCallback);
   static nsresult EvictIfOverLimit();
   static nsresult EvictAll();
-  static nsresult EvictByContext(nsILoadContextInfo *aLoadContextInfo,
-                                 bool aPinning, const nsAString &aOrigin);
+  static nsresult EvictByContext(nsILoadContextInfo* aLoadContextInfo,
+                                 bool aPinning, const nsAString& aOrigin);
 
-  static nsresult InitIndexEntry(CacheFileHandle *aHandle,
+  static nsresult InitIndexEntry(CacheFileHandle* aHandle,
                                  OriginAttrsHash aOriginAttrsHash,
                                  bool aAnonymous, bool aPinning);
-  static nsresult UpdateIndexEntry(CacheFileHandle *aHandle,
-                                   const uint32_t *aFrecency,
-                                   const bool *aHasAltData,
-                                   const uint16_t *aOnStartTime,
-                                   const uint16_t *aOnStopTime,
-                                   const uint8_t *aContentType,
-                                   const uint16_t *aBaseDomainAccessCount,
+  static nsresult UpdateIndexEntry(CacheFileHandle* aHandle,
+                                   const uint32_t* aFrecency,
+                                   const bool* aHasAltData,
+                                   const uint16_t* aOnStartTime,
+                                   const uint16_t* aOnStopTime,
+                                   const uint8_t* aContentType,
+                                   const uint16_t* aBaseDomainAccessCount,
                                    const uint32_t aTelemetryReportID);
 
   static nsresult UpdateIndexEntry();
 
   enum EEnumerateMode { ENTRIES, DOOMED };
 
-  static void GetCacheDirectory(nsIFile **result);
+  static void GetCacheDirectory(nsIFile** result);
 #if defined(MOZ_WIDGET_ANDROID)
-  static void GetProfilelessCacheDirectory(nsIFile **result);
+  static void GetProfilelessCacheDirectory(nsIFile** result);
 #endif
 
   // Calls synchronously OnEntryInfo for an entry with the given hash.
@@ -341,8 +341,8 @@ class CacheFileIOManager final : public nsITimerCallback, public nsINamed {
   // found, loads synchronously from disk file.
   // Callable on the IO thread only.
   static nsresult GetEntryInfo(
-      const SHA1Sum::Hash *aHash,
-      CacheStorageService::EntryInfoCallback *aCallback);
+      const SHA1Sum::Hash* aHash,
+      CacheStorageService::EntryInfoCallback* aCallback);
 
   // Memory reporting
   static size_t SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf);
@@ -371,57 +371,57 @@ class CacheFileIOManager final : public nsITimerCallback, public nsINamed {
   nsresult InitInternal();
   nsresult ShutdownInternal();
 
-  nsresult OpenFileInternal(const SHA1Sum::Hash *aHash, const nsACString &aKey,
-                            uint32_t aFlags, CacheFileHandle **_retval);
-  nsresult OpenSpecialFileInternal(const nsACString &aKey, uint32_t aFlags,
-                                   CacheFileHandle **_retval);
-  nsresult CloseHandleInternal(CacheFileHandle *aHandle);
-  nsresult ReadInternal(CacheFileHandle *aHandle, int64_t aOffset, char *aBuf,
+  nsresult OpenFileInternal(const SHA1Sum::Hash* aHash, const nsACString& aKey,
+                            uint32_t aFlags, CacheFileHandle** _retval);
+  nsresult OpenSpecialFileInternal(const nsACString& aKey, uint32_t aFlags,
+                                   CacheFileHandle** _retval);
+  nsresult CloseHandleInternal(CacheFileHandle* aHandle);
+  nsresult ReadInternal(CacheFileHandle* aHandle, int64_t aOffset, char* aBuf,
                         int32_t aCount);
-  nsresult WriteInternal(CacheFileHandle *aHandle, int64_t aOffset,
-                         const char *aBuf, int32_t aCount, bool aValidate,
+  nsresult WriteInternal(CacheFileHandle* aHandle, int64_t aOffset,
+                         const char* aBuf, int32_t aCount, bool aValidate,
                          bool aTruncate);
   nsresult DoomFileInternal(
-      CacheFileHandle *aHandle,
+      CacheFileHandle* aHandle,
       PinningDoomRestriction aPinningStatusRestriction = NO_RESTRICTION);
-  nsresult DoomFileByKeyInternal(const SHA1Sum::Hash *aHash);
-  nsresult MaybeReleaseNSPRHandleInternal(CacheFileHandle *aHandle,
+  nsresult DoomFileByKeyInternal(const SHA1Sum::Hash* aHash);
+  nsresult MaybeReleaseNSPRHandleInternal(CacheFileHandle* aHandle,
                                           bool aIgnoreShutdownLag = false);
-  nsresult TruncateSeekSetEOFInternal(CacheFileHandle *aHandle,
+  nsresult TruncateSeekSetEOFInternal(CacheFileHandle* aHandle,
                                       int64_t aTruncatePos, int64_t aEOFPos);
-  nsresult RenameFileInternal(CacheFileHandle *aHandle,
-                              const nsACString &aNewName);
+  nsresult RenameFileInternal(CacheFileHandle* aHandle,
+                              const nsACString& aNewName);
   nsresult EvictIfOverLimitInternal();
   nsresult OverLimitEvictionInternal();
   nsresult EvictAllInternal();
-  nsresult EvictByContextInternal(nsILoadContextInfo *aLoadContextInfo,
-                                  bool aPinning, const nsAString &aOrigin);
+  nsresult EvictByContextInternal(nsILoadContextInfo* aLoadContextInfo,
+                                  bool aPinning, const nsAString& aOrigin);
 
-  nsresult TrashDirectory(nsIFile *aFile);
-  static void OnTrashTimer(nsITimer *aTimer, void *aClosure);
+  nsresult TrashDirectory(nsIFile* aFile);
+  static void OnTrashTimer(nsITimer* aTimer, void* aClosure);
   nsresult StartRemovingTrash();
   nsresult RemoveTrashInternal();
   nsresult FindTrashDirToRemove();
 
-  nsresult CreateFile(CacheFileHandle *aHandle);
-  static void HashToStr(const SHA1Sum::Hash *aHash, nsACString &_retval);
-  static nsresult StrToHash(const nsACString &aHash, SHA1Sum::Hash *_retval);
-  nsresult GetFile(const SHA1Sum::Hash *aHash, nsIFile **_retval);
-  nsresult GetSpecialFile(const nsACString &aKey, nsIFile **_retval);
-  nsresult GetDoomedFile(nsIFile **_retval);
-  nsresult IsEmptyDirectory(nsIFile *aFile, bool *_retval);
-  nsresult CheckAndCreateDir(nsIFile *aFile, const char *aDir,
+  nsresult CreateFile(CacheFileHandle* aHandle);
+  static void HashToStr(const SHA1Sum::Hash* aHash, nsACString& _retval);
+  static nsresult StrToHash(const nsACString& aHash, SHA1Sum::Hash* _retval);
+  nsresult GetFile(const SHA1Sum::Hash* aHash, nsIFile** _retval);
+  nsresult GetSpecialFile(const nsACString& aKey, nsIFile** _retval);
+  nsresult GetDoomedFile(nsIFile** _retval);
+  nsresult IsEmptyDirectory(nsIFile* aFile, bool* _retval);
+  nsresult CheckAndCreateDir(nsIFile* aFile, const char* aDir,
                              bool aEnsureEmptyDir);
   nsresult CreateCacheTree();
-  nsresult OpenNSPRHandle(CacheFileHandle *aHandle, bool aCreate = false);
-  void NSPRHandleUsed(CacheFileHandle *aHandle);
+  nsresult OpenNSPRHandle(CacheFileHandle* aHandle, bool aCreate = false);
+  void NSPRHandleUsed(CacheFileHandle* aHandle);
 
   // Removing all cache files during shutdown
-  nsresult SyncRemoveDir(nsIFile *aFile, const char *aDir);
+  nsresult SyncRemoveDir(nsIFile* aFile, const char* aDir);
   void SyncRemoveAllCacheFiles();
 
-  nsresult ScheduleMetadataWriteInternal(CacheFile *aFile);
-  nsresult UnscheduleMetadataWriteInternal(CacheFile *aFile);
+  nsresult ScheduleMetadataWriteInternal(CacheFile* aFile);
+  nsresult UnscheduleMetadataWriteInternal(CacheFile* aFile);
   nsresult ShutdownMetadataWriteSchedulingInternal();
 
   static nsresult CacheIndexStateChanged();
@@ -454,8 +454,8 @@ class CacheFileIOManager final : public nsITimerCallback, public nsINamed {
   bool mTreeCreated;
   bool mTreeCreationFailed;
   CacheFileHandles mHandles;
-  nsTArray mHandlesByLastUsed;
-  nsTArray mSpecialHandles;
+  nsTArray mHandlesByLastUsed;
+  nsTArray mSpecialHandles;
   nsTArray > mScheduledMetadataWrites;
   nsCOMPtr mMetadataWritesTimer;
   bool mOverLimitEvicting;
diff --git a/netwerk/cache2/CacheFileInputStream.cpp b/netwerk/cache2/CacheFileInputStream.cpp
index ee7a5c42dbd9d..0c1c286012ae0 100644
--- a/netwerk/cache2/CacheFileInputStream.cpp
+++ b/netwerk/cache2/CacheFileInputStream.cpp
@@ -42,8 +42,8 @@ NS_INTERFACE_MAP_BEGIN(CacheFileInputStream)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream)
 NS_INTERFACE_MAP_END
 
-CacheFileInputStream::CacheFileInputStream(CacheFile *aFile,
-                                           nsISupports *aEntry,
+CacheFileInputStream::CacheFileInputStream(CacheFile* aFile,
+                                           nsISupports* aEntry,
                                            bool aAlternativeData)
     : mFile(aFile),
       mPos(0),
@@ -75,7 +75,7 @@ CacheFileInputStream::Close() {
 }
 
 NS_IMETHODIMP
-CacheFileInputStream::Available(uint64_t *_retval) {
+CacheFileInputStream::Available(uint64_t* _retval) {
   CacheFileAutoLock lock(mFile);
 
   if (mClosed) {
@@ -117,14 +117,14 @@ CacheFileInputStream::Available(uint64_t *_retval) {
 }
 
 NS_IMETHODIMP
-CacheFileInputStream::Read(char *aBuf, uint32_t aCount, uint32_t *_retval) {
+CacheFileInputStream::Read(char* aBuf, uint32_t aCount, uint32_t* _retval) {
   LOG(("CacheFileInputStream::Read() [this=%p, count=%d]", this, aCount));
   return ReadSegments(NS_CopySegmentToBuffer, aBuf, aCount, _retval);
 }
 
 NS_IMETHODIMP
-CacheFileInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure,
-                                   uint32_t aCount, uint32_t *_retval) {
+CacheFileInputStream::ReadSegments(nsWriteSegmentFun aWriter, void* aClosure,
+                                   uint32_t aCount, uint32_t* _retval) {
   CacheFileAutoLock lock(mFile);
 
   LOG(("CacheFileInputStream::ReadSegments() [this=%p, count=%d]", this,
@@ -183,7 +183,7 @@ CacheFileInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure,
     } else if (canRead > 0) {
       uint32_t toRead = std::min(static_cast(canRead), aCount);
       uint32_t read;
-      const char *buf = hnd.Buf() + (mPos - hnd.Offset());
+      const char* buf = hnd.Buf() + (mPos - hnd.Offset());
 
       mInReadSegments = true;
       lock.Unlock();
@@ -237,7 +237,7 @@ CacheFileInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure,
 }
 
 NS_IMETHODIMP
-CacheFileInputStream::IsNonBlocking(bool *_retval) {
+CacheFileInputStream::IsNonBlocking(bool* _retval) {
   *_retval = true;
   return NS_OK;
 }
@@ -296,9 +296,9 @@ void CacheFileInputStream::CleanUp() {
 }
 
 NS_IMETHODIMP
-CacheFileInputStream::AsyncWait(nsIInputStreamCallback *aCallback,
+CacheFileInputStream::AsyncWait(nsIInputStreamCallback* aCallback,
                                 uint32_t aFlags, uint32_t aRequestedCount,
-                                nsIEventTarget *aEventTarget) {
+                                nsIEventTarget* aEventTarget) {
   CacheFileAutoLock lock(mFile);
 
   LOG(
@@ -396,7 +396,7 @@ CacheFileInputStream::SetEOF() {
 
 // nsITellableStream
 NS_IMETHODIMP
-CacheFileInputStream::Tell(int64_t *_retval) {
+CacheFileInputStream::Tell(int64_t* _retval) {
   CacheFileAutoLock lock(mFile);
 
   if (mClosed) {
@@ -417,20 +417,20 @@ CacheFileInputStream::Tell(int64_t *_retval) {
 
 // CacheFileChunkListener
 nsresult CacheFileInputStream::OnChunkRead(nsresult aResult,
-                                           CacheFileChunk *aChunk) {
+                                           CacheFileChunk* aChunk) {
   MOZ_CRASH("CacheFileInputStream::OnChunkRead should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
 nsresult CacheFileInputStream::OnChunkWritten(nsresult aResult,
-                                              CacheFileChunk *aChunk) {
+                                              CacheFileChunk* aChunk) {
   MOZ_CRASH("CacheFileInputStream::OnChunkWritten should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
 nsresult CacheFileInputStream::OnChunkAvailable(nsresult aResult,
                                                 uint32_t aChunkIdx,
-                                                CacheFileChunk *aChunk) {
+                                                CacheFileChunk* aChunk) {
   CacheFileAutoLock lock(mFile);
 
   LOG(("CacheFileInputStream::OnChunkAvailable() [this=%p, result=0x%08" PRIx32
@@ -484,7 +484,7 @@ nsresult CacheFileInputStream::OnChunkAvailable(nsresult aResult,
   return NS_OK;
 }
 
-nsresult CacheFileInputStream::OnChunkUpdated(CacheFileChunk *aChunk) {
+nsresult CacheFileInputStream::OnChunkUpdated(CacheFileChunk* aChunk) {
   CacheFileAutoLock lock(mFile);
 
   LOG(("CacheFileInputStream::OnChunkUpdated() [this=%p, idx=%d]", this,
@@ -597,7 +597,7 @@ void CacheFileInputStream::EnsureCorrectChunk(bool aReleaseOnly) {
   MaybeNotifyListener();
 }
 
-int64_t CacheFileInputStream::CanRead(CacheFileChunkReadHandle *aHandle) {
+int64_t CacheFileInputStream::CanRead(CacheFileChunkReadHandle* aHandle) {
   mFile->AssertOwnsLock();
 
   MOZ_ASSERT(mChunk);
diff --git a/netwerk/cache2/CacheFileInputStream.h b/netwerk/cache2/CacheFileInputStream.h
index 600872f476387..cbfb553cf9558 100644
--- a/netwerk/cache2/CacheFileInputStream.h
+++ b/netwerk/cache2/CacheFileInputStream.h
@@ -26,14 +26,14 @@ class CacheFileInputStream : public nsIAsyncInputStream,
   NS_DECL_NSITELLABLESTREAM
 
  public:
-  explicit CacheFileInputStream(CacheFile *aFile, nsISupports *aEntry,
+  explicit CacheFileInputStream(CacheFile* aFile, nsISupports* aEntry,
                                 bool aAlternativeData);
 
-  NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk *aChunk) override;
-  NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk *aChunk) override;
+  NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk* aChunk) override;
+  NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk* aChunk) override;
   NS_IMETHOD OnChunkAvailable(nsresult aResult, uint32_t aChunkIdx,
-                              CacheFileChunk *aChunk) override;
-  NS_IMETHOD OnChunkUpdated(CacheFileChunk *aChunk) override;
+                              CacheFileChunk* aChunk) override;
+  NS_IMETHOD OnChunkUpdated(CacheFileChunk* aChunk) override;
 
   // Memory reporting
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
@@ -54,7 +54,7 @@ class CacheFileInputStream : public nsIAsyncInputStream,
 
   // CanRead returns negative value when output stream truncates the data before
   // the input stream's mPos.
-  int64_t CanRead(CacheFileChunkReadHandle *aHandle);
+  int64_t CanRead(CacheFileChunkReadHandle* aHandle);
   void NotifyListener();
   void MaybeNotifyListener();
 
diff --git a/netwerk/cache2/CacheFileMetadata.cpp b/netwerk/cache2/CacheFileMetadata.cpp
index 85bc4de6a038a..aa87846244a08 100644
--- a/netwerk/cache2/CacheFileMetadata.cpp
+++ b/netwerk/cache2/CacheFileMetadata.cpp
@@ -39,8 +39,8 @@ namespace net {
 
 NS_IMPL_ISUPPORTS(CacheFileMetadata, CacheFileIOListener)
 
-CacheFileMetadata::CacheFileMetadata(CacheFileHandle *aHandle,
-                                     const nsACString &aKey)
+CacheFileMetadata::CacheFileMetadata(CacheFileHandle* aHandle,
+                                     const nsACString& aKey)
     : CacheMemoryConsumer(NORMAL),
       mHandle(aHandle),
       mHashArray(nullptr),
@@ -69,7 +69,7 @@ CacheFileMetadata::CacheFileMetadata(CacheFileHandle *aHandle,
 }
 
 CacheFileMetadata::CacheFileMetadata(bool aMemoryOnly, bool aPinned,
-                                     const nsACString &aKey)
+                                     const nsACString& aKey)
     : CacheMemoryConsumer(aMemoryOnly ? MEMORY_ONLY : NORMAL),
       mHandle(nullptr),
       mHashArray(nullptr),
@@ -139,7 +139,7 @@ CacheFileMetadata::~CacheFileMetadata() {
   }
 }
 
-void CacheFileMetadata::SetHandle(CacheFileHandle *aHandle) {
+void CacheFileMetadata::SetHandle(CacheFileHandle* aHandle) {
   LOG(("CacheFileMetadata::SetHandle() [this=%p, handle=%p]", this, aHandle));
 
   MOZ_ASSERT(!mHandle);
@@ -147,12 +147,12 @@ void CacheFileMetadata::SetHandle(CacheFileHandle *aHandle) {
   mHandle = aHandle;
 }
 
-nsresult CacheFileMetadata::GetKey(nsACString &_retval) {
+nsresult CacheFileMetadata::GetKey(nsACString& _retval) {
   _retval = mKey;
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::ReadMetadata(CacheFileMetadataListener *aListener) {
+nsresult CacheFileMetadata::ReadMetadata(CacheFileMetadataListener* aListener) {
   LOG(("CacheFileMetadata::ReadMetadata() [this=%p, listener=%p]", this,
        aListener));
 
@@ -203,7 +203,7 @@ nsresult CacheFileMetadata::ReadMetadata(CacheFileMetadataListener *aListener) {
   offset = (offset / kAlignSize) * kAlignSize;
 
   mBufSize = size - offset;
-  mBuf = static_cast(moz_xmalloc(mBufSize));
+  mBuf = static_cast(moz_xmalloc(mBufSize));
 
   DoMemoryReport(MemoryUsage());
 
@@ -242,7 +242,7 @@ uint32_t CacheFileMetadata::CalcMetadataSize(uint32_t aElementsSize,
 }
 
 nsresult CacheFileMetadata::WriteMetadata(
-    uint32_t aOffset, CacheFileMetadataListener *aListener) {
+    uint32_t aOffset, CacheFileMetadataListener* aListener) {
   LOG(("CacheFileMetadata::WriteMetadata() [this=%p, offset=%d, listener=%p]",
        this, aOffset, aListener));
 
@@ -254,12 +254,12 @@ nsresult CacheFileMetadata::WriteMetadata(
   mIsDirty = false;
 
   mWriteBuf =
-      static_cast(malloc(CalcMetadataSize(mElementsSize, mHashCount)));
+      static_cast(malloc(CalcMetadataSize(mElementsSize, mHashCount)));
   if (!mWriteBuf) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  char *p = mWriteBuf + sizeof(uint32_t);
+  char* p = mWriteBuf + sizeof(uint32_t);
   if (mHashCount) {
     memcpy(p, mHashArray, mHashCount * sizeof(CacheHash::Hash16_t));
     p += mHashCount * sizeof(CacheHash::Hash16_t);
@@ -283,7 +283,7 @@ nsresult CacheFileMetadata::WriteMetadata(
   NetworkEndian::writeUint32(p, aOffset);
   p += sizeof(uint32_t);
 
-  char *writeBuffer = mWriteBuf;
+  char* writeBuffer = mWriteBuf;
   if (aListener) {
     mListener = aListener;
   } else {
@@ -313,7 +313,7 @@ nsresult CacheFileMetadata::WriteMetadata(
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::SyncReadMetadata(nsIFile *aFile) {
+nsresult CacheFileMetadata::SyncReadMetadata(nsIFile* aFile) {
   LOG(("CacheFileMetadata::SyncReadMetadata() [this=%p]", this));
 
   MOZ_ASSERT(!mListener);
@@ -332,7 +332,7 @@ nsresult CacheFileMetadata::SyncReadMetadata(nsIFile *aFile) {
     return rv;
   }
 
-  PRFileDesc *fd;
+  PRFileDesc* fd;
   rv = aFile->OpenNSPRFileDesc(PR_RDONLY, 0600, &fd);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -355,7 +355,7 @@ nsresult CacheFileMetadata::SyncReadMetadata(nsIFile *aFile) {
     return NS_ERROR_FAILURE;
   }
 
-  mBuf = static_cast(malloc(fileSize - metaOffset));
+  mBuf = static_cast(malloc(fileSize - metaOffset));
   if (!mBuf) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
@@ -381,9 +381,9 @@ nsresult CacheFileMetadata::SyncReadMetadata(nsIFile *aFile) {
   return NS_OK;
 }
 
-const char *CacheFileMetadata::GetElement(const char *aKey) {
-  const char *data = mBuf;
-  const char *limit = mBuf + mElementsSize;
+const char* CacheFileMetadata::GetElement(const char* aKey) {
+  const char* data = mBuf;
+  const char* limit = mBuf + mElementsSize;
 
   while (data != limit) {
     size_t maxLen = limit - data;
@@ -395,7 +395,7 @@ const char *CacheFileMetadata::GetElement(const char *aKey) {
                        "Metadata elements corrupted. "
                        "There is no value for the key!");
 
-    const char *value = data + keyLen + 1;
+    const char* value = data + keyLen + 1;
     maxLen = limit - value;
     size_t valueLen = strnlen(value, maxLen);
     MOZ_RELEASE_ASSERT(valueLen != maxLen,
@@ -416,7 +416,7 @@ const char *CacheFileMetadata::GetElement(const char *aKey) {
   return nullptr;
 }
 
-nsresult CacheFileMetadata::SetElement(const char *aKey, const char *aValue) {
+nsresult CacheFileMetadata::SetElement(const char* aKey, const char* aValue) {
   LOG(("CacheFileMetadata::SetElement() [this=%p, key=%s, value=%p]", this,
        aKey, aValue));
 
@@ -425,7 +425,7 @@ nsresult CacheFileMetadata::SetElement(const char *aKey, const char *aValue) {
   nsresult rv;
 
   const uint32_t keySize = strlen(aKey) + 1;
-  char *pos = const_cast(GetElement(aKey));
+  char* pos = const_cast(GetElement(aKey));
 
   if (!aValue) {
     // No value means remove the key/value pair completely, if existing
@@ -478,13 +478,13 @@ nsresult CacheFileMetadata::SetElement(const char *aKey, const char *aValue) {
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::Visit(nsICacheEntryMetaDataVisitor *aVisitor) {
-  const char *data = mBuf;
-  const char *limit = mBuf + mElementsSize;
+nsresult CacheFileMetadata::Visit(nsICacheEntryMetaDataVisitor* aVisitor) {
+  const char* data = mBuf;
+  const char* limit = mBuf + mElementsSize;
 
   while (data < limit) {
     // Point to the value part
-    const char *value = data + strlen(data) + 1;
+    const char* value = data + strlen(data) + 1;
     MOZ_ASSERT(value < limit, "Metadata elements corrupted");
 
     aVisitor->OnMetaDataElement(data, value);
@@ -522,7 +522,7 @@ nsresult CacheFileMetadata::SetHash(uint32_t aIndex,
       } else {
         mHashArraySize *= 2;
       }
-      mHashArray = static_cast(
+      mHashArray = static_cast(
           moz_xrealloc(mHashArray, mHashArraySize));
     }
 
@@ -563,7 +563,7 @@ nsresult CacheFileMetadata::RemoveFlags(uint32_t aFlags) {
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::GetFlags(uint32_t *_retval) {
+nsresult CacheFileMetadata::GetFlags(uint32_t* _retval) {
   *_retval = mMetaHdr.mFlags;
   return NS_OK;
 }
@@ -577,7 +577,7 @@ nsresult CacheFileMetadata::SetExpirationTime(uint32_t aExpirationTime) {
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::GetExpirationTime(uint32_t *_retval) {
+nsresult CacheFileMetadata::GetExpirationTime(uint32_t* _retval) {
   *_retval = mMetaHdr.mExpirationTime;
   return NS_OK;
 }
@@ -591,22 +591,22 @@ nsresult CacheFileMetadata::SetFrecency(uint32_t aFrecency) {
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::GetFrecency(uint32_t *_retval) {
+nsresult CacheFileMetadata::GetFrecency(uint32_t* _retval) {
   *_retval = mMetaHdr.mFrecency;
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::GetLastModified(uint32_t *_retval) {
+nsresult CacheFileMetadata::GetLastModified(uint32_t* _retval) {
   *_retval = mMetaHdr.mLastModified;
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::GetLastFetched(uint32_t *_retval) {
+nsresult CacheFileMetadata::GetLastFetched(uint32_t* _retval) {
   *_retval = mMetaHdr.mLastFetched;
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::GetFetchCount(uint32_t *_retval) {
+nsresult CacheFileMetadata::GetFetchCount(uint32_t* _retval) {
   *_retval = mMetaHdr.mFetchCount;
   return NS_OK;
 }
@@ -626,14 +626,14 @@ void CacheFileMetadata::MarkDirty(bool aUpdateLastModified) {
   }
 }
 
-nsresult CacheFileMetadata::OnFileOpened(CacheFileHandle *aHandle,
+nsresult CacheFileMetadata::OnFileOpened(CacheFileHandle* aHandle,
                                          nsresult aResult) {
   MOZ_CRASH("CacheFileMetadata::OnFileOpened should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFileMetadata::OnDataWritten(CacheFileHandle *aHandle,
-                                          const char *aBuf, nsresult aResult) {
+nsresult CacheFileMetadata::OnDataWritten(CacheFileHandle* aHandle,
+                                          const char* aBuf, nsresult aResult) {
   LOG(
       ("CacheFileMetadata::OnDataWritten() [this=%p, handle=%p, "
        "result=0x%08" PRIx32 "]",
@@ -655,7 +655,7 @@ nsresult CacheFileMetadata::OnDataWritten(CacheFileHandle *aHandle,
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+nsresult CacheFileMetadata::OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                                        nsresult aResult) {
   LOG((
       "CacheFileMetadata::OnDataRead() [this=%p, handle=%p, result=0x%08" PRIx32
@@ -729,7 +729,7 @@ nsresult CacheFileMetadata::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
   if (realOffset < usedOffset) {
     uint32_t missing = usedOffset - realOffset;
     // we need to read more data
-    char *newBuf = static_cast(realloc(mBuf, mBufSize + missing));
+    char* newBuf = static_cast(realloc(mBuf, mBufSize + missing));
     if (!newBuf) {
       LOG(
           ("CacheFileMetadata::OnDataRead() - Error allocating %d more bytes "
@@ -789,7 +789,7 @@ nsresult CacheFileMetadata::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
     InitEmptyMetadata();
   } else {
     // Shrink elements buffer.
-    mBuf = static_cast(moz_xrealloc(mBuf, mElementsSize));
+    mBuf = static_cast(moz_xrealloc(mBuf, mElementsSize));
     mBufSize = mElementsSize;
 
     // There is usually no or just one call to SetMetadataElement() when the
@@ -804,19 +804,19 @@ nsresult CacheFileMetadata::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::OnFileDoomed(CacheFileHandle *aHandle,
+nsresult CacheFileMetadata::OnFileDoomed(CacheFileHandle* aHandle,
                                          nsresult aResult) {
   MOZ_CRASH("CacheFileMetadata::OnFileDoomed should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFileMetadata::OnEOFSet(CacheFileHandle *aHandle,
+nsresult CacheFileMetadata::OnEOFSet(CacheFileHandle* aHandle,
                                      nsresult aResult) {
   MOZ_CRASH("CacheFileMetadata::OnEOFSet should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFileMetadata::OnFileRenamed(CacheFileHandle *aHandle,
+nsresult CacheFileMetadata::OnFileRenamed(CacheFileHandle* aHandle,
                                           nsresult aResult) {
   MOZ_CRASH("CacheFileMetadata::OnFileRenamed should not be called!");
   return NS_ERROR_UNEXPECTED;
@@ -977,8 +977,7 @@ nsresult CacheFileMetadata::ParseMetadata(uint32_t aMetaOffset,
   mHashArraySize = hashesLen;
   mHashCount = hashCount;
   if (mHashArraySize) {
-    mHashArray =
-        static_cast(moz_xmalloc(mHashArraySize));
+    mHashArray = static_cast(moz_xmalloc(mHashArraySize));
     memcpy(mHashArray, mBuf + hashesOffset, mHashArraySize);
   }
 
@@ -993,7 +992,7 @@ nsresult CacheFileMetadata::ParseMetadata(uint32_t aMetaOffset,
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::CheckElements(const char *aBuf, uint32_t aSize) {
+nsresult CacheFileMetadata::CheckElements(const char* aBuf, uint32_t aSize) {
   if (aSize) {
     // Check if the metadata ends with a zero byte.
     if (aBuf[aSize - 1] != 0) {
@@ -1047,7 +1046,7 @@ nsresult CacheFileMetadata::EnsureBuffer(uint32_t aSize) {
       aSize = kInitialBufSize;
     }
 
-    char *newBuf = static_cast(realloc(mBuf, aSize));
+    char* newBuf = static_cast(realloc(mBuf, aSize));
     if (!newBuf) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
@@ -1060,7 +1059,7 @@ nsresult CacheFileMetadata::EnsureBuffer(uint32_t aSize) {
   return NS_OK;
 }
 
-nsresult CacheFileMetadata::ParseKey(const nsACString &aKey) {
+nsresult CacheFileMetadata::ParseKey(const nsACString& aKey) {
   nsCOMPtr info = CacheFileUtils::ParseKey(aKey);
   NS_ENSURE_TRUE(info, NS_ERROR_FAILURE);
 
diff --git a/netwerk/cache2/CacheFileMetadata.h b/netwerk/cache2/CacheFileMetadata.h
index c00bebfe5cc39..5dff9326f4219 100644
--- a/netwerk/cache2/CacheFileMetadata.h
+++ b/netwerk/cache2/CacheFileMetadata.h
@@ -51,10 +51,10 @@ class CacheFileMetadataHeader {
   uint32_t mKeySize;
   uint32_t mFlags;
 
-  void WriteToBuf(void *aBuf) {
+  void WriteToBuf(void* aBuf) {
     EnsureCorrectClassSize();
 
-    uint8_t *ptr = static_cast(aBuf);
+    uint8_t* ptr = static_cast(aBuf);
     MOZ_ASSERT(mVersion == kCacheEntryVersion);
     NetworkEndian::writeUint32(ptr, mVersion);
     ptr += sizeof(uint32_t);
@@ -73,10 +73,10 @@ class CacheFileMetadataHeader {
     NetworkEndian::writeUint32(ptr, mFlags);
   }
 
-  void ReadFromBuf(const void *aBuf) {
+  void ReadFromBuf(const void* aBuf) {
     EnsureCorrectClassSize();
 
-    const uint8_t *ptr = static_cast(aBuf);
+    const uint8_t* ptr = static_cast(aBuf);
     mVersion = BigEndian::readUint32(ptr);
     ptr += sizeof(uint32_t);
     mFetchCount = BigEndian::readUint32(ptr);
@@ -135,29 +135,29 @@ class CacheFileMetadata final : public CacheFileIOListener,
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  CacheFileMetadata(CacheFileHandle *aHandle, const nsACString &aKey);
-  CacheFileMetadata(bool aMemoryOnly, bool aPinned, const nsACString &aKey);
+  CacheFileMetadata(CacheFileHandle* aHandle, const nsACString& aKey);
+  CacheFileMetadata(bool aMemoryOnly, bool aPinned, const nsACString& aKey);
   CacheFileMetadata();
 
-  void SetHandle(CacheFileHandle *aHandle);
+  void SetHandle(CacheFileHandle* aHandle);
 
-  nsresult GetKey(nsACString &_retval);
+  nsresult GetKey(nsACString& _retval);
 
-  nsresult ReadMetadata(CacheFileMetadataListener *aListener);
+  nsresult ReadMetadata(CacheFileMetadataListener* aListener);
   uint32_t CalcMetadataSize(uint32_t aElementsSize, uint32_t aHashCount);
   nsresult WriteMetadata(uint32_t aOffset,
-                         CacheFileMetadataListener *aListener);
-  nsresult SyncReadMetadata(nsIFile *aFile);
+                         CacheFileMetadataListener* aListener);
+  nsresult SyncReadMetadata(nsIFile* aFile);
 
   bool IsAnonymous() const { return mAnonymous; }
-  mozilla::OriginAttributes const &OriginAttributes() const {
+  mozilla::OriginAttributes const& OriginAttributes() const {
     return mOriginAttributes;
   }
   bool Pinned() const { return !!(mMetaHdr.mFlags & kCacheEntryIsPinned); }
 
-  const char *GetElement(const char *aKey);
-  nsresult SetElement(const char *aKey, const char *aValue);
-  nsresult Visit(nsICacheEntryMetaDataVisitor *aVisitor);
+  const char* GetElement(const char* aKey);
+  nsresult SetElement(const char* aKey, const char* aValue);
+  nsresult Visit(nsICacheEntryMetaDataVisitor* aVisitor);
 
   CacheHash::Hash16_t GetHash(uint32_t aIndex);
   nsresult SetHash(uint32_t aIndex, CacheHash::Hash16_t aHash);
@@ -165,14 +165,14 @@ class CacheFileMetadata final : public CacheFileIOListener,
 
   nsresult AddFlags(uint32_t aFlags);
   nsresult RemoveFlags(uint32_t aFlags);
-  nsresult GetFlags(uint32_t *_retval);
+  nsresult GetFlags(uint32_t* _retval);
   nsresult SetExpirationTime(uint32_t aExpirationTime);
-  nsresult GetExpirationTime(uint32_t *_retval);
+  nsresult GetExpirationTime(uint32_t* _retval);
   nsresult SetFrecency(uint32_t aFrecency);
-  nsresult GetFrecency(uint32_t *_retval);
-  nsresult GetLastModified(uint32_t *_retval);
-  nsresult GetLastFetched(uint32_t *_retval);
-  nsresult GetFetchCount(uint32_t *_retval);
+  nsresult GetFrecency(uint32_t* _retval);
+  nsresult GetLastModified(uint32_t* _retval);
+  nsresult GetLastFetched(uint32_t* _retval);
+  nsresult GetFetchCount(uint32_t* _retval);
   // Called by upper layers to indicate the entry this metadata belongs
   // with has been fetched, i.e. delivered to the consumer.
   nsresult OnFetched();
@@ -185,14 +185,14 @@ class CacheFileMetadata final : public CacheFileIOListener,
     return sizeof(CacheFileMetadata) + mHashArraySize + mBufSize;
   }
 
-  NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+  NS_IMETHOD OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                            nsresult aResult) override;
-  NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+  NS_IMETHOD OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                         nsresult aResult) override;
-  NS_IMETHOD OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) override;
+  NS_IMETHOD OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnFileRenamed(CacheFileHandle* aHandle, nsresult aResult) override;
   virtual bool IsKilled() override {
     return mListener && mListener->IsKilled();
   }
@@ -207,20 +207,20 @@ class CacheFileMetadata final : public CacheFileIOListener,
 
   nsresult ParseMetadata(uint32_t aMetaOffset, uint32_t aBufOffset,
                          bool aHaveKey);
-  nsresult CheckElements(const char *aBuf, uint32_t aSize);
+  nsresult CheckElements(const char* aBuf, uint32_t aSize);
   nsresult EnsureBuffer(uint32_t aSize);
-  nsresult ParseKey(const nsACString &aKey);
+  nsresult ParseKey(const nsACString& aKey);
 
   RefPtr mHandle;
   nsCString mKey;
-  CacheHash::Hash16_t *mHashArray;
+  CacheHash::Hash16_t* mHashArray;
   uint32_t mHashArraySize;
   uint32_t mHashCount;
   int64_t mOffset;
-  char *mBuf;  // used for parsing, then points
+  char* mBuf;  // used for parsing, then points
                // to elements
   uint32_t mBufSize;
-  char *mWriteBuf;
+  char* mWriteBuf;
   CacheFileMetadataHeader mMetaHdr;
   uint32_t mElementsSize;
   bool mIsDirty : 1;
diff --git a/netwerk/cache2/CacheFileOutputStream.cpp b/netwerk/cache2/CacheFileOutputStream.cpp
index 1dd4cfa4ff74f..9a54588150c48 100644
--- a/netwerk/cache2/CacheFileOutputStream.cpp
+++ b/netwerk/cache2/CacheFileOutputStream.cpp
@@ -45,7 +45,7 @@ NS_INTERFACE_MAP_BEGIN(CacheFileOutputStream)
 NS_INTERFACE_MAP_END
 
 CacheFileOutputStream::CacheFileOutputStream(
-    CacheFile *aFile, CacheOutputCloseListener *aCloseListener,
+    CacheFile* aFile, CacheOutputCloseListener* aCloseListener,
     bool aAlternativeData)
     : mFile(aFile),
       mCloseListener(aCloseListener),
@@ -80,8 +80,8 @@ CacheFileOutputStream::Flush() {
 }
 
 NS_IMETHODIMP
-CacheFileOutputStream::Write(const char *aBuf, uint32_t aCount,
-                             uint32_t *_retval) {
+CacheFileOutputStream::Write(const char* aBuf, uint32_t aCount,
+                             uint32_t* _retval) {
   CacheFileAutoLock lock(mFile);
 
   LOG(("CacheFileOutputStream::Write() [this=%p, count=%d]", this, aCount));
@@ -154,8 +154,8 @@ CacheFileOutputStream::Write(const char *aBuf, uint32_t aCount,
 }
 
 NS_IMETHODIMP
-CacheFileOutputStream::WriteFrom(nsIInputStream *aFromStream, uint32_t aCount,
-                                 uint32_t *_retval) {
+CacheFileOutputStream::WriteFrom(nsIInputStream* aFromStream, uint32_t aCount,
+                                 uint32_t* _retval) {
   LOG(
       ("CacheFileOutputStream::WriteFrom() - NOT_IMPLEMENTED [this=%p, from=%p"
        ", count=%d]",
@@ -165,8 +165,8 @@ CacheFileOutputStream::WriteFrom(nsIInputStream *aFromStream, uint32_t aCount,
 }
 
 NS_IMETHODIMP
-CacheFileOutputStream::WriteSegments(nsReadSegmentFun aReader, void *aClosure,
-                                     uint32_t aCount, uint32_t *_retval) {
+CacheFileOutputStream::WriteSegments(nsReadSegmentFun aReader, void* aClosure,
+                                     uint32_t aCount, uint32_t* _retval) {
   LOG(
       ("CacheFileOutputStream::WriteSegments() - NOT_IMPLEMENTED [this=%p, "
        "count=%d]",
@@ -176,7 +176,7 @@ CacheFileOutputStream::WriteSegments(nsReadSegmentFun aReader, void *aClosure,
 }
 
 NS_IMETHODIMP
-CacheFileOutputStream::IsNonBlocking(bool *_retval) {
+CacheFileOutputStream::IsNonBlocking(bool* _retval) {
   *_retval = false;
   return NS_OK;
 }
@@ -221,9 +221,9 @@ nsresult CacheFileOutputStream::CloseWithStatusLocked(nsresult aStatus) {
 }
 
 NS_IMETHODIMP
-CacheFileOutputStream::AsyncWait(nsIOutputStreamCallback *aCallback,
+CacheFileOutputStream::AsyncWait(nsIOutputStreamCallback* aCallback,
                                  uint32_t aFlags, uint32_t aRequestedCount,
-                                 nsIEventTarget *aEventTarget) {
+                                 nsIEventTarget* aEventTarget) {
   CacheFileAutoLock lock(mFile);
 
   LOG(
@@ -295,7 +295,7 @@ CacheFileOutputStream::SetEOF() {
 
 // nsITellableStream
 NS_IMETHODIMP
-CacheFileOutputStream::Tell(int64_t *_retval) {
+CacheFileOutputStream::Tell(int64_t* _retval) {
   CacheFileAutoLock lock(mFile);
 
   if (mClosed) {
@@ -316,25 +316,25 @@ CacheFileOutputStream::Tell(int64_t *_retval) {
 
 // CacheFileChunkListener
 nsresult CacheFileOutputStream::OnChunkRead(nsresult aResult,
-                                            CacheFileChunk *aChunk) {
+                                            CacheFileChunk* aChunk) {
   MOZ_CRASH("CacheFileOutputStream::OnChunkRead should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
 nsresult CacheFileOutputStream::OnChunkWritten(nsresult aResult,
-                                               CacheFileChunk *aChunk) {
+                                               CacheFileChunk* aChunk) {
   MOZ_CRASH("CacheFileOutputStream::OnChunkWritten should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
 nsresult CacheFileOutputStream::OnChunkAvailable(nsresult aResult,
                                                  uint32_t aChunkIdx,
-                                                 CacheFileChunk *aChunk) {
+                                                 CacheFileChunk* aChunk) {
   MOZ_CRASH("CacheFileOutputStream::OnChunkAvailable should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheFileOutputStream::OnChunkUpdated(CacheFileChunk *aChunk) {
+nsresult CacheFileOutputStream::OnChunkUpdated(CacheFileChunk* aChunk) {
   MOZ_CRASH("CacheFileOutputStream::OnChunkUpdated should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
diff --git a/netwerk/cache2/CacheFileOutputStream.h b/netwerk/cache2/CacheFileOutputStream.h
index 35d06bdf35bfc..0650515079c32 100644
--- a/netwerk/cache2/CacheFileOutputStream.h
+++ b/netwerk/cache2/CacheFileOutputStream.h
@@ -27,15 +27,15 @@ class CacheFileOutputStream : public nsIAsyncOutputStream,
   NS_DECL_NSITELLABLESTREAM
 
  public:
-  CacheFileOutputStream(CacheFile *aFile,
-                        CacheOutputCloseListener *aCloseListener,
+  CacheFileOutputStream(CacheFile* aFile,
+                        CacheOutputCloseListener* aCloseListener,
                         bool aAlternativeData);
 
-  NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk *aChunk) override;
-  NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk *aChunk) override;
+  NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk* aChunk) override;
+  NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk* aChunk) override;
   NS_IMETHOD OnChunkAvailable(nsresult aResult, uint32_t aChunkIdx,
-                              CacheFileChunk *aChunk) override;
-  NS_IMETHOD OnChunkUpdated(CacheFileChunk *aChunk) override;
+                              CacheFileChunk* aChunk) override;
+  NS_IMETHOD OnChunkUpdated(CacheFileChunk* aChunk) override;
 
   void NotifyCloseListener();
   bool IsAlternativeData() const { return mAlternativeData; };
diff --git a/netwerk/cache2/CacheFileUtils.cpp b/netwerk/cache2/CacheFileUtils.cpp
index 2cc853616fe37..f8a5fb17f7f2b 100644
--- a/netwerk/cache2/CacheFileUtils.cpp
+++ b/netwerk/cache2/CacheFileUtils.cpp
@@ -21,7 +21,7 @@ namespace CacheFileUtils {
 // This designates the format for the "alt-data" metadata.
 // When the format changes we need to update the version.
 static uint32_t const kAltDataVersion = 1;
-const char *kAltDataKey = "alt-data";
+const char* kAltDataKey = "alt-data";
 
 static uint32_t const kBaseDomainAccessInfoVersion = 1;
 
@@ -32,7 +32,7 @@ namespace {
  */
 class KeyParser : protected Tokenizer {
  public:
-  explicit KeyParser(nsACString const &aInput)
+  explicit KeyParser(nsACString const& aInput)
       : Tokenizer(aInput),
         isAnonymous(false)
         // Initialize the cache key to a zero length by default
@@ -126,7 +126,7 @@ class KeyParser : protected Tokenizer {
     return ParseTags();
   }
 
-  bool ParseValue(nsACString *result = nullptr) {
+  bool ParseValue(nsACString* result = nullptr) {
     // If at the end, fail since we expect a comma ; value may be empty tho
     if (CheckEOF()) {
       return false;
@@ -167,16 +167,16 @@ class KeyParser : protected Tokenizer {
     return info.forget();
   }
 
-  void URISpec(nsACString &result) { result.Assign(cacheKey); }
+  void URISpec(nsACString& result) { result.Assign(cacheKey); }
 
-  void IdEnhance(nsACString &result) { result.Assign(idEnhance); }
+  void IdEnhance(nsACString& result) { result.Assign(idEnhance); }
 };
 
 }  // namespace
 
-already_AddRefed ParseKey(const nsACString &aKey,
-                                              nsACString *aIdEnhance,
-                                              nsACString *aURISpec) {
+already_AddRefed ParseKey(const nsACString& aKey,
+                                              nsACString* aIdEnhance,
+                                              nsACString* aURISpec) {
   KeyParser parser(aKey);
   RefPtr info = parser.Parse();
 
@@ -188,7 +188,7 @@ already_AddRefed ParseKey(const nsACString &aKey,
   return info.forget();
 }
 
-void AppendKeyPrefix(nsILoadContextInfo *aInfo, nsACString &_retval) {
+void AppendKeyPrefix(nsILoadContextInfo* aInfo, nsACString& _retval) {
   /**
    * This key is used to salt file hashes.  When form of the key is changed
    * cache entries will fail to find on disk.
@@ -197,7 +197,7 @@ void AppendKeyPrefix(nsILoadContextInfo *aInfo, nsACString &_retval) {
    * Keep the attributes list sorted according their ASCII code.
    */
 
-  OriginAttributes const *oa = aInfo->OriginAttributesPtr();
+  OriginAttributes const* oa = aInfo->OriginAttributesPtr();
   nsAutoCString suffix;
   oa->CreateSuffix(suffix);
   if (!suffix.IsEmpty()) {
@@ -213,8 +213,8 @@ void AppendKeyPrefix(nsILoadContextInfo *aInfo, nsACString &_retval) {
   }
 }
 
-void AppendTagWithValue(nsACString &aTarget, char const aTag,
-                        const nsACString &aValue) {
+void AppendTagWithValue(nsACString& aTarget, char const aTag,
+                        const nsACString& aValue) {
   aTarget.Append(aTag);
 
   // First check the value string to save some memory copying
@@ -234,8 +234,8 @@ void AppendTagWithValue(nsACString &aTarget, char const aTag,
   aTarget.Append(',');
 }
 
-nsresult KeyMatchesLoadContextInfo(const nsACString &aKey,
-                                   nsILoadContextInfo *aInfo, bool *_retval) {
+nsresult KeyMatchesLoadContextInfo(const nsACString& aKey,
+                                   nsILoadContextInfo* aInfo, bool* _retval) {
   nsCOMPtr info = ParseKey(aKey);
 
   if (!info) {
@@ -249,7 +249,7 @@ nsresult KeyMatchesLoadContextInfo(const nsACString &aKey,
 ValidityPair::ValidityPair(uint32_t aOffset, uint32_t aLen)
     : mOffset(aOffset), mLen(aLen) {}
 
-bool ValidityPair::CanBeMerged(const ValidityPair &aOther) const {
+bool ValidityPair::CanBeMerged(const ValidityPair& aOther) const {
   // The pairs can be merged into a single one if the start of one of the pairs
   // is placed anywhere in the validity interval of other pair or exactly after
   // its end.
@@ -260,7 +260,7 @@ bool ValidityPair::IsInOrFollows(uint32_t aOffset) const {
   return mOffset <= aOffset && mOffset + mLen >= aOffset;
 }
 
-bool ValidityPair::LessThan(const ValidityPair &aOther) const {
+bool ValidityPair::LessThan(const ValidityPair& aOther) const {
   if (mOffset < aOther.mOffset) {
     return true;
   }
@@ -272,7 +272,7 @@ bool ValidityPair::LessThan(const ValidityPair &aOther) const {
   return false;
 }
 
-void ValidityPair::Merge(const ValidityPair &aOther) {
+void ValidityPair::Merge(const ValidityPair& aOther) {
   MOZ_ASSERT(CanBeMerged(aOther));
 
   uint32_t offset = std::min(mOffset, aOther.mOffset);
@@ -348,7 +348,7 @@ size_t ValidityMap::SizeOfExcludingThis(
   return mMap.ShallowSizeOfExcludingThis(mallocSizeOf);
 }
 
-ValidityPair &ValidityMap::operator[](uint32_t aIdx) {
+ValidityPair& ValidityMap::operator[](uint32_t aIdx) {
   return mMap.ElementAt(aIdx);
 }
 
@@ -598,12 +598,12 @@ bool CachePerfStats::IsCacheSlow() {
 }
 
 // static
-void CachePerfStats::GetSlowStats(uint32_t *aSlow, uint32_t *aNotSlow) {
+void CachePerfStats::GetSlowStats(uint32_t* aSlow, uint32_t* aNotSlow) {
   *aSlow = sCacheSlowCnt;
   *aNotSlow = sCacheNotSlowCnt;
 }
 
-void FreeBuffer(void *aBuf) {
+void FreeBuffer(void* aBuf) {
 #ifndef NS_FREE_PERMANENT_DATA
   if (CacheObserver::ShuttingDown()) {
     return;
@@ -613,8 +613,8 @@ void FreeBuffer(void *aBuf) {
   free(aBuf);
 }
 
-nsresult ParseAlternativeDataInfo(const char *aInfo, int64_t *_offset,
-                                  nsACString *_type) {
+nsresult ParseAlternativeDataInfo(const char* aInfo, int64_t* _offset,
+                                  nsACString* _type) {
   // The format is: "1;12345,javascript/binary"
   //         ;,
   mozilla::Tokenizer p(aInfo, nullptr, "/");
@@ -651,8 +651,8 @@ nsresult ParseAlternativeDataInfo(const char *aInfo, int64_t *_offset,
   return NS_OK;
 }
 
-void BuildAlternativeDataInfo(const char *aInfo, int64_t aOffset,
-                              nsACString &_retval) {
+void BuildAlternativeDataInfo(const char* aInfo, int64_t aOffset,
+                              nsACString& _retval) {
   _retval.Truncate();
   _retval.AppendInt(kAltDataVersion);
   _retval.Append(';');
@@ -661,9 +661,9 @@ void BuildAlternativeDataInfo(const char *aInfo, int64_t aOffset,
   _retval.Append(aInfo);
 }
 
-nsresult ParseBaseDomainAccessInfo(const char *aInfo, uint32_t aTrID,
-                                   const uint32_t *aSearchSiteID, bool *_found,
-                                   uint16_t *_count) {
+nsresult ParseBaseDomainAccessInfo(const char* aInfo, uint32_t aTrID,
+                                   const uint32_t* aSearchSiteID, bool* _found,
+                                   uint16_t* _count) {
   // The format is: "1;12;339456,490536687,1964820,"
   //         ;;,,
   mozilla::Tokenizer p(aInfo);
@@ -707,8 +707,8 @@ nsresult ParseBaseDomainAccessInfo(const char *aInfo, uint32_t aTrID,
   return NS_OK;
 }
 
-void BuildOrAppendBaseDomainAccessInfo(const char *aOldInfo, uint32_t aTrID,
-                                       uint32_t aSiteID, nsACString &_retval) {
+void BuildOrAppendBaseDomainAccessInfo(const char* aOldInfo, uint32_t aTrID,
+                                       uint32_t aSiteID, nsACString& _retval) {
   if (aOldInfo) {
     _retval.Assign(aOldInfo);
   } else {
diff --git a/netwerk/cache2/CacheFileUtils.h b/netwerk/cache2/CacheFileUtils.h
index def077bd2119e..f72d9f8704052 100644
--- a/netwerk/cache2/CacheFileUtils.h
+++ b/netwerk/cache2/CacheFileUtils.h
@@ -18,29 +18,29 @@ namespace mozilla {
 namespace net {
 namespace CacheFileUtils {
 
-extern const char *kAltDataKey;
+extern const char* kAltDataKey;
 
-already_AddRefed ParseKey(const nsACString &aKey,
-                                              nsACString *aIdEnhance = nullptr,
-                                              nsACString *aURISpec = nullptr);
+already_AddRefed ParseKey(const nsACString& aKey,
+                                              nsACString* aIdEnhance = nullptr,
+                                              nsACString* aURISpec = nullptr);
 
-void AppendKeyPrefix(nsILoadContextInfo *aInfo, nsACString &_retval);
+void AppendKeyPrefix(nsILoadContextInfo* aInfo, nsACString& _retval);
 
-void AppendTagWithValue(nsACString &aTarget, char const aTag,
-                        const nsACString &aValue);
+void AppendTagWithValue(nsACString& aTarget, char const aTag,
+                        const nsACString& aValue);
 
-nsresult KeyMatchesLoadContextInfo(const nsACString &aKey,
-                                   nsILoadContextInfo *aInfo, bool *_retval);
+nsresult KeyMatchesLoadContextInfo(const nsACString& aKey,
+                                   nsILoadContextInfo* aInfo, bool* _retval);
 
 class ValidityPair {
  public:
   ValidityPair(uint32_t aOffset, uint32_t aLen);
 
-  ValidityPair &operator=(const ValidityPair &aOther) = default;
+  ValidityPair& operator=(const ValidityPair& aOther) = default;
 
   // Returns true when two pairs can be merged, i.e. they do overlap or the one
   // ends exactly where the other begins.
-  bool CanBeMerged(const ValidityPair &aOther) const;
+  bool CanBeMerged(const ValidityPair& aOther) const;
 
   // Returns true when aOffset is placed anywhere in the validity interval or
   // exactly after its end.
@@ -49,10 +49,10 @@ class ValidityPair {
   // Returns true when this pair has lower offset than the other pair. In case
   // both pairs have the same offset it returns true when this pair has a
   // shorter length.
-  bool LessThan(const ValidityPair &aOther) const;
+  bool LessThan(const ValidityPair& aOther) const;
 
   // Merges two pair into one.
-  void Merge(const ValidityPair &aOther);
+  void Merge(const ValidityPair& aOther);
 
   uint32_t Offset() const { return mOffset; }
   uint32_t Len() const { return mLen; }
@@ -79,7 +79,7 @@ class ValidityMap {
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
 
-  ValidityPair &operator[](uint32_t aIdx);
+  ValidityPair& operator[](uint32_t aIdx);
 
  private:
   nsTArray mMap;
@@ -155,7 +155,7 @@ class CachePerfStats {
   static uint32_t GetAverage(EDataType aType, bool aFiltered);
   static uint32_t GetStdDev(EDataType aType, bool aFiltered);
   static bool IsCacheSlow();
-  static void GetSlowStats(uint32_t *aSlow, uint32_t *aNotSlow);
+  static void GetSlowStats(uint32_t* aSlow, uint32_t* aNotSlow);
 
  private:
   // This class computes average and standard deviation, it returns an
@@ -209,13 +209,13 @@ class CachePerfStats {
   static uint32_t sCacheNotSlowCnt;
 };
 
-void FreeBuffer(void *aBuf);
+void FreeBuffer(void* aBuf);
 
-nsresult ParseAlternativeDataInfo(const char *aInfo, int64_t *_offset,
-                                  nsACString *_type);
+nsresult ParseAlternativeDataInfo(const char* aInfo, int64_t* _offset,
+                                  nsACString* _type);
 
-void BuildAlternativeDataInfo(const char *aInfo, int64_t aOffset,
-                              nsACString &_retval);
+void BuildAlternativeDataInfo(const char* aInfo, int64_t aOffset,
+                              nsACString& _retval);
 
 // Parses base domain access info. If the info cannot be parsed (e.g. it's
 // corrupted or it's invalid because aTrID has changed) an error is thrown.
@@ -223,16 +223,16 @@ void BuildAlternativeDataInfo(const char *aInfo, int64_t aOffset,
 // in the info is returned in _count.
 // If aSearchSiteID is passed, then _count argument is ignored. It only searches
 // siteID in the info and returns the result in _found.
-nsresult ParseBaseDomainAccessInfo(const char *aInfo, uint32_t aTrID,
-                                   const uint32_t *aSearchSiteID, bool *_found,
-                                   uint16_t *_count);
+nsresult ParseBaseDomainAccessInfo(const char* aInfo, uint32_t aTrID,
+                                   const uint32_t* aSearchSiteID, bool* _found,
+                                   uint16_t* _count);
 
 // If aOldInfo is null then new base domain access info containing aSiteID is
 // built. If an old base domain access info is passed in aOldInfo, then only
 // aSiteID is appended to it. Note that this function doesn't parse the old base
 // domain info, i.e. it assumes that it's valid and it doesn't contain aSiteID.
-void BuildOrAppendBaseDomainAccessInfo(const char *aOldInfo, uint32_t aTrID,
-                                       uint32_t aSiteID, nsACString &_retval);
+void BuildOrAppendBaseDomainAccessInfo(const char* aOldInfo, uint32_t aTrID,
+                                       uint32_t aSiteID, nsACString& _retval);
 
 }  // namespace CacheFileUtils
 }  // namespace net
diff --git a/netwerk/cache2/CacheHashUtils.cpp b/netwerk/cache2/CacheHashUtils.cpp
index 03fdb1aa1413b..77ff4a87ba761 100644
--- a/netwerk/cache2/CacheHashUtils.cpp
+++ b/netwerk/cache2/CacheHashUtils.cpp
@@ -19,7 +19,7 @@ namespace net {
  *  This algorithm is used to check the data integrity.
  */
 
-static inline void hashmix(uint32_t &a, uint32_t &b, uint32_t &c) {
+static inline void hashmix(uint32_t& a, uint32_t& b, uint32_t& c) {
   a -= b;
   a -= c;
   a ^= (c >> 13);
@@ -49,9 +49,9 @@ static inline void hashmix(uint32_t &a, uint32_t &b, uint32_t &c) {
   c ^= (b >> 15);
 }
 
-CacheHash::Hash32_t CacheHash::Hash(const char *aData, uint32_t aSize,
+CacheHash::Hash32_t CacheHash::Hash(const char* aData, uint32_t aSize,
                                     uint32_t aInitval) {
-  const uint8_t *k = reinterpret_cast(aData);
+  const uint8_t* k = reinterpret_cast(aData);
   uint32_t a, b, c, len;
 
   /* Set up the internal state */
@@ -115,7 +115,7 @@ CacheHash::Hash32_t CacheHash::Hash(const char *aData, uint32_t aSize,
   return c;
 }
 
-CacheHash::Hash16_t CacheHash::Hash16(const char *aData, uint32_t aSize,
+CacheHash::Hash16_t CacheHash::Hash16(const char* aData, uint32_t aSize,
                                       uint32_t aInitval) {
   Hash32_t hash = Hash(aData, aSize, aInitval);
   return (hash & 0xFFFF);
@@ -158,8 +158,8 @@ void CacheHash::Feed(uint32_t aVal, uint8_t aLen) {
   mLength += aLen;
 }
 
-void CacheHash::Update(const char *aData, uint32_t aLen) {
-  const uint8_t *data = reinterpret_cast(aData);
+void CacheHash::Update(const char* aData, uint32_t aLen) {
+  const uint8_t* data = reinterpret_cast(aData);
 
   MOZ_ASSERT(!mFinalized);
 
@@ -219,7 +219,7 @@ CacheHash::Hash16_t CacheHash::GetHash16() {
   return (hash & 0xFFFF);
 }
 
-OriginAttrsHash GetOriginAttrsHash(const mozilla::OriginAttributes &aOA) {
+OriginAttrsHash GetOriginAttrsHash(const mozilla::OriginAttributes& aOA) {
   nsAutoCString suffix;
   aOA.CreateSuffix(suffix);
 
diff --git a/netwerk/cache2/CacheHashUtils.h b/netwerk/cache2/CacheHashUtils.h
index 5bcbd5d0c8578..574e0aff0afd6 100644
--- a/netwerk/cache2/CacheHashUtils.h
+++ b/netwerk/cache2/CacheHashUtils.h
@@ -10,12 +10,12 @@
 #include "prnetdb.h"
 #include "nsPrintfCString.h"
 
-#define LOGSHA1(x)                                          \
-  PR_htonl((reinterpret_cast(x))[0]),     \
-      PR_htonl((reinterpret_cast(x))[1]), \
-      PR_htonl((reinterpret_cast(x))[2]), \
-      PR_htonl((reinterpret_cast(x))[3]), \
-      PR_htonl((reinterpret_cast(x))[4])
+#define LOGSHA1(x)                                         \
+  PR_htonl((reinterpret_cast(x))[0]),     \
+      PR_htonl((reinterpret_cast(x))[1]), \
+      PR_htonl((reinterpret_cast(x))[2]), \
+      PR_htonl((reinterpret_cast(x))[3]), \
+      PR_htonl((reinterpret_cast(x))[4])
 
 #define SHA1STRING(x) \
   (nsPrintfCString("%08x%08x%08x%08x%08x", LOGSHA1(x)).get())
@@ -33,14 +33,14 @@ class CacheHash : public nsISupports {
   typedef uint16_t Hash16_t;
   typedef uint32_t Hash32_t;
 
-  static Hash32_t Hash(const char *aData, uint32_t aSize,
+  static Hash32_t Hash(const char* aData, uint32_t aSize,
                        uint32_t aInitval = 0);
-  static Hash16_t Hash16(const char *aData, uint32_t aSize,
+  static Hash16_t Hash16(const char* aData, uint32_t aSize,
                          uint32_t aInitval = 0);
 
   explicit CacheHash(uint32_t aInitval = 0);
 
-  void Update(const char *aData, uint32_t aLen);
+  void Update(const char* aData, uint32_t aLen);
   Hash32_t GetHash();
   Hash16_t GetHash16();
 
@@ -59,7 +59,7 @@ class CacheHash : public nsISupports {
 
 typedef uint64_t OriginAttrsHash;
 
-OriginAttrsHash GetOriginAttrsHash(const mozilla::OriginAttributes &aOA);
+OriginAttrsHash GetOriginAttrsHash(const mozilla::OriginAttributes& aOA);
 
 }  // namespace net
 }  // namespace mozilla
diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp
index 97a85dd1a47e3..038bc14969a4a 100644
--- a/netwerk/cache2/CacheIndex.cpp
+++ b/netwerk/cache2/CacheIndex.cpp
@@ -41,14 +41,14 @@ namespace {
 
 class FrecencyComparator {
  public:
-  bool Equals(CacheIndexRecord *a, CacheIndexRecord *b) const {
+  bool Equals(CacheIndexRecord* a, CacheIndexRecord* b) const {
     if (!a || !b) {
       return false;
     }
 
     return a->mFrecency == b->mFrecency;
   }
-  bool LessThan(CacheIndexRecord *a, CacheIndexRecord *b) const {
+  bool LessThan(CacheIndexRecord* a, CacheIndexRecord* b) const {
     // Removed (=null) entries must be at the end of the array.
     if (!a) {
       return false;
@@ -77,7 +77,7 @@ class FrecencyComparator {
  */
 class CacheIndexEntryAutoManage {
  public:
-  CacheIndexEntryAutoManage(const SHA1Sum::Hash *aHash, CacheIndex *aIndex)
+  CacheIndexEntryAutoManage(const SHA1Sum::Hash* aHash, CacheIndex* aIndex)
       : mIndex(aIndex),
         mOldRecord(nullptr),
         mOldFrecency(0),
@@ -86,7 +86,7 @@ class CacheIndexEntryAutoManage {
     CacheIndex::sLock.AssertCurrentThreadOwns();
 
     mHash = aHash;
-    const CacheIndexEntry *entry = FindEntry();
+    const CacheIndexEntry* entry = FindEntry();
     mIndex->mIndexStats.BeforeChange(entry);
     if (entry && entry->IsInitialized() && !entry->IsRemoved()) {
       mOldRecord = entry->mRec;
@@ -97,7 +97,7 @@ class CacheIndexEntryAutoManage {
   ~CacheIndexEntryAutoManage() {
     CacheIndex::sLock.AssertCurrentThreadOwns();
 
-    const CacheIndexEntry *entry = FindEntry();
+    const CacheIndexEntry* entry = FindEntry();
     mIndex->mIndexStats.AfterChange(entry);
     if (!entry || !entry->IsInitialized() || entry->IsRemoved()) {
       entry = nullptr;
@@ -139,8 +139,8 @@ class CacheIndexEntryAutoManage {
   void DoNotSearchInUpdates() { mDoNotSearchInUpdates = true; }
 
  private:
-  const CacheIndexEntry *FindEntry() {
-    const CacheIndexEntry *entry = nullptr;
+  const CacheIndexEntry* FindEntry() {
+    const CacheIndexEntry* entry = nullptr;
 
     switch (mIndex->mState) {
       case CacheIndex::READING:
@@ -165,9 +165,9 @@ class CacheIndexEntryAutoManage {
     return entry;
   }
 
-  const SHA1Sum::Hash *mHash;
+  const SHA1Sum::Hash* mHash;
   RefPtr mIndex;
-  CacheIndexRecord *mOldRecord;
+  CacheIndexRecord* mOldRecord;
   uint32_t mOldFrecency;
   bool mDoNotSearchInIndex;
   bool mDoNotSearchInUpdates;
@@ -177,7 +177,7 @@ class FileOpenHelper final : public CacheFileIOListener {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  explicit FileOpenHelper(CacheIndex *aIndex)
+  explicit FileOpenHelper(CacheIndex* aIndex)
       : mIndex(aIndex), mCanceled(false) {}
 
   void Cancel() {
@@ -188,26 +188,26 @@ class FileOpenHelper final : public CacheFileIOListener {
  private:
   virtual ~FileOpenHelper() = default;
 
-  NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+  NS_IMETHOD OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                            nsresult aResult) override {
     MOZ_CRASH("FileOpenHelper::OnDataWritten should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
-  NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+  NS_IMETHOD OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                         nsresult aResult) override {
     MOZ_CRASH("FileOpenHelper::OnDataRead should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
-  NS_IMETHOD OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) override {
+  NS_IMETHOD OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) override {
     MOZ_CRASH("FileOpenHelper::OnFileDoomed should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
-  NS_IMETHOD OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) override {
+  NS_IMETHOD OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) override {
     MOZ_CRASH("FileOpenHelper::OnEOFSet should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
-  NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle,
+  NS_IMETHOD OnFileRenamed(CacheFileHandle* aHandle,
                            nsresult aResult) override {
     MOZ_CRASH("FileOpenHelper::OnFileRenamed should not be called!");
     return NS_ERROR_UNEXPECTED;
@@ -217,7 +217,7 @@ class FileOpenHelper final : public CacheFileIOListener {
   bool mCanceled;
 };
 
-NS_IMETHODIMP FileOpenHelper::OnFileOpened(CacheFileHandle *aHandle,
+NS_IMETHODIMP FileOpenHelper::OnFileOpened(CacheFileHandle* aHandle,
                                            nsresult aResult) {
   StaticMutexAutoLock lock(CacheIndex::sLock);
 
@@ -278,7 +278,7 @@ CacheIndex::~CacheIndex() {
 }
 
 // static
-nsresult CacheIndex::Init(nsIFile *aCacheDirectory) {
+nsresult CacheIndex::Init(nsIFile* aCacheDirectory) {
   LOG(("CacheIndex::Init()"));
 
   MOZ_ASSERT(NS_IsMainThread());
@@ -298,7 +298,7 @@ nsresult CacheIndex::Init(nsIFile *aCacheDirectory) {
   return NS_OK;
 }
 
-nsresult CacheIndex::InitInternal(nsIFile *aCacheDirectory) {
+nsresult CacheIndex::InitInternal(nsIFile* aCacheDirectory) {
   nsresult rv;
 
   rv = aCacheDirectory->Clone(getter_AddRefs(mCacheDirectory));
@@ -477,7 +477,7 @@ nsresult CacheIndex::Shutdown() {
 }
 
 // static
-nsresult CacheIndex::AddEntry(const SHA1Sum::Hash *aHash) {
+nsresult CacheIndex::AddEntry(const SHA1Sum::Hash* aHash) {
   LOG(("CacheIndex::AddEntry() [hash=%08x%08x%08x%08x%08x]", LOGSHA1(aHash)));
 
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThread());
@@ -503,9 +503,9 @@ nsresult CacheIndex::AddEntry(const SHA1Sum::Hash *aHash) {
   {
     CacheIndexEntryAutoManage entryMng(aHash, index);
 
-    CacheIndexEntry *entry = index->mIndex.GetEntry(*aHash);
+    CacheIndexEntry* entry = index->mIndex.GetEntry(*aHash);
     bool entryRemoved = entry && entry->IsRemoved();
-    CacheIndexEntryUpdate *updated = nullptr;
+    CacheIndexEntryUpdate* updated = nullptr;
 
     if (index->mState == READY || index->mState == UPDATING ||
         index->mState == BUILDING) {
@@ -593,7 +593,7 @@ nsresult CacheIndex::AddEntry(const SHA1Sum::Hash *aHash) {
 }
 
 // static
-nsresult CacheIndex::EnsureEntryExists(const SHA1Sum::Hash *aHash) {
+nsresult CacheIndex::EnsureEntryExists(const SHA1Sum::Hash* aHash) {
   LOG(("CacheIndex::EnsureEntryExists() [hash=%08x%08x%08x%08x%08x]",
        LOGSHA1(aHash)));
 
@@ -614,7 +614,7 @@ nsresult CacheIndex::EnsureEntryExists(const SHA1Sum::Hash *aHash) {
   {
     CacheIndexEntryAutoManage entryMng(aHash, index);
 
-    CacheIndexEntry *entry = index->mIndex.GetEntry(*aHash);
+    CacheIndexEntry* entry = index->mIndex.GetEntry(*aHash);
     bool entryRemoved = entry && entry->IsRemoved();
 
     if (index->mState == READY || index->mState == UPDATING ||
@@ -647,7 +647,7 @@ nsresult CacheIndex::EnsureEntryExists(const SHA1Sum::Hash *aHash) {
       }
       entry->MarkFresh();
     } else {  // WRITING, READING
-      CacheIndexEntryUpdate *updated = index->mPendingUpdates.GetEntry(*aHash);
+      CacheIndexEntryUpdate* updated = index->mPendingUpdates.GetEntry(*aHash);
       bool updatedRemoved = updated && updated->IsRemoved();
 
       if (updatedRemoved || (!updated && entryRemoved && entry->IsFresh())) {
@@ -701,7 +701,7 @@ nsresult CacheIndex::EnsureEntryExists(const SHA1Sum::Hash *aHash) {
 }
 
 // static
-nsresult CacheIndex::InitEntry(const SHA1Sum::Hash *aHash,
+nsresult CacheIndex::InitEntry(const SHA1Sum::Hash* aHash,
                                OriginAttrsHash aOriginAttrsHash,
                                bool aAnonymous, bool aPinned) {
   LOG(
@@ -726,8 +726,8 @@ nsresult CacheIndex::InitEntry(const SHA1Sum::Hash *aHash,
   {
     CacheIndexEntryAutoManage entryMng(aHash, index);
 
-    CacheIndexEntry *entry = index->mIndex.GetEntry(*aHash);
-    CacheIndexEntryUpdate *updated = nullptr;
+    CacheIndexEntry* entry = index->mIndex.GetEntry(*aHash);
+    CacheIndexEntryUpdate* updated = nullptr;
     bool reinitEntry = false;
 
     if (entry && entry->IsRemoved()) {
@@ -830,7 +830,7 @@ nsresult CacheIndex::InitEntry(const SHA1Sum::Hash *aHash,
 }
 
 // static
-nsresult CacheIndex::RemoveEntry(const SHA1Sum::Hash *aHash) {
+nsresult CacheIndex::RemoveEntry(const SHA1Sum::Hash* aHash) {
   LOG(("CacheIndex::RemoveEntry() [hash=%08x%08x%08x%08x%08x]",
        LOGSHA1(aHash)));
 
@@ -851,7 +851,7 @@ nsresult CacheIndex::RemoveEntry(const SHA1Sum::Hash *aHash) {
   {
     CacheIndexEntryAutoManage entryMng(aHash, index);
 
-    CacheIndexEntry *entry = index->mIndex.GetEntry(*aHash);
+    CacheIndexEntry* entry = index->mIndex.GetEntry(*aHash);
     bool entryRemoved = entry && entry->IsRemoved();
 
     if (index->mState == READY || index->mState == UPDATING ||
@@ -888,7 +888,7 @@ nsresult CacheIndex::RemoveEntry(const SHA1Sum::Hash *aHash) {
         }
       }
     } else {  // WRITING, READING
-      CacheIndexEntryUpdate *updated = index->mPendingUpdates.GetEntry(*aHash);
+      CacheIndexEntryUpdate* updated = index->mPendingUpdates.GetEntry(*aHash);
       bool updatedRemoved = updated && updated->IsRemoved();
 
       if (updatedRemoved || (!updated && entryRemoved && entry->IsFresh())) {
@@ -928,11 +928,11 @@ nsresult CacheIndex::RemoveEntry(const SHA1Sum::Hash *aHash) {
 
 // static
 nsresult CacheIndex::UpdateEntry(
-    const SHA1Sum::Hash *aHash, const uint32_t *aFrecency,
-    const bool *aHasAltData, const uint16_t *aOnStartTime,
-    const uint16_t *aOnStopTime, const uint8_t *aContentType,
-    const uint16_t *aBaseDomainAccessCount, const uint32_t aTelemetryReportID,
-    const uint32_t *aSize) {
+    const SHA1Sum::Hash* aHash, const uint32_t* aFrecency,
+    const bool* aHasAltData, const uint16_t* aOnStartTime,
+    const uint16_t* aOnStopTime, const uint8_t* aContentType,
+    const uint16_t* aBaseDomainAccessCount, const uint32_t aTelemetryReportID,
+    const uint32_t* aSize) {
   LOG(
       ("CacheIndex::UpdateEntry() [hash=%08x%08x%08x%08x%08x, "
        "frecency=%s, hasAltData=%s, onStartTime=%s, onStopTime=%s, "
@@ -965,7 +965,7 @@ nsresult CacheIndex::UpdateEntry(
   {
     CacheIndexEntryAutoManage entryMng(aHash, index);
 
-    CacheIndexEntry *entry = index->mIndex.GetEntry(*aHash);
+    CacheIndexEntry* entry = index->mIndex.GetEntry(*aHash);
 
     uint16_t baseDomainAccessCount = 0;
     if (aBaseDomainAccessCount) {
@@ -1036,7 +1036,7 @@ nsresult CacheIndex::UpdateEntry(
         entry->SetFileSize(*aSize);
       }
     } else {
-      CacheIndexEntryUpdate *updated = index->mPendingUpdates.GetEntry(*aHash);
+      CacheIndexEntryUpdate* updated = index->mPendingUpdates.GetEntry(*aHash);
       DebugOnly removed = updated && updated->IsRemoved();
 
       MOZ_ASSERT(updated || !removed);
@@ -1193,8 +1193,8 @@ nsresult CacheIndex::RemoveAll() {
 
 // static
 nsresult CacheIndex::HasEntry(
-    const nsACString &aKey, EntryStatus *_retval,
-    const std::function &aCB) {
+    const nsACString& aKey, EntryStatus* _retval,
+    const std::function& aCB) {
   LOG(("CacheIndex::HasEntry() [key=%s]", PromiseFlatCString(aKey).get()));
 
   SHA1Sum sum;
@@ -1207,8 +1207,8 @@ nsresult CacheIndex::HasEntry(
 
 // static
 nsresult CacheIndex::HasEntry(
-    const SHA1Sum::Hash &hash, EntryStatus *_retval,
-    const std::function &aCB) {
+    const SHA1Sum::Hash& hash, EntryStatus* _retval,
+    const std::function& aCB) {
   StaticMutexAutoLock lock(sLock);
 
   RefPtr index = gInstance;
@@ -1221,7 +1221,7 @@ nsresult CacheIndex::HasEntry(
     return NS_ERROR_NOT_AVAILABLE;
   }
 
-  const CacheIndexEntry *entry = nullptr;
+  const CacheIndexEntry* entry = nullptr;
 
   switch (index->mState) {
     case READING:
@@ -1267,7 +1267,7 @@ nsresult CacheIndex::HasEntry(
 
 // static
 nsresult CacheIndex::GetEntryForEviction(bool aIgnoreEmptyEntries,
-                                         SHA1Sum::Hash *aHash, uint32_t *aCnt) {
+                                         SHA1Sum::Hash* aHash, uint32_t* aCnt) {
   LOG(("CacheIndex::GetEntryForEviction()"));
 
   MOZ_ASSERT(CacheFileIOManager::IsOnIOThread());
@@ -1283,14 +1283,14 @@ nsresult CacheIndex::GetEntryForEviction(bool aIgnoreEmptyEntries,
   }
 
   SHA1Sum::Hash hash;
-  CacheIndexRecord *foundRecord = nullptr;
+  CacheIndexRecord* foundRecord = nullptr;
   uint32_t skipped = 0;
 
   // find first non-forced valid and unpinned entry with the lowest frecency
   index->mFrecencyArray.SortIfNeeded();
 
   for (auto iter = index->mFrecencyArray.Iter(); !iter.Done(); iter.Next()) {
-    CacheIndexRecord *rec = iter.Get();
+    CacheIndexRecord* rec = iter.Get();
 
     memcpy(&hash, rec->mHash, sizeof(SHA1Sum::Hash));
 
@@ -1328,7 +1328,7 @@ nsresult CacheIndex::GetEntryForEviction(bool aIgnoreEmptyEntries,
 }
 
 // static
-bool CacheIndex::IsForcedValidEntry(const SHA1Sum::Hash *aHash) {
+bool CacheIndex::IsForcedValidEntry(const SHA1Sum::Hash* aHash) {
   RefPtr handle;
 
   CacheFileIOManager::gInstance->mHandles.GetHandle(aHash,
@@ -1341,7 +1341,7 @@ bool CacheIndex::IsForcedValidEntry(const SHA1Sum::Hash *aHash) {
 }
 
 // static
-nsresult CacheIndex::GetCacheSize(uint32_t *_retval) {
+nsresult CacheIndex::GetCacheSize(uint32_t* _retval) {
   LOG(("CacheIndex::GetCacheSize()"));
 
   StaticMutexAutoLock lock(sLock);
@@ -1360,7 +1360,7 @@ nsresult CacheIndex::GetCacheSize(uint32_t *_retval) {
 }
 
 // static
-nsresult CacheIndex::GetEntryFileCount(uint32_t *_retval) {
+nsresult CacheIndex::GetEntryFileCount(uint32_t* _retval) {
   LOG(("CacheIndex::GetEntryFileCount()"));
 
   StaticMutexAutoLock lock(sLock);
@@ -1381,8 +1381,8 @@ nsresult CacheIndex::GetEntryFileCount(uint32_t *_retval) {
 }
 
 // static
-nsresult CacheIndex::GetCacheStats(nsILoadContextInfo *aInfo, uint32_t *aSize,
-                                   uint32_t *aCount) {
+nsresult CacheIndex::GetCacheStats(nsILoadContextInfo* aInfo, uint32_t* aSize,
+                                   uint32_t* aCount) {
   LOG(("CacheIndex::GetCacheStats() [info=%p]", aInfo));
 
   StaticMutexAutoLock lock(sLock);
@@ -1401,7 +1401,7 @@ nsresult CacheIndex::GetCacheStats(nsILoadContextInfo *aInfo, uint32_t *aSize,
   *aCount = 0;
 
   for (auto iter = index->mFrecencyArray.Iter(); !iter.Done(); iter.Next()) {
-    CacheIndexRecord *record = iter.Get();
+    CacheIndexRecord* record = iter.Get();
     if (aInfo && !CacheIndexEntry::RecordMatchesLoadContextInfo(record, aInfo))
       continue;
 
@@ -1414,7 +1414,7 @@ nsresult CacheIndex::GetCacheStats(nsILoadContextInfo *aInfo, uint32_t *aSize,
 
 // static
 nsresult CacheIndex::AsyncGetDiskConsumption(
-    nsICacheStorageConsumptionObserver *aObserver) {
+    nsICacheStorageConsumptionObserver* aObserver) {
   LOG(("CacheIndex::AsyncGetDiskConsumption()"));
 
   StaticMutexAutoLock lock(sLock);
@@ -1468,8 +1468,8 @@ nsresult CacheIndex::AsyncGetDiskConsumption(
 }
 
 // static
-nsresult CacheIndex::GetIterator(nsILoadContextInfo *aInfo, bool aAddNew,
-                                 CacheIndexIterator **_retval) {
+nsresult CacheIndex::GetIterator(nsILoadContextInfo* aInfo, bool aAddNew,
+                                 CacheIndexIterator** _retval) {
   LOG(("CacheIndex::GetIterator() [info=%p, addNew=%d]", aInfo, aAddNew));
 
   StaticMutexAutoLock lock(sLock);
@@ -1503,7 +1503,7 @@ nsresult CacheIndex::GetIterator(nsILoadContextInfo *aInfo, bool aAddNew,
 }
 
 // static
-nsresult CacheIndex::IsUpToDate(bool *_retval) {
+nsresult CacheIndex::IsUpToDate(bool* _retval) {
   LOG(("CacheIndex::IsUpToDate()"));
 
   StaticMutexAutoLock lock(sLock);
@@ -1545,7 +1545,7 @@ bool CacheIndex::IsIndexUsable() {
 }
 
 // static
-bool CacheIndex::IsCollision(CacheIndexEntry *aEntry,
+bool CacheIndex::IsCollision(CacheIndexEntry* aEntry,
                              OriginAttrsHash aOriginAttrsHash,
                              bool aAnonymous) {
   if (!aEntry->IsInitialized()) {
@@ -1569,10 +1569,10 @@ bool CacheIndex::IsCollision(CacheIndexEntry *aEntry,
 
 // static
 bool CacheIndex::HasEntryChanged(
-    CacheIndexEntry *aEntry, const uint32_t *aFrecency, const bool *aHasAltData,
-    const uint16_t *aOnStartTime, const uint16_t *aOnStopTime,
-    const uint8_t *aContentType, const uint16_t *aBaseDomainAccessCount,
-    const uint32_t *aSize) {
+    CacheIndexEntry* aEntry, const uint32_t* aFrecency, const bool* aHasAltData,
+    const uint16_t* aOnStartTime, const uint16_t* aOnStopTime,
+    const uint8_t* aContentType, const uint16_t* aBaseDomainAccessCount,
+    const uint32_t* aSize) {
   if (aFrecency && *aFrecency != aEntry->GetFrecency()) {
     return true;
   }
@@ -1612,14 +1612,14 @@ void CacheIndex::ProcessPendingOperations() {
   sLock.AssertCurrentThreadOwns();
 
   for (auto iter = mPendingUpdates.Iter(); !iter.Done(); iter.Next()) {
-    CacheIndexEntryUpdate *update = iter.Get();
+    CacheIndexEntryUpdate* update = iter.Get();
 
     LOG(("CacheIndex::ProcessPendingOperations() [hash=%08x%08x%08x%08x%08x]",
          LOGSHA1(update->Hash())));
 
     MOZ_ASSERT(update->IsFresh());
 
-    CacheIndexEntry *entry = mIndex.GetEntry(*update->Hash());
+    CacheIndexEntry* entry = mIndex.GetEntry(*update->Hash());
 
     {
       CacheIndexEntryAutoManage emng(update->Hash(), this);
@@ -1752,7 +1752,7 @@ void CacheIndex::WriteRecords() {
   }
   uint32_t hashOffset = mRWBufPos;
 
-  char *buf = mRWBuf + mRWBufPos;
+  char* buf = mRWBuf + mRWBufPos;
   uint32_t skip = mSkipEntries;
   uint32_t processMax = (mRWBufSize - mRWBufPos) / sizeof(CacheIndexRecord);
   MOZ_ASSERT(processMax != 0 ||
@@ -1763,7 +1763,7 @@ void CacheIndex::WriteRecords() {
   bool hasMore = false;
 #endif
   for (auto iter = mIndex.Iter(); !iter.Done(); iter.Next()) {
-    CacheIndexEntry *entry = iter.Get();
+    CacheIndexEntry* entry = iter.Get();
     if (entry->IsRemoved() || !entry->IsInitialized() || entry->IsFileEmpty()) {
       continue;
     }
@@ -1800,7 +1800,7 @@ void CacheIndex::WriteRecords() {
     if (mRWBufPos + sizeof(CacheHash::Hash32_t) > mRWBufSize) {
       // realloc buffer to spare another write cycle
       mRWBufSize = mRWBufPos + sizeof(CacheHash::Hash32_t);
-      mRWBuf = static_cast(moz_xrealloc(mRWBuf, mRWBufSize));
+      mRWBuf = static_cast(moz_xrealloc(mRWBuf, mRWBufSize));
     }
 
     NetworkEndian::writeUint32(mRWBuf + mRWBufPos, mRWHash->GetHash());
@@ -1844,7 +1844,7 @@ void CacheIndex::FinishWrite(bool aSucceeded) {
     MOZ_ASSERT(!mIndexFileOpener);
 
     for (auto iter = mIndex.Iter(); !iter.Done(); iter.Next()) {
-      CacheIndexEntry *entry = iter.Get();
+      CacheIndexEntry* entry = iter.Get();
 
       bool remove = false;
       {
@@ -1882,7 +1882,7 @@ void CacheIndex::FinishWrite(bool aSucceeded) {
   }
 }
 
-nsresult CacheIndex::GetFile(const nsACString &aName, nsIFile **_retval) {
+nsresult CacheIndex::GetFile(const nsACString& aName, nsIFile** _retval) {
   nsresult rv;
 
   nsCOMPtr file;
@@ -1896,7 +1896,7 @@ nsresult CacheIndex::GetFile(const nsACString &aName, nsIFile **_retval) {
   return NS_OK;
 }
 
-nsresult CacheIndex::RemoveFile(const nsACString &aName) {
+nsresult CacheIndex::RemoveFile(const nsACString& aName) {
   MOZ_ASSERT(mState == SHUTDOWN);
 
   nsresult rv;
@@ -1938,28 +1938,28 @@ void CacheIndex::RemoveJournalAndTempFile() {
 
 class WriteLogHelper {
  public:
-  explicit WriteLogHelper(PRFileDesc *aFD)
+  explicit WriteLogHelper(PRFileDesc* aFD)
       : mFD(aFD), mBufSize(kMaxBufSize), mBufPos(0) {
     mHash = new CacheHash();
-    mBuf = static_cast(moz_xmalloc(mBufSize));
+    mBuf = static_cast(moz_xmalloc(mBufSize));
   }
 
   ~WriteLogHelper() { free(mBuf); }
 
-  nsresult AddEntry(CacheIndexEntry *aEntry);
+  nsresult AddEntry(CacheIndexEntry* aEntry);
   nsresult Finish();
 
  private:
   nsresult FlushBuffer();
 
-  PRFileDesc *mFD;
-  char *mBuf;
+  PRFileDesc* mFD;
+  char* mBuf;
   uint32_t mBufSize;
   int32_t mBufPos;
   RefPtr mHash;
 };
 
-nsresult WriteLogHelper::AddEntry(CacheIndexEntry *aEntry) {
+nsresult WriteLogHelper::AddEntry(CacheIndexEntry* aEntry) {
   nsresult rv;
 
   if (mBufPos + sizeof(CacheIndexRecord) > mBufSize) {
@@ -2036,14 +2036,14 @@ nsresult CacheIndex::WriteLogToDisk() {
 
   mIndexStats.Log();
 
-  PRFileDesc *fd = nullptr;
+  PRFileDesc* fd = nullptr;
   rv = logFile->OpenNSPRFileDesc(PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE, 0600,
                                  &fd);
   NS_ENSURE_SUCCESS(rv, rv);
 
   WriteLogHelper wlh(fd);
   for (auto iter = mIndex.Iter(); !iter.Done(); iter.Next()) {
-    CacheIndexEntry *entry = iter.Get();
+    CacheIndexEntry* entry = iter.Get();
     if (entry->IsRemoved() || entry->IsDirty()) {
       rv = wlh.AddEntry(entry);
       if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -2202,15 +2202,15 @@ void CacheIndex::ParseRecords() {
         mJournalHandle = nullptr;
       }
     } else {
-      uint32_t *isDirty =
-          reinterpret_cast(moz_xmalloc(sizeof(uint32_t)));
+      uint32_t* isDirty =
+          reinterpret_cast(moz_xmalloc(sizeof(uint32_t)));
       NetworkEndian::writeUint32(isDirty, 1);
 
       // Mark index dirty. The buffer is freed by CacheFileIOManager when
       // nullptr is passed as the listener and the call doesn't fail
       // synchronously.
       rv = CacheFileIOManager::Write(mIndexHandle, 2 * sizeof(uint32_t),
-                                     reinterpret_cast(isDirty),
+                                     reinterpret_cast(isDirty),
                                      sizeof(uint32_t), true, false, nullptr);
       if (NS_FAILED(rv)) {
         // This is not fatal, just free the memory
@@ -2224,7 +2224,7 @@ void CacheIndex::ParseRecords() {
 
   while (pos + sizeof(CacheIndexRecord) <= mRWBufPos &&
          mSkipEntries != entryCnt) {
-    CacheIndexRecord *rec = reinterpret_cast(mRWBuf + pos);
+    CacheIndexRecord* rec = reinterpret_cast(mRWBuf + pos);
     CacheIndexEntry tmpEntry(&rec->mHash);
     tmpEntry.ReadFromBuf(mRWBuf + pos);
 
@@ -2242,7 +2242,7 @@ void CacheIndex::ParseRecords() {
 
     CacheIndexEntryAutoManage emng(tmpEntry.Hash(), this);
 
-    CacheIndexEntry *entry = mIndex.PutEntry(*tmpEntry.Hash());
+    CacheIndexEntry* entry = mIndex.PutEntry(*tmpEntry.Hash());
     *entry = tmpEntry;
 
     pos += sizeof(CacheIndexRecord);
@@ -2359,10 +2359,10 @@ void CacheIndex::ParseJournal() {
 
   while (pos + sizeof(CacheIndexRecord) <= mRWBufPos &&
          mSkipEntries != entryCnt) {
-    CacheIndexEntry tmpEntry(reinterpret_cast(mRWBuf + pos));
+    CacheIndexEntry tmpEntry(reinterpret_cast(mRWBuf + pos));
     tmpEntry.ReadFromBuf(mRWBuf + pos);
 
-    CacheIndexEntry *entry = mTmpJournal.PutEntry(*tmpEntry.Hash());
+    CacheIndexEntry* entry = mTmpJournal.PutEntry(*tmpEntry.Hash());
     *entry = tmpEntry;
 
     if (entry->IsDirty() || entry->IsFresh()) {
@@ -2429,12 +2429,12 @@ void CacheIndex::MergeJournal() {
   sLock.AssertCurrentThreadOwns();
 
   for (auto iter = mTmpJournal.Iter(); !iter.Done(); iter.Next()) {
-    CacheIndexEntry *entry = iter.Get();
+    CacheIndexEntry* entry = iter.Get();
 
     LOG(("CacheIndex::MergeJournal() [hash=%08x%08x%08x%08x%08x]",
          LOGSHA1(entry->Hash())));
 
-    CacheIndexEntry *entry2 = mIndex.GetEntry(*entry->Hash());
+    CacheIndexEntry* entry2 = mIndex.GetEntry(*entry->Hash());
     {
       CacheIndexEntryAutoManage emng(entry->Hash(), this);
       if (entry->IsRemoved()) {
@@ -2563,7 +2563,7 @@ void CacheIndex::FinishRead(bool aSucceeded) {
 }
 
 // static
-void CacheIndex::DelayedUpdate(nsITimer *aTimer, void *aClosure) {
+void CacheIndex::DelayedUpdate(nsITimer* aTimer, void* aClosure) {
   LOG(("CacheIndex::DelayedUpdate()"));
 
   StaticMutexAutoLock lock(sLock);
@@ -2663,8 +2663,8 @@ nsresult CacheIndex::SetupDirectoryEnumerator() {
   return NS_OK;
 }
 
-nsresult CacheIndex::InitEntryFromDiskData(CacheIndexEntry *aEntry,
-                                           CacheFileMetadata *aMetaData,
+nsresult CacheIndex::InitEntryFromDiskData(CacheIndexEntry* aEntry,
+                                           CacheFileMetadata* aMetaData,
                                            int64_t aFileSize) {
   nsresult rv;
 
@@ -2679,7 +2679,7 @@ nsresult CacheIndex::InitEntryFromDiskData(CacheIndexEntry *aEntry,
   aMetaData->GetFrecency(&frecency);
   aEntry->SetFrecency(frecency);
 
-  const char *altData = aMetaData->GetElement(CacheFileUtils::kAltDataKey);
+  const char* altData = aMetaData->GetElement(CacheFileUtils::kAltDataKey);
   bool hasAltData = altData ? true : false;
   if (hasAltData && NS_FAILED(CacheFileUtils::ParseAlternativeDataInfo(
                         altData, nullptr, nullptr))) {
@@ -2687,7 +2687,7 @@ nsresult CacheIndex::InitEntryFromDiskData(CacheIndexEntry *aEntry,
   }
   aEntry->SetHasAltData(hasAltData);
 
-  static auto toUint16 = [](const char *aUint16String) -> uint16_t {
+  static auto toUint16 = [](const char* aUint16String) -> uint16_t {
     if (!aUint16String) {
       return kIndexTimeNotAvailable;
     }
@@ -2702,7 +2702,7 @@ nsresult CacheIndex::InitEntryFromDiskData(CacheIndexEntry *aEntry,
   aEntry->SetOnStopTime(
       toUint16(aMetaData->GetElement("net-response-time-onstop")));
 
-  const char *contentTypeStr = aMetaData->GetElement("ctid");
+  const char* contentTypeStr = aMetaData->GetElement("ctid");
   uint8_t contentType = nsICacheEntry::CONTENT_TYPE_UNKNOWN;
   if (contentTypeStr) {
     int64_t n64 = nsDependentCString(contentTypeStr).ToInteger64(&rv);
@@ -2715,7 +2715,7 @@ nsresult CacheIndex::InitEntryFromDiskData(CacheIndexEntry *aEntry,
   aEntry->SetContentType(contentType);
 
   uint32_t trID = CacheObserver::TelemetryReportID();
-  const char *siteIDInfo = aMetaData->GetElement("eTLD1Access");
+  const char* siteIDInfo = aMetaData->GetElement("eTLD1Access");
   uint16_t siteIDCount = 0;
   if (siteIDInfo) {
     CacheFileUtils::ParseBaseDomainAccessInfo(siteIDInfo, trID, nullptr,
@@ -2821,7 +2821,7 @@ void CacheIndex::BuildIndex() {
       continue;
     }
 
-    CacheIndexEntry *entry = mIndex.GetEntry(hash);
+    CacheIndexEntry* entry = mIndex.GetEntry(hash);
     if (entry && entry->IsRemoved()) {
       LOG(
           ("CacheIndex::BuildIndex() - Found file that should not exist. "
@@ -3064,7 +3064,7 @@ void CacheIndex::UpdateIndex() {
       continue;
     }
 
-    CacheIndexEntry *entry = mIndex.GetEntry(hash);
+    CacheIndexEntry* entry = mIndex.GetEntry(hash);
     if (entry && entry->IsRemoved()) {
       if (entry->IsFresh()) {
         LOG(
@@ -3241,7 +3241,7 @@ void CacheIndex::FinishUpdate(bool aSucceeded) {
 
 void CacheIndex::RemoveNonFreshEntries() {
   for (auto iter = mIndex.Iter(); !iter.Done(); iter.Next()) {
-    CacheIndexEntry *entry = iter.Get();
+    CacheIndexEntry* entry = iter.Get();
     if (entry->IsFresh()) {
       continue;
     }
@@ -3261,7 +3261,7 @@ void CacheIndex::RemoveNonFreshEntries() {
 }
 
 // static
-char const *CacheIndex::StateString(EState aState) {
+char const* CacheIndex::StateString(EState aState) {
   switch (aState) {
     case INITIAL:
       return "INITIAL";
@@ -3326,7 +3326,7 @@ void CacheIndex::NotifyAsyncGetDiskConsumptionCallbacks() {
   if ((mState == READY || mState == WRITING) &&
       !mAsyncGetDiskConsumptionBlocked && mDiskConsumptionObservers.Length()) {
     for (uint32_t i = 0; i < mDiskConsumptionObservers.Length(); ++i) {
-      DiskConsumptionObserver *o = mDiskConsumptionObservers[i];
+      DiskConsumptionObserver* o = mDiskConsumptionObservers[i];
       // Safe to call under the lock.  We always post to the main thread.
       o->OnDiskConsumption(mIndexStats.Size() << 10);
     }
@@ -3351,7 +3351,7 @@ void CacheIndex::AllocBuffer() {
       MOZ_ASSERT(false, "Unexpected state!");
   }
 
-  mRWBuf = static_cast(moz_xmalloc(mRWBufSize));
+  mRWBuf = static_cast(moz_xmalloc(mRWBufSize));
 }
 
 void CacheIndex::ReleaseBuffer() {
@@ -3369,7 +3369,7 @@ void CacheIndex::ReleaseBuffer() {
   mRWBufPos = 0;
 }
 
-void CacheIndex::FrecencyArray::AppendRecord(CacheIndexRecord *aRecord) {
+void CacheIndex::FrecencyArray::AppendRecord(CacheIndexRecord* aRecord) {
   LOG(
       ("CacheIndex::FrecencyArray::AppendRecord() [record=%p, hash=%08x%08x%08x"
        "%08x%08x]",
@@ -3385,7 +3385,7 @@ void CacheIndex::FrecencyArray::AppendRecord(CacheIndexRecord *aRecord) {
   }
 }
 
-void CacheIndex::FrecencyArray::RemoveRecord(CacheIndexRecord *aRecord) {
+void CacheIndex::FrecencyArray::RemoveRecord(CacheIndexRecord* aRecord) {
   LOG(("CacheIndex::FrecencyArray::RemoveRecord() [record=%p]", aRecord));
 
   decltype(mRecs)::index_type idx;
@@ -3399,8 +3399,8 @@ void CacheIndex::FrecencyArray::RemoveRecord(CacheIndexRecord *aRecord) {
   SortIfNeeded();
 }
 
-void CacheIndex::FrecencyArray::ReplaceRecord(CacheIndexRecord *aOldRecord,
-                                              CacheIndexRecord *aNewRecord) {
+void CacheIndex::FrecencyArray::ReplaceRecord(CacheIndexRecord* aOldRecord,
+                                              CacheIndexRecord* aNewRecord) {
   LOG(
       ("CacheIndex::FrecencyArray::ReplaceRecord() [oldRecord=%p, "
        "newRecord=%p]",
@@ -3443,7 +3443,7 @@ void CacheIndex::FrecencyArray::SortIfNeeded() {
   }
 }
 
-void CacheIndex::AddRecordToIterators(CacheIndexRecord *aRecord) {
+void CacheIndex::AddRecordToIterators(CacheIndexRecord* aRecord) {
   sLock.AssertCurrentThreadOwns();
 
   for (uint32_t i = 0; i < mIterators.Length(); ++i) {
@@ -3454,7 +3454,7 @@ void CacheIndex::AddRecordToIterators(CacheIndexRecord *aRecord) {
   }
 }
 
-void CacheIndex::RemoveRecordFromIterators(CacheIndexRecord *aRecord) {
+void CacheIndex::RemoveRecordFromIterators(CacheIndexRecord* aRecord) {
   sLock.AssertCurrentThreadOwns();
 
   for (uint32_t i = 0; i < mIterators.Length(); ++i) {
@@ -3465,8 +3465,8 @@ void CacheIndex::RemoveRecordFromIterators(CacheIndexRecord *aRecord) {
   }
 }
 
-void CacheIndex::ReplaceRecordInIterators(CacheIndexRecord *aOldRecord,
-                                          CacheIndexRecord *aNewRecord) {
+void CacheIndex::ReplaceRecordInIterators(CacheIndexRecord* aOldRecord,
+                                          CacheIndexRecord* aNewRecord) {
   sLock.AssertCurrentThreadOwns();
 
   for (uint32_t i = 0; i < mIterators.Length(); ++i) {
@@ -3508,8 +3508,8 @@ nsresult CacheIndex::Run() {
   return NS_OK;
 }
 
-nsresult CacheIndex::OnFileOpenedInternal(FileOpenHelper *aOpener,
-                                          CacheFileHandle *aHandle,
+nsresult CacheIndex::OnFileOpenedInternal(FileOpenHelper* aOpener,
+                                          CacheFileHandle* aHandle,
                                           nsresult aResult) {
   LOG(
       ("CacheIndex::OnFileOpenedInternal() [opener=%p, handle=%p, "
@@ -3616,12 +3616,12 @@ nsresult CacheIndex::OnFileOpenedInternal(FileOpenHelper *aOpener,
   return NS_OK;
 }
 
-nsresult CacheIndex::OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheIndex::OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) {
   MOZ_CRASH("CacheIndex::OnFileOpened should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheIndex::OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+nsresult CacheIndex::OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                                    nsresult aResult) {
   LOG(("CacheIndex::OnDataWritten() [handle=%p, result=0x%08" PRIx32 "]",
        aHandle, static_cast(aResult)));
@@ -3674,7 +3674,7 @@ nsresult CacheIndex::OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
   return NS_OK;
 }
 
-nsresult CacheIndex::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+nsresult CacheIndex::OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                                 nsresult aResult) {
   LOG(("CacheIndex::OnDataRead() [handle=%p, result=0x%08" PRIx32 "]", aHandle,
        static_cast(aResult)));
@@ -3713,17 +3713,17 @@ nsresult CacheIndex::OnDataRead(CacheFileHandle *aHandle, char *aBuf,
   return NS_OK;
 }
 
-nsresult CacheIndex::OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheIndex::OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) {
   MOZ_CRASH("CacheIndex::OnFileDoomed should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheIndex::OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheIndex::OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) {
   MOZ_CRASH("CacheIndex::OnEOFSet should not be called!");
   return NS_ERROR_UNEXPECTED;
 }
 
-nsresult CacheIndex::OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) {
+nsresult CacheIndex::OnFileRenamed(CacheFileHandle* aHandle, nsresult aResult) {
   LOG(("CacheIndex::OnFileRenamed() [handle=%p, result=0x%08" PRIx32 "]",
        aHandle, static_cast(aResult)));
 
@@ -3840,18 +3840,18 @@ namespace {
 
 class HashComparator {
  public:
-  bool Equals(CacheIndexRecord *a, CacheIndexRecord *b) const {
+  bool Equals(CacheIndexRecord* a, CacheIndexRecord* b) const {
     return memcmp(&a->mHash, &b->mHash, sizeof(SHA1Sum::Hash)) == 0;
   }
-  bool LessThan(CacheIndexRecord *a, CacheIndexRecord *b) const {
+  bool LessThan(CacheIndexRecord* a, CacheIndexRecord* b) const {
     return memcmp(&a->mHash, &b->mHash, sizeof(SHA1Sum::Hash)) < 0;
   }
 };
 
-void ReportHashSizeMatch(const SHA1Sum::Hash *aHash1,
-                         const SHA1Sum::Hash *aHash2) {
-  const uint32_t *h1 = reinterpret_cast(aHash1);
-  const uint32_t *h2 = reinterpret_cast(aHash2);
+void ReportHashSizeMatch(const SHA1Sum::Hash* aHash1,
+                         const SHA1Sum::Hash* aHash2) {
+  const uint32_t* h1 = reinterpret_cast(aHash1);
+  const uint32_t* h2 = reinterpret_cast(aHash2);
 
   for (uint32_t i = 0; i < 5; ++i) {
     if (h1[i] != h2[i]) {
@@ -3889,7 +3889,7 @@ void CacheIndex::ReportHashStats() {
     return;
   }
 
-  nsTArray records;
+  nsTArray records;
   for (auto iter = mFrecencyArray.Iter(); !iter.Done(); iter.Next()) {
     records.AppendElement(iter.Get());
   }
@@ -3963,7 +3963,7 @@ void CacheIndex::DoBaseDomainAccessTelemetryReport() {
   memset(&countIncByType, 0, sizeof(countIncByType));
 
   for (auto iter = mIndex.Iter(); !iter.Done(); iter.Next()) {
-    CacheIndexEntry *entry = iter.Get();
+    CacheIndexEntry* entry = iter.Get();
     if (entry->IsRemoved() || !entry->IsInitialized() || entry->IsFileEmpty()) {
       entry->SetBaseDomainAccessCount(0);
       continue;
diff --git a/netwerk/cache2/CacheIndex.h b/netwerk/cache2/CacheIndex.h
index 12696923a6071..a0f834e4bab0d 100644
--- a/netwerk/cache2/CacheIndex.h
+++ b/netwerk/cache2/CacheIndex.h
@@ -112,8 +112,8 @@ static_assert(sizeof(CacheIndexRecord::mHash) +
 
 class CacheIndexEntry : public PLDHashEntryHdr {
  public:
-  typedef const SHA1Sum::Hash &KeyType;
-  typedef const SHA1Sum::Hash *KeyTypePointer;
+  typedef const SHA1Sum::Hash& KeyType;
+  typedef const SHA1Sum::Hash* KeyTypePointer;
 
   explicit CacheIndexEntry(KeyTypePointer aKey) {
     MOZ_COUNT_CTOR(CacheIndexEntry);
@@ -122,7 +122,7 @@ class CacheIndexEntry : public PLDHashEntryHdr {
          mRec.get()));
     memcpy(&mRec->mHash, aKey, sizeof(SHA1Sum::Hash));
   }
-  CacheIndexEntry(const CacheIndexEntry &aOther) {
+  CacheIndexEntry(const CacheIndexEntry& aOther) {
     MOZ_ASSERT_UNREACHABLE("CacheIndexEntry copy constructor is forbidden!");
   }
   ~CacheIndexEntry() {
@@ -141,18 +141,18 @@ class CacheIndexEntry : public PLDHashEntryHdr {
 
   // HashKey(): calculate the hash number
   static PLDHashNumber HashKey(KeyTypePointer aKey) {
-    return (reinterpret_cast(aKey))[0];
+    return (reinterpret_cast(aKey))[0];
   }
 
   // ALLOW_MEMMOVE can we move this class with memmove(), or do we have
   // to use the copy constructor?
   enum { ALLOW_MEMMOVE = true };
 
-  bool operator==(const CacheIndexEntry &aOther) const {
+  bool operator==(const CacheIndexEntry& aOther) const {
     return KeyEquals(&aOther.mRec->mHash);
   }
 
-  CacheIndexEntry &operator=(const CacheIndexEntry &aOther) {
+  CacheIndexEntry& operator=(const CacheIndexEntry& aOther) {
     MOZ_ASSERT(
         memcmp(&mRec->mHash, &aOther.mRec->mHash, sizeof(SHA1Sum::Hash)) == 0);
     mRec->mFrecency = aOther.mRec->mFrecency;
@@ -195,7 +195,7 @@ class CacheIndexEntry : public PLDHashEntryHdr {
     }
   }
 
-  const SHA1Sum::Hash *Hash() const { return &mRec->mHash; }
+  const SHA1Sum::Hash* Hash() const { return &mRec->mHash; }
 
   bool IsInitialized() const { return !!(mRec->mFlags & kInitializedMask); }
 
@@ -256,16 +256,16 @@ class CacheIndexEntry : public PLDHashEntryHdr {
   }
   // Returns filesize in kilobytes.
   uint32_t GetFileSize() const { return GetFileSize(mRec); }
-  static uint32_t GetFileSize(CacheIndexRecord *aRec) {
+  static uint32_t GetFileSize(CacheIndexRecord* aRec) {
     return aRec->mFlags & kFileSizeMask;
   }
-  static uint32_t IsPinned(CacheIndexRecord *aRec) {
+  static uint32_t IsPinned(CacheIndexRecord* aRec) {
     return aRec->mFlags & kPinnedMask;
   }
   bool IsFileEmpty() const { return GetFileSize() == 0; }
 
-  void WriteToBuf(void *aBuf) {
-    uint8_t *ptr = static_cast(aBuf);
+  void WriteToBuf(void* aBuf) {
+    uint8_t* ptr = static_cast(aBuf);
     memcpy(ptr, mRec->mHash, sizeof(SHA1Sum::Hash));
     ptr += sizeof(SHA1Sum::Hash);
     NetworkEndian::writeUint32(ptr, mRec->mFrecency);
@@ -285,8 +285,8 @@ class CacheIndexEntry : public PLDHashEntryHdr {
     NetworkEndian::writeUint32(ptr, mRec->mFlags & ~(kDirtyMask | kFreshMask));
   }
 
-  void ReadFromBuf(void *aBuf) {
-    const uint8_t *ptr = static_cast(aBuf);
+  void ReadFromBuf(void* aBuf) {
+    const uint8_t* ptr = static_cast(aBuf);
     MOZ_ASSERT(memcmp(&mRec->mHash, ptr, sizeof(SHA1Sum::Hash)) == 0);
     ptr += sizeof(SHA1Sum::Hash);
     mRec->mFrecency = NetworkEndian::readUint32(ptr);
@@ -317,8 +317,8 @@ class CacheIndexEntry : public PLDHashEntryHdr {
          GetBaseDomainAccessCount(), GetFileSize()));
   }
 
-  static bool RecordMatchesLoadContextInfo(CacheIndexRecord *aRec,
-                                           nsILoadContextInfo *aInfo) {
+  static bool RecordMatchesLoadContextInfo(CacheIndexRecord* aRec,
+                                           nsILoadContextInfo* aInfo) {
     MOZ_ASSERT(aInfo);
 
     if (!aInfo->IsPrivate() &&
@@ -386,11 +386,11 @@ class CacheIndexEntryUpdate : public CacheIndexEntry {
     LOG(("CacheIndexEntryUpdate::~CacheIndexEntryUpdate()"));
   }
 
-  CacheIndexEntryUpdate &operator=(const CacheIndexEntry &aOther) {
+  CacheIndexEntryUpdate& operator=(const CacheIndexEntry& aOther) {
     MOZ_ASSERT(
         memcmp(&mRec->mHash, &aOther.mRec->mHash, sizeof(SHA1Sum::Hash)) == 0);
     mUpdateFlags = 0;
-    *(static_cast(this)) = aOther;
+    *(static_cast(this)) = aOther;
     return *this;
   }
 
@@ -436,7 +436,7 @@ class CacheIndexEntryUpdate : public CacheIndexEntry {
     CacheIndexEntry::SetFileSize(aFileSize);
   }
 
-  void ApplyUpdate(CacheIndexEntry *aDst) {
+  void ApplyUpdate(CacheIndexEntry* aDst) {
     MOZ_ASSERT(
         memcmp(&mRec->mHash, &aDst->mRec->mHash, sizeof(SHA1Sum::Hash)) == 0);
     if (mUpdateFlags & kFrecencyUpdatedMask) {
@@ -501,7 +501,7 @@ class CacheIndexStats {
   {
   }
 
-  bool operator==(const CacheIndexStats &aOther) const {
+  bool operator==(const CacheIndexStats& aOther) const {
     return
 #ifdef DEBUG
         aOther.mStateLogged == mStateLogged &&
@@ -566,7 +566,7 @@ class CacheIndexStats {
     return mSize;
   }
 
-  void BeforeChange(const CacheIndexEntry *aEntry) {
+  void BeforeChange(const CacheIndexEntry* aEntry) {
 #ifdef DEBUG_STATS
     if (!mDisableLogging) {
       LOG(("CacheIndexStats::BeforeChange()"));
@@ -611,7 +611,7 @@ class CacheIndexStats {
     }
   }
 
-  void AfterChange(const CacheIndexEntry *aEntry) {
+  void AfterChange(const CacheIndexEntry* aEntry) {
     MOZ_ASSERT(mStateLogged,
                "CacheIndexStats::AfterChange() - state not "
                "logged!");
@@ -677,7 +677,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
 
   CacheIndex();
 
-  static nsresult Init(nsIFile *aCacheDirectory);
+  static nsresult Init(nsIFile* aCacheDirectory);
   static nsresult PreShutdown();
   static nsresult Shutdown();
 
@@ -687,34 +687,34 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
   // method is called whenever a new handle for a new entry file is created. The
   // newly created entry is not initialized and it must be either initialized
   // with InitEntry() or removed with RemoveEntry().
-  static nsresult AddEntry(const SHA1Sum::Hash *aHash);
+  static nsresult AddEntry(const SHA1Sum::Hash* aHash);
 
   // Inform index about an existing entry that should be present in index. This
   // method is called whenever a new handle for an existing entry file is
   // created. Like in case of AddEntry(), either InitEntry() or RemoveEntry()
   // must be called on the entry, since the entry is not initizlized if the
   // index is outdated.
-  static nsresult EnsureEntryExists(const SHA1Sum::Hash *aHash);
+  static nsresult EnsureEntryExists(const SHA1Sum::Hash* aHash);
 
   // Initialize the entry. It MUST be present in index. Call to AddEntry() or
   // EnsureEntryExists() must precede the call to this method.
-  static nsresult InitEntry(const SHA1Sum::Hash *aHash,
+  static nsresult InitEntry(const SHA1Sum::Hash* aHash,
                             OriginAttrsHash aOriginAttrsHash, bool aAnonymous,
                             bool aPinned);
 
   // Remove entry from index. The entry should be present in index.
-  static nsresult RemoveEntry(const SHA1Sum::Hash *aHash);
+  static nsresult RemoveEntry(const SHA1Sum::Hash* aHash);
 
   // Update some information in entry. The entry MUST be present in index and
   // MUST be initialized. Call to AddEntry() or EnsureEntryExists() and to
   // InitEntry() must precede the call to this method.
   // Pass nullptr if the value didn't change.
   static nsresult UpdateEntry(
-      const SHA1Sum::Hash *aHash, const uint32_t *aFrecency,
-      const bool *aHasAltData, const uint16_t *aOnStartTime,
-      const uint16_t *aOnStopTime, const uint8_t *aContentType,
-      const uint16_t *aBaseDomainAccessCount, const uint32_t aTelemetryReportID,
-      const uint32_t *aSize);
+      const SHA1Sum::Hash* aHash, const uint32_t* aFrecency,
+      const bool* aHasAltData, const uint16_t* aOnStartTime,
+      const uint16_t* aOnStopTime, const uint8_t* aContentType,
+      const uint16_t* aBaseDomainAccessCount, const uint32_t aTelemetryReportID,
+      const uint32_t* aSize);
 
   // Remove all entries from the index. Called when clearing the whole cache.
   static nsresult RemoveAll();
@@ -726,51 +726,51 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
   // If the optional aCB callback is given, the it will be called with a
   // CacheIndexEntry only if _retval is EXISTS when the method returns.
   static nsresult HasEntry(
-      const nsACString &aKey, EntryStatus *_retval,
-      const std::function &aCB = nullptr);
+      const nsACString& aKey, EntryStatus* _retval,
+      const std::function& aCB = nullptr);
   static nsresult HasEntry(
-      const SHA1Sum::Hash &hash, EntryStatus *_retval,
-      const std::function &aCB = nullptr);
+      const SHA1Sum::Hash& hash, EntryStatus* _retval,
+      const std::function& aCB = nullptr);
 
   // Returns a hash of the least important entry that should be evicted if the
   // cache size is over limit and also returns a total number of all entries in
   // the index minus the number of forced valid entries and unpinned entries
   // that we encounter when searching (see below)
   static nsresult GetEntryForEviction(bool aIgnoreEmptyEntries,
-                                      SHA1Sum::Hash *aHash, uint32_t *aCnt);
+                                      SHA1Sum::Hash* aHash, uint32_t* aCnt);
 
   // Checks if a cache entry is currently forced valid. Used to prevent an entry
   // (that has been forced valid) from being evicted when the cache size reaches
   // its limit.
-  static bool IsForcedValidEntry(const SHA1Sum::Hash *aHash);
+  static bool IsForcedValidEntry(const SHA1Sum::Hash* aHash);
 
   // Returns cache size in kB.
-  static nsresult GetCacheSize(uint32_t *_retval);
+  static nsresult GetCacheSize(uint32_t* _retval);
 
   // Returns number of entry files in the cache
-  static nsresult GetEntryFileCount(uint32_t *_retval);
+  static nsresult GetEntryFileCount(uint32_t* _retval);
 
   // Synchronously returns the disk occupation and number of entries
   // per-context. Callable on any thread. It will ignore loadContextInfo and get
   // stats for all entries if the aInfo is a nullptr.
-  static nsresult GetCacheStats(nsILoadContextInfo *aInfo, uint32_t *aSize,
-                                uint32_t *aCount);
+  static nsresult GetCacheStats(nsILoadContextInfo* aInfo, uint32_t* aSize,
+                                uint32_t* aCount);
 
   // Asynchronously gets the disk cache size, used for display in the UI.
   static nsresult AsyncGetDiskConsumption(
-      nsICacheStorageConsumptionObserver *aObserver);
+      nsICacheStorageConsumptionObserver* aObserver);
 
   // Returns an iterator that returns entries matching a given context that were
   // present in the index at the time this method was called. If aAddNew is true
   // then the iterator will also return entries created after this call.
   // NOTE: When some entry is removed from index it is removed also from the
   // iterator regardless what aAddNew was passed.
-  static nsresult GetIterator(nsILoadContextInfo *aInfo, bool aAddNew,
-                              CacheIndexIterator **_retval);
+  static nsresult GetIterator(nsILoadContextInfo* aInfo, bool aAddNew,
+                              CacheIndexIterator** _retval);
 
   // Returns true if we _think_ that the index is up to date. I.e. the state is
   // READY or WRITING and mIndexNeedsUpdate as well as mShuttingDown is false.
-  static nsresult IsUpToDate(bool *_retval);
+  static nsresult IsUpToDate(bool* _retval);
 
   // Called from CacheStorageService::Clear() and
   // CacheFileContextEvictor::EvictEntries(), sets a flag that blocks
@@ -792,18 +792,18 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
 
   virtual ~CacheIndex();
 
-  NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) override;
-  nsresult OnFileOpenedInternal(FileOpenHelper *aOpener,
-                                CacheFileHandle *aHandle, nsresult aResult);
-  NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf,
+  NS_IMETHOD OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) override;
+  nsresult OnFileOpenedInternal(FileOpenHelper* aOpener,
+                                CacheFileHandle* aHandle, nsresult aResult);
+  NS_IMETHOD OnDataWritten(CacheFileHandle* aHandle, const char* aBuf,
                            nsresult aResult) override;
-  NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf,
+  NS_IMETHOD OnDataRead(CacheFileHandle* aHandle, char* aBuf,
                         nsresult aResult) override;
-  NS_IMETHOD OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) override;
-  NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) override;
+  NS_IMETHOD OnFileDoomed(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnEOFSet(CacheFileHandle* aHandle, nsresult aResult) override;
+  NS_IMETHOD OnFileRenamed(CacheFileHandle* aHandle, nsresult aResult) override;
 
-  nsresult InitInternal(nsIFile *aCacheDirectory);
+  nsresult InitInternal(nsIFile* aCacheDirectory);
   void PreShutdownInternal();
 
   // This method returns false when index is not initialized or is shut down.
@@ -813,15 +813,15 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
   // originAttributes and isAnonymous. We don't expect to find a collision
   // since these values are part of the key that we hash and we use a strong
   // hash function.
-  static bool IsCollision(CacheIndexEntry *aEntry,
+  static bool IsCollision(CacheIndexEntry* aEntry,
                           OriginAttrsHash aOriginAttrsHash, bool aAnonymous);
 
   // Checks whether any of the information about the entry has changed.
   static bool HasEntryChanged(
-      CacheIndexEntry *aEntry, const uint32_t *aFrecency,
-      const bool *aHasAltData, const uint16_t *aOnStartTime,
-      const uint16_t *aOnStopTime, const uint8_t *aContentType,
-      const uint16_t *aBaseDomainAccessCount, const uint32_t *aSize);
+      CacheIndexEntry* aEntry, const uint32_t* aFrecency,
+      const bool* aHasAltData, const uint16_t* aOnStartTime,
+      const uint16_t* aOnStopTime, const uint8_t* aContentType,
+      const uint16_t* aBaseDomainAccessCount, const uint32_t* aSize);
 
   // Merge all pending operations from mPendingUpdates into mIndex.
   void ProcessPendingOperations();
@@ -852,8 +852,8 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
   // dirty, i.e. changes that are not present in the index file on the disk.
   // When the log is written successfully, the dirty flag in index file is
   // cleared.
-  nsresult GetFile(const nsACString &aName, nsIFile **_retval);
-  nsresult RemoveFile(const nsACString &aName);
+  nsresult GetFile(const nsACString& aName, nsIFile** _retval);
+  nsresult RemoveFile(const nsACString& aName);
   void RemoveAllIndexFiles();
   void RemoveJournalAndTempFile();
   // Writes journal to the disk and clears dirty flag in index header.
@@ -918,13 +918,13 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
 
   // Following methods perform updating and building of the index.
   // Timer callback that starts update or build process.
-  static void DelayedUpdate(nsITimer *aTimer, void *aClosure);
+  static void DelayedUpdate(nsITimer* aTimer, void* aClosure);
   void DelayedUpdateLocked();
   // Posts timer event that start update or build process.
   nsresult ScheduleUpdateTimer(uint32_t aDelay);
   nsresult SetupDirectoryEnumerator();
-  nsresult InitEntryFromDiskData(CacheIndexEntry *aEntry,
-                                 CacheFileMetadata *aMetaData,
+  nsresult InitEntryFromDiskData(CacheIndexEntry* aEntry,
+                                 CacheFileMetadata* aMetaData,
                                  int64_t aFileSize);
   // Returns true when either a timer is scheduled or event is posted.
   bool IsUpdatePending();
@@ -995,7 +995,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
     SHUTDOWN = 6
   };
 
-  static char const *StateString(EState aState);
+  static char const* StateString(EState aState);
   void ChangeState(EState aNewState);
   void NotifyAsyncGetDiskConsumptionCallbacks();
 
@@ -1004,10 +1004,10 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
   void ReleaseBuffer();
 
   // Methods used by CacheIndexEntryAutoManage to keep the iterators up to date.
-  void AddRecordToIterators(CacheIndexRecord *aRecord);
-  void RemoveRecordFromIterators(CacheIndexRecord *aRecord);
-  void ReplaceRecordInIterators(CacheIndexRecord *aOldRecord,
-                                CacheIndexRecord *aNewRecord);
+  void AddRecordToIterators(CacheIndexRecord* aRecord);
+  void RemoveRecordFromIterators(CacheIndexRecord* aRecord);
+  void ReplaceRecordInIterators(CacheIndexRecord* aOldRecord,
+                                CacheIndexRecord* aNewRecord);
 
   // Memory reporting (private part)
   size_t SizeOfExcludingThisInternal(mozilla::MallocSizeOf mallocSizeOf) const;
@@ -1071,7 +1071,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
   // in hashtable that are initialized and are not marked as removed when
   // writing begins.
   uint32_t mProcessEntries;
-  char *mRWBuf;
+  char* mRWBuf;
   uint32_t mRWBufSize;
   uint32_t mRWBufPos;
   RefPtr mRWHash;
@@ -1124,7 +1124,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
   class FrecencyArray {
     class Iterator {
      public:
-      explicit Iterator(nsTArray *aRecs)
+      explicit Iterator(nsTArray* aRecs)
           : mRecs(aRecs), mIdx(0) {
         while (!Done() && !(*mRecs)[mIdx]) {
           mIdx++;
@@ -1133,7 +1133,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
 
       bool Done() const { return mIdx == mRecs->Length(); }
 
-      CacheIndexRecord *Get() const {
+      CacheIndexRecord* Get() const {
         MOZ_ASSERT(!Done());
         return (*mRecs)[mIdx];
       }
@@ -1147,7 +1147,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
       }
 
      private:
-      nsTArray *mRecs;
+      nsTArray* mRecs;
       uint32_t mIdx;
     };
 
@@ -1157,10 +1157,10 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
     FrecencyArray() : mUnsortedElements(0), mRemovedElements(0) {}
 
     // Methods used by CacheIndexEntryAutoManage to keep the array up to date.
-    void AppendRecord(CacheIndexRecord *aRecord);
-    void RemoveRecord(CacheIndexRecord *aRecord);
-    void ReplaceRecord(CacheIndexRecord *aOldRecord,
-                       CacheIndexRecord *aNewRecord);
+    void AppendRecord(CacheIndexRecord* aRecord);
+    void RemoveRecord(CacheIndexRecord* aRecord);
+    void ReplaceRecord(CacheIndexRecord* aOldRecord,
+                       CacheIndexRecord* aNewRecord);
     void SortIfNeeded();
 
     size_t Length() const { return mRecs.Length() - mRemovedElements; }
@@ -1169,7 +1169,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
    private:
     friend class CacheIndex;
 
-    nsTArray mRecs;
+    nsTArray mRecs;
     uint32_t mUnsortedElements;
     // Instead of removing elements from the array immediately, we null them out
     // and the iterator skips them when accessing the array. The null pointers
@@ -1180,7 +1180,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
 
   FrecencyArray mFrecencyArray;
 
-  nsTArray mIterators;
+  nsTArray mIterators;
 
   // This flag is true iff we are between CacheStorageService:Clear() and
   // processing all contexts to be evicted.  It will make UI to show
@@ -1189,8 +1189,8 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
 
   class DiskConsumptionObserver : public Runnable {
    public:
-    static DiskConsumptionObserver *Init(
-        nsICacheStorageConsumptionObserver *aObserver) {
+    static DiskConsumptionObserver* Init(
+        nsICacheStorageConsumptionObserver* aObserver) {
       nsWeakPtr observer = do_GetWeakReference(aObserver);
       if (!observer) return nullptr;
 
@@ -1203,7 +1203,7 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
     }
 
    private:
-    explicit DiskConsumptionObserver(nsWeakPtr const &aWeakObserver)
+    explicit DiskConsumptionObserver(nsWeakPtr const& aWeakObserver)
         : Runnable("net::CacheIndex::DiskConsumptionObserver"),
           mObserver(aWeakObserver),
           mSize(0) {}
diff --git a/netwerk/cache2/CacheIndexContextIterator.cpp b/netwerk/cache2/CacheIndexContextIterator.cpp
index 87a9b3d0ae7cc..0c53049158f46 100644
--- a/netwerk/cache2/CacheIndexContextIterator.cpp
+++ b/netwerk/cache2/CacheIndexContextIterator.cpp
@@ -10,19 +10,19 @@
 namespace mozilla {
 namespace net {
 
-CacheIndexContextIterator::CacheIndexContextIterator(CacheIndex *aIndex,
+CacheIndexContextIterator::CacheIndexContextIterator(CacheIndex* aIndex,
                                                      bool aAddNew,
-                                                     nsILoadContextInfo *aInfo)
+                                                     nsILoadContextInfo* aInfo)
     : CacheIndexIterator(aIndex, aAddNew), mInfo(aInfo) {}
 
-void CacheIndexContextIterator::AddRecord(CacheIndexRecord *aRecord) {
+void CacheIndexContextIterator::AddRecord(CacheIndexRecord* aRecord) {
   if (CacheIndexEntry::RecordMatchesLoadContextInfo(aRecord, mInfo)) {
     CacheIndexIterator::AddRecord(aRecord);
   }
 }
 
 void CacheIndexContextIterator::AddRecords(
-    const nsTArray &aRecords) {
+    const nsTArray& aRecords) {
   // We need to add one by one so that those with wrong context are ignored.
   for (uint32_t i = 0; i < aRecords.Length(); ++i) {
     AddRecord(aRecords[i]);
diff --git a/netwerk/cache2/CacheIndexContextIterator.h b/netwerk/cache2/CacheIndexContextIterator.h
index 299422dcc43a9..6217783d75961 100644
--- a/netwerk/cache2/CacheIndexContextIterator.h
+++ b/netwerk/cache2/CacheIndexContextIterator.h
@@ -14,13 +14,13 @@ namespace net {
 
 class CacheIndexContextIterator : public CacheIndexIterator {
  public:
-  CacheIndexContextIterator(CacheIndex *aIndex, bool aAddNew,
-                            nsILoadContextInfo *aInfo);
+  CacheIndexContextIterator(CacheIndex* aIndex, bool aAddNew,
+                            nsILoadContextInfo* aInfo);
   virtual ~CacheIndexContextIterator() = default;
 
  private:
-  virtual void AddRecord(CacheIndexRecord *aRecord) override;
-  virtual void AddRecords(const nsTArray &aRecords);
+  virtual void AddRecord(CacheIndexRecord* aRecord) override;
+  virtual void AddRecords(const nsTArray& aRecords);
 
   nsCOMPtr mInfo;
 };
diff --git a/netwerk/cache2/CacheIndexIterator.cpp b/netwerk/cache2/CacheIndexIterator.cpp
index 93cf8f0a76f1f..0c365c1f8282d 100644
--- a/netwerk/cache2/CacheIndexIterator.cpp
+++ b/netwerk/cache2/CacheIndexIterator.cpp
@@ -11,7 +11,7 @@
 namespace mozilla {
 namespace net {
 
-CacheIndexIterator::CacheIndexIterator(CacheIndex *aIndex, bool aAddNew)
+CacheIndexIterator::CacheIndexIterator(CacheIndex* aIndex, bool aAddNew)
     : mStatus(NS_OK), mIndex(aIndex), mAddNew(aAddNew) {
   LOG(("CacheIndexIterator::CacheIndexIterator() [this=%p]", this));
 }
@@ -22,7 +22,7 @@ CacheIndexIterator::~CacheIndexIterator() {
   Close();
 }
 
-nsresult CacheIndexIterator::GetNextHash(SHA1Sum::Hash *aHash) {
+nsresult CacheIndexIterator::GetNextHash(SHA1Sum::Hash* aHash) {
   LOG(("CacheIndexIterator::GetNextHash() [this=%p]", this));
 
   StaticMutexAutoLock lock(CacheIndex::sLock);
@@ -71,21 +71,21 @@ nsresult CacheIndexIterator::CloseInternal(nsresult aStatus) {
   return NS_OK;
 }
 
-void CacheIndexIterator::AddRecord(CacheIndexRecord *aRecord) {
+void CacheIndexIterator::AddRecord(CacheIndexRecord* aRecord) {
   LOG(("CacheIndexIterator::AddRecord() [this=%p, record=%p]", this, aRecord));
 
   mRecords.AppendElement(aRecord);
 }
 
-bool CacheIndexIterator::RemoveRecord(CacheIndexRecord *aRecord) {
+bool CacheIndexIterator::RemoveRecord(CacheIndexRecord* aRecord) {
   LOG(("CacheIndexIterator::RemoveRecord() [this=%p, record=%p]", this,
        aRecord));
 
   return mRecords.RemoveElement(aRecord);
 }
 
-bool CacheIndexIterator::ReplaceRecord(CacheIndexRecord *aOldRecord,
-                                       CacheIndexRecord *aNewRecord) {
+bool CacheIndexIterator::ReplaceRecord(CacheIndexRecord* aOldRecord,
+                                       CacheIndexRecord* aNewRecord) {
   LOG(
       ("CacheIndexIterator::ReplaceRecord() [this=%p, oldRecord=%p, "
        "newRecord=%p]",
diff --git a/netwerk/cache2/CacheIndexIterator.h b/netwerk/cache2/CacheIndexIterator.h
index 05b056c00a4a6..306aa93b5a21f 100644
--- a/netwerk/cache2/CacheIndexIterator.h
+++ b/netwerk/cache2/CacheIndexIterator.h
@@ -20,7 +20,7 @@ class CacheIndexIterator {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CacheIndexIterator)
 
-  CacheIndexIterator(CacheIndex *aIndex, bool aAddNew);
+  CacheIndexIterator(CacheIndex* aIndex, bool aAddNew);
 
  protected:
   virtual ~CacheIndexIterator();
@@ -29,7 +29,7 @@ class CacheIndexIterator {
   // Returns a hash of a next entry. If there is no entry NS_ERROR_NOT_AVAILABLE
   // is returned and the iterator is closed. Other error is returned when the
   // iterator is closed for other reason, e.g. shutdown.
-  nsresult GetNextHash(SHA1Sum::Hash *aHash);
+  nsresult GetNextHash(SHA1Sum::Hash* aHash);
 
   // Closes the iterator. This means the iterator is removed from the list of
   // iterators in CacheIndex.
@@ -41,14 +41,14 @@ class CacheIndexIterator {
   nsresult CloseInternal(nsresult aStatus);
 
   bool ShouldBeNewAdded() { return mAddNew; }
-  virtual void AddRecord(CacheIndexRecord *aRecord);
-  bool RemoveRecord(CacheIndexRecord *aRecord);
-  bool ReplaceRecord(CacheIndexRecord *aOldRecord,
-                     CacheIndexRecord *aNewRecord);
+  virtual void AddRecord(CacheIndexRecord* aRecord);
+  bool RemoveRecord(CacheIndexRecord* aRecord);
+  bool ReplaceRecord(CacheIndexRecord* aOldRecord,
+                     CacheIndexRecord* aNewRecord);
 
   nsresult mStatus;
   RefPtr mIndex;
-  nsTArray mRecords;
+  nsTArray mRecords;
   bool mAddNew;
 };
 
diff --git a/netwerk/cache2/CacheStorage.cpp b/netwerk/cache2/CacheStorage.cpp
index 08d48bcf281bf..d26ceb87eb1b5 100644
--- a/netwerk/cache2/CacheStorage.cpp
+++ b/netwerk/cache2/CacheStorage.cpp
@@ -24,7 +24,7 @@ namespace net {
 
 NS_IMPL_ISUPPORTS(CacheStorage, nsICacheStorage)
 
-CacheStorage::CacheStorage(nsILoadContextInfo *aInfo, bool aAllowDisk,
+CacheStorage::CacheStorage(nsILoadContextInfo* aInfo, bool aAllowDisk,
                            bool aLookupAppCache, bool aSkipSizeCheck,
                            bool aPinning)
     : mLoadContextInfo(GetLoadContextInfo(aInfo)),
@@ -33,10 +33,10 @@ CacheStorage::CacheStorage(nsILoadContextInfo *aInfo, bool aAllowDisk,
       mSkipSizeCheck(aSkipSizeCheck),
       mPinning(aPinning) {}
 
-NS_IMETHODIMP CacheStorage::AsyncOpenURI(nsIURI *aURI,
-                                         const nsACString &aIdExtension,
+NS_IMETHODIMP CacheStorage::AsyncOpenURI(nsIURI* aURI,
+                                         const nsACString& aIdExtension,
                                          uint32_t aFlags,
-                                         nsICacheEntryOpenCallback *aCallback) {
+                                         nsICacheEntryOpenCallback* aCallback) {
   if (!CacheStorageService::Self()) return NS_ERROR_NOT_INITIALIZED;
 
   if (MOZ_UNLIKELY(!CacheObserver::UseDiskCache()) && mWriteToDisk &&
@@ -107,9 +107,9 @@ NS_IMETHODIMP CacheStorage::AsyncOpenURI(nsIURI *aURI,
   return NS_OK;
 }
 
-NS_IMETHODIMP CacheStorage::OpenTruncate(nsIURI *aURI,
-                                         const nsACString &aIdExtension,
-                                         nsICacheEntry **aCacheEntry) {
+NS_IMETHODIMP CacheStorage::OpenTruncate(nsIURI* aURI,
+                                         const nsACString& aIdExtension,
+                                         nsICacheEntry** aCacheEntry) {
   if (!CacheStorageService::Self()) return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv;
@@ -139,8 +139,8 @@ NS_IMETHODIMP CacheStorage::OpenTruncate(nsIURI *aURI,
   return NS_OK;
 }
 
-NS_IMETHODIMP CacheStorage::Exists(nsIURI *aURI, const nsACString &aIdExtension,
-                                   bool *aResult) {
+NS_IMETHODIMP CacheStorage::Exists(nsIURI* aURI, const nsACString& aIdExtension,
+                                   bool* aResult) {
   NS_ENSURE_ARG(aURI);
   NS_ENSURE_ARG(aResult);
 
@@ -161,9 +161,9 @@ NS_IMETHODIMP CacheStorage::Exists(nsIURI *aURI, const nsACString &aIdExtension,
 }
 
 NS_IMETHODIMP
-CacheStorage::GetCacheIndexEntryAttrs(nsIURI *aURI,
-                                      const nsACString &aIdExtension,
-                                      bool *aHasAltData, uint32_t *aSizeInKB) {
+CacheStorage::GetCacheIndexEntryAttrs(nsIURI* aURI,
+                                      const nsACString& aIdExtension,
+                                      bool* aHasAltData, uint32_t* aSizeInKB) {
   NS_ENSURE_ARG(aURI);
   NS_ENSURE_ARG(aHasAltData);
   NS_ENSURE_ARG(aSizeInKB);
@@ -185,9 +185,9 @@ CacheStorage::GetCacheIndexEntryAttrs(nsIURI *aURI,
       this, asciiSpec, aIdExtension, aHasAltData, aSizeInKB);
 }
 
-NS_IMETHODIMP CacheStorage::AsyncDoomURI(nsIURI *aURI,
-                                         const nsACString &aIdExtension,
-                                         nsICacheEntryDoomCallback *aCallback) {
+NS_IMETHODIMP CacheStorage::AsyncDoomURI(nsIURI* aURI,
+                                         const nsACString& aIdExtension,
+                                         nsICacheEntryDoomCallback* aCallback) {
   if (!CacheStorageService::Self()) return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv;
@@ -208,7 +208,7 @@ NS_IMETHODIMP CacheStorage::AsyncDoomURI(nsIURI *aURI,
 }
 
 NS_IMETHODIMP CacheStorage::AsyncEvictStorage(
-    nsICacheEntryDoomCallback *aCallback) {
+    nsICacheEntryDoomCallback* aCallback) {
   if (!CacheStorageService::Self()) return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv =
@@ -218,7 +218,7 @@ NS_IMETHODIMP CacheStorage::AsyncEvictStorage(
   return NS_OK;
 }
 
-NS_IMETHODIMP CacheStorage::AsyncVisitStorage(nsICacheStorageVisitor *aVisitor,
+NS_IMETHODIMP CacheStorage::AsyncVisitStorage(nsICacheStorageVisitor* aVisitor,
                                               bool aVisitEntries) {
   LOG(("CacheStorage::AsyncVisitStorage [this=%p, cb=%p, disk=%d]", this,
        aVisitor, (bool)mWriteToDisk));
@@ -233,8 +233,8 @@ NS_IMETHODIMP CacheStorage::AsyncVisitStorage(nsICacheStorageVisitor *aVisitor,
 
 // Internal
 
-nsresult CacheStorage::ChooseApplicationCache(nsIURI *aURI,
-                                              nsIApplicationCache **aCache) {
+nsresult CacheStorage::ChooseApplicationCache(nsIURI* aURI,
+                                              nsIApplicationCache** aCache) {
   nsresult rv;
 
   nsCOMPtr appCacheService =
diff --git a/netwerk/cache2/OldWrappers.cpp b/netwerk/cache2/OldWrappers.cpp
index 506d7f4a2d034..6f05bc0700e5f 100644
--- a/netwerk/cache2/OldWrappers.cpp
+++ b/netwerk/cache2/OldWrappers.cpp
@@ -39,7 +39,7 @@ namespace {
 
 class DoomCallbackSynchronizer : public Runnable {
  public:
-  explicit DoomCallbackSynchronizer(nsICacheEntryDoomCallback *cb)
+  explicit DoomCallbackSynchronizer(nsICacheEntryDoomCallback* cb)
       : Runnable("net::DoomCallbackSynchronizer"), mCB(cb) {}
   nsresult Dispatch();
 
@@ -82,7 +82,7 @@ class DoomCallbackWrapper : public nsICacheListener {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICACHELISTENER
 
-  explicit DoomCallbackWrapper(nsICacheEntryDoomCallback *cb) : mCB(cb) {}
+  explicit DoomCallbackWrapper(nsICacheEntryDoomCallback* cb) : mCB(cb) {}
 
  private:
   virtual ~DoomCallbackWrapper() = default;
@@ -93,7 +93,7 @@ class DoomCallbackWrapper : public nsICacheListener {
 NS_IMPL_ISUPPORTS(DoomCallbackWrapper, nsICacheListener);
 
 NS_IMETHODIMP DoomCallbackWrapper::OnCacheEntryAvailable(
-    nsICacheEntryDescriptor *descriptor, nsCacheAccessMode accessGranted,
+    nsICacheEntryDescriptor* descriptor, nsCacheAccessMode accessGranted,
     nsresult status) {
   return NS_OK;
 }
@@ -126,7 +126,7 @@ _OldVisitCallbackWrapper::~_OldVisitCallbackWrapper() {
 }
 
 NS_IMETHODIMP _OldVisitCallbackWrapper::VisitDevice(
-    const char *deviceID, nsICacheDeviceInfo *deviceInfo, bool *_retval) {
+    const char* deviceID, nsICacheDeviceInfo* deviceInfo, bool* _retval) {
   if (!mCB) return NS_ERROR_NULL_POINTER;
 
   *_retval = false;
@@ -174,9 +174,9 @@ NS_IMETHODIMP _OldVisitCallbackWrapper::VisitDevice(
   return NS_OK;
 }
 
-NS_IMETHODIMP _OldVisitCallbackWrapper::VisitEntry(const char *deviceID,
-                                                   nsICacheEntryInfo *entryInfo,
-                                                   bool *_retval) {
+NS_IMETHODIMP _OldVisitCallbackWrapper::VisitEntry(const char* deviceID,
+                                                   nsICacheEntryInfo* entryInfo,
+                                                   bool* _retval) {
   MOZ_ASSERT(!strcmp(deviceID, mDeviceID));
 
   nsresult rv;
@@ -245,7 +245,7 @@ NS_IMETHODIMP _OldVisitCallbackWrapper::VisitEntry(const char *deviceID,
 
 // static
 nsresult _OldGetDiskConsumption::Get(
-    nsICacheStorageConsumptionObserver *aCallback) {
+    nsICacheStorageConsumptionObserver* aCallback) {
   nsresult rv;
 
   nsCOMPtr serv =
@@ -270,7 +270,7 @@ nsresult _OldGetDiskConsumption::Get(
 NS_IMPL_ISUPPORTS_INHERITED(_OldGetDiskConsumption, Runnable, nsICacheVisitor)
 
 _OldGetDiskConsumption::_OldGetDiskConsumption(
-    nsICacheStorageConsumptionObserver *aCallback)
+    nsICacheStorageConsumptionObserver* aCallback)
     : Runnable("net::_OldGetDiskConsumption"), mCallback(aCallback), mSize(0) {}
 
 NS_IMETHODIMP
@@ -280,9 +280,9 @@ _OldGetDiskConsumption::Run() {
 }
 
 NS_IMETHODIMP
-_OldGetDiskConsumption::VisitDevice(const char *deviceID,
-                                    nsICacheDeviceInfo *deviceInfo,
-                                    bool *_retval) {
+_OldGetDiskConsumption::VisitDevice(const char* deviceID,
+                                    nsICacheDeviceInfo* deviceInfo,
+                                    bool* _retval) {
   if (!strcmp(deviceID, "disk")) {
     uint32_t size;
     nsresult rv = deviceInfo->GetTotalSize(&size);
@@ -294,21 +294,21 @@ _OldGetDiskConsumption::VisitDevice(const char *deviceID,
 }
 
 NS_IMETHODIMP
-_OldGetDiskConsumption::VisitEntry(const char *deviceID,
-                                   nsICacheEntryInfo *entryInfo,
-                                   bool *_retval) {
+_OldGetDiskConsumption::VisitEntry(const char* deviceID,
+                                   nsICacheEntryInfo* entryInfo,
+                                   bool* _retval) {
   MOZ_CRASH("Unexpected");
   return NS_OK;
 }
 
 // _OldCacheEntryWrapper
 
-_OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryDescriptor *desc)
+_OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryDescriptor* desc)
     : mOldDesc(desc), mOldInfo(desc), mCacheEntryId(CacheEntry::GetNextId()) {
   LOG(("Creating _OldCacheEntryWrapper %p for descriptor %p", this, desc));
 }
 
-_OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryInfo *info)
+_OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryInfo* info)
     : mOldDesc(nullptr),
       mOldInfo(info),
       mCacheEntryId(CacheEntry::GetNextId()) {
@@ -320,7 +320,7 @@ _OldCacheEntryWrapper::~_OldCacheEntryWrapper() {
        mOldInfo.get()));
 }
 
-NS_IMETHODIMP _OldCacheEntryWrapper::GetIsForcedValid(bool *aIsForcedValid) {
+NS_IMETHODIMP _OldCacheEntryWrapper::GetIsForcedValid(bool* aIsForcedValid) {
   // Unused stub
   return NS_ERROR_NOT_IMPLEMENTED;
 }
@@ -334,13 +334,13 @@ NS_IMETHODIMP _OldCacheEntryWrapper::ForceValidFor(
 NS_IMPL_ISUPPORTS(_OldCacheEntryWrapper, nsICacheEntry)
 
 NS_IMETHODIMP _OldCacheEntryWrapper::AsyncDoom(
-    nsICacheEntryDoomCallback *listener) {
+    nsICacheEntryDoomCallback* listener) {
   RefPtr cb =
       listener ? new DoomCallbackWrapper(listener) : nullptr;
   return AsyncDoom(cb);
 }
 
-NS_IMETHODIMP _OldCacheEntryWrapper::GetDataSize(int64_t *aSize) {
+NS_IMETHODIMP _OldCacheEntryWrapper::GetDataSize(int64_t* aSize) {
   uint32_t size;
   nsresult rv = GetDataSize(&size);
   if (NS_FAILED(rv)) return rv;
@@ -349,15 +349,15 @@ NS_IMETHODIMP _OldCacheEntryWrapper::GetDataSize(int64_t *aSize) {
   return NS_OK;
 }
 
-NS_IMETHODIMP _OldCacheEntryWrapper::GetAltDataSize(int64_t *aSize) {
+NS_IMETHODIMP _OldCacheEntryWrapper::GetAltDataSize(int64_t* aSize) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP _OldCacheEntryWrapper::GetAltDataType(nsACString &aType) {
+NS_IMETHODIMP _OldCacheEntryWrapper::GetAltDataType(nsACString& aType) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP _OldCacheEntryWrapper::GetPersistent(bool *aPersistToDisk) {
+NS_IMETHODIMP _OldCacheEntryWrapper::GetPersistent(bool* aPersistToDisk) {
   if (!mOldDesc) {
     return NS_ERROR_NULL_POINTER;
   }
@@ -374,7 +374,7 @@ NS_IMETHODIMP _OldCacheEntryWrapper::GetPersistent(bool *aPersistToDisk) {
 }
 
 NS_IMETHODIMP _OldCacheEntryWrapper::Recreate(bool aMemoryOnly,
-                                              nsICacheEntry **aResult) {
+                                              nsICacheEntry** aResult) {
   NS_ENSURE_TRUE(mOldDesc, NS_ERROR_NOT_AVAILABLE);
 
   nsCacheAccessMode mode;
@@ -393,13 +393,13 @@ NS_IMETHODIMP _OldCacheEntryWrapper::Recreate(bool aMemoryOnly,
 }
 
 NS_IMETHODIMP _OldCacheEntryWrapper::OpenInputStream(int64_t offset,
-                                                     nsIInputStream **_retval) {
+                                                     nsIInputStream** _retval) {
   if (offset > PR_UINT32_MAX) return NS_ERROR_INVALID_ARG;
 
   return OpenInputStream(uint32_t(offset), _retval);
 }
 NS_IMETHODIMP _OldCacheEntryWrapper::OpenOutputStream(
-    int64_t offset, int64_t predictedSize, nsIOutputStream **_retval) {
+    int64_t offset, int64_t predictedSize, nsIOutputStream** _retval) {
   if (offset > PR_UINT32_MAX) return NS_ERROR_INVALID_ARG;
 
   return OpenOutputStream(uint32_t(offset), _retval);
@@ -425,7 +425,7 @@ NS_IMETHODIMP _OldCacheEntryWrapper::MaybeMarkValid() {
 }
 
 NS_IMETHODIMP _OldCacheEntryWrapper::HasWriteAccess(bool aWriteAllowed_unused,
-                                                    bool *aWriteAccess) {
+                                                    bool* aWriteAccess) {
   NS_ENSURE_TRUE(mOldDesc, NS_ERROR_NULL_POINTER);
   NS_ENSURE_ARG(aWriteAccess);
 
@@ -448,15 +448,15 @@ class MetaDataVisitorWrapper : public nsICacheMetaDataVisitor {
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSICACHEMETADATAVISITOR
-  explicit MetaDataVisitorWrapper(nsICacheEntryMetaDataVisitor *cb) : mCB(cb) {}
+  explicit MetaDataVisitorWrapper(nsICacheEntryMetaDataVisitor* cb) : mCB(cb) {}
   nsCOMPtr mCB;
 };
 
 NS_IMPL_ISUPPORTS(MetaDataVisitorWrapper, nsICacheMetaDataVisitor)
 
 NS_IMETHODIMP
-MetaDataVisitorWrapper::VisitMetaDataElement(char const *key, char const *value,
-                                             bool *goon) {
+MetaDataVisitorWrapper::VisitMetaDataElement(char const* key, char const* value,
+                                             bool* goon) {
   *goon = true;
   return mCB->OnMetaDataElement(key, value);
 }
@@ -464,7 +464,7 @@ MetaDataVisitorWrapper::VisitMetaDataElement(char const *key, char const *value,
 }  // namespace
 
 NS_IMETHODIMP _OldCacheEntryWrapper::VisitMetaData(
-    nsICacheEntryMetaDataVisitor *cb) {
+    nsICacheEntryMetaDataVisitor* cb) {
   RefPtr w = new MetaDataVisitorWrapper(cb);
   return mOldDesc->VisitMetaData(w);
 }
@@ -472,9 +472,9 @@ NS_IMETHODIMP _OldCacheEntryWrapper::VisitMetaData(
 namespace {
 
 nsresult GetCacheSessionNameForStoragePolicy(
-    const nsACString &scheme, nsCacheStoragePolicy storagePolicy,
-    bool isPrivate, OriginAttributes const *originAttribs,
-    nsACString &sessionName) {
+    const nsACString& scheme, nsCacheStoragePolicy storagePolicy,
+    bool isPrivate, OriginAttributes const* originAttribs,
+    nsACString& sessionName) {
   MOZ_ASSERT(!isPrivate || storagePolicy == nsICache::STORE_IN_MEMORY);
 
   // HTTP
@@ -523,10 +523,10 @@ nsresult GetCacheSessionNameForStoragePolicy(
   return NS_OK;
 }
 
-nsresult GetCacheSession(const nsACString &aScheme, bool aWriteToDisk,
-                         nsILoadContextInfo *aLoadInfo,
-                         nsIApplicationCache *aAppCache,
-                         nsICacheSession **_result) {
+nsresult GetCacheSession(const nsACString& aScheme, bool aWriteToDisk,
+                         nsILoadContextInfo* aLoadInfo,
+                         nsIApplicationCache* aAppCache,
+                         nsICacheSession** _result) {
   nsresult rv;
 
   nsCacheStoragePolicy storagePolicy;
@@ -581,11 +581,11 @@ nsresult GetCacheSession(const nsACString &aScheme, bool aWriteToDisk,
 
 NS_IMPL_ISUPPORTS_INHERITED(_OldCacheLoad, Runnable, nsICacheListener)
 
-_OldCacheLoad::_OldCacheLoad(const nsACString &aScheme,
-                             const nsACString &aCacheKey,
-                             nsICacheEntryOpenCallback *aCallback,
-                             nsIApplicationCache *aAppCache,
-                             nsILoadContextInfo *aLoadInfo, bool aWriteToDisk,
+_OldCacheLoad::_OldCacheLoad(const nsACString& aScheme,
+                             const nsACString& aCacheKey,
+                             nsICacheEntryOpenCallback* aCallback,
+                             nsIApplicationCache* aAppCache,
+                             nsILoadContextInfo* aLoadInfo, bool aWriteToDisk,
                              uint32_t aFlags)
     : Runnable("net::_OldCacheLoad"),
       mScheme(aScheme),
@@ -744,7 +744,7 @@ _OldCacheLoad::Run() {
 }
 
 NS_IMETHODIMP
-_OldCacheLoad::OnCacheEntryAvailable(nsICacheEntryDescriptor *entry,
+_OldCacheLoad::OnCacheEntryAvailable(nsICacheEntryDescriptor* entry,
                                      nsCacheAccessMode access,
                                      nsresult status) {
   LOG(
@@ -800,9 +800,9 @@ _OldCacheLoad::OnCacheEntryDoomed(nsresult) { return NS_ERROR_NOT_IMPLEMENTED; }
 
 NS_IMPL_ISUPPORTS(_OldStorage, nsICacheStorage)
 
-_OldStorage::_OldStorage(nsILoadContextInfo *aInfo, bool aAllowDisk,
+_OldStorage::_OldStorage(nsILoadContextInfo* aInfo, bool aAllowDisk,
                          bool aLookupAppCache, bool aOfflineStorage,
-                         nsIApplicationCache *aAppCache)
+                         nsIApplicationCache* aAppCache)
     : mLoadInfo(GetLoadContextInfo(aInfo)),
       mAppCache(aAppCache),
       mWriteToDisk(aAllowDisk),
@@ -811,10 +811,10 @@ _OldStorage::_OldStorage(nsILoadContextInfo *aInfo, bool aAllowDisk,
 
 _OldStorage::~_OldStorage() = default;
 
-NS_IMETHODIMP _OldStorage::AsyncOpenURI(nsIURI *aURI,
-                                        const nsACString &aIdExtension,
+NS_IMETHODIMP _OldStorage::AsyncOpenURI(nsIURI* aURI,
+                                        const nsACString& aIdExtension,
                                         uint32_t aFlags,
-                                        nsICacheEntryOpenCallback *aCallback) {
+                                        nsICacheEntryOpenCallback* aCallback) {
   NS_ENSURE_ARG(aURI);
   NS_ENSURE_ARG(aCallback);
 
@@ -850,20 +850,20 @@ NS_IMETHODIMP _OldStorage::AsyncOpenURI(nsIURI *aURI,
   return NS_OK;
 }
 
-NS_IMETHODIMP _OldStorage::OpenTruncate(nsIURI *aURI,
-                                        const nsACString &aIdExtension,
-                                        nsICacheEntry **aCacheEntry) {
+NS_IMETHODIMP _OldStorage::OpenTruncate(nsIURI* aURI,
+                                        const nsACString& aIdExtension,
+                                        nsICacheEntry** aCacheEntry) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP _OldStorage::Exists(nsIURI *aURI, const nsACString &aIdExtension,
-                                  bool *aResult) {
+NS_IMETHODIMP _OldStorage::Exists(nsIURI* aURI, const nsACString& aIdExtension,
+                                  bool* aResult) {
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-NS_IMETHODIMP _OldStorage::AsyncDoomURI(nsIURI *aURI,
-                                        const nsACString &aIdExtension,
-                                        nsICacheEntryDoomCallback *aCallback) {
+NS_IMETHODIMP _OldStorage::AsyncDoomURI(nsIURI* aURI,
+                                        const nsACString& aIdExtension,
+                                        nsICacheEntryDoomCallback* aCallback) {
   LOG(("_OldStorage::AsyncDoomURI"));
 
   nsresult rv;
@@ -886,7 +886,7 @@ NS_IMETHODIMP _OldStorage::AsyncDoomURI(nsIURI *aURI,
 }
 
 NS_IMETHODIMP _OldStorage::AsyncEvictStorage(
-    nsICacheEntryDoomCallback *aCallback) {
+    nsICacheEntryDoomCallback* aCallback) {
   LOG(("_OldStorage::AsyncEvictStorage"));
 
   nsresult rv;
@@ -935,7 +935,7 @@ NS_IMETHODIMP _OldStorage::AsyncEvictStorage(
   return NS_OK;
 }
 
-NS_IMETHODIMP _OldStorage::AsyncVisitStorage(nsICacheStorageVisitor *aVisitor,
+NS_IMETHODIMP _OldStorage::AsyncVisitStorage(nsICacheStorageVisitor* aVisitor,
                                              bool aVisitEntries) {
   LOG(("_OldStorage::AsyncVisitStorage"));
 
@@ -947,13 +947,13 @@ NS_IMETHODIMP _OldStorage::AsyncVisitStorage(nsICacheStorageVisitor *aVisitor,
       do_GetService(NS_CACHESERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  char *deviceID;
+  char* deviceID;
   if (mAppCache || mOfflineStorage) {
-    deviceID = const_cast("offline");
+    deviceID = const_cast("offline");
   } else if (!mWriteToDisk || mLoadInfo->IsPrivate()) {
-    deviceID = const_cast("memory");
+    deviceID = const_cast("memory");
   } else {
-    deviceID = const_cast("disk");
+    deviceID = const_cast("disk");
   }
 
   RefPtr<_OldVisitCallbackWrapper> cb = new _OldVisitCallbackWrapper(
@@ -965,17 +965,17 @@ NS_IMETHODIMP _OldStorage::AsyncVisitStorage(nsICacheStorageVisitor *aVisitor,
 }
 
 NS_IMETHODIMP _OldStorage::GetCacheIndexEntryAttrs(
-    nsIURI *aURI, const nsACString &aIdExtension, bool *aHasAltData,
-    uint32_t *aSizeInKB) {
+    nsIURI* aURI, const nsACString& aIdExtension, bool* aHasAltData,
+    uint32_t* aSizeInKB) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 // Internal
 
-nsresult _OldStorage::AssembleCacheKey(nsIURI *aURI,
-                                       nsACString const &aIdExtension,
-                                       nsACString &aCacheKey,
-                                       nsACString &aScheme) {
+nsresult _OldStorage::AssembleCacheKey(nsIURI* aURI,
+                                       nsACString const& aIdExtension,
+                                       nsACString& aCacheKey,
+                                       nsACString& aScheme) {
   // Copied from nsHttpChannel::AssembleCacheKey
 
   aCacheKey.Truncate();
@@ -1015,8 +1015,8 @@ nsresult _OldStorage::AssembleCacheKey(nsIURI *aURI,
   return NS_OK;
 }
 
-nsresult _OldStorage::ChooseApplicationCache(const nsACString &cacheKey,
-                                             nsIApplicationCache **aCache) {
+nsresult _OldStorage::ChooseApplicationCache(const nsACString& cacheKey,
+                                             nsIApplicationCache** aCache) {
   nsresult rv;
 
   nsCOMPtr appCacheService =
diff --git a/netwerk/cache2/OldWrappers.h b/netwerk/cache2/OldWrappers.h
index b46e3a43d4e8a..f0dee60fe5b64 100644
--- a/netwerk/cache2/OldWrappers.h
+++ b/netwerk/cache2/OldWrappers.h
@@ -34,37 +34,37 @@ class _OldCacheEntryWrapper : public nsICacheEntry {
     return !mOldDesc ? NS_ERROR_NULL_POINTER
                      : mOldDesc->SetExpirationTime(expirationTime);
   }
-  nsresult OpenInputStream(uint32_t offset, nsIInputStream **_retval) {
+  nsresult OpenInputStream(uint32_t offset, nsIInputStream** _retval) {
     return !mOldDesc ? NS_ERROR_NULL_POINTER
                      : mOldDesc->OpenInputStream(offset, _retval);
   }
-  nsresult OpenOutputStream(uint32_t offset, nsIOutputStream **_retval) {
+  nsresult OpenOutputStream(uint32_t offset, nsIOutputStream** _retval) {
     return !mOldDesc ? NS_ERROR_NULL_POINTER
                      : mOldDesc->OpenOutputStream(offset, _retval);
   }
   NS_IMETHOD OpenAlternativeOutputStream(
-      const nsACString &type, int64_t predictedSize,
-      nsIAsyncOutputStream **_retval) override {
+      const nsACString& type, int64_t predictedSize,
+      nsIAsyncOutputStream** _retval) override {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
-  NS_IMETHOD OpenAlternativeInputStream(const nsACString &type,
-                                        nsIInputStream **_retval) override {
+  NS_IMETHOD OpenAlternativeInputStream(const nsACString& type,
+                                        nsIInputStream** _retval) override {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
-  NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo) override {
+  NS_IMETHOD GetSecurityInfo(nsISupports** aSecurityInfo) override {
     return !mOldDesc ? NS_ERROR_NULL_POINTER
                      : mOldDesc->GetSecurityInfo(aSecurityInfo);
   }
-  NS_IMETHOD SetSecurityInfo(nsISupports *aSecurityInfo) override {
+  NS_IMETHOD SetSecurityInfo(nsISupports* aSecurityInfo) override {
     return !mOldDesc ? NS_ERROR_NULL_POINTER
                      : mOldDesc->SetSecurityInfo(aSecurityInfo);
   }
-  NS_IMETHOD GetStorageDataSize(uint32_t *aStorageDataSize) override {
+  NS_IMETHOD GetStorageDataSize(uint32_t* aStorageDataSize) override {
     return !mOldDesc ? NS_ERROR_NULL_POINTER
                      : mOldDesc->GetStorageDataSize(aStorageDataSize);
   }
-  nsresult AsyncDoom(nsICacheListener *listener) {
+  nsresult AsyncDoom(nsICacheListener* listener) {
     return !mOldDesc ? NS_ERROR_NULL_POINTER : mOldDesc->AsyncDoom(listener);
   }
   NS_IMETHOD MarkValid(void) override {
@@ -73,46 +73,46 @@ class _OldCacheEntryWrapper : public nsICacheEntry {
   NS_IMETHOD Close(void) override {
     return !mOldDesc ? NS_ERROR_NULL_POINTER : mOldDesc->Close();
   }
-  NS_IMETHOD GetMetaDataElement(const char *key, char **_retval) override {
+  NS_IMETHOD GetMetaDataElement(const char* key, char** _retval) override {
     return !mOldDesc ? NS_ERROR_NULL_POINTER
                      : mOldDesc->GetMetaDataElement(key, _retval);
   }
-  NS_IMETHOD SetMetaDataElement(const char *key, const char *value) override {
+  NS_IMETHOD SetMetaDataElement(const char* key, const char* value) override {
     return !mOldDesc ? NS_ERROR_NULL_POINTER
                      : mOldDesc->SetMetaDataElement(key, value);
   }
 
-  NS_IMETHOD GetDiskStorageSizeInKB(uint32_t *aDiskStorageSize) override {
+  NS_IMETHOD GetDiskStorageSizeInKB(uint32_t* aDiskStorageSize) override {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // nsICacheEntryInfo
-  NS_IMETHOD GetKey(nsACString &aKey) override {
+  NS_IMETHOD GetKey(nsACString& aKey) override {
     return mOldInfo->GetKey(aKey);
   }
-  NS_IMETHOD GetCacheEntryId(uint64_t *aCacheEntryId) override {
+  NS_IMETHOD GetCacheEntryId(uint64_t* aCacheEntryId) override {
     *aCacheEntryId = mCacheEntryId;
     return NS_OK;
   }
-  NS_IMETHOD GetFetchCount(int32_t *aFetchCount) override {
+  NS_IMETHOD GetFetchCount(int32_t* aFetchCount) override {
     return mOldInfo->GetFetchCount(aFetchCount);
   }
-  NS_IMETHOD GetLastFetched(uint32_t *aLastFetched) override {
+  NS_IMETHOD GetLastFetched(uint32_t* aLastFetched) override {
     return mOldInfo->GetLastFetched(aLastFetched);
   }
-  NS_IMETHOD GetLastModified(uint32_t *aLastModified) override {
+  NS_IMETHOD GetLastModified(uint32_t* aLastModified) override {
     return mOldInfo->GetLastModified(aLastModified);
   }
-  NS_IMETHOD GetExpirationTime(uint32_t *aExpirationTime) override {
+  NS_IMETHOD GetExpirationTime(uint32_t* aExpirationTime) override {
     return mOldInfo->GetExpirationTime(aExpirationTime);
   }
-  nsresult GetDataSize(uint32_t *aDataSize) {
+  nsresult GetDataSize(uint32_t* aDataSize) {
     return mOldInfo->GetDataSize(aDataSize);
   }
-  NS_IMETHOD GetOnStartTime(uint64_t *aTime) override {
+  NS_IMETHOD GetOnStartTime(uint64_t* aTime) override {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
-  NS_IMETHOD GetOnStopTime(uint64_t *aTime) override {
+  NS_IMETHOD GetOnStopTime(uint64_t* aTime) override {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   NS_IMETHOD SetNetworkTimes(uint64_t aOnStartTime,
@@ -125,36 +125,36 @@ class _OldCacheEntryWrapper : public nsICacheEntry {
   NS_IMETHOD AddBaseDomainAccess(uint32_t aSiteID) override {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
-  NS_IMETHOD GetLoadContextInfo(nsILoadContextInfo **aInfo) override {
+  NS_IMETHOD GetLoadContextInfo(nsILoadContextInfo** aInfo) override {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   NS_IMETHOD Dismiss() override { return NS_ERROR_NOT_IMPLEMENTED; }
 
-  NS_IMETHOD AsyncDoom(nsICacheEntryDoomCallback *listener) override;
-  NS_IMETHOD GetPersistent(bool *aPersistToDisk) override;
-  NS_IMETHOD GetIsForcedValid(bool *aIsForcedValid) override;
+  NS_IMETHOD AsyncDoom(nsICacheEntryDoomCallback* listener) override;
+  NS_IMETHOD GetPersistent(bool* aPersistToDisk) override;
+  NS_IMETHOD GetIsForcedValid(bool* aIsForcedValid) override;
   NS_IMETHOD ForceValidFor(uint32_t aSecondsToTheFuture) override;
   NS_IMETHOD SetValid() override { return NS_OK; }
   NS_IMETHOD MetaDataReady() override { return NS_OK; }
-  NS_IMETHOD Recreate(bool, nsICacheEntry **) override;
-  NS_IMETHOD GetDataSize(int64_t *size) override;
-  NS_IMETHOD GetAltDataSize(int64_t *size) override;
-  NS_IMETHOD GetAltDataType(nsACString &aType) override;
-  NS_IMETHOD OpenInputStream(int64_t offset, nsIInputStream **_retval) override;
+  NS_IMETHOD Recreate(bool, nsICacheEntry**) override;
+  NS_IMETHOD GetDataSize(int64_t* size) override;
+  NS_IMETHOD GetAltDataSize(int64_t* size) override;
+  NS_IMETHOD GetAltDataType(nsACString& aType) override;
+  NS_IMETHOD OpenInputStream(int64_t offset, nsIInputStream** _retval) override;
   NS_IMETHOD OpenOutputStream(int64_t offset, int64_t predictedSize,
-                              nsIOutputStream **_retval) override;
+                              nsIOutputStream** _retval) override;
   NS_IMETHOD MaybeMarkValid() override;
-  NS_IMETHOD HasWriteAccess(bool aWriteOnly, bool *aWriteAccess) override;
-  NS_IMETHOD VisitMetaData(nsICacheEntryMetaDataVisitor *) override;
+  NS_IMETHOD HasWriteAccess(bool aWriteOnly, bool* aWriteAccess) override;
+  NS_IMETHOD VisitMetaData(nsICacheEntryMetaDataVisitor*) override;
 
-  explicit _OldCacheEntryWrapper(nsICacheEntryDescriptor *desc);
-  explicit _OldCacheEntryWrapper(nsICacheEntryInfo *info);
+  explicit _OldCacheEntryWrapper(nsICacheEntryDescriptor* desc);
+  explicit _OldCacheEntryWrapper(nsICacheEntryInfo* info);
 
  private:
   virtual ~_OldCacheEntryWrapper();
 
   _OldCacheEntryWrapper() = delete;
-  nsICacheEntryDescriptor *mOldDesc;  // ref holded in mOldInfo
+  nsICacheEntryDescriptor* mOldDesc;  // ref holded in mOldInfo
   nsCOMPtr mOldInfo;
 
   const uint64_t mCacheEntryId;
@@ -166,9 +166,9 @@ class _OldCacheLoad : public Runnable, public nsICacheListener {
   NS_DECL_NSIRUNNABLE
   NS_DECL_NSICACHELISTENER
 
-  _OldCacheLoad(const nsACString &aScheme, const nsACString &aCacheKey,
-                nsICacheEntryOpenCallback *aCallback,
-                nsIApplicationCache *aAppCache, nsILoadContextInfo *aLoadInfo,
+  _OldCacheLoad(const nsACString& aScheme, const nsACString& aCacheKey,
+                nsICacheEntryOpenCallback* aCallback,
+                nsIApplicationCache* aAppCache, nsILoadContextInfo* aLoadInfo,
                 bool aWriteToDisk, uint32_t aFlags);
 
   nsresult Start();
@@ -205,15 +205,15 @@ class _OldStorage : public nsICacheStorage {
   NS_DECL_NSICACHESTORAGE
 
  public:
-  _OldStorage(nsILoadContextInfo *aInfo, bool aAllowDisk, bool aLookupAppCache,
-              bool aOfflineStorage, nsIApplicationCache *aAppCache);
+  _OldStorage(nsILoadContextInfo* aInfo, bool aAllowDisk, bool aLookupAppCache,
+              bool aOfflineStorage, nsIApplicationCache* aAppCache);
 
  private:
   virtual ~_OldStorage();
-  nsresult AssembleCacheKey(nsIURI *aURI, nsACString const &aIdExtension,
-                            nsACString &aCacheKey, nsACString &aScheme);
-  nsresult ChooseApplicationCache(const nsACString &cacheKey,
-                                  nsIApplicationCache **aCache);
+  nsresult AssembleCacheKey(nsIURI* aURI, nsACString const& aIdExtension,
+                            nsACString& aCacheKey, nsACString& aScheme);
+  nsresult ChooseApplicationCache(const nsACString& cacheKey,
+                                  nsIApplicationCache** aCache);
 
   nsCOMPtr mLoadInfo;
   nsCOMPtr mAppCache;
@@ -226,8 +226,8 @@ class _OldVisitCallbackWrapper : public nsICacheVisitor {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICACHEVISITOR
 
-  _OldVisitCallbackWrapper(char const *deviceID, nsICacheStorageVisitor *cb,
-                           bool visitEntries, nsILoadContextInfo *aInfo)
+  _OldVisitCallbackWrapper(char const* deviceID, nsICacheStorageVisitor* cb,
+                           bool visitEntries, nsILoadContextInfo* aInfo)
       : mCB(cb),
         mVisitEntries(visitEntries),
         mDeviceID(deviceID),
@@ -238,18 +238,18 @@ class _OldVisitCallbackWrapper : public nsICacheVisitor {
   virtual ~_OldVisitCallbackWrapper();
   nsCOMPtr mCB;
   bool mVisitEntries;
-  char const *mDeviceID;
+  char const* mDeviceID;
   nsCOMPtr mLoadInfo;
   bool mHit;  // set to true when the device was found
 };
 
 class _OldGetDiskConsumption : public Runnable, public nsICacheVisitor {
  public:
-  static nsresult Get(nsICacheStorageConsumptionObserver *aCallback);
+  static nsresult Get(nsICacheStorageConsumptionObserver* aCallback);
 
  private:
   explicit _OldGetDiskConsumption(
-      nsICacheStorageConsumptionObserver *aCallback);
+      nsICacheStorageConsumptionObserver* aCallback);
   virtual ~_OldGetDiskConsumption() = default;
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSICACHEVISITOR
diff --git a/netwerk/cookie/CookieServiceChild.cpp b/netwerk/cookie/CookieServiceChild.cpp
index 39d48f6308291..28914b807ebba 100644
--- a/netwerk/cookie/CookieServiceChild.cpp
+++ b/netwerk/cookie/CookieServiceChild.cpp
@@ -65,8 +65,8 @@ CookieServiceChild::CookieServiceChild()
       mIPCOpen(false) {
   NS_ASSERTION(IsNeckoChild(), "not a child process");
 
-  mozilla::dom::ContentChild *cc =
-      static_cast(gNeckoChild->Manager());
+  mozilla::dom::ContentChild* cc =
+      static_cast(gNeckoChild->Manager());
   if (cc->IsShuttingDown()) {
     return;
   }
@@ -107,10 +107,10 @@ CookieServiceChild::CookieServiceChild()
 void CookieServiceChild::MoveCookies() {
   TimeStamp start = TimeStamp::Now();
   for (auto iter = mCookiesMap.Iter(); !iter.Done(); iter.Next()) {
-    CookiesList *cookiesList = iter.UserData();
+    CookiesList* cookiesList = iter.UserData();
     CookiesList newCookiesList;
     for (uint32_t i = 0; i < cookiesList->Length(); ++i) {
-      nsCookie *cookie = cookiesList->ElementAt(i);
+      nsCookie* cookie = cookiesList->ElementAt(i);
       RefPtr newCookie = nsCookie::Create(
           cookie->Name(), cookie->Value(), cookie->Host(), cookie->Path(),
           cookie->Expiry(), cookie->LastAccessed(), cookie->CreationTime(),
@@ -125,7 +125,7 @@ void CookieServiceChild::MoveCookies() {
 }
 
 NS_IMETHODIMP
-CookieServiceChild::Notify(nsITimer *aTimer) {
+CookieServiceChild::Notify(nsITimer* aTimer) {
   if (aTimer == mCookieTimer) {
     MoveCookies();
   } else {
@@ -140,7 +140,7 @@ void CookieServiceChild::ActorDestroy(ActorDestroyReason why) {
   mIPCOpen = false;
 }
 
-void CookieServiceChild::TrackCookieLoad(nsIChannel *aChannel) {
+void CookieServiceChild::TrackCookieLoad(nsIChannel* aChannel) {
   if (!mIPCOpen) {
     return;
   }
@@ -192,12 +192,12 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveAll() {
 }
 
 mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveCookie(
-    const CookieStruct &aCookie, const OriginAttributes &aAttrs) {
+    const CookieStruct& aCookie, const OriginAttributes& aAttrs) {
   nsCString baseDomain;
   nsCookieService::GetBaseDomainFromHost(mTLDService, aCookie.host(),
                                          baseDomain);
   nsCookieKey key(baseDomain, aAttrs);
-  CookiesList *cookiesList = nullptr;
+  CookiesList* cookiesList = nullptr;
   mCookiesMap.Get(key, &cookiesList);
 
   if (!cookiesList) {
@@ -205,7 +205,7 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveCookie(
   }
 
   for (uint32_t i = 0; i < cookiesList->Length(); i++) {
-    nsCookie *cookie = cookiesList->ElementAt(i);
+    nsCookie* cookie = cookiesList->ElementAt(i);
     if (cookie->Name().Equals(aCookie.name()) &&
         cookie->Host().Equals(aCookie.host()) &&
         cookie->Path().Equals(aCookie.path())) {
@@ -218,7 +218,7 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveCookie(
 }
 
 mozilla::ipc::IPCResult CookieServiceChild::RecvAddCookie(
-    const CookieStruct &aCookie, const OriginAttributes &aAttrs) {
+    const CookieStruct& aCookie, const OriginAttributes& aAttrs) {
   RefPtr cookie = nsCookie::Create(
       aCookie.name(), aCookie.value(), aCookie.host(), aCookie.path(),
       aCookie.expiry(), aCookie.lastAccessed(), aCookie.creationTime(),
@@ -229,8 +229,8 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvAddCookie(
 }
 
 mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveBatchDeletedCookies(
-    nsTArray &&aCookiesList,
-    nsTArray &&aAttrsList) {
+    nsTArray&& aCookiesList,
+    nsTArray&& aAttrsList) {
   MOZ_ASSERT(aCookiesList.Length() == aAttrsList.Length());
   for (uint32_t i = 0; i < aCookiesList.Length(); i++) {
     CookieStruct cookieStruct = aCookiesList.ElementAt(i);
@@ -240,7 +240,7 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvRemoveBatchDeletedCookies(
 }
 
 mozilla::ipc::IPCResult CookieServiceChild::RecvTrackCookiesLoad(
-    nsTArray &&aCookiesList, const OriginAttributes &aAttrs) {
+    nsTArray&& aCookiesList, const OriginAttributes& aAttrs) {
   for (uint32_t i = 0; i < aCookiesList.Length(); i++) {
     RefPtr cookie = nsCookie::Create(
         aCookiesList[i].name(), aCookiesList[i].value(), aCookiesList[i].host(),
@@ -254,7 +254,7 @@ mozilla::ipc::IPCResult CookieServiceChild::RecvTrackCookiesLoad(
   return IPC_OK();
 }
 
-void CookieServiceChild::PrefChanged(nsIPrefBranch *aPrefBranch) {
+void CookieServiceChild::PrefChanged(nsIPrefBranch* aPrefBranch) {
   bool boolval;
   if (NS_SUCCEEDED(aPrefBranch->GetBoolPref(kPrefThirdPartySession, &boolval)))
     mThirdPartySession = !!boolval;
@@ -282,9 +282,9 @@ void CookieServiceChild::PrefChanged(nsIPrefBranch *aPrefBranch) {
 }
 
 void CookieServiceChild::GetCookieStringFromCookieHashTable(
-    nsIURI *aHostURI, bool aIsForeign, bool aIsTrackingResource,
+    nsIURI* aHostURI, bool aIsForeign, bool aIsTrackingResource,
     bool aFirstPartyStorageAccessGranted, bool aIsSafeTopLevelNav,
-    bool aIsSameSiteForeign, nsIChannel *aChannel, nsCString &aCookieString) {
+    bool aIsSameSiteForeign, nsIChannel* aChannel, nsCString& aCookieString) {
   nsCOMPtr TLDService =
       do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
   NS_ASSERTION(TLDService, "Can't get TLDService");
@@ -302,7 +302,7 @@ void CookieServiceChild::GetCookieStringFromCookieHashTable(
   nsCookieService::GetBaseDomain(TLDService, aHostURI, baseDomain,
                                  requireHostMatch);
   nsCookieKey key(baseDomain, attrs);
-  CookiesList *cookiesList = nullptr;
+  CookiesList* cookiesList = nullptr;
   mCookiesMap.Get(key, &cookiesList);
 
   if (!cookiesList) {
@@ -332,7 +332,7 @@ void CookieServiceChild::GetCookieStringFromCookieHashTable(
 
   cookiesList->Sort(CompareCookiesForSending());
   for (uint32_t i = 0; i < cookiesList->Length(); i++) {
-    nsCookie *cookie = cookiesList->ElementAt(i);
+    nsCookie* cookie = cookiesList->ElementAt(i);
     // check the host, since the base domain lookup is conservative.
     if (!nsCookieService::DomainMatches(cookie, hostFromURI)) continue;
 
@@ -383,8 +383,8 @@ void CookieServiceChild::GetCookieStringFromCookieHashTable(
 }
 
 uint32_t CookieServiceChild::CountCookiesFromHashTable(
-    const nsCString &aBaseDomain, const OriginAttributes &aOriginAttrs) {
-  CookiesList *cookiesList = nullptr;
+    const nsCString& aBaseDomain, const OriginAttributes& aOriginAttrs) {
+  CookiesList* cookiesList = nullptr;
 
   nsCString baseDomain;
   nsCookieKey key(aBaseDomain, aOriginAttrs);
@@ -394,9 +394,9 @@ uint32_t CookieServiceChild::CountCookiesFromHashTable(
 }
 
 void CookieServiceChild::SetCookieInternal(
-    nsCookieAttributes &aCookieAttributes,
-    const mozilla::OriginAttributes &aAttrs, nsIChannel *aChannel,
-    bool aFromHttp, nsICookiePermission *aPermissionService) {
+    nsCookieAttributes& aCookieAttributes,
+    const mozilla::OriginAttributes& aAttrs, nsIChannel* aChannel,
+    bool aFromHttp, nsICookiePermission* aPermissionService) {
   int64_t currentTimeInUsec = PR_Now();
   RefPtr cookie = nsCookie::Create(
       aCookieAttributes.name, aCookieAttributes.value, aCookieAttributes.host,
@@ -408,7 +408,7 @@ void CookieServiceChild::SetCookieInternal(
   RecordDocumentCookie(cookie, aAttrs);
 }
 
-bool CookieServiceChild::RequireThirdPartyCheck(nsILoadInfo *aLoadInfo) {
+bool CookieServiceChild::RequireThirdPartyCheck(nsILoadInfo* aLoadInfo) {
   if (!aLoadInfo) {
     return false;
   }
@@ -426,21 +426,21 @@ bool CookieServiceChild::RequireThirdPartyCheck(nsILoadInfo *aLoadInfo) {
          mThirdPartySession || mThirdPartyNonsecureSession;
 }
 
-void CookieServiceChild::RecordDocumentCookie(nsCookie *aCookie,
-                                              const OriginAttributes &aAttrs) {
+void CookieServiceChild::RecordDocumentCookie(nsCookie* aCookie,
+                                              const OriginAttributes& aAttrs) {
   nsAutoCString baseDomain;
   nsCookieService::GetBaseDomainFromHost(mTLDService, aCookie->Host(),
                                          baseDomain);
 
   nsCookieKey key(baseDomain, aAttrs);
-  CookiesList *cookiesList = nullptr;
+  CookiesList* cookiesList = nullptr;
   mCookiesMap.Get(key, &cookiesList);
 
   if (!cookiesList) {
     cookiesList = mCookiesMap.LookupOrAdd(key);
   }
   for (uint32_t i = 0; i < cookiesList->Length(); i++) {
-    nsCookie *cookie = cookiesList->ElementAt(i);
+    nsCookie* cookie = cookiesList->ElementAt(i);
     if (cookie->Name().Equals(aCookie->Name()) &&
         cookie->Host().Equals(aCookie->Host()) &&
         cookie->Path().Equals(aCookie->Path())) {
@@ -466,9 +466,9 @@ void CookieServiceChild::RecordDocumentCookie(nsCookie *aCookie,
   cookiesList->AppendElement(aCookie);
 }
 
-nsresult CookieServiceChild::GetCookieStringInternal(nsIURI *aHostURI,
-                                                     nsIChannel *aChannel,
-                                                     char **aCookieString) {
+nsresult CookieServiceChild::GetCookieStringInternal(nsIURI* aHostURI,
+                                                     nsIChannel* aChannel,
+                                                     char** aCookieString) {
   NS_ENSURE_ARG(aHostURI);
   NS_ENSURE_ARG_POINTER(aCookieString);
 
@@ -514,10 +514,10 @@ nsresult CookieServiceChild::GetCookieStringInternal(nsIURI *aHostURI,
   return NS_OK;
 }
 
-nsresult CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
-                                                     nsIChannel *aChannel,
-                                                     const char *aCookieString,
-                                                     const char *aServerTime,
+nsresult CookieServiceChild::SetCookieStringInternal(nsIURI* aHostURI,
+                                                     nsIChannel* aChannel,
+                                                     const char* aCookieString,
+                                                     const char* aServerTime,
                                                      bool aFromHttp) {
   NS_ENSURE_ARG(aHostURI);
   NS_ENSURE_ARG_POINTER(aCookieString);
@@ -601,7 +601,7 @@ nsresult CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
   }
 
   nsCookieKey key(baseDomain, attrs);
-  CookiesList *cookies = mCookiesMap.Get(key);
+  CookiesList* cookies = mCookiesMap.Get(key);
 
   nsCString serverTimeString(aServerTime);
   int64_t serverTime = nsCookieService::ParseServerTime(serverTimeString);
@@ -648,8 +648,8 @@ nsresult CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
 }
 
 NS_IMETHODIMP
-CookieServiceChild::Observe(nsISupports *aSubject, const char *aTopic,
-                            const char16_t *aData) {
+CookieServiceChild::Observe(nsISupports* aSubject, const char* aTopic,
+                            const char16_t* aData) {
   if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
     if (mCookieTimer) {
       mCookieTimer->Cancel();
@@ -673,38 +673,38 @@ CookieServiceChild::Observe(nsISupports *aSubject, const char *aTopic,
 }
 
 NS_IMETHODIMP
-CookieServiceChild::GetCookieString(nsIURI *aHostURI, nsIChannel *aChannel,
-                                    char **aCookieString) {
+CookieServiceChild::GetCookieString(nsIURI* aHostURI, nsIChannel* aChannel,
+                                    char** aCookieString) {
   return GetCookieStringInternal(aHostURI, aChannel, aCookieString);
 }
 
 NS_IMETHODIMP
-CookieServiceChild::GetCookieStringFromHttp(nsIURI *aHostURI, nsIURI *aFirstURI,
-                                            nsIChannel *aChannel,
-                                            char **aCookieString) {
+CookieServiceChild::GetCookieStringFromHttp(nsIURI* aHostURI, nsIURI* aFirstURI,
+                                            nsIChannel* aChannel,
+                                            char** aCookieString) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-CookieServiceChild::SetCookieString(nsIURI *aHostURI, nsIPrompt *aPrompt,
-                                    const char *aCookieString,
-                                    nsIChannel *aChannel) {
+CookieServiceChild::SetCookieString(nsIURI* aHostURI, nsIPrompt* aPrompt,
+                                    const char* aCookieString,
+                                    nsIChannel* aChannel) {
   return SetCookieStringInternal(aHostURI, aChannel, aCookieString, nullptr,
                                  false);
 }
 
 NS_IMETHODIMP
-CookieServiceChild::SetCookieStringFromHttp(nsIURI *aHostURI, nsIURI *aFirstURI,
-                                            nsIPrompt *aPrompt,
-                                            const char *aCookieString,
-                                            const char *aServerTime,
-                                            nsIChannel *aChannel) {
+CookieServiceChild::SetCookieStringFromHttp(nsIURI* aHostURI, nsIURI* aFirstURI,
+                                            nsIPrompt* aPrompt,
+                                            const char* aCookieString,
+                                            const char* aServerTime,
+                                            nsIChannel* aChannel) {
   return SetCookieStringInternal(aHostURI, aChannel, aCookieString, aServerTime,
                                  true);
 }
 
 NS_IMETHODIMP
-CookieServiceChild::RunInTransaction(nsICookieTransactionCallback *aCallback) {
+CookieServiceChild::RunInTransaction(nsICookieTransactionCallback* aCallback) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
diff --git a/netwerk/cookie/CookieServiceChild.h b/netwerk/cookie/CookieServiceChild.h
index 3096881a5bb68..3e24f7a94d34e 100644
--- a/netwerk/cookie/CookieServiceChild.h
+++ b/netwerk/cookie/CookieServiceChild.h
@@ -47,57 +47,57 @@ class CookieServiceChild : public PCookieServiceChild,
 
   static already_AddRefed GetSingleton();
 
-  void TrackCookieLoad(nsIChannel *aChannel);
+  void TrackCookieLoad(nsIChannel* aChannel);
 
  protected:
   virtual ~CookieServiceChild();
   void MoveCookies();
 
-  void SerializeURIs(nsIURI *aHostURI, nsIChannel *aChannel,
-                     nsCString &aHostSpec, nsCString &aHostCharset,
-                     nsCString &aOriginatingSpec,
-                     nsCString &aOriginatingCharset);
+  void SerializeURIs(nsIURI* aHostURI, nsIChannel* aChannel,
+                     nsCString& aHostSpec, nsCString& aHostCharset,
+                     nsCString& aOriginatingSpec,
+                     nsCString& aOriginatingCharset);
 
-  nsresult GetCookieStringInternal(nsIURI *aHostURI, nsIChannel *aChannel,
-                                   char **aCookieString);
+  nsresult GetCookieStringInternal(nsIURI* aHostURI, nsIChannel* aChannel,
+                                   char** aCookieString);
 
   void GetCookieStringFromCookieHashTable(
-      nsIURI *aHostURI, bool aIsForeign, bool aIsTrackingResource,
+      nsIURI* aHostURI, bool aIsForeign, bool aIsTrackingResource,
       bool aFirstPartyStorageAccessGranted, bool aIsSafeTopLevelNav,
-      bool aIsSameSiteForeign, nsIChannel *aChannel, nsCString &aCookieString);
+      bool aIsSameSiteForeign, nsIChannel* aChannel, nsCString& aCookieString);
 
-  nsresult SetCookieStringInternal(nsIURI *aHostURI, nsIChannel *aChannel,
-                                   const char *aCookieString,
-                                   const char *aServerTime, bool aFromHttp);
+  nsresult SetCookieStringInternal(nsIURI* aHostURI, nsIChannel* aChannel,
+                                   const char* aCookieString,
+                                   const char* aServerTime, bool aFromHttp);
 
-  void RecordDocumentCookie(nsCookie *aCookie, const OriginAttributes &aAttrs);
+  void RecordDocumentCookie(nsCookie* aCookie, const OriginAttributes& aAttrs);
 
-  void SetCookieInternal(nsCookieAttributes &aCookieAttributes,
-                         const mozilla::OriginAttributes &aAttrs,
-                         nsIChannel *aChannel, bool aFromHttp,
-                         nsICookiePermission *aPermissionService);
+  void SetCookieInternal(nsCookieAttributes& aCookieAttributes,
+                         const mozilla::OriginAttributes& aAttrs,
+                         nsIChannel* aChannel, bool aFromHttp,
+                         nsICookiePermission* aPermissionService);
 
-  uint32_t CountCookiesFromHashTable(const nsCString &aBaseDomain,
-                                     const OriginAttributes &aOriginAttrs);
+  uint32_t CountCookiesFromHashTable(const nsCString& aBaseDomain,
+                                     const OriginAttributes& aOriginAttrs);
 
-  void PrefChanged(nsIPrefBranch *aPrefBranch);
+  void PrefChanged(nsIPrefBranch* aPrefBranch);
 
-  bool RequireThirdPartyCheck(nsILoadInfo *aLoadInfo);
+  bool RequireThirdPartyCheck(nsILoadInfo* aLoadInfo);
 
   mozilla::ipc::IPCResult RecvTrackCookiesLoad(
-      nsTArray &&aCookiesList, const OriginAttributes &aAttrs);
+      nsTArray&& aCookiesList, const OriginAttributes& aAttrs);
 
   mozilla::ipc::IPCResult RecvRemoveAll();
 
   mozilla::ipc::IPCResult RecvRemoveBatchDeletedCookies(
-      nsTArray &&aCookiesList,
-      nsTArray &&aAttrsList);
+      nsTArray&& aCookiesList,
+      nsTArray&& aAttrsList);
 
-  mozilla::ipc::IPCResult RecvRemoveCookie(const CookieStruct &aCookie,
-                                           const OriginAttributes &aAttrs);
+  mozilla::ipc::IPCResult RecvRemoveCookie(const CookieStruct& aCookie,
+                                           const OriginAttributes& aAttrs);
 
-  mozilla::ipc::IPCResult RecvAddCookie(const CookieStruct &aCookie,
-                                        const OriginAttributes &aAttrs);
+  mozilla::ipc::IPCResult RecvAddCookie(const CookieStruct& aCookie,
+                                        const OriginAttributes& aAttrs);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
diff --git a/netwerk/cookie/CookieServiceParent.cpp b/netwerk/cookie/CookieServiceParent.cpp
index e78e148e73107..d17d1f196a216 100644
--- a/netwerk/cookie/CookieServiceParent.cpp
+++ b/netwerk/cookie/CookieServiceParent.cpp
@@ -29,8 +29,8 @@ namespace {
 
 // Ignore failures from this function, as they only affect whether we do or
 // don't show a dialog box in private browsing mode if the user sets a pref.
-nsresult CreateDummyChannel(nsIURI *aHostURI, nsILoadInfo *aLoadInfo,
-                            nsIChannel **aChannel) {
+nsresult CreateDummyChannel(nsIURI* aHostURI, nsILoadInfo* aLoadInfo,
+                            nsIChannel** aChannel) {
   nsCOMPtr dummyChannel;
   nsresult rv =
       NS_NewChannelInternal(getter_AddRefs(dummyChannel), aHostURI, aLoadInfo);
@@ -58,7 +58,7 @@ CookieServiceParent::CookieServiceParent() {
   mProcessingCookie = false;
 }
 
-void GetInfoFromCookie(nsCookie *aCookie, CookieStruct &aCookieStruct) {
+void GetInfoFromCookie(nsCookie* aCookie, CookieStruct& aCookieStruct) {
   aCookieStruct.name() = aCookie->Name();
   aCookieStruct.value() = aCookie->Value();
   aCookieStruct.host() = aCookie->Host();
@@ -72,7 +72,7 @@ void GetInfoFromCookie(nsCookie *aCookie, CookieStruct &aCookieStruct) {
   aCookieStruct.sameSite() = aCookie->SameSite();
 }
 
-void CookieServiceParent::RemoveBatchDeletedCookies(nsIArray *aCookieList) {
+void CookieServiceParent::RemoveBatchDeletedCookies(nsIArray* aCookieList) {
   uint32_t len = 0;
   aCookieList->GetLength(&len);
   OriginAttributes attrs;
@@ -81,7 +81,7 @@ void CookieServiceParent::RemoveBatchDeletedCookies(nsIArray *aCookieList) {
   nsTArray attrsList;
   for (uint32_t i = 0; i < len; i++) {
     nsCOMPtr xpcCookie = do_QueryElementAt(aCookieList, i);
-    auto cookie = static_cast(xpcCookie.get());
+    auto cookie = static_cast(xpcCookie.get());
     attrs = cookie->OriginAttributesRef();
     GetInfoFromCookie(cookie, cookieStruct);
     if (cookie->IsHttpOnly()) {
@@ -96,8 +96,8 @@ void CookieServiceParent::RemoveBatchDeletedCookies(nsIArray *aCookieList) {
 
 void CookieServiceParent::RemoveAll() { Unused << SendRemoveAll(); }
 
-void CookieServiceParent::RemoveCookie(nsICookie *aCookie) {
-  auto cookie = static_cast(aCookie);
+void CookieServiceParent::RemoveCookie(nsICookie* aCookie) {
+  auto cookie = static_cast(aCookie);
   OriginAttributes attrs = cookie->OriginAttributesRef();
   CookieStruct cookieStruct;
   GetInfoFromCookie(cookie, cookieStruct);
@@ -107,8 +107,8 @@ void CookieServiceParent::RemoveCookie(nsICookie *aCookie) {
   Unused << SendRemoveCookie(cookieStruct, attrs);
 }
 
-void CookieServiceParent::AddCookie(nsICookie *aCookie) {
-  auto cookie = static_cast(aCookie);
+void CookieServiceParent::AddCookie(nsICookie* aCookie) {
+  auto cookie = static_cast(aCookie);
   OriginAttributes attrs = cookie->OriginAttributesRef();
   CookieStruct cookieStruct;
   GetInfoFromCookie(cookie, cookieStruct);
@@ -118,7 +118,7 @@ void CookieServiceParent::AddCookie(nsICookie *aCookie) {
   Unused << SendAddCookie(cookieStruct, attrs);
 }
 
-void CookieServiceParent::TrackCookieLoad(nsIChannel *aChannel) {
+void CookieServiceParent::TrackCookieLoad(nsIChannel* aChannel) {
   nsCOMPtr uri;
   aChannel->GetURI(getter_AddRefs(uri));
 
@@ -149,7 +149,7 @@ void CookieServiceParent::TrackCookieLoad(nsIChannel *aChannel) {
     }
   }
 
-  nsTArray foundCookieList;
+  nsTArray foundCookieList;
   mCookieService->GetCookiesForURI(
       uri, aChannel, isForeign, isTrackingResource, storageAccessGranted,
       isSafeTopLevelNav, aIsSameSiteForeign, false, attrs, foundCookieList);
@@ -159,11 +159,11 @@ void CookieServiceParent::TrackCookieLoad(nsIChannel *aChannel) {
 }
 
 void CookieServiceParent::SerialializeCookieList(
-    const nsTArray &aFoundCookieList,
-    nsTArray &aCookiesList, nsIURI *aHostURI) {
+    const nsTArray& aFoundCookieList,
+    nsTArray& aCookiesList, nsIURI* aHostURI) {
   for (uint32_t i = 0; i < aFoundCookieList.Length(); i++) {
-    nsCookie *cookie = aFoundCookieList.ElementAt(i);
-    CookieStruct *cookieStruct = aCookiesList.AppendElement();
+    nsCookie* cookie = aFoundCookieList.ElementAt(i);
+    CookieStruct* cookieStruct = aCookiesList.AppendElement();
     cookieStruct->name() = cookie->Name();
     if (!cookie->IsHttpOnly()) {
       cookieStruct->value() = cookie->Value();
@@ -180,14 +180,14 @@ void CookieServiceParent::SerialializeCookieList(
 }
 
 mozilla::ipc::IPCResult CookieServiceParent::RecvPrepareCookieList(
-    const URIParams &aHost, const bool &aIsForeign,
-    const bool &aIsTrackingResource,
-    const bool &aFirstPartyStorageAccessGranted, const bool &aIsSafeTopLevelNav,
-    const bool &aIsSameSiteForeign, const OriginAttributes &aAttrs) {
+    const URIParams& aHost, const bool& aIsForeign,
+    const bool& aIsTrackingResource,
+    const bool& aFirstPartyStorageAccessGranted, const bool& aIsSafeTopLevelNav,
+    const bool& aIsSameSiteForeign, const OriginAttributes& aAttrs) {
   nsCOMPtr hostURI = DeserializeURI(aHost);
 
   // Send matching cookies to Child.
-  nsTArray foundCookieList;
+  nsTArray foundCookieList;
   // Note: passing nullptr as aChannel to GetCookiesForURI() here is fine since
   // this argument is only used for proper reporting of cookie loads, but the
   // child process already does the necessary reporting in this case for us.
@@ -207,12 +207,12 @@ void CookieServiceParent::ActorDestroy(ActorDestroyReason aWhy) {
 }
 
 mozilla::ipc::IPCResult CookieServiceParent::RecvSetCookieString(
-    const URIParams &aHost, const Maybe &aChannelURI,
-    const Maybe &aLoadInfoArgs, const bool &aIsForeign,
-    const bool &aIsTrackingResource,
-    const bool &aFirstPartyStorageAccessGranted, const OriginAttributes &aAttrs,
-    const nsCString &aCookieString, const nsCString &aServerTime,
-    const bool &aFromHttp) {
+    const URIParams& aHost, const Maybe& aChannelURI,
+    const Maybe& aLoadInfoArgs, const bool& aIsForeign,
+    const bool& aIsTrackingResource,
+    const bool& aFirstPartyStorageAccessGranted, const OriginAttributes& aAttrs,
+    const nsCString& aCookieString, const nsCString& aServerTime,
+    const bool& aFromHttp) {
   if (!mCookieService) return IPC_OK();
 
   // Deserialize URI. Having a host URI is mandatory and should always be
diff --git a/netwerk/cookie/CookieServiceParent.h b/netwerk/cookie/CookieServiceParent.h
index 8d67a2958ea36..c2584577eef16 100644
--- a/netwerk/cookie/CookieServiceParent.h
+++ b/netwerk/cookie/CookieServiceParent.h
@@ -25,15 +25,15 @@ class CookieServiceParent : public PCookieServiceParent {
   CookieServiceParent();
   virtual ~CookieServiceParent() = default;
 
-  void TrackCookieLoad(nsIChannel *aChannel);
+  void TrackCookieLoad(nsIChannel* aChannel);
 
-  void RemoveBatchDeletedCookies(nsIArray *aCookieList);
+  void RemoveBatchDeletedCookies(nsIArray* aCookieList);
 
   void RemoveAll();
 
-  void RemoveCookie(nsICookie *aCookie);
+  void RemoveCookie(nsICookie* aCookie);
 
-  void AddCookie(nsICookie *aCookie);
+  void AddCookie(nsICookie* aCookie);
 
   // This will return true if the CookieServiceParent is currently processing
   // an update from the content process. This is used in ContentParent to make
@@ -45,23 +45,23 @@ class CookieServiceParent : public PCookieServiceParent {
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
   mozilla::ipc::IPCResult RecvSetCookieString(
-      const URIParams &aHost, const Maybe &aChannelURI,
-      const Maybe &aLoadInfoArgs, const bool &aIsForeign,
-      const bool &aIsTrackingResource,
-      const bool &aFirstPartyStorageAccessGranted,
-      const OriginAttributes &aAttrs, const nsCString &aCookieString,
-      const nsCString &aServerTime, const bool &aFromHttp);
+      const URIParams& aHost, const Maybe& aChannelURI,
+      const Maybe& aLoadInfoArgs, const bool& aIsForeign,
+      const bool& aIsTrackingResource,
+      const bool& aFirstPartyStorageAccessGranted,
+      const OriginAttributes& aAttrs, const nsCString& aCookieString,
+      const nsCString& aServerTime, const bool& aFromHttp);
 
   mozilla::ipc::IPCResult RecvPrepareCookieList(
-      const URIParams &aHost, const bool &aIsForeign,
-      const bool &aIsTrackingResource,
-      const bool &aFirstPartyStorageAccessGranted,
-      const bool &aIsSafeTopLevelNav, const bool &aIsSameSiteForeign,
-      const OriginAttributes &aAttrs);
-
-  void SerialializeCookieList(const nsTArray &aFoundCookieList,
-                              nsTArray &aCookiesList,
-                              nsIURI *aHostURI);
+      const URIParams& aHost, const bool& aIsForeign,
+      const bool& aIsTrackingResource,
+      const bool& aFirstPartyStorageAccessGranted,
+      const bool& aIsSafeTopLevelNav, const bool& aIsSameSiteForeign,
+      const OriginAttributes& aAttrs);
+
+  void SerialializeCookieList(const nsTArray& aFoundCookieList,
+                              nsTArray& aCookiesList,
+                              nsIURI* aHostURI);
 
   RefPtr mCookieService;
   bool mProcessingCookie;
diff --git a/netwerk/cookie/nsCookie.cpp b/netwerk/cookie/nsCookie.cpp
index a6d167e235f68..9518f89c34f76 100644
--- a/netwerk/cookie/nsCookie.cpp
+++ b/netwerk/cookie/nsCookie.cpp
@@ -16,12 +16,12 @@
 
 // copy aSource strings into contiguous storage provided in aDest1,
 // providing terminating nulls for each destination string.
-static inline void StrBlockCopy(const nsACString &aSource1,
-                                const nsACString &aSource2,
-                                const nsACString &aSource3,
-                                const nsACString &aSource4, char *&aDest1,
-                                char *&aDest2, char *&aDest3, char *&aDest4,
-                                char *&aDestEnd) {
+static inline void StrBlockCopy(const nsACString& aSource1,
+                                const nsACString& aSource2,
+                                const nsACString& aSource3,
+                                const nsACString& aSource4, char*& aDest1,
+                                char*& aDest2, char*& aDest3, char*& aDest4,
+                                char*& aDestEnd) {
   size_t len1 = aSource1.Length();
   memcpy(aDest1, aSource1.BeginReading(), len1);
   aDest1[len1] = 0;
@@ -74,12 +74,12 @@ int64_t nsCookie::GenerateUniqueCreationTime(int64_t aCreationTime) {
   return ++gLastCreationTime;
 }
 
-nsCookie *nsCookie::Create(const nsACString &aName, const nsACString &aValue,
-                           const nsACString &aHost, const nsACString &aPath,
+nsCookie* nsCookie::Create(const nsACString& aName, const nsACString& aValue,
+                           const nsACString& aHost, const nsACString& aPath,
                            int64_t aExpiry, int64_t aLastAccessed,
                            int64_t aCreationTime, bool aIsSession,
                            bool aIsSecure, bool aIsHttpOnly,
-                           const OriginAttributes &aOriginAttributes,
+                           const OriginAttributes& aOriginAttributes,
                            int32_t aSameSite) {
   // Ensure mValue contains a valid UTF-8 sequence. Otherwise XPConnect will
   // truncate the string after the first invalid octet.
@@ -92,12 +92,12 @@ nsCookie *nsCookie::Create(const nsACString &aName, const nsACString &aValue,
 
   // allocate contiguous space for the nsCookie and its strings -
   // we store the strings in-line with the nsCookie to save allocations
-  void *place = ::operator new(sizeof(nsCookie) + stringLength);
+  void* place = ::operator new(sizeof(nsCookie) + stringLength);
   if (!place) return nullptr;
 
   // assign string members
   char *name, *value, *host, *path, *end;
-  name = static_cast(place) + sizeof(nsCookie);
+  name = static_cast(place) + sizeof(nsCookie);
   StrBlockCopy(aName, aUTF8Value, aHost, aPath, name, value, host, path, end);
 
   // If the creationTime given to us is higher than the running maximum, update
@@ -135,61 +135,61 @@ bool nsCookie::IsStale() const {
  ******************************************************************************/
 
 // xpcom getters
-NS_IMETHODIMP nsCookie::GetName(nsACString &aName) {
+NS_IMETHODIMP nsCookie::GetName(nsACString& aName) {
   aName = Name();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetValue(nsACString &aValue) {
+NS_IMETHODIMP nsCookie::GetValue(nsACString& aValue) {
   aValue = Value();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetHost(nsACString &aHost) {
+NS_IMETHODIMP nsCookie::GetHost(nsACString& aHost) {
   aHost = Host();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetRawHost(nsACString &aHost) {
+NS_IMETHODIMP nsCookie::GetRawHost(nsACString& aHost) {
   aHost = RawHost();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetPath(nsACString &aPath) {
+NS_IMETHODIMP nsCookie::GetPath(nsACString& aPath) {
   aPath = Path();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetExpiry(int64_t *aExpiry) {
+NS_IMETHODIMP nsCookie::GetExpiry(int64_t* aExpiry) {
   *aExpiry = Expiry();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetIsSession(bool *aIsSession) {
+NS_IMETHODIMP nsCookie::GetIsSession(bool* aIsSession) {
   *aIsSession = IsSession();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetIsDomain(bool *aIsDomain) {
+NS_IMETHODIMP nsCookie::GetIsDomain(bool* aIsDomain) {
   *aIsDomain = IsDomain();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetIsSecure(bool *aIsSecure) {
+NS_IMETHODIMP nsCookie::GetIsSecure(bool* aIsSecure) {
   *aIsSecure = IsSecure();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetIsHttpOnly(bool *aHttpOnly) {
+NS_IMETHODIMP nsCookie::GetIsHttpOnly(bool* aHttpOnly) {
   *aHttpOnly = IsHttpOnly();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetCreationTime(int64_t *aCreation) {
+NS_IMETHODIMP nsCookie::GetCreationTime(int64_t* aCreation) {
   *aCreation = CreationTime();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetLastAccessed(int64_t *aTime) {
+NS_IMETHODIMP nsCookie::GetLastAccessed(int64_t* aTime) {
   *aTime = LastAccessed();
   return NS_OK;
 }
-NS_IMETHODIMP nsCookie::GetSameSite(int32_t *aSameSite) {
+NS_IMETHODIMP nsCookie::GetSameSite(int32_t* aSameSite) {
   *aSameSite = SameSite();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCookie::GetOriginAttributes(JSContext *aCx,
+nsCookie::GetOriginAttributes(JSContext* aCx,
                               JS::MutableHandle aVal) {
   if (NS_WARN_IF(!ToJSValue(aCx, mOriginAttributes, aVal))) {
     return NS_ERROR_FAILURE;
@@ -200,7 +200,7 @@ nsCookie::GetOriginAttributes(JSContext *aCx,
 // compatibility method, for use with the legacy nsICookie interface.
 // here, expires == 0 denotes a session cookie.
 NS_IMETHODIMP
-nsCookie::GetExpires(uint64_t *aExpires) {
+nsCookie::GetExpires(uint64_t* aExpires) {
   if (IsSession()) {
     *aExpires = 0;
   } else {
diff --git a/netwerk/cookie/nsCookie.h b/netwerk/cookie/nsCookie.h
index 1582cca49467e..5043deffc4b44 100644
--- a/netwerk/cookie/nsCookie.h
+++ b/netwerk/cookie/nsCookie.h
@@ -36,11 +36,11 @@ class nsCookie final : public nsICookie2 {
 
  private:
   // for internal use only. see nsCookie::Create().
-  nsCookie(const char *aName, const char *aValue, const char *aHost,
-           const char *aPath, const char *aEnd, int64_t aExpiry,
+  nsCookie(const char* aName, const char* aValue, const char* aHost,
+           const char* aPath, const char* aEnd, int64_t aExpiry,
            int64_t aLastAccessed, int64_t aCreationTime, bool aIsSession,
            bool aIsSecure, bool aIsHttpOnly,
-           const OriginAttributes &aOriginAttributes, int32_t aSameSite)
+           const OriginAttributes& aOriginAttributes, int32_t aSameSite)
       : mName(aName),
         mValue(aValue),
         mHost(aHost),
@@ -73,12 +73,12 @@ class nsCookie final : public nsICookie2 {
 
   // public helper to create an nsCookie object. use |operator delete|
   // to destroy an object created by this method.
-  static nsCookie *Create(const nsACString &aName, const nsACString &aValue,
-                          const nsACString &aHost, const nsACString &aPath,
+  static nsCookie* Create(const nsACString& aName, const nsACString& aValue,
+                          const nsACString& aHost, const nsACString& aPath,
                           int64_t aExpiry, int64_t aLastAccessed,
                           int64_t aCreationTime, bool aIsSession,
                           bool aIsSecure, bool aIsHttpOnly,
-                          const OriginAttributes &aOriginAttributes,
+                          const OriginAttributes& aOriginAttributes,
                           int32_t aSameSite);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
@@ -110,7 +110,7 @@ class nsCookie final : public nsICookie2 {
   inline bool IsDomain() const { return *mHost == '.'; }
   inline bool IsSecure() const { return mIsSecure; }
   inline bool IsHttpOnly() const { return mIsHttpOnly; }
-  inline const OriginAttributes &OriginAttributesRef() const {
+  inline const OriginAttributes& OriginAttributesRef() const {
     return mOriginAttributes;
   }
   inline int32_t SameSite() const { return mSameSite; }
@@ -136,11 +136,11 @@ class nsCookie final : public nsICookie2 {
   // out as nsCStrings.
   //
   // Please update SizeOfIncludingThis if this strategy changes.
-  const char *mName;
-  const char *mValue;
-  const char *mHost;
-  const char *mPath;
-  const char *mEnd;
+  const char* mName;
+  const char* mValue;
+  const char* mHost;
+  const char* mPath;
+  const char* mEnd;
   int64_t mExpiry;
   int64_t mLastAccessed;
   int64_t mCreationTime;
@@ -154,12 +154,12 @@ class nsCookie final : public nsICookie2 {
 // Comparator class for sorting cookies before sending to a server.
 class CompareCookiesForSending {
  public:
-  bool Equals(const nsCookie *aCookie1, const nsCookie *aCookie2) const {
+  bool Equals(const nsCookie* aCookie1, const nsCookie* aCookie2) const {
     return aCookie1->CreationTime() == aCookie2->CreationTime() &&
            aCookie2->Path().Length() == aCookie1->Path().Length();
   }
 
-  bool LessThan(const nsCookie *aCookie1, const nsCookie *aCookie2) const {
+  bool LessThan(const nsCookie* aCookie1, const nsCookie* aCookie2) const {
     // compare by cookie path length in accordance with RFC2109
     int32_t result = aCookie2->Path().Length() - aCookie1->Path().Length();
     if (result != 0) return result < 0;
diff --git a/netwerk/cookie/nsCookiePermission.cpp b/netwerk/cookie/nsCookiePermission.cpp
index 874a5c64a5bfb..87f7f12c7d809 100644
--- a/netwerk/cookie/nsCookiePermission.cpp
+++ b/netwerk/cookie/nsCookiePermission.cpp
@@ -65,7 +65,7 @@ bool nsCookiePermission::Init() {
 }
 
 NS_IMETHODIMP
-nsCookiePermission::SetAccess(nsIURI *aURI, nsCookieAccess aAccess) {
+nsCookiePermission::SetAccess(nsIURI* aURI, nsCookieAccess aAccess) {
   // Lazily initialize ourselves
   if (!EnsureInitialized()) return NS_ERROR_UNEXPECTED;
 
@@ -79,9 +79,9 @@ nsCookiePermission::SetAccess(nsIURI *aURI, nsCookieAccess aAccess) {
 }
 
 NS_IMETHODIMP
-nsCookiePermission::CanSetCookie(nsIURI *aURI, nsIChannel *aChannel,
-                                 nsICookie2 *aCookie, bool *aIsSession,
-                                 int64_t *aExpiry, bool *aResult) {
+nsCookiePermission::CanSetCookie(nsIURI* aURI, nsIChannel* aChannel,
+                                 nsICookie2* aCookie, bool* aIsSession,
+                                 int64_t* aExpiry, bool* aResult) {
   NS_ASSERTION(aURI, "null uri");
 
   *aResult = kDefaultPolicy;
diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp
index 6390027f7696a..44f573c98491c 100644
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -135,9 +135,9 @@ static const char kPrefThirdPartySession[] =
 static const char kPrefThirdPartyNonsecureSession[] =
     "network.cookie.thirdparty.nonsecureSessionOnly";
 
-static void bindCookieParameters(mozIStorageBindingParamsArray *aParamsArray,
-                                 const nsCookieKey &aKey,
-                                 const nsCookie *aCookie);
+static void bindCookieParameters(mozIStorageBindingParamsArray* aParamsArray,
+                                 const nsCookieKey& aKey,
+                                 const nsCookie* aCookie);
 
 // stores the nsCookieEntry entryclass and an index into the cookie array
 // within that entryclass, for purposes of storing an iteration state that
@@ -148,13 +148,13 @@ struct nsListIter {
 
   // explicit constructor to a given iterator state with entryclass 'aEntry'
   // and index 'aIndex'.
-  explicit nsListIter(nsCookieEntry *aEntry, nsCookieEntry::IndexType aIndex)
+  explicit nsListIter(nsCookieEntry* aEntry, nsCookieEntry::IndexType aIndex)
       : entry(aEntry), index(aIndex) {}
 
   // get the nsCookie * the iterator currently points to.
-  nsCookie *Cookie() const { return entry->GetCookies()[index]; }
+  nsCookie* Cookie() const { return entry->GetCookies()[index]; }
 
-  nsCookieEntry *entry;
+  nsCookieEntry* entry;
   nsCookieEntry::IndexType index;
 };
 
@@ -194,8 +194,8 @@ static LazyLogModule gCookieLog("cookie");
   MOZ_LOG(gCookieLog, lvl, ("\n")); \
   PR_END_MACRO
 
-static void LogFailure(bool aSetCookie, nsIURI *aHostURI,
-                       const char *aCookieString, const char *aReason) {
+static void LogFailure(bool aSetCookie, nsIURI* aHostURI,
+                       const char* aCookieString, const char* aReason) {
   // if logging isn't enabled, return now to save cycles
   if (!MOZ_LOG_TEST(gCookieLog, LogLevel::Warning)) return;
 
@@ -220,7 +220,7 @@ static void LogFailure(bool aSetCookie, nsIURI *aHostURI,
   MOZ_LOG(gCookieLog, LogLevel::Warning, ("\n"));
 }
 
-static void LogCookie(nsCookie *aCookie) {
+static void LogCookie(nsCookie* aCookie) {
   PRExplodedTime explodedTime;
   PR_ExplodeTime(PR_Now(), PR_GMTParameters, &explodedTime);
   char timeString[40];
@@ -262,8 +262,8 @@ static void LogCookie(nsCookie *aCookie) {
   }
 }
 
-static void LogSuccess(bool aSetCookie, nsIURI *aHostURI,
-                       const char *aCookieString, nsCookie *aCookie,
+static void LogSuccess(bool aSetCookie, nsIURI* aHostURI,
+                       const char* aCookieString, nsCookie* aCookie,
                        bool aReplacing) {
   // if logging isn't enabled, return now to save cycles
   if (!MOZ_LOG_TEST(gCookieLog, LogLevel::Debug)) {
@@ -286,7 +286,7 @@ static void LogSuccess(bool aSetCookie, nsIURI *aHostURI,
   MOZ_LOG(gCookieLog, LogLevel::Debug, ("\n"));
 }
 
-static void LogEvicted(nsCookie *aCookie, const char *details) {
+static void LogEvicted(nsCookie* aCookie, const char* details) {
   MOZ_LOG(gCookieLog, LogLevel::Debug, ("===== COOKIE EVICTED =====\n"));
   MOZ_LOG(gCookieLog, LogLevel::Debug, ("%s\n", details));
 
@@ -296,14 +296,14 @@ static void LogEvicted(nsCookie *aCookie, const char *details) {
 }
 
 // inline wrappers to make passing in nsCStrings easier
-static inline void LogFailure(bool aSetCookie, nsIURI *aHostURI,
-                              const nsCString &aCookieString,
-                              const char *aReason) {
+static inline void LogFailure(bool aSetCookie, nsIURI* aHostURI,
+                              const nsCString& aCookieString,
+                              const char* aReason) {
   LogFailure(aSetCookie, aHostURI, aCookieString.get(), aReason);
 }
 
-static inline void LogSuccess(bool aSetCookie, nsIURI *aHostURI,
-                              const nsCString &aCookieString, nsCookie *aCookie,
+static inline void LogSuccess(bool aSetCookie, nsIURI* aHostURI,
+                              const nsCString& aCookieString, nsCookie* aCookie,
                               bool aReplacing) {
   LogSuccess(aSetCookie, aHostURI, aCookieString.get(), aCookie, aReplacing);
 }
@@ -330,12 +330,12 @@ static inline void LogSuccess(bool aSetCookie, nsIURI *aHostURI,
  ******************************************************************************/
 class DBListenerErrorHandler : public mozIStorageStatementCallback {
  protected:
-  explicit DBListenerErrorHandler(DBState *dbState) : mDBState(dbState) {}
+  explicit DBListenerErrorHandler(DBState* dbState) : mDBState(dbState) {}
   RefPtr mDBState;
-  virtual const char *GetOpType() = 0;
+  virtual const char* GetOpType() = 0;
 
  public:
-  NS_IMETHOD HandleError(mozIStorageError *aError) override {
+  NS_IMETHOD HandleError(mozIStorageError* aError) override {
     if (MOZ_LOG_TEST(gCookieLog, LogLevel::Warning)) {
       int32_t result = -1;
       aError->GetResult(&result);
@@ -362,16 +362,16 @@ class DBListenerErrorHandler : public mozIStorageStatementCallback {
  ******************************************************************************/
 class InsertCookieDBListener final : public DBListenerErrorHandler {
  private:
-  const char *GetOpType() override { return "INSERT"; }
+  const char* GetOpType() override { return "INSERT"; }
 
   ~InsertCookieDBListener() = default;
 
  public:
   NS_DECL_ISUPPORTS
 
-  explicit InsertCookieDBListener(DBState *dbState)
+  explicit InsertCookieDBListener(DBState* dbState)
       : DBListenerErrorHandler(dbState) {}
-  NS_IMETHOD HandleResult(mozIStorageResultSet *) override {
+  NS_IMETHOD HandleResult(mozIStorageResultSet*) override {
     MOZ_ASSERT_UNREACHABLE(
         "Unexpected call to "
         "InsertCookieDBListener::HandleResult");
@@ -399,16 +399,16 @@ NS_IMPL_ISUPPORTS(InsertCookieDBListener, mozIStorageStatementCallback)
  ******************************************************************************/
 class UpdateCookieDBListener final : public DBListenerErrorHandler {
  private:
-  const char *GetOpType() override { return "UPDATE"; }
+  const char* GetOpType() override { return "UPDATE"; }
 
   ~UpdateCookieDBListener() = default;
 
  public:
   NS_DECL_ISUPPORTS
 
-  explicit UpdateCookieDBListener(DBState *dbState)
+  explicit UpdateCookieDBListener(DBState* dbState)
       : DBListenerErrorHandler(dbState) {}
-  NS_IMETHOD HandleResult(mozIStorageResultSet *) override {
+  NS_IMETHOD HandleResult(mozIStorageResultSet*) override {
     MOZ_ASSERT_UNREACHABLE(
         "Unexpected call to "
         "UpdateCookieDBListener::HandleResult");
@@ -425,16 +425,16 @@ NS_IMPL_ISUPPORTS(UpdateCookieDBListener, mozIStorageStatementCallback)
  ******************************************************************************/
 class RemoveCookieDBListener final : public DBListenerErrorHandler {
  private:
-  const char *GetOpType() override { return "REMOVE"; }
+  const char* GetOpType() override { return "REMOVE"; }
 
   ~RemoveCookieDBListener() = default;
 
  public:
   NS_DECL_ISUPPORTS
 
-  explicit RemoveCookieDBListener(DBState *dbState)
+  explicit RemoveCookieDBListener(DBState* dbState)
       : DBListenerErrorHandler(dbState) {}
-  NS_IMETHOD HandleResult(mozIStorageResultSet *) override {
+  NS_IMETHOD HandleResult(mozIStorageResultSet*) override {
     MOZ_ASSERT_UNREACHABLE(
         "Unexpected call to "
         "RemoveCookieDBListener::HandleResult");
@@ -454,11 +454,11 @@ class CloseCookieDBListener final : public mozIStorageCompletionCallback {
   ~CloseCookieDBListener() = default;
 
  public:
-  explicit CloseCookieDBListener(DBState *dbState) : mDBState(dbState) {}
+  explicit CloseCookieDBListener(DBState* dbState) : mDBState(dbState) {}
   RefPtr mDBState;
   NS_DECL_ISUPPORTS
 
-  NS_IMETHOD Complete(nsresult, nsISupports *) override {
+  NS_IMETHOD Complete(nsresult, nsISupports*) override {
     gCookieService->HandleDBClosed(mDBState);
     return NS_OK;
   }
@@ -476,8 +476,8 @@ class AppClearDataObserver final : public nsIObserver {
 
   // nsIObserver implementation.
   NS_IMETHOD
-  Observe(nsISupports *aSubject, const char *aTopic,
-          const char16_t *aData) override {
+  Observe(nsISupports* aSubject, const char* aTopic,
+          const char16_t* aData) override {
     MOZ_ASSERT(!nsCRT::strcmp(aTopic, TOPIC_CLEAR_ORIGIN_DATA));
 
     MOZ_ASSERT(XRE_IsParentProcess());
@@ -496,13 +496,13 @@ NS_IMPL_ISUPPORTS(AppClearDataObserver, nsIObserver)
 // comparator class for sorting cookies by entry and index.
 class CompareCookiesByIndex {
  public:
-  bool Equals(const nsListIter &a, const nsListIter &b) const {
+  bool Equals(const nsListIter& a, const nsListIter& b) const {
     NS_ASSERTION(a.entry != b.entry || a.index != b.index,
                  "cookie indexes should never be equal");
     return false;
   }
 
-  bool LessThan(const nsListIter &a, const nsListIter &b) const {
+  bool LessThan(const nsListIter& a, const nsListIter& b) const {
     // compare by entryclass pointer, then by index.
     if (a.entry != b.entry) return a.entry < b.entry;
 
@@ -732,7 +732,7 @@ NS_IMPL_ISUPPORTS(ConvertAppIdToOriginAttrsSQLFunction, mozIStorageFunction);
 
 NS_IMETHODIMP
 ConvertAppIdToOriginAttrsSQLFunction::OnFunctionCall(
-    mozIStorageValueArray *aFunctionArguments, nsIVariant **aResult) {
+    mozIStorageValueArray* aFunctionArguments, nsIVariant** aResult) {
   nsresult rv;
   int32_t inIsolatedMozBrowser;
 
@@ -766,7 +766,7 @@ NS_IMPL_ISUPPORTS(SetAppIdFromOriginAttributesSQLFunction, mozIStorageFunction);
 
 NS_IMETHODIMP
 SetAppIdFromOriginAttributesSQLFunction::OnFunctionCall(
-    mozIStorageValueArray *aFunctionArguments, nsIVariant **aResult) {
+    mozIStorageValueArray* aFunctionArguments, nsIVariant** aResult) {
   nsresult rv;
   nsAutoCString suffix;
   OriginAttributes attrs;
@@ -797,7 +797,7 @@ NS_IMPL_ISUPPORTS(SetInBrowserFromOriginAttributesSQLFunction,
 
 NS_IMETHODIMP
 SetInBrowserFromOriginAttributesSQLFunction::OnFunctionCall(
-    mozIStorageValueArray *aFunctionArguments, nsIVariant **aResult) {
+    mozIStorageValueArray* aFunctionArguments, nsIVariant** aResult) {
   nsresult rv;
   nsAutoCString suffix;
   OriginAttributes attrs;
@@ -1385,7 +1385,7 @@ OpenDBResult nsCookieService::TryInitDB(bool aRecreateDB) {
         // failure. Note that we have to switch out our DBState temporarily, in
         // case we're in private browsing mode; otherwise ImportCookies() won't
         // be happy.
-        DBState *initialState = gCookieService->mDBState;
+        DBState* initialState = gCookieService->mDBState;
         gCookieService->mDBState = gCookieService->mDefaultDBState;
         oldCookieFile->AppendNative(NS_LITERAL_CSTRING(OLD_COOKIE_FILE_NAME));
         gCookieService->ImportCookies(oldCookieFile);
@@ -1408,7 +1408,7 @@ void nsCookieService::InitDBConn() {
   }
 
   for (uint32_t i = 0; i < mReadArray.Length(); ++i) {
-    CookieDomainTuple &tuple = mReadArray[i];
+    CookieDomainTuple& tuple = mReadArray[i];
     RefPtr cookie = nsCookie::Create(
         tuple.cookie->name, tuple.cookie->value, tuple.cookie->host,
         tuple.cookie->path, tuple.cookie->expiry, tuple.cookie->lastAccessed,
@@ -1522,7 +1522,7 @@ nsresult nsCookieService::InitDBConnInternal() {
 }
 
 // Sets the schema version and creates the moz_cookies table.
-nsresult nsCookieService::CreateTableWorker(const char *aName) {
+nsresult nsCookieService::CreateTableWorker(const char* aName) {
   // Create the table.
   // We default originAttributes to empty string: this is so if users revert to
   // an older Firefox version that doesn't know about this field, any cookies
@@ -1704,7 +1704,7 @@ void nsCookieService::CleanupDefaultDBConnection() {
   mDefaultDBState->closeListener = nullptr;
 }
 
-void nsCookieService::HandleDBClosed(DBState *aDBState) {
+void nsCookieService::HandleDBClosed(DBState* aDBState) {
   COOKIE_LOGSTRING(LogLevel::Debug,
                    ("HandleDBClosed(): DBState %p closed", aDBState));
 
@@ -1746,7 +1746,7 @@ void nsCookieService::HandleDBClosed(DBState *aDBState) {
   }
 }
 
-void nsCookieService::HandleCorruptDB(DBState *aDBState) {
+void nsCookieService::HandleCorruptDB(DBState* aDBState) {
   if (mDefaultDBState != aDBState) {
     // We've either closed the state or we've switched profiles. It's getting
     // a bit late to rebuild -- bail instead.
@@ -1792,7 +1792,7 @@ void nsCookieService::HandleCorruptDB(DBState *aDBState) {
   }
 }
 
-void nsCookieService::RebuildCorruptDB(DBState *aDBState) {
+void nsCookieService::RebuildCorruptDB(DBState* aDBState) {
   NS_ASSERTION(!aDBState->dbConn, "shouldn't have an open db connection");
   NS_ASSERTION(aDBState->corruptFlag == DBState::CLOSING_FOR_REBUILD,
                "should be in CLOSING_FOR_REBUILD state");
@@ -1857,19 +1857,19 @@ void nsCookieService::RebuildCorruptDB(DBState *aDBState) {
               gCookieService->InitDBConnInternal();
 
               // Enumerate the hash, and add cookies to the params array.
-              mozIStorageAsyncStatement *stmt =
+              mozIStorageAsyncStatement* stmt =
                   gCookieService->mDefaultDBState->stmtInsert;
               nsCOMPtr paramsArray;
               stmt->NewBindingParamsArray(getter_AddRefs(paramsArray));
               for (auto iter =
                        gCookieService->mDefaultDBState->hostTable.Iter();
                    !iter.Done(); iter.Next()) {
-                nsCookieEntry *entry = iter.Get();
+                nsCookieEntry* entry = iter.Get();
 
-                const nsCookieEntry::ArrayType &cookies = entry->GetCookies();
+                const nsCookieEntry::ArrayType& cookies = entry->GetCookies();
                 for (nsCookieEntry::IndexType i = 0; i < cookies.Length();
                      ++i) {
-                  nsCookie *cookie = cookies[i];
+                  nsCookie* cookie = cookies[i];
 
                   if (!cookie->IsSession()) {
                     bindCookieParameters(paramsArray, nsCookieKey(entry),
@@ -1914,8 +1914,8 @@ nsCookieService::~nsCookieService() {
 }
 
 NS_IMETHODIMP
-nsCookieService::Observe(nsISupports *aSubject, const char *aTopic,
-                         const char16_t *aData) {
+nsCookieService::Observe(nsISupports* aSubject, const char* aTopic,
+                         const char16_t* aData) {
   // check the topic
   if (!strcmp(aTopic, "profile-before-change")) {
     // The profile is about to change,
@@ -1951,21 +1951,21 @@ nsCookieService::Observe(nsISupports *aSubject, const char *aTopic,
 }
 
 NS_IMETHODIMP
-nsCookieService::GetCookieString(nsIURI *aHostURI, nsIChannel *aChannel,
-                                 char **aCookie) {
+nsCookieService::GetCookieString(nsIURI* aHostURI, nsIChannel* aChannel,
+                                 char** aCookie) {
   return GetCookieStringCommon(aHostURI, aChannel, false, aCookie);
 }
 
 NS_IMETHODIMP
-nsCookieService::GetCookieStringFromHttp(nsIURI *aHostURI, nsIURI *aFirstURI,
-                                         nsIChannel *aChannel, char **aCookie) {
+nsCookieService::GetCookieStringFromHttp(nsIURI* aHostURI, nsIURI* aFirstURI,
+                                         nsIChannel* aChannel, char** aCookie) {
   return GetCookieStringCommon(aHostURI, aChannel, true, aCookie);
 }
 
-nsresult nsCookieService::GetCookieStringCommon(nsIURI *aHostURI,
-                                                nsIChannel *aChannel,
+nsresult nsCookieService::GetCookieStringCommon(nsIURI* aHostURI,
+                                                nsIChannel* aChannel,
                                                 bool aHttpBound,
-                                                char **aCookie) {
+                                                char** aCookie) {
   NS_ENSURE_ARG(aHostURI);
   NS_ENSURE_ARG(aCookie);
 
@@ -2006,7 +2006,7 @@ nsresult nsCookieService::GetCookieStringCommon(nsIURI *aHostURI,
 
 // static
 already_AddRefed nsCookieService::GetCookieSettings(
-    nsIChannel *aChannel) {
+    nsIChannel* aChannel) {
   nsCOMPtr cookieSettings;
   if (aChannel) {
     nsCOMPtr loadInfo = aChannel->LoadInfo();
@@ -2023,9 +2023,9 @@ already_AddRefed nsCookieService::GetCookieSettings(
 }
 
 NS_IMETHODIMP
-nsCookieService::SetCookieString(nsIURI *aHostURI, nsIPrompt *aPrompt,
-                                 const char *aCookieHeader,
-                                 nsIChannel *aChannel) {
+nsCookieService::SetCookieString(nsIURI* aHostURI, nsIPrompt* aPrompt,
+                                 const char* aCookieHeader,
+                                 nsIChannel* aChannel) {
   // The aPrompt argument is deprecated and unused.  Avoid introducing new
   // code that uses this argument by warning if the value is non-null.
   MOZ_ASSERT(!aPrompt);
@@ -2042,11 +2042,11 @@ nsCookieService::SetCookieString(nsIURI *aHostURI, nsIPrompt *aPrompt,
 }
 
 NS_IMETHODIMP
-nsCookieService::SetCookieStringFromHttp(nsIURI *aHostURI, nsIURI *aFirstURI,
-                                         nsIPrompt *aPrompt,
-                                         const char *aCookieHeader,
-                                         const char *aServerTime,
-                                         nsIChannel *aChannel) {
+nsCookieService::SetCookieStringFromHttp(nsIURI* aHostURI, nsIURI* aFirstURI,
+                                         nsIPrompt* aPrompt,
+                                         const char* aCookieHeader,
+                                         const char* aServerTime,
+                                         nsIChannel* aChannel) {
   // The aPrompt argument is deprecated and unused.  Avoid introducing new
   // code that uses this argument by warning if the value is non-null.
   MOZ_ASSERT(!aPrompt);
@@ -2062,7 +2062,7 @@ nsCookieService::SetCookieStringFromHttp(nsIURI *aHostURI, nsIURI *aFirstURI,
                                true);
 }
 
-int64_t nsCookieService::ParseServerTime(const nsCString &aServerTime) {
+int64_t nsCookieService::ParseServerTime(const nsCString& aServerTime) {
   // parse server local time. this is not just done here for efficiency
   // reasons - if there's an error parsing it, and we need to default it
   // to the current time, we must do it here since the current time in
@@ -2081,10 +2081,10 @@ int64_t nsCookieService::ParseServerTime(const nsCString &aServerTime) {
   return serverTime;
 }
 
-nsresult nsCookieService::SetCookieStringCommon(nsIURI *aHostURI,
-                                                const char *aCookieHeader,
-                                                const char *aServerTime,
-                                                nsIChannel *aChannel,
+nsresult nsCookieService::SetCookieStringCommon(nsIURI* aHostURI,
+                                                const char* aCookieHeader,
+                                                const char* aServerTime,
+                                                nsIChannel* aChannel,
                                                 bool aFromHttp) {
   NS_ENSURE_ARG(aHostURI);
   NS_ENSURE_ARG(aCookieHeader);
@@ -2123,10 +2123,10 @@ nsresult nsCookieService::SetCookieStringCommon(nsIURI *aHostURI,
 }
 
 void nsCookieService::SetCookieStringInternal(
-    nsIURI *aHostURI, bool aIsForeign, bool aIsTrackingResource,
-    bool aFirstPartyStorageAccessGranted, nsDependentCString &aCookieHeader,
-    const nsCString &aServerTime, bool aFromHttp,
-    const OriginAttributes &aOriginAttrs, nsIChannel *aChannel) {
+    nsIURI* aHostURI, bool aIsForeign, bool aIsTrackingResource,
+    bool aFirstPartyStorageAccessGranted, nsDependentCString& aCookieHeader,
+    const nsCString& aServerTime, bool aFromHttp,
+    const OriginAttributes& aOriginAttrs, nsIChannel* aChannel) {
   NS_ASSERTION(aHostURI, "null host!");
 
   if (!mDBState) {
@@ -2136,7 +2136,7 @@ void nsCookieService::SetCookieStringInternal(
 
   EnsureReadComplete(true);
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState =
       (aOriginAttrs.mPrivateBrowsingId > 0) ? mPrivateDBState : mDefaultDBState;
 
@@ -2203,13 +2203,13 @@ void nsCookieService::SetCookieStringInternal(
   }
 }
 
-void nsCookieService::NotifyAccepted(nsIChannel *aChannel) {
+void nsCookieService::NotifyAccepted(nsIChannel* aChannel) {
   AntiTrackingCommon::NotifyBlockingDecision(
       aChannel, AntiTrackingCommon::BlockingDecision::eAllow, 0);
 }
 
 // notify observers that a cookie was rejected due to the users' prefs.
-void nsCookieService::NotifyRejected(nsIURI *aHostURI, nsIChannel *aChannel,
+void nsCookieService::NotifyRejected(nsIURI* aHostURI, nsIChannel* aChannel,
                                      uint32_t aRejectedReason,
                                      CookieOperation aOperation) {
   if (aOperation == OPERATION_WRITE) {
@@ -2227,14 +2227,14 @@ void nsCookieService::NotifyRejected(nsIURI *aHostURI, nsIChannel *aChannel,
 
 // notify observers that a third-party cookie was accepted/rejected
 // if the cookie issuer is unknown, it defaults to "?"
-void nsCookieService::NotifyThirdParty(nsIURI *aHostURI, bool aIsAccepted,
-                                       nsIChannel *aChannel) {
+void nsCookieService::NotifyThirdParty(nsIURI* aHostURI, bool aIsAccepted,
+                                       nsIChannel* aChannel) {
   nsCOMPtr os = mozilla::services::GetObserverService();
   if (!os) {
     return;
   }
 
-  const char *topic;
+  const char* topic;
 
   if (mDBState != mPrivateDBState) {
     // Regular (non-private) browsing
@@ -2286,10 +2286,10 @@ void nsCookieService::NotifyThirdParty(nsIURI *aHostURI, bool aIsAccepted,
 // "cleared" means the entire cookie list was cleared. aSubject is null.
 // "batch-deleted" means a set of cookies was purged. aSubject is the list of
 // cookies.
-void nsCookieService::NotifyChanged(nsISupports *aSubject,
-                                    const char16_t *aData,
+void nsCookieService::NotifyChanged(nsISupports* aSubject,
+                                    const char16_t* aData,
                                     bool aOldCookieIsSession, bool aFromHttp) {
-  const char *topic =
+  const char* topic =
       mDBState == mPrivateDBState ? "private-cookie-changed" : "cookie-changed";
   nsCOMPtr os = mozilla::services::GetObserverService();
   if (!os) {
@@ -2310,7 +2310,7 @@ void nsCookieService::NotifyChanged(nsISupports *aSubject,
       NS_LITERAL_STRING("added").Equals(aData)) {
     nsCOMPtr xpcCookie = do_QueryInterface(aSubject);
     MOZ_ASSERT(xpcCookie);
-    auto cookie = static_cast(xpcCookie.get());
+    auto cookie = static_cast(xpcCookie.get());
     if (!cookie->IsSession() && !aOldCookieIsSession) {
       return;
     }
@@ -2319,15 +2319,15 @@ void nsCookieService::NotifyChanged(nsISupports *aSubject,
 }
 
 already_AddRefed nsCookieService::CreatePurgeList(
-    nsICookie2 *aCookie) {
+    nsICookie2* aCookie) {
   nsCOMPtr removedList =
       do_CreateInstance(NS_ARRAY_CONTRACTID);
   removedList->AppendElement(aCookie);
   return removedList.forget();
 }
 
-void nsCookieService::CreateOrUpdatePurgeList(nsIArray **aPurgedList,
-                                              nsICookie2 *aCookie) {
+void nsCookieService::CreateOrUpdatePurgeList(nsIArray** aPurgedList,
+                                              nsICookie2* aCookie) {
   if (!*aPurgedList) {
     COOKIE_LOGSTRING(LogLevel::Debug, ("Creating new purge list"));
     nsCOMPtr purgedList = CreatePurgeList(aCookie);
@@ -2350,7 +2350,7 @@ void nsCookieService::CreateOrUpdatePurgeList(nsIArray **aPurgedList,
  ******************************************************************************/
 
 NS_IMETHODIMP
-nsCookieService::RunInTransaction(nsICookieTransactionCallback *aCallback) {
+nsCookieService::RunInTransaction(nsICookieTransactionCallback* aCallback) {
   NS_ENSURE_ARG(aCallback);
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
@@ -2376,7 +2376,7 @@ nsCookieService::RunInTransaction(nsICookieTransactionCallback *aCallback) {
  * pref observer impl
  ******************************************************************************/
 
-void nsCookieService::PrefChanged(nsIPrefBranch *aPrefBranch) {
+void nsCookieService::PrefChanged(nsIPrefBranch* aPrefBranch) {
   int32_t val;
   if (NS_SUCCEEDED(aPrefBranch->GetIntPref(kPrefMaxNumberOfCookies, &val)))
     mMaxNumberOfCookies = (uint16_t)LIMIT(val, 1, 0xFFFF, kMaxNumberOfCookies);
@@ -2447,7 +2447,7 @@ nsCookieService::RemoveAll() {
 }
 
 NS_IMETHODIMP
-nsCookieService::GetEnumerator(nsISimpleEnumerator **aEnumerator) {
+nsCookieService::GetEnumerator(nsISimpleEnumerator** aEnumerator) {
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
@@ -2457,7 +2457,7 @@ nsCookieService::GetEnumerator(nsISimpleEnumerator **aEnumerator) {
 
   nsCOMArray cookieList(mDBState->cookieCount);
   for (auto iter = mDBState->hostTable.Iter(); !iter.Done(); iter.Next()) {
-    const nsCookieEntry::ArrayType &cookies = iter.Get()->GetCookies();
+    const nsCookieEntry::ArrayType& cookies = iter.Get()->GetCookies();
     for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
       cookieList.AppendObject(cookies[i]);
     }
@@ -2467,7 +2467,7 @@ nsCookieService::GetEnumerator(nsISimpleEnumerator **aEnumerator) {
 }
 
 NS_IMETHODIMP
-nsCookieService::GetSessionEnumerator(nsISimpleEnumerator **aEnumerator) {
+nsCookieService::GetSessionEnumerator(nsISimpleEnumerator** aEnumerator) {
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
@@ -2477,9 +2477,9 @@ nsCookieService::GetSessionEnumerator(nsISimpleEnumerator **aEnumerator) {
 
   nsCOMArray cookieList(mDBState->cookieCount);
   for (auto iter = mDBState->hostTable.Iter(); !iter.Done(); iter.Next()) {
-    const nsCookieEntry::ArrayType &cookies = iter.Get()->GetCookies();
+    const nsCookieEntry::ArrayType& cookies = iter.Get()->GetCookies();
     for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
-      nsCookie *cookie = cookies[i];
+      nsCookie* cookie = cookies[i];
       // Filter out non-session cookies.
       if (cookie->IsSession()) {
         cookieList.AppendObject(cookie);
@@ -2491,11 +2491,11 @@ nsCookieService::GetSessionEnumerator(nsISimpleEnumerator **aEnumerator) {
 }
 
 NS_IMETHODIMP
-nsCookieService::Add(const nsACString &aHost, const nsACString &aPath,
-                     const nsACString &aName, const nsACString &aValue,
+nsCookieService::Add(const nsACString& aHost, const nsACString& aPath,
+                     const nsACString& aName, const nsACString& aValue,
                      bool aIsSecure, bool aIsHttpOnly, bool aIsSession,
                      int64_t aExpiry, JS::HandleValue aOriginAttributes,
-                     int32_t aSameSite, JSContext *aCx) {
+                     int32_t aSameSite, JSContext* aCx) {
   OriginAttributes attrs;
 
   if (!aOriginAttributes.isObject() || !attrs.Init(aCx, aOriginAttributes)) {
@@ -2507,10 +2507,10 @@ nsCookieService::Add(const nsACString &aHost, const nsACString &aPath,
 }
 
 NS_IMETHODIMP_(nsresult)
-nsCookieService::AddNative(const nsACString &aHost, const nsACString &aPath,
-                           const nsACString &aName, const nsACString &aValue,
+nsCookieService::AddNative(const nsACString& aHost, const nsACString& aPath,
+                           const nsACString& aName, const nsACString& aValue,
                            bool aIsSecure, bool aIsHttpOnly, bool aIsSession,
-                           int64_t aExpiry, OriginAttributes *aOriginAttributes,
+                           int64_t aExpiry, OriginAttributes* aOriginAttributes,
                            int32_t aSameSite) {
   if (NS_WARN_IF(!aOriginAttributes)) {
     return NS_ERROR_FAILURE;
@@ -2523,7 +2523,7 @@ nsCookieService::AddNative(const nsACString &aHost, const nsACString &aPath,
 
   EnsureReadComplete(true);
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState = (aOriginAttributes->mPrivateBrowsingId > 0) ? mPrivateDBState
                                                          : mDefaultDBState;
 
@@ -2553,10 +2553,10 @@ nsCookieService::AddNative(const nsACString &aHost, const nsACString &aPath,
   return NS_OK;
 }
 
-nsresult nsCookieService::Remove(const nsACString &aHost,
-                                 const OriginAttributes &aAttrs,
-                                 const nsACString &aName,
-                                 const nsACString &aPath, bool aBlocked) {
+nsresult nsCookieService::Remove(const nsACString& aHost,
+                                 const OriginAttributes& aAttrs,
+                                 const nsACString& aName,
+                                 const nsACString& aPath, bool aBlocked) {
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
@@ -2564,7 +2564,7 @@ nsresult nsCookieService::Remove(const nsACString &aHost,
 
   EnsureReadComplete(true);
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState =
       (aAttrs.mPrivateBrowsingId > 0) ? mPrivateDBState : mDefaultDBState;
 
@@ -2609,9 +2609,9 @@ nsresult nsCookieService::Remove(const nsACString &aHost,
 }
 
 NS_IMETHODIMP
-nsCookieService::Remove(const nsACString &aHost, const nsACString &aName,
-                        const nsACString &aPath, bool aBlocked,
-                        JS::HandleValue aOriginAttributes, JSContext *aCx) {
+nsCookieService::Remove(const nsACString& aHost, const nsACString& aName,
+                        const nsACString& aPath, bool aBlocked,
+                        JS::HandleValue aOriginAttributes, JSContext* aCx) {
   OriginAttributes attrs;
 
   if (!aOriginAttributes.isObject() || !attrs.Init(aCx, aOriginAttributes)) {
@@ -2622,9 +2622,9 @@ nsCookieService::Remove(const nsACString &aHost, const nsACString &aName,
 }
 
 NS_IMETHODIMP_(nsresult)
-nsCookieService::RemoveNative(const nsACString &aHost, const nsACString &aName,
-                              const nsACString &aPath, bool aBlocked,
-                              OriginAttributes *aOriginAttributes) {
+nsCookieService::RemoveNative(const nsACString& aHost, const nsACString& aName,
+                              const nsACString& aPath, bool aBlocked,
+                              OriginAttributes* aOriginAttributes) {
   if (NS_WARN_IF(!aOriginAttributes)) {
     return NS_ERROR_FAILURE;
   }
@@ -2644,7 +2644,7 @@ nsCookieService::RemoveNative(const nsACString &aHost, const nsACString &aName,
 
 // Extract data from a single result row and create an nsCookie.
 mozilla::UniquePtr nsCookieService::GetCookieFromRow(
-    mozIStorageStatement *aRow, const OriginAttributes &aOriginAttributes) {
+    mozIStorageStatement* aRow, const OriginAttributes& aOriginAttributes) {
   // Skip reading 'baseDomain' -- up to the caller.
   nsCString name, value, host, path;
   DebugOnly rv = aRow->GetUTF8String(IDX_NAME, name);
@@ -2775,7 +2775,7 @@ OpenDBResult nsCookieService::Read() {
     Unused << attrs.PopulateFromSuffix(suffix);
 
     nsCookieKey key(baseDomain, attrs);
-    CookieDomainTuple *tuple = mReadArray.AppendElement();
+    CookieDomainTuple* tuple = mReadArray.AppendElement();
     tuple->key = std::move(key);
     tuple->cookie = GetCookieFromRow(stmt, attrs);
   }
@@ -2787,7 +2787,7 @@ OpenDBResult nsCookieService::Read() {
 }
 
 NS_IMETHODIMP
-nsCookieService::ImportCookies(nsIFile *aCookieFile) {
+nsCookieService::ImportCookies(nsIFile* aCookieFile) {
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
@@ -2894,7 +2894,7 @@ nsCookieService::ImportCookies(nsIFile *aCookieFile) {
 
     isDomain = Substring(buffer, isDomainIndex, pathIndex - isDomainIndex - 1)
                    .EqualsLiteral(kTrue);
-    const nsACString &host =
+    const nsACString& host =
         Substring(buffer, hostIndex, isDomainIndex - hostIndex - 1);
     // check for bad legacy cookies (domain not starting with a dot, or
     // containing a port), and discard
@@ -2968,8 +2968,8 @@ static inline bool ispathdelimiter(char c) {
   return c == '/' || c == '?' || c == '#' || c == ';';
 }
 
-bool nsCookieService::DomainMatches(nsCookie *aCookie,
-                                    const nsACString &aHost) {
+bool nsCookieService::DomainMatches(nsCookie* aCookie,
+                                    const nsACString& aHost) {
   // first, check for an exact host or domain cookie match, e.g. "google.com"
   // or ".google.com"; second a subdomain match, e.g.
   // host = "mail.google.com", cookie domain = ".google.com".
@@ -2987,7 +2987,7 @@ bool nsCookieService::IsSameSiteEnabled() {
   return sSameSiteEnabled;
 }
 
-bool nsCookieService::PathMatches(nsCookie *aCookie, const nsACString &aPath) {
+bool nsCookieService::PathMatches(nsCookie* aCookie, const nsACString& aPath) {
   // calculate cookie path length, excluding trailing '/'
   uint32_t cookiePathLen = aCookie->Path().Length();
   if (cookiePathLen > 0 && aCookie->Path().Last() == '/') --cookiePathLen;
@@ -3018,10 +3018,10 @@ bool nsCookieService::PathMatches(nsCookie *aCookie, const nsACString &aPath) {
 }
 
 void nsCookieService::GetCookiesForURI(
-    nsIURI *aHostURI, nsIChannel *aChannel, bool aIsForeign,
+    nsIURI* aHostURI, nsIChannel* aChannel, bool aIsForeign,
     bool aIsTrackingResource, bool aFirstPartyStorageAccessGranted,
     bool aIsSafeTopLevelNav, bool aIsSameSiteForeign, bool aHttpBound,
-    const OriginAttributes &aOriginAttrs, nsTArray &aCookieList) {
+    const OriginAttributes& aOriginAttrs, nsTArray& aCookieList) {
   NS_ASSERTION(aHostURI, "null host!");
 
   if (!mDBState) {
@@ -3031,7 +3031,7 @@ void nsCookieService::GetCookiesForURI(
 
   EnsureReadComplete(true);
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState =
       (aOriginAttrs.mPrivateBrowsingId > 0) ? mPrivateDBState : mDefaultDBState;
 
@@ -3088,7 +3088,7 @@ void nsCookieService::GetCookiesForURI(
     isSecure = false;
   }
 
-  nsCookie *cookie;
+  nsCookie* cookie;
   int64_t currentTimeInUsec = PR_Now();
   int64_t currentTime = currentTimeInUsec / PR_USEC_PER_SEC;
   bool stale = false;
@@ -3096,11 +3096,11 @@ void nsCookieService::GetCookiesForURI(
   nsCookieKey key(baseDomain, aOriginAttrs);
 
   // perform the hash lookup
-  nsCookieEntry *entry = mDBState->hostTable.GetEntry(key);
+  nsCookieEntry* entry = mDBState->hostTable.GetEntry(key);
   if (!entry) return;
 
   // iterate the cookies!
-  const nsCookieEntry::ArrayType &cookies = entry->GetCookies();
+  const nsCookieEntry::ArrayType& cookies = entry->GetCookies();
   for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
     cookie = cookies[i];
 
@@ -3158,7 +3158,7 @@ void nsCookieService::GetCookiesForURI(
     // Create an array of parameters to bind to our update statement. Batching
     // is OK here since we're updating cookies with no interleaved operations.
     nsCOMPtr paramsArray;
-    mozIStorageAsyncStatement *stmt = mDBState->stmtUpdate;
+    mozIStorageAsyncStatement* stmt = mDBState->stmtUpdate;
     if (mDBState->dbConn) {
       stmt->NewBindingParamsArray(getter_AddRefs(paramsArray));
     }
@@ -3192,17 +3192,17 @@ void nsCookieService::GetCookiesForURI(
 }
 
 void nsCookieService::GetCookieStringInternal(
-    nsIURI *aHostURI, nsIChannel *aChannel, bool aIsForeign,
+    nsIURI* aHostURI, nsIChannel* aChannel, bool aIsForeign,
     bool aIsTrackingResource, bool aFirstPartyStorageAccessGranted,
     bool aIsSafeTopLevelNav, bool aIsSameSiteForeign, bool aHttpBound,
-    const OriginAttributes &aOriginAttrs, nsCString &aCookieString) {
-  AutoTArray foundCookieList;
+    const OriginAttributes& aOriginAttrs, nsCString& aCookieString) {
+  AutoTArray foundCookieList;
   GetCookiesForURI(aHostURI, aChannel, aIsForeign, aIsTrackingResource,
                    aFirstPartyStorageAccessGranted, aIsSafeTopLevelNav,
                    aIsSameSiteForeign, aHttpBound, aOriginAttrs,
                    foundCookieList);
 
-  nsCookie *cookie;
+  nsCookie* cookie;
   for (uint32_t i = 0; i < foundCookieList.Length(); ++i) {
     cookie = foundCookieList.ElementAt(i);
 
@@ -3231,13 +3231,13 @@ void nsCookieService::GetCookieStringInternal(
 
 // processes a single cookie, and returns true if there are more cookies
 // to be processed
-bool nsCookieService::CanSetCookie(nsIURI *aHostURI, const nsCookieKey &aKey,
-                                   nsCookieAttributes &aCookieAttributes,
+bool nsCookieService::CanSetCookie(nsIURI* aHostURI, const nsCookieKey& aKey,
+                                   nsCookieAttributes& aCookieAttributes,
                                    bool aRequireHostMatch, CookieStatus aStatus,
-                                   nsDependentCString &aCookieHeader,
+                                   nsDependentCString& aCookieHeader,
                                    int64_t aServerTime, bool aFromHttp,
-                                   nsIChannel *aChannel, bool &aSetCookie,
-                                   mozIThirdPartyUtil *aThirdPartyUtil) {
+                                   nsIChannel* aChannel, bool& aSetCookie,
+                                   mozIThirdPartyUtil* aThirdPartyUtil) {
   NS_ASSERTION(aHostURI, "null host!");
 
   aSetCookie = false;
@@ -3403,13 +3403,13 @@ bool nsCookieService::CanSetCookie(nsIURI *aHostURI, const nsCookieKey &aKey,
 
 // processes a single cookie, and returns true if there are more cookies
 // to be processed
-bool nsCookieService::SetCookieInternal(nsIURI *aHostURI,
-                                        const mozilla::net::nsCookieKey &aKey,
+bool nsCookieService::SetCookieInternal(nsIURI* aHostURI,
+                                        const mozilla::net::nsCookieKey& aKey,
                                         bool aRequireHostMatch,
                                         CookieStatus aStatus,
-                                        nsDependentCString &aCookieHeader,
+                                        nsDependentCString& aCookieHeader,
                                         int64_t aServerTime, bool aFromHttp,
-                                        nsIChannel *aChannel) {
+                                        nsIChannel* aChannel) {
   NS_ASSERTION(aHostURI, "null host!");
   bool canSetCookie = false;
   nsDependentCString savedCookieHeader(aCookieHeader);
@@ -3440,7 +3440,7 @@ bool nsCookieService::SetCookieInternal(nsIURI *aHostURI,
     bool permission;
     mPermissionService->CanSetCookie(
         aHostURI, aChannel,
-        static_cast(static_cast(cookie)),
+        static_cast(static_cast(cookie)),
         &cookieAttributes.isSession, &cookieAttributes.expiryTime, &permission);
     if (!permission) {
       COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, savedCookieHeader,
@@ -3470,9 +3470,9 @@ bool nsCookieService::SetCookieInternal(nsIURI *aHostURI,
 // it either replaces an existing cookie; or adds the cookie to the hashtable,
 // and deletes a cookie (if maximum number of cookies has been
 // reached). also performs list maintenance by removing expired cookies.
-void nsCookieService::AddInternal(const nsCookieKey &aKey, nsCookie *aCookie,
-                                  int64_t aCurrentTimeInUsec, nsIURI *aHostURI,
-                                  const char *aCookieHeader, bool aFromHttp) {
+void nsCookieService::AddInternal(const nsCookieKey& aKey, nsCookie* aCookie,
+                                  int64_t aCurrentTimeInUsec, nsIURI* aHostURI,
+                                  const char* aCookieHeader, bool aFromHttp) {
   MOZ_ASSERT(mInitializedDBStates);
   MOZ_ASSERT(mInitializedDBConn);
 
@@ -3589,7 +3589,7 @@ void nsCookieService::AddInternal(const nsCookieKey &aKey, nsCookie *aCookie,
     }
 
     // check if we have to delete an old cookie.
-    nsCookieEntry *entry = mDBState->hostTable.GetEntry(aKey);
+    nsCookieEntry* entry = mDBState->hostTable.GetEntry(aKey);
     if (entry && entry->GetCookies().Length() >= mMaxCookiesPerHost) {
       nsTArray removedIterList;
       // Prioritize evicting insecure cookies.
@@ -3739,11 +3739,11 @@ static inline bool istokenseparator(char c) {
 
 // Parse a single token/value pair.
 // Returns true if a cookie terminator is found, so caller can parse new cookie.
-bool nsCookieService::GetTokenValue(nsACString::const_char_iterator &aIter,
-                                    nsACString::const_char_iterator &aEndIter,
-                                    nsDependentCSubstring &aTokenString,
-                                    nsDependentCSubstring &aTokenValue,
-                                    bool &aEqualsFound) {
+bool nsCookieService::GetTokenValue(nsACString::const_char_iterator& aIter,
+                                    nsACString::const_char_iterator& aEndIter,
+                                    nsDependentCSubstring& aTokenString,
+                                    nsDependentCSubstring& aTokenValue,
+                                    bool& aEqualsFound) {
   nsACString::const_char_iterator start, lastSpace;
   // initialize value string to clear garbage
   aTokenValue.Rebind(aIter, aIter);
@@ -3797,8 +3797,8 @@ bool nsCookieService::GetTokenValue(nsACString::const_char_iterator &aIter,
 // Parses attributes from cookie header. expires/max-age attributes aren't
 // folded into the cookie struct here, because we don't know which one to use
 // until we've parsed the header.
-bool nsCookieService::ParseAttributes(nsDependentCString &aCookieHeader,
-                                      nsCookieAttributes &aCookieAttributes) {
+bool nsCookieService::ParseAttributes(nsDependentCString& aCookieHeader,
+                                      nsCookieAttributes& aCookieAttributes) {
   static const char kPath[] = "path";
   static const char kDomain[] = "domain";
   static const char kExpires[] = "expires";
@@ -3893,10 +3893,10 @@ bool nsCookieService::ParseAttributes(nsDependentCString &aCookieHeader,
 // 'localhost', an eTLD such as 'co.uk', or the empty string, aBaseDomain will
 // be the exact host, and aRequireHostMatch will be true to indicate that
 // substring matches should not be performed.
-nsresult nsCookieService::GetBaseDomain(nsIEffectiveTLDService *aTLDService,
-                                        nsIURI *aHostURI,
-                                        nsCString &aBaseDomain,
-                                        bool &aRequireHostMatch) {
+nsresult nsCookieService::GetBaseDomain(nsIEffectiveTLDService* aTLDService,
+                                        nsIURI* aHostURI,
+                                        nsCString& aBaseDomain,
+                                        bool& aRequireHostMatch) {
   // get the base domain. this will fail if the host contains a leading dot,
   // more than one trailing dot, or is otherwise malformed.
   nsresult rv = aTLDService->GetBaseDomain(aHostURI, 0, aBaseDomain);
@@ -3932,8 +3932,8 @@ nsresult nsCookieService::GetBaseDomain(nsIEffectiveTLDService *aTLDService,
 // 'co.uk', or the empty string, aBaseDomain will be the exact host, and a
 // leading dot will be treated as an error.
 nsresult nsCookieService::GetBaseDomainFromHost(
-    nsIEffectiveTLDService *aTLDService, const nsACString &aHost,
-    nsCString &aBaseDomain) {
+    nsIEffectiveTLDService* aTLDService, const nsACString& aHost,
+    nsCString& aBaseDomain) {
   // aHost must not be the string '.'.
   if (aHost.Length() == 1 && aHost.Last() == '.') return NS_ERROR_INVALID_ARG;
 
@@ -3961,7 +3961,7 @@ nsresult nsCookieService::GetBaseDomainFromHost(
 // Normalizes the given hostname, component by component. ASCII/ACE
 // components are lower-cased, and UTF-8 components are normalized per
 // RFC 3454 and converted to ACE.
-nsresult nsCookieService::NormalizeHost(nsCString &aHost) {
+nsresult nsCookieService::NormalizeHost(nsCString& aHost) {
   if (!IsASCII(aHost)) {
     nsAutoCString host;
     nsresult rv = mIDNService->ConvertUTF8toACE(aHost, host);
@@ -3976,7 +3976,7 @@ nsresult nsCookieService::NormalizeHost(nsCString &aHost) {
 
 // returns true if 'a' is equal to or a subdomain of 'b',
 // assuming no leading dots are present.
-static inline bool IsSubdomainOf(const nsCString &a, const nsCString &b) {
+static inline bool IsSubdomainOf(const nsCString& a, const nsCString& b) {
   if (a == b) return true;
   if (a.Length() > b.Length())
     return a[a.Length() - b.Length() - 1] == '.' && StringEndsWith(a, b);
@@ -3984,11 +3984,11 @@ static inline bool IsSubdomainOf(const nsCString &a, const nsCString &b) {
 }
 
 CookieStatus nsCookieService::CheckPrefs(
-    nsICookieSettings *aCookieSettings, bool aThirdPartySession,
-    bool aThirdPartyNonsecureSession, nsIURI *aHostURI, bool aIsForeign,
+    nsICookieSettings* aCookieSettings, bool aThirdPartySession,
+    bool aThirdPartyNonsecureSession, nsIURI* aHostURI, bool aIsForeign,
     bool aIsTrackingResource, bool aFirstPartyStorageAccessGranted,
-    const char *aCookieHeader, const int aNumOfCookies,
-    const OriginAttributes &aOriginAttrs, uint32_t *aRejectedReason) {
+    const char* aCookieHeader, const int aNumOfCookies,
+    const OriginAttributes& aOriginAttrs, uint32_t* aRejectedReason) {
   nsresult rv;
 
   // Let's use a internal value in order to avoid a null check on
@@ -4102,9 +4102,9 @@ CookieStatus nsCookieService::CheckPrefs(
 
 // processes domain attribute, and returns true if host has permission to set
 // for this domain.
-bool nsCookieService::CheckDomain(nsCookieAttributes &aCookieAttributes,
-                                  nsIURI *aHostURI,
-                                  const nsCString &aBaseDomain,
+bool nsCookieService::CheckDomain(nsCookieAttributes& aCookieAttributes,
+                                  nsIURI* aHostURI,
+                                  const nsCString& aBaseDomain,
                                   bool aRequireHostMatch) {
   // Note: The logic in this function is mirrored in
   // toolkit/components/extensions/ext-cookies.js:checkSetCookiePermissions().
@@ -4157,7 +4157,7 @@ bool nsCookieService::CheckDomain(nsCookieAttributes &aCookieAttributes,
   return true;
 }
 
-nsAutoCString nsCookieService::GetPathFromURI(nsIURI *aHostURI) {
+nsAutoCString nsCookieService::GetPathFromURI(nsIURI* aHostURI) {
   // strip down everything after the last slash to get the path,
   // ignoring slashes in the query string part.
   // if we can QI to nsIURL, that'll take care of the query string portion.
@@ -4177,8 +4177,8 @@ nsAutoCString nsCookieService::GetPathFromURI(nsIURI *aHostURI) {
   return path;
 }
 
-bool nsCookieService::CheckPath(nsCookieAttributes &aCookieAttributes,
-                                nsIURI *aHostURI) {
+bool nsCookieService::CheckPath(nsCookieAttributes& aCookieAttributes,
+                                nsIURI* aHostURI) {
   // if a path is given, check the host has permission
   if (aCookieAttributes.path.IsEmpty() ||
       aCookieAttributes.path.First() != '/') {
@@ -4216,7 +4216,7 @@ bool nsCookieService::CheckPath(nsCookieAttributes &aCookieAttributes,
 //
 // Must not be called until after CheckDomain() and CheckPath() have
 // regularized and validated the nsCookieAttributes values!
-bool nsCookieService::CheckPrefixes(nsCookieAttributes &aCookieAttributes,
+bool nsCookieService::CheckPrefixes(nsCookieAttributes& aCookieAttributes,
                                     bool aSecureRequest) {
   static const char kSecure[] = "__Secure-";
   static const char kHost[] = "__Host-";
@@ -4254,7 +4254,7 @@ bool nsCookieService::CheckPrefixes(nsCookieAttributes &aCookieAttributes,
   return true;
 }
 
-bool nsCookieService::GetExpiry(nsCookieAttributes &aCookieAttributes,
+bool nsCookieService::GetExpiry(nsCookieAttributes& aCookieAttributes,
                                 int64_t aServerTime, int64_t aCurrentTime,
                                 bool aFromHttp) {
   // maxageCap is in seconds.
@@ -4338,12 +4338,12 @@ void nsCookieService::RemoveAllFromMemory() {
 // comparator class for lastaccessed times of cookies.
 class CompareCookiesByAge {
  public:
-  bool Equals(const nsListIter &a, const nsListIter &b) const {
+  bool Equals(const nsListIter& a, const nsListIter& b) const {
     return a.Cookie()->LastAccessed() == b.Cookie()->LastAccessed() &&
            a.Cookie()->CreationTime() == b.Cookie()->CreationTime();
   }
 
-  bool LessThan(const nsListIter &a, const nsListIter &b) const {
+  bool LessThan(const nsListIter& a, const nsListIter& b) const {
     // compare by lastAccessed time, and tiebreak by creationTime.
     int64_t result = a.Cookie()->LastAccessed() - b.Cookie()->LastAccessed();
     if (result != 0) return result < 0;
@@ -4372,7 +4372,7 @@ already_AddRefed nsCookieService::PurgeCookies(
 
   // Create a params array to batch the removals. This is OK here because
   // all the removals are in order, and there are no interleaved additions.
-  mozIStorageAsyncStatement *stmt = mDBState->stmtDelete;
+  mozIStorageAsyncStatement* stmt = mDBState->stmtDelete;
   nsCOMPtr paramsArray;
   if (mDBState->dbConn) {
     stmt->NewBindingParamsArray(getter_AddRefs(paramsArray));
@@ -4383,13 +4383,13 @@ already_AddRefed nsCookieService::PurgeCookies(
   int64_t oldestTime = INT64_MAX;
 
   for (auto iter = mDBState->hostTable.Iter(); !iter.Done(); iter.Next()) {
-    nsCookieEntry *entry = iter.Get();
+    nsCookieEntry* entry = iter.Get();
 
-    const nsCookieEntry::ArrayType &cookies = entry->GetCookies();
+    const nsCookieEntry::ArrayType& cookies = entry->GetCookies();
     auto length = cookies.Length();
     for (nsCookieEntry::IndexType i = 0; i < length;) {
       nsListIter iter(entry, i);
-      nsCookie *cookie = cookies[i];
+      nsCookie* cookie = cookies[i];
 
       // check if the cookie has expired
       if (cookie->Expiry() <= currentTime) {
@@ -4440,7 +4440,7 @@ already_AddRefed nsCookieService::PurgeCookies(
   // over the list removing cookies, without having to adjust indexes as we go.
   purgeList.Sort(CompareCookiesByIndex());
   for (PurgeList::index_type i = purgeList.Length(); i--;) {
-    nsCookie *cookie = purgeList[i].Cookie();
+    nsCookie* cookie = purgeList[i].Cookie();
     removedList->AppendElement(cookie);
     COOKIE_LOGEVICTED(cookie, "Cookie too old");
 
@@ -4477,10 +4477,10 @@ already_AddRefed nsCookieService::PurgeCookies(
 // find whether a given cookie has been previously set. this is provided by the
 // nsICookieManager interface.
 NS_IMETHODIMP
-nsCookieService::CookieExists(const nsACString &aHost, const nsACString &aPath,
-                              const nsACString &aName,
-                              JS::HandleValue aOriginAttributes, JSContext *aCx,
-                              bool *aFoundCookie) {
+nsCookieService::CookieExists(const nsACString& aHost, const nsACString& aPath,
+                              const nsACString& aName,
+                              JS::HandleValue aOriginAttributes, JSContext* aCx,
+                              bool* aFoundCookie) {
   NS_ENSURE_ARG_POINTER(aCx);
   NS_ENSURE_ARG_POINTER(aFoundCookie);
 
@@ -4492,11 +4492,11 @@ nsCookieService::CookieExists(const nsACString &aHost, const nsACString &aPath,
 }
 
 NS_IMETHODIMP_(nsresult)
-nsCookieService::CookieExistsNative(const nsACString &aHost,
-                                    const nsACString &aPath,
-                                    const nsACString &aName,
-                                    OriginAttributes *aOriginAttributes,
-                                    bool *aFoundCookie) {
+nsCookieService::CookieExistsNative(const nsACString& aHost,
+                                    const nsACString& aPath,
+                                    const nsACString& aName,
+                                    OriginAttributes* aOriginAttributes,
+                                    bool* aFoundCookie) {
   NS_ENSURE_ARG_POINTER(aOriginAttributes);
   NS_ENSURE_ARG_POINTER(aFoundCookie);
 
@@ -4507,7 +4507,7 @@ nsCookieService::CookieExistsNative(const nsACString &aHost,
 
   EnsureReadComplete(true);
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState = (aOriginAttributes->mPrivateBrowsingId > 0) ? mPrivateDBState
                                                          : mDefaultDBState;
 
@@ -4533,7 +4533,7 @@ class CookieIterComparator {
  public:
   explicit CookieIterComparator(int64_t aTime) : mCurrentTime(aTime) {}
 
-  bool LessThan(const nsListIter &lhs, const nsListIter &rhs) {
+  bool LessThan(const nsListIter& lhs, const nsListIter& rhs) {
     bool lExpired = lhs.Cookie()->Expiry() <= mCurrentTime;
     bool rExpired = rhs.Cookie()->Expiry() <= mCurrentTime;
     if (lExpired && !rExpired) {
@@ -4550,20 +4550,20 @@ class CookieIterComparator {
 
 // Given the output iter array and the count limit, find cookies
 // sort by expiry and lastAccessed time.
-void nsCookieService::FindStaleCookies(nsCookieEntry *aEntry,
+void nsCookieService::FindStaleCookies(nsCookieEntry* aEntry,
                                        int64_t aCurrentTime, bool aIsSecure,
-                                       nsTArray &aOutput,
+                                       nsTArray& aOutput,
                                        uint32_t aLimit) {
   MOZ_ASSERT(aLimit);
 
-  const nsCookieEntry::ArrayType &cookies = aEntry->GetCookies();
+  const nsCookieEntry::ArrayType& cookies = aEntry->GetCookies();
   aOutput.Clear();
 
   CookieIterComparator comp(aCurrentTime);
   nsTPriorityQueue queue(comp);
 
   for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
-    nsCookie *cookie = cookies[i];
+    nsCookie* cookie = cookies[i];
 
     if (cookie->Expiry() <= aCurrentTime) {
       queue.Push(nsListIter(aEntry, i));
@@ -4591,8 +4591,8 @@ void nsCookieService::FindStaleCookies(nsCookieEntry *aEntry,
 // count the number of cookies stored by a particular host. this is provided by
 // the nsICookieManager interface.
 NS_IMETHODIMP
-nsCookieService::CountCookiesFromHost(const nsACString &aHost,
-                                      uint32_t *aCountFromHost) {
+nsCookieService::CountCookiesFromHost(const nsACString& aHost,
+                                      uint32_t* aCountFromHost) {
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
@@ -4612,7 +4612,7 @@ nsCookieService::CountCookiesFromHost(const nsACString &aHost,
   nsCookieKey key = DEFAULT_APP_KEY(baseDomain);
 
   // Return a count of all cookies, including expired.
-  nsCookieEntry *entry = mDBState->hostTable.GetEntry(key);
+  nsCookieEntry* entry = mDBState->hostTable.GetEntry(key);
   *aCountFromHost = entry ? entry->GetCookies().Length() : 0;
   return NS_OK;
 }
@@ -4620,10 +4620,10 @@ nsCookieService::CountCookiesFromHost(const nsACString &aHost,
 // get an enumerator of cookies stored by a particular host. this is provided by
 // the nsICookieManager interface.
 NS_IMETHODIMP
-nsCookieService::GetCookiesFromHost(const nsACString &aHost,
+nsCookieService::GetCookiesFromHost(const nsACString& aHost,
                                     JS::HandleValue aOriginAttributes,
-                                    JSContext *aCx,
-                                    nsISimpleEnumerator **aEnumerator) {
+                                    JSContext* aCx,
+                                    nsISimpleEnumerator** aEnumerator) {
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
@@ -4645,16 +4645,16 @@ nsCookieService::GetCookiesFromHost(const nsACString &aHost,
     return NS_ERROR_INVALID_ARG;
   }
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState = (attrs.mPrivateBrowsingId > 0) ? mPrivateDBState : mDefaultDBState;
 
   nsCookieKey key = nsCookieKey(baseDomain, attrs);
 
-  nsCookieEntry *entry = mDBState->hostTable.GetEntry(key);
+  nsCookieEntry* entry = mDBState->hostTable.GetEntry(key);
   if (!entry) return NS_NewEmptyEnumerator(aEnumerator);
 
   nsCOMArray cookieList(mMaxCookiesPerHost);
-  const nsCookieEntry::ArrayType &cookies = entry->GetCookies();
+  const nsCookieEntry::ArrayType& cookies = entry->GetCookies();
   for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
     cookieList.AppendObject(cookies[i]);
   }
@@ -4664,8 +4664,8 @@ nsCookieService::GetCookiesFromHost(const nsACString &aHost,
 
 NS_IMETHODIMP
 nsCookieService::GetCookiesWithOriginAttributes(
-    const nsAString &aPattern, const nsACString &aHost,
-    nsISimpleEnumerator **aEnumerator) {
+    const nsAString& aPattern, const nsACString& aHost,
+    nsISimpleEnumerator** aEnumerator) {
   mozilla::OriginAttributesPattern pattern;
   if (!pattern.Init(aPattern)) {
     return NS_ERROR_INVALID_ARG;
@@ -4683,15 +4683,15 @@ nsCookieService::GetCookiesWithOriginAttributes(
 }
 
 nsresult nsCookieService::GetCookiesWithOriginAttributes(
-    const mozilla::OriginAttributesPattern &aPattern,
-    const nsCString &aBaseDomain, nsISimpleEnumerator **aEnumerator) {
+    const mozilla::OriginAttributesPattern& aPattern,
+    const nsCString& aBaseDomain, nsISimpleEnumerator** aEnumerator) {
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already closed?");
     return NS_ERROR_NOT_AVAILABLE;
   }
   EnsureReadComplete(true);
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState = (aPattern.mPrivateBrowsingId.WasPassed() &&
               aPattern.mPrivateBrowsingId.Value() > 0)
                  ? mPrivateDBState
@@ -4699,7 +4699,7 @@ nsresult nsCookieService::GetCookiesWithOriginAttributes(
 
   nsCOMArray cookies;
   for (auto iter = mDBState->hostTable.Iter(); !iter.Done(); iter.Next()) {
-    nsCookieEntry *entry = iter.Get();
+    nsCookieEntry* entry = iter.Get();
 
     if (!aBaseDomain.IsEmpty() && !aBaseDomain.Equals(entry->mBaseDomain)) {
       continue;
@@ -4709,7 +4709,7 @@ nsresult nsCookieService::GetCookiesWithOriginAttributes(
       continue;
     }
 
-    const nsCookieEntry::ArrayType &entryCookies = entry->GetCookies();
+    const nsCookieEntry::ArrayType& entryCookies = entry->GetCookies();
 
     for (nsCookieEntry::IndexType i = 0; i < entryCookies.Length(); ++i) {
       cookies.AppendObject(entryCookies[i]);
@@ -4720,8 +4720,8 @@ nsresult nsCookieService::GetCookiesWithOriginAttributes(
 }
 
 NS_IMETHODIMP
-nsCookieService::RemoveCookiesWithOriginAttributes(const nsAString &aPattern,
-                                                   const nsACString &aHost) {
+nsCookieService::RemoveCookiesWithOriginAttributes(const nsAString& aPattern,
+                                                   const nsACString& aHost) {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   mozilla::OriginAttributesPattern pattern;
@@ -4741,8 +4741,8 @@ nsCookieService::RemoveCookiesWithOriginAttributes(const nsAString &aPattern,
 }
 
 nsresult nsCookieService::RemoveCookiesWithOriginAttributes(
-    const mozilla::OriginAttributesPattern &aPattern,
-    const nsCString &aBaseDomain) {
+    const mozilla::OriginAttributesPattern& aPattern,
+    const nsCString& aBaseDomain) {
   if (!mDBState) {
     NS_WARNING("No DBState! Profile already close?");
     return NS_ERROR_NOT_AVAILABLE;
@@ -4750,7 +4750,7 @@ nsresult nsCookieService::RemoveCookiesWithOriginAttributes(
 
   EnsureReadComplete(true);
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState = (aPattern.mPrivateBrowsingId.WasPassed() &&
               aPattern.mPrivateBrowsingId.Value() > 0)
                  ? mPrivateDBState
@@ -4759,7 +4759,7 @@ nsresult nsCookieService::RemoveCookiesWithOriginAttributes(
   mozStorageTransaction transaction(mDBState->dbConn, false);
   // Iterate the hash table of nsCookieEntry.
   for (auto iter = mDBState->hostTable.Iter(); !iter.Done(); iter.Next()) {
-    nsCookieEntry *entry = iter.Get();
+    nsCookieEntry* entry = iter.Get();
 
     if (!aBaseDomain.IsEmpty() && !aBaseDomain.Equals(entry->mBaseDomain)) {
       continue;
@@ -4792,8 +4792,8 @@ nsresult nsCookieService::RemoveCookiesWithOriginAttributes(
 }
 
 NS_IMETHODIMP
-nsCookieService::RemoveCookiesFromRootDomain(const nsACString &aHost,
-                                             const nsAString &aPattern) {
+nsCookieService::RemoveCookiesFromRootDomain(const nsACString& aHost,
+                                             const nsAString& aPattern) {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   mozilla::OriginAttributesPattern pattern;
@@ -4805,7 +4805,7 @@ nsCookieService::RemoveCookiesFromRootDomain(const nsACString &aHost,
 }
 
 nsresult nsCookieService::RemoveCookiesFromRootDomain(
-    const nsACString &aHost, const mozilla::OriginAttributesPattern &aPattern) {
+    const nsACString& aHost, const mozilla::OriginAttributesPattern& aPattern) {
   nsAutoCString host(aHost);
   nsresult rv = NormalizeHost(host);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -4821,7 +4821,7 @@ nsresult nsCookieService::RemoveCookiesFromRootDomain(
 
   EnsureReadComplete(true);
 
-  AutoRestore savePrevDBState(mDBState);
+  AutoRestore savePrevDBState(mDBState);
   mDBState = (aPattern.mPrivateBrowsingId.WasPassed() &&
               aPattern.mPrivateBrowsingId.Value() > 0)
                  ? mPrivateDBState
@@ -4830,7 +4830,7 @@ nsresult nsCookieService::RemoveCookiesFromRootDomain(
   mozStorageTransaction transaction(mDBState->dbConn, false);
   // Iterate the hash table of nsCookieEntry.
   for (auto iter = mDBState->hostTable.Iter(); !iter.Done(); iter.Next()) {
-    nsCookieEntry *entry = iter.Get();
+    nsCookieEntry* entry = iter.Get();
 
     if (!baseDomain.Equals(entry->mBaseDomain)) {
       continue;
@@ -4868,14 +4868,14 @@ nsresult nsCookieService::RemoveCookiesFromRootDomain(
 }
 
 // find an secure cookie specified by host and name
-bool nsCookieService::FindSecureCookie(const nsCookieKey &aKey,
-                                       nsCookie *aCookie) {
-  nsCookieEntry *entry = mDBState->hostTable.GetEntry(aKey);
+bool nsCookieService::FindSecureCookie(const nsCookieKey& aKey,
+                                       nsCookie* aCookie) {
+  nsCookieEntry* entry = mDBState->hostTable.GetEntry(aKey);
   if (!entry) return false;
 
-  const nsCookieEntry::ArrayType &cookies = entry->GetCookies();
+  const nsCookieEntry::ArrayType& cookies = entry->GetCookies();
   for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
-    nsCookie *cookie = cookies[i];
+    nsCookie* cookie = cookies[i];
     // isn't a match if insecure or a different name
     if (!cookie->IsSecure() || !aCookie->Name().Equals(cookie->Name()))
       continue;
@@ -4897,19 +4897,19 @@ bool nsCookieService::FindSecureCookie(const nsCookieKey &aKey,
 }
 
 // find an exact cookie specified by host, name, and path that hasn't expired.
-bool nsCookieService::FindCookie(const nsCookieKey &aKey,
-                                 const nsCString &aHost, const nsCString &aName,
-                                 const nsCString &aPath, nsListIter &aIter) {
+bool nsCookieService::FindCookie(const nsCookieKey& aKey,
+                                 const nsCString& aHost, const nsCString& aName,
+                                 const nsCString& aPath, nsListIter& aIter) {
   // Should |EnsureReadComplete| before.
   MOZ_ASSERT(mInitializedDBStates);
   MOZ_ASSERT(mInitializedDBConn);
 
-  nsCookieEntry *entry = mDBState->hostTable.GetEntry(aKey);
+  nsCookieEntry* entry = mDBState->hostTable.GetEntry(aKey);
   if (!entry) return false;
 
-  const nsCookieEntry::ArrayType &cookies = entry->GetCookies();
+  const nsCookieEntry::ArrayType& cookies = entry->GetCookies();
   for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
-    nsCookie *cookie = cookies[i];
+    nsCookie* cookie = cookies[i];
 
     if (aHost.Equals(cookie->Host()) && aPath.Equals(cookie->Path()) &&
         aName.Equals(cookie->Name())) {
@@ -4923,12 +4923,12 @@ bool nsCookieService::FindCookie(const nsCookieKey &aKey,
 
 // remove a cookie from the hashtable, and update the iterator state.
 void nsCookieService::RemoveCookieFromList(
-    const nsListIter &aIter, mozIStorageBindingParamsArray *aParamsArray) {
+    const nsListIter& aIter, mozIStorageBindingParamsArray* aParamsArray) {
   // if it's a non-session cookie, remove it from the db
   if (!aIter.Cookie()->IsSession() && mDBState->dbConn) {
     // Use the asynchronous binding methods to ensure that we do not acquire
     // the database lock.
-    mozIStorageAsyncStatement *stmt = mDBState->stmtDelete;
+    mozIStorageAsyncStatement* stmt = mDBState->stmtDelete;
     nsCOMPtr paramsArray(aParamsArray);
     if (!paramsArray) {
       stmt->NewBindingParamsArray(getter_AddRefs(paramsArray));
@@ -4982,8 +4982,8 @@ void nsCookieService::RemoveCookieFromList(
   --mDBState->cookieCount;
 }
 
-void bindCookieParameters(mozIStorageBindingParamsArray *aParamsArray,
-                          const nsCookieKey &aKey, const nsCookie *aCookie) {
+void bindCookieParameters(mozIStorageBindingParamsArray* aParamsArray,
+                          const nsCookieKey& aKey, const nsCookie* aCookie) {
   NS_ASSERTION(aParamsArray,
                "Null params array passed to bindCookieParameters!");
   NS_ASSERTION(aCookie, "Null cookie passed to bindCookieParameters!");
@@ -5050,16 +5050,16 @@ void bindCookieParameters(mozIStorageBindingParamsArray *aParamsArray,
   NS_ASSERT_SUCCESS(rv);
 }
 
-void nsCookieService::UpdateCookieOldestTime(DBState *aDBState,
-                                             nsCookie *aCookie) {
+void nsCookieService::UpdateCookieOldestTime(DBState* aDBState,
+                                             nsCookie* aCookie) {
   if (aCookie->LastAccessed() < aDBState->cookieOldestTime) {
     aDBState->cookieOldestTime = aCookie->LastAccessed();
   }
 }
 
 void nsCookieService::AddCookieToList(
-    const nsCookieKey &aKey, nsCookie *aCookie, DBState *aDBState,
-    mozIStorageBindingParamsArray *aParamsArray, bool aWriteToDB) {
+    const nsCookieKey& aKey, nsCookie* aCookie, DBState* aDBState,
+    mozIStorageBindingParamsArray* aParamsArray, bool aWriteToDB) {
   NS_ASSERTION(!(aDBState->dbConn && !aWriteToDB && aParamsArray),
                "Not writing to the DB but have a params array?");
   NS_ASSERTION(!(!aDBState->dbConn && aParamsArray),
@@ -5070,7 +5070,7 @@ void nsCookieService::AddCookieToList(
     return;
   }
 
-  nsCookieEntry *entry = aDBState->hostTable.PutEntry(aKey);
+  nsCookieEntry* entry = aDBState->hostTable.PutEntry(aKey);
   NS_ASSERTION(entry, "can't insert element into a null entry!");
 
   entry->GetCookies().AppendElement(aCookie);
@@ -5082,7 +5082,7 @@ void nsCookieService::AddCookieToList(
   // if it's a non-session cookie and hasn't just been read from the db, write
   // it out.
   if (aWriteToDB && !aCookie->IsSession() && aDBState->dbConn) {
-    mozIStorageAsyncStatement *stmt = aDBState->stmtInsert;
+    mozIStorageAsyncStatement* stmt = aDBState->stmtInsert;
     nsCOMPtr paramsArray(aParamsArray);
     if (!paramsArray) {
       stmt->NewBindingParamsArray(getter_AddRefs(paramsArray));
@@ -5102,8 +5102,8 @@ void nsCookieService::AddCookieToList(
 }
 
 void nsCookieService::UpdateCookieInList(
-    nsCookie *aCookie, int64_t aLastAccessed,
-    mozIStorageBindingParamsArray *aParamsArray) {
+    nsCookie* aCookie, int64_t aLastAccessed,
+    mozIStorageBindingParamsArray* aParamsArray) {
   NS_ASSERTION(aCookie, "Passing a null cookie to UpdateCookieInList!");
 
   // udpate the lastAccessed timestamp
@@ -5161,8 +5161,8 @@ size_t nsCookieService::SizeOfIncludingThis(
 MOZ_DEFINE_MALLOC_SIZE_OF(CookieServiceMallocSizeOf)
 
 NS_IMETHODIMP
-nsCookieService::CollectReports(nsIHandleReportCallback *aHandleReport,
-                                nsISupports *aData, bool aAnonymize) {
+nsCookieService::CollectReports(nsIHandleReportCallback* aHandleReport,
+                                nsISupports* aData, bool aAnonymize) {
   MOZ_COLLECT_REPORT("explicit/cookie-service", KIND_HEAP, UNITS_BYTES,
                      SizeOfIncludingThis(CookieServiceMallocSizeOf),
                      "Memory used by the cookie service.");
diff --git a/netwerk/cookie/nsCookieService.h b/netwerk/cookie/nsCookieService.h
index b89b5df716764..0da4bfe2ae3e0 100644
--- a/netwerk/cookie/nsCookieService.h
+++ b/netwerk/cookie/nsCookieService.h
@@ -72,7 +72,7 @@ class nsCookieEntry : public nsCookieKey {
 
   explicit nsCookieEntry(KeyTypePointer aKey) : nsCookieKey(aKey) {}
 
-  nsCookieEntry(const nsCookieEntry &toCopy) {
+  nsCookieEntry(const nsCookieEntry& toCopy) {
     // if we end up here, things will break. nsTHashtable shouldn't
     // allow this, since we set ALLOW_MEMMOVE to true.
     MOZ_ASSERT_UNREACHABLE("nsCookieEntry copy constructor is forbidden!");
@@ -80,7 +80,7 @@ class nsCookieEntry : public nsCookieKey {
 
   ~nsCookieEntry() = default;
 
-  inline ArrayType &GetCookies() { return mCookies; }
+  inline ArrayType& GetCookies() { return mCookies; }
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
@@ -90,10 +90,10 @@ class nsCookieEntry : public nsCookieKey {
 
 // struct for a constant cookie for threadsafe
 struct ConstCookie {
-  ConstCookie(const nsCString &aName, const nsCString &aValue,
-              const nsCString &aHost, const nsCString &aPath, int64_t aExpiry,
+  ConstCookie(const nsCString& aName, const nsCString& aValue,
+              const nsCString& aHost, const nsCString& aPath, int64_t aExpiry,
               int64_t aLastAccessed, int64_t aCreationTime, bool aIsSecure,
-              bool aIsHttpOnly, const OriginAttributes &aOriginAttributes,
+              bool aIsHttpOnly, const OriginAttributes& aOriginAttributes,
               int32_t aSameSite)
       : name(aName),
         value(aValue),
@@ -167,7 +167,7 @@ struct DBState final {
   nsCOMPtr stmtReadDomain;
   // The asynchronous read listener. This is a weak ref (storage has ownership)
   // since it may need to outlive the DBState's database connection.
-  ReadCookieDBListener *readListener;
+  ReadCookieDBListener* readListener;
 
   // DB completion handlers.
   nsCOMPtr insertListener;
@@ -242,50 +242,50 @@ class nsCookieService final : public nsICookieService,
    * app.
    */
   static void AppClearDataObserverInit();
-  static nsAutoCString GetPathFromURI(nsIURI *aHostURI);
-  static nsresult GetBaseDomain(nsIEffectiveTLDService *aTLDService,
-                                nsIURI *aHostURI, nsCString &aBaseDomain,
-                                bool &aRequireHostMatch);
-  static nsresult GetBaseDomainFromHost(nsIEffectiveTLDService *aTLDService,
-                                        const nsACString &aHost,
-                                        nsCString &aBaseDomain);
-  static bool DomainMatches(nsCookie *aCookie, const nsACString &aHost);
+  static nsAutoCString GetPathFromURI(nsIURI* aHostURI);
+  static nsresult GetBaseDomain(nsIEffectiveTLDService* aTLDService,
+                                nsIURI* aHostURI, nsCString& aBaseDomain,
+                                bool& aRequireHostMatch);
+  static nsresult GetBaseDomainFromHost(nsIEffectiveTLDService* aTLDService,
+                                        const nsACString& aHost,
+                                        nsCString& aBaseDomain);
+  static bool DomainMatches(nsCookie* aCookie, const nsACString& aHost);
   static bool IsSameSiteEnabled();
-  static bool PathMatches(nsCookie *aCookie, const nsACString &aPath);
-  static bool CanSetCookie(nsIURI *aHostURI, const nsCookieKey &aKey,
-                           nsCookieAttributes &aCookieAttributes,
+  static bool PathMatches(nsCookie* aCookie, const nsACString& aPath);
+  static bool CanSetCookie(nsIURI* aHostURI, const nsCookieKey& aKey,
+                           nsCookieAttributes& aCookieAttributes,
                            bool aRequireHostMatch, CookieStatus aStatus,
-                           nsDependentCString &aCookieHeader,
+                           nsDependentCString& aCookieHeader,
                            int64_t aServerTime, bool aFromHttp,
-                           nsIChannel *aChannel, bool &aSetCookie,
-                           mozIThirdPartyUtil *aThirdPartyUtil);
+                           nsIChannel* aChannel, bool& aSetCookie,
+                           mozIThirdPartyUtil* aThirdPartyUtil);
   static CookieStatus CheckPrefs(
-      nsICookieSettings *aCookieSettings, bool aThirdPartySession,
-      bool aThirdPartyNonsecureSession, nsIURI *aHostURI, bool aIsForeign,
+      nsICookieSettings* aCookieSettings, bool aThirdPartySession,
+      bool aThirdPartyNonsecureSession, nsIURI* aHostURI, bool aIsForeign,
       bool aIsTrackingResource, bool aIsFirstPartyStorageAccessGranted,
-      const char *aCookieHeader, const int aNumOfCookies,
-      const OriginAttributes &aOriginAttrs, uint32_t *aRejectedReason);
-  static int64_t ParseServerTime(const nsCString &aServerTime);
+      const char* aCookieHeader, const int aNumOfCookies,
+      const OriginAttributes& aOriginAttrs, uint32_t* aRejectedReason);
+  static int64_t ParseServerTime(const nsCString& aServerTime);
 
   static already_AddRefed GetCookieSettings(
-      nsIChannel *aChannel);
+      nsIChannel* aChannel);
 
-  void GetCookiesForURI(nsIURI *aHostURI, nsIChannel *aChannel, bool aIsForeign,
+  void GetCookiesForURI(nsIURI* aHostURI, nsIChannel* aChannel, bool aIsForeign,
                         bool aIsTrackingResource,
                         bool aFirstPartyStorageAccessGranted,
                         bool aIsSafeTopLevelNav, bool aIsSameSiteForeign,
-                        bool aHttpBound, const OriginAttributes &aOriginAttrs,
-                        nsTArray &aCookieList);
+                        bool aHttpBound, const OriginAttributes& aOriginAttrs,
+                        nsTArray& aCookieList);
 
  protected:
   virtual ~nsCookieService();
 
-  void PrefChanged(nsIPrefBranch *aPrefBranch);
+  void PrefChanged(nsIPrefBranch* aPrefBranch);
   void InitDBStates();
   OpenDBResult TryInitDB(bool aDeleteExistingDB);
   void InitDBConn();
   nsresult InitDBConnInternal();
-  nsresult CreateTableWorker(const char *aName);
+  nsresult CreateTableWorker(const char* aName);
   nsresult CreateIndex();
   nsresult CreateTable();
   nsresult CreateTableForSchemaVersion6();
@@ -293,103 +293,103 @@ class nsCookieService final : public nsICookieService,
   void CloseDBStates();
   void CleanupCachedStatements();
   void CleanupDefaultDBConnection();
-  void HandleDBClosed(DBState *aDBState);
-  void HandleCorruptDB(DBState *aDBState);
-  void RebuildCorruptDB(DBState *aDBState);
+  void HandleDBClosed(DBState* aDBState);
+  void HandleCorruptDB(DBState* aDBState);
+  void RebuildCorruptDB(DBState* aDBState);
   OpenDBResult Read();
   mozilla::UniquePtr GetCookieFromRow(
-      mozIStorageStatement *aRow, const OriginAttributes &aOriginAttributes);
+      mozIStorageStatement* aRow, const OriginAttributes& aOriginAttributes);
   void EnsureReadComplete(bool aInitDBConn);
-  nsresult NormalizeHost(nsCString &aHost);
-  nsresult GetCookieStringCommon(nsIURI *aHostURI, nsIChannel *aChannel,
-                                 bool aHttpBound, char **aCookie);
-  void GetCookieStringInternal(nsIURI *aHostURI, nsIChannel *aChannel,
+  nsresult NormalizeHost(nsCString& aHost);
+  nsresult GetCookieStringCommon(nsIURI* aHostURI, nsIChannel* aChannel,
+                                 bool aHttpBound, char** aCookie);
+  void GetCookieStringInternal(nsIURI* aHostURI, nsIChannel* aChannel,
                                bool aIsForeign, bool aIsTrackingResource,
                                bool aFirstPartyStorageAccessGranted,
                                bool aIsSafeTopLevelNav, bool aIsSameSiteForeign,
                                bool aHttpBound,
-                               const OriginAttributes &aOriginAttrs,
-                               nsCString &aCookie);
-  nsresult SetCookieStringCommon(nsIURI *aHostURI, const char *aCookieHeader,
-                                 const char *aServerTime, nsIChannel *aChannel,
+                               const OriginAttributes& aOriginAttrs,
+                               nsCString& aCookie);
+  nsresult SetCookieStringCommon(nsIURI* aHostURI, const char* aCookieHeader,
+                                 const char* aServerTime, nsIChannel* aChannel,
                                  bool aFromHttp);
-  void SetCookieStringInternal(nsIURI *aHostURI, bool aIsForeign,
+  void SetCookieStringInternal(nsIURI* aHostURI, bool aIsForeign,
                                bool aIsTrackingResource,
                                bool aFirstPartyStorageAccessGranted,
-                               nsDependentCString &aCookieHeader,
-                               const nsCString &aServerTime, bool aFromHttp,
-                               const OriginAttributes &aOriginAttrs,
-                               nsIChannel *aChannel);
-  bool SetCookieInternal(nsIURI *aHostURI, const nsCookieKey &aKey,
+                               nsDependentCString& aCookieHeader,
+                               const nsCString& aServerTime, bool aFromHttp,
+                               const OriginAttributes& aOriginAttrs,
+                               nsIChannel* aChannel);
+  bool SetCookieInternal(nsIURI* aHostURI, const nsCookieKey& aKey,
                          bool aRequireHostMatch, CookieStatus aStatus,
-                         nsDependentCString &aCookieHeader, int64_t aServerTime,
-                         bool aFromHttp, nsIChannel *aChannel);
-  void AddInternal(const nsCookieKey &aKey, nsCookie *aCookie,
-                   int64_t aCurrentTimeInUsec, nsIURI *aHostURI,
-                   const char *aCookieHeader, bool aFromHttp);
+                         nsDependentCString& aCookieHeader, int64_t aServerTime,
+                         bool aFromHttp, nsIChannel* aChannel);
+  void AddInternal(const nsCookieKey& aKey, nsCookie* aCookie,
+                   int64_t aCurrentTimeInUsec, nsIURI* aHostURI,
+                   const char* aCookieHeader, bool aFromHttp);
   void RemoveCookieFromList(
-      const nsListIter &aIter,
-      mozIStorageBindingParamsArray *aParamsArray = nullptr);
-  void AddCookieToList(const nsCookieKey &aKey, nsCookie *aCookie,
-                       DBState *aDBState,
-                       mozIStorageBindingParamsArray *aParamsArray,
+      const nsListIter& aIter,
+      mozIStorageBindingParamsArray* aParamsArray = nullptr);
+  void AddCookieToList(const nsCookieKey& aKey, nsCookie* aCookie,
+                       DBState* aDBState,
+                       mozIStorageBindingParamsArray* aParamsArray,
                        bool aWriteToDB = true);
-  void UpdateCookieInList(nsCookie *aCookie, int64_t aLastAccessed,
-                          mozIStorageBindingParamsArray *aParamsArray);
-  static bool GetTokenValue(nsACString::const_char_iterator &aIter,
-                            nsACString::const_char_iterator &aEndIter,
-                            nsDependentCSubstring &aTokenString,
-                            nsDependentCSubstring &aTokenValue,
-                            bool &aEqualsFound);
-  static bool ParseAttributes(nsDependentCString &aCookieHeader,
-                              nsCookieAttributes &aCookie);
+  void UpdateCookieInList(nsCookie* aCookie, int64_t aLastAccessed,
+                          mozIStorageBindingParamsArray* aParamsArray);
+  static bool GetTokenValue(nsACString::const_char_iterator& aIter,
+                            nsACString::const_char_iterator& aEndIter,
+                            nsDependentCSubstring& aTokenString,
+                            nsDependentCSubstring& aTokenValue,
+                            bool& aEqualsFound);
+  static bool ParseAttributes(nsDependentCString& aCookieHeader,
+                              nsCookieAttributes& aCookie);
   bool RequireThirdPartyCheck();
-  static bool CheckDomain(nsCookieAttributes &aCookie, nsIURI *aHostURI,
-                          const nsCString &aBaseDomain, bool aRequireHostMatch);
-  static bool CheckPath(nsCookieAttributes &aCookie, nsIURI *aHostURI);
-  static bool CheckPrefixes(nsCookieAttributes &aCookie, bool aSecureRequest);
-  static bool GetExpiry(nsCookieAttributes &aCookie, int64_t aServerTime,
+  static bool CheckDomain(nsCookieAttributes& aCookie, nsIURI* aHostURI,
+                          const nsCString& aBaseDomain, bool aRequireHostMatch);
+  static bool CheckPath(nsCookieAttributes& aCookie, nsIURI* aHostURI);
+  static bool CheckPrefixes(nsCookieAttributes& aCookie, bool aSecureRequest);
+  static bool GetExpiry(nsCookieAttributes& aCookie, int64_t aServerTime,
                         int64_t aCurrentTime, bool aFromHttp);
   void RemoveAllFromMemory();
   already_AddRefed PurgeCookies(int64_t aCurrentTimeInUsec);
-  bool FindCookie(const nsCookieKey &aKey, const nsCString &aHost,
-                  const nsCString &aName, const nsCString &aPath,
-                  nsListIter &aIter);
-  bool FindSecureCookie(const nsCookieKey &aKey, nsCookie *aCookie);
-  void FindStaleCookies(nsCookieEntry *aEntry, int64_t aCurrentTime,
-                        bool aIsSecure, nsTArray &aOutput,
+  bool FindCookie(const nsCookieKey& aKey, const nsCString& aHost,
+                  const nsCString& aName, const nsCString& aPath,
+                  nsListIter& aIter);
+  bool FindSecureCookie(const nsCookieKey& aKey, nsCookie* aCookie);
+  void FindStaleCookies(nsCookieEntry* aEntry, int64_t aCurrentTime,
+                        bool aIsSecure, nsTArray& aOutput,
                         uint32_t aLimit);
-  void NotifyAccepted(nsIChannel *aChannel);
-  void NotifyRejected(nsIURI *aHostURI, nsIChannel *aChannel,
+  void NotifyAccepted(nsIChannel* aChannel);
+  void NotifyRejected(nsIURI* aHostURI, nsIChannel* aChannel,
                       uint32_t aRejectedReason, CookieOperation aOperation);
-  void NotifyThirdParty(nsIURI *aHostURI, bool aAccepted, nsIChannel *aChannel);
-  void NotifyChanged(nsISupports *aSubject, const char16_t *aData,
+  void NotifyThirdParty(nsIURI* aHostURI, bool aAccepted, nsIChannel* aChannel);
+  void NotifyChanged(nsISupports* aSubject, const char16_t* aData,
                      bool aOldCookieIsSession = false, bool aFromHttp = false);
-  void NotifyPurged(nsICookie2 *aCookie);
-  already_AddRefed CreatePurgeList(nsICookie2 *aCookie);
-  void CreateOrUpdatePurgeList(nsIArray **aPurgeList, nsICookie2 *aCookie);
-  void UpdateCookieOldestTime(DBState *aDBState, nsCookie *aCookie);
+  void NotifyPurged(nsICookie2* aCookie);
+  already_AddRefed CreatePurgeList(nsICookie2* aCookie);
+  void CreateOrUpdatePurgeList(nsIArray** aPurgeList, nsICookie2* aCookie);
+  void UpdateCookieOldestTime(DBState* aDBState, nsCookie* aCookie);
 
   nsresult GetCookiesWithOriginAttributes(
-      const mozilla::OriginAttributesPattern &aPattern,
-      const nsCString &aBaseDomain, nsISimpleEnumerator **aEnumerator);
+      const mozilla::OriginAttributesPattern& aPattern,
+      const nsCString& aBaseDomain, nsISimpleEnumerator** aEnumerator);
   nsresult RemoveCookiesWithOriginAttributes(
-      const mozilla::OriginAttributesPattern &aPattern,
-      const nsCString &aBaseDomain);
+      const mozilla::OriginAttributesPattern& aPattern,
+      const nsCString& aBaseDomain);
 
   /**
    * This method is a helper that allows calling nsICookieManager::Remove()
    * with OriginAttributes parameter.
    * NOTE: this could be added to a public interface if we happen to need it.
    */
-  nsresult Remove(const nsACString &aHost, const OriginAttributes &aAttrs,
-                  const nsACString &aName, const nsACString &aPath,
+  nsresult Remove(const nsACString& aHost, const OriginAttributes& aAttrs,
+                  const nsACString& aName, const nsACString& aPath,
                   bool aBlocked);
 
  protected:
   nsresult RemoveCookiesFromRootDomain(
-      const nsACString &aHost,
-      const mozilla::OriginAttributesPattern &aPattern);
+      const nsACString& aHost,
+      const mozilla::OriginAttributesPattern& aPattern);
 
   // cached members.
   nsCOMPtr mPermissionService;
@@ -403,7 +403,7 @@ class nsCookieService final : public nsICookieService,
   // this state encapsulates both the in-memory table and the on-disk DB.
   // note that the private states' dbConn should always be null - we never
   // want to be dealing with the on-disk DB when in private browsing.
-  DBState *mDBState;
+  DBState* mDBState;
   RefPtr mDefaultDBState;
   RefPtr mPrivateDBState;
 
diff --git a/netwerk/dns/ChildDNSService.cpp b/netwerk/dns/ChildDNSService.cpp
index b1c8b2cff76b6..65aa094f4b63d 100644
--- a/netwerk/dns/ChildDNSService.cpp
+++ b/netwerk/dns/ChildDNSService.cpp
@@ -49,9 +49,9 @@ ChildDNSService::ChildDNSService()
 }
 
 void ChildDNSService::GetDNSRecordHashKey(
-    const nsACString &aHost, uint16_t aType,
-    const OriginAttributes &aOriginAttributes, uint32_t aFlags,
-    nsIDNSListener *aListener, nsACString &aHashKey) {
+    const nsACString& aHost, uint16_t aType,
+    const OriginAttributes& aOriginAttributes, uint32_t aFlags,
+    nsIDNSListener* aListener, nsACString& aHashKey) {
   aHashKey.Assign(aHost);
   aHashKey.AppendInt(aType);
 
@@ -64,9 +64,9 @@ void ChildDNSService::GetDNSRecordHashKey(
 }
 
 nsresult ChildDNSService::AsyncResolveInternal(
-    const nsACString &hostname, uint16_t type, uint32_t flags,
-    nsIDNSListener *listener, nsIEventTarget *target_,
-    const OriginAttributes &aOriginAttributes, nsICancelable **result) {
+    const nsACString& hostname, uint16_t type, uint32_t flags,
+    nsIDNSListener* listener, nsIEventTarget* target_,
+    const OriginAttributes& aOriginAttributes, nsICancelable** result) {
   NS_ENSURE_TRUE(gNeckoChild != nullptr, NS_ERROR_FAILURE);
 
   if (mDisablePrefetch && (flags & RESOLVE_SPECULATE)) {
@@ -83,7 +83,7 @@ nsresult ChildDNSService::AsyncResolveInternal(
   }
 
   // We need original listener for the pending requests hash.
-  nsIDNSListener *originalListener = listener;
+  nsIDNSListener* originalListener = listener;
 
   // make sure JS callers get notification on the main thread
   nsCOMPtr target = target_;
@@ -110,7 +110,7 @@ nsresult ChildDNSService::AsyncResolveInternal(
       entry.Data()->AppendElement(childReq);
     } else {
       entry.OrInsert([&]() {
-        auto *hashEntry = new nsTArray>();
+        auto* hashEntry = new nsTArray>();
         hashEntry->AppendElement(childReq);
         return hashEntry;
       });
@@ -124,15 +124,15 @@ nsresult ChildDNSService::AsyncResolveInternal(
 }
 
 nsresult ChildDNSService::CancelAsyncResolveInternal(
-    const nsACString &aHostname, uint16_t aType, uint32_t aFlags,
-    nsIDNSListener *aListener, nsresult aReason,
-    const OriginAttributes &aOriginAttributes) {
+    const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
+    nsIDNSListener* aListener, nsresult aReason,
+    const OriginAttributes& aOriginAttributes) {
   if (mDisablePrefetch && (aFlags & RESOLVE_SPECULATE)) {
     return NS_ERROR_DNS_LOOKUP_QUEUE_FULL;
   }
 
   MutexAutoLock lock(mPendingRequestsLock);
-  nsTArray> *hashEntry;
+  nsTArray>* hashEntry;
   nsCString key;
   GetDNSRecordHashKey(aHostname, aType, aOriginAttributes, aFlags, aListener,
                       key);
@@ -149,10 +149,10 @@ nsresult ChildDNSService::CancelAsyncResolveInternal(
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-ChildDNSService::AsyncResolve(const nsACString &hostname, uint32_t flags,
-                              nsIDNSListener *listener, nsIEventTarget *target_,
-                              JS::HandleValue aOriginAttributes, JSContext *aCx,
-                              uint8_t aArgc, nsICancelable **result) {
+ChildDNSService::AsyncResolve(const nsACString& hostname, uint32_t flags,
+                              nsIDNSListener* listener, nsIEventTarget* target_,
+                              JS::HandleValue aOriginAttributes, JSContext* aCx,
+                              uint8_t aArgc, nsICancelable** result) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -166,23 +166,23 @@ ChildDNSService::AsyncResolve(const nsACString &hostname, uint32_t flags,
 }
 
 NS_IMETHODIMP
-ChildDNSService::AsyncResolveNative(const nsACString &hostname, uint32_t flags,
-                                    nsIDNSListener *listener,
-                                    nsIEventTarget *target_,
-                                    const OriginAttributes &aOriginAttributes,
-                                    nsICancelable **result) {
+ChildDNSService::AsyncResolveNative(const nsACString& hostname, uint32_t flags,
+                                    nsIDNSListener* listener,
+                                    nsIEventTarget* target_,
+                                    const OriginAttributes& aOriginAttributes,
+                                    nsICancelable** result) {
   return AsyncResolveInternal(hostname, nsIDNSService::RESOLVE_TYPE_DEFAULT,
                               flags, listener, target_, aOriginAttributes,
                               result);
 }
 
 NS_IMETHODIMP
-ChildDNSService::AsyncResolveByType(const nsACString &hostname, uint16_t type,
-                                    uint32_t flags, nsIDNSListener *listener,
-                                    nsIEventTarget *target_,
+ChildDNSService::AsyncResolveByType(const nsACString& hostname, uint16_t type,
+                                    uint32_t flags, nsIDNSListener* listener,
+                                    nsIEventTarget* target_,
                                     JS::HandleValue aOriginAttributes,
-                                    JSContext *aCx, uint8_t aArgc,
-                                    nsICancelable **result) {
+                                    JSContext* aCx, uint8_t aArgc,
+                                    nsICancelable** result) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -197,19 +197,19 @@ ChildDNSService::AsyncResolveByType(const nsACString &hostname, uint16_t type,
 
 NS_IMETHODIMP
 ChildDNSService::AsyncResolveByTypeNative(
-    const nsACString &hostname, uint16_t type, uint32_t flags,
-    nsIDNSListener *listener, nsIEventTarget *target_,
-    const OriginAttributes &aOriginAttributes, nsICancelable **result) {
+    const nsACString& hostname, uint16_t type, uint32_t flags,
+    nsIDNSListener* listener, nsIEventTarget* target_,
+    const OriginAttributes& aOriginAttributes, nsICancelable** result) {
   return AsyncResolveInternal(hostname, type, flags, listener, target_,
                               aOriginAttributes, result);
 }
 
 NS_IMETHODIMP
-ChildDNSService::CancelAsyncResolve(const nsACString &aHostname,
-                                    uint32_t aFlags, nsIDNSListener *aListener,
+ChildDNSService::CancelAsyncResolve(const nsACString& aHostname,
+                                    uint32_t aFlags, nsIDNSListener* aListener,
                                     nsresult aReason,
                                     JS::HandleValue aOriginAttributes,
-                                    JSContext *aCx, uint8_t aArgc) {
+                                    JSContext* aCx, uint8_t aArgc) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -225,20 +225,20 @@ ChildDNSService::CancelAsyncResolve(const nsACString &aHostname,
 
 NS_IMETHODIMP
 ChildDNSService::CancelAsyncResolveNative(
-    const nsACString &aHostname, uint32_t aFlags, nsIDNSListener *aListener,
-    nsresult aReason, const OriginAttributes &aOriginAttributes) {
+    const nsACString& aHostname, uint32_t aFlags, nsIDNSListener* aListener,
+    nsresult aReason, const OriginAttributes& aOriginAttributes) {
   return CancelAsyncResolveInternal(aHostname,
                                     nsIDNSService::RESOLVE_TYPE_DEFAULT, aFlags,
                                     aListener, aReason, aOriginAttributes);
 }
 
 NS_IMETHODIMP
-ChildDNSService::CancelAsyncResolveByType(const nsACString &aHostname,
+ChildDNSService::CancelAsyncResolveByType(const nsACString& aHostname,
                                           uint16_t aType, uint32_t aFlags,
-                                          nsIDNSListener *aListener,
+                                          nsIDNSListener* aListener,
                                           nsresult aReason,
                                           JS::HandleValue aOriginAttributes,
-                                          JSContext *aCx, uint8_t aArgc) {
+                                          JSContext* aCx, uint8_t aArgc) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -253,32 +253,32 @@ ChildDNSService::CancelAsyncResolveByType(const nsACString &aHostname,
 
 NS_IMETHODIMP
 ChildDNSService::CancelAsyncResolveByTypeNative(
-    const nsACString &aHostname, uint16_t aType, uint32_t aFlags,
-    nsIDNSListener *aListener, nsresult aReason,
-    const OriginAttributes &aOriginAttributes) {
+    const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
+    nsIDNSListener* aListener, nsresult aReason,
+    const OriginAttributes& aOriginAttributes) {
   return CancelAsyncResolveInternal(aHostname, aType, aFlags, aListener,
                                     aReason, aOriginAttributes);
 }
 
 NS_IMETHODIMP
-ChildDNSService::Resolve(const nsACString &hostname, uint32_t flags,
-                         JS::HandleValue aOriginAttributes, JSContext *aCx,
-                         uint8_t aArgc, nsIDNSRecord **result) {
+ChildDNSService::Resolve(const nsACString& hostname, uint32_t flags,
+                         JS::HandleValue aOriginAttributes, JSContext* aCx,
+                         uint8_t aArgc, nsIDNSRecord** result) {
   // not planning to ever support this, since sync IPDL is evil.
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
-ChildDNSService::ResolveNative(const nsACString &hostname, uint32_t flags,
-                               const OriginAttributes &aOriginAttributes,
-                               nsIDNSRecord **result) {
+ChildDNSService::ResolveNative(const nsACString& hostname, uint32_t flags,
+                               const OriginAttributes& aOriginAttributes,
+                               nsIDNSRecord** result) {
   // not planning to ever support this, since sync IPDL is evil.
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
 ChildDNSService::GetDNSCacheEntries(
-    nsTArray *args) {
+    nsTArray* args) {
   // Only used by networking dashboard, so may not ever need this in child.
   // (and would provide a way to spy on what hosts other apps are connecting to,
   // unless we start keeping per-app DNS caches).
@@ -289,12 +289,12 @@ NS_IMETHODIMP
 ChildDNSService::ClearCache(bool aTrrToo) { return NS_ERROR_NOT_AVAILABLE; }
 
 NS_IMETHODIMP
-ChildDNSService::GetMyHostName(nsACString &result) {
+ChildDNSService::GetMyHostName(nsACString& result) {
   // TODO: get value from parent during PNecko construction?
   return NS_ERROR_NOT_AVAILABLE;
 }
 
-void ChildDNSService::NotifyRequestDone(DNSRequestChild *aDnsRequest) {
+void ChildDNSService::NotifyRequestDone(DNSRequestChild* aDnsRequest) {
   // We need the original flags and listener for the pending requests hash.
   uint32_t originalFlags = aDnsRequest->mFlags & ~RESOLVE_OFFLINE;
   nsCOMPtr originalListener = aDnsRequest->mListener;
@@ -314,7 +314,7 @@ void ChildDNSService::NotifyRequestDone(DNSRequestChild *aDnsRequest) {
                       aDnsRequest->mOriginAttributes, originalFlags,
                       originalListener, key);
 
-  nsTArray> *hashEntry;
+  nsTArray>* hashEntry;
 
   if (mPendingRequests.Get(key, &hashEntry)) {
     auto idx = hashEntry->IndexOf(aDnsRequest);
@@ -363,7 +363,7 @@ nsresult ChildDNSService::Init() {
 nsresult ChildDNSService::Shutdown() { return NS_OK; }
 
 NS_IMETHODIMP
-ChildDNSService::GetPrefetchEnabled(bool *outVal) {
+ChildDNSService::GetPrefetchEnabled(bool* outVal) {
   *outVal = !mDisablePrefetch;
   return NS_OK;
 }
@@ -388,8 +388,8 @@ bool ChildDNSService::GetOffline() const {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-ChildDNSService::Observe(nsISupports *subject, const char *topic,
-                         const char16_t *data) {
+ChildDNSService::Observe(nsISupports* subject, const char* topic,
+                         const char16_t* data) {
   // we are only getting called if a preference has changed.
   NS_ASSERTION(strcmp(topic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) == 0,
                "unexpected observe call");
diff --git a/netwerk/dns/ChildDNSService.h b/netwerk/dns/ChildDNSService.h
index 876fedbdf9960..1273637304803 100644
--- a/netwerk/dns/ChildDNSService.h
+++ b/netwerk/dns/ChildDNSService.h
@@ -30,7 +30,7 @@ class ChildDNSService final : public nsPIDNSService, public nsIObserver {
 
   static already_AddRefed GetSingleton();
 
-  void NotifyRequestDone(DNSRequestChild *aDnsRequest);
+  void NotifyRequestDone(DNSRequestChild* aDnsRequest);
 
   bool GetOffline() const;
 
@@ -38,18 +38,18 @@ class ChildDNSService final : public nsPIDNSService, public nsIObserver {
   virtual ~ChildDNSService() = default;
 
   void MOZ_ALWAYS_INLINE GetDNSRecordHashKey(
-      const nsACString &aHost, uint16_t aType,
-      const OriginAttributes &aOriginAttributes, uint32_t aFlags,
-      nsIDNSListener *aListener, nsACString &aHashKey);
-  nsresult AsyncResolveInternal(const nsACString &hostname, uint16_t type,
-                                uint32_t flags, nsIDNSListener *listener,
-                                nsIEventTarget *target_,
-                                const OriginAttributes &aOriginAttributes,
-                                nsICancelable **result);
+      const nsACString& aHost, uint16_t aType,
+      const OriginAttributes& aOriginAttributes, uint32_t aFlags,
+      nsIDNSListener* aListener, nsACString& aHashKey);
+  nsresult AsyncResolveInternal(const nsACString& hostname, uint16_t type,
+                                uint32_t flags, nsIDNSListener* listener,
+                                nsIEventTarget* target_,
+                                const OriginAttributes& aOriginAttributes,
+                                nsICancelable** result);
   nsresult CancelAsyncResolveInternal(
-      const nsACString &aHostname, uint16_t aType, uint32_t aFlags,
-      nsIDNSListener *aListener, nsresult aReason,
-      const OriginAttributes &aOriginAttributes);
+      const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
+      nsIDNSListener* aListener, nsresult aReason,
+      const OriginAttributes& aOriginAttributes);
 
   bool mFirstTime;
   bool mDisablePrefetch;
diff --git a/netwerk/dns/DNS.cpp b/netwerk/dns/DNS.cpp
index 48dd5936e4cb4..ee9160c3ed72e 100644
--- a/netwerk/dns/DNS.cpp
+++ b/netwerk/dns/DNS.cpp
@@ -19,7 +19,7 @@
 namespace mozilla {
 namespace net {
 
-const char *inet_ntop_internal(int af, const void *src, char *dst,
+const char* inet_ntop_internal(int af, const void* src, char* dst,
                                socklen_t size) {
 #ifdef XP_WIN
   if (af == AF_INET) {
@@ -27,7 +27,7 @@ const char *inet_ntop_internal(int af, const void *src, char *dst,
     memset(&s, 0, sizeof(s));
     s.sin_family = AF_INET;
     memcpy(&s.sin_addr, src, sizeof(struct in_addr));
-    int result = getnameinfo((struct sockaddr *)&s, sizeof(struct sockaddr_in),
+    int result = getnameinfo((struct sockaddr*)&s, sizeof(struct sockaddr_in),
                              dst, size, nullptr, 0, NI_NUMERICHOST);
     if (result == 0) {
       return dst;
@@ -37,7 +37,7 @@ const char *inet_ntop_internal(int af, const void *src, char *dst,
     memset(&s, 0, sizeof(s));
     s.sin6_family = AF_INET6;
     memcpy(&s.sin6_addr, src, sizeof(struct in_addr6));
-    int result = getnameinfo((struct sockaddr *)&s, sizeof(struct sockaddr_in6),
+    int result = getnameinfo((struct sockaddr*)&s, sizeof(struct sockaddr_in6),
                              dst, size, nullptr, 0, NI_NUMERICHOST);
     if (result == 0) {
       return dst;
@@ -51,7 +51,7 @@ const char *inet_ntop_internal(int af, const void *src, char *dst,
 
 // Copies the contents of a PRNetAddr to a NetAddr.
 // Does not do a ptr safety check!
-void PRNetAddrToNetAddr(const PRNetAddr *prAddr, NetAddr *addr) {
+void PRNetAddrToNetAddr(const PRNetAddr* prAddr, NetAddr* addr) {
   if (prAddr->raw.family == PR_AF_INET) {
     addr->inet.family = AF_INET;
     addr->inet.port = prAddr->inet.port;
@@ -73,7 +73,7 @@ void PRNetAddrToNetAddr(const PRNetAddr *prAddr, NetAddr *addr) {
 
 // Copies the contents of a NetAddr to a PRNetAddr.
 // Does not do a ptr safety check!
-void NetAddrToPRNetAddr(const NetAddr *addr, PRNetAddr *prAddr) {
+void NetAddrToPRNetAddr(const NetAddr* addr, PRNetAddr* prAddr) {
   if (addr->raw.family == AF_INET) {
     prAddr->inet.family = PR_AF_INET;
     prAddr->inet.port = addr->inet.port;
@@ -98,7 +98,7 @@ void NetAddrToPRNetAddr(const NetAddr *addr, PRNetAddr *prAddr) {
 #endif
 }
 
-bool NetAddrToString(const NetAddr *addr, char *buf, uint32_t bufSize) {
+bool NetAddrToString(const NetAddr* addr, char* buf, uint32_t bufSize) {
   if (addr->raw.family == AF_INET) {
     if (bufSize < INET_ADDRSTRLEN) {
       return false;
@@ -138,7 +138,7 @@ bool NetAddrToString(const NetAddr *addr, char *buf, uint32_t bufSize) {
   return false;
 }
 
-bool IsLoopBackAddress(const NetAddr *addr) {
+bool IsLoopBackAddress(const NetAddr* addr) {
   if (addr->raw.family == AF_INET) {
     return (addr->inet.ip == htonl(INADDR_LOOPBACK));
   }
@@ -155,7 +155,7 @@ bool IsLoopBackAddress(const NetAddr *addr) {
   return false;
 }
 
-bool IsIPAddrAny(const NetAddr *addr) {
+bool IsIPAddrAny(const NetAddr* addr) {
   if (addr->raw.family == AF_INET) {
     if (addr->inet.ip == htonl(INADDR_ANY)) {
       return true;
@@ -172,14 +172,14 @@ bool IsIPAddrAny(const NetAddr *addr) {
   return false;
 }
 
-bool IsIPAddrV4Mapped(const NetAddr *addr) {
+bool IsIPAddrV4Mapped(const NetAddr* addr) {
   if (addr->raw.family == AF_INET6) {
     return IPv6ADDR_IS_V4MAPPED(&addr->inet6.ip);
   }
   return false;
 }
 
-bool IsIPAddrLocal(const NetAddr *addr) {
+bool IsIPAddrLocal(const NetAddr* addr) {
   MOZ_ASSERT(addr);
 
   // IPv4 RFC1918 and Link Local Addresses.
@@ -204,7 +204,7 @@ bool IsIPAddrLocal(const NetAddr *addr) {
   return false;
 }
 
-nsresult GetPort(const NetAddr *aAddr, uint16_t *aResult) {
+nsresult GetPort(const NetAddr* aAddr, uint16_t* aResult) {
   uint16_t port;
   if (aAddr->raw.family == PR_AF_INET) {
     port = aAddr->inet.port;
@@ -218,7 +218,7 @@ nsresult GetPort(const NetAddr *aAddr, uint16_t *aResult) {
   return NS_OK;
 }
 
-bool NetAddr::operator==(const NetAddr &other) const {
+bool NetAddr::operator==(const NetAddr& other) const {
   if (this->raw.family != other.raw.family) {
     return false;
   }
@@ -242,7 +242,7 @@ bool NetAddr::operator==(const NetAddr &other) const {
   return false;
 }
 
-bool NetAddr::operator<(const NetAddr &other) const {
+bool NetAddr::operator<(const NetAddr& other) const {
   if (this->raw.family != other.raw.family) {
     return this->raw.family < other.raw.family;
   }
@@ -266,21 +266,21 @@ bool NetAddr::operator<(const NetAddr &other) const {
   return false;
 }
 
-NetAddrElement::NetAddrElement(const PRNetAddr *prNetAddr) {
+NetAddrElement::NetAddrElement(const PRNetAddr* prNetAddr) {
   this->mAddress.raw.family = 0;
   this->mAddress.inet = {};
   PRNetAddrToNetAddr(prNetAddr, &mAddress);
 }
 
-NetAddrElement::NetAddrElement(const NetAddrElement &netAddr) {
+NetAddrElement::NetAddrElement(const NetAddrElement& netAddr) {
   mAddress = netAddr.mAddress;
 }
 
 NetAddrElement::~NetAddrElement() = default;
 
-AddrInfo::AddrInfo(const nsACString &host, const PRAddrInfo *prAddrInfo,
+AddrInfo::AddrInfo(const nsACString& host, const PRAddrInfo* prAddrInfo,
                    bool disableIPv4, bool filterNameCollision,
-                   const nsACString &cname)
+                   const nsACString& cname)
     : mHostName(host),
       mCanonicalName(cname),
       ttl(NO_TTL_DATA),
@@ -290,34 +290,34 @@ AddrInfo::AddrInfo(const nsACString &host, const PRAddrInfo *prAddrInfo,
   const uint32_t nameCollisionAddr = htonl(0x7f003535);  // 127.0.53.53
 
   PRNetAddr tmpAddr;
-  void *iter = nullptr;
+  void* iter = nullptr;
   do {
     iter = PR_EnumerateAddrInfo(iter, prAddrInfo, 0, &tmpAddr);
     bool addIt = iter && (!disableIPv4 || tmpAddr.raw.family != PR_AF_INET) &&
                  (!filterNameCollision || tmpAddr.raw.family != PR_AF_INET ||
                   (tmpAddr.inet.ip != nameCollisionAddr));
     if (addIt) {
-      auto *addrElement = new NetAddrElement(&tmpAddr);
+      auto* addrElement = new NetAddrElement(&tmpAddr);
       mAddresses.insertBack(addrElement);
     }
   } while (iter);
 }
 
-AddrInfo::AddrInfo(const nsACString &host, const nsACString &cname,
+AddrInfo::AddrInfo(const nsACString& host, const nsACString& cname,
                    unsigned int aTRR)
     : mHostName(host),
       mCanonicalName(cname),
       ttl(NO_TTL_DATA),
       mFromTRR(aTRR) {}
 
-AddrInfo::AddrInfo(const nsACString &host, unsigned int aTRR)
+AddrInfo::AddrInfo(const nsACString& host, unsigned int aTRR)
     : mHostName(host),
       mCanonicalName(EmptyCString()),
       ttl(NO_TTL_DATA),
       mFromTRR(aTRR) {}
 
 // deep copy constructor
-AddrInfo::AddrInfo(const AddrInfo *src) {
+AddrInfo::AddrInfo(const AddrInfo* src) {
   mHostName = src->mHostName;
   mCanonicalName = src->mCanonicalName;
   ttl = src->ttl;
@@ -331,7 +331,7 @@ AddrInfo::AddrInfo(const AddrInfo *src) {
 
 AddrInfo::~AddrInfo() {}
 
-void AddrInfo::AddAddress(NetAddrElement *address) {
+void AddrInfo::AddAddress(NetAddrElement* address) {
   MOZ_ASSERT(address, "Cannot add the address to an uninitialized list");
 
   mAddresses.insertBack(address);
diff --git a/netwerk/dns/DNS.h b/netwerk/dns/DNS.h
index 4ceeb7017fa97..960df6763854c 100644
--- a/netwerk/dns/DNS.h
+++ b/netwerk/dns/DNS.h
@@ -107,8 +107,8 @@ union NetAddr {
   } local;
 #endif
   // introduced to support nsTArray comparisons and sorting
-  bool operator==(const NetAddr &other) const;
-  bool operator<(const NetAddr &other) const;
+  bool operator==(const NetAddr& other) const;
+  bool operator<(const NetAddr& other) const;
 };
 
 // This class wraps a NetAddr union to provide C++ linked list
@@ -116,8 +116,8 @@ union NetAddr {
 // which is converted to a mozilla::dns::NetAddr.
 class NetAddrElement : public LinkedListElement {
  public:
-  explicit NetAddrElement(const PRNetAddr *prNetAddr);
-  NetAddrElement(const NetAddrElement &netAddr);
+  explicit NetAddrElement(const PRNetAddr* prNetAddr);
+  NetAddrElement(const NetAddrElement& netAddr);
   ~NetAddrElement();
 
   NetAddr mAddress;
@@ -128,21 +128,21 @@ class AddrInfo {
 
  public:
   // Creates an AddrInfo object.
-  explicit AddrInfo(const nsACString &host, const PRAddrInfo *prAddrInfo,
+  explicit AddrInfo(const nsACString& host, const PRAddrInfo* prAddrInfo,
                     bool disableIPv4, bool filterNameCollision,
-                    const nsACString &cname);
+                    const nsACString& cname);
 
   // Creates a basic AddrInfo object (initialize only the host, cname and TRR
   // type).
-  explicit AddrInfo(const nsACString &host, const nsACString &cname,
+  explicit AddrInfo(const nsACString& host, const nsACString& cname,
                     unsigned int TRRType);
 
   // Creates a basic AddrInfo object (initialize only the host and TRR status).
-  explicit AddrInfo(const nsACString &host, unsigned int TRRType);
+  explicit AddrInfo(const nsACString& host, unsigned int TRRType);
 
-  explicit AddrInfo(const AddrInfo *src);  // copy
+  explicit AddrInfo(const AddrInfo* src);  // copy
 
-  void AddAddress(NetAddrElement *address);
+  void AddAddress(NetAddrElement* address);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
 
@@ -161,23 +161,23 @@ class AddrInfo {
 
 // Copies the contents of a PRNetAddr to a NetAddr.
 // Does not do a ptr safety check!
-void PRNetAddrToNetAddr(const PRNetAddr *prAddr, NetAddr *addr);
+void PRNetAddrToNetAddr(const PRNetAddr* prAddr, NetAddr* addr);
 
 // Copies the contents of a NetAddr to a PRNetAddr.
 // Does not do a ptr safety check!
-void NetAddrToPRNetAddr(const NetAddr *addr, PRNetAddr *prAddr);
+void NetAddrToPRNetAddr(const NetAddr* addr, PRNetAddr* prAddr);
 
-bool NetAddrToString(const NetAddr *addr, char *buf, uint32_t bufSize);
+bool NetAddrToString(const NetAddr* addr, char* buf, uint32_t bufSize);
 
-bool IsLoopBackAddress(const NetAddr *addr);
+bool IsLoopBackAddress(const NetAddr* addr);
 
-bool IsIPAddrAny(const NetAddr *addr);
+bool IsIPAddrAny(const NetAddr* addr);
 
-bool IsIPAddrV4Mapped(const NetAddr *addr);
+bool IsIPAddrV4Mapped(const NetAddr* addr);
 
-bool IsIPAddrLocal(const NetAddr *addr);
+bool IsIPAddrLocal(const NetAddr* addr);
 
-nsresult GetPort(const NetAddr *aAddr, uint16_t *aResult);
+nsresult GetPort(const NetAddr* aAddr, uint16_t* aResult);
 
 }  // namespace net
 }  // namespace mozilla
diff --git a/netwerk/dns/DNSRequestChild.cpp b/netwerk/dns/DNSRequestChild.cpp
index 7e4991dd8aa48..12630713111c4 100644
--- a/netwerk/dns/DNSRequestChild.cpp
+++ b/netwerk/dns/DNSRequestChild.cpp
@@ -33,7 +33,7 @@ class ChildDNSRecord : public nsIDNSRecord {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDNSRECORD
 
-  ChildDNSRecord(const DNSRecord &reply, uint16_t flags);
+  ChildDNSRecord(const DNSRecord& reply, uint16_t flags);
 
  private:
   virtual ~ChildDNSRecord() = default;
@@ -47,12 +47,12 @@ class ChildDNSRecord : public nsIDNSRecord {
 
 NS_IMPL_ISUPPORTS(ChildDNSRecord, nsIDNSRecord)
 
-ChildDNSRecord::ChildDNSRecord(const DNSRecord &reply, uint16_t flags)
+ChildDNSRecord::ChildDNSRecord(const DNSRecord& reply, uint16_t flags)
     : mCurrent(0), mFlags(flags) {
   mCanonicalName = reply.canonicalName();
 
   // A shame IPDL gives us no way to grab ownership of array: so copy it.
-  const nsTArray &addrs = reply.addrs();
+  const nsTArray& addrs = reply.addrs();
   uint32_t i = 0;
   mLength = addrs.Length();
   for (; i < mLength; i++) {
@@ -65,7 +65,7 @@ ChildDNSRecord::ChildDNSRecord(const DNSRecord &reply, uint16_t flags)
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-ChildDNSRecord::GetCanonicalName(nsACString &result) {
+ChildDNSRecord::GetCanonicalName(nsACString& result) {
   if (!(mFlags & nsHostResolver::RES_CANON_NAME)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -75,13 +75,13 @@ ChildDNSRecord::GetCanonicalName(nsACString &result) {
 }
 
 NS_IMETHODIMP
-ChildDNSRecord::IsTRR(bool *retval) {
+ChildDNSRecord::IsTRR(bool* retval) {
   *retval = false;
   return NS_ERROR_NOT_AVAILABLE;
 }
 
 NS_IMETHODIMP
-ChildDNSRecord::GetNextAddr(uint16_t port, NetAddr *addr) {
+ChildDNSRecord::GetNextAddr(uint16_t port, NetAddr* addr) {
   if (mCurrent >= mLength) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -95,14 +95,14 @@ ChildDNSRecord::GetNextAddr(uint16_t port, NetAddr *addr) {
 }
 
 NS_IMETHODIMP
-ChildDNSRecord::GetAddresses(nsTArray &aAddressArray) {
+ChildDNSRecord::GetAddresses(nsTArray& aAddressArray) {
   aAddressArray = mAddresses;
   return NS_OK;
 }
 
 // shamelessly copied from nsDNSRecord
 NS_IMETHODIMP
-ChildDNSRecord::GetScriptableNextAddr(uint16_t port, nsINetAddr **result) {
+ChildDNSRecord::GetScriptableNextAddr(uint16_t port, nsINetAddr** result) {
   NetAddr addr;
   nsresult rv = GetNextAddr(port, &addr);
   if (NS_FAILED(rv)) return rv;
@@ -114,7 +114,7 @@ ChildDNSRecord::GetScriptableNextAddr(uint16_t port, nsINetAddr **result) {
 
 // also copied from nsDNSRecord
 NS_IMETHODIMP
-ChildDNSRecord::GetNextAddrAsString(nsACString &result) {
+ChildDNSRecord::GetNextAddrAsString(nsACString& result) {
   NetAddr addr;
   nsresult rv = GetNextAddr(0, &addr);
   if (NS_FAILED(rv)) {
@@ -131,7 +131,7 @@ ChildDNSRecord::GetNextAddrAsString(nsACString &result) {
 }
 
 NS_IMETHODIMP
-ChildDNSRecord::HasMore(bool *result) {
+ChildDNSRecord::HasMore(bool* result) {
   *result = mCurrent < mLength;
   return NS_OK;
 }
@@ -154,7 +154,7 @@ class ChildDNSByTypeRecord : public nsIDNSByTypeRecord {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDNSBYTYPERECORD
 
-  explicit ChildDNSByTypeRecord(const nsTArray &reply);
+  explicit ChildDNSByTypeRecord(const nsTArray& reply);
 
  private:
   virtual ~ChildDNSByTypeRecord() = default;
@@ -164,18 +164,18 @@ class ChildDNSByTypeRecord : public nsIDNSByTypeRecord {
 
 NS_IMPL_ISUPPORTS(ChildDNSByTypeRecord, nsIDNSByTypeRecord)
 
-ChildDNSByTypeRecord::ChildDNSByTypeRecord(const nsTArray &reply) {
+ChildDNSByTypeRecord::ChildDNSByTypeRecord(const nsTArray& reply) {
   mRecords = reply;
 }
 
 NS_IMETHODIMP
-ChildDNSByTypeRecord::GetRecords(nsTArray &aRecords) {
+ChildDNSByTypeRecord::GetRecords(nsTArray& aRecords) {
   aRecords = mRecords;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-ChildDNSByTypeRecord::GetRecordsAsOneString(nsACString &aRecords) {
+ChildDNSByTypeRecord::GetRecordsAsOneString(nsACString& aRecords) {
   // deep copy
   for (uint32_t i = 0; i < mRecords.Length(); i++) {
     aRecords.Append(mRecords[i]);
@@ -189,7 +189,7 @@ ChildDNSByTypeRecord::GetRecordsAsOneString(nsACString &aRecords) {
 
 class CancelDNSRequestEvent : public Runnable {
  public:
-  CancelDNSRequestEvent(DNSRequestChild *aDnsReq, nsresult aReason)
+  CancelDNSRequestEvent(DNSRequestChild* aDnsReq, nsresult aReason)
       : Runnable("net::CancelDNSRequestEvent"),
         mDnsRequest(aDnsReq),
         mReasonForCancel(aReason) {}
@@ -213,11 +213,11 @@ class CancelDNSRequestEvent : public Runnable {
 // DNSRequestChild
 //-----------------------------------------------------------------------------
 
-DNSRequestChild::DNSRequestChild(const nsACString &aHost, const uint16_t &aType,
-                                 const OriginAttributes &aOriginAttributes,
-                                 const uint32_t &aFlags,
-                                 nsIDNSListener *aListener,
-                                 nsIEventTarget *target)
+DNSRequestChild::DNSRequestChild(const nsACString& aHost, const uint16_t& aType,
+                                 const OriginAttributes& aOriginAttributes,
+                                 const uint32_t& aFlags,
+                                 nsIDNSListener* aListener,
+                                 nsIEventTarget* target)
     : mListener(aListener),
       mTarget(target),
       mResultStatus(NS_OK),
@@ -242,8 +242,8 @@ void DNSRequestChild::StartRequest() {
 
   gNeckoChild->SetEventTargetForActor(this, systemGroupEventTarget);
 
-  mozilla::dom::ContentChild *cc =
-      static_cast(gNeckoChild->Manager());
+  mozilla::dom::ContentChild* cc =
+      static_cast(gNeckoChild->Manager());
   if (cc->IsShuttingDown()) {
     return;
   }
@@ -269,7 +269,7 @@ void DNSRequestChild::CallOnLookupByTypeComplete() {
 }
 
 mozilla::ipc::IPCResult DNSRequestChild::RecvLookupCompleted(
-    const DNSRequestResponse &reply) {
+    const DNSRequestResponse& reply) {
   mIPCOpen = false;
   MOZ_ASSERT(mListener);
 
diff --git a/netwerk/dns/DNSRequestParent.cpp b/netwerk/dns/DNSRequestParent.cpp
index 41da820267526..92933f029558f 100644
--- a/netwerk/dns/DNSRequestParent.cpp
+++ b/netwerk/dns/DNSRequestParent.cpp
@@ -21,8 +21,8 @@ namespace net {
 
 DNSRequestParent::DNSRequestParent() : mFlags(0), mIPCClosed(false) {}
 
-void DNSRequestParent::DoAsyncResolve(const nsACString &hostname,
-                                      const OriginAttributes &originAttributes,
+void DNSRequestParent::DoAsyncResolve(const nsACString& hostname,
+                                      const OriginAttributes& originAttributes,
                                       uint32_t flags) {
   nsresult rv;
   mFlags = flags;
@@ -41,9 +41,9 @@ void DNSRequestParent::DoAsyncResolve(const nsACString &hostname,
 }
 
 mozilla::ipc::IPCResult DNSRequestParent::RecvCancelDNSRequest(
-    const nsCString &hostName, const uint16_t &type,
-    const OriginAttributes &originAttributes, const uint32_t &flags,
-    const nsresult &reason) {
+    const nsCString& hostName, const uint16_t& type,
+    const OriginAttributes& originAttributes, const uint32_t& flags,
+    const nsresult& reason) {
   nsresult rv;
   nsCOMPtr dns = do_GetService(NS_DNSSERVICE_CONTRACTID, &rv);
   if (NS_SUCCEEDED(rv)) {
@@ -80,7 +80,7 @@ NS_IMPL_ISUPPORTS(DNSRequestParent, nsIDNSListener)
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-DNSRequestParent::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec,
+DNSRequestParent::OnLookupComplete(nsICancelable* request, nsIDNSRecord* rec,
                                    nsresult status) {
   if (mIPCClosed) {
     // nothing to do: child probably crashed
@@ -112,8 +112,8 @@ DNSRequestParent::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec,
 }
 
 NS_IMETHODIMP
-DNSRequestParent::OnLookupByTypeComplete(nsICancelable *aRequest,
-                                         nsIDNSByTypeRecord *aRes,
+DNSRequestParent::OnLookupByTypeComplete(nsICancelable* aRequest,
+                                         nsIDNSByTypeRecord* aRes,
                                          nsresult aStatus) {
   if (mIPCClosed) {
     // nothing to do: child probably crashed
diff --git a/netwerk/dns/TRR.cpp b/netwerk/dns/TRR.cpp
index 8b91096d989ec..993ac30e567b3 100644
--- a/netwerk/dns/TRR.cpp
+++ b/netwerk/dns/TRR.cpp
@@ -45,7 +45,7 @@ NS_IMPL_ISUPPORTS(TRR, nsIHttpPushListener, nsIInterfaceRequestor,
 const uint8_t kDNS_CLASS_IN = 1;
 
 NS_IMETHODIMP
-TRR::Notify(nsITimer *aTimer) {
+TRR::Notify(nsITimer* aTimer) {
   if (aTimer == mTimeout) {
     mTimeout = nullptr;
     Cancel();
@@ -58,7 +58,7 @@ TRR::Notify(nsITimer *aTimer) {
 
 // convert a given host request to a DOH 'body'
 //
-nsresult TRR::DohEncode(nsCString &aBody, bool aDisableECS) {
+nsresult TRR::DohEncode(nsCString& aBody, bool aDisableECS) {
   aBody.Truncate();
   // Header
   aBody += '\0';
@@ -209,7 +209,7 @@ nsresult TRR::SendHTTPRequest() {
     /* For GET requests, the outgoing packet needs to be Base64url-encoded and
        then appended to the end of the URI. */
     rv = Base64URLEncode(tmp.Length(),
-                         reinterpret_cast(tmp.get()),
+                         reinterpret_cast(tmp.get()),
                          Base64URLEncodePaddingPolicy::Omit, body);
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -319,7 +319,7 @@ nsresult TRR::SendHTTPRequest() {
 }
 
 NS_IMETHODIMP
-TRR::GetInterface(const nsIID &iid, void **result) {
+TRR::GetInterface(const nsIID& iid, void** result) {
   if (!iid.Equals(NS_GET_IID(nsIHttpPushListener))) {
     return NS_ERROR_NO_INTERFACE;
   }
@@ -329,8 +329,8 @@ TRR::GetInterface(const nsIID &iid, void **result) {
   return NS_OK;
 }
 
-nsresult TRR::DohDecodeQuery(const nsCString &query, nsCString &host,
-                             enum TrrType &type) {
+nsresult TRR::DohDecodeQuery(const nsCString& query, nsCString& host,
+                             enum TrrType& type) {
   FallibleTArray binary;
   bool found_dns = false;
   LOG(("TRR::DohDecodeQuery %s!\n", query.get()));
@@ -339,7 +339,7 @@ nsresult TRR::DohDecodeQuery(const nsCString &query, nsCString &host,
   nsCCharSeparatedTokenizer tokenizer(query, '&');
   nsAutoCString data;
   while (tokenizer.hasMoreTokens()) {
-    const nsACString &token = tokenizer.nextToken();
+    const nsACString& token = tokenizer.nextToken();
     nsDependentCSubstring dns = Substring(token, 0, 4);
     nsAutoCString check(dns);
     if (check.Equals("dns=")) {
@@ -386,7 +386,7 @@ nsresult TRR::DohDecodeQuery(const nsCString &query, nsCString &host,
       if (avail < (index + 1 + length)) {
         return NS_ERROR_UNEXPECTED;
       }
-      host.Append((const char *)(&binary[0]) + index + 1, length);
+      host.Append((const char*)(&binary[0]) + index + 1, length);
     }
     index += 1 + length;  // skip length byte + label
   } while (length);
@@ -406,7 +406,7 @@ nsresult TRR::DohDecodeQuery(const nsCString &query, nsCString &host,
   return NS_OK;
 }
 
-nsresult TRR::ReceivePush(nsIHttpChannel *pushed, nsHostRecord *pushedRec) {
+nsresult TRR::ReceivePush(nsIHttpChannel* pushed, nsHostRecord* pushedRec) {
   if (!mHostResolver) {
     return NS_ERROR_UNEXPECTED;
   }
@@ -461,7 +461,7 @@ nsresult TRR::ReceivePush(nsIHttpChannel *pushed, nsHostRecord *pushedRec) {
 }
 
 NS_IMETHODIMP
-TRR::OnPush(nsIHttpChannel *associated, nsIHttpChannel *pushed) {
+TRR::OnPush(nsIHttpChannel* associated, nsIHttpChannel* pushed) {
   LOG(("TRR::OnPush entry\n"));
   MOZ_ASSERT(associated == mChannel);
   if (!mRec) {
@@ -473,22 +473,22 @@ TRR::OnPush(nsIHttpChannel *associated, nsIHttpChannel *pushed) {
 }
 
 NS_IMETHODIMP
-TRR::OnStartRequest(nsIRequest *aRequest) {
+TRR::OnStartRequest(nsIRequest* aRequest) {
   LOG(("TRR::OnStartRequest %p %s %d\n", this, mHost.get(), mType));
   mStartTime = TimeStamp::Now();
   return NS_OK;
 }
 
-static uint16_t get16bit(unsigned char *aData, int index) {
+static uint16_t get16bit(unsigned char* aData, int index) {
   return ((aData[index] << 8) | aData[index + 1]);
 }
 
-static uint32_t get32bit(unsigned char *aData, int index) {
+static uint32_t get32bit(unsigned char* aData, int index) {
   return (aData[index] << 24) | (aData[index + 1] << 16) |
          (aData[index + 2] << 8) | aData[index + 3];
 }
 
-nsresult TRR::PassQName(unsigned int &index) {
+nsresult TRR::PassQName(unsigned int& index) {
   uint8_t length;
   do {
     if (mBodySize < (index + 1)) {
@@ -521,7 +521,7 @@ nsresult TRR::PassQName(unsigned int &index) {
 // GetQname: retrieves the qname (stores in 'aQname') and stores the index
 // after qname was parsed into the 'aIndex'.
 
-nsresult TRR::GetQname(nsAutoCString &aQname, unsigned int &aIndex) {
+nsresult TRR::GetQname(nsAutoCString& aQname, unsigned int& aIndex) {
   uint8_t clength = 0;
   unsigned int cindex = aIndex;
   unsigned int loop = 128;    // a valid DNS name can never loop this much
@@ -559,7 +559,7 @@ nsresult TRR::GetQname(nsAutoCString &aQname, unsigned int &aIndex) {
       if ((cindex + clength) > mBodySize) {
         return NS_ERROR_ILLEGAL_VALUE;
       }
-      aQname.Append((const char *)(&mResponse[cindex]), clength);
+      aQname.Append((const char*)(&mResponse[cindex]), clength);
       cindex += clength;  // skip label
     }
   } while (clength && --loop);
@@ -579,7 +579,7 @@ nsresult TRR::GetQname(nsAutoCString &aQname, unsigned int &aIndex) {
 //
 // DohDecode() collects the TTL and the IP addresses in the response
 //
-nsresult TRR::DohDecode(nsCString &aHost) {
+nsresult TRR::DohDecode(nsCString& aHost) {
   // The response has a 12 byte header followed by the question (returned)
   // and then the answer. The answer section itself contains the name, type
   // and class again and THEN the record data.
@@ -627,7 +627,7 @@ nsresult TRR::DohDecode(nsCString &aHost) {
         if (mBodySize < (index + 1 + length)) {
           return NS_ERROR_ILLEGAL_VALUE;
         }
-        host.Append(((char *)mResponse) + index + 1, length);
+        host.Append(((char*)mResponse) + index + 1, length);
       }
       index += 1 + length;  // skip length byte + label
     } while (length);
@@ -767,8 +767,7 @@ nsresult TRR::DohDecode(nsCString &aHost) {
               LOG(("TRR::DohDecode MALFORMED TXT RECORD\n"));
               break;
             }
-            txt.Append((const char *)(&mResponse[txtIndex]),
-                       characterStringLen);
+            txt.Append((const char*)(&mResponse[txtIndex]), characterStringLen);
             txtIndex += characterStringLen;
             available -= characterStringLen;
           }
@@ -876,12 +875,12 @@ nsresult TRR::ReturnData() {
   if (mType != TRRTYPE_TXT) {
     // create and populate an AddrInfo instance to pass on
     RefPtr ai(new AddrInfo(mHost, mType));
-    DOHaddr *item;
+    DOHaddr* item;
     uint32_t ttl = AddrInfo::NO_TTL_DATA;
-    while ((item = static_cast(mDNS.mAddresses.popFirst()))) {
+    while ((item = static_cast(mDNS.mAddresses.popFirst()))) {
       PRNetAddr prAddr;
       NetAddrToPRNetAddr(&item->mNet, &prAddr);
-      auto *addrElement = new NetAddrElement(&prAddr);
+      auto* addrElement = new NetAddrElement(&prAddr);
       ai->AddAddress(addrElement);
       if (item->mTtl < ttl) {
         // While the DNS packet might return individual TTLs for each address,
@@ -965,7 +964,7 @@ nsresult TRR::On200Response() {
 }
 
 NS_IMETHODIMP
-TRR::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) {
+TRR::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
   // The dtor will be run after the function returns
   LOG(("TRR:OnStopRequest %p %s %d failed=%d code=%X\n", this, mHost.get(),
        mType, mFailed, (unsigned int)aStatusCode));
@@ -1013,7 +1012,7 @@ TRR::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) {
 }
 
 NS_IMETHODIMP
-TRR::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aInputStream,
+TRR::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aInputStream,
                      uint64_t aOffset, const uint32_t aCount) {
   LOG(("TRR:OnDataAvailable %p %s %d failed=%d aCount=%u\n", this, mHost.get(),
        mType, mFailed, (unsigned int)aCount));
@@ -1030,7 +1029,7 @@ TRR::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aInputStream,
 
   uint32_t count;
   nsresult rv =
-      aInputStream->Read((char *)mResponse + mBodySize, aCount, &count);
+      aInputStream->Read((char*)mResponse + mBodySize, aCount, &count);
   if (NS_FAILED(rv)) {
     LOG(("TRR::OnDataAvailable:%d fail\n", __LINE__));
     mFailed = true;
@@ -1041,10 +1040,10 @@ TRR::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aInputStream,
   return NS_OK;
 }
 
-nsresult DOHresp::Add(uint32_t TTL, unsigned char *dns, int index, uint16_t len,
+nsresult DOHresp::Add(uint32_t TTL, unsigned char* dns, int index, uint16_t len,
                       bool aLocalAllowed) {
   nsAutoPtr doh(new DOHaddr);
-  NetAddr *addr = &doh->mNet;
+  NetAddr* addr = &doh->mNet;
   if (4 == len) {
     // IPv4
     addr->inet.family = AF_INET;
@@ -1079,7 +1078,7 @@ nsresult DOHresp::Add(uint32_t TTL, unsigned char *dns, int index, uint16_t len,
 
 class ProxyCancel : public Runnable {
  public:
-  explicit ProxyCancel(TRR *aTRR) : Runnable("proxyTrrCancel"), mTRR(aTRR) {}
+  explicit ProxyCancel(TRR* aTRR) : Runnable("proxyTrrCancel"), mTRR(aTRR) {}
 
   NS_IMETHOD Run() override {
     mTRR->Cancel();
diff --git a/netwerk/dns/TRR.h b/netwerk/dns/TRR.h
index 900ecd5e11c29..5d33a655c49cc 100644
--- a/netwerk/dns/TRR.h
+++ b/netwerk/dns/TRR.h
@@ -31,17 +31,17 @@ class DOHaddr : public LinkedListElement {
 };
 
 class TRRService;
-extern TRRService *gTRRService;
+extern TRRService* gTRRService;
 
 class DOHresp {
  public:
   ~DOHresp() {
-    DOHaddr *el;
+    DOHaddr* el;
     while ((el = mAddresses.popLast())) {
       delete el;
     }
   }
-  nsresult Add(uint32_t TTL, unsigned char *dns, int index, uint16_t len,
+  nsresult Add(uint32_t TTL, unsigned char* dns, int index, uint16_t len,
                bool aLocalAllowed);
   LinkedList mAddresses;
 };
@@ -67,7 +67,7 @@ class TRR : public Runnable,
   static const unsigned int kCnameChaseMax = 64;
 
   // when firing off a normal A or AAAA query
-  explicit TRR(AHostResolver *aResolver, nsHostRecord *aRec, enum TrrType aType)
+  explicit TRR(AHostResolver* aResolver, nsHostRecord* aRec, enum TrrType aType)
       : mozilla::Runnable("TRR"),
         mRec(aRec),
         mHostResolver(aResolver),
@@ -83,8 +83,8 @@ class TRR : public Runnable,
   }
 
   // when following CNAMEs
-  explicit TRR(AHostResolver *aResolver, nsHostRecord *aRec, nsCString &aHost,
-               enum TrrType &aType, unsigned int aLoopCount, bool aPB)
+  explicit TRR(AHostResolver* aResolver, nsHostRecord* aRec, nsCString& aHost,
+               enum TrrType& aType, unsigned int aLoopCount, bool aPB)
       : mozilla::Runnable("TRR"),
         mHost(aHost),
         mRec(aRec),
@@ -99,7 +99,7 @@ class TRR : public Runnable,
         mOriginSuffix(aRec ? aRec->originSuffix : EmptyCString()) {}
 
   // used on push
-  explicit TRR(AHostResolver *aResolver, bool aPB)
+  explicit TRR(AHostResolver* aResolver, bool aPB)
       : mozilla::Runnable("TRR"),
         mHostResolver(aResolver),
         mType(TRRTYPE_A),
@@ -111,8 +111,8 @@ class TRR : public Runnable,
         mTxtTtl(UINT32_MAX) {}
 
   // to verify a domain
-  explicit TRR(AHostResolver *aResolver, nsACString &aHost, enum TrrType aType,
-               const nsACString &aOriginSuffix, bool aPB)
+  explicit TRR(AHostResolver* aResolver, nsACString& aHost, enum TrrType aType,
+               const nsACString& aOriginSuffix, bool aPB)
       : mozilla::Runnable("TRR"),
         mHost(aHost),
         mRec(nullptr),
@@ -136,10 +136,10 @@ class TRR : public Runnable,
  private:
   ~TRR() = default;
   nsresult SendHTTPRequest();
-  nsresult DohEncode(nsCString &target, bool aDisableECS);
-  nsresult PassQName(unsigned int &index);
-  nsresult GetQname(nsAutoCString &aQname, unsigned int &aIndex);
-  nsresult DohDecode(nsCString &aHost);
+  nsresult DohEncode(nsCString& target, bool aDisableECS);
+  nsresult PassQName(unsigned int& index);
+  nsresult GetQname(nsAutoCString& aQname, unsigned int& aIndex);
+  nsresult DohDecode(nsCString& aHost);
   nsresult ReturnData();
 
   // FailData() must be called to signal that the asynch TRR resolve is
@@ -149,9 +149,9 @@ class TRR : public Runnable,
   // other error codes must be used. This distinction is important for the
   // subsequent logic to separate the error reasons.
   nsresult FailData(nsresult error);
-  nsresult DohDecodeQuery(const nsCString &query, nsCString &host,
-                          enum TrrType &type);
-  nsresult ReceivePush(nsIHttpChannel *pushed, nsHostRecord *pushedRec);
+  nsresult DohDecodeQuery(const nsCString& query, nsCString& host,
+                          enum TrrType& type);
+  nsresult ReceivePush(nsIHttpChannel* pushed, nsHostRecord* pushedRec);
   nsresult On200Response();
 
   nsCOMPtr mChannel;
diff --git a/netwerk/dns/TRRService.cpp b/netwerk/dns/TRRService.cpp
index d2d00e8607401..3a2fa46752a3e 100644
--- a/netwerk/dns/TRRService.cpp
+++ b/netwerk/dns/TRRService.cpp
@@ -29,7 +29,7 @@ namespace net {
 extern mozilla::LazyLogModule gHostResolverLog;
 #define LOG(args) MOZ_LOG(gHostResolverLog, mozilla::LogLevel::Debug, args)
 
-TRRService *gTRRService = nullptr;
+TRRService* gTRRService = nullptr;
 
 NS_IMPL_ISUPPORTS(TRRService, nsIObserver, nsISupportsWeakReference)
 
@@ -116,13 +116,13 @@ bool TRRService::Enabled() {
   return (mConfirmationState == CONFIRM_OK);
 }
 
-void TRRService::GetPrefBranch(nsIPrefBranch **result) {
+void TRRService::GetPrefBranch(nsIPrefBranch** result) {
   MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
   *result = nullptr;
   CallGetService(NS_PREFSERVICE_CONTRACTID, result);
 }
 
-nsresult TRRService::ReadPrefs(const char *name) {
+nsresult TRRService::ReadPrefs(const char* name) {
   MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
   if (!name || !strcmp(name, TRR_PREF("mode"))) {
     // 0 - off, 1 - parallel, 2 - TRR first, 3 - TRR only, 4 - shadow,
@@ -164,7 +164,7 @@ nsresult TRRService::ReadPrefs(const char *name) {
           nsAutoCString prefix(openBrace.nextToken());
 
           // if there is an open brace, there's another token
-          const nsACString &endBrace = openBrace.nextToken();
+          const nsACString& endBrace = openBrace.nextToken();
           nsCCharSeparatedTokenizer closeBrace(endBrace, '}');
           if (closeBrace.hasMoreTokens()) {
             // there is a close brace as well, make a URI out of the prefix
@@ -281,13 +281,13 @@ nsresult TRRService::ReadPrefs(const char *name) {
   return NS_OK;
 }
 
-nsresult TRRService::GetURI(nsCString &result) {
+nsresult TRRService::GetURI(nsCString& result) {
   MutexAutoLock lock(mLock);
   result = mPrivateURI;
   return NS_OK;
 }
 
-nsresult TRRService::GetCredentials(nsCString &result) {
+nsresult TRRService::GetCredentials(nsCString& result) {
   MutexAutoLock lock(mLock);
   result = mPrivateCred;
   return NS_OK;
@@ -308,8 +308,8 @@ TRRService::~TRRService() {
 }
 
 NS_IMETHODIMP
-TRRService::Observe(nsISupports *aSubject, const char *aTopic,
-                    const char16_t *aData) {
+TRRService::Observe(nsISupports* aSubject, const char* aTopic,
+                    const char16_t* aData) {
   MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
   LOG(("TRR::Observe() topic=%s\n", aTopic));
   if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
@@ -380,7 +380,7 @@ void TRRService::MaybeConfirm_locked() {
     LOG(
         ("TRRService:MaybeConfirm mode=%d, mConfirmer=%p "
          "mConfirmationState=%d\n",
-         (int)mMode, (void *)mConfirmer, (int)mConfirmationState));
+         (int)mMode, (void*)mConfirmer, (int)mConfirmationState));
     return;
   }
 
@@ -397,8 +397,8 @@ void TRRService::MaybeConfirm_locked() {
   }
 }
 
-bool TRRService::MaybeBootstrap(const nsACString &aPossible,
-                                nsACString &aResult) {
+bool TRRService::MaybeBootstrap(const nsACString& aPossible,
+                                nsACString& aResult) {
   MutexAutoLock lock(mLock);
   if (TRR_DISABLED(mMode) || mBootstrapAddr.IsEmpty()) {
     return false;
@@ -429,8 +429,8 @@ bool TRRService::MaybeBootstrap(const nsACString &aPossible,
 
 // When running in TRR-only mode, the blacklist is not used and it will also
 // try resolving the localhost / .local names.
-bool TRRService::IsTRRBlacklisted(const nsACString &aHost,
-                                  const nsACString &aOriginSuffix,
+bool TRRService::IsTRRBlacklisted(const nsACString& aHost,
+                                  const nsACString& aOriginSuffix,
                                   bool aPrivateBrowsing,
                                   bool aParentsToo)  // false if domain
 {
@@ -509,7 +509,7 @@ bool TRRService::IsTRRBlacklisted(const nsACString &aHost,
   return false;
 }
 
-bool TRRService::IsExcludedFromTRR(const nsACString &aHost) {
+bool TRRService::IsExcludedFromTRR(const nsACString& aHost) {
   if (mExcludedDomains.GetEntry(aHost)) {
     LOG(("Host [%s] Is Excluded From TRR via pref\n", aHost.BeginReading()));
     return true;
@@ -533,8 +533,8 @@ bool TRRService::IsExcludedFromTRR(const nsACString &aHost) {
 
 class ProxyBlacklist : public Runnable {
  public:
-  ProxyBlacklist(TRRService *service, const nsACString &aHost,
-                 const nsACString &aOriginSuffix, bool pb, bool aParentsToo)
+  ProxyBlacklist(TRRService* service, const nsACString& aHost,
+                 const nsACString& aOriginSuffix, bool pb, bool aParentsToo)
       : mozilla::Runnable("proxyBlackList"),
         mService(service),
         mHost(aHost),
@@ -556,8 +556,8 @@ class ProxyBlacklist : public Runnable {
   bool mParentsToo;
 };
 
-void TRRService::TRRBlacklist(const nsACString &aHost,
-                              const nsACString &aOriginSuffix,
+void TRRService::TRRBlacklist(const nsACString& aHost,
+                              const nsACString& aOriginSuffix,
                               bool privateBrowsing, bool aParentsToo) {
   {
     MutexAutoLock lock(mLock);
@@ -609,7 +609,7 @@ void TRRService::TRRBlacklist(const nsACString &aHost,
 }
 
 NS_IMETHODIMP
-TRRService::Notify(nsITimer *aTimer) {
+TRRService::Notify(nsITimer* aTimer) {
   if (aTimer == mRetryConfirmTimer) {
     mRetryConfirmTimer = nullptr;
     if (mConfirmationState == CONFIRM_FAILED) {
@@ -648,8 +648,8 @@ void TRRService::TRRIsOkay(enum TrrOkay aReason) {
 }
 
 AHostResolver::LookupStatus TRRService::CompleteLookup(
-    nsHostRecord *rec, nsresult status, AddrInfo *aNewRRSet, bool pb,
-    const nsACString &aOriginSuffix) {
+    nsHostRecord* rec, nsresult status, AddrInfo* aNewRRSet, bool pb,
+    const nsACString& aOriginSuffix) {
   // this is an NS check for the TRR blacklist or confirmationNS check
 
   MOZ_ASSERT(NS_IsMainThread());
@@ -705,7 +705,7 @@ AHostResolver::LookupStatus TRRService::CompleteLookup(
 }
 
 AHostResolver::LookupStatus TRRService::CompleteLookupByType(
-    nsHostRecord *, nsresult, const nsTArray *aResult, uint32_t aTtl,
+    nsHostRecord*, nsresult, const nsTArray* aResult, uint32_t aTtl,
     bool aPb) {
   return LOOKUP_OK;
 }
diff --git a/netwerk/dns/TRRService.h b/netwerk/dns/TRRService.h
index 7924a6700402d..950dfc022129a 100644
--- a/netwerk/dns/TRRService.h
+++ b/netwerk/dns/TRRService.h
@@ -37,31 +37,31 @@ class TRRService : public nsIObserver,
   bool EarlyAAAA() { return mEarlyAAAA; }
   bool DisableIPv6() { return mDisableIPv6; }
   bool DisableECS() { return mDisableECS; }
-  nsresult GetURI(nsCString &result);
-  nsresult GetCredentials(nsCString &result);
+  nsresult GetURI(nsCString& result);
+  nsresult GetCredentials(nsCString& result);
   uint32_t GetRequestTimeout() { return mTRRTimeout; }
 
-  LookupStatus CompleteLookup(nsHostRecord *, nsresult,
-                              mozilla::net::AddrInfo *, bool pb,
-                              const nsACString &aOriginSuffix) override;
-  LookupStatus CompleteLookupByType(nsHostRecord *, nsresult,
-                                    const nsTArray *, uint32_t,
+  LookupStatus CompleteLookup(nsHostRecord*, nsresult, mozilla::net::AddrInfo*,
+                              bool pb,
+                              const nsACString& aOriginSuffix) override;
+  LookupStatus CompleteLookupByType(nsHostRecord*, nsresult,
+                                    const nsTArray*, uint32_t,
                                     bool pb) override;
-  void TRRBlacklist(const nsACString &host, const nsACString &originSuffix,
+  void TRRBlacklist(const nsACString& host, const nsACString& originSuffix,
                     bool privateBrowsing, bool aParentsToo);
-  bool IsTRRBlacklisted(const nsACString &aHost,
-                        const nsACString &aOriginSuffix, bool aPrivateBrowsing,
+  bool IsTRRBlacklisted(const nsACString& aHost,
+                        const nsACString& aOriginSuffix, bool aPrivateBrowsing,
                         bool aParentsToo);
-  bool IsExcludedFromTRR(const nsACString &aHost);
+  bool IsExcludedFromTRR(const nsACString& aHost);
 
-  bool MaybeBootstrap(const nsACString &possible, nsACString &result);
+  bool MaybeBootstrap(const nsACString& possible, nsACString& result);
   enum TrrOkay { OKAY_NORMAL = 0, OKAY_TIMEOUT = 1, OKAY_BAD = 2 };
   void TRRIsOkay(enum TrrOkay aReason);
 
  private:
   virtual ~TRRService();
-  nsresult ReadPrefs(const char *name);
-  void GetPrefBranch(nsIPrefBranch **result);
+  nsresult ReadPrefs(const char* name);
+  void GetPrefBranch(nsIPrefBranch** result);
   void MaybeConfirm();
   void MaybeConfirm_locked();
 
@@ -113,7 +113,7 @@ class TRRService : public nsIObserver,
   Atomic mTRRFailures;
 };
 
-extern TRRService *gTRRService;
+extern TRRService* gTRRService;
 
 }  // namespace net
 }  // namespace mozilla
diff --git a/netwerk/dns/nsDNSService2.cpp b/netwerk/dns/nsDNSService2.cpp
index ed20e02016b83..665726360cd17 100644
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -67,7 +67,7 @@ class nsDNSRecord : public nsIDNSRecord {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDNSRECORD
 
-  explicit nsDNSRecord(nsHostRecord *hostRecord)
+  explicit nsDNSRecord(nsHostRecord* hostRecord)
       : mIter(nullptr), mIterGenCnt(-1), mDone(false) {
     mHostRecord = do_QueryObject(hostRecord);
   }
@@ -76,7 +76,7 @@ class nsDNSRecord : public nsIDNSRecord {
   virtual ~nsDNSRecord() = default;
 
   RefPtr mHostRecord;
-  NetAddrElement *mIter;
+  NetAddrElement* mIter;
   int mIterGenCnt;  // the generation count of
                     // mHostRecord->addr_info when we
                     // start iterating
@@ -86,7 +86,7 @@ class nsDNSRecord : public nsIDNSRecord {
 NS_IMPL_ISUPPORTS(nsDNSRecord, nsIDNSRecord)
 
 NS_IMETHODIMP
-nsDNSRecord::GetCanonicalName(nsACString &result) {
+nsDNSRecord::GetCanonicalName(nsACString& result) {
   // this method should only be called if we have a CNAME
   NS_ENSURE_TRUE(mHostRecord->flags & nsHostResolver::RES_CANON_NAME,
                  NS_ERROR_NOT_AVAILABLE);
@@ -109,7 +109,7 @@ nsDNSRecord::GetCanonicalName(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsDNSRecord::IsTRR(bool *retval) {
+nsDNSRecord::IsTRR(bool* retval) {
   MutexAutoLock lock(mHostRecord->addr_info_lock);
   if (mHostRecord->addr_info) {
     *retval = mHostRecord->addr_info->IsTRR();
@@ -119,7 +119,7 @@ nsDNSRecord::IsTRR(bool *retval) {
   return NS_OK;
 }
 NS_IMETHODIMP
-nsDNSRecord::GetNextAddr(uint16_t port, NetAddr *addr) {
+nsDNSRecord::GetNextAddr(uint16_t port, NetAddr* addr) {
   if (mDone) {
     return NS_ERROR_NOT_AVAILABLE;
   }
@@ -185,19 +185,19 @@ nsDNSRecord::GetNextAddr(uint16_t port, NetAddr *addr) {
 }
 
 NS_IMETHODIMP
-nsDNSRecord::GetAddresses(nsTArray &aAddressArray) {
+nsDNSRecord::GetAddresses(nsTArray& aAddressArray) {
   if (mDone) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   mHostRecord->addr_info_lock.Lock();
   if (mHostRecord->addr_info) {
-    for (NetAddrElement *iter = mHostRecord->addr_info->mAddresses.getFirst();
+    for (NetAddrElement* iter = mHostRecord->addr_info->mAddresses.getFirst();
          iter; iter = iter->getNext()) {
       if (mHostRecord->Blacklisted(&iter->mAddress)) {
         continue;
       }
-      NetAddr *addr = aAddressArray.AppendElement(NetAddr());
+      NetAddr* addr = aAddressArray.AppendElement(NetAddr());
       memcpy(addr, &iter->mAddress, sizeof(NetAddr));
       if (addr->raw.family == AF_INET) {
         addr->inet.port = 0;
@@ -212,7 +212,7 @@ nsDNSRecord::GetAddresses(nsTArray &aAddressArray) {
     if (!mHostRecord->addr) {
       return NS_ERROR_NOT_AVAILABLE;
     }
-    NetAddr *addr = aAddressArray.AppendElement(NetAddr());
+    NetAddr* addr = aAddressArray.AppendElement(NetAddr());
     memcpy(addr, mHostRecord->addr.get(), sizeof(NetAddr));
     if (addr->raw.family == AF_INET) {
       addr->inet.port = 0;
@@ -224,7 +224,7 @@ nsDNSRecord::GetAddresses(nsTArray &aAddressArray) {
 }
 
 NS_IMETHODIMP
-nsDNSRecord::GetScriptableNextAddr(uint16_t port, nsINetAddr **result) {
+nsDNSRecord::GetScriptableNextAddr(uint16_t port, nsINetAddr** result) {
   NetAddr addr;
   nsresult rv = GetNextAddr(port, &addr);
   if (NS_FAILED(rv)) return rv;
@@ -235,7 +235,7 @@ nsDNSRecord::GetScriptableNextAddr(uint16_t port, nsINetAddr **result) {
 }
 
 NS_IMETHODIMP
-nsDNSRecord::GetNextAddrAsString(nsACString &result) {
+nsDNSRecord::GetNextAddrAsString(nsACString& result) {
   NetAddr addr;
   nsresult rv = GetNextAddr(0, &addr);
   if (NS_FAILED(rv)) return rv;
@@ -250,13 +250,13 @@ nsDNSRecord::GetNextAddrAsString(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsDNSRecord::HasMore(bool *result) {
+nsDNSRecord::HasMore(bool* result) {
   if (mDone) {
     *result = false;
     return NS_OK;
   }
 
-  NetAddrElement *iterCopy = mIter;
+  NetAddrElement* iterCopy = mIter;
   int iterGenCntCopy = mIterGenCnt;
 
   NetAddr addr;
@@ -300,7 +300,7 @@ class nsDNSByTypeRecord : public nsIDNSByTypeRecord {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDNSBYTYPERECORD
 
-  explicit nsDNSByTypeRecord(nsHostRecord *hostRecord) {
+  explicit nsDNSByTypeRecord(nsHostRecord* hostRecord) {
     mHostRecord = do_QueryObject(hostRecord);
   }
 
@@ -312,14 +312,14 @@ class nsDNSByTypeRecord : public nsIDNSByTypeRecord {
 NS_IMPL_ISUPPORTS(nsDNSByTypeRecord, nsIDNSByTypeRecord)
 
 NS_IMETHODIMP
-nsDNSByTypeRecord::GetRecords(nsTArray &aRecords) {
+nsDNSByTypeRecord::GetRecords(nsTArray& aRecords) {
   // deep copy
   mHostRecord->GetRecords(aRecords);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDNSByTypeRecord::GetRecordsAsOneString(nsACString &aRecords) {
+nsDNSByTypeRecord::GetRecordsAsOneString(nsACString& aRecords) {
   // deep copy
   mHostRecord->GetRecordsAsOneString(aRecords);
   return NS_OK;
@@ -333,8 +333,8 @@ class nsDNSAsyncRequest final : public nsResolveHostCallback,
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICANCELABLE
 
-  nsDNSAsyncRequest(nsHostResolver *res, const nsACString &host, uint16_t type,
-                    const OriginAttributes &attrs, nsIDNSListener *listener,
+  nsDNSAsyncRequest(nsHostResolver* res, const nsACString& host, uint16_t type,
+                    const OriginAttributes& attrs, nsIDNSListener* listener,
                     uint16_t flags, uint16_t af)
       : mResolver(res),
         mHost(host),
@@ -344,12 +344,11 @@ class nsDNSAsyncRequest final : public nsResolveHostCallback,
         mFlags(flags),
         mAF(af) {}
 
-  void OnResolveHostComplete(nsHostResolver *, nsHostRecord *,
-                             nsresult) override;
+  void OnResolveHostComplete(nsHostResolver*, nsHostRecord*, nsresult) override;
   // Returns TRUE if the DNS listener arg is the same as the member listener
   // Used in Cancellations to remove DNS requests associated with a
   // particular hostname and nsIDNSListener
-  bool EqualsAsyncListener(nsIDNSListener *aListener) override;
+  bool EqualsAsyncListener(nsIDNSListener* aListener) override;
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf) const override;
 
@@ -368,8 +367,8 @@ class nsDNSAsyncRequest final : public nsResolveHostCallback,
 
 NS_IMPL_ISUPPORTS(nsDNSAsyncRequest, nsICancelable)
 
-void nsDNSAsyncRequest::OnResolveHostComplete(nsHostResolver *resolver,
-                                              nsHostRecord *hostRecord,
+void nsDNSAsyncRequest::OnResolveHostComplete(nsHostResolver* resolver,
+                                              nsHostRecord* hostRecord,
                                               nsresult status) {
   if (hostRecord->type != nsDNSService::RESOLVE_TYPE_DEFAULT) {
     nsCOMPtr rec;
@@ -393,7 +392,7 @@ void nsDNSAsyncRequest::OnResolveHostComplete(nsHostResolver *resolver,
   mListener = nullptr;
 }
 
-bool nsDNSAsyncRequest::EqualsAsyncListener(nsIDNSListener *aListener) {
+bool nsDNSAsyncRequest::EqualsAsyncListener(nsIDNSListener* aListener) {
   nsCOMPtr wrapper = do_QueryInterface(mListener);
   if (wrapper) {
     nsCOMPtr originalListener;
@@ -427,12 +426,11 @@ nsDNSAsyncRequest::Cancel(nsresult reason) {
 class nsDNSSyncRequest : public nsResolveHostCallback {
   NS_DECL_THREADSAFE_ISUPPORTS
  public:
-  explicit nsDNSSyncRequest(PRMonitor *mon)
+  explicit nsDNSSyncRequest(PRMonitor* mon)
       : mDone(false), mStatus(NS_OK), mMonitor(mon) {}
 
-  void OnResolveHostComplete(nsHostResolver *, nsHostRecord *,
-                             nsresult) override;
-  bool EqualsAsyncListener(nsIDNSListener *aListener) override;
+  void OnResolveHostComplete(nsHostResolver*, nsHostRecord*, nsresult) override;
+  bool EqualsAsyncListener(nsIDNSListener* aListener) override;
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf) const override;
 
   bool mDone;
@@ -442,13 +440,13 @@ class nsDNSSyncRequest : public nsResolveHostCallback {
  private:
   virtual ~nsDNSSyncRequest() = default;
 
-  PRMonitor *mMonitor;
+  PRMonitor* mMonitor;
 };
 
 NS_IMPL_ISUPPORTS0(nsDNSSyncRequest)
 
-void nsDNSSyncRequest::OnResolveHostComplete(nsHostResolver *resolver,
-                                             nsHostRecord *hostRecord,
+void nsDNSSyncRequest::OnResolveHostComplete(nsHostResolver* resolver,
+                                             nsHostRecord* hostRecord,
                                              nsresult status) {
   // store results, and wake up nsDNSService::Resolve to process results.
   PR_EnterMonitor(mMonitor);
@@ -459,7 +457,7 @@ void nsDNSSyncRequest::OnResolveHostComplete(nsHostResolver *resolver,
   PR_ExitMonitor(mMonitor);
 }
 
-bool nsDNSSyncRequest::EqualsAsyncListener(nsIDNSListener *aListener) {
+bool nsDNSSyncRequest::EqualsAsyncListener(nsIDNSListener* aListener) {
   // Sync request: no listener to compare
   return false;
 }
@@ -479,7 +477,7 @@ size_t nsDNSSyncRequest::SizeOfIncludingThis(MallocSizeOf mallocSizeOf) const {
 
 class NotifyDNSResolution : public Runnable {
  public:
-  explicit NotifyDNSResolution(const nsACString &aHostname)
+  explicit NotifyDNSResolution(const nsACString& aHostname)
       : mozilla::Runnable("NotifyDNSResolution"), mHostname(aHostname) {}
 
   NS_IMETHOD Run() override {
@@ -547,7 +545,7 @@ already_AddRefed nsDNSService::GetSingleton() {
   return do_AddRef(gDNSService);
 }
 
-nsresult nsDNSService::ReadPrefs(const char *name) {
+nsresult nsDNSService::ReadPrefs(const char* name) {
   bool tmpbool;
   uint32_t tmpint;
   mResolverPrefsUpdated = false;
@@ -734,7 +732,7 @@ bool nsDNSService::GetOffline() const {
 }
 
 NS_IMETHODIMP
-nsDNSService::GetPrefetchEnabled(bool *outVal) {
+nsDNSService::GetPrefetchEnabled(bool* outVal) {
   MutexAutoLock lock(mLock);
   *outVal = !mDisablePrefetch;
   return NS_OK;
@@ -748,9 +746,9 @@ nsDNSService::SetPrefetchEnabled(bool inVal) {
 }
 
 nsresult nsDNSService::PreprocessHostname(bool aLocalDomain,
-                                          const nsACString &aInput,
-                                          nsIIDNService *aIDN,
-                                          nsACString &aACE) {
+                                          const nsACString& aInput,
+                                          nsIIDNService* aIDN,
+                                          nsACString& aACE) {
   // Enforce RFC 7686
   if (mBlockDotOnion && StringEndsWith(aInput, NS_LITERAL_CSTRING(".onion"))) {
     return NS_ERROR_UNKNOWN_HOST;
@@ -786,9 +784,9 @@ nsresult nsDNSService::PreprocessHostname(bool aLocalDomain,
 }
 
 nsresult nsDNSService::AsyncResolveInternal(
-    const nsACString &aHostname, uint16_t type, uint32_t flags,
-    nsIDNSListener *aListener, nsIEventTarget *target_,
-    const OriginAttributes &aOriginAttributes, nsICancelable **result) {
+    const nsACString& aHostname, uint16_t type, uint32_t flags,
+    nsIDNSListener* aListener, nsIEventTarget* target_,
+    const OriginAttributes& aOriginAttributes, nsICancelable** result) {
   // grab reference to global host resolver and IDN service.  beware
   // simultaneous shutdown!!
   RefPtr res;
@@ -853,9 +851,9 @@ nsresult nsDNSService::AsyncResolveInternal(
 }
 
 nsresult nsDNSService::CancelAsyncResolveInternal(
-    const nsACString &aHostname, uint16_t aType, uint32_t aFlags,
-    nsIDNSListener *aListener, nsresult aReason,
-    const OriginAttributes &aOriginAttributes) {
+    const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
+    nsIDNSListener* aListener, nsresult aReason,
+    const OriginAttributes& aOriginAttributes) {
   // grab reference to global host resolver and IDN service.  beware
   // simultaneous shutdown!!
   RefPtr res;
@@ -888,10 +886,10 @@ nsresult nsDNSService::CancelAsyncResolveInternal(
 }
 
 NS_IMETHODIMP
-nsDNSService::AsyncResolve(const nsACString &aHostname, uint32_t flags,
-                           nsIDNSListener *listener, nsIEventTarget *target_,
-                           JS::HandleValue aOriginAttributes, JSContext *aCx,
-                           uint8_t aArgc, nsICancelable **result) {
+nsDNSService::AsyncResolve(const nsACString& aHostname, uint32_t flags,
+                           nsIDNSListener* listener, nsIEventTarget* target_,
+                           JS::HandleValue aOriginAttributes, JSContext* aCx,
+                           uint8_t aArgc, nsICancelable** result) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -905,22 +903,22 @@ nsDNSService::AsyncResolve(const nsACString &aHostname, uint32_t flags,
 }
 
 NS_IMETHODIMP
-nsDNSService::AsyncResolveNative(const nsACString &aHostname, uint32_t flags,
-                                 nsIDNSListener *aListener,
-                                 nsIEventTarget *target_,
-                                 const OriginAttributes &aOriginAttributes,
-                                 nsICancelable **result) {
+nsDNSService::AsyncResolveNative(const nsACString& aHostname, uint32_t flags,
+                                 nsIDNSListener* aListener,
+                                 nsIEventTarget* target_,
+                                 const OriginAttributes& aOriginAttributes,
+                                 nsICancelable** result) {
   return AsyncResolveInternal(aHostname, RESOLVE_TYPE_DEFAULT, flags, aListener,
                               target_, aOriginAttributes, result);
 }
 
 NS_IMETHODIMP
-nsDNSService::AsyncResolveByType(const nsACString &aHostname, uint16_t aType,
-                                 uint32_t aFlags, nsIDNSListener *aListener,
-                                 nsIEventTarget *aTarget_,
+nsDNSService::AsyncResolveByType(const nsACString& aHostname, uint16_t aType,
+                                 uint32_t aFlags, nsIDNSListener* aListener,
+                                 nsIEventTarget* aTarget_,
                                  JS::HandleValue aOriginAttributes,
-                                 JSContext *aCx, uint8_t aArgc,
-                                 nsICancelable **aResult) {
+                                 JSContext* aCx, uint8_t aArgc,
+                                 nsICancelable** aResult) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -935,18 +933,18 @@ nsDNSService::AsyncResolveByType(const nsACString &aHostname, uint16_t aType,
 
 NS_IMETHODIMP
 nsDNSService::AsyncResolveByTypeNative(
-    const nsACString &aHostname, uint16_t aType, uint32_t aFlags,
-    nsIDNSListener *aListener, nsIEventTarget *aTarget_,
-    const OriginAttributes &aOriginAttributes, nsICancelable **aResult) {
+    const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
+    nsIDNSListener* aListener, nsIEventTarget* aTarget_,
+    const OriginAttributes& aOriginAttributes, nsICancelable** aResult) {
   return AsyncResolveInternal(aHostname, aType, aFlags, aListener, aTarget_,
                               aOriginAttributes, aResult);
 }
 
 NS_IMETHODIMP
-nsDNSService::CancelAsyncResolve(const nsACString &aHostname, uint32_t aFlags,
-                                 nsIDNSListener *aListener, nsresult aReason,
+nsDNSService::CancelAsyncResolve(const nsACString& aHostname, uint32_t aFlags,
+                                 nsIDNSListener* aListener, nsresult aReason,
                                  JS::HandleValue aOriginAttributes,
-                                 JSContext *aCx, uint8_t aArgc) {
+                                 JSContext* aCx, uint8_t aArgc) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -961,19 +959,19 @@ nsDNSService::CancelAsyncResolve(const nsACString &aHostname, uint32_t aFlags,
 
 NS_IMETHODIMP
 nsDNSService::CancelAsyncResolveNative(
-    const nsACString &aHostname, uint32_t aFlags, nsIDNSListener *aListener,
-    nsresult aReason, const OriginAttributes &aOriginAttributes) {
+    const nsACString& aHostname, uint32_t aFlags, nsIDNSListener* aListener,
+    nsresult aReason, const OriginAttributes& aOriginAttributes) {
   return CancelAsyncResolveInternal(aHostname, RESOLVE_TYPE_DEFAULT, aFlags,
                                     aListener, aReason, aOriginAttributes);
 }
 
 NS_IMETHODIMP
-nsDNSService::CancelAsyncResolveByType(const nsACString &aHostname,
+nsDNSService::CancelAsyncResolveByType(const nsACString& aHostname,
                                        uint16_t aType, uint32_t aFlags,
-                                       nsIDNSListener *aListener,
+                                       nsIDNSListener* aListener,
                                        nsresult aReason,
                                        JS::HandleValue aOriginAttributes,
-                                       JSContext *aCx, uint8_t aArgc) {
+                                       JSContext* aCx, uint8_t aArgc) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -988,17 +986,17 @@ nsDNSService::CancelAsyncResolveByType(const nsACString &aHostname,
 
 NS_IMETHODIMP
 nsDNSService::CancelAsyncResolveByTypeNative(
-    const nsACString &aHostname, uint16_t aType, uint32_t aFlags,
-    nsIDNSListener *aListener, nsresult aReason,
-    const OriginAttributes &aOriginAttributes) {
+    const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
+    nsIDNSListener* aListener, nsresult aReason,
+    const OriginAttributes& aOriginAttributes) {
   return CancelAsyncResolveInternal(aHostname, aType, aFlags, aListener,
                                     aReason, aOriginAttributes);
 }
 
 NS_IMETHODIMP
-nsDNSService::Resolve(const nsACString &aHostname, uint32_t flags,
-                      JS::HandleValue aOriginAttributes, JSContext *aCx,
-                      uint8_t aArgc, nsIDNSRecord **result) {
+nsDNSService::Resolve(const nsACString& aHostname, uint32_t flags,
+                      JS::HandleValue aOriginAttributes, JSContext* aCx,
+                      uint8_t aArgc, nsIDNSRecord** result) {
   OriginAttributes attrs;
 
   if (aArgc == 1) {
@@ -1011,9 +1009,9 @@ nsDNSService::Resolve(const nsACString &aHostname, uint32_t flags,
 }
 
 NS_IMETHODIMP
-nsDNSService::ResolveNative(const nsACString &aHostname, uint32_t flags,
-                            const OriginAttributes &aOriginAttributes,
-                            nsIDNSRecord **result) {
+nsDNSService::ResolveNative(const nsACString& aHostname, uint32_t flags,
+                            const OriginAttributes& aOriginAttributes,
+                            nsIDNSRecord** result) {
   // Synchronous resolution is not available on the main thread.
   if (NS_IsMainThread()) {
     return NS_ERROR_NOT_AVAILABLE;
@@ -1023,14 +1021,14 @@ nsDNSService::ResolveNative(const nsACString &aHostname, uint32_t flags,
 }
 
 nsresult nsDNSService::DeprecatedSyncResolve(
-    const nsACString &aHostname, uint32_t flags,
-    const OriginAttributes &aOriginAttributes, nsIDNSRecord **result) {
+    const nsACString& aHostname, uint32_t flags,
+    const OriginAttributes& aOriginAttributes, nsIDNSRecord** result) {
   return ResolveInternal(aHostname, flags, aOriginAttributes, result);
 }
 
 nsresult nsDNSService::ResolveInternal(
-    const nsACString &aHostname, uint32_t flags,
-    const OriginAttributes &aOriginAttributes, nsIDNSRecord **result) {
+    const nsACString& aHostname, uint32_t flags,
+    const OriginAttributes& aOriginAttributes, nsIDNSRecord** result) {
   // grab reference to global host resolver and IDN service.  beware
   // simultaneous shutdown!!
   RefPtr res;
@@ -1068,7 +1066,7 @@ nsresult nsDNSService::ResolveInternal(
   // we need to use a monitor! ;-)
   //
 
-  PRMonitor *mon = PR_NewMonitor();
+  PRMonitor* mon = PR_NewMonitor();
   if (!mon) return NS_ERROR_OUT_OF_MEMORY;
 
   PR_EnterMonitor(mon);
@@ -1099,7 +1097,7 @@ nsresult nsDNSService::ResolveInternal(
 }
 
 NS_IMETHODIMP
-nsDNSService::GetMyHostName(nsACString &result) {
+nsDNSService::GetMyHostName(nsACString& result) {
   char name[100];
   if (PR_GetSystemInfo(PR_SI_HOSTNAME, name, sizeof(name)) == PR_SUCCESS) {
     result = name;
@@ -1109,8 +1107,8 @@ nsDNSService::GetMyHostName(nsACString &result) {
 }
 
 NS_IMETHODIMP
-nsDNSService::Observe(nsISupports *subject, const char *topic,
-                      const char16_t *data) {
+nsDNSService::Observe(nsISupports* subject, const char* topic,
+                      const char16_t* data) {
   bool flushCache = false;
   if (!strcmp(topic, NS_NETWORK_LINK_TOPIC)) {
     nsAutoCString converted = NS_ConvertUTF16toUTF8(data);
@@ -1138,7 +1136,7 @@ nsDNSService::Observe(nsISupports *subject, const char *topic,
   return NS_OK;
 }
 
-uint16_t nsDNSService::GetAFForLookup(const nsACString &host, uint32_t flags) {
+uint16_t nsDNSService::GetAFForLookup(const nsACString& host, uint32_t flags) {
   if (mDisableIPv6 || (flags & RESOLVE_DISABLE_IPV6)) return PR_AF_INET;
 
   MutexAutoLock lock(mLock);
@@ -1169,7 +1167,7 @@ uint16_t nsDNSService::GetAFForLookup(const nsACString &host, uint32_t flags) {
       // matches the end of the hostname.
       domainLen = end - domain;
       if (domainLen && hostLen >= domainLen) {
-        const char *hostTail = hostStart.get() + hostLen - domainLen;
+        const char* hostTail = hostStart.get() + hostLen - domainLen;
         if (PL_strncasecmp(domain, hostTail, domainLen) == 0) {
           // now, make sure either that the hostname is a direct match or
           // that the hostname begins with a dot.
@@ -1192,7 +1190,7 @@ uint16_t nsDNSService::GetAFForLookup(const nsACString &host, uint32_t flags) {
 
 NS_IMETHODIMP
 nsDNSService::GetDNSCacheEntries(
-    nsTArray *args) {
+    nsTArray* args) {
   NS_ENSURE_TRUE(mResolver, NS_ERROR_NOT_INITIALIZED);
   mResolver->GetDNSCacheEntries(args);
   return NS_OK;
@@ -1221,8 +1219,8 @@ size_t nsDNSService::SizeOfIncludingThis(
 MOZ_DEFINE_MALLOC_SIZE_OF(DNSServiceMallocSizeOf)
 
 NS_IMETHODIMP
-nsDNSService::CollectReports(nsIHandleReportCallback *aHandleReport,
-                             nsISupports *aData, bool aAnonymize) {
+nsDNSService::CollectReports(nsIHandleReportCallback* aHandleReport,
+                             nsISupports* aData, bool aAnonymize) {
   MOZ_COLLECT_REPORT("explicit/network/dns-service", KIND_HEAP, UNITS_BYTES,
                      SizeOfIncludingThis(DNSServiceMallocSizeOf),
                      "Memory used for the DNS service.");
diff --git a/netwerk/dns/nsDNSService2.h b/netwerk/dns/nsDNSService2.h
index f9c31bbb26de9..e68337681315f 100644
--- a/netwerk/dns/nsDNSService2.h
+++ b/netwerk/dns/nsDNSService2.h
@@ -44,35 +44,35 @@ class nsDNSService final : public nsPIDNSService,
   friend class nsAuthSSPI;
 
   nsresult DeprecatedSyncResolve(
-      const nsACString &aHostname, uint32_t flags,
-      const mozilla::OriginAttributes &aOriginAttributes,
-      nsIDNSRecord **result);
+      const nsACString& aHostname, uint32_t flags,
+      const mozilla::OriginAttributes& aOriginAttributes,
+      nsIDNSRecord** result);
 
  private:
   ~nsDNSService();
 
-  nsresult ReadPrefs(const char *name);
+  nsresult ReadPrefs(const char* name);
   static already_AddRefed GetSingleton();
 
-  uint16_t GetAFForLookup(const nsACString &host, uint32_t flags);
+  uint16_t GetAFForLookup(const nsACString& host, uint32_t flags);
 
-  nsresult PreprocessHostname(bool aLocalDomain, const nsACString &aInput,
-                              nsIIDNService *aIDN, nsACString &aACE);
+  nsresult PreprocessHostname(bool aLocalDomain, const nsACString& aInput,
+                              nsIIDNService* aIDN, nsACString& aACE);
 
   nsresult AsyncResolveInternal(
-      const nsACString &aHostname, uint16_t type, uint32_t flags,
-      nsIDNSListener *aListener, nsIEventTarget *target_,
-      const mozilla::OriginAttributes &aOriginAttributes,
-      nsICancelable **result);
+      const nsACString& aHostname, uint16_t type, uint32_t flags,
+      nsIDNSListener* aListener, nsIEventTarget* target_,
+      const mozilla::OriginAttributes& aOriginAttributes,
+      nsICancelable** result);
 
   nsresult CancelAsyncResolveInternal(
-      const nsACString &aHostname, uint16_t aType, uint32_t aFlags,
-      nsIDNSListener *aListener, nsresult aReason,
-      const mozilla::OriginAttributes &aOriginAttributes);
+      const nsACString& aHostname, uint16_t aType, uint32_t aFlags,
+      nsIDNSListener* aListener, nsresult aReason,
+      const mozilla::OriginAttributes& aOriginAttributes);
 
-  nsresult ResolveInternal(const nsACString &aHostname, uint32_t flags,
-                           const mozilla::OriginAttributes &aOriginAttributes,
-                           nsIDNSRecord **result);
+  nsresult ResolveInternal(const nsACString& aHostname, uint32_t flags,
+                           const mozilla::OriginAttributes& aOriginAttributes,
+                           nsIDNSRecord** result);
 
   RefPtr mResolver;
   nsCOMPtr mIDN;
diff --git a/netwerk/dns/nsEffectiveTLDService.cpp b/netwerk/dns/nsEffectiveTLDService.cpp
index 463179037d552..763b106c29e31 100644
--- a/netwerk/dns/nsEffectiveTLDService.cpp
+++ b/netwerk/dns/nsEffectiveTLDService.cpp
@@ -36,7 +36,7 @@ NS_IMPL_ISUPPORTS(nsEffectiveTLDService, nsIEffectiveTLDService,
 
 // ----------------------------------------------------------------------
 
-static nsEffectiveTLDService *gService = nullptr;
+static nsEffectiveTLDService* gService = nullptr;
 
 nsEffectiveTLDService::nsEffectiveTLDService()
     : mIDNService(), mGraph(etld_dafsa::kDafsa) {}
@@ -65,7 +65,7 @@ nsEffectiveTLDService::~nsEffectiveTLDService() {
 }
 
 // static
-nsEffectiveTLDService *nsEffectiveTLDService::GetInstance() {
+nsEffectiveTLDService* nsEffectiveTLDService::GetInstance() {
   if (gService) {
     return gService;
   }
@@ -87,8 +87,8 @@ MOZ_DEFINE_MALLOC_SIZE_OF(EffectiveTLDServiceMallocSizeOf)
 // Nonetheless, we keep this code here in anticipation of bug 1083971 which will
 // change ETLDEntries::entries to a heap-allocated array modifiable at runtime.
 NS_IMETHODIMP
-nsEffectiveTLDService::CollectReports(nsIHandleReportCallback *aHandleReport,
-                                      nsISupports *aData, bool aAnonymize) {
+nsEffectiveTLDService::CollectReports(nsIHandleReportCallback* aHandleReport,
+                                      nsISupports* aData, bool aAnonymize) {
   MOZ_COLLECT_REPORT("explicit/network/effective-TLD-service", KIND_HEAP,
                      UNITS_BYTES,
                      SizeOfIncludingThis(EffectiveTLDServiceMallocSizeOf),
@@ -112,8 +112,8 @@ size_t nsEffectiveTLDService::SizeOfIncludingThis(
 // Pulls out the host portion from an nsIURI, and calls through to
 // GetPublicSuffixFromHost().
 NS_IMETHODIMP
-nsEffectiveTLDService::GetPublicSuffix(nsIURI *aURI,
-                                       nsACString &aPublicSuffix) {
+nsEffectiveTLDService::GetPublicSuffix(nsIURI* aURI,
+                                       nsACString& aPublicSuffix) {
   NS_ENSURE_ARG_POINTER(aURI);
 
   nsAutoCString host;
@@ -129,8 +129,8 @@ nsEffectiveTLDService::GetPublicSuffix(nsIURI *aURI,
 // Pulls out the host portion from an nsIURI, and calls through to
 // GetBaseDomainFromHost().
 NS_IMETHODIMP
-nsEffectiveTLDService::GetBaseDomain(nsIURI *aURI, uint32_t aAdditionalParts,
-                                     nsACString &aBaseDomain) {
+nsEffectiveTLDService::GetBaseDomain(nsIURI* aURI, uint32_t aAdditionalParts,
+                                     nsACString& aBaseDomain) {
   NS_ENSURE_ARG_POINTER(aURI);
   NS_ENSURE_TRUE(((int32_t)aAdditionalParts) >= 0, NS_ERROR_INVALID_ARG);
 
@@ -146,8 +146,8 @@ nsEffectiveTLDService::GetBaseDomain(nsIURI *aURI, uint32_t aAdditionalParts,
 // External function for dealing with a host string directly: finds the public
 // suffix (e.g. co.uk) for the given hostname. See GetBaseDomainInternal().
 NS_IMETHODIMP
-nsEffectiveTLDService::GetPublicSuffixFromHost(const nsACString &aHostname,
-                                               nsACString &aPublicSuffix) {
+nsEffectiveTLDService::GetPublicSuffixFromHost(const nsACString& aHostname,
+                                               nsACString& aPublicSuffix) {
   // Create a mutable copy of the hostname and normalize it to ACE.
   // This will fail if the hostname includes invalid characters.
   nsAutoCString normHostname(aHostname);
@@ -161,9 +161,9 @@ nsEffectiveTLDService::GetPublicSuffixFromHost(const nsACString &aHostname,
 // domain (e.g. www.co.uk) for the given hostname and number of subdomain parts
 // requested. See GetBaseDomainInternal().
 NS_IMETHODIMP
-nsEffectiveTLDService::GetBaseDomainFromHost(const nsACString &aHostname,
+nsEffectiveTLDService::GetBaseDomainFromHost(const nsACString& aHostname,
                                              uint32_t aAdditionalParts,
-                                             nsACString &aBaseDomain) {
+                                             nsACString& aBaseDomain) {
   NS_ENSURE_TRUE(((int32_t)aAdditionalParts) >= 0, NS_ERROR_INVALID_ARG);
 
   // Create a mutable copy of the hostname and normalize it to ACE.
@@ -176,8 +176,8 @@ nsEffectiveTLDService::GetBaseDomainFromHost(const nsACString &aHostname,
 }
 
 NS_IMETHODIMP
-nsEffectiveTLDService::GetNextSubDomain(const nsACString &aHostname,
-                                        nsACString &aBaseDomain) {
+nsEffectiveTLDService::GetNextSubDomain(const nsACString& aHostname,
+                                        nsACString& aBaseDomain) {
   // Create a mutable copy of the hostname and normalize it to ACE.
   // This will fail if the hostname includes invalid characters.
   nsAutoCString normHostname(aHostname);
@@ -192,9 +192,9 @@ nsEffectiveTLDService::GetNextSubDomain(const nsACString &aHostname,
 // if more subdomain parts are requested than are available, or if the hostname
 // includes characters that are not valid in a URL. Normalization is performed
 // on the host string and the result will be in UTF8.
-nsresult nsEffectiveTLDService::GetBaseDomainInternal(nsCString &aHostname,
+nsresult nsEffectiveTLDService::GetBaseDomainInternal(nsCString& aHostname,
                                                       int32_t aAdditionalParts,
-                                                      nsACString &aBaseDomain) {
+                                                      nsACString& aBaseDomain) {
   const int kExceptionRule = 1;
   const int kWildcardRule = 2;
 
@@ -247,12 +247,12 @@ nsresult nsEffectiveTLDService::GetBaseDomainInternal(nsCString &aHostname,
   // Walk up the domain tree, most specific to least specific,
   // looking for matches at each level.  Note that a given level may
   // have multiple attributes (e.g. IsWild() and IsNormal()).
-  const char *prevDomain = nullptr;
-  const char *currDomain = aHostname.get();
-  const char *nextDot = strchr(currDomain, '.');
-  const char *end = currDomain + aHostname.Length();
+  const char* prevDomain = nullptr;
+  const char* currDomain = aHostname.get();
+  const char* nextDot = strchr(currDomain, '.');
+  const char* end = currDomain + aHostname.Length();
   // Default value of *eTLD is currDomain as set in the while loop below
-  const char *eTLD = nullptr;
+  const char* eTLD = nullptr;
   while (true) {
     // sanity check the string we're about to look up: it should not begin with
     // a '.'; this would mean the hostname began with a '.' or had an
@@ -353,7 +353,7 @@ nsresult nsEffectiveTLDService::GetBaseDomainInternal(nsCString &aHostname,
 // Normalizes the given hostname, component by component.  ASCII/ACE
 // components are lower-cased, and UTF-8 components are normalized per
 // RFC 3454 and converted to ACE.
-nsresult nsEffectiveTLDService::NormalizeHostname(nsCString &aHostname) {
+nsresult nsEffectiveTLDService::NormalizeHostname(nsCString& aHostname) {
   if (!IsASCII(aHostname)) {
     nsresult rv = mIDNService->ConvertUTF8toACE(aHostname, aHostname);
     if (NS_FAILED(rv)) return rv;
@@ -364,8 +364,8 @@ nsresult nsEffectiveTLDService::NormalizeHostname(nsCString &aHostname) {
 }
 
 NS_IMETHODIMP
-nsEffectiveTLDService::HasRootDomain(const nsACString &aInput,
-                                     const nsACString &aHost, bool *aResult) {
+nsEffectiveTLDService::HasRootDomain(const nsACString& aInput,
+                                     const nsACString& aHost, bool* aResult) {
   if (NS_WARN_IF(!aResult)) {
     return NS_ERROR_FAILURE;
   }
diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp
index feeb773bca514..f5bbc33e0265c 100644
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -158,8 +158,8 @@ static inline bool IsLowPriority(uint16_t flags) {
 #define IS_ADDR_TYPE(_type) ((_type) == nsIDNSService::RESOLVE_TYPE_DEFAULT)
 #define IS_OTHER_TYPE(_type) ((_type) != nsIDNSService::RESOLVE_TYPE_DEFAULT)
 
-nsHostKey::nsHostKey(const nsACString &aHost, uint16_t aType, uint16_t aFlags,
-                     uint16_t aAf, bool aPb, const nsACString &aOriginsuffix)
+nsHostKey::nsHostKey(const nsACString& aHost, uint16_t aType, uint16_t aFlags,
+                     uint16_t aAf, bool aPb, const nsACString& aOriginsuffix)
     : host(aHost),
       type(aType),
       flags(aFlags),
@@ -172,7 +172,7 @@ nsHostKey::nsHostKey(const nsACString &aHost, uint16_t aType, uint16_t aFlags,
   }
 }
 
-bool nsHostKey::operator==(const nsHostKey &other) const {
+bool nsHostKey::operator==(const nsHostKey& other) const {
   return host == other.host && type == other.type &&
          RES_KEY_FLAGS(flags) == RES_KEY_FLAGS(other.flags) && af == other.af &&
          originSuffix == other.originSuffix;
@@ -193,7 +193,7 @@ size_t nsHostKey::SizeOfExcludingThis(
 
 NS_IMPL_ISUPPORTS0(nsHostRecord)
 
-nsHostRecord::nsHostRecord(const nsHostKey &key)
+nsHostRecord::nsHostRecord(const nsHostKey& key)
     : nsHostKey(key),
       mResolverMode(MODE_NATIVEONLY),
       mResolving(0),
@@ -203,7 +203,7 @@ nsHostRecord::nsHostRecord(const nsHostKey &key)
 void nsHostRecord::Invalidate() { mDoomed = true; }
 
 nsHostRecord::ExpirationStatus nsHostRecord::CheckExpiration(
-    const mozilla::TimeStamp &now) const {
+    const mozilla::TimeStamp& now) const {
   if (!mGraceStart.IsNull() && now >= mGraceStart && !mValidEnd.IsNull() &&
       now < mValidEnd) {
     return nsHostRecord::EXP_GRACE;
@@ -215,7 +215,7 @@ nsHostRecord::ExpirationStatus nsHostRecord::CheckExpiration(
   return nsHostRecord::EXP_EXPIRED;
 }
 
-void nsHostRecord::SetExpiration(const mozilla::TimeStamp &now,
+void nsHostRecord::SetExpiration(const mozilla::TimeStamp& now,
                                  unsigned int valid, unsigned int grace) {
   mValidStart = now;
   if ((valid + grace) < 60) {
@@ -227,7 +227,7 @@ void nsHostRecord::SetExpiration(const mozilla::TimeStamp &now,
 }
 
 void nsHostRecord::CopyExpirationTimesAndFlagsFrom(
-    const nsHostRecord *aFromHostRecord) {
+    const nsHostRecord* aFromHostRecord) {
   // This is used to copy information from a cache entry to a record. All
   // information necessary for HasUsableRecord needs to be copied.
   mValidStart = aFromHostRecord->mValidStart;
@@ -236,7 +236,7 @@ void nsHostRecord::CopyExpirationTimesAndFlagsFrom(
   mDoomed = aFromHostRecord->mDoomed;
 }
 
-bool nsHostRecord::HasUsableResult(const mozilla::TimeStamp &now,
+bool nsHostRecord::HasUsableResult(const mozilla::TimeStamp& now,
                                    uint16_t queryFlags) const {
   if (mDoomed) {
     return false;
@@ -259,11 +259,11 @@ bool nsHostRecord::HasUsableResult(const mozilla::TimeStamp &now,
 }
 
 static size_t SizeOfResolveHostCallbackListExcludingHead(
-    const mozilla::LinkedList> &aCallbacks,
+    const mozilla::LinkedList>& aCallbacks,
     MallocSizeOf mallocSizeOf) {
   size_t n = aCallbacks.sizeOfExcludingThis(mallocSizeOf);
 
-  for (const nsResolveHostCallback *t = aCallbacks.getFirst(); t;
+  for (const nsResolveHostCallback* t = aCallbacks.getFirst(); t;
        t = t->getNext()) {
     n += t->SizeOfIncludingThis(mallocSizeOf);
   }
@@ -273,7 +273,7 @@ static size_t SizeOfResolveHostCallbackListExcludingHead(
 
 NS_IMPL_ISUPPORTS_INHERITED(AddrHostRecord, nsHostRecord, AddrHostRecord)
 
-AddrHostRecord::AddrHostRecord(const nsHostKey &key)
+AddrHostRecord::AddrHostRecord(const nsHostKey& key)
     : nsHostRecord(key),
       addr_info_lock("AddrHostRecord.addr_info_lock"),
       addr_info_gencnt(0),
@@ -300,7 +300,7 @@ AddrHostRecord::~AddrHostRecord() {
   Telemetry::Accumulate(Telemetry::DNS_BLACKLIST_COUNT, mBlacklistedCount);
 }
 
-bool AddrHostRecord::Blacklisted(NetAddr *aQuery) {
+bool AddrHostRecord::Blacklisted(NetAddr* aQuery) {
   // must call locked
   LOG(("Checking blacklist for host [%s], host record [%p].\n", host.get(),
        this));
@@ -326,7 +326,7 @@ bool AddrHostRecord::Blacklisted(NetAddr *aQuery) {
   return false;
 }
 
-void AddrHostRecord::ReportUnusable(NetAddr *aAddress) {
+void AddrHostRecord::ReportUnusable(NetAddr* aAddress) {
   // must call locked
   LOG(
       ("Adding address to blacklist for host [%s], host record [%p]."
@@ -537,7 +537,7 @@ AddrHostRecord::DnsPriority AddrHostRecord::GetPriority(uint16_t aFlags) {
 
 NS_IMPL_ISUPPORTS_INHERITED(TypeHostRecord, nsHostRecord, TypeHostRecord)
 
-TypeHostRecord::TypeHostRecord(const nsHostKey &key)
+TypeHostRecord::TypeHostRecord(const nsHostKey& key)
     : nsHostRecord(key),
       mTrrLock("TypeHostRecord.mTrrLock"),
       mResultsLock("TypeHostRecord.mResultsLock") {}
@@ -548,13 +548,13 @@ bool TypeHostRecord::HasUsableResultInternal() const {
   return !mResults.IsEmpty();
 }
 
-void TypeHostRecord::GetRecords(nsTArray &aRecords) {
+void TypeHostRecord::GetRecords(nsTArray& aRecords) {
   // deep copy
   MutexAutoLock lock(mResultsLock);
   aRecords = mResults;
 }
 
-void TypeHostRecord::GetRecordsAsOneString(nsACString &aRecords) {
+void TypeHostRecord::GetRecordsAsOneString(nsACString& aRecords) {
   // deep copy
   MutexAutoLock lock(mResultsLock);
 
@@ -588,7 +588,7 @@ static const char kPrefThreadIdleTime[] =
 static bool sGetTtlEnabled = false;
 mozilla::Atomic gNativeIsLocalhost;
 
-static void DnsPrefChanged(const char *aPref, nsHostResolver *aSelf) {
+static void DnsPrefChanged(const char* aPref, nsHostResolver* aSelf) {
   MOZ_ASSERT(NS_IsMainThread(),
              "Should be getting pref changed notification on main thread!");
 
@@ -691,7 +691,7 @@ nsresult nsHostResolver::Init() {
 }
 
 void nsHostResolver::ClearPendingQueue(
-    LinkedList> &aPendingQ) {
+    LinkedList>& aPendingQ) {
   // loop through pending queue, erroring out pending lookups.
   if (!aPendingQ.isEmpty()) {
     for (RefPtr rec : aPendingQ) {
@@ -725,14 +725,14 @@ void nsHostResolver::FlushCache(bool aTrrToo) {
   if (!mEvictionQ.isEmpty()) {
     for (RefPtr rec : mEvictionQ) {
       rec->Cancel();
-      mRecordDB.Remove(*static_cast(rec));
+      mRecordDB.Remove(*static_cast(rec));
     }
     mEvictionQ.clear();
   }
 
   // Refresh the cache entries that are resolving RIGHT now, remove the rest.
   for (auto iter = mRecordDB.Iter(); !iter.Done(); iter.Next()) {
-    nsHostRecord *record = iter.UserData();
+    nsHostRecord* record = iter.UserData();
     // Try to remove the record, or mark it for refresh.
     // By-type records are from TRR. We do not need to flush those entry
     // when the network has change, because they are not local.
@@ -811,14 +811,14 @@ void nsHostResolver::Shutdown() {
   }
 }
 
-nsresult nsHostResolver::GetHostRecord(const nsACString &host, uint16_t type,
+nsresult nsHostResolver::GetHostRecord(const nsACString& host, uint16_t type,
                                        uint16_t flags, uint16_t af, bool pb,
-                                       const nsCString &originSuffix,
-                                       nsHostRecord **result) {
+                                       const nsCString& originSuffix,
+                                       nsHostRecord** result) {
   MutexAutoLock lock(mLock);
   nsHostKey key(host, type, flags, af, pb, originSuffix);
 
-  RefPtr &entry = mRecordDB.GetOrInsert(key);
+  RefPtr& entry = mRecordDB.GetOrInsert(key);
   if (!entry) {
     if (IS_ADDR_TYPE(type)) {
       entry = new AddrHostRecord(key);
@@ -842,10 +842,10 @@ nsresult nsHostResolver::GetHostRecord(const nsACString &host, uint16_t type,
   return NS_OK;
 }
 
-nsresult nsHostResolver::ResolveHost(const nsACString &aHost, uint16_t type,
-                                     const OriginAttributes &aOriginAttributes,
+nsresult nsHostResolver::ResolveHost(const nsACString& aHost, uint16_t type,
+                                     const OriginAttributes& aOriginAttributes,
                                      uint16_t flags, uint16_t af,
-                                     nsResolveHostCallback *aCallback) {
+                                     nsResolveHostCallback* aCallback) {
   nsAutoCString host(aHost);
   NS_ENSURE_TRUE(!host.IsEmpty(), NS_ERROR_UNEXPECTED);
 
@@ -898,7 +898,7 @@ nsresult nsHostResolver::ResolveHost(const nsACString &aHost, uint16_t type,
 
       nsHostKey key(host, type, flags, af,
                     (aOriginAttributes.mPrivateBrowsingId > 0), originSuffix);
-      RefPtr &entry = mRecordDB.GetOrInsert(key);
+      RefPtr& entry = mRecordDB.GetOrInsert(key);
       if (!entry) {
         if (IS_ADDR_TYPE(type)) {
           entry = new AddrHostRecord(key);
@@ -1019,7 +1019,7 @@ nsresult nsHostResolver::ResolveHost(const nsACString &aHost, uint16_t type,
               // Search for any valid address in the AF_UNSPEC entry
               // in the cache (not blacklisted and from the right
               // family).
-              NetAddrElement *addrIter =
+              NetAddrElement* addrIter =
                   addrUnspecRec->addr_info->mAddresses.getFirst();
               while (addrIter) {
                 if ((af == addrIter->mAddress.inet.family) &&
@@ -1153,10 +1153,10 @@ nsresult nsHostResolver::ResolveHost(const nsACString &aHost, uint16_t type,
   return rv;
 }
 
-void nsHostResolver::DetachCallback(const nsACString &host, uint16_t aType,
-                                    const OriginAttributes &aOriginAttributes,
+void nsHostResolver::DetachCallback(const nsACString& host, uint16_t aType,
+                                    const OriginAttributes& aOriginAttributes,
                                     uint16_t flags, uint16_t af,
-                                    nsResolveHostCallback *aCallback,
+                                    nsResolveHostCallback* aCallback,
                                     nsresult status) {
   RefPtr rec;
   RefPtr callback(aCallback);
@@ -1174,7 +1174,7 @@ void nsHostResolver::DetachCallback(const nsACString &host, uint16_t aType,
       // walk list looking for |callback|... we cannot assume
       // that it will be there!
 
-      for (nsResolveHostCallback *c : entry->mCallbacks) {
+      for (nsResolveHostCallback* c : entry->mCallbacks) {
         if (c == callback) {
           rec = entry;
           c->remove();
@@ -1191,7 +1191,7 @@ void nsHostResolver::DetachCallback(const nsACString &host, uint16_t aType,
   }
 }
 
-nsresult nsHostResolver::ConditionallyCreateThread(nsHostRecord *rec) {
+nsresult nsHostResolver::ConditionallyCreateThread(nsHostRecord* rec) {
   if (mNumIdleTasks) {
     // wake up idle tasks to process this lookup
     mIdleTaskCV.Notify();
@@ -1216,14 +1216,14 @@ nsresult nsHostResolver::ConditionallyCreateThread(nsHostRecord *rec) {
 // make sure the mTrrLock is held when this is used!
 #define TRROutstanding() ((addrRec->mTrrA || addrRec->mTrrAAAA))
 
-nsresult nsHostResolver::TrrLookup_unlocked(nsHostRecord *rec, TRR *pushedTRR) {
+nsresult nsHostResolver::TrrLookup_unlocked(nsHostRecord* rec, TRR* pushedTRR) {
   MutexAutoLock lock(mLock);
   return TrrLookup(rec, pushedTRR);
 }
 
 // returns error if no TRR resolve is issued
 // it is impt this is not called while a native lookup is going on
-nsresult nsHostResolver::TrrLookup(nsHostRecord *aRec, TRR *pushedTRR) {
+nsresult nsHostResolver::TrrLookup(nsHostRecord* aRec, TRR* pushedTRR) {
   RefPtr rec(aRec);
   mLock.AssertCurrentThreadOwns();
 
@@ -1332,8 +1332,8 @@ nsresult nsHostResolver::TrrLookup(nsHostRecord *aRec, TRR *pushedTRR) {
   return madeQuery ? NS_OK : NS_ERROR_UNKNOWN_HOST;
 }
 
-void nsHostResolver::AssertOnQ(nsHostRecord *rec,
-                               LinkedList> &q) {
+void nsHostResolver::AssertOnQ(nsHostRecord* rec,
+                               LinkedList>& q) {
 #ifdef DEBUG
   MOZ_ASSERT(!q.isEmpty());
   MOZ_ASSERT(rec->isInList());
@@ -1346,7 +1346,7 @@ void nsHostResolver::AssertOnQ(nsHostRecord *rec,
 #endif
 }
 
-nsresult nsHostResolver::NativeLookup(nsHostRecord *aRec) {
+nsresult nsHostResolver::NativeLookup(nsHostRecord* aRec) {
   // Only A/AAAA request are resolve natively.
   MOZ_ASSERT(aRec->IsAddrRecord());
   mLock.AssertCurrentThreadOwns();
@@ -1406,7 +1406,7 @@ ResolverMode nsHostResolver::Mode() {
 }
 
 // Kick-off a name resolve operation, using native resolver and/or TRR
-nsresult nsHostResolver::NameLookup(nsHostRecord *rec) {
+nsresult nsHostResolver::NameLookup(nsHostRecord* rec) {
   nsresult rv = NS_ERROR_UNKNOWN_HOST;
   if (rec->mResolving) {
     LOG(("NameLookup %s while already resolving\n", rec->host.get()));
@@ -1460,8 +1460,8 @@ nsresult nsHostResolver::NameLookup(nsHostRecord *rec) {
   return rv;
 }
 
-nsresult nsHostResolver::ConditionallyRefreshRecord(nsHostRecord *rec,
-                                                    const nsACString &host) {
+nsresult nsHostResolver::ConditionallyRefreshRecord(nsHostRecord* rec,
+                                                    const nsACString& host) {
   if ((rec->CheckExpiration(TimeStamp::NowLoRes()) != nsHostRecord::EXP_VALID ||
        rec->negative) &&
       !rec->mResolving) {
@@ -1478,8 +1478,8 @@ nsresult nsHostResolver::ConditionallyRefreshRecord(nsHostRecord *rec,
   return NS_OK;
 }
 
-void nsHostResolver::DeQueue(LinkedList> &aQ,
-                             AddrHostRecord **aResult) {
+void nsHostResolver::DeQueue(LinkedList>& aQ,
+                             AddrHostRecord** aResult) {
   RefPtr rec = aQ.popFirst();
   mPendingCount--;
   MOZ_ASSERT(rec->IsAddrRecord());
@@ -1489,7 +1489,7 @@ void nsHostResolver::DeQueue(LinkedList> &aQ,
   addrRec.forget(aResult);
 }
 
-bool nsHostResolver::GetHostToLookup(AddrHostRecord **result) {
+bool nsHostResolver::GetHostToLookup(AddrHostRecord** result) {
   bool timedOut = false;
   TimeDuration timeout;
   TimeStamp epoch, now;
@@ -1562,7 +1562,7 @@ bool nsHostResolver::GetHostToLookup(AddrHostRecord **result) {
 }
 
 void nsHostResolver::PrepareRecordExpirationAddrRecord(
-    AddrHostRecord *rec) const {
+    AddrHostRecord* rec) const {
   // NOTE: rec->addr_info_lock is already held by parent
   MOZ_ASSERT(((bool)rec->addr_info) != rec->negative);
   mLock.AssertCurrentThreadOwns();
@@ -1590,11 +1590,11 @@ void nsHostResolver::PrepareRecordExpirationAddrRecord(
        lifetime, grace));
 }
 
-static nsresult merge_rrset(AddrInfo *rrto, AddrInfo *rrfrom) {
+static nsresult merge_rrset(AddrInfo* rrto, AddrInfo* rrfrom) {
   if (!rrto || !rrfrom) {
     return NS_ERROR_NULL_POINTER;
   }
-  NetAddrElement *element;
+  NetAddrElement* element;
   while ((element = rrfrom->mAddresses.getFirst())) {
     element->remove();          // unlist from old
     rrto->AddAddress(element);  // enlist on new
@@ -1602,7 +1602,7 @@ static nsresult merge_rrset(AddrInfo *rrto, AddrInfo *rrfrom) {
   return NS_OK;
 }
 
-static bool different_rrset(AddrInfo *rrset1, AddrInfo *rrset2) {
+static bool different_rrset(AddrInfo* rrset1, AddrInfo* rrset2) {
   if (!rrset1 || !rrset2) {
     return true;
   }
@@ -1615,7 +1615,7 @@ static bool different_rrset(AddrInfo *rrset1, AddrInfo *rrset2) {
     return true;
   }
 
-  for (NetAddrElement *element = rrset1->mAddresses.getFirst(); element;
+  for (NetAddrElement* element = rrset1->mAddresses.getFirst(); element;
        element = element->getNext()) {
     if (LOG_ENABLED()) {
       char buf[128];
@@ -1625,7 +1625,7 @@ static bool different_rrset(AddrInfo *rrset1, AddrInfo *rrset2) {
     orderedSet1.InsertElementAt(orderedSet1.Length(), element->mAddress);
   }
 
-  for (NetAddrElement *element = rrset2->mAddresses.getFirst(); element;
+  for (NetAddrElement* element = rrset2->mAddresses.getFirst(); element;
        element = element->getNext()) {
     if (LOG_ENABLED()) {
       char buf[128];
@@ -1652,7 +1652,7 @@ static bool different_rrset(AddrInfo *rrset1, AddrInfo *rrset2) {
   return false;
 }
 
-void nsHostResolver::AddToEvictionQ(nsHostRecord *rec) {
+void nsHostResolver::AddToEvictionQ(nsHostRecord* rec) {
   MOZ_ASSERT(!rec->isInList());
   mEvictionQ.insertBack(rec);
   if (mEvictionQSize < mMaxCacheEntries) {
@@ -1660,7 +1660,7 @@ void nsHostResolver::AddToEvictionQ(nsHostRecord *rec) {
   } else {
     // remove first element on mEvictionQ
     RefPtr head = mEvictionQ.popFirst();
-    mRecordDB.Remove(*static_cast(head.get()));
+    mRecordDB.Remove(*static_cast(head.get()));
 
     if (!head->negative) {
       // record the age of the entry upon eviction.
@@ -1691,8 +1691,8 @@ void nsHostResolver::AddToEvictionQ(nsHostRecord *rec) {
 // returns LOOKUP_RESOLVEAGAIN, but only if 'status' is not NS_ERROR_ABORT.
 // takes ownership of AddrInfo parameter
 nsHostResolver::LookupStatus nsHostResolver::CompleteLookup(
-    nsHostRecord *rec, nsresult status, AddrInfo *aNewRRSet, bool pb,
-    const nsACString &aOriginsuffix) {
+    nsHostRecord* rec, nsresult status, AddrInfo* aNewRRSet, bool pb,
+    const nsACString& aOriginsuffix) {
   MutexAutoLock lock(mLock);
   MOZ_ASSERT(rec);
   MOZ_ASSERT(rec->pb == pb);
@@ -1865,7 +1865,7 @@ nsHostResolver::LookupStatus nsHostResolver::CompleteLookup(
 
   if (LOG_ENABLED()) {
     MutexAutoLock lock(addrRec->addr_info_lock);
-    NetAddrElement *element;
+    NetAddrElement* element;
     if (addrRec->addr_info) {
       for (element = addrRec->addr_info->mAddresses.getFirst(); element;
            element = element->getNext()) {
@@ -1886,7 +1886,7 @@ nsHostResolver::LookupStatus nsHostResolver::CompleteLookup(
 
     LOG(("nsHostResolver record %p calling back dns users\n", addrRec.get()));
 
-    for (nsResolveHostCallback *c = cbs.getFirst(); c;
+    for (nsResolveHostCallback* c = cbs.getFirst(); c;
          c = c->removeAndGetNext()) {
       c->OnResolveHostComplete(this, rec, status);
     }
@@ -1923,7 +1923,7 @@ nsHostResolver::LookupStatus nsHostResolver::CompleteLookup(
 }
 
 nsHostResolver::LookupStatus nsHostResolver::CompleteLookupByType(
-    nsHostRecord *rec, nsresult status, const nsTArray *aResult,
+    nsHostRecord* rec, nsresult status, const nsTArray* aResult,
     uint32_t aTtl, bool pb) {
   MutexAutoLock lock(mLock);
   MOZ_ASSERT(rec);
@@ -1972,7 +1972,7 @@ nsHostResolver::LookupStatus nsHostResolver::CompleteLookupByType(
        "users\n",
        typeRec.get()));
 
-  for (nsResolveHostCallback *c = cbs.getFirst(); c;
+  for (nsResolveHostCallback* c = cbs.getFirst(); c;
        c = c->removeAndGetNext()) {
     c->OnResolveHostComplete(this, rec, status);
   }
@@ -1982,9 +1982,9 @@ nsHostResolver::LookupStatus nsHostResolver::CompleteLookupByType(
 }
 
 void nsHostResolver::CancelAsyncRequest(
-    const nsACString &host, uint16_t aType,
-    const OriginAttributes &aOriginAttributes, uint16_t flags, uint16_t af,
-    nsIDNSListener *aListener, nsresult status)
+    const nsACString& host, uint16_t aType,
+    const OriginAttributes& aOriginAttributes, uint16_t flags, uint16_t af,
+    nsIDNSListener* aListener, nsresult status)
 
 {
   MutexAutoLock lock(mLock);
@@ -1998,7 +1998,7 @@ void nsHostResolver::CancelAsyncRequest(
                 (aOriginAttributes.mPrivateBrowsingId > 0), originSuffix);
   RefPtr rec = mRecordDB.Get(key);
   if (rec) {
-    nsHostRecord *recPtr = nullptr;
+    nsHostRecord* recPtr = nullptr;
 
     for (RefPtr c : rec->mCallbacks) {
       if (c->EqualsAsyncListener(aListener)) {
@@ -2011,7 +2011,7 @@ void nsHostResolver::CancelAsyncRequest(
 
     // If there are no more callbacks, remove the hash table entry
     if (recPtr && recPtr->mCallbacks.isEmpty()) {
-      mRecordDB.Remove(*static_cast(recPtr));
+      mRecordDB.Remove(*static_cast(recPtr));
       // If record is on a Queue, remove it and then deref it
       if (recPtr->isInList()) {
         recPtr->remove();
@@ -2130,7 +2130,7 @@ void nsHostResolver::SetCacheLimits(uint32_t aMaxCacheEntries,
 nsresult nsHostResolver::Create(uint32_t maxCacheEntries,
                                 uint32_t defaultCacheEntryLifetime,
                                 uint32_t defaultGracePeriod,
-                                nsHostResolver **result) {
+                                nsHostResolver** result) {
   RefPtr res = new nsHostResolver(
       maxCacheEntries, defaultCacheEntryLifetime, defaultGracePeriod);
 
@@ -2143,12 +2143,12 @@ nsresult nsHostResolver::Create(uint32_t maxCacheEntries,
   return NS_OK;
 }
 
-void nsHostResolver::GetDNSCacheEntries(nsTArray *args) {
+void nsHostResolver::GetDNSCacheEntries(nsTArray* args) {
   MutexAutoLock lock(mLock);
   for (auto iter = mRecordDB.Iter(); !iter.Done(); iter.Next()) {
     // We don't pay attention to address literals, only resolved domains.
     // Also require a host.
-    nsHostRecord *rec = iter.UserData();
+    nsHostRecord* rec = iter.UserData();
     MOZ_ASSERT(rec, "rec should never be null here!");
 
     if (!rec) {
@@ -2179,8 +2179,8 @@ void nsHostResolver::GetDNSCacheEntries(nsTArray *args) {
     {
       MutexAutoLock lock(addrRec->addr_info_lock);
 
-      NetAddr *addr = nullptr;
-      NetAddrElement *addrElement = addrRec->addr_info->mAddresses.getFirst();
+      NetAddr* addr = nullptr;
+      NetAddrElement* addrElement = addrRec->addr_info->mAddresses.getFirst();
       if (addrElement) {
         addr = &addrElement->mAddress;
       }
diff --git a/netwerk/dns/nsHostResolver.h b/netwerk/dns/nsHostResolver.h
index 6b281db52ea4e..e697deed52701 100644
--- a/netwerk/dns/nsHostResolver.h
+++ b/netwerk/dns/nsHostResolver.h
@@ -60,9 +60,9 @@ struct nsHostKey {
   uint16_t af;
   bool pb;
   const nsCString originSuffix;
-  explicit nsHostKey(const nsACString &host, uint16_t type, uint16_t flags,
-                     uint16_t af, bool pb, const nsACString &originSuffix);
-  bool operator==(const nsHostKey &other) const;
+  explicit nsHostKey(const nsACString& host, uint16_t type, uint16_t flags,
+                     uint16_t af, bool pb, const nsACString& originSuffix);
+  bool operator==(const nsHostKey& other) const;
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
   PLDHashNumber Hash() const;
 };
@@ -83,7 +83,7 @@ class nsHostRecord : public mozilla::LinkedListElement>,
  protected:
   friend class nsHostResolver;
 
-  explicit nsHostRecord(const nsHostKey &key);
+  explicit nsHostRecord(const nsHostKey& key);
   virtual ~nsHostRecord() = default;
 
   // Mark hostrecord as not usable
@@ -95,16 +95,16 @@ class nsHostRecord : public mozilla::LinkedListElement>,
     EXP_EXPIRED,
   };
 
-  ExpirationStatus CheckExpiration(const mozilla::TimeStamp &now) const;
+  ExpirationStatus CheckExpiration(const mozilla::TimeStamp& now) const;
 
   // Convenience function for setting the timestamps above (mValidStart,
   // mValidEnd, and mGraceStart). valid and grace are durations in seconds.
-  void SetExpiration(const mozilla::TimeStamp &now, unsigned int valid,
+  void SetExpiration(const mozilla::TimeStamp& now, unsigned int valid,
                      unsigned int grace);
-  void CopyExpirationTimesAndFlagsFrom(const nsHostRecord *aFromHostRecord);
+  void CopyExpirationTimesAndFlagsFrom(const nsHostRecord* aFromHostRecord);
 
   // Checks if the record is usable (not expired and has a value)
-  bool HasUsableResult(const mozilla::TimeStamp &now,
+  bool HasUsableResult(const mozilla::TimeStamp& now,
                        uint16_t queryFlags = 0) const;
 
   enum DnsPriority {
@@ -185,9 +185,9 @@ class AddrHostRecord final : public nsHostRecord {
   mozilla::UniquePtr addr;
 
   // hold addr_info_lock when calling the blacklist functions
-  bool Blacklisted(mozilla::net::NetAddr *query);
+  bool Blacklisted(mozilla::net::NetAddr* query);
   void ResetBlacklist();
-  void ReportUnusable(mozilla::net::NetAddr *addr);
+  void ReportUnusable(mozilla::net::NetAddr* addr);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const override;
 
@@ -196,7 +196,7 @@ class AddrHostRecord final : public nsHostRecord {
  private:
   friend class nsHostResolver;
 
-  explicit AddrHostRecord(const nsHostKey &key);
+  explicit AddrHostRecord(const nsHostKey& key);
   ~AddrHostRecord();
 
   // Checks if the record is usable (not expired and has a value)
@@ -275,15 +275,15 @@ class TypeHostRecord final : public nsHostRecord {
   NS_DECLARE_STATIC_IID_ACCESSOR(TYPEHOSTRECORD_IID)
   NS_DECL_ISUPPORTS_INHERITED
 
-  void GetRecords(nsTArray &aRecords);
-  void GetRecordsAsOneString(nsACString &aRecords);
+  void GetRecords(nsTArray& aRecords);
+  void GetRecordsAsOneString(nsACString& aRecords);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const override;
 
  private:
   friend class nsHostResolver;
 
-  explicit TypeHostRecord(const nsHostKey &key);
+  explicit TypeHostRecord(const nsHostKey& key);
   ~TypeHostRecord();
 
   // Checks if the record is usable (not expired and has a value)
@@ -331,8 +331,8 @@ class nsResolveHostCallback
    * @param status
    *        if successful, |record| contains non-null results
    */
-  virtual void OnResolveHostComplete(nsHostResolver *resolver,
-                                     nsHostRecord *record, nsresult status) = 0;
+  virtual void OnResolveHostComplete(nsHostResolver* resolver,
+                                     nsHostRecord* record, nsresult status) = 0;
   /**
    * EqualsAsyncListener
    *
@@ -346,7 +346,7 @@ class nsResolveHostCallback
    * @param aListener
    *        nsIDNSListener object associated with the original request
    */
-  virtual bool EqualsAsyncListener(nsIDNSListener *aListener) = 0;
+  virtual bool EqualsAsyncListener(nsIDNSListener* aListener) = 0;
 
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf) const = 0;
 
@@ -365,20 +365,20 @@ class AHostResolver {
     LOOKUP_RESOLVEAGAIN,
   };
 
-  virtual LookupStatus CompleteLookup(nsHostRecord *, nsresult,
-                                      mozilla::net::AddrInfo *, bool pb,
-                                      const nsACString &aOriginsuffix) = 0;
-  virtual LookupStatus CompleteLookupByType(nsHostRecord *, nsresult,
-                                            const nsTArray *aResult,
+  virtual LookupStatus CompleteLookup(nsHostRecord*, nsresult,
+                                      mozilla::net::AddrInfo*, bool pb,
+                                      const nsACString& aOriginsuffix) = 0;
+  virtual LookupStatus CompleteLookupByType(nsHostRecord*, nsresult,
+                                            const nsTArray* aResult,
                                             uint32_t aTtl, bool pb) = 0;
-  virtual nsresult GetHostRecord(const nsACString &host, uint16_t type,
+  virtual nsresult GetHostRecord(const nsACString& host, uint16_t type,
                                  uint16_t flags, uint16_t af, bool pb,
-                                 const nsCString &originSuffix,
-                                 nsHostRecord **result) {
+                                 const nsCString& originSuffix,
+                                 nsHostRecord** result) {
     return NS_ERROR_FAILURE;
   }
-  virtual nsresult TrrLookup_unlocked(nsHostRecord *,
-                                      mozilla::net::TRR *pushedTRR = nullptr) {
+  virtual nsresult TrrLookup_unlocked(nsHostRecord*,
+                                      mozilla::net::TRR* pushedTRR = nullptr) {
     return NS_ERROR_FAILURE;
   }
 };
@@ -399,7 +399,7 @@ class nsHostResolver : public nsISupports, public AHostResolver {
   static nsresult Create(uint32_t maxCacheEntries,  // zero disables cache
                          uint32_t defaultCacheEntryLifetime,  // seconds
                          uint32_t defaultGracePeriod,         // seconds
-                         nsHostResolver **resolver);
+                         nsHostResolver** resolver);
 
   /**
    * Set (new) cache limits.
@@ -421,10 +421,10 @@ class nsHostResolver : public nsISupports, public AHostResolver {
    * host lookup cannot be canceled (cancelation can be layered above this by
    * having the callback implementation return without doing anything).
    */
-  nsresult ResolveHost(const nsACString &hostname, uint16_t type,
-                       const mozilla::OriginAttributes &aOriginAttributes,
+  nsresult ResolveHost(const nsACString& hostname, uint16_t type,
+                       const mozilla::OriginAttributes& aOriginAttributes,
                        uint16_t flags, uint16_t af,
-                       nsResolveHostCallback *callback);
+                       nsResolveHostCallback* callback);
 
   /**
    * removes the specified callback from the nsHostRecord for the given
@@ -433,10 +433,10 @@ class nsHostResolver : public nsISupports, public AHostResolver {
    * executes the callback if the callback is still pending with the given
    * status.
    */
-  void DetachCallback(const nsACString &hostname, uint16_t type,
-                      const mozilla::OriginAttributes &aOriginAttributes,
+  void DetachCallback(const nsACString& hostname, uint16_t type,
+                      const mozilla::OriginAttributes& aOriginAttributes,
                       uint16_t flags, uint16_t af,
-                      nsResolveHostCallback *callback, nsresult status);
+                      nsResolveHostCallback* callback, nsresult status);
 
   /**
    * Cancels an async request associated with the hostname, originAttributes,
@@ -445,10 +445,10 @@ class nsHostResolver : public nsISupports, public AHostResolver {
    * parameters passed to ResolveHost.  If this is the last callback associated
    * with the host record, it is removed from any request queues it might be on.
    */
-  void CancelAsyncRequest(const nsACString &host, uint16_t type,
-                          const mozilla::OriginAttributes &aOriginAttributes,
+  void CancelAsyncRequest(const nsACString& host, uint16_t type,
+                          const mozilla::OriginAttributes& aOriginAttributes,
                           uint16_t flags, uint16_t af,
-                          nsIDNSListener *aListener, nsresult status);
+                          nsIDNSListener* aListener, nsresult status);
   /**
    * values for the flags parameter passed to ResolveHost and DetachCallback
    * that may be bitwise OR'd together.
@@ -477,17 +477,17 @@ class nsHostResolver : public nsISupports, public AHostResolver {
    */
   void FlushCache(bool aTrrToo);
 
-  LookupStatus CompleteLookup(nsHostRecord *, nsresult,
-                              mozilla::net::AddrInfo *, bool pb,
-                              const nsACString &aOriginsuffix) override;
-  LookupStatus CompleteLookupByType(nsHostRecord *, nsresult,
-                                    const nsTArray *aResult,
+  LookupStatus CompleteLookup(nsHostRecord*, nsresult, mozilla::net::AddrInfo*,
+                              bool pb,
+                              const nsACString& aOriginsuffix) override;
+  LookupStatus CompleteLookupByType(nsHostRecord*, nsresult,
+                                    const nsTArray* aResult,
                                     uint32_t aTtl, bool pb) override;
-  nsresult GetHostRecord(const nsACString &host, uint16_t type, uint16_t flags,
-                         uint16_t af, bool pb, const nsCString &originSuffix,
-                         nsHostRecord **result) override;
-  nsresult TrrLookup_unlocked(nsHostRecord *,
-                              mozilla::net::TRR *pushedTRR = nullptr) override;
+  nsresult GetHostRecord(const nsACString& host, uint16_t type, uint16_t flags,
+                         uint16_t af, bool pb, const nsCString& originSuffix,
+                         nsHostRecord** result) override;
+  nsresult TrrLookup_unlocked(nsHostRecord*,
+                              mozilla::net::TRR* pushedTRR = nullptr) override;
 
  private:
   explicit nsHostResolver(uint32_t maxCacheEntries,
@@ -497,32 +497,32 @@ class nsHostResolver : public nsISupports, public AHostResolver {
 
   nsresult Init();
   // In debug builds it asserts that the element is in the list.
-  void AssertOnQ(nsHostRecord *, mozilla::LinkedList> &);
+  void AssertOnQ(nsHostRecord*, mozilla::LinkedList>&);
   mozilla::net::ResolverMode Mode();
-  nsresult NativeLookup(nsHostRecord *);
-  nsresult TrrLookup(nsHostRecord *, mozilla::net::TRR *pushedTRR = nullptr);
+  nsresult NativeLookup(nsHostRecord*);
+  nsresult TrrLookup(nsHostRecord*, mozilla::net::TRR* pushedTRR = nullptr);
 
   // Kick-off a name resolve operation, using native resolver and/or TRR
-  nsresult NameLookup(nsHostRecord *);
-  bool GetHostToLookup(AddrHostRecord **m);
+  nsresult NameLookup(nsHostRecord*);
+  bool GetHostToLookup(AddrHostRecord** m);
 
   // Removes the first element from the list and returns it AddRef-ed in aResult
   // Should not be called for an empty linked list.
-  void DeQueue(mozilla::LinkedList> &aQ,
-               AddrHostRecord **aResult);
+  void DeQueue(mozilla::LinkedList>& aQ,
+               AddrHostRecord** aResult);
   // Cancels host records in the pending queue and also
   // calls CompleteLookup with the NS_ERROR_ABORT result code.
-  void ClearPendingQueue(mozilla::LinkedList> &aPendingQ);
-  nsresult ConditionallyCreateThread(nsHostRecord *rec);
+  void ClearPendingQueue(mozilla::LinkedList>& aPendingQ);
+  nsresult ConditionallyCreateThread(nsHostRecord* rec);
 
   /**
    * Starts a new lookup in the background for entries that are in the grace
    * period with a failed connect or all cached entries are negative.
    */
-  nsresult ConditionallyRefreshRecord(nsHostRecord *rec,
-                                      const nsACString &host);
+  nsresult ConditionallyRefreshRecord(nsHostRecord* rec,
+                                      const nsACString& host);
 
-  void AddToEvictionQ(nsHostRecord *rec);
+  void AddToEvictionQ(nsHostRecord* rec);
 
   void ThreadFunc();
 
@@ -560,13 +560,13 @@ class nsHostResolver : public nsISupports, public AHostResolver {
   mozilla::Atomic mPendingCount;
 
   // Set the expiration time stamps appropriately.
-  void PrepareRecordExpirationAddrRecord(AddrHostRecord *rec) const;
+  void PrepareRecordExpirationAddrRecord(AddrHostRecord* rec) const;
 
  public:
   /*
    * Called by the networking dashboard via the DnsService2
    */
-  void GetDNSCacheEntries(nsTArray *);
+  void GetDNSCacheEntries(nsTArray*);
 };
 
 #endif  // nsHostResolver_h__
diff --git a/netwerk/dns/punycode.c b/netwerk/dns/punycode.c
index 858769791e6fb..03d87d4747c65 100644
--- a/netwerk/dns/punycode.c
+++ b/netwerk/dns/punycode.c
@@ -112,7 +112,7 @@ static punycode_uint adapt(punycode_uint delta, punycode_uint numpoints,
 enum punycode_status punycode_encode(punycode_uint input_length,
                                      const punycode_uint input[],
                                      const unsigned char case_flags[],
-                                     punycode_uint *output_length,
+                                     punycode_uint* output_length,
                                      char output[]) {
   punycode_uint n, delta, h, b, out, max_out, bias, j, m, q, k, t;
 
@@ -198,7 +198,7 @@ enum punycode_status punycode_encode(punycode_uint input_length,
 
 enum punycode_status punycode_decode(punycode_uint input_length,
                                      const char input[],
-                                     punycode_uint *output_length,
+                                     punycode_uint* output_length,
                                      punycode_uint output[],
                                      unsigned char case_flags[]) {
   punycode_uint n, out, i, max_out, bias, b, j, in, oldi, w, k, digit, t;
diff --git a/netwerk/dns/punycode.h b/netwerk/dns/punycode.h
index a4d4293447b11..6a626c7a07dcb 100644
--- a/netwerk/dns/punycode.h
+++ b/netwerk/dns/punycode.h
@@ -46,7 +46,7 @@ typedef unsigned long punycode_uint;
 enum punycode_status punycode_encode(punycode_uint input_length,
                                      const punycode_uint input[],
                                      const unsigned char case_flags[],
-                                     punycode_uint *output_length,
+                                     punycode_uint* output_length,
                                      char output[]);
 
 /* punycode_encode() converts Unicode to Punycode.  The input     */
@@ -76,7 +76,7 @@ enum punycode_status punycode_encode(punycode_uint input_length,
 
 enum punycode_status punycode_decode(punycode_uint input_length,
                                      const char input[],
-                                     punycode_uint *output_length,
+                                     punycode_uint* output_length,
                                      punycode_uint output[],
                                      unsigned char case_flags[]);
 
diff --git a/netwerk/mime/nsMIMEHeaderParamImpl.cpp b/netwerk/mime/nsMIMEHeaderParamImpl.cpp
index 3856970005427..9ccfcfaf6b562 100644
--- a/netwerk/mime/nsMIMEHeaderParamImpl.cpp
+++ b/netwerk/mime/nsMIMEHeaderParamImpl.cpp
@@ -25,18 +25,18 @@ using mozilla::Encoding;
 
 // static functions declared below are moved from mailnews/mime/src/comi18n.cpp
 
-static char *DecodeQ(const char *, uint32_t);
-static bool Is7bitNonAsciiString(const char *, uint32_t);
-static void CopyRawHeader(const char *, uint32_t, const nsACString &,
-                          nsACString &);
-static nsresult DecodeRFC2047Str(const char *, const nsACString &, bool,
-                                 nsACString &);
-static nsresult internalDecodeParameter(const nsACString &, const nsACString &,
-                                        const nsACString &, bool, bool,
-                                        nsACString &);
-
-static nsresult ToUTF8(const nsACString &aString, const nsACString &aCharset,
-                       bool aAllowSubstitution, nsACString &aResult) {
+static char* DecodeQ(const char*, uint32_t);
+static bool Is7bitNonAsciiString(const char*, uint32_t);
+static void CopyRawHeader(const char*, uint32_t, const nsACString&,
+                          nsACString&);
+static nsresult DecodeRFC2047Str(const char*, const nsACString&, bool,
+                                 nsACString&);
+static nsresult internalDecodeParameter(const nsACString&, const nsACString&,
+                                        const nsACString&, bool, bool,
+                                        nsACString&);
+
+static nsresult ToUTF8(const nsACString& aString, const nsACString& aCharset,
+                       bool aAllowSubstitution, nsACString& aResult) {
   if (aCharset.IsEmpty()) {
     return NS_ERROR_INVALID_ARG;
   }
@@ -56,10 +56,10 @@ static nsresult ToUTF8(const nsACString &aString, const nsACString &aCharset,
                                                                  aResult);
 }
 
-static nsresult ConvertStringToUTF8(const nsACString &aString,
-                                    const nsACString &aCharset, bool aSkipCheck,
+static nsresult ConvertStringToUTF8(const nsACString& aString,
+                                    const nsACString& aCharset, bool aSkipCheck,
                                     bool aAllowSubstitution,
-                                    nsACString &aUTF8String) {
+                                    nsACString& aUTF8String) {
   // return if ASCII only or valid UTF-8 providing that the ASCII/UTF-8
   // check is requested. It may not be asked for if a caller suspects
   // that the input is in non-ASCII 7bit charset (ISO-2022-xx, HZ) or
@@ -95,29 +95,29 @@ static nsresult ConvertStringToUTF8(const nsACString &aString,
 NS_IMPL_ISUPPORTS(nsMIMEHeaderParamImpl, nsIMIMEHeaderParam)
 
 NS_IMETHODIMP
-nsMIMEHeaderParamImpl::GetParameter(const nsACString &aHeaderVal,
-                                    const char *aParamName,
-                                    const nsACString &aFallbackCharset,
-                                    bool aTryLocaleCharset, char **aLang,
-                                    nsAString &aResult) {
+nsMIMEHeaderParamImpl::GetParameter(const nsACString& aHeaderVal,
+                                    const char* aParamName,
+                                    const nsACString& aFallbackCharset,
+                                    bool aTryLocaleCharset, char** aLang,
+                                    nsAString& aResult) {
   return DoGetParameter(aHeaderVal, aParamName, MIME_FIELD_ENCODING,
                         aFallbackCharset, aTryLocaleCharset, aLang, aResult);
 }
 
 NS_IMETHODIMP
-nsMIMEHeaderParamImpl::GetParameterHTTP(const nsACString &aHeaderVal,
-                                        const char *aParamName,
-                                        const nsACString &aFallbackCharset,
-                                        bool aTryLocaleCharset, char **aLang,
-                                        nsAString &aResult) {
+nsMIMEHeaderParamImpl::GetParameterHTTP(const nsACString& aHeaderVal,
+                                        const char* aParamName,
+                                        const nsACString& aFallbackCharset,
+                                        bool aTryLocaleCharset, char** aLang,
+                                        nsAString& aResult) {
   return DoGetParameter(aHeaderVal, aParamName, HTTP_FIELD_ENCODING,
                         aFallbackCharset, aTryLocaleCharset, aLang, aResult);
 }
 
 /* static */
-nsresult nsMIMEHeaderParamImpl::GetParameterHTTP(const nsACString &aHeaderVal,
-                                                 const char *aParamName,
-                                                 nsAString &aResult) {
+nsresult nsMIMEHeaderParamImpl::GetParameterHTTP(const nsACString& aHeaderVal,
+                                                 const char* aParamName,
+                                                 nsAString& aResult) {
   return DoGetParameter(aHeaderVal, aParamName, HTTP_FIELD_ENCODING,
                         EmptyCString(), false, nullptr, aResult);
 }
@@ -125,9 +125,9 @@ nsresult nsMIMEHeaderParamImpl::GetParameterHTTP(const nsACString &aHeaderVal,
 // XXX : aTryLocaleCharset is not yet effective.
 /* static */
 nsresult nsMIMEHeaderParamImpl::DoGetParameter(
-    const nsACString &aHeaderVal, const char *aParamName,
-    ParamDecoding aDecoding, const nsACString &aFallbackCharset,
-    bool aTryLocaleCharset, char **aLang, nsAString &aResult) {
+    const nsACString& aHeaderVal, const char* aParamName,
+    ParamDecoding aDecoding, const nsACString& aFallbackCharset,
+    bool aTryLocaleCharset, char** aLang, nsAString& aResult) {
   aResult.Truncate();
   nsresult rv;
 
@@ -151,7 +151,7 @@ nsresult nsMIMEHeaderParamImpl::DoGetParameter(
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!aFallbackCharset.IsEmpty()) {
-    const Encoding *encoding = Encoding::ForLabel(aFallbackCharset);
+    const Encoding* encoding = Encoding::ForLabel(aFallbackCharset);
     nsAutoCString str2;
     if (NS_SUCCEEDED(ConvertStringToUTF8(str1, aFallbackCharset, false,
                                          encoding != UTF_8_ENCODING, str2))) {
@@ -174,10 +174,10 @@ nsresult nsMIMEHeaderParamImpl::DoGetParameter(
 
 // remove backslash-encoded sequences from quoted-strings
 // modifies string in place, potentially shortening it
-void RemoveQuotedStringEscapes(char *src) {
-  char *dst = src;
+void RemoveQuotedStringEscapes(char* src) {
+  char* dst = src;
 
-  for (char *c = src; *c; ++c) {
+  for (char* c = src; *c; ++c) {
     if (c[0] == '\\' && c[1]) {
       // skip backslash if not at end
       ++c;
@@ -196,7 +196,7 @@ bool IsHexDigit(char aChar) {
 }
 
 // validate that a C String containing %-escapes is syntactically valid
-bool IsValidPercentEscaped(const char *aValue, int32_t len) {
+bool IsValidPercentEscaped(const char* aValue, int32_t len) {
   for (int32_t i = 0; i < len; i++) {
     if (aValue[i] == '%') {
       if (!IsHexDigit(aValue[i + 1]) || !IsHexDigit(aValue[i + 2])) {
@@ -216,7 +216,7 @@ bool IsValidPercentEscaped(const char *aValue, int32_t len) {
 
 class Continuation {
  public:
-  Continuation(const char *aValue, uint32_t aLength, bool aNeedsPercentDecoding,
+  Continuation(const char* aValue, uint32_t aLength, bool aNeedsPercentDecoding,
                bool aWasQuotedString) {
     value = aValue;
     length = aLength;
@@ -232,7 +232,7 @@ class Continuation {
   }
   ~Continuation() = default;
 
-  const char *value;
+  const char* value;
   uint32_t length;
   bool needsPercentDecoding;
   bool wasQuotedString;
@@ -240,7 +240,7 @@ class Continuation {
 
 // combine segments into a single string, returning the allocated string
 // (or nullptr) while emptying the list
-char *combineContinuations(nsTArray &aArray) {
+char* combineContinuations(nsTArray& aArray) {
   // Sanity check
   if (aArray.Length() == 0) return nullptr;
 
@@ -251,7 +251,7 @@ char *combineContinuations(nsTArray &aArray) {
   }
 
   // Allocate
-  char *result = (char *)moz_xmalloc(length + 1);
+  char* result = (char*)moz_xmalloc(length + 1);
 
   // Concatenate
   *result = '\0';
@@ -260,7 +260,7 @@ char *combineContinuations(nsTArray &aArray) {
     Continuation cont = aArray[i];
     if (!cont.value) break;
 
-    char *c = result + strlen(result);
+    char* c = result + strlen(result);
     strncat(result, cont.value, cont.length);
     if (cont.needsPercentDecoding) {
       nsUnescape(c);
@@ -280,8 +280,8 @@ char *combineContinuations(nsTArray &aArray) {
 }
 
 // add a continuation, return false on error if segment already has been seen
-bool addContinuation(nsTArray &aArray, uint32_t aIndex,
-                     const char *aValue, uint32_t aLength,
+bool addContinuation(nsTArray& aArray, uint32_t aIndex,
+                     const char* aValue, uint32_t aLength,
                      bool aNeedsPercentDecoding, bool aWasQuotedString) {
   if (aIndex < aArray.Length() && aArray[aIndex].value) {
     NS_WARNING("duplicate RC2231 continuation segment #\n");
@@ -311,7 +311,7 @@ bool addContinuation(nsTArray &aArray, uint32_t aIndex,
 }
 
 // parse a segment number; return -1 on error
-int32_t parseSegmentNumber(const char *aValue, int32_t aLen) {
+int32_t parseSegmentNumber(const char* aValue, int32_t aLen) {
   if (aLen < 1) {
     NS_WARNING("segment number missing\n");
     return -1;
@@ -343,8 +343,8 @@ int32_t parseSegmentNumber(const char *aValue, int32_t aLen) {
 
 // validate a given octet sequence for compliance with the specified
 // encoding
-bool IsValidOctetSequenceForCharset(const nsACString &aCharset,
-                                    const char *aOctets) {
+bool IsValidOctetSequenceForCharset(const nsACString& aCharset,
+                                    const char* aOctets) {
   nsAutoCString tmpRaw;
   tmpRaw.Assign(aOctets);
   nsAutoCString tmpDecoded;
@@ -371,18 +371,18 @@ bool IsValidOctetSequenceForCharset(const nsACString &aCharset,
 // The format of these header lines  is
 //  [ ';'  '='  ]*
 NS_IMETHODIMP
-nsMIMEHeaderParamImpl::GetParameterInternal(const char *aHeaderValue,
-                                            const char *aParamName,
-                                            char **aCharset, char **aLang,
-                                            char **aResult) {
+nsMIMEHeaderParamImpl::GetParameterInternal(const char* aHeaderValue,
+                                            const char* aParamName,
+                                            char** aCharset, char** aLang,
+                                            char** aResult) {
   return DoParameterInternal(aHeaderValue, aParamName, MIME_FIELD_ENCODING,
                              aCharset, aLang, aResult);
 }
 
 /* static */
 nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
-    const char *aHeaderValue, const char *aParamName, ParamDecoding aDecoding,
-    char **aCharset, char **aLang, char **aResult) {
+    const char* aHeaderValue, const char* aParamName, ParamDecoding aDecoding,
+    char** aCharset, char** aLang, char** aResult) {
   if (!aHeaderValue || !*aHeaderValue || !aResult) return NS_ERROR_INVALID_ARG;
 
   *aResult = nullptr;
@@ -396,12 +396,12 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
   // them for HTTP header fields later on, see bug 776324
   bool acceptContinuations = true;
 
-  const char *str = aHeaderValue;
+  const char* str = aHeaderValue;
 
   // skip leading white space.
   for (; *str && nsCRT::IsAsciiSpace(*str); ++str)
     ;
-  const char *start = str;
+  const char* start = str;
 
   // aParamName is empty. return the first (possibly) _unnamed_ 'parameter'
   // For instance, return 'inline' in the following case:
@@ -411,7 +411,7 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
       ;
     if (str == start) return NS_ERROR_FIRST_HEADER_FIELD_COMPONENT_EMPTY;
 
-    *aResult = (char *)moz_xmemdup(start, (str - start) + 1);
+    *aResult = (char*)moz_xmemdup(start, (str - start) + 1);
     (*aResult)[str - start] = '\0';  // null-terminate
     return NS_OK;
   }
@@ -444,9 +444,9 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
   // collect results for the different algorithms (plain filename,
   // RFC5987/2231-encoded filename, + continuations) separately and decide
   // which to use at the end
-  char *caseAResult = nullptr;
-  char *caseBResult = nullptr;
-  char *caseCDResult = nullptr;
+  char* caseAResult = nullptr;
+  char* caseBResult = nullptr;
+  char* caseCDResult = nullptr;
 
   // collect continuation segments
   nsTArray segments;
@@ -462,10 +462,10 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
   while (*str) {
     // find name/value
 
-    const char *nameStart = str;
-    const char *nameEnd = nullptr;
-    const char *valueStart = nullptr;
-    const char *valueEnd = nullptr;
+    const char* nameStart = str;
+    const char* nameEnd = nullptr;
+    const char* valueStart = nullptr;
+    const char* valueEnd = nullptr;
     bool isQuotedString = false;
 
     NS_ASSERTION(!nsCRT::IsAsciiSpace(*str), "should be after whitespace.");
@@ -529,7 +529,7 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
       //     line continuation -- jht 4/29/98
       nsAutoCString tempStr(valueStart, valueEnd - valueStart);
       tempStr.StripCRLF();
-      char *res = ToNewCString(tempStr);
+      char* res = ToNewCString(tempStr);
       NS_ENSURE_TRUE(res, NS_ERROR_OUT_OF_MEMORY);
 
       if (isQuotedString) RemoveQuotedStringEscapes(res);
@@ -542,7 +542,7 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
              !nsCRT::strncasecmp(nameStart, aParamName, paramLen) &&
              *(nameStart + paramLen) == '*') {
       // 1st char past '*'
-      const char *cp = nameStart + paramLen + 1;
+      const char* cp = nameStart + paramLen + 1;
 
       // if param name ends in "*" we need do to RFC5987 "ext-value" decoding
       bool needExtDecoding = *(nameEnd - 1) == '*';
@@ -566,8 +566,8 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
       // in quotes (quotes required even if lang is blank)
       if (caseB || (caseCStart && acceptContinuations)) {
         // look for single quotation mark(')
-        const char *sQuote1 = PL_strchr(valueStart, 0x27);
-        const char *sQuote2 = sQuote1 ? PL_strchr(sQuote1 + 1, 0x27) : nullptr;
+        const char* sQuote1 = PL_strchr(valueStart, 0x27);
+        const char* sQuote2 = sQuote1 ? PL_strchr(sQuote1 + 1, 0x27) : nullptr;
 
         // Two single quotation marks must be present even in
         // absence of charset and lang.
@@ -576,11 +576,11 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
               "Mandatory two single quotes are missing in header parameter\n");
         }
 
-        const char *charsetStart = nullptr;
+        const char* charsetStart = nullptr;
         int32_t charsetLength = 0;
-        const char *langStart = nullptr;
+        const char* langStart = nullptr;
         int32_t langLength = 0;
-        const char *rawValStart = nullptr;
+        const char* rawValStart = nullptr;
         int32_t rawValLength = 0;
 
         if (sQuote2 && sQuote1) {
@@ -626,8 +626,7 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
             }
 
             // allocate buffer for the raw value
-            char *tmpResult =
-                (char *)moz_xmemdup(rawValStart, rawValLength + 1);
+            char* tmpResult = (char*)moz_xmemdup(rawValStart, rawValLength + 1);
             *(tmpResult + rawValLength) = 0;
 
             nsUnescape(tmpResult);
@@ -715,12 +714,12 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
     // then return charset and lang as well
     if (aLang && !lang.IsEmpty()) {
       uint32_t len = lang.Length();
-      *aLang = (char *)moz_xmemdup(lang.BeginReading(), len + 1);
+      *aLang = (char*)moz_xmemdup(lang.BeginReading(), len + 1);
       *(*aLang + len) = 0;
     }
     if (aCharset && !charset.IsEmpty()) {
       uint32_t len = charset.Length();
-      *aCharset = (char *)moz_xmemdup(charset.BeginReading(), len + 1);
+      *aCharset = (char*)moz_xmemdup(charset.BeginReading(), len + 1);
       *(*aCharset + len) = 0;
     }
   }
@@ -728,11 +727,11 @@ nsresult nsMIMEHeaderParamImpl::DoParameterInternal(
   return *aResult ? NS_OK : NS_ERROR_INVALID_ARG;
 }
 
-nsresult internalDecodeRFC2047Header(const char *aHeaderVal,
-                                     const nsACString &aDefaultCharset,
+nsresult internalDecodeRFC2047Header(const char* aHeaderVal,
+                                     const nsACString& aDefaultCharset,
                                      bool aOverrideCharset,
                                      bool aEatContinuations,
-                                     nsACString &aResult) {
+                                     nsACString& aResult) {
   aResult.Truncate();
   if (!aHeaderVal) return NS_ERROR_INVALID_ARG;
   if (!*aHeaderVal) return NS_OK;
@@ -765,11 +764,11 @@ nsresult internalDecodeRFC2047Header(const char *aHeaderVal,
 }
 
 NS_IMETHODIMP
-nsMIMEHeaderParamImpl::DecodeRFC2047Header(const char *aHeaderVal,
-                                           const char *aDefaultCharset,
+nsMIMEHeaderParamImpl::DecodeRFC2047Header(const char* aHeaderVal,
+                                           const char* aDefaultCharset,
                                            bool aOverrideCharset,
                                            bool aEatContinuations,
-                                           nsACString &aResult) {
+                                           nsACString& aResult) {
   return internalDecodeRFC2047Header(aHeaderVal, nsCString(aDefaultCharset),
                                      aOverrideCharset, aEatContinuations,
                                      aResult);
@@ -789,8 +788,8 @@ bool IsRFC5987AttrChar(char aChar) {
 
 // percent-decode a value
 // returns false on failure
-bool PercentDecode(nsACString &aValue) {
-  char *c = (char *)moz_xmalloc(aValue.Length() + 1);
+bool PercentDecode(nsACString& aValue) {
+  char* c = (char*)moz_xmalloc(aValue.Length() + 1);
 
   strcpy(c, PromiseFlatCString(aValue).get());
   nsUnescape(c);
@@ -804,16 +803,16 @@ bool PercentDecode(nsACString &aValue) {
 //
 // charset  "'" [ language ] "'" value-chars
 NS_IMETHODIMP
-nsMIMEHeaderParamImpl::DecodeRFC5987Param(const nsACString &aParamVal,
-                                          nsACString &aLang,
-                                          nsAString &aResult) {
+nsMIMEHeaderParamImpl::DecodeRFC5987Param(const nsACString& aParamVal,
+                                          nsACString& aLang,
+                                          nsAString& aResult) {
   nsAutoCString charset;
   nsAutoCString language;
   nsAutoCString value;
 
   uint32_t delimiters = 0;
-  const nsCString &encoded = PromiseFlatCString(aParamVal);
-  const char *c = encoded.get();
+  const nsCString& encoded = PromiseFlatCString(aParamVal);
+  const char* c = encoded.get();
 
   while (*c) {
     char tc = *c++;
@@ -882,11 +881,11 @@ nsMIMEHeaderParamImpl::DecodeRFC5987Param(const nsACString &aParamVal,
   return NS_OK;
 }
 
-nsresult internalDecodeParameter(const nsACString &aParamValue,
-                                 const nsACString &aCharset,
-                                 const nsACString &aDefaultCharset,
+nsresult internalDecodeParameter(const nsACString& aParamValue,
+                                 const nsACString& aCharset,
+                                 const nsACString& aDefaultCharset,
                                  bool aOverrideCharset, bool aDecode2047,
-                                 nsACString &aResult) {
+                                 nsACString& aResult) {
   aResult.Truncate();
   // If aCharset is given, aParamValue was obtained from RFC2231/5987
   // encoding and we're pretty sure that it's in aCharset.
@@ -894,7 +893,7 @@ nsresult internalDecodeParameter(const nsACString &aParamValue,
     return ConvertStringToUTF8(aParamValue, aCharset, true, true, aResult);
   }
 
-  const nsCString ¶m = PromiseFlatCString(aParamValue);
+  const nsCString& param = PromiseFlatCString(aParamValue);
   nsAutoCString unQuoted;
   nsACString::const_iterator s, e;
   param.BeginReading(s);
@@ -931,11 +930,11 @@ nsresult internalDecodeParameter(const nsACString &aParamValue,
 }
 
 NS_IMETHODIMP
-nsMIMEHeaderParamImpl::DecodeParameter(const nsACString &aParamValue,
-                                       const char *aCharset,
-                                       const char *aDefaultCharset,
+nsMIMEHeaderParamImpl::DecodeParameter(const nsACString& aParamValue,
+                                       const char* aCharset,
+                                       const char* aDefaultCharset,
                                        bool aOverrideCharset,
-                                       nsACString &aResult) {
+                                       nsACString& aResult) {
   return internalDecodeParameter(aParamValue, nsCString(aCharset),
                                  nsCString(aDefaultCharset), aOverrideCharset,
                                  true, aResult);
@@ -948,10 +947,10 @@ nsMIMEHeaderParamImpl::DecodeParameter(const nsACString &aParamValue,
 
 // Decode Q encoding (RFC 2047).
 // static
-char *DecodeQ(const char *in, uint32_t length) {
+char* DecodeQ(const char* in, uint32_t length) {
   char *out, *dest = nullptr;
 
-  out = dest = (char *)calloc(length + 1, sizeof(char));
+  out = dest = (char*)calloc(length + 1, sizeof(char));
   if (dest == nullptr) return nullptr;
   while (length > 0) {
     unsigned c = 0;
@@ -995,7 +994,7 @@ char *DecodeQ(const char *in, uint32_t length) {
 // or has  ESC which may be an  indication that  it's in one of many ISO
 // 2022 7bit  encodings (e.g. ISO-2022-JP(-2)/CN : see RFC 1468, 1922, 1554).
 // static
-bool Is7bitNonAsciiString(const char *input, uint32_t len) {
+bool Is7bitNonAsciiString(const char* input, uint32_t len) {
   int32_t c;
 
   enum {
@@ -1047,8 +1046,8 @@ bool Is7bitNonAsciiString(const char *input, uint32_t len) {
 // is not successful, each octet is replaced by Unicode replacement
 // chars. *aOutput is advanced by the number of output octets.
 // static
-void CopyRawHeader(const char *aInput, uint32_t aLen,
-                   const nsACString &aDefaultCharset, nsACString &aOutput) {
+void CopyRawHeader(const char* aInput, uint32_t aLen,
+                   const nsACString& aDefaultCharset, nsACString& aOutput) {
   int32_t c;
 
   // If aDefaultCharset is not specified, make a blind copy.
@@ -1091,9 +1090,9 @@ void CopyRawHeader(const char *aInput, uint32_t aLen,
   }
 }
 
-nsresult DecodeQOrBase64Str(const char *aEncoded, size_t aLen, char aQOrBase64,
-                            const nsACString &aCharset, nsACString &aResult) {
-  char *decodedText;
+nsresult DecodeQOrBase64Str(const char* aEncoded, size_t aLen, char aQOrBase64,
+                            const nsACString& aCharset, nsACString& aResult) {
+  char* decodedText;
   bool b64alloc = false;
   NS_ASSERTION(aQOrBase64 == 'Q' || aQOrBase64 == 'B', "Should be 'Q' or 'B'");
   if (aQOrBase64 == 'Q')
@@ -1136,11 +1135,11 @@ static const char especials[] = R"(()<>@,;:\"/[]?.=)";
 // ignored and aDefaultCharset is assumed, instead. aDefaultCharset
 // is also used to convert raw octets (without RFC 2047 encoding) to UTF-8.
 // static
-nsresult DecodeRFC2047Str(const char *aHeader,
-                          const nsACString &aDefaultCharset,
-                          bool aOverrideCharset, nsACString &aResult) {
+nsresult DecodeRFC2047Str(const char* aHeader,
+                          const nsACString& aDefaultCharset,
+                          bool aOverrideCharset, nsACString& aResult) {
   const char *p, *q = nullptr, *r;
-  const char *begin;  // tracking pointer for where we are in the input buffer
+  const char* begin;  // tracking pointer for where we are in the input buffer
   int32_t isLastEncodedWord = 0;
   const char *charsetStart, *charsetEnd;
   nsAutoCString prevCharset, curCharset;
@@ -1231,7 +1230,7 @@ nsresult DecodeRFC2047Str(const char *aHeader,
       curCharset = aDefaultCharset;
     }
 
-    const char *R;
+    const char* R;
     R = r;
     if (curEncoding == 'B') {
       // bug 227290. ignore an extraneous '=' at the end.
diff --git a/netwerk/mime/nsMIMEHeaderParamImpl.h b/netwerk/mime/nsMIMEHeaderParamImpl.h
index 885849778656e..4e162f8a5bd0b 100644
--- a/netwerk/mime/nsMIMEHeaderParamImpl.h
+++ b/netwerk/mime/nsMIMEHeaderParamImpl.h
@@ -19,24 +19,24 @@ class nsMIMEHeaderParamImpl : public nsIMIMEHeaderParam {
    * GetParameterHTTP(aHeaderVal, aParameterName, EmptyCString(), false,
    * nullptr, aResult) See nsIMIMEHeaderParam.idl for more information.
    */
-  static nsresult GetParameterHTTP(const nsACString &aHeaderVal,
-                                   const char *aParamName, nsAString &aResult);
+  static nsresult GetParameterHTTP(const nsACString& aHeaderVal,
+                                   const char* aParamName, nsAString& aResult);
 
  private:
   virtual ~nsMIMEHeaderParamImpl() = default;
   enum ParamDecoding { MIME_FIELD_ENCODING = 1, HTTP_FIELD_ENCODING };
 
-  static nsresult DoGetParameter(const nsACString &aHeaderVal,
-                                 const char *aParamName,
+  static nsresult DoGetParameter(const nsACString& aHeaderVal,
+                                 const char* aParamName,
                                  ParamDecoding aDecoding,
-                                 const nsACString &aFallbackCharset,
-                                 bool aTryLocaleCharset, char **aLang,
-                                 nsAString &aResult);
-
-  static nsresult DoParameterInternal(const char *aHeaderValue,
-                                      const char *aParamName,
-                                      ParamDecoding aDecoding, char **aCharset,
-                                      char **aLang, char **aResult);
+                                 const nsACString& aFallbackCharset,
+                                 bool aTryLocaleCharset, char** aLang,
+                                 nsAString& aResult);
+
+  static nsresult DoParameterInternal(const char* aHeaderValue,
+                                      const char* aParamName,
+                                      ParamDecoding aDecoding, char** aCharset,
+                                      char** aLang, char** aResult);
 };
 
 #endif
diff --git a/netwerk/protocol/about/nsAboutBlank.h b/netwerk/protocol/about/nsAboutBlank.h
index a91137c839980..4fcd90816ce2a 100644
--- a/netwerk/protocol/about/nsAboutBlank.h
+++ b/netwerk/protocol/about/nsAboutBlank.h
@@ -16,7 +16,7 @@ class nsAboutBlank : public nsIAboutModule {
 
   nsAboutBlank() = default;
 
-  static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
+  static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
 
  private:
   virtual ~nsAboutBlank() = default;
diff --git a/netwerk/protocol/about/nsAboutCache.cpp b/netwerk/protocol/about/nsAboutCache.cpp
index f6c5ff3298eb3..495b04ab71388 100644
--- a/netwerk/protocol/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -29,8 +29,8 @@ NS_IMPL_ISUPPORTS(nsAboutCache::Channel, nsIChannel, nsIRequest,
                   nsICacheStorageVisitor)
 
 NS_IMETHODIMP
-nsAboutCache::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo,
-                         nsIChannel **result) {
+nsAboutCache::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
+                         nsIChannel** result) {
   nsresult rv;
 
   NS_ENSURE_ARG_POINTER(aURI);
@@ -44,7 +44,7 @@ nsAboutCache::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo,
   return NS_OK;
 }
 
-nsresult nsAboutCache::Channel::Init(nsIURI *aURI, nsILoadInfo *aLoadInfo) {
+nsresult nsAboutCache::Channel::Init(nsIURI* aURI, nsILoadInfo* aLoadInfo) {
   nsresult rv;
 
   mCancel = false;
@@ -126,7 +126,7 @@ nsresult nsAboutCache::Channel::Init(nsIURI *aURI, nsILoadInfo *aLoadInfo) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsAboutCache::Channel::AsyncOpen(nsIStreamListener *aListener) {
+NS_IMETHODIMP nsAboutCache::Channel::AsyncOpen(nsIStreamListener* aListener) {
   nsresult rv;
 
   if (!mChannel) {
@@ -143,11 +143,11 @@ NS_IMETHODIMP nsAboutCache::Channel::AsyncOpen(nsIStreamListener *aListener) {
   return NS_OK;
 }
 
-NS_IMETHODIMP nsAboutCache::Channel::Open(nsIInputStream **_retval) {
+NS_IMETHODIMP nsAboutCache::Channel::Open(nsIInputStream** _retval) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-nsresult nsAboutCache::Channel::ParseURI(nsIURI *uri, nsACString &storage) {
+nsresult nsAboutCache::Channel::ParseURI(nsIURI* uri, nsACString& storage) {
   //
   // about:cache[?storage=[&context=]]
   //
@@ -231,7 +231,7 @@ void nsAboutCache::Channel::FireVisitStorage() {
   }
 }
 
-nsresult nsAboutCache::Channel::VisitStorage(nsACString const &storageName) {
+nsresult nsAboutCache::Channel::VisitStorage(nsACString const& storageName) {
   nsresult rv;
 
   rv = GetStorage(storageName, mLoadInfo, getter_AddRefs(mStorage));
@@ -244,9 +244,9 @@ nsresult nsAboutCache::Channel::VisitStorage(nsACString const &storageName) {
 }
 
 // static
-nsresult nsAboutCache::GetStorage(nsACString const &storageName,
-                                  nsILoadContextInfo *loadInfo,
-                                  nsICacheStorage **storage) {
+nsresult nsAboutCache::GetStorage(nsACString const& storageName,
+                                  nsILoadContextInfo* loadInfo,
+                                  nsICacheStorage** storage) {
   nsresult rv;
 
   nsCOMPtr cacheService =
@@ -276,7 +276,7 @@ NS_IMETHODIMP
 nsAboutCache::Channel::OnCacheStorageInfo(uint32_t aEntryCount,
                                           uint64_t aConsumption,
                                           uint64_t aCapacity,
-                                          nsIFile *aDirectory) {
+                                          nsIFile* aDirectory) {
   // We need mStream for this
   if (!mStream) {
     return NS_ERROR_FAILURE;
@@ -371,12 +371,12 @@ nsAboutCache::Channel::OnCacheStorageInfo(uint32_t aEntryCount,
 }
 
 NS_IMETHODIMP
-nsAboutCache::Channel::OnCacheEntryInfo(nsIURI *aURI,
-                                        const nsACString &aIdEnhance,
+nsAboutCache::Channel::OnCacheEntryInfo(nsIURI* aURI,
+                                        const nsACString& aIdEnhance,
                                         int64_t aDataSize, int32_t aFetchCount,
                                         uint32_t aLastModified,
                                         uint32_t aExpirationTime, bool aPinned,
-                                        nsILoadContextInfo *aInfo) {
+                                        nsILoadContextInfo* aInfo) {
   // We need mStream for this
   if (!mStream || mCancel) {
     // Returning a failure from this callback stops the iteration
@@ -544,14 +544,14 @@ nsresult nsAboutCache::Channel::FlushBuffer() {
 }
 
 NS_IMETHODIMP
-nsAboutCache::GetURIFlags(nsIURI *aURI, uint32_t *result) {
+nsAboutCache::GetURIFlags(nsIURI* aURI, uint32_t* result) {
   *result = nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT;
   return NS_OK;
 }
 
 // static
-nsresult nsAboutCache::Create(nsISupports *aOuter, REFNSIID aIID,
-                              void **aResult) {
+nsresult nsAboutCache::Create(nsISupports* aOuter, REFNSIID aIID,
+                              void** aResult) {
   RefPtr about = new nsAboutCache();
   return about->QueryInterface(aIID, aResult);
 }
diff --git a/netwerk/protocol/about/nsAboutCache.h b/netwerk/protocol/about/nsAboutCache.h
index edb33532723b4..da2ce3d9339bf 100644
--- a/netwerk/protocol/about/nsAboutCache.h
+++ b/netwerk/protocol/about/nsAboutCache.h
@@ -18,49 +18,49 @@
 #include "nsTArray.h"
 
 #define NS_FORWARD_SAFE_NSICHANNEL_SUBSET(_to)                                 \
-  NS_IMETHOD GetOriginalURI(nsIURI **aOriginalURI) override {                  \
+  NS_IMETHOD GetOriginalURI(nsIURI** aOriginalURI) override {                  \
     return !_to ? NS_ERROR_NULL_POINTER : _to->GetOriginalURI(aOriginalURI);   \
   }                                                                            \
-  NS_IMETHOD SetOriginalURI(nsIURI *aOriginalURI) override {                   \
+  NS_IMETHOD SetOriginalURI(nsIURI* aOriginalURI) override {                   \
     return !_to ? NS_ERROR_NULL_POINTER : _to->SetOriginalURI(aOriginalURI);   \
   }                                                                            \
-  NS_IMETHOD GetURI(nsIURI **aURI) override {                                  \
+  NS_IMETHOD GetURI(nsIURI** aURI) override {                                  \
     return !_to ? NS_ERROR_NULL_POINTER : _to->GetURI(aURI);                   \
   }                                                                            \
-  NS_IMETHOD GetOwner(nsISupports **aOwner) override {                         \
+  NS_IMETHOD GetOwner(nsISupports** aOwner) override {                         \
     return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwner(aOwner);               \
   }                                                                            \
-  NS_IMETHOD SetOwner(nsISupports *aOwner) override {                          \
+  NS_IMETHOD SetOwner(nsISupports* aOwner) override {                          \
     return !_to ? NS_ERROR_NULL_POINTER : _to->SetOwner(aOwner);               \
   }                                                                            \
   NS_IMETHOD GetNotificationCallbacks(                                         \
-      nsIInterfaceRequestor **aNotificationCallbacks) override {               \
+      nsIInterfaceRequestor** aNotificationCallbacks) override {               \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->GetNotificationCallbacks(aNotificationCallbacks);       \
   }                                                                            \
   NS_IMETHOD SetNotificationCallbacks(                                         \
-      nsIInterfaceRequestor *aNotificationCallbacks) override {                \
+      nsIInterfaceRequestor* aNotificationCallbacks) override {                \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->SetNotificationCallbacks(aNotificationCallbacks);       \
   }                                                                            \
-  NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo) override {           \
+  NS_IMETHOD GetSecurityInfo(nsISupports** aSecurityInfo) override {           \
     return !_to ? NS_ERROR_NULL_POINTER : _to->GetSecurityInfo(aSecurityInfo); \
   }                                                                            \
-  NS_IMETHOD GetContentType(nsACString &aContentType) override {               \
+  NS_IMETHOD GetContentType(nsACString& aContentType) override {               \
     return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentType(aContentType);   \
   }                                                                            \
-  NS_IMETHOD SetContentType(const nsACString &aContentType) override {         \
+  NS_IMETHOD SetContentType(const nsACString& aContentType) override {         \
     return !_to ? NS_ERROR_NULL_POINTER : _to->SetContentType(aContentType);   \
   }                                                                            \
-  NS_IMETHOD GetContentCharset(nsACString &aContentCharset) override {         \
+  NS_IMETHOD GetContentCharset(nsACString& aContentCharset) override {         \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->GetContentCharset(aContentCharset);                     \
   }                                                                            \
-  NS_IMETHOD SetContentCharset(const nsACString &aContentCharset) override {   \
+  NS_IMETHOD SetContentCharset(const nsACString& aContentCharset) override {   \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->SetContentCharset(aContentCharset);                     \
   }                                                                            \
-  NS_IMETHOD GetContentLength(int64_t *aContentLength) override {              \
+  NS_IMETHOD GetContentLength(int64_t* aContentLength) override {              \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->GetContentLength(aContentLength);                       \
   }                                                                            \
@@ -68,7 +68,7 @@
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->SetContentLength(aContentLength);                       \
   }                                                                            \
-  NS_IMETHOD GetContentDisposition(uint32_t *aContentDisposition) override {   \
+  NS_IMETHOD GetContentDisposition(uint32_t* aContentDisposition) override {   \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->GetContentDisposition(aContentDisposition);             \
   }                                                                            \
@@ -77,29 +77,29 @@
                 : _to->SetContentDisposition(aContentDisposition);             \
   }                                                                            \
   NS_IMETHOD GetContentDispositionFilename(                                    \
-      nsAString &aContentDispositionFilename) override {                       \
+      nsAString& aContentDispositionFilename) override {                       \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->GetContentDispositionFilename(                          \
                       aContentDispositionFilename);                            \
   }                                                                            \
   NS_IMETHOD SetContentDispositionFilename(                                    \
-      const nsAString &aContentDispositionFilename) override {                 \
+      const nsAString& aContentDispositionFilename) override {                 \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->SetContentDispositionFilename(                          \
                       aContentDispositionFilename);                            \
   }                                                                            \
   NS_IMETHOD GetContentDispositionHeader(                                      \
-      nsACString &aContentDispositionHeader) override {                        \
+      nsACString& aContentDispositionHeader) override {                        \
     return !_to ? NS_ERROR_NULL_POINTER                                        \
                 : _to->GetContentDispositionHeader(aContentDispositionHeader); \
   }                                                                            \
-  NS_IMETHOD GetLoadInfo(nsILoadInfo **aLoadInfo) override {                   \
+  NS_IMETHOD GetLoadInfo(nsILoadInfo** aLoadInfo) override {                   \
     return !_to ? NS_ERROR_NULL_POINTER : _to->GetLoadInfo(aLoadInfo);         \
   }                                                                            \
-  NS_IMETHOD SetLoadInfo(nsILoadInfo *aLoadInfo) override {                    \
+  NS_IMETHOD SetLoadInfo(nsILoadInfo* aLoadInfo) override {                    \
     return !_to ? NS_ERROR_NULL_POINTER : _to->SetLoadInfo(aLoadInfo);         \
   }                                                                            \
-  NS_IMETHOD GetIsDocument(bool *aIsDocument) override {                       \
+  NS_IMETHOD GetIsDocument(bool* aIsDocument) override {                       \
     return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDocument(aIsDocument);     \
   };
 
@@ -110,12 +110,12 @@ class nsAboutCache final : public nsIAboutModule {
 
   nsAboutCache() = default;
 
-  static MOZ_MUST_USE nsresult Create(nsISupports *aOuter, REFNSIID aIID,
-                                      void **aResult);
+  static MOZ_MUST_USE nsresult Create(nsISupports* aOuter, REFNSIID aIID,
+                                      void** aResult);
 
-  static MOZ_MUST_USE nsresult GetStorage(nsACString const &storageName,
-                                          nsILoadContextInfo *loadInfo,
-                                          nsICacheStorage **storage);
+  static MOZ_MUST_USE nsresult GetStorage(nsACString const& storageName,
+                                          nsILoadContextInfo* loadInfo,
+                                          nsICacheStorage** storage);
 
  protected:
   virtual ~nsAboutCache() = default;
@@ -125,15 +125,15 @@ class nsAboutCache final : public nsIAboutModule {
     NS_DECL_NSICACHESTORAGEVISITOR
     NS_FORWARD_SAFE_NSIREQUEST(mChannel)
     NS_FORWARD_SAFE_NSICHANNEL_SUBSET(mChannel)
-    NS_IMETHOD AsyncOpen(nsIStreamListener *aListener) override;
-    NS_IMETHOD Open(nsIInputStream **_retval) override;
+    NS_IMETHOD AsyncOpen(nsIStreamListener* aListener) override;
+    NS_IMETHOD Open(nsIInputStream** _retval) override;
 
    private:
     virtual ~Channel() = default;
 
    public:
-    MOZ_MUST_USE nsresult Init(nsIURI *aURI, nsILoadInfo *aLoadInfo);
-    MOZ_MUST_USE nsresult ParseURI(nsIURI *uri, nsACString &storage);
+    MOZ_MUST_USE nsresult Init(nsIURI* aURI, nsILoadInfo* aLoadInfo);
+    MOZ_MUST_USE nsresult ParseURI(nsIURI* uri, nsACString& storage);
 
     // Finds a next storage we wish to visit (we use this method
     // even there is a specified storage name, which is the only
@@ -146,7 +146,7 @@ class nsAboutCache final : public nsIAboutModule {
     // Kiks the visit cycle for the given storage, names can be:
     // "disk", "memory", "appcache"
     // Note: any newly added storage type has to be manually handled here.
-    MOZ_MUST_USE nsresult VisitStorage(nsACString const &storageName);
+    MOZ_MUST_USE nsresult VisitStorage(nsACString const& storageName);
 
     // Writes content of mBuffer to mStream and truncates
     // the buffer.  It may fail when the input stream is closed by canceling
diff --git a/netwerk/protocol/about/nsAboutCacheEntry.cpp b/netwerk/protocol/about/nsAboutCacheEntry.cpp
index f9c741a309ef6..8e7400a90e14c 100644
--- a/netwerk/protocol/about/nsAboutCacheEntry.cpp
+++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp
@@ -25,17 +25,17 @@ using namespace mozilla::net;
 
 #define HEXDUMP_MAX_ROWS 16
 
-static void HexDump(uint32_t *state, const char *buf, int32_t n,
-                    nsCString &result) {
+static void HexDump(uint32_t* state, const char* buf, int32_t n,
+                    nsCString& result) {
   char temp[16];
 
-  const unsigned char *p;
+  const unsigned char* p;
   while (n) {
     SprintfLiteral(temp, "%08x:  ", *state);
     result.Append(temp);
     *state += HEXDUMP_MAX_ROWS;
 
-    p = (const unsigned char *)buf;
+    p = (const unsigned char*)buf;
 
     int32_t i, row_max = std::min(HEXDUMP_MAX_ROWS, n);
 
@@ -49,7 +49,7 @@ static void HexDump(uint32_t *state, const char *buf, int32_t n,
     }
 
     // print ASCII glyphs if possible:
-    p = (const unsigned char *)buf;
+    p = (const unsigned char*)buf;
     for (i = 0; i < row_max; ++i, ++p) {
       switch (*p) {
         case '<':
@@ -89,8 +89,8 @@ NS_IMPL_ISUPPORTS(nsAboutCacheEntry::Channel, nsICacheEntryOpenCallback,
 // nsAboutCacheEntry::nsIAboutModule
 
 NS_IMETHODIMP
-nsAboutCacheEntry::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo,
-                              nsIChannel **result) {
+nsAboutCacheEntry::NewChannel(nsIURI* uri, nsILoadInfo* aLoadInfo,
+                              nsIChannel** result) {
   NS_ENSURE_ARG_POINTER(uri);
   nsresult rv;
 
@@ -104,7 +104,7 @@ nsAboutCacheEntry::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo,
 }
 
 NS_IMETHODIMP
-nsAboutCacheEntry::GetURIFlags(nsIURI *aURI, uint32_t *result) {
+nsAboutCacheEntry::GetURIFlags(nsIURI* aURI, uint32_t* result) {
   *result = nsIAboutModule::HIDE_FROM_ABOUTABOUT |
             nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT;
   return NS_OK;
@@ -113,7 +113,7 @@ nsAboutCacheEntry::GetURIFlags(nsIURI *aURI, uint32_t *result) {
 //-----------------------------------------------------------------------------
 // nsAboutCacheEntry::Channel
 
-nsresult nsAboutCacheEntry::Channel::Init(nsIURI *uri, nsILoadInfo *aLoadInfo) {
+nsresult nsAboutCacheEntry::Channel::Init(nsIURI* uri, nsILoadInfo* aLoadInfo) {
   nsresult rv;
 
   nsCOMPtr stream;
@@ -128,8 +128,8 @@ nsresult nsAboutCacheEntry::Channel::Init(nsIURI *uri, nsILoadInfo *aLoadInfo) {
   return NS_OK;
 }
 
-nsresult nsAboutCacheEntry::Channel::GetContentStream(nsIURI *uri,
-                                                      nsIInputStream **result) {
+nsresult nsAboutCacheEntry::Channel::GetContentStream(nsIURI* uri,
+                                                      nsIInputStream** result) {
   nsresult rv;
 
   // Init: (block size, maximum length)
@@ -163,7 +163,7 @@ nsresult nsAboutCacheEntry::Channel::GetContentStream(nsIURI *uri,
   return NS_OK;
 }
 
-nsresult nsAboutCacheEntry::Channel::OpenCacheEntry(nsIURI *uri) {
+nsresult nsAboutCacheEntry::Channel::OpenCacheEntry(nsIURI* uri) {
   nsresult rv;
 
   rv = ParseURI(uri, mStorageName, getter_AddRefs(mLoadInfo), mEnhanceId,
@@ -190,11 +190,11 @@ nsresult nsAboutCacheEntry::Channel::OpenCacheEntry() {
   return NS_OK;
 }
 
-nsresult nsAboutCacheEntry::Channel::ParseURI(nsIURI *uri,
-                                              nsACString &storageName,
-                                              nsILoadContextInfo **loadInfo,
-                                              nsCString &enahnceID,
-                                              nsIURI **cacheUri) {
+nsresult nsAboutCacheEntry::Channel::ParseURI(nsIURI* uri,
+                                              nsACString& storageName,
+                                              nsILoadContextInfo** loadInfo,
+                                              nsCString& enahnceID,
+                                              nsIURI** cacheUri) {
   //
   // about:cache-entry?storage=[string]&contenxt=[string]&eid=[string]&uri=[string]
   //
@@ -259,15 +259,15 @@ nsresult nsAboutCacheEntry::Channel::ParseURI(nsIURI *uri,
 
 NS_IMETHODIMP
 nsAboutCacheEntry::Channel::OnCacheEntryCheck(
-    nsICacheEntry *aEntry, nsIApplicationCache *aApplicationCache,
-    uint32_t *result) {
+    nsICacheEntry* aEntry, nsIApplicationCache* aApplicationCache,
+    uint32_t* result) {
   *result = nsICacheEntryOpenCallback::ENTRY_WANTED;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAboutCacheEntry::Channel::OnCacheEntryAvailable(
-    nsICacheEntry *entry, bool isNew, nsIApplicationCache *aApplicationCache,
+    nsICacheEntry* entry, bool isNew, nsIApplicationCache* aApplicationCache,
     nsresult status) {
   nsresult rv;
 
@@ -307,7 +307,7 @@ nsAboutCacheEntry::Channel::OnCacheEntryAvailable(
   PR_END_MACRO
 
 nsresult nsAboutCacheEntry::Channel::WriteCacheEntryDescription(
-    nsICacheEntry *entry) {
+    nsICacheEntry* entry) {
   nsresult rv;
   // This method appears to run in a situation where the run-time stack
   // should have plenty of space, so allocating a large string on the
@@ -480,8 +480,8 @@ nsresult nsAboutCacheEntry::Channel::WriteCacheEntryUnavailable() {
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsAboutCacheEntry::Channel::OnMetaDataElement(char const *key,
-                                              char const *value) {
+nsAboutCacheEntry::Channel::OnMetaDataElement(char const* key,
+                                              char const* value) {
   mBuffer->AppendLiteral(
       "  \n"
       "    ");
@@ -502,7 +502,7 @@ nsAboutCacheEntry::Channel::OnMetaDataElement(char const *key,
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-nsAboutCacheEntry::Channel::OnStartRequest(nsIRequest *request) {
+nsAboutCacheEntry::Channel::OnStartRequest(nsIRequest* request) {
   mHexDumpState = 0;
 
   NS_NAMED_LITERAL_CSTRING(buffer, "
\n
");
@@ -511,8 +511,8 @@ nsAboutCacheEntry::Channel::OnStartRequest(nsIRequest *request) {
 }
 
 NS_IMETHODIMP
-nsAboutCacheEntry::Channel::OnDataAvailable(nsIRequest *request,
-                                            nsIInputStream *aInputStream,
+nsAboutCacheEntry::Channel::OnDataAvailable(nsIRequest* request,
+                                            nsIInputStream* aInputStream,
                                             uint64_t aOffset, uint32_t aCount) {
   uint32_t n;
   return aInputStream->ReadSegments(&nsAboutCacheEntry::Channel::PrintCacheData,
@@ -521,10 +521,10 @@ nsAboutCacheEntry::Channel::OnDataAvailable(nsIRequest *request,
 
 /* static */
 nsresult nsAboutCacheEntry::Channel::PrintCacheData(
-    nsIInputStream *aInStream, void *aClosure, const char *aFromSegment,
-    uint32_t aToOffset, uint32_t aCount, uint32_t *aWriteCount) {
-  nsAboutCacheEntry::Channel *a =
-      static_cast(aClosure);
+    nsIInputStream* aInStream, void* aClosure, const char* aFromSegment,
+    uint32_t aToOffset, uint32_t aCount, uint32_t* aWriteCount) {
+  nsAboutCacheEntry::Channel* a =
+      static_cast(aClosure);
 
   nsCString buffer;
   HexDump(&a->mHexDumpState, aFromSegment, aCount, buffer);
@@ -538,7 +538,7 @@ nsresult nsAboutCacheEntry::Channel::PrintCacheData(
 }
 
 NS_IMETHODIMP
-nsAboutCacheEntry::Channel::OnStopRequest(nsIRequest *request,
+nsAboutCacheEntry::Channel::OnStopRequest(nsIRequest* request,
                                           nsresult result) {
   NS_NAMED_LITERAL_CSTRING(buffer, "
\n"); uint32_t n; diff --git a/netwerk/protocol/about/nsAboutCacheEntry.h b/netwerk/protocol/about/nsAboutCacheEntry.h index 9cfd498bc1f8a..4ae1a4ae6b7f3 100644 --- a/netwerk/protocol/about/nsAboutCacheEntry.h +++ b/netwerk/protocol/about/nsAboutCacheEntry.h @@ -45,28 +45,28 @@ class nsAboutCacheEntry final : public nsIAboutModule { virtual ~Channel() = default; public: - MOZ_MUST_USE nsresult Init(nsIURI *uri, nsILoadInfo *aLoadInfo); + MOZ_MUST_USE nsresult Init(nsIURI* uri, nsILoadInfo* aLoadInfo); - MOZ_MUST_USE nsresult GetContentStream(nsIURI *, nsIInputStream **); - MOZ_MUST_USE nsresult OpenCacheEntry(nsIURI *); + MOZ_MUST_USE nsresult GetContentStream(nsIURI*, nsIInputStream**); + MOZ_MUST_USE nsresult OpenCacheEntry(nsIURI*); MOZ_MUST_USE nsresult OpenCacheEntry(); - MOZ_MUST_USE nsresult WriteCacheEntryDescription(nsICacheEntry *); + MOZ_MUST_USE nsresult WriteCacheEntryDescription(nsICacheEntry*); MOZ_MUST_USE nsresult WriteCacheEntryUnavailable(); - MOZ_MUST_USE nsresult ParseURI(nsIURI *uri, nsACString &storageName, - nsILoadContextInfo **loadInfo, - nsCString &enahnceID, nsIURI **cacheUri); + MOZ_MUST_USE nsresult ParseURI(nsIURI* uri, nsACString& storageName, + nsILoadContextInfo** loadInfo, + nsCString& enahnceID, nsIURI** cacheUri); void CloseContent(); static MOZ_MUST_USE nsresult PrintCacheData( - nsIInputStream *aInStream, void *aClosure, const char *aFromSegment, - uint32_t aToOffset, uint32_t aCount, uint32_t *aWriteCount); + nsIInputStream* aInStream, void* aClosure, const char* aFromSegment, + uint32_t aToOffset, uint32_t aCount, uint32_t* aWriteCount); private: nsCString mStorageName, mEnhanceId; nsCOMPtr mLoadInfo; nsCOMPtr mCacheURI; - nsCString *mBuffer; + nsCString* mBuffer; nsCOMPtr mOutputStream; bool mWaitingForData; uint32_t mHexDumpState; diff --git a/netwerk/protocol/about/nsAboutProtocolHandler.cpp b/netwerk/protocol/about/nsAboutProtocolHandler.cpp index 1d95af91a5e61..0aefabfa8b69d 100644 --- a/netwerk/protocol/about/nsAboutProtocolHandler.cpp +++ b/netwerk/protocol/about/nsAboutProtocolHandler.cpp @@ -28,7 +28,7 @@ namespace net { static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID); static NS_DEFINE_CID(kNestedAboutURICID, NS_NESTEDABOUTURI_CID); -static bool IsSafeForUntrustedContent(nsIAboutModule *aModule, nsIURI *aURI) { +static bool IsSafeForUntrustedContent(nsIAboutModule* aModule, nsIURI* aURI) { uint32_t flags; nsresult rv = aModule->GetURIFlags(aURI, &flags); NS_ENSURE_SUCCESS(rv, false); @@ -36,8 +36,8 @@ static bool IsSafeForUntrustedContent(nsIAboutModule *aModule, nsIURI *aURI) { return (flags & nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT) != 0; } -static bool IsSafeToLinkForUntrustedContent(nsIAboutModule *aModule, - nsIURI *aURI) { +static bool IsSafeToLinkForUntrustedContent(nsIAboutModule* aModule, + nsIURI* aURI) { uint32_t flags; nsresult rv = aModule->GetURIFlags(aURI, &flags); NS_ENSURE_SUCCESS(rv, false); @@ -54,26 +54,26 @@ NS_IMPL_ISUPPORTS(nsAboutProtocolHandler, nsIProtocolHandler, // nsIProtocolHandler methods: NS_IMETHODIMP -nsAboutProtocolHandler::GetScheme(nsACString &result) { +nsAboutProtocolHandler::GetScheme(nsACString& result) { result.AssignLiteral("about"); return NS_OK; } NS_IMETHODIMP -nsAboutProtocolHandler::GetDefaultPort(int32_t *result) { +nsAboutProtocolHandler::GetDefaultPort(int32_t* result) { *result = -1; // no port for about: URLs return NS_OK; } NS_IMETHODIMP -nsAboutProtocolHandler::GetProtocolFlags(uint32_t *result) { +nsAboutProtocolHandler::GetProtocolFlags(uint32_t* result) { *result = URI_NORELATIVE | URI_NOAUTH | URI_DANGEROUS_TO_LOAD | URI_SCHEME_NOT_SELF_LINKABLE; return NS_OK; } NS_IMETHODIMP -nsAboutProtocolHandler::GetFlagsForURI(nsIURI *aURI, uint32_t *aFlags) { +nsAboutProtocolHandler::GetFlagsForURI(nsIURI* aURI, uint32_t* aFlags) { // First use the default (which is "unsafe for content"): GetProtocolFlags(aFlags); @@ -105,9 +105,9 @@ nsAboutProtocolHandler::GetFlagsForURI(nsIURI *aURI, uint32_t *aFlags) { } NS_IMETHODIMP -nsAboutProtocolHandler::NewURI(const nsACString &aSpec, - const char *aCharset, // ignore charset info - nsIURI *aBaseURI, nsIURI **result) { +nsAboutProtocolHandler::NewURI(const nsACString& aSpec, + const char* aCharset, // ignore charset info + nsIURI* aBaseURI, nsIURI** result) { *result = nullptr; nsresult rv; @@ -159,8 +159,8 @@ nsAboutProtocolHandler::NewURI(const nsACString &aSpec, } NS_IMETHODIMP -nsAboutProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, - nsIChannel **result) { +nsAboutProtocolHandler::NewChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, + nsIChannel** result) { NS_ENSURE_ARG_POINTER(uri); // about:what you ask? @@ -209,7 +209,7 @@ nsAboutProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, NS_ASSERTION(false, "nsIAboutModule->newChannel(aURI, aLoadInfo) needs to " "set LoadInfo"); - const char16_t *params[] = { + const char16_t* params[] = { u"nsIAboutModule->newChannel(aURI)", u"nsIAboutModule->newChannel(aURI, aLoadInfo)"}; nsContentUtils::ReportToConsole( @@ -260,8 +260,8 @@ nsAboutProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, } NS_IMETHODIMP -nsAboutProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +nsAboutProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { // don't override anything. *_retval = false; return NS_OK; @@ -276,28 +276,28 @@ NS_IMPL_ISUPPORTS(nsSafeAboutProtocolHandler, nsIProtocolHandler, // nsIProtocolHandler methods: NS_IMETHODIMP -nsSafeAboutProtocolHandler::GetScheme(nsACString &result) { +nsSafeAboutProtocolHandler::GetScheme(nsACString& result) { result.AssignLiteral("moz-safe-about"); return NS_OK; } NS_IMETHODIMP -nsSafeAboutProtocolHandler::GetDefaultPort(int32_t *result) { +nsSafeAboutProtocolHandler::GetDefaultPort(int32_t* result) { *result = -1; // no port for moz-safe-about: URLs return NS_OK; } NS_IMETHODIMP -nsSafeAboutProtocolHandler::GetProtocolFlags(uint32_t *result) { +nsSafeAboutProtocolHandler::GetProtocolFlags(uint32_t* result) { *result = URI_NORELATIVE | URI_NOAUTH | URI_LOADABLE_BY_ANYONE | URI_IS_POTENTIALLY_TRUSTWORTHY; return NS_OK; } NS_IMETHODIMP -nsSafeAboutProtocolHandler::NewURI(const nsACString &aSpec, - const char *aCharset, // ignore charset info - nsIURI *aBaseURI, nsIURI **result) { +nsSafeAboutProtocolHandler::NewURI(const nsACString& aSpec, + const char* aCharset, // ignore charset info + nsIURI* aBaseURI, nsIURI** result) { nsresult rv = NS_MutateURI(new nsSimpleURI::Mutator()).SetSpec(aSpec).Finalize(result); if (NS_FAILED(rv)) { @@ -308,15 +308,15 @@ nsSafeAboutProtocolHandler::NewURI(const nsACString &aSpec, } NS_IMETHODIMP -nsSafeAboutProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, - nsIChannel **result) { +nsSafeAboutProtocolHandler::NewChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, + nsIChannel** result) { *result = nullptr; return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -nsSafeAboutProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +nsSafeAboutProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { // don't override anything. *_retval = false; return NS_OK; @@ -326,19 +326,19 @@ nsSafeAboutProtocolHandler::AllowPort(int32_t port, const char *scheme, // nsNestedAboutURI implementation NS_INTERFACE_MAP_BEGIN(nsNestedAboutURI) if (aIID.Equals(kNestedAboutURICID)) - foundInterface = static_cast(this); + foundInterface = static_cast(this); else NS_INTERFACE_MAP_END_INHERITING(nsSimpleNestedURI) // nsISerializable NS_IMETHODIMP -nsNestedAboutURI::Read(nsIObjectInputStream *aStream) { +nsNestedAboutURI::Read(nsIObjectInputStream* aStream) { MOZ_ASSERT_UNREACHABLE("Use nsIURIMutator.read() instead"); return NS_ERROR_NOT_IMPLEMENTED; } -nsresult nsNestedAboutURI::ReadPrivate(nsIObjectInputStream *aStream) { +nsresult nsNestedAboutURI::ReadPrivate(nsIObjectInputStream* aStream) { nsresult rv = nsSimpleNestedURI::ReadPrivate(aStream); if (NS_FAILED(rv)) return rv; @@ -359,7 +359,7 @@ nsresult nsNestedAboutURI::ReadPrivate(nsIObjectInputStream *aStream) { } NS_IMETHODIMP -nsNestedAboutURI::Write(nsIObjectOutputStream *aStream) { +nsNestedAboutURI::Write(nsIObjectOutputStream* aStream) { nsresult rv = nsSimpleNestedURI::Write(aStream); if (NS_FAILED(rv)) return rv; @@ -383,8 +383,8 @@ nsNestedAboutURI::Write(nsIObjectOutputStream *aStream) { } // nsSimpleURI -/* virtual */ nsSimpleURI *nsNestedAboutURI::StartClone( - nsSimpleURI::RefHandlingEnum aRefHandlingMode, const nsACString &aNewRef) { +/* virtual */ nsSimpleURI* nsNestedAboutURI::StartClone( + nsSimpleURI::RefHandlingEnum aRefHandlingMode, const nsACString& aNewRef) { // Sadly, we can't make use of nsSimpleNestedURI::StartClone here. // However, this function is expected to exactly match that function, // aside from the "new ns***URI()" call. @@ -404,7 +404,7 @@ nsNestedAboutURI::Write(nsIObjectOutputStream *aStream) { return nullptr; } - nsNestedAboutURI *url = new nsNestedAboutURI(innerClone, mBaseURI); + nsNestedAboutURI* url = new nsNestedAboutURI(innerClone, mBaseURI); SetRefOnClone(url, aRefHandlingMode, aNewRef); return url; @@ -416,7 +416,7 @@ NS_IMPL_NSIURIMUTATOR_ISUPPORTS(nsNestedAboutURI::Mutator, nsIURISetters, nsINestedAboutURIMutator) NS_IMETHODIMP -nsNestedAboutURI::Mutate(nsIURIMutator **aMutator) { +nsNestedAboutURI::Mutate(nsIURIMutator** aMutator) { RefPtr mutator = new nsNestedAboutURI::Mutator(); nsresult rv = mutator->InitFromURI(this); if (NS_FAILED(rv)) { @@ -428,7 +428,7 @@ nsNestedAboutURI::Mutate(nsIURIMutator **aMutator) { // nsIClassInfo NS_IMETHODIMP -nsNestedAboutURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) { +nsNestedAboutURI::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc) { *aClassIDNoAlloc = kNestedAboutURICID; return NS_OK; } diff --git a/netwerk/protocol/about/nsAboutProtocolUtils.h b/netwerk/protocol/about/nsAboutProtocolUtils.h index 41828b4444292..da6e64230bbe5 100644 --- a/netwerk/protocol/about/nsAboutProtocolUtils.h +++ b/netwerk/protocol/about/nsAboutProtocolUtils.h @@ -12,8 +12,8 @@ #include "nsServiceManagerUtils.h" #include "prtime.h" -inline MOZ_MUST_USE nsresult NS_GetAboutModuleName(nsIURI *aAboutURI, - nsCString &aModule) { +inline MOZ_MUST_USE nsresult NS_GetAboutModuleName(nsIURI* aAboutURI, + nsCString& aModule) { #ifdef DEBUG { bool isAbout; @@ -36,7 +36,7 @@ inline MOZ_MUST_USE nsresult NS_GetAboutModuleName(nsIURI *aAboutURI, return NS_OK; } -inline nsresult NS_GetAboutModule(nsIURI *aAboutURI, nsIAboutModule **aModule) { +inline nsresult NS_GetAboutModule(nsIURI* aAboutURI, nsIAboutModule** aModule) { MOZ_ASSERT(aAboutURI, "Must have URI"); nsAutoCString contractID; @@ -55,7 +55,7 @@ inline PRTime SecondsToPRTime(uint32_t t_sec) { usec_per_sec = PR_USEC_PER_SEC; return t_usec *= usec_per_sec; } -inline void PrintTimeString(char *buf, uint32_t bufsize, uint32_t t_sec) { +inline void PrintTimeString(char* buf, uint32_t bufsize, uint32_t t_sec) { PRExplodedTime et; PRTime t_usec = SecondsToPRTime(t_sec); PR_ExplodeTime(t_usec, PR_LocalTimeParameters, &et); diff --git a/netwerk/protocol/data/DataChannelChild.h b/netwerk/protocol/data/DataChannelChild.h index c5ebde129e1d1..516722b9c1a7b 100644 --- a/netwerk/protocol/data/DataChannelChild.h +++ b/netwerk/protocol/data/DataChannelChild.h @@ -20,7 +20,7 @@ class DataChannelChild : public nsDataChannel, public nsIChildChannel, public PDataChannelChild { public: - explicit DataChannelChild(nsIURI *uri); + explicit DataChannelChild(nsIURI* uri); NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSICHILDCHANNEL diff --git a/netwerk/protocol/data/DataChannelParent.cpp b/netwerk/protocol/data/DataChannelParent.cpp index 24451191a7347..9b8aea8992b98 100644 --- a/netwerk/protocol/data/DataChannelParent.cpp +++ b/netwerk/protocol/data/DataChannelParent.cpp @@ -14,7 +14,7 @@ namespace net { NS_IMPL_ISUPPORTS(DataChannelParent, nsIParentChannel, nsIStreamListener) -bool DataChannelParent::Init(const uint32_t &channelId) { +bool DataChannelParent::Init(const uint32_t& channelId) { nsCOMPtr channel; MOZ_ALWAYS_SUCCEEDS( NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel))); @@ -23,7 +23,7 @@ bool DataChannelParent::Init(const uint32_t &channelId) { } NS_IMETHODIMP -DataChannelParent::SetParentListener(HttpChannelParentListener *aListener) { +DataChannelParent::SetParentListener(HttpChannelParentListener* aListener) { // Nothing to do. return NS_OK; } @@ -62,9 +62,9 @@ DataChannelParent::NotifyFlashPluginStateChanged( } NS_IMETHODIMP -DataChannelParent::SetClassifierMatchedInfo(const nsACString &aList, - const nsACString &aProvider, - const nsACString &aFullHash) { +DataChannelParent::SetClassifierMatchedInfo(const nsACString& aList, + const nsACString& aProvider, + const nsACString& aFullHash) { // nothing to do return NS_OK; } @@ -85,7 +85,7 @@ DataChannelParent::Delete() { void DataChannelParent::ActorDestroy(ActorDestroyReason why) {} NS_IMETHODIMP -DataChannelParent::OnStartRequest(nsIRequest *aRequest) { +DataChannelParent::OnStartRequest(nsIRequest* aRequest) { // We don't have a way to prevent nsBaseChannel from calling AsyncOpen on // the created nsDataChannel. We don't have anywhere to send the data in the // parent, so abort the binding. @@ -93,15 +93,15 @@ DataChannelParent::OnStartRequest(nsIRequest *aRequest) { } NS_IMETHODIMP -DataChannelParent::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) { +DataChannelParent::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) { // See above. MOZ_ASSERT(NS_FAILED(aStatusCode)); return NS_OK; } NS_IMETHODIMP -DataChannelParent::OnDataAvailable(nsIRequest *aRequest, - nsIInputStream *aInputStream, +DataChannelParent::OnDataAvailable(nsIRequest* aRequest, + nsIInputStream* aInputStream, uint64_t aOffset, uint32_t aCount) { // See above. MOZ_CRASH("Should never be called"); diff --git a/netwerk/protocol/data/nsDataChannel.h b/netwerk/protocol/data/nsDataChannel.h index b916fb93254cc..1c02299a78541 100644 --- a/netwerk/protocol/data/nsDataChannel.h +++ b/netwerk/protocol/data/nsDataChannel.h @@ -14,11 +14,11 @@ class nsIInputStream; class nsDataChannel : public nsBaseChannel { public: - explicit nsDataChannel(nsIURI *uri) { SetURI(uri); } + explicit nsDataChannel(nsIURI* uri) { SetURI(uri); } protected: virtual MOZ_MUST_USE nsresult OpenContentStream( - bool async, nsIInputStream **result, nsIChannel **channel) override; + bool async, nsIInputStream** result, nsIChannel** channel) override; }; #endif /* nsDataChannel_h___ */ diff --git a/netwerk/protocol/file/FileChannelChild.cpp b/netwerk/protocol/file/FileChannelChild.cpp index fae58b9674d12..a81adf146b39f 100644 --- a/netwerk/protocol/file/FileChannelChild.cpp +++ b/netwerk/protocol/file/FileChannelChild.cpp @@ -15,13 +15,13 @@ namespace net { NS_IMPL_ISUPPORTS_INHERITED(FileChannelChild, nsFileChannel, nsIChildChannel) -FileChannelChild::FileChannelChild(nsIURI *uri) +FileChannelChild::FileChannelChild(nsIURI* uri) : nsFileChannel(uri), mIPCOpen(false) {} NS_IMETHODIMP FileChannelChild::ConnectParent(uint32_t id) { - mozilla::dom::ContentChild *cc = - static_cast(gNeckoChild->Manager()); + mozilla::dom::ContentChild* cc = + static_cast(gNeckoChild->Manager()); if (cc->IsShuttingDown()) { return NS_ERROR_FAILURE; } @@ -35,8 +35,8 @@ FileChannelChild::ConnectParent(uint32_t id) { } NS_IMETHODIMP -FileChannelChild::CompleteRedirectSetup(nsIStreamListener *listener, - nsISupports *ctx) { +FileChannelChild::CompleteRedirectSetup(nsIStreamListener* listener, + nsISupports* ctx) { nsresult rv; rv = AsyncOpen(listener); diff --git a/netwerk/protocol/file/FileChannelChild.h b/netwerk/protocol/file/FileChannelChild.h index d91b088d64ff3..145316c5ecdb5 100644 --- a/netwerk/protocol/file/FileChannelChild.h +++ b/netwerk/protocol/file/FileChannelChild.h @@ -20,7 +20,7 @@ class FileChannelChild : public nsFileChannel, public nsIChildChannel, public PFileChannelChild { public: - explicit FileChannelChild(nsIURI *uri); + explicit FileChannelChild(nsIURI* uri); NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSICHILDCHANNEL diff --git a/netwerk/protocol/file/FileChannelParent.cpp b/netwerk/protocol/file/FileChannelParent.cpp index 94d0e47514242..12c3f3c3b5815 100644 --- a/netwerk/protocol/file/FileChannelParent.cpp +++ b/netwerk/protocol/file/FileChannelParent.cpp @@ -14,7 +14,7 @@ namespace net { NS_IMPL_ISUPPORTS(FileChannelParent, nsIParentChannel, nsIStreamListener) -bool FileChannelParent::Init(const uint32_t &channelId) { +bool FileChannelParent::Init(const uint32_t& channelId) { nsCOMPtr channel; MOZ_ALWAYS_SUCCEEDS( NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel))); @@ -23,7 +23,7 @@ bool FileChannelParent::Init(const uint32_t &channelId) { } NS_IMETHODIMP -FileChannelParent::SetParentListener(HttpChannelParentListener *aListener) { +FileChannelParent::SetParentListener(HttpChannelParentListener* aListener) { // Nothing to do. return NS_OK; } @@ -62,9 +62,9 @@ FileChannelParent::NotifyFlashPluginStateChanged( } NS_IMETHODIMP -FileChannelParent::SetClassifierMatchedInfo(const nsACString &aList, - const nsACString &aProvider, - const nsACString &aFullHash) { +FileChannelParent::SetClassifierMatchedInfo(const nsACString& aList, + const nsACString& aProvider, + const nsACString& aFullHash) { // nothing to do return NS_OK; } @@ -85,7 +85,7 @@ FileChannelParent::Delete() { void FileChannelParent::ActorDestroy(ActorDestroyReason why) {} NS_IMETHODIMP -FileChannelParent::OnStartRequest(nsIRequest *aRequest) { +FileChannelParent::OnStartRequest(nsIRequest* aRequest) { // We don't have a way to prevent nsBaseChannel from calling AsyncOpen on // the created nsDataChannel. We don't have anywhere to send the data in the // parent, so abort the binding. @@ -93,15 +93,15 @@ FileChannelParent::OnStartRequest(nsIRequest *aRequest) { } NS_IMETHODIMP -FileChannelParent::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) { +FileChannelParent::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) { // See above. MOZ_ASSERT(NS_FAILED(aStatusCode)); return NS_OK; } NS_IMETHODIMP -FileChannelParent::OnDataAvailable(nsIRequest *aRequest, - nsIInputStream *aInputStream, +FileChannelParent::OnDataAvailable(nsIRequest* aRequest, + nsIInputStream* aInputStream, uint64_t aOffset, uint32_t aCount) { // See above. MOZ_CRASH("Should never be called"); diff --git a/netwerk/protocol/file/nsFileChannel.cpp b/netwerk/protocol/file/nsFileChannel.cpp index 27f1958010ff1..5e19e27f44e66 100644 --- a/netwerk/protocol/file/nsFileChannel.cpp +++ b/netwerk/protocol/file/nsFileChannel.cpp @@ -39,7 +39,7 @@ using namespace mozilla::net; class nsFileCopyEvent : public Runnable { public: - nsFileCopyEvent(nsIOutputStream *dest, nsIInputStream *source, int64_t len) + nsFileCopyEvent(nsIOutputStream* dest, nsIInputStream* source, int64_t len) : mozilla::Runnable("nsFileCopyEvent"), mDest(dest), mSource(source), @@ -55,8 +55,8 @@ class nsFileCopyEvent : public Runnable { // Call this method to perform the file copy on a background thread. The // callback is dispatched when the file copy completes. - nsresult Dispatch(nsIRunnable *callback, nsITransportEventSink *sink, - nsIEventTarget *target); + nsresult Dispatch(nsIRunnable* callback, nsITransportEventSink* sink, + nsIEventTarget* target); // Call this method to interrupt a file copy operation that is occuring on // a background thread. The status parameter passed to this function must @@ -132,9 +132,9 @@ void nsFileCopyEvent::DoCopy() { } } -nsresult nsFileCopyEvent::Dispatch(nsIRunnable *callback, - nsITransportEventSink *sink, - nsIEventTarget *target) { +nsresult nsFileCopyEvent::Dispatch(nsIRunnable* callback, + nsITransportEventSink* sink, + nsIEventTarget* target) { // Use the supplied event target for all asynchronous operations. mCallback = callback; @@ -164,19 +164,19 @@ class nsFileUploadContentStream : public nsBaseContentStream { NS_INLINE_DECL_REFCOUNTING_INHERITED(nsFileUploadContentStream, nsBaseContentStream) - nsFileUploadContentStream(bool nonBlocking, nsIOutputStream *dest, - nsIInputStream *source, int64_t len, - nsITransportEventSink *sink) + nsFileUploadContentStream(bool nonBlocking, nsIOutputStream* dest, + nsIInputStream* source, int64_t len, + nsITransportEventSink* sink) : nsBaseContentStream(nonBlocking), mCopyEvent(new nsFileCopyEvent(dest, source, len)), mSink(sink) {} bool IsInitialized() { return mCopyEvent != nullptr; } - NS_IMETHOD ReadSegments(nsWriteSegmentFun fun, void *closure, uint32_t count, - uint32_t *result) override; - NS_IMETHOD AsyncWait(nsIInputStreamCallback *callback, uint32_t flags, - uint32_t count, nsIEventTarget *target) override; + NS_IMETHOD ReadSegments(nsWriteSegmentFun fun, void* closure, uint32_t count, + uint32_t* result) override; + NS_IMETHOD AsyncWait(nsIInputStreamCallback* callback, uint32_t flags, + uint32_t count, nsIEventTarget* target) override; private: virtual ~nsFileUploadContentStream() = default; @@ -188,8 +188,8 @@ class nsFileUploadContentStream : public nsBaseContentStream { }; NS_IMETHODIMP -nsFileUploadContentStream::ReadSegments(nsWriteSegmentFun fun, void *closure, - uint32_t count, uint32_t *result) { +nsFileUploadContentStream::ReadSegments(nsWriteSegmentFun fun, void* closure, + uint32_t count, uint32_t* result) { *result = 0; // nothing is ever actually read from this stream if (IsClosed()) return NS_OK; @@ -209,9 +209,9 @@ nsFileUploadContentStream::ReadSegments(nsWriteSegmentFun fun, void *closure, } NS_IMETHODIMP -nsFileUploadContentStream::AsyncWait(nsIInputStreamCallback *callback, +nsFileUploadContentStream::AsyncWait(nsIInputStreamCallback* callback, uint32_t flags, uint32_t count, - nsIEventTarget *target) { + nsIEventTarget* target) { nsresult rv = nsBaseContentStream::AsyncWait(callback, flags, count, target); if (NS_FAILED(rv) || IsClosed()) return rv; @@ -234,7 +234,7 @@ void nsFileUploadContentStream::OnCopyComplete() { //----------------------------------------------------------------------------- -nsFileChannel::nsFileChannel(nsIURI *uri) : mUploadLength(0), mFileURI(uri) {} +nsFileChannel::nsFileChannel(nsIURI* uri) : mUploadLength(0), mFileURI(uri) {} nsresult nsFileChannel::Init() { NS_ENSURE_STATE(mLoadInfo); @@ -289,9 +289,9 @@ nsresult nsFileChannel::Init() { return NS_OK; } -nsresult nsFileChannel::MakeFileInputStream(nsIFile *file, - nsCOMPtr &stream, - nsCString &contentType, +nsresult nsFileChannel::MakeFileInputStream(nsIFile* file, + nsCOMPtr& stream, + nsCString& contentType, bool async) { // we accept that this might result in a disk hit to stat the file bool isDir; @@ -327,8 +327,8 @@ nsresult nsFileChannel::MakeFileInputStream(nsIFile *file, return rv; } -nsresult nsFileChannel::OpenContentStream(bool async, nsIInputStream **result, - nsIChannel **channel) { +nsresult nsFileChannel::OpenContentStream(bool async, nsIInputStream** result, + nsIChannel** channel) { // NOTE: the resulting file is a clone, so it is safe to pass it to the // file input stream which will be read on a background thread. nsCOMPtr file; @@ -413,7 +413,7 @@ nsresult nsFileChannel::OpenContentStream(bool async, nsIInputStream **result, return NS_OK; } -nsresult nsFileChannel::ListenerBlockingPromise(BlockingPromise **aPromise) { +nsresult nsFileChannel::ListenerBlockingPromise(BlockingPromise** aPromise) { NS_ENSURE_ARG(aPromise); *aPromise = nullptr; @@ -476,7 +476,7 @@ NS_IMPL_ISUPPORTS_INHERITED(nsFileChannel, nsBaseChannel, nsIUploadChannel, // nsFileChannel::nsIFileChannel NS_IMETHODIMP -nsFileChannel::GetFile(nsIFile **file) { +nsFileChannel::GetFile(nsIFile** file) { nsCOMPtr fileURL = do_QueryInterface(URI()); NS_ENSURE_STATE(fileURL); @@ -488,8 +488,8 @@ nsFileChannel::GetFile(nsIFile **file) { // nsFileChannel::nsIUploadChannel NS_IMETHODIMP -nsFileChannel::SetUploadStream(nsIInputStream *stream, - const nsACString &contentType, +nsFileChannel::SetUploadStream(nsIInputStream* stream, + const nsACString& contentType, int64_t contentLength) { NS_ENSURE_TRUE(!Pending(), NS_ERROR_IN_PROGRESS); @@ -511,7 +511,7 @@ nsFileChannel::SetUploadStream(nsIInputStream *stream, } NS_IMETHODIMP -nsFileChannel::GetUploadStream(nsIInputStream **result) { +nsFileChannel::GetUploadStream(nsIInputStream** result) { NS_IF_ADDREF(*result = mUploadStream); return NS_OK; } diff --git a/netwerk/protocol/file/nsFileChannel.h b/netwerk/protocol/file/nsFileChannel.h index 7257d0a4792e7..99eef4b318bb4 100644 --- a/netwerk/protocol/file/nsFileChannel.h +++ b/netwerk/protocol/file/nsFileChannel.h @@ -19,7 +19,7 @@ class nsFileChannel : public nsBaseChannel, NS_DECL_NSIFILECHANNEL NS_DECL_NSIUPLOADCHANNEL - explicit nsFileChannel(nsIURI *uri); + explicit nsFileChannel(nsIURI* uri); nsresult Init(); @@ -30,16 +30,16 @@ class nsFileChannel : public nsBaseChannel, // method also returns a best guess at the content-type for the data stream. // NOTE: If the channel has a type hint set, contentType will be left // untouched. The caller should not use it in that case. - MOZ_MUST_USE nsresult MakeFileInputStream(nsIFile *file, - nsCOMPtr &stream, - nsCString &contentType, bool async); + MOZ_MUST_USE nsresult MakeFileInputStream(nsIFile* file, + nsCOMPtr& stream, + nsCString& contentType, bool async); virtual MOZ_MUST_USE nsresult OpenContentStream( - bool async, nsIInputStream **result, nsIChannel **channel) override; + bool async, nsIInputStream** result, nsIChannel** channel) override; // Implementing the pump blocking promise to fixup content length on a // background thread prior to calling on mListener - virtual nsresult ListenerBlockingPromise(BlockingPromise **promise) override; + virtual nsresult ListenerBlockingPromise(BlockingPromise** promise) override; private: nsresult FixupContentLength(bool async); diff --git a/netwerk/protocol/file/nsFileProtocolHandler.cpp b/netwerk/protocol/file/nsFileProtocolHandler.cpp index 00f388c547934..0b93a92657a18 100644 --- a/netwerk/protocol/file/nsFileProtocolHandler.cpp +++ b/netwerk/protocol/file/nsFileProtocolHandler.cpp @@ -44,7 +44,7 @@ NS_IMPL_ISUPPORTS(nsFileProtocolHandler, nsIFileProtocolHandler, #if defined(XP_WIN) NS_IMETHODIMP -nsFileProtocolHandler::ReadURLFile(nsIFile *aFile, nsIURI **aURI) { +nsFileProtocolHandler::ReadURLFile(nsIFile* aFile, nsIURI** aURI) { nsAutoString path; nsresult rv = aFile->GetPath(path); if (NS_FAILED(rv)) return rv; @@ -57,13 +57,13 @@ nsFileProtocolHandler::ReadURLFile(nsIFile *aFile, nsIURI **aURI) { rv = NS_ERROR_NOT_AVAILABLE; - IUniformResourceLocatorW *urlLink = nullptr; + IUniformResourceLocatorW* urlLink = nullptr; result = ::CoCreateInstance(CLSID_InternetShortcut, nullptr, CLSCTX_INPROC_SERVER, - IID_IUniformResourceLocatorW, (void **)&urlLink); + IID_IUniformResourceLocatorW, (void**)&urlLink); if (SUCCEEDED(result) && urlLink) { - IPersistFile *urlFile = nullptr; - result = urlLink->QueryInterface(IID_IPersistFile, (void **)&urlFile); + IPersistFile* urlFile = nullptr; + result = urlLink->QueryInterface(IID_IPersistFile, (void**)&urlFile); if (SUCCEEDED(result) && urlFile) { result = urlFile->Load(path.get(), STGM_READ); if (SUCCEEDED(result)) { @@ -87,7 +87,7 @@ nsFileProtocolHandler::ReadURLFile(nsIFile *aFile, nsIURI **aURI) { #elif defined(XP_UNIX) NS_IMETHODIMP -nsFileProtocolHandler::ReadURLFile(nsIFile *aFile, nsIURI **aURI) { +nsFileProtocolHandler::ReadURLFile(nsIFile* aFile, nsIURI** aURI) { // We only support desktop files that end in ".desktop" like the spec says: // http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html nsAutoCString leafName; @@ -119,33 +119,33 @@ nsFileProtocolHandler::ReadURLFile(nsIFile *aFile, nsIURI **aURI) { #else // other platforms NS_IMETHODIMP -nsFileProtocolHandler::ReadURLFile(nsIFile *aFile, nsIURI **aURI) { +nsFileProtocolHandler::ReadURLFile(nsIFile* aFile, nsIURI** aURI) { return NS_ERROR_NOT_AVAILABLE; } #endif // ReadURLFile() NS_IMETHODIMP -nsFileProtocolHandler::GetScheme(nsACString &result) { +nsFileProtocolHandler::GetScheme(nsACString& result) { result.AssignLiteral("file"); return NS_OK; } NS_IMETHODIMP -nsFileProtocolHandler::GetDefaultPort(int32_t *result) { +nsFileProtocolHandler::GetDefaultPort(int32_t* result) { *result = -1; // no port for file: URLs return NS_OK; } NS_IMETHODIMP -nsFileProtocolHandler::GetProtocolFlags(uint32_t *result) { +nsFileProtocolHandler::GetProtocolFlags(uint32_t* result) { *result = URI_NOAUTH | URI_IS_LOCAL_FILE | URI_IS_LOCAL_RESOURCE | URI_IS_POTENTIALLY_TRUSTWORTHY; return NS_OK; } NS_IMETHODIMP -nsFileProtocolHandler::NewURI(const nsACString &spec, const char *charset, - nsIURI *aBaseURI, nsIURI **result) { +nsFileProtocolHandler::NewURI(const nsACString& spec, const char* charset, + nsIURI* aBaseURI, nsIURI** result) { nsAutoCString buf(spec); #if defined(XP_WIN) buf.Truncate(); @@ -164,8 +164,8 @@ nsFileProtocolHandler::NewURI(const nsACString &spec, const char *charset, } NS_IMETHODIMP -nsFileProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, - nsIChannel **result) { +nsFileProtocolHandler::NewChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, + nsIChannel** result) { nsresult rv; RefPtr chan; @@ -193,8 +193,8 @@ nsFileProtocolHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, } NS_IMETHODIMP -nsFileProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *result) { +nsFileProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* result) { // don't override anything. *result = false; return NS_OK; @@ -204,7 +204,7 @@ nsFileProtocolHandler::AllowPort(int32_t port, const char *scheme, // nsIFileProtocolHandler methods: NS_IMETHODIMP -nsFileProtocolHandler::NewFileURI(nsIFile *aFile, nsIURI **aResult) { +nsFileProtocolHandler::NewFileURI(nsIFile* aFile, nsIURI** aResult) { NS_ENSURE_ARG_POINTER(aFile); RefPtr file(aFile); @@ -216,8 +216,8 @@ nsFileProtocolHandler::NewFileURI(nsIFile *aFile, nsIURI **aResult) { } NS_IMETHODIMP -nsFileProtocolHandler::NewFileURIMutator(nsIFile *aFile, - nsIURIMutator **aResult) { +nsFileProtocolHandler::NewFileURIMutator(nsIFile* aFile, + nsIURIMutator** aResult) { NS_ENSURE_ARG_POINTER(aFile); nsresult rv; @@ -239,26 +239,26 @@ nsFileProtocolHandler::NewFileURIMutator(nsIFile *aFile, } NS_IMETHODIMP -nsFileProtocolHandler::GetURLSpecFromFile(nsIFile *file, nsACString &result) { +nsFileProtocolHandler::GetURLSpecFromFile(nsIFile* file, nsACString& result) { NS_ENSURE_ARG_POINTER(file); return net_GetURLSpecFromFile(file, result); } NS_IMETHODIMP -nsFileProtocolHandler::GetURLSpecFromActualFile(nsIFile *file, - nsACString &result) { +nsFileProtocolHandler::GetURLSpecFromActualFile(nsIFile* file, + nsACString& result) { NS_ENSURE_ARG_POINTER(file); return net_GetURLSpecFromActualFile(file, result); } NS_IMETHODIMP -nsFileProtocolHandler::GetURLSpecFromDir(nsIFile *file, nsACString &result) { +nsFileProtocolHandler::GetURLSpecFromDir(nsIFile* file, nsACString& result) { NS_ENSURE_ARG_POINTER(file); return net_GetURLSpecFromDir(file, result); } NS_IMETHODIMP -nsFileProtocolHandler::GetFileFromURLSpec(const nsACString &spec, - nsIFile **result) { +nsFileProtocolHandler::GetFileFromURLSpec(const nsACString& spec, + nsIFile** result) { return net_GetFileFromURLSpec(spec, result); } diff --git a/netwerk/protocol/ftp/nsFTPChannel.cpp b/netwerk/protocol/ftp/nsFTPChannel.cpp index f58f6cd7d8f67..07d0e84f7c86d 100644 --- a/netwerk/protocol/ftp/nsFTPChannel.cpp +++ b/netwerk/protocol/ftp/nsFTPChannel.cpp @@ -32,8 +32,8 @@ NS_IMPL_ISUPPORTS_INHERITED(nsFtpChannel, nsBaseChannel, nsIUploadChannel, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsFtpChannel::SetUploadStream(nsIInputStream *stream, - const nsACString &contentType, +nsFtpChannel::SetUploadStream(nsIInputStream* stream, + const nsACString& contentType, int64_t contentLength) { NS_ENSURE_TRUE(!Pending(), NS_ERROR_IN_PROGRESS); @@ -45,7 +45,7 @@ nsFtpChannel::SetUploadStream(nsIInputStream *stream, } NS_IMETHODIMP -nsFtpChannel::GetUploadStream(nsIInputStream **aStream) { +nsFtpChannel::GetUploadStream(nsIInputStream** aStream) { NS_ENSURE_ARG_POINTER(aStream); nsCOMPtr stream = mUploadStream; stream.forget(aStream); @@ -55,7 +55,7 @@ nsFtpChannel::GetUploadStream(nsIInputStream **aStream) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsFtpChannel::ResumeAt(uint64_t aStartPos, const nsACString &aEntityID) { +nsFtpChannel::ResumeAt(uint64_t aStartPos, const nsACString& aEntityID) { NS_ENSURE_TRUE(!Pending(), NS_ERROR_IN_PROGRESS); mEntityID = aEntityID; mStartPos = aStartPos; @@ -64,7 +64,7 @@ nsFtpChannel::ResumeAt(uint64_t aStartPos, const nsACString &aEntityID) { } NS_IMETHODIMP -nsFtpChannel::GetEntityID(nsACString &entityID) { +nsFtpChannel::GetEntityID(nsACString& entityID) { if (mEntityID.IsEmpty()) return NS_ERROR_NOT_RESUMABLE; entityID = mEntityID; @@ -73,7 +73,7 @@ nsFtpChannel::GetEntityID(nsACString &entityID) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsFtpChannel::GetProxyInfo(nsIProxyInfo **aProxyInfo) { +nsFtpChannel::GetProxyInfo(nsIProxyInfo** aProxyInfo) { nsCOMPtr info = ProxyInfo(); info.forget(aProxyInfo); return NS_OK; @@ -81,8 +81,8 @@ nsFtpChannel::GetProxyInfo(nsIProxyInfo **aProxyInfo) { //----------------------------------------------------------------------------- -nsresult nsFtpChannel::OpenContentStream(bool async, nsIInputStream **result, - nsIChannel **channel) { +nsresult nsFtpChannel::OpenContentStream(bool async, nsIInputStream** result, + nsIChannel** channel) { if (!async) return NS_ERROR_NOT_IMPLEMENTED; RefPtr state = new nsFtpState(); @@ -96,7 +96,7 @@ nsresult nsFtpChannel::OpenContentStream(bool async, nsIInputStream **result, return NS_OK; } -bool nsFtpChannel::GetStatusArg(nsresult status, nsString &statusArg) { +bool nsFtpChannel::GetStatusArg(nsresult status, nsString& statusArg) { nsAutoCString host; URI()->GetHost(host); CopyUTF8toUTF16(host, statusArg); @@ -113,7 +113,7 @@ class FTPEventSinkProxy final : public nsIFTPEventSink { ~FTPEventSinkProxy() = default; public: - explicit FTPEventSinkProxy(nsIFTPEventSink *aTarget) + explicit FTPEventSinkProxy(nsIFTPEventSink* aTarget) : mTarget(aTarget), mEventTarget(GetCurrentThreadEventTarget()) {} NS_DECL_THREADSAFE_ISUPPORTS @@ -121,8 +121,8 @@ class FTPEventSinkProxy final : public nsIFTPEventSink { class OnFTPControlLogRunnable : public Runnable { public: - OnFTPControlLogRunnable(nsIFTPEventSink *aTarget, bool aServer, - const char *aMessage) + OnFTPControlLogRunnable(nsIFTPEventSink* aTarget, bool aServer, + const char* aMessage) : mozilla::Runnable("FTPEventSinkProxy::OnFTPControlLogRunnable"), mTarget(aTarget), mServer(aServer), @@ -144,7 +144,7 @@ class FTPEventSinkProxy final : public nsIFTPEventSink { NS_IMPL_ISUPPORTS(FTPEventSinkProxy, nsIFTPEventSink) NS_IMETHODIMP -FTPEventSinkProxy::OnFTPControlLog(bool aServer, const char *aMsg) { +FTPEventSinkProxy::OnFTPControlLog(bool aServer, const char* aMsg) { RefPtr r = new OnFTPControlLogRunnable(mTarget, aServer, aMsg); return mEventTarget->Dispatch(r, NS_DISPATCH_NORMAL); @@ -158,7 +158,7 @@ FTPEventSinkProxy::OnFTPControlLogRunnable::Run() { } // namespace -void nsFtpChannel::GetFTPEventSink(nsCOMPtr &aResult) { +void nsFtpChannel::GetFTPEventSink(nsCOMPtr& aResult) { if (!mFTPEventSink) { nsCOMPtr ftpSink; GetCallback(ftpSink); @@ -181,7 +181,7 @@ nsFtpChannel::ForcePending(bool aForcePending) { } NS_IMETHODIMP -nsFtpChannel::IsPending(bool *result) { +nsFtpChannel::IsPending(bool* result) { *result = Pending(); return NS_OK; } @@ -224,7 +224,7 @@ nsFtpChannel::Resume() { NS_IMETHODIMP nsFtpChannel::MessageDiversionStarted( - ADivertableParentChannel *aParentChannel) { + ADivertableParentChannel* aParentChannel) { MOZ_ASSERT(!mParentChannel); mParentChannel = aParentChannel; // If the channel is suspended, propagate that info to the parent's mEventQ. diff --git a/netwerk/protocol/ftp/nsFTPChannel.h b/netwerk/protocol/ftp/nsFTPChannel.h index 1c43bd91fbaf0..f8ae858538afb 100644 --- a/netwerk/protocol/ftp/nsFTPChannel.h +++ b/netwerk/protocol/ftp/nsFTPChannel.h @@ -36,7 +36,7 @@ class nsFtpChannel final : public nsBaseChannel, NS_DECL_NSIPROXIEDCHANNEL NS_DECL_NSICHANNELWITHDIVERTABLEPARENTLISTENER - nsFtpChannel(nsIURI *uri, nsIProxyInfo *pi) + nsFtpChannel(nsIURI* uri, nsIProxyInfo* pi) : mProxyInfo(pi), mStartPos(0), mResumeRequested(false), @@ -46,16 +46,16 @@ class nsFtpChannel final : public nsBaseChannel, SetURI(uri); } - void UpdateURI(nsIURI *aURI) { + void UpdateURI(nsIURI* aURI) { MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread(), "Not thread-safe."); mURI = aURI; } - nsIProxyInfo *ProxyInfo() { return mProxyInfo; } + nsIProxyInfo* ProxyInfo() { return mProxyInfo; } - void SetProxyInfo(nsIProxyInfo *pi) { mProxyInfo = pi; } + void SetProxyInfo(nsIProxyInfo* pi) { mProxyInfo = pi; } - NS_IMETHOD IsPending(bool *result) override; + NS_IMETHOD IsPending(bool* result) override; // This is a short-cut to calling nsIRequest::IsPending(). // Overrides Pending in nsBaseChannel. @@ -68,10 +68,10 @@ class nsFtpChannel final : public nsBaseChannel, uint64_t StartPos() { return mStartPos; } // ID of the entity to resume downloading - const nsCString &EntityID() { return mEntityID; } - void SetEntityID(const nsACString &entityID) { mEntityID = entityID; } + const nsCString& EntityID() { return mEntityID; } + void SetEntityID(const nsACString& entityID) { mEntityID = entityID; } - NS_IMETHOD GetLastModifiedTime(PRTime *lastModifiedTime) override { + NS_IMETHOD GetLastModifiedTime(PRTime* lastModifiedTime) override { *lastModifiedTime = mLastModifiedTime; return NS_OK; } @@ -82,10 +82,10 @@ class nsFtpChannel final : public nsBaseChannel, } // Data stream to upload - nsIInputStream *UploadStream() { return mUploadStream; } + nsIInputStream* UploadStream() { return mUploadStream; } // Helper function for getting the nsIFTPEventSink. - void GetFTPEventSink(nsCOMPtr &aResult); + void GetFTPEventSink(nsCOMPtr& aResult); NS_IMETHOD Suspend() override; NS_IMETHOD Resume() override; @@ -95,9 +95,9 @@ class nsFtpChannel final : public nsBaseChannel, protected: virtual ~nsFtpChannel() = default; - virtual nsresult OpenContentStream(bool async, nsIInputStream **result, - nsIChannel **channel) override; - virtual bool GetStatusArg(nsresult status, nsString &statusArg) override; + virtual nsresult OpenContentStream(bool async, nsIInputStream** result, + nsIChannel** channel) override; + virtual bool GetStatusArg(nsresult status, nsString& statusArg) override; virtual void OnCallbacksChanged() override; private: diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp index 5a47bd08ad293..37d786ab1f17f 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp @@ -54,7 +54,7 @@ extern LazyLogModule gFTPLog; #define LOG_INFO(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Info, args) // remove FTP parameters (starting with ";") from the path -static void removeParamsFromPath(nsCString &path) { +static void removeParamsFromPath(nsCString& path) { int32_t index = path.FindChar(';'); if (index >= 0) { path.SetLength(index); @@ -108,7 +108,7 @@ nsFtpState::~nsFtpState() { // nsIInputStreamCallback implementation NS_IMETHODIMP -nsFtpState::OnInputStreamReady(nsIAsyncInputStream *aInStream) { +nsFtpState::OnInputStreamReady(nsIAsyncInputStream* aInStream) { LOG(("FTP:(%p) data stream ready\n", this)); // We are receiving a notification from our data stream, so just forward it @@ -118,7 +118,7 @@ nsFtpState::OnInputStreamReady(nsIAsyncInputStream *aInStream) { return NS_OK; } -void nsFtpState::OnControlDataAvailable(const char *aData, uint32_t aDataLen) { +void nsFtpState::OnControlDataAvailable(const char* aData, uint32_t aDataLen) { LOG(("FTP:(%p) control data available [%u]\n", this, aDataLen)); mControlConnection->WaitData(this); // queue up another call @@ -139,7 +139,7 @@ void nsFtpState::OnControlDataAvailable(const char *aData, uint32_t aDataLen) { buffer.Append(aData, aDataLen); - const char *currLine = buffer.get(); + const char* currLine = buffer.get(); while (*currLine && mKeepRunning) { int32_t eolLength = strcspn(currLine, CRLF); int32_t currLineLength = strlen(currLine); @@ -661,7 +661,7 @@ nsresult nsFtpState::S_user() { return NS_ERROR_FAILURE; nsCOMPtr prompter; - NS_QueryAuthPrompt2(static_cast(mChannel), + NS_QueryAuthPrompt2(static_cast(mChannel), getter_AddRefs(prompter)); if (!prompter) return NS_ERROR_NOT_INITIALIZED; @@ -743,7 +743,7 @@ nsresult nsFtpState::S_pass() { return NS_ERROR_FAILURE; nsCOMPtr prompter; - NS_QueryAuthPrompt2(static_cast(mChannel), + NS_QueryAuthPrompt2(static_cast(mChannel), getter_AddRefs(prompter)); if (!prompter) return NS_ERROR_NOT_INITIALIZED; @@ -1047,7 +1047,7 @@ nsresult nsFtpState::S_list() { mChannel->SetEntityID(EmptyCString()); - const char *listString; + const char* listString; if (mServerType == FTP_VMS_TYPE) { listString = "LIST *.*;0" CRLF; } else { @@ -1189,7 +1189,7 @@ nsresult nsFtpState::S_pasv() { mServerAddress.inet.ip = htonl(INADDR_ANY); mServerAddress.inet.port = htons(0); - nsITransport *controlSocket = mControlConnection->Transport(); + nsITransport* controlSocket = mControlConnection->Transport(); if (!controlSocket) // XXX Invalid cast of FTP_STATE to nsresult -- FTP_ERROR has // value < 0x80000000 and will pass NS_SUCCEEDED() (bug 778109) @@ -1220,7 +1220,7 @@ nsresult nsFtpState::S_pasv() { } } - const char *string; + const char* string; if (mServerIsIPv6) { string = "EPSV" CRLF; } else { @@ -1238,9 +1238,9 @@ nsFtpState::R_pasv() { int32_t port; nsAutoCString responseCopy(mResponseMsg); - char *response = responseCopy.BeginWriting(); + char* response = responseCopy.BeginWriting(); - char *ptr = response; + char* ptr = response; // Make sure to ignore the address in the PASV response (bug 370559) @@ -1447,7 +1447,7 @@ nsFtpState::R_opts() { //////////////////////////////////////////////////////////////////////////////// // nsIRequest methods: -nsresult nsFtpState::Init(nsFtpChannel *channel) { +nsresult nsFtpState::Init(nsFtpChannel* channel) { // parameter validation NS_ASSERTION(channel, "FTP: needs a channel"); @@ -1493,7 +1493,7 @@ nsresult nsFtpState::Init(nsFtpChannel *channel) { } // Skip leading slash - char *fwdPtr = path.BeginWriting(); + char* fwdPtr = path.BeginWriting(); if (!fwdPtr) return NS_ERROR_OUT_OF_MEMORY; if (*fwdPtr == '/') fwdPtr++; if (*fwdPtr != '\0') { @@ -1541,7 +1541,7 @@ nsresult nsFtpState::Init(nsFtpChannel *channel) { do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID); if (pps && !mChannel->ProxyInfo()) { - pps->AsyncResolve(static_cast(mChannel), 0, this, nullptr, + pps->AsyncResolve(static_cast(mChannel), 0, this, nullptr, getter_AddRefs(mProxyRequest)); } @@ -1633,7 +1633,7 @@ nsresult nsFtpState::StopProcessing() { return NS_OK; } -nsresult nsFtpState::SendFTPCommand(const nsACString &command) { +nsresult nsFtpState::SendFTPCommand(const nsACString& command) { NS_ASSERTION(mControlConnection, "null control connection"); // we don't want to log the password: @@ -1655,7 +1655,7 @@ nsresult nsFtpState::SendFTPCommand(const nsACString &command) { // Convert a unix-style filespec to VMS format // /foo/fred/barney/file.txt -> foo:[fred.barney]file.txt // /foo/file.txt -> foo:[000000]file.txt -void nsFtpState::ConvertFilespecToVMS(nsCString &fileString) { +void nsFtpState::ConvertFilespecToVMS(nsCString& fileString) { int ntok = 1; char *t, *nextToken; nsAutoCString fileStringCopy; @@ -1736,7 +1736,7 @@ void nsFtpState::ConvertFilespecToVMS(nsCString &fileString) { // /foo/fred -> foo:[fred] // /foo -> foo:[000000] // (null) -> (null) -void nsFtpState::ConvertDirspecToVMS(nsCString &dirSpec) { +void nsFtpState::ConvertDirspecToVMS(nsCString& dirSpec) { LOG(("FTP:(%p) ConvertDirspecToVMS from: \"%s\"\n", this, dirSpec.get())); if (!dirSpec.IsEmpty()) { if (dirSpec.Last() != '/') dirSpec.Append('/'); @@ -1749,7 +1749,7 @@ void nsFtpState::ConvertDirspecToVMS(nsCString &dirSpec) { } // Convert an absolute VMS style dirspec to UNIX format -void nsFtpState::ConvertDirspecFromVMS(nsCString &dirSpec) { +void nsFtpState::ConvertDirspecFromVMS(nsCString& dirSpec) { LOG(("FTP:(%p) ConvertDirspecFromVMS from: \"%s\"\n", this, dirSpec.get())); if (dirSpec.IsEmpty()) { dirSpec.Insert('.', 0); @@ -1765,7 +1765,7 @@ void nsFtpState::ConvertDirspecFromVMS(nsCString &dirSpec) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsFtpState::OnTransportStatus(nsITransport *transport, nsresult status, +nsFtpState::OnTransportStatus(nsITransport* transport, nsresult status, int64_t progress, int64_t progressMax) { // Mix signals from both the control and data connections. @@ -1795,13 +1795,13 @@ nsFtpState::OnTransportStatus(nsITransport *transport, nsresult status, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsFtpState::OnStartRequest(nsIRequest *request) { +nsFtpState::OnStartRequest(nsIRequest* request) { mStorReplyReceived = false; return NS_OK; } NS_IMETHODIMP -nsFtpState::OnStopRequest(nsIRequest *request, nsresult status) { +nsFtpState::OnStopRequest(nsIRequest* request, nsresult status) { mUploadRequest = nullptr; // Close() will be called when reply to STOR command is received @@ -1816,15 +1816,15 @@ nsFtpState::OnStopRequest(nsIRequest *request, nsresult status) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsFtpState::Available(uint64_t *result) { +nsFtpState::Available(uint64_t* result) { if (mDataStream) return mDataStream->Available(result); return nsBaseContentStream::Available(result); } NS_IMETHODIMP -nsFtpState::ReadSegments(nsWriteSegmentFun writer, void *closure, - uint32_t count, uint32_t *result) { +nsFtpState::ReadSegments(nsWriteSegmentFun writer, void* closure, + uint32_t count, uint32_t* result) { // Insert a thunk here so that the input stream passed to the writer is this // input stream instead of mDataStream. @@ -1868,8 +1868,8 @@ nsFtpState::CloseWithStatus(nsresult status) { return nsBaseContentStream::CloseWithStatus(status); } -static nsresult CreateHTTPProxiedChannel(nsIChannel *channel, nsIProxyInfo *pi, - nsIChannel **newChannel) { +static nsresult CreateHTTPProxiedChannel(nsIChannel* channel, nsIProxyInfo* pi, + nsIChannel** newChannel) { nsresult rv; nsCOMPtr ioService = do_GetIOService(&rv); if (NS_FAILED(rv)) return rv; @@ -1890,8 +1890,8 @@ static nsresult CreateHTTPProxiedChannel(nsIChannel *channel, nsIProxyInfo *pi, } NS_IMETHODIMP -nsFtpState::OnProxyAvailable(nsICancelable *request, nsIChannel *channel, - nsIProxyInfo *pi, nsresult status) { +nsFtpState::OnProxyAvailable(nsICancelable* request, nsIChannel* channel, + nsIProxyInfo* pi, nsresult status) { mProxyRequest = nullptr; // failed status code just implies DIRECT processing diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp index 28264fcd9a64e..864b7c1921d08 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp @@ -44,7 +44,7 @@ LazyLogModule gFTPLog("nsFtp"); #define QOS_DATA_PREF "network.ftp.data.qos" #define QOS_CONTROL_PREF "network.ftp.control.qos" -nsFtpProtocolHandler *gFtpHandler = nullptr; +nsFtpProtocolHandler* gFtpHandler = nullptr; //----------------------------------------------------------------------------- @@ -122,33 +122,33 @@ nsresult nsFtpProtocolHandler::Init() { // nsIProtocolHandler methods: NS_IMETHODIMP -nsFtpProtocolHandler::GetScheme(nsACString &result) { +nsFtpProtocolHandler::GetScheme(nsACString& result) { result.AssignLiteral("ftp"); return NS_OK; } NS_IMETHODIMP -nsFtpProtocolHandler::GetDefaultPort(int32_t *result) { +nsFtpProtocolHandler::GetDefaultPort(int32_t* result) { *result = 21; return NS_OK; } NS_IMETHODIMP -nsFtpProtocolHandler::GetProtocolFlags(uint32_t *result) { +nsFtpProtocolHandler::GetProtocolFlags(uint32_t* result) { *result = URI_STD | ALLOWS_PROXY | ALLOWS_PROXY_HTTP | URI_LOADABLE_BY_ANYONE; return NS_OK; } NS_IMETHODIMP -nsFtpProtocolHandler::NewURI(const nsACString &aSpec, const char *aCharset, - nsIURI *aBaseURI, nsIURI **result) { +nsFtpProtocolHandler::NewURI(const nsACString& aSpec, const char* aCharset, + nsIURI* aBaseURI, nsIURI** result) { if (!mEnabled) { return NS_ERROR_UNKNOWN_PROTOCOL; } nsAutoCString spec(aSpec); spec.Trim(" \t\n\r"); // Match NS_IsAsciiWhitespace instead of HTML5 - char *fwdPtr = spec.BeginWriting(); + char* fwdPtr = spec.BeginWriting(); // now unescape it... %xx reduced inline to resulting character @@ -171,17 +171,17 @@ nsFtpProtocolHandler::NewURI(const nsACString &aSpec, const char *aCharset, } NS_IMETHODIMP -nsFtpProtocolHandler::NewChannel(nsIURI *url, nsILoadInfo *aLoadInfo, - nsIChannel **result) { +nsFtpProtocolHandler::NewChannel(nsIURI* url, nsILoadInfo* aLoadInfo, + nsIChannel** result) { return NewProxiedChannel(url, nullptr, 0, nullptr, aLoadInfo, result); } NS_IMETHODIMP -nsFtpProtocolHandler::NewProxiedChannel(nsIURI *uri, nsIProxyInfo *proxyInfo, +nsFtpProtocolHandler::NewProxiedChannel(nsIURI* uri, nsIProxyInfo* proxyInfo, uint32_t proxyResolveFlags, - nsIURI *proxyURI, - nsILoadInfo *aLoadInfo, - nsIChannel **result) { + nsIURI* proxyURI, + nsILoadInfo* aLoadInfo, + nsIChannel** result) { NS_ENSURE_ARG_POINTER(uri); RefPtr channel; if (IsNeckoChild()) @@ -205,15 +205,15 @@ nsFtpProtocolHandler::NewProxiedChannel(nsIURI *uri, nsIProxyInfo *proxyInfo, } NS_IMETHODIMP -nsFtpProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +nsFtpProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { *_retval = (port == 21 || port == 22); return NS_OK; } // connection cache methods -void nsFtpProtocolHandler::Timeout(nsITimer *aTimer, void *aClosure) { +void nsFtpProtocolHandler::Timeout(nsITimer* aTimer, void* aClosure) { LOG(("FTP:timeout reached for %p\n", aClosure)); bool found = gFtpHandler->mRootConnectionList.RemoveElement(aClosure); @@ -222,12 +222,12 @@ void nsFtpProtocolHandler::Timeout(nsITimer *aTimer, void *aClosure) { return; } - timerStruct *s = (timerStruct *)aClosure; + timerStruct* s = (timerStruct*)aClosure; delete s; } nsresult nsFtpProtocolHandler::RemoveConnection( - nsIURI *aKey, nsFtpControlConnection **_retval) { + nsIURI* aKey, nsFtpControlConnection** _retval) { NS_ASSERTION(_retval, "null pointer"); NS_ASSERTION(aKey, "null pointer"); @@ -238,7 +238,7 @@ nsresult nsFtpProtocolHandler::RemoveConnection( LOG(("FTP:removing connection for %s\n", spec.get())); - timerStruct *ts = nullptr; + timerStruct* ts = nullptr; uint32_t i; bool found = false; @@ -260,8 +260,8 @@ nsresult nsFtpProtocolHandler::RemoveConnection( return NS_OK; } -nsresult nsFtpProtocolHandler::InsertConnection(nsIURI *aKey, - nsFtpControlConnection *aConn) { +nsresult nsFtpProtocolHandler::InsertConnection(nsIURI* aKey, + nsFtpControlConnection* aConn) { NS_ASSERTION(aConn, "null pointer"); NS_ASSERTION(aKey, "null pointer"); @@ -272,7 +272,7 @@ nsresult nsFtpProtocolHandler::InsertConnection(nsIURI *aKey, LOG(("FTP:inserting connection for %s\n", spec.get())); - timerStruct *ts = new timerStruct(); + timerStruct* ts = new timerStruct(); if (!ts) return NS_ERROR_OUT_OF_MEMORY; nsCOMPtr timer; @@ -303,7 +303,7 @@ nsresult nsFtpProtocolHandler::InsertConnection(nsIURI *aKey, if (mRootConnectionList.Length() == IDLE_CONNECTION_LIMIT) { uint32_t i; for (i = 0; i < mRootConnectionList.Length(); ++i) { - timerStruct *candidate = mRootConnectionList[i]; + timerStruct* candidate = mRootConnectionList[i]; if (strcmp(candidate->key, ts->key) == 0) { mRootConnectionList.RemoveElementAt(i); delete candidate; @@ -311,7 +311,7 @@ nsresult nsFtpProtocolHandler::InsertConnection(nsIURI *aKey, } } if (mRootConnectionList.Length() == IDLE_CONNECTION_LIMIT) { - timerStruct *eldest = mRootConnectionList[0]; + timerStruct* eldest = mRootConnectionList[0]; mRootConnectionList.RemoveElementAt(0); delete eldest; } @@ -325,8 +325,8 @@ nsresult nsFtpProtocolHandler::InsertConnection(nsIURI *aKey, // nsIObserver NS_IMETHODIMP -nsFtpProtocolHandler::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsFtpProtocolHandler::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { LOG(("FTP:observing [%s]\n", aTopic)); if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) { diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.h b/netwerk/protocol/ftp/nsFtpProtocolHandler.h index 0bad9c5e57525..38ce33f8b7edb 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.h +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.h @@ -29,8 +29,8 @@ class nsFtpProtocolHandler final : public nsIProxiedProtocolHandler, nsresult Init(); // FTP Connection list access - nsresult InsertConnection(nsIURI *aKey, nsFtpControlConnection *aConn); - nsresult RemoveConnection(nsIURI *aKey, nsFtpControlConnection **aConn); + nsresult InsertConnection(nsIURI* aKey, nsFtpControlConnection* aConn); + nsresult RemoveConnection(nsIURI* aKey, nsFtpControlConnection** aConn); uint32_t GetSessionId() { return mSessionId; } uint8_t GetDataQoSBits() { return mDataQoSBits; } @@ -43,7 +43,7 @@ class nsFtpProtocolHandler final : public nsIProxiedProtocolHandler, struct timerStruct { nsCOMPtr timer; RefPtr conn; - char *key; + char* key; timerStruct() : key(nullptr) {} @@ -56,10 +56,10 @@ class nsFtpProtocolHandler final : public nsIProxiedProtocolHandler, } }; - static void Timeout(nsITimer *aTimer, void *aClosure); + static void Timeout(nsITimer* aTimer, void* aClosure); void ClearAllConnections(); - nsTArray mRootConnectionList; + nsTArray mRootConnectionList; int32_t mIdleTimeout; bool mEnabled; @@ -77,7 +77,7 @@ class nsFtpProtocolHandler final : public nsIProxiedProtocolHandler, //----------------------------------------------------------------------------- -extern nsFtpProtocolHandler *gFtpHandler; +extern nsFtpProtocolHandler* gFtpHandler; #include "mozilla/Logging.h" extern mozilla::LazyLogModule gFTPLog; diff --git a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp index a04387e64b95b..753a0926317ce 100644 --- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp +++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp @@ -106,7 +106,7 @@ static nsresult MapGIOResult(gint code) { } } -static nsresult MapGIOResult(GError *result) { +static nsresult MapGIOResult(GError* result) { if (!result) return NS_OK; return MapGIOResult(result->code); } @@ -128,8 +128,8 @@ typedef enum { * +1 when second object should be before the first */ static gint FileInfoComparator(gconstpointer a, gconstpointer b) { - GFileInfo *ia = (GFileInfo *)a; - GFileInfo *ib = (GFileInfo *)b; + GFileInfo* ia = (GFileInfo*)a; + GFileInfo* ib = (GFileInfo*)b; if (g_file_info_get_file_type(ia) == G_FILE_TYPE_DIRECTORY && g_file_info_get_file_type(ib) != G_FILE_TYPE_DIRECTORY) return -1; @@ -141,12 +141,12 @@ static gint FileInfoComparator(gconstpointer a, gconstpointer b) { } /* Declaration of mount callback functions */ -static void mount_enclosing_volume_finished(GObject *source_object, - GAsyncResult *res, +static void mount_enclosing_volume_finished(GObject* source_object, + GAsyncResult* res, gpointer user_data); static void mount_operation_ask_password( - GMountOperation *mount_op, const char *message, const char *default_user, - const char *default_domain, GAskPasswordFlags flags, gpointer user_data); + GMountOperation* mount_op, const char* message, const char* default_user, + const char* default_domain, GAskPasswordFlags flags, gpointer user_data); //----------------------------------------------------------------------------- class nsGIOInputStream final : public nsIInputStream { @@ -156,7 +156,7 @@ class nsGIOInputStream final : public nsIInputStream { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM - explicit nsGIOInputStream(const nsCString &uriSpec) + explicit nsGIOInputStream(const nsCString& uriSpec) : mSpec(uriSpec), mChannel(nullptr), mHandle(nullptr), @@ -169,7 +169,7 @@ class nsGIOInputStream final : public nsIInputStream { mDirOpen(false), mMonitorMountInProgress("GIOInputStream::MountFinished") {} - void SetChannel(nsIChannel *channel) { + void SetChannel(nsIChannel* channel) { // We need to hold an owning reference to our channel. This is done // so we can access the channel's notification callbacks to acquire // a reference to a nsIAuthPrompt if we need to handle an interactive @@ -189,19 +189,19 @@ class nsGIOInputStream final : public nsIInputStream { private: nsresult DoOpen(); - nsresult DoRead(char *aBuf, uint32_t aCount, uint32_t *aCountRead); - nsresult SetContentTypeOfChannel(const char *contentType); + nsresult DoRead(char* aBuf, uint32_t aCount, uint32_t* aCountRead); + nsresult SetContentTypeOfChannel(const char* contentType); nsresult MountVolume(); nsresult DoOpenDirectory(); - nsresult DoOpenFile(GFileInfo *info); + nsresult DoOpenFile(GFileInfo* info); nsCString mSpec; - nsIChannel *mChannel; // manually refcounted - GFile *mHandle; - GFileInputStream *mStream; + nsIChannel* mChannel; // manually refcounted + GFile* mHandle; + GFileInputStream* mStream; uint64_t mBytesRemaining; nsresult mStatus; - GList *mDirList; - GList *mDirListPtr; + GList* mDirList; + GList* mDirListPtr; nsCString mDirBuf; uint32_t mDirBufCursor; bool mDirOpen; @@ -228,7 +228,7 @@ void nsGIOInputStream::SetMountResult(MountOperationResult result, * called from thread which is trying to read from location. */ nsresult nsGIOInputStream::MountVolume() { - GMountOperation *mount_op = g_mount_operation_new(); + GMountOperation* mount_op = g_mount_operation_new(); g_signal_connect(mount_op, "ask-password", G_CALLBACK(mount_operation_ask_password), mChannel); mMountRes = MOUNT_OPERATION_IN_PROGRESS; @@ -255,9 +255,9 @@ nsresult nsGIOInputStream::MountVolume() { * to failed operation. */ nsresult nsGIOInputStream::DoOpenDirectory() { - GError *error = nullptr; + GError* error = nullptr; - GFileEnumerator *f_enum = g_file_enumerate_children( + GFileEnumerator* f_enum = g_file_enumerate_children( mHandle, "standard::*,time::*", G_FILE_QUERY_INFO_NONE, nullptr, &error); if (!f_enum) { nsresult rv = MapGIOResult(error); @@ -266,7 +266,7 @@ nsresult nsGIOInputStream::DoOpenDirectory() { return rv; } // fill list of file infos - GFileInfo *info = g_file_enumerator_next_file(f_enum, nullptr, &error); + GFileInfo* info = g_file_enumerator_next_file(f_enum, nullptr, &error); while (info) { mDirList = g_list_append(mDirList, info); info = g_file_enumerator_next_file(f_enum, nullptr, &error); @@ -306,8 +306,8 @@ nsresult nsGIOInputStream::DoOpenDirectory() { * @param info file info used to determine mime type * @return NS_OK when file stream created successfuly, error code otherwise */ -nsresult nsGIOInputStream::DoOpenFile(GFileInfo *info) { - GError *error = nullptr; +nsresult nsGIOInputStream::DoOpenFile(GFileInfo* info) { + GError* error = nullptr; mStream = g_file_read(mHandle, nullptr, &error); if (!mStream) { @@ -317,9 +317,9 @@ nsresult nsGIOInputStream::DoOpenFile(GFileInfo *info) { return rv; } - const char *content_type = g_file_info_get_content_type(info); + const char* content_type = g_file_info_get_content_type(info); if (content_type) { - char *mime_type = g_content_type_get_mime_type(content_type); + char* mime_type = g_content_type_get_mime_type(content_type); if (mime_type) { if (strcmp(mime_type, APPLICATION_OCTET_STREAM) != 0) { SetContentTypeOfChannel(mime_type); @@ -346,13 +346,13 @@ nsresult nsGIOInputStream::DoOpenFile(GFileInfo *info) { */ nsresult nsGIOInputStream::DoOpen() { nsresult rv; - GError *error = nullptr; + GError* error = nullptr; NS_ASSERTION(mHandle == nullptr, "already open"); mHandle = g_file_new_for_uri(mSpec.get()); - GFileInfo *info = g_file_query_info(mHandle, "standard::*", + GFileInfo* info = g_file_query_info(mHandle, "standard::*", G_FILE_QUERY_INFO_NONE, nullptr, &error); if (error) { @@ -406,12 +406,12 @@ nsresult nsGIOInputStream::DoOpen() { * @return NS_OK when read successfully, NS_BASE_STREAM_CLOSED when end of file, * error code otherwise */ -nsresult nsGIOInputStream::DoRead(char *aBuf, uint32_t aCount, - uint32_t *aCountRead) { +nsresult nsGIOInputStream::DoRead(char* aBuf, uint32_t aCount, + uint32_t* aCountRead) { nsresult rv = NS_ERROR_NOT_AVAILABLE; if (mStream) { // file read - GError *error = nullptr; + GError* error = nullptr; uint32_t bytes_read = g_input_stream_read(G_INPUT_STREAM(mStream), aBuf, aCount, nullptr, &error); if (error) { @@ -444,10 +444,10 @@ nsresult nsGIOInputStream::DoRead(char *aBuf, uint32_t aCount, rv = NS_BASE_STREAM_CLOSED; } else if (aCount) // Do we need more data? { - GFileInfo *info = (GFileInfo *)mDirListPtr->data; + GFileInfo* info = (GFileInfo*)mDirListPtr->data; // Prune '.' and '..' from directory listing. - const char *fname = g_file_info_get_name(info); + const char* fname = g_file_info_get_name(info); if (fname && fname[0] == '.' && (fname[1] == '\0' || (fname[1] == '.' && fname[2] == '\0'))) { mDirListPtr = mDirListPtr->next; @@ -519,7 +519,7 @@ nsresult nsGIOInputStream::DoRead(char *aBuf, uint32_t aCount, */ class nsGIOSetContentTypeEvent : public mozilla::Runnable { public: - nsGIOSetContentTypeEvent(nsIChannel *channel, const char *contentType) + nsGIOSetContentTypeEvent(nsIChannel* channel, const char* contentType) : mozilla::Runnable("nsGIOSetContentTypeEvent"), mChannel(channel), mContentType(contentType) { @@ -533,11 +533,11 @@ class nsGIOSetContentTypeEvent : public mozilla::Runnable { } private: - nsIChannel *mChannel; + nsIChannel* mChannel; nsCString mContentType; }; -nsresult nsGIOInputStream::SetContentTypeOfChannel(const char *contentType) { +nsresult nsGIOInputStream::SetContentTypeOfChannel(const char* contentType) { // We need to proxy this call over to the main thread. We post an // asynchronous event in this case so that we don't delay reading data, and // we know that this is safe to do since the channel's reference will be @@ -600,7 +600,7 @@ nsGIOInputStream::Close() { * @param aResult remaining bytes */ NS_IMETHODIMP -nsGIOInputStream::Available(uint64_t *aResult) { +nsGIOInputStream::Available(uint64_t* aResult) { if (NS_FAILED(mStatus)) return mStatus; *aResult = mBytesRemaining; @@ -616,7 +616,7 @@ nsGIOInputStream::Available(uint64_t *aResult) { * @param aCountRead number of bytes actually read */ NS_IMETHODIMP -nsGIOInputStream::Read(char *aBuf, uint32_t aCount, uint32_t *aCountRead) { +nsGIOInputStream::Read(char* aBuf, uint32_t aCount, uint32_t* aCountRead) { *aCountRead = 0; // Check if file is already opened, otherwise open it if (!mStream && !mDirOpen && mStatus == NS_OK) { @@ -635,8 +635,8 @@ nsGIOInputStream::Read(char *aBuf, uint32_t aCount, uint32_t *aCountRead) { } NS_IMETHODIMP -nsGIOInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, - uint32_t aCount, uint32_t *aResult) { +nsGIOInputStream::ReadSegments(nsWriteSegmentFun aWriter, void* aClosure, + uint32_t aCount, uint32_t* aResult) { // There is no way to implement this using GnomeVFS, but fortunately // that doesn't matter. Because we are a blocking input stream, Necko // isn't going to call our ReadSegments method. @@ -645,7 +645,7 @@ nsGIOInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, } NS_IMETHODIMP -nsGIOInputStream::IsNonBlocking(bool *aResult) { +nsGIOInputStream::IsNonBlocking(bool* aResult) { *aResult = false; return NS_OK; } @@ -660,12 +660,12 @@ nsGIOInputStream::IsNonBlocking(bool *aResult) { * @param res result object * @param user_data pointer to nsGIOInputStream */ -static void mount_enclosing_volume_finished(GObject *source_object, - GAsyncResult *res, +static void mount_enclosing_volume_finished(GObject* source_object, + GAsyncResult* res, gpointer user_data) { - GError *error = nullptr; + GError* error = nullptr; - nsGIOInputStream *istream = static_cast(user_data); + nsGIOInputStream* istream = static_cast(user_data); g_file_mount_enclosing_volume_finish(G_FILE(source_object), res, &error); @@ -689,9 +689,9 @@ static void mount_enclosing_volume_finished(GObject *source_object, * @param user_data nsIChannel */ static void mount_operation_ask_password( - GMountOperation *mount_op, const char *message, const char *default_user, - const char *default_domain, GAskPasswordFlags flags, gpointer user_data) { - nsIChannel *channel = (nsIChannel *)user_data; + GMountOperation* mount_op, const char* message, const char* default_user, + const char* default_domain, GAskPasswordFlags flags, gpointer user_data) { + nsIChannel* channel = (nsIChannel*)user_data; if (!channel) { g_mount_operation_reply(mount_op, G_MOUNT_OPERATION_ABORTED); return; @@ -773,17 +773,17 @@ static void mount_operation_ask_password( if (flags & G_ASK_PASSWORD_NEED_PASSWORD) { if (flags & G_ASK_PASSWORD_NEED_USERNAME) { if (!realm.IsEmpty()) { - const char16_t *strings[] = {realm.get(), dispHost.get()}; + const char16_t* strings[] = {realm.get(), dispHost.get()}; bundle->FormatStringFromName("EnterLoginForRealm3", strings, 2, nsmessage); } else { - const char16_t *strings[] = {dispHost.get()}; + const char16_t* strings[] = {dispHost.get()}; bundle->FormatStringFromName("EnterUserPasswordFor2", strings, 1, nsmessage); } } else { NS_ConvertUTF8toUTF16 userName(default_user); - const char16_t *strings[] = {userName.get(), dispHost.get()}; + const char16_t* strings[] = {userName.get(), dispHost.get()}; bundle->FormatStringFromName("EnterPasswordFor", strings, 2, nsmessage); } } else { @@ -839,8 +839,8 @@ class nsGIOProtocolHandler final : public nsIProtocolHandler, private: ~nsGIOProtocolHandler() {} - void InitSupportedProtocolsPref(nsIPrefBranch *prefs); - bool IsSupportedProtocol(const nsCString &spec); + void InitSupportedProtocolsPref(nsIPrefBranch* prefs); + bool IsSupportedProtocol(const nsCString& spec); nsCString mSupportedProtocols; }; @@ -865,7 +865,7 @@ nsresult nsGIOProtocolHandler::Init() { return NS_OK; } -void nsGIOProtocolHandler::InitSupportedProtocolsPref(nsIPrefBranch *prefs) { +void nsGIOProtocolHandler::InitSupportedProtocolsPref(nsIPrefBranch* prefs) { // Get user preferences to determine which protocol is supported. // Gvfs/GIO has a set of supported protocols like obex, network, archive, // computer, dav, cdda, gphoto2, trash, etc. Some of these seems to be @@ -888,9 +888,9 @@ void nsGIOProtocolHandler::InitSupportedProtocolsPref(nsIPrefBranch *prefs) { LOG(("gio: supported protocols \"%s\"\n", mSupportedProtocols.get())); } -bool nsGIOProtocolHandler::IsSupportedProtocol(const nsCString &aSpec) { - const char *specString = aSpec.get(); - const char *colon = strchr(specString, ':'); +bool nsGIOProtocolHandler::IsSupportedProtocol(const nsCString& aSpec) { + const char* specString = aSpec.get(); + const char* colon = strchr(specString, ':'); if (!colon) return false; uint32_t length = colon - specString + 1; @@ -898,7 +898,7 @@ bool nsGIOProtocolHandler::IsSupportedProtocol(const nsCString &aSpec) { // + ':' nsCString scheme(specString, length); - char *found = PL_strcasestr(mSupportedProtocols.get(), scheme.get()); + char* found = PL_strcasestr(mSupportedProtocols.get(), scheme.get()); if (!found) return false; if (found[length] != ',' && found[length] != '\0') return false; @@ -907,28 +907,28 @@ bool nsGIOProtocolHandler::IsSupportedProtocol(const nsCString &aSpec) { } NS_IMETHODIMP -nsGIOProtocolHandler::GetScheme(nsACString &aScheme) { +nsGIOProtocolHandler::GetScheme(nsACString& aScheme) { aScheme.AssignLiteral(MOZ_GIO_SCHEME); return NS_OK; } NS_IMETHODIMP -nsGIOProtocolHandler::GetDefaultPort(int32_t *aDefaultPort) { +nsGIOProtocolHandler::GetDefaultPort(int32_t* aDefaultPort) { *aDefaultPort = -1; return NS_OK; } NS_IMETHODIMP -nsGIOProtocolHandler::GetProtocolFlags(uint32_t *aProtocolFlags) { +nsGIOProtocolHandler::GetProtocolFlags(uint32_t* aProtocolFlags) { // Is URI_STD true of all GnomeVFS URI types? *aProtocolFlags = URI_STD | URI_DANGEROUS_TO_LOAD; return NS_OK; } NS_IMETHODIMP -nsGIOProtocolHandler::NewURI(const nsACString &aSpec, - const char *aOriginCharset, nsIURI *aBaseURI, - nsIURI **aResult) { +nsGIOProtocolHandler::NewURI(const nsACString& aSpec, + const char* aOriginCharset, nsIURI* aBaseURI, + nsIURI** aResult) { const nsCString flatSpec(aSpec); LOG(("gio: NewURI [spec=%s]\n", flatSpec.get())); @@ -942,14 +942,14 @@ nsGIOProtocolHandler::NewURI(const nsACString &aSpec, // Verify that GIO supports this URI scheme. bool uri_scheme_supported = false; - GVfs *gvfs = g_vfs_get_default(); + GVfs* gvfs = g_vfs_get_default(); if (!gvfs) { g_warning("Cannot get GVfs object."); return NS_ERROR_UNKNOWN_PROTOCOL; } - const gchar *const *uri_schemes = g_vfs_get_supported_uri_schemes(gvfs); + const gchar* const* uri_schemes = g_vfs_get_supported_uri_schemes(gvfs); while (*uri_schemes != nullptr) { // While flatSpec ends with ':' the uri_scheme does not. Therefore do not @@ -975,8 +975,8 @@ nsGIOProtocolHandler::NewURI(const nsACString &aSpec, } NS_IMETHODIMP -nsGIOProtocolHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, - nsIChannel **aResult) { +nsGIOProtocolHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, + nsIChannel** aResult) { NS_ENSURE_ARG_POINTER(aURI); nsresult rv; @@ -1002,16 +1002,16 @@ nsGIOProtocolHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, } NS_IMETHODIMP -nsGIOProtocolHandler::AllowPort(int32_t aPort, const char *aScheme, - bool *aResult) { +nsGIOProtocolHandler::AllowPort(int32_t aPort, const char* aScheme, + bool* aResult) { // Don't override anything. *aResult = false; return NS_OK; } NS_IMETHODIMP -nsGIOProtocolHandler::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsGIOProtocolHandler::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { if (strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) == 0) { nsCOMPtr prefs = do_QueryInterface(aSubject); InitSupportedProtocolsPref(prefs); diff --git a/netwerk/protocol/http/ASpdySession.cpp b/netwerk/protocol/http/ASpdySession.cpp index 962481a555dde..a37f366d4f31a 100644 --- a/netwerk/protocol/http/ASpdySession.cpp +++ b/netwerk/protocol/http/ASpdySession.cpp @@ -24,8 +24,8 @@ namespace mozilla { namespace net { -ASpdySession *ASpdySession::NewSpdySession(net::SpdyVersion version, - nsISocketTransport *aTransport, +ASpdySession* ASpdySession::NewSpdySession(net::SpdyVersion version, + nsISocketTransport* aTransport, bool attemptingEarlyData) { // This is a necko only interface, so we can enforce version // requests as a precondition @@ -53,8 +53,8 @@ bool SpdyInformation::ProtocolEnabled(uint32_t index) const { return gHttpHandler->IsHttp2Enabled(); } -nsresult SpdyInformation::GetNPNIndex(const nsACString &npnString, - uint32_t *result) const { +nsresult SpdyInformation::GetNPNIndex(const nsACString& npnString, + uint32_t* result) const { if (npnString.IsEmpty()) return NS_ERROR_FAILURE; for (uint32_t index = 0; index < kCount; ++index) { @@ -73,8 +73,8 @@ nsresult SpdyInformation::GetNPNIndex(const nsACString &npnString, SpdyPushCache::~SpdyPushCache() { mHashHttp2.Clear(); } -bool SpdyPushCache::RegisterPushedStreamHttp2(const nsCString &key, - Http2PushedStream *stream) { +bool SpdyPushCache::RegisterPushedStreamHttp2(const nsCString& key, + Http2PushedStream* stream) { LOG3(("SpdyPushCache::RegisterPushedStreamHttp2 %s 0x%X\n", key.get(), stream->StreamID())); if (mHashHttp2.Get(key)) { @@ -86,18 +86,18 @@ bool SpdyPushCache::RegisterPushedStreamHttp2(const nsCString &key, return true; } -Http2PushedStream *SpdyPushCache::RemovePushedStreamHttp2( - const nsCString &key) { - Http2PushedStream *rv = mHashHttp2.Get(key); +Http2PushedStream* SpdyPushCache::RemovePushedStreamHttp2( + const nsCString& key) { + Http2PushedStream* rv = mHashHttp2.Get(key); LOG3(("SpdyPushCache::RemovePushedStreamHttp2 %s 0x%X\n", key.get(), rv ? rv->StreamID() : 0)); if (rv) mHashHttp2.Remove(key); return rv; } -Http2PushedStream *SpdyPushCache::RemovePushedStreamHttp2ByID( - const nsCString &key, const uint32_t &streamID) { - Http2PushedStream *rv = mHashHttp2.Get(key); +Http2PushedStream* SpdyPushCache::RemovePushedStreamHttp2ByID( + const nsCString& key, const uint32_t& streamID) { + Http2PushedStream* rv = mHashHttp2.Get(key); LOG3(("SpdyPushCache::RemovePushedStreamHttp2ByID %s 0x%X 0x%X", key.get(), rv ? rv->StreamID() : 0, streamID)); if (rv && streamID == rv->StreamID()) { diff --git a/netwerk/protocol/http/ASpdySession.h b/netwerk/protocol/http/ASpdySession.h index d06c7f7dd7e57..060b58613b34e 100644 --- a/netwerk/protocol/http/ASpdySession.h +++ b/netwerk/protocol/http/ASpdySession.h @@ -21,8 +21,8 @@ class ASpdySession : public nsAHttpTransaction { ASpdySession() = default; virtual ~ASpdySession() = default; - virtual MOZ_MUST_USE bool AddStream(nsAHttpTransaction *, int32_t, bool, bool, - nsIInterfaceRequestor *) = 0; + virtual MOZ_MUST_USE bool AddStream(nsAHttpTransaction*, int32_t, bool, bool, + nsIInterfaceRequestor*) = 0; virtual bool CanReuse() = 0; virtual bool RoomForMoreStreams() = 0; virtual PRIntervalTime IdleTime() = 0; @@ -30,11 +30,11 @@ class ASpdySession : public nsAHttpTransaction { virtual void DontReuse() = 0; virtual enum SpdyVersion SpdyVersion() = 0; - static ASpdySession *NewSpdySession(net::SpdyVersion version, - nsISocketTransport *, bool); + static ASpdySession* NewSpdySession(net::SpdyVersion version, + nsISocketTransport*, bool); - virtual bool TestJoinConnection(const nsACString &hostname, int32_t port) = 0; - virtual bool JoinConnection(const nsACString &hostname, int32_t port) = 0; + virtual bool TestJoinConnection(const nsACString& hostname, int32_t port) = 0; + virtual bool JoinConnection(const nsACString& hostname, int32_t port) = 0; // MaybeReTunnel() is called by the connection manager when it cannot // dispatch a tunneled transaction. That might be because the tunnels it @@ -43,9 +43,9 @@ class ASpdySession : public nsAHttpTransaction { // // return true if the session takes back ownership of the transaction from // the connection manager. - virtual bool MaybeReTunnel(nsAHttpTransaction *) = 0; + virtual bool MaybeReTunnel(nsAHttpTransaction*) = 0; - virtual void PrintDiagnostics(nsCString &log) = 0; + virtual void PrintDiagnostics(nsCString& log) = 0; bool ResponseTimeoutEnabled() const final { return true; } @@ -90,7 +90,7 @@ class ASpdySession : public nsAHttpTransaction { virtual bool CanAcceptWebsocket() = 0; }; -typedef bool (*ALPNCallback)(nsISupports *); // nsISSLSocketControl is typical +typedef bool (*ALPNCallback)(nsISupports*); // nsISSLSocketControl is typical // this is essentially a single instantiation as a member of nsHttpHandler. // It could be all static except using static ctors of XPCOM objects is a @@ -104,8 +104,8 @@ class SpdyInformation { // determine the index (0..kCount-1) of the spdy information that // correlates to the npn string. NS_FAILED() if no match is found. - MOZ_MUST_USE nsresult GetNPNIndex(const nsACString &npnString, - uint32_t *result) const; + MOZ_MUST_USE nsresult GetNPNIndex(const nsACString& npnString, + uint32_t* result) const; // determine if a version of the protocol is enabled for index < kCount bool ProtocolEnabled(uint32_t index) const; diff --git a/netwerk/protocol/http/AltDataOutputStreamChild.cpp b/netwerk/protocol/http/AltDataOutputStreamChild.cpp index 355d5303eccb3..502b48d05e338 100644 --- a/netwerk/protocol/http/AltDataOutputStreamChild.cpp +++ b/netwerk/protocol/http/AltDataOutputStreamChild.cpp @@ -59,7 +59,7 @@ void AltDataOutputStreamChild::ReleaseIPDLReference() { } bool AltDataOutputStreamChild::WriteDataInChunks( - const nsDependentCSubstring &data) { + const nsDependentCSubstring& data) { const uint32_t kChunkSize = 128 * 1024; uint32_t next = std::min(data.Length(), kChunkSize); for (uint32_t i = 0; i < data.Length(); @@ -90,8 +90,8 @@ AltDataOutputStreamChild::Flush() { } NS_IMETHODIMP -AltDataOutputStreamChild::Write(const char *aBuf, uint32_t aCount, - uint32_t *_retval) { +AltDataOutputStreamChild::Write(const char* aBuf, uint32_t aCount, + uint32_t* _retval) { if (!mIPCOpen) { return NS_ERROR_NOT_AVAILABLE; } @@ -106,26 +106,26 @@ AltDataOutputStreamChild::Write(const char *aBuf, uint32_t aCount, } NS_IMETHODIMP -AltDataOutputStreamChild::WriteFrom(nsIInputStream *aFromStream, - uint32_t aCount, uint32_t *_retval) { +AltDataOutputStreamChild::WriteFrom(nsIInputStream* aFromStream, + uint32_t aCount, uint32_t* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP AltDataOutputStreamChild::WriteSegments(nsReadSegmentFun aReader, - void *aClosure, uint32_t aCount, - uint32_t *_retval) { + void* aClosure, uint32_t aCount, + uint32_t* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -AltDataOutputStreamChild::IsNonBlocking(bool *_retval) { +AltDataOutputStreamChild::IsNonBlocking(bool* _retval) { *_retval = false; return NS_OK; } mozilla::ipc::IPCResult AltDataOutputStreamChild::RecvError( - const nsresult &err) { + const nsresult& err) { mError = err; return IPC_OK(); } @@ -151,9 +151,9 @@ AltDataOutputStreamChild::CloseWithStatus(nsresult aStatus) { } NS_IMETHODIMP -AltDataOutputStreamChild::AsyncWait(nsIOutputStreamCallback *aCallback, +AltDataOutputStreamChild::AsyncWait(nsIOutputStreamCallback* aCallback, uint32_t aFlags, uint32_t aRequestedCount, - nsIEventTarget *aEventTarget) { + nsIEventTarget* aEventTarget) { mCallback = aCallback; mCallbackFlags = aFlags; mCallbackTarget = aEventTarget; diff --git a/netwerk/protocol/http/AlternateServices.cpp b/netwerk/protocol/http/AlternateServices.cpp index d69ec4e60955f..3dadedff3f183 100644 --- a/netwerk/protocol/http/AlternateServices.cpp +++ b/netwerk/protocol/http/AlternateServices.cpp @@ -33,8 +33,8 @@ namespace net { // alternate service should already be normalized to those lower case // strings by the URI parser (and so there is an assert)- this is an extra // check. -static nsresult SchemeIsHTTPS(const nsACString &originScheme, - bool &outIsHTTPS) { +static nsresult SchemeIsHTTPS(const nsACString& originScheme, + bool& outIsHTTPS) { outIsHTTPS = originScheme.EqualsLiteral("https"); if (!outIsHTTPS && !originScheme.EqualsLiteral("http")) { @@ -44,16 +44,16 @@ static nsresult SchemeIsHTTPS(const nsACString &originScheme, return NS_OK; } -bool AltSvcMapping::AcceptableProxy(nsProxyInfo *proxyInfo) { +bool AltSvcMapping::AcceptableProxy(nsProxyInfo* proxyInfo) { return !proxyInfo || proxyInfo->IsDirect() || proxyInfo->IsSOCKS(); } void AltSvcMapping::ProcessHeader( - const nsCString &buf, const nsCString &originScheme, - const nsCString &originHost, int32_t originPort, const nsACString &username, - const nsACString &topWindowOrigin, bool privateBrowsing, - nsIInterfaceRequestor *callbacks, nsProxyInfo *proxyInfo, uint32_t caps, - const OriginAttributes &originAttributes) { + const nsCString& buf, const nsCString& originScheme, + const nsCString& originHost, int32_t originPort, const nsACString& username, + const nsACString& topWindowOrigin, bool privateBrowsing, + nsIInterfaceRequestor* callbacks, nsProxyInfo* proxyInfo, uint32_t caps, + const OriginAttributes& originAttributes) { MOZ_ASSERT(NS_IsMainThread()); LOG(("AltSvcMapping::ProcessHeader: %s\n", buf.get())); if (!callbacks) { @@ -88,9 +88,9 @@ void AltSvcMapping::ProcessHeader( for (uint32_t pairIndex = 0; pairIndex < parsedAltSvc.mValues[index].mValues.Length(); ++pairIndex) { - nsDependentCSubstring ¤tName = + nsDependentCSubstring& currentName = parsedAltSvc.mValues[index].mValues[pairIndex].mName; - nsDependentCSubstring ¤tValue = + nsDependentCSubstring& currentValue = parsedAltSvc.mValues[index].mValues[pairIndex].mValue; if (!pairIndex) { @@ -135,7 +135,7 @@ void AltSvcMapping::ProcessHeader( npnToken.SetLength(strlen(npnToken.BeginReading())); uint32_t spdyIndex; - SpdyInformation *spdyInfo = gHttpHandler->SpdyInfo(); + SpdyInformation* spdyInfo = gHttpHandler->SpdyInfo(); if (!(NS_SUCCEEDED(spdyInfo->GetNPNIndex(npnToken, &spdyIndex)) && spdyInfo->ProtocolEnabled(spdyIndex))) { LOG(("Alt Svc unknown protocol %s, ignoring", npnToken.get())); @@ -166,15 +166,15 @@ void AltSvcMapping::ProcessHeader( } } -AltSvcMapping::AltSvcMapping(DataStorage *storage, int32_t epoch, - const nsACString &originScheme, - const nsACString &originHost, int32_t originPort, - const nsACString &username, - const nsACString &topWindowOrigin, +AltSvcMapping::AltSvcMapping(DataStorage* storage, int32_t epoch, + const nsACString& originScheme, + const nsACString& originHost, int32_t originPort, + const nsACString& username, + const nsACString& topWindowOrigin, bool privateBrowsing, uint32_t expiresAt, - const nsACString &alternateHost, - int32_t alternatePort, const nsACString &npnToken, - const OriginAttributes &originAttributes) + const nsACString& alternateHost, + int32_t alternatePort, const nsACString& npnToken, + const OriginAttributes& originAttributes) : mStorage(storage), mStorageEpoch(epoch), mAlternateHost(alternateHost), @@ -224,11 +224,11 @@ AltSvcMapping::AltSvcMapping(DataStorage *storage, int32_t epoch, } } -void AltSvcMapping::MakeHashKey(nsCString &outKey, - const nsACString &originScheme, - const nsACString &originHost, +void AltSvcMapping::MakeHashKey(nsCString& outKey, + const nsACString& originScheme, + const nsACString& originHost, int32_t originPort, bool privateBrowsing, - const OriginAttributes &originAttributes) { + const OriginAttributes& originAttributes) { outKey.Truncate(); if (originPort == -1) { @@ -251,7 +251,7 @@ void AltSvcMapping::MakeHashKey(nsCString &outKey, int32_t AltSvcMapping::TTL() { return mExpiresAt - NowInSeconds(); } -void AltSvcMapping::SyncString(const nsCString &str) { +void AltSvcMapping::SyncString(const nsCString& str) { MOZ_ASSERT(NS_IsMainThread()); mStorage->Put(HashKey(), str, mPrivate ? DataStorage_Private : DataStorage_Persistent); @@ -301,7 +301,7 @@ void AltSvcMapping::SetExpired() { Sync(); } -bool AltSvcMapping::RouteEquals(AltSvcMapping *map) { +bool AltSvcMapping::RouteEquals(AltSvcMapping* map) { MOZ_ASSERT(map->mHashKey.Equals(mHashKey)); return mAlternateHost.Equals(map->mAlternateHost) && (mAlternatePort == map->mAlternatePort) && @@ -309,8 +309,8 @@ bool AltSvcMapping::RouteEquals(AltSvcMapping *map) { } void AltSvcMapping::GetConnectionInfo( - nsHttpConnectionInfo **outCI, nsProxyInfo *pi, - const OriginAttributes &originAttributes) { + nsHttpConnectionInfo** outCI, nsProxyInfo* pi, + const OriginAttributes& originAttributes) { RefPtr ci = new nsHttpConnectionInfo( mOriginHost, mOriginPort, mNPNToken, mUsername, mTopWindowOrigin, pi, originAttributes, mAlternateHost, mAlternatePort); @@ -324,7 +324,7 @@ void AltSvcMapping::GetConnectionInfo( ci.forget(outCI); } -void AltSvcMapping::Serialize(nsCString &out) { +void AltSvcMapping::Serialize(nsCString& out) { // Be careful, when serializing new members, add them to the end of this list. out = mHttps ? NS_LITERAL_CSTRING("https:") : NS_LITERAL_CSTRING("http:"); out.Append(mOriginHost); @@ -358,8 +358,8 @@ void AltSvcMapping::Serialize(nsCString &out) { // Add code to serialize new members here! } -AltSvcMapping::AltSvcMapping(DataStorage *storage, int32_t epoch, - const nsCString &str) +AltSvcMapping::AltSvcMapping(DataStorage* storage, int32_t epoch, + const nsCString& str) : mStorage(storage), mStorageEpoch(epoch), mSyncOnlyOnSuccess(false) { mValidated = false; nsresult code; @@ -430,8 +430,8 @@ AltSvcMapping::AltSvcMapping(DataStorage *storage, int32_t epoch, // an alt-svc advertisement only for https:// class AltSvcTransaction final : public NullHttpTransaction { public: - AltSvcTransaction(AltSvcMapping *map, nsHttpConnectionInfo *ci, - nsIInterfaceRequestor *callbacks, uint32_t caps) + AltSvcTransaction(AltSvcMapping* map, nsHttpConnectionInfo* ci, + nsIInterfaceRequestor* callbacks, uint32_t caps) : NullHttpTransaction(ci, callbacks, caps & ~NS_HTTP_ALLOW_KEEPALIVE), mMapping(map), mRunning(true), @@ -531,8 +531,8 @@ class AltSvcTransaction final : public NullHttpTransaction { NullHttpTransaction::Close(reason); } - nsresult ReadSegments(nsAHttpSegmentReader *reader, uint32_t count, - uint32_t *countRead) override { + nsresult ReadSegments(nsAHttpSegmentReader* reader, uint32_t count, + uint32_t* countRead) override { LOG(("AltSvcTransaction::ReadSegements() %p\n", this)); mTriedToWrite = true; return NullHttpTransaction::ReadSegments(reader, count, countRead); @@ -547,8 +547,8 @@ class AltSvcTransaction final : public NullHttpTransaction { class WellKnownChecker { public: - WellKnownChecker(nsIURI *uri, const nsCString &origin, uint32_t caps, - nsHttpConnectionInfo *ci, AltSvcMapping *mapping) + WellKnownChecker(nsIURI* uri, const nsCString& origin, uint32_t caps, + nsHttpConnectionInfo* ci, AltSvcMapping* mapping) : mWaiting( 2) // waiting for 2 channels (default and alternate) to complete , @@ -585,7 +585,7 @@ class WellKnownChecker { return MakeChannel(chan, mTransactionOrigin, newCI, mURI, mCaps, loadInfo); } - void Done(TransactionObserver *finished) { + void Done(TransactionObserver* finished) { MOZ_ASSERT(NS_IsMainThread()); LOG(("WellKnownChecker::Done %p waiting for %d\n", this, mWaiting)); @@ -693,9 +693,9 @@ class WellKnownChecker { ~WellKnownChecker() { LOG(("WellKnownChecker dtor %p\n", this)); } private: - nsresult MakeChannel(nsHttpChannel *chan, TransactionObserver *obs, - nsHttpConnectionInfo *ci, nsIURI *uri, uint32_t caps, - nsILoadInfo *loadInfo) { + nsresult MakeChannel(nsHttpChannel* chan, TransactionObserver* obs, + nsHttpConnectionInfo* ci, nsIURI* uri, uint32_t caps, + nsILoadInfo* loadInfo) { uint64_t channelId; nsLoadFlags flags; @@ -735,8 +735,8 @@ class WellKnownChecker { NS_IMPL_ISUPPORTS(TransactionObserver, nsIStreamListener) -TransactionObserver::TransactionObserver(nsHttpChannel *channel, - WellKnownChecker *checker) +TransactionObserver::TransactionObserver(nsHttpChannel* channel, + WellKnownChecker* checker) : mChannel(channel), mChecker(checker), mRanOnce(false), @@ -745,10 +745,10 @@ TransactionObserver::TransactionObserver(nsHttpChannel *channel, mStatusOK(false) { LOG(("TransactionObserver ctor %p channel %p checker %p\n", this, channel, checker)); - mChannelRef = do_QueryInterface((nsIHttpChannel *)channel); + mChannelRef = do_QueryInterface((nsIHttpChannel*)channel); } -void TransactionObserver::Complete(nsHttpTransaction *aTrans, nsresult reason) { +void TransactionObserver::Complete(nsHttpTransaction* aTrans, nsresult reason) { // socket thread MOZ_ASSERT(!NS_IsMainThread()); if (mRanOnce) { @@ -784,7 +784,7 @@ void TransactionObserver::Complete(nsHttpTransaction *aTrans, nsresult reason) { #define MAX_WK 32768 NS_IMETHODIMP -TransactionObserver::OnStartRequest(nsIRequest *aRequest) { +TransactionObserver::OnStartRequest(nsIRequest* aRequest) { MOZ_ASSERT(NS_IsMainThread()); // only consider the first 32KB.. because really. mWKResponse.SetCapacity(MAX_WK); @@ -792,8 +792,8 @@ TransactionObserver::OnStartRequest(nsIRequest *aRequest) { } NS_IMETHODIMP -TransactionObserver::OnDataAvailable(nsIRequest *aRequest, - nsIInputStream *aStream, uint64_t aOffset, +TransactionObserver::OnDataAvailable(nsIRequest* aRequest, + nsIInputStream* aStream, uint64_t aOffset, uint32_t aCount) { MOZ_ASSERT(NS_IsMainThread()); uint32_t oldLen = mWKResponse.Length(); @@ -819,12 +819,12 @@ TransactionObserver::OnDataAvailable(nsIRequest *aRequest, } NS_IMETHODIMP -TransactionObserver::OnStopRequest(nsIRequest *aRequest, nsresult code) { +TransactionObserver::OnStopRequest(nsIRequest* aRequest, nsresult code) { MOZ_ASSERT(NS_IsMainThread()); LOG(("TransactionObserver onStopRequest %p code %" PRIx32 "\n", this, static_cast(code))); if (NS_SUCCEEDED(code)) { - nsHttpResponseHead *hdrs = mChannel->GetResponseHead(); + nsHttpResponseHead* hdrs = mChannel->GetResponseHead(); LOG(("TransactionObserver onStopRequest %p http resp %d\n", this, hdrs ? hdrs->Status() : -1)); mStatusOK = hdrs && (hdrs->Status() == 200); @@ -836,7 +836,7 @@ TransactionObserver::OnStopRequest(nsIRequest *aRequest, nsresult code) { } already_AddRefed AltSvcCache::LookupMapping( - const nsCString &key, bool privateBrowsing) { + const nsCString& key, bool privateBrowsing) { LOG(("AltSvcCache::LookupMapping %p %s\n", this, key.get())); if (!mStorage) { LOG(("AltSvcCache::LookupMapping %p no backing store\n", this)); @@ -872,8 +872,8 @@ already_AddRefed AltSvcCache::LookupMapping( } void AltSvcCache::UpdateAltServiceMapping( - AltSvcMapping *map, nsProxyInfo *pi, nsIInterfaceRequestor *aCallbacks, - uint32_t caps, const OriginAttributes &originAttributes) { + AltSvcMapping* map, nsProxyInfo* pi, nsIInterfaceRequestor* aCallbacks, + uint32_t caps, const OriginAttributes& originAttributes) { MOZ_ASSERT(NS_IsMainThread()); if (!mStorage) { return; @@ -993,7 +993,7 @@ void AltSvcCache::UpdateAltServiceMapping( uri.AppendLiteral("/.well-known/http-opportunistic"); NS_NewURI(getter_AddRefs(wellKnown), uri); - auto *checker = new WellKnownChecker(wellKnown, origin, caps, ci, map); + auto* checker = new WellKnownChecker(wellKnown, origin, caps, ci, map); if (NS_FAILED(checker->Start())) { LOG( ("AltSvcCache::UpdateAltServiceMapping %p .wk checker failed to " @@ -1011,8 +1011,8 @@ void AltSvcCache::UpdateAltServiceMapping( } already_AddRefed AltSvcCache::GetAltServiceMapping( - const nsACString &scheme, const nsACString &host, int32_t port, - bool privateBrowsing, const OriginAttributes &originAttributes) { + const nsACString& scheme, const nsACString& host, int32_t port, + bool privateBrowsing, const OriginAttributes& originAttributes) { bool isHTTPS; MOZ_ASSERT(NS_IsMainThread()); if (!mStorage) { @@ -1058,8 +1058,8 @@ already_AddRefed AltSvcCache::GetAltServiceMapping( class ProxyClearHostMapping : public Runnable { public: - explicit ProxyClearHostMapping(const nsACString &host, int32_t port, - const OriginAttributes &originAttributes) + explicit ProxyClearHostMapping(const nsACString& host, int32_t port, + const OriginAttributes& originAttributes) : Runnable("net::ProxyClearHostMapping"), mHost(host), mPort(port), @@ -1077,8 +1077,8 @@ class ProxyClearHostMapping : public Runnable { OriginAttributes mOriginAttributes; }; -void AltSvcCache::ClearHostMapping(const nsACString &host, int32_t port, - const OriginAttributes &originAttributes) { +void AltSvcCache::ClearHostMapping(const nsACString& host, int32_t port, + const OriginAttributes& originAttributes) { if (!NS_IsMainThread()) { nsCOMPtr event = new ProxyClearHostMapping(host, port, originAttributes); @@ -1117,7 +1117,7 @@ void AltSvcCache::ClearHostMapping(const nsACString &host, int32_t port, } } -void AltSvcCache::ClearHostMapping(nsHttpConnectionInfo *ci) { +void AltSvcCache::ClearHostMapping(nsHttpConnectionInfo* ci) { if (!ci->GetOrigin().IsEmpty()) { ClearHostMapping(ci->GetOrigin(), ci->OriginPort(), ci->GetOriginAttributes()); @@ -1132,7 +1132,7 @@ void AltSvcCache::ClearAltServiceMappings() { } NS_IMETHODIMP -AltSvcOverride::GetInterface(const nsIID &iid, void **result) { +AltSvcOverride::GetInterface(const nsIID& iid, void** result) { if (NS_SUCCEEDED(QueryInterface(iid, result)) && *result) { return NS_OK; } @@ -1140,26 +1140,26 @@ AltSvcOverride::GetInterface(const nsIID &iid, void **result) { } NS_IMETHODIMP -AltSvcOverride::GetIgnoreIdle(bool *ignoreIdle) { +AltSvcOverride::GetIgnoreIdle(bool* ignoreIdle) { *ignoreIdle = true; return NS_OK; } NS_IMETHODIMP AltSvcOverride::GetParallelSpeculativeConnectLimit( - uint32_t *parallelSpeculativeConnectLimit) { + uint32_t* parallelSpeculativeConnectLimit) { *parallelSpeculativeConnectLimit = 32; return NS_OK; } NS_IMETHODIMP -AltSvcOverride::GetIsFromPredictor(bool *isFromPredictor) { +AltSvcOverride::GetIsFromPredictor(bool* isFromPredictor) { *isFromPredictor = false; return NS_OK; } NS_IMETHODIMP -AltSvcOverride::GetAllow1918(bool *allow) { +AltSvcOverride::GetAllow1918(bool* allow) { // normally we don't do speculative connects to 1918.. and we use // speculative connects for the mapping validation, so override // that default here for alt-svc diff --git a/netwerk/protocol/http/AlternateServices.h b/netwerk/protocol/http/AlternateServices.h index 1b741d2e5b8e4..0917e26580ec6 100644 --- a/netwerk/protocol/http/AlternateServices.h +++ b/netwerk/protocol/http/AlternateServices.h @@ -46,43 +46,43 @@ class AltSvcMapping { NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AltSvcMapping) private: // ctor from ProcessHeader - AltSvcMapping(DataStorage *storage, int32_t storageEpoch, - const nsACString &originScheme, const nsACString &originHost, - int32_t originPort, const nsACString &username, - const nsACString &topWindowOrigin, bool privateBrowsing, - uint32_t expiresAt, const nsACString &alternateHost, - int32_t alternatePort, const nsACString &npnToken, - const OriginAttributes &originAttributes); + AltSvcMapping(DataStorage* storage, int32_t storageEpoch, + const nsACString& originScheme, const nsACString& originHost, + int32_t originPort, const nsACString& username, + const nsACString& topWindowOrigin, bool privateBrowsing, + uint32_t expiresAt, const nsACString& alternateHost, + int32_t alternatePort, const nsACString& npnToken, + const OriginAttributes& originAttributes); public: - AltSvcMapping(DataStorage *storage, int32_t storageEpoch, - const nsCString &serialized); + AltSvcMapping(DataStorage* storage, int32_t storageEpoch, + const nsCString& serialized); - static void ProcessHeader(const nsCString &buf, const nsCString &originScheme, - const nsCString &originHost, int32_t originPort, - const nsACString &username, - const nsACString &topWindowOrigin, + static void ProcessHeader(const nsCString& buf, const nsCString& originScheme, + const nsCString& originHost, int32_t originPort, + const nsACString& username, + const nsACString& topWindowOrigin, bool privateBrowsing, - nsIInterfaceRequestor *callbacks, - nsProxyInfo *proxyInfo, uint32_t caps, - const OriginAttributes &originAttributes); + nsIInterfaceRequestor* callbacks, + nsProxyInfo* proxyInfo, uint32_t caps, + const OriginAttributes& originAttributes); // AcceptableProxy() decides whether a particular proxy configuration (pi) is // suitable for use with Alt-Svc. No proxy (including a null pi) is suitable. - static bool AcceptableProxy(nsProxyInfo *pi); + static bool AcceptableProxy(nsProxyInfo* pi); - const nsCString &AlternateHost() const { return mAlternateHost; } - const nsCString &OriginHost() const { return mOriginHost; } + const nsCString& AlternateHost() const { return mAlternateHost; } + const nsCString& OriginHost() const { return mOriginHost; } uint32_t OriginPort() const { return mOriginPort; } - const nsCString &HashKey() const { return mHashKey; } + const nsCString& HashKey() const { return mHashKey; } uint32_t AlternatePort() const { return mAlternatePort; } bool Validated() { return mValidated; } int32_t GetExpiresAt() { return mExpiresAt; } - bool RouteEquals(AltSvcMapping *map); + bool RouteEquals(AltSvcMapping* map); bool HTTPS() { return mHttps; } - void GetConnectionInfo(nsHttpConnectionInfo **outCI, nsProxyInfo *pi, - const OriginAttributes &originAttributes); + void GetConnectionInfo(nsHttpConnectionInfo** outCI, nsProxyInfo* pi, + const OriginAttributes& originAttributes); int32_t TTL(); int32_t StorageEpoch() { return mStorageEpoch; } @@ -95,17 +95,17 @@ class AltSvcMapping { void Sync(); void SetSyncOnlyOnSuccess(bool aSOOS) { mSyncOnlyOnSuccess = aSOOS; } - static void MakeHashKey(nsCString &outKey, const nsACString &originScheme, - const nsACString &originHost, int32_t originPort, + static void MakeHashKey(nsCString& outKey, const nsACString& originScheme, + const nsACString& originHost, int32_t originPort, bool privateBrowsing, - const OriginAttributes &originAttributes); + const OriginAttributes& originAttributes); private: virtual ~AltSvcMapping() = default; - void SyncString(const nsCString &val); + void SyncString(const nsCString& val); RefPtr mStorage; int32_t mStorageEpoch; - void Serialize(nsCString &out); + void Serialize(nsCString& out); nsCString mHashKey; @@ -141,7 +141,7 @@ class AltSvcOverride : public nsIInterfaceRequestor, NS_DECL_NSISPECULATIVECONNECTIONOVERRIDER NS_DECL_NSIINTERFACEREQUESTOR - explicit AltSvcOverride(nsIInterfaceRequestor *aRequestor) + explicit AltSvcOverride(nsIInterfaceRequestor* aRequestor) : mCallbacks(aRequestor) {} private: @@ -155,16 +155,16 @@ class TransactionObserver final : public nsIStreamListener { NS_DECL_NSISTREAMLISTENER NS_DECL_NSIREQUESTOBSERVER - TransactionObserver(nsHttpChannel *channel, WellKnownChecker *checker); - void Complete(nsHttpTransaction *, nsresult); + TransactionObserver(nsHttpChannel* channel, WellKnownChecker* checker); + void Complete(nsHttpTransaction*, nsresult); private: friend class WellKnownChecker; virtual ~TransactionObserver() = default; nsCOMPtr mChannelRef; - nsHttpChannel *mChannel; - WellKnownChecker *mChecker; + nsHttpChannel* mChannel; + WellKnownChecker* mChecker; nsCString mWKResponse; bool mRanOnce; @@ -178,21 +178,21 @@ class AltSvcCache { AltSvcCache() : mStorageEpoch(0) {} virtual ~AltSvcCache() = default; void UpdateAltServiceMapping( - AltSvcMapping *map, nsProxyInfo *pi, nsIInterfaceRequestor *, + AltSvcMapping* map, nsProxyInfo* pi, nsIInterfaceRequestor*, uint32_t caps, - const OriginAttributes &originAttributes); // main thread + const OriginAttributes& originAttributes); // main thread already_AddRefed GetAltServiceMapping( - const nsACString &scheme, const nsACString &host, int32_t port, bool pb, - const OriginAttributes &originAttributes); + const nsACString& scheme, const nsACString& host, int32_t port, bool pb, + const OriginAttributes& originAttributes); void ClearAltServiceMappings(); - void ClearHostMapping(const nsACString &host, int32_t port, - const OriginAttributes &originAttributes); - void ClearHostMapping(nsHttpConnectionInfo *ci); - DataStorage *GetStoragePtr() { return mStorage.get(); } + void ClearHostMapping(const nsACString& host, int32_t port, + const OriginAttributes& originAttributes); + void ClearHostMapping(nsHttpConnectionInfo* ci); + DataStorage* GetStoragePtr() { return mStorage.get(); } int32_t StorageEpoch() { return mStorageEpoch; } private: - already_AddRefed LookupMapping(const nsCString &key, + already_AddRefed LookupMapping(const nsCString& key, bool privateBrowsing); RefPtr mStorage; int32_t mStorageEpoch; diff --git a/netwerk/protocol/http/CacheControlParser.cpp b/netwerk/protocol/http/CacheControlParser.cpp index c4587b574656e..766027ffe9a24 100644 --- a/netwerk/protocol/http/CacheControlParser.cpp +++ b/netwerk/protocol/http/CacheControlParser.cpp @@ -9,7 +9,7 @@ namespace mozilla { namespace net { -CacheControlParser::CacheControlParser(nsACString const &aHeader) +CacheControlParser::CacheControlParser(nsACString const& aHeader) : Tokenizer(aHeader, nullptr, "-_"), mMaxAgeSet(false), mMaxAge(0), @@ -54,7 +54,7 @@ void CacheControlParser::Directive() { NS_WARNING("Unexpected input in Cache-control header value"); } -bool CacheControlParser::SecondsValue(uint32_t *seconds, uint32_t defaultVal) { +bool CacheControlParser::SecondsValue(uint32_t* seconds, uint32_t defaultVal) { SkipWhites(); if (!CheckChar('=')) { *seconds = defaultVal; @@ -88,17 +88,17 @@ void CacheControlParser::IgnoreDirective() { } } -bool CacheControlParser::MaxAge(uint32_t *seconds) { +bool CacheControlParser::MaxAge(uint32_t* seconds) { *seconds = mMaxAge; return mMaxAgeSet; } -bool CacheControlParser::MaxStale(uint32_t *seconds) { +bool CacheControlParser::MaxStale(uint32_t* seconds) { *seconds = mMaxStale; return mMaxStaleSet; } -bool CacheControlParser::MinFresh(uint32_t *seconds) { +bool CacheControlParser::MinFresh(uint32_t* seconds) { *seconds = mMinFresh; return mMinFreshSet; } diff --git a/netwerk/protocol/http/CacheControlParser.h b/netwerk/protocol/http/CacheControlParser.h index 3b9499a5df635..83639944962b9 100644 --- a/netwerk/protocol/http/CacheControlParser.h +++ b/netwerk/protocol/http/CacheControlParser.h @@ -14,18 +14,18 @@ namespace net { class CacheControlParser final : Tokenizer { public: - explicit CacheControlParser(nsACString const &header); + explicit CacheControlParser(nsACString const& header); - MOZ_MUST_USE bool MaxAge(uint32_t *seconds); - MOZ_MUST_USE bool MaxStale(uint32_t *seconds); - MOZ_MUST_USE bool MinFresh(uint32_t *seconds); + MOZ_MUST_USE bool MaxAge(uint32_t* seconds); + MOZ_MUST_USE bool MaxStale(uint32_t* seconds); + MOZ_MUST_USE bool MinFresh(uint32_t* seconds); bool NoCache(); bool NoStore(); private: void Directive(); void IgnoreDirective(); - MOZ_MUST_USE bool SecondsValue(uint32_t *seconds, uint32_t defaultVal = 0); + MOZ_MUST_USE bool SecondsValue(uint32_t* seconds, uint32_t defaultVal = 0); bool mMaxAgeSet; uint32_t mMaxAge; diff --git a/netwerk/protocol/http/ConnectionDiagnostics.cpp b/netwerk/protocol/http/ConnectionDiagnostics.cpp index 61ee62146f72e..e689c6683b274 100644 --- a/netwerk/protocol/http/ConnectionDiagnostics.cpp +++ b/netwerk/protocol/http/ConnectionDiagnostics.cpp @@ -31,7 +31,7 @@ void nsHttpConnectionMgr::PrintDiagnostics() { } } -void nsHttpConnectionMgr::OnMsgPrintDiagnostics(int32_t, ARefBase *) { +void nsHttpConnectionMgr::OnMsgPrintDiagnostics(int32_t, ARefBase*) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); nsCOMPtr consoleService = @@ -103,7 +103,7 @@ void nsHttpConnectionMgr::OnMsgPrintDiagnostics(int32_t, ARefBase *) { mLogData.Truncate(); } -void nsHttpConnectionMgr::nsHalfOpenSocket::PrintDiagnostics(nsCString &log) { +void nsHttpConnectionMgr::nsHalfOpenSocket::PrintDiagnostics(nsCString& log) { log.AppendPrintf(" has connected = %d, isSpeculative = %d\n", HasConnected(), IsSpeculative()); @@ -125,7 +125,7 @@ void nsHttpConnectionMgr::nsHalfOpenSocket::PrintDiagnostics(nsCString &log) { !!mSocketTransport.get(), !!mBackupTransport.get()); } -void nsHttpConnection::PrintDiagnostics(nsCString &log) { +void nsHttpConnection::PrintDiagnostics(nsCString& log) { log.AppendPrintf(" CanDirectlyActivate = %d\n", CanDirectlyActivate()); log.AppendPrintf(" npncomplete = %d setupSSLCalled = %d\n", mNPNComplete, @@ -157,7 +157,7 @@ void nsHttpConnection::PrintDiagnostics(nsCString &log) { if (mSpdySession) mSpdySession->PrintDiagnostics(log); } -void Http2Session::PrintDiagnostics(nsCString &log) { +void Http2Session::PrintDiagnostics(nsCString& log) { log.AppendPrintf(" ::: HTTP2\n"); log.AppendPrintf( " shouldgoaway = %d mClosed = %d CanReuse = %d nextID=0x%X\n", @@ -191,7 +191,7 @@ void Http2Session::PrintDiagnostics(nsCString &log) { log.AppendPrintf(" No Ping Outstanding\n"); } -void nsHttpTransaction::PrintDiagnostics(nsCString &log) { +void nsHttpTransaction::PrintDiagnostics(nsCString& log) { if (!mRequestHead) return; nsAutoCString requestURI; @@ -203,7 +203,7 @@ void nsHttpTransaction::PrintDiagnostics(nsCString &log) { } void nsHttpConnectionMgr::PendingTransactionInfo::PrintDiagnostics( - nsCString &log) { + nsCString& log) { log.AppendPrintf(" ::: Pending transaction\n"); mTransaction->PrintDiagnostics(log); RefPtr halfOpen = do_QueryReferent(mHalfOpen); diff --git a/netwerk/protocol/http/Http2Compression.cpp b/netwerk/protocol/http/Http2Compression.cpp index 9d3dbb602a9b3..2bb1d492da1cd 100644 --- a/netwerk/protocol/http/Http2Compression.cpp +++ b/netwerk/protocol/http/Http2Compression.cpp @@ -23,7 +23,7 @@ namespace mozilla { namespace net { -static nsDeque *gStaticHeaders = nullptr; +static nsDeque* gStaticHeaders = nullptr; class HpackStaticTableReporter final : public nsIMemoryReporter { public: @@ -32,7 +32,7 @@ class HpackStaticTableReporter final : public nsIMemoryReporter { HpackStaticTableReporter() = default; NS_IMETHOD - CollectReports(nsIHandleReportCallback *aHandleReport, nsISupports *aData, + CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData, bool aAnonymize) override { MOZ_COLLECT_REPORT("explicit/network/hpack/static-table", KIND_HEAP, UNITS_BYTES, @@ -54,11 +54,11 @@ class HpackDynamicTableReporter final : public nsIMemoryReporter { public: NS_DECL_THREADSAFE_ISUPPORTS - explicit HpackDynamicTableReporter(Http2BaseCompressor *aCompressor) + explicit HpackDynamicTableReporter(Http2BaseCompressor* aCompressor) : mCompressor(aCompressor) {} NS_IMETHOD - CollectReports(nsIHandleReportCallback *aHandleReport, nsISupports *aData, + CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData, bool aAnonymize) override { if (mCompressor) { MOZ_COLLECT_REPORT("explicit/network/hpack/dynamic-tables", KIND_HEAP, @@ -74,7 +74,7 @@ class HpackDynamicTableReporter final : public nsIMemoryReporter { ~HpackDynamicTableReporter() = default; - Http2BaseCompressor *mCompressor; + Http2BaseCompressor* mCompressor; friend class Http2BaseCompressor; }; @@ -91,12 +91,12 @@ void Http2CompressionCleanup() { gStaticReporter = nullptr; } -static void AddStaticElement(const nsCString &name, const nsCString &value) { - nvPair *pair = new nvPair(name, value); +static void AddStaticElement(const nsCString& name, const nsCString& value) { + nvPair* pair = new nvPair(name, value); gStaticHeaders->Push(pair); } -static void AddStaticElement(const nsCString &name) { +static void AddStaticElement(const nsCString& name) { AddStaticElement(name, EmptyCString()); } @@ -186,18 +186,18 @@ nvFIFO::nvFIFO() : mByteCount(0), mTable() { InitializeStaticHeaders(); } nvFIFO::~nvFIFO() { Clear(); } -void nvFIFO::AddElement(const nsCString &name, const nsCString &value) { - nvPair *pair = new nvPair(name, value); +void nvFIFO::AddElement(const nsCString& name, const nsCString& value) { + nvPair* pair = new nvPair(name, value); mByteCount += pair->Size(); mTable.PushFront(pair); } -void nvFIFO::AddElement(const nsCString &name) { +void nvFIFO::AddElement(const nsCString& name) { AddElement(name, EmptyCString()); } void nvFIFO::RemoveElement() { - nvPair *pair = static_cast(mTable.Pop()); + nvPair* pair = static_cast(mTable.Pop()); if (pair) { mByteCount -= pair->Size(); delete pair; @@ -216,10 +216,10 @@ size_t nvFIFO::StaticLength() const { return gStaticHeaders->GetSize(); } void nvFIFO::Clear() { mByteCount = 0; - while (mTable.GetSize()) delete static_cast(mTable.Pop()); + while (mTable.GetSize()) delete static_cast(mTable.Pop()); } -const nvPair *nvFIFO::operator[](size_t index) const { +const nvPair* nvFIFO::operator[](size_t index) const { // NWGH - ensure index > 0 // NWGH - subtract 1 from index here if (index >= (mTable.GetSize() + gStaticHeaders->GetSize())) { @@ -228,10 +228,10 @@ const nvPair *nvFIFO::operator[](size_t index) const { return nullptr; } if (index >= gStaticHeaders->GetSize()) { - return static_cast( + return static_cast( mTable.ObjectAt(index - gStaticHeaders->GetSize())); } - return static_cast(gStaticHeaders->ObjectAt(index)); + return static_cast(gStaticHeaders->ObjectAt(index)); } Http2BaseCompressor::Http2BaseCompressor() @@ -270,7 +270,7 @@ size_t Http2BaseCompressor::SizeOfExcludingThis( return size; } -void Http2BaseCompressor::MakeRoom(uint32_t amount, const char *direction) { +void Http2BaseCompressor::MakeRoom(uint32_t amount, const char* direction) { uint32_t countEvicted = 0; uint32_t bytesEvicted = 0; @@ -306,7 +306,7 @@ void Http2BaseCompressor::MakeRoom(uint32_t amount, const char *direction) { } } -void Http2BaseCompressor::DumpState(const char *preamble) { +void Http2BaseCompressor::DumpState(const char* preamble) { if (!LOG_ENABLED()) { return; } @@ -323,7 +323,7 @@ void Http2BaseCompressor::DumpState(const char *preamble) { uint32_t staticLength = mHeaderTable.StaticLength(); // NWGH - make i = 1; i <= length; ++i for (i = 0; i < length; ++i) { - const nvPair *pair = mHeaderTable[i]; + const nvPair* pair = mHeaderTable[i]; // NWGH - make this <= staticLength LOG(("%sindex %u: %s %s", i < staticLength ? "static " : "", i, pair->mName.get(), pair->mValue.get())); @@ -362,9 +362,9 @@ void Http2BaseCompressor::SetDumpTables(bool dumpTables) { mDumpTables = dumpTables; } -nsresult Http2Decompressor::DecodeHeaderBlock(const uint8_t *data, +nsresult Http2Decompressor::DecodeHeaderBlock(const uint8_t* data, uint32_t datalen, - nsACString &output, bool isPush) { + nsACString& output, bool isPush) { mSetInitialMaxBufferSizeAllowed = false; mOffset = 0; mData = data; @@ -386,7 +386,7 @@ nsresult Http2Decompressor::DecodeHeaderBlock(const uint8_t *data, nsresult softfail_rv = NS_OK; while (NS_SUCCEEDED(rv) && (mOffset < mDataLen)) { bool modifiesTable = true; - const char *preamble = "Decompressor state after ?"; + const char* preamble = "Decompressor state after ?"; if (mData[mOffset] & 0x80) { rv = DoIndexed(); preamble = "Decompressor state after indexed"; @@ -436,7 +436,7 @@ nsresult Http2Decompressor::DecodeHeaderBlock(const uint8_t *data, return softfail_rv; } -nsresult Http2Decompressor::DecodeInteger(uint32_t prefixLen, uint32_t &accum) { +nsresult Http2Decompressor::DecodeInteger(uint32_t prefixLen, uint32_t& accum) { accum = 0; if (prefixLen) { @@ -491,10 +491,10 @@ nsresult Http2Decompressor::DecodeInteger(uint32_t prefixLen, uint32_t &accum) { return NS_OK; } -static bool HasConnectionBasedAuth(const nsACString &headerValue) { +static bool HasConnectionBasedAuth(const nsACString& headerValue) { nsCCharSeparatedTokenizer t(headerValue, '\n'); while (t.hasMoreTokens()) { - const nsDependentCSubstring &authMethod = t.nextToken(); + const nsDependentCSubstring& authMethod = t.nextToken(); if (authMethod.LowerCaseEqualsLiteral("ntlm")) { return true; } @@ -506,8 +506,8 @@ static bool HasConnectionBasedAuth(const nsACString &headerValue) { return false; } -nsresult Http2Decompressor::OutputHeader(const nsACString &name, - const nsACString &value) { +nsresult Http2Decompressor::OutputHeader(const nsACString& name, + const nsACString& value) { // exclusions if (!mIsPush && (name.EqualsLiteral("connection") || name.EqualsLiteral("host") || @@ -522,7 +522,7 @@ nsresult Http2Decompressor::OutputHeader(const nsACString &name, } // Look for upper case characters in the name. - for (const char *cPtr = name.BeginReading(); cPtr && cPtr < name.EndReading(); + for (const char* cPtr = name.BeginReading(); cPtr && cPtr < name.EndReading(); ++cPtr) { if (*cPtr <= 'Z' && *cPtr >= 'A') { nsCString toLog(name); @@ -534,10 +534,10 @@ nsresult Http2Decompressor::OutputHeader(const nsACString &name, // Look for CR OR LF in value - could be smuggling Sec 10.3 // can map to space safely - for (const char *cPtr = value.BeginReading(); + for (const char* cPtr = value.BeginReading(); cPtr && cPtr < value.EndReading(); ++cPtr) { if (*cPtr == '\r' || *cPtr == '\n') { - char *wPtr = const_cast(cPtr); + char* wPtr = const_cast(cPtr); *wPtr = ' '; } } @@ -561,7 +561,7 @@ nsresult Http2Decompressor::OutputHeader(const nsACString &name, // http/2 transport level headers shouldn't be gatewayed into http/1 bool isColonHeader = false; - for (const char *cPtr = name.BeginReading(); cPtr && cPtr < name.EndReading(); + for (const char* cPtr = name.BeginReading(); cPtr && cPtr < name.EndReading(); ++cPtr) { if (*cPtr == ':') { isColonHeader = true; @@ -625,7 +625,7 @@ nsresult Http2Decompressor::OutputHeader(uint32_t index) { return OutputHeader(mHeaderTable[index]->mName, mHeaderTable[index]->mValue); } -nsresult Http2Decompressor::CopyHeaderString(uint32_t index, nsACString &name) { +nsresult Http2Decompressor::CopyHeaderString(uint32_t index, nsACString& name) { // NWGH - make this < index // bounds check if (mHeaderTable.Length() <= index) { @@ -638,19 +638,19 @@ nsresult Http2Decompressor::CopyHeaderString(uint32_t index, nsACString &name) { } nsresult Http2Decompressor::CopyStringFromInput(uint32_t bytes, - nsACString &val) { + nsACString& val) { if (mOffset + bytes > mDataLen) { // This is session-fatal. return NS_ERROR_FAILURE; } - val.Assign(reinterpret_cast(mData) + mOffset, bytes); + val.Assign(reinterpret_cast(mData) + mOffset, bytes); mOffset += bytes; return NS_OK; } nsresult Http2Decompressor::DecodeFinalHuffmanCharacter( - const HuffmanIncomingTable *table, uint8_t &c, uint8_t &bitsLeft) { + const HuffmanIncomingTable* table, uint8_t& c, uint8_t& bitsLeft) { MOZ_ASSERT(mOffset <= mDataLen); if (mOffset > mDataLen) { NS_WARNING("DecodeFinalHuffmanCharacter would read beyond end of buffer"); @@ -669,7 +669,7 @@ nsresult Http2Decompressor::DecodeFinalHuffmanCharacter( return NS_ERROR_FAILURE; } - const HuffmanIncomingEntry *entry = table->Entry(idx); + const HuffmanIncomingEntry* entry = table->Entry(idx); if (bitsLeft < entry->mPrefixLen) { // We don't have enough bits to actually make a match, this is some sort of @@ -691,7 +691,7 @@ nsresult Http2Decompressor::DecodeFinalHuffmanCharacter( } uint8_t Http2Decompressor::ExtractByte(uint8_t bitsLeft, - uint32_t &bytesConsumed) { + uint32_t& bytesConsumed) { MOZ_DIAGNOSTIC_ASSERT(mOffset < mDataLen); uint8_t rv; @@ -715,8 +715,8 @@ uint8_t Http2Decompressor::ExtractByte(uint8_t bitsLeft, } nsresult Http2Decompressor::DecodeHuffmanCharacter( - const HuffmanIncomingTable *table, uint8_t &c, uint32_t &bytesConsumed, - uint8_t &bitsLeft) { + const HuffmanIncomingTable* table, uint8_t& c, uint32_t& bytesConsumed, + uint8_t& bitsLeft) { uint8_t idx = ExtractByte(bitsLeft, bytesConsumed); if (table->IndexHasANextTable(idx)) { @@ -737,7 +737,7 @@ nsresult Http2Decompressor::DecodeHuffmanCharacter( bitsLeft); } - const HuffmanIncomingEntry *entry = table->Entry(idx); + const HuffmanIncomingEntry* entry = table->Entry(idx); if (entry->mValue == 256) { LOG(("DecodeHuffmanCharacter found an actual EOS")); return NS_ERROR_FAILURE; @@ -759,7 +759,7 @@ nsresult Http2Decompressor::DecodeHuffmanCharacter( } nsresult Http2Decompressor::CopyHuffmanStringFromInput(uint32_t bytes, - nsACString &val) { + nsACString& val) { if (mOffset + bytes > mDataLen) { LOG(("CopyHuffmanStringFromInput not enough data")); return NS_ERROR_FAILURE; @@ -845,8 +845,8 @@ nsresult Http2Decompressor::DoIndexed() { return OutputHeader(index); } -nsresult Http2Decompressor::DoLiteralInternal(nsACString &name, - nsACString &value, +nsresult Http2Decompressor::DoLiteralInternal(nsACString& name, + nsACString& value, uint32_t namePrefixLen) { // guts of doliteralwithoutindex and doliteralwithincremental MOZ_ASSERT(((mData[mOffset] & 0xF0) == 0x00) || // withoutindex @@ -1044,9 +1044,9 @@ nsresult Http2Decompressor::DoContextUpdate() { ///////////////////////////////////////////////////////////////// nsresult Http2Compressor::EncodeHeaderBlock( - const nsCString &nvInput, const nsACString &method, const nsACString &path, - const nsACString &host, const nsACString &scheme, - const nsACString &protocol, bool simpleConnectForm, nsACString &output) { + const nsCString& nvInput, const nsACString& method, const nsACString& path, + const nsACString& host, const nsACString& scheme, + const nsACString& protocol, bool simpleConnectForm, nsACString& output) { mSetInitialMaxBufferSizeAllowed = false; mOutput = &output; output.Truncate(); @@ -1079,7 +1079,7 @@ nsresult Http2Compressor::EncodeHeaderBlock( } // now the non colon headers - const char *beginBuffer = nvInput.BeginReading(); + const char* beginBuffer = nvInput.BeginReading(); // This strips off the HTTP/1 method+path+version int32_t crlfIndex = nvInput.Find("\r\n"); @@ -1115,7 +1115,7 @@ nsresult Http2Compressor::EncodeHeaderBlock( // colon headers are for http/2 and this is http/1 input, so that // is probably a smuggling attack of some kind bool isColonHeader = false; - for (const char *cPtr = name.BeginReading(); + for (const char* cPtr = name.BeginReading(); cPtr && cPtr < name.EndReading(); ++cPtr) { if (*cPtr == ':') { isColonHeader = true; @@ -1186,12 +1186,12 @@ nsresult Http2Compressor::EncodeHeaderBlock( } void Http2Compressor::DoOutput(Http2Compressor::outputCode code, - const class nvPair *pair, uint32_t index) { + const class nvPair* pair, uint32_t index) { // start Byte needs to be calculated from the offset after // the opcode has been written out in case the output stream // buffer gets resized/relocated uint32_t offset = mOutput->Length(); - uint8_t *startByte; + uint8_t* startByte; switch (code) { case kNeverIndexedLiteral: @@ -1204,7 +1204,7 @@ void Http2Compressor::DoOutput(Http2Compressor::outputCode code, // instead of 0-based. EncodeInteger(4, index); // 0001 4 bit prefix startByte = - reinterpret_cast(mOutput->BeginWriting()) + offset; + reinterpret_cast(mOutput->BeginWriting()) + offset; *startByte = (*startByte & 0x0f) | 0x10; if (!index) { @@ -1222,7 +1222,7 @@ void Http2Compressor::DoOutput(Http2Compressor::outputCode code, // instead of 0-based. EncodeInteger(4, index); // 0000 4 bit prefix startByte = - reinterpret_cast(mOutput->BeginWriting()) + offset; + reinterpret_cast(mOutput->BeginWriting()) + offset; *startByte = *startByte & 0x0f; if (!index) { @@ -1240,7 +1240,7 @@ void Http2Compressor::DoOutput(Http2Compressor::outputCode code, // instead of 0-based. EncodeInteger(6, index); // 01 2 bit prefix startByte = - reinterpret_cast(mOutput->BeginWriting()) + offset; + reinterpret_cast(mOutput->BeginWriting()) + offset; *startByte = (*startByte & 0x3f) | 0x40; if (!index) { @@ -1258,7 +1258,7 @@ void Http2Compressor::DoOutput(Http2Compressor::outputCode code, // increment to make it 1-based and comply with the spec EncodeInteger(7, index + 1); startByte = - reinterpret_cast(mOutput->BeginWriting()) + offset; + reinterpret_cast(mOutput->BeginWriting()) + offset; *startByte = *startByte | 0x80; // 1 1 bit prefix break; } @@ -1272,14 +1272,14 @@ void Http2Compressor::EncodeInteger(uint32_t prefixLen, uint32_t val) { if (val < mask) { // 1 byte encoding! tmp = val; - mOutput->Append(reinterpret_cast(&tmp), 1); + mOutput->Append(reinterpret_cast(&tmp), 1); return; } if (mask) { val -= mask; tmp = mask; - mOutput->Append(reinterpret_cast(&tmp), 1); + mOutput->Append(reinterpret_cast(&tmp), 1); } uint32_t q, r; @@ -1291,16 +1291,16 @@ void Http2Compressor::EncodeInteger(uint32_t prefixLen, uint32_t val) { tmp |= 0x80; // chain bit } val = q; - mOutput->Append(reinterpret_cast(&tmp), 1); + mOutput->Append(reinterpret_cast(&tmp), 1); } while (q); } -void Http2Compressor::HuffmanAppend(const nsCString &value) { +void Http2Compressor::HuffmanAppend(const nsCString& value) { nsAutoCString buf; uint8_t bitsLeft = 8; uint32_t length = value.Length(); uint32_t offset; - uint8_t *startByte; + uint8_t* startByte; for (uint32_t i = 0; i < length; ++i) { uint8_t idx = static_cast(value[i]); @@ -1319,8 +1319,7 @@ void Http2Compressor::HuffmanAppend(const nsCString &value) { } val &= ((1 << bitsLeft) - 1); offset = buf.Length() - 1; - startByte = - reinterpret_cast(buf.BeginWriting()) + offset; + startByte = reinterpret_cast(buf.BeginWriting()) + offset; *startByte = *startByte | static_cast(val & 0xFF); if (huffLength >= bitsLeft) { huffLength -= bitsLeft; @@ -1334,7 +1333,7 @@ void Http2Compressor::HuffmanAppend(const nsCString &value) { while (huffLength >= 8) { uint32_t mask = ~((1 << (huffLength - 8)) - 1); uint8_t val = ((huffValue & mask) >> (huffLength - 8)) & 0xFF; - buf.Append(reinterpret_cast(&val), 1); + buf.Append(reinterpret_cast(&val), 1); huffLength -= 8; } @@ -1342,7 +1341,7 @@ void Http2Compressor::HuffmanAppend(const nsCString &value) { // Fill in the most significant bits of the next byte bitsLeft = 8 - huffLength; uint8_t val = (huffValue & ((1 << huffLength) - 1)) << bitsLeft; - buf.Append(reinterpret_cast(&val), 1); + buf.Append(reinterpret_cast(&val), 1); } } @@ -1351,7 +1350,7 @@ void Http2Compressor::HuffmanAppend(const nsCString &value) { // encoding uint8_t val = (1 << bitsLeft) - 1; offset = buf.Length() - 1; - startByte = reinterpret_cast(buf.BeginWriting()) + offset; + startByte = reinterpret_cast(buf.BeginWriting()) + offset; *startByte = *startByte | val; } @@ -1360,7 +1359,7 @@ void Http2Compressor::HuffmanAppend(const nsCString &value) { offset = mOutput->Length(); EncodeInteger(7, bufLength); startByte = - reinterpret_cast(mOutput->BeginWriting()) + offset; + reinterpret_cast(mOutput->BeginWriting()) + offset; *startByte = *startByte | 0x80; // Finally, we can add our REAL data! @@ -1429,8 +1428,8 @@ void Http2Compressor::ProcessHeader(const nvPair inputPair, bool noLocalIndex, void Http2Compressor::EncodeTableSizeChange(uint32_t newMaxSize) { uint32_t offset = mOutput->Length(); EncodeInteger(5, newMaxSize); - uint8_t *startByte = - reinterpret_cast(mOutput->BeginWriting()) + offset; + uint8_t* startByte = + reinterpret_cast(mOutput->BeginWriting()) + offset; *startByte = *startByte | 0x20; } diff --git a/netwerk/protocol/http/Http2Compression.h b/netwerk/protocol/http/Http2Compression.h index 5ff2118083f70..f0e45cef7ab7a 100644 --- a/netwerk/protocol/http/Http2Compression.h +++ b/netwerk/protocol/http/Http2Compression.h @@ -24,7 +24,7 @@ void Http2CompressionCleanup(); class nvPair { public: - nvPair(const nsACString &name, const nsACString &value) + nvPair(const nsACString& name, const nsACString& value) : mName(name), mValue(value) {} uint32_t Size() const { return mName.Length() + mValue.Length() + 32; } @@ -39,15 +39,15 @@ class nvFIFO { public: nvFIFO(); ~nvFIFO(); - void AddElement(const nsCString &name, const nsCString &value); - void AddElement(const nsCString &name); + void AddElement(const nsCString& name, const nsCString& value); + void AddElement(const nsCString& name); void RemoveElement(); uint32_t ByteCount() const; uint32_t Length() const; uint32_t VariableLength() const; size_t StaticLength() const; void Clear(); - const nvPair *operator[](size_t index) const; + const nvPair* operator[](size_t index) const; private: uint32_t mByteCount; @@ -68,11 +68,11 @@ class Http2BaseCompressor { const static uint32_t kDefaultMaxBuffer = 4096; virtual void ClearHeaderTable(); - virtual void MakeRoom(uint32_t amount, const char *direction); - virtual void DumpState(const char *); + virtual void MakeRoom(uint32_t amount, const char* direction); + virtual void DumpState(const char*); virtual void SetMaxBufferSizeInternal(uint32_t maxBufferSize); - nsACString *mOutput; + nsACString* mOutput; nvFIFO mHeaderTable; uint32_t mMaxBuffer; @@ -108,38 +108,38 @@ class Http2Decompressor final : public Http2BaseCompressor { virtual ~Http2Decompressor() = default; // NS_OK: Produces the working set of HTTP/1 formatted headers - MOZ_MUST_USE nsresult DecodeHeaderBlock(const uint8_t *data, uint32_t datalen, - nsACString &output, bool isPush); + MOZ_MUST_USE nsresult DecodeHeaderBlock(const uint8_t* data, uint32_t datalen, + nsACString& output, bool isPush); - void GetStatus(nsACString &hdr) { hdr = mHeaderStatus; } - void GetHost(nsACString &hdr) { hdr = mHeaderHost; } - void GetScheme(nsACString &hdr) { hdr = mHeaderScheme; } - void GetPath(nsACString &hdr) { hdr = mHeaderPath; } - void GetMethod(nsACString &hdr) { hdr = mHeaderMethod; } + void GetStatus(nsACString& hdr) { hdr = mHeaderStatus; } + void GetHost(nsACString& hdr) { hdr = mHeaderHost; } + void GetScheme(nsACString& hdr) { hdr = mHeaderScheme; } + void GetPath(nsACString& hdr) { hdr = mHeaderPath; } + void GetMethod(nsACString& hdr) { hdr = mHeaderMethod; } private: MOZ_MUST_USE nsresult DoIndexed(); MOZ_MUST_USE nsresult DoLiteralWithoutIndex(); MOZ_MUST_USE nsresult DoLiteralWithIncremental(); - MOZ_MUST_USE nsresult DoLiteralInternal(nsACString &, nsACString &, uint32_t); + MOZ_MUST_USE nsresult DoLiteralInternal(nsACString&, nsACString&, uint32_t); MOZ_MUST_USE nsresult DoLiteralNeverIndexed(); MOZ_MUST_USE nsresult DoContextUpdate(); - MOZ_MUST_USE nsresult DecodeInteger(uint32_t prefixLen, uint32_t &result); + MOZ_MUST_USE nsresult DecodeInteger(uint32_t prefixLen, uint32_t& result); MOZ_MUST_USE nsresult OutputHeader(uint32_t index); - MOZ_MUST_USE nsresult OutputHeader(const nsACString &name, - const nsACString &value); + MOZ_MUST_USE nsresult OutputHeader(const nsACString& name, + const nsACString& value); - MOZ_MUST_USE nsresult CopyHeaderString(uint32_t index, nsACString &name); - MOZ_MUST_USE nsresult CopyStringFromInput(uint32_t index, nsACString &val); - uint8_t ExtractByte(uint8_t bitsLeft, uint32_t &bytesConsumed); + MOZ_MUST_USE nsresult CopyHeaderString(uint32_t index, nsACString& name); + MOZ_MUST_USE nsresult CopyStringFromInput(uint32_t index, nsACString& val); + uint8_t ExtractByte(uint8_t bitsLeft, uint32_t& bytesConsumed); MOZ_MUST_USE nsresult CopyHuffmanStringFromInput(uint32_t index, - nsACString &val); + nsACString& val); MOZ_MUST_USE nsresult - DecodeHuffmanCharacter(const HuffmanIncomingTable *table, uint8_t &c, - uint32_t &bytesConsumed, uint8_t &bitsLeft); + DecodeHuffmanCharacter(const HuffmanIncomingTable* table, uint8_t& c, + uint32_t& bytesConsumed, uint8_t& bitsLeft); MOZ_MUST_USE nsresult DecodeFinalHuffmanCharacter( - const HuffmanIncomingTable *table, uint8_t &c, uint8_t &bitsLeft); + const HuffmanIncomingTable* table, uint8_t& c, uint8_t& bitsLeft); nsCString mHeaderStatus; nsCString mHeaderHost; @@ -149,7 +149,7 @@ class Http2Decompressor final : public Http2BaseCompressor { // state variables when DecodeBlock() is on the stack uint32_t mOffset; - const uint8_t *mData; + const uint8_t* mData; uint32_t mDataLen; bool mSeenNonColonHeader; bool mIsPush; @@ -169,9 +169,9 @@ class Http2Compressor final : public Http2BaseCompressor { // HTTP/1 formatted header block as input - HTTP/2 formatted // header block as output MOZ_MUST_USE nsresult EncodeHeaderBlock( - const nsCString &nvInput, const nsACString &method, - const nsACString &path, const nsACString &host, const nsACString &scheme, - const nsACString &protocol, bool simpleConnectForm, nsACString &output); + const nsCString& nvInput, const nsACString& method, + const nsACString& path, const nsACString& host, const nsACString& scheme, + const nsACString& protocol, bool simpleConnectForm, nsACString& output); int64_t GetParsedContentLength() { return mParsedContentLength; @@ -187,12 +187,12 @@ class Http2Compressor final : public Http2BaseCompressor { kIndex }; - void DoOutput(Http2Compressor::outputCode code, const class nvPair *pair, + void DoOutput(Http2Compressor::outputCode code, const class nvPair* pair, uint32_t index); void EncodeInteger(uint32_t prefixLen, uint32_t val); void ProcessHeader(const nvPair inputPair, bool noLocalIndex, bool neverIndex); - void HuffmanAppend(const nsCString &value); + void HuffmanAppend(const nsCString& value); void EncodeTableSizeChange(uint32_t newMaxSize); int64_t mParsedContentLength; diff --git a/netwerk/protocol/http/Http2Push.cpp b/netwerk/protocol/http/Http2Push.cpp index 58372a50bdae8..495209729807e 100644 --- a/netwerk/protocol/http/Http2Push.cpp +++ b/netwerk/protocol/http/Http2Push.cpp @@ -25,8 +25,8 @@ namespace net { class CallChannelOnPush final : public Runnable { public: - CallChannelOnPush(nsIHttpChannelInternal *associatedChannel, - const nsACString &pushedURI, Http2PushedStream *pushStream) + CallChannelOnPush(nsIHttpChannelInternal* associatedChannel, + const nsACString& pushedURI, Http2PushedStream* pushStream) : Runnable("net::CallChannelOnPush"), mAssociatedChannel(associatedChannel), mPushedURI(pushedURI), @@ -49,7 +49,7 @@ class CallChannelOnPush final : public Runnable { private: nsCOMPtr mAssociatedChannel; const nsCString mPushedURI; - Http2PushedStream *mPushedStream; + Http2PushedStream* mPushedStream; }; ////////////////////////////////////////// @@ -57,8 +57,8 @@ class CallChannelOnPush final : public Runnable { ////////////////////////////////////////// Http2PushedStream::Http2PushedStream( - Http2PushTransactionBuffer *aTransaction, Http2Session *aSession, - Http2Stream *aAssociatedStream, uint32_t aID, + Http2PushTransactionBuffer* aTransaction, Http2Session* aSession, + Http2Stream* aAssociatedStream, uint32_t aID, uint64_t aCurrentForegroundTabOuterContentWindowId) : Http2Stream(aTransaction, aSession, 0, aCurrentForegroundTabOuterContentWindowId), @@ -92,9 +92,9 @@ Http2PushedStream::Http2PushedStream( bool Http2PushedStream::GetPushComplete() { return mPushCompleted; } -nsresult Http2PushedStream::WriteSegments(nsAHttpSegmentWriter *writer, +nsresult Http2PushedStream::WriteSegments(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) { + uint32_t* countWritten) { nsresult rv = Http2Stream::WriteSegments(writer, count, countWritten); if (NS_SUCCEEDED(rv) && *countWritten) { mLastRead = TimeStamp::Now(); @@ -135,7 +135,7 @@ bool Http2PushedStream::DeferCleanup(nsresult status) { // return true if channel implements nsIHttpPushListener bool Http2PushedStream::TryOnPush() { - nsHttpTransaction *trans = mAssociatedTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mAssociatedTransaction->QueryHttpTransaction(); if (!trans) { return false; } @@ -158,15 +158,15 @@ bool Http2PushedStream::TryOnPush() { // side effect free static method to determine if Http2Stream implements // nsIHttpPushListener -bool Http2PushedStream::TestOnPush(Http2Stream *stream) { +bool Http2PushedStream::TestOnPush(Http2Stream* stream) { if (!stream) { return false; } - nsAHttpTransaction *abstractTransaction = stream->Transaction(); + nsAHttpTransaction* abstractTransaction = stream->Transaction(); if (!abstractTransaction) { return false; } - nsHttpTransaction *trans = abstractTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = abstractTransaction->QueryHttpTransaction(); if (!trans) { return false; } @@ -178,8 +178,8 @@ bool Http2PushedStream::TestOnPush(Http2Stream *stream) { return (trans->Caps() & NS_HTTP_ONPUSH_LISTENER); } -nsresult Http2PushedStream::ReadSegments(nsAHttpSegmentReader *reader, uint32_t, - uint32_t *count) { +nsresult Http2PushedStream::ReadSegments(nsAHttpSegmentReader* reader, uint32_t, + uint32_t* count) { nsresult rv = NS_OK; *count = 0; @@ -238,7 +238,7 @@ void Http2PushedStream::AdjustInitialWindow() { // anyway, so we're good to go. } -void Http2PushedStream::SetConsumerStream(Http2Stream *consumer) { +void Http2PushedStream::SetConsumerStream(Http2Stream* consumer) { LOG3(("Http2PushedStream::SetConsumerStream this=%p consumer=%p", this, consumer)); @@ -246,14 +246,14 @@ void Http2PushedStream::SetConsumerStream(Http2Stream *consumer) { mDeferCleanupOnPush = false; } -bool Http2PushedStream::GetHashKey(nsCString &key) { +bool Http2PushedStream::GetHashKey(nsCString& key) { if (mHashKey.IsEmpty()) return false; key = mHashKey; return true; } -void Http2PushedStream::ConnectPushedStream(Http2Stream *stream) { +void Http2PushedStream::ConnectPushedStream(Http2Stream* stream) { mSession->ConnectPushedStream(stream); } @@ -279,8 +279,8 @@ bool Http2PushedStream::IsOrphaned(TimeStamp now) { return rv; } -nsresult Http2PushedStream::GetBufferedData(char *buf, uint32_t count, - uint32_t *countWritten) { +nsresult Http2PushedStream::GetBufferedData(char* buf, uint32_t count, + uint32_t* countWritten) { if (NS_FAILED(mStatus)) return mStatus; nsresult rv = mBufferedPush->GetBufferedData(buf, count, countWritten); @@ -344,20 +344,20 @@ Http2PushTransactionBuffer::~Http2PushTransactionBuffer() { delete mRequestHead; } -void Http2PushTransactionBuffer::SetConnection(nsAHttpConnection *conn) {} +void Http2PushTransactionBuffer::SetConnection(nsAHttpConnection* conn) {} -nsAHttpConnection *Http2PushTransactionBuffer::Connection() { return nullptr; } +nsAHttpConnection* Http2PushTransactionBuffer::Connection() { return nullptr; } void Http2PushTransactionBuffer::GetSecurityCallbacks( - nsIInterfaceRequestor **outCB) { + nsIInterfaceRequestor** outCB) { *outCB = nullptr; } -void Http2PushTransactionBuffer::OnTransportStatus(nsITransport *transport, +void Http2PushTransactionBuffer::OnTransportStatus(nsITransport* transport, nsresult status, int64_t progress) {} -nsHttpConnectionInfo *Http2PushTransactionBuffer::ConnectionInfo() { +nsHttpConnectionInfo* Http2PushTransactionBuffer::ConnectionInfo() { if (!mPushStream) { return nullptr; } @@ -380,16 +380,16 @@ uint64_t Http2PushTransactionBuffer::Available() { return mBufferedHTTP1Used - mBufferedHTTP1Consumed; } -nsresult Http2PushTransactionBuffer::ReadSegments(nsAHttpSegmentReader *reader, +nsresult Http2PushTransactionBuffer::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count, - uint32_t *countRead) { + uint32_t* countRead) { *countRead = 0; return NS_ERROR_NOT_IMPLEMENTED; } -nsresult Http2PushTransactionBuffer::WriteSegments(nsAHttpSegmentWriter *writer, +nsresult Http2PushTransactionBuffer::WriteSegments(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) { + uint32_t* countWritten) { if ((mBufferedHTTP1Size - mBufferedHTTP1Used) < 20480) { EnsureBuffer(mBufferedHTTP1, mBufferedHTTP1Size + kDefaultBufferSize, mBufferedHTTP1Used, mBufferedHTTP1Size); @@ -405,7 +405,7 @@ nsresult Http2PushTransactionBuffer::WriteSegments(nsAHttpSegmentWriter *writer, } if (Available() || mIsDone) { - Http2Stream *consumer = mPushStream->GetConsumerStream(); + Http2Stream* consumer = mPushStream->GetConsumerStream(); if (consumer) { LOG3( @@ -421,13 +421,13 @@ nsresult Http2PushTransactionBuffer::WriteSegments(nsAHttpSegmentWriter *writer, uint32_t Http2PushTransactionBuffer::Http1xTransactionCount() { return 0; } -nsHttpRequestHead *Http2PushTransactionBuffer::RequestHead() { +nsHttpRequestHead* Http2PushTransactionBuffer::RequestHead() { if (!mRequestHead) mRequestHead = new nsHttpRequestHead(); return mRequestHead; } nsresult Http2PushTransactionBuffer::TakeSubTransactions( - nsTArray > &outTransactions) { + nsTArray >& outTransactions) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -438,8 +438,8 @@ void Http2PushTransactionBuffer::Close(nsresult reason) { mIsDone = true; } -nsresult Http2PushTransactionBuffer::GetBufferedData(char *buf, uint32_t count, - uint32_t *countWritten) { +nsresult Http2PushTransactionBuffer::GetBufferedData(char* buf, uint32_t count, + uint32_t* countWritten) { *countWritten = std::min(count, static_cast(Available())); if (*countWritten) { memcpy(buf, &mBufferedHTTP1[mBufferedHTTP1Consumed], *countWritten); diff --git a/netwerk/protocol/http/Http2Push.h b/netwerk/protocol/http/Http2Push.h index a94331697eac4..6a959557b62a2 100644 --- a/netwerk/protocol/http/Http2Push.h +++ b/netwerk/protocol/http/Http2Push.h @@ -28,8 +28,8 @@ class Http2PushTransactionBuffer; class Http2PushedStream final : public Http2Stream { public: - Http2PushedStream(Http2PushTransactionBuffer *aTransaction, - Http2Session *aSession, Http2Stream *aAssociatedStream, + Http2PushedStream(Http2PushTransactionBuffer* aTransaction, + Http2Session* aSession, Http2Stream* aAssociatedStream, uint32_t aID, uint64_t aCurrentForegroundTabOuterContentWindowId); virtual ~Http2PushedStream() = default; @@ -37,23 +37,23 @@ class Http2PushedStream final : public Http2Stream { bool GetPushComplete(); // The consumer stream is the synthetic pull stream hooked up to this push - virtual Http2Stream *GetConsumerStream() override { return mConsumerStream; }; + virtual Http2Stream* GetConsumerStream() override { return mConsumerStream; }; - void SetConsumerStream(Http2Stream *aStream); - MOZ_MUST_USE bool GetHashKey(nsCString &key); + void SetConsumerStream(Http2Stream* aStream); + MOZ_MUST_USE bool GetHashKey(nsCString& key); // override of Http2Stream - MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, - uint32_t *) override; - MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, - uint32_t *) override; + MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader*, uint32_t, + uint32_t*) override; + MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter*, uint32_t, + uint32_t*) override; void AdjustInitialWindow() override; - nsIRequestContext *RequestContext() override { return mRequestContext; }; - void ConnectPushedStream(Http2Stream *consumer); + nsIRequestContext* RequestContext() override { return mRequestContext; }; + void ConnectPushedStream(Http2Stream* consumer); MOZ_MUST_USE bool TryOnPush(); - static MOZ_MUST_USE bool TestOnPush(Http2Stream *consumer); + static MOZ_MUST_USE bool TestOnPush(Http2Stream* consumer); virtual bool DeferCleanup(nsresult status) override; void SetDeferCleanupOnSuccess(bool val) { mDeferCleanupOnSuccess = val; } @@ -64,26 +64,26 @@ class Http2PushedStream final : public Http2Stream { mOnPushFailed = true; } - MOZ_MUST_USE nsresult GetBufferedData(char *buf, uint32_t count, - uint32_t *countWritten); + MOZ_MUST_USE nsresult GetBufferedData(char* buf, uint32_t count, + uint32_t* countWritten); // overload of Http2Stream virtual bool HasSink() override { return !!mConsumerStream; } virtual void SetPushComplete() override { mPushCompleted = true; } virtual void TopLevelOuterContentWindowIdChanged(uint64_t) override; - nsCString &GetRequestString() { return mRequestString; } + nsCString& GetRequestString() { return mRequestString; } private: - Http2Stream - *mConsumerStream; // paired request stream that consumes from - // real http/2 one.. null until a match is made. + Http2Stream* + mConsumerStream; // paired request stream that consumes from + // real http/2 one.. null until a match is made. nsCOMPtr mRequestContext; - nsAHttpTransaction *mAssociatedTransaction; + nsAHttpTransaction* mAssociatedTransaction; - Http2PushTransactionBuffer *mBufferedPush; + Http2PushTransactionBuffer* mBufferedPush; mozilla::TimeStamp mLastRead; nsCString mHashKey; @@ -111,9 +111,9 @@ class Http2PushTransactionBuffer final : public nsAHttpTransaction { Http2PushTransactionBuffer(); - MOZ_MUST_USE nsresult GetBufferedData(char *buf, uint32_t count, - uint32_t *countWritten); - void SetPushStream(Http2PushedStream *stream) { mPushStream = stream; } + MOZ_MUST_USE nsresult GetBufferedData(char* buf, uint32_t count, + uint32_t* countWritten); + void SetPushStream(Http2PushedStream* stream) { mPushStream = stream; } private: virtual ~Http2PushTransactionBuffer(); @@ -122,8 +122,8 @@ class Http2PushTransactionBuffer final : public nsAHttpTransaction { const static uint32_t kDefaultBufferSize = 4096; nsresult mStatus; - nsHttpRequestHead *mRequestHead; - Http2PushedStream *mPushStream; + nsHttpRequestHead* mRequestHead; + Http2PushedStream* mPushStream; bool mIsDone; UniquePtr mBufferedHTTP1; diff --git a/netwerk/protocol/http/Http2Session.cpp b/netwerk/protocol/http/Http2Session.cpp index a374f3c9a2f93..c40a2845daae4 100644 --- a/netwerk/protocol/http/Http2Session.cpp +++ b/netwerk/protocol/http/Http2Session.cpp @@ -58,7 +58,7 @@ const uint8_t Http2Session::kMagicHello[] = { 0x50, 0x52, 0x49, 0x20, 0x2a, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x32, 0x2e, 0x30, 0x0d, 0x0a, 0x0d, 0x0a, 0x53, 0x4d, 0x0d, 0x0a, 0x0d, 0x0a}; -Http2Session::Http2Session(nsISocketTransport *aSocketTransport, +Http2Session::Http2Session(nsISocketTransport* aSocketTransport, enum SpdyVersion version, bool attemptingEarlyData) : mSocketTransport(aSocketTransport), mSegmentReader(nullptr), @@ -153,7 +153,7 @@ Http2Session::Http2Session(nsISocketTransport *aSocketTransport, void Http2Session::Shutdown() { for (auto iter = mStreamTransactionHash.Iter(); !iter.Done(); iter.Next()) { - nsAutoPtr &stream = iter.Data(); + nsAutoPtr& stream = iter.Data(); // On a clean server hangup the server sets the GoAwayID to be the ID of // the last transaction it processed. If the ID of stream in the @@ -210,8 +210,8 @@ inline nsresult Http2Session::SessionError(enum errorType reason) { return NS_ERROR_NET_HTTP2_SENT_GOAWAY; } -void Http2Session::LogIO(Http2Session *self, Http2Stream *stream, - const char *label, const char *data, +void Http2Session::LogIO(Http2Session* self, Http2Stream* stream, + const char* label, const char* data, uint32_t datalen) { if (!LOG5_ENABLED()) return; @@ -221,7 +221,7 @@ void Http2Session::LogIO(Http2Session *self, Http2Stream *stream, // Max line is (16 * 3) + 10(prefix) + newline + null char linebuf[128]; uint32_t index; - char *line = linebuf; + char* line = linebuf; linebuf[127] = 0; @@ -236,7 +236,7 @@ void Http2Session::LogIO(Http2Session *self, Http2Stream *stream, line += 10; } snprintf(line, 128 - (line - linebuf), "%02X ", - (reinterpret_cast(data))[index]); + (reinterpret_cast(data))[index]); line += 3; } if (index) { @@ -245,7 +245,7 @@ void Http2Session::LogIO(Http2Session *self, Http2Stream *stream, } } -typedef nsresult (*Http2ControlFx)(Http2Session *self); +typedef nsresult (*Http2ControlFx)(Http2Session* self); static Http2ControlFx sControlFunctions[] = { nullptr, // type 0 data is not a control function Http2Session::RecvHeaders, @@ -334,13 +334,13 @@ uint32_t Http2Session::ReadTimeoutTick(PRIntervalTime now) { // Check for orphaned push streams. This looks expensive, but generally the // list is empty. - Http2PushedStream *deleteMe; + Http2PushedStream* deleteMe; TimeStamp timestampNow; do { deleteMe = nullptr; for (uint32_t index = mPushedStreams.Length(); index > 0; --index) { - Http2PushedStream *pushedStream = mPushedStreams[index - 1]; + Http2PushedStream* pushedStream = mPushedStreams[index - 1]; if (timestampNow.IsNull()) timestampNow = TimeStamp::Now(); // lazy initializer @@ -361,7 +361,7 @@ uint32_t Http2Session::ReadTimeoutTick(PRIntervalTime now) { return 1; // run the tick aggressively while ping is outstanding } -uint32_t Http2Session::RegisterStreamID(Http2Stream *stream, uint32_t aNewID) { +uint32_t Http2Session::RegisterStreamID(Http2Stream* stream, uint32_t aNewID) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(mNextStreamID < 0xfffffff0, "should have stopped admitting streams"); @@ -423,10 +423,10 @@ uint32_t Http2Session::RegisterStreamID(Http2Stream *stream, uint32_t aNewID) { return aNewID; } -bool Http2Session::AddStream(nsAHttpTransaction *aHttpTransaction, +bool Http2Session::AddStream(nsAHttpTransaction* aHttpTransaction, int32_t aPriority, bool aUseTunnel, bool aIsWebsocket, - nsIInterfaceRequestor *aCallbacks) { + nsIInterfaceRequestor* aCallbacks) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); // integrity check @@ -447,7 +447,7 @@ bool Http2Session::AddStream(nsAHttpTransaction *aHttpTransaction, } if (mClosed || mShouldGoAway) { - nsHttpTransaction *trans = aHttpTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = aHttpTransaction->QueryHttpTransaction(); if (trans && !trans->GetPushedStream()) { LOG3( ("Http2Session::AddStream %p atrans=%p trans=%p session unusable - " @@ -470,7 +470,7 @@ bool Http2Session::AddStream(nsAHttpTransaction *aHttpTransaction, if (aIsWebsocket) { MOZ_ASSERT(!aUseTunnel, "Websocket on tunnel?!"); - nsHttpTransaction *trans = aHttpTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = aHttpTransaction->QueryHttpTransaction(); MOZ_ASSERT(trans, "Websocket without transaction?!"); if (!trans) { LOG3(("Http2Session::AddStream %p websocket without transaction. WAT?!", @@ -539,7 +539,7 @@ bool Http2Session::AddStream(nsAHttpTransaction *aHttpTransaction, return true; } - Http2Stream *stream = + Http2Stream* stream = new Http2Stream(aHttpTransaction, this, aPriority, mCurrentForegroundTabOuterContentWindowId); @@ -570,7 +570,7 @@ bool Http2Session::AddStream(nsAHttpTransaction *aHttpTransaction, return true; } -void Http2Session::QueueStream(Http2Stream *stream) { +void Http2Session::QueueStream(Http2Stream* stream) { // will be removed via processpending or a shutdown path MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(!stream->CountAsActive()); @@ -581,8 +581,8 @@ void Http2Session::QueueStream(Http2Stream *stream) { #ifdef DEBUG int32_t qsize = mQueuedStreams.GetSize(); for (int32_t i = 0; i < qsize; i++) { - Http2Stream *qStream = - static_cast(mQueuedStreams.ObjectAt(i)); + Http2Stream* qStream = + static_cast(mQueuedStreams.ObjectAt(i)); MOZ_ASSERT(qStream != stream); MOZ_ASSERT(qStream->Queued()); } @@ -595,9 +595,9 @@ void Http2Session::QueueStream(Http2Stream *stream) { void Http2Session::ProcessPending() { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - Http2Stream *stream; + Http2Stream* stream; while (RoomForMoreConcurrent() && - (stream = static_cast(mQueuedStreams.PopFront()))) { + (stream = static_cast(mQueuedStreams.PopFront()))) { LOG3(("Http2Session::ProcessPending %p stream %p woken from queue.", this, stream)); MOZ_ASSERT(!stream->CountAsActive()); @@ -608,8 +608,8 @@ void Http2Session::ProcessPending() { } } -nsresult Http2Session::NetworkRead(nsAHttpSegmentWriter *writer, char *buf, - uint32_t count, uint32_t *countWritten) { +nsresult Http2Session::NetworkRead(nsAHttpSegmentWriter* writer, char* buf, + uint32_t count, uint32_t* countWritten) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); if (!count) { @@ -740,7 +740,7 @@ void Http2Session::ResetDownstreamState() { // return true if activated (and counted against max) // otherwise return false and queue -bool Http2Session::TryToActivate(Http2Stream *aStream) { +bool Http2Session::TryToActivate(Http2Stream* aStream) { if (aStream->Queued()) { LOG3(("Http2Session::TryToActivate %p stream=%p already queued.\n", this, aStream)); @@ -761,12 +761,12 @@ bool Http2Session::TryToActivate(Http2Stream *aStream) { return true; } -void Http2Session::IncrementConcurrent(Http2Stream *stream) { +void Http2Session::IncrementConcurrent(Http2Stream* stream) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(!stream->StreamID() || (stream->StreamID() & 1), "Do not activate pushed streams"); - nsAHttpTransaction *trans = stream->Transaction(); + nsAHttpTransaction* trans = stream->Transaction(); if (!trans || !trans->IsNullTransaction() || trans->QuerySpdyConnectTransaction()) { MOZ_ASSERT(!stream->CountAsActive()); @@ -803,7 +803,7 @@ void Http2Session::CreateFrameHeader(charType dest, uint16_t frameLength, NetworkEndian::writeUint32(dest + 5, streamID); } -char *Http2Session::EnsureOutputBuffer(uint32_t spaceNeeded) { +char* Http2Session::EnsureOutputBuffer(uint32_t spaceNeeded) { // this is an infallible allocation (if an allocation is // needed, which is probably isn't) EnsureBuffer(mOutputQueueBuffer, mOutputQueueUsed + spaceNeeded, @@ -811,18 +811,18 @@ char *Http2Session::EnsureOutputBuffer(uint32_t spaceNeeded) { return mOutputQueueBuffer.get() + mOutputQueueUsed; } -template void Http2Session::CreateFrameHeader(char *dest, uint16_t frameLength, +template void Http2Session::CreateFrameHeader(char* dest, uint16_t frameLength, uint8_t frameType, uint8_t frameFlags, uint32_t streamID); -template void Http2Session::CreateFrameHeader(uint8_t *dest, +template void Http2Session::CreateFrameHeader(uint8_t* dest, uint16_t frameLength, uint8_t frameType, uint8_t frameFlags, uint32_t streamID); -void Http2Session::MaybeDecrementConcurrent(Http2Stream *aStream) { +void Http2Session::MaybeDecrementConcurrent(Http2Stream* aStream) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("MaybeDecrementConcurrent %p id=0x%X concurrent=%d active=%d\n", this, aStream->StreamID(), mConcurrent, aStream->CountAsActive())); @@ -842,7 +842,7 @@ nsresult Http2Session::UncompressAndDiscard(bool isPush) { nsAutoCString trash; rv = mDecompressor.DecodeHeaderBlock( - reinterpret_cast(mDecompressBuffer.BeginReading()), + reinterpret_cast(mDecompressBuffer.BeginReading()), mDecompressBuffer.Length(), trash, isPush); mDecompressBuffer.Truncate(); if (NS_FAILED(rv)) { @@ -857,7 +857,7 @@ void Http2Session::GeneratePing(bool isAck) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::GeneratePing %p isAck=%d\n", this, isAck)); - char *packet = EnsureOutputBuffer(kFrameHeaderBytes + 8); + char* packet = EnsureOutputBuffer(kFrameHeaderBytes + 8); mOutputQueueUsed += kFrameHeaderBytes + 8; if (isAck) { @@ -878,7 +878,7 @@ void Http2Session::GenerateSettingsAck() { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::GenerateSettingsAck %p\n", this)); - char *packet = EnsureOutputBuffer(kFrameHeaderBytes); + char* packet = EnsureOutputBuffer(kFrameHeaderBytes); mOutputQueueUsed += kFrameHeaderBytes; CreateFrameHeader(packet, 0, FRAME_TYPE_SETTINGS, kFlag_ACK, 0); LogIO(this, nullptr, "Generate Settings ACK", packet, kFrameHeaderBytes); @@ -890,7 +890,7 @@ void Http2Session::GeneratePriority(uint32_t aID, uint8_t aPriorityWeight) { LOG3(("Http2Session::GeneratePriority %p %X %X\n", this, aID, aPriorityWeight)); - char *packet = CreatePriorityFrame(aID, 0, aPriorityWeight); + char* packet = CreatePriorityFrame(aID, 0, aPriorityWeight); LogIO(this, nullptr, "Generate Priority", packet, kFrameHeaderBytes + 5); FlushOutputQueue(); @@ -901,7 +901,7 @@ void Http2Session::GenerateRstStream(uint32_t aStatusCode, uint32_t aID) { // make sure we don't do this twice for the same stream (at least if we // have a stream entry for it) - Http2Stream *stream = mStreamIDHash.Get(aID); + Http2Stream* stream = mStreamIDHash.Get(aID); if (stream) { if (stream->SentReset()) return; stream->SetSentReset(true); @@ -910,7 +910,7 @@ void Http2Session::GenerateRstStream(uint32_t aStatusCode, uint32_t aID) { LOG3(("Http2Session::GenerateRst %p 0x%X %d\n", this, aID, aStatusCode)); uint32_t frameSize = kFrameHeaderBytes + 4; - char *packet = EnsureOutputBuffer(frameSize); + char* packet = EnsureOutputBuffer(frameSize); mOutputQueueUsed += frameSize; CreateFrameHeader(packet, 4, FRAME_TYPE_RST_STREAM, 0, aID); @@ -926,7 +926,7 @@ void Http2Session::GenerateGoAway(uint32_t aStatusCode) { mClientGoAwayReason = aStatusCode; uint32_t frameSize = kFrameHeaderBytes + 8; - char *packet = EnsureOutputBuffer(frameSize); + char* packet = EnsureOutputBuffer(frameSize); mOutputQueueUsed += frameSize; CreateFrameHeader(packet, 8, FRAME_TYPE_GOAWAY, 0, 0); @@ -961,7 +961,7 @@ void Http2Session::SendHello() { kPriorityGroupCount * (kFrameHeaderBytes + 5); static const uint32_t maxDataLen = 24 + kFrameHeaderBytes + maxSettings * 6 + 13 + prioritySize; - char *packet = EnsureOutputBuffer(maxDataLen); + char* packet = EnsureOutputBuffer(maxDataLen); memcpy(packet, kMagicHello, 24); mOutputQueueUsed += 24; LogIO(this, nullptr, "Magic Connection Header", packet, 24); @@ -1085,16 +1085,16 @@ void Http2Session::SendPriorityFrame(uint32_t streamID, uint32_t dependsOn, "weight %d\n", this, streamID, dependsOn, weight)); - char *packet = CreatePriorityFrame(streamID, dependsOn, weight); + char* packet = CreatePriorityFrame(streamID, dependsOn, weight); LogIO(this, nullptr, "SendPriorityFrame", packet, kFrameHeaderBytes + 5); FlushOutputQueue(); } -char *Http2Session::CreatePriorityFrame(uint32_t streamID, uint32_t dependsOn, +char* Http2Session::CreatePriorityFrame(uint32_t streamID, uint32_t dependsOn, uint8_t weight) { MOZ_ASSERT(streamID, "Priority on stream 0"); - char *packet = EnsureOutputBuffer(kFrameHeaderBytes + 5); + char* packet = EnsureOutputBuffer(kFrameHeaderBytes + 5); CreateFrameHeader(packet, 5, FRAME_TYPE_PRIORITY, 0, streamID); mOutputQueueUsed += kFrameHeaderBytes + 5; NetworkEndian::writeUint32(packet + kFrameHeaderBytes, @@ -1104,8 +1104,8 @@ char *Http2Session::CreatePriorityFrame(uint32_t streamID, uint32_t dependsOn, } void Http2Session::CreatePriorityNode(uint32_t streamID, uint32_t dependsOn, - uint8_t weight, const char *label) { - char *packet = CreatePriorityFrame(streamID, dependsOn, weight); + uint8_t weight, const char* label) { + char* packet = CreatePriorityFrame(streamID, dependsOn, weight); LOG3( ("Http2Session %p generate Priority Frame 0x%X depends on 0x%X " @@ -1116,7 +1116,7 @@ void Http2Session::CreatePriorityNode(uint32_t streamID, uint32_t dependsOn, // perform a bunch of integrity checks on the stream. // returns true if passed, false (plus LOG and ABORT) if failed. -bool Http2Session::VerifyStream(Http2Stream *aStream, +bool Http2Session::VerifyStream(Http2Stream* aStream, uint32_t aOptionalID = 0) { // This is annoying, but at least it is O(1) MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -1133,7 +1133,7 @@ bool Http2Session::VerifyStream(Http2Stream *aStream, do { if (aStream->StreamID() == kDeadStreamID) break; - nsAHttpTransaction *trans = aStream->Transaction(); + nsAHttpTransaction* trans = aStream->Transaction(); test++; if (!trans) break; @@ -1142,7 +1142,7 @@ bool Http2Session::VerifyStream(Http2Stream *aStream, if (mStreamTransactionHash.Get(trans) != aStream) break; if (aStream->StreamID()) { - Http2Stream *idStream = mStreamIDHash.Get(aStream->StreamID()); + Http2Stream* idStream = mStreamIDHash.Get(aStream->StreamID()); test++; if (idStream != aStream) break; @@ -1168,7 +1168,7 @@ bool Http2Session::VerifyStream(Http2Stream *aStream, #endif // DEBUG } -void Http2Session::CleanupStream(Http2Stream *aStream, nsresult aResult, +void Http2Session::CleanupStream(Http2Stream* aStream, nsresult aResult, errorType aResetCode) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::CleanupStream %p %p 0x%X %" PRIX32 "\n", this, aStream, @@ -1177,7 +1177,7 @@ void Http2Session::CleanupStream(Http2Stream *aStream, nsresult aResult, return; } - Http2PushedStream *pushSource = aStream->PushSource(); + Http2PushedStream* pushSource = aStream->PushSource(); if (pushSource) { // aStream is a synthetic attached to an even push MOZ_ASSERT(pushSource->GetConsumerStream() == aStream); @@ -1214,17 +1214,17 @@ void Http2Session::CleanupStream(Http2Stream *aStream, nsresult aResult, mStreamIDHash.Remove(id); if (!(id & 1)) { mPushedStreams.RemoveElement(aStream); - Http2PushedStream *pushStream = static_cast(aStream); + Http2PushedStream* pushStream = static_cast(aStream); nsAutoCString hashKey; DebugOnly rv = pushStream->GetHashKey(hashKey); MOZ_ASSERT(rv); - nsIRequestContext *requestContext = aStream->RequestContext(); + nsIRequestContext* requestContext = aStream->RequestContext(); if (requestContext) { - SpdyPushCache *cache = requestContext->GetSpdyPushCache(); + SpdyPushCache* cache = requestContext->GetSpdyPushCache(); if (cache) { // Make sure the id of the stream in the push cache is the same // as the id of the stream we're cleaning up! See bug 1368080. - Http2PushedStream *trash = + Http2PushedStream* trash = cache->RemovePushedStreamHttp2ByID(hashKey, aStream->StreamID()); LOG3( ("Http2Session::CleanupStream %p aStream=%p pushStream=%p " @@ -1253,7 +1253,7 @@ void Http2Session::CleanupStream(Http2Stream *aStream, nsresult aResult, void Http2Session::CleanupStream(uint32_t aID, nsresult aResult, errorType aResetCode) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - Http2Stream *stream = mStreamIDHash.Get(aID); + Http2Stream* stream = mStreamIDHash.Get(aID); LOG3(("Http2Session::CleanupStream %p by ID 0x%X to stream %p\n", this, aID, stream)); if (!stream) { @@ -1262,22 +1262,22 @@ void Http2Session::CleanupStream(uint32_t aID, nsresult aResult, CleanupStream(stream, aResult, aResetCode); } -static void RemoveStreamFromQueue(Http2Stream *aStream, nsDeque &queue) { +static void RemoveStreamFromQueue(Http2Stream* aStream, nsDeque& queue) { size_t size = queue.GetSize(); for (size_t count = 0; count < size; ++count) { - Http2Stream *stream = static_cast(queue.PopFront()); + Http2Stream* stream = static_cast(queue.PopFront()); if (stream != aStream) queue.Push(stream); } } -void Http2Session::RemoveStreamFromQueues(Http2Stream *aStream) { +void Http2Session::RemoveStreamFromQueues(Http2Stream* aStream) { RemoveStreamFromQueue(aStream, mReadyForWrite); RemoveStreamFromQueue(aStream, mQueuedStreams); RemoveStreamFromQueue(aStream, mPushesReadyForRead); RemoveStreamFromQueue(aStream, mSlowConsumersReadyForRead); } -void Http2Session::CloseStream(Http2Stream *aStream, nsresult aResult) { +void Http2Session::CloseStream(Http2Stream* aStream, nsresult aResult) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::CloseStream %p %p 0x%x %" PRIX32 "\n", this, aStream, aStream->StreamID(), static_cast(aResult))); @@ -1311,11 +1311,11 @@ nsresult Http2Session::SetInputFrameDataStream(uint32_t streamID) { return NS_ERROR_UNEXPECTED; } -nsresult Http2Session::ParsePadding(uint8_t &paddingControlBytes, - uint16_t &paddingLength) { +nsresult Http2Session::ParsePadding(uint8_t& paddingControlBytes, + uint16_t& paddingLength) { if (mInputFrameFlags & kFlag_PADDED) { paddingLength = - *reinterpret_cast(&mInputFrameBuffer[kFrameHeaderBytes]); + *reinterpret_cast(&mInputFrameBuffer[kFrameHeaderBytes]); paddingControlBytes = 1; } else { paddingLength = 0; @@ -1335,7 +1335,7 @@ nsresult Http2Session::ParsePadding(uint8_t &paddingControlBytes, return NS_OK; } -nsresult Http2Session::RecvHeaders(Http2Session *self) { +nsresult Http2Session::RecvHeaders(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_HEADERS || self->mInputFrameType == FRAME_TYPE_CONTINUATION); @@ -1545,7 +1545,7 @@ nsresult Http2Session::ResponseHeadersComplete() { return NS_OK; } -nsresult Http2Session::RecvPriority(Http2Session *self) { +nsresult Http2Session::RecvPriority(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_PRIORITY); if (self->mInputFrameDataSize != 5) { @@ -1580,7 +1580,7 @@ nsresult Http2Session::RecvPriority(Http2Session *self) { return NS_OK; } -nsresult Http2Session::RecvRstStream(Http2Session *self) { +nsresult Http2Session::RecvRstStream(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_RST_STREAM); if (self->mInputFrameDataSize != 4) { @@ -1614,7 +1614,7 @@ nsresult Http2Session::RecvRstStream(Http2Session *self) { return NS_OK; } -nsresult Http2Session::RecvSettings(Http2Session *self) { +nsresult Http2Session::RecvSettings(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_SETTINGS); if (self->mInputFrameID) { @@ -1646,8 +1646,8 @@ nsresult Http2Session::RecvSettings(Http2Session *self) { } for (uint32_t index = 0; index < numEntries; ++index) { - uint8_t *setting = - reinterpret_cast(self->mInputFrameBuffer.get()) + + uint8_t* setting = + reinterpret_cast(self->mInputFrameBuffer.get()) + kFrameHeaderBytes + index * 6; uint16_t id = NetworkEndian::readUint16(setting); @@ -1727,7 +1727,7 @@ nsresult Http2Session::RecvSettings(Http2Session *self) { return NS_OK; } -nsresult Http2Session::RecvPushPromise(Http2Session *self) { +nsresult Http2Session::RecvPushPromise(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_PUSH_PROMISE || self->mInputFrameType == FRAME_TYPE_CONTINUATION); @@ -1800,7 +1800,7 @@ nsresult Http2Session::RecvPushPromise(Http2Session *self) { nsresult rv = self->SetInputFrameDataStream(associatedID); if (NS_FAILED(rv)) return rv; - Http2Stream *associatedStream = self->mInputFrameDataStream; + Http2Stream* associatedStream = self->mInputFrameDataStream; ++(self->mServerPushedResources); // Anytime we start using the high bit of stream ID (either client or server) @@ -1808,7 +1808,7 @@ nsresult Http2Session::RecvPushPromise(Http2Session *self) { if (promisedID >= kMaxStreamID) self->mShouldGoAway = true; bool resetStream = true; - SpdyPushCache *cache = nullptr; + SpdyPushCache* cache = nullptr; if (self->mShouldGoAway && !Http2PushedStream::TestOnPush(associatedStream)) { LOG3( @@ -1839,7 +1839,7 @@ nsresult Http2Session::RecvPushPromise(Http2Session *self) { self)); resetStream = false; } else { - nsIRequestContext *requestContext = associatedStream->RequestContext(); + nsIRequestContext* requestContext = associatedStream->RequestContext(); if (requestContext) { cache = requestContext->GetSpdyPushCache(); if (!cache) { @@ -1910,7 +1910,7 @@ nsresult Http2Session::RecvPushPromise(Http2Session *self) { RefPtr transactionBuffer = new Http2PushTransactionBuffer(); transactionBuffer->SetConnection(self); - Http2PushedStream *pushedStream = new Http2PushedStream( + Http2PushedStream* pushedStream = new Http2PushedStream( transactionBuffer, self, associatedStream, promisedID, self->mCurrentForegroundTabOuterContentWindowId); @@ -2072,7 +2072,7 @@ NS_IMPL_ISUPPORTS(Http2Session::CachePushCheckCallback, nsICacheEntryOpenCallback); Http2Session::CachePushCheckCallback::CachePushCheckCallback( - Http2Session *session, uint32_t promisedID, const nsACString &requestString) + Http2Session* session, uint32_t promisedID, const nsACString& requestString) : mPromisedID(promisedID) { mSession = session; mRequestHead.ParseHeaderSet(requestString.BeginReading()); @@ -2080,7 +2080,7 @@ Http2Session::CachePushCheckCallback::CachePushCheckCallback( NS_IMETHODIMP Http2Session::CachePushCheckCallback::OnCacheEntryCheck( - nsICacheEntry *entry, nsIApplicationCache *appCache, uint32_t *result) { + nsICacheEntry* entry, nsIApplicationCache* appCache, uint32_t* result) { MOZ_ASSERT(OnSocketThread(), "Not on socket thread?!"); // We never care to fully open the entry, since we won't actually use it. @@ -2229,13 +2229,13 @@ Http2Session::CachePushCheckCallback::OnCacheEntryCheck( NS_IMETHODIMP Http2Session::CachePushCheckCallback::OnCacheEntryAvailable( - nsICacheEntry *entry, bool isNew, nsIApplicationCache *appCache, + nsICacheEntry* entry, bool isNew, nsIApplicationCache* appCache, nsresult result) { // Nothing to do here, all the work is in OnCacheEntryCheck. return NS_OK; } -nsresult Http2Session::RecvPing(Http2Session *self) { +nsresult Http2Session::RecvPing(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_PING); LOG3(("Http2Session::RecvPing %p PING Flags 0x%X.", self, @@ -2265,7 +2265,7 @@ nsresult Http2Session::RecvPing(Http2Session *self) { return NS_OK; } -nsresult Http2Session::RecvGoAway(Http2Session *self) { +nsresult Http2Session::RecvGoAway(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_GOAWAY); if (self->mInputFrameDataSize < 8) { @@ -2299,7 +2299,7 @@ nsresult Http2Session::RecvGoAway(Http2Session *self) { // Do that after the enumerator completes to avoid the risk of // a restart event re-entrantly modifying this hash. Be sure not to restart // a pushed (even numbered) stream - nsAutoPtr &stream = iter.Data(); + nsAutoPtr& stream = iter.Data(); if ((stream->StreamID() > self->mGoAwayID && (stream->StreamID() & 1)) || !stream->HasRegisteredID()) { self->mGoAwayStreamsToRestart.Push(stream); @@ -2309,8 +2309,8 @@ nsresult Http2Session::RecvGoAway(Http2Session *self) { // Process the streams marked for deletion and restart. size_t size = self->mGoAwayStreamsToRestart.GetSize(); for (size_t count = 0; count < size; ++count) { - Http2Stream *stream = - static_cast(self->mGoAwayStreamsToRestart.PopFront()); + Http2Stream* stream = + static_cast(self->mGoAwayStreamsToRestart.PopFront()); if (self->mPeerGoAwayReason == HTTP_1_1_REQUIRED) { stream->Transaction()->DisableSpdy(); @@ -2326,8 +2326,8 @@ nsresult Http2Session::RecvGoAway(Http2Session *self) { // are not covered by the last-good id. size = self->mQueuedStreams.GetSize(); for (size_t count = 0; count < size; ++count) { - Http2Stream *stream = - static_cast(self->mQueuedStreams.PopFront()); + Http2Stream* stream = + static_cast(self->mQueuedStreams.PopFront()); MOZ_ASSERT(stream->Queued()); stream->SetQueued(false); if (self->mPeerGoAwayReason == HTTP_1_1_REQUIRED) { @@ -2347,7 +2347,7 @@ nsresult Http2Session::RecvGoAway(Http2Session *self) { return NS_OK; } -nsresult Http2Session::RecvWindowUpdate(Http2Session *self) { +nsresult Http2Session::RecvWindowUpdate(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_WINDOW_UPDATE); if (self->mInputFrameDataSize != 4) { @@ -2436,7 +2436,7 @@ nsresult Http2Session::RecvWindowUpdate(Http2Session *self) { iter.Next()) { MOZ_ASSERT(self->mServerSessionWindow > 0); - nsAutoPtr &stream = iter.Data(); + nsAutoPtr& stream = iter.Data(); if (!stream->BlockedOnRwin() || stream->ServerReceiveWindow() <= 0) { continue; } @@ -2455,7 +2455,7 @@ nsresult Http2Session::RecvWindowUpdate(Http2Session *self) { return NS_OK; } -nsresult Http2Session::RecvContinuation(Http2Session *self) { +nsresult Http2Session::RecvContinuation(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_CONTINUATION); MOZ_ASSERT(self->mInputFrameID); MOZ_ASSERT(self->mExpectedPushPromiseID || self->mExpectedHeaderID); @@ -2492,8 +2492,8 @@ nsresult Http2Session::RecvContinuation(Http2Session *self) { class UpdateAltSvcEvent : public Runnable { public: - UpdateAltSvcEvent(const nsCString &header, const nsCString &aOrigin, - nsHttpConnectionInfo *aCI, nsIInterfaceRequestor *callbacks) + UpdateAltSvcEvent(const nsCString& header, const nsCString& aOrigin, + nsHttpConnectionInfo* aCI, nsIInterfaceRequestor* callbacks) : Runnable("net::UpdateAltSvcEvent"), mHeader(header), mOrigin(aOrigin), @@ -2534,7 +2534,7 @@ class UpdateAltSvcEvent : public Runnable { // defines receipt of frame type 0x0A.. See AlternateSevices.h at least draft // -06 sec 4 as this is an extension, never generate protocol error - just // ignore problems -nsresult Http2Session::RecvAltSvc(Http2Session *self) { +nsresult Http2Session::RecvAltSvc(Http2Session* self) { MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_ALTSVC); LOG3(("Http2Session::RecvAltSvc %p Flags 0x%X id 0x%X\n", self, self->mInputFrameFlags, self->mInputFrameID)); @@ -2689,7 +2689,7 @@ nsresult Http2Session::RecvAltSvc(Http2Session *self) { return NS_OK; } -void Http2Session::Received421(nsHttpConnectionInfo *ci) { +void Http2Session::Received421(nsHttpConnectionInfo* ci) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::Recevied421 %p %d\n", this, mOriginFrameActivated)); if (!mOriginFrameActivated || !ci) { @@ -2703,7 +2703,7 @@ void Http2Session::Received421(nsHttpConnectionInfo *ci) { LOG3(("Http2Session::Received421 %p key %s removed\n", this, key.get())); } -nsresult Http2Session::RecvUnused(Http2Session *self) { +nsresult Http2Session::RecvUnused(Http2Session* self) { LOG3(("Http2Session %p unknown frame type %x ignored\n", self, self->mInputFrameType)); self->ResetDownstreamState(); @@ -2714,7 +2714,7 @@ nsresult Http2Session::RecvUnused(Http2Session *self) { // defines receipt of frame type 0x0b.. // http://httpwg.org/http-extensions/origin-frame.html as this is an extension, // never generate protocol error - just ignore problems -nsresult Http2Session::RecvOrigin(Http2Session *self) { +nsresult Http2Session::RecvOrigin(Http2Session* self) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(self->mInputFrameType == FRAME_TYPE_ORIGIN); LOG3(("Http2Session::RecvOrigin %p Flags 0x%X id 0x%X\n", self, @@ -2809,7 +2809,7 @@ nsresult Http2Session::RecvOrigin(Http2Session *self) { // of these methods //----------------------------------------------------------------------------- -void Http2Session::OnTransportStatus(nsITransport *aTransport, nsresult aStatus, +void Http2Session::OnTransportStatus(nsITransport* aTransport, nsresult aStatus, int64_t aProgress) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -2876,9 +2876,9 @@ void Http2Session::OnTransportStatus(nsITransport *aTransport, nsresult aStatus, // converted to http/2 data. Sometimes control data like window-update are // generated instead. -nsresult Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader, - uint32_t count, uint32_t *countRead, - bool *again) { +nsresult Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader* reader, + uint32_t count, uint32_t* countRead, + bool* again) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(!mSegmentReader || !reader || (mSegmentReader == reader), @@ -2902,7 +2902,7 @@ nsresult Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader, LOG3(("Http2Session::ReadSegments %p", this)); - Http2Stream *stream = static_cast(mReadyForWrite.PopFront()); + Http2Stream* stream = static_cast(mReadyForWrite.PopFront()); if (!stream) { LOG3(("Http2Session %p could not identify a stream to write; suspending.", this)); @@ -3036,8 +3036,8 @@ nsresult Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader, return rv; } -nsresult Http2Session::ReadSegments(nsAHttpSegmentReader *reader, - uint32_t count, uint32_t *countRead) { +nsresult Http2Session::ReadSegments(nsAHttpSegmentReader* reader, + uint32_t count, uint32_t* countRead) { bool again = false; return ReadSegmentsAgain(reader, count, countRead, &again); } @@ -3121,9 +3121,9 @@ nsresult Http2Session::ReadyToProcessDataFrame( // call stream->WriteSegments which can call this::OnWriteSegment to get the // data. It always gets full frames if they are part of the stream -nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, +nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten, bool *again) { + uint32_t* countWritten, bool* again) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::WriteSegments %p InternalState %X\n", this, @@ -3141,8 +3141,8 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, // If there are http transactions attached to a push stream with filled // buffers trigger that data pump here. This only reads from buffers (not the // network) so mDownstreamState doesn't matter. - Http2Stream *pushConnectedStream = - static_cast(mPushesReadyForRead.PopFront()); + Http2Stream* pushConnectedStream = + static_cast(mPushesReadyForRead.PopFront()); if (pushConnectedStream) { return ProcessConnectedPush(pushConnectedStream, writer, count, countWritten); @@ -3150,8 +3150,8 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, // feed gecko channels that previously stopped consuming data // only take data from stored buffers - Http2Stream *slowConsumer = - static_cast(mSlowConsumersReadyForRead.PopFront()); + Http2Stream* slowConsumer = + static_cast(mSlowConsumersReadyForRead.PopFront()); if (slowConsumer) { internalStateType savedState = mDownstreamState; mDownstreamState = NOT_USING_NETWORK; @@ -3209,9 +3209,9 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, mInputFrameDataSize)); return SessionError(PROTOCOL_ERROR); } - mInputFrameType = *reinterpret_cast(mInputFrameBuffer.get() + - kFrameLengthBytes); - mInputFrameFlags = *reinterpret_cast( + mInputFrameType = *reinterpret_cast(mInputFrameBuffer.get() + + kFrameLengthBytes); + mInputFrameFlags = *reinterpret_cast( mInputFrameBuffer.get() + kFrameLengthBytes + kFrameTypeBytes); mInputFrameID = NetworkEndian::readUint32(mInputFrameBuffer.get() + kFrameLengthBytes + @@ -3266,7 +3266,7 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, // Go through and re-start all of our transactions with h2 disabled. for (auto iter = mStreamTransactionHash.Iter(); !iter.Done(); iter.Next()) { - nsAutoPtr &stream = iter.Data(); + nsAutoPtr& stream = iter.Data(); stream->Transaction()->DisableSpdy(); CloseStream(stream, NS_ERROR_NET_RESET); } @@ -3324,7 +3324,7 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, ++mInputFrameDataRead; - char *control = &mInputFrameBuffer[kFrameHeaderBytes]; + char* control = &mInputFrameBuffer[kFrameHeaderBytes]; mPaddingLength = static_cast(*control); LOG3(("Http2Session::WriteSegments %p stream 0x%X mPaddingLength=%d", this, @@ -3380,7 +3380,7 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, } // mInputFrameDataStream is reset by ChangeDownstreamState - Http2Stream *stream = mInputFrameDataStream; + Http2Stream* stream = mInputFrameDataStream; ResetDownstreamState(); LOG3( ("Http2Session::WriteSegments cleanup stream on recv of rst " @@ -3485,7 +3485,7 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, mInputFrameDataRead += *countWritten; if (mInputFrameDataRead == mInputFrameDataSize) { - Http2Stream *streamToCleanup = nullptr; + Http2Stream* streamToCleanup = nullptr; if (mInputFrameFinal) { streamToCleanup = mInputFrameDataStream; } @@ -3499,7 +3499,7 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, // Pushed streams are special on padding-only final data frames. // See bug 1409570 comments 6-8 for details. streamToCleanup->SetPushComplete(); - Http2Stream *pushSink = streamToCleanup->GetConsumerStream(); + Http2Stream* pushSink = streamToCleanup->GetConsumerStream(); if (pushSink) { bool enqueueSink = true; for (auto s : mPushesReadyForRead) { @@ -3570,8 +3570,8 @@ nsresult Http2Session::WriteSegmentsAgain(nsAHttpSegmentWriter *writer, return rv; } -nsresult Http2Session::WriteSegments(nsAHttpSegmentWriter *writer, - uint32_t count, uint32_t *countWritten) { +nsresult Http2Session::WriteSegments(nsAHttpSegmentWriter* writer, + uint32_t count, uint32_t* countWritten) { bool again = false; return WriteSegmentsAgain(writer, count, countWritten, &again); } @@ -3641,10 +3641,10 @@ void Http2Session::SetFastOpenStatus(uint8_t aStatus) { } } -nsresult Http2Session::ProcessConnectedPush(Http2Stream *pushConnectedStream, - nsAHttpSegmentWriter *writer, +nsresult Http2Session::ProcessConnectedPush(Http2Stream* pushConnectedStream, + nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) { + uint32_t* countWritten) { LOG3(("Http2Session::ProcessConnectedPush %p 0x%X\n", this, pushConnectedStream->StreamID())); mSegmentWriter = writer; @@ -3673,10 +3673,10 @@ nsresult Http2Session::ProcessConnectedPush(Http2Stream *pushConnectedStream, return rv; } -nsresult Http2Session::ProcessSlowConsumer(Http2Stream *slowConsumer, - nsAHttpSegmentWriter *writer, +nsresult Http2Session::ProcessSlowConsumer(Http2Stream* slowConsumer, + nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) { + uint32_t* countWritten) { LOG3(("Http2Session::ProcessSlowConsumer %p 0x%X\n", this, slowConsumer->StreamID())); mSegmentWriter = writer; @@ -3706,7 +3706,7 @@ nsresult Http2Session::ProcessSlowConsumer(Http2Stream *slowConsumer, return rv; } -void Http2Session::UpdateLocalStreamWindow(Http2Stream *stream, +void Http2Session::UpdateLocalStreamWindow(Http2Stream* stream, uint32_t bytes) { if (!stream) // this is ok - it means there was a data frame for a rst stream return; @@ -3757,7 +3757,7 @@ void Http2Session::UpdateLocalStreamWindow(Http2Stream *stream, } // room for this packet needs to be ensured before calling this function - char *packet = mOutputQueueBuffer.get() + mOutputQueueUsed; + char* packet = mOutputQueueBuffer.get() + mOutputQueueUsed; mOutputQueueUsed += kFrameHeaderBytes + 4; MOZ_ASSERT(mOutputQueueUsed <= mOutputQueueSize); @@ -3799,7 +3799,7 @@ void Http2Session::UpdateLocalSessionWindow(uint32_t bytes) { } // room for this packet needs to be ensured before calling this function - char *packet = mOutputQueueBuffer.get() + mOutputQueueUsed; + char* packet = mOutputQueueBuffer.get() + mOutputQueueUsed; mOutputQueueUsed += kFrameHeaderBytes + 4; MOZ_ASSERT(mOutputQueueUsed <= mOutputQueueSize); @@ -3810,7 +3810,7 @@ void Http2Session::UpdateLocalSessionWindow(uint32_t bytes) { // dont flush here, this write can commonly be coalesced with others } -void Http2Session::UpdateLocalRwin(Http2Stream *stream, uint32_t bytes) { +void Http2Session::UpdateLocalRwin(Http2Stream* stream, uint32_t bytes) { // make sure there is room for 2 window updates even though // we may not generate any. EnsureOutputBuffer(2 * (kFrameHeaderBytes + 4)); @@ -3848,7 +3848,7 @@ void Http2Session::Close(nsresult aReason) { RefPtr httpTransaction = mWaitingWebsockets[i]; LOG3(("Http2Session::Close %p Re-queuing websocket.", this)); httpTransaction->SetConnection(nullptr); - nsHttpTransaction *trans = httpTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = httpTransaction->QueryHttpTransaction(); if (trans) { nsresult rv = gHttpHandler->InitiateTransaction(trans, trans->Priority()); @@ -3886,13 +3886,13 @@ void Http2Session::Close(nsresult aReason) { mSegmentWriter = nullptr; } -nsHttpConnectionInfo *Http2Session::ConnectionInfo() { +nsHttpConnectionInfo* Http2Session::ConnectionInfo() { RefPtr ci; GetConnectionInfo(getter_AddRefs(ci)); return ci.get(); } -void Http2Session::CloseTransaction(nsAHttpTransaction *aTransaction, +void Http2Session::CloseTransaction(nsAHttpTransaction* aTransaction, nsresult aResult) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::CloseTransaction %p %p %" PRIx32, this, aTransaction, @@ -3901,7 +3901,7 @@ void Http2Session::CloseTransaction(nsAHttpTransaction *aTransaction, // Generally this arrives as a cancel event from the connection manager. // need to find the stream and call CleanupStream() on it. - Http2Stream *stream = mStreamTransactionHash.Get(aTransaction); + Http2Stream* stream = mStreamTransactionHash.Get(aTransaction); if (!stream) { LOG3(("Http2Session::CloseTransaction %p %p %" PRIx32 " - not found.", this, aTransaction, static_cast(aResult))); @@ -3925,8 +3925,8 @@ void Http2Session::CloseTransaction(nsAHttpTransaction *aTransaction, // nsAHttpSegmentReader //----------------------------------------------------------------------------- -nsresult Http2Session::OnReadSegment(const char *buf, uint32_t count, - uint32_t *countRead) { +nsresult Http2Session::OnReadSegment(const char* buf, uint32_t count, + uint32_t* countRead) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); nsresult rv; @@ -4014,8 +4014,8 @@ nsresult Http2Session::CommitToSegmentSize(uint32_t count, // nsAHttpSegmentWriter //----------------------------------------------------------------------------- -nsresult Http2Session::OnWriteSegment(char *buf, uint32_t count, - uint32_t *countWritten) { +nsresult Http2Session::OnWriteSegment(char* buf, uint32_t count, + uint32_t* countWritten) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); nsresult rv; @@ -4123,28 +4123,28 @@ void Http2Session::SetNeedsCleanup() { ResetDownstreamState(); } -void Http2Session::ConnectPushedStream(Http2Stream *stream) { +void Http2Session::ConnectPushedStream(Http2Stream* stream) { mPushesReadyForRead.Push(stream); Unused << ForceRecv(); } -void Http2Session::ConnectSlowConsumer(Http2Stream *stream) { +void Http2Session::ConnectSlowConsumer(Http2Stream* stream) { LOG3(("Http2Session::ConnectSlowConsumer %p 0x%X\n", this, stream->StreamID())); mSlowConsumersReadyForRead.Push(stream); Unused << ForceRecv(); } -uint32_t Http2Session::FindTunnelCount(nsHttpConnectionInfo *aConnInfo) { +uint32_t Http2Session::FindTunnelCount(nsHttpConnectionInfo* aConnInfo) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); uint32_t rv = 0; mTunnelHash.Get(aConnInfo->HashKey(), &rv); return rv; } -void Http2Session::RegisterTunnel(Http2Stream *aTunnel) { +void Http2Session::RegisterTunnel(Http2Stream* aTunnel) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpConnectionInfo *ci = aTunnel->Transaction()->ConnectionInfo(); + nsHttpConnectionInfo* ci = aTunnel->Transaction()->ConnectionInfo(); uint32_t newcount = FindTunnelCount(ci) + 1; mTunnelHash.Remove(ci->HashKey()); mTunnelHash.Put(ci->HashKey(), newcount); @@ -4152,9 +4152,9 @@ void Http2Session::RegisterTunnel(Http2Stream *aTunnel) { aTunnel, newcount, ci->HashKey().get())); } -void Http2Session::UnRegisterTunnel(Http2Stream *aTunnel) { +void Http2Session::UnRegisterTunnel(Http2Stream* aTunnel) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpConnectionInfo *ci = aTunnel->Transaction()->ConnectionInfo(); + nsHttpConnectionInfo* ci = aTunnel->Transaction()->ConnectionInfo(); MOZ_ASSERT(FindTunnelCount(ci)); uint32_t newcount = FindTunnelCount(ci) - 1; mTunnelHash.Remove(ci->HashKey()); @@ -4165,9 +4165,9 @@ void Http2Session::UnRegisterTunnel(Http2Stream *aTunnel) { aTunnel, newcount, ci->HashKey().get())); } -void Http2Session::CreateTunnel(nsHttpTransaction *trans, - nsHttpConnectionInfo *ci, - nsIInterfaceRequestor *aCallbacks) { +void Http2Session::CreateTunnel(nsHttpTransaction* trans, + nsHttpConnectionInfo* ci, + nsIInterfaceRequestor* aCallbacks) { LOG(("Http2Session::CreateTunnel %p %p make new tunnel\n", this, trans)); // The connect transaction will hold onto the underlying http // transaction so that an auth created by the connect can be mappped @@ -4179,16 +4179,16 @@ void Http2Session::CreateTunnel(nsHttpTransaction *trans, AddStream(connectTrans, nsISupportsPriority::PRIORITY_NORMAL, false, false, nullptr); MOZ_ASSERT(rv); - Http2Stream *tunnel = mStreamTransactionHash.Get(connectTrans); + Http2Stream* tunnel = mStreamTransactionHash.Get(connectTrans); MOZ_ASSERT(tunnel); RegisterTunnel(tunnel); } -void Http2Session::DispatchOnTunnel(nsAHttpTransaction *aHttpTransaction, - nsIInterfaceRequestor *aCallbacks) { +void Http2Session::DispatchOnTunnel(nsAHttpTransaction* aHttpTransaction, + nsIInterfaceRequestor* aCallbacks) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpTransaction *trans = aHttpTransaction->QueryHttpTransaction(); - nsHttpConnectionInfo *ci = aHttpTransaction->ConnectionInfo(); + nsHttpTransaction* trans = aHttpTransaction->QueryHttpTransaction(); + nsHttpConnectionInfo* ci = aHttpTransaction->ConnectionInfo(); MOZ_ASSERT(trans); LOG3(("Http2Session::DispatchOnTunnel %p trans=%p", this, trans)); @@ -4224,9 +4224,9 @@ void Http2Session::DispatchOnTunnel(nsAHttpTransaction *aHttpTransaction, } // From ASpdySession -bool Http2Session::MaybeReTunnel(nsAHttpTransaction *aHttpTransaction) { +bool Http2Session::MaybeReTunnel(nsAHttpTransaction* aHttpTransaction) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpTransaction *trans = aHttpTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = aHttpTransaction->QueryHttpTransaction(); LOG(("Http2Session::MaybeReTunnel %p trans=%p\n", this, trans)); if (!trans || trans->TunnelProvider() != this) { // this isn't really one of our transactions. @@ -4247,7 +4247,7 @@ bool Http2Session::MaybeReTunnel(nsAHttpTransaction *aHttpTransaction) { return true; } - nsHttpConnectionInfo *ci = aHttpTransaction->ConnectionInfo(); + nsHttpConnectionInfo* ci = aHttpTransaction->ConnectionInfo(); LOG(("Http2Session:MaybeReTunnel %p %p count=%d limit %d\n", this, trans, FindTunnelCount(ci), gHttpHandler->MaxConnectionsPerOrigin())); if (FindTunnelCount(ci) >= gHttpHandler->MaxConnectionsPerOrigin()) { @@ -4260,9 +4260,9 @@ bool Http2Session::MaybeReTunnel(nsAHttpTransaction *aHttpTransaction) { return true; } -nsresult Http2Session::BufferOutput(const char *buf, uint32_t count, - uint32_t *countRead) { - nsAHttpSegmentReader *old = mSegmentReader; +nsresult Http2Session::BufferOutput(const char* buf, uint32_t count, + uint32_t* countRead) { + nsAHttpSegmentReader* old = mSegmentReader; mSegmentReader = nullptr; nsresult rv = OnReadSegment(buf, count, countRead); mSegmentReader = old; @@ -4270,7 +4270,7 @@ nsresult Http2Session::BufferOutput(const char *buf, uint32_t count, } bool // static -Http2Session::ALPNCallback(nsISupports *securityInfo) { +Http2Session::ALPNCallback(nsISupports* securityInfo) { nsCOMPtr ssl = do_QueryInterface(securityInfo); LOG3(("Http2Session::ALPNCallback sslsocketcontrol=%p\n", ssl.get())); if (ssl) { @@ -4375,14 +4375,14 @@ nsresult Http2Session::ConfirmTLSProfile() { // Modified methods of nsAHttpConnection //----------------------------------------------------------------------------- -void Http2Session::TransactionHasDataToWrite(nsAHttpTransaction *caller) { +void Http2Session::TransactionHasDataToWrite(nsAHttpTransaction* caller) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::TransactionHasDataToWrite %p trans=%p", this, caller)); // a trapped signal from the http transaction to the connection that // it is no longer blocked on read. - Http2Stream *stream = mStreamTransactionHash.Get(caller); + Http2Stream* stream = mStreamTransactionHash.Get(caller); if (!stream || !VerifyStream(stream)) { LOG3(("Http2Session::TransactionHasDataToWrite %p caller %p not found", this, caller)); @@ -4408,13 +4408,13 @@ void Http2Session::TransactionHasDataToWrite(nsAHttpTransaction *caller) { Unused << ForceSend(); } -void Http2Session::TransactionHasDataToRecv(nsAHttpTransaction *caller) { +void Http2Session::TransactionHasDataToRecv(nsAHttpTransaction* caller) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::TransactionHasDataToRecv %p trans=%p", this, caller)); // a signal from the http transaction to the connection that it will consume // more - Http2Stream *stream = mStreamTransactionHash.Get(caller); + Http2Stream* stream = mStreamTransactionHash.Get(caller); if (!stream || !VerifyStream(stream)) { LOG3(("Http2Session::TransactionHasDataToRecv %p caller %p not found", this, caller)); @@ -4426,7 +4426,7 @@ void Http2Session::TransactionHasDataToRecv(nsAHttpTransaction *caller) { ConnectSlowConsumer(stream); } -void Http2Session::TransactionHasDataToWrite(Http2Stream *stream) { +void Http2Session::TransactionHasDataToWrite(Http2Stream* stream) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG3(("Http2Session::TransactionHasDataToWrite %p stream=%p ID=0x%x", this, stream, stream->StreamID())); @@ -4438,9 +4438,9 @@ void Http2Session::TransactionHasDataToWrite(Http2Stream *stream) { bool Http2Session::IsPersistent() { return true; } -nsresult Http2Session::TakeTransport(nsISocketTransport **, - nsIAsyncInputStream **, - nsIAsyncOutputStream **) { +nsresult Http2Session::TakeTransport(nsISocketTransport**, + nsIAsyncInputStream**, + nsIAsyncOutputStream**) { MOZ_ASSERT(false, "TakeTransport of Http2Session"); return NS_ERROR_UNEXPECTED; } @@ -4457,7 +4457,7 @@ already_AddRefed Http2Session::HttpConnection() { return nullptr; } -void Http2Session::GetSecurityCallbacks(nsIInterfaceRequestor **aOut) { +void Http2Session::GetSecurityCallbacks(nsIInterfaceRequestor** aOut) { *aOut = nullptr; } @@ -4468,7 +4468,7 @@ void Http2Session::GetSecurityCallbacks(nsIInterfaceRequestor **aOut) { // TLSFilterTransaction TLS tunnel //----------------------------------------------------------------------------- -void Http2Session::SetConnection(nsAHttpConnection *) { +void Http2Session::SetConnection(nsAHttpConnection*) { // This is unexpected MOZ_ASSERT(false, "Http2Session::SetConnection()"); } @@ -4493,7 +4493,7 @@ void Http2Session::SetDNSWasRefreshed() { MOZ_ASSERT(false, "Http2Session::SetDNSWasRefreshed()"); } -nsHttpRequestHead *Http2Session::RequestHead() { +nsHttpRequestHead* Http2Session::RequestHead() { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(false, "Http2Session::RequestHead() " @@ -4504,7 +4504,7 @@ nsHttpRequestHead *Http2Session::RequestHead() { uint32_t Http2Session::Http1xTransactionCount() { return 0; } nsresult Http2Session::TakeSubTransactions( - nsTArray > &outTransactions) { + nsTArray >& outTransactions) { // Generally this cannot be done with http/2 as transactions are // started right away. @@ -4528,22 +4528,22 @@ nsresult Http2Session::TakeSubTransactions( // Pass through methods of nsAHttpConnection //----------------------------------------------------------------------------- -nsAHttpConnection *Http2Session::Connection() { +nsAHttpConnection* Http2Session::Connection() { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); return mConnection; } -nsresult Http2Session::OnHeadersAvailable(nsAHttpTransaction *transaction, - nsHttpRequestHead *requestHead, - nsHttpResponseHead *responseHead, - bool *reset) { +nsresult Http2Session::OnHeadersAvailable(nsAHttpTransaction* transaction, + nsHttpRequestHead* requestHead, + nsHttpResponseHead* responseHead, + bool* reset) { return mConnection->OnHeadersAvailable(transaction, requestHead, responseHead, reset); } bool Http2Session::IsReused() { return mConnection->IsReused(); } -nsresult Http2Session::PushBack(const char *buf, uint32_t len) { +nsresult Http2Session::PushBack(const char* buf, uint32_t len) { return mConnection->PushBack(buf, len); } @@ -4569,7 +4569,7 @@ void Http2Session::SendPing() { Unused << ResumeRecv(); } -bool Http2Session::TestOriginFrame(const nsACString &hostname, int32_t port) { +bool Http2Session::TestOriginFrame(const nsACString& hostname, int32_t port) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(mOriginFrameActivated); @@ -4580,7 +4580,7 @@ bool Http2Session::TestOriginFrame(const nsACString &hostname, int32_t port) { LOG3(("TestOriginFrame() hash.get %p %s %d\n", this, key.get(), rv)); if (!rv && ConnectionInfo()) { // the SNI is also implicitly in this list, so consult that too - nsHttpConnectionInfo *ci = ConnectionInfo(); + nsHttpConnectionInfo* ci = ConnectionInfo(); rv = nsCString(hostname).EqualsIgnoreCase(ci->Origin()) && (port == ci->OriginPort()); LOG3(("TestOriginFrame() %p sni test %d\n", this, rv)); @@ -4588,22 +4588,22 @@ bool Http2Session::TestOriginFrame(const nsACString &hostname, int32_t port) { return rv; } -bool Http2Session::TestJoinConnection(const nsACString &hostname, +bool Http2Session::TestJoinConnection(const nsACString& hostname, int32_t port) { return RealJoinConnection(hostname, port, true); } -bool Http2Session::JoinConnection(const nsACString &hostname, int32_t port) { +bool Http2Session::JoinConnection(const nsACString& hostname, int32_t port) { return RealJoinConnection(hostname, port, false); } -bool Http2Session::RealJoinConnection(const nsACString &hostname, int32_t port, +bool Http2Session::RealJoinConnection(const nsACString& hostname, int32_t port, bool justKidding) { if (!mConnection || mClosed || mShouldGoAway) { return false; } - nsHttpConnectionInfo *ci = ConnectionInfo(); + nsHttpConnectionInfo* ci = ConnectionInfo(); if (nsCString(hostname).EqualsIgnoreCase(ci->Origin()) && (port == ci->OriginPort())) { return true; @@ -4646,7 +4646,7 @@ bool Http2Session::RealJoinConnection(const nsACString &hostname, int32_t port, } // try all the coalescable versions we support. - const SpdyInformation *info = gHttpHandler->SpdyInfo(); + const SpdyInformation* info = gHttpHandler->SpdyInfo(); static_assert(SpdyInformation::kCount == 1, "assume 1 alpn version"); bool joinedReturn = false; if (info->ProtocolEnabled(0)) { @@ -4693,15 +4693,15 @@ void Http2Session::SetCleanShutdown(bool aCleanShutdown) { } void Http2Session::CreateWebsocketStream( - nsAHttpTransaction *aOriginalTransaction, - nsIInterfaceRequestor *aCallbacks) { + nsAHttpTransaction* aOriginalTransaction, + nsIInterfaceRequestor* aCallbacks) { LOG(("Http2Session::CreateWebsocketStream %p %p\n", this, aOriginalTransaction)); - nsHttpTransaction *trans = aOriginalTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = aOriginalTransaction->QueryHttpTransaction(); MOZ_ASSERT(trans); - nsHttpConnectionInfo *ci = aOriginalTransaction->ConnectionInfo(); + nsHttpConnectionInfo* ci = aOriginalTransaction->ConnectionInfo(); MOZ_ASSERT(ci); RefPtr connectTrans = new SpdyConnectTransaction( @@ -4742,7 +4742,7 @@ void Http2Session::ProcessWaitingWebsockets() { this)); httpTransaction->SetConnection(nullptr); httpTransaction->DisableSpdy(); - nsHttpTransaction *trans = httpTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = httpTransaction->QueryHttpTransaction(); if (trans) { nsresult rv = gHttpHandler->InitiateTransaction(trans, trans->Priority()); diff --git a/netwerk/protocol/http/Http2Session.h b/netwerk/protocol/http/Http2Session.h index d3be421ff12e8..78e4815e7f254 100644 --- a/netwerk/protocol/http/Http2Session.h +++ b/netwerk/protocol/http/Http2Session.h @@ -45,16 +45,16 @@ class Http2Session final : public ASpdySession, NS_DECL_NSAHTTPSEGMENTREADER NS_DECL_NSAHTTPSEGMENTWRITER - Http2Session(nsISocketTransport *, enum SpdyVersion version, + Http2Session(nsISocketTransport*, enum SpdyVersion version, bool attemptingEarlyData); - MOZ_MUST_USE bool AddStream(nsAHttpTransaction *, int32_t, bool, bool, - nsIInterfaceRequestor *) override; + MOZ_MUST_USE bool AddStream(nsAHttpTransaction*, int32_t, bool, bool, + nsIInterfaceRequestor*) override; bool CanReuse() override { return !mShouldGoAway && !mClosed; } bool RoomForMoreStreams() override; enum SpdyVersion SpdyVersion() override; - bool TestJoinConnection(const nsACString &hostname, int32_t port) override; - bool JoinConnection(const nsACString &hostname, int32_t port) override; + bool TestJoinConnection(const nsACString& hostname, int32_t port) override; + bool JoinConnection(const nsACString& hostname, int32_t port) override; // When the connection is active this is called up to once every 1 second // return the interval (in seconds) that the connection next wants to @@ -66,7 +66,7 @@ class Http2Session final : public ASpdySession, PRIntervalTime IdleTime() override; // Registering with a newID of 0 means pick the next available odd ID - uint32_t RegisterStreamID(Http2Stream *, uint32_t aNewID = 0); + uint32_t RegisterStreamID(Http2Stream*, uint32_t aNewID = 0); /* HTTP/2 framing @@ -192,40 +192,40 @@ class Http2Session final : public ASpdySession, }; const static uint8_t kPriorityGroupCount = 6; - static nsresult RecvHeaders(Http2Session *); - static nsresult RecvPriority(Http2Session *); - static nsresult RecvRstStream(Http2Session *); - static nsresult RecvSettings(Http2Session *); - static nsresult RecvPushPromise(Http2Session *); - static nsresult RecvPing(Http2Session *); - static nsresult RecvGoAway(Http2Session *); - static nsresult RecvWindowUpdate(Http2Session *); - static nsresult RecvContinuation(Http2Session *); - static nsresult RecvAltSvc(Http2Session *); - static nsresult RecvUnused(Http2Session *); - static nsresult RecvOrigin(Http2Session *); - - char *EnsureOutputBuffer(uint32_t needed); + static nsresult RecvHeaders(Http2Session*); + static nsresult RecvPriority(Http2Session*); + static nsresult RecvRstStream(Http2Session*); + static nsresult RecvSettings(Http2Session*); + static nsresult RecvPushPromise(Http2Session*); + static nsresult RecvPing(Http2Session*); + static nsresult RecvGoAway(Http2Session*); + static nsresult RecvWindowUpdate(Http2Session*); + static nsresult RecvContinuation(Http2Session*); + static nsresult RecvAltSvc(Http2Session*); + static nsresult RecvUnused(Http2Session*); + static nsresult RecvOrigin(Http2Session*); + + char* EnsureOutputBuffer(uint32_t needed); template void CreateFrameHeader(charType dest, uint16_t frameLength, uint8_t frameType, uint8_t frameFlags, uint32_t streamID); // For writing the data stream to LOG4 - static void LogIO(Http2Session *, Http2Stream *, const char *, const char *, + static void LogIO(Http2Session*, Http2Stream*, const char*, const char*, uint32_t); // overload of nsAHttpConnection - void TransactionHasDataToWrite(nsAHttpTransaction *) override; - void TransactionHasDataToRecv(nsAHttpTransaction *) override; + void TransactionHasDataToWrite(nsAHttpTransaction*) override; + void TransactionHasDataToRecv(nsAHttpTransaction*) override; // a similar version for Http2Stream - void TransactionHasDataToWrite(Http2Stream *); + void TransactionHasDataToWrite(Http2Stream*); // an overload of nsAHttpSegementReader virtual MOZ_MUST_USE nsresult CommitToSegmentSize(uint32_t size, bool forceCommitment) override; - MOZ_MUST_USE nsresult BufferOutput(const char *, uint32_t, uint32_t *); + MOZ_MUST_USE nsresult BufferOutput(const char*, uint32_t, uint32_t*); void FlushOutputQueue(); uint32_t AmountOfOutputBuffered() { return mOutputQueueUsed - mOutputQueueSent; @@ -233,22 +233,22 @@ class Http2Session final : public ASpdySession, uint32_t GetServerInitialStreamWindow() { return mServerInitialStreamWindow; } - MOZ_MUST_USE bool TryToActivate(Http2Stream *stream); - void ConnectPushedStream(Http2Stream *stream); - void ConnectSlowConsumer(Http2Stream *stream); + MOZ_MUST_USE bool TryToActivate(Http2Stream* stream); + void ConnectPushedStream(Http2Stream* stream); + void ConnectSlowConsumer(Http2Stream* stream); MOZ_MUST_USE nsresult ConfirmTLSProfile(); - static MOZ_MUST_USE bool ALPNCallback(nsISupports *securityInfo); + static MOZ_MUST_USE bool ALPNCallback(nsISupports* securityInfo); uint64_t Serial() { return mSerial; } - void PrintDiagnostics(nsCString &log) override; + void PrintDiagnostics(nsCString& log) override; // Streams need access to these uint32_t SendingChunkSize() { return mSendingChunkSize; } uint32_t PushAllowance() { return mPushAllowance; } - Http2Compressor *Compressor() { return &mCompressor; } - nsISocketTransport *SocketTransport() { return mSocketTransport; } + Http2Compressor* Compressor() { return &mCompressor; } + nsISocketTransport* SocketTransport() { return mSocketTransport; } int64_t ServerSessionWindow() { return mServerSessionWindow; } void DecrementServerSessionWindow(uint32_t bytes) { mServerSessionWindow -= bytes; @@ -256,21 +256,21 @@ class Http2Session final : public ASpdySession, uint32_t InitialRwin() { return mInitialRwin; } void SendPing() override; - MOZ_MUST_USE bool MaybeReTunnel(nsAHttpTransaction *) override; + MOZ_MUST_USE bool MaybeReTunnel(nsAHttpTransaction*) override; bool UseH2Deps() { return mUseH2Deps; } void SetCleanShutdown(bool) override; // overload of nsAHttpTransaction - MOZ_MUST_USE nsresult ReadSegmentsAgain(nsAHttpSegmentReader *, uint32_t, - uint32_t *, bool *) final; - MOZ_MUST_USE nsresult WriteSegmentsAgain(nsAHttpSegmentWriter *, uint32_t, - uint32_t *, bool *) final; + MOZ_MUST_USE nsresult ReadSegmentsAgain(nsAHttpSegmentReader*, uint32_t, + uint32_t*, bool*) final; + MOZ_MUST_USE nsresult WriteSegmentsAgain(nsAHttpSegmentWriter*, uint32_t, + uint32_t*, bool*) final; MOZ_MUST_USE bool Do0RTT() final { return true; } MOZ_MUST_USE nsresult Finish0RTT(bool aRestart, bool aAlpnChanged) final; void SetFastOpenStatus(uint8_t aStatus) final; // For use by an HTTP2Stream - void Received421(nsHttpConnectionInfo *ci); + void Received421(nsHttpConnectionInfo* ci); void SendPriorityFrame(uint32_t streamID, uint32_t dependsOn, uint8_t weight); void IncrementTrrCounter() { mTrrStreams++; } @@ -306,43 +306,42 @@ class Http2Session final : public ASpdySession, void GeneratePriority(uint32_t, uint8_t); void GenerateRstStream(uint32_t, uint32_t); void GenerateGoAway(uint32_t); - void CleanupStream(Http2Stream *, nsresult, errorType); + void CleanupStream(Http2Stream*, nsresult, errorType); void CleanupStream(uint32_t, nsresult, errorType); - void CloseStream(Http2Stream *, nsresult); + void CloseStream(Http2Stream*, nsresult); void SendHello(); - void RemoveStreamFromQueues(Http2Stream *); - MOZ_MUST_USE nsresult ParsePadding(uint8_t &, uint16_t &); + void RemoveStreamFromQueues(Http2Stream*); + MOZ_MUST_USE nsresult ParsePadding(uint8_t&, uint16_t&); void SetWriteCallbacks(); void RealignOutputQueue(); void ProcessPending(); - MOZ_MUST_USE nsresult ProcessConnectedPush(Http2Stream *, - nsAHttpSegmentWriter *, uint32_t, - uint32_t *); - MOZ_MUST_USE nsresult ProcessSlowConsumer(Http2Stream *, - nsAHttpSegmentWriter *, uint32_t, - uint32_t *); + MOZ_MUST_USE nsresult ProcessConnectedPush(Http2Stream*, + nsAHttpSegmentWriter*, uint32_t, + uint32_t*); + MOZ_MUST_USE nsresult ProcessSlowConsumer(Http2Stream*, nsAHttpSegmentWriter*, + uint32_t, uint32_t*); MOZ_MUST_USE nsresult SetInputFrameDataStream(uint32_t); - void CreatePriorityNode(uint32_t, uint32_t, uint8_t, const char *); - char *CreatePriorityFrame(uint32_t, uint32_t, uint8_t); - bool VerifyStream(Http2Stream *, uint32_t); + void CreatePriorityNode(uint32_t, uint32_t, uint8_t, const char*); + char* CreatePriorityFrame(uint32_t, uint32_t, uint8_t); + bool VerifyStream(Http2Stream*, uint32_t); void SetNeedsCleanup(); - void UpdateLocalRwin(Http2Stream *stream, uint32_t bytes); - void UpdateLocalStreamWindow(Http2Stream *stream, uint32_t bytes); + void UpdateLocalRwin(Http2Stream* stream, uint32_t bytes); + void UpdateLocalStreamWindow(Http2Stream* stream, uint32_t bytes); void UpdateLocalSessionWindow(uint32_t bytes); - void MaybeDecrementConcurrent(Http2Stream *stream); + void MaybeDecrementConcurrent(Http2Stream* stream); bool RoomForMoreConcurrent(); - void IncrementConcurrent(Http2Stream *stream); - void QueueStream(Http2Stream *stream); + void IncrementConcurrent(Http2Stream* stream); + void QueueStream(Http2Stream* stream); // a wrapper for all calls to the nshttpconnection level segment writer. Used // to track network I/O for timeout purposes - MOZ_MUST_USE nsresult NetworkRead(nsAHttpSegmentWriter *, char *, uint32_t, - uint32_t *); + MOZ_MUST_USE nsresult NetworkRead(nsAHttpSegmentWriter*, char*, uint32_t, + uint32_t*); void Shutdown(); @@ -354,13 +353,13 @@ class Http2Session final : public ASpdySession, RefPtr mConnection; // The underlying socket transport object is needed to propogate some events - nsISocketTransport *mSocketTransport; + nsISocketTransport* mSocketTransport; // These are temporary state variables to hold the argument to // Read/WriteSegments so it can be accessed by On(read/write)segment // further up the stack. - nsAHttpSegmentReader *mSegmentReader; - nsAHttpSegmentWriter *mSegmentWriter; + nsAHttpSegmentReader* mSegmentReader; + nsAHttpSegmentWriter* mSegmentWriter; uint32_t mSendingChunkSize; /* the transmission chunk size */ uint32_t mNextStreamID; /* 24 bits */ @@ -377,7 +376,7 @@ class Http2Session final : public ASpdySession, // The objects are not ref counted - they get destroyed // by the nsClassHashtable implementation when they are removed from // the transaction hash. - nsDataHashtable mStreamIDHash; + nsDataHashtable mStreamIDHash; nsClassHashtable, Http2Stream> mStreamTransactionHash; @@ -385,7 +384,7 @@ class Http2Session final : public ASpdySession, nsDeque mQueuedStreams; nsDeque mPushesReadyForRead; nsDeque mSlowConsumersReadyForRead; - nsTArray mPushedStreams; + nsTArray mPushedStreams; // Compression contexts for header transport. // HTTP/2 compresses only HTTP headers and does not reset the context in @@ -419,14 +418,14 @@ class Http2Session final : public ASpdySession, // When a frame has been received that is addressed to a particular stream // (e.g. a data frame after the stream-id has been decoded), this points // to the stream. - Http2Stream *mInputFrameDataStream; + Http2Stream* mInputFrameDataStream; // mNeedsCleanup is a state variable to defer cleanup of a closed stream // If needed, It is set in session::OnWriteSegments() and acted on and // cleared when the stack returns to session::WriteSegments(). The stream // cannot be destroyed directly out of OnWriteSegments because // stream::writeSegments() is on the stack at that time. - Http2Stream *mNeedsCleanup; + Http2Stream* mNeedsCleanup; // This reason code in the last processed RESET frame uint32_t mDownstreamRstReason; @@ -553,8 +552,8 @@ class Http2Session final : public ASpdySession, // remember them put them into mReadyForWrite queue when 0RTT finishes. nsTArray> mCannotDo0RTTStreams; - bool RealJoinConnection(const nsACString &hostname, int32_t port, bool jk); - bool TestOriginFrame(const nsACString &name, int32_t port); + bool RealJoinConnection(const nsACString& hostname, int32_t port, bool jk); + bool TestOriginFrame(const nsACString& name, int32_t port); bool mOriginFrameActivated; nsDataHashtable mOriginFrame; @@ -564,8 +563,8 @@ class Http2Session final : public ASpdySession, class CachePushCheckCallback final : public nsICacheEntryOpenCallback { public: - CachePushCheckCallback(Http2Session *session, uint32_t promisedID, - const nsACString &requestString); + CachePushCheckCallback(Http2Session* session, uint32_t promisedID, + const nsACString& requestString); NS_DECL_ISUPPORTS NS_DECL_NSICACHEENTRYOPENCALLBACK @@ -591,17 +590,17 @@ class Http2Session final : public ASpdySession, private: /// connect tunnels - void DispatchOnTunnel(nsAHttpTransaction *, nsIInterfaceRequestor *); - void CreateTunnel(nsHttpTransaction *, nsHttpConnectionInfo *, - nsIInterfaceRequestor *); - void RegisterTunnel(Http2Stream *); - void UnRegisterTunnel(Http2Stream *); - uint32_t FindTunnelCount(nsHttpConnectionInfo *); + void DispatchOnTunnel(nsAHttpTransaction*, nsIInterfaceRequestor*); + void CreateTunnel(nsHttpTransaction*, nsHttpConnectionInfo*, + nsIInterfaceRequestor*); + void RegisterTunnel(Http2Stream*); + void UnRegisterTunnel(Http2Stream*); + uint32_t FindTunnelCount(nsHttpConnectionInfo*); nsDataHashtable mTunnelHash; uint32_t mTrrStreams; // websockets - void CreateWebsocketStream(nsAHttpTransaction *, nsIInterfaceRequestor *); + void CreateWebsocketStream(nsAHttpTransaction*, nsIInterfaceRequestor*); void ProcessWaitingWebsockets(); bool mEnableWebsockets; // Whether we allow websockets, based on a pref bool mPeerAllowsWebsockets; // Whether our peer allows websockets, based on diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index 79d5986efeb6f..ad7e6a49f5678 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -36,8 +36,8 @@ namespace mozilla { namespace net { -Http2Stream::Http2Stream(nsAHttpTransaction *httpTransaction, - Http2Session *session, int32_t priority, +Http2Stream::Http2Stream(nsAHttpTransaction* httpTransaction, + Http2Session* session, int32_t priority, uint64_t windowId) : mStreamID(0), mSession(session), @@ -79,7 +79,7 @@ Http2Stream::Http2Stream(nsAHttpTransaction *httpTransaction, mIsWebsocket(false) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpTransaction *trans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mTransaction->QueryHttpTransaction(); LOG1(("Http2Stream::Http2Stream %p trans=%p atrans=%p", this, trans, httpTransaction)); @@ -130,8 +130,8 @@ void Http2Stream::ClearPushSource() { // converted to HTTP/2 data. Sometimes control data like a window-update is // generated instead. -nsresult Http2Stream::ReadSegments(nsAHttpSegmentReader *reader, uint32_t count, - uint32_t *countRead) { +nsresult Http2Stream::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count, + uint32_t* countRead) { LOG3(("Http2Stream %p ReadSegments reader=%p count=%d state=%x", this, reader, count, mUpstreamState)); @@ -266,7 +266,7 @@ uint64_t Http2Stream::LocalUnAcked() { return mLocalUnacked - undelivered; } -nsresult Http2Stream::BufferInput(uint32_t count, uint32_t *countWritten) { +nsresult Http2Stream::BufferInput(uint32_t count, uint32_t* countWritten) { char buf[SimpleBufferPage::kSimpleBufferPageSize]; if (SimpleBufferPage::kSimpleBufferPageSize < count) { count = SimpleBufferPage::kSimpleBufferPageSize; @@ -295,8 +295,8 @@ bool Http2Stream::DeferCleanup(nsresult status) { // just a call through to the associated nsHttpTransaction for this stream // for the remaining data bytes indicated by the current DATA frame. -nsresult Http2Stream::WriteSegments(nsAHttpSegmentWriter *writer, - uint32_t count, uint32_t *countWritten) { +nsresult Http2Stream::WriteSegments(nsAHttpSegmentWriter* writer, + uint32_t count, uint32_t* countWritten) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(!mSegmentWriter, "segment writer in progress"); @@ -332,17 +332,17 @@ nsresult Http2Stream::WriteSegments(nsAHttpSegmentWriter *writer, return rv; } -nsresult Http2Stream::MakeOriginURL(const nsACString &origin, - nsCOMPtr &url) { +nsresult Http2Stream::MakeOriginURL(const nsACString& origin, + nsCOMPtr& url) { nsAutoCString scheme; nsresult rv = net_ExtractURLScheme(origin, scheme); NS_ENSURE_SUCCESS(rv, rv); return MakeOriginURL(scheme, origin, url); } -nsresult Http2Stream::MakeOriginURL(const nsACString &scheme, - const nsACString &origin, - nsCOMPtr &url) { +nsresult Http2Stream::MakeOriginURL(const nsACString& scheme, + const nsACString& origin, + nsCOMPtr& url) { return NS_MutateURI(new nsStandardURL::Mutator()) .Apply(NS_MutatorMethod( &nsIStandardURLMutator::Init, nsIStandardURL::URLTYPE_AUTHORITY, @@ -353,9 +353,9 @@ nsresult Http2Stream::MakeOriginURL(const nsACString &scheme, } void Http2Stream::CreatePushHashKey( - const nsCString &scheme, const nsCString &hostHeader, - const mozilla::OriginAttributes &originAttributes, uint64_t serial, - const nsACString &pathInfo, nsCString &outOrigin, nsCString &outKey) { + const nsCString& scheme, const nsCString& hostHeader, + const mozilla::OriginAttributes& originAttributes, uint64_t serial, + const nsACString& pathInfo, nsCString& outOrigin, nsCString& outKey) { nsCString fullOrigin = scheme; fullOrigin.AppendLiteral("://"); fullOrigin.Append(hostHeader); @@ -385,8 +385,8 @@ void Http2Stream::CreatePushHashKey( outKey.Append(pathInfo); } -nsresult Http2Stream::ParseHttpRequestHeaders(const char *buf, uint32_t avail, - uint32_t *countUsed) { +nsresult Http2Stream::ParseHttpRequestHeaders(const char* buf, uint32_t avail, + uint32_t* countUsed) { // Returns NS_OK even if the headers are incomplete // set mRequestHeadersDone flag if they are complete @@ -398,7 +398,7 @@ nsresult Http2Stream::ParseHttpRequestHeaders(const char *buf, uint32_t avail, avail, mUpstreamState)); mFlatHttpRequestHeaders.Append(buf, avail); - nsHttpRequestHead *head = mTransaction->RequestHead(); + nsHttpRequestHead* head = mTransaction->RequestHead(); // We can use the simple double crlf because firefox is the // only client we are parsing @@ -443,18 +443,18 @@ nsresult Http2Stream::ParseHttpRequestHeaders(const char *buf, uint32_t avail, // check the push cache for GET if (head->IsGet()) { // from :scheme, :authority, :path - nsIRequestContext *requestContext = mTransaction->RequestContext(); - SpdyPushCache *cache = nullptr; + nsIRequestContext* requestContext = mTransaction->RequestContext(); + SpdyPushCache* cache = nullptr; if (requestContext) { cache = requestContext->GetSpdyPushCache(); } - Http2PushedStream *pushedStream = nullptr; + Http2PushedStream* pushedStream = nullptr; // If a push stream is attached to the transaction via onPush, match only // with that one. This occurs when a push was made with in conjunction with // a nsIHttpPushListener - nsHttpTransaction *trans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mTransaction->QueryHttpTransaction(); if (trans && (pushedStream = trans->TakePushedStream())) { if (pushedStream->mSession == mSession) { LOG3(("Pushed Stream match based on OnPush correlation %p", @@ -517,7 +517,7 @@ nsresult Http2Stream::GenerateOpen() { mOpenGenerated = 1; - nsHttpRequestHead *head = mTransaction->RequestHead(); + nsHttpRequestHead* head = mTransaction->RequestHead(); nsAutoCString requestURI; head->RequestURI(requestURI); LOG3(("Http2Stream %p Stream ID 0x%X [session=%p] for URI %s\n", this, @@ -549,7 +549,7 @@ nsresult Http2Stream::GenerateOpen() { nsDependentCString scheme(head->IsHTTPS() ? "https" : "http"); if (head->IsConnect()) { - SpdyConnectTransaction *scTrans = + SpdyConnectTransaction* scTrans = mTransaction->QuerySpdyConnectTransaction(); MOZ_ASSERT(scTrans); if (scTrans->IsWebsocket()) { @@ -562,7 +562,7 @@ nsresult Http2Stream::GenerateOpen() { if (mIsTunnel) { // Our normal authority has an implicit port, best to use an // explicit one with a tunnel - nsHttpConnectionInfo *ci = mTransaction->ConnectionInfo(); + nsHttpConnectionInfo* ci = mTransaction->ConnectionInfo(); if (!ci) { return NS_ERROR_UNEXPECTED; } @@ -714,7 +714,7 @@ void Http2Stream::AdjustInitialWindow() { // >0 even numbered IDs are pushed streams. // odd numbered IDs are pulled streams. // 0 is the sink for a pushed stream. - Http2Stream *stream = this; + Http2Stream* stream = this; if (!mStreamID) { MOZ_ASSERT(mPushSource); if (!mPushSource) return; @@ -736,7 +736,7 @@ void Http2Stream::AdjustInitialWindow() { // bump it up to the pull limit set by the channel or session // don't allow windows less than push uint32_t bump = 0; - nsHttpTransaction *trans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mTransaction->QueryHttpTransaction(); if (trans && trans->InitialRwin()) { bump = (trans->InitialRwin() > mClientReceiveWindow) ? (trans->InitialRwin() - mClientReceiveWindow) @@ -755,7 +755,7 @@ void Http2Stream::AdjustInitialWindow() { EnsureBuffer(mTxInlineFrame, mTxInlineFrameUsed + Http2Session::kFrameHeaderBytes + 4, mTxInlineFrameUsed, mTxInlineFrameSize); - uint8_t *packet = mTxInlineFrame.get() + mTxInlineFrameUsed; + uint8_t* packet = mTxInlineFrame.get() + mTxInlineFrameUsed; mTxInlineFrameUsed += Http2Session::kFrameHeaderBytes + 4; mSession->CreateFrameHeader(packet, 4, Http2Session::FRAME_TYPE_WINDOW_UPDATE, @@ -784,7 +784,7 @@ void Http2Stream::AdjustPushedPriority() { EnsureBuffer(mTxInlineFrame, mTxInlineFrameUsed + Http2Session::kFrameHeaderBytes + 5, mTxInlineFrameUsed, mTxInlineFrameSize); - uint8_t *packet = mTxInlineFrame.get() + mTxInlineFrameUsed; + uint8_t* packet = mTxInlineFrame.get() + mTxInlineFrameUsed; mTxInlineFrameUsed += Http2Session::kFrameHeaderBytes + 5; mSession->CreateFrameHeader(packet, 5, Http2Session::FRAME_TYPE_PRIORITY, 0, @@ -840,7 +840,7 @@ void Http2Stream::UpdateTransportSendEvents(uint32_t count) { } } -nsresult Http2Stream::TransmitFrame(const char *buf, uint32_t *countUsed, +nsresult Http2Stream::TransmitFrame(const char* buf, uint32_t* countUsed, bool forceCommitment) { // If TransmitFrame returns SUCCESS than all the data is sent (or at least // buffered at the session level), if it returns WOULD_BLOCK then none of @@ -896,7 +896,7 @@ nsresult Http2Stream::TransmitFrame(const char *buf, uint32_t *countUsed, // which calls the socket write function. It will accept all of the inline and // stream data because of the above 'commitment' even if it has to buffer - rv = mSession->BufferOutput(reinterpret_cast(mTxInlineFrame.get()), + rv = mSession->BufferOutput(reinterpret_cast(mTxInlineFrame.get()), mTxInlineFrameUsed, &transmittedCount); LOG3( ("Http2Stream::TransmitFrame for inline BufferOutput session=%p " @@ -912,7 +912,7 @@ nsresult Http2Stream::TransmitFrame(const char *buf, uint32_t *countUsed, "inconsistent inline commitment count"); Http2Session::LogIO(mSession, this, "Writing from Inline Buffer", - reinterpret_cast(mTxInlineFrame.get()), + reinterpret_cast(mTxInlineFrame.get()), transmittedCount); if (mTxStreamFrameSize) { @@ -995,12 +995,12 @@ void Http2Stream::GenerateDataFrameHeader(uint32_t dataLength, bool lastFrame) { // ConvertResponseHeaders is used to convert the response headers // into HTTP/1 format and report some telemetry -nsresult Http2Stream::ConvertResponseHeaders(Http2Decompressor *decompressor, - nsACString &aHeadersIn, - nsACString &aHeadersOut, - int32_t &httpResponseCode) { +nsresult Http2Stream::ConvertResponseHeaders(Http2Decompressor* decompressor, + nsACString& aHeadersIn, + nsACString& aHeadersOut, + int32_t& httpResponseCode) { nsresult rv = decompressor->DecodeHeaderBlock( - reinterpret_cast(aHeadersIn.BeginReading()), + reinterpret_cast(aHeadersIn.BeginReading()), aHeadersIn.Length(), aHeadersOut, false); if (NS_FAILED(rv)) { LOG3(("Http2Stream::ConvertResponseHeaders %p decode Error\n", this)); @@ -1079,11 +1079,11 @@ nsresult Http2Stream::ConvertResponseHeaders(Http2Decompressor *decompressor, // ConvertPushHeaders is used to convert the pushed request headers // into HTTP/1 format and report some telemetry -nsresult Http2Stream::ConvertPushHeaders(Http2Decompressor *decompressor, - nsACString &aHeadersIn, - nsACString &aHeadersOut) { +nsresult Http2Stream::ConvertPushHeaders(Http2Decompressor* decompressor, + nsACString& aHeadersIn, + nsACString& aHeadersOut) { nsresult rv = decompressor->DecodeHeaderBlock( - reinterpret_cast(aHeadersIn.BeginReading()), + reinterpret_cast(aHeadersIn.BeginReading()), aHeadersIn.Length(), aHeadersOut, true); if (NS_FAILED(rv)) { LOG3(("Http2Stream::ConvertPushHeaders %p Error\n", this)); @@ -1119,20 +1119,20 @@ nsresult Http2Stream::ConvertPushHeaders(Http2Decompressor *decompressor, return NS_OK; } -nsresult Http2Stream::ConvertResponseTrailers(Http2Decompressor *decompressor, - nsACString &aTrailersIn) { +nsresult Http2Stream::ConvertResponseTrailers(Http2Decompressor* decompressor, + nsACString& aTrailersIn) { LOG3(("Http2Stream::ConvertResponseTrailers %p", this)); nsAutoCString flatTrailers; nsresult rv = decompressor->DecodeHeaderBlock( - reinterpret_cast(aTrailersIn.BeginReading()), + reinterpret_cast(aTrailersIn.BeginReading()), aTrailersIn.Length(), flatTrailers, false); if (NS_FAILED(rv)) { LOG3(("Http2Stream::ConvertResponseTrailers %p decode Error", this)); return rv; } - nsHttpTransaction *trans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mTransaction->QueryHttpTransaction(); if (trans) { trans->SetHttpTrailers(flatTrailers); } else { @@ -1152,7 +1152,7 @@ void Http2Stream::Close(nsresult reason) { } void Http2Stream::SetResponseIsComplete() { - nsHttpTransaction *trans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mTransaction->QueryHttpTransaction(); if (trans) { trans->SetResponseIsComplete(); } @@ -1211,7 +1211,7 @@ void Http2Stream::SetPriorityDependency(uint32_t newPriority, mPriorityDependency = newDependency; } -static uint32_t GetPriorityDependencyFromTransaction(nsHttpTransaction *trans) { +static uint32_t GetPriorityDependencyFromTransaction(nsHttpTransaction* trans) { MOZ_ASSERT(trans); uint32_t classFlags = trans->ClassOfService(); @@ -1248,7 +1248,7 @@ void Http2Stream::UpdatePriorityDependency() { return; } - nsHttpTransaction *trans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mTransaction->QueryHttpTransaction(); if (!trans) { return; } @@ -1330,7 +1330,7 @@ void Http2Stream::TopLevelOuterContentWindowIdChangedInternal( nsHttp::NotifyActiveTabLoadOptimization(); } else { - nsHttpTransaction *trans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mTransaction->QueryHttpTransaction(); if (!trans) { return; } @@ -1390,8 +1390,8 @@ void Http2Stream::SetSentReset(bool aStatus) { // nsAHttpSegmentReader //----------------------------------------------------------------------------- -nsresult Http2Stream::OnReadSegment(const char *buf, uint32_t count, - uint32_t *countRead) { +nsresult Http2Stream::OnReadSegment(const char* buf, uint32_t count, + uint32_t* countRead) { LOG3(("Http2Stream::OnReadSegment %p count=%d state=%x", this, count, mUpstreamState)); @@ -1539,8 +1539,8 @@ nsresult Http2Stream::OnReadSegment(const char *buf, uint32_t count, // nsAHttpSegmentWriter //----------------------------------------------------------------------------- -nsresult Http2Stream::OnWriteSegment(char *buf, uint32_t count, - uint32_t *countWritten) { +nsresult Http2Stream::OnWriteSegment(char* buf, uint32_t count, + uint32_t* countWritten) { LOG3(("Http2Stream::OnWriteSegment %p count=%d state=%x 0x%X\n", this, count, mUpstreamState, mStreamID)); @@ -1631,7 +1631,7 @@ nsresult Http2Stream::Finish0RTT(bool aRestart, bool aAlpnChanged) { // for devtools purposes nsresult rv = mTransaction->Finish0RTT(aAlpnChanged, aAlpnChanged); if (aRestart) { - nsHttpTransaction *trans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = mTransaction->QueryHttpTransaction(); if (trans) { trans->Refused0RTT(); } @@ -1639,7 +1639,7 @@ nsresult Http2Stream::Finish0RTT(bool aRestart, bool aAlpnChanged) { return rv; } -nsresult Http2Stream::GetOriginAttributes(mozilla::OriginAttributes *oa) { +nsresult Http2Stream::GetOriginAttributes(mozilla::OriginAttributes* oa) { if (!mSocketTransport) { return NS_ERROR_UNEXPECTED; } diff --git a/netwerk/protocol/http/Http2Stream.h b/netwerk/protocol/http/Http2Stream.h index bddff01292239..ebe9b4c3a3349 100644 --- a/netwerk/protocol/http/Http2Stream.h +++ b/netwerk/protocol/http/Http2Stream.h @@ -52,28 +52,28 @@ class Http2Stream : public nsAHttpSegmentReader, const static int32_t kBestPriority = kNormalPriority + nsISupportsPriority::PRIORITY_HIGHEST; - Http2Stream(nsAHttpTransaction *, Http2Session *, int32_t, uint64_t); + Http2Stream(nsAHttpTransaction*, Http2Session*, int32_t, uint64_t); uint32_t StreamID() { return mStreamID; } - Http2PushedStream *PushSource() { return mPushSource; } + Http2PushedStream* PushSource() { return mPushSource; } void ClearPushSource(); stateType HTTPState() { return mState; } void SetHTTPState(stateType val) { mState = val; } - virtual MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, - uint32_t *); - virtual MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, - uint32_t *); + virtual MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader*, uint32_t, + uint32_t*); + virtual MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter*, uint32_t, + uint32_t*); virtual bool DeferCleanup(nsresult status); // The consumer stream is the synthetic pull stream hooked up to this stream // http2PushedStream overrides it - virtual Http2Stream *GetConsumerStream() { return nullptr; }; + virtual Http2Stream* GetConsumerStream() { return nullptr; }; - const nsCString &Origin() const { return mOrigin; } - const nsCString &Host() const { return mHeaderHost; } - const nsCString &Path() const { return mHeaderPath; } + const nsCString& Origin() const { return mOrigin; } + const nsCString& Host() const { return mHeaderHost; } + const nsCString& Path() const { return mHeaderPath; } bool RequestBlockedOnRead() { return static_cast(mRequestBlockedOnRead); @@ -81,8 +81,8 @@ class Http2Stream : public nsAHttpSegmentReader, bool HasRegisteredID() { return mStreamID != 0; } - nsAHttpTransaction *Transaction() { return mTransaction; } - virtual nsIRequestContext *RequestContext() { + nsAHttpTransaction* Transaction() { return mTransaction; } + virtual nsIRequestContext* RequestContext() { return mTransaction ? mTransaction->RequestContext() : nullptr; } @@ -118,13 +118,12 @@ class Http2Stream : public nsAHttpSegmentReader, void UpdateTransportReadEvents(uint32_t count); // NS_ERROR_ABORT terminates stream, other failure terminates session - MOZ_MUST_USE nsresult ConvertResponseHeaders(Http2Decompressor *, - nsACString &, nsACString &, - int32_t &); - MOZ_MUST_USE nsresult ConvertPushHeaders(Http2Decompressor *, nsACString &, - nsACString &); - MOZ_MUST_USE nsresult ConvertResponseTrailers(Http2Decompressor *, - nsACString &); + MOZ_MUST_USE nsresult ConvertResponseHeaders(Http2Decompressor*, nsACString&, + nsACString&, int32_t&); + MOZ_MUST_USE nsresult ConvertPushHeaders(Http2Decompressor*, nsACString&, + nsACString&); + MOZ_MUST_USE nsresult ConvertResponseTrailers(Http2Decompressor*, + nsACString&); bool AllowFlowControlledWrite(); void UpdateServerReceiveWindow(int32_t delta); @@ -163,20 +162,20 @@ class Http2Stream : public nsAHttpSegmentReader, virtual ~Http2Stream(); - Http2Session *Session() { return mSession; } + Http2Session* Session() { return mSession; } - static MOZ_MUST_USE nsresult MakeOriginURL(const nsACString &origin, - nsCOMPtr &url); + static MOZ_MUST_USE nsresult MakeOriginURL(const nsACString& origin, + nsCOMPtr& url); - static MOZ_MUST_USE nsresult MakeOriginURL(const nsACString &scheme, - const nsACString &origin, - nsCOMPtr &url); + static MOZ_MUST_USE nsresult MakeOriginURL(const nsACString& scheme, + const nsACString& origin, + nsCOMPtr& url); // Mirrors nsAHttpTransaction bool Do0RTT(); nsresult Finish0RTT(bool aRestart, bool aAlpnIgnored); - nsresult GetOriginAttributes(mozilla::OriginAttributes *oa); + nsresult GetOriginAttributes(mozilla::OriginAttributes* oa); virtual void TopLevelOuterContentWindowIdChanged(uint64_t windowId); void TopLevelOuterContentWindowIdChangedInternal( @@ -184,9 +183,9 @@ class Http2Stream : public nsAHttpSegmentReader, protected: static void CreatePushHashKey( - const nsCString &scheme, const nsCString &hostHeader, - const mozilla::OriginAttributes &originAttributes, uint64_t serial, - const nsACString &pathInfo, nsCString &outOrigin, nsCString &outKey); + const nsCString& scheme, const nsCString& hostHeader, + const mozilla::OriginAttributes& originAttributes, uint64_t serial, + const nsACString& pathInfo, nsCString& outOrigin, nsCString& outKey); // These internal states track request generation enum upstreamStateType { @@ -200,13 +199,13 @@ class Http2Stream : public nsAHttpSegmentReader, uint32_t mStreamID; // The session that this stream is a subset of - Http2Session *mSession; + Http2Session* mSession; // These are temporary state variables to hold the argument to // Read/WriteSegments so it can be accessed by On(read/write)segment // further up the stack. - nsAHttpSegmentReader *mSegmentReader; - nsAHttpSegmentWriter *mSegmentWriter; + nsAHttpSegmentReader* mSegmentReader; + nsAHttpSegmentWriter* mSegmentWriter; nsCString mOrigin; nsCString mHeaderHost; @@ -237,11 +236,11 @@ class Http2Stream : public nsAHttpSegmentReader, void ChangeState(enum upstreamStateType); virtual void AdjustInitialWindow(); - MOZ_MUST_USE nsresult TransmitFrame(const char *, uint32_t *, + MOZ_MUST_USE nsresult TransmitFrame(const char*, uint32_t*, bool forceCommitment); // The underlying socket transport object is needed to propogate some events - nsISocketTransport *mSocketTransport; + nsISocketTransport* mSocketTransport; uint8_t mPriorityWeight; // h2 weight uint32_t mPriorityDependency; // h2 stream id this one depends on @@ -251,14 +250,14 @@ class Http2Stream : public nsAHttpSegmentReader, private: friend class nsAutoPtr; - MOZ_MUST_USE nsresult ParseHttpRequestHeaders(const char *, uint32_t, - uint32_t *); + MOZ_MUST_USE nsresult ParseHttpRequestHeaders(const char*, uint32_t, + uint32_t*); MOZ_MUST_USE nsresult GenerateOpen(); void AdjustPushedPriority(); void GenerateDataFrameHeader(uint32_t, bool); - MOZ_MUST_USE nsresult BufferInput(uint32_t, uint32_t *); + MOZ_MUST_USE nsresult BufferInput(uint32_t, uint32_t*); // The underlying HTTP transaction. This pointer is used as the key // in the Http2Session mStreamTransactionHash so it is important to @@ -355,7 +354,7 @@ class Http2Stream : public nsAHttpSegmentReader, uint64_t mTotalRead; // For Http2Push - Http2PushedStream *mPushSource; + Http2PushedStream* mPushSource; // Used to store stream data when the transaction channel cannot keep up // and flow control has not yet kicked in. diff --git a/netwerk/protocol/http/HttpAuthUtils.h b/netwerk/protocol/http/HttpAuthUtils.h index 4a1763a5bf4bf..c045f81701aa8 100644 --- a/netwerk/protocol/http/HttpAuthUtils.h +++ b/netwerk/protocol/http/HttpAuthUtils.h @@ -24,7 +24,7 @@ namespace auth { * * Will return true if the URI matches any of the patterns, or false otherwise. */ -bool URIMatchesPrefPattern(nsIURI *uri, const char *pref); +bool URIMatchesPrefPattern(nsIURI* uri, const char* pref); } // namespace auth } // namespace net diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index 8f9b1716ccdaf..595964efdfaac 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -125,241 +125,241 @@ class HttpBaseChannel : public nsHashPropertyBag, HttpBaseChannel(); - virtual MOZ_MUST_USE nsresult Init(nsIURI *aURI, uint32_t aCaps, - nsProxyInfo *aProxyInfo, + virtual MOZ_MUST_USE nsresult Init(nsIURI* aURI, uint32_t aCaps, + nsProxyInfo* aProxyInfo, uint32_t aProxyResolveFlags, - nsIURI *aProxyURI, uint64_t aChannelId, + nsIURI* aProxyURI, uint64_t aChannelId, nsContentPolicyType aContentPolicyType); // nsIRequest - NS_IMETHOD GetName(nsACString &aName) override; - NS_IMETHOD IsPending(bool *aIsPending) override; - NS_IMETHOD GetStatus(nsresult *aStatus) override; - NS_IMETHOD GetLoadGroup(nsILoadGroup **aLoadGroup) override; - NS_IMETHOD SetLoadGroup(nsILoadGroup *aLoadGroup) override; - NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) override; + NS_IMETHOD GetName(nsACString& aName) override; + NS_IMETHOD IsPending(bool* aIsPending) override; + NS_IMETHOD GetStatus(nsresult* aStatus) override; + NS_IMETHOD GetLoadGroup(nsILoadGroup** aLoadGroup) override; + NS_IMETHOD SetLoadGroup(nsILoadGroup* aLoadGroup) override; + NS_IMETHOD GetLoadFlags(nsLoadFlags* aLoadFlags) override; NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags) override; NS_IMETHOD SetDocshellUserAgentOverride(); // nsIChannel - NS_IMETHOD GetOriginalURI(nsIURI **aOriginalURI) override; - NS_IMETHOD SetOriginalURI(nsIURI *aOriginalURI) override; - NS_IMETHOD GetURI(nsIURI **aURI) override; - NS_IMETHOD GetOwner(nsISupports **aOwner) override; - NS_IMETHOD SetOwner(nsISupports *aOwner) override; - NS_IMETHOD GetLoadInfo(nsILoadInfo **aLoadInfo) override; - NS_IMETHOD SetLoadInfo(nsILoadInfo *aLoadInfo) override; - NS_IMETHOD GetIsDocument(bool *aIsDocument) override; + NS_IMETHOD GetOriginalURI(nsIURI** aOriginalURI) override; + NS_IMETHOD SetOriginalURI(nsIURI* aOriginalURI) override; + NS_IMETHOD GetURI(nsIURI** aURI) override; + NS_IMETHOD GetOwner(nsISupports** aOwner) override; + NS_IMETHOD SetOwner(nsISupports* aOwner) override; + NS_IMETHOD GetLoadInfo(nsILoadInfo** aLoadInfo) override; + NS_IMETHOD SetLoadInfo(nsILoadInfo* aLoadInfo) override; + NS_IMETHOD GetIsDocument(bool* aIsDocument) override; NS_IMETHOD GetNotificationCallbacks( - nsIInterfaceRequestor **aCallbacks) override; + nsIInterfaceRequestor** aCallbacks) override; NS_IMETHOD SetNotificationCallbacks( - nsIInterfaceRequestor *aCallbacks) override; - NS_IMETHOD GetContentType(nsACString &aContentType) override; - NS_IMETHOD SetContentType(const nsACString &aContentType) override; - NS_IMETHOD GetContentCharset(nsACString &aContentCharset) override; - NS_IMETHOD SetContentCharset(const nsACString &aContentCharset) override; - NS_IMETHOD GetContentDisposition(uint32_t *aContentDisposition) override; + nsIInterfaceRequestor* aCallbacks) override; + NS_IMETHOD GetContentType(nsACString& aContentType) override; + NS_IMETHOD SetContentType(const nsACString& aContentType) override; + NS_IMETHOD GetContentCharset(nsACString& aContentCharset) override; + NS_IMETHOD SetContentCharset(const nsACString& aContentCharset) override; + NS_IMETHOD GetContentDisposition(uint32_t* aContentDisposition) override; NS_IMETHOD SetContentDisposition(uint32_t aContentDisposition) override; NS_IMETHOD GetContentDispositionFilename( - nsAString &aContentDispositionFilename) override; + nsAString& aContentDispositionFilename) override; NS_IMETHOD SetContentDispositionFilename( - const nsAString &aContentDispositionFilename) override; + const nsAString& aContentDispositionFilename) override; NS_IMETHOD GetContentDispositionHeader( - nsACString &aContentDispositionHeader) override; - NS_IMETHOD GetContentLength(int64_t *aContentLength) override; + nsACString& aContentDispositionHeader) override; + NS_IMETHOD GetContentLength(int64_t* aContentLength) override; NS_IMETHOD SetContentLength(int64_t aContentLength) override; - NS_IMETHOD Open(nsIInputStream **aResult) override; - NS_IMETHOD GetBlockAuthPrompt(bool *aValue) override; + NS_IMETHOD Open(nsIInputStream** aResult) override; + NS_IMETHOD GetBlockAuthPrompt(bool* aValue) override; NS_IMETHOD SetBlockAuthPrompt(bool aValue) override; // nsIEncodedChannel - NS_IMETHOD GetApplyConversion(bool *value) override; + NS_IMETHOD GetApplyConversion(bool* value) override; NS_IMETHOD SetApplyConversion(bool value) override; - NS_IMETHOD GetContentEncodings(nsIUTF8StringEnumerator **aEncodings) override; - NS_IMETHOD DoApplyContentConversions(nsIStreamListener *aNextListener, - nsIStreamListener **aNewNextListener, - nsISupports *aCtxt) override; + NS_IMETHOD GetContentEncodings(nsIUTF8StringEnumerator** aEncodings) override; + NS_IMETHOD DoApplyContentConversions(nsIStreamListener* aNextListener, + nsIStreamListener** aNewNextListener, + nsISupports* aCtxt) override; // HttpBaseChannel::nsIHttpChannel - NS_IMETHOD GetRequestMethod(nsACString &aMethod) override; - NS_IMETHOD SetRequestMethod(const nsACString &aMethod) override; - NS_IMETHOD GetReferrer(nsIURI **referrer) override; - NS_IMETHOD SetReferrer(nsIURI *referrer) override; - NS_IMETHOD GetReferrerPolicy(uint32_t *referrerPolicy) override; - NS_IMETHOD SetReferrerWithPolicy(nsIURI *referrer, + NS_IMETHOD GetRequestMethod(nsACString& aMethod) override; + NS_IMETHOD SetRequestMethod(const nsACString& aMethod) override; + NS_IMETHOD GetReferrer(nsIURI** referrer) override; + NS_IMETHOD SetReferrer(nsIURI* referrer) override; + NS_IMETHOD GetReferrerPolicy(uint32_t* referrerPolicy) override; + NS_IMETHOD SetReferrerWithPolicy(nsIURI* referrer, uint32_t referrerPolicy) override; - NS_IMETHOD GetRequestHeader(const nsACString &aHeader, - nsACString &aValue) override; - NS_IMETHOD SetRequestHeader(const nsACString &aHeader, - const nsACString &aValue, bool aMerge) override; - NS_IMETHOD SetEmptyRequestHeader(const nsACString &aHeader) override; - NS_IMETHOD VisitRequestHeaders(nsIHttpHeaderVisitor *visitor) override; + NS_IMETHOD GetRequestHeader(const nsACString& aHeader, + nsACString& aValue) override; + NS_IMETHOD SetRequestHeader(const nsACString& aHeader, + const nsACString& aValue, bool aMerge) override; + NS_IMETHOD SetEmptyRequestHeader(const nsACString& aHeader) override; + NS_IMETHOD VisitRequestHeaders(nsIHttpHeaderVisitor* visitor) override; NS_IMETHOD VisitNonDefaultRequestHeaders( - nsIHttpHeaderVisitor *visitor) override; - NS_IMETHOD GetResponseHeader(const nsACString &header, - nsACString &value) override; - NS_IMETHOD SetResponseHeader(const nsACString &header, - const nsACString &value, bool merge) override; - NS_IMETHOD VisitResponseHeaders(nsIHttpHeaderVisitor *visitor) override; - NS_IMETHOD GetOriginalResponseHeader(const nsACString &aHeader, - nsIHttpHeaderVisitor *aVisitor) override; + nsIHttpHeaderVisitor* visitor) override; + NS_IMETHOD GetResponseHeader(const nsACString& header, + nsACString& value) override; + NS_IMETHOD SetResponseHeader(const nsACString& header, + const nsACString& value, bool merge) override; + NS_IMETHOD VisitResponseHeaders(nsIHttpHeaderVisitor* visitor) override; + NS_IMETHOD GetOriginalResponseHeader(const nsACString& aHeader, + nsIHttpHeaderVisitor* aVisitor) override; NS_IMETHOD VisitOriginalResponseHeaders( - nsIHttpHeaderVisitor *aVisitor) override; - NS_IMETHOD GetAllowPipelining(bool *value) override; // deprecated + nsIHttpHeaderVisitor* aVisitor) override; + NS_IMETHOD GetAllowPipelining(bool* value) override; // deprecated NS_IMETHOD SetAllowPipelining(bool value) override; // deprecated - NS_IMETHOD GetAllowSTS(bool *value) override; + NS_IMETHOD GetAllowSTS(bool* value) override; NS_IMETHOD SetAllowSTS(bool value) override; - NS_IMETHOD GetRedirectionLimit(uint32_t *value) override; + NS_IMETHOD GetRedirectionLimit(uint32_t* value) override; NS_IMETHOD SetRedirectionLimit(uint32_t value) override; - NS_IMETHOD IsNoStoreResponse(bool *value) override; - NS_IMETHOD IsNoCacheResponse(bool *value) override; - NS_IMETHOD IsPrivateResponse(bool *value) override; - NS_IMETHOD GetResponseStatus(uint32_t *aValue) override; - NS_IMETHOD GetResponseStatusText(nsACString &aValue) override; - NS_IMETHOD GetRequestSucceeded(bool *aValue) override; - NS_IMETHOD RedirectTo(nsIURI *newURI) override; - NS_IMETHOD SwitchProcessTo(mozilla::dom::Promise *aBrowserParent, + NS_IMETHOD IsNoStoreResponse(bool* value) override; + NS_IMETHOD IsNoCacheResponse(bool* value) override; + NS_IMETHOD IsPrivateResponse(bool* value) override; + NS_IMETHOD GetResponseStatus(uint32_t* aValue) override; + NS_IMETHOD GetResponseStatusText(nsACString& aValue) override; + NS_IMETHOD GetRequestSucceeded(bool* aValue) override; + NS_IMETHOD RedirectTo(nsIURI* newURI) override; + NS_IMETHOD SwitchProcessTo(mozilla::dom::Promise* aBrowserParent, uint64_t aIdentifier) override; - NS_IMETHOD HasCrossOriginOpenerPolicyMismatch(bool *aMismatch) override; + NS_IMETHOD HasCrossOriginOpenerPolicyMismatch(bool* aMismatch) override; NS_IMETHOD UpgradeToSecure() override; - NS_IMETHOD GetRequestContextID(uint64_t *aRCID) override; - NS_IMETHOD GetTransferSize(uint64_t *aTransferSize) override; - NS_IMETHOD GetDecodedBodySize(uint64_t *aDecodedBodySize) override; - NS_IMETHOD GetEncodedBodySize(uint64_t *aEncodedBodySize) override; + NS_IMETHOD GetRequestContextID(uint64_t* aRCID) override; + NS_IMETHOD GetTransferSize(uint64_t* aTransferSize) override; + NS_IMETHOD GetDecodedBodySize(uint64_t* aDecodedBodySize) override; + NS_IMETHOD GetEncodedBodySize(uint64_t* aEncodedBodySize) override; NS_IMETHOD SetRequestContextID(uint64_t aRCID) override; - NS_IMETHOD GetIsMainDocumentChannel(bool *aValue) override; + NS_IMETHOD GetIsMainDocumentChannel(bool* aValue) override; NS_IMETHOD SetIsMainDocumentChannel(bool aValue) override; - NS_IMETHOD GetProtocolVersion(nsACString &aProtocolVersion) override; - NS_IMETHOD GetChannelId(uint64_t *aChannelId) override; + NS_IMETHOD GetProtocolVersion(nsACString& aProtocolVersion) override; + NS_IMETHOD GetChannelId(uint64_t* aChannelId) override; NS_IMETHOD SetChannelId(uint64_t aChannelId) override; - NS_IMETHOD GetTopLevelContentWindowId(uint64_t *aContentWindowId) override; + NS_IMETHOD GetTopLevelContentWindowId(uint64_t* aContentWindowId) override; NS_IMETHOD SetTopLevelContentWindowId(uint64_t aContentWindowId) override; - NS_IMETHOD GetTopLevelOuterContentWindowId(uint64_t *aWindowId) override; + NS_IMETHOD GetTopLevelOuterContentWindowId(uint64_t* aWindowId) override; NS_IMETHOD SetTopLevelOuterContentWindowId(uint64_t aWindowId) override; - NS_IMETHOD IsTrackingResource(bool *aIsTrackingResource) override; - NS_IMETHOD IsThirdPartyTrackingResource(bool *aIsTrackingResource) override; - NS_IMETHOD GetClassificationFlags(uint32_t *aIsClassificationFlags) override; + NS_IMETHOD IsTrackingResource(bool* aIsTrackingResource) override; + NS_IMETHOD IsThirdPartyTrackingResource(bool* aIsTrackingResource) override; + NS_IMETHOD GetClassificationFlags(uint32_t* aIsClassificationFlags) override; NS_IMETHOD GetFirstPartyClassificationFlags( - uint32_t *aIsClassificationFlags) override; + uint32_t* aIsClassificationFlags) override; NS_IMETHOD GetThirdPartyClassificationFlags( - uint32_t *aIsClassificationFlags) override; + uint32_t* aIsClassificationFlags) override; NS_IMETHOD GetFlashPluginState( - nsIHttpChannel::FlashPluginState *aState) override; + nsIHttpChannel::FlashPluginState* aState) override; using nsIHttpChannel::IsThirdPartyTrackingResource; // nsIHttpChannelInternal - NS_IMETHOD GetDocumentURI(nsIURI **aDocumentURI) override; - NS_IMETHOD SetDocumentURI(nsIURI *aDocumentURI) override; - NS_IMETHOD GetRequestVersion(uint32_t *major, uint32_t *minor) override; - NS_IMETHOD GetResponseVersion(uint32_t *major, uint32_t *minor) override; - NS_IMETHOD SetCookie(const char *aCookieHeader) override; - NS_IMETHOD GetThirdPartyFlags(uint32_t *aForce) override; + NS_IMETHOD GetDocumentURI(nsIURI** aDocumentURI) override; + NS_IMETHOD SetDocumentURI(nsIURI* aDocumentURI) override; + NS_IMETHOD GetRequestVersion(uint32_t* major, uint32_t* minor) override; + NS_IMETHOD GetResponseVersion(uint32_t* major, uint32_t* minor) override; + NS_IMETHOD SetCookie(const char* aCookieHeader) override; + NS_IMETHOD GetThirdPartyFlags(uint32_t* aForce) override; NS_IMETHOD SetThirdPartyFlags(uint32_t aForce) override; - NS_IMETHOD GetForceAllowThirdPartyCookie(bool *aForce) override; + NS_IMETHOD GetForceAllowThirdPartyCookie(bool* aForce) override; NS_IMETHOD SetForceAllowThirdPartyCookie(bool aForce) override; - NS_IMETHOD GetCanceled(bool *aCanceled) override; - NS_IMETHOD GetChannelIsForDownload(bool *aChannelIsForDownload) override; + NS_IMETHOD GetCanceled(bool* aCanceled) override; + NS_IMETHOD GetChannelIsForDownload(bool* aChannelIsForDownload) override; NS_IMETHOD SetChannelIsForDownload(bool aChannelIsForDownload) override; - NS_IMETHOD SetCacheKeysRedirectChain(nsTArray *cacheKeys) override; - NS_IMETHOD GetLocalAddress(nsACString &addr) override; - NS_IMETHOD GetLocalPort(int32_t *port) override; - NS_IMETHOD GetRemoteAddress(nsACString &addr) override; - NS_IMETHOD GetRemotePort(int32_t *port) override; - NS_IMETHOD GetOnlyConnect(bool *aOnlyConnect) override; + NS_IMETHOD SetCacheKeysRedirectChain(nsTArray* cacheKeys) override; + NS_IMETHOD GetLocalAddress(nsACString& addr) override; + NS_IMETHOD GetLocalPort(int32_t* port) override; + NS_IMETHOD GetRemoteAddress(nsACString& addr) override; + NS_IMETHOD GetRemotePort(int32_t* port) override; + NS_IMETHOD GetOnlyConnect(bool* aOnlyConnect) override; NS_IMETHOD SetConnectOnly() override; - NS_IMETHOD GetAllowSpdy(bool *aAllowSpdy) override; + NS_IMETHOD GetAllowSpdy(bool* aAllowSpdy) override; NS_IMETHOD SetAllowSpdy(bool aAllowSpdy) override; - NS_IMETHOD GetAllowAltSvc(bool *aAllowAltSvc) override; + NS_IMETHOD GetAllowAltSvc(bool* aAllowAltSvc) override; NS_IMETHOD SetAllowAltSvc(bool aAllowAltSvc) override; - NS_IMETHOD GetBeConservative(bool *aBeConservative) override; + NS_IMETHOD GetBeConservative(bool* aBeConservative) override; NS_IMETHOD SetBeConservative(bool aBeConservative) override; - NS_IMETHOD GetTrr(bool *aTRR) override; + NS_IMETHOD GetTrr(bool* aTRR) override; NS_IMETHOD SetTrr(bool aTRR) override; - NS_IMETHOD GetTlsFlags(uint32_t *aTlsFlags) override; + NS_IMETHOD GetTlsFlags(uint32_t* aTlsFlags) override; NS_IMETHOD SetTlsFlags(uint32_t aTlsFlags) override; - NS_IMETHOD GetApiRedirectToURI(nsIURI **aApiRedirectToURI) override; + NS_IMETHOD GetApiRedirectToURI(nsIURI** aApiRedirectToURI) override; virtual MOZ_MUST_USE nsresult AddSecurityMessage( - const nsAString &aMessageTag, const nsAString &aMessageCategory); + const nsAString& aMessageTag, const nsAString& aMessageCategory); NS_IMETHOD TakeAllSecurityMessages( - nsCOMArray &aMessages) override; - NS_IMETHOD GetResponseTimeoutEnabled(bool *aEnable) override; + nsCOMArray& aMessages) override; + NS_IMETHOD GetResponseTimeoutEnabled(bool* aEnable) override; NS_IMETHOD SetResponseTimeoutEnabled(bool aEnable) override; - NS_IMETHOD GetInitialRwin(uint32_t *aRwin) override; + NS_IMETHOD GetInitialRwin(uint32_t* aRwin) override; NS_IMETHOD SetInitialRwin(uint32_t aRwin) override; NS_IMETHOD ForcePending(bool aForcePending) override; - NS_IMETHOD GetLastModifiedTime(PRTime *lastModifiedTime) override; - NS_IMETHOD GetCorsIncludeCredentials(bool *aInclude) override; + NS_IMETHOD GetLastModifiedTime(PRTime* lastModifiedTime) override; + NS_IMETHOD GetCorsIncludeCredentials(bool* aInclude) override; NS_IMETHOD SetCorsIncludeCredentials(bool aInclude) override; - NS_IMETHOD GetCorsMode(uint32_t *aCorsMode) override; + NS_IMETHOD GetCorsMode(uint32_t* aCorsMode) override; NS_IMETHOD SetCorsMode(uint32_t aCorsMode) override; - NS_IMETHOD GetRedirectMode(uint32_t *aRedirectMode) override; + NS_IMETHOD GetRedirectMode(uint32_t* aRedirectMode) override; NS_IMETHOD SetRedirectMode(uint32_t aRedirectMode) override; - NS_IMETHOD GetFetchCacheMode(uint32_t *aFetchCacheMode) override; + NS_IMETHOD GetFetchCacheMode(uint32_t* aFetchCacheMode) override; NS_IMETHOD SetFetchCacheMode(uint32_t aFetchCacheMode) override; - NS_IMETHOD GetTopWindowURI(nsIURI **aTopWindowURI) override; - NS_IMETHOD SetTopWindowURIIfUnknown(nsIURI *aTopWindowURI) override; - NS_IMETHOD GetProxyURI(nsIURI **proxyURI) override; + NS_IMETHOD GetTopWindowURI(nsIURI** aTopWindowURI) override; + NS_IMETHOD SetTopWindowURIIfUnknown(nsIURI* aTopWindowURI) override; + NS_IMETHOD GetProxyURI(nsIURI** proxyURI) override; virtual void SetCorsPreflightParameters( - const nsTArray &unsafeHeaders) override; + const nsTArray& unsafeHeaders) override; virtual void SetAltDataForChild(bool aIsForChild) override; NS_IMETHOD GetConnectionInfoHashKey( - nsACString &aConnectionInfoHashKey) override; - NS_IMETHOD GetIntegrityMetadata(nsAString &aIntegrityMetadata) override; - NS_IMETHOD SetIntegrityMetadata(const nsAString &aIntegrityMetadata) override; - NS_IMETHOD GetLastRedirectFlags(uint32_t *aValue) override; + nsACString& aConnectionInfoHashKey) override; + NS_IMETHOD GetIntegrityMetadata(nsAString& aIntegrityMetadata) override; + NS_IMETHOD SetIntegrityMetadata(const nsAString& aIntegrityMetadata) override; + NS_IMETHOD GetLastRedirectFlags(uint32_t* aValue) override; NS_IMETHOD SetLastRedirectFlags(uint32_t aValue) override; - NS_IMETHOD GetNavigationStartTimeStamp(TimeStamp *aTimeStamp) override; + NS_IMETHOD GetNavigationStartTimeStamp(TimeStamp* aTimeStamp) override; NS_IMETHOD SetNavigationStartTimeStamp(TimeStamp aTimeStamp) override; NS_IMETHOD CancelByURLClassifier(nsresult aErrorCode) override; virtual void SetIPv4Disabled(void) override; virtual void SetIPv6Disabled(void) override; NS_IMETHOD GetCrossOriginOpenerPolicy( - nsILoadInfo::CrossOriginOpenerPolicy *aPolicy) override; + nsILoadInfo::CrossOriginOpenerPolicy* aPolicy) override; inline void CleanRedirectCacheChainIfNecessary() { mRedirectedCachekeys = nullptr; } - NS_IMETHOD HTTPUpgrade(const nsACString &aProtocolName, - nsIHttpUpgradeListener *aListener) override; + NS_IMETHOD HTTPUpgrade(const nsACString& aProtocolName, + nsIHttpUpgradeListener* aListener) override; // nsISupportsPriority - NS_IMETHOD GetPriority(int32_t *value) override; + NS_IMETHOD GetPriority(int32_t* value) override; NS_IMETHOD AdjustPriority(int32_t delta) override; // nsIClassOfService - NS_IMETHOD GetClassFlags(uint32_t *outFlags) override { + NS_IMETHOD GetClassFlags(uint32_t* outFlags) override { *outFlags = mClassOfService; return NS_OK; } // nsIResumableChannel - NS_IMETHOD GetEntityID(nsACString &aEntityID) override; + NS_IMETHOD GetEntityID(nsACString& aEntityID) override; // nsIConsoleReportCollector - void AddConsoleReport(uint32_t aErrorFlags, const nsACString &aCategory, + void AddConsoleReport(uint32_t aErrorFlags, const nsACString& aCategory, nsContentUtils::PropertiesFile aPropertiesFile, - const nsACString &aSourceFileURI, uint32_t aLineNumber, - uint32_t aColumnNumber, const nsACString &aMessageName, - const nsTArray &aStringParams) override; + const nsACString& aSourceFileURI, uint32_t aLineNumber, + uint32_t aColumnNumber, const nsACString& aMessageName, + const nsTArray& aStringParams) override; void FlushReportsToConsole( uint64_t aInnerWindowID, ReportAction aAction = ReportAction::Forget) override; void FlushReportsToConsoleForServiceWorkerScope( - const nsACString &aScope, + const nsACString& aScope, ReportAction aAction = ReportAction::Forget) override; void FlushConsoleReports( - dom::Document *aDocument, + dom::Document* aDocument, ReportAction aAction = ReportAction::Forget) override; void FlushConsoleReports( - nsILoadGroup *aLoadGroup, + nsILoadGroup* aLoadGroup, ReportAction aAction = ReportAction::Forget) override; - void FlushConsoleReports(nsIConsoleReportCollector *aCollector) override; + void FlushConsoleReports(nsIConsoleReportCollector* aCollector) override; void ClearConsoleReports() override; @@ -370,7 +370,7 @@ class HttpBaseChannel : public nsHashPropertyBag, using nsStringEnumeratorBase::GetNext; - nsContentEncodings(nsIHttpChannel *aChannel, const char *aEncodingHeader); + nsContentEncodings(nsIHttpChannel* aChannel, const char* aEncodingHeader); private: virtual ~nsContentEncodings() = default; @@ -378,9 +378,9 @@ class HttpBaseChannel : public nsHashPropertyBag, MOZ_MUST_USE nsresult PrepareForNext(void); // We do not own the buffer. The channel owns it. - const char *mEncodingHeader; - const char *mCurStart; // points to start of current header - const char *mCurEnd; // points to end of current header + const char* mEncodingHeader; + const char* mCurStart; // points to start of current header + const char* mCurEnd; // points to end of current header // Hold a ref to our channel so that it can't go away and take the // header with it. @@ -389,14 +389,14 @@ class HttpBaseChannel : public nsHashPropertyBag, bool mReady; }; - nsHttpResponseHead *GetResponseHead() const { return mResponseHead; } - nsHttpRequestHead *GetRequestHead() { return &mRequestHead; } - nsHttpHeaderArray *GetResponseTrailers() const { return mResponseTrailers; } + nsHttpResponseHead* GetResponseHead() const { return mResponseHead; } + nsHttpRequestHead* GetRequestHead() { return &mRequestHead; } + nsHttpHeaderArray* GetResponseTrailers() const { return mResponseTrailers; } - const NetAddr &GetSelfAddr() { return mSelfAddr; } - const NetAddr &GetPeerAddr() { return mPeerAddr; } + const NetAddr& GetSelfAddr() { return mSelfAddr; } + const NetAddr& GetPeerAddr() { return mPeerAddr; } - MOZ_MUST_USE nsresult OverrideSecurityInfo(nsISupports *aSecurityInfo); + MOZ_MUST_USE nsresult OverrideSecurityInfo(nsISupports* aSecurityInfo); public: /* Necko internal use only... */ int64_t GetAltDataLength() { return mAltDataLength; } @@ -404,10 +404,10 @@ class HttpBaseChannel : public nsHashPropertyBag, bool IsDeliveringAltData() const { return mDeliveringAltData; } - static bool IsReferrerSchemeAllowed(nsIURI *aReferrer); + static bool IsReferrerSchemeAllowed(nsIURI* aReferrer); - static void PropagateReferenceIfNeeded(nsIURI *aURI, - nsCOMPtr &aRedirectURI); + static void PropagateReferenceIfNeeded(nsIURI* aURI, + nsCOMPtr& aRedirectURI); // Return whether upon a redirect code of httpStatus for method, the // request method should be rewritten to GET. @@ -417,7 +417,7 @@ class HttpBaseChannel : public nsHashPropertyBag, // Like nsIEncodedChannel::DoApplyConversions except context is set to // mListenerContext. MOZ_MUST_USE nsresult DoApplyContentConversions( - nsIStreamListener *aNextListener, nsIStreamListener **aNewNextListener); + nsIStreamListener* aNextListener, nsIStreamListener** aNewNextListener); // Callback on STS thread called by CopyComplete when NS_AsyncCopy() // is finished. This function works as a proxy function to dispatch @@ -428,9 +428,9 @@ class HttpBaseChannel : public nsHashPropertyBag, void SetFlashPluginState(nsIHttpChannel::FlashPluginState aState); - const uint64_t &ChannelId() const { return mChannelId; } + const uint64_t& ChannelId() const { return mChannelId; } - void InternalSetUploadStream(nsIInputStream *uploadStream) { + void InternalSetUploadStream(nsIInputStream* uploadStream) { mUploadStream = uploadStream; } @@ -443,7 +443,7 @@ class HttpBaseChannel : public nsHashPropertyBag, } MOZ_MUST_USE nsresult SetReferrerWithPolicyInternal( - nsIURI *referrer, uint32_t originalReferrerPolicy, + nsIURI* referrer, uint32_t originalReferrerPolicy, uint32_t referrerPolicy) { nsAutoCString spec; nsresult rv = referrer->GetAsciiSpec(spec); @@ -458,13 +458,13 @@ class HttpBaseChannel : public nsHashPropertyBag, return rv; } - MOZ_MUST_USE nsresult SetTopWindowURI(nsIURI *aTopWindowURI) { + MOZ_MUST_USE nsresult SetTopWindowURI(nsIURI* aTopWindowURI) { mTopWindowURI = aTopWindowURI; return NS_OK; } protected: - nsresult GetTopWindowURI(nsIURI *aURIBeingLoaded, nsIURI **aTopWindowURI); + nsresult GetTopWindowURI(nsIURI* aURIBeingLoaded, nsIURI** aTopWindowURI); // Handle notifying listener, removing from loadgroup if request failed. void DoNotifyListener(); @@ -480,15 +480,15 @@ class HttpBaseChannel : public nsHashPropertyBag, // Set-Cookie header in the response header of any network request. // This notification will come only after the "http-on-examine-response" // was fired. - void NotifySetCookie(char const *aCookie); + void NotifySetCookie(char const* aCookie); - mozilla::dom::PerformanceStorage *GetPerformanceStorage(); + mozilla::dom::PerformanceStorage* GetPerformanceStorage(); void MaybeReportTimingData(); - nsIURI *GetReferringPage(); - nsPIDOMWindowInner *GetInnerDOMWindow(); + nsIURI* GetReferringPage(); + nsPIDOMWindowInner* GetInnerDOMWindow(); void AddCookiesToRequest(); - virtual MOZ_MUST_USE nsresult SetupReplacementChannel(nsIURI *, nsIChannel *, + virtual MOZ_MUST_USE nsresult SetupReplacementChannel(nsIURI*, nsIChannel*, bool preserveMethod, uint32_t redirectFlags); @@ -501,7 +501,7 @@ class HttpBaseChannel : public nsHashPropertyBag, // Helper function to simplify getting notification callbacks. template - void GetCallback(nsCOMPtr &aResult) { + void GetCallback(nsCOMPtr& aResult) { NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, NS_GET_TEMPLATE_IID(T), getter_AddRefs(aResult)); @@ -509,16 +509,16 @@ class HttpBaseChannel : public nsHashPropertyBag, // Redirect tracking // Checks whether or not aURI and mOriginalURI share the same domain. - bool SameOriginWithOriginalUri(nsIURI *aURI); + bool SameOriginWithOriginalUri(nsIURI* aURI); // GetPrincipal Returns the channel's URI principal. - nsIPrincipal *GetURIPrincipal(); + nsIPrincipal* GetURIPrincipal(); MOZ_MUST_USE bool BypassServiceWorker() const; // Returns true if this channel should intercept the network request and // prepare for a possible synthesized response instead. - bool ShouldIntercept(nsIURI *aURI = nullptr); + bool ShouldIntercept(nsIURI* aURI = nullptr); // Callback on main thread when NS_AsyncCopy() is finished populating // the new mUploadStream. @@ -531,15 +531,15 @@ class HttpBaseChannel : public nsHashPropertyBag, // Called before we create the redirect target channel. already_AddRefed CloneLoadInfoForRedirect( - nsIURI *newURI, uint32_t redirectFlags); + nsIURI* newURI, uint32_t redirectFlags); - static void CallTypeSniffers(void *aClosure, const uint8_t *aData, + static void CallTypeSniffers(void* aClosure, const uint8_t* aData, uint32_t aCount); nsresult CheckRedirectLimit(uint32_t aRedirectFlags) const; - bool MaybeWaitForUploadStreamLength(nsIStreamListener *aListener, - nsISupports *aContext); + bool MaybeWaitForUploadStreamLength(nsIStreamListener* aListener, + nsISupports* aContext); friend class PrivateBrowsingChannel; friend class InterceptFailedOnStop; @@ -822,7 +822,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(HttpBaseChannel, HTTP_BASE_CHANNEL_IID) template class HttpAsyncAborter { public: - explicit HttpAsyncAborter(T *derived) + explicit HttpAsyncAborter(T* derived) : mThis(derived), mCallOnResume(nullptr) {} // Aborts channel: calls OnStart/Stop with provided status, removes channel @@ -836,14 +836,14 @@ class HttpAsyncAborter { // retval isn't refcounted and is set only when event was successfully // posted, the event is returned for the purpose of cancelling when needed MOZ_MUST_USE virtual nsresult AsyncCall( - void (T::*funcPtr)(), nsRunnableMethod **retval = nullptr); + void (T::*funcPtr)(), nsRunnableMethod** retval = nullptr); private: - T *mThis; + T* mThis; protected: // Function to be called at resume time - std::function mCallOnResume; + std::function mCallOnResume; }; template @@ -868,7 +868,7 @@ inline void HttpAsyncAborter::HandleAsyncAbort() { MOZ_LOG( gHttpLog, LogLevel::Debug, ("Waiting until resume to do async notification [this=%p]\n", mThis)); - mCallOnResume = [](T *self) { + mCallOnResume = [](T* self) { self->HandleAsyncAbort(); return NS_OK; }; @@ -884,7 +884,7 @@ inline void HttpAsyncAborter::HandleAsyncAbort() { template nsresult HttpAsyncAborter::AsyncCall(void (T::*funcPtr)(), - nsRunnableMethod **retval) { + nsRunnableMethod** retval) { nsresult rv; RefPtr> event = @@ -899,7 +899,7 @@ nsresult HttpAsyncAborter::AsyncCall(void (T::*funcPtr)(), class ProxyReleaseRunnable final : public mozilla::Runnable { public: - explicit ProxyReleaseRunnable(nsTArray> &&aDoomed) + explicit ProxyReleaseRunnable(nsTArray>&& aDoomed) : Runnable("ProxyReleaseRunnable"), mDoomed(std::move(aDoomed)) {} NS_IMETHOD diff --git a/netwerk/protocol/http/HttpInfo.h b/netwerk/protocol/http/HttpInfo.h index 3b63b9fa63005..981a3df56b6e9 100644 --- a/netwerk/protocol/http/HttpInfo.h +++ b/netwerk/protocol/http/HttpInfo.h @@ -15,7 +15,7 @@ struct HttpRetParams; class HttpInfo { public: /* Calls getConnectionData method in nsHttpConnectionMgr. */ - static void GetHttpConnectionData(nsTArray *); + static void GetHttpConnectionData(nsTArray*); }; } // namespace net diff --git a/netwerk/protocol/http/HttpTrafficAnalyzer.cpp b/netwerk/protocol/http/HttpTrafficAnalyzer.cpp index 89e66260b8594..2a6fa71424984 100644 --- a/netwerk/protocol/http/HttpTrafficAnalyzer.cpp +++ b/netwerk/protocol/http/HttpTrafficAnalyzer.cpp @@ -130,7 +130,7 @@ nsresult HttpTrafficAnalyzer::IncrementHttpConnection( } nsresult HttpTrafficAnalyzer::IncrementHttpConnection( - nsTArray &&aCategories) { + nsTArray&& aCategories) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(StaticPrefs::network_traffic_analyzer_enabled()); MOZ_ASSERT(!aCategories.IsEmpty(), "empty category"); diff --git a/netwerk/protocol/http/HttpTrafficAnalyzer.h b/netwerk/protocol/http/HttpTrafficAnalyzer.h index ef5dce5f58e12..3e7a91a8b23b6 100644 --- a/netwerk/protocol/http/HttpTrafficAnalyzer.h +++ b/netwerk/protocol/http/HttpTrafficAnalyzer.h @@ -37,7 +37,7 @@ class HttpTrafficAnalyzer final { nsresult IncrementHttpTransaction(HttpTrafficCategory aCategory); nsresult IncrementHttpConnection(HttpTrafficCategory aCategory); - nsresult IncrementHttpConnection(nsTArray &&aCategories); + nsresult IncrementHttpConnection(nsTArray&& aCategories); nsresult AccumulateHttpTransferredSize(HttpTrafficCategory aCategory, uint64_t aBytesRead, uint64_t aBytesSent); diff --git a/netwerk/protocol/http/NullHttpChannel.cpp b/netwerk/protocol/http/NullHttpChannel.cpp index 397f46d81ad52..216e633361307 100644 --- a/netwerk/protocol/http/NullHttpChannel.cpp +++ b/netwerk/protocol/http/NullHttpChannel.cpp @@ -21,9 +21,9 @@ NullHttpChannel::NullHttpChannel() mAsyncOpenTime = TimeStamp::Now(); } -NullHttpChannel::NullHttpChannel(nsIHttpChannel *chan) +NullHttpChannel::NullHttpChannel(nsIHttpChannel* chan) : mAllRedirectsSameOrigin(false), mAllRedirectsPassTimingAllowCheck(false) { - nsIScriptSecurityManager *ssm = nsContentUtils::GetSecurityManager(); + nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); ssm->GetChannelURIPrincipal(chan, getter_AddRefs(mResourcePrincipal)); Unused << chan->GetResponseHeader(NS_LITERAL_CSTRING("Timing-Allow-Origin"), @@ -41,9 +41,9 @@ NullHttpChannel::NullHttpChannel(nsIHttpChannel *chan) } } -nsresult NullHttpChannel::Init(nsIURI *aURI, uint32_t aCaps, - nsProxyInfo *aProxyInfo, - uint32_t aProxyResolveFlags, nsIURI *aProxyURI) { +nsresult NullHttpChannel::Init(nsIURI* aURI, uint32_t aCaps, + nsProxyInfo* aProxyInfo, + uint32_t aProxyResolveFlags, nsIURI* aProxyURI) { mURI = aURI; mOriginalURI = aURI; return NS_OK; @@ -54,7 +54,7 @@ nsresult NullHttpChannel::Init(nsIURI *aURI, uint32_t aCaps, //----------------------------------------------------------------------------- NS_IMETHODIMP -NullHttpChannel::GetChannelId(uint64_t *aChannelId) { +NullHttpChannel::GetChannelId(uint64_t* aChannelId) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -64,7 +64,7 @@ NullHttpChannel::SetChannelId(uint64_t aChannelId) { } NS_IMETHODIMP -NullHttpChannel::GetTopLevelContentWindowId(uint64_t *aWindowId) { +NullHttpChannel::GetTopLevelContentWindowId(uint64_t* aWindowId) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -74,7 +74,7 @@ NullHttpChannel::SetTopLevelContentWindowId(uint64_t aWindowId) { } NS_IMETHODIMP -NullHttpChannel::GetTopLevelOuterContentWindowId(uint64_t *aWindowId) { +NullHttpChannel::GetTopLevelOuterContentWindowId(uint64_t* aWindowId) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -84,109 +84,109 @@ NullHttpChannel::SetTopLevelOuterContentWindowId(uint64_t aWindowId) { } NS_IMETHODIMP -NullHttpChannel::IsTrackingResource(bool *aIsTrackingResource) { +NullHttpChannel::IsTrackingResource(bool* aIsTrackingResource) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::IsThirdPartyTrackingResource(bool *aIsTrackingResource) { +NullHttpChannel::IsThirdPartyTrackingResource(bool* aIsTrackingResource) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetClassificationFlags(uint32_t *aClassificationFlags) { +NullHttpChannel::GetClassificationFlags(uint32_t* aClassificationFlags) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP NullHttpChannel::GetFlashPluginState( - nsIHttpChannel::FlashPluginState *aResult) { + nsIHttpChannel::FlashPluginState* aResult) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP NullHttpChannel::GetFirstPartyClassificationFlags( - uint32_t *aClassificationFlags) { + uint32_t* aClassificationFlags) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP NullHttpChannel::GetThirdPartyClassificationFlags( - uint32_t *aClassificationFlags) { + uint32_t* aClassificationFlags) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetTransferSize(uint64_t *aTransferSize) { +NullHttpChannel::GetTransferSize(uint64_t* aTransferSize) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetDecodedBodySize(uint64_t *aDecodedBodySize) { +NullHttpChannel::GetDecodedBodySize(uint64_t* aDecodedBodySize) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetRequestMethod(nsACString &aRequestMethod) { +NullHttpChannel::GetRequestMethod(nsACString& aRequestMethod) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetRequestMethod(const nsACString &aRequestMethod) { +NullHttpChannel::SetRequestMethod(const nsACString& aRequestMethod) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetReferrer(nsIURI **aReferrer) { +NullHttpChannel::GetReferrer(nsIURI** aReferrer) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetReferrer(nsIURI *aReferrer) { +NullHttpChannel::SetReferrer(nsIURI* aReferrer) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetReferrerPolicy(uint32_t *aReferrerPolicy) { +NullHttpChannel::GetReferrerPolicy(uint32_t* aReferrerPolicy) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetReferrerWithPolicy(nsIURI *referrer, +NullHttpChannel::SetReferrerWithPolicy(nsIURI* referrer, uint32_t referrerPolicy) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetRequestHeader(const nsACString &aHeader, - nsACString &_retval) { +NullHttpChannel::GetRequestHeader(const nsACString& aHeader, + nsACString& _retval) { _retval.Truncate(); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetRequestHeader(const nsACString &aHeader, - const nsACString &aValue, bool aMerge) { +NullHttpChannel::SetRequestHeader(const nsACString& aHeader, + const nsACString& aValue, bool aMerge) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetEmptyRequestHeader(const nsACString &aHeader) { +NullHttpChannel::SetEmptyRequestHeader(const nsACString& aHeader) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::VisitRequestHeaders(nsIHttpHeaderVisitor *aVisitor) { +NullHttpChannel::VisitRequestHeaders(nsIHttpHeaderVisitor* aVisitor) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::VisitNonDefaultRequestHeaders(nsIHttpHeaderVisitor *aVisitor) { +NullHttpChannel::VisitNonDefaultRequestHeaders(nsIHttpHeaderVisitor* aVisitor) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetAllowPipelining(bool *aAllowPipelining) { +NullHttpChannel::GetAllowPipelining(bool* aAllowPipelining) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -196,7 +196,7 @@ NullHttpChannel::SetAllowPipelining(bool aAllowPipelining) { } NS_IMETHODIMP -NullHttpChannel::GetAllowSTS(bool *aAllowSTS) { +NullHttpChannel::GetAllowSTS(bool* aAllowSTS) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -206,7 +206,7 @@ NullHttpChannel::SetAllowSTS(bool aAllowSTS) { } NS_IMETHODIMP -NullHttpChannel::GetRedirectionLimit(uint32_t *aRedirectionLimit) { +NullHttpChannel::GetRedirectionLimit(uint32_t* aRedirectionLimit) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -216,77 +216,77 @@ NullHttpChannel::SetRedirectionLimit(uint32_t aRedirectionLimit) { } NS_IMETHODIMP -NullHttpChannel::GetResponseStatus(uint32_t *aResponseStatus) { +NullHttpChannel::GetResponseStatus(uint32_t* aResponseStatus) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetResponseStatusText(nsACString &aResponseStatusText) { +NullHttpChannel::GetResponseStatusText(nsACString& aResponseStatusText) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetRequestSucceeded(bool *aRequestSucceeded) { +NullHttpChannel::GetRequestSucceeded(bool* aRequestSucceeded) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetResponseHeader(const nsACString &header, - nsACString &_retval) { +NullHttpChannel::GetResponseHeader(const nsACString& header, + nsACString& _retval) { _retval.Truncate(); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetResponseHeader(const nsACString &header, - const nsACString &value, bool merge) { +NullHttpChannel::SetResponseHeader(const nsACString& header, + const nsACString& value, bool merge) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor) { +NullHttpChannel::VisitResponseHeaders(nsIHttpHeaderVisitor* aVisitor) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetOriginalResponseHeader(const nsACString &header, - nsIHttpHeaderVisitor *aVisitor) { +NullHttpChannel::GetOriginalResponseHeader(const nsACString& header, + nsIHttpHeaderVisitor* aVisitor) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::VisitOriginalResponseHeaders(nsIHttpHeaderVisitor *aVisitor) { +NullHttpChannel::VisitOriginalResponseHeaders(nsIHttpHeaderVisitor* aVisitor) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::IsNoStoreResponse(bool *_retval) { +NullHttpChannel::IsNoStoreResponse(bool* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::IsNoCacheResponse(bool *_retval) { +NullHttpChannel::IsNoCacheResponse(bool* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::IsPrivateResponse(bool *_retval) { +NullHttpChannel::IsPrivateResponse(bool* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::RedirectTo(nsIURI *aNewURI) { +NullHttpChannel::RedirectTo(nsIURI* aNewURI) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SwitchProcessTo(mozilla::dom::Promise *aBrowserParent, +NullHttpChannel::SwitchProcessTo(mozilla::dom::Promise* aBrowserParent, uint64_t aIdentifier) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -NullHttpChannel::HasCrossOriginOpenerPolicyMismatch(bool *aMismatch) { +NullHttpChannel::HasCrossOriginOpenerPolicyMismatch(bool* aMismatch) { return NS_ERROR_NOT_AVAILABLE; } @@ -294,7 +294,7 @@ NS_IMETHODIMP NullHttpChannel::UpgradeToSecure() { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetRequestContextID(uint64_t *_retval) { +NullHttpChannel::GetRequestContextID(uint64_t* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -304,12 +304,12 @@ NullHttpChannel::SetRequestContextID(uint64_t rcID) { } NS_IMETHODIMP -NullHttpChannel::GetProtocolVersion(nsACString &aProtocolVersion) { +NullHttpChannel::GetProtocolVersion(nsACString& aProtocolVersion) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetEncodedBodySize(uint64_t *aEncodedBodySize) { +NullHttpChannel::GetEncodedBodySize(uint64_t* aEncodedBodySize) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -318,72 +318,72 @@ NullHttpChannel::GetEncodedBodySize(uint64_t *aEncodedBodySize) { //----------------------------------------------------------------------------- NS_IMETHODIMP -NullHttpChannel::GetOriginalURI(nsIURI **aOriginalURI) { +NullHttpChannel::GetOriginalURI(nsIURI** aOriginalURI) { NS_IF_ADDREF(*aOriginalURI = mOriginalURI); return NS_OK; } NS_IMETHODIMP -NullHttpChannel::SetOriginalURI(nsIURI *aOriginalURI) { +NullHttpChannel::SetOriginalURI(nsIURI* aOriginalURI) { mOriginalURI = aOriginalURI; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetURI(nsIURI **aURI) { +NullHttpChannel::GetURI(nsIURI** aURI) { NS_IF_ADDREF(*aURI = mURI); return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetOwner(nsISupports **aOwner) { +NullHttpChannel::GetOwner(nsISupports** aOwner) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetOwner(nsISupports *aOwner) { +NullHttpChannel::SetOwner(nsISupports* aOwner) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP NullHttpChannel::GetNotificationCallbacks( - nsIInterfaceRequestor **aNotificationCallbacks) { + nsIInterfaceRequestor** aNotificationCallbacks) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP NullHttpChannel::SetNotificationCallbacks( - nsIInterfaceRequestor *aNotificationCallbacks) { + nsIInterfaceRequestor* aNotificationCallbacks) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { +NullHttpChannel::GetSecurityInfo(nsISupports** aSecurityInfo) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetContentType(nsACString &aContentType) { +NullHttpChannel::GetContentType(nsACString& aContentType) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetContentType(const nsACString &aContentType) { +NullHttpChannel::SetContentType(const nsACString& aContentType) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetContentCharset(nsACString &aContentCharset) { +NullHttpChannel::GetContentCharset(nsACString& aContentCharset) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetContentCharset(const nsACString &aContentCharset) { +NullHttpChannel::SetContentCharset(const nsACString& aContentCharset) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetContentLength(int64_t *aContentLength) { +NullHttpChannel::GetContentLength(int64_t* aContentLength) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -393,7 +393,7 @@ NullHttpChannel::SetContentLength(int64_t aContentLength) { } NS_IMETHODIMP -NullHttpChannel::Open(nsIInputStream **aStream) { +NullHttpChannel::Open(nsIInputStream** aStream) { nsCOMPtr listener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); @@ -403,7 +403,7 @@ NullHttpChannel::Open(nsIInputStream **aStream) { } NS_IMETHODIMP -NullHttpChannel::AsyncOpen(nsIStreamListener *aListener) { +NullHttpChannel::AsyncOpen(nsIStreamListener* aListener) { nsCOMPtr listener = aListener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); @@ -412,7 +412,7 @@ NullHttpChannel::AsyncOpen(nsIStreamListener *aListener) { } NS_IMETHODIMP -NullHttpChannel::GetContentDisposition(uint32_t *aContentDisposition) { +NullHttpChannel::GetContentDisposition(uint32_t* aContentDisposition) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -423,29 +423,29 @@ NullHttpChannel::SetContentDisposition(uint32_t aContentDisposition) { NS_IMETHODIMP NullHttpChannel::GetContentDispositionFilename( - nsAString &aContentDispositionFilename) { + nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP NullHttpChannel::SetContentDispositionFilename( - const nsAString &aContentDispositionFilename) { + const nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP NullHttpChannel::GetContentDispositionHeader( - nsACString &aContentDispositionHeader) { + nsACString& aContentDispositionHeader) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) { +NullHttpChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) { +NullHttpChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -454,13 +454,13 @@ NullHttpChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) { //----------------------------------------------------------------------------- NS_IMETHODIMP -NullHttpChannel::GetName(nsACString &aName) { return NS_ERROR_NOT_IMPLEMENTED; } +NullHttpChannel::GetName(nsACString& aName) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::IsPending(bool *_retval) { return NS_ERROR_NOT_IMPLEMENTED; } +NullHttpChannel::IsPending(bool* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetStatus(nsresult *aStatus) { +NullHttpChannel::GetStatus(nsresult* aStatus) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -474,17 +474,17 @@ NS_IMETHODIMP NullHttpChannel::Resume() { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) { +NullHttpChannel::GetLoadGroup(nsILoadGroup** aLoadGroup) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) { +NullHttpChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetLoadFlags(nsLoadFlags *aLoadFlags) { +NullHttpChannel::GetLoadFlags(nsLoadFlags* aLoadFlags) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -494,7 +494,7 @@ NullHttpChannel::SetLoadFlags(nsLoadFlags aLoadFlags) { } NS_IMETHODIMP -NullHttpChannel::GetIsDocument(bool *aIsDocument) { +NullHttpChannel::GetIsDocument(bool* aIsDocument) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -503,7 +503,7 @@ NullHttpChannel::GetIsDocument(bool *aIsDocument) { //----------------------------------------------------------------------------- NS_IMETHODIMP -NullHttpChannel::GetTimingEnabled(bool *aTimingEnabled) { +NullHttpChannel::GetTimingEnabled(bool* aTimingEnabled) { // We don't want to report timing for null channels. *aTimingEnabled = false; return NS_OK; @@ -515,7 +515,7 @@ NullHttpChannel::SetTimingEnabled(bool aTimingEnabled) { } NS_IMETHODIMP -NullHttpChannel::GetRedirectCount(uint8_t *aRedirectCount) { +NullHttpChannel::GetRedirectCount(uint8_t* aRedirectCount) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -525,7 +525,7 @@ NullHttpChannel::SetRedirectCount(uint8_t aRedirectCount) { } NS_IMETHODIMP -NullHttpChannel::GetInternalRedirectCount(uint8_t *aRedirectCount) { +NullHttpChannel::GetInternalRedirectCount(uint8_t* aRedirectCount) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -535,7 +535,7 @@ NullHttpChannel::SetInternalRedirectCount(uint8_t aRedirectCount) { } NS_IMETHODIMP -NullHttpChannel::GetChannelCreation(mozilla::TimeStamp *aChannelCreation) { +NullHttpChannel::GetChannelCreation(mozilla::TimeStamp* aChannelCreation) { *aChannelCreation = mChannelCreationTimestamp; return NS_OK; } @@ -550,7 +550,7 @@ NullHttpChannel::SetChannelCreation(TimeStamp aValue) { } NS_IMETHODIMP -NullHttpChannel::GetAsyncOpen(mozilla::TimeStamp *aAsyncOpen) { +NullHttpChannel::GetAsyncOpen(mozilla::TimeStamp* aAsyncOpen) { *aAsyncOpen = mAsyncOpenTime; return NS_OK; } @@ -563,7 +563,7 @@ NullHttpChannel::SetAsyncOpen(TimeStamp aValue) { } NS_IMETHODIMP -NullHttpChannel::GetLaunchServiceWorkerStart(mozilla::TimeStamp *_retval) { +NullHttpChannel::GetLaunchServiceWorkerStart(mozilla::TimeStamp* _retval) { MOZ_ASSERT(_retval); *_retval = mAsyncOpenTime; return NS_OK; @@ -575,7 +575,7 @@ NullHttpChannel::SetLaunchServiceWorkerStart(mozilla::TimeStamp aTimeStamp) { } NS_IMETHODIMP -NullHttpChannel::GetLaunchServiceWorkerEnd(mozilla::TimeStamp *_retval) { +NullHttpChannel::GetLaunchServiceWorkerEnd(mozilla::TimeStamp* _retval) { MOZ_ASSERT(_retval); *_retval = mAsyncOpenTime; return NS_OK; @@ -587,7 +587,7 @@ NullHttpChannel::SetLaunchServiceWorkerEnd(mozilla::TimeStamp aTimeStamp) { } NS_IMETHODIMP -NullHttpChannel::GetDispatchFetchEventStart(mozilla::TimeStamp *_retval) { +NullHttpChannel::GetDispatchFetchEventStart(mozilla::TimeStamp* _retval) { MOZ_ASSERT(_retval); *_retval = mAsyncOpenTime; return NS_OK; @@ -599,7 +599,7 @@ NullHttpChannel::SetDispatchFetchEventStart(mozilla::TimeStamp aTimeStamp) { } NS_IMETHODIMP -NullHttpChannel::GetDispatchFetchEventEnd(mozilla::TimeStamp *_retval) { +NullHttpChannel::GetDispatchFetchEventEnd(mozilla::TimeStamp* _retval) { MOZ_ASSERT(_retval); *_retval = mAsyncOpenTime; return NS_OK; @@ -611,7 +611,7 @@ NullHttpChannel::SetDispatchFetchEventEnd(mozilla::TimeStamp aTimeStamp) { } NS_IMETHODIMP -NullHttpChannel::GetHandleFetchEventStart(mozilla::TimeStamp *_retval) { +NullHttpChannel::GetHandleFetchEventStart(mozilla::TimeStamp* _retval) { MOZ_ASSERT(_retval); *_retval = mAsyncOpenTime; return NS_OK; @@ -623,7 +623,7 @@ NullHttpChannel::SetHandleFetchEventStart(mozilla::TimeStamp aTimeStamp) { } NS_IMETHODIMP -NullHttpChannel::GetHandleFetchEventEnd(mozilla::TimeStamp *_retval) { +NullHttpChannel::GetHandleFetchEventEnd(mozilla::TimeStamp* _retval) { MOZ_ASSERT(_retval); *_retval = mAsyncOpenTime; return NS_OK; @@ -635,62 +635,62 @@ NullHttpChannel::SetHandleFetchEventEnd(mozilla::TimeStamp aTimeStamp) { } NS_IMETHODIMP -NullHttpChannel::GetDomainLookupStart(mozilla::TimeStamp *aDomainLookupStart) { +NullHttpChannel::GetDomainLookupStart(mozilla::TimeStamp* aDomainLookupStart) { *aDomainLookupStart = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetDomainLookupEnd(mozilla::TimeStamp *aDomainLookupEnd) { +NullHttpChannel::GetDomainLookupEnd(mozilla::TimeStamp* aDomainLookupEnd) { *aDomainLookupEnd = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetConnectStart(mozilla::TimeStamp *aConnectStart) { +NullHttpChannel::GetConnectStart(mozilla::TimeStamp* aConnectStart) { *aConnectStart = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetTcpConnectEnd(mozilla::TimeStamp *aTcpConnectEnd) { +NullHttpChannel::GetTcpConnectEnd(mozilla::TimeStamp* aTcpConnectEnd) { *aTcpConnectEnd = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP NullHttpChannel::GetSecureConnectionStart( - mozilla::TimeStamp *aSecureConnectionStart) { + mozilla::TimeStamp* aSecureConnectionStart) { *aSecureConnectionStart = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetConnectEnd(mozilla::TimeStamp *aConnectEnd) { +NullHttpChannel::GetConnectEnd(mozilla::TimeStamp* aConnectEnd) { *aConnectEnd = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetRequestStart(mozilla::TimeStamp *aRequestStart) { +NullHttpChannel::GetRequestStart(mozilla::TimeStamp* aRequestStart) { *aRequestStart = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetResponseStart(mozilla::TimeStamp *aResponseStart) { +NullHttpChannel::GetResponseStart(mozilla::TimeStamp* aResponseStart) { *aResponseStart = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetResponseEnd(mozilla::TimeStamp *aResponseEnd) { +NullHttpChannel::GetResponseEnd(mozilla::TimeStamp* aResponseEnd) { *aResponseEnd = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetRedirectStart(mozilla::TimeStamp *aRedirectStart) { +NullHttpChannel::GetRedirectStart(mozilla::TimeStamp* aRedirectStart) { *aRedirectStart = mAsyncOpenTime; return NS_OK; } @@ -701,7 +701,7 @@ NullHttpChannel::SetRedirectStart(mozilla::TimeStamp aRedirectStart) { } NS_IMETHODIMP -NullHttpChannel::GetRedirectEnd(mozilla::TimeStamp *aRedirectEnd) { +NullHttpChannel::GetRedirectEnd(mozilla::TimeStamp* aRedirectEnd) { *aRedirectEnd = mAsyncOpenTime; return NS_OK; } @@ -712,19 +712,19 @@ NullHttpChannel::SetRedirectEnd(mozilla::TimeStamp aRedirectEnd) { } NS_IMETHODIMP -NullHttpChannel::GetInitiatorType(nsAString &aInitiatorType) { +NullHttpChannel::GetInitiatorType(nsAString& aInitiatorType) { aInitiatorType = mInitiatorType; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::SetInitiatorType(const nsAString &aInitiatorType) { +NullHttpChannel::SetInitiatorType(const nsAString& aInitiatorType) { mInitiatorType = aInitiatorType; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetAllRedirectsSameOrigin(bool *aAllRedirectsSameOrigin) { +NullHttpChannel::GetAllRedirectsSameOrigin(bool* aAllRedirectsSameOrigin) { *aAllRedirectsSameOrigin = mAllRedirectsSameOrigin; return NS_OK; } @@ -736,7 +736,7 @@ NullHttpChannel::SetAllRedirectsSameOrigin(bool aAllRedirectsSameOrigin) { NS_IMETHODIMP NullHttpChannel::GetAllRedirectsPassTimingAllowCheck( - bool *aAllRedirectsPassTimingAllowCheck) { + bool* aAllRedirectsPassTimingAllowCheck) { *aAllRedirectsPassTimingAllowCheck = mAllRedirectsPassTimingAllowCheck; return NS_OK; } @@ -748,7 +748,7 @@ NullHttpChannel::SetAllRedirectsPassTimingAllowCheck( } NS_IMETHODIMP -NullHttpChannel::TimingAllowCheck(nsIPrincipal *aOrigin, bool *_retval) { +NullHttpChannel::TimingAllowCheck(nsIPrincipal* aOrigin, bool* _retval) { if (!mResourcePrincipal || !aOrigin) { *_retval = false; return NS_OK; @@ -779,19 +779,19 @@ NullHttpChannel::TimingAllowCheck(nsIPrincipal *aOrigin, bool *_retval) { } NS_IMETHODIMP -NullHttpChannel::GetCacheReadStart(mozilla::TimeStamp *aCacheReadStart) { +NullHttpChannel::GetCacheReadStart(mozilla::TimeStamp* aCacheReadStart) { *aCacheReadStart = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetCacheReadEnd(mozilla::TimeStamp *aCacheReadEnd) { +NullHttpChannel::GetCacheReadEnd(mozilla::TimeStamp* aCacheReadEnd) { *aCacheReadEnd = mAsyncOpenTime; return NS_OK; } NS_IMETHODIMP -NullHttpChannel::GetIsMainDocumentChannel(bool *aValue) { +NullHttpChannel::GetIsMainDocumentChannel(bool* aValue) { *aValue = false; return NS_OK; } @@ -802,15 +802,15 @@ NullHttpChannel::SetIsMainDocumentChannel(bool aValue) { } NS_IMETHODIMP -NullHttpChannel::LogBlockedCORSRequest(const nsAString &aMessage, - const nsACString &aCategory) { +NullHttpChannel::LogBlockedCORSRequest(const nsAString& aMessage, + const nsACString& aCategory) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::LogMimeTypeMismatch(const nsACString &aMessageName, - bool aWarning, const nsAString &aURL, - const nsAString &aContentType) { +NullHttpChannel::LogMimeTypeMismatch(const nsACString& aMessageName, + bool aWarning, const nsAString& aURL, + const nsAString& aContentType) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -820,24 +820,24 @@ NullHttpChannel::SetReportResourceTiming(bool enabled) { } NS_IMETHODIMP -NullHttpChannel::GetReportResourceTiming(bool *_retval) { +NullHttpChannel::GetReportResourceTiming(bool* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -NullHttpChannel::GetServerTiming(nsIArray **aServerTiming) { +NullHttpChannel::GetServerTiming(nsIArray** aServerTiming) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP NullHttpChannel::GetNativeServerTiming( - nsTArray> &aServerTiming) { + nsTArray>& aServerTiming) { return NS_ERROR_NOT_IMPLEMENTED; } #define IMPL_TIMING_ATTR(name) \ NS_IMETHODIMP \ - NullHttpChannel::Get##name##Time(PRTime *_retval) { \ + NullHttpChannel::Get##name##Time(PRTime* _retval) { \ TimeStamp stamp; \ Get##name(&stamp); \ if (stamp.IsNull()) { \ diff --git a/netwerk/protocol/http/NullHttpChannel.h b/netwerk/protocol/http/NullHttpChannel.h index cb2638918de91..54e2bc0460a17 100644 --- a/netwerk/protocol/http/NullHttpChannel.h +++ b/netwerk/protocol/http/NullHttpChannel.h @@ -33,12 +33,12 @@ class NullHttpChannel final : public nsINullChannel, // Copies the URI, Principal and Timing-Allow-Origin headers from the // passed channel to this object, to be used for resource timing checks - explicit NullHttpChannel(nsIHttpChannel *chan); + explicit NullHttpChannel(nsIHttpChannel* chan); // Same signature as nsHttpChannel::Init - MOZ_MUST_USE nsresult Init(nsIURI *aURI, uint32_t aCaps, - nsProxyInfo *aProxyInfo, - uint32_t aProxyResolveFlags, nsIURI *aProxyURI); + MOZ_MUST_USE nsresult Init(nsIURI* aURI, uint32_t aCaps, + nsProxyInfo* aProxyInfo, + uint32_t aProxyResolveFlags, nsIURI* aProxyURI); private: ~NullHttpChannel() = default; diff --git a/netwerk/protocol/http/NullHttpTransaction.cpp b/netwerk/protocol/http/NullHttpTransaction.cpp index 56baf1dff9760..00661d090d33f 100644 --- a/netwerk/protocol/http/NullHttpTransaction.cpp +++ b/netwerk/protocol/http/NullHttpTransaction.cpp @@ -25,11 +25,11 @@ class CallObserveActivity final : public nsIRunnable { public: NS_DECL_THREADSAFE_ISUPPORTS - CallObserveActivity(nsIHttpActivityObserver *aActivityDistributor, - const nsCString &aHost, int32_t aPort, bool aEndToEndSSL, + CallObserveActivity(nsIHttpActivityObserver* aActivityDistributor, + const nsCString& aHost, int32_t aPort, bool aEndToEndSSL, uint32_t aActivityType, uint32_t aActivitySubtype, PRTime aTimestamp, uint64_t aExtraSizeData, - const nsACString &aExtraStringData) + const nsACString& aExtraStringData) : mActivityDistributor(aActivityDistributor), mHost(aHost), mPort(aPort), @@ -84,8 +84,8 @@ NS_IMPL_ISUPPORTS(CallObserveActivity, nsIRunnable) NS_IMPL_ISUPPORTS(NullHttpTransaction, NullHttpTransaction, nsISupportsWeakReference) -NullHttpTransaction::NullHttpTransaction(nsHttpConnectionInfo *ci, - nsIInterfaceRequestor *callbacks, +NullHttpTransaction::NullHttpTransaction(nsHttpConnectionInfo* ci, + nsIInterfaceRequestor* callbacks, uint32_t caps) : mStatus(NS_OK), mCaps(caps | NS_HTTP_ALLOW_KEEPALIVE), @@ -133,20 +133,20 @@ bool NullHttpTransaction::Claim() { void NullHttpTransaction::Unclaim() { mClaimed = false; } -void NullHttpTransaction::SetConnection(nsAHttpConnection *conn) { +void NullHttpTransaction::SetConnection(nsAHttpConnection* conn) { mConnection = conn; } -nsAHttpConnection *NullHttpTransaction::Connection() { +nsAHttpConnection* NullHttpTransaction::Connection() { return mConnection.get(); } -void NullHttpTransaction::GetSecurityCallbacks(nsIInterfaceRequestor **outCB) { +void NullHttpTransaction::GetSecurityCallbacks(nsIInterfaceRequestor** outCB) { nsCOMPtr copyCB(mCallbacks); *outCB = copyCB.forget().take(); } -void NullHttpTransaction::OnTransportStatus(nsITransport *transport, +void NullHttpTransaction::OnTransportStatus(nsITransport* transport, nsresult status, int64_t progress) { if (status == NS_NET_STATUS_RESOLVING_HOST) { if (mTimings.domainLookupStart.IsNull()) { @@ -203,24 +203,24 @@ void NullHttpTransaction::SetDNSWasRefreshed() { mCapsToClear |= NS_HTTP_REFRESH_DNS; } -nsresult NullHttpTransaction::ReadSegments(nsAHttpSegmentReader *reader, +nsresult NullHttpTransaction::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count, - uint32_t *countRead) { + uint32_t* countRead) { *countRead = 0; mIsDone = true; return NS_BASE_STREAM_CLOSED; } -nsresult NullHttpTransaction::WriteSegments(nsAHttpSegmentWriter *writer, +nsresult NullHttpTransaction::WriteSegments(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) { + uint32_t* countWritten) { *countWritten = 0; return NS_BASE_STREAM_CLOSED; } uint32_t NullHttpTransaction::Http1xTransactionCount() { return 0; } -nsHttpRequestHead *NullHttpTransaction::RequestHead() { +nsHttpRequestHead* NullHttpTransaction::RequestHead() { // We suport a requesthead at all so that a CONNECT tunnel transaction // can obtain a Host header from it, but we lazy-popualate that header. @@ -257,7 +257,7 @@ nsHttpRequestHead *NullHttpTransaction::RequestHead() { } nsresult NullHttpTransaction::TakeSubTransactions( - nsTArray > &outTransactions) { + nsTArray >& outTransactions) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -278,7 +278,7 @@ void NullHttpTransaction::Close(nsresult reason) { } } -nsHttpConnectionInfo *NullHttpTransaction::ConnectionInfo() { +nsHttpConnectionInfo* NullHttpTransaction::ConnectionInfo() { return mConnectionInfo; } diff --git a/netwerk/protocol/http/NullHttpTransaction.h b/netwerk/protocol/http/NullHttpTransaction.h index 028824750b84b..ea8fdc11b14c5 100644 --- a/netwerk/protocol/http/NullHttpTransaction.h +++ b/netwerk/protocol/http/NullHttpTransaction.h @@ -39,15 +39,15 @@ class NullHttpTransaction : public nsAHttpTransaction { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION - NullHttpTransaction(nsHttpConnectionInfo *ci, - nsIInterfaceRequestor *callbacks, uint32_t caps); + NullHttpTransaction(nsHttpConnectionInfo* ci, + nsIInterfaceRequestor* callbacks, uint32_t caps); MOZ_MUST_USE bool Claim(); void Unclaim(); // Overload of nsAHttpTransaction methods bool IsNullTransaction() final { return true; } - NullHttpTransaction *QueryNullTransaction() final { return this; } + NullHttpTransaction* QueryNullTransaction() final { return this; } bool ResponseTimeoutEnabled() const final { return true; } PRIntervalTime ResponseTimeout() final { return PR_SecondsToInterval(15); } @@ -76,7 +76,7 @@ class NullHttpTransaction : public nsAHttpTransaction { protected: uint32_t mCaps; - nsHttpRequestHead *mRequestHead; + nsHttpRequestHead* mRequestHead; private: // mCapsToClear holds flags that should be cleared in mCaps, e.g. unset diff --git a/netwerk/protocol/http/TunnelUtils.cpp b/netwerk/protocol/http/TunnelUtils.cpp index 834e2866cbb09..30b0a3794648d 100644 --- a/netwerk/protocol/http/TunnelUtils.cpp +++ b/netwerk/protocol/http/TunnelUtils.cpp @@ -33,13 +33,13 @@ namespace net { static PRDescIdentity sLayerIdentity; static PRIOMethods sLayerMethods; -static PRIOMethods *sLayerMethodsPtr = nullptr; +static PRIOMethods* sLayerMethodsPtr = nullptr; -TLSFilterTransaction::TLSFilterTransaction(nsAHttpTransaction *aWrapped, - const char *aTLSHost, +TLSFilterTransaction::TLSFilterTransaction(nsAHttpTransaction* aWrapped, + const char* aTLSHost, int32_t aTLSPort, - nsAHttpSegmentReader *aReader, - nsAHttpSegmentWriter *aWriter) + nsAHttpSegmentReader* aReader, + nsAHttpSegmentWriter* aWriter) : mTransaction(aWrapped), mEncryptedTextUsed(0), mEncryptedTextSize(0), @@ -81,7 +81,7 @@ TLSFilterTransaction::TLSFilterTransaction(nsAHttpTransaction *aWrapped, mFD = PR_CreateIOLayerStub(sLayerIdentity, &sLayerMethods); if (provider && mFD) { - mFD->secret = reinterpret_cast(this); + mFD->secret = reinterpret_cast(this); provider->AddToSocket(PR_AF_INET, aTLSHost, aTLSPort, nullptr, OriginAttributes(), 0, 0, mFD, getter_AddRefs(mSecInfo)); @@ -132,7 +132,7 @@ void TLSFilterTransaction::Close(nsresult aReason) { mTransaction = nullptr; RefPtr baseTrans(do_QueryReferent(mWeakTrans)); - SpdyConnectTransaction *trans = + SpdyConnectTransaction* trans = baseTrans ? baseTrans->QuerySpdyConnectTransaction() : nullptr; LOG(("TLSFilterTransaction::Close %p aReason=%" PRIx32 " trans=%p\n", this, @@ -144,8 +144,8 @@ void TLSFilterTransaction::Close(nsresult aReason) { } } -nsresult TLSFilterTransaction::OnReadSegment(const char *aData, uint32_t aCount, - uint32_t *outCountRead) { +nsresult TLSFilterTransaction::OnReadSegment(const char* aData, uint32_t aCount, + uint32_t* outCountRead) { LOG(("TLSFilterTransaction %p OnReadSegment %d (buffered %d)\n", this, aCount, mEncryptedTextUsed)); @@ -244,7 +244,7 @@ nsresult TLSFilterTransaction::OnReadSegment(const char *aData, uint32_t aCount, return NS_OK; } -int32_t TLSFilterTransaction::FilterOutput(const char *aBuf, int32_t aAmount) { +int32_t TLSFilterTransaction::FilterOutput(const char* aBuf, int32_t aAmount) { EnsureBuffer(mEncryptedText, mEncryptedTextUsed + aAmount, mEncryptedTextUsed, mEncryptedTextSize); memcpy(&mEncryptedText[mEncryptedTextUsed], aBuf, aAmount); @@ -264,8 +264,8 @@ nsresult TLSFilterTransaction::CommitToSegmentSize(uint32_t size, return mSegmentReader->CommitToSegmentSize(size + 1024, forceCommitment); } -nsresult TLSFilterTransaction::OnWriteSegment(char *aData, uint32_t aCount, - uint32_t *outCountRead) { +nsresult TLSFilterTransaction::OnWriteSegment(char* aData, uint32_t aCount, + uint32_t* outCountRead) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(mSegmentWriter); LOG(("TLSFilterTransaction::OnWriteSegment %p max=%d\n", this, aCount)); @@ -307,7 +307,7 @@ nsresult TLSFilterTransaction::OnWriteSegment(char *aData, uint32_t aCount, return mFilterReadCode; } -int32_t TLSFilterTransaction::FilterInput(char *aBuf, int32_t aAmount) { +int32_t TLSFilterTransaction::FilterInput(char* aBuf, int32_t aAmount) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(mSegmentWriter); LOG(("TLSFilterTransaction::FilterInput max=%d\n", aAmount)); @@ -331,9 +331,9 @@ int32_t TLSFilterTransaction::FilterInput(char *aBuf, int32_t aAmount) { return outCountRead; } -nsresult TLSFilterTransaction::ReadSegments(nsAHttpSegmentReader *aReader, +nsresult TLSFilterTransaction::ReadSegments(nsAHttpSegmentReader* aReader, uint32_t aCount, - uint32_t *outCountRead) { + uint32_t* outCountRead) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("TLSFilterTransaction::ReadSegments %p max=%d\n", this, aCount)); @@ -356,9 +356,9 @@ nsresult TLSFilterTransaction::ReadSegments(nsAHttpSegmentReader *aReader, return NS_SUCCEEDED(rv) ? mReadSegmentReturnValue : rv; } -nsresult TLSFilterTransaction::WriteSegments(nsAHttpSegmentWriter *aWriter, +nsresult TLSFilterTransaction::WriteSegments(nsAHttpSegmentWriter* aWriter, uint32_t aCount, - uint32_t *outCountWritten) { + uint32_t* outCountWritten) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("TLSFilterTransaction::WriteSegments %p max=%d\n", this, aCount)); @@ -382,7 +382,7 @@ nsresult TLSFilterTransaction::WriteSegments(nsAHttpSegmentWriter *aWriter, } nsresult TLSFilterTransaction::GetTransactionSecurityInfo( - nsISupports **outSecInfo) { + nsISupports** outSecInfo) { if (!mSecInfo) { return NS_ERROR_FAILURE; } @@ -392,7 +392,7 @@ nsresult TLSFilterTransaction::GetTransactionSecurityInfo( return NS_OK; } -nsresult TLSFilterTransaction::NudgeTunnel(NudgeTunnelCallback *aCallback) { +nsresult TLSFilterTransaction::NudgeTunnel(NudgeTunnelCallback* aCallback) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("TLSFilterTransaction %p NudgeTunnel\n", this)); mNudgeCallback = nullptr; @@ -449,7 +449,7 @@ nsresult TLSFilterTransaction::NudgeTunnel(NudgeTunnelCallback *aCallback) { } NS_IMETHODIMP -TLSFilterTransaction::Notify(nsITimer *timer) { +TLSFilterTransaction::Notify(nsITimer* timer) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("TLSFilterTransaction %p NudgeTunnel notify\n", this)); @@ -464,7 +464,7 @@ TLSFilterTransaction::Notify(nsITimer *timer) { } NS_IMETHODIMP -TLSFilterTransaction::GetName(nsACString &aName) { +TLSFilterTransaction::GetName(nsACString& aName) { aName.AssignLiteral("TLSFilterTransaction"); return NS_OK; } @@ -482,10 +482,10 @@ nsresult TLSFilterTransaction::StartTimerCallback() { return NS_OK; } -PRStatus TLSFilterTransaction::GetPeerName(PRFileDesc *aFD, PRNetAddr *addr) { +PRStatus TLSFilterTransaction::GetPeerName(PRFileDesc* aFD, PRNetAddr* addr) { NetAddr peeraddr; - TLSFilterTransaction *self = - reinterpret_cast(aFD->secret); + TLSFilterTransaction* self = + reinterpret_cast(aFD->secret); if (!self->mTransaction || NS_FAILED(self->mTransaction->Connection()->Transport()->GetPeerAddr( @@ -496,8 +496,8 @@ PRStatus TLSFilterTransaction::GetPeerName(PRFileDesc *aFD, PRNetAddr *addr) { return PR_SUCCESS; } -PRStatus TLSFilterTransaction::GetSocketOption(PRFileDesc *aFD, - PRSocketOptionData *aOpt) { +PRStatus TLSFilterTransaction::GetSocketOption(PRFileDesc* aFD, + PRSocketOptionData* aOpt) { if (aOpt->option == PR_SockOpt_Nonblocking) { aOpt->value.non_blocking = PR_TRUE; return PR_SUCCESS; @@ -505,35 +505,35 @@ PRStatus TLSFilterTransaction::GetSocketOption(PRFileDesc *aFD, return PR_FAILURE; } -PRStatus TLSFilterTransaction::SetSocketOption(PRFileDesc *aFD, - const PRSocketOptionData *aOpt) { +PRStatus TLSFilterTransaction::SetSocketOption(PRFileDesc* aFD, + const PRSocketOptionData* aOpt) { return PR_FAILURE; } -PRStatus TLSFilterTransaction::FilterClose(PRFileDesc *aFD) { +PRStatus TLSFilterTransaction::FilterClose(PRFileDesc* aFD) { return PR_SUCCESS; } -int32_t TLSFilterTransaction::FilterWrite(PRFileDesc *aFD, const void *aBuf, +int32_t TLSFilterTransaction::FilterWrite(PRFileDesc* aFD, const void* aBuf, int32_t aAmount) { - TLSFilterTransaction *self = - reinterpret_cast(aFD->secret); - return self->FilterOutput(static_cast(aBuf), aAmount); + TLSFilterTransaction* self = + reinterpret_cast(aFD->secret); + return self->FilterOutput(static_cast(aBuf), aAmount); } -int32_t TLSFilterTransaction::FilterSend(PRFileDesc *aFD, const void *aBuf, +int32_t TLSFilterTransaction::FilterSend(PRFileDesc* aFD, const void* aBuf, int32_t aAmount, int, PRIntervalTime) { return FilterWrite(aFD, aBuf, aAmount); } -int32_t TLSFilterTransaction::FilterRead(PRFileDesc *aFD, void *aBuf, +int32_t TLSFilterTransaction::FilterRead(PRFileDesc* aFD, void* aBuf, int32_t aAmount) { - TLSFilterTransaction *self = - reinterpret_cast(aFD->secret); - return self->FilterInput(static_cast(aBuf), aAmount); + TLSFilterTransaction* self = + reinterpret_cast(aFD->secret); + return self->FilterInput(static_cast(aBuf), aAmount); } -int32_t TLSFilterTransaction::FilterRecv(PRFileDesc *aFD, void *aBuf, +int32_t TLSFilterTransaction::FilterRecv(PRFileDesc* aFD, void* aBuf, int32_t aAmount, int, PRIntervalTime) { return FilterRead(aFD, aBuf, aAmount); } @@ -542,7 +542,7 @@ int32_t TLSFilterTransaction::FilterRecv(PRFileDesc *aFD, void *aBuf, // The other methods of TLSFilterTransaction just call mTransaction->method ///// -void TLSFilterTransaction::SetConnection(nsAHttpConnection *aConnection) { +void TLSFilterTransaction::SetConnection(nsAHttpConnection* aConnection) { if (!mTransaction) { return; } @@ -550,21 +550,21 @@ void TLSFilterTransaction::SetConnection(nsAHttpConnection *aConnection) { mTransaction->SetConnection(aConnection); } -nsAHttpConnection *TLSFilterTransaction::Connection() { +nsAHttpConnection* TLSFilterTransaction::Connection() { if (!mTransaction) { return nullptr; } return mTransaction->Connection(); } -void TLSFilterTransaction::GetSecurityCallbacks(nsIInterfaceRequestor **outCB) { +void TLSFilterTransaction::GetSecurityCallbacks(nsIInterfaceRequestor** outCB) { if (!mTransaction) { return; } mTransaction->GetSecurityCallbacks(outCB); } -void TLSFilterTransaction::OnTransportStatus(nsITransport *aTransport, +void TLSFilterTransaction::OnTransportStatus(nsITransport* aTransport, nsresult aStatus, int64_t aProgress) { if (!mTransaction) { @@ -573,7 +573,7 @@ void TLSFilterTransaction::OnTransportStatus(nsITransport *aTransport, mTransaction->OnTransportStatus(aTransport, aStatus, aProgress); } -nsHttpConnectionInfo *TLSFilterTransaction::ConnectionInfo() { +nsHttpConnectionInfo* TLSFilterTransaction::ConnectionInfo() { if (!mTransaction) { return nullptr; } @@ -619,7 +619,7 @@ void TLSFilterTransaction::SetProxyConnectFailed() { mTransaction->SetProxyConnectFailed(); } -nsHttpRequestHead *TLSFilterTransaction::RequestHead() { +nsHttpRequestHead* TLSFilterTransaction::RequestHead() { if (!mTransaction) { return nullptr; } @@ -636,7 +636,7 @@ uint32_t TLSFilterTransaction::Http1xTransactionCount() { } nsresult TLSFilterTransaction::TakeSubTransactions( - nsTArray > &outTransactions) { + nsTArray >& outTransactions) { LOG(("TLSFilterTransaction::TakeSubTransactions [this=%p] mTransaction %p\n", this, mTransaction.get())); @@ -654,7 +654,7 @@ nsresult TLSFilterTransaction::TakeSubTransactions( } nsresult TLSFilterTransaction::SetProxiedTransaction( - nsAHttpTransaction *aTrans, nsAHttpTransaction *aSpdyConnectTransaction) { + nsAHttpTransaction* aTrans, nsAHttpTransaction* aSpdyConnectTransaction) { LOG( ("TLSFilterTransaction::SetProxiedTransaction [this=%p] aTrans=%p, " "aSpdyConnectTransaction=%p\n", @@ -680,14 +680,14 @@ bool TLSFilterTransaction::IsNullTransaction() { return mTransaction->IsNullTransaction(); } -NullHttpTransaction *TLSFilterTransaction::QueryNullTransaction() { +NullHttpTransaction* TLSFilterTransaction::QueryNullTransaction() { if (!mTransaction) { return nullptr; } return mTransaction->QueryNullTransaction(); } -nsHttpTransaction *TLSFilterTransaction::QueryHttpTransaction() { +nsHttpTransaction* TLSFilterTransaction::QueryHttpTransaction() { if (!mTransaction) { return nullptr; } @@ -699,7 +699,7 @@ class SocketInWrapper : public nsIAsyncInputStream, NS_DECL_THREADSAFE_ISUPPORTS NS_FORWARD_NSIASYNCINPUTSTREAM(mStream->) - SocketInWrapper(nsIAsyncInputStream *aWrapped, TLSFilterTransaction *aFilter) + SocketInWrapper(nsIAsyncInputStream* aWrapped, TLSFilterTransaction* aFilter) : mStream(aWrapped), mTLSFilter(aFilter) {} NS_IMETHOD Close() override { @@ -707,23 +707,23 @@ class SocketInWrapper : public nsIAsyncInputStream, return mStream->Close(); } - NS_IMETHOD Available(uint64_t *_retval) override { + NS_IMETHOD Available(uint64_t* _retval) override { return mStream->Available(_retval); } - NS_IMETHOD IsNonBlocking(bool *_retval) override { + NS_IMETHOD IsNonBlocking(bool* _retval) override { return mStream->IsNonBlocking(_retval); } - NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, - uint32_t aCount, uint32_t *_retval) override { + NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void* aClosure, + uint32_t aCount, uint32_t* _retval) override { return mStream->ReadSegments(aWriter, aClosure, aCount, _retval); } // finally, ones that don't get forwarded :) - NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) override; - virtual nsresult OnWriteSegment(char *segment, uint32_t count, - uint32_t *countWritten) override; + NS_IMETHOD Read(char* aBuf, uint32_t aCount, uint32_t* _retval) override; + virtual nsresult OnWriteSegment(char* segment, uint32_t count, + uint32_t* countWritten) override; private: virtual ~SocketInWrapper() = default; @@ -733,8 +733,8 @@ class SocketInWrapper : public nsIAsyncInputStream, RefPtr mTLSFilter; }; -nsresult SocketInWrapper::OnWriteSegment(char *segment, uint32_t count, - uint32_t *countWritten) { +nsresult SocketInWrapper::OnWriteSegment(char* segment, uint32_t count, + uint32_t* countWritten) { LOG(("SocketInWrapper OnWriteSegment %d %p filter=%p\n", count, this, mTLSFilter.get())); @@ -745,7 +745,7 @@ nsresult SocketInWrapper::OnWriteSegment(char *segment, uint32_t count, } NS_IMETHODIMP -SocketInWrapper::Read(char *aBuf, uint32_t aCount, uint32_t *_retval) { +SocketInWrapper::Read(char* aBuf, uint32_t aCount, uint32_t* _retval) { LOG(("SocketInWrapper Read %d %p filter=%p\n", aCount, this, mTLSFilter.get())); @@ -762,8 +762,8 @@ class SocketOutWrapper : public nsIAsyncOutputStream, NS_DECL_THREADSAFE_ISUPPORTS NS_FORWARD_NSIASYNCOUTPUTSTREAM(mStream->) - SocketOutWrapper(nsIAsyncOutputStream *aWrapped, - TLSFilterTransaction *aFilter) + SocketOutWrapper(nsIAsyncOutputStream* aWrapped, + TLSFilterTransaction* aFilter) : mStream(aWrapped), mTLSFilter(aFilter) {} NS_IMETHOD Close() override { @@ -773,25 +773,25 @@ class SocketOutWrapper : public nsIAsyncOutputStream, NS_IMETHOD Flush() override { return mStream->Flush(); } - NS_IMETHOD IsNonBlocking(bool *_retval) override { + NS_IMETHOD IsNonBlocking(bool* _retval) override { return mStream->IsNonBlocking(_retval); } - NS_IMETHOD WriteSegments(nsReadSegmentFun aReader, void *aClosure, - uint32_t aCount, uint32_t *_retval) override { + NS_IMETHOD WriteSegments(nsReadSegmentFun aReader, void* aClosure, + uint32_t aCount, uint32_t* _retval) override { return mStream->WriteSegments(aReader, aClosure, aCount, _retval); } - NS_IMETHOD WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, - uint32_t *_retval) override { + NS_IMETHOD WriteFrom(nsIInputStream* aFromStream, uint32_t aCount, + uint32_t* _retval) override { return mStream->WriteFrom(aFromStream, aCount, _retval); } // finally, ones that don't get forwarded :) - NS_IMETHOD Write(const char *aBuf, uint32_t aCount, - uint32_t *_retval) override; - virtual nsresult OnReadSegment(const char *segment, uint32_t count, - uint32_t *countRead) override; + NS_IMETHOD Write(const char* aBuf, uint32_t aCount, + uint32_t* _retval) override; + virtual nsresult OnReadSegment(const char* segment, uint32_t count, + uint32_t* countRead) override; private: virtual ~SocketOutWrapper() = default; @@ -801,13 +801,13 @@ class SocketOutWrapper : public nsIAsyncOutputStream, RefPtr mTLSFilter; }; -nsresult SocketOutWrapper::OnReadSegment(const char *segment, uint32_t count, - uint32_t *countWritten) { +nsresult SocketOutWrapper::OnReadSegment(const char* segment, uint32_t count, + uint32_t* countWritten) { return mStream->Write(segment, count, countWritten); } NS_IMETHODIMP -SocketOutWrapper::Write(const char *aBuf, uint32_t aCount, uint32_t *_retval) { +SocketOutWrapper::Write(const char* aBuf, uint32_t aCount, uint32_t* _retval) { LOG(("SocketOutWrapper Write %d %p filter=%p\n", aCount, this, mTLSFilter.get())); @@ -819,22 +819,22 @@ SocketOutWrapper::Write(const char *aBuf, uint32_t aCount, uint32_t *_retval) { return mTLSFilter->OnReadSegment(aBuf, aCount, _retval); } -void TLSFilterTransaction::newIODriver(nsIAsyncInputStream *aSocketIn, - nsIAsyncOutputStream *aSocketOut, - nsIAsyncInputStream **outSocketIn, - nsIAsyncOutputStream **outSocketOut) { - SocketInWrapper *inputWrapper = new SocketInWrapper(aSocketIn, this); +void TLSFilterTransaction::newIODriver(nsIAsyncInputStream* aSocketIn, + nsIAsyncOutputStream* aSocketOut, + nsIAsyncInputStream** outSocketIn, + nsIAsyncOutputStream** outSocketOut) { + SocketInWrapper* inputWrapper = new SocketInWrapper(aSocketIn, this); mSegmentWriter = inputWrapper; nsCOMPtr newIn(inputWrapper); newIn.forget(outSocketIn); - SocketOutWrapper *outputWrapper = new SocketOutWrapper(aSocketOut, this); + SocketOutWrapper* outputWrapper = new SocketOutWrapper(aSocketOut, this); mSegmentReader = outputWrapper; nsCOMPtr newOut(outputWrapper); newOut.forget(outSocketOut); } -SpdyConnectTransaction *TLSFilterTransaction::QuerySpdyConnectTransaction() { +SpdyConnectTransaction* TLSFilterTransaction::QuerySpdyConnectTransaction() { if (!mTransaction) { return nullptr; } @@ -847,7 +847,7 @@ class SocketTransportShim : public nsISocketTransport { NS_DECL_NSITRANSPORT NS_DECL_NSISOCKETTRANSPORT - explicit SocketTransportShim(nsISocketTransport *aWrapped, bool aIsWebsocket) + explicit SocketTransportShim(nsISocketTransport* aWrapped, bool aIsWebsocket) : mWrapped(aWrapped), mIsWebsocket(aIsWebsocket){}; private: @@ -862,7 +862,7 @@ class WeakTransProxy final : public nsISupports { public: NS_DECL_THREADSAFE_ISUPPORTS - explicit WeakTransProxy(SpdyConnectTransaction *aTrans) { + explicit WeakTransProxy(SpdyConnectTransaction* aTrans) { MOZ_ASSERT(OnSocketThread()); mWeakTrans = do_GetWeakReference(aTrans); } @@ -883,7 +883,7 @@ NS_IMPL_ISUPPORTS(WeakTransProxy, nsISupports) class WeakTransFreeProxy final : public Runnable { public: - explicit WeakTransFreeProxy(WeakTransProxy *proxy) + explicit WeakTransFreeProxy(WeakTransProxy* proxy) : Runnable("WeakTransFreeProxy"), mProxy(proxy) {} NS_IMETHOD Run() override { @@ -913,7 +913,7 @@ class OutputStreamShim : public nsIAsyncOutputStream { friend class WebsocketHasDataToWrite; friend class OutputCloseTransaction; - OutputStreamShim(SpdyConnectTransaction *aTrans, bool aIsWebsocket) + OutputStreamShim(SpdyConnectTransaction* aTrans, bool aIsWebsocket) : mCallback(nullptr), mStatus(NS_OK), mMutex("OutputStreamShim"), @@ -921,7 +921,7 @@ class OutputStreamShim : public nsIAsyncOutputStream { mWeakTrans = new WeakTransProxy(aTrans); } - nsIOutputStreamCallback *GetCallback(); + nsIOutputStreamCallback* GetCallback(); private: virtual ~OutputStreamShim() { @@ -933,7 +933,7 @@ class OutputStreamShim : public nsIAsyncOutputStream { } RefPtr mWeakTrans; // SpdyConnectTransaction * - nsIOutputStreamCallback *mCallback; + nsIOutputStreamCallback* mCallback; nsresult mStatus; mozilla::Mutex mMutex; @@ -952,7 +952,7 @@ class InputStreamShim : public nsIAsyncInputStream { friend class SpdyConnectTransaction; friend class InputCloseTransaction; - InputStreamShim(SpdyConnectTransaction *aTrans, bool aIsWebsocket) + InputStreamShim(SpdyConnectTransaction* aTrans, bool aIsWebsocket) : mCallback(nullptr), mStatus(NS_OK), mMutex("InputStreamShim"), @@ -960,7 +960,7 @@ class InputStreamShim : public nsIAsyncInputStream { mWeakTrans = new WeakTransProxy(aTrans); } - nsIInputStreamCallback *GetCallback(); + nsIInputStreamCallback* GetCallback(); private: virtual ~InputStreamShim() { @@ -972,7 +972,7 @@ class InputStreamShim : public nsIAsyncInputStream { } RefPtr mWeakTrans; // SpdyConnectTransaction * - nsIInputStreamCallback *mCallback; + nsIInputStreamCallback* mCallback; nsresult mStatus; mozilla::Mutex mMutex; @@ -982,8 +982,8 @@ class InputStreamShim : public nsIAsyncInputStream { }; SpdyConnectTransaction::SpdyConnectTransaction( - nsHttpConnectionInfo *ci, nsIInterfaceRequestor *callbacks, uint32_t caps, - nsHttpTransaction *trans, nsAHttpConnection *session, bool isWebsocket) + nsHttpConnectionInfo* ci, nsIInterfaceRequestor* callbacks, uint32_t caps, + nsHttpTransaction* trans, nsAHttpConnection* session, bool isWebsocket) : NullHttpTransaction(ci, callbacks, caps | NS_HTTP_ALLOW_KEEPALIVE), mConnectStringOffset(0), mSession(session), @@ -1038,7 +1038,7 @@ void SpdyConnectTransaction::ForcePlainText() { } void SpdyConnectTransaction::MapStreamToHttpConnection( - nsISocketTransport *aTransport, nsHttpConnectionInfo *aConnInfo) { + nsISocketTransport* aTransport, nsHttpConnectionInfo* aConnInfo) { mConnInfo = aConnInfo; mTunnelTransport = new SocketTransportShim(aTransport, mIsWebsocket); @@ -1088,7 +1088,7 @@ void SpdyConnectTransaction::MapStreamToHttpConnection( } } -nsresult SpdyConnectTransaction::Flush(uint32_t count, uint32_t *countRead) { +nsresult SpdyConnectTransaction::Flush(uint32_t count, uint32_t* countRead) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("SpdyConnectTransaction::Flush %p count %d avail %d\n", this, count, mOutputDataUsed - mOutputDataOffset)); @@ -1128,9 +1128,9 @@ nsresult SpdyConnectTransaction::Flush(uint32_t count, uint32_t *countRead) { return NS_OK; } -nsresult SpdyConnectTransaction::ReadSegments(nsAHttpSegmentReader *reader, +nsresult SpdyConnectTransaction::ReadSegments(nsAHttpSegmentReader* reader, uint32_t count, - uint32_t *countRead) { + uint32_t* countRead) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("SpdyConnectTransaction::ReadSegments %p count %d conn %p\n", this, count, mTunneledConn.get())); @@ -1179,7 +1179,7 @@ nsresult SpdyConnectTransaction::ReadSegments(nsAHttpSegmentReader *reader, *countRead = 0; nsresult rv = Flush(count, countRead); - nsIOutputStreamCallback *cb = mTunnelStreamOut->GetCallback(); + nsIOutputStreamCallback* cb = mTunnelStreamOut->GetCallback(); if (!cb && !(*countRead)) { return NS_BASE_STREAM_WOULD_BLOCK; } @@ -1220,14 +1220,14 @@ void SpdyConnectTransaction::CreateShimError(nsresult code) { } if (mTunnelStreamIn) { - nsIInputStreamCallback *cb = mTunnelStreamIn->GetCallback(); + nsIInputStreamCallback* cb = mTunnelStreamIn->GetCallback(); if (cb) { cb->OnInputStreamReady(mTunnelStreamIn); } } if (mTunnelStreamOut) { - nsIOutputStreamCallback *cb = mTunnelStreamOut->GetCallback(); + nsIOutputStreamCallback* cb = mTunnelStreamOut->GetCallback(); if (cb) { cb->OnOutputStreamReady(mTunnelStreamOut); } @@ -1235,9 +1235,9 @@ void SpdyConnectTransaction::CreateShimError(nsresult code) { mCreateShimErrorCalled = false; } -nsresult SpdyConnectTransaction::WriteDataToBuffer(nsAHttpSegmentWriter *writer, +nsresult SpdyConnectTransaction::WriteDataToBuffer(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) { + uint32_t* countWritten) { EnsureBuffer(mInputData, mInputDataUsed + count, mInputDataUsed, mInputDataSize); nsresult rv = @@ -1261,11 +1261,11 @@ nsresult SpdyConnectTransaction::WriteDataToBuffer(nsAHttpSegmentWriter *writer, return rv; } -nsresult SpdyConnectTransaction::WriteSegments(nsAHttpSegmentWriter *writer, +nsresult SpdyConnectTransaction::WriteSegments(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) { + uint32_t* countWritten) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsIInputStreamCallback *cb = + nsIInputStreamCallback* cb = mTunneledConn ? mTunnelStreamIn->GetCallback() : nullptr; LOG(("SpdyConnectTransaction::WriteSegments %p max=%d cb=%p\n", this, count, cb)); @@ -1299,14 +1299,14 @@ nsresult SpdyConnectTransaction::WriteSegments(nsAHttpSegmentWriter *writer, "goodput %p out %" PRId64 "\n", this, mTunneledConn.get(), mTunneledConn->ContentBytesWritten())); if (NS_SUCCEEDED(rv) && !mTunneledConn->ContentBytesWritten()) { - nsIOutputStreamCallback *ocb = mTunnelStreamOut->GetCallback(); + nsIOutputStreamCallback* ocb = mTunnelStreamOut->GetCallback(); mTunnelStreamOut->AsyncWait(ocb, 0, 0, nullptr); } return rv; } nsresult SpdyConnectTransaction::WebsocketWriteSegments( - nsAHttpSegmentWriter *writer, uint32_t count, uint32_t *countWritten) { + nsAHttpSegmentWriter* writer, uint32_t count, uint32_t* countWritten) { MOZ_ASSERT(mIsWebsocket); if (mDrivingTransaction && !mDrivingTransaction->IsDone()) { // Transaction hasn't received end of headers yet, so keep passing data to @@ -1330,7 +1330,7 @@ nsresult SpdyConnectTransaction::WebsocketWriteSegments( if (!mTunneledConn || !mTunnelStreamIn->GetCallback()) { return NS_BASE_STREAM_WOULD_BLOCK; } - nsIInputStreamCallback *cb = mTunnelStreamIn->GetCallback(); + nsIInputStreamCallback* cb = mTunnelStreamIn->GetCallback(); rv = cb->OnInputStreamReady(mTunnelStreamIn); } @@ -1341,7 +1341,7 @@ bool SpdyConnectTransaction::ConnectedReadyForInput() { return mTunneledConn && mTunnelStreamIn->GetCallback(); } -nsHttpRequestHead *SpdyConnectTransaction::RequestHead() { +nsHttpRequestHead* SpdyConnectTransaction::RequestHead() { return mRequestHead; } @@ -1371,14 +1371,14 @@ void SpdyConnectTransaction::SetConnRefTaken() { mDrivingTransaction = nullptr; // Just in case } -nsIOutputStreamCallback *OutputStreamShim::GetCallback() { +nsIOutputStreamCallback* OutputStreamShim::GetCallback() { mozilla::MutexAutoLock lock(mMutex); return mCallback; } class WebsocketHasDataToWrite final : public Runnable { public: - explicit WebsocketHasDataToWrite(OutputStreamShim *shim) + explicit WebsocketHasDataToWrite(OutputStreamShim* shim) : Runnable("WebsocketHasDataToWrite"), mShim(shim) {} ~WebsocketHasDataToWrite() = default; @@ -1400,9 +1400,9 @@ class WebsocketHasDataToWrite final : public Runnable { }; NS_IMETHODIMP -OutputStreamShim::AsyncWait(nsIOutputStreamCallback *callback, +OutputStreamShim::AsyncWait(nsIOutputStreamCallback* callback, unsigned int flags, unsigned int requestedCount, - nsIEventTarget *target) { + nsIEventTarget* target) { if (mIsWebsocket) { // With websockets, AsyncWait may be called from the main thread, but the // target is on the socket thread. That's all we really care about. @@ -1437,7 +1437,7 @@ OutputStreamShim::AsyncWait(nsIOutputStreamCallback *callback, class OutputCloseTransaction final : public Runnable { public: - OutputCloseTransaction(OutputStreamShim *shim, nsresult reason) + OutputCloseTransaction(OutputStreamShim* shim, nsresult reason) : Runnable("OutputCloseTransaction"), mShim(shim), mReason(reason) {} ~OutputCloseTransaction() = default; @@ -1468,7 +1468,7 @@ nsresult OutputStreamShim::CloseTransaction(nsresult reason) { if (!baseTrans) { return NS_ERROR_FAILURE; } - SpdyConnectTransaction *trans = baseTrans->QuerySpdyConnectTransaction(); + SpdyConnectTransaction* trans = baseTrans->QuerySpdyConnectTransaction(); MOZ_ASSERT(trans); if (!trans) { return NS_ERROR_UNEXPECTED; @@ -1488,7 +1488,7 @@ OutputStreamShim::Flush() { if (!baseTrans) { return NS_ERROR_FAILURE; } - SpdyConnectTransaction *trans = baseTrans->QuerySpdyConnectTransaction(); + SpdyConnectTransaction* trans = baseTrans->QuerySpdyConnectTransaction(); MOZ_ASSERT(trans); if (!trans) { return NS_ERROR_UNEXPECTED; @@ -1512,7 +1512,7 @@ nsresult OutputStreamShim::CallTransactionHasDataToWrite() { if (!baseTrans) { return NS_ERROR_FAILURE; } - SpdyConnectTransaction *trans = baseTrans->QuerySpdyConnectTransaction(); + SpdyConnectTransaction* trans = baseTrans->QuerySpdyConnectTransaction(); MOZ_ASSERT(trans); if (!trans) { return NS_ERROR_UNEXPECTED; @@ -1522,7 +1522,7 @@ nsresult OutputStreamShim::CallTransactionHasDataToWrite() { } NS_IMETHODIMP -OutputStreamShim::Write(const char *aBuf, uint32_t aCount, uint32_t *_retval) { +OutputStreamShim::Write(const char* aBuf, uint32_t aCount, uint32_t* _retval) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); if (NS_FAILED(mStatus)) { @@ -1533,7 +1533,7 @@ OutputStreamShim::Write(const char *aBuf, uint32_t aCount, uint32_t *_retval) { if (!baseTrans) { return NS_ERROR_FAILURE; } - SpdyConnectTransaction *trans = baseTrans->QuerySpdyConnectTransaction(); + SpdyConnectTransaction* trans = baseTrans->QuerySpdyConnectTransaction(); MOZ_ASSERT(trans); if (!trans) { return NS_ERROR_UNEXPECTED; @@ -1559,8 +1559,8 @@ OutputStreamShim::Write(const char *aBuf, uint32_t aCount, uint32_t *_retval) { } NS_IMETHODIMP -OutputStreamShim::WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, - uint32_t *_retval) { +OutputStreamShim::WriteFrom(nsIInputStream* aFromStream, uint32_t aCount, + uint32_t* _retval) { if (mIsWebsocket) { LOG3(("WARNING: OutputStreamShim::WriteFrom %p", this)); } @@ -1568,8 +1568,8 @@ OutputStreamShim::WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, } NS_IMETHODIMP -OutputStreamShim::WriteSegments(nsReadSegmentFun aReader, void *aClosure, - uint32_t aCount, uint32_t *_retval) { +OutputStreamShim::WriteSegments(nsReadSegmentFun aReader, void* aClosure, + uint32_t aCount, uint32_t* _retval) { if (mIsWebsocket) { LOG3(("WARNING: OutputStreamShim::WriteSegments %p", this)); } @@ -1577,20 +1577,20 @@ OutputStreamShim::WriteSegments(nsReadSegmentFun aReader, void *aClosure, } NS_IMETHODIMP -OutputStreamShim::IsNonBlocking(bool *_retval) { +OutputStreamShim::IsNonBlocking(bool* _retval) { *_retval = true; return NS_OK; } -nsIInputStreamCallback *InputStreamShim::GetCallback() { +nsIInputStreamCallback* InputStreamShim::GetCallback() { mozilla::MutexAutoLock lock(mMutex); return mCallback; } NS_IMETHODIMP -InputStreamShim::AsyncWait(nsIInputStreamCallback *callback, unsigned int flags, +InputStreamShim::AsyncWait(nsIInputStreamCallback* callback, unsigned int flags, unsigned int requestedCount, - nsIEventTarget *target) { + nsIEventTarget* target) { if (mIsWebsocket) { // With websockets, AsyncWait may be called from the main thread, but the // target is on the socket thread. That's all we really care about. @@ -1622,7 +1622,7 @@ InputStreamShim::AsyncWait(nsIInputStreamCallback *callback, unsigned int flags, class InputCloseTransaction final : public Runnable { public: - InputCloseTransaction(InputStreamShim *shim, nsresult reason) + InputCloseTransaction(InputStreamShim* shim, nsresult reason) : Runnable("InputCloseTransaction"), mShim(shim), mReason(reason) {} ~InputCloseTransaction() = default; @@ -1652,7 +1652,7 @@ nsresult InputStreamShim::CloseTransaction(nsresult reason) { if (!baseTrans) { return NS_ERROR_FAILURE; } - SpdyConnectTransaction *trans = baseTrans->QuerySpdyConnectTransaction(); + SpdyConnectTransaction* trans = baseTrans->QuerySpdyConnectTransaction(); MOZ_ASSERT(trans); if (!trans) { return NS_ERROR_UNEXPECTED; @@ -1666,12 +1666,12 @@ NS_IMETHODIMP InputStreamShim::Close() { return CloseWithStatus(NS_OK); } NS_IMETHODIMP -InputStreamShim::Available(uint64_t *_retval) { +InputStreamShim::Available(uint64_t* _retval) { RefPtr baseTrans = mWeakTrans->QueryTransaction(); if (!baseTrans) { return NS_ERROR_FAILURE; } - SpdyConnectTransaction *trans = baseTrans->QuerySpdyConnectTransaction(); + SpdyConnectTransaction* trans = baseTrans->QuerySpdyConnectTransaction(); MOZ_ASSERT(trans); if (!trans) { return NS_ERROR_UNEXPECTED; @@ -1682,7 +1682,7 @@ InputStreamShim::Available(uint64_t *_retval) { } NS_IMETHODIMP -InputStreamShim::Read(char *aBuf, uint32_t aCount, uint32_t *_retval) { +InputStreamShim::Read(char* aBuf, uint32_t aCount, uint32_t* _retval) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); if (NS_FAILED(mStatus)) { @@ -1693,7 +1693,7 @@ InputStreamShim::Read(char *aBuf, uint32_t aCount, uint32_t *_retval) { if (!baseTrans) { return NS_ERROR_FAILURE; } - SpdyConnectTransaction *trans = baseTrans->QuerySpdyConnectTransaction(); + SpdyConnectTransaction* trans = baseTrans->QuerySpdyConnectTransaction(); MOZ_ASSERT(trans); if (!trans) { return NS_ERROR_UNEXPECTED; @@ -1712,8 +1712,8 @@ InputStreamShim::Read(char *aBuf, uint32_t aCount, uint32_t *_retval) { } NS_IMETHODIMP -InputStreamShim::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, - uint32_t aCount, uint32_t *_retval) { +InputStreamShim::ReadSegments(nsWriteSegmentFun aWriter, void* aClosure, + uint32_t aCount, uint32_t* _retval) { if (mIsWebsocket) { LOG3(("WARNING: InputStreamShim::ReadSegments %p", this)); } @@ -1721,7 +1721,7 @@ InputStreamShim::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, } NS_IMETHODIMP -InputStreamShim::IsNonBlocking(bool *_retval) { +InputStreamShim::IsNonBlocking(bool* _retval) { *_retval = true; return NS_OK; } @@ -1745,7 +1745,7 @@ SocketTransportShim::SetKeepaliveVals(int32_t keepaliveIdleTime, NS_IMETHODIMP SocketTransportShim::GetSecurityCallbacks( - nsIInterfaceRequestor **aSecurityCallbacks) { + nsIInterfaceRequestor** aSecurityCallbacks) { if (mIsWebsocket) { nsCOMPtr out(mSecurityCallbacks); *aSecurityCallbacks = out.forget().take(); @@ -1757,7 +1757,7 @@ SocketTransportShim::GetSecurityCallbacks( NS_IMETHODIMP SocketTransportShim::SetSecurityCallbacks( - nsIInterfaceRequestor *aSecurityCallbacks) { + nsIInterfaceRequestor* aSecurityCallbacks) { if (mIsWebsocket) { mSecurityCallbacks = aSecurityCallbacks; return NS_OK; @@ -1768,7 +1768,7 @@ SocketTransportShim::SetSecurityCallbacks( NS_IMETHODIMP SocketTransportShim::OpenInputStream(uint32_t aFlags, uint32_t aSegmentSize, uint32_t aSegmentCount, - nsIInputStream **_retval) { + nsIInputStream** _retval) { if (mIsWebsocket) { LOG3(("WARNING: SocketTransportShim::OpenInputStream %p", this)); } @@ -1778,7 +1778,7 @@ SocketTransportShim::OpenInputStream(uint32_t aFlags, uint32_t aSegmentSize, NS_IMETHODIMP SocketTransportShim::OpenOutputStream(uint32_t aFlags, uint32_t aSegmentSize, uint32_t aSegmentCount, - nsIOutputStream **_retval) { + nsIOutputStream** _retval) { if (mIsWebsocket) { LOG3(("WARNING: SocketTransportShim::OpenOutputStream %p", this)); } @@ -1794,8 +1794,8 @@ SocketTransportShim::Close(nsresult aReason) { } NS_IMETHODIMP -SocketTransportShim::SetEventSink(nsITransportEventSink *aSink, - nsIEventTarget *aEventTarget) { +SocketTransportShim::SetEventSink(nsITransportEventSink* aSink, + nsIEventTarget* aEventTarget) { if (mIsWebsocket) { // Need to pretend, since websockets expect this to work return NS_OK; @@ -1804,7 +1804,7 @@ SocketTransportShim::SetEventSink(nsITransportEventSink *aSink, } NS_IMETHODIMP -SocketTransportShim::Bind(NetAddr *aLocalAddr) { +SocketTransportShim::Bind(NetAddr* aLocalAddr) { if (mIsWebsocket) { LOG3(("WARNING: SocketTransportShim::Bind %p", this)); } @@ -1812,7 +1812,7 @@ SocketTransportShim::Bind(NetAddr *aLocalAddr) { } NS_IMETHODIMP -SocketTransportShim::GetFirstRetryError(nsresult *aFirstRetryError) { +SocketTransportShim::GetFirstRetryError(nsresult* aFirstRetryError) { if (mIsWebsocket) { LOG3(("WARNING: SocketTransportShim::GetFirstRetryError %p", this)); } @@ -1820,7 +1820,7 @@ SocketTransportShim::GetFirstRetryError(nsresult *aFirstRetryError) { } NS_IMETHODIMP -SocketTransportShim::GetEsniUsed(bool *aEsniUsed) { +SocketTransportShim::GetEsniUsed(bool* aEsniUsed) { if (mIsWebsocket) { LOG3(("WARNING: SocketTransportShim::GetEsniUsed %p", this)); } @@ -1829,11 +1829,11 @@ SocketTransportShim::GetEsniUsed(bool *aEsniUsed) { #define FWD_TS_PTR(fx, ts) \ NS_IMETHODIMP \ - SocketTransportShim::fx(ts *arg) { return mWrapped->fx(arg); } + SocketTransportShim::fx(ts* arg) { return mWrapped->fx(arg); } #define FWD_TS_ADDREF(fx, ts) \ NS_IMETHODIMP \ - SocketTransportShim::fx(ts **arg) { return mWrapped->fx(arg); } + SocketTransportShim::fx(ts** arg) { return mWrapped->fx(arg); } #define FWD_TS(fx, ts) \ NS_IMETHODIMP \ @@ -1858,34 +1858,34 @@ FWD_TS(SetRecvBufferSize, uint32_t); FWD_TS_PTR(GetResetIPFamilyPreference, bool); nsresult SocketTransportShim::GetOriginAttributes( - mozilla::OriginAttributes *aOriginAttributes) { + mozilla::OriginAttributes* aOriginAttributes) { return mWrapped->GetOriginAttributes(aOriginAttributes); } nsresult SocketTransportShim::SetOriginAttributes( - const mozilla::OriginAttributes &aOriginAttributes) { + const mozilla::OriginAttributes& aOriginAttributes) { return mWrapped->SetOriginAttributes(aOriginAttributes); } NS_IMETHODIMP SocketTransportShim::GetScriptableOriginAttributes( - JSContext *aCx, JS::MutableHandle aOriginAttributes) { + JSContext* aCx, JS::MutableHandle aOriginAttributes) { return mWrapped->GetScriptableOriginAttributes(aCx, aOriginAttributes); } NS_IMETHODIMP SocketTransportShim::SetScriptableOriginAttributes( - JSContext *aCx, JS::Handle aOriginAttributes) { + JSContext* aCx, JS::Handle aOriginAttributes) { return mWrapped->SetScriptableOriginAttributes(aCx, aOriginAttributes); } NS_IMETHODIMP -SocketTransportShim::GetHost(nsACString &aHost) { +SocketTransportShim::GetHost(nsACString& aHost) { return mWrapped->GetHost(aHost); } NS_IMETHODIMP -SocketTransportShim::GetTimeout(uint32_t aType, uint32_t *_retval) { +SocketTransportShim::GetTimeout(uint32_t aType, uint32_t* _retval) { return mWrapped->GetTimeout(aType, _retval); } @@ -1905,7 +1905,7 @@ SocketTransportShim::SetLinger(bool aPolarity, int16_t aTimeout) { } NS_IMETHODIMP -SocketTransportShim::GetQoSBits(uint8_t *aQoSBits) { +SocketTransportShim::GetQoSBits(uint8_t* aQoSBits) { return mWrapped->GetQoSBits(aQoSBits); } @@ -1915,7 +1915,7 @@ SocketTransportShim::SetQoSBits(uint8_t aQoSBits) { } NS_IMETHODIMP -SocketTransportShim::SetFastOpenCallback(TCPFastOpen *aFastOpen) { +SocketTransportShim::SetFastOpenCallback(TCPFastOpen* aFastOpen) { return mWrapped->SetFastOpenCallback(aFastOpen); } diff --git a/netwerk/protocol/http/TunnelUtils.h b/netwerk/protocol/http/TunnelUtils.h index eec70036c5bbe..1d8c656efe9b2 100644 --- a/netwerk/protocol/http/TunnelUtils.h +++ b/netwerk/protocol/http/TunnelUtils.h @@ -100,11 +100,11 @@ class TLSFilterTransaction; class NudgeTunnelCallback : public nsISupports { public: - virtual nsresult OnTunnelNudged(TLSFilterTransaction *) = 0; + virtual nsresult OnTunnelNudged(TLSFilterTransaction*) = 0; }; #define NS_DECL_NUDGETUNNELCALLBACK \ - nsresult OnTunnelNudged(TLSFilterTransaction *) override; + nsresult OnTunnelNudged(TLSFilterTransaction*) override; class TLSFilterTransaction final : public nsAHttpTransaction, public nsAHttpSegmentReader, @@ -121,47 +121,47 @@ class TLSFilterTransaction final : public nsAHttpTransaction, NS_DECL_NSITIMERCALLBACK NS_DECL_NSINAMED - TLSFilterTransaction(nsAHttpTransaction *aWrappedTransaction, - const char *tlsHost, int32_t tlsPort, - nsAHttpSegmentReader *reader, - nsAHttpSegmentWriter *writer); + TLSFilterTransaction(nsAHttpTransaction* aWrappedTransaction, + const char* tlsHost, int32_t tlsPort, + nsAHttpSegmentReader* reader, + nsAHttpSegmentWriter* writer); - const nsAHttpTransaction *Transaction() const { return mTransaction.get(); } + const nsAHttpTransaction* Transaction() const { return mTransaction.get(); } MOZ_MUST_USE nsresult CommitToSegmentSize(uint32_t size, bool forceCommitment) override; - MOZ_MUST_USE nsresult GetTransactionSecurityInfo(nsISupports **) override; - MOZ_MUST_USE nsresult NudgeTunnel(NudgeTunnelCallback *callback); + MOZ_MUST_USE nsresult GetTransactionSecurityInfo(nsISupports**) override; + MOZ_MUST_USE nsresult NudgeTunnel(NudgeTunnelCallback* callback); MOZ_MUST_USE nsresult - SetProxiedTransaction(nsAHttpTransaction *aTrans, - nsAHttpTransaction *aSpdyConnectTransaction = nullptr); - void newIODriver(nsIAsyncInputStream *aSocketIn, - nsIAsyncOutputStream *aSocketOut, - nsIAsyncInputStream **outSocketIn, - nsIAsyncOutputStream **outSocketOut); + SetProxiedTransaction(nsAHttpTransaction* aTrans, + nsAHttpTransaction* aSpdyConnectTransaction = nullptr); + void newIODriver(nsIAsyncInputStream* aSocketIn, + nsIAsyncOutputStream* aSocketOut, + nsIAsyncInputStream** outSocketIn, + nsIAsyncOutputStream** outSocketOut); // nsAHttpTransaction overloads bool IsNullTransaction() override; - NullHttpTransaction *QueryNullTransaction() override; - nsHttpTransaction *QueryHttpTransaction() override; - SpdyConnectTransaction *QuerySpdyConnectTransaction() override; + NullHttpTransaction* QueryNullTransaction() override; + nsHttpTransaction* QueryHttpTransaction() override; + SpdyConnectTransaction* QuerySpdyConnectTransaction() override; private: MOZ_MUST_USE nsresult StartTimerCallback(); void Cleanup(); - int32_t FilterOutput(const char *aBuf, int32_t aAmount); - int32_t FilterInput(char *aBuf, int32_t aAmount); - - static PRStatus GetPeerName(PRFileDesc *fd, PRNetAddr *addr); - static PRStatus GetSocketOption(PRFileDesc *fd, PRSocketOptionData *data); - static PRStatus SetSocketOption(PRFileDesc *fd, - const PRSocketOptionData *data); - static int32_t FilterWrite(PRFileDesc *fd, const void *buf, int32_t amount); - static int32_t FilterRead(PRFileDesc *fd, void *buf, int32_t amount); - static int32_t FilterSend(PRFileDesc *fd, const void *buf, int32_t amount, + int32_t FilterOutput(const char* aBuf, int32_t aAmount); + int32_t FilterInput(char* aBuf, int32_t aAmount); + + static PRStatus GetPeerName(PRFileDesc* fd, PRNetAddr* addr); + static PRStatus GetSocketOption(PRFileDesc* fd, PRSocketOptionData* data); + static PRStatus SetSocketOption(PRFileDesc* fd, + const PRSocketOptionData* data); + static int32_t FilterWrite(PRFileDesc* fd, const void* buf, int32_t amount); + static int32_t FilterRead(PRFileDesc* fd, void* buf, int32_t amount); + static int32_t FilterSend(PRFileDesc* fd, const void* buf, int32_t amount, int flags, PRIntervalTime timeout); - static int32_t FilterRecv(PRFileDesc *fd, void *buf, int32_t amount, + static int32_t FilterRecv(PRFileDesc* fd, void* buf, int32_t amount, int flags, PRIntervalTime timeout); - static PRStatus FilterClose(PRFileDesc *fd); + static PRStatus FilterClose(PRFileDesc* fd); private: RefPtr mTransaction; @@ -175,9 +175,9 @@ class TLSFilterTransaction final : public nsAHttpTransaction, uint32_t mEncryptedTextUsed; uint32_t mEncryptedTextSize; - PRFileDesc *mFD; - nsAHttpSegmentReader *mSegmentReader; - nsAHttpSegmentWriter *mSegmentWriter; + PRFileDesc* mFD; + nsAHttpSegmentReader* mSegmentReader; + nsAHttpSegmentWriter* mSegmentWriter; nsresult mFilterReadCode; bool mForce; @@ -192,13 +192,13 @@ class nsHttpConnection; class SpdyConnectTransaction final : public NullHttpTransaction { public: - SpdyConnectTransaction(nsHttpConnectionInfo *ci, - nsIInterfaceRequestor *callbacks, uint32_t caps, - nsHttpTransaction *trans, nsAHttpConnection *session, + SpdyConnectTransaction(nsHttpConnectionInfo* ci, + nsIInterfaceRequestor* callbacks, uint32_t caps, + nsHttpTransaction* trans, nsAHttpConnection* session, bool isWebsocket); ~SpdyConnectTransaction(); - SpdyConnectTransaction *QuerySpdyConnectTransaction() override { + SpdyConnectTransaction* QuerySpdyConnectTransaction() override { return this; } @@ -206,15 +206,15 @@ class SpdyConnectTransaction final : public NullHttpTransaction { // CONNECT tunnel but the setup fails. The plaintext only carries the CONNECT // error. void ForcePlainText(); - void MapStreamToHttpConnection(nsISocketTransport *aTransport, - nsHttpConnectionInfo *aConnInfo); + void MapStreamToHttpConnection(nsISocketTransport* aTransport, + nsHttpConnectionInfo* aConnInfo); - MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader *reader, - uint32_t count, uint32_t *countRead) final; - MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter *writer, + MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader* reader, + uint32_t count, uint32_t* countRead) final; + MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) final; - nsHttpRequestHead *RequestHead() final; + uint32_t* countWritten) final; + nsHttpRequestHead* RequestHead() final; void Close(nsresult reason) final; // ConnectedReadyForInput() tests whether the spdy connect transaction is @@ -229,14 +229,14 @@ class SpdyConnectTransaction final : public NullHttpTransaction { friend class InputStreamShim; friend class OutputStreamShim; - MOZ_MUST_USE nsresult Flush(uint32_t count, uint32_t *countRead); + MOZ_MUST_USE nsresult Flush(uint32_t count, uint32_t* countRead); void CreateShimError(nsresult code); nsCString mConnectString; uint32_t mConnectStringOffset; - nsAHttpConnection *mSession; - nsAHttpSegmentReader *mSegmentReader; + nsAHttpConnection* mSession; + nsAHttpSegmentReader* mSegmentReader; UniquePtr mInputData; uint32_t mInputDataSize; @@ -267,11 +267,11 @@ class SpdyConnectTransaction final : public NullHttpTransaction { bool mConnRefTaken; nsCOMPtr mInputShimPipe; nsCOMPtr mOutputShimPipe; - nsresult WriteDataToBuffer(nsAHttpSegmentWriter *writer, uint32_t count, - uint32_t *countWritten); - MOZ_MUST_USE nsresult WebsocketWriteSegments(nsAHttpSegmentWriter *writer, + nsresult WriteDataToBuffer(nsAHttpSegmentWriter* writer, uint32_t count, + uint32_t* countWritten); + MOZ_MUST_USE nsresult WebsocketWriteSegments(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten); + uint32_t* countWritten); bool mCreateShimErrorCalled; }; diff --git a/netwerk/protocol/http/nsAHttpConnection.h b/netwerk/protocol/http/nsAHttpConnection.h index 656cebdf2053d..01079be8ebc1a 100644 --- a/netwerk/protocol/http/nsAHttpConnection.h +++ b/netwerk/protocol/http/nsAHttpConnection.h @@ -45,10 +45,10 @@ class nsAHttpConnection : public nsISupports { // // @return failure code to close the transaction. // - virtual MOZ_MUST_USE nsresult OnHeadersAvailable(nsAHttpTransaction *, - nsHttpRequestHead *, - nsHttpResponseHead *, - bool *reset) = 0; + virtual MOZ_MUST_USE nsresult OnHeadersAvailable(nsAHttpTransaction*, + nsHttpRequestHead*, + nsHttpResponseHead*, + bool* reset) = 0; // // called by a transaction to resume either sending or receiving data @@ -69,13 +69,13 @@ class nsAHttpConnection : public nsISupports { // multiplexed protocols like SPDY - h1 // implicitly has this information in a 1:1 relationship with the // transaction(s) they manage. - virtual void TransactionHasDataToWrite(nsAHttpTransaction *) { + virtual void TransactionHasDataToWrite(nsAHttpTransaction*) { // by default do nothing - only multiplexed protocols need to overload } // This is the companion to *HasDataToWrite() for the case // when a gecko caller has called ResumeRecv() after being paused - virtual void TransactionHasDataToRecv(nsAHttpTransaction *) { + virtual void TransactionHasDataToRecv(nsAHttpTransaction*) { // by default do nothing - only multiplexed protocols need to overload } @@ -88,20 +88,20 @@ class nsAHttpConnection : public nsISupports { // the reason for closing the transaction. NS_BASE_STREAM_CLOSED // is equivalent to NS_OK. // - virtual void CloseTransaction(nsAHttpTransaction *transaction, + virtual void CloseTransaction(nsAHttpTransaction* transaction, nsresult reason) = 0; // get a reference to the connection's connection info object. - virtual void GetConnectionInfo(nsHttpConnectionInfo **) = 0; + virtual void GetConnectionInfo(nsHttpConnectionInfo**) = 0; // get the transport level information for this connection. This may fail // if it is in use. - virtual MOZ_MUST_USE nsresult TakeTransport(nsISocketTransport **, - nsIAsyncInputStream **, - nsIAsyncOutputStream **) = 0; + virtual MOZ_MUST_USE nsresult TakeTransport(nsISocketTransport**, + nsIAsyncInputStream**, + nsIAsyncOutputStream**) = 0; // called by a transaction to get the security info from the socket. - virtual void GetSecurityInfo(nsISupports **) = 0; + virtual void GetSecurityInfo(nsISupports**) = 0; // called by a transaction to determine whether or not the connection is // persistent... important in determining the end of a response. @@ -113,7 +113,7 @@ class nsAHttpConnection : public nsISupports { // called by a transaction when the transaction reads more from the socket // than it should have (eg. containing part of the next response). - virtual MOZ_MUST_USE nsresult PushBack(const char *data, uint32_t length) = 0; + virtual MOZ_MUST_USE nsresult PushBack(const char* data, uint32_t length) = 0; // Used to determine if the connection wants read events even though // it has not written out a transaction. Used when a connection has issued @@ -134,7 +134,7 @@ class nsAHttpConnection : public nsISupports { // Get the nsISocketTransport used by the connection without changing // references or ownership. - virtual nsISocketTransport *Transport() = 0; + virtual nsISocketTransport* Transport() = 0; // The number of transaction bytes written out on this HTTP Connection, does // not count CONNECT tunnel setup @@ -142,7 +142,7 @@ class nsAHttpConnection : public nsISupports { // Update the callbacks used to provide security info. May be called on // any thread. - virtual void SetSecurityCallbacks(nsIInterfaceRequestor *aCallbacks) = 0; + virtual void SetSecurityCallbacks(nsIInterfaceRequestor* aCallbacks) = 0; // nsHttp.h version virtual HttpVersion Version() = 0; @@ -157,81 +157,81 @@ class nsAHttpConnection : public nsISupports { NS_DEFINE_STATIC_IID_ACCESSOR(nsAHttpConnection, NS_AHTTPCONNECTION_IID) -#define NS_DECL_NSAHTTPCONNECTION(fwdObject) \ - MOZ_MUST_USE nsresult OnHeadersAvailable( \ - nsAHttpTransaction *, nsHttpRequestHead *, nsHttpResponseHead *, \ - bool *reset) override; \ - void CloseTransaction(nsAHttpTransaction *, nsresult) override; \ - MOZ_MUST_USE nsresult TakeTransport( \ - nsISocketTransport **, nsIAsyncInputStream **, nsIAsyncOutputStream **) \ - override; \ - bool IsPersistent() override; \ - bool IsReused() override; \ - void DontReuse() override; \ - MOZ_MUST_USE nsresult PushBack(const char *, uint32_t) override; \ - already_AddRefed TakeHttpConnection() override; \ - already_AddRefed HttpConnection() override; \ - void TopLevelOuterContentWindowIdChanged(uint64_t windowId) override; \ - /* \ - Thes methods below have automatic definitions that just forward the \ - function to a lower level connection object \ - */ \ - void GetConnectionInfo(nsHttpConnectionInfo **result) override { \ - if (!(fwdObject)) { \ - *result = nullptr; \ - return; \ - } \ - return (fwdObject)->GetConnectionInfo(result); \ - } \ - void GetSecurityInfo(nsISupports **result) override { \ - if (!(fwdObject)) { \ - *result = nullptr; \ - return; \ - } \ - return (fwdObject)->GetSecurityInfo(result); \ - } \ - MOZ_MUST_USE nsresult ResumeSend() override { \ - if (!(fwdObject)) return NS_ERROR_FAILURE; \ - return (fwdObject)->ResumeSend(); \ - } \ - MOZ_MUST_USE nsresult ResumeRecv() override { \ - if (!(fwdObject)) return NS_ERROR_FAILURE; \ - return (fwdObject)->ResumeRecv(); \ - } \ - MOZ_MUST_USE nsresult ForceSend() override { \ - if (!(fwdObject)) return NS_ERROR_FAILURE; \ - return (fwdObject)->ForceSend(); \ - } \ - MOZ_MUST_USE nsresult ForceRecv() override { \ - if (!(fwdObject)) return NS_ERROR_FAILURE; \ - return (fwdObject)->ForceRecv(); \ - } \ - nsISocketTransport *Transport() override { \ - if (!(fwdObject)) return nullptr; \ - return (fwdObject)->Transport(); \ - } \ - HttpVersion Version() override { \ - return (fwdObject) ? (fwdObject)->Version() \ - : mozilla::net::HttpVersion::UNKNOWN; \ - } \ - bool IsProxyConnectInProgress() override { \ - return (!fwdObject) ? false : (fwdObject)->IsProxyConnectInProgress(); \ - } \ - bool LastTransactionExpectedNoContent() override { \ - return (!fwdObject) ? false \ - : (fwdObject)->LastTransactionExpectedNoContent(); \ - } \ - void SetLastTransactionExpectedNoContent(bool val) override { \ - if (fwdObject) (fwdObject)->SetLastTransactionExpectedNoContent(val); \ - } \ - int64_t BytesWritten() override { \ - return fwdObject ? (fwdObject)->BytesWritten() : 0; \ - } \ - void SetSecurityCallbacks(nsIInterfaceRequestor *aCallbacks) override { \ - if (fwdObject) (fwdObject)->SetSecurityCallbacks(aCallbacks); \ - } \ - void SetTrafficCategory(HttpTrafficCategory aCategory) override { \ - if (fwdObject) (fwdObject)->SetTrafficCategory(aCategory); \ +#define NS_DECL_NSAHTTPCONNECTION(fwdObject) \ + MOZ_MUST_USE nsresult OnHeadersAvailable( \ + nsAHttpTransaction*, nsHttpRequestHead*, nsHttpResponseHead*, \ + bool* reset) override; \ + void CloseTransaction(nsAHttpTransaction*, nsresult) override; \ + MOZ_MUST_USE nsresult TakeTransport( \ + nsISocketTransport**, nsIAsyncInputStream**, nsIAsyncOutputStream**) \ + override; \ + bool IsPersistent() override; \ + bool IsReused() override; \ + void DontReuse() override; \ + MOZ_MUST_USE nsresult PushBack(const char*, uint32_t) override; \ + already_AddRefed TakeHttpConnection() override; \ + already_AddRefed HttpConnection() override; \ + void TopLevelOuterContentWindowIdChanged(uint64_t windowId) override; \ + /* \ + Thes methods below have automatic definitions that just forward the \ + function to a lower level connection object \ + */ \ + void GetConnectionInfo(nsHttpConnectionInfo** result) override { \ + if (!(fwdObject)) { \ + *result = nullptr; \ + return; \ + } \ + return (fwdObject)->GetConnectionInfo(result); \ + } \ + void GetSecurityInfo(nsISupports** result) override { \ + if (!(fwdObject)) { \ + *result = nullptr; \ + return; \ + } \ + return (fwdObject)->GetSecurityInfo(result); \ + } \ + MOZ_MUST_USE nsresult ResumeSend() override { \ + if (!(fwdObject)) return NS_ERROR_FAILURE; \ + return (fwdObject)->ResumeSend(); \ + } \ + MOZ_MUST_USE nsresult ResumeRecv() override { \ + if (!(fwdObject)) return NS_ERROR_FAILURE; \ + return (fwdObject)->ResumeRecv(); \ + } \ + MOZ_MUST_USE nsresult ForceSend() override { \ + if (!(fwdObject)) return NS_ERROR_FAILURE; \ + return (fwdObject)->ForceSend(); \ + } \ + MOZ_MUST_USE nsresult ForceRecv() override { \ + if (!(fwdObject)) return NS_ERROR_FAILURE; \ + return (fwdObject)->ForceRecv(); \ + } \ + nsISocketTransport* Transport() override { \ + if (!(fwdObject)) return nullptr; \ + return (fwdObject)->Transport(); \ + } \ + HttpVersion Version() override { \ + return (fwdObject) ? (fwdObject)->Version() \ + : mozilla::net::HttpVersion::UNKNOWN; \ + } \ + bool IsProxyConnectInProgress() override { \ + return (!fwdObject) ? false : (fwdObject)->IsProxyConnectInProgress(); \ + } \ + bool LastTransactionExpectedNoContent() override { \ + return (!fwdObject) ? false \ + : (fwdObject)->LastTransactionExpectedNoContent(); \ + } \ + void SetLastTransactionExpectedNoContent(bool val) override { \ + if (fwdObject) (fwdObject)->SetLastTransactionExpectedNoContent(val); \ + } \ + int64_t BytesWritten() override { \ + return fwdObject ? (fwdObject)->BytesWritten() : 0; \ + } \ + void SetSecurityCallbacks(nsIInterfaceRequestor* aCallbacks) override { \ + if (fwdObject) (fwdObject)->SetSecurityCallbacks(aCallbacks); \ + } \ + void SetTrafficCategory(HttpTrafficCategory aCategory) override { \ + if (fwdObject) (fwdObject)->SetTrafficCategory(aCategory); \ } // ThrottleResponse deliberately ommited since we want different implementation diff --git a/netwerk/protocol/http/nsAHttpTransaction.h b/netwerk/protocol/http/nsAHttpTransaction.h index 1b5fd2f440c1d..26bd7ba7e77b4 100644 --- a/netwerk/protocol/http/nsAHttpTransaction.h +++ b/netwerk/protocol/http/nsAHttpTransaction.h @@ -55,7 +55,7 @@ class nsAHttpTransaction : public nsSupportsWeakReference { NS_DECLARE_STATIC_IID_ACCESSOR(NS_AHTTPTRANSACTION_IID) // called by the connection when it takes ownership of the transaction. - virtual void SetConnection(nsAHttpConnection *) = 0; + virtual void SetConnection(nsAHttpConnection*) = 0; // called by the connection after a successfull activation of this transaction // in other words, tells the transaction it transitioned to the "active" @@ -63,14 +63,14 @@ class nsAHttpTransaction : public nsSupportsWeakReference { virtual void OnActivated() {} // used to obtain the connection associated with this transaction - virtual nsAHttpConnection *Connection() = 0; + virtual nsAHttpConnection* Connection() = 0; // called by the connection to get security callbacks to set on the // socket transport. - virtual void GetSecurityCallbacks(nsIInterfaceRequestor **) = 0; + virtual void GetSecurityCallbacks(nsIInterfaceRequestor**) = 0; // called to report socket status (see nsITransportEventSink) - virtual void OnTransportStatus(nsITransport *transport, nsresult status, + virtual void OnTransportStatus(nsITransport* transport, nsresult status, int64_t progress) = 0; // called to check the transaction status. @@ -82,29 +82,29 @@ class nsAHttpTransaction : public nsSupportsWeakReference { virtual void SetDNSWasRefreshed() = 0; // called to read request data from the transaction. - virtual MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader *reader, + virtual MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader* reader, uint32_t count, - uint32_t *countRead) = 0; + uint32_t* countRead) = 0; // called to write response data to the transaction. - virtual MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter *writer, + virtual MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) = 0; + uint32_t* countWritten) = 0; // These versions of the functions allow the overloader to specify whether or // not it is safe to call *Segments() in a loop while they return OK. // The callee should turn again to false if it is not, otherwise leave // untouched - virtual MOZ_MUST_USE nsresult ReadSegmentsAgain(nsAHttpSegmentReader *reader, + virtual MOZ_MUST_USE nsresult ReadSegmentsAgain(nsAHttpSegmentReader* reader, uint32_t count, - uint32_t *countRead, - bool *again) { + uint32_t* countRead, + bool* again) { return ReadSegments(reader, count, countRead); } - virtual MOZ_MUST_USE nsresult WriteSegmentsAgain(nsAHttpSegmentWriter *writer, + virtual MOZ_MUST_USE nsresult WriteSegmentsAgain(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten, - bool *again) { + uint32_t* countWritten, + bool* again) { return WriteSegments(writer, count, countWritten); } @@ -115,7 +115,7 @@ class nsAHttpTransaction : public nsSupportsWeakReference { virtual void SetProxyConnectFailed() = 0; // called to retrieve the request headers of the transaction - virtual nsHttpRequestHead *RequestHead() = 0; + virtual nsHttpRequestHead* RequestHead() = 0; // determine the number of real http/1.x transactions on this // abstract object. Pipelines had multiple, SPDY has 0, @@ -132,7 +132,7 @@ class nsAHttpTransaction : public nsSupportsWeakReference { // at least partially written and cannot be moved. // virtual MOZ_MUST_USE nsresult TakeSubTransactions( - nsTArray > &outTransactions) = 0; + nsTArray >& outTransactions) = 0; // Occasionally the abstract interface has to give way to base implementations // to respect differences between spdy, h2, etc.. @@ -145,25 +145,25 @@ class nsAHttpTransaction : public nsSupportsWeakReference { // A null transaction is expected to return BASE_STREAM_CLOSED on all of // its IO functions all the time. virtual bool IsNullTransaction() { return false; } - virtual NullHttpTransaction *QueryNullTransaction() { return nullptr; } + virtual NullHttpTransaction* QueryNullTransaction() { return nullptr; } // If we used rtti this would be the result of doing // dynamic_cast(this).. i.e. it can be nullptr for // non nsHttpTransaction implementations of nsAHttpTransaction - virtual nsHttpTransaction *QueryHttpTransaction() { return nullptr; } + virtual nsHttpTransaction* QueryHttpTransaction() { return nullptr; } // If we used rtti this would be the result of doing // dynamic_cast(this).. i.e. it can be nullptr for // other types - virtual SpdyConnectTransaction *QuerySpdyConnectTransaction() { + virtual SpdyConnectTransaction* QuerySpdyConnectTransaction() { return nullptr; } // return the request context associated with the transaction - virtual nsIRequestContext *RequestContext() { return nullptr; } + virtual nsIRequestContext* RequestContext() { return nullptr; } // return the connection information associated with the transaction - virtual nsHttpConnectionInfo *ConnectionInfo() = 0; + virtual nsHttpConnectionInfo* ConnectionInfo() = 0; // The base definition of these is done in nsHttpTransaction.cpp virtual bool ResponseTimeoutEnabled() const; @@ -175,7 +175,7 @@ class nsAHttpTransaction : public nsSupportsWeakReference { // the connection due to multiplexing. This interface represents such an // overload. If it returns NS_FAILURE the connection should be considered // authoritative. - virtual MOZ_MUST_USE nsresult GetTransactionSecurityInfo(nsISupports **) { + virtual MOZ_MUST_USE nsresult GetTransactionSecurityInfo(nsISupports**) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -218,26 +218,26 @@ class nsAHttpTransaction : public nsSupportsWeakReference { NS_DEFINE_STATIC_IID_ACCESSOR(nsAHttpTransaction, NS_AHTTPTRANSACTION_IID) #define NS_DECL_NSAHTTPTRANSACTION \ - void SetConnection(nsAHttpConnection *) override; \ - nsAHttpConnection *Connection() override; \ - void GetSecurityCallbacks(nsIInterfaceRequestor **) override; \ - void OnTransportStatus(nsITransport *transport, nsresult status, \ + void SetConnection(nsAHttpConnection*) override; \ + nsAHttpConnection* Connection() override; \ + void GetSecurityCallbacks(nsIInterfaceRequestor**) override; \ + void OnTransportStatus(nsITransport* transport, nsresult status, \ int64_t progress) override; \ bool IsDone() override; \ nsresult Status() override; \ uint32_t Caps() override; \ void SetDNSWasRefreshed() override; \ - virtual MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, \ - uint32_t *) override; \ - virtual MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter *, \ - uint32_t, uint32_t *) override; \ + virtual MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader*, uint32_t, \ + uint32_t*) override; \ + virtual MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter*, uint32_t, \ + uint32_t*) override; \ virtual void Close(nsresult reason) override; \ - nsHttpConnectionInfo *ConnectionInfo() override; \ + nsHttpConnectionInfo* ConnectionInfo() override; \ void SetProxyConnectFailed() override; \ - virtual nsHttpRequestHead *RequestHead() override; \ + virtual nsHttpRequestHead* RequestHead() override; \ uint32_t Http1xTransactionCount() override; \ MOZ_MUST_USE nsresult TakeSubTransactions( \ - nsTArray > &outTransactions) override; + nsTArray >& outTransactions) override; //----------------------------------------------------------------------------- // nsAHttpSegmentReader @@ -246,9 +246,9 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsAHttpTransaction, NS_AHTTPTRANSACTION_IID) class nsAHttpSegmentReader { public: // any returned failure code stops segment iteration - virtual MOZ_MUST_USE nsresult OnReadSegment(const char *segment, + virtual MOZ_MUST_USE nsresult OnReadSegment(const char* segment, uint32_t count, - uint32_t *countRead) = 0; + uint32_t* countRead) = 0; // Ask the segment reader to commit to accepting size bytes of // data from subsequent OnReadSegment() calls or throw hard @@ -266,8 +266,8 @@ class nsAHttpSegmentReader { } }; -#define NS_DECL_NSAHTTPSEGMENTREADER \ - MOZ_MUST_USE nsresult OnReadSegment(const char *, uint32_t, uint32_t *) \ +#define NS_DECL_NSAHTTPSEGMENTREADER \ + MOZ_MUST_USE nsresult OnReadSegment(const char*, uint32_t, uint32_t*) \ override; //----------------------------------------------------------------------------- @@ -277,12 +277,12 @@ class nsAHttpSegmentReader { class nsAHttpSegmentWriter { public: // any returned failure code stops segment iteration - virtual MOZ_MUST_USE nsresult OnWriteSegment(char *segment, uint32_t count, - uint32_t *countWritten) = 0; + virtual MOZ_MUST_USE nsresult OnWriteSegment(char* segment, uint32_t count, + uint32_t* countWritten) = 0; }; #define NS_DECL_NSAHTTPSEGMENTWRITER \ - MOZ_MUST_USE nsresult OnWriteSegment(char *, uint32_t, uint32_t *) override; + MOZ_MUST_USE nsresult OnWriteSegment(char*, uint32_t, uint32_t*) override; } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/nsHttp.cpp b/netwerk/protocol/http/nsHttp.cpp index 9ef90fdd90363..bb356cfe5078c 100644 --- a/netwerk/protocol/http/nsHttp.cpp +++ b/netwerk/protocol/http/nsHttp.cpp @@ -44,18 +44,18 @@ enum { // as one contiguous block. struct HttpHeapAtom { - struct HttpHeapAtom *next; + struct HttpHeapAtom* next; char value[1]; }; -static PLDHashTable *sAtomTable; -static struct HttpHeapAtom *sHeapAtoms = nullptr; -static Mutex *sLock = nullptr; +static PLDHashTable* sAtomTable; +static struct HttpHeapAtom* sHeapAtoms = nullptr; +static Mutex* sLock = nullptr; -HttpHeapAtom *NewHeapAtom(const char *value) { +HttpHeapAtom* NewHeapAtom(const char* value) { int len = strlen(value); - HttpHeapAtom *a = reinterpret_cast(malloc(sizeof(*a) + len)); + HttpHeapAtom* a = reinterpret_cast(malloc(sizeof(*a) + len)); if (!a) return nullptr; memcpy(a->value, value, len + 1); @@ -67,18 +67,18 @@ HttpHeapAtom *NewHeapAtom(const char *value) { } // Hash string ignore case, based on PL_HashString -static PLDHashNumber StringHash(const void *key) { +static PLDHashNumber StringHash(const void* key) { PLDHashNumber h = 0; - for (const char *s = reinterpret_cast(key); *s; ++s) + for (const char* s = reinterpret_cast(key); *s; ++s) h = AddToHash(h, nsCRT::ToLower(*s)); return h; } -static bool StringCompare(const PLDHashEntryHdr *entry, const void *testKey) { - const void *entryKey = reinterpret_cast(entry)->key; +static bool StringCompare(const PLDHashEntryHdr* entry, const void* testKey) { + const void* entryKey = reinterpret_cast(entry)->key; - return PL_strcasecmp(reinterpret_cast(entryKey), - reinterpret_cast(testKey)) == 0; + return PL_strcasecmp(reinterpret_cast(entryKey), + reinterpret_cast(testKey)) == 0; } static const PLDHashTableOps ops = {StringHash, StringCompare, @@ -101,7 +101,7 @@ nsresult CreateAtomTable() { new PLDHashTable(&ops, sizeof(PLDHashEntryStub), NUM_HTTP_ATOMS + 10); // fill the table with our known atoms - const char *const atoms[] = { + const char* const atoms[] = { #define HTTP_ATOM(_name, _value) _name._val, #include "nsHttpAtomList.h" #undef HTTP_ATOM @@ -109,7 +109,7 @@ nsresult CreateAtomTable() { for (int i = 0; atoms[i]; ++i) { auto stub = - static_cast(sAtomTable->Add(atoms[i], fallible)); + static_cast(sAtomTable->Add(atoms[i], fallible)); if (!stub) return NS_ERROR_OUT_OF_MEMORY; MOZ_ASSERT(!stub->key, "duplicate static atom"); @@ -124,7 +124,7 @@ void DestroyAtomTable() { sAtomTable = nullptr; while (sHeapAtoms) { - HttpHeapAtom *next = sHeapAtoms->next; + HttpHeapAtom* next = sHeapAtoms->next; free(sHeapAtoms); sHeapAtoms = next; } @@ -133,27 +133,27 @@ void DestroyAtomTable() { sLock = nullptr; } -Mutex *GetLock() { return sLock; } +Mutex* GetLock() { return sLock; } // this function may be called from multiple threads -nsHttpAtom ResolveAtom(const char *str) { +nsHttpAtom ResolveAtom(const char* str) { nsHttpAtom atom = {nullptr}; if (!str || !sAtomTable) return atom; MutexAutoLock lock(*sLock); - auto stub = static_cast(sAtomTable->Add(str, fallible)); + auto stub = static_cast(sAtomTable->Add(str, fallible)); if (!stub) return atom; // out of memory if (stub->key) { - atom._val = reinterpret_cast(stub->key); + atom._val = reinterpret_cast(stub->key); return atom; } // if the atom could not be found in the atom table, then we'll go // and allocate a new atom on the heap. - HttpHeapAtom *heapAtom = NewHeapAtom(str); + HttpHeapAtom* heapAtom = NewHeapAtom(str); if (!heapAtom) return atom; // out of memory stub->key = atom._val = heapAtom->value; @@ -195,7 +195,7 @@ static const char kValidTokenMap[128] = { 1, 1, 1, 1, 1, 1, 1, 1, // 112 1, 1, 1, 0, 1, 0, 1, 0 // 120 }; -bool IsValidToken(const char *start, const char *end) { +bool IsValidToken(const char* start, const char* end) { if (start == end) return false; for (; start != end; ++start) { @@ -206,7 +206,7 @@ bool IsValidToken(const char *start, const char *end) { return true; } -const char *GetProtocolVersion(HttpVersion pv) { +const char* GetProtocolVersion(HttpVersion pv) { switch (pv) { case HttpVersion::v2_0: return "h2"; @@ -224,7 +224,7 @@ const char *GetProtocolVersion(HttpVersion pv) { } // static -void TrimHTTPWhitespace(const nsACString &aSource, nsACString &aDest) { +void TrimHTTPWhitespace(const nsACString& aSource, nsACString& aDest) { nsAutoCString str(aSource); // HTTP whitespace 0x09: '\t', 0x0A: '\n', 0x0D: '\r', 0x20: ' ' @@ -234,14 +234,14 @@ void TrimHTTPWhitespace(const nsACString &aSource, nsACString &aDest) { } // static -bool IsReasonableHeaderValue(const nsACString &s) { +bool IsReasonableHeaderValue(const nsACString& s) { // Header values MUST NOT contain line-breaks. RFC 2616 technically // permits CTL characters, including CR and LF, in header values provided // they are quoted. However, this can lead to problems if servers do not // interpret quoted strings properly. Disallowing CR and LF here seems // reasonable and keeps things simple. We also disallow a null byte. - const nsACString::char_type *end = s.EndReading(); - for (const nsACString::char_type *i = s.BeginReading(); i != end; ++i) { + const nsACString::char_type* end = s.EndReading(); + for (const nsACString::char_type* i = s.BeginReading(); i != end; ++i) { if (*i == '\r' || *i == '\n' || *i == '\0') { return false; } @@ -249,7 +249,7 @@ bool IsReasonableHeaderValue(const nsACString &s) { return true; } -const char *FindToken(const char *input, const char *token, const char *seps) { +const char* FindToken(const char* input, const char* token, const char* seps) { if (!input) return nullptr; int inputLen = strlen(input); @@ -257,8 +257,8 @@ const char *FindToken(const char *input, const char *token, const char *seps) { if (inputLen < tokenLen) return nullptr; - const char *inputTop = input; - const char *inputEnd = input + inputLen - tokenLen; + const char* inputTop = input; + const char* inputEnd = input + inputLen - tokenLen; for (; input <= inputEnd; ++input) { if (PL_strncasecmp(input, token, tokenLen) == 0) { if (input > inputTop && !strchr(seps, *(input - 1))) continue; @@ -270,11 +270,11 @@ const char *FindToken(const char *input, const char *token, const char *seps) { return nullptr; } -bool ParseInt64(const char *input, const char **next, int64_t *r) { +bool ParseInt64(const char* input, const char** next, int64_t* r) { MOZ_ASSERT(input); MOZ_ASSERT(r); - char *end = nullptr; + char* end = nullptr; errno = 0; // Clear errno to make sure its value is set by strtoll int64_t value = strtoll(input, &end, /* base */ 10); @@ -298,13 +298,13 @@ bool IsPermanentRedirect(uint32_t httpStatus) { } bool ValidationRequired(bool isForcedValid, - nsHttpResponseHead *cachedResponseHead, + nsHttpResponseHead* cachedResponseHead, uint32_t loadFlags, bool allowStaleCacheContent, bool isImmutable, bool customConditionalRequest, - nsHttpRequestHead &requestHead, nsICacheEntry *entry, - CacheControlParser &cacheControlRequest, + nsHttpRequestHead& requestHead, nsICacheEntry* entry, + CacheControlParser& cacheControlRequest, bool fromPreviousSession, - bool *performBackgroundRevalidation) { + bool* performBackgroundRevalidation) { if (performBackgroundRevalidation) { *performBackgroundRevalidation = false; } @@ -441,7 +441,7 @@ bool ValidationRequired(bool isForcedValid, } nsresult GetHttpResponseHeadFromCacheEntry( - nsICacheEntry *entry, nsHttpResponseHead *cachedResponseHead) { + nsICacheEntry* entry, nsHttpResponseHead* cachedResponseHead) { nsCString buf; // A "original-response-headers" metadata element holds network original // headers, i.e. the headers in the form as they arrieved from the network. We @@ -450,7 +450,7 @@ nsresult GetHttpResponseHeadFromCacheEntry( nsresult rv = entry->GetMetaDataElement("original-response-headers", getter_Copies(buf)); if (NS_SUCCEEDED(rv)) { - rv = cachedResponseHead->ParseCachedOriginalHeaders((char *)buf.get()); + rv = cachedResponseHead->ParseCachedOriginalHeaders((char*)buf.get()); if (NS_FAILED(rv)) { LOG((" failed to parse original-response-headers\n")); } @@ -473,9 +473,9 @@ nsresult GetHttpResponseHeadFromCacheEntry( return NS_OK; } -nsresult CheckPartial(nsICacheEntry *aEntry, int64_t *aSize, - int64_t *aContentLength, - nsHttpResponseHead *responseHead) { +nsresult CheckPartial(nsICacheEntry* aEntry, int64_t* aSize, + int64_t* aContentLength, + nsHttpResponseHead* responseHead) { nsresult rv; rv = aEntry->GetDataSize(aSize); @@ -496,10 +496,10 @@ nsresult CheckPartial(nsICacheEntry *aEntry, int64_t *aSize, return NS_OK; } -void DetermineFramingAndImmutability(nsICacheEntry *entry, - nsHttpResponseHead *responseHead, - bool isHttps, bool *weaklyFramed, - bool *isImmutable) { +void DetermineFramingAndImmutability(nsICacheEntry* entry, + nsHttpResponseHead* responseHead, + bool isHttps, bool* weaklyFramed, + bool* isImmutable) { nsCString framedBuf; nsresult rv = entry->GetMetaDataElement("strongly-framed", getter_Copies(framedBuf)); @@ -509,7 +509,7 @@ void DetermineFramingAndImmutability(nsICacheEntry *entry, *isImmutable = !*weaklyFramed && isHttps && responseHead->Immutable(); } -bool IsBeforeLastActiveTabLoadOptimization(TimeStamp const &when) { +bool IsBeforeLastActiveTabLoadOptimization(TimeStamp const& when) { return gHttpHandler && gHttpHandler->IsBeforeLastActiveTabLoadOptimization(when); } @@ -525,7 +525,7 @@ TimeStamp const GetLastActiveTabLoadOptimizationHit() { : TimeStamp(); } -void SetLastActiveTabLoadOptimizationHit(TimeStamp const &when) { +void SetLastActiveTabLoadOptimizationHit(TimeStamp const& when) { if (gHttpHandler) { gHttpHandler->SetLastActiveTabLoadOptimizationHit(when); } @@ -541,8 +541,8 @@ HttpVersion GetHttpVersionFromSpdy(SpdyVersion sv) { } // namespace nsHttp template -void localEnsureBuffer(UniquePtr &buf, uint32_t newSize, uint32_t preserve, - uint32_t &objSize) { +void localEnsureBuffer(UniquePtr& buf, uint32_t newSize, uint32_t preserve, + uint32_t& objSize) { if (objSize >= newSize) return; // Leave a little slop on the new allocation - add 2KB to @@ -559,13 +559,13 @@ void localEnsureBuffer(UniquePtr &buf, uint32_t newSize, uint32_t preserve, buf = std::move(tmp); } -void EnsureBuffer(UniquePtr &buf, uint32_t newSize, uint32_t preserve, - uint32_t &objSize) { +void EnsureBuffer(UniquePtr& buf, uint32_t newSize, uint32_t preserve, + uint32_t& objSize) { localEnsureBuffer(buf, newSize, preserve, objSize); } -void EnsureBuffer(UniquePtr &buf, uint32_t newSize, - uint32_t preserve, uint32_t &objSize) { +void EnsureBuffer(UniquePtr& buf, uint32_t newSize, + uint32_t preserve, uint32_t& objSize) { localEnsureBuffer(buf, newSize, preserve, objSize); } @@ -579,8 +579,8 @@ static bool IsTokenSymbol(signed char chr) { return true; } -ParsedHeaderPair::ParsedHeaderPair(const char *name, int32_t nameLen, - const char *val, int32_t valLen, +ParsedHeaderPair::ParsedHeaderPair(const char* name, int32_t nameLen, + const char* val, int32_t valLen, bool isQuotedValue) : mName(nsDependentCSubstring(nullptr, 0u)), mValue(nsDependentCSubstring(nullptr, 0u)), @@ -598,10 +598,10 @@ ParsedHeaderPair::ParsedHeaderPair(const char *name, int32_t nameLen, } } -void ParsedHeaderPair::RemoveQuotedStringEscapes(const char *val, +void ParsedHeaderPair::RemoveQuotedStringEscapes(const char* val, int32_t valLen) { mUnquotedValue.Truncate(); - const char *c = val; + const char* c = val; for (int32_t i = 0; i < valLen; ++i) { if (c[i] == '\\' && c[i + 1]) { ++i; @@ -611,10 +611,10 @@ void ParsedHeaderPair::RemoveQuotedStringEscapes(const char *val, } static void Tokenize( - const char *input, uint32_t inputLen, const char token, - const std::function &consumer) { - auto trimWhitespace = [](const char *in, uint32_t inLen, const char **out, - uint32_t *outLen) { + const char* input, uint32_t inputLen, const char token, + const std::function& consumer) { + auto trimWhitespace = [](const char* in, uint32_t inLen, const char** out, + uint32_t* outLen) { *out = in; *outLen = inLen; if (inLen == 0) { @@ -628,7 +628,7 @@ static void Tokenize( } // Trim tailing space - for (const char *i = *out + *outLen - 1; i >= *out; --i) { + for (const char* i = *out + *outLen - 1; i >= *out; --i) { if (!nsCRT::IsAsciiSpace(*i)) { break; } @@ -636,9 +636,9 @@ static void Tokenize( } }; - const char *first = input; + const char* first = input; bool inQuote = false; - const char *result = nullptr; + const char* result = nullptr; uint32_t resultLen = 0; for (uint32_t index = 0; index < inputLen; ++index) { if (inQuote && input[index] == '\\' && input[index + 1]) { @@ -663,26 +663,26 @@ static void Tokenize( consumer(result, resultLen); } -ParsedHeaderValueList::ParsedHeaderValueList(const char *t, uint32_t len, +ParsedHeaderValueList::ParsedHeaderValueList(const char* t, uint32_t len, bool allowInvalidValue) { if (!len) { return; } - ParsedHeaderValueList *self = this; - auto consumer = [=](const char *output, uint32_t outputLength) { + ParsedHeaderValueList* self = this; + auto consumer = [=](const char* output, uint32_t outputLength) { self->ParseNameAndValue(output, allowInvalidValue); }; Tokenize(t, len, ';', consumer); } -void ParsedHeaderValueList::ParseNameAndValue(const char *input, +void ParsedHeaderValueList::ParseNameAndValue(const char* input, bool allowInvalidValue) { - const char *nameStart = input; - const char *nameEnd = nullptr; - const char *valueStart = input; - const char *valueEnd = nullptr; + const char* nameStart = input; + const char* nameEnd = nullptr; + const char* valueStart = input; + const char* valueEnd = nullptr; bool isQuotedString = false; bool invalidValue = false; @@ -698,7 +698,7 @@ void ParsedHeaderValueList::ParseNameAndValue(const char *input, } // Check whether param name is a valid token. - for (const char *c = nameStart; c < nameEnd; c++) { + for (const char* c = nameStart; c < nameEnd; c++) { if (!IsTokenSymbol(*c)) { nameEnd = c; break; @@ -731,7 +731,7 @@ void ParsedHeaderValueList::ParseNameAndValue(const char *input, valueEnd++) ; if (!allowInvalidValue) { - for (const char *c = valueStart; c < valueEnd; c++) { + for (const char* c = valueStart; c < valueEnd; c++) { if (!IsTokenSymbol(*c)) { valueEnd = c; break; @@ -773,10 +773,10 @@ void ParsedHeaderValueList::ParseNameAndValue(const char *input, } ParsedHeaderValueListList::ParsedHeaderValueListList( - const nsCString &fullHeader, bool allowInvalidValue) + const nsCString& fullHeader, bool allowInvalidValue) : mFull(fullHeader) { - auto &values = mValues; - auto consumer = [&values, allowInvalidValue](const char *output, + auto& values = mValues; + auto consumer = [&values, allowInvalidValue](const char* output, uint32_t outputLength) { values.AppendElement( ParsedHeaderValueList(output, outputLength, allowInvalidValue)); @@ -785,12 +785,12 @@ ParsedHeaderValueListList::ParsedHeaderValueListList( Tokenize(mFull.BeginReading(), mFull.Length(), ',', consumer); } -void LogCallingScriptLocation(void *instance) { +void LogCallingScriptLocation(void* instance) { if (!LOG4_ENABLED()) { return; } - JSContext *cx = nsContentUtils::GetCurrentJSContext(); + JSContext* cx = nsContentUtils::GetCurrentJSContext(); if (!cx) { return; } diff --git a/netwerk/protocol/http/nsHttp.h b/netwerk/protocol/http/nsHttp.h index df293cc172626..2db22cb1b6e85 100644 --- a/netwerk/protocol/http/nsHttp.h +++ b/netwerk/protocol/http/nsHttp.h @@ -141,14 +141,14 @@ enum class SpdyVersion { //----------------------------------------------------------------------------- struct nsHttpAtom { - operator const char *() const { return _val; } - const char *get() const { return _val; } + operator const char*() const { return _val; } + const char* get() const { return _val; } - void operator=(const char *v) { _val = v; } - void operator=(const nsHttpAtom &a) { _val = a._val; } + void operator=(const char* v) { _val = v; } + void operator=(const nsHttpAtom& a) { _val = a._val; } // private - const char *_val; + const char* _val; }; namespace nsHttp { @@ -158,37 +158,37 @@ void DestroyAtomTable(); // The mutex is valid any time the Atom Table is valid // This mutex is used in the unusual case that the network thread and // main thread might access the same data -Mutex *GetLock(); +Mutex* GetLock(); // will dynamically add atoms to the table if they don't already exist -nsHttpAtom ResolveAtom(const char *); -inline nsHttpAtom ResolveAtom(const nsACString &s) { +nsHttpAtom ResolveAtom(const char*); +inline nsHttpAtom ResolveAtom(const nsACString& s) { return ResolveAtom(PromiseFlatCString(s).get()); } // returns true if the specified token [start,end) is valid per RFC 2616 // section 2.2 -bool IsValidToken(const char *start, const char *end); +bool IsValidToken(const char* start, const char* end); -inline bool IsValidToken(const nsACString &s) { +inline bool IsValidToken(const nsACString& s) { return IsValidToken(s.BeginReading(), s.EndReading()); } // Strip the leading or trailing HTTP whitespace per fetch spec section 2.2. -void TrimHTTPWhitespace(const nsACString &aSource, nsACString &aDest); +void TrimHTTPWhitespace(const nsACString& aSource, nsACString& aDest); // Returns true if the specified value is reasonable given the defintion // in RFC 2616 section 4.2. Full strict validation is not performed // currently as it would require full parsing of the value. -bool IsReasonableHeaderValue(const nsACString &s); +bool IsReasonableHeaderValue(const nsACString& s); // find the first instance (case-insensitive comparison) of the given // |token| in the |input| string. the |token| is bounded by elements of // |separators| and may appear at the beginning or end of the |input| // string. null is returned if the |token| is not found. |input| may be // null, in which case null is returned. -const char *FindToken(const char *input, const char *token, - const char *separators); +const char* FindToken(const char* input, const char* token, + const char* separators); // This function parses a string containing a decimal-valued, non-negative // 64-bit integer. If the value would exceed INT64_MAX, then false is @@ -198,13 +198,13 @@ const char *FindToken(const char *input, const char *token, // // TODO(darin): Replace this with something generic. // -MOZ_MUST_USE bool ParseInt64(const char *input, const char **next, - int64_t *result); +MOZ_MUST_USE bool ParseInt64(const char* input, const char** next, + int64_t* result); // Variant on ParseInt64 that expects the input string to contain nothing // more than the value being parsed. -inline MOZ_MUST_USE bool ParseInt64(const char *input, int64_t *result) { - const char *next; +inline MOZ_MUST_USE bool ParseInt64(const char* input, int64_t* result) { + const char* next; return ParseInt64(input, &next, result) && *next == '\0'; } @@ -212,36 +212,36 @@ inline MOZ_MUST_USE bool ParseInt64(const char *input, int64_t *result) { bool IsPermanentRedirect(uint32_t httpStatus); // Returns the APLN token which represents the used protocol version. -const char *GetProtocolVersion(HttpVersion pv); +const char* GetProtocolVersion(HttpVersion pv); bool ValidationRequired(bool isForcedValid, - nsHttpResponseHead *cachedResponseHead, + nsHttpResponseHead* cachedResponseHead, uint32_t loadFlags, bool allowStaleCacheContent, bool isImmutable, bool customConditionalRequest, - nsHttpRequestHead &requestHead, nsICacheEntry *entry, - CacheControlParser &cacheControlRequest, + nsHttpRequestHead& requestHead, nsICacheEntry* entry, + CacheControlParser& cacheControlRequest, bool fromPreviousSession, - bool *performBackgroundRevalidation = nullptr); + bool* performBackgroundRevalidation = nullptr); nsresult GetHttpResponseHeadFromCacheEntry( - nsICacheEntry *entry, nsHttpResponseHead *cachedResponseHead); + nsICacheEntry* entry, nsHttpResponseHead* cachedResponseHead); -nsresult CheckPartial(nsICacheEntry *aEntry, int64_t *aSize, - int64_t *aContentLength, - nsHttpResponseHead *responseHead); +nsresult CheckPartial(nsICacheEntry* aEntry, int64_t* aSize, + int64_t* aContentLength, + nsHttpResponseHead* responseHead); -void DetermineFramingAndImmutability(nsICacheEntry *entry, - nsHttpResponseHead *cachedResponseHead, - bool isHttps, bool *weaklyFramed, - bool *isImmutable); +void DetermineFramingAndImmutability(nsICacheEntry* entry, + nsHttpResponseHead* cachedResponseHead, + bool isHttps, bool* weaklyFramed, + bool* isImmutable); // Called when an optimization feature affecting active vs background tab load // took place. Called only on the parent process and only updates // mLastActiveTabLoadOptimizationHit timestamp to now. void NotifyActiveTabLoadOptimization(); TimeStamp const GetLastActiveTabLoadOptimizationHit(); -void SetLastActiveTabLoadOptimizationHit(TimeStamp const &when); -bool IsBeforeLastActiveTabLoadOptimization(TimeStamp const &when); +void SetLastActiveTabLoadOptimizationHit(TimeStamp const& when); +bool IsBeforeLastActiveTabLoadOptimization(TimeStamp const& when); HttpVersion GetHttpVersionFromSpdy(SpdyVersion sv); @@ -272,20 +272,20 @@ static inline uint32_t PRTimeToSeconds(PRTime t_usec) { #define HTTP_LWS " \t" #define HTTP_HEADER_VALUE_SEPS HTTP_LWS "," -void EnsureBuffer(UniquePtr &buf, uint32_t newSize, uint32_t preserve, - uint32_t &objSize); -void EnsureBuffer(UniquePtr &buf, uint32_t newSize, - uint32_t preserve, uint32_t &objSize); +void EnsureBuffer(UniquePtr& buf, uint32_t newSize, uint32_t preserve, + uint32_t& objSize); +void EnsureBuffer(UniquePtr& buf, uint32_t newSize, + uint32_t preserve, uint32_t& objSize); // h2=":443"; ma=60; single // results in 3 mValues = {{h2, :443}, {ma, 60}, {single}} class ParsedHeaderPair { public: - ParsedHeaderPair(const char *name, int32_t nameLen, const char *val, + ParsedHeaderPair(const char* name, int32_t nameLen, const char* val, int32_t valLen, bool isQuotedValue); - ParsedHeaderPair(ParsedHeaderPair const ©) + ParsedHeaderPair(ParsedHeaderPair const& copy) : mName(copy.mName), mValue(copy.mValue), mUnquotedValue(copy.mUnquotedValue), @@ -302,16 +302,16 @@ class ParsedHeaderPair { nsCString mUnquotedValue; bool mIsQuotedValue; - void RemoveQuotedStringEscapes(const char *val, int32_t valLen); + void RemoveQuotedStringEscapes(const char* val, int32_t valLen); }; class ParsedHeaderValueList { public: - ParsedHeaderValueList(const char *t, uint32_t len, bool allowInvalidValue); + ParsedHeaderValueList(const char* t, uint32_t len, bool allowInvalidValue); nsTArray mValues; private: - void ParseNameAndValue(const char *input, bool allowInvalidValue); + void ParseNameAndValue(const char* input, bool allowInvalidValue); }; class ParsedHeaderValueListList { @@ -322,7 +322,7 @@ class ParsedHeaderValueListList { // Note that ParsedHeaderValueListList is currently used to parse // Alt-Svc and Server-Timing header. |allowInvalidValue| is set to true // when parsing Alt-Svc for historical reasons. - explicit ParsedHeaderValueListList(const nsCString &txt, + explicit ParsedHeaderValueListList(const nsCString& txt, bool allowInvalidValue = true); nsTArray mValues; diff --git a/netwerk/protocol/http/nsHttpActivityDistributor.cpp b/netwerk/protocol/http/nsHttpActivityDistributor.cpp index 353c328f0a88c..ae2629ff6d863 100644 --- a/netwerk/protocol/http/nsHttpActivityDistributor.cpp +++ b/netwerk/protocol/http/nsHttpActivityDistributor.cpp @@ -19,11 +19,11 @@ typedef nsTArray ObserverArray; class nsHttpActivityEvent : public Runnable { public: - nsHttpActivityEvent(nsISupports *aHttpChannel, uint32_t aActivityType, + nsHttpActivityEvent(nsISupports* aHttpChannel, uint32_t aActivityType, uint32_t aActivitySubtype, PRTime aTimestamp, uint64_t aExtraSizeData, - const nsACString &aExtraStringData, - ObserverArray *aObservers) + const nsACString& aExtraStringData, + ObserverArray* aObservers) : Runnable("net::nsHttpActivityEvent"), mHttpChannel(aHttpChannel), mActivityType(aActivityType), @@ -62,12 +62,12 @@ nsHttpActivityDistributor::nsHttpActivityDistributor() : mLock("nsHttpActivityDistributor.mLock") {} NS_IMETHODIMP -nsHttpActivityDistributor::ObserveActivity(nsISupports *aHttpChannel, +nsHttpActivityDistributor::ObserveActivity(nsISupports* aHttpChannel, uint32_t aActivityType, uint32_t aActivitySubtype, PRTime aTimestamp, uint64_t aExtraSizeData, - const nsACString &aExtraStringData) { + const nsACString& aExtraStringData) { nsCOMPtr event; { MutexAutoLock lock(mLock); @@ -83,7 +83,7 @@ nsHttpActivityDistributor::ObserveActivity(nsISupports *aHttpChannel, } NS_IMETHODIMP -nsHttpActivityDistributor::GetIsActive(bool *isActive) { +nsHttpActivityDistributor::GetIsActive(bool* isActive) { NS_ENSURE_ARG_POINTER(isActive); MutexAutoLock lock(mLock); *isActive = !!mObservers.Length(); @@ -91,7 +91,7 @@ nsHttpActivityDistributor::GetIsActive(bool *isActive) { } NS_IMETHODIMP -nsHttpActivityDistributor::AddObserver(nsIHttpActivityObserver *aObserver) { +nsHttpActivityDistributor::AddObserver(nsIHttpActivityObserver* aObserver) { MutexAutoLock lock(mLock); ObserverHandle observer( @@ -102,7 +102,7 @@ nsHttpActivityDistributor::AddObserver(nsIHttpActivityObserver *aObserver) { } NS_IMETHODIMP -nsHttpActivityDistributor::RemoveObserver(nsIHttpActivityObserver *aObserver) { +nsHttpActivityDistributor::RemoveObserver(nsIHttpActivityObserver* aObserver) { MutexAutoLock lock(mLock); ObserverHandle observer( diff --git a/netwerk/protocol/http/nsHttpAuthCache.cpp b/netwerk/protocol/http/nsHttpAuthCache.cpp index e5fb8c43c2d59..3fe3b50c9e8ea 100644 --- a/netwerk/protocol/http/nsHttpAuthCache.cpp +++ b/netwerk/protocol/http/nsHttpAuthCache.cpp @@ -21,9 +21,9 @@ namespace mozilla { namespace net { -static inline void GetAuthKey(const char *scheme, const char *host, - int32_t port, nsACString const &originSuffix, - nsCString &key) { +static inline void GetAuthKey(const char* scheme, const char* host, + int32_t port, nsACString const& originSuffix, + nsCString& key) { key.Truncate(); key.Append(originSuffix); key.Append(':'); @@ -36,7 +36,7 @@ static inline void GetAuthKey(const char *scheme, const char *host, // return true if the two strings are equal or both empty. an empty string // is either null or zero length. -static bool StrEquivalent(const char16_t *a, const char16_t *b) { +static bool StrEquivalent(const char16_t* a, const char16_t* b) { static const char16_t emptyStr[] = {0}; if (!a) a = emptyStr; @@ -67,47 +67,47 @@ nsHttpAuthCache::~nsHttpAuthCache() { } } -nsresult nsHttpAuthCache::GetAuthEntryForPath(const char *scheme, - const char *host, int32_t port, - const char *path, - nsACString const &originSuffix, - nsHttpAuthEntry **entry) { +nsresult nsHttpAuthCache::GetAuthEntryForPath(const char* scheme, + const char* host, int32_t port, + const char* path, + nsACString const& originSuffix, + nsHttpAuthEntry** entry) { LOG(("nsHttpAuthCache::GetAuthEntryForPath [key=%s://%s:%d path=%s]\n", scheme, host, port, path)); nsAutoCString key; - nsHttpAuthNode *node = LookupAuthNode(scheme, host, port, originSuffix, key); + nsHttpAuthNode* node = LookupAuthNode(scheme, host, port, originSuffix, key); if (!node) return NS_ERROR_NOT_AVAILABLE; *entry = node->LookupEntryByPath(path); return *entry ? NS_OK : NS_ERROR_NOT_AVAILABLE; } -nsresult nsHttpAuthCache::GetAuthEntryForDomain(const char *scheme, - const char *host, int32_t port, - const char *realm, - nsACString const &originSuffix, - nsHttpAuthEntry **entry) +nsresult nsHttpAuthCache::GetAuthEntryForDomain(const char* scheme, + const char* host, int32_t port, + const char* realm, + nsACString const& originSuffix, + nsHttpAuthEntry** entry) { LOG(("nsHttpAuthCache::GetAuthEntryForDomain [key=%s://%s:%d realm=%s]\n", scheme, host, port, realm)); nsAutoCString key; - nsHttpAuthNode *node = LookupAuthNode(scheme, host, port, originSuffix, key); + nsHttpAuthNode* node = LookupAuthNode(scheme, host, port, originSuffix, key); if (!node) return NS_ERROR_NOT_AVAILABLE; *entry = node->LookupEntryByRealm(realm); return *entry ? NS_OK : NS_ERROR_NOT_AVAILABLE; } -nsresult nsHttpAuthCache::SetAuthEntry(const char *scheme, const char *host, - int32_t port, const char *path, - const char *realm, const char *creds, - const char *challenge, - nsACString const &originSuffix, - const nsHttpAuthIdentity *ident, - nsISupports *metadata) { +nsresult nsHttpAuthCache::SetAuthEntry(const char* scheme, const char* host, + int32_t port, const char* path, + const char* realm, const char* creds, + const char* challenge, + nsACString const& originSuffix, + const nsHttpAuthIdentity* ident, + nsISupports* metadata) { nsresult rv; LOG( @@ -116,7 +116,7 @@ nsresult nsHttpAuthCache::SetAuthEntry(const char *scheme, const char *host, scheme, host, port, realm, path, metadata)); nsAutoCString key; - nsHttpAuthNode *node = LookupAuthNode(scheme, host, port, originSuffix, key); + nsHttpAuthNode* node = LookupAuthNode(scheme, host, port, originSuffix, key); if (!node) { // create a new entry node and set the given entry @@ -132,9 +132,9 @@ nsresult nsHttpAuthCache::SetAuthEntry(const char *scheme, const char *host, return node->SetAuthEntry(path, realm, creds, challenge, ident, metadata); } -void nsHttpAuthCache::ClearAuthEntry(const char *scheme, const char *host, - int32_t port, const char *realm, - nsACString const &originSuffix) { +void nsHttpAuthCache::ClearAuthEntry(const char* scheme, const char* host, + int32_t port, const char* realm, + nsACString const& originSuffix) { nsAutoCString key; GetAuthKey(scheme, host, port, originSuffix, key); mDB.Remove(key); @@ -150,10 +150,10 @@ nsresult nsHttpAuthCache::ClearAll() { // nsHttpAuthCache //----------------------------------------------------------------------------- -nsHttpAuthNode *nsHttpAuthCache::LookupAuthNode(const char *scheme, - const char *host, int32_t port, - nsACString const &originSuffix, - nsCString &key) { +nsHttpAuthNode* nsHttpAuthCache::LookupAuthNode(const char* scheme, + const char* host, int32_t port, + nsACString const& originSuffix, + nsCString& key) { GetAuthKey(scheme, host, port, originSuffix, key); return mDB.Get(key); } @@ -161,9 +161,9 @@ nsHttpAuthNode *nsHttpAuthCache::LookupAuthNode(const char *scheme, NS_IMPL_ISUPPORTS(nsHttpAuthCache::OriginClearObserver, nsIObserver) NS_IMETHODIMP -nsHttpAuthCache::OriginClearObserver::Observe(nsISupports *subject, - const char *topic, - const char16_t *data_unicode) { +nsHttpAuthCache::OriginClearObserver::Observe(nsISupports* subject, + const char* topic, + const char16_t* data_unicode) { NS_ENSURE_TRUE(mOwner, NS_ERROR_NOT_AVAILABLE); OriginAttributesPattern pattern; @@ -176,9 +176,9 @@ nsHttpAuthCache::OriginClearObserver::Observe(nsISupports *subject, return NS_OK; } -void nsHttpAuthCache::ClearOriginData(OriginAttributesPattern const &pattern) { +void nsHttpAuthCache::ClearOriginData(OriginAttributesPattern const& pattern) { for (auto iter = mDB.Iter(); !iter.Done(); iter.Next()) { - const nsACString &key = iter.Key(); + const nsACString& key = iter.Key(); // Extract the origin attributes suffix from the key. int32_t colon = key.FindChar(':'); @@ -201,8 +201,8 @@ void nsHttpAuthCache::ClearOriginData(OriginAttributesPattern const &pattern) { // nsHttpAuthIdentity //----------------------------------------------------------------------------- -nsresult nsHttpAuthIdentity::Set(const char16_t *domain, const char16_t *user, - const char16_t *pass) { +nsresult nsHttpAuthIdentity::Set(const char16_t* domain, const char16_t* user, + const char16_t* pass) { char16_t *newUser, *newPass, *newDomain; int domainLen = domain ? NS_strlen(domain) : 0; @@ -210,7 +210,7 @@ nsresult nsHttpAuthIdentity::Set(const char16_t *domain, const char16_t *user, int passLen = pass ? NS_strlen(pass) : 0; int len = userLen + 1 + passLen + 1 + domainLen + 1; - newUser = (char16_t *)malloc(len * sizeof(char16_t)); + newUser = (char16_t*)malloc(len * sizeof(char16_t)); if (!newUser) return NS_ERROR_OUT_OF_MEMORY; if (user) memcpy(newUser, user, userLen * sizeof(char16_t)); @@ -242,7 +242,7 @@ void nsHttpAuthIdentity::Clear() { } } -bool nsHttpAuthIdentity::Equals(const nsHttpAuthIdentity &ident) const { +bool nsHttpAuthIdentity::Equals(const nsHttpAuthIdentity& ident) const { // we could probably optimize this with a single loop, but why bother? return StrEquivalent(mUser, ident.mUser) && StrEquivalent(mPass, ident.mPass) && @@ -257,19 +257,19 @@ nsHttpAuthEntry::~nsHttpAuthEntry() { if (mRealm) free(mRealm); while (mRoot) { - nsHttpAuthPath *ap = mRoot; + nsHttpAuthPath* ap = mRoot; mRoot = mRoot->mNext; free(ap); } } -nsresult nsHttpAuthEntry::AddPath(const char *aPath) { +nsresult nsHttpAuthEntry::AddPath(const char* aPath) { // null path matches empty path if (!aPath) aPath = ""; - nsHttpAuthPath *tempPtr = mRoot; + nsHttpAuthPath* tempPtr = mRoot; while (tempPtr) { - const char *curpath = tempPtr->mPath; + const char* curpath = tempPtr->mPath; if (strncmp(aPath, curpath, strlen(curpath)) == 0) return NS_OK; // subpath already exists in the list @@ -277,9 +277,9 @@ nsresult nsHttpAuthEntry::AddPath(const char *aPath) { } // Append the aPath - nsHttpAuthPath *newAuthPath; + nsHttpAuthPath* newAuthPath; int newpathLen = strlen(aPath); - newAuthPath = (nsHttpAuthPath *)malloc(sizeof(nsHttpAuthPath) + newpathLen); + newAuthPath = (nsHttpAuthPath*)malloc(sizeof(nsHttpAuthPath) + newpathLen); if (!newAuthPath) return NS_ERROR_OUT_OF_MEMORY; memcpy(newAuthPath->mPath, aPath, newpathLen + 1); @@ -295,10 +295,10 @@ nsresult nsHttpAuthEntry::AddPath(const char *aPath) { return NS_OK; } -nsresult nsHttpAuthEntry::Set(const char *path, const char *realm, - const char *creds, const char *chall, - const nsHttpAuthIdentity *ident, - nsISupports *metadata) { +nsresult nsHttpAuthEntry::Set(const char* path, const char* realm, + const char* creds, const char* chall, + const nsHttpAuthIdentity* ident, + nsISupports* metadata) { char *newRealm, *newCreds, *newChall; int realmLen = realm ? strlen(realm) : 0; @@ -306,7 +306,7 @@ nsresult nsHttpAuthEntry::Set(const char *path, const char *realm, int challLen = chall ? strlen(chall) : 0; int len = realmLen + 1 + credsLen + 1 + challLen + 1; - newRealm = (char *)malloc(len); + newRealm = (char*)malloc(len); if (!newRealm) return NS_ERROR_OUT_OF_MEMORY; if (realm) memcpy(newRealm, realm, realmLen); @@ -367,8 +367,8 @@ nsHttpAuthNode::~nsHttpAuthNode() { mList.Clear(); } -nsHttpAuthEntry *nsHttpAuthNode::LookupEntryByPath(const char *path) { - nsHttpAuthEntry *entry; +nsHttpAuthEntry* nsHttpAuthNode::LookupEntryByPath(const char* path) { + nsHttpAuthEntry* entry; // null path matches empty path if (!path) path = ""; @@ -378,9 +378,9 @@ nsHttpAuthEntry *nsHttpAuthNode::LookupEntryByPath(const char *path) { // directory of an existing entry. for (uint32_t i = 0; i < mList.Length(); ++i) { entry = mList[i]; - nsHttpAuthPath *authPath = entry->RootPath(); + nsHttpAuthPath* authPath = entry->RootPath(); while (authPath) { - const char *entryPath = authPath->mPath; + const char* entryPath = authPath->mPath; // proxy auth entries have no path, so require exact match on // empty path string. if (entryPath[0] == '\0') { @@ -394,8 +394,8 @@ nsHttpAuthEntry *nsHttpAuthNode::LookupEntryByPath(const char *path) { return nullptr; } -nsHttpAuthEntry *nsHttpAuthNode::LookupEntryByRealm(const char *realm) { - nsHttpAuthEntry *entry; +nsHttpAuthEntry* nsHttpAuthNode::LookupEntryByRealm(const char* realm) { + nsHttpAuthEntry* entry; // null realm matches empty realm if (!realm) realm = ""; @@ -409,12 +409,12 @@ nsHttpAuthEntry *nsHttpAuthNode::LookupEntryByRealm(const char *realm) { return nullptr; } -nsresult nsHttpAuthNode::SetAuthEntry(const char *path, const char *realm, - const char *creds, const char *challenge, - const nsHttpAuthIdentity *ident, - nsISupports *metadata) { +nsresult nsHttpAuthNode::SetAuthEntry(const char* path, const char* realm, + const char* creds, const char* challenge, + const nsHttpAuthIdentity* ident, + nsISupports* metadata) { // look for an entry with a matching realm - nsHttpAuthEntry *entry = LookupEntryByRealm(realm); + nsHttpAuthEntry* entry = LookupEntryByRealm(realm); if (!entry) { entry = new nsHttpAuthEntry(path, realm, creds, challenge, ident, metadata); if (!entry) return NS_ERROR_OUT_OF_MEMORY; @@ -432,8 +432,8 @@ nsresult nsHttpAuthNode::SetAuthEntry(const char *path, const char *realm, return NS_OK; } -void nsHttpAuthNode::ClearAuthEntry(const char *realm) { - nsHttpAuthEntry *entry = LookupEntryByRealm(realm); +void nsHttpAuthNode::ClearAuthEntry(const char* realm) { + nsHttpAuthEntry* entry = LookupEntryByRealm(realm); if (entry) { mList.RemoveElement(entry); // double search OK } diff --git a/netwerk/protocol/http/nsHttpAuthCache.h b/netwerk/protocol/http/nsHttpAuthCache.h index 054e865b185e2..e9896ceb85e7c 100644 --- a/netwerk/protocol/http/nsHttpAuthCache.h +++ b/netwerk/protocol/http/nsHttpAuthCache.h @@ -22,7 +22,7 @@ class OriginAttributesPattern; namespace net { struct nsHttpAuthPath { - struct nsHttpAuthPath *mNext; + struct nsHttpAuthPath* mNext; char mPath[1]; }; @@ -33,33 +33,33 @@ struct nsHttpAuthPath { class nsHttpAuthIdentity { public: nsHttpAuthIdentity() : mUser(nullptr), mPass(nullptr), mDomain(nullptr) {} - nsHttpAuthIdentity(const char16_t *domain, const char16_t *user, - const char16_t *password) + nsHttpAuthIdentity(const char16_t* domain, const char16_t* user, + const char16_t* password) : mUser(nullptr), mPass{nullptr}, mDomain{nullptr} { DebugOnly rv = Set(domain, user, password); MOZ_ASSERT(NS_SUCCEEDED(rv)); } ~nsHttpAuthIdentity() { Clear(); } - const char16_t *Domain() const { return mDomain; } - const char16_t *User() const { return mUser; } - const char16_t *Password() const { return mPass; } + const char16_t* Domain() const { return mDomain; } + const char16_t* User() const { return mUser; } + const char16_t* Password() const { return mPass; } - MOZ_MUST_USE nsresult Set(const char16_t *domain, const char16_t *user, - const char16_t *password); - MOZ_MUST_USE nsresult Set(const nsHttpAuthIdentity &other) { + MOZ_MUST_USE nsresult Set(const char16_t* domain, const char16_t* user, + const char16_t* password); + MOZ_MUST_USE nsresult Set(const nsHttpAuthIdentity& other) { return Set(other.mDomain, other.mUser, other.mPass); } void Clear(); - bool Equals(const nsHttpAuthIdentity &other) const; + bool Equals(const nsHttpAuthIdentity& other) const; bool IsEmpty() const { return !mUser; } private: // allocated as one contiguous blob, starting at mUser. - char16_t *mUser; - char16_t *mPass; - char16_t *mDomain; + char16_t* mUser; + char16_t* mPass; + char16_t* mDomain; }; //----------------------------------------------------------------------------- @@ -68,24 +68,24 @@ class nsHttpAuthIdentity { class nsHttpAuthEntry { public: - const char *Realm() const { return mRealm; } - const char *Creds() const { return mCreds; } - const char *Challenge() const { return mChallenge; } - const char16_t *Domain() const { return mIdent.Domain(); } - const char16_t *User() const { return mIdent.User(); } - const char16_t *Pass() const { return mIdent.Password(); } - nsHttpAuthPath *RootPath() { return mRoot; } + const char* Realm() const { return mRealm; } + const char* Creds() const { return mCreds; } + const char* Challenge() const { return mChallenge; } + const char16_t* Domain() const { return mIdent.Domain(); } + const char16_t* User() const { return mIdent.User(); } + const char16_t* Pass() const { return mIdent.Password(); } + nsHttpAuthPath* RootPath() { return mRoot; } - const nsHttpAuthIdentity &Identity() const { return mIdent; } + const nsHttpAuthIdentity& Identity() const { return mIdent; } - MOZ_MUST_USE nsresult AddPath(const char *aPath); + MOZ_MUST_USE nsresult AddPath(const char* aPath); nsCOMPtr mMetaData; private: - nsHttpAuthEntry(const char *path, const char *realm, const char *creds, - const char *challenge, const nsHttpAuthIdentity *ident, - nsISupports *metadata) + nsHttpAuthEntry(const char* path, const char* realm, const char* creds, + const char* challenge, const nsHttpAuthIdentity* ident, + nsISupports* metadata) : mRoot(nullptr), mTail(nullptr), mRealm(nullptr), @@ -97,20 +97,20 @@ class nsHttpAuthEntry { } ~nsHttpAuthEntry(); - MOZ_MUST_USE nsresult Set(const char *path, const char *realm, - const char *creds, const char *challenge, - const nsHttpAuthIdentity *ident, - nsISupports *metadata); + MOZ_MUST_USE nsresult Set(const char* path, const char* realm, + const char* creds, const char* challenge, + const nsHttpAuthIdentity* ident, + nsISupports* metadata); nsHttpAuthIdentity mIdent; - nsHttpAuthPath *mRoot; // root pointer - nsHttpAuthPath *mTail; // tail pointer + nsHttpAuthPath* mRoot; // root pointer + nsHttpAuthPath* mTail; // tail pointer // allocated together in one blob, starting with mRealm. - char *mRealm; - char *mCreds; - char *mChallenge; + char* mRealm; + char* mCreds; + char* mChallenge; friend class nsHttpAuthNode; friend class nsHttpAuthCache; @@ -128,19 +128,19 @@ class nsHttpAuthNode { // path can be null, in which case we'll search for an entry // with a null path. - nsHttpAuthEntry *LookupEntryByPath(const char *path); + nsHttpAuthEntry* LookupEntryByPath(const char* path); // realm must not be null - nsHttpAuthEntry *LookupEntryByRealm(const char *realm); + nsHttpAuthEntry* LookupEntryByRealm(const char* realm); // if a matching entry is found, then credentials will be changed. - MOZ_MUST_USE nsresult SetAuthEntry(const char *path, const char *realm, - const char *credentials, - const char *challenge, - const nsHttpAuthIdentity *ident, - nsISupports *metadata); + MOZ_MUST_USE nsresult SetAuthEntry(const char* path, const char* realm, + const char* credentials, + const char* challenge, + const nsHttpAuthIdentity* ident, + nsISupports* metadata); - void ClearAuthEntry(const char *realm); + void ClearAuthEntry(const char* realm); uint32_t EntryCount() { return mList.Length(); } @@ -164,44 +164,44 @@ class nsHttpAuthCache { // |scheme|, |host|, and |port| are required // |path| can be null // |entry| is either null or a weak reference - MOZ_MUST_USE nsresult GetAuthEntryForPath(const char *scheme, - const char *host, int32_t port, - const char *path, - nsACString const &originSuffix, - nsHttpAuthEntry **entry); + MOZ_MUST_USE nsresult GetAuthEntryForPath(const char* scheme, + const char* host, int32_t port, + const char* path, + nsACString const& originSuffix, + nsHttpAuthEntry** entry); // |scheme|, |host|, and |port| are required // |realm| must not be null // |entry| is either null or a weak reference - MOZ_MUST_USE nsresult GetAuthEntryForDomain(const char *scheme, - const char *host, int32_t port, - const char *realm, - nsACString const &originSuffix, - nsHttpAuthEntry **entry); + MOZ_MUST_USE nsresult GetAuthEntryForDomain(const char* scheme, + const char* host, int32_t port, + const char* realm, + nsACString const& originSuffix, + nsHttpAuthEntry** entry); // |scheme|, |host|, and |port| are required // |path| can be null // |realm| must not be null // if |credentials|, |user|, |pass|, and |challenge| are each // null, then the entry is deleted. - MOZ_MUST_USE nsresult SetAuthEntry(const char *scheme, const char *host, - int32_t port, const char *directory, - const char *realm, const char *credentials, - const char *challenge, - nsACString const &originSuffix, - const nsHttpAuthIdentity *ident, - nsISupports *metadata); + MOZ_MUST_USE nsresult SetAuthEntry(const char* scheme, const char* host, + int32_t port, const char* directory, + const char* realm, const char* credentials, + const char* challenge, + nsACString const& originSuffix, + const nsHttpAuthIdentity* ident, + nsISupports* metadata); - void ClearAuthEntry(const char *scheme, const char *host, int32_t port, - const char *realm, nsACString const &originSuffix); + void ClearAuthEntry(const char* scheme, const char* host, int32_t port, + const char* realm, nsACString const& originSuffix); // expire all existing auth list entries including proxy auths. MOZ_MUST_USE nsresult ClearAll(); private: - nsHttpAuthNode *LookupAuthNode(const char *scheme, const char *host, - int32_t port, nsACString const &originSuffix, - nsCString &key); + nsHttpAuthNode* LookupAuthNode(const char* scheme, const char* host, + int32_t port, nsACString const& originSuffix, + nsCString& key); class OriginClearObserver : public nsIObserver { virtual ~OriginClearObserver() = default; @@ -209,11 +209,11 @@ class nsHttpAuthCache { public: NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER - explicit OriginClearObserver(nsHttpAuthCache *aOwner) : mOwner(aOwner) {} - nsHttpAuthCache *mOwner; + explicit OriginClearObserver(nsHttpAuthCache* aOwner) : mOwner(aOwner) {} + nsHttpAuthCache* mOwner; }; - void ClearOriginData(OriginAttributesPattern const &pattern); + void ClearOriginData(OriginAttributesPattern const& pattern); private: using AuthNodeTable = nsClassHashtable; diff --git a/netwerk/protocol/http/nsHttpAuthManager.h b/netwerk/protocol/http/nsHttpAuthManager.h index 41a826d458df8..a2b49bf1e1588 100644 --- a/netwerk/protocol/http/nsHttpAuthManager.h +++ b/netwerk/protocol/http/nsHttpAuthManager.h @@ -24,8 +24,8 @@ class nsHttpAuthManager : public nsIHttpAuthManager { protected: virtual ~nsHttpAuthManager() = default; - nsHttpAuthCache *mAuthCache; - nsHttpAuthCache *mPrivateAuthCache; + nsHttpAuthCache* mAuthCache; + nsHttpAuthCache* mPrivateAuthCache; }; } // namespace net diff --git a/netwerk/protocol/http/nsHttpBasicAuth.cpp b/netwerk/protocol/http/nsHttpBasicAuth.cpp index f5bbf3daf3507..df83a8c62102f 100644 --- a/netwerk/protocol/http/nsHttpBasicAuth.cpp +++ b/netwerk/protocol/http/nsHttpBasicAuth.cpp @@ -41,11 +41,11 @@ NS_IMPL_ISUPPORTS(nsHttpBasicAuth, nsIHttpAuthenticator) //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpBasicAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel, - const char *challenge, bool isProxyAuth, - nsISupports **sessionState, - nsISupports **continuationState, - bool *identityInvalid) { +nsHttpBasicAuth::ChallengeReceived(nsIHttpAuthenticableChannel* authChannel, + const char* challenge, bool isProxyAuth, + nsISupports** sessionState, + nsISupports** continuationState, + bool* identityInvalid) { // if challenged, then the username:password that was sent must // have been wrong. *identityInvalid = true; @@ -53,20 +53,20 @@ nsHttpBasicAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel, } NS_IMETHODIMP nsHttpBasicAuth::GenerateCredentialsAsync( - nsIHttpAuthenticableChannel *authChannel, - nsIHttpAuthenticatorCallback *aCallback, const char *challenge, - bool isProxyAuth, const char16_t *domain, const char16_t *username, - const char16_t *password, nsISupports *sessionState, - nsISupports *continuationState, nsICancelable **aCancellable) { + nsIHttpAuthenticableChannel* authChannel, + nsIHttpAuthenticatorCallback* aCallback, const char* challenge, + bool isProxyAuth, const char16_t* domain, const char16_t* username, + const char16_t* password, nsISupports* sessionState, + nsISupports* continuationState, nsICancelable** aCancellable) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsHttpBasicAuth::GenerateCredentials( - nsIHttpAuthenticableChannel *authChannel, const char *challenge, - bool isProxyAuth, const char16_t *domain, const char16_t *user, - const char16_t *password, nsISupports **sessionState, - nsISupports **continuationState, uint32_t *aFlags, char **creds) + nsIHttpAuthenticableChannel* authChannel, const char* challenge, + bool isProxyAuth, const char16_t* domain, const char16_t* user, + const char16_t* password, nsISupports** sessionState, + nsISupports** continuationState, uint32_t* aFlags, char** creds) { LOG(("nsHttpBasicAuth::GenerateCredentials [challenge=%s]\n", challenge)); @@ -96,7 +96,7 @@ nsHttpBasicAuth::GenerateCredentials( } NS_IMETHODIMP -nsHttpBasicAuth::GetAuthFlags(uint32_t *flags) { +nsHttpBasicAuth::GetAuthFlags(uint32_t* flags) { *flags = REQUEST_BASED | REUSABLE_CREDENTIALS | REUSABLE_CHALLENGE; return NS_OK; } diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index ffc2e2b4f3839..a52327b08f4d7 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -175,7 +175,7 @@ void AccumulateCacheHitTelemetry(CacheDisposition hitOrMiss) { // Computes and returns a SHA1 hash of the input buffer. The input buffer // must be a null-terminated string. -nsresult Hash(const char *buf, nsACString &hash) { +nsresult Hash(const char* buf, nsACString& hash) { nsresult rv; nsCOMPtr hasher = @@ -185,8 +185,7 @@ nsresult Hash(const char *buf, nsACString &hash) { rv = hasher->Init(nsICryptoHash::SHA1); NS_ENSURE_SUCCESS(rv, rv); - rv = - hasher->Update(reinterpret_cast(buf), strlen(buf)); + rv = hasher->Update(reinterpret_cast(buf), strlen(buf)); NS_ENSURE_SUCCESS(rv, rv); rv = hasher->Finish(true, hash); @@ -195,8 +194,8 @@ nsresult Hash(const char *buf, nsACString &hash) { return NS_OK; } -bool IsInSubpathOfAppCacheManifest(nsIApplicationCache *cache, - nsACString const &uriSpec) { +bool IsInSubpathOfAppCacheManifest(nsIApplicationCache* cache, + nsACString const& uriSpec) { MOZ_ASSERT(cache); nsresult rv; @@ -242,17 +241,17 @@ bool IsInSubpathOfAppCacheManifest(nsIApplicationCache *cache, // We only treat 3xx responses as redirects if they have a Location header and // the status code is in a whitelist. -bool nsHttpChannel::WillRedirect(nsHttpResponseHead *response) { +bool nsHttpChannel::WillRedirect(nsHttpResponseHead* response) { return IsRedirectStatus(response->Status()) && response->HasHeader(nsHttp::Location); } -nsresult StoreAuthorizationMetaData(nsICacheEntry *entry, - nsHttpRequestHead *requestHead); +nsresult StoreAuthorizationMetaData(nsICacheEntry* entry, + nsHttpRequestHead* requestHead); class AutoRedirectVetoNotifier { public: - explicit AutoRedirectVetoNotifier(nsHttpChannel *channel) + explicit AutoRedirectVetoNotifier(nsHttpChannel* channel) : mChannel(channel) { if (mChannel->mHasAutoRedirectVetoNotifier) { MOZ_CRASH("Nested AutoRedirectVetoNotifier on the stack"); @@ -266,7 +265,7 @@ class AutoRedirectVetoNotifier { void RedirectSucceeded() { ReportRedirectResult(true); } private: - nsHttpChannel *mChannel; + nsHttpChannel* mChannel; void ReportRedirectResult(bool succeeded); }; @@ -283,7 +282,7 @@ void AutoRedirectVetoNotifier::ReportRedirectResult(bool succeeded) { NS_QueryNotificationCallbacks(mChannel, NS_GET_IID(nsIRedirectResultListener), getter_AddRefs(vetoHook)); - nsHttpChannel *channel = mChannel; + nsHttpChannel* channel = mChannel; mChannel = nullptr; if (vetoHook) vetoHook->OnRedirectResult(succeeded); @@ -382,8 +381,8 @@ void nsHttpChannel::ReleaseMainThreadOnlyReferences() { NS_DispatchToMainThread(new ProxyReleaseRunnable(std::move(arrayToRelease))); } -nsresult nsHttpChannel::Init(nsIURI *uri, uint32_t caps, nsProxyInfo *proxyInfo, - uint32_t proxyResolveFlags, nsIURI *proxyURI, +nsresult nsHttpChannel::Init(nsIURI* uri, uint32_t caps, nsProxyInfo* proxyInfo, + uint32_t proxyResolveFlags, nsIURI* proxyURI, uint64_t channelId, nsContentPolicyType aContentPolicyType) { nsresult rv = HttpBaseChannel::Init(uri, caps, proxyInfo, proxyResolveFlags, @@ -395,8 +394,8 @@ nsresult nsHttpChannel::Init(nsIURI *uri, uint32_t caps, nsProxyInfo *proxyInfo, return rv; } -nsresult nsHttpChannel::AddSecurityMessage(const nsAString &aMessageTag, - const nsAString &aMessageCategory) { +nsresult nsHttpChannel::AddSecurityMessage(const nsAString& aMessageTag, + const nsAString& aMessageCategory) { if (mWarningReporter) { return mWarningReporter->ReportSecurityMessage(aMessageTag, aMessageCategory); @@ -405,8 +404,8 @@ nsresult nsHttpChannel::AddSecurityMessage(const nsAString &aMessageTag, } NS_IMETHODIMP -nsHttpChannel::LogBlockedCORSRequest(const nsAString &aMessage, - const nsACString &aCategory) { +nsHttpChannel::LogBlockedCORSRequest(const nsAString& aMessage, + const nsACString& aCategory) { if (mWarningReporter) { return mWarningReporter->LogBlockedCORSRequest(aMessage, aCategory); } @@ -414,9 +413,9 @@ nsHttpChannel::LogBlockedCORSRequest(const nsAString &aMessage, } NS_IMETHODIMP -nsHttpChannel::LogMimeTypeMismatch(const nsACString &aMessageName, - bool aWarning, const nsAString &aURL, - const nsAString &aContentType) { +nsHttpChannel::LogMimeTypeMismatch(const nsACString& aMessageName, + bool aWarning, const nsAString& aURL, + const nsAString& aContentType) { if (mWarningReporter) { return mWarningReporter->LogMimeTypeMismatch(aMessageName, aWarning, aURL, aContentType); @@ -447,7 +446,7 @@ nsresult nsHttpChannel::PrepareToConnect() { // We abandon the connection here if there was one. LOG(("Waiting until resume OnBeforeConnect [this=%p]\n", this)); MOZ_ASSERT(!mCallOnResume); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->HandleOnBeforeConnect(); return NS_OK; }; @@ -468,7 +467,7 @@ void nsHttpChannel::HandleContinueCancellingByURLClassifier( ("Waiting until resume HandleContinueCancellingByURLClassifier " "[this=%p]\n", this)); - mCallOnResume = [aErrorCode](nsHttpChannel *self) { + mCallOnResume = [aErrorCode](nsHttpChannel* self) { self->HandleContinueCancellingByURLClassifier(aErrorCode); return NS_OK; }; @@ -486,7 +485,7 @@ void nsHttpChannel::HandleOnBeforeConnect() { if (mSuspendCount) { LOG(("Waiting until resume OnBeforeConnect [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->HandleOnBeforeConnect(); return NS_OK; }; @@ -653,7 +652,7 @@ nsresult nsHttpChannel::ContinueOnBeforeConnect(bool aShouldUpgrade, // We abandon the connection here if there was one. LOG(("Waiting until resume OnBeforeConnect [this=%p]\n", this)); MOZ_ASSERT(!mCallOnResume); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->OnBeforeConnectContinue(); return NS_OK; }; @@ -669,7 +668,7 @@ void nsHttpChannel::OnBeforeConnectContinue() { if (mSuspendCount) { LOG(("Waiting until resume OnBeforeConnect [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->OnBeforeConnectContinue(); return NS_OK; }; @@ -798,7 +797,7 @@ nsresult nsHttpChannel::ContinueConnect() { if (mCacheEntry) { // read straight from the cache if possible... if (mCachedContentIsValid) { - nsRunnableMethod *event = nullptr; + nsRunnableMethod* event = nullptr; nsresult rv; if (!mCachedContentIsPartial) { rv = AsyncCall(&nsHttpChannel::AsyncOnExamineCachedResponse, &event); @@ -843,7 +842,7 @@ nsresult nsHttpChannel::ContinueConnect() { return DoConnect(); } -nsresult nsHttpChannel::DoConnect(nsHttpTransaction *aTransWithStickyConn) { +nsresult nsHttpChannel::DoConnect(nsHttpTransaction* aTransWithStickyConn) { LOG(("nsHttpChannel::DoConnect [this=%p, aTransWithStickyConn=%p]\n", this, aTransWithStickyConn)); @@ -937,7 +936,7 @@ void nsHttpChannel::HandleAsyncRedirect() { if (mSuspendCount) { LOG(("Waiting until resume to do async redirect [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->HandleAsyncRedirect(); return NS_OK; }; @@ -1006,7 +1005,7 @@ void nsHttpChannel::HandleAsyncNotModified() { if (mSuspendCount) { LOG(("Waiting until resume to do async not-modified [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->HandleAsyncNotModified(); return NS_OK; }; @@ -1029,7 +1028,7 @@ void nsHttpChannel::HandleAsyncFallback() { if (mSuspendCount) { LOG(("Waiting until resume to do async fallback [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->HandleAsyncFallback(); return NS_OK; }; @@ -1121,7 +1120,7 @@ nsresult nsHttpChannel::SetupTransaction() { // Use the URI path if not proxying (transparent proxying such as proxy // CONNECT does not count here). Also figure out what HTTP version to use. nsAutoCString buf, path; - nsCString *requestURI; + nsCString* requestURI; // This is the normal e2e H1 path syntax "/index.html" rv = mURI->GetPathQueryRef(path); @@ -1361,8 +1360,8 @@ enum class Report { Error, Warning }; // Helper Function to report messages to the console when the loaded // script had a wrong MIME type. -void ReportMimeTypeMismatch(nsHttpChannel *aChannel, const char *aMessageName, - nsIURI *aURI, const nsACString &aContentType, +void ReportMimeTypeMismatch(nsHttpChannel* aChannel, const char* aMessageName, + nsIURI* aURI, const nsACString& aContentType, Report report) { NS_ConvertUTF8toUTF16 spec(aURI->GetSpecOrDefault()); NS_ConvertUTF8toUTF16 contentType(aContentType); @@ -1372,9 +1371,9 @@ void ReportMimeTypeMismatch(nsHttpChannel *aChannel, const char *aMessageName, } // Check and potentially enforce X-Content-Type-Options: nosniff -nsresult ProcessXCTO(nsHttpChannel *aChannel, nsIURI *aURI, - nsHttpResponseHead *aResponseHead, - nsILoadInfo *aLoadInfo) { +nsresult ProcessXCTO(nsHttpChannel* aChannel, nsIURI* aURI, + nsHttpResponseHead* aResponseHead, + nsILoadInfo* aLoadInfo) { if (!aURI || !aResponseHead || !aLoadInfo) { // if there is no uri, no response head or no loadInfo, then there is // nothing to do @@ -1408,7 +1407,7 @@ nsresult ProcessXCTO(nsHttpChannel *aChannel, nsIURI *aURI, // a non matching value most likely means a mistake happenend; // e.g. sending 'nosnif' instead of 'nosniff', let's log a warning. NS_ConvertUTF8toUTF16 char16_header(contentTypeOptionsHeader); - const char16_t *params[] = {char16_header.get()}; + const char16_t* params[] = {char16_header.get()}; RefPtr doc; aLoadInfo->GetLoadingDocument(getter_AddRefs(doc)); nsContentUtils::ReportToConsole( @@ -1447,9 +1446,9 @@ nsresult ProcessXCTO(nsHttpChannel *aChannel, nsIURI *aURI, } // Ensure that a load of type script has correct MIME type -nsresult EnsureMIMEOfScript(nsHttpChannel *aChannel, nsIURI *aURI, - nsHttpResponseHead *aResponseHead, - nsILoadInfo *aLoadInfo) { +nsresult EnsureMIMEOfScript(nsHttpChannel* aChannel, nsIURI* aURI, + nsHttpResponseHead* aResponseHead, + nsILoadInfo* aLoadInfo) { if (!aURI || !aResponseHead || !aLoadInfo) { // if there is no uri, no response head or no loadInfo, then there is // nothing to do @@ -1503,7 +1502,7 @@ nsresult EnsureMIMEOfScript(nsHttpChannel *aChannel, nsIURI *aURI, nsCOMPtr requestURI; aLoadInfo->LoadingPrincipal()->GetURI(getter_AddRefs(requestURI)); - nsIScriptSecurityManager *ssm = nsContentUtils::GetSecurityManager(); + nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); bool isPrivateWin = aLoadInfo->GetOriginAttributes().mPrivateBrowsingId > 0; nsresult rv = ssm->CheckSameOriginURI(requestURI, aURI, false, isPrivateWin); if (NS_SUCCEEDED(rv)) { @@ -1666,9 +1665,9 @@ nsresult EnsureMIMEOfScript(nsHttpChannel *aChannel, nsIURI *aURI, // Warn when a load of type script uses a wrong MIME type and // wasn't blocked by EnsureMIMEOfScript or ProcessXCTO. -void WarnWrongMIMEOfScript(nsHttpChannel *aChannel, nsIURI *aURI, - nsHttpResponseHead *aResponseHead, - nsILoadInfo *aLoadInfo) { +void WarnWrongMIMEOfScript(nsHttpChannel* aChannel, nsIURI* aURI, + nsHttpResponseHead* aResponseHead, + nsILoadInfo* aLoadInfo) { if (!aURI || !aResponseHead || !aLoadInfo) { // If there is no uri, no response head or no loadInfo, then there is // nothing to do. @@ -1802,7 +1801,7 @@ nsresult nsHttpChannel::CallOnStartRequest() { // because that's the one that has the initial contents. If that fails // then give the transaction pump a shot. - nsIChannel *thisChannel = static_cast(this); + nsIChannel* thisChannel = static_cast(this); bool typeSniffersCalled = false; if (mCachePump) { @@ -2010,7 +2009,7 @@ nsresult nsHttpChannel::ProcessFailedProxyConnect(uint32_t httpStatus) { } static void GetSTSConsoleErrorTag(uint32_t failureResult, - nsAString &consoleErrorTag) { + nsAString& consoleErrorTag) { switch (failureResult) { case nsISiteSecurityService::ERROR_UNTRUSTWORTHY_CONNECTION: consoleErrorTag = NS_LITERAL_STRING("STSUntrustworthyConnection"); @@ -2043,7 +2042,7 @@ static void GetSTSConsoleErrorTag(uint32_t failureResult, } static void GetPKPConsoleErrorTag(uint32_t failureResult, - nsAString &consoleErrorTag) { + nsAString& consoleErrorTag) { switch (failureResult) { case nsISiteSecurityService::ERROR_UNTRUSTWORTHY_CONNECTION: consoleErrorTag = NS_LITERAL_STRING("PKPUntrustworthyConnection"); @@ -2095,7 +2094,7 @@ static void GetPKPConsoleErrorTag(uint32_t failureResult, * HPKP. */ nsresult nsHttpChannel::ProcessSingleSecurityHeader( - uint32_t aType, nsITransportSecurityInfo *aSecInfo, uint32_t aFlags) { + uint32_t aType, nsITransportSecurityInfo* aSecInfo, uint32_t aFlags) { nsHttpAtom atom; switch (aType) { case nsISiteSecurityService::HEADER_HSTS: @@ -2112,7 +2111,7 @@ nsresult nsHttpChannel::ProcessSingleSecurityHeader( nsAutoCString securityHeader; nsresult rv = mResponseHead->GetHeader(atom, securityHeader); if (NS_SUCCEEDED(rv)) { - nsISiteSecurityService *sss = gHttpHandler->GetSSService(); + nsISiteSecurityService* sss = gHttpHandler->GetSSService(); NS_ENSURE_TRUE(sss, NS_ERROR_OUT_OF_MEMORY); // Process header will now discard the headers itself if the channel // wasn't secure (whereas before it had to be checked manually) @@ -2496,7 +2495,7 @@ nsresult nsHttpChannel::ContinueProcessResponse1() { if (mSuspendCount) { LOG(("Waiting until resume to finish processing response [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->AsyncContinueProcessResponse(); return NS_OK; }; @@ -2651,7 +2650,7 @@ nsresult nsHttpChannel::ContinueProcessResponse3(nsresult rv) { break; case 206: if (mCachedContentIsPartial) { // an internal byte range request... - auto func = [](auto *self, nsresult aRv) { + auto func = [](auto* self, nsresult aRv) { return self->ContinueProcessResponseAfterPartialContent(aRv); }; rv = ProcessPartialContent(func); @@ -2695,7 +2694,7 @@ nsresult nsHttpChannel::ContinueProcessResponse3(nsresult rv) { break; case 304: if (!ShouldBypassProcessNotModified()) { - auto func = [](auto *self, nsresult aRv) { + auto func = [](auto* self, nsresult aRv) { return self->ContinueProcessResponseAfterNotModified(aRv); }; rv = ProcessNotModified(func); @@ -3078,7 +3077,7 @@ void nsHttpChannel::HandleAsyncRedirectChannelToHttps() { if (mSuspendCount) { LOG(("Waiting until resume to do async redirect to https [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->HandleAsyncRedirectChannelToHttps(); return NS_OK; }; @@ -3113,7 +3112,7 @@ void nsHttpChannel::HandleAsyncAPIRedirect() { if (mSuspendCount) { LOG(("Waiting until resume to do async API redirect [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->HandleAsyncAPIRedirect(); return NS_OK; }; @@ -3131,7 +3130,7 @@ void nsHttpChannel::HandleAsyncAPIRedirect() { } } -nsresult nsHttpChannel::StartRedirectChannelToURI(nsIURI *upgradedURI, +nsresult nsHttpChannel::StartRedirectChannelToURI(nsIURI* upgradedURI, uint32_t flags) { nsresult rv = NS_OK; LOG(("nsHttpChannel::StartRedirectChannelToURI()\n")); @@ -3228,7 +3227,7 @@ nsresult nsHttpChannel::OpenRedirectChannel(nsresult rv) { return NS_OK; } -nsresult nsHttpChannel::AsyncDoReplaceWithProxy(nsIProxyInfo *pi) { +nsresult nsHttpChannel::AsyncDoReplaceWithProxy(nsIProxyInfo* pi) { LOG(("nsHttpChannel::AsyncDoReplaceWithProxy [this=%p pi=%p]", this, pi)); nsresult rv; @@ -3299,14 +3298,14 @@ nsresult nsHttpChannel::ResolveProxy() { rv = pps2->AsyncResolve2(this, mProxyResolveFlags, this, nullptr, getter_AddRefs(mProxyRequest)); } else { - rv = pps->AsyncResolve(static_cast(this), mProxyResolveFlags, + rv = pps->AsyncResolve(static_cast(this), mProxyResolveFlags, this, nullptr, getter_AddRefs(mProxyRequest)); } return rv; } -bool nsHttpChannel::ResponseWouldVary(nsICacheEntry *entry) { +bool nsHttpChannel::ResponseWouldVary(nsICacheEntry* entry) { nsresult rv; nsAutoCString buf, metaKey; Unused << mCachedResponseHead->GetHeader(nsHttp::Vary, buf); @@ -3314,8 +3313,8 @@ bool nsHttpChannel::ResponseWouldVary(nsICacheEntry *entry) { NS_NAMED_LITERAL_CSTRING(prefix, "request-"); // enumerate the elements of the Vary header... - char *val = buf.BeginWriting(); // going to munge buf - char *token = nsCRT::strtok(val, NS_HTTP_HEADER_SEPS, &val); + char* val = buf.BeginWriting(); // going to munge buf + char* token = nsCRT::strtok(val, NS_HTTP_HEADER_SEPS, &val); while (token) { LOG( ("nsHttpChannel::ResponseWouldVary [channel=%p] " @@ -3476,8 +3475,8 @@ void nsHttpChannel::UntieByteRangeRequest() { } nsresult nsHttpChannel::ProcessPartialContent( - const std::function - &aContinueProcessResponseFunc) { + const std::function& + aContinueProcessResponseFunc) { // ok, we've just received a 206 // // we need to stream whatever data is in the cache out first, and then @@ -3583,13 +3582,13 @@ nsresult nsHttpChannel::ProcessPartialContent( // Now we continue reading the network response. // the cached content is valid, although incomplete. mCachedContentIsValid = true; - return CallOrWaitForResume([aContinueProcessResponseFunc](auto *self) { + return CallOrWaitForResume([aContinueProcessResponseFunc](auto* self) { nsresult rv = self->ReadFromCache(false); return aContinueProcessResponseFunc(self, rv); }); } -nsresult nsHttpChannel::OnDoneReadingPartialCacheEntry(bool *streamDone) { +nsresult nsHttpChannel::OnDoneReadingPartialCacheEntry(bool* streamDone) { nsresult rv; LOG(("nsHttpChannel::OnDoneReadingPartialCacheEntry [this=%p]", this)); @@ -3653,8 +3652,8 @@ bool nsHttpChannel::ShouldBypassProcessNotModified() { } nsresult nsHttpChannel::ProcessNotModified( - const std::function - &aContinueProcessResponseFunc) { + const std::function& + aContinueProcessResponseFunc) { nsresult rv; LOG(("nsHttpChannel::ProcessNotModified [this=%p]\n", this)); @@ -3724,13 +3723,13 @@ nsresult nsHttpChannel::ProcessNotModified( rv = mCacheEntry->SetValid(); if (NS_FAILED(rv)) return rv; - return CallOrWaitForResume([aContinueProcessResponseFunc](auto *self) { + return CallOrWaitForResume([aContinueProcessResponseFunc](auto* self) { nsresult rv = self->ReadFromCache(false); return aContinueProcessResponseFunc(self, rv); }); } -nsresult nsHttpChannel::ProcessFallback(bool *waitingForRedirectCallback) { +nsresult nsHttpChannel::ProcessFallback(bool* waitingForRedirectCallback) { LOG(("nsHttpChannel::ProcessFallback [this=%p]\n", this)); nsresult rv; @@ -3853,7 +3852,7 @@ nsresult nsHttpChannel::ContinueProcessFallback(nsresult rv) { // Determines if a request is a byte range request for a subrange, // i.e. is a byte range request, but not a 0- byte range request. -static bool IsSubRangeRequest(nsHttpRequestHead &aRequestHead) { +static bool IsSubRangeRequest(nsHttpRequestHead& aRequestHead) { nsAutoCString byteRange; if (NS_FAILED(aRequestHead.GetHeader(nsHttp::Range, byteRange))) { return false; @@ -3907,7 +3906,7 @@ bool nsHttpChannel::IsIsolated() { return mIsIsolated; } -const nsCString &nsHttpChannel::GetTopWindowOrigin() { +const nsCString& nsHttpChannel::GetTopWindowOrigin() { if (mTopWindowOriginComputed) { return mTopWindowOrigin; } @@ -3933,7 +3932,7 @@ const nsCString &nsHttpChannel::GetTopWindowOrigin() { } nsresult nsHttpChannel::OpenCacheEntryInternal( - bool isHttps, nsIApplicationCache *applicationCache, + bool isHttps, nsIApplicationCache* applicationCache, bool allowApplicationCache) { MOZ_ASSERT_IF(!allowApplicationCache, !applicationCache); @@ -4052,7 +4051,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal( } if (IsIsolated()) { - auto &topWindowOrigin = GetTopWindowOrigin(); + auto& topWindowOrigin = GetTopWindowOrigin(); if (topWindowOrigin.IsEmpty()) { return NS_ERROR_FAILURE; } @@ -4091,7 +4090,7 @@ nsresult nsHttpChannel::OpenCacheEntryInternal( // We pass `this` explicitly as a parameter due to the raw pointer // to refcounted object in lambda analysis. mCacheOpenFunc = [openURI, extension, cacheEntryOpenFlags, - cacheStorage](nsHttpChannel *self) -> void { + cacheStorage](nsHttpChannel* self) -> void { MOZ_ASSERT(NS_IsMainThread(), "Should be called on the main thread"); if (self->mNetworkTriggered) { self->mRaceCacheWithNetwork = true; @@ -4143,8 +4142,8 @@ nsresult nsHttpChannel::OpenCacheEntryInternal( return NS_OK; } -nsresult nsHttpChannel::CheckPartial(nsICacheEntry *aEntry, int64_t *aSize, - int64_t *aContentLength) { +nsresult nsHttpChannel::CheckPartial(nsICacheEntry* aEntry, int64_t* aSize, + int64_t* aContentLength) { return nsHttp::CheckPartial( aEntry, aSize, aContentLength, mCachedResponseHead ? mCachedResponseHead : mResponseHead); @@ -4162,9 +4161,9 @@ void nsHttpChannel::UntieValidationRequest() { } NS_IMETHODIMP -nsHttpChannel::OnCacheEntryCheck(nsICacheEntry *entry, - nsIApplicationCache *appCache, - uint32_t *aResult) { +nsHttpChannel::OnCacheEntryCheck(nsICacheEntry* entry, + nsIApplicationCache* appCache, + uint32_t* aResult) { nsresult rv = NS_OK; LOG(("nsHttpChannel::OnCacheEntryCheck enter [channel=%p entry=%p]", this, @@ -4535,8 +4534,8 @@ nsHttpChannel::OnCacheEntryCheck(nsICacheEntry *entry, } NS_IMETHODIMP -nsHttpChannel::OnCacheEntryAvailable(nsICacheEntry *entry, bool aNew, - nsIApplicationCache *aAppCache, +nsHttpChannel::OnCacheEntryAvailable(nsICacheEntry* entry, bool aNew, + nsIApplicationCache* aAppCache, nsresult status) { MOZ_ASSERT(NS_IsMainThread()); @@ -4577,7 +4576,7 @@ nsHttpChannel::OnCacheEntryAvailable(nsICacheEntry *entry, bool aNew, } nsresult nsHttpChannel::OnCacheEntryAvailableInternal( - nsICacheEntry *entry, bool aNew, nsIApplicationCache *aAppCache, + nsICacheEntry* entry, bool aNew, nsIApplicationCache* aAppCache, nsresult status) { nsresult rv; @@ -4646,7 +4645,7 @@ nsresult nsHttpChannel::OnCacheEntryAvailableInternal( return TriggerNetwork(); } -nsresult nsHttpChannel::OnNormalCacheEntryAvailable(nsICacheEntry *aEntry, +nsresult nsHttpChannel::OnNormalCacheEntryAvailable(nsICacheEntry* aEntry, bool aNew, nsresult aEntryStatus) { mCacheEntriesToWaitFor &= ~WAIT_FOR_CACHE_ENTRY; @@ -4705,7 +4704,7 @@ nsresult nsHttpChannel::OnNormalCacheEntryAvailable(nsICacheEntry *aEntry, } nsresult nsHttpChannel::OnOfflineCacheEntryAvailable( - nsICacheEntry *aEntry, bool aNew, nsIApplicationCache *aAppCache, + nsICacheEntry* aEntry, bool aNew, nsIApplicationCache* aAppCache, nsresult aEntryStatus) { MOZ_ASSERT(!mApplicationCache || aAppCache == mApplicationCache); MOZ_ASSERT(!aNew || !aEntry || mApplicationCacheForWrite); @@ -4800,7 +4799,7 @@ nsresult nsHttpChannel::OnOfflineCacheEntryAvailable( } nsresult nsHttpChannel::OnOfflineCacheEntryForWritingAvailable( - nsICacheEntry *aEntry, nsIApplicationCache *aAppCache, + nsICacheEntry* aEntry, nsIApplicationCache* aAppCache, nsresult aEntryStatus) { MOZ_ASSERT(mApplicationCacheForWrite && aAppCache == mApplicationCacheForWrite); @@ -4819,15 +4818,15 @@ nsresult nsHttpChannel::OnOfflineCacheEntryForWritingAvailable( // Generates the proper cache-key for this instance of nsHttpChannel nsresult nsHttpChannel::GenerateCacheKey(uint32_t postID, - nsACString &cacheKey) { + nsACString& cacheKey) { AssembleCacheKey(mFallbackChannel ? mFallbackKey.get() : mSpec.get(), postID, cacheKey); return NS_OK; } // Assembles a cache-key from the given pieces of information and |mLoadFlags| -void nsHttpChannel::AssembleCacheKey(const char *spec, uint32_t postID, - nsACString &cacheKey) { +void nsHttpChannel::AssembleCacheKey(const char* spec, uint32_t postID, + nsACString& cacheKey) { cacheKey.Truncate(); if (mLoadFlags & LOAD_ANONYMOUS) { @@ -4845,17 +4844,17 @@ void nsHttpChannel::AssembleCacheKey(const char *spec, uint32_t postID, } // Strip any trailing #ref from the URL before using it as the key - const char *p = strchr(spec, '#'); + const char* p = strchr(spec, '#'); if (p) cacheKey.Append(spec, p - spec); else cacheKey.Append(spec); } -nsresult DoUpdateExpirationTime(nsHttpChannel *aSelf, - nsICacheEntry *aCacheEntry, - nsHttpResponseHead *aResponseHead, - uint32_t &aExpirationTime) { +nsresult DoUpdateExpirationTime(nsHttpChannel* aSelf, + nsICacheEntry* aCacheEntry, + nsHttpResponseHead* aResponseHead, + uint32_t& aExpirationTime) { MOZ_ASSERT(aExpirationTime == 0); NS_ENSURE_TRUE(aResponseHead, NS_ERROR_FAILURE); @@ -4959,7 +4958,7 @@ bool nsHttpChannel::ShouldUpdateOfflineCacheEntry() { return false; } -nsresult nsHttpChannel::OpenCacheInputStream(nsICacheEntry *cacheEntry, +nsresult nsHttpChannel::OpenCacheInputStream(nsICacheEntry* cacheEntry, bool startBuffering, bool checkingAppCacheEntry) { nsresult rv; @@ -5052,7 +5051,7 @@ nsresult nsHttpChannel::OpenCacheInputStream(nsICacheEntry *cacheEntry, bool deliverAltData = true; if (!altDataType.IsEmpty() && !mPreferredCachedAltDataTypes.IsEmpty() && altDataFromChild == mAltDataForChild) { - for (auto &pref : mPreferredCachedAltDataTypes) { + for (auto& pref : mPreferredCachedAltDataTypes) { if (pref.type() == altDataType && (pref.contentType().IsEmpty() || pref.contentType() == contentType)) { foundAltData = true; @@ -5479,10 +5478,10 @@ nsresult nsHttpChannel::InitOfflineCacheEntry() { return AddCacheEntryHeaders(mOfflineCacheEntry); } -nsresult DoAddCacheEntryHeaders(nsHttpChannel *self, nsICacheEntry *entry, - nsHttpRequestHead *requestHead, - nsHttpResponseHead *responseHead, - nsISupports *securityInfo) { +nsresult DoAddCacheEntryHeaders(nsHttpChannel* self, nsICacheEntry* entry, + nsHttpRequestHead* requestHead, + nsHttpResponseHead* responseHead, + nsISupports* securityInfo) { nsresult rv; LOG(("nsHttpChannel::AddCacheEntryHeaders [this=%p] begin", self)); @@ -5517,8 +5516,8 @@ nsresult DoAddCacheEntryHeaders(nsHttpChannel *self, nsICacheEntry *entry, if (!buf.IsEmpty()) { NS_NAMED_LITERAL_CSTRING(prefix, "request-"); - char *bufData = buf.BeginWriting(); // going to munge buf - char *token = nsCRT::strtok(bufData, NS_HTTP_HEADER_SEPS, &bufData); + char* bufData = buf.BeginWriting(); // going to munge buf + char* token = nsCRT::strtok(bufData, NS_HTTP_HEADER_SEPS, &bufData); while (token) { LOG( ("nsHttpChannel::AddCacheEntryHeaders [this=%p] " @@ -5581,13 +5580,13 @@ nsresult DoAddCacheEntryHeaders(nsHttpChannel *self, nsICacheEntry *entry, return rv; } -nsresult nsHttpChannel::AddCacheEntryHeaders(nsICacheEntry *entry) { +nsresult nsHttpChannel::AddCacheEntryHeaders(nsICacheEntry* entry) { return DoAddCacheEntryHeaders(this, entry, &mRequestHead, mResponseHead, mSecurityInfo); } -inline void GetAuthType(const char *challenge, nsCString &authType) { - const char *p; +inline void GetAuthType(const char* challenge, nsCString& authType) { + const char* p; // get the challenge type if ((p = strchr(challenge, ' ')) != nullptr) @@ -5596,8 +5595,8 @@ inline void GetAuthType(const char *challenge, nsCString &authType) { authType.Assign(challenge); } -nsresult StoreAuthorizationMetaData(nsICacheEntry *entry, - nsHttpRequestHead *requestHead) { +nsresult StoreAuthorizationMetaData(nsICacheEntry* entry, + nsHttpRequestHead* requestHead) { // Not applicable to proxy authorization... nsAutoCString val; if (NS_FAILED(requestHead->GetHeader(nsHttp::Authorization, val))) { @@ -5779,8 +5778,8 @@ void nsHttpChannel::ClearBogusContentEncodingIfNeeded() { // nsHttpChannel //----------------------------------------------------------------------------- -nsresult nsHttpChannel::SetupReplacementChannel(nsIURI *newURI, - nsIChannel *newChannel, +nsresult nsHttpChannel::SetupReplacementChannel(nsIURI* newURI, + nsIChannel* newChannel, bool preserveMethod, uint32_t redirectFlags) { LOG( @@ -6194,7 +6193,7 @@ nsHttpChannel::CancelByURLClassifier(nsresult aErrorCode) { LOG(("Waiting until resume in Cancel [this=%p]\n", this)); MOZ_ASSERT(!mCallOnResume); mChannelClassifierCancellationPending = 1; - mCallOnResume = [aErrorCode](nsHttpChannel *self) { + mCallOnResume = [aErrorCode](nsHttpChannel* self) { self->HandleContinueCancellingByURLClassifier(aErrorCode); return NS_OK; }; @@ -6301,7 +6300,7 @@ nsHttpChannel::Resume() { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::GetSecurityInfo(nsISupports **securityInfo) { +nsHttpChannel::GetSecurityInfo(nsISupports** securityInfo) { NS_ENSURE_ARG_POINTER(securityInfo); *securityInfo = mSecurityInfo; NS_IF_ADDREF(*securityInfo); @@ -6314,7 +6313,7 @@ nsHttpChannel::GetSecurityInfo(nsISupports **securityInfo) { // If AsyncOpen returns NS_OK, after that point AsyncAbort must be called on // any error. NS_IMETHODIMP -nsHttpChannel::AsyncOpen(nsIStreamListener *aListener) { +nsHttpChannel::AsyncOpen(nsIStreamListener* aListener) { nsCOMPtr listener = aListener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); @@ -6818,7 +6817,7 @@ nsresult nsHttpChannel::BeginConnectActual() { } NS_IMETHODIMP -nsHttpChannel::GetEncodedBodySize(uint64_t *aEncodedBodySize) { +nsHttpChannel::GetEncodedBodySize(uint64_t* aEncodedBodySize) { if (mCacheEntry && !mCacheEntryIsWriteOnly) { int64_t dataSize = 0; mCacheEntry->GetDataSize(&dataSize); @@ -6834,7 +6833,7 @@ nsHttpChannel::GetEncodedBodySize(uint64_t *aEncodedBodySize) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::SetupFallbackChannel(const char *aFallbackKey) { +nsHttpChannel::SetupFallbackChannel(const char* aFallbackKey) { ENSURE_CALLED_BEFORE_CONNECT(); LOG(("nsHttpChannel::SetupFallbackChannel [this=%p, key=%s]\n", this, @@ -6867,7 +6866,7 @@ base::ProcessId nsHttpChannel::ProcessId() { } bool nsHttpChannel::AttachStreamFilter( - mozilla::ipc::Endpoint &&aEndpoint) + mozilla::ipc::Endpoint&& aEndpoint) { nsCOMPtr parentChannel; @@ -6882,7 +6881,7 @@ bool nsHttpChannel::AttachStreamFilter( } NS_IMETHODIMP -nsHttpChannel::GetNavigationStartTimeStamp(TimeStamp *aTimeStamp) { +nsHttpChannel::GetNavigationStartTimeStamp(TimeStamp* aTimeStamp) { LOG(("nsHttpChannel::GetNavigationStartTimeStamp %p", this)); MOZ_ASSERT(aTimeStamp); *aTimeStamp = mNavigationStartTimeStamp; @@ -6938,7 +6937,7 @@ nsresult nsHttpChannel::ContinueBeginConnectWithResult() { if (mSuspendCount) { LOG(("Waiting until resume to do async connect [this=%p]\n", this)); - mCallOnResume = [](nsHttpChannel *self) { + mCallOnResume = [](nsHttpChannel* self) { self->ContinueBeginConnect(); return NS_OK; }; @@ -7022,8 +7021,8 @@ nsHttpChannel::ClearClassFlags(uint32_t inFlags) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::OnProxyAvailable(nsICancelable *request, nsIChannel *channel, - nsIProxyInfo *pi, nsresult status) { +nsHttpChannel::OnProxyAvailable(nsICancelable* request, nsIChannel* channel, + nsIProxyInfo* pi, nsresult status) { LOG(("nsHttpChannel::OnProxyAvailable [this=%p pi=%p status=%" PRIx32 " mStatus=%" PRIx32 "]\n", this, pi, static_cast(status), @@ -7061,7 +7060,7 @@ nsHttpChannel::OnProxyAvailable(nsICancelable *request, nsIChannel *channel, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::GetProxyInfo(nsIProxyInfo **result) { +nsHttpChannel::GetProxyInfo(nsIProxyInfo** result) { if (!mConnectionInfo) *result = mProxyInfo; else @@ -7075,7 +7074,7 @@ nsHttpChannel::GetProxyInfo(nsIProxyInfo **result) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::GetDomainLookupStart(TimeStamp *_retval) { +nsHttpChannel::GetDomainLookupStart(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetDomainLookupStart(); else @@ -7084,7 +7083,7 @@ nsHttpChannel::GetDomainLookupStart(TimeStamp *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetDomainLookupEnd(TimeStamp *_retval) { +nsHttpChannel::GetDomainLookupEnd(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetDomainLookupEnd(); else @@ -7093,7 +7092,7 @@ nsHttpChannel::GetDomainLookupEnd(TimeStamp *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetConnectStart(TimeStamp *_retval) { +nsHttpChannel::GetConnectStart(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetConnectStart(); else @@ -7102,7 +7101,7 @@ nsHttpChannel::GetConnectStart(TimeStamp *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetTcpConnectEnd(TimeStamp *_retval) { +nsHttpChannel::GetTcpConnectEnd(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetTcpConnectEnd(); else @@ -7111,7 +7110,7 @@ nsHttpChannel::GetTcpConnectEnd(TimeStamp *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetSecureConnectionStart(TimeStamp *_retval) { +nsHttpChannel::GetSecureConnectionStart(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetSecureConnectionStart(); else @@ -7120,7 +7119,7 @@ nsHttpChannel::GetSecureConnectionStart(TimeStamp *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetConnectEnd(TimeStamp *_retval) { +nsHttpChannel::GetConnectEnd(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetConnectEnd(); else @@ -7129,7 +7128,7 @@ nsHttpChannel::GetConnectEnd(TimeStamp *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetRequestStart(TimeStamp *_retval) { +nsHttpChannel::GetRequestStart(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetRequestStart(); else @@ -7138,7 +7137,7 @@ nsHttpChannel::GetRequestStart(TimeStamp *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetResponseStart(TimeStamp *_retval) { +nsHttpChannel::GetResponseStart(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetResponseStart(); else @@ -7147,7 +7146,7 @@ nsHttpChannel::GetResponseStart(TimeStamp *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetResponseEnd(TimeStamp *_retval) { +nsHttpChannel::GetResponseEnd(TimeStamp* _retval) { if (mTransaction) *_retval = mTransaction->GetResponseEnd(); else @@ -7160,7 +7159,7 @@ nsHttpChannel::GetResponseEnd(TimeStamp *_retval) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::GetIsSSL(bool *aIsSSL) { +nsHttpChannel::GetIsSSL(bool* aIsSSL) { // this attribute is really misnamed - it wants to know if // https:// is being used. SSL might be used to cover http:// // in some circumstances (proxies, http/2, etc..) @@ -7168,36 +7167,36 @@ nsHttpChannel::GetIsSSL(bool *aIsSSL) { } NS_IMETHODIMP -nsHttpChannel::GetProxyMethodIsConnect(bool *aProxyMethodIsConnect) { +nsHttpChannel::GetProxyMethodIsConnect(bool* aProxyMethodIsConnect) { *aProxyMethodIsConnect = mConnectionInfo->UsingConnect(); return NS_OK; } NS_IMETHODIMP -nsHttpChannel::GetServerResponseHeader(nsACString &value) { +nsHttpChannel::GetServerResponseHeader(nsACString& value) { if (!mResponseHead) return NS_ERROR_NOT_AVAILABLE; return mResponseHead->GetHeader(nsHttp::Server, value); } NS_IMETHODIMP -nsHttpChannel::GetProxyChallenges(nsACString &value) { +nsHttpChannel::GetProxyChallenges(nsACString& value) { if (!mResponseHead) return NS_ERROR_UNEXPECTED; return mResponseHead->GetHeader(nsHttp::Proxy_Authenticate, value); } NS_IMETHODIMP -nsHttpChannel::GetWWWChallenges(nsACString &value) { +nsHttpChannel::GetWWWChallenges(nsACString& value) { if (!mResponseHead) return NS_ERROR_UNEXPECTED; return mResponseHead->GetHeader(nsHttp::WWW_Authenticate, value); } NS_IMETHODIMP -nsHttpChannel::SetProxyCredentials(const nsACString &value) { +nsHttpChannel::SetProxyCredentials(const nsACString& value) { return mRequestHead.SetHeader(nsHttp::Proxy_Authorization, value); } NS_IMETHODIMP -nsHttpChannel::SetWWWCredentials(const nsACString &value) { +nsHttpChannel::SetWWWCredentials(const nsACString& value) { // This method is called when various browser initiated authorization // code sets the credentials. We need to flag this header as the // "browser default" so it does not show up in the ServiceWorker @@ -7215,25 +7214,25 @@ nsHttpChannel::SetWWWCredentials(const nsACString &value) { // NS_IMETHODIMP -nsHttpChannel::GetLoadFlags(nsLoadFlags *aLoadFlags) { +nsHttpChannel::GetLoadFlags(nsLoadFlags* aLoadFlags) { return HttpBaseChannel::GetLoadFlags(aLoadFlags); } NS_IMETHODIMP -nsHttpChannel::GetURI(nsIURI **aURI) { return HttpBaseChannel::GetURI(aURI); } +nsHttpChannel::GetURI(nsIURI** aURI) { return HttpBaseChannel::GetURI(aURI); } NS_IMETHODIMP -nsHttpChannel::GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks) { +nsHttpChannel::GetNotificationCallbacks(nsIInterfaceRequestor** aCallbacks) { return HttpBaseChannel::GetNotificationCallbacks(aCallbacks); } NS_IMETHODIMP -nsHttpChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) { +nsHttpChannel::GetLoadGroup(nsILoadGroup** aLoadGroup) { return HttpBaseChannel::GetLoadGroup(aLoadGroup); } NS_IMETHODIMP -nsHttpChannel::GetRequestMethod(nsACString &aMethod) { +nsHttpChannel::GetRequestMethod(nsACString& aMethod) { return HttpBaseChannel::GetRequestMethod(aMethod); } @@ -7245,7 +7244,7 @@ nsHttpChannel::GetRequestMethod(nsACString &aMethod) { class DomPromiseListener final : dom::PromiseNativeHandler { NS_DECL_ISUPPORTS - static RefPtr Create(dom::Promise *aDOMPromise) { + static RefPtr Create(dom::Promise* aDOMPromise) { MOZ_ASSERT(aDOMPromise); RefPtr handler = new DomPromiseListener(); RefPtr promise = @@ -7254,10 +7253,10 @@ class DomPromiseListener final : dom::PromiseNativeHandler { return promise; } - virtual void ResolvedCallback(JSContext *aCx, + virtual void ResolvedCallback(JSContext* aCx, JS::Handle aValue) override { nsCOMPtr browserParent; - JS::Rooted obj(aCx, &aValue.toObject()); + JS::Rooted obj(aCx, &aValue.toObject()); nsresult rv = UnwrapArg(aCx, obj, getter_AddRefs(browserParent)); if (NS_FAILED(rv)) { @@ -7267,7 +7266,7 @@ class DomPromiseListener final : dom::PromiseNativeHandler { mPromiseHolder.Resolve(browserParent, __func__); } - virtual void RejectedCallback(JSContext *aCx, + virtual void RejectedCallback(JSContext* aCx, JS::Handle aValue) override { if (!aValue.isInt32()) { mPromiseHolder.Reject(NS_ERROR_DOM_NOT_NUMBER_ERR, __func__); @@ -7284,7 +7283,7 @@ class DomPromiseListener final : dom::PromiseNativeHandler { NS_IMPL_ISUPPORTS0(DomPromiseListener) -NS_IMETHODIMP nsHttpChannel::SwitchProcessTo(dom::Promise *aTabPromise, +NS_IMETHODIMP nsHttpChannel::SwitchProcessTo(dom::Promise* aTabPromise, uint64_t aIdentifier) { MOZ_ASSERT(NS_IsMainThread()); NS_ENSURE_ARG(aTabPromise); @@ -7337,9 +7336,9 @@ nsresult nsHttpChannel::StartCrossProcessRedirect() { static bool CompareCrossOriginOpenerPolicies( nsILoadInfo::CrossOriginOpenerPolicy documentPolicy, - nsIPrincipal *documentOrigin, + nsIPrincipal* documentOrigin, nsILoadInfo::CrossOriginOpenerPolicy resultPolicy, - nsIPrincipal *resultOrigin) { + nsIPrincipal* resultOrigin) { if (documentPolicy == nsILoadInfo::OPENER_POLICY_NULL && resultPolicy == nsILoadInfo::OPENER_POLICY_NULL) { return true; @@ -7373,7 +7372,7 @@ static bool CompareCrossOriginOpenerPolicies( } NS_IMETHODIMP -nsHttpChannel::HasCrossOriginOpenerPolicyMismatch(bool *aMismatch) { +nsHttpChannel::HasCrossOriginOpenerPolicyMismatch(bool* aMismatch) { MOZ_ASSERT(aMismatch); if (!aMismatch) { return NS_ERROR_INVALID_ARG; @@ -7387,7 +7386,7 @@ nsHttpChannel::HasCrossOriginOpenerPolicyMismatch(bool *aMismatch) { } // Maybe the channel failed and we have no response head? - nsHttpResponseHead *head = + nsHttpResponseHead* head = mResponseHead ? mResponseHead : mCachedResponseHead; if (!head) { return NS_ERROR_NOT_AVAILABLE; @@ -7450,7 +7449,7 @@ nsHttpChannel::HasCrossOriginOpenerPolicyMismatch(bool *aMismatch) { } nsresult nsHttpChannel::GetResponseCrossOriginPolicy( - nsILoadInfo::CrossOriginPolicy *aResponseCrossOriginPolicy) { + nsILoadInfo::CrossOriginPolicy* aResponseCrossOriginPolicy) { if (!mResponseHead) { return NS_ERROR_NOT_AVAILABLE; } @@ -7517,7 +7516,7 @@ nsresult nsHttpChannel::ProcessCrossOriginHeader() { } NS_IMETHODIMP -nsHttpChannel::OnStartRequest(nsIRequest *request) { +nsHttpChannel::OnStartRequest(nsIRequest* request) { nsresult rv; MOZ_ASSERT(mRequestObserversCalled); @@ -7749,7 +7748,7 @@ nsresult nsHttpChannel::ContinueOnStartRequest4(nsresult result) { } NS_IMETHODIMP -nsHttpChannel::OnStopRequest(nsIRequest *request, nsresult status) { +nsHttpChannel::OnStopRequest(nsIRequest* request, nsresult status) { AUTO_PROFILER_LABEL("nsHttpChannel::OnStopRequest", NETWORK); LOG(("nsHttpChannel::OnStopRequest [this=%p request=%p status=%" PRIx32 "]\n", @@ -7908,7 +7907,7 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsresult status) { if (authRetry) { mAuthRetryPending = false; auto continueOSR = [authRetry, isFromNet, contentComplete, - transactionWithStickyConn](auto *self, + transactionWithStickyConn](auto* self, nsresult aStatus) { return self->ContinueOnStopRequestAfterAuthRetry( aStatus, authRetry, isFromNet, contentComplete, @@ -7929,7 +7928,7 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsresult status) { nsresult nsHttpChannel::ContinueOnStopRequestAfterAuthRetry( nsresult aStatus, bool aAuthRetry, bool aIsFromNet, bool aContentComplete, - nsHttpTransaction *aTransWithStickyConn) { + nsHttpTransaction* aTransWithStickyConn) { LOG( ("nsHttpChannel::ContinueOnStopRequestAfterAuthRetry " "[this=%p, aStatus=%" PRIx32 @@ -8197,7 +8196,7 @@ nsresult nsHttpChannel::ContinueOnStopRequest(nsresult aStatus, bool aIsFromNet, class OnTransportStatusAsyncEvent : public Runnable { public: - OnTransportStatusAsyncEvent(nsITransportEventSink *aEventSink, + OnTransportStatusAsyncEvent(nsITransportEventSink* aEventSink, nsresult aTransportStatus, int64_t aProgress, int64_t aProgressMax) : Runnable("net::OnTransportStatusAsyncEvent"), @@ -8225,7 +8224,7 @@ class OnTransportStatusAsyncEvent : public Runnable { }; NS_IMETHODIMP -nsHttpChannel::OnDataAvailable(nsIRequest *request, nsIInputStream *input, +nsHttpChannel::OnDataAvailable(nsIRequest* request, nsIInputStream* input, uint64_t offset, uint32_t count) { nsresult rv; AUTO_PROFILER_LABEL("nsHttpChannel::OnDataAvailable", NETWORK); @@ -8349,7 +8348,7 @@ nsHttpChannel::OnDataAvailable(nsIRequest *request, nsIInputStream *input, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::RetargetDeliveryTo(nsIEventTarget *aNewTarget) { +nsHttpChannel::RetargetDeliveryTo(nsIEventTarget* aNewTarget) { MOZ_ASSERT(NS_IsMainThread(), "Should be called on main thread only"); NS_ENSURE_ARG(aNewTarget); @@ -8391,7 +8390,7 @@ nsHttpChannel::RetargetDeliveryTo(nsIEventTarget *aNewTarget) { } NS_IMETHODIMP -nsHttpChannel::GetDeliveryTarget(nsIEventTarget **aEventTarget) { +nsHttpChannel::GetDeliveryTarget(nsIEventTarget** aEventTarget) { if (mCachePump) { return mCachePump->GetDeliveryTarget(aEventTarget); } @@ -8422,7 +8421,7 @@ nsHttpChannel::CheckListenerChain() { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status, +nsHttpChannel::OnTransportStatus(nsITransport* trans, nsresult status, int64_t progress, int64_t progressMax) { MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread only"); // cache the progress sink so we don't have to query for it each time. @@ -8478,7 +8477,7 @@ nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::IsFromCache(bool *value) { +nsHttpChannel::IsFromCache(bool* value) { if (!mIsPending) return NS_ERROR_NOT_AVAILABLE; if (!mRaceCacheWithNetwork) { @@ -8497,7 +8496,7 @@ nsHttpChannel::IsFromCache(bool *value) { } NS_IMETHODIMP -nsHttpChannel::GetCacheEntryId(uint64_t *aCacheEntryId) { +nsHttpChannel::GetCacheEntryId(uint64_t* aCacheEntryId) { bool fromCache = false; if (NS_FAILED(IsFromCache(&fromCache)) || !fromCache || !mCacheEntry || NS_FAILED(mCacheEntry->GetCacheEntryId(aCacheEntryId))) { @@ -8508,7 +8507,7 @@ nsHttpChannel::GetCacheEntryId(uint64_t *aCacheEntryId) { } NS_IMETHODIMP -nsHttpChannel::GetCacheTokenFetchCount(int32_t *_retval) { +nsHttpChannel::GetCacheTokenFetchCount(int32_t* _retval) { NS_ENSURE_ARG_POINTER(_retval); nsCOMPtr cacheEntry = mCacheEntry ? mCacheEntry : mAltDataCacheEntry; @@ -8520,7 +8519,7 @@ nsHttpChannel::GetCacheTokenFetchCount(int32_t *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetCacheTokenExpirationTime(uint32_t *_retval) { +nsHttpChannel::GetCacheTokenExpirationTime(uint32_t* _retval) { NS_ENSURE_ARG_POINTER(_retval); if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE; @@ -8528,7 +8527,7 @@ nsHttpChannel::GetCacheTokenExpirationTime(uint32_t *_retval) { } NS_IMETHODIMP -nsHttpChannel::GetCacheTokenCachedCharset(nsACString &_retval) { +nsHttpChannel::GetCacheTokenCachedCharset(nsACString& _retval) { nsresult rv; if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE; @@ -8541,7 +8540,7 @@ nsHttpChannel::GetCacheTokenCachedCharset(nsACString &_retval) { } NS_IMETHODIMP -nsHttpChannel::SetCacheTokenCachedCharset(const nsACString &aCharset) { +nsHttpChannel::SetCacheTokenCachedCharset(const nsACString& aCharset) { if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE; return mCacheEntry->SetMetaDataElement("charset", @@ -8556,15 +8555,15 @@ nsHttpChannel::SetAllowStaleCacheContent(bool aAllowStaleCacheContent) { return NS_OK; } NS_IMETHODIMP -nsHttpChannel::GetAllowStaleCacheContent(bool *aAllowStaleCacheContent) { +nsHttpChannel::GetAllowStaleCacheContent(bool* aAllowStaleCacheContent) { NS_ENSURE_ARG(aAllowStaleCacheContent); *aAllowStaleCacheContent = mAllowStaleCacheContent; return NS_OK; } NS_IMETHODIMP -nsHttpChannel::PreferAlternativeDataType(const nsACString &aType, - const nsACString &aContentType, +nsHttpChannel::PreferAlternativeDataType(const nsACString& aType, + const nsACString& aContentType, bool aDeliverAltData) { ENSURE_CALLED_BEFORE_ASYNC_OPEN(); mPreferredCachedAltDataTypes.AppendElement(PreferredAlternativeDataTypeParams( @@ -8572,13 +8571,13 @@ nsHttpChannel::PreferAlternativeDataType(const nsACString &aType, return NS_OK; } -const nsTArray - &nsHttpChannel::PreferredAlternativeDataTypes() { +const nsTArray& +nsHttpChannel::PreferredAlternativeDataTypes() { return mPreferredCachedAltDataTypes; } NS_IMETHODIMP -nsHttpChannel::GetAlternativeDataType(nsACString &aType) { +nsHttpChannel::GetAlternativeDataType(nsACString& aType) { // must be called during or after OnStartRequest if (!mAfterOnStartRequestBegun) { return NS_ERROR_NOT_AVAILABLE; @@ -8588,9 +8587,9 @@ nsHttpChannel::GetAlternativeDataType(nsACString &aType) { } NS_IMETHODIMP -nsHttpChannel::OpenAlternativeOutputStream(const nsACString &type, +nsHttpChannel::OpenAlternativeOutputStream(const nsACString& type, int64_t predictedSize, - nsIAsyncOutputStream **_retval) { + nsIAsyncOutputStream** _retval) { // OnStopRequest will clear mCacheEntry, but we may use mAltDataCacheEntry // if the consumer called PreferAlternativeDataType() nsCOMPtr cacheEntry = @@ -8609,7 +8608,7 @@ nsHttpChannel::OpenAlternativeOutputStream(const nsACString &type, } NS_IMETHODIMP -nsHttpChannel::GetOriginalInputStream(nsIInputStreamReceiver *aReceiver) { +nsHttpChannel::GetOriginalInputStream(nsIInputStreamReceiver* aReceiver) { if (aReceiver == nullptr) { return NS_ERROR_INVALID_ARG; } @@ -8625,8 +8624,8 @@ nsHttpChannel::GetOriginalInputStream(nsIInputStreamReceiver *aReceiver) { } NS_IMETHODIMP -nsHttpChannel::GetAltDataInputStream(const nsACString &aType, - nsIInputStreamReceiver *aReceiver) { +nsHttpChannel::GetAltDataInputStream(const nsACString& aType, + nsIInputStreamReceiver* aReceiver) { if (aReceiver == nullptr) { return NS_ERROR_INVALID_ARG; } @@ -8649,7 +8648,7 @@ nsHttpChannel::GetAltDataInputStream(const nsACString &aType, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::IsRacing(bool *aIsRacing) { +nsHttpChannel::IsRacing(bool* aIsRacing) { if (!mAfterOnStartRequestBegun) { return NS_ERROR_NOT_AVAILABLE; } @@ -8658,31 +8657,31 @@ nsHttpChannel::IsRacing(bool *aIsRacing) { } NS_IMETHODIMP -nsHttpChannel::GetCacheToken(nsISupports **token) { +nsHttpChannel::GetCacheToken(nsISupports** token) { NS_ENSURE_ARG_POINTER(token); if (!mCacheEntry) return NS_ERROR_NOT_AVAILABLE; return CallQueryInterface(mCacheEntry, token); } NS_IMETHODIMP -nsHttpChannel::SetCacheToken(nsISupports *token) { +nsHttpChannel::SetCacheToken(nsISupports* token) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsHttpChannel::GetOfflineCacheToken(nsISupports **token) { +nsHttpChannel::GetOfflineCacheToken(nsISupports** token) { NS_ENSURE_ARG_POINTER(token); if (!mOfflineCacheEntry) return NS_ERROR_NOT_AVAILABLE; return CallQueryInterface(mOfflineCacheEntry, token); } NS_IMETHODIMP -nsHttpChannel::SetOfflineCacheToken(nsISupports *token) { +nsHttpChannel::SetOfflineCacheToken(nsISupports* token) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsHttpChannel::GetCacheKey(uint32_t *key) { +nsHttpChannel::GetCacheKey(uint32_t* key) { NS_ENSURE_ARG_POINTER(key); LOG(("nsHttpChannel::GetCacheKey [this=%p]\n", this)); @@ -8702,7 +8701,7 @@ nsHttpChannel::SetCacheKey(uint32_t key) { } NS_IMETHODIMP -nsHttpChannel::GetCacheOnlyMetadata(bool *aOnlyMetadata) { +nsHttpChannel::GetCacheOnlyMetadata(bool* aOnlyMetadata) { NS_ENSURE_ARG(aOnlyMetadata); *aOnlyMetadata = mCacheOnlyMetadata; return NS_OK; @@ -8724,7 +8723,7 @@ nsHttpChannel::SetCacheOnlyMetadata(bool aOnlyMetadata) { } NS_IMETHODIMP -nsHttpChannel::GetPin(bool *aPin) { +nsHttpChannel::GetPin(bool* aPin) { NS_ENSURE_ARG(aPin); *aPin = mPinCacheContent; return NS_OK; @@ -8767,7 +8766,7 @@ nsHttpChannel::ForceCacheEntryValidFor(uint32_t aSecondsToTheFuture) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::ResumeAt(uint64_t aStartPos, const nsACString &aEntityID) { +nsHttpChannel::ResumeAt(uint64_t aStartPos, const nsACString& aEntityID) { LOG(("nsHttpChannel::ResumeAt [this=%p startPos=%" PRIu64 " id='%s']\n", this, aStartPos, PromiseFlatCString(aEntityID).get())); mEntityID = aEntityID; @@ -8777,9 +8776,9 @@ nsHttpChannel::ResumeAt(uint64_t aStartPos, const nsACString &aEntityID) { } nsresult nsHttpChannel::DoAuthRetry( - nsHttpTransaction *aTransWithStickyConn, - const std::function - &aContinueOnStopRequestFunc) { + nsHttpTransaction* aTransWithStickyConn, + const std::function& + aContinueOnStopRequestFunc) { LOG(("nsHttpChannel::DoAuthRetry [this=%p, aTransWithStickyConn=%p]\n", this, aTransWithStickyConn)); @@ -8806,15 +8805,15 @@ nsresult nsHttpChannel::DoAuthRetry( RefPtr trans(aTransWithStickyConn); return CallOrWaitForResume( - [trans{std::move(trans)}, aContinueOnStopRequestFunc](auto *self) { + [trans{std::move(trans)}, aContinueOnStopRequestFunc](auto* self) { return self->ContinueDoAuthRetry(trans, aContinueOnStopRequestFunc); }); } nsresult nsHttpChannel::ContinueDoAuthRetry( - nsHttpTransaction *aTransWithStickyConn, - const std::function - &aContinueOnStopRequestFunc) { + nsHttpTransaction* aTransWithStickyConn, + const std::function& + aContinueOnStopRequestFunc) { LOG(("nsHttpChannel::ContinueDoAuthRetry [this=%p]\n", this)); mIsPending = true; @@ -8847,7 +8846,7 @@ nsresult nsHttpChannel::ContinueDoAuthRetry( RefPtr trans(aTransWithStickyConn); return CallOrWaitForResume( - [trans{std::move(trans)}, aContinueOnStopRequestFunc](auto *self) { + [trans{std::move(trans)}, aContinueOnStopRequestFunc](auto* self) { nsresult rv = self->DoConnect(trans); return aContinueOnStopRequestFunc(self, rv); }); @@ -8858,13 +8857,13 @@ nsresult nsHttpChannel::ContinueDoAuthRetry( //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::GetApplicationCache(nsIApplicationCache **out) { +nsHttpChannel::GetApplicationCache(nsIApplicationCache** out) { NS_IF_ADDREF(*out = mApplicationCache); return NS_OK; } NS_IMETHODIMP -nsHttpChannel::SetApplicationCache(nsIApplicationCache *appCache) { +nsHttpChannel::SetApplicationCache(nsIApplicationCache* appCache) { ENSURE_CALLED_BEFORE_CONNECT(); mApplicationCache = appCache; @@ -8872,13 +8871,13 @@ nsHttpChannel::SetApplicationCache(nsIApplicationCache *appCache) { } NS_IMETHODIMP -nsHttpChannel::GetApplicationCacheForWrite(nsIApplicationCache **out) { +nsHttpChannel::GetApplicationCacheForWrite(nsIApplicationCache** out) { NS_IF_ADDREF(*out = mApplicationCacheForWrite); return NS_OK; } NS_IMETHODIMP -nsHttpChannel::SetApplicationCacheForWrite(nsIApplicationCache *appCache) { +nsHttpChannel::SetApplicationCacheForWrite(nsIApplicationCache* appCache) { ENSURE_CALLED_BEFORE_CONNECT(); mApplicationCacheForWrite = appCache; @@ -8887,13 +8886,13 @@ nsHttpChannel::SetApplicationCacheForWrite(nsIApplicationCache *appCache) { NS_IMETHODIMP nsHttpChannel::GetLoadedFromApplicationCache( - bool *aLoadedFromApplicationCache) { + bool* aLoadedFromApplicationCache) { *aLoadedFromApplicationCache = mLoadedFromApplicationCache; return NS_OK; } NS_IMETHODIMP -nsHttpChannel::GetInheritApplicationCache(bool *aInherit) { +nsHttpChannel::GetInheritApplicationCache(bool* aInherit) { *aInherit = mInheritApplicationCache; return NS_OK; } @@ -8907,7 +8906,7 @@ nsHttpChannel::SetInheritApplicationCache(bool aInherit) { } NS_IMETHODIMP -nsHttpChannel::GetChooseApplicationCache(bool *aChoose) { +nsHttpChannel::GetChooseApplicationCache(bool* aChoose) { *aChoose = mChooseApplicationCache; return NS_OK; } @@ -8920,7 +8919,7 @@ nsHttpChannel::SetChooseApplicationCache(bool aChoose) { return NS_OK; } -nsHttpChannel::OfflineCacheEntryAsForeignMarker * +nsHttpChannel::OfflineCacheEntryAsForeignMarker* nsHttpChannel::GetOfflineCacheEntryAsForeignMarker() { if (!mApplicationCache) return nullptr; @@ -9050,7 +9049,7 @@ void nsHttpChannel::PopRedirectAsyncFunc(nsContinueRedirectionFunc func) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpChannel::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec, +nsHttpChannel::OnLookupComplete(nsICancelable* request, nsIDNSRecord* rec, nsresult status) { MOZ_ASSERT(NS_IsMainThread(), "Expecting DNS callback on main thread."); @@ -9088,8 +9087,8 @@ nsHttpChannel::OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec, } NS_IMETHODIMP -nsHttpChannel::OnLookupByTypeComplete(nsICancelable *aRequest, - nsIDNSByTypeRecord *aRes, +nsHttpChannel::OnLookupByTypeComplete(nsICancelable* aRequest, + nsIDNSByTypeRecord* aRes, nsresult aStatus) { return NS_OK; } @@ -9099,7 +9098,7 @@ nsHttpChannel::OnLookupByTypeComplete(nsICancelable *aRequest, //----------------------------------------------------------------------------- // Creates an URI to the given location using current URI for base and charset -nsresult nsHttpChannel::CreateNewURI(const char *loc, nsIURI **newURI) { +nsresult nsHttpChannel::CreateNewURI(const char* loc, nsIURI** newURI) { nsCOMPtr ioService; nsresult rv = gHttpHandler->GetIOService(getter_AddRefs(ioService)); if (NS_FAILED(rv)) return rv; @@ -9145,7 +9144,7 @@ void nsHttpChannel::MaybeInvalidateCacheEntryForSubsequentGet() { } } -void nsHttpChannel::InvalidateCacheEntryForLocation(const char *location) { +void nsHttpChannel::InvalidateCacheEntryForLocation(const char* location) { nsAutoCString tmpCacheKey, tmpSpec; nsCOMPtr resultingURI; nsresult rv = CreateNewURI(location, getter_AddRefs(resultingURI)); @@ -9156,7 +9155,7 @@ void nsHttpChannel::InvalidateCacheEntryForLocation(const char *location) { } } -void nsHttpChannel::DoInvalidateCacheEntry(nsIURI *aURI) { +void nsHttpChannel::DoInvalidateCacheEntry(nsIURI* aURI) { // NOTE: // Following comments 24,32 and 33 in bug #327765, we only care about // the cache in the protocol-handler, not the application cache. @@ -9207,7 +9206,7 @@ void nsHttpChannel::UpdateAggregateCallbacks() { } NS_IMETHODIMP -nsHttpChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) { +nsHttpChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) { MOZ_ASSERT(NS_IsMainThread(), "Wrong thread."); nsresult rv = HttpBaseChannel::SetLoadGroup(aLoadGroup); @@ -9218,7 +9217,7 @@ nsHttpChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) { } NS_IMETHODIMP -nsHttpChannel::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) { +nsHttpChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aCallbacks) { MOZ_ASSERT(NS_IsMainThread(), "Wrong thread."); nsresult rv = HttpBaseChannel::SetNotificationCallbacks(aCallbacks); @@ -9232,14 +9231,14 @@ bool nsHttpChannel::AwaitingCacheCallbacks() { return mCacheEntriesToWaitFor != 0; } -void nsHttpChannel::SetPushedStream(Http2PushedStream *stream) { +void nsHttpChannel::SetPushedStream(Http2PushedStream* stream) { MOZ_ASSERT(stream); MOZ_ASSERT(!mPushedStream); mPushedStream = stream; } -nsresult nsHttpChannel::OnPush(const nsACString &url, - Http2PushedStream *pushedStream) { +nsresult nsHttpChannel::OnPush(const nsACString& url, + Http2PushedStream* pushedStream) { MOZ_ASSERT(NS_IsMainThread()); LOG(("nsHttpChannel::OnPush [this=%p]\n", this)); @@ -9319,7 +9318,7 @@ void nsHttpChannel::SetCouldBeSynthesized() { mResponseCouldBeSynthesized = true; } -void nsHttpChannel::SetConnectionInfo(nsHttpConnectionInfo *aCI) { +void nsHttpChannel::SetConnectionInfo(nsHttpConnectionInfo* aCI) { mConnectionInfo = aCI ? aCI->Clone() : nullptr; } @@ -9349,7 +9348,7 @@ nsHttpChannel::OnPreflightFailed(nsresult aError) { NS_IMETHODIMP nsHttpChannel::MessageDiversionStarted( - ADivertableParentChannel *aParentChannel) { + ADivertableParentChannel* aParentChannel) { LOG(("nsHttpChannel::MessageDiversionStarted [this=%p]", this)); MOZ_ASSERT(!mParentChannel); mParentChannel = aParentChannel; @@ -9394,7 +9393,7 @@ nsHttpChannel::SuspendInternal() { } nsresult nsHttpChannel::CallOrWaitForResume( - const std::function &aFunc) { + const std::function& aFunc) { if (mCanceled) { MOZ_ASSERT(NS_FAILED(mStatus)); return mStatus; @@ -9429,7 +9428,7 @@ nsHttpChannel::ResumeInternal() { MOZ_ASSERT(!mAsyncResumePending); mAsyncResumePending = 1; - std::function callOnResume = nullptr; + std::function callOnResume = nullptr; std::swap(callOnResume, mCallOnResume); RefPtr self(this); @@ -9548,7 +9547,7 @@ void nsHttpChannel::SetLoadGroupUserAgentOverride() { return; } - nsIRequestContextService *rcsvc = gHttpHandler->GetRequestContextService(); + nsIRequestContextService* rcsvc = gHttpHandler->GetRequestContextService(); nsCOMPtr rc; if (rcsvc) { rcsvc->GetRequestContext(mRequestContextID, getter_AddRefs(rc)); @@ -9874,7 +9873,7 @@ nsHttpChannel::Test_triggerDelayedOpenCacheEntry() { } mCacheOpenDelay = 0; // Avoid re-entrancy issues by nulling our mCacheOpenFunc before calling it. - std::function cacheOpenFunc = nullptr; + std::function cacheOpenFunc = nullptr; std::swap(cacheOpenFunc, mCacheOpenFunc); cacheOpenFunc(this); @@ -10019,7 +10018,7 @@ nsHttpChannel::Test_triggerNetwork(int32_t aTimeout) { } NS_IMETHODIMP -nsHttpChannel::Notify(nsITimer *aTimer) { +nsHttpChannel::Notify(nsITimer* aTimer) { RefPtr self(this); if (aTimer == mCacheOpenTimer) { return Test_triggerDelayedOpenCacheEntry(); @@ -10120,12 +10119,12 @@ nsHttpChannel::OnTailUnblock(nsresult rv) { } void nsHttpChannel::SetWarningReporter( - HttpChannelSecurityWarningReporter *aReporter) { + HttpChannelSecurityWarningReporter* aReporter) { LOG(("nsHttpChannel [this=%p] SetWarningReporter [%p]", this, aReporter)); mWarningReporter = aReporter; } -HttpChannelSecurityWarningReporter *nsHttpChannel::GetWarningReporter() { +HttpChannelSecurityWarningReporter* nsHttpChannel::GetWarningReporter() { LOG(("nsHttpChannel [this=%p] GetWarningReporter [%p]", this, mWarningReporter.get())); return mWarningReporter.get(); @@ -10139,7 +10138,7 @@ class CopyNonDefaultHeaderVisitor final : public nsIHttpHeaderVisitor { ~CopyNonDefaultHeaderVisitor() = default; NS_IMETHOD - VisitHeader(const nsACString &aHeader, const nsACString &aValue) override { + VisitHeader(const nsACString& aHeader, const nsACString& aValue) override { if (aValue.IsEmpty()) { return mTarget->SetEmptyRequestHeader(aHeader); } else { @@ -10148,7 +10147,7 @@ class CopyNonDefaultHeaderVisitor final : public nsIHttpHeaderVisitor { } public: - explicit CopyNonDefaultHeaderVisitor(nsIHttpChannel *aTarget) + explicit CopyNonDefaultHeaderVisitor(nsIHttpChannel* aTarget) : mTarget(aTarget) { MOZ_DIAGNOSTIC_ASSERT(mTarget); } @@ -10173,7 +10172,7 @@ nsresult nsHttpChannel::RedirectToInterceptedChannel() { : nsIContentPolicy::TYPE_OTHER; nsresult rv = intercepted->Init( - mURI, mCaps, static_cast(mProxyInfo.get()), + mURI, mCaps, static_cast(mProxyInfo.get()), mProxyResolveFlags, mProxyURI, mChannelId, type); nsCOMPtr redirectLoadInfo = @@ -10253,13 +10252,13 @@ class BackgroundRevalidatingListener : public nsIStreamListener { }; NS_IMETHODIMP -BackgroundRevalidatingListener::OnStartRequest(nsIRequest *request) { +BackgroundRevalidatingListener::OnStartRequest(nsIRequest* request) { return NS_OK; } NS_IMETHODIMP -BackgroundRevalidatingListener::OnDataAvailable(nsIRequest *request, - nsIInputStream *input, +BackgroundRevalidatingListener::OnDataAvailable(nsIRequest* request, + nsIInputStream* input, uint64_t offset, uint32_t count) { uint32_t bytesRead = 0; @@ -10267,7 +10266,7 @@ BackgroundRevalidatingListener::OnDataAvailable(nsIRequest *request, } NS_IMETHODIMP -BackgroundRevalidatingListener::OnStopRequest(nsIRequest *request, +BackgroundRevalidatingListener::OnStopRequest(nsIRequest* request, nsresult status) { if (NS_FAILED(status)) { return status; diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h index c31325e1e3d50..b55db7176bc61 100644 --- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h @@ -50,12 +50,12 @@ class Http2PushedStream; class HttpChannelSecurityWarningReporter : public nsISupports { public: virtual MOZ_MUST_USE nsresult ReportSecurityMessage( - const nsAString &aMessageTag, const nsAString &aMessageCategory) = 0; + const nsAString& aMessageTag, const nsAString& aMessageCategory) = 0; virtual MOZ_MUST_USE nsresult LogBlockedCORSRequest( - const nsAString &aMessage, const nsACString &aCategory) = 0; + const nsAString& aMessage, const nsACString& aCategory) = 0; virtual MOZ_MUST_USE nsresult - LogMimeTypeMismatch(const nsACString &aMessageName, bool aWarning, - const nsAString &aURL, const nsAString &aContentType) = 0; + LogMimeTypeMismatch(const nsACString& aMessageName, bool aWarning, + const nsAString& aURL, const nsAString& aContentType) = 0; }; //----------------------------------------------------------------------------- @@ -114,14 +114,14 @@ class nsHttpChannel final : public HttpBaseChannel, // nsIHttpAuthenticableChannel. We can't use // NS_DECL_NSIHTTPAUTHENTICABLECHANNEL because it duplicates cancel() and // others. - NS_IMETHOD GetIsSSL(bool *aIsSSL) override; - NS_IMETHOD GetProxyMethodIsConnect(bool *aProxyMethodIsConnect) override; + NS_IMETHOD GetIsSSL(bool* aIsSSL) override; + NS_IMETHOD GetProxyMethodIsConnect(bool* aProxyMethodIsConnect) override; NS_IMETHOD GetServerResponseHeader( - nsACString &aServerResponseHeader) override; - NS_IMETHOD GetProxyChallenges(nsACString &aChallenges) override; - NS_IMETHOD GetWWWChallenges(nsACString &aChallenges) override; - NS_IMETHOD SetProxyCredentials(const nsACString &aCredentials) override; - NS_IMETHOD SetWWWCredentials(const nsACString &aCredentials) override; + nsACString& aServerResponseHeader) override; + NS_IMETHOD GetProxyChallenges(nsACString& aChallenges) override; + NS_IMETHOD GetWWWChallenges(nsACString& aChallenges) override; + NS_IMETHOD SetProxyCredentials(const nsACString& aCredentials) override; + NS_IMETHOD SetWWWCredentials(const nsACString& aCredentials) override; NS_IMETHOD OnAuthAvailable() override; NS_IMETHOD OnAuthCancelled(bool userCancel) override; NS_IMETHOD CloseStickyConnection() override; @@ -129,25 +129,25 @@ class nsHttpChannel final : public HttpBaseChannel, // Functions we implement from nsIHttpAuthenticableChannel but are // declared in HttpBaseChannel must be implemented in this class. We // just call the HttpBaseChannel:: impls. - NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) override; - NS_IMETHOD GetURI(nsIURI **aURI) override; + NS_IMETHOD GetLoadFlags(nsLoadFlags* aLoadFlags) override; + NS_IMETHOD GetURI(nsIURI** aURI) override; NS_IMETHOD GetNotificationCallbacks( - nsIInterfaceRequestor **aCallbacks) override; - NS_IMETHOD GetLoadGroup(nsILoadGroup **aLoadGroup) override; - NS_IMETHOD GetRequestMethod(nsACString &aMethod) override; + nsIInterfaceRequestor** aCallbacks) override; + NS_IMETHOD GetLoadGroup(nsILoadGroup** aLoadGroup) override; + NS_IMETHOD GetRequestMethod(nsACString& aMethod) override; nsHttpChannel(); virtual MOZ_MUST_USE nsresult - Init(nsIURI *aURI, uint32_t aCaps, nsProxyInfo *aProxyInfo, - uint32_t aProxyResolveFlags, nsIURI *aProxyURI, uint64_t aChannelId, + Init(nsIURI* aURI, uint32_t aCaps, nsProxyInfo* aProxyInfo, + uint32_t aProxyResolveFlags, nsIURI* aProxyURI, uint64_t aChannelId, nsContentPolicyType aContentPolicyType) override; - MOZ_MUST_USE nsresult OnPush(const nsACString &uri, - Http2PushedStream *pushedStream); + MOZ_MUST_USE nsresult OnPush(const nsACString& uri, + Http2PushedStream* pushedStream); static bool IsRedirectStatus(uint32_t status); - static bool WillRedirect(nsHttpResponseHead *response); + static bool WillRedirect(nsHttpResponseHead* response); // Methods HttpBaseChannel didn't implement for us or that we override. // @@ -156,17 +156,17 @@ class nsHttpChannel final : public HttpBaseChannel, NS_IMETHOD Suspend() override; NS_IMETHOD Resume() override; // nsIChannel - NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo) override; - NS_IMETHOD AsyncOpen(nsIStreamListener *aListener) override; + NS_IMETHOD GetSecurityInfo(nsISupports** aSecurityInfo) override; + NS_IMETHOD AsyncOpen(nsIStreamListener* aListener) override; // nsIHttpChannel - NS_IMETHOD GetEncodedBodySize(uint64_t *aEncodedBodySize) override; - NS_IMETHOD SwitchProcessTo(mozilla::dom::Promise *aBrowserParent, + NS_IMETHOD GetEncodedBodySize(uint64_t* aEncodedBodySize) override; + NS_IMETHOD SwitchProcessTo(mozilla::dom::Promise* aBrowserParent, uint64_t aIdentifier) override; - NS_IMETHOD HasCrossOriginOpenerPolicyMismatch(bool *aMismatch) override; + NS_IMETHOD HasCrossOriginOpenerPolicyMismatch(bool* aMismatch) override; // nsIHttpChannelInternal - NS_IMETHOD SetupFallbackChannel(const char *aFallbackKey) override; + NS_IMETHOD SetupFallbackChannel(const char* aFallbackKey) override; NS_IMETHOD SetChannelIsForDownload(bool aChannelIsForDownload) override; - NS_IMETHOD GetNavigationStartTimeStamp(TimeStamp *aTimeStamp) override; + NS_IMETHOD GetNavigationStartTimeStamp(TimeStamp* aTimeStamp) override; NS_IMETHOD SetNavigationStartTimeStamp(TimeStamp aTimeStamp) override; NS_IMETHOD CancelByURLClassifier(nsresult aErrorCode) override; // nsISupportsPriority @@ -177,37 +177,37 @@ class nsHttpChannel final : public HttpBaseChannel, NS_IMETHOD ClearClassFlags(uint32_t inFlags) override; // nsIResumableChannel - NS_IMETHOD ResumeAt(uint64_t startPos, const nsACString &entityID) override; + NS_IMETHOD ResumeAt(uint64_t startPos, const nsACString& entityID) override; NS_IMETHOD SetNotificationCallbacks( - nsIInterfaceRequestor *aCallbacks) override; - NS_IMETHOD SetLoadGroup(nsILoadGroup *aLoadGroup) override; + nsIInterfaceRequestor* aCallbacks) override; + NS_IMETHOD SetLoadGroup(nsILoadGroup* aLoadGroup) override; // nsITimedChannel NS_IMETHOD GetDomainLookupStart( - mozilla::TimeStamp *aDomainLookupStart) override; - NS_IMETHOD GetDomainLookupEnd(mozilla::TimeStamp *aDomainLookupEnd) override; - NS_IMETHOD GetConnectStart(mozilla::TimeStamp *aConnectStart) override; - NS_IMETHOD GetTcpConnectEnd(mozilla::TimeStamp *aTcpConnectEnd) override; + mozilla::TimeStamp* aDomainLookupStart) override; + NS_IMETHOD GetDomainLookupEnd(mozilla::TimeStamp* aDomainLookupEnd) override; + NS_IMETHOD GetConnectStart(mozilla::TimeStamp* aConnectStart) override; + NS_IMETHOD GetTcpConnectEnd(mozilla::TimeStamp* aTcpConnectEnd) override; NS_IMETHOD GetSecureConnectionStart( - mozilla::TimeStamp *aSecureConnectionStart) override; - NS_IMETHOD GetConnectEnd(mozilla::TimeStamp *aConnectEnd) override; - NS_IMETHOD GetRequestStart(mozilla::TimeStamp *aRequestStart) override; - NS_IMETHOD GetResponseStart(mozilla::TimeStamp *aResponseStart) override; - NS_IMETHOD GetResponseEnd(mozilla::TimeStamp *aResponseEnd) override; + mozilla::TimeStamp* aSecureConnectionStart) override; + NS_IMETHOD GetConnectEnd(mozilla::TimeStamp* aConnectEnd) override; + NS_IMETHOD GetRequestStart(mozilla::TimeStamp* aRequestStart) override; + NS_IMETHOD GetResponseStart(mozilla::TimeStamp* aResponseStart) override; + NS_IMETHOD GetResponseEnd(mozilla::TimeStamp* aResponseEnd) override; // nsICorsPreflightCallback NS_IMETHOD OnPreflightSucceeded() override; NS_IMETHOD OnPreflightFailed(nsresult aError) override; MOZ_MUST_USE nsresult AddSecurityMessage( - const nsAString &aMessageTag, const nsAString &aMessageCategory) override; - NS_IMETHOD LogBlockedCORSRequest(const nsAString &aMessage, - const nsACString &aCategory) override; - NS_IMETHOD LogMimeTypeMismatch(const nsACString &aMessageName, bool aWarning, - const nsAString &aURL, - const nsAString &aContentType) override; + const nsAString& aMessageTag, const nsAString& aMessageCategory) override; + NS_IMETHOD LogBlockedCORSRequest(const nsAString& aMessage, + const nsACString& aCategory) override; + NS_IMETHOD LogMimeTypeMismatch(const nsACString& aMessageName, bool aWarning, + const nsAString& aURL, + const nsAString& aContentType) override; - void SetWarningReporter(HttpChannelSecurityWarningReporter *aReporter); - HttpChannelSecurityWarningReporter *GetWarningReporter(); + void SetWarningReporter(HttpChannelSecurityWarningReporter* aReporter); + HttpChannelSecurityWarningReporter* GetWarningReporter(); public: /* internal necko use only */ uint32_t GetRequestTime() const { return mRequestTime; } @@ -216,10 +216,10 @@ class nsHttpChannel final : public HttpBaseChannel, MOZ_MUST_USE nsresult OpenCacheEntry(bool usingSSL); MOZ_MUST_USE nsresult OpenCacheEntryInternal( - bool isHttps, nsIApplicationCache *applicationCache, bool noAppCache); + bool isHttps, nsIApplicationCache* applicationCache, bool noAppCache); MOZ_MUST_USE nsresult ContinueConnect(); - MOZ_MUST_USE nsresult StartRedirectChannelToURI(nsIURI *, uint32_t); + MOZ_MUST_USE nsresult StartRedirectChannelToURI(nsIURI*, uint32_t); // This allows cache entry to be marked as foreign even after channel itself // is gone. Needed for e10s (see @@ -229,19 +229,19 @@ class nsHttpChannel final : public HttpBaseChannel, nsCOMPtr mCacheURI; public: - OfflineCacheEntryAsForeignMarker(nsIApplicationCache *appCache, - nsIURI *aURI) + OfflineCacheEntryAsForeignMarker(nsIApplicationCache* appCache, + nsIURI* aURI) : mApplicationCache(appCache), mCacheURI(aURI) {} nsresult MarkAsForeign(); }; - OfflineCacheEntryAsForeignMarker *GetOfflineCacheEntryAsForeignMarker(); + OfflineCacheEntryAsForeignMarker* GetOfflineCacheEntryAsForeignMarker(); // Helper to keep cache callbacks wait flags consistent class AutoCacheWaitFlags { public: - explicit AutoCacheWaitFlags(nsHttpChannel *channel) + explicit AutoCacheWaitFlags(nsHttpChannel* channel) : mChannel(channel), mKeep(0) { // Flags must be set before entering any AsyncOpenCacheEntry call. mChannel->mCacheEntriesToWaitFor = @@ -260,7 +260,7 @@ class nsHttpChannel final : public HttpBaseChannel, } private: - nsHttpChannel *mChannel; + nsHttpChannel* mChannel; uint32_t mKeep : 2; }; @@ -274,17 +274,17 @@ class nsHttpChannel final : public HttpBaseChannel, base::ProcessId ProcessId(); MOZ_MUST_USE bool AttachStreamFilter( - ipc::Endpoint &&aEndpoint); + ipc::Endpoint&& aEndpoint); private: // used for alternate service validation RefPtr mTransactionObserver; public: - void SetConnectionInfo(nsHttpConnectionInfo *); // clones the argument - void SetTransactionObserver(TransactionObserver *arg) { + void SetConnectionInfo(nsHttpConnectionInfo*); // clones the argument + void SetTransactionObserver(TransactionObserver* arg) { mTransactionObserver = arg; } - TransactionObserver *GetTransactionObserver() { return mTransactionObserver; } + TransactionObserver* GetTransactionObserver() { return mTransactionObserver; } typedef MozPromise, nsresult, false> TabPromise; already_AddRefed TakeRedirectTabPromise() { @@ -306,7 +306,7 @@ class nsHttpChannel final : public HttpBaseChannel, // Otherwise, set |aFunc| to |mCallOnResume| and wait until the channel // resumes. nsresult CallOrWaitForResume( - const std::function &aFunc); + const std::function& aFunc); bool RequestIsConditional(); void HandleContinueCancellingByURLClassifier(nsresult aErrorCode); @@ -348,15 +348,15 @@ class nsHttpChannel final : public HttpBaseChannel, void ProcessAltService(); bool ShouldBypassProcessNotModified(); MOZ_MUST_USE nsresult ProcessNotModified( - const std::function - &aContinueProcessResponseFunc); + const std::function& + aContinueProcessResponseFunc); MOZ_MUST_USE nsresult ContinueProcessResponseAfterNotModified(nsresult aRv); MOZ_MUST_USE nsresult AsyncProcessRedirection(uint32_t httpStatus); MOZ_MUST_USE nsresult ContinueProcessRedirection(nsresult); MOZ_MUST_USE nsresult ContinueProcessRedirectionAfterFallback(nsresult); MOZ_MUST_USE nsresult ProcessFailedProxyConnect(uint32_t httpStatus); - MOZ_MUST_USE nsresult ProcessFallback(bool *waitingForRedirectCallback); + MOZ_MUST_USE nsresult ProcessFallback(bool* waitingForRedirectCallback); MOZ_MUST_USE nsresult ContinueProcessFallback(nsresult); void HandleAsyncAbort(); MOZ_MUST_USE nsresult EnsureAssocReq(); @@ -379,33 +379,33 @@ class nsHttpChannel final : public HttpBaseChannel, MOZ_MUST_USE nsresult ContinueHandleAsyncFallback(nsresult); MOZ_MUST_USE nsresult PromptTempRedirect(); virtual MOZ_MUST_USE nsresult - SetupReplacementChannel(nsIURI *, nsIChannel *, bool preserveMethod, + SetupReplacementChannel(nsIURI*, nsIChannel*, bool preserveMethod, uint32_t redirectFlags) override; nsresult StartCrossProcessRedirect(); // proxy specific methods MOZ_MUST_USE nsresult ProxyFailover(); - MOZ_MUST_USE nsresult AsyncDoReplaceWithProxy(nsIProxyInfo *); + MOZ_MUST_USE nsresult AsyncDoReplaceWithProxy(nsIProxyInfo*); MOZ_MUST_USE nsresult ContinueDoReplaceWithProxy(nsresult); MOZ_MUST_USE nsresult ResolveProxy(); // cache specific methods MOZ_MUST_USE nsresult OnOfflineCacheEntryAvailable( - nsICacheEntry *aEntry, bool aNew, nsIApplicationCache *aAppCache, + nsICacheEntry* aEntry, bool aNew, nsIApplicationCache* aAppCache, nsresult aResult); - MOZ_MUST_USE nsresult OnNormalCacheEntryAvailable(nsICacheEntry *aEntry, + MOZ_MUST_USE nsresult OnNormalCacheEntryAvailable(nsICacheEntry* aEntry, bool aNew, nsresult aResult); MOZ_MUST_USE nsresult OpenOfflineCacheEntryForWriting(); MOZ_MUST_USE nsresult OnOfflineCacheEntryForWritingAvailable( - nsICacheEntry *aEntry, nsIApplicationCache *aAppCache, nsresult aResult); + nsICacheEntry* aEntry, nsIApplicationCache* aAppCache, nsresult aResult); MOZ_MUST_USE nsresult OnCacheEntryAvailableInternal( - nsICacheEntry *entry, bool aNew, nsIApplicationCache *aAppCache, + nsICacheEntry* entry, bool aNew, nsIApplicationCache* aAppCache, nsresult status); - MOZ_MUST_USE nsresult GenerateCacheKey(uint32_t postID, nsACString &key); + MOZ_MUST_USE nsresult GenerateCacheKey(uint32_t postID, nsACString& key); MOZ_MUST_USE nsresult UpdateExpirationTime(); - MOZ_MUST_USE nsresult CheckPartial(nsICacheEntry *aEntry, int64_t *aSize, - int64_t *aContentLength); + MOZ_MUST_USE nsresult CheckPartial(nsICacheEntry* aEntry, int64_t* aSize, + int64_t* aContentLength); bool ShouldUpdateOfflineCacheEntry(); MOZ_MUST_USE nsresult ReadFromCache(bool alreadyMarkedValid); void CloseCacheEntry(bool doomOnFailure); @@ -413,7 +413,7 @@ class nsHttpChannel final : public HttpBaseChannel, MOZ_MUST_USE nsresult InitCacheEntry(); void UpdateInhibitPersistentCachingFlag(); MOZ_MUST_USE nsresult InitOfflineCacheEntry(); - MOZ_MUST_USE nsresult AddCacheEntryHeaders(nsICacheEntry *entry); + MOZ_MUST_USE nsresult AddCacheEntryHeaders(nsICacheEntry* entry); MOZ_MUST_USE nsresult FinalizeCacheEntry(); MOZ_MUST_USE nsresult InstallCacheListener(int64_t offset = 0); MOZ_MUST_USE nsresult InstallOfflineCacheListener(int64_t offset = 0); @@ -425,25 +425,25 @@ class nsHttpChannel final : public HttpBaseChannel, // byte range request specific methods MOZ_MUST_USE nsresult ProcessPartialContent( - const std::function - &aContinueProcessResponseFunc); + const std::function& + aContinueProcessResponseFunc); MOZ_MUST_USE nsresult ContinueProcessResponseAfterPartialContent(nsresult aRv); - MOZ_MUST_USE nsresult OnDoneReadingPartialCacheEntry(bool *streamDone); + MOZ_MUST_USE nsresult OnDoneReadingPartialCacheEntry(bool* streamDone); MOZ_MUST_USE nsresult - DoAuthRetry(nsHttpTransaction *aTransWithStickyConn, - const std::function - &aContinueOnStopRequestFunc); + DoAuthRetry(nsHttpTransaction* aTransWithStickyConn, + const std::function& + aContinueOnStopRequestFunc); MOZ_MUST_USE nsresult - ContinueDoAuthRetry(nsHttpTransaction *aTransWithStickyConn, - const std::function - &aContinueOnStopRequestFunc); + ContinueDoAuthRetry(nsHttpTransaction* aTransWithStickyConn, + const std::function& + aContinueOnStopRequestFunc); MOZ_MUST_USE nsresult - DoConnect(nsHttpTransaction *aTransWithStickyConn = nullptr); + DoConnect(nsHttpTransaction* aTransWithStickyConn = nullptr); MOZ_MUST_USE nsresult ContinueOnStopRequestAfterAuthRetry( nsresult aStatus, bool aAuthRetry, bool aIsFromNet, bool aContentComplete, - nsHttpTransaction *aTransWithStickyConn); + nsHttpTransaction* aTransWithStickyConn); MOZ_MUST_USE nsresult ContinueOnStopRequest(nsresult status, bool aIsFromNet, bool aContentComplete); @@ -472,7 +472,7 @@ class nsHttpChannel final : public HttpBaseChannel, * NS_ERROR_INVALID_SIGNATURE is thrown and a fallback loaded in nsDocShell */ MOZ_MUST_USE nsresult - ProcessContentSignatureHeader(nsHttpResponseHead *aResponseHead); + ProcessContentSignatureHeader(nsHttpResponseHead* aResponseHead); /** * A function that will, if the feature is enabled, send security reports. @@ -480,7 +480,7 @@ class nsHttpChannel final : public HttpBaseChannel, void ProcessSecurityReport(nsresult status); nsresult GetResponseCrossOriginPolicy( - nsILoadInfo::CrossOriginPolicy *aResponseCrossOriginPolicy); + nsILoadInfo::CrossOriginPolicy* aResponseCrossOriginPolicy); nsresult ProcessCrossOriginHeader(); /** @@ -489,16 +489,16 @@ class nsHttpChannel final : public HttpBaseChannel, * from ProcessSecurityHeaders. */ MOZ_MUST_USE nsresult ProcessSingleSecurityHeader( - uint32_t aType, nsITransportSecurityInfo *aSecInfo, uint32_t aFlags); + uint32_t aType, nsITransportSecurityInfo* aSecInfo, uint32_t aFlags); - void InvalidateCacheEntryForLocation(const char *location); - void AssembleCacheKey(const char *spec, uint32_t postID, nsACString &key); - MOZ_MUST_USE nsresult CreateNewURI(const char *loc, nsIURI **newURI); - void DoInvalidateCacheEntry(nsIURI *aURI); + void InvalidateCacheEntryForLocation(const char* location); + void AssembleCacheKey(const char* spec, uint32_t postID, nsACString& key); + MOZ_MUST_USE nsresult CreateNewURI(const char* loc, nsIURI** newURI); + void DoInvalidateCacheEntry(nsIURI* aURI); // Ref RFC2616 13.10: "invalidation... MUST only be performed if // the host part is the same as in the Request-URI" - inline bool HostPartIsTheSame(nsIURI *uri) { + inline bool HostPartIsTheSame(nsIURI* uri) { nsAutoCString tmpHost1, tmpHost2; return (NS_SUCCEEDED(mURI->GetAsciiHost(tmpHost1)) && NS_SUCCEEDED(uri->GetAsciiHost(tmpHost2)) && @@ -523,8 +523,8 @@ class nsHttpChannel final : public HttpBaseChannel, void UpdateAggregateCallbacks(); static bool HasQueryString(nsHttpRequestHead::ParsedMethodType method, - nsIURI *uri); - bool ResponseWouldVary(nsICacheEntry *entry); + nsIURI* uri); + bool ResponseWouldVary(nsICacheEntry* entry); bool IsResumable(int64_t partialLen, int64_t contentLength, bool ignoreMissingPartialLen = false) const; MOZ_MUST_USE nsresult @@ -533,11 +533,11 @@ class nsHttpChannel final : public HttpBaseChannel, MOZ_MUST_USE nsresult SetupByteRangeRequest(int64_t partialLen); void UntieByteRangeRequest(); void UntieValidationRequest(); - MOZ_MUST_USE nsresult OpenCacheInputStream(nsICacheEntry *cacheEntry, + MOZ_MUST_USE nsresult OpenCacheInputStream(nsICacheEntry* cacheEntry, bool startBuffering, bool checkingAppCacheEntry); - void SetPushedStream(Http2PushedStream *stream); + void SetPushedStream(Http2PushedStream* stream); void MaybeWarnAboutAppCache(); @@ -742,7 +742,7 @@ class nsHttpChannel final : public HttpBaseChannel, // Needed for accurate DNS timing RefPtr mDNSPrefetch; - Http2PushedStream *mPushedStream; + Http2PushedStream* mPushedStream; // True if the channel's principal was found on a phishing, malware, or // tracking (if tracking protection is enabled) blocklist bool mLocalBlocklist; @@ -784,7 +784,7 @@ class nsHttpChannel final : public HttpBaseChannel, // These next members are only used in unit tests to delay the call to // cache->AsyncOpenURI in order to race the cache with the network. nsCOMPtr mCacheOpenTimer; - std::function mCacheOpenFunc; + std::function mCacheOpenFunc; uint32_t mCacheOpenDelay = 0; // We need to remember which is the source of the response we are using. @@ -839,8 +839,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsHttpChannel, NS_HTTPCHANNEL_IID) } // namespace net } // namespace mozilla -inline nsISupports *ToSupports(mozilla::net::nsHttpChannel *aChannel) { - return static_cast(aChannel); +inline nsISupports* ToSupports(mozilla::net::nsHttpChannel* aChannel) { + return static_cast(aChannel); } #endif // nsHttpChannel_h__ diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp index 8756191b7876a..2a0264bbee039 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp @@ -61,7 +61,7 @@ namespace net { #define MAX_DISPLAYED_USER_LENGTH 64 #define MAX_DISPLAYED_HOST_LENGTH 64 -static void GetOriginAttributesSuffix(nsIChannel *aChan, nsACString &aSuffix) { +static void GetOriginAttributesSuffix(nsIChannel* aChan, nsACString& aSuffix) { OriginAttributes oa; // Deliberately ignoring the result and going with defaults @@ -93,7 +93,7 @@ nsHttpChannelAuthProvider::~nsHttpChannelAuthProvider() { } NS_IMETHODIMP -nsHttpChannelAuthProvider::Init(nsIHttpAuthenticableChannel *channel) { +nsHttpChannelAuthProvider::Init(nsIHttpAuthenticableChannel* channel) { MOZ_ASSERT(channel, "channel expected!"); mAuthChannel = channel; @@ -219,10 +219,10 @@ nsHttpChannelAuthProvider::AddAuthorizationHeaders( if (NS_FAILED(rv)) return rv; // this getter never fails - nsHttpAuthCache *authCache = gHttpHandler->AuthCache(mIsPrivate); + nsHttpAuthCache* authCache = gHttpHandler->AuthCache(mIsPrivate); // check if proxy credentials should be sent - const char *proxyHost = ProxyHost(); + const char* proxyHost = ProxyHost(); if (proxyHost && UsingHttpProxy()) { SetAuthorizationHeader(authCache, nsHttp::Proxy_Authorization, "http", proxyHost, ProxyPort(), @@ -313,9 +313,9 @@ nsHttpChannelAuthProvider::Disconnect(nsresult status) { } // buf contains "domain\user" -static void ParseUserDomain(char16_t *buf, const char16_t **user, - const char16_t **domain) { - char16_t *p = buf; +static void ParseUserDomain(char16_t* buf, const char16_t** user, + const char16_t** domain) { + char16_t* p = buf; while (*p && *p != '\\') ++p; if (!*p) return; *p = '\0'; @@ -324,10 +324,10 @@ static void ParseUserDomain(char16_t *buf, const char16_t **user, } // helper function for setting identity from raw user:pass -static void SetIdent(nsHttpAuthIdentity &ident, uint32_t authFlags, - char16_t *userBuf, char16_t *passBuf) { - const char16_t *user = userBuf; - const char16_t *domain = nullptr; +static void SetIdent(nsHttpAuthIdentity& ident, uint32_t authFlags, + char16_t* userBuf, char16_t* passBuf) { + const char16_t* user = userBuf; + const char16_t* domain = nullptr; if (authFlags & nsIHttpAuthenticator::IDENTITY_INCLUDES_DOMAIN) ParseUserDomain(userBuf, &user, &domain); @@ -337,8 +337,8 @@ static void SetIdent(nsHttpAuthIdentity &ident, uint32_t authFlags, } // helper function for getting an auth prompt from an interface requestor -static void GetAuthPrompt(nsIInterfaceRequestor *ifreq, bool proxyAuth, - nsIAuthPrompt2 **result) { +static void GetAuthPrompt(nsIInterfaceRequestor* ifreq, bool proxyAuth, + nsIAuthPrompt2** result) { if (!ifreq) return; uint32_t promptReason; @@ -350,24 +350,24 @@ static void GetAuthPrompt(nsIInterfaceRequestor *ifreq, bool proxyAuth, nsCOMPtr promptProvider = do_GetInterface(ifreq); if (promptProvider) promptProvider->GetAuthPrompt(promptReason, NS_GET_IID(nsIAuthPrompt2), - reinterpret_cast(result)); + reinterpret_cast(result)); else NS_QueryAuthPrompt2(ifreq, result); } // generate credentials for the given challenge, and update the auth cache. nsresult nsHttpChannelAuthProvider::GenCredsAndSetEntry( - nsIHttpAuthenticator *auth, bool proxyAuth, const char *scheme, - const char *host, int32_t port, const char *directory, const char *realm, - const char *challenge, const nsHttpAuthIdentity &ident, - nsCOMPtr &sessionState, char **result) { + nsIHttpAuthenticator* auth, bool proxyAuth, const char* scheme, + const char* host, int32_t port, const char* directory, const char* realm, + const char* challenge, const nsHttpAuthIdentity& ident, + nsCOMPtr& sessionState, char** result) { nsresult rv; - nsISupports *ss = sessionState; + nsISupports* ss = sessionState; // set informations that depend on whether // we're authenticating against a proxy // or a webserver - nsISupports **continuationState; + nsISupports** continuationState; if (proxyAuth) { continuationState = &mProxyAuthContinuationState; @@ -403,10 +403,10 @@ nsresult nsHttpChannelAuthProvider::GenCredsAndSetEntry( } nsresult nsHttpChannelAuthProvider::UpdateCache( - nsIHttpAuthenticator *auth, const char *scheme, const char *host, - int32_t port, const char *directory, const char *realm, - const char *challenge, const nsHttpAuthIdentity &ident, const char *creds, - uint32_t generateFlags, nsISupports *sessionState) { + nsIHttpAuthenticator* auth, const char* scheme, const char* host, + int32_t port, const char* directory, const char* realm, + const char* challenge, const nsHttpAuthIdentity& ident, const char* creds, + uint32_t generateFlags, nsISupports* sessionState) { nsresult rv; uint32_t authFlags; @@ -424,7 +424,7 @@ nsresult nsHttpChannelAuthProvider::UpdateCache( 0 == (generateFlags & nsIHttpAuthenticator::USING_INTERNAL_IDENTITY); // this getter never fails - nsHttpAuthCache *authCache = gHttpHandler->AuthCache(mIsPrivate); + nsHttpAuthCache* authCache = gHttpHandler->AuthCache(mIsPrivate); nsCOMPtr chan = do_QueryInterface(mAuthChannel); nsAutoCString suffix; @@ -487,9 +487,9 @@ nsresult nsHttpChannelAuthProvider::PrepareForAuthentication(bool proxyAuth) { return NS_OK; } -nsresult nsHttpChannelAuthProvider::GetCredentials(const char *challenges, +nsresult nsHttpChannelAuthProvider::GetCredentials(const char* challenges, bool proxyAuth, - nsCString &creds) { + nsCString& creds) { nsCOMPtr auth; nsAutoCString challenge; @@ -498,8 +498,8 @@ nsresult nsHttpChannelAuthProvider::GetCredentials(const char *challenges, // set informations that depend on whether we're authenticating against a // proxy or a webserver - nsISupports **currentContinuationState; - nsCString *currentAuthType; + nsISupports** currentContinuationState; + nsCString* currentAuthType; if (proxyAuth) { currentContinuationState = &mProxyAuthContinuationState; @@ -513,8 +513,8 @@ nsresult nsHttpChannelAuthProvider::GetCredentials(const char *challenges, bool gotCreds = false; // figure out which challenge we can handle and which authenticator to use. - for (const char *eol = challenges - 1; eol;) { - const char *p = eol + 1; + for (const char* eol = challenges - 1; eol;) { + const char* p = eol + 1; // get the challenge string (LF separated -- see nsHttpHeaderArray) if ((eol = strchr(p, '\n')) != nullptr) @@ -583,9 +583,9 @@ nsresult nsHttpChannelAuthProvider::GetCredentials(const char *challenges, } nsresult nsHttpChannelAuthProvider::GetAuthorizationMembers( - bool proxyAuth, nsACString &scheme, const char *&host, int32_t &port, - nsACString &path, nsHttpAuthIdentity *&ident, - nsISupports **&continuationState) { + bool proxyAuth, nsACString& scheme, const char*& host, int32_t& port, + nsACString& path, nsHttpAuthIdentity*& ident, + nsISupports**& continuationState) { if (proxyAuth) { MOZ_ASSERT(UsingHttpProxy(), "proxyAuth is true, but no HTTP proxy is configured!"); @@ -615,15 +615,15 @@ nsresult nsHttpChannelAuthProvider::GetAuthorizationMembers( } nsresult nsHttpChannelAuthProvider::GetCredentialsForChallenge( - const char *challenge, const char *authType, bool proxyAuth, - nsIHttpAuthenticator *auth, nsCString &creds) { + const char* challenge, const char* authType, bool proxyAuth, + nsIHttpAuthenticator* auth, nsCString& creds) { LOG( ("nsHttpChannelAuthProvider::GetCredentialsForChallenge " "[this=%p channel=%p proxyAuth=%d challenges=%s]\n", this, mAuthChannel, proxyAuth, challenge)); // this getter never fails - nsHttpAuthCache *authCache = gHttpHandler->AuthCache(mIsPrivate); + nsHttpAuthCache* authCache = gHttpHandler->AuthCache(mIsPrivate); uint32_t authFlags; nsresult rv = auth->GetAuthFlags(&authFlags); @@ -646,12 +646,12 @@ nsresult nsHttpChannelAuthProvider::GetCredentialsForChallenge( // set informations that depend on whether // we're authenticating against a proxy // or a webserver - const char *host; + const char* host; int32_t port; - nsHttpAuthIdentity *ident; + nsHttpAuthIdentity* ident; nsAutoCString path, scheme; bool identFromURI = false; - nsISupports **continuationState; + nsISupports** continuationState; rv = GetAuthorizationMembers(proxyAuth, scheme, host, port, path, ident, continuationState); @@ -693,7 +693,7 @@ nsresult nsHttpChannelAuthProvider::GetCredentialsForChallenge( // in the cache have changed, in which case we'd want to give them a // try instead. // - nsHttpAuthEntry *entry = nullptr; + nsHttpAuthEntry* entry = nullptr; Unused << authCache->GetAuthEntryForDomain(scheme.get(), host, port, realm.get(), suffix, &entry); @@ -709,7 +709,7 @@ nsresult nsHttpChannelAuthProvider::GetCredentialsForChallenge( // for digest auth, maybe our cached nonce value simply timed out... bool identityInvalid; - nsISupports *sessionState = sessionStateGrip; + nsISupports* sessionState = sessionStateGrip; rv = auth->ChallengeReceived(mAuthChannel, challenge, proxyAuth, &sessionState, &*continuationState, &identityInvalid); @@ -1002,8 +1002,8 @@ bool nsHttpChannelAuthProvider::BlockPrompt(bool proxyAuth) { return false; } -inline void GetAuthType(const char *challenge, nsCString &authType) { - const char *p; +inline void GetAuthType(const char* challenge, nsCString& authType) { + const char* p; // get the challenge type if ((p = strchr(challenge, ' ')) != nullptr) @@ -1013,7 +1013,7 @@ inline void GetAuthType(const char *challenge, nsCString &authType) { } nsresult nsHttpChannelAuthProvider::GetAuthenticator( - const char *challenge, nsCString &authType, nsIHttpAuthenticator **auth) { + const char* challenge, nsCString& authType, nsIHttpAuthenticator** auth) { LOG(("nsHttpChannelAuthProvider::GetAuthenticator [this=%p channel=%p]\n", this, mAuthChannel)); @@ -1042,7 +1042,7 @@ nsresult nsHttpChannelAuthProvider::GetAuthenticator( } void nsHttpChannelAuthProvider::GetIdentityFromURI(uint32_t authFlags, - nsHttpAuthIdentity &ident) { + nsHttpAuthIdentity& ident) { LOG(("nsHttpChannelAuthProvider::GetIdentityFromURI [this=%p channel=%p]\n", this, mAuthChannel)); @@ -1063,13 +1063,13 @@ void nsHttpChannelAuthProvider::GetIdentityFromURI(uint32_t authFlags, } if (!userBuf.IsEmpty()) { - SetIdent(ident, authFlags, (char16_t *)userBuf.get(), - (char16_t *)passBuf.get()); + SetIdent(ident, authFlags, (char16_t*)userBuf.get(), + (char16_t*)passBuf.get()); } } -void nsHttpChannelAuthProvider::ParseRealm(const char *challenge, - nsACString &realm) { +void nsHttpChannelAuthProvider::ParseRealm(const char* challenge, + nsACString& realm) { // // From RFC2617 section 1.2, the realm value is defined as such: // @@ -1080,7 +1080,7 @@ void nsHttpChannelAuthProvider::ParseRealm(const char *challenge, // end-of-line, if the string is not quoted. // - const char *p = PL_strcasestr(challenge, "realm="); + const char* p = PL_strcasestr(challenge, "realm="); if (p) { bool has_quote = false; p += 6; @@ -1089,7 +1089,7 @@ void nsHttpChannelAuthProvider::ParseRealm(const char *challenge, p++; } - const char *end; + const char* end; if (has_quote) { end = p; while (*end) { @@ -1116,23 +1116,23 @@ void nsHttpChannelAuthProvider::ParseRealm(const char *challenge, class nsHTTPAuthInformation : public nsAuthInformationHolder { public: - nsHTTPAuthInformation(uint32_t aFlags, const nsString &aRealm, - const nsCString &aAuthType) + nsHTTPAuthInformation(uint32_t aFlags, const nsString& aRealm, + const nsCString& aAuthType) : nsAuthInformationHolder(aFlags, aRealm, aAuthType) {} - void SetToHttpAuthIdentity(uint32_t authFlags, nsHttpAuthIdentity &identity); + void SetToHttpAuthIdentity(uint32_t authFlags, nsHttpAuthIdentity& identity); }; void nsHTTPAuthInformation::SetToHttpAuthIdentity( - uint32_t authFlags, nsHttpAuthIdentity &identity) { + uint32_t authFlags, nsHttpAuthIdentity& identity) { DebugOnly rv = identity.Set(Domain().get(), User().get(), Password().get()); MOZ_ASSERT(NS_SUCCEEDED(rv)); } nsresult nsHttpChannelAuthProvider::PromptForIdentity( - uint32_t level, bool proxyAuth, const char *realm, const char *authType, - uint32_t authFlags, nsHttpAuthIdentity &ident) { + uint32_t level, bool proxyAuth, const char* realm, const char* authType, + uint32_t authFlags, nsHttpAuthIdentity& ident) { LOG(("nsHttpChannelAuthProvider::PromptForIdentity [this=%p channel=%p]\n", this, mAuthChannel)); @@ -1223,7 +1223,7 @@ nsresult nsHttpChannelAuthProvider::PromptForIdentity( } NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthAvailable( - nsISupports *aContext, nsIAuthInformation *aAuthInfo) { + nsISupports* aContext, nsIAuthInformation* aAuthInfo) { LOG(("nsHttpChannelAuthProvider::OnAuthAvailable [this=%p channel=%p]", this, mAuthChannel)); @@ -1232,11 +1232,11 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthAvailable( nsresult rv; - const char *host; + const char* host; int32_t port; - nsHttpAuthIdentity *ident; + nsHttpAuthIdentity* ident; nsAutoCString path, scheme; - nsISupports **continuationState; + nsISupports** continuationState; rv = GetAuthorizationMembers(mProxyAuth, scheme, host, port, path, ident, continuationState); if (NS_FAILED(rv)) OnAuthCancelled(aContext, false); @@ -1251,16 +1251,16 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthAvailable( GetOriginAttributesSuffix(chan, suffix); } - nsHttpAuthCache *authCache = gHttpHandler->AuthCache(mIsPrivate); - nsHttpAuthEntry *entry = nullptr; + nsHttpAuthCache* authCache = gHttpHandler->AuthCache(mIsPrivate); + nsHttpAuthEntry* entry = nullptr; Unused << authCache->GetAuthEntryForDomain(scheme.get(), host, port, realm.get(), suffix, &entry); nsCOMPtr sessionStateGrip; if (entry) sessionStateGrip = entry->mMetaData; - nsAuthInformationHolder *holder = - static_cast(aAuthInfo); + nsAuthInformationHolder* holder = + static_cast(aAuthInfo); rv = ident->Set(holder->Domain().get(), holder->User().get(), holder->Password().get()); MOZ_ASSERT(NS_SUCCEEDED(rv)); @@ -1288,7 +1288,7 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthAvailable( return ContinueOnAuthAvailable(creds); } -NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthCancelled(nsISupports *aContext, +NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthCancelled(nsISupports* aContext, bool userCancel) { LOG(("nsHttpChannelAuthProvider::OnAuthCancelled [this=%p channel=%p]", this, mAuthChannel)); @@ -1346,8 +1346,8 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnAuthCancelled(nsISupports *aContext, } NS_IMETHODIMP nsHttpChannelAuthProvider::OnCredsGenerated( - const char *aGeneratedCreds, uint32_t aFlags, nsresult aResult, - nsISupports *aSessionState, nsISupports *aContinuationState) { + const char* aGeneratedCreds, uint32_t aFlags, nsresult aResult, + nsISupports* aSessionState, nsISupports* aContinuationState) { nsresult rv; MOZ_ASSERT(NS_IsMainThread()); @@ -1377,11 +1377,11 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnCredsGenerated( rv = GetAuthenticator(mCurrentChallenge.get(), unused, getter_AddRefs(auth)); NS_ENSURE_SUCCESS(rv, rv); - const char *host; + const char* host; int32_t port; - nsHttpAuthIdentity *ident; + nsHttpAuthIdentity* ident; nsAutoCString directory, scheme; - nsISupports **unusedContinuationState; + nsISupports** unusedContinuationState; // Get realm from challenge nsAutoCString realm; @@ -1403,7 +1403,7 @@ NS_IMETHODIMP nsHttpChannelAuthProvider::OnCredsGenerated( } nsresult nsHttpChannelAuthProvider::ContinueOnAuthAvailable( - const nsACString &creds) { + const nsACString& creds) { nsresult rv; if (mProxyAuth) rv = mAuthChannel->SetProxyCredentials(creds); @@ -1422,7 +1422,7 @@ nsresult nsHttpChannelAuthProvider::ContinueOnAuthAvailable( return NS_OK; } -bool nsHttpChannelAuthProvider::ConfirmAuth(const char *bundleKey, +bool nsHttpChannelAuthProvider::ConfirmAuth(const char* bundleKey, bool doYesNoPrompt) { // skip prompting the user if // 1) we've already prompted the user @@ -1491,7 +1491,7 @@ bool nsHttpChannelAuthProvider::ConfirmAuth(const char *bundleKey, } } - const char16_t *strs[2] = {ucsHost.get(), ucsUser.get()}; + const char16_t* strs[2] = {ucsHost.get(), ucsUser.get()}; nsAutoString msg; rv = bundle->FormatStringFromName(bundleKey, strs, 2, msg); @@ -1533,16 +1533,16 @@ bool nsHttpChannelAuthProvider::ConfirmAuth(const char *bundleKey, } void nsHttpChannelAuthProvider::SetAuthorizationHeader( - nsHttpAuthCache *authCache, nsHttpAtom header, const char *scheme, - const char *host, int32_t port, const char *path, - nsHttpAuthIdentity &ident) { - nsHttpAuthEntry *entry = nullptr; + nsHttpAuthCache* authCache, nsHttpAtom header, const char* scheme, + const char* host, int32_t port, const char* path, + nsHttpAuthIdentity& ident) { + nsHttpAuthEntry* entry = nullptr; nsresult rv; // set informations that depend on whether // we're authenticating against a proxy // or a webserver - nsISupports **continuationState; + nsISupports** continuationState; nsAutoCString suffix; if (header == nsHttp::Proxy_Authorization) { @@ -1586,8 +1586,8 @@ void nsHttpChannelAuthProvider::SetAuthorizationHeader( identFromURI = true; nsCString temp; // this must have the same lifetime as creds - const char *creds = entry->Creds(); - const char *challenge = entry->Challenge(); + const char* creds = entry->Creds(); + const char* challenge = entry->Challenge(); // we can only send a preemptive Authorization header if we have either // stored credentials or a stored challenge from which to derive // credentials. if the identity is from the URI, then we cannot use @@ -1628,7 +1628,7 @@ void nsHttpChannelAuthProvider::SetAuthorizationHeader( } } -nsresult nsHttpChannelAuthProvider::GetCurrentPath(nsACString &path) { +nsresult nsHttpChannelAuthProvider::GetCurrentPath(nsACString& path) { nsresult rv; nsCOMPtr url = do_QueryInterface(mURI); if (url) diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.h b/netwerk/protocol/http/nsHttpChannelAuthProvider.h index 66ffb08c367de..a95cd70c2637b 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.h +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.h @@ -41,13 +41,13 @@ class nsHttpChannelAuthProvider final : public nsIHttpChannelAuthProvider, private: virtual ~nsHttpChannelAuthProvider(); - const char *ProxyHost() const { + const char* ProxyHost() const { return mProxyInfo ? mProxyInfo->Host().get() : nullptr; } int32_t ProxyPort() const { return mProxyInfo ? mProxyInfo->Port() : -1; } - const char *Host() const { return mHost.get(); } + const char* Host() const { return mHost.get(); } int32_t Port() const { return mPort; } bool UsingSSL() const { return mUsingSSL; } @@ -57,15 +57,15 @@ class nsHttpChannelAuthProvider final : public nsIHttpChannelAuthProvider, MOZ_MUST_USE nsresult PrepareForAuthentication(bool proxyAuth); MOZ_MUST_USE nsresult GenCredsAndSetEntry( - nsIHttpAuthenticator *, bool proxyAuth, const char *scheme, - const char *host, int32_t port, const char *dir, const char *realm, - const char *challenge, const nsHttpAuthIdentity &ident, - nsCOMPtr &session, char **result); - MOZ_MUST_USE nsresult GetAuthenticator(const char *challenge, - nsCString &scheme, - nsIHttpAuthenticator **auth); - void ParseRealm(const char *challenge, nsACString &realm); - void GetIdentityFromURI(uint32_t authFlags, nsHttpAuthIdentity &); + nsIHttpAuthenticator*, bool proxyAuth, const char* scheme, + const char* host, int32_t port, const char* dir, const char* realm, + const char* challenge, const nsHttpAuthIdentity& ident, + nsCOMPtr& session, char** result); + MOZ_MUST_USE nsresult GetAuthenticator(const char* challenge, + nsCString& scheme, + nsIHttpAuthenticator** auth); + void ParseRealm(const char* challenge, nsACString& realm); + void GetIdentityFromURI(uint32_t authFlags, nsHttpAuthIdentity&); /** * Following three methods return NS_ERROR_IN_PROGRESS when @@ -73,40 +73,40 @@ class nsHttpChannelAuthProvider final : public nsIHttpChannelAuthProvider, * the user's decision will be gathered in a callback and is not an actual * error. */ - MOZ_MUST_USE nsresult GetCredentials(const char *challenges, bool proxyAuth, - nsCString &creds); - MOZ_MUST_USE nsresult GetCredentialsForChallenge(const char *challenge, - const char *scheme, + MOZ_MUST_USE nsresult GetCredentials(const char* challenges, bool proxyAuth, + nsCString& creds); + MOZ_MUST_USE nsresult GetCredentialsForChallenge(const char* challenge, + const char* scheme, bool proxyAuth, - nsIHttpAuthenticator *auth, - nsCString &creds); + nsIHttpAuthenticator* auth, + nsCString& creds); MOZ_MUST_USE nsresult PromptForIdentity(uint32_t level, bool proxyAuth, - const char *realm, - const char *authType, + const char* realm, + const char* authType, uint32_t authFlags, - nsHttpAuthIdentity &); - - bool ConfirmAuth(const char *bundleKey, bool doYesNoPrompt); - void SetAuthorizationHeader(nsHttpAuthCache *, nsHttpAtom header, - const char *scheme, const char *host, - int32_t port, const char *path, - nsHttpAuthIdentity &ident); - MOZ_MUST_USE nsresult GetCurrentPath(nsACString &); + nsHttpAuthIdentity&); + + bool ConfirmAuth(const char* bundleKey, bool doYesNoPrompt); + void SetAuthorizationHeader(nsHttpAuthCache*, nsHttpAtom header, + const char* scheme, const char* host, + int32_t port, const char* path, + nsHttpAuthIdentity& ident); + MOZ_MUST_USE nsresult GetCurrentPath(nsACString&); /** * Return all information needed to build authorization information, * all parameters except proxyAuth are out parameters. proxyAuth specifies * with what authorization we work (WWW or proxy). */ MOZ_MUST_USE nsresult GetAuthorizationMembers( - bool proxyAuth, nsACString &scheme, const char *&host, int32_t &port, - nsACString &path, nsHttpAuthIdentity *&ident, - nsISupports **&continuationState); + bool proxyAuth, nsACString& scheme, const char*& host, int32_t& port, + nsACString& path, nsHttpAuthIdentity*& ident, + nsISupports**& continuationState); /** * Method called to resume suspended transaction after we got credentials * from the user. Called from OnAuthAvailable callback or OnAuthCancelled * when credentials for next challenge were obtained synchronously. */ - MOZ_MUST_USE nsresult ContinueOnAuthAvailable(const nsACString &creds); + MOZ_MUST_USE nsresult ContinueOnAuthAvailable(const nsACString& creds); MOZ_MUST_USE nsresult DoRedirectChannelToHttps(); @@ -125,16 +125,16 @@ class nsHttpChannelAuthProvider final : public nsIHttpChannelAuthProvider, bool BlockPrompt(bool proxyAuth); // Store credentials to the cache when appropriate aFlags are set. - MOZ_MUST_USE nsresult UpdateCache(nsIHttpAuthenticator *aAuth, - const char *aScheme, const char *aHost, - int32_t aPort, const char *aDirectory, - const char *aRealm, const char *aChallenge, - const nsHttpAuthIdentity &aIdent, - const char *aCreds, uint32_t aGenerateFlags, - nsISupports *aSessionState); + MOZ_MUST_USE nsresult UpdateCache(nsIHttpAuthenticator* aAuth, + const char* aScheme, const char* aHost, + int32_t aPort, const char* aDirectory, + const char* aRealm, const char* aChallenge, + const nsHttpAuthIdentity& aIdent, + const char* aCreds, uint32_t aGenerateFlags, + nsISupports* aSessionState); private: - nsIHttpAuthenticableChannel *mAuthChannel; // weak ref + nsIHttpAuthenticableChannel* mAuthChannel; // weak ref nsCOMPtr mURI; nsCOMPtr mProxyInfo; @@ -144,9 +144,9 @@ class nsHttpChannelAuthProvider final : public nsIHttpChannelAuthProvider, bool mProxyUsingSSL; bool mIsPrivate; - nsISupports *mProxyAuthContinuationState; + nsISupports* mProxyAuthContinuationState; nsCString mProxyAuthType; - nsISupports *mAuthContinuationState; + nsISupports* mAuthContinuationState; nsCString mAuthType; nsHttpAuthIdentity mIdent; nsHttpAuthIdentity mProxyIdent; diff --git a/netwerk/protocol/http/nsHttpChunkedDecoder.cpp b/netwerk/protocol/http/nsHttpChunkedDecoder.cpp index 618b3927ba246..354ce302ee86b 100644 --- a/netwerk/protocol/http/nsHttpChunkedDecoder.cpp +++ b/netwerk/protocol/http/nsHttpChunkedDecoder.cpp @@ -21,8 +21,8 @@ namespace net { //----------------------------------------------------------------------------- nsresult nsHttpChunkedDecoder::HandleChunkedContent( - char *buf, uint32_t count, uint32_t *contentRead, - uint32_t *contentRemaining) { + char* buf, uint32_t count, uint32_t* contentRead, + uint32_t* contentRemaining) { LOG(("nsHttpChunkedDecoder::HandleChunkedContent [count=%u]\n", count)); *contentRead = 0; @@ -82,14 +82,14 @@ nsresult nsHttpChunkedDecoder::HandleChunkedContent( // nsHttpChunkedDecoder //----------------------------------------------------------------------------- -nsresult nsHttpChunkedDecoder::ParseChunkRemaining(char *buf, uint32_t count, - uint32_t *bytesConsumed) { +nsresult nsHttpChunkedDecoder::ParseChunkRemaining(char* buf, uint32_t count, + uint32_t* bytesConsumed) { MOZ_ASSERT(mChunkRemaining == 0, "chunk remaining should be zero"); MOZ_ASSERT(count, "unexpected"); *bytesConsumed = 0; - char *p = static_cast(memchr(buf, '\n', count)); + char* p = static_cast(memchr(buf, '\n', count)); if (p) { *p = 0; count = p - buf; // new length @@ -102,7 +102,7 @@ nsresult nsHttpChunkedDecoder::ParseChunkRemaining(char *buf, uint32_t count, // make buf point to the full line buffer to parse if (!mLineBuf.IsEmpty()) { mLineBuf.Append(buf, count); - buf = (char *)mLineBuf.get(); + buf = (char*)mLineBuf.get(); count = mLineBuf.Length(); } @@ -131,7 +131,7 @@ nsresult nsHttpChunkedDecoder::ParseChunkRemaining(char *buf, uint32_t count, LOG(("reached end of chunked-body\n")); } } else if (*buf) { - char *endptr; + char* endptr; unsigned long parsedval; // could be 64 bit, could be 32 // ignore any chunk-extensions diff --git a/netwerk/protocol/http/nsHttpChunkedDecoder.h b/netwerk/protocol/http/nsHttpChunkedDecoder.h index 3a9546fd08929..334376dad2a32 100644 --- a/netwerk/protocol/http/nsHttpChunkedDecoder.h +++ b/netwerk/protocol/http/nsHttpChunkedDecoder.h @@ -26,19 +26,19 @@ class nsHttpChunkedDecoder { bool ReachedEOF() { return mReachedEOF; } // called by the transaction to handle chunked content. - MOZ_MUST_USE nsresult HandleChunkedContent(char *buf, uint32_t count, - uint32_t *contentRead, - uint32_t *contentRemaining); + MOZ_MUST_USE nsresult HandleChunkedContent(char* buf, uint32_t count, + uint32_t* contentRead, + uint32_t* contentRemaining); - nsHttpHeaderArray *Trailers() { return mTrailers.get(); } + nsHttpHeaderArray* Trailers() { return mTrailers.get(); } - nsHttpHeaderArray *TakeTrailers() { return mTrailers.forget(); } + nsHttpHeaderArray* TakeTrailers() { return mTrailers.forget(); } uint32_t GetChunkRemaining() { return mChunkRemaining; } private: - MOZ_MUST_USE nsresult ParseChunkRemaining(char *buf, uint32_t count, - uint32_t *countRead); + MOZ_MUST_USE nsresult ParseChunkRemaining(char* buf, uint32_t count, + uint32_t* countRead); private: nsAutoPtr mTrailers; diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp index 31e66e372be2e..6e1119570300d 100644 --- a/netwerk/protocol/http/nsHttpConnection.cpp +++ b/netwerk/protocol/http/nsHttpConnection.cpp @@ -132,7 +132,7 @@ nsHttpConnection::~nsHttpConnection() { mHttp1xTransactionCount)); Telemetry::Accumulate(Telemetry::HTTP_REQUEST_PER_CONN, mHttp1xTransactionCount); - nsHttpConnectionInfo *ci = nullptr; + nsHttpConnectionInfo* ci = nullptr; if (mTransaction) { ci = mTransaction->ConnectionInfo(); } @@ -189,10 +189,10 @@ nsHttpConnection::~nsHttpConnection() { } nsresult nsHttpConnection::Init( - nsHttpConnectionInfo *info, uint16_t maxHangTime, - nsISocketTransport *transport, nsIAsyncInputStream *instream, - nsIAsyncOutputStream *outstream, bool connectedTransport, - nsIInterfaceRequestor *callbacks, PRIntervalTime rtt) { + nsHttpConnectionInfo* info, uint16_t maxHangTime, + nsISocketTransport* transport, nsIAsyncInputStream* instream, + nsIAsyncOutputStream* outstream, bool connectedTransport, + nsIInterfaceRequestor* callbacks, PRIntervalTime rtt) { LOG1(("nsHttpConnection::Init this=%p sockettransport=%p", this, transport)); NS_ENSURE_ARG_POINTER(info); NS_ENSURE_TRUE(!mConnInfo, NS_ERROR_ALREADY_INITIALIZED); @@ -220,7 +220,7 @@ nsresult nsHttpConnection::Init( } nsresult nsHttpConnection::TryTakeSubTransactions( - nsTArray > &list) { + nsTArray >& list) { nsresult rv = mTransaction->TakeSubTransactions(list); if (rv == NS_ERROR_ALREADY_OPENED) { @@ -249,7 +249,7 @@ nsresult nsHttpConnection::TryTakeSubTransactions( } nsresult nsHttpConnection::MoveTransactionsToSpdy( - nsresult status, nsTArray > &list) { + nsresult status, nsTArray >& list) { if (NS_FAILED(status)) { // includes NS_ERROR_NOT_IMPLEMENTED MOZ_ASSERT(list.IsEmpty(), "sub transaction list not empty"); @@ -321,7 +321,7 @@ void nsHttpConnection::Start0RTTSpdy(SpdyVersion spdyVersion) { mTransaction = mSpdySession; } -void nsHttpConnection::StartSpdy(nsISSLSocketControl *sslControl, +void nsHttpConnection::StartSpdy(nsISSLSocketControl* sslControl, SpdyVersion spdyVersion) { LOG(("nsHttpConnection::StartSpdy [this=%p, mDid0RTTSpdy=%d]\n", this, mDid0RTTSpdy)); @@ -423,8 +423,8 @@ void nsHttpConnection::StartSpdy(nsISSLSocketControl *sslControl, } } -bool nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue, - uint32_t &aOut0RTTBytesWritten) { +bool nsHttpConnection::EnsureNPNComplete(nsresult& aOut0RTTWriteHandshakeValue, + uint32_t& aOut0RTTBytesWritten) { // If for some reason the components to check on NPN aren't available, // this function will just return true to continue on and disable SPDY @@ -505,7 +505,7 @@ bool nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue, "early selected alpn: %s", this, mEarlyNegotiatedALPN.get())); uint32_t infoIndex; - const SpdyInformation *info = gHttpHandler->SpdyInfo(); + const SpdyInformation* info = gHttpHandler->SpdyInfo(); if (NS_FAILED(info->GetNPNIndex(mEarlyNegotiatedALPN, &infoIndex))) { // This is the HTTP/1 case. // Check if early-data is allowed for this transaction. @@ -628,7 +628,7 @@ bool nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue, mTransaction->QueryNullTransaction()->GetTcpConnectEnd(); } uint32_t infoIndex; - const SpdyInformation *info = gHttpHandler->SpdyInfo(); + const SpdyInformation* info = gHttpHandler->SpdyInfo(); if (NS_SUCCEEDED(info->GetNPNIndex(negotiatedNPN, &infoIndex))) { StartSpdy(ssl, info->Version[infoIndex]); } @@ -718,7 +718,7 @@ bool nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue, return true; } -nsresult nsHttpConnection::OnTunnelNudged(TLSFilterTransaction *trans) { +nsresult nsHttpConnection::OnTunnelNudged(TLSFilterTransaction* trans) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnection::OnTunnelNudged %p\n", this)); if (trans != mTLSFilter) { @@ -729,7 +729,7 @@ nsresult nsHttpConnection::OnTunnelNudged(TLSFilterTransaction *trans) { } // called on the socket thread -nsresult nsHttpConnection::Activate(nsAHttpTransaction *trans, uint32_t caps, +nsresult nsHttpConnection::Activate(nsAHttpTransaction* trans, uint32_t caps, int32_t pri) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG1(("nsHttpConnection::Activate [this=%p trans=%p caps=%x]\n", this, trans, @@ -741,7 +741,7 @@ nsresult nsHttpConnection::Activate(nsAHttpTransaction *trans, uint32_t caps, } if (mBootstrappedTimingsSet) { mBootstrappedTimingsSet = false; - nsHttpTransaction *hTrans = trans->QueryHttpTransaction(); + nsHttpTransaction* hTrans = trans->QueryHttpTransaction(); if (hTrans) { hTrans->BootstrapTimings(mBootstrappedTimings); SetUrgentStartPreferred(hTrans->ClassOfService() & @@ -898,7 +898,7 @@ void nsHttpConnection::SetupSSL() { // offer list for both NPN and ALPN. ALPN validation callbacks are made // now before the handshake is complete, and NPN validation callbacks // are made during the handshake. -nsresult nsHttpConnection::SetupNPNList(nsISSLSocketControl *ssl, +nsresult nsHttpConnection::SetupNPNList(nsISSLSocketControl* ssl, uint32_t caps) { nsTArray protocolArray; @@ -915,7 +915,7 @@ nsresult nsHttpConnection::SetupNPNList(nsISSLSocketControl *ssl, if (gHttpHandler->IsSpdyEnabled() && !(caps & NS_HTTP_DISALLOW_SPDY)) { LOG(("nsHttpConnection::SetupSSL Allow SPDY NPN selection")); - const SpdyInformation *info = gHttpHandler->SpdyInfo(); + const SpdyInformation* info = gHttpHandler->SpdyInfo(); for (uint32_t index = SpdyInformation::kCount; index > 0; --index) { if (info->ProtocolEnabled(index - 1) && info->ALPNCallbacks[index - 1](ssl)) { @@ -935,7 +935,7 @@ nsresult nsHttpConnection::SetupNPNList(nsISSLSocketControl *ssl, return rv; } -nsresult nsHttpConnection::AddTransaction(nsAHttpTransaction *httpTransaction, +nsresult nsHttpConnection::AddTransaction(nsAHttpTransaction* httpTransaction, int32_t priority) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(mSpdySession && (mUsingSpdyVersion != SpdyVersion::NONE), @@ -945,7 +945,7 @@ nsresult nsHttpConnection::AddTransaction(nsAHttpTransaction *httpTransaction, // it is important to start the stream using the specific connection // info of the transaction to ensure it is routed on the right tunnel - nsHttpConnectionInfo *transCI = httpTransaction->ConnectionInfo(); + nsHttpConnectionInfo* transCI = httpTransaction->ConnectionInfo(); bool needTunnel = transCI->UsingHttpsProxy(); needTunnel = needTunnel && !mTLSFilter; @@ -953,7 +953,7 @@ nsresult nsHttpConnection::AddTransaction(nsAHttpTransaction *httpTransaction, needTunnel = needTunnel && httpTransaction->QueryHttpTransaction(); bool isWebsocket = false; - nsHttpTransaction *trans = httpTransaction->QueryHttpTransaction(); + nsHttpTransaction* trans = httpTransaction->QueryHttpTransaction(); if (trans) { isWebsocket = trans->IsWebsocketUpgrade(); MOZ_ASSERT(!isWebsocket || !needTunnel, "Websocket and tunnel?!"); @@ -990,7 +990,7 @@ void nsHttpConnection::Close(nsresult reason, bool aIsShutdown) { } if (!mTrafficCategory.IsEmpty()) { - HttpTrafficAnalyzer *hta = gHttpHandler->GetHttpTrafficAnalyzer(); + HttpTrafficAnalyzer* hta = gHttpHandler->GetHttpTrafficAnalyzer(); if (hta) { hta->IncrementHttpConnection(std::move(mTrafficCategory)); MOZ_ASSERT(mTrafficCategory.IsEmpty()); @@ -1082,7 +1082,7 @@ void nsHttpConnection::DontReuse() { if (mSpdySession) mSpdySession->DontReuse(); } -bool nsHttpConnection::TestJoinConnection(const nsACString &hostname, +bool nsHttpConnection::TestJoinConnection(const nsACString& hostname, int32_t port) { if (mSpdySession && CanDirectlyActivate()) { return mSpdySession->TestJoinConnection(hostname, port); @@ -1090,7 +1090,7 @@ bool nsHttpConnection::TestJoinConnection(const nsACString &hostname, return false; } -bool nsHttpConnection::JoinConnection(const nsACString &hostname, +bool nsHttpConnection::JoinConnection(const nsACString& hostname, int32_t port) { if (mSpdySession && CanDirectlyActivate()) { return mSpdySession->JoinConnection(hostname, port); @@ -1204,10 +1204,10 @@ void nsHttpConnection::SetUrgentStartPreferred(bool urgent) { // nsHttpConnection::nsAHttpConnection compatible methods //---------------------------------------------------------------------------- -nsresult nsHttpConnection::OnHeadersAvailable(nsAHttpTransaction *trans, - nsHttpRequestHead *requestHead, - nsHttpResponseHead *responseHead, - bool *reset) { +nsresult nsHttpConnection::OnHeadersAvailable(nsAHttpTransaction* trans, + nsHttpRequestHead* requestHead, + nsHttpResponseHead* responseHead, + bool* reset) { LOG( ("nsHttpConnection::OnHeadersAvailable [this=%p trans=%p " "response-head=%p]\n", @@ -1286,7 +1286,7 @@ nsresult nsHttpConnection::OnHeadersAvailable(nsAHttpTransaction *trans, Unused << responseHead->GetHeader(nsHttp::Keep_Alive, keepAlive); if (mUsingSpdyVersion == SpdyVersion::NONE) { - const char *cp = PL_strcasestr(keepAlive.get(), "timeout="); + const char* cp = PL_strcasestr(keepAlive.get(), "timeout="); if (cp) mIdleTimeout = PR_SecondsToInterval((uint32_t)atoi(cp + 8)); else @@ -1416,9 +1416,9 @@ void nsHttpConnection::SetIsReusedAfter(uint32_t afterMilliseconds) { mConsiderReusedAfterInterval = PR_MillisecondsToInterval(afterMilliseconds); } -nsresult nsHttpConnection::TakeTransport(nsISocketTransport **aTransport, - nsIAsyncInputStream **aInputStream, - nsIAsyncOutputStream **aOutputStream) { +nsresult nsHttpConnection::TakeTransport(nsISocketTransport** aTransport, + nsIAsyncInputStream** aInputStream, + nsIAsyncOutputStream** aOutputStream) { if (mUsingSpdyVersion != SpdyVersion::NONE) return NS_ERROR_FAILURE; if (mTransaction && !mTransaction->IsDone()) return NS_ERROR_IN_PROGRESS; if (!(mSocketTransport && mSocketIn && mSocketOut)) @@ -1540,11 +1540,11 @@ uint32_t nsHttpConnection::ReadTimeoutTick(PRIntervalTime now) { return nextTickAfter; } -void nsHttpConnection::UpdateTCPKeepalive(nsITimer *aTimer, void *aClosure) { +void nsHttpConnection::UpdateTCPKeepalive(nsITimer* aTimer, void* aClosure) { MOZ_ASSERT(aTimer); MOZ_ASSERT(aClosure); - nsHttpConnection *self = static_cast(aClosure); + nsHttpConnection* self = static_cast(aClosure); if (NS_WARN_IF(self->mUsingSpdyVersion != SpdyVersion::NONE)) { return; @@ -1564,7 +1564,7 @@ void nsHttpConnection::UpdateTCPKeepalive(nsITimer *aTimer, void *aClosure) { } } -void nsHttpConnection::GetSecurityInfo(nsISupports **secinfo) { +void nsHttpConnection::GetSecurityInfo(nsISupports** secinfo) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnection::GetSecurityInfo trans=%p tlsfilter=%p socket=%p\n", mTransaction.get(), mTLSFilter.get(), mSocketTransport.get())); @@ -1587,7 +1587,7 @@ void nsHttpConnection::GetSecurityInfo(nsISupports **secinfo) { *secinfo = nullptr; } -void nsHttpConnection::SetSecurityCallbacks(nsIInterfaceRequestor *aCallbacks) { +void nsHttpConnection::SetSecurityCallbacks(nsIInterfaceRequestor* aCallbacks) { MutexAutoLock lock(mCallbacksLock); // This is called both on and off the main thread. For JS-implemented // callbacks, we requires that the call happen on the main thread, but @@ -1597,7 +1597,7 @@ void nsHttpConnection::SetSecurityCallbacks(nsIInterfaceRequestor *aCallbacks) { "nsHttpConnection::mCallbacks", aCallbacks, false); } -nsresult nsHttpConnection::PushBack(const char *data, uint32_t length) { +nsresult nsHttpConnection::PushBack(const char* data, uint32_t length) { LOG(("nsHttpConnection::PushBack [this=%p, length=%d]\n", this, length)); if (mInputOverflow) { @@ -1611,7 +1611,7 @@ nsresult nsHttpConnection::PushBack(const char *data, uint32_t length) { class HttpConnectionForceIO : public Runnable { public: - HttpConnectionForceIO(nsHttpConnection *aConn, bool doRecv, + HttpConnectionForceIO(nsHttpConnection* aConn, bool doRecv, bool isFastOpenForce) : Runnable("net::HttpConnectionForceIO"), mConn(aConn), @@ -1705,9 +1705,9 @@ nsresult nsHttpConnection::ResumeRecv() { return NS_ERROR_UNEXPECTED; } -void nsHttpConnection::ForceSendIO(nsITimer *aTimer, void *aClosure) { +void nsHttpConnection::ForceSendIO(nsITimer* aTimer, void* aClosure) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpConnection *self = static_cast(aClosure); + nsHttpConnection* self = static_cast(aClosure); MOZ_ASSERT(aTimer == self->mForceSendTimer); self->mForceSendTimer = nullptr; NS_DispatchToCurrentThread(new HttpConnectionForceIO(self, false, false)); @@ -1788,7 +1788,7 @@ HttpVersion nsHttpConnection::Version() { // nsHttpConnection //----------------------------------------------------------------------------- -void nsHttpConnection::CloseTransaction(nsAHttpTransaction *trans, +void nsHttpConnection::CloseTransaction(nsAHttpTransaction* trans, nsresult reason, bool aIsShutdown) { LOG(("nsHttpConnection::CloseTransaction[this=%p trans=%p reason=%" PRIx32 "]\n", @@ -1832,16 +1832,16 @@ void nsHttpConnection::CloseTransaction(nsAHttpTransaction *trans, mIsReused = true; } -nsresult nsHttpConnection::ReadFromStream(nsIInputStream *input, void *closure, - const char *buf, uint32_t offset, - uint32_t count, uint32_t *countRead) { +nsresult nsHttpConnection::ReadFromStream(nsIInputStream* input, void* closure, + const char* buf, uint32_t offset, + uint32_t count, uint32_t* countRead) { // thunk for nsIInputStream instance - nsHttpConnection *conn = (nsHttpConnection *)closure; + nsHttpConnection* conn = (nsHttpConnection*)closure; return conn->OnReadSegment(buf, count, countRead); } -nsresult nsHttpConnection::OnReadSegment(const char *buf, uint32_t count, - uint32_t *countRead) { +nsresult nsHttpConnection::OnReadSegment(const char* buf, uint32_t count, + uint32_t* countRead) { if (count == 0) { // some ReadSegments implementations will erroneously call the writer // to consume 0 bytes worth of data. we must protect against this case @@ -2017,8 +2017,8 @@ nsresult nsHttpConnection::OnSocketWritable() { return rv; } -nsresult nsHttpConnection::OnWriteSegment(char *buf, uint32_t count, - uint32_t *countWritten) { +nsresult nsHttpConnection::OnWriteSegment(char* buf, uint32_t count, + uint32_t* countWritten) { if (count == 0) { // some WriteSegments implementations will erroneously call the reader // to provide 0 bytes worth of data. we must protect against this case @@ -2131,7 +2131,7 @@ nsresult nsHttpConnection::OnSocketReadable() { } void nsHttpConnection::SetupSecondaryTLS( - nsAHttpTransaction *aSpdyConnectTransaction) { + nsAHttpTransaction* aSpdyConnectTransaction) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(!mTLSFilter); LOG( @@ -2140,7 +2140,7 @@ void nsHttpConnection::SetupSecondaryTLS( this, mConnInfo->Origin(), mConnInfo->OriginPort(), aSpdyConnectTransaction)); - nsHttpConnectionInfo *ci = nullptr; + nsHttpConnectionInfo* ci = nullptr; if (mTransaction) { ci = mTransaction->ConnectionInfo(); } @@ -2168,9 +2168,9 @@ void nsHttpConnection::SetInSpdyTunnel(bool arg) { mProxyConnectInProgress = false; } -nsresult nsHttpConnection::MakeConnectString(nsAHttpTransaction *trans, - nsHttpRequestHead *request, - nsACString &result, bool h2ws) { +nsresult nsHttpConnection::MakeConnectString(nsAHttpTransaction* trans, + nsHttpRequestHead* request, + nsACString& result, bool h2ws) { result.Truncate(); if (!trans->ConnectionInfo()) { return NS_ERROR_NOT_INITIALIZED; @@ -2412,7 +2412,7 @@ NS_INTERFACE_MAP_END // called on the socket transport thread NS_IMETHODIMP -nsHttpConnection::OnInputStreamReady(nsIAsyncInputStream *in) { +nsHttpConnection::OnInputStreamReady(nsIAsyncInputStream* in) { MOZ_ASSERT(in == mSocketIn, "unexpected stream"); MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -2452,7 +2452,7 @@ nsHttpConnection::OnInputStreamReady(nsIAsyncInputStream *in) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpConnection::OnOutputStreamReady(nsIAsyncOutputStream *out) { +nsHttpConnection::OnOutputStreamReady(nsIAsyncOutputStream* out) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(out == mSocketOut, "unexpected socket"); // if the transaction was dropped... @@ -2472,7 +2472,7 @@ nsHttpConnection::OnOutputStreamReady(nsIAsyncOutputStream *out) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpConnection::OnTransportStatus(nsITransport *trans, nsresult status, +nsHttpConnection::OnTransportStatus(nsITransport* trans, nsresult status, int64_t progress, int64_t progressMax) { if (mTransaction) mTransaction->OnTransportStatus(trans, status, progress); return NS_OK; @@ -2484,7 +2484,7 @@ nsHttpConnection::OnTransportStatus(nsITransport *trans, nsresult status, // not called on the socket transport thread NS_IMETHODIMP -nsHttpConnection::GetInterface(const nsIID &iid, void **result) { +nsHttpConnection::GetInterface(const nsIID& iid, void** result) { // NOTE: This function is only called on the UI thread via sync proxy from // the socket transport thread. If that weren't the case, then we'd // have to worry about the possibility of mTransaction going away @@ -2529,7 +2529,7 @@ void nsHttpConnection::CheckForTraffic(bool check) { } } -nsAHttpTransaction * +nsAHttpTransaction* nsHttpConnection::CloseConnectionFastOpenTakesTooLongOrError( bool aCloseSocketTransport) { MOZ_ASSERT(!mCurrentBytesRead); @@ -2586,7 +2586,7 @@ void nsHttpConnection::SetFastOpen(bool aFastOpen) { if (!mFastOpen && mTransaction && !mTransaction->IsNullTransaction()) { mExperienced = true; - nsHttpTransaction *hTrans = mTransaction->QueryHttpTransaction(); + nsHttpTransaction* hTrans = mTransaction->QueryHttpTransaction(); if (hTrans) { SetUrgentStartPreferred(hTrans->ClassOfService() & nsIClassOfService::UrgentStart); diff --git a/netwerk/protocol/http/nsHttpConnection.h b/netwerk/protocol/http/nsHttpConnection.h index 54053d3cfdad5..4dbd13fb4c07c 100644 --- a/netwerk/protocol/http/nsHttpConnection.h +++ b/netwerk/protocol/http/nsHttpConnection.h @@ -78,22 +78,22 @@ class nsHttpConnection final : public nsAHttpSegmentReader, // maxHangTime - limits the amount of time this connection can spend on a // single transaction before it should no longer be kept // alive. a value of 0xffff indicates no limit. - MOZ_MUST_USE nsresult Init(nsHttpConnectionInfo *info, uint16_t maxHangTime, - nsISocketTransport *, nsIAsyncInputStream *, - nsIAsyncOutputStream *, bool connectedTransport, - nsIInterfaceRequestor *, PRIntervalTime); + MOZ_MUST_USE nsresult Init(nsHttpConnectionInfo* info, uint16_t maxHangTime, + nsISocketTransport*, nsIAsyncInputStream*, + nsIAsyncOutputStream*, bool connectedTransport, + nsIInterfaceRequestor*, PRIntervalTime); // Activate causes the given transaction to be processed on this // connection. It fails if there is already an existing transaction unless // a multiplexing protocol such as SPDY is being used - MOZ_MUST_USE nsresult Activate(nsAHttpTransaction *, uint32_t caps, + MOZ_MUST_USE nsresult Activate(nsAHttpTransaction*, uint32_t caps, int32_t pri); void SetFastOpen(bool aFastOpen); // Close this connection and return the transaction. The transaction is // restarted as well. This will only happened before connection is // connected. - nsAHttpTransaction *CloseConnectionFastOpenTakesTooLongOrError( + nsAHttpTransaction* CloseConnectionFastOpenTakesTooLongOrError( bool aCloseocketTransport); // Close the underlying socket transport. @@ -139,27 +139,27 @@ class nsHttpConnection final : public nsAHttpSegmentReader, } void SetUrgentStartPreferred(bool urgent); - nsISocketTransport *Transport() { return mSocketTransport; } - nsAHttpTransaction *Transaction() { return mTransaction; } - nsHttpConnectionInfo *ConnectionInfo() { return mConnInfo; } + nsISocketTransport* Transport() { return mSocketTransport; } + nsAHttpTransaction* Transaction() { return mTransaction; } + nsHttpConnectionInfo* ConnectionInfo() { return mConnInfo; } // nsAHttpConnection compatible methods (non-virtual): - MOZ_MUST_USE nsresult OnHeadersAvailable(nsAHttpTransaction *, - nsHttpRequestHead *, - nsHttpResponseHead *, bool *reset); - void CloseTransaction(nsAHttpTransaction *, nsresult reason, + MOZ_MUST_USE nsresult OnHeadersAvailable(nsAHttpTransaction*, + nsHttpRequestHead*, + nsHttpResponseHead*, bool* reset); + void CloseTransaction(nsAHttpTransaction*, nsresult reason, bool aIsShutdown = false); - void GetConnectionInfo(nsHttpConnectionInfo **ci) { + void GetConnectionInfo(nsHttpConnectionInfo** ci) { NS_IF_ADDREF(*ci = mConnInfo); } - MOZ_MUST_USE nsresult TakeTransport(nsISocketTransport **, - nsIAsyncInputStream **, - nsIAsyncOutputStream **); - void GetSecurityInfo(nsISupports **); + MOZ_MUST_USE nsresult TakeTransport(nsISocketTransport**, + nsIAsyncInputStream**, + nsIAsyncOutputStream**); + void GetSecurityInfo(nsISupports**); bool IsPersistent() { return IsKeepAlive() && !mDontReuse; } bool IsReused(); void SetIsReusedAfter(uint32_t afterMilliseconds); - MOZ_MUST_USE nsresult PushBack(const char *data, uint32_t length); + MOZ_MUST_USE nsresult PushBack(const char* data, uint32_t length); MOZ_MUST_USE nsresult ResumeSend(); MOZ_MUST_USE nsresult ResumeRecv(); int64_t MaxBytesRead() { return mMaxBytesRead; } @@ -169,9 +169,9 @@ class nsHttpConnection final : public nsAHttpSegmentReader, MOZ_MUST_USE nsresult ForceSend(); MOZ_MUST_USE nsresult ForceRecv(); - static MOZ_MUST_USE nsresult ReadFromStream(nsIInputStream *, void *, - const char *, uint32_t, uint32_t, - uint32_t *); + static MOZ_MUST_USE nsresult ReadFromStream(nsIInputStream*, void*, + const char*, uint32_t, uint32_t, + uint32_t*); // When a persistent connection is in the connection manager idle // connection pool, the nsHttpConnection still reads errors and hangups @@ -198,7 +198,7 @@ class nsHttpConnection final : public nsAHttpSegmentReader, // For Active and Idle connections, this will be called when // mTCPKeepaliveTransitionTimer fires, to check if the TCP keepalive config // should move from short-lived (fast-detect) to long-lived. - static void UpdateTCPKeepalive(nsITimer *aTimer, void *aClosure); + static void UpdateTCPKeepalive(nsITimer* aTimer, void* aClosure); // When the connection is active this is called every second void ReadTimeoutTick(); @@ -206,8 +206,8 @@ class nsHttpConnection final : public nsAHttpSegmentReader, int64_t BytesWritten() { return mTotalBytesWritten; } // includes TLS int64_t ContentBytesWritten() { return mContentBytesWritten; } - void SetSecurityCallbacks(nsIInterfaceRequestor *aCallbacks); - void PrintDiagnostics(nsCString &log); + void SetSecurityCallbacks(nsIInterfaceRequestor* aCallbacks); + void PrintDiagnostics(nsCString& log); void SetTransactionCaps(uint32_t aCaps) { mTransactionCaps = aCaps; } @@ -215,10 +215,10 @@ class nsHttpConnection final : public nsAHttpSegmentReader, // non null HTTP transaction of any version. bool IsExperienced() { return mExperienced; } - static MOZ_MUST_USE nsresult MakeConnectString(nsAHttpTransaction *trans, - nsHttpRequestHead *request, - nsACString &result, bool h2ws); - void SetupSecondaryTLS(nsAHttpTransaction *aSpdyConnectTransaction = nullptr); + static MOZ_MUST_USE nsresult MakeConnectString(nsAHttpTransaction* trans, + nsHttpRequestHead* request, + nsACString& result, bool h2ws); + void SetupSecondaryTLS(nsAHttpTransaction* aSpdyConnectTransaction = nullptr); void SetInSpdyTunnel(bool arg); // Check active connections for traffic (or not). SPDY connections send a @@ -236,8 +236,8 @@ class nsHttpConnection final : public nsAHttpSegmentReader, // override of nsAHttpConnection virtual HttpVersion Version(); - bool TestJoinConnection(const nsACString &hostname, int32_t port); - bool JoinConnection(const nsACString &hostname, int32_t port); + bool TestJoinConnection(const nsACString& hostname, int32_t port); + bool JoinConnection(const nsACString& hostname, int32_t port); void SetFastOpenStatus(uint8_t tfoStatus); uint8_t GetFastOpenStatus() { return mFastOpenStatus; } @@ -265,7 +265,7 @@ class nsHttpConnection final : public nsAHttpSegmentReader, // called to cause the underlying socket to start speaking SSL MOZ_MUST_USE nsresult InitSSLParams(bool connectingToProxy, bool ProxyStartSSL); - MOZ_MUST_USE nsresult SetupNPNList(nsISSLSocketControl *ssl, uint32_t caps); + MOZ_MUST_USE nsresult SetupNPNList(nsISSLSocketControl* ssl, uint32_t caps); MOZ_MUST_USE nsresult OnTransactionDone(nsresult reason); MOZ_MUST_USE nsresult OnSocketWritable(); @@ -278,23 +278,23 @@ class nsHttpConnection final : public nsAHttpSegmentReader, // Makes certain the SSL handshake is complete and NPN negotiation // has had a chance to happen - MOZ_MUST_USE bool EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue, - uint32_t &aOut0RTTBytesWritten); + MOZ_MUST_USE bool EnsureNPNComplete(nsresult& aOut0RTTWriteHandshakeValue, + uint32_t& aOut0RTTBytesWritten); void SetupSSL(); // Start the Spdy transaction handler when NPN indicates spdy/* - void StartSpdy(nsISSLSocketControl *ssl, SpdyVersion versionLevel); + void StartSpdy(nsISSLSocketControl* ssl, SpdyVersion versionLevel); // Like the above, but do the bare minimum to do 0RTT data, so we can back // it out, if necessary void Start0RTTSpdy(SpdyVersion versionLevel); // Helpers for Start*Spdy - nsresult TryTakeSubTransactions(nsTArray > &list); + nsresult TryTakeSubTransactions(nsTArray >& list); nsresult MoveTransactionsToSpdy(nsresult status, - nsTArray > &list); + nsTArray >& list); // Directly Add a transaction to an active connection for SPDY - MOZ_MUST_USE nsresult AddTransaction(nsAHttpTransaction *, int32_t); + MOZ_MUST_USE nsresult AddTransaction(nsAHttpTransaction*, int32_t); // Used to set TCP keepalives for fast detection of dead connections during // an initial period, and slower detection for long-lived connections. @@ -406,7 +406,7 @@ class nsHttpConnection final : public nsAHttpSegmentReader, private: // For ForceSend() - static void ForceSendIO(nsITimer *aTimer, void *aClosure); + static void ForceSendIO(nsITimer* aTimer, void* aClosure); MOZ_MUST_USE nsresult MaybeForceSendIO(); bool mForceSendPending; nsCOMPtr mForceSendTimer; diff --git a/netwerk/protocol/http/nsHttpConnectionInfo.cpp b/netwerk/protocol/http/nsHttpConnectionInfo.cpp index c3a5b59c4c3a0..8bcf678dc1998 100644 --- a/netwerk/protocol/http/nsHttpConnectionInfo.cpp +++ b/netwerk/protocol/http/nsHttpConnectionInfo.cpp @@ -22,7 +22,7 @@ #include "nsNetCID.h" #include "prnetdb.h" -static nsresult SHA256(const char *aPlainText, nsAutoCString &aResult) { +static nsresult SHA256(const char* aPlainText, nsAutoCString& aResult) { nsresult rv; nsCOMPtr hasher = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv); @@ -32,7 +32,7 @@ static nsresult SHA256(const char *aPlainText, nsAutoCString &aResult) { } rv = hasher->Init(nsICryptoHash::SHA256); NS_ENSURE_SUCCESS(rv, rv); - rv = hasher->Update((unsigned char *)aPlainText, strlen(aPlainText)); + rv = hasher->Update((unsigned char*)aPlainText, strlen(aPlainText)); NS_ENSURE_SUCCESS(rv, rv); return hasher->Finish(false, aResult); } @@ -41,29 +41,29 @@ namespace mozilla { namespace net { nsHttpConnectionInfo::nsHttpConnectionInfo( - const nsACString &originHost, int32_t originPort, - const nsACString &npnToken, const nsACString &username, - const nsACString &topWindowOrigin, nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, bool endToEndSSL, bool isolated) + const nsACString& originHost, int32_t originPort, + const nsACString& npnToken, const nsACString& username, + const nsACString& topWindowOrigin, nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, bool endToEndSSL, bool isolated) : mRoutedPort(443), mIsolated(isolated), mLessThanTls13(false) { Init(originHost, originPort, npnToken, username, topWindowOrigin, proxyInfo, originAttributes, endToEndSSL); } nsHttpConnectionInfo::nsHttpConnectionInfo( - const nsACString &originHost, int32_t originPort, - const nsACString &npnToken, const nsACString &username, - const nsACString &topWindowOrigin, nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, bool endToEndSSL) + const nsACString& originHost, int32_t originPort, + const nsACString& npnToken, const nsACString& username, + const nsACString& topWindowOrigin, nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, bool endToEndSSL) : nsHttpConnectionInfo(originHost, originPort, npnToken, username, topWindowOrigin, proxyInfo, originAttributes, endToEndSSL, false) {} nsHttpConnectionInfo::nsHttpConnectionInfo( - const nsACString &originHost, int32_t originPort, - const nsACString &npnToken, const nsACString &username, - const nsACString &topWindowOrigin, nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, const nsACString &routedHost, + const nsACString& originHost, int32_t originPort, + const nsACString& npnToken, const nsACString& username, + const nsACString& topWindowOrigin, nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, const nsACString& routedHost, int32_t routedPort, bool isolated) : mIsolated(isolated), mLessThanTls13(false) { mEndToEndSSL = true; // so DefaultPort() works @@ -77,21 +77,21 @@ nsHttpConnectionInfo::nsHttpConnectionInfo( } nsHttpConnectionInfo::nsHttpConnectionInfo( - const nsACString &originHost, int32_t originPort, - const nsACString &npnToken, const nsACString &username, - const nsACString &topWindowOrigin, nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, const nsACString &routedHost, + const nsACString& originHost, int32_t originPort, + const nsACString& npnToken, const nsACString& username, + const nsACString& topWindowOrigin, nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, const nsACString& routedHost, int32_t routedPort) : nsHttpConnectionInfo(originHost, originPort, npnToken, username, topWindowOrigin, proxyInfo, originAttributes, routedHost, routedPort, false) {} -void nsHttpConnectionInfo::Init(const nsACString &host, int32_t port, - const nsACString &npnToken, - const nsACString &username, - const nsACString &topWindowOrigin, - nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, +void nsHttpConnectionInfo::Init(const nsACString& host, int32_t port, + const nsACString& npnToken, + const nsACString& username, + const nsACString& topWindowOrigin, + nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, bool e2eSSL) { LOG(("Init nsHttpConnectionInfo @%p\n", this)); @@ -134,7 +134,7 @@ void nsHttpConnectionInfo::BuildHashKey() { // where we know we use anonymous connection (LOAD_ANONYMOUS load flag) // - const char *keyHost; + const char* keyHost; int32_t keyPort; if (mUsingHttpProxy && !mUsingConnect) { @@ -204,7 +204,7 @@ void nsHttpConnectionInfo::BuildHashKey() { mHashKey.Append('['); mHashKey.Append(ProxyUsername()); mHashKey.Append(':'); - const char *password = ProxyPassword(); + const char* password = ProxyPassword(); if (strlen(password) > 0) { nsAutoCString digestedPassword; nsresult rv = SHA256(password, digestedPassword); @@ -257,7 +257,7 @@ void nsHttpConnectionInfo::BuildHashKey() { mHashKey.Append(originAttributes); } -void nsHttpConnectionInfo::SetOriginServer(const nsACString &host, +void nsHttpConnectionInfo::SetOriginServer(const nsACString& host, int32_t port) { mOrigin = host; mOriginPort = port == -1 ? DefaultPort() : port; @@ -293,7 +293,7 @@ already_AddRefed nsHttpConnectionInfo::Clone() const { return clone.forget(); } -void nsHttpConnectionInfo::CloneAsDirectRoute(nsHttpConnectionInfo **outCI) { +void nsHttpConnectionInfo::CloneAsDirectRoute(nsHttpConnectionInfo** outCI) { if (mRoutedHost.IsEmpty()) { RefPtr clone = Clone(); clone.forget(outCI); @@ -318,7 +318,7 @@ void nsHttpConnectionInfo::CloneAsDirectRoute(nsHttpConnectionInfo **outCI) { clone.forget(outCI); } -nsresult nsHttpConnectionInfo::CreateWildCard(nsHttpConnectionInfo **outParam) { +nsresult nsHttpConnectionInfo::CreateWildCard(nsHttpConnectionInfo** outParam) { // T???mozilla.org:443 (https:proxy.ducksong.com:3128) [specifc form] // TS??*:0 (https:proxy.ducksong.com:3128) [wildcard form] diff --git a/netwerk/protocol/http/nsHttpConnectionInfo.h b/netwerk/protocol/http/nsHttpConnectionInfo.h index d7e3317b93008..19bf1edfeac22 100644 --- a/netwerk/protocol/http/nsHttpConnectionInfo.h +++ b/netwerk/protocol/http/nsHttpConnectionInfo.h @@ -36,22 +36,22 @@ extern LazyLogModule gHttpLog; class nsHttpConnectionInfo final : public ARefBase { public: - nsHttpConnectionInfo(const nsACString &originHost, int32_t originPort, - const nsACString &npnToken, const nsACString &username, - const nsACString &topWindowOrigin, - nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, + nsHttpConnectionInfo(const nsACString& originHost, int32_t originPort, + const nsACString& npnToken, const nsACString& username, + const nsACString& topWindowOrigin, + nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, bool endToEndSSL = false); // this version must use TLS and you may supply separate // connection (aka routing) information than the authenticated // origin information - nsHttpConnectionInfo(const nsACString &originHost, int32_t originPort, - const nsACString &npnToken, const nsACString &username, - const nsACString &topWindowOrigin, - nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, - const nsACString &routedHost, int32_t routedPort); + nsHttpConnectionInfo(const nsACString& originHost, int32_t originPort, + const nsACString& npnToken, const nsACString& username, + const nsACString& topWindowOrigin, + nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, + const nsACString& routedHost, int32_t routedPort); private: virtual ~nsHttpConnectionInfo() { @@ -62,32 +62,32 @@ class nsHttpConnectionInfo final : public ARefBase { void BuildHashKey(); public: - const nsCString &HashKey() const { return mHashKey; } + const nsCString& HashKey() const { return mHashKey; } - const nsCString &GetOrigin() const { return mOrigin; } - const char *Origin() const { return mOrigin.get(); } + const nsCString& GetOrigin() const { return mOrigin; } + const char* Origin() const { return mOrigin.get(); } int32_t OriginPort() const { return mOriginPort; } - const nsCString &GetRoutedHost() const { return mRoutedHost; } - const char *RoutedHost() const { return mRoutedHost.get(); } + const nsCString& GetRoutedHost() const { return mRoutedHost; } + const char* RoutedHost() const { return mRoutedHost.get(); } int32_t RoutedPort() const { return mRoutedPort; } // OK to treat these as an infalible allocation already_AddRefed Clone() const; - void CloneAsDirectRoute(nsHttpConnectionInfo **outParam); - MOZ_MUST_USE nsresult CreateWildCard(nsHttpConnectionInfo **outParam); + void CloneAsDirectRoute(nsHttpConnectionInfo** outParam); + MOZ_MUST_USE nsresult CreateWildCard(nsHttpConnectionInfo** outParam); - const char *ProxyHost() const { + const char* ProxyHost() const { return mProxyInfo ? mProxyInfo->Host().get() : nullptr; } int32_t ProxyPort() const { return mProxyInfo ? mProxyInfo->Port() : -1; } - const char *ProxyType() const { + const char* ProxyType() const { return mProxyInfo ? mProxyInfo->Type() : nullptr; } - const char *ProxyUsername() const { + const char* ProxyUsername() const { return mProxyInfo ? mProxyInfo->Username().get() : nullptr; } - const char *ProxyPassword() const { + const char* ProxyPassword() const { return mProxyInfo ? mProxyInfo->Password().get() : nullptr; } @@ -98,12 +98,12 @@ class nsHttpConnectionInfo final : public ARefBase { // Note that we don't care about transparent proxies - // it doesn't matter if we're talking via socks or not, since // a request will end up at the same host. - bool Equals(const nsHttpConnectionInfo *info) { + bool Equals(const nsHttpConnectionInfo* info) { return mHashKey.Equals(info->HashKey()); } - const char *Username() const { return mUsername.get(); } - nsProxyInfo *ProxyInfo() const { return mProxyInfo; } + const char* Username() const { return mUsername.get(); } + nsProxyInfo* ProxyInfo() const { return mProxyInfo; } int32_t DefaultPort() const { return mEndToEndSSL ? NS_HTTPS_DEFAULT_PORT : NS_HTTP_DEFAULT_PORT; } @@ -148,11 +148,11 @@ class nsHttpConnectionInfo final : public ARefBase { void SetIPv6Disabled(bool aNoIPv6); bool GetIPv6Disabled() const { return mIPv6Disabled; } - const nsCString &GetNPNToken() { return mNPNToken; } - const nsCString &GetUsername() { return mUsername; } - const nsCString &GetTopWindowOrigin() { return mTopWindowOrigin; } + const nsCString& GetNPNToken() { return mNPNToken; } + const nsCString& GetUsername() { return mUsername; } + const nsCString& GetTopWindowOrigin() { return mTopWindowOrigin; } - const OriginAttributes &GetOriginAttributes() { return mOriginAttributes; } + const OriginAttributes& GetOriginAttributes() { return mOriginAttributes; } // Returns true for any kind of proxy (http, socks, https, etc..) bool UsingProxy(); @@ -184,25 +184,25 @@ class nsHttpConnectionInfo final : public ARefBase { private: // These constructor versions are intended to only be used from Clone(). - nsHttpConnectionInfo(const nsACString &originHost, int32_t originPort, - const nsACString &npnToken, const nsACString &username, - const nsACString &topWindowOrigin, - nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, + nsHttpConnectionInfo(const nsACString& originHost, int32_t originPort, + const nsACString& npnToken, const nsACString& username, + const nsACString& topWindowOrigin, + nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, bool endToEndSSL, bool isolated); - nsHttpConnectionInfo(const nsACString &originHost, int32_t originPort, - const nsACString &npnToken, const nsACString &username, - const nsACString &topWindowOrigin, - nsProxyInfo *proxyInfo, - const OriginAttributes &originAttributes, - const nsACString &routedHost, int32_t routedPort, + nsHttpConnectionInfo(const nsACString& originHost, int32_t originPort, + const nsACString& npnToken, const nsACString& username, + const nsACString& topWindowOrigin, + nsProxyInfo* proxyInfo, + const OriginAttributes& originAttributes, + const nsACString& routedHost, int32_t routedPort, bool isolated); - void Init(const nsACString &host, int32_t port, const nsACString &npnToken, - const nsACString &username, const nsACString &topWindowOrigin, - nsProxyInfo *proxyInfo, const OriginAttributes &originAttributes, + void Init(const nsACString& host, int32_t port, const nsACString& npnToken, + const nsACString& username, const nsACString& topWindowOrigin, + nsProxyInfo* proxyInfo, const OriginAttributes& originAttributes, bool EndToEndSSL); - void SetOriginServer(const nsACString &host, int32_t port); + void SetOriginServer(const nsACString& host, int32_t port); nsCString mOrigin; int32_t mOriginPort; diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 2d0ff92ca6b07..6b3f3acbdeeed 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -50,8 +50,8 @@ NS_IMPL_ISUPPORTS(nsHttpConnectionMgr, nsIObserver) // This function decides the transaction's order in the pending queue. // Given two transactions t1 and t2, returning true means that t2 is // more important than t1 and thus should be dispatched first. -static bool TransactionComparator(nsHttpTransaction *t1, - nsHttpTransaction *t2) { +static bool TransactionComparator(nsHttpTransaction* t1, + nsHttpTransaction* t2) { bool t1Blocking = t1->Caps() & (NS_HTTP_LOAD_AS_BLOCKING | NS_HTTP_LOAD_UNBLOCKED); bool t2Blocking = @@ -69,8 +69,8 @@ static bool TransactionComparator(nsHttpTransaction *t1, } void nsHttpConnectionMgr::InsertTransactionSorted( - nsTArray> &pendingQ, - nsHttpConnectionMgr::PendingTransactionInfo *pendingTransInfo, + nsTArray>& pendingQ, + nsHttpConnectionMgr::PendingTransactionInfo* pendingTransInfo, bool aInsertAsFirstForTheSamePriority /*= false*/) { // insert the transaction into the front of the queue based on following // rules: @@ -80,10 +80,10 @@ void nsHttpConnectionMgr::InsertTransactionSorted( // search in reverse order under the assumption that many of the // existing transactions will have the same priority (usually 0). - nsHttpTransaction *trans = pendingTransInfo->mTransaction; + nsHttpTransaction* trans = pendingTransInfo->mTransaction; for (int32_t i = pendingQ.Length() - 1; i >= 0; --i) { - nsHttpTransaction *t = pendingQ[i]->mTransaction; + nsHttpTransaction* t = pendingQ[i]->mTransaction; if (TransactionComparator(trans, t)) { if (ChaosMode::isActive(ChaosFeature::NetworkScheduling) || aInsertAsFirstForTheSamePriority) { @@ -245,8 +245,8 @@ nsresult nsHttpConnectionMgr::Shutdown() { class ConnEvent : public Runnable { public: - ConnEvent(nsHttpConnectionMgr *mgr, nsConnEventHandler handler, - int32_t iparam, ARefBase *vparam) + ConnEvent(nsHttpConnectionMgr* mgr, nsConnEventHandler handler, + int32_t iparam, ARefBase* vparam) : Runnable("net::ConnEvent"), mMgr(mgr), mHandler(handler), @@ -268,7 +268,7 @@ class ConnEvent : public Runnable { }; nsresult nsHttpConnectionMgr::PostEvent(nsConnEventHandler handler, - int32_t iparam, ARefBase *vparam) { + int32_t iparam, ARefBase* vparam) { Unused << EnsureSocketThreadTarget(); ReentrantMonitorAutoEnter mon(mReentrantMonitor); @@ -336,8 +336,8 @@ void nsHttpConnectionMgr::ConditionallyStopTimeoutTick() { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpConnectionMgr::Observe(nsISupports *subject, const char *topic, - const char16_t *data) { +nsHttpConnectionMgr::Observe(nsISupports* subject, const char* topic, + const char16_t* data) { LOG(("nsHttpConnectionMgr::Observe [topic=\"%s\"]\n", topic)); if (0 == strcmp(topic, NS_TIMER_CALLBACK_TOPIC)) { @@ -364,7 +364,7 @@ nsHttpConnectionMgr::Observe(nsISupports *subject, const char *topic, //----------------------------------------------------------------------------- -nsresult nsHttpConnectionMgr::AddTransaction(nsHttpTransaction *trans, +nsresult nsHttpConnectionMgr::AddTransaction(nsHttpTransaction* trans, int32_t priority) { LOG(("nsHttpConnectionMgr::AddTransaction [trans=%p %d]\n", trans, priority)); return PostEvent(&nsHttpConnectionMgr::OnMsgNewTransaction, priority, trans); @@ -372,8 +372,8 @@ nsresult nsHttpConnectionMgr::AddTransaction(nsHttpTransaction *trans, class NewTransactionData : public ARefBase { public: - NewTransactionData(nsHttpTransaction *trans, int32_t priority, - nsHttpTransaction *transWithStickyConn) + NewTransactionData(nsHttpTransaction* trans, int32_t priority, + nsHttpTransaction* transWithStickyConn) : mTrans(trans), mPriority(priority), mTransWithStickyConn(transWithStickyConn) {} @@ -389,8 +389,8 @@ class NewTransactionData : public ARefBase { }; nsresult nsHttpConnectionMgr::AddTransactionWithStickyConn( - nsHttpTransaction *trans, int32_t priority, - nsHttpTransaction *transWithStickyConn) { + nsHttpTransaction* trans, int32_t priority, + nsHttpTransaction* transWithStickyConn) { LOG( ("nsHttpConnectionMgr::AddTransactionWithStickyConn " "[trans=%p %d transWithStickyConn=%p]\n", @@ -401,7 +401,7 @@ nsresult nsHttpConnectionMgr::AddTransactionWithStickyConn( data); } -nsresult nsHttpConnectionMgr::RescheduleTransaction(nsHttpTransaction *trans, +nsresult nsHttpConnectionMgr::RescheduleTransaction(nsHttpTransaction* trans, int32_t priority) { LOG(("nsHttpConnectionMgr::RescheduleTransaction [trans=%p %d]\n", trans, priority)); @@ -410,7 +410,7 @@ nsresult nsHttpConnectionMgr::RescheduleTransaction(nsHttpTransaction *trans, } void nsHttpConnectionMgr::UpdateClassOfServiceOnTransaction( - nsHttpTransaction *trans, uint32_t classOfService) { + nsHttpTransaction* trans, uint32_t classOfService) { LOG( ("nsHttpConnectionMgr::UpdateClassOfServiceOnTransaction [trans=%p " "classOfService=%" PRIu32 "]\n", @@ -420,7 +420,7 @@ void nsHttpConnectionMgr::UpdateClassOfServiceOnTransaction( static_cast(classOfService), trans); } -nsresult nsHttpConnectionMgr::CancelTransaction(nsHttpTransaction *trans, +nsresult nsHttpConnectionMgr::CancelTransaction(nsHttpTransaction* trans, nsresult reason) { LOG(("nsHttpConnectionMgr::CancelTransaction [trans=%p reason=%" PRIx32 "]\n", trans, static_cast(reason))); @@ -447,7 +447,7 @@ nsresult nsHttpConnectionMgr::VerifyTraffic() { } nsresult nsHttpConnectionMgr::DoShiftReloadConnectionCleanup( - nsHttpConnectionInfo *aCI) { + nsHttpConnectionInfo* aCI) { return PostEvent(&nsHttpConnectionMgr::OnMsgDoShiftReloadConnectionCleanup, 0, aCI); } @@ -478,8 +478,8 @@ class SpeculativeConnectArgs : public ARefBase { }; nsresult nsHttpConnectionMgr::SpeculativeConnect( - nsHttpConnectionInfo *ci, nsIInterfaceRequestor *callbacks, uint32_t caps, - NullHttpTransaction *nullTransaction) { + nsHttpConnectionInfo* ci, nsIInterfaceRequestor* callbacks, uint32_t caps, + NullHttpTransaction* nullTransaction) { MOZ_ASSERT(NS_IsMainThread(), "nsHttpConnectionMgr::SpeculativeConnect called off main thread!"); @@ -532,7 +532,7 @@ nsresult nsHttpConnectionMgr::SpeculativeConnect( return PostEvent(&nsHttpConnectionMgr::OnMsgSpeculativeConnect, 0, args); } -nsresult nsHttpConnectionMgr::GetSocketThreadTarget(nsIEventTarget **target) { +nsresult nsHttpConnectionMgr::GetSocketThreadTarget(nsIEventTarget** target) { Unused << EnsureSocketThreadTarget(); ReentrantMonitorAutoEnter mon(mReentrantMonitor); @@ -541,7 +541,7 @@ nsresult nsHttpConnectionMgr::GetSocketThreadTarget(nsIEventTarget **target) { return NS_OK; } -nsresult nsHttpConnectionMgr::ReclaimConnection(nsHttpConnection *conn) { +nsresult nsHttpConnectionMgr::ReclaimConnection(nsHttpConnection* conn) { LOG(("nsHttpConnectionMgr::ReclaimConnection [conn=%p]\n", conn)); return PostEvent(&nsHttpConnectionMgr::OnMsgReclaimConnection, 0, conn); } @@ -550,8 +550,8 @@ nsresult nsHttpConnectionMgr::ReclaimConnection(nsHttpConnection *conn) { // threads to complete an HTTP upgrade. class nsCompleteUpgradeData : public ARefBase { public: - nsCompleteUpgradeData(nsHttpTransaction *aTrans, - nsIHttpUpgradeListener *aListener, bool aJsWrapped) + nsCompleteUpgradeData(nsHttpTransaction* aTrans, + nsIHttpUpgradeListener* aListener, bool aJsWrapped) : mTrans(aTrans), mUpgradeListener(aListener), mJsWrapped(aJsWrapped) {} NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsCompleteUpgradeData, override) @@ -570,7 +570,7 @@ class nsCompleteUpgradeData : public ARefBase { }; nsresult nsHttpConnectionMgr::CompleteUpgrade( - nsHttpTransaction *aTrans, nsIHttpUpgradeListener *aUpgradeListener) { + nsHttpTransaction* aTrans, nsIHttpUpgradeListener* aUpgradeListener) { // test if aUpgradeListener is a wrapped JsObject nsCOMPtr wrapper = do_QueryInterface(aUpgradeListener); @@ -587,7 +587,7 @@ nsresult nsHttpConnectionMgr::UpdateParam(nsParamName name, uint16_t value) { static_cast(param), nullptr); } -nsresult nsHttpConnectionMgr::ProcessPendingQ(nsHttpConnectionInfo *ci) { +nsresult nsHttpConnectionMgr::ProcessPendingQ(nsHttpConnectionInfo* ci) { LOG(("nsHttpConnectionMgr::ProcessPendingQ [ci=%s]\n", ci->HashKey().get())); return PostEvent(&nsHttpConnectionMgr::OnMsgProcessPendingQ, 0, ci); } @@ -598,13 +598,13 @@ nsresult nsHttpConnectionMgr::ProcessPendingQ() { } void nsHttpConnectionMgr::OnMsgUpdateRequestTokenBucket(int32_t, - ARefBase *param) { - EventTokenBucket *tokenBucket = static_cast(param); + ARefBase* param) { + EventTokenBucket* tokenBucket = static_cast(param); gHttpHandler->SetRequestTokenBucket(tokenBucket); } nsresult nsHttpConnectionMgr::UpdateRequestTokenBucket( - EventTokenBucket *aBucket) { + EventTokenBucket* aBucket) { // Call From main thread when a new EventTokenBucket has been made in order // to post the new value to the socket thread. return PostEvent(&nsHttpConnectionMgr::OnMsgUpdateRequestTokenBucket, 0, @@ -627,7 +627,7 @@ nsresult nsHttpConnectionMgr::ClearConnectionHistory() { return NS_OK; } -nsresult nsHttpConnectionMgr::CloseIdleConnection(nsHttpConnection *conn) { +nsresult nsHttpConnectionMgr::CloseIdleConnection(nsHttpConnection* conn) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::CloseIdleConnection %p conn=%p", this, conn)); @@ -635,7 +635,7 @@ nsresult nsHttpConnectionMgr::CloseIdleConnection(nsHttpConnection *conn) { return NS_ERROR_UNEXPECTED; } - nsConnectionEntry *ent = mCT.GetWeak(conn->ConnectionInfo()->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(conn->ConnectionInfo()->HashKey()); RefPtr deleteProtector(conn); if (!ent || !ent->mIdleConns.RemoveElement(conn)) return NS_ERROR_UNEXPECTED; @@ -646,7 +646,7 @@ nsresult nsHttpConnectionMgr::CloseIdleConnection(nsHttpConnection *conn) { return NS_OK; } -nsresult nsHttpConnectionMgr::RemoveIdleConnection(nsHttpConnection *conn) { +nsresult nsHttpConnectionMgr::RemoveIdleConnection(nsHttpConnection* conn) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::RemoveIdleConnection %p conn=%p", this, conn)); @@ -655,7 +655,7 @@ nsresult nsHttpConnectionMgr::RemoveIdleConnection(nsHttpConnection *conn) { return NS_ERROR_UNEXPECTED; } - nsConnectionEntry *ent = mCT.GetWeak(conn->ConnectionInfo()->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(conn->ConnectionInfo()->HashKey()); if (!ent || !ent->mIdleConns.RemoveElement(conn)) { return NS_ERROR_UNEXPECTED; @@ -666,13 +666,13 @@ nsresult nsHttpConnectionMgr::RemoveIdleConnection(nsHttpConnection *conn) { return NS_OK; } -nsHttpConnection *nsHttpConnectionMgr::FindCoalescableConnectionByHashKey( - nsConnectionEntry *ent, const nsCString &key, bool justKidding) { +nsHttpConnection* nsHttpConnectionMgr::FindCoalescableConnectionByHashKey( + nsConnectionEntry* ent, const nsCString& key, bool justKidding) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(ent->mConnInfo); - nsHttpConnectionInfo *ci = ent->mConnInfo; + nsHttpConnectionInfo* ci = ent->mConnInfo; - nsTArray *listOfWeakConns = mCoalescingHash.Get(key); + nsTArray* listOfWeakConns = mCoalescingHash.Get(key); if (!listOfWeakConns) { return nullptr; } @@ -729,9 +729,9 @@ nsHttpConnection *nsHttpConnectionMgr::FindCoalescableConnectionByHashKey( return nullptr; } -static void BuildOriginFrameHashKey(nsACString &newKey, - nsHttpConnectionInfo *ci, - const nsACString &host, int32_t port) { +static void BuildOriginFrameHashKey(nsACString& newKey, + nsHttpConnectionInfo* ci, + const nsACString& host, int32_t port) { newKey.Assign(host); if (ci->GetAnonymous()) { newKey.AppendLiteral("~A:"); @@ -746,16 +746,16 @@ static void BuildOriginFrameHashKey(nsACString &newKey, newKey.AppendLiteral("]viaORIGIN.FRAME"); } -nsHttpConnection *nsHttpConnectionMgr::FindCoalescableConnection( - nsConnectionEntry *ent, bool justKidding) { +nsHttpConnection* nsHttpConnectionMgr::FindCoalescableConnection( + nsConnectionEntry* ent, bool justKidding) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(ent->mConnInfo); - nsHttpConnectionInfo *ci = ent->mConnInfo; + nsHttpConnectionInfo* ci = ent->mConnInfo; LOG(("FindCoalescableConnection %s\n", ci->HashKey().get())); // First try and look it up by origin frame nsCString newKey; BuildOriginFrameHashKey(newKey, ci, ci->GetOrigin(), ci->OriginPort()); - nsHttpConnection *conn = + nsHttpConnection* conn = FindCoalescableConnectionByHashKey(ent, newKey, justKidding); if (conn) { LOG(("FindCoalescableConnection(%s) match conn %p on frame key %s\n", @@ -781,15 +781,15 @@ nsHttpConnection *nsHttpConnectionMgr::FindCoalescableConnection( return nullptr; } -void nsHttpConnectionMgr::UpdateCoalescingForNewConn(nsHttpConnection *newConn, - nsConnectionEntry *ent) { +void nsHttpConnectionMgr::UpdateCoalescingForNewConn(nsHttpConnection* newConn, + nsConnectionEntry* ent) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(newConn); MOZ_ASSERT(newConn->ConnectionInfo()); MOZ_ASSERT(ent); MOZ_ASSERT(mCT.GetWeak(newConn->ConnectionInfo()->HashKey()) == ent); - nsHttpConnection *existingConn = FindCoalescableConnection(ent, true); + nsHttpConnection* existingConn = FindCoalescableConnection(ent, true); if (existingConn) { LOG( ("UpdateCoalescingForNewConn() found existing active conn that could " @@ -812,7 +812,7 @@ void nsHttpConnectionMgr::UpdateCoalescingForNewConn(nsHttpConnection *newConn, "UpdateCoalescingForNewConn() registering newConn %p %s under key %s\n", newConn, newConn->ConnectionInfo()->HashKey().get(), ent->mCoalescingKeys[i].get())); - nsTArray *listOfWeakConns = + nsTArray* listOfWeakConns = mCoalescingHash.Get(ent->mCoalescingKeys[i]); if (!listOfWeakConns) { LOG(("UpdateCoalescingForNewConn() need new list element\n")); @@ -820,7 +820,7 @@ void nsHttpConnectionMgr::UpdateCoalescingForNewConn(nsHttpConnection *newConn, mCoalescingHash.Put(ent->mCoalescingKeys[i], listOfWeakConns); } listOfWeakConns->AppendElement( - do_GetWeakReference(static_cast(newConn))); + do_GetWeakReference(static_cast(newConn))); } // Cancel any other pending connections - their associated transactions @@ -840,7 +840,7 @@ void nsHttpConnectionMgr::UpdateCoalescingForNewConn(nsHttpConnection *newConn, // This probably happened due to the parallel connection algorithm // that is used only before the host is known to speak h2. for (uint32_t index = 0; index < ent->mActiveConns.Length(); ++index) { - nsHttpConnection *otherConn = ent->mActiveConns[index]; + nsHttpConnection* otherConn = ent->mActiveConns[index]; if (otherConn != newConn) { LOG( ("UpdateCoalescingForNewConn() shutting down old connection (%p) " @@ -871,13 +871,13 @@ void nsHttpConnectionMgr::UpdateCoalescingForNewConn(nsHttpConnection *newConn, // connection is then updated to indicate whether or not we want to use // spdy with that host and update the coalescing hash // entries used for de-sharding hostsnames. -void nsHttpConnectionMgr::ReportSpdyConnection(nsHttpConnection *conn, +void nsHttpConnectionMgr::ReportSpdyConnection(nsHttpConnection* conn, bool usingSpdy) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); if (!conn->ConnectionInfo()) { return; } - nsConnectionEntry *ent = mCT.GetWeak(conn->ConnectionInfo()->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(conn->ConnectionInfo()->HashKey()); if (!ent || !usingSpdy) { return; } @@ -912,11 +912,11 @@ void nsHttpConnectionMgr::ReportSpdyConnection(nsHttpConnection *conn, //----------------------------------------------------------------------------- bool nsHttpConnectionMgr::DispatchPendingQ( - nsTArray> &pendingQ, - nsConnectionEntry *ent, bool considerAll) { + nsTArray>& pendingQ, + nsConnectionEntry* ent, bool considerAll) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - PendingTransactionInfo *pendingTransInfo = nullptr; + PendingTransactionInfo* pendingTransInfo = nullptr; nsresult rv; bool dispatchedSuccessfully = false; @@ -1009,7 +1009,7 @@ bool nsHttpConnectionMgr::DispatchPendingQ( } uint32_t nsHttpConnectionMgr::TotalActiveConnections( - nsConnectionEntry *ent) const { + nsConnectionEntry* ent) const { // Add in the in-progress tcp connections, we will assume they are // keepalive enabled. // Exclude half-open's that has already created a usable connection. @@ -1019,7 +1019,7 @@ uint32_t nsHttpConnectionMgr::TotalActiveConnections( } uint32_t nsHttpConnectionMgr::MaxPersistConnections( - nsConnectionEntry *ent) const { + nsConnectionEntry* ent) const { if (ent->mConnInfo->UsingHttpProxy() && !ent->mConnInfo->UsingConnect()) { return static_cast(mMaxPersistConnsPerProxy); } @@ -1028,7 +1028,7 @@ uint32_t nsHttpConnectionMgr::MaxPersistConnections( } void nsHttpConnectionMgr::PreparePendingQForDispatching( - nsConnectionEntry *ent, nsTArray> &pendingQ, + nsConnectionEntry* ent, nsTArray>& pendingQ, bool considerAll) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -1111,7 +1111,7 @@ void nsHttpConnectionMgr::PreparePendingQForDispatching( pendingQ.AppendElements(std::move(remainingPendingQ)); } -bool nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent, +bool nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry* ent, bool considerAll) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -1125,36 +1125,36 @@ bool nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent, if (LOG_ENABLED()) { LOG(("urgent queue [")); - for (const auto &info : ent->mUrgentStartQ) { + for (const auto& info : ent->mUrgentStartQ) { LOG((" %p", info->mTransaction.get())); } for (auto it = ent->mPendingTransactionTable.Iter(); !it.Done(); it.Next()) { LOG(("] window id = %" PRIx64 " queue [", it.Key())); - for (const auto &info : *it.UserData()) { + for (const auto& info : *it.UserData()) { LOG((" %p", info->mTransaction.get())); } } LOG(("] active urgent conns [")); - for (nsHttpConnection *conn : ent->mActiveConns) { + for (nsHttpConnection* conn : ent->mActiveConns) { if (conn->IsUrgentStartPreferred()) { LOG((" %p", conn)); } } LOG(("] active regular conns [")); - for (nsHttpConnection *conn : ent->mActiveConns) { + for (nsHttpConnection* conn : ent->mActiveConns) { if (!conn->IsUrgentStartPreferred()) { LOG((" %p", conn)); } } LOG(("] idle urgent conns [")); - for (nsHttpConnection *conn : ent->mIdleConns) { + for (nsHttpConnection* conn : ent->mIdleConns) { if (conn->IsUrgentStartPreferred()) { LOG((" %p", conn)); } } LOG(("] idle regular conns [")); - for (nsHttpConnection *conn : ent->mIdleConns) { + for (nsHttpConnection* conn : ent->mIdleConns) { if (!conn->IsUrgentStartPreferred()) { LOG((" %p", conn)); } @@ -1191,7 +1191,7 @@ bool nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent, // Put the leftovers into connection entry, in the same order as they // were before to keep the natural ordering. - for (const auto &transactionInfo : Reversed(pendingQ)) { + for (const auto& transactionInfo : Reversed(pendingQ)) { ent->InsertTransaction(transactionInfo, true); } @@ -1203,10 +1203,10 @@ bool nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent, return dispatchedSuccessfully; } -bool nsHttpConnectionMgr::ProcessPendingQForEntry(nsHttpConnectionInfo *ci) { +bool nsHttpConnectionMgr::ProcessPendingQForEntry(nsHttpConnectionInfo* ci) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsConnectionEntry *ent = mCT.GetWeak(ci->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(ci->HashKey()); if (ent) return ProcessPendingQForEntry(ent, false); return false; } @@ -1216,9 +1216,9 @@ bool nsHttpConnectionMgr::ProcessPendingQForEntry(nsHttpConnectionInfo *ci) { // (1) at max-connections // (2) keep-alive enabled and at max-persistent-connections-per-server/proxy // (3) keep-alive disabled and at max-connections-per-server -bool nsHttpConnectionMgr::AtActiveConnectionLimit(nsConnectionEntry *ent, +bool nsHttpConnectionMgr::AtActiveConnectionLimit(nsConnectionEntry* ent, uint32_t caps) { - nsHttpConnectionInfo *ci = ent->mConnInfo; + nsHttpConnectionInfo* ci = ent->mConnInfo; uint32_t totalCount = TotalActiveConnections(ent); uint32_t maxPersistConns = MaxPersistConnections(ent); @@ -1260,7 +1260,7 @@ bool nsHttpConnectionMgr::AtActiveConnectionLimit(nsConnectionEntry *ent, return result; } -void nsHttpConnectionMgr::ClosePersistentConnections(nsConnectionEntry *ent) { +void nsHttpConnectionMgr::ClosePersistentConnections(nsConnectionEntry* ent) { LOG(("nsHttpConnectionMgr::ClosePersistentConnections [ci=%s]\n", ent->mConnInfo->HashKey().get())); while (ent->mIdleConns.Length()) { @@ -1279,7 +1279,7 @@ void nsHttpConnectionMgr::ClosePersistentConnections(nsConnectionEntry *ent) { } } -bool nsHttpConnectionMgr::RestrictConnections(nsConnectionEntry *ent) { +bool nsHttpConnectionMgr::RestrictConnections(nsConnectionEntry* ent) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); if (ent->AvailableForDispatchNow()) { @@ -1316,7 +1316,7 @@ bool nsHttpConnectionMgr::RestrictConnections(nsConnectionEntry *ent) { if (ent->mUsingSpdy && ent->mActiveConns.Length()) { bool confirmedRestrict = false; for (uint32_t index = 0; index < ent->mActiveConns.Length(); ++index) { - nsHttpConnection *conn = ent->mActiveConns[index]; + nsHttpConnection* conn = ent->mActiveConns[index]; if (!conn->ReportedNPN() || conn->CanDirectlyActivate()) { confirmedRestrict = true; break; @@ -1338,8 +1338,8 @@ bool nsHttpConnectionMgr::RestrictConnections(nsConnectionEntry *ent) { // ephemeral limits // returns other NS_ERROR on hard failure conditions nsresult nsHttpConnectionMgr::MakeNewConnection( - nsConnectionEntry *ent, PendingTransactionInfo *pendingTransInfo) { - nsHttpTransaction *trans = pendingTransInfo->mTransaction; + nsConnectionEntry* ent, PendingTransactionInfo* pendingTransInfo) { + nsHttpTransaction* trans = pendingTransInfo->mTransaction; LOG(("nsHttpConnectionMgr::MakeNewConnection %p ent=%p trans=%p", this, ent, trans)); @@ -1359,7 +1359,7 @@ nsresult nsHttpConnectionMgr::MakeNewConnection( "Found a speculative or a free-to-use half open connection\n", ent->mConnInfo->HashKey().get())); pendingTransInfo->mHalfOpen = do_GetWeakReference( - static_cast(ent->mHalfOpens[i])); + static_cast(ent->mHalfOpens[i])); // return OK because we have essentially opened a new connection // by converting a speculative half-open to general use return NS_OK; @@ -1372,8 +1372,8 @@ nsresult nsHttpConnectionMgr::MakeNewConnection( if (trans->Caps() & NS_HTTP_ALLOW_KEEPALIVE) { uint32_t activeLength = ent->mActiveConns.Length(); for (uint32_t i = 0; i < activeLength; i++) { - nsAHttpTransaction *activeTrans = ent->mActiveConns[i]->Transaction(); - NullHttpTransaction *nullTrans = + nsAHttpTransaction* activeTrans = ent->mActiveConns[i]->Transaction(); + NullHttpTransaction* nullTrans = activeTrans ? activeTrans->QueryNullTransaction() : nullptr; if (nullTrans && nullTrans->Claim()) { LOG( @@ -1381,7 +1381,7 @@ nsresult nsHttpConnectionMgr::MakeNewConnection( "Claiming a null transaction for later use\n", ent->mConnInfo->HashKey().get())); pendingTransInfo->mActiveConn = do_GetWeakReference( - static_cast(ent->mActiveConns[i])); + static_cast(ent->mActiveConns[i])); return NS_OK; } } @@ -1436,7 +1436,7 @@ nsresult nsHttpConnectionMgr::MakeNewConnection( } for (uint32_t index = 0; index < entry->mActiveConns.Length(); ++index) { - nsHttpConnection *conn = entry->mActiveConns[index]; + nsHttpConnection* conn = entry->mActiveConns[index]; if (conn->UsingSpdy() && conn->CanReuse()) { conn->DontReuse(); // Stop on <= (particularly =) because this dontreuse @@ -1478,11 +1478,11 @@ nsresult nsHttpConnectionMgr::MakeNewConnection( // returns other ERROR when transaction has a hard failure and should // not remain in the pending queue nsresult nsHttpConnectionMgr::TryDispatchTransaction( - nsConnectionEntry *ent, bool onlyReusedConnection, - PendingTransactionInfo *pendingTransInfo) { + nsConnectionEntry* ent, bool onlyReusedConnection, + PendingTransactionInfo* pendingTransInfo) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpTransaction *trans = pendingTransInfo->mTransaction; + nsHttpTransaction* trans = pendingTransInfo->mTransaction; LOG( ("nsHttpConnectionMgr::TryDispatchTransaction without conn " @@ -1546,7 +1546,7 @@ nsresult nsHttpConnectionMgr::TryDispatchTransaction( // explicitly marked as unblocked. if (!(caps & NS_HTTP_LOAD_AS_BLOCKING)) { if (!(caps & NS_HTTP_LOAD_UNBLOCKED)) { - nsIRequestContext *requestContext = trans->RequestContext(); + nsIRequestContext* requestContext = trans->RequestContext(); if (requestContext) { uint32_t blockers = 0; if (NS_SUCCEEDED( @@ -1664,11 +1664,11 @@ nsresult nsHttpConnectionMgr::TryDispatchTransaction( } nsresult nsHttpConnectionMgr::TryDispatchTransactionOnIdleConn( - nsConnectionEntry *ent, PendingTransactionInfo *pendingTransInfo, - bool respectUrgency, bool *allUrgent) { + nsConnectionEntry* ent, PendingTransactionInfo* pendingTransInfo, + bool respectUrgency, bool* allUrgent) { bool onlyUrgent = !!ent->mIdleConns.Length(); - nsHttpTransaction *trans = pendingTransInfo->mTransaction; + nsHttpTransaction* trans = pendingTransInfo->mTransaction; bool urgentTrans = trans->ClassOfService() & nsIClassOfService::UrgentStart; LOG( @@ -1728,9 +1728,9 @@ nsresult nsHttpConnectionMgr::TryDispatchTransactionOnIdleConn( return NS_ERROR_NOT_AVAILABLE; } -nsresult nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry *ent, - nsHttpTransaction *trans, - nsHttpConnection *conn) { +nsresult nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry* ent, + nsHttpTransaction* trans, + nsHttpConnection* conn) { uint32_t caps = trans->Caps(); int32_t priority = trans->Priority(); nsresult rv; @@ -1788,7 +1788,7 @@ class ConnectionHandle : public nsAHttpConnection { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPCONNECTION(mConn) - explicit ConnectionHandle(nsHttpConnection *conn) : mConn(conn) {} + explicit ConnectionHandle(nsHttpConnection* conn) : mConn(conn) {} void Reset() { mConn = nullptr; } private: @@ -1796,8 +1796,8 @@ class ConnectionHandle : public nsAHttpConnection { RefPtr mConn; }; -nsAHttpConnection *nsHttpConnectionMgr::MakeConnectionHandle( - nsHttpConnection *aWrapped) { +nsAHttpConnection* nsHttpConnectionMgr::MakeConnectionHandle( + nsHttpConnection* aWrapped) { return new ConnectionHandle(aWrapped); } @@ -1819,8 +1819,8 @@ NS_IMPL_ISUPPORTS0(ConnectionHandle) // HTTP/1 yet as multiplexing onto an existing SPDY session requires a // concrete nsHttpTransaction nsresult nsHttpConnectionMgr::DispatchAbstractTransaction( - nsConnectionEntry *ent, nsAHttpTransaction *aTrans, uint32_t caps, - nsHttpConnection *conn, int32_t priority) { + nsConnectionEntry* ent, nsAHttpTransaction* aTrans, uint32_t caps, + nsHttpConnection* conn, int32_t priority) { MOZ_ASSERT(ent); nsresult rv; @@ -1854,7 +1854,7 @@ nsresult nsHttpConnectionMgr::DispatchAbstractTransaction( return rv; } -void nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry *ent) { +void nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry* ent) { enum { PROXY_NONE = 1, PROXY_HTTP = 2, PROXY_SOCKS = 3, PROXY_HTTPS = 4 }; if (!ent->mConnInfo->UsingProxy()) @@ -1867,7 +1867,7 @@ void nsHttpConnectionMgr::ReportProxyTelemetry(nsConnectionEntry *ent) { Telemetry::Accumulate(Telemetry::HTTP_PROXY_TYPE, PROXY_SOCKS); } -nsresult nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) { +nsresult nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction* trans) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); // since "adds" and "cancels" are processed asynchronously and because @@ -1881,7 +1881,7 @@ nsresult nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) { trans->SetPendingTime(); - Http2PushedStream *pushedStream = trans->GetPushedStream(); + Http2PushedStream* pushedStream = trans->GetPushedStream(); if (pushedStream) { LOG((" ProcessNewTransaction %p tied to h2 session push %p\n", trans, pushedStream->Session())); @@ -1892,10 +1892,10 @@ nsresult nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) { } nsresult rv = NS_OK; - nsHttpConnectionInfo *ci = trans->ConnectionInfo(); + nsHttpConnectionInfo* ci = trans->ConnectionInfo(); MOZ_ASSERT(ci); - nsConnectionEntry *ent = + nsConnectionEntry* ent = GetOrCreateConnectionEntry(ci, !!trans->TunnelProvider()); MOZ_ASSERT(ent); @@ -1905,7 +1905,7 @@ nsresult nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) { // If so, then we can just use it directly by transferring its reference // to the new connection variable instead of searching for a new one - nsAHttpConnection *wrappedConnection = trans->Connection(); + nsAHttpConnection* wrappedConnection = trans->Connection(); RefPtr conn; RefPtr pendingTransInfo; if (wrappedConnection) conn = wrappedConnection->TakeHttpConnection(); @@ -1974,14 +1974,14 @@ nsresult nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans) { return rv; } -void nsHttpConnectionMgr::AddActiveConn(nsHttpConnection *conn, - nsConnectionEntry *ent) { +void nsHttpConnectionMgr::AddActiveConn(nsHttpConnection* conn, + nsConnectionEntry* ent) { ent->mActiveConns.AppendElement(conn); mNumActiveConns++; ActivateTimeoutTick(); } -void nsHttpConnectionMgr::DecrementActiveConnCount(nsHttpConnection *conn) { +void nsHttpConnectionMgr::DecrementActiveConnCount(nsHttpConnection* conn) { mNumActiveConns--; if (conn->EverUsedSpdy()) mNumSpdyActiveConns--; } @@ -1997,7 +1997,7 @@ void nsHttpConnectionMgr::RecvdConnect() { } void nsHttpConnectionMgr::ReleaseClaimedSockets( - nsConnectionEntry *ent, PendingTransactionInfo *pendingTransInfo) { + nsConnectionEntry* ent, PendingTransactionInfo* pendingTransInfo) { if (pendingTransInfo->mHalfOpen) { RefPtr halfOpen = do_QueryReferent(pendingTransInfo->mHalfOpen); @@ -2014,7 +2014,7 @@ void nsHttpConnectionMgr::ReleaseClaimedSockets( do_QueryReferent(pendingTransInfo->mActiveConn); if (activeConn && activeConn->Transaction() && activeConn->Transaction()->IsNullTransaction()) { - NullHttpTransaction *nullTrans = + NullHttpTransaction* nullTrans = activeConn->Transaction()->QueryNullTransaction(); nullTrans->Unclaim(); LOG(("nsHttpConnectionMgr::ReleaseClaimedSockets - mark %p unclaimed.", @@ -2024,9 +2024,9 @@ void nsHttpConnectionMgr::ReleaseClaimedSockets( } nsresult nsHttpConnectionMgr::CreateTransport( - nsConnectionEntry *ent, nsAHttpTransaction *trans, uint32_t caps, + nsConnectionEntry* ent, nsAHttpTransaction* trans, uint32_t caps, bool speculative, bool isFromPredictor, bool urgentStart, bool allow1918, - PendingTransactionInfo *pendingTransInfo) { + PendingTransactionInfo* pendingTransInfo) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT((speculative && !pendingTransInfo) || (!speculative && pendingTransInfo)); @@ -2045,7 +2045,7 @@ nsresult nsHttpConnectionMgr::CreateTransport( if (pendingTransInfo) { pendingTransInfo->mHalfOpen = - do_GetWeakReference(static_cast(sock)); + do_GetWeakReference(static_cast(sock)); DebugOnly claimed = sock->Claim(); MOZ_ASSERT(claimed); } @@ -2056,8 +2056,8 @@ nsresult nsHttpConnectionMgr::CreateTransport( } void nsHttpConnectionMgr::DispatchSpdyPendingQ( - nsTArray> &pendingQ, nsConnectionEntry *ent, - nsHttpConnection *conn) { + nsTArray>& pendingQ, nsConnectionEntry* ent, + nsHttpConnection* conn) { if (pendingQ.Length() == 0) { return; } @@ -2067,7 +2067,7 @@ void nsHttpConnectionMgr::DispatchSpdyPendingQ( // Dispatch all the transactions we can for (index = 0; index < pendingQ.Length() && conn->CanDirectlyActivate(); ++index) { - PendingTransactionInfo *pendingTransInfo = pendingQ[index]; + PendingTransactionInfo* pendingTransInfo = pendingQ[index]; if (!(pendingTransInfo->mTransaction->Caps() & NS_HTTP_ALLOW_KEEPALIVE) || pendingTransInfo->mTransaction->Caps() & NS_HTTP_DISALLOW_SPDY) { @@ -2091,7 +2091,7 @@ void nsHttpConnectionMgr::DispatchSpdyPendingQ( // Slurp up the rest of the pending queue into our leftovers bucket (we // might have some left if conn->CanDirectlyActivate returned false) for (; index < pendingQ.Length(); ++index) { - PendingTransactionInfo *pendingTransInfo = pendingQ[index]; + PendingTransactionInfo* pendingTransInfo = pendingQ[index]; leftovers.AppendElement(pendingTransInfo); } @@ -2106,8 +2106,8 @@ void nsHttpConnectionMgr::DispatchSpdyPendingQ( // active spdy connection either in that same entry or from the // coalescing hash table -void nsHttpConnectionMgr::ProcessSpdyPendingQ(nsConnectionEntry *ent) { - nsHttpConnection *conn = GetSpdyActiveConn(ent); +void nsHttpConnectionMgr::ProcessSpdyPendingQ(nsConnectionEntry* ent) { + nsHttpConnection* conn = GetSpdyActiveConn(ent); if (!conn || !conn->CanDirectlyActivate()) { return; } @@ -2123,12 +2123,12 @@ void nsHttpConnectionMgr::ProcessSpdyPendingQ(nsConnectionEntry *ent) { DispatchSpdyPendingQ(pendingQ, ent, conn); // Put the leftovers back in the pending queue. - for (const auto &transactionInfo : pendingQ) { + for (const auto& transactionInfo : pendingQ) { ent->InsertTransaction(transactionInfo); } } -void nsHttpConnectionMgr::OnMsgProcessAllSpdyPendingQ(int32_t, ARefBase *) { +void nsHttpConnectionMgr::OnMsgProcessAllSpdyPendingQ(int32_t, ARefBase*) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::OnMsgProcessAllSpdyPendingQ\n")); for (auto iter = mCT.Iter(); !iter.Done(); iter.Next()) { @@ -2138,21 +2138,21 @@ void nsHttpConnectionMgr::OnMsgProcessAllSpdyPendingQ(int32_t, ARefBase *) { // Given a connection entry, return an active h2 connection // that can be directly activated or null -nsHttpConnection *nsHttpConnectionMgr::GetSpdyActiveConn( - nsConnectionEntry *ent) { +nsHttpConnection* nsHttpConnectionMgr::GetSpdyActiveConn( + nsConnectionEntry* ent) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(ent); - nsHttpConnection *experienced = nullptr; - nsHttpConnection *noExperience = nullptr; + nsHttpConnection* experienced = nullptr; + nsHttpConnection* noExperience = nullptr; uint32_t activeLen = ent->mActiveConns.Length(); - nsHttpConnectionInfo *ci = ent->mConnInfo; + nsHttpConnectionInfo* ci = ent->mConnInfo; uint32_t index; // activeLen should generally be 1.. this is a setup race being resolved // take a conn who can activate and is experienced for (index = 0; index < activeLen; ++index) { - nsHttpConnection *tmp = ent->mActiveConns[index]; + nsHttpConnection* tmp = ent->mActiveConns[index]; if (tmp->CanDirectlyActivate()) { if (tmp->IsExperienced()) { experienced = tmp; @@ -2165,7 +2165,7 @@ nsHttpConnection *nsHttpConnectionMgr::GetSpdyActiveConn( // if that worked, cleanup anything else and exit if (experienced) { for (index = 0; index < activeLen; ++index) { - nsHttpConnection *tmp = ent->mActiveConns[index]; + nsHttpConnection* tmp = ent->mActiveConns[index]; // in the case where there is a functional h2 session, drop the others if (tmp != experienced) { tmp->DontReuse(); @@ -2201,7 +2201,7 @@ nsHttpConnection *nsHttpConnectionMgr::GetSpdyActiveConn( // there was no active spdy connection in the connection entry, but // there might be one in the hash table for coalescing - nsHttpConnection *existingConn = FindCoalescableConnection(ent, false); + nsHttpConnection* existingConn = FindCoalescableConnection(ent, false); if (existingConn) { LOG( ("GetSpdyActiveConn() request for ent %p %s " @@ -2219,7 +2219,7 @@ nsHttpConnection *nsHttpConnectionMgr::GetSpdyActiveConn( //----------------------------------------------------------------------------- -void nsHttpConnectionMgr::AbortAndCloseAllConnections(int32_t, ARefBase *) { +void nsHttpConnectionMgr::AbortAndCloseAllConnections(int32_t, ARefBase*) { if (!OnSocketThread()) { Unused << PostEvent(&nsHttpConnectionMgr::AbortAndCloseAllConnections); return; @@ -2257,7 +2257,7 @@ void nsHttpConnectionMgr::AbortAndCloseAllConnections(int32_t, ARefBase *) { // Close all urgentStart transactions. while (ent->mUrgentStartQ.Length()) { - PendingTransactionInfo *pendingTransInfo = ent->mUrgentStartQ[0]; + PendingTransactionInfo* pendingTransInfo = ent->mUrgentStartQ[0]; pendingTransInfo->mTransaction->Close(NS_ERROR_ABORT); ent->mUrgentStartQ.RemoveElementAt(0); } @@ -2266,7 +2266,7 @@ void nsHttpConnectionMgr::AbortAndCloseAllConnections(int32_t, ARefBase *) { for (auto it = ent->mPendingTransactionTable.Iter(); !it.Done(); it.Next()) { while (it.UserData()->Length()) { - PendingTransactionInfo *pendingTransInfo = (*it.UserData())[0]; + PendingTransactionInfo* pendingTransInfo = (*it.UserData())[0]; pendingTransInfo->mTransaction->Close(NS_ERROR_ABORT); it.UserData()->RemoveElementAt(0); } @@ -2287,7 +2287,7 @@ void nsHttpConnectionMgr::AbortAndCloseAllConnections(int32_t, ARefBase *) { mActiveTransactions[true].Clear(); } -void nsHttpConnectionMgr::OnMsgShutdown(int32_t, ARefBase *param) { +void nsHttpConnectionMgr::OnMsgShutdown(int32_t, ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::OnMsgShutdown\n")); @@ -2322,29 +2322,29 @@ void nsHttpConnectionMgr::OnMsgShutdown(int32_t, ARefBase *param) { } void nsHttpConnectionMgr::OnMsgShutdownConfirm(int32_t priority, - ARefBase *param) { + ARefBase* param) { MOZ_ASSERT(NS_IsMainThread()); LOG(("nsHttpConnectionMgr::OnMsgShutdownConfirm\n")); - BoolWrapper *shutdown = static_cast(param); + BoolWrapper* shutdown = static_cast(param); shutdown->mBool = true; } void nsHttpConnectionMgr::OnMsgNewTransaction(int32_t priority, - ARefBase *param) { + ARefBase* param) { LOG(("nsHttpConnectionMgr::OnMsgNewTransaction [trans=%p]\n", param)); - nsHttpTransaction *trans = static_cast(param); + nsHttpTransaction* trans = static_cast(param); trans->SetPriority(priority); nsresult rv = ProcessNewTransaction(trans); if (NS_FAILED(rv)) trans->Close(rv); // for whatever its worth } void nsHttpConnectionMgr::OnMsgNewTransactionWithStickyConn(int32_t priority, - ARefBase *param) { + ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - NewTransactionData *data = static_cast(param); + NewTransactionData* data = static_cast(param); LOG( ("nsHttpConnectionMgr::OnMsgNewTransactionWithStickyConn " "[trans=%p, transWithStickyConn=%p, conn=%p]\n", @@ -2372,16 +2372,16 @@ void nsHttpConnectionMgr::OnMsgNewTransactionWithStickyConn(int32_t priority, } } -static uint64_t TabIdForQueuing(nsAHttpTransaction *transaction) { +static uint64_t TabIdForQueuing(nsAHttpTransaction* transaction) { return gHttpHandler->ActiveTabPriority() ? transaction->TopLevelOuterContentWindowId() : 0; } -nsTArray> * -nsHttpConnectionMgr::GetTransactionPendingQHelper(nsConnectionEntry *ent, - nsAHttpTransaction *trans) { - nsTArray> *pendingQ = nullptr; +nsTArray>* +nsHttpConnectionMgr::GetTransactionPendingQHelper(nsConnectionEntry* ent, + nsAHttpTransaction* trans) { + nsTArray>* pendingQ = nullptr; int32_t caps = trans->Caps(); if (caps & NS_HTTP_URGENT_START) { pendingQ = &(ent->mUrgentStartQ); @@ -2392,20 +2392,20 @@ nsHttpConnectionMgr::GetTransactionPendingQHelper(nsConnectionEntry *ent, } void nsHttpConnectionMgr::OnMsgReschedTransaction(int32_t priority, - ARefBase *param) { + ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::OnMsgReschedTransaction [trans=%p]\n", param)); - RefPtr trans = static_cast(param); + RefPtr trans = static_cast(param); trans->SetPriority(priority); if (!trans->ConnectionInfo()) { return; } - nsConnectionEntry *ent = mCT.GetWeak(trans->ConnectionInfo()->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(trans->ConnectionInfo()->HashKey()); if (ent) { - nsTArray> *pendingQ = + nsTArray>* pendingQ = GetTransactionPendingQHelper(ent, trans); int32_t index = @@ -2419,7 +2419,7 @@ void nsHttpConnectionMgr::OnMsgReschedTransaction(int32_t priority, } void nsHttpConnectionMgr::OnMsgUpdateClassOfServiceOnTransaction( - int32_t arg, ARefBase *param) { + int32_t arg, ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG( ("nsHttpConnectionMgr::OnMsgUpdateClassOfServiceOnTransaction " @@ -2427,7 +2427,7 @@ void nsHttpConnectionMgr::OnMsgUpdateClassOfServiceOnTransaction( param)); uint32_t cos = static_cast(arg); - nsHttpTransaction *trans = static_cast(param); + nsHttpTransaction* trans = static_cast(param); uint32_t previous = trans->ClassOfService(); trans->SetClassOfService(cos); @@ -2438,14 +2438,14 @@ void nsHttpConnectionMgr::OnMsgUpdateClassOfServiceOnTransaction( } void nsHttpConnectionMgr::OnMsgCancelTransaction(int32_t reason, - ARefBase *param) { + ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::OnMsgCancelTransaction [trans=%p]\n", param)); nsresult closeCode = static_cast(reason); // caller holds a ref to param/trans on stack - nsHttpTransaction *trans = static_cast(param); + nsHttpTransaction* trans = static_cast(param); // // if the transaction owns a connection and the transaction is not done, @@ -2456,7 +2456,7 @@ void nsHttpConnectionMgr::OnMsgCancelTransaction(int32_t reason, if (conn && !trans->IsDone()) { conn->CloseTransaction(trans, closeCode); } else { - nsConnectionEntry *ent = nullptr; + nsConnectionEntry* ent = nullptr; if (trans->ConnectionInfo()) { ent = mCT.GetWeak(trans->ConnectionInfo()->HashKey()); } @@ -2464,7 +2464,7 @@ void nsHttpConnectionMgr::OnMsgCancelTransaction(int32_t reason, int32_t transIndex; // We will abandon all half-open sockets belonging to the given // transaction. - nsTArray> *infoArray = + nsTArray>* infoArray = GetTransactionPendingQHelper(ent, trans); RefPtr pendingTransInfo; @@ -2502,8 +2502,8 @@ void nsHttpConnectionMgr::OnMsgCancelTransaction(int32_t reason, // it only applied to something in the queue. for (uint32_t index = 0; ent && (index < ent->mActiveConns.Length()); ++index) { - nsHttpConnection *activeConn = ent->mActiveConns[index]; - nsAHttpTransaction *liveTransaction = activeConn->Transaction(); + nsHttpConnection* activeConn = ent->mActiveConns[index]; + nsAHttpTransaction* liveTransaction = activeConn->Transaction(); if (liveTransaction && liveTransaction->IsNullTransaction()) { LOG( ("nsHttpConnectionMgr::OnMsgCancelTransaction [trans=%p] " @@ -2515,9 +2515,9 @@ void nsHttpConnectionMgr::OnMsgCancelTransaction(int32_t reason, } } -void nsHttpConnectionMgr::OnMsgProcessPendingQ(int32_t, ARefBase *param) { +void nsHttpConnectionMgr::OnMsgProcessPendingQ(int32_t, ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpConnectionInfo *ci = static_cast(param); + nsHttpConnectionInfo* ci = static_cast(param); if (!ci) { LOG(("nsHttpConnectionMgr::OnMsgProcessPendingQ [ci=nullptr]\n")); @@ -2532,7 +2532,7 @@ void nsHttpConnectionMgr::OnMsgProcessPendingQ(int32_t, ARefBase *param) { ci->HashKey().get())); // start by processing the queue identified by the given connection info. - nsConnectionEntry *ent = mCT.GetWeak(ci->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(ci->HashKey()); if (!(ent && ProcessPendingQForEntry(ent, false))) { // if we reach here, it means that we couldn't dispatch a transaction // for the specified connection info. walk the connection table... @@ -2544,7 +2544,7 @@ void nsHttpConnectionMgr::OnMsgProcessPendingQ(int32_t, ARefBase *param) { } } -nsresult nsHttpConnectionMgr::CancelTransactions(nsHttpConnectionInfo *ci, +nsresult nsHttpConnectionMgr::CancelTransactions(nsHttpConnectionInfo* ci, nsresult code) { LOG(("nsHttpConnectionMgr::CancelTransactions %s\n", ci->HashKey().get())); @@ -2554,10 +2554,10 @@ nsresult nsHttpConnectionMgr::CancelTransactions(nsHttpConnectionInfo *ci, } void nsHttpConnectionMgr::CancelTransactionsHelper( - nsTArray> &pendingQ, - const nsHttpConnectionInfo *ci, - const nsHttpConnectionMgr::nsConnectionEntry *ent, nsresult reason) { - for (const auto &pendingTransInfo : pendingQ) { + nsTArray>& pendingQ, + const nsHttpConnectionInfo* ci, + const nsHttpConnectionMgr::nsConnectionEntry* ent, nsresult reason) { + for (const auto& pendingTransInfo : pendingQ) { LOG(("nsHttpConnectionMgr::OnMsgCancelTransactions %s %p %p\n", ci->HashKey().get(), ent, pendingTransInfo->mTransaction.get())); pendingTransInfo->mTransaction->Close(reason); @@ -2566,10 +2566,10 @@ void nsHttpConnectionMgr::CancelTransactionsHelper( } void nsHttpConnectionMgr::OnMsgCancelTransactions(int32_t code, - ARefBase *param) { + ARefBase* param) { nsresult reason = static_cast(code); - nsHttpConnectionInfo *ci = static_cast(param); - nsConnectionEntry *ent = mCT.GetWeak(ci->HashKey()); + nsHttpConnectionInfo* ci = static_cast(param); + nsConnectionEntry* ent = mCT.GetWeak(ci->HashKey()); LOG(("nsHttpConnectionMgr::OnMsgCancelTransactions %s %p\n", ci->HashKey().get(), ent)); if (!ent) { @@ -2584,7 +2584,7 @@ void nsHttpConnectionMgr::OnMsgCancelTransactions(int32_t code, ent->mPendingTransactionTable.Clear(); } -void nsHttpConnectionMgr::OnMsgPruneDeadConnections(int32_t, ARefBase *) { +void nsHttpConnectionMgr::OnMsgPruneDeadConnections(int32_t, ARefBase*) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::OnMsgPruneDeadConnections\n")); @@ -2618,7 +2618,7 @@ void nsHttpConnectionMgr::OnMsgPruneDeadConnections(int32_t, ARefBase *) { if (ent->mUsingSpdy) { for (uint32_t i = 0; i < ent->mActiveConns.Length(); ++i) { - nsHttpConnection *conn = ent->mActiveConns[i]; + nsHttpConnection* conn = ent->mActiveConns[i]; if (conn->UsingSpdy()) { if (!conn->CanReuse()) { // Marking it don't-reuse will create an active @@ -2674,7 +2674,7 @@ void nsHttpConnectionMgr::OnMsgPruneDeadConnections(int32_t, ARefBase *) { } } -void nsHttpConnectionMgr::OnMsgPruneNoTraffic(int32_t, ARefBase *) { +void nsHttpConnectionMgr::OnMsgPruneNoTraffic(int32_t, ARefBase*) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::OnMsgPruneNoTraffic\n")); @@ -2706,7 +2706,7 @@ void nsHttpConnectionMgr::OnMsgPruneNoTraffic(int32_t, ARefBase *) { mPruningNoTraffic = false; // not pruning anymore } -void nsHttpConnectionMgr::OnMsgVerifyTraffic(int32_t, ARefBase *) { +void nsHttpConnectionMgr::OnMsgVerifyTraffic(int32_t, ARefBase*) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::OnMsgVerifyTraffic\n")); @@ -2748,11 +2748,11 @@ void nsHttpConnectionMgr::OnMsgVerifyTraffic(int32_t, ARefBase *) { } void nsHttpConnectionMgr::OnMsgDoShiftReloadConnectionCleanup(int32_t, - ARefBase *param) { + ARefBase* param) { LOG(("nsHttpConnectionMgr::OnMsgDoShiftReloadConnectionCleanup\n")); MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpConnectionInfo *ci = static_cast(param); + nsHttpConnectionInfo* ci = static_cast(param); for (auto iter = mCT.Iter(); !iter.Done(); iter.Next()) { ClosePersistentConnections(iter.Data()); @@ -2761,10 +2761,10 @@ void nsHttpConnectionMgr::OnMsgDoShiftReloadConnectionCleanup(int32_t, if (ci) ResetIPFamilyPreference(ci); } -void nsHttpConnectionMgr::OnMsgReclaimConnection(int32_t, ARefBase *param) { +void nsHttpConnectionMgr::OnMsgReclaimConnection(int32_t, ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpConnection *conn = static_cast(param); + nsHttpConnection* conn = static_cast(param); // // 1) remove the connection from the active list @@ -2773,7 +2773,7 @@ void nsHttpConnectionMgr::OnMsgReclaimConnection(int32_t, ARefBase *param) { // MOZ_ASSERT(conn); - nsConnectionEntry *ent = conn->ConnectionInfo() + nsConnectionEntry* ent = conn->ConnectionInfo() ? mCT.GetWeak(conn->ConnectionInfo()->HashKey()) : nullptr; @@ -2832,7 +2832,7 @@ void nsHttpConnectionMgr::OnMsgReclaimConnection(int32_t, ARefBase *param) { uint32_t idx; for (idx = 0; idx < ent->mIdleConns.Length(); idx++) { - nsHttpConnection *idleConn = ent->mIdleConns[idx]; + nsHttpConnection* idleConn = ent->mIdleConns[idx]; if (idleConn->MaxBytesRead() < conn->MaxBytesRead()) break; } @@ -2854,11 +2854,11 @@ void nsHttpConnectionMgr::OnMsgReclaimConnection(int32_t, ARefBase *param) { OnMsgProcessPendingQ(0, ci); } -void nsHttpConnectionMgr::OnMsgCompleteUpgrade(int32_t, ARefBase *param) { +void nsHttpConnectionMgr::OnMsgCompleteUpgrade(int32_t, ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); nsresult rv = NS_OK; - nsCompleteUpgradeData *data = static_cast(param); + nsCompleteUpgradeData* data = static_cast(param); MOZ_ASSERT(data->mTrans && data->mTrans->Caps() & NS_HTTP_STICKY_CONNECTION); RefPtr conn(data->mTrans->Connection()); @@ -2906,7 +2906,7 @@ void nsHttpConnectionMgr::OnMsgCompleteUpgrade(int32_t, ARefBase *param) { } } -void nsHttpConnectionMgr::OnMsgUpdateParam(int32_t inParam, ARefBase *) { +void nsHttpConnectionMgr::OnMsgUpdateParam(int32_t inParam, ARefBase*) { uint32_t param = static_cast(inParam); uint16_t name = ((param)&0xFFFF0000) >> 16; uint16_t value = param & 0x0000FFFF; @@ -3065,7 +3065,7 @@ void nsHttpConnectionMgr::LogActiveTransactions(char operation) { return; } - nsTArray> *trs = nullptr; + nsTArray>* trs = nullptr; uint32_t au, at, bu = 0, bt = 0; trs = mActiveTransactions[false].Get(mCurrentTopLevelOuterContentWindowId); @@ -3092,13 +3092,13 @@ void nsHttpConnectionMgr::LogActiveTransactions(char operation) { LOG(("Active transactions %c[%u,%u,%u,%u]", operation, au, at, bu, bt)); } -void nsHttpConnectionMgr::AddActiveTransaction(nsHttpTransaction *aTrans) { +void nsHttpConnectionMgr::AddActiveTransaction(nsHttpTransaction* aTrans) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); uint64_t tabId = aTrans->TopLevelOuterContentWindowId(); bool throttled = aTrans->EligibleForThrottling(); - nsTArray> *transactions = + nsTArray>* transactions = mActiveTransactions[throttled].LookupOrAdd(tabId); MOZ_ASSERT(!transactions->Contains(aTrans)); @@ -3134,14 +3134,14 @@ void nsHttpConnectionMgr::AddActiveTransaction(nsHttpTransaction *aTrans) { } void nsHttpConnectionMgr::RemoveActiveTransaction( - nsHttpTransaction *aTrans, Maybe const &aOverride) { + nsHttpTransaction* aTrans, Maybe const& aOverride) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); uint64_t tabId = aTrans->TopLevelOuterContentWindowId(); bool forActiveTab = tabId == mCurrentTopLevelOuterContentWindowId; bool throttled = aOverride.valueOr(aTrans->EligibleForThrottling()); - nsTArray> *transactions = + nsTArray>* transactions = mActiveTransactions[throttled].Get(tabId); if (!transactions || !transactions->RemoveElement(aTrans)) { @@ -3242,7 +3242,7 @@ void nsHttpConnectionMgr::RemoveActiveTransaction( LOG((" not resuming anything")); } -void nsHttpConnectionMgr::UpdateActiveTransaction(nsHttpTransaction *aTrans) { +void nsHttpConnectionMgr::UpdateActiveTransaction(nsHttpTransaction* aTrans) { LOG(("nsHttpConnectionMgr::UpdateActiveTransaction ENTER t=%p", aTrans)); // First remove then add. In case of a download that is the only active @@ -3260,7 +3260,7 @@ void nsHttpConnectionMgr::UpdateActiveTransaction(nsHttpTransaction *aTrans) { LOG(("nsHttpConnectionMgr::UpdateActiveTransaction EXIT t=%p", aTrans)); } -bool nsHttpConnectionMgr::ShouldThrottle(nsHttpTransaction *aTrans) { +bool nsHttpConnectionMgr::ShouldThrottle(nsHttpTransaction* aTrans) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG(("nsHttpConnectionMgr::ShouldThrottle trans=%p", aTrans)); @@ -3350,14 +3350,14 @@ bool nsHttpConnectionMgr::ShouldThrottle(nsHttpTransaction *aTrans) { } bool nsHttpConnectionMgr::IsConnEntryUnderPressure( - nsHttpConnectionInfo *connInfo) { - nsConnectionEntry *ent = mCT.GetWeak(connInfo->HashKey()); + nsHttpConnectionInfo* connInfo) { + nsConnectionEntry* ent = mCT.GetWeak(connInfo->HashKey()); if (!ent) { // No entry, no pressure. return false; } - nsTArray> *transactions = + nsTArray>* transactions = ent->mPendingTransactionTable.Get(mCurrentTopLevelOuterContentWindowId); return transactions && !transactions->IsEmpty(); @@ -3547,8 +3547,8 @@ void nsHttpConnectionMgr::ResumeBackgroundThrottledTransactions() { } void nsHttpConnectionMgr::ResumeReadOf( - nsClassHashtable>> - &hashtable, + nsClassHashtable>>& + hashtable, bool excludeForActiveTab) { for (auto iter = hashtable.Iter(); !iter.Done(); iter.Next()) { if (excludeForActiveTab && @@ -3561,10 +3561,10 @@ void nsHttpConnectionMgr::ResumeReadOf( } void nsHttpConnectionMgr::ResumeReadOf( - nsTArray> *transactions) { + nsTArray>* transactions) { MOZ_ASSERT(transactions); - for (const auto &trans : *transactions) { + for (const auto& trans : *transactions) { trans->ResumeReading(); } } @@ -3573,16 +3573,16 @@ void nsHttpConnectionMgr::NotifyConnectionOfWindowIdChange( uint64_t previousWindowId) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsTArray> *transactions = nullptr; + nsTArray>* transactions = nullptr; nsTArray> connections; auto addConnectionHelper = - [&connections](nsTArray> *trans) { + [&connections](nsTArray>* trans) { if (!trans) { return; } - for (const auto &t : *trans) { + for (const auto& t : *trans) { RefPtr conn = t->Connection(); if (conn && !connections.Contains(conn)) { connections.AppendElement(conn); @@ -3604,17 +3604,17 @@ void nsHttpConnectionMgr::NotifyConnectionOfWindowIdChange( mActiveTransactions[true].Get(mCurrentTopLevelOuterContentWindowId); addConnectionHelper(transactions); - for (const auto &conn : connections) { + for (const auto& conn : connections) { conn->TopLevelOuterContentWindowIdChanged( mCurrentTopLevelOuterContentWindowId); } } void nsHttpConnectionMgr::OnMsgUpdateCurrentTopLevelOuterContentWindowId( - int32_t aLoading, ARefBase *param) { + int32_t aLoading, ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - uint64_t winId = static_cast(param)->GetValue(); + uint64_t winId = static_cast(param)->GetValue(); if (mCurrentTopLevelOuterContentWindowId == winId) { // duplicate notification @@ -3635,7 +3635,7 @@ void nsHttpConnectionMgr::OnMsgUpdateCurrentTopLevelOuterContentWindowId( " id=%" PRIx64 "\n", mCurrentTopLevelOuterContentWindowId)); - nsTArray> *transactions = nullptr; + nsTArray>* transactions = nullptr; // Update the "Exists" caches and resume any transactions that now deserve it, // changing the active tab changes the conditions for throttling. @@ -3717,7 +3717,7 @@ void nsHttpConnectionMgr::TimeoutTick() { for (uint32_t index = ent->mHalfOpens.Length(); index > 0;) { index--; - nsHalfOpenSocket *half = ent->mHalfOpens[index]; + nsHalfOpenSocket* half = ent->mHalfOpens[index]; double delta = half->Duration(currentTime); // If the socket has timed out, close it so the waiting // transaction will get the proper signal. @@ -3758,11 +3758,11 @@ void nsHttpConnectionMgr::TimeoutTick() { // 2] otherwise use an ent of wildcard(ci) than can be dispatched immediately // 3] otherwise create an ent that matches ci and make new conn on it -nsHttpConnectionMgr::nsConnectionEntry * +nsHttpConnectionMgr::nsConnectionEntry* nsHttpConnectionMgr::GetOrCreateConnectionEntry( - nsHttpConnectionInfo *specificCI, bool prohibitWildCard) { + nsHttpConnectionInfo* specificCI, bool prohibitWildCard) { // step 1 - nsConnectionEntry *specificEnt = mCT.GetWeak(specificCI->HashKey()); + nsConnectionEntry* specificEnt = mCT.GetWeak(specificCI->HashKey()); if (specificEnt && specificEnt->AvailableForDispatchNow()) { return specificEnt; } @@ -3772,9 +3772,9 @@ nsHttpConnectionMgr::GetOrCreateConnectionEntry( // with a client certificate. RefPtr anonInvertedCI(specificCI->Clone()); anonInvertedCI->SetAnonymous(!specificCI->GetAnonymous()); - nsConnectionEntry *invertedEnt = mCT.GetWeak(anonInvertedCI->HashKey()); + nsConnectionEntry* invertedEnt = mCT.GetWeak(anonInvertedCI->HashKey()); if (invertedEnt) { - nsHttpConnection *h2conn = GetSpdyActiveConn(invertedEnt); + nsHttpConnection* h2conn = GetSpdyActiveConn(invertedEnt); if (h2conn && h2conn->IsExperienced() && h2conn->NoClientCertAuth()) { MOZ_ASSERT(h2conn->UsingSpdy()); LOG( @@ -3795,7 +3795,7 @@ nsHttpConnectionMgr::GetOrCreateConnectionEntry( DebugOnly rv = specificCI->CreateWildCard(getter_AddRefs(wildCardProxyCI)); MOZ_ASSERT(NS_SUCCEEDED(rv)); - nsConnectionEntry *wildCardEnt = mCT.GetWeak(wildCardProxyCI->HashKey()); + nsConnectionEntry* wildCardEnt = mCT.GetWeak(wildCardProxyCI->HashKey()); if (wildCardEnt && wildCardEnt->AvailableForDispatchNow()) { return wildCardEnt; } @@ -3810,33 +3810,33 @@ nsHttpConnectionMgr::GetOrCreateConnectionEntry( return specificEnt; } -nsresult ConnectionHandle::OnHeadersAvailable(nsAHttpTransaction *trans, - nsHttpRequestHead *req, - nsHttpResponseHead *resp, - bool *reset) { +nsresult ConnectionHandle::OnHeadersAvailable(nsAHttpTransaction* trans, + nsHttpRequestHead* req, + nsHttpResponseHead* resp, + bool* reset) { return mConn->OnHeadersAvailable(trans, req, resp, reset); } -void ConnectionHandle::CloseTransaction(nsAHttpTransaction *trans, +void ConnectionHandle::CloseTransaction(nsAHttpTransaction* trans, nsresult reason) { mConn->CloseTransaction(trans, reason); } -nsresult ConnectionHandle::TakeTransport(nsISocketTransport **aTransport, - nsIAsyncInputStream **aInputStream, - nsIAsyncOutputStream **aOutputStream) { +nsresult ConnectionHandle::TakeTransport(nsISocketTransport** aTransport, + nsIAsyncInputStream** aInputStream, + nsIAsyncOutputStream** aOutputStream) { return mConn->TakeTransport(aTransport, aInputStream, aOutputStream); } -void nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, ARefBase *param) { +void nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, ARefBase* param) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - SpeculativeConnectArgs *args = static_cast(param); + SpeculativeConnectArgs* args = static_cast(param); LOG(("nsHttpConnectionMgr::OnMsgSpeculativeConnect [ci=%s]\n", args->mTrans->ConnectionInfo()->HashKey().get())); - nsConnectionEntry *ent = + nsConnectionEntry* ent = GetOrCreateConnectionEntry(args->mTrans->ConnectionInfo(), false); uint32_t parallelSpeculativeConnectLimit = @@ -3885,7 +3885,7 @@ void ConnectionHandle::DontReuse() { mConn->DontReuse(); } -nsresult ConnectionHandle::PushBack(const char *buf, uint32_t bufLen) { +nsresult ConnectionHandle::PushBack(const char* buf, uint32_t bufLen) { return mConn->PushBack(buf, bufLen); } @@ -3909,7 +3909,7 @@ NS_INTERFACE_MAP_BEGIN(nsHttpConnectionMgr::nsHalfOpenSocket) NS_INTERFACE_MAP_END nsHttpConnectionMgr::nsHalfOpenSocket::nsHalfOpenSocket( - nsConnectionEntry *ent, nsAHttpTransaction *trans, uint32_t caps, + nsConnectionEntry* ent, nsAHttpTransaction* trans, uint32_t caps, bool speculative, bool isFromPredictor, bool urgentStart) : mTransaction(trans), mDispatchedMTransaction(false), @@ -3959,15 +3959,15 @@ nsHttpConnectionMgr::nsHalfOpenSocket::~nsHalfOpenSocket() { } nsresult nsHttpConnectionMgr::nsHalfOpenSocket::SetupStreams( - nsISocketTransport **transport, nsIAsyncInputStream **instream, - nsIAsyncOutputStream **outstream, bool isBackup) { + nsISocketTransport** transport, nsIAsyncInputStream** instream, + nsIAsyncOutputStream** outstream, bool isBackup) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(mEnt); nsresult rv; - const char *socketTypes[1]; + const char* socketTypes[1]; uint32_t typeCount = 0; - const nsHttpConnectionInfo *ci = mEnt->mConnInfo; + const nsHttpConnectionInfo* ci = mEnt->mConnInfo; if (ci->FirstHopSSL()) { socketTypes[typeCount++] = "ssl"; } else { @@ -4088,7 +4088,7 @@ nsresult nsHttpConnectionMgr::nsHalfOpenSocket::SetupStreams( socketTransport->SetConnectionFlags(tmpFlags); socketTransport->SetTlsFlags(ci->GetTlsFlags()); - const OriginAttributes &originAttributes = + const OriginAttributes& originAttributes = mEnt->mConnInfo->GetOriginAttributes(); if (originAttributes != OriginAttributes()) { socketTransport->SetOriginAttributes(originAttributes); @@ -4272,7 +4272,7 @@ double nsHttpConnectionMgr::nsHalfOpenSocket::Duration(TimeStamp epoch) { } NS_IMETHODIMP // method for nsITimerCallback -nsHttpConnectionMgr::nsHalfOpenSocket::Notify(nsITimer *timer) { +nsHttpConnectionMgr::nsHalfOpenSocket::Notify(nsITimer* timer) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(timer == mSynTimer, "wrong timer"); @@ -4290,7 +4290,7 @@ nsHttpConnectionMgr::nsHalfOpenSocket::Notify(nsITimer *timer) { } NS_IMETHODIMP // method for nsINamed -nsHttpConnectionMgr::nsHalfOpenSocket::GetName(nsACString &aName) { +nsHttpConnectionMgr::nsHalfOpenSocket::GetName(nsACString& aName) { aName.AssignLiteral("nsHttpConnectionMgr::nsHalfOpenSocket"); return NS_OK; } @@ -4298,7 +4298,7 @@ nsHttpConnectionMgr::nsHalfOpenSocket::GetName(nsACString &aName) { already_AddRefed nsHttpConnectionMgr::nsHalfOpenSocket::FindTransactionHelper( bool removeWhenFound) { - nsTArray> *pendingQ = + nsTArray>* pendingQ = gHttpHandler->ConnMgr()->GetTransactionPendingQHelper(mEnt, mTransaction); int32_t index = @@ -4317,7 +4317,7 @@ nsHttpConnectionMgr::nsHalfOpenSocket::FindTransactionHelper( // method for nsIAsyncOutputStreamCallback NS_IMETHODIMP nsHttpConnectionMgr::nsHalfOpenSocket::OnOutputStreamReady( - nsIAsyncOutputStream *out) { + nsIAsyncOutputStream* out) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(mStreamOut || mBackupStreamOut); MOZ_ASSERT(out == mStreamOut || out == mBackupStreamOut, "stream mismatch"); @@ -4364,7 +4364,7 @@ nsHttpConnectionMgr::nsHalfOpenSocket::OnOutputStreamReady( RefPtr pendingTransInfo = new PendingTransactionInfo(trans->QueryHttpTransaction()); pendingTransInfo->mHalfOpen = - do_GetWeakReference(static_cast(this)); + do_GetWeakReference(static_cast(this)); if (trans->Caps() & NS_HTTP_URGENT_START) { gHttpHandler->ConnMgr()->InsertTransactionSorted( mEnt->mUrgentStartQ, pendingTransInfo, true); @@ -4602,7 +4602,7 @@ void nsHttpConnectionMgr::nsHalfOpenSocket::SetFastOpenConnected( RefPtr pendingTransInfo = new PendingTransactionInfo(trans->QueryHttpTransaction()); pendingTransInfo->mHalfOpen = - do_GetWeakReference(static_cast(this)); + do_GetWeakReference(static_cast(this)); if (trans->Caps() & NS_HTTP_URGENT_START) { gHttpHandler->ConnMgr()->InsertTransactionSorted( mEnt->mUrgentStartQ, pendingTransInfo, true); @@ -4726,7 +4726,7 @@ void nsHttpConnectionMgr::nsHalfOpenSocket::FastOpenNotSupported() { } nsresult nsHttpConnectionMgr::nsHalfOpenSocket::SetupConn( - nsIAsyncOutputStream *out, bool aFastOpen) { + nsIAsyncOutputStream* out, bool aFastOpen) { MOZ_ASSERT(!aFastOpen || (out == mStreamOut)); // assign the new socket to the http connection RefPtr conn = new nsHttpConnection(); @@ -4735,7 +4735,7 @@ nsresult nsHttpConnectionMgr::nsHalfOpenSocket::SetupConn( "Created new nshttpconnection %p\n", conn.get())); - NullHttpTransaction *nullTrans = mTransaction->QueryNullTransaction(); + NullHttpTransaction* nullTrans = mTransaction->QueryNullTransaction(); if (nullTrans) { conn->BootstrapTimings(nullTrans->Timings()); } @@ -4947,24 +4947,24 @@ nsresult nsHttpConnectionMgr::nsHalfOpenSocket::SetupConn( // register a connection to receive CanJoinConnection() for particular // origin keys -void nsHttpConnectionMgr::RegisterOriginCoalescingKey(nsHttpConnection *conn, - const nsACString &host, +void nsHttpConnectionMgr::RegisterOriginCoalescingKey(nsHttpConnection* conn, + const nsACString& host, int32_t port) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsHttpConnectionInfo *ci = conn ? conn->ConnectionInfo() : nullptr; + nsHttpConnectionInfo* ci = conn ? conn->ConnectionInfo() : nullptr; if (!ci || !conn->CanDirectlyActivate()) { return; } nsCString newKey; BuildOriginFrameHashKey(newKey, ci, host, port); - nsTArray *listOfWeakConns = mCoalescingHash.Get(newKey); + nsTArray* listOfWeakConns = mCoalescingHash.Get(newKey); if (!listOfWeakConns) { listOfWeakConns = new nsTArray(1); mCoalescingHash.Put(newKey, listOfWeakConns); } listOfWeakConns->AppendElement( - do_GetWeakReference(static_cast(conn))); + do_GetWeakReference(static_cast(conn))); LOG( ("nsHttpConnectionMgr::RegisterOriginCoalescingKey " @@ -4974,7 +4974,7 @@ void nsHttpConnectionMgr::RegisterOriginCoalescingKey(nsHttpConnection *conn, // method for nsITransportEventSink NS_IMETHODIMP -nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans, +nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport* trans, nsresult status, int64_t progress, int64_t progressMax) { @@ -5033,7 +5033,7 @@ nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans, if (NS_SUCCEEDED(rv) && !addressSet.IsEmpty()) { for (uint32_t i = 0; i < addressSet.Length(); ++i) { - nsCString *newKey = mEnt->mCoalescingKeys.AppendElement(nsCString()); + nsCString* newKey = mEnt->mCoalescingKeys.AppendElement(nsCString()); newKey->SetLength(kIPv6CStrBufSize + 26); NetAddrToString(&addressSet[i], newKey->BeginWriting(), kIPv6CStrBufSize); @@ -5087,8 +5087,8 @@ nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans, // method for nsIInterfaceRequestor NS_IMETHODIMP -nsHttpConnectionMgr::nsHalfOpenSocket::GetInterface(const nsIID &iid, - void **result) { +nsHttpConnectionMgr::nsHalfOpenSocket::GetInterface(const nsIID& iid, + void** result) { if (mTransaction) { nsCOMPtr callbacks; mTransaction->GetSecurityCallbacks(getter_AddRefs(callbacks)); @@ -5098,7 +5098,7 @@ nsHttpConnectionMgr::nsHalfOpenSocket::GetInterface(const nsIID &iid, } bool nsHttpConnectionMgr::nsHalfOpenSocket::AcceptsTransaction( - nsHttpTransaction *trans) { + nsHttpTransaction* trans) { // When marked as urgent start, only accept urgent start marked transactions. // Otherwise, accept any kind of transaction. return !mUrgentStart || (trans->Caps() & nsIClassOfService::UrgentStart); @@ -5164,7 +5164,7 @@ void ConnectionHandle::TopLevelOuterContentWindowIdChanged(uint64_t windowId) { // nsConnectionEntry nsHttpConnectionMgr::nsConnectionEntry::nsConnectionEntry( - nsHttpConnectionInfo *ci) + nsHttpConnectionInfo* ci) : mConnInfo(ci), mUsingSpdy(false), mCanUseSpdy(true), @@ -5193,7 +5193,7 @@ bool nsHttpConnectionMgr::nsConnectionEntry::AvailableForDispatchNow() { return gHttpHandler->ConnMgr()->GetSpdyActiveConn(this) ? true : false; } -bool nsHttpConnectionMgr::GetConnectionData(nsTArray *aArg) { +bool nsHttpConnectionMgr::GetConnectionData(nsTArray* aArg) { for (auto iter = mCT.Iter(); !iter.Done(); iter.Next()) { RefPtr ent = iter.Data(); @@ -5237,9 +5237,9 @@ bool nsHttpConnectionMgr::GetConnectionData(nsTArray *aArg) { return true; } -void nsHttpConnectionMgr::ResetIPFamilyPreference(nsHttpConnectionInfo *ci) { +void nsHttpConnectionMgr::ResetIPFamilyPreference(nsHttpConnectionInfo* ci) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - nsConnectionEntry *ent = mCT.GetWeak(ci->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(ci->HashKey()); if (ent) { ent->ResetIPFamilyPreference(); } @@ -5254,7 +5254,7 @@ uint32_t nsHttpConnectionMgr::nsConnectionEntry::UnconnectedHalfOpens() { } void nsHttpConnectionMgr::nsConnectionEntry::RemoveHalfOpen( - nsHalfOpenSocket *halfOpen) { + nsHalfOpenSocket* halfOpen) { // A failure to create the transport object at all // will result in it not being present in the halfopen table. That's expected. if (mHalfOpens.RemoveElement(halfOpen)) { @@ -5291,10 +5291,10 @@ void nsHttpConnectionMgr::nsConnectionEntry::RemoveHalfOpen( } } -void nsHttpConnectionMgr::BlacklistSpdy(const nsHttpConnectionInfo *ci) { +void nsHttpConnectionMgr::BlacklistSpdy(const nsHttpConnectionInfo* ci) { LOG(("nsHttpConnectionMgr::BlacklistSpdy blacklisting ci %s", ci->HashKey().BeginReading())); - nsConnectionEntry *ent = mCT.GetWeak(ci->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(ci->HashKey()); if (!ent) { LOG(("nsHttpConnectionMgr::BlacklistSpdy no entry found?!")); return; @@ -5360,7 +5360,7 @@ size_t nsHttpConnectionMgr::nsConnectionEntry::PendingQLength() const { } void nsHttpConnectionMgr::nsConnectionEntry::InsertTransaction( - PendingTransactionInfo *info, + PendingTransactionInfo* info, bool aInsertAsFirstForTheSamePriority /*= false*/) { LOG( ("nsHttpConnectionMgr::nsConnectionEntry::InsertTransaction" @@ -5369,7 +5369,7 @@ void nsHttpConnectionMgr::nsConnectionEntry::InsertTransaction( info->mTransaction->TopLevelOuterContentWindowId())); uint64_t windowId = TabIdForQueuing(info->mTransaction); - nsTArray> *infoArray; + nsTArray>* infoArray; if (!mPendingTransactionTable.Get(windowId, &infoArray)) { infoArray = new nsTArray>(); mPendingTransactionTable.Put(windowId, infoArray); @@ -5380,9 +5380,9 @@ void nsHttpConnectionMgr::nsConnectionEntry::InsertTransaction( } void nsHttpConnectionMgr::nsConnectionEntry::AppendPendingQForFocusedWindow( - uint64_t windowId, nsTArray> &result, + uint64_t windowId, nsTArray>& result, uint32_t maxCount) { - nsTArray> *infoArray = nullptr; + nsTArray>* infoArray = nullptr; if (!mPendingTransactionTable.Get(windowId, &infoArray)) { result.Clear(); return; @@ -5406,7 +5406,7 @@ void nsHttpConnectionMgr::nsConnectionEntry::AppendPendingQForFocusedWindow( } void nsHttpConnectionMgr::nsConnectionEntry::AppendPendingQForNonFocusedWindows( - uint64_t windowId, nsTArray> &result, + uint64_t windowId, nsTArray>& result, uint32_t maxCount) { // XXX Adjust the order of transactions in a smarter manner. uint32_t totalCount = 0; @@ -5455,8 +5455,8 @@ void nsHttpConnectionMgr::nsConnectionEntry::RemoveEmptyPendingQ() { } void nsHttpConnectionMgr::MoveToWildCardConnEntry( - nsHttpConnectionInfo *specificCI, nsHttpConnectionInfo *wildCardCI, - nsHttpConnection *proxyConn) { + nsHttpConnectionInfo* specificCI, nsHttpConnectionInfo* wildCardCI, + nsHttpConnection* proxyConn) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); MOZ_ASSERT(specificCI->UsingHttpsProxy()); @@ -5465,7 +5465,7 @@ void nsHttpConnectionMgr::MoveToWildCardConnEntry( "change CI from %s to %s\n", proxyConn, specificCI->HashKey().get(), wildCardCI->HashKey().get())); - nsConnectionEntry *ent = mCT.GetWeak(specificCI->HashKey()); + nsConnectionEntry* ent = mCT.GetWeak(specificCI->HashKey()); LOG( ("nsHttpConnectionMgr::MakeConnEntryWildCard conn %p using ent %p (spdy " "%d)\n", @@ -5475,7 +5475,7 @@ void nsHttpConnectionMgr::MoveToWildCardConnEntry( return; } - nsConnectionEntry *wcEnt = GetOrCreateConnectionEntry(wildCardCI, true); + nsConnectionEntry* wcEnt = GetOrCreateConnectionEntry(wildCardCI, true); if (wcEnt == ent) { // nothing to do! return; diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.h b/netwerk/protocol/http/nsHttpConnectionMgr.h index 4f2046857bc91..87901a3f79f2c 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.h +++ b/netwerk/protocol/http/nsHttpConnectionMgr.h @@ -45,7 +45,7 @@ struct HttpRetParams; // message handlers have this signature class nsHttpConnectionMgr; -typedef void (nsHttpConnectionMgr::*nsConnEventHandler)(int32_t, ARefBase *); +typedef void (nsHttpConnectionMgr::*nsConnEventHandler)(int32_t, ARefBase*); class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { public: @@ -93,7 +93,7 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { void PruneDeadConnectionsAfter(uint32_t time); // this cancels all outstanding transactions but does not shut down the mgr - void AbortAndCloseAllConnections(int32_t, ARefBase *); + void AbortAndCloseAllConnections(int32_t, ARefBase*); // Stops timer scheduled for next pruning of dead connections if // there are no more idle connections or active spdy ones @@ -104,25 +104,25 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { void ConditionallyStopTimeoutTick(); // adds a transaction to the list of managed transactions. - MOZ_MUST_USE nsresult AddTransaction(nsHttpTransaction *, int32_t priority); + MOZ_MUST_USE nsresult AddTransaction(nsHttpTransaction*, int32_t priority); // Add a new transaction with a sticky connection from |transWithStickyConn|. MOZ_MUST_USE nsresult - AddTransactionWithStickyConn(nsHttpTransaction *trans, int32_t priority, - nsHttpTransaction *transWithStickyConn); + AddTransactionWithStickyConn(nsHttpTransaction* trans, int32_t priority, + nsHttpTransaction* transWithStickyConn); // called to reschedule the given transaction. it must already have been // added to the connection manager via AddTransaction. - MOZ_MUST_USE nsresult RescheduleTransaction(nsHttpTransaction *, + MOZ_MUST_USE nsresult RescheduleTransaction(nsHttpTransaction*, int32_t priority); // TOOD - void UpdateClassOfServiceOnTransaction(nsHttpTransaction *, + void UpdateClassOfServiceOnTransaction(nsHttpTransaction*, uint32_t classOfService); // cancels a transaction w/ the given reason. - MOZ_MUST_USE nsresult CancelTransaction(nsHttpTransaction *, nsresult reason); - MOZ_MUST_USE nsresult CancelTransactions(nsHttpConnectionInfo *, + MOZ_MUST_USE nsresult CancelTransaction(nsHttpTransaction*, nsresult reason); + MOZ_MUST_USE nsresult CancelTransactions(nsHttpConnectionInfo*, nsresult reason); // called to force the connection manager to prune its list of idle @@ -140,11 +140,11 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // Close all idle persistent connections and prevent any active connections // from being reused. Optional connection info resets CI specific // information such as Happy Eyeballs history. - MOZ_MUST_USE nsresult DoShiftReloadConnectionCleanup(nsHttpConnectionInfo *); + MOZ_MUST_USE nsresult DoShiftReloadConnectionCleanup(nsHttpConnectionInfo*); // called to get a reference to the socket transport service. the socket // transport service is not available when the connection manager is down. - MOZ_MUST_USE nsresult GetSocketThreadTarget(nsIEventTarget **); + MOZ_MUST_USE nsresult GetSocketThreadTarget(nsIEventTarget**); // called to indicate a transaction for the connectionInfo is likely coming // soon. The connection manager may use this information to start a TCP @@ -152,15 +152,15 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // ready when the transaction is submitted. No obligation is taken on by the // connection manager, nor is the submitter obligated to actually submit a // real transaction for this connectionInfo. - MOZ_MUST_USE nsresult SpeculativeConnect(nsHttpConnectionInfo *, - nsIInterfaceRequestor *, + MOZ_MUST_USE nsresult SpeculativeConnect(nsHttpConnectionInfo*, + nsIInterfaceRequestor*, uint32_t caps = 0, - NullHttpTransaction * = nullptr); + NullHttpTransaction* = nullptr); // called when a connection is done processing a transaction. if the // connection can be reused then it will be added to the idle list, else // it will be closed. - MOZ_MUST_USE nsresult ReclaimConnection(nsHttpConnection *conn); + MOZ_MUST_USE nsresult ReclaimConnection(nsHttpConnection* conn); // called by the main thread to execute the taketransport() logic on the // socket thread after a 101 response has been received and the socket @@ -169,7 +169,7 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // @param aTrans: a transaction that contains a sticky connection. We'll // take the transport of this connection. MOZ_MUST_USE nsresult CompleteUpgrade( - nsHttpTransaction *aTrans, nsIHttpUpgradeListener *aUpgradeListener); + nsHttpTransaction* aTrans, nsIHttpUpgradeListener* aUpgradeListener); // called to update a parameter after the connection manager has already // been initialized. @@ -177,12 +177,12 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // called from main thread to post a new request token bucket // to the socket thread - MOZ_MUST_USE nsresult UpdateRequestTokenBucket(EventTokenBucket *aBucket); + MOZ_MUST_USE nsresult UpdateRequestTokenBucket(EventTokenBucket* aBucket); // clears the connection history mCT MOZ_MUST_USE nsresult ClearConnectionHistory(); - void ReportFailedToProcess(nsIURI *uri); + void ReportFailedToProcess(nsIURI* uri); // Causes a large amount of connection diagnostic information to be // printed to the javascript console @@ -194,14 +194,14 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // called to change the connection entry associated with conn from specific // into a wildcard (i.e. http2 proxy friendy) mapping - void MoveToWildCardConnEntry(nsHttpConnectionInfo *specificCI, - nsHttpConnectionInfo *wildcardCI, - nsHttpConnection *conn); + void MoveToWildCardConnEntry(nsHttpConnectionInfo* specificCI, + nsHttpConnectionInfo* wildcardCI, + nsHttpConnection* conn); // called to force the transaction queue to be processed once more, giving // preference to the specified connection. - MOZ_MUST_USE nsresult ProcessPendingQ(nsHttpConnectionInfo *); - MOZ_MUST_USE bool ProcessPendingQForEntry(nsHttpConnectionInfo *); + MOZ_MUST_USE nsresult ProcessPendingQ(nsHttpConnectionInfo*); + MOZ_MUST_USE bool ProcessPendingQForEntry(nsHttpConnectionInfo*); // Try and process all pending transactions MOZ_MUST_USE nsresult ProcessPendingQ(); @@ -209,17 +209,17 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // This is used to force an idle connection to be closed and removed from // the idle connection list. It is called when the idle connection detects // that the network peer has closed the transport. - MOZ_MUST_USE nsresult CloseIdleConnection(nsHttpConnection *); - MOZ_MUST_USE nsresult RemoveIdleConnection(nsHttpConnection *); + MOZ_MUST_USE nsresult CloseIdleConnection(nsHttpConnection*); + MOZ_MUST_USE nsresult RemoveIdleConnection(nsHttpConnection*); // The connection manager needs to know when a normal HTTP connection has been // upgraded to SPDY because the dispatch and idle semantics are a little // bit different. - void ReportSpdyConnection(nsHttpConnection *, bool usingSpdy); + void ReportSpdyConnection(nsHttpConnection*, bool usingSpdy); - bool GetConnectionData(nsTArray *); + bool GetConnectionData(nsTArray*); - void ResetIPFamilyPreference(nsHttpConnectionInfo *); + void ResetIPFamilyPreference(nsHttpConnectionInfo*); uint16_t MaxRequestDelay() { return mMaxRequestDelay; } @@ -229,16 +229,16 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { nsresult UpdateCurrentTopLevelOuterContentWindowId(uint64_t aWindowId); // tracks and untracks active transactions according their throttle status - void AddActiveTransaction(nsHttpTransaction *aTrans); - void RemoveActiveTransaction(nsHttpTransaction *aTrans, - Maybe const &aOverride = Nothing()); - void UpdateActiveTransaction(nsHttpTransaction *aTrans); + void AddActiveTransaction(nsHttpTransaction* aTrans); + void RemoveActiveTransaction(nsHttpTransaction* aTrans, + Maybe const& aOverride = Nothing()); + void UpdateActiveTransaction(nsHttpTransaction* aTrans); // called by nsHttpTransaction::WriteSegments. decides whether the // transaction should limit reading its reponse data. There are various // conditions this methods evaluates. If called by an active-tab // non-throttled transaction, the throttling window time will be prolonged. - bool ShouldThrottle(nsHttpTransaction *aTrans); + bool ShouldThrottle(nsHttpTransaction* aTrans); // prolongs the throttling time window to now + the window preferred delay. // called when: @@ -251,13 +251,13 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // it's mainly used to disallow throttling (limit reading) of a response // belonging to the same conn info to free up a connection ASAP. // NOTE: relatively expensive to call, there are two hashtable lookups. - bool IsConnEntryUnderPressure(nsHttpConnectionInfo *); + bool IsConnEntryUnderPressure(nsHttpConnectionInfo*); uint64_t CurrentTopLevelOuterContentWindowId() { return mCurrentTopLevelOuterContentWindowId; } - void BlacklistSpdy(const nsHttpConnectionInfo *ci); + void BlacklistSpdy(const nsHttpConnectionInfo* ci); private: virtual ~nsHttpConnectionMgr(); @@ -274,7 +274,7 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { class nsConnectionEntry { public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsConnectionEntry) - explicit nsConnectionEntry(nsHttpConnectionInfo *ci); + explicit nsConnectionEntry(nsHttpConnectionInfo* ci); RefPtr mConnInfo; nsTArray> @@ -290,8 +290,8 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { mPendingTransactionTable; nsTArray> mActiveConns; // active connections nsTArray> - mIdleConns; // idle persistent connections - nsTArray mHalfOpens; // half open connections + mIdleConns; // idle persistent connections + nsTArray mHalfOpens; // half open connections nsTArray> mHalfOpenFastOpenBackups; // backup half open connections for // connection in fast open phase @@ -303,7 +303,7 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { uint32_t UnconnectedHalfOpens(); // Remove a particular half open socket from the mHalfOpens array - void RemoveHalfOpen(nsHalfOpenSocket *); + void RemoveHalfOpen(nsHalfOpenSocket*); // Spdy sometimes resolves the address in the socket manager in order // to re-coalesce sharded HTTP hosts. The dotted decimal address is @@ -357,21 +357,21 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // Add a transaction information into the pending queue in // |mPendingTransactionTable| according to the transaction's // top level outer content window id. - void InsertTransaction(PendingTransactionInfo *info, + void InsertTransaction(PendingTransactionInfo* info, bool aInsertAsFirstForTheSamePriority = false); // Append transactions to the |result| whose window id // is equal to |windowId|. // NOTE: maxCount == 0 will get all transactions in the queue. void AppendPendingQForFocusedWindow( - uint64_t windowId, nsTArray> &result, + uint64_t windowId, nsTArray>& result, uint32_t maxCount = 0); // Append transactions whose window id isn't equal to |windowId|. // NOTE: windowId == 0 will get all transactions for both // focused and non-focused windows. void AppendPendingQForNonFocusedWindows( - uint64_t windowId, nsTArray> &result, + uint64_t windowId, nsTArray>& result, uint32_t maxCount = 0); // Remove the empty pendingQ in |mPendingTransactionTable|. @@ -382,8 +382,8 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { }; public: - static nsAHttpConnection *MakeConnectionHandle(nsHttpConnection *aWrapped); - void RegisterOriginCoalescingKey(nsHttpConnection *, const nsACString &host, + static nsAHttpConnection* MakeConnectionHandle(nsHttpConnection* aWrapped); + void RegisterOriginCoalescingKey(nsHttpConnection*, const nsACString& host, int32_t port); private: @@ -408,23 +408,23 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { NS_DECL_NSITIMERCALLBACK NS_DECL_NSINAMED - nsHalfOpenSocket(nsConnectionEntry *ent, nsAHttpTransaction *trans, + nsHalfOpenSocket(nsConnectionEntry* ent, nsAHttpTransaction* trans, uint32_t caps, bool speculative, bool isFromPredictor, bool urgentStart); - MOZ_MUST_USE nsresult SetupStreams(nsISocketTransport **, - nsIAsyncInputStream **, - nsIAsyncOutputStream **, bool isBackup); + MOZ_MUST_USE nsresult SetupStreams(nsISocketTransport**, + nsIAsyncInputStream**, + nsIAsyncOutputStream**, bool isBackup); MOZ_MUST_USE nsresult SetupPrimaryStreams(); MOZ_MUST_USE nsresult SetupBackupStreams(); void SetupBackupTimer(); void CancelBackupTimer(); void Abandon(); double Duration(TimeStamp epoch); - nsISocketTransport *SocketTransport() { return mSocketTransport; } - nsISocketTransport *BackupTransport() { return mBackupTransport; } + nsISocketTransport* SocketTransport() { return mSocketTransport; } + nsISocketTransport* BackupTransport() { return mBackupTransport; } - nsAHttpTransaction *Transaction() { return mTransaction; } + nsAHttpTransaction* Transaction() { return mTransaction; } bool IsSpeculative() { return mSpeculative; } @@ -435,12 +435,12 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { bool HasConnected() { return mHasConnected; } - void PrintDiagnostics(nsCString &log); + void PrintDiagnostics(nsCString& log); // Checks whether the transaction can be dispatched using this // half-open's connection. If this half-open is marked as urgent-start, // it only accepts urgent start transactions. Call only before Claim(). - bool AcceptsTransaction(nsHttpTransaction *trans); + bool AcceptsTransaction(nsHttpTransaction* trans); bool Claim(); void Unclaim(); @@ -452,7 +452,7 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { void CancelFastOpenConnection(); private: - nsresult SetupConn(nsIAsyncOutputStream *out, bool aFastOpen); + nsresult SetupConn(nsIAsyncOutputStream* out, bool aFastOpen); // To find out whether |mTransaction| is still in the connection entry's // pending queue. If the transaction is found and |removeWhenFound| is @@ -519,12 +519,12 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { class PendingTransactionInfo final : public ARefBase { public: - explicit PendingTransactionInfo(nsHttpTransaction *trans) + explicit PendingTransactionInfo(nsHttpTransaction* trans) : mTransaction(trans) {} NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PendingTransactionInfo, override) - void PrintDiagnostics(nsCString &log); + void PrintDiagnostics(nsCString& log); public: // meant to be public. RefPtr mTransaction; @@ -538,8 +538,8 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { class PendingComparator { public: - bool Equals(const PendingTransactionInfo *aPendingTrans, - const nsAHttpTransaction *aTrans) const { + bool Equals(const PendingTransactionInfo* aPendingTrans, + const nsAHttpTransaction* aTrans) const { return aPendingTrans->mTransaction.get() == aTrans; } }; @@ -571,10 +571,10 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // NOTE: these members are only accessed on the socket transport thread //------------------------------------------------------------------------- - MOZ_MUST_USE bool ProcessPendingQForEntry(nsConnectionEntry *, + MOZ_MUST_USE bool ProcessPendingQForEntry(nsConnectionEntry*, bool considerAll); - bool DispatchPendingQ(nsTArray> &pendingQ, - nsConnectionEntry *ent, bool considerAll); + bool DispatchPendingQ(nsTArray>& pendingQ, + nsConnectionEntry* ent, bool considerAll); // This function selects transactions from mPendingTransactionTable to // dispatch according to the following conditions: @@ -585,112 +585,111 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // 3. If |considerAll| is true, fill the |pendingQ| with the transactions from // both focused window and non-focused window queues. void PreparePendingQForDispatching( - nsConnectionEntry *ent, - nsTArray> &pendingQ, bool considerAll); + nsConnectionEntry* ent, + nsTArray>& pendingQ, bool considerAll); // Return total active connection count, which is the sum of // active connections and unconnected half open connections. - uint32_t TotalActiveConnections(nsConnectionEntry *ent) const; + uint32_t TotalActiveConnections(nsConnectionEntry* ent) const; // Return |mMaxPersistConnsPerProxy| or |mMaxPersistConnsPerHost|, // depending whether the proxy is used. - uint32_t MaxPersistConnections(nsConnectionEntry *ent) const; + uint32_t MaxPersistConnections(nsConnectionEntry* ent) const; - bool AtActiveConnectionLimit(nsConnectionEntry *, uint32_t caps); + bool AtActiveConnectionLimit(nsConnectionEntry*, uint32_t caps); MOZ_MUST_USE nsresult - TryDispatchTransaction(nsConnectionEntry *ent, bool onlyReusedConnection, - PendingTransactionInfo *pendingTransInfo); + TryDispatchTransaction(nsConnectionEntry* ent, bool onlyReusedConnection, + PendingTransactionInfo* pendingTransInfo); MOZ_MUST_USE nsresult TryDispatchTransactionOnIdleConn( - nsConnectionEntry *ent, PendingTransactionInfo *pendingTransInfo, - bool respectUrgency, bool *allUrgent = nullptr); - MOZ_MUST_USE nsresult DispatchTransaction(nsConnectionEntry *, - nsHttpTransaction *, - nsHttpConnection *); - MOZ_MUST_USE nsresult DispatchAbstractTransaction(nsConnectionEntry *, - nsAHttpTransaction *, - uint32_t, - nsHttpConnection *, + nsConnectionEntry* ent, PendingTransactionInfo* pendingTransInfo, + bool respectUrgency, bool* allUrgent = nullptr); + MOZ_MUST_USE nsresult DispatchTransaction(nsConnectionEntry*, + nsHttpTransaction*, + nsHttpConnection*); + MOZ_MUST_USE nsresult DispatchAbstractTransaction(nsConnectionEntry*, + nsAHttpTransaction*, + uint32_t, nsHttpConnection*, int32_t); - bool RestrictConnections(nsConnectionEntry *); - MOZ_MUST_USE nsresult ProcessNewTransaction(nsHttpTransaction *); + bool RestrictConnections(nsConnectionEntry*); + MOZ_MUST_USE nsresult ProcessNewTransaction(nsHttpTransaction*); MOZ_MUST_USE nsresult EnsureSocketThreadTarget(); - void ClosePersistentConnections(nsConnectionEntry *ent); - void ReportProxyTelemetry(nsConnectionEntry *ent); + void ClosePersistentConnections(nsConnectionEntry* ent); + void ReportProxyTelemetry(nsConnectionEntry* ent); MOZ_MUST_USE nsresult - CreateTransport(nsConnectionEntry *, nsAHttpTransaction *, uint32_t, bool, - bool, bool, bool, PendingTransactionInfo *pendingTransInfo); - void AddActiveConn(nsHttpConnection *, nsConnectionEntry *); - void DecrementActiveConnCount(nsHttpConnection *); + CreateTransport(nsConnectionEntry*, nsAHttpTransaction*, uint32_t, bool, bool, + bool, bool, PendingTransactionInfo* pendingTransInfo); + void AddActiveConn(nsHttpConnection*, nsConnectionEntry*); + void DecrementActiveConnCount(nsHttpConnection*); void StartedConnect(); void RecvdConnect(); // This function will unclaim the claimed connection or set a halfOpen // socket to the speculative state if the transaction claiming them ends up // using another connection. - void ReleaseClaimedSockets(nsConnectionEntry *ent, - PendingTransactionInfo *pendingTransInfo); + void ReleaseClaimedSockets(nsConnectionEntry* ent, + PendingTransactionInfo* pendingTransInfo); void InsertTransactionSorted( - nsTArray> &pendingQ, - PendingTransactionInfo *pendingTransInfo, + nsTArray>& pendingQ, + PendingTransactionInfo* pendingTransInfo, bool aInsertAsFirstForTheSamePriority = false); - nsConnectionEntry *GetOrCreateConnectionEntry(nsHttpConnectionInfo *, + nsConnectionEntry* GetOrCreateConnectionEntry(nsHttpConnectionInfo*, bool allowWildCard); MOZ_MUST_USE nsresult MakeNewConnection( - nsConnectionEntry *ent, PendingTransactionInfo *pendingTransInfo); + nsConnectionEntry* ent, PendingTransactionInfo* pendingTransInfo); // Manage h2 connection coalescing // The hashtable contains arrays of weak pointers to nsHttpConnections nsClassHashtable> mCoalescingHash; - nsHttpConnection *FindCoalescableConnection(nsConnectionEntry *ent, + nsHttpConnection* FindCoalescableConnection(nsConnectionEntry* ent, bool justKidding); - nsHttpConnection *FindCoalescableConnectionByHashKey(nsConnectionEntry *ent, - const nsCString &key, + nsHttpConnection* FindCoalescableConnectionByHashKey(nsConnectionEntry* ent, + const nsCString& key, bool justKidding); - void UpdateCoalescingForNewConn(nsHttpConnection *conn, - nsConnectionEntry *ent); - nsHttpConnection *GetSpdyActiveConn(nsConnectionEntry *ent); + void UpdateCoalescingForNewConn(nsHttpConnection* conn, + nsConnectionEntry* ent); + nsHttpConnection* GetSpdyActiveConn(nsConnectionEntry* ent); - void ProcessSpdyPendingQ(nsConnectionEntry *ent); - void DispatchSpdyPendingQ(nsTArray> &pendingQ, - nsConnectionEntry *ent, nsHttpConnection *conn); + void ProcessSpdyPendingQ(nsConnectionEntry* ent); + void DispatchSpdyPendingQ(nsTArray>& pendingQ, + nsConnectionEntry* ent, nsHttpConnection* conn); // used to marshall events to the socket transport thread. MOZ_MUST_USE nsresult PostEvent(nsConnEventHandler handler, int32_t iparam = 0, - ARefBase *vparam = nullptr); + ARefBase* vparam = nullptr); // Used to close all transactions in the |pendingQ| with the given |reason|. // Note that the |pendingQ| will be also cleared. void CancelTransactionsHelper( - nsTArray> &pendingQ, - const nsHttpConnectionInfo *ci, const nsConnectionEntry *ent, + nsTArray>& pendingQ, + const nsHttpConnectionInfo* ci, const nsConnectionEntry* ent, nsresult reason); // message handlers - void OnMsgShutdown(int32_t, ARefBase *); - void OnMsgShutdownConfirm(int32_t, ARefBase *); - void OnMsgNewTransaction(int32_t, ARefBase *); - void OnMsgNewTransactionWithStickyConn(int32_t, ARefBase *); - void OnMsgReschedTransaction(int32_t, ARefBase *); - void OnMsgUpdateClassOfServiceOnTransaction(int32_t, ARefBase *); - void OnMsgCancelTransaction(int32_t, ARefBase *); - void OnMsgCancelTransactions(int32_t, ARefBase *); - void OnMsgProcessPendingQ(int32_t, ARefBase *); - void OnMsgPruneDeadConnections(int32_t, ARefBase *); - void OnMsgSpeculativeConnect(int32_t, ARefBase *); - void OnMsgReclaimConnection(int32_t, ARefBase *); - void OnMsgCompleteUpgrade(int32_t, ARefBase *); - void OnMsgUpdateParam(int32_t, ARefBase *); - void OnMsgDoShiftReloadConnectionCleanup(int32_t, ARefBase *); - void OnMsgProcessFeedback(int32_t, ARefBase *); - void OnMsgProcessAllSpdyPendingQ(int32_t, ARefBase *); - void OnMsgUpdateRequestTokenBucket(int32_t, ARefBase *); - void OnMsgVerifyTraffic(int32_t, ARefBase *); - void OnMsgPruneNoTraffic(int32_t, ARefBase *); - void OnMsgUpdateCurrentTopLevelOuterContentWindowId(int32_t, ARefBase *); + void OnMsgShutdown(int32_t, ARefBase*); + void OnMsgShutdownConfirm(int32_t, ARefBase*); + void OnMsgNewTransaction(int32_t, ARefBase*); + void OnMsgNewTransactionWithStickyConn(int32_t, ARefBase*); + void OnMsgReschedTransaction(int32_t, ARefBase*); + void OnMsgUpdateClassOfServiceOnTransaction(int32_t, ARefBase*); + void OnMsgCancelTransaction(int32_t, ARefBase*); + void OnMsgCancelTransactions(int32_t, ARefBase*); + void OnMsgProcessPendingQ(int32_t, ARefBase*); + void OnMsgPruneDeadConnections(int32_t, ARefBase*); + void OnMsgSpeculativeConnect(int32_t, ARefBase*); + void OnMsgReclaimConnection(int32_t, ARefBase*); + void OnMsgCompleteUpgrade(int32_t, ARefBase*); + void OnMsgUpdateParam(int32_t, ARefBase*); + void OnMsgDoShiftReloadConnectionCleanup(int32_t, ARefBase*); + void OnMsgProcessFeedback(int32_t, ARefBase*); + void OnMsgProcessAllSpdyPendingQ(int32_t, ARefBase*); + void OnMsgUpdateRequestTokenBucket(int32_t, ARefBase*); + void OnMsgVerifyTraffic(int32_t, ARefBase*); + void OnMsgPruneNoTraffic(int32_t, ARefBase*); + void OnMsgUpdateCurrentTopLevelOuterContentWindowId(int32_t, ARefBase*); // Total number of active connections in all of the ConnectionEntry objects // that are accessed from mCT connection table. @@ -732,7 +731,7 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { void TimeoutTick(); // For diagnostics - void OnMsgPrintDiagnostics(int32_t, ARefBase *); + void OnMsgPrintDiagnostics(int32_t, ARefBase*); nsCString mLogData; uint64_t mCurrentTopLevelOuterContentWindowId; @@ -799,9 +798,9 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { // Simple helpers, iterates the given hash/array and resume. // @param excludeActive: skip active tabid transactions. void ResumeReadOf( - nsClassHashtable>> &, + nsClassHashtable>>&, bool excludeActive = false); - void ResumeReadOf(nsTArray> *); + void ResumeReadOf(nsTArray>*); // Cached status of the active tab active transactions existence, // saves a lot of hashtable lookups @@ -810,8 +809,8 @@ class nsHttpConnectionMgr final : public nsIObserver, public AltSvcCache { void LogActiveTransactions(char); - nsTArray> *GetTransactionPendingQHelper( - nsConnectionEntry *ent, nsAHttpTransaction *trans); + nsTArray>* GetTransactionPendingQHelper( + nsConnectionEntry* ent, nsAHttpTransaction* trans); // When current active tab is changed, this function uses // |previousWindowId| to select background transactions and diff --git a/netwerk/protocol/http/nsHttpDigestAuth.cpp b/netwerk/protocol/http/nsHttpDigestAuth.cpp index a4d8bdbad7384..ed725da7026e7 100644 --- a/netwerk/protocol/http/nsHttpDigestAuth.cpp +++ b/netwerk/protocol/http/nsHttpDigestAuth.cpp @@ -51,7 +51,7 @@ NS_IMPL_ISUPPORTS(nsHttpDigestAuth, nsIHttpAuthenticator) // nsHttpDigestAuth //----------------------------------------------------------------------------- -nsresult nsHttpDigestAuth::MD5Hash(const char *buf, uint32_t len) { +nsresult nsHttpDigestAuth::MD5Hash(const char* buf, uint32_t len) { nsresult rv; // Cache a reference to the nsICryptoHash instance since we'll be calling @@ -67,7 +67,7 @@ nsresult nsHttpDigestAuth::MD5Hash(const char *buf, uint32_t len) { rv = mVerifier->Init(nsICryptoHash::MD5); if (NS_FAILED(rv)) return rv; - rv = mVerifier->Update((unsigned char *)buf, len); + rv = mVerifier->Update((unsigned char*)buf, len); if (NS_FAILED(rv)) return rv; nsAutoCString hashString; @@ -81,8 +81,8 @@ nsresult nsHttpDigestAuth::MD5Hash(const char *buf, uint32_t len) { } nsresult nsHttpDigestAuth::GetMethodAndPath( - nsIHttpAuthenticableChannel *authChannel, bool isProxyAuth, - nsCString &httpMethod, nsCString &path) { + nsIHttpAuthenticableChannel* authChannel, bool isProxyAuth, + nsCString& httpMethod, nsCString& path) { nsresult rv, rv2; nsCOMPtr uri; rv = authChannel->GetURI(getter_AddRefs(uri)); @@ -138,11 +138,11 @@ nsresult nsHttpDigestAuth::GetMethodAndPath( //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpDigestAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel, - const char *challenge, bool isProxyAuth, - nsISupports **sessionState, - nsISupports **continuationState, - bool *result) { +nsHttpDigestAuth::ChallengeReceived(nsIHttpAuthenticableChannel* authChannel, + const char* challenge, bool isProxyAuth, + nsISupports** sessionState, + nsISupports** continuationState, + bool* result) { nsAutoCString realm, domain, nonce, opaque; bool stale; uint16_t algorithm, qop; @@ -163,20 +163,20 @@ nsHttpDigestAuth::ChallengeReceived(nsIHttpAuthenticableChannel *authChannel, NS_IMETHODIMP nsHttpDigestAuth::GenerateCredentialsAsync( - nsIHttpAuthenticableChannel *authChannel, - nsIHttpAuthenticatorCallback *aCallback, const char *challenge, - bool isProxyAuth, const char16_t *domain, const char16_t *username, - const char16_t *password, nsISupports *sessionState, - nsISupports *continuationState, nsICancelable **aCancellable) { + nsIHttpAuthenticableChannel* authChannel, + nsIHttpAuthenticatorCallback* aCallback, const char* challenge, + bool isProxyAuth, const char16_t* domain, const char16_t* username, + const char16_t* password, nsISupports* sessionState, + nsISupports* continuationState, nsICancelable** aCancellable) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsHttpDigestAuth::GenerateCredentials( - nsIHttpAuthenticableChannel *authChannel, const char *challenge, - bool isProxyAuth, const char16_t *userdomain, const char16_t *username, - const char16_t *password, nsISupports **sessionState, - nsISupports **continuationState, uint32_t *aFlags, char **creds) + nsIHttpAuthenticableChannel* authChannel, const char* challenge, + bool isProxyAuth, const char16_t* userdomain, const char16_t* username, + const char16_t* password, nsISupports** sessionState, + nsISupports** continuationState, uint32_t* aFlags, char** creds) { LOG(("nsHttpDigestAuth::GenerateCredentials [challenge=%s]\n", challenge)); @@ -380,7 +380,7 @@ nsHttpDigestAuth::GenerateCredentials( } NS_IMETHODIMP -nsHttpDigestAuth::GetAuthFlags(uint32_t *flags) { +nsHttpDigestAuth::GetAuthFlags(uint32_t* flags) { *flags = REQUEST_BASED | REUSABLE_CHALLENGE | IDENTITY_ENCRYPTED; // // NOTE: digest auth credentials must be uniquely computed for each request, @@ -390,9 +390,9 @@ nsHttpDigestAuth::GetAuthFlags(uint32_t *flags) { } nsresult nsHttpDigestAuth::CalculateResponse( - const char *ha1_digest, const char *ha2_digest, const nsCString &nonce, - uint16_t qop, const char *nonce_count, const nsCString &cnonce, - char *result) { + const char* ha1_digest, const char* ha2_digest, const nsCString& nonce, + uint16_t qop, const char* nonce_count, const nsCString& cnonce, + char* result) { uint32_t len = 2 * EXPANDED_DIGEST_LENGTH + nonce.Length() + 2; if (qop & QOP_AUTH || qop & QOP_AUTH_INT) { @@ -429,7 +429,7 @@ nsresult nsHttpDigestAuth::CalculateResponse( return rv; } -nsresult nsHttpDigestAuth::ExpandToHex(const char *digest, char *result) { +nsresult nsHttpDigestAuth::ExpandToHex(const char* digest, char* result) { int16_t index, value; for (index = 0; index < DIGEST_LENGTH; index++) { @@ -450,12 +450,12 @@ nsresult nsHttpDigestAuth::ExpandToHex(const char *digest, char *result) { return NS_OK; } -nsresult nsHttpDigestAuth::CalculateHA1(const nsCString &username, - const nsCString &password, - const nsCString &realm, +nsresult nsHttpDigestAuth::CalculateHA1(const nsCString& username, + const nsCString& password, + const nsCString& realm, uint16_t algorithm, - const nsCString &nonce, - const nsCString &cnonce, char *result) { + const nsCString& nonce, + const nsCString& cnonce, char* result) { int16_t len = username.Length() + password.Length() + realm.Length() + 2; if (algorithm & ALGO_MD5_SESS) { int16_t exlen = @@ -494,9 +494,9 @@ nsresult nsHttpDigestAuth::CalculateHA1(const nsCString &username, return ExpandToHex(mHashBuf, result); } -nsresult nsHttpDigestAuth::CalculateHA2(const nsCString &method, - const nsCString &path, uint16_t qop, - const char *bodyDigest, char *result) { +nsresult nsHttpDigestAuth::CalculateHA2(const nsCString& method, + const nsCString& path, uint16_t qop, + const char* bodyDigest, char* result) { uint16_t methodLen = method.Length(); uint32_t pathLen = path.Length(); uint32_t len = methodLen + pathLen + 1; @@ -522,18 +522,18 @@ nsresult nsHttpDigestAuth::CalculateHA2(const nsCString &method, return rv; } -nsresult nsHttpDigestAuth::ParseChallenge(const char *challenge, - nsACString &realm, nsACString &domain, - nsACString &nonce, nsACString &opaque, - bool *stale, uint16_t *algorithm, - uint16_t *qop) { +nsresult nsHttpDigestAuth::ParseChallenge(const char* challenge, + nsACString& realm, nsACString& domain, + nsACString& nonce, nsACString& opaque, + bool* stale, uint16_t* algorithm, + uint16_t* qop) { // put an absurd, but maximum, length cap on the challenge so // that calculations are 32 bit safe if (strlen(challenge) > 16000000) { return NS_ERROR_INVALID_ARG; } - const char *p = challenge + 6; // first 6 characters are "Digest" + const char* p = challenge + 6; // first 6 characters are "Digest" *stale = false; *algorithm = ALGO_MD5; // default is MD5 @@ -623,8 +623,8 @@ nsresult nsHttpDigestAuth::ParseChallenge(const char *challenge, return NS_OK; } -nsresult nsHttpDigestAuth::AppendQuotedString(const nsACString &value, - nsACString &aHeaderLine) { +nsresult nsHttpDigestAuth::AppendQuotedString(const nsACString& value, + nsACString& aHeaderLine) { nsAutoCString quoted; nsACString::const_iterator s, e; value.BeginReading(s); diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 2a6f6bdaf1d6d..afe259ab53e7c 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -141,8 +141,8 @@ namespace net { LazyLogModule gHttpLog("nsHttp"); -static nsresult NewURI(const nsACString &aSpec, const char *aCharset, - nsIURI *aBaseURI, int32_t aDefaultPort, nsIURI **aURI) { +static nsresult NewURI(const nsACString& aSpec, const char* aCharset, + nsIURI* aBaseURI, int32_t aDefaultPort, nsIURI** aURI) { nsCOMPtr base(aBaseURI); return NS_MutateURI(new nsStandardURL::Mutator()) .Apply(NS_MutatorMethod(&nsIStandardURLMutator::Init, @@ -371,7 +371,7 @@ void nsHttpHandler::SetFastOpenOSSupport() { nsCCharSeparatedTokenizer tokenizer(version, '.'); while ((inx < 2) && tokenizer.hasMoreTokens()) { nsAutoCString token(tokenizer.nextToken()); - const char *nondigit = NS_strspnp("0123456789", token.get()); + const char* nondigit = NS_strspnp("0123456789", token.get()); if (nondigit && *nondigit) { break; } @@ -435,7 +435,7 @@ nsHttpHandler::~nsHttpHandler() { nsHttp::DestroyAtomTable(); } -static const char *gCallbackPrefs[] = { +static const char* gCallbackPrefs[] = { HTTP_PREF_PREFIX, UA_PREF_PREFIX, INTL_ACCEPT_LANGUAGES, @@ -545,7 +545,7 @@ nsresult nsHttpHandler::Init() { // Bring alive the objects in the http-protocol-startup category NS_CreateServicesFromCategory( NS_HTTP_STARTUP_CATEGORY, - static_cast(static_cast(this)), + static_cast(static_cast(this)), NS_HTTP_STARTUP_TOPIC); nsCOMPtr obsService = services::GetObserverService(); @@ -633,7 +633,7 @@ nsresult nsHttpHandler::InitConnectionMgr() { } nsresult nsHttpHandler::AddStandardRequestHeaders( - nsHttpRequestHead *request, bool isSecure, + nsHttpRequestHead* request, bool isSecure, nsContentPolicyType aContentPolicyType) { nsresult rv; @@ -696,7 +696,7 @@ nsresult nsHttpHandler::AddStandardRequestHeaders( return NS_OK; } -nsresult nsHttpHandler::AddConnectionHeader(nsHttpRequestHead *request, +nsresult nsHttpHandler::AddConnectionHeader(nsHttpRequestHead* request, uint32_t caps) { // RFC2616 section 19.6.2 states that the "Connection: keep-alive" // and "Keep-alive" request headers should not be sent by HTTP/1.1 @@ -706,7 +706,7 @@ nsresult nsHttpHandler::AddConnectionHeader(nsHttpRequestHead *request, NS_NAMED_LITERAL_CSTRING(close, "close"); NS_NAMED_LITERAL_CSTRING(keepAlive, "keep-alive"); - const nsLiteralCString *connectionType = &close; + const nsLiteralCString* connectionType = &close; if (caps & NS_HTTP_ALLOW_KEEPALIVE) { connectionType = &keepAlive; } @@ -714,7 +714,7 @@ nsresult nsHttpHandler::AddConnectionHeader(nsHttpRequestHead *request, return request->SetHeader(nsHttp::Connection, *connectionType); } -bool nsHttpHandler::IsAcceptableEncoding(const char *enc, bool isSecure) { +bool nsHttpHandler::IsAcceptableEncoding(const char* enc, bool isSecure) { if (!enc) return false; // we used to accept x-foo anytime foo was acceptable, but that's just @@ -771,7 +771,7 @@ void nsHttpHandler::IncrementFastOpenStallsCounter() { } nsresult nsHttpHandler::GetStreamConverterService( - nsIStreamConverterService **result) { + nsIStreamConverterService** result) { if (!mStreamConvSvc) { nsresult rv; nsCOMPtr service = @@ -785,7 +785,7 @@ nsresult nsHttpHandler::GetStreamConverterService( return NS_OK; } -nsISiteSecurityService *nsHttpHandler::GetSSService() { +nsISiteSecurityService* nsHttpHandler::GetSSService() { if (!mSSService) { nsCOMPtr service = do_GetService(NS_SSSERVICE_CONTRACTID); @@ -795,7 +795,7 @@ nsISiteSecurityService *nsHttpHandler::GetSSService() { return mSSService; } -nsICookieService *nsHttpHandler::GetCookieService() { +nsICookieService* nsHttpHandler::GetCookieService() { if (!mCookieService) { nsCOMPtr service = do_GetService(NS_COOKIESERVICE_CONTRACTID); @@ -805,7 +805,7 @@ nsICookieService *nsHttpHandler::GetCookieService() { return mCookieService; } -nsresult nsHttpHandler::GetIOService(nsIIOService **result) { +nsresult nsHttpHandler::GetIOService(nsIIOService** result) { NS_ENSURE_ARG_POINTER(result); NS_ADDREF(*result = mIOService); @@ -831,15 +831,15 @@ uint32_t nsHttpHandler::Get32BitsOfPseudoRandom() { #endif } -void nsHttpHandler::NotifyObservers(nsIHttpChannel *chan, const char *event) { +void nsHttpHandler::NotifyObservers(nsIHttpChannel* chan, const char* event) { LOG(("nsHttpHandler::NotifyObservers [chan=%p event=\"%s\"]\n", chan, event)); nsCOMPtr obsService = services::GetObserverService(); if (obsService) obsService->NotifyObservers(chan, event, nullptr); } nsresult nsHttpHandler::AsyncOnChannelRedirect( - nsIChannel *oldChan, nsIChannel *newChan, uint32_t flags, - nsIEventTarget *mainThreadEventTarget) { + nsIChannel* oldChan, nsIChannel* newChan, uint32_t flags, + nsIEventTarget* mainThreadEventTarget) { MOZ_ASSERT(NS_IsMainThread() && (oldChan && newChan)); nsCOMPtr newURI; @@ -864,8 +864,8 @@ nsresult nsHttpHandler::AsyncOnChannelRedirect( } /* static */ -nsresult nsHttpHandler::GenerateHostPort(const nsCString &host, int32_t port, - nsACString &hostLine) { +nsresult nsHttpHandler::GenerateHostPort(const nsCString& host, int32_t port, + nsACString& hostLine) { return NS_GenerateHostPort(host, port, hostLine); } @@ -873,7 +873,7 @@ nsresult nsHttpHandler::GenerateHostPort(const nsCString &host, int32_t port, // nsHttpHandler //----------------------------------------------------------------------------- -const nsCString &nsHttpHandler::UserAgent() { +const nsCString& nsHttpHandler::UserAgent() { if (nsContentUtils::ShouldResistFingerprinting() && !mSpoofedUserAgent.IsEmpty()) { LOG(("using spoofed userAgent : %s\n", mSpoofedUserAgent.get())); @@ -1037,7 +1037,7 @@ void nsHttpHandler::InitUserAgentComponents() { # pragma warning(disable : 4996) if (GetVersionEx(&info)) { # pragma warning(pop) - const char *format; + const char* format; # if defined _M_IA64 format = WNT_BASE W64_PREFIX "; IA64"; # elif defined _M_X64 || defined _M_AMD64 @@ -1071,10 +1071,10 @@ void nsHttpHandler::InitUserAgentComponents() { int ret = uname(&name); if (ret >= 0) { nsAutoCString buf; - buf = (char *)name.sysname; + buf = (char*)name.sysname; if (strcmp(name.machine, "x86_64") == 0 && - sizeof(void *) == sizeof(int32_t)) { + sizeof(void*) == sizeof(int32_t)) { // We're running 32-bit code on x86_64. Make this browser // look like it's running on i686 hardware, but append " // (x86_64)" to the end of the oscpu identifier to be able @@ -1089,11 +1089,11 @@ void nsHttpHandler::InitUserAgentComponents() { // AIX uname returns machine specific info in the uname.machine // field and does not return the cpu type like other platforms. // We use the AIX version and release numbers instead. - buf += (char *)name.version; + buf += (char*)name.version; buf += '.'; - buf += (char *)name.release; + buf += (char*)name.release; # else - buf += (char *)name.machine; + buf += (char*)name.machine; # endif } @@ -1121,7 +1121,7 @@ uint32_t nsHttpHandler::MaxSocketCount() { return maxCount; } -void nsHttpHandler::PrefsChanged(const char *pref) { +void nsHttpHandler::PrefsChanged(const char* pref) { nsresult rv = NS_OK; int32_t val; @@ -1964,8 +1964,8 @@ void nsHttpHandler::PrefsChanged(const char *pref) { * passing: "en, ja, fr_CA" * returns: "en,ja;q=0.7,fr_CA;q=0.3" */ -static nsresult PrepareAcceptLanguages(const char *i_AcceptLanguages, - nsACString &o_AcceptLanguages) { +static nsresult PrepareAcceptLanguages(const char* i_AcceptLanguages, + nsACString& o_AcceptLanguages) { if (!i_AcceptLanguages) return NS_OK; const nsAutoCString ns_accept_languages(i_AcceptLanguages); @@ -1987,7 +1987,7 @@ nsresult nsHttpHandler::SetAcceptLanguages() { return rv; } -nsresult nsHttpHandler::SetAcceptEncodings(const char *aAcceptEncodings, +nsresult nsHttpHandler::SetAcceptEncodings(const char* aAcceptEncodings, bool isSecure) { if (isSecure) { mHttpsAcceptEncodings = aAcceptEncodings; @@ -2015,33 +2015,33 @@ NS_IMPL_ISUPPORTS(nsHttpHandler, nsIHttpProtocolHandler, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpHandler::GetScheme(nsACString &aScheme) { +nsHttpHandler::GetScheme(nsACString& aScheme) { aScheme.AssignLiteral("http"); return NS_OK; } NS_IMETHODIMP -nsHttpHandler::GetDefaultPort(int32_t *result) { +nsHttpHandler::GetDefaultPort(int32_t* result) { *result = NS_HTTP_DEFAULT_PORT; return NS_OK; } NS_IMETHODIMP -nsHttpHandler::GetProtocolFlags(uint32_t *result) { +nsHttpHandler::GetProtocolFlags(uint32_t* result) { *result = NS_HTTP_PROTOCOL_FLAGS; return NS_OK; } NS_IMETHODIMP -nsHttpHandler::NewURI(const nsACString &aSpec, const char *aCharset, - nsIURI *aBaseURI, nsIURI **aURI) { +nsHttpHandler::NewURI(const nsACString& aSpec, const char* aCharset, + nsIURI* aBaseURI, nsIURI** aURI) { return mozilla::net::NewURI(aSpec, aCharset, aBaseURI, NS_HTTP_DEFAULT_PORT, aURI); } NS_IMETHODIMP -nsHttpHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, - nsIChannel **result) { +nsHttpHandler::NewChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, + nsIChannel** result) { LOG(("nsHttpHandler::NewChannel\n")); NS_ENSURE_ARG_POINTER(uri); @@ -2065,7 +2065,7 @@ nsHttpHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, } NS_IMETHODIMP -nsHttpHandler::AllowPort(int32_t port, const char *scheme, bool *_retval) { +nsHttpHandler::AllowPort(int32_t port, const char* scheme, bool* _retval) { // don't override anything. *_retval = false; return NS_OK; @@ -2076,9 +2076,9 @@ nsHttpHandler::AllowPort(int32_t port, const char *scheme, bool *_retval) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpHandler::NewProxiedChannel(nsIURI *uri, nsIProxyInfo *givenProxyInfo, - uint32_t proxyResolveFlags, nsIURI *proxyURI, - nsILoadInfo *aLoadInfo, nsIChannel **result) { +nsHttpHandler::NewProxiedChannel(nsIURI* uri, nsIProxyInfo* givenProxyInfo, + uint32_t proxyResolveFlags, nsIURI* proxyURI, + nsILoadInfo* aLoadInfo, nsIChannel** result) { RefPtr httpChannel; LOG(("nsHttpHandler::NewProxiedChannel [proxyInfo=%p]\n", givenProxyInfo)); @@ -2146,37 +2146,37 @@ nsHttpHandler::NewProxiedChannel(nsIURI *uri, nsIProxyInfo *givenProxyInfo, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpHandler::GetUserAgent(nsACString &value) { +nsHttpHandler::GetUserAgent(nsACString& value) { value = UserAgent(); return NS_OK; } NS_IMETHODIMP -nsHttpHandler::GetAppName(nsACString &value) { +nsHttpHandler::GetAppName(nsACString& value) { value = mLegacyAppName; return NS_OK; } NS_IMETHODIMP -nsHttpHandler::GetAppVersion(nsACString &value) { +nsHttpHandler::GetAppVersion(nsACString& value) { value = mLegacyAppVersion; return NS_OK; } NS_IMETHODIMP -nsHttpHandler::GetPlatform(nsACString &value) { +nsHttpHandler::GetPlatform(nsACString& value) { value = mPlatform; return NS_OK; } NS_IMETHODIMP -nsHttpHandler::GetOscpu(nsACString &value) { +nsHttpHandler::GetOscpu(nsACString& value) { value = mOscpu; return NS_OK; } NS_IMETHODIMP -nsHttpHandler::GetMisc(nsACString &value) { +nsHttpHandler::GetMisc(nsACString& value) { value = mMisc; return NS_OK; } @@ -2186,8 +2186,8 @@ nsHttpHandler::GetMisc(nsACString &value) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsHttpHandler::Observe(nsISupports *subject, const char *topic, - const char16_t *data) { +nsHttpHandler::Observe(nsISupports* subject, const char* topic, + const char16_t* data) { MOZ_ASSERT(NS_IsMainThread()); LOG(("nsHttpHandler::Observe [topic=\"%s\"]\n", topic)); @@ -2399,7 +2399,7 @@ void nsHttpHandler::MaybeEnableSpeculativeConnect() { } nsresult nsHttpHandler::SpeculativeConnectInternal( - nsIURI *aURI, nsIPrincipal *aPrincipal, nsIInterfaceRequestor *aCallbacks, + nsIURI* aURI, nsIPrincipal* aPrincipal, nsIInterfaceRequestor* aCallbacks, bool anonymous) { if (IsNeckoChild()) { ipc::URIParams params; @@ -2418,9 +2418,9 @@ nsresult nsHttpHandler::SpeculativeConnectInternal( // feature obsService->NotifyObservers(nullptr, "speculative-connect-request", nullptr); - for (auto *cp : + for (auto* cp : dom::ContentParent::AllProcesses(dom::ContentParent::eLive)) { - PNeckoParent *neckoParent = + PNeckoParent* neckoParent = SingleManagedOrNull(cp->ManagedPNeckoParent()); if (!neckoParent) { continue; @@ -2429,7 +2429,7 @@ nsresult nsHttpHandler::SpeculativeConnectInternal( } } - nsISiteSecurityService *sss = gHttpHandler->GetSSService(); + nsISiteSecurityService* sss = gHttpHandler->GetSSService(); bool isStsHost = false; if (!sss) return NS_OK; @@ -2509,19 +2509,19 @@ nsresult nsHttpHandler::SpeculativeConnectInternal( } NS_IMETHODIMP -nsHttpHandler::SpeculativeConnect(nsIURI *aURI, nsIPrincipal *aPrincipal, - nsIInterfaceRequestor *aCallbacks) { +nsHttpHandler::SpeculativeConnect(nsIURI* aURI, nsIPrincipal* aPrincipal, + nsIInterfaceRequestor* aCallbacks) { return SpeculativeConnectInternal(aURI, aPrincipal, aCallbacks, false); } NS_IMETHODIMP -nsHttpHandler::SpeculativeAnonymousConnect(nsIURI *aURI, - nsIPrincipal *aPrincipal, - nsIInterfaceRequestor *aCallbacks) { +nsHttpHandler::SpeculativeAnonymousConnect(nsIURI* aURI, + nsIPrincipal* aPrincipal, + nsIInterfaceRequestor* aCallbacks) { return SpeculativeConnectInternal(aURI, aPrincipal, aCallbacks, true); } -void nsHttpHandler::TickleWifi(nsIInterfaceRequestor *cb) { +void nsHttpHandler::TickleWifi(nsIInterfaceRequestor* cb) { if (!cb || !mWifiTickler) return; // If B2G requires a similar mechanism nsINetworkManager, currently only avail @@ -2562,40 +2562,40 @@ nsresult nsHttpsHandler::Init() { } NS_IMETHODIMP -nsHttpsHandler::GetScheme(nsACString &aScheme) { +nsHttpsHandler::GetScheme(nsACString& aScheme) { aScheme.AssignLiteral("https"); return NS_OK; } NS_IMETHODIMP -nsHttpsHandler::GetDefaultPort(int32_t *aPort) { +nsHttpsHandler::GetDefaultPort(int32_t* aPort) { *aPort = NS_HTTPS_DEFAULT_PORT; return NS_OK; } NS_IMETHODIMP -nsHttpsHandler::GetProtocolFlags(uint32_t *aProtocolFlags) { +nsHttpsHandler::GetProtocolFlags(uint32_t* aProtocolFlags) { *aProtocolFlags = NS_HTTP_PROTOCOL_FLAGS | URI_IS_POTENTIALLY_TRUSTWORTHY; return NS_OK; } NS_IMETHODIMP -nsHttpsHandler::NewURI(const nsACString &aSpec, const char *aOriginCharset, - nsIURI *aBaseURI, nsIURI **_retval) { +nsHttpsHandler::NewURI(const nsACString& aSpec, const char* aOriginCharset, + nsIURI* aBaseURI, nsIURI** _retval) { return mozilla::net::NewURI(aSpec, aOriginCharset, aBaseURI, NS_HTTPS_DEFAULT_PORT, _retval); } NS_IMETHODIMP -nsHttpsHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, - nsIChannel **_retval) { +nsHttpsHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, + nsIChannel** _retval) { MOZ_ASSERT(gHttpHandler); if (!gHttpHandler) return NS_ERROR_UNEXPECTED; return gHttpHandler->NewChannel(aURI, aLoadInfo, _retval); } NS_IMETHODIMP -nsHttpsHandler::AllowPort(int32_t aPort, const char *aScheme, bool *_retval) { +nsHttpsHandler::AllowPort(int32_t aPort, const char* aScheme, bool* _retval) { // don't override anything. *_retval = false; return NS_OK; @@ -2628,12 +2628,12 @@ nsresult nsHttpHandler::EnsureHSTSDataReadyNative( } NS_IMETHODIMP -nsHttpHandler::EnsureHSTSDataReady(JSContext *aCx, Promise **aPromise) { +nsHttpHandler::EnsureHSTSDataReady(JSContext* aCx, Promise** aPromise) { if (NS_WARN_IF(!aCx)) { return NS_ERROR_FAILURE; } - nsIGlobalObject *globalObject = xpc::CurrentNativeGlobal(aCx); + nsIGlobalObject* globalObject = xpc::CurrentNativeGlobal(aCx); if (NS_WARN_IF(!globalObject)) { return NS_ERROR_FAILURE; } @@ -2648,7 +2648,7 @@ nsHttpHandler::EnsureHSTSDataReady(JSContext *aCx, Promise **aPromise) { gNeckoChild->SendEnsureHSTSData()->Then( GetMainThreadSerialEventTarget(), __func__, [promise(promise)]( - NeckoChild::EnsureHSTSDataPromise::ResolveOrRejectValue &&aResult) { + NeckoChild::EnsureHSTSDataPromise::ResolveOrRejectValue&& aResult) { if (aResult.IsResolve()) { promise->MaybeResolve(aResult.ResolveValue()); } else { @@ -2681,7 +2681,7 @@ void nsHttpHandler::ShutdownConnectionManager() { } } -nsresult nsHttpHandler::NewChannelId(uint64_t &channelId) { +nsresult nsHttpHandler::NewChannelId(uint64_t& channelId) { MOZ_ASSERT(NS_IsMainThread()); channelId = ((static_cast(mProcessId) << 32) & 0xFFFFFFFF00000000LL) | @@ -2699,7 +2699,7 @@ TimeStamp const nsHttpHandler::GetLastActiveTabLoadOptimizationHit() { return mLastActiveTabLoadOptimizationHit; } -void nsHttpHandler::SetLastActiveTabLoadOptimizationHit(TimeStamp const &when) { +void nsHttpHandler::SetLastActiveTabLoadOptimizationHit(TimeStamp const& when) { MutexAutoLock lock(mLastActiveTabLoadOptimizationLock); if (mLastActiveTabLoadOptimizationHit.IsNull() || @@ -2709,23 +2709,23 @@ void nsHttpHandler::SetLastActiveTabLoadOptimizationHit(TimeStamp const &when) { } bool nsHttpHandler::IsBeforeLastActiveTabLoadOptimization( - TimeStamp const &when) { + TimeStamp const& when) { MutexAutoLock lock(mLastActiveTabLoadOptimizationLock); return !mLastActiveTabLoadOptimizationHit.IsNull() && when <= mLastActiveTabLoadOptimizationHit; } -void nsHttpHandler::BlacklistSpdy(const nsHttpConnectionInfo *ci) { +void nsHttpHandler::BlacklistSpdy(const nsHttpConnectionInfo* ci) { mConnMgr->BlacklistSpdy(ci); mBlacklistedSpdyOrigins.PutEntry(ci->GetOrigin()); } -bool nsHttpHandler::IsSpdyBlacklisted(const nsHttpConnectionInfo *ci) { +bool nsHttpHandler::IsSpdyBlacklisted(const nsHttpConnectionInfo* ci) { return mBlacklistedSpdyOrigins.Contains(ci->GetOrigin()); } -HttpTrafficAnalyzer *nsHttpHandler::GetHttpTrafficAnalyzer() { +HttpTrafficAnalyzer* nsHttpHandler::GetHttpTrafficAnalyzer() { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); if (!StaticPrefs::network_traffic_analyzer_enabled()) { diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h index 528543976c710..f9d8a34a58ca5 100644 --- a/netwerk/protocol/http/nsHttpHandler.h +++ b/netwerk/protocol/http/nsHttpHandler.h @@ -68,13 +68,13 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, static already_AddRefed GetInstance(); MOZ_MUST_USE nsresult - AddStandardRequestHeaders(nsHttpRequestHead *, bool isSecure, + AddStandardRequestHeaders(nsHttpRequestHead*, bool isSecure, nsContentPolicyType aContentPolicyType); - MOZ_MUST_USE nsresult AddConnectionHeader(nsHttpRequestHead *, + MOZ_MUST_USE nsresult AddConnectionHeader(nsHttpRequestHead*, uint32_t capabilities); - bool IsAcceptableEncoding(const char *encoding, bool isSecure); + bool IsAcceptableEncoding(const char* encoding, bool isSecure); - const nsCString &UserAgent(); + const nsCString& UserAgent(); enum HttpVersion HttpVersion() { return mHttpVersion; } enum HttpVersion ProxyHttpVersion() { return mProxyHttpVersion; } @@ -95,7 +95,7 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, PRIntervalTime ResponseTimeoutEnabled() { return mResponseTimeoutEnabled; } uint32_t NetworkChangedTimeout() { return mNetworkChangedTimeout; } uint16_t MaxRequestAttempts() { return mMaxRequestAttempts; } - const char *DefaultSocketType() { + const char* DefaultSocketType() { return mDefaultSocketType.IsVoid() ? nullptr : mDefaultSocketType.get(); } uint32_t PhishyUserPassLength() { return mPhishyUserPassLength; } @@ -216,10 +216,10 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, // network.http.enforce-framing.http1 and network.http.enforce-framing.soft FrameCheckLevel GetEnforceH1Framing() { return mEnforceH1Framing; } - nsHttpAuthCache *AuthCache(bool aPrivate) { + nsHttpAuthCache* AuthCache(bool aPrivate) { return aPrivate ? &mPrivateAuthCache : &mAuthCache; } - nsHttpConnectionMgr *ConnMgr() { return mConnMgr; } + nsHttpConnectionMgr* ConnMgr() { return mConnMgr; } // cache support uint32_t GenerateUniqueID() { return ++mLastUniqueID; } @@ -238,7 +238,7 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, // Called to kick-off a new transaction, by default the transaction // will be put on the pending transaction queue if it cannot be // initiated at this time. Callable from any thread. - MOZ_MUST_USE nsresult InitiateTransaction(nsHttpTransaction *trans, + MOZ_MUST_USE nsresult InitiateTransaction(nsHttpTransaction* trans, int32_t priority) { return mConnMgr->AddTransaction(trans, priority); } @@ -247,38 +247,38 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, // transaction will take a sticky connection from |transWithStickyConn| // and reuse it. MOZ_MUST_USE nsresult - InitiateTransactionWithStickyConn(nsHttpTransaction *trans, int32_t priority, - nsHttpTransaction *transWithStickyConn) { + InitiateTransactionWithStickyConn(nsHttpTransaction* trans, int32_t priority, + nsHttpTransaction* transWithStickyConn) { return mConnMgr->AddTransactionWithStickyConn(trans, priority, transWithStickyConn); } // Called to change the priority of an existing transaction that has // already been initiated. - MOZ_MUST_USE nsresult RescheduleTransaction(nsHttpTransaction *trans, + MOZ_MUST_USE nsresult RescheduleTransaction(nsHttpTransaction* trans, int32_t priority) { return mConnMgr->RescheduleTransaction(trans, priority); } - void UpdateClassOfServiceOnTransaction(nsHttpTransaction *trans, + void UpdateClassOfServiceOnTransaction(nsHttpTransaction* trans, uint32_t classOfService) { mConnMgr->UpdateClassOfServiceOnTransaction(trans, classOfService); } // Called to cancel a transaction, which may or may not be assigned to // a connection. Callable from any thread. - MOZ_MUST_USE nsresult CancelTransaction(nsHttpTransaction *trans, + MOZ_MUST_USE nsresult CancelTransaction(nsHttpTransaction* trans, nsresult reason) { return mConnMgr->CancelTransaction(trans, reason); } // Called when a connection is done processing a transaction. Callable // from any thread. - MOZ_MUST_USE nsresult ReclaimConnection(nsHttpConnection *conn) { + MOZ_MUST_USE nsresult ReclaimConnection(nsHttpConnection* conn) { return mConnMgr->ReclaimConnection(conn); } - MOZ_MUST_USE nsresult ProcessPendingQ(nsHttpConnectionInfo *cinfo) { + MOZ_MUST_USE nsresult ProcessPendingQ(nsHttpConnectionInfo* cinfo) { return mConnMgr->ProcessPendingQ(cinfo); } @@ -286,28 +286,28 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, return mConnMgr->ProcessPendingQ(); } - MOZ_MUST_USE nsresult GetSocketThreadTarget(nsIEventTarget **target) { + MOZ_MUST_USE nsresult GetSocketThreadTarget(nsIEventTarget** target) { return mConnMgr->GetSocketThreadTarget(target); } - MOZ_MUST_USE nsresult SpeculativeConnect(nsHttpConnectionInfo *ci, - nsIInterfaceRequestor *callbacks, + MOZ_MUST_USE nsresult SpeculativeConnect(nsHttpConnectionInfo* ci, + nsIInterfaceRequestor* callbacks, uint32_t caps = 0) { TickleWifi(callbacks); return mConnMgr->SpeculativeConnect(ci, callbacks, caps); } // Alternate Services Maps are main thread only - void UpdateAltServiceMapping(AltSvcMapping *map, nsProxyInfo *proxyInfo, - nsIInterfaceRequestor *callbacks, uint32_t caps, - const OriginAttributes &originAttributes) { + void UpdateAltServiceMapping(AltSvcMapping* map, nsProxyInfo* proxyInfo, + nsIInterfaceRequestor* callbacks, uint32_t caps, + const OriginAttributes& originAttributes) { mConnMgr->UpdateAltServiceMapping(map, proxyInfo, callbacks, caps, originAttributes); } already_AddRefed GetAltServiceMapping( - const nsACString &scheme, const nsACString &host, int32_t port, bool pb, - const OriginAttributes &originAttributes) { + const nsACString& scheme, const nsACString& host, int32_t port, bool pb, + const OriginAttributes& originAttributes) { return mConnMgr->GetAltServiceMapping(scheme, host, port, pb, originAttributes); } @@ -316,88 +316,88 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, // The HTTP handler caches pointers to specific XPCOM services, and // provides the following helper routines for accessing those services: // - MOZ_MUST_USE nsresult GetStreamConverterService(nsIStreamConverterService **); - MOZ_MUST_USE nsresult GetIOService(nsIIOService **service); - nsICookieService *GetCookieService(); // not addrefed - nsISiteSecurityService *GetSSService(); + MOZ_MUST_USE nsresult GetStreamConverterService(nsIStreamConverterService**); + MOZ_MUST_USE nsresult GetIOService(nsIIOService** service); + nsICookieService* GetCookieService(); // not addrefed + nsISiteSecurityService* GetSSService(); // callable from socket thread only uint32_t Get32BitsOfPseudoRandom(); // Called by the channel synchronously during asyncOpen - void OnFailedOpeningRequest(nsIHttpChannel *chan) { + void OnFailedOpeningRequest(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_FAILED_OPENING_REQUEST_TOPIC); } // Called by the channel synchronously during asyncOpen - void OnOpeningRequest(nsIHttpChannel *chan) { + void OnOpeningRequest(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_OPENING_REQUEST_TOPIC); } // Called by the channel before writing a request - void OnModifyRequest(nsIHttpChannel *chan) { + void OnModifyRequest(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_MODIFY_REQUEST_TOPIC); } // Called by the channel before writing a request - void OnStopRequest(nsIHttpChannel *chan) { + void OnStopRequest(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_STOP_REQUEST_TOPIC); } // Called by the channel and cached in the loadGroup - void OnUserAgentRequest(nsIHttpChannel *chan) { + void OnUserAgentRequest(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_USERAGENT_REQUEST_TOPIC); } // Called by the channel before setting up the transaction - void OnBeforeConnect(nsIHttpChannel *chan) { + void OnBeforeConnect(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_BEFORE_CONNECT_TOPIC); } // Called by the channel once headers are available - void OnExamineResponse(nsIHttpChannel *chan) { + void OnExamineResponse(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_EXAMINE_RESPONSE_TOPIC); } // Called by the channel once headers have been merged with cached headers - void OnExamineMergedResponse(nsIHttpChannel *chan) { + void OnExamineMergedResponse(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_EXAMINE_MERGED_RESPONSE_TOPIC); } // Called by the channel once it made background cache revalidation - void OnBackgroundRevalidation(nsIHttpChannel *chan) { + void OnBackgroundRevalidation(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_BACKGROUND_REVALIDATION); } // Called by channels before a redirect happens. This notifies both the // channel's and the global redirect observers. MOZ_MUST_USE nsresult AsyncOnChannelRedirect( - nsIChannel *oldChan, nsIChannel *newChan, uint32_t flags, - nsIEventTarget *mainThreadEventTarget = nullptr); + nsIChannel* oldChan, nsIChannel* newChan, uint32_t flags, + nsIEventTarget* mainThreadEventTarget = nullptr); // Called by the channel when the response is read from the cache without // communicating with the server. - void OnExamineCachedResponse(nsIHttpChannel *chan) { + void OnExamineCachedResponse(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_EXAMINE_CACHED_RESPONSE_TOPIC); } - void OnMayChangeProcess(nsIHttpChannel *chan) { + void OnMayChangeProcess(nsIHttpChannel* chan) { NotifyObservers(chan, NS_HTTP_ON_MAY_CHANGE_PROCESS_TOPIC); } // Generates the host:port string for use in the Host: header as well as the // CONNECT line for proxies. This handles IPv6 literals correctly. - static MOZ_MUST_USE nsresult GenerateHostPort(const nsCString &host, + static MOZ_MUST_USE nsresult GenerateHostPort(const nsCString& host, int32_t port, - nsACString &hostLine); + nsACString& hostLine); - SpdyInformation *SpdyInfo() { return &mSpdyInfo; } + SpdyInformation* SpdyInfo() { return &mSpdyInfo; } bool IsH2MandatorySuiteEnabled() { return mH2MandatorySuiteEnabled; } // returns true in between Init and Shutdown states bool Active() { return mHandlerActive; } - nsIRequestContextService *GetRequestContextService() { + nsIRequestContextService* GetRequestContextService() { return mRequestContextService.get(); } @@ -420,12 +420,12 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, // mLastActiveTabLoadOptimizationHit timestamp to now. void NotifyActiveTabLoadOptimization(); TimeStamp const GetLastActiveTabLoadOptimizationHit(); - void SetLastActiveTabLoadOptimizationHit(TimeStamp const &when); - bool IsBeforeLastActiveTabLoadOptimization(TimeStamp const &when); + void SetLastActiveTabLoadOptimizationHit(TimeStamp const& when); + bool IsBeforeLastActiveTabLoadOptimization(TimeStamp const& when); bool DumpHpackTables() { return mDumpHpackTables; } - HttpTrafficAnalyzer *GetHttpTrafficAnalyzer(); + HttpTrafficAnalyzer* GetHttpTrafficAnalyzer(); bool GetThroughCaptivePortal() { return mThroughCaptivePortal; } @@ -441,14 +441,14 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, // void BuildUserAgent(); void InitUserAgentComponents(); - void PrefsChanged(const char *pref); + void PrefsChanged(const char* pref); MOZ_MUST_USE nsresult SetAcceptLanguages(); - MOZ_MUST_USE nsresult SetAcceptEncodings(const char *, bool mIsSecure); + MOZ_MUST_USE nsresult SetAcceptEncodings(const char*, bool mIsSecure); MOZ_MUST_USE nsresult InitConnectionMgr(); - void NotifyObservers(nsIHttpChannel *chan, const char *event); + void NotifyObservers(nsIHttpChannel* chan, const char* event); void SetFastOpenOSSupport(); @@ -688,8 +688,8 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, public: // Socket thread only - MOZ_MUST_USE nsresult SubmitPacedRequest(ATokenBucketEvent *event, - nsICancelable **cancel) { + MOZ_MUST_USE nsresult SubmitPacedRequest(ATokenBucketEvent* event, + nsICancelable** cancel) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); if (!mRequestTokenBucket) { return NS_ERROR_NOT_AVAILABLE; @@ -698,7 +698,7 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, } // Socket thread only - void SetRequestTokenBucket(EventTokenBucket *aTokenBucket) { + void SetRequestTokenBucket(EventTokenBucket* aTokenBucket) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); mRequestTokenBucket = aTokenBucket; } @@ -713,12 +713,12 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, private: RefPtr mWifiTickler; - void TickleWifi(nsIInterfaceRequestor *cb); + void TickleWifi(nsIInterfaceRequestor* cb); private: MOZ_MUST_USE nsresult - SpeculativeConnectInternal(nsIURI *aURI, nsIPrincipal *aPrincipal, - nsIInterfaceRequestor *aCallbacks, bool anonymous); + SpeculativeConnectInternal(nsIURI* aURI, nsIPrincipal* aPrincipal, + nsIInterfaceRequestor* aCallbacks, bool anonymous); // State for generating channelIds uint32_t mProcessId; @@ -737,10 +737,10 @@ class nsHttpHandler final : public nsIHttpProtocolHandler, TimeStamp mLastActiveTabLoadOptimizationHit; public: - MOZ_MUST_USE nsresult NewChannelId(uint64_t &channelId); + MOZ_MUST_USE nsresult NewChannelId(uint64_t& channelId); - void BlacklistSpdy(const nsHttpConnectionInfo *ci); - MOZ_MUST_USE bool IsSpdyBlacklisted(const nsHttpConnectionInfo *ci); + void BlacklistSpdy(const nsHttpConnectionInfo* ci); + MOZ_MUST_USE bool IsSpdyBlacklisted(const nsHttpConnectionInfo* ci); virtual nsresult EnsureHSTSDataReadyNative( already_AddRefed aCallback) @@ -794,7 +794,7 @@ class HSTSDataCallbackWrapper final { public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(HSTSDataCallbackWrapper) - explicit HSTSDataCallbackWrapper(std::function &&aCallback) + explicit HSTSDataCallbackWrapper(std::function&& aCallback) : mCallback(std::move(aCallback)) { MOZ_ASSERT(NS_IsMainThread()); } diff --git a/netwerk/protocol/http/nsHttpHeaderArray.cpp b/netwerk/protocol/http/nsHttpHeaderArray.cpp index 90a5552817d74..86842135f05fd 100644 --- a/netwerk/protocol/http/nsHttpHeaderArray.cpp +++ b/netwerk/protocol/http/nsHttpHeaderArray.cpp @@ -20,7 +20,7 @@ namespace net { //----------------------------------------------------------------------------- nsresult nsHttpHeaderArray::SetHeader( - const nsACString &headerName, const nsACString &value, bool merge, + const nsACString& headerName, const nsACString& value, bool merge, nsHttpHeaderArray::HeaderVariety variety) { nsHttpAtom header = nsHttp::ResolveAtom(PromiseFlatCString(headerName).get()); if (!header) { @@ -31,20 +31,20 @@ nsresult nsHttpHeaderArray::SetHeader( } nsresult nsHttpHeaderArray::SetHeader( - nsHttpAtom header, const nsACString &value, bool merge, + nsHttpAtom header, const nsACString& value, bool merge, nsHttpHeaderArray::HeaderVariety variety) { return SetHeader(header, EmptyCString(), value, merge, variety); } nsresult nsHttpHeaderArray::SetHeader( - nsHttpAtom header, const nsACString &headerName, const nsACString &value, + nsHttpAtom header, const nsACString& headerName, const nsACString& value, bool merge, nsHttpHeaderArray::HeaderVariety variety) { MOZ_ASSERT( (variety == eVarietyResponse) || (variety == eVarietyRequestDefault) || (variety == eVarietyRequestOverride), "Net original headers can only be set using SetHeader_internal()."); - nsEntry *entry = nullptr; + nsEntry* entry = nullptr; int32_t index; index = LookupEntry(header, &entry); @@ -84,9 +84,9 @@ nsresult nsHttpHeaderArray::SetHeader( } nsresult nsHttpHeaderArray::SetHeader_internal( - nsHttpAtom header, const nsACString &headerName, const nsACString &value, + nsHttpAtom header, const nsACString& headerName, const nsACString& value, nsHttpHeaderArray::HeaderVariety variety) { - nsEntry *entry = mHeaders.AppendElement(); + nsEntry* entry = mHeaders.AppendElement(); if (!entry) { return NS_ERROR_OUT_OF_MEMORY; } @@ -101,7 +101,7 @@ nsresult nsHttpHeaderArray::SetHeader_internal( return NS_OK; } -nsresult nsHttpHeaderArray::SetEmptyHeader(const nsACString &headerName, +nsresult nsHttpHeaderArray::SetEmptyHeader(const nsACString& headerName, HeaderVariety variety) { nsHttpAtom header = nsHttp::ResolveAtom(PromiseFlatCString(headerName).get()); if (!header) { @@ -113,7 +113,7 @@ nsresult nsHttpHeaderArray::SetEmptyHeader(const nsACString &headerName, (variety == eVarietyRequestDefault) || (variety == eVarietyRequestOverride), "Original headers can only be set using SetHeader_internal()."); - nsEntry *entry = nullptr; + nsEntry* entry = nullptr; LookupEntry(header, &entry); @@ -129,11 +129,11 @@ nsresult nsHttpHeaderArray::SetEmptyHeader(const nsACString &headerName, } nsresult nsHttpHeaderArray::SetHeaderFromNet( - nsHttpAtom header, const nsACString &headerNameOriginal, - const nsACString &value, bool response) { + nsHttpAtom header, const nsACString& headerNameOriginal, + const nsACString& value, bool response) { // mHeader holds the consolidated (merged or updated) headers. // mHeader for response header will keep the original heades as well. - nsEntry *entry = nullptr; + nsEntry* entry = nullptr; LookupEntry(header, &entry); @@ -179,8 +179,8 @@ nsresult nsHttpHeaderArray::SetHeaderFromNet( } nsresult nsHttpHeaderArray::SetResponseHeaderFromCache( - nsHttpAtom header, const nsACString &headerNameOriginal, - const nsACString &value, nsHttpHeaderArray::HeaderVariety variety) { + nsHttpAtom header, const nsACString& headerNameOriginal, + const nsACString& value, nsHttpHeaderArray::HeaderVariety variety) { MOZ_ASSERT( (variety == eVarietyResponse) || (variety == eVarietyResponseNetOriginal), "Headers from cache can only be eVarietyResponse and " @@ -194,7 +194,7 @@ nsresult nsHttpHeaderArray::SetResponseHeaderFromCache( do { index = mHeaders.IndexOf(header, index, nsEntry::MatchHeader()); if (index != mHeaders.NoIndex) { - nsEntry &entry = mHeaders[index]; + nsEntry& entry = mHeaders[index]; if (value.Equals(entry.value)) { MOZ_ASSERT( (entry.variety == eVarietyResponseNetOriginal) || @@ -213,7 +213,7 @@ nsresult nsHttpHeaderArray::SetResponseHeaderFromCache( } void nsHttpHeaderArray::ClearHeader(nsHttpAtom header) { - nsEntry *entry = nullptr; + nsEntry* entry = nullptr; int32_t index = LookupEntry(header, &entry); if (entry) { if (entry->variety == eVarietyResponseNetOriginalAndResponse) { @@ -224,15 +224,15 @@ void nsHttpHeaderArray::ClearHeader(nsHttpAtom header) { } } -const char *nsHttpHeaderArray::PeekHeader(nsHttpAtom header) const { - const nsEntry *entry = nullptr; +const char* nsHttpHeaderArray::PeekHeader(nsHttpAtom header) const { + const nsEntry* entry = nullptr; LookupEntry(header, &entry); return entry ? entry->value.get() : nullptr; } nsresult nsHttpHeaderArray::GetHeader(nsHttpAtom header, - nsACString &result) const { - const nsEntry *entry = nullptr; + nsACString& result) const { + const nsEntry* entry = nullptr; LookupEntry(header, &entry); if (!entry) return NS_ERROR_NOT_AVAILABLE; result = entry->value; @@ -240,14 +240,14 @@ nsresult nsHttpHeaderArray::GetHeader(nsHttpAtom header, } nsresult nsHttpHeaderArray::GetOriginalHeader(nsHttpAtom aHeader, - nsIHttpHeaderVisitor *aVisitor) { + nsIHttpHeaderVisitor* aVisitor) { NS_ENSURE_ARG_POINTER(aVisitor); uint32_t index = 0; nsresult rv = NS_ERROR_NOT_AVAILABLE; while (true) { index = mHeaders.IndexOf(aHeader, index, nsEntry::MatchHeader()); if (index != UINT32_MAX) { - const nsEntry &entry = mHeaders[index]; + const nsEntry& entry = mHeaders[index]; MOZ_ASSERT((entry.variety == eVarietyResponseNetOriginalAndResponse) || (entry.variety == eVarietyResponseNetOriginal) || @@ -279,19 +279,19 @@ nsresult nsHttpHeaderArray::GetOriginalHeader(nsHttpAtom aHeader, } bool nsHttpHeaderArray::HasHeader(nsHttpAtom header) const { - const nsEntry *entry = nullptr; + const nsEntry* entry = nullptr; LookupEntry(header, &entry); return entry; } nsresult nsHttpHeaderArray::VisitHeaders( - nsIHttpHeaderVisitor *visitor, nsHttpHeaderArray::VisitorFilter filter) { + nsIHttpHeaderVisitor* visitor, nsHttpHeaderArray::VisitorFilter filter) { NS_ENSURE_ARG_POINTER(visitor); nsresult rv; uint32_t i, count = mHeaders.Length(); for (i = 0; i < count; ++i) { - const nsEntry &entry = mHeaders[i]; + const nsEntry& entry = mHeaders[i]; if (filter == eFilterSkipDefault && entry.variety == eVarietyRequestDefault) { continue; @@ -318,10 +318,10 @@ nsresult nsHttpHeaderArray::VisitHeaders( } /*static*/ -nsresult nsHttpHeaderArray::ParseHeaderLine(const nsACString &line, - nsHttpAtom *hdr, - nsACString *headerName, - nsACString *val) { +nsresult nsHttpHeaderArray::ParseHeaderLine(const nsACString& line, + nsHttpAtom* hdr, + nsACString* headerName, + nsACString* val) { // // BNF from section 4.2 of RFC 2616: // @@ -342,8 +342,8 @@ nsresult nsHttpHeaderArray::ParseHeaderLine(const nsACString &line, return NS_ERROR_FAILURE; } - const nsACString &sub = Substring(line, 0, split); - const nsACString &sub2 = + const nsACString& sub = Substring(line, 0, split); + const nsACString& sub2 = Substring(line, split + 1, line.Length() - split - 1); // make sure we have a valid token for the field-name @@ -360,11 +360,11 @@ nsresult nsHttpHeaderArray::ParseHeaderLine(const nsACString &line, } // skip over whitespace - char *p = + char* p = net_FindCharNotInSet(sub2.BeginReading(), sub2.EndReading(), HTTP_LWS); // trim trailing whitespace - bug 86608 - char *p2 = net_RFindCharNotInSet(p, sub2.EndReading(), HTTP_LWS); + char* p2 = net_RFindCharNotInSet(p, sub2.EndReading(), HTTP_LWS); // assign return values if (hdr) *hdr = atom; @@ -374,11 +374,11 @@ nsresult nsHttpHeaderArray::ParseHeaderLine(const nsACString &line, return NS_OK; } -void nsHttpHeaderArray::Flatten(nsACString &buf, bool pruneProxyHeaders, +void nsHttpHeaderArray::Flatten(nsACString& buf, bool pruneProxyHeaders, bool pruneTransients) { uint32_t i, count = mHeaders.Length(); for (i = 0; i < count; ++i) { - const nsEntry &entry = mHeaders[i]; + const nsEntry& entry = mHeaders[i]; // Skip original header. if (entry.variety == eVarietyResponseNetOriginal) { continue; @@ -414,10 +414,10 @@ void nsHttpHeaderArray::Flatten(nsACString &buf, bool pruneProxyHeaders, } } -void nsHttpHeaderArray::FlattenOriginalHeader(nsACString &buf) { +void nsHttpHeaderArray::FlattenOriginalHeader(nsACString& buf) { uint32_t i, count = mHeaders.Length(); for (i = 0; i < count; ++i) { - const nsEntry &entry = mHeaders[i]; + const nsEntry& entry = mHeaders[i]; // Skip changed header. if (entry.variety == eVarietyResponse) { continue; @@ -435,9 +435,9 @@ void nsHttpHeaderArray::FlattenOriginalHeader(nsACString &buf) { } } -const char *nsHttpHeaderArray::PeekHeaderAt( - uint32_t index, nsHttpAtom &header, nsACString &headerNameOriginal) const { - const nsEntry &entry = mHeaders[index]; +const char* nsHttpHeaderArray::PeekHeaderAt( + uint32_t index, nsHttpAtom& header, nsACString& headerNameOriginal) const { + const nsEntry& entry = mHeaders[index]; header = entry.header; headerNameOriginal = entry.headerNameOriginal; diff --git a/netwerk/protocol/http/nsHttpHeaderArray.h b/netwerk/protocol/http/nsHttpHeaderArray.h index 0455e7639d92f..12a310a89cf2d 100644 --- a/netwerk/protocol/http/nsHttpHeaderArray.h +++ b/netwerk/protocol/http/nsHttpHeaderArray.h @@ -25,7 +25,7 @@ namespace net { class nsHttpHeaderArray { public: - const char *PeekHeader(nsHttpAtom header) const; + const char* PeekHeader(nsHttpAtom header) const; // For nsHttpResponseHead nsHttpHeaderArray will keep track of the original // headers as they come from the network and the parse headers used in @@ -49,44 +49,44 @@ class nsHttpHeaderArray { }; // Used by internal setters: to set header from network use SetHeaderFromNet - MOZ_MUST_USE nsresult SetHeader(const nsACString &headerName, - const nsACString &value, bool merge, + MOZ_MUST_USE nsresult SetHeader(const nsACString& headerName, + const nsACString& value, bool merge, HeaderVariety variety); - MOZ_MUST_USE nsresult SetHeader(nsHttpAtom header, const nsACString &value, + MOZ_MUST_USE nsresult SetHeader(nsHttpAtom header, const nsACString& value, bool merge, HeaderVariety variety); MOZ_MUST_USE nsresult SetHeader(nsHttpAtom header, - const nsACString &headerName, - const nsACString &value, bool merge, + const nsACString& headerName, + const nsACString& value, bool merge, HeaderVariety variety); // Used by internal setters to set an empty header - MOZ_MUST_USE nsresult SetEmptyHeader(const nsACString &headerName, + MOZ_MUST_USE nsresult SetEmptyHeader(const nsACString& headerName, HeaderVariety variety); // Merges supported headers. For other duplicate values, determines if error // needs to be thrown or 1st value kept. // For the response header we keep the original headers as well. MOZ_MUST_USE nsresult SetHeaderFromNet(nsHttpAtom header, - const nsACString &headerNameOriginal, - const nsACString &value, + const nsACString& headerNameOriginal, + const nsACString& value, bool response); MOZ_MUST_USE nsresult SetResponseHeaderFromCache( - nsHttpAtom header, const nsACString &headerNameOriginal, - const nsACString &value, HeaderVariety variety); + nsHttpAtom header, const nsACString& headerNameOriginal, + const nsACString& value, HeaderVariety variety); - MOZ_MUST_USE nsresult GetHeader(nsHttpAtom header, nsACString &value) const; + MOZ_MUST_USE nsresult GetHeader(nsHttpAtom header, nsACString& value) const; MOZ_MUST_USE nsresult GetOriginalHeader(nsHttpAtom aHeader, - nsIHttpHeaderVisitor *aVisitor); + nsIHttpHeaderVisitor* aVisitor); void ClearHeader(nsHttpAtom h); // Find the location of the given header value, or null if none exists. - const char *FindHeaderValue(nsHttpAtom header, const char *value) const { + const char* FindHeaderValue(nsHttpAtom header, const char* value) const { return nsHttp::FindToken(PeekHeader(header), value, HTTP_HEADER_VALUE_SEPS); } // Determine if the given header value exists. - bool HasHeaderValue(nsHttpAtom header, const char *value) const { + bool HasHeaderValue(nsHttpAtom header, const char* value) const { return FindHeaderValue(header, value) != nullptr; } @@ -99,22 +99,22 @@ class nsHttpHeaderArray { eFilterResponseOriginal }; - MOZ_MUST_USE nsresult VisitHeaders(nsIHttpHeaderVisitor *visitor, + MOZ_MUST_USE nsresult VisitHeaders(nsIHttpHeaderVisitor* visitor, VisitorFilter filter = eFilterAll); // parse a header line, return the header atom and a pointer to the // header value (the substring of the header line -- do not free). static MOZ_MUST_USE nsresult ParseHeaderLine( - const nsACString &line, nsHttpAtom *header = nullptr, - nsACString *headerNameOriginal = nullptr, nsACString *value = nullptr); + const nsACString& line, nsHttpAtom* header = nullptr, + nsACString* headerNameOriginal = nullptr, nsACString* value = nullptr); - void Flatten(nsACString &, bool pruneProxyHeaders, bool pruneTransients); - void FlattenOriginalHeader(nsACString &); + void Flatten(nsACString&, bool pruneProxyHeaders, bool pruneTransients); + void FlattenOriginalHeader(nsACString&); uint32_t Count() const { return mHeaders.Length(); } - const char *PeekHeaderAt(uint32_t i, nsHttpAtom &header, - nsACString &headerNameOriginal) const; + const char* PeekHeaderAt(uint32_t i, nsHttpAtom& header, + nsACString& headerNameOriginal) const; void Clear(); @@ -126,31 +126,31 @@ class nsHttpHeaderArray { HeaderVariety variety = eVarietyUnknown; struct MatchHeader { - bool Equals(const nsEntry &aEntry, const nsHttpAtom &aHeader) const { + bool Equals(const nsEntry& aEntry, const nsHttpAtom& aHeader) const { return aEntry.header == aHeader; } }; - bool operator==(const nsEntry &aOther) const { + bool operator==(const nsEntry& aOther) const { return header == aOther.header && value == aOther.value; } }; - bool operator==(const nsHttpHeaderArray &aOther) const { + bool operator==(const nsHttpHeaderArray& aOther) const { return mHeaders == aOther.mHeaders; } private: // LookupEntry function will never return eVarietyResponseNetOriginal. // It will ignore original headers from the network. - int32_t LookupEntry(nsHttpAtom header, const nsEntry **) const; - int32_t LookupEntry(nsHttpAtom header, nsEntry **); - MOZ_MUST_USE nsresult MergeHeader(nsHttpAtom header, nsEntry *entry, - const nsACString &value, + int32_t LookupEntry(nsHttpAtom header, const nsEntry**) const; + int32_t LookupEntry(nsHttpAtom header, nsEntry**); + MOZ_MUST_USE nsresult MergeHeader(nsHttpAtom header, nsEntry* entry, + const nsACString& value, HeaderVariety variety); MOZ_MUST_USE nsresult SetHeader_internal(nsHttpAtom header, - const nsACString &headeName, - const nsACString &value, + const nsACString& headeName, + const nsACString& value, HeaderVariety variety); // Header cannot be merged: only one value possible @@ -175,7 +175,7 @@ class nsHttpHeaderArray { //----------------------------------------------------------------------------- inline int32_t nsHttpHeaderArray::LookupEntry(nsHttpAtom header, - const nsEntry **entry) const { + const nsEntry** entry) const { uint32_t index = 0; while (index != UINT32_MAX) { index = mHeaders.IndexOf(header, index, nsEntry::MatchHeader()); @@ -192,7 +192,7 @@ inline int32_t nsHttpHeaderArray::LookupEntry(nsHttpAtom header, } inline int32_t nsHttpHeaderArray::LookupEntry(nsHttpAtom header, - nsEntry **entry) { + nsEntry** entry) { uint32_t index = 0; while (index != UINT32_MAX) { index = mHeaders.IndexOf(header, index, nsEntry::MatchHeader()); @@ -234,7 +234,7 @@ inline bool nsHttpHeaderArray::IsIgnoreMultipleHeader(nsHttpAtom header) { } inline MOZ_MUST_USE nsresult nsHttpHeaderArray::MergeHeader( - nsHttpAtom header, nsEntry *entry, const nsACString &value, + nsHttpAtom header, nsEntry* entry, const nsACString& value, nsHttpHeaderArray::HeaderVariety variety) { if (value.IsEmpty()) return NS_OK; // merge of empty header = no-op diff --git a/netwerk/protocol/http/nsHttpNTLMAuth.cpp b/netwerk/protocol/http/nsHttpNTLMAuth.cpp index 72dcf13948af6..8496d8da24dac 100644 --- a/netwerk/protocol/http/nsHttpNTLMAuth.cpp +++ b/netwerk/protocol/http/nsHttpNTLMAuth.cpp @@ -49,7 +49,7 @@ static const char kSSOinPBmode[] = "network.auth.private-browsing-sso"; StaticRefPtr nsHttpNTLMAuth::gSingleton; -static bool IsNonFqdn(nsIURI *uri) { +static bool IsNonFqdn(nsIURI* uri) { nsAutoCString host; PRNetAddr addr; @@ -73,7 +73,7 @@ static bool ForceGenericNTLM() { } // Check to see if we should use default credentials for this host or proxy. -static bool CanUseDefaultCredentials(nsIHttpAuthenticableChannel *channel, +static bool CanUseDefaultCredentials(nsIHttpAuthenticableChannel* channel, bool isProxyAuth) { nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); if (!prefs) { @@ -153,11 +153,11 @@ already_AddRefed nsHttpNTLMAuth::GetOrCreate() { NS_IMPL_ISUPPORTS(nsHttpNTLMAuth, nsIHttpAuthenticator) NS_IMETHODIMP -nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel *channel, - const char *challenge, bool isProxyAuth, - nsISupports **sessionState, - nsISupports **continuationState, - bool *identityInvalid) { +nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel* channel, + const char* challenge, bool isProxyAuth, + nsISupports** sessionState, + nsISupports** continuationState, + bool* identityInvalid) { LOG(("nsHttpNTLMAuth::ChallengeReceived [ss=%p cs=%p]\n", *sessionState, *continuationState)); @@ -248,22 +248,22 @@ nsHttpNTLMAuth::ChallengeReceived(nsIHttpAuthenticableChannel *channel, NS_IMETHODIMP nsHttpNTLMAuth::GenerateCredentialsAsync( - nsIHttpAuthenticableChannel *authChannel, - nsIHttpAuthenticatorCallback *aCallback, const char *challenge, - bool isProxyAuth, const char16_t *domain, const char16_t *username, - const char16_t *password, nsISupports *sessionState, - nsISupports *continuationState, nsICancelable **aCancellable) { + nsIHttpAuthenticableChannel* authChannel, + nsIHttpAuthenticatorCallback* aCallback, const char* challenge, + bool isProxyAuth, const char16_t* domain, const char16_t* username, + const char16_t* password, nsISupports* sessionState, + nsISupports* continuationState, nsICancelable** aCancellable) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsHttpNTLMAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, - const char *challenge, bool isProxyAuth, - const char16_t *domain, - const char16_t *user, const char16_t *pass, - nsISupports **sessionState, - nsISupports **continuationState, - uint32_t *aFlags, char **creds) +nsHttpNTLMAuth::GenerateCredentials(nsIHttpAuthenticableChannel* authChannel, + const char* challenge, bool isProxyAuth, + const char16_t* domain, + const char16_t* user, const char16_t* pass, + nsISupports** sessionState, + nsISupports** continuationState, + uint32_t* aFlags, char** creds) { LOG(("nsHttpNTLMAuth::GenerateCredentials\n")); @@ -332,7 +332,7 @@ nsHttpNTLMAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, if (NS_FAILED(rv)) return rv; uint32_t length; - uint8_t *certArray; + uint8_t* certArray; rv = cert->GetRawDER(&length, &certArray); if (NS_FAILED(rv)) return rv; @@ -361,7 +361,7 @@ nsHttpNTLMAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, while (challenge[len - 1] == '=') len--; // decode into the input secbuffer - rv = Base64Decode(challenge, len, (char **)&inBuf, &inBufLen); + rv = Base64Decode(challenge, len, (char**)&inBuf, &inBufLen); if (NS_FAILED(rv)) { return rv; } @@ -377,9 +377,9 @@ nsHttpNTLMAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, if (!credsLen.isValid()) { rv = NS_ERROR_FAILURE; } else { - *creds = (char *)moz_xmalloc(credsLen.value()); + *creds = (char*)moz_xmalloc(credsLen.value()); memcpy(*creds, "NTLM ", 5); - PL_Base64Encode((char *)outBuf, outBufLen, *creds + 5); + PL_Base64Encode((char*)outBuf, outBufLen, *creds + 5); (*creds)[credsLen.value() - 1] = '\0'; // null terminate } @@ -393,7 +393,7 @@ nsHttpNTLMAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel, } NS_IMETHODIMP -nsHttpNTLMAuth::GetAuthFlags(uint32_t *flags) { +nsHttpNTLMAuth::GetAuthFlags(uint32_t* flags) { *flags = CONNECTION_BASED | IDENTITY_INCLUDES_DOMAIN | IDENTITY_ENCRYPTED; return NS_OK; } diff --git a/netwerk/protocol/http/nsHttpRequestHead.cpp b/netwerk/protocol/http/nsHttpRequestHead.cpp index 948f5b16f9794..c5001ec05b4ee 100644 --- a/netwerk/protocol/http/nsHttpRequestHead.cpp +++ b/netwerk/protocol/http/nsHttpRequestHead.cpp @@ -30,13 +30,13 @@ nsHttpRequestHead::~nsHttpRequestHead() { MOZ_COUNT_DTOR(nsHttpRequestHead); } // Don't use this function. It is only used by HttpChannelParent to avoid // copying of request headers!!! -const nsHttpHeaderArray &nsHttpRequestHead::Headers() const { - nsHttpRequestHead &curr = const_cast(*this); +const nsHttpHeaderArray& nsHttpRequestHead::Headers() const { + nsHttpRequestHead& curr = const_cast(*this); curr.mRecursiveMutex.AssertCurrentThreadIn(); return mHeaders; } -void nsHttpRequestHead::SetHeaders(const nsHttpHeaderArray &aHeaders) { +void nsHttpRequestHead::SetHeaders(const nsHttpHeaderArray& aHeaders) { RecursiveMutexAutoLock mon(mRecursiveMutex); mHeaders = aHeaders; } @@ -46,12 +46,12 @@ void nsHttpRequestHead::SetVersion(HttpVersion version) { mVersion = version; } -void nsHttpRequestHead::SetRequestURI(const nsACString &s) { +void nsHttpRequestHead::SetRequestURI(const nsACString& s) { RecursiveMutexAutoLock mon(mRecursiveMutex); mRequestURI = s; } -void nsHttpRequestHead::SetPath(const nsACString &s) { +void nsHttpRequestHead::SetPath(const nsACString& s) { RecursiveMutexAutoLock mon(mRecursiveMutex); mPath = s; } @@ -62,7 +62,7 @@ uint32_t nsHttpRequestHead::HeaderCount() { } nsresult nsHttpRequestHead::VisitHeaders( - nsIHttpHeaderVisitor *visitor, + nsIHttpHeaderVisitor* visitor, nsHttpHeaderArray::VisitorFilter filter /* = nsHttpHeaderArray::eFilterAll*/) { RecursiveMutexAutoLock mon(mRecursiveMutex); @@ -72,7 +72,7 @@ nsresult nsHttpRequestHead::VisitHeaders( return rv; } -void nsHttpRequestHead::Method(nsACString &aMethod) { +void nsHttpRequestHead::Method(nsACString& aMethod) { RecursiveMutexAutoLock mon(mRecursiveMutex); aMethod = mMethod; } @@ -82,12 +82,12 @@ HttpVersion nsHttpRequestHead::Version() { return mVersion; } -void nsHttpRequestHead::RequestURI(nsACString &aRequestURI) { +void nsHttpRequestHead::RequestURI(nsACString& aRequestURI) { RecursiveMutexAutoLock mon(mRecursiveMutex); aRequestURI = mRequestURI; } -void nsHttpRequestHead::Path(nsACString &aPath) { +void nsHttpRequestHead::Path(nsACString& aPath) { RecursiveMutexAutoLock mon(mRecursiveMutex); aPath = mPath.IsEmpty() ? mRequestURI : mPath; } @@ -97,12 +97,12 @@ void nsHttpRequestHead::SetHTTPS(bool val) { mHTTPS = val; } -void nsHttpRequestHead::Origin(nsACString &aOrigin) { +void nsHttpRequestHead::Origin(nsACString& aOrigin) { RecursiveMutexAutoLock mon(mRecursiveMutex); aOrigin = mOrigin; } -nsresult nsHttpRequestHead::SetHeader(const nsACString &h, const nsACString &v, +nsresult nsHttpRequestHead::SetHeader(const nsACString& h, const nsACString& v, bool m /*= false*/) { RecursiveMutexAutoLock mon(mRecursiveMutex); @@ -114,7 +114,7 @@ nsresult nsHttpRequestHead::SetHeader(const nsACString &h, const nsACString &v, nsHttpHeaderArray::eVarietyRequestOverride); } -nsresult nsHttpRequestHead::SetHeader(nsHttpAtom h, const nsACString &v, +nsresult nsHttpRequestHead::SetHeader(nsHttpAtom h, const nsACString& v, bool m /*= false*/) { RecursiveMutexAutoLock mon(mRecursiveMutex); @@ -127,7 +127,7 @@ nsresult nsHttpRequestHead::SetHeader(nsHttpAtom h, const nsACString &v, } nsresult nsHttpRequestHead::SetHeader( - nsHttpAtom h, const nsACString &v, bool m, + nsHttpAtom h, const nsACString& v, bool m, nsHttpHeaderArray::HeaderVariety variety) { RecursiveMutexAutoLock mon(mRecursiveMutex); @@ -138,7 +138,7 @@ nsresult nsHttpRequestHead::SetHeader( return mHeaders.SetHeader(h, v, m, variety); } -nsresult nsHttpRequestHead::SetEmptyHeader(const nsACString &h) { +nsresult nsHttpRequestHead::SetEmptyHeader(const nsACString& h) { RecursiveMutexAutoLock mon(mRecursiveMutex); if (mInVisitHeaders) { @@ -148,7 +148,7 @@ nsresult nsHttpRequestHead::SetEmptyHeader(const nsACString &h) { return mHeaders.SetEmptyHeader(h, nsHttpHeaderArray::eVarietyRequestOverride); } -nsresult nsHttpRequestHead::GetHeader(nsHttpAtom h, nsACString &v) { +nsresult nsHttpRequestHead::GetHeader(nsHttpAtom h, nsACString& v) { v.Truncate(); RecursiveMutexAutoLock mon(mRecursiveMutex); return mHeaders.GetHeader(h, v); @@ -180,12 +180,12 @@ bool nsHttpRequestHead::HasHeader(nsHttpAtom h) { return mHeaders.HasHeader(h); } -bool nsHttpRequestHead::HasHeaderValue(nsHttpAtom h, const char *v) { +bool nsHttpRequestHead::HasHeaderValue(nsHttpAtom h, const char* v) { RecursiveMutexAutoLock mon(mRecursiveMutex); return mHeaders.HasHeaderValue(h, v); } -nsresult nsHttpRequestHead::SetHeaderOnce(nsHttpAtom h, const char *v, +nsresult nsHttpRequestHead::SetHeaderOnce(nsHttpAtom h, const char* v, bool merge /*= false */) { RecursiveMutexAutoLock mon(mRecursiveMutex); @@ -210,13 +210,13 @@ bool nsHttpRequestHead::EqualsMethod(ParsedMethodType aType) { return mParsedMethod == aType; } -void nsHttpRequestHead::ParseHeaderSet(const char *buffer) { +void nsHttpRequestHead::ParseHeaderSet(const char* buffer) { RecursiveMutexAutoLock mon(mRecursiveMutex); nsHttpAtom hdr; nsAutoCString headerNameOriginal; nsAutoCString val; while (buffer) { - const char *eof = strchr(buffer, '\r'); + const char* eof = strchr(buffer, '\r'); if (!eof) { break; } @@ -239,7 +239,7 @@ bool nsHttpRequestHead::IsHTTPS() { return mHTTPS; } -void nsHttpRequestHead::SetMethod(const nsACString &method) { +void nsHttpRequestHead::SetMethod(const nsACString& method) { RecursiveMutexAutoLock mon(mRecursiveMutex); mParsedMethod = kMethod_Custom; mMethod = method; @@ -260,8 +260,8 @@ void nsHttpRequestHead::SetMethod(const nsACString &method) { } } -void nsHttpRequestHead::SetOrigin(const nsACString &scheme, - const nsACString &host, int32_t port) { +void nsHttpRequestHead::SetOrigin(const nsACString& scheme, + const nsACString& host, int32_t port) { RecursiveMutexAutoLock mon(mRecursiveMutex); mOrigin.Assign(scheme); mOrigin.AppendLiteral("://"); @@ -289,7 +289,7 @@ bool nsHttpRequestHead::IsSafeMethod() { !strcmp(mMethod.get(), "REPORT") || !strcmp(mMethod.get(), "SEARCH")); } -void nsHttpRequestHead::Flatten(nsACString &buf, bool pruneProxyHeaders) { +void nsHttpRequestHead::Flatten(nsACString& buf, bool pruneProxyHeaders) { RecursiveMutexAutoLock mon(mRecursiveMutex); // note: the first append is intentional. diff --git a/netwerk/protocol/http/nsHttpRequestHead.h b/netwerk/protocol/http/nsHttpRequestHead.h index 639fe97fcdc16..788903178715a 100644 --- a/netwerk/protocol/http/nsHttpRequestHead.h +++ b/netwerk/protocol/http/nsHttpRequestHead.h @@ -29,54 +29,54 @@ class nsHttpRequestHead { // The following function is only used in HttpChannelParent to avoid // copying headers. If you use it be careful to do it only under // nsHttpRequestHead lock!!! - const nsHttpHeaderArray &Headers() const; + const nsHttpHeaderArray& Headers() const; void Enter() { mRecursiveMutex.Lock(); } void Exit() { mRecursiveMutex.Unlock(); } - void SetHeaders(const nsHttpHeaderArray &aHeaders); + void SetHeaders(const nsHttpHeaderArray& aHeaders); - void SetMethod(const nsACString &method); + void SetMethod(const nsACString& method); void SetVersion(HttpVersion version); - void SetRequestURI(const nsACString &s); - void SetPath(const nsACString &s); + void SetRequestURI(const nsACString& s); + void SetPath(const nsACString& s); uint32_t HeaderCount(); // Using this function it is possible to itereate through all headers // automatically under one lock. MOZ_MUST_USE nsresult VisitHeaders( - nsIHttpHeaderVisitor *visitor, + nsIHttpHeaderVisitor* visitor, nsHttpHeaderArray::VisitorFilter filter = nsHttpHeaderArray::eFilterAll); - void Method(nsACString &aMethod); + void Method(nsACString& aMethod); HttpVersion Version(); - void RequestURI(nsACString &RequestURI); - void Path(nsACString &aPath); + void RequestURI(nsACString& RequestURI); + void Path(nsACString& aPath); void SetHTTPS(bool val); bool IsHTTPS(); - void SetOrigin(const nsACString &scheme, const nsACString &host, + void SetOrigin(const nsACString& scheme, const nsACString& host, int32_t port); - void Origin(nsACString &aOrigin); + void Origin(nsACString& aOrigin); - MOZ_MUST_USE nsresult SetHeader(const nsACString &h, const nsACString &v, + MOZ_MUST_USE nsresult SetHeader(const nsACString& h, const nsACString& v, bool m = false); - MOZ_MUST_USE nsresult SetHeader(nsHttpAtom h, const nsACString &v, + MOZ_MUST_USE nsresult SetHeader(nsHttpAtom h, const nsACString& v, bool m = false); - MOZ_MUST_USE nsresult SetHeader(nsHttpAtom h, const nsACString &v, bool m, + MOZ_MUST_USE nsresult SetHeader(nsHttpAtom h, const nsACString& v, bool m, nsHttpHeaderArray::HeaderVariety variety); - MOZ_MUST_USE nsresult SetEmptyHeader(const nsACString &h); - MOZ_MUST_USE nsresult GetHeader(nsHttpAtom h, nsACString &v); + MOZ_MUST_USE nsresult SetEmptyHeader(const nsACString& h); + MOZ_MUST_USE nsresult GetHeader(nsHttpAtom h, nsACString& v); MOZ_MUST_USE nsresult ClearHeader(nsHttpAtom h); void ClearHeaders(); - bool HasHeaderValue(nsHttpAtom h, const char *v); + bool HasHeaderValue(nsHttpAtom h, const char* v); // This function returns true if header is set even if it is an empty // header. bool HasHeader(nsHttpAtom h); - void Flatten(nsACString &, bool pruneProxyHeaders = false); + void Flatten(nsACString&, bool pruneProxyHeaders = false); // Don't allow duplicate values - MOZ_MUST_USE nsresult SetHeaderOnce(nsHttpAtom h, const char *v, + MOZ_MUST_USE nsresult SetHeaderOnce(nsHttpAtom h, const char* v, bool merge = false); bool IsSafeMethod(); @@ -101,7 +101,7 @@ class nsHttpRequestHead { bool IsHead() { return EqualsMethod(kMethod_Head); } bool IsPut() { return EqualsMethod(kMethod_Put); } bool IsTrace() { return EqualsMethod(kMethod_Trace); } - void ParseHeaderSet(const char *buffer); + void ParseHeaderSet(const char* buffer); private: // All members must be copy-constructable and assignable diff --git a/netwerk/protocol/http/nsHttpResponseHead.cpp b/netwerk/protocol/http/nsHttpResponseHead.cpp index f85431f0e9b1f..c565b88aef858 100644 --- a/netwerk/protocol/http/nsHttpResponseHead.cpp +++ b/netwerk/protocol/http/nsHttpResponseHead.cpp @@ -23,10 +23,10 @@ namespace net { // nsHttpResponseHead //----------------------------------------------------------------------------- -nsHttpResponseHead::nsHttpResponseHead(const nsHttpResponseHead &aOther) +nsHttpResponseHead::nsHttpResponseHead(const nsHttpResponseHead& aOther) : mRecursiveMutex("nsHttpResponseHead.mRecursiveMutex"), mInVisitHeaders(false) { - nsHttpResponseHead &other = const_cast(aOther); + nsHttpResponseHead& other = const_cast(aOther); RecursiveMutexAutoLock monitor(other.mRecursiveMutex); mHeaders = other.mHeaders; @@ -43,9 +43,9 @@ nsHttpResponseHead::nsHttpResponseHead(const nsHttpResponseHead &aOther) mPragmaNoCache = other.mPragmaNoCache; } -nsHttpResponseHead &nsHttpResponseHead::operator=( - const nsHttpResponseHead &aOther) { - nsHttpResponseHead &other = const_cast(aOther); +nsHttpResponseHead& nsHttpResponseHead::operator=( + const nsHttpResponseHead& aOther) { + nsHttpResponseHead& other = const_cast(aOther); RecursiveMutexAutoLock monitorOther(other.mRecursiveMutex); RecursiveMutexAutoLock monitor(mRecursiveMutex); @@ -75,7 +75,7 @@ uint16_t nsHttpResponseHead::Status() { return mStatus; } -void nsHttpResponseHead::StatusText(nsACString &aStatusText) { +void nsHttpResponseHead::StatusText(nsACString& aStatusText) { RecursiveMutexAutoLock monitor(mRecursiveMutex); aStatusText = mStatusText; } @@ -85,12 +85,12 @@ int64_t nsHttpResponseHead::ContentLength() { return mContentLength; } -void nsHttpResponseHead::ContentType(nsACString &aContentType) { +void nsHttpResponseHead::ContentType(nsACString& aContentType) { RecursiveMutexAutoLock monitor(mRecursiveMutex); aContentType = mContentType; } -void nsHttpResponseHead::ContentCharset(nsACString &aContentCharset) { +void nsHttpResponseHead::ContentCharset(nsACString& aContentCharset) { RecursiveMutexAutoLock monitor(mRecursiveMutex); aContentCharset = mContentCharset; } @@ -115,8 +115,8 @@ bool nsHttpResponseHead::Immutable() { return mCacheControlImmutable; } -nsresult nsHttpResponseHead::SetHeader(const nsACString &hdr, - const nsACString &val, bool merge) { +nsresult nsHttpResponseHead::SetHeader(const nsACString& hdr, + const nsACString& val, bool merge) { RecursiveMutexAutoLock monitor(mRecursiveMutex); if (mInVisitHeaders) { @@ -132,7 +132,7 @@ nsresult nsHttpResponseHead::SetHeader(const nsACString &hdr, return SetHeader_locked(atom, hdr, val, merge); } -nsresult nsHttpResponseHead::SetHeader(nsHttpAtom hdr, const nsACString &val, +nsresult nsHttpResponseHead::SetHeader(nsHttpAtom hdr, const nsACString& val, bool merge) { RecursiveMutexAutoLock monitor(mRecursiveMutex); @@ -144,8 +144,8 @@ nsresult nsHttpResponseHead::SetHeader(nsHttpAtom hdr, const nsACString &val, } nsresult nsHttpResponseHead::SetHeader_locked(nsHttpAtom atom, - const nsACString &hdr, - const nsACString &val, + const nsACString& hdr, + const nsACString& val, bool merge) { nsresult rv = mHeaders.SetHeader(atom, hdr, val, merge, nsHttpHeaderArray::eVarietyResponse); @@ -161,7 +161,7 @@ nsresult nsHttpResponseHead::SetHeader_locked(nsHttpAtom atom, return NS_OK; } -nsresult nsHttpResponseHead::GetHeader(nsHttpAtom h, nsACString &v) { +nsresult nsHttpResponseHead::GetHeader(nsHttpAtom h, nsACString& v) { v.Truncate(); RecursiveMutexAutoLock monitor(mRecursiveMutex); return mHeaders.GetHeader(h, v); @@ -177,7 +177,7 @@ void nsHttpResponseHead::ClearHeaders() { mHeaders.Clear(); } -bool nsHttpResponseHead::HasHeaderValue(nsHttpAtom h, const char *v) { +bool nsHttpResponseHead::HasHeaderValue(nsHttpAtom h, const char* v) { RecursiveMutexAutoLock monitor(mRecursiveMutex); return mHeaders.HasHeaderValue(h, v); } @@ -187,12 +187,12 @@ bool nsHttpResponseHead::HasHeader(nsHttpAtom h) { return mHeaders.HasHeader(h); } -void nsHttpResponseHead::SetContentType(const nsACString &s) { +void nsHttpResponseHead::SetContentType(const nsACString& s) { RecursiveMutexAutoLock monitor(mRecursiveMutex); mContentType = s; } -void nsHttpResponseHead::SetContentCharset(const nsACString &s) { +void nsHttpResponseHead::SetContentCharset(const nsACString& s) { RecursiveMutexAutoLock monitor(mRecursiveMutex); mContentCharset = s; } @@ -211,7 +211,7 @@ void nsHttpResponseHead::SetContentLength(int64_t len) { } } -void nsHttpResponseHead::Flatten(nsACString &buf, bool pruneTransients) { +void nsHttpResponseHead::Flatten(nsACString& buf, bool pruneTransients) { RecursiveMutexAutoLock monitor(mRecursiveMutex); if (mVersion == HttpVersion::v0_9) return; @@ -230,7 +230,7 @@ void nsHttpResponseHead::Flatten(nsACString &buf, bool pruneTransients) { mHeaders.Flatten(buf, false, pruneTransients); } -void nsHttpResponseHead::FlattenNetworkOriginalHeaders(nsACString &buf) { +void nsHttpResponseHead::FlattenNetworkOriginalHeaders(nsACString& buf) { RecursiveMutexAutoLock monitor(mRecursiveMutex); if (mVersion == HttpVersion::v0_9) { return; @@ -239,14 +239,14 @@ void nsHttpResponseHead::FlattenNetworkOriginalHeaders(nsACString &buf) { mHeaders.FlattenOriginalHeader(buf); } -nsresult nsHttpResponseHead::ParseCachedHead(const char *block) { +nsresult nsHttpResponseHead::ParseCachedHead(const char* block) { RecursiveMutexAutoLock monitor(mRecursiveMutex); LOG(("nsHttpResponseHead::ParseCachedHead [this=%p]\n", this)); // this command works on a buffer as prepared by Flatten, as such it is // not very forgiving ;-) - char *p = PL_strstr(block, "\r\n"); + char* p = PL_strstr(block, "\r\n"); if (!p) return NS_ERROR_UNEXPECTED; ParseStatusLine_locked(nsDependentCSubstring(block, p - block)); @@ -267,7 +267,7 @@ nsresult nsHttpResponseHead::ParseCachedHead(const char *block) { return NS_OK; } -nsresult nsHttpResponseHead::ParseCachedOriginalHeaders(char *block) { +nsresult nsHttpResponseHead::ParseCachedOriginalHeaders(char* block) { RecursiveMutexAutoLock monitor(mRecursiveMutex); LOG(("nsHttpResponseHead::ParseCachedOriginalHeader [this=%p]\n", this)); @@ -278,7 +278,7 @@ nsresult nsHttpResponseHead::ParseCachedOriginalHeaders(char *block) { return NS_ERROR_UNEXPECTED; } - char *p = block; + char* p = block; nsHttpAtom hdr = {nullptr}; nsAutoCString headerNameOriginal; nsAutoCString val; @@ -465,19 +465,19 @@ void nsHttpResponseHead::AssignDefaultStatusText() { } } -void nsHttpResponseHead::ParseStatusLine(const nsACString &line) { +void nsHttpResponseHead::ParseStatusLine(const nsACString& line) { RecursiveMutexAutoLock monitor(mRecursiveMutex); ParseStatusLine_locked(line); } -void nsHttpResponseHead::ParseStatusLine_locked(const nsACString &line) { +void nsHttpResponseHead::ParseStatusLine_locked(const nsACString& line) { // // Parse Status-Line:: HTTP-Version SP Status-Code SP Reason-Phrase CRLF // - const char *start = line.BeginReading(); - const char *end = line.EndReading(); - const char *p = start; + const char* start = line.BeginReading(); + const char* end = line.EndReading(); + const char* p = start; // HTTP-Version ParseVersion(start); @@ -510,13 +510,13 @@ void nsHttpResponseHead::ParseStatusLine_locked(const nsACString &line) { unsigned(mVersion), unsigned(mStatus), mStatusText.get())); } -nsresult nsHttpResponseHead::ParseHeaderLine(const nsACString &line) { +nsresult nsHttpResponseHead::ParseHeaderLine(const nsACString& line) { RecursiveMutexAutoLock monitor(mRecursiveMutex); return ParseHeaderLine_locked(line, true); } nsresult nsHttpResponseHead::ParseHeaderLine_locked( - const nsACString &line, bool originalFromNetHeaders) { + const nsACString& line, bool originalFromNetHeaders) { nsHttpAtom hdr = {nullptr}; nsAutoCString headerNameOriginal; nsAutoCString val; @@ -541,7 +541,7 @@ nsresult nsHttpResponseHead::ParseHeaderLine_locked( // handle some special case headers... if (hdr == nsHttp::Content_Length) { int64_t len; - const char *ignored; + const char* ignored; // permit only a single value here. if (nsHttp::ParseInt64(val.get(), &ignored, &len)) { mContentLength = len; @@ -572,7 +572,7 @@ nsresult nsHttpResponseHead::ParseHeaderLine_locked( // nsresult nsHttpResponseHead::ComputeCurrentAge(uint32_t now, uint32_t requestTime, - uint32_t *result) { + uint32_t* result) { RecursiveMutexAutoLock monitor(mRecursiveMutex); uint32_t dateValue; uint32_t ageValue; @@ -619,7 +619,7 @@ nsresult nsHttpResponseHead::ComputeCurrentAge(uint32_t now, // // freshnessLifetime = 0 // -nsresult nsHttpResponseHead::ComputeFreshnessLifetime(uint32_t *result) { +nsresult nsHttpResponseHead::ComputeFreshnessLifetime(uint32_t* result) { RecursiveMutexAutoLock monitor(mRecursiveMutex); *result = 0; @@ -814,7 +814,7 @@ bool nsHttpResponseHead::ExpiresInPast_locked() const { NS_SUCCEEDED(GetDateValue_locked(&dateVal)) && expiresVal < dateVal; } -nsresult nsHttpResponseHead::UpdateHeaders(nsHttpResponseHead *aOther) { +nsresult nsHttpResponseHead::UpdateHeaders(nsHttpResponseHead* aOther) { LOG(("nsHttpResponseHead::UpdateHeaders [this=%p]\n", this)); RecursiveMutexAutoLock monitor(mRecursiveMutex); @@ -824,7 +824,7 @@ nsresult nsHttpResponseHead::UpdateHeaders(nsHttpResponseHead *aOther) { for (i = 0; i < count; ++i) { nsHttpAtom header; nsAutoCString headerNameOriginal; - const char *val = + const char* val = aOther->mHeaders.PeekHeaderAt(i, header, headerNameOriginal); if (!val) { @@ -882,8 +882,8 @@ void nsHttpResponseHead::Reset() { } nsresult nsHttpResponseHead::ParseDateHeader(nsHttpAtom header, - uint32_t *result) const { - const char *val = mHeaders.PeekHeader(header); + uint32_t* result) const { + const char* val = mHeaders.PeekHeader(header); if (!val) return NS_ERROR_NOT_AVAILABLE; PRTime time; @@ -894,13 +894,13 @@ nsresult nsHttpResponseHead::ParseDateHeader(nsHttpAtom header, return NS_OK; } -nsresult nsHttpResponseHead::GetAgeValue(uint32_t *result) { +nsresult nsHttpResponseHead::GetAgeValue(uint32_t* result) { RecursiveMutexAutoLock monitor(mRecursiveMutex); return GetAgeValue_locked(result); } -nsresult nsHttpResponseHead::GetAgeValue_locked(uint32_t *result) const { - const char *val = mHeaders.PeekHeader(nsHttp::Age); +nsresult nsHttpResponseHead::GetAgeValue_locked(uint32_t* result) const { + const char* val = mHeaders.PeekHeader(nsHttp::Age); if (!val) return NS_ERROR_NOT_AVAILABLE; *result = (uint32_t)atoi(val); @@ -909,16 +909,16 @@ nsresult nsHttpResponseHead::GetAgeValue_locked(uint32_t *result) const { // Return the value of the (HTTP 1.1) max-age directive, which itself is a // component of the Cache-Control response header -nsresult nsHttpResponseHead::GetMaxAgeValue(uint32_t *result) { +nsresult nsHttpResponseHead::GetMaxAgeValue(uint32_t* result) { RecursiveMutexAutoLock monitor(mRecursiveMutex); return GetMaxAgeValue_locked(result); } -nsresult nsHttpResponseHead::GetMaxAgeValue_locked(uint32_t *result) const { - const char *val = mHeaders.PeekHeader(nsHttp::Cache_Control); +nsresult nsHttpResponseHead::GetMaxAgeValue_locked(uint32_t* result) const { + const char* val = mHeaders.PeekHeader(nsHttp::Cache_Control); if (!val) return NS_ERROR_NOT_AVAILABLE; - const char *p = nsHttp::FindToken(val, "max-age", HTTP_HEADER_VALUE_SEPS "="); + const char* p = nsHttp::FindToken(val, "max-age", HTTP_HEADER_VALUE_SEPS "="); if (!p) return NS_ERROR_NOT_AVAILABLE; p += 7; while (*p == ' ' || *p == '\t') ++p; @@ -933,20 +933,20 @@ nsresult nsHttpResponseHead::GetMaxAgeValue_locked(uint32_t *result) const { } // Get the stale-while-revalidate directive value, if present -nsresult nsHttpResponseHead::GetStaleWhileRevalidateValue(uint32_t *result) { +nsresult nsHttpResponseHead::GetStaleWhileRevalidateValue(uint32_t* result) { RecursiveMutexAutoLock monitor(mRecursiveMutex); return GetStaleWhileRevalidateValue_locked(result); } nsresult nsHttpResponseHead::GetStaleWhileRevalidateValue_locked( - uint32_t *result) const { - const char *val = mHeaders.PeekHeader(nsHttp::Cache_Control); + uint32_t* result) const { + const char* val = mHeaders.PeekHeader(nsHttp::Cache_Control); if (!val) { return NS_ERROR_NOT_AVAILABLE; } // Rewrite (best all FindToken users) to mozilla::Tokenizer, bug 1542293. - const char *p = nsHttp::FindToken(val, "stale-while-revalidate", + const char* p = nsHttp::FindToken(val, "stale-while-revalidate", HTTP_HEADER_VALUE_SEPS "="); if (!p) { return NS_ERROR_NOT_AVAILABLE; @@ -971,18 +971,18 @@ nsresult nsHttpResponseHead::GetStaleWhileRevalidateValue_locked( return NS_OK; } -nsresult nsHttpResponseHead::GetDateValue(uint32_t *result) { +nsresult nsHttpResponseHead::GetDateValue(uint32_t* result) { RecursiveMutexAutoLock monitor(mRecursiveMutex); return GetDateValue_locked(result); } -nsresult nsHttpResponseHead::GetExpiresValue(uint32_t *result) { +nsresult nsHttpResponseHead::GetExpiresValue(uint32_t* result) { RecursiveMutexAutoLock monitor(mRecursiveMutex); return GetExpiresValue_locked(result); } -nsresult nsHttpResponseHead::GetExpiresValue_locked(uint32_t *result) const { - const char *val = mHeaders.PeekHeader(nsHttp::Expires); +nsresult nsHttpResponseHead::GetExpiresValue_locked(uint32_t* result) const { + const char* val = mHeaders.PeekHeader(nsHttp::Expires); if (!val) return NS_ERROR_NOT_AVAILABLE; PRTime time; @@ -1001,14 +1001,14 @@ nsresult nsHttpResponseHead::GetExpiresValue_locked(uint32_t *result) const { return NS_OK; } -nsresult nsHttpResponseHead::GetLastModifiedValue(uint32_t *result) { +nsresult nsHttpResponseHead::GetLastModifiedValue(uint32_t* result) { RecursiveMutexAutoLock monitor(mRecursiveMutex); return ParseDateHeader(nsHttp::Last_Modified, result); } -bool nsHttpResponseHead::operator==(const nsHttpResponseHead &aOther) const { - nsHttpResponseHead &curr = const_cast(*this); - nsHttpResponseHead &other = const_cast(aOther); +bool nsHttpResponseHead::operator==(const nsHttpResponseHead& aOther) const { + nsHttpResponseHead& curr = const_cast(*this); + nsHttpResponseHead& other = const_cast(aOther); RecursiveMutexAutoLock monitorOther(other.mRecursiveMutex); RecursiveMutexAutoLock monitor(curr.mRecursiveMutex); @@ -1026,11 +1026,11 @@ bool nsHttpResponseHead::operator==(const nsHttpResponseHead &aOther) const { int64_t nsHttpResponseHead::TotalEntitySize() { RecursiveMutexAutoLock monitor(mRecursiveMutex); - const char *contentRange = mHeaders.PeekHeader(nsHttp::Content_Range); + const char* contentRange = mHeaders.PeekHeader(nsHttp::Content_Range); if (!contentRange) return mContentLength; // Total length is after a slash - const char *slash = strrchr(contentRange, '/'); + const char* slash = strrchr(contentRange, '/'); if (!slash) return -1; // No idea what the length is slash++; @@ -1046,7 +1046,7 @@ int64_t nsHttpResponseHead::TotalEntitySize() { // nsHttpResponseHead //----------------------------------------------------------------------------- -void nsHttpResponseHead::ParseVersion(const char *str) { +void nsHttpResponseHead::ParseVersion(const char* str) { // Parse HTTP-Version:: "HTTP" "/" 1*DIGIT "." 1*DIGIT LOG(("nsHttpResponseHead::ParseVersion [version=%s]\n", str)); @@ -1073,7 +1073,7 @@ void nsHttpResponseHead::ParseVersion(const char *str) { return; } - char *p = PL_strchr(str, '.'); + char* p = PL_strchr(str, '.'); if (p == nullptr) { LOG(("mal-formed server version; assuming HTTP/1.0\n")); mVersion = HttpVersion::v1_0; @@ -1095,7 +1095,7 @@ void nsHttpResponseHead::ParseVersion(const char *str) { mVersion = HttpVersion::v1_0; } -void nsHttpResponseHead::ParseCacheControl(const char *val) { +void nsHttpResponseHead::ParseCacheControl(const char* val) { if (!(val && *val)) { // clear flags mCacheControlPrivate = false; @@ -1124,7 +1124,7 @@ void nsHttpResponseHead::ParseCacheControl(const char *val) { } } -void nsHttpResponseHead::ParsePragma(const char *val) { +void nsHttpResponseHead::ParsePragma(const char* val) { LOG(("nsHttpResponseHead::ParsePragma [val=%s]\n", val)); if (!(val && *val)) { @@ -1141,7 +1141,7 @@ void nsHttpResponseHead::ParsePragma(const char *val) { } nsresult nsHttpResponseHead::VisitHeaders( - nsIHttpHeaderVisitor *visitor, nsHttpHeaderArray::VisitorFilter filter) { + nsIHttpHeaderVisitor* visitor, nsHttpHeaderArray::VisitorFilter filter) { RecursiveMutexAutoLock monitor(mRecursiveMutex); mInVisitHeaders = true; nsresult rv = mHeaders.VisitHeaders(visitor, filter); @@ -1150,7 +1150,7 @@ nsresult nsHttpResponseHead::VisitHeaders( } nsresult nsHttpResponseHead::GetOriginalHeader(nsHttpAtom aHeader, - nsIHttpHeaderVisitor *aVisitor) { + nsIHttpHeaderVisitor* aVisitor) { RecursiveMutexAutoLock monitor(mRecursiveMutex); mInVisitHeaders = true; nsresult rv = mHeaders.GetOriginalHeader(aHeader, aVisitor); diff --git a/netwerk/protocol/http/nsHttpResponseHead.h b/netwerk/protocol/http/nsHttpResponseHead.h index cc221e0384251..450a822ee4fcb 100644 --- a/netwerk/protocol/http/nsHttpResponseHead.h +++ b/netwerk/protocol/http/nsHttpResponseHead.h @@ -50,18 +50,18 @@ class nsHttpResponseHead { mRecursiveMutex("nsHttpResponseHead.mRecursiveMutex"), mInVisitHeaders(false) {} - nsHttpResponseHead(const nsHttpResponseHead &aOther); - nsHttpResponseHead &operator=(const nsHttpResponseHead &aOther); + nsHttpResponseHead(const nsHttpResponseHead& aOther); + nsHttpResponseHead& operator=(const nsHttpResponseHead& aOther); void Enter() { mRecursiveMutex.Lock(); } void Exit() { mRecursiveMutex.Unlock(); } HttpVersion Version(); uint16_t Status(); - void StatusText(nsACString &aStatusText); + void StatusText(nsACString& aStatusText); int64_t ContentLength(); - void ContentType(nsACString &aContentType); - void ContentCharset(nsACString &aContentCharset); + void ContentType(nsACString& aContentType); + void ContentCharset(nsACString& aContentCharset); bool Private(); bool NoStore(); bool NoCache(); @@ -73,26 +73,26 @@ class nsHttpResponseHead { */ int64_t TotalEntitySize(); - MOZ_MUST_USE nsresult SetHeader(const nsACString &h, const nsACString &v, + MOZ_MUST_USE nsresult SetHeader(const nsACString& h, const nsACString& v, bool m = false); - MOZ_MUST_USE nsresult SetHeader(nsHttpAtom h, const nsACString &v, + MOZ_MUST_USE nsresult SetHeader(nsHttpAtom h, const nsACString& v, bool m = false); - MOZ_MUST_USE nsresult GetHeader(nsHttpAtom h, nsACString &v); + MOZ_MUST_USE nsresult GetHeader(nsHttpAtom h, nsACString& v); void ClearHeader(nsHttpAtom h); void ClearHeaders(); - bool HasHeaderValue(nsHttpAtom h, const char *v); + bool HasHeaderValue(nsHttpAtom h, const char* v); bool HasHeader(nsHttpAtom h); - void SetContentType(const nsACString &s); - void SetContentCharset(const nsACString &s); + void SetContentType(const nsACString& s); + void SetContentCharset(const nsACString& s); void SetContentLength(int64_t); // write out the response status line and headers as a single text block, // optionally pruning out transient headers (ie. headers that only make // sense the first time the response is handled). // Both functions append to the string supplied string. - void Flatten(nsACString &, bool pruneTransients); - void FlattenNetworkOriginalHeaders(nsACString &buf); + void Flatten(nsACString&, bool pruneTransients); + void FlattenNetworkOriginalHeaders(nsACString& buf); // The next 2 functions parse flattened response head and original net // headers. They are used when we are reading an entry from the cache. @@ -101,19 +101,19 @@ class nsHttpResponseHead { // ParseCachedOriginalHeaders FIRST and then ParseCachedHead. // // block must be null terminated. - MOZ_MUST_USE nsresult ParseCachedHead(const char *block); - MOZ_MUST_USE nsresult ParseCachedOriginalHeaders(char *block); + MOZ_MUST_USE nsresult ParseCachedHead(const char* block); + MOZ_MUST_USE nsresult ParseCachedOriginalHeaders(char* block); // parse the status line. - void ParseStatusLine(const nsACString &line); + void ParseStatusLine(const nsACString& line); // parse a header line. - MOZ_MUST_USE nsresult ParseHeaderLine(const nsACString &line); + MOZ_MUST_USE nsresult ParseHeaderLine(const nsACString& line); // cache validation support methods - MOZ_MUST_USE nsresult ComputeFreshnessLifetime(uint32_t *); + MOZ_MUST_USE nsresult ComputeFreshnessLifetime(uint32_t*); MOZ_MUST_USE nsresult ComputeCurrentAge(uint32_t now, uint32_t requestTime, - uint32_t *result); + uint32_t* result); bool MustValidate(); bool MustValidateIfExpired(); @@ -130,58 +130,58 @@ class nsHttpResponseHead { bool ExpiresInPast(); // update headers... - MOZ_MUST_USE nsresult UpdateHeaders(nsHttpResponseHead *headers); + MOZ_MUST_USE nsresult UpdateHeaders(nsHttpResponseHead* headers); // reset the response head to it's initial state void Reset(); - MOZ_MUST_USE nsresult GetAgeValue(uint32_t *result); - MOZ_MUST_USE nsresult GetMaxAgeValue(uint32_t *result); - MOZ_MUST_USE nsresult GetStaleWhileRevalidateValue(uint32_t *result); - MOZ_MUST_USE nsresult GetDateValue(uint32_t *result); - MOZ_MUST_USE nsresult GetExpiresValue(uint32_t *result); - MOZ_MUST_USE nsresult GetLastModifiedValue(uint32_t *result); + MOZ_MUST_USE nsresult GetAgeValue(uint32_t* result); + MOZ_MUST_USE nsresult GetMaxAgeValue(uint32_t* result); + MOZ_MUST_USE nsresult GetStaleWhileRevalidateValue(uint32_t* result); + MOZ_MUST_USE nsresult GetDateValue(uint32_t* result); + MOZ_MUST_USE nsresult GetExpiresValue(uint32_t* result); + MOZ_MUST_USE nsresult GetLastModifiedValue(uint32_t* result); - bool operator==(const nsHttpResponseHead &aOther) const; + bool operator==(const nsHttpResponseHead& aOther) const; // Using this function it is possible to itereate through all headers // automatically under one lock. - MOZ_MUST_USE nsresult VisitHeaders(nsIHttpHeaderVisitor *visitor, + MOZ_MUST_USE nsresult VisitHeaders(nsIHttpHeaderVisitor* visitor, nsHttpHeaderArray::VisitorFilter filter); MOZ_MUST_USE nsresult GetOriginalHeader(nsHttpAtom aHeader, - nsIHttpHeaderVisitor *aVisitor); + nsIHttpHeaderVisitor* aVisitor); bool HasContentType(); bool HasContentCharset(); private: - MOZ_MUST_USE nsresult SetHeader_locked(nsHttpAtom atom, const nsACString &h, - const nsACString &v, bool m = false); + MOZ_MUST_USE nsresult SetHeader_locked(nsHttpAtom atom, const nsACString& h, + const nsACString& v, bool m = false); void AssignDefaultStatusText(); - void ParseVersion(const char *); - void ParseCacheControl(const char *); - void ParsePragma(const char *); + void ParseVersion(const char*); + void ParseCacheControl(const char*); + void ParsePragma(const char*); - void ParseStatusLine_locked(const nsACString &line); - MOZ_MUST_USE nsresult ParseHeaderLine_locked(const nsACString &line, + void ParseStatusLine_locked(const nsACString& line); + MOZ_MUST_USE nsresult ParseHeaderLine_locked(const nsACString& line, bool originalFromNetHeaders); // these return failure if the header does not exist. MOZ_MUST_USE nsresult ParseDateHeader(nsHttpAtom header, - uint32_t *result) const; + uint32_t* result) const; bool ExpiresInPast_locked() const; - MOZ_MUST_USE nsresult GetAgeValue_locked(uint32_t *result) const; - MOZ_MUST_USE nsresult GetExpiresValue_locked(uint32_t *result) const; - MOZ_MUST_USE nsresult GetMaxAgeValue_locked(uint32_t *result) const; + MOZ_MUST_USE nsresult GetAgeValue_locked(uint32_t* result) const; + MOZ_MUST_USE nsresult GetExpiresValue_locked(uint32_t* result) const; + MOZ_MUST_USE nsresult GetMaxAgeValue_locked(uint32_t* result) const; MOZ_MUST_USE nsresult - GetStaleWhileRevalidateValue_locked(uint32_t *result) const; + GetStaleWhileRevalidateValue_locked(uint32_t* result) const; - MOZ_MUST_USE nsresult GetDateValue_locked(uint32_t *result) const { + MOZ_MUST_USE nsresult GetDateValue_locked(uint32_t* result) const { return ParseDateHeader(nsHttp::Date, result); } - MOZ_MUST_USE nsresult GetLastModifiedValue_locked(uint32_t *result) const { + MOZ_MUST_USE nsresult GetLastModifiedValue_locked(uint32_t* result) const { return ParseDateHeader(nsHttp::Last_Modified, result); } diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index 73eeda48b7c66..0c8c5c098ae6e 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -66,14 +66,14 @@ namespace net { // helpers //----------------------------------------------------------------------------- -static void LogHeaders(const char *lineStart) { +static void LogHeaders(const char* lineStart) { nsAutoCString buf; - char *endOfLine; + char* endOfLine; while ((endOfLine = PL_strstr(lineStart, "\r\n"))) { buf.Assign(lineStart, endOfLine - lineStart); if (PL_strcasestr(buf.get(), "authorization: ") || PL_strcasestr(buf.get(), "proxy-authorization: ")) { - char *p = PL_strchr(PL_strchr(buf.get(), ' ') + 1, ' '); + char* p = PL_strchr(PL_strchr(buf.get(), ' ') + 1, ' '); while (p && *++p) *p = '*'; } LOG1((" %s\n", buf.get())); @@ -212,7 +212,7 @@ void nsHttpTransaction::SetClassOfService(uint32_t cos) { class ReleaseH2WSTrans final : public Runnable { public: - explicit ReleaseH2WSTrans(SpdyConnectTransaction *trans) + explicit ReleaseH2WSTrans(SpdyConnectTransaction* trans) : Runnable("ReleaseH2WSTrans"), mTrans(trans) {} NS_IMETHOD Run() override { @@ -260,12 +260,12 @@ nsHttpTransaction::~nsHttpTransaction() { } nsresult nsHttpTransaction::Init( - uint32_t caps, nsHttpConnectionInfo *cinfo, nsHttpRequestHead *requestHead, - nsIInputStream *requestBody, uint64_t requestContentLength, - bool requestBodyHasHeaders, nsIEventTarget *target, - nsIInterfaceRequestor *callbacks, nsITransportEventSink *eventsink, + uint32_t caps, nsHttpConnectionInfo* cinfo, nsHttpRequestHead* requestHead, + nsIInputStream* requestBody, uint64_t requestContentLength, + bool requestBodyHasHeaders, nsIEventTarget* target, + nsIInterfaceRequestor* callbacks, nsITransportEventSink* eventsink, uint64_t topLevelOuterContentWindowId, HttpTrafficCategory trafficCategory, - nsIAsyncInputStream **responseBody) { + nsIAsyncInputStream** responseBody) { nsresult rv; LOG1(("nsHttpTransaction::Init [this=%p caps=%x]\n", this, caps)); @@ -420,7 +420,7 @@ nsresult nsHttpTransaction::Init( } nsCOMPtr throttled = do_QueryInterface(mChannel); - nsIInputChannelThrottleQueue *queue; + nsIInputChannelThrottleQueue* queue; if (throttled) { rv = throttled->GetThrottleQueue(&queue); // In case of failure, just carry on without throttling. @@ -457,7 +457,7 @@ nsresult nsHttpTransaction::Init( } // This method should only be used on the socket thread -nsAHttpConnection *nsHttpTransaction::Connection() { +nsAHttpConnection* nsHttpTransaction::Connection() { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); return mConnection.get(); } @@ -472,7 +472,7 @@ void nsHttpTransaction::SetH2WSConnRefTaken() { } } -nsHttpResponseHead *nsHttpTransaction::TakeResponseHead() { +nsHttpResponseHead* nsHttpTransaction::TakeResponseHead() { MOZ_ASSERT(!mResponseHeadTaken, "TakeResponseHead called 2x"); // Lock TakeResponseHead() against main thread @@ -487,12 +487,12 @@ nsHttpResponseHead *nsHttpTransaction::TakeResponseHead() { return nullptr; } - nsHttpResponseHead *head = mResponseHead; + nsHttpResponseHead* head = mResponseHead; mResponseHead = nullptr; return head; } -nsHttpHeaderArray *nsHttpTransaction::TakeResponseTrailers() { +nsHttpHeaderArray* nsHttpTransaction::TakeResponseTrailers() { MOZ_ASSERT(!mResponseTrailersTaken, "TakeResponseTrailers called 2x"); // Lock TakeResponseTrailers() against main thread @@ -504,12 +504,12 @@ nsHttpHeaderArray *nsHttpTransaction::TakeResponseTrailers() { void nsHttpTransaction::SetProxyConnectFailed() { mProxyConnectFailed = true; } -nsHttpRequestHead *nsHttpTransaction::RequestHead() { return mRequestHead; } +nsHttpRequestHead* nsHttpTransaction::RequestHead() { return mRequestHead; } uint32_t nsHttpTransaction::Http1xTransactionCount() { return 1; } nsresult nsHttpTransaction::TakeSubTransactions( - nsTArray > &outTransactions) { + nsTArray >& outTransactions) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -517,7 +517,7 @@ nsresult nsHttpTransaction::TakeSubTransactions( // nsHttpTransaction::nsAHttpTransaction //---------------------------------------------------------------------------- -void nsHttpTransaction::SetConnection(nsAHttpConnection *conn) { +void nsHttpTransaction::SetConnection(nsAHttpConnection* conn) { { MutexAutoLock lock(mLock); mConnection = conn; @@ -532,7 +532,7 @@ void nsHttpTransaction::OnActivated() { } if (mTrafficCategory != HttpTrafficCategory::eInvalid) { - HttpTrafficAnalyzer *hta = gHttpHandler->GetHttpTrafficAnalyzer(); + HttpTrafficAnalyzer* hta = gHttpHandler->GetHttpTrafficAnalyzer(); if (hta) { hta->IncrementHttpTransaction(mTrafficCategory); } @@ -559,14 +559,14 @@ void nsHttpTransaction::OnActivated() { gHttpHandler->ConnMgr()->AddActiveTransaction(this); } -void nsHttpTransaction::GetSecurityCallbacks(nsIInterfaceRequestor **cb) { +void nsHttpTransaction::GetSecurityCallbacks(nsIInterfaceRequestor** cb) { MutexAutoLock lock(mLock); nsCOMPtr tmp(mCallbacks); tmp.forget(cb); } void nsHttpTransaction::SetSecurityCallbacks( - nsIInterfaceRequestor *aCallbacks) { + nsIInterfaceRequestor* aCallbacks) { { MutexAutoLock lock(mLock); mCallbacks = aCallbacks; @@ -579,7 +579,7 @@ void nsHttpTransaction::SetSecurityCallbacks( } } -void nsHttpTransaction::OnTransportStatus(nsITransport *transport, +void nsHttpTransaction::OnTransportStatus(nsITransport* transport, nsresult status, int64_t progress) { LOG1(("nsHttpTransaction::OnSocketStatus [this=%p status=%" PRIx32 " progress=%" PRId64 "]\n", @@ -587,7 +587,7 @@ void nsHttpTransaction::OnTransportStatus(nsITransport *transport, if (status == NS_NET_STATUS_CONNECTED_TO || status == NS_NET_STATUS_WAITING_FOR) { - nsISocketTransport *socketTransport = + nsISocketTransport* socketTransport = mConnection ? mConnection->Transport() : nullptr; if (socketTransport) { MutexAutoLock lock(mLock); @@ -723,14 +723,14 @@ void nsHttpTransaction::SetDNSWasRefreshed() { mCapsToClear |= NS_HTTP_REFRESH_DNS; } -nsresult nsHttpTransaction::ReadRequestSegment(nsIInputStream *stream, - void *closure, const char *buf, +nsresult nsHttpTransaction::ReadRequestSegment(nsIInputStream* stream, + void* closure, const char* buf, uint32_t offset, uint32_t count, - uint32_t *countRead) { + uint32_t* countRead) { // For the tracking of sent bytes that we used to do for the networkstats // API, please see bug 1318883 where it was removed. - nsHttpTransaction *trans = (nsHttpTransaction *)closure; + nsHttpTransaction* trans = (nsHttpTransaction*)closure; nsresult rv = trans->mReader->OnReadSegment(buf, count, countRead); if (NS_FAILED(rv)) return rv; @@ -740,8 +740,8 @@ nsresult nsHttpTransaction::ReadRequestSegment(nsIInputStream *stream, return NS_OK; } -nsresult nsHttpTransaction::ReadSegments(nsAHttpSegmentReader *reader, - uint32_t count, uint32_t *countRead) { +nsresult nsHttpTransaction::ReadSegments(nsAHttpSegmentReader* reader, + uint32_t count, uint32_t* countRead) { LOG(("nsHttpTransaction::ReadSegments %p", this)); MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -805,11 +805,11 @@ nsresult nsHttpTransaction::ReadSegments(nsAHttpSegmentReader *reader, return rv; } -nsresult nsHttpTransaction::WritePipeSegment(nsIOutputStream *stream, - void *closure, char *buf, +nsresult nsHttpTransaction::WritePipeSegment(nsIOutputStream* stream, + void* closure, char* buf, uint32_t offset, uint32_t count, - uint32_t *countWritten) { - nsHttpTransaction *trans = (nsHttpTransaction *)closure; + uint32_t* countWritten) { + nsHttpTransaction* trans = (nsHttpTransaction*)closure; if (trans->mTransactionDone) return NS_BASE_STREAM_CLOSED; // stop iterating @@ -904,9 +904,9 @@ void nsHttpTransaction::DontReuseConnection() { } } -nsresult nsHttpTransaction::WriteSegments(nsAHttpSegmentWriter *writer, +nsresult nsHttpTransaction::WriteSegments(nsAHttpSegmentWriter* writer, uint32_t count, - uint32_t *countWritten) { + uint32_t* countWritten) { LOG(("nsHttpTransaction::WriteSegments %p", this)); MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -1191,7 +1191,7 @@ void nsHttpTransaction::Close(nsresult reason) { } if (mTrafficCategory != HttpTrafficCategory::eInvalid) { - HttpTrafficAnalyzer *hta = gHttpHandler->GetHttpTrafficAnalyzer(); + HttpTrafficAnalyzer* hta = gHttpHandler->GetHttpTrafficAnalyzer(); if (hta) { hta->AccumulateHttpTransferredSize(mTrafficCategory, mTransferSize, mContentRead); @@ -1226,7 +1226,7 @@ void nsHttpTransaction::Close(nsresult reason) { mPipeOut->CloseWithStatus(reason); } -nsHttpConnectionInfo *nsHttpTransaction::ConnectionInfo() { +nsHttpConnectionInfo* nsHttpTransaction::ConnectionInfo() { return mConnInfo.get(); } @@ -1293,7 +1293,7 @@ nsresult nsHttpTransaction::Restart() { return gHttpHandler->InitiateTransaction(this, mPriority); } -char *nsHttpTransaction::LocateHttpStart(char *buf, uint32_t len, +char* nsHttpTransaction::LocateHttpStart(char* buf, uint32_t len, bool aAllowPartialMatch) { MOZ_ASSERT(!aAllowPartialMatch || mLineBuf.IsEmpty()); @@ -1370,7 +1370,7 @@ char *nsHttpTransaction::LocateHttpStart(char *buf, uint32_t len, return nullptr; } -nsresult nsHttpTransaction::ParseLine(nsACString &line) { +nsresult nsHttpTransaction::ParseLine(nsACString& line) { LOG1(("nsHttpTransaction::ParseLine [%s]\n", PromiseFlatCString(line).get())); nsresult rv = NS_OK; @@ -1385,7 +1385,7 @@ nsresult nsHttpTransaction::ParseLine(nsACString &line) { return rv; } -nsresult nsHttpTransaction::ParseLineSegment(char *segment, uint32_t len) { +nsresult nsHttpTransaction::ParseLineSegment(char* segment, uint32_t len) { MOZ_ASSERT(!mHaveAllHeaders, "already have all headers"); if (!mLineBuf.IsEmpty() && mLineBuf.Last() == '\n') { @@ -1424,11 +1424,11 @@ nsresult nsHttpTransaction::ParseLineSegment(char *segment, uint32_t len) { return NS_OK; } -nsresult nsHttpTransaction::ParseHead(char *buf, uint32_t count, - uint32_t *countRead) { +nsresult nsHttpTransaction::ParseHead(char* buf, uint32_t count, + uint32_t* countRead) { nsresult rv; uint32_t len; - char *eol; + char* eol; LOG(("nsHttpTransaction::ParseHead [count=%u]\n", count)); @@ -1462,7 +1462,7 @@ nsresult nsHttpTransaction::ParseHead(char *buf, uint32_t count, if (!mConnection || !mConnection->LastTransactionExpectedNoContent()) { // tolerate only minor junk before the status line mHttpResponseMatched = true; - char *p = LocateHttpStart(buf, std::min(count, 11), true); + char* p = LocateHttpStart(buf, std::min(count, 11), true); if (!p) { // Treat any 0.9 style response of a put as a failure. if (mRequestHead->IsPut()) return NS_ERROR_ABORT; @@ -1479,7 +1479,7 @@ nsresult nsHttpTransaction::ParseHead(char *buf, uint32_t count, buf = p; } } else { - char *p = LocateHttpStart(buf, count, false); + char* p = LocateHttpStart(buf, count, false); if (p) { mInvalidResponseBytesRead += p - buf; *countRead = p - buf; @@ -1503,7 +1503,7 @@ nsresult nsHttpTransaction::ParseHead(char *buf, uint32_t count, // otherwise we can assume that we don't have a HTTP/0.9 response. MOZ_ASSERT(mHttpResponseMatched); - while ((eol = static_cast(memchr(buf, '\n', count - *countRead))) != + while ((eol = static_cast(memchr(buf, '\n', count - *countRead))) != nullptr) { // found line in range [buf:eol] len = eol - buf + 1; @@ -1707,9 +1707,9 @@ nsresult nsHttpTransaction::HandleContentStart() { } // called on the socket thread -nsresult nsHttpTransaction::HandleContent(char *buf, uint32_t count, - uint32_t *contentRead, - uint32_t *contentRemaining) { +nsresult nsHttpTransaction::HandleContent(char* buf, uint32_t count, + uint32_t* contentRead, + uint32_t* contentRemaining) { nsresult rv; LOG(("nsHttpTransaction::HandleContent [this=%p count=%u]\n", this, count)); @@ -1799,8 +1799,8 @@ nsresult nsHttpTransaction::HandleContent(char *buf, uint32_t count, return NS_OK; } -nsresult nsHttpTransaction::ProcessData(char *buf, uint32_t count, - uint32_t *countRead) { +nsresult nsHttpTransaction::ProcessData(char* buf, uint32_t count, + uint32_t* countRead) { nsresult rv; LOG1(("nsHttpTransaction::ProcessData [this=%p count=%u]\n", this, count)); @@ -1813,7 +1813,7 @@ nsresult nsHttpTransaction::ProcessData(char *buf, uint32_t count, do { uint32_t localBytesConsumed = 0; - char *localBuf = buf + bytesConsumed; + char* localBuf = buf + bytesConsumed; uint32_t localCount = count - bytesConsumed; rv = ParseHead(localBuf, localCount, &localBytesConsumed); @@ -1887,7 +1887,7 @@ nsresult nsHttpTransaction::ProcessData(char *buf, uint32_t count, return NS_OK; } -void nsHttpTransaction::SetRequestContext(nsIRequestContext *aRequestContext) { +void nsHttpTransaction::SetRequestContext(nsIRequestContext* aRequestContext) { LOG1(("nsHttpTransaction %p SetRequestContext %p\n", this, aRequestContext)); mRequestContext = aRequestContext; } @@ -1971,7 +1971,7 @@ void nsHttpTransaction::CheckForStickyAuthScheme() { CheckForStickyAuthSchemeAt(nsHttp::Proxy_Authenticate); } -void nsHttpTransaction::CheckForStickyAuthSchemeAt(nsHttpAtom const &header) { +void nsHttpTransaction::CheckForStickyAuthSchemeAt(nsHttpAtom const& header) { if (mCaps & NS_HTTP_STICKY_CONNECTION) { LOG((" already sticky")); return; @@ -2142,7 +2142,7 @@ mozilla::TimeStamp nsHttpTransaction::GetResponseEnd() { class DeleteHttpTransaction : public Runnable { public: - explicit DeleteHttpTransaction(nsHttpTransaction *trans) + explicit DeleteHttpTransaction(nsHttpTransaction* trans) : Runnable("net::DeleteHttpTransaction"), mTrans(trans) {} NS_IMETHOD Run() override { @@ -2151,7 +2151,7 @@ class DeleteHttpTransaction : public Runnable { } private: - nsHttpTransaction *mTrans; + nsHttpTransaction* mTrans; }; void nsHttpTransaction::DeleteSelfOnConsumerThread() { @@ -2232,7 +2232,7 @@ NS_IMPL_QUERY_INTERFACE(nsHttpTransaction, nsIInputStreamCallback, // called on the socket thread NS_IMETHODIMP -nsHttpTransaction::OnInputStreamReady(nsIAsyncInputStream *out) { +nsHttpTransaction::OnInputStreamReady(nsIAsyncInputStream* out) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); if (mConnection) { mConnection->TransactionHasDataToWrite(this); @@ -2248,7 +2248,7 @@ nsHttpTransaction::OnInputStreamReady(nsIAsyncInputStream *out) { // called on the socket thread NS_IMETHODIMP -nsHttpTransaction::OnOutputStreamReady(nsIAsyncOutputStream *out) { +nsHttpTransaction::OnOutputStreamReady(nsIAsyncOutputStream* out) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); mWaitingOnPipeOut = false; if (mConnection) { @@ -2259,7 +2259,7 @@ nsHttpTransaction::OnOutputStreamReady(nsIAsyncOutputStream *out) { return NS_OK; } -void nsHttpTransaction::GetNetworkAddresses(NetAddr &self, NetAddr &peer) { +void nsHttpTransaction::GetNetworkAddresses(NetAddr& self, NetAddr& peer) { MutexAutoLock lock(mLock); self = mSelfAddr; peer = mPeerAddr; @@ -2351,7 +2351,7 @@ void nsHttpTransaction::Refused0RTT() { } } -void nsHttpTransaction::SetHttpTrailers(nsCString &aTrailers) { +void nsHttpTransaction::SetHttpTrailers(nsCString& aTrailers) { LOG(("nsHttpTransaction::SetHttpTrailers %p", this)); LOG(("[\n %s\n]", aTrailers.BeginReading())); if (!mForTakeResponseTrailers) { @@ -2400,7 +2400,7 @@ bool nsHttpTransaction::IsWebsocketUpgrade() { } void nsHttpTransaction::SetH2WSTransaction( - SpdyConnectTransaction *aH2WSTransaction) { + SpdyConnectTransaction* aH2WSTransaction) { mH2WSTransaction = aH2WSTransaction; } diff --git a/netwerk/protocol/http/nsHttpTransaction.h b/netwerk/protocol/http/nsHttpTransaction.h index 033e31f86cb7f..d2156718c14e2 100644 --- a/netwerk/protocol/http/nsHttpTransaction.h +++ b/netwerk/protocol/http/nsHttpTransaction.h @@ -81,33 +81,33 @@ class nsHttpTransaction final : public nsAHttpTransaction, // headers should be available (check transaction status). // MOZ_MUST_USE nsresult - Init(uint32_t caps, nsHttpConnectionInfo *connInfo, - nsHttpRequestHead *reqHeaders, nsIInputStream *reqBody, + Init(uint32_t caps, nsHttpConnectionInfo* connInfo, + nsHttpRequestHead* reqHeaders, nsIInputStream* reqBody, uint64_t reqContentLength, bool reqBodyIncludesHeaders, - nsIEventTarget *consumerTarget, nsIInterfaceRequestor *callbacks, - nsITransportEventSink *eventsink, uint64_t topLevelOuterContentWindowId, - HttpTrafficCategory trafficCategory, nsIAsyncInputStream **responseBody); + nsIEventTarget* consumerTarget, nsIInterfaceRequestor* callbacks, + nsITransportEventSink* eventsink, uint64_t topLevelOuterContentWindowId, + HttpTrafficCategory trafficCategory, nsIAsyncInputStream** responseBody); void OnActivated() override; // attributes - nsHttpResponseHead *ResponseHead() { + nsHttpResponseHead* ResponseHead() { return mHaveAllHeaders ? mResponseHead : nullptr; } - nsISupports *SecurityInfo() { return mSecurityInfo; } + nsISupports* SecurityInfo() { return mSecurityInfo; } - nsIEventTarget *ConsumerTarget() { return mConsumerTarget; } - nsISupports *HttpChannel() { return mChannel; } + nsIEventTarget* ConsumerTarget() { return mConsumerTarget; } + nsISupports* HttpChannel() { return mChannel; } - void SetSecurityCallbacks(nsIInterfaceRequestor *aCallbacks); + void SetSecurityCallbacks(nsIInterfaceRequestor* aCallbacks); // Called to take ownership of the response headers; the transaction // will drop any reference to the response headers after this call. - nsHttpResponseHead *TakeResponseHead(); + nsHttpResponseHead* TakeResponseHead(); // Called to take ownership of the trailer headers. // Returning null if there is no trailer. - nsHttpHeaderArray *TakeResponseTrailers(); + nsHttpHeaderArray* TakeResponseTrailers(); void SetH2WSConnRefTaken(); @@ -124,7 +124,7 @@ class nsHttpTransaction final : public nsAHttpTransaction, void SetPriority(int32_t priority) { mPriority = priority; } int32_t Priority() { return mPriority; } - void PrintDiagnostics(nsCString &log); + void PrintDiagnostics(nsCString& log); // Sets mPendingTime to the current time stamp or to a null time stamp (if now // is false) @@ -134,22 +134,22 @@ class nsHttpTransaction final : public nsAHttpTransaction, const TimeStamp GetPendingTime() { return mPendingTime; } // overload of nsAHttpTransaction::RequestContext() - nsIRequestContext *RequestContext() override { return mRequestContext.get(); } - void SetRequestContext(nsIRequestContext *aRequestContext); + nsIRequestContext* RequestContext() override { return mRequestContext.get(); } + void SetRequestContext(nsIRequestContext* aRequestContext); void DispatchedAsBlocking(); void RemoveDispatchedAsBlocking(); void DisableSpdy() override; - nsHttpTransaction *QueryHttpTransaction() override { return this; } + nsHttpTransaction* QueryHttpTransaction() override { return this; } - Http2PushedStream *GetPushedStream() { return mPushedStream; } - Http2PushedStream *TakePushedStream() { - Http2PushedStream *r = mPushedStream; + Http2PushedStream* GetPushedStream() { return mPushedStream; } + Http2PushedStream* TakePushedStream() { + Http2PushedStream* r = mPushedStream; mPushedStream = nullptr; return r; } - void SetPushedStream(Http2PushedStream *push) { mPushedStream = push; } + void SetPushedStream(Http2PushedStream* push) { mPushedStream = push; } uint32_t InitialRwin() const { return mInitialRwin; }; bool ChannelPipeFull() { return mWaitingOnPipeOut; } @@ -196,34 +196,33 @@ class nsHttpTransaction final : public nsAHttpTransaction, void SetFastOpenStatus(uint8_t aStatus) override; - void SetHttpTrailers(nsCString &aTrailers); + void SetHttpTrailers(nsCString& aTrailers); bool IsWebsocketUpgrade(); - void SetH2WSTransaction(SpdyConnectTransaction *); + void SetH2WSTransaction(SpdyConnectTransaction*); private: friend class DeleteHttpTransaction; virtual ~nsHttpTransaction(); MOZ_MUST_USE nsresult Restart(); - char *LocateHttpStart(char *buf, uint32_t len, bool aAllowPartialMatch); - MOZ_MUST_USE nsresult ParseLine(nsACString &line); - MOZ_MUST_USE nsresult ParseLineSegment(char *seg, uint32_t len); - MOZ_MUST_USE nsresult ParseHead(char *, uint32_t count, uint32_t *countRead); + char* LocateHttpStart(char* buf, uint32_t len, bool aAllowPartialMatch); + MOZ_MUST_USE nsresult ParseLine(nsACString& line); + MOZ_MUST_USE nsresult ParseLineSegment(char* seg, uint32_t len); + MOZ_MUST_USE nsresult ParseHead(char*, uint32_t count, uint32_t* countRead); MOZ_MUST_USE nsresult HandleContentStart(); - MOZ_MUST_USE nsresult HandleContent(char *, uint32_t count, - uint32_t *contentRead, - uint32_t *contentRemaining); - MOZ_MUST_USE nsresult ProcessData(char *, uint32_t, uint32_t *); + MOZ_MUST_USE nsresult HandleContent(char*, uint32_t count, + uint32_t* contentRead, + uint32_t* contentRemaining); + MOZ_MUST_USE nsresult ProcessData(char*, uint32_t, uint32_t*); void DeleteSelfOnConsumerThread(); void ReleaseBlockingTransaction(); - static MOZ_MUST_USE nsresult ReadRequestSegment(nsIInputStream *, void *, - const char *, uint32_t, - uint32_t, uint32_t *); - static MOZ_MUST_USE nsresult WritePipeSegment(nsIOutputStream *, void *, - char *, uint32_t, uint32_t, - uint32_t *); + static MOZ_MUST_USE nsresult ReadRequestSegment(nsIInputStream*, void*, + const char*, uint32_t, + uint32_t, uint32_t*); + static MOZ_MUST_USE nsresult WritePipeSegment(nsIOutputStream*, void*, char*, + uint32_t, uint32_t, uint32_t*); bool TimingEnabled() const { return mCaps & NS_HTTP_TIMING_ENABLED; } @@ -239,7 +238,7 @@ class nsHttpTransaction final : public nsAHttpTransaction, // is set in mCaps. We need the sticky flag be set early to keep the // connection from very start of the authentication process. void CheckForStickyAuthScheme(); - void CheckForStickyAuthSchemeAt(nsHttpAtom const &header); + void CheckForStickyAuthSchemeAt(nsHttpAtom const& header); // Called from WriteSegments. Checks for conditions whether to throttle // reading the content. When this returns true, WriteSegments returns @@ -249,8 +248,8 @@ class nsHttpTransaction final : public nsAHttpTransaction, private: class UpdateSecurityCallbacks : public Runnable { public: - UpdateSecurityCallbacks(nsHttpTransaction *aTrans, - nsIInterfaceRequestor *aCallbacks) + UpdateSecurityCallbacks(nsHttpTransaction* aTrans, + nsIInterfaceRequestor* aCallbacks) : Runnable("net::nsHttpTransaction::UpdateSecurityCallbacks"), mTrans(aTrans), mCallbacks(aCallbacks) {} @@ -285,11 +284,11 @@ class nsHttpTransaction final : public nsAHttpTransaction, RefPtr mConnection; RefPtr mConnInfo; - nsHttpRequestHead *mRequestHead; // weak ref - nsHttpResponseHead *mResponseHead; // owning pointer + nsHttpRequestHead* mRequestHead; // weak ref + nsHttpResponseHead* mResponseHead; // owning pointer - nsAHttpSegmentReader *mReader; - nsAHttpSegmentWriter *mWriter; + nsAHttpSegmentReader* mReader; + nsAHttpSegmentWriter* mWriter; nsCString mLineBuf; // may contain a partial line @@ -304,10 +303,10 @@ class nsHttpTransaction final : public nsAHttpTransaction, // so far been skipped. uint32_t mInvalidResponseBytesRead; - Http2PushedStream *mPushedStream; + Http2PushedStream* mPushedStream; uint32_t mInitialRwin; - nsHttpChunkedDecoder *mChunkedDecoder; + nsHttpChunkedDecoder* mChunkedDecoder; TimingStruct mTimings; @@ -447,15 +446,15 @@ class nsHttpTransaction final : public nsAHttpTransaction, // existing tunnel instead of triggering creation of a new one. // The tunnel provider is used for ASpdySession::MaybeReTunnel() checks. - void SetTunnelProvider(ASpdySession *provider) { mTunnelProvider = provider; } - ASpdySession *TunnelProvider() { return mTunnelProvider; } - nsIInterfaceRequestor *SecurityCallbacks() { return mCallbacks; } + void SetTunnelProvider(ASpdySession* provider) { mTunnelProvider = provider; } + ASpdySession* TunnelProvider() { return mTunnelProvider; } + nsIInterfaceRequestor* SecurityCallbacks() { return mCallbacks; } private: RefPtr mTunnelProvider; public: - void SetTransactionObserver(TransactionObserver *arg) { + void SetTransactionObserver(TransactionObserver* arg) { mTransactionObserver = arg; } @@ -463,7 +462,7 @@ class nsHttpTransaction final : public nsAHttpTransaction, RefPtr mTransactionObserver; public: - void GetNetworkAddresses(NetAddr &self, NetAddr &peer); + void GetNetworkAddresses(NetAddr& self, NetAddr& peer); private: NetAddr mSelfAddr; diff --git a/netwerk/protocol/http/nsServerTiming.cpp b/netwerk/protocol/http/nsServerTiming.cpp index 36014f46a8560..4d2bf63ad97d7 100644 --- a/netwerk/protocol/http/nsServerTiming.cpp +++ b/netwerk/protocol/http/nsServerTiming.cpp @@ -9,19 +9,19 @@ NS_IMPL_ISUPPORTS(nsServerTiming, nsIServerTiming) NS_IMETHODIMP -nsServerTiming::GetName(nsACString &aName) { +nsServerTiming::GetName(nsACString& aName) { aName.Assign(mName); return NS_OK; } NS_IMETHODIMP -nsServerTiming::GetDuration(double *aDuration) { +nsServerTiming::GetDuration(double* aDuration) { *aDuration = mDuration; return NS_OK; } NS_IMETHODIMP -nsServerTiming::GetDescription(nsACString &aDescription) { +nsServerTiming::GetDescription(nsACString& aDescription) { aDescription.Assign(mDescription); return NS_OK; } @@ -29,7 +29,7 @@ nsServerTiming::GetDescription(nsACString &aDescription) { namespace mozilla { namespace net { -static double ParseDouble(const nsACString &aString) { +static double ParseDouble(const nsACString& aString) { nsresult rv; double val = PromiseFlatCString(aString).ToDouble(&rv); return NS_FAILED(rv) ? 0.0f : val; @@ -66,9 +66,9 @@ void ServerTimingParser::Parse() { for (uint32_t pairIndex = 1; pairIndex < parsedHeader.mValues[index].mValues.Length(); ++pairIndex) { - nsDependentCSubstring ¤tName = + nsDependentCSubstring& currentName = parsedHeader.mValues[index].mValues[pairIndex].mName; - nsDependentCSubstring ¤tValue = + nsDependentCSubstring& currentValue = parsedHeader.mValues[index].mValues[pairIndex].mValue; // We should only take the value from the first @@ -99,8 +99,8 @@ void ServerTimingParser::Parse() { } } -nsTArray> - &&ServerTimingParser::TakeServerTimingHeaders() { +nsTArray>&& +ServerTimingParser::TakeServerTimingHeaders() { return std::move(mServerTimingHeaders); } diff --git a/netwerk/protocol/http/nsServerTiming.h b/netwerk/protocol/http/nsServerTiming.h index 277f2fcad9fa5..ef6b9319a664a 100644 --- a/netwerk/protocol/http/nsServerTiming.h +++ b/netwerk/protocol/http/nsServerTiming.h @@ -18,11 +18,11 @@ class nsServerTiming final : public nsIServerTiming { nsServerTiming() = default; - void SetName(const nsACString &aName) { mName = aName; } + void SetName(const nsACString& aName) { mName = aName; } void SetDuration(double aDuration) { mDuration = aDuration; } - void SetDescription(const nsACString &aDescription) { + void SetDescription(const nsACString& aDescription) { mDescription = aDescription; } @@ -39,9 +39,9 @@ namespace net { class ServerTimingParser { public: - explicit ServerTimingParser(const nsCString &value) : mValue(value) {} + explicit ServerTimingParser(const nsCString& value) : mValue(value) {} void Parse(); - nsTArray> &&TakeServerTimingHeaders(); + nsTArray>&& TakeServerTimingHeaders(); private: nsCString mValue; diff --git a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp index fb1ba69f92693..ec6583b10d52c 100644 --- a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp +++ b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp @@ -40,7 +40,7 @@ NS_INTERFACE_MAP_BEGIN(nsViewSourceChannel) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIViewSourceChannel) NS_INTERFACE_MAP_END -nsresult nsViewSourceChannel::Init(nsIURI *uri) { +nsresult nsViewSourceChannel::Init(nsIURI* uri) { mOriginalURI = uri; nsAutoCString path; @@ -93,9 +93,9 @@ nsresult nsViewSourceChannel::Init(nsIURI *uri) { return NS_OK; } -nsresult nsViewSourceChannel::InitSrcdoc(nsIURI *aURI, nsIURI *aBaseURI, - const nsAString &aSrcdoc, - nsILoadInfo *aLoadInfo) { +nsresult nsViewSourceChannel::InitSrcdoc(nsIURI* aURI, nsIURI* aBaseURI, + const nsAString& aSrcdoc, + nsILoadInfo* aLoadInfo) { nsresult rv; nsCOMPtr inStreamURI; @@ -175,8 +175,8 @@ nsresult nsViewSourceChannel::UpdateLoadInfoResultPrincipalURI() { return NS_OK; } -nsresult nsViewSourceChannel::BuildViewSourceURI(nsIURI *aURI, - nsIURI **aResult) { +nsresult nsViewSourceChannel::BuildViewSourceURI(nsIURI* aURI, + nsIURI** aResult) { nsresult rv; // protect ourselves against broken channel implementations @@ -198,34 +198,34 @@ nsresult nsViewSourceChannel::BuildViewSourceURI(nsIURI *aURI, // nsIRequest methods: NS_IMETHODIMP -nsViewSourceChannel::GetName(nsACString &result) { +nsViewSourceChannel::GetName(nsACString& result) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsViewSourceChannel::GetTransferSize(uint64_t *aTransferSize) { +nsViewSourceChannel::GetTransferSize(uint64_t* aTransferSize) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsViewSourceChannel::GetDecodedBodySize(uint64_t *aDecodedBodySize) { +nsViewSourceChannel::GetDecodedBodySize(uint64_t* aDecodedBodySize) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsViewSourceChannel::GetEncodedBodySize(uint64_t *aEncodedBodySize) { +nsViewSourceChannel::GetEncodedBodySize(uint64_t* aEncodedBodySize) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsViewSourceChannel::IsPending(bool *result) { +nsViewSourceChannel::IsPending(bool* result) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->IsPending(result); } NS_IMETHODIMP -nsViewSourceChannel::GetStatus(nsresult *status) { +nsViewSourceChannel::GetStatus(nsresult* status) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetStatus(status); @@ -256,7 +256,7 @@ nsViewSourceChannel::Resume(void) { // nsIChannel methods: NS_IMETHODIMP -nsViewSourceChannel::GetOriginalURI(nsIURI **aURI) { +nsViewSourceChannel::GetOriginalURI(nsIURI** aURI) { NS_ASSERTION(aURI, "Null out param!"); *aURI = mOriginalURI; NS_ADDREF(*aURI); @@ -264,14 +264,14 @@ nsViewSourceChannel::GetOriginalURI(nsIURI **aURI) { } NS_IMETHODIMP -nsViewSourceChannel::SetOriginalURI(nsIURI *aURI) { +nsViewSourceChannel::SetOriginalURI(nsIURI* aURI) { NS_ENSURE_ARG_POINTER(aURI); mOriginalURI = aURI; return NS_OK; } NS_IMETHODIMP -nsViewSourceChannel::GetURI(nsIURI **aURI) { +nsViewSourceChannel::GetURI(nsIURI** aURI) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); nsCOMPtr uri; @@ -284,13 +284,13 @@ nsViewSourceChannel::GetURI(nsIURI **aURI) { } NS_IMETHODIMP -nsViewSourceChannel::Open(nsIInputStream **aStream) { +nsViewSourceChannel::Open(nsIInputStream** aStream) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return Open(aStream); } NS_IMETHODIMP -nsViewSourceChannel::AsyncOpen(nsIStreamListener *aListener) { +nsViewSourceChannel::AsyncOpen(nsIStreamListener* aListener) { // We can't ensure GetInitialSecurityCheckDone here NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); @@ -306,13 +306,13 @@ nsViewSourceChannel::AsyncOpen(nsIStreamListener *aListener) { nsCOMPtr loadGroup; mChannel->GetLoadGroup(getter_AddRefs(loadGroup)); if (loadGroup) - loadGroup->AddRequest(static_cast(this), nullptr); + loadGroup->AddRequest(static_cast(this), nullptr); nsresult rv = NS_OK; rv = mChannel->AsyncOpen(this); if (NS_FAILED(rv) && loadGroup) - loadGroup->RemoveRequest(static_cast(this), nullptr, + loadGroup->RemoveRequest(static_cast(this), nullptr, rv); if (NS_SUCCEEDED(rv)) { @@ -336,7 +336,7 @@ nsViewSourceChannel::AsyncOpen(nsIStreamListener *aListener) { */ NS_IMETHODIMP -nsViewSourceChannel::GetLoadFlags(uint32_t *aLoadFlags) { +nsViewSourceChannel::GetLoadFlags(uint32_t* aLoadFlags) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); nsresult rv = mChannel->GetLoadFlags(aLoadFlags); @@ -381,7 +381,7 @@ nsViewSourceChannel::SetLoadFlags(uint32_t aLoadFlags) { } NS_IMETHODIMP -nsViewSourceChannel::GetContentType(nsACString &aContentType) { +nsViewSourceChannel::GetContentType(nsACString& aContentType) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); aContentType.Truncate(); @@ -409,7 +409,7 @@ nsViewSourceChannel::GetContentType(nsACString &aContentType) { } NS_IMETHODIMP -nsViewSourceChannel::SetContentType(const nsACString &aContentType) { +nsViewSourceChannel::SetContentType(const nsACString& aContentType) { // Our GetContentType() currently returns VIEWSOURCE_CONTENT_TYPE // // However, during the parsing phase the parser calls our @@ -438,14 +438,14 @@ nsViewSourceChannel::SetContentType(const nsACString &aContentType) { } NS_IMETHODIMP -nsViewSourceChannel::GetContentCharset(nsACString &aContentCharset) { +nsViewSourceChannel::GetContentCharset(nsACString& aContentCharset) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetContentCharset(aContentCharset); } NS_IMETHODIMP -nsViewSourceChannel::SetContentCharset(const nsACString &aContentCharset) { +nsViewSourceChannel::SetContentCharset(const nsACString& aContentCharset) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->SetContentCharset(aContentCharset); @@ -454,7 +454,7 @@ nsViewSourceChannel::SetContentCharset(const nsACString &aContentCharset) { // We don't forward these methods becacuse content-disposition isn't whitelisted // (see GetResponseHeader/VisitResponseHeaders). NS_IMETHODIMP -nsViewSourceChannel::GetContentDisposition(uint32_t *aContentDisposition) { +nsViewSourceChannel::GetContentDisposition(uint32_t* aContentDisposition) { return NS_ERROR_NOT_AVAILABLE; } @@ -465,24 +465,24 @@ nsViewSourceChannel::SetContentDisposition(uint32_t aContentDisposition) { NS_IMETHODIMP nsViewSourceChannel::GetContentDispositionFilename( - nsAString &aContentDispositionFilename) { + nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsViewSourceChannel::SetContentDispositionFilename( - const nsAString &aContentDispositionFilename) { + const nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsViewSourceChannel::GetContentDispositionHeader( - nsACString &aContentDispositionHeader) { + nsACString& aContentDispositionHeader) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -nsViewSourceChannel::GetContentLength(int64_t *aContentLength) { +nsViewSourceChannel::GetContentLength(int64_t* aContentLength) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetContentLength(aContentLength); @@ -496,49 +496,49 @@ nsViewSourceChannel::SetContentLength(int64_t aContentLength) { } NS_IMETHODIMP -nsViewSourceChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) { +nsViewSourceChannel::GetLoadGroup(nsILoadGroup** aLoadGroup) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetLoadGroup(aLoadGroup); } NS_IMETHODIMP -nsViewSourceChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) { +nsViewSourceChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->SetLoadGroup(aLoadGroup); } NS_IMETHODIMP -nsViewSourceChannel::GetOwner(nsISupports **aOwner) { +nsViewSourceChannel::GetOwner(nsISupports** aOwner) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetOwner(aOwner); } NS_IMETHODIMP -nsViewSourceChannel::SetOwner(nsISupports *aOwner) { +nsViewSourceChannel::SetOwner(nsISupports* aOwner) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->SetOwner(aOwner); } NS_IMETHODIMP -nsViewSourceChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) { +nsViewSourceChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetLoadInfo(aLoadInfo); } NS_IMETHODIMP -nsViewSourceChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) { +nsViewSourceChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null"); return mChannel->SetLoadInfo(aLoadInfo); } NS_IMETHODIMP -nsViewSourceChannel::GetIsDocument(bool *aIsDocument) { +nsViewSourceChannel::GetIsDocument(bool* aIsDocument) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetIsDocument(aIsDocument); @@ -546,7 +546,7 @@ nsViewSourceChannel::GetIsDocument(bool *aIsDocument) { NS_IMETHODIMP nsViewSourceChannel::GetNotificationCallbacks( - nsIInterfaceRequestor **aNotificationCallbacks) { + nsIInterfaceRequestor** aNotificationCallbacks) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetNotificationCallbacks(aNotificationCallbacks); @@ -554,14 +554,14 @@ nsViewSourceChannel::GetNotificationCallbacks( NS_IMETHODIMP nsViewSourceChannel::SetNotificationCallbacks( - nsIInterfaceRequestor *aNotificationCallbacks) { + nsIInterfaceRequestor* aNotificationCallbacks) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->SetNotificationCallbacks(aNotificationCallbacks); } NS_IMETHODIMP -nsViewSourceChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { +nsViewSourceChannel::GetSecurityInfo(nsISupports** aSecurityInfo) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetSecurityInfo(aSecurityInfo); @@ -569,14 +569,14 @@ nsViewSourceChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { // nsIViewSourceChannel methods NS_IMETHODIMP -nsViewSourceChannel::GetOriginalContentType(nsACString &aContentType) { +nsViewSourceChannel::GetOriginalContentType(nsACString& aContentType) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); return mChannel->GetContentType(aContentType); } NS_IMETHODIMP -nsViewSourceChannel::SetOriginalContentType(const nsACString &aContentType) { +nsViewSourceChannel::SetOriginalContentType(const nsACString& aContentType) { NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE); // clear our cached content-type value @@ -586,13 +586,13 @@ nsViewSourceChannel::SetOriginalContentType(const nsACString &aContentType) { } NS_IMETHODIMP -nsViewSourceChannel::GetIsSrcdocChannel(bool *aIsSrcdocChannel) { +nsViewSourceChannel::GetIsSrcdocChannel(bool* aIsSrcdocChannel) { *aIsSrcdocChannel = mIsSrcdocChannel; return NS_OK; } NS_IMETHODIMP -nsViewSourceChannel::GetBaseURI(nsIURI **aBaseURI) { +nsViewSourceChannel::GetBaseURI(nsIURI** aBaseURI) { if (mIsSrcdocChannel) { nsCOMPtr isc = do_QueryInterface(mChannel); if (isc) { @@ -605,19 +605,19 @@ nsViewSourceChannel::GetBaseURI(nsIURI **aBaseURI) { } NS_IMETHODIMP -nsViewSourceChannel::SetBaseURI(nsIURI *aBaseURI) { +nsViewSourceChannel::SetBaseURI(nsIURI* aBaseURI) { mBaseURI = aBaseURI; return NS_OK; } NS_IMETHODIMP -nsViewSourceChannel::GetProtocolVersion(nsACString &aProtocolVersion) { +nsViewSourceChannel::GetProtocolVersion(nsACString& aProtocolVersion) { return NS_ERROR_NOT_IMPLEMENTED; } // nsIRequestObserver methods NS_IMETHODIMP -nsViewSourceChannel::OnStartRequest(nsIRequest *aRequest) { +nsViewSourceChannel::OnStartRequest(nsIRequest* aRequest) { NS_ENSURE_TRUE(mListener, NS_ERROR_FAILURE); // The channel may have gotten redirected... Time to update our info mChannel = do_QueryInterface(aRequest); @@ -631,31 +631,31 @@ nsViewSourceChannel::OnStartRequest(nsIRequest *aRequest) { Cancel(rv); } - return mListener->OnStartRequest(static_cast(this)); + return mListener->OnStartRequest(static_cast(this)); } NS_IMETHODIMP -nsViewSourceChannel::OnStopRequest(nsIRequest *aRequest, nsresult aStatus) { +nsViewSourceChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) { NS_ENSURE_TRUE(mListener, NS_ERROR_FAILURE); if (mChannel) { nsCOMPtr loadGroup; mChannel->GetLoadGroup(getter_AddRefs(loadGroup)); if (loadGroup) { - loadGroup->RemoveRequest(static_cast(this), + loadGroup->RemoveRequest(static_cast(this), nullptr, aStatus); } } - return mListener->OnStopRequest(static_cast(this), + return mListener->OnStopRequest(static_cast(this), aStatus); } // nsIStreamListener methods NS_IMETHODIMP -nsViewSourceChannel::OnDataAvailable(nsIRequest *aRequest, - nsIInputStream *aInputStream, +nsViewSourceChannel::OnDataAvailable(nsIRequest* aRequest, + nsIInputStream* aInputStream, uint64_t aSourceOffset, uint32_t aLength) { NS_ENSURE_TRUE(mListener, NS_ERROR_FAILURE); - return mListener->OnDataAvailable(static_cast(this), + return mListener->OnDataAvailable(static_cast(this), aInputStream, aSourceOffset, aLength); } @@ -665,7 +665,7 @@ nsViewSourceChannel::OnDataAvailable(nsIRequest *aRequest, // to override GetRequestHeader and VisitHeaders. The reason is that we don't // want various headers like Link: and Refresh: applying to view-source. NS_IMETHODIMP -nsViewSourceChannel::GetChannelId(uint64_t *aChannelId) { +nsViewSourceChannel::GetChannelId(uint64_t* aChannelId) { NS_ENSURE_ARG_POINTER(aChannelId); return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetChannelId(aChannelId); @@ -678,7 +678,7 @@ nsViewSourceChannel::SetChannelId(uint64_t aChannelId) { } NS_IMETHODIMP -nsViewSourceChannel::GetTopLevelContentWindowId(uint64_t *aWindowId) { +nsViewSourceChannel::GetTopLevelContentWindowId(uint64_t* aWindowId) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetTopLevelContentWindowId(aWindowId); } @@ -690,7 +690,7 @@ nsViewSourceChannel::SetTopLevelContentWindowId(uint64_t aWindowId) { } NS_IMETHODIMP -nsViewSourceChannel::GetTopLevelOuterContentWindowId(uint64_t *aWindowId) { +nsViewSourceChannel::GetTopLevelOuterContentWindowId(uint64_t* aWindowId) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetTopLevelOuterContentWindowId(aWindowId); @@ -704,20 +704,20 @@ nsViewSourceChannel::SetTopLevelOuterContentWindowId(uint64_t aWindowId) { } NS_IMETHODIMP -nsViewSourceChannel::IsTrackingResource(bool *aIsTrackingResource) { +nsViewSourceChannel::IsTrackingResource(bool* aIsTrackingResource) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->IsTrackingResource(aIsTrackingResource); } NS_IMETHODIMP -nsViewSourceChannel::IsThirdPartyTrackingResource(bool *aIsTrackingResource) { +nsViewSourceChannel::IsThirdPartyTrackingResource(bool* aIsTrackingResource) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->IsThirdPartyTrackingResource(aIsTrackingResource); } NS_IMETHODIMP -nsViewSourceChannel::GetClassificationFlags(uint32_t *aClassificationFlags) { +nsViewSourceChannel::GetClassificationFlags(uint32_t* aClassificationFlags) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetClassificationFlags(aClassificationFlags); @@ -725,7 +725,7 @@ nsViewSourceChannel::GetClassificationFlags(uint32_t *aClassificationFlags) { NS_IMETHODIMP nsViewSourceChannel::GetFirstPartyClassificationFlags( - uint32_t *aClassificationFlags) { + uint32_t* aClassificationFlags) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetFirstPartyClassificationFlags( aClassificationFlags); @@ -733,7 +733,7 @@ nsViewSourceChannel::GetFirstPartyClassificationFlags( NS_IMETHODIMP nsViewSourceChannel::GetThirdPartyClassificationFlags( - uint32_t *aClassificationFlags) { + uint32_t* aClassificationFlags) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetThirdPartyClassificationFlags( aClassificationFlags); @@ -741,43 +741,43 @@ nsViewSourceChannel::GetThirdPartyClassificationFlags( NS_IMETHODIMP nsViewSourceChannel::GetFlashPluginState( - nsIHttpChannel::FlashPluginState *aResult) { + nsIHttpChannel::FlashPluginState* aResult) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetFlashPluginState(aResult); } NS_IMETHODIMP -nsViewSourceChannel::GetRequestMethod(nsACString &aRequestMethod) { +nsViewSourceChannel::GetRequestMethod(nsACString& aRequestMethod) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetRequestMethod(aRequestMethod); } NS_IMETHODIMP -nsViewSourceChannel::SetRequestMethod(const nsACString &aRequestMethod) { +nsViewSourceChannel::SetRequestMethod(const nsACString& aRequestMethod) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->SetRequestMethod(aRequestMethod); } NS_IMETHODIMP -nsViewSourceChannel::GetReferrer(nsIURI **aReferrer) { +nsViewSourceChannel::GetReferrer(nsIURI** aReferrer) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetReferrer(aReferrer); } NS_IMETHODIMP -nsViewSourceChannel::SetReferrer(nsIURI *aReferrer) { +nsViewSourceChannel::SetReferrer(nsIURI* aReferrer) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->SetReferrer(aReferrer); } NS_IMETHODIMP -nsViewSourceChannel::GetReferrerPolicy(uint32_t *aReferrerPolicy) { +nsViewSourceChannel::GetReferrerPolicy(uint32_t* aReferrerPolicy) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetReferrerPolicy(aReferrerPolicy); } NS_IMETHODIMP -nsViewSourceChannel::SetReferrerWithPolicy(nsIURI *aReferrer, +nsViewSourceChannel::SetReferrerWithPolicy(nsIURI* aReferrer, uint32_t aReferrerPolicy) { return !mHttpChannel ? NS_ERROR_NULL_POINTER @@ -785,42 +785,42 @@ nsViewSourceChannel::SetReferrerWithPolicy(nsIURI *aReferrer, } NS_IMETHODIMP -nsViewSourceChannel::GetRequestHeader(const nsACString &aHeader, - nsACString &aValue) { +nsViewSourceChannel::GetRequestHeader(const nsACString& aHeader, + nsACString& aValue) { aValue.Truncate(); return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetRequestHeader(aHeader, aValue); } NS_IMETHODIMP -nsViewSourceChannel::SetRequestHeader(const nsACString &aHeader, - const nsACString &aValue, bool aMerge) { +nsViewSourceChannel::SetRequestHeader(const nsACString& aHeader, + const nsACString& aValue, bool aMerge) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->SetRequestHeader(aHeader, aValue, aMerge); } NS_IMETHODIMP -nsViewSourceChannel::SetEmptyRequestHeader(const nsACString &aHeader) { +nsViewSourceChannel::SetEmptyRequestHeader(const nsACString& aHeader) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->SetEmptyRequestHeader(aHeader); } NS_IMETHODIMP -nsViewSourceChannel::VisitRequestHeaders(nsIHttpHeaderVisitor *aVisitor) { +nsViewSourceChannel::VisitRequestHeaders(nsIHttpHeaderVisitor* aVisitor) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->VisitRequestHeaders(aVisitor); } NS_IMETHODIMP nsViewSourceChannel::VisitNonDefaultRequestHeaders( - nsIHttpHeaderVisitor *aVisitor) { + nsIHttpHeaderVisitor* aVisitor) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->VisitNonDefaultRequestHeaders(aVisitor); } NS_IMETHODIMP -nsViewSourceChannel::GetAllowPipelining(bool *aAllowPipelining) { +nsViewSourceChannel::GetAllowPipelining(bool* aAllowPipelining) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetAllowPipelining(aAllowPipelining); } @@ -832,7 +832,7 @@ nsViewSourceChannel::SetAllowPipelining(bool aAllowPipelining) { } NS_IMETHODIMP -nsViewSourceChannel::GetAllowSTS(bool *aAllowSTS) { +nsViewSourceChannel::GetAllowSTS(bool* aAllowSTS) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetAllowSTS(aAllowSTS); } @@ -844,7 +844,7 @@ nsViewSourceChannel::SetAllowSTS(bool aAllowSTS) { } NS_IMETHODIMP -nsViewSourceChannel::GetRedirectionLimit(uint32_t *aRedirectionLimit) { +nsViewSourceChannel::GetRedirectionLimit(uint32_t* aRedirectionLimit) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetRedirectionLimit(aRedirectionLimit); } @@ -856,27 +856,27 @@ nsViewSourceChannel::SetRedirectionLimit(uint32_t aRedirectionLimit) { } NS_IMETHODIMP -nsViewSourceChannel::GetResponseStatus(uint32_t *aResponseStatus) { +nsViewSourceChannel::GetResponseStatus(uint32_t* aResponseStatus) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetResponseStatus(aResponseStatus); } NS_IMETHODIMP -nsViewSourceChannel::GetResponseStatusText(nsACString &aResponseStatusText) { +nsViewSourceChannel::GetResponseStatusText(nsACString& aResponseStatusText) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetResponseStatusText(aResponseStatusText); } NS_IMETHODIMP -nsViewSourceChannel::GetRequestSucceeded(bool *aRequestSucceeded) { +nsViewSourceChannel::GetRequestSucceeded(bool* aRequestSucceeded) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetRequestSucceeded(aRequestSucceeded); } NS_IMETHODIMP -nsViewSourceChannel::GetResponseHeader(const nsACString &aHeader, - nsACString &aValue) { +nsViewSourceChannel::GetResponseHeader(const nsACString& aHeader, + nsACString& aValue) { aValue.Truncate(); if (!mHttpChannel) return NS_ERROR_NULL_POINTER; @@ -899,14 +899,14 @@ nsViewSourceChannel::GetResponseHeader(const nsACString &aHeader, } NS_IMETHODIMP -nsViewSourceChannel::SetResponseHeader(const nsACString &header, - const nsACString &value, bool merge) { +nsViewSourceChannel::SetResponseHeader(const nsACString& header, + const nsACString& value, bool merge) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->SetResponseHeader(header, value, merge); } NS_IMETHODIMP -nsViewSourceChannel::VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor) { +nsViewSourceChannel::VisitResponseHeaders(nsIHttpHeaderVisitor* aVisitor) { if (!mHttpChannel) return NS_ERROR_NULL_POINTER; NS_NAMED_LITERAL_CSTRING(contentTypeStr, "Content-Type"); @@ -919,8 +919,8 @@ nsViewSourceChannel::VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor) { } NS_IMETHODIMP -nsViewSourceChannel::GetOriginalResponseHeader(const nsACString &aHeader, - nsIHttpHeaderVisitor *aVisitor) { +nsViewSourceChannel::GetOriginalResponseHeader(const nsACString& aHeader, + nsIHttpHeaderVisitor* aVisitor) { nsAutoCString value; nsresult rv = GetResponseHeader(aHeader, value); if (NS_FAILED(rv)) { @@ -931,35 +931,35 @@ nsViewSourceChannel::GetOriginalResponseHeader(const nsACString &aHeader, NS_IMETHODIMP nsViewSourceChannel::VisitOriginalResponseHeaders( - nsIHttpHeaderVisitor *aVisitor) { + nsIHttpHeaderVisitor* aVisitor) { return VisitResponseHeaders(aVisitor); } NS_IMETHODIMP -nsViewSourceChannel::IsNoStoreResponse(bool *_retval) { +nsViewSourceChannel::IsNoStoreResponse(bool* _retval) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->IsNoStoreResponse(_retval); } NS_IMETHODIMP -nsViewSourceChannel::IsNoCacheResponse(bool *_retval) { +nsViewSourceChannel::IsNoCacheResponse(bool* _retval) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->IsNoCacheResponse(_retval); } NS_IMETHODIMP -nsViewSourceChannel::IsPrivateResponse(bool *_retval) { +nsViewSourceChannel::IsPrivateResponse(bool* _retval) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->IsPrivateResponse(_retval); } NS_IMETHODIMP -nsViewSourceChannel::RedirectTo(nsIURI *uri) { +nsViewSourceChannel::RedirectTo(nsIURI* uri) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->RedirectTo(uri); } NS_IMETHODIMP -nsViewSourceChannel::SwitchProcessTo(mozilla::dom::Promise *aBrowserParent, +nsViewSourceChannel::SwitchProcessTo(mozilla::dom::Promise* aBrowserParent, uint64_t aIdentifier) { return !mHttpChannel ? NS_ERROR_NULL_POINTER @@ -967,7 +967,7 @@ nsViewSourceChannel::SwitchProcessTo(mozilla::dom::Promise *aBrowserParent, } NS_IMETHODIMP -nsViewSourceChannel::HasCrossOriginOpenerPolicyMismatch(bool *aMismatch) { +nsViewSourceChannel::HasCrossOriginOpenerPolicyMismatch(bool* aMismatch) { MOZ_ASSERT(aMismatch); if (!aMismatch) { return NS_ERROR_INVALID_ARG; @@ -983,7 +983,7 @@ nsViewSourceChannel::UpgradeToSecure() { } NS_IMETHODIMP -nsViewSourceChannel::GetRequestContextID(uint64_t *_retval) { +nsViewSourceChannel::GetRequestContextID(uint64_t* _retval) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetRequestContextID(_retval); } @@ -995,7 +995,7 @@ nsViewSourceChannel::SetRequestContextID(uint64_t rcid) { } NS_IMETHODIMP -nsViewSourceChannel::GetIsMainDocumentChannel(bool *aValue) { +nsViewSourceChannel::GetIsMainDocumentChannel(bool* aValue) { return !mHttpChannel ? NS_ERROR_NULL_POINTER : mHttpChannel->GetIsMainDocumentChannel(aValue); } @@ -1008,7 +1008,7 @@ nsViewSourceChannel::SetIsMainDocumentChannel(bool aValue) { // Have to manually forward SetCorsPreflightParameters since it's [notxpcom] void nsViewSourceChannel::SetCorsPreflightParameters( - const nsTArray &aUnsafeHeaders) { + const nsTArray& aUnsafeHeaders) { mHttpChannelInternal->SetCorsPreflightParameters(aUnsafeHeaders); } @@ -1017,8 +1017,8 @@ void nsViewSourceChannel::SetAltDataForChild(bool aIsForChild) { } NS_IMETHODIMP -nsViewSourceChannel::LogBlockedCORSRequest(const nsAString &aMessage, - const nsACString &aCategory) { +nsViewSourceChannel::LogBlockedCORSRequest(const nsAString& aMessage, + const nsACString& aCategory) { if (!mHttpChannel) { NS_WARNING( "nsViewSourceChannel::LogBlockedCORSRequest mHttpChannel is null"); @@ -1028,9 +1028,9 @@ nsViewSourceChannel::LogBlockedCORSRequest(const nsAString &aMessage, } NS_IMETHODIMP -nsViewSourceChannel::LogMimeTypeMismatch(const nsACString &aMessageName, - bool aWarning, const nsAString &aURL, - const nsAString &aContentType) { +nsViewSourceChannel::LogMimeTypeMismatch(const nsACString& aMessageName, + bool aWarning, const nsAString& aURL, + const nsAString& aContentType) { if (!mHttpChannel) { NS_WARNING("nsViewSourceChannel::LogMimeTypeMismatch mHttpChannel is null"); return NS_ERROR_UNEXPECTED; @@ -1039,8 +1039,8 @@ nsViewSourceChannel::LogMimeTypeMismatch(const nsACString &aMessageName, aContentType); } -const nsTArray - &nsViewSourceChannel::PreferredAlternativeDataTypes() { +const nsTArray& +nsViewSourceChannel::PreferredAlternativeDataTypes() { if (mCacheInfoChannel) { return mCacheInfoChannel->PreferredAlternativeDataTypes(); } diff --git a/netwerk/protocol/viewsource/nsViewSourceHandler.cpp b/netwerk/protocol/viewsource/nsViewSourceHandler.cpp index c5442440aef78..9e058dd40af5f 100644 --- a/netwerk/protocol/viewsource/nsViewSourceHandler.cpp +++ b/netwerk/protocol/viewsource/nsViewSourceHandler.cpp @@ -26,25 +26,25 @@ NS_IMPL_ISUPPORTS(nsViewSourceHandler, nsIProtocolHandler, // nsIProtocolHandler methods: NS_IMETHODIMP -nsViewSourceHandler::GetScheme(nsACString &result) { +nsViewSourceHandler::GetScheme(nsACString& result) { result.AssignLiteral(VIEW_SOURCE); return NS_OK; } NS_IMETHODIMP -nsViewSourceHandler::GetDefaultPort(int32_t *result) { +nsViewSourceHandler::GetDefaultPort(int32_t* result) { *result = -1; return NS_OK; } NS_IMETHODIMP -nsViewSourceHandler::GetProtocolFlags(uint32_t *result) { +nsViewSourceHandler::GetProtocolFlags(uint32_t* result) { *result = DEFAULT_FLAGS; return NS_OK; } NS_IMETHODIMP -nsViewSourceHandler::GetFlagsForURI(nsIURI *aURI, uint32_t *result) { +nsViewSourceHandler::GetFlagsForURI(nsIURI* aURI, uint32_t* result) { *result = DEFAULT_FLAGS; nsCOMPtr nestedURI(do_QueryInterface(aURI)); if (!nestedURI) { @@ -65,8 +65,8 @@ nsViewSourceHandler::GetFlagsForURI(nsIURI *aURI, uint32_t *result) { } NS_IMETHODIMP -nsViewSourceHandler::NewURI(const nsACString &aSpec, const char *aCharset, - nsIURI *aBaseURI, nsIURI **aResult) { +nsViewSourceHandler::NewURI(const nsACString& aSpec, const char* aCharset, + nsIURI* aBaseURI, nsIURI** aResult) { *aResult = nullptr; // Extract inner URL and normalize to ASCII. This is done to properly @@ -102,8 +102,8 @@ nsViewSourceHandler::NewURI(const nsACString &aSpec, const char *aCharset, } NS_IMETHODIMP -nsViewSourceHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, - nsIChannel **result) { +nsViewSourceHandler::NewChannel(nsIURI* uri, nsILoadInfo* aLoadInfo, + nsIChannel** result) { NS_ENSURE_ARG_POINTER(uri); RefPtr channel = new nsViewSourceChannel(); @@ -122,10 +122,10 @@ nsViewSourceHandler::NewChannel(nsIURI *uri, nsILoadInfo *aLoadInfo, return NS_OK; } -nsresult nsViewSourceHandler::NewSrcdocChannel(nsIURI *aURI, nsIURI *aBaseURI, - const nsAString &aSrcdoc, - nsILoadInfo *aLoadInfo, - nsIChannel **outChannel) { +nsresult nsViewSourceHandler::NewSrcdocChannel(nsIURI* aURI, nsIURI* aBaseURI, + const nsAString& aSrcdoc, + nsILoadInfo* aLoadInfo, + nsIChannel** outChannel) { NS_ENSURE_ARG_POINTER(aURI); RefPtr channel = new nsViewSourceChannel(); @@ -134,13 +134,13 @@ nsresult nsViewSourceHandler::NewSrcdocChannel(nsIURI *aURI, nsIURI *aBaseURI, return rv; } - *outChannel = static_cast(channel.forget().take()); + *outChannel = static_cast(channel.forget().take()); return NS_OK; } NS_IMETHODIMP -nsViewSourceHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +nsViewSourceHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { // don't override anything. *_retval = false; return NS_OK; @@ -150,9 +150,9 @@ nsViewSourceHandler::nsViewSourceHandler() { gInstance = this; } nsViewSourceHandler::~nsViewSourceHandler() { gInstance = nullptr; } -nsViewSourceHandler *nsViewSourceHandler::gInstance = nullptr; +nsViewSourceHandler* nsViewSourceHandler::gInstance = nullptr; -nsViewSourceHandler *nsViewSourceHandler::GetInstance() { return gInstance; } +nsViewSourceHandler* nsViewSourceHandler::GetInstance() { return gInstance; } } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/viewsource/nsViewSourceHandler.h b/netwerk/protocol/viewsource/nsViewSourceHandler.h index f1d82a5770060..9e6ab4f15881f 100644 --- a/netwerk/protocol/viewsource/nsViewSourceHandler.h +++ b/netwerk/protocol/viewsource/nsViewSourceHandler.h @@ -26,17 +26,17 @@ class nsViewSourceHandler final : public nsIProtocolHandlerWithDynamicFlags, // Creates a new nsViewSourceChannel to view the source of an about:srcdoc // URI with contents specified by srcdoc. - MOZ_MUST_USE nsresult NewSrcdocChannel(nsIURI *aURI, nsIURI *aBaseURI, - const nsAString &aSrcdoc, - nsILoadInfo *aLoadInfo, - nsIChannel **outChannel); + MOZ_MUST_USE nsresult NewSrcdocChannel(nsIURI* aURI, nsIURI* aBaseURI, + const nsAString& aSrcdoc, + nsILoadInfo* aLoadInfo, + nsIChannel** outChannel); - static nsViewSourceHandler *GetInstance(); + static nsViewSourceHandler* GetInstance(); private: ~nsViewSourceHandler(); - static nsViewSourceHandler *gInstance; + static nsViewSourceHandler* gInstance; }; } // namespace net diff --git a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp index b55796a5d8097..bd49aa5d5f3fe 100644 --- a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp +++ b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp @@ -46,7 +46,7 @@ BaseWebSocketChannel::BaseWebSocketChannel() // Generation of a unique serial ID. uint64_t processID = 0; if (XRE_IsContentProcess()) { - ContentChild *cc = ContentChild::GetSingleton(); + ContentChild* cc = ContentChild::GetSingleton(); processID = cc->GetID(); } @@ -69,7 +69,7 @@ BaseWebSocketChannel::BaseWebSocketChannel() //----------------------------------------------------------------------------- NS_IMETHODIMP -BaseWebSocketChannel::GetOriginalURI(nsIURI **aOriginalURI) { +BaseWebSocketChannel::GetOriginalURI(nsIURI** aOriginalURI) { LOG(("BaseWebSocketChannel::GetOriginalURI() %p\n", this)); if (!mOriginalURI) return NS_ERROR_NOT_INITIALIZED; @@ -78,7 +78,7 @@ BaseWebSocketChannel::GetOriginalURI(nsIURI **aOriginalURI) { } NS_IMETHODIMP -BaseWebSocketChannel::GetURI(nsIURI **aURI) { +BaseWebSocketChannel::GetURI(nsIURI** aURI) { LOG(("BaseWebSocketChannel::GetURI() %p\n", this)); if (!mOriginalURI) return NS_ERROR_NOT_INITIALIZED; @@ -91,7 +91,7 @@ BaseWebSocketChannel::GetURI(nsIURI **aURI) { NS_IMETHODIMP BaseWebSocketChannel::GetNotificationCallbacks( - nsIInterfaceRequestor **aNotificationCallbacks) { + nsIInterfaceRequestor** aNotificationCallbacks) { LOG(("BaseWebSocketChannel::GetNotificationCallbacks() %p\n", this)); NS_IF_ADDREF(*aNotificationCallbacks = mCallbacks); return NS_OK; @@ -99,62 +99,62 @@ BaseWebSocketChannel::GetNotificationCallbacks( NS_IMETHODIMP BaseWebSocketChannel::SetNotificationCallbacks( - nsIInterfaceRequestor *aNotificationCallbacks) { + nsIInterfaceRequestor* aNotificationCallbacks) { LOG(("BaseWebSocketChannel::SetNotificationCallbacks() %p\n", this)); mCallbacks = aNotificationCallbacks; return NS_OK; } NS_IMETHODIMP -BaseWebSocketChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) { +BaseWebSocketChannel::GetLoadGroup(nsILoadGroup** aLoadGroup) { LOG(("BaseWebSocketChannel::GetLoadGroup() %p\n", this)); NS_IF_ADDREF(*aLoadGroup = mLoadGroup); return NS_OK; } NS_IMETHODIMP -BaseWebSocketChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) { +BaseWebSocketChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) { LOG(("BaseWebSocketChannel::SetLoadGroup() %p\n", this)); mLoadGroup = aLoadGroup; return NS_OK; } NS_IMETHODIMP -BaseWebSocketChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) { +BaseWebSocketChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) { MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null"); mLoadInfo = aLoadInfo; return NS_OK; } NS_IMETHODIMP -BaseWebSocketChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) { +BaseWebSocketChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) { NS_IF_ADDREF(*aLoadInfo = mLoadInfo); return NS_OK; } NS_IMETHODIMP -BaseWebSocketChannel::GetExtensions(nsACString &aExtensions) { +BaseWebSocketChannel::GetExtensions(nsACString& aExtensions) { LOG(("BaseWebSocketChannel::GetExtensions() %p\n", this)); aExtensions = mNegotiatedExtensions; return NS_OK; } NS_IMETHODIMP -BaseWebSocketChannel::GetProtocol(nsACString &aProtocol) { +BaseWebSocketChannel::GetProtocol(nsACString& aProtocol) { LOG(("BaseWebSocketChannel::GetProtocol() %p\n", this)); aProtocol = mProtocol; return NS_OK; } NS_IMETHODIMP -BaseWebSocketChannel::SetProtocol(const nsACString &aProtocol) { +BaseWebSocketChannel::SetProtocol(const nsACString& aProtocol) { LOG(("BaseWebSocketChannel::SetProtocol() %p\n", this)); mProtocol = aProtocol; /* the sub protocol */ return NS_OK; } NS_IMETHODIMP -BaseWebSocketChannel::GetPingInterval(uint32_t *aSeconds) { +BaseWebSocketChannel::GetPingInterval(uint32_t* aSeconds) { // stored in ms but should only have second resolution MOZ_ASSERT(!(mPingInterval % 1000)); @@ -177,7 +177,7 @@ BaseWebSocketChannel::SetPingInterval(uint32_t aSeconds) { } NS_IMETHODIMP -BaseWebSocketChannel::GetPingTimeout(uint32_t *aSeconds) { +BaseWebSocketChannel::GetPingTimeout(uint32_t* aSeconds) { // stored in ms but should only have second resolution MOZ_ASSERT(!(mPingResponseTimeout % 1000)); @@ -200,10 +200,10 @@ BaseWebSocketChannel::SetPingTimeout(uint32_t aSeconds) { } NS_IMETHODIMP -BaseWebSocketChannel::InitLoadInfoNative(nsINode *aLoadingNode, - nsIPrincipal *aLoadingPrincipal, - nsIPrincipal *aTriggeringPrincipal, - nsICookieSettings *aCookieSettings, +BaseWebSocketChannel::InitLoadInfoNative(nsINode* aLoadingNode, + nsIPrincipal* aLoadingPrincipal, + nsIPrincipal* aTriggeringPrincipal, + nsICookieSettings* aCookieSettings, uint32_t aSecurityFlags, uint32_t aContentPolicyType) { mLoadInfo = new LoadInfo(aLoadingPrincipal, aTriggeringPrincipal, @@ -215,9 +215,9 @@ BaseWebSocketChannel::InitLoadInfoNative(nsINode *aLoadingNode, } NS_IMETHODIMP -BaseWebSocketChannel::InitLoadInfo(nsINode *aLoadingNode, - nsIPrincipal *aLoadingPrincipal, - nsIPrincipal *aTriggeringPrincipal, +BaseWebSocketChannel::InitLoadInfo(nsINode* aLoadingNode, + nsIPrincipal* aLoadingPrincipal, + nsIPrincipal* aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType) { return InitLoadInfoNative(aLoadingNode, aLoadingPrincipal, @@ -226,7 +226,7 @@ BaseWebSocketChannel::InitLoadInfo(nsINode *aLoadingNode, } NS_IMETHODIMP -BaseWebSocketChannel::GetSerial(uint32_t *aSerial) { +BaseWebSocketChannel::GetSerial(uint32_t* aSerial) { if (!aSerial) { return NS_ERROR_FAILURE; } @@ -243,7 +243,7 @@ BaseWebSocketChannel::SetSerial(uint32_t aSerial) { NS_IMETHODIMP BaseWebSocketChannel::SetServerParameters( - nsITransportProvider *aProvider, const nsACString &aNegotiatedExtensions) { + nsITransportProvider* aProvider, const nsACString& aNegotiatedExtensions) { MOZ_ASSERT(aProvider); mServerTransportProvider = aProvider; mNegotiatedExtensions = aNegotiatedExtensions; @@ -256,7 +256,7 @@ BaseWebSocketChannel::SetServerParameters( //----------------------------------------------------------------------------- NS_IMETHODIMP -BaseWebSocketChannel::GetScheme(nsACString &aScheme) { +BaseWebSocketChannel::GetScheme(nsACString& aScheme) { LOG(("BaseWebSocketChannel::GetScheme() %p\n", this)); if (mEncrypted) @@ -267,7 +267,7 @@ BaseWebSocketChannel::GetScheme(nsACString &aScheme) { } NS_IMETHODIMP -BaseWebSocketChannel::GetDefaultPort(int32_t *aDefaultPort) { +BaseWebSocketChannel::GetDefaultPort(int32_t* aDefaultPort) { LOG(("BaseWebSocketChannel::GetDefaultPort() %p\n", this)); if (mEncrypted) @@ -278,7 +278,7 @@ BaseWebSocketChannel::GetDefaultPort(int32_t *aDefaultPort) { } NS_IMETHODIMP -BaseWebSocketChannel::GetProtocolFlags(uint32_t *aProtocolFlags) { +BaseWebSocketChannel::GetProtocolFlags(uint32_t* aProtocolFlags) { LOG(("BaseWebSocketChannel::GetProtocolFlags() %p\n", this)); *aProtocolFlags = URI_NORELATIVE | URI_NON_PERSISTABLE | ALLOWS_PROXY | @@ -291,9 +291,9 @@ BaseWebSocketChannel::GetProtocolFlags(uint32_t *aProtocolFlags) { } NS_IMETHODIMP -BaseWebSocketChannel::NewURI(const nsACString &aSpec, - const char *aOriginCharset, nsIURI *aBaseURI, - nsIURI **_retval) { +BaseWebSocketChannel::NewURI(const nsACString& aSpec, + const char* aOriginCharset, nsIURI* aBaseURI, + nsIURI** _retval) { LOG(("BaseWebSocketChannel::NewURI() %p\n", this)); int32_t port; @@ -309,15 +309,15 @@ BaseWebSocketChannel::NewURI(const nsACString &aSpec, } NS_IMETHODIMP -BaseWebSocketChannel::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, - nsIChannel **outChannel) { +BaseWebSocketChannel::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, + nsIChannel** outChannel) { LOG(("BaseWebSocketChannel::NewChannel() %p\n", this)); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -BaseWebSocketChannel::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +BaseWebSocketChannel::AllowPort(int32_t port, const char* scheme, + bool* _retval) { LOG(("BaseWebSocketChannel::AllowPort() %p\n", this)); // do not override any blacklisted ports @@ -330,7 +330,7 @@ BaseWebSocketChannel::AllowPort(int32_t port, const char *scheme, //----------------------------------------------------------------------------- NS_IMETHODIMP -BaseWebSocketChannel::RetargetDeliveryTo(nsIEventTarget *aTargetThread) { +BaseWebSocketChannel::RetargetDeliveryTo(nsIEventTarget* aTargetThread) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aTargetThread); MOZ_ASSERT(!mTargetThread, @@ -343,7 +343,7 @@ BaseWebSocketChannel::RetargetDeliveryTo(nsIEventTarget *aTargetThread) { } NS_IMETHODIMP -BaseWebSocketChannel::GetDeliveryTarget(nsIEventTarget **aTargetThread) { +BaseWebSocketChannel::GetDeliveryTarget(nsIEventTarget** aTargetThread) { MOZ_ASSERT(NS_IsMainThread()); nsCOMPtr target = mTargetThread; @@ -355,7 +355,7 @@ BaseWebSocketChannel::GetDeliveryTarget(nsIEventTarget **aTargetThread) { } BaseWebSocketChannel::ListenerAndContextContainer::ListenerAndContextContainer( - nsIWebSocketListener *aListener, nsISupports *aContext) + nsIWebSocketListener* aListener, nsISupports* aContext) : mListener(aListener), mContext(aContext) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(mListener); diff --git a/netwerk/protocol/websocket/BaseWebSocketChannel.h b/netwerk/protocol/websocket/BaseWebSocketChannel.h index fcc058e1d20f8..d44e09ac78cbf 100644 --- a/netwerk/protocol/websocket/BaseWebSocketChannel.h +++ b/netwerk/protocol/websocket/BaseWebSocketChannel.h @@ -30,56 +30,56 @@ class BaseWebSocketChannel : public nsIWebSocketChannel, NS_DECL_NSIPROTOCOLHANDLER NS_DECL_NSITHREADRETARGETABLEREQUEST - NS_IMETHOD QueryInterface(const nsIID &uuid, void **result) override = 0; + NS_IMETHOD QueryInterface(const nsIID& uuid, void** result) override = 0; NS_IMETHOD_(MozExternalRefCountType) AddRef(void) override = 0; NS_IMETHOD_(MozExternalRefCountType) Release(void) override = 0; // Partial implementation of nsIWebSocketChannel // - NS_IMETHOD GetOriginalURI(nsIURI **aOriginalURI) override; - NS_IMETHOD GetURI(nsIURI **aURI) override; + NS_IMETHOD GetOriginalURI(nsIURI** aOriginalURI) override; + NS_IMETHOD GetURI(nsIURI** aURI) override; NS_IMETHOD GetNotificationCallbacks( - nsIInterfaceRequestor **aNotificationCallbacks) override; + nsIInterfaceRequestor** aNotificationCallbacks) override; NS_IMETHOD SetNotificationCallbacks( - nsIInterfaceRequestor *aNotificationCallbacks) override; - NS_IMETHOD GetLoadGroup(nsILoadGroup **aLoadGroup) override; - NS_IMETHOD SetLoadGroup(nsILoadGroup *aLoadGroup) override; - NS_IMETHOD SetLoadInfo(nsILoadInfo *aLoadInfo) override; - NS_IMETHOD GetLoadInfo(nsILoadInfo **aLoadInfo) override; - NS_IMETHOD GetExtensions(nsACString &aExtensions) override; - NS_IMETHOD GetProtocol(nsACString &aProtocol) override; - NS_IMETHOD SetProtocol(const nsACString &aProtocol) override; - NS_IMETHOD GetPingInterval(uint32_t *aSeconds) override; + nsIInterfaceRequestor* aNotificationCallbacks) override; + NS_IMETHOD GetLoadGroup(nsILoadGroup** aLoadGroup) override; + NS_IMETHOD SetLoadGroup(nsILoadGroup* aLoadGroup) override; + NS_IMETHOD SetLoadInfo(nsILoadInfo* aLoadInfo) override; + NS_IMETHOD GetLoadInfo(nsILoadInfo** aLoadInfo) override; + NS_IMETHOD GetExtensions(nsACString& aExtensions) override; + NS_IMETHOD GetProtocol(nsACString& aProtocol) override; + NS_IMETHOD SetProtocol(const nsACString& aProtocol) override; + NS_IMETHOD GetPingInterval(uint32_t* aSeconds) override; NS_IMETHOD SetPingInterval(uint32_t aSeconds) override; - NS_IMETHOD GetPingTimeout(uint32_t *aSeconds) override; + NS_IMETHOD GetPingTimeout(uint32_t* aSeconds) override; NS_IMETHOD SetPingTimeout(uint32_t aSeconds) override; - NS_IMETHOD InitLoadInfoNative(nsINode *aLoadingNode, - nsIPrincipal *aLoadingPrincipal, - nsIPrincipal *aTriggeringPrincipal, - nsICookieSettings *aCookieSettings, + NS_IMETHOD InitLoadInfoNative(nsINode* aLoadingNode, + nsIPrincipal* aLoadingPrincipal, + nsIPrincipal* aTriggeringPrincipal, + nsICookieSettings* aCookieSettings, uint32_t aSecurityFlags, uint32_t aContentPolicyType) override; - NS_IMETHOD InitLoadInfo(nsINode *aLoadingNode, - nsIPrincipal *aLoadingPrincipal, - nsIPrincipal *aTriggeringPrincipal, + NS_IMETHOD InitLoadInfo(nsINode* aLoadingNode, + nsIPrincipal* aLoadingPrincipal, + nsIPrincipal* aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType) override; - NS_IMETHOD GetSerial(uint32_t *aSerial) override; + NS_IMETHOD GetSerial(uint32_t* aSerial) override; NS_IMETHOD SetSerial(uint32_t aSerial) override; NS_IMETHOD SetServerParameters( - nsITransportProvider *aProvider, - const nsACString &aNegotiatedExtensions) override; + nsITransportProvider* aProvider, + const nsACString& aNegotiatedExtensions) override; // Off main thread URI access. - virtual void GetEffectiveURL(nsAString &aEffectiveURL) const = 0; + virtual void GetEffectiveURL(nsAString& aEffectiveURL) const = 0; virtual bool IsEncrypted() const = 0; class ListenerAndContextContainer final { public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ListenerAndContextContainer) - ListenerAndContextContainer(nsIWebSocketListener *aListener, - nsISupports *aContext); + ListenerAndContextContainer(nsIWebSocketListener* aListener, + nsISupports* aContext); nsCOMPtr mListener; nsCOMPtr mContext; diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp index fe527d483fbf8..62a42c11f79c9 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.cpp +++ b/netwerk/protocol/websocket/WebSocketChannel.cpp @@ -195,26 +195,26 @@ class FailDelayManager { } } - void Add(nsCString &address, int32_t port) { + void Add(nsCString& address, int32_t port) { if (mDelaysDisabled) return; - FailDelay *record = new FailDelay(address, port); + FailDelay* record = new FailDelay(address, port); mEntries.AppendElement(record); } // Element returned may not be valid after next main thread event: don't keep // pointer to it around - FailDelay *Lookup(nsCString &address, int32_t port, - uint32_t *outIndex = nullptr) { + FailDelay* Lookup(nsCString& address, int32_t port, + uint32_t* outIndex = nullptr) { if (mDelaysDisabled) return nullptr; - FailDelay *result = nullptr; + FailDelay* result = nullptr; TimeStamp rightNow = TimeStamp::Now(); // We also remove expired entries during search: iterate from end to make // indexing simpler for (int32_t i = mEntries.Length() - 1; i >= 0; --i) { - FailDelay *fail = mEntries[i]; + FailDelay* fail = mEntries[i]; if (fail->mAddress.Equals(address) && fail->mPort == port) { if (outIndex) *outIndex = i; result = fail; @@ -231,10 +231,10 @@ class FailDelayManager { } // returns true if channel connects immediately, or false if it's delayed - void DelayOrBegin(WebSocketChannel *ws) { + void DelayOrBegin(WebSocketChannel* ws) { if (!mDelaysDisabled) { uint32_t failIndex = 0; - FailDelay *fail = Lookup(ws->mAddress, ws->mPort, &failIndex); + FailDelay* fail = Lookup(ws->mAddress, ws->mPort, &failIndex); if (fail) { TimeStamp rightNow = TimeStamp::Now(); @@ -270,12 +270,12 @@ class FailDelayManager { // Remove() also deletes all expired entries as it iterates: better for // battery life than using a periodic timer. - void Remove(nsCString &address, int32_t port) { + void Remove(nsCString& address, int32_t port) { TimeStamp rightNow = TimeStamp::Now(); // iterate from end, to make deletion indexing easier for (int32_t i = mEntries.Length() - 1; i >= 0; --i) { - FailDelay *entry = mEntries[i]; + FailDelay* entry = mEntries[i]; if ((entry->mAddress.Equals(address) && entry->mPort == port) || entry->IsExpired(rightNow)) { mEntries.RemoveElementAt(i); @@ -285,7 +285,7 @@ class FailDelayManager { } private: - nsTArray mEntries; + nsTArray mEntries; bool mDelaysDisabled; }; @@ -314,7 +314,7 @@ class nsWSAdmissionManager { // Determine if we will open connection immediately (returns true), or // delay/queue the connection (returns false) - static void ConditionallyConnect(WebSocketChannel *ws) { + static void ConditionallyConnect(WebSocketChannel* ws) { LOG(("Websocket: ConditionallyConnect: [this=%p]", ws)); MOZ_ASSERT(NS_IsMainThread(), "not main thread"); MOZ_ASSERT(ws->mConnecting == NOT_CONNECTING, "opening state"); @@ -329,7 +329,7 @@ class nsWSAdmissionManager { bool found = (sManager->IndexOf(ws->mAddress) >= 0); // Always add ourselves to queue, even if we'll connect immediately - nsOpenConn *newdata = new nsOpenConn(ws->mAddress, ws); + nsOpenConn* newdata = new nsOpenConn(ws->mAddress, ws); LOG(("Websocket: adding conn %p to the queue", newdata)); sManager->mQueue.AppendElement(newdata); @@ -343,7 +343,7 @@ class nsWSAdmissionManager { } } - static void OnConnected(WebSocketChannel *aChannel) { + static void OnConnected(WebSocketChannel* aChannel) { LOG(("Websocket: OnConnected: [this=%p]", aChannel)); MOZ_ASSERT(NS_IsMainThread(), "not main thread"); @@ -372,7 +372,7 @@ class nsWSAdmissionManager { // Called every time a websocket channel ends its session (including going // away w/o ever successfully creating a connection) - static void OnStopSession(WebSocketChannel *aChannel, nsresult aReason) { + static void OnStopSession(WebSocketChannel* aChannel, nsresult aReason) { LOG(("Websocket: OnStopSession: [this=%p, reason=0x%08" PRIx32 "]", aChannel, static_cast(aReason))); @@ -383,7 +383,7 @@ class nsWSAdmissionManager { if (NS_FAILED(aReason)) { // Have we seen this failure before? - FailDelay *knownFailure = + FailDelay* knownFailure = sManager->mFailures.Lookup(aChannel->mAddress, aChannel->mPort); if (knownFailure) { if (aReason == NS_ERROR_NOT_CONNECTED) { @@ -440,7 +440,7 @@ class nsWSAdmissionManager { sManager->mSessionCount--; } - static void GetSessionCount(int32_t &aSessionCount) { + static void GetSessionCount(int32_t& aSessionCount) { StaticMutexAutoLock lock(sLock); if (!sManager) { return; @@ -460,22 +460,22 @@ class nsWSAdmissionManager { class nsOpenConn { public: - nsOpenConn(nsCString &addr, WebSocketChannel *channel) + nsOpenConn(nsCString& addr, WebSocketChannel* channel) : mAddress(addr), mChannel(channel) { MOZ_COUNT_CTOR(nsOpenConn); } ~nsOpenConn() { MOZ_COUNT_DTOR(nsOpenConn); } nsCString mAddress; - WebSocketChannel *mChannel; + WebSocketChannel* mChannel; }; - void ConnectNext(nsCString &hostName) { + void ConnectNext(nsCString& hostName) { MOZ_ASSERT(NS_IsMainThread(), "not main thread"); int32_t index = IndexOf(hostName); if (index >= 0) { - WebSocketChannel *chan = mQueue[index]->mChannel; + WebSocketChannel* chan = mQueue[index]->mChannel; MOZ_ASSERT(chan->mConnecting == CONNECTING_QUEUED, "transaction not queued but in queue"); @@ -485,25 +485,25 @@ class nsWSAdmissionManager { } } - void RemoveFromQueue(WebSocketChannel *aChannel) { + void RemoveFromQueue(WebSocketChannel* aChannel) { LOG(("Websocket: RemoveFromQueue: [this=%p]", aChannel)); int32_t index = IndexOf(aChannel); MOZ_ASSERT(index >= 0, "connection to remove not in queue"); if (index >= 0) { - nsOpenConn *olddata = mQueue[index]; + nsOpenConn* olddata = mQueue[index]; mQueue.RemoveElementAt(index); LOG(("Websocket: removing conn %p from the queue", olddata)); delete olddata; } } - int32_t IndexOf(nsCString &aStr) { + int32_t IndexOf(nsCString& aStr) { for (uint32_t i = 0; i < mQueue.Length(); i++) if (aStr == (mQueue[i])->mAddress) return i; return -1; } - int32_t IndexOf(WebSocketChannel *aChannel) { + int32_t IndexOf(WebSocketChannel* aChannel) { for (uint32_t i = 0; i < mQueue.Length(); i++) if (aChannel == (mQueue[i])->mChannel) return i; return -1; @@ -520,15 +520,15 @@ class nsWSAdmissionManager { // // We could hash hostnames instead of using a single big vector here, but the // dataset is expected to be small. - nsTArray mQueue; + nsTArray mQueue; FailDelayManager mFailures; - static nsWSAdmissionManager *sManager; + static nsWSAdmissionManager* sManager; static StaticMutex sLock; }; -nsWSAdmissionManager *nsWSAdmissionManager::sManager; +nsWSAdmissionManager* nsWSAdmissionManager::sManager; StaticMutex nsWSAdmissionManager::sLock; //----------------------------------------------------------------------------- @@ -539,7 +539,7 @@ class CallOnMessageAvailable final : public nsIRunnable { public: NS_DECL_THREADSAFE_ISUPPORTS - CallOnMessageAvailable(WebSocketChannel *aChannel, nsACString &aData, + CallOnMessageAvailable(WebSocketChannel* aChannel, nsACString& aData, int32_t aLen) : mChannel(aChannel), mListenerMT(aChannel->mListenerMT), @@ -587,7 +587,7 @@ class CallOnStop final : public nsIRunnable { public: NS_DECL_THREADSAFE_ISUPPORTS - CallOnStop(WebSocketChannel *aChannel, nsresult aReason) + CallOnStop(WebSocketChannel* aChannel, nsresult aReason) : mChannel(aChannel), mListenerMT(mChannel->mListenerMT), mReason(aReason) {} @@ -627,8 +627,8 @@ class CallOnServerClose final : public nsIRunnable { public: NS_DECL_THREADSAFE_ISUPPORTS - CallOnServerClose(WebSocketChannel *aChannel, uint16_t aCode, - nsACString &aReason) + CallOnServerClose(WebSocketChannel* aChannel, uint16_t aCode, + nsACString& aReason) : mChannel(aChannel), mListenerMT(mChannel->mListenerMT), mCode(aCode), @@ -666,7 +666,7 @@ NS_IMPL_ISUPPORTS(CallOnServerClose, nsIRunnable) class CallAcknowledge final : public CancelableRunnable { public: - CallAcknowledge(WebSocketChannel *aChannel, uint32_t aSize) + CallAcknowledge(WebSocketChannel* aChannel, uint32_t aSize) : CancelableRunnable("net::CallAcknowledge"), mChannel(aChannel), mListenerMT(mChannel->mListenerMT), @@ -704,10 +704,10 @@ class CallOnTransportAvailable final : public nsIRunnable { public: NS_DECL_THREADSAFE_ISUPPORTS - CallOnTransportAvailable(WebSocketChannel *aChannel, - nsISocketTransport *aTransport, - nsIAsyncInputStream *aSocketIn, - nsIAsyncOutputStream *aSocketOut) + CallOnTransportAvailable(WebSocketChannel* aChannel, + nsISocketTransport* aTransport, + nsIAsyncInputStream* aSocketIn, + nsIAsyncOutputStream* aSocketOut) : mChannel(aChannel), mTransport(aTransport), mSocketIn(aSocketIn), @@ -797,7 +797,7 @@ class PMCECompression { bool UsingContextTakeover() { return !mNoContextTakeover; } - nsresult Deflate(uint8_t *data, uint32_t dataLen, nsACString &_retval) { + nsresult Deflate(uint8_t* data, uint32_t dataLen, nsACString& _retval) { if (mResetDeflater || mNoContextTakeover) { if (deflateReset(&mDeflater) != Z_OK) { return NS_ERROR_UNEXPECTED; @@ -820,7 +820,7 @@ class PMCECompression { uint32_t deflated = kBufferLen - mDeflater.avail_out; if (deflated > 0) { - _retval.Append(reinterpret_cast(mBuffer), deflated); + _retval.Append(reinterpret_cast(mBuffer), deflated); } mDeflater.avail_out = kBufferLen; @@ -848,7 +848,7 @@ class PMCECompression { return NS_OK; } - nsresult Inflate(uint8_t *data, uint32_t dataLen, nsACString &_retval) { + nsresult Inflate(uint8_t* data, uint32_t dataLen, nsACString& _retval) { mMessageDeflated = false; Bytef trailingData[] = {0x00, 0x00, 0xFF, 0xFF}; @@ -863,9 +863,9 @@ class PMCECompression { int zerr = inflate(&mInflater, Z_NO_FLUSH); if (zerr == Z_STREAM_END) { - Bytef *saveNextIn = mInflater.next_in; + Bytef* saveNextIn = mInflater.next_in; uint32_t saveAvailIn = mInflater.avail_in; - Bytef *saveNextOut = mInflater.next_out; + Bytef* saveNextOut = mInflater.next_out; uint32_t saveAvailOut = mInflater.avail_out; inflateReset(&mInflater); @@ -880,7 +880,7 @@ class PMCECompression { uint32_t inflated = kBufferLen - mInflater.avail_out; if (inflated > 0) { - _retval.Append(reinterpret_cast(mBuffer), inflated); + _retval.Append(reinterpret_cast(mBuffer), inflated); } mInflater.avail_out = kBufferLen; @@ -929,12 +929,12 @@ enum WsMsgType { kMsgTypeFin }; -static const char *msgNames[] = {"text", "binaryString", "binaryStream", +static const char* msgNames[] = {"text", "binaryString", "binaryStream", "ping", "pong", "close"}; class OutboundMessage { public: - OutboundMessage(WsMsgType type, nsCString *str) + OutboundMessage(WsMsgType type, nsCString* str) : mMsgType(type), mDeflated(false), mOrigLength(0) { MOZ_COUNT_CTOR(OutboundMessage); mMsg.pString.mValue = str; @@ -942,7 +942,7 @@ class OutboundMessage { mLength = str ? str->Length() : 0; } - OutboundMessage(nsIInputStream *stream, uint32_t length) + OutboundMessage(nsIInputStream* stream, uint32_t length) : mMsgType(kMsgTypeStream), mLength(length), mDeflated(false), @@ -978,27 +978,27 @@ class OutboundMessage { int32_t Length() const { return mLength; } int32_t OrigLength() const { return mDeflated ? mOrigLength : mLength; } - uint8_t *BeginWriting() { + uint8_t* BeginWriting() { MOZ_ASSERT(mMsgType != kMsgTypeStream, "Stream should have been converted to string by now"); - return (uint8_t *)(mMsg.pString.mValue ? mMsg.pString.mValue->BeginWriting() - : nullptr); + return (uint8_t*)(mMsg.pString.mValue ? mMsg.pString.mValue->BeginWriting() + : nullptr); } - uint8_t *BeginReading() { + uint8_t* BeginReading() { MOZ_ASSERT(mMsgType != kMsgTypeStream, "Stream should have been converted to string by now"); - return (uint8_t *)(mMsg.pString.mValue ? mMsg.pString.mValue->BeginReading() - : nullptr); + return (uint8_t*)(mMsg.pString.mValue ? mMsg.pString.mValue->BeginReading() + : nullptr); } - uint8_t *BeginOrigReading() { + uint8_t* BeginOrigReading() { MOZ_ASSERT(mMsgType != kMsgTypeStream, "Stream should have been converted to string by now"); if (!mDeflated) return BeginReading(); - return (uint8_t *)(mMsg.pString.mOrigValue - ? mMsg.pString.mOrigValue->BeginReading() - : nullptr); + return (uint8_t*)(mMsg.pString.mOrigValue + ? mMsg.pString.mOrigValue->BeginReading() + : nullptr); } nsresult ConvertStreamToString() { @@ -1021,7 +1021,7 @@ class OutboundMessage { return NS_OK; } - bool DeflatePayload(PMCECompression *aCompressor) { + bool DeflatePayload(PMCECompression* aCompressor) { MOZ_ASSERT(mMsgType != kMsgTypeStream, "Stream should have been converted to string by now"); MOZ_ASSERT(!mDeflated); @@ -1069,10 +1069,10 @@ class OutboundMessage { private: union { struct { - nsCString *mValue; - nsCString *mOrigValue; + nsCString* mValue; + nsCString* mOrigValue; } pString; - nsIInputStream *pStream; + nsIInputStream* pStream; } mMsg; WsMsgType mMsgType; uint32_t mLength; @@ -1088,7 +1088,7 @@ class OutboundEnqueuer final : public nsIRunnable { public: NS_DECL_THREADSAFE_ISUPPORTS - OutboundEnqueuer(WebSocketChannel *aChannel, OutboundMessage *aMsg) + OutboundEnqueuer(WebSocketChannel* aChannel, OutboundMessage* aMsg) : mChannel(aChannel), mMessage(aMsg) {} NS_IMETHOD Run() override { @@ -1100,7 +1100,7 @@ class OutboundEnqueuer final : public nsIRunnable { ~OutboundEnqueuer() = default; RefPtr mChannel; - OutboundMessage *mMessage; + OutboundMessage* mMessage; }; NS_IMPL_ISUPPORTS(OutboundEnqueuer, nsIRunnable) @@ -1154,7 +1154,7 @@ WebSocketChannel::WebSocketChannel() nsWSAdmissionManager::Init(); - mFramePtr = mBuffer = static_cast(moz_xmalloc(mBufferSize)); + mFramePtr = mBuffer = static_cast(moz_xmalloc(mBufferSize)); nsresult rv; mConnectionLogService = @@ -1178,11 +1178,11 @@ WebSocketChannel::~WebSocketChannel() { free(mDynamicOutput); delete mCurrentOut; - while ((mCurrentOut = (OutboundMessage *)mOutgoingPingMessages.PopFront())) + while ((mCurrentOut = (OutboundMessage*)mOutgoingPingMessages.PopFront())) delete mCurrentOut; - while ((mCurrentOut = (OutboundMessage *)mOutgoingPongMessages.PopFront())) + while ((mCurrentOut = (OutboundMessage*)mOutgoingPongMessages.PopFront())) delete mCurrentOut; - while ((mCurrentOut = (OutboundMessage *)mOutgoingMessages.PopFront())) + while ((mCurrentOut = (OutboundMessage*)mOutgoingMessages.PopFront())) delete mCurrentOut; NS_ReleaseOnMainThreadSystemGroup("WebSocketChannel::mURI", mURI.forget()); @@ -1200,13 +1200,13 @@ WebSocketChannel::~WebSocketChannel() { } NS_IMETHODIMP -WebSocketChannel::Observe(nsISupports *subject, const char *topic, - const char16_t *data) { +WebSocketChannel::Observe(nsISupports* subject, const char* topic, + const char16_t* data) { LOG(("WebSocketChannel::Observe [topic=\"%s\"]\n", topic)); if (strcmp(topic, NS_NETWORK_LINK_TOPIC) == 0) { nsCString converted = NS_ConvertUTF16toUTF8(data); - const char *state = converted.get(); + const char* state = converted.get(); if (strcmp(state, NS_NETWORK_LINK_DATA_CHANGED) == 0) { LOG(("WebSocket: received network CHANGED event")); @@ -1298,7 +1298,7 @@ bool WebSocketChannel::IsOnTargetThread() { return NS_FAILED(rv) ? false : isOnTargetThread; } -void WebSocketChannel::GetEffectiveURL(nsAString &aEffectiveURL) const { +void WebSocketChannel::GetEffectiveURL(nsAString& aEffectiveURL) const { aEffectiveURL = mEffectiveURL; } @@ -1377,9 +1377,9 @@ bool WebSocketChannel::IsPersistentFramePtr() { // variable beacuse when transitioning from the stack to the persistent // read buffer we want to explicitly include them in the buffer instead // of as already existing data. -bool WebSocketChannel::UpdateReadBuffer(uint8_t *buffer, uint32_t count, +bool WebSocketChannel::UpdateReadBuffer(uint8_t* buffer, uint32_t count, uint32_t accumulatedFragments, - uint32_t *available) { + uint32_t* available) { LOG(("WebSocketChannel::UpdateReadBuffer() %p [%p %u]\n", this, buffer, count)); @@ -1403,8 +1403,8 @@ bool WebSocketChannel::UpdateReadBuffer(uint8_t *buffer, uint32_t count, // existing buffer is not sufficient, extend it mBufferSize += count + 8192 + mBufferSize / 3; LOG(("WebSocketChannel: update read buffer extended to %u\n", mBufferSize)); - uint8_t *old = mBuffer; - mBuffer = (uint8_t *)realloc(mBuffer, mBufferSize); + uint8_t* old = mBuffer; + mBuffer = (uint8_t*)realloc(mBuffer, mBufferSize); if (!mBuffer) { mBuffer = old; return false; @@ -1420,7 +1420,7 @@ bool WebSocketChannel::UpdateReadBuffer(uint8_t *buffer, uint32_t count, return true; } -nsresult WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count) { +nsresult WebSocketChannel::ProcessInput(uint8_t* buffer, uint32_t count) { LOG(("WebSocketChannel::ProcessInput %p [%d %d]\n", this, count, mBuffered)); MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -1445,7 +1445,7 @@ nsresult WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count) { } } - uint8_t *payload; + uint8_t* payload; uint32_t totalAvail = avail; while (avail >= 2) { @@ -1647,7 +1647,7 @@ nsresult WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count) { "[origLength=%d, newLength=%d]\n", payloadLength, utf8Data.Length())); } else { - if (!utf8Data.Assign((const char *)payload, payloadLength, + if (!utf8Data.Assign((const char*)payload, payloadLength, mozilla::fallible)) { return NS_ERROR_OUT_OF_MEMORY; } @@ -1696,7 +1696,7 @@ nsresult WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count) { uint16_t msglen = static_cast(payloadLength - 2); if (msglen > 0) { mServerCloseReason.SetLength(msglen); - memcpy(mServerCloseReason.BeginWriting(), (const char *)payload + 2, + memcpy(mServerCloseReason.BeginWriting(), (const char*)payload + 2, msglen); // section 8.1 says to replace received non utf-8 sequences @@ -1779,7 +1779,7 @@ nsresult WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count) { "[origLength=%d, newLength=%d]\n", payloadLength, binaryData.Length())); } else { - if (!binaryData.Assign((const char *)payload, payloadLength, + if (!binaryData.Assign((const char*)payload, payloadLength, mozilla::fallible)) { return NS_ERROR_OUT_OF_MEMORY; } @@ -1846,14 +1846,14 @@ nsresult WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count) { if (mBufferSize > kIncomingBufferStableSize) { mBufferSize = kIncomingBufferStableSize; free(mBuffer); - mBuffer = (uint8_t *)moz_xmalloc(mBufferSize); + mBuffer = (uint8_t*)moz_xmalloc(mBufferSize); } } return NS_OK; } /* static */ -void WebSocketChannel::ApplyMask(uint32_t mask, uint8_t *data, uint64_t len) { +void WebSocketChannel::ApplyMask(uint32_t mask, uint8_t* data, uint64_t len) { if (!data || len == 0) return; // Optimally we want to apply the mask 32 bits at a time, @@ -1869,12 +1869,12 @@ void WebSocketChannel::ApplyMask(uint32_t mask, uint8_t *data, uint64_t len) { // perform mask on full words of data - uint32_t *iData = (uint32_t *)data; - uint32_t *end = iData + (len / 4); + uint32_t* iData = (uint32_t*)data; + uint32_t* end = iData + (len / 4); NetworkEndian::writeUint32(&mask, mask); for (; iData < end; iData++) *iData ^= mask; mask = NetworkEndian::readUint32(&mask); - data = (uint8_t *)iData; + data = (uint8_t*)iData; len = len % 4; // There maybe up to 3 trailing bytes that need to be dealt with @@ -1889,14 +1889,14 @@ void WebSocketChannel::ApplyMask(uint32_t mask, uint8_t *data, uint64_t len) { } void WebSocketChannel::GeneratePing() { - nsCString *buf = new nsCString(); + nsCString* buf = new nsCString(); buf->AssignLiteral("PING"); EnqueueOutgoingMessage(mOutgoingPingMessages, new OutboundMessage(kMsgTypePing, buf)); } -void WebSocketChannel::GeneratePong(uint8_t *payload, uint32_t len) { - nsCString *buf = new nsCString(); +void WebSocketChannel::GeneratePong(uint8_t* payload, uint32_t len) { + nsCString* buf = new nsCString(); buf->SetLength(len); if (buf->Length() < len) { LOG(("WebSocketChannel::GeneratePong Allocation Failure\n")); @@ -1909,8 +1909,8 @@ void WebSocketChannel::GeneratePong(uint8_t *payload, uint32_t len) { new OutboundMessage(kMsgTypePong, buf)); } -void WebSocketChannel::EnqueueOutgoingMessage(nsDeque &aQueue, - OutboundMessage *aMsg) { +void WebSocketChannel::EnqueueOutgoingMessage(nsDeque& aQueue, + OutboundMessage* aMsg) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); LOG( @@ -1945,16 +1945,16 @@ void WebSocketChannel::PrimeNewOutgoingMessage() { nsresult rv = NS_OK; - mCurrentOut = (OutboundMessage *)mOutgoingPongMessages.PopFront(); + mCurrentOut = (OutboundMessage*)mOutgoingPongMessages.PopFront(); if (mCurrentOut) { MOZ_ASSERT(mCurrentOut->GetMsgType() == kMsgTypePong, "Not pong message!"); } else { - mCurrentOut = (OutboundMessage *)mOutgoingPingMessages.PopFront(); + mCurrentOut = (OutboundMessage*)mOutgoingPingMessages.PopFront(); if (mCurrentOut) MOZ_ASSERT(mCurrentOut->GetMsgType() == kMsgTypePing, "Not ping message!"); else - mCurrentOut = (OutboundMessage *)mOutgoingMessages.PopFront(); + mCurrentOut = (OutboundMessage*)mOutgoingMessages.PopFront(); } if (!mCurrentOut) return; @@ -1975,7 +1975,7 @@ void WebSocketChannel::PrimeNewOutgoingMessage() { uint8_t maskBit = mIsServerSide ? 0 : kMaskBit; uint8_t maskSize = mIsServerSide ? 0 : 4; - uint8_t *payload = nullptr; + uint8_t* payload = nullptr; if (msgType == kMsgTypeFin) { // This is a demand to create a close message @@ -2106,7 +2106,7 @@ void WebSocketChannel::PrimeNewOutgoingMessage() { if (!mIsServerSide) { // Perform the sending mask. Never use a zero mask do { - uint8_t *buffer; + uint8_t* buffer; static_assert(4 == sizeof(mask), "Size of the mask should be equal to 4"); nsresult rv = mRandomGenerator->GenerateRandomBytes(sizeof(mask), &buffer); @@ -2185,8 +2185,7 @@ void WebSocketChannel::EnsureHdrOut(uint32_t size) { if (mDynamicOutputSize < size) { mDynamicOutputSize = size; - mDynamicOutput = - (uint8_t *)moz_xrealloc(mDynamicOutput, mDynamicOutputSize); + mDynamicOutput = (uint8_t*)moz_xrealloc(mDynamicOutput, mDynamicOutputSize); } mHdrOut = mDynamicOutput; @@ -2198,7 +2197,7 @@ class RemoveObserverRunnable : public Runnable { RefPtr mChannel; public: - explicit RemoveObserverRunnable(WebSocketChannel *aChannel) + explicit RemoveObserverRunnable(WebSocketChannel* aChannel) : Runnable("net::RemoveObserverRunnable"), mChannel(aChannel) {} NS_IMETHOD Run() override { @@ -2448,12 +2447,12 @@ namespace { enum ExtensionParseMode { eParseServerSide, eParseClientSide }; } -static nsresult ParseWebSocketExtension(const nsACString &aExtension, +static nsresult ParseWebSocketExtension(const nsACString& aExtension, ExtensionParseMode aMode, - bool &aClientNoContextTakeover, - bool &aServerNoContextTakeover, - int32_t &aClientMaxWindowBits, - int32_t &aServerMaxWindowBits) { + bool& aClientNoContextTakeover, + bool& aServerNoContextTakeover, + int32_t& aClientMaxWindowBits, + int32_t& aServerMaxWindowBits) { nsCCharSeparatedTokenizer tokens(aExtension, ';'); if (!tokens.hasMoreTokens() || @@ -2644,8 +2643,8 @@ nsresult WebSocketChannel::HandleExtensions() { return NS_OK; } -void ProcessServerWebSocketExtensions(const nsACString &aExtensions, - nsACString &aNegotiatedExtensions) { +void ProcessServerWebSocketExtensions(const nsACString& aExtensions, + nsACString& aNegotiatedExtensions) { aNegotiatedExtensions.Truncate(); nsCOMPtr prefService = @@ -2694,8 +2693,8 @@ void ProcessServerWebSocketExtensions(const nsACString &aExtensions, } } -nsresult CalculateWebSocketHashedSecret(const nsACString &aKey, - nsACString &aHash) { +nsresult CalculateWebSocketHashedSecret(const nsACString& aKey, + nsACString& aHash) { nsresult rv; nsCString key = aKey + NS_LITERAL_CSTRING("258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); @@ -2704,7 +2703,7 @@ nsresult CalculateWebSocketHashedSecret(const nsACString &aKey, NS_ENSURE_SUCCESS(rv, rv); rv = hasher->Init(nsICryptoHash::SHA1); NS_ENSURE_SUCCESS(rv, rv); - rv = hasher->Update((const uint8_t *)key.BeginWriting(), key.Length()); + rv = hasher->Update((const uint8_t*)key.BeginWriting(), key.Length()); NS_ENSURE_SUCCESS(rv, rv); return hasher->Finish(true, aHash); } @@ -2761,12 +2760,12 @@ nsresult WebSocketChannel::SetupRequest() { MOZ_ASSERT(NS_SUCCEEDED(rv)); } - uint8_t *secKey; + uint8_t* secKey; nsAutoCString secKeyString; rv = mRandomGenerator->GenerateRandomBytes(16, &secKey); NS_ENSURE_SUCCESS(rv, rv); - char *b64 = PL_Base64Encode((const char *)secKey, 16, nullptr); + char* b64 = PL_Base64Encode((const char*)secKey, 16, nullptr); free(secKey); if (!b64) return NS_ERROR_OUT_OF_MEMORY; secKeyString.Assign(b64); @@ -2967,8 +2966,8 @@ void WebSocketChannel::ReportConnectionTelemetry(nsresult aStatusCode) { // nsIDNSListener NS_IMETHODIMP -WebSocketChannel::OnLookupComplete(nsICancelable *aRequest, - nsIDNSRecord *aRecord, nsresult aStatus) { +WebSocketChannel::OnLookupComplete(nsICancelable* aRequest, + nsIDNSRecord* aRecord, nsresult aStatus) { LOG(("WebSocketChannel::OnLookupComplete() %p [%p %p %" PRIx32 "]\n", this, aRequest, aRecord, static_cast(aStatus))); @@ -3001,16 +3000,16 @@ WebSocketChannel::OnLookupComplete(nsICancelable *aRequest, } NS_IMETHODIMP -WebSocketChannel::OnLookupByTypeComplete(nsICancelable *aRequest, - nsIDNSByTypeRecord *aRes, +WebSocketChannel::OnLookupByTypeComplete(nsICancelable* aRequest, + nsIDNSByTypeRecord* aRes, nsresult aStatus) { return NS_OK; } // nsIProtocolProxyCallback NS_IMETHODIMP -WebSocketChannel::OnProxyAvailable(nsICancelable *aRequest, - nsIChannel *aChannel, nsIProxyInfo *pi, +WebSocketChannel::OnProxyAvailable(nsICancelable* aRequest, + nsIChannel* aChannel, nsIProxyInfo* pi, nsresult status) { if (mStopped) { LOG(("WebSocketChannel::OnProxyAvailable: [%p] Request Already Stopped\n", @@ -3046,7 +3045,7 @@ WebSocketChannel::OnProxyAvailable(nsICancelable *aRequest, // nsIInterfaceRequestor NS_IMETHODIMP -WebSocketChannel::GetInterface(const nsIID &iid, void **result) { +WebSocketChannel::GetInterface(const nsIID& iid, void** result) { LOG(("WebSocketChannel::GetInterface() %p\n", this)); if (iid.Equals(NS_GET_IID(nsIChannelEventSink))) @@ -3061,8 +3060,8 @@ WebSocketChannel::GetInterface(const nsIID &iid, void **result) { NS_IMETHODIMP WebSocketChannel::AsyncOnChannelRedirect( - nsIChannel *oldChannel, nsIChannel *newChannel, uint32_t flags, - nsIAsyncVerifyRedirectCallback *callback) { + nsIChannel* oldChannel, nsIChannel* newChannel, uint32_t flags, + nsIAsyncVerifyRedirectCallback* callback) { LOG(("WebSocketChannel::AsyncOnChannelRedirect() %p\n", this)); MOZ_ASSERT(NS_IsMainThread(), "not main thread"); @@ -3165,7 +3164,7 @@ WebSocketChannel::AsyncOnChannelRedirect( // nsITimerCallback NS_IMETHODIMP -WebSocketChannel::Notify(nsITimer *timer) { +WebSocketChannel::Notify(nsITimer* timer) { LOG(("WebSocketChannel::Notify() %p [%p]\n", this, timer)); if (timer == mCloseTimer) { @@ -3231,7 +3230,7 @@ WebSocketChannel::Notify(nsITimer *timer) { // nsINamed NS_IMETHODIMP -WebSocketChannel::GetName(nsACString &aName) { +WebSocketChannel::GetName(nsACString& aName) { aName.AssignLiteral("WebSocketChannel"); return NS_OK; } @@ -3239,7 +3238,7 @@ WebSocketChannel::GetName(nsACString &aName) { // nsIWebSocketChannel NS_IMETHODIMP -WebSocketChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { +WebSocketChannel::GetSecurityInfo(nsISupports** aSecurityInfo) { LOG(("WebSocketChannel::GetSecurityInfo() %p\n", this)); MOZ_ASSERT(NS_IsMainThread(), "not main thread"); @@ -3251,10 +3250,10 @@ WebSocketChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { } NS_IMETHODIMP -WebSocketChannel::AsyncOpen(nsIURI *aURI, const nsACString &aOrigin, +WebSocketChannel::AsyncOpen(nsIURI* aURI, const nsACString& aOrigin, uint64_t aInnerWindowID, - nsIWebSocketListener *aListener, - nsISupports *aContext) { + nsIWebSocketListener* aListener, + nsISupports* aContext) { LOG(("WebSocketChannel::AsyncOpen() %p\n", this)); if (!NS_IsMainThread()) { @@ -3407,7 +3406,7 @@ WebSocketChannel::AsyncOpen(nsIURI *aURI, const nsACString &aOrigin, class MOZ_STACK_CLASS CleanUpOnFailure { public: - explicit CleanUpOnFailure(WebSocketChannel *aWebSocketChannel) + explicit CleanUpOnFailure(WebSocketChannel* aWebSocketChannel) : mWebSocketChannel(aWebSocketChannel) {} ~CleanUpOnFailure() { @@ -3417,7 +3416,7 @@ WebSocketChannel::AsyncOpen(nsIURI *aURI, const nsACString &aOrigin, } } - WebSocketChannel *mWebSocketChannel; + WebSocketChannel* mWebSocketChannel; }; CleanUpOnFailure cuof(this); @@ -3464,7 +3463,7 @@ WebSocketChannel::AsyncOpen(nsIURI *aURI, const nsACString &aOrigin, } NS_IMETHODIMP -WebSocketChannel::Close(uint16_t code, const nsACString &reason) { +WebSocketChannel::Close(uint16_t code, const nsACString& reason) { LOG(("WebSocketChannel::Close() %p\n", this)); MOZ_ASSERT(NS_IsMainThread(), "not main thread"); @@ -3510,28 +3509,28 @@ WebSocketChannel::Close(uint16_t code, const nsACString &reason) { } NS_IMETHODIMP -WebSocketChannel::SendMsg(const nsACString &aMsg) { +WebSocketChannel::SendMsg(const nsACString& aMsg) { LOG(("WebSocketChannel::SendMsg() %p\n", this)); return SendMsgCommon(&aMsg, false, aMsg.Length()); } NS_IMETHODIMP -WebSocketChannel::SendBinaryMsg(const nsACString &aMsg) { +WebSocketChannel::SendBinaryMsg(const nsACString& aMsg) { LOG(("WebSocketChannel::SendBinaryMsg() %p len=%d\n", this, aMsg.Length())); return SendMsgCommon(&aMsg, true, aMsg.Length()); } NS_IMETHODIMP -WebSocketChannel::SendBinaryStream(nsIInputStream *aStream, uint32_t aLength) { +WebSocketChannel::SendBinaryStream(nsIInputStream* aStream, uint32_t aLength) { LOG(("WebSocketChannel::SendBinaryStream() %p\n", this)); return SendMsgCommon(nullptr, true, aLength, aStream); } -nsresult WebSocketChannel::SendMsgCommon(const nsACString *aMsg, bool aIsBinary, +nsresult WebSocketChannel::SendMsgCommon(const nsACString* aMsg, bool aIsBinary, uint32_t aLength, - nsIInputStream *aStream) { + nsIInputStream* aStream) { MOZ_ASSERT(IsOnTargetThread(), "not target thread"); if (!mDataStarted) { @@ -3573,9 +3572,9 @@ nsresult WebSocketChannel::SendMsgCommon(const nsACString *aMsg, bool aIsBinary, // nsIHttpUpgradeListener NS_IMETHODIMP -WebSocketChannel::OnTransportAvailable(nsISocketTransport *aTransport, - nsIAsyncInputStream *aSocketIn, - nsIAsyncOutputStream *aSocketOut) { +WebSocketChannel::OnTransportAvailable(nsISocketTransport* aTransport, + nsIAsyncInputStream* aSocketIn, + nsIAsyncOutputStream* aSocketOut) { if (!NS_IsMainThread()) { return NS_DispatchToMainThread( new CallOnTransportAvailable(this, aTransport, aSocketIn, aSocketOut)); @@ -3662,7 +3661,7 @@ WebSocketChannel::OnTransportAvailable(nsISocketTransport *aTransport, // nsIRequestObserver (from nsIStreamListener) NS_IMETHODIMP -WebSocketChannel::OnStartRequest(nsIRequest *aRequest) { +WebSocketChannel::OnStartRequest(nsIRequest* aRequest) { LOG(("WebSocketChannel::OnStartRequest(): %p [%p %p] recvdhttpupgrade=%d\n", this, aRequest, mHttpChannel.get(), mRecvdHttpUpgradeTransport)); MOZ_ASSERT(NS_IsMainThread(), "not main thread"); @@ -3847,7 +3846,7 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest) { } NS_IMETHODIMP -WebSocketChannel::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) { +WebSocketChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) { LOG(("WebSocketChannel::OnStopRequest() %p [%p %p %" PRIx32 "]\n", this, aRequest, mHttpChannel.get(), static_cast(aStatusCode))); MOZ_ASSERT(NS_IsMainThread(), "not main thread"); @@ -3874,7 +3873,7 @@ WebSocketChannel::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) { // nsIInputStreamCallback NS_IMETHODIMP -WebSocketChannel::OnInputStreamReady(nsIAsyncInputStream *aStream) { +WebSocketChannel::OnInputStreamReady(nsIAsyncInputStream* aStream) { LOG(("WebSocketChannel::OnInputStreamReady() %p\n", this)); MOZ_ASSERT(OnSocketThread(), "not on socket thread"); @@ -3887,7 +3886,7 @@ WebSocketChannel::OnInputStreamReady(nsIAsyncInputStream *aStream) { nsresult rv; do { - rv = mSocketIn->Read((char *)buffer, 2048, &count); + rv = mSocketIn->Read((char*)buffer, 2048, &count); LOG(("WebSocketChannel::OnInputStreamReady: read %u rv %" PRIx32 "\n", count, static_cast(rv))); @@ -3910,7 +3909,7 @@ WebSocketChannel::OnInputStreamReady(nsIAsyncInputStream *aStream) { continue; } - rv = ProcessInput((uint8_t *)buffer, count); + rv = ProcessInput((uint8_t*)buffer, count); if (NS_FAILED(rv)) { AbortSession(rv); return rv; @@ -3923,7 +3922,7 @@ WebSocketChannel::OnInputStreamReady(nsIAsyncInputStream *aStream) { // nsIOutputStreamCallback NS_IMETHODIMP -WebSocketChannel::OnOutputStreamReady(nsIAsyncOutputStream *aStream) { +WebSocketChannel::OnOutputStreamReady(nsIAsyncOutputStream* aStream) { LOG(("WebSocketChannel::OnOutputStreamReady() %p\n", this)); MOZ_ASSERT(OnSocketThread(), "not on socket thread"); nsresult rv; @@ -3931,19 +3930,19 @@ WebSocketChannel::OnOutputStreamReady(nsIAsyncOutputStream *aStream) { if (!mCurrentOut) PrimeNewOutgoingMessage(); while (mCurrentOut && mSocketOut) { - const char *sndBuf; + const char* sndBuf; uint32_t toSend; uint32_t amtSent; if (mHdrOut) { - sndBuf = (const char *)mHdrOut; + sndBuf = (const char*)mHdrOut; toSend = mHdrOutToSend; LOG( ("WebSocketChannel::OnOutputStreamReady: " "Try to send %u of hdr/copybreak\n", toSend)); } else { - sndBuf = (char *)mCurrentOut->BeginReading() + mCurrentOutSent; + sndBuf = (char*)mCurrentOut->BeginReading() + mCurrentOutSent; toSend = mCurrentOut->Length() - mCurrentOutSent; if (toSend > 0) { LOG( @@ -4003,8 +4002,8 @@ WebSocketChannel::OnOutputStreamReady(nsIAsyncOutputStream *aStream) { // nsIStreamListener NS_IMETHODIMP -WebSocketChannel::OnDataAvailable(nsIRequest *aRequest, - nsIInputStream *aInputStream, +WebSocketChannel::OnDataAvailable(nsIRequest* aRequest, + nsIInputStream* aInputStream, uint64_t aOffset, uint32_t aCount) { LOG(("WebSocketChannel::OnDataAvailable() %p [%p %p %p %" PRIu64 " %u]\n", this, aRequest, mHttpChannel.get(), aInputStream, aOffset, aCount)); diff --git a/netwerk/protocol/websocket/WebSocketChannel.h b/netwerk/protocol/websocket/WebSocketChannel.h index 1524d24985d5f..165c90370a04e 100644 --- a/netwerk/protocol/websocket/WebSocketChannel.h +++ b/netwerk/protocol/websocket/WebSocketChannel.h @@ -49,9 +49,9 @@ class CallAcknowledge; class WebSocketEventService; extern MOZ_MUST_USE nsresult -CalculateWebSocketHashedSecret(const nsACString &aKey, nsACString &aHash); -extern void ProcessServerWebSocketExtensions(const nsACString &aExtensions, - nsACString &aNegotiatedExtensions); +CalculateWebSocketHashedSecret(const nsACString& aKey, nsACString& aHash); +extern void ProcessServerWebSocketExtensions(const nsACString& aExtensions, + nsACString& aNegotiatedExtensions); // Used to enforce "1 connecting websocket per host" rule, and reconnect delays enum wsConnectingState { @@ -92,22 +92,22 @@ class WebSocketChannel : public BaseWebSocketChannel, // nsIWebSocketChannel methods BaseWebSocketChannel didn't implement for us // - NS_IMETHOD AsyncOpen(nsIURI *aURI, const nsACString &aOrigin, - uint64_t aWindowID, nsIWebSocketListener *aListener, - nsISupports *aContext) override; - NS_IMETHOD Close(uint16_t aCode, const nsACString &aReason) override; - NS_IMETHOD SendMsg(const nsACString &aMsg) override; - NS_IMETHOD SendBinaryMsg(const nsACString &aMsg) override; - NS_IMETHOD SendBinaryStream(nsIInputStream *aStream, + NS_IMETHOD AsyncOpen(nsIURI* aURI, const nsACString& aOrigin, + uint64_t aWindowID, nsIWebSocketListener* aListener, + nsISupports* aContext) override; + NS_IMETHOD Close(uint16_t aCode, const nsACString& aReason) override; + NS_IMETHOD SendMsg(const nsACString& aMsg) override; + NS_IMETHOD SendBinaryMsg(const nsACString& aMsg) override; + NS_IMETHOD SendBinaryStream(nsIInputStream* aStream, uint32_t length) override; - NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo) override; + NS_IMETHOD GetSecurityInfo(nsISupports** aSecurityInfo) override; WebSocketChannel(); static void Shutdown(); bool IsOnTargetThread(); // Off main thread URI access. - void GetEffectiveURL(nsAString &aEffectiveURL) const override; + void GetEffectiveURL(nsAString& aEffectiveURL) const override; bool IsEncrypted() const override; const static uint32_t kControlFrameMask = 0x8; @@ -137,15 +137,15 @@ class WebSocketChannel : public BaseWebSocketChannel, friend class CallAcknowledge; // Common send code for binary + text msgs - MOZ_MUST_USE nsresult SendMsgCommon(const nsACString *aMsg, bool isBinary, + MOZ_MUST_USE nsresult SendMsgCommon(const nsACString* aMsg, bool isBinary, uint32_t length, - nsIInputStream *aStream = nullptr); + nsIInputStream* aStream = nullptr); - void EnqueueOutgoingMessage(nsDeque &aQueue, OutboundMessage *aMsg); + void EnqueueOutgoingMessage(nsDeque& aQueue, OutboundMessage* aMsg); void PrimeNewOutgoingMessage(); void DeleteCurrentOutGoingMessage(); - void GeneratePong(uint8_t *payload, uint32_t len); + void GeneratePong(uint8_t* payload, uint32_t len); void GeneratePing(); MOZ_MUST_USE nsresult OnNetworkChanged(); @@ -172,13 +172,13 @@ class WebSocketChannel : public BaseWebSocketChannel, void EnsureHdrOut(uint32_t size); - static void ApplyMask(uint32_t mask, uint8_t *data, uint64_t len); + static void ApplyMask(uint32_t mask, uint8_t* data, uint64_t len); bool IsPersistentFramePtr(); - MOZ_MUST_USE nsresult ProcessInput(uint8_t *buffer, uint32_t count); - MOZ_MUST_USE bool UpdateReadBuffer(uint8_t *buffer, uint32_t count, + MOZ_MUST_USE nsresult ProcessInput(uint8_t* buffer, uint32_t count); + MOZ_MUST_USE bool UpdateReadBuffer(uint8_t* buffer, uint32_t count, uint32_t accumulatedFragments, - uint32_t *available); + uint32_t* available); inline void ResetPingTimer() { mPingOutstanding = 0; @@ -273,8 +273,8 @@ class WebSocketChannel : public BaseWebSocketChannel, // increase the buffer temporarily, then drop back down to this size. const static uint32_t kIncomingBufferStableSize = 128 * 1024; - uint8_t *mFramePtr; - uint8_t *mBuffer; + uint8_t* mFramePtr; + uint8_t* mBuffer; uint8_t mFragmentOpcode; uint32_t mFragmentAccumulator; uint32_t mBuffered; @@ -283,17 +283,17 @@ class WebSocketChannel : public BaseWebSocketChannel, // These are for the send buffers const static int32_t kCopyBreak = 1000; - OutboundMessage *mCurrentOut; + OutboundMessage* mCurrentOut; uint32_t mCurrentOutSent; nsDeque mOutgoingMessages; nsDeque mOutgoingPingMessages; nsDeque mOutgoingPongMessages; uint32_t mHdrOutToSend; - uint8_t *mHdrOut; + uint8_t* mHdrOut; uint8_t mOutHeader[kCopyBreak + 16]; nsAutoPtr mPMCECompressor; uint32_t mDynamicOutputSize; - uint8_t *mDynamicOutput; + uint8_t* mDynamicOutput; bool mPrivateBrowsing; nsCOMPtr mConnectionLogService; diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index caed7394eb472..3b507722a5ee6 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -83,13 +83,13 @@ static LazyLogModule gSCTPLog("SCTP"); class DataChannelConnectionShutdown : public nsITimerCallback { public: - explicit DataChannelConnectionShutdown(DataChannelConnection *aConnection) + explicit DataChannelConnectionShutdown(DataChannelConnection* aConnection) : mConnection(aConnection) { mTimer = NS_NewTimer(); // we'll crash if this fails mTimer->InitWithCallback(this, 30 * 1000, nsITimer::TYPE_ONE_SHOT); } - NS_IMETHODIMP Notify(nsITimer *aTimer) override; + NS_IMETHODIMP Notify(nsITimer* aTimer) override; NS_DECL_THREADSAFE_ISUPPORTS @@ -128,8 +128,8 @@ class DataChannelShutdown : public nsIObserver { (void)rv; } - NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) override { + NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) override { // Note: MainThread if (strcmp(aTopic, "xpcom-will-shutdown") == 0) { LOG(("Shutting down SCTP")); @@ -155,7 +155,7 @@ class DataChannelShutdown : public nsIObserver { return NS_OK; } - void CreateConnectionShutdown(DataChannelConnection *aConnection) { + void CreateConnectionShutdown(DataChannelConnection* aConnection) { StaticMutexAutoLock lock(sLock); if (!sConnections) { sConnections = new nsTArray>(); @@ -164,7 +164,7 @@ class DataChannelShutdown : public nsIObserver { } void RemoveConnectionShutdown( - DataChannelConnectionShutdown *aConnectionShutdown) { + DataChannelConnectionShutdown* aConnectionShutdown) { StaticMutexAutoLock lock(sLock); if (sConnections) { sConnections->RemoveElement(aConnectionShutdown); @@ -191,7 +191,7 @@ NS_IMPL_ISUPPORTS(DataChannelShutdown, nsIObserver); NS_IMPL_ISUPPORTS(DataChannelConnectionShutdown, nsITimerCallback) NS_IMETHODIMP -DataChannelConnectionShutdown::Notify(nsITimer *aTimer) { +DataChannelConnectionShutdown::Notify(nsITimer* aTimer) { // safely release reference to ourself RefPtr grip(this); // Might not be set. We don't actually use the |this| pointer in @@ -203,7 +203,7 @@ DataChannelConnectionShutdown::Notify(nsITimer *aTimer) { return NS_OK; } -OutgoingMsg::OutgoingMsg(struct sctp_sendv_spa &info, const uint8_t *data, +OutgoingMsg::OutgoingMsg(struct sctp_sendv_spa& info, const uint8_t* data, size_t length) : mLength(length), mData(data) { mInfo = &info; @@ -217,9 +217,9 @@ void OutgoingMsg::Advance(size_t offset) { } } -BufferedOutgoingMsg::BufferedOutgoingMsg(OutgoingMsg &msg) { +BufferedOutgoingMsg::BufferedOutgoingMsg(OutgoingMsg& msg) { size_t length = msg.GetLeft(); - auto *tmp = new uint8_t[length]; // infallible malloc! + auto* tmp = new uint8_t[length]; // infallible malloc! memcpy(tmp, msg.GetData(), length); mLength = length; mData = tmp; @@ -233,16 +233,16 @@ BufferedOutgoingMsg::~BufferedOutgoingMsg() { delete mData; } -static int receive_cb(struct socket *sock, union sctp_sockstore addr, - void *data, size_t datalen, struct sctp_rcvinfo rcv, - int flags, void *ulp_info) { - DataChannelConnection *connection = - static_cast(ulp_info); +static int receive_cb(struct socket* sock, union sctp_sockstore addr, + void* data, size_t datalen, struct sctp_rcvinfo rcv, + int flags, void* ulp_info) { + DataChannelConnection* connection = + static_cast(ulp_info); return connection->ReceiveCallback(sock, data, datalen, rcv, flags); } -static DataChannelConnection *GetConnectionFromSocket(struct socket *sock) { - struct sockaddr *addrs = nullptr; +static DataChannelConnection* GetConnectionFromSocket(struct socket* sock) { + struct sockaddr* addrs = nullptr; int naddrs = usrsctp_getladdrs(sock, 0, &addrs); if (naddrs <= 0 || addrs[0].sa_family != AF_CONN) { return nullptr; @@ -252,18 +252,18 @@ static DataChannelConnection *GetConnectionFromSocket(struct socket *sock) { // then free the list of addresses once we have the pointer. We only open // AF_CONN sockets, and they should all have the sconn_addr set to the // pointer that created them, so [0] is as good as any other. - struct sockaddr_conn *sconn = - reinterpret_cast(&addrs[0]); - DataChannelConnection *connection = - reinterpret_cast(sconn->sconn_addr); + struct sockaddr_conn* sconn = + reinterpret_cast(&addrs[0]); + DataChannelConnection* connection = + reinterpret_cast(sconn->sconn_addr); usrsctp_freeladdrs(addrs); return connection; } // called when the buffer empties to the threshold value -static int threshold_event(struct socket *sock, uint32_t sb_free) { - DataChannelConnection *connection = GetConnectionFromSocket(sock); +static int threshold_event(struct socket* sock, uint32_t sb_free) { + DataChannelConnection* connection = GetConnectionFromSocket(sock); if (connection) { connection->SendDeferredMessages(); } else { @@ -272,7 +272,7 @@ static int threshold_event(struct socket *sock, uint32_t sb_free) { return 0; } -static void debug_printf(const char *format, ...) { +static void debug_printf(const char* format, ...) { va_list ap; char buffer[1024]; @@ -289,9 +289,9 @@ static void debug_printf(const char *format, ...) { } } -DataChannelConnection::DataChannelConnection(DataConnectionListener *listener, - nsIEventTarget *aTarget, - MediaTransportHandler *aHandler) +DataChannelConnection::DataChannelConnection(DataConnectionListener* listener, + nsIEventTarget* aTarget, + MediaTransportHandler* aHandler) : NeckoTargetHolder(aTarget), mLock("netwerk::sctp::DataChannelConnection"), mSendInterleaved(false), @@ -317,7 +317,7 @@ DataChannelConnection::DataChannelConnection(DataConnectionListener *listener, } DataChannelConnection::~DataChannelConnection() { - LOG(("Deleting DataChannelConnection %p", (void *)this)); + LOG(("Deleting DataChannelConnection %p", (void*)this)); // This may die on the MainThread, or on the STS thread ASSERT_WEBRTC(mState == CLOSED); MOZ_ASSERT(!mMasterSocket); @@ -346,7 +346,7 @@ void DataChannelConnection::Destroy() { // if we really want it to do true clean shutdowns it can // create a dependant Internal object that would remain around // until the network shut down the association or timed out. - LOG(("Destroying DataChannelConnection %p", (void *)this)); + LOG(("Destroying DataChannelConnection %p", (void*)this)); ASSERT_WEBRTC(NS_IsMainThread()); CloseAll(); @@ -377,13 +377,13 @@ void DataChannelConnection::Destroy() { // nsDOMDataChannel objects have refs to DataChannels that have refs to us } -void DataChannelConnection::DestroyOnSTS(struct socket *aMasterSocket, - struct socket *aSocket) { +void DataChannelConnection::DestroyOnSTS(struct socket* aMasterSocket, + struct socket* aSocket) { if (aSocket && aSocket != aMasterSocket) usrsctp_close(aSocket); if (aMasterSocket) usrsctp_close(aMasterSocket); - usrsctp_deregister_address(static_cast(this)); - LOG(("Deregistered %p from the SCTP stack.", static_cast(this))); + usrsctp_deregister_address(static_cast(this)); + LOG(("Deregistered %p from the SCTP stack.", static_cast(this))); #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED mShutdown = true; #endif @@ -475,12 +475,12 @@ bool DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, int buf_size = 1024 * 1024; if (usrsctp_setsockopt(mMasterSocket, SOL_SOCKET, SO_RCVBUF, - (const void *)&buf_size, sizeof(buf_size)) < 0) { + (const void*)&buf_size, sizeof(buf_size)) < 0) { LOG(("Couldn't change receive buffer size on SCTP socket")); goto error_cleanup; } if (usrsctp_setsockopt(mMasterSocket, SOL_SOCKET, SO_SNDBUF, - (const void *)&buf_size, sizeof(buf_size)) < 0) { + (const void*)&buf_size, sizeof(buf_size)) < 0) { LOG(("Couldn't change send buffer size on SCTP socket")); goto error_cleanup; } @@ -500,7 +500,7 @@ bool DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, struct linger l; l.l_onoff = 1; l.l_linger = 0; - if (usrsctp_setsockopt(mMasterSocket, SOL_SOCKET, SO_LINGER, (const void *)&l, + if (usrsctp_setsockopt(mMasterSocket, SOL_SOCKET, SO_LINGER, (const void*)&l, (socklen_t)sizeof(struct linger)) < 0) { LOG(("Couldn't set SO_LINGER on SCTP socket")); // unsafe to allow it to continue if this fails @@ -513,12 +513,12 @@ bool DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, { const int option_value = 1; if (usrsctp_setsockopt(mMasterSocket, IPPROTO_SCTP, SCTP_REUSE_PORT, - (const void *)&option_value, + (const void*)&option_value, (socklen_t)sizeof(option_value)) < 0) { LOG(("Couldn't set SCTP_REUSE_PORT on SCTP socket")); } if (usrsctp_setsockopt(mMasterSocket, IPPROTO_SCTP, SCTP_NODELAY, - (const void *)&option_value, + (const void*)&option_value, (socklen_t)sizeof(option_value)) < 0) { LOG(("Couldn't set SCTP_NODELAY on SCTP socket")); } @@ -528,7 +528,7 @@ bool DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, { const int option_value = 1; if (usrsctp_setsockopt(mMasterSocket, IPPROTO_SCTP, SCTP_EXPLICIT_EOR, - (const void *)&option_value, + (const void*)&option_value, (socklen_t)sizeof(option_value)) < 0) { LOG(("*** failed enable explicit EOR mode %d", errno)); goto error_cleanup; @@ -591,8 +591,8 @@ bool DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, } mSocket = nullptr; - usrsctp_register_address(static_cast(this)); - LOG(("Registered %p within the SCTP stack.", static_cast(this))); + usrsctp_register_address(static_cast(this)); + LOG(("Registered %p within the SCTP stack.", static_cast(this))); return true; error_cleanup: @@ -667,7 +667,7 @@ uint64_t DataChannelConnection::GetMaxMessageSize() { return mMaxMessageSize; } #ifdef MOZ_PEERCONNECTION -bool DataChannelConnection::ConnectToTransport(const std::string &aTransportId, +bool DataChannelConnection::ConnectToTransport(const std::string& aTransportId, bool aClient, uint16_t localport, uint16_t remoteport) { LOG(("Connect DTLS local %u, remote %u", localport, remoteport)); @@ -690,7 +690,7 @@ bool DataChannelConnection::ConnectToTransport(const std::string &aTransportId, return true; } -void DataChannelConnection::SetSignals(const std::string &aTransportId, +void DataChannelConnection::SetSignals(const std::string& aTransportId, bool aClient) { ASSERT_WEBRTC(IsSTSThread()); mTransportId = aTransportId; @@ -710,7 +710,7 @@ void DataChannelConnection::SetSignals(const std::string &aTransportId, } void DataChannelConnection::TransportStateChange( - const std::string &aTransportId, TransportLayer::State aState) { + const std::string& aTransportId, TransportLayer::State aState) { if (aState == TransportLayer::TS_OPEN) { CompleteConnect(); } @@ -731,20 +731,19 @@ void DataChannelConnection::CompleteConnect() { addr.sconn_len = sizeof(addr); # endif addr.sconn_port = htons(mLocalPort); - addr.sconn_addr = static_cast(this); + addr.sconn_addr = static_cast(this); LOG(("Calling usrsctp_bind")); - int r = usrsctp_bind( - mMasterSocket, reinterpret_cast(&addr), sizeof(addr)); + int r = usrsctp_bind(mMasterSocket, reinterpret_cast(&addr), + sizeof(addr)); if (r < 0) { LOG(("usrsctp_bind failed: %d", r)); } else { // This is the remote addr addr.sconn_port = htons(mRemotePort); LOG(("Calling usrsctp_connect")); - r = usrsctp_connect(mMasterSocket, - reinterpret_cast(&addr), - sizeof(addr)); + r = usrsctp_connect( + mMasterSocket, reinterpret_cast(&addr), sizeof(addr)); if (r >= 0 || errno == EINPROGRESS) { struct sctp_paddrparams paddrparams; socklen_t opt_len; @@ -799,17 +798,17 @@ void DataChannelConnection::ProcessQueuedOpens() { // Can't copy nsDeque's. Move into temp array since any that fail will // go back to mPending nsDeque temp; - DataChannel *temp_channel; // really already_AddRefed<> + DataChannel* temp_channel; // really already_AddRefed<> while (nullptr != - (temp_channel = static_cast(mPending.PopFront()))) { - temp.Push(static_cast(temp_channel)); + (temp_channel = static_cast(mPending.PopFront()))) { + temp.Push(static_cast(temp_channel)); } RefPtr channel; // All these entries have an AddRef(); make that explicit now via the // dont_AddRef() while (nullptr != - (channel = dont_AddRef(static_cast(temp.PopFront())))) { + (channel = dont_AddRef(static_cast(temp.PopFront())))) { if (channel->mFlags & DATA_CHANNEL_FLAGS_FINISH_OPEN) { LOG(("Processing queued open for %p (%u)", channel.get(), channel->mStream)); @@ -825,16 +824,16 @@ void DataChannelConnection::ProcessQueuedOpens() { } } -void DataChannelConnection::SctpDtlsInput(const std::string &aTransportId, - MediaPacket &packet) { +void DataChannelConnection::SctpDtlsInput(const std::string& aTransportId, + MediaPacket& packet) { if ((packet.type() != MediaPacket::SCTP) || (mTransportId != aTransportId)) { return; } if (MOZ_LOG_TEST(gSCTPLog, LogLevel::Debug)) { - char *buf; + char* buf; - if ((buf = usrsctp_dumppacket((void *)packet.data(), packet.len(), + if ((buf = usrsctp_dumppacket((void*)packet.data(), packet.len(), SCTP_DUMP_INBOUND)) != nullptr) { SCTP_LOG(("%s", buf)); usrsctp_freedumpbuffer(buf); @@ -842,7 +841,7 @@ void DataChannelConnection::SctpDtlsInput(const std::string &aTransportId, } // Pass the data to SCTP MutexAutoLock lock(mLock); - usrsctp_conninput(static_cast(this), packet.data(), packet.len(), 0); + usrsctp_conninput(static_cast(this), packet.data(), packet.len(), 0); } void DataChannelConnection::SendPacket(nsAutoPtr packet) { @@ -853,14 +852,14 @@ void DataChannelConnection::SendPacket(nsAutoPtr packet) { } /* static */ -int DataChannelConnection::SctpDtlsOutput(void *addr, void *buffer, +int DataChannelConnection::SctpDtlsOutput(void* addr, void* buffer, size_t length, uint8_t tos, uint8_t set_df) { - DataChannelConnection *peer = static_cast(addr); + DataChannelConnection* peer = static_cast(addr); MOZ_DIAGNOSTIC_ASSERT(!peer->mShutdown); if (MOZ_LOG_TEST(gSCTPLog, LogLevel::Debug)) { - char *buf; + char* buf; if ((buf = usrsctp_dumppacket(buffer, length, SCTP_DUMP_OUTBOUND)) != nullptr) { @@ -876,7 +875,7 @@ int DataChannelConnection::SctpDtlsOutput(void *addr, void *buffer, // the underlying SCTP stack this might remove the need to use an async proxy. nsAutoPtr packet(new MediaPacket); packet->SetType(MediaPacket::SCTP); - packet->Copy(static_cast(buffer), length); + packet->Copy(static_cast(buffer), length); // XXX It might be worthwhile to add an assertion against the thread // somehow getting into the DataChannel/SCTP code again, as @@ -901,7 +900,7 @@ bool DataChannelConnection::Listen(unsigned short port) { "Blocks, do not call from main thread!!!"); /* Acting as the 'server' */ - memset((void *)&addr, 0, sizeof(addr)); + memset((void*)&addr, 0, sizeof(addr)); # ifdef HAVE_SIN_LEN addr.sin_len = sizeof(struct sockaddr_in); # endif @@ -910,7 +909,7 @@ bool DataChannelConnection::Listen(unsigned short port) { addr.sin_addr.s_addr = htonl(INADDR_ANY); LOG(("Waiting for connections on port %u", ntohs(addr.sin_port))); mState = CONNECTING; - if (usrsctp_bind(mMasterSocket, reinterpret_cast(&addr), + if (usrsctp_bind(mMasterSocket, reinterpret_cast(&addr), sizeof(struct sockaddr_in)) < 0) { LOG(("***Failed userspace_bind")); return false; @@ -932,7 +931,7 @@ bool DataChannelConnection::Listen(unsigned short port) { struct linger l; l.l_onoff = 1; l.l_linger = 0; - if (usrsctp_setsockopt(mSocket, SOL_SOCKET, SO_LINGER, (const void *)&l, + if (usrsctp_setsockopt(mSocket, SOL_SOCKET, SO_LINGER, (const void*)&l, (socklen_t)sizeof(struct linger)) < 0) { LOG(("Couldn't set SO_LINGER on SCTP socket")); } @@ -943,12 +942,12 @@ bool DataChannelConnection::Listen(unsigned short port) { LOG(("%s: sending ON_CONNECTION for %p", __FUNCTION__, this)); Dispatch(do_AddRef(new DataChannelOnMessageAvailable( DataChannelOnMessageAvailable::ON_CONNECTION, this, - (DataChannel *)nullptr))); + (DataChannel*)nullptr))); return true; } // Blocks! - Don't call this from main thread! -bool DataChannelConnection::Connect(const char *addr, unsigned short port) { +bool DataChannelConnection::Connect(const char* addr, unsigned short port) { struct sockaddr_in addr4; struct sockaddr_in6 addr6; @@ -957,8 +956,8 @@ bool DataChannelConnection::Connect(const char *addr, unsigned short port) { /* Acting as the connector */ LOG(("Connecting to %s, port %u", addr, port)); - memset((void *)&addr4, 0, sizeof(struct sockaddr_in)); - memset((void *)&addr6, 0, sizeof(struct sockaddr_in6)); + memset((void*)&addr4, 0, sizeof(struct sockaddr_in)); + memset((void*)&addr6, 0, sizeof(struct sockaddr_in6)); # ifdef HAVE_SIN_LEN addr4.sin_len = sizeof(struct sockaddr_in); # endif @@ -974,14 +973,14 @@ bool DataChannelConnection::Connect(const char *addr, unsigned short port) { # if !defined(__Userspace_os_Windows) if (inet_pton(AF_INET6, addr, &addr6.sin6_addr) == 1) { if (usrsctp_connect(mMasterSocket, - reinterpret_cast(&addr6), + reinterpret_cast(&addr6), sizeof(struct sockaddr_in6)) < 0) { LOG(("*** Failed userspace_connect")); return false; } } else if (inet_pton(AF_INET, addr, &addr4.sin_addr) == 1) { if (usrsctp_connect(mMasterSocket, - reinterpret_cast(&addr4), + reinterpret_cast(&addr4), sizeof(struct sockaddr_in)) < 0) { LOG(("*** Failed userspace_connect")); return false; @@ -994,21 +993,21 @@ bool DataChannelConnection::Connect(const char *addr, unsigned short port) { struct sockaddr_storage ss; int sslen = sizeof(ss); - if (!WSAStringToAddressA(const_cast(addr), AF_INET6, nullptr, - (struct sockaddr *)&ss, &sslen)) { + if (!WSAStringToAddressA(const_cast(addr), AF_INET6, nullptr, + (struct sockaddr*)&ss, &sslen)) { addr6.sin6_addr = - (reinterpret_cast(&ss))->sin6_addr; + (reinterpret_cast(&ss))->sin6_addr; if (usrsctp_connect(mMasterSocket, - reinterpret_cast(&addr6), + reinterpret_cast(&addr6), sizeof(struct sockaddr_in6)) < 0) { LOG(("*** Failed userspace_connect")); return false; } - } else if (!WSAStringToAddressA(const_cast(addr), AF_INET, nullptr, - (struct sockaddr *)&ss, &sslen)) { - addr4.sin_addr = (reinterpret_cast(&ss))->sin_addr; + } else if (!WSAStringToAddressA(const_cast(addr), AF_INET, nullptr, + (struct sockaddr*)&ss, &sslen)) { + addr4.sin_addr = (reinterpret_cast(&ss))->sin_addr; if (usrsctp_connect(mMasterSocket, - reinterpret_cast(&addr4), + reinterpret_cast(&addr4), sizeof(struct sockaddr_in)) < 0) { LOG(("*** Failed userspace_connect")); return false; @@ -1030,12 +1029,12 @@ bool DataChannelConnection::Connect(const char *addr, unsigned short port) { LOG(("%s: sending ON_CONNECTION for %p", __FUNCTION__, this)); Dispatch(do_AddRef(new DataChannelOnMessageAvailable( DataChannelOnMessageAvailable::ON_CONNECTION, this, - (DataChannel *)nullptr))); + (DataChannel*)nullptr))); return true; } #endif -DataChannel *DataChannelConnection::FindChannelByStream(uint16_t stream) { +DataChannel* DataChannelConnection::FindChannelByStream(uint16_t stream) { return mStreams.SafeElementAt(stream); } @@ -1125,7 +1124,7 @@ bool DataChannelConnection::RequestMoreStreams(int32_t aNeeded) { } // Returns a POSIX error code. -int DataChannelConnection::SendControlMessage(const uint8_t *data, uint32_t len, +int DataChannelConnection::SendControlMessage(const uint8_t* data, uint32_t len, uint16_t stream) { struct sctp_sendv_spa info = {0}; @@ -1162,20 +1161,20 @@ int DataChannelConnection::SendOpenAckMessage(uint16_t stream) { memset(&ack, 0, sizeof(struct rtcweb_datachannel_ack)); ack.msg_type = DATA_CHANNEL_ACK; - return SendControlMessage((const uint8_t *)&ack, sizeof(ack), stream); + return SendControlMessage((const uint8_t*)&ack, sizeof(ack), stream); } // Returns a POSIX error code. int DataChannelConnection::SendOpenRequestMessage( - const nsACString &label, const nsACString &protocol, uint16_t stream, + const nsACString& label, const nsACString& protocol, uint16_t stream, bool unordered, uint16_t prPolicy, uint32_t prValue) { const int label_len = label.Length(); // not including nul const int proto_len = protocol.Length(); // not including nul // careful - request struct include one char for the label const int req_size = sizeof(struct rtcweb_datachannel_open_request) - 1 + label_len + proto_len; - struct rtcweb_datachannel_open_request *req = - (struct rtcweb_datachannel_open_request *)moz_xmalloc(req_size); + struct rtcweb_datachannel_open_request* req = + (struct rtcweb_datachannel_open_request*)moz_xmalloc(req_size); memset(req, 0, req_size); req->msg_type = DATA_CHANNEL_OPEN_REQUEST; @@ -1207,7 +1206,7 @@ int DataChannelConnection::SendOpenRequestMessage( memcpy(&req->label[label_len], PromiseFlatCString(protocol).get(), proto_len); // TODO: req_size is an int... that looks hairy - int error = SendControlMessage((const uint8_t *)req, req_size, stream); + int error = SendControlMessage((const uint8_t*)req, req_size, stream); free(req); return error; @@ -1315,7 +1314,7 @@ bool DataChannelConnection::SendDeferredMessages() { // buffer MUST have at least one item! // returns if we're still blocked (true) bool DataChannelConnection::SendBufferedMessages( - nsTArray> &buffer) { + nsTArray>& buffer) { do { // Re-send message int error = SendMsgInternal(*buffer[0]); @@ -1340,7 +1339,7 @@ bool DataChannelConnection::SendBufferedMessages( // Caller must ensure that length <= SIZE_MAX void DataChannelConnection::HandleOpenRequestMessage( - const struct rtcweb_datachannel_open_request *req, uint32_t length, + const struct rtcweb_datachannel_open_request* req, uint32_t length, uint16_t stream) { RefPtr channel; uint32_t prValue; @@ -1471,9 +1470,9 @@ void DataChannelConnection::DeliverQueuedData(uint16_t stream) { // Caller must ensure that length <= SIZE_MAX void DataChannelConnection::HandleOpenAckMessage( - const struct rtcweb_datachannel_ack *ack, uint32_t length, + const struct rtcweb_datachannel_ack* ack, uint32_t length, uint16_t stream) { - DataChannel *channel; + DataChannel* channel; mLock.AssertCurrentThreadOwns(); @@ -1497,10 +1496,10 @@ void DataChannelConnection::HandleUnknownMessage(uint32_t ppid, uint32_t length, // XXX Log to JS error console if possible } -uint8_t DataChannelConnection::BufferMessage(nsACString &recvBuffer, - const void *data, uint32_t length, +uint8_t DataChannelConnection::BufferMessage(nsACString& recvBuffer, + const void* data, uint32_t length, uint32_t ppid, int flags) { - const char *buffer = (const char *)data; + const char* buffer = (const char*)data; uint8_t bufferFlags = 0; if ((flags & MSG_EOR) && ppid != DATA_CHANNEL_PPID_BINARY_PARTIAL && @@ -1528,11 +1527,11 @@ uint8_t DataChannelConnection::BufferMessage(nsACString &recvBuffer, return bufferFlags; } -void DataChannelConnection::HandleDataMessage(const void *data, size_t length, +void DataChannelConnection::HandleDataMessage(const void* data, size_t length, uint32_t ppid, uint16_t stream, int flags) { - DataChannel *channel; - const char *buffer = (const char *)data; + DataChannel* channel; + const char* buffer = (const char*)data; mLock.AssertCurrentThreadOwns(); channel = FindChannelByStream(stream); @@ -1578,7 +1577,7 @@ void DataChannelConnection::HandleDataMessage(const void *data, size_t length, bool is_binary = true; uint8_t bufferFlags; int32_t type; - const char *info = ""; + const char* info = ""; if (ppid == DATA_CHANNEL_PPID_DOMSTRING_PARTIAL || ppid == DATA_CHANNEL_PPID_DOMSTRING) { @@ -1683,11 +1682,11 @@ void DataChannelConnection::HandleDataMessage(const void *data, size_t length, } } -void DataChannelConnection::HandleDCEPMessage(const void *buffer, size_t length, +void DataChannelConnection::HandleDCEPMessage(const void* buffer, size_t length, uint32_t ppid, uint16_t stream, int flags) { - const struct rtcweb_datachannel_open_request *req; - const struct rtcweb_datachannel_ack *ack; + const struct rtcweb_datachannel_open_request* req; + const struct rtcweb_datachannel_ack* ack; // Note: Until we support SIZE_MAX sized messages, we need this check #if (SIZE_MAX > UINT32_MAX) @@ -1718,11 +1717,11 @@ void DataChannelConnection::HandleDCEPMessage(const void *buffer, size_t length, return; } if (bufferFlags & DATA_CHANNEL_BUFFER_MESSAGE_FLAGS_BUFFERED) { - buffer = reinterpret_cast(mRecvBuffer.BeginReading()); + buffer = reinterpret_cast(mRecvBuffer.BeginReading()); data_length = mRecvBuffer.Length(); } - req = static_cast(buffer); + req = static_cast(buffer); LOG(("Handling DCEP message of length %u", data_length)); // Ensure minimum message size (ack is the smallest DCEP message) @@ -1744,7 +1743,7 @@ void DataChannelConnection::HandleDCEPMessage(const void *buffer, size_t length, case DATA_CHANNEL_ACK: // >= sizeof(*ack) checked above - ack = static_cast(buffer); + ack = static_cast(buffer); HandleOpenAckMessage(ack, data_length, stream); break; default: @@ -1757,7 +1756,7 @@ void DataChannelConnection::HandleDCEPMessage(const void *buffer, size_t length, } // Called with mLock locked! -void DataChannelConnection::HandleMessage(const void *buffer, size_t length, +void DataChannelConnection::HandleMessage(const void* buffer, size_t length, uint32_t ppid, uint16_t stream, int flags) { mLock.AssertCurrentThreadOwns(); @@ -1780,7 +1779,7 @@ void DataChannelConnection::HandleMessage(const void *buffer, size_t length, } void DataChannelConnection::HandleAssociationChangeEvent( - const struct sctp_assoc_change *sac) { + const struct sctp_assoc_change* sac) { uint32_t i, n; switch (sac->sac_state) { @@ -1890,24 +1889,24 @@ void DataChannelConnection::HandleAssociationChangeEvent( } void DataChannelConnection::HandlePeerAddressChangeEvent( - const struct sctp_paddr_change *spc) { - const char *addr = ""; + const struct sctp_paddr_change* spc) { + const char* addr = ""; #if !defined(__Userspace_os_Windows) char addr_buf[INET6_ADDRSTRLEN]; - struct sockaddr_in *sin; - struct sockaddr_in6 *sin6; + struct sockaddr_in* sin; + struct sockaddr_in6* sin6; #endif switch (spc->spc_aaddr.ss_family) { case AF_INET: #if !defined(__Userspace_os_Windows) - sin = (struct sockaddr_in *)&spc->spc_aaddr; + sin = (struct sockaddr_in*)&spc->spc_aaddr; addr = inet_ntop(AF_INET, &sin->sin_addr, addr_buf, INET6_ADDRSTRLEN); #endif break; case AF_INET6: #if !defined(__Userspace_os_Windows) - sin6 = (struct sockaddr_in6 *)&spc->spc_aaddr; + sin6 = (struct sockaddr_in6*)&spc->spc_aaddr; addr = inet_ntop(AF_INET6, &sin6->sin6_addr, addr_buf, INET6_ADDRSTRLEN); #endif break; @@ -1945,7 +1944,7 @@ void DataChannelConnection::HandlePeerAddressChangeEvent( } void DataChannelConnection::HandleRemoteErrorEvent( - const struct sctp_remote_error *sre) { + const struct sctp_remote_error* sre) { size_t i, n; n = sre->sre_length - sizeof(struct sctp_remote_error); @@ -1956,19 +1955,19 @@ void DataChannelConnection::HandleRemoteErrorEvent( } void DataChannelConnection::HandleShutdownEvent( - const struct sctp_shutdown_event *sse) { + const struct sctp_shutdown_event* sse) { LOG(("Shutdown event.")); /* XXX: notify all channels. */ // Attempts to actually send anything will fail } void DataChannelConnection::HandleAdaptationIndication( - const struct sctp_adaptation_event *sai) { + const struct sctp_adaptation_event* sai) { LOG(("Adaptation indication: %x.", sai->sai_adaptation_ind)); } void DataChannelConnection::HandlePartialDeliveryEvent( - const struct sctp_pdapi_event *spde) { + const struct sctp_pdapi_event* spde) { // Note: Be aware that stream and sequence number being u32 instead of u16 is // a bug in the SCTP API. This may change in the future. @@ -1992,7 +1991,7 @@ void DataChannelConnection::HandlePartialDeliveryEvent( } // Find channel and reset buffer - DataChannel *channel = FindChannelByStream((uint16_t)spde->pdapi_stream); + DataChannel* channel = FindChannelByStream((uint16_t)spde->pdapi_stream); if (channel) { LOG(("Abort partially delivered message of %u bytes\n", channel->mRecvBuffer.Length())); @@ -2001,7 +2000,7 @@ void DataChannelConnection::HandlePartialDeliveryEvent( } void DataChannelConnection::HandleSendFailedEvent( - const struct sctp_send_failed_event *ssfe) { + const struct sctp_send_failed_event* ssfe) { size_t i, n; if (ssfe->ssfe_flags & SCTP_DATA_UNSENT) { @@ -2044,7 +2043,7 @@ void DataChannelConnection::ResetOutgoingStream(uint16_t stream) { uint32_t i; mLock.AssertCurrentThreadOwns(); - LOG(("Connection %p: Resetting outgoing stream %u", (void *)this, stream)); + LOG(("Connection %p: Resetting outgoing stream %u", (void*)this, stream)); // Rarely has more than a couple items and only for a short time for (i = 0; i < mStreamsResetting.Length(); ++i) { if (mStreamsResetting[i] == stream) { @@ -2055,12 +2054,12 @@ void DataChannelConnection::ResetOutgoingStream(uint16_t stream) { } void DataChannelConnection::SendOutgoingStreamReset() { - struct sctp_reset_streams *srs; + struct sctp_reset_streams* srs; uint32_t i; size_t len; LOG(("Connection %p: Sending outgoing stream reset for %zu streams", - (void *)this, mStreamsResetting.Length())); + (void*)this, mStreamsResetting.Length())); mLock.AssertCurrentThreadOwns(); if (mStreamsResetting.IsEmpty()) { LOG(("No streams to reset")); @@ -2068,7 +2067,7 @@ void DataChannelConnection::SendOutgoingStreamReset() { } len = sizeof(sctp_assoc_t) + (2 + mStreamsResetting.Length()) * sizeof(uint16_t); - srs = static_cast( + srs = static_cast( moz_xmalloc(len)); // infallible malloc memset(srs, 0, len); srs->srs_flags = SCTP_STREAM_RESET_OUTGOING; @@ -2091,7 +2090,7 @@ void DataChannelConnection::SendOutgoingStreamReset() { } void DataChannelConnection::HandleStreamResetEvent( - const struct sctp_stream_reset_event *strrst) { + const struct sctp_stream_reset_event* strrst) { uint32_t n, i; RefPtr channel; // since we may null out the ref to the channel @@ -2129,7 +2128,7 @@ void DataChannelConnection::HandleStreamResetEvent( mStreams[channel->mStream] = nullptr; LOG(("Disconnected DataChannel %p from connection %p", - (void *)channel.get(), (void *)channel->mConnection.get())); + (void*)channel.get(), (void*)channel->mConnection.get())); // This sends ON_CHANNEL_CLOSED to mainthread channel->StreamClosedLocked(); } else { @@ -2147,7 +2146,7 @@ void DataChannelConnection::HandleStreamResetEvent( } void DataChannelConnection::HandleStreamChangeEvent( - const struct sctp_stream_change_event *strchg) { + const struct sctp_stream_change_event* strchg) { uint16_t stream; RefPtr channel; @@ -2254,7 +2253,7 @@ void DataChannelConnection::HandleStreamChangeEvent( // Called with mLock locked! void DataChannelConnection::HandleNotification( - const union sctp_notification *notif, size_t n) { + const union sctp_notification* notif, size_t n) { mLock.AssertCurrentThreadOwns(); if (notif->sn_header.sn_length != (uint32_t)n) { return; @@ -2305,7 +2304,7 @@ void DataChannelConnection::HandleNotification( } } -int DataChannelConnection::ReceiveCallback(struct socket *sock, void *data, +int DataChannelConnection::ReceiveCallback(struct socket* sock, void* data, size_t datalen, struct sctp_rcvinfo rcv, int flags) { ASSERT_WEBRTC(!NS_IsMainThread()); @@ -2321,7 +2320,7 @@ int DataChannelConnection::ReceiveCallback(struct socket *sock, void *data, mLock.AssertCurrentThreadOwns(); } if (flags & MSG_NOTIFICATION) { - HandleNotification(static_cast(data), datalen); + HandleNotification(static_cast(data), datalen); } else { HandleMessage(data, datalen, ntohl(rcv.rcv_ppid), rcv.rcv_sid, flags); } @@ -2339,9 +2338,9 @@ int DataChannelConnection::ReceiveCallback(struct socket *sock, void *data, } already_AddRefed DataChannelConnection::Open( - const nsACString &label, const nsACString &protocol, Type type, - bool inOrder, uint32_t prValue, DataChannelListener *aListener, - nsISupports *aContext, bool aExternalNegotiated, uint16_t aStream) { + const nsACString& label, const nsACString& protocol, Type type, + bool inOrder, uint32_t prValue, DataChannelListener* aListener, + nsISupports* aContext, bool aExternalNegotiated, uint16_t aStream) { if (!aExternalNegotiated) { // aStream == INVALID_STREAM to have the protocol allocate aStream = INVALID_STREAM; @@ -2398,7 +2397,7 @@ already_AddRefed DataChannelConnection::Open( // Separate routine so we can also call it to finish up from pending opens already_AddRefed DataChannelConnection::OpenFinish( - already_AddRefed &&aChannel) { + already_AddRefed&& aChannel) { RefPtr channel(aChannel); // takes the reference passed in // Normally 1 reference if called from ::Open(), or 2 if called from // ProcessQueuedOpens() unless the DOMDataChannel was gc'd @@ -2488,7 +2487,7 @@ already_AddRefed DataChannelConnection::OpenFinish( // Also serves to mark we told the app channel->mFlags |= DATA_CHANNEL_FLAGS_FINISH_OPEN; // we need a ref for the nsDeQue and one to return - DataChannel *rawChannel = channel; + DataChannel* rawChannel = channel; rawChannel->AddRef(); mPending.Push(rawChannel); return channel.forget(); @@ -2562,8 +2561,8 @@ already_AddRefed DataChannelConnection::OpenFinish( // Requires mLock to be locked! // Returns a POSIX error code directly instead of setting errno. -int DataChannelConnection::SendMsgInternal(OutgoingMsg &msg) { - auto &info = msg.GetInfo().sendv_sndinfo; +int DataChannelConnection::SendMsgInternal(OutgoingMsg& msg) { + auto& info = msg.GetInfo().sendv_sndinfo; int error; // EOR set? @@ -2594,7 +2593,7 @@ int DataChannelConnection::SendMsgInternal(OutgoingMsg &msg) { // size (or EAGAIN if there isn't space). However, we can avoid EMSGSIZE // by carefully crafting small enough message chunks. ssize_t written = usrsctp_sendv( - mSocket, msg.GetData(), length, nullptr, 0, (void *)&msg.GetInfo(), + mSocket, msg.GetData(), length, nullptr, 0, (void*)&msg.GetInfo(), (socklen_t)sizeof(struct sctp_sendv_spa), SCTP_SENDV_SPA, 0); if (written < 0) { error = errno; @@ -2642,8 +2641,8 @@ int DataChannelConnection::SendMsgInternal(OutgoingMsg &msg) { // Returns a POSIX error code directly instead of setting errno. // IMPORTANT: Ensure that the buffer passed is guarded by mLock! int DataChannelConnection::SendMsgInternalOrBuffer( - nsTArray> &buffer, OutgoingMsg &msg, - bool &buffered) { + nsTArray>& buffer, OutgoingMsg& msg, + bool& buffered) { NS_WARNING_ASSERTION(msg.GetLength() > 0, "Length is 0?!"); int error = 0; @@ -2688,7 +2687,7 @@ int DataChannelConnection::SendMsgInternalOrBuffer( if (need_buffering) { // queue data for resend! And queue any further data for the stream until // it is... - auto *bufferedMsg = new BufferedOutgoingMsg(msg); // infallible malloc + auto* bufferedMsg = new BufferedOutgoingMsg(msg); // infallible malloc buffer.AppendElement(bufferedMsg); // owned by mBufferedData array LOG(("Queued %zu buffers (left=%zu, total=%zu)", buffer.Length(), msg.GetLeft(), msg.GetLength())); @@ -2702,8 +2701,8 @@ int DataChannelConnection::SendMsgInternalOrBuffer( // Caller must ensure that length <= UINT32_MAX // Returns a POSIX error code. -int DataChannelConnection::SendDataMsgInternalOrBuffer(DataChannel &channel, - const uint8_t *data, +int DataChannelConnection::SendDataMsgInternalOrBuffer(DataChannel& channel, + const uint8_t* data, size_t len, uint32_t ppid) { if (NS_WARN_IF(channel.mState != OPEN && channel.mState != CONNECTING)) { @@ -2752,8 +2751,8 @@ int DataChannelConnection::SendDataMsgInternalOrBuffer(DataChannel &channel, // Caller must ensure that length <= UINT32_MAX // Returns a POSIX error code. -int DataChannelConnection::SendDataMsg(DataChannel &channel, - const uint8_t *data, size_t len, +int DataChannelConnection::SendDataMsg(DataChannel& channel, + const uint8_t* data, size_t len, uint32_t ppidPartial, uint32_t ppidFinal) { // We *really* don't want to do this from main thread! - and @@ -2825,8 +2824,8 @@ int DataChannelConnection::SendDataMsg(DataChannel &channel, class ReadBlobRunnable : public Runnable { public: - ReadBlobRunnable(DataChannelConnection *aConnection, uint16_t aStream, - nsIInputStream *aBlob) + ReadBlobRunnable(DataChannelConnection* aConnection, uint16_t aStream, + nsIInputStream* aBlob) : Runnable("ReadBlobRunnable"), mConnection(aConnection), mStream(aStream), @@ -2834,7 +2833,7 @@ class ReadBlobRunnable : public Runnable { NS_IMETHOD Run() override { // ReadBlob() is responsible to releasing the reference - DataChannelConnection *self = mConnection; + DataChannelConnection* self = mConnection; self->ReadBlob(mConnection.forget(), mStream, mBlob); return NS_OK; } @@ -2852,8 +2851,8 @@ class ReadBlobRunnable : public Runnable { }; // Returns a POSIX error code. -int DataChannelConnection::SendBlob(uint16_t stream, nsIInputStream *aBlob) { - DataChannel *channel = mStreams[stream]; +int DataChannelConnection::SendBlob(uint16_t stream, nsIInputStream* aBlob) { + DataChannel* channel = mStreams[stream]; if (NS_WARN_IF(!channel)) { return EINVAL; // TODO: Find a better error code } @@ -2875,7 +2874,7 @@ int DataChannelConnection::SendBlob(uint16_t stream, nsIInputStream *aBlob) { class DataChannelBlobSendRunnable : public Runnable { public: DataChannelBlobSendRunnable( - already_AddRefed &aConnection, uint16_t aStream) + already_AddRefed& aConnection, uint16_t aStream) : Runnable("DataChannelBlobSendRunnable"), mConnection(aConnection), mStream(aStream) {} @@ -2908,7 +2907,7 @@ class DataChannelBlobSendRunnable : public Runnable { void DataChannelConnection::ReadBlob( already_AddRefed aThis, uint16_t aStream, - nsIInputStream *aBlob) { + nsIInputStream* aBlob) { // NOTE: 'aThis' has been forgotten by the caller to avoid releasing // it off mainthread; if PeerConnectionImpl has released then we want // ~DataChannelConnection() to run on MainThread @@ -2939,7 +2938,7 @@ void DataChannelConnection::ReadBlob( Dispatch(runnable.forget()); } -void DataChannelConnection::GetStreamIds(std::vector *aStreamList) { +void DataChannelConnection::GetStreamIds(std::vector* aStreamList) { ASSERT_WEBRTC(NS_IsMainThread()); for (uint32_t i = 0; i < mStreams.Length(); ++i) { if (mStreams[i]) { @@ -2950,21 +2949,21 @@ void DataChannelConnection::GetStreamIds(std::vector *aStreamList) { // Returns a POSIX error code. int DataChannelConnection::SendDataMsgCommon(uint16_t stream, - const nsACString &aMsg, + const nsACString& aMsg, bool isBinary) { ASSERT_WEBRTC(NS_IsMainThread()); // We really could allow this from other threads, so long as we deal with // asynchronosity issues with channels closing, in particular access to // mStreams, and issues with the association closing (access to mSocket). - const uint8_t *data = (const uint8_t *)aMsg.BeginReading(); + const uint8_t* data = (const uint8_t*)aMsg.BeginReading(); uint32_t len = aMsg.Length(); #if (UINT32_MAX > SIZE_MAX) if (len > SIZE_MAX) { return EMSGSIZE; } #endif - DataChannel *channelPtr; + DataChannel* channelPtr; LOG(("Sending %sto stream %u: %u bytes", isBinary ? "binary " : "", stream, len)); @@ -2974,7 +2973,7 @@ int DataChannelConnection::SendDataMsgCommon(uint16_t stream, return EINVAL; // TODO: Find a better error code } - auto &channel = *channelPtr; + auto& channel = *channelPtr; if (isBinary) { return SendDataMsg(channel, data, len, DATA_CHANNEL_PPID_BINARY_PARTIAL, @@ -2990,14 +2989,14 @@ void DataChannelConnection::Stop() { DataChannelOnMessageAvailable::ON_DISCONNECTED, this))); } -void DataChannelConnection::Close(DataChannel *aChannel) { +void DataChannelConnection::Close(DataChannel* aChannel) { MutexAutoLock lock(mLock); CloseInt(aChannel); } // So we can call Close() with the lock already held // Called from someone who holds a ref via ::Close(), or from ~DataChannel -void DataChannelConnection::CloseInt(DataChannel *aChannel) { +void DataChannelConnection::CloseInt(DataChannel* aChannel) { MOZ_ASSERT(aChannel); RefPtr channel(aChannel); // make sure it doesn't go away on us @@ -3035,7 +3034,7 @@ void DataChannelConnection::CloseInt(DataChannel *aChannel) { } void DataChannelConnection::CloseAll() { - LOG(("Closing all channels (connection %p)", (void *)this)); + LOG(("Closing all channels (connection %p)", (void*)this)); // Don't need to lock here // Make sure no more channels will be opened @@ -3058,7 +3057,7 @@ void DataChannelConnection::CloseAll() { // Clean up any pending opens for channels RefPtr channel; while (nullptr != (channel = dont_AddRef( - static_cast(mPending.PopFront())))) { + static_cast(mPending.PopFront())))) { LOG(("closing pending channel %p, stream %u", channel.get(), channel->mStream)); channel->Close(); // also releases the ref on each iteration @@ -3108,14 +3107,14 @@ void DataChannel::ReleaseConnection() { mConnection = nullptr; } -void DataChannel::SetListener(DataChannelListener *aListener, - nsISupports *aContext) { +void DataChannel::SetListener(DataChannelListener* aListener, + nsISupports* aContext) { MutexAutoLock mLock(mListenerLock); mContext = aContext; mListener = aListener; } -void DataChannel::SendErrnoToErrorResult(int error, ErrorResult &aRv) { +void DataChannel::SendErrnoToErrorResult(int error, ErrorResult& aRv) { switch (error) { case 0: break; @@ -3128,7 +3127,7 @@ void DataChannel::SendErrnoToErrorResult(int error, ErrorResult &aRv) { } } -void DataChannel::SendMsg(const nsACString &aMsg, ErrorResult &aRv) { +void DataChannel::SendMsg(const nsACString& aMsg, ErrorResult& aRv) { if (!EnsureValidStream(aRv)) { return; } @@ -3136,7 +3135,7 @@ void DataChannel::SendMsg(const nsACString &aMsg, ErrorResult &aRv) { SendErrnoToErrorResult(mConnection->SendMsg(mStream, aMsg), aRv); } -void DataChannel::SendBinaryMsg(const nsACString &aMsg, ErrorResult &aRv) { +void DataChannel::SendBinaryMsg(const nsACString& aMsg, ErrorResult& aRv) { if (!EnsureValidStream(aRv)) { return; } @@ -3144,7 +3143,7 @@ void DataChannel::SendBinaryMsg(const nsACString &aMsg, ErrorResult &aRv) { SendErrnoToErrorResult(mConnection->SendBinaryMsg(mStream, aMsg), aRv); } -void DataChannel::SendBinaryStream(nsIInputStream *aBlob, ErrorResult &aRv) { +void DataChannel::SendBinaryStream(nsIInputStream* aBlob, ErrorResult& aRv) { if (!EnsureValidStream(aRv)) { return; } @@ -3197,7 +3196,7 @@ void DataChannel::AppReady() { size_t DataChannel::GetBufferedAmountLocked() const { size_t buffered = 0; - for (auto &msg : mBufferedData) { + for (auto& msg : mBufferedData) { buffered += msg->GetLeft(); } // XXX Note: per Michael Tuexen, there's no way to currently get the buffered @@ -3220,7 +3219,7 @@ void DataChannel::SetBufferedAmountLowThreshold(uint32_t aThreshold) { } // Called with mLock locked! -void DataChannel::SendOrQueue(DataChannelOnMessageAvailable *aMessage) { +void DataChannel::SendOrQueue(DataChannelOnMessageAvailable* aMessage) { if (!(mFlags & DATA_CHANNEL_FLAGS_READY) && (mState == CONNECTING || mState == WAITING_TO_OPEN)) { mQueuedMessages.AppendElement(aMessage); @@ -3230,7 +3229,7 @@ void DataChannel::SendOrQueue(DataChannelOnMessageAvailable *aMessage) { } } -bool DataChannel::EnsureValidStream(ErrorResult &aRv) { +bool DataChannel::EnsureValidStream(ErrorResult& aRv) { MOZ_ASSERT(mConnection); if (mConnection && mStream != INVALID_STREAM) { return true; diff --git a/netwerk/sctp/datachannel/DataChannel.h b/netwerk/sctp/datachannel/DataChannel.h index 9dae825ecc76e..1289ec540a283 100644 --- a/netwerk/sctp/datachannel/DataChannel.h +++ b/netwerk/sctp/datachannel/DataChannel.h @@ -56,23 +56,23 @@ class MediaTransportHandler; // not copy it. class OutgoingMsg { public: - OutgoingMsg(struct sctp_sendv_spa &info, const uint8_t *data, size_t length); + OutgoingMsg(struct sctp_sendv_spa& info, const uint8_t* data, size_t length); ~OutgoingMsg() = default; ; void Advance(size_t offset); - struct sctp_sendv_spa &GetInfo() { + struct sctp_sendv_spa& GetInfo() { return *mInfo; }; size_t GetLength() { return mLength; }; size_t GetLeft() { return mLength - mPos; }; - const uint8_t *GetData() { return (const uint8_t *)(mData + mPos); }; + const uint8_t* GetData() { return (const uint8_t*)(mData + mPos); }; protected: OutgoingMsg() // Use this for inheritance only : mLength(0), mData(nullptr), mInfo(nullptr), mPos(0){}; size_t mLength; - const uint8_t *mData; - struct sctp_sendv_spa *mInfo; + const uint8_t* mData; + struct sctp_sendv_spa* mInfo; size_t mPos; }; @@ -80,7 +80,7 @@ class OutgoingMsg { // This class copies data of an outgoing message. class BufferedOutgoingMsg : public OutgoingMsg { public: - explicit BufferedOutgoingMsg(OutgoingMsg &message); + explicit BufferedOutgoingMsg(OutgoingMsg& message); ~BufferedOutgoingMsg(); }; @@ -88,10 +88,10 @@ class BufferedOutgoingMsg : public OutgoingMsg { // external negotiation is indicated to us class QueuedDataMessage { public: - QueuedDataMessage(uint16_t stream, uint32_t ppid, int flags, const void *data, + QueuedDataMessage(uint16_t stream, uint32_t ppid, int flags, const void* data, uint32_t length) : mStream(stream), mPpid(ppid), mFlags(flags), mLength(length) { - mData = static_cast(moz_xmalloc((size_t)length)); // infallible + mData = static_cast(moz_xmalloc((size_t)length)); // infallible memcpy(mData, data, (size_t)length); } @@ -101,7 +101,7 @@ class QueuedDataMessage { uint32_t mPpid; int mFlags; uint32_t mLength; - uint8_t *mData; + uint8_t* mData; }; // One per PeerConnection @@ -133,16 +133,16 @@ class DataChannelConnection final : public net::NeckoTargetHolder virtual void NotifyDataChannel(already_AddRefed channel) = 0; }; - DataChannelConnection(DataConnectionListener *listener, - nsIEventTarget *aTarget, - MediaTransportHandler *aTransportHandler); + DataChannelConnection(DataConnectionListener* listener, + nsIEventTarget* aTarget, + MediaTransportHandler* aTransportHandler); bool Init(unsigned short aPort, uint16_t aNumStreams, bool aMaxMessageSizeSet, uint64_t aMaxMessageSize); void Destroy(); // So we can spawn refs tied to runnables in shutdown // Finish Destroy on STS to avoid SCTP race condition with ABORT from far end - void DestroyOnSTS(struct socket *aMasterSocket, struct socket *aSocket); + void DestroyOnSTS(struct socket* aMasterSocket, struct socket* aSocket); void DestroyOnSTSFinal(); void SetMaxMessageSize(bool aMaxMessageSizeSet, uint64_t aMaxMessageSize); @@ -153,16 +153,16 @@ class DataChannelConnection final : public net::NeckoTargetHolder // (though you can do simultaneous Connect()). Do not call these from // the main thread! bool Listen(unsigned short port); - bool Connect(const char *addr, unsigned short port); + bool Connect(const char* addr, unsigned short port); #endif #ifdef SCTP_DTLS_SUPPORTED - bool ConnectToTransport(const std::string &aTransportId, bool aClient, + bool ConnectToTransport(const std::string& aTransportId, bool aClient, uint16_t localport, uint16_t remoteport); - void TransportStateChange(const std::string &aTransportId, + void TransportStateChange(const std::string& aTransportId, TransportLayer::State aState); void CompleteConnect(); - void SetSignals(const std::string &aTransportId, bool aClient); + void SetSignals(const std::string& aTransportId, bool aClient); #endif typedef enum { @@ -173,32 +173,32 @@ class DataChannelConnection final : public net::NeckoTargetHolder MOZ_MUST_USE already_AddRefed Open( - const nsACString &label, const nsACString &protocol, Type type, - bool inOrder, uint32_t prValue, DataChannelListener *aListener, - nsISupports *aContext, bool aExternalNegotiated, uint16_t aStream); + const nsACString& label, const nsACString& protocol, Type type, + bool inOrder, uint32_t prValue, DataChannelListener* aListener, + nsISupports* aContext, bool aExternalNegotiated, uint16_t aStream); void Stop(); - void Close(DataChannel *aChannel); + void Close(DataChannel* aChannel); // CloseInt() must be called with mLock held - void CloseInt(DataChannel *aChannel); + void CloseInt(DataChannel* aChannel); void CloseAll(); // Returns a POSIX error code. - int SendMsg(uint16_t stream, const nsACString &aMsg) { + int SendMsg(uint16_t stream, const nsACString& aMsg) { return SendDataMsgCommon(stream, aMsg, false); } // Returns a POSIX error code. - int SendBinaryMsg(uint16_t stream, const nsACString &aMsg) { + int SendBinaryMsg(uint16_t stream, const nsACString& aMsg) { return SendDataMsgCommon(stream, aMsg, true); } // Returns a POSIX error code. - int SendBlob(uint16_t stream, nsIInputStream *aBlob); + int SendBlob(uint16_t stream, nsIInputStream* aBlob); // Called on data reception from the SCTP library // must(?) be public so my c->c++ trampoline can call it - int ReceiveCallback(struct socket *sock, void *data, size_t datalen, + int ReceiveCallback(struct socket* sock, void* data, size_t datalen, struct sctp_rcvinfo rcv, int flags); // Find out state @@ -212,9 +212,9 @@ class DataChannelConnection final : public net::NeckoTargetHolder Mutex mLock; void ReadBlob(already_AddRefed aThis, uint16_t aStream, - nsIInputStream *aBlob); + nsIInputStream* aBlob); - void GetStreamIds(std::vector *aStreamList); + void GetStreamIds(std::vector* aStreamList); bool SendDeferredMessages(); @@ -228,66 +228,66 @@ class DataChannelConnection final : public net::NeckoTargetHolder friend class DataChannelConnectRunnable; #ifdef SCTP_DTLS_SUPPORTED - static void DTLSConnectThread(void *data); + static void DTLSConnectThread(void* data); void SendPacket(nsAutoPtr packet); - void SctpDtlsInput(const std::string &aTransportId, MediaPacket &packet); - static int SctpDtlsOutput(void *addr, void *buffer, size_t length, + void SctpDtlsInput(const std::string& aTransportId, MediaPacket& packet); + static int SctpDtlsOutput(void* addr, void* buffer, size_t length, uint8_t tos, uint8_t set_df); #endif - DataChannel *FindChannelByStream(uint16_t stream); + DataChannel* FindChannelByStream(uint16_t stream); uint16_t FindFreeStream(); bool RequestMoreStreams(int32_t aNeeded = 16); uint32_t UpdateCurrentStreamIndex(); uint32_t GetCurrentStreamIndex(); - int SendControlMessage(const uint8_t *data, uint32_t len, uint16_t stream); + int SendControlMessage(const uint8_t* data, uint32_t len, uint16_t stream); int SendOpenAckMessage(uint16_t stream); - int SendOpenRequestMessage(const nsACString &label, - const nsACString &protocol, uint16_t stream, + int SendOpenRequestMessage(const nsACString& label, + const nsACString& protocol, uint16_t stream, bool unordered, uint16_t prPolicy, uint32_t prValue); - bool SendBufferedMessages(nsTArray> &buffer); - int SendMsgInternal(OutgoingMsg &msg); - int SendMsgInternalOrBuffer(nsTArray> &buffer, - OutgoingMsg &msg, bool &buffered); - int SendDataMsgInternalOrBuffer(DataChannel &channel, const uint8_t *data, + bool SendBufferedMessages(nsTArray>& buffer); + int SendMsgInternal(OutgoingMsg& msg); + int SendMsgInternalOrBuffer(nsTArray>& buffer, + OutgoingMsg& msg, bool& buffered); + int SendDataMsgInternalOrBuffer(DataChannel& channel, const uint8_t* data, size_t len, uint32_t ppid); - int SendDataMsg(DataChannel &channel, const uint8_t *data, size_t len, + int SendDataMsg(DataChannel& channel, const uint8_t* data, size_t len, uint32_t ppidPartial, uint32_t ppidFinal); - int SendDataMsgCommon(uint16_t stream, const nsACString &aMsg, bool isBinary); + int SendDataMsgCommon(uint16_t stream, const nsACString& aMsg, bool isBinary); void DeliverQueuedData(uint16_t stream); already_AddRefed OpenFinish( - already_AddRefed &&aChannel); + already_AddRefed&& aChannel); void ProcessQueuedOpens(); void ClearResets(); void SendOutgoingStreamReset(); void ResetOutgoingStream(uint16_t stream); void HandleOpenRequestMessage( - const struct rtcweb_datachannel_open_request *req, uint32_t length, + const struct rtcweb_datachannel_open_request* req, uint32_t length, uint16_t stream); - void HandleOpenAckMessage(const struct rtcweb_datachannel_ack *ack, + void HandleOpenAckMessage(const struct rtcweb_datachannel_ack* ack, uint32_t length, uint16_t stream); void HandleUnknownMessage(uint32_t ppid, uint32_t length, uint16_t stream); - uint8_t BufferMessage(nsACString &recvBuffer, const void *data, + uint8_t BufferMessage(nsACString& recvBuffer, const void* data, uint32_t length, uint32_t ppid, int flags); - void HandleDataMessage(const void *buffer, size_t length, uint32_t ppid, + void HandleDataMessage(const void* buffer, size_t length, uint32_t ppid, uint16_t stream, int flags); - void HandleDCEPMessage(const void *buffer, size_t length, uint32_t ppid, + void HandleDCEPMessage(const void* buffer, size_t length, uint32_t ppid, uint16_t stream, int flags); - void HandleMessage(const void *buffer, size_t length, uint32_t ppid, + void HandleMessage(const void* buffer, size_t length, uint32_t ppid, uint16_t stream, int flags); - void HandleAssociationChangeEvent(const struct sctp_assoc_change *sac); - void HandlePeerAddressChangeEvent(const struct sctp_paddr_change *spc); - void HandleRemoteErrorEvent(const struct sctp_remote_error *sre); - void HandleShutdownEvent(const struct sctp_shutdown_event *sse); - void HandleAdaptationIndication(const struct sctp_adaptation_event *sai); - void HandlePartialDeliveryEvent(const struct sctp_pdapi_event *spde); - void HandleSendFailedEvent(const struct sctp_send_failed_event *ssfe); - void HandleStreamResetEvent(const struct sctp_stream_reset_event *strrst); - void HandleStreamChangeEvent(const struct sctp_stream_change_event *strchg); - void HandleNotification(const union sctp_notification *notif, size_t n); + void HandleAssociationChangeEvent(const struct sctp_assoc_change* sac); + void HandlePeerAddressChangeEvent(const struct sctp_paddr_change* spc); + void HandleRemoteErrorEvent(const struct sctp_remote_error* sre); + void HandleShutdownEvent(const struct sctp_shutdown_event* sse); + void HandleAdaptationIndication(const struct sctp_adaptation_event* sai); + void HandlePartialDeliveryEvent(const struct sctp_pdapi_event* spde); + void HandleSendFailedEvent(const struct sctp_send_failed_event* ssfe); + void HandleStreamResetEvent(const struct sctp_stream_reset_event* strrst); + void HandleStreamChangeEvent(const struct sctp_stream_change_event* strchg); + void HandleNotification(const union sctp_notification* notif, size_t n); #ifdef SCTP_DTLS_SUPPORTED bool IsSTSThread() { @@ -320,8 +320,8 @@ class DataChannelConnection final : public net::NeckoTargetHolder // Streams pending reset AutoTArray mStreamsResetting; - struct socket *mMasterSocket; // accessed from STS thread - struct socket * + struct socket* mMasterSocket; // accessed from STS thread + struct socket* mSocket; // cloned from mMasterSocket on successful Connect on STS thread uint16_t mState; // Protected with mLock @@ -360,11 +360,11 @@ class DataChannel { WAITING_TO_OPEN = 4U }; - DataChannel(DataChannelConnection *connection, uint16_t stream, - uint16_t state, const nsACString &label, - const nsACString &protocol, uint16_t policy, uint32_t value, - uint32_t flags, DataChannelListener *aListener, - nsISupports *aContext) + DataChannel(DataChannelConnection* connection, uint16_t stream, + uint16_t state, const nsACString& label, + const nsACString& protocol, uint16_t policy, uint32_t value, + uint32_t flags, DataChannelListener* aListener, + nsISupports* aContext) : mListenerLock("netwerk::sctp::DataChannel"), mListener(aListener), mContext(aContext), @@ -403,19 +403,19 @@ class DataChannel { void Close(); // Set the listener (especially for channels created from the other side) - void SetListener(DataChannelListener *aListener, nsISupports *aContext); + void SetListener(DataChannelListener* aListener, nsISupports* aContext); // Helper for send methods that converts POSIX error codes to an ErrorResult. - static void SendErrnoToErrorResult(int error, ErrorResult &aRv); + static void SendErrnoToErrorResult(int error, ErrorResult& aRv); // Send a string - void SendMsg(const nsACString &aMsg, ErrorResult &aRv); + void SendMsg(const nsACString& aMsg, ErrorResult& aRv); // Send a binary message (TypedArray) - void SendBinaryMsg(const nsACString &aMsg, ErrorResult &aRv); + void SendBinaryMsg(const nsACString& aMsg, ErrorResult& aRv); // Send a binary blob - void SendBinaryStream(nsIInputStream *aBlob, ErrorResult &aRv); + void SendBinaryStream(nsIInputStream* aBlob, ErrorResult& aRv); uint16_t GetType() { return mPrPolicy; } @@ -460,28 +460,28 @@ class DataChannel { return CLOSED; } - void GetLabel(nsAString &aLabel) { CopyUTF8toUTF16(mLabel, aLabel); } - void GetProtocol(nsAString &aProtocol) { + void GetLabel(nsAString& aLabel) { CopyUTF8toUTF16(mLabel, aLabel); } + void GetProtocol(nsAString& aProtocol) { CopyUTF8toUTF16(mProtocol, aProtocol); } uint16_t GetStream() { return mStream; } void AppReady(); - void SendOrQueue(DataChannelOnMessageAvailable *aMessage); + void SendOrQueue(DataChannelOnMessageAvailable* aMessage); protected: Mutex mListenerLock; // protects mListener and mContext - DataChannelListener *mListener; + DataChannelListener* mListener; nsCOMPtr mContext; private: friend class DataChannelOnMessageAvailable; friend class DataChannelConnection; - nsresult AddDataToBinaryMsg(const char *data, uint32_t size); + nsresult AddDataToBinaryMsg(const char* data, uint32_t size); size_t GetBufferedAmountLocked() const; - bool EnsureValidStream(ErrorResult &aRv); + bool EnsureValidStream(ErrorResult& aRv); RefPtr mConnection; nsCString mLabel; @@ -519,15 +519,15 @@ class DataChannelOnMessageAvailable : public Runnable { }; /* types */ DataChannelOnMessageAvailable( - int32_t aType, DataChannelConnection *aConnection, DataChannel *aChannel, - nsCString &aData) // XXX this causes inefficiency + int32_t aType, DataChannelConnection* aConnection, DataChannel* aChannel, + nsCString& aData) // XXX this causes inefficiency : Runnable("DataChannelOnMessageAvailable"), mType(aType), mChannel(aChannel), mConnection(aConnection), mData(aData) {} - DataChannelOnMessageAvailable(int32_t aType, DataChannel *aChannel) + DataChannelOnMessageAvailable(int32_t aType, DataChannel* aChannel) : Runnable("DataChannelOnMessageAvailable"), mType(aType), mChannel(aChannel) {} @@ -536,8 +536,8 @@ class DataChannelOnMessageAvailable : public Runnable { // bulletproof compile-time checking. DataChannelOnMessageAvailable(int32_t aType, - DataChannelConnection *aConnection, - DataChannel *aChannel) + DataChannelConnection* aConnection, + DataChannel* aChannel) : Runnable("DataChannelOnMessageAvailable"), mType(aType), mChannel(aChannel), @@ -545,7 +545,7 @@ class DataChannelOnMessageAvailable : public Runnable { // for ON_CONNECTION/ON_DISCONNECTED DataChannelOnMessageAvailable(int32_t aType, - DataChannelConnection *aConnection) + DataChannelConnection* aConnection) : Runnable("DataChannelOnMessageAvailable"), mType(aType), mConnection(aConnection) {} diff --git a/netwerk/sctp/datachannel/DataChannelListener.h b/netwerk/sctp/datachannel/DataChannelListener.h index 4c45b63815dfe..06564b6cc7a23 100644 --- a/netwerk/sctp/datachannel/DataChannelListener.h +++ b/netwerk/sctp/datachannel/DataChannelListener.h @@ -20,24 +20,24 @@ class DataChannelListener { virtual ~DataChannelListener() = default; // Called when a DOMString message is received. - virtual nsresult OnMessageAvailable(nsISupports *aContext, - const nsACString &message) = 0; + virtual nsresult OnMessageAvailable(nsISupports* aContext, + const nsACString& message) = 0; // Called when a binary message is received. - virtual nsresult OnBinaryMessageAvailable(nsISupports *aContext, - const nsACString &message) = 0; + virtual nsresult OnBinaryMessageAvailable(nsISupports* aContext, + const nsACString& message) = 0; // Called when the channel is connected - virtual nsresult OnChannelConnected(nsISupports *aContext) = 0; + virtual nsresult OnChannelConnected(nsISupports* aContext) = 0; // Called when the channel is closed - virtual nsresult OnChannelClosed(nsISupports *aContext) = 0; + virtual nsresult OnChannelClosed(nsISupports* aContext) = 0; // Called when the BufferedAmount drops below the BufferedAmountLowThreshold - virtual nsresult OnBufferLow(nsISupports *aContext) = 0; + virtual nsresult OnBufferLow(nsISupports* aContext) = 0; // Called when the BufferedAmount drops to 0 - virtual nsresult NotBuffered(nsISupports *aContext) = 0; + virtual nsresult NotBuffered(nsISupports* aContext) = 0; }; } // namespace mozilla diff --git a/netwerk/socket/nsSOCKSIOLayer.cpp b/netwerk/socket/nsSOCKSIOLayer.cpp index 2de5652659cab..6909ade1c9585 100644 --- a/netwerk/socket/nsSOCKSIOLayer.cpp +++ b/netwerk/socket/nsSOCKSIOLayer.cpp @@ -71,15 +71,15 @@ class nsSOCKSSocketInfo : public nsISOCKSSocketInfo, public nsIDNSListener { NS_DECL_NSISOCKSSOCKETINFO NS_DECL_NSIDNSLISTENER - void Init(int32_t version, int32_t family, nsIProxyInfo *proxy, - const char *destinationHost, uint32_t flags, uint32_t tlsFlags); + void Init(int32_t version, int32_t family, nsIProxyInfo* proxy, + const char* destinationHost, uint32_t flags, uint32_t tlsFlags); void SetConnectTimeout(PRIntervalTime to); - PRStatus DoHandshake(PRFileDesc *fd, int16_t oflags = -1); + PRStatus DoHandshake(PRFileDesc* fd, int16_t oflags = -1); int16_t GetPollFlags() const; bool IsConnected() const { return mState == SOCKS_CONNECTED; } void ForgetFD() { mFD = nullptr; } - void SetNamedPipeFD(PRFileDesc *fd) { mFD = fd; } + void SetNamedPipeFD(PRFileDesc* fd) { mFD = fd; } private: virtual ~nsSOCKSSocketInfo() { @@ -88,10 +88,10 @@ class nsSOCKSSocketInfo : public nsISOCKSSocketInfo, public nsIDNSListener { } void HandshakeFinished(PRErrorCode err = 0); - PRStatus StartDNS(PRFileDesc *fd); - PRStatus ConnectToProxy(PRFileDesc *fd); - void FixupAddressFamily(PRFileDesc *fd, NetAddr *proxy); - PRStatus ContinueConnectingToProxy(PRFileDesc *fd, int16_t oflags); + PRStatus StartDNS(PRFileDesc* fd); + PRStatus ConnectToProxy(PRFileDesc* fd); + void FixupAddressFamily(PRFileDesc* fd, NetAddr* proxy); + PRStatus ContinueConnectingToProxy(PRFileDesc* fd, int16_t oflags); PRStatus WriteV4ConnectRequest(); PRStatus ReadV4ConnectResponse(); PRStatus WriteV5AuthRequest(); @@ -99,19 +99,19 @@ class nsSOCKSSocketInfo : public nsISOCKSSocketInfo, public nsIDNSListener { PRStatus WriteV5UsernameRequest(); PRStatus ReadV5UsernameResponse(); PRStatus WriteV5ConnectRequest(); - PRStatus ReadV5AddrTypeAndLength(uint8_t *type, uint32_t *len); + PRStatus ReadV5AddrTypeAndLength(uint8_t* type, uint32_t* len); PRStatus ReadV5ConnectResponseTop(); PRStatus ReadV5ConnectResponseBottom(); uint8_t ReadUint8(); uint16_t ReadUint16(); uint32_t ReadUint32(); - void ReadNetAddr(NetAddr *addr, uint16_t fam); - void ReadNetPort(NetAddr *addr); + void ReadNetAddr(NetAddr* addr, uint16_t fam); + void ReadNetPort(NetAddr* addr); void WantRead(uint32_t sz); - PRStatus ReadFromSocket(PRFileDesc *fd); - PRStatus WriteToSocket(PRFileDesc *fd); + PRStatus ReadFromSocket(PRFileDesc* fd); + PRStatus WriteToSocket(PRFileDesc* fd); bool IsLocalProxy() { nsAutoCString proxyHost; @@ -119,8 +119,8 @@ class nsSOCKSSocketInfo : public nsISOCKSSocketInfo, public nsIDNSListener { return IsHostLocalTarget(proxyHost); } - nsresult SetLocalProxyPath(const nsACString &aLocalProxyPath, - NetAddr *aProxyAddr) { + nsresult SetLocalProxyPath(const nsACString& aLocalProxyPath, + NetAddr* aProxyAddr) { #ifdef XP_UNIX nsresult rv; MOZ_ASSERT(aProxyAddr); @@ -176,7 +176,7 @@ class nsSOCKSSocketInfo : public nsISOCKSSocketInfo, public nsIDNSListener { #endif } - bool SetupNamedPipeLayer(PRFileDesc *fd) { + bool SetupNamedPipeLayer(PRFileDesc* fd) { #if defined(XP_WIN) if (IsLocalProxy()) { // nsSOCKSIOLayer handshaking only works under blocking mode @@ -190,15 +190,15 @@ class nsSOCKSSocketInfo : public nsISOCKSSocketInfo, public nsIDNSListener { private: State mState; - uint8_t *mData; - uint8_t *mDataIoPtr; + uint8_t* mData; + uint8_t* mDataIoPtr; uint32_t mDataLength; uint32_t mReadOffset; uint32_t mAmountToRead; nsCOMPtr mDnsRec; nsCOMPtr mLookup; nsresult mLookupStatus; - PRFileDesc *mFD; + PRFileDesc* mFD; nsCString mDestinationHost; nsCOMPtr mProxy; @@ -293,11 +293,11 @@ class Buffer { public: Buffer() : mBuf(nullptr), mLength(0) {} - explicit Buffer(uint8_t *aBuf, size_t aLength = 0) + explicit Buffer(uint8_t* aBuf, size_t aLength = 0) : mBuf(aBuf), mLength(aLength) {} template - MOZ_IMPLICIT Buffer(const Buffer &aBuf) + MOZ_IMPLICIT Buffer(const Buffer& aBuf) : mBuf(aBuf.mBuf), mLength(aBuf.mLength) { static_assert(Size2 > Size, "Cannot cast buffer"); } @@ -314,11 +314,11 @@ class Buffer { return Write(aValue); } - Buffer WriteNetPort(const NetAddr *aAddr) { + Buffer WriteNetPort(const NetAddr* aAddr) { return WriteUint16(aAddr->inet.port); } - Buffer WriteNetAddr(const NetAddr *aAddr) { + Buffer WriteNetAddr(const NetAddr* aAddr) { if (aAddr->raw.family == AF_INET) { return Write(aAddr->inet.ip); } else if (aAddr->raw.family == AF_INET6) { @@ -329,7 +329,7 @@ class Buffer { } template - Buffer WriteString(const nsACString &aStr) { + Buffer WriteString(const nsACString& aStr) { if (aStr.Length() > MaxLength) { return Buffer(nullptr); } @@ -348,12 +348,12 @@ class Buffer { friend class Buffer; template - Buffer Write(T &aValue) { + Buffer Write(T& aValue) { return WritePtr(&aValue, sizeof(T)); } template - Buffer WritePtr(const T *aValue, size_t aCopyLength) { + Buffer WritePtr(const T* aValue, size_t aCopyLength) { static_assert(Size >= Length, "Cannot write that much"); MOZ_ASSERT(aCopyLength <= Length); MOZ_ASSERT(mBuf); @@ -364,12 +364,12 @@ class Buffer { return result; } - uint8_t *mBuf; + uint8_t* mBuf; size_t mLength; }; void nsSOCKSSocketInfo::Init(int32_t version, int32_t family, - nsIProxyInfo *proxy, const char *host, + nsIProxyInfo* proxy, const char* host, uint32_t flags, uint32_t tlsFlags) { mVersion = version; mDestinationFamily = family; @@ -383,37 +383,37 @@ void nsSOCKSSocketInfo::Init(int32_t version, int32_t family, NS_IMPL_ISUPPORTS(nsSOCKSSocketInfo, nsISOCKSSocketInfo, nsIDNSListener) NS_IMETHODIMP -nsSOCKSSocketInfo::GetExternalProxyAddr(NetAddr **aExternalProxyAddr) { +nsSOCKSSocketInfo::GetExternalProxyAddr(NetAddr** aExternalProxyAddr) { memcpy(*aExternalProxyAddr, &mExternalProxyAddr, sizeof(NetAddr)); return NS_OK; } NS_IMETHODIMP -nsSOCKSSocketInfo::SetExternalProxyAddr(NetAddr *aExternalProxyAddr) { +nsSOCKSSocketInfo::SetExternalProxyAddr(NetAddr* aExternalProxyAddr) { memcpy(&mExternalProxyAddr, aExternalProxyAddr, sizeof(NetAddr)); return NS_OK; } NS_IMETHODIMP -nsSOCKSSocketInfo::GetDestinationAddr(NetAddr **aDestinationAddr) { +nsSOCKSSocketInfo::GetDestinationAddr(NetAddr** aDestinationAddr) { memcpy(*aDestinationAddr, &mDestinationAddr, sizeof(NetAddr)); return NS_OK; } NS_IMETHODIMP -nsSOCKSSocketInfo::SetDestinationAddr(NetAddr *aDestinationAddr) { +nsSOCKSSocketInfo::SetDestinationAddr(NetAddr* aDestinationAddr) { memcpy(&mDestinationAddr, aDestinationAddr, sizeof(NetAddr)); return NS_OK; } NS_IMETHODIMP -nsSOCKSSocketInfo::GetInternalProxyAddr(NetAddr **aInternalProxyAddr) { +nsSOCKSSocketInfo::GetInternalProxyAddr(NetAddr** aInternalProxyAddr) { memcpy(*aInternalProxyAddr, &mInternalProxyAddr, sizeof(NetAddr)); return NS_OK; } NS_IMETHODIMP -nsSOCKSSocketInfo::SetInternalProxyAddr(NetAddr *aInternalProxyAddr) { +nsSOCKSSocketInfo::SetInternalProxyAddr(NetAddr* aInternalProxyAddr) { memcpy(&mInternalProxyAddr, aInternalProxyAddr, sizeof(NetAddr)); return NS_OK; } @@ -456,7 +456,7 @@ void nsSOCKSSocketInfo::HandshakeFinished(PRErrorCode err) { } } -PRStatus nsSOCKSSocketInfo::StartDNS(PRFileDesc *fd) { +PRStatus nsSOCKSSocketInfo::StartDNS(PRFileDesc* fd) { MOZ_ASSERT(!mDnsRec && mState == SOCKS_INITIAL, "Must be in initial state to make DNS Lookup"); @@ -483,8 +483,8 @@ PRStatus nsSOCKSSocketInfo::StartDNS(PRFileDesc *fd) { } NS_IMETHODIMP -nsSOCKSSocketInfo::OnLookupComplete(nsICancelable *aRequest, - nsIDNSRecord *aRecord, nsresult aStatus) { +nsSOCKSSocketInfo::OnLookupComplete(nsICancelable* aRequest, + nsIDNSRecord* aRecord, nsresult aStatus) { MOZ_ASSERT(aRequest == mLookup, "wrong DNS query"); mLookup = nullptr; mLookupStatus = aStatus; @@ -498,13 +498,13 @@ nsSOCKSSocketInfo::OnLookupComplete(nsICancelable *aRequest, } NS_IMETHODIMP -nsSOCKSSocketInfo::OnLookupByTypeComplete(nsICancelable *aRequest, - nsIDNSByTypeRecord *res, +nsSOCKSSocketInfo::OnLookupByTypeComplete(nsICancelable* aRequest, + nsIDNSByTypeRecord* res, nsresult aStatus) { return NS_OK; } -PRStatus nsSOCKSSocketInfo::ConnectToProxy(PRFileDesc *fd) { +PRStatus nsSOCKSSocketInfo::ConnectToProxy(PRFileDesc* fd) { PRStatus status; nsresult rv; @@ -592,7 +592,7 @@ PRStatus nsSOCKSSocketInfo::ConnectToProxy(PRFileDesc *fd) { return WriteV5AuthRequest(); } -void nsSOCKSSocketInfo::FixupAddressFamily(PRFileDesc *fd, NetAddr *proxy) { +void nsSOCKSSocketInfo::FixupAddressFamily(PRFileDesc* fd, NetAddr* proxy) { int32_t proxyFamily = mInternalProxyAddr.raw.family; // Do nothing if the address family is already matched if (proxyFamily == mDestinationFamily) { @@ -609,10 +609,10 @@ void nsSOCKSSocketInfo::FixupAddressFamily(PRFileDesc *fd, NetAddr *proxy) { if (mDestinationFamily == AF_INET6 && !ipv6Supported) { proxy->inet6.family = AF_INET6; proxy->inet6.port = mInternalProxyAddr.inet.port; - uint8_t *proxyp = proxy->inet6.ip.u8; + uint8_t* proxyp = proxy->inet6.ip.u8; memset(proxyp, 0, 10); memset(proxyp + 10, 0xff, 2); - memcpy(proxyp + 12, (char *)&mInternalProxyAddr.inet.ip, 4); + memcpy(proxyp + 12, (char*)&mInternalProxyAddr.inet.ip, 4); // mDestinationFamily should not be updated return; } @@ -629,7 +629,7 @@ void nsSOCKSSocketInfo::FixupAddressFamily(PRFileDesc *fd, NetAddr *proxy) { } // Create a new FileDesc with a specified family - PRFileDesc *tmpfd = PR_OpenTCPSocket(proxyFamily); + PRFileDesc* tmpfd = PR_OpenTCPSocket(proxyFamily); if (!tmpfd) { return; } @@ -650,7 +650,7 @@ void nsSOCKSSocketInfo::FixupAddressFamily(PRFileDesc *fd, NetAddr *proxy) { mDestinationFamily = proxyFamily; } -PRStatus nsSOCKSSocketInfo::ContinueConnectingToProxy(PRFileDesc *fd, +PRStatus nsSOCKSSocketInfo::ContinueConnectingToProxy(PRFileDesc* fd, int16_t oflags) { PRStatus status; @@ -684,7 +684,7 @@ PRStatus nsSOCKSSocketInfo::WriteV4ConnectRequest() { return PR_FAILURE; } - NetAddr *addr = &mDestinationAddr; + NetAddr* addr = &mDestinationAddr; int32_t proxy_resolve; MOZ_ASSERT(mState == SOCKS_CONNECTING_TO_PROXY, "Invalid state!"); @@ -873,7 +873,7 @@ PRStatus nsSOCKSSocketInfo::ReadV5UsernameResponse() { PRStatus nsSOCKSSocketInfo::WriteV5ConnectRequest() { // Send SOCKS 5 connect request - NetAddr *addr = &mDestinationAddr; + NetAddr* addr = &mDestinationAddr; int32_t proxy_resolve; proxy_resolve = mFlags & nsISocketProvider::PROXY_RESOLVES_HOST; @@ -922,8 +922,8 @@ PRStatus nsSOCKSSocketInfo::WriteV5ConnectRequest() { return PR_SUCCESS; } -PRStatus nsSOCKSSocketInfo::ReadV5AddrTypeAndLength(uint8_t *type, - uint32_t *len) { +PRStatus nsSOCKSSocketInfo::ReadV5AddrTypeAndLength(uint8_t* type, + uint32_t* len) { MOZ_ASSERT(mState == SOCKS5_READ_CONNECT_RESPONSE_TOP || mState == SOCKS5_READ_CONNECT_RESPONSE_BOTTOM, "Invalid state!"); @@ -1071,7 +1071,7 @@ PRStatus nsSOCKSSocketInfo::ReadV5ConnectResponseBottom() { void nsSOCKSSocketInfo::SetConnectTimeout(PRIntervalTime to) { mTimeout = to; } -PRStatus nsSOCKSSocketInfo::DoHandshake(PRFileDesc *fd, int16_t oflags) { +PRStatus nsSOCKSSocketInfo::DoHandshake(PRFileDesc* fd, int16_t oflags) { LOGDEBUG(("socks: DoHandshake(), state = %d", mState)); switch (mState) { @@ -1197,9 +1197,9 @@ inline uint32_t nsSOCKSSocketInfo::ReadUint32() { return rv; } -void nsSOCKSSocketInfo::ReadNetAddr(NetAddr *addr, uint16_t fam) { +void nsSOCKSSocketInfo::ReadNetAddr(NetAddr* addr, uint16_t fam) { uint32_t amt = 0; - const uint8_t *ip = mData + mReadOffset; + const uint8_t* ip = mData + mReadOffset; addr->raw.family = fam; if (fam == AF_INET) { @@ -1217,7 +1217,7 @@ void nsSOCKSSocketInfo::ReadNetAddr(NetAddr *addr, uint16_t fam) { mReadOffset += amt; } -void nsSOCKSSocketInfo::ReadNetPort(NetAddr *addr) { +void nsSOCKSSocketInfo::ReadNetPort(NetAddr* addr) { addr->inet.port = ReadUint16(); } @@ -1228,9 +1228,9 @@ void nsSOCKSSocketInfo::WantRead(uint32_t sz) { mAmountToRead = sz; } -PRStatus nsSOCKSSocketInfo::ReadFromSocket(PRFileDesc *fd) { +PRStatus nsSOCKSSocketInfo::ReadFromSocket(PRFileDesc* fd) { int32_t rc; - const uint8_t *end; + const uint8_t* end; if (!mAmountToRead) { LOGDEBUG(("socks: ReadFromSocket(), nothing to do")); @@ -1272,9 +1272,9 @@ PRStatus nsSOCKSSocketInfo::ReadFromSocket(PRFileDesc *fd) { return PR_FAILURE; } -PRStatus nsSOCKSSocketInfo::WriteToSocket(PRFileDesc *fd) { +PRStatus nsSOCKSSocketInfo::WriteToSocket(PRFileDesc* fd) { int32_t rc; - const uint8_t *end; + const uint8_t* end; if (!mDataLength) { LOGDEBUG(("socks: WriteToSocket(), nothing to do")); @@ -1307,17 +1307,17 @@ PRStatus nsSOCKSSocketInfo::WriteToSocket(PRFileDesc *fd) { return PR_FAILURE; } -static PRStatus nsSOCKSIOLayerConnect(PRFileDesc *fd, const PRNetAddr *addr, +static PRStatus nsSOCKSIOLayerConnect(PRFileDesc* fd, const PRNetAddr* addr, PRIntervalTime to) { PRStatus status; NetAddr dst; - nsSOCKSSocketInfo *info = (nsSOCKSSocketInfo *)fd->secret; + nsSOCKSSocketInfo* info = (nsSOCKSSocketInfo*)fd->secret; if (info == nullptr) return PR_FAILURE; if (addr->raw.family == PR_AF_INET6 && PR_IsNetAddrType(addr, PR_IpAddrV4Mapped)) { - const uint8_t *srcp; + const uint8_t* srcp; LOGDEBUG(("socks: converting ipv4-mapped ipv6 address to ipv4")); @@ -1343,10 +1343,10 @@ static PRStatus nsSOCKSIOLayerConnect(PRFileDesc *fd, const PRNetAddr *addr, return status; } -static PRStatus nsSOCKSIOLayerConnectContinue(PRFileDesc *fd, int16_t oflags) { +static PRStatus nsSOCKSIOLayerConnectContinue(PRFileDesc* fd, int16_t oflags) { PRStatus status; - nsSOCKSSocketInfo *info = (nsSOCKSSocketInfo *)fd->secret; + nsSOCKSSocketInfo* info = (nsSOCKSSocketInfo*)fd->secret; if (info == nullptr) return PR_FAILURE; do { @@ -1356,9 +1356,9 @@ static PRStatus nsSOCKSIOLayerConnectContinue(PRFileDesc *fd, int16_t oflags) { return status; } -static int16_t nsSOCKSIOLayerPoll(PRFileDesc *fd, int16_t in_flags, - int16_t *out_flags) { - nsSOCKSSocketInfo *info = (nsSOCKSSocketInfo *)fd->secret; +static int16_t nsSOCKSIOLayerPoll(PRFileDesc* fd, int16_t in_flags, + int16_t* out_flags) { + nsSOCKSSocketInfo* info = (nsSOCKSSocketInfo*)fd->secret; if (info == nullptr) return PR_FAILURE; if (!info->IsConnected()) { @@ -1369,8 +1369,8 @@ static int16_t nsSOCKSIOLayerPoll(PRFileDesc *fd, int16_t in_flags, return fd->lower->methods->poll(fd->lower, in_flags, out_flags); } -static PRStatus nsSOCKSIOLayerClose(PRFileDesc *fd) { - nsSOCKSSocketInfo *info = (nsSOCKSSocketInfo *)fd->secret; +static PRStatus nsSOCKSIOLayerClose(PRFileDesc* fd) { + nsSOCKSSocketInfo* info = (nsSOCKSSocketInfo*)fd->secret; PRDescIdentity id = PR_GetLayersIdentity(fd); if (info && id == nsSOCKSIOLayerIdentity) { @@ -1382,14 +1382,14 @@ static PRStatus nsSOCKSIOLayerClose(PRFileDesc *fd) { return fd->lower->methods->close(fd->lower); } -static PRFileDesc *nsSOCKSIOLayerAccept(PRFileDesc *fd, PRNetAddr *addr, +static PRFileDesc* nsSOCKSIOLayerAccept(PRFileDesc* fd, PRNetAddr* addr, PRIntervalTime timeout) { // TODO: implement SOCKS support for accept return fd->lower->methods->accept(fd->lower, addr, timeout); } -static int32_t nsSOCKSIOLayerAcceptRead(PRFileDesc *sd, PRFileDesc **nd, - PRNetAddr **raddr, void *buf, +static int32_t nsSOCKSIOLayerAcceptRead(PRFileDesc* sd, PRFileDesc** nd, + PRNetAddr** raddr, void* buf, int32_t amount, PRIntervalTime timeout) { // TODO: implement SOCKS support for accept, then read from it @@ -1397,17 +1397,17 @@ static int32_t nsSOCKSIOLayerAcceptRead(PRFileDesc *sd, PRFileDesc **nd, timeout); } -static PRStatus nsSOCKSIOLayerBind(PRFileDesc *fd, const PRNetAddr *addr) { +static PRStatus nsSOCKSIOLayerBind(PRFileDesc* fd, const PRNetAddr* addr) { // TODO: implement SOCKS support for bind (very similar to connect) return fd->lower->methods->bind(fd->lower, addr); } -static PRStatus nsSOCKSIOLayerGetName(PRFileDesc *fd, PRNetAddr *addr) { - nsSOCKSSocketInfo *info = (nsSOCKSSocketInfo *)fd->secret; +static PRStatus nsSOCKSIOLayerGetName(PRFileDesc* fd, PRNetAddr* addr) { + nsSOCKSSocketInfo* info = (nsSOCKSSocketInfo*)fd->secret; if (info != nullptr && addr != nullptr) { NetAddr temp; - NetAddr *tempPtr = &temp; + NetAddr* tempPtr = &temp; if (info->GetExternalProxyAddr(&tempPtr) == NS_OK) { NetAddrToPRNetAddr(tempPtr, addr); return PR_SUCCESS; @@ -1417,12 +1417,12 @@ static PRStatus nsSOCKSIOLayerGetName(PRFileDesc *fd, PRNetAddr *addr) { return PR_FAILURE; } -static PRStatus nsSOCKSIOLayerGetPeerName(PRFileDesc *fd, PRNetAddr *addr) { - nsSOCKSSocketInfo *info = (nsSOCKSSocketInfo *)fd->secret; +static PRStatus nsSOCKSIOLayerGetPeerName(PRFileDesc* fd, PRNetAddr* addr) { + nsSOCKSSocketInfo* info = (nsSOCKSSocketInfo*)fd->secret; if (info != nullptr && addr != nullptr) { NetAddr temp; - NetAddr *tempPtr = &temp; + NetAddr* tempPtr = &temp; if (info->GetDestinationAddr(&tempPtr) == NS_OK) { NetAddrToPRNetAddr(tempPtr, addr); return PR_SUCCESS; @@ -1432,24 +1432,24 @@ static PRStatus nsSOCKSIOLayerGetPeerName(PRFileDesc *fd, PRNetAddr *addr) { return PR_FAILURE; } -static PRStatus nsSOCKSIOLayerListen(PRFileDesc *fd, int backlog) { +static PRStatus nsSOCKSIOLayerListen(PRFileDesc* fd, int backlog) { // TODO: implement SOCKS support for listen return fd->lower->methods->listen(fd->lower, backlog); } // add SOCKS IO layer to an existing socket -nsresult nsSOCKSIOLayerAddToSocket(int32_t family, const char *host, - int32_t port, nsIProxyInfo *proxy, +nsresult nsSOCKSIOLayerAddToSocket(int32_t family, const char* host, + int32_t port, nsIProxyInfo* proxy, int32_t socksVersion, uint32_t flags, - uint32_t tlsFlags, PRFileDesc *fd, - nsISupports **info) { + uint32_t tlsFlags, PRFileDesc* fd, + nsISupports** info) { NS_ENSURE_TRUE((socksVersion == 4) || (socksVersion == 5), NS_ERROR_NOT_INITIALIZED); if (firstTime) { // XXX hack until NSPR provides an official way to detect system IPv6 // support (bug 388519) - PRFileDesc *tmpfd = PR_OpenTCPSocket(PR_AF_INET6); + PRFileDesc* tmpfd = PR_OpenTCPSocket(PR_AF_INET6); if (!tmpfd) { ipv6Supported = false; } else { @@ -1478,7 +1478,7 @@ nsresult nsSOCKSIOLayerAddToSocket(int32_t family, const char *host, LOGDEBUG(("Entering nsSOCKSIOLayerAddToSocket().")); - PRFileDesc *layer; + PRFileDesc* layer; PRStatus rv; layer = PR_CreateIOLayerStub(nsSOCKSIOLayerIdentity, &nsSOCKSIOLayerMethods); @@ -1487,7 +1487,7 @@ nsresult nsSOCKSIOLayerAddToSocket(int32_t family, const char *host, return NS_ERROR_FAILURE; } - nsSOCKSSocketInfo *infoObject = new nsSOCKSSocketInfo(); + nsSOCKSSocketInfo* infoObject = new nsSOCKSSocketInfo(); if (!infoObject) { // clean up IOLayerStub LOGERROR(("Failed to create nsSOCKSSocketInfo().")); @@ -1497,7 +1497,7 @@ nsresult nsSOCKSIOLayerAddToSocket(int32_t family, const char *host, NS_ADDREF(infoObject); infoObject->Init(socksVersion, family, proxy, host, flags, tlsFlags); - layer->secret = (PRFilePrivate *)infoObject; + layer->secret = (PRFilePrivate*)infoObject; PRDescIdentity fdIdentity = PR_GetLayersIdentity(fd); #if defined(XP_WIN) @@ -1516,12 +1516,12 @@ nsresult nsSOCKSIOLayerAddToSocket(int32_t family, const char *host, return NS_ERROR_FAILURE; } - *info = static_cast(infoObject); + *info = static_cast(infoObject); NS_ADDREF(*info); return NS_OK; } -bool IsHostLocalTarget(const nsACString &aHost) { +bool IsHostLocalTarget(const nsACString& aHost) { #if defined(XP_UNIX) return StringBeginsWith(aHost, NS_LITERAL_CSTRING("file:")); #elif defined(XP_WIN) diff --git a/netwerk/socket/nsSOCKSIOLayer.h b/netwerk/socket/nsSOCKSIOLayer.h index b2a431d94b979..5b82f3827d57c 100644 --- a/netwerk/socket/nsSOCKSIOLayer.h +++ b/netwerk/socket/nsSOCKSIOLayer.h @@ -11,12 +11,12 @@ #include "nscore.h" #include "nsIProxyInfo.h" -nsresult nsSOCKSIOLayerAddToSocket(int32_t family, const char *host, - int32_t port, nsIProxyInfo *proxyInfo, +nsresult nsSOCKSIOLayerAddToSocket(int32_t family, const char* host, + int32_t port, nsIProxyInfo* proxyInfo, int32_t socksVersion, uint32_t flags, - uint32_t tlsFlags, PRFileDesc *fd, - nsISupports **info); + uint32_t tlsFlags, PRFileDesc* fd, + nsISupports** info); -bool IsHostLocalTarget(const nsACString &aHost); +bool IsHostLocalTarget(const nsACString& aHost); #endif /* nsSOCKSIOLayer_h__ */ diff --git a/netwerk/socket/nsSOCKSSocketProvider.cpp b/netwerk/socket/nsSOCKSSocketProvider.cpp index c20416b1df24d..d76e1413a9362 100644 --- a/netwerk/socket/nsSOCKSSocketProvider.cpp +++ b/netwerk/socket/nsSOCKSSocketProvider.cpp @@ -17,8 +17,8 @@ using mozilla::OriginAttributes; NS_IMPL_ISUPPORTS(nsSOCKSSocketProvider, nsISocketProvider) -nsresult nsSOCKSSocketProvider::CreateV4(nsISupports *aOuter, REFNSIID aIID, - void **aResult) { +nsresult nsSOCKSSocketProvider::CreateV4(nsISupports* aOuter, REFNSIID aIID, + void** aResult) { nsresult rv; nsCOMPtr inst = new nsSOCKSSocketProvider(NS_SOCKS_VERSION_4); @@ -29,8 +29,8 @@ nsresult nsSOCKSSocketProvider::CreateV4(nsISupports *aOuter, REFNSIID aIID, return rv; } -nsresult nsSOCKSSocketProvider::CreateV5(nsISupports *aOuter, REFNSIID aIID, - void **aResult) { +nsresult nsSOCKSSocketProvider::CreateV5(nsISupports* aOuter, REFNSIID aIID, + void** aResult) { nsresult rv; nsCOMPtr inst = new nsSOCKSSocketProvider(NS_SOCKS_VERSION_5); @@ -47,8 +47,8 @@ nsresult nsSOCKSSocketProvider::CreateV5(nsISupports *aOuter, REFNSIID aIID, #if defined(XP_WIN) // The proxy host on Windows may be a named pipe uri, in which // case a named-pipe (rather than a socket) should be returned -static PRFileDesc *OpenTCPSocket(int32_t family, nsIProxyInfo *proxy) { - PRFileDesc *sock = nullptr; +static PRFileDesc* OpenTCPSocket(int32_t family, nsIProxyInfo* proxy) { + PRFileDesc* sock = nullptr; nsAutoCString proxyHost; proxy->GetHost(proxyHost); @@ -69,7 +69,7 @@ static PRFileDesc *OpenTCPSocket(int32_t family, nsIProxyInfo *proxy) { // with the proper family, but we want to do it early here so that // we can enforce seccomp policy to blacklist socket(AF_INET) calls // to prevent the content sandbox from creating network requests -static PRFileDesc *OpenTCPSocket(int32_t family, nsIProxyInfo *proxy) { +static PRFileDesc* OpenTCPSocket(int32_t family, nsIProxyInfo* proxy) { nsAutoCString proxyHost; proxy->GetHost(proxyHost); if (StringBeginsWith(proxyHost, NS_LITERAL_CSTRING("file://"))) { @@ -80,18 +80,18 @@ static PRFileDesc *OpenTCPSocket(int32_t family, nsIProxyInfo *proxy) { } #else // Default, pass-through to PR_OpenTCPSocket -static PRFileDesc *OpenTCPSocket(int32_t family, nsIProxyInfo *) { +static PRFileDesc* OpenTCPSocket(int32_t family, nsIProxyInfo*) { return PR_OpenTCPSocket(family); } #endif NS_IMETHODIMP -nsSOCKSSocketProvider::NewSocket(int32_t family, const char *host, int32_t port, - nsIProxyInfo *proxy, - const OriginAttributes &originAttributes, +nsSOCKSSocketProvider::NewSocket(int32_t family, const char* host, int32_t port, + nsIProxyInfo* proxy, + const OriginAttributes& originAttributes, uint32_t flags, uint32_t tlsFlags, - PRFileDesc **result, nsISupports **socksInfo) { - PRFileDesc *sock = OpenTCPSocket(family, proxy); + PRFileDesc** result, nsISupports** socksInfo) { + PRFileDesc* sock = OpenTCPSocket(family, proxy); if (!sock) { return NS_ERROR_OUT_OF_MEMORY; } @@ -107,11 +107,11 @@ nsSOCKSSocketProvider::NewSocket(int32_t family, const char *host, int32_t port, } NS_IMETHODIMP -nsSOCKSSocketProvider::AddToSocket(int32_t family, const char *host, - int32_t port, nsIProxyInfo *proxy, - const OriginAttributes &originAttributes, +nsSOCKSSocketProvider::AddToSocket(int32_t family, const char* host, + int32_t port, nsIProxyInfo* proxy, + const OriginAttributes& originAttributes, uint32_t flags, uint32_t tlsFlags, - PRFileDesc *sock, nsISupports **socksInfo) { + PRFileDesc* sock, nsISupports** socksInfo) { nsresult rv = nsSOCKSIOLayerAddToSocket(family, host, port, proxy, mVersion, flags, tlsFlags, sock, socksInfo); diff --git a/netwerk/socket/nsSOCKSSocketProvider.h b/netwerk/socket/nsSOCKSSocketProvider.h index 7366863b2e0ab..7dc34dae603fa 100644 --- a/netwerk/socket/nsSOCKSSocketProvider.h +++ b/netwerk/socket/nsSOCKSSocketProvider.h @@ -19,8 +19,8 @@ class nsSOCKSSocketProvider : public nsISocketProvider { explicit nsSOCKSSocketProvider(uint32_t version) : mVersion(version) {} - static nsresult CreateV4(nsISupports *, REFNSIID aIID, void **aResult); - static nsresult CreateV5(nsISupports *, REFNSIID aIID, void **aResult); + static nsresult CreateV4(nsISupports*, REFNSIID aIID, void** aResult); + static nsresult CreateV5(nsISupports*, REFNSIID aIID, void** aResult); private: virtual ~nsSOCKSSocketProvider() = default; diff --git a/netwerk/socket/nsSocketProviderService.cpp b/netwerk/socket/nsSocketProviderService.cpp index dc75c5bf5a29e..87cc86d83932f 100644 --- a/netwerk/socket/nsSocketProviderService.cpp +++ b/netwerk/socket/nsSocketProviderService.cpp @@ -44,8 +44,8 @@ NS_IMPL_ISUPPORTS(nsSocketProviderService, nsISocketProviderService) //////////////////////////////////////////////////////////////////////////////// NS_IMETHODIMP -nsSocketProviderService::GetSocketProvider(const char *type, - nsISocketProvider **result) { +nsSocketProviderService::GetSocketProvider(const char* type, + nsISocketProvider** result) { nsCOMPtr inst; if (!nsCRT::strcmp(type, "ssl") && XRE_IsParentProcess() && EnsureNSSInitializedChromeOrContent()) { diff --git a/netwerk/socket/nsUDPSocketProvider.cpp b/netwerk/socket/nsUDPSocketProvider.cpp index b5b2f58626a32..c81a1614d5bb6 100644 --- a/netwerk/socket/nsUDPSocketProvider.cpp +++ b/netwerk/socket/nsUDPSocketProvider.cpp @@ -11,15 +11,15 @@ using mozilla::OriginAttributes; NS_IMPL_ISUPPORTS(nsUDPSocketProvider, nsISocketProvider) NS_IMETHODIMP -nsUDPSocketProvider::NewSocket(int32_t aFamily, const char *aHost, - int32_t aPort, nsIProxyInfo *aProxy, - const OriginAttributes &originAttributes, +nsUDPSocketProvider::NewSocket(int32_t aFamily, const char* aHost, + int32_t aPort, nsIProxyInfo* aProxy, + const OriginAttributes& originAttributes, uint32_t aFlags, uint32_t aTlsFlags, - PRFileDesc **aFileDesc, - nsISupports **aSecurityInfo) { + PRFileDesc** aFileDesc, + nsISupports** aSecurityInfo) { NS_ENSURE_ARG_POINTER(aFileDesc); - PRFileDesc *udpFD = PR_OpenUDPSocket(aFamily); + PRFileDesc* udpFD = PR_OpenUDPSocket(aFamily); if (!udpFD) return NS_ERROR_FAILURE; *aFileDesc = udpFD; @@ -27,12 +27,12 @@ nsUDPSocketProvider::NewSocket(int32_t aFamily, const char *aHost, } NS_IMETHODIMP -nsUDPSocketProvider::AddToSocket(int32_t aFamily, const char *aHost, - int32_t aPort, nsIProxyInfo *aProxy, - const OriginAttributes &originAttributes, +nsUDPSocketProvider::AddToSocket(int32_t aFamily, const char* aHost, + int32_t aPort, nsIProxyInfo* aProxy, + const OriginAttributes& originAttributes, uint32_t aFlags, uint32_t aTlsFlags, - struct PRFileDesc *aFileDesc, - nsISupports **aSecurityInfo) { + struct PRFileDesc* aFileDesc, + nsISupports** aSecurityInfo) { // does not make sense to strap a UDP socket onto an existing socket MOZ_ASSERT_UNREACHABLE("Cannot layer UDP socket on an existing socket"); return NS_ERROR_UNEXPECTED; diff --git a/netwerk/streamconv/converters/ParseFTPList.cpp b/netwerk/streamconv/converters/ParseFTPList.cpp index a87f8c3e1f74b..ea995c1685793 100644 --- a/netwerk/streamconv/converters/ParseFTPList.cpp +++ b/netwerk/streamconv/converters/ParseFTPList.cpp @@ -27,13 +27,13 @@ using mozilla::IsAsciiLowercaseAlpha; static const int kMaxFTPListLen = 32768; -static inline int ParsingFailed(struct list_state *state) { +static inline int ParsingFailed(struct list_state* state) { if (state->parsed_one || state->lstyle) /* junk if we fail to parse */ return '?'; /* this time but had previously parsed successfully */ return '"'; /* its part of a comment or error message */ } -void FixupYear(PRExplodedTime *aTime) { +void FixupYear(PRExplodedTime* aTime) { /* if year has only two digits then assume that 00-79 is 2000-2079 80-99 is 1980-1999 */ @@ -44,12 +44,12 @@ void FixupYear(PRExplodedTime *aTime) { } } -int ParseFTPList(const char *line, struct list_state *state, - struct list_result *result, PRTimeParamFn timeParam, +int ParseFTPList(const char* line, struct list_state* state, + struct list_result* result, PRTimeParamFn timeParam, NowTimeFn nowTimeFn) { unsigned int carry_buf_len; /* copy of state->carry_buf_len */ unsigned int pos; - const char *p; + const char* p; if (!line || !state || !result) return 0; @@ -77,8 +77,8 @@ int ParseFTPList(const char *line, struct list_state *state, } if (linelen > 0) { - static const char *month_names = "JanFebMarAprMayJunJulAugSepOctNovDec"; - const char *tokens[16]; /* 16 is more than enough */ + static const char* month_names = "JanFebMarAprMayJunJulAugSepOctNovDec"; + const char* tokens[16]; /* 16 is more than enough */ unsigned int toklen[(sizeof(tokens) / sizeof(tokens[0]))]; unsigned int linelen_sans_wsp; // line length sans whitespace unsigned int numtoks = 0; @@ -598,7 +598,7 @@ int ParseFTPList(const char *line, struct list_state *state, if ((/*newstyle*/ toklen[tokmarker + 4] == 10 && tokmarker > 1) || (/*oldstyle*/ toklen[tokmarker + 4] != 10 && tokmarker > 2)) { /* have a filetype column */ - char *dot; + char* dot; p = &(tokens[0][toklen[0]]); memcpy(&dot, &p, sizeof(dot)); /* NASTY! */ *dot++ = '.'; @@ -1033,8 +1033,8 @@ int ParseFTPList(const char *line, struct list_state *state, // Don't care about leading spaces when the date string has different // format or when old Hellsoft output was detected. { - const char *date_start = tokens[tokmarker + 1]; - const char *date_end = tokens[tokmarker + 3] + toklen[tokmarker + 3]; + const char* date_start = tokens[tokmarker + 1]; + const char* date_end = tokens[tokmarker + 3] + toklen[tokmarker + 3]; if (!is_old_Hellsoft && ((date_end - date_start) == 12 || ((date_end - date_start) == 11 && date_end[1] == ' '))) diff --git a/netwerk/streamconv/converters/ParseFTPList.h b/netwerk/streamconv/converters/ParseFTPList.h index ca5ef733870cd..610db04d31c8d 100644 --- a/netwerk/streamconv/converters/ParseFTPList.h +++ b/netwerk/streamconv/converters/ParseFTPList.h @@ -82,9 +82,9 @@ struct list_state { struct list_result { int32_t fe_type; /* 'd'(dir) or 'l'(link) or 'f'(file) */ - const char *fe_fname; /* pointer to filename */ + const char* fe_fname; /* pointer to filename */ uint32_t fe_fnlen; /* length of filename */ - const char *fe_lname; /* pointer to symlink name */ + const char* fe_lname; /* pointer to symlink name */ uint32_t fe_lnlen; /* length of symlink name */ char fe_size[40]; /* size of file in bytes (<= (2^128 - 1)) */ PRExplodedTime fe_time; /* last-modified time */ @@ -94,8 +94,8 @@ struct list_result { typedef PRTime (*NowTimeFn)(); -int ParseFTPList(const char *line, struct list_state *state, - struct list_result *result, +int ParseFTPList(const char* line, struct list_state* state, + struct list_result* result, PRTimeParamFn timeParam = PR_LocalTimeParameters, NowTimeFn nowTimeFn = PR_Now); diff --git a/netwerk/streamconv/converters/nsDirIndexParser.cpp b/netwerk/streamconv/converters/nsDirIndexParser.cpp index 0bbc2fc31e2bd..e38189e19c5d5 100644 --- a/netwerk/streamconv/converters/nsDirIndexParser.cpp +++ b/netwerk/streamconv/converters/nsDirIndexParser.cpp @@ -51,19 +51,19 @@ nsDirIndexParser::~nsDirIndexParser() { } NS_IMETHODIMP -nsDirIndexParser::SetListener(nsIDirIndexListener *aListener) { +nsDirIndexParser::SetListener(nsIDirIndexListener* aListener) { mListener = aListener; return NS_OK; } NS_IMETHODIMP -nsDirIndexParser::GetListener(nsIDirIndexListener **aListener) { +nsDirIndexParser::GetListener(nsIDirIndexListener** aListener) { NS_IF_ADDREF(*aListener = mListener.get()); return NS_OK; } NS_IMETHODIMP -nsDirIndexParser::GetComment(char **aComment) { +nsDirIndexParser::GetComment(char** aComment) { *aComment = ToNewCString(mComment); if (!*aComment) return NS_ERROR_OUT_OF_MEMORY; @@ -72,13 +72,13 @@ nsDirIndexParser::GetComment(char **aComment) { } NS_IMETHODIMP -nsDirIndexParser::SetEncoding(const char *aEncoding) { +nsDirIndexParser::SetEncoding(const char* aEncoding) { mEncoding.Assign(aEncoding); return NS_OK; } NS_IMETHODIMP -nsDirIndexParser::GetEncoding(char **aEncoding) { +nsDirIndexParser::GetEncoding(char** aEncoding) { *aEncoding = ToNewCString(mEncoding); if (!*aEncoding) return NS_ERROR_OUT_OF_MEMORY; @@ -87,10 +87,10 @@ nsDirIndexParser::GetEncoding(char **aEncoding) { } NS_IMETHODIMP -nsDirIndexParser::OnStartRequest(nsIRequest *aRequest) { return NS_OK; } +nsDirIndexParser::OnStartRequest(nsIRequest* aRequest) { return NS_OK; } NS_IMETHODIMP -nsDirIndexParser::OnStopRequest(nsIRequest *aRequest, nsresult aStatusCode) { +nsDirIndexParser::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) { // Finish up if (mBuf.Length() > (uint32_t)mLineStart) { ProcessData(aRequest, nullptr); @@ -109,9 +109,9 @@ nsDirIndexParser::Field nsDirIndexParser::gFieldTable[] = { {nullptr, FIELD_UNKNOWN}}; nsrefcnt nsDirIndexParser::gRefCntParser = 0; -nsITextToSubURI *nsDirIndexParser::gTextToSubURI; +nsITextToSubURI* nsDirIndexParser::gTextToSubURI; -nsresult nsDirIndexParser::ParseFormat(const char *aFormatStr) { +nsresult nsDirIndexParser::ParseFormat(const char* aFormatStr) { // Parse a "200" format line, and remember the fields and their // ordering in mFormat. Multiple 200 lines stomp on each other. unsigned int formatNum = 0; @@ -137,7 +137,7 @@ nsresult nsDirIndexParser::ParseFormat(const char *aFormatStr) { // http://www.mozilla.org/projects/netlib/dirindexformat.html if (name.LowerCaseEqualsLiteral("description")) mHasDescription = true; - for (Field *i = gFieldTable; i->mName; ++i) { + for (Field* i = gFieldTable; i->mName; ++i) { if (name.EqualsIgnoreCase(i->mName)) { mFormat[formatNum] = i->mType; mFormat[++formatNum] = -1; @@ -150,7 +150,7 @@ nsresult nsDirIndexParser::ParseFormat(const char *aFormatStr) { return NS_OK; } -nsresult nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char *aDataStr, +nsresult nsDirIndexParser::ParseData(nsIDirIndex* aIdx, char* aDataStr, int32_t aLineLen) { // Parse a "201" data line, using the field ordering specified in // mFormat. @@ -180,7 +180,7 @@ nsresult nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char *aDataStr, return NS_OK; } - char *value = aDataStr; + char* value = aDataStr; if (*aDataStr == '"' || *aDataStr == '\'') { // it's a quoted string. snarf everything up to the next quote character const char quotechar = *(aDataStr++); @@ -294,7 +294,7 @@ nsresult nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char *aDataStr, } NS_IMETHODIMP -nsDirIndexParser::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aStream, +nsDirIndexParser::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream, uint64_t aSourceOffset, uint32_t aCount) { if (aCount < 1) return NS_OK; @@ -318,8 +318,8 @@ nsDirIndexParser::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aStream, return ProcessData(aRequest, nullptr); } -nsresult nsDirIndexParser::ProcessData(nsIRequest *aRequest, - nsISupports *aCtxt) { +nsresult nsDirIndexParser::ProcessData(nsIRequest* aRequest, + nsISupports* aCtxt) { if (!mListener) return NS_ERROR_FAILURE; int32_t numItems = 0; @@ -331,14 +331,14 @@ nsresult nsDirIndexParser::ProcessData(nsIRequest *aRequest, if (eol < 0) break; mBuf.SetCharAt(char16_t('\0'), eol); - const char *line = mBuf.get() + mLineStart; + const char* line = mBuf.get() + mLineStart; int32_t lineLen = eol - mLineStart; mLineStart = eol + 1; if (lineLen >= 4) { nsresult rv; - const char *buf = line; + const char* buf = line; if (buf[0] == '1') { if (buf[1] == '0') { @@ -348,7 +348,7 @@ nsresult nsDirIndexParser::ProcessData(nsIRequest *aRequest, // 101. Human-readable information line. mComment.Append(buf + 4); - char *value = ((char *)buf) + 4; + char* value = ((char*)buf) + 4; nsUnescape(value); mListener->OnInformationAvailable(aRequest, aCtxt, NS_ConvertUTF8toUTF16(value)); @@ -370,7 +370,7 @@ nsresult nsDirIndexParser::ProcessData(nsIRequest *aRequest, // 201. Field data nsCOMPtr idx = new nsDirIndex(); - rv = ParseData(idx, ((char *)buf) + 4, lineLen - 4); + rv = ParseData(idx, ((char*)buf) + 4, lineLen - 4); if (NS_FAILED(rv)) { return rv; } diff --git a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp index fb3fd8129f2bd..af0093fd5c6c2 100644 --- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp +++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp @@ -42,19 +42,19 @@ NS_IMPL_ISUPPORTS(nsFTPDirListingConv, nsIStreamConverter, nsIStreamListener, // nsIStreamConverter implementation NS_IMETHODIMP -nsFTPDirListingConv::Convert(nsIInputStream *aFromStream, const char *aFromType, - const char *aToType, nsISupports *aCtxt, - nsIInputStream **_retval) { +nsFTPDirListingConv::Convert(nsIInputStream* aFromStream, const char* aFromType, + const char* aToType, nsISupports* aCtxt, + nsIInputStream** _retval) { return NS_ERROR_NOT_IMPLEMENTED; } // Stream converter service calls this to initialize the actual stream converter // (us). NS_IMETHODIMP -nsFTPDirListingConv::AsyncConvertData(const char *aFromType, - const char *aToType, - nsIStreamListener *aListener, - nsISupports *aCtxt) { +nsFTPDirListingConv::AsyncConvertData(const char* aFromType, + const char* aToType, + nsIStreamListener* aListener, + nsISupports* aCtxt) { NS_ASSERTION(aListener && aFromType && aToType, "null pointer passed into FTP dir listing converter"); @@ -72,7 +72,7 @@ nsFTPDirListingConv::AsyncConvertData(const char *aFromType, // nsIStreamListener implementation NS_IMETHODIMP -nsFTPDirListingConv::OnDataAvailable(nsIRequest *request, nsIInputStream *inStr, +nsFTPDirListingConv::OnDataAvailable(nsIRequest* request, nsIInputStream* inStr, uint64_t sourceOffset, uint32_t count) { NS_ASSERTION(request, "FTP dir listing stream converter needs a request"); @@ -131,7 +131,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest *request, nsIInputStream *inStr, mSentHeading = true; } - char *line = buffer.get(); + char* line = buffer.get(); line = DigestBufferLines(line, indexFormat); MOZ_LOG(gFTPDirListConvLog, LogLevel::Debug, @@ -160,14 +160,14 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest *request, nsIInputStream *inStr, // nsIRequestObserver implementation NS_IMETHODIMP -nsFTPDirListingConv::OnStartRequest(nsIRequest *request) { +nsFTPDirListingConv::OnStartRequest(nsIRequest* request) { // we don't care about start. move along... but start masqeurading // as the http-index channel now. return mFinalListener->OnStartRequest(request); } NS_IMETHODIMP -nsFTPDirListingConv::OnStopRequest(nsIRequest *request, nsresult aStatus) { +nsFTPDirListingConv::OnStopRequest(nsIRequest* request, nsresult aStatus) { // we don't care about stop. move along... return mFinalListener->OnStopRequest(request, aStatus); @@ -181,7 +181,7 @@ nsFTPDirListingConv::nsFTPDirListingConv() { nsFTPDirListingConv::~nsFTPDirListingConv() { NS_IF_RELEASE(mFinalListener); } -nsresult nsFTPDirListingConv::GetHeaders(nsACString &headers, nsIURI *uri) { +nsresult nsFTPDirListingConv::GetHeaders(nsACString& headers, nsIURI* uri) { nsresult rv = NS_OK; // build up 300 line headers.AppendLiteral("300: "); @@ -213,10 +213,10 @@ nsresult nsFTPDirListingConv::GetHeaders(nsACString &headers, nsIURI *uri) { return rv; } -char *nsFTPDirListingConv::DigestBufferLines(char *aBuffer, - nsCString &aString) { - char *line = aBuffer; - char *eol; +char* nsFTPDirListingConv::DigestBufferLines(char* aBuffer, + nsCString& aString) { + char* line = aBuffer; + char* eol; bool cr = false; list_state state; @@ -257,7 +257,7 @@ char *nsFTPDirListingConv::DigestBufferLines(char *aBuffer, // parsers for styles 'U' and 'W' handle sequence " -> " themself if (state.lstyle != 'U' && state.lstyle != 'W') { - const char *offset = strstr(result.fe_fname, " -> "); + const char* offset = strstr(result.fe_fname, " -> "); if (offset) { result.fe_fnlen = offset - result.fe_fname; } @@ -273,8 +273,8 @@ char *nsFTPDirListingConv::DigestBufferLines(char *aBuffer, // CONTENT LENGTH if (type != 'd') { - for (char &fe : result.fe_size) { - if (fe != '\0') aString.Append((const char *)&fe, 1); + for (char& fe : result.fe_size) { + if (fe != '\0') aString.Append((const char*)&fe, 1); } aString.Append(' '); @@ -325,7 +325,7 @@ char *nsFTPDirListingConv::DigestBufferLines(char *aBuffer, return line; } -nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv **aFTPDirListingConv) { +nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** aFTPDirListingConv) { MOZ_ASSERT(aFTPDirListingConv != nullptr, "null ptr"); if (!aFTPDirListingConv) return NS_ERROR_NULL_POINTER; diff --git a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp index 0bb7ee33846a4..6408a32eb0b87 100644 --- a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp +++ b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp @@ -79,15 +79,15 @@ nsHTTPCompressConv::~nsHTTPCompressConv() { } NS_IMETHODIMP -nsHTTPCompressConv::GetDecodedDataLength(uint64_t *aDecodedDataLength) { +nsHTTPCompressConv::GetDecodedDataLength(uint64_t* aDecodedDataLength) { *aDecodedDataLength = mDecodedDataLength; return NS_OK; } NS_IMETHODIMP -nsHTTPCompressConv::AsyncConvertData(const char *aFromType, const char *aToType, - nsIStreamListener *aListener, - nsISupports *aCtxt) { +nsHTTPCompressConv::AsyncConvertData(const char* aFromType, const char* aToType, + nsIStreamListener* aListener, + nsISupports* aCtxt) { if (!PL_strncasecmp(aFromType, HTTP_COMPRESS_TYPE, sizeof(HTTP_COMPRESS_TYPE) - 1) || !PL_strncasecmp(aFromType, HTTP_X_COMPRESS_TYPE, @@ -116,7 +116,7 @@ nsHTTPCompressConv::AsyncConvertData(const char *aFromType, const char *aToType, } NS_IMETHODIMP -nsHTTPCompressConv::OnStartRequest(nsIRequest *request) { +nsHTTPCompressConv::OnStartRequest(nsIRequest* request) { LOG(("nsHttpCompresssConv %p onstart\n", this)); nsCOMPtr listener; { @@ -127,7 +127,7 @@ nsHTTPCompressConv::OnStartRequest(nsIRequest *request) { } NS_IMETHODIMP -nsHTTPCompressConv::OnStopRequest(nsIRequest *request, nsresult aStatus) { +nsHTTPCompressConv::OnStopRequest(nsIRequest* request, nsresult aStatus) { nsresult status = aStatus; LOG(("nsHttpCompresssConv %p onstop %" PRIx32 "\n", this, static_cast(aStatus))); @@ -170,16 +170,16 @@ nsHTTPCompressConv::OnStopRequest(nsIRequest *request, nsresult aStatus) { } /* static */ -nsresult nsHTTPCompressConv::BrotliHandler(nsIInputStream *stream, - void *closure, const char *dataIn, +nsresult nsHTTPCompressConv::BrotliHandler(nsIInputStream* stream, + void* closure, const char* dataIn, uint32_t, uint32_t aAvail, - uint32_t *countRead) { + uint32_t* countRead) { MOZ_ASSERT(stream); - nsHTTPCompressConv *self = static_cast(closure); + nsHTTPCompressConv* self = static_cast(closure); *countRead = 0; const size_t kOutSize = 128 * 1024; // just a chunk size, we call in a loop - uint8_t *outPtr; + uint8_t* outPtr; size_t outSize; size_t avail = aAvail; BrotliDecoderResult res; @@ -204,7 +204,7 @@ nsresult nsHTTPCompressConv::BrotliHandler(nsIInputStream *stream, size_t totalOut = self->mBrotli->mTotalOut; res = ::BrotliDecoderDecompressStream( &self->mBrotli->mState, &avail, - reinterpret_cast(&dataIn), &outSize, &outPtr, + reinterpret_cast(&dataIn), &outSize, &outPtr, &totalOut); outSize = kOutSize - outSize; self->mBrotli->mTotalOut = totalOut; @@ -234,7 +234,7 @@ nsresult nsHTTPCompressConv::BrotliHandler(nsIInputStream *stream, nsresult rv = self->do_OnDataAvailable( self->mBrotli->mRequest, self->mBrotli->mContext, self->mBrotli->mSourceOffset, - reinterpret_cast(outBuffer.get()), outSize); + reinterpret_cast(outBuffer.get()), outSize); LOG(("nsHttpCompressConv %p BrotliHandler ODA rv=%" PRIx32, self, static_cast(rv))); if (NS_FAILED(rv)) { @@ -256,7 +256,7 @@ nsresult nsHTTPCompressConv::BrotliHandler(nsIInputStream *stream, } NS_IMETHODIMP -nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, +nsHTTPCompressConv::OnDataAvailable(nsIRequest* request, nsIInputStream* iStr, uint64_t aSourceOffset, uint32_t aCount) { nsresult rv = NS_ERROR_INVALID_CONTENT_ENCODING; uint32_t streamLen = aCount; @@ -292,15 +292,15 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, case HTTP_COMPRESS_DEFLATE: if (mInpBuffer != nullptr && streamLen > mInpBufferLen) { - unsigned char *originalInpBuffer = mInpBuffer; - if (!(mInpBuffer = (unsigned char *)realloc( + unsigned char* originalInpBuffer = mInpBuffer; + if (!(mInpBuffer = (unsigned char*)realloc( originalInpBuffer, mInpBufferLen = streamLen))) { free(originalInpBuffer); } if (mOutBufferLen < streamLen * 2) { - unsigned char *originalOutBuffer = mOutBuffer; - if (!(mOutBuffer = (unsigned char *)realloc( + unsigned char* originalOutBuffer = mOutBuffer; + if (!(mOutBuffer = (unsigned char*)realloc( mOutBuffer, mOutBufferLen = streamLen * 3))) { free(originalOutBuffer); } @@ -312,11 +312,11 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, } if (mInpBuffer == nullptr) { - mInpBuffer = (unsigned char *)malloc(mInpBufferLen = streamLen); + mInpBuffer = (unsigned char*)malloc(mInpBufferLen = streamLen); } if (mOutBuffer == nullptr) { - mOutBuffer = (unsigned char *)malloc(mOutBufferLen = streamLen * 3); + mOutBuffer = (unsigned char*)malloc(mOutBufferLen = streamLen * 3); } if (mInpBuffer == nullptr || mOutBuffer == nullptr) { @@ -324,7 +324,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, } uint32_t unused; - iStr->Read((char *)mInpBuffer, streamLen, &unused); + iStr->Read((char*)mInpBuffer, streamLen, &unused); if (mMode == HTTP_COMPRESS_DEFLATE) { if (!mStreamInitialized) { @@ -350,7 +350,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, if (code == Z_STREAM_END) { if (bytesWritten) { rv = do_OnDataAvailable(request, nullptr, aSourceOffset, - (char *)mOutBuffer, bytesWritten); + (char*)mOutBuffer, bytesWritten); if (NS_FAILED(rv)) { return rv; } @@ -362,7 +362,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, } else if (code == Z_OK) { if (bytesWritten) { rv = do_OnDataAvailable(request, nullptr, aSourceOffset, - (char *)mOutBuffer, bytesWritten); + (char*)mOutBuffer, bytesWritten); if (NS_FAILED(rv)) { return rv; } @@ -370,7 +370,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, } else if (code == Z_BUF_ERROR) { if (bytesWritten) { rv = do_OnDataAvailable(request, nullptr, aSourceOffset, - (char *)mOutBuffer, bytesWritten); + (char*)mOutBuffer, bytesWritten); if (NS_FAILED(rv)) { return rv; } @@ -384,7 +384,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, (((0x8 + 0x7 * 0x10) * 0x100 + 30) / 31 * 31) & 0xFF, }; inflateReset(&d_stream); - d_stream.next_in = (Bytef *)dummy_head; + d_stream.next_in = (Bytef*)dummy_head; d_stream.avail_in = sizeof(dummy_head); code = inflate(&d_stream, Z_NO_FLUSH); @@ -432,7 +432,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, if (code == Z_STREAM_END) { if (bytesWritten) { rv = do_OnDataAvailable(request, nullptr, aSourceOffset, - (char *)mOutBuffer, bytesWritten); + (char*)mOutBuffer, bytesWritten); if (NS_FAILED(rv)) { return rv; } @@ -444,7 +444,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, } else if (code == Z_OK) { if (bytesWritten) { rv = do_OnDataAvailable(request, nullptr, aSourceOffset, - (char *)mOutBuffer, bytesWritten); + (char*)mOutBuffer, bytesWritten); if (NS_FAILED(rv)) { return rv; } @@ -452,7 +452,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, } else if (code == Z_BUF_ERROR) { if (bytesWritten) { rv = do_OnDataAvailable(request, nullptr, aSourceOffset, - (char *)mOutBuffer, bytesWritten); + (char*)mOutBuffer, bytesWritten); if (NS_FAILED(rv)) { return rv; } @@ -502,16 +502,16 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsIInputStream *iStr, // XXX/ruslan: need to implement this too NS_IMETHODIMP -nsHTTPCompressConv::Convert(nsIInputStream *aFromStream, const char *aFromType, - const char *aToType, nsISupports *aCtxt, - nsIInputStream **_retval) { +nsHTTPCompressConv::Convert(nsIInputStream* aFromStream, const char* aFromType, + const char* aToType, nsISupports* aCtxt, + nsIInputStream** _retval) { return NS_ERROR_NOT_IMPLEMENTED; } -nsresult nsHTTPCompressConv::do_OnDataAvailable(nsIRequest *request, - nsISupports *context, +nsresult nsHTTPCompressConv::do_OnDataAvailable(nsIRequest* request, + nsISupports* context, uint64_t offset, - const char *buffer, + const char* buffer, uint32_t count) { if (!mStream) { mStream = do_CreateInstance(NS_STRINGINPUTSTREAM_CONTRACTID); @@ -544,8 +544,8 @@ nsresult nsHTTPCompressConv::do_OnDataAvailable(nsIRequest *request, static unsigned gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ -uint32_t nsHTTPCompressConv::check_header(nsIInputStream *iStr, - uint32_t streamLen, nsresult *rs) { +uint32_t nsHTTPCompressConv::check_header(nsIInputStream* iStr, + uint32_t streamLen, nsresult* rs) { enum { GZIP_INIT = 0, GZIP_OS, @@ -699,7 +699,7 @@ nsHTTPCompressConv::CheckListenerChain() { } // namespace mozilla nsresult NS_NewHTTPCompressConv( - mozilla::net::nsHTTPCompressConv **aHTTPCompressConv) { + mozilla::net::nsHTTPCompressConv** aHTTPCompressConv) { MOZ_ASSERT(aHTTPCompressConv != nullptr, "null ptr"); if (!aHTTPCompressConv) { return NS_ERROR_NULL_POINTER; diff --git a/netwerk/streamconv/converters/nsHTTPCompressConv.h b/netwerk/streamconv/converters/nsHTTPCompressConv.h index 3b35a3506d610..0f2bf044a6499 100644 --- a/netwerk/streamconv/converters/nsHTTPCompressConv.h +++ b/netwerk/streamconv/converters/nsHTTPCompressConv.h @@ -70,8 +70,8 @@ class BrotliWrapper { nsresult mStatus; Atomic mBrotliStateIsStreamEnd; - nsIRequest *mRequest; - nsISupports *mContext; + nsIRequest* mRequest; + nsISupports* mContext; uint64_t mSourceOffset; }; @@ -98,8 +98,8 @@ class nsHTTPCompressConv : public nsIStreamConverter, mListener; // this guy gets the converted data via his OnDataAvailable () Atomic mMode; - unsigned char *mOutBuffer; - unsigned char *mInpBuffer; + unsigned char* mOutBuffer; + unsigned char* mInpBuffer; uint32_t mOutBufferLen; uint32_t mInpBufferLen; @@ -108,12 +108,12 @@ class nsHTTPCompressConv : public nsIStreamConverter, nsCOMPtr mStream; - static nsresult BrotliHandler(nsIInputStream *stream, void *closure, - const char *dataIn, uint32_t, uint32_t avail, - uint32_t *countRead); + static nsresult BrotliHandler(nsIInputStream* stream, void* closure, + const char* dataIn, uint32_t, uint32_t avail, + uint32_t* countRead); - nsresult do_OnDataAvailable(nsIRequest *request, nsISupports *aContext, - uint64_t aSourceOffset, const char *buffer, + nsresult do_OnDataAvailable(nsIRequest* request, nsISupports* aContext, + uint64_t aSourceOffset, const char* buffer, uint32_t aCount); bool mCheckHeaderDone; @@ -125,7 +125,7 @@ class nsHTTPCompressConv : public nsIStreamConverter, z_stream d_stream; unsigned mLen, hMode, mSkipCount, mFlags; - uint32_t check_header(nsIInputStream *iStr, uint32_t streamLen, nsresult *rv); + uint32_t check_header(nsIInputStream* iStr, uint32_t streamLen, nsresult* rv); Atomic mDecodedDataLength; diff --git a/netwerk/streamconv/converters/nsIndexedToHTML.h b/netwerk/streamconv/converters/nsIndexedToHTML.h index 14e2a6c5b6948..6173ecb523085 100644 --- a/netwerk/streamconv/converters/nsIndexedToHTML.h +++ b/netwerk/streamconv/converters/nsIndexedToHTML.h @@ -31,17 +31,17 @@ class nsIndexedToHTML : public nsIStreamConverter, public nsIDirIndexListener { nsIndexedToHTML(); - nsresult Init(nsIStreamListener *aListener); + nsresult Init(nsIStreamListener* aListener); - static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); + static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult); protected: - void FormatSizeString(int64_t inSize, nsCString &outSizeString); - nsresult SendToListener(nsIRequest *aRequest, nsISupports *aContext, - const nsACString &aBuffer); + void FormatSizeString(int64_t inSize, nsCString& outSizeString); + nsresult SendToListener(nsIRequest* aRequest, nsISupports* aContext, + const nsACString& aBuffer); // Helper to properly implement OnStartRequest - nsresult DoOnStartRequest(nsIRequest *request, nsISupports *aContext, - nsCString &aBuffer); + nsresult DoOnStartRequest(nsIRequest* request, nsISupports* aContext, + nsCString& aBuffer); protected: nsCOMPtr mParser; diff --git a/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/netwerk/streamconv/converters/nsMultiMixedConv.cpp index d8b686f50cadc..b837c1926d266 100644 --- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -22,8 +22,8 @@ #include "nsHttpHeaderArray.h" #include "mozilla/AutoRestore.h" -nsPartChannel::nsPartChannel(nsIChannel *aMultipartChannel, uint32_t aPartID, - nsIStreamListener *aListener) +nsPartChannel::nsPartChannel(nsIChannel* aMultipartChannel, uint32_t aPartID, + nsIStreamListener* aListener) : mMultipartChannel(aMultipartChannel), mListener(aListener), mStatus(NS_OK), @@ -48,17 +48,17 @@ void nsPartChannel::InitializeByteRange(int64_t aStart, int64_t aEnd) { mByteRangeEnd = aEnd; } -nsresult nsPartChannel::SendOnStartRequest(nsISupports *aContext) { +nsresult nsPartChannel::SendOnStartRequest(nsISupports* aContext) { return mListener->OnStartRequest(this); } -nsresult nsPartChannel::SendOnDataAvailable(nsISupports *aContext, - nsIInputStream *aStream, +nsresult nsPartChannel::SendOnDataAvailable(nsISupports* aContext, + nsIInputStream* aStream, uint64_t aOffset, uint32_t aLen) { return mListener->OnDataAvailable(this, aStream, aOffset, aLen); } -nsresult nsPartChannel::SendOnStopRequest(nsISupports *aContext, +nsresult nsPartChannel::SendOnStopRequest(nsISupports* aContext, nsresult aStatus) { // Drop the listener nsCOMPtr listener; @@ -67,7 +67,7 @@ nsresult nsPartChannel::SendOnStopRequest(nsISupports *aContext, } void nsPartChannel::SetContentDisposition( - const nsACString &aContentDispositionHeader) { + const nsACString& aContentDispositionHeader) { mContentDispositionHeader = aContentDispositionHeader; nsCOMPtr uri; GetURI(getter_AddRefs(uri)); @@ -97,12 +97,12 @@ NS_INTERFACE_MAP_END // NS_IMETHODIMP -nsPartChannel::GetName(nsACString &aResult) { +nsPartChannel::GetName(nsACString& aResult) { return mMultipartChannel->GetName(aResult); } NS_IMETHODIMP -nsPartChannel::IsPending(bool *aResult) { +nsPartChannel::IsPending(bool* aResult) { // For now, consider the active lifetime of each part the same as // the underlying multipart channel... This is not exactly right, // but it is good enough :-) @@ -110,7 +110,7 @@ nsPartChannel::IsPending(bool *aResult) { } NS_IMETHODIMP -nsPartChannel::GetStatus(nsresult *aResult) { +nsPartChannel::GetStatus(nsresult* aResult) { nsresult rv = NS_OK; if (NS_FAILED(mStatus)) { @@ -152,20 +152,20 @@ nsPartChannel::Resume(void) { // NS_IMETHODIMP -nsPartChannel::GetOriginalURI(nsIURI **aURI) { +nsPartChannel::GetOriginalURI(nsIURI** aURI) { return mMultipartChannel->GetOriginalURI(aURI); } NS_IMETHODIMP -nsPartChannel::SetOriginalURI(nsIURI *aURI) { +nsPartChannel::SetOriginalURI(nsIURI* aURI) { return mMultipartChannel->SetOriginalURI(aURI); } NS_IMETHODIMP -nsPartChannel::GetURI(nsIURI **aURI) { return mMultipartChannel->GetURI(aURI); } +nsPartChannel::GetURI(nsIURI** aURI) { return mMultipartChannel->GetURI(aURI); } NS_IMETHODIMP -nsPartChannel::Open(nsIInputStream **aStream) { +nsPartChannel::Open(nsIInputStream** aStream) { nsCOMPtr listener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); @@ -176,7 +176,7 @@ nsPartChannel::Open(nsIInputStream **aStream) { } NS_IMETHODIMP -nsPartChannel::AsyncOpen(nsIStreamListener *aListener) { +nsPartChannel::AsyncOpen(nsIStreamListener* aListener) { nsCOMPtr listener = aListener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); @@ -187,7 +187,7 @@ nsPartChannel::AsyncOpen(nsIStreamListener *aListener) { } NS_IMETHODIMP -nsPartChannel::GetLoadFlags(nsLoadFlags *aLoadFlags) { +nsPartChannel::GetLoadFlags(nsLoadFlags* aLoadFlags) { *aLoadFlags = mLoadFlags; return NS_OK; } @@ -199,12 +199,12 @@ nsPartChannel::SetLoadFlags(nsLoadFlags aLoadFlags) { } NS_IMETHODIMP -nsPartChannel::GetIsDocument(bool *aIsDocument) { +nsPartChannel::GetIsDocument(bool* aIsDocument) { return NS_GetIsDocumentChannel(this, aIsDocument); } NS_IMETHODIMP -nsPartChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) { +nsPartChannel::GetLoadGroup(nsILoadGroup** aLoadGroup) { *aLoadGroup = mLoadGroup; NS_IF_ADDREF(*aLoadGroup); @@ -212,75 +212,75 @@ nsPartChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) { } NS_IMETHODIMP -nsPartChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) { +nsPartChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) { mLoadGroup = aLoadGroup; return NS_OK; } NS_IMETHODIMP -nsPartChannel::GetOwner(nsISupports **aOwner) { +nsPartChannel::GetOwner(nsISupports** aOwner) { return mMultipartChannel->GetOwner(aOwner); } NS_IMETHODIMP -nsPartChannel::SetOwner(nsISupports *aOwner) { +nsPartChannel::SetOwner(nsISupports* aOwner) { return mMultipartChannel->SetOwner(aOwner); } NS_IMETHODIMP -nsPartChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) { +nsPartChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) { return mMultipartChannel->GetLoadInfo(aLoadInfo); } NS_IMETHODIMP -nsPartChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) { +nsPartChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) { MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null"); return mMultipartChannel->SetLoadInfo(aLoadInfo); } NS_IMETHODIMP -nsPartChannel::GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks) { +nsPartChannel::GetNotificationCallbacks(nsIInterfaceRequestor** aCallbacks) { return mMultipartChannel->GetNotificationCallbacks(aCallbacks); } NS_IMETHODIMP -nsPartChannel::SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) { +nsPartChannel::SetNotificationCallbacks(nsIInterfaceRequestor* aCallbacks) { return mMultipartChannel->SetNotificationCallbacks(aCallbacks); } NS_IMETHODIMP -nsPartChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { +nsPartChannel::GetSecurityInfo(nsISupports** aSecurityInfo) { return mMultipartChannel->GetSecurityInfo(aSecurityInfo); } NS_IMETHODIMP -nsPartChannel::GetContentType(nsACString &aContentType) { +nsPartChannel::GetContentType(nsACString& aContentType) { aContentType = mContentType; return NS_OK; } NS_IMETHODIMP -nsPartChannel::SetContentType(const nsACString &aContentType) { +nsPartChannel::SetContentType(const nsACString& aContentType) { bool dummy; net_ParseContentType(aContentType, mContentType, mContentCharset, &dummy); return NS_OK; } NS_IMETHODIMP -nsPartChannel::GetContentCharset(nsACString &aContentCharset) { +nsPartChannel::GetContentCharset(nsACString& aContentCharset) { aContentCharset = mContentCharset; return NS_OK; } NS_IMETHODIMP -nsPartChannel::SetContentCharset(const nsACString &aContentCharset) { +nsPartChannel::SetContentCharset(const nsACString& aContentCharset) { mContentCharset = aContentCharset; return NS_OK; } NS_IMETHODIMP -nsPartChannel::GetContentLength(int64_t *aContentLength) { +nsPartChannel::GetContentLength(int64_t* aContentLength) { *aContentLength = mContentLength; return NS_OK; } @@ -292,7 +292,7 @@ nsPartChannel::SetContentLength(int64_t aContentLength) { } NS_IMETHODIMP -nsPartChannel::GetContentDisposition(uint32_t *aContentDisposition) { +nsPartChannel::GetContentDisposition(uint32_t* aContentDisposition) { if (mContentDispositionHeader.IsEmpty()) return NS_ERROR_NOT_AVAILABLE; *aContentDisposition = mContentDisposition; @@ -306,7 +306,7 @@ nsPartChannel::SetContentDisposition(uint32_t aContentDisposition) { NS_IMETHODIMP nsPartChannel::GetContentDispositionFilename( - nsAString &aContentDispositionFilename) { + nsAString& aContentDispositionFilename) { if (mContentDispositionFilename.IsEmpty()) return NS_ERROR_NOT_AVAILABLE; aContentDispositionFilename = mContentDispositionFilename; @@ -315,13 +315,13 @@ nsPartChannel::GetContentDispositionFilename( NS_IMETHODIMP nsPartChannel::SetContentDispositionFilename( - const nsAString &aContentDispositionFilename) { + const nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsPartChannel::GetContentDispositionHeader( - nsACString &aContentDispositionHeader) { + nsACString& aContentDispositionHeader) { if (mContentDispositionHeader.IsEmpty()) return NS_ERROR_NOT_AVAILABLE; aContentDispositionHeader = mContentDispositionHeader; @@ -329,13 +329,13 @@ nsPartChannel::GetContentDispositionHeader( } NS_IMETHODIMP -nsPartChannel::GetPartID(uint32_t *aPartID) { +nsPartChannel::GetPartID(uint32_t* aPartID) { *aPartID = mPartID; return NS_OK; } NS_IMETHODIMP -nsPartChannel::GetIsLastPart(bool *aIsLastPart) { +nsPartChannel::GetIsLastPart(bool* aIsLastPart) { *aIsLastPart = mIsLastPart; return NS_OK; } @@ -345,27 +345,27 @@ nsPartChannel::GetIsLastPart(bool *aIsLastPart) { // NS_IMETHODIMP -nsPartChannel::GetIsByteRangeRequest(bool *aIsByteRangeRequest) { +nsPartChannel::GetIsByteRangeRequest(bool* aIsByteRangeRequest) { *aIsByteRangeRequest = mIsByteRangeRequest; return NS_OK; } NS_IMETHODIMP -nsPartChannel::GetStartRange(int64_t *aStartRange) { +nsPartChannel::GetStartRange(int64_t* aStartRange) { *aStartRange = mByteRangeStart; return NS_OK; } NS_IMETHODIMP -nsPartChannel::GetEndRange(int64_t *aEndRange) { +nsPartChannel::GetEndRange(int64_t* aEndRange) { *aEndRange = mByteRangeEnd; return NS_OK; } NS_IMETHODIMP -nsPartChannel::GetBaseChannel(nsIChannel **aReturn) { +nsPartChannel::GetBaseChannel(nsIChannel** aReturn) { NS_ENSURE_ARG_POINTER(aReturn); *aReturn = mMultipartChannel; @@ -381,18 +381,18 @@ NS_IMPL_ISUPPORTS(nsMultiMixedConv, nsIStreamConverter, nsIStreamListener, // No syncronous conversion at this time. NS_IMETHODIMP -nsMultiMixedConv::Convert(nsIInputStream *aFromStream, const char *aFromType, - const char *aToType, nsISupports *aCtxt, - nsIInputStream **_retval) { +nsMultiMixedConv::Convert(nsIInputStream* aFromStream, const char* aFromType, + const char* aToType, nsISupports* aCtxt, + nsIInputStream** _retval) { return NS_ERROR_NOT_IMPLEMENTED; } // Stream converter service calls this to initialize the actual stream converter // (us). NS_IMETHODIMP -nsMultiMixedConv::AsyncConvertData(const char *aFromType, const char *aToType, - nsIStreamListener *aListener, - nsISupports *aCtxt) { +nsMultiMixedConv::AsyncConvertData(const char* aFromType, const char* aToType, + nsIStreamListener* aListener, + nsISupports* aCtxt) { NS_ASSERTION(aListener && aFromType && aToType, "null pointer passed into multi mixed converter"); @@ -409,7 +409,7 @@ nsMultiMixedConv::AsyncConvertData(const char *aFromType, const char *aToType, // nsIRequestObserver implementation NS_IMETHODIMP -nsMultiMixedConv::OnStartRequest(nsIRequest *request) { +nsMultiMixedConv::OnStartRequest(nsIRequest* request) { // we're assuming the content-type is available at this stage NS_ASSERTION(mBoundary.IsEmpty(), "a second on start???"); @@ -495,7 +495,7 @@ nsMultiMixedConv::OnStartRequest(nsIRequest *request) { // nsIStreamListener implementation NS_IMETHODIMP -nsMultiMixedConv::OnDataAvailable(nsIRequest *request, nsIInputStream *inStr, +nsMultiMixedConv::OnDataAvailable(nsIRequest* request, nsIInputStream* inStr, uint64_t sourceOffset, uint32_t count) { // Failing these assertions may indicate that some of the target listeners of // this converter is looping the thead queue, which is harmful to how we @@ -523,7 +523,7 @@ nsMultiMixedConv::OnDataAvailable(nsIRequest *request, nsIInputStream *inStr, } NS_IMETHODIMP -nsMultiMixedConv::OnStopRequest(nsIRequest *request, nsresult aStatus) { +nsMultiMixedConv::OnStopRequest(nsIRequest* request, nsresult aStatus) { nsresult rv; if (mBoundary.IsEmpty()) { // no token, no love. @@ -558,7 +558,7 @@ nsMultiMixedConv::OnStopRequest(nsIRequest *request, nsresult aStatus) { return NS_OK; } -nsresult nsMultiMixedConv::ConsumeToken(Token const &token) { +nsresult nsMultiMixedConv::ConsumeToken(Token const& token) { nsresult rv; switch (mParserState) { @@ -794,7 +794,7 @@ nsresult nsMultiMixedConv::SendStart() { // before starting up another "part." that would be bad. MOZ_ASSERT(!mPartChannel, "tisk tisk, shouldn't be overwriting a channel"); - nsPartChannel *newChannel; + nsPartChannel* newChannel; newChannel = new nsPartChannel(mChannel, mCurrentPartID++, partListener); if (!newChannel) return NS_ERROR_OUT_OF_MEMORY; @@ -866,7 +866,7 @@ nsresult nsMultiMixedConv::SendStop(nsresult aStatus) { return rv; } -void nsMultiMixedConv::AccumulateData(Token const &aToken) { +void nsMultiMixedConv::AccumulateData(Token const& aToken) { if (!mRawData) { // This is the first read of raw data during this FeedInput loop // of the incremental tokenizer. All 'raw' tokens are coming from @@ -1009,7 +1009,7 @@ nsresult nsMultiMixedConv::ProcessHeader() { return NS_OK; } -nsresult NS_NewMultiMixedConv(nsMultiMixedConv **aMultiMixedConv) { +nsresult NS_NewMultiMixedConv(nsMultiMixedConv** aMultiMixedConv) { MOZ_ASSERT(aMultiMixedConv != nullptr, "null ptr"); if (!aMultiMixedConv) return NS_ERROR_NULL_POINTER; diff --git a/netwerk/streamconv/nsStreamConverterService.cpp b/netwerk/streamconv/nsStreamConverterService.cpp index c7c4d51dd89e8..a90235350ac7a 100644 --- a/netwerk/streamconv/nsStreamConverterService.cpp +++ b/netwerk/streamconv/nsStreamConverterService.cpp @@ -33,7 +33,7 @@ struct BFSTableData { int32_t distance; nsAutoPtr predecessor; - explicit BFSTableData(const nsACString &aKey) + explicit BFSTableData(const nsACString& aKey) : key(aKey), color(white), distance(-1) {} }; @@ -106,7 +106,7 @@ nsresult nsStreamConverterService::BuildGraph() { // It's // XXX not programatically prohibited, it's just that results are un-predictable // XXX right now. -nsresult nsStreamConverterService::AddAdjacency(const char *aContractID) { +nsresult nsStreamConverterService::AddAdjacency(const char* aContractID) { nsresult rv; // first parse out the FROM and TO MIME-types. @@ -117,7 +117,7 @@ nsresult nsStreamConverterService::AddAdjacency(const char *aContractID) { // Each MIME-type is a vertex in the graph, so first lets make sure // each MIME-type is represented as a key in our hashtable. - nsTArray> *fromEdges = mAdjacencyList.Get(fromStr); + nsTArray>* fromEdges = mAdjacencyList.Get(fromStr); if (!fromEdges) { // There is no fromStr vertex, create one. fromEdges = new nsTArray>(); @@ -141,9 +141,9 @@ nsresult nsStreamConverterService::AddAdjacency(const char *aContractID) { return fromEdges->AppendElement(vertex) ? NS_OK : NS_ERROR_FAILURE; } -nsresult nsStreamConverterService::ParseFromTo(const char *aContractID, - nsCString &aFromRes, - nsCString &aToRes) { +nsresult nsStreamConverterService::ParseFromTo(const char* aContractID, + nsCString& aFromRes, + nsCString& aToRes) { nsAutoCString ContractIDStr(aContractID); int32_t fromLoc = ContractIDStr.Find("from="); @@ -170,8 +170,8 @@ typedef nsClassHashtable BFSHashTable; class CStreamConvDeallocator : public nsDequeFunctor { public: - void operator()(void *anObject) override { - nsCString *string = (nsCString *)anObject; + void operator()(void* anObject) override { + nsCString* string = (nsCString*)anObject; delete string; } }; @@ -183,7 +183,7 @@ class CStreamConvDeallocator : public nsDequeFunctor { // to calling this method in an attempt to find a direct converter rather than // walking the graph. nsresult nsStreamConverterService::FindConverter( - const char *aContractID, nsTArray **aEdgeList) { + const char* aContractID, nsTArray** aEdgeList) { nsresult rv; if (!aEdgeList) return NS_ERROR_NULL_POINTER; *aEdgeList = nullptr; @@ -196,7 +196,7 @@ nsresult nsStreamConverterService::FindConverter( // Create a corresponding color table for each vertex in the graph. BFSHashTable lBFSTable; for (auto iter = mAdjacencyList.Iter(); !iter.Done(); iter.Next()) { - const nsACString &key = iter.Key(); + const nsACString& key = iter.Key(); MOZ_ASSERT(iter.UserData(), "no data in the table iteration"); lBFSTable.Put(key, new BFSTableData(key)); } @@ -209,37 +209,37 @@ nsresult nsStreamConverterService::FindConverter( rv = ParseFromTo(aContractID, fromC, toC); if (NS_FAILED(rv)) return rv; - BFSTableData *data = lBFSTable.Get(fromC); + BFSTableData* data = lBFSTable.Get(fromC); if (!data) { return NS_ERROR_FAILURE; } data->color = gray; data->distance = 0; - auto *dtorFunc = new CStreamConvDeallocator(); + auto* dtorFunc = new CStreamConvDeallocator(); nsDeque grayQ(dtorFunc); // Now generate the shortest path tree. grayQ.Push(new nsCString(fromC)); while (0 < grayQ.GetSize()) { - nsCString *currentHead = (nsCString *)grayQ.PeekFront(); - nsTArray> *data2 = mAdjacencyList.Get(*currentHead); + nsCString* currentHead = (nsCString*)grayQ.PeekFront(); + nsTArray>* data2 = mAdjacencyList.Get(*currentHead); if (!data2) return NS_ERROR_FAILURE; // Get the state of the current head to calculate the distance of each // reachable vertex in the loop. - BFSTableData *headVertexState = lBFSTable.Get(*currentHead); + BFSTableData* headVertexState = lBFSTable.Get(*currentHead); if (!headVertexState) return NS_ERROR_FAILURE; int32_t edgeCount = data2->Length(); for (int32_t i = 0; i < edgeCount; i++) { - nsAtom *curVertexAtom = data2->ElementAt(i); - auto *curVertex = new nsCString(); + nsAtom* curVertexAtom = data2->ElementAt(i); + auto* curVertex = new nsCString(); curVertexAtom->ToUTF8String(*curVertex); - BFSTableData *curVertexState = lBFSTable.Get(*curVertex); + BFSTableData* curVertexState = lBFSTable.Get(*curVertex); if (!curVertexState) { delete curVertex; return NS_ERROR_FAILURE; @@ -257,7 +257,7 @@ nsresult nsStreamConverterService::FindConverter( } } headVertexState->color = black; - nsCString *cur = (nsCString *)grayQ.PopFront(); + nsCString* cur = (nsCString*)grayQ.PopFront(); delete cur; cur = nullptr; } @@ -273,7 +273,7 @@ nsresult nsStreamConverterService::FindConverter( // get the root CONTRACTID nsAutoCString ContractIDPrefix(NS_ISTREAMCONVERTER_KEY); - auto *shortestPath = new nsTArray(); + auto* shortestPath = new nsTArray(); data = lBFSTable.Get(toMIMEType); if (!data) { @@ -293,7 +293,7 @@ nsresult nsStreamConverterService::FindConverter( // reconstruct the CONTRACTID. // Get the predecessor. if (!data->predecessor) break; // no predecessor - BFSTableData *predecessorData = lBFSTable.Get(*data->predecessor); + BFSTableData* predecessorData = lBFSTable.Get(*data->predecessor); if (!predecessorData) break; // no predecessor, chain doesn't exist. @@ -322,8 +322,8 @@ nsresult nsStreamConverterService::FindConverter( ///////////////////////////////////////////////////// // nsIStreamConverterService methods NS_IMETHODIMP -nsStreamConverterService::CanConvert(const char *aFromType, const char *aToType, - bool *_retval) { +nsStreamConverterService::CanConvert(const char* aFromType, const char* aToType, + bool* _retval) { nsCOMPtr reg; nsresult rv = NS_GetComponentRegistrar(getter_AddRefs(reg)); if (NS_FAILED(rv)) return rv; @@ -343,7 +343,7 @@ nsStreamConverterService::CanConvert(const char *aFromType, const char *aToType, rv = BuildGraph(); if (NS_FAILED(rv)) return rv; - nsTArray *converterChain = nullptr; + nsTArray* converterChain = nullptr; rv = FindConverter(contractID.get(), &converterChain); *_retval = NS_SUCCEEDED(rv); @@ -352,10 +352,10 @@ nsStreamConverterService::CanConvert(const char *aFromType, const char *aToType, } NS_IMETHODIMP -nsStreamConverterService::Convert(nsIInputStream *aFromStream, - const char *aFromType, const char *aToType, - nsISupports *aContext, - nsIInputStream **_retval) { +nsStreamConverterService::Convert(nsIInputStream* aFromStream, + const char* aFromType, const char* aToType, + nsISupports* aContext, + nsIInputStream** _retval) { if (!aFromStream || !aFromType || !aToType || !_retval) return NS_ERROR_NULL_POINTER; nsresult rv; @@ -367,7 +367,7 @@ nsStreamConverterService::Convert(nsIInputStream *aFromStream, contractID.Append(aFromType); contractID.AppendLiteral("&to="); contractID.Append(aToType); - const char *cContractID = contractID.get(); + const char* cContractID = contractID.get(); nsCOMPtr converter(do_CreateInstance(cContractID, &rv)); if (NS_FAILED(rv)) { @@ -375,7 +375,7 @@ nsStreamConverterService::Convert(nsIInputStream *aFromStream, rv = BuildGraph(); if (NS_FAILED(rv)) return rv; - nsTArray *converterChain = nullptr; + nsTArray* converterChain = nullptr; rv = FindConverter(cContractID, &converterChain); if (NS_FAILED(rv)) { @@ -393,7 +393,7 @@ nsStreamConverterService::Convert(nsIInputStream *aFromStream, nsCOMPtr convertedData; for (int32_t i = edgeCount - 1; i >= 0; i--) { - const char *lContractID = converterChain->ElementAt(i).get(); + const char* lContractID = converterChain->ElementAt(i).get(); converter = do_CreateInstance(lContractID, &rv); @@ -429,11 +429,11 @@ nsStreamConverterService::Convert(nsIInputStream *aFromStream, } NS_IMETHODIMP -nsStreamConverterService::AsyncConvertData(const char *aFromType, - const char *aToType, - nsIStreamListener *aListener, - nsISupports *aContext, - nsIStreamListener **_retval) { +nsStreamConverterService::AsyncConvertData(const char* aFromType, + const char* aToType, + nsIStreamListener* aListener, + nsISupports* aContext, + nsIStreamListener** _retval) { if (!aFromType || !aToType || !aListener || !_retval) return NS_ERROR_NULL_POINTER; @@ -446,7 +446,7 @@ nsStreamConverterService::AsyncConvertData(const char *aFromType, contractID.Append(aFromType); contractID.AppendLiteral("&to="); contractID.Append(aToType); - const char *cContractID = contractID.get(); + const char* cContractID = contractID.get(); nsCOMPtr listener(do_CreateInstance(cContractID, &rv)); if (NS_FAILED(rv)) { @@ -454,7 +454,7 @@ nsStreamConverterService::AsyncConvertData(const char *aFromType, rv = BuildGraph(); if (NS_FAILED(rv)) return rv; - nsTArray *converterChain = nullptr; + nsTArray* converterChain = nullptr; rv = FindConverter(cContractID, &converterChain); if (NS_FAILED(rv)) { @@ -474,7 +474,7 @@ nsStreamConverterService::AsyncConvertData(const char *aFromType, int32_t edgeCount = int32_t(converterChain->Length()); NS_ASSERTION(edgeCount > 0, "findConverter should have failed"); for (int i = 0; i < edgeCount; i++) { - const char *lContractID = converterChain->ElementAt(i).get(); + const char* lContractID = converterChain->ElementAt(i).get(); // create the converter for this from/to pair nsCOMPtr converter(do_CreateInstance(lContractID)); @@ -517,7 +517,7 @@ nsStreamConverterService::AsyncConvertData(const char *aFromType, return rv; } -nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv) { +nsresult NS_NewStreamConv(nsStreamConverterService** aStreamConv) { MOZ_ASSERT(aStreamConv != nullptr, "null ptr"); if (!aStreamConv) return NS_ERROR_NULL_POINTER; diff --git a/netwerk/streamconv/nsStreamConverterService.h b/netwerk/streamconv/nsStreamConverterService.h index 049a4d9026973..15561a76b2502 100644 --- a/netwerk/streamconv/nsStreamConverterService.h +++ b/netwerk/streamconv/nsStreamConverterService.h @@ -33,12 +33,12 @@ class nsStreamConverterService : public nsIStreamConverterService { virtual ~nsStreamConverterService() = default; // Responsible for finding a converter for the given MIME-type. - nsresult FindConverter(const char *aContractID, - nsTArray **aEdgeList); + nsresult FindConverter(const char* aContractID, + nsTArray** aEdgeList); nsresult BuildGraph(void); - nsresult AddAdjacency(const char *aContractID); - nsresult ParseFromTo(const char *aContractID, nsCString &aFromRes, - nsCString &aToRes); + nsresult AddAdjacency(const char* aContractID); + nsresult ParseFromTo(const char* aContractID, nsCString& aFromRes, + nsCString& aToRes); // member variables nsClassHashtable>> mAdjacencyList; diff --git a/netwerk/system/android/nsAndroidNetworkLinkService.cpp b/netwerk/system/android/nsAndroidNetworkLinkService.cpp index 7da591779a442..677b13f68e109 100644 --- a/netwerk/system/android/nsAndroidNetworkLinkService.cpp +++ b/netwerk/system/android/nsAndroidNetworkLinkService.cpp @@ -18,7 +18,7 @@ nsAndroidNetworkLinkService::nsAndroidNetworkLinkService() {} nsAndroidNetworkLinkService::~nsAndroidNetworkLinkService() {} NS_IMETHODIMP -nsAndroidNetworkLinkService::GetIsLinkUp(bool *aIsUp) { +nsAndroidNetworkLinkService::GetIsLinkUp(bool* aIsUp) { if (!mozilla::AndroidBridge::Bridge()) { // Fail soft here and assume a connection exists NS_WARNING("GetIsLinkUp is not supported without a bridge connection"); @@ -31,7 +31,7 @@ nsAndroidNetworkLinkService::GetIsLinkUp(bool *aIsUp) { } NS_IMETHODIMP -nsAndroidNetworkLinkService::GetLinkStatusKnown(bool *aIsKnown) { +nsAndroidNetworkLinkService::GetLinkStatusKnown(bool* aIsKnown) { NS_ENSURE_TRUE(mozilla::AndroidBridge::Bridge(), NS_ERROR_NOT_IMPLEMENTED); *aIsKnown = java::GeckoAppShell::IsNetworkLinkKnown(); @@ -39,7 +39,7 @@ nsAndroidNetworkLinkService::GetLinkStatusKnown(bool *aIsKnown) { } NS_IMETHODIMP -nsAndroidNetworkLinkService::GetLinkType(uint32_t *aLinkType) { +nsAndroidNetworkLinkService::GetLinkType(uint32_t* aLinkType) { NS_ENSURE_ARG_POINTER(aLinkType); if (!mozilla::AndroidBridge::Bridge()) { diff --git a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp index 360dd54912492..a9ec6a1b0fb3a 100644 --- a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp +++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp @@ -65,21 +65,21 @@ nsNotifyAddrListener::~nsNotifyAddrListener() { } NS_IMETHODIMP -nsNotifyAddrListener::GetIsLinkUp(bool *aIsUp) { +nsNotifyAddrListener::GetIsLinkUp(bool* aIsUp) { // XXX This function has not yet been implemented for this platform *aIsUp = mLinkUp; return NS_OK; } NS_IMETHODIMP -nsNotifyAddrListener::GetLinkStatusKnown(bool *aIsUp) { +nsNotifyAddrListener::GetLinkStatusKnown(bool* aIsUp) { // XXX This function has not yet been implemented for this platform *aIsUp = mStatusKnown; return NS_OK; } NS_IMETHODIMP -nsNotifyAddrListener::GetLinkType(uint32_t *aLinkType) { +nsNotifyAddrListener::GetLinkType(uint32_t* aLinkType) { NS_ENSURE_ARG_POINTER(aLinkType); // XXX This function has not yet been implemented for this platform @@ -95,15 +95,15 @@ nsNotifyAddrListener::GetLinkType(uint32_t *aLinkType) { // information leakage). // void nsNotifyAddrListener::calculateNetworkId(void) { - const char *kProcRoute = "/proc/net/route"; /* IPv4 routes */ - const char *kProcArp = "/proc/net/arp"; + const char* kProcRoute = "/proc/net/route"; /* IPv4 routes */ + const char* kProcArp = "/proc/net/arp"; bool found = false; - FILE *froute = fopen(kProcRoute, "r"); + FILE* froute = fopen(kProcRoute, "r"); if (froute) { char buffer[512]; uint32_t gw = 0; - char *l = fgets(buffer, sizeof(buffer), froute); + char* l = fgets(buffer, sizeof(buffer), froute); if (l) { /* skip the title line */ while (l) { @@ -129,7 +129,7 @@ void nsNotifyAddrListener::calculateNetworkId(void) { SprintfLiteral(searchfor, "%d.%d.%d.%d", gw & 0xff, (gw >> 8) & 0xff, (gw >> 16) & 0xff, gw >> 24); - FILE *farp = fopen(kProcArp, "r"); + FILE* farp = fopen(kProcArp, "r"); if (farp) { l = fgets(buffer, sizeof(buffer), farp); while (l) { @@ -157,7 +157,7 @@ void nsNotifyAddrListener::calculateNetworkId(void) { sha1.update(combined.get(), combined.Length()); uint8_t digest[SHA1Sum::kHashSize]; sha1.finish(digest); - nsCString newString(reinterpret_cast(digest), + nsCString newString(reinterpret_cast(digest), SHA1Sum::kHashSize); nsresult rv = Base64Encode(newString, output); MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); @@ -190,8 +190,8 @@ void nsNotifyAddrListener::calculateNetworkId(void) { // Check if there's a network interface available to do networking on. // void nsNotifyAddrListener::checkLink(void) { - struct ifaddrs *list; - struct ifaddrs *ifa; + struct ifaddrs* list; + struct ifaddrs* ifa; bool link = false; bool prevLinkUp = mLinkUp; @@ -223,15 +223,15 @@ void nsNotifyAddrListener::checkLink(void) { } void nsNotifyAddrListener::OnNetlinkMessage(int aNetlinkSocket) { - struct nlmsghdr *nlh; + struct nlmsghdr* nlh; // The buffer size below, (4095) was chosen partly based on testing and // partly on existing sample source code using this size. It needs to be // large enough to hold the netlink messages from the kernel. char buffer[4095]; - struct rtattr *attr; + struct rtattr* attr; int attr_len; - const struct ifaddrmsg *newifam; + const struct ifaddrmsg* newifam; ssize_t rc = EINTR_RETRY(recv(aNetlinkSocket, buffer, sizeof(buffer), 0)); if (rc < 0) { @@ -239,14 +239,14 @@ void nsNotifyAddrListener::OnNetlinkMessage(int aNetlinkSocket) { } size_t netlink_bytes = rc; - nlh = reinterpret_cast(buffer); + nlh = reinterpret_cast(buffer); bool networkChange = false; for (; NLMSG_OK(nlh, netlink_bytes); nlh = NLMSG_NEXT(nlh, netlink_bytes)) { char prefixaddr[INET6_ADDRSTRLEN]; char localaddr[INET6_ADDRSTRLEN]; - char *addr = nullptr; + char* addr = nullptr; prefixaddr[0] = localaddr[0] = '\0'; if (NLMSG_DONE == nlh->nlmsg_type) { @@ -254,7 +254,7 @@ void nsNotifyAddrListener::OnNetlinkMessage(int aNetlinkSocket) { } LOG(("nsNotifyAddrListener::OnNetlinkMessage: new/deleted address\n")); - newifam = reinterpret_cast(NLMSG_DATA(nlh)); + newifam = reinterpret_cast(NLMSG_DATA(nlh)); if ((newifam->ifa_family != AF_INET) && (newifam->ifa_family != AF_INET6)) { continue; @@ -266,18 +266,18 @@ void nsNotifyAddrListener::OnNetlinkMessage(int aNetlinkSocket) { attr = RTA_NEXT(attr, attr_len)) { if (attr->rta_type == IFA_ADDRESS) { if (newifam->ifa_family == AF_INET) { - struct in_addr *in = (struct in_addr *)RTA_DATA(attr); + struct in_addr* in = (struct in_addr*)RTA_DATA(attr); inet_ntop(AF_INET, in, prefixaddr, INET_ADDRSTRLEN); } else { - struct in6_addr *in = (struct in6_addr *)RTA_DATA(attr); + struct in6_addr* in = (struct in6_addr*)RTA_DATA(attr); inet_ntop(AF_INET6, in, prefixaddr, INET6_ADDRSTRLEN); } } else if (attr->rta_type == IFA_LOCAL) { if (newifam->ifa_family == AF_INET) { - struct in_addr *in = (struct in_addr *)RTA_DATA(attr); + struct in_addr* in = (struct in_addr*)RTA_DATA(attr); inet_ntop(AF_INET, in, localaddr, INET_ADDRSTRLEN); } else { - struct in6_addr *in = (struct in6_addr *)RTA_DATA(attr); + struct in6_addr* in = (struct in6_addr*)RTA_DATA(attr); inet_ntop(AF_INET6, in, localaddr, INET6_ADDRSTRLEN); } } @@ -294,7 +294,7 @@ void nsNotifyAddrListener::OnNetlinkMessage(int aNetlinkSocket) { ("nsNotifyAddrListener::OnNetlinkMessage: a new address " "- %s.", addr)); - struct ifaddrmsg *ifam; + struct ifaddrmsg* ifam; nsCString addrStr; addrStr.Assign(addr); if (auto entry = mAddressInfo.LookupForAdd(addrStr)) { @@ -311,7 +311,7 @@ void nsNotifyAddrListener::OnNetlinkMessage(int aNetlinkSocket) { } } else { networkChange = true; - ifam = (struct ifaddrmsg *)malloc(sizeof(struct ifaddrmsg)); + ifam = (struct ifaddrmsg*)malloc(sizeof(struct ifaddrmsg)); memcpy(ifam, newifam, sizeof(struct ifaddrmsg)); entry.OrInsert([ifam]() { return ifam; }); } @@ -349,7 +349,7 @@ nsNotifyAddrListener::Run() { addr.nl_family = AF_NETLINK; addr.nl_groups = RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR; - if (bind(netlinkSocket, (struct sockaddr *)&addr, sizeof(addr)) < 0) { + if (bind(netlinkSocket, (struct sockaddr*)&addr, sizeof(addr)) < 0) { // failure! EINTR_RETRY(close(netlinkSocket)); return NS_ERROR_FAILURE; @@ -410,8 +410,8 @@ nsNotifyAddrListener::Run() { } NS_IMETHODIMP -nsNotifyAddrListener::Observe(nsISupports *subject, const char *topic, - const char16_t *data) { +nsNotifyAddrListener::Observe(nsISupports* subject, const char* topic, + const char16_t* data) { if (!strcmp("xpcom-shutdown-threads", topic)) { Shutdown(); } @@ -485,7 +485,7 @@ nsresult nsNotifyAddrListener::NetworkChanged() { /* Sends the given event. Assumes aEventID never goes out of scope (static * strings are ideal). */ -nsresult nsNotifyAddrListener::SendEvent(const char *aEventID) { +nsresult nsNotifyAddrListener::SendEvent(const char* aEventID) { if (!aEventID) return NS_ERROR_NULL_POINTER; LOG(("SendEvent: %s\n", aEventID)); diff --git a/netwerk/system/mac/nsNetworkLinkService.h b/netwerk/system/mac/nsNetworkLinkService.h index fe70be09ef73e..57c0df963ffba 100644 --- a/netwerk/system/mac/nsNetworkLinkService.h +++ b/netwerk/system/mac/nsNetworkLinkService.h @@ -40,9 +40,9 @@ class nsNetworkLinkService : public nsINetworkLinkService, public nsIObserver { void UpdateReachability(); void SendEvent(bool aNetworkChanged); static void ReachabilityChanged(SCNetworkReachabilityRef target, - SCNetworkConnectionFlags flags, void *info); + SCNetworkConnectionFlags flags, void* info); static void IPConfigChanged(SCDynamicStoreRef store, CFArrayRef changedKeys, - void *info); + void* info); void calculateNetworkId(void); nsCString mNetworkId; }; diff --git a/netwerk/system/mac/nsNetworkLinkService.mm b/netwerk/system/mac/nsNetworkLinkService.mm index d984eb6c369ca..89d295ba527e5 100644 --- a/netwerk/system/mac/nsNetworkLinkService.mm +++ b/netwerk/system/mac/nsNetworkLinkService.mm @@ -53,7 +53,7 @@ static OSStatus getErrorCodeBool(Boolean success) { } // If given a NULL pointer, return the error code. -static OSStatus getErrorCodePtr(const void *value) { return getErrorCodeBool(value != nullptr); } +static OSStatus getErrorCodePtr(const void* value) { return getErrorCodeBool(value != nullptr); } // Convenience function to allow NULL input. static void CFReleaseSafe(CFTypeRef cf) { @@ -78,19 +78,19 @@ static void CFReleaseSafe(CFTypeRef cf) { nsNetworkLinkService::~nsNetworkLinkService() = default; NS_IMETHODIMP -nsNetworkLinkService::GetIsLinkUp(bool *aIsUp) { +nsNetworkLinkService::GetIsLinkUp(bool* aIsUp) { *aIsUp = mLinkUp; return NS_OK; } NS_IMETHODIMP -nsNetworkLinkService::GetLinkStatusKnown(bool *aIsUp) { +nsNetworkLinkService::GetLinkStatusKnown(bool* aIsUp) { *aIsUp = mStatusKnown; return NS_OK; } NS_IMETHODIMP -nsNetworkLinkService::GetLinkType(uint32_t *aLinkType) { +nsNetworkLinkService::GetLinkType(uint32_t* aLinkType) { NS_ENSURE_ARG_POINTER(aLinkType); // XXX This function has not yet been implemented for this platform @@ -99,18 +99,18 @@ static void CFReleaseSafe(CFTypeRef cf) { } #ifndef SA_SIZE -# define SA_SIZE(sa) \ - ((!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) \ - ? sizeof(uint32_t) \ - : 1 + ((((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(uint32_t) - 1))) +# define SA_SIZE(sa) \ + ((!(sa) || ((struct sockaddr*)(sa))->sa_len == 0) \ + ? sizeof(uint32_t) \ + : 1 + ((((struct sockaddr*)(sa))->sa_len - 1) | (sizeof(uint32_t) - 1))) #endif -static char *getMac(struct sockaddr_dl *sdl, char *buf, size_t bufsize) { - char *cp; +static char* getMac(struct sockaddr_dl* sdl, char* buf, size_t bufsize) { + char* cp; int n, p = 0; buf[0] = 0; - cp = (char *)LLADDR(sdl); + cp = (char*)LLADDR(sdl); n = sdl->sdl_alen; if (n > 0) { while (--n >= 0) { @@ -121,7 +121,7 @@ static void CFReleaseSafe(CFTypeRef cf) { } /* If the IP matches, get the MAC and return true */ -static bool matchIp(struct sockaddr_dl *sdl, struct sockaddr_inarp *addr, char *ip, char *buf, +static bool matchIp(struct sockaddr_dl* sdl, struct sockaddr_inarp* addr, char* ip, char* buf, size_t bufsize) { if (sdl->sdl_alen) { if (!strcmp(inet_ntoa(addr->sin_addr), ip)) { @@ -138,7 +138,7 @@ static bool matchIp(struct sockaddr_dl *sdl, struct sockaddr_inarp *addr, char * * * Returns 'true' if it found the IP and returns a MAC. */ -static bool scanArp(char *ip, char *mac, size_t maclen) { +static bool scanArp(char* ip, char* mac, size_t maclen) { int mib[6]; char *lim, *next; int st; @@ -177,11 +177,11 @@ static bool scanArp(char *ip, char *mac, size_t maclen) { } lim = &buf[needed]; - struct rt_msghdr *rtm; + struct rt_msghdr* rtm; for (next = &buf[0]; next < lim; next += rtm->rtm_msglen) { - rtm = reinterpret_cast(next); - struct sockaddr_inarp *sin2 = reinterpret_cast(rtm + 1); - struct sockaddr_dl *sdl = reinterpret_cast((char *)sin2 + SA_SIZE(sin2)); + rtm = reinterpret_cast(next); + struct sockaddr_inarp* sin2 = reinterpret_cast(rtm + 1); + struct sockaddr_dl* sdl = reinterpret_cast((char*)sin2 + SA_SIZE(sin2)); if (matchIp(sdl, sin2, ip, mac, maclen)) { return true; } @@ -190,12 +190,12 @@ static bool scanArp(char *ip, char *mac, size_t maclen) { return false; } -static int routingTable(char *gw, size_t aGwLen) { +static int routingTable(char* gw, size_t aGwLen) { size_t needed; int mib[6]; - struct rt_msghdr *rtm; - struct sockaddr *sa; - struct sockaddr_in *sockin; + struct rt_msghdr* rtm; + struct sockaddr* sa; + struct sockaddr_in* sockin; mib[0] = CTL_NET; mib[1] = PF_ROUTE; @@ -213,10 +213,10 @@ static int routingTable(char *gw, size_t aGwLen) { return 3; } - rtm = reinterpret_cast(&buf[0]); - sa = reinterpret_cast(rtm + 1); - sa = reinterpret_cast(SA_SIZE(sa) + (char *)sa); - sockin = reinterpret_cast(sa); + rtm = reinterpret_cast(&buf[0]); + sa = reinterpret_cast(rtm + 1); + sa = reinterpret_cast(SA_SIZE(sa) + (char*)sa); + sockin = reinterpret_cast(sa); inet_ntop(AF_INET, &sockin->sin_addr.s_addr, gw, aGwLen - 1); return 0; @@ -246,7 +246,7 @@ static int routingTable(char *gw, size_t aGwLen) { sha1.update(combined.get(), combined.Length()); uint8_t digest[SHA1Sum::kHashSize]; sha1.finish(digest); - nsCString newString(reinterpret_cast(digest), SHA1Sum::kHashSize); + nsCString newString(reinterpret_cast(digest), SHA1Sum::kHashSize); nsresult rv = Base64Encode(newString, output); MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); LOG(("networkid: id %s\n", output.get())); @@ -268,7 +268,7 @@ static int routingTable(char *gw, size_t aGwLen) { } NS_IMETHODIMP -nsNetworkLinkService::Observe(nsISupports *subject, const char *topic, const char16_t *data) { +nsNetworkLinkService::Observe(nsISupports* subject, const char* topic, const char16_t* data) { if (!strcmp(topic, "xpcom-shutdown")) { Shutdown(); } @@ -278,8 +278,8 @@ static int routingTable(char *gw, size_t aGwLen) { /* static */ void nsNetworkLinkService::IPConfigChanged(SCDynamicStoreRef aStoreREf, CFArrayRef aChangedKeys, - void *aInfo) { - nsNetworkLinkService *service = static_cast(aInfo); + void* aInfo) { + nsNetworkLinkService* service = static_cast(aInfo); service->SendEvent(true); } @@ -301,7 +301,7 @@ static int routingTable(char *gw, size_t aGwLen) { bzero(&addr, sizeof(addr)); addr.sin_len = sizeof(addr); addr.sin_family = AF_INET; - mReachability = ::SCNetworkReachabilityCreateWithAddress(nullptr, (struct sockaddr *)&addr); + mReachability = ::SCNetworkReachabilityCreateWithAddress(nullptr, (struct sockaddr*)&addr); if (!mReachability) { return NS_ERROR_NOT_AVAILABLE; } @@ -339,7 +339,7 @@ static int routingTable(char *gw, size_t aGwLen) { // that match that pattern list, then create our run loop // source. if (err == noErr) { - patternList = ::CFArrayCreate(nullptr, (const void **)patterns, 2, &kCFTypeArrayCallBacks); + patternList = ::CFArrayCreate(nullptr, (const void**)patterns, 2, &kCFTypeArrayCallBacks); if (!patternList) { err = -1; } @@ -437,7 +437,7 @@ static int routingTable(char *gw, size_t aGwLen) { return; } - const char *event; + const char* event; if (aNetworkChanged) { if (!mAllowChangedEvent) { return; @@ -450,14 +450,14 @@ static int routingTable(char *gw, size_t aGwLen) { } LOG(("SendEvent: network is '%s'\n", event)); - observerService->NotifyObservers(static_cast(this), - NS_NETWORK_LINK_TOPIC, NS_ConvertASCIItoUTF16(event).get()); + observerService->NotifyObservers(static_cast(this), NS_NETWORK_LINK_TOPIC, + NS_ConvertASCIItoUTF16(event).get()); } /* static */ void nsNetworkLinkService::ReachabilityChanged(SCNetworkReachabilityRef target, - SCNetworkConnectionFlags flags, void *info) { - nsNetworkLinkService *service = static_cast(info); + SCNetworkConnectionFlags flags, void* info) { + nsNetworkLinkService* service = static_cast(info); service->UpdateReachability(); service->SendEvent(false); diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp index 97b60dc1320db..8f8ee6abab302 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.cpp +++ b/netwerk/system/win32/nsNotifyAddrListener.cpp @@ -46,11 +46,11 @@ static LazyLogModule gNotifyAddrLog("nsNotifyAddr"); #define LOG(args) MOZ_LOG(gNotifyAddrLog, mozilla::LogLevel::Debug, args) static HMODULE sNetshell; -static decltype(NcFreeNetconProperties) *sNcFreeNetconProperties; +static decltype(NcFreeNetconProperties)* sNcFreeNetconProperties; static HMODULE sIphlpapi; -static decltype(NotifyIpInterfaceChange) *sNotifyIpInterfaceChange; -static decltype(CancelMibChangeNotify2) *sCancelMibChangeNotify2; +static decltype(NotifyIpInterfaceChange)* sNotifyIpInterfaceChange; +static decltype(CancelMibChangeNotify2)* sCancelMibChangeNotify2; #define NETWORK_NOTIFY_CHANGED_PREF "network.notify.changed" #define NETWORK_NOTIFY_IPV6_PREF "network.notify.IPv6" @@ -64,10 +64,10 @@ static void InitIphlpapi(void) { sIphlpapi = LoadLibraryW(L"Iphlpapi.dll"); if (sIphlpapi) { sNotifyIpInterfaceChange = - (decltype(NotifyIpInterfaceChange) *)GetProcAddress( + (decltype(NotifyIpInterfaceChange)*)GetProcAddress( sIphlpapi, "NotifyIpInterfaceChange"); sCancelMibChangeNotify2 = - (decltype(CancelMibChangeNotify2) *)GetProcAddress( + (decltype(CancelMibChangeNotify2)*)GetProcAddress( sIphlpapi, "CancelMibChangeNotify2"); } else { NS_WARNING( @@ -82,7 +82,7 @@ static void InitNetshellLibrary(void) { sNetshell = LoadLibraryW(L"Netshell.dll"); if (sNetshell) { sNcFreeNetconProperties = - (decltype(NcFreeNetconProperties) *)GetProcAddress( + (decltype(NcFreeNetconProperties)*)GetProcAddress( sNetshell, "NcFreeNetconProperties"); } } @@ -125,7 +125,7 @@ nsNotifyAddrListener::~nsNotifyAddrListener() { } NS_IMETHODIMP -nsNotifyAddrListener::GetIsLinkUp(bool *aIsUp) { +nsNotifyAddrListener::GetIsLinkUp(bool* aIsUp) { if (!mCheckAttempted && !mStatusKnown) { mCheckAttempted = true; CheckLinkStatus(); @@ -136,13 +136,13 @@ nsNotifyAddrListener::GetIsLinkUp(bool *aIsUp) { } NS_IMETHODIMP -nsNotifyAddrListener::GetLinkStatusKnown(bool *aIsUp) { +nsNotifyAddrListener::GetLinkStatusKnown(bool* aIsUp) { *aIsUp = mStatusKnown; return NS_OK; } NS_IMETHODIMP -nsNotifyAddrListener::GetLinkType(uint32_t *aLinkType) { +nsNotifyAddrListener::GetLinkType(uint32_t* aLinkType) { NS_ENSURE_ARG_POINTER(aLinkType); // XXX This function has not yet been implemented for this platform @@ -150,7 +150,7 @@ nsNotifyAddrListener::GetLinkType(uint32_t *aLinkType) { return NS_OK; } -static bool macAddr(BYTE addr[], DWORD len, char *buf, size_t buflen) { +static bool macAddr(BYTE addr[], DWORD len, char* buf, size_t buflen) { buf[0] = '\0'; if (!addr || !len || (len * 3 > buflen)) { return false; @@ -163,7 +163,7 @@ static bool macAddr(BYTE addr[], DWORD len, char *buf, size_t buflen) { return true; } -bool nsNotifyAddrListener::findMac(char *gateway) { +bool nsNotifyAddrListener::findMac(char* gateway) { // query for buffer size needed DWORD dwActualSize = 0; bool found = FALSE; @@ -202,7 +202,7 @@ bool nsNotifyAddrListener::findMac(char *gateway) { sha1.update(combined.get(), combined.Length()); uint8_t digest[SHA1Sum::kHashSize]; sha1.finish(digest); - nsCString newString(reinterpret_cast(digest), + nsCString newString(reinterpret_cast(digest), SHA1Sum::kHashSize); nsresult rv = Base64Encode(newString, output); if (NS_FAILED(rv)) { @@ -228,7 +228,7 @@ bool nsNotifyAddrListener::findMac(char *gateway) { } // returns 'true' when the gw is found and stored -static bool defaultgw(char *aGateway, size_t aGatewayLen) { +static bool defaultgw(char* aGateway, size_t aGatewayLen) { PMIB_IPFORWARDTABLE pIpForwardTable = NULL; DWORD dwSize = 0; @@ -249,7 +249,7 @@ static bool defaultgw(char *aGateway, size_t aGatewayLen) { struct in_addr IpAddr; IpAddr.S_un.S_addr = static_cast(pIpForwardTable->table[i].dwForwardDest); - char *ipStr = inet_ntoa(IpAddr); + char* ipStr = inet_ntoa(IpAddr); if (ipStr && !strcmp("0.0.0.0", ipStr)) { // Default gateway! IpAddr.S_un.S_addr = @@ -289,8 +289,8 @@ void nsNotifyAddrListener::calculateNetworkId(void) { static void WINAPI OnInterfaceChange(PVOID callerContext, PMIB_IPINTERFACE_ROW row, MIB_NOTIFICATION_TYPE notificationType) { - nsNotifyAddrListener *notify = - static_cast(callerContext); + nsNotifyAddrListener* notify = + static_cast(callerContext); notify->CheckLinkStatus(); } @@ -375,8 +375,8 @@ nsNotifyAddrListener::Run() { } NS_IMETHODIMP -nsNotifyAddrListener::Observe(nsISupports *subject, const char *topic, - const char16_t *data) { +nsNotifyAddrListener::Observe(nsISupports* subject, const char* topic, + const char16_t* data) { if (!strcmp("xpcom-shutdown-threads", topic)) Shutdown(); return NS_OK; @@ -451,7 +451,7 @@ nsresult nsNotifyAddrListener::NetworkChanged() { /* Sends the given event. Assumes aEventID never goes out of scope (static * strings are ideal). */ -nsresult nsNotifyAddrListener::SendEvent(const char *aEventID) { +nsresult nsNotifyAddrListener::SendEvent(const char* aEventID) { if (!aEventID) return NS_ERROR_NULL_POINTER; LOG(("SendEvent: network is '%s'\n", aEventID)); @@ -547,7 +547,7 @@ bool nsNotifyAddrListener::CheckICSStatus(PWCHAR aAdapterName) { IID_INetConnection, getter_AddRefs(connection)))) { connectionVariant.punkVal->Release(); - NETCON_PROPERTIES *properties; + NETCON_PROPERTIES* properties; if (SUCCEEDED(connection->GetProperties(&properties))) { if (!wcscmp(properties->pszwName, aAdapterName)) isICSGatewayAdapter = true; @@ -614,9 +614,9 @@ nsNotifyAddrListener::CheckAdaptersAddresses(void) { // Add bytes from each socket address to the checksum. for (PIP_ADAPTER_UNICAST_ADDRESS pip = adapter->FirstUnicastAddress; pip; pip = pip->Next) { - SOCKET_ADDRESS *sockAddr = &pip->Address; + SOCKET_ADDRESS* sockAddr = &pip->Address; for (int i = 0; i < sockAddr->iSockaddrLength; ++i) { - sum += (reinterpret_cast(sockAddr->lpSockaddr))[i]; + sum += (reinterpret_cast(sockAddr->lpSockaddr))[i]; } } linkUp = true; @@ -644,7 +644,7 @@ nsNotifyAddrListener::CheckAdaptersAddresses(void) { */ void nsNotifyAddrListener::CheckLinkStatus(void) { DWORD ret; - const char *event; + const char* event; bool prevLinkUp = mLinkUp; ULONG prevCsum = mIPInterfaceChecksum; diff --git a/netwerk/system/win32/nsNotifyAddrListener.h b/netwerk/system/win32/nsNotifyAddrListener.h index 4f8f347f15bcc..4a26b6ca23c09 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.h +++ b/netwerk/system/win32/nsNotifyAddrListener.h @@ -36,14 +36,14 @@ class nsNotifyAddrListener : public nsINetworkLinkService, class ChangeEvent : public mozilla::Runnable { public: NS_DECL_NSIRUNNABLE - ChangeEvent(nsINetworkLinkService *aService, const char *aEventID) + ChangeEvent(nsINetworkLinkService* aService, const char* aEventID) : Runnable("nsNotifyAddrListener::ChangeEvent"), mService(aService), mEventID(aEventID) {} private: nsCOMPtr mService; - const char *mEventID; + const char* mEventID; }; bool mLinkUp; @@ -51,7 +51,7 @@ class nsNotifyAddrListener : public nsINetworkLinkService, bool mCheckAttempted; nsresult Shutdown(void); - nsresult SendEvent(const char *aEventID); + nsresult SendEvent(const char* aEventID); DWORD CheckAdaptersAddresses(void); @@ -70,7 +70,7 @@ class nsNotifyAddrListener : public nsINetworkLinkService, // Figure out the current network identification void calculateNetworkId(void); - bool findMac(char *gateway); + bool findMac(char* gateway); nsCString mNetworkId; HANDLE mCheckEvent; diff --git a/netwerk/test/TestCookie.cpp b/netwerk/test/TestCookie.cpp index 4fed959645c2b..7c838a4a1c6c4 100644 --- a/netwerk/test/TestCookie.cpp +++ b/netwerk/test/TestCookie.cpp @@ -38,8 +38,8 @@ static const char kCookiesMaxPerHost[] = "network.cookie.maxPerHost"; #define OFFSET_ONE_DAY int64_t(86400) * PR_USEC_PER_SEC // Set server time or expiry time -void SetTime(PRTime offsetTime, nsAutoCString &serverString, - nsAutoCString &cookieString, bool expiry) { +void SetTime(PRTime offsetTime, nsAutoCString& serverString, + nsAutoCString& cookieString, bool expiry) { char timeStringPreset[40]; PRTime CurrentTime = PR_Now(); PRTime SetCookieTime = CurrentTime + offsetTime; @@ -65,23 +65,23 @@ void SetTime(PRTime offsetTime, nsAutoCString &serverString, cookieString.Append(timeStringPreset); } -void SetACookie(nsICookieService *aCookieService, const char *aSpec1, - const char *aSpec2, const char *aCookieString, - const char *aServerTime) { +void SetACookie(nsICookieService* aCookieService, const char* aSpec1, + const char* aSpec2, const char* aCookieString, + const char* aServerTime) { nsCOMPtr uri1, uri2; NS_NewURI(getter_AddRefs(uri1), aSpec1); if (aSpec2) NS_NewURI(getter_AddRefs(uri2), aSpec2); nsresult rv = aCookieService->SetCookieStringFromHttp( - uri1, uri2, nullptr, (char *)aCookieString, aServerTime, nullptr); + uri1, uri2, nullptr, (char*)aCookieString, aServerTime, nullptr); EXPECT_TRUE(NS_SUCCEEDED(rv)); } // Custom Cookie Generator specifically for the needs of same-site cookies! // Hands off unless you know exactly what you are doing! -void SetASameSiteCookie(nsICookieService *aCookieService, const char *aSpec1, - const char *aSpec2, const char *aCookieString, - const char *aServerTime, bool aAllowed) { +void SetASameSiteCookie(nsICookieService* aCookieService, const char* aSpec1, + const char* aSpec2, const char* aCookieString, + const char* aServerTime, bool aAllowed) { nsCOMPtr uri1, uri2; NS_NewURI(getter_AddRefs(uri1), aSpec1); if (aSpec2) NS_NewURI(getter_AddRefs(uri2), aSpec2); @@ -109,23 +109,23 @@ void SetASameSiteCookie(nsICookieService *aCookieService, const char *aSpec1, loadInfo->SetCookieSettings(cookieSettings); nsresult rv = aCookieService->SetCookieStringFromHttp( - uri1, uri2, nullptr, (char *)aCookieString, aServerTime, dummyChannel); + uri1, uri2, nullptr, (char*)aCookieString, aServerTime, dummyChannel); EXPECT_TRUE(NS_SUCCEEDED(rv)); } -void SetACookieNoHttp(nsICookieService *aCookieService, const char *aSpec, - const char *aCookieString) { +void SetACookieNoHttp(nsICookieService* aCookieService, const char* aSpec, + const char* aCookieString) { nsCOMPtr uri; NS_NewURI(getter_AddRefs(uri), aSpec); nsresult rv = aCookieService->SetCookieString(uri, nullptr, - (char *)aCookieString, nullptr); + (char*)aCookieString, nullptr); EXPECT_TRUE(NS_SUCCEEDED(rv)); } // The cookie string is returned via aCookie. -void GetACookie(nsICookieService *aCookieService, const char *aSpec1, - const char *aSpec2, nsACString &aCookie) { +void GetACookie(nsICookieService* aCookieService, const char* aSpec1, + const char* aSpec2, nsACString& aCookie) { nsCOMPtr uri1, uri2; NS_NewURI(getter_AddRefs(uri1), aSpec1); if (aSpec2) NS_NewURI(getter_AddRefs(uri2), aSpec2); @@ -135,8 +135,8 @@ void GetACookie(nsICookieService *aCookieService, const char *aSpec1, } // The cookie string is returned via aCookie. -void GetACookieNoHttp(nsICookieService *aCookieService, const char *aSpec, - nsACString &aCookie) { +void GetACookieNoHttp(nsICookieService* aCookieService, const char* aSpec, + nsACString& aCookie) { nsCOMPtr uri; NS_NewURI(getter_AddRefs(uri), aSpec); @@ -154,8 +154,8 @@ void GetACookieNoHttp(nsICookieService *aCookieService, const char *aSpec, // a simple helper function to improve readability: // takes one of the #defined rules above, and performs the appropriate test. // true means the test passed; false means the test failed. -static inline bool CheckResult(const char *aLhs, uint32_t aRule, - const char *aRhs = nullptr) { +static inline bool CheckResult(const char* aLhs, uint32_t aRule, + const char* aRhs = nullptr) { switch (aRule) { case MUST_BE_NULL: return !aLhs || !*aLhs; @@ -177,7 +177,7 @@ static inline bool CheckResult(const char *aLhs, uint32_t aRule, } } -void InitPrefs(nsIPrefBranch *aPrefBranch) { +void InitPrefs(nsIPrefBranch* aPrefBranch) { // init some relevant prefs, so the tests don't go awry. // we use the most restrictive set of prefs we can; // however, we don't test third party blocking here. diff --git a/netwerk/wifi/nsWifiMonitor.cpp b/netwerk/wifi/nsWifiMonitor.cpp index f3effebe8a5ef..779a359abdd45 100644 --- a/netwerk/wifi/nsWifiMonitor.cpp +++ b/netwerk/wifi/nsWifiMonitor.cpp @@ -36,8 +36,8 @@ nsWifiMonitor::nsWifiMonitor() } NS_IMETHODIMP -nsWifiMonitor::Observe(nsISupports *subject, const char *topic, - const char16_t *data) { +nsWifiMonitor::Observe(nsISupports* subject, const char* topic, + const char16_t* data) { if (!strcmp(topic, "xpcom-shutdown")) { LOG(("Shutting down\n")); @@ -49,7 +49,7 @@ nsWifiMonitor::Observe(nsISupports *subject, const char *topic, return NS_OK; } -NS_IMETHODIMP nsWifiMonitor::StartWatching(nsIWifiListener *aListener) { +NS_IMETHODIMP nsWifiMonitor::StartWatching(nsIWifiListener* aListener) { LOG(("nsWifiMonitor::StartWatching %p thread %p listener %p\n", this, mThread.get(), aListener)); MOZ_ASSERT(NS_IsMainThread()); @@ -85,7 +85,7 @@ NS_IMETHODIMP nsWifiMonitor::StartWatching(nsIWifiListener *aListener) { return NS_OK; } -NS_IMETHODIMP nsWifiMonitor::StopWatching(nsIWifiListener *aListener) { +NS_IMETHODIMP nsWifiMonitor::StopWatching(nsIWifiListener* aListener) { LOG(("nsWifiMonitor::StopWatching %p thread %p listener %p\n", this, mThread.get(), aListener)); MOZ_ASSERT(NS_IsMainThread()); @@ -173,13 +173,13 @@ class nsCallWifiListeners final : public nsIRunnable { NS_DECL_NSIRUNNABLE nsCallWifiListeners(nsAutoPtr aListeners, - nsAutoPtr > aAccessPoints) + nsAutoPtr > aAccessPoints) : mListeners(aListeners), mAccessPoints(aAccessPoints) {} private: ~nsCallWifiListeners() = default; nsAutoPtr mListeners; - nsAutoPtr > mAccessPoints; + nsAutoPtr > mAccessPoints; }; NS_IMPL_ISUPPORTS(nsCallWifiListeners, nsIRunnable) @@ -194,7 +194,7 @@ NS_IMETHODIMP nsCallWifiListeners::Run() { } nsresult nsWifiMonitor::CallWifiListeners( - const nsCOMArray &aAccessPoints, + const nsCOMArray& aAccessPoints, bool aAccessPointsChanged) { nsAutoPtr currentListeners; { @@ -212,8 +212,8 @@ nsresult nsWifiMonitor::CallWifiListeners( if (currentListeners->Length() > 0) { uint32_t resultCount = aAccessPoints.Count(); - nsAutoPtr > accessPoints( - new nsTArray(resultCount)); + nsAutoPtr > accessPoints( + new nsTArray(resultCount)); if (!accessPoints) return NS_ERROR_OUT_OF_MEMORY; for (uint32_t i = 0; i < resultCount; i++) diff --git a/netwerk/wifi/nsWifiScannerFreeBSD.cpp b/netwerk/wifi/nsWifiScannerFreeBSD.cpp index 1c6fb7d97cf9f..83ec847bdfe7a 100644 --- a/netwerk/wifi/nsWifiScannerFreeBSD.cpp +++ b/netwerk/wifi/nsWifiScannerFreeBSD.cpp @@ -28,9 +28,9 @@ using namespace mozilla; static nsresult FreeBSDGetAccessPointData( - nsCOMArray &accessPoints) { + nsCOMArray& accessPoints) { // get list of interfaces - struct ifaddrs *ifal; + struct ifaddrs* ifal; if (getifaddrs(&ifal) < 0) { return NS_ERROR_FAILURE; } @@ -39,7 +39,7 @@ static nsresult FreeBSDGetAccessPointData( // loop through the interfaces nsresult rv = NS_ERROR_FAILURE; - struct ifaddrs *ifa; + struct ifaddrs* ifa; for (ifa = ifal; ifa; ifa = ifa->ifa_next) { // limit to one interface per address if (ifa->ifa_addr->sa_family != AF_LINK) { @@ -92,14 +92,14 @@ static nsresult FreeBSDGetAccessPointData( close(s); // loop through WiFi networks and build geoloc-lookup structure - char *vsr = (char *)i802r.i_data; + char* vsr = (char*)i802r.i_data; unsigned len = i802r.i_len; while (len >= sizeof(struct ieee80211req_scan_result)) { - struct ieee80211req_scan_result *isr = - (struct ieee80211req_scan_result *)vsr; + struct ieee80211req_scan_result* isr = + (struct ieee80211req_scan_result*)vsr; // determine size of this entry - char *id; + char* id; int idlen; if (isr->isr_meshid_len) { id = vsr + isr->isr_ie_off + isr->isr_ssid_len; @@ -113,7 +113,7 @@ static nsresult FreeBSDGetAccessPointData( char ssid[IEEE80211_NWID_LEN + 1]; strncpy(ssid, id, idlen); ssid[idlen] = '\0'; - nsWifiAccessPoint *ap = new nsWifiAccessPoint(); + nsWifiAccessPoint* ap = new nsWifiAccessPoint(); ap->setSSID(ssid, strlen(ssid)); ap->setMac(isr->isr_bssid); ap->setSignal(isr->isr_rssi); diff --git a/netwerk/wifi/nsWifiScannerMac.cpp b/netwerk/wifi/nsWifiScannerMac.cpp index 827fb8777933a..051eab93c1df1 100644 --- a/netwerk/wifi/nsWifiScannerMac.cpp +++ b/netwerk/wifi/nsWifiScannerMac.cpp @@ -23,7 +23,7 @@ using namespace mozilla; // basically replaces accesspoints in the passed reference // it lives in a separate file so that we can use objective c. extern nsresult GetAccessPointsFromWLAN( - nsCOMArray &accessPoints); + nsCOMArray& accessPoints); nsresult nsWifiMonitor::DoScan() { // Regularly get the access point data. diff --git a/netwerk/wifi/nsWifiScannerSolaris.cpp b/netwerk/wifi/nsWifiScannerSolaris.cpp index d15ba9ad501db..b583b19103d65 100644 --- a/netwerk/wifi/nsWifiScannerSolaris.cpp +++ b/netwerk/wifi/nsWifiScannerSolaris.cpp @@ -17,7 +17,7 @@ using namespace mozilla; struct val_strength_t { - const char *strength_name; + const char* strength_name; int signal_value; }; @@ -27,8 +27,8 @@ static val_strength_t strength_vals[] = {{"very weak", -112}, {"very good", -40}, {"excellent", -16}}; -static nsWifiAccessPoint *do_parse_str(char *bssid_str, char *essid_str, - char *strength) { +static nsWifiAccessPoint* do_parse_str(char* bssid_str, char* essid_str, + char* strength) { unsigned char mac_as_int[6] = {0}; sscanf(bssid_str, "%x:%x:%x:%x:%x:%x", &mac_as_int[0], &mac_as_int[1], &mac_as_int[2], &mac_as_int[3], &mac_as_int[4], &mac_as_int[5]); @@ -42,7 +42,7 @@ static nsWifiAccessPoint *do_parse_str(char *bssid_str, char *essid_str, } } - nsWifiAccessPoint *ap = new nsWifiAccessPoint(); + nsWifiAccessPoint* ap = new nsWifiAccessPoint(); if (ap) { ap->setMac(mac_as_int); ap->setSignal(signal); @@ -52,12 +52,12 @@ static nsWifiAccessPoint *do_parse_str(char *bssid_str, char *essid_str, return ap; } -static void do_dladm(nsCOMArray &accessPoints) { - GError *err = nullptr; - char *sout = nullptr; - char *serr = nullptr; +static void do_dladm(nsCOMArray& accessPoints) { + GError* err = nullptr; + char* sout = nullptr; + char* serr = nullptr; int exit_status = 0; - char *dladm_args[] = { + char* dladm_args[] = { "/usr/bin/pfexec", "/usr/sbin/dladm", "scan-wifi", "-p", "-o", "BSSID,ESSID,STRENGTH"}; @@ -69,7 +69,7 @@ static void do_dladm(nsCOMArray &accessPoints) { uint32_t sout_scan = 0; uint32_t wlan_put = 0; bool escape = false; - nsWifiAccessPoint *ap; + nsWifiAccessPoint* ap; char sout_char; do { sout_char = sout[sout_scan++]; diff --git a/netwerk/wifi/osx_wifi.h b/netwerk/wifi/osx_wifi.h index aa5e6f74e5847..3a177f96438f7 100644 --- a/netwerk/wifi/osx_wifi.h +++ b/netwerk/wifi/osx_wifi.h @@ -72,12 +72,12 @@ typedef SInt32 WIErr; // A WirelessContext should be created using WirelessAttach // before any other Wireless functions are called. WirelessDetach // is used to dispose of a WirelessContext. -typedef struct __WirelessContext *WirelessContextPtr; +typedef struct __WirelessContext* WirelessContextPtr; // WirelessAttach // // This should be called before all other wireless functions. -typedef WIErr (*WirelessAttachFunction)(WirelessContextPtr *outContext, +typedef WIErr (*WirelessAttachFunction)(WirelessContextPtr* outContext, const UInt32); // WirelessDetach @@ -110,8 +110,8 @@ struct WirelessNetworkInfo { // // If stripDups != 0 only one bases tation for each SSID will be returned. typedef WIErr (*WirelessScanSplitFunction)(WirelessContextPtr inContext, - CFArrayRef *apList, - CFArrayRef *adhocList, + CFArrayRef* apList, + CFArrayRef* adhocList, const UInt32 stripDups); } // extern "C" diff --git a/netwerk/wifi/win_wifiScanner.cpp b/netwerk/wifi/win_wifiScanner.cpp index ddea1c2cfa324..cc42cd414c7a9 100644 --- a/netwerk/wifi/win_wifiScanner.cpp +++ b/netwerk/wifi/win_wifiScanner.cpp @@ -52,8 +52,8 @@ static void WINAPI OnScanComplete(PWLAN_NOTIFICATION_DATA data, PVOID context) { return; } - InterfaceScanCallbackData *cbData = - reinterpret_cast(context); + InterfaceScanCallbackData* cbData = + reinterpret_cast(context); cbData->OnInterfaceScanComplete(); } @@ -73,7 +73,7 @@ WinWifiScanner::WinWifiScanner() { WinWifiScanner::~WinWifiScanner() {} nsresult WinWifiScanner::GetAccessPointsFromWLAN( - nsCOMArray &accessPoints) { + nsCOMArray& accessPoints) { accessPoints.Clear(); // NOTE: We do not try to load the WLAN library if we previously failed @@ -83,7 +83,7 @@ nsresult WinWifiScanner::GetAccessPointsFromWLAN( } // Get the list of interfaces. WlanEnumInterfaces allocates interface_list. - WLAN_INTERFACE_INFO_LIST *interface_list = nullptr; + WLAN_INTERFACE_INFO_LIST* interface_list = nullptr; if (ERROR_SUCCESS != (*mWlanLibrary->GetWlanEnumInterfacesPtr())(mWlanLibrary->GetWLANHandle(), nullptr, &interface_list)) { @@ -132,7 +132,7 @@ nsresult WinWifiScanner::GetAccessPointsFromWLAN( // Go through the list of interfaces and get the data for each. for (uint32_t i = 0; i < interface_list->dwNumberOfItems; ++i) { - WLAN_BSS_LIST *bss_list; + WLAN_BSS_LIST* bss_list; if (ERROR_SUCCESS != (*mWlanLibrary->GetWlanGetNetworkBssListPtr())( mWlanLibrary->GetWLANHandle(), &interface_list->InterfaceInfo[i].InterfaceGuid, @@ -149,7 +149,7 @@ nsresult WinWifiScanner::GetAccessPointsFromWLAN( // Store each discovered access point in our outparam for (int j = 0; j < static_cast(bss_list->dwNumberOfItems); ++j) { - nsWifiAccessPoint *ap = new nsWifiAccessPoint(); + nsWifiAccessPoint* ap = new nsWifiAccessPoint(); if (!ap) { continue; } @@ -157,7 +157,7 @@ nsresult WinWifiScanner::GetAccessPointsFromWLAN( const WLAN_BSS_ENTRY bss_entry = bss_list->wlanBssEntries[j]; ap->setMac(bss_entry.dot11Bssid); ap->setSignal(bss_entry.lRssi); - ap->setSSID(reinterpret_cast(bss_entry.dot11Ssid.ucSSID), + ap->setSSID(reinterpret_cast(bss_entry.dot11Ssid.ucSSID), bss_entry.dot11Ssid.uSSIDLength); accessPoints.AppendObject(ap); diff --git a/netwerk/wifi/win_wifiScanner.h b/netwerk/wifi/win_wifiScanner.h index 79b1bf132d9f5..8c00a79f9f26f 100644 --- a/netwerk/wifi/win_wifiScanner.h +++ b/netwerk/wifi/win_wifiScanner.h @@ -25,7 +25,7 @@ class WinWifiScanner final { * @param accessPoints The collection to populate with available APs * @return NS_OK on success, failure codes on failure */ - nsresult GetAccessPointsFromWLAN(nsCOMArray &accessPoints); + nsresult GetAccessPointsFromWLAN(nsCOMArray& accessPoints); private: nsAutoPtr mWlanLibrary; diff --git a/parser/htmlparser/nsExpatDriver.cpp b/parser/htmlparser/nsExpatDriver.cpp index e29f6d95f7ecc..bef29df30c024 100644 --- a/parser/htmlparser/nsExpatDriver.cpp +++ b/parser/htmlparser/nsExpatDriver.cpp @@ -43,112 +43,112 @@ static mozilla::LazyLogModule gExpatDriverLog("expatdriver"); /***************************** EXPAT CALL BACKS ******************************/ // The callback handlers that get called from the expat parser. -static void Driver_HandleXMLDeclaration(void *aUserData, - const XML_Char *aVersion, - const XML_Char *aEncoding, +static void Driver_HandleXMLDeclaration(void* aUserData, + const XML_Char* aVersion, + const XML_Char* aEncoding, int aStandalone) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - nsExpatDriver *driver = static_cast(aUserData); + nsExpatDriver* driver = static_cast(aUserData); driver->HandleXMLDeclaration(aVersion, aEncoding, aStandalone); } } -static void Driver_HandleStartElement(void *aUserData, const XML_Char *aName, - const XML_Char **aAtts) { +static void Driver_HandleStartElement(void* aUserData, const XML_Char* aName, + const XML_Char** aAtts) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - static_cast(aUserData)->HandleStartElement(aName, aAtts); + static_cast(aUserData)->HandleStartElement(aName, aAtts); } } -static void Driver_HandleEndElement(void *aUserData, const XML_Char *aName) { +static void Driver_HandleEndElement(void* aUserData, const XML_Char* aName) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - static_cast(aUserData)->HandleEndElement(aName); + static_cast(aUserData)->HandleEndElement(aName); } } -static void Driver_HandleCharacterData(void *aUserData, const XML_Char *aData, +static void Driver_HandleCharacterData(void* aUserData, const XML_Char* aData, int aLength) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - nsExpatDriver *driver = static_cast(aUserData); + nsExpatDriver* driver = static_cast(aUserData); driver->HandleCharacterData(aData, uint32_t(aLength)); } } -static void Driver_HandleComment(void *aUserData, const XML_Char *aName) { +static void Driver_HandleComment(void* aUserData, const XML_Char* aName) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - static_cast(aUserData)->HandleComment(aName); + static_cast(aUserData)->HandleComment(aName); } } -static void Driver_HandleProcessingInstruction(void *aUserData, - const XML_Char *aTarget, - const XML_Char *aData) { +static void Driver_HandleProcessingInstruction(void* aUserData, + const XML_Char* aTarget, + const XML_Char* aData) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - nsExpatDriver *driver = static_cast(aUserData); + nsExpatDriver* driver = static_cast(aUserData); driver->HandleProcessingInstruction(aTarget, aData); } } -static void Driver_HandleDefault(void *aUserData, const XML_Char *aData, +static void Driver_HandleDefault(void* aUserData, const XML_Char* aData, int aLength) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - nsExpatDriver *driver = static_cast(aUserData); + nsExpatDriver* driver = static_cast(aUserData); driver->HandleDefault(aData, uint32_t(aLength)); } } -static void Driver_HandleStartCdataSection(void *aUserData) { +static void Driver_HandleStartCdataSection(void* aUserData) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - static_cast(aUserData)->HandleStartCdataSection(); + static_cast(aUserData)->HandleStartCdataSection(); } } -static void Driver_HandleEndCdataSection(void *aUserData) { +static void Driver_HandleEndCdataSection(void* aUserData) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - static_cast(aUserData)->HandleEndCdataSection(); + static_cast(aUserData)->HandleEndCdataSection(); } } -static void Driver_HandleStartDoctypeDecl(void *aUserData, - const XML_Char *aDoctypeName, - const XML_Char *aSysid, - const XML_Char *aPubid, +static void Driver_HandleStartDoctypeDecl(void* aUserData, + const XML_Char* aDoctypeName, + const XML_Char* aSysid, + const XML_Char* aPubid, int aHasInternalSubset) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - static_cast(aUserData)->HandleStartDoctypeDecl( + static_cast(aUserData)->HandleStartDoctypeDecl( aDoctypeName, aSysid, aPubid, !!aHasInternalSubset); } } -static void Driver_HandleEndDoctypeDecl(void *aUserData) { +static void Driver_HandleEndDoctypeDecl(void* aUserData) { NS_ASSERTION(aUserData, "expat driver should exist"); if (aUserData) { - static_cast(aUserData)->HandleEndDoctypeDecl(); + static_cast(aUserData)->HandleEndDoctypeDecl(); } } -static int Driver_HandleExternalEntityRef(void *aExternalEntityRefHandler, - const XML_Char *aOpenEntityNames, - const XML_Char *aBase, - const XML_Char *aSystemId, - const XML_Char *aPublicId) { +static int Driver_HandleExternalEntityRef(void* aExternalEntityRefHandler, + const XML_Char* aOpenEntityNames, + const XML_Char* aBase, + const XML_Char* aSystemId, + const XML_Char* aPublicId) { NS_ASSERTION(aExternalEntityRefHandler, "expat driver should exist"); if (!aExternalEntityRefHandler) { return 1; } - nsExpatDriver *driver = - static_cast(aExternalEntityRefHandler); + nsExpatDriver* driver = + static_cast(aExternalEntityRefHandler); return driver->HandleExternalEntityRef(aOpenEntityNames, aBase, aSystemId, aPublicId); @@ -165,9 +165,9 @@ static int Driver_HandleExternalEntityRef(void *aExternalEntityRefHandler, // XXX The cleanest solution here would be to fix Bug 98413: Implement XML // Catalogs. struct nsCatalogData { - const char *mPublicID; - const char *mLocalDTD; - const char *mAgentSheet; + const char* mPublicID; + const char* mLocalDTD; + const char* mAgentSheet; }; // The order of this table is guestimated to be in the optimum order @@ -184,13 +184,13 @@ static const nsCatalogData kCatalogTable[] = { {"-//WAPFORUM//DTD XHTML Mobile 1.0//EN", "htmlmathml-f.ent", nullptr}, {nullptr, nullptr, nullptr}}; -static const nsCatalogData *LookupCatalogData(const char16_t *aPublicID) { +static const nsCatalogData* LookupCatalogData(const char16_t* aPublicID) { nsDependentString publicID(aPublicID); // linear search for now since the number of entries is going to // be negligible, and the fix for bug 98413 would get rid of this // code anyway - const nsCatalogData *data = kCatalogTable; + const nsCatalogData* data = kCatalogTable; while (data->mPublicID) { if (publicID.EqualsASCII(data->mPublicID)) { return data; @@ -205,8 +205,8 @@ static const nsCatalogData *LookupCatalogData(const char16_t *aPublicID) { // in resource://gre/res/dtd/ which may or may not exist. // If aCatalogData is provided, it is used to remap the // DTD instead of taking the filename from the URI. -static void GetLocalDTDURI(const nsCatalogData *aCatalogData, nsIURI *aDTD, - nsIURI **aResult) { +static void GetLocalDTDURI(const nsCatalogData* aCatalogData, nsIURI* aDTD, + nsIURI** aResult) { NS_ASSERTION(aDTD, "Null parameter."); nsAutoCString fileName; @@ -267,8 +267,8 @@ nsExpatDriver::~nsExpatDriver() { } } -nsresult nsExpatDriver::HandleStartElement(const char16_t *aValue, - const char16_t **aAtts) { +nsresult nsExpatDriver::HandleStartElement(const char16_t* aValue, + const char16_t** aAtts) { NS_ASSERTION(mSink, "content sink not found!"); // Calculate the total number of elements in aAtts. @@ -291,7 +291,7 @@ nsresult nsExpatDriver::HandleStartElement(const char16_t *aValue, return NS_OK; } -nsresult nsExpatDriver::HandleEndElement(const char16_t *aValue) { +nsresult nsExpatDriver::HandleEndElement(const char16_t* aValue) { NS_ASSERTION(mSink, "content sink not found!"); NS_ASSERTION(mInternalState != NS_ERROR_HTMLPARSER_BLOCK, "Shouldn't block from HandleStartElement."); @@ -304,7 +304,7 @@ nsresult nsExpatDriver::HandleEndElement(const char16_t *aValue) { return NS_OK; } -nsresult nsExpatDriver::HandleCharacterData(const char16_t *aValue, +nsresult nsExpatDriver::HandleCharacterData(const char16_t* aValue, const uint32_t aLength) { NS_ASSERTION(mSink, "content sink not found!"); @@ -320,7 +320,7 @@ nsresult nsExpatDriver::HandleCharacterData(const char16_t *aValue, return NS_OK; } -nsresult nsExpatDriver::HandleComment(const char16_t *aValue) { +nsresult nsExpatDriver::HandleComment(const char16_t* aValue) { NS_ASSERTION(mSink, "content sink not found!"); if (mInExternalDTD) { @@ -340,8 +340,8 @@ nsresult nsExpatDriver::HandleComment(const char16_t *aValue) { return NS_OK; } -nsresult nsExpatDriver::HandleProcessingInstruction(const char16_t *aTarget, - const char16_t *aData) { +nsresult nsExpatDriver::HandleProcessingInstruction(const char16_t* aTarget, + const char16_t* aData) { NS_ASSERTION(mSink, "content sink not found!"); if (mInExternalDTD) { @@ -364,8 +364,8 @@ nsresult nsExpatDriver::HandleProcessingInstruction(const char16_t *aTarget, return NS_OK; } -nsresult nsExpatDriver::HandleXMLDeclaration(const char16_t *aVersion, - const char16_t *aEncoding, +nsresult nsExpatDriver::HandleXMLDeclaration(const char16_t* aVersion, + const char16_t* aEncoding, int32_t aStandalone) { if (mSink) { nsresult rv = mSink->HandleXMLDeclaration(aVersion, aEncoding, aStandalone); @@ -375,7 +375,7 @@ nsresult nsExpatDriver::HandleXMLDeclaration(const char16_t *aVersion, return NS_OK; } -nsresult nsExpatDriver::HandleDefault(const char16_t *aValue, +nsresult nsExpatDriver::HandleDefault(const char16_t* aValue, const uint32_t aLength) { NS_ASSERTION(mSink, "content sink not found!"); @@ -420,9 +420,9 @@ nsresult nsExpatDriver::HandleEndCdataSection() { return NS_OK; } -nsresult nsExpatDriver::HandleStartDoctypeDecl(const char16_t *aDoctypeName, - const char16_t *aSysid, - const char16_t *aPubid, +nsresult nsExpatDriver::HandleStartDoctypeDecl(const char16_t* aDoctypeName, + const char16_t* aSysid, + const char16_t* aPubid, bool aHasInternalSubset) { mDoctypeName = aDoctypeName; mSystemID = aSysid; @@ -474,13 +474,13 @@ nsresult nsExpatDriver::HandleEndDoctypeDecl() { return NS_OK; } -static nsresult ExternalDTDStreamReaderFunc(nsIUnicharInputStream *aIn, - void *aClosure, - const char16_t *aFromSegment, +static nsresult ExternalDTDStreamReaderFunc(nsIUnicharInputStream* aIn, + void* aClosure, + const char16_t* aFromSegment, uint32_t aToOffset, uint32_t aCount, - uint32_t *aWriteCount) { + uint32_t* aWriteCount) { // Pass the buffer to expat for parsing. - if (XML_Parse((XML_Parser)aClosure, (const char *)aFromSegment, + if (XML_Parse((XML_Parser)aClosure, (const char*)aFromSegment, aCount * sizeof(char16_t), 0) == XML_STATUS_OK) { *aWriteCount = aCount; @@ -492,10 +492,10 @@ static nsresult ExternalDTDStreamReaderFunc(nsIUnicharInputStream *aIn, return NS_ERROR_FAILURE; } -int nsExpatDriver::HandleExternalEntityRef(const char16_t *openEntityNames, - const char16_t *base, - const char16_t *systemId, - const char16_t *publicId) { +int nsExpatDriver::HandleExternalEntityRef(const char16_t* openEntityNames, + const char16_t* base, + const char16_t* systemId, + const char16_t* publicId) { if (mInInternalSubset && !mInExternalDTD && openEntityNames) { mInternalSubset.Append(char16_t('%')); mInternalSubset.Append(nsDependentString(openEntityNames)); @@ -553,11 +553,11 @@ int nsExpatDriver::HandleExternalEntityRef(const char16_t *openEntityNames, return result; } -nsresult nsExpatDriver::OpenInputStreamFromExternalDTD(const char16_t *aFPIStr, - const char16_t *aURLStr, - const char16_t *aBaseURL, - nsIInputStream **aStream, - nsAString &aAbsURL) { +nsresult nsExpatDriver::OpenInputStreamFromExternalDTD(const char16_t* aFPIStr, + const char16_t* aURLStr, + const char16_t* aBaseURL, + nsIInputStream** aStream, + nsAString& aAbsURL) { nsCOMPtr baseURI; nsresult rv = NS_NewURI(getter_AddRefs(baseURI), NS_ConvertUTF16toUTF8(aBaseURL)); @@ -628,11 +628,11 @@ nsresult nsExpatDriver::OpenInputStreamFromExternalDTD(const char16_t *aFPIStr, return channel->Open(aStream); } -static nsresult CreateErrorText(const char16_t *aDescription, - const char16_t *aSourceURL, +static nsresult CreateErrorText(const char16_t* aDescription, + const char16_t* aSourceURL, const uint32_t aLineNumber, const uint32_t aColNumber, - nsString &aErrorString) { + nsString& aErrorString) { aErrorString.Truncate(); nsAutoString msg; @@ -647,8 +647,8 @@ static nsresult CreateErrorText(const char16_t *aDescription, } static nsresult AppendErrorPointer(const int32_t aColNumber, - const char16_t *aSourceLine, - nsString &aSourceString) { + const char16_t* aSourceLine, + nsString& aSourceString) { aSourceString.Append(char16_t('\n')); // Last character will be '^'. @@ -691,10 +691,10 @@ nsresult nsExpatDriver::HandleError() { * and we use 0xFFFF for the . * */ - const char16_t *mismatch = MOZ_XML_GetMismatchedTag(mExpatParser); - const char16_t *uriEnd = nullptr; - const char16_t *nameEnd = nullptr; - const char16_t *pos; + const char16_t* mismatch = MOZ_XML_GetMismatchedTag(mExpatParser); + const char16_t* uriEnd = nullptr; + const char16_t* nameEnd = nullptr; + const char16_t* pos; for (pos = mismatch; *pos; ++pos) { if (*pos == kExpatSeparatorChar) { if (uriEnd) { @@ -711,7 +711,7 @@ nsresult nsExpatDriver::HandleError() { tagName.Append(nameEnd + 1, pos - nameEnd - 1); tagName.Append(char16_t(':')); } - const char16_t *nameStart = uriEnd ? uriEnd + 1 : mismatch; + const char16_t* nameStart = uriEnd ? uriEnd + 1 : mismatch; tagName.Append(nameStart, (nameEnd ? nameEnd : pos) - nameStart); nsAutoString msg; @@ -774,8 +774,8 @@ nsresult nsExpatDriver::HandleError() { return NS_ERROR_HTMLPARSER_STOPPARSING; } -void nsExpatDriver::ParseBuffer(const char16_t *aBuffer, uint32_t aLength, - bool aIsFinal, uint32_t *aConsumed) { +void nsExpatDriver::ParseBuffer(const char16_t* aBuffer, uint32_t aLength, + bool aIsFinal, uint32_t* aConsumed) { NS_ASSERTION((aBuffer && aLength != 0) || (!aBuffer && aLength == 0), "?"); NS_ASSERTION(mInternalState != NS_OK || aIsFinal || aBuffer, "Useless call, we won't call Expat"); @@ -793,7 +793,7 @@ void nsExpatDriver::ParseBuffer(const char16_t *aBuffer, uint32_t aLength, mInternalState = NS_OK; // Resume in case we're blocked. status = XML_ResumeParser(mExpatParser); } else { - status = XML_Parse(mExpatParser, reinterpret_cast(aBuffer), + status = XML_Parse(mExpatParser, reinterpret_cast(aBuffer), aLength * sizeof(char16_t), aIsFinal); } @@ -822,7 +822,7 @@ void nsExpatDriver::ParseBuffer(const char16_t *aBuffer, uint32_t aLength, } NS_IMETHODIMP -nsExpatDriver::ConsumeToken(nsScanner &aScanner, bool &aFlushTokens) { +nsExpatDriver::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens) { // We keep the scanner pointing to the position where Expat will start // parsing. nsScannerIterator currentExpatPosition; @@ -849,7 +849,7 @@ nsExpatDriver::ConsumeToken(nsScanner &aScanner, bool &aFlushTokens) { bool noMoreBuffers = start == end && mIsFinalChunk; bool blocked = BlockedOrInterrupted(); - const char16_t *buffer; + const char16_t* buffer; uint32_t length; if (blocked || noMoreBuffers) { // If we're blocked we just resume Expat so we don't need a buffer, if @@ -946,7 +946,7 @@ nsExpatDriver::ConsumeToken(nsScanner &aScanner, bool &aFlushTokens) { while (lastLine != end) { length = uint32_t(lastLine.size_forward()); uint32_t endOffset = 0; - const char16_t *buffer = lastLine.get(); + const char16_t* buffer = lastLine.get(); while (endOffset < length && buffer[endOffset] != '\n' && buffer[endOffset] != '\r') { ++endOffset; @@ -991,8 +991,8 @@ nsExpatDriver::ConsumeToken(nsScanner &aScanner, bool &aFlushTokens) { } NS_IMETHODIMP -nsExpatDriver::WillBuildModel(const CParserContext &aParserContext, - nsITokenizer *aTokenizer, nsIContentSink *aSink) { +nsExpatDriver::WillBuildModel(const CParserContext& aParserContext, + nsITokenizer* aTokenizer, nsIContentSink* aSink) { mSink = do_QueryInterface(aSink); if (!mSink) { NS_ERROR("nsExpatDriver didn't get an nsIExpatSink"); @@ -1028,7 +1028,7 @@ nsExpatDriver::WillBuildModel(const CParserContext &aParserContext, inner = win->GetCurrentInnerWindow(); } else { bool aHasHadScriptHandlingObject; - nsIScriptGlobalObject *global = + nsIScriptGlobalObject* global = doc->GetScriptHandlingObject(aHasHadScriptHandlingObject); if (global) { inner = do_QueryInterface(global); @@ -1067,7 +1067,7 @@ nsExpatDriver::WillBuildModel(const CParserContext &aParserContext, } NS_IMETHODIMP -nsExpatDriver::BuildModel(nsITokenizer *aTokenizer, nsIContentSink *aSink) { +nsExpatDriver::BuildModel(nsITokenizer* aTokenizer, nsIContentSink* aSink) { return mInternalState; } diff --git a/parser/htmlparser/nsExpatDriver.h b/parser/htmlparser/nsExpatDriver.h index 954ef116182b5..a6bda0b16a143 100644 --- a/parser/htmlparser/nsExpatDriver.h +++ b/parser/htmlparser/nsExpatDriver.h @@ -30,33 +30,33 @@ class nsExpatDriver : public nsIDTD, public nsITokenizer { nsExpatDriver(); - int HandleExternalEntityRef(const char16_t *aOpenEntityNames, - const char16_t *aBase, const char16_t *aSystemId, - const char16_t *aPublicId); - nsresult HandleStartElement(const char16_t *aName, const char16_t **aAtts); - nsresult HandleEndElement(const char16_t *aName); - nsresult HandleCharacterData(const char16_t *aCData, const uint32_t aLength); - nsresult HandleComment(const char16_t *aName); - nsresult HandleProcessingInstruction(const char16_t *aTarget, - const char16_t *aData); - nsresult HandleXMLDeclaration(const char16_t *aVersion, - const char16_t *aEncoding, int32_t aStandalone); - nsresult HandleDefault(const char16_t *aData, const uint32_t aLength); + int HandleExternalEntityRef(const char16_t* aOpenEntityNames, + const char16_t* aBase, const char16_t* aSystemId, + const char16_t* aPublicId); + nsresult HandleStartElement(const char16_t* aName, const char16_t** aAtts); + nsresult HandleEndElement(const char16_t* aName); + nsresult HandleCharacterData(const char16_t* aCData, const uint32_t aLength); + nsresult HandleComment(const char16_t* aName); + nsresult HandleProcessingInstruction(const char16_t* aTarget, + const char16_t* aData); + nsresult HandleXMLDeclaration(const char16_t* aVersion, + const char16_t* aEncoding, int32_t aStandalone); + nsresult HandleDefault(const char16_t* aData, const uint32_t aLength); nsresult HandleStartCdataSection(); nsresult HandleEndCdataSection(); - nsresult HandleStartDoctypeDecl(const char16_t *aDoctypeName, - const char16_t *aSysid, - const char16_t *aPubid, + nsresult HandleStartDoctypeDecl(const char16_t* aDoctypeName, + const char16_t* aSysid, + const char16_t* aPubid, bool aHasInternalSubset); nsresult HandleEndDoctypeDecl(); private: // Load up an external stream to get external entity information - nsresult OpenInputStreamFromExternalDTD(const char16_t *aFPIStr, - const char16_t *aURLStr, - const char16_t *aBaseURL, - nsIInputStream **aStream, - nsAString &aAbsURL); + nsresult OpenInputStreamFromExternalDTD(const char16_t* aFPIStr, + const char16_t* aURLStr, + const char16_t* aBaseURL, + nsIInputStream** aStream, + nsAString& aAbsURL); /** * Pass a buffer to Expat. If Expat is blocked aBuffer should be null and @@ -74,8 +74,8 @@ class nsExpatDriver : public nsIDTD, public nsITokenizer { * doesn't include the PRUnichars that Expat stored in * its buffer but didn't parse yet. */ - void ParseBuffer(const char16_t *aBuffer, uint32_t aLength, bool aIsFinal, - uint32_t *aConsumed); + void ParseBuffer(const char16_t* aBuffer, uint32_t aLength, bool aIsFinal, + uint32_t* aConsumed); nsresult HandleError(); void MaybeStopParser(nsresult aState); @@ -113,7 +113,7 @@ class nsExpatDriver : public nsIDTD, public nsITokenizer { nsCOMPtr mOriginalSink; nsCOMPtr mSink; - const nsCatalogData *mCatalogData; // weak + const nsCatalogData* mCatalogData; // weak nsString mURISpec; // Used for error reporting. diff --git a/security/manager/pki/nsASN1Tree.h b/security/manager/pki/nsASN1Tree.h index 1b9310159084f..bb25d7917b9ca 100644 --- a/security/manager/pki/nsASN1Tree.h +++ b/security/manager/pki/nsASN1Tree.h @@ -54,32 +54,32 @@ class nsNSSASN1Tree : public nsIASN1Tree { public: nsCOMPtr obj; nsCOMPtr seq; - myNode *child; - myNode *next; - myNode *parent; + myNode* child; + myNode* next; + myNode* parent; myNode() { child = next = parent = nullptr; } }; - myNode *mTopNode; + myNode* mTopNode; nsCOMPtr mASN1Object; nsCOMPtr mSelection; RefPtr mTree; void InitNodes(); - void InitChildsRecursively(myNode *n); + void InitChildsRecursively(myNode* n); void ClearNodes(); - void ClearNodesRecursively(myNode *n); + void ClearNodesRecursively(myNode* n); - int32_t CountVisibleNodes(myNode *n); - myNode *FindNodeFromIndex(myNode *n, int32_t wantedIndex, - int32_t &index_counter, int32_t &level_counter, - int32_t *optionalOutParentIndex, - int32_t *optionalOutLevel); - myNode *FindNodeFromIndex(int32_t wantedIndex, - int32_t *optionalOutParentIndex = nullptr, - int32_t *optionalOutLevel = nullptr); + int32_t CountVisibleNodes(myNode* n); + myNode* FindNodeFromIndex(myNode* n, int32_t wantedIndex, + int32_t& index_counter, int32_t& level_counter, + int32_t* optionalOutParentIndex, + int32_t* optionalOutLevel); + myNode* FindNodeFromIndex(int32_t wantedIndex, + int32_t* optionalOutParentIndex = nullptr, + int32_t* optionalOutLevel = nullptr); }; #endif //_NSSASNTREE_H_ diff --git a/security/manager/ssl/NSSErrorsService.cpp b/security/manager/ssl/NSSErrorsService.cpp index 736bd7c714c34..e4161cfd58261 100644 --- a/security/manager/ssl/NSSErrorsService.cpp +++ b/security/manager/ssl/NSSErrorsService.cpp @@ -82,7 +82,7 @@ nsresult GetXPCOMFromNSSError(PRErrorCode code) { } NS_IMETHODIMP -NSSErrorsService::IsNSSErrorCode(int32_t aNSPRCode, bool *_retval) { +NSSErrorsService::IsNSSErrorCode(int32_t aNSPRCode, bool* _retval) { if (!_retval) { return NS_ERROR_INVALID_ARG; } @@ -93,7 +93,7 @@ NSSErrorsService::IsNSSErrorCode(int32_t aNSPRCode, bool *_retval) { NS_IMETHODIMP NSSErrorsService::GetXPCOMFromNSSError(int32_t aNSPRCode, - nsresult *aXPCOMErrorCode) { + nsresult* aXPCOMErrorCode) { if (!aXPCOMErrorCode) { return NS_ERROR_INVALID_ARG; } @@ -109,7 +109,7 @@ NSSErrorsService::GetXPCOMFromNSSError(int32_t aNSPRCode, NS_IMETHODIMP NSSErrorsService::GetErrorClass(nsresult aXPCOMErrorCode, - uint32_t *aErrorClass) { + uint32_t* aErrorClass) { NS_ENSURE_ARG(aErrorClass); if (NS_ERROR_GET_MODULE(aXPCOMErrorCode) != NS_ERROR_MODULE_SECURITY || @@ -158,7 +158,7 @@ bool ErrorIsOverridable(PRErrorCode code) { } } -static const char *getOverrideErrorStringName(PRErrorCode aErrorCode) { +static const char* getOverrideErrorStringName(PRErrorCode aErrorCode) { switch (aErrorCode) { case SSL_ERROR_SSL_DISABLED: return "PSMERR_SSL_Disabled"; @@ -175,7 +175,7 @@ static const char *getOverrideErrorStringName(PRErrorCode aErrorCode) { NS_IMETHODIMP NSSErrorsService::GetErrorMessage(nsresult aXPCOMErrorCode, - nsAString &aErrorMessage) { + nsAString& aErrorMessage) { if (NS_ERROR_GET_MODULE(aXPCOMErrorCode) != NS_ERROR_MODULE_SECURITY || NS_ERROR_GET_SEVERITY(aXPCOMErrorCode) != NS_ERROR_SEVERITY_ERROR) { return NS_ERROR_FAILURE; @@ -188,7 +188,7 @@ NSSErrorsService::GetErrorMessage(nsresult aXPCOMErrorCode, } nsCOMPtr theBundle = mPIPNSSBundle; - const char *idStr = getOverrideErrorStringName(aNSPRCode); + const char* idStr = getOverrideErrorStringName(aNSPRCode); if (!idStr) { idStr = PR_ErrorToName(aNSPRCode); diff --git a/security/manager/ssl/PSMContentListener.h b/security/manager/ssl/PSMContentListener.h index 19e32eee46be4..7b66d14a97d4b 100644 --- a/security/manager/ssl/PSMContentListener.h +++ b/security/manager/ssl/PSMContentListener.h @@ -58,19 +58,19 @@ class PSMContentDownloaderParent : public PPSMContentDownloaderParent, public: explicit PSMContentDownloaderParent(uint32_t type); - mozilla::ipc::IPCResult RecvOnStartRequest(const uint32_t &contentLength); - mozilla::ipc::IPCResult RecvOnDataAvailable(const nsCString &data, - const uint64_t &offset, - const uint32_t &count); - mozilla::ipc::IPCResult RecvOnStopRequest(const nsresult &code); + mozilla::ipc::IPCResult RecvOnStartRequest(const uint32_t& contentLength); + mozilla::ipc::IPCResult RecvOnDataAvailable(const nsCString& data, + const uint64_t& offset, + const uint32_t& count); + mozilla::ipc::IPCResult RecvOnStopRequest(const nsresult& code); // We inherit most of nsIStreamListener from PSMContentStreamListener, but // we have to override OnStopRequest to know when we're done with our IPC // ref. - NS_IMETHOD OnStopRequest(nsIRequest *request, nsresult code) override; + NS_IMETHOD OnStopRequest(nsIRequest* request, nsresult code) override; mozilla::ipc::IPCResult RecvDivertToParentUsing( - mozilla::net::PChannelDiverterParent *diverter); + mozilla::net::PChannelDiverterParent* diverter); protected: virtual ~PSMContentDownloaderParent(); diff --git a/security/manager/ssl/md4.c b/security/manager/ssl/md4.c index 6f0764b6e1c15..ba8e14d1f3c91 100644 --- a/security/manager/ssl/md4.c +++ b/security/manager/ssl/md4.c @@ -38,8 +38,8 @@ a = ROTL(a, s) /* converts from word array to byte array, len is number of bytes */ -static void w2b(uint8_t *out, const uint32_t *in, uint32_t len) { - uint8_t *bp; +static void w2b(uint8_t* out, const uint32_t* in, uint32_t len) { + uint8_t* bp; const uint32_t *wp, *wpend; bp = out; @@ -55,8 +55,8 @@ static void w2b(uint8_t *out, const uint32_t *in, uint32_t len) { } /* converts from byte array to word array, len is number of bytes */ -static void b2w(uint32_t *out, const uint8_t *in, uint32_t len) { - uint32_t *wp; +static void b2w(uint32_t* out, const uint8_t* in, uint32_t len) { + uint32_t* wp; const uint8_t *bp, *bpend; wp = out; @@ -70,7 +70,7 @@ static void b2w(uint32_t *out, const uint8_t *in, uint32_t len) { } /* update state: data is 64 bytes in length */ -static void md4step(uint32_t state[4], const uint8_t *data) { +static void md4step(uint32_t state[4], const uint8_t* data) { uint32_t A, B, C, D, X[16]; b2w(X, data, 64); @@ -137,7 +137,7 @@ static void md4step(uint32_t state[4], const uint8_t *data) { state[3] += D; } -void md4sum(const uint8_t *input, uint32_t inputLen, uint8_t *result) { +void md4sum(const uint8_t* input, uint32_t inputLen, uint8_t* result) { uint8_t final[128]; uint32_t i, n, m, state[4]; uint64_t inputLenBits; diff --git a/security/manager/ssl/md4.h b/security/manager/ssl/md4.h index 4107aed4071d4..6e56a4ffdc51e 100644 --- a/security/manager/ssl/md4.h +++ b/security/manager/ssl/md4.h @@ -29,7 +29,7 @@ extern "C" { * interface would make more sense if that were a requirement. Currently, this * is good enough for the applications we care about. */ -void md4sum(const uint8_t *input, uint32_t inputLen, uint8_t *result); +void md4sum(const uint8_t* input, uint32_t inputLen, uint8_t* result); #ifdef __cplusplus } diff --git a/security/manager/ssl/nsCertOverrideService.cpp b/security/manager/ssl/nsCertOverrideService.cpp index b8537e5b82135..2057178e6fffc 100644 --- a/security/manager/ssl/nsCertOverrideService.cpp +++ b/security/manager/ssl/nsCertOverrideService.cpp @@ -35,7 +35,7 @@ using namespace mozilla::psm; #define CERT_OVERRIDE_FILE_NAME "cert_override.txt" void nsCertOverride::convertBitsToString(OverrideBits ob, - /*out*/ nsACString &str) { + /*out*/ nsACString& str) { str.Truncate(); if (ob & OverrideBits::Mismatch) { @@ -51,8 +51,8 @@ void nsCertOverride::convertBitsToString(OverrideBits ob, } } -void nsCertOverride::convertStringToBits(const nsACString &str, - /*out*/ OverrideBits &ob) { +void nsCertOverride::convertStringToBits(const nsACString& str, + /*out*/ OverrideBits& ob) { ob = OverrideBits::None; for (uint32_t i = 0; i < str.Length(); i++) { @@ -110,8 +110,8 @@ nsresult nsCertOverrideService::Init() { } NS_IMETHODIMP -nsCertOverrideService::Observe(nsISupports *, const char *aTopic, - const char16_t *aData) { +nsCertOverrideService::Observe(nsISupports*, const char* aTopic, + const char16_t* aData) { // check the topic if (!nsCRT::strcmp(aTopic, "profile-before-change")) { // The profile is about to change, @@ -147,7 +147,7 @@ void nsCertOverrideService::RemoveAllFromMemory() { void nsCertOverrideService::RemoveAllTemporaryOverrides() { MutexAutoLock lock(mMutex); for (auto iter = mSettingsTable.Iter(); !iter.Done(); iter.Next()) { - nsCertOverrideEntry *entry = iter.Get(); + nsCertOverrideEntry* entry = iter.Get(); if (entry->mSettings.mIsTemporary) { entry->mSettings.mCert = nullptr; iter.Remove(); @@ -156,7 +156,7 @@ void nsCertOverrideService::RemoveAllTemporaryOverrides() { // no need to write, as temporaries are never written to disk } -nsresult nsCertOverrideService::Read(const MutexAutoLock &aProofOfLock) { +nsresult nsCertOverrideService::Read(const MutexAutoLock& aProofOfLock) { // If we don't have a profile, then we won't try to read any settings file. if (!mSettingsFile) return NS_OK; @@ -208,14 +208,14 @@ nsresult nsCertOverrideService::Read(const MutexAutoLock &aProofOfLock) { continue; } - const nsACString &tmp = + const nsACString& tmp = Substring(buffer, hostIndex, algoIndex - hostIndex - 1); // We just ignore the algorithm string. - const nsACString &fingerprint = Substring( + const nsACString& fingerprint = Substring( buffer, fingerprintIndex, overrideBitsIndex - fingerprintIndex - 1); - const nsACString &bits_string = Substring( + const nsACString& bits_string = Substring( buffer, overrideBitsIndex, dbKeyIndex - overrideBitsIndex - 1); - const nsACString &db_key = + const nsACString& db_key = Substring(buffer, dbKeyIndex, buffer.Length() - dbKeyIndex); nsAutoCString host(tmp); @@ -243,7 +243,7 @@ nsresult nsCertOverrideService::Read(const MutexAutoLock &aProofOfLock) { } static const char sSHA256OIDString[] = "OID.2.16.840.1.101.3.4.2.1"; -nsresult nsCertOverrideService::Write(const MutexAutoLock &aProofOfLock) { +nsresult nsCertOverrideService::Write(const MutexAutoLock& aProofOfLock) { // If we don't have any profile, then we won't try to write any file if (!mSettingsFile) { return NS_OK; @@ -277,9 +277,9 @@ nsresult nsCertOverrideService::Write(const MutexAutoLock &aProofOfLock) { static const char kTab[] = "\t"; for (auto iter = mSettingsTable.Iter(); !iter.Done(); iter.Next()) { - nsCertOverrideEntry *entry = iter.Get(); + nsCertOverrideEntry* entry = iter.Get(); - const nsCertOverride &settings = entry->mSettings; + const nsCertOverride& settings = entry->mSettings; if (settings.mIsTemporary) { continue; } @@ -320,8 +320,8 @@ nsresult nsCertOverrideService::Write(const MutexAutoLock &aProofOfLock) { return NS_OK; } -static nsresult GetCertFingerprintByOidTag(nsIX509Cert *aCert, - SECOidTag aOidTag, nsCString &fp) { +static nsresult GetCertFingerprintByOidTag(nsIX509Cert* aCert, + SECOidTag aOidTag, nsCString& fp) { UniqueCERTCertificate nsscert(aCert->GetCert()); if (!nsscert) { return NS_ERROR_FAILURE; @@ -330,9 +330,9 @@ static nsresult GetCertFingerprintByOidTag(nsIX509Cert *aCert, } NS_IMETHODIMP -nsCertOverrideService::RememberValidityOverride(const nsACString &aHostName, +nsCertOverrideService::RememberValidityOverride(const nsACString& aHostName, int32_t aPort, - nsIX509Cert *aCert, + nsIX509Cert* aCert, uint32_t aOverrideBits, bool aTemporary) { NS_ENSURE_ARG_POINTER(aCert); @@ -387,8 +387,8 @@ nsCertOverrideService::RememberValidityOverride(const nsACString &aHostName, NS_IMETHODIMP nsCertOverrideService::RememberTemporaryValidityOverrideUsingFingerprint( - const nsACString &aHostName, int32_t aPort, - const nsACString &aCertFingerprint, uint32_t aOverrideBits) { + const nsACString& aHostName, int32_t aPort, + const nsACString& aCertFingerprint, uint32_t aOverrideBits) { if (aCertFingerprint.IsEmpty() || aHostName.IsEmpty() || (aPort < -1)) { return NS_ERROR_INVALID_ARG; } @@ -405,10 +405,10 @@ nsCertOverrideService::RememberTemporaryValidityOverrideUsingFingerprint( } NS_IMETHODIMP -nsCertOverrideService::HasMatchingOverride(const nsACString &aHostName, - int32_t aPort, nsIX509Cert *aCert, - uint32_t *aOverrideBits, - bool *aIsTemporary, bool *_retval) { +nsCertOverrideService::HasMatchingOverride(const nsACString& aHostName, + int32_t aPort, nsIX509Cert* aCert, + uint32_t* aOverrideBits, + bool* aIsTemporary, bool* _retval) { if (aHostName.IsEmpty()) return NS_ERROR_INVALID_ARG; if (aPort < -1) return NS_ERROR_INVALID_ARG; @@ -425,7 +425,7 @@ nsCertOverrideService::HasMatchingOverride(const nsACString &aHostName, { MutexAutoLock lock(mMutex); - nsCertOverrideEntry *entry = mSettingsTable.GetEntry(hostPort.get()); + nsCertOverrideEntry* entry = mSettingsTable.GetEntry(hostPort.get()); if (!entry) return NS_OK; @@ -448,14 +448,14 @@ nsCertOverrideService::HasMatchingOverride(const nsACString &aHostName, } nsresult nsCertOverrideService::AddEntryToList( - const nsACString &aHostName, int32_t aPort, nsIX509Cert *aCert, - const bool aIsTemporary, const nsACString &fingerprint, - nsCertOverride::OverrideBits ob, const nsACString &dbKey, - const MutexAutoLock &aProofOfLock) { + const nsACString& aHostName, int32_t aPort, nsIX509Cert* aCert, + const bool aIsTemporary, const nsACString& fingerprint, + nsCertOverride::OverrideBits ob, const nsACString& dbKey, + const MutexAutoLock& aProofOfLock) { nsAutoCString hostPort; GetHostWithPort(aHostName, aPort, hostPort); - nsCertOverrideEntry *entry = mSettingsTable.PutEntry(hostPort.get()); + nsCertOverrideEntry* entry = mSettingsTable.PutEntry(hostPort.get()); if (!entry) { NS_ERROR("can't insert a null entry!"); @@ -464,7 +464,7 @@ nsresult nsCertOverrideService::AddEntryToList( entry->mHostWithPort = hostPort; - nsCertOverride &settings = entry->mSettings; + nsCertOverride& settings = entry->mSettings; settings.mAsciiHost = aHostName; settings.mPort = aPort; settings.mIsTemporary = aIsTemporary; @@ -479,7 +479,7 @@ nsresult nsCertOverrideService::AddEntryToList( } NS_IMETHODIMP -nsCertOverrideService::ClearValidityOverride(const nsACString &aHostName, +nsCertOverrideService::ClearValidityOverride(const nsACString& aHostName, int32_t aPort) { if (!NS_IsMainThread()) { return NS_ERROR_NOT_SAME_THREAD; @@ -508,7 +508,7 @@ nsCertOverrideService::ClearValidityOverride(const nsACString &aHostName, } void nsCertOverrideService::CountPermanentOverrideTelemetry( - const MutexAutoLock &aProofOfLock) { + const MutexAutoLock& aProofOfLock) { uint32_t overrideCount = 0; for (auto iter = mSettingsTable.Iter(); !iter.Done(); iter.Next()) { if (!iter.Get()->mSettings.mIsTemporary) { @@ -519,7 +519,7 @@ void nsCertOverrideService::CountPermanentOverrideTelemetry( overrideCount); } -static bool matchesDBKey(nsIX509Cert *cert, const nsCString &matchDbKey) { +static bool matchesDBKey(nsIX509Cert* cert, const nsCString& matchDbKey) { nsAutoCString dbKey; nsresult rv = cert->GetDbKey(dbKey); if (NS_FAILED(rv)) { @@ -529,10 +529,10 @@ static bool matchesDBKey(nsIX509Cert *cert, const nsCString &matchDbKey) { } NS_IMETHODIMP -nsCertOverrideService::IsCertUsedForOverrides(nsIX509Cert *aCert, +nsCertOverrideService::IsCertUsedForOverrides(nsIX509Cert* aCert, bool aCheckTemporaries, bool aCheckPermanents, - uint32_t *_retval) { + uint32_t* _retval) { NS_ENSURE_ARG(aCert); NS_ENSURE_ARG(_retval); @@ -540,7 +540,7 @@ nsCertOverrideService::IsCertUsedForOverrides(nsIX509Cert *aCert, { MutexAutoLock lock(mMutex); for (auto iter = mSettingsTable.Iter(); !iter.Done(); iter.Next()) { - const nsCertOverride &settings = iter.Get()->mSettings; + const nsCertOverride& settings = iter.Get()->mSettings; if ((settings.mIsTemporary && !aCheckTemporaries) || (!settings.mIsTemporary && !aCheckPermanents)) { @@ -563,10 +563,10 @@ nsCertOverrideService::IsCertUsedForOverrides(nsIX509Cert *aCert, } nsresult nsCertOverrideService::EnumerateCertOverrides( - nsIX509Cert *aCert, CertOverrideEnumerator aEnumerator, void *aUserData) { + nsIX509Cert* aCert, CertOverrideEnumerator aEnumerator, void* aUserData) { MutexAutoLock lock(mMutex); for (auto iter = mSettingsTable.Iter(); !iter.Done(); iter.Next()) { - const nsCertOverride &settings = iter.Get()->mSettings; + const nsCertOverride& settings = iter.Get()->mSettings; if (!aCert) { aEnumerator(settings, aUserData); @@ -585,9 +585,9 @@ nsresult nsCertOverrideService::EnumerateCertOverrides( return NS_OK; } -void nsCertOverrideService::GetHostWithPort(const nsACString &aHostName, +void nsCertOverrideService::GetHostWithPort(const nsACString& aHostName, int32_t aPort, - nsACString &_retval) { + nsACString& _retval) { nsAutoCString hostPort(aHostName); if (aPort == -1) { aPort = 443; diff --git a/security/manager/ssl/nsCertOverrideService.h b/security/manager/ssl/nsCertOverrideService.h index f49f040a070c8..6615698cfbb7b 100644 --- a/security/manager/ssl/nsCertOverrideService.h +++ b/security/manager/ssl/nsCertOverrideService.h @@ -31,9 +31,9 @@ class nsCertOverride { nsCertOverride() : mPort(-1), mIsTemporary(false), mOverrideBits(OverrideBits::None) {} - nsCertOverride(const nsCertOverride &other) { this->operator=(other); } + nsCertOverride(const nsCertOverride& other) { this->operator=(other); } - nsCertOverride &operator=(const nsCertOverride &other) { + nsCertOverride& operator=(const nsCertOverride& other) { mAsciiHost = other.mAsciiHost; mPort = other.mPort; mIsTemporary = other.mIsTemporary; @@ -52,8 +52,8 @@ class nsCertOverride { nsCString mDBKey; nsCOMPtr mCert; - static void convertBitsToString(OverrideBits ob, nsACString &str); - static void convertStringToBits(const nsACString &str, OverrideBits &ob); + static void convertBitsToString(OverrideBits ob, nsACString& str); + static void convertStringToBits(const nsACString& str, OverrideBits& ob); }; MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsCertOverride::OverrideBits) @@ -62,13 +62,13 @@ MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsCertOverride::OverrideBits) class nsCertOverrideEntry final : public PLDHashEntryHdr { public: // Hash methods - typedef const char *KeyType; - typedef const char *KeyTypePointer; + typedef const char* KeyType; + typedef const char* KeyTypePointer; // do nothing with aHost - we require mHead to be set before we're live! explicit nsCertOverrideEntry(KeyTypePointer aHostWithPortUTF8) {} - nsCertOverrideEntry(nsCertOverrideEntry &&toMove) + nsCertOverrideEntry(nsCertOverrideEntry&& toMove) : PLDHashEntryHdr(std::move(toMove)), mSettings(std::move(toMove.mSettings)), mHostWithPort(std::move(toMove.mHostWithPort)) {} @@ -92,7 +92,7 @@ class nsCertOverrideEntry final : public PLDHashEntryHdr { enum { ALLOW_MEMMOVE = false }; // get methods - inline const nsCString &HostWithPort() const { return mHostWithPort; } + inline const nsCString& HostWithPort() const { return mHostWithPort; } inline KeyTypePointer HostWithPortPtr() const { return mHostWithPort.get(); } @@ -113,20 +113,20 @@ class nsCertOverrideService final : public nsICertOverrideService, nsresult Init(); void RemoveAllTemporaryOverrides(); - typedef void (*CertOverrideEnumerator)(const nsCertOverride &aSettings, - void *aUserData); + typedef void (*CertOverrideEnumerator)(const nsCertOverride& aSettings, + void* aUserData); // aCert == null: return all overrides // aCert != null: return overrides that match the given cert - nsresult EnumerateCertOverrides(nsIX509Cert *aCert, + nsresult EnumerateCertOverrides(nsIX509Cert* aCert, CertOverrideEnumerator enumerator, - void *aUserData); + void* aUserData); // Concates host name and the port number. If the port number is -1 then // port 443 is automatically used. This method ensures there is always a port // number separated with colon. - static void GetHostWithPort(const nsACString &aHostName, int32_t aPort, - nsACString &_retval); + static void GetHostWithPort(const nsACString& aHostName, int32_t aPort, + nsACString& _retval); protected: ~nsCertOverrideService(); @@ -136,17 +136,17 @@ class nsCertOverrideService final : public nsICertOverrideService, nsTHashtable mSettingsTable; void CountPermanentOverrideTelemetry( - const mozilla::MutexAutoLock &aProofOfLock); + const mozilla::MutexAutoLock& aProofOfLock); void RemoveAllFromMemory(); - nsresult Read(const mozilla::MutexAutoLock &aProofOfLock); - nsresult Write(const mozilla::MutexAutoLock &aProofOfLock); - nsresult AddEntryToList(const nsACString &host, int32_t port, - nsIX509Cert *aCert, const bool aIsTemporary, - const nsACString &fingerprint, + nsresult Read(const mozilla::MutexAutoLock& aProofOfLock); + nsresult Write(const mozilla::MutexAutoLock& aProofOfLock); + nsresult AddEntryToList(const nsACString& host, int32_t port, + nsIX509Cert* aCert, const bool aIsTemporary, + const nsACString& fingerprint, nsCertOverride::OverrideBits ob, - const nsACString &dbKey, - const mozilla::MutexAutoLock &aProofOfLock); + const nsACString& dbKey, + const mozilla::MutexAutoLock& aProofOfLock); }; #define NS_CERTOVERRIDE_CID \ diff --git a/security/manager/ssl/nsCertTree.cpp b/security/manager/ssl/nsCertTree.cpp index 7e9d0e9e0787a..3baf7e6115859 100644 --- a/security/manager/ssl/nsCertTree.cpp +++ b/security/manager/ssl/nsCertTree.cpp @@ -56,23 +56,23 @@ CompareCacheHashEntry::CompareCacheHashEntry() : key(nullptr), mCritInit() { } } -static bool CompareCacheMatchEntry(const PLDHashEntryHdr *hdr, - const void *key) { - const CompareCacheHashEntryPtr *entryPtr = - static_cast(hdr); +static bool CompareCacheMatchEntry(const PLDHashEntryHdr* hdr, + const void* key) { + const CompareCacheHashEntryPtr* entryPtr = + static_cast(hdr); return entryPtr->entry->key == key; } -static void CompareCacheInitEntry(PLDHashEntryHdr *hdr, const void *key) { +static void CompareCacheInitEntry(PLDHashEntryHdr* hdr, const void* key) { new (hdr) CompareCacheHashEntryPtr(); - CompareCacheHashEntryPtr *entryPtr = - static_cast(hdr); - entryPtr->entry->key = (void *)key; + CompareCacheHashEntryPtr* entryPtr = + static_cast(hdr); + entryPtr->entry->key = (void*)key; } -static void CompareCacheClearEntry(PLDHashTable *table, PLDHashEntryHdr *hdr) { - CompareCacheHashEntryPtr *entryPtr = - static_cast(hdr); +static void CompareCacheClearEntry(PLDHashTable* table, PLDHashEntryHdr* hdr) { + CompareCacheHashEntryPtr* entryPtr = + static_cast(hdr); entryPtr->~CompareCacheHashEntryPtr(); } @@ -90,7 +90,7 @@ nsCertTreeDispInfo::nsCertTreeDispInfo() mOverrideBits(nsCertOverride::OverrideBits::None), mIsTemporary(true) {} -nsCertTreeDispInfo::nsCertTreeDispInfo(nsCertTreeDispInfo &other) { +nsCertTreeDispInfo::nsCertTreeDispInfo(nsCertTreeDispInfo& other) { mAddonInfo = other.mAddonInfo; mTypeOfEntry = other.mTypeOfEntry; mAsciiHost = other.mAsciiHost; @@ -103,7 +103,7 @@ nsCertTreeDispInfo::nsCertTreeDispInfo(nsCertTreeDispInfo &other) { nsCertTreeDispInfo::~nsCertTreeDispInfo() {} NS_IMETHODIMP -nsCertTreeDispInfo::GetCert(nsIX509Cert **_cert) { +nsCertTreeDispInfo::GetCert(nsIX509Cert** _cert) { NS_ENSURE_ARG(_cert); if (mCert) { // we may already have the cert for temporary overrides @@ -121,7 +121,7 @@ nsCertTreeDispInfo::GetCert(nsIX509Cert **_cert) { } NS_IMETHODIMP -nsCertTreeDispInfo::GetHostPort(nsAString &aHostPort) { +nsCertTreeDispInfo::GetHostPort(nsAString& aHostPort) { nsAutoCString hostPort; nsCertOverrideService::GetHostWithPort(mAsciiHost, mPort, hostPort); aHostPort = NS_ConvertUTF8toUTF16(hostPort); @@ -141,7 +141,7 @@ nsCertTree::nsCertTree() nsCOMPtr origCertOverride = do_GetService(kCertOverrideCID); mOriginalOverrideService = - static_cast(origCertOverride.get()); + static_cast(origCertOverride.get()); mCellText = nullptr; } @@ -153,14 +153,14 @@ nsCertTree::~nsCertTree() { delete[] mTreeArray; } void nsCertTree::FreeCertArray() { mDispInfo.Clear(); } -CompareCacheHashEntry *nsCertTree::getCacheEntry(void *cache, void *aCert) { - PLDHashTable &aCompareCache = *static_cast(cache); - auto entryPtr = static_cast( +CompareCacheHashEntry* nsCertTree::getCacheEntry(void* cache, void* aCert) { + PLDHashTable& aCompareCache = *static_cast(cache); + auto entryPtr = static_cast( aCompareCache.Add(aCert, fallible)); return entryPtr ? entryPtr->entry : nullptr; } -void nsCertTree::RemoveCacheEntry(void *key) { mCompareCache.Remove(key); } +void nsCertTree::RemoveCacheEntry(void* key) { mCompareCache.Remove(key); } // CountOrganizations // @@ -171,7 +171,7 @@ int32_t nsCertTree::CountOrganizations() { certCount = mDispInfo.Length(); if (certCount == 0) return 0; nsCOMPtr orgCert = nullptr; - nsCertAddonInfo *addonInfo = mDispInfo.ElementAt(0)->mAddonInfo; + nsCertAddonInfo* addonInfo = mDispInfo.ElementAt(0)->mAddonInfo; if (addonInfo) { orgCert = addonInfo->mCert; } @@ -197,7 +197,7 @@ int32_t nsCertTree::CountOrganizations() { // // If the row at index is an organization thread, return the collection // associated with that thread. Otherwise, return null. -treeArrayEl *nsCertTree::GetThreadDescAtIndex(int32_t index) { +treeArrayEl* nsCertTree::GetThreadDescAtIndex(int32_t index) { int i, idx = 0; if (index < 0) return nullptr; for (i = 0; i < mNumOrgs; i++) { @@ -217,7 +217,7 @@ treeArrayEl *nsCertTree::GetThreadDescAtIndex(int32_t index) { // // If the row at index is a cert, return that cert. Otherwise, return null. already_AddRefed nsCertTree::GetCertAtIndex( - int32_t index, int32_t *outAbsoluteCertOffset) { + int32_t index, int32_t* outAbsoluteCertOffset) { RefPtr certdi( GetDispInfoAtIndex(index, outAbsoluteCertOffset)); if (!certdi) return nullptr; @@ -233,7 +233,7 @@ already_AddRefed nsCertTree::GetCertAtIndex( // If the row at index is a cert, return that cert. Otherwise, return null. already_AddRefed nsCertTree::GetDispInfoAtIndex( - int32_t index, int32_t *outAbsoluteCertOffset) { + int32_t index, int32_t* outAbsoluteCertOffset) { int i, idx = 0, cIndex = 0, nc; if (index < 0) return nullptr; // Loop over the threads @@ -276,10 +276,10 @@ nsCertTree::nsCertCompareFunc nsCertTree::GetCompareFuncFromCertType( struct nsCertAndArrayAndPositionAndCounterAndTracker { RefPtr certai; - nsTArray > *array; + nsTArray >* array; int position; int counter; - nsTHashtable *tracker; + nsTHashtable* tracker; }; // Used to enumerate host:port overrides that match a stored @@ -289,13 +289,13 @@ struct nsCertAndArrayAndPositionAndCounterAndTracker { // track entries that have not yet been handled. // The created display-info references the cert, so make a note // of that by incrementing the cert usage counter. -static void MatchingCertOverridesCallback(const nsCertOverride &aSettings, - void *aUserData) { - nsCertAndArrayAndPositionAndCounterAndTracker *cap = - (nsCertAndArrayAndPositionAndCounterAndTracker *)aUserData; +static void MatchingCertOverridesCallback(const nsCertOverride& aSettings, + void* aUserData) { + nsCertAndArrayAndPositionAndCounterAndTracker* cap = + (nsCertAndArrayAndPositionAndCounterAndTracker*)aUserData; if (!cap) return; - nsCertTreeDispInfo *certdi = new nsCertTreeDispInfo; + nsCertTreeDispInfo* certdi = new nsCertTreeDispInfo; if (certdi) { if (cap->certai) cap->certai->mUsageCount++; certdi->mAddonInfo = cap->certai; @@ -320,10 +320,10 @@ static void MatchingCertOverridesCallback(const nsCertOverride &aSettings, // Used to collect a list of the (unique) host:port keys // for all stored overrides. -static void CollectAllHostPortOverridesCallback(const nsCertOverride &aSettings, - void *aUserData) { - nsTHashtable *collectorTable = - (nsTHashtable *)aUserData; +static void CollectAllHostPortOverridesCallback(const nsCertOverride& aSettings, + void* aUserData) { + nsTHashtable* collectorTable = + (nsTHashtable*)aUserData; if (!collectorTable) return; nsAutoCString hostPort; @@ -333,18 +333,18 @@ static void CollectAllHostPortOverridesCallback(const nsCertOverride &aSettings, } struct nsArrayAndPositionAndCounterAndTracker { - nsTArray > *array; + nsTArray >* array; int position; int counter; - nsTHashtable *tracker; + nsTHashtable* tracker; }; // Used when enumerating the stored host:port overrides where // no associated certificate was found in the NSS database. static void AddRemaningHostPortOverridesCallback( - const nsCertOverride &aSettings, void *aUserData) { - nsArrayAndPositionAndCounterAndTracker *cap = - (nsArrayAndPositionAndCounterAndTracker *)aUserData; + const nsCertOverride& aSettings, void* aUserData) { + nsArrayAndPositionAndCounterAndTracker* cap = + (nsArrayAndPositionAndCounterAndTracker*)aUserData; if (!cap) return; nsAutoCString hostPort; @@ -355,7 +355,7 @@ static void AddRemaningHostPortOverridesCallback( // This entry is not associated to any stored cert, // so we still need to display it. - nsCertTreeDispInfo *certdi = new nsCertTreeDispInfo; + nsCertTreeDispInfo* certdi = new nsCertTreeDispInfo; if (certdi) { certdi->mAddonInfo = nullptr; certdi->mTypeOfEntry = nsCertTreeDispInfo::host_port_override; @@ -370,10 +370,10 @@ static void AddRemaningHostPortOverridesCallback( } } -nsresult nsCertTree::GetCertsByTypeFromCertList(nsIX509CertList *aCertList, +nsresult nsCertTree::GetCertsByTypeFromCertList(nsIX509CertList* aCertList, uint32_t aWantedType, nsCertCompareFunc aCertCmpFn, - void *aCertCmpFnArg) { + void* aCertCmpFnArg) { MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("GetCertsByTypeFromCertList")); if (!aCertList) return NS_ERROR_FAILURE; @@ -507,7 +507,7 @@ nsresult nsCertTree::GetCertsByTypeFromCertList(nsIX509CertList *aCertList, } } if (wantThisCert) { - nsCertTreeDispInfo *certdi = new nsCertTreeDispInfo; + nsCertTreeDispInfo* certdi = new nsCertTreeDispInfo; certdi->mAddonInfo = certai; certai->mUsageCount++; certdi->mTypeOfEntry = nsCertTreeDispInfo::direct_db; @@ -556,7 +556,7 @@ nsresult nsCertTree::GetCertsByTypeFromCertList(nsIX509CertList *aCertList, // Load all of the certificates in the DB for this type. Sort them // by token, organization, then common name. NS_IMETHODIMP -nsCertTree::LoadCertsFromCache(nsIX509CertList *aCache, uint32_t aType) { +nsCertTree::LoadCertsFromCache(nsIX509CertList* aCache, uint32_t aType) { if (mTreeArray) { FreeCertArray(); delete[] mTreeArray; @@ -607,12 +607,12 @@ nsresult nsCertTree::UpdateUIContents() { if (count) { uint32_t j = 0; nsCOMPtr orgCert = nullptr; - nsCertAddonInfo *addonInfo = mDispInfo.ElementAt(j)->mAddonInfo; + nsCertAddonInfo* addonInfo = mDispInfo.ElementAt(j)->mAddonInfo; if (addonInfo) { orgCert = addonInfo->mCert; } for (int32_t i = 0; i < mNumOrgs; i++) { - nsString &orgNameRef = mTreeArray[i].orgName; + nsString& orgNameRef = mTreeArray[i].orgName; if (!orgCert) { GetPIPNSSBundleString("CertOrgUnknown", orgNameRef); } else { @@ -624,7 +624,7 @@ nsresult nsCertTree::UpdateUIContents() { mTreeArray[i].numChildren = 1; if (++j >= count) break; nsCOMPtr nextCert = nullptr; - nsCertAddonInfo *addonInfo = + nsCertAddonInfo* addonInfo = mDispInfo.SafeElementAt(j, nullptr)->mAddonInfo; if (addonInfo) { nextCert = addonInfo->mCert; @@ -684,7 +684,7 @@ nsCertTree::DeleteEntryObject(uint32_t index) { if (certdi->mAddonInfo) { cert = certdi->mAddonInfo->mCert; } - nsCertAddonInfo *addonInfo = + nsCertAddonInfo* addonInfo = certdi->mAddonInfo ? certdi->mAddonInfo.get() : nullptr; if (certdi->mTypeOfEntry == nsCertTreeDispInfo::host_port_override) { mOverrideService->ClearValidityOverride(certdi->mAsciiHost, @@ -709,7 +709,7 @@ nsCertTree::DeleteEntryObject(uint32_t index) { if (nsscert) { CERTCertTrust trust; - memset((void *)&trust, 0, sizeof(trust)); + memset((void*)&trust, 0, sizeof(trust)); SECStatus srv = CERT_DecodeTrustString(&trust, ""); // no override @@ -749,14 +749,14 @@ nsCertTree::DeleteEntryObject(uint32_t index) { ///////////////////////////////////////////////////////////////////////////// NS_IMETHODIMP -nsCertTree::GetCert(uint32_t aIndex, nsIX509Cert **_cert) { +nsCertTree::GetCert(uint32_t aIndex, nsIX509Cert** _cert) { NS_ENSURE_ARG(_cert); *_cert = GetCertAtIndex(aIndex).take(); return NS_OK; } NS_IMETHODIMP -nsCertTree::GetTreeItem(uint32_t aIndex, nsICertTreeItem **_treeitem) { +nsCertTree::GetTreeItem(uint32_t aIndex, nsICertTreeItem** _treeitem) { NS_ENSURE_ARG(_treeitem); RefPtr certdi(GetDispInfoAtIndex(aIndex)); @@ -768,7 +768,7 @@ nsCertTree::GetTreeItem(uint32_t aIndex, nsICertTreeItem **_treeitem) { } NS_IMETHODIMP -nsCertTree::GetRowCount(int32_t *aRowCount) { +nsCertTree::GetRowCount(int32_t* aRowCount) { if (!mTreeArray) return NS_ERROR_NOT_INITIALIZED; uint32_t count = 0; for (int32_t i = 0; i < mNumOrgs; i++) { @@ -782,35 +782,35 @@ nsCertTree::GetRowCount(int32_t *aRowCount) { } NS_IMETHODIMP -nsCertTree::GetSelection(nsITreeSelection **aSelection) { +nsCertTree::GetSelection(nsITreeSelection** aSelection) { *aSelection = mSelection; NS_IF_ADDREF(*aSelection); return NS_OK; } NS_IMETHODIMP -nsCertTree::SetSelection(nsITreeSelection *aSelection) { +nsCertTree::SetSelection(nsITreeSelection* aSelection) { mSelection = aSelection; return NS_OK; } NS_IMETHODIMP -nsCertTree::GetRowProperties(int32_t index, nsAString &aProps) { return NS_OK; } +nsCertTree::GetRowProperties(int32_t index, nsAString& aProps) { return NS_OK; } NS_IMETHODIMP -nsCertTree::GetCellProperties(int32_t row, nsTreeColumn *col, - nsAString &aProps) { +nsCertTree::GetCellProperties(int32_t row, nsTreeColumn* col, + nsAString& aProps) { return NS_OK; } NS_IMETHODIMP -nsCertTree::GetColumnProperties(nsTreeColumn *col, nsAString &aProps) { +nsCertTree::GetColumnProperties(nsTreeColumn* col, nsAString& aProps) { return NS_OK; } NS_IMETHODIMP -nsCertTree::IsContainer(int32_t index, bool *_retval) { +nsCertTree::IsContainer(int32_t index, bool* _retval) { if (!mTreeArray) return NS_ERROR_NOT_INITIALIZED; - treeArrayEl *el = GetThreadDescAtIndex(index); + treeArrayEl* el = GetThreadDescAtIndex(index); if (el) { *_retval = true; } else { @@ -820,9 +820,9 @@ nsCertTree::IsContainer(int32_t index, bool *_retval) { } NS_IMETHODIMP -nsCertTree::IsContainerOpen(int32_t index, bool *_retval) { +nsCertTree::IsContainerOpen(int32_t index, bool* _retval) { if (!mTreeArray) return NS_ERROR_NOT_INITIALIZED; - treeArrayEl *el = GetThreadDescAtIndex(index); + treeArrayEl* el = GetThreadDescAtIndex(index); if (el && el->open) { *_retval = true; } else { @@ -832,19 +832,19 @@ nsCertTree::IsContainerOpen(int32_t index, bool *_retval) { } NS_IMETHODIMP -nsCertTree::IsContainerEmpty(int32_t index, bool *_retval) { +nsCertTree::IsContainerEmpty(int32_t index, bool* _retval) { *_retval = !mTreeArray; return NS_OK; } NS_IMETHODIMP -nsCertTree::IsSeparator(int32_t index, bool *_retval) { +nsCertTree::IsSeparator(int32_t index, bool* _retval) { *_retval = false; return NS_OK; } NS_IMETHODIMP -nsCertTree::GetParentIndex(int32_t rowIndex, int32_t *_retval) { +nsCertTree::GetParentIndex(int32_t rowIndex, int32_t* _retval) { if (!mTreeArray) return NS_ERROR_NOT_INITIALIZED; int i, idx = 0; for (i = 0; i < mNumOrgs && idx < rowIndex; i++, idx++) { @@ -862,7 +862,7 @@ nsCertTree::GetParentIndex(int32_t rowIndex, int32_t *_retval) { NS_IMETHODIMP nsCertTree::HasNextSibling(int32_t rowIndex, int32_t afterIndex, - bool *_retval) { + bool* _retval) { if (!mTreeArray) return NS_ERROR_NOT_INITIALIZED; int i, idx = 0; @@ -880,9 +880,9 @@ nsCertTree::HasNextSibling(int32_t rowIndex, int32_t afterIndex, } NS_IMETHODIMP -nsCertTree::GetLevel(int32_t index, int32_t *_retval) { +nsCertTree::GetLevel(int32_t index, int32_t* _retval) { if (!mTreeArray) return NS_ERROR_NOT_INITIALIZED; - treeArrayEl *el = GetThreadDescAtIndex(index); + treeArrayEl* el = GetThreadDescAtIndex(index); if (el) { *_retval = 0; } else { @@ -892,27 +892,27 @@ nsCertTree::GetLevel(int32_t index, int32_t *_retval) { } NS_IMETHODIMP -nsCertTree::GetImageSrc(int32_t row, nsTreeColumn *col, nsAString &_retval) { +nsCertTree::GetImageSrc(int32_t row, nsTreeColumn* col, nsAString& _retval) { _retval.Truncate(); return NS_OK; } NS_IMETHODIMP -nsCertTree::GetCellValue(int32_t row, nsTreeColumn *col, nsAString &_retval) { +nsCertTree::GetCellValue(int32_t row, nsTreeColumn* col, nsAString& _retval) { _retval.Truncate(); return NS_OK; } NS_IMETHODIMP -nsCertTree::GetCellText(int32_t row, nsTreeColumn *col, nsAString &_retval) { +nsCertTree::GetCellText(int32_t row, nsTreeColumn* col, nsAString& _retval) { if (!mTreeArray) return NS_ERROR_NOT_INITIALIZED; nsresult rv = NS_OK; _retval.Truncate(); - const nsAString &colID = col->GetId(); + const nsAString& colID = col->GetId(); - treeArrayEl *el = GetThreadDescAtIndex(row); + treeArrayEl* el = GetThreadDescAtIndex(row); if (el) { if (NS_LITERAL_STRING("certcol").Equals(colID)) _retval.Assign(el->orgName); @@ -982,7 +982,7 @@ nsCertTree::GetCellText(int32_t row, nsTreeColumn *col, nsAString &_retval) { _retval = NS_LITERAL_STRING("*"); } } else if (NS_LITERAL_STRING("lifetimecol").Equals(colID)) { - const char *stringID = (certdi->mIsTemporary) ? "CertExceptionTemporary" + const char* stringID = (certdi->mIsTemporary) ? "CertExceptionTemporary" : "CertExceptionPermanent"; rv = GetPIPNSSBundleString(stringID, _retval); } else { @@ -999,7 +999,7 @@ nsCertTree::GetCellText(int32_t row, nsTreeColumn *col, nsAString &_retval) { } NS_IMETHODIMP -nsCertTree::SetTree(mozilla::dom::XULTreeElement *tree) { +nsCertTree::SetTree(mozilla::dom::XULTreeElement* tree) { mTree = tree; return NS_OK; } @@ -1007,7 +1007,7 @@ nsCertTree::SetTree(mozilla::dom::XULTreeElement *tree) { NS_IMETHODIMP nsCertTree::ToggleOpenState(int32_t index) { if (!mTreeArray) return NS_ERROR_NOT_INITIALIZED; - treeArrayEl *el = GetThreadDescAtIndex(index); + treeArrayEl* el = GetThreadDescAtIndex(index); if (el) { el->open = !el->open; int32_t newChildren = (el->open) ? el->numChildren : -el->numChildren; @@ -1020,43 +1020,43 @@ nsCertTree::ToggleOpenState(int32_t index) { } NS_IMETHODIMP -nsCertTree::CycleHeader(nsTreeColumn *col) { return NS_OK; } +nsCertTree::CycleHeader(nsTreeColumn* col) { return NS_OK; } NS_IMETHODIMP nsCertTree::SelectionChangedXPCOM() { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsCertTree::CycleCell(int32_t row, nsTreeColumn *col) { return NS_OK; } +nsCertTree::CycleCell(int32_t row, nsTreeColumn* col) { return NS_OK; } NS_IMETHODIMP -nsCertTree::IsEditable(int32_t row, nsTreeColumn *col, bool *_retval) { +nsCertTree::IsEditable(int32_t row, nsTreeColumn* col, bool* _retval) { *_retval = false; return NS_OK; } NS_IMETHODIMP -nsCertTree::SetCellValue(int32_t row, nsTreeColumn *col, - const nsAString &value) { +nsCertTree::SetCellValue(int32_t row, nsTreeColumn* col, + const nsAString& value) { return NS_OK; } NS_IMETHODIMP -nsCertTree::SetCellText(int32_t row, nsTreeColumn *col, - const nsAString &value) { +nsCertTree::SetCellText(int32_t row, nsTreeColumn* col, + const nsAString& value) { return NS_OK; } NS_IMETHODIMP -nsCertTree::PerformAction(const char16_t *action) { return NS_OK; } +nsCertTree::PerformAction(const char16_t* action) { return NS_OK; } NS_IMETHODIMP -nsCertTree::PerformActionOnRow(const char16_t *action, int32_t row) { +nsCertTree::PerformActionOnRow(const char16_t* action, int32_t row) { return NS_OK; } NS_IMETHODIMP -nsCertTree::PerformActionOnCell(const char16_t *action, int32_t row, - nsTreeColumn *col) { +nsCertTree::PerformActionOnCell(const char16_t* action, int32_t row, + nsTreeColumn* col) { return NS_OK; } @@ -1073,7 +1073,7 @@ void nsCertTree::dumpMap() { ("NCHILD[%d]", mTreeArray[i].numChildren)); } for (int i = 0; i < mNumRows; i++) { - treeArrayEl *el = GetThreadDescAtIndex(i); + treeArrayEl* el = GetThreadDescAtIndex(i); if (el) { nsAutoString td(el->orgName); MOZ_LOG( @@ -1082,7 +1082,7 @@ void nsCertTree::dumpMap() { } nsCOMPtr ct = GetCertAtIndex(i); if (ct) { - char16_t *goo; + char16_t* goo; ct->GetCommonName(&goo); nsAutoString doo(goo); MOZ_LOG(gPIPNSSLog, LogLevel::Debug, @@ -1096,8 +1096,8 @@ void nsCertTree::dumpMap() { // CanDrop // NS_IMETHODIMP nsCertTree::CanDrop(int32_t index, int32_t orientation, - mozilla::dom::DataTransfer *aDataTransfer, - bool *_retval) { + mozilla::dom::DataTransfer* aDataTransfer, + bool* _retval) { NS_ENSURE_ARG_POINTER(_retval); *_retval = false; @@ -1108,7 +1108,7 @@ NS_IMETHODIMP nsCertTree::CanDrop(int32_t index, int32_t orientation, // Drop // NS_IMETHODIMP nsCertTree::Drop(int32_t row, int32_t orient, - mozilla::dom::DataTransfer *aDataTransfer) { + mozilla::dom::DataTransfer* aDataTransfer) { return NS_OK; } @@ -1117,20 +1117,20 @@ NS_IMETHODIMP nsCertTree::Drop(int32_t row, int32_t orient, // // ... // -NS_IMETHODIMP nsCertTree::IsSorted(bool *_retval) { +NS_IMETHODIMP nsCertTree::IsSorted(bool* _retval) { *_retval = false; return NS_OK; } #define RETURN_NOTHING -void nsCertTree::CmpInitCriterion(nsIX509Cert *cert, - CompareCacheHashEntry *entry, +void nsCertTree::CmpInitCriterion(nsIX509Cert* cert, + CompareCacheHashEntry* entry, sortCriterion crit, int32_t level) { NS_ENSURE_TRUE(cert && entry, RETURN_NOTHING); entry->mCritInit[level] = true; - nsString &str = entry->mCrit[level]; + nsString& str = entry->mCrit[level]; switch (crit) { case sort_IssuerOrg: @@ -1175,8 +1175,8 @@ void nsCertTree::CmpInitCriterion(nsIX509Cert *cert, } } -int32_t nsCertTree::CmpByCrit(nsIX509Cert *a, CompareCacheHashEntry *ace, - nsIX509Cert *b, CompareCacheHashEntry *bce, +int32_t nsCertTree::CmpByCrit(nsIX509Cert* a, CompareCacheHashEntry* ace, + nsIX509Cert* b, CompareCacheHashEntry* bce, sortCriterion crit, int32_t level) { NS_ENSURE_TRUE(a && ace && b && bce, 0); @@ -1188,8 +1188,8 @@ int32_t nsCertTree::CmpByCrit(nsIX509Cert *a, CompareCacheHashEntry *ace, CmpInitCriterion(b, bce, crit, level); } - nsString &str_a = ace->mCrit[level]; - nsString &str_b = bce->mCrit[level]; + nsString& str_a = ace->mCrit[level]; + nsString& str_b = bce->mCrit[level]; int32_t result; if (!str_a.IsVoid() && !str_b.IsVoid()) @@ -1202,7 +1202,7 @@ int32_t nsCertTree::CmpByCrit(nsIX509Cert *a, CompareCacheHashEntry *ace, return result; } -int32_t nsCertTree::CmpBy(void *cache, nsIX509Cert *a, nsIX509Cert *b, +int32_t nsCertTree::CmpBy(void* cache, nsIX509Cert* a, nsIX509Cert* b, sortCriterion c0, sortCriterion c1, sortCriterion c2) { // This will be called when comparing items for display sorting. @@ -1220,8 +1220,8 @@ int32_t nsCertTree::CmpBy(void *cache, nsIX509Cert *a, nsIX509Cert *b, NS_ENSURE_TRUE(cache && a && b, 0); - CompareCacheHashEntry *ace = getCacheEntry(cache, a); - CompareCacheHashEntry *bce = getCacheEntry(cache, b); + CompareCacheHashEntry* ace = getCacheEntry(cache, a); + CompareCacheHashEntry* bce = getCacheEntry(cache, b); int32_t cmp; cmp = CmpByCrit(a, ace, b, bce, c0, 0); @@ -1239,24 +1239,24 @@ int32_t nsCertTree::CmpBy(void *cache, nsIX509Cert *a, nsIX509Cert *b, return cmp; } -int32_t nsCertTree::CmpCACert(void *cache, nsIX509Cert *a, nsIX509Cert *b) { +int32_t nsCertTree::CmpCACert(void* cache, nsIX509Cert* a, nsIX509Cert* b) { // XXX we assume issuer org is always criterion 1 return CmpBy(cache, a, b, sort_IssuerOrg, sort_Org, sort_Token); } -int32_t nsCertTree::CmpWebSiteCert(void *cache, nsIX509Cert *a, - nsIX509Cert *b) { +int32_t nsCertTree::CmpWebSiteCert(void* cache, nsIX509Cert* a, + nsIX509Cert* b) { // XXX we assume issuer org is always criterion 1 return CmpBy(cache, a, b, sort_IssuerOrg, sort_CommonName, sort_None); } -int32_t nsCertTree::CmpUserCert(void *cache, nsIX509Cert *a, nsIX509Cert *b) { +int32_t nsCertTree::CmpUserCert(void* cache, nsIX509Cert* a, nsIX509Cert* b) { // XXX we assume issuer org is always criterion 1 return CmpBy(cache, a, b, sort_IssuerOrg, sort_Token, sort_IssuedDateDescending); } -int32_t nsCertTree::CmpEmailCert(void *cache, nsIX509Cert *a, nsIX509Cert *b) { +int32_t nsCertTree::CmpEmailCert(void* cache, nsIX509Cert* a, nsIX509Cert* b) { // XXX we assume issuer org is always criterion 1 return CmpBy(cache, a, b, sort_IssuerOrg, sort_Email, sort_CommonName); } diff --git a/security/manager/ssl/nsCertTree.h b/security/manager/ssl/nsCertTree.h index b783731295618..d0d0f7365c1b9 100644 --- a/security/manager/ssl/nsCertTree.h +++ b/security/manager/ssl/nsCertTree.h @@ -42,7 +42,7 @@ struct CompareCacheHashEntry { enum { max_criterions = 3 }; CompareCacheHashEntry(); - void *key; // no ownership + void* key; // no ownership bool mCritInit[max_criterions]; nsString mCrit[max_criterions]; }; @@ -50,7 +50,7 @@ struct CompareCacheHashEntry { struct CompareCacheHashEntryPtr : PLDHashEntryHdr { CompareCacheHashEntryPtr(); ~CompareCacheHashEntryPtr(); - CompareCacheHashEntry *entry; + CompareCacheHashEntry* entry; }; class nsCertAddonInfo final : public nsISupports { @@ -77,7 +77,7 @@ class nsCertTreeDispInfo : public nsICertTreeItem { NS_DECL_NSICERTTREEITEM nsCertTreeDispInfo(); - nsCertTreeDispInfo(nsCertTreeDispInfo &other); + nsCertTreeDispInfo(nsCertTreeDispInfo& other); RefPtr mAddonInfo; enum { direct_db, host_port_override } mTypeOfEntry; @@ -110,22 +110,22 @@ class nsCertTree : public nsICertTree { virtual ~nsCertTree(); void ClearCompareHash(); - void RemoveCacheEntry(void *key); + void RemoveCacheEntry(void* key); - typedef int (*nsCertCompareFunc)(void *, nsIX509Cert *a, nsIX509Cert *b); + typedef int (*nsCertCompareFunc)(void*, nsIX509Cert* a, nsIX509Cert* b); - static CompareCacheHashEntry *getCacheEntry(void *cache, void *aCert); - static void CmpInitCriterion(nsIX509Cert *cert, CompareCacheHashEntry *entry, + static CompareCacheHashEntry* getCacheEntry(void* cache, void* aCert); + static void CmpInitCriterion(nsIX509Cert* cert, CompareCacheHashEntry* entry, sortCriterion crit, int32_t level); - static int32_t CmpByCrit(nsIX509Cert *a, CompareCacheHashEntry *ace, - nsIX509Cert *b, CompareCacheHashEntry *bce, + static int32_t CmpByCrit(nsIX509Cert* a, CompareCacheHashEntry* ace, + nsIX509Cert* b, CompareCacheHashEntry* bce, sortCriterion crit, int32_t level); - static int32_t CmpBy(void *cache, nsIX509Cert *a, nsIX509Cert *b, + static int32_t CmpBy(void* cache, nsIX509Cert* a, nsIX509Cert* b, sortCriterion c0, sortCriterion c1, sortCriterion c2); - static int32_t CmpCACert(void *cache, nsIX509Cert *a, nsIX509Cert *b); - static int32_t CmpWebSiteCert(void *cache, nsIX509Cert *a, nsIX509Cert *b); - static int32_t CmpUserCert(void *cache, nsIX509Cert *a, nsIX509Cert *b); - static int32_t CmpEmailCert(void *cache, nsIX509Cert *a, nsIX509Cert *b); + static int32_t CmpCACert(void* cache, nsIX509Cert* a, nsIX509Cert* b); + static int32_t CmpWebSiteCert(void* cache, nsIX509Cert* a, nsIX509Cert* b); + static int32_t CmpUserCert(void* cache, nsIX509Cert* a, nsIX509Cert* b); + static int32_t CmpEmailCert(void* cache, nsIX509Cert* a, nsIX509Cert* b); nsCertCompareFunc GetCompareFuncFromCertType(uint32_t aType); int32_t CountOrganizations(); @@ -135,25 +135,25 @@ class nsCertTree : public nsICertTree { nsTArray > mDispInfo; RefPtr mTree; nsCOMPtr mSelection; - treeArrayEl *mTreeArray; + treeArrayEl* mTreeArray; int32_t mNumOrgs; int32_t mNumRows; PLDHashTable mCompareCache; nsCOMPtr mOverrideService; RefPtr mOriginalOverrideService; - treeArrayEl *GetThreadDescAtIndex(int32_t _index); + treeArrayEl* GetThreadDescAtIndex(int32_t _index); already_AddRefed GetCertAtIndex( - int32_t _index, int32_t *outAbsoluteCertOffset = nullptr); + int32_t _index, int32_t* outAbsoluteCertOffset = nullptr); already_AddRefed GetDispInfoAtIndex( - int32_t index, int32_t *outAbsoluteCertOffset = nullptr); + int32_t index, int32_t* outAbsoluteCertOffset = nullptr); void FreeCertArray(); nsresult UpdateUIContents(); - nsresult GetCertsByTypeFromCertList(nsIX509CertList *aCertList, + nsresult GetCertsByTypeFromCertList(nsIX509CertList* aCertList, uint32_t aType, nsCertCompareFunc aCertCmpFn, - void *aCertCmpFnArg); + void* aCertCmpFnArg); nsCOMPtr mCellText; diff --git a/security/manager/ssl/nsCryptoHash.cpp b/security/manager/ssl/nsCryptoHash.cpp index 26840a6fbaa1a..9304a0cd996aa 100644 --- a/security/manager/ssl/nsCryptoHash.cpp +++ b/security/manager/ssl/nsCryptoHash.cpp @@ -81,7 +81,7 @@ nsCryptoHash::Init(uint32_t algorithm) { } NS_IMETHODIMP -nsCryptoHash::InitWithString(const nsACString &aAlgorithm) { +nsCryptoHash::InitWithString(const nsACString& aAlgorithm) { if (aAlgorithm.LowerCaseEqualsLiteral("md5")) return Init(nsICryptoHash::MD5); if (aAlgorithm.LowerCaseEqualsLiteral("sha1")) @@ -100,7 +100,7 @@ nsCryptoHash::InitWithString(const nsACString &aAlgorithm) { } NS_IMETHODIMP -nsCryptoHash::Update(const uint8_t *data, uint32_t len) { +nsCryptoHash::Update(const uint8_t* data, uint32_t len) { if (!mInitialized) { return NS_ERROR_NOT_INITIALIZED; } @@ -110,7 +110,7 @@ nsCryptoHash::Update(const uint8_t *data, uint32_t len) { } NS_IMETHODIMP -nsCryptoHash::UpdateFromStream(nsIInputStream *data, uint32_t aLen) { +nsCryptoHash::UpdateFromStream(nsIInputStream* data, uint32_t aLen) { if (!mInitialized) return NS_ERROR_NOT_INITIALIZED; if (!data) return NS_ERROR_INVALID_ARG; @@ -145,7 +145,7 @@ nsCryptoHash::UpdateFromStream(nsIInputStream *data, uint32_t aLen) { return rv; } - rv = Update(BitwiseCast(buffer), read); + rv = Update(BitwiseCast(buffer), read); if (NS_FAILED(rv)) { return rv; } @@ -157,7 +157,7 @@ nsCryptoHash::UpdateFromStream(nsIInputStream *data, uint32_t aLen) { } NS_IMETHODIMP -nsCryptoHash::Finish(bool ascii, nsACString &_retval) { +nsCryptoHash::Finish(bool ascii, nsACString& _retval) { if (!mInitialized) { return NS_ERROR_NOT_INITIALIZED; } @@ -169,11 +169,11 @@ nsCryptoHash::Finish(bool ascii, nsACString &_retval) { mInitialized = false; if (ascii) { - nsDependentCSubstring dataStr(BitwiseCast(buffer), hashLen); + nsDependentCSubstring dataStr(BitwiseCast(buffer), hashLen); return Base64Encode(dataStr, _retval); } - _retval.Assign(BitwiseCast(buffer), hashLen); + _retval.Assign(BitwiseCast(buffer), hashLen); return NS_OK; } @@ -186,7 +186,7 @@ NS_IMPL_ISUPPORTS(nsCryptoHMAC, nsICryptoHMAC) nsCryptoHMAC::nsCryptoHMAC() : mHMACContext(nullptr) {} NS_IMETHODIMP -nsCryptoHMAC::Init(uint32_t aAlgorithm, nsIKeyObject *aKeyObject) { +nsCryptoHMAC::Init(uint32_t aAlgorithm, nsIKeyObject* aKeyObject) { if (mHMACContext) { mHMACContext = nullptr; } @@ -222,7 +222,7 @@ nsCryptoHMAC::Init(uint32_t aAlgorithm, nsIKeyObject *aKeyObject) { NS_ENSURE_TRUE(keyType == nsIKeyObject::SYM_KEY, NS_ERROR_INVALID_ARG); - PK11SymKey *key; + PK11SymKey* key; // GetKeyObj doesn't addref the key rv = aKeyObject->GetKeyObj(&key); NS_ENSURE_SUCCESS(rv, rv); @@ -242,7 +242,7 @@ nsCryptoHMAC::Init(uint32_t aAlgorithm, nsIKeyObject *aKeyObject) { } NS_IMETHODIMP -nsCryptoHMAC::Update(const uint8_t *aData, uint32_t aLen) { +nsCryptoHMAC::Update(const uint8_t* aData, uint32_t aLen) { if (!mHMACContext) return NS_ERROR_NOT_INITIALIZED; if (!aData) return NS_ERROR_INVALID_ARG; @@ -255,7 +255,7 @@ nsCryptoHMAC::Update(const uint8_t *aData, uint32_t aLen) { } NS_IMETHODIMP -nsCryptoHMAC::UpdateFromStream(nsIInputStream *aStream, uint32_t aLen) { +nsCryptoHMAC::UpdateFromStream(nsIInputStream* aStream, uint32_t aLen) { if (!mHMACContext) return NS_ERROR_NOT_INITIALIZED; if (!aStream) return NS_ERROR_INVALID_ARG; @@ -292,7 +292,7 @@ nsCryptoHMAC::UpdateFromStream(nsIInputStream *aStream, uint32_t aLen) { return NS_BASE_STREAM_CLOSED; } - rv = Update(BitwiseCast(buffer), read); + rv = Update(BitwiseCast(buffer), read); if (NS_FAILED(rv)) { return rv; } @@ -304,7 +304,7 @@ nsCryptoHMAC::UpdateFromStream(nsIInputStream *aStream, uint32_t aLen) { } NS_IMETHODIMP -nsCryptoHMAC::Finish(bool aASCII, nsACString &_retval) { +nsCryptoHMAC::Finish(bool aASCII, nsACString& _retval) { if (!mHMACContext) return NS_ERROR_NOT_INITIALIZED; uint32_t hashLen = 0; @@ -316,11 +316,11 @@ nsCryptoHMAC::Finish(bool aASCII, nsACString &_retval) { } if (aASCII) { - nsDependentCSubstring dataStr(BitwiseCast(buffer), hashLen); + nsDependentCSubstring dataStr(BitwiseCast(buffer), hashLen); return Base64Encode(dataStr, _retval); } - _retval.Assign(BitwiseCast(buffer), hashLen); + _retval.Assign(BitwiseCast(buffer), hashLen); return NS_OK; } diff --git a/security/manager/ssl/nsKeygenThread.cpp b/security/manager/ssl/nsKeygenThread.cpp index d9347cbe77df7..13465c40786c8 100644 --- a/security/manager/ssl/nsKeygenThread.cpp +++ b/security/manager/ssl/nsKeygenThread.cpp @@ -49,11 +49,11 @@ nsKeygenThread::~nsKeygenThread() { if (usedSlot) PK11_FreeSlot(usedSlot); } -void nsKeygenThread::SetParams(PK11SlotInfo *a_slot, PK11AttrFlags a_flags, - PK11SlotInfo *a_alternative_slot, +void nsKeygenThread::SetParams(PK11SlotInfo* a_slot, PK11AttrFlags a_flags, + PK11SlotInfo* a_alternative_slot, PK11AttrFlags a_alternative_flags, - uint32_t a_keyGenMechanism, void *a_params, - void *a_wincx) { + uint32_t a_keyGenMechanism, void* a_params, + void* a_wincx) { MutexAutoLock lock(mutex); if (!alreadyReceivedParams) { @@ -69,9 +69,9 @@ void nsKeygenThread::SetParams(PK11SlotInfo *a_slot, PK11AttrFlags a_flags, } } -nsresult nsKeygenThread::ConsumeResult(PK11SlotInfo **a_used_slot, - SECKEYPrivateKey **a_privateKey, - SECKEYPublicKey **a_publicKey) { +nsresult nsKeygenThread::ConsumeResult(PK11SlotInfo** a_used_slot, + SECKEYPrivateKey** a_privateKey, + SECKEYPublicKey** a_publicKey) { if (!a_used_slot || !a_privateKey || !a_publicKey) { return NS_ERROR_FAILURE; } @@ -101,14 +101,14 @@ nsresult nsKeygenThread::ConsumeResult(PK11SlotInfo **a_used_slot, return rv; } -static void nsKeygenThreadRunner(void *arg) { +static void nsKeygenThreadRunner(void* arg) { AUTO_PROFILER_REGISTER_THREAD("Keygen"); NS_SetCurrentThreadName("Keygen"); - nsKeygenThread *self = static_cast(arg); + nsKeygenThread* self = static_cast(arg); self->Run(); } -nsresult nsKeygenThread::StartKeyGeneration(nsIObserver *aObserver) { +nsresult nsKeygenThread::StartKeyGeneration(nsIObserver* aObserver) { if (!NS_IsMainThread()) { NS_ERROR("nsKeygenThread::StartKeyGeneration called off the main thread"); return NS_ERROR_NOT_SAME_THREAD; @@ -129,7 +129,7 @@ nsresult nsKeygenThread::StartKeyGeneration(nsIObserver *aObserver) { iAmRunning = true; threadHandle = PR_CreateThread(PR_USER_THREAD, nsKeygenThreadRunner, - static_cast(this), PR_PRIORITY_NORMAL, + static_cast(this), PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); // bool thread_started_ok = (threadHandle != nullptr); @@ -138,7 +138,7 @@ nsresult nsKeygenThread::StartKeyGeneration(nsIObserver *aObserver) { return NS_OK; } -nsresult nsKeygenThread::UserCanceled(bool *threadAlreadyClosedDialog) { +nsresult nsKeygenThread::UserCanceled(bool* threadAlreadyClosedDialog) { if (!threadAlreadyClosedDialog) return NS_OK; *threadAlreadyClosedDialog = false; diff --git a/security/manager/ssl/nsKeygenThread.h b/security/manager/ssl/nsKeygenThread.h index 167a7619507ac..b2b083a8eccf2 100644 --- a/security/manager/ssl/nsKeygenThread.h +++ b/security/manager/ssl/nsKeygenThread.h @@ -27,18 +27,18 @@ class nsKeygenThread : public nsIKeygenThread { bool statusDialogClosed; bool alreadyReceivedParams; - SECKEYPrivateKey *privateKey; - SECKEYPublicKey *publicKey; - PK11SlotInfo *slot; + SECKEYPrivateKey* privateKey; + SECKEYPublicKey* publicKey; + PK11SlotInfo* slot; PK11AttrFlags flags; - PK11SlotInfo *altSlot; + PK11SlotInfo* altSlot; PK11AttrFlags altFlags; - PK11SlotInfo *usedSlot; + PK11SlotInfo* usedSlot; uint32_t keyGenMechanism; - void *params; - void *wincx; + void* params; + void* wincx; - PRThread *threadHandle; + PRThread* threadHandle; protected: virtual ~nsKeygenThread(); @@ -49,14 +49,14 @@ class nsKeygenThread : public nsIKeygenThread { NS_DECL_NSIKEYGENTHREAD NS_DECL_THREADSAFE_ISUPPORTS - void SetParams(PK11SlotInfo *a_slot, PK11AttrFlags a_flags, - PK11SlotInfo *a_alternative_slot, + void SetParams(PK11SlotInfo* a_slot, PK11AttrFlags a_flags, + PK11SlotInfo* a_alternative_slot, PK11AttrFlags a_alternative_flags, uint32_t a_keyGenMechanism, - void *a_params, void *a_wincx); + void* a_params, void* a_wincx); - nsresult ConsumeResult(PK11SlotInfo **a_used_slot, - SECKEYPrivateKey **a_privateKey, - SECKEYPublicKey **a_publicKey); + nsresult ConsumeResult(PK11SlotInfo** a_used_slot, + SECKEYPrivateKey** a_privateKey, + SECKEYPublicKey** a_publicKey); void Join(void); diff --git a/security/manager/ssl/nsNSSASN1Object.cpp b/security/manager/ssl/nsNSSASN1Object.cpp index a6fe2b8d6b14f..24ecaeb8efbe5 100644 --- a/security/manager/ssl/nsNSSASN1Object.cpp +++ b/security/manager/ssl/nsNSSASN1Object.cpp @@ -19,7 +19,7 @@ NS_IMPL_ISUPPORTS(nsNSSASN1PrintableItem, nsIASN1PrintableItem, nsIASN1Object) // structure. This interprets the buffer in data // as defined by the DER (Distinguised Encoding Rules) of // ASN1. -static int getInteger256(unsigned char *data, unsigned int nb) { +static int getInteger256(unsigned char* data, unsigned int nb) { int val; switch (nb) { @@ -50,8 +50,8 @@ static int getInteger256(unsigned char *data, unsigned int nb) { // A DER encoded item has the following structure: // // -static int32_t getDERItemLength(unsigned char *data, unsigned char *end, - unsigned long *bytesUsed, bool *indefinite) { +static int32_t getDERItemLength(unsigned char* data, unsigned char* end, + unsigned long* bytesUsed, bool* indefinite) { unsigned char lbyte = *data++; int32_t length = -1; @@ -80,8 +80,8 @@ static int32_t getDERItemLength(unsigned char *data, unsigned char *end, return length; } -static nsresult buildASN1ObjectFromDER(unsigned char *data, unsigned char *end, - nsIASN1Sequence *parent) { +static nsresult buildASN1ObjectFromDER(unsigned char* data, unsigned char* end, + nsIASN1Sequence* parent) { nsresult rv; nsCOMPtr sequence; nsCOMPtr printableItem; @@ -160,7 +160,7 @@ static nsresult buildASN1ObjectFromDER(unsigned char *data, unsigned char *end, asn1Obj = printableItem; asn1Obj->SetType(tagnum); asn1Obj->SetTag(tagnum); - printableItem->SetData((char *)data, len); + printableItem->SetData((char*)data, len); } data += len; parentObjects->AppendElement(asn1Obj); @@ -169,8 +169,8 @@ static nsresult buildASN1ObjectFromDER(unsigned char *data, unsigned char *end, return NS_OK; } -nsresult CreateFromDER(unsigned char *data, unsigned int len, - nsIASN1Object **retval) { +nsresult CreateFromDER(unsigned char* data, unsigned int len, + nsIASN1Object** retval) { nsCOMPtr sequence = new nsNSSASN1Sequence; *retval = nullptr; @@ -201,7 +201,7 @@ nsNSSASN1Sequence::~nsNSSASN1Sequence() { /* destructor code */ } NS_IMETHODIMP -nsNSSASN1Sequence::GetASN1Objects(nsIMutableArray **aASN1Objects) { +nsNSSASN1Sequence::GetASN1Objects(nsIMutableArray** aASN1Objects) { if (!mASN1Objects) { mASN1Objects = nsArrayBase::Create(); } @@ -211,13 +211,13 @@ nsNSSASN1Sequence::GetASN1Objects(nsIMutableArray **aASN1Objects) { } NS_IMETHODIMP -nsNSSASN1Sequence::SetASN1Objects(nsIMutableArray *aASN1Objects) { +nsNSSASN1Sequence::SetASN1Objects(nsIMutableArray* aASN1Objects) { mASN1Objects = aASN1Objects; return NS_OK; } NS_IMETHODIMP -nsNSSASN1Sequence::GetTag(uint32_t *aTag) { +nsNSSASN1Sequence::GetTag(uint32_t* aTag) { *aTag = mTag; return NS_OK; } @@ -229,7 +229,7 @@ nsNSSASN1Sequence::SetTag(uint32_t aTag) { } NS_IMETHODIMP -nsNSSASN1Sequence::GetType(uint32_t *aType) { +nsNSSASN1Sequence::GetType(uint32_t* aType) { *aType = mType; return NS_OK; } @@ -241,31 +241,31 @@ nsNSSASN1Sequence::SetType(uint32_t aType) { } NS_IMETHODIMP -nsNSSASN1Sequence::GetDisplayName(nsAString &aDisplayName) { +nsNSSASN1Sequence::GetDisplayName(nsAString& aDisplayName) { aDisplayName = mDisplayName; return NS_OK; } NS_IMETHODIMP -nsNSSASN1Sequence::SetDisplayName(const nsAString &aDisplayName) { +nsNSSASN1Sequence::SetDisplayName(const nsAString& aDisplayName) { mDisplayName = aDisplayName; return NS_OK; } NS_IMETHODIMP -nsNSSASN1Sequence::GetDisplayValue(nsAString &aDisplayValue) { +nsNSSASN1Sequence::GetDisplayValue(nsAString& aDisplayValue) { aDisplayValue = mDisplayValue; return NS_OK; } NS_IMETHODIMP -nsNSSASN1Sequence::SetDisplayValue(const nsAString &aDisplayValue) { +nsNSSASN1Sequence::SetDisplayValue(const nsAString& aDisplayValue) { mDisplayValue = aDisplayValue; return NS_OK; } NS_IMETHODIMP -nsNSSASN1Sequence::GetIsValidContainer(bool *aIsValidContainer) { +nsNSSASN1Sequence::GetIsValidContainer(bool* aIsValidContainer) { NS_ENSURE_ARG_POINTER(aIsValidContainer); *aIsValidContainer = mIsValidContainer; return NS_OK; @@ -279,7 +279,7 @@ nsNSSASN1Sequence::SetIsValidContainer(bool aIsValidContainer) { } NS_IMETHODIMP -nsNSSASN1Sequence::GetIsExpanded(bool *aIsExpanded) { +nsNSSASN1Sequence::GetIsExpanded(bool* aIsExpanded) { NS_ENSURE_ARG_POINTER(aIsExpanded); *aIsExpanded = mIsExpanded; return NS_OK; @@ -302,19 +302,19 @@ nsNSSASN1PrintableItem::~nsNSSASN1PrintableItem() { } NS_IMETHODIMP -nsNSSASN1PrintableItem::GetDisplayValue(nsAString &aValue) { +nsNSSASN1PrintableItem::GetDisplayValue(nsAString& aValue) { aValue = mValue; return NS_OK; } NS_IMETHODIMP -nsNSSASN1PrintableItem::SetDisplayValue(const nsAString &aValue) { +nsNSSASN1PrintableItem::SetDisplayValue(const nsAString& aValue) { mValue = aValue; return NS_OK; } NS_IMETHODIMP -nsNSSASN1PrintableItem::GetTag(uint32_t *aTag) { +nsNSSASN1PrintableItem::GetTag(uint32_t* aTag) { *aTag = mTag; return NS_OK; } @@ -326,7 +326,7 @@ nsNSSASN1PrintableItem::SetTag(uint32_t aTag) { } NS_IMETHODIMP -nsNSSASN1PrintableItem::GetType(uint32_t *aType) { +nsNSSASN1PrintableItem::GetType(uint32_t* aType) { *aType = mType; return NS_OK; } @@ -338,10 +338,10 @@ nsNSSASN1PrintableItem::SetType(uint32_t aType) { } NS_IMETHODIMP -nsNSSASN1PrintableItem::SetData(char *data, uint32_t len) { +nsNSSASN1PrintableItem::SetData(char* data, uint32_t len) { if (len > 0) { if (mLen < len) { - mData = (unsigned char *)moz_xrealloc(mData, len); + mData = (unsigned char*)moz_xrealloc(mData, len); } memcpy(mData, data, len); @@ -356,23 +356,23 @@ nsNSSASN1PrintableItem::SetData(char *data, uint32_t len) { } NS_IMETHODIMP -nsNSSASN1PrintableItem::GetData(char **outData, uint32_t *outLen) { +nsNSSASN1PrintableItem::GetData(char** outData, uint32_t* outLen) { NS_ENSURE_ARG_POINTER(outData); NS_ENSURE_ARG_POINTER(outLen); - *outData = (char *)mData; + *outData = (char*)mData; *outLen = mLen; return NS_OK; } NS_IMETHODIMP -nsNSSASN1PrintableItem::GetDisplayName(nsAString &aDisplayName) { +nsNSSASN1PrintableItem::GetDisplayName(nsAString& aDisplayName) { aDisplayName = mDisplayName; return NS_OK; } NS_IMETHODIMP -nsNSSASN1PrintableItem::SetDisplayName(const nsAString &aDisplayName) { +nsNSSASN1PrintableItem::SetDisplayName(const nsAString& aDisplayName) { mDisplayName = aDisplayName; return NS_OK; } diff --git a/security/manager/ssl/nsNSSASN1Object.h b/security/manager/ssl/nsNSSASN1Object.h index 373eb70a86f54..fecc40d321d0c 100644 --- a/security/manager/ssl/nsNSSASN1Object.h +++ b/security/manager/ssl/nsNSSASN1Object.h @@ -54,10 +54,10 @@ class nsNSSASN1PrintableItem : public nsIASN1PrintableItem { nsString mValue; uint32_t mType; uint32_t mTag; - unsigned char *mData; + unsigned char* mData; uint32_t mLen; }; -nsresult CreateFromDER(unsigned char *data, unsigned int len, - nsIASN1Object **retval); +nsresult CreateFromDER(unsigned char* data, unsigned int len, + nsIASN1Object** retval); #endif //_NSSASN_H_ diff --git a/security/manager/ssl/nsNSSCertTrust.cpp b/security/manager/ssl/nsNSSCertTrust.cpp index 6badaf05e4c05..f5cc3f18fac00 100644 --- a/security/manager/ssl/nsNSSCertTrust.cpp +++ b/security/manager/ssl/nsNSSCertTrust.cpp @@ -30,7 +30,7 @@ nsNSSCertTrust::nsNSSCertTrust(unsigned int ssl, unsigned int email) { addTrust(&mTrust.emailFlags, email); } -nsNSSCertTrust::nsNSSCertTrust(CERTCertTrust *t) { +nsNSSCertTrust::nsNSSCertTrust(CERTCertTrust* t) { if (t) memcpy(&mTrust, t, sizeof(CERTCertTrust)); else @@ -114,7 +114,7 @@ bool nsNSSCertTrust::HasTrustedPeer(bool checkSSL, bool checkEmail) { return true; } -void nsNSSCertTrust::addTrust(unsigned int *t, unsigned int v) { *t |= v; } +void nsNSSCertTrust::addTrust(unsigned int* t, unsigned int v) { *t |= v; } bool nsNSSCertTrust::hasTrust(unsigned int t, unsigned int v) { return !!(t & v); diff --git a/security/manager/ssl/nsNSSCertTrust.h b/security/manager/ssl/nsNSSCertTrust.h index 75aa0471d4ad2..3f05d289938a3 100644 --- a/security/manager/ssl/nsNSSCertTrust.h +++ b/security/manager/ssl/nsNSSCertTrust.h @@ -14,7 +14,7 @@ class nsNSSCertTrust { public: nsNSSCertTrust(); nsNSSCertTrust(unsigned int ssl, unsigned int email); - explicit nsNSSCertTrust(CERTCertTrust *t); + explicit nsNSSCertTrust(CERTCertTrust* t); virtual ~nsNSSCertTrust(); /* query */ @@ -43,11 +43,11 @@ class nsNSSCertTrust { /* set p <--> P */ void AddPeerTrust(bool ssl, bool email); - CERTCertTrust &GetTrust() { return mTrust; } + CERTCertTrust& GetTrust() { return mTrust; } private: - void addTrust(unsigned int *t, unsigned int v); - void removeTrust(unsigned int *t, unsigned int v); + void addTrust(unsigned int* t, unsigned int v); + void removeTrust(unsigned int* t, unsigned int v); bool hasTrust(unsigned int t, unsigned int v); CERTCertTrust mTrust; }; diff --git a/security/manager/ssl/nsNTLMAuthModule.cpp b/security/manager/ssl/nsNTLMAuthModule.cpp index a16ead6f1e451..c04437ce66b0a 100644 --- a/security/manager/ssl/nsNTLMAuthModule.cpp +++ b/security/manager/ssl/nsNTLMAuthModule.cpp @@ -37,8 +37,8 @@ static mozilla::LazyLogModule sNTLMLog("NTLM"); #define LOG(x) MOZ_LOG(sNTLMLog, mozilla::LogLevel::Debug, x) #define LOG_ENABLED() MOZ_LOG_TEST(sNTLMLog, mozilla::LogLevel::Debug) -static void des_makekey(const uint8_t *raw, uint8_t *key); -static void des_encrypt(const uint8_t *key, const uint8_t *src, uint8_t *hash); +static void des_makekey(const uint8_t* raw, uint8_t* key); +static void des_encrypt(const uint8_t* key, const uint8_t* src, uint8_t* hash); //----------------------------------------------------------------------------- // this file contains a cross-platform NTLM authentication implementation. it @@ -159,7 +159,7 @@ static void LogFlags(uint32_t flags) { * @param buf the data to print * @param bufLen length of the data */ -static void LogBuf(const char *tag, const uint8_t *buf, uint32_t bufLen) { +static void LogBuf(const char* tag, const uint8_t* buf, uint32_t bufLen) { int i; if (!LOG_ENABLED()) return; @@ -202,12 +202,12 @@ static void LogBuf(const char *tag, const uint8_t *buf, uint32_t bufLen) { * @param token The token to print * @param tokenLen length of the data in token */ -static void LogToken(const char *name, const void *token, uint32_t tokenLen) { +static void LogToken(const char* name, const void* token, uint32_t tokenLen) { if (!LOG_ENABLED()) { return; } - nsDependentCSubstring tokenString(static_cast(token), tokenLen); + nsDependentCSubstring tokenString(static_cast(token), tokenLen); nsAutoCString base64Token; nsresult rv = mozilla::Base64Encode(tokenString, base64Token); if (NS_FAILED(rv)) { @@ -223,12 +223,12 @@ static void LogToken(const char *name, const void *token, uint32_t tokenLen) { #define SWAP16(x) ((((x)&0xff) << 8) | (((x) >> 8) & 0xff)) #define SWAP32(x) ((SWAP16((x)&0xffff) << 16) | (SWAP16((x) >> 16))) -static void *WriteBytes(void *buf, const void *data, uint32_t dataLen) { +static void* WriteBytes(void* buf, const void* data, uint32_t dataLen) { memcpy(buf, data, dataLen); - return (uint8_t *)buf + dataLen; + return (uint8_t*)buf + dataLen; } -static void *WriteDWORD(void *buf, uint32_t dword) { +static void* WriteDWORD(void* buf, uint32_t dword) { #ifdef IS_BIG_ENDIAN // NTLM uses little endian on the wire dword = SWAP32(dword); @@ -236,7 +236,7 @@ static void *WriteDWORD(void *buf, uint32_t dword) { return WriteBytes(buf, &dword, sizeof(dword)); } -static void *WriteSecBuf(void *buf, uint16_t length, uint32_t offset) { +static void* WriteSecBuf(void* buf, uint16_t length, uint32_t offset) { #ifdef IS_BIG_ENDIAN length = SWAP16(length); offset = SWAP32(offset); @@ -255,9 +255,9 @@ static void *WriteSecBuf(void *buf, uint16_t length, uint32_t offset) { * to pass the same buffer as both input and output, which is a handy way to * convert the unicode buffer to little-endian on big-endian platforms. */ -static void *WriteUnicodeLE(void *buf, const char16_t *str, uint32_t strLen) { +static void* WriteUnicodeLE(void* buf, const char16_t* str, uint32_t strLen) { // convert input string from BE to LE - uint8_t *cursor = (uint8_t *)buf, *input = (uint8_t *)str; + uint8_t *cursor = (uint8_t*)buf, *input = (uint8_t*)str; for (uint32_t i = 0; i < strLen; ++i, input += 2, cursor += 2) { // allow for the case where |buf == str| uint8_t temp = input[0]; @@ -268,13 +268,13 @@ static void *WriteUnicodeLE(void *buf, const char16_t *str, uint32_t strLen) { } #endif -static uint16_t ReadUint16(const uint8_t *&buf) { +static uint16_t ReadUint16(const uint8_t*& buf) { uint16_t x = ((uint16_t)buf[0]) | ((uint16_t)buf[1] << 8); buf += sizeof(x); return x; } -static uint32_t ReadUint32(const uint8_t *&buf) { +static uint32_t ReadUint32(const uint8_t*& buf) { uint32_t x = ((uint32_t)buf[0]) | (((uint32_t)buf[1]) << 8) | (((uint32_t)buf[2]) << 16) | (((uint32_t)buf[3]) << 24); buf += sizeof(x); @@ -283,9 +283,9 @@ static uint32_t ReadUint32(const uint8_t *&buf) { //----------------------------------------------------------------------------- -static void ZapBuf(void *buf, size_t bufLen) { memset(buf, 0, bufLen); } +static void ZapBuf(void* buf, size_t bufLen) { memset(buf, 0, bufLen); } -static void ZapString(nsString &s) { ZapBuf(s.BeginWriting(), s.Length() * 2); } +static void ZapString(nsString& s) { ZapBuf(s.BeginWriting(), s.Length() * 2); } /** * NTLM_Hash computes the NTLM hash of the given password. @@ -295,15 +295,15 @@ static void ZapString(nsString &s) { ZapBuf(s.BeginWriting(), s.Length() * 2); } * @param hash * 16-byte result buffer */ -static void NTLM_Hash(const nsString &password, unsigned char *hash) { +static void NTLM_Hash(const nsString& password, unsigned char* hash) { uint32_t len = password.Length(); - uint8_t *passbuf; + uint8_t* passbuf; #ifdef IS_BIG_ENDIAN - passbuf = (uint8_t *)malloc(len * 2); + passbuf = (uint8_t*)malloc(len * 2); WriteUnicodeLE(passbuf, password.get(), len); #else - passbuf = (uint8_t *)password.get(); + passbuf = (uint8_t*)password.get(); #endif md4sum(passbuf, len * 2, hash); @@ -327,8 +327,8 @@ static void NTLM_Hash(const nsString &password, unsigned char *hash) { * @param response * 24-byte buffer to contain the LM response upon return */ -static void LM_Response(const uint8_t *hash, const uint8_t *challenge, - uint8_t *response) { +static void LM_Response(const uint8_t* hash, const uint8_t* challenge, + uint8_t* response) { uint8_t keybytes[21], k1[8], k2[8], k3[8]; memcpy(keybytes, hash, 16); @@ -345,7 +345,7 @@ static void LM_Response(const uint8_t *hash, const uint8_t *challenge, //----------------------------------------------------------------------------- -static nsresult GenerateType1Msg(void **outBuf, uint32_t *outLen) { +static nsresult GenerateType1Msg(void** outBuf, uint32_t* outLen) { // // verify that bufLen is sufficient // @@ -355,7 +355,7 @@ static nsresult GenerateType1Msg(void **outBuf, uint32_t *outLen) { // // write out type 1 msg // - void *cursor = *outBuf; + void* cursor = *outBuf; // 0 : signature cursor = WriteBytes(cursor, NTLM_SIGNATURE, sizeof(NTLM_SIGNATURE)); @@ -386,15 +386,15 @@ static nsresult GenerateType1Msg(void **outBuf, uint32_t *outLen) { struct Type2Msg { uint32_t flags; // NTLM_Xxx bitwise combination uint8_t challenge[NTLM_CHAL_LEN]; // 8 byte challenge - const uint8_t *target; // target string (type depends on flags) + const uint8_t* target; // target string (type depends on flags) uint32_t targetLen; // target length in bytes - const uint8_t - *targetInfo; // target Attribute-Value pairs (DNS domain, et al) + const uint8_t* + targetInfo; // target Attribute-Value pairs (DNS domain, et al) uint32_t targetInfoLen; // target AV pairs length in bytes }; -static nsresult ParseType2Msg(const void *inBuf, uint32_t inLen, - Type2Msg *msg) { +static nsresult ParseType2Msg(const void* inBuf, uint32_t inLen, + Type2Msg* msg) { // make sure inBuf is long enough to contain a meaningful type2 msg. // // 0 NTLMSSP Signature @@ -407,7 +407,7 @@ static nsresult ParseType2Msg(const void *inBuf, uint32_t inLen, // if (inLen < NTLM_TYPE2_HEADER_LEN) return NS_ERROR_UNEXPECTED; - auto cursor = static_cast(inBuf); + auto cursor = static_cast(inBuf); // verify NTLMSSP signature if (memcmp(cursor, NTLM_SIGNATURE, sizeof(NTLM_SIGNATURE)) != 0) @@ -434,7 +434,7 @@ static nsresult ParseType2Msg(const void *inBuf, uint32_t inLen, // integer overflow checking. if (MOZ_LIKELY(targetEnd.isValid() && targetEnd.value() <= inLen)) { msg->targetLen = targetLen; - msg->target = static_cast(inBuf) + offset; + msg->target = static_cast(inBuf) + offset; } else { // Do not error out, for (conservative) backward compatibility. msg->targetLen = 0; @@ -451,8 +451,7 @@ static nsresult ParseType2Msg(const void *inBuf, uint32_t inLen, LOG(("NTLM type 2 message:\n")); LogBuf("target", msg->target, msg->targetLen); LogBuf("flags", - mozilla::BitwiseCast(&msg->flags), - 4); + mozilla::BitwiseCast(&msg->flags), 4); LogFlags(msg->flags); LogBuf("challenge", msg->challenge, sizeof(msg->challenge)); @@ -472,7 +471,7 @@ static nsresult ParseType2Msg(const void *inBuf, uint32_t inLen, // integer overflow checking. if (MOZ_LIKELY(targetInfoEnd.isValid() && targetInfoEnd.value() <= inLen)) { msg->targetInfoLen = targetInfoLen; - msg->targetInfo = static_cast(inBuf) + offset; + msg->targetInfo = static_cast(inBuf) + offset; } else { NS_ERROR("failed to get NTLMv2 target info"); return NS_ERROR_UNEXPECTED; @@ -481,11 +480,11 @@ static nsresult ParseType2Msg(const void *inBuf, uint32_t inLen, return NS_OK; } -static nsresult GenerateType3Msg(const nsString &domain, - const nsString &username, - const nsString &password, const void *inBuf, - uint32_t inLen, void **outBuf, - uint32_t *outLen) { +static nsresult GenerateType3Msg(const nsString& domain, + const nsString& username, + const nsString& password, const void* inBuf, + uint32_t inLen, void** outBuf, + uint32_t* outLen) { // inBuf contains Type-2 msg (the challenge) from server MOZ_ASSERT(NS_IsMainThread()); nsresult rv; @@ -524,8 +523,8 @@ static nsresult GenerateType3Msg(const nsString &domain, ucsDomainBuf = domain; domainPtr = ucsDomainBuf.get(); domainLen = ucsDomainBuf.Length() * 2; - WriteUnicodeLE(const_cast(domainPtr), - static_cast(domainPtr), + WriteUnicodeLE(const_cast(domainPtr), + static_cast(domainPtr), ucsDomainBuf.Length()); #else domainPtr = domain.get(); @@ -545,8 +544,8 @@ static nsresult GenerateType3Msg(const nsString &domain, ucsUserBuf = username; userPtr = ucsUserBuf.get(); userLen = ucsUserBuf.Length() * 2; - WriteUnicodeLE(const_cast(userPtr), - static_cast(userPtr), ucsUserBuf.Length()); + WriteUnicodeLE(const_cast(userPtr), + static_cast(userPtr), ucsUserBuf.Length()); #else userPtr = username.get(); userLen = username.Length() * 2; @@ -572,8 +571,8 @@ static nsresult GenerateType3Msg(const nsString &domain, hostPtr = ucsHostBuf.get(); hostLen = ucsHostBuf.Length() * 2; #ifdef IS_BIG_ENDIAN - WriteUnicodeLE(const_cast(hostPtr), - static_cast(hostPtr), ucsHostBuf.Length()); + WriteUnicodeLE(const_cast(hostPtr), + static_cast(hostPtr), ucsHostBuf.Length()); #endif } else { hostPtr = hostBuf.get(); @@ -602,8 +601,8 @@ static nsresult GenerateType3Msg(const nsString &domain, // temporary buffers for unicode strings nsAutoString ucsDomainUpperBuf; nsAutoString ucsUserUpperBuf; - const void *domainUpperPtr; - const void *userUpperPtr; + const void* domainUpperPtr; + const void* userUpperPtr; uint32_t domainUpperLen; uint32_t userUpperLen; @@ -616,22 +615,22 @@ static nsresult GenerateType3Msg(const nsString &domain, userUpperPtr = ucsUserUpperBuf.get(); userUpperLen = ucsUserUpperBuf.Length() * 2; #ifdef IS_BIG_ENDIAN - WriteUnicodeLE(const_cast(userUpperPtr), - static_cast(userUpperPtr), + WriteUnicodeLE(const_cast(userUpperPtr), + static_cast(userUpperPtr), ucsUserUpperBuf.Length()); #endif ToUpperCase(domain, ucsDomainUpperBuf); domainUpperPtr = ucsDomainUpperBuf.get(); domainUpperLen = ucsDomainUpperBuf.Length() * 2; #ifdef IS_BIG_ENDIAN - WriteUnicodeLE(const_cast(domainUpperPtr), - static_cast(domainUpperPtr), + WriteUnicodeLE(const_cast(domainUpperPtr), + static_cast(domainUpperPtr), ucsDomainUpperBuf.Length()); #endif NTLM_Hash(password, ntlmHash); ntlmHashStr = nsAutoCString( - mozilla::BitwiseCast(ntlmHash), + mozilla::BitwiseCast(ntlmHash), NTLM_HASH_LEN); nsCOMPtr keyFactory = @@ -662,12 +661,12 @@ static nsresult GenerateType3Msg(const nsString &domain, if (NS_FAILED(rv)) { return rv; } - rv = hasher->Update(static_cast(userUpperPtr), - userUpperLen); + rv = + hasher->Update(static_cast(userUpperPtr), userUpperLen); if (NS_FAILED(rv)) { return rv; } - rv = hasher->Update(static_cast(domainUpperPtr), + rv = hasher->Update(static_cast(domainUpperPtr), domainUpperLen); if (NS_FAILED(rv)) { return rv; @@ -790,7 +789,7 @@ static nsresult GenerateType3Msg(const nsString &domain, return rv; } - auto sessionHash = mozilla::BitwiseCast( + auto sessionHash = mozilla::BitwiseCast( sessionHashString.get()); LogBuf("NTLM2 effective key: ", sessionHash, 8); @@ -823,7 +822,7 @@ static nsresult GenerateType3Msg(const nsString &domain, // // finally, we assemble the Type-3 msg :-) // - void *cursor = *outBuf; + void* cursor = *outBuf; mozilla::CheckedInt offset; // 0 : signature @@ -842,7 +841,7 @@ static nsresult GenerateType3Msg(const nsString &domain, return NS_ERROR_UNEXPECTED; } cursor = WriteSecBuf(cursor, LM_RESP_LEN, offset.value()); - memcpy(static_cast(*outBuf) + offset.value(), lmResp, LM_RESP_LEN); + memcpy(static_cast(*outBuf) + offset.value(), lmResp, LM_RESP_LEN); // 20 : NTLM or NTLMv2 response sec buf offset += LM_RESP_LEN; @@ -852,31 +851,30 @@ static nsresult GenerateType3Msg(const nsString &domain, } cursor = WriteSecBuf(cursor, ntlmRespLen.value(), offset.value()); if (ntlmv2) { - memcpy(static_cast(*outBuf) + offset.value(), ntlmv2Resp, + memcpy(static_cast(*outBuf) + offset.value(), ntlmv2Resp, NTLMv2_RESP_LEN); offset += NTLMv2_RESP_LEN; if (!offset.isValid()) { NS_ERROR("failed preparing to write NTLM response: integer overflow?!?"); return NS_ERROR_UNEXPECTED; } - memcpy(static_cast(*outBuf) + offset.value(), ntlmv2_blob1, + memcpy(static_cast(*outBuf) + offset.value(), ntlmv2_blob1, NTLMv2_BLOB1_LEN); offset += NTLMv2_BLOB1_LEN; if (!offset.isValid()) { NS_ERROR("failed preparing to write NTLM response: integer overflow?!?"); return NS_ERROR_UNEXPECTED; } - memcpy(static_cast(*outBuf) + offset.value(), msg.targetInfo, + memcpy(static_cast(*outBuf) + offset.value(), msg.targetInfo, msg.targetInfoLen); } else { - memcpy(static_cast(*outBuf) + offset.value(), ntlmResp, + memcpy(static_cast(*outBuf) + offset.value(), ntlmResp, NTLM_RESP_LEN); } // 28 : domain name sec buf offset = NTLM_TYPE3_HEADER_LEN; cursor = WriteSecBuf(cursor, domainLen, offset.value()); - memcpy(static_cast(*outBuf) + offset.value(), domainPtr, - domainLen); + memcpy(static_cast(*outBuf) + offset.value(), domainPtr, domainLen); // 36 : user name sec buf offset += domainLen; @@ -885,7 +883,7 @@ static nsresult GenerateType3Msg(const nsString &domain, return NS_ERROR_UNEXPECTED; } cursor = WriteSecBuf(cursor, userLen, offset.value()); - memcpy(static_cast(*outBuf) + offset.value(), userPtr, userLen); + memcpy(static_cast(*outBuf) + offset.value(), userPtr, userLen); // 44 : workstation (host) name sec buf offset += userLen; @@ -894,7 +892,7 @@ static nsresult GenerateType3Msg(const nsString &domain, return NS_ERROR_UNEXPECTED; } cursor = WriteSecBuf(cursor, hostLen, offset.value()); - memcpy(static_cast(*outBuf) + offset.value(), hostPtr, hostLen); + memcpy(static_cast(*outBuf) + offset.value(), hostPtr, hostLen); // 52 : session key sec buf (not used) cursor = WriteSecBuf(cursor, 0, 0); @@ -924,9 +922,9 @@ nsresult nsNTLMAuthModule::InitTest() { } NS_IMETHODIMP -nsNTLMAuthModule::Init(const char * /*serviceName*/, uint32_t serviceFlags, - const char16_t *domain, const char16_t *username, - const char16_t *password) { +nsNTLMAuthModule::Init(const char* /*serviceName*/, uint32_t serviceFlags, + const char16_t* domain, const char16_t* username, + const char16_t* password) { MOZ_ASSERT((serviceFlags & ~nsIAuthModule::REQ_PROXY_AUTH) == nsIAuthModule::REQ_DEFAULT, "Unexpected service flags"); @@ -949,8 +947,8 @@ nsNTLMAuthModule::Init(const char * /*serviceName*/, uint32_t serviceFlags, } NS_IMETHODIMP -nsNTLMAuthModule::GetNextToken(const void *inToken, uint32_t inTokenLen, - void **outToken, uint32_t *outTokenLen) { +nsNTLMAuthModule::GetNextToken(const void* inToken, uint32_t inTokenLen, + void** outToken, uint32_t* outTokenLen) { nsresult rv; // disable NTLM authentication when FIPS mode is enabled. @@ -990,15 +988,15 @@ nsNTLMAuthModule::GetNextToken(const void *inToken, uint32_t inTokenLen, } NS_IMETHODIMP -nsNTLMAuthModule::Unwrap(const void *inToken, uint32_t inTokenLen, - void **outToken, uint32_t *outTokenLen) { +nsNTLMAuthModule::Unwrap(const void* inToken, uint32_t inTokenLen, + void** outToken, uint32_t* outTokenLen) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsNTLMAuthModule::Wrap(const void *inToken, uint32_t inTokenLen, - bool confidential, void **outToken, - uint32_t *outTokenLen) { +nsNTLMAuthModule::Wrap(const void* inToken, uint32_t inTokenLen, + bool confidential, void** outToken, + uint32_t* outTokenLen) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -1017,7 +1015,7 @@ static uint8_t des_setkeyparity(uint8_t x) { } // build 64-bit des key from 56-bit raw key -static void des_makekey(const uint8_t *raw, uint8_t *key) { +static void des_makekey(const uint8_t* raw, uint8_t* key) { key[0] = des_setkeyparity(raw[0]); key[1] = des_setkeyparity((raw[0] << 7) | (raw[1] >> 1)); key[2] = des_setkeyparity((raw[1] << 6) | (raw[2] >> 2)); @@ -1029,10 +1027,10 @@ static void des_makekey(const uint8_t *raw, uint8_t *key) { } // run des encryption algorithm (using NSS) -static void des_encrypt(const uint8_t *key, const uint8_t *src, uint8_t *hash) { +static void des_encrypt(const uint8_t* key, const uint8_t* src, uint8_t* hash) { CK_MECHANISM_TYPE cipherMech = CKM_DES_ECB; - PK11SymKey *symkey = nullptr; - PK11Context *ctxt = nullptr; + PK11SymKey* symkey = nullptr; + PK11Context* ctxt = nullptr; SECItem keyItem; mozilla::UniqueSECItem param; SECStatus rv; @@ -1044,7 +1042,7 @@ static void des_encrypt(const uint8_t *key, const uint8_t *src, uint8_t *hash) { goto done; } - keyItem.data = const_cast(key); + keyItem.data = const_cast(key); keyItem.len = 8; symkey = PK11_ImportSymKey(slot.get(), cipherMech, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr); @@ -1067,7 +1065,7 @@ static void des_encrypt(const uint8_t *key, const uint8_t *src, uint8_t *hash) { goto done; } - rv = PK11_CipherOp(ctxt, hash, (int *)&n, 8, (uint8_t *)src, 8); + rv = PK11_CipherOp(ctxt, hash, (int*)&n, 8, (uint8_t*)src, 8); if (rv != SECSuccess) { NS_ERROR("des failure"); goto done; diff --git a/security/manager/ssl/nsProtectedAuthThread.cpp b/security/manager/ssl/nsProtectedAuthThread.cpp index 63a03387dd5b9..b572d263981dd 100644 --- a/security/manager/ssl/nsProtectedAuthThread.cpp +++ b/security/manager/ssl/nsProtectedAuthThread.cpp @@ -20,11 +20,11 @@ using namespace mozilla::psm; NS_IMPL_ISUPPORTS(nsProtectedAuthThread, nsIProtectedAuthThread) -static void nsProtectedAuthThreadRunner(void *arg) { +static void nsProtectedAuthThreadRunner(void* arg) { AUTO_PROFILER_REGISTER_THREAD("Protected Auth"); NS_SetCurrentThreadName("Protected Auth"); - nsProtectedAuthThread *self = static_cast(arg); + nsProtectedAuthThread* self = static_cast(arg); self->Run(); } @@ -38,7 +38,7 @@ nsProtectedAuthThread::nsProtectedAuthThread() nsProtectedAuthThread::~nsProtectedAuthThread() {} -NS_IMETHODIMP nsProtectedAuthThread::Login(nsIObserver *aObserver) { +NS_IMETHODIMP nsProtectedAuthThread::Login(nsIObserver* aObserver) { NS_ENSURE_ARG(aObserver); if (!mSlot) @@ -61,7 +61,7 @@ NS_IMETHODIMP nsProtectedAuthThread::Login(nsIObserver *aObserver) { mIAmRunning = true; mThreadHandle = PR_CreateThread(PR_USER_THREAD, nsProtectedAuthThreadRunner, - static_cast(this), PR_PRIORITY_NORMAL, + static_cast(this), PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); // bool thread_started_ok = (threadHandle != nullptr); @@ -71,7 +71,7 @@ NS_IMETHODIMP nsProtectedAuthThread::Login(nsIObserver *aObserver) { return NS_OK; } -NS_IMETHODIMP nsProtectedAuthThread::GetTokenName(nsAString &_retval) { +NS_IMETHODIMP nsProtectedAuthThread::GetTokenName(nsAString& _retval) { MutexAutoLock lock(mMutex); // Get token name @@ -80,7 +80,7 @@ NS_IMETHODIMP nsProtectedAuthThread::GetTokenName(nsAString &_retval) { return NS_OK; } -NS_IMETHODIMP nsProtectedAuthThread::GetSlot(nsIPKCS11Slot **_retval) { +NS_IMETHODIMP nsProtectedAuthThread::GetSlot(nsIPKCS11Slot** _retval) { RefPtr slot; { MutexAutoLock lock(mMutex); @@ -91,7 +91,7 @@ NS_IMETHODIMP nsProtectedAuthThread::GetSlot(nsIPKCS11Slot **_retval) { return NS_OK; } -void nsProtectedAuthThread::SetParams(PK11SlotInfo *aSlot) { +void nsProtectedAuthThread::SetParams(PK11SlotInfo* aSlot) { MutexAutoLock lock(mMutex); mSlot = (aSlot) ? PK11_ReferenceSlot(aSlot) : 0; diff --git a/security/manager/ssl/nsProtectedAuthThread.h b/security/manager/ssl/nsProtectedAuthThread.h index a647ec2166e8e..83554658f9a59 100644 --- a/security/manager/ssl/nsProtectedAuthThread.h +++ b/security/manager/ssl/nsProtectedAuthThread.h @@ -23,10 +23,10 @@ class nsProtectedAuthThread : public nsIProtectedAuthThread { bool mIAmRunning; bool mLoginReady; - PRThread *mThreadHandle; + PRThread* mThreadHandle; // Slot to do authentication on - PK11SlotInfo *mSlot; + PK11SlotInfo* mSlot; // Result of the authentication SECStatus mLoginResult; @@ -38,7 +38,7 @@ class nsProtectedAuthThread : public nsIProtectedAuthThread { NS_DECL_NSIPROTECTEDAUTHTHREAD // Sets parameters for the thread - void SetParams(PK11SlotInfo *slot); + void SetParams(PK11SlotInfo* slot); // Gets result of the protected authentication operation SECStatus GetResult(); diff --git a/security/manager/ssl/nsSSLSocketProvider.cpp b/security/manager/ssl/nsSSLSocketProvider.cpp index fdef31d717d4f..0fe9bb636d745 100644 --- a/security/manager/ssl/nsSSLSocketProvider.cpp +++ b/security/manager/ssl/nsSSLSocketProvider.cpp @@ -18,12 +18,12 @@ nsSSLSocketProvider::~nsSSLSocketProvider() {} NS_IMPL_ISUPPORTS(nsSSLSocketProvider, nsISocketProvider) NS_IMETHODIMP -nsSSLSocketProvider::NewSocket(int32_t family, const char *host, int32_t port, - nsIProxyInfo *proxy, - const OriginAttributes &originAttributes, +nsSSLSocketProvider::NewSocket(int32_t family, const char* host, int32_t port, + nsIProxyInfo* proxy, + const OriginAttributes& originAttributes, uint32_t flags, uint32_t tlsFlags, - PRFileDesc **_result, - nsISupports **securityInfo) { + PRFileDesc** _result, + nsISupports** securityInfo) { nsresult rv = nsSSLIOLayerNewSocket(family, host, port, proxy, originAttributes, _result, securityInfo, false, flags, tlsFlags); @@ -32,12 +32,12 @@ nsSSLSocketProvider::NewSocket(int32_t family, const char *host, int32_t port, // Add the SSL IO layer to an existing socket NS_IMETHODIMP -nsSSLSocketProvider::AddToSocket(int32_t family, const char *host, int32_t port, - nsIProxyInfo *proxy, - const OriginAttributes &originAttributes, +nsSSLSocketProvider::AddToSocket(int32_t family, const char* host, int32_t port, + nsIProxyInfo* proxy, + const OriginAttributes& originAttributes, uint32_t flags, uint32_t tlsFlags, - PRFileDesc *aSocket, - nsISupports **securityInfo) { + PRFileDesc* aSocket, + nsISupports** securityInfo) { nsresult rv = nsSSLIOLayerAddToSocket(family, host, port, proxy, originAttributes, aSocket, securityInfo, false, flags, tlsFlags); diff --git a/security/manager/ssl/nsSecurityHeaderParser.h b/security/manager/ssl/nsSecurityHeaderParser.h index 2f9df8269b360..5cb50d425adb4 100644 --- a/security/manager/ssl/nsSecurityHeaderParser.h +++ b/security/manager/ssl/nsSecurityHeaderParser.h @@ -40,13 +40,13 @@ class nsSecurityHeaderParser { // The input to this class must be null-terminated, and must have a lifetime // greater than or equal to the lifetime of the created // nsSecurityHeaderParser. - explicit nsSecurityHeaderParser(const nsCString &aHeader); + explicit nsSecurityHeaderParser(const nsCString& aHeader); ~nsSecurityHeaderParser(); // Only call Parse once. nsresult Parse(); // The caller does not take ownership of the memory returned here. - mozilla::LinkedList *GetDirectives(); + mozilla::LinkedList* GetDirectives(); private: bool Accept(char aChr); @@ -68,8 +68,8 @@ class nsSecurityHeaderParser { void LWS(); // Handles the 1*( SP | HT ) part of LWS mozilla::LinkedList mDirectives; - const char *mCursor; - nsSecurityHeaderDirective *mDirective; + const char* mCursor; + nsSecurityHeaderDirective* mDirective; nsCString mOutput; bool mError; diff --git a/security/manager/ssl/nsTLSSocketProvider.cpp b/security/manager/ssl/nsTLSSocketProvider.cpp index d0a2bbe22e19d..641b606d1ca26 100644 --- a/security/manager/ssl/nsTLSSocketProvider.cpp +++ b/security/manager/ssl/nsTLSSocketProvider.cpp @@ -18,12 +18,12 @@ nsTLSSocketProvider::~nsTLSSocketProvider() {} NS_IMPL_ISUPPORTS(nsTLSSocketProvider, nsISocketProvider) NS_IMETHODIMP -nsTLSSocketProvider::NewSocket(int32_t family, const char *host, int32_t port, - nsIProxyInfo *proxy, - const OriginAttributes &originAttributes, +nsTLSSocketProvider::NewSocket(int32_t family, const char* host, int32_t port, + nsIProxyInfo* proxy, + const OriginAttributes& originAttributes, uint32_t flags, uint32_t tlsFlags, - PRFileDesc **_result, - nsISupports **securityInfo) { + PRFileDesc** _result, + nsISupports** securityInfo) { nsresult rv = nsSSLIOLayerNewSocket(family, host, port, proxy, originAttributes, _result, securityInfo, true, flags, tlsFlags); @@ -33,12 +33,12 @@ nsTLSSocketProvider::NewSocket(int32_t family, const char *host, int32_t port, // Add the SSL IO layer to an existing socket NS_IMETHODIMP -nsTLSSocketProvider::AddToSocket(int32_t family, const char *host, int32_t port, - nsIProxyInfo *proxy, - const OriginAttributes &originAttributes, +nsTLSSocketProvider::AddToSocket(int32_t family, const char* host, int32_t port, + nsIProxyInfo* proxy, + const OriginAttributes& originAttributes, uint32_t flags, uint32_t tlsFlags, - PRFileDesc *aSocket, - nsISupports **securityInfo) { + PRFileDesc* aSocket, + nsISupports** securityInfo) { nsresult rv = nsSSLIOLayerAddToSocket(family, host, port, proxy, originAttributes, aSocket, securityInfo, true, flags, tlsFlags); diff --git a/security/manager/ssl/nsVerificationJob.h b/security/manager/ssl/nsVerificationJob.h index 2fbee3bb0841f..377cfabb73be2 100644 --- a/security/manager/ssl/nsVerificationJob.h +++ b/security/manager/ssl/nsVerificationJob.h @@ -40,7 +40,7 @@ class nsCertVerificationResult : public nsICertVerificationResult { nsresult mRV; uint32_t mVerified; uint32_t mCount; - char16_t **mUsages; + char16_t** mUsages; friend class nsCertVerificationJob; }; diff --git a/security/manager/ssl/tests/gtest/DeserializeCertTest.cpp b/security/manager/ssl/tests/gtest/DeserializeCertTest.cpp index dbcb3170cb184..48373db4f3a6d 100644 --- a/security/manager/ssl/tests/gtest/DeserializeCertTest.cpp +++ b/security/manager/ssl/tests/gtest/DeserializeCertTest.cpp @@ -28,7 +28,7 @@ // // We would like to move away from this binary compatibility requirement // in service workers. See bug 1248628. -void deserializeAndVerify(const nsCString &serializedSecInfo, +void deserializeAndVerify(const nsCString& serializedSecInfo, bool hasFailedCertChain, size_t failedCertChainLength = 0) { nsCOMPtr secInfo; diff --git a/security/manager/ssl/tests/unit/tlsserver/cmd/OCSPStaplingServer.cpp b/security/manager/ssl/tests/unit/tlsserver/cmd/OCSPStaplingServer.cpp index e041291b0e563..456755efb12a0 100644 --- a/security/manager/ssl/tests/unit/tlsserver/cmd/OCSPStaplingServer.cpp +++ b/security/manager/ssl/tests/unit/tlsserver/cmd/OCSPStaplingServer.cpp @@ -98,9 +98,9 @@ const OCSPHost sOCSPHosts[] = { "multi-tls-feature-bad-ee"}, {nullptr, ORTNull, nullptr, nullptr}}; -int32_t DoSNISocketConfig(PRFileDesc *aFd, const SECItem *aSrvNameArr, - uint32_t aSrvNameArrSize, void *aArg) { - const OCSPHost *host = +int32_t DoSNISocketConfig(PRFileDesc* aFd, const SECItem* aSrvNameArr, + uint32_t aSrvNameArrSize, void* aArg) { + const OCSPHost* host = GetHostForSNI(aSrvNameArr, aSrvNameArrSize, sOCSPHosts); if (!host) { return SSL_SNI_SEND_ALERT; @@ -110,7 +110,7 @@ int32_t DoSNISocketConfig(PRFileDesc *aFd, const SECItem *aSrvNameArr, fprintf(stderr, "found pre-defined host '%s'\n", host->mHostName); } - const char *certNickname = + const char* certNickname = host->mServerCertName ? host->mServerCertName : DEFAULT_CERT_NICKNAME; UniqueCERTCertificate cert; @@ -132,7 +132,7 @@ int32_t DoSNISocketConfig(PRFileDesc *aFd, const SECItem *aSrvNameArr, } // response is contained by the arena - freeing the arena will free it - SECItemArray *response = GetOCSPResponseForType(host->mORT, cert, arena, + SECItemArray* response = GetOCSPResponseForType(host->mORT, cert, arena, host->mAdditionalCertName, 0); if (!response) { return SSL_SNI_SEND_ALERT; @@ -148,7 +148,7 @@ int32_t DoSNISocketConfig(PRFileDesc *aFd, const SECItem *aSrvNameArr, return 0; } -int main(int argc, char *argv[]) { +int main(int argc, char* argv[]) { if (argc != 2) { fprintf(stderr, "usage: %s \n", argv[0]); return 1; diff --git a/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.h b/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.h index 0d48b20d231e4..b69d9a2ad5ccb 100644 --- a/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.h +++ b/security/manager/ssl/tests/unit/tlsserver/lib/TLSServer.h @@ -34,7 +34,7 @@ enum DebugLevel { DEBUG_ERRORS = 1, DEBUG_WARNINGS = 2, DEBUG_VERBOSE = 3 }; extern DebugLevel gDebugLevel; -void PrintPRError(const char *aPrefix); +void PrintPRError(const char* aPrefix); // The default certificate is trusted for localhost and *.example.com extern const char DEFAULT_CERT_NICKNAME[]; @@ -42,23 +42,22 @@ extern const char DEFAULT_CERT_NICKNAME[]; // Pass DEFAULT_CERT_NICKNAME as certName unless you need a specific // certificate. SECStatus ConfigSecureServerWithNamedCert( - PRFileDesc *fd, const char *certName, - /*optional*/ UniqueCERTCertificate *cert, - /*optional*/ SSLKEAType *kea); + PRFileDesc* fd, const char* certName, + /*optional*/ UniqueCERTCertificate* cert, + /*optional*/ SSLKEAType* kea); -SECStatus InitializeNSS(const char *nssCertDBDir); +SECStatus InitializeNSS(const char* nssCertDBDir); -int StartServer(const char *nssCertDBDir, SSLSNISocketConfig sniSocketConfig, - void *sniSocketConfigArg); +int StartServer(const char* nssCertDBDir, SSLSNISocketConfig sniSocketConfig, + void* sniSocketConfigArg); template -inline const Host *GetHostForSNI(const SECItem *aSrvNameArr, - uint32_t aSrvNameArrSize, const Host *hosts) { +inline const Host* GetHostForSNI(const SECItem* aSrvNameArr, + uint32_t aSrvNameArrSize, const Host* hosts) { for (uint32_t i = 0; i < aSrvNameArrSize; i++) { - for (const Host *host = hosts; host->mHostName; ++host) { + for (const Host* host = hosts; host->mHostName; ++host) { SECItem hostName; - hostName.data = - BitwiseCast(host->mHostName); + hostName.data = BitwiseCast(host->mHostName); hostName.len = strlen(host->mHostName); if (SECITEM_ItemsAreEqual(&hostName, &aSrvNameArr[i])) { if (gDebugLevel >= DEBUG_VERBOSE) { diff --git a/security/sandbox/common/SandboxSettings.cpp b/security/sandbox/common/SandboxSettings.cpp index 91ee4a867813b..16ed5eb4d95c2 100644 --- a/security/sandbox/common/SandboxSettings.cpp +++ b/security/sandbox/common/SandboxSettings.cpp @@ -69,7 +69,7 @@ class SandboxSettings final : public mozISandboxSettings { NS_IMPL_ISUPPORTS(SandboxSettings, mozISandboxSettings) NS_IMETHODIMP SandboxSettings::GetEffectiveContentSandboxLevel( - int32_t *aRetVal) { + int32_t* aRetVal) { *aRetVal = mozilla::GetEffectiveContentSandboxLevel(); return NS_OK; } diff --git a/security/sandbox/linux/glue/SandboxCrash.cpp b/security/sandbox/linux/glue/SandboxCrash.cpp index 5bf7648189827..6868d4094a0b7 100644 --- a/security/sandbox/linux/glue/SandboxCrash.cpp +++ b/security/sandbox/linux/glue/SandboxCrash.cpp @@ -45,7 +45,7 @@ static void SandboxLogJSStack(void) { // If we got a stack, we must have a current JSContext. This is icky. :( // Would be better if GetCurrentJSStack() handed out the JSContext it ended up // using or something. - JSContext *cx = frame ? nsContentUtils::GetCurrentJSContext() : nullptr; + JSContext* cx = frame ? nsContentUtils::GetCurrentJSContext() : nullptr; for (int i = 0; frame != nullptr; ++i) { nsAutoString fileName, funName; int32_t lineNumber; @@ -71,8 +71,8 @@ static void SandboxLogJSStack(void) { } } -static void SandboxPrintStackFrame(uint32_t aFrameNumber, void *aPC, void *aSP, - void *aClosure) { +static void SandboxPrintStackFrame(uint32_t aFrameNumber, void* aPC, void* aSP, + void* aClosure) { char buf[1024]; MozCodeAddressDetails details; @@ -93,7 +93,7 @@ static void SandboxLogCStack() { SANDBOX_LOG_ERROR("end of stack."); } -static void SandboxCrash(int nr, siginfo_t *info, void *void_context) { +static void SandboxCrash(int nr, siginfo_t* info, void* void_context) { pid_t pid = getpid(), tid = syscall(__NR_gettid); bool dumped = CrashReporter::WriteMinidumpForSigInfo(nr, info, void_context); diff --git a/security/sandbox/mac/Sandbox.mm b/security/sandbox/mac/Sandbox.mm index dbb5eaeb5bfb0..a703bb508eabd 100644 --- a/security/sandbox/mac/Sandbox.mm +++ b/security/sandbox/mac/Sandbox.mm @@ -29,12 +29,12 @@ // sandbox_init_with_parameters is not included in the header. For the time // being (until this problem is resolved), we refer directly to what we need // from it, rather than including it here. -extern "C" int sandbox_init(const char *profile, uint64_t flags, char **errorbuf); -extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, - const char *const parameters[], char **errorbuf); -extern "C" void sandbox_free_error(char *errorbuf); +extern "C" int sandbox_init(const char* profile, uint64_t flags, char** errorbuf); +extern "C" int sandbox_init_with_parameters(const char* profile, uint64_t flags, + const char* const parameters[], char** errorbuf); +extern "C" void sandbox_free_error(char* errorbuf); #ifdef DEBUG -extern "C" int sandbox_check(pid_t pid, const char *operation, int type, ...); +extern "C" int sandbox_check(pid_t pid, const char* operation, int type, ...); #endif #define MAC_OS_X_VERSION_10_0_HEX 0x00001000 @@ -58,7 +58,7 @@ static int32_t OSXVersionMinor(); private: - static void GetSystemVersion(int32_t &aMajor, int32_t &aMinor, int32_t &aBugFix); + static void GetSystemVersion(int32_t& aMajor, int32_t& aMinor, int32_t& aBugFix); static int32_t GetVersionNumber(); static int32_t mOSXVersion; }; @@ -67,7 +67,7 @@ int32_t OSXVersion::OSXVersionMinor() { return (GetVersionNumber() & 0xF0) >> 4; } -void OSXVersion::GetSystemVersion(int32_t &aMajor, int32_t &aMinor, int32_t &aBugFix) { +void OSXVersion::GetSystemVersion(int32_t& aMajor, int32_t& aMinor, int32_t& aBugFix) { SInt32 major = 0, minor = 0, bugfix = 0; CFURLRef url = CFURLCreateWithString( @@ -122,8 +122,8 @@ return mOSXVersion; } -bool GetRealPath(std::string &aOutputPath, const char *aInputPath) { - char *resolvedPath = realpath(aInputPath, nullptr); +bool GetRealPath(std::string& aOutputPath, const char* aInputPath) { + char* resolvedPath = realpath(aInputPath, nullptr); if (resolvedPath == nullptr) { return false; } @@ -134,7 +134,7 @@ bool GetRealPath(std::string &aOutputPath, const char *aInputPath) { return !aOutputPath.empty(); } -void MacSandboxInfo::AppendAsParams(std::vector &aParams) const { +void MacSandboxInfo::AppendAsParams(std::vector& aParams) const { this->AppendStartupParam(aParams); this->AppendLoggingParam(aParams); this->AppendAppPathParam(aParams); @@ -159,30 +159,30 @@ bool GetRealPath(std::string &aOutputPath, const char *aInputPath) { } } -void MacSandboxInfo::AppendStartupParam(std::vector &aParams) const { +void MacSandboxInfo::AppendStartupParam(std::vector& aParams) const { aParams.push_back("-sbStartup"); } -void MacSandboxInfo::AppendLoggingParam(std::vector &aParams) const { +void MacSandboxInfo::AppendLoggingParam(std::vector& aParams) const { if (this->shouldLog) { aParams.push_back("-sbLogging"); } } -void MacSandboxInfo::AppendAppPathParam(std::vector &aParams) const { +void MacSandboxInfo::AppendAppPathParam(std::vector& aParams) const { aParams.push_back("-sbAppPath"); aParams.push_back(this->appPath); } /* static */ -void MacSandboxInfo::AppendFileAccessParam(std::vector &aParams, +void MacSandboxInfo::AppendFileAccessParam(std::vector& aParams, bool aHasFilePrivileges) { if (aHasFilePrivileges) { aParams.push_back("-sbAllowFileAccess"); } } -void MacSandboxInfo::AppendLevelParam(std::vector &aParams) const { +void MacSandboxInfo::AppendLevelParam(std::vector& aParams) const { std::ostringstream os; os << this->level; std::string levelString = os.str(); @@ -190,19 +190,19 @@ bool GetRealPath(std::string &aOutputPath, const char *aInputPath) { aParams.push_back(levelString); } -void MacSandboxInfo::AppendAudioParam(std::vector &aParams) const { +void MacSandboxInfo::AppendAudioParam(std::vector& aParams) const { if (this->hasAudio) { aParams.push_back("-sbAllowAudio"); } } -void MacSandboxInfo::AppendWindowServerParam(std::vector &aParams) const { +void MacSandboxInfo::AppendWindowServerParam(std::vector& aParams) const { if (this->hasWindowServer) { aParams.push_back("-sbAllowWindowServer"); } } -void MacSandboxInfo::AppendReadPathParams(std::vector &aParams) const { +void MacSandboxInfo::AppendReadPathParams(std::vector& aParams) const { if (!this->testingReadPath1.empty()) { aParams.push_back("-sbTestingReadPath"); aParams.push_back(this->testingReadPath1.c_str()); @@ -222,7 +222,7 @@ bool GetRealPath(std::string &aOutputPath, const char *aInputPath) { } #ifdef DEBUG -void MacSandboxInfo::AppendDebugWriteDirParam(std::vector &aParams) const { +void MacSandboxInfo::AppendDebugWriteDirParam(std::vector& aParams) const { if (!this->debugWriteDir.empty()) { aParams.push_back("-sbDebugWriteDir"); aParams.push_back(this->debugWriteDir.c_str()); @@ -232,8 +232,8 @@ bool GetRealPath(std::string &aOutputPath, const char *aInputPath) { namespace mozilla { -bool StartMacSandbox(MacSandboxInfo const &aInfo, std::string &aErrorMessage) { - std::vector params; +bool StartMacSandbox(MacSandboxInfo const& aInfo, std::string& aErrorMessage) { + std::vector params; std::string profile; std::string macOSMinor = std::to_string(OSXVersion::OSXVersionMinor()); @@ -285,7 +285,7 @@ bool StartMacSandbox(MacSandboxInfo const &aInfo, std::string &aErrorMessage) { } params.push_back(flashTempDir.c_str()); } else if (aInfo.type == MacSandboxType_Utility) { - profile = const_cast(SandboxPolicyUtility); + profile = const_cast(SandboxPolicyUtility); params.push_back("SHOULD_LOG"); params.push_back(aInfo.shouldLog ? "TRUE" : "FALSE"); params.push_back("APP_PATH"); @@ -295,7 +295,7 @@ bool StartMacSandbox(MacSandboxInfo const &aInfo, std::string &aErrorMessage) { params.push_back(aInfo.crashServerPort.c_str()); } } else if (aInfo.type == MacSandboxType_Plugin) { - profile = const_cast(SandboxPolicyGMP); + profile = const_cast(SandboxPolicyGMP); params.push_back("SHOULD_LOG"); params.push_back(aInfo.shouldLog ? "TRUE" : "FALSE"); params.push_back("PLUGIN_BINARY_PATH"); @@ -366,7 +366,7 @@ bool StartMacSandbox(MacSandboxInfo const &aInfo, std::string &aErrorMessage) { return false; } } else { - char *msg = NULL; + char* msg = NULL; asprintf(&msg, "Unexpected sandbox type %u", aInfo.type); if (msg) { aErrorMessage.assign(msg); @@ -396,11 +396,11 @@ bool StartMacSandbox(MacSandboxInfo const &aInfo, std::string &aErrorMessage) { // The parameters array is null terminated. params.push_back(nullptr); - char *errorbuf = NULL; + char* errorbuf = NULL; int rv = sandbox_init_with_parameters(profile.c_str(), 0, params.data(), &errorbuf); if (rv) { if (errorbuf) { - char *msg = NULL; + char* msg = NULL; asprintf(&msg, "sandbox_init() failed with error \"%s\"", errorbuf); if (msg) { aErrorMessage.assign(msg); @@ -422,7 +422,7 @@ bool StartMacSandbox(MacSandboxInfo const &aInfo, std::string &aErrorMessage) { * command line arguments. Return false if any sandbox parameters needed * for early startup of the sandbox are not present in the arguments. */ -bool GetContentSandboxParamsFromArgs(int aArgc, char **aArgv, MacSandboxInfo &aInfo) { +bool GetContentSandboxParamsFromArgs(int aArgc, char** aArgv, MacSandboxInfo& aInfo) { // Ensure we find these paramaters in the command // line arguments. Return false if any are missing. bool foundSandboxLevel = false; @@ -534,7 +534,7 @@ bool GetContentSandboxParamsFromArgs(int aArgc, char **aArgv, MacSandboxInfo &aI return true; } -bool GetUtilitySandboxParamsFromArgs(int aArgc, char **aArgv, MacSandboxInfo &aInfo) { +bool GetUtilitySandboxParamsFromArgs(int aArgc, char** aArgv, MacSandboxInfo& aInfo) { // Ensure we find these paramaters in the command // line arguments. Return false if any are missing. bool foundAppPath = false; @@ -573,8 +573,8 @@ bool GetUtilitySandboxParamsFromArgs(int aArgc, char **aArgv, MacSandboxInfo &aI * Returns true if no errors were encountered or if early sandbox startup is * not enabled for this process. Returns false if an error was encountered. */ -bool StartMacSandboxIfEnabled(const MacSandboxType aSandboxType, int aArgc, char **aArgv, - std::string &aErrorMessage) { +bool StartMacSandboxIfEnabled(const MacSandboxType aSandboxType, int aArgc, char** aArgv, + std::string& aErrorMessage) { bool earlyStartupEnabled = false; // Check for the -sbStartup CLI parameter which diff --git a/security/sandbox/win/src/remotesandboxbroker/remoteSandboxBroker.cpp b/security/sandbox/win/src/remotesandboxbroker/remoteSandboxBroker.cpp index 6d1435bb69406..91e3c553a409a 100644 --- a/security/sandbox/win/src/remotesandboxbroker/remoteSandboxBroker.cpp +++ b/security/sandbox/win/src/remotesandboxbroker/remoteSandboxBroker.cpp @@ -34,12 +34,12 @@ void RemoteSandboxBroker::Shutdown() { })); } -bool RemoteSandboxBroker::LaunchApp(const wchar_t *aPath, - const wchar_t *aArguments, - base::EnvironmentMap &aEnvironment, +bool RemoteSandboxBroker::LaunchApp(const wchar_t* aPath, + const wchar_t* aArguments, + base::EnvironmentMap& aEnvironment, GeckoProcessType aProcessType, const bool aEnableLogging, - void **aProcessHandle) { + void** aProcessHandle) { // Note: we expect to be called on the IPC launch thread from // GeckoChildProcesHost while it's launching a child process. We can't // run a synchronous launch here as that blocks the calling thread while @@ -56,7 +56,7 @@ bool RemoteSandboxBroker::LaunchApp(const wchar_t *aPath, mParameters.path() = nsDependentString(aPath); mParameters.args() = nsDependentString(aArguments); - auto toNsString = [](const std::wstring &s) { + auto toNsString = [](const std::wstring& s) { return nsDependentString(s.c_str()); }; for (auto itr : aEnvironment) { @@ -106,7 +106,7 @@ bool RemoteSandboxBroker::LaunchApp(const wchar_t *aPath, return false; } - *aProcessHandle = (void **)(ourChildHandle); + *aProcessHandle = (void**)(ourChildHandle); base::ProcessHandle process = *aProcessHandle; SandboxBroker::AddTargetPeer(process); @@ -119,7 +119,7 @@ bool RemoteSandboxBroker::SetSecurityLevelForGMPlugin(SandboxLevel aLevel) { return true; } -bool RemoteSandboxBroker::AllowReadFile(wchar_t const *aFile) { +bool RemoteSandboxBroker::AllowReadFile(wchar_t const* aFile) { mParameters.allowedReadFiles().AppendElement(nsDependentString(aFile)); return true; } @@ -150,7 +150,7 @@ bool RemoteSandboxBroker::SetSecurityLevelForPluginProcess( "RemoteSandboxBroker::SetSecurityLevelForPluginProcess not Implemented"); } -AbstractSandboxBroker *CreateRemoteSandboxBroker() { +AbstractSandboxBroker* CreateRemoteSandboxBroker() { return new RemoteSandboxBroker(); } diff --git a/security/sandbox/win/src/remotesandboxbroker/remoteSandboxBroker.h b/security/sandbox/win/src/remotesandboxbroker/remoteSandboxBroker.h index 5ca0b4aac17d3..c604de592997a 100644 --- a/security/sandbox/win/src/remotesandboxbroker/remoteSandboxBroker.h +++ b/security/sandbox/win/src/remotesandboxbroker/remoteSandboxBroker.h @@ -27,10 +27,10 @@ class RemoteSandboxBroker : public AbstractSandboxBroker { // Note: This should be called on the IPC launch thread, and this spins // the event loop. So this means potentially another IPC launch could occur // re-entrantly while calling this. - bool LaunchApp(const wchar_t *aPath, const wchar_t *aArguments, - base::EnvironmentMap &aEnvironment, + bool LaunchApp(const wchar_t* aPath, const wchar_t* aArguments, + base::EnvironmentMap& aEnvironment, GeckoProcessType aProcessType, const bool aEnableLogging, - void **aProcessHandle) override; + void** aProcessHandle) override; // Security levels for different types of processes void SetSecurityLevelForContentProcess(int32_t aSandboxLevel, @@ -39,7 +39,7 @@ class RemoteSandboxBroker : public AbstractSandboxBroker { bool SetSecurityLevelForRDDProcess() override; bool SetSecurityLevelForPluginProcess(int32_t aSandboxLevel) override; bool SetSecurityLevelForGMPlugin(SandboxLevel aLevel) override; - bool AllowReadFile(wchar_t const *file) override; + bool AllowReadFile(wchar_t const* file) override; void AddHandleToShare(HANDLE aHandle) override; private: diff --git a/security/sandbox/win/src/sandboxbroker/sandboxBroker.h b/security/sandbox/win/src/sandboxbroker/sandboxBroker.h index 5f52914124093..39cc0e74e6947 100644 --- a/security/sandbox/win/src/sandboxbroker/sandboxBroker.h +++ b/security/sandbox/win/src/sandboxbroker/sandboxBroker.h @@ -26,13 +26,13 @@ class AbstractSandboxBroker { public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AbstractSandboxBroker) - static AbstractSandboxBroker *Create(GeckoProcessType aProcessType); + static AbstractSandboxBroker* Create(GeckoProcessType aProcessType); virtual void Shutdown() = 0; - virtual bool LaunchApp(const wchar_t *aPath, const wchar_t *aArguments, - base::EnvironmentMap &aEnvironment, + virtual bool LaunchApp(const wchar_t* aPath, const wchar_t* aArguments, + base::EnvironmentMap& aEnvironment, GeckoProcessType aProcessType, - const bool aEnableLogging, void **aProcessHandle) = 0; + const bool aEnableLogging, void** aProcessHandle) = 0; // Security levels for different types of processes virtual void SetSecurityLevelForContentProcess(int32_t aSandboxLevel, @@ -46,7 +46,7 @@ class AbstractSandboxBroker { virtual bool SetSecurityLevelForGMPlugin(SandboxLevel aLevel) = 0; // File system permissions - virtual bool AllowReadFile(wchar_t const *file) = 0; + virtual bool AllowReadFile(wchar_t const* file) = 0; /** * Share a HANDLE with the child process. The HANDLE will be made available @@ -64,7 +64,7 @@ class SandboxBroker : public AbstractSandboxBroker { public: SandboxBroker(); - static void Initialize(sandbox::BrokerServices *aBrokerServices); + static void Initialize(sandbox::BrokerServices* aBrokerServices); void Shutdown() override {} @@ -74,10 +74,10 @@ class SandboxBroker : public AbstractSandboxBroker { */ static void GeckoDependentInitialize(); - bool LaunchApp(const wchar_t *aPath, const wchar_t *aArguments, - base::EnvironmentMap &aEnvironment, + bool LaunchApp(const wchar_t* aPath, const wchar_t* aArguments, + base::EnvironmentMap& aEnvironment, GeckoProcessType aProcessType, const bool aEnableLogging, - void **aProcessHandle) override; + void** aProcessHandle) override; virtual ~SandboxBroker(); // Security levels for different types of processes @@ -91,7 +91,7 @@ class SandboxBroker : public AbstractSandboxBroker { bool SetSecurityLevelForGMPlugin(SandboxLevel aLevel) override; // File system permissions - bool AllowReadFile(wchar_t const *file) override; + bool AllowReadFile(wchar_t const* file) override; /** * Exposes AddTargetPeer from broker services, so that non-sandboxed @@ -111,9 +111,9 @@ class SandboxBroker : public AbstractSandboxBroker { void ApplyLoggingPolicy(); private: - static sandbox::BrokerServices *sBrokerService; + static sandbox::BrokerServices* sBrokerService; static bool sRunningFromNetworkDrive; - sandbox::TargetPolicy *mPolicy; + sandbox::TargetPolicy* mPolicy; }; } // namespace mozilla diff --git a/startupcache/StartupCacheUtils.cpp b/startupcache/StartupCacheUtils.cpp index 6a29bdc3ddc9a..81f865b0626ca 100644 --- a/startupcache/StartupCacheUtils.cpp +++ b/startupcache/StartupCacheUtils.cpp @@ -20,7 +20,7 @@ namespace mozilla { namespace scache { nsresult NewObjectInputStreamFromBuffer(UniquePtr buffer, uint32_t len, - nsIObjectInputStream **stream) { + nsIObjectInputStream** stream) { nsCOMPtr stringStream; nsresult rv = NS_NewByteInputStream(getter_AddRefs(stringStream), MakeSpan(buffer.release(), len), @@ -35,7 +35,7 @@ nsresult NewObjectInputStreamFromBuffer(UniquePtr buffer, uint32_t len, } nsresult NewObjectOutputWrappedStorageStream( - nsIObjectOutputStream **wrapperStream, nsIStorageStream **stream, + nsIObjectOutputStream** wrapperStream, nsIStorageStream** stream, bool wantDebugStream) { nsCOMPtr storageStream; @@ -52,7 +52,7 @@ nsresult NewObjectOutputWrappedStorageStream( if (wantDebugStream) { // Wrap in debug stream to detect unsupported writes of // multiply-referenced non-singleton objects - StartupCache *sc = StartupCache::GetSingleton(); + StartupCache* sc = StartupCache::GetSingleton(); NS_ENSURE_TRUE(sc, NS_ERROR_UNEXPECTED); nsCOMPtr debugStream; sc->GetDebugObjectOutputStream(objectOutput, getter_AddRefs(debugStream)); @@ -68,8 +68,8 @@ nsresult NewObjectOutputWrappedStorageStream( return NS_OK; } -nsresult NewBufferFromStorageStream(nsIStorageStream *storageStream, - UniquePtr *buffer, uint32_t *len) { +nsresult NewBufferFromStorageStream(nsIStorageStream* storageStream, + UniquePtr* buffer, uint32_t* len) { nsresult rv; nsCOMPtr inputStream; rv = storageStream->NewInputStream(0, getter_AddRefs(inputStream)); @@ -97,7 +97,7 @@ nsresult NewBufferFromStorageStream(nsIStorageStream *storageStream, static const char baseName[2][5] = {"gre/", "app/"}; -static inline bool canonicalizeBase(nsAutoCString &spec, nsACString &out) { +static inline bool canonicalizeBase(nsAutoCString& spec, nsACString& out) { nsAutoCString greBase, appBase; nsresult rv = mozilla::Omnijar::GetURIString(mozilla::Omnijar::GRE, greBase); if (NS_FAILED(rv) || !greBase.Length()) return false; @@ -135,7 +135,7 @@ static inline bool canonicalizeBase(nsAutoCString &spec, nsACString &out) { * ResolveURI transforms a chrome: or resource: URI into the URI for its * underlying resource, or returns any other URI unchanged. */ -nsresult ResolveURI(nsIURI *in, nsIURI **out) { +nsresult ResolveURI(nsIURI* in, nsIURI** out) { bool equals; nsresult rv; @@ -194,7 +194,7 @@ nsresult ResolveURI(nsIURI *in, nsIURI **out) { * jar:file://$PROFILE_DIR/extensions/some.xpi!/components/component.js becomes * jsloader/$PROFILE_DIR/extensions/some.xpi/components/component.js */ -nsresult PathifyURI(nsIURI *in, nsACString &out) { +nsresult PathifyURI(nsIURI* in, nsACString& out) { bool equals; nsresult rv; diff --git a/startupcache/StartupCacheUtils.h b/startupcache/StartupCacheUtils.h index 9631ddef49f56..c1ab2dad78786 100644 --- a/startupcache/StartupCacheUtils.h +++ b/startupcache/StartupCacheUtils.h @@ -17,7 +17,7 @@ namespace mozilla { namespace scache { nsresult NewObjectInputStreamFromBuffer(UniquePtr buffer, uint32_t len, - nsIObjectInputStream **stream); + nsIObjectInputStream** stream); // We can't retrieve the wrapped stream from the objectOutputStream later, // so we return it here. We give callers in debug builds the option @@ -26,18 +26,18 @@ nsresult NewObjectInputStreamFromBuffer(UniquePtr buffer, uint32_t len, // This could cause them to be deserialized incorrectly (as multiple copies // instead of references). nsresult NewObjectOutputWrappedStorageStream( - nsIObjectOutputStream **wrapperStream, nsIStorageStream **stream, + nsIObjectOutputStream** wrapperStream, nsIStorageStream** stream, bool wantDebugStream); // Creates a buffer for storing the stream into the cache. The buffer is // allocated with 'new []'. After calling this function, the caller would // typically call StartupCache::PutBuffer with the returned buffer. -nsresult NewBufferFromStorageStream(nsIStorageStream *storageStream, - UniquePtr *buffer, uint32_t *len); +nsresult NewBufferFromStorageStream(nsIStorageStream* storageStream, + UniquePtr* buffer, uint32_t* len); -nsresult ResolveURI(nsIURI *in, nsIURI **out); +nsresult ResolveURI(nsIURI* in, nsIURI** out); -nsresult PathifyURI(nsIURI *in, nsACString &out); +nsresult PathifyURI(nsIURI* in, nsACString& out); } // namespace scache } // namespace mozilla diff --git a/storage/IStorageBindingParamsInternal.h b/storage/IStorageBindingParamsInternal.h index 6e78a086f2720..a056ae3269807 100644 --- a/storage/IStorageBindingParamsInternal.h +++ b/storage/IStorageBindingParamsInternal.h @@ -39,14 +39,14 @@ class IStorageBindingParamsInternal : public nsISupports { * @return nullptr on success, or a mozIStorageError object if an error * occurred. */ - virtual already_AddRefed bind(sqlite3_stmt *aStatement) = 0; + virtual already_AddRefed bind(sqlite3_stmt* aStatement) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(IStorageBindingParamsInternal, ISTORAGEBINDINGPARAMSINTERNAL_IID) #define NS_DECL_ISTORAGEBINDINGPARAMSINTERNAL \ - already_AddRefed bind(sqlite3_stmt *aStatement) override; + already_AddRefed bind(sqlite3_stmt* aStatement) override; } // namespace storage } // namespace mozilla diff --git a/storage/SQLCollations.cpp b/storage/SQLCollations.cpp index 56ba44da9c5fd..1495ecc1da177 100644 --- a/storage/SQLCollations.cpp +++ b/storage/SQLCollations.cpp @@ -37,12 +37,12 @@ namespace { * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollationHelper8(void *aService, int aLen1, const void *aStr1, - int aLen2, const void *aStr2, +int localeCollationHelper8(void* aService, int aLen1, const void* aStr1, + int aLen2, const void* aStr2, int32_t aComparisonStrength) { - NS_ConvertUTF8toUTF16 str1(static_cast(aStr1), aLen1); - NS_ConvertUTF8toUTF16 str2(static_cast(aStr2), aLen2); - Service *serv = static_cast(aService); + NS_ConvertUTF8toUTF16 str1(static_cast(aStr1), aLen1); + NS_ConvertUTF8toUTF16 str2(static_cast(aStr2), aLen2); + Service* serv = static_cast(aService); return serv->localeCompareStrings(str1, str2, aComparisonStrength); } @@ -67,11 +67,11 @@ int localeCollationHelper8(void *aService, int aLen1, const void *aStr1, * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollationHelper16(void *aService, int aLen1, const void *aStr1, - int aLen2, const void *aStr2, +int localeCollationHelper16(void* aService, int aLen1, const void* aStr1, + int aLen2, const void* aStr2, int32_t aComparisonStrength) { - const char16_t *buf1 = static_cast(aStr1); - const char16_t *buf2 = static_cast(aStr2); + const char16_t* buf1 = static_cast(aStr1); + const char16_t* buf2 = static_cast(aStr2); // The second argument to the nsDependentSubstring constructor is exclusive: // It points to the char16_t immediately following the last one in the target @@ -79,16 +79,16 @@ int localeCollationHelper16(void *aService, int aLen1, const void *aStr1, // so that the pointer arithmetic is correct. nsDependentSubstring str1(buf1, buf1 + (aLen1 / sizeof(char16_t))); nsDependentSubstring str2(buf2, buf2 + (aLen2 / sizeof(char16_t))); - Service *serv = static_cast(aService); + Service* serv = static_cast(aService); return serv->localeCompareStrings(str1, str2, aComparisonStrength); } // This struct is used only by registerCollations below, but ISO C++98 forbids // instantiating a template dependent on a locally-defined type. Boo-urns! struct Collations { - const char *zName; + const char* zName; int enc; - int (*xCompare)(void *, int, const void *, int, const void *); + int (*xCompare)(void*, int, const void*, int, const void*); }; } // namespace @@ -96,7 +96,7 @@ struct Collations { //////////////////////////////////////////////////////////////////////////////// //// Exposed Functions -int registerCollations(sqlite3 *aDB, Service *aService) { +int registerCollations(sqlite3* aDB, Service* aService) { Collations collations[] = { {"locale", SQLITE_UTF8, localeCollation8}, {"locale_case_sensitive", SQLITE_UTF8, localeCollationCaseSensitive8}, @@ -113,7 +113,7 @@ int registerCollations(sqlite3 *aDB, Service *aService) { int rv = SQLITE_OK; for (size_t i = 0; SQLITE_OK == rv && i < ArrayLength(collations); ++i) { - struct Collations *p = &collations[i]; + struct Collations* p = &collations[i]; rv = ::sqlite3_create_collation(aDB, p->zName, p->enc, aService, p->xCompare); } @@ -124,54 +124,54 @@ int registerCollations(sqlite3 *aDB, Service *aService) { //////////////////////////////////////////////////////////////////////////////// //// SQL Collations -int localeCollation8(void *aService, int aLen1, const void *aStr1, int aLen2, - const void *aStr2) { +int localeCollation8(void* aService, int aLen1, const void* aStr1, int aLen2, + const void* aStr2) { return localeCollationHelper8(aService, aLen1, aStr1, aLen2, aStr2, nsICollation::kCollationCaseInSensitive); } -int localeCollationCaseSensitive8(void *aService, int aLen1, const void *aStr1, - int aLen2, const void *aStr2) { +int localeCollationCaseSensitive8(void* aService, int aLen1, const void* aStr1, + int aLen2, const void* aStr2) { return localeCollationHelper8(aService, aLen1, aStr1, aLen2, aStr2, nsICollation::kCollationAccentInsenstive); } -int localeCollationAccentSensitive8(void *aService, int aLen1, - const void *aStr1, int aLen2, - const void *aStr2) { +int localeCollationAccentSensitive8(void* aService, int aLen1, + const void* aStr1, int aLen2, + const void* aStr2) { return localeCollationHelper8(aService, aLen1, aStr1, aLen2, aStr2, nsICollation::kCollationCaseInsensitiveAscii); } -int localeCollationCaseAccentSensitive8(void *aService, int aLen1, - const void *aStr1, int aLen2, - const void *aStr2) { +int localeCollationCaseAccentSensitive8(void* aService, int aLen1, + const void* aStr1, int aLen2, + const void* aStr2) { return localeCollationHelper8(aService, aLen1, aStr1, aLen2, aStr2, nsICollation::kCollationCaseSensitive); } -int localeCollation16(void *aService, int aLen1, const void *aStr1, int aLen2, - const void *aStr2) { +int localeCollation16(void* aService, int aLen1, const void* aStr1, int aLen2, + const void* aStr2) { return localeCollationHelper16(aService, aLen1, aStr1, aLen2, aStr2, nsICollation::kCollationCaseInSensitive); } -int localeCollationCaseSensitive16(void *aService, int aLen1, const void *aStr1, - int aLen2, const void *aStr2) { +int localeCollationCaseSensitive16(void* aService, int aLen1, const void* aStr1, + int aLen2, const void* aStr2) { return localeCollationHelper16(aService, aLen1, aStr1, aLen2, aStr2, nsICollation::kCollationAccentInsenstive); } -int localeCollationAccentSensitive16(void *aService, int aLen1, - const void *aStr1, int aLen2, - const void *aStr2) { +int localeCollationAccentSensitive16(void* aService, int aLen1, + const void* aStr1, int aLen2, + const void* aStr2) { return localeCollationHelper16(aService, aLen1, aStr1, aLen2, aStr2, nsICollation::kCollationCaseInsensitiveAscii); } -int localeCollationCaseAccentSensitive16(void *aService, int aLen1, - const void *aStr1, int aLen2, - const void *aStr2) { +int localeCollationCaseAccentSensitive16(void* aService, int aLen1, + const void* aStr1, int aLen2, + const void* aStr2) { return localeCollationHelper16(aService, aLen1, aStr1, aLen2, aStr2, nsICollation::kCollationCaseSensitive); } diff --git a/storage/SQLCollations.h b/storage/SQLCollations.h index d108d05a16018..d0bb53d2db11e 100644 --- a/storage/SQLCollations.h +++ b/storage/SQLCollations.h @@ -26,7 +26,7 @@ namespace storage { * The Service that owns the nsICollation used by our collations. * @return the SQLite status code indicating success or failure. */ -int registerCollations(sqlite3 *aDB, Service *aService); +int registerCollations(sqlite3* aDB, Service* aService); //////////////////////////////////////////////////////////////////////////////// //// Predefined Functions @@ -51,8 +51,8 @@ int registerCollations(sqlite3 *aDB, Service *aService); * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollation8(void *aService, int aLen1, const void *aStr1, int aLen2, - const void *aStr2); +int localeCollation8(void* aService, int aLen1, const void* aStr1, int aLen2, + const void* aStr2); /** * Custom UTF-8 collating sequence that respects the application's locale. @@ -75,8 +75,8 @@ int localeCollation8(void *aService, int aLen1, const void *aStr1, int aLen2, * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollationCaseSensitive8(void *aService, int aLen1, const void *aStr1, - int aLen2, const void *aStr2); +int localeCollationCaseSensitive8(void* aService, int aLen1, const void* aStr1, + int aLen2, const void* aStr2); /** * Custom UTF-8 collating sequence that respects the application's locale. @@ -99,9 +99,9 @@ int localeCollationCaseSensitive8(void *aService, int aLen1, const void *aStr1, * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollationAccentSensitive8(void *aService, int aLen1, - const void *aStr1, int aLen2, - const void *aStr2); +int localeCollationAccentSensitive8(void* aService, int aLen1, + const void* aStr1, int aLen2, + const void* aStr2); /** * Custom UTF-8 collating sequence that respects the application's locale. @@ -123,9 +123,9 @@ int localeCollationAccentSensitive8(void *aService, int aLen1, * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollationCaseAccentSensitive8(void *aService, int aLen1, - const void *aStr1, int aLen2, - const void *aStr2); +int localeCollationCaseAccentSensitive8(void* aService, int aLen1, + const void* aStr1, int aLen2, + const void* aStr2); /** * Custom UTF-16 collating sequence that respects the application's locale. @@ -147,8 +147,8 @@ int localeCollationCaseAccentSensitive8(void *aService, int aLen1, * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollation16(void *aService, int aLen1, const void *aStr1, int aLen2, - const void *aStr2); +int localeCollation16(void* aService, int aLen1, const void* aStr1, int aLen2, + const void* aStr2); /** * Custom UTF-16 collating sequence that respects the application's locale. @@ -171,8 +171,8 @@ int localeCollation16(void *aService, int aLen1, const void *aStr1, int aLen2, * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollationCaseSensitive16(void *aService, int aLen1, const void *aStr1, - int aLen2, const void *aStr2); +int localeCollationCaseSensitive16(void* aService, int aLen1, const void* aStr1, + int aLen2, const void* aStr2); /** * Custom UTF-16 collating sequence that respects the application's locale. @@ -195,9 +195,9 @@ int localeCollationCaseSensitive16(void *aService, int aLen1, const void *aStr1, * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollationAccentSensitive16(void *aService, int aLen1, - const void *aStr1, int aLen2, - const void *aStr2); +int localeCollationAccentSensitive16(void* aService, int aLen1, + const void* aStr1, int aLen2, + const void* aStr2); /** * Custom UTF-16 collating sequence that respects the application's locale. @@ -219,9 +219,9 @@ int localeCollationAccentSensitive16(void *aService, int aLen1, * If aStr1 > aStr2, returns a positive number. If aStr1 == aStr2, * returns 0. */ -int localeCollationCaseAccentSensitive16(void *aService, int aLen1, - const void *aStr1, int aLen2, - const void *aStr2); +int localeCollationCaseAccentSensitive16(void* aService, int aLen1, + const void* aStr1, int aLen2, + const void* aStr2); } // namespace storage } // namespace mozilla diff --git a/storage/SQLiteMutex.h b/storage/SQLiteMutex.h index edd73d6d9dba5..77598be71971c 100644 --- a/storage/SQLiteMutex.h +++ b/storage/SQLiteMutex.h @@ -28,7 +28,7 @@ class SQLiteMutex : private BlockingResourceBase { * @param aName * A name which can be used to reference this mutex. */ - explicit SQLiteMutex(const char *aName) + explicit SQLiteMutex(const char* aName) : BlockingResourceBase(aName, eMutex), mMutex(nullptr) {} /** @@ -39,7 +39,7 @@ class SQLiteMutex : private BlockingResourceBase { * @param aMutex * The sqlite3_mutex that we are going to wrap. */ - void initWithMutex(sqlite3_mutex *aMutex) { + void initWithMutex(sqlite3_mutex* aMutex) { NS_ASSERTION(aMutex, "You must pass in a valid mutex!"); NS_ASSERTION(!mMutex, "A mutex has already been set for this!"); mMutex = aMutex; @@ -107,7 +107,7 @@ class SQLiteMutex : private BlockingResourceBase { #endif // ifndef DEBUG private: - sqlite3_mutex *mMutex; + sqlite3_mutex* mMutex; }; /** @@ -116,14 +116,14 @@ class SQLiteMutex : private BlockingResourceBase { */ class MOZ_STACK_CLASS SQLiteMutexAutoLock { public: - explicit SQLiteMutexAutoLock(SQLiteMutex &aMutex) : mMutex(aMutex) { + explicit SQLiteMutexAutoLock(SQLiteMutex& aMutex) : mMutex(aMutex) { mMutex.lock(); } ~SQLiteMutexAutoLock() { mMutex.unlock(); } private: - SQLiteMutex &mMutex; + SQLiteMutex& mMutex; }; /** @@ -132,14 +132,14 @@ class MOZ_STACK_CLASS SQLiteMutexAutoLock { */ class MOZ_STACK_CLASS SQLiteMutexAutoUnlock { public: - explicit SQLiteMutexAutoUnlock(SQLiteMutex &aMutex) : mMutex(aMutex) { + explicit SQLiteMutexAutoUnlock(SQLiteMutex& aMutex) : mMutex(aMutex) { mMutex.unlock(); } ~SQLiteMutexAutoUnlock() { mMutex.lock(); } private: - SQLiteMutex &mMutex; + SQLiteMutex& mMutex; }; } // namespace storage diff --git a/storage/StorageBaseStatementInternal.cpp b/storage/StorageBaseStatementInternal.cpp index 94c7d4a902c32..1d00700e550dc 100644 --- a/storage/StorageBaseStatementInternal.cpp +++ b/storage/StorageBaseStatementInternal.cpp @@ -34,8 +34,8 @@ class AsyncStatementFinalizer : public Runnable { * on. We release the statement on that thread since releasing the * statement might end up releasing the connection too. */ - AsyncStatementFinalizer(StorageBaseStatementInternal *aStatement, - Connection *aConnection) + AsyncStatementFinalizer(StorageBaseStatementInternal* aStatement, + Connection* aConnection) : Runnable("storage::AsyncStatementFinalizer"), mStatement(aStatement), mConnection(aConnection) {} @@ -78,8 +78,8 @@ class LastDitchSqliteStatementFinalizer : public Runnable { * responsibility for the instance and all other references to it * should be forgotten. */ - LastDitchSqliteStatementFinalizer(RefPtr &aConnection, - sqlite3_stmt *aStatement) + LastDitchSqliteStatementFinalizer(RefPtr& aConnection, + sqlite3_stmt* aStatement) : Runnable("storage::LastDitchSqliteStatementFinalizer"), mConnection(aConnection), mAsyncStatement(aStatement) { @@ -98,7 +98,7 @@ class LastDitchSqliteStatementFinalizer : public Runnable { private: RefPtr mConnection; - sqlite3_stmt *mAsyncStatement; + sqlite3_stmt* mAsyncStatement; }; //////////////////////////////////////////////////////////////////////////////// @@ -108,7 +108,7 @@ StorageBaseStatementInternal::StorageBaseStatementInternal() : mNativeConnection(nullptr), mAsyncStatement(nullptr) {} void StorageBaseStatementInternal::asyncFinalize() { - nsIEventTarget *target = mDBConnection->getAsyncExecutionTarget(); + nsIEventTarget* target = mDBConnection->getAsyncExecutionTarget(); if (target) { // Attempt to finalize asynchronously nsCOMPtr event = @@ -134,7 +134,7 @@ void StorageBaseStatementInternal::destructorAsyncFinalize() { // If we are the owning thread (currently that means we're also the // main thread), then we can get the async target and just dispatch // to it. - nsIEventTarget *target = mDBConnection->getAsyncExecutionTarget(); + nsIEventTarget* target = mDBConnection->getAsyncExecutionTarget(); if (target) { nsCOMPtr event = new LastDitchSqliteStatementFinalizer(mDBConnection, mAsyncStatement); @@ -156,7 +156,7 @@ void StorageBaseStatementInternal::destructorAsyncFinalize() { NS_IMETHODIMP StorageBaseStatementInternal::NewBindingParamsArray( - mozIStorageBindingParamsArray **_array) { + mozIStorageBindingParamsArray** _array) { nsCOMPtr array = new BindingParamsArray(this); NS_ENSURE_TRUE(array, NS_ERROR_OUT_OF_MEMORY); @@ -166,8 +166,8 @@ StorageBaseStatementInternal::NewBindingParamsArray( NS_IMETHODIMP StorageBaseStatementInternal::ExecuteAsync( - mozIStorageStatementCallback *aCallback, - mozIStoragePendingStatement **_stmt) { + mozIStorageStatementCallback* aCallback, + mozIStoragePendingStatement** _stmt) { // We used to call Connection::ExecuteAsync but it takes a // mozIStorageBaseStatement signature because it is also a public API. Since // our 'this' has no static concept of mozIStorageBaseStatement and Connection @@ -185,9 +185,9 @@ StorageBaseStatementInternal::ExecuteAsync( } NS_IMETHODIMP -StorageBaseStatementInternal::EscapeStringForLIKE(const nsAString &aValue, +StorageBaseStatementInternal::EscapeStringForLIKE(const nsAString& aValue, const char16_t aEscapeChar, - nsAString &_escapedString) { + nsAString& _escapedString) { const char16_t MATCH_ALL('%'); const char16_t MATCH_ONE('_'); diff --git a/storage/StorageBaseStatementInternal.h b/storage/StorageBaseStatementInternal.h index 8c7f880b57388..832e7ee176e06 100644 --- a/storage/StorageBaseStatementInternal.h +++ b/storage/StorageBaseStatementInternal.h @@ -51,7 +51,7 @@ class StorageBaseStatementInternal : public nsISupports { /** * @return the connection that this statement belongs to. */ - Connection *getOwner() { return mDBConnection; } + Connection* getOwner() { return mDBConnection; } /** * Return the asynchronous statement, creating it if required. @@ -65,7 +65,7 @@ class StorageBaseStatementInternal : public nsISupports { * @return The SQLite result code for creating the statement if created, * SQLITE_OK if creation was not required. */ - virtual int getAsyncStatement(sqlite3_stmt **_stmt) = 0; + virtual int getAsyncStatement(sqlite3_stmt** _stmt) = 0; /** * Obtains the StatementData needed for asynchronous execution. @@ -78,7 +78,7 @@ class StorageBaseStatementInternal : public nsISupports { * upon successful execution of this method. * @return NS_OK if we were able to assemble the data, failure otherwise. */ - virtual nsresult getAsynchronousStatementData(StatementData &_data) = 0; + virtual nsresult getAsynchronousStatementData(StatementData& _data) = 0; /** * Construct a new BindingParams to be owned by the provided binding params @@ -91,13 +91,13 @@ class StorageBaseStatementInternal : public nsISupports { * underlying statement type. */ virtual already_AddRefed newBindingParams( - mozIStorageBindingParamsArray *aOwner) = 0; + mozIStorageBindingParamsArray* aOwner) = 0; protected: // mix-in bits are protected StorageBaseStatementInternal(); RefPtr mDBConnection; - sqlite3 *mNativeConnection; + sqlite3* mNativeConnection; /** * Our asynchronous statement. @@ -109,7 +109,7 @@ class StorageBaseStatementInternal : public nsISupports { * async thread when it calls getAsyncStatement the first time the statement * is executed. (Or in the event of badly formed SQL, every time.) */ - sqlite3_stmt *mAsyncStatement; + sqlite3_stmt* mAsyncStatement; /** * Initiate asynchronous finalization by dispatching an event to the @@ -136,11 +136,11 @@ class StorageBaseStatementInternal : public nsISupports { */ void destructorAsyncFinalize(); - NS_IMETHOD NewBindingParamsArray(mozIStorageBindingParamsArray **_array); - NS_IMETHOD ExecuteAsync(mozIStorageStatementCallback *aCallback, - mozIStoragePendingStatement **_stmt); - NS_IMETHOD EscapeStringForLIKE(const nsAString &aValue, char16_t aEscapeChar, - nsAString &_escapedString); + NS_IMETHOD NewBindingParamsArray(mozIStorageBindingParamsArray** _array); + NS_IMETHOD ExecuteAsync(mozIStorageStatementCallback* aCallback, + mozIStoragePendingStatement** _stmt); + NS_IMETHOD EscapeStringForLIKE(const nsAString& aValue, char16_t aEscapeChar, + nsAString& _escapedString); // Needs access to internalAsyncFinalize friend class AsyncStatementFinalizer; @@ -150,12 +150,12 @@ NS_DEFINE_STATIC_IID_ACCESSOR(StorageBaseStatementInternal, STORAGEBASESTATEMENTINTERNAL_IID) #define NS_DECL_STORAGEBASESTATEMENTINTERNAL \ - virtual Connection *getOwner(); \ - virtual int getAsyncStatement(sqlite3_stmt **_stmt) override; \ - virtual nsresult getAsynchronousStatementData(StatementData &_data) \ + virtual Connection* getOwner(); \ + virtual int getAsyncStatement(sqlite3_stmt** _stmt) override; \ + virtual nsresult getAsynchronousStatementData(StatementData& _data) \ override; \ virtual already_AddRefed newBindingParams( \ - mozIStorageBindingParamsArray *aOwner) override; + mozIStorageBindingParamsArray* aOwner) override; /** * Helper macro to implement the proxying implementations. Because we are @@ -181,8 +181,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(StorageBaseStatementInternal, mozIStoragePendingStatement * *_stmt), \ (aCallback, _stmt)) \ MIX_IMPL(_class, _optionalGuard, EscapeStringForLIKE, \ - (const nsAString &aValue, char16_t aEscapeChar, \ - nsAString &_escapedString), \ + (const nsAString& aValue, char16_t aEscapeChar, \ + nsAString& _escapedString), \ (aValue, aEscapeChar, _escapedString)) /** @@ -213,12 +213,12 @@ NS_DEFINE_STATIC_IID_ACCESSOR(StorageBaseStatementInternal, */ #define BIND_GEN_IMPL(_class, _guard, _name, _declName, _declIndex, _invArgs) \ NS_IMETHODIMP _class::BIND_NAME_CONCAT(_name, ByName) _declName { \ - _guard mozIStorageBindingParams *params = getParams(); \ + _guard mozIStorageBindingParams* params = getParams(); \ NS_ENSURE_TRUE(params, NS_ERROR_OUT_OF_MEMORY); \ return params->BIND_NAME_CONCAT(_name, ByName) _invArgs; \ } \ NS_IMETHODIMP _class::BIND_NAME_CONCAT(_name, ByIndex) _declIndex { \ - _guard mozIStorageBindingParams *params = getParams(); \ + _guard mozIStorageBindingParams* params = getParams(); \ NS_ENSURE_TRUE(params, NS_ERROR_OUT_OF_MEMORY); \ return params->BIND_NAME_CONCAT(_name, ByIndex) _invArgs; \ } @@ -230,14 +230,14 @@ NS_DEFINE_STATIC_IID_ACCESSOR(StorageBaseStatementInternal, * @param _optionalGuard The guard clause to inject. */ #define BIND_BASE_IMPLS(_class, _optionalGuard) \ - NS_IMETHODIMP _class::BindByName(const nsACString &aName, \ - nsIVariant *aValue) { \ - _optionalGuard mozIStorageBindingParams *params = getParams(); \ + NS_IMETHODIMP _class::BindByName(const nsACString& aName, \ + nsIVariant* aValue) { \ + _optionalGuard mozIStorageBindingParams* params = getParams(); \ NS_ENSURE_TRUE(params, NS_ERROR_OUT_OF_MEMORY); \ return params->BindByName(aName, aValue); \ } \ - NS_IMETHODIMP _class::BindByIndex(uint32_t aIndex, nsIVariant *aValue) { \ - _optionalGuard mozIStorageBindingParams *params = getParams(); \ + NS_IMETHODIMP _class::BindByIndex(uint32_t aIndex, nsIVariant* aValue) { \ + _optionalGuard mozIStorageBindingParams* params = getParams(); \ NS_ENSURE_TRUE(params, NS_ERROR_OUT_OF_MEMORY); \ return params->BindByIndex(aIndex, aValue); \ } @@ -249,36 +249,36 @@ NS_DEFINE_STATIC_IID_ACCESSOR(StorageBaseStatementInternal, #define BOILERPLATE_BIND_PROXIES(_class, _optionalGuard) \ BIND_BASE_IMPLS(_class, _optionalGuard) \ BIND_GEN_IMPL(_class, _optionalGuard, UTF8String, \ - (const nsACString &aWhere, const nsACString &aValue), \ - (uint32_t aWhere, const nsACString &aValue), (aWhere, aValue)) \ + (const nsACString& aWhere, const nsACString& aValue), \ + (uint32_t aWhere, const nsACString& aValue), (aWhere, aValue)) \ BIND_GEN_IMPL(_class, _optionalGuard, String, \ - (const nsACString &aWhere, const nsAString &aValue), \ - (uint32_t aWhere, const nsAString &aValue), (aWhere, aValue)) \ + (const nsACString& aWhere, const nsAString& aValue), \ + (uint32_t aWhere, const nsAString& aValue), (aWhere, aValue)) \ BIND_GEN_IMPL(_class, _optionalGuard, Double, \ - (const nsACString &aWhere, double aValue), \ + (const nsACString& aWhere, double aValue), \ (uint32_t aWhere, double aValue), (aWhere, aValue)) \ BIND_GEN_IMPL(_class, _optionalGuard, Int32, \ - (const nsACString &aWhere, int32_t aValue), \ + (const nsACString& aWhere, int32_t aValue), \ (uint32_t aWhere, int32_t aValue), (aWhere, aValue)) \ BIND_GEN_IMPL(_class, _optionalGuard, Int64, \ - (const nsACString &aWhere, int64_t aValue), \ + (const nsACString& aWhere, int64_t aValue), \ (uint32_t aWhere, int64_t aValue), (aWhere, aValue)) \ - BIND_GEN_IMPL(_class, _optionalGuard, Null, (const nsACString &aWhere), \ + BIND_GEN_IMPL(_class, _optionalGuard, Null, (const nsACString& aWhere), \ (uint32_t aWhere), (aWhere)) \ BIND_GEN_IMPL( \ _class, _optionalGuard, Blob, \ - (const nsACString &aWhere, const uint8_t *aValue, uint32_t aValueSize), \ - (uint32_t aWhere, const uint8_t *aValue, uint32_t aValueSize), \ + (const nsACString& aWhere, const uint8_t* aValue, uint32_t aValueSize), \ + (uint32_t aWhere, const uint8_t* aValue, uint32_t aValueSize), \ (aWhere, aValue, aValueSize)) \ BIND_GEN_IMPL(_class, _optionalGuard, StringAsBlob, \ - (const nsACString &aWhere, const nsAString &aValue), \ - (uint32_t aWhere, const nsAString &aValue), (aWhere, aValue)) \ + (const nsACString& aWhere, const nsAString& aValue), \ + (uint32_t aWhere, const nsAString& aValue), (aWhere, aValue)) \ BIND_GEN_IMPL(_class, _optionalGuard, UTF8StringAsBlob, \ - (const nsACString &aWhere, const nsACString &aValue), \ - (uint32_t aWhere, const nsACString &aValue), (aWhere, aValue)) \ + (const nsACString& aWhere, const nsACString& aValue), \ + (uint32_t aWhere, const nsACString& aValue), (aWhere, aValue)) \ BIND_GEN_IMPL( \ _class, _optionalGuard, AdoptedBlob, \ - (const nsACString &aWhere, uint8_t *aValue, uint32_t aValueSize), \ + (const nsACString& aWhere, uint8_t* aValue, uint32_t aValueSize), \ (uint32_t aWhere, uint8_t * aValue, uint32_t aValueSize), \ (aWhere, aValue, aValueSize)) diff --git a/storage/TelemetryVFS.cpp b/storage/TelemetryVFS.cpp index d0e64ee44f3cf..5ab6dc13ef873 100644 --- a/storage/TelemetryVFS.cpp +++ b/storage/TelemetryVFS.cpp @@ -45,7 +45,7 @@ using namespace mozilla::dom::quota; using namespace mozilla::net; struct Histograms { - const char *name; + const char* name; const Telemetry::HistogramID readB; const Telemetry::HistogramID writeB; const Telemetry::HistogramID readMS; @@ -125,8 +125,8 @@ class IOThreadAutoTimer { // of the data captured here. #if defined(MOZ_GECKO_PROFILER) && !defined(XP_WIN) if (IOInterposer::IsObservedOperation(op)) { - const char *main_ref = "sqlite-mainthread"; - const char *other_ref = "sqlite-otherthread"; + const char* main_ref = "sqlite-mainthread"; + const char* other_ref = "sqlite-otherthread"; // Create observation IOInterposeObserver::Observation ob(op, start, end, @@ -150,7 +150,7 @@ struct telemetry_file { sqlite3_file base; // histograms pertaining to this file - Histograms *histograms; + Histograms* histograms; // quota object for this file RefPtr quotaObject; @@ -160,13 +160,13 @@ struct telemetry_file { int fileChunkSize; // The filename - char *location; + char* location; // This contains the vfs that actually does work sqlite3_file pReal[1]; }; -const char *DatabasePathFromWALPath(const char *zWALName) { +const char* DatabasePathFromWALPath(const char* zWALName) { /** * Do some sketchy pointer arithmetic to find the parameter key. The WAL * filename is in the middle of a big allocated block that contains: @@ -201,7 +201,7 @@ const char *DatabasePathFromWALPath(const char *zWALName) { // We want to scan to the end of the key/value URI pairs. Skip the preceding // null and go to the last char of the journal path. - const char *cursor = zWALName - 2; + const char* cursor = zWALName - 2; // Make sure we just skipped a null. MOZ_ASSERT(!*(cursor + 1)); @@ -223,7 +223,7 @@ const char *DatabasePathFromWALPath(const char *zWALName) { { // Verify that we just walked over the journal path. Account for the two // nulls we just skipped. - const char *journalStart = cursor + 3; + const char* journalStart = cursor + 3; nsDependentCSubstring journalPath(journalStart, strlen(journalStart)); @@ -244,8 +244,8 @@ const char *DatabasePathFromWALPath(const char *zWALName) { // end of the database path. Carefully walk backwards one character at a // time to do this safely without running past the beginning of the database // path. - const char *const dbPathStart = dbPath.BeginReading(); - const char *dbPathCursor = dbPath.EndReading() - 1; + const char* const dbPathStart = dbPath.BeginReading(); + const char* dbPathCursor = dbPath.EndReading() - 1; bool isDBPath = true; while (true) { @@ -294,23 +294,23 @@ const char *DatabasePathFromWALPath(const char *zWALName) { } already_AddRefed GetQuotaObjectFromNameAndParameters( - const char *zName, const char *zURIParameterKey) { + const char* zName, const char* zURIParameterKey) { MOZ_ASSERT(zName); MOZ_ASSERT(zURIParameterKey); - const char *persistenceType = + const char* persistenceType = sqlite3_uri_parameter(zURIParameterKey, "persistenceType"); if (!persistenceType) { return nullptr; } - const char *group = sqlite3_uri_parameter(zURIParameterKey, "group"); + const char* group = sqlite3_uri_parameter(zURIParameterKey, "group"); if (!group) { NS_WARNING("SQLite URI had 'persistenceType' but not 'group'?!"); return nullptr; } - const char *origin = sqlite3_uri_parameter(zURIParameterKey, "origin"); + const char* origin = sqlite3_uri_parameter(zURIParameterKey, "origin"); if (!origin) { NS_WARNING( "SQLite URI had 'persistenceType' and 'group' but not " @@ -318,7 +318,7 @@ already_AddRefed GetQuotaObjectFromNameAndParameters( return nullptr; } - QuotaManager *quotaManager = QuotaManager::Get(); + QuotaManager* quotaManager = QuotaManager::Get(); MOZ_ASSERT(quotaManager); return quotaManager->GetQuotaObject( @@ -327,7 +327,7 @@ already_AddRefed GetQuotaObjectFromNameAndParameters( NS_ConvertUTF8toUTF16(zName)); } -void MaybeEstablishQuotaControl(const char *zName, telemetry_file *pFile, +void MaybeEstablishQuotaControl(const char* zName, telemetry_file* pFile, int flags) { MOZ_ASSERT(pFile); MOZ_ASSERT(!pFile->quotaObject); @@ -338,7 +338,7 @@ void MaybeEstablishQuotaControl(const char *zName, telemetry_file *pFile, MOZ_ASSERT(zName); - const char *zURIParameterKey = + const char* zURIParameterKey = (flags & SQLITE_OPEN_WAL) ? DatabasePathFromWALPath(zName) : zName; MOZ_ASSERT(zURIParameterKey); @@ -350,8 +350,8 @@ void MaybeEstablishQuotaControl(const char *zName, telemetry_file *pFile, /* ** Close a telemetry_file. */ -int xClose(sqlite3_file *pFile) { - telemetry_file *p = (telemetry_file *)pFile; +int xClose(sqlite3_file* pFile) { + telemetry_file* p = (telemetry_file*)pFile; int rc; { // Scope for IOThreadAutoTimer IOThreadAutoTimer ioTimer(IOInterposeObserver::OpClose); @@ -372,8 +372,8 @@ int xClose(sqlite3_file *pFile) { /* ** Read data from a telemetry_file. */ -int xRead(sqlite3_file *pFile, void *zBuf, int iAmt, sqlite_int64 iOfst) { - telemetry_file *p = (telemetry_file *)pFile; +int xRead(sqlite3_file* pFile, void* zBuf, int iAmt, sqlite_int64 iOfst) { + telemetry_file* p = (telemetry_file*)pFile; IOThreadAutoTimer ioTimer(p->histograms->readMS, IOInterposeObserver::OpRead); int rc; rc = p->pReal->pMethods->xRead(p->pReal, zBuf, iAmt, iOfst); @@ -389,9 +389,9 @@ int xRead(sqlite3_file *pFile, void *zBuf, int iAmt, sqlite_int64 iOfst) { /* ** Return the current file-size of a telemetry_file. */ -int xFileSize(sqlite3_file *pFile, sqlite_int64 *pSize) { +int xFileSize(sqlite3_file* pFile, sqlite_int64* pSize) { IOThreadAutoTimer ioTimer(IOInterposeObserver::OpStat); - telemetry_file *p = (telemetry_file *)pFile; + telemetry_file* p = (telemetry_file*)pFile; int rc; rc = p->pReal->pMethods->xFileSize(p->pReal, pSize); return rc; @@ -400,9 +400,9 @@ int xFileSize(sqlite3_file *pFile, sqlite_int64 *pSize) { /* ** Write data to a telemetry_file. */ -int xWrite(sqlite3_file *pFile, const void *zBuf, int iAmt, +int xWrite(sqlite3_file* pFile, const void* zBuf, int iAmt, sqlite_int64 iOfst) { - telemetry_file *p = (telemetry_file *)pFile; + telemetry_file* p = (telemetry_file*)pFile; IOThreadAutoTimer ioTimer(p->histograms->writeMS, IOInterposeObserver::OpWrite); int rc; @@ -433,9 +433,9 @@ int xWrite(sqlite3_file *pFile, const void *zBuf, int iAmt, /* ** Truncate a telemetry_file. */ -int xTruncate(sqlite3_file *pFile, sqlite_int64 size) { +int xTruncate(sqlite3_file* pFile, sqlite_int64 size) { IOThreadAutoTimer ioTimer(Telemetry::MOZ_SQLITE_TRUNCATE_MS); - telemetry_file *p = (telemetry_file *)pFile; + telemetry_file* p = (telemetry_file*)pFile; int rc; Telemetry::AutoTimer timer; if (p->quotaObject) { @@ -473,8 +473,8 @@ int xTruncate(sqlite3_file *pFile, sqlite_int64 size) { /* ** Sync a telemetry_file. */ -int xSync(sqlite3_file *pFile, int flags) { - telemetry_file *p = (telemetry_file *)pFile; +int xSync(sqlite3_file* pFile, int flags) { + telemetry_file* p = (telemetry_file*)pFile; IOThreadAutoTimer ioTimer(p->histograms->syncMS, IOInterposeObserver::OpFSync); return p->pReal->pMethods->xSync(p->pReal, flags); @@ -483,8 +483,8 @@ int xSync(sqlite3_file *pFile, int flags) { /* ** Lock a telemetry_file. */ -int xLock(sqlite3_file *pFile, int eLock) { - telemetry_file *p = (telemetry_file *)pFile; +int xLock(sqlite3_file* pFile, int eLock) { + telemetry_file* p = (telemetry_file*)pFile; int rc; rc = p->pReal->pMethods->xLock(p->pReal, eLock); return rc; @@ -493,8 +493,8 @@ int xLock(sqlite3_file *pFile, int eLock) { /* ** Unlock a telemetry_file. */ -int xUnlock(sqlite3_file *pFile, int eLock) { - telemetry_file *p = (telemetry_file *)pFile; +int xUnlock(sqlite3_file* pFile, int eLock) { + telemetry_file* p = (telemetry_file*)pFile; int rc; rc = p->pReal->pMethods->xUnlock(p->pReal, eLock); return rc; @@ -503,8 +503,8 @@ int xUnlock(sqlite3_file *pFile, int eLock) { /* ** Check if another file-handle holds a RESERVED lock on a telemetry_file. */ -int xCheckReservedLock(sqlite3_file *pFile, int *pResOut) { - telemetry_file *p = (telemetry_file *)pFile; +int xCheckReservedLock(sqlite3_file* pFile, int* pResOut) { + telemetry_file* p = (telemetry_file*)pFile; int rc = p->pReal->pMethods->xCheckReservedLock(p->pReal, pResOut); return rc; } @@ -512,13 +512,13 @@ int xCheckReservedLock(sqlite3_file *pFile, int *pResOut) { /* ** File control method. For custom operations on a telemetry_file. */ -int xFileControl(sqlite3_file *pFile, int op, void *pArg) { - telemetry_file *p = (telemetry_file *)pFile; +int xFileControl(sqlite3_file* pFile, int op, void* pArg) { + telemetry_file* p = (telemetry_file*)pFile; int rc; // Hook SQLITE_FCNTL_SIZE_HINT for quota-controlled files and do the necessary // work before passing to the SQLite VFS. if (op == SQLITE_FCNTL_SIZE_HINT && p->quotaObject) { - sqlite3_int64 hintSize = *static_cast(pArg); + sqlite3_int64 hintSize = *static_cast(pArg); sqlite3_int64 currentSize; rc = xFileSize(pFile, ¤tSize); if (rc != SQLITE_OK) { @@ -534,11 +534,11 @@ int xFileControl(sqlite3_file *pFile, int op, void *pArg) { rc = p->pReal->pMethods->xFileControl(p->pReal, op, pArg); // Grab the file chunk size after the SQLite VFS has approved. if (op == SQLITE_FCNTL_CHUNK_SIZE && rc == SQLITE_OK) { - p->fileChunkSize = *static_cast(pArg); + p->fileChunkSize = *static_cast(pArg); } #ifdef DEBUG if (op == SQLITE_FCNTL_SIZE_HINT && p->quotaObject && rc == SQLITE_OK) { - sqlite3_int64 hintSize = *static_cast(pArg); + sqlite3_int64 hintSize = *static_cast(pArg); if (p->fileChunkSize > 0) { hintSize = ((hintSize + p->fileChunkSize - 1) / p->fileChunkSize) * p->fileChunkSize; @@ -554,8 +554,8 @@ int xFileControl(sqlite3_file *pFile, int op, void *pArg) { /* ** Return the sector-size in bytes for a telemetry_file. */ -int xSectorSize(sqlite3_file *pFile) { - telemetry_file *p = (telemetry_file *)pFile; +int xSectorSize(sqlite3_file* pFile) { + telemetry_file* p = (telemetry_file*)pFile; int rc; rc = p->pReal->pMethods->xSectorSize(p->pReal); return rc; @@ -564,8 +564,8 @@ int xSectorSize(sqlite3_file *pFile) { /* ** Return the device characteristic flags supported by a telemetry_file. */ -int xDeviceCharacteristics(sqlite3_file *pFile) { - telemetry_file *p = (telemetry_file *)pFile; +int xDeviceCharacteristics(sqlite3_file* pFile) { + telemetry_file* p = (telemetry_file*)pFile; int rc; rc = p->pReal->pMethods->xDeviceCharacteristics(p->pReal); return rc; @@ -574,59 +574,59 @@ int xDeviceCharacteristics(sqlite3_file *pFile) { /* ** Shared-memory operations. */ -int xShmLock(sqlite3_file *pFile, int ofst, int n, int flags) { - telemetry_file *p = (telemetry_file *)pFile; +int xShmLock(sqlite3_file* pFile, int ofst, int n, int flags) { + telemetry_file* p = (telemetry_file*)pFile; return p->pReal->pMethods->xShmLock(p->pReal, ofst, n, flags); } -int xShmMap(sqlite3_file *pFile, int iRegion, int szRegion, int isWrite, - void volatile **pp) { - telemetry_file *p = (telemetry_file *)pFile; +int xShmMap(sqlite3_file* pFile, int iRegion, int szRegion, int isWrite, + void volatile** pp) { + telemetry_file* p = (telemetry_file*)pFile; int rc; rc = p->pReal->pMethods->xShmMap(p->pReal, iRegion, szRegion, isWrite, pp); return rc; } -void xShmBarrier(sqlite3_file *pFile) { - telemetry_file *p = (telemetry_file *)pFile; +void xShmBarrier(sqlite3_file* pFile) { + telemetry_file* p = (telemetry_file*)pFile; p->pReal->pMethods->xShmBarrier(p->pReal); } -int xShmUnmap(sqlite3_file *pFile, int delFlag) { - telemetry_file *p = (telemetry_file *)pFile; +int xShmUnmap(sqlite3_file* pFile, int delFlag) { + telemetry_file* p = (telemetry_file*)pFile; int rc; rc = p->pReal->pMethods->xShmUnmap(p->pReal, delFlag); return rc; } -int xFetch(sqlite3_file *pFile, sqlite3_int64 iOff, int iAmt, void **pp) { - telemetry_file *p = (telemetry_file *)pFile; +int xFetch(sqlite3_file* pFile, sqlite3_int64 iOff, int iAmt, void** pp) { + telemetry_file* p = (telemetry_file*)pFile; MOZ_ASSERT(p->pReal->pMethods->iVersion >= 3); return p->pReal->pMethods->xFetch(p->pReal, iOff, iAmt, pp); } -int xUnfetch(sqlite3_file *pFile, sqlite3_int64 iOff, void *pResOut) { - telemetry_file *p = (telemetry_file *)pFile; +int xUnfetch(sqlite3_file* pFile, sqlite3_int64 iOff, void* pResOut) { + telemetry_file* p = (telemetry_file*)pFile; MOZ_ASSERT(p->pReal->pMethods->iVersion >= 3); return p->pReal->pMethods->xUnfetch(p->pReal, iOff, pResOut); } -int xOpen(sqlite3_vfs *vfs, const char *zName, sqlite3_file *pFile, int flags, - int *pOutFlags) { +int xOpen(sqlite3_vfs* vfs, const char* zName, sqlite3_file* pFile, int flags, + int* pOutFlags) { IOThreadAutoTimer ioTimer(Telemetry::MOZ_SQLITE_OPEN_MS, IOInterposeObserver::OpCreateOrOpen); Telemetry::AutoTimer timer; - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); int rc; - telemetry_file *p = (telemetry_file *)pFile; - Histograms *h = nullptr; + telemetry_file* p = (telemetry_file*)pFile; + Histograms* h = nullptr; // check if the filename is one we are probing for for (size_t i = 0; i < sizeof(gHistograms) / sizeof(gHistograms[0]); i++) { h = &gHistograms[i]; // last probe is the fallback probe if (!h->name) break; if (!zName) continue; - const char *match = strstr(zName, h->name); + const char* match = strstr(zName, h->name); if (!match) continue; char c = match[strlen(h->name)]; // include -wal/-journal too @@ -649,8 +649,8 @@ int xOpen(sqlite3_vfs *vfs, const char *zName, sqlite3_file *pFile, int flags, } if (p->pReal->pMethods) { - sqlite3_io_methods *pNew = new sqlite3_io_methods; - const sqlite3_io_methods *pSub = p->pReal->pMethods; + sqlite3_io_methods* pNew = new sqlite3_io_methods; + const sqlite3_io_methods* pSub = p->pReal->pMethods; memset(pNew, 0, sizeof(*pNew)); // If the io_methods version is higher than the last known one, you should // update this VFS adding appropriate IO methods for any methods added in @@ -691,13 +691,13 @@ int xOpen(sqlite3_vfs *vfs, const char *zName, sqlite3_file *pFile, int flags, return rc; } -int xDelete(sqlite3_vfs *vfs, const char *zName, int syncDir) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +int xDelete(sqlite3_vfs* vfs, const char* zName, int syncDir) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); int rc; RefPtr quotaObject; if (StringEndsWith(nsDependentCString(zName), NS_LITERAL_CSTRING("-wal"))) { - const char *zURIParameterKey = DatabasePathFromWALPath(zName); + const char* zURIParameterKey = DatabasePathFromWALPath(zName); MOZ_ASSERT(zURIParameterKey); quotaObject = GetQuotaObjectFromNameAndParameters(zName, zURIParameterKey); @@ -711,74 +711,74 @@ int xDelete(sqlite3_vfs *vfs, const char *zName, int syncDir) { return rc; } -int xAccess(sqlite3_vfs *vfs, const char *zName, int flags, int *pResOut) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +int xAccess(sqlite3_vfs* vfs, const char* zName, int flags, int* pResOut) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xAccess(orig_vfs, zName, flags, pResOut); } -int xFullPathname(sqlite3_vfs *vfs, const char *zName, int nOut, char *zOut) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +int xFullPathname(sqlite3_vfs* vfs, const char* zName, int nOut, char* zOut) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xFullPathname(orig_vfs, zName, nOut, zOut); } -void *xDlOpen(sqlite3_vfs *vfs, const char *zFilename) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +void* xDlOpen(sqlite3_vfs* vfs, const char* zFilename) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xDlOpen(orig_vfs, zFilename); } -void xDlError(sqlite3_vfs *vfs, int nByte, char *zErrMsg) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +void xDlError(sqlite3_vfs* vfs, int nByte, char* zErrMsg) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); orig_vfs->xDlError(orig_vfs, nByte, zErrMsg); } -void (*xDlSym(sqlite3_vfs *vfs, void *pHdle, const char *zSym))(void) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +void (*xDlSym(sqlite3_vfs* vfs, void* pHdle, const char* zSym))(void) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xDlSym(orig_vfs, pHdle, zSym); } -void xDlClose(sqlite3_vfs *vfs, void *pHandle) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +void xDlClose(sqlite3_vfs* vfs, void* pHandle) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); orig_vfs->xDlClose(orig_vfs, pHandle); } -int xRandomness(sqlite3_vfs *vfs, int nByte, char *zOut) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +int xRandomness(sqlite3_vfs* vfs, int nByte, char* zOut) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xRandomness(orig_vfs, nByte, zOut); } -int xSleep(sqlite3_vfs *vfs, int microseconds) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +int xSleep(sqlite3_vfs* vfs, int microseconds) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xSleep(orig_vfs, microseconds); } -int xCurrentTime(sqlite3_vfs *vfs, double *prNow) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +int xCurrentTime(sqlite3_vfs* vfs, double* prNow) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xCurrentTime(orig_vfs, prNow); } -int xGetLastError(sqlite3_vfs *vfs, int nBuf, char *zBuf) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +int xGetLastError(sqlite3_vfs* vfs, int nBuf, char* zBuf) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xGetLastError(orig_vfs, nBuf, zBuf); } -int xCurrentTimeInt64(sqlite3_vfs *vfs, sqlite3_int64 *piNow) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +int xCurrentTimeInt64(sqlite3_vfs* vfs, sqlite3_int64* piNow) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xCurrentTimeInt64(orig_vfs, piNow); } -static int xSetSystemCall(sqlite3_vfs *vfs, const char *zName, +static int xSetSystemCall(sqlite3_vfs* vfs, const char* zName, sqlite3_syscall_ptr pFunc) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xSetSystemCall(orig_vfs, zName, pFunc); } -static sqlite3_syscall_ptr xGetSystemCall(sqlite3_vfs *vfs, const char *zName) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +static sqlite3_syscall_ptr xGetSystemCall(sqlite3_vfs* vfs, const char* zName) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xGetSystemCall(orig_vfs, zName); } -static const char *xNextSystemCall(sqlite3_vfs *vfs, const char *zName) { - sqlite3_vfs *orig_vfs = static_cast(vfs->pAppData); +static const char* xNextSystemCall(sqlite3_vfs* vfs, const char* zName) { + sqlite3_vfs* orig_vfs = static_cast(vfs->pAppData); return orig_vfs->xNextSystemCall(orig_vfs, zName); } @@ -787,9 +787,9 @@ static const char *xNextSystemCall(sqlite3_vfs *vfs, const char *zName) { namespace mozilla { namespace storage { -const char *GetVFSName() { return "telemetry-vfs"; } +const char* GetVFSName() { return "telemetry-vfs"; } -sqlite3_vfs *ConstructTelemetryVFS() { +sqlite3_vfs* ConstructTelemetryVFS() { #if defined(XP_WIN) # define EXPECTED_VFS "win32" # define EXPECTED_VFS_EXCL "win32" @@ -799,7 +799,7 @@ sqlite3_vfs *ConstructTelemetryVFS() { #endif bool expected_vfs; - sqlite3_vfs *vfs; + sqlite3_vfs* vfs; if (Preferences::GetBool(PREF_MULTI_PROCESS_ACCESS, false)) { // Use the non-exclusive VFS. vfs = sqlite3_vfs_find(nullptr); @@ -812,7 +812,7 @@ sqlite3_vfs *ConstructTelemetryVFS() { return nullptr; } - sqlite3_vfs *tvfs = new ::sqlite3_vfs; + sqlite3_vfs* tvfs = new ::sqlite3_vfs; memset(tvfs, 0, sizeof(::sqlite3_vfs)); // If the VFS version is higher than the last known one, you should update // this VFS adding appropriate methods for any methods added in the version @@ -849,10 +849,10 @@ sqlite3_vfs *ConstructTelemetryVFS() { return tvfs; } -already_AddRefed GetQuotaObjectForFile(sqlite3_file *pFile) { +already_AddRefed GetQuotaObjectForFile(sqlite3_file* pFile) { MOZ_ASSERT(pFile); - telemetry_file *p = (telemetry_file *)pFile; + telemetry_file* p = (telemetry_file*)pFile; RefPtr result = p->quotaObject; return result.forget(); } diff --git a/storage/VacuumManager.cpp b/storage/VacuumManager.cpp index 642bc51f64b03..d184a08add777 100644 --- a/storage/VacuumManager.cpp +++ b/storage/VacuumManager.cpp @@ -60,7 +60,7 @@ class BaseCallback : public mozIStorageStatementCallback { }; NS_IMETHODIMP -BaseCallback::HandleError(mozIStorageError *aError) { +BaseCallback::HandleError(mozIStorageError* aError) { #ifdef DEBUG int32_t result; nsresult rv = aError->GetResult(&result); @@ -80,7 +80,7 @@ BaseCallback::HandleError(mozIStorageError *aError) { } NS_IMETHODIMP -BaseCallback::HandleResult(mozIStorageResultSet *aResultSet) { +BaseCallback::HandleResult(mozIStorageResultSet* aResultSet) { // We could get results from PRAGMA statements, but we don't mind them. return NS_OK; } @@ -100,7 +100,7 @@ class Vacuumer : public BaseCallback { public: NS_DECL_MOZISTORAGESTATEMENTCALLBACK - explicit Vacuumer(mozIStorageVacuumParticipant *aParticipant); + explicit Vacuumer(mozIStorageVacuumParticipant* aParticipant); bool execute(); nsresult notifyCompletion(bool aSucceeded); @@ -114,7 +114,7 @@ class Vacuumer : public BaseCallback { //////////////////////////////////////////////////////////////////////////////// //// Vacuumer implementation. -Vacuumer::Vacuumer(mozIStorageVacuumParticipant *aParticipant) +Vacuumer::Vacuumer(mozIStorageVacuumParticipant* aParticipant) : mParticipant(aParticipant) {} bool Vacuumer::execute() { @@ -211,7 +211,7 @@ bool Vacuumer::execute() { //// mozIStorageStatementCallback NS_IMETHODIMP -Vacuumer::HandleError(mozIStorageError *aError) { +Vacuumer::HandleError(mozIStorageError* aError) { int32_t result; nsresult rv; nsAutoCString message; @@ -245,7 +245,7 @@ Vacuumer::HandleError(mozIStorageError *aError) { } NS_IMETHODIMP -Vacuumer::HandleResult(mozIStorageResultSet *aResultSet) { +Vacuumer::HandleResult(mozIStorageResultSet* aResultSet) { MOZ_ASSERT_UNREACHABLE("Got a resultset from a vacuum?"); return NS_OK; } @@ -287,7 +287,7 @@ nsresult Vacuumer::notifyCompletion(bool aSucceeded) { NS_IMPL_ISUPPORTS(VacuumManager, nsIObserver) -VacuumManager *VacuumManager::gVacuumManager = nullptr; +VacuumManager* VacuumManager::gVacuumManager = nullptr; already_AddRefed VacuumManager::getSingleton() { // Don't allocate it in the child Process. @@ -323,8 +323,8 @@ VacuumManager::~VacuumManager() { //// nsIObserver NS_IMETHODIMP -VacuumManager::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +VacuumManager::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { if (strcmp(aTopic, OBSERVER_TOPIC_IDLE_DAILY) == 0) { // Try to run vacuum on all registered entries. Will stop at the first // successful one. @@ -332,7 +332,7 @@ VacuumManager::Observe(nsISupports *aSubject, const char *aTopic, mParticipants.GetEntries(entries); // If there are more entries than what a month can contain, we could end up // skipping some, since we run daily. So we use a starting index. - static const char *kPrefName = PREF_VACUUM_BRANCH "index"; + static const char* kPrefName = PREF_VACUUM_BRANCH "index"; int32_t startIndex = Preferences::GetInt(kPrefName, 0); if (startIndex >= entries.Count()) { startIndex = 0; diff --git a/storage/VacuumManager.h b/storage/VacuumManager.h index 5bd0ec45b99e3..4f3ef44858bd1 100644 --- a/storage/VacuumManager.h +++ b/storage/VacuumManager.h @@ -32,7 +32,7 @@ class VacuumManager final : public nsIObserver { private: ~VacuumManager(); - static VacuumManager *gVacuumManager; + static VacuumManager* gVacuumManager; // Cache of components registered in "vacuum-participant" category. nsCategoryCache mParticipants; diff --git a/storage/Variant.h b/storage/Variant.h index e9a0a85746a7a..122efe7154a88 100644 --- a/storage/Variant.h +++ b/storage/Variant.h @@ -75,11 +75,11 @@ struct variant_storage_traits { typedef DataType ConstructorType; typedef DataType StorageType; static inline void storage_conversion(const ConstructorType aData, - StorageType *_storage) { + StorageType* _storage) { *_storage = aData; } - static inline void destroy(const StorageType &_storage) {} + static inline void destroy(const StorageType& _storage) {} }; #define NO_CONVERSION return NS_ERROR_CANNOT_CONVERT_DATA; @@ -88,38 +88,32 @@ template struct variant_boolean_traits { typedef typename variant_storage_traits::StorageType StorageType; - static inline nsresult asBool(const StorageType &, bool *) { NO_CONVERSION } + static inline nsresult asBool(const StorageType&, bool*) { NO_CONVERSION } }; template struct variant_integer_traits { typedef typename variant_storage_traits::StorageType StorageType; - static inline nsresult asInt32(const StorageType &, int32_t *) { - NO_CONVERSION - } - static inline nsresult asInt64(const StorageType &, int64_t *) { - NO_CONVERSION - } + static inline nsresult asInt32(const StorageType&, int32_t*) { NO_CONVERSION } + static inline nsresult asInt64(const StorageType&, int64_t*) { NO_CONVERSION } }; template struct variant_float_traits { typedef typename variant_storage_traits::StorageType StorageType; - static inline nsresult asDouble(const StorageType &, double *) { - NO_CONVERSION - } + static inline nsresult asDouble(const StorageType&, double*) { NO_CONVERSION } }; template struct variant_text_traits { typedef typename variant_storage_traits::StorageType StorageType; - static inline nsresult asUTF8String(const StorageType &, nsACString &) { + static inline nsresult asUTF8String(const StorageType&, nsACString&) { NO_CONVERSION } - static inline nsresult asString(const StorageType &, nsAString &) { + static inline nsresult asString(const StorageType&, nsAString&) { NO_CONVERSION } }; @@ -128,8 +122,8 @@ template struct variant_blob_traits { typedef typename variant_storage_traits::StorageType StorageType; - static inline nsresult asArray(const StorageType &, uint16_t *, uint32_t *, - void **) { + static inline nsresult asArray(const StorageType&, uint16_t*, uint32_t*, + void**) { NO_CONVERSION } }; @@ -146,7 +140,7 @@ struct variant_traits { }; template <> struct variant_boolean_traits { - static inline nsresult asBool(bool aValue, bool *_result) { + static inline nsresult asBool(bool aValue, bool* _result) { *_result = aValue; return NS_OK; } @@ -170,14 +164,14 @@ struct variant_traits { }; template <> struct variant_integer_traits { - static inline nsresult asInt32(int64_t aValue, int32_t *_result) { + static inline nsresult asInt32(int64_t aValue, int32_t* _result) { if (aValue > INT32_MAX || aValue < INT32_MIN) return NS_ERROR_CANNOT_CONVERT_DATA; *_result = static_cast(aValue); return NS_OK; } - static inline nsresult asInt64(int64_t aValue, int64_t *_result) { + static inline nsresult asInt64(int64_t aValue, int64_t* _result) { *_result = aValue; return NS_OK; } @@ -185,7 +179,7 @@ struct variant_integer_traits { // xpcvariant just calls get double for integers... template <> struct variant_float_traits { - static inline nsresult asDouble(int64_t aValue, double *_result) { + static inline nsresult asDouble(int64_t aValue, double* _result) { *_result = double(aValue); return NS_OK; } @@ -201,7 +195,7 @@ struct variant_traits { }; template <> struct variant_float_traits { - static inline nsresult asDouble(double aValue, double *_result) { + static inline nsresult asDouble(double aValue, double* _result) { *_result = aValue; return NS_OK; } @@ -217,22 +211,22 @@ struct variant_traits { }; template <> struct variant_storage_traits { - typedef const nsAString &ConstructorType; + typedef const nsAString& ConstructorType; typedef nsString StorageType; static inline void storage_conversion(ConstructorType aText, - StorageType *_outData) { + StorageType* _outData) { *_outData = aText; } - static inline void destroy(const StorageType &_outData) {} + static inline void destroy(const StorageType& _outData) {} }; template <> struct variant_text_traits { - static inline nsresult asUTF8String(const nsString &aValue, - nsACString &_result) { + static inline nsresult asUTF8String(const nsString& aValue, + nsACString& _result) { CopyUTF16toUTF8(aValue, _result); return NS_OK; } - static inline nsresult asString(const nsString &aValue, nsAString &_result) { + static inline nsresult asString(const nsString& aValue, nsAString& _result) { _result = aValue; return NS_OK; } @@ -244,22 +238,22 @@ struct variant_traits { }; template <> struct variant_storage_traits { - typedef const nsACString &ConstructorType; + typedef const nsACString& ConstructorType; typedef nsCString StorageType; static inline void storage_conversion(ConstructorType aText, - StorageType *_outData) { + StorageType* _outData) { *_outData = aText; } - static inline void destroy(const StorageType &aData) {} + static inline void destroy(const StorageType& aData) {} }; template <> struct variant_text_traits { - static inline nsresult asUTF8String(const nsCString &aValue, - nsACString &_result) { + static inline nsresult asUTF8String(const nsCString& aValue, + nsACString& _result) { _result = aValue; return NS_OK; } - static inline nsresult asString(const nsCString &aValue, nsAString &_result) { + static inline nsresult asString(const nsCString& aValue, nsAString& _result) { CopyUTF8toUTF16(aValue, _result); return NS_OK; } @@ -275,25 +269,25 @@ struct variant_traits { }; template <> struct variant_storage_traits { - typedef std::pair ConstructorType; + typedef std::pair ConstructorType; typedef FallibleTArray StorageType; static inline void storage_conversion(ConstructorType aBlob, - StorageType *_outData) { + StorageType* _outData) { _outData->Clear(); - (void)_outData->AppendElements(static_cast(aBlob.first), + (void)_outData->AppendElements(static_cast(aBlob.first), aBlob.second, fallible); } - static inline void destroy(const StorageType &_outData) {} + static inline void destroy(const StorageType& _outData) {} }; template <> struct variant_storage_traits { - typedef std::pair ConstructorType; - typedef std::pair StorageType; + typedef std::pair ConstructorType; + typedef std::pair StorageType; static inline void storage_conversion(ConstructorType aBlob, - StorageType *_outData) { + StorageType* _outData) { *_outData = aBlob; } - static inline void destroy(StorageType &aData) { + static inline void destroy(StorageType& aData) { if (aData.first) { free(aData.first); aData.first = nullptr; @@ -302,9 +296,9 @@ struct variant_storage_traits { }; template <> struct variant_blob_traits { - static inline nsresult asArray(FallibleTArray &aData, - uint16_t *_type, uint32_t *_size, - void **_result) { + static inline nsresult asArray(FallibleTArray& aData, + uint16_t* _type, uint32_t* _size, + void** _result) { // For empty blobs, we return nullptr. if (aData.Length() == 0) { *_result = nullptr; @@ -325,9 +319,9 @@ struct variant_blob_traits { template <> struct variant_blob_traits { - static inline nsresult asArray(std::pair &aData, - uint16_t *_type, uint32_t *_size, - void **_result) { + static inline nsresult asArray(std::pair& aData, + uint16_t* _type, uint32_t* _size, + void** _result) { // For empty blobs, we return nullptr. if (aData.second == 0) { *_result = nullptr; @@ -356,13 +350,13 @@ class NullVariant : public Variant_base { public: uint16_t GetDataType() override { return nsIDataType::VTYPE_EMPTY; } - NS_IMETHOD GetAsAUTF8String(nsACString &_str) override { + NS_IMETHOD GetAsAUTF8String(nsACString& _str) override { // Return a void string. _str.SetIsVoid(true); return NS_OK; } - NS_IMETHOD GetAsAString(nsAString &_str) override { + NS_IMETHOD GetAsAString(nsAString& _str) override { // Return a void string. _str.SetIsVoid(true); return NS_OK; @@ -386,32 +380,32 @@ class Variant final : public Variant_base { uint16_t GetDataType() override { return variant_traits::type(); } - NS_IMETHOD GetAsBool(bool *_boolean) override { + NS_IMETHOD GetAsBool(bool* _boolean) override { return variant_boolean_traits::asBool(mData, _boolean); } - NS_IMETHOD GetAsInt32(int32_t *_integer) override { + NS_IMETHOD GetAsInt32(int32_t* _integer) override { return variant_integer_traits::asInt32(mData, _integer); } - NS_IMETHOD GetAsInt64(int64_t *_integer) override { + NS_IMETHOD GetAsInt64(int64_t* _integer) override { return variant_integer_traits::asInt64(mData, _integer); } - NS_IMETHOD GetAsDouble(double *_double) override { + NS_IMETHOD GetAsDouble(double* _double) override { return variant_float_traits::asDouble(mData, _double); } - NS_IMETHOD GetAsAUTF8String(nsACString &_str) override { + NS_IMETHOD GetAsAUTF8String(nsACString& _str) override { return variant_text_traits::asUTF8String(mData, _str); } - NS_IMETHOD GetAsAString(nsAString &_str) override { + NS_IMETHOD GetAsAString(nsAString& _str) override { return variant_text_traits::asString(mData, _str); } - NS_IMETHOD GetAsArray(uint16_t *_type, nsIID *, uint32_t *_size, - void **_data) override { + NS_IMETHOD GetAsArray(uint16_t* _type, nsIID*, uint32_t* _size, + void** _data) override { return variant_blob_traits::asArray(mData, _type, _size, _data); } diff --git a/storage/Variant_inl.h b/storage/Variant_inl.h index 32c647e56300c..488c120f9c44b 100644 --- a/storage/Variant_inl.h +++ b/storage/Variant_inl.h @@ -28,101 +28,100 @@ inline NS_IMPL_ADDREF(Variant_base) inline NS_IMPL_RELEASE( return nsIDataType::VTYPE_VOID; } -inline NS_IMETHODIMP Variant_base::GetAsInt32(int32_t *) { +inline NS_IMETHODIMP Variant_base::GetAsInt32(int32_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsInt64(int64_t *) { +inline NS_IMETHODIMP Variant_base::GetAsInt64(int64_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsDouble(double *) { +inline NS_IMETHODIMP Variant_base::GetAsDouble(double*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsAUTF8String(nsACString &) { +inline NS_IMETHODIMP Variant_base::GetAsAUTF8String(nsACString&) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsAString(nsAString &) { +inline NS_IMETHODIMP Variant_base::GetAsAString(nsAString&) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsArray(uint16_t *, nsIID *, uint32_t *, - void **) { +inline NS_IMETHODIMP Variant_base::GetAsArray(uint16_t*, nsIID*, uint32_t*, + void**) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsInt8(uint8_t *) { +inline NS_IMETHODIMP Variant_base::GetAsInt8(uint8_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsInt16(int16_t *) { +inline NS_IMETHODIMP Variant_base::GetAsInt16(int16_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsUint8(uint8_t *) { +inline NS_IMETHODIMP Variant_base::GetAsUint8(uint8_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsUint16(uint16_t *) { +inline NS_IMETHODIMP Variant_base::GetAsUint16(uint16_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsUint32(uint32_t *) { +inline NS_IMETHODIMP Variant_base::GetAsUint32(uint32_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsUint64(uint64_t *) { +inline NS_IMETHODIMP Variant_base::GetAsUint64(uint64_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsFloat(float *) { +inline NS_IMETHODIMP Variant_base::GetAsFloat(float*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsBool(bool *) { +inline NS_IMETHODIMP Variant_base::GetAsBool(bool*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsChar(char *) { +inline NS_IMETHODIMP Variant_base::GetAsChar(char*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsWChar(char16_t *) { +inline NS_IMETHODIMP Variant_base::GetAsWChar(char16_t*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsID(nsID *) { +inline NS_IMETHODIMP Variant_base::GetAsID(nsID*) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsString(char **) { +inline NS_IMETHODIMP Variant_base::GetAsString(char**) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsWString(char16_t **) { +inline NS_IMETHODIMP Variant_base::GetAsWString(char16_t**) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsISupports(nsISupports **) { +inline NS_IMETHODIMP Variant_base::GetAsISupports(nsISupports**) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsInterface(nsIID **, void **) { +inline NS_IMETHODIMP Variant_base::GetAsInterface(nsIID**, void**) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsACString(nsACString &) { +inline NS_IMETHODIMP Variant_base::GetAsACString(nsACString&) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsStringWithSize(uint32_t *, char **) { +inline NS_IMETHODIMP Variant_base::GetAsStringWithSize(uint32_t*, char**) { return NS_ERROR_CANNOT_CONVERT_DATA; } -inline NS_IMETHODIMP Variant_base::GetAsWStringWithSize(uint32_t *, - char16_t **) { +inline NS_IMETHODIMP Variant_base::GetAsWStringWithSize(uint32_t*, char16_t**) { return NS_ERROR_CANNOT_CONVERT_DATA; } diff --git a/storage/mozStorageArgValueArray.cpp b/storage/mozStorageArgValueArray.cpp index ffbe57b26a6bb..5526786cf95ac 100644 --- a/storage/mozStorageArgValueArray.cpp +++ b/storage/mozStorageArgValueArray.cpp @@ -17,7 +17,7 @@ namespace storage { //////////////////////////////////////////////////////////////////////////////// //// ArgValueArray -ArgValueArray::ArgValueArray(int32_t aArgc, sqlite3_value **aArgv) +ArgValueArray::ArgValueArray(int32_t aArgc, sqlite3_value** aArgv) : mArgc(aArgc), mArgv(aArgv) {} NS_IMPL_ISUPPORTS(ArgValueArray, mozIStorageValueArray) @@ -26,13 +26,13 @@ NS_IMPL_ISUPPORTS(ArgValueArray, mozIStorageValueArray) //// mozIStorageValueArray NS_IMETHODIMP -ArgValueArray::GetNumEntries(uint32_t *_size) { +ArgValueArray::GetNumEntries(uint32_t* _size) { *_size = mArgc; return NS_OK; } NS_IMETHODIMP -ArgValueArray::GetTypeOfIndex(uint32_t aIndex, int32_t *_type) { +ArgValueArray::GetTypeOfIndex(uint32_t aIndex, int32_t* _type) { ENSURE_INDEX_VALUE(aIndex, mArgc); int t = ::sqlite3_value_type(mArgv[aIndex]); @@ -60,7 +60,7 @@ ArgValueArray::GetTypeOfIndex(uint32_t aIndex, int32_t *_type) { } NS_IMETHODIMP -ArgValueArray::GetInt32(uint32_t aIndex, int32_t *_value) { +ArgValueArray::GetInt32(uint32_t aIndex, int32_t* _value) { ENSURE_INDEX_VALUE(aIndex, mArgc); *_value = ::sqlite3_value_int(mArgv[aIndex]); @@ -68,7 +68,7 @@ ArgValueArray::GetInt32(uint32_t aIndex, int32_t *_value) { } NS_IMETHODIMP -ArgValueArray::GetInt64(uint32_t aIndex, int64_t *_value) { +ArgValueArray::GetInt64(uint32_t aIndex, int64_t* _value) { ENSURE_INDEX_VALUE(aIndex, mArgc); *_value = ::sqlite3_value_int64(mArgv[aIndex]); @@ -76,7 +76,7 @@ ArgValueArray::GetInt64(uint32_t aIndex, int64_t *_value) { } NS_IMETHODIMP -ArgValueArray::GetDouble(uint32_t aIndex, double *_value) { +ArgValueArray::GetDouble(uint32_t aIndex, double* _value) { ENSURE_INDEX_VALUE(aIndex, mArgc); *_value = ::sqlite3_value_double(mArgv[aIndex]); @@ -84,7 +84,7 @@ ArgValueArray::GetDouble(uint32_t aIndex, double *_value) { } NS_IMETHODIMP -ArgValueArray::GetUTF8String(uint32_t aIndex, nsACString &_value) { +ArgValueArray::GetUTF8String(uint32_t aIndex, nsACString& _value) { ENSURE_INDEX_VALUE(aIndex, mArgc); if (::sqlite3_value_type(mArgv[aIndex]) == SQLITE_NULL) { @@ -93,14 +93,14 @@ ArgValueArray::GetUTF8String(uint32_t aIndex, nsACString &_value) { _value.SetIsVoid(true); } else { _value.Assign( - reinterpret_cast(::sqlite3_value_text(mArgv[aIndex])), + reinterpret_cast(::sqlite3_value_text(mArgv[aIndex])), ::sqlite3_value_bytes(mArgv[aIndex])); } return NS_OK; } NS_IMETHODIMP -ArgValueArray::GetString(uint32_t aIndex, nsAString &_value) { +ArgValueArray::GetString(uint32_t aIndex, nsAString& _value) { ENSURE_INDEX_VALUE(aIndex, mArgc); if (::sqlite3_value_type(mArgv[aIndex]) == SQLITE_NULL) { @@ -108,8 +108,8 @@ ArgValueArray::GetString(uint32_t aIndex, nsAString &_value) { // string. _value.SetIsVoid(true); } else { - const char16_t *string = - static_cast(::sqlite3_value_text16(mArgv[aIndex])); + const char16_t* string = + static_cast(::sqlite3_value_text16(mArgv[aIndex])); _value.Assign(string, ::sqlite3_value_bytes16(mArgv[aIndex]) / sizeof(char16_t)); } @@ -117,28 +117,28 @@ ArgValueArray::GetString(uint32_t aIndex, nsAString &_value) { } NS_IMETHODIMP -ArgValueArray::GetBlob(uint32_t aIndex, uint32_t *_size, uint8_t **_blob) { +ArgValueArray::GetBlob(uint32_t aIndex, uint32_t* _size, uint8_t** _blob) { ENSURE_INDEX_VALUE(aIndex, mArgc); int size = ::sqlite3_value_bytes(mArgv[aIndex]); - void *blob = moz_xmemdup(::sqlite3_value_blob(mArgv[aIndex]), size); - *_blob = static_cast(blob); + void* blob = moz_xmemdup(::sqlite3_value_blob(mArgv[aIndex]), size); + *_blob = static_cast(blob); *_size = size; return NS_OK; } NS_IMETHODIMP -ArgValueArray::GetBlobAsString(uint32_t aIndex, nsAString &aValue) { +ArgValueArray::GetBlobAsString(uint32_t aIndex, nsAString& aValue) { return DoGetBlobAsString(this, aIndex, aValue); } NS_IMETHODIMP -ArgValueArray::GetBlobAsUTF8String(uint32_t aIndex, nsACString &aValue) { +ArgValueArray::GetBlobAsUTF8String(uint32_t aIndex, nsACString& aValue) { return DoGetBlobAsString(this, aIndex, aValue); } NS_IMETHODIMP -ArgValueArray::GetIsNull(uint32_t aIndex, bool *_isNull) { +ArgValueArray::GetIsNull(uint32_t aIndex, bool* _isNull) { // GetTypeOfIndex will check aIndex for us, so we don't have to. int32_t type; nsresult rv = GetTypeOfIndex(aIndex, &type); @@ -149,10 +149,9 @@ ArgValueArray::GetIsNull(uint32_t aIndex, bool *_isNull) { } NS_IMETHODIMP -ArgValueArray::GetSharedUTF8String(uint32_t aIndex, uint32_t *_byteLength, - const char **_string) { - *_string = - reinterpret_cast(::sqlite3_value_text(mArgv[aIndex])); +ArgValueArray::GetSharedUTF8String(uint32_t aIndex, uint32_t* _byteLength, + const char** _string) { + *_string = reinterpret_cast(::sqlite3_value_text(mArgv[aIndex])); if (_byteLength) { *_byteLength = ::sqlite3_value_bytes(mArgv[aIndex]); } @@ -160,10 +159,10 @@ ArgValueArray::GetSharedUTF8String(uint32_t aIndex, uint32_t *_byteLength, } NS_IMETHODIMP -ArgValueArray::GetSharedString(uint32_t aIndex, uint32_t *_byteLength, - const char16_t **_string) { +ArgValueArray::GetSharedString(uint32_t aIndex, uint32_t* _byteLength, + const char16_t** _string) { *_string = - static_cast(::sqlite3_value_text16(mArgv[aIndex])); + static_cast(::sqlite3_value_text16(mArgv[aIndex])); if (_byteLength) { *_byteLength = ::sqlite3_value_bytes16(mArgv[aIndex]); } @@ -171,9 +170,9 @@ ArgValueArray::GetSharedString(uint32_t aIndex, uint32_t *_byteLength, } NS_IMETHODIMP -ArgValueArray::GetSharedBlob(uint32_t aIndex, uint32_t *_byteLength, - const uint8_t **_blob) { - *_blob = static_cast(::sqlite3_value_blob(mArgv[aIndex])); +ArgValueArray::GetSharedBlob(uint32_t aIndex, uint32_t* _byteLength, + const uint8_t** _blob) { + *_blob = static_cast(::sqlite3_value_blob(mArgv[aIndex])); if (_byteLength) { *_byteLength = ::sqlite3_value_bytes(mArgv[aIndex]); } diff --git a/storage/mozStorageArgValueArray.h b/storage/mozStorageArgValueArray.h index 8c8c21fde0018..6b4c4c20e70de 100644 --- a/storage/mozStorageArgValueArray.h +++ b/storage/mozStorageArgValueArray.h @@ -17,7 +17,7 @@ namespace storage { class ArgValueArray final : public mozIStorageValueArray { public: - ArgValueArray(int32_t aArgc, sqlite3_value **aArgv); + ArgValueArray(int32_t aArgc, sqlite3_value** aArgv); NS_DECL_ISUPPORTS NS_DECL_MOZISTORAGEVALUEARRAY @@ -26,7 +26,7 @@ class ArgValueArray final : public mozIStorageValueArray { ~ArgValueArray() {} uint32_t mArgc; - sqlite3_value **mArgv; + sqlite3_value** mArgv; }; } // namespace storage diff --git a/storage/mozStorageAsyncStatement.cpp b/storage/mozStorageAsyncStatement.cpp index 30b7d38ed4749..1bd0ae376c38b 100644 --- a/storage/mozStorageAsyncStatement.cpp +++ b/storage/mozStorageAsyncStatement.cpp @@ -45,43 +45,43 @@ class AsyncStatementClassInfo : public nsIClassInfo { NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD - GetInterfaces(nsTArray &_array) override { + GetInterfaces(nsTArray& _array) override { return NS_CI_INTERFACE_GETTER_NAME(AsyncStatement)(_array); } NS_IMETHOD - GetScriptableHelper(nsIXPCScriptable **_helper) override { + GetScriptableHelper(nsIXPCScriptable** _helper) override { static AsyncStatementJSHelper sJSHelper; *_helper = &sJSHelper; return NS_OK; } NS_IMETHOD - GetContractID(nsACString &aContractID) override { + GetContractID(nsACString& aContractID) override { aContractID.SetIsVoid(true); return NS_OK; } NS_IMETHOD - GetClassDescription(nsACString &aDesc) override { + GetClassDescription(nsACString& aDesc) override { aDesc.SetIsVoid(true); return NS_OK; } NS_IMETHOD - GetClassID(nsCID **_id) override { + GetClassID(nsCID** _id) override { *_id = nullptr; return NS_OK; } NS_IMETHOD - GetFlags(uint32_t *_flags) override { + GetFlags(uint32_t* _flags) override { *_flags = 0; return NS_OK; } NS_IMETHOD - GetClassIDNoAlloc(nsCID *_cid) override { return NS_ERROR_NOT_AVAILABLE; } + GetClassIDNoAlloc(nsCID* _cid) override { return NS_ERROR_NOT_AVAILABLE; } }; NS_IMETHODIMP_(MozExternalRefCountType) AsyncStatementClassInfo::AddRef() { @@ -100,9 +100,9 @@ static AsyncStatementClassInfo sAsyncStatementClassInfo; AsyncStatement::AsyncStatement() : StorageBaseStatementInternal(), mFinalized(false) {} -nsresult AsyncStatement::initialize(Connection *aDBConnection, - sqlite3 *aNativeConnection, - const nsACString &aSQLStatement) { +nsresult AsyncStatement::initialize(Connection* aDBConnection, + sqlite3* aNativeConnection, + const nsACString& aSQLStatement) { MOZ_ASSERT(aDBConnection, "No database connection given!"); MOZ_ASSERT(aDBConnection->isConnectionReadyOnThisThread(), "Database connection should be valid"); @@ -154,7 +154,7 @@ nsresult AsyncStatement::initialize(Connection *aDBConnection, return NS_OK; } -mozIStorageBindingParams *AsyncStatement::getParams() { +mozIStorageBindingParams* AsyncStatement::getParams() { nsresult rv; // If we do not have an array object yet, make it. @@ -163,7 +163,7 @@ mozIStorageBindingParams *AsyncStatement::getParams() { rv = NewBindingParamsArray(getter_AddRefs(array)); NS_ENSURE_SUCCESS(rv, nullptr); - mParamsArray = static_cast(array.get()); + mParamsArray = static_cast(array.get()); } // If there isn't already any rows added, we'll have to add one to use. @@ -223,7 +223,7 @@ NS_INTERFACE_MAP_BEGIN(AsyncStatement) NS_INTERFACE_MAP_ENTRY(mozIStorageBindingParams) NS_INTERFACE_MAP_ENTRY(mozilla::storage::StorageBaseStatementInternal) if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { - foundInterface = static_cast(&sAsyncStatementClassInfo); + foundInterface = static_cast(&sAsyncStatementClassInfo); } else NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, mozIStorageAsyncStatement) NS_INTERFACE_MAP_END @@ -231,9 +231,9 @@ NS_INTERFACE_MAP_END //////////////////////////////////////////////////////////////////////////////// //// StorageBaseStatementInternal -Connection *AsyncStatement::getOwner() { return mDBConnection; } +Connection* AsyncStatement::getOwner() { return mDBConnection; } -int AsyncStatement::getAsyncStatement(sqlite3_stmt **_stmt) { +int AsyncStatement::getAsyncStatement(sqlite3_stmt** _stmt) { #ifdef DEBUG // Make sure we are never called on the connection's owning thread. bool onOpenedThread = false; @@ -263,7 +263,7 @@ int AsyncStatement::getAsyncStatement(sqlite3_stmt **_stmt) { return SQLITE_OK; } -nsresult AsyncStatement::getAsynchronousStatementData(StatementData &_data) { +nsresult AsyncStatement::getAsynchronousStatementData(StatementData& _data) { if (mFinalized) return NS_ERROR_UNEXPECTED; // Pass null for the sqlite3_stmt; it will be requested on demand from the @@ -274,7 +274,7 @@ nsresult AsyncStatement::getAsynchronousStatementData(StatementData &_data) { } already_AddRefed AsyncStatement::newBindingParams( - mozIStorageBindingParamsArray *aOwner) { + mozIStorageBindingParamsArray* aOwner) { if (mFinalized) return nullptr; nsCOMPtr params(new AsyncBindingParams(aOwner)); @@ -311,10 +311,10 @@ AsyncStatement::Finalize() { } NS_IMETHODIMP -AsyncStatement::BindParameters(mozIStorageBindingParamsArray *aParameters) { +AsyncStatement::BindParameters(mozIStorageBindingParamsArray* aParameters) { if (mFinalized) return NS_ERROR_UNEXPECTED; - BindingParamsArray *array = static_cast(aParameters); + BindingParamsArray* array = static_cast(aParameters); if (array->getOwner() != this) return NS_ERROR_UNEXPECTED; if (array->length() == 0) return NS_ERROR_UNEXPECTED; @@ -326,7 +326,7 @@ AsyncStatement::BindParameters(mozIStorageBindingParamsArray *aParameters) { } NS_IMETHODIMP -AsyncStatement::GetState(int32_t *_state) { +AsyncStatement::GetState(int32_t* _state) { if (mFinalized) *_state = MOZ_STORAGE_STATEMENT_INVALID; else diff --git a/storage/mozStorageAsyncStatement.h b/storage/mozStorageAsyncStatement.h index 2033b697cb701..b770cc68df09a 100644 --- a/storage/mozStorageAsyncStatement.h +++ b/storage/mozStorageAsyncStatement.h @@ -47,8 +47,8 @@ class AsyncStatement final : public mozIStorageAsyncStatement, * @param aSQLStatement * The SQL statement to prepare that this object will represent. */ - nsresult initialize(Connection *aDBConnection, sqlite3 *aNativeConnection, - const nsACString &aSQLStatement); + nsresult initialize(Connection* aDBConnection, sqlite3* aNativeConnection, + const nsACString& aSQLStatement); /** * Obtains and transfers ownership of the array of parameters that are bound @@ -65,7 +65,7 @@ class AsyncStatement final : public mozIStorageAsyncStatement, * @return a pointer to the BindingParams object to use with our Bind* * method. */ - mozIStorageBindingParams *getParams(); + mozIStorageBindingParams* getParams(); /** * The SQL string as passed by the user. We store it because we create the diff --git a/storage/mozStorageAsyncStatementExecution.cpp b/storage/mozStorageAsyncStatementExecution.cpp index 146cb973633fc..99ccac5b60ed9 100644 --- a/storage/mozStorageAsyncStatementExecution.cpp +++ b/storage/mozStorageAsyncStatementExecution.cpp @@ -44,16 +44,16 @@ namespace storage { /* static */ nsresult AsyncExecuteStatements::execute( - StatementDataArray &aStatements, Connection *aConnection, - sqlite3 *aNativeConnection, mozIStorageStatementCallback *aCallback, - mozIStoragePendingStatement **_stmt) { + StatementDataArray& aStatements, Connection* aConnection, + sqlite3* aNativeConnection, mozIStorageStatementCallback* aCallback, + mozIStoragePendingStatement** _stmt) { // Create our event to run in the background RefPtr event = new AsyncExecuteStatements( aStatements, aConnection, aNativeConnection, aCallback); NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY); // Dispatch it to the background - nsIEventTarget *target = aConnection->getAsyncExecutionTarget(); + nsIEventTarget* target = aConnection->getAsyncExecutionTarget(); // If we don't have a valid target, this is a bug somewhere else. In the past, // this assert found cases where a Run method would schedule a new statement @@ -74,8 +74,8 @@ nsresult AsyncExecuteStatements::execute( } AsyncExecuteStatements::AsyncExecuteStatements( - StatementDataArray &aStatements, Connection *aConnection, - sqlite3 *aNativeConnection, mozIStorageStatementCallback *aCallback) + StatementDataArray& aStatements, Connection* aConnection, + sqlite3* aNativeConnection, mozIStorageStatementCallback* aCallback) : mConnection(aConnection), mNativeConnection(aNativeConnection), mHasTransaction(false), @@ -118,14 +118,14 @@ bool AsyncExecuteStatements::shouldNotify() { } bool AsyncExecuteStatements::bindExecuteAndProcessStatement( - StatementData &aData, bool aLastStatement) { + StatementData& aData, bool aLastStatement) { mMutex.AssertNotCurrentThreadOwns(); - sqlite3_stmt *aStatement = nullptr; + sqlite3_stmt* aStatement = nullptr; // This cannot fail; we are only called if it's available. (void)aData.getSqliteStatement(&aStatement); NS_ASSERTION(aStatement, "You broke the code; do not call here like that!"); - BindingParamsArray *paramsArray(aData); + BindingParamsArray* paramsArray(aData); // Iterate through all of our parameters, bind them, and execute. bool continueProcessing = true; @@ -158,7 +158,7 @@ bool AsyncExecuteStatements::bindExecuteAndProcessStatement( } bool AsyncExecuteStatements::executeAndProcessStatement( - sqlite3_stmt *aStatement, bool aLastStatement) { + sqlite3_stmt* aStatement, bool aLastStatement) { mMutex.AssertNotCurrentThreadOwns(); // Execute our statement @@ -209,7 +209,7 @@ bool AsyncExecuteStatements::executeAndProcessStatement( return true; } -bool AsyncExecuteStatements::executeStatement(sqlite3_stmt *aStatement) { +bool AsyncExecuteStatements::executeStatement(sqlite3_stmt* aStatement) { mMutex.AssertNotCurrentThreadOwns(); Telemetry::AutoTimer finallySendExecutionDuration(mRequestStartDate); @@ -267,7 +267,7 @@ bool AsyncExecuteStatements::executeStatement(sqlite3_stmt *aStatement) { } nsresult AsyncExecuteStatements::buildAndNotifyResults( - sqlite3_stmt *aStatement) { + sqlite3_stmt* aStatement) { NS_ASSERTION(mCallback, "Trying to dispatch results without a callback!"); mMutex.AssertNotCurrentThreadOwns(); @@ -360,7 +360,7 @@ nsresult AsyncExecuteStatements::notifyCompleteOnCallingThread() { } nsresult AsyncExecuteStatements::notifyError(int32_t aErrorCode, - const char *aMessage) { + const char* aMessage) { mMutex.AssertNotCurrentThreadOwns(); mDBMutex.assertNotCurrentThreadOwns(); @@ -372,7 +372,7 @@ nsresult AsyncExecuteStatements::notifyError(int32_t aErrorCode, return notifyError(errorObj); } -nsresult AsyncExecuteStatements::notifyError(mozIStorageError *aError) { +nsresult AsyncExecuteStatements::notifyError(mozIStorageError* aError) { mMutex.AssertNotCurrentThreadOwns(); mDBMutex.assertNotCurrentThreadOwns(); @@ -388,7 +388,7 @@ nsresult AsyncExecuteStatements::notifyError(mozIStorageError *aError) { } nsresult AsyncExecuteStatements::notifyErrorOnCallingThread( - mozIStorageError *aError) { + mozIStorageError* aError) { MOZ_ASSERT(mCallingThread->IsOnCurrentThread()); // Acquire our own strong reference so that if the callback spins a nested // event loop and notifyCompleteOnCallingThread is executed, forgetting @@ -418,7 +418,7 @@ nsresult AsyncExecuteStatements::notifyResults() { } nsresult AsyncExecuteStatements::notifyResultsOnCallingThread( - ResultSet *aResultSet) { + ResultSet* aResultSet) { MOZ_ASSERT(mCallingThread->IsOnCurrentThread()); // Acquire our own strong reference so that if the callback spins a nested // event loop and notifyCompleteOnCallingThread is executed, forgetting @@ -502,7 +502,7 @@ AsyncExecuteStatements::Run() { for (uint32_t i = 0; i < mStatements.Length(); i++) { bool finished = (i == (mStatements.Length() - 1)); - sqlite3_stmt *stmt; + sqlite3_stmt* stmt; { // lock the sqlite mutex so sqlite3_errmsg cannot change SQLiteMutexAutoLock lockedScope(mDBMutex); diff --git a/storage/mozStorageAsyncStatementExecution.h b/storage/mozStorageAsyncStatementExecution.h index d390707399237..9b453d4ddbdb5 100644 --- a/storage/mozStorageAsyncStatementExecution.h +++ b/storage/mozStorageAsyncStatementExecution.h @@ -64,10 +64,10 @@ class AsyncExecuteStatements final : public nsIRunnable, * @param _stmt * The handle to control the execution of the statements. */ - static nsresult execute(StatementDataArray &aStatements, - Connection *aConnection, sqlite3 *aNativeConnection, - mozIStorageStatementCallback *aCallback, - mozIStoragePendingStatement **_stmt); + static nsresult execute(StatementDataArray& aStatements, + Connection* aConnection, sqlite3* aNativeConnection, + mozIStorageStatementCallback* aCallback, + mozIStoragePendingStatement** _stmt); /** * Indicates when events on the calling thread should run or not. Certain @@ -85,13 +85,13 @@ class AsyncExecuteStatements final : public nsIRunnable, * the calling thread. */ nsresult notifyCompleteOnCallingThread(); - nsresult notifyErrorOnCallingThread(mozIStorageError *aError); - nsresult notifyResultsOnCallingThread(ResultSet *aResultSet); + nsresult notifyErrorOnCallingThread(mozIStorageError* aError); + nsresult notifyResultsOnCallingThread(ResultSet* aResultSet); private: - AsyncExecuteStatements(StatementDataArray &aStatements, - Connection *aConnection, sqlite3 *aNativeConnection, - mozIStorageStatementCallback *aCallback); + AsyncExecuteStatements(StatementDataArray& aStatements, + Connection* aConnection, sqlite3* aNativeConnection, + mozIStorageStatementCallback* aCallback); ~AsyncExecuteStatements(); /** @@ -108,7 +108,7 @@ class AsyncExecuteStatements final : public nsIRunnable, * to set the proper state. * @returns true if we should continue to process statements, false otherwise. */ - bool bindExecuteAndProcessStatement(StatementData &aData, + bool bindExecuteAndProcessStatement(StatementData& aData, bool aLastStatement); /** @@ -124,7 +124,7 @@ class AsyncExecuteStatements final : public nsIRunnable, * to set the proper state. * @returns true if we should continue to process statements, false otherwise. */ - bool executeAndProcessStatement(sqlite3_stmt *aStatement, + bool executeAndProcessStatement(sqlite3_stmt* aStatement, bool aLastStatement); /** @@ -136,7 +136,7 @@ class AsyncExecuteStatements final : public nsIRunnable, * The statement to execute to completion. * @returns true if results were obtained, false otherwise. */ - bool executeStatement(sqlite3_stmt *aStatement); + bool executeStatement(sqlite3_stmt* aStatement); /** * Builds a result set up with a row from a given statement. If we meet the @@ -147,7 +147,7 @@ class AsyncExecuteStatements final : public nsIRunnable, * @param aStatement * The statement to get the row data from. */ - nsresult buildAndNotifyResults(sqlite3_stmt *aStatement); + nsresult buildAndNotifyResults(sqlite3_stmt* aStatement); /** * Notifies callback about completion, and does any necessary cleanup. @@ -169,8 +169,8 @@ class AsyncExecuteStatements final : public nsIRunnable, * @param aError * The error object to notify the caller with. */ - nsresult notifyError(int32_t aErrorCode, const char *aMessage); - nsresult notifyError(mozIStorageError *aError); + nsresult notifyError(int32_t aErrorCode, const char* aMessage); + nsresult notifyError(mozIStorageError* aError); /** * Notifies the callback about a result set. @@ -189,7 +189,7 @@ class AsyncExecuteStatements final : public nsIRunnable, StatementDataArray mStatements; RefPtr mConnection; - sqlite3 *mNativeConnection; + sqlite3* mNativeConnection; bool mHasTransaction; // Note, this may not be a threadsafe object - never addref/release off // the calling thread. We take a reference when this is created, and @@ -226,7 +226,7 @@ class AsyncExecuteStatements final : public nsIRunnable, * held. It is always read from within the lock on the background thread, * but not on the calling thread (see shouldNotify for why). */ - Mutex &mMutex; + Mutex& mMutex; /** * The wrapped SQLite recursive connection mutex. We use it whenever we call @@ -234,7 +234,7 @@ class AsyncExecuteStatements final : public nsIRunnable, * prior to the call and holding it until the point where we no longer care * about the error message, the user gets reliable error messages. */ - SQLiteMutex &mDBMutex; + SQLiteMutex& mDBMutex; /** * The instant at which the request was started. diff --git a/storage/mozStorageAsyncStatementJSHelper.cpp b/storage/mozStorageAsyncStatementJSHelper.cpp index ce9da6e73dc23..daf5057745db3 100644 --- a/storage/mozStorageAsyncStatementJSHelper.cpp +++ b/storage/mozStorageAsyncStatementJSHelper.cpp @@ -26,9 +26,9 @@ namespace storage { //////////////////////////////////////////////////////////////////////////////// //// AsyncStatementJSHelper -nsresult AsyncStatementJSHelper::getParams(AsyncStatement *aStatement, - JSContext *aCtx, JSObject *aScopeObj, - JS::Value *_params) { +nsresult AsyncStatementJSHelper::getParams(AsyncStatement* aStatement, + JSContext* aCtx, JSObject* aScopeObj, + JS::Value* _params) { MOZ_ASSERT(NS_IsMainThread()); #ifdef DEBUG @@ -64,7 +64,7 @@ nsresult AsyncStatementJSHelper::getParams(AsyncStatement *aStatement, RefPtr params( aStatement->mStatementParamsHolder->Get()); - JSObject *obj = params->WrapObject(aCtx, nullptr); + JSObject* obj = params->WrapObject(aCtx, nullptr); if (!obj) { return NS_ERROR_UNEXPECTED; } @@ -94,21 +94,21 @@ NS_INTERFACE_MAP_END #include "xpc_map_end.h" NS_IMETHODIMP -AsyncStatementJSHelper::Resolve(nsIXPConnectWrappedNative *aWrapper, - JSContext *aCtx, JSObject *aScopeObj, jsid aId, - bool *resolvedp, bool *_retval) { +AsyncStatementJSHelper::Resolve(nsIXPConnectWrappedNative* aWrapper, + JSContext* aCtx, JSObject* aScopeObj, jsid aId, + bool* resolvedp, bool* _retval) { if (!JSID_IS_STRING(aId)) return NS_OK; // Cast to async via mozI* since direct from nsISupports is ambiguous. JS::RootedObject scope(aCtx, aScopeObj); JS::RootedId id(aCtx, aId); - mozIStorageAsyncStatement *iAsyncStmt = - static_cast(aWrapper->Native()); - AsyncStatement *stmt = static_cast(iAsyncStmt); + mozIStorageAsyncStatement* iAsyncStmt = + static_cast(aWrapper->Native()); + AsyncStatement* stmt = static_cast(iAsyncStmt); #ifdef DEBUG { - nsISupports *supp = aWrapper->Native(); + nsISupports* supp = aWrapper->Native(); nsCOMPtr isStatement(do_QueryInterface(supp)); NS_ASSERTION(isStatement, "How is this not an async statement?!"); } diff --git a/storage/mozStorageAsyncStatementJSHelper.h b/storage/mozStorageAsyncStatementJSHelper.h index 6e2b9b4871f2c..4da1f33309ffe 100644 --- a/storage/mozStorageAsyncStatementJSHelper.h +++ b/storage/mozStorageAsyncStatementJSHelper.h @@ -27,7 +27,7 @@ class AsyncStatementJSHelper : public nsIXPCScriptable { NS_DECL_NSIXPCSCRIPTABLE private: - nsresult getParams(AsyncStatement *, JSContext *, JSObject *, JS::Value *); + nsresult getParams(AsyncStatement*, JSContext*, JSObject*, JS::Value*); }; /** @@ -39,10 +39,10 @@ class AsyncStatementParamsHolder final : public nsISupports { public: NS_DECL_ISUPPORTS - explicit AsyncStatementParamsHolder(AsyncStatementParams *aParams) + explicit AsyncStatementParamsHolder(AsyncStatementParams* aParams) : mParams(aParams) {} - AsyncStatementParams *Get() const { + AsyncStatementParams* Get() const { MOZ_ASSERT(mParams); return mParams; } diff --git a/storage/mozStorageBindingParams.cpp b/storage/mozStorageBindingParams.cpp index 008bcb6481554..e767145fcc5c6 100644 --- a/storage/mozStorageBindingParams.cpp +++ b/storage/mozStorageBindingParams.cpp @@ -24,9 +24,9 @@ namespace storage { namespace { struct BindingColumnData { - BindingColumnData(sqlite3_stmt *aStmt, int aColumn) + BindingColumnData(sqlite3_stmt* aStmt, int aColumn) : stmt(aStmt), column(aColumn) {} - sqlite3_stmt *stmt; + sqlite3_stmt* stmt; int column; }; @@ -45,12 +45,12 @@ int sqlite3_T_double(BindingColumnData aData, double aValue) { return ::sqlite3_bind_double(aData.stmt, aData.column + 1, aValue); } -int sqlite3_T_text(BindingColumnData aData, const nsCString &aValue) { +int sqlite3_T_text(BindingColumnData aData, const nsCString& aValue) { return ::sqlite3_bind_text(aData.stmt, aData.column + 1, aValue.get(), aValue.Length(), SQLITE_TRANSIENT); } -int sqlite3_T_text16(BindingColumnData aData, const nsString &aValue) { +int sqlite3_T_text16(BindingColumnData aData, const nsString& aValue) { return ::sqlite3_bind_text16( aData.stmt, aData.column + 1, aValue.get(), aValue.Length() * sizeof(char16_t), // Length in bytes! @@ -61,7 +61,7 @@ int sqlite3_T_null(BindingColumnData aData) { return ::sqlite3_bind_null(aData.stmt, aData.column + 1); } -int sqlite3_T_blob(BindingColumnData aData, const void *aBlob, int aSize) { +int sqlite3_T_blob(BindingColumnData aData, const void* aBlob, int aSize) { return ::sqlite3_bind_blob(aData.stmt, aData.column + 1, aBlob, aSize, free); } @@ -72,8 +72,8 @@ int sqlite3_T_blob(BindingColumnData aData, const void *aBlob, int aSize) { //////////////////////////////////////////////////////////////////////////////// //// BindingParams -BindingParams::BindingParams(mozIStorageBindingParamsArray *aOwningArray, - Statement *aOwningStatement) +BindingParams::BindingParams(mozIStorageBindingParamsArray* aOwningArray, + Statement* aOwningStatement) : mLocked(false), mOwningArray(aOwningArray), mOwningStatement(aOwningStatement), @@ -82,14 +82,14 @@ BindingParams::BindingParams(mozIStorageBindingParamsArray *aOwningArray, mParameters.SetCapacity(mParamCount); } -BindingParams::BindingParams(mozIStorageBindingParamsArray *aOwningArray) +BindingParams::BindingParams(mozIStorageBindingParamsArray* aOwningArray) : mLocked(false), mOwningArray(aOwningArray), mOwningStatement(nullptr), mParamCount(0) {} AsyncBindingParams::AsyncBindingParams( - mozIStorageBindingParamsArray *aOwningArray) + mozIStorageBindingParamsArray* aOwningArray) : BindingParams(aOwningArray) {} void BindingParams::lock() { @@ -103,13 +103,13 @@ void BindingParams::lock() { mOwningArray = nullptr; } -void BindingParams::unlock(Statement *aOwningStatement) { +void BindingParams::unlock(Statement* aOwningStatement) { NS_ASSERTION(mLocked == true, "Parameters were not yet locked!"); mLocked = false; mOwningStatement = aOwningStatement; } -const mozIStorageBindingParamsArray *BindingParams::getOwner() const { +const mozIStorageBindingParamsArray* BindingParams::getOwner() const { return mOwningArray; } @@ -123,7 +123,7 @@ NS_IMPL_ISUPPORTS(BindingParams, mozIStorageBindingParams, //// IStorageBindingParamsInternal already_AddRefed BindingParams::bind( - sqlite3_stmt *aStatement) { + sqlite3_stmt* aStatement) { // Iterate through all of our stored data, and bind it. for (size_t i = 0; i < mParameters.Length(); i++) { int rc = variantToSQLiteT(BindingColumnData(aStatement, i), mParameters[i]); @@ -131,7 +131,7 @@ already_AddRefed BindingParams::bind( // We had an error while trying to bind. Now we need to create an error // object with the right message. Note that we special case // SQLITE_MISMATCH, but otherwise get the message from SQLite. - const char *msg = "Could not covert nsIVariant to SQLite type."; + const char* msg = "Could not covert nsIVariant to SQLite type."; if (rc != SQLITE_MISMATCH) msg = ::sqlite3_errmsg(::sqlite3_db_handle(aStatement)); @@ -144,7 +144,7 @@ already_AddRefed BindingParams::bind( } already_AddRefed AsyncBindingParams::bind( - sqlite3_stmt *aStatement) { + sqlite3_stmt* aStatement) { // We should bind by index using the super-class if there is nothing in our // hashtable. if (!mNamedParameters.Count()) return BindingParams::bind(aStatement); @@ -152,7 +152,7 @@ already_AddRefed AsyncBindingParams::bind( nsCOMPtr err; for (auto iter = mNamedParameters.Iter(); !iter.Done(); iter.Next()) { - const nsACString &key = iter.Key(); + const nsACString& key = iter.Key(); // We do not accept any forms of names other than ":name", but we need to // add the colon for SQLite. @@ -177,7 +177,7 @@ already_AddRefed AsyncBindingParams::bind( // We had an error while trying to bind. Now we need to create an error // object with the right message. Note that we special case // SQLITE_MISMATCH, but otherwise get the message from SQLite. - const char *msg = "Could not covert nsIVariant to SQLite type."; + const char* msg = "Could not covert nsIVariant to SQLite type."; if (rc != SQLITE_MISMATCH) { msg = ::sqlite3_errmsg(::sqlite3_db_handle(aStatement)); } @@ -193,7 +193,7 @@ already_AddRefed AsyncBindingParams::bind( //// mozIStorageBindingParams NS_IMETHODIMP -BindingParams::BindByName(const nsACString &aName, nsIVariant *aValue) { +BindingParams::BindByName(const nsACString& aName, nsIVariant* aValue) { NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED); // Get the column index that we need to store this at. @@ -205,7 +205,7 @@ BindingParams::BindByName(const nsACString &aName, nsIVariant *aValue) { } NS_IMETHODIMP -AsyncBindingParams::BindByName(const nsACString &aName, nsIVariant *aValue) { +AsyncBindingParams::BindByName(const nsACString& aName, nsIVariant* aValue) { NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED); RefPtr variant = convertVariantToStorageVariant(aValue); @@ -216,8 +216,8 @@ AsyncBindingParams::BindByName(const nsACString &aName, nsIVariant *aValue) { } NS_IMETHODIMP -BindingParams::BindUTF8StringByName(const nsACString &aName, - const nsACString &aValue) { +BindingParams::BindUTF8StringByName(const nsACString& aName, + const nsACString& aValue) { nsCOMPtr value(new UTF8TextVariant(aValue)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -225,8 +225,8 @@ BindingParams::BindUTF8StringByName(const nsACString &aName, } NS_IMETHODIMP -BindingParams::BindStringByName(const nsACString &aName, - const nsAString &aValue) { +BindingParams::BindStringByName(const nsACString& aName, + const nsAString& aValue) { nsCOMPtr value(new TextVariant(aValue)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -234,7 +234,7 @@ BindingParams::BindStringByName(const nsACString &aName, } NS_IMETHODIMP -BindingParams::BindDoubleByName(const nsACString &aName, double aValue) { +BindingParams::BindDoubleByName(const nsACString& aName, double aValue) { nsCOMPtr value(new FloatVariant(aValue)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -242,7 +242,7 @@ BindingParams::BindDoubleByName(const nsACString &aName, double aValue) { } NS_IMETHODIMP -BindingParams::BindInt32ByName(const nsACString &aName, int32_t aValue) { +BindingParams::BindInt32ByName(const nsACString& aName, int32_t aValue) { nsCOMPtr value(new IntegerVariant(aValue)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -250,7 +250,7 @@ BindingParams::BindInt32ByName(const nsACString &aName, int32_t aValue) { } NS_IMETHODIMP -BindingParams::BindInt64ByName(const nsACString &aName, int64_t aValue) { +BindingParams::BindInt64ByName(const nsACString& aName, int64_t aValue) { nsCOMPtr value(new IntegerVariant(aValue)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -258,7 +258,7 @@ BindingParams::BindInt64ByName(const nsACString &aName, int64_t aValue) { } NS_IMETHODIMP -BindingParams::BindNullByName(const nsACString &aName) { +BindingParams::BindNullByName(const nsACString& aName) { nsCOMPtr value(new NullVariant()); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -266,11 +266,11 @@ BindingParams::BindNullByName(const nsACString &aName) { } NS_IMETHODIMP -BindingParams::BindBlobByName(const nsACString &aName, const uint8_t *aValue, +BindingParams::BindBlobByName(const nsACString& aName, const uint8_t* aValue, uint32_t aValueSize) { NS_ENSURE_ARG_MAX(aValueSize, INT_MAX); - std::pair data(static_cast(aValue), - int(aValueSize)); + std::pair data(static_cast(aValue), + int(aValueSize)); nsCOMPtr value(new BlobVariant(data)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -278,30 +278,30 @@ BindingParams::BindBlobByName(const nsACString &aName, const uint8_t *aValue, } NS_IMETHODIMP -BindingParams::BindStringAsBlobByName(const nsACString &aName, - const nsAString &aValue) { +BindingParams::BindStringAsBlobByName(const nsACString& aName, + const nsAString& aValue) { return DoBindStringAsBlobByName(this, aName, aValue); } NS_IMETHODIMP -BindingParams::BindUTF8StringAsBlobByName(const nsACString &aName, - const nsACString &aValue) { +BindingParams::BindUTF8StringAsBlobByName(const nsACString& aName, + const nsACString& aValue) { return DoBindStringAsBlobByName(this, aName, aValue); } NS_IMETHODIMP -BindingParams::BindAdoptedBlobByName(const nsACString &aName, uint8_t *aValue, +BindingParams::BindAdoptedBlobByName(const nsACString& aName, uint8_t* aValue, uint32_t aValueSize) { UniqueFreePtr uniqueValue(aValue); NS_ENSURE_ARG_MAX(aValueSize, INT_MAX); - std::pair data(uniqueValue.release(), int(aValueSize)); + std::pair data(uniqueValue.release(), int(aValueSize)); nsCOMPtr value(new AdoptedBlobVariant(data)); return BindByName(aName, value); } NS_IMETHODIMP -BindingParams::BindByIndex(uint32_t aIndex, nsIVariant *aValue) { +BindingParams::BindByIndex(uint32_t aIndex, nsIVariant* aValue) { NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED); ENSURE_INDEX_VALUE(aIndex, mParamCount); @@ -319,7 +319,7 @@ BindingParams::BindByIndex(uint32_t aIndex, nsIVariant *aValue) { } NS_IMETHODIMP -AsyncBindingParams::BindByIndex(uint32_t aIndex, nsIVariant *aValue) { +AsyncBindingParams::BindByIndex(uint32_t aIndex, nsIVariant* aValue) { NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED); // In the asynchronous case we do not know how many parameters there are to // bind to, so we cannot check the validity of aIndex. @@ -338,7 +338,7 @@ AsyncBindingParams::BindByIndex(uint32_t aIndex, nsIVariant *aValue) { NS_IMETHODIMP BindingParams::BindUTF8StringByIndex(uint32_t aIndex, - const nsACString &aValue) { + const nsACString& aValue) { nsCOMPtr value(new UTF8TextVariant(aValue)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -346,7 +346,7 @@ BindingParams::BindUTF8StringByIndex(uint32_t aIndex, } NS_IMETHODIMP -BindingParams::BindStringByIndex(uint32_t aIndex, const nsAString &aValue) { +BindingParams::BindStringByIndex(uint32_t aIndex, const nsAString& aValue) { nsCOMPtr value(new TextVariant(aValue)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -386,11 +386,11 @@ BindingParams::BindNullByIndex(uint32_t aIndex) { } NS_IMETHODIMP -BindingParams::BindBlobByIndex(uint32_t aIndex, const uint8_t *aValue, +BindingParams::BindBlobByIndex(uint32_t aIndex, const uint8_t* aValue, uint32_t aValueSize) { NS_ENSURE_ARG_MAX(aValueSize, INT_MAX); - std::pair data(static_cast(aValue), - int(aValueSize)); + std::pair data(static_cast(aValue), + int(aValueSize)); nsCOMPtr value(new BlobVariant(data)); NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY); @@ -399,22 +399,22 @@ BindingParams::BindBlobByIndex(uint32_t aIndex, const uint8_t *aValue, NS_IMETHODIMP BindingParams::BindStringAsBlobByIndex(uint32_t aIndex, - const nsAString &aValue) { + const nsAString& aValue) { return DoBindStringAsBlobByIndex(this, aIndex, aValue); } NS_IMETHODIMP BindingParams::BindUTF8StringAsBlobByIndex(uint32_t aIndex, - const nsACString &aValue) { + const nsACString& aValue) { return DoBindStringAsBlobByIndex(this, aIndex, aValue); } NS_IMETHODIMP -BindingParams::BindAdoptedBlobByIndex(uint32_t aIndex, uint8_t *aValue, +BindingParams::BindAdoptedBlobByIndex(uint32_t aIndex, uint8_t* aValue, uint32_t aValueSize) { UniqueFreePtr uniqueValue(aValue); NS_ENSURE_ARG_MAX(aValueSize, INT_MAX); - std::pair data(uniqueValue.release(), int(aValueSize)); + std::pair data(uniqueValue.release(), int(aValueSize)); nsCOMPtr value(new AdoptedBlobVariant(data)); return BindByIndex(aIndex, value); diff --git a/storage/mozStorageBindingParams.h b/storage/mozStorageBindingParams.h index f020d03df7f0b..cef221ecef3ae 100644 --- a/storage/mozStorageBindingParams.h +++ b/storage/mozStorageBindingParams.h @@ -43,21 +43,21 @@ class BindingParams : public mozIStorageBindingParams, * and our invariant requires us to have this, so you need to tell us * again. */ - void unlock(Statement *aOwningStatement); + void unlock(Statement* aOwningStatement); /** * @returns the pointer to the owning BindingParamsArray. Used by a * BindingParamsArray to verify that we belong to it when added. */ - const mozIStorageBindingParamsArray *getOwner() const; + const mozIStorageBindingParamsArray* getOwner() const; - BindingParams(mozIStorageBindingParamsArray *aOwningArray, - Statement *aOwningStatement); + BindingParams(mozIStorageBindingParamsArray* aOwningArray, + Statement* aOwningStatement); protected: virtual ~BindingParams() {} - explicit BindingParams(mozIStorageBindingParamsArray *aOwningArray); + explicit BindingParams(mozIStorageBindingParamsArray* aOwningArray); // Note that this is managed as a sparse array, so particular caution should // be used for out-of-bounds usage. nsTArray > mParameters; @@ -77,7 +77,7 @@ class BindingParams : public mozIStorageBindingParams, * Not reference-counted because this is only non-null as long as mOwningArray * is non-null and mOwningArray also holds a statement reference. */ - Statement *mOwningStatement; + Statement* mOwningStatement; uint32_t mParamCount; }; @@ -92,13 +92,13 @@ class BindingParams : public mozIStorageBindingParams, */ class AsyncBindingParams : public BindingParams { public: - NS_IMETHOD BindByName(const nsACString &aName, nsIVariant *aValue) override; - NS_IMETHOD BindByIndex(uint32_t aIndex, nsIVariant *aValue) override; + NS_IMETHOD BindByName(const nsACString& aName, nsIVariant* aValue) override; + NS_IMETHOD BindByIndex(uint32_t aIndex, nsIVariant* aValue) override; virtual already_AddRefed bind( - sqlite3_stmt *aStatement) override; + sqlite3_stmt* aStatement) override; - explicit AsyncBindingParams(mozIStorageBindingParamsArray *aOwningArray); + explicit AsyncBindingParams(mozIStorageBindingParamsArray* aOwningArray); virtual ~AsyncBindingParams() {} private: diff --git a/storage/mozStorageBindingParamsArray.cpp b/storage/mozStorageBindingParamsArray.cpp index 7228700cb6ad0..66ea1aead629a 100644 --- a/storage/mozStorageBindingParamsArray.cpp +++ b/storage/mozStorageBindingParamsArray.cpp @@ -15,7 +15,7 @@ namespace storage { //// BindingParamsArray BindingParamsArray::BindingParamsArray( - StorageBaseStatementInternal *aOwningStatement) + StorageBaseStatementInternal* aOwningStatement) : mOwningStatement(aOwningStatement), mLocked(false) {} void BindingParamsArray::lock() { @@ -27,7 +27,7 @@ void BindingParamsArray::lock() { mOwningStatement = nullptr; } -const StorageBaseStatementInternal *BindingParamsArray::getOwner() const { +const StorageBaseStatementInternal* BindingParamsArray::getOwner() const { return mOwningStatement; } @@ -37,7 +37,7 @@ NS_IMPL_ISUPPORTS(BindingParamsArray, mozIStorageBindingParamsArray) //// mozIStorageBindingParamsArray NS_IMETHODIMP -BindingParamsArray::NewBindingParams(mozIStorageBindingParams **_params) { +BindingParamsArray::NewBindingParams(mozIStorageBindingParams** _params) { NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED); nsCOMPtr params( @@ -49,10 +49,10 @@ BindingParamsArray::NewBindingParams(mozIStorageBindingParams **_params) { } NS_IMETHODIMP -BindingParamsArray::AddParams(mozIStorageBindingParams *aParameters) { +BindingParamsArray::AddParams(mozIStorageBindingParams* aParameters) { NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED); - BindingParams *params = static_cast(aParameters); + BindingParams* params = static_cast(aParameters); // Check to make sure that this set of parameters was created with us. if (params->getOwner() != this) return NS_ERROR_UNEXPECTED; @@ -66,7 +66,7 @@ BindingParamsArray::AddParams(mozIStorageBindingParams *aParameters) { } NS_IMETHODIMP -BindingParamsArray::GetLength(uint32_t *_length) { +BindingParamsArray::GetLength(uint32_t* _length) { *_length = length(); return NS_OK; } diff --git a/storage/mozStorageBindingParamsArray.h b/storage/mozStorageBindingParamsArray.h index 381e275eb38ce..ced56285e118b 100644 --- a/storage/mozStorageBindingParamsArray.h +++ b/storage/mozStorageBindingParamsArray.h @@ -27,7 +27,7 @@ class BindingParamsArray final : public mozIStorageBindingParamsArray { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_MOZISTORAGEBINDINGPARAMSARRAY - explicit BindingParamsArray(StorageBaseStatementInternal *aOwningStatement); + explicit BindingParamsArray(StorageBaseStatementInternal* aOwningStatement); typedef array_type::size_type size_type; @@ -40,7 +40,7 @@ class BindingParamsArray final : public mozIStorageBindingParamsArray { /** * @return the pointer to the owning BindingParamsArray. */ - const StorageBaseStatementInternal *getOwner() const; + const StorageBaseStatementInternal* getOwner() const; /** * @return the number of elemets the array contains. @@ -49,19 +49,19 @@ class BindingParamsArray final : public mozIStorageBindingParamsArray { class iterator { public: - iterator(BindingParamsArray *aArray, uint32_t aIndex) + iterator(BindingParamsArray* aArray, uint32_t aIndex) : mArray(aArray), mIndex(aIndex) {} - iterator &operator++(int) { + iterator& operator++(int) { mIndex++; return *this; } - bool operator==(const iterator &aOther) const { + bool operator==(const iterator& aOther) const { return mIndex == aOther.mIndex; } - bool operator!=(const iterator &aOther) const { return !(*this == aOther); } - mozIStorageBindingParams *operator*() { + bool operator!=(const iterator& aOther) const { return !(*this == aOther); } + mozIStorageBindingParams* operator*() { NS_ASSERTION(mIndex < mArray->length(), "Dereferenceing an invalid value!"); return mArray->mArray[mIndex].get(); @@ -69,7 +69,7 @@ class BindingParamsArray final : public mozIStorageBindingParamsArray { private: void operator--() {} - BindingParamsArray *mArray; + BindingParamsArray* mArray; uint32_t mIndex; }; diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index fef2f52768402..371cc5797a217 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -76,7 +76,7 @@ namespace storage { using mozilla::dom::quota::QuotaObject; -const char *GetVFSName(); +const char* GetVFSName(); namespace { @@ -118,27 +118,27 @@ int nsresultToSQLiteResult(nsresult aXPCOMResultCode) { //////////////////////////////////////////////////////////////////////////////// //// Variant Specialization Functions (variantToSQLiteT) -int sqlite3_T_int(sqlite3_context *aCtx, int aValue) { +int sqlite3_T_int(sqlite3_context* aCtx, int aValue) { ::sqlite3_result_int(aCtx, aValue); return SQLITE_OK; } -int sqlite3_T_int64(sqlite3_context *aCtx, sqlite3_int64 aValue) { +int sqlite3_T_int64(sqlite3_context* aCtx, sqlite3_int64 aValue) { ::sqlite3_result_int64(aCtx, aValue); return SQLITE_OK; } -int sqlite3_T_double(sqlite3_context *aCtx, double aValue) { +int sqlite3_T_double(sqlite3_context* aCtx, double aValue) { ::sqlite3_result_double(aCtx, aValue); return SQLITE_OK; } -int sqlite3_T_text(sqlite3_context *aCtx, const nsCString &aValue) { +int sqlite3_T_text(sqlite3_context* aCtx, const nsCString& aValue) { ::sqlite3_result_text(aCtx, aValue.get(), aValue.Length(), SQLITE_TRANSIENT); return SQLITE_OK; } -int sqlite3_T_text16(sqlite3_context *aCtx, const nsString &aValue) { +int sqlite3_T_text16(sqlite3_context* aCtx, const nsString& aValue) { ::sqlite3_result_text16( aCtx, aValue.get(), aValue.Length() * sizeof(char16_t), // Number of bytes. @@ -146,12 +146,12 @@ int sqlite3_T_text16(sqlite3_context *aCtx, const nsString &aValue) { return SQLITE_OK; } -int sqlite3_T_null(sqlite3_context *aCtx) { +int sqlite3_T_null(sqlite3_context* aCtx) { ::sqlite3_result_null(aCtx); return SQLITE_OK; } -int sqlite3_T_blob(sqlite3_context *aCtx, const void *aData, int aSize) { +int sqlite3_T_blob(sqlite3_context* aCtx, const void* aData, int aSize) { ::sqlite3_result_blob(aCtx, aData, aSize, free); return SQLITE_OK; } @@ -162,8 +162,8 @@ int sqlite3_T_blob(sqlite3_context *aCtx, const void *aData, int aSize) { //// Modules struct Module { - const char *name; - int (*registerFunc)(sqlite3 *, const char *); + const char* name; + int (*registerFunc)(sqlite3*, const char*); }; Module gModules[] = {{"filesystem", RegisterFileSystemModule}}; @@ -171,20 +171,20 @@ Module gModules[] = {{"filesystem", RegisterFileSystemModule}}; //////////////////////////////////////////////////////////////////////////////// //// Local Functions -int tracefunc(unsigned aReason, void *aClosure, void *aP, void *aX) { +int tracefunc(unsigned aReason, void* aClosure, void* aP, void* aX) { switch (aReason) { case SQLITE_TRACE_STMT: { // aP is a pointer to the prepared statement. - sqlite3_stmt *stmt = static_cast(aP); + sqlite3_stmt* stmt = static_cast(aP); // aX is a pointer to a string containing the unexpanded SQL or a comment, // starting with "--"" in case of a trigger. - char *expanded = static_cast(aX); + char* expanded = static_cast(aX); // Simulate what sqlite_trace was doing. if (!::strncmp(expanded, "--", 2)) { MOZ_LOG(gStorageLog, LogLevel::Debug, ("TRACE_STMT on %p: '%s'", aClosure, expanded)); } else { - char *sql = ::sqlite3_expanded_sql(stmt); + char* sql = ::sqlite3_expanded_sql(stmt); MOZ_LOG(gStorageLog, LogLevel::Debug, ("TRACE_STMT on %p: '%s'", aClosure, sql)); ::sqlite3_free(sql); @@ -194,7 +194,7 @@ int tracefunc(unsigned aReason, void *aClosure, void *aP, void *aX) { case SQLITE_TRACE_PROFILE: { // aX is pointer to a 64bit integer containing nanoseconds it took to // execute the last command. - sqlite_int64 time = *(static_cast(aX)) / 1000000; + sqlite_int64 time = *(static_cast(aX)) / 1000000; if (time > 0) { MOZ_LOG(gStorageLog, LogLevel::Debug, ("TRACE_TIME on %p: %lldms", aClosure, time)); @@ -205,11 +205,11 @@ int tracefunc(unsigned aReason, void *aClosure, void *aP, void *aX) { return 0; } -void basicFunctionHelper(sqlite3_context *aCtx, int aArgc, - sqlite3_value **aArgv) { - void *userData = ::sqlite3_user_data(aCtx); +void basicFunctionHelper(sqlite3_context* aCtx, int aArgc, + sqlite3_value** aArgv) { + void* userData = ::sqlite3_user_data(aCtx); - mozIStorageFunction *func = static_cast(userData); + mozIStorageFunction* func = static_cast(userData); RefPtr arguments(new ArgValueArray(aArgc, aArgv)); if (!arguments) return; @@ -236,11 +236,11 @@ void basicFunctionHelper(sqlite3_context *aCtx, int aArgc, } } -void aggregateFunctionStepHelper(sqlite3_context *aCtx, int aArgc, - sqlite3_value **aArgv) { - void *userData = ::sqlite3_user_data(aCtx); - mozIStorageAggregateFunction *func = - static_cast(userData); +void aggregateFunctionStepHelper(sqlite3_context* aCtx, int aArgc, + sqlite3_value** aArgv) { + void* userData = ::sqlite3_user_data(aCtx); + mozIStorageAggregateFunction* func = + static_cast(userData); RefPtr arguments(new ArgValueArray(aArgc, aArgv)); if (!arguments) return; @@ -249,10 +249,10 @@ void aggregateFunctionStepHelper(sqlite3_context *aCtx, int aArgc, NS_WARNING("User aggregate step function returned error code!"); } -void aggregateFunctionFinalHelper(sqlite3_context *aCtx) { - void *userData = ::sqlite3_user_data(aCtx); - mozIStorageAggregateFunction *func = - static_cast(userData); +void aggregateFunctionFinalHelper(sqlite3_context* aCtx) { + void* userData = ::sqlite3_user_data(aCtx); + mozIStorageAggregateFunction* func = + static_cast(userData); RefPtr result; if (NS_FAILED(func->OnFinal(getter_AddRefs(result)))) { @@ -299,15 +299,15 @@ class UnlockNotification { bool mSignaled; }; -void UnlockNotifyCallback(void **aArgs, int aArgsSize) { +void UnlockNotifyCallback(void** aArgs, int aArgsSize) { for (int i = 0; i < aArgsSize; i++) { - UnlockNotification *notification = - static_cast(aArgs[i]); + UnlockNotification* notification = + static_cast(aArgs[i]); notification->Signal(); } } -int WaitForUnlockNotify(sqlite3 *aDatabase) { +int WaitForUnlockNotify(sqlite3* aDatabase) { UnlockNotification notification; int srv = ::sqlite3_unlock_notify(aDatabase, UnlockNotifyCallback, ¬ification); @@ -324,8 +324,8 @@ int WaitForUnlockNotify(sqlite3 *aDatabase) { class AsyncCloseConnection final : public Runnable { public: - AsyncCloseConnection(Connection *aConnection, sqlite3 *aNativeConnection, - nsIRunnable *aCallbackEvent) + AsyncCloseConnection(Connection* aConnection, sqlite3* aNativeConnection, + nsIRunnable* aCallbackEvent) : Runnable("storage::AsyncCloseConnection"), mConnection(aConnection), mNativeConnection(aNativeConnection), @@ -362,7 +362,7 @@ class AsyncCloseConnection final : public Runnable { private: RefPtr mConnection; - sqlite3 *mNativeConnection; + sqlite3* mNativeConnection; nsCOMPtr mCallbackEvent; }; @@ -381,9 +381,9 @@ class AsyncInitializeClone final : public Runnable { * is complete. This event will be called on * aClone->threadOpenedOn. */ - AsyncInitializeClone(Connection *aConnection, Connection *aClone, + AsyncInitializeClone(Connection* aConnection, Connection* aClone, const bool aReadOnly, - mozIStorageCompletionCallback *aCallback) + mozIStorageCompletionCallback* aCallback) : Runnable("storage::AsyncInitializeClone"), mConnection(aConnection), mClone(aClone), @@ -399,11 +399,11 @@ class AsyncInitializeClone final : public Runnable { return Dispatch(rv, nullptr); } return Dispatch(NS_OK, - NS_ISUPPORTS_CAST(mozIStorageAsyncConnection *, mClone)); + NS_ISUPPORTS_CAST(mozIStorageAsyncConnection*, mClone)); } private: - nsresult Dispatch(nsresult aResult, nsISupports *aValue) { + nsresult Dispatch(nsresult aResult, nsISupports* aValue) { RefPtr event = new CallbackComplete(aResult, aValue, mCallback.forget()); return mClone->threadOpenedOn->Dispatch(event, NS_DISPATCH_NORMAL); @@ -440,7 +440,7 @@ class CloseListener final : public mozIStorageCompletionCallback { NS_DECL_ISUPPORTS CloseListener() : mClosed(false) {} - NS_IMETHOD Complete(nsresult, nsISupports *) override { + NS_IMETHOD Complete(nsresult, nsISupports*) override { mClosed = true; return NS_OK; } @@ -458,7 +458,7 @@ NS_IMPL_ISUPPORTS(CloseListener, mozIStorageCompletionCallback) //////////////////////////////////////////////////////////////////////////////// //// Connection -Connection::Connection(Service *aService, int aFlags, +Connection::Connection(Service* aService, int aFlags, ConnectionOperation aSupportedOperations, bool aIgnoreLockingMode) : sharedAsyncExecutionMutex("Connection::sharedAsyncExecutionMutex"), @@ -563,7 +563,7 @@ NS_IMETHODIMP_(MozExternalRefCountType) Connection::Release(void) { } int32_t Connection::getSqliteRuntimeStatus(int32_t aStatusOption, - int32_t *aMaxValue) { + int32_t* aMaxValue) { MOZ_ASSERT(connectionReady(), "A connection must exist at this point"); int curr = 0, max = 0; DebugOnly rc = @@ -573,7 +573,7 @@ int32_t Connection::getSqliteRuntimeStatus(int32_t aStatusOption, return curr; } -nsIEventTarget *Connection::getAsyncExecutionTarget() { +nsIEventTarget* Connection::getAsyncExecutionTarget() { NS_ENSURE_TRUE(threadOpenedOn == NS_GetCurrentThread(), nullptr); // Don't return the asynchronous thread if we are shutting down. @@ -624,7 +624,7 @@ nsresult Connection::initialize() { return NS_OK; } -nsresult Connection::initialize(nsIFile *aDatabaseFile) { +nsresult Connection::initialize(nsIFile* aDatabaseFile) { NS_ASSERTION(aDatabaseFile, "Passed null file!"); NS_ASSERTION(!connectionReady(), "Initialize called on already opened database!"); @@ -637,11 +637,11 @@ nsresult Connection::initialize(nsIFile *aDatabaseFile) { NS_ENSURE_SUCCESS(rv, rv); #ifdef XP_WIN - static const char *sIgnoreLockingVFS = "win32-none"; + static const char* sIgnoreLockingVFS = "win32-none"; #else - static const char *sIgnoreLockingVFS = "unix-none"; + static const char* sIgnoreLockingVFS = "unix-none"; #endif - const char *vfs = mIgnoreLockingMode ? sIgnoreLockingVFS : GetVFSName(); + const char* vfs = mIgnoreLockingMode ? sIgnoreLockingVFS : GetVFSName(); int srv = ::sqlite3_open_v2(NS_ConvertUTF16toUTF8(path).get(), &mDBConn, mFlags, vfs); @@ -667,7 +667,7 @@ nsresult Connection::initialize(nsIFile *aDatabaseFile) { return NS_OK; } -nsresult Connection::initialize(nsIFileURL *aFileURL) { +nsresult Connection::initialize(nsIFileURL* aFileURL) { NS_ASSERTION(aFileURL, "Passed null file URL!"); NS_ASSERTION(!connectionReady(), "Initialize called on already opened database!"); @@ -710,10 +710,10 @@ nsresult Connection::initializeInternal() { auto guard = MakeScopeExit([&]() { initializeFailed(); }); if (mFileURL) { - const char *dbPath = ::sqlite3_db_filename(mDBConn, "main"); + const char* dbPath = ::sqlite3_db_filename(mDBConn, "main"); MOZ_ASSERT(dbPath); - const char *telemetryFilename = + const char* telemetryFilename = ::sqlite3_uri_parameter(dbPath, "telemetryFilename"); if (telemetryFilename) { if (NS_WARN_IF(*telemetryFilename == '\0')) { @@ -802,7 +802,7 @@ nsresult Connection::initializeInternal() { return NS_OK; } -nsresult Connection::initializeOnAsyncThread(nsIFile *aStorageFile) { +nsresult Connection::initializeOnAsyncThread(nsIFile* aStorageFile) { MOZ_ASSERT(threadOpenedOn != NS_GetCurrentThread()); nsresult rv = aStorageFile ? initialize(aStorageFile) : initialize(); if (NS_FAILED(rv)) { @@ -828,8 +828,8 @@ void Connection::initializeFailed() { } nsresult Connection::databaseElementExists( - enum DatabaseElementType aElementType, const nsACString &aElementName, - bool *_exists) { + enum DatabaseElementType aElementType, const nsACString& aElementName, + bool* _exists) { if (!connectionReady()) { return NS_ERROR_NOT_AVAILABLE; } @@ -867,7 +867,7 @@ nsresult Connection::databaseElementExists( query.Append(element); query.Append('\''); - sqlite3_stmt *stmt; + sqlite3_stmt* stmt; int srv = prepareStatement(mDBConn, query, &stmt); if (srv != SQLITE_OK) return convertResultCode(srv); @@ -887,7 +887,7 @@ nsresult Connection::databaseElementExists( return convertResultCode(srv); } -bool Connection::findFunctionByInstance(nsISupports *aInstance) { +bool Connection::findFunctionByInstance(nsISupports* aInstance) { sharedDBMutex.assertCurrentThreadOwns(); for (auto iter = mFunctions.Iter(); !iter.Done(); iter.Next()) { @@ -899,8 +899,8 @@ bool Connection::findFunctionByInstance(nsISupports *aInstance) { } /* static */ -int Connection::sProgressHelper(void *aArg) { - Connection *_this = static_cast(aArg); +int Connection::sProgressHelper(void* aArg) { + Connection* _this = static_cast(aArg); return _this->progressHandler(); } @@ -985,7 +985,7 @@ bool Connection::isClosed() { return mConnectionClosed; } -bool Connection::isClosed(MutexAutoLock &lock) { return mConnectionClosed; } +bool Connection::isClosed(MutexAutoLock& lock) { return mConnectionClosed; } bool Connection::isAsyncExecutionThreadAvailable() { MOZ_ASSERT(threadOpenedOn == NS_GetCurrentThread()); @@ -1001,7 +1001,7 @@ void Connection::shutdownAsyncThread() { mAsyncExecutionThread = nullptr; } -nsresult Connection::internalClose(sqlite3 *aNativeConnection) { +nsresult Connection::internalClose(sqlite3* aNativeConnection) { #ifdef DEBUG { // Make sure we have marked our async thread as shutting down. MutexAutoLock lockedScope(sharedAsyncExecutionMutex); @@ -1040,7 +1040,7 @@ nsresult Connection::internalClose(sqlite3 *aNativeConnection) { // are done here. SQLiteMutexAutoLock lockedScope(sharedDBMutex); // We still have non-finalized statements. Finalize them. - sqlite3_stmt *stmt = nullptr; + sqlite3_stmt* stmt = nullptr; while ((stmt = ::sqlite3_next_stmt(aNativeConnection, stmt))) { MOZ_LOG(gStorageLog, LogLevel::Debug, ("Auto-finalizing SQL statement '%s' (%p)", ::sqlite3_sql(stmt), @@ -1101,8 +1101,8 @@ nsCString Connection::getFilename() { return leafname; } -int Connection::stepStatement(sqlite3 *aNativeConnection, - sqlite3_stmt *aStatement) { +int Connection::stepStatement(sqlite3* aNativeConnection, + sqlite3_stmt* aStatement) { MOZ_ASSERT(aStatement); AUTO_PROFILER_LABEL_DYNAMIC_CSTR("Connection::stepStatement", OTHER, @@ -1154,8 +1154,8 @@ int Connection::stepStatement(sqlite3 *aNativeConnection, return srv & 0xFF; } -int Connection::prepareStatement(sqlite3 *aNativeConnection, - const nsCString &aSQL, sqlite3_stmt **_stmt) { +int Connection::prepareStatement(sqlite3* aNativeConnection, + const nsCString& aSQL, sqlite3_stmt** _stmt) { // We should not even try to prepare statements after the connection has // been closed. if (!isConnectionReadyOnThisThread()) return SQLITE_MISUSE; @@ -1207,7 +1207,7 @@ int Connection::prepareStatement(sqlite3 *aNativeConnection, return rc; } -int Connection::executeSql(sqlite3 *aNativeConnection, const char *aSqlString) { +int Connection::executeSql(sqlite3* aNativeConnection, const char* aSqlString) { if (!isConnectionReadyOnThisThread()) return SQLITE_MISUSE; AUTO_PROFILER_LABEL_DYNAMIC_CSTR("Connection::executeSql", OTHER, aSqlString); @@ -1234,9 +1234,9 @@ int Connection::executeSql(sqlite3 *aNativeConnection, const char *aSqlString) { //// nsIInterfaceRequestor NS_IMETHODIMP -Connection::GetInterface(const nsIID &aIID, void **_result) { +Connection::GetInterface(const nsIID& aIID, void** _result) { if (aIID.Equals(NS_GET_IID(nsIEventTarget))) { - nsIEventTarget *background = getAsyncExecutionTarget(); + nsIEventTarget* background = getAsyncExecutionTarget(); NS_IF_ADDREF(background); *_result = background; return NS_OK; @@ -1291,7 +1291,7 @@ nsresult Connection::synchronousClose() { // setClosedState nullifies our connection pointer, so we take a raw pointer // off it, to pass it through the close procedure. - sqlite3 *nativeConn = mDBConn; + sqlite3* nativeConn = mDBConn; nsresult rv = setClosedState(); NS_ENSURE_SUCCESS(rv, rv); @@ -1326,7 +1326,7 @@ Connection::SpinningSynchronousClose() { } NS_IMETHODIMP -Connection::AsyncClose(mozIStorageCompletionCallback *aCallback) { +Connection::AsyncClose(mozIStorageCompletionCallback* aCallback) { NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_NOT_SAME_THREAD); // Check if AsyncClose or Close were already invoked. if (!connectionReady()) { @@ -1381,7 +1381,7 @@ Connection::AsyncClose(mozIStorageCompletionCallback *aCallback) { // getAsyncExecutionTarget() to avoid wastefully creating a thread just to // shut it down. But this complicates the method for broken caller code // whereas we're still correct and safe without the special-case. - nsIEventTarget *asyncThread = getAsyncExecutionTarget(); + nsIEventTarget* asyncThread = getAsyncExecutionTarget(); // Create our callback event if we were given a callback. This will // eventually be dispatched in all cases, even if we fall back to Close() and @@ -1415,7 +1415,7 @@ Connection::AsyncClose(mozIStorageCompletionCallback *aCallback) { // setClosedState nullifies our connection pointer, so we take a raw pointer // off it, to pass it through the close procedure. - sqlite3 *nativeConn = mDBConn; + sqlite3* nativeConn = mDBConn; rv = setClosedState(); NS_ENSURE_SUCCESS(rv, rv); @@ -1430,7 +1430,7 @@ Connection::AsyncClose(mozIStorageCompletionCallback *aCallback) { NS_IMETHODIMP Connection::AsyncClone(bool aReadOnly, - mozIStorageCompletionCallback *aCallback) { + mozIStorageCompletionCallback* aCallback) { AUTO_PROFILER_LABEL("Connection::AsyncClone", OTHER); NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_NOT_SAME_THREAD); @@ -1468,7 +1468,7 @@ Connection::AsyncClone(bool aReadOnly, return target->Dispatch(initEvent, NS_DISPATCH_NORMAL); } -nsresult Connection::initializeClone(Connection *aClone, bool aReadOnly) { +nsresult Connection::initializeClone(Connection* aClone, bool aReadOnly) { nsresult rv = mFileURL ? aClone->initialize(mFileURL) : aClone->initialize(mDatabaseFile); if (NS_FAILED(rv)) { @@ -1515,10 +1515,10 @@ nsresult Connection::initializeClone(Connection *aClone, bool aReadOnly) { // LIMITATION WARNING! Many of these pragmas are actually scoped to the // schema ("main" and any other attached databases), and this implmentation // fails to propagate them. This is being addressed on trunk. - static const char *pragmas[] = { + static const char* pragmas[] = { "cache_size", "temp_store", "foreign_keys", "journal_size_limit", "synchronous", "wal_autocheckpoint", "busy_timeout"}; - for (auto &pragma : pragmas) { + for (auto& pragma : pragmas) { // Read-only connections just need cache_size and temp_store pragmas. if (aReadOnly && ::strcmp(pragma, "cache_size") != 0 && ::strcmp(pragma, "temp_store") != 0) { @@ -1582,7 +1582,7 @@ nsresult Connection::initializeClone(Connection *aClone, bool aReadOnly) { // Copy any functions that have been added to this connection. SQLiteMutexAutoLock lockedScope(sharedDBMutex); for (auto iter = mFunctions.Iter(); !iter.Done(); iter.Next()) { - const nsACString &key = iter.Key(); + const nsACString& key = iter.Key(); Connection::FunctionInfo data = iter.UserData(); MOZ_ASSERT(data.type == Connection::FunctionInfo::SIMPLE || @@ -1590,16 +1590,16 @@ nsresult Connection::initializeClone(Connection *aClone, bool aReadOnly) { "Invalid function type!"); if (data.type == Connection::FunctionInfo::SIMPLE) { - mozIStorageFunction *function = - static_cast(data.function.get()); + mozIStorageFunction* function = + static_cast(data.function.get()); rv = aClone->CreateFunction(key, data.numArgs, function); if (NS_FAILED(rv)) { NS_WARNING("Failed to copy function to cloned connection"); } } else { - mozIStorageAggregateFunction *function = - static_cast(data.function.get()); + mozIStorageAggregateFunction* function = + static_cast(data.function.get()); rv = aClone->CreateAggregateFunction(key, data.numArgs, function); if (NS_FAILED(rv)) { NS_WARNING("Failed to copy aggregate function to cloned connection"); @@ -1612,7 +1612,7 @@ nsresult Connection::initializeClone(Connection *aClone, bool aReadOnly) { } NS_IMETHODIMP -Connection::Clone(bool aReadOnly, mozIStorageConnection **_connection) { +Connection::Clone(bool aReadOnly, mozIStorageConnection** _connection) { MOZ_ASSERT(threadOpenedOn == NS_GetCurrentThread()); AUTO_PROFILER_LABEL("Connection::Clone", OTHER); @@ -1662,20 +1662,20 @@ Connection::Interrupt() { } NS_IMETHODIMP -Connection::GetDefaultPageSize(int32_t *_defaultPageSize) { +Connection::GetDefaultPageSize(int32_t* _defaultPageSize) { *_defaultPageSize = Service::getDefaultPageSize(); return NS_OK; } NS_IMETHODIMP -Connection::GetConnectionReady(bool *_ready) { +Connection::GetConnectionReady(bool* _ready) { MOZ_ASSERT(threadOpenedOn == NS_GetCurrentThread()); *_ready = connectionReady(); return NS_OK; } NS_IMETHODIMP -Connection::GetDatabaseFile(nsIFile **_dbFile) { +Connection::GetDatabaseFile(nsIFile** _dbFile) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -1690,7 +1690,7 @@ Connection::GetDatabaseFile(nsIFile **_dbFile) { } NS_IMETHODIMP -Connection::GetLastInsertRowID(int64_t *_id) { +Connection::GetLastInsertRowID(int64_t* _id) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -1706,7 +1706,7 @@ Connection::GetLastInsertRowID(int64_t *_id) { } NS_IMETHODIMP -Connection::GetAffectedRows(int32_t *_rows) { +Connection::GetAffectedRows(int32_t* _rows) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -1721,7 +1721,7 @@ Connection::GetAffectedRows(int32_t *_rows) { } NS_IMETHODIMP -Connection::GetLastError(int32_t *_error) { +Connection::GetLastError(int32_t* _error) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -1736,7 +1736,7 @@ Connection::GetLastError(int32_t *_error) { } NS_IMETHODIMP -Connection::GetLastErrorString(nsACString &_errorString) { +Connection::GetLastErrorString(nsACString& _errorString) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -1745,14 +1745,14 @@ Connection::GetLastErrorString(nsACString &_errorString) { return rv; } - const char *serr = ::sqlite3_errmsg(mDBConn); + const char* serr = ::sqlite3_errmsg(mDBConn); _errorString.Assign(serr); return NS_OK; } NS_IMETHODIMP -Connection::GetSchemaVersion(int32_t *_version) { +Connection::GetSchemaVersion(int32_t* _version) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -1791,8 +1791,8 @@ Connection::SetSchemaVersion(int32_t aVersion) { } NS_IMETHODIMP -Connection::CreateStatement(const nsACString &aSQLStatement, - mozIStorageStatement **_stmt) { +Connection::CreateStatement(const nsACString& aSQLStatement, + mozIStorageStatement** _stmt) { NS_ENSURE_ARG_POINTER(_stmt); if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; @@ -1808,15 +1808,15 @@ Connection::CreateStatement(const nsACString &aSQLStatement, rv = statement->initialize(this, mDBConn, aSQLStatement); NS_ENSURE_SUCCESS(rv, rv); - Statement *rawPtr; + Statement* rawPtr; statement.forget(&rawPtr); *_stmt = rawPtr; return NS_OK; } NS_IMETHODIMP -Connection::CreateAsyncStatement(const nsACString &aSQLStatement, - mozIStorageAsyncStatement **_stmt) { +Connection::CreateAsyncStatement(const nsACString& aSQLStatement, + mozIStorageAsyncStatement** _stmt) { NS_ENSURE_ARG_POINTER(_stmt); if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; @@ -1832,14 +1832,14 @@ Connection::CreateAsyncStatement(const nsACString &aSQLStatement, rv = statement->initialize(this, mDBConn, aSQLStatement); NS_ENSURE_SUCCESS(rv, rv); - AsyncStatement *rawPtr; + AsyncStatement* rawPtr; statement.forget(&rawPtr); *_stmt = rawPtr; return NS_OK; } NS_IMETHODIMP -Connection::ExecuteSimpleSQL(const nsACString &aSQLStatement) { +Connection::ExecuteSimpleSQL(const nsACString& aSQLStatement) { CHECK_MAINTHREAD_ABUSE(); if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; @@ -1854,10 +1854,10 @@ Connection::ExecuteSimpleSQL(const nsACString &aSQLStatement) { } NS_IMETHODIMP -Connection::ExecuteAsync(mozIStorageBaseStatement **aStatements, +Connection::ExecuteAsync(mozIStorageBaseStatement** aStatements, uint32_t aNumStatements, - mozIStorageStatementCallback *aCallback, - mozIStoragePendingStatement **_handle) { + mozIStorageStatementCallback* aCallback, + mozIStoragePendingStatement** _handle) { nsTArray stmts(aNumStatements); for (uint32_t i = 0; i < aNumStatements; i++) { nsCOMPtr stmt = @@ -1881,9 +1881,9 @@ Connection::ExecuteAsync(mozIStorageBaseStatement **aStatements, } NS_IMETHODIMP -Connection::ExecuteSimpleSQLAsync(const nsACString &aSQLStatement, - mozIStorageStatementCallback *aCallback, - mozIStoragePendingStatement **_handle) { +Connection::ExecuteSimpleSQLAsync(const nsACString& aSQLStatement, + mozIStorageStatementCallback* aCallback, + mozIStoragePendingStatement** _handle) { NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_NOT_SAME_THREAD); nsCOMPtr stmt; @@ -1903,17 +1903,17 @@ Connection::ExecuteSimpleSQLAsync(const nsACString &aSQLStatement, } NS_IMETHODIMP -Connection::TableExists(const nsACString &aTableName, bool *_exists) { +Connection::TableExists(const nsACString& aTableName, bool* _exists) { return databaseElementExists(TABLE, aTableName, _exists); } NS_IMETHODIMP -Connection::IndexExists(const nsACString &aIndexName, bool *_exists) { +Connection::IndexExists(const nsACString& aIndexName, bool* _exists) { return databaseElementExists(INDEX, aIndexName, _exists); } NS_IMETHODIMP -Connection::GetTransactionInProgress(bool *_inProgress) { +Connection::GetTransactionInProgress(bool* _inProgress) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -1928,7 +1928,7 @@ Connection::GetTransactionInProgress(bool *_inProgress) { } NS_IMETHODIMP -Connection::GetDefaultTransactionType(int32_t *_type) { +Connection::GetDefaultTransactionType(int32_t* _type) { *_type = mDefaultTransactionType; return NS_OK; } @@ -1953,7 +1953,7 @@ Connection::BeginTransaction() { return beginTransactionInternal(mDBConn, mDefaultTransactionType); } -nsresult Connection::beginTransactionInternal(sqlite3 *aNativeConnection, +nsresult Connection::beginTransactionInternal(sqlite3* aNativeConnection, int32_t aTransactionType) { SQLiteMutexAutoLock lockedScope(sharedDBMutex); if (mTransactionInProgress) return NS_ERROR_FAILURE; @@ -1988,7 +1988,7 @@ Connection::CommitTransaction() { return commitTransactionInternal(mDBConn); } -nsresult Connection::commitTransactionInternal(sqlite3 *aNativeConnection) { +nsresult Connection::commitTransactionInternal(sqlite3* aNativeConnection) { SQLiteMutexAutoLock lockedScope(sharedDBMutex); if (!mTransactionInProgress) return NS_ERROR_UNEXPECTED; nsresult rv = @@ -2010,7 +2010,7 @@ Connection::RollbackTransaction() { return rollbackTransactionInternal(mDBConn); } -nsresult Connection::rollbackTransactionInternal(sqlite3 *aNativeConnection) { +nsresult Connection::rollbackTransactionInternal(sqlite3* aNativeConnection) { SQLiteMutexAutoLock lockedScope(sharedDBMutex); if (!mTransactionInProgress) return NS_ERROR_UNEXPECTED; @@ -2021,7 +2021,7 @@ nsresult Connection::rollbackTransactionInternal(sqlite3 *aNativeConnection) { } NS_IMETHODIMP -Connection::CreateTable(const char *aTableName, const char *aTableSchema) { +Connection::CreateTable(const char* aTableName, const char* aTableSchema) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -2040,9 +2040,9 @@ Connection::CreateTable(const char *aTableName, const char *aTableSchema) { } NS_IMETHODIMP -Connection::CreateFunction(const nsACString &aFunctionName, +Connection::CreateFunction(const nsACString& aFunctionName, int32_t aNumArguments, - mozIStorageFunction *aFunction) { + mozIStorageFunction* aFunction) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -2069,9 +2069,9 @@ Connection::CreateFunction(const nsACString &aFunctionName, } NS_IMETHODIMP -Connection::CreateAggregateFunction(const nsACString &aFunctionName, +Connection::CreateAggregateFunction(const nsACString& aFunctionName, int32_t aNumArguments, - mozIStorageAggregateFunction *aFunction) { + mozIStorageAggregateFunction* aFunction) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -2103,7 +2103,7 @@ Connection::CreateAggregateFunction(const nsACString &aFunctionName, } NS_IMETHODIMP -Connection::RemoveFunction(const nsACString &aFunctionName) { +Connection::RemoveFunction(const nsACString& aFunctionName) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -2127,8 +2127,8 @@ Connection::RemoveFunction(const nsACString &aFunctionName) { NS_IMETHODIMP Connection::SetProgressHandler(int32_t aGranularity, - mozIStorageProgressHandler *aHandler, - mozIStorageProgressHandler **_oldHandler) { + mozIStorageProgressHandler* aHandler, + mozIStorageProgressHandler** _oldHandler) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -2152,7 +2152,7 @@ Connection::SetProgressHandler(int32_t aGranularity, } NS_IMETHODIMP -Connection::RemoveProgressHandler(mozIStorageProgressHandler **_oldHandler) { +Connection::RemoveProgressHandler(mozIStorageProgressHandler** _oldHandler) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -2173,7 +2173,7 @@ Connection::RemoveProgressHandler(mozIStorageProgressHandler **_oldHandler) { NS_IMETHODIMP Connection::SetGrowthIncrement(int32_t aChunkSize, - const nsACString &aDatabaseName) { + const nsACString& aDatabaseName) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -2204,7 +2204,7 @@ Connection::SetGrowthIncrement(int32_t aChunkSize, } NS_IMETHODIMP -Connection::EnableModule(const nsACString &aModuleName) { +Connection::EnableModule(const nsACString& aModuleName) { if (!connectionReady()) { return NS_ERROR_NOT_INITIALIZED; } @@ -2213,8 +2213,8 @@ Connection::EnableModule(const nsACString &aModuleName) { return rv; } - for (auto &gModule : gModules) { - struct Module *m = &gModule; + for (auto& gModule : gModules) { + struct Module* m = &gModule; if (aModuleName.Equals(m->name)) { int srv = m->registerFunc(mDBConn, m->name); if (srv != SQLITE_OK) return convertResultCode(srv); @@ -2227,11 +2227,11 @@ Connection::EnableModule(const nsACString &aModuleName) { } // Implemented in TelemetryVFS.cpp -already_AddRefed GetQuotaObjectForFile(sqlite3_file *pFile); +already_AddRefed GetQuotaObjectForFile(sqlite3_file* pFile); NS_IMETHODIMP -Connection::GetQuotaObjects(QuotaObject **aDatabaseQuotaObject, - QuotaObject **aJournalQuotaObject) { +Connection::GetQuotaObjects(QuotaObject** aDatabaseQuotaObject, + QuotaObject** aJournalQuotaObject) { MOZ_ASSERT(aDatabaseQuotaObject); MOZ_ASSERT(aJournalQuotaObject); @@ -2243,7 +2243,7 @@ Connection::GetQuotaObjects(QuotaObject **aDatabaseQuotaObject, return rv; } - sqlite3_file *file; + sqlite3_file* file; int srv = ::sqlite3_file_control(mDBConn, nullptr, SQLITE_FCNTL_FILE_POINTER, &file); if (srv != SQLITE_OK) { diff --git a/storage/mozStorageConnection.h b/storage/mozStorageConnection.h index c683dc4712cab..41e7366ae48d9 100644 --- a/storage/mozStorageConnection.h +++ b/storage/mozStorageConnection.h @@ -83,7 +83,7 @@ class Connection final : public mozIStorageConnection, * corrupt) or produce wrong results without any indication that has * happened. */ - Connection(Service *aService, int aFlags, + Connection(Service* aService, int aFlags, ConnectionOperation aSupportedOperations, bool aIgnoreLockingMode = false); @@ -99,7 +99,7 @@ class Connection final : public mozIStorageConnection, * The nsIFile of the location of the database to open, or create if it * does not exist. */ - nsresult initialize(nsIFile *aDatabaseFile); + nsresult initialize(nsIFile* aDatabaseFile); /** * Creates the connection to the database. @@ -108,12 +108,12 @@ class Connection final : public mozIStorageConnection, * The nsIFileURL of the location of the database to open, or create if * it does not exist. */ - nsresult initialize(nsIFileURL *aFileURL); + nsresult initialize(nsIFileURL* aFileURL); /** * Same as initialize, but to be used on the async thread. */ - nsresult initializeOnAsyncThread(nsIFile *aStorageFile); + nsresult initializeOnAsyncThread(nsIFile* aStorageFile); /** * Fetches runtime status information for this connection. @@ -125,7 +125,7 @@ class Connection final : public mozIStorageConnection, * @return the current value for the specified option. */ int32_t getSqliteRuntimeStatus(int32_t aStatusOption, - int32_t *aMaxValue = nullptr); + int32_t* aMaxValue = nullptr); /** * Registers/unregisters a commit hook callback. * @@ -134,7 +134,7 @@ class Connection final : public mozIStorageConnection, * @param [optional] aData if provided, will be passed to the callback. * @see http://sqlite.org/c3ref/commit_hook.html */ - void setCommitHook(int (*aCallbackFn)(void *), void *aData = nullptr) { + void setCommitHook(int (*aCallbackFn)(void*), void* aData = nullptr) { MOZ_ASSERT(mDBConn, "A connection must exist at this point"); ::sqlite3_commit_hook(mDBConn, aCallbackFn, aData); }; @@ -156,7 +156,7 @@ class Connection final : public mozIStorageConnection, * @return an event target suitable for asynchronous statement execution. * @note This method will return null once AsyncClose() has been called. */ - nsIEventTarget *getAsyncExecutionTarget(); + nsIEventTarget* getAsyncExecutionTarget(); /** * Mutex used by asynchronous statements to protect state. The mutex is @@ -186,7 +186,7 @@ class Connection final : public mozIStorageConnection, /** * Closes the SQLite database, and warns about any non-finalized statements. */ - nsresult internalClose(sqlite3 *aDBConn); + nsresult internalClose(sqlite3* aDBConn); /** * Shuts down the passed-in async thread. @@ -209,8 +209,8 @@ class Connection final : public mozIStorageConnection, * New sqlite3_stmt object. * @return the result from sqlite3_prepare_v2. */ - int prepareStatement(sqlite3 *aNativeConnection, const nsCString &aSQL, - sqlite3_stmt **_stmt); + int prepareStatement(sqlite3* aNativeConnection, const nsCString& aSQL, + sqlite3_stmt** _stmt); /** * Performs a sqlite3_step on aStatement, while properly handling @@ -222,7 +222,7 @@ class Connection final : public mozIStorageConnection, * A pointer to a sqlite3_stmt object. * @return the result from sqlite3_step. */ - int stepStatement(sqlite3 *aNativeConnection, sqlite3_stmt *aStatement); + int stepStatement(sqlite3* aNativeConnection, sqlite3_stmt* aStatement); /** * Raw connection transaction management. @@ -230,10 +230,10 @@ class Connection final : public mozIStorageConnection, * @see BeginTransactionAs, CommitTransaction, RollbackTransaction. */ nsresult beginTransactionInternal( - sqlite3 *aNativeConnection, + sqlite3* aNativeConnection, int32_t aTransactionType = TRANSACTION_DEFERRED); - nsresult commitTransactionInternal(sqlite3 *aNativeConnection); - nsresult rollbackTransactionInternal(sqlite3 *aNativeConnection); + nsresult commitTransactionInternal(sqlite3* aNativeConnection); + nsresult rollbackTransactionInternal(sqlite3* aNativeConnection); /** * Indicates if this database connection is open. @@ -283,7 +283,7 @@ class Connection final : public mozIStorageConnection, * Same as isClosed(), but takes a proof-of-lock instead of locking * internally. */ - bool isClosed(MutexAutoLock &lock); + bool isClosed(MutexAutoLock& lock); /** * True if the async execution thread is alive and able to be used (i.e., it @@ -293,7 +293,7 @@ class Connection final : public mozIStorageConnection, */ bool isAsyncExecutionThreadAvailable(); - nsresult initializeClone(Connection *aClone, bool aReadOnly); + nsresult initializeClone(Connection* aClone, bool aReadOnly); private: ~Connection(); @@ -317,7 +317,7 @@ class Connection final : public mozIStorageConnection, * SQL string to execute * @return the result from sqlite3_exec. */ - int executeSql(sqlite3 *aNativeConnection, const char *aSqlString); + int executeSql(sqlite3* aNativeConnection, const char* aSqlString); /** * Describes a certain primitive type in the database. @@ -338,11 +338,11 @@ class Connection final : public mozIStorageConnection, * @returns true if element exists, false otherwise */ nsresult databaseElementExists(enum DatabaseElementType aElementType, - const nsACString &aElementName, bool *_exists); + const nsACString& aElementName, bool* _exists); - bool findFunctionByInstance(nsISupports *aInstance); + bool findFunctionByInstance(nsISupports* aInstance); - static int sProgressHelper(void *aArg); + static int sProgressHelper(void* aArg); // Generic progress handler // Dispatch call to registered progress handler, // if there is one. Do nothing in other cases. @@ -354,7 +354,7 @@ class Connection final : public mozIStorageConnection, */ nsresult ensureOperationSupported(ConnectionOperation aOperationType); - sqlite3 *mDBConn; + sqlite3* mDBConn; nsCOMPtr mFileURL; nsCOMPtr mDatabaseFile; @@ -465,7 +465,7 @@ class CallbackComplete final : public Runnable { * @param aCallback The callback. It must already be owned by the * main thread. */ - CallbackComplete(nsresult aStatus, nsISupports *aValue, + CallbackComplete(nsresult aStatus, nsISupports* aValue, already_AddRefed aCallback) : Runnable("storage::CallbackComplete"), mStatus(aStatus), @@ -498,8 +498,8 @@ class CallbackComplete final : public Runnable { * Casting Connection to nsISupports is ambiguous. * This method handles that. */ -inline nsISupports *ToSupports(mozilla::storage::Connection *p) { - return NS_ISUPPORTS_CAST(mozIStorageAsyncConnection *, p); +inline nsISupports* ToSupports(mozilla::storage::Connection* p) { + return NS_ISUPPORTS_CAST(mozIStorageAsyncConnection*, p); } #endif // mozilla_storage_Connection_h diff --git a/storage/mozStorageError.cpp b/storage/mozStorageError.cpp index 0f0bbfe13c1fb..89beccac381cd 100644 --- a/storage/mozStorageError.cpp +++ b/storage/mozStorageError.cpp @@ -12,7 +12,7 @@ namespace storage { //////////////////////////////////////////////////////////////////////////////// //// Error -Error::Error(int aResult, const char *aMessage) +Error::Error(int aResult, const char* aMessage) : mResult(aResult), mMessage(aMessage) {} /** @@ -25,13 +25,13 @@ NS_IMPL_ISUPPORTS(Error, mozIStorageError) //// mozIStorageError NS_IMETHODIMP -Error::GetResult(int32_t *_result) { +Error::GetResult(int32_t* _result) { *_result = mResult; return NS_OK; } NS_IMETHODIMP -Error::GetMessage(nsACString &_message) { +Error::GetMessage(nsACString& _message) { _message = mMessage; return NS_OK; } diff --git a/storage/mozStorageError.h b/storage/mozStorageError.h index 7fa3013f41507..07037fb4189fe 100644 --- a/storage/mozStorageError.h +++ b/storage/mozStorageError.h @@ -19,7 +19,7 @@ class Error final : public mozIStorageError { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_MOZISTORAGEERROR - Error(int aResult, const char *aMessage); + Error(int aResult, const char* aMessage); private: ~Error() {} diff --git a/storage/mozStoragePrivateHelpers.cpp b/storage/mozStoragePrivateHelpers.cpp index a9bf364d43d29..b8ef25ad39de3 100644 --- a/storage/mozStoragePrivateHelpers.cpp +++ b/storage/mozStoragePrivateHelpers.cpp @@ -77,13 +77,13 @@ nsresult convertResultCode(int aSQLiteResultCode) { return NS_ERROR_FAILURE; } -void checkAndLogStatementPerformance(sqlite3_stmt *aStatement) { +void checkAndLogStatementPerformance(sqlite3_stmt* aStatement) { // Check to see if the query performed sorting operations or not. If it // did, it may need to be optimized! int count = ::sqlite3_stmt_status(aStatement, SQLITE_STMTSTATUS_SORT, 1); if (count <= 0) return; - const char *sql = ::sqlite3_sql(aStatement); + const char* sql = ::sqlite3_sql(aStatement); // Check to see if this is marked to not warn if (::strstr(sql, "/* do not warn (bug ")) return; @@ -108,7 +108,7 @@ void checkAndLogStatementPerformance(sqlite3_stmt *aStatement) { NS_WARNING(message.get()); } -nsIVariant *convertJSValToVariant(JSContext *aCtx, const JS::Value &aValue) { +nsIVariant* convertJSValToVariant(JSContext* aCtx, const JS::Value& aValue) { if (aValue.isInt32()) return new IntegerVariant(aValue.toInt32()); if (aValue.isDouble()) return new FloatVariant(aValue.toDouble()); @@ -124,7 +124,7 @@ nsIVariant *convertJSValToVariant(JSContext *aCtx, const JS::Value &aValue) { if (aValue.isNull()) return new NullVariant(); if (aValue.isObject()) { - JS::Rooted obj(aCtx, &aValue.toObject()); + JS::Rooted obj(aCtx, &aValue.toObject()); // We only support Date instances, all others fail. bool valid; if (!js::DateIsValid(aCtx, obj, &valid) || !valid) return nullptr; @@ -141,7 +141,7 @@ nsIVariant *convertJSValToVariant(JSContext *aCtx, const JS::Value &aValue) { return nullptr; } -Variant_base *convertVariantToStorageVariant(nsIVariant *aVariant) { +Variant_base* convertVariantToStorageVariant(nsIVariant* aVariant) { RefPtr variant = do_QueryObject(aVariant); if (variant) { // JS helpers already convert the JS representation to a Storage Variant, @@ -198,12 +198,12 @@ Variant_base *convertVariantToStorageVariant(nsIVariant *aVariant) { uint16_t type; nsIID iid; uint32_t len; - void *rawArray; + void* rawArray; // Note this copies the array data. nsresult rv = aVariant->GetAsArray(&type, &iid, &len, &rawArray); NS_ENSURE_SUCCESS(rv, nullptr); if (type == nsIDataType::VTYPE_UINT8) { - std::pair v(static_cast(rawArray), len); + std::pair v(static_cast(rawArray), len); // Take ownership of the data avoiding a further copy. return new AdoptedBlobVariant(v); } @@ -227,7 +227,7 @@ Variant_base *convertVariantToStorageVariant(nsIVariant *aVariant) { namespace { class CallbackEvent : public Runnable { public: - explicit CallbackEvent(mozIStorageCompletionCallback *aCallback) + explicit CallbackEvent(mozIStorageCompletionCallback* aCallback) : Runnable("storage::CallbackEvent"), mCallback(aCallback) {} NS_IMETHOD Run() override { @@ -240,7 +240,7 @@ class CallbackEvent : public Runnable { }; } // namespace already_AddRefed newCompletionEvent( - mozIStorageCompletionCallback *aCallback) { + mozIStorageCompletionCallback* aCallback) { NS_ASSERTION(aCallback, "Passing a null callback is a no-no!"); nsCOMPtr event = new CallbackEvent(aCallback); return event.forget(); diff --git a/storage/mozStorageResultSet.cpp b/storage/mozStorageResultSet.cpp index edb5a9cf23631..8a0ae6abd36cd 100644 --- a/storage/mozStorageResultSet.cpp +++ b/storage/mozStorageResultSet.cpp @@ -17,7 +17,7 @@ ResultSet::ResultSet() : mCurrentIndex(0) {} ResultSet::~ResultSet() { mData.Clear(); } -nsresult ResultSet::add(mozIStorageRow *aRow) { +nsresult ResultSet::add(mozIStorageRow* aRow) { return mData.AppendObject(aRow) ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } @@ -31,7 +31,7 @@ NS_IMPL_ISUPPORTS(ResultSet, mozIStorageResultSet) //// mozIStorageResultSet NS_IMETHODIMP -ResultSet::GetNextRow(mozIStorageRow **_row) { +ResultSet::GetNextRow(mozIStorageRow** _row) { NS_ENSURE_ARG_POINTER(_row); if (mCurrentIndex >= mData.Count()) { diff --git a/storage/mozStorageResultSet.h b/storage/mozStorageResultSet.h index ebc04db73b66b..0716504378e5f 100644 --- a/storage/mozStorageResultSet.h +++ b/storage/mozStorageResultSet.h @@ -25,7 +25,7 @@ class ResultSet final : public mozIStorageResultSet { /** * Adds a tuple to this result set. */ - nsresult add(mozIStorageRow *aTuple); + nsresult add(mozIStorageRow* aTuple); /** * @returns the number of rows this result set holds. diff --git a/storage/mozStorageRow.cpp b/storage/mozStorageRow.cpp index f04fe0c88b6b7..d470feaa33866 100644 --- a/storage/mozStorageRow.cpp +++ b/storage/mozStorageRow.cpp @@ -17,14 +17,14 @@ namespace storage { //////////////////////////////////////////////////////////////////////////////// //// Row -nsresult Row::initialize(sqlite3_stmt *aStatement) { +nsresult Row::initialize(sqlite3_stmt* aStatement) { // Get the number of results mNumCols = ::sqlite3_column_count(aStatement); // Start copying over values for (uint32_t i = 0; i < mNumCols; i++) { // Store the value - nsIVariant *variant = nullptr; + nsIVariant* variant = nullptr; int type = ::sqlite3_column_type(aStatement, i); switch (type) { case SQLITE_INTEGER: @@ -34,7 +34,7 @@ nsresult Row::initialize(sqlite3_stmt *aStatement) { variant = new FloatVariant(::sqlite3_column_double(aStatement, i)); break; case SQLITE_TEXT: { - const char16_t *value = static_cast( + const char16_t* value = static_cast( ::sqlite3_column_text16(aStatement, i)); nsDependentString str( value, ::sqlite3_column_bytes16(aStatement, i) / sizeof(char16_t)); @@ -45,9 +45,9 @@ nsresult Row::initialize(sqlite3_stmt *aStatement) { variant = new NullVariant(); break; case SQLITE_BLOB: { - const void *data = ::sqlite3_column_blob(aStatement, i); + const void* data = ::sqlite3_column_blob(aStatement, i); int size = ::sqlite3_column_bytes(aStatement, i); - variant = new BlobVariant(std::pair(data, size)); + variant = new BlobVariant(std::pair(data, size)); break; } default: @@ -59,7 +59,7 @@ nsresult Row::initialize(sqlite3_stmt *aStatement) { NS_ENSURE_TRUE(mData.InsertObjectAt(variant, i), NS_ERROR_OUT_OF_MEMORY); // Associate the name (if any) with the index - const char *name = ::sqlite3_column_name(aStatement, i); + const char* name = ::sqlite3_column_name(aStatement, i); if (!name) break; nsAutoCString colName(name); mNameHashtable.Put(colName, i); @@ -78,14 +78,14 @@ NS_IMPL_ISUPPORTS(Row, mozIStorageRow, mozIStorageValueArray) //// mozIStorageRow NS_IMETHODIMP -Row::GetResultByIndex(uint32_t aIndex, nsIVariant **_result) { +Row::GetResultByIndex(uint32_t aIndex, nsIVariant** _result) { ENSURE_INDEX_VALUE(aIndex, mNumCols); NS_ADDREF(*_result = mData.ObjectAt(aIndex)); return NS_OK; } NS_IMETHODIMP -Row::GetResultByName(const nsACString &aName, nsIVariant **_result) { +Row::GetResultByName(const nsACString& aName, nsIVariant** _result) { uint32_t index; NS_ENSURE_TRUE(mNameHashtable.Get(aName, &index), NS_ERROR_NOT_AVAILABLE); return GetResultByIndex(index, _result); @@ -95,13 +95,13 @@ Row::GetResultByName(const nsACString &aName, nsIVariant **_result) { //// mozIStorageValueArray NS_IMETHODIMP -Row::GetNumEntries(uint32_t *_entries) { +Row::GetNumEntries(uint32_t* _entries) { *_entries = mNumCols; return NS_OK; } NS_IMETHODIMP -Row::GetTypeOfIndex(uint32_t aIndex, int32_t *_type) { +Row::GetTypeOfIndex(uint32_t aIndex, int32_t* _type) { ENSURE_INDEX_VALUE(aIndex, mNumCols); uint16_t type = mData.ObjectAt(aIndex)->GetDataType(); @@ -127,57 +127,57 @@ Row::GetTypeOfIndex(uint32_t aIndex, int32_t *_type) { } NS_IMETHODIMP -Row::GetInt32(uint32_t aIndex, int32_t *_value) { +Row::GetInt32(uint32_t aIndex, int32_t* _value) { ENSURE_INDEX_VALUE(aIndex, mNumCols); return mData.ObjectAt(aIndex)->GetAsInt32(_value); } NS_IMETHODIMP -Row::GetInt64(uint32_t aIndex, int64_t *_value) { +Row::GetInt64(uint32_t aIndex, int64_t* _value) { ENSURE_INDEX_VALUE(aIndex, mNumCols); return mData.ObjectAt(aIndex)->GetAsInt64(_value); } NS_IMETHODIMP -Row::GetDouble(uint32_t aIndex, double *_value) { +Row::GetDouble(uint32_t aIndex, double* _value) { ENSURE_INDEX_VALUE(aIndex, mNumCols); return mData.ObjectAt(aIndex)->GetAsDouble(_value); } NS_IMETHODIMP -Row::GetUTF8String(uint32_t aIndex, nsACString &_value) { +Row::GetUTF8String(uint32_t aIndex, nsACString& _value) { ENSURE_INDEX_VALUE(aIndex, mNumCols); return mData.ObjectAt(aIndex)->GetAsAUTF8String(_value); } NS_IMETHODIMP -Row::GetString(uint32_t aIndex, nsAString &_value) { +Row::GetString(uint32_t aIndex, nsAString& _value) { ENSURE_INDEX_VALUE(aIndex, mNumCols); return mData.ObjectAt(aIndex)->GetAsAString(_value); } NS_IMETHODIMP -Row::GetBlob(uint32_t aIndex, uint32_t *_size, uint8_t **_blob) { +Row::GetBlob(uint32_t aIndex, uint32_t* _size, uint8_t** _blob) { ENSURE_INDEX_VALUE(aIndex, mNumCols); uint16_t type; nsIID interfaceIID; return mData.ObjectAt(aIndex)->GetAsArray(&type, &interfaceIID, _size, - reinterpret_cast(_blob)); + reinterpret_cast(_blob)); } NS_IMETHODIMP -Row::GetBlobAsString(uint32_t aIndex, nsAString &aValue) { +Row::GetBlobAsString(uint32_t aIndex, nsAString& aValue) { return DoGetBlobAsString(this, aIndex, aValue); } NS_IMETHODIMP -Row::GetBlobAsUTF8String(uint32_t aIndex, nsACString &aValue) { +Row::GetBlobAsUTF8String(uint32_t aIndex, nsACString& aValue) { return DoGetBlobAsString(this, aIndex, aValue); } NS_IMETHODIMP -Row::GetIsNull(uint32_t aIndex, bool *_isNull) { +Row::GetIsNull(uint32_t aIndex, bool* _isNull) { ENSURE_INDEX_VALUE(aIndex, mNumCols); NS_ENSURE_ARG_POINTER(_isNull); @@ -187,17 +187,17 @@ Row::GetIsNull(uint32_t aIndex, bool *_isNull) { } NS_IMETHODIMP -Row::GetSharedUTF8String(uint32_t, uint32_t *, char const **) { +Row::GetSharedUTF8String(uint32_t, uint32_t*, char const**) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -Row::GetSharedString(uint32_t, uint32_t *, const char16_t **) { +Row::GetSharedString(uint32_t, uint32_t*, const char16_t**) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -Row::GetSharedBlob(uint32_t, uint32_t *, const uint8_t **) { +Row::GetSharedBlob(uint32_t, uint32_t*, const uint8_t**) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/storage/mozStorageRow.h b/storage/mozStorageRow.h index 7d20ca114749d..55d6f31a8a8f0 100644 --- a/storage/mozStorageRow.h +++ b/storage/mozStorageRow.h @@ -32,7 +32,7 @@ class Row final : public mozIStorageRow { * @param aStatement * The sqlite statement to pull results from. */ - nsresult initialize(sqlite3_stmt *aStatement); + nsresult initialize(sqlite3_stmt* aStatement); private: ~Row() {} diff --git a/storage/mozStorageSQLFunctions.cpp b/storage/mozStorageSQLFunctions.cpp index 5827f52f071a3..d160ddb18b4bf 100644 --- a/storage/mozStorageSQLFunctions.cpp +++ b/storage/mozStorageSQLFunctions.cpp @@ -120,8 +120,8 @@ int likeCompare(nsAString::const_iterator aPatternItr, * an outparam that will receive the edit distance between the arguments * @return a Sqlite result code, e.g. SQLITE_OK, SQLITE_NOMEM, etc. */ -int levenshteinDistance(const nsAString &aStringS, const nsAString &aStringT, - int *_result) { +int levenshteinDistance(const nsAString& aStringS, const nsAString& aStringT, + int* _result) { // Set the result to a non-sensical value in case we encounter an error. *_result = -1; @@ -159,14 +159,14 @@ int levenshteinDistance(const nsAString &aStringS, const nsAString &aStringT, AutoTArray row2; // Declare the raw pointers that will actually be used to access the memory. - int *prevRow = row1.AppendElements(sLen + 1); - int *currRow = row2.AppendElements(sLen + 1); + int* prevRow = row1.AppendElements(sLen + 1); + int* currRow = row2.AppendElements(sLen + 1); // Initialize the first row. for (uint32_t i = 0; i <= sLen; i++) prevRow[i] = i; - const char16_t *s = aStringS.BeginReading(); - const char16_t *t = aStringT.BeginReading(); + const char16_t* s = aStringS.BeginReading(); + const char16_t* t = aStringT.BeginReading(); // Compute the empty cells in the "matrix" row-by-row, starting with // the second row. @@ -199,7 +199,7 @@ int levenshteinDistance(const nsAString &aStringS, const nsAString &aStringT, // row and we recycle the old previous row as the new current row. // We don't need to re-initialize the new current row since we will // rewrite all of its cells anyway. - int *oldPrevRow = prevRow; + int* oldPrevRow = prevRow; prevRow = currRow; currRow = oldPrevRow; } @@ -213,11 +213,11 @@ int levenshteinDistance(const nsAString &aStringS, const nsAString &aStringT, // This struct is used only by registerFunctions below, but ISO C++98 forbids // instantiating a template dependent on a locally-defined type. Boo-urns! struct Functions { - const char *zName; + const char* zName; int nArg; int enc; - void *pContext; - void (*xFunc)(::sqlite3_context *, int, sqlite3_value **); + void* pContext; + void (*xFunc)(::sqlite3_context*, int, sqlite3_value**); }; } // namespace @@ -225,12 +225,12 @@ struct Functions { //////////////////////////////////////////////////////////////////////////////// //// Exposed Functions -int registerFunctions(sqlite3 *aDB) { +int registerFunctions(sqlite3* aDB) { Functions functions[] = { {"lower", 1, SQLITE_UTF16, 0, caseFunction}, {"lower", 1, SQLITE_UTF8, 0, caseFunction}, - {"upper", 1, SQLITE_UTF16, (void *)1, caseFunction}, - {"upper", 1, SQLITE_UTF8, (void *)1, caseFunction}, + {"upper", 1, SQLITE_UTF16, (void*)1, caseFunction}, + {"upper", 1, SQLITE_UTF8, (void*)1, caseFunction}, {"like", 2, SQLITE_UTF16, 0, likeFunction}, {"like", 2, SQLITE_UTF8, 0, likeFunction}, @@ -246,7 +246,7 @@ int registerFunctions(sqlite3 *aDB) { int rv = SQLITE_OK; for (size_t i = 0; SQLITE_OK == rv && i < ArrayLength(functions); ++i) { - struct Functions *p = &functions[i]; + struct Functions* p = &functions[i]; rv = ::sqlite3_create_function(aDB, p->zName, p->nArg, p->enc, p->pContext, p->xFunc, nullptr, nullptr); } @@ -257,11 +257,11 @@ int registerFunctions(sqlite3 *aDB) { //////////////////////////////////////////////////////////////////////////////// //// SQL Functions -void caseFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv) { +void caseFunction(sqlite3_context* aCtx, int aArgc, sqlite3_value** aArgv) { NS_ASSERTION(1 == aArgc, "Invalid number of arguments!"); - const char16_t *value = - static_cast(::sqlite3_value_text16(aArgv[0])); + const char16_t* value = + static_cast(::sqlite3_value_text16(aArgv[0])); nsAutoString data(value, ::sqlite3_value_bytes16(aArgv[0]) / sizeof(char16_t)); bool toUpper = ::sqlite3_user_data(aCtx) ? true : false; @@ -281,7 +281,7 @@ void caseFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv) { * The SQL statement 'A LIKE B' is implemented as 'like(B, A)', and if there is * an escape character, say E, it is implemented as 'like(B, A, E)'. */ -void likeFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv) { +void likeFunction(sqlite3_context* aCtx, int aArgc, sqlite3_value** aArgv) { NS_ASSERTION(2 == aArgc || 3 == aArgc, "Invalid number of arguments!"); if (::sqlite3_value_bytes(aArgv[0]) > SQLITE_MAX_LIKE_PATTERN_LENGTH) { @@ -293,20 +293,20 @@ void likeFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv) { if (!::sqlite3_value_text16(aArgv[0]) || !::sqlite3_value_text16(aArgv[1])) return; - const char16_t *a = - static_cast(::sqlite3_value_text16(aArgv[1])); + const char16_t* a = + static_cast(::sqlite3_value_text16(aArgv[1])); int aLen = ::sqlite3_value_bytes16(aArgv[1]) / sizeof(char16_t); nsDependentString A(a, aLen); - const char16_t *b = - static_cast(::sqlite3_value_text16(aArgv[0])); + const char16_t* b = + static_cast(::sqlite3_value_text16(aArgv[0])); int bLen = ::sqlite3_value_bytes16(aArgv[0]) / sizeof(char16_t); nsDependentString B(b, bLen); NS_ASSERTION(!B.IsEmpty(), "LIKE string must not be null!"); char16_t E = 0; if (3 == aArgc) - E = static_cast(::sqlite3_value_text16(aArgv[2]))[0]; + E = static_cast(::sqlite3_value_text16(aArgv[2]))[0]; nsAString::const_iterator itrString, endString; A.BeginReading(itrString); @@ -318,8 +318,8 @@ void likeFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv) { aCtx, likeCompare(itrPattern, endPattern, itrString, endString, E)); } -void levenshteinDistanceFunction(sqlite3_context *aCtx, int aArgc, - sqlite3_value **aArgv) { +void levenshteinDistanceFunction(sqlite3_context* aCtx, int aArgc, + sqlite3_value** aArgv) { NS_ASSERTION(2 == aArgc, "Invalid number of arguments!"); // If either argument is a SQL NULL, then return SQL NULL. @@ -329,12 +329,12 @@ void levenshteinDistanceFunction(sqlite3_context *aCtx, int aArgc, return; } - const char16_t *a = - static_cast(::sqlite3_value_text16(aArgv[0])); + const char16_t* a = + static_cast(::sqlite3_value_text16(aArgv[0])); int aLen = ::sqlite3_value_bytes16(aArgv[0]) / sizeof(char16_t); - const char16_t *b = - static_cast(::sqlite3_value_text16(aArgv[1])); + const char16_t* b = + static_cast(::sqlite3_value_text16(aArgv[1])); int bLen = ::sqlite3_value_bytes16(aArgv[1]) / sizeof(char16_t); // Compute the Levenshtein Distance, and return the result (or error). @@ -351,8 +351,8 @@ void levenshteinDistanceFunction(sqlite3_context *aCtx, int aArgc, } } -void utf16LengthFunction(sqlite3_context *aCtx, int aArgc, - sqlite3_value **aArgv) { +void utf16LengthFunction(sqlite3_context* aCtx, int aArgc, + sqlite3_value** aArgv) { NS_ASSERTION(1 == aArgc, "Invalid number of arguments!"); int len = ::sqlite3_value_bytes16(aArgv[0]) / sizeof(char16_t); diff --git a/storage/mozStorageSQLFunctions.h b/storage/mozStorageSQLFunctions.h index 88eddbb1d2976..2a3f1f3d7e93e 100644 --- a/storage/mozStorageSQLFunctions.h +++ b/storage/mozStorageSQLFunctions.h @@ -20,7 +20,7 @@ namespace storage { * The database we'll be registering the functions with. * @return the SQLite status code indicating success or failure. */ -int registerFunctions(sqlite3 *aDB); +int registerFunctions(sqlite3* aDB); //////////////////////////////////////////////////////////////////////////////// //// Predefined Functions @@ -36,7 +36,7 @@ int registerFunctions(sqlite3 *aDB); * @param aArgv * An array of the arguments the functions is being called with. */ -void caseFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv); +void caseFunction(sqlite3_context* aCtx, int aArgc, sqlite3_value** aArgv); /** * Overridden function to perform the SQL function LIKE. This supports unicode, @@ -49,7 +49,7 @@ void caseFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv); * @param aArgv * An array of the arguments the functions is being called with. */ -void likeFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv); +void likeFunction(sqlite3_context* aCtx, int aArgc, sqlite3_value** aArgv); /** * An implementation of the Levenshtein Edit Distance algorithm for use in @@ -62,8 +62,8 @@ void likeFunction(sqlite3_context *aCtx, int aArgc, sqlite3_value **aArgv); * @param aArgv * An array of the arguments the functions is being called with. */ -void levenshteinDistanceFunction(sqlite3_context *aCtx, int aArgc, - sqlite3_value **aArgv); +void levenshteinDistanceFunction(sqlite3_context* aCtx, int aArgc, + sqlite3_value** aArgv); /** * An alternative string length function that uses XPCOM string classes for @@ -76,8 +76,8 @@ void levenshteinDistanceFunction(sqlite3_context *aCtx, int aArgc, * @param aArgv * An array of the arguments the functions is being called with. */ -void utf16LengthFunction(sqlite3_context *aCtx, int aArgc, - sqlite3_value **aArgv); +void utf16LengthFunction(sqlite3_context* aCtx, int aArgc, + sqlite3_value** aArgv); } // namespace storage } // namespace mozilla diff --git a/storage/mozStorageService.cpp b/storage/mozStorageService.cpp index 7ed48d56d42cd..5b3e6ed1aec95 100644 --- a/storage/mozStorageService.cpp +++ b/storage/mozStorageService.cpp @@ -81,11 +81,11 @@ static int64_t StorageSQLiteDistinguishedAmount() { * @param aTotal * The accumulator for the measurement. */ -static void ReportConn(nsIHandleReportCallback *aHandleReport, - nsISupports *aData, Connection *aConn, - const nsACString &aPathHead, const nsACString &aKind, - const nsACString &aDesc, int32_t aOption, - size_t *aTotal) { +static void ReportConn(nsIHandleReportCallback* aHandleReport, + nsISupports* aData, Connection* aConn, + const nsACString& aPathHead, const nsACString& aKind, + const nsACString& aDesc, int32_t aOption, + size_t* aTotal) { nsCString path(aPathHead); path.Append(aKind); path.AppendLiteral("-used"); @@ -104,15 +104,15 @@ static void ReportConn(nsIHandleReportCallback *aHandleReport, // about:memory is loaded (not, for example, when telemetry pings occur) and // any delays in that case aren't so bad. NS_IMETHODIMP -Service::CollectReports(nsIHandleReportCallback *aHandleReport, - nsISupports *aData, bool aAnonymize) { +Service::CollectReports(nsIHandleReportCallback* aHandleReport, + nsISupports* aData, bool aAnonymize) { size_t totalConnSize = 0; { nsTArray> connections; getConnections(connections); for (uint32_t i = 0; i < connections.Length(); i++) { - RefPtr &conn = connections[i]; + RefPtr& conn = connections[i]; // Someone may have closed the Connection, in which case we skip it. // Note that we have consumers of the synchronous API that are off the @@ -177,7 +177,7 @@ Service::CollectReports(nsIHandleReportCallback *aHandleReport, NS_IMPL_ISUPPORTS(Service, mozIStorageService, nsIObserver, nsIMemoryReporter) -Service *Service::gService = nullptr; +Service* Service::gService = nullptr; already_AddRefed Service::getSingleton() { if (gService) { @@ -247,13 +247,13 @@ Service::~Service() { mSqliteVFS = nullptr; } -void Service::registerConnection(Connection *aConnection) { +void Service::registerConnection(Connection* aConnection) { mRegistrationMutex.AssertNotCurrentThreadOwns(); MutexAutoLock mutex(mRegistrationMutex); (void)mConnections.AppendElement(aConnection); } -void Service::unregisterConnection(Connection *aConnection) { +void Service::unregisterConnection(Connection* aConnection) { // If this is the last Connection it might be the only thing keeping Service // alive. So ensure that Service is destroyed only after the Connection is // cleanly unregistered and destroyed. @@ -288,7 +288,7 @@ void Service::unregisterConnection(Connection *aConnection) { } void Service::getConnections( - /* inout */ nsTArray> &aConnections) { + /* inout */ nsTArray>& aConnections) { mRegistrationMutex.AssertNotCurrentThreadOwns(); MutexAutoLock mutex(mRegistrationMutex); aConnections.Clear(); @@ -343,10 +343,10 @@ void Service::minimizeMemory() { } } -sqlite3_vfs *ConstructTelemetryVFS(); -const char *GetVFSName(); +sqlite3_vfs* ConstructTelemetryVFS(); +const char* GetVFSName(); -static const char *sObserverTopics[] = {"memory-pressure", +static const char* sObserverTopics[] = {"memory-pressure", "xpcom-shutdown-threads"}; nsresult Service::initialize() { @@ -392,15 +392,15 @@ nsresult Service::initialize() { return NS_OK; } -int Service::localeCompareStrings(const nsAString &aStr1, - const nsAString &aStr2, +int Service::localeCompareStrings(const nsAString& aStr1, + const nsAString& aStr2, int32_t aComparisonStrength) { // The implementation of nsICollation.CompareString() is platform-dependent. // On Linux it's not thread-safe. It may not be on Windows and OS X either, // but it's more difficult to tell. We therefore synchronize this method. MutexAutoLock mutex(mMutex); - nsICollation *coll = getLocaleCollation(); + nsICollation* coll = getLocaleCollation(); if (!coll) { NS_ERROR("Storage service has no collation"); return 0; @@ -416,7 +416,7 @@ int Service::localeCompareStrings(const nsAString &aStr1, return res; } -nsICollation *Service::getLocaleCollation() { +nsICollation* Service::getLocaleCollation() { mMutex.AssertCurrentThreadOwns(); if (mLocaleCollation) return mLocaleCollation; @@ -441,8 +441,8 @@ nsICollation *Service::getLocaleCollation() { //// mozIStorageService NS_IMETHODIMP -Service::OpenSpecialDatabase(const char *aStorageKey, - mozIStorageConnection **_connection) { +Service::OpenSpecialDatabase(const char* aStorageKey, + mozIStorageConnection** _connection) { nsresult rv; nsCOMPtr storageFile; @@ -467,9 +467,9 @@ namespace { class AsyncInitDatabase final : public Runnable { public: - AsyncInitDatabase(Connection *aConnection, nsIFile *aStorageFile, + AsyncInitDatabase(Connection* aConnection, nsIFile* aStorageFile, int32_t aGrowthIncrement, - mozIStorageCompletionCallback *aCallback) + mozIStorageCompletionCallback* aCallback) : Runnable("storage::AsyncInitDatabase"), mConnection(aConnection), mStorageFile(aStorageFile), @@ -491,11 +491,11 @@ class AsyncInitDatabase final : public Runnable { } return DispatchResult( - NS_OK, NS_ISUPPORTS_CAST(mozIStorageAsyncConnection *, mConnection)); + NS_OK, NS_ISUPPORTS_CAST(mozIStorageAsyncConnection*, mConnection)); } private: - nsresult DispatchResult(nsresult aStatus, nsISupports *aValue) { + nsresult DispatchResult(nsresult aStatus, nsISupports* aValue) { RefPtr event = new CallbackComplete(aStatus, aValue, mCallback.forget()); return NS_DispatchToMainThread(event); @@ -523,9 +523,9 @@ class AsyncInitDatabase final : public Runnable { } // namespace NS_IMETHODIMP -Service::OpenAsyncDatabase(nsIVariant *aDatabaseStore, - nsIPropertyBag2 *aOptions, - mozIStorageCompletionCallback *aCallback) { +Service::OpenAsyncDatabase(nsIVariant* aDatabaseStore, + nsIPropertyBag2* aOptions, + mozIStorageCompletionCallback* aCallback) { if (!NS_IsMainThread()) { return NS_ERROR_NOT_SAME_THREAD; } @@ -617,8 +617,8 @@ Service::OpenAsyncDatabase(nsIVariant *aDatabaseStore, } NS_IMETHODIMP -Service::OpenDatabase(nsIFile *aDatabaseFile, - mozIStorageConnection **_connection) { +Service::OpenDatabase(nsIFile* aDatabaseFile, + mozIStorageConnection** _connection) { NS_ENSURE_ARG(aDatabaseFile); // Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility @@ -635,8 +635,8 @@ Service::OpenDatabase(nsIFile *aDatabaseFile, } NS_IMETHODIMP -Service::OpenUnsharedDatabase(nsIFile *aDatabaseFile, - mozIStorageConnection **_connection) { +Service::OpenUnsharedDatabase(nsIFile* aDatabaseFile, + mozIStorageConnection** _connection) { NS_ENSURE_ARG(aDatabaseFile); // Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility @@ -653,8 +653,8 @@ Service::OpenUnsharedDatabase(nsIFile *aDatabaseFile, } NS_IMETHODIMP -Service::OpenDatabaseWithFileURL(nsIFileURL *aFileURL, - mozIStorageConnection **_connection) { +Service::OpenDatabaseWithFileURL(nsIFileURL* aFileURL, + mozIStorageConnection** _connection) { NS_ENSURE_ARG(aFileURL); // Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility @@ -671,8 +671,8 @@ Service::OpenDatabaseWithFileURL(nsIFileURL *aFileURL, } NS_IMETHODIMP -Service::BackupDatabaseFile(nsIFile *aDBFile, const nsAString &aBackupFileName, - nsIFile *aBackupParentDirectory, nsIFile **backup) { +Service::BackupDatabaseFile(nsIFile* aDBFile, const nsAString& aBackupFileName, + nsIFile* aBackupParentDirectory, nsIFile** backup) { nsresult rv; nsCOMPtr parentDir = aBackupParentDirectory; if (!parentDir) { @@ -708,7 +708,7 @@ Service::BackupDatabaseFile(nsIFile *aDBFile, const nsAString &aBackupFileName, //// nsIObserver NS_IMETHODIMP -Service::Observe(nsISupports *, const char *aTopic, const char16_t *) { +Service::Observe(nsISupports*, const char* aTopic, const char16_t*) { if (strcmp(aTopic, "memory-pressure") == 0) { minimizeMemory(); } else if (strcmp(aTopic, "xpcom-shutdown-threads") == 0) { @@ -729,7 +729,7 @@ Service::Observe(nsISupports *, const char *aTopic, const char16_t *) { // We must wait until all the closing connections are closed. nsTArray> connections; getConnections(connections); - for (auto &conn : connections) { + for (auto& conn : connections) { if (conn->isClosing()) { return false; } diff --git a/storage/mozStorageService.h b/storage/mozStorageService.h index d6474370ab86f..c3e9a2432ea15 100644 --- a/storage/mozStorageService.h +++ b/storage/mozStorageService.h @@ -46,7 +46,7 @@ class Service : public mozIStorageService, * number. If aStr1 > aStr2, returns a positive number. If * aStr1 == aStr2, returns 0. */ - int localeCompareStrings(const nsAString &aStr1, const nsAString &aStr2, + int localeCompareStrings(const nsAString& aStr1, const nsAString& aStr2, int32_t aComparisonStrength); static already_AddRefed getSingleton(); @@ -87,7 +87,7 @@ class Service : public mozIStorageService, * @param aConnection * The connection to register. */ - void registerConnection(Connection *aConnection); + void registerConnection(Connection* aConnection); /** * Unregisters the connection with the storage service. @@ -97,7 +97,7 @@ class Service : public mozIStorageService, * @param aConnection * The connection to unregister. */ - void unregisterConnection(Connection *aConnection); + void unregisterConnection(Connection* aConnection); /** * Gets the list of open connections. Note that you must test each @@ -111,7 +111,7 @@ class Service : public mozIStorageService, * it. * @return The open connections. */ - void getConnections(nsTArray > &aConnections); + void getConnections(nsTArray >& aConnections); private: Service(); @@ -124,7 +124,7 @@ class Service : public mozIStorageService, */ Mutex mMutex; - sqlite3_vfs *mSqliteVFS; + sqlite3_vfs* mSqliteVFS; /** * Protects mConnections. @@ -150,7 +150,7 @@ class Service : public mozIStorageService, * execute outside the lifetime of the Service, this method returns a raw * pointer. */ - nsICollation *getLocaleCollation(); + nsICollation* getLocaleCollation(); /** * Lazily created collation that all statements of all Connections of this @@ -165,7 +165,7 @@ class Service : public mozIStorageService, nsCOMPtr mStorageSQLiteReporter; - static Service *gService; + static Service* gService; static int32_t sSynchronousPref; static int32_t sDefaultPageSize; diff --git a/storage/mozStorageStatement.cpp b/storage/mozStorageStatement.cpp index 9938090ab8ff1..5f551e879a6b8 100644 --- a/storage/mozStorageStatement.cpp +++ b/storage/mozStorageStatement.cpp @@ -47,43 +47,43 @@ class StatementClassInfo : public nsIClassInfo { NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD - GetInterfaces(nsTArray &_array) override { + GetInterfaces(nsTArray& _array) override { return NS_CI_INTERFACE_GETTER_NAME(Statement)(_array); } NS_IMETHOD - GetScriptableHelper(nsIXPCScriptable **_helper) override { + GetScriptableHelper(nsIXPCScriptable** _helper) override { static StatementJSHelper sJSHelper; *_helper = &sJSHelper; return NS_OK; } NS_IMETHOD - GetContractID(nsACString &aContractID) override { + GetContractID(nsACString& aContractID) override { aContractID.SetIsVoid(true); return NS_OK; } NS_IMETHOD - GetClassDescription(nsACString &aDesc) override { + GetClassDescription(nsACString& aDesc) override { aDesc.SetIsVoid(true); return NS_OK; } NS_IMETHOD - GetClassID(nsCID **_id) override { + GetClassID(nsCID** _id) override { *_id = nullptr; return NS_OK; } NS_IMETHOD - GetFlags(uint32_t *_flags) override { + GetFlags(uint32_t* _flags) override { *_flags = 0; return NS_OK; } NS_IMETHOD - GetClassIDNoAlloc(nsCID *_cid) override { return NS_ERROR_NOT_AVAILABLE; } + GetClassIDNoAlloc(nsCID* _cid) override { return NS_ERROR_NOT_AVAILABLE; } }; NS_IMETHODIMP_(MozExternalRefCountType) StatementClassInfo::AddRef() { @@ -107,9 +107,9 @@ Statement::Statement() mColumnNames(), mExecuting(false) {} -nsresult Statement::initialize(Connection *aDBConnection, - sqlite3 *aNativeConnection, - const nsACString &aSQLStatement) { +nsresult Statement::initialize(Connection* aDBConnection, + sqlite3* aNativeConnection, + const nsACString& aSQLStatement) { MOZ_ASSERT(aDBConnection, "No database connection given!"); MOZ_ASSERT(aDBConnection->isConnectionReadyOnThisThread(), "Database connection should be valid"); @@ -137,9 +137,9 @@ nsresult Statement::initialize(Connection *aDBConnection, mResultColumnCount = ::sqlite3_column_count(mDBStatement); mColumnNames.Clear(); - nsCString *columnNames = mColumnNames.AppendElements(mResultColumnCount); + nsCString* columnNames = mColumnNames.AppendElements(mResultColumnCount); for (uint32_t i = 0; i < mResultColumnCount; i++) { - const char *name = ::sqlite3_column_name(mDBStatement, i); + const char* name = ::sqlite3_column_name(mDBStatement, i); columnNames[i].Assign(name); } @@ -182,7 +182,7 @@ nsresult Statement::initialize(Connection *aDBConnection, return NS_OK; } -mozIStorageBindingParams *Statement::getParams() { +mozIStorageBindingParams* Statement::getParams() { nsresult rv; // If we do not have an array object yet, make it. @@ -191,7 +191,7 @@ mozIStorageBindingParams *Statement::getParams() { rv = NewBindingParamsArray(getter_AddRefs(array)); NS_ENSURE_SUCCESS(rv, nullptr); - mParamsArray = static_cast(array.get()); + mParamsArray = static_cast(array.get()); } // If there isn't already any rows added, we'll have to add one to use. @@ -230,7 +230,7 @@ NS_INTERFACE_MAP_BEGIN(Statement) NS_INTERFACE_MAP_ENTRY(mozIStorageValueArray) NS_INTERFACE_MAP_ENTRY(mozilla::storage::StorageBaseStatementInternal) if (aIID.Equals(NS_GET_IID(nsIClassInfo))) { - foundInterface = static_cast(&sStatementClassInfo); + foundInterface = static_cast(&sStatementClassInfo); } else NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, mozIStorageStatement) NS_INTERFACE_MAP_END @@ -238,9 +238,9 @@ NS_INTERFACE_MAP_END //////////////////////////////////////////////////////////////////////////////// //// StorageBaseStatementInternal -Connection *Statement::getOwner() { return mDBConnection; } +Connection* Statement::getOwner() { return mDBConnection; } -int Statement::getAsyncStatement(sqlite3_stmt **_stmt) { +int Statement::getAsyncStatement(sqlite3_stmt** _stmt) { // If we have no statement, we shouldn't be calling this method! NS_ASSERTION(mDBStatement != nullptr, "We have no statement to clone!"); @@ -262,10 +262,10 @@ int Statement::getAsyncStatement(sqlite3_stmt **_stmt) { return SQLITE_OK; } -nsresult Statement::getAsynchronousStatementData(StatementData &_data) { +nsresult Statement::getAsynchronousStatementData(StatementData& _data) { if (!mDBStatement) return NS_ERROR_UNEXPECTED; - sqlite3_stmt *stmt; + sqlite3_stmt* stmt; int rc = getAsyncStatement(&stmt); if (rc != SQLITE_OK) return convertResultCode(rc); @@ -275,7 +275,7 @@ nsresult Statement::getAsynchronousStatementData(StatementData &_data) { } already_AddRefed Statement::newBindingParams( - mozIStorageBindingParamsArray *aOwner) { + mozIStorageBindingParamsArray* aOwner) { nsCOMPtr params = new BindingParams(aOwner, this); return params.forget(); } @@ -287,7 +287,7 @@ already_AddRefed Statement::newBindingParams( MIXIN_IMPL_STORAGEBASESTATEMENTINTERNAL(Statement, (void)0;) NS_IMETHODIMP -Statement::Clone(mozIStorageStatement **_statement) { +Statement::Clone(mozIStorageStatement** _statement) { RefPtr statement(new Statement()); NS_ENSURE_TRUE(statement, NS_ERROR_OUT_OF_MEMORY); @@ -365,7 +365,7 @@ nsresult Statement::internalFinalize(bool aDestructing) { } NS_IMETHODIMP -Statement::GetParameterCount(uint32_t *_parameterCount) { +Statement::GetParameterCount(uint32_t* _parameterCount) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; *_parameterCount = mParamCount; @@ -373,11 +373,11 @@ Statement::GetParameterCount(uint32_t *_parameterCount) { } NS_IMETHODIMP -Statement::GetParameterName(uint32_t aParamIndex, nsACString &_name) { +Statement::GetParameterName(uint32_t aParamIndex, nsACString& _name) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; ENSURE_INDEX_VALUE(aParamIndex, mParamCount); - const char *name = + const char* name = ::sqlite3_bind_parameter_name(mDBStatement, aParamIndex + 1); if (name == nullptr) { // this thing had no name, so fake one @@ -392,7 +392,7 @@ Statement::GetParameterName(uint32_t aParamIndex, nsACString &_name) { } NS_IMETHODIMP -Statement::GetParameterIndex(const nsACString &aName, uint32_t *_index) { +Statement::GetParameterIndex(const nsACString& aName, uint32_t* _index) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; // We do not accept any forms of names other than ":name", but we need to add @@ -409,7 +409,7 @@ Statement::GetParameterIndex(const nsACString &aName, uint32_t *_index) { } NS_IMETHODIMP -Statement::GetColumnCount(uint32_t *_columnCount) { +Statement::GetColumnCount(uint32_t* _columnCount) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; *_columnCount = mResultColumnCount; @@ -417,18 +417,18 @@ Statement::GetColumnCount(uint32_t *_columnCount) { } NS_IMETHODIMP -Statement::GetColumnName(uint32_t aColumnIndex, nsACString &_name) { +Statement::GetColumnName(uint32_t aColumnIndex, nsACString& _name) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; ENSURE_INDEX_VALUE(aColumnIndex, mResultColumnCount); - const char *cname = ::sqlite3_column_name(mDBStatement, aColumnIndex); + const char* cname = ::sqlite3_column_name(mDBStatement, aColumnIndex); _name.Assign(nsDependentCString(cname)); return NS_OK; } NS_IMETHODIMP -Statement::GetColumnIndex(const nsACString &aName, uint32_t *_index) { +Statement::GetColumnIndex(const nsACString& aName, uint32_t* _index) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; // Surprisingly enough, SQLite doesn't provide an API for this. We have to @@ -464,12 +464,12 @@ Statement::Reset() { } NS_IMETHODIMP -Statement::BindParameters(mozIStorageBindingParamsArray *aParameters) { +Statement::BindParameters(mozIStorageBindingParamsArray* aParameters) { NS_ENSURE_ARG_POINTER(aParameters); if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; - BindingParamsArray *array = static_cast(aParameters); + BindingParamsArray* array = static_cast(aParameters); if (array->getOwner() != this) return NS_ERROR_UNEXPECTED; if (array->length() == 0) return NS_ERROR_UNEXPECTED; @@ -492,7 +492,7 @@ Statement::Execute() { } NS_IMETHODIMP -Statement::ExecuteStep(bool *_moreResults) { +Statement::ExecuteStep(bool* _moreResults) { AUTO_PROFILER_LABEL("Statement::ExecuteStep", OTHER); if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; @@ -549,7 +549,7 @@ Statement::ExecuteStep(bool *_moreResults) { } NS_IMETHODIMP -Statement::GetState(int32_t *_state) { +Statement::GetState(int32_t* _state) { if (!mDBStatement) *_state = MOZ_STORAGE_STATEMENT_INVALID; else if (mExecuting) @@ -564,13 +564,13 @@ Statement::GetState(int32_t *_state) { //// mozIStorageValueArray (now part of mozIStorageStatement too) NS_IMETHODIMP -Statement::GetNumEntries(uint32_t *_length) { +Statement::GetNumEntries(uint32_t* _length) { *_length = mResultColumnCount; return NS_OK; } NS_IMETHODIMP -Statement::GetTypeOfIndex(uint32_t aIndex, int32_t *_type) { +Statement::GetTypeOfIndex(uint32_t aIndex, int32_t* _type) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; ENSURE_INDEX_VALUE(aIndex, mResultColumnCount); @@ -602,7 +602,7 @@ Statement::GetTypeOfIndex(uint32_t aIndex, int32_t *_type) { } NS_IMETHODIMP -Statement::GetInt32(uint32_t aIndex, int32_t *_value) { +Statement::GetInt32(uint32_t aIndex, int32_t* _value) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; ENSURE_INDEX_VALUE(aIndex, mResultColumnCount); @@ -614,7 +614,7 @@ Statement::GetInt32(uint32_t aIndex, int32_t *_value) { } NS_IMETHODIMP -Statement::GetInt64(uint32_t aIndex, int64_t *_value) { +Statement::GetInt64(uint32_t aIndex, int64_t* _value) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; ENSURE_INDEX_VALUE(aIndex, mResultColumnCount); @@ -627,7 +627,7 @@ Statement::GetInt64(uint32_t aIndex, int64_t *_value) { } NS_IMETHODIMP -Statement::GetDouble(uint32_t aIndex, double *_value) { +Statement::GetDouble(uint32_t aIndex, double* _value) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; ENSURE_INDEX_VALUE(aIndex, mResultColumnCount); @@ -640,7 +640,7 @@ Statement::GetDouble(uint32_t aIndex, double *_value) { } NS_IMETHODIMP -Statement::GetUTF8String(uint32_t aIndex, nsACString &_value) { +Statement::GetUTF8String(uint32_t aIndex, nsACString& _value) { // Get type of Index will check aIndex for us, so we don't have to. int32_t type; nsresult rv = GetTypeOfIndex(aIndex, &type); @@ -650,7 +650,7 @@ Statement::GetUTF8String(uint32_t aIndex, nsACString &_value) { // string. _value.SetIsVoid(true); } else { - const char *value = reinterpret_cast( + const char* value = reinterpret_cast( ::sqlite3_column_text(mDBStatement, aIndex)); _value.Assign(value, ::sqlite3_column_bytes(mDBStatement, aIndex)); } @@ -658,7 +658,7 @@ Statement::GetUTF8String(uint32_t aIndex, nsACString &_value) { } NS_IMETHODIMP -Statement::GetString(uint32_t aIndex, nsAString &_value) { +Statement::GetString(uint32_t aIndex, nsAString& _value) { // Get type of Index will check aIndex for us, so we don't have to. int32_t type; nsresult rv = GetTypeOfIndex(aIndex, &type); @@ -668,7 +668,7 @@ Statement::GetString(uint32_t aIndex, nsAString &_value) { // string. _value.SetIsVoid(true); } else { - const char16_t *value = static_cast( + const char16_t* value = static_cast( ::sqlite3_column_text16(mDBStatement, aIndex)); _value.Assign(value, ::sqlite3_column_bytes16(mDBStatement, aIndex) / sizeof(char16_t)); @@ -677,7 +677,7 @@ Statement::GetString(uint32_t aIndex, nsAString &_value) { } NS_IMETHODIMP -Statement::GetVariant(uint32_t aIndex, nsIVariant **_value) { +Statement::GetVariant(uint32_t aIndex, nsIVariant** _value) { if (!mDBStatement) { return NS_ERROR_NOT_INITIALIZED; } @@ -699,7 +699,7 @@ Statement::GetVariant(uint32_t aIndex, nsIVariant **_value) { variant = new FloatVariant(::sqlite3_column_double(mDBStatement, aIndex)); break; case SQLITE_TEXT: { - const char16_t *value = static_cast( + const char16_t* value = static_cast( ::sqlite3_column_text16(mDBStatement, aIndex)); nsDependentString str( value, @@ -712,8 +712,8 @@ Statement::GetVariant(uint32_t aIndex, nsIVariant **_value) { break; case SQLITE_BLOB: { int size = ::sqlite3_column_bytes(mDBStatement, aIndex); - const void *data = ::sqlite3_column_blob(mDBStatement, aIndex); - variant = new BlobVariant(std::pair(data, size)); + const void* data = ::sqlite3_column_blob(mDBStatement, aIndex); + variant = new BlobVariant(std::pair(data, size)); break; } } @@ -724,7 +724,7 @@ Statement::GetVariant(uint32_t aIndex, nsIVariant **_value) { } NS_IMETHODIMP -Statement::GetBlob(uint32_t aIndex, uint32_t *_size, uint8_t **_blob) { +Statement::GetBlob(uint32_t aIndex, uint32_t* _size, uint8_t** _blob) { if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; ENSURE_INDEX_VALUE(aIndex, mResultColumnCount); @@ -732,30 +732,30 @@ Statement::GetBlob(uint32_t aIndex, uint32_t *_size, uint8_t **_blob) { if (!mExecuting) return NS_ERROR_UNEXPECTED; int size = ::sqlite3_column_bytes(mDBStatement, aIndex); - void *blob = nullptr; + void* blob = nullptr; if (size) { blob = moz_xmemdup(::sqlite3_column_blob(mDBStatement, aIndex), size); } - *_blob = static_cast(blob); + *_blob = static_cast(blob); *_size = size; return NS_OK; } NS_IMETHODIMP -Statement::GetBlobAsString(uint32_t aIndex, nsAString &aValue) { +Statement::GetBlobAsString(uint32_t aIndex, nsAString& aValue) { return DoGetBlobAsString(this, aIndex, aValue); } NS_IMETHODIMP -Statement::GetBlobAsUTF8String(uint32_t aIndex, nsACString &aValue) { +Statement::GetBlobAsUTF8String(uint32_t aIndex, nsACString& aValue) { return DoGetBlobAsString(this, aIndex, aValue); } NS_IMETHODIMP -Statement::GetSharedUTF8String(uint32_t aIndex, uint32_t *_byteLength, - const char **_value) { - *_value = reinterpret_cast( +Statement::GetSharedUTF8String(uint32_t aIndex, uint32_t* _byteLength, + const char** _value) { + *_value = reinterpret_cast( ::sqlite3_column_text(mDBStatement, aIndex)); if (_byteLength) { *_byteLength = ::sqlite3_column_bytes(mDBStatement, aIndex); @@ -764,9 +764,9 @@ Statement::GetSharedUTF8String(uint32_t aIndex, uint32_t *_byteLength, } NS_IMETHODIMP -Statement::GetSharedString(uint32_t aIndex, uint32_t *_byteLength, - const char16_t **_value) { - *_value = static_cast( +Statement::GetSharedString(uint32_t aIndex, uint32_t* _byteLength, + const char16_t** _value) { + *_value = static_cast( ::sqlite3_column_text16(mDBStatement, aIndex)); if (_byteLength) { *_byteLength = ::sqlite3_column_bytes16(mDBStatement, aIndex); @@ -775,10 +775,10 @@ Statement::GetSharedString(uint32_t aIndex, uint32_t *_byteLength, } NS_IMETHODIMP -Statement::GetSharedBlob(uint32_t aIndex, uint32_t *_byteLength, - const uint8_t **_blob) { +Statement::GetSharedBlob(uint32_t aIndex, uint32_t* _byteLength, + const uint8_t** _blob) { *_blob = - static_cast(::sqlite3_column_blob(mDBStatement, aIndex)); + static_cast(::sqlite3_column_blob(mDBStatement, aIndex)); if (_byteLength) { *_byteLength = ::sqlite3_column_bytes(mDBStatement, aIndex); } @@ -786,7 +786,7 @@ Statement::GetSharedBlob(uint32_t aIndex, uint32_t *_byteLength, } NS_IMETHODIMP -Statement::GetIsNull(uint32_t aIndex, bool *_isNull) { +Statement::GetIsNull(uint32_t aIndex, bool* _isNull) { // Get type of Index will check aIndex for us, so we don't have to. int32_t type; nsresult rv = GetTypeOfIndex(aIndex, &type); diff --git a/storage/mozStorageStatement.h b/storage/mozStorageStatement.h index 50cb9cc600bf4..d170fb0cd6ef6 100644 --- a/storage/mozStorageStatement.h +++ b/storage/mozStorageStatement.h @@ -52,13 +52,13 @@ class Statement final : public mozIStorageStatement, * @param aSQLStatement * The SQL statement to prepare that this object will represent. */ - nsresult initialize(Connection *aDBConnection, sqlite3 *aNativeConnection, - const nsACString &aSQLStatement); + nsresult initialize(Connection* aDBConnection, sqlite3* aNativeConnection, + const nsACString& aSQLStatement); /** * Obtains the native statement pointer. */ - inline sqlite3_stmt *nativeStatement() { return mDBStatement; } + inline sqlite3_stmt* nativeStatement() { return mDBStatement; } /** * Obtains and transfers ownership of the array of parameters that are bound @@ -71,7 +71,7 @@ class Statement final : public mozIStorageStatement, private: ~Statement(); - sqlite3_stmt *mDBStatement; + sqlite3_stmt* mDBStatement; uint32_t mParamCount; uint32_t mResultColumnCount; nsTArray mColumnNames; @@ -81,7 +81,7 @@ class Statement final : public mozIStorageStatement, * @return a pointer to the BindingParams object to use with our Bind* * method. */ - mozIStorageBindingParams *getParams(); + mozIStorageBindingParams* getParams(); /** * Holds the array of parameters to bind to this statement when we execute @@ -109,8 +109,8 @@ class Statement final : public mozIStorageStatement, friend class StatementJSHelper; }; -inline nsISupports *ToSupports(Statement *p) { - return NS_ISUPPORTS_CAST(mozIStorageStatement *, p); +inline nsISupports* ToSupports(Statement* p) { + return NS_ISUPPORTS_CAST(mozIStorageStatement*, p); } } // namespace storage diff --git a/storage/mozStorageStatementData.h b/storage/mozStorageStatementData.h index c03d1423bb6bc..96efa67bba5d7 100644 --- a/storage/mozStorageStatementData.h +++ b/storage/mozStorageStatementData.h @@ -26,15 +26,15 @@ namespace storage { class StatementData { public: - StatementData(sqlite3_stmt *aStatement, + StatementData(sqlite3_stmt* aStatement, already_AddRefed aParamsArray, - StorageBaseStatementInternal *aStatementOwner) + StorageBaseStatementInternal* aStatementOwner) : mStatement(aStatement), mParamsArray(aParamsArray), mStatementOwner(aStatementOwner) { MOZ_ASSERT(mStatementOwner, "Must have a statement owner!"); } - StatementData(const StatementData &aSource) + StatementData(const StatementData& aSource) : mStatement(aSource.mStatement), mParamsArray(aSource.mParamsArray), mStatementOwner(aSource.mStatementOwner) { @@ -53,7 +53,7 @@ class StatementData { * Return the sqlite statement, fetching it from the storage statement. In * the case of AsyncStatements this may actually create the statement */ - inline int getSqliteStatement(sqlite3_stmt **_stmt) { + inline int getSqliteStatement(sqlite3_stmt** _stmt) { if (!mStatement) { int rc = mStatementOwner->getAsyncStatement(&mStatement); NS_ENSURE_TRUE(rc == SQLITE_OK, rc); @@ -62,7 +62,7 @@ class StatementData { return SQLITE_OK; } - operator BindingParamsArray *() const { return mParamsArray; } + operator BindingParamsArray*() const { return mParamsArray; } /** * NULLs out our sqlite3_stmt (it is held by the owner) after reseting it and @@ -103,7 +103,7 @@ class StatementData { // Be sure to use the getSqliteStatement helper, since sqlite3_stmt_readonly // can only analyze prepared statements and AsyncStatements are prepared // lazily. - sqlite3_stmt *stmt; + sqlite3_stmt* stmt; int rc = getSqliteStatement(&stmt); if (SQLITE_OK != rc || ::sqlite3_stmt_readonly(stmt)) { return 0; @@ -112,7 +112,7 @@ class StatementData { } private: - sqlite3_stmt *mStatement; + sqlite3_stmt* mStatement; RefPtr mParamsArray; /** diff --git a/storage/mozStorageStatementJSHelper.cpp b/storage/mozStorageStatementJSHelper.cpp index 3de884394769e..7fe6198650ac8 100644 --- a/storage/mozStorageStatementJSHelper.cpp +++ b/storage/mozStorageStatementJSHelper.cpp @@ -27,7 +27,7 @@ namespace storage { //////////////////////////////////////////////////////////////////////////////// //// Global Functions -static bool stepFunc(JSContext *aCtx, uint32_t argc, JS::Value *_vp) { +static bool stepFunc(JSContext* aCtx, uint32_t argc, JS::Value* _vp) { JS::CallArgs args = CallArgsFromVp(argc, _vp); nsCOMPtr xpc(nsIXPConnect::XPConnect()); @@ -38,7 +38,7 @@ static bool stepFunc(JSContext *aCtx, uint32_t argc, JS::Value *_vp) { return false; } - JSObject *obj = &args.thisv().toObject(); + JSObject* obj = &args.thisv().toObject(); nsresult rv = xpc->GetWrappedNativeOfJSObject(aCtx, obj, getter_AddRefs(wrapper)); if (NS_FAILED(rv)) { @@ -55,8 +55,8 @@ static bool stepFunc(JSContext *aCtx, uint32_t argc, JS::Value *_vp) { } #endif - Statement *stmt = static_cast( - static_cast(wrapper->Native())); + Statement* stmt = static_cast( + static_cast(wrapper->Native())); bool hasMore = false; rv = stmt->ExecuteStep(&hasMore); @@ -79,8 +79,8 @@ static bool stepFunc(JSContext *aCtx, uint32_t argc, JS::Value *_vp) { //////////////////////////////////////////////////////////////////////////////// //// StatementJSHelper -nsresult StatementJSHelper::getRow(Statement *aStatement, JSContext *aCtx, - JSObject *aScopeObj, JS::Value *_row) { +nsresult StatementJSHelper::getRow(Statement* aStatement, JSContext* aCtx, + JSObject* aScopeObj, JS::Value* _row) { MOZ_ASSERT(NS_IsMainThread()); #ifdef DEBUG @@ -113,7 +113,7 @@ nsresult StatementJSHelper::getRow(Statement *aStatement, JSContext *aCtx, } RefPtr row(aStatement->mStatementRowHolder->Get()); - JSObject *obj = row->WrapObject(aCtx, nullptr); + JSObject* obj = row->WrapObject(aCtx, nullptr); if (!obj) { return NS_ERROR_UNEXPECTED; } @@ -122,8 +122,8 @@ nsresult StatementJSHelper::getRow(Statement *aStatement, JSContext *aCtx, return NS_OK; } -nsresult StatementJSHelper::getParams(Statement *aStatement, JSContext *aCtx, - JSObject *aScopeObj, JS::Value *_params) { +nsresult StatementJSHelper::getParams(Statement* aStatement, JSContext* aCtx, + JSObject* aScopeObj, JS::Value* _params) { MOZ_ASSERT(NS_IsMainThread()); #ifdef DEBUG @@ -157,7 +157,7 @@ nsresult StatementJSHelper::getParams(Statement *aStatement, JSContext *aCtx, } RefPtr params(aStatement->mStatementParamsHolder->Get()); - JSObject *obj = params->WrapObject(aCtx, nullptr); + JSObject* obj = params->WrapObject(aCtx, nullptr); if (!obj) { return NS_ERROR_UNEXPECTED; } @@ -187,12 +187,12 @@ NS_INTERFACE_MAP_END #include "xpc_map_end.h" NS_IMETHODIMP -StatementJSHelper::Resolve(nsIXPConnectWrappedNative *aWrapper, JSContext *aCtx, - JSObject *aScopeObj, jsid aId, bool *aResolvedp, - bool *_retval) { +StatementJSHelper::Resolve(nsIXPConnectWrappedNative* aWrapper, JSContext* aCtx, + JSObject* aScopeObj, jsid aId, bool* aResolvedp, + bool* _retval) { if (!JSID_IS_STRING(aId)) return NS_OK; - JS::Rooted scope(aCtx, aScopeObj); + JS::Rooted scope(aCtx, aScopeObj); JS::Rooted id(aCtx, aId); #ifdef DEBUG @@ -203,10 +203,10 @@ StatementJSHelper::Resolve(nsIXPConnectWrappedNative *aWrapper, JSContext *aCtx, } #endif - Statement *stmt = static_cast( - static_cast(aWrapper->Native())); + Statement* stmt = static_cast( + static_cast(aWrapper->Native())); - JSFlatString *str = JSID_TO_FLAT_STRING(id); + JSFlatString* str = JSID_TO_FLAT_STRING(id); if (::JS_FlatStringEqualsAscii(str, "step")) { *_retval = ::JS_DefineFunction(aCtx, scope, "step", stepFunc, 0, JSPROP_RESOLVING) != nullptr; diff --git a/storage/mozStorageStatementJSHelper.h b/storage/mozStorageStatementJSHelper.h index e62a86e2e55e7..edc1e9717c96c 100644 --- a/storage/mozStorageStatementJSHelper.h +++ b/storage/mozStorageStatementJSHelper.h @@ -24,8 +24,8 @@ class StatementJSHelper : public nsIXPCScriptable { NS_DECL_NSIXPCSCRIPTABLE private: - nsresult getRow(Statement *, JSContext *, JSObject *, JS::Value *); - nsresult getParams(Statement *, JSContext *, JSObject *, JS::Value *); + nsresult getRow(Statement*, JSContext*, JSObject*, JS::Value*); + nsresult getParams(Statement*, JSContext*, JSObject*, JS::Value*); }; /** @@ -38,9 +38,9 @@ class StatementParamsHolder final : public nsISupports { public: NS_DECL_ISUPPORTS - explicit StatementParamsHolder(StatementParams *aParams) : mParams(aParams) {} + explicit StatementParamsHolder(StatementParams* aParams) : mParams(aParams) {} - StatementParams *Get() const { + StatementParams* Get() const { MOZ_ASSERT(mParams); return mParams; } @@ -55,9 +55,9 @@ class StatementRowHolder final : public nsISupports { public: NS_DECL_ISUPPORTS - explicit StatementRowHolder(StatementRow *aRow) : mRow(aRow) {} + explicit StatementRowHolder(StatementRow* aRow) : mRow(aRow) {} - StatementRow *Get() const { + StatementRow* Get() const { MOZ_ASSERT(mRow); return mRow; } diff --git a/storage/test/gtest/storage_test_harness.h b/storage/test/gtest/storage_test_harness.h index 9a2355472bdc1..bc8518200657e 100644 --- a/storage/test/gtest/storage_test_harness.h +++ b/storage/test/gtest/storage_test_harness.h @@ -99,12 +99,12 @@ AsyncStatementSpinner::AsyncStatementSpinner() : completionReason(0), mCompleted(false) {} NS_IMETHODIMP -AsyncStatementSpinner::HandleResult(mozIStorageResultSet *aResultSet) { +AsyncStatementSpinner::HandleResult(mozIStorageResultSet* aResultSet) { return NS_OK; } NS_IMETHODIMP -AsyncStatementSpinner::HandleError(mozIStorageError *aError) { +AsyncStatementSpinner::HandleError(mozIStorageError* aError) { int32_t result; nsresult rv = aError->GetResult(&result); NS_ENSURE_SUCCESS(rv, rv); @@ -131,7 +131,7 @@ AsyncStatementSpinner::HandleCompletion(uint16_t aReason) { } NS_IMETHODIMP -AsyncStatementSpinner::Complete(nsresult, nsISupports *) { +AsyncStatementSpinner::Complete(nsresult, nsISupports*) { mCompleted = true; return NS_OK; } @@ -146,7 +146,7 @@ void AsyncStatementSpinner::SpinUntilCompleted() { } #define NS_DECL_ASYNCSTATEMENTSPINNER \ - NS_IMETHOD HandleResult(mozIStorageResultSet *aResultSet) override; + NS_IMETHOD HandleResult(mozIStorageResultSet* aResultSet) override; //////////////////////////////////////////////////////////////////////////////// //// Async Helpers @@ -155,7 +155,7 @@ void AsyncStatementSpinner::SpinUntilCompleted() { * Execute an async statement, blocking the main thread until we get the * callback completion notification. */ -void blocking_async_execute(mozIStorageBaseStatement *stmt) { +void blocking_async_execute(mozIStorageBaseStatement* stmt) { RefPtr spinner(new AsyncStatementSpinner()); nsCOMPtr pendy; @@ -167,7 +167,7 @@ void blocking_async_execute(mozIStorageBaseStatement *stmt) { * Invoke AsyncClose on the given connection, blocking the main thread until we * get the completion notification. */ -void blocking_async_close(mozIStorageConnection *db) { +void blocking_async_close(mozIStorageConnection* db) { RefPtr spinner(new AsyncStatementSpinner()); db->AsyncClose(spinner); @@ -190,7 +190,7 @@ sqlite3_mutex_methods orig_mutex_methods; sqlite3_mutex_methods wrapped_mutex_methods; bool mutex_used_on_watched_thread = false; -PRThread *watched_thread = nullptr; +PRThread* watched_thread = nullptr; /** * Ugly hack to let us figure out what a connection's async thread is. If we * were MOZILLA_INTERNAL_API and linked as such we could just include @@ -200,13 +200,13 @@ PRThread *watched_thread = nullptr; * When the thread a mutex is invoked on isn't watched_thread we save it to this * variable. */ -nsIThread *last_non_watched_thread = nullptr; +nsIThread* last_non_watched_thread = nullptr; /** * Set a flag if the mutex is used on the thread we are watching, but always * call the real mutex function. */ -extern "C" void wrapped_MutexEnter(sqlite3_mutex *mutex) { +extern "C" void wrapped_MutexEnter(sqlite3_mutex* mutex) { if (PR_GetCurrentThread() == watched_thread) mutex_used_on_watched_thread = true; else @@ -214,7 +214,7 @@ extern "C" void wrapped_MutexEnter(sqlite3_mutex *mutex) { orig_mutex_methods.xMutexEnter(mutex); } -extern "C" int wrapped_MutexTry(sqlite3_mutex *mutex) { +extern "C" int wrapped_MutexTry(sqlite3_mutex* mutex) { if (::PR_GetCurrentThread() == watched_thread) mutex_used_on_watched_thread = true; return orig_mutex_methods.xMutexTry(mutex); @@ -266,7 +266,7 @@ void watch_for_mutex_use_on_this_thread() { */ class ThreadWedger : public mozilla::Runnable { public: - explicit ThreadWedger(nsIEventTarget *aTarget) + explicit ThreadWedger(nsIEventTarget* aTarget) : mozilla::Runnable("ThreadWedger"), mReentrantMonitor("thread wedger"), unwedged(false) { @@ -300,7 +300,7 @@ class ThreadWedger : public mozilla::Runnable { * creating a statement and async dispatching we can tell from the mutex who * is the async thread, PRThread style. Then we map that to an nsIThread. */ -already_AddRefed get_conn_async_thread(mozIStorageConnection *db) { +already_AddRefed get_conn_async_thread(mozIStorageConnection* db) { // Make sure we are tracking the current thread as the watched thread watch_for_mutex_use_on_this_thread(); diff --git a/storage/test/gtest/test_AsXXX_helpers.cpp b/storage/test/gtest/test_AsXXX_helpers.cpp index 4fef8693a9474..2594b5cf7e26c 100644 --- a/storage/test/gtest/test_AsXXX_helpers.cpp +++ b/storage/test/gtest/test_AsXXX_helpers.cpp @@ -27,7 +27,7 @@ class Spinner : public AsyncStatementSpinner { NS_IMPL_ISUPPORTS_INHERITED0(Spinner, AsyncStatementSpinner) NS_IMETHODIMP -Spinner::HandleResult(mozIStorageResultSet *aResultSet) { +Spinner::HandleResult(mozIStorageResultSet* aResultSet) { nsCOMPtr row; do_check_true(NS_SUCCEEDED(aResultSet->GetNextRow(getter_AddRefs(row))) && row); @@ -37,13 +37,13 @@ Spinner::HandleResult(mozIStorageResultSet *aResultSet) { do_check_eq(row->AsDouble(0), 0.0); uint32_t len = 100; - do_check_eq(row->AsSharedUTF8String(0, &len), (const char *)nullptr); + do_check_eq(row->AsSharedUTF8String(0, &len), (const char*)nullptr); do_check_eq(len, 0); len = 100; - do_check_eq(row->AsSharedWString(0, &len), (const char16_t *)nullptr); + do_check_eq(row->AsSharedWString(0, &len), (const char16_t*)nullptr); do_check_eq(len, 0); len = 100; - do_check_eq(row->AsSharedBlob(0, &len), (const uint8_t *)nullptr); + do_check_eq(row->AsSharedBlob(0, &len), (const uint8_t*)nullptr); do_check_eq(len, 0); do_check_eq(row->IsNull(0), true); @@ -68,13 +68,13 @@ TEST(storage_AsXXX_helpers, NULLFallback) do_check_eq(stmt->AsInt64(0), 0); do_check_eq(stmt->AsDouble(0), 0.0); uint32_t len = 100; - do_check_eq(stmt->AsSharedUTF8String(0, &len), (const char *)nullptr); + do_check_eq(stmt->AsSharedUTF8String(0, &len), (const char*)nullptr); do_check_eq(len, 0); len = 100; - do_check_eq(stmt->AsSharedWString(0, &len), (const char16_t *)nullptr); + do_check_eq(stmt->AsSharedWString(0, &len), (const char16_t*)nullptr); do_check_eq(len, 0); len = 100; - do_check_eq(stmt->AsSharedBlob(0, &len), (const uint8_t *)nullptr); + do_check_eq(stmt->AsSharedBlob(0, &len), (const uint8_t*)nullptr); do_check_eq(len, 0); do_check_eq(stmt->IsNull(0), true); @@ -82,13 +82,13 @@ TEST(storage_AsXXX_helpers, NULLFallback) do_check_eq(valueArray->AsInt64(0), 0); do_check_eq(valueArray->AsDouble(0), 0.0); len = 100; - do_check_eq(valueArray->AsSharedUTF8String(0, &len), (const char *)nullptr); + do_check_eq(valueArray->AsSharedUTF8String(0, &len), (const char*)nullptr); do_check_eq(len, 0); len = 100; - do_check_eq(valueArray->AsSharedWString(0, &len), (const char16_t *)nullptr); + do_check_eq(valueArray->AsSharedWString(0, &len), (const char16_t*)nullptr); do_check_eq(len, 0); len = 100; - do_check_eq(valueArray->AsSharedBlob(0, &len), (const uint8_t *)nullptr); + do_check_eq(valueArray->AsSharedBlob(0, &len), (const uint8_t*)nullptr); do_check_eq(len, 0); do_check_eq(valueArray->IsNull(0), true); } diff --git a/storage/test/gtest/test_asyncStatementExecution_transaction.cpp b/storage/test/gtest/test_asyncStatementExecution_transaction.cpp index 4d4ffe5829be0..9086980526760 100644 --- a/storage/test/gtest/test_asyncStatementExecution_transaction.cpp +++ b/storage/test/gtest/test_asyncStatementExecution_transaction.cpp @@ -20,8 +20,8 @@ using namespace mozilla::storage; * @param aArg * An integer pointer that will be incremented for each commit. */ -int commit_hook(void *aArg) { - int *arg = static_cast(aArg); +int commit_hook(void* aArg) { + int* arg = static_cast(aArg); (*arg)++; return 0; } @@ -39,12 +39,12 @@ int commit_hook(void *aArg) { * @param aTransactionExpected * Whether a transaction is expected or not. */ -void check_transaction(mozIStorageConnection *aDB, - mozIStorageBaseStatement **aStmts, uint32_t aStmtsLen, +void check_transaction(mozIStorageConnection* aDB, + mozIStorageBaseStatement** aStmts, uint32_t aStmtsLen, bool aTransactionExpected) { // -- install a transaction commit hook. int commit = 0; - static_cast(aDB)->setCommitHook(commit_hook, &commit); + static_cast(aDB)->setCommitHook(commit_hook, &commit); RefPtr asyncSpin(new AsyncStatementSpinner()); nsCOMPtr asyncPend; @@ -56,7 +56,7 @@ void check_transaction(mozIStorageConnection *aDB, asyncSpin->SpinUntilCompleted(); // -- uninstall the transaction commit hook. - static_cast(aDB)->setCommitHook(nullptr); + static_cast(aDB)->setCommitHook(nullptr); // -- check transaction do_check_eq(aTransactionExpected, !!commit); @@ -93,7 +93,7 @@ TEST(storage_asyncStatementExecution_transaction, MultipleAsyncReadStatements) db->CreateAsyncStatement(NS_LITERAL_CSTRING("SELECT * FROM sqlite_master"), getter_AddRefs(stmt2)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt1, stmt2, }; @@ -118,7 +118,7 @@ TEST(storage_asyncStatementExecution_transaction, MultipleReadStatements) db->CreateStatement(NS_LITERAL_CSTRING("SELECT * FROM sqlite_master"), getter_AddRefs(stmt2)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt1, stmt2, }; @@ -145,7 +145,7 @@ TEST(storage_asyncStatementExecution_transaction, NS_LITERAL_CSTRING("CREATE TABLE test (id INTEGER PRIMARY KEY)"), getter_AddRefs(stmt2)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt1, stmt2, }; @@ -170,7 +170,7 @@ TEST(storage_asyncStatementExecution_transaction, MultipleReadWriteStatements) NS_LITERAL_CSTRING("CREATE TABLE test (id INTEGER PRIMARY KEY)"), getter_AddRefs(stmt2)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt1, stmt2, }; @@ -197,7 +197,7 @@ TEST(storage_asyncStatementExecution_transaction, MultipleAsyncWriteStatements) NS_LITERAL_CSTRING("CREATE TABLE test2 (id INTEGER PRIMARY KEY)"), getter_AddRefs(stmt2)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt1, stmt2, }; @@ -224,7 +224,7 @@ TEST(storage_asyncStatementExecution_transaction, MultipleWriteStatements) NS_LITERAL_CSTRING("CREATE TABLE test2 (id INTEGER PRIMARY KEY)"), getter_AddRefs(stmt2)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt1, stmt2, }; @@ -245,7 +245,7 @@ TEST(storage_asyncStatementExecution_transaction, SingleAsyncReadStatement) db->CreateAsyncStatement(NS_LITERAL_CSTRING("SELECT * FROM sqlite_master"), getter_AddRefs(stmt)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt, }; @@ -265,7 +265,7 @@ TEST(storage_asyncStatementExecution_transaction, SingleReadStatement) db->CreateStatement(NS_LITERAL_CSTRING("SELECT * FROM sqlite_master"), getter_AddRefs(stmt)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt, }; @@ -286,7 +286,7 @@ TEST(storage_asyncStatementExecution_transaction, SingleAsyncWriteStatement) NS_LITERAL_CSTRING("CREATE TABLE test (id INTEGER PRIMARY KEY)"), getter_AddRefs(stmt)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt, }; @@ -306,7 +306,7 @@ TEST(storage_asyncStatementExecution_transaction, SingleWriteStatement) NS_LITERAL_CSTRING("CREATE TABLE test (id INTEGER PRIMARY KEY)"), getter_AddRefs(stmt)); - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt, }; @@ -340,7 +340,7 @@ TEST(storage_asyncStatementExecution_transaction, stmt->BindParameters(paramsArray); paramsArray = nullptr; - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt, }; @@ -372,7 +372,7 @@ TEST(storage_asyncStatementExecution_transaction, MultipleParamsReadStatement) stmt->BindParameters(paramsArray); paramsArray = nullptr; - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt, }; @@ -414,7 +414,7 @@ TEST(storage_asyncStatementExecution_transaction, stmt->BindParameters(paramsArray); paramsArray = nullptr; - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt, }; @@ -454,7 +454,7 @@ TEST(storage_asyncStatementExecution_transaction, MultipleParamsWriteStatement) stmt->BindParameters(paramsArray); paramsArray = nullptr; - mozIStorageBaseStatement *stmts[] = { + mozIStorageBaseStatement* stmts[] = { stmt, }; diff --git a/storage/test/gtest/test_mutex.cpp b/storage/test/gtest/test_mutex.cpp index 906d7c29a5d02..db1a645e09d5d 100644 --- a/storage/test/gtest/test_mutex.cpp +++ b/storage/test/gtest/test_mutex.cpp @@ -25,7 +25,7 @@ TEST(storage_mutex, AutoLock) // Get our test mutex (we have to allocate a SQLite mutex of the right type // too!). SQLiteMutex mutex("TestMutex"); - sqlite3_mutex *inner = sqlite3_mutex_alloc(lockType); + sqlite3_mutex* inner = sqlite3_mutex_alloc(lockType); do_check_true(inner); mutex.initWithMutex(inner); @@ -52,7 +52,7 @@ TEST(storage_mutex, AutoUnlock) // Get our test mutex (we have to allocate a SQLite mutex of the right type // too!). SQLiteMutex mutex("TestMutex"); - sqlite3_mutex *inner = sqlite3_mutex_alloc(lockType); + sqlite3_mutex* inner = sqlite3_mutex_alloc(lockType); do_check_true(inner); mutex.initWithMutex(inner); diff --git a/storage/variantToSQLiteT_impl.h b/storage/variantToSQLiteT_impl.h index ab1a20d8d4401..cadaa3f176657 100644 --- a/storage/variantToSQLiteT_impl.h +++ b/storage/variantToSQLiteT_impl.h @@ -13,7 +13,7 @@ //// variantToSQLiteT Implementation template -int variantToSQLiteT(T aObj, nsIVariant *aValue) { +int variantToSQLiteT(T aObj, nsIVariant* aValue) { // Allow to return nullptr not wrapped to nsIVariant for speed. if (!aValue) return sqlite3_T_null(aObj); @@ -84,7 +84,7 @@ int variantToSQLiteT(T aObj, nsIVariant *aValue) { uint16_t arrayType; nsIID iid; uint32_t count; - void *data; + void* data; nsresult rv = aValue->GetAsArray(&arrayType, &iid, &count, &data); NS_ENSURE_SUCCESS(rv, SQLITE_MISMATCH); diff --git a/toolkit/components/autocomplete/nsAutoCompleteController.cpp b/toolkit/components/autocomplete/nsAutoCompleteController.cpp index 20e51d316da07..3f3cd496b3265 100644 --- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp +++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp @@ -19,7 +19,7 @@ #include "mozilla/dom/KeyboardEventBinding.h" #include "mozilla/dom/Event.h" -static const char *kAutoCompleteSearchCID = +static const char* kAutoCompleteSearchCID = "@mozilla.org/autocomplete/search;1?name="; using namespace mozilla; @@ -61,7 +61,7 @@ nsAutoCompleteController::nsAutoCompleteController() nsAutoCompleteController::~nsAutoCompleteController() { SetInput(nullptr); } -void nsAutoCompleteController::SetValueOfInputTo(const nsString &aValue, +void nsAutoCompleteController::SetValueOfInputTo(const nsString& aValue, uint16_t aReason) { mSetValue = aValue; nsCOMPtr input(mInput); @@ -75,19 +75,19 @@ void nsAutoCompleteController::SetValueOfInputTo(const nsString &aValue, //// nsIAutoCompleteController NS_IMETHODIMP -nsAutoCompleteController::GetSearchStatus(uint16_t *aSearchStatus) { +nsAutoCompleteController::GetSearchStatus(uint16_t* aSearchStatus) { *aSearchStatus = mSearchStatus; return NS_OK; } NS_IMETHODIMP -nsAutoCompleteController::GetMatchCount(uint32_t *aMatchCount) { +nsAutoCompleteController::GetMatchCount(uint32_t* aMatchCount) { *aMatchCount = mMatchCount; return NS_OK; } NS_IMETHODIMP -nsAutoCompleteController::GetInput(nsIAutoCompleteInput **aInput) { +nsAutoCompleteController::GetInput(nsIAutoCompleteInput** aInput) { *aInput = mInput; NS_IF_ADDREF(*aInput); return NS_OK; @@ -113,7 +113,7 @@ nsAutoCompleteController::SetInitiallySelectedIndex(int32_t aSelectedIndex) { } NS_IMETHODIMP -nsAutoCompleteController::SetInput(nsIAutoCompleteInput *aInput) { +nsAutoCompleteController::SetInput(nsIAutoCompleteInput* aInput) { // Don't do anything if the input isn't changing. if (mInput == aInput) return NS_OK; @@ -165,7 +165,7 @@ nsAutoCompleteController::ResetInternalState() { } NS_IMETHODIMP -nsAutoCompleteController::StartSearch(const nsAString &aSearchString) { +nsAutoCompleteController::StartSearch(const nsAString& aSearchString) { // If composition is ongoing don't start searching yet, until it is committed. if (mCompositionState == eCompositionState_Composing) { return NS_OK; @@ -177,7 +177,7 @@ nsAutoCompleteController::StartSearch(const nsAString &aSearchString) { } NS_IMETHODIMP -nsAutoCompleteController::HandleText(bool *_retval) { +nsAutoCompleteController::HandleText(bool* _retval) { *_retval = false; // Note: the events occur in the following order when IME is used. // 1. a compositionstart event(HandleStartComposition) @@ -295,7 +295,7 @@ nsAutoCompleteController::HandleText(bool *_retval) { NS_IMETHODIMP nsAutoCompleteController::HandleEnter(bool aIsPopupSelection, - dom::Event *aEvent, bool *_retval) { + dom::Event* aEvent, bool* _retval) { *_retval = false; if (!mInput) return NS_OK; @@ -327,7 +327,7 @@ nsAutoCompleteController::HandleEnter(bool aIsPopupSelection, } NS_IMETHODIMP -nsAutoCompleteController::HandleEscape(bool *_retval) { +nsAutoCompleteController::HandleEscape(bool* _retval) { *_retval = false; if (!mInput) return NS_OK; @@ -394,7 +394,7 @@ nsAutoCompleteController::HandleTab() { } NS_IMETHODIMP -nsAutoCompleteController::HandleKeyNavigation(uint32_t aKey, bool *_retval) { +nsAutoCompleteController::HandleKeyNavigation(uint32_t aKey, bool* _retval) { // By default, don't cancel the event *_retval = false; @@ -641,7 +641,7 @@ nsAutoCompleteController::HandleKeyNavigation(uint32_t aKey, bool *_retval) { } NS_IMETHODIMP -nsAutoCompleteController::HandleDelete(bool *_retval) { +nsAutoCompleteController::HandleDelete(bool* _retval) { *_retval = false; if (!mInput) return NS_OK; @@ -670,7 +670,7 @@ nsAutoCompleteController::HandleDelete(bool *_retval) { MatchIndexToSearch(index, &searchIndex, &matchIndex); NS_ENSURE_TRUE(searchIndex >= 0 && matchIndex >= 0, NS_ERROR_FAILURE); - nsIAutoCompleteResult *result = mResults.SafeObjectAt(searchIndex); + nsIAutoCompleteResult* result = mResults.SafeObjectAt(searchIndex); NS_ENSURE_TRUE(result, NS_ERROR_FAILURE); nsAutoString search; @@ -721,8 +721,8 @@ nsAutoCompleteController::HandleDelete(bool *_retval) { } nsresult nsAutoCompleteController::GetResultAt(int32_t aIndex, - nsIAutoCompleteResult **aResult, - int32_t *aMatchIndex) { + nsIAutoCompleteResult** aResult, + int32_t* aMatchIndex) { int32_t searchIndex; MatchIndexToSearch(aIndex, &searchIndex, aMatchIndex); NS_ENSURE_TRUE(searchIndex >= 0 && *aMatchIndex >= 0, NS_ERROR_FAILURE); @@ -733,23 +733,23 @@ nsresult nsAutoCompleteController::GetResultAt(int32_t aIndex, } NS_IMETHODIMP -nsAutoCompleteController::GetValueAt(int32_t aIndex, nsAString &_retval) { +nsAutoCompleteController::GetValueAt(int32_t aIndex, nsAString& _retval) { GetResultLabelAt(aIndex, _retval); return NS_OK; } NS_IMETHODIMP -nsAutoCompleteController::GetLabelAt(int32_t aIndex, nsAString &_retval) { +nsAutoCompleteController::GetLabelAt(int32_t aIndex, nsAString& _retval) { GetResultLabelAt(aIndex, _retval); return NS_OK; } NS_IMETHODIMP -nsAutoCompleteController::GetCommentAt(int32_t aIndex, nsAString &_retval) { +nsAutoCompleteController::GetCommentAt(int32_t aIndex, nsAString& _retval) { int32_t matchIndex; - nsIAutoCompleteResult *result; + nsIAutoCompleteResult* result; nsresult rv = GetResultAt(aIndex, &result, &matchIndex); NS_ENSURE_SUCCESS(rv, rv); @@ -757,9 +757,9 @@ nsAutoCompleteController::GetCommentAt(int32_t aIndex, nsAString &_retval) { } NS_IMETHODIMP -nsAutoCompleteController::GetStyleAt(int32_t aIndex, nsAString &_retval) { +nsAutoCompleteController::GetStyleAt(int32_t aIndex, nsAString& _retval) { int32_t matchIndex; - nsIAutoCompleteResult *result; + nsIAutoCompleteResult* result; nsresult rv = GetResultAt(aIndex, &result, &matchIndex); NS_ENSURE_SUCCESS(rv, rv); @@ -767,9 +767,9 @@ nsAutoCompleteController::GetStyleAt(int32_t aIndex, nsAString &_retval) { } NS_IMETHODIMP -nsAutoCompleteController::GetImageAt(int32_t aIndex, nsAString &_retval) { +nsAutoCompleteController::GetImageAt(int32_t aIndex, nsAString& _retval) { int32_t matchIndex; - nsIAutoCompleteResult *result; + nsIAutoCompleteResult* result; nsresult rv = GetResultAt(aIndex, &result, &matchIndex); NS_ENSURE_SUCCESS(rv, rv); @@ -778,9 +778,9 @@ nsAutoCompleteController::GetImageAt(int32_t aIndex, nsAString &_retval) { NS_IMETHODIMP nsAutoCompleteController::GetFinalCompleteValueAt(int32_t aIndex, - nsAString &_retval) { + nsAString& _retval) { int32_t matchIndex; - nsIAutoCompleteResult *result; + nsIAutoCompleteResult* result; nsresult rv = GetResultAt(aIndex, &result, &matchIndex); NS_ENSURE_SUCCESS(rv, rv); @@ -788,13 +788,13 @@ nsAutoCompleteController::GetFinalCompleteValueAt(int32_t aIndex, } NS_IMETHODIMP -nsAutoCompleteController::SetSearchString(const nsAString &aSearchString) { +nsAutoCompleteController::SetSearchString(const nsAString& aSearchString) { SetSearchStringInternal(aSearchString); return NS_OK; } NS_IMETHODIMP -nsAutoCompleteController::GetSearchString(nsAString &aSearchString) { +nsAutoCompleteController::GetSearchString(nsAString& aSearchString) { aSearchString = mSearchString; return NS_OK; } @@ -803,8 +803,8 @@ nsAutoCompleteController::GetSearchString(nsAString &aSearchString) { //// nsIAutoCompleteObserver NS_IMETHODIMP -nsAutoCompleteController::OnSearchResult(nsIAutoCompleteSearch *aSearch, - nsIAutoCompleteResult *aResult) { +nsAutoCompleteController::OnSearchResult(nsIAutoCompleteSearch* aSearch, + nsIAutoCompleteResult* aResult) { MOZ_ASSERT(mSearchesOngoing > 0 && mSearches.Contains(aSearch)); uint16_t result = 0; @@ -838,7 +838,7 @@ nsAutoCompleteController::OnSearchResult(nsIAutoCompleteSearch *aSearch, MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHODIMP -nsAutoCompleteController::Notify(nsITimer *timer) { +nsAutoCompleteController::Notify(nsITimer* timer) { mTimer = nullptr; if (mImmediateSearchesCount == 0) { @@ -856,7 +856,7 @@ nsAutoCompleteController::Notify(nsITimer *timer) { //// nsINamed NS_IMETHODIMP -nsAutoCompleteController::GetName(nsACString &aName) { +nsAutoCompleteController::GetName(nsACString& aName) { aName.AssignLiteral("nsAutoCompleteController"); return NS_OK; } @@ -935,7 +935,7 @@ nsresult nsAutoCompleteController::StartSearch(uint16_t aSearchType) { if (searchDesc) searchDesc->GetSearchType(&searchType); if (searchType != aSearchType) continue; - nsIAutoCompleteResult *result = mResultCache.SafeObjectAt(i); + nsIAutoCompleteResult* result = mResultCache.SafeObjectAt(i); if (result) { uint16_t searchResult; @@ -966,7 +966,7 @@ nsresult nsAutoCompleteController::StartSearch(uint16_t aSearchType) { } rv = search->StartSearch(mSearchString, searchParam, result, - static_cast(this)); + static_cast(this)); if (NS_FAILED(rv)) { ++mSearchesFailed; MOZ_ASSERT(mSearchesOngoing > 0); @@ -1064,7 +1064,7 @@ nsresult nsAutoCompleteController::StartSearches() { mSearches.SetCapacity(searchCount); mImmediateSearchesCount = 0; - const char *searchCID = kAutoCompleteSearchCID; + const char* searchCID = kAutoCompleteSearchCID; for (uint32_t i = 0; i < searchCount; ++i) { // Use the search name to create the contract id string for the search @@ -1148,7 +1148,7 @@ nsresult nsAutoCompleteController::ClearSearchTimer() { } nsresult nsAutoCompleteController::EnterMatch(bool aIsPopupSelection, - dom::Event *aEvent) { + dom::Event* aEvent) { nsCOMPtr input(mInput); nsCOMPtr popup(GetPopup()); NS_ENSURE_TRUE(popup != nullptr, NS_ERROR_FAILURE); @@ -1226,7 +1226,7 @@ nsresult nsAutoCompleteController::EnterMatch(bool aIsPopupSelection, } for (uint32_t i = 0; i < mResults.Length(); ++i) { - nsIAutoCompleteResult *result = mResults[i]; + nsIAutoCompleteResult* result = mResults[i]; if (result) { uint32_t matchCount = 0; result->GetMatchCount(&matchCount); @@ -1249,7 +1249,7 @@ nsresult nsAutoCompleteController::EnterMatch(bool aIsPopupSelection, // Since nothing was selected, and forceComplete is specified, that means // we have to find the first default match and enter it instead. for (uint32_t i = 0; i < mResults.Length(); ++i) { - nsIAutoCompleteResult *result = mResults[i]; + nsIAutoCompleteResult* result = mResults[i]; if (result) { int32_t defaultIndex; result->GetDefaultIndex(&defaultIndex); @@ -1323,7 +1323,7 @@ nsresult nsAutoCompleteController::RevertTextValue() { } nsresult nsAutoCompleteController::ProcessResult( - int32_t aSearchIndex, nsIAutoCompleteResult *aResult) { + int32_t aSearchIndex, nsIAutoCompleteResult* aResult) { NS_ENSURE_STATE(mInput); MOZ_ASSERT(aResult, "ProcessResult should always receive a result"); NS_ENSURE_ARG(aResult); @@ -1339,7 +1339,7 @@ nsresult nsAutoCompleteController::ProcessResult( // This way both mSearches and mResults can be indexed by the search index, // cause we'll always have only one result per search. if (mResults.IndexOf(aResult) == -1) { - nsIAutoCompleteResult *oldResult = mResults.SafeObjectAt(aSearchIndex); + nsIAutoCompleteResult* oldResult = mResults.SafeObjectAt(aSearchIndex); if (oldResult) { MOZ_ASSERT(false, "Passing new matches to OnSearchResult with a new " @@ -1376,7 +1376,7 @@ nsresult nsAutoCompleteController::ProcessResult( // Increase the match count for all matches in this result. uint32_t totalMatchCount = 0; for (uint32_t i = 0; i < mResults.Length(); i++) { - nsIAutoCompleteResult *result = mResults.SafeObjectAt(i); + nsIAutoCompleteResult* result = mResults.SafeObjectAt(i); if (result) { uint32_t matchCount = 0; result->GetMatchCount(&matchCount); @@ -1504,14 +1504,14 @@ nsresult nsAutoCompleteController::CompleteDefaultIndex(int32_t aResultIndex) { } nsresult nsAutoCompleteController::GetDefaultCompleteResult( - int32_t aResultIndex, nsIAutoCompleteResult **_result, - int32_t *_defaultIndex) { + int32_t aResultIndex, nsIAutoCompleteResult** _result, + int32_t* _defaultIndex) { *_defaultIndex = -1; int32_t resultIndex = aResultIndex; // If a result index was not provided, find the first defaultIndex result. for (int32_t i = 0; resultIndex < 0 && i < mResults.Count(); ++i) { - nsIAutoCompleteResult *result = mResults.SafeObjectAt(i); + nsIAutoCompleteResult* result = mResults.SafeObjectAt(i); if (result && NS_SUCCEEDED(result->GetDefaultIndex(_defaultIndex)) && *_defaultIndex >= 0) { resultIndex = i; @@ -1551,8 +1551,8 @@ nsresult nsAutoCompleteController::GetDefaultCompleteResult( nsresult nsAutoCompleteController::GetDefaultCompleteValue(int32_t aResultIndex, bool aPreserveCasing, - nsAString &_retval) { - nsIAutoCompleteResult *result; + nsAString& _retval) { + nsIAutoCompleteResult* result; int32_t defaultIndex = -1; nsresult rv = GetDefaultCompleteResult(aResultIndex, &result, &defaultIndex); if (NS_FAILED(rv)) return rv; @@ -1582,10 +1582,10 @@ nsresult nsAutoCompleteController::GetDefaultCompleteValue(int32_t aResultIndex, } nsresult nsAutoCompleteController::GetFinalDefaultCompleteValue( - nsAString &_retval) { + nsAString& _retval) { MOZ_ASSERT(mInput, "Must have a valid input"); nsCOMPtr input(mInput); - nsIAutoCompleteResult *result; + nsIAutoCompleteResult* result; int32_t defaultIndex = -1; nsresult rv = GetDefaultCompleteResult(-1, &result, &defaultIndex); if (NS_FAILED(rv)) return rv; @@ -1606,7 +1606,7 @@ nsresult nsAutoCompleteController::GetFinalDefaultCompleteValue( return NS_OK; } -nsresult nsAutoCompleteController::CompleteValue(nsString &aValue) +nsresult nsAutoCompleteController::CompleteValue(nsString& aValue) /* mInput contains mSearchString, which we want to autocomplete to aValue. If * selectDifference is true, select the remaining portion of aValue not * contained in mSearchString. */ @@ -1673,25 +1673,25 @@ nsresult nsAutoCompleteController::CompleteValue(nsString &aValue) } nsresult nsAutoCompleteController::GetResultLabelAt(int32_t aIndex, - nsAString &_retval) { + nsAString& _retval) { return GetResultValueLabelAt(aIndex, false, false, _retval); } nsresult nsAutoCompleteController::GetResultValueAt(int32_t aIndex, bool aGetFinalValue, - nsAString &_retval) { + nsAString& _retval) { return GetResultValueLabelAt(aIndex, aGetFinalValue, true, _retval); } nsresult nsAutoCompleteController::GetResultValueLabelAt(int32_t aIndex, bool aGetFinalValue, bool aGetValue, - nsAString &_retval) { + nsAString& _retval) { NS_ENSURE_TRUE(aIndex >= 0 && static_cast(aIndex) < mMatchCount, NS_ERROR_ILLEGAL_VALUE); int32_t matchIndex; - nsIAutoCompleteResult *result; + nsIAutoCompleteResult* result; nsresult rv = GetResultAt(aIndex, &result, &matchIndex); NS_ENSURE_SUCCESS(rv, rv); @@ -1725,8 +1725,8 @@ nsresult nsAutoCompleteController::GetResultValueLabelAt(int32_t aIndex, * the search's results list. */ nsresult nsAutoCompleteController::MatchIndexToSearch(int32_t aMatchIndex, - int32_t *aSearchIndex, - int32_t *aItemIndex) { + int32_t* aSearchIndex, + int32_t* aItemIndex) { *aSearchIndex = -1; *aItemIndex = -1; @@ -1735,7 +1735,7 @@ nsresult nsAutoCompleteController::MatchIndexToSearch(int32_t aMatchIndex, // Move index through the results of each registered nsIAutoCompleteSearch // until we find the given match for (uint32_t i = 0; i < mSearches.Length(); ++i) { - nsIAutoCompleteResult *result = mResults.SafeObjectAt(i); + nsIAutoCompleteResult* result = mResults.SafeObjectAt(i); if (!result) continue; uint32_t matchCount = 0; diff --git a/toolkit/components/build/nsToolkitCompsModule.cpp b/toolkit/components/build/nsToolkitCompsModule.cpp index d17e8fff2a21e..838a8fc88b459 100644 --- a/toolkit/components/build/nsToolkitCompsModule.cpp +++ b/toolkit/components/build/nsToolkitCompsModule.cpp @@ -20,9 +20,9 @@ using namespace mozilla; ///////////////////////////////////////////////////////////////////////////// -nsresult nsUrlClassifierDBServiceConstructor(nsISupports *aOuter, - const nsIID &aIID, - void **aResult) { +nsresult nsUrlClassifierDBServiceConstructor(nsISupports* aOuter, + const nsIID& aIID, + void** aResult) { nsresult rv; NS_ENSURE_ARG_POINTER(aResult); NS_ENSURE_NO_AGGREGATION(aOuter); diff --git a/toolkit/components/build/nsToolkitCompsModule.h b/toolkit/components/build/nsToolkitCompsModule.h index 50108e3441f1d..acb5910dd3925 100644 --- a/toolkit/components/build/nsToolkitCompsModule.h +++ b/toolkit/components/build/nsToolkitCompsModule.h @@ -7,5 +7,5 @@ class nsISupports; -nsresult nsUrlClassifierDBServiceConstructor(nsISupports *aOuter, - const nsIID &aIID, void **aResult); +nsresult nsUrlClassifierDBServiceConstructor(nsISupports* aOuter, + const nsIID& aIID, void** aResult); diff --git a/toolkit/components/ctypes/tests/jsctypes-test-finalizer.cpp b/toolkit/components/ctypes/tests/jsctypes-test-finalizer.cpp index b46280632c809..bdbe8637914ec 100644 --- a/toolkit/components/ctypes/tests/jsctypes-test-finalizer.cpp +++ b/toolkit/components/ctypes/tests/jsctypes-test-finalizer.cpp @@ -14,13 +14,13 @@ * - 1: acquired * - < 0: error, resource has been released several times. */ -int *gFinalizerTestResources = nullptr; -char **gFinalizerTestNames = nullptr; +int* gFinalizerTestResources = nullptr; +char** gFinalizerTestNames = nullptr; size_t gFinalizerTestSize; void test_finalizer_start(size_t size) { gFinalizerTestResources = new int[size]; - gFinalizerTestNames = new char *[size]; + gFinalizerTestNames = new char*[size]; gFinalizerTestSize = size; for (size_t i = 0; i < size; ++i) { gFinalizerTestResources[i] = 0; @@ -106,50 +106,50 @@ bool test_finalizer_cmp_int64_t(int64_t a, int64_t b) { return a == b; } // Resource type: void* // Acquire resource i -void *test_finalizer_acq_ptr_t(size_t i) { +void* test_finalizer_acq_ptr_t(size_t i) { gFinalizerTestResources[i] = 1; - return (void *)&gFinalizerTestResources[i]; + return (void*)&gFinalizerTestResources[i]; } // Release resource i -void test_finalizer_rel_ptr_t(void *i) { - int *as_int = (int *)i; +void test_finalizer_rel_ptr_t(void* i) { + int* as_int = (int*)i; --(*as_int); if (*as_int < 0) { MOZ_CRASH("Assertion failed"); } } -bool test_finalizer_cmp_ptr_t(void *a, void *b) { return a == b; } +bool test_finalizer_cmp_ptr_t(void* a, void* b) { return a == b; } // Resource type: int32_t* // Acquire resource i -int32_t *test_finalizer_acq_int32_ptr_t(size_t i) { +int32_t* test_finalizer_acq_int32_ptr_t(size_t i) { gFinalizerTestResources[i] = 1; - return (int32_t *)&gFinalizerTestResources[i]; + return (int32_t*)&gFinalizerTestResources[i]; } // Release resource i -void test_finalizer_rel_int32_ptr_t(int32_t *i) { +void test_finalizer_rel_int32_ptr_t(int32_t* i) { --(*i); if (*i < 0) { MOZ_CRASH("Assertion failed"); } } -bool test_finalizer_cmp_int32_ptr_t(int32_t *a, int32_t *b) { return a == b; } +bool test_finalizer_cmp_int32_ptr_t(int32_t* a, int32_t* b) { return a == b; } // Resource type: nullptr // Acquire resource i -void *test_finalizer_acq_null_t(size_t i) { +void* test_finalizer_acq_null_t(size_t i) { gFinalizerTestResources[0] = 1; // Always index 0 return nullptr; } // Release resource i -void test_finalizer_rel_null_t(void *i) { +void test_finalizer_rel_null_t(void* i) { if (i != nullptr) { MOZ_CRASH("Assertion failed"); } @@ -160,15 +160,15 @@ bool test_finalizer_null_resource_is_acquired(size_t) { return gFinalizerTestResources[0] == 1; } -bool test_finalizer_cmp_null_t(void *a, void *b) { return a == b; } +bool test_finalizer_cmp_null_t(void* a, void* b) { return a == b; } // Resource type: char* // Acquire resource i -char *test_finalizer_acq_string_t(int i) { +char* test_finalizer_acq_string_t(int i) { gFinalizerTestResources[i] = 1; if (!gFinalizerTestNames[i]) { - char *buf = new char[12]; + char* buf = new char[12]; snprintf(buf, 12, "%d", i); gFinalizerTestNames[i] = buf; return buf; @@ -177,7 +177,7 @@ char *test_finalizer_acq_string_t(int i) { } // Release resource i -void test_finalizer_rel_string_t(char *i) { +void test_finalizer_rel_string_t(char* i) { int index = atoi(i); if (index < 0 || index >= (int)gFinalizerTestSize) { MOZ_CRASH("Assertion failed"); @@ -189,7 +189,7 @@ bool test_finalizer_string_resource_is_acquired(size_t i) { return gFinalizerTestResources[i] == 1; } -bool test_finalizer_cmp_string_t(char *a, char *b) { +bool test_finalizer_cmp_string_t(char* a, char* b) { return !strncmp(a, b, 10); } @@ -222,7 +222,7 @@ bool test_finalizer_struct_resource_is_acquired(myRECT i) { bool test_finalizer_cmp_struct_t(myRECT a, myRECT b) { return a.top == b.top; } // Support for checking that we reject nullptr finalizer -afun *test_finalizer_rel_null_function() { return nullptr; } +afun* test_finalizer_rel_null_function() { return nullptr; } void test_finalizer_rel_size_t_set_errno(size_t i) { if (--gFinalizerTestResources[i] < 0) { diff --git a/toolkit/components/ctypes/tests/jsctypes-test-finalizer.h b/toolkit/components/ctypes/tests/jsctypes-test-finalizer.h index 75f9fb6bdf72b..45888dd2b7be2 100644 --- a/toolkit/components/ctypes/tests/jsctypes-test-finalizer.h +++ b/toolkit/components/ctypes/tests/jsctypes-test-finalizer.h @@ -27,21 +27,21 @@ EXPORT_CDECL(int64_t) test_finalizer_acq_int64_t(size_t i); EXPORT_CDECL(void) test_finalizer_rel_int64_t(int64_t i); EXPORT_CDECL(bool) test_finalizer_cmp_int64_t(int64_t a, int64_t b); -EXPORT_CDECL(void *) test_finalizer_acq_ptr_t(size_t i); -EXPORT_CDECL(void) test_finalizer_rel_ptr_t(void *i); -EXPORT_CDECL(bool) test_finalizer_cmp_ptr_t(void *a, void *b); +EXPORT_CDECL(void*) test_finalizer_acq_ptr_t(size_t i); +EXPORT_CDECL(void) test_finalizer_rel_ptr_t(void* i); +EXPORT_CDECL(bool) test_finalizer_cmp_ptr_t(void* a, void* b); -EXPORT_CDECL(int32_t *) test_finalizer_acq_int32_ptr_t(size_t i); -EXPORT_CDECL(void) test_finalizer_rel_int32_ptr_t(int32_t *i); -EXPORT_CDECL(bool) test_finalizer_cmp_int32_ptr_t(int32_t *a, int32_t *b); +EXPORT_CDECL(int32_t*) test_finalizer_acq_int32_ptr_t(size_t i); +EXPORT_CDECL(void) test_finalizer_rel_int32_ptr_t(int32_t* i); +EXPORT_CDECL(bool) test_finalizer_cmp_int32_ptr_t(int32_t* a, int32_t* b); -EXPORT_CDECL(char *) test_finalizer_acq_string_t(int i); -EXPORT_CDECL(void) test_finalizer_rel_string_t(char *i); -EXPORT_CDECL(bool) test_finalizer_cmp_string_t(char *a, char *b); +EXPORT_CDECL(char*) test_finalizer_acq_string_t(int i); +EXPORT_CDECL(void) test_finalizer_rel_string_t(char* i); +EXPORT_CDECL(bool) test_finalizer_cmp_string_t(char* a, char* b); -EXPORT_CDECL(void *) test_finalizer_acq_null_t(size_t i); -EXPORT_CDECL(void) test_finalizer_rel_null_t(void *i); -EXPORT_CDECL(bool) test_finalizer_cmp_null_t(void *a, void *b); +EXPORT_CDECL(void*) test_finalizer_acq_null_t(size_t i); +EXPORT_CDECL(void) test_finalizer_rel_null_t(void* i); +EXPORT_CDECL(bool) test_finalizer_cmp_null_t(void* a, void* b); EXPORT_CDECL(bool) test_finalizer_null_resource_is_acquired(size_t i); EXPORT_CDECL(myRECT) test_finalizer_acq_struct_t(int i); @@ -49,7 +49,7 @@ EXPORT_CDECL(void) test_finalizer_rel_struct_t(myRECT i); EXPORT_CDECL(bool) test_finalizer_cmp_struct_t(myRECT a, myRECT b); typedef void (*afun)(size_t); -EXPORT_CDECL(afun *) test_finalizer_rel_null_function(); +EXPORT_CDECL(afun*) test_finalizer_rel_null_function(); EXPORT_CDECL(void) test_finalizer_rel_size_t_set_errno(size_t i); EXPORT_CDECL(void) reset_errno(); diff --git a/toolkit/components/find/nsFindService.cpp b/toolkit/components/find/nsFindService.cpp index fb5ea6252affb..1d1731787f941 100644 --- a/toolkit/components/find/nsFindService.cpp +++ b/toolkit/components/find/nsFindService.cpp @@ -21,26 +21,26 @@ nsFindService::~nsFindService() = default; NS_IMPL_ISUPPORTS(nsFindService, nsIFindService) -NS_IMETHODIMP nsFindService::GetSearchString(nsAString &aSearchString) { +NS_IMETHODIMP nsFindService::GetSearchString(nsAString& aSearchString) { aSearchString = mSearchString; return NS_OK; } -NS_IMETHODIMP nsFindService::SetSearchString(const nsAString &aSearchString) { +NS_IMETHODIMP nsFindService::SetSearchString(const nsAString& aSearchString) { mSearchString = aSearchString; return NS_OK; } -NS_IMETHODIMP nsFindService::GetReplaceString(nsAString &aReplaceString) { +NS_IMETHODIMP nsFindService::GetReplaceString(nsAString& aReplaceString) { aReplaceString = mReplaceString; return NS_OK; } -NS_IMETHODIMP nsFindService::SetReplaceString(const nsAString &aReplaceString) { +NS_IMETHODIMP nsFindService::SetReplaceString(const nsAString& aReplaceString) { mReplaceString = aReplaceString; return NS_OK; } -NS_IMETHODIMP nsFindService::GetFindBackwards(bool *aFindBackwards) { +NS_IMETHODIMP nsFindService::GetFindBackwards(bool* aFindBackwards) { NS_ENSURE_ARG_POINTER(aFindBackwards); *aFindBackwards = mFindBackwards; return NS_OK; @@ -50,7 +50,7 @@ NS_IMETHODIMP nsFindService::SetFindBackwards(bool aFindBackwards) { return NS_OK; } -NS_IMETHODIMP nsFindService::GetWrapFind(bool *aWrapFind) { +NS_IMETHODIMP nsFindService::GetWrapFind(bool* aWrapFind) { NS_ENSURE_ARG_POINTER(aWrapFind); *aWrapFind = mWrapFind; return NS_OK; @@ -60,7 +60,7 @@ NS_IMETHODIMP nsFindService::SetWrapFind(bool aWrapFind) { return NS_OK; } -NS_IMETHODIMP nsFindService::GetEntireWord(bool *aEntireWord) { +NS_IMETHODIMP nsFindService::GetEntireWord(bool* aEntireWord) { NS_ENSURE_ARG_POINTER(aEntireWord); *aEntireWord = mEntireWord; return NS_OK; @@ -70,7 +70,7 @@ NS_IMETHODIMP nsFindService::SetEntireWord(bool aEntireWord) { return NS_OK; } -NS_IMETHODIMP nsFindService::GetMatchCase(bool *aMatchCase) { +NS_IMETHODIMP nsFindService::GetMatchCase(bool* aMatchCase) { NS_ENSURE_ARG_POINTER(aMatchCase); *aMatchCase = mMatchCase; return NS_OK; diff --git a/toolkit/components/maintenanceservice/maintenanceservice.cpp b/toolkit/components/maintenanceservice/maintenanceservice.cpp index 8d0e9fb7c5af0..9ab230a2aa1bd 100644 --- a/toolkit/components/maintenanceservice/maintenanceservice.cpp +++ b/toolkit/components/maintenanceservice/maintenanceservice.cpp @@ -29,9 +29,9 @@ bool gServiceControlStopping = false; // logs are pretty small, about 20 lines, so 10 seems reasonable. #define LOGS_TO_KEEP 10 -BOOL GetLogDirectoryPath(WCHAR *path); +BOOL GetLogDirectoryPath(WCHAR* path); -int wmain(int argc, WCHAR **argv) { +int wmain(int argc, WCHAR** argv) { // If command-line parameter is "install", install the service // or upgrade if already installed // If command line parameter is "forceinstall", install the service @@ -125,7 +125,7 @@ int wmain(int argc, WCHAR **argv) { * @param path The out buffer for the backup log path of size MAX_PATH + 1 * @return TRUE if successful. */ -BOOL GetLogDirectoryPath(WCHAR *path) { +BOOL GetLogDirectoryPath(WCHAR* path) { if (!GetModuleFileNameW(nullptr, path, MAX_PATH)) { return FALSE; } @@ -224,7 +224,7 @@ void StartTerminationThread() { /** * Main entry point when running as a service. */ -void WINAPI SvcMain(DWORD argc, LPWSTR *argv) { +void WINAPI SvcMain(DWORD argc, LPWSTR* argv) { // Setup logging, and backup the old logs WCHAR updatePath[MAX_PATH + 1]; if (GetLogDirectoryPath(updatePath)) { diff --git a/toolkit/components/maintenanceservice/maintenanceservice.h b/toolkit/components/maintenanceservice/maintenanceservice.h index acc3b1ba47bf6..7f04c7c743d9d 100644 --- a/toolkit/components/maintenanceservice/maintenanceservice.h +++ b/toolkit/components/maintenanceservice/maintenanceservice.h @@ -2,8 +2,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/. */ -void WINAPI SvcMain(DWORD dwArgc, LPWSTR *lpszArgv); -void SvcInit(DWORD dwArgc, LPWSTR *lpszArgv); +void WINAPI SvcMain(DWORD dwArgc, LPWSTR* lpszArgv); +void SvcInit(DWORD dwArgc, LPWSTR* lpszArgv); void WINAPI SvcCtrlHandler(DWORD dwCtrl); void ReportSvcStatus(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint); diff --git a/toolkit/components/maintenanceservice/servicebase.cpp b/toolkit/components/maintenanceservice/servicebase.cpp index a23d08d0437b7..d6004234c7cfc 100644 --- a/toolkit/components/maintenanceservice/servicebase.cpp +++ b/toolkit/components/maintenanceservice/servicebase.cpp @@ -16,7 +16,7 @@ * @param sameContent Out parameter, TRUE if the files are equal * @return TRUE If there was no error checking the files. */ -BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent) { +BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL& sameContent) { sameContent = FALSE; nsAutoHandle file1(CreateFileW(file1Path, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr)); diff --git a/toolkit/components/maintenanceservice/servicebase.h b/toolkit/components/maintenanceservice/servicebase.h index 67b915ca495d7..5ba3689a2273e 100644 --- a/toolkit/components/maintenanceservice/servicebase.h +++ b/toolkit/components/maintenanceservice/servicebase.h @@ -6,7 +6,7 @@ #include "updatecommon.h" BOOL PathAppendSafe(LPWSTR base, LPCWSTR extra); -BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent); +BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL& sameContent); // 32KiB for comparing files at a time seems reasonable. // The bigger the better for speed, but this will be used diff --git a/toolkit/components/maintenanceservice/serviceinstall.cpp b/toolkit/components/maintenanceservice/serviceinstall.cpp index 0c1ab62b00e12..2fe50653b2b3a 100644 --- a/toolkit/components/maintenanceservice/serviceinstall.cpp +++ b/toolkit/components/maintenanceservice/serviceinstall.cpp @@ -37,7 +37,7 @@ static BOOL UpdateUninstallerVersionString(LPWSTR versionString) { } LONG rv = RegSetValueExW(uninstallKey, L"DisplayVersion", 0, REG_SZ, - reinterpret_cast(versionString), + reinterpret_cast(versionString), (wcslen(versionString) + 1) * sizeof(WCHAR)); RegCloseKey(uninstallKey); return rv == ERROR_SUCCESS; @@ -51,10 +51,10 @@ static BOOL UpdateUninstallerVersionString(LPWSTR versionString) { * @return OK on success */ static int ReadMaintenanceServiceStrings( - LPCWSTR path, MaintenanceServiceStringTable *results) { + LPCWSTR path, MaintenanceServiceStringTable* results) { // Read in the maintenance service description string if specified. const unsigned int kNumStrings = 1; - const char *kServiceKeys = "MozillaMaintenanceDescription\0"; + const char* kServiceKeys = "MozillaMaintenanceDescription\0"; char serviceStrings[kNumStrings][MAX_TEXT_LEN]; int result = ReadStrings(path, kServiceKeys, kNumStrings, serviceStrings); if (result != OK) { @@ -76,8 +76,8 @@ static int ReadMaintenanceServiceStrings( * @param D The fourth part of the version number * @return TRUE if successful */ -static BOOL GetVersionNumberFromPath(LPWSTR path, DWORD &A, DWORD &B, DWORD &C, - DWORD &D) { +static BOOL GetVersionNumberFromPath(LPWSTR path, DWORD& A, DWORD& B, DWORD& C, + DWORD& D) { DWORD fileVersionInfoSize = GetFileVersionInfoSizeW(path, 0); mozilla::UniquePtr fileVersionInfo(new char[fileVersionInfoSize]); if (!GetFileVersionInfoW(path, 0, fileVersionInfoSize, @@ -87,11 +87,11 @@ static BOOL GetVersionNumberFromPath(LPWSTR path, DWORD &A, DWORD &B, DWORD &C, return FALSE; } - VS_FIXEDFILEINFO *fixedFileInfo = - reinterpret_cast(fileVersionInfo.get()); + VS_FIXEDFILEINFO* fixedFileInfo = + reinterpret_cast(fileVersionInfo.get()); UINT size; if (!VerQueryValueW(fileVersionInfo.get(), L"\\", - reinterpret_cast(&fixedFileInfo), &size)) { + reinterpret_cast(&fixedFileInfo), &size)) { LOG_WARN(("Could not query file version info of old service. (%d)", GetLastError())); return FALSE; @@ -187,7 +187,7 @@ BOOL UpdateServiceDescription(SC_HANDLE serviceHandle) { * @return TRUE if the service path is now correct. */ BOOL FixServicePath(SC_HANDLE service, LPCWSTR currentServicePath, - BOOL &servicePathWasWrong) { + BOOL& servicePathWasWrong) { // When we originally upgraded the MozillaMaintenance service we // would uninstall the service on each upgrade. This had an // intermittent error which could cause the service to use the file @@ -310,16 +310,16 @@ BOOL SvcInstall(SvcInstallAction action) { // Get the service config information, in particular we want the binary // path of the service. mozilla::UniquePtr serviceConfigBuffer(new char[bytesNeeded]); - if (!QueryServiceConfigW(schService, - reinterpret_cast( - serviceConfigBuffer.get()), - bytesNeeded, &bytesNeeded)) { + if (!QueryServiceConfigW( + schService, + reinterpret_cast(serviceConfigBuffer.get()), + bytesNeeded, &bytesNeeded)) { LOG_WARN(("Could open service but could not query service config. (%d)", GetLastError())); return FALSE; } - QUERY_SERVICE_CONFIGW &serviceConfig = - *reinterpret_cast(serviceConfigBuffer.get()); + QUERY_SERVICE_CONFIGW& serviceConfig = + *reinterpret_cast(serviceConfigBuffer.get()); // Check if we need to fix the service path BOOL servicePathWasWrong; @@ -649,7 +649,7 @@ BOOL SetUserAccessServiceDACL(SC_HANDLE hService) { * @return ERROR_SUCCESS if successful */ DWORD -SetUserAccessServiceDACL(SC_HANDLE hService, PACL &pNewAcl, +SetUserAccessServiceDACL(SC_HANDLE hService, PACL& pNewAcl, PSECURITY_DESCRIPTOR psd) { // Get the current security descriptor needed size DWORD needed = 0; diff --git a/toolkit/components/maintenanceservice/serviceinstall.h b/toolkit/components/maintenanceservice/serviceinstall.h index b9eb46a022355..8cc23a7930187 100644 --- a/toolkit/components/maintenanceservice/serviceinstall.h +++ b/toolkit/components/maintenanceservice/serviceinstall.h @@ -11,7 +11,7 @@ BOOL SvcInstall(SvcInstallAction action); BOOL SvcUninstall(); BOOL StopService(); BOOL SetUserAccessServiceDACL(SC_HANDLE hService); -DWORD SetUserAccessServiceDACL(SC_HANDLE hService, PACL &pNewAcl, +DWORD SetUserAccessServiceDACL(SC_HANDLE hService, PACL& pNewAcl, PSECURITY_DESCRIPTOR psd); struct MaintenanceServiceStringTable { diff --git a/toolkit/components/maintenanceservice/workmonitor.cpp b/toolkit/components/maintenanceservice/workmonitor.cpp index cb416d0d5c107..41ad373537704 100644 --- a/toolkit/components/maintenanceservice/workmonitor.cpp +++ b/toolkit/components/maintenanceservice/workmonitor.cpp @@ -53,7 +53,7 @@ BOOL DoesFallbackKeyExist(); * is set to applying or not. * @return TRUE if the information was filled. */ -static BOOL IsStatusApplying(LPCWSTR updateDirPath, BOOL &isApplying) { +static BOOL IsStatusApplying(LPCWSTR updateDirPath, BOOL& isApplying) { isApplying = FALSE; WCHAR updateStatusFilePath[MAX_PATH + 1] = {L'\0'}; wcsncpy(updateStatusFilePath, updateDirPath, MAX_PATH); @@ -91,7 +91,7 @@ static BOOL IsStatusApplying(LPCWSTR updateDirPath, BOOL &isApplying) { * @param argv The argv value normally sent to updater.exe * @return boolean True if we're staging an update */ -static bool IsUpdateBeingStaged(int argc, LPWSTR *argv) { +static bool IsUpdateBeingStaged(int argc, LPWSTR* argv) { // PID will be set to -1 if we're supposed to stage an update. return (argc == 4 && !wcscmp(argv[3], L"-1")) || (argc == 5 && !wcscmp(argv[4], L"-1")); @@ -103,7 +103,7 @@ static bool IsUpdateBeingStaged(int argc, LPWSTR *argv) { * @param str The string to check * @param boolean True if the param only contains digits */ -static bool IsDigits(WCHAR *str) { +static bool IsDigits(WCHAR* str) { while (*str) { if (!iswdigit(*str++)) { return FALSE; @@ -122,7 +122,7 @@ static bool IsDigits(WCHAR *str) { * @param boolean True if the command line contains just the directory to apply * the update to */ -static bool IsOldCommandline(int argc, LPWSTR *argv) { +static bool IsOldCommandline(int argc, LPWSTR* argv) { return (argc == 4 && !wcscmp(argv[3], L"-1")) || (argc >= 4 && (wcsstr(argv[3], L"/replace") || IsDigits(argv[3]))); } @@ -134,7 +134,7 @@ static bool IsOldCommandline(int argc, LPWSTR *argv) { * @param argvTmp The argv value normally sent to updater.exe * @param aResultDir Buffer to hold the installation directory. */ -static BOOL GetInstallationDir(int argcTmp, LPWSTR *argvTmp, +static BOOL GetInstallationDir(int argcTmp, LPWSTR* argvTmp, WCHAR aResultDir[MAX_PATH + 1]) { int index = 3; if (IsOldCommandline(argcTmp, argvTmp)) { @@ -146,7 +146,7 @@ static BOOL GetInstallationDir(int argcTmp, LPWSTR *argvTmp, } wcsncpy(aResultDir, argvTmp[2], MAX_PATH); - WCHAR *backSlash = wcsrchr(aResultDir, L'\\'); + WCHAR* backSlash = wcsrchr(aResultDir, L'\\'); // Make sure that the path does not include trailing backslashes if (backSlash && (backSlash[1] == L'\0')) { *backSlash = L'\0'; @@ -173,8 +173,8 @@ static BOOL GetInstallationDir(int argcTmp, LPWSTR *argvTmp, * @param userToken User impersonation token to pass to the updater. * @return TRUE if the update process was run had a return code of 0. */ -BOOL StartUpdateProcess(int argc, LPWSTR *argv, LPCWSTR installDir, - BOOL &processStarted, nsAutoHandle &userToken) { +BOOL StartUpdateProcess(int argc, LPWSTR* argv, LPCWSTR installDir, + BOOL& processStarted, nsAutoHandle& userToken) { processStarted = FALSE; LOG(("Starting update process as the service in session 0.")); @@ -182,7 +182,7 @@ BOOL StartUpdateProcess(int argc, LPWSTR *argv, LPCWSTR installDir, ZeroMemory(&sie, sizeof(sie)); sie.StartupInfo.cb = sizeof(sie); - STARTUPINFOW &si = sie.StartupInfo; + STARTUPINFOW& si = sie.StartupInfo; si.lpDesktop = const_cast(L"winsta0\\Default"); // -Wwritable-strings PROCESS_INFORMATION pi = {0}; @@ -209,7 +209,7 @@ BOOL StartUpdateProcess(int argc, LPWSTR *argv, LPCWSTR installDir, // Add an env var for MOZ_USING_SERVICE so the updater.exe can // do anything special that it needs to do for service updates. // Search in updater.cpp for more info on MOZ_USING_SERVICE. - putenv(const_cast("MOZ_USING_SERVICE=1")); + putenv(const_cast("MOZ_USING_SERVICE=1")); #ifndef DISABLE_USER_IMPERSONATION // Add an env var with a pointer to the impersonation token. @@ -333,8 +333,8 @@ BOOL StartUpdateProcess(int argc, LPWSTR *argv, LPCWSTR installDir, } // Empty value on putenv is how you remove an env variable in Windows - putenv(const_cast("MOZ_USING_SERVICE=")); - putenv(const_cast(USER_TOKEN_VAR_NAME "=")); + putenv(const_cast("MOZ_USING_SERVICE=")); + putenv(const_cast(USER_TOKEN_VAR_NAME "=")); return updateWasSuccessful; } @@ -355,7 +355,7 @@ BOOL StartUpdateProcess(int argc, LPWSTR *argv, LPCWSTR installDir, * @return true if updater is the path to a valid updater */ static bool UpdaterIsValid(LPWSTR updater, LPWSTR installDir, LPWSTR updateDir, - nsAutoHandle &userToken) { + nsAutoHandle& userToken) { // Make sure the path to the updater to use for the update is local. // We do this check to make sure that file locking is available for // race condition security checks. @@ -491,8 +491,8 @@ static bool UpdaterIsValid(LPWSTR updater, LPWSTR installDir, LPWSTR updateDir, * * @return TRUE if the update was successful. */ -BOOL ProcessSoftwareUpdateCommand(DWORD argc, LPWSTR *argv, - nsAutoHandle &userToken) { +BOOL ProcessSoftwareUpdateCommand(DWORD argc, LPWSTR* argv, + nsAutoHandle& userToken) { BOOL result = TRUE; if (argc < 3) { LOG_WARN( @@ -658,7 +658,7 @@ BOOL DeleteSecureUpdater(WCHAR serviceUpdaterPath[MAX_PATH + 1]) { * * @return FALSE if there was an error executing the service command. */ -BOOL ExecuteServiceCommand(int argc, LPWSTR *argv) { +BOOL ExecuteServiceCommand(int argc, LPWSTR* argv) { if (argc < 3) { LOG_WARN( ("Not enough command line arguments to execute a service command")); @@ -890,7 +890,7 @@ BOOL ExecuteServiceCommand(int argc, LPWSTR *argv) { #ifndef DISABLE_USER_IMPERSONATION if (result) { userToken.own(GetUserProcessToken(installDirUpdater, argc - 3, - const_cast(argv + 3))); + const_cast(argv + 3))); result = !!userToken; if (!userToken) { LOG_WARN(("Could not get user process impersonation token")); diff --git a/toolkit/components/maintenanceservice/workmonitor.h b/toolkit/components/maintenanceservice/workmonitor.h index ac4cd679bf8d8..8fc2e51a7deda 100644 --- a/toolkit/components/maintenanceservice/workmonitor.h +++ b/toolkit/components/maintenanceservice/workmonitor.h @@ -2,4 +2,4 @@ * 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/. */ -BOOL ExecuteServiceCommand(int argc, LPWSTR *argv); +BOOL ExecuteServiceCommand(int argc, LPWSTR* argv); diff --git a/toolkit/components/mediasniffer/mp3sniff.c b/toolkit/components/mediasniffer/mp3sniff.c index 38a9ca09854a6..cb1e2fdc1db53 100644 --- a/toolkit/components/mediasniffer/mp3sniff.c +++ b/toolkit/components/mediasniffer/mp3sniff.c @@ -25,7 +25,7 @@ typedef struct { } mp3_header; /* Parse the 4-byte header in p and fill in the header struct. */ -static void mp3_parse(const uint8_t *p, mp3_header *header) { +static void mp3_parse(const uint8_t* p, mp3_header* header) { const int bitrates[2][16] = { /* MPEG version 1 layer 3 bitrates. */ {0, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, @@ -56,7 +56,7 @@ static void mp3_parse(const uint8_t *p, mp3_header *header) { } /* calculate the size of an mp3 frame from its header */ -static int mp3_framesize(mp3_header *header) { +static int mp3_framesize(mp3_header* header) { int size; int scale; @@ -70,7 +70,7 @@ static int mp3_framesize(mp3_header *header) { return size; } -static int is_mp3(const uint8_t *p, long length) { +static int is_mp3(const uint8_t* p, long length) { /* Do we have enough room to see a 4 byte header? */ if (length < 4) return 0; /* Do we have a sync pattern? */ @@ -88,7 +88,7 @@ static int is_mp3(const uint8_t *p, long length) { /* Identify an ID3 tag based on its header. */ /* http://id3.org/id3v2.4.0-structure */ -static int is_id3(const uint8_t *p, long length) { +static int is_id3(const uint8_t* p, long length) { /* Do we have enough room to see the header? */ if (length < 10) return 0; /* Do we have a sync pattern? */ @@ -103,7 +103,7 @@ static int is_id3(const uint8_t *p, long length) { } /* Calculate the size of an id3 tag structure from its header. */ -static int id3_framesize(const uint8_t *p, long length) { +static int id3_framesize(const uint8_t* p, long length) { int size; /* Header is 10 bytes. */ @@ -116,9 +116,9 @@ static int id3_framesize(const uint8_t *p, long length) { return size; } -int mp3_sniff(const uint8_t *buf, long length) { +int mp3_sniff(const uint8_t* buf, long length) { mp3_header header; - const uint8_t *p; + const uint8_t* p; long skip; long avail; diff --git a/toolkit/components/mediasniffer/mp3sniff.h b/toolkit/components/mediasniffer/mp3sniff.h index 5b041a0a2de3e..b189db187385d 100644 --- a/toolkit/components/mediasniffer/mp3sniff.h +++ b/toolkit/components/mediasniffer/mp3sniff.h @@ -8,7 +8,7 @@ extern "C" { #endif -int mp3_sniff(const uint8_t *buf, long length); +int mp3_sniff(const uint8_t* buf, long length); #ifdef __cplusplus } diff --git a/toolkit/components/parentalcontrols/nsParentalControlsService.h b/toolkit/components/parentalcontrols/nsParentalControlsService.h index d7bbc3df05700..e2f2bfba352e3 100644 --- a/toolkit/components/parentalcontrols/nsParentalControlsService.h +++ b/toolkit/components/parentalcontrols/nsParentalControlsService.h @@ -30,8 +30,8 @@ class nsParentalControlsService : public nsIParentalControlsService { bool mEnabled; #if defined(XP_WIN) REGHANDLE mProvider; - IWindowsParentalControls *mPC; - void LogFileDownload(bool blocked, nsIURI *aSource, nsIFile *aTarget); + IWindowsParentalControls* mPC; + void LogFileDownload(bool blocked, nsIURI* aSource, nsIFile* aTarget); #endif }; diff --git a/toolkit/components/parentalcontrols/nsParentalControlsServiceAndroid.cpp b/toolkit/components/parentalcontrols/nsParentalControlsServiceAndroid.cpp index b25ca25424b4a..5bddd78ab6227 100644 --- a/toolkit/components/parentalcontrols/nsParentalControlsServiceAndroid.cpp +++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceAndroid.cpp @@ -21,13 +21,13 @@ nsParentalControlsService::nsParentalControlsService() : mEnabled(false) { nsParentalControlsService::~nsParentalControlsService() {} NS_IMETHODIMP -nsParentalControlsService::GetParentalControlsEnabled(bool *aResult) { +nsParentalControlsService::GetParentalControlsEnabled(bool* aResult) { *aResult = mEnabled; return NS_OK; } NS_IMETHODIMP -nsParentalControlsService::GetBlockFileDownloadsEnabled(bool *aResult) { +nsParentalControlsService::GetBlockFileDownloadsEnabled(bool* aResult) { // NOTE: isAllowed returns the opposite intention, so we need to flip it bool res; IsAllowed(nsIParentalControlsService::DOWNLOAD, NULL, &res); @@ -37,7 +37,7 @@ nsParentalControlsService::GetBlockFileDownloadsEnabled(bool *aResult) { } NS_IMETHODIMP -nsParentalControlsService::GetLoggingEnabled(bool *aResult) { +nsParentalControlsService::GetLoggingEnabled(bool* aResult) { // Android doesn't currently have any method of logging restricted actions. *aResult = false; return NS_OK; @@ -45,25 +45,25 @@ nsParentalControlsService::GetLoggingEnabled(bool *aResult) { NS_IMETHODIMP nsParentalControlsService::Log(int16_t aEntryType, bool aBlocked, - nsIURI *aSource, nsIFile *aTarget) { + nsIURI* aSource, nsIFile* aTarget) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsParentalControlsService::RequestURIOverride( - nsIURI *aTarget, nsIInterfaceRequestor *aWindowContext, bool *_retval) { + nsIURI* aTarget, nsIInterfaceRequestor* aWindowContext, bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsParentalControlsService::RequestURIOverrides( - nsIArray *aTargets, nsIInterfaceRequestor *aWindowContext, bool *_retval) { + nsIArray* aTargets, nsIInterfaceRequestor* aWindowContext, bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -nsParentalControlsService::IsAllowed(int16_t aAction, nsIURI *aUri, - bool *_retval) { +nsParentalControlsService::IsAllowed(int16_t aAction, nsIURI* aUri, + bool* _retval) { nsresult rv = NS_OK; *_retval = true; diff --git a/toolkit/components/parentalcontrols/nsParentalControlsServiceCocoa.mm b/toolkit/components/parentalcontrols/nsParentalControlsServiceCocoa.mm index 855a6f2840893..136a55c61bd08 100644 --- a/toolkit/components/parentalcontrols/nsParentalControlsServiceCocoa.mm +++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceCocoa.mm @@ -19,45 +19,45 @@ nsParentalControlsService::~nsParentalControlsService() {} NS_IMETHODIMP -nsParentalControlsService::GetParentalControlsEnabled(bool *aResult) { +nsParentalControlsService::GetParentalControlsEnabled(bool* aResult) { *aResult = mEnabled; return NS_OK; } NS_IMETHODIMP -nsParentalControlsService::GetBlockFileDownloadsEnabled(bool *aResult) { +nsParentalControlsService::GetBlockFileDownloadsEnabled(bool* aResult) { *aResult = false; return NS_OK; } NS_IMETHODIMP -nsParentalControlsService::GetLoggingEnabled(bool *aResult) { +nsParentalControlsService::GetLoggingEnabled(bool* aResult) { *aResult = false; return NS_OK; } NS_IMETHODIMP -nsParentalControlsService::Log(int16_t aEntryType, bool blocked, nsIURI *aSource, - nsIFile *aTarget) { +nsParentalControlsService::Log(int16_t aEntryType, bool blocked, nsIURI* aSource, + nsIFile* aTarget) { // silently drop on the floor return NS_OK; } NS_IMETHODIMP -nsParentalControlsService::RequestURIOverride(nsIURI *aTarget, - nsIInterfaceRequestor *aWindowContext, - bool *_retval) { +nsParentalControlsService::RequestURIOverride(nsIURI* aTarget, + nsIInterfaceRequestor* aWindowContext, + bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -nsParentalControlsService::RequestURIOverrides(nsIArray *aTargets, - nsIInterfaceRequestor *aWindowContext, - bool *_retval) { +nsParentalControlsService::RequestURIOverrides(nsIArray* aTargets, + nsIInterfaceRequestor* aWindowContext, + bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -nsParentalControlsService::IsAllowed(int16_t aAction, nsIURI *aUri, bool *_retval) { +nsParentalControlsService::IsAllowed(int16_t aAction, nsIURI* aUri, bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } diff --git a/toolkit/components/parentalcontrols/nsParentalControlsServiceDefault.cpp b/toolkit/components/parentalcontrols/nsParentalControlsServiceDefault.cpp index b9fd26d8dc4ba..9f3810a0f7a48 100644 --- a/toolkit/components/parentalcontrols/nsParentalControlsServiceDefault.cpp +++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceDefault.cpp @@ -17,41 +17,41 @@ nsParentalControlsService::nsParentalControlsService() : mEnabled(false) { nsParentalControlsService::~nsParentalControlsService() = default; NS_IMETHODIMP -nsParentalControlsService::GetParentalControlsEnabled(bool *aResult) { +nsParentalControlsService::GetParentalControlsEnabled(bool* aResult) { *aResult = false; return NS_OK; } NS_IMETHODIMP -nsParentalControlsService::GetBlockFileDownloadsEnabled(bool *aResult) { +nsParentalControlsService::GetBlockFileDownloadsEnabled(bool* aResult) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -nsParentalControlsService::GetLoggingEnabled(bool *aResult) { +nsParentalControlsService::GetLoggingEnabled(bool* aResult) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsParentalControlsService::Log(int16_t aEntryType, bool blocked, - nsIURI *aSource, nsIFile *aTarget) { + nsIURI* aSource, nsIFile* aTarget) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsParentalControlsService::RequestURIOverride( - nsIURI *aTarget, nsIInterfaceRequestor *aWindowContext, bool *_retval) { + nsIURI* aTarget, nsIInterfaceRequestor* aWindowContext, bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsParentalControlsService::RequestURIOverrides( - nsIArray *aTargets, nsIInterfaceRequestor *aWindowContext, bool *_retval) { + nsIArray* aTargets, nsIInterfaceRequestor* aWindowContext, bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -nsParentalControlsService::IsAllowed(int16_t aAction, nsIURI *aUri, - bool *_retval) { +nsParentalControlsService::IsAllowed(int16_t aAction, nsIURI* aUri, + bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } diff --git a/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp b/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp index 60124ebfacb7b..c57467991ecb8 100644 --- a/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp +++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp @@ -61,7 +61,7 @@ nsParentalControlsService::~nsParentalControlsService() { //------------------------------------------------------------------------ NS_IMETHODIMP -nsParentalControlsService::GetParentalControlsEnabled(bool *aResult) { +nsParentalControlsService::GetParentalControlsEnabled(bool* aResult) { *aResult = false; if (mEnabled) *aResult = true; @@ -70,7 +70,7 @@ nsParentalControlsService::GetParentalControlsEnabled(bool *aResult) { } NS_IMETHODIMP -nsParentalControlsService::GetBlockFileDownloadsEnabled(bool *aResult) { +nsParentalControlsService::GetBlockFileDownloadsEnabled(bool* aResult) { *aResult = false; if (!mEnabled) return NS_ERROR_NOT_AVAILABLE; @@ -86,7 +86,7 @@ nsParentalControlsService::GetBlockFileDownloadsEnabled(bool *aResult) { } NS_IMETHODIMP -nsParentalControlsService::GetLoggingEnabled(bool *aResult) { +nsParentalControlsService::GetLoggingEnabled(bool* aResult) { *aResult = false; if (!mEnabled) return NS_ERROR_NOT_AVAILABLE; @@ -105,7 +105,7 @@ nsParentalControlsService::GetLoggingEnabled(bool *aResult) { // Post a log event to the system NS_IMETHODIMP nsParentalControlsService::Log(int16_t aEntryType, bool blocked, - nsIURI *aSource, nsIFile *aTarget) { + nsIURI* aSource, nsIFile* aTarget) { if (!mEnabled) return NS_ERROR_NOT_AVAILABLE; NS_ENSURE_ARG_POINTER(aSource); @@ -139,7 +139,7 @@ nsParentalControlsService::Log(int16_t aEntryType, bool blocked, // Override a single URI NS_IMETHODIMP nsParentalControlsService::RequestURIOverride( - nsIURI *aTarget, nsIInterfaceRequestor *aWindowContext, bool *_retval) { + nsIURI* aTarget, nsIInterfaceRequestor* aWindowContext, bool* _retval) { *_retval = false; if (!mEnabled) return NS_ERROR_NOT_AVAILABLE; @@ -170,7 +170,7 @@ nsParentalControlsService::RequestURIOverride( // Override a web page NS_IMETHODIMP nsParentalControlsService::RequestURIOverrides( - nsIArray *aTargets, nsIInterfaceRequestor *aWindowContext, bool *_retval) { + nsIArray* aTargets, nsIInterfaceRequestor* aWindowContext, bool* _retval) { *_retval = false; if (!mEnabled) return NS_ERROR_NOT_AVAILABLE; @@ -225,12 +225,12 @@ nsParentalControlsService::RequestURIOverrides( RefPtr wpcws; if (SUCCEEDED(mPC->GetWebSettings(nullptr, getter_AddRefs(wpcws)))) { wpcws->RequestURLOverride(hWnd, NS_ConvertUTF8toUTF16(rootSpec).get(), - uriIdx, (LPCWSTR *)arrUrls.get(), &ret); + uriIdx, (LPCWSTR*)arrUrls.get(), &ret); *_retval = ret; } // Free up the allocated strings in our array - for (idx = 0; idx < uriIdx; idx++) free((void *)arrUrls[idx]); + for (idx = 0; idx < uriIdx; idx++) free((void*)arrUrls[idx]); return NS_OK; } @@ -238,8 +238,8 @@ nsParentalControlsService::RequestURIOverrides( //------------------------------------------------------------------------ // Sends a file download event to the Vista Event Log -void nsParentalControlsService::LogFileDownload(bool blocked, nsIURI *aSource, - nsIFile *aTarget) { +void nsParentalControlsService::LogFileDownload(bool blocked, nsIURI* aSource, + nsIFile* aTarget) { nsAutoCString curi; // Note, EventDataDescCreate is a macro defined in the headers, not a function @@ -261,26 +261,26 @@ void nsParentalControlsService::LogFileDownload(bool blocked, nsIURI *aSource, DWORD dwBlocked = blocked; EventDataDescCreate(&eventData[WPC_ARGS_FILEDOWNLOADEVENT_URL], - (const void *)uri.get(), + (const void*)uri.get(), ((ULONG)uri.Length() + 1) * sizeof(WCHAR)); EventDataDescCreate(&eventData[WPC_ARGS_FILEDOWNLOADEVENT_APPNAME], - (const void *)appName.get(), + (const void*)appName.get(), ((ULONG)appName.Length() + 1) * sizeof(WCHAR)); EventDataDescCreate(&eventData[WPC_ARGS_FILEDOWNLOADEVENT_VERSION], - (const void *)fill, sizeof(fill)); + (const void*)fill, sizeof(fill)); EventDataDescCreate(&eventData[WPC_ARGS_FILEDOWNLOADEVENT_BLOCKED], - (const void *)&dwBlocked, sizeof(dwBlocked)); + (const void*)&dwBlocked, sizeof(dwBlocked)); nsCOMPtr local(do_QueryInterface(aTarget)); // May be null if (local) { nsAutoString path; local->GetCanonicalPath(path); EventDataDescCreate(&eventData[WPC_ARGS_FILEDOWNLOADEVENT_PATH], - (const void *)path.get(), + (const void*)path.get(), ((ULONG)path.Length() + 1) * sizeof(WCHAR)); } else { EventDataDescCreate(&eventData[WPC_ARGS_FILEDOWNLOADEVENT_PATH], - (const void *)fill, sizeof(fill)); + (const void*)fill, sizeof(fill)); } EventWrite(mProvider, &WPCEVENT_WEB_FILEDOWNLOAD, ARRAYSIZE(eventData), @@ -288,7 +288,7 @@ void nsParentalControlsService::LogFileDownload(bool blocked, nsIURI *aSource, } NS_IMETHODIMP -nsParentalControlsService::IsAllowed(int16_t aAction, nsIURI *aUri, - bool *_retval) { +nsParentalControlsService::IsAllowed(int16_t aAction, nsIURI* aUri, + bool* _retval) { return NS_ERROR_NOT_AVAILABLE; } diff --git a/toolkit/components/places/SQLFunctions.cpp b/toolkit/components/places/SQLFunctions.cpp index 70ace9d18c13d..089903a62073d 100644 --- a/toolkit/components/places/SQLFunctions.cpp +++ b/toolkit/components/places/SQLFunctions.cpp @@ -47,7 +47,7 @@ typedef nsACString::char_type char_type; * An interator pointing to past-the-end of the string. */ static MOZ_ALWAYS_INLINE void goToNextSearchCandidate( - const_char_iterator &aStart, const const_char_iterator &aEnd, + const_char_iterator& aStart, const const_char_iterator& aEnd, uint32_t aSearchFor) { // If the character we search for is ASCII, then we can scan until we find // it or its ASCII uppercase character, modulo the special cases @@ -161,8 +161,8 @@ enum FindInStringBehavior { eFindOnBoundary, eFindAnywhere }; * * @return true if aToken was found in aSourceString, false otherwise. */ -static bool findInString(const nsDependentCSubstring &aToken, - const nsACString &aSourceString, +static bool findInString(const nsDependentCSubstring& aToken, + const nsACString& aSourceString, FindInStringBehavior aBehavior) { // GetLowerUTF8Codepoint assumes that there's at least one byte in // the string, so don't pass an empty token here. @@ -214,9 +214,9 @@ static bool findInString(const nsDependentCSubstring &aToken, } static MOZ_ALWAYS_INLINE nsDependentCString -getSharedUTF8String(mozIStorageValueArray *aValues, uint32_t aIndex) { +getSharedUTF8String(mozIStorageValueArray* aValues, uint32_t aIndex) { uint32_t len; - const char *str = aValues->AsSharedUTF8String(aIndex, &len); + const char* str = aValues->AsSharedUTF8String(aIndex, &len); if (!str) { return nsDependentCString("", (uint32_t)0); } @@ -226,12 +226,12 @@ getSharedUTF8String(mozIStorageValueArray *aValues, uint32_t aIndex) { class MOZ_STACK_CLASS GetQueryParamIterator final : public URLParams::ForEachIterator { public: - explicit GetQueryParamIterator(const nsCString &aParamName, - nsVariant *aResult) + explicit GetQueryParamIterator(const nsCString& aParamName, + nsVariant* aResult) : mParamName(aParamName), mResult(aResult) {} - bool URLParamsIterator(const nsAString &aName, - const nsAString &aValue) override { + bool URLParamsIterator(const nsAString& aName, + const nsAString& aValue) override { NS_ConvertUTF16toUTF8 name(aName); if (!mParamName.Equals(name)) { return true; @@ -241,8 +241,8 @@ class MOZ_STACK_CLASS GetQueryParamIterator final } private: - const nsCString &mParamName; - nsVariant *mResult; + const nsCString& mParamName; + nsVariant* mResult; }; /** @@ -267,7 +267,7 @@ class MOZ_STACK_CLASS GetQueryParamIterator final * @return The length of the prefix in the spec. If there isn't a prefix, * returns 0. */ -static MOZ_ALWAYS_INLINE size_type getPrefixLength(const nsACString &aSpec) { +static MOZ_ALWAYS_INLINE size_type getPrefixLength(const nsACString& aSpec) { // To keep the search bounded, look at 64 characters at most. The longest // IANA schemes are ~30, so double that and round up to a nice number. size_type length = std::min(static_cast(64), aSpec.Length()); @@ -322,7 +322,7 @@ static MOZ_ALWAYS_INLINE size_type getPrefixLength(const nsACString &aSpec) { * the length of aSpec. */ static MOZ_ALWAYS_INLINE size_type -indexOfHostAndPort(const nsACString &aSpec, size_type *_hostAndPortLength) { +indexOfHostAndPort(const nsACString& aSpec, size_type* _hostAndPortLength) { size_type index = getPrefixLength(aSpec); size_type i = index; for (; i < aSpec.Length(); ++i) { @@ -353,7 +353,7 @@ namespace places { //// AutoComplete Matching Function /* static */ -nsresult MatchAutoCompleteFunction::create(mozIStorageConnection *aDBConn) { +nsresult MatchAutoCompleteFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new MatchAutoCompleteFunction(); nsresult rv = aDBConn->CreateFunction( @@ -365,7 +365,7 @@ nsresult MatchAutoCompleteFunction::create(mozIStorageConnection *aDBConn) { /* static */ nsDependentCSubstring MatchAutoCompleteFunction::fixupURISpec( - const nsACString &aURISpec, int32_t aMatchBehavior, nsACString &aSpecBuf) { + const nsACString& aURISpec, int32_t aMatchBehavior, nsACString& aSpecBuf) { nsDependentCSubstring fixedSpec; // Try to unescape the string. If that succeeds and yields a different @@ -395,7 +395,7 @@ nsDependentCSubstring MatchAutoCompleteFunction::fixupURISpec( /* static */ bool MatchAutoCompleteFunction::findAnywhere( - const nsDependentCSubstring &aToken, const nsACString &aSourceString) { + const nsDependentCSubstring& aToken, const nsACString& aSourceString) { // We can't use FindInReadable here; it works only for ASCII. return findInString(aToken, aSourceString, eFindAnywhere); @@ -403,7 +403,7 @@ bool MatchAutoCompleteFunction::findAnywhere( /* static */ bool MatchAutoCompleteFunction::findOnBoundary( - const nsDependentCSubstring &aToken, const nsACString &aSourceString) { + const nsDependentCSubstring& aToken, const nsACString& aSourceString) { return findInString(aToken, aSourceString, eFindOnBoundary); } @@ -429,8 +429,8 @@ MatchAutoCompleteFunction::MatchAutoCompleteFunction() } NS_IMETHODIMP -MatchAutoCompleteFunction::OnFunctionCall(mozIStorageValueArray *aArguments, - nsIVariant **_result) { +MatchAutoCompleteFunction::OnFunctionCall(mozIStorageValueArray* aArguments, + nsIVariant** _result) { // Macro to make the code a bit cleaner and easier to read. Operates on // searchBehavior. int32_t searchBehavior = aArguments->AsInt32(kArgIndexSearchBehavior); @@ -493,19 +493,19 @@ MatchAutoCompleteFunction::OnFunctionCall(mozIStorageValueArray *aArguments, nsDependentCSubstring fixedUrl = fixupURISpec(url, matchBehavior, fixedUrlBuf); // Limit the number of chars we search through. - const nsDependentCSubstring &trimmedUrl = + const nsDependentCSubstring& trimmedUrl = Substring(fixedUrl, 0, MAX_CHARS_TO_SEARCH_THROUGH); nsDependentCString title = getSharedUTF8String(aArguments, kArgIndexTitle); // Limit the number of chars we search through. - const nsDependentCSubstring &trimmedTitle = + const nsDependentCSubstring& trimmedTitle = Substring(title, 0, MAX_CHARS_TO_SEARCH_THROUGH); // Determine if every token matches either the bookmark title, tags, page // title, or page URL. nsCWhitespaceTokenizer tokenizer(searchString); while (matches && tokenizer.hasMoreTokens()) { - const nsDependentCSubstring &token = tokenizer.nextToken(); + const nsDependentCSubstring& token = tokenizer.nextToken(); if (HAS_BEHAVIOR(TITLE) && HAS_BEHAVIOR(URL)) { matches = (searchFunction(token, trimmedTitle) || @@ -532,7 +532,7 @@ MatchAutoCompleteFunction::OnFunctionCall(mozIStorageValueArray *aArguments, //// Frecency Calculation Function /* static */ -nsresult CalculateFrecencyFunction::create(mozIStorageConnection *aDBConn) { +nsresult CalculateFrecencyFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new CalculateFrecencyFunction(); nsresult rv = aDBConn->CreateFunction( @@ -545,8 +545,8 @@ nsresult CalculateFrecencyFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(CalculateFrecencyFunction, mozIStorageFunction) NS_IMETHODIMP -CalculateFrecencyFunction::OnFunctionCall(mozIStorageValueArray *aArguments, - nsIVariant **_result) { +CalculateFrecencyFunction::OnFunctionCall(mozIStorageValueArray* aArguments, + nsIVariant** _result) { // Fetch arguments. Use default values if they were omitted. uint32_t numEntries; nsresult rv = aArguments->GetNumEntries(&numEntries); @@ -577,7 +577,7 @@ CalculateFrecencyFunction::OnFunctionCall(mozIStorageValueArray *aArguments, int32_t bonus = 0; // This is a const version of the history object for thread-safety. - const nsNavHistory *history = nsNavHistory::GetConstHistoryService(); + const nsNavHistory* history = nsNavHistory::GetConstHistoryService(); NS_ENSURE_STATE(history); RefPtr DB = Database::GetDatabase(); NS_ENSURE_STATE(DB); @@ -743,7 +743,7 @@ CalculateFrecencyFunction::OnFunctionCall(mozIStorageValueArray *aArguments, //// GUID Creation Function /* static */ -nsresult GenerateGUIDFunction::create(mozIStorageConnection *aDBConn) { +nsresult GenerateGUIDFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new GenerateGUIDFunction(); nsresult rv = aDBConn->CreateFunction(NS_LITERAL_CSTRING("generate_guid"), 0, function); @@ -755,8 +755,8 @@ nsresult GenerateGUIDFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(GenerateGUIDFunction, mozIStorageFunction) NS_IMETHODIMP -GenerateGUIDFunction::OnFunctionCall(mozIStorageValueArray *aArguments, - nsIVariant **_result) { +GenerateGUIDFunction::OnFunctionCall(mozIStorageValueArray* aArguments, + nsIVariant** _result) { nsAutoCString guid; nsresult rv = GenerateGUID(guid); NS_ENSURE_SUCCESS(rv, rv); @@ -769,7 +769,7 @@ GenerateGUIDFunction::OnFunctionCall(mozIStorageValueArray *aArguments, //// GUID Validation Function /* static */ -nsresult IsValidGUIDFunction::create(mozIStorageConnection *aDBConn) { +nsresult IsValidGUIDFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new IsValidGUIDFunction(); return aDBConn->CreateFunction(NS_LITERAL_CSTRING("is_valid_guid"), 1, function); @@ -778,8 +778,8 @@ nsresult IsValidGUIDFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(IsValidGUIDFunction, mozIStorageFunction) NS_IMETHODIMP -IsValidGUIDFunction::OnFunctionCall(mozIStorageValueArray *aArguments, - nsIVariant **_result) { +IsValidGUIDFunction::OnFunctionCall(mozIStorageValueArray* aArguments, + nsIVariant** _result) { // Must have non-null function arguments. MOZ_ASSERT(aArguments); @@ -796,7 +796,7 @@ IsValidGUIDFunction::OnFunctionCall(mozIStorageValueArray *aArguments, //// Get Unreversed Host Function /* static */ -nsresult GetUnreversedHostFunction::create(mozIStorageConnection *aDBConn) { +nsresult GetUnreversedHostFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new GetUnreversedHostFunction(); nsresult rv = aDBConn->CreateFunction( NS_LITERAL_CSTRING("get_unreversed_host"), 1, function); @@ -808,8 +808,8 @@ nsresult GetUnreversedHostFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(GetUnreversedHostFunction, mozIStorageFunction) NS_IMETHODIMP -GetUnreversedHostFunction::OnFunctionCall(mozIStorageValueArray *aArguments, - nsIVariant **_result) { +GetUnreversedHostFunction::OnFunctionCall(mozIStorageValueArray* aArguments, + nsIVariant** _result) { // Must have non-null function arguments. MOZ_ASSERT(aArguments); @@ -834,7 +834,7 @@ GetUnreversedHostFunction::OnFunctionCall(mozIStorageValueArray *aArguments, //// Fixup URL Function /* static */ -nsresult FixupURLFunction::create(mozIStorageConnection *aDBConn) { +nsresult FixupURLFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new FixupURLFunction(); nsresult rv = aDBConn->CreateFunction(NS_LITERAL_CSTRING("fixup_url"), 1, function); @@ -846,8 +846,8 @@ nsresult FixupURLFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(FixupURLFunction, mozIStorageFunction) NS_IMETHODIMP -FixupURLFunction::OnFunctionCall(mozIStorageValueArray *aArguments, - nsIVariant **_result) { +FixupURLFunction::OnFunctionCall(mozIStorageValueArray* aArguments, + nsIVariant** _result) { // Must have non-null function arguments. MOZ_ASSERT(aArguments); @@ -877,7 +877,7 @@ FixupURLFunction::OnFunctionCall(mozIStorageValueArray *aArguments, //// Frecency Changed Notification Function /* static */ -nsresult FrecencyNotificationFunction::create(mozIStorageConnection *aDBConn) { +nsresult FrecencyNotificationFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new FrecencyNotificationFunction(); nsresult rv = aDBConn->CreateFunction(NS_LITERAL_CSTRING("notify_frecency"), @@ -890,8 +890,8 @@ nsresult FrecencyNotificationFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(FrecencyNotificationFunction, mozIStorageFunction) NS_IMETHODIMP -FrecencyNotificationFunction::OnFunctionCall(mozIStorageValueArray *aArgs, - nsIVariant **_result) { +FrecencyNotificationFunction::OnFunctionCall(mozIStorageValueArray* aArgs, + nsIVariant** _result) { uint32_t numArgs; nsresult rv = aArgs->GetNumEntries(&numArgs); NS_ENSURE_SUCCESS(rv, rv); @@ -910,7 +910,7 @@ FrecencyNotificationFunction::OnFunctionCall(mozIStorageValueArray *aArgs, bool hidden = static_cast(aArgs->AsInt32(3)); PRTime lastVisitDate = static_cast(aArgs->AsInt64(4)); - const nsNavHistory *navHistory = nsNavHistory::GetConstHistoryService(); + const nsNavHistory* navHistory = nsNavHistory::GetConstHistoryService(); NS_ENSURE_STATE(navHistory); navHistory->DispatchFrecencyChangedNotification(spec, newFrecency, guid, hidden, lastVisitDate); @@ -926,7 +926,7 @@ FrecencyNotificationFunction::OnFunctionCall(mozIStorageValueArray *aArgs, //// Store Last Inserted Id Function /* static */ -nsresult StoreLastInsertedIdFunction::create(mozIStorageConnection *aDBConn) { +nsresult StoreLastInsertedIdFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new StoreLastInsertedIdFunction(); nsresult rv = aDBConn->CreateFunction( @@ -939,8 +939,8 @@ nsresult StoreLastInsertedIdFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(StoreLastInsertedIdFunction, mozIStorageFunction) NS_IMETHODIMP -StoreLastInsertedIdFunction::OnFunctionCall(mozIStorageValueArray *aArgs, - nsIVariant **_result) { +StoreLastInsertedIdFunction::OnFunctionCall(mozIStorageValueArray* aArgs, + nsIVariant** _result) { uint32_t numArgs; nsresult rv = aArgs->GetNumEntries(&numArgs); NS_ENSURE_SUCCESS(rv, rv); @@ -976,7 +976,7 @@ StoreLastInsertedIdFunction::OnFunctionCall(mozIStorageValueArray *aArgs, //// Get Query Param Function /* static */ -nsresult GetQueryParamFunction::create(mozIStorageConnection *aDBConn) { +nsresult GetQueryParamFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new GetQueryParamFunction(); return aDBConn->CreateFunction(NS_LITERAL_CSTRING("get_query_param"), 2, function); @@ -985,8 +985,8 @@ nsresult GetQueryParamFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(GetQueryParamFunction, mozIStorageFunction) NS_IMETHODIMP -GetQueryParamFunction::OnFunctionCall(mozIStorageValueArray *aArguments, - nsIVariant **_result) { +GetQueryParamFunction::OnFunctionCall(mozIStorageValueArray* aArguments, + nsIVariant** _result) { // Must have non-null function arguments. MOZ_ASSERT(aArguments); @@ -1007,7 +1007,7 @@ GetQueryParamFunction::OnFunctionCall(mozIStorageValueArray *aArguments, //// Hash Function /* static */ -nsresult HashFunction::create(mozIStorageConnection *aDBConn) { +nsresult HashFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new HashFunction(); return aDBConn->CreateFunction(NS_LITERAL_CSTRING("hash"), -1, function); } @@ -1015,8 +1015,8 @@ nsresult HashFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(HashFunction, mozIStorageFunction) NS_IMETHODIMP -HashFunction::OnFunctionCall(mozIStorageValueArray *aArguments, - nsIVariant **_result) { +HashFunction::OnFunctionCall(mozIStorageValueArray* aArguments, + nsIVariant** _result) { // Must have non-null function arguments. MOZ_ASSERT(aArguments); @@ -1047,7 +1047,7 @@ HashFunction::OnFunctionCall(mozIStorageValueArray *aArguments, //// Get prefix function /* static */ -nsresult GetPrefixFunction::create(mozIStorageConnection *aDBConn) { +nsresult GetPrefixFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new GetPrefixFunction(); nsresult rv = aDBConn->CreateFunction(NS_LITERAL_CSTRING("get_prefix"), 1, function); @@ -1059,8 +1059,8 @@ nsresult GetPrefixFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(GetPrefixFunction, mozIStorageFunction) NS_IMETHODIMP -GetPrefixFunction::OnFunctionCall(mozIStorageValueArray *aArgs, - nsIVariant **_result) { +GetPrefixFunction::OnFunctionCall(mozIStorageValueArray* aArgs, + nsIVariant** _result) { MOZ_ASSERT(aArgs); uint32_t numArgs; @@ -1080,7 +1080,7 @@ GetPrefixFunction::OnFunctionCall(mozIStorageValueArray *aArgs, //// Get host and port function /* static */ -nsresult GetHostAndPortFunction::create(mozIStorageConnection *aDBConn) { +nsresult GetHostAndPortFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new GetHostAndPortFunction(); nsresult rv = aDBConn->CreateFunction(NS_LITERAL_CSTRING("get_host_and_port"), 1, function); @@ -1092,8 +1092,8 @@ nsresult GetHostAndPortFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(GetHostAndPortFunction, mozIStorageFunction) NS_IMETHODIMP -GetHostAndPortFunction::OnFunctionCall(mozIStorageValueArray *aArgs, - nsIVariant **_result) { +GetHostAndPortFunction::OnFunctionCall(mozIStorageValueArray* aArgs, + nsIVariant** _result) { MOZ_ASSERT(aArgs); uint32_t numArgs; @@ -1117,7 +1117,7 @@ GetHostAndPortFunction::OnFunctionCall(mozIStorageValueArray *aArgs, /* static */ nsresult StripPrefixAndUserinfoFunction::create( - mozIStorageConnection *aDBConn) { + mozIStorageConnection* aDBConn) { RefPtr function = new StripPrefixAndUserinfoFunction(); nsresult rv = aDBConn->CreateFunction( @@ -1130,8 +1130,8 @@ nsresult StripPrefixAndUserinfoFunction::create( NS_IMPL_ISUPPORTS(StripPrefixAndUserinfoFunction, mozIStorageFunction) NS_IMETHODIMP -StripPrefixAndUserinfoFunction::OnFunctionCall(mozIStorageValueArray *aArgs, - nsIVariant **_result) { +StripPrefixAndUserinfoFunction::OnFunctionCall(mozIStorageValueArray* aArgs, + nsIVariant** _result) { MOZ_ASSERT(aArgs); uint32_t numArgs; @@ -1153,7 +1153,7 @@ StripPrefixAndUserinfoFunction::OnFunctionCall(mozIStorageValueArray *aArgs, //// Is frecency decaying function /* static */ -nsresult IsFrecencyDecayingFunction::create(mozIStorageConnection *aDBConn) { +nsresult IsFrecencyDecayingFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new IsFrecencyDecayingFunction(); nsresult rv = aDBConn->CreateFunction( @@ -1166,8 +1166,8 @@ nsresult IsFrecencyDecayingFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(IsFrecencyDecayingFunction, mozIStorageFunction) NS_IMETHODIMP -IsFrecencyDecayingFunction::OnFunctionCall(mozIStorageValueArray *aArgs, - nsIVariant **_result) { +IsFrecencyDecayingFunction::OnFunctionCall(mozIStorageValueArray* aArgs, + nsIVariant** _result) { MOZ_ASSERT(aArgs); uint32_t numArgs; @@ -1175,7 +1175,7 @@ IsFrecencyDecayingFunction::OnFunctionCall(mozIStorageValueArray *aArgs, NS_ENSURE_SUCCESS(rv, rv); MOZ_ASSERT(numArgs == 0); - const nsNavHistory *navHistory = nsNavHistory::GetConstHistoryService(); + const nsNavHistory* navHistory = nsNavHistory::GetConstHistoryService(); NS_ENSURE_STATE(navHistory); RefPtr result = new nsVariant(); @@ -1189,7 +1189,7 @@ IsFrecencyDecayingFunction::OnFunctionCall(mozIStorageValueArray *aArgs, //// sqrt function /* static */ -nsresult SqrtFunction::create(mozIStorageConnection *aDBConn) { +nsresult SqrtFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new SqrtFunction(); nsresult rv = aDBConn->CreateFunction(NS_LITERAL_CSTRING("sqrt"), 1, function); @@ -1200,8 +1200,8 @@ nsresult SqrtFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(SqrtFunction, mozIStorageFunction) NS_IMETHODIMP -SqrtFunction::OnFunctionCall(mozIStorageValueArray *aArgs, - nsIVariant **_result) { +SqrtFunction::OnFunctionCall(mozIStorageValueArray* aArgs, + nsIVariant** _result) { MOZ_ASSERT(aArgs); uint32_t numArgs; @@ -1223,7 +1223,7 @@ SqrtFunction::OnFunctionCall(mozIStorageValueArray *aArgs, //// Note Sync Change Function /* static */ -nsresult NoteSyncChangeFunction::create(mozIStorageConnection *aDBConn) { +nsresult NoteSyncChangeFunction::create(mozIStorageConnection* aDBConn) { RefPtr function = new NoteSyncChangeFunction(); nsresult rv = aDBConn->CreateFunction(NS_LITERAL_CSTRING("note_sync_change"), 0, function); @@ -1235,8 +1235,8 @@ nsresult NoteSyncChangeFunction::create(mozIStorageConnection *aDBConn) { NS_IMPL_ISUPPORTS(NoteSyncChangeFunction, mozIStorageFunction) NS_IMETHODIMP -NoteSyncChangeFunction::OnFunctionCall(mozIStorageValueArray *aArgs, - nsIVariant **_result) { +NoteSyncChangeFunction::OnFunctionCall(mozIStorageValueArray* aArgs, + nsIVariant** _result) { nsNavBookmarks::NoteSyncChange(); *_result = nullptr; return NS_OK; diff --git a/toolkit/components/places/SQLFunctions.h b/toolkit/components/places/SQLFunctions.h index b5628e62054d2..f9bad8b0f4f7c 100644 --- a/toolkit/components/places/SQLFunctions.h +++ b/toolkit/components/places/SQLFunctions.h @@ -69,7 +69,7 @@ class MatchAutoCompleteFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~MatchAutoCompleteFunction() {} @@ -99,8 +99,8 @@ class MatchAutoCompleteFunction final : public mozIStorageFunction { /** * Typedefs */ - typedef bool (*searchFunctionPtr)(const nsDependentCSubstring &aToken, - const nsACString &aSourceString); + typedef bool (*searchFunctionPtr)(const nsDependentCSubstring& aToken, + const nsACString& aSourceString); typedef nsACString::const_char_iterator const_char_iterator; @@ -123,8 +123,8 @@ class MatchAutoCompleteFunction final : public mozIStorageFunction { * The string to search. * @return true if found, false otherwise. */ - static bool findBeginning(const nsDependentCSubstring &aToken, - const nsACString &aSourceString); + static bool findBeginning(const nsDependentCSubstring& aToken, + const nsACString& aSourceString); /** * Tests if aSourceString starts with aToken in a case sensitive way. @@ -135,8 +135,8 @@ class MatchAutoCompleteFunction final : public mozIStorageFunction { * The string to search. * @return true if found, false otherwise. */ - static bool findBeginningCaseSensitive(const nsDependentCSubstring &aToken, - const nsACString &aSourceString); + static bool findBeginningCaseSensitive(const nsDependentCSubstring& aToken, + const nsACString& aSourceString); /** * Searches aSourceString for aToken anywhere in the string in a case- @@ -148,8 +148,8 @@ class MatchAutoCompleteFunction final : public mozIStorageFunction { * The string to search. * @return true if found, false otherwise. */ - static bool findAnywhere(const nsDependentCSubstring &aToken, - const nsACString &aSourceString); + static bool findAnywhere(const nsDependentCSubstring& aToken, + const nsACString& aSourceString); /** * Tests if aToken is found on a word boundary in aSourceString. @@ -160,8 +160,8 @@ class MatchAutoCompleteFunction final : public mozIStorageFunction { * The string to search. * @return true if found, false otherwise. */ - static bool findOnBoundary(const nsDependentCSubstring &aToken, - const nsACString &aSourceString); + static bool findOnBoundary(const nsDependentCSubstring& aToken, + const nsACString& aSourceString); /** * Fixes a URI's spec such that it is ready to be searched. This includes @@ -177,9 +177,9 @@ class MatchAutoCompleteFunction final : public mozIStorageFunction { * A string buffer that the returned slice can point into, if needed. * @return the fixed up string. */ - static nsDependentCSubstring fixupURISpec(const nsACString &aURISpec, + static nsDependentCSubstring fixupURISpec(const nsACString& aURISpec, int32_t aMatchBehavior, - nsACString &aSpecBuf); + nsACString& aSpecBuf); }; //////////////////////////////////////////////////////////////////////////////// @@ -210,7 +210,7 @@ class CalculateFrecencyFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~CalculateFrecencyFunction() {} @@ -233,7 +233,7 @@ class GenerateGUIDFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~GenerateGUIDFunction() {} @@ -256,7 +256,7 @@ class IsValidGUIDFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~IsValidGUIDFunction() {} @@ -281,7 +281,7 @@ class GetUnreversedHostFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~GetUnreversedHostFunction() {} @@ -310,7 +310,7 @@ class FixupURLFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~FixupURLFunction() {} @@ -347,7 +347,7 @@ class FrecencyNotificationFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~FrecencyNotificationFunction() {} @@ -376,7 +376,7 @@ class StoreLastInsertedIdFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~StoreLastInsertedIdFunction() {} @@ -404,7 +404,7 @@ class HashFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~HashFunction() {} @@ -432,7 +432,7 @@ class GetQueryParamFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~GetQueryParamFunction() {} @@ -462,7 +462,7 @@ class GetPrefixFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~GetPrefixFunction() {} @@ -492,7 +492,7 @@ class GetHostAndPortFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~GetHostAndPortFunction() {} @@ -523,7 +523,7 @@ class StripPrefixAndUserinfoFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~StripPrefixAndUserinfoFunction() {} @@ -549,7 +549,7 @@ class IsFrecencyDecayingFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~IsFrecencyDecayingFunction() {} @@ -572,7 +572,7 @@ class SqrtFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~SqrtFunction() {} @@ -597,7 +597,7 @@ class NoteSyncChangeFunction final : public mozIStorageFunction { * @param aDBConn * The database connection to register with. */ - static nsresult create(mozIStorageConnection *aDBConn); + static nsresult create(mozIStorageConnection* aDBConn); private: ~NoteSyncChangeFunction() {} diff --git a/toolkit/components/places/nsAnnoProtocolHandler.cpp b/toolkit/components/places/nsAnnoProtocolHandler.cpp index b79adde2471ba..7aba7ac412bd3 100644 --- a/toolkit/components/places/nsAnnoProtocolHandler.cpp +++ b/toolkit/components/places/nsAnnoProtocolHandler.cpp @@ -45,8 +45,8 @@ using namespace mozilla::places; /** * Creates a channel to obtain the default favicon. */ -static nsresult GetDefaultIcon(nsIChannel *aOriginalChannel, - nsIChannel **aChannel) { +static nsresult GetDefaultIcon(nsIChannel* aOriginalChannel, + nsIChannel** aChannel) { nsCOMPtr defaultIconURI; nsresult rv = NS_NewURI(getter_AddRefs(defaultIconURI), NS_LITERAL_CSTRING(FAVICON_DEFAULT_URL)); @@ -78,7 +78,7 @@ namespace { */ class faviconAsyncLoader : public AsyncStatementCallback { public: - faviconAsyncLoader(nsIChannel *aChannel, nsIStreamListener *aListener, + faviconAsyncLoader(nsIChannel* aChannel, nsIStreamListener* aListener, uint16_t aPreferredSize) : mChannel(aChannel), mListener(aListener), @@ -92,7 +92,7 @@ class faviconAsyncLoader : public AsyncStatementCallback { ////////////////////////////////////////////////////////////////////////////// //// mozIStorageStatementCallback - NS_IMETHOD HandleResult(mozIStorageResultSet *aResultSet) override { + NS_IMETHOD HandleResult(mozIStorageResultSet* aResultSet) override { nsCOMPtr row; while (NS_SUCCEEDED(aResultSet->GetNextRow(getter_AddRefs(row))) && row) { int32_t width; @@ -114,7 +114,7 @@ class faviconAsyncLoader : public AsyncStatementCallback { NS_ENSURE_SUCCESS(rv, rv); // Obtain the binary blob that contains our favicon data. - uint8_t *data; + uint8_t* data; uint32_t dataLen; rv = row->GetBlob(0, &dataLen, &data); NS_ENSURE_SUCCESS(rv, rv); @@ -184,7 +184,7 @@ NS_IMPL_ISUPPORTS(nsAnnoProtocolHandler, nsIProtocolHandler) // nsAnnoProtocolHandler::GetScheme NS_IMETHODIMP -nsAnnoProtocolHandler::GetScheme(nsACString &aScheme) { +nsAnnoProtocolHandler::GetScheme(nsACString& aScheme) { aScheme.AssignLiteral("moz-anno"); return NS_OK; } @@ -194,7 +194,7 @@ nsAnnoProtocolHandler::GetScheme(nsACString &aScheme) { // There is no default port for annotation URLs NS_IMETHODIMP -nsAnnoProtocolHandler::GetDefaultPort(int32_t *aDefaultPort) { +nsAnnoProtocolHandler::GetDefaultPort(int32_t* aDefaultPort) { *aDefaultPort = -1; return NS_OK; } @@ -202,7 +202,7 @@ nsAnnoProtocolHandler::GetDefaultPort(int32_t *aDefaultPort) { // nsAnnoProtocolHandler::GetProtocolFlags NS_IMETHODIMP -nsAnnoProtocolHandler::GetProtocolFlags(uint32_t *aProtocolFlags) { +nsAnnoProtocolHandler::GetProtocolFlags(uint32_t* aProtocolFlags) { *aProtocolFlags = (URI_NORELATIVE | URI_NOAUTH | URI_DANGEROUS_TO_LOAD | URI_IS_LOCAL_RESOURCE); return NS_OK; @@ -211,9 +211,9 @@ nsAnnoProtocolHandler::GetProtocolFlags(uint32_t *aProtocolFlags) { // nsAnnoProtocolHandler::NewURI NS_IMETHODIMP -nsAnnoProtocolHandler::NewURI(const nsACString &aSpec, - const char *aOriginCharset, nsIURI *aBaseURI, - nsIURI **_retval) { +nsAnnoProtocolHandler::NewURI(const nsACString& aSpec, + const char* aOriginCharset, nsIURI* aBaseURI, + nsIURI** _retval) { *_retval = nullptr; return NS_MutateURI(NS_SIMPLEURIMUTATOR_CONTRACTID) .SetSpec(aSpec) @@ -224,8 +224,8 @@ nsAnnoProtocolHandler::NewURI(const nsACString &aSpec, // NS_IMETHODIMP -nsAnnoProtocolHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, - nsIChannel **_retval) { +nsAnnoProtocolHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, + nsIChannel** _retval) { NS_ENSURE_ARG_POINTER(aURI); // annotation info @@ -246,8 +246,8 @@ nsAnnoProtocolHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, // Don't override any bans on bad ports. NS_IMETHODIMP -nsAnnoProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +nsAnnoProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { *_retval = false; return NS_OK; } @@ -256,8 +256,8 @@ nsAnnoProtocolHandler::AllowPort(int32_t port, const char *scheme, // // Splits an annotation URL into its URI and name parts -nsresult nsAnnoProtocolHandler::ParseAnnoURI(nsIURI *aURI, nsIURI **aResultURI, - nsCString &aName) { +nsresult nsAnnoProtocolHandler::ParseAnnoURI(nsIURI* aURI, nsIURI** aResultURI, + nsCString& aName) { nsresult rv; nsAutoCString path; rv = aURI->GetPathQueryRef(path); @@ -273,16 +273,16 @@ nsresult nsAnnoProtocolHandler::ParseAnnoURI(nsIURI *aURI, nsIURI **aResultURI, return NS_OK; } -nsresult nsAnnoProtocolHandler::NewFaviconChannel(nsIURI *aURI, - nsIURI *aAnnotationURI, - nsILoadInfo *aLoadInfo, - nsIChannel **_channel) { +nsresult nsAnnoProtocolHandler::NewFaviconChannel(nsIURI* aURI, + nsIURI* aAnnotationURI, + nsILoadInfo* aLoadInfo, + nsIChannel** _channel) { // Create our channel. We'll call SetContentType with the right type when // we know what it actually is. nsCOMPtr channel = NS_NewSimpleChannel( aURI, aLoadInfo, aAnnotationURI, - [](nsIStreamListener *listener, nsIChannel *channel, - nsIURI *annotationURI) { + [](nsIStreamListener* listener, nsIChannel* channel, + nsIURI* annotationURI) { auto fallback = [&]() -> RequestOrReason { nsCOMPtr chan; nsresult rv = GetDefaultIcon(channel, getter_AddRefs(chan)); @@ -297,7 +297,7 @@ nsresult nsAnnoProtocolHandler::NewFaviconChannel(nsIURI *aURI, // Now we go ahead and get our data asynchronously for the favicon. // Ignore the ref part of the URI before querying the database because // we may have added a size fragment for rendering purposes. - nsFaviconService *faviconService = + nsFaviconService* faviconService = nsFaviconService::GetFaviconService(); nsAutoCString faviconSpec; nsresult rv = annotationURI->GetSpecIgnoringRef(faviconSpec); diff --git a/toolkit/components/places/nsAnnoProtocolHandler.h b/toolkit/components/places/nsAnnoProtocolHandler.h index 450bd78b3f9eb..4b1ea3fb480d6 100644 --- a/toolkit/components/places/nsAnnoProtocolHandler.h +++ b/toolkit/components/places/nsAnnoProtocolHandler.h @@ -33,7 +33,7 @@ class nsAnnoProtocolHandler final : public nsIProtocolHandler, ~nsAnnoProtocolHandler() {} protected: - nsresult ParseAnnoURI(nsIURI *aURI, nsIURI **aResultURI, nsCString &aName); + nsresult ParseAnnoURI(nsIURI* aURI, nsIURI** aResultURI, nsCString& aName); /** * Obtains a new channel to be used to get a favicon from the database. This @@ -49,8 +49,8 @@ class nsAnnoProtocolHandler final : public nsIProtocolHandler, * The loadinfo that requested the resource load. * @returns (via _channel) the channel that will obtain the favicon data. */ - nsresult NewFaviconChannel(nsIURI *aURI, nsIURI *aAnnotationURI, - nsILoadInfo *aLoadInfo, nsIChannel **_channel); + nsresult NewFaviconChannel(nsIURI* aURI, nsIURI* aAnnotationURI, + nsILoadInfo* aLoadInfo, nsIChannel** _channel); }; #endif /* nsAnnoProtocolHandler_h___ */ diff --git a/toolkit/components/places/nsPlacesMacros.h b/toolkit/components/places/nsPlacesMacros.h index e2b8cd1f28c31..60c6f4aab5341 100644 --- a/toolkit/components/places/nsPlacesMacros.h +++ b/toolkit/components/places/nsPlacesMacros.h @@ -19,7 +19,7 @@ PR_BEGIN_MACRO \ if (canFire) { \ for (uint32_t idx = 0; idx < array.Length(); ++idx) { \ - const nsCOMPtr &e = \ + const nsCOMPtr& e = \ array.ElementAt(idx).GetValue(); \ if (e) { \ if (skipIf(e)) continue; \ @@ -30,7 +30,7 @@ PR_END_MACRO; #define PLACES_FACTORY_SINGLETON_IMPLEMENTATION(_className, _sInstance) \ - _className *_className::_sInstance = nullptr; \ + _className* _className::_sInstance = nullptr; \ \ already_AddRefed<_className> _className::GetSingleton() { \ if (_sInstance) { \ diff --git a/toolkit/components/places/tests/gtest/places_test_harness_tail.h b/toolkit/components/places/tests/gtest/places_test_harness_tail.h index e27551f275b75..8eba3cfd9738b 100644 --- a/toolkit/components/places/tests/gtest/places_test_harness_tail.h +++ b/toolkit/components/places/tests/gtest/places_test_harness_tail.h @@ -24,7 +24,7 @@ class RunNextTest : public mozilla::Runnable { NS_ASSERTION(NS_IsMainThread(), "Not running on the main thread?"); if (gTestsIndex < int(mozilla::ArrayLength(gTests))) { do_test_pending(); - Test &test = gTests[gTestsIndex++]; + Test& test = gTests[gTestsIndex++]; (void)fprintf(stderr, TEST_INFO_STR "Running %s.\n", test.name); test.func(); } diff --git a/toolkit/components/printingui/ipc/PrintDataUtils.cpp b/toolkit/components/printingui/ipc/PrintDataUtils.cpp index 150d8c604de94..1e386bb7a738c 100644 --- a/toolkit/components/printingui/ipc/PrintDataUtils.cpp +++ b/toolkit/components/printingui/ipc/PrintDataUtils.cpp @@ -21,73 +21,73 @@ namespace embedding { NS_IMPL_ISUPPORTS(MockWebBrowserPrint, nsIWebBrowserPrint); -MockWebBrowserPrint::MockWebBrowserPrint(const PrintData &aData) +MockWebBrowserPrint::MockWebBrowserPrint(const PrintData& aData) : mData(aData) {} MockWebBrowserPrint::~MockWebBrowserPrint() {} NS_IMETHODIMP MockWebBrowserPrint::GetGlobalPrintSettings( - nsIPrintSettings **aGlobalPrintSettings) { + nsIPrintSettings** aGlobalPrintSettings) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP MockWebBrowserPrint::GetCurrentPrintSettings( - nsIPrintSettings **aCurrentPrintSettings) { + nsIPrintSettings** aCurrentPrintSettings) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -MockWebBrowserPrint::GetDoingPrint(bool *aDoingPrint) { +MockWebBrowserPrint::GetDoingPrint(bool* aDoingPrint) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -MockWebBrowserPrint::GetDoingPrintPreview(bool *aDoingPrintPreview) { +MockWebBrowserPrint::GetDoingPrintPreview(bool* aDoingPrintPreview) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -MockWebBrowserPrint::GetIsFramesetDocument(bool *aIsFramesetDocument) { +MockWebBrowserPrint::GetIsFramesetDocument(bool* aIsFramesetDocument) { *aIsFramesetDocument = mData.isFramesetDocument(); return NS_OK; } NS_IMETHODIMP MockWebBrowserPrint::GetIsFramesetFrameSelected( - bool *aIsFramesetFrameSelected) { + bool* aIsFramesetFrameSelected) { *aIsFramesetFrameSelected = mData.isFramesetFrameSelected(); return NS_OK; } NS_IMETHODIMP -MockWebBrowserPrint::GetIsIFrameSelected(bool *aIsIFrameSelected) { +MockWebBrowserPrint::GetIsIFrameSelected(bool* aIsIFrameSelected) { *aIsIFrameSelected = mData.isIFrameSelected(); return NS_OK; } NS_IMETHODIMP -MockWebBrowserPrint::GetIsRangeSelection(bool *aIsRangeSelection) { +MockWebBrowserPrint::GetIsRangeSelection(bool* aIsRangeSelection) { *aIsRangeSelection = mData.isRangeSelection(); return NS_OK; } NS_IMETHODIMP -MockWebBrowserPrint::GetPrintPreviewNumPages(int32_t *aPrintPreviewNumPages) { +MockWebBrowserPrint::GetPrintPreviewNumPages(int32_t* aPrintPreviewNumPages) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -MockWebBrowserPrint::Print(nsIPrintSettings *aThePrintSettings, - nsIWebProgressListener *aWPListener) { +MockWebBrowserPrint::Print(nsIPrintSettings* aThePrintSettings, + nsIWebProgressListener* aWPListener) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -MockWebBrowserPrint::PrintPreview(nsIPrintSettings *aThePrintSettings, - mozIDOMWindowProxy *aChildDOMWin, - nsIWebProgressListener *aWPListener) { +MockWebBrowserPrint::PrintPreview(nsIPrintSettings* aThePrintSettings, + mozIDOMWindowProxy* aChildDOMWin, + nsIWebProgressListener* aWPListener) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -100,8 +100,8 @@ NS_IMETHODIMP MockWebBrowserPrint::Cancel() { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -MockWebBrowserPrint::EnumerateDocumentNames(uint32_t *aCount, - char16_t ***aResult) { +MockWebBrowserPrint::EnumerateDocumentNames(uint32_t* aCount, + char16_t*** aResult) { *aCount = 0; *aResult = nullptr; @@ -113,7 +113,7 @@ MockWebBrowserPrint::EnumerateDocumentNames(uint32_t *aCount, // dialog, and even then, it only cares about the first document // name. That's why we only send a single document name through // PrintData. - char16_t **array = (char16_t **)moz_xmalloc(sizeof(char16_t *)); + char16_t** array = (char16_t**)moz_xmalloc(sizeof(char16_t*)); array[0] = ToNewUnicode(mData.printJobName()); *aCount = 1; diff --git a/toolkit/components/printingui/ipc/PrintDataUtils.h b/toolkit/components/printingui/ipc/PrintDataUtils.h index b555f42272258..a172ac92302c0 100644 --- a/toolkit/components/printingui/ipc/PrintDataUtils.h +++ b/toolkit/components/printingui/ipc/PrintDataUtils.h @@ -22,7 +22,7 @@ namespace embedding { class MockWebBrowserPrint final : public nsIWebBrowserPrint { public: - explicit MockWebBrowserPrint(const PrintData &aData); + explicit MockWebBrowserPrint(const PrintData& aData); NS_DECL_ISUPPORTS NS_DECL_NSIWEBBROWSERPRINT diff --git a/toolkit/components/printingui/nsPrintProgress.cpp b/toolkit/components/printingui/nsPrintProgress.cpp index 1092a7da5a98e..ea9b3c925a5d8 100644 --- a/toolkit/components/printingui/nsPrintProgress.cpp +++ b/toolkit/components/printingui/nsPrintProgress.cpp @@ -26,7 +26,7 @@ NS_INTERFACE_MAP_BEGIN(nsPrintProgress) NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) NS_INTERFACE_MAP_END -nsPrintProgress::nsPrintProgress(nsIPrintSettings *aPrintSettings) { +nsPrintProgress::nsPrintProgress(nsIPrintSettings* aPrintSettings) { m_closeProgress = false; m_processCanceled = false; m_pendingStateFlags = -1; @@ -37,8 +37,8 @@ nsPrintProgress::nsPrintProgress(nsIPrintSettings *aPrintSettings) { nsPrintProgress::~nsPrintProgress() { (void)ReleaseListeners(); } NS_IMETHODIMP nsPrintProgress::OpenProgressDialog( - mozIDOMWindowProxy *parent, const char *dialogURL, nsISupports *parameters, - nsIObserver *openDialogObserver, bool *notifyOnOpen) { + mozIDOMWindowProxy* parent, const char* dialogURL, nsISupports* parameters, + nsIObserver* openDialogObserver, bool* notifyOnOpen) { *notifyOnOpen = true; m_observer = openDialogObserver; nsresult rv = NS_ERROR_FAILURE; @@ -55,7 +55,7 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog( do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - ifptr->SetData(static_cast(this)); + ifptr->SetData(static_cast(this)); ifptr->SetDataIID(&NS_GET_IID(nsIPrintProgress)); array->AppendElement(ifptr); @@ -100,7 +100,7 @@ NS_IMETHODIMP nsPrintProgress::CloseProgressDialog(bool forceClose) { (nsresult)forceClose); } -NS_IMETHODIMP nsPrintProgress::GetPrompter(nsIPrompt **_retval) { +NS_IMETHODIMP nsPrintProgress::GetPrompter(nsIPrompt** _retval) { NS_ENSURE_ARG_POINTER(_retval); *_retval = nullptr; @@ -114,7 +114,7 @@ NS_IMETHODIMP nsPrintProgress::GetPrompter(nsIPrompt **_retval) { } NS_IMETHODIMP nsPrintProgress::GetProcessCanceledByUser( - bool *aProcessCanceledByUser) { + bool* aProcessCanceledByUser) { NS_ENSURE_ARG_POINTER(aProcessCanceledByUser); *aProcessCanceledByUser = m_processCanceled; return NS_OK; @@ -132,7 +132,7 @@ NS_IMETHODIMP nsPrintProgress::SetProcessCanceledByUser( } NS_IMETHODIMP nsPrintProgress::RegisterListener( - nsIWebProgressListener *listener) { + nsIWebProgressListener* listener) { if (!listener) // Nothing to do with a null listener! return NS_OK; @@ -151,7 +151,7 @@ NS_IMETHODIMP nsPrintProgress::RegisterListener( } NS_IMETHODIMP nsPrintProgress::UnregisterListener( - nsIWebProgressListener *listener) { + nsIWebProgressListener* listener) { if (listener) m_listenerList.RemoveObject(listener); return NS_OK; @@ -164,8 +164,8 @@ NS_IMETHODIMP nsPrintProgress::DoneIniting() { return NS_OK; } -NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aStateFlags, nsresult aStatus) { if (XRE_IsE10sParentProcess() && @@ -191,8 +191,8 @@ NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, return NS_OK; } -NS_IMETHODIMP nsPrintProgress::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +NS_IMETHODIMP nsPrintProgress::OnProgressChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, int32_t aCurSelfProgress, int32_t aMaxSelfProgress, int32_t aCurTotalProgress, @@ -218,17 +218,17 @@ NS_IMETHODIMP nsPrintProgress::OnProgressChange(nsIWebProgress *aWebProgress, return NS_OK; } -NS_IMETHODIMP nsPrintProgress::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *location, +NS_IMETHODIMP nsPrintProgress::OnLocationChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, + nsIURI* location, uint32_t aFlags) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, nsresult aStatus, - const char16_t *aMessage) { + const char16_t* aMessage) { if (aMessage && *aMessage) m_pendingStatus = aMessage; uint32_t count = m_listenerList.Count(); @@ -243,14 +243,14 @@ NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress *aWebProgress, return NS_OK; } -NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aState) { return NS_OK; } NS_IMETHODIMP nsPrintProgress::OnContentBlockingEvent( - nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aEvent) { + nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t aEvent) { return NS_OK; } diff --git a/toolkit/components/remote/RemoteUtils.cpp b/toolkit/components/remote/RemoteUtils.cpp index 71941d1df4f0a..4e0c3d239b03f 100644 --- a/toolkit/components/remote/RemoteUtils.cpp +++ b/toolkit/components/remote/RemoteUtils.cpp @@ -31,7 +31,7 @@ #endif /* like strcpy, but return the char after the final null */ -static char *estrcpy(const char *s, char *d) { +static char* estrcpy(const char* s, char* d) { while (*s) *d++ = *s++; *d++ = '\0'; @@ -41,9 +41,9 @@ static char *estrcpy(const char *s, char *d) { /* Construct a command line from given args and desktop startup ID. * Returned buffer must be released by free(). */ -char *ConstructCommandLine(int32_t argc, char **argv, - const char *aDesktopStartupID, - int *aCommandLineLength) { +char* ConstructCommandLine(int32_t argc, char** argv, + const char* aDesktopStartupID, + int* aCommandLineLength) { char cwdbuf[MAX_PATH]; if (!getcwd(cwdbuf, MAX_PATH)) return nullptr; @@ -64,18 +64,18 @@ char *ConstructCommandLine(int32_t argc, char **argv, argvlen += len; } - auto *buffer = - (int32_t *)malloc(argvlen + argc + 1 + sizeof(int32_t) * (argc + 1)); + auto* buffer = + (int32_t*)malloc(argvlen + argc + 1 + sizeof(int32_t) * (argc + 1)); if (!buffer) return nullptr; buffer[0] = TO_LITTLE_ENDIAN32(argc); - auto *bufend = (char *)(buffer + argc + 1); + auto* bufend = (char*)(buffer + argc + 1); bufend = estrcpy(cwdbuf, bufend); for (int i = 0; i < argc; ++i) { - buffer[i + 1] = TO_LITTLE_ENDIAN32(bufend - ((char *)buffer)); + buffer[i + 1] = TO_LITTLE_ENDIAN32(bufend - ((char*)buffer)); bufend = estrcpy(argv[i], bufend); if (i == 0 && aDesktopStartupID) { bufend = estrcpy(desktopStartupPrefix, bufend - 1); @@ -85,7 +85,7 @@ char *ConstructCommandLine(int32_t argc, char **argv, #ifdef DEBUG_command_line int32_t debug_argc = TO_LITTLE_ENDIAN32(*buffer); - char *debug_workingdir = (char *)(buffer + argc + 1); + char* debug_workingdir = (char*)(buffer + argc + 1); printf( "Sending command line:\n" @@ -93,12 +93,12 @@ char *ConstructCommandLine(int32_t argc, char **argv, " argc:\t%i", debug_workingdir, debug_argc); - int32_t *debug_offset = buffer + 1; + int32_t* debug_offset = buffer + 1; for (int debug_i = 0; debug_i < debug_argc; ++debug_i) printf(" argv[%i]:\t%s\n", debug_i, - ((char *)buffer) + TO_LITTLE_ENDIAN32(debug_offset[debug_i])); + ((char*)buffer) + TO_LITTLE_ENDIAN32(debug_offset[debug_i])); #endif - *aCommandLineLength = bufend - reinterpret_cast(buffer); - return reinterpret_cast(buffer); + *aCommandLineLength = bufend - reinterpret_cast(buffer); + return reinterpret_cast(buffer); } diff --git a/toolkit/components/remote/nsDBusRemoteClient.cpp b/toolkit/components/remote/nsDBusRemoteClient.cpp index 5f83f61015f1a..303f4ed81b12c 100644 --- a/toolkit/components/remote/nsDBusRemoteClient.cpp +++ b/toolkit/components/remote/nsDBusRemoteClient.cpp @@ -52,14 +52,14 @@ void nsDBusRemoteClient::Shutdown(void) { } nsresult nsDBusRemoteClient::SendCommandLine( - const char *aProgram, const char *aProfile, int32_t argc, char **argv, - const char *aDesktopStartupID, char **aResponse, bool *aWindowFound) { + const char* aProgram, const char* aProfile, int32_t argc, char** argv, + const char* aDesktopStartupID, char** aResponse, bool* aWindowFound) { NS_ENSURE_TRUE(aProgram, NS_ERROR_INVALID_ARG); MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsDBusRemoteClient::SendCommandLine")); int commandLineLength; - char *commandLine = + char* commandLine = ConstructCommandLine(argc, argv, aDesktopStartupID, &commandLineLength); if (!commandLine) return NS_ERROR_FAILURE; @@ -74,9 +74,9 @@ nsresult nsDBusRemoteClient::SendCommandLine( return rv; } -bool nsDBusRemoteClient::GetRemoteDestinationName(const char *aProgram, - const char *aProfile, - nsCString &aDestinationName) { +bool nsDBusRemoteClient::GetRemoteDestinationName(const char* aProgram, + const char* aProfile, + nsCString& aDestinationName) { // We have a profile name - just create the destination. // D-Bus names can contain only [a-z][A-Z][0-9]_ // characters so adjust the profile string properly. @@ -90,7 +90,7 @@ bool nsDBusRemoteClient::GetRemoteDestinationName(const char *aProgram, if (aDestinationName.Length() > DBUS_MAXIMUM_NAME_LENGTH) aDestinationName.Truncate(DBUS_MAXIMUM_NAME_LENGTH); - static auto sDBusValidateBusName = (bool (*)(const char *, DBusError *))dlsym( + static auto sDBusValidateBusName = (bool (*)(const char*, DBusError*))dlsym( RTLD_DEFAULT, "dbus_validate_bus_name"); if (!sDBusValidateBusName) { return false; @@ -110,9 +110,9 @@ bool nsDBusRemoteClient::GetRemoteDestinationName(const char *aProgram, return true; } -nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char *aProgram, - const char *aProfile, - const char *aBuffer, +nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProgram, + const char* aProfile, + const char* aBuffer, int aLength) { nsAutoCString destinationName; if (!GetRemoteDestinationName(aProgram, aProfile, destinationName)) diff --git a/toolkit/components/remote/nsDBusRemoteClient.h b/toolkit/components/remote/nsDBusRemoteClient.h index ef6acc4fb60d2..92e7e02b9fee0 100644 --- a/toolkit/components/remote/nsDBusRemoteClient.h +++ b/toolkit/components/remote/nsDBusRemoteClient.h @@ -17,17 +17,17 @@ class nsDBusRemoteClient : public nsRemoteClient { ~nsDBusRemoteClient(); virtual nsresult Init() override; - virtual nsresult SendCommandLine(const char *aProgram, const char *aProfile, - int32_t argc, char **argv, - const char *aDesktopStartupID, - char **aResponse, bool *aSucceeded) override; + virtual nsresult SendCommandLine(const char* aProgram, const char* aProfile, + int32_t argc, char** argv, + const char* aDesktopStartupID, + char** aResponse, bool* aSucceeded) override; void Shutdown(); private: - bool GetRemoteDestinationName(const char *aProgram, const char *aProfile, - nsCString &aDestinationName); - nsresult DoSendDBusCommandLine(const char *aProgram, const char *aProfile, - const char *aBuffer, int aLength); + bool GetRemoteDestinationName(const char* aProgram, const char* aProfile, + nsCString& aDestinationName); + nsresult DoSendDBusCommandLine(const char* aProgram, const char* aProfile, + const char* aBuffer, int aLength); RefPtr mConnection; }; diff --git a/toolkit/components/remote/nsDBusRemoteServer.cpp b/toolkit/components/remote/nsDBusRemoteServer.cpp index 7f42a08029e31..703eb1bc07915 100644 --- a/toolkit/components/remote/nsDBusRemoteServer.cpp +++ b/toolkit/components/remote/nsDBusRemoteServer.cpp @@ -27,7 +27,7 @@ #include -const char *introspect_template = +const char* introspect_template = "\n" @@ -44,8 +44,8 @@ const char *introspect_template = " \n" "\n"; -DBusHandlerResult nsDBusRemoteServer::Introspect(DBusMessage *msg) { - DBusMessage *reply; +DBusHandlerResult nsDBusRemoteServer::Introspect(DBusMessage* msg) { + DBusMessage* reply; reply = dbus_message_new_method_return(msg); if (!reply) return DBUS_HANDLER_RESULT_NEED_MEMORY; @@ -53,7 +53,7 @@ DBusHandlerResult nsDBusRemoteServer::Introspect(DBusMessage *msg) { nsAutoCString introspect_xml; introspect_xml = nsPrintfCString(introspect_template, mAppName.get()); - const char *message = introspect_xml.get(); + const char* message = introspect_xml.get(); dbus_message_append_args(reply, DBUS_TYPE_STRING, &message, DBUS_TYPE_INVALID); @@ -63,9 +63,9 @@ DBusHandlerResult nsDBusRemoteServer::Introspect(DBusMessage *msg) { return DBUS_HANDLER_RESULT_HANDLED; } -DBusHandlerResult nsDBusRemoteServer::OpenURL(DBusMessage *msg) { - DBusMessage *reply = nullptr; - const char *commandLine; +DBusHandlerResult nsDBusRemoteServer::OpenURL(DBusMessage* msg) { + DBusMessage* reply = nullptr; + const char* commandLine; int length; if (!dbus_message_get_args(msg, nullptr, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, @@ -90,11 +90,11 @@ DBusHandlerResult nsDBusRemoteServer::OpenURL(DBusMessage *msg) { } DBusHandlerResult nsDBusRemoteServer::HandleDBusMessage( - DBusConnection *aConnection, DBusMessage *msg) { + DBusConnection* aConnection, DBusMessage* msg) { NS_ASSERTION(mConnection == aConnection, "Wrong D-Bus connection."); - const char *method = dbus_message_get_member(msg); - const char *iface = dbus_message_get_interface(msg); + const char* method = dbus_message_get_member(msg); + const char* iface = dbus_message_get_interface(msg); if ((strcmp("Introspect", method) == 0) && (strcmp("org.freedesktop.DBus.Introspectable", iface) == 0)) { @@ -112,19 +112,19 @@ DBusHandlerResult nsDBusRemoteServer::HandleDBusMessage( return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } -void nsDBusRemoteServer::UnregisterDBusInterface(DBusConnection *aConnection) { +void nsDBusRemoteServer::UnregisterDBusInterface(DBusConnection* aConnection) { NS_ASSERTION(mConnection == aConnection, "Wrong D-Bus connection."); // Not implemented } -static DBusHandlerResult message_handler(DBusConnection *conn, DBusMessage *msg, - void *user_data) { - auto interface = static_cast(user_data); +static DBusHandlerResult message_handler(DBusConnection* conn, DBusMessage* msg, + void* user_data) { + auto interface = static_cast(user_data); return interface->HandleDBusMessage(conn, msg); } -static void unregister(DBusConnection *conn, void *user_data) { - auto interface = static_cast(user_data); +static void unregister(DBusConnection* conn, void* user_data) { + auto interface = static_cast(user_data); interface->UnregisterDBusInterface(conn); } @@ -133,8 +133,8 @@ static DBusObjectPathVTable remoteHandlersTable = { .message_function = message_handler, }; -nsresult nsDBusRemoteServer::Startup(const char *aAppName, - const char *aProfileName) { +nsresult nsDBusRemoteServer::Startup(const char* aAppName, + const char* aProfileName) { if (mConnection && dbus_connection_get_is_connected(mConnection)) { // We're already connected so we don't need to reconnect return NS_ERROR_ALREADY_INITIALIZED; @@ -169,7 +169,7 @@ nsresult nsDBusRemoteServer::Startup(const char *aAppName, if (busName.Length() > DBUS_MAXIMUM_NAME_LENGTH) busName.Truncate(DBUS_MAXIMUM_NAME_LENGTH); - static auto sDBusValidateBusName = (bool (*)(const char *, DBusError *))dlsym( + static auto sDBusValidateBusName = (bool (*)(const char*, DBusError*))dlsym( RTLD_DEFAULT, "dbus_validate_bus_name"); if (!sDBusValidateBusName) { return NS_ERROR_FAILURE; diff --git a/toolkit/components/remote/nsDBusRemoteServer.h b/toolkit/components/remote/nsDBusRemoteServer.h index 3bb2ec6fdc122..ce23a28c36329 100644 --- a/toolkit/components/remote/nsDBusRemoteServer.h +++ b/toolkit/components/remote/nsDBusRemoteServer.h @@ -18,16 +18,16 @@ class nsDBusRemoteServer final : public nsRemoteServer, nsDBusRemoteServer() : mConnection(nullptr), mAppName(nullptr) {} ~nsDBusRemoteServer() override { Shutdown(); } - nsresult Startup(const char *aAppName, const char *aProfileName) override; + nsresult Startup(const char* aAppName, const char* aProfileName) override; void Shutdown() override; - DBusHandlerResult HandleDBusMessage(DBusConnection *aConnection, - DBusMessage *msg); - void UnregisterDBusInterface(DBusConnection *aConnection); + DBusHandlerResult HandleDBusMessage(DBusConnection* aConnection, + DBusMessage* msg); + void UnregisterDBusInterface(DBusConnection* aConnection); private: - DBusHandlerResult OpenURL(DBusMessage *msg); - DBusHandlerResult Introspect(DBusMessage *msg); + DBusHandlerResult OpenURL(DBusMessage* msg); + DBusHandlerResult Introspect(DBusMessage* msg); // The connection is owned by DBus library RefPtr mConnection; diff --git a/toolkit/components/remote/nsRemoteClient.h b/toolkit/components/remote/nsRemoteClient.h index 184c8a8c37c97..4f8050a2374f3 100644 --- a/toolkit/components/remote/nsRemoteClient.h +++ b/toolkit/components/remote/nsRemoteClient.h @@ -53,10 +53,10 @@ class nsRemoteClient { * @return true if succeeded, false if no running instance was found. * */ - virtual nsresult SendCommandLine(const char *aProgram, const char *aProfile, - int32_t argc, char **argv, - const char *aDesktopStartupID, - char **aResponse, bool *aSucceeded) = 0; + virtual nsresult SendCommandLine(const char* aProgram, const char* aProfile, + int32_t argc, char** argv, + const char* aDesktopStartupID, + char** aResponse, bool* aSucceeded) = 0; }; #endif // nsRemoteClient_h__ diff --git a/toolkit/components/remote/nsWinRemoteClient.cpp b/toolkit/components/remote/nsWinRemoteClient.cpp index f1577d1c44bb9..bb126b0a7591f 100644 --- a/toolkit/components/remote/nsWinRemoteClient.cpp +++ b/toolkit/components/remote/nsWinRemoteClient.cpp @@ -15,8 +15,8 @@ using namespace mozilla; nsresult nsWinRemoteClient::Init() { return NS_OK; } nsresult nsWinRemoteClient::SendCommandLine( - const char *aProgram, const char *aProfile, int32_t argc, char **argv, - const char *aDesktopStartupID, char **aResponse, bool *aSucceeded) { + const char* aProgram, const char* aProfile, int32_t argc, char** argv, + const char* aDesktopStartupID, char** aResponse, bool* aSucceeded) { *aSucceeded = false; nsString className; @@ -28,21 +28,21 @@ nsresult nsWinRemoteClient::SendCommandLine( return NS_OK; } - WCHAR *cmd = ::GetCommandLineW(); + WCHAR* cmd = ::GetCommandLineW(); WCHAR cwd[MAX_PATH]; _wgetcwd(cwd, MAX_PATH); // Construct a narrow UTF8 buffer \0\0 NS_ConvertUTF16toUTF8 utf8buffer(cmd); utf8buffer.Append('\0'); - WCHAR *cwdPtr = cwd; - AppendUTF16toUTF8(MakeStringSpan(reinterpret_cast(cwdPtr)), + WCHAR* cwdPtr = cwd; + AppendUTF16toUTF8(MakeStringSpan(reinterpret_cast(cwdPtr)), utf8buffer); utf8buffer.Append('\0'); // We used to set dwData to zero, when we didn't send the working dir. // Now we're using it as a version number. - COPYDATASTRUCT cds = {1, utf8buffer.Length(), (void *)utf8buffer.get()}; + COPYDATASTRUCT cds = {1, utf8buffer.Length(), (void*)utf8buffer.get()}; // Bring the already running Mozilla process to the foreground. // nsWindow will restore the window (if minimized) and raise it. ::SetForegroundWindow(handle); diff --git a/toolkit/components/remote/nsWinRemoteClient.h b/toolkit/components/remote/nsWinRemoteClient.h index 9ae658002a531..f17e3c9dfe0b6 100644 --- a/toolkit/components/remote/nsWinRemoteClient.h +++ b/toolkit/components/remote/nsWinRemoteClient.h @@ -21,10 +21,10 @@ class nsWinRemoteClient : public nsRemoteClient { nsresult Init() override; - nsresult SendCommandLine(const char *aProgram, const char *aProfile, - int32_t argc, char **argv, - const char *aDesktopStartupID, char **aResponse, - bool *aSucceeded) override; + nsresult SendCommandLine(const char* aProgram, const char* aProfile, + int32_t argc, char** argv, + const char* aDesktopStartupID, char** aResponse, + bool* aSucceeded) override; }; #endif // nsWinRemoteClient_h__ diff --git a/toolkit/components/remote/nsWinRemoteServer.cpp b/toolkit/components/remote/nsWinRemoteServer.cpp index d6acdaf9375e5..49af2c4f42c07 100644 --- a/toolkit/components/remote/nsWinRemoteServer.cpp +++ b/toolkit/components/remote/nsWinRemoteServer.cpp @@ -21,7 +21,7 @@ #include "nsCommandLine.h" #include "nsIDocShell.h" -HWND hwndForDOMWindow(mozIDOMWindowProxy *window) { +HWND hwndForDOMWindow(mozIDOMWindowProxy* window) { if (!window) { return 0; } @@ -39,7 +39,7 @@ HWND hwndForDOMWindow(mozIDOMWindowProxy *window) { return (HWND)(ppWidget->GetNativeData(NS_NATIVE_WIDGET)); } -static nsresult GetMostRecentWindow(mozIDOMWindowProxy **aWindow) { +static nsresult GetMostRecentWindow(mozIDOMWindowProxy** aWindow) { nsresult rv; nsCOMPtr med( do_GetService(NS_WINDOWMEDIATOR_CONTRACTID, &rv)); @@ -50,17 +50,17 @@ static nsresult GetMostRecentWindow(mozIDOMWindowProxy **aWindow) { return NS_ERROR_FAILURE; } -void HandleCommandLine(const char *aCmdLineString, nsIFile *aWorkingDir, +void HandleCommandLine(const char* aCmdLineString, nsIFile* aWorkingDir, uint32_t aState) { nsresult rv; int justCounting = 1; - char **argv = 0; + char** argv = 0; // Flags, etc. int init = 1; int between, quoted, bSlashCount; int argc; - const char *p; + const char* p; nsAutoCString arg; nsCOMPtr cmdLine(new nsCommandLine()); @@ -176,7 +176,7 @@ void HandleCommandLine(const char *aCmdLineString, nsIFile *aWorkingDir, // If on first pass, go on to second. if (justCounting) { // Allocate argv array. - argv = new char *[argc]; + argv = new char*[argc]; // Start second pass justCounting = 0; @@ -207,11 +207,11 @@ void HandleCommandLine(const char *aCmdLineString, nsIFile *aWorkingDir, LRESULT CALLBACK WindowProc(HWND msgWindow, UINT msg, WPARAM wp, LPARAM lp) { if (msg == WM_COPYDATA) { // This is an incoming request. - COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lp; + COPYDATASTRUCT* cds = (COPYDATASTRUCT*)lp; nsCOMPtr workingDir; if (1 >= cds->dwData) { - char *wdpath = (char *)cds->lpData; + char* wdpath = (char*)cds->lpData; // skip the command line, and get the working dir of the // other process, which is after the first null char while (*wdpath) ++wdpath; @@ -221,7 +221,7 @@ LRESULT CALLBACK WindowProc(HWND msgWindow, UINT msg, WPARAM wp, LPARAM lp) { NS_NewLocalFile(NS_ConvertUTF8toUTF16(wdpath), false, getter_AddRefs(workingDir)); } - HandleCommandLine((char *)cds->lpData, workingDir, + HandleCommandLine((char*)cds->lpData, workingDir, nsICommandLine::STATE_REMOTE_AUTO); // Get current window and return its window handle. @@ -232,8 +232,8 @@ LRESULT CALLBACK WindowProc(HWND msgWindow, UINT msg, WPARAM wp, LPARAM lp) { return DefWindowProc(msgWindow, msg, wp, lp); } -nsresult nsWinRemoteServer::Startup(const char *aAppName, - const char *aProfileName) { +nsresult nsWinRemoteServer::Startup(const char* aAppName, + const char* aProfileName) { nsString className; BuildClassName(aAppName, aProfileName, className); diff --git a/toolkit/components/remote/nsWinRemoteUtils.h b/toolkit/components/remote/nsWinRemoteUtils.h index e5cc6554f9c0c..d0092b472afd9 100644 --- a/toolkit/components/remote/nsWinRemoteUtils.h +++ b/toolkit/components/remote/nsWinRemoteUtils.h @@ -10,8 +10,8 @@ #include "nsString.h" -static void BuildClassName(const char *aProgram, const char *aProfile, - nsString &aClassName) { +static void BuildClassName(const char* aProgram, const char* aProfile, + nsString& aClassName) { aClassName.AppendPrintf("Mozilla_%s_%s_RemoteWindow", aProgram, aProfile); } diff --git a/toolkit/components/remote/nsXRemoteClient.cpp b/toolkit/components/remote/nsXRemoteClient.cpp index 2e2bc8de7ce3e..00d8cfd1e04f2 100644 --- a/toolkit/components/remote/nsXRemoteClient.cpp +++ b/toolkit/components/remote/nsXRemoteClient.cpp @@ -57,7 +57,7 @@ using mozilla::Unused; static mozilla::LazyLogModule sRemoteLm("nsXRemoteClient"); -static int (*sOldHandler)(Display *, XErrorEvent *); +static int (*sOldHandler)(Display*, XErrorEvent*); static bool sGotBadWindow; nsXRemoteClient::nsXRemoteClient() { @@ -81,7 +81,7 @@ nsXRemoteClient::~nsXRemoteClient() { } // Minimize the roundtrips to the X-server -static const char *XAtomNames[] = { +static const char* XAtomNames[] = { MOZILLA_VERSION_PROP, MOZILLA_LOCK_PROP, MOZILLA_RESPONSE_PROP, "WM_STATE", MOZILLA_USER_PROP, MOZILLA_PROFILE_PROP, MOZILLA_PROGRAM_PROP, MOZILLA_COMMANDLINE_PROP}; @@ -97,7 +97,7 @@ nsresult nsXRemoteClient::Init() { if (!mDisplay) return NS_ERROR_FAILURE; // get our atoms - XInternAtoms(mDisplay, const_cast(XAtomNames), + XInternAtoms(mDisplay, const_cast(XAtomNames), MOZ_ARRAY_LENGTH(XAtomNames), False, XAtoms); int i = 0; @@ -130,7 +130,7 @@ void nsXRemoteClient::Shutdown(void) { } } -static int HandleBadWindow(Display *display, XErrorEvent *event) { +static int HandleBadWindow(Display* display, XErrorEvent* event) { if (event->error_code == BadWindow) { sGotBadWindow = true; return 0; // ignored @@ -140,8 +140,8 @@ static int HandleBadWindow(Display *display, XErrorEvent *event) { } nsresult nsXRemoteClient::SendCommandLine( - const char *aProgram, const char *aProfile, int32_t argc, char **argv, - const char *aDesktopStartupID, char **aResponse, bool *aWindowFound) { + const char* aProgram, const char* aProfile, int32_t argc, char** argv, + const char* aDesktopStartupID, char** aResponse, bool* aWindowFound) { NS_ENSURE_TRUE(aProgram, NS_ERROR_INVALID_ARG); MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsXRemoteClient::SendCommandLine")); @@ -197,7 +197,7 @@ Window nsXRemoteClient::CheckWindow(Window aWindow) { Atom type = None; int format; unsigned long nitems, bytesafter; - unsigned char *data; + unsigned char* data; Window innerWindow; XGetWindowProperty(mDisplay, aWindow, mMozWMStateAtom, 0, 0, False, @@ -219,13 +219,13 @@ Window nsXRemoteClient::CheckWindow(Window aWindow) { Window nsXRemoteClient::CheckChildren(Window aWindow) { Window root, parent; - Window *children; + Window* children; unsigned int nchildren; unsigned int i; Atom type = None; int format; unsigned long nitems, after; - unsigned char *data; + unsigned char* data; Window retval = None; if (!XQueryTree(mDisplay, aWindow, &root, &parent, &children, &nchildren)) @@ -247,12 +247,12 @@ Window nsXRemoteClient::CheckChildren(Window aWindow) { retval = CheckChildren(children[i]); } - if (children) XFree((char *)children); + if (children) XFree((char*)children); return retval; } -nsresult nsXRemoteClient::GetLock(Window aWindow, bool *aDestroyed) { +nsresult nsXRemoteClient::GetLock(Window aWindow, bool* aDestroyed) { bool locked = false; bool waited = false; *aDestroyed = false; @@ -272,7 +272,7 @@ nsresult nsXRemoteClient::GetLock(Window aWindow, bool *aDestroyed) { // allocate enough space for the string plus the terminating // char - mLockData = (char *)malloc(strlen(pidstr) + strlen(sysinfobuf) + 1); + mLockData = (char*)malloc(strlen(pidstr) + strlen(sysinfobuf) + 1); if (!mLockData) return NS_ERROR_OUT_OF_MEMORY; strcpy(mLockData, pidstr); @@ -284,7 +284,7 @@ nsresult nsXRemoteClient::GetLock(Window aWindow, bool *aDestroyed) { Atom actual_type; int actual_format; unsigned long nitems, bytes_after; - unsigned char *data = 0; + unsigned char* data = 0; XGrabServer(mDisplay); @@ -303,7 +303,7 @@ nsresult nsXRemoteClient::GetLock(Window aWindow, bool *aDestroyed) { } else if (result != Success || actual_type == None) { /* It's not now locked - lock it. */ XChangeProperty(mDisplay, aWindow, mMozLockAtom, XA_STRING, 8, - PropModeReplace, (unsigned char *)mLockData, + PropModeReplace, (unsigned char*)mLockData, strlen(mLockData)); locked = True; } @@ -373,8 +373,8 @@ nsresult nsXRemoteClient::GetLock(Window aWindow, bool *aDestroyed) { return rv; } -Window nsXRemoteClient::FindBestWindow(const char *aProgram, - const char *aProfile) { +Window nsXRemoteClient::FindBestWindow(const char* aProgram, + const char* aProfile) { Window root = RootWindowOfScreen(DefaultScreenOfDisplay(mDisplay)); Window bestWindow = 0; Window root2, parent, *kids; @@ -400,7 +400,7 @@ Window nsXRemoteClient::FindBestWindow(const char *aProgram, Atom type; int format; unsigned long nitems, bytesafter; - unsigned char *data_return = 0; + unsigned char* data_return = 0; Window w; w = kids[i]; // find the inner window with WM_STATE on it @@ -412,7 +412,7 @@ Window nsXRemoteClient::FindBestWindow(const char *aProgram, if (!data_return) continue; - double version = PR_strtod((char *)data_return, nullptr); + double version = PR_strtod((char*)data_return, nullptr); XFree(data_return); if (!(version >= 5.1 && version < 6)) continue; @@ -429,7 +429,7 @@ Window nsXRemoteClient::FindBestWindow(const char *aProgram, // If the return name is not the same as this program name, we don't want // this window. if (data_return) { - if (strcmp(aProgram, (const char *)data_return)) { + if (strcmp(aProgram, (const char*)data_return)) { XFree(data_return); continue; } @@ -444,7 +444,7 @@ Window nsXRemoteClient::FindBestWindow(const char *aProgram, // Check to see if it has the user atom on that window. If there // is then we need to make sure that it matches what we have. - const char *username = PR_GetEnv("LOGNAME"); + const char* username = PR_GetEnv("LOGNAME"); if (username) { Unused << XGetWindowProperty( @@ -454,7 +454,7 @@ Window nsXRemoteClient::FindBestWindow(const char *aProgram, // if there's a username compare it with what we have if (data_return) { // If the IDs aren't equal, we don't want this window. - if (strcmp(username, (const char *)data_return)) { + if (strcmp(username, (const char*)data_return)) { XFree(data_return); continue; } @@ -473,7 +473,7 @@ Window nsXRemoteClient::FindBestWindow(const char *aProgram, // If there's a profile compare it with what we have if (data_return) { // If the profiles aren't equal, we don't want this window. - if (strcmp(aProfile, (const char *)data_return)) { + if (strcmp(aProfile, (const char*)data_return)) { XFree(data_return); continue; } @@ -493,7 +493,7 @@ Window nsXRemoteClient::FindBestWindow(const char *aProgram, break; } - if (kids) XFree((char *)kids); + if (kids) XFree((char*)kids); return bestWindow; } @@ -503,7 +503,7 @@ nsresult nsXRemoteClient::FreeLock(Window aWindow) { Atom actual_type; int actual_format; unsigned long nitems, bytes_after; - unsigned char *data = 0; + unsigned char* data = 0; result = XGetWindowProperty( mDisplay, aWindow, mMozLockAtom, 0, (65536 / sizeof(long)), @@ -519,7 +519,7 @@ nsresult nsXRemoteClient::FreeLock(Window aWindow) { ("invalid data on " MOZILLA_LOCK_PROP " of window 0x%x.\n", (unsigned int)aWindow)); return NS_ERROR_FAILURE; - } else if (strcmp((char *)data, mLockData)) { + } else if (strcmp((char*)data, mLockData)) { MOZ_LOG(sRemoteLm, LogLevel::Debug, (MOZILLA_LOCK_PROP " was stolen! Expected \"%s\", saw \"%s\"!\n", mLockData, data)); @@ -531,17 +531,17 @@ nsresult nsXRemoteClient::FreeLock(Window aWindow) { } nsresult nsXRemoteClient::DoSendCommandLine(Window aWindow, int32_t argc, - char **argv, - const char *aDesktopStartupID, - char **aResponse, - bool *aDestroyed) { + char** argv, + const char* aDesktopStartupID, + char** aResponse, + bool* aDestroyed) { *aDestroyed = false; int commandLineLength; - char *commandLine = + char* commandLine = ConstructCommandLine(argc, argv, aDesktopStartupID, &commandLineLength); XChangeProperty(mDisplay, aWindow, mMozCommandLineAtom, XA_STRING, 8, - PropModeReplace, (unsigned char *)commandLine, + PropModeReplace, (unsigned char*)commandLine, commandLineLength); free(commandLine); @@ -551,8 +551,8 @@ nsresult nsXRemoteClient::DoSendCommandLine(Window aWindow, int32_t argc, return NS_OK; } -bool nsXRemoteClient::WaitForResponse(Window aWindow, char **aResponse, - bool *aDestroyed, Atom aCommandAtom) { +bool nsXRemoteClient::WaitForResponse(Window aWindow, char** aResponse, + bool* aDestroyed, Atom aCommandAtom) { bool done = false; bool accepted = false; @@ -575,7 +575,7 @@ bool nsXRemoteClient::WaitForResponse(Window aWindow, char **aResponse, Atom actual_type; int actual_format; unsigned long nitems, bytes_after; - unsigned char *data = 0; + unsigned char* data = 0; Bool result; result = XGetWindowProperty(mDisplay, aWindow, mMozResponseAtom, 0, (65536 / sizeof(long)), @@ -589,7 +589,7 @@ bool nsXRemoteClient::WaitForResponse(Window aWindow, char **aResponse, (unsigned int)aWindow)); *aResponse = strdup("Internal error reading response from window."); done = true; - } else if (!data || strlen((char *)data) < 5) { + } else if (!data || strlen((char*)data) < 5) { MOZ_LOG(sRemoteLm, LogLevel::Debug, ("invalid data on " MOZILLA_RESPONSE_PROP " property of window 0x%0x.\n", @@ -602,15 +602,15 @@ bool nsXRemoteClient::WaitForResponse(Window aWindow, char **aResponse, done = false; } - else if (!strncmp((char *)data, "200", 3)) { /* positive completion */ - *aResponse = strdup((char *)data); + else if (!strncmp((char*)data, "200", 3)) { /* positive completion */ + *aResponse = strdup((char*)data); accepted = true; done = true; } else if (*data == '2') { /* positive completion */ MOZ_LOG(sRemoteLm, LogLevel::Debug, ("%s\n", data + 4)); - *aResponse = strdup((char *)data); + *aResponse = strdup((char*)data); accepted = true; done = true; } @@ -620,14 +620,14 @@ bool nsXRemoteClient::WaitForResponse(Window aWindow, char **aResponse, ("internal error: " "server wants more information? (%s)\n", data)); - *aResponse = strdup((char *)data); + *aResponse = strdup((char*)data); done = true; } else if (*data == '4' || /* transient negative completion */ *data == '5') { /* permanent negative completion */ MOZ_LOG(sRemoteLm, LogLevel::Debug, ("%s\n", data + 4)); - *aResponse = strdup((char *)data); + *aResponse = strdup((char*)data); done = true; } @@ -636,7 +636,7 @@ bool nsXRemoteClient::WaitForResponse(Window aWindow, char **aResponse, sRemoteLm, LogLevel::Debug, ("unrecognised " MOZILLA_RESPONSE_PROP " from window 0x%x: %s\n", (unsigned int)aWindow, data)); - *aResponse = strdup((char *)data); + *aResponse = strdup((char*)data); done = true; } diff --git a/toolkit/components/remote/nsXRemoteClient.h b/toolkit/components/remote/nsXRemoteClient.h index 8d5ab7690873e..9bc7a82c5c508 100644 --- a/toolkit/components/remote/nsXRemoteClient.h +++ b/toolkit/components/remote/nsXRemoteClient.h @@ -14,25 +14,25 @@ class nsXRemoteClient : public nsRemoteClient { ~nsXRemoteClient(); virtual nsresult Init() override; - virtual nsresult SendCommandLine(const char *aProgram, const char *aProfile, - int32_t argc, char **argv, - const char *aDesktopStartupID, - char **aResponse, bool *aSucceeded) override; + virtual nsresult SendCommandLine(const char* aProgram, const char* aProfile, + int32_t argc, char** argv, + const char* aDesktopStartupID, + char** aResponse, bool* aSucceeded) override; void Shutdown(); private: Window CheckWindow(Window aWindow); Window CheckChildren(Window aWindow); - nsresult GetLock(Window aWindow, bool *aDestroyed); + nsresult GetLock(Window aWindow, bool* aDestroyed); nsresult FreeLock(Window aWindow); - Window FindBestWindow(const char *aProgram, const char *aProfile); - nsresult DoSendCommandLine(Window aWindow, int32_t argc, char **argv, - const char *aDesktopStartupID, char **aResponse, - bool *aDestroyed); - bool WaitForResponse(Window aWindow, char **aResponse, bool *aDestroyed, + Window FindBestWindow(const char* aProgram, const char* aProfile); + nsresult DoSendCommandLine(Window aWindow, int32_t argc, char** argv, + const char* aDesktopStartupID, char** aResponse, + bool* aDestroyed); + bool WaitForResponse(Window aWindow, char** aResponse, bool* aDestroyed, Atom aCommandAtom); - Display *mDisplay; + Display* mDisplay; Atom mMozVersionAtom; Atom mMozLockAtom; @@ -43,7 +43,7 @@ class nsXRemoteClient : public nsRemoteClient { Atom mMozProfileAtom; Atom mMozProgramAtom; - char *mLockData; + char* mLockData; bool mInitialized; }; diff --git a/toolkit/components/remote/nsXRemoteServer.cpp b/toolkit/components/remote/nsXRemoteServer.cpp index 8753dcf43b4c0..fa7e9f406d614 100644 --- a/toolkit/components/remote/nsXRemoteServer.cpp +++ b/toolkit/components/remote/nsXRemoteServer.cpp @@ -47,7 +47,7 @@ using namespace mozilla; const unsigned char kRemoteVersion[] = "5.1"; // Minimize the roundtrips to the X server by getting all the atoms at once -static const char *XAtomNames[] = { +static const char* XAtomNames[] = { MOZILLA_VERSION_PROP, MOZILLA_LOCK_PROP, MOZILLA_RESPONSE_PROP, MOZILLA_USER_PROP, MOZILLA_PROFILE_PROP, MOZILLA_PROGRAM_PROP, MOZILLA_COMMANDLINE_PROP}; @@ -63,8 +63,8 @@ Atom nsXRemoteServer::sMozCommandLineAtom; nsXRemoteServer::nsXRemoteServer() = default; -void nsXRemoteServer::XRemoteBaseStartup(const char *aAppName, - const char *aProfileName) { +void nsXRemoteServer::XRemoteBaseStartup(const char* aAppName, + const char* aProfileName) { EnsureAtoms(); mAppName = aAppName; @@ -80,25 +80,25 @@ void nsXRemoteServer::HandleCommandsFor(Window aWindowId) { sizeof(kRemoteVersion) - 1); // get our username - unsigned char *logname; - logname = (unsigned char *)PR_GetEnv("LOGNAME"); + unsigned char* logname; + logname = (unsigned char*)PR_GetEnv("LOGNAME"); if (logname) { // set the property on the window if it's available XChangeProperty(mozilla::DefaultXDisplay(), aWindowId, sMozUserAtom, XA_STRING, 8, PropModeReplace, logname, - strlen((char *)logname)); + strlen((char*)logname)); } XChangeProperty(mozilla::DefaultXDisplay(), aWindowId, sMozProgramAtom, - XA_STRING, 8, PropModeReplace, - (unsigned char *)mAppName.get(), mAppName.Length()); + XA_STRING, 8, PropModeReplace, (unsigned char*)mAppName.get(), + mAppName.Length()); XChangeProperty(mozilla::DefaultXDisplay(), aWindowId, sMozProfileAtom, XA_STRING, 8, PropModeReplace, - (unsigned char *)mProfileName.get(), mProfileName.Length()); + (unsigned char*)mProfileName.get(), mProfileName.Length()); } -bool nsXRemoteServer::HandleNewProperty(XID aWindowId, Display *aDisplay, +bool nsXRemoteServer::HandleNewProperty(XID aWindowId, Display* aDisplay, Time aEventTime, Atom aChangedAtom) { if (aChangedAtom == sMozCommandLineAtom) { // We got a new command atom. @@ -106,34 +106,34 @@ bool nsXRemoteServer::HandleNewProperty(XID aWindowId, Display *aDisplay, Atom actual_type; int actual_format; unsigned long nitems, bytes_after; - char *data = 0; - - result = XGetWindowProperty( - aDisplay, aWindowId, aChangedAtom, 0, /* long_offset */ - (65536 / sizeof(long)), /* long_length */ - X11True, /* atomic delete after */ - XA_STRING, /* req_type */ - &actual_type, /* actual_type return */ - &actual_format, /* actual_format_return */ - &nitems, /* nitems_return */ - &bytes_after, /* bytes_after_return */ - (unsigned char **)&data); /* prop_return - (we only care - about the first ) */ + char* data = 0; + + result = XGetWindowProperty(aDisplay, aWindowId, aChangedAtom, + 0, /* long_offset */ + (65536 / sizeof(long)), /* long_length */ + X11True, /* atomic delete after */ + XA_STRING, /* req_type */ + &actual_type, /* actual_type return */ + &actual_format, /* actual_format_return */ + &nitems, /* nitems_return */ + &bytes_after, /* bytes_after_return */ + (unsigned char**)&data); /* prop_return + (we only care + about the first ) */ // Failed to get property off the window? if (result != Success) return false; // Failed to get the data off the window or it was the wrong type? - if (!data || !TO_LITTLE_ENDIAN32(*reinterpret_cast(data))) + if (!data || !TO_LITTLE_ENDIAN32(*reinterpret_cast(data))) return false; // cool, we got the property data. - const char *response = HandleCommandLine(data, aEventTime); + const char* response = HandleCommandLine(data, aEventTime); // put the property onto the window as the response XChangeProperty(aDisplay, aWindowId, sMozResponseAtom, XA_STRING, 8, - PropModeReplace, (const unsigned char *)response, + PropModeReplace, (const unsigned char*)response, strlen(response)); XFree(data); return true; @@ -155,7 +155,7 @@ bool nsXRemoteServer::HandleNewProperty(XID aWindowId, Display *aDisplay, void nsXRemoteServer::EnsureAtoms(void) { if (sMozVersionAtom) return; - XInternAtoms(mozilla::DefaultXDisplay(), const_cast(XAtomNames), + XInternAtoms(mozilla::DefaultXDisplay(), const_cast(XAtomNames), ArrayLength(XAtomNames), X11False, XAtoms); int i = 0; diff --git a/toolkit/components/startup/StartupTimeline.cpp b/toolkit/components/startup/StartupTimeline.cpp index eb836b09ea6e3..cc1c7d32c8267 100644 --- a/toolkit/components/startup/StartupTimeline.cpp +++ b/toolkit/components/startup/StartupTimeline.cpp @@ -10,8 +10,8 @@ namespace mozilla { TimeStamp StartupTimeline::sStartupTimeline[StartupTimeline::MAX_EVENT_ID]; -const char - *StartupTimeline::sStartupTimelineDesc[StartupTimeline::MAX_EVENT_ID] = { +const char* + StartupTimeline::sStartupTimelineDesc[StartupTimeline::MAX_EVENT_ID] = { #define mozilla_StartupTimeline_Event(ev, desc) desc, #include "StartupTimeline.h" #undef mozilla_StartupTimeline_Event diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index aa82d28dacc94..8f76515859dd5 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -120,7 +120,7 @@ class nsAppExitEvent : public mozilla::Runnable { RefPtr mService; public: - explicit nsAppExitEvent(nsAppStartup *service) + explicit nsAppExitEvent(nsAppStartup* service) : mozilla::Runnable("nsAppExitEvent"), mService(service) {} NS_IMETHOD Run() override { @@ -509,13 +509,13 @@ nsAppStartup::ExitLastWindowClosingSurvivalArea(void) { // NS_IMETHODIMP -nsAppStartup::GetShuttingDown(bool *aResult) { +nsAppStartup::GetShuttingDown(bool* aResult) { *aResult = mShuttingDown; return NS_OK; } NS_IMETHODIMP -nsAppStartup::GetStartingUp(bool *aResult) { +nsAppStartup::GetStartingUp(bool* aResult) { *aResult = mStartingUp; return NS_OK; } @@ -530,14 +530,14 @@ nsAppStartup::DoneStartingUp() { } NS_IMETHODIMP -nsAppStartup::GetRestarting(bool *aResult) { +nsAppStartup::GetRestarting(bool* aResult) { *aResult = mRestart; return NS_OK; } NS_IMETHODIMP -nsAppStartup::GetWasRestarted(bool *aResult) { - char *mozAppRestart = PR_GetEnv("MOZ_APP_RESTART"); +nsAppStartup::GetWasRestarted(bool* aResult) { + char* mozAppRestart = PR_GetEnv("MOZ_APP_RESTART"); /* When calling PR_SetEnv() with an empty value the existing variable may * be unset or set to the empty string depending on the underlying platform @@ -573,7 +573,7 @@ nsAppStartup::SetInterrupted(bool aInterrupted) { } NS_IMETHODIMP -nsAppStartup::GetInterrupted(bool *aInterrupted) { +nsAppStartup::GetInterrupted(bool* aInterrupted) { *aInterrupted = mInterrupted; return NS_OK; } @@ -583,9 +583,9 @@ nsAppStartup::GetInterrupted(bool *aInterrupted) { // NS_IMETHODIMP -nsAppStartup::CreateChromeWindow(nsIWebBrowserChrome *aParent, +nsAppStartup::CreateChromeWindow(nsIWebBrowserChrome* aParent, uint32_t aChromeFlags, - nsIWebBrowserChrome **_retval) { + nsIWebBrowserChrome** _retval) { bool cancel; return CreateChromeWindow2(aParent, aChromeFlags, nullptr, nullptr, 0, &cancel, _retval); @@ -607,12 +607,12 @@ nsAppStartup::SetScreenId(uint32_t aScreenId) { } NS_IMETHODIMP -nsAppStartup::CreateChromeWindow2(nsIWebBrowserChrome *aParent, +nsAppStartup::CreateChromeWindow2(nsIWebBrowserChrome* aParent, uint32_t aChromeFlags, - nsIRemoteTab *aOpeningTab, - mozIDOMWindowProxy *aOpener, - uint64_t aNextRemoteTabId, bool *aCancel, - nsIWebBrowserChrome **_retval) { + nsIRemoteTab* aOpeningTab, + mozIDOMWindowProxy* aOpener, + uint64_t aNextRemoteTabId, bool* aCancel, + nsIWebBrowserChrome** _retval) { NS_ENSURE_ARG_POINTER(aCancel); NS_ENSURE_ARG_POINTER(_retval); *aCancel = false; @@ -678,8 +678,8 @@ nsAppStartup::CreateChromeWindow2(nsIWebBrowserChrome *aParent, // NS_IMETHODIMP -nsAppStartup::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsAppStartup::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { NS_ASSERTION(mAppShell, "appshell service notified before appshell built"); if (!strcmp(aTopic, "quit-application-forced")) { mShuttingDown = true; @@ -726,9 +726,9 @@ nsAppStartup::Observe(nsISupports *aSubject, const char *aTopic, } NS_IMETHODIMP -nsAppStartup::GetStartupInfo(JSContext *aCx, +nsAppStartup::GetStartupInfo(JSContext* aCx, JS::MutableHandle aRetval) { - JS::Rooted obj(aCx, JS_NewPlainObject(aCx)); + JS::Rooted obj(aCx, JS_NewPlainObject(aCx)); aRetval.setObject(*obj); @@ -763,7 +763,7 @@ nsAppStartup::GetStartupInfo(JSContext *aCx, if (!stamp.IsNull()) { if (stamp >= procTime) { PRTime prStamp = ComputeAbsoluteTimestamp(stamp) / PR_USEC_PER_MSEC; - JS::Rooted date( + JS::Rooted date( aCx, JS::NewDateObject(aCx, JS::TimeClip(prStamp))); JS_DefineProperty(aCx, obj, StartupTimeline::Describe(ev), date, JSPROP_ENUMERATE); @@ -777,7 +777,7 @@ nsAppStartup::GetStartupInfo(JSContext *aCx, } NS_IMETHODIMP -nsAppStartup::GetAutomaticSafeModeNecessary(bool *_retval) { +nsAppStartup::GetAutomaticSafeModeNecessary(bool* _retval) { NS_ENSURE_ARG_POINTER(_retval); bool alwaysSafe = false; @@ -796,7 +796,7 @@ nsAppStartup::GetAutomaticSafeModeNecessary(bool *_retval) { } NS_IMETHODIMP -nsAppStartup::TrackStartupCrashBegin(bool *aIsSafeModeNecessary) { +nsAppStartup::TrackStartupCrashBegin(bool* aIsSafeModeNecessary) { const int32_t MAX_TIME_SINCE_STARTUP = 6 * 60 * 60 * 1000; const int32_t MAX_STARTUP_BUFFER = 10; nsresult rv; @@ -842,7 +842,7 @@ nsAppStartup::TrackStartupCrashBegin(bool *aIsSafeModeNecessary) { // XRE_PROFILE_PATH is set. After profile manager, the profile lock's mod. // time has been changed so can't be used on this startup. After a restart, // it's safe to assume the last startup was successful. - char *xreProfilePath = PR_GetEnv("XRE_PROFILE_PATH"); + char* xreProfilePath = PR_GetEnv("XRE_PROFILE_PATH"); if (xreProfilePath) { GetAutomaticSafeModeNecessary(aIsSafeModeNecessary); return NS_ERROR_NOT_AVAILABLE; @@ -895,7 +895,7 @@ nsAppStartup::TrackStartupCrashBegin(bool *aIsSafeModeNecessary) { (recentCrashes > maxResumedCrashes && maxResumedCrashes != -1); nsCOMPtr prefs = Preferences::GetService(); - rv = static_cast(prefs.get()) + rv = static_cast(prefs.get()) ->SavePrefFileBlocking(); // flush prefs to disk since we are // tracking crashes NS_ENSURE_SUCCESS(rv, rv); @@ -985,7 +985,7 @@ nsAppStartup::RestartInSafeMode(uint32_t aQuitMode) { } NS_IMETHODIMP -nsAppStartup::CreateInstanceWithProfile(nsIToolkitProfile *aProfile) { +nsAppStartup::CreateInstanceWithProfile(nsIToolkitProfile* aProfile) { if (NS_WARN_IF(!aProfile)) { return NS_ERROR_FAILURE; } @@ -1017,7 +1017,7 @@ nsAppStartup::CreateInstanceWithProfile(nsIToolkitProfile *aProfile) { return rv; } - const char *args[] = {"-no-remote", "-P", profileName.get()}; + const char* args[] = {"-no-remote", "-P", profileName.get()}; rv = process->Run(false, args, 3); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; diff --git a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp index 456dd90aea630..2586b4dc27974 100644 --- a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp +++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp @@ -55,7 +55,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsBrowserStatusFilter) //----------------------------------------------------------------------------- NS_IMETHODIMP -nsBrowserStatusFilter::AddProgressListener(nsIWebProgressListener *aListener, +nsBrowserStatusFilter::AddProgressListener(nsIWebProgressListener* aListener, uint32_t aNotifyMask) { mListener = aListener; return NS_OK; @@ -63,60 +63,60 @@ nsBrowserStatusFilter::AddProgressListener(nsIWebProgressListener *aListener, NS_IMETHODIMP nsBrowserStatusFilter::RemoveProgressListener( - nsIWebProgressListener *aListener) { + nsIWebProgressListener* aListener) { if (aListener == mListener) mListener = nullptr; return NS_OK; } NS_IMETHODIMP -nsBrowserStatusFilter::GetDOMWindow(mozIDOMWindowProxy **aResult) { +nsBrowserStatusFilter::GetDOMWindow(mozIDOMWindowProxy** aResult) { MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetDOMWindow"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsBrowserStatusFilter::GetDOMWindowID(uint64_t *aResult) { +nsBrowserStatusFilter::GetDOMWindowID(uint64_t* aResult) { *aResult = 0; MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetDOMWindowID"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsBrowserStatusFilter::GetInnerDOMWindowID(uint64_t *aResult) { +nsBrowserStatusFilter::GetInnerDOMWindowID(uint64_t* aResult) { *aResult = 0; MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetInnerDOMWindowID"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsBrowserStatusFilter::GetIsTopLevel(bool *aIsTopLevel) { +nsBrowserStatusFilter::GetIsTopLevel(bool* aIsTopLevel) { *aIsTopLevel = false; MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetIsTopLevel"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsBrowserStatusFilter::GetIsLoadingDocument(bool *aIsLoadingDocument) { +nsBrowserStatusFilter::GetIsLoadingDocument(bool* aIsLoadingDocument) { MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetIsLoadingDocument"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsBrowserStatusFilter::GetLoadType(uint32_t *aLoadType) { +nsBrowserStatusFilter::GetLoadType(uint32_t* aLoadType) { *aLoadType = 0; MOZ_ASSERT_UNREACHABLE("nsBrowserStatusFilter::GetLoadType"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsBrowserStatusFilter::GetTarget(nsIEventTarget **aTarget) { +nsBrowserStatusFilter::GetTarget(nsIEventTarget** aTarget) { nsCOMPtr target = mTarget; target.forget(aTarget); return NS_OK; } NS_IMETHODIMP -nsBrowserStatusFilter::SetTarget(nsIEventTarget *aTarget) { +nsBrowserStatusFilter::SetTarget(nsIEventTarget* aTarget) { mTarget = aTarget; return NS_OK; } @@ -126,8 +126,8 @@ nsBrowserStatusFilter::SetTarget(nsIEventTarget *aTarget) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsBrowserStatusFilter::OnStateChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, uint32_t aStateFlags, +nsBrowserStatusFilter::OnStateChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aStateFlags, nsresult aStatus) { if (!mListener) return NS_OK; @@ -172,8 +172,8 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsBrowserStatusFilter::OnProgressChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsBrowserStatusFilter::OnProgressChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, int32_t aCurSelfProgress, int32_t aMaxSelfProgress, int32_t aCurTotalProgress, @@ -200,8 +200,8 @@ nsBrowserStatusFilter::OnProgressChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsBrowserStatusFilter::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, nsIURI *aLocation, +nsBrowserStatusFilter::OnLocationChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, nsIURI* aLocation, uint32_t aFlags) { if (!mListener) return NS_OK; @@ -209,9 +209,9 @@ nsBrowserStatusFilter::OnLocationChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsBrowserStatusFilter::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, nsresult aStatus, - const char16_t *aMessage) { +nsBrowserStatusFilter::OnStatusChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, nsresult aStatus, + const char16_t* aMessage) { if (!mListener) return NS_OK; // @@ -235,16 +235,16 @@ nsBrowserStatusFilter::OnStatusChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsBrowserStatusFilter::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, uint32_t aState) { +nsBrowserStatusFilter::OnSecurityChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aState) { if (!mListener) return NS_OK; return mListener->OnSecurityChange(aWebProgress, aRequest, aState); } NS_IMETHODIMP -nsBrowserStatusFilter::OnContentBlockingEvent(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsBrowserStatusFilter::OnContentBlockingEvent(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aEvent) { if (!mListener) return NS_OK; @@ -255,8 +255,8 @@ nsBrowserStatusFilter::OnContentBlockingEvent(nsIWebProgress *aWebProgress, // nsBrowserStatusFilter::nsIWebProgressListener2 //----------------------------------------------------------------------------- NS_IMETHODIMP -nsBrowserStatusFilter::OnProgressChange64(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsBrowserStatusFilter::OnProgressChange64(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, int64_t aCurSelfProgress, int64_t aMaxSelfProgress, int64_t aCurTotalProgress, @@ -268,9 +268,9 @@ nsBrowserStatusFilter::OnProgressChange64(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsBrowserStatusFilter::OnRefreshAttempted(nsIWebProgress *aWebProgress, - nsIURI *aUri, int32_t aDelay, - bool aSameUri, bool *allowRefresh) { +nsBrowserStatusFilter::OnRefreshAttempted(nsIWebProgress* aWebProgress, + nsIURI* aUri, int32_t aDelay, + bool aSameUri, bool* allowRefresh) { nsCOMPtr listener = do_QueryInterface(mListener); if (!listener) { *allowRefresh = true; @@ -342,9 +342,9 @@ void nsBrowserStatusFilter::ProcessTimeout() { } } -void nsBrowserStatusFilter::TimeoutHandler(nsITimer *aTimer, void *aClosure) { - nsBrowserStatusFilter *self = - reinterpret_cast(aClosure); +void nsBrowserStatusFilter::TimeoutHandler(nsITimer* aTimer, void* aClosure) { + nsBrowserStatusFilter* self = + reinterpret_cast(aClosure); if (!self) { NS_ERROR("no self"); return; diff --git a/toolkit/components/statusfilter/nsBrowserStatusFilter.h b/toolkit/components/statusfilter/nsBrowserStatusFilter.h index cdf9d2eaa7456..b7da66d663277 100644 --- a/toolkit/components/statusfilter/nsBrowserStatusFilter.h +++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.h @@ -44,7 +44,7 @@ class nsBrowserStatusFilter : public nsIWebProgress, void ResetMembers(); bool DelayInEffect() { return mDelayedStatus || mDelayedProgress; } - static void TimeoutHandler(nsITimer *aTimer, void *aClosure); + static void TimeoutHandler(nsITimer* aTimer, void* aClosure); private: nsCOMPtr mListener; diff --git a/toolkit/components/telemetry/core/ScalarInfo.h b/toolkit/components/telemetry/core/ScalarInfo.h index 3ff37fc2ea50d..ceae07110b496 100644 --- a/toolkit/components/telemetry/core/ScalarInfo.h +++ b/toolkit/components/telemetry/core/ScalarInfo.h @@ -39,8 +39,8 @@ struct BaseScalarInfo { builtin(aBuiltin) {} virtual ~BaseScalarInfo() {} - virtual const char *name() const = 0; - virtual const char *expiration() const = 0; + virtual const char* name() const = 0; + virtual const char* expiration() const = 0; virtual uint32_t storeOffset() const = 0; @@ -76,8 +76,8 @@ struct ScalarInfo : BaseScalarInfo { store_count(aStoreCount), store_offset(aStoreOffset) {} - const char *name() const override; - const char *expiration() const override; + const char* name() const override; + const char* expiration() const override; uint32_t storeOffset() const override { return store_offset; }; diff --git a/toolkit/components/telemetry/other/ProcessedStack.cpp b/toolkit/components/telemetry/other/ProcessedStack.cpp index 64f832a93374b..148437b75a14b 100644 --- a/toolkit/components/telemetry/other/ProcessedStack.cpp +++ b/toolkit/components/telemetry/other/ProcessedStack.cpp @@ -15,11 +15,11 @@ struct StackFrame { }; #ifdef MOZ_GECKO_PROFILER -static bool CompareByPC(const StackFrame &a, const StackFrame &b) { +static bool CompareByPC(const StackFrame& a, const StackFrame& b) { return a.mPC < b.mPC; } -static bool CompareByIndex(const StackFrame &a, const StackFrame &b) { +static bool CompareByIndex(const StackFrame& a, const StackFrame& b) { return a.mIndex < b.mIndex; } #endif @@ -37,23 +37,23 @@ size_t ProcessedStack::GetStackSize() const { return mStack.size(); } size_t ProcessedStack::GetNumModules() const { return mModules.size(); } -bool ProcessedStack::Module::operator==(const Module &aOther) const { +bool ProcessedStack::Module::operator==(const Module& aOther) const { return mName == aOther.mName && mBreakpadId == aOther.mBreakpadId; } -const ProcessedStack::Frame &ProcessedStack::GetFrame(unsigned aIndex) const { +const ProcessedStack::Frame& ProcessedStack::GetFrame(unsigned aIndex) const { MOZ_ASSERT(aIndex < mStack.size()); return mStack[aIndex]; } -void ProcessedStack::AddFrame(const Frame &aFrame) { mStack.push_back(aFrame); } +void ProcessedStack::AddFrame(const Frame& aFrame) { mStack.push_back(aFrame); } -const ProcessedStack::Module &ProcessedStack::GetModule(unsigned aIndex) const { +const ProcessedStack::Module& ProcessedStack::GetModule(unsigned aIndex) const { MOZ_ASSERT(aIndex < mModules.size()); return mModules[aIndex]; } -void ProcessedStack::AddModule(const Module &aModule) { +void ProcessedStack::AddModule(const Module& aModule) { mModules.push_back(aModule); } @@ -62,7 +62,7 @@ void ProcessedStack::Clear() { mStack.clear(); } -ProcessedStack GetStackAndModules(const std::vector &aPCs) { +ProcessedStack GetStackAndModules(const std::vector& aPCs) { return BatchProcessedStackGenerator().GetStackAndModules(aPCs); } @@ -77,7 +77,7 @@ BatchProcessedStackGenerator::BatchProcessedStackGenerator() } ProcessedStack BatchProcessedStackGenerator::GetStackAndModules( - const std::vector &aPCs) { + const std::vector& aPCs) { std::vector rawStack; auto stackEnd = aPCs.begin() + std::min(aPCs.size(), kMaxChromeStackDepth); for (auto i = aPCs.begin(); i != stackEnd; ++i) { @@ -97,7 +97,7 @@ ProcessedStack BatchProcessedStackGenerator::GetStackAndModules( size_t stackSize = rawStack.size(); while (moduleIndex < rawModules.GetSize()) { - const SharedLibrary &module = rawModules.GetEntry(moduleIndex); + const SharedLibrary& module = rawModules.GetEntry(moduleIndex); uintptr_t moduleStart = module.GetStart(); uintptr_t moduleEnd = module.GetEnd() - 1; // the interval is [moduleStart, moduleEnd) @@ -139,7 +139,7 @@ ProcessedStack BatchProcessedStackGenerator::GetStackAndModules( // Copy the information to the return value. ProcessedStack Ret; - for (auto &rawFrame : rawStack) { + for (auto& rawFrame : rawStack) { mozilla::Telemetry::ProcessedStack::Frame frame = {rawFrame.mPC, rawFrame.mModIndex}; Ret.AddFrame(frame); @@ -147,7 +147,7 @@ ProcessedStack BatchProcessedStackGenerator::GetStackAndModules( #ifdef MOZ_GECKO_PROFILER for (unsigned i = 0, n = rawModules.GetSize(); i != n; ++i) { - const SharedLibrary &info = rawModules.GetEntry(i); + const SharedLibrary& info = rawModules.GetEntry(i); mozilla::Telemetry::ProcessedStack::Module module = {info.GetDebugName(), info.GetBreakpadId()}; Ret.AddModule(module); diff --git a/toolkit/components/telemetry/other/ProcessedStack.h b/toolkit/components/telemetry/other/ProcessedStack.h index b93746f880332..3d340ee4f47a1 100644 --- a/toolkit/components/telemetry/other/ProcessedStack.h +++ b/toolkit/components/telemetry/other/ProcessedStack.h @@ -38,13 +38,13 @@ class ProcessedStack { nsString mName; nsCString mBreakpadId; - bool operator==(const Module &other) const; + bool operator==(const Module& other) const; }; - const Frame &GetFrame(unsigned aIndex) const; - void AddFrame(const Frame &aFrame); - const Module &GetModule(unsigned aIndex) const; - void AddModule(const Module &aFrame); + const Frame& GetFrame(unsigned aIndex) const; + void AddFrame(const Frame& aFrame); + const Module& GetModule(unsigned aIndex) const; + void AddModule(const Module& aFrame); void Clear(); @@ -56,13 +56,13 @@ class ProcessedStack { // Get the current list of loaded modules, filter and pair it to the provided // stack. We let the caller collect the stack since different callers have // different needs (current thread X main thread, stopping the thread, etc). -ProcessedStack GetStackAndModules(const std::vector &aPCs); +ProcessedStack GetStackAndModules(const std::vector& aPCs); // This class optimizes repeated calls to GetStackAndModules. class BatchProcessedStackGenerator { public: BatchProcessedStackGenerator(); - ProcessedStack GetStackAndModules(const std::vector &aPCs); + ProcessedStack GetStackAndModules(const std::vector& aPCs); private: #if defined(MOZ_GECKO_PROFILER) diff --git a/toolkit/components/telemetry/other/WebrtcTelemetry.cpp b/toolkit/components/telemetry/other/WebrtcTelemetry.cpp index f135e76f429bb..a9fff1f3be105 100644 --- a/toolkit/components/telemetry/other/WebrtcTelemetry.cpp +++ b/toolkit/components/telemetry/other/WebrtcTelemetry.cpp @@ -12,7 +12,7 @@ #include "nsTHashtable.h" void WebrtcTelemetry::RecordIceCandidateMask(const uint32_t iceCandidateBitmask, const bool success) { - WebrtcIceCandidateType *entry = + WebrtcIceCandidateType* entry = mWebrtcIceCandidates.GetEntry(iceCandidateBitmask); if (!entry) { entry = mWebrtcIceCandidates.PutEntry(iceCandidateBitmask); @@ -26,14 +26,14 @@ void WebrtcTelemetry::RecordIceCandidateMask(const uint32_t iceCandidateBitmask, } } -bool ReflectIceEntry(const WebrtcTelemetry::WebrtcIceCandidateType *entry, - const WebrtcTelemetry::WebrtcIceCandidateStats *stat, - JSContext *cx, JS::Handle obj) { +bool ReflectIceEntry(const WebrtcTelemetry::WebrtcIceCandidateType* entry, + const WebrtcTelemetry::WebrtcIceCandidateStats* stat, + JSContext* cx, JS::Handle obj) { if ((stat->successCount == 0) && (stat->failureCount == 0)) return true; - const uint32_t &bitmask = entry->GetKey(); + const uint32_t& bitmask = entry->GetKey(); - JS::Rooted statsObj(cx, JS_NewPlainObject(cx)); + JS::Rooted statsObj(cx, JS_NewPlainObject(cx)); if (!statsObj) return false; if (!JS_DefineProperty(cx, obj, nsPrintfCString("%" PRIu32, bitmask).BeginReading(), @@ -53,13 +53,13 @@ bool ReflectIceEntry(const WebrtcTelemetry::WebrtcIceCandidateType *entry, return true; } -bool ReflectIceWebrtc(WebrtcTelemetry::WebrtcIceCandidateType *entry, - JSContext *cx, JS::Handle obj) { +bool ReflectIceWebrtc(WebrtcTelemetry::WebrtcIceCandidateType* entry, + JSContext* cx, JS::Handle obj) { return ReflectIceEntry(entry, &entry->mData.webrtc, cx, obj); } -bool WebrtcTelemetry::AddIceInfo(JSContext *cx, JS::Handle iceObj) { - JS::Rooted statsObj(cx, JS_NewPlainObject(cx)); +bool WebrtcTelemetry::AddIceInfo(JSContext* cx, JS::Handle iceObj) { + JS::Rooted statsObj(cx, JS_NewPlainObject(cx)); if (!statsObj) return false; if (!mWebrtcIceCandidates.ReflectIntoJS(ReflectIceWebrtc, cx, statsObj)) { @@ -69,13 +69,13 @@ bool WebrtcTelemetry::AddIceInfo(JSContext *cx, JS::Handle iceObj) { return JS_DefineProperty(cx, iceObj, "webrtc", statsObj, JSPROP_ENUMERATE); } -bool WebrtcTelemetry::GetWebrtcStats(JSContext *cx, +bool WebrtcTelemetry::GetWebrtcStats(JSContext* cx, JS::MutableHandle ret) { - JS::Rooted root_obj(cx, JS_NewPlainObject(cx)); + JS::Rooted root_obj(cx, JS_NewPlainObject(cx)); if (!root_obj) return false; ret.setObject(*root_obj); - JS::Rooted ice_obj(cx, JS_NewPlainObject(cx)); + JS::Rooted ice_obj(cx, JS_NewPlainObject(cx)); if (!ice_obj) return false; JS_DefineProperty(cx, root_obj, "IceCandidatesStats", ice_obj, JSPROP_ENUMERATE); diff --git a/toolkit/components/telemetry/other/WebrtcTelemetry.h b/toolkit/components/telemetry/other/WebrtcTelemetry.h index 3e12651a6509e..f6db46b61ccce 100644 --- a/toolkit/components/telemetry/other/WebrtcTelemetry.h +++ b/toolkit/components/telemetry/other/WebrtcTelemetry.h @@ -26,12 +26,12 @@ class WebrtcTelemetry { void RecordIceCandidateMask(const uint32_t iceCandidateBitmask, bool success); - bool GetWebrtcStats(JSContext *cx, JS::MutableHandle ret); + bool GetWebrtcStats(JSContext* cx, JS::MutableHandle ret); size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; private: - bool AddIceInfo(JSContext *cx, JS::Handle rootObj); + bool AddIceInfo(JSContext* cx, JS::Handle rootObj); mozilla::Telemetry::Common::AutoHashtable mWebrtcIceCandidates; diff --git a/toolkit/components/typeaheadfind/nsTypeAheadFind.h b/toolkit/components/typeaheadfind/nsTypeAheadFind.h index c2deff98b866d..4224bc9eeb62b 100644 --- a/toolkit/components/typeaheadfind/nsTypeAheadFind.h +++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.h @@ -50,31 +50,31 @@ class nsTypeAheadFind : public nsITypeAheadFind, void SaveFind(); void PlayNotFoundSound(); - nsresult GetWebBrowserFind(nsIDocShell *aDocShell, - nsIWebBrowserFind **aWebBrowserFind); + nsresult GetWebBrowserFind(nsIDocShell* aDocShell, + nsIWebBrowserFind** aWebBrowserFind); - void RangeStartsInsideLink(nsRange *aRange, bool *aIsInsideLink, - bool *aIsStartingLink); + void RangeStartsInsideLink(nsRange* aRange, bool* aIsInsideLink, + bool* aIsStartingLink); - void GetSelection(mozilla::PresShell *aPresShell, - nsISelectionController **aSelCon, - mozilla::dom::Selection **aDomSel); + void GetSelection(mozilla::PresShell* aPresShell, + nsISelectionController** aSelCon, + mozilla::dom::Selection** aDomSel); // *aNewRange may not be collapsed. If you want to collapse it in a // particular way, you need to do it yourself. - bool IsRangeVisible(mozilla::PresShell *aPresShell, - nsPresContext *aPresContext, nsRange *aRange, + bool IsRangeVisible(mozilla::PresShell* aPresShell, + nsPresContext* aPresContext, nsRange* aRange, bool aMustBeVisible, bool aGetTopVisibleLeaf, - nsRange **aNewRange, bool *aUsesIndependentSelection); - bool IsRangeRendered(mozilla::PresShell *aPresShell, - nsPresContext *aPresContext, nsRange *aRange); + nsRange** aNewRange, bool* aUsesIndependentSelection); + bool IsRangeRendered(mozilla::PresShell* aPresShell, + nsPresContext* aPresContext, nsRange* aRange); MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult FindItNow(bool aIsLinksOnly, bool aIsFirstVisiblePreferred, - bool aFindPrev, uint16_t *aResult); - nsresult GetSearchContainers(nsISupports *aContainer, - nsISelectionController *aSelectionController, + bool aFindPrev, uint16_t* aResult); + nsresult GetSearchContainers(nsISupports* aContainer, + nsISelectionController* aSelectionController, bool aIsFirstVisiblePreferred, bool aFindPrev, - mozilla::PresShell **aPresShell, - nsPresContext **aPresContext); + mozilla::PresShell** aPresShell, + nsPresContext** aPresContext); // Get the pres shell from mPresShell and return it only if it is still // attached to the DOM window. diff --git a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp index f3488480eae69..02b4aff93eebf 100644 --- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp +++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp @@ -16,7 +16,7 @@ NS_IMPL_ISUPPORTS_INHERITED(nsCheckSummedOutputStream, nsBufferedOutputStream, nsISafeOutputStream) NS_IMETHODIMP -nsCheckSummedOutputStream::Init(nsIOutputStream *stream, uint32_t bufferSize) { +nsCheckSummedOutputStream::Init(nsIOutputStream* stream, uint32_t bufferSize) { nsresult rv; mHash = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); @@ -34,7 +34,7 @@ nsCheckSummedOutputStream::Finish() { uint32_t written; rv = nsBufferedOutputStream::Write( - reinterpret_cast(mCheckSum.BeginReading()), + reinterpret_cast(mCheckSum.BeginReading()), mCheckSum.Length(), &written); NS_ASSERTION(written == mCheckSum.Length(), "Error writing stream checksum"); NS_ENSURE_SUCCESS(rv, rv); @@ -43,9 +43,9 @@ nsCheckSummedOutputStream::Finish() { } NS_IMETHODIMP -nsCheckSummedOutputStream::Write(const char *buf, uint32_t count, - uint32_t *result) { - nsresult rv = mHash->Update(reinterpret_cast(buf), count); +nsCheckSummedOutputStream::Write(const char* buf, uint32_t count, + uint32_t* result) { + nsresult rv = mHash->Update(reinterpret_cast(buf), count); NS_ENSURE_SUCCESS(rv, rv); return nsBufferedOutputStream::Write(buf, count, result); @@ -57,7 +57,7 @@ NS_IMPL_ISUPPORTS_INHERITED(nsCrc32CheckSumedOutputStream, nsBufferedOutputStream, nsISafeOutputStream) NS_IMETHODIMP -nsCrc32CheckSumedOutputStream::Init(nsIOutputStream *stream, +nsCrc32CheckSumedOutputStream::Init(nsIOutputStream* stream, uint32_t bufferSize) { mCheckSum = ~0; @@ -68,7 +68,7 @@ NS_IMETHODIMP nsCrc32CheckSumedOutputStream::Finish() { uint32_t written; nsresult rv = nsBufferedOutputStream::Write( - reinterpret_cast(&mCheckSum), sizeof(mCheckSum), &written); + reinterpret_cast(&mCheckSum), sizeof(mCheckSum), &written); NS_ASSERTION(written == sizeof(mCheckSum), "Error writing stream checksum"); NS_ENSURE_SUCCESS(rv, rv); @@ -76,10 +76,10 @@ nsCrc32CheckSumedOutputStream::Finish() { } NS_IMETHODIMP -nsCrc32CheckSumedOutputStream::Write(const char *buf, uint32_t count, - uint32_t *result) { +nsCrc32CheckSumedOutputStream::Write(const char* buf, uint32_t count, + uint32_t* result) { mCheckSum = - ComputeCrc32c(mCheckSum, reinterpret_cast(buf), count); + ComputeCrc32c(mCheckSum, reinterpret_cast(buf), count); return nsBufferedOutputStream::Write(buf, count, result); } diff --git a/toolkit/components/url-classifier/nsCheckSummedOutputStream.h b/toolkit/components/url-classifier/nsCheckSummedOutputStream.h index 211ae3f095abc..71290207c88cc 100644 --- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.h +++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.h @@ -26,8 +26,8 @@ class nsCheckSummedOutputStream : public nsBufferedOutputStream { nsCheckSummedOutputStream() {} NS_IMETHOD Finish() override; - NS_IMETHOD Write(const char *buf, uint32_t count, uint32_t *result) override; - NS_IMETHOD Init(nsIOutputStream *stream, uint32_t bufferSize) override; + NS_IMETHOD Write(const char* buf, uint32_t count, uint32_t* result) override; + NS_IMETHOD Init(nsIOutputStream* stream, uint32_t bufferSize) override; protected: virtual ~nsCheckSummedOutputStream() { nsBufferedOutputStream::Close(); } @@ -37,8 +37,8 @@ class nsCheckSummedOutputStream : public nsBufferedOutputStream { }; // returns a file output stream which can be QI'ed to nsIFileOutputStream. -inline nsresult NS_NewCheckSummedOutputStream(nsIOutputStream **result, - nsIFile *file) { +inline nsresult NS_NewCheckSummedOutputStream(nsIOutputStream** result, + nsIFile* file) { nsCOMPtr localOutFile; nsresult rv = NS_NewSafeLocalFileOutputStream(getter_AddRefs(localOutFile), file, @@ -62,8 +62,8 @@ class nsCrc32CheckSumedOutputStream : public nsBufferedOutputStream { nsCrc32CheckSumedOutputStream() = default; NS_IMETHOD Finish() override; - NS_IMETHOD Write(const char *buf, uint32_t count, uint32_t *result) override; - NS_IMETHOD Init(nsIOutputStream *stream, uint32_t bufferSize) override; + NS_IMETHOD Write(const char* buf, uint32_t count, uint32_t* result) override; + NS_IMETHOD Init(nsIOutputStream* stream, uint32_t bufferSize) override; protected: virtual ~nsCrc32CheckSumedOutputStream() { nsBufferedOutputStream::Close(); } @@ -72,7 +72,7 @@ class nsCrc32CheckSumedOutputStream : public nsBufferedOutputStream { }; inline nsresult NS_NewCrc32OutputStream( - nsIOutputStream **aResult, already_AddRefed aOutput, + nsIOutputStream** aResult, already_AddRefed aOutput, uint32_t aBufferSize) { nsCOMPtr out = std::move(aOutput); diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index a5c4692ed25b9..173d4ce55e98e 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -37,7 +37,7 @@ using namespace mozilla; static_assert(DEFAULT_TIMEOUT_MS > DEFAULT_RESPONSE_TIMEOUT_MS, "General timeout must be greater than reponse timeout"); -static const char *gQuitApplicationMessage = "quit-application"; +static const char* gQuitApplicationMessage = "quit-application"; static uint32_t sResponseTimeoutMs = DEFAULT_RESPONSE_TIMEOUT_MS; static uint32_t sTimeoutMs = DEFAULT_TIMEOUT_MS; @@ -60,7 +60,7 @@ static mozilla::LazyLogModule gUrlClassifierStreamUpdaterLog( // Calls nsIURLFormatter::TrimSensitiveURLs to remove sensitive // info from the logging message. -static MOZ_FORMAT_PRINTF(1, 2) void TrimAndLog(const char *aFmt, ...) { +static MOZ_FORMAT_PRINTF(1, 2) void TrimAndLog(const char* aFmt, ...) { nsString raw; va_list ap; @@ -119,8 +119,8 @@ void nsUrlClassifierStreamUpdater::DownloadDone() { // nsIUrlClassifierStreamUpdater implementation nsresult nsUrlClassifierStreamUpdater::FetchUpdate( - nsIURI *aUpdateUrl, const nsACString &aRequestPayload, bool aIsPostRequest, - const nsACString &aStreamTable) { + nsIURI* aUpdateUrl, const nsACString& aRequestPayload, bool aIsPostRequest, + const nsACString& aStreamTable) { #ifdef DEBUG LOG(("Fetching update %s from %s", aRequestPayload.Data(), aUpdateUrl->GetSpecOrDefault().get())); @@ -233,8 +233,8 @@ nsresult nsUrlClassifierStreamUpdater::FetchUpdate( } nsresult nsUrlClassifierStreamUpdater::FetchUpdate( - const nsACString &aUpdateUrl, const nsACString &aRequestPayload, - bool aIsPostRequest, const nsACString &aStreamTable) { + const nsACString& aUpdateUrl, const nsACString& aRequestPayload, + bool aIsPostRequest, const nsACString& aStreamTable) { LOG(("(pre) Fetching update from %s\n", PromiseFlatCString(aUpdateUrl).get())); @@ -257,11 +257,11 @@ nsresult nsUrlClassifierStreamUpdater::FetchUpdate( NS_IMETHODIMP nsUrlClassifierStreamUpdater::DownloadUpdates( - const nsACString &aRequestTables, const nsACString &aRequestPayload, - bool aIsPostRequest, const nsACString &aUpdateUrl, - nsIUrlClassifierCallback *aSuccessCallback, - nsIUrlClassifierCallback *aUpdateErrorCallback, - nsIUrlClassifierCallback *aDownloadErrorCallback, bool *_retval) { + const nsACString& aRequestTables, const nsACString& aRequestPayload, + bool aIsPostRequest, const nsACString& aUpdateUrl, + nsIUrlClassifierCallback* aSuccessCallback, + nsIUrlClassifierCallback* aUpdateErrorCallback, + nsIUrlClassifierCallback* aDownloadErrorCallback, bool* _retval) { NS_ENSURE_ARG(aSuccessCallback); NS_ENSURE_ARG(aUpdateErrorCallback); NS_ENSURE_ARG(aDownloadErrorCallback); @@ -270,7 +270,7 @@ nsUrlClassifierStreamUpdater::DownloadUpdates( LOG(("Already updating, queueing update %s from %s", aRequestPayload.Data(), aUpdateUrl.Data())); *_retval = false; - UpdateRequest *request = mPendingRequests.AppendElement(fallible); + UpdateRequest* request = mPendingRequests.AppendElement(fallible); if (!request) { return NS_ERROR_OUT_OF_MEMORY; } @@ -308,7 +308,7 @@ nsUrlClassifierStreamUpdater::DownloadUpdates( LOG(("Service busy, already updating, queuing update %s from %s", aRequestPayload.Data(), aUpdateUrl.Data())); *_retval = false; - UpdateRequest *request = mPendingRequests.AppendElement(fallible); + UpdateRequest* request = mPendingRequests.AppendElement(fallible); if (!request) { return NS_ERROR_OUT_OF_MEMORY; } @@ -329,7 +329,7 @@ nsUrlClassifierStreamUpdater::DownloadUpdates( return rv; } - nsUrlClassifierUtils *urlUtil = nsUrlClassifierUtils::GetInstance(); + nsUrlClassifierUtils* urlUtil = nsUrlClassifierUtils::GetInstance(); if (NS_WARN_IF(!urlUtil)) { return NS_ERROR_FAILURE; } @@ -357,11 +357,11 @@ nsUrlClassifierStreamUpdater::DownloadUpdates( // nsIUrlClassifierUpdateObserver implementation NS_IMETHODIMP -nsUrlClassifierStreamUpdater::UpdateUrlRequested(const nsACString &aUrl, - const nsACString &aTable) { +nsUrlClassifierStreamUpdater::UpdateUrlRequested(const nsACString& aUrl, + const nsACString& aTable) { LOG(("Queuing requested update from %s\n", PromiseFlatCString(aUrl).get())); - PendingUpdate *update = mPendingUpdates.AppendElement(fallible); + PendingUpdate* update = mPendingUpdates.AppendElement(fallible); if (!update) { return NS_ERROR_OUT_OF_MEMORY; } @@ -390,7 +390,7 @@ nsresult nsUrlClassifierStreamUpdater::FetchNext() { return NS_OK; } - PendingUpdate &update = mPendingUpdates[0]; + PendingUpdate& update = mPendingUpdates[0]; LOG(("Fetching update url: %s\n", update.mUrl.get())); nsresult rv = FetchUpdate(update.mUrl, EmptyCString(), @@ -432,11 +432,11 @@ nsresult nsUrlClassifierStreamUpdater::FetchNextRequest() { } void nsUrlClassifierStreamUpdater::BuildUpdateRequest( - const nsACString &aRequestTables, const nsACString &aRequestPayload, - bool aIsPostRequest, const nsACString &aUpdateUrl, - nsIUrlClassifierCallback *aSuccessCallback, - nsIUrlClassifierCallback *aUpdateErrorCallback, - nsIUrlClassifierCallback *aDownloadErrorCallback, UpdateRequest *aRequest) { + const nsACString& aRequestTables, const nsACString& aRequestPayload, + bool aIsPostRequest, const nsACString& aUpdateUrl, + nsIUrlClassifierCallback* aSuccessCallback, + nsIUrlClassifierCallback* aUpdateErrorCallback, + nsIUrlClassifierCallback* aDownloadErrorCallback, UpdateRequest* aRequest) { MOZ_ASSERT(aRequest); aRequest->mTables = aRequestTables; @@ -543,7 +543,7 @@ nsUrlClassifierStreamUpdater::UpdateError(nsresult result) { } nsresult nsUrlClassifierStreamUpdater::AddRequestBody( - const nsACString &aRequestBody) { + const nsACString& aRequestBody) { nsresult rv; nsCOMPtr strStream = do_CreateInstance(NS_STRINGINPUTSTREAM_CONTRACTID, &rv); @@ -572,7 +572,7 @@ nsresult nsUrlClassifierStreamUpdater::AddRequestBody( // nsIStreamListenerObserver implementation NS_IMETHODIMP -nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request) { +nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest* request) { nsresult rv; bool downloadError = false; nsAutoCString strStatus; @@ -666,8 +666,8 @@ nsUrlClassifierStreamUpdater::OnStartRequest(nsIRequest *request) { } NS_IMETHODIMP -nsUrlClassifierStreamUpdater::OnDataAvailable(nsIRequest *request, - nsIInputStream *aIStream, +nsUrlClassifierStreamUpdater::OnDataAvailable(nsIRequest* request, + nsIInputStream* aIStream, uint64_t aSourceOffset, uint32_t aLength) { if (!mDBService) return NS_ERROR_NOT_INITIALIZED; @@ -697,7 +697,7 @@ nsUrlClassifierStreamUpdater::OnDataAvailable(nsIRequest *request, } NS_IMETHODIMP -nsUrlClassifierStreamUpdater::OnStopRequest(nsIRequest *request, +nsUrlClassifierStreamUpdater::OnStopRequest(nsIRequest* request, nsresult aStatus) { if (!mDBService) return NS_ERROR_NOT_INITIALIZED; @@ -757,8 +757,8 @@ nsUrlClassifierStreamUpdater::OnStopRequest(nsIRequest *request, // nsIObserver implementation NS_IMETHODIMP -nsUrlClassifierStreamUpdater::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsUrlClassifierStreamUpdater::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { if (nsCRT::strcmp(aTopic, gQuitApplicationMessage) == 0) { if (mIsUpdating && mChannel) { LOG(("Cancel download")); @@ -793,15 +793,15 @@ nsUrlClassifierStreamUpdater::Observe(nsISupports *aSubject, const char *aTopic, // nsIInterfaceRequestor implementation NS_IMETHODIMP -nsUrlClassifierStreamUpdater::GetInterface(const nsIID &eventSinkIID, - void **_retval) { +nsUrlClassifierStreamUpdater::GetInterface(const nsIID& eventSinkIID, + void** _retval) { return QueryInterface(eventSinkIID, _retval); } /////////////////////////////////////////////////////////////////////////////// // nsITimerCallback implementation NS_IMETHODIMP -nsUrlClassifierStreamUpdater::Notify(nsITimer *timer) { +nsUrlClassifierStreamUpdater::Notify(nsITimer* timer) { LOG(("nsUrlClassifierStreamUpdater::Notify [%p]", this)); if (timer == mFetchNextRequestTimer) { @@ -872,7 +872,7 @@ nsUrlClassifierStreamUpdater::Notify(nsITimer *timer) { //// nsINamed NS_IMETHODIMP -nsUrlClassifierStreamUpdater::GetName(nsACString &aName) { +nsUrlClassifierStreamUpdater::GetName(nsACString& aName) { aName.AssignLiteral("nsUrlClassifierStreamUpdater"); return NS_OK; } diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.h b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.h index 8511d71baf743..a56dce75119d2 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.h +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.h @@ -51,16 +51,16 @@ class nsUrlClassifierStreamUpdater final void DownloadDone(); // Disallow copy constructor - nsUrlClassifierStreamUpdater(nsUrlClassifierStreamUpdater &); + nsUrlClassifierStreamUpdater(nsUrlClassifierStreamUpdater&); - nsresult AddRequestBody(const nsACString &aRequestBody); + nsresult AddRequestBody(const nsACString& aRequestBody); // Fetches an update for a single table. - nsresult FetchUpdate(nsIURI *aURI, const nsACString &aRequest, - bool aIsPostRequest, const nsACString &aTable); + nsresult FetchUpdate(nsIURI* aURI, const nsACString& aRequest, + bool aIsPostRequest, const nsACString& aTable); // Dumb wrapper so we don't have to create URIs. - nsresult FetchUpdate(const nsACString &aURI, const nsACString &aRequest, - bool aIsPostRequest, const nsACString &aTable); + nsresult FetchUpdate(const nsACString& aURI, const nsACString& aRequest, + bool aIsPostRequest, const nsACString& aTable); // Fetches the next table, from mPendingUpdates. nsresult FetchNext(); @@ -77,13 +77,13 @@ class nsUrlClassifierStreamUpdater final nsCOMPtr mDownloadErrorCallback; }; // Utility function to create an update request. - void BuildUpdateRequest(const nsACString &aRequestTables, - const nsACString &aRequestPayload, - bool aIsPostRequest, const nsACString &aUpdateUrl, - nsIUrlClassifierCallback *aSuccessCallback, - nsIUrlClassifierCallback *aUpdateErrorCallback, - nsIUrlClassifierCallback *aDownloadErrorCallback, - UpdateRequest *aRequest); + void BuildUpdateRequest(const nsACString& aRequestTables, + const nsACString& aRequestPayload, + bool aIsPostRequest, const nsACString& aUpdateUrl, + nsIUrlClassifierCallback* aSuccessCallback, + nsIUrlClassifierCallback* aUpdateErrorCallback, + nsIUrlClassifierCallback* aDownloadErrorCallback, + UpdateRequest* aRequest); bool mIsUpdating; bool mInitialized; diff --git a/toolkit/crashreporter/LoadLibraryRemote.cpp b/toolkit/crashreporter/LoadLibraryRemote.cpp index 6e98f8b982014..22adba2deb3d9 100644 --- a/toolkit/crashreporter/LoadLibraryRemote.cpp +++ b/toolkit/crashreporter/LoadLibraryRemote.cpp @@ -22,7 +22,7 @@ #include "nsWindowsHelpers.h" -typedef const unsigned char *FileView; +typedef const unsigned char* FileView; template <> class nsAutoRefTraits { @@ -44,28 +44,28 @@ class nsAutoRefTraits { typedef struct { PIMAGE_NT_HEADERS headers; - unsigned char *localCodeBase; - unsigned char *remoteCodeBase; - HMODULE *modules; + unsigned char* localCodeBase; + unsigned char* remoteCodeBase; + HMODULE* modules; int numModules; } MEMORYMODULE, *PMEMORYMODULE; -typedef BOOL(WINAPI *DllEntryProc)(HINSTANCE hinstDLL, DWORD fdwReason, +typedef BOOL(WINAPI* DllEntryProc)(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved); #define GET_HEADER_DICTIONARY(module, idx) \ &(module)->headers->OptionalHeader.DataDirectory[idx] #ifdef DEBUG_OUTPUT -static void OutputLastError(const char *msg) { - char *tmp; - char *tmpmsg; +static void OutputLastError(const char* msg) { + char* tmp; + char* tmpmsg; FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&tmp, 0, nullptr); - tmpmsg = (char *)LocalAlloc(LPTR, strlen(msg) + strlen(tmp) + 3); + tmpmsg = (char*)LocalAlloc(LPTR, strlen(msg) + strlen(tmp) + 3); sprintf(tmpmsg, "%s: %s", msg, tmp); OutputDebugStringA(tmpmsg); LocalFree(tmpmsg); @@ -73,11 +73,11 @@ static void OutputLastError(const char *msg) { } #endif -static void CopySections(const unsigned char *data, +static void CopySections(const unsigned char* data, PIMAGE_NT_HEADERS old_headers, PMEMORYMODULE module) { int i; - unsigned char *codeBase = module->localCodeBase; - unsigned char *dest; + unsigned char* codeBase = module->localCodeBase; + unsigned char* dest; PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(module->headers); for (i = 0; i < module->headers->FileHeader.NumberOfSections; i++, section++) { @@ -91,8 +91,8 @@ static void CopySections(const unsigned char *data, } } -static bool CopyRegion(HANDLE hRemoteProcess, void *remoteAddress, - void *localAddress, DWORD size, DWORD protect) { +static bool CopyRegion(HANDLE hRemoteProcess, void* remoteAddress, + void* localAddress, DWORD size, DWORD protect) { if (size > 0) { // Copy the data from local->remote and set the memory protection if (!VirtualAllocEx(hRemoteProcess, remoteAddress, size, MEM_COMMIT, @@ -163,8 +163,8 @@ static bool FinalizeSections(PMEMORYMODULE module, HANDLE hRemoteProcess) { protect |= PAGE_NOCACHE; } - void *remoteAddress = module->remoteCodeBase + section->VirtualAddress; - void *localAddress = module->localCodeBase + section->VirtualAddress; + void* remoteAddress = module->remoteCodeBase + section->VirtualAddress; + void* localAddress = module->localCodeBase + section->VirtualAddress; // determine size of region size = section->Misc.VirtualSize; @@ -183,7 +183,7 @@ static bool FinalizeSections(PMEMORYMODULE module, HANDLE hRemoteProcess) { static void PerformBaseRelocation(PMEMORYMODULE module, SIZE_T delta) { DWORD i; - unsigned char *codeBase = module->localCodeBase; + unsigned char* codeBase = module->localCodeBase; PIMAGE_DATA_DIRECTORY directory = GET_HEADER_DICTIONARY(module, IMAGE_DIRECTORY_ENTRY_BASERELOC); @@ -191,16 +191,15 @@ static void PerformBaseRelocation(PMEMORYMODULE module, SIZE_T delta) { PIMAGE_BASE_RELOCATION relocation = (PIMAGE_BASE_RELOCATION)(codeBase + directory->VirtualAddress); for (; relocation->VirtualAddress > 0;) { - unsigned char *dest = codeBase + relocation->VirtualAddress; - unsigned short *relInfo = - (unsigned short *)((unsigned char *)relocation + - IMAGE_SIZEOF_BASE_RELOCATION); + unsigned char* dest = codeBase + relocation->VirtualAddress; + unsigned short* relInfo = (unsigned short*)((unsigned char*)relocation + + IMAGE_SIZEOF_BASE_RELOCATION); for (i = 0; i < ((relocation->SizeOfBlock - IMAGE_SIZEOF_BASE_RELOCATION) / 2); i++, relInfo++) { - DWORD *patchAddrHL; + DWORD* patchAddrHL; #ifdef _WIN64 - ULONGLONG *patchAddr64; + ULONGLONG* patchAddr64; #endif int type, offset; @@ -216,13 +215,13 @@ static void PerformBaseRelocation(PMEMORYMODULE module, SIZE_T delta) { case IMAGE_REL_BASED_HIGHLOW: // change complete 32 bit address - patchAddrHL = (DWORD *)(dest + offset); + patchAddrHL = (DWORD*)(dest + offset); *patchAddrHL += delta; break; #ifdef _WIN64 case IMAGE_REL_BASED_DIR64: - patchAddr64 = (ULONGLONG *)(dest + offset); + patchAddr64 = (ULONGLONG*)(dest + offset); *patchAddr64 += delta; break; #endif @@ -234,7 +233,7 @@ static void PerformBaseRelocation(PMEMORYMODULE module, SIZE_T delta) { } // advance to next relocation block - relocation = (PIMAGE_BASE_RELOCATION)(((char *)relocation) + + relocation = (PIMAGE_BASE_RELOCATION)(((char*)relocation) + relocation->SizeOfBlock); } } @@ -242,7 +241,7 @@ static void PerformBaseRelocation(PMEMORYMODULE module, SIZE_T delta) { static int BuildImportTable(PMEMORYMODULE module) { int result = 1; - unsigned char *codeBase = module->localCodeBase; + unsigned char* codeBase = module->localCodeBase; PIMAGE_DATA_DIRECTORY directory = GET_HEADER_DICTIONARY(module, IMAGE_DIRECTORY_ENTRY_IMPORT); @@ -253,8 +252,8 @@ static int BuildImportTable(PMEMORYMODULE module) { codeBase + directory->VirtualAddress + directory->Size); for (; importDesc < importEnd && importDesc->Name; importDesc++) { - POINTER_TYPE *thunkRef; - FARPROC *funcRef; + POINTER_TYPE* thunkRef; + FARPROC* funcRef; HMODULE handle = GetModuleHandleA((LPCSTR)(codeBase + importDesc->Name)); if (handle == nullptr) { #if DEBUG_OUTPUT @@ -264,7 +263,7 @@ static int BuildImportTable(PMEMORYMODULE module) { break; } - module->modules = (HMODULE *)realloc( + module->modules = (HMODULE*)realloc( module->modules, (module->numModules + 1) * (sizeof(HMODULE))); if (module->modules == nullptr) { result = 0; @@ -273,12 +272,12 @@ static int BuildImportTable(PMEMORYMODULE module) { module->modules[module->numModules++] = handle; if (importDesc->OriginalFirstThunk) { - thunkRef = (POINTER_TYPE *)(codeBase + importDesc->OriginalFirstThunk); - funcRef = (FARPROC *)(codeBase + importDesc->FirstThunk); + thunkRef = (POINTER_TYPE*)(codeBase + importDesc->OriginalFirstThunk); + funcRef = (FARPROC*)(codeBase + importDesc->FirstThunk); } else { // no hint table - thunkRef = (POINTER_TYPE *)(codeBase + importDesc->FirstThunk); - funcRef = (FARPROC *)(codeBase + importDesc->FirstThunk); + thunkRef = (POINTER_TYPE*)(codeBase + importDesc->FirstThunk); + funcRef = (FARPROC*)(codeBase + importDesc->FirstThunk); } for (; *thunkRef; thunkRef++, funcRef++) { if (IMAGE_SNAP_BY_ORDINAL(*thunkRef)) { @@ -304,10 +303,10 @@ static int BuildImportTable(PMEMORYMODULE module) { return result; } -static void *MemoryGetProcAddress(PMEMORYMODULE module, const char *name); +static void* MemoryGetProcAddress(PMEMORYMODULE module, const char* name); -void *LoadRemoteLibraryAndGetAddress(HANDLE hRemoteProcess, - const WCHAR *library, const char *symbol) { +void* LoadRemoteLibraryAndGetAddress(HANDLE hRemoteProcess, + const WCHAR* library, const char* symbol) { // Map the DLL into memory nsAutoHandle hLibrary(CreateFile(library, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, @@ -329,7 +328,7 @@ void *LoadRemoteLibraryAndGetAddress(HANDLE hRemoteProcess, } nsAutoRef data( - (const unsigned char *)MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0, 0)); + (const unsigned char*)MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0, 0)); if (!data) { #if DEBUG_OUTPUT OutputLastError("Couldn't MapViewOfFile.\n"); @@ -357,7 +356,7 @@ void *LoadRemoteLibraryAndGetAddress(HANDLE hRemoteProcess, } // reserve memory for image of library in this process and the target process - unsigned char *localCode = (unsigned char *)VirtualAlloc( + unsigned char* localCode = (unsigned char*)VirtualAlloc( nullptr, old_header->OptionalHeader.SizeOfImage, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); if (!localCode) { @@ -366,7 +365,7 @@ void *LoadRemoteLibraryAndGetAddress(HANDLE hRemoteProcess, #endif } - unsigned char *remoteCode = (unsigned char *)VirtualAllocEx( + unsigned char* remoteCode = (unsigned char*)VirtualAllocEx( hRemoteProcess, nullptr, old_header->OptionalHeader.SizeOfImage, MEM_RESERVE, PAGE_EXECUTE_READ); if (!remoteCode) { @@ -413,11 +412,11 @@ void *LoadRemoteLibraryAndGetAddress(HANDLE hRemoteProcess, return MemoryGetProcAddress(&result, symbol); } -static void *MemoryGetProcAddress(PMEMORYMODULE module, const char *name) { - unsigned char *localCodeBase = module->localCodeBase; +static void* MemoryGetProcAddress(PMEMORYMODULE module, const char* name) { + unsigned char* localCodeBase = module->localCodeBase; int idx = -1; DWORD i, *nameRef; - WORD *ordinal; + WORD* ordinal; PIMAGE_EXPORT_DIRECTORY exports; PIMAGE_DATA_DIRECTORY directory = GET_HEADER_DICTIONARY(module, IMAGE_DIRECTORY_ENTRY_EXPORT); @@ -434,10 +433,10 @@ static void *MemoryGetProcAddress(PMEMORYMODULE module, const char *name) { } // search function name in list of exported names - nameRef = (DWORD *)(localCodeBase + exports->AddressOfNames); - ordinal = (WORD *)(localCodeBase + exports->AddressOfNameOrdinals); + nameRef = (DWORD*)(localCodeBase + exports->AddressOfNames); + ordinal = (WORD*)(localCodeBase + exports->AddressOfNameOrdinals); for (i = 0; i < exports->NumberOfNames; i++, nameRef++, ordinal++) { - if (stricmp(name, (const char *)(localCodeBase + (*nameRef))) == 0) { + if (stricmp(name, (const char*)(localCodeBase + (*nameRef))) == 0) { idx = *ordinal; break; } @@ -455,5 +454,5 @@ static void *MemoryGetProcAddress(PMEMORYMODULE module, const char *name) { // AddressOfFunctions contains the RVAs to the "real" functions return module->remoteCodeBase + - (*(DWORD *)(localCodeBase + exports->AddressOfFunctions + (idx * 4))); + (*(DWORD*)(localCodeBase + exports->AddressOfFunctions + (idx * 4))); } diff --git a/toolkit/crashreporter/rust/rust_demangle.h b/toolkit/crashreporter/rust/rust_demangle.h index 992e219a7a2af..3832db292daef 100644 --- a/toolkit/crashreporter/rust/rust_demangle.h +++ b/toolkit/crashreporter/rust/rust_demangle.h @@ -5,8 +5,8 @@ extern "C" { #endif -extern char *rust_demangle(const char *); -extern void free_rust_demangled_name(char *); +extern char* rust_demangle(const char*); +extern void free_rust_demangled_name(char*); #ifdef __cplusplus } diff --git a/toolkit/mozapps/update/common/certificatecheck.cpp b/toolkit/mozapps/update/common/certificatecheck.cpp index c1f5b3556c9fc..fcaa79b82536b 100644 --- a/toolkit/mozapps/update/common/certificatecheck.cpp +++ b/toolkit/mozapps/update/common/certificatecheck.cpp @@ -22,7 +22,7 @@ static const int ENCODING = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING; * does not match, or the last error otherwise. */ DWORD -CheckCertificateForPEFile(LPCWSTR filePath, CertificateCheckInfo &infoToMatch) { +CheckCertificateForPEFile(LPCWSTR filePath, CertificateCheckInfo& infoToMatch) { HCERTSTORE certStore = nullptr; HCRYPTMSG cryptMsg = nullptr; PCCERT_CONTEXT certContext = nullptr; @@ -112,7 +112,7 @@ CheckCertificateForPEFile(LPCWSTR filePath, CertificateCheckInfo &infoToMatch) { * @return FALSE if the info does not match or if any error occurs in the check */ BOOL DoCertificateAttributesMatch(PCCERT_CONTEXT certContext, - CertificateCheckInfo &infoToMatch) { + CertificateCheckInfo& infoToMatch) { DWORD dwData; LPWSTR szName = nullptr; diff --git a/toolkit/mozapps/update/common/certificatecheck.h b/toolkit/mozapps/update/common/certificatecheck.h index 150c0a5576da0..edb8ddb095aeb 100644 --- a/toolkit/mozapps/update/common/certificatecheck.h +++ b/toolkit/mozapps/update/common/certificatecheck.h @@ -13,9 +13,9 @@ struct CertificateCheckInfo { }; BOOL DoCertificateAttributesMatch(PCCERT_CONTEXT pCertContext, - CertificateCheckInfo &infoToMatch); + CertificateCheckInfo& infoToMatch); DWORD VerifyCertificateTrustForFile(LPCWSTR filePath); DWORD CheckCertificateForPEFile(LPCWSTR filePath, - CertificateCheckInfo &infoToMatch); + CertificateCheckInfo& infoToMatch); #endif diff --git a/toolkit/mozapps/update/common/pathhash.cpp b/toolkit/mozapps/update/common/pathhash.cpp index 409e76cd1aaa3..e70f69a7554fc 100644 --- a/toolkit/mozapps/update/common/pathhash.cpp +++ b/toolkit/mozapps/update/common/pathhash.cpp @@ -14,9 +14,9 @@ * @param hexString A buffer to store the hex string, must be of * size 2 * @hashSize */ -static void BinaryDataToHexString(const BYTE *hash, DWORD &hashSize, +static void BinaryDataToHexString(const BYTE* hash, DWORD& hashSize, LPWSTR hexString) { - WCHAR *p = hexString; + WCHAR* p = hexString; for (DWORD i = 0; i < hashSize; ++i) { wsprintfW(p, L"%.2x", hash[i]); p += 2; @@ -32,8 +32,8 @@ static void BinaryDataToHexString(const BYTE *hash, DWORD &hashSize, * @param hashSize The number of bytes in the output buffer * @return TRUE on success */ -static BOOL CalculateMD5(const char *data, DWORD dataSize, BYTE **hash, - DWORD &hashSize) { +static BOOL CalculateMD5(const char* data, DWORD dataSize, BYTE** hash, + DWORD& hashSize) { HCRYPTPROV hProv = 0; HCRYPTHASH hHash = 0; @@ -54,13 +54,12 @@ static BOOL CalculateMD5(const char *data, DWORD dataSize, BYTE **hash, return FALSE; } - if (!CryptHashData(hHash, reinterpret_cast(data), dataSize, - 0)) { + if (!CryptHashData(hHash, reinterpret_cast(data), dataSize, 0)) { return FALSE; } DWORD dwCount = sizeof(DWORD); - if (!CryptGetHashParam(hHash, HP_HASHSIZE, (BYTE *)&hashSize, &dwCount, 0)) { + if (!CryptGetHashParam(hHash, HP_HASHSIZE, (BYTE*)&hashSize, &dwCount, 0)) { return FALSE; } @@ -105,14 +104,14 @@ BOOL CalculateRegistryPathFromFilePath(const LPCWSTR filePath, // Copying in the extra slash is OK because we calculate the hash // based on the filePathLen which excludes the slash. // +2 to account for the possibly trailing slash and the null terminator. - WCHAR *lowercasePath = new WCHAR[filePathLen + 2]; + WCHAR* lowercasePath = new WCHAR[filePathLen + 2]; memset(lowercasePath, 0, (filePathLen + 2) * sizeof(WCHAR)); wcsncpy(lowercasePath, filePath, filePathLen + 1); _wcslwr(lowercasePath); - BYTE *hash; + BYTE* hash; DWORD hashSize = 0; - if (!CalculateMD5(reinterpret_cast(lowercasePath), + if (!CalculateMD5(reinterpret_cast(lowercasePath), filePathLen * 2, &hash, hashSize)) { delete[] lowercasePath; return FALSE; diff --git a/toolkit/mozapps/update/common/readstrings.cpp b/toolkit/mozapps/update/common/readstrings.cpp index 7e4a9cb914742..6d909ca9654db 100644 --- a/toolkit/mozapps/update/common/readstrings.cpp +++ b/toolkit/mozapps/update/common/readstrings.cpp @@ -21,26 +21,26 @@ // stack based FILE wrapper to ensure that fclose is called. class AutoFILE { public: - explicit AutoFILE(FILE *fp) : fp_(fp) {} + explicit AutoFILE(FILE* fp) : fp_(fp) {} ~AutoFILE() { if (fp_) { fclose(fp_); } } - operator FILE *() { return fp_; } + operator FILE*() { return fp_; } private: - FILE *fp_; + FILE* fp_; }; class AutoCharArray { public: explicit AutoCharArray(size_t len) { ptr_ = new char[len]; } ~AutoCharArray() { delete[] ptr_; } - operator char *() { return ptr_; } + operator char*() { return ptr_; } private: - char *ptr_; + char* ptr_; }; static const char kNL[] = "\r\n"; @@ -48,8 +48,8 @@ static const char kEquals[] = "="; static const char kWhitespace[] = " \t"; static const char kRBracket[] = "]"; -static const char *NS_strspnp(const char *delims, const char *str) { - const char *d; +static const char* NS_strspnp(const char* delims, const char* str) { + const char* d; do { for (d = delims; *d != '\0'; ++d) { if (*str == *d) { @@ -62,21 +62,21 @@ static const char *NS_strspnp(const char *delims, const char *str) { return str; } -static char *NS_strtok(const char *delims, char **str) { +static char* NS_strtok(const char* delims, char** str) { if (!*str) { return nullptr; } - char *ret = (char *)NS_strspnp(delims, *str); + char* ret = (char*)NS_strspnp(delims, *str); if (!*ret) { *str = ret; return nullptr; } - char *i = ret; + char* i = ret; do { - for (const char *d = delims; *d != '\0'; ++d) { + for (const char* d = delims; *d != '\0'; ++d) { if (*i == *d) { *i = '\0'; *str = ++i; @@ -95,13 +95,13 @@ static char *NS_strtok(const char *delims, char **str) { * Returns a zero-based index of the key in the list, or -1 if the key is not * found. */ -static int find_key(const char *keyList, char *key) { +static int find_key(const char* keyList, char* key) { if (!keyList) { return -1; } int index = 0; - const char *p = keyList; + const char* p = keyList; while (*p) { if (strcmp(key, p) == 0) { return index; @@ -127,9 +127,9 @@ static int find_key(const char *keyList, char *key) { * order as the keys provided * @param section Optional name of the section to read; defaults to "Strings" */ -int ReadStrings(const NS_tchar *path, const char *keyList, +int ReadStrings(const NS_tchar* path, const char* keyList, unsigned int numStrings, char results[][MAX_TEXT_LEN], - const char *section) { + const char* section) { AutoFILE fp(NS_tfopen(path, OPEN_MODE)); if (!fp) { @@ -164,26 +164,26 @@ int ReadStrings(const NS_tchar *path, const char *keyList, fileContents[flen] = '\0'; - char *buffer = fileContents; + char* buffer = fileContents; bool inStringsSection = false; unsigned int read = 0; - while (char *token = NS_strtok(kNL, &buffer)) { + while (char* token = NS_strtok(kNL, &buffer)) { if (token[0] == '#' || token[0] == ';') { // it's a comment continue; } - token = (char *)NS_strspnp(kWhitespace, token); + token = (char*)NS_strspnp(kWhitespace, token); if (!*token) { // empty line continue; } if (token[0] == '[') { // section header! ++token; - char const *currSection = token; + char const* currSection = token; - char *rb = NS_strtok(kRBracket, &token); + char* rb = NS_strtok(kRBracket, &token); if (!rb || NS_strtok(kWhitespace, &token)) { // there's either an unclosed [Section or a [Section]Moretext! // we could frankly decide that this INI file is malformed right @@ -208,8 +208,8 @@ int ReadStrings(const NS_tchar *path, const char *keyList, continue; } - char *key = token; - char *e = NS_strtok(kEquals, &token); + char* key = token; + char* e = NS_strtok(kEquals, &token); if (!e) { continue; } @@ -227,9 +227,9 @@ int ReadStrings(const NS_tchar *path, const char *keyList, // A wrapper function to read strings for the updater. // Added for compatibility with the original code. -int ReadStrings(const NS_tchar *path, StringTable *results) { +int ReadStrings(const NS_tchar* path, StringTable* results) { const unsigned int kNumStrings = 2; - const char *kUpdaterKeys = "Title\0Info\0"; + const char* kUpdaterKeys = "Title\0Info\0"; char updater_strings[kNumStrings][MAX_TEXT_LEN]; int result = ReadStrings(path, kUpdaterKeys, kNumStrings, updater_strings); diff --git a/toolkit/mozapps/update/common/readstrings.h b/toolkit/mozapps/update/common/readstrings.h index 955cd337284b6..836a743f056ea 100644 --- a/toolkit/mozapps/update/common/readstrings.h +++ b/toolkit/mozapps/update/common/readstrings.h @@ -28,14 +28,14 @@ struct StringTable { /** * This function reads in localized strings from updater.ini */ -int ReadStrings(const NS_tchar *path, StringTable *results); +int ReadStrings(const NS_tchar* path, StringTable* results); /** * This function reads in localized strings corresponding to the keys from a * given .ini */ -int ReadStrings(const NS_tchar *path, const char *keyList, +int ReadStrings(const NS_tchar* path, const char* keyList, unsigned int numStrings, char results[][MAX_TEXT_LEN], - const char *section = nullptr); + const char* section = nullptr); #endif // READSTRINGS_H__ diff --git a/toolkit/mozapps/update/common/uachelper.h b/toolkit/mozapps/update/common/uachelper.h index 8acb98971f8ad..e9f52157879df 100644 --- a/toolkit/mozapps/update/common/uachelper.h +++ b/toolkit/mozapps/update/common/uachelper.h @@ -14,7 +14,7 @@ class UACHelper { private: static BOOL SetPrivilege(HANDLE token, LPCTSTR privs, BOOL enable); - static BOOL DisableUnneededPrivileges(HANDLE token, LPCTSTR *unneededPrivs, + static BOOL DisableUnneededPrivileges(HANDLE token, LPCTSTR* unneededPrivs, size_t count); static LPCTSTR PrivsToDisable[]; }; diff --git a/toolkit/mozapps/update/common/updatehelper.cpp b/toolkit/mozapps/update/common/updatehelper.cpp index f56a96f617ef0..da19098938aae 100644 --- a/toolkit/mozapps/update/common/updatehelper.cpp +++ b/toolkit/mozapps/update/common/updatehelper.cpp @@ -92,7 +92,7 @@ BOOL StartServiceUpdate(LPCWSTR installDir) { UniquePtr serviceConfigBuffer = MakeUnique(bytesNeeded); if (!QueryServiceConfigW( svc, - reinterpret_cast(serviceConfigBuffer.get()), + reinterpret_cast(serviceConfigBuffer.get()), bytesNeeded, &bytesNeeded)) { CloseServiceHandle(svc); return FALSE; @@ -100,8 +100,8 @@ BOOL StartServiceUpdate(LPCWSTR installDir) { CloseServiceHandle(svc); - QUERY_SERVICE_CONFIGW &serviceConfig = - *reinterpret_cast(serviceConfigBuffer.get()); + QUERY_SERVICE_CONFIGW& serviceConfig = + *reinterpret_cast(serviceConfigBuffer.get()); PathUnquoteSpacesW(serviceConfig.lpBinaryPathName); @@ -157,7 +157,7 @@ BOOL StartServiceUpdate(LPCWSTR installDir) { * 17002 if the service could not be opened */ DWORD -StartServiceCommand(int argc, LPCWSTR *argv) { +StartServiceCommand(int argc, LPCWSTR* argv) { DWORD lastState = WaitForServiceStop(SVC_NAME, 5); if (lastState != SERVICE_STOPPED) { return 20000 + lastState; @@ -210,14 +210,14 @@ StartServiceCommand(int argc, LPCWSTR *argv) { * @return ERROR_SUCCESS if successful */ DWORD -LaunchServiceSoftwareUpdateCommand(int argc, LPCWSTR *argv) { +LaunchServiceSoftwareUpdateCommand(int argc, LPCWSTR* argv) { // The service command is the same as the updater.exe command line except // it has 4 extra args: // 0) The name of the service, automatically added by Windows // 1) "MozillaMaintenance" (I think this is redundant with 0) // 2) The command being executed, which is "software-update" // 3) The path to updater.exe (from argv[0]) - LPCWSTR *updaterServiceArgv = new LPCWSTR[argc + 2]; + LPCWSTR* updaterServiceArgv = new LPCWSTR[argc + 2]; updaterServiceArgv[0] = L"MozillaMaintenance"; updaterServiceArgv[1] = L"software-update"; @@ -295,7 +295,7 @@ BOOL GetUUIDTempFilePath(LPCWSTR basePath, LPCWSTR prefix, LPWSTR tmpPath) { * @return TRUE if successful */ BOOL WriteStatusFailure(LPCWSTR updateDirPath, int errorCode, - nsAutoHandle &userToken) { + nsAutoHandle& userToken) { ImpersonationScope impersonated(userToken); if (userToken && !impersonated) { return FALSE; @@ -560,7 +560,7 @@ BOOL DoesFallbackKeyExist() { * @param isLocal out parameter which will hold TRUE if the drive is local * @return TRUE if the call succeeded */ -BOOL IsLocalFile(LPCWSTR file, BOOL &isLocal) { +BOOL IsLocalFile(LPCWSTR file, BOOL& isLocal) { WCHAR rootPath[MAX_PATH + 1] = {L'\0'}; if (wcslen(file) > MAX_PATH) { return FALSE; @@ -580,7 +580,7 @@ BOOL IsLocalFile(LPCWSTR file, BOOL &isLocal) { * @param retValue Out parameter which will hold the value * @return TRUE on success */ -static BOOL GetDWORDValue(HKEY key, LPCWSTR valueName, DWORD &retValue) { +static BOOL GetDWORDValue(HKEY key, LPCWSTR valueName, DWORD& retValue) { DWORD regDWORDValueSize = sizeof(DWORD); LONG retCode = RegQueryValueExW(key, valueName, 0, nullptr, @@ -597,7 +597,7 @@ static BOOL GetDWORDValue(HKEY key, LPCWSTR valueName, DWORD &retValue) { * @return TRUE if the user can actually elevate and the value was obtained * successfully. */ -BOOL IsUnpromptedElevation(BOOL &isUnpromptedElevation) { +BOOL IsUnpromptedElevation(BOOL& isUnpromptedElevation) { if (!UACHelper::CanUserElevate()) { return FALSE; } diff --git a/toolkit/mozapps/update/common/updatehelper.h b/toolkit/mozapps/update/common/updatehelper.h index 4153b770cbc35..fc733364843a4 100644 --- a/toolkit/mozapps/update/common/updatehelper.h +++ b/toolkit/mozapps/update/common/updatehelper.h @@ -5,17 +5,17 @@ #include "nsWindowsHelpers.h" BOOL StartServiceUpdate(LPCWSTR installDir); -DWORD LaunchServiceSoftwareUpdateCommand(int argc, LPCWSTR *argv); +DWORD LaunchServiceSoftwareUpdateCommand(int argc, LPCWSTR* argv); BOOL GetUUIDTempFilePath(LPCWSTR basePath, LPCWSTR prefix, LPWSTR tmpPath); BOOL WriteStatusFailure(LPCWSTR updateDirPath, int errorCode, - nsAutoHandle &userToken); + nsAutoHandle& userToken); DWORD WaitForServiceStop(LPCWSTR serviceName, DWORD maxWaitSeconds); DWORD WaitForProcessExit(LPCWSTR filename, DWORD maxSeconds); DWORD IsProcessRunning(LPCWSTR filename); BOOL DoesFallbackKeyExist(); -BOOL IsLocalFile(LPCWSTR file, BOOL &isLocal); -DWORD StartServiceCommand(int argc, LPCWSTR *argv); -BOOL IsUnpromptedElevation(BOOL &isUnpromptedElevation); +BOOL IsLocalFile(LPCWSTR file, BOOL& isLocal); +DWORD StartServiceCommand(int argc, LPCWSTR* argv); +BOOL IsUnpromptedElevation(BOOL& isUnpromptedElevation); #define SVC_NAME L"MozillaMaintenance" diff --git a/toolkit/mozapps/update/tests/TestAUSHelper.cpp b/toolkit/mozapps/update/tests/TestAUSHelper.cpp index b4e85bf64ae90..a44bfa713d0dc 100644 --- a/toolkit/mozapps/update/tests/TestAUSHelper.cpp +++ b/toolkit/mozapps/update/tests/TestAUSHelper.cpp @@ -24,8 +24,8 @@ #include #include -static void WriteMsg(const NS_tchar *path, const char *status) { - FILE *outFP = NS_tfopen(path, NS_T("wb")); +static void WriteMsg(const NS_tchar* path, const char* status) { + FILE* outFP = NS_tfopen(path, NS_T("wb")); if (!outFP) { return; } @@ -35,8 +35,8 @@ static void WriteMsg(const NS_tchar *path, const char *status) { outFP = nullptr; } -static bool CheckMsg(const NS_tchar *path, const char *expected) { - FILE *inFP = NS_tfopen(path, NS_T("rb")); +static bool CheckMsg(const NS_tchar* path, const char* expected) { + FILE* inFP = NS_tfopen(path, NS_T("rb")); if (!inFP) { return false; } @@ -48,7 +48,7 @@ static bool CheckMsg(const NS_tchar *path, const char *expected) { return false; } - char *mbuf = (char *)malloc(ms.st_size + 1); + char* mbuf = (char*)malloc(ms.st_size + 1); if (!mbuf) { fclose(inFP); inFP = nullptr; @@ -56,7 +56,7 @@ static bool CheckMsg(const NS_tchar *path, const char *expected) { } size_t r = ms.st_size; - char *rb = mbuf; + char* rb = mbuf; size_t c = fread(rb, sizeof(char), 50, inFP); r -= c; if (c == 0 && r) { @@ -75,7 +75,7 @@ static bool CheckMsg(const NS_tchar *path, const char *expected) { return isMatch; } -int NS_main(int argc, NS_tchar **argv) { +int NS_main(int argc, NS_tchar** argv) { if (argc == 2) { if (!NS_tstrcmp(argv[1], NS_T("post-update-async")) || !NS_tstrcmp(argv[1], NS_T("post-update-sync"))) { @@ -206,7 +206,7 @@ int NS_main(int argc, NS_tchar **argv) { argv[4])) { return 1; } - FILE *file = NS_tfopen(path, NS_T("w")); + FILE* file = NS_tfopen(path, NS_T("w")); if (file) { fputs(NS_T("test"), file); fclose(file); @@ -333,7 +333,7 @@ int NS_main(int argc, NS_tchar **argv) { if (!NS_tstrcmp(argv[1], NS_T("launch-service"))) { #ifdef XP_WIN DWORD ret = - LaunchServiceSoftwareUpdateCommand(argc - 2, (LPCWSTR *)argv + 2); + LaunchServiceSoftwareUpdateCommand(argc - 2, (LPCWSTR*)argv + 2); if (ret != ERROR_SUCCESS) { // 192 is used to avoid reusing a possible return value from the call to // WaitForServiceStop @@ -371,7 +371,7 @@ int NS_main(int argc, NS_tchar **argv) { if (!NS_tstrcmp(argv[4], NS_T("-s"))) { // Note: glibc's getcwd() allocates the buffer dynamically using malloc(3) // if buf (the 1st param) is NULL so free cwd when it is no longer needed. - NS_tchar *cwd = NS_tgetcwd(nullptr, 0); + NS_tchar* cwd = NS_tgetcwd(nullptr, 0); NS_tchar inFilePath[MAXPATHLEN]; if (!NS_tvsnprintf(inFilePath, sizeof(inFilePath) / sizeof(inFilePath[0]), NS_T("%s/%s"), cwd, argv[2])) { @@ -426,7 +426,7 @@ int NS_main(int argc, NS_tchar **argv) { return 1; } - FILE *logFP = NS_tfopen(logFilePath, NS_T("wb")); + FILE* logFP = NS_tfopen(logFilePath, NS_T("wb")); if (!logFP) { return 1; } diff --git a/toolkit/mozapps/update/tests/TestAUSReadStrings.cpp b/toolkit/mozapps/update/tests/TestAUSReadStrings.cpp index fbc571dba2ed5..40d739af4c6b9 100644 --- a/toolkit/mozapps/update/tests/TestAUSReadStrings.cpp +++ b/toolkit/mozapps/update/tests/TestAUSReadStrings.cpp @@ -55,7 +55,7 @@ static int gFailCount = 0; * "TEST-UNEXPECTED-FAIL " for the benefit of the test harness and * appending "\n" to eliminate having to type it at each call site. */ -void fail(const char *msg, ...) { +void fail(const char* msg, ...) { va_list ap; printf("TEST-UNEXPECTED-FAIL | "); @@ -68,7 +68,7 @@ void fail(const char *msg, ...) { ++gFailCount; } -int NS_main(int argc, NS_tchar **argv) { +int NS_main(int argc, NS_tchar** argv) { printf("Running TestAUSReadStrings tests\n"); int rv = 0; @@ -76,9 +76,9 @@ int NS_main(int argc, NS_tchar **argv) { NS_tchar inifile[MAXPATHLEN]; StringTable testStrings; - NS_tchar *slash = NS_tstrrchr(argv[0], PATH_SEPARATOR_CHAR); + NS_tchar* slash = NS_tstrrchr(argv[0], PATH_SEPARATOR_CHAR); #ifdef ALT_PATH_SEPARATOR_CHAR - NS_tchar *altslash = NS_tstrrchr(argv[0], ALT_PATH_SEPARATOR_CHAR); + NS_tchar* altslash = NS_tstrrchr(argv[0], ALT_PATH_SEPARATOR_CHAR); slash = (slash > altslash) ? slash : altslash; #endif // ALT_PATH_SEPARATOR_CHAR diff --git a/toolkit/mozapps/update/updater/archivereader.cpp b/toolkit/mozapps/update/updater/archivereader.cpp index 34fa41471c24d..e166310b13f69 100644 --- a/toolkit/mozapps/update/updater/archivereader.cpp +++ b/toolkit/mozapps/update/updater/archivereader.cpp @@ -53,13 +53,13 @@ * @return OK on success, CERT_VERIFY_ERROR on failure. */ template -int VerifyLoadedCert(MarFile *archive, const uint8_t (&certData)[SIZE]) { +int VerifyLoadedCert(MarFile* archive, const uint8_t (&certData)[SIZE]) { (void)archive; (void)certData; #ifdef MOZ_VERIFY_MAR_SIGNATURE const uint32_t size = SIZE; - const uint8_t *const data = &certData[0]; + const uint8_t* const data = &certData[0]; if (mar_verify_signatures(archive, &data, &size, 1)) { return CERT_VERIFY_ERROR; } @@ -122,8 +122,8 @@ int ArchiveReader::VerifySignature() { * this updater is newer than the * one in the MAR. */ -int ArchiveReader::VerifyProductInformation(const char *MARChannelID, - const char *appVersion) { +int ArchiveReader::VerifyProductInformation(const char* MARChannelID, + const char* appVersion) { if (!mArchive) { return ARCHIVE_NOT_OPEN; } @@ -138,12 +138,12 @@ int ArchiveReader::VerifyProductInformation(const char *MARChannelID, // the update-settings.ini file. if (MARChannelID && strlen(MARChannelID)) { // Check for at least one match in the comma separated list of values. - const char *delimiter = " ,\t"; + const char* delimiter = " ,\t"; // Make a copy of the string in case a read only memory buffer // was specified. strtok modifies the input buffer. char channelCopy[512] = {0}; strncpy(channelCopy, MARChannelID, sizeof(channelCopy) - 1); - char *channel = strtok(channelCopy, delimiter); + char* channel = strtok(channelCopy, delimiter); rv = MAR_CHANNEL_MISMATCH_ERROR; while (channel) { if (!strcmp(channel, productInfoBlock.MARChannelID)) { @@ -171,22 +171,22 @@ int ArchiveReader::VerifyProductInformation(const char *MARChannelID, } } - free((void *)productInfoBlock.MARChannelID); - free((void *)productInfoBlock.productVersion); + free((void*)productInfoBlock.MARChannelID); + free((void*)productInfoBlock.productVersion); return rv; } -int ArchiveReader::Open(const NS_tchar *path) { +int ArchiveReader::Open(const NS_tchar* path) { if (mArchive) { Close(); } if (!mInBuf) { - mInBuf = (uint8_t *)malloc(mInBufSize); + mInBuf = (uint8_t*)malloc(mInBufSize); if (!mInBuf) { // Try again with a smaller buffer. mInBufSize = 1024; - mInBuf = (uint8_t *)malloc(mInBufSize); + mInBuf = (uint8_t*)malloc(mInBufSize); if (!mInBuf) { return ARCHIVE_READER_MEM_ERROR; } @@ -194,11 +194,11 @@ int ArchiveReader::Open(const NS_tchar *path) { } if (!mOutBuf) { - mOutBuf = (uint8_t *)malloc(mOutBufSize); + mOutBuf = (uint8_t*)malloc(mOutBufSize); if (!mOutBuf) { // Try again with a smaller buffer. mOutBufSize = 1024; - mOutBuf = (uint8_t *)malloc(mOutBufSize); + mOutBuf = (uint8_t*)malloc(mOutBufSize); if (!mOutBuf) { return ARCHIVE_READER_MEM_ERROR; } @@ -237,21 +237,21 @@ void ArchiveReader::Close() { } } -int ArchiveReader::ExtractFile(const char *name, const NS_tchar *dest) { - const MarItem *item = mar_find_item(mArchive, name); +int ArchiveReader::ExtractFile(const char* name, const NS_tchar* dest) { + const MarItem* item = mar_find_item(mArchive, name); if (!item) { return READ_ERROR; } #ifdef XP_WIN - FILE *fp = _wfopen(dest, L"wb+"); + FILE* fp = _wfopen(dest, L"wb+"); #else int fd = creat(dest, item->flags); if (fd == -1) { return WRITE_ERROR; } - FILE *fp = fdopen(fd, "wb"); + FILE* fp = fdopen(fd, "wb"); #endif if (!fp) { return WRITE_ERROR; @@ -263,8 +263,8 @@ int ArchiveReader::ExtractFile(const char *name, const NS_tchar *dest) { return rv; } -int ArchiveReader::ExtractFileToStream(const char *name, FILE *fp) { - const MarItem *item = mar_find_item(mArchive, name); +int ArchiveReader::ExtractFileToStream(const char* name, FILE* fp) { + const MarItem* item = mar_find_item(mArchive, name); if (!item) { return READ_ERROR; } @@ -272,14 +272,14 @@ int ArchiveReader::ExtractFileToStream(const char *name, FILE *fp) { return ExtractItemToStream(item, fp); } -int ArchiveReader::ExtractItemToStream(const MarItem *item, FILE *fp) { +int ArchiveReader::ExtractItemToStream(const MarItem* item, FILE* fp) { /* decompress the data chunk by chunk */ int offset, inlen, ret = OK; struct xz_buf strm = {0}; enum xz_ret xz_rv = XZ_OK; - struct xz_dec *dec = xz_dec_init(XZ_DYNALLOC, 64 * 1024 * 1024); + struct xz_dec* dec = xz_dec_init(XZ_DYNALLOC, 64 * 1024 * 1024); if (!dec) { return UNEXPECTED_XZ_ERROR; } diff --git a/toolkit/mozapps/update/updater/archivereader.h b/toolkit/mozapps/update/updater/archivereader.h index a626530a4ead9..7fb34e4dbe74a 100644 --- a/toolkit/mozapps/update/updater/archivereader.h +++ b/toolkit/mozapps/update/updater/archivereader.h @@ -22,21 +22,21 @@ class ArchiveReader { ArchiveReader() {} ~ArchiveReader() { Close(); } - int Open(const NS_tchar *path); + int Open(const NS_tchar* path); int VerifySignature(); - int VerifyProductInformation(const char *MARChannelID, - const char *appVersion); + int VerifyProductInformation(const char* MARChannelID, + const char* appVersion); void Close(); - int ExtractFile(const char *item, const NS_tchar *destination); - int ExtractFileToStream(const char *item, FILE *fp); + int ExtractFile(const char* item, const NS_tchar* destination); + int ExtractFileToStream(const char* item, FILE* fp); private: - int ExtractItemToStream(const MarItem *item, FILE *fp); + int ExtractItemToStream(const MarItem* item, FILE* fp); - MarFile *mArchive = nullptr; - uint8_t *mInBuf = nullptr; - uint8_t *mOutBuf = nullptr; + MarFile* mArchive = nullptr; + uint8_t* mInBuf = nullptr; + uint8_t* mOutBuf = nullptr; size_t mInBufSize = 262144; size_t mOutBufSize = 262144; }; diff --git a/toolkit/mozapps/update/updater/bspatch/bspatch.cpp b/toolkit/mozapps/update/updater/bspatch/bspatch.cpp index 8d9e9b5acc354..281d5558c7c95 100644 --- a/toolkit/mozapps/update/updater/bspatch/bspatch.cpp +++ b/toolkit/mozapps/update/updater/bspatch/bspatch.cpp @@ -55,7 +55,7 @@ # define SSIZE_MAX LONG_MAX #endif -int MBS_ReadHeader(FILE *file, MBSPatchHeader *header) { +int MBS_ReadHeader(FILE* file, MBSPatchHeader* header) { size_t s = fread(header, 1, sizeof(MBSPatchHeader), file); if (s != sizeof(MBSPatchHeader)) { return READ_ERROR; @@ -110,13 +110,13 @@ int MBS_ReadHeader(FILE *file, MBSPatchHeader *header) { return OK; } -int MBS_ApplyPatch(const MBSPatchHeader *header, FILE *patchFile, - unsigned char *fbuffer, FILE *file) { - unsigned char *fbufstart = fbuffer; - unsigned char *fbufend = fbuffer + header->slen; +int MBS_ApplyPatch(const MBSPatchHeader* header, FILE* patchFile, + unsigned char* fbuffer, FILE* file) { + unsigned char* fbufstart = fbuffer; + unsigned char* fbufend = fbuffer + header->slen; - unsigned char *buf = (unsigned char *)malloc(header->cblen + header->difflen + - header->extralen); + unsigned char* buf = (unsigned char*)malloc(header->cblen + header->difflen + + header->extralen); if (!buf) { return BSPATCH_MEM_ERROR; } @@ -124,7 +124,7 @@ int MBS_ApplyPatch(const MBSPatchHeader *header, FILE *patchFile, int rv = OK; size_t r = header->cblen + header->difflen + header->extralen; - unsigned char *wb = buf; + unsigned char* wb = buf; while (r) { const size_t count = (r > SSIZE_MAX) ? SSIZE_MAX : r; size_t c = fread(wb, 1, count, patchFile); @@ -143,18 +143,18 @@ int MBS_ApplyPatch(const MBSPatchHeader *header, FILE *patchFile, } { - MBSPatchTriple *ctrlsrc = (MBSPatchTriple *)buf; + MBSPatchTriple* ctrlsrc = (MBSPatchTriple*)buf; if (header->cblen % sizeof(MBSPatchTriple) != 0) { rv = UNEXPECTED_BSPATCH_ERROR; goto end; } - unsigned char *diffsrc = buf + header->cblen; - unsigned char *extrasrc = diffsrc + header->difflen; + unsigned char* diffsrc = buf + header->cblen; + unsigned char* extrasrc = diffsrc + header->difflen; - MBSPatchTriple *ctrlend = (MBSPatchTriple *)diffsrc; - unsigned char *diffend = extrasrc; - unsigned char *extraend = extrasrc + header->extralen; + MBSPatchTriple* ctrlend = (MBSPatchTriple*)diffsrc; + unsigned char* diffend = extrasrc; + unsigned char* extraend = extrasrc + header->extralen; while (ctrlsrc < ctrlend) { ctrlsrc->x = ntohl(ctrlsrc->x); diff --git a/toolkit/mozapps/update/updater/progressui.h b/toolkit/mozapps/update/updater/progressui.h index 79856ac28c796..e283c4d1cdd93 100644 --- a/toolkit/mozapps/update/updater/progressui.h +++ b/toolkit/mozapps/update/updater/progressui.h @@ -18,7 +18,7 @@ typedef char NS_tchar; #endif // Called to perform any initialization of the widget toolkit -int InitProgressUI(int *argc, NS_tchar ***argv); +int InitProgressUI(int* argc, NS_tchar*** argv); #if defined(XP_WIN) // Called on the main thread at startup diff --git a/toolkit/mozapps/update/updater/progressui_gtk.cpp b/toolkit/mozapps/update/updater/progressui_gtk.cpp index d64ff94c1d3fd..ea2fc997a62ae 100644 --- a/toolkit/mozapps/update/updater/progressui_gtk.cpp +++ b/toolkit/mozapps/update/updater/progressui_gtk.cpp @@ -19,10 +19,10 @@ static gboolean sQuit = FALSE; static gboolean sEnableUI; static guint sTimerID; -static GtkWidget *sWin; -static GtkWidget *sLabel; -static GtkWidget *sProgressBar; -static GdkPixbuf *sPixbuf; +static GtkWidget* sWin; +static GtkWidget* sLabel; +static GtkWidget* sProgressBar; +static GdkPixbuf* sPixbuf; StringTable sStrings; @@ -40,12 +40,12 @@ static gboolean UpdateDialog(gpointer data) { return TRUE; } -static gboolean OnDeleteEvent(GtkWidget *widget, GdkEvent *event, +static gboolean OnDeleteEvent(GtkWidget* widget, GdkEvent* event, gpointer user_data) { return TRUE; } -int InitProgressUI(int *pargc, char ***pargv) { +int InitProgressUI(int* pargc, char*** pargv) { sEnableUI = gtk_init_check(pargc, pargv); if (sEnableUI) { // Prepare to show the UI here in case the files are modified by the update. @@ -94,7 +94,7 @@ int ShowProgressUI() { gtk_window_set_icon(GTK_WINDOW(sWin), sPixbuf); g_object_unref(sPixbuf); - GtkWidget *vbox = gtk_vbox_new(TRUE, 6); + GtkWidget* vbox = gtk_vbox_new(TRUE, 6); sLabel = gtk_label_new(sStrings.info); gtk_misc_set_alignment(GTK_MISC(sLabel), 0.0f, 0.0f); sProgressBar = gtk_progress_bar_new(); diff --git a/toolkit/mozapps/update/updater/progressui_null.cpp b/toolkit/mozapps/update/updater/progressui_null.cpp index 12e6f95bc8348..49877b2faf17d 100644 --- a/toolkit/mozapps/update/updater/progressui_null.cpp +++ b/toolkit/mozapps/update/updater/progressui_null.cpp @@ -6,7 +6,7 @@ #include "progressui.h" -int InitProgressUI(int *argc, char ***argv) { return 0; } +int InitProgressUI(int* argc, char*** argv) { return 0; } int ShowProgressUI() { return 0; } diff --git a/toolkit/mozapps/update/updater/progressui_osx.mm b/toolkit/mozapps/update/updater/progressui_osx.mm index fe75124e96be0..10728ff5cf796 100644 --- a/toolkit/mozapps/update/updater/progressui_osx.mm +++ b/toolkit/mozapps/update/updater/progressui_osx.mm @@ -18,18 +18,18 @@ static BOOL sQuit = NO; static BOOL sIndeterminate = NO; static StringTable sLabels; -static const char *sUpdatePath; +static const char* sUpdatePath; @interface UpdaterUI : NSObject { - IBOutlet NSProgressIndicator *progressBar; - IBOutlet NSTextField *progressTextField; + IBOutlet NSProgressIndicator* progressBar; + IBOutlet NSTextField* progressTextField; } @end @implementation UpdaterUI - (void)awakeFromNib { - NSWindow *w = [progressBar window]; + NSWindow* w = [progressBar window]; [w setTitle:[NSString stringWithUTF8String:sLabels.title]]; [progressTextField setStringValue:[NSString stringWithUTF8String:sLabels.info]]; @@ -62,7 +62,7 @@ - (void)awakeFromNib { } // called when the timer goes off -- (void)updateProgressUI:(NSTimer *)aTimer { +- (void)updateProgressUI:(NSTimer*)aTimer { if (sQuit) { [aTimer invalidate]; [aTimer release]; @@ -83,13 +83,13 @@ - (void)updateProgressUI:(NSTimer *)aTimer { // leave this as returning a BOOL instead of NSApplicationTerminateReply // for backward compatibility -- (BOOL)applicationShouldTerminate:(NSApplication *)sender { +- (BOOL)applicationShouldTerminate:(NSApplication*)sender { return sQuit; } @end -int InitProgressUI(int *pargc, char ***pargv) { +int InitProgressUI(int* pargc, char*** pargv) { sUpdatePath = (*pargv)[1]; return 0; diff --git a/toolkit/mozapps/update/updater/progressui_win.cpp b/toolkit/mozapps/update/updater/progressui_win.cpp index ca8ac18356486..83335e82f48fd 100644 --- a/toolkit/mozapps/update/updater/progressui_win.cpp +++ b/toolkit/mozapps/update/updater/progressui_win.cpp @@ -49,7 +49,7 @@ static BOOL GetStringsFile(WCHAR filename[MAX_PATH]) { return FALSE; } - WCHAR *dot = wcsrchr(filename, '.'); + WCHAR* dot = wcsrchr(filename, '.'); if (!dot || wcsicmp(dot + 1, L"exe")) { return FALSE; } @@ -192,7 +192,7 @@ static LRESULT CALLBACK DialogProc(HWND hDlg, UINT message, WPARAM wParam, return FALSE; } -int InitProgressUI(int *argc, WCHAR ***argv) { return 0; } +int InitProgressUI(int* argc, WCHAR*** argv) { return 0; } /** * Initializes the progress UI strings diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp index 3bff5f616cc76..fcd821cd49e48 100644 --- a/toolkit/mozapps/update/updater/updater.cpp +++ b/toolkit/mozapps/update/updater/updater.cpp @@ -73,16 +73,16 @@ #if defined(XP_MACOSX) // These functions are defined in launchchild_osx.mm void CleanupElevatedMacUpdate(bool aFailureOccurred); -bool IsOwnedByGroupAdmin(const char *aAppBundle); -bool IsRecursivelyWritable(const char *aPath); -void LaunchChild(int argc, const char **argv); -void LaunchMacPostProcess(const char *aAppBundle); -bool ObtainUpdaterArguments(int *argc, char ***argv); -bool ServeElevatedUpdate(int argc, const char **argv); -void SetGroupOwnershipAndPermissions(const char *aAppBundle); +bool IsOwnedByGroupAdmin(const char* aAppBundle); +bool IsRecursivelyWritable(const char* aPath); +void LaunchChild(int argc, const char** argv); +void LaunchMacPostProcess(const char* aAppBundle); +bool ObtainUpdaterArguments(int* argc, char*** argv); +bool ServeElevatedUpdate(int argc, const char** argv); +void SetGroupOwnershipAndPermissions(const char* aAppBundle); struct UpdateServerThreadArgs { int argc; - const NS_tchar **argv; + const NS_tchar** argv; }; #endif @@ -140,10 +140,10 @@ BOOL PathGetSiblingFilePath(LPWSTR destinationBuffer, LPCWSTR siblingFilePath, // This BZ2_crc32Table variable lives in libbz2. We just took the // data structure from bz2 and created crctables.h -static unsigned int crc32(const unsigned char *buf, unsigned int len) { +static unsigned int crc32(const unsigned char* buf, unsigned int len) { unsigned int crc = 0xffffffffL; - const unsigned char *end = buf + len; + const unsigned char* end = buf + len; for (; buf != end; ++buf) crc = (crc << 8) ^ BZ2_crc32Table[(crc >> 24) ^ *buf]; @@ -157,7 +157,7 @@ static unsigned int crc32(const unsigned char *buf, unsigned int len) { // file descriptor from its destructor. class AutoFile { public: - explicit AutoFile(FILE *file = nullptr) : mFile(file) {} + explicit AutoFile(FILE* file = nullptr) : mFile(file) {} ~AutoFile() { if (mFile != nullptr) { @@ -165,7 +165,7 @@ class AutoFile { } } - AutoFile &operator=(FILE *file) { + AutoFile& operator=(FILE* file) { if (mFile != 0) { fclose(mFile); } @@ -173,12 +173,12 @@ class AutoFile { return *this; } - operator FILE *() { return mFile; } + operator FILE*() { return mFile; } - FILE *get() { return mFile; } + FILE* get() { return mFile; } private: - FILE *mFile; + FILE* mFile; }; struct MARChannelStringTable { @@ -212,14 +212,14 @@ UmaskContext::~UmaskContext() { umask(mPreviousUmask); } //----------------------------------------------------------------------------- -typedef void (*ThreadFunc)(void *param); +typedef void (*ThreadFunc)(void* param); #ifdef XP_WIN # include class Thread { public: - int Run(ThreadFunc func, void *param) { + int Run(ThreadFunc func, void* param) { mThreadFunc = func; mThreadParam = param; @@ -237,14 +237,14 @@ class Thread { } private: - static unsigned __stdcall ThreadMain(void *p) { - Thread *self = (Thread *)p; + static unsigned __stdcall ThreadMain(void* p) { + Thread* self = (Thread*)p; self->mThreadFunc(self->mThreadParam); return 0; } HANDLE mThread; ThreadFunc mThreadFunc; - void *mThreadParam; + void* mThreadParam; }; #elif defined(XP_UNIX) @@ -252,11 +252,11 @@ class Thread { class Thread { public: - int Run(ThreadFunc func, void *param) { - return pthread_create(&thr, nullptr, (void *(*)(void *))func, param); + int Run(ThreadFunc func, void* param) { + return pthread_create(&thr, nullptr, (void* (*)(void*))func, param); } int Join() { - void *result; + void* result; return pthread_join(thr, &result); } @@ -281,7 +281,7 @@ static bool sUsingService = false; #ifdef XP_WIN // The current working directory specified in the command line. -static NS_tchar *gDestPath; +static NS_tchar* gDestPath; static NS_tchar gCallbackRelPath[MAXPATHLEN]; static NS_tchar gCallbackBackupPath[MAXPATHLEN]; static NS_tchar gDeleteDirPath[MAXPATHLEN]; @@ -291,8 +291,8 @@ static NS_tchar gDeleteDirPath[MAXPATHLEN]; // maintenance service. If nullptr no impersonation is performed. static HANDLE gUserToken; -static void ImpersonatedLogInit(NS_tchar *sourcePath, - const NS_tchar *fileName) { +static void ImpersonatedLogInit(NS_tchar* sourcePath, + const NS_tchar* fileName) { ImpersonationScope impersonated(gUserToken); if (!gUserToken || impersonated) { LogInit(sourcePath, fileName); @@ -320,15 +320,15 @@ static const NS_tchar kQuote[] = NS_T("\""); static inline size_t mmin(size_t a, size_t b) { return (a > b) ? b : a; } -static NS_tchar *mstrtok(const NS_tchar *delims, NS_tchar **str) { +static NS_tchar* mstrtok(const NS_tchar* delims, NS_tchar** str) { if (!*str || !**str) { *str = nullptr; return nullptr; } // skip leading "whitespace" - NS_tchar *ret = *str; - const NS_tchar *d; + NS_tchar* ret = *str; + const NS_tchar* d; do { for (d = delims; *d != NS_T('\0'); ++d) { if (*ret == *d) { @@ -343,7 +343,7 @@ static NS_tchar *mstrtok(const NS_tchar *delims, NS_tchar **str) { return nullptr; } - NS_tchar *i = ret; + NS_tchar* i = ret; do { for (d = delims; *d != NS_T('\0'); ++d) { if (*i == *d) { @@ -366,8 +366,8 @@ static NS_tchar *mstrtok(const NS_tchar *delims, NS_tchar **str) { #endif #if defined(HAS_ENV_CHECK) -static bool EnvHasValue(const char *name) { - const char *val = getenv(name); +static bool EnvHasValue(const char* name) { + const char* val = getenv(name); return (val && *val); } #endif @@ -379,16 +379,16 @@ static bool EnvHasValue(const char *name) { * The relative path to convert to a full path. * @return valid filesystem full path or nullptr if memory allocation fails. */ -static NS_tchar *get_full_path(const NS_tchar *relpath) { - NS_tchar *destpath = sStagedUpdate ? gWorkingDirPath : gInstallDirPath; +static NS_tchar* get_full_path(const NS_tchar* relpath) { + NS_tchar* destpath = sStagedUpdate ? gWorkingDirPath : gInstallDirPath; size_t lendestpath = NS_tstrlen(destpath); size_t lenrelpath = NS_tstrlen(relpath); - NS_tchar *s = new NS_tchar[lendestpath + lenrelpath + 2]; + NS_tchar* s = new NS_tchar[lendestpath + lenrelpath + 2]; if (!s) { return nullptr; } - NS_tchar *c = s; + NS_tchar* c = s; NS_tstrcpy(c, destpath); c += lendestpath; @@ -410,12 +410,12 @@ static NS_tchar *get_full_path(const NS_tchar *relpath) { * or fullpath itself if it already looks relative. */ #ifndef XP_WIN -static const NS_tchar *get_relative_path(const NS_tchar *fullpath) { +static const NS_tchar* get_relative_path(const NS_tchar* fullpath) { if (fullpath[0] != '/') { return fullpath; } - NS_tchar *prefix = sStagedUpdate ? gWorkingDirPath : gInstallDirPath; + NS_tchar* prefix = sStagedUpdate ? gWorkingDirPath : gInstallDirPath; // If the path isn't long enough to be absolute, return it as-is. if (NS_tstrlen(fullpath) <= NS_tstrlen(prefix)) { @@ -436,8 +436,8 @@ static const NS_tchar *get_relative_path(const NS_tchar *fullpath) { * Whether the path is a directory path. Defaults to false. * @return valid filesystem path or nullptr if the path checks fail. */ -static NS_tchar *get_valid_path(NS_tchar **line, bool isdir = false) { - NS_tchar *path = mstrtok(kQuote, line); +static NS_tchar* get_valid_path(NS_tchar** line, bool isdir = false) { + NS_tchar* path = mstrtok(kQuote, line); if (!path) { LOG(("get_valid_path: unable to determine path: " LOG_S, *line)); return nullptr; @@ -489,17 +489,17 @@ static NS_tchar *get_valid_path(NS_tchar **line, bool isdir = false) { * The path to quote. * @return On success the quoted path and nullptr otherwise. */ -static NS_tchar *get_quoted_path(const NS_tchar *path) { +static NS_tchar* get_quoted_path(const NS_tchar* path) { size_t lenQuote = NS_tstrlen(kQuote); size_t lenPath = NS_tstrlen(path); size_t len = lenQuote + lenPath + lenQuote + 1; - NS_tchar *s = (NS_tchar *)malloc(len * sizeof(NS_tchar)); + NS_tchar* s = (NS_tchar*)malloc(len * sizeof(NS_tchar)); if (!s) { return nullptr; } - NS_tchar *c = s; + NS_tchar* c = s; NS_tstrcpy(c, kQuote); c += lenQuote; NS_tstrcat(c, path); @@ -510,7 +510,7 @@ static NS_tchar *get_quoted_path(const NS_tchar *path) { return s; } -static void ensure_write_permissions(const NS_tchar *path) { +static void ensure_write_permissions(const NS_tchar* path) { #ifdef XP_WIN (void)_wchmod(path, _S_IREAD | _S_IWRITE); #else @@ -521,7 +521,7 @@ static void ensure_write_permissions(const NS_tchar *path) { #endif } -static int ensure_remove(const NS_tchar *path) { +static int ensure_remove(const NS_tchar* path) { ensure_write_permissions(path); int rv = NS_tremove(path); if (rv) { @@ -533,7 +533,7 @@ static int ensure_remove(const NS_tchar *path) { // Remove the directory pointed to by path and all of its files and // sub-directories. -static int ensure_remove_recursive(const NS_tchar *path, +static int ensure_remove_recursive(const NS_tchar* path, bool continueEnumOnFailure = false) { // We use lstat rather than stat here so that we can successfully remove // symlinks. @@ -547,8 +547,8 @@ static int ensure_remove_recursive(const NS_tchar *path, return ensure_remove(path); } - NS_tDIR *dir; - NS_tdirent *entry; + NS_tDIR* dir; + NS_tdirent* entry; dir = NS_topendir(path); if (!dir) { @@ -585,7 +585,7 @@ static int ensure_remove_recursive(const NS_tchar *path, return rv; } -static bool is_read_only(const NS_tchar *flags) { +static bool is_read_only(const NS_tchar* flags) { size_t length = NS_tstrlen(flags); if (length == 0) { return false; @@ -609,10 +609,10 @@ static bool is_read_only(const NS_tchar *flags) { return true; } -static FILE *ensure_open(const NS_tchar *path, const NS_tchar *flags, +static FILE* ensure_open(const NS_tchar* path, const NS_tchar* flags, unsigned int options) { ensure_write_permissions(path); - FILE *f = NS_tfopen(path, flags); + FILE* f = NS_tfopen(path, flags); if (is_read_only(flags)) { // Don't attempt to modify the file permissions if the file is being opened // in read-only mode. @@ -635,10 +635,10 @@ static FILE *ensure_open(const NS_tchar *path, const NS_tchar *flags, } // Ensure that the directory containing this file exists. -static int ensure_parent_dir(const NS_tchar *path) { +static int ensure_parent_dir(const NS_tchar* path) { int rv = OK; - NS_tchar *slash = (NS_tchar *)NS_tstrrchr(path, NS_T('/')); + NS_tchar* slash = (NS_tchar*)NS_tstrrchr(path, NS_T('/')); if (slash) { *slash = NS_T('\0'); rv = ensure_parent_dir(path); @@ -661,7 +661,7 @@ static int ensure_parent_dir(const NS_tchar *path) { } #ifdef XP_UNIX -static int ensure_copy_symlink(const NS_tchar *path, const NS_tchar *dest) { +static int ensure_copy_symlink(const NS_tchar* path, const NS_tchar* dest) { // Copy symlinks by creating a new symlink to the same target NS_tchar target[MAXPATHLEN + 1] = {NS_T('\0')}; int rv = readlink(path, target, MAXPATHLEN); @@ -682,7 +682,7 @@ static int ensure_copy_symlink(const NS_tchar *path, const NS_tchar *dest) { #endif // Copy the file named path onto a new file named dest. -static int ensure_copy(const NS_tchar *path, const NS_tchar *dest) { +static int ensure_copy(const NS_tchar* path, const NS_tchar* dest) { #ifdef XP_WIN // Fast path for Windows bool result = CopyFileW(path, dest, false); @@ -725,7 +725,7 @@ static int ensure_copy(const NS_tchar *path, const NS_tchar *dest) { // compromise. For example, the optimal block size on a modern OS X machine // is 100k */ const int blockSize = 32 * 1024; - void *buffer = malloc(blockSize); + void* buffer = malloc(blockSize); if (!buffer) { return UPDATER_MEM_ERROR; } @@ -765,11 +765,11 @@ template struct copy_recursive_skiplist { NS_tchar paths[N][MAXPATHLEN]; - void append(unsigned index, const NS_tchar *path, const NS_tchar *suffix) { + void append(unsigned index, const NS_tchar* path, const NS_tchar* suffix) { NS_tsnprintf(paths[index], MAXPATHLEN, NS_T("%s/%s"), path, suffix); } - bool find(const NS_tchar *path) { + bool find(const NS_tchar* path) { for (int i = 0; i < static_cast(N); ++i) { if (!NS_tstricmp(paths[i], path)) { return true; @@ -782,8 +782,8 @@ struct copy_recursive_skiplist { // Copy all of the files and subdirectories under path to a new directory named // dest. The path names in the skiplist will be skipped and will not be copied. template -static int ensure_copy_recursive(const NS_tchar *path, const NS_tchar *dest, - copy_recursive_skiplist &skiplist) { +static int ensure_copy_recursive(const NS_tchar* path, const NS_tchar* dest, + copy_recursive_skiplist& skiplist) { struct NS_tstat_t sInfo; int rv = NS_tlstat(path, &sInfo); if (rv) { @@ -811,8 +811,8 @@ static int ensure_copy_recursive(const NS_tchar *path, const NS_tchar *dest, return WRITE_ERROR; } - NS_tDIR *dir; - NS_tdirent *entry; + NS_tDIR* dir; + NS_tdirent* entry; dir = NS_topendir(path); if (!dir) { @@ -847,7 +847,7 @@ static int ensure_copy_recursive(const NS_tchar *path, const NS_tchar *dest, // Renames the specified file to the new file specified. If the destination file // exists it is removed. -static int rename_file(const NS_tchar *spath, const NS_tchar *dpath, +static int rename_file(const NS_tchar* spath, const NS_tchar* dpath, bool allowDirs = false) { int rv = ensure_parent_dir(dpath); if (rv) { @@ -896,8 +896,8 @@ static int rename_file(const NS_tchar *spath, const NS_tchar *dpath, // Remove the directory pointed to by path and all of its files and // sub-directories. If a file is in use move it to the tobedeleted directory // and attempt to schedule removal of the file on reboot -static int remove_recursive_on_reboot(const NS_tchar *path, - const NS_tchar *deleteDir) { +static int remove_recursive_on_reboot(const NS_tchar* path, + const NS_tchar* deleteDir) { struct NS_tstat_t sInfo; int rv = NS_tlstat(path, &sInfo); if (rv) { @@ -929,8 +929,8 @@ static int remove_recursive_on_reboot(const NS_tchar *path, return rv; } - NS_tDIR *dir; - NS_tdirent *entry; + NS_tDIR* dir; + NS_tdirent* entry; dir = NS_topendir(path); if (!dir) { @@ -972,7 +972,7 @@ static int remove_recursive_on_reboot(const NS_tchar *path, //----------------------------------------------------------------------------- // Create a backup of the specified file by renaming it. -static int backup_create(const NS_tchar *path) { +static int backup_create(const NS_tchar* path) { NS_tchar backup[MAXPATHLEN]; NS_tsnprintf(backup, sizeof(backup) / sizeof(backup[0]), NS_T("%s") BACKUP_EXT, path); @@ -982,7 +982,7 @@ static int backup_create(const NS_tchar *path) { // Rename the backup of the specified file that was created by renaming it back // to the original file. -static int backup_restore(const NS_tchar *path, const NS_tchar *relPath) { +static int backup_restore(const NS_tchar* path, const NS_tchar* relPath) { NS_tchar backup[MAXPATHLEN]; NS_tsnprintf(backup, sizeof(backup) / sizeof(backup[0]), NS_T("%s") BACKUP_EXT, path); @@ -1000,7 +1000,7 @@ static int backup_restore(const NS_tchar *path, const NS_tchar *relPath) { } // Discard the backup of the specified file that was created by renaming it. -static int backup_discard(const NS_tchar *path, const NS_tchar *relPath) { +static int backup_discard(const NS_tchar* path, const NS_tchar* relPath) { NS_tchar backup[MAXPATHLEN]; NS_tsnprintf(backup, sizeof(backup) / sizeof(backup[0]), NS_T("%s") BACKUP_EXT, path); @@ -1052,7 +1052,7 @@ static int backup_discard(const NS_tchar *path, const NS_tchar *relPath) { } // Helper function for post-processing a temporary backup. -static void backup_finish(const NS_tchar *path, const NS_tchar *relPath, +static void backup_finish(const NS_tchar* path, const NS_tchar* relPath, int status) { if (status == OK) { backup_discard(path, relPath); @@ -1070,7 +1070,7 @@ class Action { Action() : mProgressCost(1), mNext(nullptr) {} virtual ~Action() = default; - virtual int Parse(NS_tchar *line) = 0; + virtual int Parse(NS_tchar* line) = 0; // Do any preprocessing to ensure that the action can be performed. Execute // will be called if this Action and all others return OK from this method. @@ -1088,7 +1088,7 @@ class Action { int mProgressCost; private: - Action *mNext; + Action* mNext; friend class ActionList; }; @@ -1097,7 +1097,7 @@ class RemoveFile : public Action { public: RemoveFile() : mSkip(0) {} - int Parse(NS_tchar *line) override; + int Parse(NS_tchar* line) override; int Prepare() override; int Execute() override; void Finish(int status) override; @@ -1108,10 +1108,10 @@ class RemoveFile : public Action { int mSkip; }; -int RemoveFile::Parse(NS_tchar *line) { +int RemoveFile::Parse(NS_tchar* line) { // format "" - NS_tchar *validPath = get_valid_path(&line); + NS_tchar* validPath = get_valid_path(&line); if (!validPath) { return PARSE_ERROR; } @@ -1152,7 +1152,7 @@ int RemoveFile::Prepare() { return DELETE_ERROR_EXPECTED_FILE; } - NS_tchar *slash = (NS_tchar *)NS_tstrrchr(mFile.get(), NS_T('/')); + NS_tchar* slash = (NS_tchar*)NS_tstrrchr(mFile.get(), NS_T('/')); if (slash) { *slash = NS_T('\0'); rv = NS_taccess(mFile.get(), W_OK); @@ -1220,7 +1220,7 @@ class RemoveDir : public Action { public: RemoveDir() : mSkip(0) {} - int Parse(NS_tchar *line) override; + int Parse(NS_tchar* line) override; int Prepare() override; // check that the source dir exists int Execute() override; void Finish(int status) override; @@ -1231,10 +1231,10 @@ class RemoveDir : public Action { int mSkip; }; -int RemoveDir::Parse(NS_tchar *line) { +int RemoveDir::Parse(NS_tchar* line) { // format "/" - NS_tchar *validPath = get_valid_path(&line, true); + NS_tchar* validPath = get_valid_path(&line, true); if (!validPath) { return PARSE_ERROR; } @@ -1329,7 +1329,7 @@ class AddFile : public Action { public: AddFile() : mAdded(false) {} - int Parse(NS_tchar *line) override; + int Parse(NS_tchar* line) override; int Prepare() override; int Execute() override; void Finish(int status) override; @@ -1340,10 +1340,10 @@ class AddFile : public Action { bool mAdded; }; -int AddFile::Parse(NS_tchar *line) { +int AddFile::Parse(NS_tchar* line) { // format "" - NS_tchar *validPath = get_valid_path(&line); + NS_tchar* validPath = get_valid_path(&line); if (!validPath) { return PARSE_ERROR; } @@ -1430,22 +1430,22 @@ class PatchFile : public Action { ~PatchFile() override; - int Parse(NS_tchar *line) override; + int Parse(NS_tchar* line) override; int Prepare() override; // should check for patch file and for checksum here int Execute() override; void Finish(int status) override; private: - int LoadSourceFile(FILE *ofile); + int LoadSourceFile(FILE* ofile); static int sPatchIndex; - const NS_tchar *mPatchFile; + const NS_tchar* mPatchFile; mozilla::UniquePtr mFile; mozilla::UniquePtr mFileRelPath; int mPatchIndex; MBSPatchHeader header; - unsigned char *buf; + unsigned char* buf; NS_tchar spath[MAXPATHLEN]; AutoFile mPatchStream; }; @@ -1470,9 +1470,9 @@ PatchFile::~PatchFile() { } } -int PatchFile::LoadSourceFile(FILE *ofile) { +int PatchFile::LoadSourceFile(FILE* ofile) { struct stat os; - int rv = fstat(fileno((FILE *)ofile), &os); + int rv = fstat(fileno((FILE*)ofile), &os); if (rv) { LOG(("LoadSourceFile: unable to stat destination file: " LOG_S ", " "err: %d", @@ -1488,13 +1488,13 @@ int PatchFile::LoadSourceFile(FILE *ofile) { return LOADSOURCE_ERROR_WRONG_SIZE; } - buf = (unsigned char *)malloc(header.slen); + buf = (unsigned char*)malloc(header.slen); if (!buf) { return UPDATER_MEM_ERROR; } size_t r = header.slen; - unsigned char *rb = buf; + unsigned char* rb = buf; while (r) { const size_t count = mmin(SSIZE_MAX, r); size_t c = fread(rb, 1, count, ofile); @@ -1523,7 +1523,7 @@ int PatchFile::LoadSourceFile(FILE *ofile) { return OK; } -int PatchFile::Parse(NS_tchar *line) { +int PatchFile::Parse(NS_tchar* line) { // format "" "" // Get the path to the patch file inside of the mar @@ -1533,12 +1533,12 @@ int PatchFile::Parse(NS_tchar *line) { } // consume whitespace between args - NS_tchar *q = mstrtok(kQuote, &line); + NS_tchar* q = mstrtok(kQuote, &line); if (!q) { return PARSE_ERROR; } - NS_tchar *validPath = get_valid_path(&line); + NS_tchar* validPath = get_valid_path(&line); if (!validPath) { return PARSE_ERROR; } @@ -1609,7 +1609,7 @@ int PatchFile::Execute() { return rv; } - FILE *origfile = nullptr; + FILE* origfile = nullptr; #ifdef XP_WIN if (NS_tstrcmp(mFileRelPath.get(), gCallbackRelPath) == 0) { // Read from the copy of the callback when patching since the callback can't @@ -1655,7 +1655,7 @@ int PatchFile::Execute() { #if defined(HAVE_POSIX_FALLOCATE) AutoFile ofile(ensure_open(mFile.get(), NS_T("wb+"), ss.st_mode)); - posix_fallocate(fileno((FILE *)ofile), 0, header.dlen); + posix_fallocate(fileno((FILE*)ofile), 0, header.dlen); #elif defined(XP_WIN) bool shouldTruncate = true; // Creating the file, setting the size, and then closing the file handle @@ -1684,15 +1684,15 @@ int PatchFile::Execute() { // Modified code from FileUtils.cpp fstore_t store = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, header.dlen}; // Try to get a continous chunk of disk space - rv = fcntl(fileno((FILE *)ofile), F_PREALLOCATE, &store); + rv = fcntl(fileno((FILE*)ofile), F_PREALLOCATE, &store); if (rv == -1) { // OK, perhaps we are too fragmented, allocate non-continuous store.fst_flags = F_ALLOCATEALL; - rv = fcntl(fileno((FILE *)ofile), F_PREALLOCATE, &store); + rv = fcntl(fileno((FILE*)ofile), F_PREALLOCATE, &store); } if (rv != -1) { - ftruncate(fileno((FILE *)ofile), header.dlen); + ftruncate(fileno((FILE*)ofile), header.dlen); } #else AutoFile ofile(ensure_open(mFile.get(), NS_T("wb+"), ss.st_mode)); @@ -1741,7 +1741,7 @@ void PatchFile::Finish(int status) { class AddIfFile : public AddFile { public: - int Parse(NS_tchar *line) override; + int Parse(NS_tchar* line) override; int Prepare() override; int Execute() override; void Finish(int status) override; @@ -1750,7 +1750,7 @@ class AddIfFile : public AddFile { mozilla::UniquePtr mTestFile; }; -int AddIfFile::Parse(NS_tchar *line) { +int AddIfFile::Parse(NS_tchar* line) { // format "" "" mTestFile.reset(get_full_path(get_valid_path(&line))); @@ -1759,7 +1759,7 @@ int AddIfFile::Parse(NS_tchar *line) { } // consume whitespace between args - NS_tchar *q = mstrtok(kQuote, &line); + NS_tchar* q = mstrtok(kQuote, &line); if (!q) { return PARSE_ERROR; } @@ -1795,7 +1795,7 @@ void AddIfFile::Finish(int status) { class AddIfNotFile : public AddFile { public: - int Parse(NS_tchar *line) override; + int Parse(NS_tchar* line) override; int Prepare() override; int Execute() override; void Finish(int status) override; @@ -1804,7 +1804,7 @@ class AddIfNotFile : public AddFile { mozilla::UniquePtr mTestFile; }; -int AddIfNotFile::Parse(NS_tchar *line) { +int AddIfNotFile::Parse(NS_tchar* line) { // format "" "" mTestFile.reset(get_full_path(get_valid_path(&line))); @@ -1813,7 +1813,7 @@ int AddIfNotFile::Parse(NS_tchar *line) { } // consume whitespace between args - NS_tchar *q = mstrtok(kQuote, &line); + NS_tchar* q = mstrtok(kQuote, &line); if (!q) { return PARSE_ERROR; } @@ -1849,7 +1849,7 @@ void AddIfNotFile::Finish(int status) { class PatchIfFile : public PatchFile { public: - int Parse(NS_tchar *line) override; + int Parse(NS_tchar* line) override; int Prepare() override; // should check for patch file and for checksum here int Execute() override; void Finish(int status) override; @@ -1858,7 +1858,7 @@ class PatchIfFile : public PatchFile { mozilla::UniquePtr mTestFile; }; -int PatchIfFile::Parse(NS_tchar *line) { +int PatchIfFile::Parse(NS_tchar* line) { // format "" "" "" mTestFile.reset(get_full_path(get_valid_path(&line))); @@ -1867,7 +1867,7 @@ int PatchIfFile::Parse(NS_tchar *line) { } // consume whitespace between args - NS_tchar *q = mstrtok(kQuote, &line); + NS_tchar* q = mstrtok(kQuote, &line); if (!q) { return PARSE_ERROR; } @@ -1918,8 +1918,8 @@ void PatchIfFile::Finish(int status) { * @param updateInfoDir The directory where update info is stored. * @return true if there was no error starting the process. */ -bool LaunchWinPostProcess(const WCHAR *installationDir, - const WCHAR *updateInfoDir) { +bool LaunchWinPostProcess(const WCHAR* installationDir, + const WCHAR* updateInfoDir) { WCHAR workingDirectory[MAX_PATH + 1] = {L'\0'}; wcsncpy(workingDirectory, installationDir, MAX_PATH); @@ -1997,7 +1997,7 @@ bool LaunchWinPostProcess(const WCHAR *installationDir, sizeof(dummyArg) / sizeof(dummyArg[0]) - 1); size_t len = wcslen(exearg) + wcslen(dummyArg); - WCHAR *cmdline = (WCHAR *)malloc((len + 1) * sizeof(WCHAR)); + WCHAR* cmdline = (WCHAR*)malloc((len + 1) * sizeof(WCHAR)); if (!cmdline) { return false; } @@ -2039,9 +2039,9 @@ bool LaunchWinPostProcess(const WCHAR *installationDir, #endif -static void LaunchCallbackApp(const NS_tchar *workingDir, int argc, - NS_tchar **argv, bool usingService) { - putenv(const_cast("MOZ_LAUNCHED_CHILD=1")); +static void LaunchCallbackApp(const NS_tchar* workingDir, int argc, + NS_tchar** argv, bool usingService) { + putenv(const_cast("MOZ_LAUNCHED_CHILD=1")); // Run from the specified working directory (see bug 312360). if (NS_tchdir(workingDir) != 0) { @@ -2051,7 +2051,7 @@ static void LaunchCallbackApp(const NS_tchar *workingDir, int argc, #if defined(USE_EXECV) execv(argv[0], argv); #elif defined(XP_MACOSX) - LaunchChild(argc, (const char **)argv); + LaunchChild(argc, (const char**)argv); #elif defined(XP_WIN) // Do not allow the callback to run when running an update through the // service as session 0. The unelevated updater.exe will do the launching. @@ -2070,7 +2070,7 @@ static void LaunchCallbackApp(const NS_tchar *workingDir, int argc, #endif } -static bool WriteToFile(const NS_tchar *aFilename, const char *aStatus) { +static bool WriteToFile(const NS_tchar* aFilename, const char* aStatus) { NS_tchar filename[MAXPATHLEN] = {NS_T('\0')}; #if defined(XP_WIN) # if defined(MOZ_MAINTENANCE_SERVICE) @@ -2120,12 +2120,12 @@ static bool WriteToFile(const NS_tchar *aFilename, const char *aStatus) { return true; } -static bool WriteStatusFile(const char *aStatus) { +static bool WriteStatusFile(const char* aStatus) { return WriteToFile(NS_T("update.status"), aStatus); } static void WriteStatusFile(int status) { - const char *text; + const char* text; char buf[32]; if (status == OK) { @@ -2189,7 +2189,7 @@ static bool IsUpdateStatusPendingService() { * is set to succeeded or not. * @return true if the information was retrieved and it is succeeded. */ -static bool IsUpdateStatusSucceeded(bool &isSucceeded) { +static bool IsUpdateStatusSucceeded(bool& isSucceeded) { # if defined(MOZ_MAINTENANCE_SERVICE) ImpersonationScope impersonated(gUserToken); if (gUserToken && !impersonated) { @@ -2270,7 +2270,7 @@ static int ProcessReplaceRequest() { return NO_INSTALLDIR_ERROR; } #else - NS_tchar *destDir = gInstallDirPath; + NS_tchar* destDir = gInstallDirPath; #endif NS_tchar tmpDir[MAXPATHLEN]; @@ -2396,7 +2396,7 @@ static int ProcessReplaceRequest() { } #ifdef XP_WIN -static void WaitForServiceFinishThread(void *param) { +static void WaitForServiceFinishThread(void* param) { // We wait at most 10 minutes, we already waited 5 seconds previously // before deciding to show this UI. WaitForServiceStop(SVC_NAME, 595); @@ -2412,10 +2412,10 @@ static void WaitForServiceFinishThread(void *param) { * @param results A pointer to the location to store the read strings * @return OK on success */ -static int ReadMARChannelIDs(const NS_tchar *path, - MARChannelStringTable *results) { +static int ReadMARChannelIDs(const NS_tchar* path, + MARChannelStringTable* results) { const unsigned int kNumStrings = 1; - const char *kUpdaterKeys = "ACCEPTED_MAR_CHANNEL_IDS\0"; + const char* kUpdaterKeys = "ACCEPTED_MAR_CHANNEL_IDS\0"; char updater_strings[kNumStrings][MAX_TEXT_LEN]; int result = @@ -2428,12 +2428,12 @@ static int ReadMARChannelIDs(const NS_tchar *path, } #endif -static int GetUpdateFileName(NS_tchar *fileName, int maxChars) { +static int GetUpdateFileName(NS_tchar* fileName, int maxChars) { NS_tsnprintf(fileName, maxChars, NS_T("%s/update.mar"), gPatchDirPath); return OK; } -static void UpdateThreadFunc(void *param) { +static void UpdateThreadFunc(void* param) { // open ZIP archive and process... int rv; if (sReplaceRequest) { @@ -2540,7 +2540,7 @@ static void UpdateThreadFunc(void *param) { LOG(("failed: %d", rv)); #ifdef TEST_UPDATER // Some tests need to use --test-process-updates again. - putenv(const_cast("MOZ_TEST_PROCESS_UPDATES=")); + putenv(const_cast("MOZ_TEST_PROCESS_UPDATES=")); #endif } else { if (rv) { @@ -2564,8 +2564,8 @@ static void UpdateThreadFunc(void *param) { } #ifdef XP_MACOSX -static void ServeElevatedUpdateThreadFunc(void *param) { - UpdateServerThreadArgs *threadArgs = (UpdateServerThreadArgs *)param; +static void ServeElevatedUpdateThreadFunc(void* param) { + UpdateServerThreadArgs* threadArgs = (UpdateServerThreadArgs*)param; gSucceeded = ServeElevatedUpdate(threadArgs->argc, threadArgs->argv); if (!gSucceeded) { WriteStatusFile(ELEVATION_CANCELED); @@ -2573,7 +2573,7 @@ static void ServeElevatedUpdateThreadFunc(void *param) { QuitProgressUI(); } -void freeArguments(int argc, char **argv) { +void freeArguments(int argc, char** argv) { for (int i = 0; i < argc; i++) { free(argv[i]); } @@ -2581,11 +2581,11 @@ void freeArguments(int argc, char **argv) { } #endif -int LaunchCallbackAndPostProcessApps(int argc, NS_tchar **argv, +int LaunchCallbackAndPostProcessApps(int argc, NS_tchar** argv, int callbackIndex #ifdef XP_WIN , - const WCHAR *elevatedLockFilePath, + const WCHAR* elevatedLockFilePath, HANDLE updateLockFileHandle #elif XP_MACOSX , @@ -2627,10 +2627,10 @@ int LaunchCallbackAndPostProcessApps(int argc, NS_tchar **argv, return 0; } -int NS_main(int argc, NS_tchar **argv) { +int NS_main(int argc, NS_tchar** argv) { #ifdef MOZ_MAINTENANCE_SERVICE sUsingService = EnvHasValue("MOZ_USING_SERVICE"); - putenv(const_cast("MOZ_USING_SERVICE=")); + putenv(const_cast("MOZ_USING_SERVICE=")); # if XP_WIN // Null gUserToken is treated as "no impersonation required". @@ -2638,7 +2638,7 @@ int NS_main(int argc, NS_tchar **argv) { # ifndef DISABLE_USER_IMPERSONATION if (sUsingService) { - char *tokenStr = getenv(USER_TOKEN_VAR_NAME); + char* tokenStr = getenv(USER_TOKEN_VAR_NAME); if (tokenStr) { // If a token is provided ensure that we can use it. @@ -2746,7 +2746,7 @@ int NS_main(int argc, NS_tchar **argv) { // the current working directory than it is to set the current working // directory in the test itself. if (EnvHasValue("CURWORKDIRPATH")) { - const WCHAR *val = _wgetenv(L"CURWORKDIRPATH"); + const WCHAR* val = _wgetenv(L"CURWORKDIRPATH"); NS_tchdir(val); } #endif @@ -2794,7 +2794,7 @@ int NS_main(int argc, NS_tchar **argv) { // elements, but I don't necessarily believe it. NS_tstrncpy(gInstallDirPath, argv[2], MAXPATHLEN); gInstallDirPath[MAXPATHLEN - 1] = NS_T('\0'); - NS_tchar *slash = NS_tstrrchr(gInstallDirPath, NS_SLASH); + NS_tchar* slash = NS_tstrrchr(gInstallDirPath, NS_SLASH); if (slash && !slash[1]) { *slash = NS_T('\0'); } @@ -2810,7 +2810,7 @@ int NS_main(int argc, NS_tchar **argv) { useService = IsUpdateStatusPendingService(); # ifdef TEST_UPDATER noServiceFallback = EnvHasValue("MOZ_NO_SERVICE_FALLBACK"); - putenv(const_cast("MOZ_NO_SERVICE_FALLBACK=")); + putenv(const_cast("MOZ_NO_SERVICE_FALLBACK=")); // Our tests run with a different apply directory for each test. // We use this registry key on our test slaves to store the // allowed name/issuers. @@ -2921,7 +2921,7 @@ int NS_main(int argc, NS_tchar **argv) { // required. UpdateServerThreadArgs threadArgs; threadArgs.argc = argc; - threadArgs.argv = const_cast(argv); + threadArgs.argv = const_cast(argv); Thread t1; if (t1.Run(ServeElevatedUpdateThreadFunc, &threadArgs) == 0) { @@ -3059,7 +3059,7 @@ int NS_main(int argc, NS_tchar **argv) { // \..\moz_update_in_progress.lock NS_tchar installDir[MAXPATHLEN]; NS_tstrcpy(installDir, gInstallDirPath); - NS_tchar *slash = (NS_tchar *)NS_tstrrchr(installDir, NS_SLASH); + NS_tchar* slash = (NS_tchar*)NS_tstrrchr(installDir, NS_SLASH); *slash = NS_T('\0'); NS_tsnprintf(updateLockFilePath, sizeof(updateLockFilePath) / sizeof(updateLockFilePath[0]), @@ -3210,7 +3210,7 @@ int NS_main(int argc, NS_tchar **argv) { // If the update couldn't be started, then set useService to false so // we do the update the old way. - DWORD ret = LaunchServiceSoftwareUpdateCommand(argc, (LPCWSTR *)argv); + DWORD ret = LaunchServiceSoftwareUpdateCommand(argc, (LPCWSTR*)argv); useService = (ret == ERROR_SUCCESS); // If the command was launched then wait for the service to be done. if (useService) { @@ -3365,13 +3365,13 @@ int NS_main(int argc, NS_tchar **argv) { if (!sReplaceRequest) { // Allocate enough space for the length of the path an optional additional // trailing slash and null termination. - NS_tchar *destpath = (NS_tchar *)malloc((NS_tstrlen(gWorkingDirPath) + 2) * - sizeof(NS_tchar)); + NS_tchar* destpath = + (NS_tchar*)malloc((NS_tstrlen(gWorkingDirPath) + 2) * sizeof(NS_tchar)); if (!destpath) { return 1; } - NS_tchar *c = destpath; + NS_tchar* c = destpath; NS_tstrcpy(c, gWorkingDirPath); c += NS_tstrlen(gWorkingDirPath); if (gWorkingDirPath[NS_tstrlen(gWorkingDirPath) - 1] != NS_T('/') && @@ -3409,7 +3409,7 @@ int NS_main(int argc, NS_tchar **argv) { // to stack corruption which causes crashes and other problems. NS_tchar callbackLongPath[MAXPATHLEN]; ZeroMemory(callbackLongPath, sizeof(callbackLongPath)); - NS_tchar *targetPath = argv[callbackIndex]; + NS_tchar* targetPath = argv[callbackIndex]; NS_tchar buffer[MAXPATHLEN * 2] = {NS_T('\0')}; size_t bufferLeft = MAXPATHLEN * 2; if (sReplaceRequest) { @@ -3417,7 +3417,7 @@ int NS_main(int argc, NS_tchar **argv) { // the destination directory. size_t commonPrefixLength = PathCommonPrefixW(argv[callbackIndex], gInstallDirPath, nullptr); - NS_tchar *p = buffer; + NS_tchar* p = buffer; NS_tstrncpy(p, argv[callbackIndex], commonPrefixLength); p += commonPrefixLength; bufferLeft -= commonPrefixLength; @@ -3457,8 +3457,8 @@ int NS_main(int argc, NS_tchar **argv) { // Doing this is only necessary when we're actually applying a patch. if (!sReplaceRequest) { int len = NS_tstrlen(applyDirLongPath); - NS_tchar *s = callbackLongPath; - NS_tchar *d = gCallbackRelPath; + NS_tchar* s = callbackLongPath; + NS_tchar* d = gCallbackRelPath; // advance to the apply to directory and advance past the trailing // backslash if present. s += len; @@ -3690,27 +3690,27 @@ class ActionList { ActionList() : mFirst(nullptr), mLast(nullptr), mCount(0) {} ~ActionList(); - void Append(Action *action); + void Append(Action* action); int Prepare(); int Execute(); void Finish(int status); private: - Action *mFirst; - Action *mLast; + Action* mFirst; + Action* mLast; int mCount; }; ActionList::~ActionList() { - Action *a = mFirst; + Action* a = mFirst; while (a) { - Action *b = a; + Action* b = a; a = a->mNext; delete b; } } -void ActionList::Append(Action *action) { +void ActionList::Append(Action* action) { if (mLast) { mLast->mNext = action; } else { @@ -3730,7 +3730,7 @@ int ActionList::Prepare() { return MAR_ERROR_EMPTY_ACTION_LIST; } - Action *a = mFirst; + Action* a = mFirst; int i = 0; while (a) { int rv = a->Prepare(); @@ -3749,7 +3749,7 @@ int ActionList::Prepare() { int ActionList::Execute() { int currentProgress = 0, maxProgress = 0; - Action *a = mFirst; + Action* a = mFirst; while (a) { maxProgress += a->mProgressCost; a = a->mNext; @@ -3774,7 +3774,7 @@ int ActionList::Execute() { } void ActionList::Finish(int status) { - Action *a = mFirst; + Action* a = mFirst; int i = 0; while (a) { a->Finish(status); @@ -3792,7 +3792,7 @@ void ActionList::Finish(int status) { } #ifdef XP_WIN -int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { +int add_dir_entries(const NS_tchar* dirpath, ActionList* list) { int rv = OK; WIN32_FIND_DATAW finddata; HANDLE hFindFile; @@ -3825,12 +3825,12 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { } } else { // Add the file to be removed to the ActionList. - NS_tchar *quotedpath = get_quoted_path(foundpath); + NS_tchar* quotedpath = get_quoted_path(foundpath); if (!quotedpath) { return PARSE_ERROR; } - Action *action = new RemoveFile(); + Action* action = new RemoveFile(); rv = action->Parse(quotedpath); if (rv) { LOG(("add_dir_entries Parse error on recurse: " LOG_S ", err: %d", @@ -3847,12 +3847,12 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { FindClose(hFindFile); { // Add the directory to be removed to the ActionList. - NS_tchar *quotedpath = get_quoted_path(dirpath); + NS_tchar* quotedpath = get_quoted_path(dirpath); if (!quotedpath) { return PARSE_ERROR; } - Action *action = new RemoveDir(); + Action* action = new RemoveDir(); rv = action->Parse(quotedpath); if (rv) { LOG(("add_dir_entries Parse error on close: " LOG_S ", err: %d", @@ -3868,24 +3868,24 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { } #elif defined(SOLARIS) - int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { + int add_dir_entries(const NS_tchar* dirpath, ActionList* list) { int rv = OK; NS_tchar foundpath[MAXPATHLEN]; struct { dirent dent_buffer; char chars[MAXNAMLEN]; } ent_buf; - struct dirent *ent; + struct dirent* ent; mozilla::UniquePtr searchpath(get_full_path(dirpath)); - DIR *dir = opendir(searchpath.get()); + DIR* dir = opendir(searchpath.get()); if (!dir) { LOG(("add_dir_entries error on opendir: " LOG_S ", err: %d", searchpath.get(), errno)); return UNEXPECTED_FILE_OPERATION_ERROR; } - while (readdir_r(dir, (dirent *)&ent_buf, &ent) == 0 && ent) { + while (readdir_r(dir, (dirent*)&ent_buf, &ent) == 0 && ent) { if ((strcmp(ent->d_name, ".") == 0) || (strcmp(ent->d_name, "..") == 0)) { continue; } @@ -3910,13 +3910,13 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { } } else { // Add the file to be removed to the ActionList. - NS_tchar *quotedpath = get_quoted_path(get_relative_path(foundpath)); + NS_tchar* quotedpath = get_quoted_path(get_relative_path(foundpath)); if (!quotedpath) { closedir(dir); return PARSE_ERROR; } - Action *action = new RemoveFile(); + Action* action = new RemoveFile(); rv = action->Parse(quotedpath); if (rv) { LOG(("add_dir_entries Parse error on recurse: " LOG_S ", err: %d", @@ -3933,12 +3933,12 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { closedir(dir); // Add the directory to be removed to the ActionList. - NS_tchar *quotedpath = get_quoted_path(get_relative_path(dirpath)); + NS_tchar* quotedpath = get_quoted_path(get_relative_path(dirpath)); if (!quotedpath) { return PARSE_ERROR; } - Action *action = new RemoveDir(); + Action* action = new RemoveDir(); rv = action->Parse(quotedpath); if (rv) { LOG(("add_dir_entries Parse error on close: " LOG_S ", err: %d", @@ -3953,16 +3953,16 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { #else -int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { +int add_dir_entries(const NS_tchar* dirpath, ActionList* list) { int rv = OK; - FTS *ftsdir; - FTSENT *ftsdirEntry; + FTS* ftsdir; + FTSENT* ftsdirEntry; mozilla::UniquePtr searchpath(get_full_path(dirpath)); // Remove the trailing slash so the paths don't contain double slashes. The // existence of the slash has already been checked in DoUpdate. searchpath[NS_tstrlen(searchpath.get()) - 1] = NS_T('\0'); - char *const pathargv[] = {searchpath.get(), nullptr}; + char* const pathargv[] = {searchpath.get(), nullptr}; // FTS_NOCHDIR is used so relative paths from the destination directory are // returned. @@ -3974,8 +3974,8 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { while ((ftsdirEntry = fts_read(ftsdir)) != nullptr) { NS_tchar foundpath[MAXPATHLEN]; - NS_tchar *quotedpath = nullptr; - Action *action = nullptr; + NS_tchar* quotedpath = nullptr; + Action* action = nullptr; switch (ftsdirEntry->fts_info) { // Filesystem objects that shouldn't be in the application's directories @@ -4075,7 +4075,7 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list) { * The full path to the manifest file. * @return On success the contents of the manifest and nullptr otherwise. */ -static NS_tchar *GetManifestContents(const NS_tchar *manifest) { +static NS_tchar* GetManifestContents(const NS_tchar* manifest) { AutoFile mfile(NS_tfopen(manifest, NS_T("rb"))); if (mfile == nullptr) { LOG(("GetManifestContents: error opening manifest file: " LOG_S, manifest)); @@ -4083,19 +4083,19 @@ static NS_tchar *GetManifestContents(const NS_tchar *manifest) { } struct stat ms; - int rv = fstat(fileno((FILE *)mfile), &ms); + int rv = fstat(fileno((FILE*)mfile), &ms); if (rv) { LOG(("GetManifestContents: error stating manifest file: " LOG_S, manifest)); return nullptr; } - char *mbuf = (char *)malloc(ms.st_size + 1); + char* mbuf = (char*)malloc(ms.st_size + 1); if (!mbuf) { return nullptr; } size_t r = ms.st_size; - char *rb = mbuf; + char* rb = mbuf; while (r) { const size_t count = mmin(SSIZE_MAX, r); size_t c = fread(rb, 1, count, mfile); @@ -4114,7 +4114,7 @@ static NS_tchar *GetManifestContents(const NS_tchar *manifest) { #ifndef XP_WIN return mbuf; #else - NS_tchar *wrb = (NS_tchar *)malloc((ms.st_size + 1) * sizeof(NS_tchar)); + NS_tchar* wrb = (NS_tchar*)malloc((ms.st_size + 1) * sizeof(NS_tchar)); if (!wrb) { free(mbuf); return nullptr; @@ -4134,7 +4134,7 @@ static NS_tchar *GetManifestContents(const NS_tchar *manifest) { #endif } -int AddPreCompleteActions(ActionList *list) { +int AddPreCompleteActions(ActionList* list) { #ifdef XP_MACOSX mozilla::UniquePtr manifestPath( get_full_path(NS_T("Contents/Resources/precomplete"))); @@ -4143,7 +4143,7 @@ int AddPreCompleteActions(ActionList *list) { get_full_path(NS_T("precomplete"))); #endif - NS_tchar *buf = GetManifestContents(manifestPath.get()); + NS_tchar* buf = GetManifestContents(manifestPath.get()); if (!buf) { LOG( ("AddPreCompleteActions: error getting contents of precomplete " @@ -4152,24 +4152,24 @@ int AddPreCompleteActions(ActionList *list) { // generation scripts enforce the presence of a precomplete manifest. return OK; } - NS_tchar *rb = buf; + NS_tchar* rb = buf; int rv; - NS_tchar *line; + NS_tchar* line; while ((line = mstrtok(kNL, &rb)) != 0) { // skip comments if (*line == NS_T('#')) { continue; } - NS_tchar *token = mstrtok(kWhitespace, &line); + NS_tchar* token = mstrtok(kWhitespace, &line); if (!token) { LOG(("AddPreCompleteActions: token not found in manifest")); free(buf); return PARSE_ERROR; } - Action *action = nullptr; + Action* action = nullptr; if (NS_tstrcmp(token, NS_T("remove")) == 0) { // rm file action = new RemoveFile(); } else if (NS_tstrcmp(token, NS_T("remove-cc")) == @@ -4215,17 +4215,17 @@ int DoUpdate() { return rv; } - NS_tchar *buf = GetManifestContents(manifest); + NS_tchar* buf = GetManifestContents(manifest); // The manifest is located in the /updating directory which is // removed after the update has finished so don't delete it here. if (!buf) { LOG(("DoUpdate: error opening manifest file: " LOG_S, manifest)); return READ_ERROR; } - NS_tchar *rb = buf; + NS_tchar* rb = buf; ActionList list; - NS_tchar *line; + NS_tchar* line; bool isFirstAction = true; while ((line = mstrtok(kNL, &rb)) != 0) { // skip comments @@ -4233,7 +4233,7 @@ int DoUpdate() { continue; } - NS_tchar *token = mstrtok(kWhitespace, &line); + NS_tchar* token = mstrtok(kWhitespace, &line); if (!token) { LOG(("DoUpdate: token not found in manifest")); free(buf); @@ -4245,7 +4245,7 @@ int DoUpdate() { // The update manifest isn't required to have a type declaration. The mar // generation scripts enforce the presence of the type declaration. if (NS_tstrcmp(token, NS_T("type")) == 0) { - const NS_tchar *type = mstrtok(kQuote, &line); + const NS_tchar* type = mstrtok(kQuote, &line); LOG(("UPDATE TYPE " LOG_S, type)); if (NS_tstrcmp(type, NS_T("complete")) == 0) { rv = AddPreCompleteActions(&list); @@ -4258,13 +4258,13 @@ int DoUpdate() { } } - Action *action = nullptr; + Action* action = nullptr; if (NS_tstrcmp(token, NS_T("remove")) == 0) { // rm file action = new RemoveFile(); } else if (NS_tstrcmp(token, NS_T("rmdir")) == 0) { // rmdir if empty action = new RemoveDir(); } else if (NS_tstrcmp(token, NS_T("rmrfdir")) == 0) { // rmdir recursive - const NS_tchar *reldirpath = mstrtok(kQuote, &line); + const NS_tchar* reldirpath = mstrtok(kQuote, &line); if (!reldirpath) { free(buf); return PARSE_ERROR; diff --git a/toolkit/profile/ProfileUnlockerWin.h b/toolkit/profile/ProfileUnlockerWin.h index 570ddb4cc89e4..1a3e13029453f 100644 --- a/toolkit/profile/ProfileUnlockerWin.h +++ b/toolkit/profile/ProfileUnlockerWin.h @@ -21,26 +21,26 @@ class ProfileUnlockerWin final : public nsIProfileUnlocker { NS_DECL_ISUPPORTS NS_DECL_NSIPROFILEUNLOCKER - explicit ProfileUnlockerWin(const nsAString &aFileName); + explicit ProfileUnlockerWin(const nsAString& aFileName); nsresult Init(); - DWORD StartSession(DWORD &aHandle); + DWORD StartSession(DWORD& aHandle); void EndSession(DWORD aHandle); private: ~ProfileUnlockerWin(); - nsresult TryToTerminate(RM_UNIQUE_PROCESS &aProcess); + nsresult TryToTerminate(RM_UNIQUE_PROCESS& aProcess); private: - typedef DWORD(WINAPI *RMSTARTSESSION)(DWORD *, DWORD, WCHAR[]); - typedef DWORD(WINAPI *RMREGISTERRESOURCES)(DWORD, UINT, LPCWSTR[], UINT, + typedef DWORD(WINAPI* RMSTARTSESSION)(DWORD*, DWORD, WCHAR[]); + typedef DWORD(WINAPI* RMREGISTERRESOURCES)(DWORD, UINT, LPCWSTR[], UINT, RM_UNIQUE_PROCESS[], UINT, LPCWSTR[]); - typedef DWORD(WINAPI *RMGETLIST)(DWORD, UINT *, UINT *, RM_PROCESS_INFO[], + typedef DWORD(WINAPI* RMGETLIST)(DWORD, UINT*, UINT*, RM_PROCESS_INFO[], LPDWORD); - typedef DWORD(WINAPI *RMENDSESSION)(DWORD); - typedef BOOL(WINAPI *QUERYFULLPROCESSIMAGENAME)(HANDLE, DWORD, LPWSTR, + typedef DWORD(WINAPI* RMENDSESSION)(DWORD); + typedef BOOL(WINAPI* QUERYFULLPROCESSIMAGENAME)(HANDLE, DWORD, LPWSTR, PDWORD); private: diff --git a/toolkit/profile/nsProfileLock.cpp b/toolkit/profile/nsProfileLock.cpp index db7dcfa10c4a9..af25462502489 100644 --- a/toolkit/profile/nsProfileLock.cpp +++ b/toolkit/profile/nsProfileLock.cpp @@ -58,9 +58,9 @@ nsProfileLock::nsProfileLock() #endif } -nsProfileLock::nsProfileLock(nsProfileLock &src) { *this = src; } +nsProfileLock::nsProfileLock(nsProfileLock& src) { *this = src; } -nsProfileLock &nsProfileLock::operator=(nsProfileLock &rhs) { +nsProfileLock& nsProfileLock::operator=(nsProfileLock& rhs) { Unlock(); mHaveLock = rhs.mHaveLock; @@ -95,7 +95,7 @@ PRCList nsProfileLock::mPidLockList = void nsProfileLock::RemovePidLockFiles(bool aFatalSignal) { while (!PR_CLIST_IS_EMPTY(&mPidLockList)) { - nsProfileLock *lock = static_cast(mPidLockList.next); + nsProfileLock* lock = static_cast(mPidLockList.next); lock->Unlock(aFatalSignal); } } @@ -111,14 +111,14 @@ static struct sigaction SIGTERM_oldact; void nsProfileLock::FatalSignalHandler(int signo # ifdef SA_SIGINFO , - siginfo_t *info, void *context + siginfo_t* info, void* context # endif ) { // Remove any locks still held. RemovePidLockFiles(true); // Chain to the old handler, which may exit. - struct sigaction *oldact = nullptr; + struct sigaction* oldact = nullptr; switch (signo) { case SIGHUP: @@ -179,7 +179,7 @@ void nsProfileLock::FatalSignalHandler(int signo _exit(signo); } -nsresult nsProfileLock::LockWithFcntl(nsIFile *aLockFile) { +nsresult nsProfileLock::LockWithFcntl(nsIFile* aLockFile) { nsresult rv = NS_OK; nsAutoCString lockFilePath; @@ -228,7 +228,7 @@ nsresult nsProfileLock::LockWithFcntl(nsIFile *aLockFile) { return rv; } -static bool IsSymlinkStaleLock(struct in_addr *aAddr, const char *aFileName, +static bool IsSymlinkStaleLock(struct in_addr* aAddr, const char* aFileName, bool aHaveFcntlLock) { // the link exists; see if it's from this machine, and if // so if the process is still active @@ -236,7 +236,7 @@ static bool IsSymlinkStaleLock(struct in_addr *aAddr, const char *aFileName, int len = readlink(aFileName, buf, sizeof buf - 1); if (len > 0) { buf[len] = '\0'; - char *colon = strchr(buf, ':'); + char* colon = strchr(buf, ':'); if (colon) { *colon++ = '\0'; unsigned long addr = inet_addr(buf); @@ -248,7 +248,7 @@ static bool IsSymlinkStaleLock(struct in_addr *aAddr, const char *aFileName, return true; } - char *after = nullptr; + char* after = nullptr; pid_t pid = strtol(colon, &after, 0); if (pid != 0 && *after == '\0') { if (addr != aAddr->s_addr) { @@ -272,7 +272,7 @@ static bool IsSymlinkStaleLock(struct in_addr *aAddr, const char *aFileName, return true; } -nsresult nsProfileLock::LockWithSymlink(nsIFile *aLockFile, +nsresult nsProfileLock::LockWithSymlink(nsIFile* aLockFile, bool aHaveFcntlLock) { nsresult rv; nsAutoCString lockFilePath; @@ -301,7 +301,7 @@ nsresult nsProfileLock::LockWithSymlink(nsIFile *aLockFile, mozilla::SmprintfPointer signature = mozilla::Smprintf("%s:%s%lu", inet_ntoa(inaddr), aHaveFcntlLock ? "+" : "", (unsigned long)getpid()); - const char *fileName = lockFilePath.get(); + const char* fileName = lockFilePath.get(); int symlink_rv, symlink_errno = 0, tries = 0; // use ns4.x-compatible symlinks if the FS supports them @@ -376,13 +376,13 @@ nsresult nsProfileLock::LockWithSymlink(nsIFile *aLockFile, } #endif /* XP_UNIX */ -nsresult nsProfileLock::GetReplacedLockTime(PRTime *aResult) { +nsresult nsProfileLock::GetReplacedLockTime(PRTime* aResult) { *aResult = mReplacedLockTime; return NS_OK; } -nsresult nsProfileLock::Lock(nsIFile *aProfileDir, - nsIProfileUnlocker **aUnlocker) { +nsresult nsProfileLock::Lock(nsIFile* aProfileDir, + nsIProfileUnlocker** aUnlocker) { #if defined(XP_MACOSX) NS_NAMED_LITERAL_STRING(LOCKFILE_NAME, ".parentlock"); NS_NAMED_LITERAL_STRING(OLD_LOCKFILE_NAME, "parent.lock"); @@ -435,7 +435,7 @@ nsresult nsProfileLock::Lock(nsIFile *aProfileDir, unsigned long launchDate; }; - PRFileDesc *fd = nullptr; + PRFileDesc* fd = nullptr; int32_t ioBytes; ProcessInfoRec processInfo; LockProcessInfo lockProcessInfo; diff --git a/toolkit/system/gnome/nsGSettingsService.cpp b/toolkit/system/gnome/nsGSettingsService.cpp index 8d584e59e3e1d..36962c65545eb 100644 --- a/toolkit/system/gnome/nsGSettingsService.cpp +++ b/toolkit/system/gnome/nsGSettingsService.cpp @@ -24,35 +24,35 @@ typedef struct _GVariantType GVariantType; typedef struct _GVariant GVariant; #ifndef G_VARIANT_TYPE_INT32 -# define G_VARIANT_TYPE_INT32 ((const GVariantType *)"i") -# define G_VARIANT_TYPE_BOOLEAN ((const GVariantType *)"b") -# define G_VARIANT_TYPE_STRING ((const GVariantType *)"s") -# define G_VARIANT_TYPE_OBJECT_PATH ((const GVariantType *)"o") -# define G_VARIANT_TYPE_SIGNATURE ((const GVariantType *)"g") +# define G_VARIANT_TYPE_INT32 ((const GVariantType*)"i") +# define G_VARIANT_TYPE_BOOLEAN ((const GVariantType*)"b") +# define G_VARIANT_TYPE_STRING ((const GVariantType*)"s") +# define G_VARIANT_TYPE_OBJECT_PATH ((const GVariantType*)"o") +# define G_VARIANT_TYPE_SIGNATURE ((const GVariantType*)"g") #endif #ifndef G_VARIANT_TYPE_STRING_ARRAY -# define G_VARIANT_TYPE_STRING_ARRAY ((const GVariantType *)"as") +# define G_VARIANT_TYPE_STRING_ARRAY ((const GVariantType*)"as") #endif -#define GSETTINGS_FUNCTIONS \ - FUNC(g_settings_new, GSettings *, (const char *schema)) \ - FUNC(g_settings_list_schemas, const char *const *, (void)) \ - FUNC(g_settings_list_keys, char **, (GSettings * settings)) \ - FUNC(g_settings_get_value, GVariant *, \ - (GSettings * settings, const char *key)) \ - FUNC(g_settings_set_value, gboolean, \ - (GSettings * settings, const char *key, GVariant *value)) \ - FUNC(g_settings_range_check, gboolean, \ - (GSettings * settings, const char *key, GVariant *value)) \ - FUNC(g_variant_get_int32, gint32, (GVariant * variant)) \ - FUNC(g_variant_get_boolean, gboolean, (GVariant * variant)) \ - FUNC(g_variant_get_string, const char *, (GVariant * value, gsize * length)) \ - FUNC(g_variant_get_strv, const char **, (GVariant * value, gsize * length)) \ - FUNC(g_variant_is_of_type, gboolean, \ - (GVariant * value, const GVariantType *type)) \ - FUNC(g_variant_new_int32, GVariant *, (gint32 value)) \ - FUNC(g_variant_new_boolean, GVariant *, (gboolean value)) \ - FUNC(g_variant_new_string, GVariant *, (const char *string)) \ +#define GSETTINGS_FUNCTIONS \ + FUNC(g_settings_new, GSettings*, (const char* schema)) \ + FUNC(g_settings_list_schemas, const char* const*, (void)) \ + FUNC(g_settings_list_keys, char**, (GSettings * settings)) \ + FUNC(g_settings_get_value, GVariant*, \ + (GSettings * settings, const char* key)) \ + FUNC(g_settings_set_value, gboolean, \ + (GSettings * settings, const char* key, GVariant* value)) \ + FUNC(g_settings_range_check, gboolean, \ + (GSettings * settings, const char* key, GVariant* value)) \ + FUNC(g_variant_get_int32, gint32, (GVariant * variant)) \ + FUNC(g_variant_get_boolean, gboolean, (GVariant * variant)) \ + FUNC(g_variant_get_string, const char*, (GVariant * value, gsize * length)) \ + FUNC(g_variant_get_strv, const char**, (GVariant * value, gsize * length)) \ + FUNC(g_variant_is_of_type, gboolean, \ + (GVariant * value, const GVariantType* type)) \ + FUNC(g_variant_new_int32, GVariant*, (gint32 value)) \ + FUNC(g_variant_new_boolean, GVariant*, (gboolean value)) \ + FUNC(g_variant_new_string, GVariant*, (const char* string)) \ FUNC(g_variant_unref, void, (GVariant * value)) #define FUNC(name, type, params) \ @@ -79,24 +79,24 @@ GSETTINGS_FUNCTIONS #define g_variant_new_string _g_variant_new_string #define g_variant_unref _g_variant_unref -static PRLibrary *gioLib = nullptr; +static PRLibrary* gioLib = nullptr; class nsGSettingsCollection final : public nsIGSettingsCollection { public: NS_DECL_ISUPPORTS NS_DECL_NSIGSETTINGSCOLLECTION - explicit nsGSettingsCollection(GSettings *aSettings) + explicit nsGSettingsCollection(GSettings* aSettings) : mSettings(aSettings), mKeys(nullptr) {} private: ~nsGSettingsCollection(); - bool KeyExists(const nsACString &aKey); - bool SetValue(const nsACString &aKey, GVariant *aValue); + bool KeyExists(const nsACString& aKey); + bool SetValue(const nsACString& aKey, GVariant* aValue); - GSettings *mSettings; - char **mKeys; + GSettings* mSettings; + char** mKeys; }; nsGSettingsCollection::~nsGSettingsCollection() { @@ -104,7 +104,7 @@ nsGSettingsCollection::~nsGSettingsCollection() { g_object_unref(mSettings); } -bool nsGSettingsCollection::KeyExists(const nsACString &aKey) { +bool nsGSettingsCollection::KeyExists(const nsACString& aKey) { if (!mKeys) mKeys = g_settings_list_keys(mSettings); for (uint32_t i = 0; mKeys[i] != nullptr; i++) { @@ -114,7 +114,7 @@ bool nsGSettingsCollection::KeyExists(const nsACString &aKey) { return false; } -bool nsGSettingsCollection::SetValue(const nsACString &aKey, GVariant *aValue) { +bool nsGSettingsCollection::SetValue(const nsACString& aKey, GVariant* aValue) { if (!KeyExists(aKey) || !g_settings_range_check(mSettings, PromiseFlatCString(aKey).get(), aValue)) { @@ -129,9 +129,9 @@ bool nsGSettingsCollection::SetValue(const nsACString &aKey, GVariant *aValue) { NS_IMPL_ISUPPORTS(nsGSettingsCollection, nsIGSettingsCollection) NS_IMETHODIMP -nsGSettingsCollection::SetString(const nsACString &aKey, - const nsACString &aValue) { - GVariant *value = g_variant_new_string(PromiseFlatCString(aValue).get()); +nsGSettingsCollection::SetString(const nsACString& aKey, + const nsACString& aValue) { + GVariant* value = g_variant_new_string(PromiseFlatCString(aValue).get()); if (!value) return NS_ERROR_OUT_OF_MEMORY; bool res = SetValue(aKey, value); @@ -140,8 +140,8 @@ nsGSettingsCollection::SetString(const nsACString &aKey, } NS_IMETHODIMP -nsGSettingsCollection::SetBoolean(const nsACString &aKey, bool aValue) { - GVariant *value = g_variant_new_boolean(aValue); +nsGSettingsCollection::SetBoolean(const nsACString& aKey, bool aValue) { + GVariant* value = g_variant_new_boolean(aValue); if (!value) return NS_ERROR_OUT_OF_MEMORY; bool res = SetValue(aKey, value); @@ -150,8 +150,8 @@ nsGSettingsCollection::SetBoolean(const nsACString &aKey, bool aValue) { } NS_IMETHODIMP -nsGSettingsCollection::SetInt(const nsACString &aKey, int32_t aValue) { - GVariant *value = g_variant_new_int32(aValue); +nsGSettingsCollection::SetInt(const nsACString& aKey, int32_t aValue) { + GVariant* value = g_variant_new_int32(aValue); if (!value) return NS_ERROR_OUT_OF_MEMORY; bool res = SetValue(aKey, value); @@ -160,10 +160,10 @@ nsGSettingsCollection::SetInt(const nsACString &aKey, int32_t aValue) { } NS_IMETHODIMP -nsGSettingsCollection::GetString(const nsACString &aKey, nsACString &aResult) { +nsGSettingsCollection::GetString(const nsACString& aKey, nsACString& aResult) { if (!KeyExists(aKey)) return NS_ERROR_INVALID_ARG; - GVariant *value = + GVariant* value = g_settings_get_value(mSettings, PromiseFlatCString(aKey).get()); if (!g_variant_is_of_type(value, G_VARIANT_TYPE_STRING) && !g_variant_is_of_type(value, G_VARIANT_TYPE_OBJECT_PATH) && @@ -179,12 +179,12 @@ nsGSettingsCollection::GetString(const nsACString &aKey, nsACString &aResult) { } NS_IMETHODIMP -nsGSettingsCollection::GetBoolean(const nsACString &aKey, bool *aResult) { +nsGSettingsCollection::GetBoolean(const nsACString& aKey, bool* aResult) { NS_ENSURE_ARG_POINTER(aResult); if (!KeyExists(aKey)) return NS_ERROR_INVALID_ARG; - GVariant *value = + GVariant* value = g_settings_get_value(mSettings, PromiseFlatCString(aKey).get()); if (!g_variant_is_of_type(value, G_VARIANT_TYPE_BOOLEAN)) { g_variant_unref(value); @@ -199,12 +199,12 @@ nsGSettingsCollection::GetBoolean(const nsACString &aKey, bool *aResult) { } NS_IMETHODIMP -nsGSettingsCollection::GetInt(const nsACString &aKey, int32_t *aResult) { +nsGSettingsCollection::GetInt(const nsACString& aKey, int32_t* aResult) { NS_ENSURE_ARG_POINTER(aResult); if (!KeyExists(aKey)) return NS_ERROR_INVALID_ARG; - GVariant *value = + GVariant* value = g_settings_get_value(mSettings, PromiseFlatCString(aKey).get()); if (!g_variant_is_of_type(value, G_VARIANT_TYPE_INT32)) { g_variant_unref(value); @@ -222,13 +222,13 @@ nsGSettingsCollection::GetInt(const nsACString &aKey, int32_t *aResult) { // Boo-urns! typedef void (*nsGSettingsFunc)(); struct nsGSettingsDynamicFunction { - const char *functionName; - nsGSettingsFunc *function; + const char* functionName; + nsGSettingsFunc* function; }; NS_IMETHODIMP -nsGSettingsCollection::GetStringList(const nsACString &aKey, - nsIArray **aResult) { +nsGSettingsCollection::GetStringList(const nsACString& aKey, + nsIArray** aResult) { if (!KeyExists(aKey)) return NS_ERROR_INVALID_ARG; nsCOMPtr items(do_CreateInstance(NS_ARRAY_CONTRACTID)); @@ -236,7 +236,7 @@ nsGSettingsCollection::GetStringList(const nsACString &aKey, return NS_ERROR_OUT_OF_MEMORY; } - GVariant *value = + GVariant* value = g_settings_get_value(mSettings, PromiseFlatCString(aKey).get()); if (!g_variant_is_of_type(value, G_VARIANT_TYPE_STRING_ARRAY)) { @@ -244,7 +244,7 @@ nsGSettingsCollection::GetStringList(const nsACString &aKey, return NS_ERROR_FAILURE; } - const gchar **gs_strings = g_variant_get_strv(value, nullptr); + const gchar** gs_strings = g_variant_get_strv(value, nullptr); if (!gs_strings) { // empty array items.forget(aResult); @@ -252,7 +252,7 @@ nsGSettingsCollection::GetStringList(const nsACString &aKey, return NS_OK; } - const gchar **p_gs_strings = gs_strings; + const gchar** p_gs_strings = gs_strings; while (*p_gs_strings != nullptr) { nsCOMPtr obj( do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID)); @@ -269,7 +269,7 @@ nsGSettingsCollection::GetStringList(const nsACString &aKey, } nsresult nsGSettingsService::Init() { -#define FUNC(name, type, params) {#name, (nsGSettingsFunc *)&_##name}, +#define FUNC(name, type, params) {#name, (nsGSettingsFunc*)&_##name}, static const nsGSettingsDynamicFunction kGSettingsSymbols[] = { GSETTINGS_FUNCTIONS}; #undef FUNC @@ -301,15 +301,15 @@ nsGSettingsService::~nsGSettingsService() { NS_IMETHODIMP nsGSettingsService::GetCollectionForSchema( - const nsACString &schema, nsIGSettingsCollection **collection) { + const nsACString& schema, nsIGSettingsCollection** collection) { NS_ENSURE_ARG_POINTER(collection); - const char *const *schemas = g_settings_list_schemas(); + const char* const* schemas = g_settings_list_schemas(); for (uint32_t i = 0; schemas[i] != nullptr; i++) { if (schema.Equals(schemas[i])) { - GSettings *settings = g_settings_new(PromiseFlatCString(schema).get()); - nsGSettingsCollection *mozGSettings = new nsGSettingsCollection(settings); + GSettings* settings = g_settings_new(PromiseFlatCString(schema).get()); + nsGSettingsCollection* mozGSettings = new nsGSettingsCollection(settings); NS_ADDREF(*collection = mozGSettings); return NS_OK; } diff --git a/toolkit/system/unixproxy/nsLibProxySettings.cpp b/toolkit/system/unixproxy/nsLibProxySettings.cpp index 33c60edac1627..01ee0d1297238 100644 --- a/toolkit/system/unixproxy/nsLibProxySettings.cpp +++ b/toolkit/system/unixproxy/nsLibProxySettings.cpp @@ -28,28 +28,28 @@ class nsUnixSystemProxySettings : public nsISystemProxySettings { if (mProxyFactory) px_proxy_factory_free(mProxyFactory); } - pxProxyFactory *mProxyFactory; + pxProxyFactory* mProxyFactory; }; NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings) NS_IMETHODIMP -nsUnixSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly) { +nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { *aMainThreadOnly = false; return NS_OK; } -nsresult nsUnixSystemProxySettings::GetPACURI(nsACString &aResult) { +nsresult nsUnixSystemProxySettings::GetPACURI(nsACString& aResult) { // Make sure we return an empty result. aResult.Truncate(); return NS_OK; } -nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString &aSpec, - const nsACString &aScheme, - const nsACString &aHost, +nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec, + const nsACString& aScheme, + const nsACString& aHost, const int32_t aPort, - nsACString &aResult) { + nsACString& aResult) { nsresult rv; if (!mProxyFactory) { @@ -57,7 +57,7 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString &aSpec, } NS_ENSURE_TRUE(mProxyFactory, NS_ERROR_NOT_AVAILABLE); - char **proxyArray = nullptr; + char** proxyArray = nullptr; proxyArray = px_proxy_factory_get_proxies(mProxyFactory, PromiseFlatCString(aSpec).get()); NS_ENSURE_TRUE(proxyArray, NS_ERROR_NOT_AVAILABLE); @@ -80,7 +80,7 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString &aSpec, // figure out the scheme, and we can't use nsIIOService::NewURI because // this is not the main thread. - char *colon = strchr(proxyArray[c], ':'); + char* colon = strchr(proxyArray[c], ':'); uint32_t schemelen = colon ? colon - proxyArray[c] : 0; if (schemelen < 1) { c++; diff --git a/toolkit/xre/AutoSQLiteLifetime.cpp b/toolkit/xre/AutoSQLiteLifetime.cpp index a396f3f30428f..4500ec1bfe0e6 100644 --- a/toolkit/xre/AutoSQLiteLifetime.cpp +++ b/toolkit/xre/AutoSQLiteLifetime.cpp @@ -63,25 +63,25 @@ MOZ_DEFINE_MALLOC_SIZE_OF_ON_FREE(SqliteMallocSizeOfOnFree) # endif -static void *sqliteMemMalloc(int n) { - void *p = ::malloc(n); +static void* sqliteMemMalloc(int n) { + void* p = ::malloc(n); # ifdef MOZ_DMD gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(p); # endif return p; } -static void sqliteMemFree(void *p) { +static void sqliteMemFree(void* p) { # ifdef MOZ_DMD gSqliteMemoryUsed -= SqliteMallocSizeOfOnFree(p); # endif ::free(p); } -static void *sqliteMemRealloc(void *p, int n) { +static void* sqliteMemRealloc(void* p, int n) { # ifdef MOZ_DMD gSqliteMemoryUsed -= SqliteMallocSizeOfOnFree(p); - void *pnew = ::realloc(p, n); + void* pnew = ::realloc(p, n); if (pnew) { gSqliteMemoryUsed += SqliteMallocSizeOfOnAlloc(pnew); } else { @@ -94,7 +94,7 @@ static void *sqliteMemRealloc(void *p, int n) { # endif } -static int sqliteMemSize(void *p) { return ::moz_malloc_usable_size(p); } +static int sqliteMemSize(void* p) { return ::moz_malloc_usable_size(p); } static int sqliteMemRoundup(int n) { n = malloc_good_size(n); @@ -105,9 +105,9 @@ static int sqliteMemRoundup(int n) { return n <= 8 ? 8 : n; } -static int sqliteMemInit(void *p) { return 0; } +static int sqliteMemInit(void* p) { return 0; } -static void sqliteMemShutdown(void *p) {} +static void sqliteMemShutdown(void* p) {} const sqlite3_mem_methods memMethods = { &sqliteMemMalloc, &sqliteMemFree, &sqliteMemRealloc, &sqliteMemSize, diff --git a/toolkit/xre/MacApplicationDelegate.mm b/toolkit/xre/MacApplicationDelegate.mm index 80dd131b2732e..521c718076adc 100644 --- a/toolkit/xre/MacApplicationDelegate.mm +++ b/toolkit/xre/MacApplicationDelegate.mm @@ -42,7 +42,7 @@ ~AutoAutoreleasePool() { [mLocalPool release]; } private: - NSAutoreleasePool *mLocalPool; + NSAutoreleasePool* mLocalPool; }; @interface MacApplicationDelegate : NSObject { @@ -98,7 +98,7 @@ void ProcessPendingGetURLAppleEvents() { bool keepSpinning = true; while (keepSpinning) { sProcessedGetURLEvent = false; - NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask + NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES]; @@ -113,7 +113,7 @@ - (id)init { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; if ((self = [super init])) { - NSAppleEventManager *aeMgr = [NSAppleEventManager sharedAppleEventManager]; + NSAppleEventManager* aeMgr = [NSAppleEventManager sharedAppleEventManager]; [aeMgr setEventHandler:self andSelector:@selector(handleAppleEvent:withReplyEvent:) @@ -133,7 +133,7 @@ - (id)init { if (![NSApp windowsMenu]) { // If the application has a windows menu, it will keep it up to date and // prepend the window list to the Dock menu automatically. - NSMenu *windowsMenu = [[NSMenu alloc] initWithTitle:@"Window"]; + NSMenu* windowsMenu = [[NSMenu alloc] initWithTitle:@"Window"]; [NSApp setWindowsMenu:windowsMenu]; [windowsMenu release]; } @@ -146,7 +146,7 @@ - (id)init { - (void)dealloc { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - NSAppleEventManager *aeMgr = [NSAppleEventManager sharedAppleEventManager]; + NSAppleEventManager* aeMgr = [NSAppleEventManager sharedAppleEventManager]; [aeMgr removeEventHandlerForEventClass:kInternetEventClass andEventID:kAEGetURL]; [aeMgr removeEventHandlerForEventClass:'WWW!' andEventID:'OURL']; [aeMgr removeEventHandlerForEventClass:kCoreEventClass andEventID:kAEOpenDocuments]; @@ -158,7 +158,7 @@ - (void)dealloc { // The method that NSApplication calls upon a request to reopen, such as when // the Dock icon is clicked and no windows are open. A "visible" window may be // miniaturized, so we can't skip nsCocoaNativeReOpen() if 'flag' is 'true'. -- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApp hasVisibleWindows:(BOOL)flag { +- (BOOL)applicationShouldHandleReopen:(NSApplication*)theApp hasVisibleWindows:(BOOL)flag { nsCOMPtr nas = NS_GetNativeAppSupport(); NS_ENSURE_TRUE(nas, NO); @@ -172,13 +172,13 @@ - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApp hasVisibleWindows: // The method that NSApplication calls when documents are requested to be opened. // It will be called once for each selected document. -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { +- (BOOL)application:(NSApplication*)theApplication openFile:(NSString*)filename { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; - NSURL *url = [NSURL fileURLWithPath:filename]; + NSURL* url = [NSURL fileURLWithPath:filename]; if (!url) return NO; - NSString *urlString = [url absoluteString]; + NSString* urlString = [url absoluteString]; if (!urlString) return NO; // Add the URL to any command line we're currently setting up. @@ -198,7 +198,7 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam rv = NS_GetSpecialDirectory(NS_OS_CURRENT_WORKING_DIR, getter_AddRefs(workingDir)); if (NS_FAILED(rv)) return NO; - const char *argv[3] = {nullptr, "-file", filePath.get()}; + const char* argv[3] = {nullptr, "-file", filePath.get()}; rv = cmdLine->Init(3, argv, workingDir, nsICommandLine::STATE_REMOTE_EXPLICIT); if (NS_FAILED(rv)) return NO; @@ -212,16 +212,16 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam // The method that NSApplication calls when documents are requested to be printed // from the Finder (under the "File" menu). // It will be called once for each selected document. -- (BOOL)application:(NSApplication *)theApplication printFile:(NSString *)filename { +- (BOOL)application:(NSApplication*)theApplication printFile:(NSString*)filename { return NO; } // Create the menu that shows up in the Dock. -- (NSMenu *)applicationDockMenu:(NSApplication *)sender { +- (NSMenu*)applicationDockMenu:(NSApplication*)sender { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; // Create the NSMenu that will contain the dock menu items. - NSMenu *menu = [[[NSMenu alloc] initWithTitle:@""] autorelease]; + NSMenu* menu = [[[NSMenu alloc] initWithTitle:@""] autorelease]; [menu setAutoenablesItems:NO]; // Add application-specific dock menu items. On error, do not insert the @@ -242,8 +242,8 @@ - (NSMenu *)applicationDockMenu:(NSApplication *)sender { if (NS_FAILED(rv) || !shouldShowItems) return menu; // Obtain a copy of the native menu. - NSMenu *nativeDockMenu; - rv = dockMenu->GetNativeMenu(reinterpret_cast(&nativeDockMenu)); + NSMenu* nativeDockMenu; + rv = dockMenu->GetNativeMenu(reinterpret_cast(&nativeDockMenu)); if (NS_FAILED(rv) || !nativeDockMenu) return menu; // Loop through the application-specific dock menu and insert its @@ -253,7 +253,7 @@ - (NSMenu *)applicationDockMenu:(NSApplication *)sender { if ([menu numberOfItems] > 0) [menu addItem:[NSMenuItem separatorItem]]; for (int i = 0; i < numDockMenuItems; i++) { - NSMenuItem *itemCopy = [[nativeDockMenu itemAtIndex:i] copy]; + NSMenuItem* itemCopy = [[nativeDockMenu itemAtIndex:i] copy]; [menu addItem:itemCopy]; [itemCopy release]; } @@ -264,7 +264,7 @@ - (NSMenu *)applicationDockMenu:(NSApplication *)sender { NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } -- (void)applicationWillFinishLaunching:(NSNotification *)notification { +- (void)applicationWillFinishLaunching:(NSNotification*)notification { // We provide our own full screen menu item, so we don't want the OS providing // one as well. [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"]; @@ -272,7 +272,7 @@ - (void)applicationWillFinishLaunching:(NSNotification *)notification { // If we don't handle applicationShouldTerminate:, a call to [NSApp terminate:] // (from the browser or from the OS) can result in an unclean shutdown. -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { +- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender { nsCOMPtr obsServ = do_GetService("@mozilla.org/observer-service;1"); if (!obsServ) return NSTerminateNow; @@ -292,8 +292,8 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende return NSTerminateNow; } -- (void)handleAppleEvent:(NSAppleEventDescriptor *)event - withReplyEvent:(NSAppleEventDescriptor *)replyEvent { +- (void)handleAppleEvent:(NSAppleEventDescriptor*)event + withReplyEvent:(NSAppleEventDescriptor*)replyEvent { if (!event) return; AutoAutoreleasePool pool; @@ -302,22 +302,22 @@ - (void)handleAppleEvent:(NSAppleEventDescriptor *)event if (isGetURLEvent) sProcessedGetURLEvent = true; if (isGetURLEvent || ([event eventClass] == 'WWW!' && [event eventID] == 'OURL')) { - NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; - NSURL *url = [NSURL URLWithString:urlString]; + NSString* urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; + NSURL* url = [NSURL URLWithString:urlString]; [self openURL:url]; } else if ([event eventClass] == kCoreEventClass && [event eventID] == kAEOpenDocuments) { - NSAppleEventDescriptor *fileListDescriptor = [event paramDescriptorForKeyword:keyDirectObject]; + NSAppleEventDescriptor* fileListDescriptor = [event paramDescriptorForKeyword:keyDirectObject]; if (!fileListDescriptor) return; // Descriptor list indexing is one-based... NSInteger numberOfFiles = [fileListDescriptor numberOfItems]; for (NSInteger i = 1; i <= numberOfFiles; i++) { - NSString *urlString = [[fileListDescriptor descriptorAtIndex:i] stringValue]; + NSString* urlString = [[fileListDescriptor descriptorAtIndex:i] stringValue]; if (!urlString) continue; // We need a path, not a URL - NSURL *url = [NSURL URLWithString:urlString]; + NSURL* url = [NSURL URLWithString:urlString]; if (!url) continue; [self application:NSApp openFile:[url path]]; @@ -325,14 +325,14 @@ - (void)handleAppleEvent:(NSAppleEventDescriptor *)event } } -- (BOOL)application:(NSApplication *)application - willContinueUserActivityWithType:(NSString *)userActivityType { +- (BOOL)application:(NSApplication*)application + willContinueUserActivityWithType:(NSString*)userActivityType { return [userActivityType isEqualToString:NSUserActivityTypeBrowsingWeb]; } -- (BOOL)application:(NSApplication *)application - continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *))restorationHandler { +- (BOOL)application:(NSApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler { if (![userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) { return NO; } @@ -340,18 +340,18 @@ - (BOOL)application:(NSApplication *)application return [self openURL:userActivity.webpageURL]; } -- (void)application:(NSApplication *)application - didFailToContinueUserActivityWithType:(NSString *)userActivityType - error:(NSError *)error { +- (void)application:(NSApplication*)application + didFailToContinueUserActivityWithType:(NSString*)userActivityType + error:(NSError*)error { NSLog(@"Failed to continue user activity %@: %@", userActivityType, error); } -- (BOOL)openURL:(NSURL *)url { +- (BOOL)openURL:(NSURL*)url { if (!url || !url.scheme || [url.scheme caseInsensitiveCompare:@"chrome"] == NSOrderedSame) { return NO; } - const char *const urlString = [[url absoluteString] UTF8String]; + const char* const urlString = [[url absoluteString] UTF8String]; // Add the URL to any command line we're currently setting up. if (CommandLineServiceMac::AddURLToCurrentCommandLine(urlString)) { return NO; @@ -363,7 +363,7 @@ - (BOOL)openURL:(NSURL *)url { if (NS_FAILED(rv)) { return NO; } - const char *argv[3] = {nullptr, "-url", urlString}; + const char* argv[3] = {nullptr, "-url", urlString}; rv = cmdLine->Init(3, argv, workingDir, nsICommandLine::STATE_REMOTE_EXPLICIT); if (NS_FAILED(rv)) { return NO; diff --git a/toolkit/xre/MacAutoreleasePool.h b/toolkit/xre/MacAutoreleasePool.h index 43fb172346c1c..6c574beef289f 100644 --- a/toolkit/xre/MacAutoreleasePool.h +++ b/toolkit/xre/MacAutoreleasePool.h @@ -20,10 +20,10 @@ class MacAutoreleasePool { ~MacAutoreleasePool(); private: - NSAutoreleasePool *mPool; + NSAutoreleasePool* mPool; - MacAutoreleasePool(const MacAutoreleasePool &); - void operator=(const MacAutoreleasePool &); + MacAutoreleasePool(const MacAutoreleasePool&); + void operator=(const MacAutoreleasePool&); }; } // namespace mozilla diff --git a/toolkit/xre/glxtest.cpp b/toolkit/xre/glxtest.cpp index b4dc46cd8b6aa..67b1c6a75fcb6 100644 --- a/toolkit/xre/glxtest.cpp +++ b/toolkit/xre/glxtest.cpp @@ -37,11 +37,11 @@ #include "mozilla/Unused.h" // stuff from glx.h -typedef struct __GLXcontextRec *GLXContext; +typedef struct __GLXcontextRec* GLXContext; typedef XID GLXPixmap; typedef XID GLXDrawable; /* GLX 1.3 and later */ -typedef struct __GLXFBConfigRec *GLXFBConfig; +typedef struct __GLXFBConfigRec* GLXFBConfig; typedef XID GLXFBConfigID; typedef XID GLXContextID; typedef XID GLXWindow; @@ -90,17 +90,17 @@ static int write_end_of_the_pipe = -1; // to function pointer types. So the work-around is to convert first to size_t. // http://www.trilithium.com/johan/2004/12/problem-with-dlsym/ template -static func_ptr_type cast(void *ptr) { +static func_ptr_type cast(void* ptr) { return reinterpret_cast(reinterpret_cast(ptr)); } -static void fatal_error(const char *str) { +static void fatal_error(const char* str) { mozilla::Unused << write(write_end_of_the_pipe, str, strlen(str)); mozilla::Unused << write(write_end_of_the_pipe, "\n", 1); _exit(EXIT_FAILURE); } -static int x_error_handler(Display *, XErrorEvent *ev) { +static int x_error_handler(Display*, XErrorEvent* ev) { enum { bufsize = 1024 }; char buf[bufsize]; int length = snprintf(buf, bufsize, @@ -137,42 +137,42 @@ void glxtest() { #else # define LIBGL_FILENAME "libGL.so.1" #endif - void *libgl = dlopen(LIBGL_FILENAME, RTLD_LAZY); + void* libgl = dlopen(LIBGL_FILENAME, RTLD_LAZY); if (!libgl) fatal_error("Unable to load " LIBGL_FILENAME); - typedef void *(*PFNGLXGETPROCADDRESS)(const char *); + typedef void* (*PFNGLXGETPROCADDRESS)(const char*); PFNGLXGETPROCADDRESS glXGetProcAddress = cast(dlsym(libgl, "glXGetProcAddress")); if (!glXGetProcAddress) fatal_error("Unable to find glXGetProcAddress in " LIBGL_FILENAME); - typedef GLXFBConfig *(*PFNGLXQUERYEXTENSION)(Display *, int *, int *); + typedef GLXFBConfig* (*PFNGLXQUERYEXTENSION)(Display*, int*, int*); PFNGLXQUERYEXTENSION glXQueryExtension = cast(glXGetProcAddress("glXQueryExtension")); - typedef GLXFBConfig *(*PFNGLXQUERYVERSION)(Display *, int *, int *); + typedef GLXFBConfig* (*PFNGLXQUERYVERSION)(Display*, int*, int*); PFNGLXQUERYVERSION glXQueryVersion = cast(dlsym(libgl, "glXQueryVersion")); - typedef XVisualInfo *(*PFNGLXCHOOSEVISUAL)(Display *, int, int *); + typedef XVisualInfo* (*PFNGLXCHOOSEVISUAL)(Display*, int, int*); PFNGLXCHOOSEVISUAL glXChooseVisual = cast(glXGetProcAddress("glXChooseVisual")); - typedef GLXContext (*PFNGLXCREATECONTEXT)(Display *, XVisualInfo *, - GLXContext, Bool); + typedef GLXContext (*PFNGLXCREATECONTEXT)(Display*, XVisualInfo*, GLXContext, + Bool); PFNGLXCREATECONTEXT glXCreateContext = cast(glXGetProcAddress("glXCreateContext")); - typedef Bool (*PFNGLXMAKECURRENT)(Display *, GLXDrawable, GLXContext); + typedef Bool (*PFNGLXMAKECURRENT)(Display*, GLXDrawable, GLXContext); PFNGLXMAKECURRENT glXMakeCurrent = cast(glXGetProcAddress("glXMakeCurrent")); - typedef void (*PFNGLXDESTROYCONTEXT)(Display *, GLXContext); + typedef void (*PFNGLXDESTROYCONTEXT)(Display*, GLXContext); PFNGLXDESTROYCONTEXT glXDestroyContext = cast(glXGetProcAddress("glXDestroyContext")); - typedef GLubyte *(*PFNGLGETSTRING)(GLenum); + typedef GLubyte* (*PFNGLGETSTRING)(GLenum); PFNGLGETSTRING glGetString = cast(glXGetProcAddress("glGetString")); @@ -182,7 +182,7 @@ void glxtest() { fatal_error("glXGetProcAddress couldn't find required functions"); } ///// Open a connection to the X server ///// - Display *dpy = XOpenDisplay(nullptr); + Display* dpy = XOpenDisplay(nullptr); if (!dpy) fatal_error("Unable to open a connection to the X server"); ///// Check that the GLX extension is present ///// @@ -194,7 +194,7 @@ void glxtest() { ///// Get a visual ///// int attribs[] = {GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, None}; - XVisualInfo *vInfo = glXChooseVisual(dpy, DefaultScreen(dpy), attribs); + XVisualInfo* vInfo = glXChooseVisual(dpy, DefaultScreen(dpy), attribs); if (!vInfo) fatal_error("No visuals found"); // using a X11 Window instead of a GLXPixmap does not crash @@ -214,14 +214,14 @@ void glxtest() { glXMakeCurrent(dpy, window, context); ///// Look for this symbol to determine texture_from_pixmap support ///// - void *glXBindTexImageEXT = glXGetProcAddress("glXBindTexImageEXT"); + void* glXBindTexImageEXT = glXGetProcAddress("glXBindTexImageEXT"); ///// Get GL vendor/renderer/versions strings ///// enum { bufsize = 2048 }; char buf[bufsize]; - const GLubyte *versionString = glGetString(GL_VERSION); - const GLubyte *vendorString = glGetString(GL_VENDOR); - const GLubyte *rendererString = glGetString(GL_RENDERER); + const GLubyte* versionString = glGetString(GL_VERSION); + const GLubyte* vendorString = glGetString(GL_VENDOR); + const GLubyte* rendererString = glGetString(GL_RENDERER); if (!versionString || !vendorString || !rendererString) fatal_error("glGetString returned null"); @@ -235,7 +235,7 @@ void glxtest() { // If GLX_MESA_query_renderer is available, populate additional data. typedef Bool (*PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)( - int attribute, unsigned int *value); + int attribute, unsigned int* value); PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glXQueryCurrentRendererIntegerMESAProc = cast( @@ -268,11 +268,11 @@ void glxtest() { } // From Mesa's GL/internal/dri_interface.h, to be used by DRI clients. - typedef const char *(*PFNGLXGETSCREENDRIVERPROC)(Display * dpy, int scrNum); + typedef const char* (*PFNGLXGETSCREENDRIVERPROC)(Display * dpy, int scrNum); PFNGLXGETSCREENDRIVERPROC glXGetScreenDriverProc = cast(glXGetProcAddress("glXGetScreenDriver")); if (glXGetScreenDriverProc) { - const char *driDriver = glXGetScreenDriverProc(dpy, DefaultScreen(dpy)); + const char* driDriver = glXGetScreenDriverProc(dpy, DefaultScreen(dpy)); if (driDriver) { length += snprintf(buf + length, bufsize, "DRI_DRIVER\n%s\n", driDriver); if (length >= bufsize) diff --git a/toolkit/xre/nsGDKErrorHandler.cpp b/toolkit/xre/nsGDKErrorHandler.cpp index da94dc47763d0..183dfb0a8f199 100644 --- a/toolkit/xre/nsGDKErrorHandler.cpp +++ b/toolkit/xre/nsGDKErrorHandler.cpp @@ -24,12 +24,12 @@ * so we have to utilize the Gdk error handler to avoid * false alarms in Gtk3. */ -static void GdkErrorHandler(const gchar *log_domain, GLogLevelFlags log_level, - const gchar *message, gpointer user_data) { +static void GdkErrorHandler(const gchar* log_domain, GLogLevelFlags log_level, + const gchar* message, gpointer user_data) { if (strstr(message, "X Window System error")) { XErrorEvent event; nsDependentCString buffer(message); - char *endptr; + char* endptr; /* Parse Gdk X Window error message which has this format: * (Details: serial XXXX error_code XXXX request_code XXXX (XXXX) minor_code diff --git a/toolkit/xre/nsNativeAppSupportBase.cpp b/toolkit/xre/nsNativeAppSupportBase.cpp index 8dfafc3c2120e..c65b4a7289e9c 100644 --- a/toolkit/xre/nsNativeAppSupportBase.cpp +++ b/toolkit/xre/nsNativeAppSupportBase.cpp @@ -13,7 +13,7 @@ NS_IMPL_ISUPPORTS(nsNativeAppSupportBase, nsINativeAppSupport) // Start answer defaults to OK. NS_IMETHODIMP -nsNativeAppSupportBase::Start(bool *result) { +nsNativeAppSupportBase::Start(bool* result) { *result = true; return NS_OK; } diff --git a/toolkit/xre/nsNativeAppSupportUnix.cpp b/toolkit/xre/nsNativeAppSupportUnix.cpp index 5411baedf6e4a..380fbc4cb7dc4 100644 --- a/toolkit/xre/nsNativeAppSupportUnix.cpp +++ b/toolkit/xre/nsNativeAppSupportUnix.cpp @@ -70,18 +70,18 @@ typedef IceIOErrorHandler (*IceSetIOErrorHandlerFn)(IceIOErrorHandler); typedef int (*IceAddConnectionWatchFn)(IceWatchProc, IcePointer); typedef int (*IceConnectionNumberFn)(IceConn); typedef IceProcessMessagesStatus (*IceProcessMessagesFn)(IceConn, - IceReplyWaitInfo *, - Bool *); + IceReplyWaitInfo*, + Bool*); typedef IcePointer (*IceGetConnectionContextFn)(IceConn); typedef void (*SmcInteractDoneFn)(SmcConn, Bool); typedef void (*SmcSaveYourselfDoneFn)(SmcConn, Bool); typedef int (*SmcInteractRequestFn)(SmcConn, int, SmcInteractProc, SmPointer); -typedef SmcCloseStatus (*SmcCloseConnectionFn)(SmcConn, int, char **); -typedef SmcConn (*SmcOpenConnectionFn)(char *, SmPointer, int, int, - unsigned long, SmcCallbacks *, - const char *, char **, int, char *); -typedef void (*SmcSetPropertiesFn)(SmcConn, int, SmProp **); +typedef SmcCloseStatus (*SmcCloseConnectionFn)(SmcConn, int, char**); +typedef SmcConn (*SmcOpenConnectionFn)(char*, SmPointer, int, int, + unsigned long, SmcCallbacks*, + const char*, char**, int, char*); +typedef void (*SmcSetPropertiesFn)(SmcConn, int, SmProp**); static IceSetIOErrorHandlerFn IceSetIOErrorHandlerPtr; static IceAddConnectionWatchFn IceAddConnectionWatchPtr; @@ -115,7 +115,7 @@ enum ClientState { STATE_SHUTDOWN_CANCELLED }; -static const char *gClientStateTable[] = {"DISCONNECTED", "REGISTERING", "IDLE", +static const char* gClientStateTable[] = {"DISCONNECTED", "REGISTERING", "IDLE", "INTERACTING", "SHUTDOWN_CANCELLED"}; static LazyLogModule sMozSMLog("MozSM"); @@ -134,7 +134,7 @@ class nsNativeAppSupportUnix : public nsNativeAppSupportBase { void DisconnectFromSM(); #endif - NS_IMETHOD Start(bool *aRetVal) override; + NS_IMETHOD Start(bool* aRetVal) override; NS_IMETHOD Enable() override; private: @@ -169,7 +169,7 @@ static gboolean process_ice_messages(IceConn connection) { return TRUE; case IceProcessMessagesIOError: { - nsNativeAppSupportUnix *native = static_cast( + nsNativeAppSupportUnix* native = static_cast( IceGetConnectionContext(connection)); native->DisconnectFromSM(); } @@ -183,17 +183,17 @@ static gboolean process_ice_messages(IceConn connection) { } } -static gboolean ice_iochannel_watch(GIOChannel *channel, GIOCondition condition, +static gboolean ice_iochannel_watch(GIOChannel* channel, GIOCondition condition, gpointer client_data) { return process_ice_messages(static_cast(client_data)); } static void ice_connection_watch(IceConn connection, IcePointer client_data, - Bool opening, IcePointer *watch_data) { + Bool opening, IcePointer* watch_data) { guint watch_id; if (opening) { - GIOChannel *channel; + GIOChannel* channel; int fd = IceConnectionNumber(connection); fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC); @@ -227,8 +227,8 @@ static void ice_init(void) { void nsNativeAppSupportUnix::InteractCB(SmcConn smc_conn, SmPointer client_data) { - nsNativeAppSupportUnix *self = - static_cast(client_data); + nsNativeAppSupportUnix* self = + static_cast(client_data); self->SetClientState(STATE_INTERACTING); @@ -288,8 +288,8 @@ void nsNativeAppSupportUnix::SaveYourselfCB(SmcConn smc_conn, SmPointer client_data, int save_style, Bool shutdown, int interact_style, Bool fast) { - nsNativeAppSupportUnix *self = - static_cast(client_data); + nsNativeAppSupportUnix* self = + static_cast(client_data); // Expect a SaveYourselfCB if we're registering a new client. // All properties are already set in Start() so just reply with @@ -369,8 +369,8 @@ void nsNativeAppSupportUnix::DieCB(SmcConn smc_conn, SmPointer client_data) { void nsNativeAppSupportUnix::ShutdownCancelledCB(SmcConn smc_conn, SmPointer client_data) { - nsNativeAppSupportUnix *self = - static_cast(client_data); + nsNativeAppSupportUnix* self = + static_cast(client_data); // Interacting is the only time when we wouldn't already have called // SmcSaveYourselfDone. Do that now, then set the state to make sure we @@ -394,21 +394,21 @@ void nsNativeAppSupportUnix::DisconnectFromSM() { } } -static void SetSMValue(SmPropValue &val, const nsCString &data) { - val.value = static_cast(const_cast(data.get())); +static void SetSMValue(SmPropValue& val, const nsCString& data) { + val.value = static_cast(const_cast(data.get())); val.length = data.Length(); } -static void SetSMProperty(SmProp &prop, const char *name, const char *type, +static void SetSMProperty(SmProp& prop, const char* name, const char* type, int numVals, SmPropValue vals[]) { - prop.name = const_cast(name); - prop.type = const_cast(type); + prop.name = const_cast(name); + prop.type = const_cast(type); prop.num_vals = numVals; prop.vals = vals; } #endif /* MOZ_X11 */ -static void RemoveArg(char **argv) { +static void RemoveArg(char** argv) { do { *argv = *(argv + 1); ++argv; @@ -418,7 +418,7 @@ static void RemoveArg(char **argv) { } NS_IMETHODIMP -nsNativeAppSupportUnix::Start(bool *aRetVal) { +nsNativeAppSupportUnix::Start(bool* aRetVal) { NS_ASSERTION(gAppData, "gAppData must not be null."); // The dbus library is used by both nsWifiScannerDBus and BluetoothDBusService, @@ -438,9 +438,9 @@ nsNativeAppSupportUnix::Start(bool *aRetVal) { nsAutoCString prev_client_id; - char **curarg = gArgv + 1; + char** curarg = gArgv + 1; while (*curarg) { - char *arg = *curarg; + char* arg = *curarg; if (arg[0] == '-' && arg[1] == '-') { arg += 2; if (!strcmp(arg, "sm-disable")) { @@ -467,14 +467,14 @@ nsNativeAppSupportUnix::Start(bool *aRetVal) { // We don't want child processes to use the same ID unsetenv("DESKTOP_AUTOSTART_ID"); - char *client_id = nullptr; + char* client_id = nullptr; if (!sm_disable) { - PRLibrary *iceLib = PR_LoadLibrary("libICE.so.6"); + PRLibrary* iceLib = PR_LoadLibrary("libICE.so.6"); if (!iceLib) { return NS_OK; } - PRLibrary *smLib = PR_LoadLibrary("libSM.so.6"); + PRLibrary* smLib = PR_LoadLibrary("libSM.so.6"); if (!smLib) { PR_UnloadLibrary(iceLib); return NS_OK; @@ -628,7 +628,7 @@ nsNativeAppSupportUnix::Start(bool *aRetVal) { props[n++] = &propProgram; nsAutoCString userName; // username that started the program - struct passwd *pw = getpwuid(getuid()); + struct passwd* pw = getpwuid(getuid()); if (pw && pw->pw_name) { userName = pw->pw_name; } else { @@ -653,8 +653,8 @@ nsNativeAppSupportUnix::Start(bool *aRetVal) { NS_IMETHODIMP nsNativeAppSupportUnix::Enable() { return NS_OK; } -nsresult NS_CreateNativeAppSupport(nsINativeAppSupport **aResult) { - nsNativeAppSupportBase *native = new nsNativeAppSupportUnix(); +nsresult NS_CreateNativeAppSupport(nsINativeAppSupport** aResult) { + nsNativeAppSupportBase* native = new nsNativeAppSupportUnix(); if (!native) return NS_ERROR_OUT_OF_MEMORY; *aResult = native; diff --git a/toolkit/xre/nsNativeAppSupportWin.cpp b/toolkit/xre/nsNativeAppSupportWin.cpp index 881ba02ccd649..02c2d39c38eb4 100644 --- a/toolkit/xre/nsNativeAppSupportWin.cpp +++ b/toolkit/xre/nsNativeAppSupportWin.cpp @@ -55,8 +55,8 @@ void nsNativeAppSupportWin::CheckConsole() { } // Create and return an instance of class nsNativeAppSupportWin. -nsresult NS_CreateNativeAppSupport(nsINativeAppSupport **aResult) { - nsNativeAppSupportWin *pNative = new nsNativeAppSupportWin; +nsresult NS_CreateNativeAppSupport(nsINativeAppSupport** aResult) { + nsNativeAppSupportWin* pNative = new nsNativeAppSupportWin; if (!pNative) return NS_ERROR_OUT_OF_MEMORY; // Check for dynamic console creation request. diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp index 690c787c5d2db..3c05c79f8a700 100644 --- a/toolkit/xre/nsSigHandlers.cpp +++ b/toolkit/xre/nsSigHandlers.cpp @@ -58,7 +58,7 @@ unsigned int _gdb_sleep_duration = 300; # include "nsISupportsUtils.h" # include "mozilla/StackWalk.h" -static const char *gProgname = "huh?"; +static const char* gProgname = "huh?"; // NB: keep me up to date with the same variable in // ipc/chromium/chrome/common/ipc_channel_posix.cc @@ -66,8 +66,8 @@ static const int kClientChannelFd = 3; extern "C" { -static void PrintStackFrame(uint32_t aFrameNumber, void *aPC, void *aSP, - void *aClosure) { +static void PrintStackFrame(uint32_t aFrameNumber, void* aPC, void* aSP, + void* aClosure) { char buf[1024]; MozCodeAddressDetails details; @@ -119,13 +119,13 @@ void child_ah_crap_handler(int signum) { static GLogFunc orig_log_func = nullptr; extern "C" { -static void my_glib_log_func(const gchar *log_domain, GLogLevelFlags log_level, - const gchar *message, gpointer user_data); +static void my_glib_log_func(const gchar* log_domain, GLogLevelFlags log_level, + const gchar* message, gpointer user_data); } -/* static */ void my_glib_log_func(const gchar *log_domain, +/* static */ void my_glib_log_func(const gchar* log_domain, GLogLevelFlags log_level, - const gchar *message, gpointer user_data) { + const gchar* message, gpointer user_data) { if (log_level & (G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION)) { NS_DebugBreak(NS_DEBUG_ASSERTION, message, "glib assertion", __FILE__, @@ -141,7 +141,7 @@ static void my_glib_log_func(const gchar *log_domain, GLogLevelFlags log_level, # endif # ifdef SA_SIGINFO -static void fpehandler(int signum, siginfo_t *si, void *context) { +static void fpehandler(int signum, siginfo_t* si, void* context) { /* Integer divide by zero or integer overflow. */ /* Note: FPE_INTOVF is ignored on Intel, PowerPC and SPARC systems. */ if (si->si_code == FPE_INTDIV || si->si_code == FPE_INTOVF) { @@ -150,19 +150,19 @@ static void fpehandler(int signum, siginfo_t *si, void *context) { } # ifdef XP_MACOSX - ucontext_t *uc = (ucontext_t *)context; + ucontext_t* uc = (ucontext_t*)context; # if defined(__i386__) || defined(__amd64__) - _STRUCT_FP_CONTROL *ctrl = &uc->uc_mcontext->__fs.__fpu_fcw; + _STRUCT_FP_CONTROL* ctrl = &uc->uc_mcontext->__fs.__fpu_fcw; ctrl->__invalid = ctrl->__denorm = ctrl->__zdiv = ctrl->__ovrfl = ctrl->__undfl = ctrl->__precis = 1; - _STRUCT_FP_STATUS *status = &uc->uc_mcontext->__fs.__fpu_fsw; + _STRUCT_FP_STATUS* status = &uc->uc_mcontext->__fs.__fpu_fsw; status->__invalid = status->__denorm = status->__zdiv = status->__ovrfl = status->__undfl = status->__precis = status->__stkflt = status->__errsumm = 0; - uint32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr; + uint32_t* mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr; *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */ *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */ # endif @@ -170,53 +170,53 @@ static void fpehandler(int signum, siginfo_t *si, void *context) { # if defined(LINUX) && !defined(ANDROID) # if defined(__i386__) - ucontext_t *uc = (ucontext_t *)context; + ucontext_t* uc = (ucontext_t*)context; /* * It seems that we have no access to mxcsr on Linux. libc * seems to be translating cw/sw to mxcsr. */ - unsigned long int *cw = &uc->uc_mcontext.fpregs->cw; + unsigned long int* cw = &uc->uc_mcontext.fpregs->cw; *cw |= FPU_EXCEPTION_MASK; - unsigned long int *sw = &uc->uc_mcontext.fpregs->sw; + unsigned long int* sw = &uc->uc_mcontext.fpregs->sw; *sw &= ~FPU_STATUS_FLAGS; # endif # if defined(__amd64__) - ucontext_t *uc = (ucontext_t *)context; + ucontext_t* uc = (ucontext_t*)context; - uint16_t *cw = &uc->uc_mcontext.fpregs->cwd; + uint16_t* cw = &uc->uc_mcontext.fpregs->cwd; *cw |= FPU_EXCEPTION_MASK; - uint16_t *sw = &uc->uc_mcontext.fpregs->swd; + uint16_t* sw = &uc->uc_mcontext.fpregs->swd; *sw &= ~FPU_STATUS_FLAGS; - uint32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr; + uint32_t* mxcsr = &uc->uc_mcontext.fpregs->mxcsr; *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */ *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */ # endif # endif # ifdef SOLARIS - ucontext_t *uc = (ucontext_t *)context; + ucontext_t* uc = (ucontext_t*)context; # if defined(__i386) - uint32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0]; + uint32_t* cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0]; *cw |= FPU_EXCEPTION_MASK; - uint32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1]; + uint32_t* sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1]; *sw &= ~FPU_STATUS_FLAGS; /* address of the instruction that caused the exception */ - uint32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3]; + uint32_t* ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3]; uc->uc_mcontext.gregs[REG_PC] = *ip; # endif # if defined(__amd64__) - uint16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw; + uint16_t* cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw; *cw |= FPU_EXCEPTION_MASK; - uint16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw; + uint16_t* sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw; *sw &= ~FPU_STATUS_FLAGS; - uint32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr; + uint32_t* mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr; *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */ *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */ # endif @@ -224,15 +224,15 @@ static void fpehandler(int signum, siginfo_t *si, void *context) { } # endif -void InstallSignalHandlers(const char *aProgname) { +void InstallSignalHandlers(const char* aProgname) { # if defined(CRAWL_STACK_ON_SIGSEGV) - const char *tmp = PL_strdup(aProgname); + const char* tmp = PL_strdup(aProgname); if (tmp) { gProgname = tmp; } # endif // CRAWL_STACK_ON_SIGSEGV - const char *gdbSleep = PR_GetEnv("MOZ_GDB_SLEEP"); + const char* gdbSleep = PR_GetEnv("MOZ_GDB_SLEEP"); if (gdbSleep && *gdbSleep) { unsigned int s; if (1 == sscanf(gdbSleep, "%u", &s)) { @@ -271,7 +271,7 @@ void InstallSignalHandlers(const char *aProgname) { } # if defined(DEBUG) && defined(LINUX) - const char *memLimit = PR_GetEnv("MOZ_MEM_LIMIT"); + const char* memLimit = PR_GetEnv("MOZ_MEM_LIMIT"); if (memLimit && *memLimit) { long m = atoi(memLimit); m *= (1024 * 1024); @@ -285,7 +285,7 @@ void InstallSignalHandlers(const char *aProgname) { # if defined(MOZ_WIDGET_GTK) && \ (GLIB_MAJOR_VERSION > 2 || \ (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6)) - const char *assertString = PR_GetEnv("XPCOM_DEBUG_BREAK"); + const char* assertString = PR_GetEnv("XPCOM_DEBUG_BREAK"); if (assertString && (!strcmp(assertString, "suspend") || !strcmp(assertString, "stack") || !strcmp(assertString, "abort") || !strcmp(assertString, "trap") || @@ -305,7 +305,7 @@ void InstallSignalHandlers(const char *aProgname) { * WinNT.h prior to SDK7 does not expose the structure of the ExtendedRegisters * for ia86. We known that MxCsr is at offset 0x18 and is a DWORD. */ -# define MXCSR(ctx) (*(DWORD *)(((BYTE *)(ctx)->ExtendedRegisters) + 0x18)) +# define MXCSR(ctx) (*(DWORD*)(((BYTE*)(ctx)->ExtendedRegisters) + 0x18)) # endif # ifdef _M_X64 @@ -326,7 +326,7 @@ static LPTOP_LEVEL_EXCEPTION_FILTER gFPEPreviousFilter; LONG __stdcall FpeHandler(PEXCEPTION_POINTERS pe) { PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)pe->ExceptionRecord; - CONTEXT *c = (CONTEXT *)pe->ContextRecord; + CONTEXT* c = (CONTEXT*)pe->ContextRecord; switch (e->ExceptionCode) { case STATUS_FLOAT_DENORMAL_OPERAND: @@ -356,13 +356,13 @@ LONG __stdcall FpeHandler(PEXCEPTION_POINTERS pe) { return action; } -void InstallSignalHandlers(const char *aProgname) { +void InstallSignalHandlers(const char* aProgname) { gFPEPreviousFilter = SetUnhandledExceptionFilter(FpeHandler); } # else -void InstallSignalHandlers(const char *aProgname) {} +void InstallSignalHandlers(const char* aProgname) {} # endif diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index 0ca395fe46cd2..6ef799f0ce316 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -73,7 +73,7 @@ static LazyLogModule sUpdateLog("updatedriver"); #endif #ifdef XP_MACOSX -static void UpdateDriverSetupMacCommandLine(int &argc, char **&argv, +static void UpdateDriverSetupMacCommandLine(int& argc, char**& argv, bool restart) { if (NS_IsMainThread()) { CommandLineServiceMac::SetupMacCommandLine(argc, argv, restart); @@ -112,7 +112,7 @@ static void UpdateDriverSetupMacCommandLine(int &argc, char **&argv, } #endif -static nsresult GetCurrentWorkingDir(char *buf, size_t size) { +static nsresult GetCurrentWorkingDir(char* buf, size_t size) { // Cannot use NS_GetSpecialDirectory because XPCOM is not yet initialized. // This code is duplicated from xpcom/io/SpecialSystemDirectory.cpp: @@ -134,7 +134,7 @@ static nsresult GetCurrentWorkingDir(char *buf, size_t size) { * @param appDir the application directory file object * @param installDirPath the path to the installation directory */ -static nsresult GetInstallDirPath(nsIFile *appDir, nsACString &installDirPath) { +static nsresult GetInstallDirPath(nsIFile* appDir, nsACString& installDirPath) { nsresult rv; #ifdef XP_MACOSX nsCOMPtr parentDir1, parentDir2; @@ -163,8 +163,8 @@ static nsresult GetInstallDirPath(nsIFile *appDir, nsACString &installDirPath) { return NS_OK; } -static bool GetFile(nsIFile *dir, const nsACString &name, - nsCOMPtr &result) { +static bool GetFile(nsIFile* dir, const nsACString& name, + nsCOMPtr& result) { nsresult rv; nsCOMPtr file; @@ -178,7 +178,7 @@ static bool GetFile(nsIFile *dir, const nsACString &name, return true; } -static bool GetStatusFile(nsIFile *dir, nsCOMPtr &result) { +static bool GetStatusFile(nsIFile* dir, nsCOMPtr& result) { return GetFile(dir, NS_LITERAL_CSTRING("update.status"), result); } @@ -191,12 +191,12 @@ static bool GetStatusFile(nsIFile *dir, nsCOMPtr &result) { * @return true if successful, false otherwise. */ template -static bool GetStatusFileContents(nsIFile *statusFile, char (&buf)[Size]) { +static bool GetStatusFileContents(nsIFile* statusFile, char (&buf)[Size]) { static_assert( Size > 16, "Buffer needs to be large enough to hold the known status codes"); - PRFileDesc *fd = nullptr; + PRFileDesc* fd = nullptr; nsresult rv = statusFile->OpenNSPRFileDesc(PR_RDONLY, 0660, &fd); if (NS_FAILED(rv)) return false; @@ -224,8 +224,8 @@ typedef enum { * * @return the update action to be performed. */ -static UpdateStatus GetUpdateStatus(nsIFile *dir, - nsCOMPtr &statusFile) { +static UpdateStatus GetUpdateStatus(nsIFile* dir, + nsCOMPtr& statusFile) { if (GetStatusFile(dir, statusFile)) { char buf[32]; if (GetStatusFileContents(statusFile, buf)) { @@ -254,14 +254,14 @@ static UpdateStatus GetUpdateStatus(nsIFile *dir, return eNoUpdateAction; } -static bool GetVersionFile(nsIFile *dir, nsCOMPtr &result) { +static bool GetVersionFile(nsIFile* dir, nsCOMPtr& result) { return GetFile(dir, NS_LITERAL_CSTRING("update.version"), result); } // Compares the current application version with the update's application // version. -static bool IsOlderVersion(nsIFile *versionFile, const char *appVersion) { - PRFileDesc *fd = nullptr; +static bool IsOlderVersion(nsIFile* versionFile, const char* appVersion) { + PRFileDesc* fd = nullptr; nsresult rv = versionFile->OpenNSPRFileDesc(PR_RDONLY, 0660, &fd); if (NS_FAILED(rv)) return true; @@ -285,8 +285,8 @@ static bool IsOlderVersion(nsIFile *versionFile, const char *appVersion) { } #if defined(XP_MACOSX) -static bool CopyFileIntoUpdateDir(nsIFile *parentDir, const nsACString &leaf, - nsIFile *updateDir) { +static bool CopyFileIntoUpdateDir(nsIFile* parentDir, const nsACString& leaf, + nsIFile* updateDir) { nsCOMPtr file; // Make sure there is not an existing file in the target location. @@ -307,9 +307,9 @@ static bool CopyFileIntoUpdateDir(nsIFile *parentDir, const nsACString &leaf, return true; } -static bool CopyUpdaterIntoUpdateDir(nsIFile *greDir, nsIFile *appDir, - nsIFile *updateDir, - nsCOMPtr &updater) { +static bool CopyUpdaterIntoUpdateDir(nsIFile* greDir, nsIFile* appDir, + nsIFile* updateDir, + nsCOMPtr& updater) { // Copy the updater application from the GRE and the updater ini from the app. if (!CopyFileIntoUpdateDir(appDir, NS_LITERAL_CSTRING(UPDATER_APP), updateDir)) @@ -344,9 +344,9 @@ static bool CopyUpdaterIntoUpdateDir(nsIFile *greDir, nsIFile *appDir, * @param outpid (out) parameter holding the handle to the updater application * when staging updates */ -static void ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *appDir, - int appArgc, char **appArgv, bool restart, - bool isStaged, ProcessType *outpid) { +static void ApplyUpdate(nsIFile* greDir, nsIFile* updateDir, nsIFile* appDir, + int appArgc, char** appArgv, bool restart, + bool isStaged, ProcessType* outpid) { // The following determines the update operation to perform. // 1. When restart is false the update will be staged. // 2. When restart is true and isStaged is false the update will apply the mar @@ -566,25 +566,25 @@ static void ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *appDir, argc += 1; } } - char **argv = static_cast(malloc((argc + 1) * sizeof(char *))); + char** argv = static_cast(malloc((argc + 1) * sizeof(char*))); if (!argv) { return; } - argv[0] = (char *)updaterPath.get(); - argv[1] = (char *)updateDirPath.get(); - argv[2] = (char *)installDirPath.get(); - argv[3] = (char *)applyToDirPath.get(); - argv[4] = (char *)pid.get(); + argv[0] = (char*)updaterPath.get(); + argv[1] = (char*)updateDirPath.get(); + argv[2] = (char*)installDirPath.get(); + argv[3] = (char*)applyToDirPath.get(); + argv[4] = (char*)pid.get(); if (restart && appArgc) { argv[5] = workingDirPath; - argv[6] = (char *)appFilePath.get(); + argv[6] = (char*)appFilePath.get(); for (int i = 1; i < appArgc; ++i) { argv[6 + i] = appArgv[i]; } if (gRestartedByOS) { // We haven't truly started up, restore this argument so that we will have // it upon restart. - argv[6 + appArgc] = const_cast("-os-restarted"); + argv[6 + appArgc] = const_cast("-os-restarted"); } } argv[argc] = nullptr; @@ -710,9 +710,9 @@ static bool ProcessHasTerminated(ProcessType pt) { #endif } -nsresult ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir, - int argc, char **argv, const char *appVersion, - bool restart, ProcessType *pid) { +nsresult ProcessUpdates(nsIFile* greDir, nsIFile* appDir, nsIFile* updRootDir, + int argc, char** argv, const char* appVersion, + bool restart, ProcessType* pid) { nsresult rv; nsCOMPtr updatesDir; @@ -855,8 +855,8 @@ nsUpdateProcessor::FixUpdateDirectoryPerms(bool aShouldUseService) { class FixUpdateDirectoryPermsRunnable final : public mozilla::Runnable { public: - FixUpdateDirectoryPermsRunnable(const char *aName, bool aShouldUseService, - const nsAutoString &aInstallPath) + FixUpdateDirectoryPermsRunnable(const char* aName, bool aShouldUseService, + const nsAutoString& aInstallPath) : Runnable(aName), mShouldUseService(aShouldUseService), mState(State::Initializing) { diff --git a/toolkit/xre/nsUpdateDriver.h b/toolkit/xre/nsUpdateDriver.h index fded83dd1f781..cc85d95bfd044 100644 --- a/toolkit/xre/nsUpdateDriver.h +++ b/toolkit/xre/nsUpdateDriver.h @@ -23,7 +23,7 @@ typedef HANDLE ProcessType; typedef pid_t ProcessType; #else # include "prproces.h" -typedef PRProcess *ProcessType; +typedef PRProcess* ProcessType; #endif /** @@ -46,9 +46,9 @@ typedef PRProcess *ProcessType; * * This function does not modify appDir. */ -nsresult ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir, - int argc, char **argv, const char *appVersion, - bool restart = true, ProcessType *pid = nullptr); +nsresult ProcessUpdates(nsIFile* greDir, nsIFile* appDir, nsIFile* updRootDir, + int argc, char** argv, const char* appVersion, + bool restart = true, ProcessType* pid = nullptr); // The implementation of the update processor handles the task of loading the // updater application for staging an update. @@ -77,7 +77,7 @@ class nsUpdateProcessor final : public nsIUpdateProcessor { nsCOMPtr mAppDir; nsCOMPtr mUpdateRoot; int mArgc; - char **mArgv; + char** mArgv; nsCString mAppVersion; }; diff --git a/toolkit/xre/nsWindowsRestart.cpp b/toolkit/xre/nsWindowsRestart.cpp index 901c34d17723a..a1e9401231ac8 100644 --- a/toolkit/xre/nsWindowsRestart.cpp +++ b/toolkit/xre/nsWindowsRestart.cpp @@ -27,20 +27,20 @@ * Convert UTF8 to UTF16 without using the normal XPCOM goop, which we * can't link to updater.exe. */ -static char16_t *AllocConvertUTF8toUTF16(const char *arg) { +static char16_t* AllocConvertUTF8toUTF16(const char* arg) { // UTF16 can't be longer in units than UTF8 size_t len = strlen(arg); - char16_t *s = new char16_t[(len + 1) * sizeof(char16_t)]; + char16_t* s = new char16_t[(len + 1) * sizeof(char16_t)]; if (!s) return nullptr; size_t dstLen = ::MultiByteToWideChar(CP_UTF8, 0, arg, len, - reinterpret_cast(s), len); + reinterpret_cast(s), len); s[dstLen] = 0; return s; } -static void FreeAllocStrings(int argc, wchar_t **argv) { +static void FreeAllocStrings(int argc, wchar_t** argv) { while (argc) { --argc; delete[] argv[argc]; @@ -49,13 +49,13 @@ static void FreeAllocStrings(int argc, wchar_t **argv) { delete[] argv; } -static wchar_t **AllocConvertUTF8toUTF16Strings(int argc, char **argv) { - wchar_t **argvConverted = new wchar_t *[argc]; +static wchar_t** AllocConvertUTF8toUTF16Strings(int argc, char** argv) { + wchar_t** argvConverted = new wchar_t*[argc]; if (!argvConverted) return nullptr; for (int i = 0; i < argc; ++i) { argvConverted[i] = - reinterpret_cast(AllocConvertUTF8toUTF16(argv[i])); + reinterpret_cast(AllocConvertUTF8toUTF16(argv[i])); if (!argvConverted[i]) { FreeAllocStrings(i, argvConverted); return nullptr; @@ -70,12 +70,12 @@ static wchar_t **AllocConvertUTF8toUTF16Strings(int argc, char **argv) { * @note The form of this function that takes char **argv expects UTF-8 */ -BOOL WinLaunchChild(const wchar_t *exePath, int argc, wchar_t **argv, - HANDLE userToken = nullptr, HANDLE *hProcess = nullptr); +BOOL WinLaunchChild(const wchar_t* exePath, int argc, wchar_t** argv, + HANDLE userToken = nullptr, HANDLE* hProcess = nullptr); -BOOL WinLaunchChild(const wchar_t *exePath, int argc, char **argv, - HANDLE userToken, HANDLE *hProcess) { - wchar_t **argvConverted = AllocConvertUTF8toUTF16Strings(argc, argv); +BOOL WinLaunchChild(const wchar_t* exePath, int argc, char** argv, + HANDLE userToken, HANDLE* hProcess) { + wchar_t** argvConverted = AllocConvertUTF8toUTF16Strings(argc, argv); if (!argvConverted) return FALSE; BOOL ok = WinLaunchChild(exePath, argc, argvConverted, userToken, hProcess); @@ -83,8 +83,8 @@ BOOL WinLaunchChild(const wchar_t *exePath, int argc, char **argv, return ok; } -BOOL WinLaunchChild(const wchar_t *exePath, int argc, wchar_t **argv, - HANDLE userToken, HANDLE *hProcess) { +BOOL WinLaunchChild(const wchar_t* exePath, int argc, wchar_t** argv, + HANDLE userToken, HANDLE* hProcess) { BOOL ok; mozilla::UniquePtr cl(mozilla::MakeCommandLine(argc, argv)); @@ -143,7 +143,7 @@ BOOL WinLaunchChild(const wchar_t *exePath, int argc, wchar_t **argv, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, nullptr); wprintf(L"Error restarting: %s\n", - lpMsgBuf ? static_cast(lpMsgBuf) : L"(null)"); + lpMsgBuf ? static_cast(lpMsgBuf) : L"(null)"); if (lpMsgBuf) LocalFree(lpMsgBuf); } diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp index 4e9d40b7acc32..109c53cac9830 100644 --- a/toolkit/xre/nsWindowsWMain.cpp +++ b/toolkit/xre/nsWindowsWMain.cpp @@ -26,12 +26,12 @@ # include -int wmain(int argc, WCHAR **argv); +int wmain(int argc, WCHAR** argv); -int main(int argc, char **argv) { +int main(int argc, char** argv) { LPWSTR commandLine = GetCommandLineW(); int argcw = 0; - LPWSTR *argvw = CommandLineToArgvW(commandLine, &argcw); + LPWSTR* argvw = CommandLineToArgvW(commandLine, &argcw); if (!argvw) return 127; int result = wmain(argcw, argvw); @@ -43,20 +43,20 @@ int main(int argc, char **argv) { #define main NS_internal_main #ifndef XRE_WANT_ENVIRON -int main(int argc, char **argv); +int main(int argc, char** argv); #else -int main(int argc, char **argv, char **envp); +int main(int argc, char** argv, char** envp); #endif static void SanitizeEnvironmentVariables() { DWORD bufferSize = GetEnvironmentVariableW(L"PATH", nullptr, 0); if (bufferSize) { - wchar_t *originalPath = new wchar_t[bufferSize]; + wchar_t* originalPath = new wchar_t[bufferSize]; if (bufferSize - 1 == GetEnvironmentVariableW(L"PATH", originalPath, bufferSize)) { bufferSize = ExpandEnvironmentStringsW(originalPath, nullptr, 0); if (bufferSize) { - wchar_t *newPath = new wchar_t[bufferSize]; + wchar_t* newPath = new wchar_t[bufferSize]; if (ExpandEnvironmentStringsW(originalPath, newPath, bufferSize)) { SetEnvironmentVariableW(L"PATH", newPath); } @@ -67,13 +67,13 @@ static void SanitizeEnvironmentVariables() { } } -static char *AllocConvertUTF16toUTF8(char16ptr_t arg) { +static char* AllocConvertUTF16toUTF8(char16ptr_t arg) { // be generous... UTF16 units can expand up to 3 UTF8 units size_t len = wcslen(arg); // ConvertUTF16toUTF8 requires +1. Let's do that here, too, lacking // knowledge of Windows internals. size_t dstLen = len * 3 + 1; - char *s = new char[dstLen + 1]; // Another +1 for zero terminator + char* s = new char[dstLen + 1]; // Another +1 for zero terminator if (!s) return nullptr; int written = @@ -82,7 +82,7 @@ static char *AllocConvertUTF16toUTF8(char16ptr_t arg) { return s; } -static void FreeAllocStrings(int argc, char **argv) { +static void FreeAllocStrings(int argc, char** argv) { while (argc) { --argc; delete[] argv[argc]; @@ -91,7 +91,7 @@ static void FreeAllocStrings(int argc, char **argv) { delete[] argv; } -int wmain(int argc, WCHAR **argv) { +int wmain(int argc, WCHAR** argv) { SanitizeEnvironmentVariables(); SetDllDirectoryW(L""); @@ -105,7 +105,7 @@ int wmain(int argc, WCHAR **argv) { } #endif // defined(mozilla_LauncherProcessWin_h) - char **argvConverted = new char *[argc + 1]; + char** argvConverted = new char*[argc + 1]; if (!argvConverted) return 127; for (int i = 0; i < argc; ++i) { @@ -117,7 +117,7 @@ int wmain(int argc, WCHAR **argv) { argvConverted[argc] = nullptr; // need to save argvConverted copy for later deletion. - char **deleteUs = new char *[argc + 1]; + char** deleteUs = new char*[argc + 1]; if (!deleteUs) { FreeAllocStrings(argc, argvConverted); return 127; diff --git a/toolkit/xre/nsX11ErrorHandler.cpp b/toolkit/xre/nsX11ErrorHandler.cpp index 22052640a218d..3ba6d696fa7a3 100644 --- a/toolkit/xre/nsX11ErrorHandler.cpp +++ b/toolkit/xre/nsX11ErrorHandler.cpp @@ -16,7 +16,7 @@ #define BUFSIZE 2048 // What Xlib uses with XGetErrorDatabaseText extern "C" { -int X11Error(Display *display, XErrorEvent *event) { +int X11Error(Display* display, XErrorEvent* event) { // Get an indication of how long ago the request that caused the error was // made. unsigned long age = NextRequest(display) - event->serial; @@ -35,10 +35,10 @@ int X11Error(Display *display, XErrorEvent *event) { // temporary Display to request extension information. This assumes on // the DISPLAY environment variable has been set and matches what was used // to open |display|. - Display *tmpDisplay = XOpenDisplay(nullptr); + Display* tmpDisplay = XOpenDisplay(nullptr); if (tmpDisplay) { int nExts; - char **extNames = XListExtensions(tmpDisplay, &nExts); + char** extNames = XListExtensions(tmpDisplay, &nExts); int first_error; if (extNames) { for (int i = 0; i < nExts; ++i) { @@ -138,7 +138,7 @@ int X11Error(Display *display, XErrorEvent *event) { void InstallX11ErrorHandler() { XSetErrorHandler(X11Error); - Display *display = mozilla::DefaultXDisplay(); + Display* display = mozilla::DefaultXDisplay(); NS_ASSERTION(display, "No X display"); if (PR_GetEnv("MOZ_X_SYNC")) { XSynchronize(display, X11True); diff --git a/toolkit/xre/nsX11ErrorHandler.h b/toolkit/xre/nsX11ErrorHandler.h index 27e271a969522..246ef061ca1c3 100644 --- a/toolkit/xre/nsX11ErrorHandler.h +++ b/toolkit/xre/nsX11ErrorHandler.h @@ -13,5 +13,5 @@ **/ void InstallX11ErrorHandler(); -extern "C" int X11Error(Display *display, XErrorEvent *event); +extern "C" int X11Error(Display* display, XErrorEvent* event); #endif diff --git a/toolkit/xre/test/win/TestXREMakeCommandLineWin.cpp b/toolkit/xre/test/win/TestXREMakeCommandLineWin.cpp index c66e18996f091..c12550c3d6243 100644 --- a/toolkit/xre/test/win/TestXREMakeCommandLineWin.cpp +++ b/toolkit/xre/test/win/TestXREMakeCommandLineWin.cpp @@ -41,7 +41,7 @@ // accomplished by converting inCmdLine to an argument list with // CommandLineToArgvW and converting it back to a command line with // MakeCommandLine. -static int verifyCmdLineCreation(wchar_t *inCmdLine, wchar_t *compareCmdLine, +static int verifyCmdLineCreation(wchar_t* inCmdLine, wchar_t* compareCmdLine, bool passes, int testNum) { int rv = 0; int i; @@ -61,18 +61,18 @@ static int verifyCmdLineCreation(wchar_t *inCmdLine, wchar_t *compareCmdLine, // handles argv[0] differently than other arguments since argv[0] is the path // to the binary being executed and MakeCommandLine only handles argv[1] and // larger. - wchar_t *inCmdLineNew = (wchar_t *)malloc( + wchar_t* inCmdLineNew = (wchar_t*)malloc( (wcslen(DUMMY_ARG1) + wcslen(inCmdLine) + 1) * sizeof(wchar_t)); wcscpy(inCmdLineNew, DUMMY_ARG1); wcscat(inCmdLineNew, inCmdLine); - LPWSTR *inArgv = CommandLineToArgvW(inCmdLineNew, &inArgc); + LPWSTR* inArgv = CommandLineToArgvW(inCmdLineNew, &inArgc); auto outCmdLine = mozilla::MakeCommandLine(inArgc - 1, inArgv + 1); - wchar_t *outCmdLineNew = (wchar_t *)malloc( + wchar_t* outCmdLineNew = (wchar_t*)malloc( (wcslen(DUMMY_ARG1) + wcslen(outCmdLine.get()) + 1) * sizeof(wchar_t)); wcscpy(outCmdLineNew, DUMMY_ARG1); wcscat(outCmdLineNew, outCmdLine.get()); - LPWSTR *outArgv = CommandLineToArgvW(outCmdLineNew, &outArgc); + LPWSTR* outArgv = CommandLineToArgvW(outCmdLineNew, &outArgc); if (VERBOSE) { wprintf(L"\n"); @@ -155,7 +155,7 @@ static int verifyCmdLineCreation(wchar_t *inCmdLine, wchar_t *compareCmdLine, return rv; } -int wmain(int argc, wchar_t *argv[]) { +int wmain(int argc, wchar_t* argv[]) { int i; int rv = 0; @@ -175,7 +175,7 @@ int wmain(int argc, wchar_t *argv[]) { return 2; } - WCHAR *slash = wcsrchr(inifile, '\\'); + WCHAR* slash = wcsrchr(inifile, '\\'); if (!slash) { wprintf(L"TEST-UNEXPECTED-FAIL | %s | wcsrchr\n", TEST_NAME); return 3; @@ -253,10 +253,10 @@ int wmain(int argc, wchar_t *argv[]) { # include -int main(int argc, char **argv) { +int main(int argc, char** argv) { LPWSTR commandLine = GetCommandLineW(); int argcw = 0; - LPWSTR *argvw = CommandLineToArgvW(commandLine, &argcw); + LPWSTR* argvw = CommandLineToArgvW(commandLine, &argcw); if (!argvw) return 127; int result = wmain(argcw, argvw); diff --git a/tools/crashreporter/minidump_stackwalk/minidump_stackwalk.cc b/tools/crashreporter/minidump_stackwalk/minidump_stackwalk.cc index 1be341fc9bf5c..f43cf14a0178d 100644 --- a/tools/crashreporter/minidump_stackwalk/minidump_stackwalk.cc +++ b/tools/crashreporter/minidump_stackwalk/minidump_stackwalk.cc @@ -83,8 +83,8 @@ using google_breakpad::SimpleSymbolSupplier; // information if the minidump was produced as a result of a crash, and // call stacks for each thread contained in the minidump. All information // is printed to stdout. -bool PrintMinidumpProcess(const string &minidump_file, - const std::vector &symbol_args, +bool PrintMinidumpProcess(const string& minidump_file, + const std::vector& symbol_args, bool machine_readable, bool output_stack_contents) { std::vector server_paths; std::vector symbol_paths; @@ -151,7 +151,7 @@ bool PrintMinidumpProcess(const string &minidump_file, return true; } -void usage(const char *program_name) { +void usage(const char* program_name) { fprintf(stderr, "usage: %s [-m|-s] [ | " "]+\n" @@ -162,7 +162,7 @@ void usage(const char *program_name) { } // namespace -int main(int argc, char **argv) { +int main(int argc, char** argv) { BPLOG_INIT(&argc, &argv); if (argc < 2) { @@ -170,7 +170,7 @@ int main(int argc, char **argv) { return 1; } - const char *minidump_file; + const char* minidump_file; bool machine_readable = false; bool output_stack_contents = false; int symbol_path_arg; diff --git a/tools/fuzzing/interface/harness/FuzzerTestHarness.h b/tools/fuzzing/interface/harness/FuzzerTestHarness.h index cc54f7eecb5a8..64ad959d98697 100644 --- a/tools/fuzzing/interface/harness/FuzzerTestHarness.h +++ b/tools/fuzzing/interface/harness/FuzzerTestHarness.h @@ -42,7 +42,7 @@ static uint32_t gFailCount = 0; * "TEST-UNEXPECTED-FAIL " for the benefit of the test harness and * appending "\n" to eliminate having to type it at each call site. */ -MOZ_FORMAT_PRINTF(1, 2) void fail(const char *msg, ...) { +MOZ_FORMAT_PRINTF(1, 2) void fail(const char* msg, ...) { va_list ap; printf("TEST-UNEXPECTED-FAIL | "); @@ -61,8 +61,8 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2 { public: NS_DECL_ISUPPORTS - explicit ScopedXPCOM(const char *testName, - nsIDirectoryServiceProvider *dirSvcProvider = nullptr) + explicit ScopedXPCOM(const char* testName, + nsIDirectoryServiceProvider* dirSvcProvider = nullptr) : mDirSvcProvider(dirSvcProvider) { mTestName = testName; printf("Running %s tests...\n", mTestName); @@ -145,7 +145,7 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2 { return copy.forget(); } - char *env = PR_GetEnv("MOZ_XRE_DIR"); + char* env = PR_GetEnv("MOZ_XRE_DIR"); nsCOMPtr greD; if (env) { NS_NewLocalFile(NS_ConvertUTF8toUTF16(env), false, getter_AddRefs(greD)); @@ -182,8 +182,8 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2 { //////////////////////////////////////////////////////////////////////////// //// nsIDirectoryServiceProvider - NS_IMETHODIMP GetFile(const char *aProperty, bool *_persistent, - nsIFile **_result) override { + NS_IMETHODIMP GetFile(const char* aProperty, bool* _persistent, + nsIFile** _result) override { // If we were supplied a directory service provider, ask it first. if (mDirSvcProvider && NS_SUCCEEDED(mDirSvcProvider->GetFile( aProperty, _persistent, _result))) { @@ -226,8 +226,8 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2 { //////////////////////////////////////////////////////////////////////////// //// nsIDirectoryServiceProvider2 - NS_IMETHODIMP GetFiles(const char *aProperty, - nsISimpleEnumerator **_enum) override { + NS_IMETHODIMP GetFiles(const char* aProperty, + nsISimpleEnumerator** _enum) override { // If we were supplied a directory service provider, ask it first. nsCOMPtr provider = do_QueryInterface(mDirSvcProvider); @@ -239,8 +239,8 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2 { } private: - const char *mTestName; - nsIServiceManager *mServMgr; + const char* mTestName; + nsIServiceManager* mServMgr; nsCOMPtr mDirSvcProvider; nsCOMPtr mProfD; nsCOMPtr mGRED; diff --git a/tools/jprof/bfd.cpp b/tools/jprof/bfd.cpp index 8861bd6c92c89..6be8fde760476 100644 --- a/tools/jprof/bfd.cpp +++ b/tools/jprof/bfd.cpp @@ -14,7 +14,7 @@ # include # include -static bfd *try_debug_file(const char *filename, unsigned long crc32) { +static bfd* try_debug_file(const char* filename, unsigned long crc32) { int fd = open(filename, O_RDONLY); if (fd < 0) return nullptr; @@ -32,7 +32,7 @@ static bfd *try_debug_file(const char *filename, unsigned long crc32) { if (crc != crc32) return nullptr; - bfd *object = bfd_openr(filename, nullptr); + bfd* object = bfd_openr(filename, nullptr); if (!bfd_check_format(object, bfd_object)) { bfd_close(object); return nullptr; @@ -41,15 +41,15 @@ static bfd *try_debug_file(const char *filename, unsigned long crc32) { return object; } -static bfd *find_debug_file(bfd *lib, const char *aFileName) { +static bfd* find_debug_file(bfd* lib, const char* aFileName) { // check for a separate debug file with symbols - asection *sect = bfd_get_section_by_name(lib, ".gnu_debuglink"); + asection* sect = bfd_get_section_by_name(lib, ".gnu_debuglink"); if (!sect) return nullptr; bfd_size_type debuglinkSize = bfd_section_size(objfile->obfd, sect); - char *debuglink = new char[debuglinkSize]; + char* debuglink = new char[debuglinkSize]; bfd_get_section_contents(lib, sect, debuglink, 0, debuglinkSize); // crc checksum is aligned to 4 bytes, and after the NUL. @@ -57,20 +57,20 @@ static bfd *find_debug_file(bfd *lib, const char *aFileName) { unsigned long crc32 = bfd_get_32(lib, debuglink + crc_offset); // directory component - char *dirbuf = strdup(aFileName); - const char *dir = dirname(dirbuf); + char* dirbuf = strdup(aFileName); + const char* dir = dirname(dirbuf); static const char debug_subdir[] = ".debug"; // This is gdb's default global debugging info directory, but gdb can // be instructed to use a different directory. static const char global_debug_dir[] = "/usr/lib/debug"; - char *filename = + char* filename = new char[strlen(global_debug_dir) + strlen(dir) + crc_offset + 3]; // /path/debuglink sprintf(filename, "%s/%s", dir, debuglink); - bfd *debugFile = try_debug_file(filename, crc32); + bfd* debugFile = try_debug_file(filename, crc32); if (!debugFile) { // /path/.debug/debuglink sprintf(filename, "%s/%s/%s", dir, debug_subdir, debuglink); @@ -90,17 +90,17 @@ static bfd *find_debug_file(bfd *lib, const char *aFileName) { } // Use an indirect array to avoid copying tons of objects -Symbol **leaky::ExtendSymbols(int num) { +Symbol** leaky::ExtendSymbols(int num) { long n = numExternalSymbols + num; - externalSymbols = (Symbol **)realloc( - externalSymbols, (size_t)(sizeof(externalSymbols[0]) * n)); - Symbol *new_array = new Symbol[n]; + externalSymbols = (Symbol**)realloc(externalSymbols, + (size_t)(sizeof(externalSymbols[0]) * n)); + Symbol* new_array = new Symbol[n]; for (int i = 0; i < num; i++) { externalSymbols[i + numExternalSymbols] = &new_array[i]; } lastSymbol = externalSymbols + n; - Symbol **sp = externalSymbols + numExternalSymbols; + Symbol** sp = externalSymbols + numExternalSymbols; numExternalSymbols = n; return sp; } @@ -113,17 +113,17 @@ Symbol **leaky::ExtendSymbols(int num) { } \ } while (0) -void leaky::ReadSymbols(const char *aFileName, u_long aBaseAddress) { +void leaky::ReadSymbols(const char* aFileName, u_long aBaseAddress) { int initialSymbols = usefulSymbols; if (nullptr == externalSymbols) { - externalSymbols = (Symbol **)calloc(sizeof(Symbol *), 10000); - Symbol *new_array = new Symbol[10000]; + externalSymbols = (Symbol**)calloc(sizeof(Symbol*), 10000); + Symbol* new_array = new Symbol[10000]; for (int i = 0; i < 10000; i++) { externalSymbols[i] = &new_array[i]; } numExternalSymbols = 10000; } - Symbol **sp = externalSymbols + usefulSymbols; + Symbol** sp = externalSymbols + usefulSymbols; lastSymbol = externalSymbols + numExternalSymbols; // Create a dummy symbol for the library so, if it doesn't have any @@ -139,7 +139,7 @@ void leaky::ReadSymbols(const char *aFileName, u_long aBaseAddress) { bfd_init(); } - bfd *lib = bfd_openr(aFileName, nullptr); + bfd* lib = bfd_openr(aFileName, nullptr); if (nullptr == lib) { return; } @@ -148,7 +148,7 @@ void leaky::ReadSymbols(const char *aFileName, u_long aBaseAddress) { return; } - bfd *symbolFile = find_debug_file(lib, aFileName); + bfd* symbolFile = find_debug_file(lib, aFileName); // read mini symbols PTR minisyms; @@ -173,16 +173,16 @@ void leaky::ReadSymbols(const char *aFileName, u_long aBaseAddress) { symbolFile = lib; } - asymbol *store; + asymbol* store; store = bfd_make_empty_symbol(symbolFile); // Scan symbols size_t demangle_buffer_size = 128; - char *demangle_buffer = (char *)malloc(demangle_buffer_size); - bfd_byte *from = (bfd_byte *)minisyms; - bfd_byte *fromend = from + symcount * size; + char* demangle_buffer = (char*)malloc(demangle_buffer_size); + bfd_byte* from = (bfd_byte*)minisyms; + bfd_byte* fromend = from + symcount * size; for (; from < fromend; from += size) { - asymbol *sym; + asymbol* sym; sym = bfd_minisymbol_to_symbol(symbolFile, kDynamic, (const PTR)from, store); @@ -190,9 +190,9 @@ void leaky::ReadSymbols(const char *aFileName, u_long aBaseAddress) { bfd_get_symbol_info(symbolFile, sym, &syminfo); // if ((syminfo.type == 'T') || (syminfo.type == 't')) { - const char *nm = bfd_asymbol_name(sym); + const char* nm = bfd_asymbol_name(sym); if (nm && nm[0]) { - char *dnm = nullptr; + char* dnm = nullptr; if (strncmp("__thunk", nm, 7)) { dnm = abi::__cxa_demangle(nm, demangle_buffer, &demangle_buffer_size, 0); diff --git a/tools/jprof/coff.cpp b/tools/jprof/coff.cpp index abed208f0fbbd..0efa83960c4d0 100644 --- a/tools/jprof/coff.cpp +++ b/tools/jprof/coff.cpp @@ -17,13 +17,13 @@ # ifdef IRIX4 extern "C" { -extern char *demangle(char const *in); +extern char* demangle(char const* in); }; # else # include # endif -static char *Demangle(char *rawName) { +static char* Demangle(char* rawName) { # ifdef IRIX4 return strdup(demangle(rawName)); # else @@ -33,8 +33,8 @@ static char *Demangle(char *rawName) { # endif } -void leaky::readSymbols(const char *fileName) { - LDFILE *ldptr; +void leaky::readSymbols(const char* fileName) { + LDFILE* ldptr; ldptr = ldopen(fileName, nullptr); if (!ldptr) { @@ -52,9 +52,9 @@ void leaky::readSymbols(const char *fileName) { long iMax = isymMax + iextMax; long alloced = 10000; - Symbol *syms = (Symbol *)malloc(sizeof(Symbol) * 10000); - Symbol *sp = syms; - Symbol *last = syms + alloced; + Symbol* syms = (Symbol*)malloc(sizeof(Symbol) * 10000); + Symbol* sp = syms; + Symbol* last = syms + alloced; SYMR symr; for (long isym = 0; isym < iMax; isym++) { @@ -73,7 +73,7 @@ void leaky::readSymbols(const char *fileName) { sp++; if (sp >= last) { long n = alloced + 10000; - syms = (Symbol *)realloc(syms, (size_t)(sizeof(Symbol) * n)); + syms = (Symbol*)realloc(syms, (size_t)(sizeof(Symbol) * n)); last = syms + n; sp = syms + alloced; alloced = n; diff --git a/tools/jprof/elf.cpp b/tools/jprof/elf.cpp index 686c47c91189e..c2e00f60dafd0 100644 --- a/tools/jprof/elf.cpp +++ b/tools/jprof/elf.cpp @@ -14,7 +14,7 @@ # include # include -void leaky::readSymbols(const char *fileName) { +void leaky::readSymbols(const char* fileName) { int fd = ::open(fileName, O_RDONLY); if (fd < 0) { fprintf(stderr, "%s: unable to open \"%s\"\n", applicationName, fileName); @@ -22,7 +22,7 @@ void leaky::readSymbols(const char *fileName) { } elf_version(EV_CURRENT); - Elf *elf = elf_begin(fd, ELF_C_READ, 0); + Elf* elf = elf_begin(fd, ELF_C_READ, 0); if (!elf) { fprintf(stderr, "%s: \"%s\": has no symbol table\n", applicationName, fileName); @@ -30,13 +30,13 @@ void leaky::readSymbols(const char *fileName) { } long alloced = 10000; - Symbol *syms = (Symbol *)malloc(sizeof(Symbol) * 10000); - Symbol *sp = syms; - Symbol *last = syms + alloced; + Symbol* syms = (Symbol*)malloc(sizeof(Symbol) * 10000); + Symbol* sp = syms; + Symbol* last = syms + alloced; // Get each of the relevant sections and add them to the list of // symbols. - Elf32_Ehdr *ehdr = elf32_getehdr(elf); + Elf32_Ehdr* ehdr = elf32_getehdr(elf); if (!ehdr) { fprintf(stderr, "%s: elf library lossage\n", applicationName); exit(-1); @@ -45,10 +45,10 @@ void leaky::readSymbols(const char *fileName) { Elf32_Half ndx = ehdr->e_shstrndx; # endif - Elf_Scn *scn = 0; + Elf_Scn* scn = 0; int strtabndx = -1; for (int i = 1; (scn = elf_nextscn(elf, scn)) != 0; i++) { - Elf32_Shdr *shdr = elf32_getshdr(scn); + Elf32_Shdr* shdr = elf32_getshdr(scn); # if 0 char *name = elf_strptr(elf, ndx, (size_t) shdr->sh_name); printf("Section %s (%d 0x%x)\n", name ? name : "(null)", @@ -78,15 +78,15 @@ void leaky::readSymbols(const char *fileName) { # endif if ((shdr->sh_type == SHT_SYMTAB) || (shdr->sh_type == SHT_DYNSYM)) { /* Symbol table */ - Elf_Data *data = elf_getdata(scn, 0); + Elf_Data* data = elf_getdata(scn, 0); if (!data || !data->d_size) { printf("No data..."); continue; } /* In theory we now have the symbols... */ - Elf32_Sym *esym = (Elf32_Sym *)data->d_buf; - Elf32_Sym *lastsym = (Elf32_Sym *)((char *)data->d_buf + data->d_size); + Elf32_Sym* esym = (Elf32_Sym*)data->d_buf; + Elf32_Sym* lastsym = (Elf32_Sym*)((char*)data->d_buf + data->d_size); for (; esym < lastsym; esym++) { # if 0 char *nm = elf_strptr(elf, strtabndx, (size_t)esym->st_name); @@ -101,14 +101,14 @@ void leaky::readSymbols(const char *fileName) { continue; } # if 1 - char *nm = elf_strptr(elf, strtabndx, (size_t)esym->st_name); + char* nm = elf_strptr(elf, strtabndx, (size_t)esym->st_name); # endif sp->name = nm ? strdup(nm) : "(no name)"; sp->address = esym->st_value; sp++; if (sp >= last) { long n = alloced + 10000; - syms = (Symbol *)realloc(syms, (size_t)(sizeof(Symbol) * n)); + syms = (Symbol*)realloc(syms, (size_t)(sizeof(Symbol) * n)); last = syms + n; sp = syms + alloced; alloced = n; diff --git a/tools/jprof/intcnt.cpp b/tools/jprof/intcnt.cpp index 511435df5c1bc..a87b6ccf74506 100644 --- a/tools/jprof/intcnt.cpp +++ b/tools/jprof/intcnt.cpp @@ -47,7 +47,7 @@ int IntCount::countAdd(int index, int increment) { } int i; - IntPair *tpair = new IntPair[numInts + 1]; + IntPair* tpair = new IntPair[numInts + 1]; for (i = 0; i < divPoint; i++) { tpair[i] = iPair[i]; } diff --git a/tools/jprof/stub/libmalloc.cpp b/tools/jprof/stub/libmalloc.cpp index aa9a3c610a987..ccbbc26ea495f 100644 --- a/tools/jprof/stub/libmalloc.cpp +++ b/tools/jprof/stub/libmalloc.cpp @@ -75,12 +75,12 @@ static void RegisterJprofShutdown() { } #if defined(i386) || defined(_i386) || defined(__x86_64__) -JPROF_STATIC void CrawlStack(malloc_log_entry *me, void *stack_top, - void *top_instr_ptr) { +JPROF_STATIC void CrawlStack(malloc_log_entry* me, void* stack_top, + void* top_instr_ptr) { # if USE_GLIBC_BACKTRACE // This probably works on more than x86! But we need a way to get the // top instruction pointer, which is kindof arch-specific - void *array[500]; + void* array[500]; int cnt, i; u_long numpcs = 0; @@ -92,13 +92,13 @@ JPROF_STATIC void CrawlStack(malloc_log_entry *me, void *stack_top, // Then we have sigaction, which replaced top_instr_ptr array[3] = top_instr_ptr; for (i = 3; i < cnt; i++) { - me->pcs[numpcs++] = (char *)array[i]; + me->pcs[numpcs++] = (char*)array[i]; } me->numpcs = numpcs; # else // original code - this breaks on many platforms - void **bp; + void** bp; # if defined(__i386) __asm__("movl %%ebp, %0" : "=g"(bp)); # elif defined(__x86_64__) @@ -112,17 +112,17 @@ JPROF_STATIC void CrawlStack(malloc_log_entry *me, void *stack_top, u_long numpcs = 0; bool tracing = false; - me->pcs[numpcs++] = (char *)top_instr_ptr; + me->pcs[numpcs++] = (char*)top_instr_ptr; while (numpcs < MAX_STACK_CRAWL) { - void **nextbp = (void **)*bp++; - void *pc = *bp; + void** nextbp = (void**)*bp++; + void* pc = *bp; if (nextbp < bp) { break; } if (tracing) { // Skip the signal handling. - me->pcs[numpcs++] = (char *)pc; + me->pcs[numpcs++] = (char*)pc; } else if (pc == top_instr_ptr) { tracing = true; } @@ -160,7 +160,7 @@ static void DumpAddressMap() { int mfd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0666); if (mfd >= 0) { malloc_map_entry mme; - link_map *map = _r_debug.r_map; + link_map* map = _r_debug.r_map; while (nullptr != map) { if (map->l_name && *map->l_name) { mme.nameLen = strlen(map->l_name); @@ -215,7 +215,7 @@ class DumbCircularBuffer { DumbCircularBuffer(size_t init_buffer_size) { used = 0; buffer_size = init_buffer_size; - buffer = (unsigned char *)malloc(buffer_size); + buffer = (unsigned char*)malloc(buffer_size); head = tail = buffer; #if defined(linux) @@ -261,7 +261,7 @@ class DumbCircularBuffer { DUMB_UNLOCK(); } - bool insert(void *data, size_t size) { + bool insert(void* data, size_t size) { // can fail if not enough space in the entire buffer DUMB_LOCK(); if (space_available() < size) return false; @@ -274,14 +274,14 @@ class DumbCircularBuffer { #endif memcpy(tail, data, initial); tail += initial; - data = ((char *)data) + initial; + data = ((char*)data) + initial; size -= initial; if (size != 0) { #if DEBUG_CIRCULAR fprintf(stderr, "wrapping by %d bytes\n", size); #endif memcpy(buffer, data, size); - tail = &(((unsigned char *)buffer)[size]); + tail = &(((unsigned char*)buffer)[size]); } used++; @@ -296,17 +296,17 @@ class DumbCircularBuffer { void unlock() { DUMB_UNLOCK(); } // XXX These really shouldn't be public... - unsigned char *head; - unsigned char *tail; + unsigned char* head; + unsigned char* tail; unsigned int used; - unsigned char *buffer; + unsigned char* buffer; size_t buffer_size; private: pthread_mutex_t mutex; }; -class DumbCircularBuffer *JprofBuffer; +class DumbCircularBuffer* JprofBuffer; JPROF_STATIC void JprofBufferInit(size_t size) { JprofBuffer = new DumbCircularBuffer(size); @@ -317,11 +317,11 @@ JPROF_STATIC void JprofBufferClear() { JprofBuffer->clear(); } -JPROF_STATIC size_t JprofEntrySizeof(malloc_log_entry *me) { - return offsetof(malloc_log_entry, pcs) + me->numpcs * sizeof(char *); +JPROF_STATIC size_t JprofEntrySizeof(malloc_log_entry* me) { + return offsetof(malloc_log_entry, pcs) + me->numpcs * sizeof(char*); } -JPROF_STATIC void JprofBufferAppend(malloc_log_entry *me) { +JPROF_STATIC void JprofBufferAppend(malloc_log_entry* me) { size_t size = JprofEntrySizeof(me); do { @@ -331,10 +331,9 @@ JPROF_STATIC void JprofBufferAppend(malloc_log_entry *me) { stderr, "dropping entry: %d in use, %d free, need %d, size_to_free = %d\n", JprofBuffer->used, JprofBuffer->space_available(), size, - JprofEntrySizeof((malloc_log_entry *)JprofBuffer->head)); + JprofEntrySizeof((malloc_log_entry*)JprofBuffer->head)); #endif - JprofBuffer->drop( - JprofEntrySizeof((malloc_log_entry *)JprofBuffer->head)); + JprofBuffer->drop(JprofEntrySizeof((malloc_log_entry*)JprofBuffer->head)); } if (JprofBuffer->space_available() < size) return; @@ -364,7 +363,7 @@ JPROF_STATIC void JprofBufferDump() { //---------------------------------------------------------------------- -JPROF_STATIC void JprofLog(u_long aTime, void *stack_top, void *top_instr_ptr) { +JPROF_STATIC void JprofLog(u_long aTime, void* stack_top, void* top_instr_ptr) { // Static is simply to make debugging tolerable static malloc_log_entry me; @@ -415,7 +414,7 @@ static void startSignalCounter(unsigned long millisec) { static long timerMilliSec = 50; #if defined(linux) -static int setupRTCSignals(int hz, struct sigaction *sap) { +static int setupRTCSignals(int hz, struct sigaction* sap) { /* global */ rtcFD = open("/dev/rtc", O_RDONLY); if (rtcFD < 0) { perror("JPROF_RTC setup: open(\"/dev/rtc\", O_RDONLY)"); @@ -482,7 +481,7 @@ static int enableRTCSignals(bool enable) { } #endif -JPROF_STATIC void StackHook(int signum, siginfo_t *info, void *ucontext) { +JPROF_STATIC void StackHook(int signum, siginfo_t* info, void* ucontext) { static struct timeval tFirst; static int first = 1; size_t millisec = 0; @@ -520,11 +519,11 @@ JPROF_STATIC void StackHook(int signum, siginfo_t *info, void *ucontext) { } } - gregset_t &gregs = ((ucontext_t *)ucontext)->uc_mcontext.gregs; + gregset_t& gregs = ((ucontext_t*)ucontext)->uc_mcontext.gregs; #ifdef __x86_64__ - JprofLog(millisec, (void *)gregs[REG_RSP], (void *)gregs[REG_RIP]); + JprofLog(millisec, (void*)gregs[REG_RSP], (void*)gregs[REG_RIP]); #else - JprofLog(millisec, (void *)gregs[REG_ESP], (void *)gregs[REG_EIP]); + JprofLog(millisec, (void*)gregs[REG_ESP], (void*)gregs[REG_EIP]); #endif if (!rtcHz) startSignalCounter(timerMilliSec); @@ -539,7 +538,7 @@ NS_EXPORT_(void) setupProfilingStuff(void) { int doNotStart = 1; int firstDelay = 0; int append = O_TRUNC; - char *tst = getenv("JPROF_FLAGS"); + char* tst = getenv("JPROF_FLAGS"); /* Options from JPROF_FLAGS environment variable: * JP_DEFER -> Wait for a SIGPROF (or SIGALRM, if JP_REALTIME @@ -573,7 +572,7 @@ NS_EXPORT_(void) setupProfilingStuff(void) { if (strstr(tst, "JP_REALTIME")) realTime = 1; if (strstr(tst, "JP_APPEND")) append = O_APPEND; - char *delay = strstr(tst, "JP_PERIOD="); + char* delay = strstr(tst, "JP_PERIOD="); if (delay) { double tmp = strtod(delay + strlen("JP_PERIOD="), nullptr); if (tmp >= 1e-3) { @@ -585,7 +584,7 @@ NS_EXPORT_(void) setupProfilingStuff(void) { } } - char *circular_op = strstr(tst, "JP_CIRCULAR="); + char* circular_op = strstr(tst, "JP_CIRCULAR="); if (circular_op) { size_t size = atol(circular_op + strlen("JP_CIRCULAR=")); if (size < 1000) { @@ -599,12 +598,12 @@ NS_EXPORT_(void) setupProfilingStuff(void) { circular = true; } - char *first = strstr(tst, "JP_FIRST="); + char* first = strstr(tst, "JP_FIRST="); if (first) { firstDelay = atol(first + strlen("JP_FIRST=")); } - char *rtc = strstr(tst, "JP_RTC_HZ="); + char* rtc = strstr(tst, "JP_RTC_HZ="); if (rtc) { #if defined(linux) rtcHz = atol(rtc + strlen("JP_RTC_HZ=")); @@ -628,13 +627,13 @@ NS_EXPORT_(void) setupProfilingStuff(void) { #endif } - const char *f = strstr(tst, "JP_FILENAME="); + const char* f = strstr(tst, "JP_FILENAME="); if (f) f = f + strlen("JP_FILENAME="); else f = M_LOGFILE; - char *is_slave = getenv("JPROF_SLAVE"); + char* is_slave = getenv("JPROF_SLAVE"); if (!is_slave) setenv("JPROF_SLAVE", "", 0); gIsSlave = !!is_slave; diff --git a/tools/profiler/core/EHABIStackWalk.cpp b/tools/profiler/core/EHABIStackWalk.cpp index 380a50bd95cbd..3eab4c0fb312d 100644 --- a/tools/profiler/core/EHABIStackWalk.cpp +++ b/tools/profiler/core/EHABIStackWalk.cpp @@ -58,12 +58,12 @@ struct PRel31 { bool topBit() const { return mBits & 0x80000000; } uint32_t value() const { return mBits & 0x7fffffff; } int32_t offset() const { return (static_cast(mBits) << 1) >> 1; } - const void *compute() const { - return reinterpret_cast(this) + offset(); + const void* compute() const { + return reinterpret_cast(this) + offset(); } private: - PRel31(const PRel31 &copied) = delete; + PRel31(const PRel31& copied) = delete; PRel31() = delete; }; @@ -72,7 +72,7 @@ struct EHEntry { PRel31 exidx; private: - EHEntry(const EHEntry &copied) = delete; + EHEntry(const EHEntry& copied) = delete; EHEntry() = delete; }; @@ -82,24 +82,24 @@ class EHState { uint32_t mRegs[16]; public: - bool unwind(const EHEntry *aEntry, const void *stackBase); - uint32_t &operator[](int i) { return mRegs[i]; } - const uint32_t &operator[](int i) const { return mRegs[i]; } - explicit EHState(const mcontext_t &); + bool unwind(const EHEntry* aEntry, const void* stackBase); + uint32_t& operator[](int i) { return mRegs[i]; } + const uint32_t& operator[](int i) const { return mRegs[i]; } + explicit EHState(const mcontext_t&); }; enum { R_SP = 13, R_LR = 14, R_PC = 15 }; #ifdef HAVE_UNSORTED_EXIDX class EHEntryHandle { - const EHEntry *mValue; + const EHEntry* mValue; public: - EHEntryHandle(const EHEntry *aEntry) : mValue(aEntry) {} - const EHEntry *value() const { return mValue; } + EHEntryHandle(const EHEntry* aEntry) : mValue(aEntry) {} + const EHEntry* value() const { return mValue; } }; -bool operator<(const EHEntryHandle &lhs, const EHEntryHandle &rhs) { +bool operator<(const EHEntryHandle& lhs, const EHEntryHandle& rhs) { return lhs.value()->startPC.compute() < rhs.value()->startPC.compute(); } #endif @@ -116,23 +116,23 @@ class EHTable { typedef std::vector::const_iterator EntryIterator; EntryIterator entriesBegin() const { return mEntries.begin(); } EntryIterator entriesEnd() const { return mEntries.end(); } - static const EHEntry *entryGet(EntryIterator aEntry) { + static const EHEntry* entryGet(EntryIterator aEntry) { return aEntry->value(); } #else - typedef const EHEntry *EntryIterator; + typedef const EHEntry* EntryIterator; EntryIterator mEntriesBegin, mEntriesEnd; EntryIterator entriesBegin() const { return mEntriesBegin; } EntryIterator entriesEnd() const { return mEntriesEnd; } - static const EHEntry *entryGet(EntryIterator aEntry) { return aEntry; } + static const EHEntry* entryGet(EntryIterator aEntry) { return aEntry; } #endif std::string mName; public: - EHTable(const void *aELF, size_t aSize, const std::string &aName); - const EHEntry *lookup(uint32_t aPC) const; + EHTable(const void* aELF, size_t aSize, const std::string& aName); + const EHEntry* lookup(uint32_t aPC) const; bool isValid() const { return entriesEnd() != entriesBegin(); } - const std::string &name() const { return mName; } + const std::string& name() const { return mName; } uint32_t startPC() const { return mStartPC; } uint32_t endPC() const { return mEndPC; } uint32_t baseAddress() const { return mBaseAddress; } @@ -141,36 +141,36 @@ class EHTable { class EHAddrSpace { std::vector mStarts; std::vector mTables; - static mozilla::Atomic sCurrent; + static mozilla::Atomic sCurrent; public: - explicit EHAddrSpace(const std::vector &aTables); - const EHTable *lookup(uint32_t aPC) const; + explicit EHAddrSpace(const std::vector& aTables); + const EHTable* lookup(uint32_t aPC) const; static void Update(); - static const EHAddrSpace *Get(); + static const EHAddrSpace* Get(); }; void EHABIStackWalkInit() { EHAddrSpace::Update(); } -size_t EHABIStackWalk(const mcontext_t &aContext, void *stackBase, void **aSPs, - void **aPCs, const size_t aNumFrames) { - const EHAddrSpace *space = EHAddrSpace::Get(); +size_t EHABIStackWalk(const mcontext_t& aContext, void* stackBase, void** aSPs, + void** aPCs, const size_t aNumFrames) { + const EHAddrSpace* space = EHAddrSpace::Get(); EHState state(aContext); size_t count = 0; while (count < aNumFrames) { uint32_t pc = state[R_PC], sp = state[R_SP]; - aPCs[count] = reinterpret_cast(pc); - aSPs[count] = reinterpret_cast(sp); + aPCs[count] = reinterpret_cast(pc); + aSPs[count] = reinterpret_cast(sp); count++; if (!space) break; // TODO: cache these lookups. Binary-searching libxul is // expensive (possibly more expensive than doing the actual // unwind), and even a small cache should help. - const EHTable *table = space->lookup(pc); + const EHTable* table = space->lookup(pc); if (!table) break; - const EHEntry *entry = table->lookup(pc); + const EHEntry* entry = table->lookup(pc); if (!entry) break; if (!state.unwind(entry, stackBase)) break; } @@ -183,7 +183,7 @@ class EHInterp { // Note that stackLimit is exclusive and stackBase is inclusive // (i.e, stackLimit < SP <= stackBase), following the convention // set by the AAPCS spec. - EHInterp(EHState &aState, const EHEntry *aEntry, uint32_t aStackLimit, + EHInterp(EHState& aState, const EHEntry* aEntry, uint32_t aStackLimit, uint32_t aStackBase) : mState(aState), mStackLimit(aStackLimit), @@ -191,7 +191,7 @@ class EHInterp { mNextWord(0), mWordsLeft(0), mFailed(false) { - const PRel31 &exidx = aEntry->exidx; + const PRel31& exidx = aEntry->exidx; uint32_t firstWord; if (exidx.mBits == 1) { // EXIDX_CANTUNWIND @@ -201,7 +201,7 @@ class EHInterp { if (exidx.topBit()) { firstWord = exidx.mBits; } else { - mNextWord = reinterpret_cast(exidx.compute()); + mNextWord = reinterpret_cast(exidx.compute()); firstWord = *mNextWord++; } @@ -230,10 +230,10 @@ class EHInterp { // it hasn't determined that they can't alias and is thus missing // optimization opportunities. So, we may want to flatten EHState // into this class; this may also make the code simpler. - EHState &mState; + EHState& mState; uint32_t mStackLimit; uint32_t mStackBase; - const uint32_t *mNextWord; + const uint32_t* mNextWord; uint32_t mWord; uint8_t mWordsLeft; uint8_t mBytesLeft; @@ -275,8 +275,8 @@ class EHInterp { return mWord; } - uint32_t &vSP() { return mState[R_SP]; } - uint32_t *ptrSP() { return reinterpret_cast(vSP()); } + uint32_t& vSP() { return mState[R_SP]; } + uint32_t* ptrSP() { return reinterpret_cast(vSP()); } void checkStackBase() { if (vSP() > mStackBase) mFailed = true; @@ -317,7 +317,7 @@ class EHInterp { } }; -bool EHState::unwind(const EHEntry *aEntry, const void *stackBasePtr) { +bool EHState::unwind(const EHEntry* aEntry, const void* stackBasePtr) { // The unwinding program cannot set SP to less than the initial value. uint32_t stackLimit = mRegs[R_SP] - 4; uint32_t stackBase = reinterpret_cast(stackBasePtr); @@ -354,7 +354,7 @@ bool EHInterp::unwind() { if ((insn & M_POPN) == I_POPN) { uint8_t n = (insn & 0x07) + 1; bool lr = insn & 0x08; - uint32_t *ptr = ptrSP(); + uint32_t* ptr = ptrSP(); vSP() += (n + (lr ? 1 : 0)) * 4; checkStackBase(); for (uint8_t r = 4; r < 4 + n; ++r) mState[r] = *ptr++; @@ -464,12 +464,12 @@ bool EHInterp::unwind() { return false; } -bool operator<(const EHTable &lhs, const EHTable &rhs) { +bool operator<(const EHTable& lhs, const EHTable& rhs) { return lhs.startPC() < rhs.startPC(); } // Async signal unsafe. -EHAddrSpace::EHAddrSpace(const std::vector &aTables) +EHAddrSpace::EHAddrSpace(const std::vector& aTables) : mTables(aTables) { std::sort(mTables.begin(), mTables.end()); DebugOnly lastEnd = 0; @@ -481,7 +481,7 @@ EHAddrSpace::EHAddrSpace(const std::vector &aTables) } } -const EHTable *EHAddrSpace::lookup(uint32_t aPC) const { +const EHTable* EHAddrSpace::lookup(uint32_t aPC) const { ptrdiff_t i = (std::upper_bound(mStarts.begin(), mStarts.end(), aPC) - mStarts.begin()) - 1; @@ -490,7 +490,7 @@ const EHTable *EHAddrSpace::lookup(uint32_t aPC) const { return &mTables[i]; } -const EHEntry *EHTable::lookup(uint32_t aPC) const { +const EHEntry* EHTable::lookup(uint32_t aPC) const { MOZ_ASSERT(aPC >= mStartPC); if (aPC >= mEndPC) return nullptr; @@ -525,7 +525,7 @@ static const unsigned char hostEndian = ELFDATA2MSB; #endif // Async signal unsafe: std::vector::reserve, std::string copy ctor. -EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) +EHTable::EHTable(const void* aELF, size_t aSize, const std::string& aName) : mStartPC(~0), // largest uint32_t mEndPC(0), #ifndef HAVE_UNSORTED_EXIDX @@ -537,7 +537,7 @@ EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) if (aSize < sizeof(Elf32_Ehdr)) return; - const Elf32_Ehdr &file = *(reinterpret_cast(fileHeaderAddr)); + const Elf32_Ehdr& file = *(reinterpret_cast(fileHeaderAddr)); if (memcmp(&file.e_ident[EI_MAG0], ELFMAG, SELFMAG) != 0 || file.e_ident[EI_CLASS] != ELFCLASS32 || file.e_ident[EI_DATA] != hostEndian || @@ -549,7 +549,7 @@ EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) MOZ_ASSERT(file.e_phoff + file.e_phnum * file.e_phentsize <= aSize); const Elf32_Phdr *exidxHdr = 0, *zeroHdr = 0; for (unsigned i = 0; i < file.e_phnum; ++i) { - const Elf32_Phdr &phdr = *(reinterpret_cast( + const Elf32_Phdr& phdr = *(reinterpret_cast( fileHeaderAddr + file.e_phoff + i * file.e_phentsize)); if (phdr.p_type == PT_ARM_EXIDX) { exidxHdr = &phdr; @@ -570,13 +570,13 @@ EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) mEndPC += mBaseAddress; // Create a sorted index of the index to work around linker bugs. - const EHEntry *startTable = - reinterpret_cast(mBaseAddress + exidxHdr->p_vaddr); - const EHEntry *endTable = reinterpret_cast( + const EHEntry* startTable = + reinterpret_cast(mBaseAddress + exidxHdr->p_vaddr); + const EHEntry* endTable = reinterpret_cast( mBaseAddress + exidxHdr->p_vaddr + exidxHdr->p_memsz); #ifdef HAVE_UNSORTED_EXIDX mEntries.reserve(endTable - startTable); - for (const EHEntry *i = startTable; i < endTable; ++i) mEntries.push_back(i); + for (const EHEntry* i = startTable; i < endTable; ++i) mEntries.push_back(i); std::sort(mEntries.begin(), mEntries.end()); #else mEntriesBegin = startTable; @@ -584,26 +584,26 @@ EHTable::EHTable(const void *aELF, size_t aSize, const std::string &aName) #endif } -mozilla::Atomic EHAddrSpace::sCurrent(nullptr); +mozilla::Atomic EHAddrSpace::sCurrent(nullptr); // Async signal safe; can fail if Update() hasn't returned yet. -const EHAddrSpace *EHAddrSpace::Get() { return sCurrent; } +const EHAddrSpace* EHAddrSpace::Get() { return sCurrent; } // Collect unwinding information from loaded objects. Calls after the // first have no effect. Async signal unsafe. void EHAddrSpace::Update() { - const EHAddrSpace *space = sCurrent; + const EHAddrSpace* space = sCurrent; if (space) return; SharedLibraryInfo info = SharedLibraryInfo::GetInfoForSelf(); std::vector tables; for (size_t i = 0; i < info.GetSize(); ++i) { - const SharedLibrary &lib = info.GetEntry(i); + const SharedLibrary& lib = info.GetEntry(i); // FIXME: This isn't correct if the start address isn't p_offset 0, because // the start address will not point at the file header. But this is worked // around by magic number checks in the EHTable constructor. - EHTable tab(reinterpret_cast(lib.GetStart()), + EHTable tab(reinterpret_cast(lib.GetStart()), lib.GetEnd() - lib.GetStart(), lib.GetNativeDebugPath()); if (tab.isValid()) tables.push_back(tab); } @@ -615,7 +615,7 @@ void EHAddrSpace::Update() { } } -EHState::EHState(const mcontext_t &context) { +EHState::EHState(const mcontext_t& context) { #ifdef linux mRegs[0] = context.arm_r0; mRegs[1] = context.arm_r1; diff --git a/tools/profiler/core/EHABIStackWalk.h b/tools/profiler/core/EHABIStackWalk.h index e114a9a65e2c8..61286290b85b5 100644 --- a/tools/profiler/core/EHABIStackWalk.h +++ b/tools/profiler/core/EHABIStackWalk.h @@ -20,8 +20,8 @@ namespace mozilla { void EHABIStackWalkInit(); -size_t EHABIStackWalk(const mcontext_t &aContext, void *stackBase, void **aSPs, - void **aPCs, size_t aNumFrames); +size_t EHABIStackWalk(const mcontext_t& aContext, void* stackBase, void** aSPs, + void** aPCs, size_t aNumFrames); } // namespace mozilla diff --git a/tools/profiler/core/shared-libraries-macos.cc b/tools/profiler/core/shared-libraries-macos.cc index 3028b80b0cefa..5ce71cff9280d 100644 --- a/tools/profiler/core/shared-libraries-macos.cc +++ b/tools/profiler/core/shared-libraries-macos.cc @@ -41,18 +41,18 @@ typedef segment_command_64 mach_segment_command_type; #endif struct NativeSharedLibrary { - const platform_mach_header *header; + const platform_mach_header* header; std::string path; }; -static std::vector *sSharedLibrariesList = nullptr; +static std::vector* sSharedLibrariesList = nullptr; static mozilla::StaticMutex sSharedLibrariesMutex; -static void SharedLibraryAddImage(const struct mach_header *mh, +static void SharedLibraryAddImage(const struct mach_header* mh, intptr_t vmaddr_slide) { // NOTE: Presumably for backwards-compatibility reasons, this function accepts // a mach_header even on 64-bit where it ought to be a mach_header_64. We cast // it to the right type here. - auto header = reinterpret_cast(mh); + auto header = reinterpret_cast(mh); Dl_info info; if (!dladdr(header, &info)) { @@ -68,12 +68,12 @@ static void SharedLibraryAddImage(const struct mach_header *mh, sSharedLibrariesList->push_back(lib); } -static void SharedLibraryRemoveImage(const struct mach_header *mh, +static void SharedLibraryRemoveImage(const struct mach_header* mh, intptr_t vmaddr_slide) { // NOTE: Presumably for backwards-compatibility reasons, this function accepts // a mach_header even on 64-bit where it ought to be a mach_header_64. We cast // it to the right type here. - auto header = reinterpret_cast(mh); + auto header = reinterpret_cast(mh); mozilla::StaticMutexAutoLock lock(sSharedLibrariesMutex); if (!sSharedLibrariesList) { @@ -98,33 +98,33 @@ void SharedLibraryInfo::Initialize() { _dyld_register_func_for_remove_image(SharedLibraryRemoveImage); } -static void addSharedLibrary(const platform_mach_header *header, - const char *path, SharedLibraryInfo &info) { - const struct load_command *cmd = - reinterpret_cast(header + 1); +static void addSharedLibrary(const platform_mach_header* header, + const char* path, SharedLibraryInfo& info) { + const struct load_command* cmd = + reinterpret_cast(header + 1); seg_size size = 0; unsigned long long start = reinterpret_cast(header); // Find the cmd segment in the macho image. It will contain the offset we care // about. - const uint8_t *uuid_bytes = nullptr; + const uint8_t* uuid_bytes = nullptr; for (unsigned int i = 0; cmd && (i < header->ncmds) && (uuid_bytes == nullptr || size == 0); ++i) { if (cmd->cmd == CMD_SEGMENT) { - const mach_segment_command_type *seg = - reinterpret_cast(cmd); + const mach_segment_command_type* seg = + reinterpret_cast(cmd); if (!strcmp(seg->segname, "__TEXT")) { size = seg->vmsize; } } else if (cmd->cmd == LC_UUID) { - const uuid_command *ucmd = reinterpret_cast(cmd); + const uuid_command* ucmd = reinterpret_cast(cmd); uuid_bytes = ucmd->uuid; } - cmd = reinterpret_cast( - reinterpret_cast(cmd) + cmd->cmdsize); + cmd = reinterpret_cast( + reinterpret_cast(cmd) + cmd->cmdsize); } nsAutoCString uuid; @@ -163,7 +163,7 @@ static void addSharedLibrary(const platform_mach_header *header, nameStr.Cut(0, pos + 1); } - const NXArchInfo *archInfo = + const NXArchInfo* archInfo = NXGetArchInfoFromCpuType(header->cputype, header->cpusubtype); info.AddSharedLibrary(SharedLibrary(start, start + size, 0, uuid, nameStr, @@ -177,7 +177,7 @@ SharedLibraryInfo SharedLibraryInfo::GetInfoForSelf() { mozilla::StaticMutexAutoLock lock(sSharedLibrariesMutex); SharedLibraryInfo sharedLibraryInfo; - for (auto &info : *sSharedLibrariesList) { + for (auto& info : *sSharedLibrariesList) { addSharedLibrary(info.header, info.path.c_str(), sharedLibraryInfo); } diff --git a/tools/profiler/lul/LulDwarf.cpp b/tools/profiler/lul/LulDwarf.cpp index 8af1a99fcab4c..c83296fc620de 100644 --- a/tools/profiler/lul/LulDwarf.cpp +++ b/tools/profiler/lul/LulDwarf.cpp @@ -96,7 +96,7 @@ void ByteReader::SetAddressSize(uint8 size) { } } -uint64 ByteReader::ReadInitialLength(const char *start, size_t *len) { +uint64 ByteReader::ReadInitialLength(const char* start, size_t* len) { const uint64 initial_length = ReadFourBytes(start); start += 4; @@ -138,9 +138,9 @@ bool ByteReader::UsableEncoding(DwarfPointerEncoding encoding) const { } } -uint64 ByteReader::ReadEncodedPointer(const char *buffer, +uint64 ByteReader::ReadEncodedPointer(const char* buffer, DwarfPointerEncoding encoding, - size_t *len) const { + size_t* len) const { // UsableEncoding doesn't approve of DW_EH_PE_omit, so we shouldn't // see it here. MOZ_ASSERT(encoding != DW_EH_PE_omit); @@ -167,7 +167,7 @@ uint64 ByteReader::ReadEncodedPointer(const char *buffer, // Round up to the next boundary. uint64 aligned = (offset + AddressSize() - 1) & -AddressSize(); // Convert back to a pointer. - const char *aligned_buffer = buffer_base_ + (aligned - skew); + const char* aligned_buffer = buffer_base_ + (aligned - skew); // Finally, store the length and actually fetch the pointer. *len = aligned_buffer - buffer + AddressSize(); return ReadAddress(aligned_buffer); @@ -302,16 +302,16 @@ class CallFrameInfo::Rule { // recovered using this rule. If REG is kCFARegister, then this rule // describes how to compute the canonical frame address. Return what the // HANDLER member function returned. - virtual bool Handle(Handler *handler, uint64 address, int reg) const = 0; + virtual bool Handle(Handler* handler, uint64 address, int reg) const = 0; // Equality on rules. We use these to decide which rules we need // to report after a DW_CFA_restore_state instruction. - virtual bool operator==(const Rule &rhs) const = 0; + virtual bool operator==(const Rule& rhs) const = 0; - bool operator!=(const Rule &rhs) const { return !(*this == rhs); } + bool operator!=(const Rule& rhs) const { return !(*this == rhs); } // Return a pointer to a copy of this rule. - virtual Rule *Copy() const = 0; + virtual Rule* Copy() const = 0; // If this is a base+offset rule, change its base register to REG. // Otherwise, do nothing. (Ugly, but required for DW_CFA_def_cfa_register.) @@ -343,14 +343,14 @@ class CallFrameInfo::UndefinedRule : public CallFrameInfo::Rule { UndefinedRule() {} ~UndefinedRule() {} CFIRTag getTag() const override { return CFIR_UNDEFINED_RULE; } - bool Handle(Handler *handler, uint64 address, int reg) const override { + bool Handle(Handler* handler, uint64 address, int reg) const override { return handler->UndefinedRule(address, reg); } - bool operator==(const Rule &rhs) const override { + bool operator==(const Rule& rhs) const override { if (rhs.getTag() != CFIR_UNDEFINED_RULE) return false; return true; } - Rule *Copy() const override { return new UndefinedRule(*this); } + Rule* Copy() const override { return new UndefinedRule(*this); } }; // Rule: the register's value is the same as that it had in the caller. @@ -359,14 +359,14 @@ class CallFrameInfo::SameValueRule : public CallFrameInfo::Rule { SameValueRule() {} ~SameValueRule() {} CFIRTag getTag() const override { return CFIR_SAME_VALUE_RULE; } - bool Handle(Handler *handler, uint64 address, int reg) const override { + bool Handle(Handler* handler, uint64 address, int reg) const override { return handler->SameValueRule(address, reg); } - bool operator==(const Rule &rhs) const override { + bool operator==(const Rule& rhs) const override { if (rhs.getTag() != CFIR_SAME_VALUE_RULE) return false; return true; } - Rule *Copy() const override { return new SameValueRule(*this); } + Rule* Copy() const override { return new SameValueRule(*this); } }; // Rule: the register is saved at OFFSET from BASE_REGISTER. BASE_REGISTER @@ -377,16 +377,16 @@ class CallFrameInfo::OffsetRule : public CallFrameInfo::Rule { : base_register_(base_register), offset_(offset) {} ~OffsetRule() {} CFIRTag getTag() const override { return CFIR_OFFSET_RULE; } - bool Handle(Handler *handler, uint64 address, int reg) const override { + bool Handle(Handler* handler, uint64 address, int reg) const override { return handler->OffsetRule(address, reg, base_register_, offset_); } - bool operator==(const Rule &rhs) const override { + bool operator==(const Rule& rhs) const override { if (rhs.getTag() != CFIR_OFFSET_RULE) return false; - const OffsetRule *our_rhs = static_cast(&rhs); + const OffsetRule* our_rhs = static_cast(&rhs); return (base_register_ == our_rhs->base_register_ && offset_ == our_rhs->offset_); } - Rule *Copy() const override { return new OffsetRule(*this); } + Rule* Copy() const override { return new OffsetRule(*this); } // We don't actually need SetBaseRegister or SetOffset here, since they // are only ever applied to CFA rules, for DW_CFA_def_cfa_offset, and it // doesn't make sense to use OffsetRule for computing the CFA: it @@ -405,16 +405,16 @@ class CallFrameInfo::ValOffsetRule : public CallFrameInfo::Rule { : base_register_(base_register), offset_(offset) {} ~ValOffsetRule() {} CFIRTag getTag() const override { return CFIR_VAL_OFFSET_RULE; } - bool Handle(Handler *handler, uint64 address, int reg) const override { + bool Handle(Handler* handler, uint64 address, int reg) const override { return handler->ValOffsetRule(address, reg, base_register_, offset_); } - bool operator==(const Rule &rhs) const override { + bool operator==(const Rule& rhs) const override { if (rhs.getTag() != CFIR_VAL_OFFSET_RULE) return false; - const ValOffsetRule *our_rhs = static_cast(&rhs); + const ValOffsetRule* our_rhs = static_cast(&rhs); return (base_register_ == our_rhs->base_register_ && offset_ == our_rhs->offset_); } - Rule *Copy() const override { return new ValOffsetRule(*this); } + Rule* Copy() const override { return new ValOffsetRule(*this); } void SetBaseRegister(unsigned reg) override { base_register_ = reg; } void SetOffset(long long offset) override { offset_ = offset; } @@ -430,15 +430,15 @@ class CallFrameInfo::RegisterRule : public CallFrameInfo::Rule { : register_number_(register_number) {} ~RegisterRule() {} CFIRTag getTag() const override { return CFIR_REGISTER_RULE; } - bool Handle(Handler *handler, uint64 address, int reg) const override { + bool Handle(Handler* handler, uint64 address, int reg) const override { return handler->RegisterRule(address, reg, register_number_); } - bool operator==(const Rule &rhs) const override { + bool operator==(const Rule& rhs) const override { if (rhs.getTag() != CFIR_REGISTER_RULE) return false; - const RegisterRule *our_rhs = static_cast(&rhs); + const RegisterRule* our_rhs = static_cast(&rhs); return (register_number_ == our_rhs->register_number_); } - Rule *Copy() const override { return new RegisterRule(*this); } + Rule* Copy() const override { return new RegisterRule(*this); } private: int register_number_; @@ -447,18 +447,18 @@ class CallFrameInfo::RegisterRule : public CallFrameInfo::Rule { // Rule: EXPRESSION evaluates to the address at which the register is saved. class CallFrameInfo::ExpressionRule : public CallFrameInfo::Rule { public: - explicit ExpressionRule(const string &expression) : expression_(expression) {} + explicit ExpressionRule(const string& expression) : expression_(expression) {} ~ExpressionRule() {} CFIRTag getTag() const override { return CFIR_EXPRESSION_RULE; } - bool Handle(Handler *handler, uint64 address, int reg) const override { + bool Handle(Handler* handler, uint64 address, int reg) const override { return handler->ExpressionRule(address, reg, expression_); } - bool operator==(const Rule &rhs) const override { + bool operator==(const Rule& rhs) const override { if (rhs.getTag() != CFIR_EXPRESSION_RULE) return false; - const ExpressionRule *our_rhs = static_cast(&rhs); + const ExpressionRule* our_rhs = static_cast(&rhs); return (expression_ == our_rhs->expression_); } - Rule *Copy() const override { return new ExpressionRule(*this); } + Rule* Copy() const override { return new ExpressionRule(*this); } private: string expression_; @@ -467,20 +467,20 @@ class CallFrameInfo::ExpressionRule : public CallFrameInfo::Rule { // Rule: EXPRESSION evaluates to the previous value of the register. class CallFrameInfo::ValExpressionRule : public CallFrameInfo::Rule { public: - explicit ValExpressionRule(const string &expression) + explicit ValExpressionRule(const string& expression) : expression_(expression) {} ~ValExpressionRule() {} CFIRTag getTag() const override { return CFIR_VAL_EXPRESSION_RULE; } - bool Handle(Handler *handler, uint64 address, int reg) const override { + bool Handle(Handler* handler, uint64 address, int reg) const override { return handler->ValExpressionRule(address, reg, expression_); } - bool operator==(const Rule &rhs) const override { + bool operator==(const Rule& rhs) const override { if (rhs.getTag() != CFIR_VAL_EXPRESSION_RULE) return false; - const ValExpressionRule *our_rhs = - static_cast(&rhs); + const ValExpressionRule* our_rhs = + static_cast(&rhs); return (expression_ == our_rhs->expression_); } - Rule *Copy() const override { return new ValExpressionRule(*this); } + Rule* Copy() const override { return new ValExpressionRule(*this); } private: string expression_; @@ -490,13 +490,13 @@ class CallFrameInfo::ValExpressionRule : public CallFrameInfo::Rule { class CallFrameInfo::RuleMap { public: RuleMap() : cfa_rule_(NULL) {} - RuleMap(const RuleMap &rhs) : cfa_rule_(NULL) { *this = rhs; } + RuleMap(const RuleMap& rhs) : cfa_rule_(NULL) { *this = rhs; } ~RuleMap() { Clear(); } - RuleMap &operator=(const RuleMap &rhs); + RuleMap& operator=(const RuleMap& rhs); // Set the rule for computing the CFA to RULE. Take ownership of RULE. - void SetCFARule(Rule *rule) { + void SetCFARule(Rule* rule) { delete cfa_rule_; cfa_rule_ = rule; } @@ -505,39 +505,39 @@ class CallFrameInfo::RuleMap { // ownership of the rule. We use this for DW_CFA_def_cfa_offset and // DW_CFA_def_cfa_register, and for detecting references to the CFA before // a rule for it has been established. - Rule *CFARule() const { return cfa_rule_; } + Rule* CFARule() const { return cfa_rule_; } // Return the rule for REG, or NULL if there is none. The caller takes // ownership of the result. - Rule *RegisterRule(int reg) const; + Rule* RegisterRule(int reg) const; // Set the rule for computing REG to RULE. Take ownership of RULE. - void SetRegisterRule(int reg, Rule *rule); + void SetRegisterRule(int reg, Rule* rule); // Make all the appropriate calls to HANDLER as if we were changing from // this RuleMap to NEW_RULES at ADDRESS. We use this to implement // DW_CFA_restore_state, where lots of rules can change simultaneously. // Return true if all handlers returned true; otherwise, return false. - bool HandleTransitionTo(Handler *handler, uint64 address, - const RuleMap &new_rules) const; + bool HandleTransitionTo(Handler* handler, uint64 address, + const RuleMap& new_rules) const; private: // A map from register numbers to Rules. - typedef std::map RuleByNumber; + typedef std::map RuleByNumber; // Remove all register rules and clear cfa_rule_. void Clear(); // The rule for computing the canonical frame address. This RuleMap owns // this rule. - Rule *cfa_rule_; + Rule* cfa_rule_; // A map from register numbers to postfix expressions to recover // their values. This RuleMap owns the Rules the map refers to. RuleByNumber registers_; }; -CallFrameInfo::RuleMap &CallFrameInfo::RuleMap::operator=(const RuleMap &rhs) { +CallFrameInfo::RuleMap& CallFrameInfo::RuleMap::operator=(const RuleMap& rhs) { Clear(); // Since each map owns the rules it refers to, assignment must copy them. if (rhs.cfa_rule_) cfa_rule_ = rhs.cfa_rule_->Copy(); @@ -547,7 +547,7 @@ CallFrameInfo::RuleMap &CallFrameInfo::RuleMap::operator=(const RuleMap &rhs) { return *this; } -CallFrameInfo::Rule *CallFrameInfo::RuleMap::RegisterRule(int reg) const { +CallFrameInfo::Rule* CallFrameInfo::RuleMap::RegisterRule(int reg) const { MOZ_ASSERT(reg != Handler::kCFARegister); RuleByNumber::const_iterator it = registers_.find(reg); if (it != registers_.end()) @@ -556,16 +556,16 @@ CallFrameInfo::Rule *CallFrameInfo::RuleMap::RegisterRule(int reg) const { return NULL; } -void CallFrameInfo::RuleMap::SetRegisterRule(int reg, Rule *rule) { +void CallFrameInfo::RuleMap::SetRegisterRule(int reg, Rule* rule) { MOZ_ASSERT(reg != Handler::kCFARegister); MOZ_ASSERT(rule); - Rule **slot = ®isters_[reg]; + Rule** slot = ®isters_[reg]; delete *slot; *slot = rule; } bool CallFrameInfo::RuleMap::HandleTransitionTo( - Handler *handler, uint64 address, const RuleMap &new_rules) const { + Handler* handler, uint64 address, const RuleMap& new_rules) const { // Transition from cfa_rule_ to new_rules.cfa_rule_. if (cfa_rule_ && new_rules.cfa_rule_) { if (*cfa_rule_ != *new_rules.cfa_rule_ && @@ -643,7 +643,7 @@ class CallFrameInfo::State { public: // Create a call frame information interpreter state with the given // reporter, reader, handler, and initial call frame info address. - State(ByteReader *reader, Handler *handler, Reporter *reporter, + State(ByteReader* reader, Handler* handler, Reporter* reporter, uint64 address) : reader_(reader), handler_(handler), @@ -660,11 +660,11 @@ class CallFrameInfo::State { // Interpret instructions from CIE, save the resulting rule set for // DW_CFA_restore instructions, and return true. On error, report // the problem to reporter_ and return false. - bool InterpretCIE(const CIE &cie); + bool InterpretCIE(const CIE& cie); // Interpret instructions from FDE, and return true. On error, // report the problem to reporter_ and return false. - bool InterpretFDE(const FDE &fde); + bool InterpretFDE(const FDE& fde); private: // The operands of a CFI instruction, for ParseOperands. @@ -694,7 +694,7 @@ class CallFrameInfo::State { // '8' an eight-byte offset (OPERANDS->offset) // 'e' a DW_FORM_block holding a (OPERANDS->expression) // DWARF expression - bool ParseOperands(const char *format, Operands *operands); + bool ParseOperands(const char* format, Operands* operands); // Interpret one CFI instruction from STATE's instruction stream, update // STATE, report any rule changes to handler_, and return true. On @@ -717,7 +717,7 @@ class CallFrameInfo::State { // Specify that REG can be recovered using RULE, and return true. On // failure, report and return false. - bool DoRule(unsigned reg, Rule *rule); + bool DoRule(unsigned reg, Rule* rule); // Specify that REG can be found at OFFSET from the CFA, and return true. // On failure, report and return false. (Subroutine for DW_CFA_offset, @@ -745,23 +745,23 @@ class CallFrameInfo::State { } // For reading multi-byte values with the appropriate endianness. - ByteReader *reader_; + ByteReader* reader_; // The handler to which we should report the data we find. - Handler *handler_; + Handler* handler_; // For reporting problems in the info we're parsing. - Reporter *reporter_; + Reporter* reporter_; // The code address to which the next instruction in the stream applies. uint64 address_; // The entry whose instructions we are currently processing. This is // first a CIE, and then an FDE. - const Entry *entry_; + const Entry* entry_; // The next instruction to process. - const char *cursor_; + const char* cursor_; // The current set of rules. RuleMap rules_; @@ -773,10 +773,10 @@ class CallFrameInfo::State { // A stack of saved states, for DW_CFA_remember_state and // DW_CFA_restore_state. - std::stack *saved_rules_; + std::stack* saved_rules_; }; -bool CallFrameInfo::State::InterpretCIE(const CIE &cie) { +bool CallFrameInfo::State::InterpretCIE(const CIE& cie) { entry_ = &cie; cursor_ = entry_->instructions; while (cursor_ < entry_->end) @@ -787,7 +787,7 @@ bool CallFrameInfo::State::InterpretCIE(const CIE &cie) { return true; } -bool CallFrameInfo::State::InterpretFDE(const FDE &fde) { +bool CallFrameInfo::State::InterpretFDE(const FDE& fde) { entry_ = &fde; cursor_ = entry_->instructions; while (cursor_ < entry_->end) @@ -795,10 +795,10 @@ bool CallFrameInfo::State::InterpretFDE(const FDE &fde) { return true; } -bool CallFrameInfo::State::ParseOperands(const char *format, - Operands *operands) { +bool CallFrameInfo::State::ParseOperands(const char* format, + Operands* operands) { size_t len; - const char *operand; + const char* operand; for (operand = format; *operand; operand++) { size_t bytes_left = entry_->end - cursor_; @@ -870,7 +870,7 @@ bool CallFrameInfo::State::ParseOperands(const char *format, } bool CallFrameInfo::State::DoInstruction() { - CIE *cie = entry_->cie; + CIE* cie = entry_->cie; Operands ops; // Our entry's kind should have been set by now. @@ -959,7 +959,7 @@ bool CallFrameInfo::State::DoInstruction() { // Change the base register used to compute the CFA. case DW_CFA_def_cfa_register: { - Rule *cfa_rule = rules_.CFARule(); + Rule* cfa_rule = rules_.CFARule(); if (!cfa_rule) { reporter_->NoCFARule(entry_->offset, entry_->kind, CursorOffset()); return false; @@ -987,7 +987,7 @@ bool CallFrameInfo::State::DoInstruction() { // Specify an expression whose value is the CFA. case DW_CFA_def_cfa_expression: { if (!ParseOperands("e", &ops)) return false; - Rule *rule = new ValExpressionRule(ops.expression); + Rule* rule = new ValExpressionRule(ops.expression); rules_.SetCFARule(rule); if (!rule->Handle(handler_, address_, Handler::kCFARegister)) return false; @@ -1095,7 +1095,7 @@ bool CallFrameInfo::State::DoInstruction() { CursorOffset()); return false; } - const RuleMap &new_rules = saved_rules_->top(); + const RuleMap& new_rules = saved_rules_->top(); if (rules_.CFARule() && !new_rules.CFARule()) { reporter_->ClearingCFARule(entry_->offset, entry_->kind, CursorOffset()); @@ -1146,13 +1146,13 @@ bool CallFrameInfo::State::DoInstruction() { } bool CallFrameInfo::State::DoDefCFA(unsigned base_register, long offset) { - Rule *rule = new ValOffsetRule(base_register, offset); + Rule* rule = new ValOffsetRule(base_register, offset); rules_.SetCFARule(rule); return rule->Handle(handler_, address_, Handler::kCFARegister); } bool CallFrameInfo::State::DoDefCFAOffset(long offset) { - Rule *cfa_rule = rules_.CFARule(); + Rule* cfa_rule = rules_.CFARule(); if (!cfa_rule) { reporter_->NoCFARule(entry_->offset, entry_->kind, CursorOffset()); return false; @@ -1161,7 +1161,7 @@ bool CallFrameInfo::State::DoDefCFAOffset(long offset) { return cfa_rule->Handle(handler_, address_, Handler::kCFARegister); } -bool CallFrameInfo::State::DoRule(unsigned reg, Rule *rule) { +bool CallFrameInfo::State::DoRule(unsigned reg, Rule* rule) { rules_.SetRegisterRule(reg, rule); return rule->Handle(handler_, address_, reg); } @@ -1188,7 +1188,7 @@ bool CallFrameInfo::State::DoRestore(unsigned reg) { reporter_->RestoreInCIE(entry_->offset, CursorOffset()); return false; } - Rule *rule = cie_rules_.RegisterRule(reg); + Rule* rule = cie_rules_.RegisterRule(reg); if (!rule) { // This isn't really the right thing to do, but since CFI generally // only mentions callee-saves registers, and GCC's convention for @@ -1199,8 +1199,8 @@ bool CallFrameInfo::State::DoRestore(unsigned reg) { return DoRule(reg, rule); } -bool CallFrameInfo::ReadEntryPrologue(const char *cursor, Entry *entry) { - const char *buffer_end = buffer_ + buffer_length_; +bool CallFrameInfo::ReadEntryPrologue(const char* cursor, Entry* entry) { + const char* buffer_end = buffer_ + buffer_length_; // Initialize enough of ENTRY for use in error reporting. entry->offset = cursor - buffer_; @@ -1275,8 +1275,8 @@ bool CallFrameInfo::ReadEntryPrologue(const char *cursor, Entry *entry) { return true; } -bool CallFrameInfo::ReadCIEFields(CIE *cie) { - const char *cursor = cie->fields; +bool CallFrameInfo::ReadCIEFields(CIE* cie) { + const char* cursor = cie->fields; size_t len; MOZ_ASSERT(cie->kind == kCIE); @@ -1306,11 +1306,11 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) { return false; } - const char *augmentation_start = cursor; - const void *augmentation_end = + const char* augmentation_start = cursor; + const void* augmentation_end = memchr(augmentation_start, '\0', cie->end - augmentation_start); if (!augmentation_end) return ReportIncomplete(cie); - cursor = static_cast(augmentation_end); + cursor = static_cast(augmentation_end); cie->augmentation = string(augmentation_start, cursor - augmentation_start); // Skip the terminating '\0'. cursor++; @@ -1336,7 +1336,7 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) { } uint8_t address_size = reader_->ReadOneByte(cursor); cursor++; - if (address_size != sizeof(void *)) { + if (address_size != sizeof(void*)) { // This is not per-se invalid CFI. But we can reasonably expect to // be running on a target of the same word size as the CFI is for, // so we reject this case. @@ -1385,9 +1385,9 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) { if (size_t(cie->end - cursor) < len + data_size) return ReportIncomplete(cie); cursor += len; - const char *data = cursor; + const char* data = cursor; cursor += data_size; - const char *data_end = cursor; + const char* data_end = cursor; cie->has_z_lsda = false; cie->has_z_personality = false; @@ -1476,8 +1476,8 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) { return true; } -bool CallFrameInfo::ReadFDEFields(FDE *fde) { - const char *cursor = fde->fields; +bool CallFrameInfo::ReadFDEFields(FDE* fde) { + const char* cursor = fde->fields; size_t size; // At this point, for Dwarf 4 and above, we are assuming that the @@ -1546,10 +1546,10 @@ bool CallFrameInfo::ReadFDEFields(FDE *fde) { } bool CallFrameInfo::Start() { - const char *buffer_end = buffer_ + buffer_length_; - const char *cursor; + const char* buffer_end = buffer_ + buffer_length_; + const char* cursor; bool all_ok = true; - const char *entry_end; + const char* entry_end; bool ok; // Traverse all the entries in buffer_, skipping CIEs and offering @@ -1665,7 +1665,7 @@ bool CallFrameInfo::Start() { return all_ok; } -const char *CallFrameInfo::KindName(EntryKind kind) { +const char* CallFrameInfo::KindName(EntryKind kind) { if (kind == CallFrameInfo::kUnknown) return "entry"; else if (kind == CallFrameInfo::kCIE) @@ -1678,7 +1678,7 @@ const char *CallFrameInfo::KindName(EntryKind kind) { } } -bool CallFrameInfo::ReportIncomplete(Entry *entry) { +bool CallFrameInfo::ReportIncomplete(Entry* entry) { reporter_->Incomplete(entry->offset, entry->kind); return false; } @@ -1730,7 +1730,7 @@ void CallFrameInfo::Reporter::UnrecognizedVersion(uint64 offset, int version) { } void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64 offset, - const string &aug) { + const string& aug) { char buf[300]; SprintfLiteral(buf, "%s: CFI frame description entry at offset 0x%llx in '%s':" @@ -1740,8 +1740,8 @@ void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64 offset, } void CallFrameInfo::Reporter::InvalidDwarf4Artefact(uint64 offset, - const char *what) { - char *what_safe = strndup(what, 100); + const char* what) { + char* what_safe = strndup(what, 100); char buf[300]; SprintfLiteral(buf, "%s: CFI frame description entry at offset 0x%llx in '%s':" @@ -1923,10 +1923,10 @@ unsigned int DwarfCFIToModule::RegisterNames::MIPS() { } // See prototype for comments. -int32_t parseDwarfExpr(Summariser *summ, const ByteReader *reader, string expr, +int32_t parseDwarfExpr(Summariser* summ, const ByteReader* reader, string expr, bool debug, bool pushCfaAtStart, bool derefAtEnd) { - const char *cursor = expr.c_str(); - const char *end1 = cursor + expr.length(); + const char* cursor = expr.c_str(); + const char* end1 = cursor + expr.length(); char buf[100]; if (debug) { @@ -1946,7 +1946,7 @@ int32_t parseDwarfExpr(Summariser *summ, const ByteReader *reader, string expr, uint8 opc = reader->ReadOneByte(cursor); cursor++; - const char *nm = nullptr; + const char* nm = nullptr; PfxExprOp pxop = PX_End; switch (opc) { @@ -2074,7 +2074,7 @@ int32_t parseDwarfExpr(Summariser *summ, const ByteReader *reader, string expr, } bool DwarfCFIToModule::Entry(size_t offset, uint64 address, uint64 length, - uint8 version, const string &augmentation, + uint8 version, const string& augmentation, unsigned return_address) { if (DEBUG_DWARF) { char buf[100]; @@ -2104,7 +2104,7 @@ bool DwarfCFIToModule::Entry(size_t offset, uint64 address, uint64 length, return true; } -const UniqueString *DwarfCFIToModule::RegisterName(int i) { +const UniqueString* DwarfCFIToModule::RegisterName(int i) { if (i < 0) { MOZ_ASSERT(i == kCFARegister); return usu_->ToUniqueString(".cfa"); @@ -2174,7 +2174,7 @@ bool DwarfCFIToModule::RegisterRule(uint64 address, int reg, } bool DwarfCFIToModule::ExpressionRule(uint64 address, int reg, - const string &expression) { + const string& expression) { bool debug = !!DEBUG_DWARF; int32_t start_ix = parseDwarfExpr(summ_, reader_, expression, debug, true /*pushCfaAtStart*/, @@ -2190,7 +2190,7 @@ bool DwarfCFIToModule::ExpressionRule(uint64 address, int reg, } bool DwarfCFIToModule::ValExpressionRule(uint64 address, int reg, - const string &expression) { + const string& expression) { bool debug = !!DEBUG_DWARF; int32_t start_ix = parseDwarfExpr(summ_, reader_, expression, debug, true /*pushCfaAtStart*/, @@ -2215,7 +2215,7 @@ bool DwarfCFIToModule::End() { } void DwarfCFIToModule::Reporter::UndefinedNotSupported( - size_t offset, const UniqueString *reg) { + size_t offset, const UniqueString* reg) { char buf[300]; SprintfLiteral(buf, "DwarfCFIToModule::Reporter::UndefinedNotSupported()\n"); log_(buf); @@ -2237,7 +2237,7 @@ static bool is_power_of_2(uint64_t n) { } void DwarfCFIToModule::Reporter::ExpressionCouldNotBeSummarised( - size_t offset, const UniqueString *reg) { + size_t offset, const UniqueString* reg) { static uint64_t n_complaints = 0; // This isn't threadsafe n_complaints++; if (!is_power_of_2(n_complaints)) return; diff --git a/tools/profiler/lul/LulDwarfExt.h b/tools/profiler/lul/LulDwarfExt.h index dbfe2cab1c41f..d27f03c5e5621 100644 --- a/tools/profiler/lul/LulDwarfExt.h +++ b/tools/profiler/lul/LulDwarfExt.h @@ -121,22 +121,22 @@ class ByteReader { // Read a single byte from BUFFER and return it as an unsigned 8 bit // number. - uint8 ReadOneByte(const char *buffer) const; + uint8 ReadOneByte(const char* buffer) const; // Read two bytes from BUFFER and return them as an unsigned 16 bit // number, using this ByteReader's endianness. - uint16 ReadTwoBytes(const char *buffer) const; + uint16 ReadTwoBytes(const char* buffer) const; // Read four bytes from BUFFER and return them as an unsigned 32 bit // number, using this ByteReader's endianness. This function returns // a uint64 so that it is compatible with ReadAddress and // ReadOffset. The number it returns will never be outside the range // of an unsigned 32 bit integer. - uint64 ReadFourBytes(const char *buffer) const; + uint64 ReadFourBytes(const char* buffer) const; // Read eight bytes from BUFFER and return them as an unsigned 64 // bit number, using this ByteReader's endianness. - uint64 ReadEightBytes(const char *buffer) const; + uint64 ReadEightBytes(const char* buffer) const; // Read an unsigned LEB128 (Little Endian Base 128) number from // BUFFER and return it as an unsigned 64 bit integer. Set LEN to @@ -155,7 +155,7 @@ class ByteReader { // In other words, we break VALUE into groups of seven bits, put // them in little-endian order, and then write them as eight-bit // bytes with the high bit on all but the last. - uint64 ReadUnsignedLEB128(const char *buffer, size_t *len) const; + uint64 ReadUnsignedLEB128(const char* buffer, size_t* len) const; // Read a signed LEB128 number from BUFFER and return it as an // signed 64 bit integer. Set LEN to the number of bytes read. @@ -174,7 +174,7 @@ class ByteReader { // In other words, we break VALUE into groups of seven bits, put // them in little-endian order, and then write them as eight-bit // bytes with the high bit on all but the last. - int64 ReadSignedLEB128(const char *buffer, size_t *len) const; + int64 ReadSignedLEB128(const char* buffer, size_t* len) const; // Indicate that addresses on this architecture are SIZE bytes long. SIZE // must be either 4 or 8. (DWARF allows addresses to be any number of @@ -197,7 +197,7 @@ class ByteReader { // Read an address from BUFFER and return it as an unsigned 64 bit // integer, respecting this ByteReader's endianness and address size. You // must call SetAddressSize before calling this function. - uint64 ReadAddress(const char *buffer) const; + uint64 ReadAddress(const char* buffer) const; // DWARF actually defines two slightly different formats: 32-bit DWARF // and 64-bit DWARF. This is *not* related to the size of registers or @@ -234,14 +234,14 @@ class ByteReader { // - The 32-bit value 0xffffffff, followed by a 64-bit byte count, // indicating that the data whose length is being measured uses // the 64-bit DWARF format. - uint64 ReadInitialLength(const char *start, size_t *len); + uint64 ReadInitialLength(const char* start, size_t* len); // Read an offset from BUFFER and return it as an unsigned 64 bit // integer, respecting the ByteReader's endianness. In 32-bit DWARF, the // offset is 4 bytes long; in 64-bit DWARF, the offset is eight bytes // long. You must call ReadInitialLength or SetOffsetSize before calling // this function; see the comments above for details. - uint64 ReadOffset(const char *buffer) const; + uint64 ReadOffset(const char* buffer) const; // Return the current offset size, in bytes. // A return value of 4 indicates that we are reading 32-bit DWARF. @@ -296,7 +296,7 @@ class ByteReader { // is BUFFER_BASE. This allows us to find the address that a given // byte in our buffer would have when loaded into the program the // data describes. We need this to resolve DW_EH_PE_pcrel pointers. - void SetCFIDataBase(uint64 section_base, const char *buffer_base); + void SetCFIDataBase(uint64 section_base, const char* buffer_base); // Indicate that the base address of the program's ".text" section // is TEXT_BASE. We need this to resolve DW_EH_PE_textrel pointers. @@ -335,12 +335,12 @@ class ByteReader { // base address this reader hasn't been given, so you should check // with ValidEncoding and UsableEncoding first if you would rather // die in a more helpful way. - uint64 ReadEncodedPointer(const char *buffer, DwarfPointerEncoding encoding, - size_t *len) const; + uint64 ReadEncodedPointer(const char* buffer, DwarfPointerEncoding encoding, + size_t* len) const; private: // Function pointer type for our address and offset readers. - typedef uint64 (ByteReader::*AddressReader)(const char *) const; + typedef uint64 (ByteReader::*AddressReader)(const char*) const; // Read an offset from BUFFER and return it as an unsigned 64 bit // integer. DWARF2/3 define offsets as either 4 or 8 bytes, @@ -364,16 +364,16 @@ class ByteReader { bool have_function_base_; uint64 section_base_; uint64 text_base_, data_base_, function_base_; - const char *buffer_base_; + const char* buffer_base_; }; -inline uint8 ByteReader::ReadOneByte(const char *buffer) const { +inline uint8 ByteReader::ReadOneByte(const char* buffer) const { return buffer[0]; } -inline uint16 ByteReader::ReadTwoBytes(const char *signed_buffer) const { - const unsigned char *buffer = - reinterpret_cast(signed_buffer); +inline uint16 ByteReader::ReadTwoBytes(const char* signed_buffer) const { + const unsigned char* buffer = + reinterpret_cast(signed_buffer); const uint16 buffer0 = buffer[0]; const uint16 buffer1 = buffer[1]; if (endian_ == ENDIANNESS_LITTLE) { @@ -383,9 +383,9 @@ inline uint16 ByteReader::ReadTwoBytes(const char *signed_buffer) const { } } -inline uint64 ByteReader::ReadFourBytes(const char *signed_buffer) const { - const unsigned char *buffer = - reinterpret_cast(signed_buffer); +inline uint64 ByteReader::ReadFourBytes(const char* signed_buffer) const { + const unsigned char* buffer = + reinterpret_cast(signed_buffer); const uint32 buffer0 = buffer[0]; const uint32 buffer1 = buffer[1]; const uint32 buffer2 = buffer[2]; @@ -397,9 +397,9 @@ inline uint64 ByteReader::ReadFourBytes(const char *signed_buffer) const { } } -inline uint64 ByteReader::ReadEightBytes(const char *signed_buffer) const { - const unsigned char *buffer = - reinterpret_cast(signed_buffer); +inline uint64 ByteReader::ReadEightBytes(const char* signed_buffer) const { + const unsigned char* buffer = + reinterpret_cast(signed_buffer); const uint64 buffer0 = buffer[0]; const uint64 buffer1 = buffer[1]; const uint64 buffer2 = buffer[2]; @@ -421,8 +421,8 @@ inline uint64 ByteReader::ReadEightBytes(const char *signed_buffer) const { // information, plus one bit saying whether the number continues or // not. -inline uint64 ByteReader::ReadUnsignedLEB128(const char *buffer, - size_t *len) const { +inline uint64 ByteReader::ReadUnsignedLEB128(const char* buffer, + size_t* len) const { uint64 result = 0; size_t num_read = 0; unsigned int shift = 0; @@ -446,8 +446,8 @@ inline uint64 ByteReader::ReadUnsignedLEB128(const char *buffer, // Read a signed LEB128 number. These are like regular LEB128 // numbers, except the last byte may have a sign bit set. -inline int64 ByteReader::ReadSignedLEB128(const char *buffer, - size_t *len) const { +inline int64 ByteReader::ReadSignedLEB128(const char* buffer, + size_t* len) const { int64 result = 0; unsigned int shift = 0; size_t num_read = 0; @@ -466,18 +466,18 @@ inline int64 ByteReader::ReadSignedLEB128(const char *buffer, return result; } -inline uint64 ByteReader::ReadOffset(const char *buffer) const { +inline uint64 ByteReader::ReadOffset(const char* buffer) const { MOZ_ASSERT(this->offset_reader_); return (this->*offset_reader_)(buffer); } -inline uint64 ByteReader::ReadAddress(const char *buffer) const { +inline uint64 ByteReader::ReadAddress(const char* buffer) const { MOZ_ASSERT(this->address_reader_); return (this->*address_reader_)(buffer); } inline void ByteReader::SetCFIDataBase(uint64 section_base, - const char *buffer_base) { + const char* buffer_base) { section_base_ = section_base; buffer_base_ = buffer_base; have_section_base_ = true; @@ -732,8 +732,8 @@ class CallFrameInfo { // and language-specific data areas are described here, rather nicely: // http://www.codesourcery.com/public/cxx-abi/abi-eh.html - CallFrameInfo(const char *buffer, size_t buffer_length, ByteReader *reader, - Handler *handler, Reporter *reporter, bool eh_frame = false) + CallFrameInfo(const char* buffer, size_t buffer_length, ByteReader* reader, + Handler* handler, Reporter* reporter, bool eh_frame = false) : buffer_(buffer), buffer_length_(buffer_length), reader_(reader), @@ -749,7 +749,7 @@ class CallFrameInfo { bool Start(); // Return the textual name of KIND. For error reporting. - static const char *KindName(EntryKind kind); + static const char* KindName(EntryKind kind); private: struct CIE; @@ -761,7 +761,7 @@ class CallFrameInfo { size_t offset; // The start of this entry in the buffer. - const char *start; + const char* start; // Which kind of entry this is. // @@ -772,16 +772,16 @@ class CallFrameInfo { // The end of this entry's common prologue (initial length and id), and // the start of this entry's kind-specific fields. - const char *fields; + const char* fields; // The start of this entry's instructions. - const char *instructions; + const char* instructions; // The address past the entry's last byte in the buffer. (Note that // since offset points to the entry's initial length field, and the // length field is the number of bytes after that field, this is not // simply buffer_ + offset + length.) - const char *end; + const char* end; // For both DWARF CFI and .eh_frame sections, this is the CIE id in a // CIE, and the offset of the associated CIE in an FDE. @@ -789,7 +789,7 @@ class CallFrameInfo { // The CIE that applies to this entry, if we've parsed it. If this is a // CIE, then this field points to this structure. - CIE *cie; + CIE* cie; }; // A common information entry (CIE). @@ -858,14 +858,14 @@ class CallFrameInfo { // true. On failure, report the problem, and return false. Even if we // return false, set ENTRY->end to the first byte after the entry if we // were able to figure that out, or NULL if we weren't. - bool ReadEntryPrologue(const char *cursor, Entry *entry); + bool ReadEntryPrologue(const char* cursor, Entry* entry); // Parse the fields of a CIE after the entry prologue, including any 'z' // augmentation data. Assume that the 'Entry' fields of CIE are // populated; use CIE->fields and CIE->end as the start and limit for // parsing. On success, populate the rest of *CIE, and return true; on // failure, report the problem and return false. - bool ReadCIEFields(CIE *cie); + bool ReadCIEFields(CIE* cie); // Parse the fields of an FDE after the entry prologue, including any 'z' // augmentation data. Assume that the 'Entry' fields of *FDE are @@ -873,12 +873,12 @@ class CallFrameInfo { // parsing. Assume that FDE->cie is fully initialized. On success, // populate the rest of *FDE, and return true; on failure, report the // problem and return false. - bool ReadFDEFields(FDE *fde); + bool ReadFDEFields(FDE* fde); // Report that ENTRY is incomplete, and return false. This is just a // trivial wrapper for invoking reporter_->Incomplete; it provides a // little brevity. - bool ReportIncomplete(Entry *entry); + bool ReportIncomplete(Entry* entry); // Return true if ENCODING has the DW_EH_PE_indirect bit set. static bool IsIndirectEncoding(DwarfPointerEncoding encoding) { @@ -886,17 +886,17 @@ class CallFrameInfo { } // The contents of the DWARF .debug_info section we're parsing. - const char *buffer_; + const char* buffer_; size_t buffer_length_; // For reading multi-byte values with the appropriate endianness. - ByteReader *reader_; + ByteReader* reader_; // The handler to which we should report the data we find. - Handler *handler_; + Handler* handler_; // For reporting problems in the info we're parsing. - Reporter *reporter_; + Reporter* reporter_; // True if we are processing .eh_frame-format data. bool eh_frame_; @@ -929,7 +929,7 @@ class CallFrameInfo::Handler { // process a given FDE, the parser reiterates the appropriate CIE's // contents at the beginning of the FDE's rules. virtual bool Entry(size_t offset, uint64 address, uint64 length, - uint8 version, const std::string &augmentation, + uint8 version, const std::string& augmentation, unsigned return_address) = 0; // When the Entry function returns true, the parser calls these @@ -978,13 +978,13 @@ class CallFrameInfo::Handler { // At ADDRESS, the DWARF expression EXPRESSION yields the address at // which REG was saved. virtual bool ExpressionRule(uint64 address, int reg, - const std::string &expression) = 0; + const std::string& expression) = 0; // At ADDRESS, the DWARF expression EXPRESSION yields the caller's // value for REG. (This rule doesn't provide an address at which the // register's value is saved.) virtual bool ValExpressionRule(uint64 address, int reg, - const std::string &expression) = 0; + const std::string& expression) = 0; // Indicate that the rules for the address range reported by the // last call to Entry are complete. End should return true if @@ -1061,8 +1061,8 @@ class CallFrameInfo::Reporter { // in a Mach-O section named __debug_frame. If we support // Linux-style exception handling data, we could be reading an // .eh_frame section. - Reporter(void (*aLog)(const char *), const std::string &filename, - const std::string §ion = ".debug_frame") + Reporter(void (*aLog)(const char*), const std::string& filename, + const std::string& section = ".debug_frame") : log_(aLog), filename_(filename), section_(section) {} virtual ~Reporter() {} @@ -1094,13 +1094,13 @@ class CallFrameInfo::Reporter { // which we don't recognize. We cannot parse DWARF CFI if it uses // augmentations we don't recognize. virtual void UnrecognizedAugmentation(uint64 offset, - const std::string &augmentation); + const std::string& augmentation); // The FDE at OFFSET contains an invalid or otherwise unusable Dwarf4 // specific field (currently, only "address_size" or "segment_size"). // Parsing DWARF CFI with unexpected values here seems dubious at best, // so we stop. WHAT gives a little more information about what is wrong. - virtual void InvalidDwarf4Artefact(uint64 offset, const char *what); + virtual void InvalidDwarf4Artefact(uint64 offset, const char* what); // The pointer encoding ENCODING, specified by the CIE at OFFSET, is not // a valid encoding. @@ -1141,7 +1141,7 @@ class CallFrameInfo::Reporter { private: // A logging sink function, as supplied by LUL's user. - void (*log_)(const char *); + void (*log_)(const char*); protected: // The name of the file whose CFI we're reading. @@ -1167,24 +1167,24 @@ class DwarfCFIToModule : public CallFrameInfo::Handler { // |aLog|. FILE is the name of the file we're processing, and // SECTION is the name of the section within that file that we're // looking at (.debug_frame, .eh_frame, etc.). - Reporter(void (*aLog)(const char *), const std::string &file, - const std::string §ion) + Reporter(void (*aLog)(const char*), const std::string& file, + const std::string& section) : log_(aLog), file_(file), section_(section) {} virtual ~Reporter() {} // The DWARF CFI entry at OFFSET says that REG is undefined, but the // Breakpad symbol file format cannot express this. - virtual void UndefinedNotSupported(size_t offset, const UniqueString *reg); + virtual void UndefinedNotSupported(size_t offset, const UniqueString* reg); // The DWARF CFI entry at OFFSET says that REG uses a DWARF // expression to find its value, but parseDwarfExpr could not // convert it to a sequence of PfxInstrs. virtual void ExpressionCouldNotBeSummarised(size_t offset, - const UniqueString *reg); + const UniqueString* reg); private: // A logging sink function, as supplied by LUL's user. - void (*log_)(const char *); + void (*log_)(const char*); protected: std::string file_, section_; @@ -1220,10 +1220,10 @@ class DwarfCFIToModule : public CallFrameInfo::Handler { // // Use REPORTER for reporting problems encountered in the conversion // process. - DwarfCFIToModule(const unsigned int num_dw_regs, Reporter *reporter, - ByteReader *reader, - /*MOD*/ UniqueStringUniverse *usu, - /*OUT*/ Summariser *summ) + DwarfCFIToModule(const unsigned int num_dw_regs, Reporter* reporter, + ByteReader* reader, + /*MOD*/ UniqueStringUniverse* usu, + /*OUT*/ Summariser* summ) : summ_(summ), usu_(usu), num_dw_regs_(num_dw_regs), @@ -1233,7 +1233,7 @@ class DwarfCFIToModule : public CallFrameInfo::Handler { virtual ~DwarfCFIToModule() {} virtual bool Entry(size_t offset, uint64 address, uint64 length, - uint8 version, const std::string &augmentation, + uint8 version, const std::string& augmentation, unsigned return_address) override; virtual bool UndefinedRule(uint64 address, int reg) override; virtual bool SameValueRule(uint64 address, int reg) override; @@ -1244,29 +1244,29 @@ class DwarfCFIToModule : public CallFrameInfo::Handler { virtual bool RegisterRule(uint64 address, int reg, int base_register) override; virtual bool ExpressionRule(uint64 address, int reg, - const std::string &expression) override; + const std::string& expression) override; virtual bool ValExpressionRule(uint64 address, int reg, - const std::string &expression) override; + const std::string& expression) override; virtual bool End() override; private: // Return the name to use for register I. - const UniqueString *RegisterName(int i); + const UniqueString* RegisterName(int i); // The Summariser to which we should give entries - Summariser *summ_; + Summariser* summ_; // Universe for creating UniqueStrings in, should that be necessary. - UniqueStringUniverse *usu_; + UniqueStringUniverse* usu_; // The number of Dwarf-defined register names for this architecture. const unsigned int num_dw_regs_; // The reporter to use to report problems. - Reporter *reporter_; + Reporter* reporter_; // The ByteReader to use for parsing Dwarf expressions. - ByteReader *reader_; + ByteReader* reader_; // The section offset of the current frame description entry, for // use in error messages. @@ -1279,7 +1279,7 @@ class DwarfCFIToModule : public CallFrameInfo::Handler { // Convert the Dwarf expression in |expr| into PfxInstrs stored in the // SecMap referred to by |summ|, and return the index of the starting // PfxInstr added, which must be >= 0. In case of failure return -1. -int32_t parseDwarfExpr(Summariser *summ, const ByteReader *reader, +int32_t parseDwarfExpr(Summariser* summ, const ByteReader* reader, std::string expr, bool debug, bool pushCfaAtStart, bool derefAtEnd); diff --git a/tools/profiler/tests/gtest/LulTestDwarf.cpp b/tools/profiler/tests/gtest/LulTestDwarf.cpp index 084728faf23cf..b76f5244830c8 100644 --- a/tools/profiler/tests/gtest/LulTestDwarf.cpp +++ b/tools/profiler/tests/gtest/LulTestDwarf.cpp @@ -29,14 +29,14 @@ using testing::Test; #define DEBUG_LUL_TEST_DWARF 0 // LUL needs a callback for its logging sink. -static void gtest_logging_sink_for_LulTestDwarf(const char *str) { +static void gtest_logging_sink_for_LulTestDwarf(const char* str) { if (DEBUG_LUL_TEST_DWARF == 0) { return; } // Ignore any trailing \n, since LOG will add one anyway. size_t n = strlen(str); if (n > 0 && str[n - 1] == '\n') { - char *tmp = strdup(str); + char* tmp = strdup(str); tmp[n - 1] = 0; fprintf(stderr, "LUL-in-gtest: %s\n", tmp); free(tmp); @@ -51,7 +51,7 @@ class MockCallFrameInfoHandler : public CallFrameInfo::Handler { public: MOCK_METHOD6(Entry, bool(size_t offset, uint64 address, uint64 length, uint8 version, - const std::string &augmentation, unsigned return_address)); + const std::string& augmentation, unsigned return_address)); MOCK_METHOD2(UndefinedRule, bool(uint64 address, int reg)); MOCK_METHOD2(SameValueRule, bool(uint64 address, int reg)); MOCK_METHOD4(OffsetRule, @@ -60,9 +60,9 @@ class MockCallFrameInfoHandler : public CallFrameInfo::Handler { bool(uint64 address, int reg, int base_register, long offset)); MOCK_METHOD3(RegisterRule, bool(uint64 address, int reg, int base_register)); MOCK_METHOD3(ExpressionRule, - bool(uint64 address, int reg, const std::string &expression)); + bool(uint64 address, int reg, const std::string& expression)); MOCK_METHOD3(ValExpressionRule, - bool(uint64 address, int reg, const std::string &expression)); + bool(uint64 address, int reg, const std::string& expression)); MOCK_METHOD0(End, bool()); MOCK_METHOD2(PersonalityRoutine, bool(uint64 address, bool indirect)); MOCK_METHOD2(LanguageSpecificDataArea, bool(uint64 address, bool indirect)); @@ -79,7 +79,7 @@ class MockCallFrameErrorReporter : public CallFrameInfo::Reporter { MOCK_METHOD2(CIEPointerOutOfRange, void(uint64, uint64)); MOCK_METHOD2(BadCIEId, void(uint64, uint64)); MOCK_METHOD2(UnrecognizedVersion, void(uint64, int version)); - MOCK_METHOD2(UnrecognizedAugmentation, void(uint64, const string &)); + MOCK_METHOD2(UnrecognizedAugmentation, void(uint64, const string&)); MOCK_METHOD2(InvalidPointerEncoding, void(uint64, uint8)); MOCK_METHOD2(UnusablePointerEncoding, void(uint64, uint8)); MOCK_METHOD2(RestoreInCIE, void(uint64, uint64)); @@ -557,7 +557,7 @@ struct CFIInsnFixture : public CFIFixture { // // On return, SECTION is ready to have FDE instructions appended to // it, and its FinishEntry member called. - void StockCIEAndFDE(CFISection *section) { + void StockCIEAndFDE(CFISection* section) { // Choose appropriate constants for our address size. if (section->AddressSize() == 4) { fde_start = 0xc628ecfbU; @@ -598,8 +598,8 @@ struct CFIInsnFixture : public CFIFixture { // expecting parser.Start to return SUCCEEDS. Caller may optionally // supply, via READER, its own ByteReader. If that's absent, a // local one is used. - void ParseSection(CFISection *section, bool succeeds = true, - ByteReader *reader = nullptr) { + void ParseSection(CFISection* section, bool succeeds = true, + ByteReader* reader = nullptr) { string contents; EXPECT_TRUE(section->GetContents(&contents)); lul::Endianness endianness; @@ -610,7 +610,7 @@ struct CFIInsnFixture : public CFIFixture { endianness = ENDIANNESS_LITTLE; } ByteReader local_reader(endianness); - ByteReader *reader_to_use = reader ? reader : &local_reader; + ByteReader* reader_to_use = reader ? reader : &local_reader; reader_to_use->SetAddressSize(section->AddressSize()); CallFrameInfo parser(contents.data(), contents.size(), reader_to_use, &handler, &reporter); @@ -2050,7 +2050,7 @@ struct EHFrameFixture : public CFIInsnFixture { // Parse CFIInsnFixture::ParseSection, but parse the section as // .eh_frame data, supplying stock base addresses. - void ParseEHFrameSection(CFISection *section, bool succeeds = true) { + void ParseEHFrameSection(CFISection* section, bool succeeds = true) { EXPECT_TRUE(section->ContainsEHFrame()); string contents; EXPECT_TRUE(section->GetContents(&contents)); @@ -2538,7 +2538,7 @@ struct EvaluatePfxExprFixture { XX(0x55); XX(0x55); XX(0x55); - if (sizeof(void *) == 8) { + if (sizeof(void*) == 8) { // le64 XX(0xEF); XX(0xBE); diff --git a/tools/profiler/tests/gtest/LulTestInfrastructure.cpp b/tools/profiler/tests/gtest/LulTestInfrastructure.cpp index c39c257807016..43154b06ada67 100644 --- a/tools/profiler/tests/gtest/LulTestInfrastructure.cpp +++ b/tools/profiler/tests/gtest/LulTestInfrastructure.cpp @@ -46,7 +46,7 @@ using std::back_insert_iterator; Label::Label() : value_(new Binding()) {} Label::Label(uint64_t value) : value_(new Binding(value)) {} -Label::Label(const Label &label) { +Label::Label(const Label& label) { value_ = label.value_; value_->Acquire(); } @@ -54,12 +54,12 @@ Label::~Label() { if (value_->Release()) delete value_; } -Label &Label::operator=(uint64_t value) { +Label& Label::operator=(uint64_t value) { value_->Set(NULL, value); return *this; } -Label &Label::operator=(const Label &label) { +Label& Label::operator=(const Label& label) { value_->Set(label.value_, 0); return *this; } @@ -89,14 +89,14 @@ Label Label::operator-(uint64_t subtrahend) const { # define ALWAYS_EVALUATE_AND_ASSERT(x) assert(x) #endif -uint64_t Label::operator-(const Label &label) const { +uint64_t Label::operator-(const Label& label) const { uint64_t offset; ALWAYS_EVALUATE_AND_ASSERT(IsKnownOffsetFrom(label, &offset)); return offset; } -bool Label::IsKnownConstant(uint64_t *value_p) const { - Binding *base; +bool Label::IsKnownConstant(uint64_t* value_p) const { + Binding* base; uint64_t addend; value_->Get(&base, &addend); if (base != NULL) return false; @@ -104,7 +104,7 @@ bool Label::IsKnownConstant(uint64_t *value_p) const { return true; } -bool Label::IsKnownOffsetFrom(const Label &label, uint64_t *offset_p) const { +bool Label::IsKnownOffsetFrom(const Label& label, uint64_t* offset_p) const { Binding *label_base, *this_base; uint64_t label_addend, this_addend; label.value_->Get(&label_base, &label_addend); @@ -127,7 +127,7 @@ Label::Binding::~Binding() { if (base_ && base_ != this && base_->Release()) delete base_; } -void Label::Binding::Set(Binding *binding, uint64_t addend) { +void Label::Binding::Set(Binding* binding, uint64_t addend) { if (!base_ && !binding) { // We're equating two constants. This could be okay. assert(addend_ == addend); @@ -175,13 +175,13 @@ void Label::Binding::Set(Binding *binding, uint64_t addend) { } } -void Label::Binding::Get(Binding **base, uint64_t *addend) { +void Label::Binding::Get(Binding** base, uint64_t* addend) { if (base_ && base_ != this) { // Recurse to find the end of our reference chain (the root of our // tree), and then rewrite every binding along the chain to refer // to it directly, adjusting addends appropriately. (This is why // this member function isn't this-const.) - Binding *final_base; + Binding* final_base; uint64_t final_addend; base_->Get(&final_base, &final_addend); if (final_base) final_base->Acquire(); @@ -210,14 +210,14 @@ static inline void InsertEndian(test_assembler::Endianness endianness, } } -Section &Section::Append(Endianness endianness, size_t size, uint64_t number) { +Section& Section::Append(Endianness endianness, size_t size, uint64_t number) { InsertEndian(endianness, size, number, back_insert_iterator(contents_)); return *this; } -Section &Section::Append(Endianness endianness, size_t size, - const Label &label) { +Section& Section::Append(Endianness endianness, size_t size, + const Label& label) { // If this label's value is known, there's no reason to waste an // entry in references_ on it. uint64_t value; @@ -237,14 +237,14 @@ Section &Section::Append(Endianness endianness, size_t size, #define ENDIANNESS(e) ENDIANNESS_##e #define DEFINE_SHORT_APPEND_NUMBER_ENDIAN(e, bits) \ - Section &Section::e##bits(uint##bits##_t v) { \ + Section& Section::e##bits(uint##bits##_t v) { \ InsertEndian(ENDIANNESS(e), bits / 8, v, \ back_insert_iterator(contents_)); \ return *this; \ } #define DEFINE_SHORT_APPEND_LABEL_ENDIAN(e, bits) \ - Section &Section::e##bits(const Label &v) { \ + Section& Section::e##bits(const Label& v) { \ return Append(ENDIANNESS(e), bits / 8, v); \ } @@ -263,13 +263,13 @@ DEFINE_SHORT_APPEND_ENDIAN(B, 32); DEFINE_SHORT_APPEND_ENDIAN(B, 64); #define DEFINE_SHORT_APPEND_NUMBER_DEFAULT(bits) \ - Section &Section::D##bits(uint##bits##_t v) { \ + Section& Section::D##bits(uint##bits##_t v) { \ InsertEndian(endianness_, bits / 8, v, \ back_insert_iterator(contents_)); \ return *this; \ } #define DEFINE_SHORT_APPEND_LABEL_DEFAULT(bits) \ - Section &Section::D##bits(const Label &v) { \ + Section& Section::D##bits(const Label& v) { \ return Append(endianness_, bits / 8, v); \ } #define DEFINE_SHORT_APPEND_DEFAULT(bits) \ @@ -281,7 +281,7 @@ DEFINE_SHORT_APPEND_DEFAULT(16); DEFINE_SHORT_APPEND_DEFAULT(32); DEFINE_SHORT_APPEND_DEFAULT(64); -Section &Section::LEB128(long long value) { +Section& Section::LEB128(long long value) { while (value < -0x40 || 0x3f < value) { contents_ += (value & 0x7f) | 0x80; if (value < 0) @@ -293,7 +293,7 @@ Section &Section::LEB128(long long value) { return *this; } -Section &Section::ULEB128(uint64_t value) { +Section& Section::ULEB128(uint64_t value) { while (value > 0x7f) { contents_ += (value & 0x7f) | 0x80; value = (value >> 7); @@ -302,7 +302,7 @@ Section &Section::ULEB128(uint64_t value) { return *this; } -Section &Section::Align(size_t alignment, uint8_t pad_byte) { +Section& Section::Align(size_t alignment, uint8_t pad_byte) { // ALIGNMENT must be a power of two. assert(((alignment - 1) & alignment) == 0); size_t new_size = (contents_.size() + alignment - 1) & ~(alignment - 1); @@ -311,11 +311,11 @@ Section &Section::Align(size_t alignment, uint8_t pad_byte) { return *this; } -bool Section::GetContents(string *contents) { +bool Section::GetContents(string* contents) { // For each label reference, find the label's value, and patch it into // the section's contents. for (size_t i = 0; i < references_.size(); i++) { - Reference &r = references_[i]; + Reference& r = references_[i]; uint64_t value; if (!r.label.IsKnownConstant(&value)) { fprintf(stderr, "Undefined label #%zu at offset 0x%zx\n", i, r.offset); @@ -336,10 +336,10 @@ bool Section::GetContents(string *contents) { namespace lul_test { -CFISection &CFISection::CIEHeader(uint64_t code_alignment_factor, +CFISection& CFISection::CIEHeader(uint64_t code_alignment_factor, int data_alignment_factor, unsigned return_address_register, - uint8_t version, const string &augmentation, + uint8_t version, const string& augmentation, bool dwarf64) { assert(!entry_length_); entry_length_ = new PendingLength(); @@ -366,7 +366,7 @@ CFISection &CFISection::CIEHeader(uint64_t code_alignment_factor, return *this; } -CFISection &CFISection::FDEHeader(Label cie_pointer, uint64_t initial_location, +CFISection& CFISection::FDEHeader(Label cie_pointer, uint64_t initial_location, uint64_t address_range, bool dwarf64) { assert(!entry_length_); entry_length_ = new PendingLength(); @@ -398,7 +398,7 @@ CFISection &CFISection::FDEHeader(Label cie_pointer, uint64_t initial_location, return *this; } -CFISection &CFISection::FinishEntry() { +CFISection& CFISection::FinishEntry() { assert(entry_length_); Align(address_size_, lul::DW_CFA_nop); entry_length_->length = Here() - entry_length_->start; @@ -408,9 +408,9 @@ CFISection &CFISection::FinishEntry() { return *this; } -CFISection &CFISection::EncodedPointer(uint64_t address, +CFISection& CFISection::EncodedPointer(uint64_t address, DwarfPointerEncoding encoding, - const EncodedPointerBases &bases) { + const EncodedPointerBases& bases) { // Omitted data is extremely easy to emit. if (encoding == lul::DW_EH_PE_omit) return *this; diff --git a/tools/profiler/tests/gtest/LulTestInfrastructure.h b/tools/profiler/tests/gtest/LulTestInfrastructure.h index dc0a57633bced..772579d538fb8 100644 --- a/tools/profiler/tests/gtest/LulTestInfrastructure.h +++ b/tools/profiler/tests/gtest/LulTestInfrastructure.h @@ -111,21 +111,21 @@ class Label { public: Label(); // An undefined label. explicit Label(uint64_t value); // A label with a fixed value - Label(const Label &value); // A label equal to another. + Label(const Label& value); // A label equal to another. ~Label(); - Label &operator=(uint64_t value); - Label &operator=(const Label &value); + Label& operator=(uint64_t value); + Label& operator=(const Label& value); Label operator+(uint64_t addend) const; Label operator-(uint64_t subtrahend) const; - uint64_t operator-(const Label &subtrahend) const; + uint64_t operator-(const Label& subtrahend) const; // We could also provide == and != that work on undefined, but // related, labels. // Return true if this label's value is known. If VALUE_P is given, // set *VALUE_P to the known value if returning true. - bool IsKnownConstant(uint64_t *value_p = NULL) const; + bool IsKnownConstant(uint64_t* value_p = NULL) const; // Return true if the offset from LABEL to this label is known. If // OFFSET_P is given, set *OFFSET_P to the offset when returning true. @@ -145,7 +145,7 @@ class Label { // l-m // -10 // m-l // 10 // m.Value() // error: m's value is not known - bool IsKnownOffsetFrom(const Label &label, uint64_t *offset_p = NULL) const; + bool IsKnownOffsetFrom(const Label& label, uint64_t* offset_p = NULL) const; private: // A label's value, or if that is not yet known, how the value is @@ -176,7 +176,7 @@ class Label { // Update every binding on this binding's chain to point directly // to BINDING, or to be a constant, with addends adjusted // appropriately. - void Set(Binding *binding, uint64_t value); + void Set(Binding* binding, uint64_t value); // Return what we know about the value of this binding. // - If this binding's value is a known constant, set BASE to @@ -188,7 +188,7 @@ class Label { // value. // - If this binding is unconstrained, set BASE to this, and leave // ADDEND unchanged. - void Get(Binding **base, uint64_t *addend); + void Get(Binding** base, uint64_t* addend); private: // There are three cases: @@ -210,7 +210,7 @@ class Label { // operations on bindings do path compression: they change every // binding on the chain to point directly to the final value, // adjusting addends as appropriate. - Binding *base_; + Binding* base_; uint64_t addend_; // The number of Labels and Bindings pointing to this binding. @@ -220,7 +220,7 @@ class Label { }; // This label's value. - Binding *value_; + Binding* value_; }; // Conventions for representing larger numbers as sequences of bytes. @@ -267,14 +267,14 @@ class Section { // Append the SIZE bytes at DATA to the end of this section. Return // a reference to this section. - Section &Append(const string &data) { + Section& Append(const string& data) { contents_.append(data); return *this; }; // Append SIZE copies of BYTE to the end of this section. Return a // reference to this section. - Section &Append(size_t size, uint8_t byte) { + Section& Append(size_t size, uint8_t byte) { contents_.append(size, (char)byte); return *this; } @@ -282,8 +282,8 @@ class Section { // Append NUMBER to this section. ENDIANNESS is the endianness to // use to write the number. SIZE is the length of the number in // bytes. Return a reference to this section. - Section &Append(Endianness endianness, size_t size, uint64_t number); - Section &Append(Endianness endianness, size_t size, const Label &label); + Section& Append(Endianness endianness, size_t size, uint64_t number); + Section& Append(Endianness endianness, size_t size, const Label& label); // Append SECTION to the end of this section. The labels SECTION // refers to need not be defined yet. @@ -292,11 +292,11 @@ class Section { // SECTION. If placing SECTION within 'this' provides new // constraints on existing labels' values, then it's up to the // caller to fiddle with those labels as needed. - Section &Append(const Section §ion); + Section& Append(const Section& section); // Append the contents of DATA as a series of bytes terminated by // a NULL character. - Section &AppendCString(const string &data) { + Section& AppendCString(const string& data) { Append(data); contents_ += '\0'; return *this; @@ -318,27 +318,26 @@ class Section { // the compiler will properly sign-extend a signed value before // passing it to the function, at which point the function's // behavior is the same either way. - Section &L8(uint8_t value) { + Section& L8(uint8_t value) { contents_ += value; return *this; } - Section &B8(uint8_t value) { + Section& B8(uint8_t value) { contents_ += value; return *this; } - Section &D8(uint8_t value) { + Section& D8(uint8_t value) { contents_ += value; return *this; } Section &L16(uint16_t), &L32(uint32_t), &L64(uint64_t), &B16(uint16_t), &B32(uint32_t), &B64(uint64_t), &D16(uint16_t), &D32(uint32_t), &D64(uint64_t); - Section &L8(const Label &label), &L16(const Label &label), - &L32(const Label &label), &L64(const Label &label), - &B8(const Label &label), &B16(const Label &label), - &B32(const Label &label), &B64(const Label &label), - &D8(const Label &label), &D16(const Label &label), - &D32(const Label &label), &D64(const Label &label); + Section &L8(const Label&label), &L16(const Label&label), + &L32(const Label&label), &L64(const Label&label), &B8(const Label&label), + &B16(const Label&label), &B32(const Label&label), &B64(const Label&label), + &D8(const Label&label), &D16(const Label&label), &D32(const Label&label), + &D64(const Label&label); // Append VALUE in a signed LEB128 (Little-Endian Base 128) form. // @@ -358,7 +357,7 @@ class Section { // // Note that VALUE cannot be a Label (we would have to implement // relaxation). - Section &LEB128(long long value); + Section& LEB128(long long value); // Append VALUE in unsigned LEB128 (Little-Endian Base 128) form. // @@ -374,13 +373,13 @@ class Section { // // Note that VALUE cannot be a Label (we would have to implement // relaxation). - Section &ULEB128(uint64_t value); + Section& ULEB128(uint64_t value); // Jump to the next location aligned on an ALIGNMENT-byte boundary, // relative to the start of the section. Fill the gap with PAD_BYTE. // ALIGNMENT must be a power of two. Return a reference to this // section. - Section &Align(size_t alignment, uint8_t pad_byte = 0); + Section& Align(size_t alignment, uint8_t pad_byte = 0); // Return the current size of the section. size_t Size() const { return contents_.size(); } @@ -408,7 +407,7 @@ class Section { Label Here() const { return start_ + Size(); } // Set *LABEL to Here, and return a reference to this section. - Section &Mark(Label *label) { + Section& Mark(Label* label) { *label = Here(); return *this; } @@ -417,13 +416,13 @@ class Section { // section, set CONTENTS to the contents of this section, as a // string, and clear this section. Return true on success, or false // if there were still undefined labels. - bool GetContents(string *contents); + bool GetContents(string* contents); private: // Used internally. A reference to a label's value. struct Reference { Reference(size_t set_offset, Endianness set_endianness, size_t set_size, - const Label &set_label) + const Label& set_label) : offset(set_offset), endianness(set_endianness), size(set_size), @@ -536,7 +535,7 @@ class CFISection : public Section { // Use the addresses in BASES as the base addresses for encoded // pointers in subsequent calls to FDEHeader or EncodedPointer. // This function makes a copy of BASES. - void SetEncodedPointerBases(const EncodedPointerBases &bases) { + void SetEncodedPointerBases(const EncodedPointerBases& bases) { encoded_pointer_bases_ = bases; } @@ -549,10 +548,10 @@ class CFISection : public Section { // Before calling this function, you will typically want to use Mark // or Here to make a label to pass to FDEHeader that refers to this // CIE's position in the section. - CFISection &CIEHeader(uint64_t code_alignment_factor, + CFISection& CIEHeader(uint64_t code_alignment_factor, int data_alignment_factor, unsigned return_address_register, uint8_t version = 3, - const string &augmentation = "", bool dwarf64 = false); + const string& augmentation = "", bool dwarf64 = false); // Append a Frame Description Entry header to this section with the // given values. If dwarf64 is true, use the 64-bit DWARF initial @@ -564,18 +563,18 @@ class CFISection : public Section { // 0xffffff00 bytes. (The "initial length" is always a 32-bit // value.) Nor does it support .debug_frame sections longer than // 0xffffff00 bytes. - CFISection &FDEHeader(Label cie_pointer, uint64_t initial_location, + CFISection& FDEHeader(Label cie_pointer, uint64_t initial_location, uint64_t address_range, bool dwarf64 = false); // Note the current position as the end of the last CIE or FDE we // started, after padding with DW_CFA_nops for alignment. This // defines the label representing the entry's length, cited in the // entry's header. Return a reference to this section. - CFISection &FinishEntry(); + CFISection& FinishEntry(); // Append the contents of BLOCK as a DW_FORM_block value: an // unsigned LEB128 length, followed by that many bytes of data. - CFISection &Block(const string &block) { + CFISection& Block(const string& block) { ULEB128(block.size()); Append(block); return *this; @@ -583,7 +582,7 @@ class CFISection : public Section { // Append ADDRESS to this section, in the appropriate size and // endianness. Return a reference to this section. - CFISection &Address(uint64_t address) { + CFISection& Address(uint64_t address) { Section::Append(endianness(), address_size_, address); return *this; } @@ -597,53 +596,53 @@ class CFISection : public Section { // // (C++ doesn't let me use default arguments here, because I want to // refer to members of *this in the default argument expression.) - CFISection &EncodedPointer(uint64_t address) { + CFISection& EncodedPointer(uint64_t address) { return EncodedPointer(address, pointer_encoding_, encoded_pointer_bases_); } - CFISection &EncodedPointer(uint64_t address, DwarfPointerEncoding encoding) { + CFISection& EncodedPointer(uint64_t address, DwarfPointerEncoding encoding) { return EncodedPointer(address, encoding, encoded_pointer_bases_); } - CFISection &EncodedPointer(uint64_t address, DwarfPointerEncoding encoding, - const EncodedPointerBases &bases); + CFISection& EncodedPointer(uint64_t address, DwarfPointerEncoding encoding, + const EncodedPointerBases& bases); // Restate some member functions, to keep chaining working nicely. - CFISection &Mark(Label *label) { + CFISection& Mark(Label* label) { Section::Mark(label); return *this; } - CFISection &D8(uint8_t v) { + CFISection& D8(uint8_t v) { Section::D8(v); return *this; } - CFISection &D16(uint16_t v) { + CFISection& D16(uint16_t v) { Section::D16(v); return *this; } - CFISection &D16(Label v) { + CFISection& D16(Label v) { Section::D16(v); return *this; } - CFISection &D32(uint32_t v) { + CFISection& D32(uint32_t v) { Section::D32(v); return *this; } - CFISection &D32(const Label &v) { + CFISection& D32(const Label& v) { Section::D32(v); return *this; } - CFISection &D64(uint64_t v) { + CFISection& D64(uint64_t v) { Section::D64(v); return *this; } - CFISection &D64(const Label &v) { + CFISection& D64(const Label& v) { Section::D64(v); return *this; } - CFISection &LEB128(long long v) { + CFISection& LEB128(long long v) { Section::LEB128(v); return *this; } - CFISection &ULEB128(uint64_t v) { + CFISection& ULEB128(uint64_t v) { Section::ULEB128(v); return *this; } @@ -691,7 +690,7 @@ class CFISection : public Section { // each header needs truly fresh Label objects to cite in their // headers and track their positions. The alternative is explicit // destructor invocation and a placement new. Ick. - PendingLength *entry_length_; + PendingLength* entry_length_; // True if we are currently emitting an FDE --- that is, we have // called FDEHeader but have not yet called FinishEntry. diff --git a/uriloader/exthandler/ExternalHelperAppChild.cpp b/uriloader/exthandler/ExternalHelperAppChild.cpp index b54c2b4441a69..2ad38336e74ca 100644 --- a/uriloader/exthandler/ExternalHelperAppChild.cpp +++ b/uriloader/exthandler/ExternalHelperAppChild.cpp @@ -27,8 +27,8 @@ ExternalHelperAppChild::~ExternalHelperAppChild() {} // nsIStreamListener //----------------------------------------------------------------------------- NS_IMETHODIMP -ExternalHelperAppChild::OnDataAvailable(nsIRequest *request, - nsIInputStream *input, uint64_t offset, +ExternalHelperAppChild::OnDataAvailable(nsIRequest* request, + nsIInputStream* input, uint64_t offset, uint32_t count) { if (NS_FAILED(mStatus)) return mStatus; @@ -60,7 +60,7 @@ ExternalHelperAppChild::OnDataAvailable(nsIRequest *request, ////////////////////////////////////////////////////////////////////////////// NS_IMETHODIMP -ExternalHelperAppChild::OnStartRequest(nsIRequest *request) { +ExternalHelperAppChild::OnStartRequest(nsIRequest* request) { nsresult rv = mHandler->OnStartRequest(request); NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED); @@ -72,7 +72,7 @@ ExternalHelperAppChild::OnStartRequest(nsIRequest *request) { do_GetInterface(mHandler->GetDialogParent()); NS_ENSURE_TRUE(window, NS_ERROR_NOT_AVAILABLE); - BrowserChild *browserChild = mozilla::dom::BrowserChild::GetFrom(window); + BrowserChild* browserChild = mozilla::dom::BrowserChild::GetFrom(window); NS_ENSURE_TRUE(browserChild, NS_ERROR_NOT_AVAILABLE); nsCOMPtr divertable = do_QueryInterface(request); @@ -90,7 +90,7 @@ ExternalHelperAppChild::OnStartRequest(nsIRequest *request) { } NS_IMETHODIMP -ExternalHelperAppChild::OnStopRequest(nsIRequest *request, nsresult status) { +ExternalHelperAppChild::OnStopRequest(nsIRequest* request, nsresult status) { // mHandler can be null if we diverted the request to the parent if (mHandler) { nsresult rv = mHandler->OnStopRequest(request, status); @@ -102,13 +102,13 @@ ExternalHelperAppChild::OnStopRequest(nsIRequest *request, nsresult status) { } nsresult ExternalHelperAppChild::DivertToParent( - nsIDivertableChannel *divertable, nsIRequest *request, - BrowserChild *browserChild) { + nsIDivertableChannel* divertable, nsIRequest* request, + BrowserChild* browserChild) { // nsIDivertable must know about content conversions before being diverted. MOZ_ASSERT(mHandler); mHandler->MaybeApplyDecodingForExtension(request); - mozilla::net::ChannelDiverterChild *diverter = nullptr; + mozilla::net::ChannelDiverterChild* diverter = nullptr; nsresult rv = divertable->DivertToParent(&diverter); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; @@ -125,7 +125,7 @@ nsresult ExternalHelperAppChild::DivertToParent( } mozilla::ipc::IPCResult ExternalHelperAppChild::RecvCancel( - const nsresult &aStatus) { + const nsresult& aStatus) { mStatus = aStatus; return IPC_OK(); } diff --git a/uriloader/exthandler/ExternalHelperAppChild.h b/uriloader/exthandler/ExternalHelperAppChild.h index ba72670e533fb..92712562bd51a 100644 --- a/uriloader/exthandler/ExternalHelperAppChild.h +++ b/uriloader/exthandler/ExternalHelperAppChild.h @@ -29,15 +29,15 @@ class ExternalHelperAppChild : public PExternalHelperAppChild, // Give the listener a real nsExternalAppHandler to complete processing on // the child. - void SetHandler(nsExternalAppHandler *handler) { mHandler = handler; } + void SetHandler(nsExternalAppHandler* handler) { mHandler = handler; } - mozilla::ipc::IPCResult RecvCancel(const nsresult &aStatus); + mozilla::ipc::IPCResult RecvCancel(const nsresult& aStatus); private: virtual ~ExternalHelperAppChild(); - MOZ_MUST_USE nsresult DivertToParent(nsIDivertableChannel *divertable, - nsIRequest *request, - BrowserChild *browserChild); + MOZ_MUST_USE nsresult DivertToParent(nsIDivertableChannel* divertable, + nsIRequest* request, + BrowserChild* browserChild); RefPtr mHandler; nsresult mStatus; diff --git a/uriloader/exthandler/android/nsExternalURLHandlerService.cpp b/uriloader/exthandler/android/nsExternalURLHandlerService.cpp index 4646d1823e5f7..de32cf5dd4c98 100644 --- a/uriloader/exthandler/android/nsExternalURLHandlerService.cpp +++ b/uriloader/exthandler/android/nsExternalURLHandlerService.cpp @@ -13,8 +13,8 @@ nsExternalURLHandlerService::nsExternalURLHandlerService() {} nsExternalURLHandlerService::~nsExternalURLHandlerService() {} NS_IMETHODIMP -nsExternalURLHandlerService::GetURLHandlerInfoFromOS(nsIURI *aURL, bool *found, - nsIHandlerInfo **info) { +nsExternalURLHandlerService::GetURLHandlerInfoFromOS(nsIURI* aURL, bool* found, + nsIHandlerInfo** info) { nsCString uriSpec; aURL->GetSpec(uriSpec); return nsMIMEInfoAndroid::GetMimeInfoForURL(uriSpec, found, info); diff --git a/uriloader/exthandler/mac/nsDecodeAppleFile.cpp b/uriloader/exthandler/mac/nsDecodeAppleFile.cpp index 9aa445535e93a..29c1adf941d50 100644 --- a/uriloader/exthandler/mac/nsDecodeAppleFile.cpp +++ b/uriloader/exthandler/mac/nsDecodeAppleFile.cpp @@ -17,7 +17,7 @@ NS_INTERFACE_MAP_END nsDecodeAppleFile::nsDecodeAppleFile() { m_state = parseHeaders; m_dataBufferLength = 0; - m_dataBuffer = (unsigned char *)malloc(MAX_BUFFERSIZE); + m_dataBuffer = (unsigned char*)malloc(MAX_BUFFERSIZE); m_entries = nullptr; m_rfRefNum = -1; m_totalDataForkWritten = 0; @@ -36,8 +36,8 @@ nsDecodeAppleFile::~nsDecodeAppleFile() { if (m_entries) delete[] m_entries; } -NS_IMETHODIMP nsDecodeAppleFile::Initialize(nsIOutputStream *output, - nsIFile *file) { +NS_IMETHODIMP nsDecodeAppleFile::Initialize(nsIOutputStream* output, + nsIFile* file) { m_output = output; nsCOMPtr macFile = do_QueryInterface(file); @@ -78,10 +78,10 @@ NS_IMETHODIMP nsDecodeAppleFile::Close(void) { } if (dataOk && resourceOk) { - HFileInfo *fpb; + HFileInfo* fpb; CInfoPBRec cipbr; - fpb = (HFileInfo *)&cipbr; + fpb = (HFileInfo*)&cipbr; fpb->ioVRefNum = m_fsFileSpec.vRefNum; fpb->ioDirID = m_fsFileSpec.parID; fpb->ioNamePtr = m_fsFileSpec.name; @@ -108,13 +108,13 @@ NS_IMETHODIMP nsDecodeAppleFile::Close(void) { GetVolParmsInfoBuffer vp; DTPBRec dtp; - memset((void *)&vinfo, 0, sizeof(vinfo)); + memset((void*)&vinfo, 0, sizeof(vinfo)); vinfo.ioVRefNum = fpb->ioVRefNum; vinfo.ioBuffer = (Ptr)&vp; vinfo.ioReqCount = sizeof(vp); if (PBHGetVolParmsSync((HParmBlkPtr)&vinfo) == noErr && ((vp.vMAttrib >> bHasDesktopMgr) & 1)) { - memset((void *)&dtp, 0, sizeof(dtp)); + memset((void*)&dtp, 0, sizeof(dtp)); dtp.ioVRefNum = fpb->ioVRefNum; if (PBDTGetPath(&dtp) == noErr) { dtp.ioDTBuffer = (Ptr)&m_comment[1]; @@ -132,27 +132,27 @@ NS_IMETHODIMP nsDecodeAppleFile::Close(void) { NS_IMETHODIMP nsDecodeAppleFile::Flush(void) { return m_output->Flush(); } -NS_IMETHODIMP nsDecodeAppleFile::WriteFrom(nsIInputStream *inStr, - uint32_t count, uint32_t *_retval) { +NS_IMETHODIMP nsDecodeAppleFile::WriteFrom(nsIInputStream* inStr, + uint32_t count, uint32_t* _retval) { return m_output->WriteFrom(inStr, count, _retval); } NS_IMETHODIMP nsDecodeAppleFile::WriteSegments(nsReadSegmentFun reader, - void *closure, uint32_t count, - uint32_t *_retval) { + void* closure, uint32_t count, + uint32_t* _retval) { return m_output->WriteSegments(reader, closure, count, _retval); } -NS_IMETHODIMP nsDecodeAppleFile::IsNonBlocking(bool *aNonBlocking) { +NS_IMETHODIMP nsDecodeAppleFile::IsNonBlocking(bool* aNonBlocking) { return m_output->IsNonBlocking(aNonBlocking); } -NS_IMETHODIMP nsDecodeAppleFile::Write(const char *buffer, uint32_t bufferSize, - uint32_t *writeCount) { +NS_IMETHODIMP nsDecodeAppleFile::Write(const char* buffer, uint32_t bufferSize, + uint32_t* writeCount) { /* WARNING: to simplify my life, I presume that I should get all appledouble headers in the first block, else I would have to implement a buffer */ - const char *buffPtr = buffer; + const char* buffPtr = buffer; uint32_t dataCount; int32_t i; nsresult rv = NS_OK; @@ -308,7 +308,7 @@ NS_IMETHODIMP nsDecodeAppleFile::Write(const char *buffer, uint32_t bufferSize, if (m_output) { uint32_t writeCount; - rv = m_output->Write((const char *)buffPtr, dataCount, &writeCount); + rv = m_output->Write((const char*)buffPtr, dataCount, &writeCount); if (dataCount != writeCount) rv = NS_ERROR_FAILURE; m_totalDataForkWritten += dataCount; } @@ -337,7 +337,7 @@ NS_IMETHODIMP nsDecodeAppleFile::Write(const char *buffer, uint32_t bufferSize, dataCount = bufferSize; if (m_output) { uint32_t writeCount; - rv = m_output->Write((const char *)buffPtr, dataCount, &writeCount); + rv = m_output->Write((const char*)buffPtr, dataCount, &writeCount); if (dataCount != writeCount) rv = NS_ERROR_FAILURE; } break; diff --git a/uriloader/exthandler/mac/nsDecodeAppleFile.h b/uriloader/exthandler/mac/nsDecodeAppleFile.h index 7df1ddb6e74e2..5cacc4e5cf9dd 100644 --- a/uriloader/exthandler/mac/nsDecodeAppleFile.h +++ b/uriloader/exthandler/mac/nsDecodeAppleFile.h @@ -74,7 +74,7 @@ class nsDecodeAppleFile : public nsIOutputStream { nsDecodeAppleFile(); virtual ~nsDecodeAppleFile(); - MOZ_MUST_USE nsresult Initialize(nsIOutputStream *output, nsIFile *file); + MOZ_MUST_USE nsresult Initialize(nsIOutputStream* output, nsIFile* file); private: #define MAX_BUFFERSIZE 1024 @@ -93,11 +93,11 @@ class nsDecodeAppleFile : public nsIOutputStream { FSSpec m_fsFileSpec; SInt16 m_rfRefNum; - unsigned char *m_dataBuffer; + unsigned char* m_dataBuffer; int32_t m_dataBufferLength; ParserState m_state; ap_header m_headers; - ap_entry *m_entries; + ap_entry* m_entries; int32_t m_offset; int32_t m_dataForkOffset; int32_t m_totalDataForkWritten; diff --git a/uriloader/exthandler/mac/nsMIMEInfoMac.mm b/uriloader/exthandler/mac/nsMIMEInfoMac.mm index 0fdb9d7c83cb9..43296bf022837 100644 --- a/uriloader/exthandler/mac/nsMIMEInfoMac.mm +++ b/uriloader/exthandler/mac/nsMIMEInfoMac.mm @@ -12,7 +12,7 @@ #include "nsIFileURL.h" // We override this to make sure app bundles display their pretty name (without .app suffix) -NS_IMETHODIMP nsMIMEInfoMac::GetDefaultDescription(nsAString &aDefaultDescription) { +NS_IMETHODIMP nsMIMEInfoMac::GetDefaultDescription(nsAString& aDefaultDescription) { if (mDefaultApplication) { nsCOMPtr macFile = do_QueryInterface(mDefaultApplication); if (macFile) { @@ -26,7 +26,7 @@ } NS_IMETHODIMP -nsMIMEInfoMac::LaunchWithFile(nsIFile *aFile) { +nsMIMEInfoMac::LaunchWithFile(nsIFile* aFile) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; nsCOMPtr application; @@ -76,7 +76,7 @@ NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } -nsresult nsMIMEInfoMac::LoadUriInternal(nsIURI *aURI) { +nsresult nsMIMEInfoMac::LoadUriInternal(nsIURI* aURI) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; NS_ENSURE_ARG_POINTER(aURI); @@ -86,7 +86,7 @@ nsAutoCString uri; aURI->GetSpec(uri); if (!uri.IsEmpty()) { - CFURLRef myURLRef = ::CFURLCreateWithBytes(kCFAllocatorDefault, (const UInt8 *)uri.get(), + CFURLRef myURLRef = ::CFURLCreateWithBytes(kCFAllocatorDefault, (const UInt8*)uri.get(), strlen(uri.get()), kCFStringEncodingUTF8, NULL); if (myURLRef) { OSStatus status = ::LSOpenCFURLRef(myURLRef, NULL); diff --git a/uriloader/exthandler/mac/nsOSHelperAppService.mm b/uriloader/exthandler/mac/nsOSHelperAppService.mm index 0a00725a9da9b..3bc8fc62ac854 100644 --- a/uriloader/exthandler/mac/nsOSHelperAppService.mm +++ b/uriloader/exthandler/mac/nsOSHelperAppService.mm @@ -44,25 +44,25 @@ @class NSURLFileTypeMappingsInternal; @interface NSURLFileTypeMappings : NSObject { - NSURLFileTypeMappingsInternal *_internal; + NSURLFileTypeMappingsInternal* _internal; } -+ (NSURLFileTypeMappings *)sharedMappings; -- (NSString *)MIMETypeForExtension:(NSString *)aString; -- (NSString *)preferredExtensionForMIMEType:(NSString *)aString; -- (NSArray *)extensionsForMIMEType:(NSString *)aString; ++ (NSURLFileTypeMappings*)sharedMappings; +- (NSString*)MIMETypeForExtension:(NSString*)aString; +- (NSString*)preferredExtensionForMIMEType:(NSString*)aString; +- (NSArray*)extensionsForMIMEType:(NSString*)aString; @end nsOSHelperAppService::~nsOSHelperAppService() {} -nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char *aProtocolScheme, - bool *aHandlerExists) { +nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char* aProtocolScheme, + bool* aHandlerExists) { // CFStringCreateWithBytes() can fail even if we're not out of memory -- // for example if the 'bytes' parameter is something very weird (like // "\xFF\xFF~"), or possibly if it can't be interpreted as using what's // specified in the 'encoding' parameter. See bug 548719. CFStringRef schemeString = - ::CFStringCreateWithBytes(kCFAllocatorDefault, (const UInt8 *)aProtocolScheme, + ::CFStringCreateWithBytes(kCFAllocatorDefault, (const UInt8*)aProtocolScheme, strlen(aProtocolScheme), kCFStringEncodingUTF8, false); if (schemeString) { // LSCopyDefaultHandlerForURLScheme() can fail to find the default handler @@ -85,14 +85,14 @@ - (NSArray *)extensionsForMIMEType:(NSString *)aString; return NS_OK; } -NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString &aScheme, - nsAString &_retval) { +NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, + nsAString& _retval) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; nsresult rv = NS_ERROR_NOT_AVAILABLE; CFStringRef schemeCFString = ::CFStringCreateWithBytes( - kCFAllocatorDefault, (const UInt8 *)PromiseFlatCString(aScheme).get(), aScheme.Length(), + kCFAllocatorDefault, (const UInt8*)PromiseFlatCString(aScheme).get(), aScheme.Length(), kCFStringEncodingUTF8, false); if (schemeCFString) { @@ -120,7 +120,7 @@ - (NSArray *)extensionsForMIMEType:(NSString *)aString; buffer.SetLength(bundleNameLength); ::CFStringGetCharacters(bundleName, CFRangeMake(0, bundleNameLength), buffer.Elements()); - _retval.Assign(reinterpret_cast(buffer.Elements()), bundleNameLength); + _retval.Assign(reinterpret_cast(buffer.Elements()), bundleNameLength); rv = NS_OK; } @@ -144,8 +144,8 @@ - (NSArray *)extensionsForMIMEType:(NSString *)aString; NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } -nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t *aPlatformAppPath, - nsIFile **aFile) { +nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t* aPlatformAppPath, + nsIFile** aFile) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; nsresult rv; @@ -154,7 +154,7 @@ - (NSArray *)extensionsForMIMEType:(NSString *)aString; CFURLRef pathAsCFURL; CFStringRef pathAsCFString = ::CFStringCreateWithCharacters( - NULL, reinterpret_cast(aPlatformAppPath), NS_strlen(aPlatformAppPath)); + NULL, reinterpret_cast(aPlatformAppPath), NS_strlen(aPlatformAppPath)); if (!pathAsCFString) return NS_ERROR_OUT_OF_MEMORY; if (::CFStringGetCharacterAtIndex(pathAsCFString, 0) == '/') { @@ -212,7 +212,7 @@ - (NSArray *)extensionsForMIMEType:(NSString *)aString; // app that wants this information (e.g. the Default Apps pref pane) needs to // iterate through the entire Launch Services database -- a process which can // take several seconds.) -static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { +static CFArrayRef GetMIMETypesHandledByApp(FSRef* aAppRef) { CFURLRef appURL = ::CFURLCreateFromFSRef(kCFAllocatorDefault, aAppRef); if (!appURL) { return NULL; @@ -269,16 +269,16 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { return mimeTypes; } -nsresult nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString &aMIMEType, - const nsACString &aFileExt, bool *aFound, - nsIMIMEInfo **aMIMEInfo) { +nsresult nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType, + const nsACString& aFileExt, bool* aFound, + nsIMIMEInfo** aMIMEInfo) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSNULL; MOZ_ASSERT(XRE_IsParentProcess()); *aFound = false; - const nsCString &flatType = PromiseFlatCString(aMIMEType); - const nsCString &flatExt = PromiseFlatCString(aFileExt); + const nsCString& flatType = PromiseFlatCString(aMIMEType); + const nsCString& flatExt = PromiseFlatCString(aFileExt); MOZ_LOG(mLog, LogLevel::Debug, ("Mac: HelperAppService lookup for type '%s' ext '%s'\n", flatType.get(), flatExt.get())); @@ -286,7 +286,7 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { // Create a Mac-specific MIME info so we can use Mac-specific members. RefPtr mimeInfoMac = new nsMIMEInfoMac(aMIMEType); - NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init]; + NSAutoreleasePool* localPool = [[NSAutoreleasePool alloc] init]; OSStatus err; bool haveAppForType = false; @@ -338,7 +338,7 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { if (haveAppForType && haveAppForExt) { // Do aMIMEType and aFileExt match? - if (::FSCompareFSRefs((const FSRef *)&typeAppFSRef, (const FSRef *)&extAppFSRef) == noErr) { + if (::FSCompareFSRefs((const FSRef*)&typeAppFSRef, (const FSRef*)&extAppFSRef) == noErr) { typeAppIsDefault = true; *aFound = true; } @@ -407,12 +407,12 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { // this when aMIMEType isn't empty but haveAppForType is false -- but // the doc for this method says that if we have a MIME type (in // aMIMEType), we need to give it preference.) - NSURLFileTypeMappings *map = [NSURLFileTypeMappings sharedMappings]; - NSString *extStr = [NSString stringWithCString:flatExt.get() encoding:NSASCIIStringEncoding]; - NSString *typeStr = map ? [map MIMETypeForExtension:extStr] : NULL; + NSURLFileTypeMappings* map = [NSURLFileTypeMappings sharedMappings]; + NSString* extStr = [NSString stringWithCString:flatExt.get() encoding:NSASCIIStringEncoding]; + NSString* typeStr = map ? [map MIMETypeForExtension:extStr] : NULL; if (typeStr) { nsAutoCString mimeType; - mimeType.Assign((char *)[typeStr cStringUsingEncoding:NSASCIIStringEncoding]); + mimeType.Assign((char*)[typeStr cStringUsingEncoding:NSASCIIStringEncoding]); mimeInfoMac->SetMIMEType(mimeType); haveAppForType = true; } else { @@ -448,12 +448,12 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { CFStringRef cfAppName = NULL; if (typeAppIsDefault) { app->InitWithFSRef(&typeAppFSRef); - ::LSCopyItemAttribute((const FSRef *)&typeAppFSRef, kLSRolesAll, kLSItemDisplayName, - (CFTypeRef *)&cfAppName); + ::LSCopyItemAttribute((const FSRef*)&typeAppFSRef, kLSRolesAll, kLSItemDisplayName, + (CFTypeRef*)&cfAppName); } else { app->InitWithFSRef(&extAppFSRef); - ::LSCopyItemAttribute((const FSRef *)&extAppFSRef, kLSRolesAll, kLSItemDisplayName, - (CFTypeRef *)&cfAppName); + ::LSCopyItemAttribute((const FSRef*)&extAppFSRef, kLSRolesAll, kLSItemDisplayName, + (CFTypeRef*)&cfAppName); } if (cfAppName) { AutoTArray buffer; @@ -461,7 +461,7 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { buffer.SetLength(appNameLength); ::CFStringGetCharacters(cfAppName, CFRangeMake(0, appNameLength), buffer.Elements()); nsAutoString appName; - appName.Assign(reinterpret_cast(buffer.Elements()), appNameLength); + appName.Assign(reinterpret_cast(buffer.Elements()), appNameLength); mimeInfoMac->SetDefaultDescription(appName); ::CFRelease(cfAppName); } @@ -477,13 +477,13 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { if (*aFound && !mimeType.IsEmpty()) { // If we have a MIME type, make sure its extension list is included in our // list. - NSURLFileTypeMappings *map = [NSURLFileTypeMappings sharedMappings]; - NSString *typeStr = [NSString stringWithCString:mimeType.get() encoding:NSASCIIStringEncoding]; - NSArray *extensionsList = map ? [map extensionsForMIMEType:typeStr] : NULL; + NSURLFileTypeMappings* map = [NSURLFileTypeMappings sharedMappings]; + NSString* typeStr = [NSString stringWithCString:mimeType.get() encoding:NSASCIIStringEncoding]; + NSArray* extensionsList = map ? [map extensionsForMIMEType:typeStr] : NULL; if (extensionsList) { - for (NSString *extension in extensionsList) { + for (NSString* extension in extensionsList) { nsAutoCString ext; - ext.Assign((char *)[extension cStringUsingEncoding:NSASCIIStringEncoding]); + ext.Assign((char*)[extension cStringUsingEncoding:NSASCIIStringEncoding]); mimeInfoMac->AppendExtension(ext); } } @@ -497,7 +497,7 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { buffer.SetLength(typeDescLength); ::CFStringGetCharacters(cfTypeDesc, CFRangeMake(0, typeDescLength), buffer.Elements()); nsAutoString typeDesc; - typeDesc.Assign(reinterpret_cast(buffer.Elements()), typeDescLength); + typeDesc.Assign(reinterpret_cast(buffer.Elements()), typeDescLength); mimeInfoMac->SetDescription(typeDesc); } if (cfTypeDesc) { @@ -517,14 +517,14 @@ static CFArrayRef GetMIMETypesHandledByApp(FSRef *aAppRef) { } NS_IMETHODIMP -nsOSHelperAppService::GetProtocolHandlerInfoFromOS(const nsACString &aScheme, bool *found, - nsIHandlerInfo **_retval) { +nsOSHelperAppService::GetProtocolHandlerInfoFromOS(const nsACString& aScheme, bool* found, + nsIHandlerInfo** _retval) { NS_ASSERTION(!aScheme.IsEmpty(), "No scheme was specified!"); nsresult rv = OSProtocolHandlerExists(nsPromiseFlatCString(aScheme).get(), found); if (NS_FAILED(rv)) return rv; - nsMIMEInfoMac *handlerInfo = new nsMIMEInfoMac(aScheme, nsMIMEInfoBase::eProtocolInfo); + nsMIMEInfoMac* handlerInfo = new nsMIMEInfoMac(aScheme, nsMIMEInfoBase::eProtocolInfo); NS_ENSURE_TRUE(handlerInfo, NS_ERROR_OUT_OF_MEMORY); NS_ADDREF(*_retval = handlerInfo); diff --git a/uriloader/exthandler/nsDBusHandlerApp.cpp b/uriloader/exthandler/nsDBusHandlerApp.cpp index 85be0c952f6d9..efef6966bff85 100644 --- a/uriloader/exthandler/nsDBusHandlerApp.cpp +++ b/uriloader/exthandler/nsDBusHandlerApp.cpp @@ -24,32 +24,32 @@ NS_IMPL_ISUPPORTS_CI(nsDBusHandlerApp, nsIDBusHandlerApp, nsIHandlerApp) //////////////////////////////////////////////////////////////////////////////// //// nsIHandlerApp -NS_IMETHODIMP nsDBusHandlerApp::GetName(nsAString &aName) { +NS_IMETHODIMP nsDBusHandlerApp::GetName(nsAString& aName) { aName.Assign(mName); return NS_OK; } -NS_IMETHODIMP nsDBusHandlerApp::SetName(const nsAString &aName) { +NS_IMETHODIMP nsDBusHandlerApp::SetName(const nsAString& aName) { mName.Assign(aName); return NS_OK; } NS_IMETHODIMP nsDBusHandlerApp::SetDetailedDescription( - const nsAString &aDescription) { + const nsAString& aDescription) { mDetailedDescription.Assign(aDescription); return NS_OK; } NS_IMETHODIMP nsDBusHandlerApp::GetDetailedDescription( - nsAString &aDescription) { + nsAString& aDescription) { aDescription.Assign(mDetailedDescription); return NS_OK; } NS_IMETHODIMP -nsDBusHandlerApp::Equals(nsIHandlerApp *aHandlerApp, bool *_retval) { +nsDBusHandlerApp::Equals(nsIHandlerApp* aHandlerApp, bool* _retval) { NS_ENSURE_ARG_POINTER(aHandlerApp); // If the handler app isn't a dbus handler app, then it's not the same app. @@ -77,12 +77,12 @@ nsDBusHandlerApp::Equals(nsIHandlerApp *aHandlerApp, bool *_retval) { } NS_IMETHODIMP -nsDBusHandlerApp::LaunchWithURI(nsIURI *aURI, - nsIInterfaceRequestor *aWindowContext) { +nsDBusHandlerApp::LaunchWithURI(nsIURI* aURI, + nsIInterfaceRequestor* aWindowContext) { nsAutoCString spec; nsresult rv = aURI->GetAsciiSpec(spec); NS_ENSURE_SUCCESS(rv, rv); - const char *uri = spec.get(); + const char* uri = spec.get(); DBusError err; dbus_error_init(&err); @@ -123,42 +123,42 @@ nsDBusHandlerApp::LaunchWithURI(nsIURI *aURI, //////////////////////////////////////////////////////////////////////////////// //// nsIDBusHandlerApp -NS_IMETHODIMP nsDBusHandlerApp::GetService(nsACString &aService) { +NS_IMETHODIMP nsDBusHandlerApp::GetService(nsACString& aService) { aService.Assign(mService); return NS_OK; } -NS_IMETHODIMP nsDBusHandlerApp::SetService(const nsACString &aService) { +NS_IMETHODIMP nsDBusHandlerApp::SetService(const nsACString& aService) { mService.Assign(aService); return NS_OK; } -NS_IMETHODIMP nsDBusHandlerApp::GetMethod(nsACString &aMethod) { +NS_IMETHODIMP nsDBusHandlerApp::GetMethod(nsACString& aMethod) { aMethod.Assign(mMethod); return NS_OK; } -NS_IMETHODIMP nsDBusHandlerApp::SetMethod(const nsACString &aMethod) { +NS_IMETHODIMP nsDBusHandlerApp::SetMethod(const nsACString& aMethod) { mMethod.Assign(aMethod); return NS_OK; } -NS_IMETHODIMP nsDBusHandlerApp::GetDBusInterface(nsACString &aInterface) { +NS_IMETHODIMP nsDBusHandlerApp::GetDBusInterface(nsACString& aInterface) { aInterface.Assign(mInterface); return NS_OK; } -NS_IMETHODIMP nsDBusHandlerApp::SetDBusInterface(const nsACString &aInterface) { +NS_IMETHODIMP nsDBusHandlerApp::SetDBusInterface(const nsACString& aInterface) { mInterface.Assign(aInterface); return NS_OK; } -NS_IMETHODIMP nsDBusHandlerApp::GetObjectPath(nsACString &aObjpath) { +NS_IMETHODIMP nsDBusHandlerApp::GetObjectPath(nsACString& aObjpath) { aObjpath.Assign(mObjpath); return NS_OK; } -NS_IMETHODIMP nsDBusHandlerApp::SetObjectPath(const nsACString &aObjpath) { +NS_IMETHODIMP nsDBusHandlerApp::SetObjectPath(const nsACString& aObjpath) { mObjpath.Assign(aObjpath); return NS_OK; } diff --git a/uriloader/exthandler/nsExternalProtocolHandler.cpp b/uriloader/exthandler/nsExternalProtocolHandler.cpp index e32cf26fa2032..badcfffd56e65 100644 --- a/uriloader/exthandler/nsExternalProtocolHandler.cpp +++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp @@ -50,7 +50,7 @@ class nsExtProtocolChannel : public nsIChannel, NS_DECL_NSICHILDCHANNEL NS_DECL_NSIPARENTCHANNEL - nsExtProtocolChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo); + nsExtProtocolChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo); private: virtual ~nsExtProtocolChannel(); @@ -88,7 +88,7 @@ NS_INTERFACE_MAP_BEGIN(nsExtProtocolChannel) NS_INTERFACE_MAP_ENTRY(nsIRequestObserver) NS_INTERFACE_MAP_END -nsExtProtocolChannel::nsExtProtocolChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo) +nsExtProtocolChannel::nsExtProtocolChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo) : mUrl(aURI), mOriginalURI(aURI), mStatus(NS_OK), @@ -99,46 +99,46 @@ nsExtProtocolChannel::nsExtProtocolChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo) nsExtProtocolChannel::~nsExtProtocolChannel() {} -NS_IMETHODIMP nsExtProtocolChannel::GetLoadGroup(nsILoadGroup **aLoadGroup) { +NS_IMETHODIMP nsExtProtocolChannel::GetLoadGroup(nsILoadGroup** aLoadGroup) { NS_IF_ADDREF(*aLoadGroup = mLoadGroup); return NS_OK; } -NS_IMETHODIMP nsExtProtocolChannel::SetLoadGroup(nsILoadGroup *aLoadGroup) { +NS_IMETHODIMP nsExtProtocolChannel::SetLoadGroup(nsILoadGroup* aLoadGroup) { mLoadGroup = aLoadGroup; return NS_OK; } NS_IMETHODIMP nsExtProtocolChannel::GetNotificationCallbacks( - nsIInterfaceRequestor **aCallbacks) { + nsIInterfaceRequestor** aCallbacks) { NS_IF_ADDREF(*aCallbacks = mCallbacks); return NS_OK; } NS_IMETHODIMP nsExtProtocolChannel::SetNotificationCallbacks( - nsIInterfaceRequestor *aCallbacks) { + nsIInterfaceRequestor* aCallbacks) { mCallbacks = aCallbacks; return NS_OK; } NS_IMETHODIMP -nsExtProtocolChannel::GetSecurityInfo(nsISupports **aSecurityInfo) { +nsExtProtocolChannel::GetSecurityInfo(nsISupports** aSecurityInfo) { *aSecurityInfo = nullptr; return NS_OK; } -NS_IMETHODIMP nsExtProtocolChannel::GetOriginalURI(nsIURI **aURI) { +NS_IMETHODIMP nsExtProtocolChannel::GetOriginalURI(nsIURI** aURI) { NS_ADDREF(*aURI = mOriginalURI); return NS_OK; } -NS_IMETHODIMP nsExtProtocolChannel::SetOriginalURI(nsIURI *aURI) { +NS_IMETHODIMP nsExtProtocolChannel::SetOriginalURI(nsIURI* aURI) { NS_ENSURE_ARG_POINTER(aURI); mOriginalURI = aURI; return NS_OK; } -NS_IMETHODIMP nsExtProtocolChannel::GetURI(nsIURI **aURI) { +NS_IMETHODIMP nsExtProtocolChannel::GetURI(nsIURI** aURI) { *aURI = mUrl; NS_IF_ADDREF(*aURI); return NS_OK; @@ -189,7 +189,7 @@ nsresult nsExtProtocolChannel::OpenURL() { return rv; } -NS_IMETHODIMP nsExtProtocolChannel::Open(nsIInputStream **aStream) { +NS_IMETHODIMP nsExtProtocolChannel::Open(nsIInputStream** aStream) { nsCOMPtr listener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); @@ -198,7 +198,7 @@ NS_IMETHODIMP nsExtProtocolChannel::Open(nsIInputStream **aStream) { return OpenURL(); } -NS_IMETHODIMP nsExtProtocolChannel::AsyncOpen(nsIStreamListener *aListener) { +NS_IMETHODIMP nsExtProtocolChannel::AsyncOpen(nsIStreamListener* aListener) { nsCOMPtr listener = aListener; nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); @@ -228,7 +228,7 @@ NS_IMETHODIMP nsExtProtocolChannel::AsyncOpen(nsIStreamListener *aListener) { return OpenURL(); } -NS_IMETHODIMP nsExtProtocolChannel::GetLoadFlags(nsLoadFlags *aLoadFlags) { +NS_IMETHODIMP nsExtProtocolChannel::GetLoadFlags(nsLoadFlags* aLoadFlags) { *aLoadFlags = mLoadFlags; return NS_OK; } @@ -238,31 +238,31 @@ NS_IMETHODIMP nsExtProtocolChannel::SetLoadFlags(nsLoadFlags aLoadFlags) { return NS_OK; } -NS_IMETHODIMP nsExtProtocolChannel::GetIsDocument(bool *aIsDocument) { +NS_IMETHODIMP nsExtProtocolChannel::GetIsDocument(bool* aIsDocument) { return NS_GetIsDocumentChannel(this, aIsDocument); } -NS_IMETHODIMP nsExtProtocolChannel::GetContentType(nsACString &aContentType) { +NS_IMETHODIMP nsExtProtocolChannel::GetContentType(nsACString& aContentType) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsExtProtocolChannel::SetContentType( - const nsACString &aContentType) { + const nsACString& aContentType) { return NS_ERROR_FAILURE; } NS_IMETHODIMP nsExtProtocolChannel::GetContentCharset( - nsACString &aContentCharset) { + nsACString& aContentCharset) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsExtProtocolChannel::SetContentCharset( - const nsACString &aContentCharset) { + const nsACString& aContentCharset) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsExtProtocolChannel::GetContentDisposition( - uint32_t *aContentDisposition) { + uint32_t* aContentDisposition) { return NS_ERROR_NOT_AVAILABLE; } @@ -272,21 +272,21 @@ NS_IMETHODIMP nsExtProtocolChannel::SetContentDisposition( } NS_IMETHODIMP nsExtProtocolChannel::GetContentDispositionFilename( - nsAString &aContentDispositionFilename) { + nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsExtProtocolChannel::SetContentDispositionFilename( - const nsAString &aContentDispositionFilename) { + const nsAString& aContentDispositionFilename) { return NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP nsExtProtocolChannel::GetContentDispositionHeader( - nsACString &aContentDispositionHeader) { + nsACString& aContentDispositionHeader) { return NS_ERROR_NOT_AVAILABLE; } -NS_IMETHODIMP nsExtProtocolChannel::GetContentLength(int64_t *aContentLength) { +NS_IMETHODIMP nsExtProtocolChannel::GetContentLength(int64_t* aContentLength) { *aContentLength = -1; return NS_OK; } @@ -297,20 +297,20 @@ nsExtProtocolChannel::SetContentLength(int64_t aContentLength) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP nsExtProtocolChannel::GetOwner(nsISupports **aPrincipal) { +NS_IMETHODIMP nsExtProtocolChannel::GetOwner(nsISupports** aPrincipal) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP nsExtProtocolChannel::SetOwner(nsISupports *aPrincipal) { +NS_IMETHODIMP nsExtProtocolChannel::SetOwner(nsISupports* aPrincipal) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP nsExtProtocolChannel::GetLoadInfo(nsILoadInfo **aLoadInfo) { +NS_IMETHODIMP nsExtProtocolChannel::GetLoadInfo(nsILoadInfo** aLoadInfo) { NS_IF_ADDREF(*aLoadInfo = mLoadInfo); return NS_OK; } -NS_IMETHODIMP nsExtProtocolChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) { +NS_IMETHODIMP nsExtProtocolChannel::SetLoadInfo(nsILoadInfo* aLoadInfo) { MOZ_RELEASE_ASSERT(aLoadInfo, "loadinfo can't be null"); mLoadInfo = aLoadInfo; return NS_OK; @@ -320,16 +320,16 @@ NS_IMETHODIMP nsExtProtocolChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) { // From nsIRequest //////////////////////////////////////////////////////////////////////////////// -NS_IMETHODIMP nsExtProtocolChannel::GetName(nsACString &result) { +NS_IMETHODIMP nsExtProtocolChannel::GetName(nsACString& result) { return mUrl->GetSpec(result); } -NS_IMETHODIMP nsExtProtocolChannel::IsPending(bool *result) { +NS_IMETHODIMP nsExtProtocolChannel::IsPending(bool* result) { *result = false; return NS_OK; } -NS_IMETHODIMP nsExtProtocolChannel::GetStatus(nsresult *status) { +NS_IMETHODIMP nsExtProtocolChannel::GetStatus(nsresult* status) { *status = mStatus; return NS_OK; } @@ -360,7 +360,7 @@ NS_IMETHODIMP nsExtProtocolChannel::ConnectParent(uint32_t registrarId) { } NS_IMETHODIMP nsExtProtocolChannel::CompleteRedirectSetup( - nsIStreamListener *listener, nsISupports *context) { + nsIStreamListener* listener, nsISupports* context) { // For redirects to external protocols we AsyncOpen on the child // (not the parent) because child channel has the right docshell // (which is needed for the select dialog). @@ -372,7 +372,7 @@ NS_IMETHODIMP nsExtProtocolChannel::CompleteRedirectSetup( ////////////////////////////////////////////////////////////////////// NS_IMETHODIMP nsExtProtocolChannel::SetParentListener( - mozilla::net::HttpChannelParentListener *aListener) { + mozilla::net::HttpChannelParentListener* aListener) { // This is called as part of the connect parent operation from // ContentParent::RecvExtProtocolChannelConnectParent. Setting // this flag tells this channel to not proceed and makes AsyncOpen @@ -400,8 +400,8 @@ NS_IMETHODIMP nsExtProtocolChannel::NotifyCookieBlocked( } NS_IMETHODIMP nsExtProtocolChannel::SetClassifierMatchedInfo( - const nsACString &aList, const nsACString &aProvider, - const nsACString &aFullHash) { + const nsACString& aList, const nsACString& aProvider, + const nsACString& aFullHash) { // nothing to do return NS_OK; } @@ -429,13 +429,13 @@ NS_IMETHODIMP nsExtProtocolChannel::Delete() { return NS_OK; } -NS_IMETHODIMP nsExtProtocolChannel::OnStartRequest(nsIRequest *aRequest) { +NS_IMETHODIMP nsExtProtocolChannel::OnStartRequest(nsIRequest* aRequest) { // no data is expected MOZ_CRASH("No data expected from external protocol channel"); return NS_ERROR_UNEXPECTED; } -NS_IMETHODIMP nsExtProtocolChannel::OnStopRequest(nsIRequest *aRequest, +NS_IMETHODIMP nsExtProtocolChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) { // no data is expected MOZ_CRASH("No data expected from external protocol channel"); @@ -443,7 +443,7 @@ NS_IMETHODIMP nsExtProtocolChannel::OnStopRequest(nsIRequest *aRequest, } NS_IMETHODIMP nsExtProtocolChannel::OnDataAvailable( - nsIRequest *aRequest, nsIInputStream *aInputStream, uint64_t aOffset, + nsIRequest* aRequest, nsIInputStream* aInputStream, uint64_t aOffset, uint32_t aCount) { // no data is expected MOZ_CRASH("No data expected from external protocol channel"); @@ -470,25 +470,25 @@ NS_INTERFACE_MAP_BEGIN(nsExternalProtocolHandler) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_END -NS_IMETHODIMP nsExternalProtocolHandler::GetScheme(nsACString &aScheme) { +NS_IMETHODIMP nsExternalProtocolHandler::GetScheme(nsACString& aScheme) { aScheme = m_schemeName; return NS_OK; } -NS_IMETHODIMP nsExternalProtocolHandler::GetDefaultPort(int32_t *aDefaultPort) { +NS_IMETHODIMP nsExternalProtocolHandler::GetDefaultPort(int32_t* aDefaultPort) { *aDefaultPort = 0; return NS_OK; } NS_IMETHODIMP -nsExternalProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +nsExternalProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { // don't override anything. *_retval = false; return NS_OK; } // returns TRUE if the OS can handle this protocol scheme and false otherwise. -bool nsExternalProtocolHandler::HaveExternalProtocolHandler(nsIURI *aURI) { +bool nsExternalProtocolHandler::HaveExternalProtocolHandler(nsIURI* aURI) { MOZ_ASSERT(aURI); nsAutoCString scheme; aURI->GetScheme(scheme); @@ -504,7 +504,7 @@ bool nsExternalProtocolHandler::HaveExternalProtocolHandler(nsIURI *aURI) { return haveHandler; } -NS_IMETHODIMP nsExternalProtocolHandler::GetProtocolFlags(uint32_t *aUritype) { +NS_IMETHODIMP nsExternalProtocolHandler::GetProtocolFlags(uint32_t* aUritype) { // Make it norelative since it is a simple uri *aUritype = URI_NORELATIVE | URI_NOAUTH | URI_LOADABLE_BY_ANYONE | URI_NON_PERSISTABLE | URI_DOES_NOT_RETURN_DATA; @@ -512,17 +512,17 @@ NS_IMETHODIMP nsExternalProtocolHandler::GetProtocolFlags(uint32_t *aUritype) { } NS_IMETHODIMP nsExternalProtocolHandler::NewURI( - const nsACString &aSpec, - const char *aCharset, // ignore charset info - nsIURI *aBaseURI, nsIURI **_retval) { + const nsACString& aSpec, + const char* aCharset, // ignore charset info + nsIURI* aBaseURI, nsIURI** _retval) { return NS_MutateURI(NS_SIMPLEURIMUTATOR_CONTRACTID) .SetSpec(aSpec) .Finalize(_retval); } NS_IMETHODIMP -nsExternalProtocolHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, - nsIChannel **aRetval) { +nsExternalProtocolHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, + nsIChannel** aRetval) { NS_ENSURE_TRUE(aURI, NS_ERROR_UNKNOWN_PROTOCOL); NS_ENSURE_TRUE(aRetval, NS_ERROR_UNKNOWN_PROTOCOL); @@ -543,7 +543,7 @@ nsExternalProtocolHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, // External protocol handler interface implementation ////////////////////////////////////////////////////////////////////// NS_IMETHODIMP nsExternalProtocolHandler::ExternalAppExistsForScheme( - const nsACString &aScheme, bool *_retval) { + const nsACString& aScheme, bool* _retval) { nsCOMPtr extProtSvc( do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID)); if (extProtSvc) diff --git a/uriloader/exthandler/nsLocalHandlerApp.cpp b/uriloader/exthandler/nsLocalHandlerApp.cpp index e6b096777e5b1..5a4ae40160171 100644 --- a/uriloader/exthandler/nsLocalHandlerApp.cpp +++ b/uriloader/exthandler/nsLocalHandlerApp.cpp @@ -15,7 +15,7 @@ NS_IMPL_ISUPPORTS(nsLocalHandlerApp, nsILocalHandlerApp, nsIHandlerApp) //////////////////////////////////////////////////////////////////////////////// //// nsIHandlerApp -NS_IMETHODIMP nsLocalHandlerApp::GetName(nsAString &aName) { +NS_IMETHODIMP nsLocalHandlerApp::GetName(nsAString& aName) { if (mName.IsEmpty() && mExecutable) { // Don't want to cache this, just in case someone resets the app // without changing the description.... @@ -27,28 +27,28 @@ NS_IMETHODIMP nsLocalHandlerApp::GetName(nsAString &aName) { return NS_OK; } -NS_IMETHODIMP nsLocalHandlerApp::SetName(const nsAString &aName) { +NS_IMETHODIMP nsLocalHandlerApp::SetName(const nsAString& aName) { mName.Assign(aName); return NS_OK; } NS_IMETHODIMP -nsLocalHandlerApp::SetDetailedDescription(const nsAString &aDescription) { +nsLocalHandlerApp::SetDetailedDescription(const nsAString& aDescription) { mDetailedDescription.Assign(aDescription); return NS_OK; } NS_IMETHODIMP -nsLocalHandlerApp::GetDetailedDescription(nsAString &aDescription) { +nsLocalHandlerApp::GetDetailedDescription(nsAString& aDescription) { aDescription.Assign(mDetailedDescription); return NS_OK; } NS_IMETHODIMP -nsLocalHandlerApp::Equals(nsIHandlerApp *aHandlerApp, bool *_retval) { +nsLocalHandlerApp::Equals(nsIHandlerApp* aHandlerApp, bool* _retval) { NS_ENSURE_ARG_POINTER(aHandlerApp); *_retval = false; @@ -89,22 +89,22 @@ nsLocalHandlerApp::Equals(nsIHandlerApp *aHandlerApp, bool *_retval) { } NS_IMETHODIMP -nsLocalHandlerApp::LaunchWithURI(nsIURI *aURI, - nsIInterfaceRequestor *aWindowContext) { +nsLocalHandlerApp::LaunchWithURI(nsIURI* aURI, + nsIInterfaceRequestor* aWindowContext) { // pass the entire URI to the handler. nsAutoCString spec; aURI->GetAsciiSpec(spec); return LaunchWithIProcess(spec); } -nsresult nsLocalHandlerApp::LaunchWithIProcess(const nsCString &aArg) { +nsresult nsLocalHandlerApp::LaunchWithIProcess(const nsCString& aArg) { nsresult rv; nsCOMPtr process = do_CreateInstance(NS_PROCESS_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv = process->Init(mExecutable))) return rv; - const char *string = aArg.get(); + const char* string = aArg.get(); return process->Run(false, &string, 1); } @@ -113,19 +113,19 @@ nsresult nsLocalHandlerApp::LaunchWithIProcess(const nsCString &aArg) { //// nsILocalHandlerApp NS_IMETHODIMP -nsLocalHandlerApp::GetExecutable(nsIFile **aExecutable) { +nsLocalHandlerApp::GetExecutable(nsIFile** aExecutable) { NS_IF_ADDREF(*aExecutable = mExecutable); return NS_OK; } NS_IMETHODIMP -nsLocalHandlerApp::SetExecutable(nsIFile *aExecutable) { +nsLocalHandlerApp::SetExecutable(nsIFile* aExecutable) { mExecutable = aExecutable; return NS_OK; } NS_IMETHODIMP -nsLocalHandlerApp::GetParameterCount(uint32_t *aParameterCount) { +nsLocalHandlerApp::GetParameterCount(uint32_t* aParameterCount) { *aParameterCount = mParameters.Length(); return NS_OK; } @@ -137,13 +137,13 @@ nsLocalHandlerApp::ClearParameters() { } NS_IMETHODIMP -nsLocalHandlerApp::AppendParameter(const nsAString &aParam) { +nsLocalHandlerApp::AppendParameter(const nsAString& aParam) { mParameters.AppendElement(aParam); return NS_OK; } NS_IMETHODIMP -nsLocalHandlerApp::GetParameter(uint32_t parameterIndex, nsAString &_retval) { +nsLocalHandlerApp::GetParameter(uint32_t parameterIndex, nsAString& _retval) { if (mParameters.Length() <= parameterIndex) return NS_ERROR_INVALID_ARG; _retval.Assign(mParameters[parameterIndex]); @@ -151,7 +151,7 @@ nsLocalHandlerApp::GetParameter(uint32_t parameterIndex, nsAString &_retval) { } NS_IMETHODIMP -nsLocalHandlerApp::ParameterExists(const nsAString &aParam, bool *_retval) { +nsLocalHandlerApp::ParameterExists(const nsAString& aParam, bool* _retval) { *_retval = mParameters.Contains(aParam); return NS_OK; } diff --git a/uriloader/exthandler/nsLocalHandlerApp.h b/uriloader/exthandler/nsLocalHandlerApp.h index 5d20044afb40b..3ea8e3e4fca43 100644 --- a/uriloader/exthandler/nsLocalHandlerApp.h +++ b/uriloader/exthandler/nsLocalHandlerApp.h @@ -20,10 +20,10 @@ class nsLocalHandlerApp : public nsILocalHandlerApp { nsLocalHandlerApp() {} - nsLocalHandlerApp(const char16_t *aName, nsIFile *aExecutable) + nsLocalHandlerApp(const char16_t* aName, nsIFile* aExecutable) : mName(aName), mExecutable(aExecutable) {} - nsLocalHandlerApp(const nsAString &aName, nsIFile *aExecutable) + nsLocalHandlerApp(const nsAString& aName, nsIFile* aExecutable) : mName(aName), mExecutable(aExecutable) {} protected: @@ -42,7 +42,7 @@ class nsLocalHandlerApp : public nsILocalHandlerApp { * @param aApp The application to launch (may not be null) * @param aArg The argument to pass on the command line */ - nsresult LaunchWithIProcess(const nsCString &aArg); + nsresult LaunchWithIProcess(const nsCString& aArg); }; // any platforms that need a platform-specific class instead of just diff --git a/uriloader/exthandler/nsMIMEInfoImpl.h b/uriloader/exthandler/nsMIMEInfoImpl.h index 60e7ded91a4b0..6beffc20a0b77 100644 --- a/uriloader/exthandler/nsMIMEInfoImpl.h +++ b/uriloader/exthandler/nsMIMEInfoImpl.h @@ -37,45 +37,45 @@ class nsMIMEInfoBase : public nsIMIMEInfo { NS_DECL_THREADSAFE_ISUPPORTS // I'd use NS_DECL_NSIMIMEINFO, but I don't want GetHasDefaultHandler - NS_IMETHOD GetFileExtensions(nsIUTF8StringEnumerator **_retval) override; - NS_IMETHOD SetFileExtensions(const nsACString &aExtensions) override; - NS_IMETHOD ExtensionExists(const nsACString &aExtension, - bool *_retval) override; - NS_IMETHOD AppendExtension(const nsACString &aExtension) override; - NS_IMETHOD GetPrimaryExtension(nsACString &aPrimaryExtension) override; - NS_IMETHOD SetPrimaryExtension(const nsACString &aPrimaryExtension) override; - NS_IMETHOD GetType(nsACString &aType) override; - NS_IMETHOD GetMIMEType(nsACString &aMIMEType) override; - NS_IMETHOD GetDescription(nsAString &aDescription) override; - NS_IMETHOD SetDescription(const nsAString &aDescription) override; - NS_IMETHOD Equals(nsIMIMEInfo *aMIMEInfo, bool *_retval) override; + NS_IMETHOD GetFileExtensions(nsIUTF8StringEnumerator** _retval) override; + NS_IMETHOD SetFileExtensions(const nsACString& aExtensions) override; + NS_IMETHOD ExtensionExists(const nsACString& aExtension, + bool* _retval) override; + NS_IMETHOD AppendExtension(const nsACString& aExtension) override; + NS_IMETHOD GetPrimaryExtension(nsACString& aPrimaryExtension) override; + NS_IMETHOD SetPrimaryExtension(const nsACString& aPrimaryExtension) override; + NS_IMETHOD GetType(nsACString& aType) override; + NS_IMETHOD GetMIMEType(nsACString& aMIMEType) override; + NS_IMETHOD GetDescription(nsAString& aDescription) override; + NS_IMETHOD SetDescription(const nsAString& aDescription) override; + NS_IMETHOD Equals(nsIMIMEInfo* aMIMEInfo, bool* _retval) override; NS_IMETHOD GetPreferredApplicationHandler( - nsIHandlerApp **aPreferredAppHandler) override; + nsIHandlerApp** aPreferredAppHandler) override; NS_IMETHOD SetPreferredApplicationHandler( - nsIHandlerApp *aPreferredAppHandler) override; + nsIHandlerApp* aPreferredAppHandler) override; NS_IMETHOD GetPossibleApplicationHandlers( - nsIMutableArray **aPossibleAppHandlers) override; - NS_IMETHOD GetDefaultDescription(nsAString &aDefaultDescription) override; - NS_IMETHOD LaunchWithFile(nsIFile *aFile) override; - NS_IMETHOD LaunchWithURI(nsIURI *aURI, - nsIInterfaceRequestor *aWindowContext) override; - NS_IMETHOD GetPreferredAction(nsHandlerInfoAction *aPreferredAction) override; + nsIMutableArray** aPossibleAppHandlers) override; + NS_IMETHOD GetDefaultDescription(nsAString& aDefaultDescription) override; + NS_IMETHOD LaunchWithFile(nsIFile* aFile) override; + NS_IMETHOD LaunchWithURI(nsIURI* aURI, + nsIInterfaceRequestor* aWindowContext) override; + NS_IMETHOD GetPreferredAction(nsHandlerInfoAction* aPreferredAction) override; NS_IMETHOD SetPreferredAction(nsHandlerInfoAction aPreferredAction) override; NS_IMETHOD GetAlwaysAskBeforeHandling( - bool *aAlwaysAskBeforeHandling) override; + bool* aAlwaysAskBeforeHandling) override; NS_IMETHOD SetAlwaysAskBeforeHandling(bool aAlwaysAskBeforeHandling) override; - NS_IMETHOD GetPossibleLocalHandlers(nsIArray **_retval) override; + NS_IMETHOD GetPossibleLocalHandlers(nsIArray** _retval) override; enum HandlerClass { eMIMEInfo, eProtocolInfo }; // nsMIMEInfoBase methods - explicit nsMIMEInfoBase(const char *aMIMEType = ""); - explicit nsMIMEInfoBase(const nsACString &aMIMEType); - nsMIMEInfoBase(const nsACString &aType, HandlerClass aClass); + explicit nsMIMEInfoBase(const char* aMIMEType = ""); + explicit nsMIMEInfoBase(const nsACString& aMIMEType); + nsMIMEInfoBase(const nsACString& aType, HandlerClass aClass); - void SetMIMEType(const nsACString &aMIMEType) { mSchemeOrType = aMIMEType; } + void SetMIMEType(const nsACString& aMIMEType) { mSchemeOrType = aMIMEType; } - void SetDefaultDescription(const nsString &aDesc) { + void SetDefaultDescription(const nsString& aDesc) { mDefaultAppDescription = aDesc; } @@ -87,7 +87,7 @@ class nsMIMEInfoBase : public nsIMIMEInfo { * function also ensures that aOther's primary extension will be the same as * the one of this object. */ - void CopyBasicDataTo(nsMIMEInfoBase *aOther); + void CopyBasicDataTo(nsMIMEInfoBase* aOther); /** * Return whether this MIMEInfo has any extensions @@ -105,17 +105,17 @@ class nsMIMEInfoBase : public nsIMIMEInfo { * * @param aFile The file that should be opened */ - virtual nsresult LaunchDefaultWithFile(nsIFile *aFile) = 0; + virtual nsresult LaunchDefaultWithFile(nsIFile* aFile) = 0; /** * Loads the URI with the OS default app. * * @param aURI The URI to pass off to the OS. */ - virtual nsresult LoadUriInternal(nsIURI *aURI) = 0; + virtual nsresult LoadUriInternal(nsIURI* aURI) = 0; - static already_AddRefed InitProcess(nsIFile *aApp, - nsresult *aResult); + static already_AddRefed InitProcess(nsIFile* aApp, + nsresult* aResult); /** * This method can be used to launch the file or URI with a single @@ -126,8 +126,8 @@ class nsMIMEInfoBase : public nsIMIMEInfo { * @param aApp The application to launch (may not be null) * @param aArg The argument to pass on the command line */ - static nsresult LaunchWithIProcess(nsIFile *aApp, const nsCString &aArg); - static nsresult LaunchWithIProcess(nsIFile *aApp, const nsString &aArg); + static nsresult LaunchWithIProcess(nsIFile* aApp, const nsCString& aArg); + static nsresult LaunchWithIProcess(nsIFile* aApp, const nsString& aArg); /** * Given a file: nsIURI, return the associated nsIFile @@ -135,7 +135,7 @@ class nsMIMEInfoBase : public nsIMIMEInfo { * @param aURI the file: URI in question * @param aFile the associated nsIFile (out param) */ - static nsresult GetLocalFileFromURI(nsIURI *aURI, nsIFile **aFile); + static nsresult GetLocalFileFromURI(nsIURI* aURI, nsIFile** aFile); // member variables nsTArray @@ -162,24 +162,24 @@ class nsMIMEInfoBase : public nsIMIMEInfo { */ class nsMIMEInfoImpl : public nsMIMEInfoBase { public: - explicit nsMIMEInfoImpl(const char *aMIMEType = "") + explicit nsMIMEInfoImpl(const char* aMIMEType = "") : nsMIMEInfoBase(aMIMEType) {} - explicit nsMIMEInfoImpl(const nsACString &aMIMEType) + explicit nsMIMEInfoImpl(const nsACString& aMIMEType) : nsMIMEInfoBase(aMIMEType) {} - nsMIMEInfoImpl(const nsACString &aType, HandlerClass aClass) + nsMIMEInfoImpl(const nsACString& aType, HandlerClass aClass) : nsMIMEInfoBase(aType, aClass) {} virtual ~nsMIMEInfoImpl() {} // nsIMIMEInfo methods - NS_IMETHOD GetHasDefaultHandler(bool *_retval) override; - NS_IMETHOD GetDefaultDescription(nsAString &aDefaultDescription) override; + NS_IMETHOD GetHasDefaultHandler(bool* _retval) override; + NS_IMETHOD GetDefaultDescription(nsAString& aDefaultDescription) override; // additional methods /** * Sets the default application. Supposed to be only called by the OS Helper * App Services; the default application is immutable after it is first set. */ - void SetDefaultApplication(nsIFile *aApp) { + void SetDefaultApplication(nsIFile* aApp) { if (!mDefaultApplication) mDefaultApplication = aApp; } @@ -189,13 +189,13 @@ class nsMIMEInfoImpl : public nsMIMEInfoBase { * The base class implementation is to use LaunchWithIProcess in combination * with mDefaultApplication. Subclasses can override that behaviour. */ - virtual nsresult LaunchDefaultWithFile(nsIFile *aFile) override; + virtual nsresult LaunchDefaultWithFile(nsIFile* aFile) override; /** * Loads the URI with the OS default app. This should be overridden by each * OS's implementation. */ - virtual nsresult LoadUriInternal(nsIURI *aURI) override = 0; + virtual nsresult LoadUriInternal(nsIURI* aURI) override = 0; nsCOMPtr mDefaultApplication; ///< default application associated with this type. diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp index 9536215a441b1..8ab279d1e79e5 100644 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp @@ -14,12 +14,12 @@ # include "nsDBusHandlerApp.h" #endif -nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI *aURI) { +nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) { return nsGNOMERegistry::LoadURL(aURI); } NS_IMETHODIMP -nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) { +nsMIMEInfoUnix::GetHasDefaultHandler(bool* _retval) { // if mDefaultApplication is set, it means the application has been set from // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to // give the GNOME answer. @@ -47,7 +47,7 @@ nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval) { return NS_OK; } -nsresult nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile *aFile) { +nsresult nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile* aFile) { // if mDefaultApplication is set, it means the application has been set from // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to // give the GNOME answer. diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.h b/uriloader/exthandler/unix/nsMIMEInfoUnix.h index f5775ebdf21f4..2e32be49157f8 100644 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.h +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.h @@ -11,20 +11,20 @@ class nsMIMEInfoUnix : public nsMIMEInfoImpl { public: - explicit nsMIMEInfoUnix(const char *aMIMEType = "") + explicit nsMIMEInfoUnix(const char* aMIMEType = "") : nsMIMEInfoImpl(aMIMEType) {} - explicit nsMIMEInfoUnix(const nsACString &aMIMEType) + explicit nsMIMEInfoUnix(const nsACString& aMIMEType) : nsMIMEInfoImpl(aMIMEType) {} - nsMIMEInfoUnix(const nsACString &aType, HandlerClass aClass) + nsMIMEInfoUnix(const nsACString& aType, HandlerClass aClass) : nsMIMEInfoImpl(aType, aClass) {} - static bool HandlerExists(const char *aProtocolScheme); + static bool HandlerExists(const char* aProtocolScheme); protected: - NS_IMETHOD GetHasDefaultHandler(bool *_retval) override; + NS_IMETHOD GetHasDefaultHandler(bool* _retval) override; - virtual nsresult LoadUriInternal(nsIURI *aURI) override; + virtual nsresult LoadUriInternal(nsIURI* aURI) override; - virtual nsresult LaunchDefaultWithFile(nsIFile *aFile) override; + virtual nsresult LaunchDefaultWithFile(nsIFile* aFile) override; }; #endif // nsMIMEInfoUnix_h_ diff --git a/uriloader/prefetch/OfflineCacheUpdateChild.cpp b/uriloader/prefetch/OfflineCacheUpdateChild.cpp index d71890f9aab7b..e5f0f49aedc49 100644 --- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp @@ -77,7 +77,7 @@ NS_IMPL_RELEASE(OfflineCacheUpdateChild) // OfflineCacheUpdateChild //----------------------------------------------------------------------------- -OfflineCacheUpdateChild::OfflineCacheUpdateChild(nsPIDOMWindowInner *aWindow) +OfflineCacheUpdateChild::OfflineCacheUpdateChild(nsPIDOMWindowInner* aWindow) : mState(STATE_UNINITIALIZED), mIsUpgrade(false), mSucceeded(false), @@ -89,7 +89,7 @@ OfflineCacheUpdateChild::~OfflineCacheUpdateChild() { } void OfflineCacheUpdateChild::GatherObservers( - nsCOMArray &aObservers) { + nsCOMArray& aObservers) { for (int32_t i = 0; i < mWeakObservers.Count(); i++) { nsCOMPtr observer = do_QueryReferent(mWeakObservers[i]); @@ -104,7 +104,7 @@ void OfflineCacheUpdateChild::GatherObservers( } } -void OfflineCacheUpdateChild::SetDocument(Document *aDocument) { +void OfflineCacheUpdateChild::SetDocument(Document* aDocument) { // The design is one document for one cache update on the content process. NS_ASSERTION( !mDocument, @@ -118,7 +118,7 @@ void OfflineCacheUpdateChild::SetDocument(Document *aDocument) { // implicit (which are the reasons we collect documents here). if (!aDocument) return; - nsIChannel *channel = aDocument->GetChannel(); + nsIChannel* channel = aDocument->GetChannel(); nsCOMPtr appCacheChannel = do_QueryInterface(channel); if (!appCacheChannel) return; @@ -131,7 +131,7 @@ void OfflineCacheUpdateChild::SetDocument(Document *aDocument) { } nsresult OfflineCacheUpdateChild::AssociateDocument( - Document *aDocument, nsIApplicationCache *aApplicationCache) { + Document* aDocument, nsIApplicationCache* aApplicationCache) { // Check that the document that requested this update was // previously associated with an application cache. If not, it // should be associated with the new one. @@ -161,13 +161,13 @@ nsresult OfflineCacheUpdateChild::AssociateDocument( //----------------------------------------------------------------------------- NS_IMETHODIMP -OfflineCacheUpdateChild::Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal, - Document *aDocument, nsIFile *aCustomProfileDir) { +OfflineCacheUpdateChild::Init(nsIURI* aManifestURI, nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal, + Document* aDocument, nsIFile* aCustomProfileDir) { nsresult rv; // Make sure the service has been initialized - nsOfflineCacheUpdateService *service = + nsOfflineCacheUpdateService* service = nsOfflineCacheUpdateService::EnsureService(); if (!service) return NS_ERROR_FAILURE; @@ -205,10 +205,10 @@ OfflineCacheUpdateChild::Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, } NS_IMETHODIMP -OfflineCacheUpdateChild::InitPartial(nsIURI *aManifestURI, - const nsACString &clientID, - nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal) { +OfflineCacheUpdateChild::InitPartial(nsIURI* aManifestURI, + const nsACString& clientID, + nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal) { MOZ_ASSERT_UNREACHABLE( "Not expected to do partial offline cache updates" " on the child process"); @@ -217,9 +217,9 @@ OfflineCacheUpdateChild::InitPartial(nsIURI *aManifestURI, } NS_IMETHODIMP -OfflineCacheUpdateChild::InitForUpdateCheck(nsIURI *aManifestURI, - nsIPrincipal *aLoadingPrincipal, - nsIObserver *aObserver) { +OfflineCacheUpdateChild::InitForUpdateCheck(nsIURI* aManifestURI, + nsIPrincipal* aLoadingPrincipal, + nsIObserver* aObserver) { MOZ_ASSERT_UNREACHABLE( "Not expected to do only update checks" " from the child process"); @@ -227,7 +227,7 @@ OfflineCacheUpdateChild::InitForUpdateCheck(nsIURI *aManifestURI, } NS_IMETHODIMP -OfflineCacheUpdateChild::GetUpdateDomain(nsACString &aUpdateDomain) { +OfflineCacheUpdateChild::GetUpdateDomain(nsACString& aUpdateDomain) { NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED); aUpdateDomain = mUpdateDomain; @@ -235,7 +235,7 @@ OfflineCacheUpdateChild::GetUpdateDomain(nsACString &aUpdateDomain) { } NS_IMETHODIMP -OfflineCacheUpdateChild::GetStatus(uint16_t *aStatus) { +OfflineCacheUpdateChild::GetStatus(uint16_t* aStatus) { switch (mState) { case STATE_CHECKING: *aStatus = mozilla::dom::OfflineResourceList_Binding::CHECKING; @@ -252,13 +252,13 @@ OfflineCacheUpdateChild::GetStatus(uint16_t *aStatus) { } NS_IMETHODIMP -OfflineCacheUpdateChild::GetPartial(bool *aPartial) { +OfflineCacheUpdateChild::GetPartial(bool* aPartial) { *aPartial = false; return NS_OK; } NS_IMETHODIMP -OfflineCacheUpdateChild::GetManifestURI(nsIURI **aManifestURI) { +OfflineCacheUpdateChild::GetManifestURI(nsIURI** aManifestURI) { NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED); NS_IF_ADDREF(*aManifestURI = mManifestURI); @@ -266,7 +266,7 @@ OfflineCacheUpdateChild::GetManifestURI(nsIURI **aManifestURI) { } NS_IMETHODIMP -OfflineCacheUpdateChild::GetSucceeded(bool *aSucceeded) { +OfflineCacheUpdateChild::GetSucceeded(bool* aSucceeded) { NS_ENSURE_TRUE(mState == STATE_FINISHED, NS_ERROR_NOT_AVAILABLE); *aSucceeded = mSucceeded; @@ -275,7 +275,7 @@ OfflineCacheUpdateChild::GetSucceeded(bool *aSucceeded) { } NS_IMETHODIMP -OfflineCacheUpdateChild::GetIsUpgrade(bool *aIsUpgrade) { +OfflineCacheUpdateChild::GetIsUpgrade(bool* aIsUpgrade) { NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED); *aIsUpgrade = mIsUpgrade; @@ -284,7 +284,7 @@ OfflineCacheUpdateChild::GetIsUpgrade(bool *aIsUpgrade) { } NS_IMETHODIMP -OfflineCacheUpdateChild::AddDynamicURI(nsIURI *aURI) { +OfflineCacheUpdateChild::AddDynamicURI(nsIURI* aURI) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -292,7 +292,7 @@ NS_IMETHODIMP OfflineCacheUpdateChild::Cancel() { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -OfflineCacheUpdateChild::AddObserver(nsIOfflineCacheUpdateObserver *aObserver, +OfflineCacheUpdateChild::AddObserver(nsIOfflineCacheUpdateObserver* aObserver, bool aHoldWeak) { LOG(("OfflineCacheUpdateChild::AddObserver [%p]", this)); @@ -310,7 +310,7 @@ OfflineCacheUpdateChild::AddObserver(nsIOfflineCacheUpdateObserver *aObserver, NS_IMETHODIMP OfflineCacheUpdateChild::RemoveObserver( - nsIOfflineCacheUpdateObserver *aObserver) { + nsIOfflineCacheUpdateObserver* aObserver) { LOG(("OfflineCacheUpdateChild::RemoveObserver [%p]", this)); NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED); @@ -335,7 +335,7 @@ OfflineCacheUpdateChild::RemoveObserver( } NS_IMETHODIMP -OfflineCacheUpdateChild::GetByteProgress(uint64_t *_result) { +OfflineCacheUpdateChild::GetByteProgress(uint64_t* _result) { NS_ENSURE_ARG(_result); *_result = mByteProgress; @@ -359,8 +359,8 @@ OfflineCacheUpdateChild::Schedule() { nsCOMPtr tabchild = docshell->GetBrowserChild(); // because owner implements nsIBrowserChild, we can assume that it is // the one and only BrowserChild. - BrowserChild *child = - tabchild ? static_cast(tabchild.get()) : nullptr; + BrowserChild* child = + tabchild ? static_cast(tabchild.get()) : nullptr; if (MissingRequiredBrowserChild(child, "offlinecacheupdate")) { return NS_ERROR_FAILURE; @@ -379,7 +379,7 @@ OfflineCacheUpdateChild::Schedule() { mozilla::services::GetObserverService(); if (observerService) { LOG(("Calling offline-cache-update-added")); - observerService->NotifyObservers(static_cast(this), + observerService->NotifyObservers(static_cast(this), "offline-cache-update-added", nullptr); LOG(("Done offline-cache-update-added")); } @@ -405,7 +405,7 @@ OfflineCacheUpdateChild::Schedule() { } mozilla::ipc::IPCResult OfflineCacheUpdateChild::RecvAssociateDocuments( - const nsCString &cacheGroupId, const nsCString &cacheClientId) { + const nsCString& cacheGroupId, const nsCString& cacheClientId) { LOG(("OfflineCacheUpdateChild::RecvAssociateDocuments [%p, cache=%s]", this, cacheClientId.get())); @@ -427,7 +427,7 @@ mozilla::ipc::IPCResult OfflineCacheUpdateChild::RecvAssociateDocuments( } mozilla::ipc::IPCResult OfflineCacheUpdateChild::RecvNotifyStateEvent( - const uint32_t &event, const uint64_t &byteProgress) { + const uint32_t& event, const uint64_t& byteProgress) { LOG(("OfflineCacheUpdateChild::RecvNotifyStateEvent [%p]", this)); mByteProgress = byteProgress; @@ -456,7 +456,7 @@ mozilla::ipc::IPCResult OfflineCacheUpdateChild::RecvNotifyStateEvent( } mozilla::ipc::IPCResult OfflineCacheUpdateChild::RecvFinish( - const bool &succeeded, const bool &isUpgrade) { + const bool& succeeded, const bool& isUpgrade) { LOG(("OfflineCacheUpdateChild::RecvFinish [%p]", this)); RefPtr kungFuDeathGrip(this); @@ -469,7 +469,7 @@ mozilla::ipc::IPCResult OfflineCacheUpdateChild::RecvFinish( mozilla::services::GetObserverService(); if (observerService) { LOG(("Calling offline-cache-update-completed")); - observerService->NotifyObservers(static_cast(this), + observerService->NotifyObservers(static_cast(this), "offline-cache-update-completed", nullptr); LOG(("Done offline-cache-update-completed")); } diff --git a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp index 2aa77c50445ac..86cbeae275248 100644 --- a/uriloader/prefetch/OfflineCacheUpdateGlue.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateGlue.cpp @@ -57,7 +57,7 @@ OfflineCacheUpdateGlue::~OfflineCacheUpdateGlue() { LOG(("OfflineCacheUpdateGlue::~OfflineCacheUpdateGlue [%p]", this)); } -nsIOfflineCacheUpdate *OfflineCacheUpdateGlue::EnsureUpdate() { +nsIOfflineCacheUpdate* OfflineCacheUpdateGlue::EnsureUpdate() { if (!mUpdate) { mUpdate = new nsOfflineCacheUpdate(); LOG(("OfflineCacheUpdateGlue [%p] is using update [%p]", this, @@ -73,7 +73,7 @@ OfflineCacheUpdateGlue::Schedule() { mozilla::services::GetObserverService(); if (observerService) { LOG(("Calling offline-cache-update-added")); - observerService->NotifyObservers(static_cast(this), + observerService->NotifyObservers(static_cast(this), "offline-cache-update-added", nullptr); LOG(("Done offline-cache-update-added")); } @@ -90,16 +90,16 @@ OfflineCacheUpdateGlue::Schedule() { } NS_IMETHODIMP -OfflineCacheUpdateGlue::Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal, - Document *aDocument, nsIFile *aCustomProfileDir) { +OfflineCacheUpdateGlue::Init(nsIURI* aManifestURI, nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal, + Document* aDocument, nsIFile* aCustomProfileDir) { nsresult rv; nsAutoCString originSuffix; rv = aLoadingPrincipal->GetOriginSuffix(originSuffix); NS_ENSURE_SUCCESS(rv, rv); - nsOfflineCacheUpdateService *service = + nsOfflineCacheUpdateService* service = nsOfflineCacheUpdateService::EnsureService(); if (service) { service->FindUpdate(aManifestURI, originSuffix, aCustomProfileDir, @@ -124,7 +124,7 @@ OfflineCacheUpdateGlue::Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, aCustomProfileDir); } -void OfflineCacheUpdateGlue::SetDocument(Document *aDocument) { +void OfflineCacheUpdateGlue::SetDocument(Document* aDocument) { // The design is one document for one cache update on the content process. NS_ASSERTION(!mDocument, "Setting more then a single document on an instance of " @@ -138,7 +138,7 @@ void OfflineCacheUpdateGlue::SetDocument(Document *aDocument) { // implicit (which are the reasons we collect documents here). if (!aDocument) return; - nsIChannel *channel = aDocument->GetChannel(); + nsIChannel* channel = aDocument->GetChannel(); nsCOMPtr appCacheChannel = do_QueryInterface(channel); if (!appCacheChannel) return; @@ -155,7 +155,7 @@ void OfflineCacheUpdateGlue::SetDocument(Document *aDocument) { } NS_IMETHODIMP -OfflineCacheUpdateGlue::UpdateStateChanged(nsIOfflineCacheUpdate *aUpdate, +OfflineCacheUpdateGlue::UpdateStateChanged(nsIOfflineCacheUpdate* aUpdate, uint32_t state) { if (state == nsIOfflineCacheUpdateObserver::STATE_FINISHED) { LOG(("OfflineCacheUpdateGlue got STATE_FINISHED [%p]", this)); @@ -165,7 +165,7 @@ OfflineCacheUpdateGlue::UpdateStateChanged(nsIOfflineCacheUpdate *aUpdate, if (observerService) { LOG(("Calling offline-cache-update-completed")); observerService->NotifyObservers( - static_cast(this), + static_cast(this), "offline-cache-update-completed", nullptr); LOG(("Done offline-cache-update-completed")); } @@ -178,7 +178,7 @@ OfflineCacheUpdateGlue::UpdateStateChanged(nsIOfflineCacheUpdate *aUpdate, NS_IMETHODIMP OfflineCacheUpdateGlue::ApplicationCacheAvailable( - nsIApplicationCache *aApplicationCache) { + nsIApplicationCache* aApplicationCache) { NS_ENSURE_ARG(aApplicationCache); // Check that the document that requested this update was diff --git a/uriloader/prefetch/OfflineCacheUpdateGlue.h b/uriloader/prefetch/OfflineCacheUpdateGlue.h index d4d8fb4a36eb1..1a324e208528c 100644 --- a/uriloader/prefetch/OfflineCacheUpdateGlue.h +++ b/uriloader/prefetch/OfflineCacheUpdateGlue.h @@ -27,51 +27,51 @@ namespace docshell { // Schedule // Init #define NS_ADJUSTED_FORWARD_NSIOFFLINECACHEUPDATE(_to) \ - NS_IMETHOD GetStatus(uint16_t *aStatus) override { \ + NS_IMETHOD GetStatus(uint16_t* aStatus) override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->GetStatus(aStatus); \ } \ - NS_IMETHOD GetPartial(bool *aPartial) override { \ + NS_IMETHOD GetPartial(bool* aPartial) override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->GetPartial(aPartial); \ } \ - NS_IMETHOD GetIsUpgrade(bool *aIsUpgrade) override { \ + NS_IMETHOD GetIsUpgrade(bool* aIsUpgrade) override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsUpgrade(aIsUpgrade); \ } \ - NS_IMETHOD GetUpdateDomain(nsACString &aUpdateDomain) override { \ + NS_IMETHOD GetUpdateDomain(nsACString& aUpdateDomain) override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->GetUpdateDomain(aUpdateDomain); \ } \ - NS_IMETHOD GetManifestURI(nsIURI **aManifestURI) override { \ + NS_IMETHOD GetManifestURI(nsIURI** aManifestURI) override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->GetManifestURI(aManifestURI); \ } \ - NS_IMETHOD GetSucceeded(bool *aSucceeded) override { \ + NS_IMETHOD GetSucceeded(bool* aSucceeded) override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->GetSucceeded(aSucceeded); \ } \ - NS_IMETHOD InitPartial(nsIURI *aManifestURI, const nsACString &aClientID, \ - nsIURI *aDocumentURI, \ - nsIPrincipal *aLoadingPrincipal) override { \ + NS_IMETHOD InitPartial(nsIURI* aManifestURI, const nsACString& aClientID, \ + nsIURI* aDocumentURI, \ + nsIPrincipal* aLoadingPrincipal) override { \ return !_to ? NS_ERROR_NULL_POINTER \ : _to->InitPartial(aManifestURI, aClientID, aDocumentURI, \ aLoadingPrincipal); \ } \ - NS_IMETHOD InitForUpdateCheck(nsIURI *aManifestURI, \ - nsIPrincipal *aLoadingPrincipal, \ - nsIObserver *aObserver) override { \ + NS_IMETHOD InitForUpdateCheck(nsIURI* aManifestURI, \ + nsIPrincipal* aLoadingPrincipal, \ + nsIObserver* aObserver) override { \ return !_to ? NS_ERROR_NULL_POINTER \ : _to->InitForUpdateCheck(aManifestURI, aLoadingPrincipal, \ aObserver); \ } \ - NS_IMETHOD AddDynamicURI(nsIURI *aURI) override { \ + NS_IMETHOD AddDynamicURI(nsIURI* aURI) override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->AddDynamicURI(aURI); \ } \ - NS_IMETHOD AddObserver(nsIOfflineCacheUpdateObserver *aObserver, \ + NS_IMETHOD AddObserver(nsIOfflineCacheUpdateObserver* aObserver, \ bool aHoldWeak) override { \ return !_to ? NS_ERROR_NULL_POINTER \ : _to->AddObserver(aObserver, aHoldWeak); \ } \ - NS_IMETHOD RemoveObserver(nsIOfflineCacheUpdateObserver *aObserver) \ + NS_IMETHOD RemoveObserver(nsIOfflineCacheUpdateObserver* aObserver) \ override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aObserver); \ } \ - NS_IMETHOD GetByteProgress(uint64_t *_result) override { \ + NS_IMETHOD GetByteProgress(uint64_t* _result) override { \ return !_to ? NS_ERROR_NULL_POINTER : _to->GetByteProgress(_result); \ } \ NS_IMETHOD Cancel() override { \ @@ -85,21 +85,21 @@ class OfflineCacheUpdateGlue final : public nsSupportsWeakReference, NS_DECL_ISUPPORTS private: - nsIOfflineCacheUpdate *EnsureUpdate(); + nsIOfflineCacheUpdate* EnsureUpdate(); public: NS_ADJUSTED_FORWARD_NSIOFFLINECACHEUPDATE(EnsureUpdate()) NS_IMETHOD Schedule(void) override; - NS_IMETHOD Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal, - mozilla::dom::Document *aDocument, - nsIFile *aCustomProfileDir) override; + NS_IMETHOD Init(nsIURI* aManifestURI, nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal, + mozilla::dom::Document* aDocument, + nsIFile* aCustomProfileDir) override; NS_DECL_NSIOFFLINECACHEUPDATEOBSERVER OfflineCacheUpdateGlue(); - void SetDocument(mozilla::dom::Document *aDocument); + void SetDocument(mozilla::dom::Document* aDocument); private: ~OfflineCacheUpdateGlue(); diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.cpp b/uriloader/prefetch/nsOfflineCacheUpdate.cpp index 7a7abf8b42133..09905714b863d 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp @@ -73,26 +73,26 @@ extern LazyLogModule gOfflineCacheUpdateLog; class AutoFreeArray { public: - AutoFreeArray(uint32_t count, char **values) + AutoFreeArray(uint32_t count, char** values) : mCount(count), mValues(values){}; ~AutoFreeArray() { NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mCount, mValues); } private: uint32_t mCount; - char **mValues; + char** mValues; }; namespace { -nsresult DropReferenceFromURL(nsCOMPtr &aURI) { +nsresult DropReferenceFromURL(nsCOMPtr& aURI) { // XXXdholbert If this SetRef fails, callers of this method probably // want to call aURI->CloneIgnoringRef() and use the result of that. nsCOMPtr uri(aURI); return NS_GetURIWithoutRef(uri, getter_AddRefs(aURI)); } -void LogToConsole(const char *message, - nsOfflineCacheUpdateItem *item = nullptr) { +void LogToConsole(const char* message, + nsOfflineCacheUpdateItem* item = nullptr) { nsCOMPtr consoleService = do_GetService(NS_CONSOLESERVICE_CONTRACTID); if (consoleService) { @@ -116,8 +116,8 @@ class nsManifestCheck final : public nsIStreamListener, public nsIChannelEventSink, public nsIInterfaceRequestor { public: - nsManifestCheck(nsOfflineCacheUpdate *aUpdate, nsIURI *aURI, - nsIURI *aReferrerURI, nsIPrincipal *aLoadingPrincipal) + nsManifestCheck(nsOfflineCacheUpdate* aUpdate, nsIURI* aURI, + nsIURI* aReferrerURI, nsIPrincipal* aLoadingPrincipal) : mUpdate(aUpdate), mURI(aURI), mReferrerURI(aReferrerURI), @@ -134,9 +134,9 @@ class nsManifestCheck final : public nsIStreamListener, private: ~nsManifestCheck() {} - static nsresult ReadManifest(nsIInputStream *aInputStream, void *aClosure, - const char *aFromSegment, uint32_t aOffset, - uint32_t aCount, uint32_t *aBytesConsumed); + static nsresult ReadManifest(nsIInputStream* aInputStream, void* aClosure, + const char* aFromSegment, uint32_t aOffset, + uint32_t aCount, uint32_t* aBytesConsumed); RefPtr mUpdate; nsCOMPtr mURI; @@ -193,17 +193,17 @@ nsresult nsManifestCheck::Begin() { //----------------------------------------------------------------------------- /* static */ -nsresult nsManifestCheck::ReadManifest(nsIInputStream *aInputStream, - void *aClosure, const char *aFromSegment, +nsresult nsManifestCheck::ReadManifest(nsIInputStream* aInputStream, + void* aClosure, const char* aFromSegment, uint32_t aOffset, uint32_t aCount, - uint32_t *aBytesConsumed) { - nsManifestCheck *manifestCheck = static_cast(aClosure); + uint32_t* aBytesConsumed) { + nsManifestCheck* manifestCheck = static_cast(aClosure); nsresult rv; *aBytesConsumed = aCount; rv = manifestCheck->mManifestHash->Update( - reinterpret_cast(aFromSegment), aCount); + reinterpret_cast(aFromSegment), aCount); NS_ENSURE_SUCCESS(rv, rv); return NS_OK; @@ -214,10 +214,10 @@ nsresult nsManifestCheck::ReadManifest(nsIInputStream *aInputStream, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsManifestCheck::OnStartRequest(nsIRequest *aRequest) { return NS_OK; } +nsManifestCheck::OnStartRequest(nsIRequest* aRequest) { return NS_OK; } NS_IMETHODIMP -nsManifestCheck::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aStream, +nsManifestCheck::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream, uint64_t aOffset, uint32_t aCount) { uint32_t bytesRead; aStream->ReadSegments(ReadManifest, this, aCount, &bytesRead); @@ -225,7 +225,7 @@ nsManifestCheck::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aStream, } NS_IMETHODIMP -nsManifestCheck::OnStopRequest(nsIRequest *aRequest, nsresult aStatus) { +nsManifestCheck::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) { nsAutoCString manifestHash; if (NS_SUCCEEDED(aStatus)) { mManifestHash->Finish(true, manifestHash); @@ -241,10 +241,10 @@ nsManifestCheck::OnStopRequest(nsIRequest *aRequest, nsresult aStatus) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsManifestCheck::GetInterface(const nsIID &aIID, void **aResult) { +nsManifestCheck::GetInterface(const nsIID& aIID, void** aResult) { if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) { NS_ADDREF_THIS(); - *aResult = static_cast(this); + *aResult = static_cast(this); return NS_OK; } @@ -257,8 +257,8 @@ nsManifestCheck::GetInterface(const nsIID &aIID, void **aResult) { NS_IMETHODIMP nsManifestCheck::AsyncOnChannelRedirect( - nsIChannel *aOldChannel, nsIChannel *aNewChannel, uint32_t aFlags, - nsIAsyncVerifyRedirectCallback *callback) { + nsIChannel* aOldChannel, nsIChannel* aNewChannel, uint32_t aFlags, + nsIAsyncVerifyRedirectCallback* callback) { // Redirects should cause the load (and therefore the update) to fail. if (aFlags & nsIChannelEventSink::REDIRECT_INTERNAL) { callback->OnRedirectVerifyCallback(NS_OK); @@ -284,9 +284,9 @@ NS_IMPL_ISUPPORTS(nsOfflineCacheUpdateItem, nsIRequestObserver, //----------------------------------------------------------------------------- nsOfflineCacheUpdateItem::nsOfflineCacheUpdateItem( - nsIURI *aURI, nsIURI *aReferrerURI, nsIPrincipal *aLoadingPrincipal, - nsIApplicationCache *aApplicationCache, - nsIApplicationCache *aPreviousApplicationCache, uint32_t type, + nsIURI* aURI, nsIURI* aReferrerURI, nsIPrincipal* aLoadingPrincipal, + nsIApplicationCache* aApplicationCache, + nsIApplicationCache* aPreviousApplicationCache, uint32_t type, uint32_t loadFlags) : mURI(aURI), mReferrerURI(aReferrerURI), @@ -301,7 +301,7 @@ nsOfflineCacheUpdateItem::nsOfflineCacheUpdateItem( nsOfflineCacheUpdateItem::~nsOfflineCacheUpdateItem() {} -nsresult nsOfflineCacheUpdateItem::OpenChannel(nsOfflineCacheUpdate *aUpdate) { +nsresult nsOfflineCacheUpdateItem::OpenChannel(nsOfflineCacheUpdate* aUpdate) { if (LOG_ENABLED()) { LOG(("%p: Opening channel for %s", this, mURI->GetSpecOrDefault().get())); } @@ -391,15 +391,15 @@ nsresult nsOfflineCacheUpdateItem::Cancel() { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsOfflineCacheUpdateItem::OnStartRequest(nsIRequest *aRequest) { +nsOfflineCacheUpdateItem::OnStartRequest(nsIRequest* aRequest) { mState = LoadStatus::RECEIVING; return NS_OK; } NS_IMETHODIMP -nsOfflineCacheUpdateItem::OnDataAvailable(nsIRequest *aRequest, - nsIInputStream *aStream, +nsOfflineCacheUpdateItem::OnDataAvailable(nsIRequest* aRequest, + nsIInputStream* aStream, uint64_t aOffset, uint32_t aCount) { uint32_t bytesRead = 0; aStream->ReadSegments(NS_DiscardSegment, nullptr, aCount, &bytesRead); @@ -413,7 +413,7 @@ nsOfflineCacheUpdateItem::OnDataAvailable(nsIRequest *aRequest, } NS_IMETHODIMP -nsOfflineCacheUpdateItem::OnStopRequest(nsIRequest *aRequest, +nsOfflineCacheUpdateItem::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) { if (LOG_ENABLED()) { LOG(("%p: Done fetching offline item %s [status=%" PRIx32 "]\n", this, @@ -473,10 +473,10 @@ nsOfflineCacheUpdateItem::Run() { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsOfflineCacheUpdateItem::GetInterface(const nsIID &aIID, void **aResult) { +nsOfflineCacheUpdateItem::GetInterface(const nsIID& aIID, void** aResult) { if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) { NS_ADDREF_THIS(); - *aResult = static_cast(this); + *aResult = static_cast(this); return NS_OK; } @@ -489,8 +489,8 @@ nsOfflineCacheUpdateItem::GetInterface(const nsIID &aIID, void **aResult) { NS_IMETHODIMP nsOfflineCacheUpdateItem::AsyncOnChannelRedirect( - nsIChannel *aOldChannel, nsIChannel *aNewChannel, uint32_t aFlags, - nsIAsyncVerifyRedirectCallback *cb) { + nsIChannel* aOldChannel, nsIChannel* aNewChannel, uint32_t aFlags, + nsIAsyncVerifyRedirectCallback* cb) { if (!(aFlags & nsIChannelEventSink::REDIRECT_INTERNAL)) { // Don't allow redirect in case of non-internal redirect and cancel // the channel to clean the cache entry. @@ -536,7 +536,7 @@ nsOfflineCacheUpdateItem::AsyncOnChannelRedirect( return NS_OK; } -nsresult nsOfflineCacheUpdateItem::GetRequestSucceeded(bool *succeeded) { +nsresult nsOfflineCacheUpdateItem::GetRequestSucceeded(bool* succeeded) { *succeeded = false; if (!mChannel) return NS_OK; @@ -580,7 +580,7 @@ bool nsOfflineCacheUpdateItem::IsCompleted() { return mState == LoadStatus::LOADED; } -nsresult nsOfflineCacheUpdateItem::GetStatus(uint16_t *aStatus) { +nsresult nsOfflineCacheUpdateItem::GetStatus(uint16_t* aStatus) { if (!mChannel) { *aStatus = 0; return NS_OK; @@ -611,9 +611,9 @@ nsresult nsOfflineCacheUpdateItem::GetStatus(uint16_t *aStatus) { //----------------------------------------------------------------------------- nsOfflineManifestItem::nsOfflineManifestItem( - nsIURI *aURI, nsIURI *aReferrerURI, nsIPrincipal *aLoadingPrincipal, - nsIApplicationCache *aApplicationCache, - nsIApplicationCache *aPreviousApplicationCache) + nsIURI* aURI, nsIURI* aReferrerURI, nsIPrincipal* aLoadingPrincipal, + nsIApplicationCache* aApplicationCache, + nsIApplicationCache* aPreviousApplicationCache) : nsOfflineCacheUpdateItem(aURI, aReferrerURI, aLoadingPrincipal, aApplicationCache, aPreviousApplicationCache, nsIApplicationCache::ITEM_MANIFEST, 0), @@ -631,13 +631,13 @@ nsOfflineManifestItem::~nsOfflineManifestItem() {} //----------------------------------------------------------------------------- /* static */ -nsresult nsOfflineManifestItem::ReadManifest(nsIInputStream *aInputStream, - void *aClosure, - const char *aFromSegment, +nsresult nsOfflineManifestItem::ReadManifest(nsIInputStream* aInputStream, + void* aClosure, + const char* aFromSegment, uint32_t aOffset, uint32_t aCount, - uint32_t *aBytesConsumed) { - nsOfflineManifestItem *manifest = - static_cast(aClosure); + uint32_t* aBytesConsumed) { + nsOfflineManifestItem* manifest = + static_cast(aClosure); nsresult rv; @@ -669,7 +669,7 @@ nsresult nsOfflineManifestItem::ReadManifest(nsIInputStream *aInputStream, if (manifest->mManifestHash) { rv = manifest->mManifestHash->Update( - reinterpret_cast(aFromSegment), aCount); + reinterpret_cast(aFromSegment), aCount); if (NS_FAILED(rv)) { manifest->mManifestHash = nullptr; LOG(("Could not update manifest hash, rv=%08" PRIx32, @@ -706,8 +706,8 @@ nsresult nsOfflineManifestItem::ReadManifest(nsIInputStream *aInputStream, } nsresult nsOfflineManifestItem::AddNamespace(uint32_t namespaceType, - const nsCString &namespaceSpec, - const nsCString &data) + const nsCString& namespaceSpec, + const nsCString& data) { nsresult rv; @@ -727,7 +727,7 @@ nsresult nsOfflineManifestItem::AddNamespace(uint32_t namespaceType, return NS_OK; } -static nsresult GetURIDirectory(nsIURI *uri, nsACString &directory) { +static nsresult GetURIDirectory(nsIURI* uri, nsACString& directory) { nsresult rv; nsCOMPtr url(do_QueryInterface(uri, &rv)); @@ -739,8 +739,8 @@ static nsresult GetURIDirectory(nsIURI *uri, nsACString &directory) { return NS_OK; } -static nsresult CheckFileContainedInPath(nsIURI *file, - nsACString const &masterDirectory) { +static nsresult CheckFileContainedInPath(nsIURI* file, + nsACString const& masterDirectory) { nsresult rv; nsAutoCString directory; @@ -756,8 +756,8 @@ static nsresult CheckFileContainedInPath(nsIURI *file, } nsresult nsOfflineManifestItem::HandleManifestLine( - const nsCString::const_iterator &aBegin, - const nsCString::const_iterator &aEnd) { + const nsCString::const_iterator& aBegin, + const nsCString::const_iterator& aEnd) { nsCString::const_iterator begin = aBegin; nsCString::const_iterator end = aEnd; @@ -781,7 +781,7 @@ nsresult nsOfflineManifestItem::HandleManifestLine( ++begin; } - const nsACString &magic = Substring(begin, end); + const nsACString& magic = Substring(begin, end); if (!magic.EqualsLiteral("CACHE MANIFEST")) { mParserState = PARSE_ERROR; @@ -799,7 +799,7 @@ nsresult nsOfflineManifestItem::HandleManifestLine( // ignore blank lines and comments if (begin == end || *begin == '#') return NS_OK; - const nsACString &line = Substring(begin, end); + const nsACString& line = Substring(begin, end); if (line.EqualsLiteral("CACHE:")) { mParserState = PARSE_CACHE_ENTRIES; @@ -956,7 +956,7 @@ nsresult nsOfflineManifestItem::HandleManifestLine( } nsresult nsOfflineManifestItem::GetOldManifestContentHash( - nsIRequest *aRequest) { + nsIRequest* aRequest) { nsresult rv; nsCOMPtr cachingChannel = do_QueryInterface(aRequest, &rv); @@ -979,7 +979,7 @@ nsresult nsOfflineManifestItem::GetOldManifestContentHash( } nsresult nsOfflineManifestItem::CheckNewManifestContentHash( - nsIRequest *aRequest) { + nsIRequest* aRequest) { nsresult rv; if (!mManifestHash) { @@ -1035,7 +1035,7 @@ void nsOfflineManifestItem::ReadStrictFileOriginPolicyPref() { } NS_IMETHODIMP -nsOfflineManifestItem::OnStartRequest(nsIRequest *aRequest) { +nsOfflineManifestItem::OnStartRequest(nsIRequest* aRequest) { nsresult rv; nsCOMPtr channel = do_QueryInterface(aRequest, &rv); @@ -1059,8 +1059,8 @@ nsOfflineManifestItem::OnStartRequest(nsIRequest *aRequest) { } NS_IMETHODIMP -nsOfflineManifestItem::OnDataAvailable(nsIRequest *aRequest, - nsIInputStream *aStream, +nsOfflineManifestItem::OnDataAvailable(nsIRequest* aRequest, + nsIInputStream* aStream, uint64_t aOffset, uint32_t aCount) { uint32_t bytesRead = 0; aStream->ReadSegments(ReadManifest, this, aCount, &bytesRead); @@ -1081,7 +1081,7 @@ nsOfflineManifestItem::OnDataAvailable(nsIRequest *aRequest, } NS_IMETHODIMP -nsOfflineManifestItem::OnStopRequest(nsIRequest *aRequest, nsresult aStatus) { +nsOfflineManifestItem::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) { if (mBytesRead == 0) { // We didn't need to read (because LOAD_ONLY_IF_MODIFIED was // specified). @@ -1130,7 +1130,7 @@ nsOfflineCacheUpdate::~nsOfflineCacheUpdate() { } /* static */ -nsresult nsOfflineCacheUpdate::GetCacheKey(nsIURI *aURI, nsACString &aKey) { +nsresult nsOfflineCacheUpdate::GetCacheKey(nsIURI* aURI, nsACString& aKey) { aKey.Truncate(); nsCOMPtr newURI; @@ -1143,8 +1143,8 @@ nsresult nsOfflineCacheUpdate::GetCacheKey(nsIURI *aURI, nsACString &aKey) { return NS_OK; } -nsresult nsOfflineCacheUpdate::InitInternal(nsIURI *aManifestURI, - nsIPrincipal *aLoadingPrincipal) { +nsresult nsOfflineCacheUpdate::InitInternal(nsIURI* aManifestURI, + nsIPrincipal* aLoadingPrincipal) { nsresult rv; // Only http and https applications are supported. @@ -1169,14 +1169,14 @@ nsresult nsOfflineCacheUpdate::InitInternal(nsIURI *aManifestURI, return NS_OK; } -nsresult nsOfflineCacheUpdate::Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal, - dom::Document *aDocument, - nsIFile *aCustomProfileDir) { +nsresult nsOfflineCacheUpdate::Init(nsIURI* aManifestURI, nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal, + dom::Document* aDocument, + nsIFile* aCustomProfileDir) { nsresult rv; // Make sure the service has been initialized - nsOfflineCacheUpdateService *service = + nsOfflineCacheUpdateService* service = nsOfflineCacheUpdateService::EnsureService(); if (!service) return NS_ERROR_FAILURE; @@ -1237,12 +1237,12 @@ nsresult nsOfflineCacheUpdate::Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, } nsresult nsOfflineCacheUpdate::InitForUpdateCheck( - nsIURI *aManifestURI, nsIPrincipal *aLoadingPrincipal, - nsIObserver *aObserver) { + nsIURI* aManifestURI, nsIPrincipal* aLoadingPrincipal, + nsIObserver* aObserver) { nsresult rv; // Make sure the service has been initialized - nsOfflineCacheUpdateService *service = + nsOfflineCacheUpdateService* service = nsOfflineCacheUpdateService::EnsureService(); if (!service) return NS_ERROR_FAILURE; @@ -1286,14 +1286,14 @@ nsresult nsOfflineCacheUpdate::InitForUpdateCheck( return NS_OK; } -nsresult nsOfflineCacheUpdate::InitPartial(nsIURI *aManifestURI, - const nsACString &clientID, - nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal) { +nsresult nsOfflineCacheUpdate::InitPartial(nsIURI* aManifestURI, + const nsACString& clientID, + nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal) { nsresult rv; // Make sure the service has been initialized - nsOfflineCacheUpdateService *service = + nsOfflineCacheUpdateService* service = nsOfflineCacheUpdateService::EnsureService(); if (!service) return NS_ERROR_FAILURE; @@ -1340,7 +1340,7 @@ nsresult nsOfflineCacheUpdate::InitPartial(nsIURI *aManifestURI, return NS_OK; } -nsresult nsOfflineCacheUpdate::HandleManifest(bool *aDoUpdate) { +nsresult nsOfflineCacheUpdate::HandleManifest(bool* aDoUpdate) { // Be pessimistic *aDoUpdate = false; @@ -1357,20 +1357,20 @@ nsresult nsOfflineCacheUpdate::HandleManifest(bool *aDoUpdate) { } // Add items requested by the manifest. - const nsCOMArray &manifestURIs = mManifestItem->GetExplicitURIs(); + const nsCOMArray& manifestURIs = mManifestItem->GetExplicitURIs(); for (int32_t i = 0; i < manifestURIs.Count(); i++) { rv = AddURI(manifestURIs[i], nsIApplicationCache::ITEM_EXPLICIT); NS_ENSURE_SUCCESS(rv, rv); } - const nsCOMArray &anonURIs = mManifestItem->GetAnonymousURIs(); + const nsCOMArray& anonURIs = mManifestItem->GetAnonymousURIs(); for (int32_t i = 0; i < anonURIs.Count(); i++) { rv = AddURI(anonURIs[i], nsIApplicationCache::ITEM_EXPLICIT, nsIRequest::LOAD_ANONYMOUS); NS_ENSURE_SUCCESS(rv, rv); } - const nsCOMArray &fallbackURIs = mManifestItem->GetFallbackURIs(); + const nsCOMArray& fallbackURIs = mManifestItem->GetFallbackURIs(); for (int32_t i = 0; i < fallbackURIs.Count(); i++) { rv = AddURI(fallbackURIs[i], nsIApplicationCache::ITEM_FALLBACK); NS_ENSURE_SUCCESS(rv, rv); @@ -1427,7 +1427,7 @@ bool nsOfflineCacheUpdate::CheckUpdateAvailability() { return mManifestItem->NeedsUpdate(); } -void nsOfflineCacheUpdate::LoadCompleted(nsOfflineCacheUpdateItem *aItem) { +void nsOfflineCacheUpdate::LoadCompleted(nsOfflineCacheUpdateItem* aItem) { nsresult rv; LOG(("nsOfflineCacheUpdate::LoadCompleted [%p]", this)); @@ -1604,7 +1604,7 @@ void nsOfflineCacheUpdate::LoadCompleted(nsOfflineCacheUpdateItem *aItem) { } void nsOfflineCacheUpdate::ManifestCheckCompleted( - nsresult aStatus, const nsCString &aManifestHash) { + nsresult aStatus, const nsCString& aManifestHash) { // Keep the object alive through a Finish() call. nsCOMPtr kungFuDeathGrip(this); @@ -1703,7 +1703,7 @@ nsresult nsOfflineCacheUpdate::Begin() { //----------------------------------------------------------------------------- nsresult nsOfflineCacheUpdate::AddExistingItems( - uint32_t aType, nsTArray *namespaceFilter) { + uint32_t aType, nsTArray* namespaceFilter) { if (!mPreviousApplicationCache) { return NS_OK; } @@ -1715,7 +1715,7 @@ nsresult nsOfflineCacheUpdate::AddExistingItems( } uint32_t count = 0; - char **keys = nullptr; + char** keys = nullptr; nsresult rv = mPreviousApplicationCache->GatherEntries(aType, &count, &keys); NS_ENSURE_SUCCESS(rv, rv); @@ -1754,10 +1754,10 @@ nsresult nsOfflineCacheUpdate::ProcessNextURI() { return NS_ERROR_UNEXPECTED; } - nsOfflineCacheUpdateItem *runItem = nullptr; + nsOfflineCacheUpdateItem* runItem = nullptr; uint32_t completedItems = 0; for (uint32_t i = 0; i < mItems.Length(); ++i) { - nsOfflineCacheUpdateItem *item = mItems[i]; + nsOfflineCacheUpdateItem* item = mItems[i]; if (item->IsScheduled()) { runItem = item; @@ -1825,7 +1825,7 @@ nsresult nsOfflineCacheUpdate::ProcessNextURI() { } void nsOfflineCacheUpdate::GatherObservers( - nsCOMArray &aObservers) { + nsCOMArray& aObservers) { for (int32_t i = 0; i < mWeakObservers.Count(); i++) { nsCOMPtr observer = do_QueryReferent(mWeakObservers[i]); @@ -1861,7 +1861,7 @@ void nsOfflineCacheUpdate::NotifyUpdateAvailability(bool updateAvailable) { LOG(("nsOfflineCacheUpdate::NotifyUpdateAvailability [this=%p, avail=%d]", this, updateAvailable)); - const char *topic = updateAvailable ? "offline-cache-update-available" + const char* topic = updateAvailable ? "offline-cache-update-available" : "offline-cache-update-unavailable"; nsCOMPtr observer; @@ -1869,7 +1869,7 @@ void nsOfflineCacheUpdate::NotifyUpdateAvailability(bool updateAvailable) { observer->Observe(mManifestURI, topic, nullptr); } -void nsOfflineCacheUpdate::AssociateDocuments(nsIApplicationCache *cache) { +void nsOfflineCacheUpdate::AssociateDocuments(nsIApplicationCache* cache) { if (!cache) { LOG( ("nsOfflineCacheUpdate::AssociateDocuments bypassed" @@ -1886,22 +1886,22 @@ void nsOfflineCacheUpdate::AssociateDocuments(nsIApplicationCache *cache) { } } -void nsOfflineCacheUpdate::StickDocument(nsIURI *aDocumentURI) { +void nsOfflineCacheUpdate::StickDocument(nsIURI* aDocumentURI) { if (!aDocumentURI) return; mDocumentURIs.AppendObject(aDocumentURI); } -void nsOfflineCacheUpdate::SetOwner(nsOfflineCacheUpdateOwner *aOwner) { +void nsOfflineCacheUpdate::SetOwner(nsOfflineCacheUpdateOwner* aOwner) { NS_ASSERTION(!mOwner, "Tried to set cache update owner twice."); mOwner = aOwner; } -bool nsOfflineCacheUpdate::IsForGroupID(const nsACString &groupID) { +bool nsOfflineCacheUpdate::IsForGroupID(const nsACString& groupID) { return mGroupID == groupID; } -bool nsOfflineCacheUpdate::IsForProfile(nsIFile *aCustomProfileDir) { +bool nsOfflineCacheUpdate::IsForProfile(nsIFile* aCustomProfileDir) { if (!mCustomProfileDir && !aCustomProfileDir) return true; if (!mCustomProfileDir || !aCustomProfileDir) return false; @@ -1911,7 +1911,7 @@ bool nsOfflineCacheUpdate::IsForProfile(nsIFile *aCustomProfileDir) { return NS_SUCCEEDED(rv) && equals; } -nsresult nsOfflineCacheUpdate::UpdateFinished(nsOfflineCacheUpdate *aUpdate) { +nsresult nsOfflineCacheUpdate::UpdateFinished(nsOfflineCacheUpdate* aUpdate) { // Keep the object alive through a Finish() call. nsCOMPtr kungFuDeathGrip(this); @@ -1972,7 +1972,7 @@ nsresult nsOfflineCacheUpdate::FinishNoNotify() { if (!mPartialUpdate && !mOnlyCheckUpdate) { if (mSucceeded) { - nsIArray *namespaces = mManifestItem->GetNamespaces(); + nsIArray* namespaces = mManifestItem->GetNamespaces(); nsresult rv = mApplicationCache->AddNamespaces(namespaces); if (NS_FAILED(rv)) { NotifyState(nsIOfflineCacheUpdateObserver::STATE_ERROR); @@ -2033,9 +2033,9 @@ void nsOfflineCacheUpdate::AsyncFinishWithError() { Finish(); } -static nsresult EvictOneOfCacheGroups(nsIApplicationCacheService *cacheService, +static nsresult EvictOneOfCacheGroups(nsIApplicationCacheService* cacheService, uint32_t count, - const char *const *groups) { + const char* const* groups) { nsresult rv; unsigned int i; @@ -2072,7 +2072,7 @@ nsresult nsOfflineCacheUpdate::EvictOneNonPinned() { NS_ENSURE_SUCCESS(rv, rv); uint32_t count; - char **groups; + char** groups; rv = cacheService->GetGroupsTimeOrdered(&count, &groups); NS_ENSURE_SUCCESS(rv, rv); @@ -2087,7 +2087,7 @@ nsresult nsOfflineCacheUpdate::EvictOneNonPinned() { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsOfflineCacheUpdate::GetUpdateDomain(nsACString &aUpdateDomain) { +nsOfflineCacheUpdate::GetUpdateDomain(nsACString& aUpdateDomain) { NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED); aUpdateDomain = mUpdateDomain; @@ -2095,7 +2095,7 @@ nsOfflineCacheUpdate::GetUpdateDomain(nsACString &aUpdateDomain) { } NS_IMETHODIMP -nsOfflineCacheUpdate::GetStatus(uint16_t *aStatus) { +nsOfflineCacheUpdate::GetStatus(uint16_t* aStatus) { switch (mState) { case STATE_CHECKING: *aStatus = dom::OfflineResourceList_Binding::CHECKING; @@ -2112,13 +2112,13 @@ nsOfflineCacheUpdate::GetStatus(uint16_t *aStatus) { } NS_IMETHODIMP -nsOfflineCacheUpdate::GetPartial(bool *aPartial) { +nsOfflineCacheUpdate::GetPartial(bool* aPartial) { *aPartial = mPartialUpdate || mOnlyCheckUpdate; return NS_OK; } NS_IMETHODIMP -nsOfflineCacheUpdate::GetManifestURI(nsIURI **aManifestURI) { +nsOfflineCacheUpdate::GetManifestURI(nsIURI** aManifestURI) { NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED); NS_IF_ADDREF(*aManifestURI = mManifestURI); @@ -2126,7 +2126,7 @@ nsOfflineCacheUpdate::GetManifestURI(nsIURI **aManifestURI) { } NS_IMETHODIMP -nsOfflineCacheUpdate::GetSucceeded(bool *aSucceeded) { +nsOfflineCacheUpdate::GetSucceeded(bool* aSucceeded) { NS_ENSURE_TRUE(mState == STATE_FINISHED, NS_ERROR_NOT_AVAILABLE); *aSucceeded = mSucceeded; @@ -2135,7 +2135,7 @@ nsOfflineCacheUpdate::GetSucceeded(bool *aSucceeded) { } NS_IMETHODIMP -nsOfflineCacheUpdate::GetIsUpgrade(bool *aIsUpgrade) { +nsOfflineCacheUpdate::GetIsUpgrade(bool* aIsUpgrade) { NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED); *aIsUpgrade = (mPreviousApplicationCache != nullptr); @@ -2143,7 +2143,7 @@ nsOfflineCacheUpdate::GetIsUpgrade(bool *aIsUpgrade) { return NS_OK; } -nsresult nsOfflineCacheUpdate::AddURI(nsIURI *aURI, uint32_t aType, +nsresult nsOfflineCacheUpdate::AddURI(nsIURI* aURI, uint32_t aType, uint32_t aLoadFlags) { NS_ENSURE_TRUE(mState >= STATE_INITIALIZED, NS_ERROR_NOT_INITIALIZED); @@ -2180,7 +2180,7 @@ nsresult nsOfflineCacheUpdate::AddURI(nsIURI *aURI, uint32_t aType, } NS_IMETHODIMP -nsOfflineCacheUpdate::AddDynamicURI(nsIURI *aURI) { +nsOfflineCacheUpdate::AddDynamicURI(nsIURI* aURI) { if (GeckoProcessType_Default != XRE_GetProcessType()) return NS_ERROR_NOT_IMPLEMENTED; @@ -2216,7 +2216,7 @@ nsOfflineCacheUpdate::Cancel() { // Cancel all running downloads for (uint32_t i = 0; i < mItems.Length(); ++i) { - nsOfflineCacheUpdateItem *item = mItems[i]; + nsOfflineCacheUpdateItem* item = mItems[i]; if (item->IsInProgress()) item->Cancel(); } @@ -2225,7 +2225,7 @@ nsOfflineCacheUpdate::Cancel() { } NS_IMETHODIMP -nsOfflineCacheUpdate::AddObserver(nsIOfflineCacheUpdateObserver *aObserver, +nsOfflineCacheUpdate::AddObserver(nsIOfflineCacheUpdateObserver* aObserver, bool aHoldWeak) { LOG(("nsOfflineCacheUpdate::AddObserver [%p] to update [%p]", aObserver, this)); @@ -2243,7 +2243,7 @@ nsOfflineCacheUpdate::AddObserver(nsIOfflineCacheUpdateObserver *aObserver, } NS_IMETHODIMP -nsOfflineCacheUpdate::RemoveObserver(nsIOfflineCacheUpdateObserver *aObserver) { +nsOfflineCacheUpdate::RemoveObserver(nsIOfflineCacheUpdateObserver* aObserver) { LOG(("nsOfflineCacheUpdate::RemoveObserver [%p] from update [%p]", aObserver, this)); @@ -2269,7 +2269,7 @@ nsOfflineCacheUpdate::RemoveObserver(nsIOfflineCacheUpdateObserver *aObserver) { } NS_IMETHODIMP -nsOfflineCacheUpdate::GetByteProgress(uint64_t *_result) { +nsOfflineCacheUpdate::GetByteProgress(uint64_t* _result) { NS_ENSURE_ARG(_result); *_result = mByteProgress; @@ -2280,7 +2280,7 @@ NS_IMETHODIMP nsOfflineCacheUpdate::Schedule() { LOG(("nsOfflineCacheUpdate::Schedule [%p]", this)); - nsOfflineCacheUpdateService *service = + nsOfflineCacheUpdateService* service = nsOfflineCacheUpdateService::EnsureService(); if (!service) { @@ -2291,7 +2291,7 @@ nsOfflineCacheUpdate::Schedule() { } NS_IMETHODIMP -nsOfflineCacheUpdate::UpdateStateChanged(nsIOfflineCacheUpdate *aUpdate, +nsOfflineCacheUpdate::UpdateStateChanged(nsIOfflineCacheUpdate* aUpdate, uint32_t aState) { if (aState == nsIOfflineCacheUpdateObserver::STATE_FINISHED) { // Take the mSucceeded flag from the underlying update, we will be @@ -2311,7 +2311,7 @@ nsOfflineCacheUpdate::UpdateStateChanged(nsIOfflineCacheUpdate *aUpdate, NS_IMETHODIMP nsOfflineCacheUpdate::ApplicationCacheAvailable( - nsIApplicationCache *applicationCache) { + nsIApplicationCache* applicationCache) { AssociateDocuments(applicationCache); return NS_OK; } diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.h b/uriloader/prefetch/nsOfflineCacheUpdate.h index 2a30af71b652a..58ec123b349cf 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.h +++ b/uriloader/prefetch/nsOfflineCacheUpdate.h @@ -46,10 +46,10 @@ class nsOfflineCacheUpdateItem : public nsIStreamListener, NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSICHANNELEVENTSINK - nsOfflineCacheUpdateItem(nsIURI *aURI, nsIURI *aReferrerURI, - nsIPrincipal *aLoadingPrincipal, - nsIApplicationCache *aApplicationCache, - nsIApplicationCache *aPreviousApplicationCache, + nsOfflineCacheUpdateItem(nsIURI* aURI, nsIURI* aReferrerURI, + nsIPrincipal* aLoadingPrincipal, + nsIApplicationCache* aApplicationCache, + nsIApplicationCache* aPreviousApplicationCache, uint32_t aType, uint32_t aLoadFlags); nsCOMPtr mURI; @@ -61,15 +61,15 @@ class nsOfflineCacheUpdateItem : public nsIStreamListener, uint32_t mItemType; uint32_t mLoadFlags; - nsresult OpenChannel(nsOfflineCacheUpdate *aUpdate); + nsresult OpenChannel(nsOfflineCacheUpdate* aUpdate); nsresult Cancel(); - nsresult GetRequestSucceeded(bool *succeeded); + nsresult GetRequestSucceeded(bool* succeeded); bool IsInProgress(); bool IsScheduled(); bool IsCompleted(); - nsresult GetStatus(uint16_t *aStatus); + nsresult GetStatus(uint16_t* aStatus); private: enum LoadStatus : uint16_t { @@ -94,54 +94,54 @@ class nsOfflineManifestItem : public nsOfflineCacheUpdateItem { NS_DECL_NSISTREAMLISTENER NS_DECL_NSIREQUESTOBSERVER - nsOfflineManifestItem(nsIURI *aURI, nsIURI *aReferrerURI, - nsIPrincipal *aLoadingPrincipal, - nsIApplicationCache *aApplicationCache, - nsIApplicationCache *aPreviousApplicationCache); + nsOfflineManifestItem(nsIURI* aURI, nsIURI* aReferrerURI, + nsIPrincipal* aLoadingPrincipal, + nsIApplicationCache* aApplicationCache, + nsIApplicationCache* aPreviousApplicationCache); virtual ~nsOfflineManifestItem(); - nsCOMArray &GetExplicitURIs() { return mExplicitURIs; } - nsCOMArray &GetAnonymousURIs() { return mAnonymousURIs; } - nsCOMArray &GetFallbackURIs() { return mFallbackURIs; } + nsCOMArray& GetExplicitURIs() { return mExplicitURIs; } + nsCOMArray& GetAnonymousURIs() { return mAnonymousURIs; } + nsCOMArray& GetFallbackURIs() { return mFallbackURIs; } - nsTArray &GetOpportunisticNamespaces() { + nsTArray& GetOpportunisticNamespaces() { return mOpportunisticNamespaces; } - nsIArray *GetNamespaces() { return mNamespaces.get(); } + nsIArray* GetNamespaces() { return mNamespaces.get(); } bool ParseSucceeded() { return (mParserState != PARSE_INIT && mParserState != PARSE_ERROR); } bool NeedsUpdate() { return mParserState != PARSE_INIT && mNeedsUpdate; } - void GetManifestHash(nsCString &aManifestHash) { + void GetManifestHash(nsCString& aManifestHash) { aManifestHash = mManifestHashValue; } private: - static nsresult ReadManifest(nsIInputStream *aInputStream, void *aClosure, - const char *aFromSegment, uint32_t aOffset, - uint32_t aCount, uint32_t *aBytesConsumed); + static nsresult ReadManifest(nsIInputStream* aInputStream, void* aClosure, + const char* aFromSegment, uint32_t aOffset, + uint32_t aCount, uint32_t* aBytesConsumed); - nsresult AddNamespace(uint32_t namespaceType, const nsCString &namespaceSpec, - const nsCString &data); + nsresult AddNamespace(uint32_t namespaceType, const nsCString& namespaceSpec, + const nsCString& data); - nsresult HandleManifestLine(const nsCString::const_iterator &aBegin, - const nsCString::const_iterator &aEnd); + nsresult HandleManifestLine(const nsCString::const_iterator& aBegin, + const nsCString::const_iterator& aEnd); /** * Saves "offline-manifest-hash" meta data from the old offline cache * token to mOldManifestHashValue member to be compared on * successfull load. */ - nsresult GetOldManifestContentHash(nsIRequest *aRequest); + nsresult GetOldManifestContentHash(nsIRequest* aRequest); /** * This method setups the mNeedsUpdate to false when hash value * of the just downloaded manifest file is the same as stored in cache's * "offline-manifest-hash" meta data. Otherwise stores the new value * to this meta data. */ - nsresult CheckNewManifestContentHash(nsIRequest *aRequest); + nsresult CheckNewManifestContentHash(nsIRequest* aRequest); void ReadStrictFileOriginPolicyPref(); @@ -183,7 +183,7 @@ class nsOfflineCacheUpdateOwner public: MOZ_DECLARE_WEAKREFERENCE_TYPENAME(nsOfflineCacheUpdateOwner) virtual ~nsOfflineCacheUpdateOwner() {} - virtual nsresult UpdateFinished(nsOfflineCacheUpdate *aUpdate) = 0; + virtual nsresult UpdateFinished(nsOfflineCacheUpdate* aUpdate) = 0; }; class nsOfflineCacheUpdate final : public nsIOfflineCacheUpdate, @@ -198,22 +198,22 @@ class nsOfflineCacheUpdate final : public nsIOfflineCacheUpdate, nsOfflineCacheUpdate(); - static nsresult GetCacheKey(nsIURI *aURI, nsACString &aKey); + static nsresult GetCacheKey(nsIURI* aURI, nsACString& aKey); nsresult Init(); nsresult Begin(); - void LoadCompleted(nsOfflineCacheUpdateItem *aItem); - void ManifestCheckCompleted(nsresult aStatus, const nsCString &aManifestHash); - void StickDocument(nsIURI *aDocumentURI); + void LoadCompleted(nsOfflineCacheUpdateItem* aItem); + void ManifestCheckCompleted(nsresult aStatus, const nsCString& aManifestHash); + void StickDocument(nsIURI* aDocumentURI); - void SetOwner(nsOfflineCacheUpdateOwner *aOwner); + void SetOwner(nsOfflineCacheUpdateOwner* aOwner); - bool IsForGroupID(const nsACString &groupID); - bool IsForProfile(nsIFile *aCustomProfileDir); + bool IsForGroupID(const nsACString& groupID); + bool IsForProfile(nsIFile* aCustomProfileDir); - virtual nsresult UpdateFinished(nsOfflineCacheUpdate *aUpdate) override; + virtual nsresult UpdateFinished(nsOfflineCacheUpdate* aUpdate) override; protected: ~nsOfflineCacheUpdate(); @@ -222,9 +222,9 @@ class nsOfflineCacheUpdate final : public nsIOfflineCacheUpdate, void OnByteProgress(uint64_t byteIncrement); private: - nsresult InitInternal(nsIURI *aManifestURI, nsIPrincipal *aPrincipal); - nsresult HandleManifest(bool *aDoUpdate); - nsresult AddURI(nsIURI *aURI, uint32_t aItemType, uint32_t aLoadFlags = 0); + nsresult InitInternal(nsIURI* aManifestURI, nsIPrincipal* aPrincipal); + nsresult HandleManifest(bool* aDoUpdate); + nsresult AddURI(nsIURI* aURI, uint32_t aItemType, uint32_t aLoadFlags = 0); nsresult ProcessNextURI(); @@ -232,13 +232,13 @@ class nsOfflineCacheUpdate final : public nsIOfflineCacheUpdate, // If namespaceFilter is non-null, only items matching the // specified namespaces will be added. nsresult AddExistingItems(uint32_t aType, - nsTArray *namespaceFilter = nullptr); + nsTArray* namespaceFilter = nullptr); nsresult ScheduleImplicit(); - void AssociateDocuments(nsIApplicationCache *cache); + void AssociateDocuments(nsIApplicationCache* cache); bool CheckUpdateAvailability(); void NotifyUpdateAvailability(bool updateAvailable); - void GatherObservers(nsCOMArray &aObservers); + void GatherObservers(nsCOMArray& aObservers); void NotifyState(uint32_t state); nsresult Finish(); nsresult FinishNoNotify(); @@ -320,32 +320,32 @@ class nsOfflineCacheUpdateService final : public nsIOfflineCacheUpdateService, nsresult Init(); - nsresult ScheduleUpdate(nsOfflineCacheUpdate *aUpdate); - nsresult FindUpdate(nsIURI *aManifestURI, nsACString const &aOriginSuffix, - nsIFile *aCustomProfileDir, - nsOfflineCacheUpdate **aUpdate); + nsresult ScheduleUpdate(nsOfflineCacheUpdate* aUpdate); + nsresult FindUpdate(nsIURI* aManifestURI, nsACString const& aOriginSuffix, + nsIFile* aCustomProfileDir, + nsOfflineCacheUpdate** aUpdate); - nsresult Schedule(nsIURI *aManifestURI, nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal, - mozilla::dom::Document *aDocument, - nsPIDOMWindowInner *aWindow, nsIFile *aCustomProfileDir, - nsIOfflineCacheUpdate **aUpdate); + nsresult Schedule(nsIURI* aManifestURI, nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal, + mozilla::dom::Document* aDocument, + nsPIDOMWindowInner* aWindow, nsIFile* aCustomProfileDir, + nsIOfflineCacheUpdate** aUpdate); - virtual nsresult UpdateFinished(nsOfflineCacheUpdate *aUpdate) override; + virtual nsresult UpdateFinished(nsOfflineCacheUpdate* aUpdate) override; /** * Returns the singleton nsOfflineCacheUpdateService without an addref, or * nullptr if the service couldn't be created. */ - static nsOfflineCacheUpdateService *EnsureService(); + static nsOfflineCacheUpdateService* EnsureService(); static already_AddRefed GetInstance(); - static nsresult OfflineAppPinnedForURI(nsIURI *aDocumentURI, - nsIPrefBranch *aPrefBranch, - bool *aPinned); + static nsresult OfflineAppPinnedForURI(nsIURI* aDocumentURI, + nsIPrefBranch* aPrefBranch, + bool* aPinned); - static nsTHashtable *AllowedDomains(); + static nsTHashtable* AllowedDomains(); private: ~nsOfflineCacheUpdateService(); @@ -353,7 +353,7 @@ class nsOfflineCacheUpdateService final : public nsIOfflineCacheUpdateService, nsresult ProcessNextUpdate(); nsTArray > mUpdates; - static nsTHashtable *mAllowedDomains; + static nsTHashtable* mAllowedDomains; bool mDisabled; bool mUpdateRunning; diff --git a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp index 2eb5915828933..31ed4aa372969 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp @@ -49,14 +49,14 @@ using namespace mozilla; using namespace mozilla::dom; -static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nullptr; +static nsOfflineCacheUpdateService* gOfflineCacheUpdateService = nullptr; static bool sAllowOfflineCache = true; static bool sAllowInsecureOfflineCache = true; -nsTHashtable *nsOfflineCacheUpdateService::mAllowedDomains = +nsTHashtable* nsOfflineCacheUpdateService::mAllowedDomains = nullptr; -nsTHashtable *nsOfflineCacheUpdateService::AllowedDomains() { +nsTHashtable* nsOfflineCacheUpdateService::AllowedDomains() { if (!mAllowedDomains) mAllowedDomains = new nsTHashtable(); return mAllowedDomains; @@ -95,10 +95,10 @@ class nsOfflineCachePendingUpdate final : public nsIWebProgressListener, NS_DECL_ISUPPORTS NS_DECL_NSIWEBPROGRESSLISTENER - nsOfflineCachePendingUpdate(nsOfflineCacheUpdateService *aService, - nsIURI *aManifestURI, nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal, - Document *aDocument) + nsOfflineCachePendingUpdate(nsOfflineCacheUpdateService* aService, + nsIURI* aManifestURI, nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal, + Document* aDocument) : mService(aService), mManifestURI(aManifestURI), mDocumentURI(aDocumentURI), @@ -126,8 +126,8 @@ NS_IMPL_ISUPPORTS(nsOfflineCachePendingUpdate, nsIWebProgressListener, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsOfflineCachePendingUpdate::OnProgressChange(nsIWebProgress *aProgress, - nsIRequest *aRequest, +nsOfflineCachePendingUpdate::OnProgressChange(nsIWebProgress* aProgress, + nsIRequest* aRequest, int32_t curSelfProgress, int32_t maxSelfProgress, int32_t curTotalProgress, @@ -137,8 +137,8 @@ nsOfflineCachePendingUpdate::OnProgressChange(nsIWebProgress *aProgress, } NS_IMETHODIMP -nsOfflineCachePendingUpdate::OnStateChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsOfflineCachePendingUpdate::OnStateChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t progressStateFlags, nsresult aStatus) { if (mDidReleaseThis) { @@ -163,8 +163,8 @@ nsOfflineCachePendingUpdate::OnStateChange(nsIWebProgress *aWebProgress, aWebProgress->GetDOMWindow(getter_AddRefs(windowProxy)); if (!windowProxy) return NS_OK; - auto *outerWindow = nsPIDOMWindowOuter::From(windowProxy); - nsPIDOMWindowInner *innerWindow = outerWindow->GetCurrentInnerWindow(); + auto* outerWindow = nsPIDOMWindowOuter::From(windowProxy); + nsPIDOMWindowInner* innerWindow = outerWindow->GetCurrentInnerWindow(); nsCOMPtr progressDoc = outerWindow->GetDoc(); if (!progressDoc || progressDoc != updateDoc) { @@ -193,26 +193,26 @@ nsOfflineCachePendingUpdate::OnStateChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsOfflineCachePendingUpdate::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, - nsIURI *location, +nsOfflineCachePendingUpdate::OnLocationChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, + nsIURI* location, uint32_t aFlags) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } NS_IMETHODIMP -nsOfflineCachePendingUpdate::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsOfflineCachePendingUpdate::OnStatusChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, nsresult aStatus, - const char16_t *aMessage) { + const char16_t* aMessage) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } NS_IMETHODIMP -nsOfflineCachePendingUpdate::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsOfflineCachePendingUpdate::OnSecurityChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aState) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; @@ -220,7 +220,7 @@ nsOfflineCachePendingUpdate::OnSecurityChange(nsIWebProgress *aWebProgress, NS_IMETHODIMP nsOfflineCachePendingUpdate::OnContentBlockingEvent( - nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t aEvent) { + nsIWebProgress* aWebProgress, nsIRequest* aRequest, uint32_t aEvent) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } @@ -282,7 +282,7 @@ nsOfflineCacheUpdateService::GetInstance() { } /* static */ -nsOfflineCacheUpdateService *nsOfflineCacheUpdateService::EnsureService() { +nsOfflineCacheUpdateService* nsOfflineCacheUpdateService::EnsureService() { if (!gOfflineCacheUpdateService) { // Make the service manager hold a long-lived reference to the service nsCOMPtr service = @@ -294,7 +294,7 @@ nsOfflineCacheUpdateService *nsOfflineCacheUpdateService::EnsureService() { } nsresult nsOfflineCacheUpdateService::ScheduleUpdate( - nsOfflineCacheUpdate *aUpdate) { + nsOfflineCacheUpdate* aUpdate) { LOG(("nsOfflineCacheUpdateService::Schedule [%p, update=%p]", this, aUpdate)); aUpdate->SetOwner(this); @@ -307,8 +307,8 @@ nsresult nsOfflineCacheUpdateService::ScheduleUpdate( NS_IMETHODIMP nsOfflineCacheUpdateService::ScheduleOnDocumentStop( - nsIURI *aManifestURI, nsIURI *aDocumentURI, nsIPrincipal *aLoadingPrincipal, - Document *aDocument) { + nsIURI* aManifestURI, nsIURI* aDocumentURI, nsIPrincipal* aLoadingPrincipal, + Document* aDocument) { LOG( ("nsOfflineCacheUpdateService::ScheduleOnDocumentStop [%p, " "manifestURI=%p, documentURI=%p doc=%p]", @@ -334,7 +334,7 @@ nsOfflineCacheUpdateService::ScheduleOnDocumentStop( } nsresult nsOfflineCacheUpdateService::UpdateFinished( - nsOfflineCacheUpdate *aUpdate) { + nsOfflineCacheUpdate* aUpdate) { LOG(("nsOfflineCacheUpdateService::UpdateFinished [%p, update=%p]", this, aUpdate)); @@ -378,7 +378,7 @@ nsresult nsOfflineCacheUpdateService::ProcessNextUpdate() { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsOfflineCacheUpdateService::GetNumUpdates(uint32_t *aNumUpdates) { +nsOfflineCacheUpdateService::GetNumUpdates(uint32_t* aNumUpdates) { LOG(("nsOfflineCacheUpdateService::GetNumUpdates [%p]", this)); *aNumUpdates = mUpdates.Length(); @@ -387,7 +387,7 @@ nsOfflineCacheUpdateService::GetNumUpdates(uint32_t *aNumUpdates) { NS_IMETHODIMP nsOfflineCacheUpdateService::GetUpdate(uint32_t aIndex, - nsIOfflineCacheUpdate **aUpdate) { + nsIOfflineCacheUpdate** aUpdate) { LOG(("nsOfflineCacheUpdateService::GetUpdate [%p, %d]", this, aIndex)); if (aIndex < mUpdates.Length()) { @@ -400,8 +400,8 @@ nsOfflineCacheUpdateService::GetUpdate(uint32_t aIndex, } nsresult nsOfflineCacheUpdateService::FindUpdate( - nsIURI *aManifestURI, nsACString const &aOriginSuffix, - nsIFile *aCustomProfileDir, nsOfflineCacheUpdate **aUpdate) { + nsIURI* aManifestURI, nsACString const& aOriginSuffix, + nsIFile* aCustomProfileDir, nsOfflineCacheUpdate** aUpdate) { nsresult rv; nsCOMPtr cacheService = @@ -437,9 +437,9 @@ nsresult nsOfflineCacheUpdateService::FindUpdate( } nsresult nsOfflineCacheUpdateService::Schedule( - nsIURI *aManifestURI, nsIURI *aDocumentURI, nsIPrincipal *aLoadingPrincipal, - Document *aDocument, nsPIDOMWindowInner *aWindow, - nsIFile *aCustomProfileDir, nsIOfflineCacheUpdate **aUpdate) { + nsIURI* aManifestURI, nsIURI* aDocumentURI, nsIPrincipal* aLoadingPrincipal, + Document* aDocument, nsPIDOMWindowInner* aWindow, + nsIFile* aCustomProfileDir, nsIOfflineCacheUpdate** aUpdate) { nsCOMPtr update; if (GeckoProcessType_Default != XRE_GetProcessType()) { update = new OfflineCacheUpdateChild(aWindow); @@ -469,26 +469,26 @@ nsresult nsOfflineCacheUpdateService::Schedule( } NS_IMETHODIMP -nsOfflineCacheUpdateService::ScheduleUpdate(nsIURI *aManifestURI, - nsIURI *aDocumentURI, - nsIPrincipal *aLoadingPrincipal, - mozIDOMWindow *aWindow, - nsIOfflineCacheUpdate **aUpdate) { +nsOfflineCacheUpdateService::ScheduleUpdate(nsIURI* aManifestURI, + nsIURI* aDocumentURI, + nsIPrincipal* aLoadingPrincipal, + mozIDOMWindow* aWindow, + nsIOfflineCacheUpdate** aUpdate) { return Schedule(aManifestURI, aDocumentURI, aLoadingPrincipal, nullptr, nsPIDOMWindowInner::From(aWindow), nullptr, aUpdate); } NS_IMETHODIMP nsOfflineCacheUpdateService::ScheduleAppUpdate( - nsIURI *aManifestURI, nsIURI *aDocumentURI, nsIPrincipal *aLoadingPrincipal, - nsIFile *aProfileDir, nsIOfflineCacheUpdate **aUpdate) { + nsIURI* aManifestURI, nsIURI* aDocumentURI, nsIPrincipal* aLoadingPrincipal, + nsIFile* aProfileDir, nsIOfflineCacheUpdate** aUpdate) { return Schedule(aManifestURI, aDocumentURI, aLoadingPrincipal, nullptr, nullptr, aProfileDir, aUpdate); } NS_IMETHODIMP nsOfflineCacheUpdateService::CheckForUpdate( - nsIURI *aManifestURI, nsIPrincipal *aLoadingPrincipal, - nsIObserver *aObserver) { + nsIURI* aManifestURI, nsIPrincipal* aLoadingPrincipal, + nsIObserver* aObserver) { if (GeckoProcessType_Default != XRE_GetProcessType()) { // Not intended to support this on child processes return NS_ERROR_NOT_IMPLEMENTED; @@ -512,8 +512,8 @@ NS_IMETHODIMP nsOfflineCacheUpdateService::CheckForUpdate( //----------------------------------------------------------------------------- NS_IMETHODIMP -nsOfflineCacheUpdateService::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsOfflineCacheUpdateService::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) { if (mUpdates.Length() > 0) mUpdates[0]->Cancel(); mDisabled = true; @@ -526,9 +526,9 @@ nsOfflineCacheUpdateService::Observe(nsISupports *aSubject, const char *aTopic, // nsOfflineCacheUpdateService::nsIOfflineCacheUpdateService //----------------------------------------------------------------------------- -static nsresult OfflineAppPermForPrincipal(nsIPrincipal *aPrincipal, - nsIPrefBranch *aPrefBranch, - bool pinned, bool *aAllowed) { +static nsresult OfflineAppPermForPrincipal(nsIPrincipal* aPrincipal, + nsIPrefBranch* aPrefBranch, + bool pinned, bool* aAllowed) { *aAllowed = false; if (!sAllowOfflineCache) { @@ -595,16 +595,16 @@ static nsresult OfflineAppPermForPrincipal(nsIPrincipal *aPrincipal, } NS_IMETHODIMP -nsOfflineCacheUpdateService::OfflineAppAllowed(nsIPrincipal *aPrincipal, - nsIPrefBranch *aPrefBranch, - bool *aAllowed) { +nsOfflineCacheUpdateService::OfflineAppAllowed(nsIPrincipal* aPrincipal, + nsIPrefBranch* aPrefBranch, + bool* aAllowed) { return OfflineAppPermForPrincipal(aPrincipal, aPrefBranch, false, aAllowed); } NS_IMETHODIMP -nsOfflineCacheUpdateService::OfflineAppAllowedForURI(nsIURI *aURI, - nsIPrefBranch *aPrefBranch, - bool *aAllowed) { +nsOfflineCacheUpdateService::OfflineAppAllowedForURI(nsIURI* aURI, + nsIPrefBranch* aPrefBranch, + bool* aAllowed) { OriginAttributes attrs; nsCOMPtr principal = BasePrincipal::CreateCodebasePrincipal(aURI, attrs); @@ -612,7 +612,7 @@ nsOfflineCacheUpdateService::OfflineAppAllowedForURI(nsIURI *aURI, } nsresult nsOfflineCacheUpdateService::OfflineAppPinnedForURI( - nsIURI *aDocumentURI, nsIPrefBranch *aPrefBranch, bool *aPinned) { + nsIURI* aDocumentURI, nsIPrefBranch* aPrefBranch, bool* aPinned) { OriginAttributes attrs; nsCOMPtr principal = BasePrincipal::CreateCodebasePrincipal(aDocumentURI, attrs); @@ -620,7 +620,7 @@ nsresult nsOfflineCacheUpdateService::OfflineAppPinnedForURI( } NS_IMETHODIMP -nsOfflineCacheUpdateService::AllowOfflineApp(nsIPrincipal *aPrincipal) { +nsOfflineCacheUpdateService::AllowOfflineApp(nsIPrincipal* aPrincipal) { nsresult rv; if (!sAllowOfflineCache) { @@ -651,7 +651,7 @@ nsOfflineCacheUpdateService::AllowOfflineApp(nsIPrincipal *aPrincipal) { } if (GeckoProcessType_Default != XRE_GetProcessType()) { - ContentChild *child = ContentChild::GetSingleton(); + ContentChild* child = ContentChild::GetSingleton(); if (!child->SendSetOfflinePermission(IPC::Principal(aPrincipal))) { return NS_ERROR_FAILURE; diff --git a/uriloader/prefetch/nsPrefetchService.cpp b/uriloader/prefetch/nsPrefetchService.cpp index c3995b0898ff4..64ee53ae20437 100644 --- a/uriloader/prefetch/nsPrefetchService.cpp +++ b/uriloader/prefetch/nsPrefetchService.cpp @@ -67,8 +67,8 @@ static LazyLogModule gPrefetchLog("nsPrefetch"); // nsPrefetchNode //----------------------------------------------------------------------------- -nsPrefetchNode::nsPrefetchNode(nsPrefetchService *aService, nsIURI *aURI, - nsIURI *aReferrerURI, nsINode *aSource, +nsPrefetchNode::nsPrefetchNode(nsPrefetchService* aService, nsIURI* aURI, + nsIURI* aReferrerURI, nsINode* aSource, nsContentPolicyType aPolicyType, bool aPreload) : mURI(aURI), mReferrerURI(aReferrerURI), @@ -105,7 +105,7 @@ nsresult nsPrefetchNode::OpenChannel() { nsCOMPtr loadGroup = source->OwnerDoc()->GetDocumentLoadGroup(); CORSMode corsMode = CORS_NONE; net::ReferrerPolicy referrerPolicy = net::RP_Unset; - if (auto *link = dom::HTMLLinkElement::FromNode(source)) { + if (auto* link = dom::HTMLLinkElement::FromNode(source)) { corsMode = link->GetCORSMode(); referrerPolicy = link->GetReferrerPolicyAsEnum(); } @@ -180,7 +180,7 @@ NS_IMPL_ISUPPORTS(nsPrefetchNode, nsIRequestObserver, nsIStreamListener, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsPrefetchNode::OnStartRequest(nsIRequest *aRequest) { +nsPrefetchNode::OnStartRequest(nsIRequest* aRequest) { nsresult rv; nsCOMPtr httpChannel = do_QueryInterface(aRequest, &rv); @@ -232,7 +232,7 @@ nsPrefetchNode::OnStartRequest(nsIRequest *aRequest) { } NS_IMETHODIMP -nsPrefetchNode::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aStream, +nsPrefetchNode::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream, uint64_t aOffset, uint32_t aCount) { uint32_t bytesRead = 0; aStream->ReadSegments(NS_DiscardSegment, nullptr, aCount, &bytesRead); @@ -242,7 +242,7 @@ nsPrefetchNode::OnDataAvailable(nsIRequest *aRequest, nsIInputStream *aStream, } NS_IMETHODIMP -nsPrefetchNode::OnStopRequest(nsIRequest *aRequest, nsresult aStatus) { +nsPrefetchNode::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) { LOG(("done prefetching [status=%" PRIx32 "]\n", static_cast(aStatus))); @@ -264,16 +264,16 @@ nsPrefetchNode::OnStopRequest(nsIRequest *aRequest, nsresult aStatus) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsPrefetchNode::GetInterface(const nsIID &aIID, void **aResult) { +nsPrefetchNode::GetInterface(const nsIID& aIID, void** aResult) { if (aIID.Equals(NS_GET_IID(nsIChannelEventSink))) { NS_ADDREF_THIS(); - *aResult = static_cast(this); + *aResult = static_cast(this); return NS_OK; } if (aIID.Equals(NS_GET_IID(nsIRedirectResultListener))) { NS_ADDREF_THIS(); - *aResult = static_cast(this); + *aResult = static_cast(this); return NS_OK; } @@ -286,8 +286,8 @@ nsPrefetchNode::GetInterface(const nsIID &aIID, void **aResult) { NS_IMETHODIMP nsPrefetchNode::AsyncOnChannelRedirect( - nsIChannel *aOldChannel, nsIChannel *aNewChannel, uint32_t aFlags, - nsIAsyncVerifyRedirectCallback *callback) { + nsIChannel* aOldChannel, nsIChannel* aNewChannel, uint32_t aFlags, + nsIAsyncVerifyRedirectCallback* callback) { nsCOMPtr newURI; nsresult rv = aNewChannel->GetURI(getter_AddRefs(newURI)); if (NS_FAILED(rv)) return rv; @@ -388,7 +388,7 @@ nsresult nsPrefetchService::Init() { } void nsPrefetchService::RemoveNodeAndMaybeStartNextPrefetchURI( - nsPrefetchNode *aFinished) { + nsPrefetchNode* aFinished) { if (aFinished) { mCurrentNodes.RemoveElement(aFinished); } @@ -432,29 +432,29 @@ void nsPrefetchService::ProcessNextPrefetchURI() { } while (NS_FAILED(rv)); } -void nsPrefetchService::NotifyLoadRequested(nsPrefetchNode *node) { +void nsPrefetchService::NotifyLoadRequested(nsPrefetchNode* node) { nsCOMPtr observerService = mozilla::services::GetObserverService(); if (!observerService) return; observerService->NotifyObservers( - static_cast(node), + static_cast(node), (node->mPreload) ? "preload-load-requested" : "prefetch-load-requested", nullptr); } -void nsPrefetchService::NotifyLoadCompleted(nsPrefetchNode *node) { +void nsPrefetchService::NotifyLoadCompleted(nsPrefetchNode* node) { nsCOMPtr observerService = mozilla::services::GetObserverService(); if (!observerService) return; observerService->NotifyObservers( - static_cast(node), + static_cast(node), (node->mPreload) ? "preload-load-completed" : "prefetch-load-completed", nullptr); } -void nsPrefetchService::DispatchEvent(nsPrefetchNode *node, bool aSuccess) { +void nsPrefetchService::DispatchEvent(nsPrefetchNode* node, bool aSuccess) { for (uint32_t i = 0; i < node->mSources.Length(); i++) { nsCOMPtr domNode = do_QueryReferent(node->mSources.ElementAt(i)); if (domNode && domNode->IsInComposedDoc()) { @@ -488,9 +488,9 @@ void nsPrefetchService::RemoveProgressListener() { if (progress) progress->RemoveProgressListener(this); } -nsresult nsPrefetchService::EnqueueURI(nsIURI *aURI, nsIURI *aReferrerURI, - nsINode *aSource, - nsPrefetchNode **aNode) { +nsresult nsPrefetchService::EnqueueURI(nsIURI* aURI, nsIURI* aReferrerURI, + nsINode* aSource, + nsPrefetchNode** aNode) { RefPtr node = new nsPrefetchNode( this, aURI, aReferrerURI, aSource, nsIContentPolicy::TYPE_OTHER, false); mPrefetchQueue.push_back(node); @@ -561,7 +561,7 @@ void nsPrefetchService::StopAll() { EmptyPrefetchQueue(); } -nsresult nsPrefetchService::CheckURIScheme(nsIURI *aURI, nsIURI *aReferrerURI) { +nsresult nsPrefetchService::CheckURIScheme(nsIURI* aURI, nsIURI* aReferrerURI) { // // XXX we should really be asking the protocol handler if it supports // caching, so we can determine if there is any value to prefetching. @@ -604,8 +604,8 @@ NS_IMPL_ISUPPORTS(nsPrefetchService, nsIPrefetchService, nsIWebProgressListener, // nsPrefetchService::nsIPrefetchService //----------------------------------------------------------------------------- -nsresult nsPrefetchService::Preload(nsIURI *aURI, nsIURI *aReferrerURI, - nsINode *aSource, +nsresult nsPrefetchService::Preload(nsIURI* aURI, nsIURI* aReferrerURI, + nsINode* aSource, nsContentPolicyType aPolicyType) { NS_ENSURE_ARG_POINTER(aURI); NS_ENSURE_ARG_POINTER(aReferrerURI); @@ -680,8 +680,8 @@ nsresult nsPrefetchService::Preload(nsIURI *aURI, nsIURI *aReferrerURI, return NS_OK; } -nsresult nsPrefetchService::Prefetch(nsIURI *aURI, nsIURI *aReferrerURI, - nsINode *aSource, bool aExplicit) { +nsresult nsPrefetchService::Prefetch(nsIURI* aURI, nsIURI* aReferrerURI, + nsINode* aSource, bool aExplicit) { NS_ENSURE_ARG_POINTER(aURI); NS_ENSURE_ARG_POINTER(aReferrerURI); @@ -776,7 +776,7 @@ nsresult nsPrefetchService::Prefetch(nsIURI *aURI, nsIURI *aReferrerURI, } NS_IMETHODIMP -nsPrefetchService::CancelPrefetchPreloadURI(nsIURI *aURI, nsINode *aSource) { +nsPrefetchService::CancelPrefetchPreloadURI(nsIURI* aURI, nsINode* aSource) { NS_ENSURE_ARG_POINTER(aURI); if (LOG_ENABLED()) { @@ -836,20 +836,20 @@ nsPrefetchService::CancelPrefetchPreloadURI(nsIURI *aURI, nsINode *aSource) { } NS_IMETHODIMP -nsPrefetchService::PreloadURI(nsIURI *aURI, nsIURI *aReferrerURI, - nsINode *aSource, +nsPrefetchService::PreloadURI(nsIURI* aURI, nsIURI* aReferrerURI, + nsINode* aSource, nsContentPolicyType aPolicyType) { return Preload(aURI, aReferrerURI, aSource, aPolicyType); } NS_IMETHODIMP -nsPrefetchService::PrefetchURI(nsIURI *aURI, nsIURI *aReferrerURI, - nsINode *aSource, bool aExplicit) { +nsPrefetchService::PrefetchURI(nsIURI* aURI, nsIURI* aReferrerURI, + nsINode* aSource, bool aExplicit) { return Prefetch(aURI, aReferrerURI, aSource, aExplicit); } NS_IMETHODIMP -nsPrefetchService::HasMoreElements(bool *aHasMore) { +nsPrefetchService::HasMoreElements(bool* aHasMore) { *aHasMore = (mCurrentNodes.Length() || !mPrefetchQueue.empty()); return NS_OK; } @@ -859,8 +859,8 @@ nsPrefetchService::HasMoreElements(bool *aHasMore) { //----------------------------------------------------------------------------- NS_IMETHODIMP -nsPrefetchService::OnProgressChange(nsIWebProgress *aProgress, - nsIRequest *aRequest, +nsPrefetchService::OnProgressChange(nsIWebProgress* aProgress, + nsIRequest* aRequest, int32_t curSelfProgress, int32_t maxSelfProgress, int32_t curTotalProgress, @@ -870,8 +870,8 @@ nsPrefetchService::OnProgressChange(nsIWebProgress *aProgress, } NS_IMETHODIMP -nsPrefetchService::OnStateChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsPrefetchService::OnStateChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t progressStateFlags, nsresult aStatus) { if (progressStateFlags & STATE_IS_DOCUMENT) { @@ -885,31 +885,31 @@ nsPrefetchService::OnStateChange(nsIWebProgress *aWebProgress, } NS_IMETHODIMP -nsPrefetchService::OnLocationChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, nsIURI *location, +nsPrefetchService::OnLocationChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, nsIURI* location, uint32_t aFlags) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } NS_IMETHODIMP -nsPrefetchService::OnStatusChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, nsresult aStatus, - const char16_t *aMessage) { +nsPrefetchService::OnStatusChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, nsresult aStatus, + const char16_t* aMessage) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } NS_IMETHODIMP -nsPrefetchService::OnSecurityChange(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, uint32_t aState) { +nsPrefetchService::OnSecurityChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aState) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; } NS_IMETHODIMP -nsPrefetchService::OnContentBlockingEvent(nsIWebProgress *aWebProgress, - nsIRequest *aRequest, +nsPrefetchService::OnContentBlockingEvent(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aEvent) { MOZ_ASSERT_UNREACHABLE("notification excluded in AddProgressListener(...)"); return NS_OK; @@ -920,8 +920,8 @@ nsPrefetchService::OnContentBlockingEvent(nsIWebProgress *aWebProgress, //----------------------------------------------------------------------------- NS_IMETHODIMP -nsPrefetchService::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsPrefetchService::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { LOG(("nsPrefetchService::Observe [topic=%s]\n", aTopic)); if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) { @@ -930,7 +930,7 @@ nsPrefetchService::Observe(nsISupports *aSubject, const char *aTopic, mPreloadDisabled = true; } else if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) { const nsCString converted = NS_ConvertUTF16toUTF8(aData); - const char *pref = converted.get(); + const char* pref = converted.get(); if (!strcmp(pref, PREFETCH_PREF)) { if (Preferences::GetBool(PREFETCH_PREF, false)) { if (mPrefetchDisabled) { diff --git a/uriloader/prefetch/nsPrefetchService.h b/uriloader/prefetch/nsPrefetchService.h index b4ecea900a338..4bf8fe57189a7 100644 --- a/uriloader/prefetch/nsPrefetchService.h +++ b/uriloader/prefetch/nsPrefetchService.h @@ -40,33 +40,33 @@ class nsPrefetchService final : public nsIPrefetchService, nsPrefetchService(); nsresult Init(); - void RemoveNodeAndMaybeStartNextPrefetchURI(nsPrefetchNode *aFinished); + void RemoveNodeAndMaybeStartNextPrefetchURI(nsPrefetchNode* aFinished); void ProcessNextPrefetchURI(); - void NotifyLoadRequested(nsPrefetchNode *node); - void NotifyLoadCompleted(nsPrefetchNode *node); - void DispatchEvent(nsPrefetchNode *node, bool aSuccess); + void NotifyLoadRequested(nsPrefetchNode* node); + void NotifyLoadCompleted(nsPrefetchNode* node); + void DispatchEvent(nsPrefetchNode* node, bool aSuccess); private: ~nsPrefetchService(); - nsresult Prefetch(nsIURI *aURI, nsIURI *aReferrerURI, nsINode *aSource, + nsresult Prefetch(nsIURI* aURI, nsIURI* aReferrerURI, nsINode* aSource, bool aExplicit); - nsresult Preload(nsIURI *aURI, nsIURI *aReferrerURI, nsINode *aSource, + nsresult Preload(nsIURI* aURI, nsIURI* aReferrerURI, nsINode* aSource, nsContentPolicyType aPolicyType); void AddProgressListener(); void RemoveProgressListener(); - nsresult EnqueueURI(nsIURI *aURI, nsIURI *aReferrerURI, nsINode *aSource, - nsPrefetchNode **node); + nsresult EnqueueURI(nsIURI* aURI, nsIURI* aReferrerURI, nsINode* aSource, + nsPrefetchNode** node); void EmptyPrefetchQueue(); void StartPrefetching(); void StopPrefetching(); void StopCurrentPrefetchsPreloads(bool aPreload); void StopAll(); - nsresult CheckURIScheme(nsIURI *aURI, nsIURI *aReferrerURI); + nsresult CheckURIScheme(nsIURI* aURI, nsIURI* aReferrerURI); std::deque> mPrefetchQueue; nsTArray> mCurrentNodes; @@ -99,8 +99,8 @@ class nsPrefetchNode final : public nsIStreamListener, NS_DECL_NSICHANNELEVENTSINK NS_DECL_NSIREDIRECTRESULTLISTENER - nsPrefetchNode(nsPrefetchService *aPrefetchService, nsIURI *aURI, - nsIURI *aReferrerURI, nsINode *aSource, + nsPrefetchNode(nsPrefetchService* aPrefetchService, nsIURI* aURI, + nsIURI* aReferrerURI, nsINode* aSource, nsContentPolicyType aPolicyType, bool aPreload); nsresult OpenChannel(); diff --git a/widget/GfxDriverInfo.h b/widget/GfxDriverInfo.h index 1d6b3566b1529..240b079f73342 100644 --- a/widget/GfxDriverInfo.h +++ b/widget/GfxDriverInfo.h @@ -148,14 +148,14 @@ typedef nsTArray GfxDeviceFamily; struct GfxDriverInfo { // If |ownDevices| is true, you are transferring ownership of the devices // array, and it will be deleted when this GfxDriverInfo is destroyed. - GfxDriverInfo(OperatingSystem os, nsAString &vendor, GfxDeviceFamily *devices, + GfxDriverInfo(OperatingSystem os, nsAString& vendor, GfxDeviceFamily* devices, int32_t feature, int32_t featureStatus, VersionComparisonOp op, - uint64_t driverVersion, const char *ruleId, - const char *suggestedVersion = nullptr, bool ownDevices = false, + uint64_t driverVersion, const char* ruleId, + const char* suggestedVersion = nullptr, bool ownDevices = false, bool gpu2 = false); GfxDriverInfo(); - GfxDriverInfo(const GfxDriverInfo &); + GfxDriverInfo(const GfxDriverInfo&); ~GfxDriverInfo(); OperatingSystem mOperatingSystem; @@ -163,8 +163,8 @@ struct GfxDriverInfo { nsString mAdapterVendor; - static GfxDeviceFamily *const allDevices; - GfxDeviceFamily *mDevices; + static GfxDeviceFamily* const allDevices; + GfxDeviceFamily* mDevices; // Whether the mDevices array should be deleted when this structure is // deallocated. False by default. @@ -184,14 +184,14 @@ struct GfxDriverInfo { uint64_t mDriverVersionMax; static uint64_t allDriverVersions; - const char *mSuggestedVersion; + const char* mSuggestedVersion; nsCString mRuleId; - static const GfxDeviceFamily *GetDeviceFamily(DeviceFamily id); - static GfxDeviceFamily *sDeviceFamilies[DeviceFamilyMax]; + static const GfxDeviceFamily* GetDeviceFamily(DeviceFamily id); + static GfxDeviceFamily* sDeviceFamilies[DeviceFamilyMax]; - static const nsAString &GetDeviceVendor(DeviceVendor id); - static nsAString *sDeviceVendors[DeviceVendorMax]; + static const nsAString& GetDeviceVendor(DeviceVendor id); + static nsAString* sDeviceVendors[DeviceVendorMax]; nsString mModel, mHardware, mProduct, mManufacturer; @@ -219,13 +219,13 @@ inline uint64_t V(uint32_t a, uint32_t b, uint32_t c, uint32_t d) { } // All destination string storage needs to have at least 5 bytes available. -inline bool SplitDriverVersion(const char *aSource, char *aAStr, char *aBStr, - char *aCStr, char *aDStr) { +inline bool SplitDriverVersion(const char* aSource, char* aAStr, char* aBStr, + char* aCStr, char* aDStr) { // sscanf doesn't do what we want here to we parse this manually. int len = strlen(aSource); // This "4" is hardcoded in a few places, including once as a 3. - char *dest[4] = {aAStr, aBStr, aCStr, aDStr}; + char* dest[4] = {aAStr, aBStr, aCStr, aDStr}; unsigned destIdx = 0; unsigned destPos = 0; @@ -272,7 +272,7 @@ inline bool SplitDriverVersion(const char *aSource, char *aAStr, char *aBStr, // a little strange but this method seems to do the right thing for all // different vendor's driver strings. i.e. .98 will become 9800, which is // larger than .978 which would become 9780. -inline void PadDriverDecimal(char *aString) { +inline void PadDriverDecimal(char* aString) { for (int i = 0; i < 4; i++) { if (!aString[i]) { for (int c = i; c < 4; c++) { @@ -284,8 +284,8 @@ inline void PadDriverDecimal(char *aString) { aString[4] = 0; } -inline bool ParseDriverVersion(const nsAString &aVersion, - uint64_t *aNumericVersion) { +inline bool ParseDriverVersion(const nsAString& aVersion, + uint64_t* aNumericVersion) { *aNumericVersion = 0; #if defined(XP_WIN) || defined(MOZ_X11) diff --git a/widget/GfxInfoCollector.cpp b/widget/GfxInfoCollector.cpp index 6c851405aa902..262b2206cd31c 100644 --- a/widget/GfxInfoCollector.cpp +++ b/widget/GfxInfoCollector.cpp @@ -12,18 +12,18 @@ using namespace mozilla; using namespace widget; -void InfoObject::DefineProperty(const char *name, int value) { +void InfoObject::DefineProperty(const char* name, int value) { if (!mOk) return; mOk = JS_DefineProperty(mCx, mObj, name, value, JSPROP_ENUMERATE); } -void InfoObject::DefineProperty(const char *name, nsAString &value) { +void InfoObject::DefineProperty(const char* name, nsAString& value) { if (!mOk) return; - const nsString &flat = PromiseFlatString(value); - JS::Rooted string( - mCx, JS_NewUCStringCopyN(mCx, static_cast(flat.get()), + const nsString& flat = PromiseFlatString(value); + JS::Rooted string( + mCx, JS_NewUCStringCopyN(mCx, static_cast(flat.get()), flat.Length())); if (!string) mOk = false; @@ -32,12 +32,12 @@ void InfoObject::DefineProperty(const char *name, nsAString &value) { mOk = JS_DefineProperty(mCx, mObj, name, string, JSPROP_ENUMERATE); } -void InfoObject::DefineProperty(const char *name, const char *value) { +void InfoObject::DefineProperty(const char* name, const char* value) { nsAutoString string = NS_ConvertASCIItoUTF16(value); DefineProperty(name, string); } -InfoObject::InfoObject(JSContext *aCx) : mCx(aCx), mObj(aCx), mOk(true) { +InfoObject::InfoObject(JSContext* aCx) : mCx(aCx), mObj(aCx), mOk(true) { mObj = JS_NewPlainObject(aCx); if (!mObj) mOk = false; } diff --git a/widget/GfxInfoCollector.h b/widget/GfxInfoCollector.h index 06f0af3c888e7..dd5cd2b4b1ff1 100644 --- a/widget/GfxInfoCollector.h +++ b/widget/GfxInfoCollector.h @@ -21,18 +21,18 @@ class MOZ_STACK_CLASS InfoObject { friend class GfxInfoBase; public: - void DefineProperty(const char *name, int value); - void DefineProperty(const char *name, nsAString &value); - void DefineProperty(const char *name, const char *value); + void DefineProperty(const char* name, int value); + void DefineProperty(const char* name, nsAString& value); + void DefineProperty(const char* name, const char* value); private: // We need to ensure that this object lives on the stack so that GC sees it // properly - explicit InfoObject(JSContext *aCx); - InfoObject(InfoObject &); + explicit InfoObject(JSContext* aCx); + InfoObject(InfoObject&); - JSContext *mCx; - JS::Rooted mObj; + JSContext* mCx; + JS::Rooted mObj; bool mOk; }; @@ -66,20 +66,20 @@ class MOZ_STACK_CLASS InfoObject { class GfxInfoCollectorBase { public: GfxInfoCollectorBase(); - virtual void GetInfo(InfoObject &obj) = 0; + virtual void GetInfo(InfoObject& obj) = 0; virtual ~GfxInfoCollectorBase(); }; template class GfxInfoCollector : public GfxInfoCollectorBase { public: - GfxInfoCollector(T *aPointer, void (T::*aFunc)(InfoObject &obj)) + GfxInfoCollector(T* aPointer, void (T::*aFunc)(InfoObject& obj)) : mPointer(aPointer), mFunc(aFunc) {} - virtual void GetInfo(InfoObject &obj) override { (mPointer->*mFunc)(obj); } + virtual void GetInfo(InfoObject& obj) override { (mPointer->*mFunc)(obj); } protected: - T *mPointer; - void (T::*mFunc)(InfoObject &obj); + T* mPointer; + void (T::*mFunc)(InfoObject& obj); }; } // namespace widget diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 13777676add5e..ddcb38a632618 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -119,11 +119,11 @@ void GfxInfo::GetData() { // Available if using a DRI-based libGL stack. nsCString driDriver; - nsCString *stringToFill = nullptr; - char *bufptr = buf; + nsCString* stringToFill = nullptr; + char* bufptr = buf; if (!error) { while (true) { - char *line = NS_strtok("\n", &bufptr); + char* line = NS_strtok("\n", &bufptr); if (!line) break; if (stringToFill) { stringToFill->Assign(line); @@ -159,15 +159,15 @@ void GfxInfo::GetData() { mOSRelease.Assign(unameobj.release); } - const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR"); + const char* spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR"); if (spoofedVendor) glVendor.Assign(spoofedVendor); - const char *spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER"); + const char* spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER"); if (spoofedRenderer) glRenderer.Assign(spoofedRenderer); - const char *spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION"); + const char* spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION"); if (spoofedVersion) glVersion.Assign(spoofedVersion); - const char *spoofedOS = PR_GetEnv("MOZ_GFX_SPOOF_OS"); + const char* spoofedOS = PR_GetEnv("MOZ_GFX_SPOOF_OS"); if (spoofedOS) mOS.Assign(spoofedOS); - const char *spoofedOSRelease = PR_GetEnv("MOZ_GFX_SPOOF_OS_RELEASE"); + const char* spoofedOSRelease = PR_GetEnv("MOZ_GFX_SPOOF_OS_RELEASE"); if (spoofedOSRelease) mOSRelease.Assign(spoofedOSRelease); if (error || glVendor.IsEmpty() || glRenderer.IsEmpty() || @@ -281,13 +281,13 @@ void GfxInfo::GetData() { AddCrashReportAnnotations(); } -const nsTArray &GfxInfo::GetGfxDriverInfo() { +const nsTArray& GfxInfo::GetGfxDriverInfo() { if (!sDriverInfo->Length()) { // Mesa 10.0 provides the GLX_MESA_query_renderer extension, which allows us // to query device IDs backing a GL context for blacklisting. APPEND_TO_DRIVER_BLOCKLIST( OperatingSystem::Linux, - (nsAString &)GfxDriverInfo::GetDeviceVendor(VendorMesaAll), + (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorMesaAll), GfxDriverInfo::allDevices, GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, V(10, 0, 0, 0), "FEATURE_FAILURE_OLD_MESA", "Mesa 10.0"); @@ -295,7 +295,7 @@ const nsTArray &GfxInfo::GetGfxDriverInfo() { // NVIDIA baseline (ported from old blocklist) APPEND_TO_DRIVER_BLOCKLIST( OperatingSystem::Linux, - (nsAString &)GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), + (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices, GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, V(257, 21, 0, 0), "FEATURE_FAILURE_OLD_NVIDIA", "NVIDIA 257.21"); @@ -303,7 +303,7 @@ const nsTArray &GfxInfo::GetGfxDriverInfo() { // fglrx baseline (chosen arbitrarily as 2013-07-22 release). APPEND_TO_DRIVER_BLOCKLIST( OperatingSystem::Linux, - (nsAString &)GfxDriverInfo::GetDeviceVendor(VendorATI), + (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorATI), GfxDriverInfo::allDevices, GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, V(13, 15, 100, 1), "FEATURE_FAILURE_OLD_FGLRX", "fglrx 13.15.100.1"); @@ -315,7 +315,7 @@ const nsTArray &GfxInfo::GetGfxDriverInfo() { // Ubuntu 18.04 LTS). APPEND_TO_DRIVER_BLOCKLIST( OperatingSystem::Linux, - (nsAString &)GfxDriverInfo::GetDeviceVendor(VendorMesaAll), + (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorMesaAll), GfxDriverInfo::allDevices, nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, V(18, 2, 8, 0), "FEATURE_FAILURE_WEBRENDER_OLD_MESA", "Mesa 18.2.8.0"); @@ -323,7 +323,7 @@ const nsTArray &GfxInfo::GetGfxDriverInfo() { // Disable on all NVIDIA devices for now. APPEND_TO_DRIVER_BLOCKLIST( OperatingSystem::Linux, - (nsAString &)GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), + (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), GfxDriverInfo::allDevices, nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), "FEATURE_FAILURE_WEBRENDER_NO_LINUX_NVIDIA", ""); @@ -331,7 +331,7 @@ const nsTArray &GfxInfo::GetGfxDriverInfo() { // Disable on all ATI devices for now. APPEND_TO_DRIVER_BLOCKLIST( OperatingSystem::Linux, - (nsAString &)GfxDriverInfo::GetDeviceVendor(VendorATI), + (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorATI), GfxDriverInfo::allDevices, nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), "FEATURE_FAILURE_WEBRENDER_NO_LINUX_ATI", ""); @@ -339,8 +339,8 @@ const nsTArray &GfxInfo::GetGfxDriverInfo() { return *sDriverInfo; } -bool GfxInfo::DoesVendorMatch(const nsAString &aBlocklistVendor, - const nsAString &aAdapterVendor) { +bool GfxInfo::DoesVendorMatch(const nsAString& aBlocklistVendor, + const nsAString& aAdapterVendor) { if (mIsMesa && aBlocklistVendor.Equals(GfxDriverInfo::GetDeviceVendor(VendorMesaAll), nsCaseInsensitiveStringComparator())) { @@ -350,9 +350,9 @@ bool GfxInfo::DoesVendorMatch(const nsAString &aBlocklistVendor, } nsresult GfxInfo::GetFeatureStatusImpl( - int32_t aFeature, int32_t *aStatus, nsAString &aSuggestedDriverVersion, - const nsTArray &aDriverInfo, nsACString &aFailureId, - OperatingSystem *aOS /* = nullptr */) + int32_t aFeature, int32_t* aStatus, nsAString& aSuggestedDriverVersion, + const nsTArray& aDriverInfo, nsACString& aFailureId, + OperatingSystem* aOS /* = nullptr */) { NS_ENSURE_ARG_POINTER(aStatus); @@ -397,120 +397,120 @@ nsresult GfxInfo::GetFeatureStatusImpl( } NS_IMETHODIMP -GfxInfo::GetD2DEnabled(bool *aEnabled) { return NS_ERROR_FAILURE; } +GfxInfo::GetD2DEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetDWriteEnabled(bool *aEnabled) { return NS_ERROR_FAILURE; } +GfxInfo::GetDWriteEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetDWriteVersion(nsAString &aDwriteVersion) { +GfxInfo::GetDWriteVersion(nsAString& aDwriteVersion) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetCleartypeParameters(nsAString &aCleartypeParams) { +GfxInfo::GetCleartypeParameters(nsAString& aCleartypeParams) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterDescription(nsAString &aAdapterDescription) { +GfxInfo::GetAdapterDescription(nsAString& aAdapterDescription) { GetData(); AppendASCIItoUTF16(mAdapterDescription, aAdapterDescription); return NS_OK; } NS_IMETHODIMP -GfxInfo::GetAdapterDescription2(nsAString &aAdapterDescription) { +GfxInfo::GetAdapterDescription2(nsAString& aAdapterDescription) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterRAM(nsAString &aAdapterRAM) { +GfxInfo::GetAdapterRAM(nsAString& aAdapterRAM) { GetData(); CopyUTF8toUTF16(mAdapterRAM, aAdapterRAM); return NS_OK; } NS_IMETHODIMP -GfxInfo::GetAdapterRAM2(nsAString &aAdapterRAM) { return NS_ERROR_FAILURE; } +GfxInfo::GetAdapterRAM2(nsAString& aAdapterRAM) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterDriver(nsAString &aAdapterDriver) { +GfxInfo::GetAdapterDriver(nsAString& aAdapterDriver) { aAdapterDriver.Truncate(); return NS_OK; } NS_IMETHODIMP -GfxInfo::GetAdapterDriver2(nsAString &aAdapterDriver) { +GfxInfo::GetAdapterDriver2(nsAString& aAdapterDriver) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterDriverVersion(nsAString &aAdapterDriverVersion) { +GfxInfo::GetAdapterDriverVersion(nsAString& aAdapterDriverVersion) { GetData(); CopyASCIItoUTF16(mDriverVersion, aAdapterDriverVersion); return NS_OK; } NS_IMETHODIMP -GfxInfo::GetAdapterDriverVersion2(nsAString &aAdapterDriverVersion) { +GfxInfo::GetAdapterDriverVersion2(nsAString& aAdapterDriverVersion) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterDriverDate(nsAString &aAdapterDriverDate) { +GfxInfo::GetAdapterDriverDate(nsAString& aAdapterDriverDate) { aAdapterDriverDate.Truncate(); return NS_OK; } NS_IMETHODIMP -GfxInfo::GetAdapterDriverDate2(nsAString &aAdapterDriverDate) { +GfxInfo::GetAdapterDriverDate2(nsAString& aAdapterDriverDate) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterVendorID(nsAString &aAdapterVendorID) { +GfxInfo::GetAdapterVendorID(nsAString& aAdapterVendorID) { GetData(); CopyUTF8toUTF16(mVendorId, aAdapterVendorID); return NS_OK; } NS_IMETHODIMP -GfxInfo::GetAdapterVendorID2(nsAString &aAdapterVendorID) { +GfxInfo::GetAdapterVendorID2(nsAString& aAdapterVendorID) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterDeviceID(nsAString &aAdapterDeviceID) { +GfxInfo::GetAdapterDeviceID(nsAString& aAdapterDeviceID) { GetData(); CopyUTF8toUTF16(mDeviceId, aAdapterDeviceID); return NS_OK; } NS_IMETHODIMP -GfxInfo::GetAdapterDeviceID2(nsAString &aAdapterDeviceID) { +GfxInfo::GetAdapterDeviceID2(nsAString& aAdapterDeviceID) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterSubsysID(nsAString &aAdapterSubsysID) { +GfxInfo::GetAdapterSubsysID(nsAString& aAdapterSubsysID) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetAdapterSubsysID2(nsAString &aAdapterSubsysID) { +GfxInfo::GetAdapterSubsysID2(nsAString& aAdapterSubsysID) { return NS_ERROR_FAILURE; } NS_IMETHODIMP -GfxInfo::GetIsGPU2Active(bool *aIsGPU2Active) { return NS_ERROR_FAILURE; } +GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) { return NS_ERROR_FAILURE; } #ifdef DEBUG // Implement nsIGfxInfoDebug // We don't support spoofing anything on Linux -NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString &aVendorID) { +NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString& aVendorID) { GetData(); CopyUTF16toUTF8(aVendorID, mVendorId); mIsAccelerated = !(mVendorId.EqualsLiteral("mesa/llvmpipe") || @@ -519,13 +519,13 @@ NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString &aVendorID) { return NS_OK; } -NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString &aDeviceID) { +NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString& aDeviceID) { GetData(); CopyUTF16toUTF8(aDeviceID, mDeviceId); return NS_OK; } -NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString &aDriverVersion) { +NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString& aDriverVersion) { GetData(); CopyUTF16toUTF8(aDriverVersion, mDriverVersion); return NS_OK; diff --git a/widget/android/ANRReporter.cpp b/widget/android/ANRReporter.cpp index cbc6a72ab5f2d..12740a8b21eef 100644 --- a/widget/android/ANRReporter.cpp +++ b/widget/android/ANRReporter.cpp @@ -25,12 +25,12 @@ bool ANRReporter::RequestNativeStack(bool aUnwind) { (aUnwind ? ProfilerFeature::StackWalk : 0) | ProfilerFeature::Threads; - const char *NATIVE_STACK_THREADS[] = {"GeckoMain", "Compositor"}; + const char* NATIVE_STACK_THREADS[] = {"GeckoMain", "Compositor"}; // Buffer one sample and let the profiler wait a long time profiler_start(/* entries */ 100, /* interval */ 10000, features, NATIVE_STACK_THREADS, - sizeof(NATIVE_STACK_THREADS) / sizeof(char *)); + sizeof(NATIVE_STACK_THREADS) / sizeof(char*)); #endif return true; } diff --git a/widget/android/AndroidGraphicBuffer.h b/widget/android/AndroidGraphicBuffer.h index d005c676d45e3..0fe1584ded0d9 100644 --- a/widget/android/AndroidGraphicBuffer.h +++ b/widget/android/AndroidGraphicBuffer.h @@ -9,8 +9,8 @@ #include "gfxTypes.h" #include "nsRect.h" -typedef void *EGLImageKHR; -typedef void *EGLClientBuffer; +typedef void* EGLImageKHR; +typedef void* EGLClientBuffer; namespace mozilla { @@ -37,8 +37,8 @@ class AndroidGraphicBuffer { gfxImageFormat format); virtual ~AndroidGraphicBuffer(); - int Lock(uint32_t usage, unsigned char **bits); - int Lock(uint32_t usage, const nsIntRect &rect, unsigned char **bits); + int Lock(uint32_t usage, unsigned char** bits); + int Lock(uint32_t usage, const nsIntRect& rect, unsigned char** bits); int Unlock(); bool Reallocate(uint32_t aWidth, uint32_t aHeight, gfxImageFormat aFormat); @@ -64,8 +64,8 @@ class AndroidGraphicBuffer { uint32_t GetAndroidUsage(uint32_t aUsage); uint32_t GetAndroidFormat(gfxImageFormat aFormat); - void *mHandle; - void *mEGLImage; + void* mHandle; + void* mEGLImage; }; } // namespace mozilla diff --git a/widget/android/GfxInfo.h b/widget/android/GfxInfo.h index 2bc36b85303d2..827909212f891 100644 --- a/widget/android/GfxInfo.h +++ b/widget/android/GfxInfo.h @@ -27,28 +27,28 @@ class GfxInfo : public GfxInfoBase { // We only declare the subset of nsIGfxInfo that we actually implement. The // rest is brought forward from GfxInfoBase. - NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled) override; - NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled) override; - NS_IMETHOD GetDWriteVersion(nsAString &aDwriteVersion) override; - NS_IMETHOD GetCleartypeParameters(nsAString &aCleartypeParams) override; - NS_IMETHOD GetAdapterDescription(nsAString &aAdapterDescription) override; - NS_IMETHOD GetAdapterDriver(nsAString &aAdapterDriver) override; - NS_IMETHOD GetAdapterVendorID(nsAString &aAdapterVendorID) override; - NS_IMETHOD GetAdapterDeviceID(nsAString &aAdapterDeviceID) override; - NS_IMETHOD GetAdapterSubsysID(nsAString &aAdapterSubsysID) override; - NS_IMETHOD GetAdapterRAM(nsAString &aAdapterRAM) override; - NS_IMETHOD GetAdapterDriverVersion(nsAString &aAdapterDriverVersion) override; - NS_IMETHOD GetAdapterDriverDate(nsAString &aAdapterDriverDate) override; - NS_IMETHOD GetAdapterDescription2(nsAString &aAdapterDescription) override; - NS_IMETHOD GetAdapterDriver2(nsAString &aAdapterDriver) override; - NS_IMETHOD GetAdapterVendorID2(nsAString &aAdapterVendorID) override; - NS_IMETHOD GetAdapterDeviceID2(nsAString &aAdapterDeviceID) override; - NS_IMETHOD GetAdapterSubsysID2(nsAString &aAdapterSubsysID) override; - NS_IMETHOD GetAdapterRAM2(nsAString &aAdapterRAM) override; + NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override; + NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override; + NS_IMETHOD GetDWriteVersion(nsAString& aDwriteVersion) override; + NS_IMETHOD GetCleartypeParameters(nsAString& aCleartypeParams) override; + NS_IMETHOD GetAdapterDescription(nsAString& aAdapterDescription) override; + NS_IMETHOD GetAdapterDriver(nsAString& aAdapterDriver) override; + NS_IMETHOD GetAdapterVendorID(nsAString& aAdapterVendorID) override; + NS_IMETHOD GetAdapterDeviceID(nsAString& aAdapterDeviceID) override; + NS_IMETHOD GetAdapterSubsysID(nsAString& aAdapterSubsysID) override; + NS_IMETHOD GetAdapterRAM(nsAString& aAdapterRAM) override; + NS_IMETHOD GetAdapterDriverVersion(nsAString& aAdapterDriverVersion) override; + NS_IMETHOD GetAdapterDriverDate(nsAString& aAdapterDriverDate) override; + NS_IMETHOD GetAdapterDescription2(nsAString& aAdapterDescription) override; + NS_IMETHOD GetAdapterDriver2(nsAString& aAdapterDriver) override; + NS_IMETHOD GetAdapterVendorID2(nsAString& aAdapterVendorID) override; + NS_IMETHOD GetAdapterDeviceID2(nsAString& aAdapterDeviceID) override; + NS_IMETHOD GetAdapterSubsysID2(nsAString& aAdapterSubsysID) override; + NS_IMETHOD GetAdapterRAM2(nsAString& aAdapterRAM) override; NS_IMETHOD GetAdapterDriverVersion2( - nsAString &aAdapterDriverVersion) override; - NS_IMETHOD GetAdapterDriverDate2(nsAString &aAdapterDriverDate) override; - NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override; + nsAString& aAdapterDriverVersion) override; + NS_IMETHOD GetAdapterDriverDate2(nsAString& aAdapterDriverDate) override; + NS_IMETHOD GetIsGPU2Active(bool* aIsGPU2Active) override; using GfxInfoBase::GetFeatureStatus; using GfxInfoBase::GetFeatureSuggestedDriverVersion; @@ -68,10 +68,10 @@ class GfxInfo : public GfxInfoBase { protected: virtual nsresult GetFeatureStatusImpl( - int32_t aFeature, int32_t *aStatus, nsAString &aSuggestedDriverVersion, - const nsTArray &aDriverInfo, nsACString &aFailureId, - OperatingSystem *aOS = nullptr) override; - virtual const nsTArray &GetGfxDriverInfo() override; + int32_t aFeature, int32_t* aStatus, nsAString& aSuggestedDriverVersion, + const nsTArray& aDriverInfo, nsACString& aFailureId, + OperatingSystem* aOS = nullptr) override; + virtual const nsTArray& GetGfxDriverInfo() override; private: void AddCrashReportAnnotations(); diff --git a/widget/android/nsAndroidProtocolHandler.cpp b/widget/android/nsAndroidProtocolHandler.cpp index b98db4840bcd3..40f3728806732 100644 --- a/widget/android/nsAndroidProtocolHandler.cpp +++ b/widget/android/nsAndroidProtocolHandler.cpp @@ -44,30 +44,30 @@ NS_IMETHODIMP AndroidInputStream::Close(void) { return NS_OK; } -NS_IMETHODIMP AndroidInputStream::Available(uint64_t *_retval) { +NS_IMETHODIMP AndroidInputStream::Available(uint64_t* _retval) { *_retval = AndroidBridge::InputStreamAvailable(mBridgeInputStream); return NS_OK; } -NS_IMETHODIMP AndroidInputStream::Read(char *aBuf, uint32_t aCount, - uint32_t *_retval) { +NS_IMETHODIMP AndroidInputStream::Read(char* aBuf, uint32_t aCount, + uint32_t* _retval) { return AndroidBridge::InputStreamRead(mBridgeChannel, aBuf, aCount, _retval); } NS_IMETHODIMP AndroidInputStream::ReadSegments(nsWriteSegmentFun aWriter, - void *aClosure, uint32_t aCount, - uint32_t *_retval) { + void* aClosure, uint32_t aCount, + uint32_t* _retval) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP AndroidInputStream::IsNonBlocking(bool *_retval) { +NS_IMETHODIMP AndroidInputStream::IsNonBlocking(bool* _retval) { *_retval = false; return NS_OK; } class AndroidChannel : public nsBaseChannel { private: - AndroidChannel(nsIURI *aURI, jni::Object::Param aConnection) { + AndroidChannel(nsIURI* aURI, jni::Object::Param aConnection) { mConnection = aConnection; SetURI(aURI); @@ -78,7 +78,7 @@ class AndroidChannel : public nsBaseChannel { } public: - static AndroidChannel *CreateChannel(nsIURI *aURI) { + static AndroidChannel* CreateChannel(nsIURI* aURI) { nsCString spec; aURI->GetSpec(spec); @@ -88,8 +88,8 @@ class AndroidChannel : public nsBaseChannel { virtual ~AndroidChannel() {} - virtual nsresult OpenContentStream(bool async, nsIInputStream **result, - nsIChannel **channel) { + virtual nsresult OpenContentStream(bool async, nsIInputStream** result, + nsIChannel** channel) { nsCOMPtr stream = new AndroidInputStream(mConnection); NS_ADDREF(*result = stream); return NS_OK; @@ -103,35 +103,35 @@ NS_IMPL_ISUPPORTS(nsAndroidProtocolHandler, nsIProtocolHandler, nsISupportsWeakReference) NS_IMETHODIMP -nsAndroidProtocolHandler::GetScheme(nsACString &result) { +nsAndroidProtocolHandler::GetScheme(nsACString& result) { result.AssignLiteral("android"); return NS_OK; } NS_IMETHODIMP -nsAndroidProtocolHandler::GetDefaultPort(int32_t *result) { +nsAndroidProtocolHandler::GetDefaultPort(int32_t* result) { *result = -1; // no port for android: URLs return NS_OK; } NS_IMETHODIMP -nsAndroidProtocolHandler::AllowPort(int32_t port, const char *scheme, - bool *_retval) { +nsAndroidProtocolHandler::AllowPort(int32_t port, const char* scheme, + bool* _retval) { // don't override anything. *_retval = false; return NS_OK; } NS_IMETHODIMP -nsAndroidProtocolHandler::GetProtocolFlags(uint32_t *result) { +nsAndroidProtocolHandler::GetProtocolFlags(uint32_t* result) { *result = URI_STD | URI_IS_UI_RESOURCE | URI_IS_LOCAL_RESOURCE | URI_NORELATIVE | URI_DANGEROUS_TO_LOAD; return NS_OK; } NS_IMETHODIMP -nsAndroidProtocolHandler::NewURI(const nsACString &aSpec, const char *aCharset, - nsIURI *aBaseURI, nsIURI **result) { +nsAndroidProtocolHandler::NewURI(const nsACString& aSpec, const char* aCharset, + nsIURI* aBaseURI, nsIURI** result) { nsCOMPtr base(aBaseURI); return NS_MutateURI(NS_STANDARDURLMUTATOR_CONTRACTID) .Apply(NS_MutatorMethod(&nsIStandardURLMutator::Init, @@ -141,8 +141,8 @@ nsAndroidProtocolHandler::NewURI(const nsACString &aSpec, const char *aCharset, } NS_IMETHODIMP -nsAndroidProtocolHandler::NewChannel(nsIURI *aURI, nsILoadInfo *aLoadInfo, - nsIChannel **aResult) { +nsAndroidProtocolHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo, + nsIChannel** aResult) { nsCOMPtr channel = AndroidChannel::CreateChannel(aURI); if (!channel) return NS_ERROR_FAILURE; diff --git a/widget/android/nsClipboard.cpp b/widget/android/nsClipboard.cpp index 6811ce861aac8..a170e217bc488 100644 --- a/widget/android/nsClipboard.cpp +++ b/widget/android/nsClipboard.cpp @@ -22,7 +22,7 @@ NS_IMPL_ISUPPORTS(nsClipboard, nsIClipboard) nsClipboard::nsClipboard() {} NS_IMETHODIMP -nsClipboard::SetData(nsITransferable *aTransferable, nsIClipboardOwner *anOwner, +nsClipboard::SetData(nsITransferable* aTransferable, nsIClipboardOwner* anOwner, int32_t aWhichClipboard) { if (aWhichClipboard != kGlobalClipboard) return NS_ERROR_NOT_IMPLEMENTED; @@ -36,7 +36,7 @@ nsClipboard::SetData(nsITransferable *aTransferable, nsIClipboardOwner *anOwner, nsAutoString html; nsAutoString text; - for (auto &flavorStr : flavors) { + for (auto& flavorStr : flavors) { if (flavorStr.EqualsLiteral(kUnicodeMime)) { nsCOMPtr item; nsresult rv = @@ -76,7 +76,7 @@ nsClipboard::SetData(nsITransferable *aTransferable, nsIClipboardOwner *anOwner, } NS_IMETHODIMP -nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) { +nsClipboard::GetData(nsITransferable* aTransferable, int32_t aWhichClipboard) { if (aWhichClipboard != kGlobalClipboard) return NS_ERROR_NOT_IMPLEMENTED; if (!jni::IsAvailable()) { @@ -86,7 +86,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) { nsTArray flavors; aTransferable->FlavorsTransferableCanImport(flavors); - for (auto &flavorStr : flavors) { + for (auto& flavorStr : flavors) { if (flavorStr.EqualsLiteral(kUnicodeMime) || flavorStr.EqualsLiteral(kHTMLMime)) { auto text = @@ -126,8 +126,8 @@ nsClipboard::EmptyClipboard(int32_t aWhichClipboard) { } NS_IMETHODIMP -nsClipboard::HasDataMatchingFlavors(const char **aFlavorList, uint32_t aLength, - int32_t aWhichClipboard, bool *aHasText) { +nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength, + int32_t aWhichClipboard, bool* aHasText) { *aHasText = false; if (aWhichClipboard != kGlobalClipboard) return NS_ERROR_NOT_IMPLEMENTED; @@ -149,13 +149,13 @@ nsClipboard::HasDataMatchingFlavors(const char **aFlavorList, uint32_t aLength, } NS_IMETHODIMP -nsClipboard::SupportsSelectionClipboard(bool *aIsSupported) { +nsClipboard::SupportsSelectionClipboard(bool* aIsSupported) { *aIsSupported = false; return NS_OK; } NS_IMETHODIMP -nsClipboard::SupportsFindClipboard(bool *_retval) { +nsClipboard::SupportsFindClipboard(bool* _retval) { *_retval = false; return NS_OK; } diff --git a/widget/android/nsIdleServiceAndroid.cpp b/widget/android/nsIdleServiceAndroid.cpp index 84646589f681c..bc5d0884e9f63 100644 --- a/widget/android/nsIdleServiceAndroid.cpp +++ b/widget/android/nsIdleServiceAndroid.cpp @@ -8,6 +8,6 @@ #include "nsIdleServiceAndroid.h" #include "nsIServiceManager.h" -bool nsIdleServiceAndroid::PollIdleTime(uint32_t *aIdleTime) { return false; } +bool nsIdleServiceAndroid::PollIdleTime(uint32_t* aIdleTime) { return false; } bool nsIdleServiceAndroid::UsePollMode() { return false; } diff --git a/widget/android/nsWidgetFactory.h b/widget/android/nsWidgetFactory.h index 229f25a74f104..57b96c1b3b41c 100644 --- a/widget/android/nsWidgetFactory.h +++ b/widget/android/nsWidgetFactory.h @@ -13,8 +13,8 @@ class nsISupports; -nsresult nsAppShellConstructor(nsISupports *outer, const nsIID &iid, - void **result); +nsresult nsAppShellConstructor(nsISupports* outer, const nsIID& iid, + void** result); nsresult nsWidgetAndroidModuleCtor(); void nsWidgetAndroidModuleDtor(); diff --git a/widget/cocoa/GfxInfo.h b/widget/cocoa/GfxInfo.h index 797363333fa50..6caeb3dee4d3d 100644 --- a/widget/cocoa/GfxInfo.h +++ b/widget/cocoa/GfxInfo.h @@ -20,28 +20,28 @@ class GfxInfo : public GfxInfoBase { GfxInfo(); // We only declare the subset of nsIGfxInfo that we actually implement. The // rest is brought forward from GfxInfoBase. - NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled) override; - NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled) override; - NS_IMETHOD GetDWriteVersion(nsAString &aDwriteVersion) override; - NS_IMETHOD GetCleartypeParameters(nsAString &aCleartypeParams) override; - NS_IMETHOD GetAdapterDescription(nsAString &aAdapterDescription) override; - NS_IMETHOD GetAdapterDriver(nsAString &aAdapterDriver) override; - NS_IMETHOD GetAdapterVendorID(nsAString &aAdapterVendorID) override; - NS_IMETHOD GetAdapterDeviceID(nsAString &aAdapterDeviceID) override; - NS_IMETHOD GetAdapterSubsysID(nsAString &aAdapterSubsysID) override; - NS_IMETHOD GetAdapterRAM(nsAString &aAdapterRAM) override; - NS_IMETHOD GetAdapterDriverVersion(nsAString &aAdapterDriverVersion) override; - NS_IMETHOD GetAdapterDriverDate(nsAString &aAdapterDriverDate) override; - NS_IMETHOD GetAdapterDescription2(nsAString &aAdapterDescription) override; - NS_IMETHOD GetAdapterDriver2(nsAString &aAdapterDriver) override; - NS_IMETHOD GetAdapterVendorID2(nsAString &aAdapterVendorID) override; - NS_IMETHOD GetAdapterDeviceID2(nsAString &aAdapterDeviceID) override; - NS_IMETHOD GetAdapterSubsysID2(nsAString &aAdapterSubsysID) override; - NS_IMETHOD GetAdapterRAM2(nsAString &aAdapterRAM) override; + NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override; + NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override; + NS_IMETHOD GetDWriteVersion(nsAString& aDwriteVersion) override; + NS_IMETHOD GetCleartypeParameters(nsAString& aCleartypeParams) override; + NS_IMETHOD GetAdapterDescription(nsAString& aAdapterDescription) override; + NS_IMETHOD GetAdapterDriver(nsAString& aAdapterDriver) override; + NS_IMETHOD GetAdapterVendorID(nsAString& aAdapterVendorID) override; + NS_IMETHOD GetAdapterDeviceID(nsAString& aAdapterDeviceID) override; + NS_IMETHOD GetAdapterSubsysID(nsAString& aAdapterSubsysID) override; + NS_IMETHOD GetAdapterRAM(nsAString& aAdapterRAM) override; + NS_IMETHOD GetAdapterDriverVersion(nsAString& aAdapterDriverVersion) override; + NS_IMETHOD GetAdapterDriverDate(nsAString& aAdapterDriverDate) override; + NS_IMETHOD GetAdapterDescription2(nsAString& aAdapterDescription) override; + NS_IMETHOD GetAdapterDriver2(nsAString& aAdapterDriver) override; + NS_IMETHOD GetAdapterVendorID2(nsAString& aAdapterVendorID) override; + NS_IMETHOD GetAdapterDeviceID2(nsAString& aAdapterDeviceID) override; + NS_IMETHOD GetAdapterSubsysID2(nsAString& aAdapterSubsysID) override; + NS_IMETHOD GetAdapterRAM2(nsAString& aAdapterRAM) override; NS_IMETHOD GetAdapterDriverVersion2( - nsAString &aAdapterDriverVersion) override; - NS_IMETHOD GetAdapterDriverDate2(nsAString &aAdapterDriverDate) override; - NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override; + nsAString& aAdapterDriverVersion) override; + NS_IMETHOD GetAdapterDriverDate2(nsAString& aAdapterDriverDate) override; + NS_IMETHOD GetIsGPU2Active(bool* aIsGPU2Active) override; using GfxInfoBase::GetFeatureStatus; using GfxInfoBase::GetFeatureSuggestedDriverVersion; @@ -55,16 +55,16 @@ class GfxInfo : public GfxInfoBase { virtual uint32_t OperatingSystemVersion() override { return mOSXVersion; } - nsresult FindMonitors(JSContext *cx, JS::HandleObject array) override; + nsresult FindMonitors(JSContext* cx, JS::HandleObject array) override; protected: virtual ~GfxInfo() {} virtual nsresult GetFeatureStatusImpl( - int32_t aFeature, int32_t *aStatus, nsAString &aSuggestedDriverVersion, - const nsTArray &aDriverInfo, nsACString &aFailureId, - OperatingSystem *aOS = nullptr) override; - virtual const nsTArray &GetGfxDriverInfo() override; + int32_t aFeature, int32_t* aStatus, nsAString& aSuggestedDriverVersion, + const nsTArray& aDriverInfo, nsACString& aFailureId, + OperatingSystem* aOS = nullptr) override; + virtual const nsTArray& GetGfxDriverInfo() override; private: void GetDeviceInfo(); diff --git a/widget/cocoa/OSXNotificationCenter.h b/widget/cocoa/OSXNotificationCenter.h index 8484a2afde45c..354ece2bae38c 100644 --- a/widget/cocoa/OSXNotificationCenter.h +++ b/widget/cocoa/OSXNotificationCenter.h @@ -40,16 +40,16 @@ class OSXNotificationCenter : public nsIAlertsService, OSXNotificationCenter(); nsresult Init(); - void CloseAlertCocoaString(NSString *aAlertName); - void OnActivate(NSString *aAlertName, NSUserNotificationActivationType aActivationType, + void CloseAlertCocoaString(NSString* aAlertName); + void OnActivate(NSString* aAlertName, NSUserNotificationActivationType aActivationType, unsigned long long aAdditionalActionIndex); - void ShowPendingNotification(OSXNotificationInfo *osxni); + void ShowPendingNotification(OSXNotificationInfo* osxni); protected: virtual ~OSXNotificationCenter(); private: - mozNotificationCenterDelegate *mDelegate; + mozNotificationCenterDelegate* mDelegate; nsTArray > mActiveAlerts; nsTArray > mPendingAlerts; }; diff --git a/widget/cocoa/OSXNotificationCenter.mm b/widget/cocoa/OSXNotificationCenter.mm index 6212545f3e258..1a9d80be69e18 100644 --- a/widget/cocoa/OSXNotificationCenter.mm +++ b/widget/cocoa/OSXNotificationCenter.mm @@ -25,7 +25,7 @@ #if !defined(MAC_OS_X_VERSION_10_8) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8) @protocol NSUserNotificationCenterDelegate @end -static NSString *const NSUserNotificationDefaultSoundName = @"DefaultSoundName"; +static NSString* const NSUserNotificationDefaultSoundName = @"DefaultSoundName"; enum { NSUserNotificationActivationTypeNone = 0, NSUserNotificationActivationTypeContentsClicked = 1, @@ -44,31 +44,31 @@ @protocol NSUserNotificationCenterDelegate #endif @protocol FakeNSUserNotification -@property(copy) NSString *title; -@property(copy) NSString *subtitle; -@property(copy) NSString *informativeText; -@property(copy) NSString *actionButtonTitle; -@property(copy) NSDictionary *userInfo; -@property(copy) NSDate *deliveryDate; -@property(copy) NSTimeZone *deliveryTimeZone; -@property(copy) NSDateComponents *deliveryRepeatInterval; -@property(readonly) NSDate *actualDeliveryDate; +@property(copy) NSString* title; +@property(copy) NSString* subtitle; +@property(copy) NSString* informativeText; +@property(copy) NSString* actionButtonTitle; +@property(copy) NSDictionary* userInfo; +@property(copy) NSDate* deliveryDate; +@property(copy) NSTimeZone* deliveryTimeZone; +@property(copy) NSDateComponents* deliveryRepeatInterval; +@property(readonly) NSDate* actualDeliveryDate; @property(readonly, getter=isPresented) BOOL presented; @property(readonly, getter=isRemote) BOOL remote; -@property(copy) NSString *soundName; +@property(copy) NSString* soundName; @property BOOL hasActionButton; @property(readonly) NSUserNotificationActivationType activationType; -@property(copy) NSString *otherButtonTitle; -@property(copy) NSImage *contentImage; +@property(copy) NSString* otherButtonTitle; +@property(copy) NSImage* contentImage; @end @protocol FakeNSUserNotificationCenter + (id)defaultUserNotificationCenter; @property(assign) id delegate; -@property(copy) NSArray *scheduledNotifications; +@property(copy) NSArray* scheduledNotifications; - (void)scheduleNotification:(id)notification; - (void)removeScheduledNotification:(id)notification; -@property(readonly) NSArray *deliveredNotifications; +@property(readonly) NSArray* deliveredNotifications; - (void)deliverNotification:(id)notification; - (void)removeDeliveredNotification:(id)notification; - (void)removeAllDeliveredNotifications; @@ -77,14 +77,14 @@ - (void)_removeDisplayedNotification:(id)notification; @end @interface mozNotificationCenterDelegate : NSObject { - OSXNotificationCenter *mOSXNC; + OSXNotificationCenter* mOSXNC; } -- (id)initWithOSXNC:(OSXNotificationCenter *)osxnc; +- (id)initWithOSXNC:(OSXNotificationCenter*)osxnc; @end @implementation mozNotificationCenterDelegate -- (id)initWithOSXNC:(OSXNotificationCenter *)osxnc { +- (id)initWithOSXNC:(OSXNotificationCenter*)osxnc { [super init]; // We should *never* outlive this OSXNotificationCenter. mOSXNC = osxnc; @@ -99,8 +99,7 @@ - (void)userNotificationCenter:(id)center didActivateNotification:(id)notification { unsigned long long additionalActionIndex = ULLONG_MAX; if ([notification respondsToSelector:@selector(_alternateActionIndex)]) { - NSNumber *alternateActionIndex = - [(NSObject *)notification valueForKey:@"_alternateActionIndex"]; + NSNumber* alternateActionIndex = [(NSObject*)notification valueForKey:@"_alternateActionIndex"]; additionalActionIndex = [alternateActionIndex unsignedLongLongValue]; } mOSXNC->OnActivate([[notification userInfo] valueForKey:@"name"], notification.activationType, @@ -115,9 +114,9 @@ - (BOOL)userNotificationCenter:(id)center // This is an undocumented method that we need for parity with Safari. // Apple bug #15440664. - (void)userNotificationCenter:(id)center - didRemoveDeliveredNotifications:(NSArray *)notifications { + didRemoveDeliveredNotifications:(NSArray*)notifications { for (id notification in notifications) { - NSString *name = [[notification userInfo] valueForKey:@"name"]; + NSString* name = [[notification userInfo] valueForKey:@"name"]; mOSXNC->CloseAlertCocoaString(name); } } @@ -125,7 +124,7 @@ - (void)userNotificationCenter:(id)center // This is an undocumented method that we need to be notified if a user clicks the close button. - (void)userNotificationCenter:(id)center didDismissAlert:(id)notification { - NSString *name = [[notification userInfo] valueForKey:@"name"]; + NSString* name = [[notification userInfo] valueForKey:@"name"]; mOSXNC->CloseAlertCocoaString(name); } @@ -144,9 +143,9 @@ - (void)userNotificationCenter:(id)center public: NS_DECL_ISUPPORTS - OSXNotificationInfo(NSString *name, nsIObserver *observer, const nsAString &alertCookie); + OSXNotificationInfo(NSString* name, nsIObserver* observer, const nsAString& alertCookie); - NSString *mName; + NSString* mName; nsCOMPtr mObserver; nsString mCookie; RefPtr mIconRequest; @@ -155,8 +154,8 @@ - (void)userNotificationCenter:(id)center NS_IMPL_ISUPPORTS0(OSXNotificationInfo) -OSXNotificationInfo::OSXNotificationInfo(NSString *name, nsIObserver *observer, - const nsAString &alertCookie) { +OSXNotificationInfo::OSXNotificationInfo(NSString* name, nsIObserver* observer, + const nsAString& alertCookie) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; NS_ASSERTION(name, "Cannot create OSXNotificationInfo without a name!"); @@ -217,10 +216,10 @@ - (void)userNotificationCenter:(id)center NS_IMETHODIMP OSXNotificationCenter::ShowAlertNotification( - const nsAString &aImageUrl, const nsAString &aAlertTitle, const nsAString &aAlertText, - bool aAlertTextClickable, const nsAString &aAlertCookie, nsIObserver *aAlertListener, - const nsAString &aAlertName, const nsAString &aBidi, const nsAString &aLang, - const nsAString &aData, nsIPrincipal *aPrincipal, bool aInPrivateBrowsing, + const nsAString& aImageUrl, const nsAString& aAlertTitle, const nsAString& aAlertText, + bool aAlertTextClickable, const nsAString& aAlertCookie, nsIObserver* aAlertListener, + const nsAString& aAlertName, const nsAString& aBidi, const nsAString& aLang, + const nsAString& aData, nsIPrincipal* aPrincipal, bool aInPrivateBrowsing, bool aRequireInteraction) { nsCOMPtr alert = do_CreateInstance(ALERT_NOTIFICATION_CONTRACTID); NS_ENSURE_TRUE(alert, NS_ERROR_FAILURE); @@ -232,21 +231,21 @@ - (void)userNotificationCenter:(id)center } NS_IMETHODIMP -OSXNotificationCenter::ShowPersistentNotification(const nsAString &aPersistentData, - nsIAlertNotification *aAlert, - nsIObserver *aAlertListener) { +OSXNotificationCenter::ShowPersistentNotification(const nsAString& aPersistentData, + nsIAlertNotification* aAlert, + nsIObserver* aAlertListener) { return ShowAlert(aAlert, aAlertListener); } NS_IMETHODIMP -OSXNotificationCenter::ShowAlert(nsIAlertNotification *aAlert, nsIObserver *aAlertListener) { +OSXNotificationCenter::ShowAlert(nsIAlertNotification* aAlert, nsIObserver* aAlertListener) { return ShowAlertWithIconData(aAlert, aAlertListener, 0, nullptr); } NS_IMETHODIMP -OSXNotificationCenter::ShowAlertWithIconData(nsIAlertNotification *aAlert, - nsIObserver *aAlertListener, uint32_t aIconSize, - const uint8_t *aIconData) { +OSXNotificationCenter::ShowAlertWithIconData(nsIAlertNotification* aAlert, + nsIObserver* aAlertListener, uint32_t aIconSize, + const uint8_t* aIconData) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; NS_ENSURE_ARG(aAlert); @@ -267,7 +266,7 @@ - (void)userNotificationCenter:(id)center sbs->CreateBundle("chrome://alerts/locale/alert.properties", getter_AddRefs(bundle)); if (!hostPort.IsEmpty() && bundle) { - const char16_t *formatStrings[] = {hostPort.get()}; + const char16_t* formatStrings[] = {hostPort.get()}; nsAutoString notificationSource; bundle->FormatStringFromName("source.label", formatStrings, ArrayLength(formatStrings), notificationSource); @@ -290,7 +289,7 @@ - (void)userNotificationCenter:(id)center bundle->GetStringFromName("closeButton.title", closeButtonTitle); bundle->GetStringFromName("actionButton.label", actionButtonTitle); if (!hostPort.IsEmpty()) { - const char16_t *formatStrings[] = {hostPort.get()}; + const char16_t* formatStrings[] = {hostPort.get()}; bundle->FormatStringFromName("webActions.disableForOrigin.label", formatStrings, ArrayLength(formatStrings), disableButtonTitle); } @@ -307,12 +306,12 @@ - (void)userNotificationCenter:(id)center notification.hasActionButton = YES; notification.actionButtonTitle = nsCocoaUtils::ToNSString(actionButtonTitle); - [(NSObject *)notification setValue:@(YES) forKey:@"_showsButtons"]; - [(NSObject *)notification setValue:@(YES) forKey:@"_alwaysShowAlternateActionMenu"]; - [(NSObject *)notification setValue:@[ + [(NSObject*)notification setValue:@(YES) forKey:@"_showsButtons"]; + [(NSObject*)notification setValue:@(YES) forKey:@"_alwaysShowAlternateActionMenu"]; + [(NSObject*)notification setValue:@[ nsCocoaUtils::ToNSString(disableButtonTitle), nsCocoaUtils::ToNSString(settingsButtonTitle) ] - forKey:@"_alternateActionButtonTitles"]; + forKey:@"_alternateActionButtonTitles"]; } } nsAutoString name; @@ -325,7 +324,7 @@ - (void)userNotificationCenter:(id)center } NS_ENSURE_SUCCESS(rv, rv); - NSString *alertName = nsCocoaUtils::ToNSString(name); + NSString* alertName = nsCocoaUtils::ToNSString(name); if (!alertName) { return NS_ERROR_FAILURE; } @@ -337,16 +336,16 @@ - (void)userNotificationCenter:(id)center rv = aAlert->GetCookie(cookie); NS_ENSURE_SUCCESS(rv, rv); - OSXNotificationInfo *osxni = new OSXNotificationInfo(alertName, aAlertListener, cookie); + OSXNotificationInfo* osxni = new OSXNotificationInfo(alertName, aAlertListener, cookie); // Show the favicon if supported on this version of OS X. if (aIconSize > 0 && [notification respondsToSelector:@selector(set_identityImage:)] && [notification respondsToSelector:@selector(set_identityImageHasBorder:)]) { - NSData *iconData = [NSData dataWithBytes:aIconData length:aIconSize]; - NSImage *icon = [[[NSImage alloc] initWithData:iconData] autorelease]; + NSData* iconData = [NSData dataWithBytes:aIconData length:aIconSize]; + NSImage* icon = [[[NSImage alloc] initWithData:iconData] autorelease]; - [(NSObject *)notification setValue:icon forKey:@"_identityImage"]; - [(NSObject *)notification setValue:@(NO) forKey:@"_identityImageHasBorder"]; + [(NSObject*)notification setValue:icon forKey:@"_identityImage"]; + [(NSObject*)notification setValue:@(NO) forKey:@"_identityImageHasBorder"]; } bool inPrivateBrowsing; @@ -379,26 +378,26 @@ - (void)userNotificationCenter:(id)center } NS_IMETHODIMP -OSXNotificationCenter::CloseAlert(const nsAString &aAlertName, nsIPrincipal *aPrincipal) { +OSXNotificationCenter::CloseAlert(const nsAString& aAlertName, nsIPrincipal* aPrincipal) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - NSString *alertName = nsCocoaUtils::ToNSString(aAlertName); + NSString* alertName = nsCocoaUtils::ToNSString(aAlertName); CloseAlertCocoaString(alertName); return NS_OK; NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } -void OSXNotificationCenter::CloseAlertCocoaString(NSString *aAlertName) { +void OSXNotificationCenter::CloseAlertCocoaString(NSString* aAlertName) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; if (!aAlertName) { return; // Can't do anything without a name } - NSArray *notifications = [GetNotificationCenter() deliveredNotifications]; + NSArray* notifications = [GetNotificationCenter() deliveredNotifications]; for (id notification in notifications) { - NSString *name = [[notification userInfo] valueForKey:@"name"]; + NSString* name = [[notification userInfo] valueForKey:@"name"]; if ([name isEqualToString:aAlertName]) { [GetNotificationCenter() removeDeliveredNotification:notification]; [GetNotificationCenter() _removeDisplayedNotification:notification]; @@ -407,7 +406,7 @@ - (void)userNotificationCenter:(id)center } for (unsigned int i = 0; i < mActiveAlerts.Length(); i++) { - OSXNotificationInfo *osxni = mActiveAlerts[i]; + OSXNotificationInfo* osxni = mActiveAlerts[i]; if ([aAlertName isEqualToString:osxni->mName]) { if (osxni->mObserver) { osxni->mObserver->Observe(nullptr, "alertfinished", osxni->mCookie.get()); @@ -424,7 +423,7 @@ - (void)userNotificationCenter:(id)center NS_OBJC_END_TRY_ABORT_BLOCK; } -void OSXNotificationCenter::OnActivate(NSString *aAlertName, +void OSXNotificationCenter::OnActivate(NSString* aAlertName, NSUserNotificationActivationType aActivationType, unsigned long long aAdditionalActionIndex) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -434,7 +433,7 @@ - (void)userNotificationCenter:(id)center } for (unsigned int i = 0; i < mActiveAlerts.Length(); i++) { - OSXNotificationInfo *osxni = mActiveAlerts[i]; + OSXNotificationInfo* osxni = mActiveAlerts[i]; if ([aAlertName isEqualToString:osxni->mName]) { if (osxni->mObserver) { switch ((int)aActivationType) { @@ -464,7 +463,7 @@ - (void)userNotificationCenter:(id)center NS_OBJC_END_TRY_ABORT_BLOCK; } -void OSXNotificationCenter::ShowPendingNotification(OSXNotificationInfo *osxni) { +void OSXNotificationCenter::ShowPendingNotification(OSXNotificationInfo* osxni) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; if (osxni->mIconRequest) { @@ -495,10 +494,10 @@ - (void)userNotificationCenter:(id)center } NS_IMETHODIMP -OSXNotificationCenter::OnImageMissing(nsISupports *aUserData) { +OSXNotificationCenter::OnImageMissing(nsISupports* aUserData) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - OSXNotificationInfo *osxni = static_cast(aUserData); + OSXNotificationInfo* osxni = static_cast(aUserData); if (osxni->mPendingNotification) { // If there was an error getting the image, or the request timed out, show // the notification without a content image. @@ -510,7 +509,7 @@ - (void)userNotificationCenter:(id)center } NS_IMETHODIMP -OSXNotificationCenter::OnImageReady(nsISupports *aUserData, imgIRequest *aRequest) { +OSXNotificationCenter::OnImageReady(nsISupports* aUserData, imgIRequest* aRequest) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; nsCOMPtr image; @@ -519,12 +518,12 @@ - (void)userNotificationCenter:(id)center return rv; } - OSXNotificationInfo *osxni = static_cast(aUserData); + OSXNotificationInfo* osxni = static_cast(aUserData); if (!osxni->mPendingNotification) { return NS_ERROR_FAILURE; } - NSImage *cocoaImage = nil; + NSImage* cocoaImage = nil; nsCocoaUtils::CreateNSImageFromImageContainer(image, imgIContainer::FRAME_FIRST, &cocoaImage, 1.0f); (osxni->mPendingNotification).contentImage = cocoaImage; diff --git a/widget/cocoa/nsCocoaFeatures.h b/widget/cocoa/nsCocoaFeatures.h index 7e69d349643b0..a4581c4d31959 100644 --- a/widget/cocoa/nsCocoaFeatures.h +++ b/widget/cocoa/nsCocoaFeatures.h @@ -33,7 +33,7 @@ class nsCocoaFeatures { // GetVersion actually adjusts to the lowest supported OS, so it will always // return a "supported" version. GetSystemVersion does not make any // modifications. - static void GetSystemVersion(int &aMajor, int &aMinor, int &aBugFix); + static void GetSystemVersion(int& aMajor, int& aMinor, int& aBugFix); static int32_t GetVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix); static int32_t ExtractMajorVersion(int32_t aVersion); static int32_t ExtractMinorVersion(int32_t aVersion); diff --git a/widget/cocoa/nsCocoaFeatures.mm b/widget/cocoa/nsCocoaFeatures.mm index 6edc31d640034..77bd3507e35f3 100644 --- a/widget/cocoa/nsCocoaFeatures.mm +++ b/widget/cocoa/nsCocoaFeatures.mm @@ -52,17 +52,17 @@ inline int32_t AssembleVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix) return aVersion & 0x0F; } -static int intAtStringIndex(NSArray *array, int index) { - return [(NSString *)[array objectAtIndex:index] integerValue]; +static int intAtStringIndex(NSArray* array, int index) { + return [(NSString*)[array objectAtIndex:index] integerValue]; } -void nsCocoaFeatures::GetSystemVersion(int &major, int &minor, int &bugfix) { +void nsCocoaFeatures::GetSystemVersion(int& major, int& minor, int& bugfix) { major = minor = bugfix = 0; - NSString *versionString = [[NSDictionary + NSString* versionString = [[NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"] objectForKey:@"ProductVersion"]; - NSArray *versions = [versionString componentsSeparatedByString:@"."]; + NSArray* versions = [versionString componentsSeparatedByString:@"."]; NSUInteger count = [versions count]; if (count > 0) { major = intAtStringIndex(versions, 0); diff --git a/widget/cocoa/nsCursorManager.h b/widget/cocoa/nsCursorManager.h index f8e4d2be22e66..a444951fb1e47 100644 --- a/widget/cocoa/nsCursorManager.h +++ b/widget/cocoa/nsCursorManager.h @@ -19,8 +19,8 @@ */ @interface nsCursorManager : NSObject { @private - NSMutableDictionary *mCursors; - nsMacCursor *mCurrentMacCursor; + NSMutableDictionary* mCursors; + nsMacCursor* mCurrentMacCursor; } /*! @method setCursor: @@ -40,7 +40,7 @@ @param aHotSpotY the y coordinate of the cursor's hotspot @param scaleFactor the scale factor of the target display (2 for a retina display) */ -- (nsresult)setCursorWithImage:(imgIContainer *)aCursorImage +- (nsresult)setCursorWithImage:(imgIContainer*)aCursorImage hotSpotX:(uint32_t)aHotspotX hotSpotY:(uint32_t)aHotspotY scaleFactor:(CGFloat)scaleFactor; @@ -50,7 +50,7 @@ @discussion Use this method to obtain a reference to the cursor manager. @result a reference to the cursor manager */ -+ (nsCursorManager *)sharedInstance; ++ (nsCursorManager*)sharedInstance; /*! @method dispose @abstract Releases the shared instance of the cursor manager. @@ -62,7 +62,7 @@ @interface NSCursor (Undocumented) // busyButClickableCursor is an undocumented NSCursor API, but has been in use since // at least OS X 10.4 and through 10.9. -+ (NSCursor *)busyButClickableCursor; ++ (NSCursor*)busyButClickableCursor; @end #endif // nsCursorManager_h_ diff --git a/widget/cocoa/nsCursorManager.mm b/widget/cocoa/nsCursorManager.mm index 059a8a54bc13f..e27641160dd62 100644 --- a/widget/cocoa/nsCursorManager.mm +++ b/widget/cocoa/nsCursorManager.mm @@ -8,9 +8,9 @@ #include "nsObjCExceptions.h" #include -static nsCursorManager *gInstance; +static nsCursorManager* gInstance; static CGFloat sCursorScaleFactor = 0.0f; -static imgIContainer *sCursorImgContainer = nullptr; +static imgIContainer* sCursorImgContainer = nullptr; static const nsCursor sCustomCursor = eCursorCount; /*! @category nsCursorManager(PrivateMethods) @@ -25,7 +25,7 @@ @interface nsCursorManager (PrivateMethods) @param aCursor the cursor to get @result the Mac native implementation of the cursor */ -- (nsMacCursor *)getCursor:(nsCursor)aCursor; +- (nsMacCursor*)getCursor:(nsCursor)aCursor; /*! @method setMacCursor: @abstract Set the current Mac native cursor @@ -34,7 +34,7 @@ - (nsMacCursor *)getCursor:(nsCursor)aCursor; @param aMacCursor the cursor to set @result NS_OK */ -- (nsresult)setMacCursor:(nsMacCursor *)aMacCursor; +- (nsresult)setMacCursor:(nsMacCursor*)aMacCursor; /*! @method createCursor: @abstract Create a Mac native representation of a cursor. @@ -42,13 +42,13 @@ - (nsresult)setMacCursor:(nsMacCursor *)aMacCursor; @param aCursor the cursor to create @result the Mac native implementation of the cursor */ -+ (nsMacCursor *)createCursor:(enum nsCursor)aCursor; ++ (nsMacCursor*)createCursor:(enum nsCursor)aCursor; @end @implementation nsCursorManager -+ (nsCursorManager *)sharedInstance { ++ (nsCursorManager*)sharedInstance { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; if (!gInstance) { @@ -68,7 +68,7 @@ + (void)dispose { NS_OBJC_END_TRY_ABORT_BLOCK; } -+ (nsMacCursor *)createCursor:(enum nsCursor)aCursor { ++ (nsMacCursor*)createCursor:(enum nsCursor)aCursor { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; switch (aCursor) { @@ -212,7 +212,7 @@ - (nsresult)setCursor:(enum nsCursor)aCursor { NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } -- (nsresult)setMacCursor:(nsMacCursor *)aMacCursor { +- (nsresult)setMacCursor:(nsMacCursor*)aMacCursor { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; // Some plugins mess with our cursors and set a cursor that even @@ -243,7 +243,7 @@ - (nsresult)setMacCursor:(nsMacCursor *)aMacCursor { NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } -- (nsresult)setCursorWithImage:(imgIContainer *)aCursorImage +- (nsresult)setCursorWithImage:(imgIContainer*)aCursorImage hotSpotX:(uint32_t)aHotspotX hotSpotY:(uint32_t)aHotspotY scaleFactor:(CGFloat)scaleFactor { @@ -263,7 +263,7 @@ - (nsresult)setCursorWithImage:(imgIContainer *)aCursorImage return NS_OK; } - NSImage *cursorImage; + NSImage* cursorImage; nsresult rv = nsCocoaUtils::CreateNSImageFromImageContainer( aCursorImage, imgIContainer::FRAME_FIRST, &cursorImage, scaleFactor); if (NS_FAILED(rv) || !cursorImage) { @@ -290,10 +290,10 @@ - (nsresult)setCursorWithImage:(imgIContainer *)aCursorImage NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } -- (nsMacCursor *)getCursor:(enum nsCursor)aCursor { +- (nsMacCursor*)getCursor:(enum nsCursor)aCursor { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; - nsMacCursor *result = [mCursors objectForKey:[NSNumber numberWithInt:aCursor]]; + nsMacCursor* result = [mCursors objectForKey:[NSNumber numberWithInt:aCursor]]; if (!result) { result = [nsCursorManager createCursor:aCursor]; [mCursors setObject:result forKey:[NSNumber numberWithInt:aCursor]]; diff --git a/widget/cocoa/nsIdleServiceX.mm b/widget/cocoa/nsIdleServiceX.mm index c5177c36bf34b..701e3a314b239 100644 --- a/widget/cocoa/nsIdleServiceX.mm +++ b/widget/cocoa/nsIdleServiceX.mm @@ -7,7 +7,7 @@ #include "nsIServiceManager.h" #import -bool nsIdleServiceX::PollIdleTime(uint32_t *aIdleTime) { +bool nsIdleServiceX::PollIdleTime(uint32_t* aIdleTime) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; kern_return_t rval; @@ -27,8 +27,8 @@ IOObjectRelease(hidItr); - NSMutableDictionary *hidProps; - rval = IORegistryEntryCreateCFProperties(entry, (CFMutableDictionaryRef *)&hidProps, + NSMutableDictionary* hidProps; + rval = IORegistryEntryCreateCFProperties(entry, (CFMutableDictionaryRef*)&hidProps, kCFAllocatorDefault, 0); if (rval != KERN_SUCCESS) return false; NS_ASSERTION(hidProps, "HIDProperties is null, but no error was returned."); diff --git a/widget/cocoa/nsMacCursor.h b/widget/cocoa/nsMacCursor.h index 417750c136337..fc97728da54d9 100644 --- a/widget/cocoa/nsMacCursor.h +++ b/widget/cocoa/nsMacCursor.h @@ -18,7 +18,7 @@ */ @interface nsMacCursor : NSObject { @private - NSTimer *mTimer; + NSTimer* mTimer; @protected nsCursor mType; int mFrameCounter; @@ -32,7 +32,7 @@ @result an autoreleased instance of nsMacCursor representing the given NSCursor */ -+ (nsMacCursor *)cursorWithCursor:(NSCursor *)aCursor type:(nsCursor)aType; ++ (nsMacCursor*)cursorWithCursor:(NSCursor*)aCursor type:(nsCursor)aType; /*! @method cursorWithImageNamed:hotSpot:type: @abstract Create a cursor by specifying the name of an image resource to @@ -50,9 +50,9 @@ @result an autoreleased instance of nsMacCursor that uses the given image and hotspot */ -+ (nsMacCursor *)cursorWithImageNamed:(NSString *)aCursorImage - hotSpot:(NSPoint)aPoint - type:(nsCursor)aType; ++ (nsMacCursor*)cursorWithImageNamed:(NSString*)aCursorImage + hotSpot:(NSPoint)aPoint + type:(nsCursor)aType; /*! @method cursorWithFrames:type: @abstract Create an animated cursor by specifying the frames to use for @@ -67,7 +67,7 @@ @result an autoreleased instance of nsMacCursor that will animate the given cursor frames */ -+ (nsMacCursor *)cursorWithFrames:(NSArray *)aCursorFrames type:(nsCursor)aType; ++ (nsMacCursor*)cursorWithFrames:(NSArray*)aCursorFrames type:(nsCursor)aType; /*! @method cocoaCursorWithImageNamed:hotSpot: @abstract Create a Cocoa NSCursor object with a Gecko image resource name @@ -80,7 +80,7 @@ @result an autoreleased instance of nsMacCursor that will animate the given cursor frames */ -+ (NSCursor *)cocoaCursorWithImageNamed:(NSString *)imageName hotSpot:(NSPoint)aPoint; ++ (NSCursor*)cocoaCursorWithImageNamed:(NSString*)imageName hotSpot:(NSPoint)aPoint; /*! @method isSet @abstract Determines whether this cursor is currently active. diff --git a/widget/cocoa/nsMacCursor.mm b/widget/cocoa/nsMacCursor.mm index ba852eff69b7b..a015dc38e2253 100644 --- a/widget/cocoa/nsMacCursor.mm +++ b/widget/cocoa/nsMacCursor.mm @@ -56,7 +56,7 @@ - (void)destroyTimer; frame. Determines which frame should occur next and sets the cursor to that frame. @param aTimer the timer causing the animation */ -- (void)advanceAnimatedCursor:(NSTimer *)aTimer; +- (void)advanceAnimatedCursor:(NSTimer*)aTimer; /*! @method setFrame: @abstract Sets the current cursor, using an index to determine which frame in the animation to @@ -80,8 +80,8 @@ - (void)setFrame:(int)aFrameIndex; */ @interface nsCocoaCursor : nsMacCursor { @private - NSArray *mFrames; - NSCursor *mLastSetCocoaCursor; + NSArray* mFrames; + NSCursor* mLastSetCocoaCursor; } /*! @method initWithFrames: @@ -93,7 +93,7 @@ @interface nsCocoaCursor : nsMacCursor { @param aType the corresponding nsCursor constant @result an instance of nsCocoaCursor that will animate the given cursor frames */ -- (id)initWithFrames:(NSArray *)aCursorFrames type:(nsCursor)aType; +- (id)initWithFrames:(NSArray*)aCursorFrames type:(nsCursor)aType; /*! @method initWithCursor: @abstract Create a cursor by specifying a Cocoa NSCursor. @@ -103,7 +103,7 @@ - (id)initWithFrames:(NSArray *)aCursorFrames type:(nsCursor)aType; @result an instance of nsCocoaCursor representing the given NSCursor */ -- (id)initWithCursor:(NSCursor *)aCursor type:(nsCursor)aType; +- (id)initWithCursor:(NSCursor*)aCursor type:(nsCursor)aType; /*! @method initWithImageNamed:hotSpot: @abstract Create a cursor by specifying the name of an image resource to use for the cursor @@ -117,13 +117,13 @@ - (id)initWithCursor:(NSCursor *)aCursor type:(nsCursor)aType; @param aType the corresponding nsCursor constant @result an instance of nsCocoaCursor that uses the given image and hotspot */ -- (id)initWithImageNamed:(NSString *)aCursorImage hotSpot:(NSPoint)aPoint type:(nsCursor)aType; +- (id)initWithImageNamed:(NSString*)aCursorImage hotSpot:(NSPoint)aPoint type:(nsCursor)aType; @end @implementation nsMacCursor -+ (nsMacCursor *)cursorWithCursor:(NSCursor *)aCursor type:(nsCursor)aType { ++ (nsMacCursor*)cursorWithCursor:(NSCursor*)aCursor type:(nsCursor)aType { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; return [[[nsCocoaCursor alloc] initWithCursor:aCursor type:aType] autorelease]; @@ -131,9 +131,9 @@ + (nsMacCursor *)cursorWithCursor:(NSCursor *)aCursor type:(nsCursor)aType { NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } -+ (nsMacCursor *)cursorWithImageNamed:(NSString *)aCursorImage - hotSpot:(NSPoint)aPoint - type:(nsCursor)aType { ++ (nsMacCursor*)cursorWithImageNamed:(NSString*)aCursorImage + hotSpot:(NSPoint)aPoint + type:(nsCursor)aType { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; return [[[nsCocoaCursor alloc] initWithImageNamed:aCursorImage hotSpot:aPoint @@ -142,7 +142,7 @@ + (nsMacCursor *)cursorWithImageNamed:(NSString *)aCursorImage NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } -+ (nsMacCursor *)cursorWithFrames:(NSArray *)aCursorFrames type:(nsCursor)aType { ++ (nsMacCursor*)cursorWithFrames:(NSArray*)aCursorFrames type:(nsCursor)aType { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; return [[[nsCocoaCursor alloc] initWithFrames:aCursorFrames type:aType] autorelease]; @@ -150,7 +150,7 @@ + (nsMacCursor *)cursorWithFrames:(NSArray *)aCursorFrames type:(nsCursor)aType NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } -+ (NSCursor *)cocoaCursorWithImageNamed:(NSString *)imageName hotSpot:(NSPoint)aPoint { ++ (NSCursor*)cocoaCursorWithImageNamed:(NSString*)imageName hotSpot:(NSPoint)aPoint { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; nsCOMPtr resDir; @@ -166,7 +166,7 @@ + (NSCursor *)cocoaCursorWithImageNamed:(NSString *)imageName hotSpot:(NSPoint)a rv = resDir->GetNativePath(resPath); if (NS_FAILED(rv)) goto INIT_FAILURE; - pathToImage = [NSString stringWithUTF8String:(const char *)resPath.get()]; + pathToImage = [NSString stringWithUTF8String:(const char*)resPath.get()]; if (!pathToImage) goto INIT_FAILURE; pathToImage = [pathToImage stringByAppendingPathComponent:imageName]; pathToHiDpiImage = [pathToImage stringByAppendingString:@"@2x"]; @@ -186,7 +186,7 @@ + (NSCursor *)cocoaCursorWithImageNamed:(NSString *)imageName hotSpot:(NSPoint)a // unless it is exactly twice the size of the lowdpi image. hiDpiCursorImage = [[[NSImage alloc] initWithContentsOfFile:pathToHiDpiImage] autorelease]; if (hiDpiCursorImage) { - NSImageRep *imageRep = [[hiDpiCursorImage representations] objectAtIndex:0]; + NSImageRep* imageRep = [[hiDpiCursorImage representations] objectAtIndex:0]; [cursorImage addRepresentation:imageRep]; } return [[[NSCursor alloc] initWithImage:cursorImage hotSpot:aPoint] autorelease]; @@ -258,7 +258,7 @@ - (void)destroyTimer { NS_OBJC_END_TRY_ABORT_BLOCK; } -- (void)advanceAnimatedCursor:(NSTimer *)aTimer { +- (void)advanceAnimatedCursor:(NSTimer*)aTimer { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; if ([aTimer isValid]) { @@ -289,12 +289,12 @@ - (void)dealloc { @implementation nsCocoaCursor -- (id)initWithFrames:(NSArray *)aCursorFrames type:(nsCursor)aType { +- (id)initWithFrames:(NSArray*)aCursorFrames type:(nsCursor)aType { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; self = [super init]; - NSEnumerator *it = [aCursorFrames objectEnumerator]; - NSObject *frame = nil; + NSEnumerator* it = [aCursorFrames objectEnumerator]; + NSObject* frame = nil; while ((frame = [it nextObject])) { NS_ASSERTION([frame isKindOfClass:[NSCursor class]], "Invalid argument: All frames must be of type NSCursor"); @@ -307,16 +307,16 @@ - (id)initWithFrames:(NSArray *)aCursorFrames type:(nsCursor)aType { NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } -- (id)initWithCursor:(NSCursor *)aCursor type:(nsCursor)aType { +- (id)initWithCursor:(NSCursor*)aCursor type:(nsCursor)aType { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; - NSArray *frame = [NSArray arrayWithObjects:aCursor, nil]; + NSArray* frame = [NSArray arrayWithObjects:aCursor, nil]; return [self initWithFrames:frame type:aType]; NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } -- (id)initWithImageNamed:(NSString *)aCursorImage hotSpot:(NSPoint)aPoint type:(nsCursor)aType { +- (id)initWithImageNamed:(NSString*)aCursorImage hotSpot:(NSPoint)aPoint type:(nsCursor)aType { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; return [self initWithCursor:[nsMacCursor cocoaCursorWithImageNamed:aCursorImage hotSpot:aPoint] @@ -332,7 +332,7 @@ - (BOOL)isSet { - (void)setFrame:(int)aFrameIndex { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - NSCursor *newCursor = [mFrames objectAtIndex:aFrameIndex]; + NSCursor* newCursor = [mFrames objectAtIndex:aFrameIndex]; [newCursor set]; mLastSetCocoaCursor = newCursor; @@ -347,7 +347,7 @@ - (int)numFrames { NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0); } -- (NSString *)description { +- (NSString*)description { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; return [mFrames description]; diff --git a/widget/cocoa/nsMenuBaseX.h b/widget/cocoa/nsMenuBaseX.h index e4bee6bbbd63f..d1c17d014330a 100644 --- a/widget/cocoa/nsMenuBaseX.h +++ b/widget/cocoa/nsMenuBaseX.h @@ -27,8 +27,8 @@ class nsMenuObjectX { public: virtual ~nsMenuObjectX() {} virtual nsMenuObjectTypeX MenuObjectType() = 0; - virtual void *NativeData() = 0; - nsIContent *Content() { return mContent; } + virtual void* NativeData() = 0; + nsIContent* Content() { return mContent; } /** * Called when an icon of a menu item somewhere in this menu has updated. @@ -48,12 +48,12 @@ class nsMenuObjectX { class nsMenuGroupOwnerX; @interface MenuItemInfo : NSObject { - nsMenuGroupOwnerX *mMenuGroupOwner; + nsMenuGroupOwnerX* mMenuGroupOwner; } -- (id)initWithMenuGroupOwner:(nsMenuGroupOwnerX *)aMenuGroupOwner; -- (nsMenuGroupOwnerX *)menuGroupOwner; -- (void)setMenuGroupOwner:(nsMenuGroupOwnerX *)aMenuGroupOwner; +- (id)initWithMenuGroupOwner:(nsMenuGroupOwnerX*)aMenuGroupOwner; +- (nsMenuGroupOwnerX*)menuGroupOwner; +- (void)setMenuGroupOwner:(nsMenuGroupOwnerX*)aMenuGroupOwner; @end diff --git a/widget/cocoa/nsPrintSettingsX.h b/widget/cocoa/nsPrintSettingsX.h index 8b35f4952c335..c47393e4a6e2c 100644 --- a/widget/cocoa/nsPrintSettingsX.h +++ b/widget/cocoa/nsPrintSettingsX.h @@ -36,13 +36,13 @@ class nsPrintSettingsX : public nsPrintSettings { nsPrintSettingsX(); nsresult Init(); - NSPrintInfo *GetCocoaPrintInfo() { return mPrintInfo; } - void SetCocoaPrintInfo(NSPrintInfo *aPrintInfo); + NSPrintInfo* GetCocoaPrintInfo() { return mPrintInfo; } + void SetCocoaPrintInfo(NSPrintInfo* aPrintInfo); virtual nsresult ReadPageFormatFromPrefs(); virtual nsresult WritePageFormatToPrefs(); - virtual nsresult GetEffectivePageSize(double *aWidth, - double *aHeight) override; - void GetFilePageSize(double *aWidth, double *aHeight); + virtual nsresult GetEffectivePageSize(double* aWidth, + double* aHeight) override; + void GetFilePageSize(double* aWidth, double* aHeight); // In addition to setting the paper width and height, these // overrides set the adjusted width and height returned from @@ -65,14 +65,14 @@ class nsPrintSettingsX : public nsPrintSettings { nsresult InitAdjustedPaperSize(); void SetInchesScale(float aWidthScale, float aHeightScale); - void GetInchesScale(float *aWidthScale, float *aHeightScale); + void GetInchesScale(float* aWidthScale, float* aHeightScale); NS_IMETHOD SetScaling(double aScaling) override; - NS_IMETHOD GetScaling(double *aScaling) override; + NS_IMETHOD GetScaling(double* aScaling) override; - NS_IMETHOD SetToFileName(const nsAString &aToFileName) override; + NS_IMETHOD SetToFileName(const nsAString& aToFileName) override; - NS_IMETHOD GetOrientation(int32_t *aOrientation) override; + NS_IMETHOD GetOrientation(int32_t* aOrientation) override; NS_IMETHOD SetOrientation(int32_t aOrientation) override; NS_IMETHOD SetUnwriteableMarginTop(double aUnwriteableMarginTop) override; @@ -82,7 +82,7 @@ class nsPrintSettingsX : public nsPrintSettings { NS_IMETHOD SetUnwriteableMarginRight(double aUnwriteableMarginRight) override; void SetAdjustedPaperSize(double aWidth, double aHeight); - void GetAdjustedPaperSize(double *aWidth, double *aHeight); + void GetAdjustedPaperSize(double* aWidth, double* aHeight); nsresult SetCocoaPaperSize(double aWidth, double aHeight); // Set the printer name using the native PrintInfo data. @@ -91,22 +91,22 @@ class nsPrintSettingsX : public nsPrintSettings { protected: virtual ~nsPrintSettingsX(); - nsPrintSettingsX(const nsPrintSettingsX &src); - nsPrintSettingsX &operator=(const nsPrintSettingsX &rhs); + nsPrintSettingsX(const nsPrintSettingsX& src); + nsPrintSettingsX& operator=(const nsPrintSettingsX& rhs); - nsresult _Clone(nsIPrintSettings **_retval) override; - nsresult _Assign(nsIPrintSettings *aPS) override; + nsresult _Clone(nsIPrintSettings** _retval) override; + nsresult _Assign(nsIPrintSettings* aPS) override; int GetCocoaUnit(int16_t aGeckoUnit); // The out param has a ref count of 1 on return so caller needs to PMRelase() // when done. OSStatus CreateDefaultPageFormat(PMPrintSession aSession, - PMPageFormat &outFormat); + PMPageFormat& outFormat); OSStatus CreateDefaultPrintSettings(PMPrintSession aSession, - PMPrintSettings &outSettings); + PMPrintSettings& outSettings); - NSPrintInfo *mPrintInfo; + NSPrintInfo* mPrintInfo; // Scaling factors used to convert the NSPrintInfo // paper size units to inches diff --git a/widget/cocoa/nsSound.mm b/widget/cocoa/nsSound.mm index 1817976f16881..e155d9bd564d7 100644 --- a/widget/cocoa/nsSound.mm +++ b/widget/cocoa/nsSound.mm @@ -31,13 +31,13 @@ } NS_IMETHODIMP -nsSound::OnStreamComplete(nsIStreamLoader *aLoader, nsISupports *context, nsresult aStatus, - uint32_t dataLen, const uint8_t *data) { +nsSound::OnStreamComplete(nsIStreamLoader* aLoader, nsISupports* context, nsresult aStatus, + uint32_t dataLen, const uint8_t* data) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - NSData *value = [NSData dataWithBytes:data length:dataLen]; + NSData* value = [NSData dataWithBytes:data length:dataLen]; - NSSound *sound = [[NSSound alloc] initWithData:value]; + NSSound* sound = [[NSSound alloc] initWithData:value]; [sound play]; @@ -49,7 +49,7 @@ } NS_IMETHODIMP -nsSound::Play(nsIURL *aURL) { +nsSound::Play(nsIURL* aURL) { nsCOMPtr uri(aURL); nsCOMPtr loader; return NS_NewStreamLoader(getter_AddRefs(loader), uri, diff --git a/widget/cocoa/nsWidgetFactory.mm b/widget/cocoa/nsWidgetFactory.mm index 46313ec02730c..0fe338a40009b 100644 --- a/widget/cocoa/nsWidgetFactory.mm +++ b/widget/cocoa/nsWidgetFactory.mm @@ -44,7 +44,7 @@ using namespace mozilla; using namespace mozilla::widget; -static nsresult nsClipboardConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult) { +static nsresult nsClipboardConstructor(nsISupports* aOuter, REFNSIID aIID, void** aResult) { nsCOMPtr inst; *aResult = nullptr; diff --git a/widget/gtk/compat/gdk/gdkdnd.h b/widget/gtk/compat/gdk/gdkdnd.h index 63eb94563bed6..bf9888d84fd9b 100644 --- a/widget/gtk/compat/gdk/gdkdnd.h +++ b/widget/gtk/compat/gdk/gdkdnd.h @@ -14,16 +14,16 @@ #undef gdk_drag_context_get_dest_window static inline GdkDragAction gdk_drag_context_get_actions( - GdkDragContext *context) { + GdkDragContext* context) { return context->actions; } -static inline GList *gdk_drag_context_list_targets(GdkDragContext *context) { +static inline GList* gdk_drag_context_list_targets(GdkDragContext* context) { return context->targets; } -static inline GdkWindow *gdk_drag_context_get_dest_window( - GdkDragContext *context) { +static inline GdkWindow* gdk_drag_context_get_dest_window( + GdkDragContext* context) { return context->dest_window; } #endif /* GDKDND_WRAPPER_H */ diff --git a/widget/gtk/compat/gdk/gdkvisual.h b/widget/gtk/compat/gdk/gdkvisual.h index 3682ac2ad2c4f..e5187a78da329 100644 --- a/widget/gtk/compat/gdk/gdkvisual.h +++ b/widget/gtk/compat/gdk/gdkvisual.h @@ -9,7 +9,7 @@ #include_next #undef gdk_visual_get_depth -static inline gint gdk_visual_get_depth(GdkVisual *visual) { +static inline gint gdk_visual_get_depth(GdkVisual* visual) { return visual->depth; } #endif /* GDKVISUAL_WRAPPER_H */ diff --git a/widget/gtk/compat/gdk/gdkwindow.h b/widget/gtk/compat/gdk/gdkwindow.h index 75b22e714bb68..a4d2efbc895a3 100644 --- a/widget/gtk/compat/gdk/gdkwindow.h +++ b/widget/gtk/compat/gdk/gdkwindow.h @@ -11,16 +11,16 @@ #undef gdk_window_get_display #undef gdk_window_get_screen -static inline GdkDisplay *gdk_window_get_display(GdkWindow *window) { +static inline GdkDisplay* gdk_window_get_display(GdkWindow* window) { return gdk_drawable_get_display(GDK_DRAWABLE(window)); } -static inline GdkScreen *gdk_window_get_screen(GdkWindow *window) { +static inline GdkScreen* gdk_window_get_screen(GdkWindow* window) { return gdk_drawable_get_screen(window); } #if GDK_PIXBUF_MAJOR == 2 && GDK_PIXBUF_MINOR < 18 -static inline gboolean gdk_window_is_destroyed(GdkWindow *window) { +static inline gboolean gdk_window_is_destroyed(GdkWindow* window) { return GDK_WINDOW_OBJECT(window)->destroyed; } #endif diff --git a/widget/gtk/compat/gdk/gdkx.h b/widget/gtk/compat/gdk/gdkx.h index d1ded94414ad1..3d13c88b4d1cc 100644 --- a/widget/gtk/compat/gdk/gdkx.h +++ b/widget/gtk/compat/gdk/gdkx.h @@ -19,17 +19,17 @@ #undef gdk_x11_window_lookup_for_display #undef gdk_x11_window_get_xid -static inline GdkWindow *gdk_x11_window_foreign_new_for_display( - GdkDisplay *display, Window window) { +static inline GdkWindow* gdk_x11_window_foreign_new_for_display( + GdkDisplay* display, Window window) { return gdk_window_foreign_new_for_display(display, window); } -static inline GdkWindow *gdk_x11_window_lookup_for_display(GdkDisplay *display, +static inline GdkWindow* gdk_x11_window_lookup_for_display(GdkDisplay* display, Window window) { return gdk_window_lookup_for_display(display, window); } -static inline Window gdk_x11_window_get_xid(GdkWindow *window) { +static inline Window gdk_x11_window_get_xid(GdkWindow* window) { return (GDK_WINDOW_XWINDOW(window)); } @@ -39,7 +39,7 @@ static inline Window gdk_x11_window_get_xid(GdkWindow *window) { #if !GTK_CHECK_VERSION(2, 24, 0) # undef gdk_x11_set_sm_client_id -static inline void gdk_x11_set_sm_client_id(const gchar *sm_client_id) { +static inline void gdk_x11_set_sm_client_id(const gchar* sm_client_id) { gdk_set_sm_client_id(sm_client_id); } #endif diff --git a/widget/gtk/compat/glib/gmem.h b/widget/gtk/compat/glib/gmem.h index 3777a3583eeef..78f24bbd8dbcd 100644 --- a/widget/gtk/compat/glib/gmem.h +++ b/widget/gtk/compat/glib/gmem.h @@ -16,13 +16,13 @@ #include #undef g_new -#define g_new(type, num) ((type *)g_malloc_n((num), sizeof(type))) +#define g_new(type, num) ((type*)g_malloc_n((num), sizeof(type))) #undef g_new0 -#define g_new0(type, num) ((type *)g_malloc0_n((num), sizeof(type))) +#define g_new0(type, num) ((type*)g_malloc0_n((num), sizeof(type))) #undef g_renew -#define g_renew(type, ptr, num) ((type *)g_realloc_n(ptr, (num), sizeof(type))) +#define g_renew(type, ptr, num) ((type*)g_realloc_n(ptr, (num), sizeof(type))) #define _CHECK_OVERFLOW(num, type_size) \ if (G_UNLIKELY(type_size > 0 && num > G_MAXSIZE / type_size)) { \ diff --git a/widget/gtk/compat/gtk/gtkwidget.h b/widget/gtk/compat/gtk/gtkwidget.h index 369239d4e7214..21165d61fade9 100644 --- a/widget/gtk/compat/gtk/gtkwidget.h +++ b/widget/gtk/compat/gtk/gtkwidget.h @@ -17,18 +17,18 @@ #include -static inline void gtk_widget_set_mapped(GtkWidget *widget, gboolean mapped) { +static inline void gtk_widget_set_mapped(GtkWidget* widget, gboolean mapped) { if (mapped) GTK_WIDGET_SET_FLAGS(widget, GTK_MAPPED); else GTK_WIDGET_UNSET_FLAGS(widget, GTK_MAPPED); } -static inline gboolean gtk_widget_get_mapped(GtkWidget *widget) { +static inline gboolean gtk_widget_get_mapped(GtkWidget* widget) { return GTK_WIDGET_MAPPED(widget); } -static inline void gtk_widget_set_realized(GtkWidget *widget, +static inline void gtk_widget_set_realized(GtkWidget* widget, gboolean realized) { if (realized) GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); @@ -36,7 +36,7 @@ static inline void gtk_widget_set_realized(GtkWidget *widget, GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED); } -static inline gboolean gtk_widget_get_realized(GtkWidget *widget) { +static inline gboolean gtk_widget_get_realized(GtkWidget* widget) { return GTK_WIDGET_REALIZED(widget); } diff --git a/widget/gtk/compat/gtk/gtkwindow.h b/widget/gtk/compat/gtk/gtkwindow.h index 748dec1cc0a63..7c3d5873bdd77 100644 --- a/widget/gtk/compat/gtk/gtkwindow.h +++ b/widget/gtk/compat/gtk/gtkwindow.h @@ -11,16 +11,16 @@ #undef gtk_window_group_get_current_grab #undef gtk_window_get_window_type -static inline GtkWidget *gtk_window_group_get_current_grab( - GtkWindowGroup *window_group) { +static inline GtkWidget* gtk_window_group_get_current_grab( + GtkWindowGroup* window_group) { if (!window_group->grabs) return NULL; return GTK_WIDGET(window_group->grabs->data); } -static inline GtkWindowType gtk_window_get_window_type(GtkWindow *window) { +static inline GtkWindowType gtk_window_get_window_type(GtkWindow* window) { gint type; - g_object_get(window, "type", &type, (void *)NULL); + g_object_get(window, "type", &type, (void*)NULL); return (GtkWindowType)type; } #endif /* GTKWINDOW_WRAPPER_H */ diff --git a/widget/gtk/maiRedundantObjectFactory.c b/widget/gtk/maiRedundantObjectFactory.c index 0ed58d64e5002..ce086e20afbce 100644 --- a/widget/gtk/maiRedundantObjectFactory.c +++ b/widget/gtk/maiRedundantObjectFactory.c @@ -9,9 +9,9 @@ #include "maiRedundantObjectFactory.h" static void mai_redundant_object_factory_class_init( - maiRedundantObjectFactoryClass *klass); + maiRedundantObjectFactoryClass* klass); -static AtkObject *mai_redundant_object_factory_create_accessible(GObject *obj); +static AtkObject* mai_redundant_object_factory_create_accessible(GObject* obj); static GType mai_redundant_object_factory_get_accessible_type(void); GType mai_redundant_object_factory_get_type(void) { @@ -39,8 +39,8 @@ GType mai_redundant_object_factory_get_type(void) { } static void mai_redundant_object_factory_class_init( - maiRedundantObjectFactoryClass *klass) { - AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS(klass); + maiRedundantObjectFactoryClass* klass) { + AtkObjectFactoryClass* class = ATK_OBJECT_FACTORY_CLASS(klass); class->create_accessible = mai_redundant_object_factory_create_accessible; class->get_accessible_type = mai_redundant_object_factory_get_accessible_type; @@ -54,8 +54,8 @@ static void mai_redundant_object_factory_class_init( * * Returns: an instance of an #AtkObjectFactory **/ -AtkObjectFactory *mai_redundant_object_factory_new() { - GObject *factory; +AtkObjectFactory* mai_redundant_object_factory_new() { + GObject* factory; factory = g_object_new(mai_redundant_object_factory_get_type(), NULL); @@ -63,8 +63,8 @@ AtkObjectFactory *mai_redundant_object_factory_new() { return ATK_OBJECT_FACTORY(factory); } -static AtkObject *mai_redundant_object_factory_create_accessible(GObject *obj) { - AtkObject *accessible; +static AtkObject* mai_redundant_object_factory_create_accessible(GObject* obj) { + AtkObject* accessible; g_return_val_if_fail(obj != NULL, NULL); diff --git a/widget/gtk/maiRedundantObjectFactory.h b/widget/gtk/maiRedundantObjectFactory.h index 1a5c9099cdc7b..931adffb6b778 100644 --- a/widget/gtk/maiRedundantObjectFactory.h +++ b/widget/gtk/maiRedundantObjectFactory.h @@ -23,7 +23,7 @@ struct _maiRedundantObjectFactoryClass { GType mai_redundant_object_factory_get_type(); -AtkObjectFactory *mai_redundant_object_factory_new(); +AtkObjectFactory* mai_redundant_object_factory_new(); G_END_DECLS diff --git a/widget/gtk/mozcontainer.cpp b/widget/gtk/mozcontainer.cpp index 038aaa3e48988..7bc7651699e3a 100644 --- a/widget/gtk/mozcontainer.cpp +++ b/widget/gtk/mozcontainer.cpp @@ -42,40 +42,40 @@ using namespace mozilla::widget; #endif /* init methods */ -static void moz_container_class_init(MozContainerClass *klass); -static void moz_container_init(MozContainer *container); +static void moz_container_class_init(MozContainerClass* klass); +static void moz_container_init(MozContainer* container); /* widget class methods */ -static void moz_container_map(GtkWidget *widget); +static void moz_container_map(GtkWidget* widget); #if defined(MOZ_WAYLAND) -static gboolean moz_container_map_wayland(GtkWidget *widget, - GdkEventAny *event); +static gboolean moz_container_map_wayland(GtkWidget* widget, + GdkEventAny* event); #endif -static void moz_container_unmap(GtkWidget *widget); -static void moz_container_realize(GtkWidget *widget); -static void moz_container_size_allocate(GtkWidget *widget, - GtkAllocation *allocation); +static void moz_container_unmap(GtkWidget* widget); +static void moz_container_realize(GtkWidget* widget); +static void moz_container_size_allocate(GtkWidget* widget, + GtkAllocation* allocation); /* container class methods */ -static void moz_container_remove(GtkContainer *container, - GtkWidget *child_widget); -static void moz_container_forall(GtkContainer *container, +static void moz_container_remove(GtkContainer* container, + GtkWidget* child_widget); +static void moz_container_forall(GtkContainer* container, gboolean include_internals, GtkCallback callback, gpointer callback_data); -static void moz_container_add(GtkContainer *container, GtkWidget *widget); +static void moz_container_add(GtkContainer* container, GtkWidget* widget); typedef struct _MozContainerChild MozContainerChild; struct _MozContainerChild { - GtkWidget *widget; + GtkWidget* widget; gint x; gint y; }; -static void moz_container_allocate_child(MozContainer *container, - MozContainerChild *child); -static MozContainerChild *moz_container_get_child(MozContainer *container, - GtkWidget *child); +static void moz_container_allocate_child(MozContainer* container, + MozContainerChild* child); +static MozContainerChild* moz_container_get_child(MozContainer* container, + GtkWidget* child); /* public methods */ @@ -111,18 +111,18 @@ GType moz_container_get_type(void) { return moz_container_type; } -GtkWidget *moz_container_new(void) { - MozContainer *container; +GtkWidget* moz_container_new(void) { + MozContainer* container; container = - static_cast(g_object_new(MOZ_CONTAINER_TYPE, nullptr)); + static_cast(g_object_new(MOZ_CONTAINER_TYPE, nullptr)); return GTK_WIDGET(container); } -void moz_container_put(MozContainer *container, GtkWidget *child_widget, gint x, +void moz_container_put(MozContainer* container, GtkWidget* child_widget, gint x, gint y) { - MozContainerChild *child; + MozContainerChild* child; child = g_new(MozContainerChild, 1); @@ -142,11 +142,11 @@ void moz_container_put(MozContainer *container, GtkWidget *child_widget, gint x, /* static methods */ -void moz_container_class_init(MozContainerClass *klass) { +void moz_container_class_init(MozContainerClass* klass) { /*GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); */ - GtkContainerClass *container_class = GTK_CONTAINER_CLASS(klass); - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); + GtkContainerClass* container_class = GTK_CONTAINER_CLASS(klass); + GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass); widget_class->map = moz_container_map; #if defined(MOZ_WAYLAND) @@ -163,7 +163,7 @@ void moz_container_class_init(MozContainerClass *klass) { container_class->add = moz_container_add; } -void moz_container_init(MozContainer *container) { +void moz_container_init(MozContainer* container) { gtk_widget_set_can_focus(GTK_WIDGET(container), TRUE); gtk_container_set_resize_mode(GTK_CONTAINER(container), GTK_RESIZE_IMMEDIATE); gtk_widget_set_redraw_on_allocate(GTK_WIDGET(container), FALSE); @@ -180,40 +180,39 @@ void moz_container_init(MozContainer *container) { container->inital_draw_cb = nullptr; #endif - LOG(("%s [%p]\n", __FUNCTION__, (void *)container)); + LOG(("%s [%p]\n", __FUNCTION__, (void*)container)); } #if defined(MOZ_WAYLAND) void moz_container_set_initial_draw_callback( - MozContainer *container, std::function inital_draw_cb) { + MozContainer* container, std::function inital_draw_cb) { container->inital_draw_cb = inital_draw_cb; } -static wl_surface *moz_container_get_gtk_container_surface( - MozContainer *container) { - static auto sGdkWaylandWindowGetWlSurface = (wl_surface * (*)(GdkWindow *)) +static wl_surface* moz_container_get_gtk_container_surface( + MozContainer* container) { + static auto sGdkWaylandWindowGetWlSurface = (wl_surface * (*)(GdkWindow*)) dlsym(RTLD_DEFAULT, "gdk_wayland_window_get_wl_surface"); - GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container)); - wl_surface *surface = sGdkWaylandWindowGetWlSurface(window); + GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); + wl_surface* surface = sGdkWaylandWindowGetWlSurface(window); - LOGWAYLAND(("%s [%p] wl_surface %p ID %d\n", __FUNCTION__, (void *)container, - (void *)surface, - surface ? wl_proxy_get_id((struct wl_proxy *)surface) : -1)); + LOGWAYLAND(("%s [%p] wl_surface %p ID %d\n", __FUNCTION__, (void*)container, + (void*)surface, + surface ? wl_proxy_get_id((struct wl_proxy*)surface) : -1)); return surface; } -static void frame_callback_handler(void *data, struct wl_callback *callback, +static void frame_callback_handler(void* data, struct wl_callback* callback, uint32_t time) { - MozContainer *container = MOZ_CONTAINER(data); + MozContainer* container = MOZ_CONTAINER(data); LOGWAYLAND( ("%s [%p] frame_callback_handler %p ready_to_draw %d (set to true)" " inital_draw callback %d\n", - __FUNCTION__, (void *)container, - (void *)container->frame_callback_handler, container->ready_to_draw, - container->inital_draw_cb ? 1 : 0)); + __FUNCTION__, (void*)container, (void*)container->frame_callback_handler, + container->ready_to_draw, container->inital_draw_cb ? 1 : 0)); g_clear_pointer(&container->frame_callback_handler, wl_callback_destroy); container->frame_callback_handler_surface_id = -1; @@ -228,18 +227,18 @@ static const struct wl_callback_listener frame_listener = { frame_callback_handler}; static void moz_container_request_parent_frame_callback( - MozContainer *container) { - wl_surface *gtk_container_surface = + MozContainer* container) { + wl_surface* gtk_container_surface = moz_container_get_gtk_container_surface(container); int gtk_container_surface_id = gtk_container_surface - ? wl_proxy_get_id((struct wl_proxy *)gtk_container_surface) + ? wl_proxy_get_id((struct wl_proxy*)gtk_container_surface) : -1; LOGWAYLAND( ("%s [%p] frame_callback_handler %p " "frame_callback_handler_surface_id %d\n", - __FUNCTION__, (void *)container, container->frame_callback_handler, + __FUNCTION__, (void*)container, container->frame_callback_handler, container->frame_callback_handler_surface_id)); if (container->frame_callback_handler && @@ -263,12 +262,12 @@ static void moz_container_request_parent_frame_callback( } } -static gboolean moz_container_map_wayland(GtkWidget *widget, - GdkEventAny *event) { - MozContainer *container = MOZ_CONTAINER(widget); +static gboolean moz_container_map_wayland(GtkWidget* widget, + GdkEventAny* event) { + MozContainer* container = MOZ_CONTAINER(widget); LOGWAYLAND(("%s begin [%p] ready_to_draw %d\n", __FUNCTION__, - (void *)container, container->ready_to_draw)); + (void*)container, container->ready_to_draw)); if (container->ready_to_draw) { return FALSE; @@ -278,7 +277,7 @@ static gboolean moz_container_map_wayland(GtkWidget *widget, return FALSE; } -static void moz_container_unmap_wayland(MozContainer *container) { +static void moz_container_unmap_wayland(MozContainer* container) { g_clear_pointer(&container->eglwindow, wl_egl_window_destroy); g_clear_pointer(&container->subsurface, wl_subsurface_destroy); g_clear_pointer(&container->surface, wl_surface_destroy); @@ -288,26 +287,26 @@ static void moz_container_unmap_wayland(MozContainer *container) { container->surface_needs_clear = true; container->ready_to_draw = false; - LOGWAYLAND(("%s [%p]\n", __FUNCTION__, (void *)container)); + LOGWAYLAND(("%s [%p]\n", __FUNCTION__, (void*)container)); } -static gint moz_container_get_scale(MozContainer *container) { +static gint moz_container_get_scale(MozContainer* container) { static auto sGdkWindowGetScaleFactorPtr = - (gint(*)(GdkWindow *))dlsym(RTLD_DEFAULT, "gdk_window_get_scale_factor"); + (gint(*)(GdkWindow*))dlsym(RTLD_DEFAULT, "gdk_window_get_scale_factor"); if (sGdkWindowGetScaleFactorPtr) { - GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container)); + GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); return (*sGdkWindowGetScaleFactorPtr)(window); } return 1; } -void moz_container_scale_changed(MozContainer *container, - GtkAllocation *aAllocation) { +void moz_container_scale_changed(MozContainer* container, + GtkAllocation* aAllocation) { LOGWAYLAND(("%s [%p] surface %p eglwindow %p\n", __FUNCTION__, - (void *)container, (void *)container->surface, - (void *)container->eglwindow)); + (void*)container, (void*)container->surface, + (void*)container->eglwindow)); if (!container->surface) { return; @@ -331,10 +330,10 @@ void moz_container_scale_changed(MozContainer *container, } #endif -void moz_container_map(GtkWidget *widget) { - MozContainer *container; - GList *tmp_list; - GtkWidget *tmp_child; +void moz_container_map(GtkWidget* widget) { + MozContainer* container; + GList* tmp_list; + GtkWidget* tmp_child; g_return_if_fail(IS_MOZ_CONTAINER(widget)); container = MOZ_CONTAINER(widget); @@ -343,7 +342,7 @@ void moz_container_map(GtkWidget *widget) { tmp_list = container->children; while (tmp_list) { - tmp_child = ((MozContainerChild *)tmp_list->data)->widget; + tmp_child = ((MozContainerChild*)tmp_list->data)->widget; if (gtk_widget_get_visible(tmp_child)) { if (!gtk_widget_get_mapped(tmp_child)) gtk_widget_map(tmp_child); @@ -361,7 +360,7 @@ void moz_container_map(GtkWidget *widget) { } } -void moz_container_unmap(GtkWidget *widget) { +void moz_container_unmap(GtkWidget* widget) { g_return_if_fail(IS_MOZ_CONTAINER(widget)); gtk_widget_set_mapped(widget, FALSE); @@ -376,9 +375,9 @@ void moz_container_unmap(GtkWidget *widget) { } } -void moz_container_realize(GtkWidget *widget) { - GdkWindow *parent = gtk_widget_get_parent_window(widget); - GdkWindow *window; +void moz_container_realize(GtkWidget* widget) { + GdkWindow* parent = gtk_widget_get_parent_window(widget); + GdkWindow* window; gtk_widget_set_realized(widget, TRUE); @@ -395,7 +394,7 @@ void moz_container_realize(GtkWidget *widget) { attributes.height = allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.window_type = GDK_WINDOW_CHILD; - MozContainer *container = MOZ_CONTAINER(widget); + MozContainer* container = MOZ_CONTAINER(widget); attributes.visual = container->force_default_visual ? gdk_screen_get_system_visual(gtk_widget_get_screen(widget)) @@ -403,8 +402,8 @@ void moz_container_realize(GtkWidget *widget) { window = gdk_window_new(parent, &attributes, attributes_mask); - LOG(("moz_container_realize() [%p] GdkWindow %p\n", (void *)container, - (void *)window)); + LOG(("moz_container_realize() [%p] GdkWindow %p\n", (void*)container, + (void*)window)); gdk_window_set_user_data(window, widget); } else { @@ -415,14 +414,14 @@ void moz_container_realize(GtkWidget *widget) { gtk_widget_set_window(widget, window); } -void moz_container_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { - MozContainer *container; - GList *tmp_list; +void moz_container_size_allocate(GtkWidget* widget, GtkAllocation* allocation) { + MozContainer* container; + GList* tmp_list; GtkAllocation tmp_allocation; g_return_if_fail(IS_MOZ_CONTAINER(widget)); - LOG(("%s [%p] %d %d %d %d\n", __FUNCTION__, (void *)widget, allocation->x, + LOG(("%s [%p] %d %d %d %d\n", __FUNCTION__, (void*)widget, allocation->x, allocation->y, allocation->width, allocation->height)); /* short circuit if you can */ @@ -440,7 +439,7 @@ void moz_container_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { tmp_list = container->children; while (tmp_list) { - MozContainerChild *child = static_cast(tmp_list->data); + MozContainerChild* child = static_cast(tmp_list->data); moz_container_allocate_child(container, child); @@ -470,10 +469,10 @@ void moz_container_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { #endif } -void moz_container_remove(GtkContainer *container, GtkWidget *child_widget) { - MozContainerChild *child; - MozContainer *moz_container; - GdkWindow *parent_window; +void moz_container_remove(GtkContainer* container, GtkWidget* child_widget) { + MozContainerChild* child; + MozContainer* moz_container; + GdkWindow* parent_window; g_return_if_fail(IS_MOZ_CONTAINER(container)); g_return_if_fail(GTK_IS_WIDGET(child_widget)); @@ -516,10 +515,10 @@ void moz_container_remove(GtkContainer *container, GtkWidget *child_widget) { g_free(child); } -void moz_container_forall(GtkContainer *container, gboolean include_internals, +void moz_container_forall(GtkContainer* container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { - MozContainer *moz_container; - GList *tmp_list; + MozContainer* moz_container; + GList* tmp_list; g_return_if_fail(IS_MOZ_CONTAINER(container)); g_return_if_fail(callback != NULL); @@ -528,15 +527,15 @@ void moz_container_forall(GtkContainer *container, gboolean include_internals, tmp_list = moz_container->children; while (tmp_list) { - MozContainerChild *child; - child = static_cast(tmp_list->data); + MozContainerChild* child; + child = static_cast(tmp_list->data); tmp_list = tmp_list->next; (*callback)(child->widget, callback_data); } } -static void moz_container_allocate_child(MozContainer *container, - MozContainerChild *child) { +static void moz_container_allocate_child(MozContainer* container, + MozContainerChild* child) { GtkAllocation allocation; gtk_widget_get_allocation(child->widget, &allocation); @@ -546,15 +545,15 @@ static void moz_container_allocate_child(MozContainer *container, gtk_widget_size_allocate(child->widget, &allocation); } -MozContainerChild *moz_container_get_child(MozContainer *container, - GtkWidget *child_widget) { - GList *tmp_list; +MozContainerChild* moz_container_get_child(MozContainer* container, + GtkWidget* child_widget) { + GList* tmp_list; tmp_list = container->children; while (tmp_list) { - MozContainerChild *child; + MozContainerChild* child; - child = static_cast(tmp_list->data); + child = static_cast(tmp_list->data); tmp_list = tmp_list->next; if (child->widget == child_widget) return child; @@ -563,14 +562,14 @@ MozContainerChild *moz_container_get_child(MozContainer *container, return NULL; } -static void moz_container_add(GtkContainer *container, GtkWidget *widget) { +static void moz_container_add(GtkContainer* container, GtkWidget* widget) { moz_container_put(MOZ_CONTAINER(container), widget, 0, 0); } #ifdef MOZ_WAYLAND -struct wl_surface *moz_container_get_wl_surface(MozContainer *container) { +struct wl_surface* moz_container_get_wl_surface(MozContainer* container) { LOGWAYLAND(("%s [%p] surface %p ready_to_draw %d\n", __FUNCTION__, - (void *)container, (void *)container->surface, + (void*)container, (void*)container->surface, container->ready_to_draw)); if (!container->surface) { @@ -578,22 +577,22 @@ struct wl_surface *moz_container_get_wl_surface(MozContainer *container) { moz_container_request_parent_frame_callback(container); return nullptr; } - GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(container)); + GdkDisplay* display = gtk_widget_get_display(GTK_WIDGET(container)); // Available as of GTK 3.8+ static auto sGdkWaylandDisplayGetWlCompositor = - (wl_compositor * (*)(GdkDisplay *)) + (wl_compositor * (*)(GdkDisplay*)) dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_compositor"); - struct wl_compositor *compositor = + struct wl_compositor* compositor = sGdkWaylandDisplayGetWlCompositor(display); container->surface = wl_compositor_create_surface(compositor); - nsWaylandDisplay *waylandDisplay = WaylandDisplayGet(display); + nsWaylandDisplay* waylandDisplay = WaylandDisplayGet(display); container->subsurface = wl_subcompositor_get_subsurface( waylandDisplay->GetSubcompositor(), container->surface, moz_container_get_gtk_container_surface(container)); - GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container)); + GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); gint x, y; gdk_window_get_position(window, &x, &y); wl_subsurface_set_position(container->subsurface, x, y); @@ -601,7 +600,7 @@ struct wl_surface *moz_container_get_wl_surface(MozContainer *container) { // Route input to parent wl_surface owned by Gtk+ so we get input // events from Gtk+. - wl_region *region = wl_compositor_create_region(compositor); + wl_region* region = wl_compositor_create_region(compositor); wl_surface_set_input_region(container->surface, region); wl_region_destroy(region); @@ -612,23 +611,23 @@ struct wl_surface *moz_container_get_wl_surface(MozContainer *container) { wl_display_flush(waylandDisplay->GetDisplay()); } - LOGWAYLAND(("%s [%p] created surface %p\n", __FUNCTION__, (void *)container, - (void *)container->surface)); + LOGWAYLAND(("%s [%p] created surface %p\n", __FUNCTION__, (void*)container, + (void*)container->surface)); return container->surface; } -struct wl_egl_window *moz_container_get_wl_egl_window(MozContainer *container) { - LOGWAYLAND(("%s [%p] eglwindow %p\n", __FUNCTION__, (void *)container, - (void *)container->eglwindow)); +struct wl_egl_window* moz_container_get_wl_egl_window(MozContainer* container) { + LOGWAYLAND(("%s [%p] eglwindow %p\n", __FUNCTION__, (void*)container, + (void*)container->eglwindow)); if (!container->eglwindow) { - wl_surface *surface = moz_container_get_wl_surface(container); + wl_surface* surface = moz_container_get_wl_surface(container); if (!surface) { return nullptr; } - GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container)); + GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); gint scale = moz_container_get_scale(container); container->eglwindow = wl_egl_window_create(surface, gdk_window_get_width(window) * scale, @@ -636,23 +635,23 @@ struct wl_egl_window *moz_container_get_wl_egl_window(MozContainer *container) { wl_surface_set_buffer_scale(surface, scale); } - LOGWAYLAND(("%s [%p] created eglwindow %p\n", __FUNCTION__, (void *)container, - (void *)container->eglwindow)); + LOGWAYLAND(("%s [%p] created eglwindow %p\n", __FUNCTION__, (void*)container, + (void*)container->eglwindow)); return container->eglwindow; } -gboolean moz_container_has_wl_egl_window(MozContainer *container) { +gboolean moz_container_has_wl_egl_window(MozContainer* container) { return container->eglwindow ? true : false; } -gboolean moz_container_surface_needs_clear(MozContainer *container) { +gboolean moz_container_surface_needs_clear(MozContainer* container) { gboolean state = container->surface_needs_clear; container->surface_needs_clear = false; return state; } #endif -void moz_container_force_default_visual(MozContainer *container) { +void moz_container_force_default_visual(MozContainer* container) { container->force_default_visual = true; } diff --git a/widget/gtk/mozcontainer.h b/widget/gtk/mozcontainer.h index b39601aec4c87..0bff7cb2f1bdb 100644 --- a/widget/gtk/mozcontainer.h +++ b/widget/gtk/mozcontainer.h @@ -70,13 +70,13 @@ struct wl_subsurface; struct _MozContainer { GtkContainer container; - GList *children; + GList* children; #ifdef MOZ_WAYLAND - struct wl_surface *surface; - struct wl_subsurface *subsurface; - struct wl_egl_window *eglwindow; - struct wl_callback *frame_callback_handler; + struct wl_surface* surface; + struct wl_subsurface* subsurface; + struct wl_egl_window* eglwindow; + struct wl_callback* frame_callback_handler; int frame_callback_handler_surface_id; gboolean surface_needs_clear; gboolean ready_to_draw; @@ -90,21 +90,21 @@ struct _MozContainerClass { }; GType moz_container_get_type(void); -GtkWidget *moz_container_new(void); -void moz_container_put(MozContainer *container, GtkWidget *child_widget, gint x, +GtkWidget* moz_container_new(void); +void moz_container_put(MozContainer* container, GtkWidget* child_widget, gint x, gint y); -void moz_container_force_default_visual(MozContainer *container); +void moz_container_force_default_visual(MozContainer* container); #ifdef MOZ_WAYLAND -struct wl_surface *moz_container_get_wl_surface(MozContainer *container); -struct wl_egl_window *moz_container_get_wl_egl_window(MozContainer *container); +struct wl_surface* moz_container_get_wl_surface(MozContainer* container); +struct wl_egl_window* moz_container_get_wl_egl_window(MozContainer* container); -gboolean moz_container_has_wl_egl_window(MozContainer *container); -gboolean moz_container_surface_needs_clear(MozContainer *container); -void moz_container_scale_changed(MozContainer *container, - GtkAllocation *aAllocation); +gboolean moz_container_has_wl_egl_window(MozContainer* container); +gboolean moz_container_surface_needs_clear(MozContainer* container); +void moz_container_scale_changed(MozContainer* container, + GtkAllocation* aAllocation); void moz_container_set_initial_draw_callback( - MozContainer *container, std::function inital_draw_cb); + MozContainer* container, std::function inital_draw_cb); #endif #endif /* __MOZ_CONTAINER_H__ */ diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c index 82c3a59db3b6b..73a9a76f9de9e 100644 --- a/widget/gtk/mozwayland/mozwayland.c +++ b/widget/gtk/mozwayland/mozwayland.c @@ -33,154 +33,154 @@ const struct wl_interface wl_subsurface_interface; const struct wl_interface wl_subcompositor_interface; #pragma GCC visibility pop -MOZ_EXPORT void wl_event_queue_destroy(struct wl_event_queue *queue) {} +MOZ_EXPORT void wl_event_queue_destroy(struct wl_event_queue* queue) {} -MOZ_EXPORT void wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...) {} +MOZ_EXPORT void wl_proxy_marshal(struct wl_proxy* p, uint32_t opcode, ...) {} -MOZ_EXPORT void wl_proxy_marshal_array(struct wl_proxy *p, uint32_t opcode, - union wl_argument *args) {} +MOZ_EXPORT void wl_proxy_marshal_array(struct wl_proxy* p, uint32_t opcode, + union wl_argument* args) {} -MOZ_EXPORT struct wl_proxy *wl_proxy_create( - struct wl_proxy *factory, const struct wl_interface *interface) { +MOZ_EXPORT struct wl_proxy* wl_proxy_create( + struct wl_proxy* factory, const struct wl_interface* interface) { return NULL; } -MOZ_EXPORT void *wl_proxy_create_wrapper(void *proxy) { return NULL; } +MOZ_EXPORT void* wl_proxy_create_wrapper(void* proxy) { return NULL; } -MOZ_EXPORT void wl_proxy_wrapper_destroy(void *proxy_wrapper) {} +MOZ_EXPORT void wl_proxy_wrapper_destroy(void* proxy_wrapper) {} -MOZ_EXPORT struct wl_proxy *wl_proxy_marshal_constructor( - struct wl_proxy *proxy, uint32_t opcode, - const struct wl_interface *interface, ...) { +MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_constructor( + struct wl_proxy* proxy, uint32_t opcode, + const struct wl_interface* interface, ...) { return NULL; } -MOZ_EXPORT struct wl_proxy *wl_proxy_marshal_constructor_versioned( - struct wl_proxy *proxy, uint32_t opcode, - const struct wl_interface *interface, uint32_t version, ...) { +MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_constructor_versioned( + struct wl_proxy* proxy, uint32_t opcode, + const struct wl_interface* interface, uint32_t version, ...) { return NULL; } -MOZ_EXPORT struct wl_proxy *wl_proxy_marshal_array_constructor( - struct wl_proxy *proxy, uint32_t opcode, union wl_argument *args, - const struct wl_interface *interface) { +MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_array_constructor( + struct wl_proxy* proxy, uint32_t opcode, union wl_argument* args, + const struct wl_interface* interface) { return NULL; } -MOZ_EXPORT struct wl_proxy *wl_proxy_marshal_array_constructor_versioned( - struct wl_proxy *proxy, uint32_t opcode, union wl_argument *args, - const struct wl_interface *interface, uint32_t version) { +MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_array_constructor_versioned( + struct wl_proxy* proxy, uint32_t opcode, union wl_argument* args, + const struct wl_interface* interface, uint32_t version) { return NULL; } -MOZ_EXPORT void wl_proxy_destroy(struct wl_proxy *proxy) {} +MOZ_EXPORT void wl_proxy_destroy(struct wl_proxy* proxy) {} -MOZ_EXPORT int wl_proxy_add_listener(struct wl_proxy *proxy, +MOZ_EXPORT int wl_proxy_add_listener(struct wl_proxy* proxy, void (**implementation)(void), - void *data) { + void* data) { return -1; } -MOZ_EXPORT const void *wl_proxy_get_listener(struct wl_proxy *proxy) { +MOZ_EXPORT const void* wl_proxy_get_listener(struct wl_proxy* proxy) { return NULL; } -typedef int (*wl_dispatcher_func_t)(const void *, void *, uint32_t, - const struct wl_message *, - union wl_argument *); +typedef int (*wl_dispatcher_func_t)(const void*, void*, uint32_t, + const struct wl_message*, + union wl_argument*); -MOZ_EXPORT int wl_proxy_add_dispatcher(struct wl_proxy *proxy, +MOZ_EXPORT int wl_proxy_add_dispatcher(struct wl_proxy* proxy, wl_dispatcher_func_t dispatcher_func, - const void *dispatcher_data, - void *data) { + const void* dispatcher_data, + void* data) { return -1; } -MOZ_EXPORT void wl_proxy_set_user_data(struct wl_proxy *proxy, - void *user_data) {} +MOZ_EXPORT void wl_proxy_set_user_data(struct wl_proxy* proxy, + void* user_data) {} -MOZ_EXPORT void *wl_proxy_get_user_data(struct wl_proxy *proxy) { return NULL; } +MOZ_EXPORT void* wl_proxy_get_user_data(struct wl_proxy* proxy) { return NULL; } -MOZ_EXPORT uint32_t wl_proxy_get_version(struct wl_proxy *proxy) { return -1; } +MOZ_EXPORT uint32_t wl_proxy_get_version(struct wl_proxy* proxy) { return -1; } -MOZ_EXPORT uint32_t wl_proxy_get_id(struct wl_proxy *proxy) { return -1; } +MOZ_EXPORT uint32_t wl_proxy_get_id(struct wl_proxy* proxy) { return -1; } -MOZ_EXPORT const char *wl_proxy_get_class(struct wl_proxy *proxy) { +MOZ_EXPORT const char* wl_proxy_get_class(struct wl_proxy* proxy) { return NULL; } -MOZ_EXPORT void wl_proxy_set_queue(struct wl_proxy *proxy, - struct wl_event_queue *queue) {} +MOZ_EXPORT void wl_proxy_set_queue(struct wl_proxy* proxy, + struct wl_event_queue* queue) {} -MOZ_EXPORT struct wl_display *wl_display_connect(const char *name) { +MOZ_EXPORT struct wl_display* wl_display_connect(const char* name) { return NULL; } -MOZ_EXPORT struct wl_display *wl_display_connect_to_fd(int fd) { return NULL; } +MOZ_EXPORT struct wl_display* wl_display_connect_to_fd(int fd) { return NULL; } -MOZ_EXPORT void wl_display_disconnect(struct wl_display *display) {} +MOZ_EXPORT void wl_display_disconnect(struct wl_display* display) {} -MOZ_EXPORT int wl_display_get_fd(struct wl_display *display) { return -1; } +MOZ_EXPORT int wl_display_get_fd(struct wl_display* display) { return -1; } -MOZ_EXPORT int wl_display_dispatch(struct wl_display *display) { return -1; } +MOZ_EXPORT int wl_display_dispatch(struct wl_display* display) { return -1; } -MOZ_EXPORT int wl_display_dispatch_queue(struct wl_display *display, - struct wl_event_queue *queue) { +MOZ_EXPORT int wl_display_dispatch_queue(struct wl_display* display, + struct wl_event_queue* queue) { return -1; } -MOZ_EXPORT int wl_display_dispatch_queue_pending(struct wl_display *display, - struct wl_event_queue *queue) { +MOZ_EXPORT int wl_display_dispatch_queue_pending(struct wl_display* display, + struct wl_event_queue* queue) { return -1; } -MOZ_EXPORT int wl_display_dispatch_pending(struct wl_display *display) { +MOZ_EXPORT int wl_display_dispatch_pending(struct wl_display* display) { return -1; } -MOZ_EXPORT int wl_display_get_error(struct wl_display *display) { return -1; } +MOZ_EXPORT int wl_display_get_error(struct wl_display* display) { return -1; } MOZ_EXPORT uint32_t wl_display_get_protocol_error( - struct wl_display *display, const struct wl_interface **interface, - uint32_t *id) { + struct wl_display* display, const struct wl_interface** interface, + uint32_t* id) { return -1; } -MOZ_EXPORT int wl_display_flush(struct wl_display *display) { return -1; } +MOZ_EXPORT int wl_display_flush(struct wl_display* display) { return -1; } -MOZ_EXPORT int wl_display_roundtrip_queue(struct wl_display *display, - struct wl_event_queue *queue) { +MOZ_EXPORT int wl_display_roundtrip_queue(struct wl_display* display, + struct wl_event_queue* queue) { return -1; } -MOZ_EXPORT int wl_display_roundtrip(struct wl_display *display) { return -1; } +MOZ_EXPORT int wl_display_roundtrip(struct wl_display* display) { return -1; } -MOZ_EXPORT struct wl_event_queue *wl_display_create_queue( - struct wl_display *display) { +MOZ_EXPORT struct wl_event_queue* wl_display_create_queue( + struct wl_display* display) { return NULL; } -MOZ_EXPORT int wl_display_prepare_read_queue(struct wl_display *display, - struct wl_event_queue *queue) { +MOZ_EXPORT int wl_display_prepare_read_queue(struct wl_display* display, + struct wl_event_queue* queue) { return -1; } -MOZ_EXPORT int wl_display_prepare_read(struct wl_display *display) { +MOZ_EXPORT int wl_display_prepare_read(struct wl_display* display) { return -1; } -MOZ_EXPORT void wl_display_cancel_read(struct wl_display *display) {} +MOZ_EXPORT void wl_display_cancel_read(struct wl_display* display) {} -MOZ_EXPORT int wl_display_read_events(struct wl_display *display) { return -1; } +MOZ_EXPORT int wl_display_read_events(struct wl_display* display) { return -1; } MOZ_EXPORT void wl_log_set_handler_client(wl_log_func_t handler) {} -MOZ_EXPORT struct wl_egl_window *wl_egl_window_create( - struct wl_surface *surface, int width, int height) { +MOZ_EXPORT struct wl_egl_window* wl_egl_window_create( + struct wl_surface* surface, int width, int height) { return NULL; } -MOZ_EXPORT void wl_egl_window_destroy(struct wl_egl_window *egl_window) {} +MOZ_EXPORT void wl_egl_window_destroy(struct wl_egl_window* egl_window) {} -MOZ_EXPORT void wl_egl_window_resize(struct wl_egl_window *egl_window, +MOZ_EXPORT void wl_egl_window_resize(struct wl_egl_window* egl_window, int width, int height, int dx, int dy) {} diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h index 92bd84188ea0f..2c8b8280a05c4 100644 --- a/widget/gtk/mozwayland/mozwayland.h +++ b/widget/gtk/mozwayland/mozwayland.h @@ -20,12 +20,12 @@ extern "C" { #endif -MOZ_EXPORT int wl_display_roundtrip_queue(struct wl_display *display, - struct wl_event_queue *queue); -MOZ_EXPORT uint32_t wl_proxy_get_version(struct wl_proxy *proxy); -MOZ_EXPORT struct wl_proxy *wl_proxy_marshal_constructor( - struct wl_proxy *proxy, uint32_t opcode, - const struct wl_interface *interface, ...); +MOZ_EXPORT int wl_display_roundtrip_queue(struct wl_display* display, + struct wl_event_queue* queue); +MOZ_EXPORT uint32_t wl_proxy_get_version(struct wl_proxy* proxy); +MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_constructor( + struct wl_proxy* proxy, uint32_t opcode, + const struct wl_interface* interface, ...); /* We need implement some missing functions from wayland-client-protocol.h */ @@ -42,18 +42,18 @@ enum wl_data_device_manager_dnd_action { # define WL_DATA_OFFER_SET_ACTIONS 4 struct moz_wl_data_offer_listener { - void (*offer)(void *data, struct wl_data_offer *wl_data_offer, - const char *mime_type); - void (*source_actions)(void *data, struct wl_data_offer *wl_data_offer, + void (*offer)(void* data, struct wl_data_offer* wl_data_offer, + const char* mime_type); + void (*source_actions)(void* data, struct wl_data_offer* wl_data_offer, uint32_t source_actions); - void (*action)(void *data, struct wl_data_offer *wl_data_offer, + void (*action)(void* data, struct wl_data_offer* wl_data_offer, uint32_t dnd_action); }; static inline void wl_data_offer_set_actions( - struct wl_data_offer *wl_data_offer, uint32_t dnd_actions, + struct wl_data_offer* wl_data_offer, uint32_t dnd_actions, uint32_t preferred_action) { - wl_proxy_marshal((struct wl_proxy *)wl_data_offer, WL_DATA_OFFER_SET_ACTIONS, + wl_proxy_marshal((struct wl_proxy*)wl_data_offer, WL_DATA_OFFER_SET_ACTIONS, dnd_actions, preferred_action); } #else @@ -78,33 +78,33 @@ extern const struct wl_interface wl_subcompositor_interface; # define WL_SUBSURFACE_SET_SYNC 4 # define WL_SUBSURFACE_SET_DESYNC 5 -static inline struct wl_subsurface *wl_subcompositor_get_subsurface( - struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, - struct wl_surface *parent) { - struct wl_proxy *id; +static inline struct wl_subsurface* wl_subcompositor_get_subsurface( + struct wl_subcompositor* wl_subcompositor, struct wl_surface* surface, + struct wl_surface* parent) { + struct wl_proxy* id; id = wl_proxy_marshal_constructor( - (struct wl_proxy *)wl_subcompositor, WL_SUBCOMPOSITOR_GET_SUBSURFACE, + (struct wl_proxy*)wl_subcompositor, WL_SUBCOMPOSITOR_GET_SUBSURFACE, &wl_subsurface_interface, NULL, surface, parent); - return (struct wl_subsurface *)id; + return (struct wl_subsurface*)id; } static inline void wl_subsurface_set_position( - struct wl_subsurface *wl_subsurface, int32_t x, int32_t y) { - wl_proxy_marshal((struct wl_proxy *)wl_subsurface, WL_SUBSURFACE_SET_POSITION, + struct wl_subsurface* wl_subsurface, int32_t x, int32_t y) { + wl_proxy_marshal((struct wl_proxy*)wl_subsurface, WL_SUBSURFACE_SET_POSITION, x, y); } static inline void wl_subsurface_set_desync( - struct wl_subsurface *wl_subsurface) { - wl_proxy_marshal((struct wl_proxy *)wl_subsurface, WL_SUBSURFACE_SET_DESYNC); + struct wl_subsurface* wl_subsurface) { + wl_proxy_marshal((struct wl_proxy*)wl_subsurface, WL_SUBSURFACE_SET_DESYNC); } -static inline void wl_subsurface_destroy(struct wl_subsurface *wl_subsurface) { - wl_proxy_marshal((struct wl_proxy *)wl_subsurface, WL_SUBSURFACE_DESTROY); +static inline void wl_subsurface_destroy(struct wl_subsurface* wl_subsurface) { + wl_proxy_marshal((struct wl_proxy*)wl_subsurface, WL_SUBSURFACE_DESTROY); - wl_proxy_destroy((struct wl_proxy *)wl_subsurface); + wl_proxy_destroy((struct wl_proxy*)wl_subsurface); } #endif diff --git a/widget/gtk/nsAppShell.h b/widget/gtk/nsAppShell.h index 3852163431b58..06543ee955447 100644 --- a/widget/gtk/nsAppShell.h +++ b/widget/gtk/nsAppShell.h @@ -24,7 +24,7 @@ class nsAppShell : public nsBaseAppShell { private: virtual ~nsAppShell(); - static gboolean EventProcessorCallback(GIOChannel *source, + static gboolean EventProcessorCallback(GIOChannel* source, GIOCondition condition, gpointer data); int mPipeFDs[2]; diff --git a/widget/gtk/nsBidiKeyboard.cpp b/widget/gtk/nsBidiKeyboard.cpp index a5ef8910b01d9..e6a2c7f871a72 100644 --- a/widget/gtk/nsBidiKeyboard.cpp +++ b/widget/gtk/nsBidiKeyboard.cpp @@ -21,10 +21,10 @@ nsBidiKeyboard::Reset() { // simply assume that we don't have bidi keyboards. mHaveBidiKeyboards = false; - GdkDisplay *display = gdk_display_get_default(); + GdkDisplay* display = gdk_display_get_default(); if (!display) return NS_OK; - GdkKeymap *keymap = gdk_keymap_get_for_display(display); + GdkKeymap* keymap = gdk_keymap_get_for_display(display); mHaveBidiKeyboards = keymap && gdk_keymap_have_bidi_layouts(keymap); return NS_OK; } @@ -32,7 +32,7 @@ nsBidiKeyboard::Reset() { nsBidiKeyboard::~nsBidiKeyboard() {} NS_IMETHODIMP -nsBidiKeyboard::IsLangRTL(bool *aIsRTL) { +nsBidiKeyboard::IsLangRTL(bool* aIsRTL) { if (!mHaveBidiKeyboards) return NS_ERROR_FAILURE; *aIsRTL = (gdk_keymap_get_direction(gdk_keymap_get_default()) == @@ -41,7 +41,7 @@ nsBidiKeyboard::IsLangRTL(bool *aIsRTL) { return NS_OK; } -NS_IMETHODIMP nsBidiKeyboard::GetHaveBidiKeyboards(bool *aResult) { +NS_IMETHODIMP nsBidiKeyboard::GetHaveBidiKeyboards(bool* aResult) { // not implemented yet return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/widget/gtk/nsCUPSShim.cpp b/widget/gtk/nsCUPSShim.cpp index 3f2557e2d4ba4..b244941d37b58 100644 --- a/widget/gtk/nsCUPSShim.cpp +++ b/widget/gtk/nsCUPSShim.cpp @@ -24,10 +24,9 @@ bool nsCUPSShim::Init() { if (!mCupsLib) return false; // List of symbol pointers. Must match gSymName[] defined above. - void **symAddr[] = { - (void **)&mCupsAddOption, (void **)&mCupsFreeDests, - (void **)&mCupsGetDest, (void **)&mCupsGetDests, - (void **)&mCupsPrintFile, (void **)&mCupsTempFd, + void** symAddr[] = { + (void**)&mCupsAddOption, (void**)&mCupsFreeDests, (void**)&mCupsGetDest, + (void**)&mCupsGetDests, (void**)&mCupsPrintFile, (void**)&mCupsTempFd, }; for (int i = gSymNameCt; i--;) { diff --git a/widget/gtk/nsCUPSShim.h b/widget/gtk/nsCUPSShim.h index 77aeb9d98980d..687f3b67531a3 100644 --- a/widget/gtk/nsCUPSShim.h +++ b/widget/gtk/nsCUPSShim.h @@ -13,8 +13,8 @@ */ typedef struct /**** Printer Options ****/ { - char *name; /* Name of option */ - char *value; /* Value of option */ + char* name; /* Name of option */ + char* value; /* Value of option */ } cups_option_t; typedef struct /**** Destination ****/ @@ -23,20 +23,20 @@ typedef struct /**** Destination ****/ *instance; /* Local instance name or nullptr */ int is_default; /* Is this printer the default? */ int num_options; /* Number of options */ - cups_option_t *options; /* Options */ + cups_option_t* options; /* Options */ } cups_dest_t; -typedef cups_dest_t *(*CupsGetDestType)(const char *printer, - const char *instance, int num_dests, - cups_dest_t *dests); -typedef int (*CupsGetDestsType)(cups_dest_t **dests); -typedef int (*CupsFreeDestsType)(int num_dests, cups_dest_t *dests); -typedef int (*CupsPrintFileType)(const char *printer, const char *filename, - const char *title, int num_options, - cups_option_t *options); -typedef int (*CupsTempFdType)(char *filename, int length); -typedef int (*CupsAddOptionType)(const char *name, const char *value, - int num_options, cups_option_t **options); +typedef cups_dest_t* (*CupsGetDestType)(const char* printer, + const char* instance, int num_dests, + cups_dest_t* dests); +typedef int (*CupsGetDestsType)(cups_dest_t** dests); +typedef int (*CupsFreeDestsType)(int num_dests, cups_dest_t* dests); +typedef int (*CupsPrintFileType)(const char* printer, const char* filename, + const char* title, int num_options, + cups_option_t* options); +typedef int (*CupsTempFdType)(char* filename, int length); +typedef int (*CupsAddOptionType)(const char* name, const char* value, + int num_options, cups_option_t** options); struct PRLibrary; @@ -70,7 +70,7 @@ class nsCUPSShim { CupsTempFdType mCupsTempFd; private: - PRLibrary *mCupsLib; + PRLibrary* mCupsLib; }; #endif /* nsCUPSShim_h___ */ diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp index e1cd6e48c9d7f..5a6043b300495 100644 --- a/widget/gtk/nsClipboard.cpp +++ b/widget/gtk/nsClipboard.cpp @@ -45,18 +45,18 @@ static const char kHTMLMarkupPrefix[] = R"()"; // Callback when someone asks us for the data -void clipboard_get_cb(GtkClipboard *aGtkClipboard, - GtkSelectionData *aSelectionData, guint info, +void clipboard_get_cb(GtkClipboard* aGtkClipboard, + GtkSelectionData* aSelectionData, guint info, gpointer user_data); // Callback when someone asks us to clear a clipboard -void clipboard_clear_cb(GtkClipboard *aGtkClipboard, gpointer user_data); +void clipboard_clear_cb(GtkClipboard* aGtkClipboard, gpointer user_data); -static void ConvertHTMLtoUCS2(const char *data, int32_t dataLength, - char16_t **unicodeData, int32_t &outUnicodeLen); +static void ConvertHTMLtoUCS2(const char* data, int32_t dataLength, + char16_t** unicodeData, int32_t& outUnicodeLen); -static void GetHTMLCharset(const char *data, int32_t dataLength, - nsCString &str); +static void GetHTMLCharset(const char* data, int32_t dataLength, + nsCString& str); GdkAtom GetSelectionAtom(int32_t aWhichClipboard) { if (aWhichClipboard == nsIClipboard::kGlobalClipboard) @@ -81,7 +81,7 @@ nsClipboard::~nsClipboard() { NS_IMPL_ISUPPORTS(nsClipboard, nsIClipboard, nsIObserver) nsresult nsClipboard::Init(void) { - GdkDisplay *display = gdk_display_get_default(); + GdkDisplay* display = gdk_display_get_default(); // Create a nsRetrievalContext. If there's no default display // create the X11 one as a fallback. @@ -105,21 +105,21 @@ nsresult nsClipboard::Init(void) { nsresult nsClipboard::Store(void) { if (mGlobalTransferable) { - GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); gtk_clipboard_store(clipboard); } return NS_OK; } NS_IMETHODIMP -nsClipboard::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsClipboard::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { Store(); return NS_OK; } NS_IMETHODIMP -nsClipboard::SetData(nsITransferable *aTransferable, nsIClipboardOwner *aOwner, +nsClipboard::SetData(nsITransferable* aTransferable, nsIClipboardOwner* aOwner, int32_t aWhichClipboard) { // See if we can short cut if ((aWhichClipboard == kGlobalClipboard && @@ -135,7 +135,7 @@ nsClipboard::SetData(nsITransferable *aTransferable, nsIClipboardOwner *aOwner, EmptyClipboard(aWhichClipboard); // List of suported targets - GtkTargetList *list = gtk_target_list_new(nullptr, 0); + GtkTargetList* list = gtk_target_list_new(nullptr, 0); // Get the types of supported flavors nsTArray flavors; @@ -147,7 +147,7 @@ nsClipboard::SetData(nsITransferable *aTransferable, nsIClipboardOwner *aOwner, // Add all the flavors to this widget's supported type. bool imagesAdded = false; for (uint32_t i = 0; i < flavors.Length(); i++) { - nsCString &flavorStr = flavors[i]; + nsCString& flavorStr = flavors[i]; // Special case text/unicode since we can handle all of the string types. if (flavorStr.EqualsLiteral(kUnicodeMime)) { @@ -171,11 +171,11 @@ nsClipboard::SetData(nsITransferable *aTransferable, nsIClipboardOwner *aOwner, } // Get GTK clipboard (CLIPBOARD or PRIMARY) - GtkClipboard *gtkClipboard = + GtkClipboard* gtkClipboard = gtk_clipboard_get(GetSelectionAtom(aWhichClipboard)); gint numTargets; - GtkTargetEntry *gtkTargets = + GtkTargetEntry* gtkTargets = gtk_target_table_new_from_list(list, &numTargets); // Set getcallback and request to store data after an application exit @@ -205,9 +205,9 @@ nsClipboard::SetData(nsITransferable *aTransferable, nsIClipboardOwner *aOwner, return rv; } -void nsClipboard::SetTransferableData(nsITransferable *aTransferable, - nsCString &aFlavor, - const char *aClipboardData, +void nsClipboard::SetTransferableData(nsITransferable* aTransferable, + nsCString& aFlavor, + const char* aClipboardData, uint32_t aClipboardDataLength) { nsCOMPtr wrapper; nsPrimitiveHelpers::CreatePrimitiveForData( @@ -216,7 +216,7 @@ void nsClipboard::SetTransferableData(nsITransferable *aTransferable, } NS_IMETHODIMP -nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) { +nsClipboard::GetData(nsITransferable* aTransferable, int32_t aWhichClipboard) { if (!aTransferable) return NS_ERROR_FAILURE; // Get a list of flavors this transferable can import @@ -227,7 +227,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) { } for (uint32_t i = 0; i < flavors.Length(); i++) { - nsCString &flavorStr = flavors[i]; + nsCString& flavorStr = flavors[i]; if (flavorStr.EqualsLiteral(kJPEGImageMime) || flavorStr.EqualsLiteral(kJPGImageMime) || @@ -239,7 +239,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) { } uint32_t clipboardDataLength; - const char *clipboardData = mContext->GetClipboardData( + const char* clipboardData = mContext->GetClipboardData( flavorStr.get(), aWhichClipboard, &clipboardDataLength); if (!clipboardData) continue; @@ -256,7 +256,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) { // Special case text/unicode since we can convert any // string into text/unicode if (flavorStr.EqualsLiteral(kUnicodeMime)) { - const char *clipboardData = mContext->GetClipboardText(aWhichClipboard); + const char* clipboardData = mContext->GetClipboardText(aWhichClipboard); if (!clipboardData) { // If the type was text/unicode and we couldn't get // text off the clipboard, run the next loop @@ -266,24 +266,24 @@ nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) { // Convert utf-8 into our unicode format. NS_ConvertUTF8toUTF16 ucs2string(clipboardData); - const char *unicodeData = (const char *)ToNewUnicode(ucs2string); + const char* unicodeData = (const char*)ToNewUnicode(ucs2string); uint32_t unicodeDataLength = ucs2string.Length() * 2; SetTransferableData(aTransferable, flavorStr, unicodeData, unicodeDataLength); - free((void *)unicodeData); + free((void*)unicodeData); mContext->ReleaseClipboardData(clipboardData); return NS_OK; } uint32_t clipboardDataLength; - const char *clipboardData = mContext->GetClipboardData( + const char* clipboardData = mContext->GetClipboardData( flavorStr.get(), aWhichClipboard, &clipboardDataLength); if (clipboardData) { // Special case text/html since we can convert into UCS2 if (flavorStr.EqualsLiteral(kHTMLMime)) { - char16_t *htmlBody = nullptr; + char16_t* htmlBody = nullptr; int32_t htmlBodyLen = 0; // Convert text/html into our unicode format ConvertHTMLtoUCS2(clipboardData, clipboardDataLength, &htmlBody, @@ -295,7 +295,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard) { continue; } - SetTransferableData(aTransferable, flavorStr, (const char *)htmlBody, + SetTransferableData(aTransferable, flavorStr, (const char*)htmlBody, htmlBodyLen * 2); free(htmlBody); } else { @@ -331,14 +331,14 @@ nsClipboard::EmptyClipboard(int32_t aWhichClipboard) { } NS_IMETHODIMP -nsClipboard::HasDataMatchingFlavors(const char **aFlavorList, uint32_t aLength, - int32_t aWhichClipboard, bool *_retval) { +nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength, + int32_t aWhichClipboard, bool* _retval) { if (!aFlavorList || !_retval) return NS_ERROR_NULL_POINTER; *_retval = false; int targetNums; - GdkAtom *targets = mContext->GetTargets(aWhichClipboard, &targetNums); + GdkAtom* targets = mContext->GetTargets(aWhichClipboard, &targetNums); if (!targets) return NS_OK; // Walk through the provided types and try to match it to a @@ -352,7 +352,7 @@ nsClipboard::HasDataMatchingFlavors(const char **aFlavorList, uint32_t aLength, } for (int32_t j = 0; j < targetNums; j++) { - gchar *atom_name = gdk_atom_name(targets[j]); + gchar* atom_name = gdk_atom_name(targets[j]); if (!atom_name) continue; if (!strcmp(atom_name, aFlavorList[i])) *_retval = true; @@ -375,19 +375,19 @@ nsClipboard::HasDataMatchingFlavors(const char **aFlavorList, uint32_t aLength, } NS_IMETHODIMP -nsClipboard::SupportsSelectionClipboard(bool *_retval) { +nsClipboard::SupportsSelectionClipboard(bool* _retval) { *_retval = mContext->HasSelectionSupport(); return NS_OK; } NS_IMETHODIMP -nsClipboard::SupportsFindClipboard(bool *_retval) { +nsClipboard::SupportsFindClipboard(bool* _retval) { *_retval = false; return NS_OK; } -nsITransferable *nsClipboard::GetTransferable(int32_t aWhichClipboard) { - nsITransferable *retval; +nsITransferable* nsClipboard::GetTransferable(int32_t aWhichClipboard) { + nsITransferable* retval; if (aWhichClipboard == kSelectionClipboard) retval = mSelectionTransferable.get(); @@ -397,8 +397,8 @@ nsITransferable *nsClipboard::GetTransferable(int32_t aWhichClipboard) { return retval; } -void nsClipboard::SelectionGetEvent(GtkClipboard *aClipboard, - GtkSelectionData *aSelectionData) { +void nsClipboard::SelectionGetEvent(GtkClipboard* aClipboard, + GtkSelectionData* aSelectionData) { // Someone has asked us to hand them something. The first thing // that we want to do is see if that something includes text. If // it does, try to give it text/unicode after converting it to @@ -456,7 +456,7 @@ void nsClipboard::SelectionGetEvent(GtkClipboard *aClipboard, // Check to see if the selection data is an image type if (gtk_targets_include_image(&selectionTarget, 1, TRUE)) { // Look through our transfer data for the image - static const char *const imageMimeTypes[] = {kNativeImageMime, + static const char* const imageMimeTypes[] = {kNativeImageMime, kPNGImageMime, kJPEGImageMime, kJPGImageMime, kGIFImageMime}; nsCOMPtr imageItem; @@ -477,7 +477,7 @@ void nsClipboard::SelectionGetEvent(GtkClipboard *aClipboard, return; } - GdkPixbuf *pixbuf = nsImageToPixbuf::ImageToPixbuf(image); + GdkPixbuf* pixbuf = nsImageToPixbuf::ImageToPixbuf(image); if (!pixbuf) return; gtk_selection_data_set_pixbuf(aSelectionData, pixbuf); @@ -506,13 +506,13 @@ void nsClipboard::SelectionGetEvent(GtkClipboard *aClipboard, AppendUTF16toUTF8(ucs2string, html); gtk_selection_data_set(aSelectionData, selectionTarget, 8, - (const guchar *)html.get(), html.Length()); + (const guchar*)html.get(), html.Length()); return; } // Try to match up the selection data target to something our // transferable provides. - gchar *target_name = gdk_atom_name(selectionTarget); + gchar* target_name = gdk_atom_name(selectionTarget); if (!target_name) return; rv = trans->GetTransferData(target_name, getter_AddRefs(item)); @@ -522,7 +522,7 @@ void nsClipboard::SelectionGetEvent(GtkClipboard *aClipboard, return; } - void *primitive_data = nullptr; + void* primitive_data = nullptr; uint32_t dataLen = 0; nsPrimitiveHelpers::CreateDataFromPrimitive(nsDependentCString(target_name), item, &primitive_data, &dataLen); @@ -530,14 +530,14 @@ void nsClipboard::SelectionGetEvent(GtkClipboard *aClipboard, if (primitive_data) { gtk_selection_data_set(aSelectionData, selectionTarget, 8, /* 8 bits in a unit */ - (const guchar *)primitive_data, dataLen); + (const guchar*)primitive_data, dataLen); free(primitive_data); } g_free(target_name); } -void nsClipboard::SelectionClearEvent(GtkClipboard *aGtkClipboard) { +void nsClipboard::SelectionClearEvent(GtkClipboard* aGtkClipboard) { int32_t whichClipboard; // which clipboard? @@ -551,15 +551,15 @@ void nsClipboard::SelectionClearEvent(GtkClipboard *aGtkClipboard) { EmptyClipboard(whichClipboard); } -void clipboard_get_cb(GtkClipboard *aGtkClipboard, - GtkSelectionData *aSelectionData, guint info, +void clipboard_get_cb(GtkClipboard* aGtkClipboard, + GtkSelectionData* aSelectionData, guint info, gpointer user_data) { - nsClipboard *aClipboard = static_cast(user_data); + nsClipboard* aClipboard = static_cast(user_data); aClipboard->SelectionGetEvent(aGtkClipboard, aSelectionData); } -void clipboard_clear_cb(GtkClipboard *aGtkClipboard, gpointer user_data) { - nsClipboard *aClipboard = static_cast(user_data); +void clipboard_clear_cb(GtkClipboard* aGtkClipboard, gpointer user_data) { + nsClipboard* aClipboard = static_cast(user_data); aClipboard->SelectionClearEvent(aGtkClipboard); } @@ -582,13 +582,13 @@ void clipboard_clear_cb(GtkClipboard *aGtkClipboard, gpointer user_data) { * body : pass to Mozilla * bodyLength: pass to Mozilla */ -void ConvertHTMLtoUCS2(const char *data, int32_t dataLength, - char16_t **unicodeData, int32_t &outUnicodeLen) { +void ConvertHTMLtoUCS2(const char* data, int32_t dataLength, + char16_t** unicodeData, int32_t& outUnicodeLen) { nsAutoCString charset; GetHTMLCharset(data, dataLength, charset); // get charset of HTML if (charset.EqualsLiteral("UTF-16")) { // current mozilla outUnicodeLen = (dataLength / 2) - 1; - *unicodeData = reinterpret_cast( + *unicodeData = reinterpret_cast( moz_xmalloc((outUnicodeLen + sizeof('\0')) * sizeof(char16_t))); memcpy(*unicodeData, data + sizeof(char16_t), outUnicodeLen * sizeof(char16_t)); @@ -627,7 +627,7 @@ void ConvertHTMLtoUCS2(const char *data, int32_t dataLength, outUnicodeLen = 0; if (needed.value()) { - *unicodeData = reinterpret_cast( + *unicodeData = reinterpret_cast( moz_xmalloc((needed.value() + 1) * sizeof(char16_t))); uint32_t result; size_t read; @@ -653,9 +653,9 @@ void ConvertHTMLtoUCS2(const char *data, int32_t dataLength, * 2. "UNKNOWN": mozilla can't detect what encode it use * 3. other: "text/html" with other charset than utf-16 */ -void GetHTMLCharset(const char *data, int32_t dataLength, nsCString &str) { +void GetHTMLCharset(const char* data, int32_t dataLength, nsCString& str) { // if detect "FFFE" or "FEFF", assume UTF-16 - char16_t *beginChar = (char16_t *)data; + char16_t* beginChar = (char16_t*)data; if ((beginChar[0] == 0xFFFE) || (beginChar[0] == 0xFEFF)) { str.AssignLiteral("UTF-16"); return; diff --git a/widget/gtk/nsClipboardWayland.cpp b/widget/gtk/nsClipboardWayland.cpp index 1bfaddce46618..7b935ea069046 100644 --- a/widget/gtk/nsClipboardWayland.cpp +++ b/widget/gtk/nsClipboardWayland.cpp @@ -35,7 +35,7 @@ #include #include -const char *nsRetrievalContextWayland::sTextMimeTypes[TEXT_MIME_TYPES_NUM] = { +const char* nsRetrievalContextWayland::sTextMimeTypes[TEXT_MIME_TYPES_NUM] = { "text/plain;charset=utf-8", "UTF8_STRING", "COMPOUND_TEXT"}; static inline GdkDragAction wl_to_gdk_actions(uint32_t dnd_actions) { @@ -60,9 +60,9 @@ static inline uint32_t gdk_to_wl_actions(GdkDragAction action) { return dnd_actions; } -static GtkWidget *get_gtk_widget_for_wl_surface(struct wl_surface *surface) { - GdkWindow *gdkParentWindow = - static_cast(wl_surface_get_user_data(surface)); +static GtkWidget* get_gtk_widget_for_wl_surface(struct wl_surface* surface) { + GdkWindow* gdkParentWindow = + static_cast(wl_surface_get_user_data(surface)); gpointer user_data = nullptr; gdk_window_get_user_data(gdkParentWindow, &user_data); @@ -70,20 +70,20 @@ static GtkWidget *get_gtk_widget_for_wl_surface(struct wl_surface *surface) { return GTK_WIDGET(user_data); } -void DataOffer::AddMIMEType(const char *aMimeType) { +void DataOffer::AddMIMEType(const char* aMimeType) { GdkAtom atom = gdk_atom_intern(aMimeType, FALSE); mTargetMIMETypes.AppendElement(atom); } -GdkAtom *DataOffer::GetTargets(int *aTargetNum) { +GdkAtom* DataOffer::GetTargets(int* aTargetNum) { int length = mTargetMIMETypes.Length(); if (!length) { *aTargetNum = 0; return nullptr; } - GdkAtom *targetList = - reinterpret_cast(g_malloc(sizeof(GdkAtom) * length)); + GdkAtom* targetList = + reinterpret_cast(g_malloc(sizeof(GdkAtom) * length)); for (int32_t j = 0; j < length; j++) { targetList[j] = mTargetMIMETypes[j]; } @@ -92,7 +92,7 @@ GdkAtom *DataOffer::GetTargets(int *aTargetNum) { return targetList; } -bool DataOffer::HasTarget(const char *aMimeType) { +bool DataOffer::HasTarget(const char* aMimeType) { int length = mTargetMIMETypes.Length(); for (int32_t j = 0; j < length; j++) { if (mTargetMIMETypes[j] == gdk_atom_intern(aMimeType, FALSE)) return true; @@ -100,8 +100,8 @@ bool DataOffer::HasTarget(const char *aMimeType) { return false; } -char *DataOffer::GetData(wl_display *aDisplay, const char *aMimeType, - uint32_t *aContentLength) { +char* DataOffer::GetData(wl_display* aDisplay, const char* aMimeType, + uint32_t* aContentLength) { int pipe_fd[2]; if (pipe(pipe_fd) == -1) return nullptr; @@ -126,9 +126,9 @@ char *DataOffer::GetData(wl_display *aDisplay, const char *aMimeType, return nullptr; } - GIOChannel *channel = g_io_channel_unix_new(pipe_fd[0]); - GError *error = nullptr; - char *clipboardData = nullptr; + GIOChannel* channel = g_io_channel_unix_new(pipe_fd[0]); + GError* error = nullptr; + char* clipboardData = nullptr; g_io_channel_set_encoding(channel, nullptr, &error); if (!error) { @@ -139,7 +139,7 @@ char *DataOffer::GetData(wl_display *aDisplay, const char *aMimeType, // g_io_channel_read_to_end() allocated clipboardData for us. // Release it now and return nullptr to indicate // we don't have reqested data flavour. - g_free((void *)clipboardData); + g_free((void*)clipboardData); clipboardData = nullptr; } *aContentLength = length; @@ -159,7 +159,7 @@ char *DataOffer::GetData(wl_display *aDisplay, const char *aMimeType, return clipboardData; } -bool WaylandDataOffer::RequestDataTransfer(const char *aMimeType, int fd) { +bool WaylandDataOffer::RequestDataTransfer(const char* aMimeType, int fd) { if (mWaylandDataOffer) { wl_data_offer_receive(mWaylandDataOffer, aMimeType, fd); return true; @@ -168,7 +168,7 @@ bool WaylandDataOffer::RequestDataTransfer(const char *aMimeType, int fd) { return false; } -void WaylandDataOffer::DragOfferAccept(const char *aMimeType, uint32_t aTime) { +void WaylandDataOffer::DragOfferAccept(const char* aMimeType, uint32_t aTime) { wl_data_offer_accept(mWaylandDataOffer, aTime, aMimeType); } @@ -211,9 +211,9 @@ GdkDragAction WaylandDataOffer::GetAvailableDragActions() { return wl_to_gdk_actions(mAvailableDragAction); } -static void data_offer_offer(void *data, struct wl_data_offer *wl_data_offer, - const char *type) { - auto *offer = static_cast(data); +static void data_offer_offer(void* data, struct wl_data_offer* wl_data_offer, + const char* type) { + auto* offer = static_cast(data); offer->AddMIMEType(type); } @@ -221,19 +221,19 @@ static void data_offer_offer(void *data, struct wl_data_offer *wl_data_offer, * We don't use that but follow gdk_wayland_drag_context_commit_status() * from gdkdnd-wayland.c here. */ -static void data_offer_source_actions(void *data, - struct wl_data_offer *wl_data_offer, +static void data_offer_source_actions(void* data, + struct wl_data_offer* wl_data_offer, uint32_t source_actions) { - auto *offer = static_cast(data); + auto* offer = static_cast(data); offer->SetAvailableDragActions(source_actions); } /* Advertise recently selected drag and drop action by compositor, based * on source actions and user choice (key modifiers, etc.). */ -static void data_offer_action(void *data, struct wl_data_offer *wl_data_offer, +static void data_offer_action(void* data, struct wl_data_offer* wl_data_offer, uint32_t dnd_action) { - auto *offer = static_cast(data); + auto* offer = static_cast(data); offer->SetSelectedDragAction(dnd_action); } @@ -249,10 +249,10 @@ static void data_offer_action(void *data, struct wl_data_offer *wl_data_offer, static const moz_wl_data_offer_listener data_offer_listener = { data_offer_offer, data_offer_source_actions, data_offer_action}; -WaylandDataOffer::WaylandDataOffer(wl_data_offer *aWaylandDataOffer) +WaylandDataOffer::WaylandDataOffer(wl_data_offer* aWaylandDataOffer) : mWaylandDataOffer(aWaylandDataOffer) { wl_data_offer_add_listener( - mWaylandDataOffer, (struct wl_data_offer_listener *)&data_offer_listener, + mWaylandDataOffer, (struct wl_data_offer_listener*)&data_offer_listener, this); } @@ -262,7 +262,7 @@ WaylandDataOffer::~WaylandDataOffer(void) { } } -bool PrimaryDataOffer::RequestDataTransfer(const char *aMimeType, int fd) { +bool PrimaryDataOffer::RequestDataTransfer(const char* aMimeType, int fd) { if (mPrimaryDataOffer) { gtk_primary_selection_offer_receive(mPrimaryDataOffer, aMimeType, fd); return true; @@ -271,9 +271,9 @@ bool PrimaryDataOffer::RequestDataTransfer(const char *aMimeType, int fd) { } static void primary_data_offer( - void *data, gtk_primary_selection_offer *gtk_primary_selection_offer, - const char *mime_type) { - auto *offer = static_cast(data); + void* data, gtk_primary_selection_offer* gtk_primary_selection_offer, + const char* mime_type) { + auto* offer = static_cast(data); offer->AddMIMEType(mime_type); } @@ -286,7 +286,7 @@ static const struct gtk_primary_selection_offer_listener primary_selection_offer_listener = {primary_data_offer}; PrimaryDataOffer::PrimaryDataOffer( - gtk_primary_selection_offer *aPrimaryDataOffer) + gtk_primary_selection_offer* aPrimaryDataOffer) : mPrimaryDataOffer(aPrimaryDataOffer) { gtk_primary_selection_offer_add_listener( aPrimaryDataOffer, &primary_selection_offer_listener, this); @@ -300,8 +300,8 @@ PrimaryDataOffer::~PrimaryDataOffer(void) { NS_IMPL_ISUPPORTS(nsWaylandDragContext, nsISupports); -nsWaylandDragContext::nsWaylandDragContext(WaylandDataOffer *aDataOffer, - wl_display *aDisplay) +nsWaylandDragContext::nsWaylandDragContext(WaylandDataOffer* aDataOffer, + wl_display* aDisplay) : mDataOffer(aDataOffer), mDisplay(aDisplay), mTime(0), @@ -309,7 +309,7 @@ nsWaylandDragContext::nsWaylandDragContext(WaylandDataOffer *aDataOffer, mX(0), mY(0) {} -void nsWaylandDragContext::DropDataEnter(GtkWidget *aGtkWidget, uint32_t aTime, +void nsWaylandDragContext::DropDataEnter(GtkWidget* aGtkWidget, uint32_t aTime, nscoord aX, nscoord aY) { mTime = aTime; mGtkWidget = aGtkWidget; @@ -323,8 +323,8 @@ void nsWaylandDragContext::DropMotion(uint32_t aTime, nscoord aX, nscoord aY) { mY = aY; } -void nsWaylandDragContext::GetLastDropInfo(uint32_t *aTime, nscoord *aX, - nscoord *aY) { +void nsWaylandDragContext::GetLastDropInfo(uint32_t* aTime, nscoord* aX, + nscoord* aY) { *aTime = mTime; *aX = mX; *aY = mY; @@ -345,11 +345,11 @@ GdkDragAction nsWaylandDragContext::GetSelectedDragAction() { return gdkAction; } -GList *nsWaylandDragContext::GetTargets() { +GList* nsWaylandDragContext::GetTargets() { int targetNums; - GdkAtom *atoms = mDataOffer->GetTargets(&targetNums); + GdkAtom* atoms = mDataOffer->GetTargets(&targetNums); - GList *targetList = nullptr; + GList* targetList = nullptr; for (int i = 0; i < targetNums; i++) { targetList = g_list_append(targetList, GDK_ATOM_TO_POINTER(atoms[i])); } @@ -357,15 +357,15 @@ GList *nsWaylandDragContext::GetTargets() { return targetList; } -char *nsWaylandDragContext::GetData(const char *aMimeType, - uint32_t *aContentLength) { +char* nsWaylandDragContext::GetData(const char* aMimeType, + uint32_t* aContentLength) { mDataOffer->DragOfferAccept(aMimeType, mTime); return mDataOffer->GetData(mDisplay, aMimeType, aContentLength); } void nsRetrievalContextWayland::RegisterNewDataOffer( - wl_data_offer *aWaylandDataOffer) { - DataOffer *dataOffer = static_cast( + wl_data_offer* aWaylandDataOffer) { + DataOffer* dataOffer = static_cast( g_hash_table_lookup(mActiveOffers, aWaylandDataOffer)); MOZ_ASSERT( dataOffer == nullptr, @@ -378,8 +378,8 @@ void nsRetrievalContextWayland::RegisterNewDataOffer( } void nsRetrievalContextWayland::RegisterNewDataOffer( - gtk_primary_selection_offer *aPrimaryDataOffer) { - DataOffer *dataOffer = static_cast( + gtk_primary_selection_offer* aPrimaryDataOffer) { + DataOffer* dataOffer = static_cast( g_hash_table_lookup(mActiveOffers, aPrimaryDataOffer)); MOZ_ASSERT( dataOffer == nullptr, @@ -392,14 +392,14 @@ void nsRetrievalContextWayland::RegisterNewDataOffer( } void nsRetrievalContextWayland::SetClipboardDataOffer( - wl_data_offer *aWaylandDataOffer) { + wl_data_offer* aWaylandDataOffer) { // Delete existing clipboard data offer mClipboardOffer = nullptr; // null aWaylandDataOffer indicates that our clipboard content // is no longer valid and should be release. if (aWaylandDataOffer != nullptr) { - DataOffer *dataOffer = static_cast( + DataOffer* dataOffer = static_cast( g_hash_table_lookup(mActiveOffers, aWaylandDataOffer)); NS_ASSERTION(dataOffer, "We're missing stored clipboard data offer!"); if (dataOffer) { @@ -410,14 +410,14 @@ void nsRetrievalContextWayland::SetClipboardDataOffer( } void nsRetrievalContextWayland::SetPrimaryDataOffer( - gtk_primary_selection_offer *aPrimaryDataOffer) { + gtk_primary_selection_offer* aPrimaryDataOffer) { // Release any primary offer we have. mPrimaryOffer = nullptr; // aPrimaryDataOffer can be null which means we lost // the mouse selection. if (aPrimaryDataOffer) { - DataOffer *dataOffer = static_cast( + DataOffer* dataOffer = static_cast( g_hash_table_lookup(mActiveOffers, aPrimaryDataOffer)); NS_ASSERTION(dataOffer, "We're missing primary data offer!"); if (dataOffer) { @@ -428,11 +428,11 @@ void nsRetrievalContextWayland::SetPrimaryDataOffer( } void nsRetrievalContextWayland::AddDragAndDropDataOffer( - wl_data_offer *aDropDataOffer) { + wl_data_offer* aDropDataOffer) { // Remove any existing D&D contexts. mDragContext = nullptr; - WaylandDataOffer *dataOffer = static_cast( + WaylandDataOffer* dataOffer = static_cast( g_hash_table_lookup(mActiveOffers, aDropDataOffer)); NS_ASSERTION(dataOffer, "We're missing drag and drop data offer!"); if (dataOffer) { @@ -441,7 +441,7 @@ void nsRetrievalContextWayland::AddDragAndDropDataOffer( } } -nsWaylandDragContext *nsRetrievalContextWayland::GetDragContext(void) { +nsWaylandDragContext* nsRetrievalContextWayland::GetDragContext(void) { return mDragContext; } @@ -451,63 +451,63 @@ void nsRetrievalContextWayland::ClearDragAndDropDataOffer(void) { // We have a new fresh data content. // We should attach listeners to it and save for further use. -static void data_device_data_offer(void *data, - struct wl_data_device *data_device, - struct wl_data_offer *offer) { - nsRetrievalContextWayland *context = - static_cast(data); +static void data_device_data_offer(void* data, + struct wl_data_device* data_device, + struct wl_data_offer* offer) { + nsRetrievalContextWayland* context = + static_cast(data); context->RegisterNewDataOffer(offer); } // The new fresh data content is clipboard. -static void data_device_selection(void *data, - struct wl_data_device *wl_data_device, - struct wl_data_offer *offer) { - nsRetrievalContextWayland *context = - static_cast(data); +static void data_device_selection(void* data, + struct wl_data_device* wl_data_device, + struct wl_data_offer* offer) { + nsRetrievalContextWayland* context = + static_cast(data); context->SetClipboardDataOffer(offer); } // The new fresh wayland data content is drag and drop. -static void data_device_enter(void *data, struct wl_data_device *data_device, - uint32_t time, struct wl_surface *surface, +static void data_device_enter(void* data, struct wl_data_device* data_device, + uint32_t time, struct wl_surface* surface, int32_t x_fixed, int32_t y_fixed, - struct wl_data_offer *offer) { - nsRetrievalContextWayland *context = - static_cast(data); + struct wl_data_offer* offer) { + nsRetrievalContextWayland* context = + static_cast(data); context->AddDragAndDropDataOffer(offer); - nsWaylandDragContext *dragContext = context->GetDragContext(); + nsWaylandDragContext* dragContext = context->GetDragContext(); - GtkWidget *gtkWidget = get_gtk_widget_for_wl_surface(surface); + GtkWidget* gtkWidget = get_gtk_widget_for_wl_surface(surface); if (!gtkWidget) { NS_WARNING("DragAndDrop: Unable to get GtkWidget for wl_surface!"); return; } - LOGDRAG(("nsWindow data_device_enter for GtkWidget %p\n", (void *)gtkWidget)); + LOGDRAG(("nsWindow data_device_enter for GtkWidget %p\n", (void*)gtkWidget)); dragContext->DropDataEnter(gtkWidget, time, wl_fixed_to_int(x_fixed), wl_fixed_to_int(y_fixed)); } -static void data_device_leave(void *data, struct wl_data_device *data_device) { - nsRetrievalContextWayland *context = - static_cast(data); +static void data_device_leave(void* data, struct wl_data_device* data_device) { + nsRetrievalContextWayland* context = + static_cast(data); - nsWaylandDragContext *dropContext = context->GetDragContext(); + nsWaylandDragContext* dropContext = context->GetDragContext(); WindowDragLeaveHandler(dropContext->GetWidget()); context->ClearDragAndDropDataOffer(); } -static void data_device_motion(void *data, struct wl_data_device *data_device, +static void data_device_motion(void* data, struct wl_data_device* data_device, uint32_t time, int32_t x_fixed, int32_t y_fixed) { - nsRetrievalContextWayland *context = - static_cast(data); + nsRetrievalContextWayland* context = + static_cast(data); - nsWaylandDragContext *dropContext = context->GetDragContext(); + nsWaylandDragContext* dropContext = context->GetDragContext(); nscoord x = wl_fixed_to_int(x_fixed); nscoord y = wl_fixed_to_int(y_fixed); @@ -517,11 +517,11 @@ static void data_device_motion(void *data, struct wl_data_device *data_device, time); } -static void data_device_drop(void *data, struct wl_data_device *data_device) { - nsRetrievalContextWayland *context = - static_cast(data); +static void data_device_drop(void* data, struct wl_data_device* data_device) { + nsRetrievalContextWayland* context = + static_cast(data); - nsWaylandDragContext *dropContext = context->GetDragContext(); + nsWaylandDragContext* dropContext = context->GetDragContext(); uint32_t time; nscoord x, y; @@ -557,21 +557,21 @@ static const struct wl_data_device_listener data_device_listener = { data_device_motion, data_device_drop, data_device_selection}; static void primary_selection_data_offer( - void *data, - struct gtk_primary_selection_device *gtk_primary_selection_device, - struct gtk_primary_selection_offer *gtk_primary_offer) { + void* data, + struct gtk_primary_selection_device* gtk_primary_selection_device, + struct gtk_primary_selection_offer* gtk_primary_offer) { // create and add listener - nsRetrievalContextWayland *context = - static_cast(data); + nsRetrievalContextWayland* context = + static_cast(data); context->RegisterNewDataOffer(gtk_primary_offer); } static void primary_selection_selection( - void *data, - struct gtk_primary_selection_device *gtk_primary_selection_device, - struct gtk_primary_selection_offer *gtk_primary_offer) { - nsRetrievalContextWayland *context = - static_cast(data); + void* data, + struct gtk_primary_selection_device* gtk_primary_selection_device, + struct gtk_primary_selection_offer* gtk_primary_offer) { + nsRetrievalContextWayland* context = + static_cast(data); context->SetPrimaryDataOffer(gtk_primary_offer); } @@ -608,14 +608,14 @@ nsRetrievalContextWayland::nsRetrievalContextWayland(void) mClipboardRequestNumber(0), mClipboardData(nullptr), mClipboardDataLength(0) { - wl_data_device *dataDevice = wl_data_device_manager_get_data_device( + wl_data_device* dataDevice = wl_data_device_manager_get_data_device( mDisplay->GetDataDeviceManager(), mDisplay->GetSeat()); wl_data_device_add_listener(dataDevice, &data_device_listener, this); - gtk_primary_selection_device_manager *manager = + gtk_primary_selection_device_manager* manager = mDisplay->GetPrimarySelectionDeviceManager(); if (manager) { - gtk_primary_selection_device *primaryDataDevice = + gtk_primary_selection_device* primaryDataDevice = gtk_primary_selection_device_manager_get_device(manager, mDisplay->GetSeat()); gtk_primary_selection_device_add_listener( @@ -632,7 +632,7 @@ static gboolean offer_hash_remove(gpointer wl_offer, gpointer aDataOffer, aDataOffer); NS_WARNING(msg.get()); #endif - delete static_cast(aDataOffer); + delete static_cast(aDataOffer); return true; } @@ -641,8 +641,8 @@ nsRetrievalContextWayland::~nsRetrievalContextWayland(void) { g_hash_table_destroy(mActiveOffers); } -GdkAtom *nsRetrievalContextWayland::GetTargets(int32_t aWhichClipboard, - int *aTargetNum) { +GdkAtom* nsRetrievalContextWayland::GetTargets(int32_t aWhichClipboard, + int* aTargetNum) { if (GetSelectionAtom(aWhichClipboard) == GDK_SELECTION_CLIPBOARD) { if (mClipboardOffer) { return mClipboardOffer->GetTargets(aTargetNum); @@ -659,29 +659,29 @@ GdkAtom *nsRetrievalContextWayland::GetTargets(int32_t aWhichClipboard, struct FastTrackClipboard { FastTrackClipboard(int aClipboardRequestNumber, - nsRetrievalContextWayland *aRetrievalContex) + nsRetrievalContextWayland* aRetrievalContex) : mClipboardRequestNumber(aClipboardRequestNumber), mRetrievalContex(aRetrievalContex) {} int mClipboardRequestNumber; - nsRetrievalContextWayland *mRetrievalContex; + nsRetrievalContextWayland* mRetrievalContex; }; static void wayland_clipboard_contents_received( - GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data) { - FastTrackClipboard *fastTrack = static_cast(data); + GtkClipboard* clipboard, GtkSelectionData* selection_data, gpointer data) { + FastTrackClipboard* fastTrack = static_cast(data); fastTrack->mRetrievalContex->TransferFastTrackClipboard( fastTrack->mClipboardRequestNumber, selection_data); delete fastTrack; } void nsRetrievalContextWayland::TransferFastTrackClipboard( - int aClipboardRequestNumber, GtkSelectionData *aSelectionData) { + int aClipboardRequestNumber, GtkSelectionData* aSelectionData) { if (mClipboardRequestNumber == aClipboardRequestNumber) { int dataLength = gtk_selection_data_get_length(aSelectionData); if (dataLength > 0) { mClipboardDataLength = dataLength; - mClipboardData = reinterpret_cast( + mClipboardData = reinterpret_cast( g_malloc(sizeof(char) * (mClipboardDataLength + 1))); memcpy(mClipboardData, gtk_selection_data_get_data(aSelectionData), sizeof(char) * mClipboardDataLength); @@ -692,8 +692,8 @@ void nsRetrievalContextWayland::TransferFastTrackClipboard( } } -const char *nsRetrievalContextWayland::GetClipboardData( - const char *aMimeType, int32_t aWhichClipboard, uint32_t *aContentLength) { +const char* nsRetrievalContextWayland::GetClipboardData( + const char* aMimeType, int32_t aWhichClipboard, uint32_t* aContentLength) { NS_ASSERTION(mClipboardData == nullptr && mClipboardDataLength == 0, "Looks like we're leaking clipboard data here!"); @@ -710,7 +710,7 @@ const char *nsRetrievalContextWayland::GetClipboardData( wayland_clipboard_contents_received, new FastTrackClipboard(mClipboardRequestNumber, this)); } else { - DataOffer *dataOffer = + DataOffer* dataOffer = (selection == GDK_SELECTION_PRIMARY) ? mPrimaryOffer : mClipboardOffer; if (!dataOffer) { // Something went wrong. We're requested to provide clipboard data @@ -725,13 +725,13 @@ const char *nsRetrievalContextWayland::GetClipboardData( } *aContentLength = mClipboardDataLength; - return reinterpret_cast(mClipboardData); + return reinterpret_cast(mClipboardData); } -const char *nsRetrievalContextWayland::GetClipboardText( +const char* nsRetrievalContextWayland::GetClipboardText( int32_t aWhichClipboard) { GdkAtom selection = GetSelectionAtom(aWhichClipboard); - DataOffer *dataOffer = + DataOffer* dataOffer = (selection == GDK_SELECTION_PRIMARY) ? mPrimaryOffer : mClipboardOffer; if (!dataOffer) return nullptr; @@ -745,10 +745,10 @@ const char *nsRetrievalContextWayland::GetClipboardText( } void nsRetrievalContextWayland::ReleaseClipboardData( - const char *aClipboardData) { + const char* aClipboardData) { NS_ASSERTION(aClipboardData == mClipboardData, "Releasing unknown clipboard data!"); - g_free((void *)aClipboardData); + g_free((void*)aClipboardData); mClipboardData = nullptr; mClipboardDataLength = 0; diff --git a/widget/gtk/nsClipboardX11.cpp b/widget/gtk/nsClipboardX11.cpp index 369d78cccb3df..32e9093971dd3 100644 --- a/widget/gtk/nsClipboardX11.cpp +++ b/widget/gtk/nsClipboardX11.cpp @@ -41,19 +41,19 @@ bool nsRetrievalContextX11::HasSelectionSupport(void) { return true; } -static GdkFilterReturn selection_request_filter(GdkXEvent *gdk_xevent, - GdkEvent *event, +static GdkFilterReturn selection_request_filter(GdkXEvent* gdk_xevent, + GdkEvent* event, gpointer data) { - XEvent *xevent = static_cast(gdk_xevent); + XEvent* xevent = static_cast(gdk_xevent); if (xevent->xany.type == SelectionRequest) { if (xevent->xselectionrequest.requestor == X11None) return GDK_FILTER_REMOVE; - GdkDisplay *display = + GdkDisplay* display = gdk_x11_lookup_xdisplay(xevent->xselectionrequest.display); if (!display) return GDK_FILTER_REMOVE; - GdkWindow *window = gdk_x11_window_foreign_new_for_display( + GdkWindow* window = gdk_x11_window_foreign_new_for_display( display, xevent->xselectionrequest.requestor); if (!window) return GDK_FILTER_REMOVE; @@ -80,7 +80,7 @@ nsRetrievalContextX11::~nsRetrievalContextX11() { gdk_window_remove_filter(nullptr, selection_request_filter, nullptr); } -static void DispatchSelectionNotifyEvent(GtkWidget *widget, XEvent *xevent) { +static void DispatchSelectionNotifyEvent(GtkWidget* widget, XEvent* xevent) { GdkEvent event; event.selection.type = GDK_SELECTION_NOTIFY; event.selection.window = gtk_widget_get_window(widget); @@ -93,8 +93,8 @@ static void DispatchSelectionNotifyEvent(GtkWidget *widget, XEvent *xevent) { gtk_widget_event(widget, &event); } -static void DispatchPropertyNotifyEvent(GtkWidget *widget, XEvent *xevent) { - GdkWindow *window = gtk_widget_get_window(widget); +static void DispatchPropertyNotifyEvent(GtkWidget* widget, XEvent* xevent) { + GdkWindow* window = gtk_widget_get_window(widget); if ((gdk_window_get_events(window)) & GDK_PROPERTY_CHANGE_MASK) { GdkEvent event; event.property.type = GDK_PROPERTY_NOTIFY; @@ -108,21 +108,21 @@ static void DispatchPropertyNotifyEvent(GtkWidget *widget, XEvent *xevent) { } struct checkEventContext { - GtkWidget *cbWidget; + GtkWidget* cbWidget; Atom selAtom; }; -static Bool checkEventProc(Display *display, XEvent *event, XPointer arg) { - checkEventContext *context = (checkEventContext *)arg; +static Bool checkEventProc(Display* display, XEvent* event, XPointer arg) { + checkEventContext* context = (checkEventContext*)arg; if (event->xany.type == SelectionNotify || (event->xany.type == PropertyNotify && event->xproperty.atom == context->selAtom)) { - GdkWindow *cbWindow = gdk_x11_window_lookup_for_display( + GdkWindow* cbWindow = gdk_x11_window_lookup_for_display( gdk_x11_lookup_xdisplay(display), event->xany.window); if (cbWindow) { - GtkWidget *cbWidget = nullptr; - gdk_window_get_user_data(cbWindow, (gpointer *)&cbWidget); + GtkWidget* cbWidget = nullptr; + gdk_window_get_user_data(cbWindow, (gpointer*)&cbWidget); if (cbWidget && GTK_IS_WIDGET(cbWidget)) { context->cbWidget = cbWidget; return X11True; @@ -138,9 +138,9 @@ bool nsRetrievalContextX11::WaitForX11Content() { return true; } - GdkDisplay *gdkDisplay = gdk_display_get_default(); + GdkDisplay* gdkDisplay = gdk_display_get_default(); if (GDK_IS_X11_DISPLAY(gdkDisplay)) { - Display *xDisplay = GDK_DISPLAY_XDISPLAY(gdkDisplay); + Display* xDisplay = GDK_DISPLAY_XDISPLAY(gdkDisplay); checkEventContext context; context.cbWidget = nullptr; context.selAtom = @@ -191,7 +191,7 @@ bool nsRetrievalContextX11::WaitForX11Content() { // Call this when data has been retrieved. void nsRetrievalContextX11::Complete(ClipboardDataType aDataType, - const void *aData, + const void* aData, int aDataRequestNumber) { if (mClipboardRequestNumber != aDataRequestNumber) { NS_WARNING( @@ -207,7 +207,7 @@ void nsRetrievalContextX11::Complete(ClipboardDataType aDataType, switch (aDataType) { case CLIPBOARD_TEXT: { - const char *text = static_cast(aData); + const char* text = static_cast(aData); if (text) { mClipboardDataLength = sizeof(char) * (strlen(text) + 1); mClipboardData = moz_xmalloc(mClipboardDataLength); @@ -215,11 +215,11 @@ void nsRetrievalContextX11::Complete(ClipboardDataType aDataType, } } break; case CLIPBOARD_TARGETS: { - const GtkSelectionData *selection = - static_cast(aData); + const GtkSelectionData* selection = + static_cast(aData); gint n_targets = 0; - GdkAtom *targets = nullptr; + GdkAtom* targets = nullptr; if (!gtk_selection_data_get_targets(selection, &targets, &n_targets) || !n_targets) { @@ -230,8 +230,8 @@ void nsRetrievalContextX11::Complete(ClipboardDataType aDataType, mClipboardDataLength = n_targets; } break; case CLIPBOARD_DATA: { - const GtkSelectionData *selection = - static_cast(aData); + const GtkSelectionData* selection = + static_cast(aData); gint dataLength = gtk_selection_data_get_length(selection); if (dataLength > 0) { @@ -248,26 +248,26 @@ void nsRetrievalContextX11::Complete(ClipboardDataType aDataType, } } -static void clipboard_contents_received(GtkClipboard *clipboard, - GtkSelectionData *selection_data, +static void clipboard_contents_received(GtkClipboard* clipboard, + GtkSelectionData* selection_data, gpointer data) { - ClipboardRequestHandler *handler = - static_cast(data); + ClipboardRequestHandler* handler = + static_cast(data); handler->Complete(selection_data); delete handler; } -static void clipboard_text_received(GtkClipboard *clipboard, const gchar *text, +static void clipboard_text_received(GtkClipboard* clipboard, const gchar* text, gpointer data) { - ClipboardRequestHandler *handler = - static_cast(data); + ClipboardRequestHandler* handler = + static_cast(data); handler->Complete(text); delete handler; } bool nsRetrievalContextX11::WaitForClipboardData(ClipboardDataType aDataType, - GtkClipboard *clipboard, - const char *aMimeType) { + GtkClipboard* clipboard, + const char* aMimeType) { mState = INITIAL; NS_ASSERTION(!mClipboardData, "Leaking clipboard content!"); @@ -276,7 +276,7 @@ bool nsRetrievalContextX11::WaitForClipboardData(ClipboardDataType aDataType, // with clipboard_contents_received() callback where the data // is provided by Gtk. mClipboardRequestNumber++; - ClipboardRequestHandler *handler = + ClipboardRequestHandler* handler = new ClipboardRequestHandler(this, aDataType, mClipboardRequestNumber); switch (aDataType) { @@ -297,15 +297,15 @@ bool nsRetrievalContextX11::WaitForClipboardData(ClipboardDataType aDataType, return WaitForX11Content(); } -GdkAtom *nsRetrievalContextX11::GetTargets(int32_t aWhichClipboard, - int *aTargetNums) { - GtkClipboard *clipboard = +GdkAtom* nsRetrievalContextX11::GetTargets(int32_t aWhichClipboard, + int* aTargetNums) { + GtkClipboard* clipboard = gtk_clipboard_get(GetSelectionAtom(aWhichClipboard)); if (!WaitForClipboardData(CLIPBOARD_TARGETS, clipboard)) return nullptr; *aTargetNums = mClipboardDataLength; - GdkAtom *targets = static_cast(mClipboardData); + GdkAtom* targets = static_cast(mClipboardData); // We don't hold the target list internally but we transfer the ownership. mClipboardData = nullptr; @@ -314,32 +314,32 @@ GdkAtom *nsRetrievalContextX11::GetTargets(int32_t aWhichClipboard, return targets; } -const char *nsRetrievalContextX11::GetClipboardData(const char *aMimeType, +const char* nsRetrievalContextX11::GetClipboardData(const char* aMimeType, int32_t aWhichClipboard, - uint32_t *aContentLength) { - GtkClipboard *clipboard; + uint32_t* aContentLength) { + GtkClipboard* clipboard; clipboard = gtk_clipboard_get(GetSelectionAtom(aWhichClipboard)); if (!WaitForClipboardData(CLIPBOARD_DATA, clipboard, aMimeType)) return nullptr; *aContentLength = mClipboardDataLength; - return static_cast(mClipboardData); + return static_cast(mClipboardData); } -const char *nsRetrievalContextX11::GetClipboardText(int32_t aWhichClipboard) { - GtkClipboard *clipboard; +const char* nsRetrievalContextX11::GetClipboardText(int32_t aWhichClipboard) { + GtkClipboard* clipboard; clipboard = gtk_clipboard_get(GetSelectionAtom(aWhichClipboard)); if (!WaitForClipboardData(CLIPBOARD_TEXT, clipboard)) return nullptr; - return static_cast(mClipboardData); + return static_cast(mClipboardData); } -void nsRetrievalContextX11::ReleaseClipboardData(const char *aClipboardData) { +void nsRetrievalContextX11::ReleaseClipboardData(const char* aClipboardData) { NS_ASSERTION(aClipboardData == mClipboardData, "Releasing unknown clipboard data!"); - free((void *)aClipboardData); + free((void*)aClipboardData); mClipboardData = nullptr; mClipboardDataLength = 0; diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp index 3ab8b1d75e786..f5626bf509beb 100644 --- a/widget/gtk/nsDragService.cpp +++ b/widget/gtk/nsDragService.cpp @@ -67,8 +67,8 @@ static LazyLogModule sDragLm("nsDragService"); // data used for synthetic periodic motion events sent to the source widget // grabbing real events for the drag. static guint sMotionEventTimerID; -static GdkEvent *sMotionEvent; -static GtkWidget *sGrabWidget; +static GdkEvent* sMotionEvent; +static GtkWidget* sGrabWidget; static const char gMimeListType[] = "application/x-moz-internal-item-list"; static const char gMozUrlType[] = "_NETSCAPE_URL"; @@ -76,19 +76,19 @@ static const char gTextUriListType[] = "text/uri-list"; static const char gTextPlainUTF8Type[] = "text/plain;charset=utf-8"; static const char gXdndDirectSaveType[] = "XdndDirectSave0"; -static void invisibleSourceDragBegin(GtkWidget *aWidget, - GdkDragContext *aContext, gpointer aData); +static void invisibleSourceDragBegin(GtkWidget* aWidget, + GdkDragContext* aContext, gpointer aData); -static void invisibleSourceDragEnd(GtkWidget *aWidget, GdkDragContext *aContext, +static void invisibleSourceDragEnd(GtkWidget* aWidget, GdkDragContext* aContext, gpointer aData); -static gboolean invisibleSourceDragFailed(GtkWidget *aWidget, - GdkDragContext *aContext, +static gboolean invisibleSourceDragFailed(GtkWidget* aWidget, + GdkDragContext* aContext, gint aResult, gpointer aData); -static void invisibleSourceDragDataGet(GtkWidget *aWidget, - GdkDragContext *aContext, - GtkSelectionData *aSelectionData, +static void invisibleSourceDragDataGet(GtkWidget* aWidget, + GdkDragContext* aContext, + GtkSelectionData* aSelectionData, guint aInfo, guint32 aTime, gpointer aData); @@ -164,8 +164,8 @@ already_AddRefed nsDragService::GetInstance() { // nsIObserver NS_IMETHODIMP -nsDragService::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsDragService::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { if (!nsCRT::strcmp(aTopic, "quit-application")) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::Observe(\"quit-application\")")); @@ -204,7 +204,7 @@ static gboolean DispatchMotionEventCopy(gpointer aData) { // dispatch. sMotionEventTimerID = 0; - GdkEvent *event = sMotionEvent; + GdkEvent* event = sMotionEvent; sMotionEvent = nullptr; // If there is no longer a grab on the widget, then the drag is over and // there is no need to continue drag motion. @@ -218,7 +218,7 @@ static gboolean DispatchMotionEventCopy(gpointer aData) { return FALSE; } -static void OnSourceGrabEventAfter(GtkWidget *widget, GdkEvent *event, +static void OnSourceGrabEventAfter(GtkWidget* widget, GdkEvent* event, gpointer user_data) { // If there is no longer a grab on the widget, then the drag motion is // over (though the data may not be fetched yet). @@ -232,7 +232,7 @@ static void OnSourceGrabEventAfter(GtkWidget *widget, GdkEvent *event, // Update the cursor position. The last of these recorded gets used for // the eDragEnd event. - nsDragService *dragService = static_cast(user_data); + nsDragService* dragService = static_cast(user_data); gint scale = ScreenHelperGTK::GetGTKMonitorScaleFactor(); auto p = LayoutDeviceIntPoint::Round(event->motion.x_root * scale, event->motion.y_root * scale); @@ -259,10 +259,10 @@ static void OnSourceGrabEventAfter(GtkWidget *widget, GdkEvent *event, G_PRIORITY_DEFAULT_IDLE, 350, DispatchMotionEventCopy, nullptr, nullptr); } -static GtkWindow *GetGtkWindow(dom::Document *aDocument) { +static GtkWindow* GetGtkWindow(dom::Document* aDocument) { if (!aDocument) return nullptr; - PresShell *presShell = aDocument->GetPresShell(); + PresShell* presShell = aDocument->GetPresShell(); if (!presShell) { return nullptr; } @@ -274,11 +274,11 @@ static GtkWindow *GetGtkWindow(dom::Document *aDocument) { vm->GetRootWidget(getter_AddRefs(widget)); if (!widget) return nullptr; - GtkWidget *gtkWidget = - static_cast(widget.get())->GetMozContainerWidget(); + GtkWidget* gtkWidget = + static_cast(widget.get())->GetMozContainerWidget(); if (!gtkWidget) return nullptr; - GtkWidget *toplevel = nullptr; + GtkWidget* toplevel = nullptr; toplevel = gtk_widget_get_toplevel(gtkWidget); if (!GTK_IS_WINDOW(toplevel)) return nullptr; @@ -289,7 +289,7 @@ static GtkWindow *GetGtkWindow(dom::Document *aDocument) { NS_IMETHODIMP nsDragService::InvokeDragSession( - nsINode *aDOMNode, nsIPrincipal *aPrincipal, nsIArray *aArrayTransferables, + nsINode* aDOMNode, nsIPrincipal* aPrincipal, nsIArray* aArrayTransferables, uint32_t aActionType, nsContentPolicyType aContentPolicyType = nsIContentPolicy::TYPE_OTHER) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::InvokeDragSession")); @@ -307,7 +307,7 @@ nsDragService::InvokeDragSession( // nsBaseDragService nsresult nsDragService::InvokeDragSessionImpl( - nsIArray *aArrayTransferables, const Maybe &aRegion, + nsIArray* aArrayTransferables, const Maybe& aRegion, uint32_t aActionType) { // make sure that we have an array of transferables to use if (!aArrayTransferables) return NS_ERROR_INVALID_ARG; @@ -316,7 +316,7 @@ nsresult nsDragService::InvokeDragSessionImpl( // length of this call mSourceDataItems = aArrayTransferables; // get the list of items we offer for drags - GtkTargetList *sourceList = GetSourceList(); + GtkTargetList* sourceList = GetSourceList(); if (!sourceList) return NS_OK; @@ -343,19 +343,19 @@ nsresult nsDragService::InvokeDragSessionImpl( // Put the drag widget in the window group of the source node so that the // gtk_grab_add during gtk_drag_begin is effective. // gtk_window_get_group(nullptr) returns the default window group. - GtkWindowGroup *window_group = + GtkWindowGroup* window_group = gtk_window_get_group(GetGtkWindow(mSourceDocument)); gtk_window_group_add_window(window_group, GTK_WINDOW(mHiddenWidget)); #ifdef MOZ_WIDGET_GTK // Get device for event source - GdkDisplay *display = gdk_display_get_default(); - GdkDeviceManager *device_manager = gdk_display_get_device_manager(display); + GdkDisplay* display = gdk_display_get_default(); + GdkDeviceManager* device_manager = gdk_display_get_device_manager(display); event.button.device = gdk_device_manager_get_client_pointer(device_manager); #endif // start our drag. - GdkDragContext *context = + GdkDragContext* context = gtk_drag_begin(mHiddenWidget, sourceList, action, 1, &event); nsresult rv; @@ -383,11 +383,11 @@ nsresult nsDragService::InvokeDragSessionImpl( return rv; } -bool nsDragService::SetAlphaPixmap(SourceSurface *aSurface, - GdkDragContext *aContext, int32_t aXOffset, +bool nsDragService::SetAlphaPixmap(SourceSurface* aSurface, + GdkDragContext* aContext, int32_t aXOffset, int32_t aYOffset, - const LayoutDeviceIntRect &dragRect) { - GdkScreen *screen = gtk_widget_get_screen(mHiddenWidget); + const LayoutDeviceIntRect& dragRect) { + GdkScreen* screen = gtk_widget_get_screen(mHiddenWidget); // Transparent drag icons need, like a lot of transparency-related things, // a compositing X window manager @@ -403,7 +403,7 @@ bool nsDragService::SetAlphaPixmap(SourceSurface *aSurface, if (gtk_check_version(3, 9, 12)) return false; // TODO: grab X11 pixmap or image data instead of expensive readback. - cairo_surface_t *surf = cairo_image_surface_create( + cairo_surface_t* surf = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, dragRect.width, dragRect.height); if (!surf) return false; @@ -424,7 +424,7 @@ bool nsDragService::SetAlphaPixmap(SourceSurface *aSurface, // Ensure that the surface is drawn at the correct scale on HiDPI displays. static auto sCairoSurfaceSetDeviceScalePtr = - (void (*)(cairo_surface_t *, double, double))dlsym( + (void (*)(cairo_surface_t*, double, double))dlsym( RTLD_DEFAULT, "cairo_surface_set_device_scale"); if (sCairoSurfaceSetDeviceScalePtr) { gint scale = ScreenHelperGTK::GetGTKMonitorScaleFactor(); @@ -484,28 +484,28 @@ nsDragService::SetCanDrop(bool aCanDrop) { } NS_IMETHODIMP -nsDragService::GetCanDrop(bool *aCanDrop) { +nsDragService::GetCanDrop(bool* aCanDrop) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::GetCanDrop")); *aCanDrop = mCanDrop; return NS_OK; } -static void UTF16ToNewUTF8(const char16_t *aUTF16, uint32_t aUTF16Len, - char **aUTF8, uint32_t *aUTF8Len) { +static void UTF16ToNewUTF8(const char16_t* aUTF16, uint32_t aUTF16Len, + char** aUTF8, uint32_t* aUTF8Len) { nsDependentSubstring utf16(aUTF16, aUTF16Len); *aUTF8 = ToNewUTF8String(utf16, aUTF8Len); } -static void UTF8ToNewUTF16(const char *aUTF8, uint32_t aUTF8Len, - char16_t **aUTF16, uint32_t *aUTF16Len) { +static void UTF8ToNewUTF16(const char* aUTF8, uint32_t aUTF8Len, + char16_t** aUTF16, uint32_t* aUTF16Len) { nsDependentCSubstring utf8(aUTF8, aUTF8Len); *aUTF16 = UTF8ToNewUnicode(utf8, aUTF16Len); } // count the number of URIs in some text/uri-list format data. -static uint32_t CountTextUriListItems(const char *data, uint32_t datalen) { - const char *p = data; - const char *endPtr = p + datalen; +static uint32_t CountTextUriListItems(const char* data, uint32_t datalen) { + const char* p = data; + const char* endPtr = p + datalen; uint32_t count = 0; while (p < endPtr) { @@ -522,11 +522,11 @@ static uint32_t CountTextUriListItems(const char *data, uint32_t datalen) { // extract an item from text/uri-list formatted data and convert it to // unicode. -static void GetTextUriListItem(const char *data, uint32_t datalen, - uint32_t aItemIndex, char16_t **convertedText, - uint32_t *convertedTextLen) { - const char *p = data; - const char *endPtr = p + datalen; +static void GetTextUriListItem(const char* data, uint32_t datalen, + uint32_t aItemIndex, char16_t** convertedText, + uint32_t* convertedTextLen) { + const char* p = data; + const char* endPtr = p + datalen; unsigned int count = 0; *convertedText = nullptr; @@ -537,7 +537,7 @@ static void GetTextUriListItem(const char *data, uint32_t datalen, if (p != endPtr && *p != '\0' && *p != '\n' && *p != '\r') count++; // this is the item we are after ... if (aItemIndex + 1 == count) { - const char *q = p; + const char* q = p; while (q < endPtr && *q != '\0' && *q != '\n' && *q != '\r') q++; UTF8ToNewUTF16(p, q - p, convertedText, convertedTextLen); break; @@ -554,7 +554,7 @@ static void GetTextUriListItem(const char *data, uint32_t datalen, } NS_IMETHODIMP -nsDragService::GetNumDropItems(uint32_t *aNumItems) { +nsDragService::GetNumDropItems(uint32_t* aNumItems) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::GetNumDropItems")); if (!mTargetWidget) { @@ -579,7 +579,7 @@ nsDragService::GetNumDropItems(uint32_t *aNumItems) { GdkAtom gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE); GetTargetDragData(gdkFlavor); if (mTargetDragData) { - const char *data = reinterpret_cast(mTargetDragData); + const char* data = reinterpret_cast(mTargetDragData); *aNumItems = CountTextUriListItems(data, mTargetDragDataLen); } else *aNumItems = 1; @@ -589,7 +589,7 @@ nsDragService::GetNumDropItems(uint32_t *aNumItems) { } NS_IMETHODIMP -nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { +nsDragService::GetData(nsITransferable* aTransferable, uint32_t aItemIndex) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::GetData %d", aItemIndex)); // make sure that we have a transferable @@ -614,7 +614,7 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { MOZ_LOG(sDragLm, LogLevel::Debug, ("it's a list...")); // find a matching flavor for (uint32_t i = 0; i < flavors.Length(); ++i) { - nsCString &flavorStr = flavors[i]; + nsCString& flavorStr = flavors[i]; MOZ_LOG(sDragLm, LogLevel::Debug, ("flavor is %s\n", flavorStr.get())); // get the item with the right index nsCOMPtr item = @@ -647,7 +647,7 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { // actually present, copy out the data into the transferable in that // format. SetTransferData() implicitly handles conversions. for (uint32_t i = 0; i < flavors.Length(); ++i) { - nsCString &flavorStr = flavors[i]; + nsCString& flavorStr = flavors[i]; GdkAtom gdkFlavor = gdk_atom_intern(flavorStr.get(), FALSE); MOZ_LOG(sDragLm, LogLevel::Debug, ("looking for data in type %s, gdk flavor %p\n", flavorStr.get(), @@ -672,8 +672,8 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { GetTargetDragData(gdkFlavor); } if (mTargetDragData) { - const char *text = static_cast(mTargetDragData); - char16_t *convertedText = nullptr; + const char* text = static_cast(mTargetDragData); + char16_t* convertedText = nullptr; uint32_t convertedTextLen = 0; GetTextUriListItem(text, mTargetDragDataLen, aItemIndex, @@ -718,8 +718,8 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { GetTargetDragData(gdkFlavor); if (mTargetDragData) { MOZ_LOG(sDragLm, LogLevel::Debug, ("Got textplain data\n")); - const char *castedText = reinterpret_cast(mTargetDragData); - char16_t *convertedText = nullptr; + const char* castedText = reinterpret_cast(mTargetDragData); + char16_t* convertedText = nullptr; NS_ConvertUTF8toUTF16 ucs2string(castedText, mTargetDragDataLen); convertedText = ToNewUnicode(ucs2string); if (convertedText) { @@ -740,8 +740,8 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { GetTargetDragData(gdkFlavor); if (mTargetDragData) { MOZ_LOG(sDragLm, LogLevel::Debug, ("Got textplain data\n")); - const char *castedText = reinterpret_cast(mTargetDragData); - char16_t *convertedText = nullptr; + const char* castedText = reinterpret_cast(mTargetDragData); + char16_t* convertedText = nullptr; uint32_t convertedTextLen = 0; UTF8ToNewUTF16(castedText, mTargetDragDataLen, &convertedText, &convertedTextLen); @@ -770,8 +770,8 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { GetTargetDragData(gdkFlavor); if (mTargetDragData) { MOZ_LOG(sDragLm, LogLevel::Debug, ("Got text/uri-list data\n")); - const char *data = reinterpret_cast(mTargetDragData); - char16_t *convertedText = nullptr; + const char* data = reinterpret_cast(mTargetDragData); + char16_t* convertedText = nullptr; uint32_t convertedTextLen = 0; GetTextUriListItem(data, mTargetDragDataLen, aItemIndex, @@ -798,8 +798,8 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { GetTargetDragData(gdkFlavor); if (mTargetDragData) { MOZ_LOG(sDragLm, LogLevel::Debug, ("Got _NETSCAPE_URL data\n")); - const char *castedText = reinterpret_cast(mTargetDragData); - char16_t *convertedText = nullptr; + const char* castedText = reinterpret_cast(mTargetDragData); + char16_t* convertedText = nullptr; uint32_t convertedTextLen = 0; UTF8ToNewUTF16(castedText, mTargetDragDataLen, &convertedText, &convertedTextLen); @@ -828,7 +828,7 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { // to DOM line endings. nsLinebreakHelpers::ConvertPlatformToDOMLinebreaks( flavorStr, &mTargetDragData, - reinterpret_cast(&mTargetDragDataLen)); + reinterpret_cast(&mTargetDragDataLen)); } // put it into the transferable. @@ -847,7 +847,7 @@ nsDragService::GetData(nsITransferable *aTransferable, uint32_t aItemIndex) { } NS_IMETHODIMP -nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) { +nsDragService::IsDataFlavorSupported(const char* aDataFlavor, bool* _retval) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::IsDataFlavorSupported %s", aDataFlavor)); if (!_retval) return NS_ERROR_INVALID_ARG; @@ -893,7 +893,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) { } // check the target context vs. this flavor, one at a time - GList *tmp = nullptr; + GList* tmp = nullptr; if (mTargetDragContext) { tmp = gdk_drag_context_list_targets(mTargetDragContext); } @@ -901,13 +901,13 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) { else if (mTargetWaylandDragContext) { tmp = mTargetWaylandDragContext->GetTargets(); } - GList *tmp_head = tmp; + GList* tmp_head = tmp; #endif for (; tmp; tmp = tmp->next) { /* Bug 331198 */ GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data); - gchar *name = nullptr; + gchar* name = nullptr; name = gdk_atom_name(atom); MOZ_LOG(sDragLm, LogLevel::Debug, ("checking %s against %s\n", name, aDataFlavor)); @@ -953,7 +953,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) { return NS_OK; } -void nsDragService::ReplyToDragMotion(GdkDragContext *aDragContext) { +void nsDragService::ReplyToDragMotion(GdkDragContext* aDragContext) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::ReplyToDragMotion %d", mCanDrop)); @@ -980,7 +980,7 @@ void nsDragService::ReplyToDragMotion(GdkDragContext *aDragContext) { } #ifdef MOZ_WAYLAND -void nsDragService::ReplyToDragMotion(nsWaylandDragContext *aDragContext) { +void nsDragService::ReplyToDragMotion(nsWaylandDragContext* aDragContext) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::ReplyToDragMotion %d", mCanDrop)); @@ -1007,16 +1007,16 @@ void nsDragService::ReplyToDragMotion(nsWaylandDragContext *aDragContext) { } #endif -void nsDragService::TargetDataReceived(GtkWidget *aWidget, - GdkDragContext *aContext, gint aX, +void nsDragService::TargetDataReceived(GtkWidget* aWidget, + GdkDragContext* aContext, gint aX, gint aY, - GtkSelectionData *aSelectionData, + GtkSelectionData* aSelectionData, guint aInfo, guint32 aTime) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::TargetDataReceived")); TargetResetData(); mTargetDragDataReceived = true; gint len = gtk_selection_data_get_length(aSelectionData); - const guchar *data = gtk_selection_data_get_data(aSelectionData); + const guchar* data = gtk_selection_data_get_data(aSelectionData); if (len > 0 && data) { mTargetDragDataLen = len; mTargetDragData = g_malloc(mTargetDragDataLen); @@ -1042,7 +1042,7 @@ bool nsDragService::IsTargetContextList(void) { // drop will work or not. if (gtk_drag_get_source_widget(mTargetDragContext) == nullptr) return retval; - GList *tmp; + GList* tmp; // walk the list of context targets and see if one of them is a list // of items. @@ -1050,7 +1050,7 @@ bool nsDragService::IsTargetContextList(void) { tmp = tmp->next) { /* Bug 331198 */ GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data); - gchar *name = nullptr; + gchar* name = nullptr; name = gdk_atom_name(atom); if (name && strcmp(name, gMimeListType) == 0) retval = true; g_free(name); @@ -1101,11 +1101,11 @@ void nsDragService::TargetResetData(void) { mTargetDragDataLen = 0; } -GtkTargetList *nsDragService::GetSourceList(void) { +GtkTargetList* nsDragService::GetSourceList(void) { if (!mSourceDataItems) return nullptr; - nsTArray targetArray; - GtkTargetEntry *targets; - GtkTargetList *targetList = 0; + nsTArray targetArray; + GtkTargetEntry* targets; + GtkTargetList* targetList = 0; uint32_t targetCount = 0; unsigned int numDragItems = 0; @@ -1119,8 +1119,8 @@ GtkTargetList *nsDragService::GetSourceList(void) { // the application/x-moz-internal-item-list format, which preserves // all information for drags within the same mozilla instance. - GtkTargetEntry *listTarget = - (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); + GtkTargetEntry* listTarget = + (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry)); listTarget->target = g_strdup(gMimeListType); listTarget->flags = 0; MOZ_LOG(sDragLm, LogLevel::Debug, @@ -1139,7 +1139,7 @@ GtkTargetList *nsDragService::GetSourceList(void) { // If so, advertise // text/uri-list. if (flavors[i].EqualsLiteral(kURLMime)) { - listTarget = (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); + listTarget = (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry)); listTarget->target = g_strdup(gTextUriListType); listTarget->flags = 0; MOZ_LOG(sDragLm, LogLevel::Debug, @@ -1154,10 +1154,10 @@ GtkTargetList *nsDragService::GetSourceList(void) { nsTArray flavors; currItem->FlavorsTransferableCanExport(flavors); for (uint32_t i = 0; i < flavors.Length(); ++i) { - nsCString &flavorStr = flavors[i]; + nsCString& flavorStr = flavors[i]; - GtkTargetEntry *target = - (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); + GtkTargetEntry* target = + (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry)); target->target = g_strdup(flavorStr.get()); target->flags = 0; MOZ_LOG(sDragLm, LogLevel::Debug, @@ -1166,8 +1166,8 @@ GtkTargetList *nsDragService::GetSourceList(void) { // If there is a file, add the text/uri-list type. if (flavorStr.EqualsLiteral(kFileMime)) { - GtkTargetEntry *urilistTarget = - (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); + GtkTargetEntry* urilistTarget = + (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry)); urilistTarget->target = g_strdup(gTextUriListType); urilistTarget->flags = 0; MOZ_LOG(sDragLm, LogLevel::Debug, @@ -1179,8 +1179,8 @@ GtkTargetList *nsDragService::GetSourceList(void) { // since we automatically support text/plain // if we support text/unicode. else if (flavorStr.EqualsLiteral(kUnicodeMime)) { - GtkTargetEntry *plainUTF8Target = - (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); + GtkTargetEntry* plainUTF8Target = + (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry)); plainUTF8Target->target = g_strdup(gTextPlainUTF8Type); plainUTF8Target->flags = 0; MOZ_LOG( @@ -1188,8 +1188,8 @@ GtkTargetList *nsDragService::GetSourceList(void) { ("automatically adding target %s\n", plainUTF8Target->target)); targetArray.AppendElement(plainUTF8Target); - GtkTargetEntry *plainTarget = - (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); + GtkTargetEntry* plainTarget = + (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry)); plainTarget->target = g_strdup(kTextMime); plainTarget->flags = 0; MOZ_LOG(sDragLm, LogLevel::Debug, @@ -1200,8 +1200,8 @@ GtkTargetList *nsDragService::GetSourceList(void) { // If it is, add _NETSCAPE_URL // this is a type used by everybody. else if (flavorStr.EqualsLiteral(kURLMime)) { - GtkTargetEntry *urlTarget = - (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); + GtkTargetEntry* urlTarget = + (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry)); urlTarget->target = g_strdup(gMozUrlType); urlTarget->flags = 0; MOZ_LOG(sDragLm, LogLevel::Debug, @@ -1210,8 +1210,8 @@ GtkTargetList *nsDragService::GetSourceList(void) { } // XdndDirectSave else if (flavorStr.EqualsLiteral(kFilePromiseMime)) { - GtkTargetEntry *directsaveTarget = - (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry)); + GtkTargetEntry* directsaveTarget = + (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry)); directsaveTarget->target = g_strdup(gXdndDirectSaveType); directsaveTarget->flags = 0; MOZ_LOG( @@ -1227,10 +1227,10 @@ GtkTargetList *nsDragService::GetSourceList(void) { targetCount = targetArray.Length(); if (targetCount) { // allocate space to create the list of valid targets - targets = (GtkTargetEntry *)g_malloc(sizeof(GtkTargetEntry) * targetCount); + targets = (GtkTargetEntry*)g_malloc(sizeof(GtkTargetEntry) * targetCount); uint32_t targetIndex; for (targetIndex = 0; targetIndex < targetCount; ++targetIndex) { - GtkTargetEntry *disEntry = targetArray.ElementAt(targetIndex); + GtkTargetEntry* disEntry = targetArray.ElementAt(targetIndex); // this is a string reference but it will be freed later. targets[targetIndex].target = disEntry->target; targets[targetIndex].flags = disEntry->flags; @@ -1239,7 +1239,7 @@ GtkTargetList *nsDragService::GetSourceList(void) { targetList = gtk_target_list_new(targets, targetCount); // clean up the target list for (uint32_t cleanIndex = 0; cleanIndex < targetCount; ++cleanIndex) { - GtkTargetEntry *thisTarget = targetArray.ElementAt(cleanIndex); + GtkTargetEntry* thisTarget = targetArray.ElementAt(cleanIndex); g_free(thisTarget->target); g_free(thisTarget); } @@ -1248,7 +1248,7 @@ GtkTargetList *nsDragService::GetSourceList(void) { return targetList; } -void nsDragService::SourceEndDragSession(GdkDragContext *aContext, +void nsDragService::SourceEndDragSession(GdkDragContext* aContext, gint aResult) { // this just releases the list of data items that we provide mSourceDataItems = nullptr; @@ -1265,7 +1265,7 @@ void nsDragService::SourceEndDragSession(GdkDragContext *aContext, if (mEndDragPoint.x < 0) { // We don't have a drag end point, so guess gint x, y; - GdkDisplay *display = gdk_display_get_default(); + GdkDisplay* display = gdk_display_get_default(); if (display) { gint scale = ScreenHelperGTK::GetGTKMonitorScaleFactor(); gdk_display_get_pointer(display, nullptr, &x, &y, nullptr); @@ -1319,7 +1319,7 @@ void nsDragService::SourceEndDragSession(GdkDragContext *aContext, LayoutDeviceIntPoint(), 0); } -static void CreateURIList(nsIArray *aItems, nsACString &aURIList) { +static void CreateURIList(nsIArray* aItems, nsACString& aURIList) { uint32_t length = 0; aItems->GetLength(&length); @@ -1370,13 +1370,13 @@ static void CreateURIList(nsIArray *aItems, nsACString &aURIList) { } } -void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, - GtkSelectionData *aSelectionData, +void nsDragService::SourceDataGet(GtkWidget* aWidget, GdkDragContext* aContext, + GtkSelectionData* aSelectionData, guint32 aTime) { MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::SourceDataGet")); GdkAtom target = gtk_selection_data_get_target(aSelectionData); nsCString mimeFlavor; - gchar *typeName = 0; + gchar* typeName = 0; typeName = gdk_atom_name(target); if (!typeName) { MOZ_LOG(sDragLm, LogLevel::Debug, ("failed to get atom name.\n")); @@ -1399,7 +1399,7 @@ void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, // if someone was asking for text/plain, lookup unicode instead so // we can convert it. bool needToDoConversionToPlainText = false; - const char *actualFlavor; + const char* actualFlavor; if (mimeFlavor.EqualsLiteral(kTextMime) || mimeFlavor.EqualsLiteral(gTextPlainUTF8Type)) { actualFlavor = kUnicodeMime; @@ -1420,12 +1420,12 @@ void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, // Someone is asking for the special Direct Save Protocol type. else if (mimeFlavor.EqualsLiteral(gXdndDirectSaveType)) { // Indicate failure by default. - gtk_selection_data_set(aSelectionData, target, 8, (guchar *)"E", 1); + gtk_selection_data_set(aSelectionData, target, 8, (guchar*)"E", 1); GdkAtom property = gdk_atom_intern(gXdndDirectSaveType, FALSE); GdkAtom type = gdk_atom_intern(kTextMime, FALSE); - guchar *data; + guchar* data; gint length; if (!gdk_property_get(gdk_drag_context_get_source_window(aContext), property, type, 0, INT32_MAX, FALSE, nullptr, @@ -1434,13 +1434,13 @@ void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, } // Zero-terminate the string. - data = (guchar *)g_realloc(data, length + 1); + data = (guchar*)g_realloc(data, length + 1); if (!data) return; data[length] = '\0'; - gchar *hostname; - char *gfullpath = - g_filename_from_uri((const gchar *)data, &hostname, nullptr); + gchar* hostname; + char* gfullpath = + g_filename_from_uri((const gchar*)data, &hostname, nullptr); g_free(data); if (!gfullpath) return; @@ -1465,7 +1465,7 @@ void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, ("ignored drag because of different host.\n")); // Special error code "F" for this case. - gtk_selection_data_set(aSelectionData, target, 8, (guchar *)"F", 1); + gtk_selection_data_set(aSelectionData, target, 8, (guchar*)"F", 1); g_free(hostname); return; } @@ -1510,21 +1510,21 @@ void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, if (strcmp(actualFlavor, kFilePromiseMime) == 0) { if (NS_SUCCEEDED(rv)) { // Indicate success. - gtk_selection_data_set(aSelectionData, target, 8, (guchar *)"S", 1); + gtk_selection_data_set(aSelectionData, target, 8, (guchar*)"S", 1); } return; } if (NS_SUCCEEDED(rv)) { - void *tmpData = nullptr; + void* tmpData = nullptr; uint32_t tmpDataLen = 0; nsPrimitiveHelpers::CreateDataFromPrimitive( nsDependentCString(actualFlavor), data, &tmpData, &tmpDataLen); // if required, do the extra work to convert unicode to plain // text and replace the output values with the plain text. if (needToDoConversionToPlainText) { - char *plainTextData = nullptr; - char16_t *castedUnicode = reinterpret_cast(tmpData); + char* plainTextData = nullptr; + char16_t* castedUnicode = reinterpret_cast(tmpData); uint32_t plainTextLen = 0; UTF16ToNewUTF8(castedUnicode, tmpDataLen / 2, &plainTextData, &plainTextLen); @@ -1537,7 +1537,7 @@ void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, } if (tmpData) { // this copies the data - gtk_selection_data_set(aSelectionData, target, 8, (guchar *)tmpData, + gtk_selection_data_set(aSelectionData, target, 8, (guchar*)tmpData, tmpDataLen); // this wasn't allocated with glib free(tmpData); @@ -1547,7 +1547,7 @@ void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, // fall back for text/uri-list nsAutoCString list; CreateURIList(mSourceDataItems, list); - gtk_selection_data_set(aSelectionData, target, 8, (guchar *)list.get(), + gtk_selection_data_set(aSelectionData, target, 8, (guchar*)list.get(), list.Length()); return; } @@ -1555,7 +1555,7 @@ void nsDragService::SourceDataGet(GtkWidget *aWidget, GdkDragContext *aContext, } } -void nsDragService::SourceBeginDrag(GdkDragContext *aContext) { +void nsDragService::SourceBeginDrag(GdkDragContext* aContext) { nsCOMPtr transferable = do_QueryElementAt(mSourceDataItems, 0); if (!transferable) return; @@ -1589,17 +1589,17 @@ void nsDragService::SourceBeginDrag(GdkDragContext *aContext) { gdk_property_change(gdk_drag_context_get_source_window(aContext), property, type, 8, GDK_PROP_MODE_REPLACE, - (const guchar *)fileNameCStr.get(), + (const guchar*)fileNameCStr.get(), fileNameCStr.Length()); } } } -void nsDragService::SetDragIcon(GdkDragContext *aContext) { +void nsDragService::SetDragIcon(GdkDragContext* aContext) { if (!mHasImage && !mSelection) return; LayoutDeviceIntRect dragRect; - nsPresContext *pc; + nsPresContext* pc; RefPtr surface; DrawDrag(mSourceNode, mRegion, mScreenPosition, &dragRect, &surface, &pc); if (!pc) return; @@ -1616,13 +1616,13 @@ void nsDragService::SetDragIcon(GdkDragContext *aContext) { // Fix this once a new GTK version ships that does not destroy our // widget in gtk_drag_set_icon_widget. if (mDragPopup && gtk_check_version(3, 19, 4)) { - GtkWidget *gtkWidget = nullptr; - nsIFrame *frame = mDragPopup->GetPrimaryFrame(); + GtkWidget* gtkWidget = nullptr; + nsIFrame* frame = mDragPopup->GetPrimaryFrame(); if (frame) { // DrawDrag ensured that this is a popup frame. nsCOMPtr widget = frame->GetNearestWidget(); if (widget) { - gtkWidget = (GtkWidget *)widget->GetNativeData(NS_NATIVE_SHELLWIDGET); + gtkWidget = (GtkWidget*)widget->GetNativeData(NS_NATIVE_SHELLWIDGET); if (gtkWidget) { OpenDragPopup(); gtk_drag_set_icon_widget(aContext, gtkWidget, offsetX, offsetY); @@ -1631,7 +1631,7 @@ void nsDragService::SetDragIcon(GdkDragContext *aContext) { } } else if (surface) { if (!SetAlphaPixmap(surface, aContext, offsetX, offsetY, dragRect)) { - GdkPixbuf *dragPixbuf = nsImageToPixbuf::SourceSurfaceToPixbuf( + GdkPixbuf* dragPixbuf = nsImageToPixbuf::SourceSurfaceToPixbuf( surface, dragRect.width, dragRect.height); if (dragPixbuf) { gtk_drag_set_icon_pixbuf(aContext, dragPixbuf, offsetX, offsetY); @@ -1641,30 +1641,30 @@ void nsDragService::SetDragIcon(GdkDragContext *aContext) { } } -static void invisibleSourceDragBegin(GtkWidget *aWidget, - GdkDragContext *aContext, gpointer aData) { +static void invisibleSourceDragBegin(GtkWidget* aWidget, + GdkDragContext* aContext, gpointer aData) { MOZ_LOG(sDragLm, LogLevel::Debug, ("invisibleSourceDragBegin")); - nsDragService *dragService = (nsDragService *)aData; + nsDragService* dragService = (nsDragService*)aData; dragService->SourceBeginDrag(aContext); dragService->SetDragIcon(aContext); } -static void invisibleSourceDragDataGet(GtkWidget *aWidget, - GdkDragContext *aContext, - GtkSelectionData *aSelectionData, +static void invisibleSourceDragDataGet(GtkWidget* aWidget, + GdkDragContext* aContext, + GtkSelectionData* aSelectionData, guint aInfo, guint32 aTime, gpointer aData) { MOZ_LOG(sDragLm, LogLevel::Debug, ("invisibleSourceDragDataGet")); - nsDragService *dragService = (nsDragService *)aData; + nsDragService* dragService = (nsDragService*)aData; dragService->SourceDataGet(aWidget, aContext, aSelectionData, aTime); } -static gboolean invisibleSourceDragFailed(GtkWidget *aWidget, - GdkDragContext *aContext, +static gboolean invisibleSourceDragFailed(GtkWidget* aWidget, + GdkDragContext* aContext, gint aResult, gpointer aData) { MOZ_LOG(sDragLm, LogLevel::Debug, ("invisibleSourceDragFailed %i", aResult)); - nsDragService *dragService = (nsDragService *)aData; + nsDragService* dragService = (nsDragService*)aData; // End the drag session now (rather than waiting for the drag-end signal) // so that operations performed on dropEffect == none can start immediately // rather than waiting for the drag-failed animation to finish. @@ -1676,10 +1676,10 @@ static gboolean invisibleSourceDragFailed(GtkWidget *aWidget, return FALSE; } -static void invisibleSourceDragEnd(GtkWidget *aWidget, GdkDragContext *aContext, +static void invisibleSourceDragEnd(GtkWidget* aWidget, GdkDragContext* aContext, gpointer aData) { MOZ_LOG(sDragLm, LogLevel::Debug, ("invisibleSourceDragEnd")); - nsDragService *dragService = (nsDragService *)aData; + nsDragService* dragService = (nsDragService*)aData; // The drag has ended. Release the hostages! dragService->SourceEndDragSession(aContext, MOZ_GTK_DRAG_RESULT_SUCCESS); @@ -1727,8 +1727,8 @@ static void invisibleSourceDragEnd(GtkWidget *aWidget, GdkDragContext *aContext, // expect nested events, while accessing an event's dataTransfer for example. gboolean nsDragService::ScheduleMotionEvent( - nsWindow *aWindow, GdkDragContext *aDragContext, - nsWaylandDragContext *aWaylandDragContext, + nsWindow* aWindow, GdkDragContext* aDragContext, + nsWaylandDragContext* aWaylandDragContext, LayoutDeviceIntPoint aWindowPoint, guint aTime) { if (aDragContext && mScheduledTask == eDragTaskMotion) { // The drag source has sent another motion message before we've @@ -1756,8 +1756,8 @@ void nsDragService::ScheduleLeaveEvent() { } gboolean nsDragService::ScheduleDropEvent( - nsWindow *aWindow, GdkDragContext *aDragContext, - nsWaylandDragContext *aWaylandDragContext, + nsWindow* aWindow, GdkDragContext* aDragContext, + nsWaylandDragContext* aWaylandDragContext, LayoutDeviceIntPoint aWindowPoint, guint aTime) { if (!Schedule(eDragTaskDrop, aWindow, aDragContext, aWaylandDragContext, aWindowPoint, aTime)) { @@ -1771,9 +1771,9 @@ gboolean nsDragService::ScheduleDropEvent( return TRUE; } -gboolean nsDragService::Schedule(DragTask aTask, nsWindow *aWindow, - GdkDragContext *aDragContext, - nsWaylandDragContext *aWaylandDragContext, +gboolean nsDragService::Schedule(DragTask aTask, nsWindow* aWindow, + GdkDragContext* aDragContext, + nsWaylandDragContext* aWaylandDragContext, LayoutDeviceIntPoint aWindowPoint, guint aTime) { // If there is an existing leave or motion task scheduled, then that @@ -1812,7 +1812,7 @@ gboolean nsDragService::Schedule(DragTask aTask, nsWindow *aWindow, } gboolean nsDragService::TaskDispatchCallback(gpointer data) { - RefPtr dragService = static_cast(data); + RefPtr dragService = static_cast(data); return dragService->RunScheduledTask(); } diff --git a/widget/gtk/nsDragService.h b/widget/gtk/nsDragService.h index bd5c8f8028028..c05d7fef5c728 100644 --- a/widget/gtk/nsDragService.h +++ b/widget/gtk/nsDragService.h @@ -27,8 +27,8 @@ class SourceSurface; template class nsGObjectRefTraits : public nsPointerRefTraits { public: - static void Release(T *aPtr) { g_object_unref(aPtr); } - static void AddRef(T *aPtr) { g_object_ref(aPtr); } + static void Release(T* aPtr) { g_object_unref(aPtr); } + static void AddRef(T* aPtr) { g_object_ref(aPtr); } }; #endif @@ -59,12 +59,12 @@ class nsDragService final : public nsBaseDragService, public nsIObserver { // nsBaseDragService virtual nsresult InvokeDragSessionImpl( - nsIArray *anArrayTransferables, - const mozilla::Maybe &aRegion, + nsIArray* anArrayTransferables, + const mozilla::Maybe& aRegion, uint32_t aActionType) override; // nsIDragService - NS_IMETHOD InvokeDragSession(nsINode *aDOMNode, nsIPrincipal *aPrincipal, - nsIArray *anArrayTransferables, + NS_IMETHOD InvokeDragSession(nsINode* aDOMNode, nsIPrincipal* aPrincipal, + nsIArray* anArrayTransferables, uint32_t aActionType, nsContentPolicyType aContentPolicyType) override; NS_IMETHOD StartDragSession() override; @@ -72,12 +72,12 @@ class nsDragService final : public nsBaseDragService, public nsIObserver { // nsIDragSession NS_IMETHOD SetCanDrop(bool aCanDrop) override; - NS_IMETHOD GetCanDrop(bool *aCanDrop) override; - NS_IMETHOD GetNumDropItems(uint32_t *aNumItems) override; - NS_IMETHOD GetData(nsITransferable *aTransferable, + NS_IMETHOD GetCanDrop(bool* aCanDrop) override; + NS_IMETHOD GetNumDropItems(uint32_t* aNumItems) override; + NS_IMETHOD GetData(nsITransferable* aTransferable, uint32_t aItemIndex) override; - NS_IMETHOD IsDataFlavorSupported(const char *aDataFlavor, - bool *_retval) override; + NS_IMETHOD IsDataFlavorSupported(const char* aDataFlavor, + bool* _retval) override; NS_IMETHOD UpdateDragEffect() override; @@ -86,21 +86,21 @@ class nsDragService final : public nsBaseDragService, public nsIObserver { static already_AddRefed GetInstance(); - void TargetDataReceived(GtkWidget *aWidget, GdkDragContext *aContext, gint aX, - gint aY, GtkSelectionData *aSelection_data, + void TargetDataReceived(GtkWidget* aWidget, GdkDragContext* aContext, gint aX, + gint aY, GtkSelectionData* aSelection_data, guint aInfo, guint32 aTime); - gboolean ScheduleMotionEvent(nsWindow *aWindow, GdkDragContext *aDragContext, - nsWaylandDragContext *aPendingWaylandDragContext, + gboolean ScheduleMotionEvent(nsWindow* aWindow, GdkDragContext* aDragContext, + nsWaylandDragContext* aPendingWaylandDragContext, mozilla::LayoutDeviceIntPoint aWindowPoint, guint aTime); void ScheduleLeaveEvent(); - gboolean ScheduleDropEvent(nsWindow *aWindow, GdkDragContext *aDragContext, - nsWaylandDragContext *aPendingWaylandDragContext, + gboolean ScheduleDropEvent(nsWindow* aWindow, GdkDragContext* aDragContext, + nsWaylandDragContext* aPendingWaylandDragContext, mozilla::LayoutDeviceIntPoint aWindowPoint, guint aTime); - nsWindow *GetMostRecentDestWindow() { + nsWindow* GetMostRecentDestWindow() { return mScheduledTask == eDragTaskNone ? mTargetWindow : mPendingWindow; } @@ -109,14 +109,14 @@ class nsDragService final : public nsBaseDragService, public nsIObserver { // These methods are public only so that they can be called from functions // with C calling conventions. They are called for drags started with the // invisible widget. - void SourceEndDragSession(GdkDragContext *aContext, gint aResult); - void SourceDataGet(GtkWidget *widget, GdkDragContext *context, - GtkSelectionData *selection_data, guint32 aTime); + void SourceEndDragSession(GdkDragContext* aContext, gint aResult); + void SourceDataGet(GtkWidget* widget, GdkDragContext* context, + GtkSelectionData* selection_data, guint32 aTime); - void SourceBeginDrag(GdkDragContext *aContext); + void SourceBeginDrag(GdkDragContext* aContext); // set the drag icon during drag-begin - void SetDragIcon(GdkDragContext *aContext); + void SetDragIcon(GdkDragContext* aContext); protected: virtual ~nsDragService(); @@ -179,7 +179,7 @@ class nsDragService final : public nsBaseDragService, public nsIObserver { // have we received our drag data? bool mTargetDragDataReceived; // last data received and its length - void *mTargetDragData; + void* mTargetDragData; uint32_t mTargetDragDataLen; // is the current target drag context contain a list? bool IsTargetContextList(void); @@ -192,22 +192,22 @@ class nsDragService final : public nsBaseDragService, public nsIObserver { // source side vars // the source of our drags - GtkWidget *mHiddenWidget; + GtkWidget* mHiddenWidget; // our source data items nsCOMPtr mSourceDataItems; // get a list of the sources in gtk's format - GtkTargetList *GetSourceList(void); + GtkTargetList* GetSourceList(void); // attempts to create a semi-transparent drag image. Returns TRUE if // successful, FALSE if not - bool SetAlphaPixmap(SourceSurface *aPixbuf, GdkDragContext *aContext, + bool SetAlphaPixmap(SourceSurface* aPixbuf, GdkDragContext* aContext, int32_t aXOffset, int32_t aYOffset, - const mozilla::LayoutDeviceIntRect &dragRect); + const mozilla::LayoutDeviceIntRect& dragRect); - gboolean Schedule(DragTask aTask, nsWindow *aWindow, - GdkDragContext *aDragContext, - nsWaylandDragContext *aPendingWaylandDragContext, + gboolean Schedule(DragTask aTask, nsWindow* aWindow, + GdkDragContext* aDragContext, + nsWaylandDragContext* aPendingWaylandDragContext, mozilla::LayoutDeviceIntPoint aWindowPoint, guint aTime); // Callback for g_idle_add_full() to run mScheduledTask. @@ -215,9 +215,9 @@ class nsDragService final : public nsBaseDragService, public nsIObserver { gboolean RunScheduledTask(); void UpdateDragAction(); void DispatchMotionEvents(); - void ReplyToDragMotion(GdkDragContext *aDragContext); + void ReplyToDragMotion(GdkDragContext* aDragContext); #ifdef MOZ_WAYLAND - void ReplyToDragMotion(nsWaylandDragContext *aDragContext); + void ReplyToDragMotion(nsWaylandDragContext* aDragContext); #endif gboolean DispatchDropEvent(); static uint32_t GetCurrentModifiers(); diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp index 12e38f26bf3b4..81ac66c30038f 100644 --- a/widget/gtk/nsFilePicker.cpp +++ b/widget/gtk/nsFilePicker.cpp @@ -32,7 +32,7 @@ using namespace mozilla; // bug 1184009 #define MAX_PREVIEW_SOURCE_SIZE 4096 -nsIFile *nsFilePicker::mPrevDisplayDirectory = nullptr; +nsIFile* nsFilePicker::mPrevDisplayDirectory = nullptr; void nsFilePicker::Shutdown() { NS_IF_RELEASE(mPrevDisplayDirectory); } @@ -62,10 +62,10 @@ static GtkFileChooserAction GetGtkFileChooserAction(int16_t aMode) { return action; } -static void UpdateFilePreviewWidget(GtkFileChooser *file_chooser, +static void UpdateFilePreviewWidget(GtkFileChooser* file_chooser, gpointer preview_widget_voidptr) { - GtkImage *preview_widget = GTK_IMAGE(preview_widget_voidptr); - char *image_filename = gtk_file_chooser_get_preview_filename(file_chooser); + GtkImage* preview_widget = GTK_IMAGE(preview_widget_voidptr); + char* image_filename = gtk_file_chooser_get_preview_filename(file_chooser); struct stat st_buf; if (!image_filename) { @@ -85,7 +85,7 @@ static void UpdateFilePreviewWidget(GtkFileChooser *file_chooser, return; /* stat failed or file is not regular */ } - GdkPixbufFormat *preview_format = + GdkPixbufFormat* preview_format = gdk_pixbuf_get_file_info(image_filename, &preview_width, &preview_height); if (!preview_format || preview_width <= 0 || preview_height <= 0 || preview_width > MAX_PREVIEW_SOURCE_SIZE || @@ -95,7 +95,7 @@ static void UpdateFilePreviewWidget(GtkFileChooser *file_chooser, return; } - GdkPixbuf *preview_pixbuf = nullptr; + GdkPixbuf* preview_pixbuf = nullptr; // Only scale down images that are too big if (preview_width > MAX_PREVIEW_SIZE || preview_height > MAX_PREVIEW_SIZE) { preview_pixbuf = gdk_pixbuf_new_from_file_at_size( @@ -111,7 +111,7 @@ static void UpdateFilePreviewWidget(GtkFileChooser *file_chooser, return; } - GdkPixbuf *preview_pixbuf_temp = preview_pixbuf; + GdkPixbuf* preview_pixbuf_temp = preview_pixbuf; preview_pixbuf = gdk_pixbuf_apply_embedded_orientation(preview_pixbuf_temp); g_object_unref(preview_pixbuf_temp); @@ -127,7 +127,7 @@ static void UpdateFilePreviewWidget(GtkFileChooser *file_chooser, gtk_file_chooser_set_preview_widget_active(file_chooser, TRUE); } -static nsAutoCString MakeCaseInsensitiveShellGlob(const char *aPattern) { +static nsAutoCString MakeCaseInsensitiveShellGlob(const char* aPattern) { // aPattern is UTF8 nsAutoCString result; unsigned int len = strlen(aPattern); @@ -171,35 +171,35 @@ nsFilePicker::~nsFilePicker() {} void ReadMultipleFiles(gpointer filename, gpointer array) { nsCOMPtr localfile; nsresult rv = - NS_NewNativeLocalFile(nsDependentCString(static_cast(filename)), + NS_NewNativeLocalFile(nsDependentCString(static_cast(filename)), false, getter_AddRefs(localfile)); if (NS_SUCCEEDED(rv)) { - nsCOMArray &files = *static_cast *>(array); + nsCOMArray& files = *static_cast*>(array); files.AppendObject(localfile); } g_free(filename); } -void nsFilePicker::ReadValuesFromFileChooser(void *file_chooser) { +void nsFilePicker::ReadValuesFromFileChooser(void* file_chooser) { mFiles.Clear(); if (mMode == nsIFilePicker::modeOpenMultiple) { mFileURL.Truncate(); - GSList *list = + GSList* list = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(file_chooser)); g_slist_foreach(list, ReadMultipleFiles, static_cast(&mFiles)); g_slist_free(list); } else { - gchar *filename = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(file_chooser)); + gchar* filename = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(file_chooser)); mFileURL.Assign(filename); g_free(filename); } - GtkFileFilter *filter = + GtkFileFilter* filter = gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(file_chooser)); - GSList *filter_list = + GSList* filter_list = gtk_file_chooser_list_filters(GTK_FILE_CHOOSER(file_chooser)); mSelectedType = static_cast(g_slist_index(filter_list, filter)); @@ -217,7 +217,7 @@ void nsFilePicker::ReadValuesFromFileChooser(void *file_chooser) { } } -void nsFilePicker::InitNative(nsIWidget *aParent, const nsAString &aTitle) { +void nsFilePicker::InitNative(nsIWidget* aParent, const nsAString& aTitle) { mParentWidget = aParent; mTitle.Assign(aTitle); } @@ -229,7 +229,7 @@ nsFilePicker::AppendFilters(int32_t aFilterMask) { } NS_IMETHODIMP -nsFilePicker::AppendFilter(const nsAString &aTitle, const nsAString &aFilter) { +nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) { if (aFilter.EqualsLiteral("..apps")) { // No platform specific thing we can do here, really.... return NS_OK; @@ -246,34 +246,34 @@ nsFilePicker::AppendFilter(const nsAString &aTitle, const nsAString &aFilter) { } NS_IMETHODIMP -nsFilePicker::SetDefaultString(const nsAString &aString) { +nsFilePicker::SetDefaultString(const nsAString& aString) { mDefault = aString; return NS_OK; } NS_IMETHODIMP -nsFilePicker::GetDefaultString(nsAString &aString) { +nsFilePicker::GetDefaultString(nsAString& aString) { // Per API... return NS_ERROR_FAILURE; } NS_IMETHODIMP -nsFilePicker::SetDefaultExtension(const nsAString &aExtension) { +nsFilePicker::SetDefaultExtension(const nsAString& aExtension) { mDefaultExtension = aExtension; return NS_OK; } NS_IMETHODIMP -nsFilePicker::GetDefaultExtension(nsAString &aExtension) { +nsFilePicker::GetDefaultExtension(nsAString& aExtension) { aExtension = mDefaultExtension; return NS_OK; } NS_IMETHODIMP -nsFilePicker::GetFilterIndex(int32_t *aFilterIndex) { +nsFilePicker::GetFilterIndex(int32_t* aFilterIndex) { *aFilterIndex = mSelectedType; return NS_OK; @@ -287,7 +287,7 @@ nsFilePicker::SetFilterIndex(int32_t aFilterIndex) { } NS_IMETHODIMP -nsFilePicker::GetFile(nsIFile **aFile) { +nsFilePicker::GetFile(nsIFile** aFile) { NS_ENSURE_ARG_POINTER(aFile); *aFile = nullptr; @@ -307,13 +307,13 @@ nsFilePicker::GetFile(nsIFile **aFile) { } NS_IMETHODIMP -nsFilePicker::GetFileURL(nsIURI **aFileURL) { +nsFilePicker::GetFileURL(nsIURI** aFileURL) { *aFileURL = nullptr; return NS_NewURI(aFileURL, mFileURL); } NS_IMETHODIMP -nsFilePicker::GetFiles(nsISimpleEnumerator **aFiles) { +nsFilePicker::GetFiles(nsISimpleEnumerator** aFiles) { NS_ENSURE_ARG_POINTER(aFiles); if (mMode == nsIFilePicker::modeOpenMultiple) { @@ -323,7 +323,7 @@ nsFilePicker::GetFiles(nsISimpleEnumerator **aFiles) { return NS_ERROR_FAILURE; } -nsresult nsFilePicker::Show(int16_t *aReturn) { +nsresult nsFilePicker::Show(int16_t* aReturn) { NS_ENSURE_ARG_POINTER(aReturn); nsresult rv = Open(nullptr); @@ -338,19 +338,19 @@ nsresult nsFilePicker::Show(int16_t *aReturn) { } NS_IMETHODIMP -nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) { +nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { // Can't show two dialogs concurrently with the same filepicker if (mRunning) return NS_ERROR_NOT_AVAILABLE; nsCString title; title.Adopt(ToNewUTF8String(mTitle)); - GtkWindow *parent_widget = + GtkWindow* parent_widget = GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)); GtkFileChooserAction action = GetGtkFileChooserAction(mMode); - const gchar *accept_button; + const gchar* accept_button; NS_ConvertUTF16toUTF8 buttonLabel(mOkButtonLabel); if (!mOkButtonLabel.IsEmpty()) { accept_button = buttonLabel.get(); @@ -358,7 +358,7 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) { accept_button = nullptr; } - void *file_chooser = + void* file_chooser = GtkFileChooserNew(title.get(), parent_widget, action, accept_button); // If we have --enable-proxy-bypass-protection, then don't allow @@ -371,7 +371,7 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) { if (action == GTK_FILE_CHOOSER_ACTION_OPEN || action == GTK_FILE_CHOOSER_ACTION_SAVE) { - GtkWidget *img_preview = gtk_image_new(); + GtkWidget* img_preview = gtk_image_new(); gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(file_chooser), img_preview); g_signal_connect(file_chooser, "update-preview", @@ -418,13 +418,13 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) { // delegate by the time this gets processed in the event loop. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1166741 if (GTK_IS_DIALOG(file_chooser)) { - GtkDialog *dialog = GTK_DIALOG(file_chooser); - GtkContainer *area = GTK_CONTAINER(gtk_dialog_get_content_area(dialog)); + GtkDialog* dialog = GTK_DIALOG(file_chooser); + GtkContainer* area = GTK_CONTAINER(gtk_dialog_get_content_area(dialog)); gtk_container_forall( area, - [](GtkWidget *widget, gpointer data) { + [](GtkWidget* widget, gpointer data) { if (GTK_IS_FILE_CHOOSER_WIDGET(widget)) { - auto result = static_cast(data); + auto result = static_cast(data); *result = GTK_FILE_CHOOSER_WIDGET(widget); } }, @@ -451,12 +451,12 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) { // This is fun... the GTK file picker does not accept a list of filters // so we need to split out each string, and add it manually. - char **patterns = g_strsplit(mFilters[i].get(), ";", -1); + char** patterns = g_strsplit(mFilters[i].get(), ";", -1); if (!patterns) { return NS_ERROR_OUT_OF_MEMORY; } - GtkFileFilter *filter = gtk_file_filter_new(); + GtkFileFilter* filter = gtk_file_filter_new(); for (int j = 0; patterns[j] != nullptr; ++j) { nsAutoCString caseInsensitiveFilter = MakeCaseInsensitiveShellGlob(g_strstrip(patterns[j])); @@ -467,11 +467,11 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) { if (!mFilterNames[i].IsEmpty()) { // If we have a name for our filter, let's use that. - const char *filter_name = mFilterNames[i].get(); + const char* filter_name = mFilterNames[i].get(); gtk_file_filter_set_name(filter, filter_name); } else { // If we don't have a name, let's just use the filter pattern. - const char *filter_pattern = mFilters[i].get(); + const char* filter_pattern = mFilters[i].get(); gtk_file_filter_set_name(filter, filter_pattern); } @@ -496,18 +496,18 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback) { } /* static */ -void nsFilePicker::OnResponse(void *file_chooser, gint response_id, +void nsFilePicker::OnResponse(void* file_chooser, gint response_id, gpointer user_data) { - static_cast(user_data)->Done(file_chooser, response_id); + static_cast(user_data)->Done(file_chooser, response_id); } /* static */ -void nsFilePicker::OnDestroy(GtkWidget *file_chooser, gpointer user_data) { - static_cast(user_data)->Done(file_chooser, - GTK_RESPONSE_CANCEL); +void nsFilePicker::OnDestroy(GtkWidget* file_chooser, gpointer user_data) { + static_cast(user_data)->Done(file_chooser, + GTK_RESPONSE_CANCEL); } -void nsFilePicker::Done(void *file_chooser, gint response) { +void nsFilePicker::Done(void* file_chooser, gint response) { mRunning = false; int16_t result; @@ -578,14 +578,13 @@ void nsFilePicker::Done(void *file_chooser, gint response) { } // All below functions available as of GTK 3.20+ -void *nsFilePicker::GtkFileChooserNew(const gchar *title, GtkWindow *parent, +void* nsFilePicker::GtkFileChooserNew(const gchar* title, GtkWindow* parent, GtkFileChooserAction action, - const gchar *accept_label) { + const gchar* accept_label) { static auto sGtkFileChooserNativeNewPtr = - (void *(*)(const gchar *, GtkWindow *, GtkFileChooserAction, - const gchar *, - const gchar *))dlsym(RTLD_DEFAULT, - "gtk_file_chooser_native_new"); + (void* (*)(const gchar*, GtkWindow*, GtkFileChooserAction, const gchar*, + const gchar*))dlsym(RTLD_DEFAULT, + "gtk_file_chooser_native_new"); if (mUseNativeFileChooser && sGtkFileChooserNativeNewPtr != nullptr) { return (*sGtkFileChooserNativeNewPtr)(title, parent, action, accept_label, nullptr); @@ -594,7 +593,7 @@ void *nsFilePicker::GtkFileChooserNew(const gchar *title, GtkWindow *parent, accept_label = (action == GTK_FILE_CHOOSER_ACTION_SAVE) ? GTK_STOCK_SAVE : GTK_STOCK_OPEN; } - GtkWidget *file_chooser = gtk_file_chooser_dialog_new( + GtkWidget* file_chooser = gtk_file_chooser_dialog_new( title, parent, action, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, accept_label, GTK_RESPONSE_ACCEPT, nullptr); gtk_dialog_set_alternative_button_order( @@ -602,9 +601,9 @@ void *nsFilePicker::GtkFileChooserNew(const gchar *title, GtkWindow *parent, return file_chooser; } -void nsFilePicker::GtkFileChooserShow(void *file_chooser) { +void nsFilePicker::GtkFileChooserShow(void* file_chooser) { static auto sGtkNativeDialogShowPtr = - (void (*)(void *))dlsym(RTLD_DEFAULT, "gtk_native_dialog_show"); + (void (*)(void*))dlsym(RTLD_DEFAULT, "gtk_native_dialog_show"); if (mUseNativeFileChooser && sGtkNativeDialogShowPtr != nullptr) { (*sGtkNativeDialogShowPtr)(file_chooser); } else { @@ -613,9 +612,9 @@ void nsFilePicker::GtkFileChooserShow(void *file_chooser) { } } -void nsFilePicker::GtkFileChooserDestroy(void *file_chooser) { +void nsFilePicker::GtkFileChooserDestroy(void* file_chooser) { static auto sGtkNativeDialogDestroyPtr = - (void (*)(void *))dlsym(RTLD_DEFAULT, "gtk_native_dialog_destroy"); + (void (*)(void*))dlsym(RTLD_DEFAULT, "gtk_native_dialog_destroy"); if (mUseNativeFileChooser && sGtkNativeDialogDestroyPtr != nullptr) { (*sGtkNativeDialogDestroyPtr)(file_chooser); } else { @@ -623,15 +622,15 @@ void nsFilePicker::GtkFileChooserDestroy(void *file_chooser) { } } -void nsFilePicker::GtkFileChooserSetModal(void *file_chooser, - GtkWindow *parent_widget, +void nsFilePicker::GtkFileChooserSetModal(void* file_chooser, + GtkWindow* parent_widget, gboolean modal) { - static auto sGtkNativeDialogSetModalPtr = (void (*)(void *, gboolean))dlsym( + static auto sGtkNativeDialogSetModalPtr = (void (*)(void*, gboolean))dlsym( RTLD_DEFAULT, "gtk_native_dialog_set_modal"); if (mUseNativeFileChooser && sGtkNativeDialogSetModalPtr != nullptr) { (*sGtkNativeDialogSetModalPtr)(file_chooser, modal); } else { - GtkWindow *window = GTK_WINDOW(file_chooser); + GtkWindow* window = GTK_WINDOW(file_chooser); gtk_window_set_modal(window, modal); if (parent_widget != nullptr) { gtk_window_set_destroy_with_parent(window, modal); diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h index 92728eb6aefc6..00b1520e827bf 100644 --- a/widget/gtk/nsFilePicker.h +++ b/widget/gtk/nsFilePicker.h @@ -23,35 +23,35 @@ class nsFilePicker : public nsBaseFilePicker { NS_DECL_ISUPPORTS // nsIFilePicker (less what's in nsBaseFilePicker) - NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback) override; + NS_IMETHOD Open(nsIFilePickerShownCallback* aCallback) override; NS_IMETHOD AppendFilters(int32_t aFilterMask) override; - NS_IMETHOD AppendFilter(const nsAString &aTitle, - const nsAString &aFilter) override; - NS_IMETHOD SetDefaultString(const nsAString &aString) override; - NS_IMETHOD GetDefaultString(nsAString &aString) override; - NS_IMETHOD SetDefaultExtension(const nsAString &aExtension) override; - NS_IMETHOD GetDefaultExtension(nsAString &aExtension) override; - NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex) override; + NS_IMETHOD AppendFilter(const nsAString& aTitle, + const nsAString& aFilter) override; + NS_IMETHOD SetDefaultString(const nsAString& aString) override; + NS_IMETHOD GetDefaultString(nsAString& aString) override; + NS_IMETHOD SetDefaultExtension(const nsAString& aExtension) override; + NS_IMETHOD GetDefaultExtension(nsAString& aExtension) override; + NS_IMETHOD GetFilterIndex(int32_t* aFilterIndex) override; NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override; - NS_IMETHOD GetFile(nsIFile **aFile) override; - NS_IMETHOD GetFileURL(nsIURI **aFileURL) override; - NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles) override; + NS_IMETHOD GetFile(nsIFile** aFile) override; + NS_IMETHOD GetFileURL(nsIURI** aFileURL) override; + NS_IMETHOD GetFiles(nsISimpleEnumerator** aFiles) override; // nsBaseFilePicker - virtual void InitNative(nsIWidget *aParent, const nsAString &aTitle) override; + virtual void InitNative(nsIWidget* aParent, const nsAString& aTitle) override; static void Shutdown(); protected: virtual ~nsFilePicker(); - nsresult Show(int16_t *aReturn) override; - void ReadValuesFromFileChooser(void *file_chooser); + nsresult Show(int16_t* aReturn) override; + void ReadValuesFromFileChooser(void* file_chooser); - static void OnResponse(void *file_chooser, gint response_id, + static void OnResponse(void* file_chooser, gint response_id, gpointer user_data); - static void OnDestroy(GtkWidget *file_chooser, gpointer user_data); - void Done(void *file_chooser, gint response_id); + static void OnDestroy(GtkWidget* file_chooser, gpointer user_data); + void Done(void* file_chooser, gint response_id); nsCOMPtr mParentWidget; nsCOMPtr mCallback; @@ -70,18 +70,18 @@ class nsFilePicker : public nsBaseFilePicker { nsTArray mFilterNames; private: - static nsIFile *mPrevDisplayDirectory; + static nsIFile* mPrevDisplayDirectory; - void *GtkFileChooserNew(const gchar *title, GtkWindow *parent, + void* GtkFileChooserNew(const gchar* title, GtkWindow* parent, GtkFileChooserAction action, - const gchar *accept_label); - void GtkFileChooserShow(void *file_chooser); - void GtkFileChooserDestroy(void *file_chooser); - void GtkFileChooserSetModal(void *file_chooser, GtkWindow *parent_widget, + const gchar* accept_label); + void GtkFileChooserShow(void* file_chooser); + void GtkFileChooserDestroy(void* file_chooser); + void GtkFileChooserSetModal(void* file_chooser, GtkWindow* parent_widget, gboolean modal); #ifdef MOZ_WIDGET_GTK - GtkFileChooserWidget *mFileChooserDelegate; + GtkFileChooserWidget* mFileChooserDelegate; #endif bool mUseNativeFileChooser; }; diff --git a/widget/gtk/nsGtkCursors.h b/widget/gtk/nsGtkCursors.h index c8ccb5ac14c61..f30ed593a92aa 100644 --- a/widget/gtk/nsGtkCursors.h +++ b/widget/gtk/nsGtkCursors.h @@ -9,11 +9,11 @@ #define nsGtkCursors_h__ typedef struct { - const unsigned char *bits; - const unsigned char *mask_bits; + const unsigned char* bits; + const unsigned char* mask_bits; int hot_x; int hot_y; - const char *hash; + const char* hash; } nsGtkCursor; /* MOZ_CURSOR_HAND_GRAB */ diff --git a/widget/gtk/nsLookAndFeel.h b/widget/gtk/nsLookAndFeel.h index 302792052448a..41b6667aec865 100644 --- a/widget/gtk/nsLookAndFeel.h +++ b/widget/gtk/nsLookAndFeel.h @@ -22,11 +22,11 @@ class nsLookAndFeel final : public nsXPLookAndFeel { void NativeInit() final; virtual void RefreshImpl() override; - virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult) override; - virtual nsresult GetIntImpl(IntID aID, int32_t &aResult) override; - virtual nsresult GetFloatImpl(FloatID aID, float &aResult) override; - virtual bool GetFontImpl(FontID aID, nsString &aFontName, - gfxFontStyle &aFontStyle) override; + virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) override; + virtual nsresult GetIntImpl(IntID aID, int32_t& aResult) override; + virtual nsresult GetFloatImpl(FloatID aID, float& aResult) override; + virtual bool GetFontImpl(FontID aID, nsString& aFontName, + gfxFontStyle& aFontStyle) override; virtual char16_t GetPasswordCharacterImpl() override; virtual bool GetEchoPasswordImpl() override; diff --git a/widget/gtk/nsPSPrinters.cpp b/widget/gtk/nsPSPrinters.cpp index 0a34c0d114af5..6e34c6eafae9e 100644 --- a/widget/gtk/nsPSPrinters.cpp +++ b/widget/gtk/nsPSPrinters.cpp @@ -36,7 +36,7 @@ nsPSPrinterList::nsPSPrinterList() { /* Check whether the PostScript module has been disabled at runtime */ bool nsPSPrinterList::Enabled() { - const char *val = PR_GetEnv("MOZILLA_POSTSCRIPT_ENABLED"); + const char* val = PR_GetEnv("MOZILLA_POSTSCRIPT_ENABLED"); if (val && (val[0] == '0' || !PL_strcasecmp(val, "false"))) return false; // is the PS module enabled? @@ -44,13 +44,13 @@ bool nsPSPrinterList::Enabled() { } /* Fetch a list of printers handled by the PostsScript module */ -void nsPSPrinterList::GetPrinterList(nsTArray &aList) { +void nsPSPrinterList::GetPrinterList(nsTArray& aList) { aList.Clear(); // Query CUPS for a printer list. The default printer goes to the // head of the output list; others are appended. if (gCupsShim.IsInitialized()) { - cups_dest_t *dests; + cups_dest_t* dests; int num_dests = (gCupsShim.mCupsGetDests)(&dests); if (num_dests) { @@ -85,9 +85,9 @@ void nsPSPrinterList::GetPrinterList(nsTArray &aList) { if (!list.IsEmpty()) { // For each printer (except "default" which was already added), // construct a string "PostScript/" and append it to the list. - char *state; + char* state; - for (char *name = PL_strtok_r(list.BeginWriting(), " ", &state); + for (char* name = PL_strtok_r(list.BeginWriting(), " ", &state); nullptr != name; name = PL_strtok_r(nullptr, " ", &state)) { if (0 != strcmp(name, "default")) { nsAutoCString fullName(NS_POSTSCRIPT_DRIVER_NAME); @@ -100,7 +100,7 @@ void nsPSPrinterList::GetPrinterList(nsTArray &aList) { /* Identify the printer type */ nsPSPrinterList::PrinterType nsPSPrinterList::GetPrinterType( - const nsACString &aName) { + const nsACString& aName) { if (StringBeginsWith(aName, NS_LITERAL_CSTRING(NS_POSTSCRIPT_DRIVER_NAME))) return kTypePS; else if (StringBeginsWith(aName, NS_LITERAL_CSTRING(NS_CUPS_PRINTER))) diff --git a/widget/gtk/nsPrintDialogGTK.h b/widget/gtk/nsPrintDialogGTK.h index fb58530749c62..37c5698dd0496 100644 --- a/widget/gtk/nsPrintDialogGTK.h +++ b/widget/gtk/nsPrintDialogGTK.h @@ -28,10 +28,10 @@ class nsPrintDialogServiceGTK : public nsIPrintDialogService { NS_DECL_ISUPPORTS NS_IMETHOD Init() override; - NS_IMETHOD Show(nsPIDOMWindowOuter *aParent, nsIPrintSettings *aSettings, - nsIWebBrowserPrint *aWebBrowserPrint) override; - NS_IMETHOD ShowPageSetup(nsPIDOMWindowOuter *aParent, - nsIPrintSettings *aSettings) override; + NS_IMETHOD Show(nsPIDOMWindowOuter* aParent, nsIPrintSettings* aSettings, + nsIWebBrowserPrint* aWebBrowserPrint) override; + NS_IMETHOD ShowPageSetup(nsPIDOMWindowOuter* aParent, + nsIPrintSettings* aSettings) override; }; #endif diff --git a/widget/gtk/nsPrintSettingsGTK.h b/widget/gtk/nsPrintSettingsGTK.h index e8c732aa82846..708154ac0c477 100644 --- a/widget/gtk/nsPrintSettingsGTK.h +++ b/widget/gtk/nsPrintSettingsGTK.h @@ -36,14 +36,14 @@ class nsPrintSettingsGTK : public nsPrintSettings { // objects, not local variables. This allows a simpler settings implementation // between Gecko and GTK. - GtkPageSetup *GetGtkPageSetup() { return mPageSetup; }; - void SetGtkPageSetup(GtkPageSetup *aPageSetup); + GtkPageSetup* GetGtkPageSetup() { return mPageSetup; }; + void SetGtkPageSetup(GtkPageSetup* aPageSetup); - GtkPrintSettings *GetGtkPrintSettings() { return mPrintSettings; }; - void SetGtkPrintSettings(GtkPrintSettings *aPrintSettings); + GtkPrintSettings* GetGtkPrintSettings() { return mPrintSettings; }; + void SetGtkPrintSettings(GtkPrintSettings* aPrintSettings); - GtkPrinter *GetGtkPrinter() { return mGTKPrinter; }; - void SetGtkPrinter(GtkPrinter *aPrinter); + GtkPrinter* GetGtkPrinter() { return mGTKPrinter; }; + void SetGtkPrinter(GtkPrinter* aPrinter); bool GetForcePrintSelectionOnly() { return mPrintSelectionOnly; }; void SetForcePrintSelectionOnly(bool aPrintSelectionOnly) { @@ -53,86 +53,86 @@ class nsPrintSettingsGTK : public nsPrintSettings { // If not printing the selection, this is stored in the GtkPrintSettings. // Printing the selection is stored as a protected boolean // (mPrintSelectionOnly). - NS_IMETHOD GetPrintRange(int16_t *aPrintRange) override; + NS_IMETHOD GetPrintRange(int16_t* aPrintRange) override; NS_IMETHOD SetPrintRange(int16_t aPrintRange) override; // The page range is stored as as single range in the GtkPrintSettings object. - NS_IMETHOD GetStartPageRange(int32_t *aStartPageRange) override; + NS_IMETHOD GetStartPageRange(int32_t* aStartPageRange) override; NS_IMETHOD SetStartPageRange(int32_t aStartPageRange) override; - NS_IMETHOD GetEndPageRange(int32_t *aEndPageRange) override; + NS_IMETHOD GetEndPageRange(int32_t* aEndPageRange) override; NS_IMETHOD SetEndPageRange(int32_t aEndPageRange) override; // Reversed, color, orientation and file name are all stored in the // GtkPrintSettings. Orientation is also stored in the GtkPageSetup and its // setting takes priority when getting the orientation. - NS_IMETHOD GetPrintReversed(bool *aPrintReversed) override; + NS_IMETHOD GetPrintReversed(bool* aPrintReversed) override; NS_IMETHOD SetPrintReversed(bool aPrintReversed) override; - NS_IMETHOD GetPrintInColor(bool *aPrintInColor) override; + NS_IMETHOD GetPrintInColor(bool* aPrintInColor) override; NS_IMETHOD SetPrintInColor(bool aPrintInColor) override; - NS_IMETHOD GetOrientation(int32_t *aOrientation) override; + NS_IMETHOD GetOrientation(int32_t* aOrientation) override; NS_IMETHOD SetOrientation(int32_t aOrientation) override; - NS_IMETHOD GetToFileName(nsAString &aToFileName) override; - NS_IMETHOD SetToFileName(const nsAString &aToFileName) override; + NS_IMETHOD GetToFileName(nsAString& aToFileName) override; + NS_IMETHOD SetToFileName(const nsAString& aToFileName) override; // Gets/Sets the printer name in the GtkPrintSettings. If no printer name is // specified there, you will get back the name of the current internal // GtkPrinter. - NS_IMETHOD GetPrinterName(nsAString &Printer) override; - NS_IMETHOD SetPrinterName(const nsAString &aPrinter) override; + NS_IMETHOD GetPrinterName(nsAString& Printer) override; + NS_IMETHOD SetPrinterName(const nsAString& aPrinter) override; // Number of copies is stored/gotten from the GtkPrintSettings. - NS_IMETHOD GetNumCopies(int32_t *aNumCopies) override; + NS_IMETHOD GetNumCopies(int32_t* aNumCopies) override; NS_IMETHOD SetNumCopies(int32_t aNumCopies) override; - NS_IMETHOD GetScaling(double *aScaling) override; + NS_IMETHOD GetScaling(double* aScaling) override; NS_IMETHOD SetScaling(double aScaling) override; // A name recognised by GTK is strongly advised here, as this is used to // create a GtkPaperSize. - NS_IMETHOD GetPaperName(nsAString &aPaperName) override; - NS_IMETHOD SetPaperName(const nsAString &aPaperName) override; + NS_IMETHOD GetPaperName(nsAString& aPaperName) override; + NS_IMETHOD SetPaperName(const nsAString& aPaperName) override; NS_IMETHOD SetUnwriteableMarginInTwips( - nsIntMargin &aUnwriteableMargin) override; + nsIntMargin& aUnwriteableMargin) override; NS_IMETHOD SetUnwriteableMarginTop(double aUnwriteableMarginTop) override; NS_IMETHOD SetUnwriteableMarginLeft(double aUnwriteableMarginLeft) override; NS_IMETHOD SetUnwriteableMarginBottom( double aUnwriteableMarginBottom) override; NS_IMETHOD SetUnwriteableMarginRight(double aUnwriteableMarginRight) override; - NS_IMETHOD GetPaperWidth(double *aPaperWidth) override; + NS_IMETHOD GetPaperWidth(double* aPaperWidth) override; NS_IMETHOD SetPaperWidth(double aPaperWidth) override; - NS_IMETHOD GetPaperHeight(double *aPaperHeight) override; + NS_IMETHOD GetPaperHeight(double* aPaperHeight) override; NS_IMETHOD SetPaperHeight(double aPaperHeight) override; NS_IMETHOD SetPaperSizeUnit(int16_t aPaperSizeUnit) override; - NS_IMETHOD GetEffectivePageSize(double *aWidth, double *aHeight) override; + NS_IMETHOD GetEffectivePageSize(double* aWidth, double* aHeight) override; NS_IMETHOD SetupSilentPrinting() override; - NS_IMETHOD GetPageRanges(nsTArray &aPages) override; + NS_IMETHOD GetPageRanges(nsTArray& aPages) override; - NS_IMETHOD GetResolution(int32_t *aResolution) override; + NS_IMETHOD GetResolution(int32_t* aResolution) override; NS_IMETHOD SetResolution(int32_t aResolution) override; - NS_IMETHOD GetDuplex(int32_t *aDuplex) override; + NS_IMETHOD GetDuplex(int32_t* aDuplex) override; NS_IMETHOD SetDuplex(int32_t aDuplex) override; - NS_IMETHOD GetOutputFormat(int16_t *aOutputFormat) override; + NS_IMETHOD GetOutputFormat(int16_t* aOutputFormat) override; protected: virtual ~nsPrintSettingsGTK(); - nsPrintSettingsGTK(const nsPrintSettingsGTK &src); - nsPrintSettingsGTK &operator=(const nsPrintSettingsGTK &rhs); + nsPrintSettingsGTK(const nsPrintSettingsGTK& src); + nsPrintSettingsGTK& operator=(const nsPrintSettingsGTK& rhs); - virtual nsresult _Clone(nsIPrintSettings **_retval) override; - virtual nsresult _Assign(nsIPrintSettings *aPS) override; + virtual nsresult _Clone(nsIPrintSettings** _retval) override; + virtual nsresult _Assign(nsIPrintSettings* aPS) override; GtkUnit GetGTKUnit(int16_t aGeckoUnit); void SaveNewPageSize(); @@ -150,9 +150,9 @@ class nsPrintSettingsGTK : public nsPrintSettings { * - mGTKPrinter is nullptr!!! Remember to be careful when accessing this * property. */ - GtkPageSetup *mPageSetup; - GtkPrintSettings *mPrintSettings; - GtkPrinter *mGTKPrinter; + GtkPageSetup* mPageSetup; + GtkPrintSettings* mPrintSettings; + GtkPrinter* mGTKPrinter; bool mPrintSelectionOnly; }; diff --git a/widget/gtk/nsSound.cpp b/widget/gtk/nsSound.cpp index 60a8cafa1a514..070c6d8b73967 100644 --- a/widget/gtk/nsSound.cpp +++ b/widget/gtk/nsSound.cpp @@ -34,26 +34,26 @@ #include #include -static PRLibrary *libcanberra = nullptr; +static PRLibrary* libcanberra = nullptr; /* used to play sounds with libcanberra. */ typedef struct _ca_context ca_context; typedef struct _ca_proplist ca_proplist; -typedef void (*ca_finish_callback_t)(ca_context *c, uint32_t id, int error_code, - void *userdata); - -typedef int (*ca_context_create_fn)(ca_context **); -typedef int (*ca_context_destroy_fn)(ca_context *); -typedef int (*ca_context_play_fn)(ca_context *c, uint32_t id, ...); -typedef int (*ca_context_change_props_fn)(ca_context *c, ...); -typedef int (*ca_proplist_create_fn)(ca_proplist **); -typedef int (*ca_proplist_destroy_fn)(ca_proplist *); -typedef int (*ca_proplist_sets_fn)(ca_proplist *c, const char *key, - const char *value); -typedef int (*ca_context_play_full_fn)(ca_context *c, uint32_t id, - ca_proplist *p, ca_finish_callback_t cb, - void *userdata); +typedef void (*ca_finish_callback_t)(ca_context* c, uint32_t id, int error_code, + void* userdata); + +typedef int (*ca_context_create_fn)(ca_context**); +typedef int (*ca_context_destroy_fn)(ca_context*); +typedef int (*ca_context_play_fn)(ca_context* c, uint32_t id, ...); +typedef int (*ca_context_change_props_fn)(ca_context* c, ...); +typedef int (*ca_proplist_create_fn)(ca_proplist**); +typedef int (*ca_proplist_destroy_fn)(ca_proplist*); +typedef int (*ca_proplist_sets_fn)(ca_proplist* c, const char* key, + const char* value); +typedef int (*ca_context_play_full_fn)(ca_context* c, uint32_t id, + ca_proplist* p, ca_finish_callback_t cb, + void* userdata); static ca_context_create_fn ca_context_create; static ca_context_destroy_fn ca_context_destroy; @@ -65,7 +65,7 @@ static ca_proplist_sets_fn ca_proplist_sets; static ca_context_play_full_fn ca_context_play_full; struct ScopedCanberraFile { - explicit ScopedCanberraFile(nsIFile *file) : mFile(file){}; + explicit ScopedCanberraFile(nsIFile* file) : mFile(file){}; ~ScopedCanberraFile() { if (mFile) { @@ -74,18 +74,18 @@ struct ScopedCanberraFile { } void forget() { mozilla::Unused << mFile.forget(); } - nsIFile *operator->() { return mFile; } - operator nsIFile *() { return mFile; } + nsIFile* operator->() { return mFile; } + operator nsIFile*() { return mFile; } nsCOMPtr mFile; }; -static ca_context *ca_context_get_default() { +static ca_context* ca_context_get_default() { // This allows us to avoid race conditions with freeing the context by handing // that responsibility to Glib, and still use one context at a time static GStaticPrivate ctx_static_private = G_STATIC_PRIVATE_INIT; - ca_context *ctx = (ca_context *)g_static_private_get(&ctx_static_private); + ca_context* ctx = (ca_context*)g_static_private_get(&ctx_static_private); if (ctx) { return ctx; @@ -99,10 +99,10 @@ static ca_context *ca_context_get_default() { g_static_private_set(&ctx_static_private, ctx, (GDestroyNotify)ca_context_destroy); - GtkSettings *settings = gtk_settings_get_default(); + GtkSettings* settings = gtk_settings_get_default(); if (g_object_class_find_property(G_OBJECT_GET_CLASS(settings), "gtk-sound-theme-name")) { - gchar *sound_theme_name = nullptr; + gchar* sound_theme_name = nullptr; g_object_get(settings, "gtk-sound-theme-name", &sound_theme_name, nullptr); if (sound_theme_name) { @@ -131,9 +131,9 @@ static ca_context *ca_context_get_default() { return ctx; } -static void ca_finish_cb(ca_context *c, uint32_t id, int error_code, - void *userdata) { - nsIFile *file = reinterpret_cast(userdata); +static void ca_finish_cb(ca_context* c, uint32_t id, int error_code, + void* userdata) { + nsIFile* file = reinterpret_cast(userdata); if (file) { file->Remove(false); NS_RELEASE(file); @@ -217,9 +217,9 @@ already_AddRefed nsSound::GetInstance() { return service.forget(); } -NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, - nsISupports *context, nsresult aStatus, - uint32_t dataLen, const uint8_t *data) { +NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader* aLoader, + nsISupports* context, nsresult aStatus, + uint32_t dataLen, const uint8_t* data) { // print a load error on bad status, and return if (NS_FAILED(aStatus)) { #ifdef DEBUG @@ -276,12 +276,12 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, data += amount; } - ca_context *ctx = ca_context_get_default(); + ca_context* ctx = ca_context_get_default(); if (!ctx) { return NS_ERROR_OUT_OF_MEMORY; } - ca_proplist *p; + ca_proplist* p; ca_proplist_create(&p); if (!p) { return NS_ERROR_OUT_OF_MEMORY; @@ -308,7 +308,7 @@ NS_IMETHODIMP nsSound::Beep() { return NS_OK; } -NS_IMETHODIMP nsSound::Play(nsIURL *aURL) { +NS_IMETHODIMP nsSound::Play(nsIURL* aURL) { if (!mInited) Init(); if (!libcanberra) return NS_ERROR_NOT_AVAILABLE; @@ -316,7 +316,7 @@ NS_IMETHODIMP nsSound::Play(nsIURL *aURL) { bool isFile; nsresult rv = aURL->SchemeIs("file", &isFile); if (NS_SUCCEEDED(rv) && isFile) { - ca_context *ctx = ca_context_get_default(); + ca_context* ctx = ca_context_get_default(); if (!ctx) { return NS_ERROR_OUT_OF_MEMORY; } @@ -326,7 +326,7 @@ NS_IMETHODIMP nsSound::Play(nsIURL *aURL) { if (NS_FAILED(rv)) { return rv; } - gchar *path = g_filename_from_uri(spec.get(), nullptr, nullptr); + gchar* path = g_filename_from_uri(spec.get(), nullptr, nullptr); if (!path) { return NS_ERROR_FILE_UNRECOGNIZED_PATH; } @@ -351,7 +351,7 @@ NS_IMETHODIMP nsSound::PlayEventSound(uint32_t aEventId) { if (!libcanberra) return NS_OK; // Do we even want alert sounds? - GtkSettings *settings = gtk_settings_get_default(); + GtkSettings* settings = gtk_settings_get_default(); if (g_object_class_find_property(G_OBJECT_GET_CLASS(settings), "gtk-enable-event-sounds")) { @@ -363,7 +363,7 @@ NS_IMETHODIMP nsSound::PlayEventSound(uint32_t aEventId) { } } - ca_context *ctx = ca_context_get_default(); + ca_context* ctx = ca_context_get_default(); if (!ctx) { return NS_ERROR_OUT_OF_MEMORY; } diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp index 87d2383770239..6518739c8d88b 100644 --- a/widget/gtk/nsWaylandDisplay.cpp +++ b/widget/gtk/nsWaylandDisplay.cpp @@ -18,12 +18,12 @@ namespace widget { // compositor thread and render thread) #define MAX_DISPLAY_CONNECTIONS 3 -static nsWaylandDisplay *gWaylandDisplays[MAX_DISPLAY_CONNECTIONS]; +static nsWaylandDisplay* gWaylandDisplays[MAX_DISPLAY_CONNECTIONS]; static StaticMutex gWaylandDisplaysMutex; void WaylandDisplayShutdown() { StaticMutexAutoLock lock(gWaylandDisplaysMutex); - for (auto &display : gWaylandDisplays) { + for (auto& display : gWaylandDisplays) { if (display) { display->Shutdown(); } @@ -37,7 +37,7 @@ static void ReleaseDisplaysAtExit() { } } -static void DispatchDisplay(nsWaylandDisplay *aDisplay) { +static void DispatchDisplay(nsWaylandDisplay* aDisplay) { aDisplay->DispatchEventQueue(); } @@ -50,7 +50,7 @@ static void DispatchDisplay(nsWaylandDisplay *aDisplay) { // compositor (not the main) thread. void WaylandDispatchDisplays() { StaticMutexAutoLock lock(gWaylandDisplaysMutex); - for (auto &display : gWaylandDisplays) { + for (auto& display : gWaylandDisplays) { if (display && display->GetDispatcherThreadLoop()) { display->GetDispatcherThreadLoop()->PostTask(NewRunnableFunction( "WaylandDisplayDispatch", &DispatchDisplay, display)); @@ -59,21 +59,21 @@ void WaylandDispatchDisplays() { } // Get WaylandDisplay for given wl_display and actual calling thread. -static nsWaylandDisplay *WaylandDisplayGetLocked(GdkDisplay *aGdkDisplay, - const StaticMutexAutoLock &) { +static nsWaylandDisplay* WaylandDisplayGetLocked(GdkDisplay* aGdkDisplay, + const StaticMutexAutoLock&) { // Available as of GTK 3.8+ - static auto sGdkWaylandDisplayGetWlDisplay = (wl_display * (*)(GdkDisplay *)) + static auto sGdkWaylandDisplayGetWlDisplay = (wl_display * (*)(GdkDisplay*)) dlsym(RTLD_DEFAULT, "gdk_wayland_display_get_wl_display"); - wl_display *waylandDisplay = sGdkWaylandDisplayGetWlDisplay(aGdkDisplay); + wl_display* waylandDisplay = sGdkWaylandDisplayGetWlDisplay(aGdkDisplay); // Search existing display connections for wl_display:thread combination. - for (auto &display : gWaylandDisplays) { + for (auto& display : gWaylandDisplays) { if (display && display->Matches(waylandDisplay)) { return display; } } - for (auto &display : gWaylandDisplays) { + for (auto& display : gWaylandDisplays) { if (display == nullptr) { display = new nsWaylandDisplay(waylandDisplay); atexit(ReleaseDisplaysAtExit); @@ -85,7 +85,7 @@ static nsWaylandDisplay *WaylandDisplayGetLocked(GdkDisplay *aGdkDisplay, return nullptr; } -nsWaylandDisplay *WaylandDisplayGet(GdkDisplay *aGdkDisplay) { +nsWaylandDisplay* WaylandDisplayGet(GdkDisplay* aGdkDisplay) { if (!aGdkDisplay) { aGdkDisplay = gdk_display_get_default(); } @@ -94,65 +94,65 @@ nsWaylandDisplay *WaylandDisplayGet(GdkDisplay *aGdkDisplay) { return WaylandDisplayGetLocked(aGdkDisplay, lock); } -void nsWaylandDisplay::SetShm(wl_shm *aShm) { mShm = aShm; } +void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } -void nsWaylandDisplay::SetSubcompositor(wl_subcompositor *aSubcompositor) { +void nsWaylandDisplay::SetSubcompositor(wl_subcompositor* aSubcompositor) { mSubcompositor = aSubcompositor; } void nsWaylandDisplay::SetDataDeviceManager( - wl_data_device_manager *aDataDeviceManager) { + wl_data_device_manager* aDataDeviceManager) { mDataDeviceManager = aDataDeviceManager; } -void nsWaylandDisplay::SetSeat(wl_seat *aSeat) { mSeat = aSeat; } +void nsWaylandDisplay::SetSeat(wl_seat* aSeat) { mSeat = aSeat; } void nsWaylandDisplay::SetPrimarySelectionDeviceManager( - gtk_primary_selection_device_manager *aPrimarySelectionDeviceManager) { + gtk_primary_selection_device_manager* aPrimarySelectionDeviceManager) { mPrimarySelectionDeviceManager = aPrimarySelectionDeviceManager; } -static void global_registry_handler(void *data, wl_registry *registry, - uint32_t id, const char *interface, +static void global_registry_handler(void* data, wl_registry* registry, + uint32_t id, const char* interface, uint32_t version) { - auto display = reinterpret_cast(data); + auto display = reinterpret_cast(data); if (!display) return; if (strcmp(interface, "wl_shm") == 0) { - auto shm = static_cast( + auto shm = static_cast( wl_registry_bind(registry, id, &wl_shm_interface, 1)); - wl_proxy_set_queue((struct wl_proxy *)shm, display->GetEventQueue()); + wl_proxy_set_queue((struct wl_proxy*)shm, display->GetEventQueue()); display->SetShm(shm); } else if (strcmp(interface, "wl_data_device_manager") == 0) { int data_device_manager_version = MIN(version, 3); - auto data_device_manager = static_cast( + auto data_device_manager = static_cast( wl_registry_bind(registry, id, &wl_data_device_manager_interface, data_device_manager_version)); - wl_proxy_set_queue((struct wl_proxy *)data_device_manager, + wl_proxy_set_queue((struct wl_proxy*)data_device_manager, display->GetEventQueue()); display->SetDataDeviceManager(data_device_manager); } else if (strcmp(interface, "wl_seat") == 0) { - auto seat = static_cast( + auto seat = static_cast( wl_registry_bind(registry, id, &wl_seat_interface, 1)); - wl_proxy_set_queue((struct wl_proxy *)seat, display->GetEventQueue()); + wl_proxy_set_queue((struct wl_proxy*)seat, display->GetEventQueue()); display->SetSeat(seat); } else if (strcmp(interface, "gtk_primary_selection_device_manager") == 0) { auto primary_selection_device_manager = - static_cast(wl_registry_bind( + static_cast(wl_registry_bind( registry, id, >k_primary_selection_device_manager_interface, 1)); - wl_proxy_set_queue((struct wl_proxy *)primary_selection_device_manager, + wl_proxy_set_queue((struct wl_proxy*)primary_selection_device_manager, display->GetEventQueue()); display->SetPrimarySelectionDeviceManager(primary_selection_device_manager); } else if (strcmp(interface, "wl_subcompositor") == 0) { - auto subcompositor = static_cast( + auto subcompositor = static_cast( wl_registry_bind(registry, id, &wl_subcompositor_interface, 1)); - wl_proxy_set_queue((struct wl_proxy *)subcompositor, + wl_proxy_set_queue((struct wl_proxy*)subcompositor, display->GetEventQueue()); display->SetSubcompositor(subcompositor); } } -static void global_registry_remover(void *data, wl_registry *registry, +static void global_registry_remover(void* data, wl_registry* registry, uint32_t id) {} static const struct wl_registry_listener registry_listener = { @@ -163,11 +163,11 @@ bool nsWaylandDisplay::DispatchEventQueue() { return true; } -bool nsWaylandDisplay::Matches(wl_display *aDisplay) { +bool nsWaylandDisplay::Matches(wl_display* aDisplay) { return mThreadId == PR_GetCurrentThread() && aDisplay == mDisplay; } -nsWaylandDisplay::nsWaylandDisplay(wl_display *aDisplay) +nsWaylandDisplay::nsWaylandDisplay(wl_display* aDisplay) : mDispatcherThreadLoop(nullptr), mThreadId(PR_GetCurrentThread()), mDisplay(aDisplay), @@ -189,7 +189,7 @@ nsWaylandDisplay::nsWaylandDisplay(wl_display *aDisplay) } else { mDispatcherThreadLoop = MessageLoop::current(); mEventQueue = wl_display_create_queue(mDisplay); - wl_proxy_set_queue((struct wl_proxy *)mRegistry, mEventQueue); + wl_proxy_set_queue((struct wl_proxy*)mRegistry, mEventQueue); wl_display_roundtrip_queue(mDisplay, mEventQueue); wl_display_roundtrip_queue(mDisplay, mEventQueue); } diff --git a/widget/gtk/nsWidgetFactory.h b/widget/gtk/nsWidgetFactory.h index 5538ad3a188a6..21ea0da66729b 100644 --- a/widget/gtk/nsWidgetFactory.h +++ b/widget/gtk/nsWidgetFactory.h @@ -13,8 +13,8 @@ class nsISupports; -nsresult nsAppShellConstructor(nsISupports *outer, const nsIID &iid, - void **result); +nsresult nsAppShellConstructor(nsISupports* outer, const nsIID& iid, + void** result); nsresult nsWidgetGtk2ModuleCtor(); void nsWidgetGtk2ModuleDtor(); diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 16bc777d7ef7a..0a33deae81193 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -172,84 +172,84 @@ typedef enum { #endif /* utility functions */ -static bool is_mouse_in_window(GdkWindow *aWindow, gdouble aMouseX, +static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX, gdouble aMouseY); -static nsWindow *get_window_for_gtk_widget(GtkWidget *widget); -static nsWindow *get_window_for_gdk_window(GdkWindow *window); -static GtkWidget *get_gtk_widget_for_gdk_window(GdkWindow *window); -static GdkCursor *get_gtk_cursor(nsCursor aCursor); +static nsWindow* get_window_for_gtk_widget(GtkWidget* widget); +static nsWindow* get_window_for_gdk_window(GdkWindow* window); +static GtkWidget* get_gtk_widget_for_gdk_window(GdkWindow* window); +static GdkCursor* get_gtk_cursor(nsCursor aCursor); -static GdkWindow *get_inner_gdk_window(GdkWindow *aWindow, gint x, gint y, - gint *retx, gint *rety); +static GdkWindow* get_inner_gdk_window(GdkWindow* aWindow, gint x, gint y, + gint* retx, gint* rety); -static int is_parent_ungrab_enter(GdkEventCrossing *aEvent); -static int is_parent_grab_leave(GdkEventCrossing *aEvent); +static int is_parent_ungrab_enter(GdkEventCrossing* aEvent); +static int is_parent_grab_leave(GdkEventCrossing* aEvent); /* callbacks from widgets */ -static gboolean expose_event_cb(GtkWidget *widget, cairo_t *rect); -static gboolean configure_event_cb(GtkWidget *widget, GdkEventConfigure *event); -static void container_unrealize_cb(GtkWidget *widget); -static void size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation); -static gboolean delete_event_cb(GtkWidget *widget, GdkEventAny *event); -static gboolean enter_notify_event_cb(GtkWidget *widget, - GdkEventCrossing *event); -static gboolean leave_notify_event_cb(GtkWidget *widget, - GdkEventCrossing *event); -static gboolean motion_notify_event_cb(GtkWidget *widget, - GdkEventMotion *event); -static gboolean button_press_event_cb(GtkWidget *widget, GdkEventButton *event); -static gboolean button_release_event_cb(GtkWidget *widget, - GdkEventButton *event); -static gboolean focus_in_event_cb(GtkWidget *widget, GdkEventFocus *event); -static gboolean focus_out_event_cb(GtkWidget *widget, GdkEventFocus *event); -static gboolean key_press_event_cb(GtkWidget *widget, GdkEventKey *event); -static gboolean key_release_event_cb(GtkWidget *widget, GdkEventKey *event); -static gboolean property_notify_event_cb(GtkWidget *widget, - GdkEventProperty *event); -static gboolean scroll_event_cb(GtkWidget *widget, GdkEventScroll *event); -static gboolean visibility_notify_event_cb(GtkWidget *widget, - GdkEventVisibility *event); -static void hierarchy_changed_cb(GtkWidget *widget, - GtkWidget *previous_toplevel); -static gboolean window_state_event_cb(GtkWidget *widget, - GdkEventWindowState *event); -static void settings_changed_cb(GtkSettings *settings, GParamSpec *pspec, - nsWindow *data); -static void check_resize_cb(GtkContainer *container, gpointer user_data); -static void screen_composited_changed_cb(GdkScreen *screen, gpointer user_data); -static void widget_composited_changed_cb(GtkWidget *widget, gpointer user_data); - -static void scale_changed_cb(GtkWidget *widget, GParamSpec *aPSpec, +static gboolean expose_event_cb(GtkWidget* widget, cairo_t* rect); +static gboolean configure_event_cb(GtkWidget* widget, GdkEventConfigure* event); +static void container_unrealize_cb(GtkWidget* widget); +static void size_allocate_cb(GtkWidget* widget, GtkAllocation* allocation); +static gboolean delete_event_cb(GtkWidget* widget, GdkEventAny* event); +static gboolean enter_notify_event_cb(GtkWidget* widget, + GdkEventCrossing* event); +static gboolean leave_notify_event_cb(GtkWidget* widget, + GdkEventCrossing* event); +static gboolean motion_notify_event_cb(GtkWidget* widget, + GdkEventMotion* event); +static gboolean button_press_event_cb(GtkWidget* widget, GdkEventButton* event); +static gboolean button_release_event_cb(GtkWidget* widget, + GdkEventButton* event); +static gboolean focus_in_event_cb(GtkWidget* widget, GdkEventFocus* event); +static gboolean focus_out_event_cb(GtkWidget* widget, GdkEventFocus* event); +static gboolean key_press_event_cb(GtkWidget* widget, GdkEventKey* event); +static gboolean key_release_event_cb(GtkWidget* widget, GdkEventKey* event); +static gboolean property_notify_event_cb(GtkWidget* widget, + GdkEventProperty* event); +static gboolean scroll_event_cb(GtkWidget* widget, GdkEventScroll* event); +static gboolean visibility_notify_event_cb(GtkWidget* widget, + GdkEventVisibility* event); +static void hierarchy_changed_cb(GtkWidget* widget, + GtkWidget* previous_toplevel); +static gboolean window_state_event_cb(GtkWidget* widget, + GdkEventWindowState* event); +static void settings_changed_cb(GtkSettings* settings, GParamSpec* pspec, + nsWindow* data); +static void check_resize_cb(GtkContainer* container, gpointer user_data); +static void screen_composited_changed_cb(GdkScreen* screen, gpointer user_data); +static void widget_composited_changed_cb(GtkWidget* widget, gpointer user_data); + +static void scale_changed_cb(GtkWidget* widget, GParamSpec* aPSpec, gpointer aPointer); #if GTK_CHECK_VERSION(3, 4, 0) -static gboolean touch_event_cb(GtkWidget *aWidget, GdkEventTouch *aEvent); +static gboolean touch_event_cb(GtkWidget* aWidget, GdkEventTouch* aEvent); #endif -static nsWindow *GetFirstNSWindowForGDKWindow(GdkWindow *aGdkWindow); +static nsWindow* GetFirstNSWindowForGDKWindow(GdkWindow* aGdkWindow); #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifdef MOZ_X11 -static GdkFilterReturn popup_take_focus_filter(GdkXEvent *gdk_xevent, - GdkEvent *event, gpointer data); +static GdkFilterReturn popup_take_focus_filter(GdkXEvent* gdk_xevent, + GdkEvent* event, gpointer data); #endif /* MOZ_X11 */ #ifdef __cplusplus } #endif /* __cplusplus */ -static gboolean drag_motion_event_cb(GtkWidget *aWidget, - GdkDragContext *aDragContext, gint aX, +static gboolean drag_motion_event_cb(GtkWidget* aWidget, + GdkDragContext* aDragContext, gint aX, gint aY, guint aTime, gpointer aData); -static void drag_leave_event_cb(GtkWidget *aWidget, - GdkDragContext *aDragContext, guint aTime, +static void drag_leave_event_cb(GtkWidget* aWidget, + GdkDragContext* aDragContext, guint aTime, gpointer aData); -static gboolean drag_drop_event_cb(GtkWidget *aWidget, - GdkDragContext *aDragContext, gint aX, +static gboolean drag_drop_event_cb(GtkWidget* aWidget, + GdkDragContext* aDragContext, gint aX, gint aY, guint aTime, gpointer aData); -static void drag_data_received_event_cb(GtkWidget *aWidget, - GdkDragContext *aDragContext, gint aX, +static void drag_data_received_event_cb(GtkWidget* aWidget, + GdkDragContext* aDragContext, gint aX, gint aY, - GtkSelectionData *aSelectionData, + GtkSelectionData* aSelectionData, guint aInfo, guint32 aTime, gpointer aData); @@ -259,7 +259,7 @@ static nsresult initialize_prefs(void); static guint32 sLastUserInputTime = GDK_CURRENT_TIME; static guint32 sRetryGrabTime; -static SystemTimeConverter &TimeConverter() { +static SystemTimeConverter& TimeConverter() { static SystemTimeConverter sTimeConverterSingleton; return sTimeConverterSingleton; } @@ -270,19 +270,19 @@ namespace mozilla { class CurrentX11TimeGetter { public: - explicit CurrentX11TimeGetter(GdkWindow *aWindow) + explicit CurrentX11TimeGetter(GdkWindow* aWindow) : mWindow(aWindow), mAsyncUpdateStart() {} guint32 GetCurrentTime() const { return gdk_x11_get_server_time(mWindow); } - void GetTimeAsyncForPossibleBackwardsSkew(const TimeStamp &aNow) { + void GetTimeAsyncForPossibleBackwardsSkew(const TimeStamp& aNow) { // Check for in-flight request if (!mAsyncUpdateStart.IsNull()) { return; } mAsyncUpdateStart = aNow; - Display *xDisplay = GDK_WINDOW_XDISPLAY(mWindow); + Display* xDisplay = GDK_WINDOW_XDISPLAY(mWindow); Window xWindow = GDK_WINDOW_XID(mWindow); unsigned char c = 'a'; Atom timeStampPropAtom = TimeStampPropAtom(); @@ -291,7 +291,7 @@ class CurrentX11TimeGetter { XFlush(xDisplay); } - gboolean PropertyNotifyHandler(GtkWidget *aWidget, GdkEventProperty *aEvent) { + gboolean PropertyNotifyHandler(GtkWidget* aWidget, GdkEventProperty* aEvent) { if (aEvent->atom != gdk_x11_xatom_to_atom(TimeStampPropAtom())) { return FALSE; } @@ -312,7 +312,7 @@ class CurrentX11TimeGetter { // This is safe because this class is stored as a member of mWindow and // won't outlive it. - GdkWindow *mWindow; + GdkWindow* mWindow; TimeStamp mAsyncUpdateStart; }; @@ -321,7 +321,7 @@ class CurrentX11TimeGetter { static NS_DEFINE_IID(kCDragServiceCID, NS_DRAGSERVICE_CID); // The window from which the focus manager asks us to dispatch key events. -static nsWindow *gFocusWindow = nullptr; +static nsWindow* gFocusWindow = nullptr; static bool gBlockActivateEvent = false; static bool gGlobalsInitialized = false; static bool gRaiseWindows = true; @@ -342,9 +342,9 @@ typedef struct _GdkDisplay GdkDisplay; #define kWindowPositionSlop 20 // cursor cache -static GdkCursor *gCursorCache[eCursorCount]; +static GdkCursor* gCursorCache[eCursorCount]; -static GtkWidget *gInvisibleContainer = nullptr; +static GtkWidget* gInvisibleContainer = nullptr; // Sometimes this actually also includes the state of the modifier keys, but // only the button state bits are used. @@ -364,14 +364,14 @@ static inline bool TimestampIsNewerThan(guint32 a, guint32 b) { return a - b <= G_MAXUINT32 / 2; } -static void UpdateLastInputEventTime(void *aGdkEvent) { +static void UpdateLastInputEventTime(void* aGdkEvent) { nsCOMPtr idleService = do_GetService("@mozilla.org/widget/idleservice;1"); if (idleService) { idleService->ResetIdleTimeOut(0); } - guint timestamp = gdk_event_get_time(static_cast(aGdkEvent)); + guint timestamp = gdk_event_get_time(static_cast(aGdkEvent)); if (timestamp == GDK_CURRENT_TIME) return; sLastUserInputTime = timestamp; @@ -460,7 +460,7 @@ nsWindow::nsWindow() { } nsWindow::~nsWindow() { - LOG(("nsWindow::~nsWindow() [%p]\n", (void *)this)); + LOG(("nsWindow::~nsWindow() [%p]\n", (void*)this)); delete[] mTransparencyBitmap; mTransparencyBitmap = nullptr; @@ -470,7 +470,7 @@ nsWindow::~nsWindow() { /* static */ void nsWindow::ReleaseGlobals() { - for (auto &cursor : gCursorCache) { + for (auto& cursor : gCursorCache) { if (cursor) { g_object_unref(cursor); cursor = nullptr; @@ -478,7 +478,7 @@ void nsWindow::ReleaseGlobals() { } } -void nsWindow::CommonCreate(nsIWidget *aParent, bool aListenForResizes) { +void nsWindow::CommonCreate(nsIWidget* aParent, bool aListenForResizes) { mParent = aParent; mListenForResizes = aListenForResizes; mCreated = true; @@ -519,17 +519,17 @@ void nsWindow::MaybeDispatchResized() { } } -nsIWidgetListener *nsWindow::GetListener() { +nsIWidgetListener* nsWindow::GetListener() { return mAttachedWidgetListener ? mAttachedWidgetListener : mWidgetListener; } -nsresult nsWindow::DispatchEvent(WidgetGUIEvent *aEvent, - nsEventStatus &aStatus) { +nsresult nsWindow::DispatchEvent(WidgetGUIEvent* aEvent, + nsEventStatus& aStatus) { #ifdef DEBUG debug_DumpEvent(stdout, aEvent->mWidget, aEvent, "something", 0); #endif aStatus = nsEventStatus_eIgnore; - nsIWidgetListener *listener = GetListener(); + nsIWidgetListener* listener = GetListener(); if (listener) { aStatus = listener->HandleEvent(aEvent, mUseAttachedEvents); } @@ -561,13 +561,13 @@ bool nsWindow::AreBoundsSane(void) { return false; } -static GtkWidget *EnsureInvisibleContainer() { +static GtkWidget* EnsureInvisibleContainer() { if (!gInvisibleContainer) { // GtkWidgets need to be anchored to a GtkWindow to be realized (to // have a window). Using GTK_WINDOW_POPUP rather than // GTK_WINDOW_TOPLEVEL in the hope that POPUP results in less // initialization and window manager interaction. - GtkWidget *window = gtk_window_new(GTK_WINDOW_POPUP); + GtkWidget* window = gtk_window_new(GTK_WINDOW_POPUP); gInvisibleContainer = moz_container_new(); gtk_container_add(GTK_CONTAINER(window), gInvisibleContainer); gtk_widget_realize(gInvisibleContainer); @@ -589,15 +589,15 @@ static void CheckDestroyInvisibleContainer() { // Change the containing GtkWidget on a sub-hierarchy of GdkWindows belonging // to aOldWidget and rooted at aWindow, and reparent any child GtkWidgets of // the GdkWindow hierarchy to aNewWidget. -static void SetWidgetForHierarchy(GdkWindow *aWindow, GtkWidget *aOldWidget, - GtkWidget *aNewWidget) { +static void SetWidgetForHierarchy(GdkWindow* aWindow, GtkWidget* aOldWidget, + GtkWidget* aNewWidget) { gpointer data; gdk_window_get_user_data(aWindow, &data); if (data != aOldWidget) { if (!GTK_IS_WIDGET(data)) return; - auto *widget = static_cast(data); + auto* widget = static_cast(data); if (gtk_widget_get_parent(widget) != aOldWidget) return; // This window belongs to a child widget, which will no longer be a @@ -607,8 +607,8 @@ static void SetWidgetForHierarchy(GdkWindow *aWindow, GtkWidget *aOldWidget, return; } - GList *children = gdk_window_get_children(aWindow); - for (GList *list = children; list; list = list->next) { + GList* children = gdk_window_get_children(aWindow); + for (GList* list = children; list; list = list->next) { SetWidgetForHierarchy(GDK_WINDOW(list->data), aOldWidget, aNewWidget); } g_list_free(children); @@ -620,9 +620,9 @@ static void SetWidgetForHierarchy(GdkWindow *aWindow, GtkWidget *aOldWidget, void nsWindow::DestroyChildWindows() { if (!mGdkWindow) return; - while (GList *children = gdk_window_peek_children(mGdkWindow)) { - GdkWindow *child = GDK_WINDOW(children->data); - nsWindow *kid = get_window_for_gdk_window(child); + while (GList* children = gdk_window_peek_children(mGdkWindow)) { + GdkWindow* child = GDK_WINDOW(children->data); + nsWindow* kid = get_window_for_gdk_window(child); if (kid) { kid->Destroy(); } else { @@ -631,7 +631,7 @@ void nsWindow::DestroyChildWindows() { gpointer data; gdk_window_get_user_data(child, &data); if (GTK_IS_WIDGET(data)) { - gtk_widget_destroy(static_cast(data)); + gtk_widget_destroy(static_cast(data)); } } } @@ -640,7 +640,7 @@ void nsWindow::DestroyChildWindows() { void nsWindow::Destroy() { if (mIsDestroyed || !mCreated) return; - LOG(("nsWindow::Destroy [%p]\n", (void *)this)); + LOG(("nsWindow::Destroy [%p]\n", (void*)this)); mIsDestroyed = true; mCreated = false; @@ -668,10 +668,10 @@ void nsWindow::Destroy() { g_signal_handlers_disconnect_by_func( gtk_settings_get_default(), FuncToGpointer(settings_changed_cb), this); - nsIRollupListener *rollupListener = nsBaseWidget::GetActiveRollupListener(); + nsIRollupListener* rollupListener = nsBaseWidget::GetActiveRollupListener(); if (rollupListener) { nsCOMPtr rollupWidget = rollupListener->GetRollupWidget(); - if (static_cast(this) == rollupWidget) { + if (static_cast(this) == rollupWidget) { rollupListener->Rollup(0, false, nullptr, nullptr); } } @@ -700,7 +700,7 @@ void nsWindow::Destroy() { } #endif - GtkWidget *owningWidget = GetMozContainerWidget(); + GtkWidget* owningWidget = GetMozContainerWidget(); if (mShell) { gtk_widget_destroy(mShell); mShell = nullptr; @@ -739,7 +739,7 @@ void nsWindow::Destroy() { OnDestroy(); } -nsIWidget *nsWindow::GetParent(void) { return mParent; } +nsIWidget* nsWindow::GetParent(void) { return mParent; } float nsWindow::GetDPI() { float dpi = 96.0f; @@ -756,7 +756,7 @@ double nsWindow::GetDefaultScaleInternal() { DesktopToLayoutDeviceScale nsWindow::GetDesktopToDeviceScale() { #ifdef MOZ_WAYLAND - GdkDisplay *gdkDisplay = gdk_display_get_default(); + GdkDisplay* gdkDisplay = gdk_display_get_default(); if (!GDK_IS_X11_DISPLAY(gdkDisplay)) { return DesktopToLayoutDeviceScale(GdkScaleFactor()); } @@ -768,7 +768,7 @@ DesktopToLayoutDeviceScale nsWindow::GetDesktopToDeviceScale() { DesktopToLayoutDeviceScale nsWindow::GetDesktopToDeviceScaleByScreen() { #ifdef MOZ_WAYLAND - GdkDisplay *gdkDisplay = gdk_display_get_default(); + GdkDisplay* gdkDisplay = gdk_display_get_default(); // In Wayland there's no way to get absolute position of the window and use it // to determine the screen factor of the monitor on which the window is // placed. The window is notified of the current scale factor but not at this @@ -776,11 +776,11 @@ DesktopToLayoutDeviceScale nsWindow::GetDesktopToDeviceScaleByScreen() { // popup placement. We need to use parent's window scale factor for the new // one. if (!GDK_IS_X11_DISPLAY(gdkDisplay)) { - nsView *view = nsView::GetViewFor(this); + nsView* view = nsView::GetViewFor(this); if (view) { - nsView *parentView = view->GetParent(); + nsView* parentView = view->GetParent(); if (parentView) { - nsIWidget *parentWidget = parentView->GetNearestWidget(nullptr); + nsIWidget* parentWidget = parentView->GetNearestWidget(nullptr); if (parentWidget) { return DesktopToLayoutDeviceScale( parentWidget->RoundsWidgetCoordinatesTo()); @@ -796,7 +796,7 @@ DesktopToLayoutDeviceScale nsWindow::GetDesktopToDeviceScaleByScreen() { return nsBaseWidget::GetDesktopToDeviceScale(); } -void nsWindow::SetParent(nsIWidget *aNewParent) { +void nsWindow::SetParent(nsIWidget* aNewParent) { if (!mGdkWindow) { MOZ_ASSERT_UNREACHABLE("The native window has already been destroyed"); return; @@ -815,7 +815,7 @@ void nsWindow::SetParent(nsIWidget *aNewParent) { mParent = aNewParent; - GtkWidget *oldContainer = GetMozContainerWidget(); + GtkWidget* oldContainer = GetMozContainerWidget(); if (!oldContainer) { // The GdkWindows have been destroyed so there is nothing else to // reparent. @@ -832,8 +832,8 @@ void nsWindow::SetParent(nsIWidget *aNewParent) { // destroying the GdkWindow and its descendants. // An invisible container widget is needed to hold descendant // GtkWidgets. - GtkWidget *newContainer = EnsureInvisibleContainer(); - GdkWindow *newParentWindow = gtk_widget_get_window(newContainer); + GtkWidget* newContainer = EnsureInvisibleContainer(); + GdkWindow* newParentWindow = gtk_widget_get_window(newContainer); ReparentNativeWidgetInternal(aNewParent, newContainer, newParentWindow, oldContainer); } @@ -841,12 +841,12 @@ void nsWindow::SetParent(nsIWidget *aNewParent) { bool nsWindow::WidgetTypeSupportsAcceleration() { return !IsSmallPopup(); } -void nsWindow::ReparentNativeWidget(nsIWidget *aNewParent) { +void nsWindow::ReparentNativeWidget(nsIWidget* aNewParent) { MOZ_ASSERT(aNewParent, "null widget"); NS_ASSERTION(!mIsDestroyed, ""); - NS_ASSERTION(!static_cast(aNewParent)->mIsDestroyed, ""); + NS_ASSERTION(!static_cast(aNewParent)->mIsDestroyed, ""); - GtkWidget *oldContainer = GetMozContainerWidget(); + GtkWidget* oldContainer = GetMozContainerWidget(); if (!oldContainer) { // The GdkWindows have been destroyed so there is nothing else to // reparent. @@ -857,13 +857,13 @@ void nsWindow::ReparentNativeWidget(nsIWidget *aNewParent) { MOZ_ASSERT(!gdk_window_is_destroyed(mGdkWindow), "destroyed GdkWindow with widget"); - auto *newParent = static_cast(aNewParent); - GdkWindow *newParentWindow = newParent->mGdkWindow; - GtkWidget *newContainer = newParent->GetMozContainerWidget(); - GtkWindow *shell = GTK_WINDOW(mShell); + auto* newParent = static_cast(aNewParent); + GdkWindow* newParentWindow = newParent->mGdkWindow; + GtkWidget* newContainer = newParent->GetMozContainerWidget(); + GtkWindow* shell = GTK_WINDOW(mShell); if (shell && gtk_window_get_transient_for(shell)) { - GtkWindow *topLevelParent = + GtkWindow* topLevelParent = GTK_WINDOW(gtk_widget_get_toplevel(newContainer)); gtk_window_set_transient_for(shell, topLevelParent); } @@ -872,10 +872,10 @@ void nsWindow::ReparentNativeWidget(nsIWidget *aNewParent) { oldContainer); } -void nsWindow::ReparentNativeWidgetInternal(nsIWidget *aNewParent, - GtkWidget *aNewContainer, - GdkWindow *aNewParentWindow, - GtkWidget *aOldContainer) { +void nsWindow::ReparentNativeWidgetInternal(nsIWidget* aNewParent, + GtkWidget* aNewContainer, + GdkWindow* aNewParentWindow, + GtkWidget* aOldContainer) { if (!aNewContainer) { // The new parent GdkWindow has been destroyed. MOZ_ASSERT(!aNewParentWindow || gdk_window_is_destroyed(aNewParentWindow), @@ -899,7 +899,7 @@ void nsWindow::ReparentNativeWidgetInternal(nsIWidget *aNewParent, } } - auto *newParent = static_cast(aNewParent); + auto* newParent = static_cast(aNewParent); bool parentHasMappedToplevel = newParent && newParent->mHasMappedToplevel; if (mHasMappedToplevel != parentHasMappedToplevel) { SetHasMappedToplevel(parentHasMappedToplevel); @@ -907,7 +907,7 @@ void nsWindow::ReparentNativeWidgetInternal(nsIWidget *aNewParent, } void nsWindow::SetModal(bool aModal) { - LOG(("nsWindow::SetModal [%p] %d\n", (void *)this, aModal)); + LOG(("nsWindow::SetModal [%p] %d\n", (void*)this, aModal)); if (mIsDestroyed) return; if (!mIsTopLevel || !mShell) return; gtk_window_set_modal(GTK_WINDOW(mShell), aModal ? TRUE : FALSE); @@ -923,7 +923,7 @@ void nsWindow::RegisterTouchWindow() { #endif } -void nsWindow::ConstrainPosition(bool aAllowSlop, int32_t *aX, int32_t *aY) { +void nsWindow::ConstrainPosition(bool aAllowSlop, int32_t* aX, int32_t* aY) { if (!mIsTopLevel || !mShell) return; double dpiScale = GetDefaultScale().scale; @@ -979,7 +979,7 @@ void nsWindow::ConstrainPosition(bool aAllowSlop, int32_t *aX, int32_t *aY) { } } -void nsWindow::SetSizeConstraints(const SizeConstraints &aConstraints) { +void nsWindow::SetSizeConstraints(const SizeConstraints& aConstraints) { mSizeConstraints.mMinSize = GetSafeWindowSize(aConstraints.mMinSize); mSizeConstraints.mMaxSize = GetSafeWindowSize(aConstraints.mMaxSize); @@ -1016,7 +1016,7 @@ void nsWindow::Show(bool aState) { mIsShown = aState; - LOG(("nsWindow::Show [%p] state %d\n", (void *)this, aState)); + LOG(("nsWindow::Show [%p] state %d\n", (void*)this, aState)); if (aState) { // Now that this window is shown, mHasMappedToplevel needs to be @@ -1098,7 +1098,7 @@ void nsWindow::Enable(bool aState) { mEnabled = aState; } bool nsWindow::IsEnabled() const { return mEnabled; } void nsWindow::Move(double aX, double aY) { - LOG(("nsWindow::Move [%p] %f %f\n", (void *)this, aX, aY)); + LOG(("nsWindow::Move [%p] %f %f\n", (void*)this, aX, aY)); double scale = BoundsUseDesktopPixels() ? GetDesktopToDeviceScale().scale : 1.0; @@ -1134,26 +1134,26 @@ bool nsWindow::IsWaylandPopup() { #ifdef DEBUG static void NativeMoveResizeWaylandPopupCallback( - GdkWindow *window, const GdkRectangle *flipped_rect, - const GdkRectangle *final_rect, gboolean flipped_x, gboolean flipped_y, - void *unused) { + GdkWindow* window, const GdkRectangle* flipped_rect, + const GdkRectangle* final_rect, gboolean flipped_x, gboolean flipped_y, + void* unused) { LOG(("%s flipped %d %d\n", __FUNCTION__, flipped_rect->x, flipped_rect->y)); LOG(("%s final %d %d\n", __FUNCTION__, final_rect->x, final_rect->y)); } #endif -void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint *aPosition, - GdkRectangle *aSize) { +void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint* aPosition, + GdkRectangle* aSize) { // Available as of GTK 3.24+ static auto sGdkWindowMoveToRect = (void (*)( - GdkWindow *, const GdkRectangle *, GdkGravity, GdkGravity, GdkAnchorHints, + GdkWindow*, const GdkRectangle*, GdkGravity, GdkGravity, GdkAnchorHints, gint, gint))dlsym(RTLD_DEFAULT, "gdk_window_move_to_rect"); if (aSize) { gtk_window_resize(GTK_WINDOW(mShell), aSize->width, aSize->height); } - GdkWindow *gdkWindow = gtk_widget_get_window(GTK_WIDGET(mShell)); + GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(mShell)); // gdk_window_move_to_rect() is not available, we don't have a valid GdkWindow // (we're not realized yet) - try plain gtk_window_move() at least. if (!sGdkWindowMoveToRect || !gdkWindow) { @@ -1161,7 +1161,7 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint *aPosition, return; } - GtkWindow *parentWindow = GetPopupParentWindow(); + GtkWindow* parentWindow = GetPopupParentWindow(); if (parentWindow) { gtk_window_set_transient_for(GTK_WINDOW(mShell), parentWindow); } else { @@ -1169,7 +1169,7 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint *aPosition, } LOG(("nsWindow::NativeMoveResizeWaylandPopup [%p] Set popup parent %p\n", - (void *)this, parentWindow)); + (void*)this, parentWindow)); int x_parent, y_parent; gdk_window_get_origin(gtk_widget_get_window(GTK_WIDGET(parentWindow)), @@ -1181,7 +1181,7 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint *aPosition, rect.height = aSize->height; } - LOG(("%s [%p] request position %d,%d\n", __FUNCTION__, (void *)this, + LOG(("%s [%p] request position %d,%d\n", __FUNCTION__, (void*)this, aPosition->x, aPosition->y)); if (aSize) { LOG((" request size %d,%d\n", aSize->width, aSize->height)); @@ -1210,7 +1210,7 @@ void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint *aPosition, void nsWindow::NativeMove() { GdkPoint point = DevicePixelsToGdkPointRoundDown(mBounds.TopLeft()); - LOG(("nsWindow::NativeMove [%p] %d %d\n", (void *)this, point.x, point.y)); + LOG(("nsWindow::NativeMove [%p] %d %d\n", (void*)this, point.x, point.y)); if (IsWaylandPopup()) { NativeMoveResizeWaylandPopup(&point, nullptr); @@ -1222,7 +1222,7 @@ void nsWindow::NativeMove() { } void nsWindow::SetZIndex(int32_t aZIndex) { - nsIWidget *oldPrev = GetPrevSibling(); + nsIWidget* oldPrev = GetPrevSibling(); nsBaseWidget::SetZIndex(aZIndex); @@ -1240,15 +1240,15 @@ void nsWindow::SetZIndex(int32_t aZIndex) { if (mGdkWindow) gdk_window_raise(mGdkWindow); } else { // All the siblings before us need to be below our widget. - for (nsWindow *w = this; w; - w = static_cast(w->GetPrevSibling())) { + for (nsWindow* w = this; w; + w = static_cast(w->GetPrevSibling())) { if (w->mGdkWindow) gdk_window_lower(w->mGdkWindow); } } } void nsWindow::SetSizeMode(nsSizeMode aMode) { - LOG(("nsWindow::SetSizeMode [%p] %d\n", (void *)this, aMode)); + LOG(("nsWindow::SetSizeMode [%p] %d\n", (void*)this, aMode)); // Save the requested state. nsBaseWidget::SetSizeMode(aMode); @@ -1282,12 +1282,12 @@ void nsWindow::SetSizeMode(nsSizeMode aMode) { mSizeState = mSizeMode; } -typedef void (*SetUserTimeFunc)(GdkWindow *aWindow, guint32 aTimestamp); +typedef void (*SetUserTimeFunc)(GdkWindow* aWindow, guint32 aTimestamp); // This will become obsolete when new GTK APIs are widely supported, // as described here: http://bugzilla.gnome.org/show_bug.cgi?id=347375 -static void SetUserTimeAndStartupIDForActivatedWindow(GtkWidget *aWindow) { - nsGTKToolkit *GTKToolkit = nsGTKToolkit::GetToolkit(); +static void SetUserTimeAndStartupIDForActivatedWindow(GtkWidget* aWindow) { + nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit(); if (!GTKToolkit) return; nsAutoCString desktopStartupID; @@ -1308,14 +1308,14 @@ static void SetUserTimeAndStartupIDForActivatedWindow(GtkWidget *aWindow) { #if defined(MOZ_ENABLE_STARTUP_NOTIFICATION) // TODO - Implement for non-X11 Gtk backends (Bug 726479) if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) { - GdkWindow *gdkWindow = gtk_widget_get_window(aWindow); + GdkWindow* gdkWindow = gtk_widget_get_window(aWindow); - GdkScreen *screen = gdk_window_get_screen(gdkWindow); - SnDisplay *snd = sn_display_new( + GdkScreen* screen = gdk_window_get_screen(gdkWindow); + SnDisplay* snd = sn_display_new( gdk_x11_display_get_xdisplay(gdk_window_get_display(gdkWindow)), nullptr, nullptr); if (!snd) return; - SnLauncheeContext *ctx = sn_launchee_context_new( + SnLauncheeContext* ctx = sn_launchee_context_new( snd, gdk_screen_get_number(screen), desktopStartupID.get()); if (!ctx) { sn_display_unref(snd); @@ -1349,7 +1349,7 @@ guint32 nsWindow::GetLastUserInputTime() { // WM_DELETE_WINDOW delete events, but not usually mouse motion nor // button and key releases. Therefore use the most recent of // gdk_x11_display_get_user_time and the last time that we have seen. - GdkDisplay *gdkDisplay = gdk_display_get_default(); + GdkDisplay* gdkDisplay = gdk_display_get_default(); guint32 timestamp = GDK_IS_X11_DISPLAY(gdkDisplay) ? gdk_x11_display_get_user_time(gdkDisplay) : gtk_get_current_event_time(); @@ -1366,19 +1366,19 @@ nsresult nsWindow::SetFocus(bool aRaise) { // Make sure that our owning widget has focus. If it doesn't try to // grab it. Note that we don't set our focus flag in this case. - LOGFOCUS((" SetFocus %d [%p]\n", aRaise, (void *)this)); + LOGFOCUS((" SetFocus %d [%p]\n", aRaise, (void*)this)); - GtkWidget *owningWidget = GetMozContainerWidget(); + GtkWidget* owningWidget = GetMozContainerWidget(); if (!owningWidget) return NS_ERROR_FAILURE; // Raise the window if someone passed in true and the prefs are // set properly. - GtkWidget *toplevelWidget = gtk_widget_get_toplevel(owningWidget); + GtkWidget* toplevelWidget = gtk_widget_get_toplevel(owningWidget); if (gRaiseWindows && aRaise && toplevelWidget && !gtk_widget_has_focus(owningWidget) && !gtk_widget_has_focus(toplevelWidget)) { - GtkWidget *top_window = GetToplevelWidget(); + GtkWidget* top_window = GetToplevelWidget(); if (top_window && (gtk_widget_get_visible(top_window))) { gdk_window_show_unraised(gtk_widget_get_window(top_window)); // Unset the urgency hint if possible. @@ -1399,10 +1399,10 @@ nsresult nsWindow::SetFocus(bool aRaise) { !gtk_window_is_active(GTK_WINDOW(owningWindow->mShell))) { uint32_t timestamp = GDK_CURRENT_TIME; - nsGTKToolkit *GTKToolkit = nsGTKToolkit::GetToolkit(); + nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit(); if (GTKToolkit) timestamp = GTKToolkit->GetFocusTimestamp(); - LOGFOCUS((" requesting toplevel activation [%p]\n", (void *)this)); + LOGFOCUS((" requesting toplevel activation [%p]\n", (void*)this)); NS_ASSERTION(owningWindow->mWindowType != eWindowType_popup || mParent, "Presenting an override-redirect window"); gtk_window_present_with_time(GTK_WINDOW(owningWindow->mShell), timestamp); @@ -1432,7 +1432,7 @@ nsresult nsWindow::SetFocus(bool aRaise) { // If this is the widget that already has focus, return. if (gFocusWindow == this) { - LOGFOCUS((" already have focus [%p]\n", (void *)this)); + LOGFOCUS((" already have focus [%p]\n", (void*)this)); return NS_OK; } @@ -1443,7 +1443,7 @@ nsresult nsWindow::SetFocus(bool aRaise) { mIMContext->OnFocusWindow(this); } - LOGFOCUS((" widget now has focus in SetFocus() [%p]\n", (void *)this)); + LOGFOCUS((" widget now has focus in SetFocus() [%p]\n", (void*)this)); return NS_OK; } @@ -1496,7 +1496,7 @@ void nsWindow::UpdateClientOffset() { GdkAtom type_returned; int format_returned; int length_returned; - long *frame_extents; + long* frame_extents; if (!gdk_property_get(gtk_widget_get_window(mShell), gdk_atom_intern("_NET_FRAME_EXTENTS", FALSE), @@ -1505,7 +1505,7 @@ void nsWindow::UpdateClientOffset() { 4 * 4, // length FALSE, // delete &type_returned, &format_returned, &length_returned, - (guchar **)&frame_extents) || + (guchar**)&frame_extents) || length_returned / sizeof(glong) != 4) { mClientOffset = nsIntPoint(0, 0); return; @@ -1524,8 +1524,8 @@ LayoutDeviceIntPoint nsWindow::GetClientOffset() { return LayoutDeviceIntPoint::FromUnknownPoint(mClientOffset); } -gboolean nsWindow::OnPropertyNotifyEvent(GtkWidget *aWidget, - GdkEventProperty *aEvent) { +gboolean nsWindow::OnPropertyNotifyEvent(GtkWidget* aWidget, + GdkEventProperty* aEvent) { if (aEvent->atom == gdk_atom_intern("_NET_FRAME_EXTENTS", FALSE)) { UpdateClientOffset(); @@ -1543,12 +1543,12 @@ gboolean nsWindow::OnPropertyNotifyEvent(GtkWidget *aWidget, return FALSE; } -static GdkCursor *GetCursorForImage(imgIContainer *aCursorImage, +static GdkCursor* GetCursorForImage(imgIContainer* aCursorImage, uint32_t aHotspotX, uint32_t aHotspotY) { if (!aCursorImage) { return nullptr; } - GdkPixbuf *pixbuf = nsImageToPixbuf::ImageToPixbuf(aCursorImage); + GdkPixbuf* pixbuf = nsImageToPixbuf::ImageToPixbuf(aCursorImage); if (!pixbuf) { return nullptr; } @@ -1574,7 +1574,7 @@ static GdkCursor *GetCursorForImage(imgIContainer *aCursorImage, // is of course not documented anywhere... // So add one if there isn't one yet if (!gdk_pixbuf_get_has_alpha(pixbuf)) { - GdkPixbuf *alphaBuf = gdk_pixbuf_add_alpha(pixbuf, FALSE, 0, 0, 0); + GdkPixbuf* alphaBuf = gdk_pixbuf_add_alpha(pixbuf, FALSE, 0, 0, 0); g_object_unref(pixbuf); pixbuf = alphaBuf; if (!alphaBuf) { @@ -1586,12 +1586,12 @@ static GdkCursor *GetCursorForImage(imgIContainer *aCursorImage, aHotspotX, aHotspotY); } -void nsWindow::SetCursor(nsCursor aDefaultCursor, imgIContainer *aCursorImage, +void nsWindow::SetCursor(nsCursor aDefaultCursor, imgIContainer* aCursorImage, uint32_t aHotspotX, uint32_t aHotspotY) { // if we're not the toplevel window pass up the cursor request to // the toplevel window to handle it. if (!mContainer && mGdkWindow) { - nsWindow *window = GetContainerWindow(); + nsWindow* window = GetContainerWindow(); if (!window) return; window->SetCursor(aDefaultCursor, aCursorImage, aHotspotX, aHotspotY); @@ -1607,7 +1607,7 @@ void nsWindow::SetCursor(nsCursor aDefaultCursor, imgIContainer *aCursorImage, mCursor = eCursorInvalid; // Try to set the cursor image first, and fall back to the numeric cursor. - GdkCursor *newCursor = GetCursorForImage(aCursorImage, aHotspotX, aHotspotY); + GdkCursor* newCursor = GetCursorForImage(aCursorImage, aHotspotX, aHotspotY); if (!newCursor) { newCursor = get_gtk_cursor(aDefaultCursor); if (newCursor) { @@ -1630,17 +1630,17 @@ void nsWindow::SetCursor(nsCursor aDefaultCursor, imgIContainer *aCursorImage, newCursor); } -void nsWindow::Invalidate(const LayoutDeviceIntRect &aRect) { +void nsWindow::Invalidate(const LayoutDeviceIntRect& aRect) { if (!mGdkWindow) return; GdkRectangle rect = DevicePixelsToGdkRectRoundOut(aRect); gdk_window_invalidate_rect(mGdkWindow, &rect, FALSE); - LOGDRAW(("Invalidate (rect) [%p]: %d %d %d %d\n", (void *)this, rect.x, - rect.y, rect.width, rect.height)); + LOGDRAW(("Invalidate (rect) [%p]: %d %d %d %d\n", (void*)this, rect.x, rect.y, + rect.width, rect.height)); } -void *nsWindow::GetNativeData(uint32_t aDataType) { +void* nsWindow::GetNativeData(uint32_t aDataType) { switch (aDataType) { case NS_NATIVE_WINDOW: case NS_NATIVE_WIDGET: { @@ -1651,7 +1651,7 @@ void *nsWindow::GetNativeData(uint32_t aDataType) { case NS_NATIVE_DISPLAY: { #ifdef MOZ_X11 - GdkDisplay *gdkDisplay = gdk_display_get_default(); + GdkDisplay* gdkDisplay = gdk_display_get_default(); if (GDK_IS_X11_DISPLAY(gdkDisplay)) { return GDK_DISPLAY_XDISPLAY(gdkDisplay); } @@ -1665,14 +1665,14 @@ void *nsWindow::GetNativeData(uint32_t aDataType) { case NS_NATIVE_SHAREABLE_WINDOW: if (mIsX11Display) { - return (void *)GDK_WINDOW_XID(gdk_window_get_toplevel(mGdkWindow)); + return (void*)GDK_WINDOW_XID(gdk_window_get_toplevel(mGdkWindow)); } NS_WARNING( "nsWindow::GetNativeData(): NS_NATIVE_SHAREABLE_WINDOW is not " "handled on Wayland!"); return nullptr; case NS_RAW_NATIVE_IME_CONTEXT: { - void *pseudoIMEContext = GetPseudoIMEContext(); + void* pseudoIMEContext = GetPseudoIMEContext(); if (pseudoIMEContext) { return pseudoIMEContext; } @@ -1691,7 +1691,7 @@ void *nsWindow::GetNativeData(uint32_t aDataType) { #endif // MOZ_X11 case NS_NATIVE_EGL_WINDOW: { if (mIsX11Display) - return mGdkWindow ? (void *)GDK_WINDOW_XID(mGdkWindow) : nullptr; + return mGdkWindow ? (void*)GDK_WINDOW_XID(mGdkWindow) : nullptr; #ifdef MOZ_WAYLAND if (mContainer) return moz_container_get_wl_egl_window(mContainer); #endif @@ -1703,7 +1703,7 @@ void *nsWindow::GetNativeData(uint32_t aDataType) { } } -nsresult nsWindow::SetTitle(const nsAString &aTitle) { +nsresult nsWindow::SetTitle(const nsAString& aTitle) { if (!mShell) return NS_OK; // convert the string into utf8 and set the title. @@ -1716,12 +1716,12 @@ nsresult nsWindow::SetTitle(const nsAString &aTitle) { while (UTF8_FOLLOWBYTE(titleUTF8[len])) --len; titleUTF8.Truncate(len); } - gtk_window_set_title(GTK_WINDOW(mShell), (const char *)titleUTF8.get()); + gtk_window_set_title(GTK_WINDOW(mShell), (const char*)titleUTF8.get()); return NS_OK; } -void nsWindow::SetIcon(const nsAString &aIconSpec) { +void nsWindow::SetIcon(const nsAString& aIconSpec) { if (!mShell) return; nsAutoCString iconName; @@ -1741,7 +1741,7 @@ void nsWindow::SetIcon(const nsAString &aIconSpec) { nsCOMPtr iconFile; nsAutoCString path; - gint *iconSizes = gtk_icon_theme_get_icon_sizes(gtk_icon_theme_get_default(), + gint* iconSizes = gtk_icon_theme_get_icon_sizes(gtk_icon_theme_get_default(), iconName.get()); bool foundIcon = (iconSizes[0] != 0); g_free(iconSizes); @@ -1763,7 +1763,7 @@ void nsWindow::SetIcon(const nsAString &aIconSpec) { getter_AddRefs(iconFile)); if (iconFile) { iconFile->GetNativePath(path); - GdkPixbuf *icon = gdk_pixbuf_new_from_file(path.get(), nullptr); + GdkPixbuf* icon = gdk_pixbuf_new_from_file(path.get(), nullptr); if (icon) { gtk_icon_theme_add_builtin_icon(iconName.get(), gdk_pixbuf_get_height(icon), icon); @@ -1791,7 +1791,7 @@ LayoutDeviceIntPoint nsWindow::WidgetToScreenOffset() { } void nsWindow::CaptureMouse(bool aCapture) { - LOG(("CaptureMouse %p\n", (void *)this)); + LOG(("CaptureMouse %p\n", (void*)this)); if (!mGdkWindow) return; @@ -1806,7 +1806,7 @@ void nsWindow::CaptureMouse(bool aCapture) { } } -void nsWindow::CaptureRollupEvents(nsIRollupListener *aListener, +void nsWindow::CaptureRollupEvents(nsIRollupListener* aListener, bool aDoCapture) { if (!mGdkWindow) return; @@ -1835,10 +1835,10 @@ void nsWindow::CaptureRollupEvents(nsIRollupListener *aListener, } nsresult nsWindow::GetAttention(int32_t aCycleCount) { - LOG(("nsWindow::GetAttention [%p]\n", (void *)this)); + LOG(("nsWindow::GetAttention [%p]\n", (void*)this)); - GtkWidget *top_window = GetToplevelWidget(); - GtkWidget *top_focused_window = + GtkWidget* top_window = GetToplevelWidget(); + GtkWidget* top_focused_window = gFocusWindow ? gFocusWindow->GetToplevelWidget() : nullptr; // Don't get attention if the window is focused anyway. @@ -1860,7 +1860,7 @@ bool nsWindow::HasPendingInputEvent() { #ifdef MOZ_X11 XEvent ev; if (mIsX11Display) { - Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); + Display* display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); haveEvent = XCheckMaskEvent( display, KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | @@ -1951,15 +1951,15 @@ gdk_window_flash(GdkWindow * aGdkWindow, #ifdef cairo_copy_clip_rectangle_list # error "Looks like we're including Mozilla's cairo instead of system cairo" #endif -static bool ExtractExposeRegion(LayoutDeviceIntRegion &aRegion, cairo_t *cr) { - cairo_rectangle_list_t *rects = cairo_copy_clip_rectangle_list(cr); +static bool ExtractExposeRegion(LayoutDeviceIntRegion& aRegion, cairo_t* cr) { + cairo_rectangle_list_t* rects = cairo_copy_clip_rectangle_list(cr); if (rects->status != CAIRO_STATUS_SUCCESS) { NS_WARNING("Failed to obtain cairo rectangle list."); return false; } for (int i = 0; i < rects->num_rectangles; i++) { - const cairo_rectangle_t &r = rects->rectangles[i]; + const cairo_rectangle_t& r = rects->rectangles[i]; aRegion.Or(aRegion, LayoutDeviceIntRect::Truncate(r.x, r.y, r.width, r.height)); LOGDRAW(("\t%f %f %f %f\n", r.x, r.y, r.width, r.height)); @@ -1977,7 +1977,7 @@ void nsWindow::WaylandEGLSurfaceForceRedraw() { return; } - if (CompositorBridgeChild *remoteRenderer = GetRemoteRenderer()) { + if (CompositorBridgeChild* remoteRenderer = GetRemoteRenderer()) { MOZ_ASSERT(mCompositorWidgetDelegate); if (mCompositorWidgetDelegate) { mNeedsUpdatingEGLSurface = false; @@ -1988,7 +1988,7 @@ void nsWindow::WaylandEGLSurfaceForceRedraw() { } #endif -gboolean nsWindow::OnExposeEvent(cairo_t *cr) { +gboolean nsWindow::OnExposeEvent(cairo_t* cr) { // Send any pending resize events so that layout can update. // May run event loop. MaybeDispatchResized(); @@ -2003,7 +2003,7 @@ gboolean nsWindow::OnExposeEvent(cairo_t *cr) { if (mContainer && !mContainer->ready_to_draw) return FALSE; #endif - nsIWidgetListener *listener = GetListener(); + nsIWidgetListener* listener = GetListener(); if (!listener) return FALSE; LayoutDeviceIntRegion exposeRegion; @@ -2045,8 +2045,8 @@ gboolean nsWindow::OnExposeEvent(cairo_t *cr) { GetLayerManager()->SetNeedsComposite(false); } - LOGDRAW(("sending expose event [%p] %p 0x%lx (rects follow):\n", (void *)this, - (void *)mGdkWindow, + LOGDRAW(("sending expose event [%p] %p 0x%lx (rects follow):\n", (void*)this, + (void*)mGdkWindow, mIsX11Display ? gdk_x11_window_get_xid(mGdkWindow) : 0)); // Our bounds may have changed after calling WillPaintWindow. Clip @@ -2056,7 +2056,7 @@ gboolean nsWindow::OnExposeEvent(cairo_t *cr) { bool shaped = false; if (eTransparencyTransparent == GetTransparencyMode()) { - auto window = static_cast(GetTopLevelWidget()); + auto window = static_cast(GetTopLevelWidget()); if (mTransparencyBitmapForTitlebar) { if (mSizeState == nsSizeMode_Normal) { window->UpdateTitlebarTransparencyBitmap(); @@ -2075,10 +2075,10 @@ gboolean nsWindow::OnExposeEvent(cairo_t *cr) { } if (!shaped) { - GList *children = gdk_window_peek_children(mGdkWindow); + GList* children = gdk_window_peek_children(mGdkWindow); while (children) { - GdkWindow *gdkWin = GDK_WINDOW(children->data); - nsWindow *kid = get_window_for_gdk_window(gdkWin); + GdkWindow* gdkWin = GDK_WINDOW(children->data); + nsWindow* kid = get_window_for_gdk_window(gdkWin); if (kid && gdk_window_is_visible(gdkWin)) { AutoTArray clipRects; kid->GetWindowClipRegion(&clipRects); @@ -2209,7 +2209,7 @@ gboolean nsWindow::OnExposeEvent(cairo_t *cr) { listener->DidPaintWindow(); // Synchronously flush any new dirty areas - cairo_region_t *dirtyArea = gdk_window_get_update_area(mGdkWindow); + cairo_region_t* dirtyArea = gdk_window_get_update_area(mGdkWindow); if (dirtyArea) { gdk_window_invalidate_region(mGdkWindow, dirtyArea, false); @@ -2221,7 +2221,7 @@ gboolean nsWindow::OnExposeEvent(cairo_t *cr) { return TRUE; } -void nsWindow::UpdateAlpha(SourceSurface *aSourceSurface, +void nsWindow::UpdateAlpha(SourceSurface* aSourceSurface, nsIntRect aBoundsRect) { // We need to create our own buffer to force the stride to match the // expected stride. @@ -2248,8 +2248,8 @@ void nsWindow::UpdateAlpha(SourceSurface *aSourceSurface, UpdateTranslucentWindowAlphaInternal(aBoundsRect, imageBuffer.get(), stride); } -gboolean nsWindow::OnConfigureEvent(GtkWidget *aWidget, - GdkEventConfigure *aEvent) { +gboolean nsWindow::OnConfigureEvent(GtkWidget* aWidget, + GdkEventConfigure* aEvent) { // These events are only received on toplevel windows. // // GDK ensures that the coordinates are the client window top-left wrt the @@ -2267,7 +2267,7 @@ gboolean nsWindow::OnConfigureEvent(GtkWidget *aWidget, // Override-redirect windows are children of the root window so parent // coordinates are root coordinates. - LOG(("configure event [%p] %d %d %d %d\n", (void *)this, aEvent->x, aEvent->y, + LOG(("configure event [%p] %d %d %d %d\n", (void*)this, aEvent->x, aEvent->y, aEvent->width, aEvent->height)); if (mPendingConfigures > 0) { @@ -2328,8 +2328,8 @@ void nsWindow::OnContainerUnrealize() { } } -void nsWindow::OnSizeAllocate(GtkAllocation *aAllocation) { - LOG(("size_allocate [%p] %d %d %d %d\n", (void *)this, aAllocation->x, +void nsWindow::OnSizeAllocate(GtkAllocation* aAllocation) { + LOG(("size_allocate [%p] %d %d %d %d\n", (void*)this, aAllocation->x, aAllocation->y, aAllocation->width, aAllocation->height)); LayoutDeviceIntSize size = GdkRectToDevicePixels(*aAllocation).Size(); @@ -2371,7 +2371,7 @@ void nsWindow::OnDeleteEvent() { if (mWidgetListener) mWidgetListener->RequestWindowClose(this); } -void nsWindow::OnEnterNotifyEvent(GdkEventCrossing *aEvent) { +void nsWindow::OnEnterNotifyEvent(GdkEventCrossing* aEvent) { // This skips NotifyVirtual and NotifyNonlinearVirtual enter notify events // when the pointer enters a child window. If the destination window is a // Gecko window then we'll catch the corresponding event on that window, @@ -2391,25 +2391,25 @@ void nsWindow::OnEnterNotifyEvent(GdkEventCrossing *aEvent) { event.mRefPoint = GdkEventCoordsToDevicePixels(aEvent->x, aEvent->y); event.AssignEventTime(GetWidgetEventTime(aEvent->time)); - LOG(("OnEnterNotify: %p\n", (void *)this)); + LOG(("OnEnterNotify: %p\n", (void*)this)); DispatchInputEvent(&event); } // XXX Is this the right test for embedding cases? -static bool is_top_level_mouse_exit(GdkWindow *aWindow, - GdkEventCrossing *aEvent) { +static bool is_top_level_mouse_exit(GdkWindow* aWindow, + GdkEventCrossing* aEvent) { auto x = gint(aEvent->x_root); auto y = gint(aEvent->y_root); - GdkDisplay *display = gdk_window_get_display(aWindow); - GdkWindow *winAtPt = gdk_display_get_window_at_pointer(display, &x, &y); + GdkDisplay* display = gdk_window_get_display(aWindow); + GdkWindow* winAtPt = gdk_display_get_window_at_pointer(display, &x, &y); if (!winAtPt) return true; - GdkWindow *topLevelAtPt = gdk_window_get_toplevel(winAtPt); - GdkWindow *topLevelWidget = gdk_window_get_toplevel(aWindow); + GdkWindow* topLevelAtPt = gdk_window_get_toplevel(winAtPt); + GdkWindow* topLevelWidget = gdk_window_get_toplevel(aWindow); return topLevelAtPt != topLevelWidget; } -void nsWindow::OnLeaveNotifyEvent(GdkEventCrossing *aEvent) { +void nsWindow::OnLeaveNotifyEvent(GdkEventCrossing* aEvent) { // This ignores NotifyVirtual and NotifyNonlinearVirtual leave notify // events when the pointer leaves a child window. If the destination // window is a Gecko window then we'll catch the corresponding event on @@ -2430,13 +2430,13 @@ void nsWindow::OnLeaveNotifyEvent(GdkEventCrossing *aEvent) { ? WidgetMouseEvent::eTopLevel : WidgetMouseEvent::eChild; - LOG(("OnLeaveNotify: %p\n", (void *)this)); + LOG(("OnLeaveNotify: %p\n", (void*)this)); DispatchInputEvent(&event); } template -static LayoutDeviceIntPoint GetRefPoint(nsWindow *aWindow, Event *aEvent) { +static LayoutDeviceIntPoint GetRefPoint(nsWindow* aWindow, Event* aEvent) { if (aEvent->window == aWindow->GetGdkWindow()) { // we are the window that the event happened on so no need for expensive // WidgetToScreenOffset @@ -2449,11 +2449,11 @@ static LayoutDeviceIntPoint GetRefPoint(nsWindow *aWindow, Event *aEvent) { aWindow->WidgetToScreenOffset(); } -void nsWindow::OnMotionNotifyEvent(GdkEventMotion *aEvent) { +void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) { if (mWindowShouldStartDragging) { mWindowShouldStartDragging = false; // find the top-level window - GdkWindow *gdk_window = gdk_window_get_toplevel(mGdkWindow); + GdkWindow* gdk_window = gdk_window_get_toplevel(mGdkWindow); MOZ_ASSERT(gdk_window, "gdk_window_get_toplevel should not return null"); bool canDrag = true; @@ -2461,7 +2461,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion *aEvent) { // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=789054 // To avoid crashes disable double-click on WM without _NET_WM_MOVERESIZE. // See _should_perform_ewmh_drag() at gdkwindow-x11.c - GdkScreen *screen = gdk_window_get_screen(gdk_window); + GdkScreen* screen = gdk_window_get_screen(gdk_window); GdkAtom atom = gdk_atom_intern("_NET_WM_MOVERESIZE", FALSE); if (!gdk_x11_screen_supports_net_wm_hint(screen, atom)) { canDrag = false; @@ -2499,7 +2499,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion *aEvent) { WidgetMouseEvent event(true, eMouseMove, this, WidgetMouseEvent::eReal); gdouble pressure = 0; - gdk_event_get_axis((GdkEvent *)aEvent, GDK_AXIS_PRESSURE, &pressure); + gdk_event_get_axis((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); // Sometime gdk generate 0 pressure value between normal values // We have to ignore that and use last valid value if (pressure) mLastMotionPressure = pressure; @@ -2541,7 +2541,7 @@ void nsWindow::OnMotionNotifyEvent(GdkEventMotion *aEvent) { // True as the ButtonRelease may be received on a foreign [plugin] window). // Use this method to check for released buttons when the pointer returns to a // Gecko window. -void nsWindow::DispatchMissedButtonReleases(GdkEventCrossing *aGdkEvent) { +void nsWindow::DispatchMissedButtonReleases(GdkEventCrossing* aGdkEvent) { guint changed = aGdkEvent->state ^ gButtonState; // Only consider button releases. // (Ignore button presses that occurred outside Gecko.) @@ -2568,7 +2568,7 @@ void nsWindow::DispatchMissedButtonReleases(GdkEventCrossing *aGdkEvent) { } LOG(("Synthesized button %u release on %p\n", guint(buttonType + 1), - (void *)this)); + (void*)this)); // Dispatch a synthesized button up event to tell Gecko about the // change in state. This event is marked as synthesized so that @@ -2582,8 +2582,8 @@ void nsWindow::DispatchMissedButtonReleases(GdkEventCrossing *aGdkEvent) { } } -void nsWindow::InitButtonEvent(WidgetMouseEvent &aEvent, - GdkEventButton *aGdkEvent) { +void nsWindow::InitButtonEvent(WidgetMouseEvent& aEvent, + GdkEventButton* aGdkEvent) { aEvent.mRefPoint = GetRefPoint(this, aGdkEvent); guint modifierState = aGdkEvent->state; @@ -2630,7 +2630,7 @@ static guint ButtonMaskFromGDKButton(guint button) { } void nsWindow::DispatchContextMenuEventFromMouseEvent(uint16_t domButton, - GdkEventButton *aEvent) { + GdkEventButton* aEvent) { if (domButton == MouseButton::eRight && MOZ_LIKELY(!mIsDestroyed)) { WidgetMouseEvent contextMenuEvent(true, eContextMenu, this, WidgetMouseEvent::eReal); @@ -2640,8 +2640,8 @@ void nsWindow::DispatchContextMenuEventFromMouseEvent(uint16_t domButton, } } -void nsWindow::OnButtonPressEvent(GdkEventButton *aEvent) { - LOG(("Button %u press on %p\n", aEvent->button, (void *)this)); +void nsWindow::OnButtonPressEvent(GdkEventButton* aEvent) { + LOG(("Button %u press on %p\n", aEvent->button, (void*)this)); // If you double click in GDK, it will actually generate a second // GDK_BUTTON_PRESS before sending the GDK_2BUTTON_PRESS, and this is @@ -2649,14 +2649,14 @@ void nsWindow::OnButtonPressEvent(GdkEventButton *aEvent) { // programatically, so it's safe to assume that if there's a // double click in the queue, it was generated so we can just drop // this click. - GdkEvent *peekedEvent = gdk_event_peek(); + GdkEvent* peekedEvent = gdk_event_peek(); if (peekedEvent) { GdkEventType type = peekedEvent->any.type; gdk_event_free(peekedEvent); if (type == GDK_2BUTTON_PRESS || type == GDK_3BUTTON_PRESS) return; } - nsWindow *containerWindow = GetContainerWindow(); + nsWindow* containerWindow = GetContainerWindow(); if (!gFocusWindow && containerWindow) { containerWindow->DispatchActivateEvent(); } @@ -2665,7 +2665,7 @@ void nsWindow::OnButtonPressEvent(GdkEventButton *aEvent) { if (CheckForRollup(aEvent->x_root, aEvent->y_root, false, false)) return; gdouble pressure = 0; - gdk_event_get_axis((GdkEvent *)aEvent, GDK_AXIS_PRESSURE, &pressure); + gdk_event_get_axis((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); mLastMotionPressure = pressure; uint16_t domButton; @@ -2718,8 +2718,8 @@ void nsWindow::OnButtonPressEvent(GdkEventButton *aEvent) { } } -void nsWindow::OnButtonReleaseEvent(GdkEventButton *aEvent) { - LOG(("Button %u release on %p\n", aEvent->button, (void *)this)); +void nsWindow::OnButtonReleaseEvent(GdkEventButton* aEvent) { + LOG(("Button %u release on %p\n", aEvent->button, (void*)this)); if (mWindowShouldStartDragging) { mWindowShouldStartDragging = false; @@ -2746,7 +2746,7 @@ void nsWindow::OnButtonReleaseEvent(GdkEventButton *aEvent) { event.mButton = domButton; InitButtonEvent(event, aEvent); gdouble pressure = 0; - gdk_event_get_axis((GdkEvent *)aEvent, GDK_AXIS_PRESSURE, &pressure); + gdk_event_get_axis((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); event.mPressure = pressure ? pressure : mLastMotionPressure; // The mRefPoint is manipulated in DispatchInputEvent, we're saving it @@ -2775,18 +2775,18 @@ void nsWindow::OnButtonReleaseEvent(GdkEventButton *aEvent) { } } -void nsWindow::OnContainerFocusInEvent(GdkEventFocus *aEvent) { - LOGFOCUS(("OnContainerFocusInEvent [%p]\n", (void *)this)); +void nsWindow::OnContainerFocusInEvent(GdkEventFocus* aEvent) { + LOGFOCUS(("OnContainerFocusInEvent [%p]\n", (void*)this)); // Unset the urgency hint, if possible - GtkWidget *top_window = GetToplevelWidget(); + GtkWidget* top_window = GetToplevelWidget(); if (top_window && (gtk_widget_get_visible(top_window))) SetUrgencyHint(top_window, false); // Return if being called within SetFocus because the focus manager // already knows that the window is active. if (gBlockActivateEvent) { - LOGFOCUS(("activated notification is blocked [%p]\n", (void *)this)); + LOGFOCUS(("activated notification is blocked [%p]\n", (void*)this)); return; } @@ -2804,11 +2804,11 @@ void nsWindow::OnContainerFocusInEvent(GdkEventFocus *aEvent) { gFocusWindow = this; } - LOGFOCUS(("Events sent from focus in event [%p]\n", (void *)this)); + LOGFOCUS(("Events sent from focus in event [%p]\n", (void*)this)); } -void nsWindow::OnContainerFocusOutEvent(GdkEventFocus *aEvent) { - LOGFOCUS(("OnContainerFocusOutEvent [%p]\n", (void *)this)); +void nsWindow::OnContainerFocusOutEvent(GdkEventFocus* aEvent) { + LOGFOCUS(("OnContainerFocusOutEvent [%p]\n", (void*)this)); if (mWindowType == eWindowType_toplevel || mWindowType == eWindowType_dialog) { @@ -2842,10 +2842,10 @@ void nsWindow::OnContainerFocusOutEvent(GdkEventFocus *aEvent) { DispatchDeactivateEvent(); - LOGFOCUS(("Done with container focus out [%p]\n", (void *)this)); + LOGFOCUS(("Done with container focus out [%p]\n", (void*)this)); } -bool nsWindow::DispatchCommandEvent(nsAtom *aCommand) { +bool nsWindow::DispatchCommandEvent(nsAtom* aCommand) { nsEventStatus status; WidgetCommandEvent appCommandEvent(true, aCommand, this); DispatchEvent(&appCommandEvent, status); @@ -2887,7 +2887,7 @@ TimeStamp nsWindow::GetEventTimeStamp(guint32 aEventTime) { BaseTimeDurationPlatformUtils::TicksFromMilliseconds(timestampTime); eventTimeStamp = TimeStamp::FromSystemTime(tick); } else { - CurrentX11TimeGetter *getCurrentTime = GetCurrentTimeGetter(); + CurrentX11TimeGetter* getCurrentTime = GetCurrentTimeGetter(); MOZ_ASSERT(getCurrentTime, "Null current time getter despite having a window"); eventTimeStamp = @@ -2896,7 +2896,7 @@ TimeStamp nsWindow::GetEventTimeStamp(guint32 aEventTime) { return eventTimeStamp; } -mozilla::CurrentX11TimeGetter *nsWindow::GetCurrentTimeGetter() { +mozilla::CurrentX11TimeGetter* nsWindow::GetCurrentTimeGetter() { MOZ_ASSERT(mGdkWindow, "Expected mGdkWindow to be set"); if (MOZ_UNLIKELY(!mCurrentTimeGetter)) { mCurrentTimeGetter = MakeUnique(mGdkWindow); @@ -2904,16 +2904,16 @@ mozilla::CurrentX11TimeGetter *nsWindow::GetCurrentTimeGetter() { return mCurrentTimeGetter.get(); } -gboolean nsWindow::OnKeyPressEvent(GdkEventKey *aEvent) { - LOGFOCUS(("OnKeyPressEvent [%p]\n", (void *)this)); +gboolean nsWindow::OnKeyPressEvent(GdkEventKey* aEvent) { + LOGFOCUS(("OnKeyPressEvent [%p]\n", (void*)this)); RefPtr self(this); KeymapWrapper::HandleKeyPressEvent(self, aEvent); return TRUE; } -gboolean nsWindow::OnKeyReleaseEvent(GdkEventKey *aEvent) { - LOGFOCUS(("OnKeyReleaseEvent [%p]\n", (void *)this)); +gboolean nsWindow::OnKeyReleaseEvent(GdkEventKey* aEvent) { + LOGFOCUS(("OnKeyReleaseEvent [%p]\n", (void*)this)); RefPtr self(this); if (NS_WARN_IF(!KeymapWrapper::HandleKeyReleaseEvent(self, aEvent))) { @@ -2922,7 +2922,7 @@ gboolean nsWindow::OnKeyReleaseEvent(GdkEventKey *aEvent) { return TRUE; } -void nsWindow::OnScrollEvent(GdkEventScroll *aEvent) { +void nsWindow::OnScrollEvent(GdkEventScroll* aEvent) { // check to see if we should rollup if (CheckForRollup(aEvent->x_root, aEvent->y_root, true, false)) return; #if GTK_CHECK_VERSION(3, 4, 0) @@ -2947,7 +2947,7 @@ void nsWindow::OnScrollEvent(GdkEventScroll *aEvent) { // This next step manually unsets smooth scrolling for touch devices // that trigger GDK_SCROLL_SMOOTH. We use the slave device, which // represents the actual input. - GdkDevice *device = gdk_event_get_source_device((GdkEvent *)aEvent); + GdkDevice* device = gdk_event_get_source_device((GdkEvent*)aEvent); GdkInputSource source = gdk_device_get_source(device); if (source == GDK_SOURCE_TOUCHSCREEN || source == GDK_SOURCE_TOUCHPAD) { wheelEvent.mScrollType = WidgetWheelEvent::SCROLL_ASYNCHRONOUSELY; @@ -2978,7 +2978,7 @@ void nsWindow::OnScrollEvent(GdkEventScroll *aEvent) { DispatchInputEvent(&wheelEvent); } -void nsWindow::OnVisibilityNotifyEvent(GdkEventVisibility *aEvent) { +void nsWindow::OnVisibilityNotifyEvent(GdkEventVisibility* aEvent) { LOGDRAW(("Visibility event %i on [%p] %p\n", aEvent->state, this, aEvent->window)); @@ -3004,10 +3004,10 @@ void nsWindow::OnVisibilityNotifyEvent(GdkEventVisibility *aEvent) { } } -void nsWindow::OnWindowStateEvent(GtkWidget *aWidget, - GdkEventWindowState *aEvent) { +void nsWindow::OnWindowStateEvent(GtkWidget* aWidget, + GdkEventWindowState* aEvent) { LOG(("nsWindow::OnWindowStateEvent [%p] changed %d new_window_state %d\n", - (void *)this, aEvent->changed_mask, aEvent->new_window_state)); + (void*)this, aEvent->changed_mask, aEvent->new_window_state)); if (IS_MOZ_CONTAINER(aWidget)) { // This event is notifying the container widget of changes to the @@ -3118,11 +3118,11 @@ void nsWindow::ThemeChanged() { if (!mGdkWindow || MOZ_UNLIKELY(mIsDestroyed)) return; // Dispatch theme change notification to all child windows - GList *children = gdk_window_peek_children(mGdkWindow); + GList* children = gdk_window_peek_children(mGdkWindow); while (children) { - GdkWindow *gdkWin = GDK_WINDOW(children->data); + GdkWindow* gdkWin = GDK_WINDOW(children->data); - auto *win = (nsWindow *)g_object_get_data(G_OBJECT(gdkWin), "nsWindow"); + auto* win = (nsWindow*)g_object_get_data(G_OBJECT(gdkWin), "nsWindow"); if (win && win != this) { // guard against infinite recursion RefPtr kungFuDeathGrip = win; @@ -3137,7 +3137,7 @@ void nsWindow::ThemeChanged() { void nsWindow::OnDPIChanged() { if (mWidgetListener) { - if (PresShell *presShell = mWidgetListener->GetPresShell()) { + if (PresShell* presShell = mWidgetListener->GetPresShell()) { presShell->BackingScaleFactorChanged(); // Update menu's font size etc presShell->ThemeChanged(); @@ -3150,14 +3150,14 @@ void nsWindow::OnCheckResize() { mPendingConfigures++; } void nsWindow::OnCompositedChanged() { if (mWidgetListener) { - if (PresShell *presShell = mWidgetListener->GetPresShell()) { + if (PresShell* presShell = mWidgetListener->GetPresShell()) { // Update CSD after the change in alpha visibility presShell->ThemeChanged(); } } } -void nsWindow::OnScaleChanged(GtkAllocation *aAllocation) { +void nsWindow::OnScaleChanged(GtkAllocation* aAllocation) { #ifdef MOZ_WAYLAND if (mContainer && moz_container_has_wl_egl_window(mContainer)) { // We need to resize wl_egl_window when scale changes. @@ -3174,7 +3174,7 @@ void nsWindow::OnScaleChanged(GtkAllocation *aAllocation) { } void nsWindow::DispatchDragEvent(EventMessage aMsg, - const LayoutDeviceIntPoint &aRefPoint, + const LayoutDeviceIntPoint& aRefPoint, guint aTime) { WidgetDragEvent event(true, aMsg, this); @@ -3186,43 +3186,43 @@ void nsWindow::DispatchDragEvent(EventMessage aMsg, DispatchInputEvent(&event); } -void nsWindow::OnDragDataReceivedEvent(GtkWidget *aWidget, - GdkDragContext *aDragContext, gint aX, +void nsWindow::OnDragDataReceivedEvent(GtkWidget* aWidget, + GdkDragContext* aDragContext, gint aX, gint aY, - GtkSelectionData *aSelectionData, + GtkSelectionData* aSelectionData, guint aInfo, guint aTime, gpointer aData) { - LOGDRAG(("nsWindow::OnDragDataReceived(%p)\n", (void *)this)); + LOGDRAG(("nsWindow::OnDragDataReceived(%p)\n", (void*)this)); RefPtr dragService = nsDragService::GetInstance(); dragService->TargetDataReceived(aWidget, aDragContext, aX, aY, aSelectionData, aInfo, aTime); } -nsWindow *nsWindow::GetTransientForWindowIfPopup() { +nsWindow* nsWindow::GetTransientForWindowIfPopup() { if (mWindowType != eWindowType_popup) { return nullptr; } - GtkWindow *toplevel = gtk_window_get_transient_for(GTK_WINDOW(mShell)); + GtkWindow* toplevel = gtk_window_get_transient_for(GTK_WINDOW(mShell)); if (toplevel) { return get_window_for_gtk_widget(GTK_WIDGET(toplevel)); } return nullptr; } -bool nsWindow::IsHandlingTouchSequence(GdkEventSequence *aSequence) { +bool nsWindow::IsHandlingTouchSequence(GdkEventSequence* aSequence) { return mHandleTouchEvent && mTouches.Contains(aSequence); } #if GTK_CHECK_VERSION(3, 4, 0) -gboolean nsWindow::OnTouchEvent(GdkEventTouch *aEvent) { +gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) { if (!mHandleTouchEvent) { // If a popup window was spawned (e.g. as the result of a long-press) // and touch events got diverted to that window within a touch sequence, // ensure the touch event gets sent to the original window instead. We // keep the checks here very conservative so that we only redirect // events in this specific scenario. - nsWindow *targetWindow = GetTransientForWindowIfPopup(); + nsWindow* targetWindow = GetTransientForWindowIfPopup(); if (targetWindow && targetWindow->IsHandlingTouchSequence(aEvent->sequence)) { return targetWindow->OnTouchEvent(aEvent); @@ -3282,7 +3282,7 @@ gboolean nsWindow::OnTouchEvent(GdkEventTouch *aEvent) { } #endif -static GdkWindow *CreateGdkWindow(GdkWindow *parent, GtkWidget *widget) { +static GdkWindow* CreateGdkWindow(GdkWindow* parent, GtkWidget* widget) { GdkWindowAttr attributes; gint attributes_mask = GDK_WA_VISUAL; @@ -3294,18 +3294,18 @@ static GdkWindow *CreateGdkWindow(GdkWindow *parent, GtkWidget *widget) { attributes.visual = gtk_widget_get_visual(widget); attributes.window_type = GDK_WINDOW_CHILD; - GdkWindow *window = gdk_window_new(parent, &attributes, attributes_mask); + GdkWindow* window = gdk_window_new(parent, &attributes, attributes_mask); gdk_window_set_user_data(window, widget); return window; } -nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, - const LayoutDeviceIntRect &aRect, - nsWidgetInitData *aInitData) { +nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, + const LayoutDeviceIntRect& aRect, + nsWidgetInitData* aInitData) { // only set the base parent if we're going to be a dialog or a // toplevel - nsIWidget *baseParent = + nsIWidget* baseParent = aInitData && (aInitData->mWindowType == eWindowType_dialog || aInitData->mWindowType == eWindowType_toplevel || aInitData->mWindowType == eWindowType_invisible) @@ -3343,18 +3343,18 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, } // figure out our parent window - GtkWidget *parentMozContainer = nullptr; - GtkContainer *parentGtkContainer = nullptr; - GdkWindow *parentGdkWindow = nullptr; - GtkWindow *topLevelParent = nullptr; - nsWindow *parentnsWindow = nullptr; - GtkWidget *eventWidget = nullptr; + GtkWidget* parentMozContainer = nullptr; + GtkContainer* parentGtkContainer = nullptr; + GdkWindow* parentGdkWindow = nullptr; + GtkWindow* topLevelParent = nullptr; + nsWindow* parentnsWindow = nullptr; + GtkWidget* eventWidget = nullptr; bool drawToContainer = false; bool needsAlphaVisual = (mWindowType == eWindowType_popup && aInitData->mSupportTranslucency); if (aParent) { - parentnsWindow = static_cast(aParent); + parentnsWindow = static_cast(aParent); parentGdkWindow = parentnsWindow->mGdkWindow; } else if (aNativeParent && GDK_IS_WINDOW(aNativeParent)) { parentGdkWindow = GDK_WINDOW(aNativeParent); @@ -3415,7 +3415,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, // There's no point to configure transparency // on non-composited screens. - GdkScreen *screen = gdk_screen_get_default(); + GdkScreen* screen = gdk_screen_get_default(); if (gdk_screen_is_composited(screen)) { // Some Gtk+ themes use non-rectangular toplevel windows. To fully // support such themes we need to make toplevel window transparent @@ -3474,9 +3474,9 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, } if (!isSetVisual && needsAlphaVisual) { - GdkScreen *screen = gtk_widget_get_screen(mShell); + GdkScreen* screen = gtk_widget_get_screen(mShell); if (gdk_screen_is_composited(screen)) { - GdkVisual *visual = gdk_screen_get_rgba_visual(screen); + GdkVisual* visual = gdk_screen_get_rgba_visual(screen); if (visual) { gtk_widget_set_visual(mShell, visual); mHasAlphaVisual = true; @@ -3557,7 +3557,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, gtk_window_set_type_hint(GTK_WINDOW(mShell), gtkTypeHint); if (topLevelParent) { - LOG(("nsWindow::Create [%p] Set popup parent %p\n", (void *)this, + LOG(("nsWindow::Create [%p] Set popup parent %p\n", (void*)this, topLevelParent)); gtk_window_set_transient_for(GTK_WINDOW(mShell), topLevelParent); } @@ -3575,7 +3575,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, gdk_get_program_class()); // each toplevel window gets its own window group - GtkWindowGroup *group = gtk_window_group_new(); + GtkWindowGroup* group = gtk_window_group_new(); gtk_window_group_add_window(group, GTK_WINDOW(mShell)); g_object_unref(group); } @@ -3585,7 +3585,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, } // Create a container to hold child windows and child GtkWidgets. - GtkWidget *container = moz_container_new(); + GtkWidget* container = moz_container_new(); mContainer = MOZ_CONTAINER(container); #ifdef MOZ_WAYLAND if (!mIsX11Display && ComputeShouldAccelerate()) { @@ -3612,7 +3612,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, * 3) We're running on Wayland. All gecko content is rendered * to mContainer and we listen to the Gtk+ events on mContainer. */ - GtkStyleContext *style = gtk_widget_get_style_context(mShell); + GtkStyleContext* style = gtk_widget_get_style_context(mShell); drawToContainer = !mIsX11Display || (mCSDSupportLevel == CSD_SUPPORT_CLIENT) || gtk_style_context_has_class(style, "csd"); @@ -3663,7 +3663,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, // If the popup ignores mouse events, set an empty input shape. if (aInitData->mMouseTransparent) { cairo_rectangle_int_t rect = {0, 0, 0, 0}; - cairo_region_t *region = cairo_region_create_rectangle(&rect); + cairo_region_t* region = cairo_region_create_rectangle(&rect); gdk_window_input_shape_combine_region(mGdkWindow, region, 0, 0); cairo_region_destroy(region); @@ -3685,7 +3685,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, // This MozContainer has its own window for drawing and receives // events because there is no mShell widget (corresponding to this // nsWindow). - GtkWidget *container = moz_container_new(); + GtkWidget* container = moz_container_new(); mContainer = MOZ_CONTAINER(container); eventWidget = container; gtk_widget_add_events(eventWidget, kEvents); @@ -3731,7 +3731,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, g_signal_connect(mShell, "property-notify-event", G_CALLBACK(property_notify_event_cb), nullptr); - GdkScreen *screen = gtk_widget_get_screen(mShell); + GdkScreen* screen = gtk_widget_get_screen(mShell); if (!g_signal_handler_find(screen, G_SIGNAL_MATCH_FUNC, 0, 0, nullptr, FuncToGpointer(screen_composited_changed_cb), 0)) { @@ -3739,7 +3739,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, G_CALLBACK(screen_composited_changed_cb), nullptr); } - GtkSettings *default_settings = gtk_settings_get_default(); + GtkSettings* default_settings = gtk_settings_get_default(); g_signal_connect_after(default_settings, "notify::gtk-theme-name", G_CALLBACK(settings_changed_cb), this); g_signal_connect_after(default_settings, "notify::gtk-font-name", @@ -3775,7 +3775,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, g_signal_connect(mContainer, "key_release_event", G_CALLBACK(key_release_event_cb), nullptr); - gtk_drag_dest_set((GtkWidget *)mContainer, (GtkDestDefaults)0, nullptr, 0, + gtk_drag_dest_set((GtkWidget*)mContainer, (GtkDestDefaults)0, nullptr, 0, (GdkDragAction)0); g_signal_connect(mContainer, "drag_motion", @@ -3787,7 +3787,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, g_signal_connect(mContainer, "drag_data_received", G_CALLBACK(drag_data_received_event_cb), nullptr); - GtkWidget *widgets[] = {GTK_WIDGET(mContainer), + GtkWidget* widgets[] = {GTK_WIDGET(mContainer), !drawToContainer ? mShell : nullptr}; for (size_t i = 0; i < ArrayLength(widgets) && widgets[i]; ++i) { // Visibility events are sent to the owning widget of the relevant @@ -3807,7 +3807,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, mIMContext = new IMContextWrapper(this); } } else if (!mIMContext) { - nsWindow *container = GetContainerWindow(); + nsWindow* container = GetContainerWindow(); if (container) { mIMContext = container->mIMContext; } @@ -3836,7 +3836,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, #endif } - LOG(("nsWindow [%p]\n", (void *)this)); + LOG(("nsWindow [%p]\n", (void*)this)); if (mShell) { LOG(("\tmShell %p mContainer %p mGdkWindow %p 0x%lx\n", mShell, mContainer, mGdkWindow, mIsX11Display ? gdk_x11_window_get_xid(mGdkWindow) : 0)); @@ -3856,7 +3856,7 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, mXDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow); mXWindow = gdk_x11_window_get_xid(mGdkWindow); - GdkVisual *gdkVisual = gdk_window_get_visual(mGdkWindow); + GdkVisual* gdkVisual = gdk_window_get_visual(mGdkWindow); mXVisual = gdk_x11_visual_get_xvisual(gdkVisual); mXDepth = gdk_visual_get_depth(gdkVisual); bool shaped = needsAlphaVisual && !mHasAlphaVisual; @@ -3884,24 +3884,24 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, void nsWindow::RefreshWindowClass(void) { if (mGtkWindowTypeName.IsEmpty() || mGtkWindowRoleName.IsEmpty()) return; - GdkWindow *gdkWindow = gtk_widget_get_window(mShell); + GdkWindow* gdkWindow = gtk_widget_get_window(mShell); gdk_window_set_role(gdkWindow, mGtkWindowRoleName.get()); #ifdef MOZ_X11 if (mIsX11Display) { - XClassHint *class_hint = XAllocClassHint(); + XClassHint* class_hint = XAllocClassHint(); if (!class_hint) { return; } - const char *res_class = gdk_get_program_class(); + const char* res_class = gdk_get_program_class(); if (!res_class) return; - class_hint->res_name = const_cast(mGtkWindowTypeName.get()); - class_hint->res_class = const_cast(res_class); + class_hint->res_name = const_cast(mGtkWindowTypeName.get()); + class_hint->res_class = const_cast(res_class); // Can't use gtk_window_set_wmclass() for this; it prints // a warning & refuses to make the change. - GdkDisplay *display = gdk_display_get_default(); + GdkDisplay* display = gdk_display_get_default(); XSetClassHint(GDK_DISPLAY_XDISPLAY(display), gdk_x11_window_get_xid(gdkWindow), class_hint); XFree(class_hint); @@ -3909,19 +3909,19 @@ void nsWindow::RefreshWindowClass(void) { #endif /* MOZ_X11 */ } -void nsWindow::SetWindowClass(const nsAString &xulWinType) { +void nsWindow::SetWindowClass(const nsAString& xulWinType) { if (!mShell) return; - char *res_name = ToNewCString(xulWinType); + char* res_name = ToNewCString(xulWinType); if (!res_name) return; - const char *role = nullptr; + const char* role = nullptr; // Parse res_name into a name and role. Characters other than // [A-Za-z0-9_-] are converted to '_'. Anything after the first // colon is assigned to role; if there's no colon, assign the // whole thing to both role and res_name. - for (char *c = res_name; *c; c++) { + for (char* c = res_name; *c; c++) { if (':' == *c) { *c = 0; role = c + 1; @@ -3955,7 +3955,7 @@ void nsWindow::NativeResize() { GdkRectangle size = DevicePixelsToGdkSizeRoundUp(mBounds.Size()); - LOG(("nsWindow::NativeResize [%p] %d %d\n", (void *)this, size.width, + LOG(("nsWindow::NativeResize [%p] %d %d\n", (void*)this, size.width, size.height)); if (mIsTopLevel) { @@ -3963,7 +3963,7 @@ void nsWindow::NativeResize() { "Can't resize window smaller than 1x1."); gtk_window_resize(GTK_WINDOW(mShell), size.width, size.height); } else if (mContainer) { - GtkWidget *widget = GTK_WIDGET(mContainer); + GtkWidget* widget = GTK_WIDGET(mContainer); GtkAllocation allocation, prev_allocation; gtk_widget_get_allocation(widget, &prev_allocation); allocation.x = prev_allocation.x; @@ -4009,7 +4009,7 @@ void nsWindow::NativeMoveResize() { GdkRectangle size = DevicePixelsToGdkSizeRoundUp(mBounds.Size()); GdkPoint topLeft = DevicePixelsToGdkPointRoundDown(mBounds.TopLeft()); - LOG(("nsWindow::NativeMoveResize [%p] %d %d %d %d\n", (void *)this, topLeft.x, + LOG(("nsWindow::NativeMoveResize [%p] %d %d %d %d\n", (void*)this, topLeft.x, topLeft.y, size.width, size.height)); if (IsWaylandPopup()) { @@ -4061,9 +4061,9 @@ void nsWindow::NativeShow(bool aAction) { } // Update popup window hierarchy run-time on Wayland. if (IsWaylandPopup()) { - GtkWindow *parentWindow = GetPopupParentWindow(); + GtkWindow* parentWindow = GetPopupParentWindow(); if (parentWindow) { - LOG(("nsWindow::NativeShow [%p] Set popup parent %p\n", (void *)this, + LOG(("nsWindow::NativeShow [%p] Set popup parent %p\n", (void*)this, parentWindow)); gtk_window_set_transient_for(GTK_WINDOW(mShell), parentWindow); } @@ -4148,10 +4148,10 @@ void nsWindow::SetHasMappedToplevel(bool aState) { EnsureGrabs(); } - for (GList *children = gdk_window_peek_children(mGdkWindow); children; + for (GList* children = gdk_window_peek_children(mGdkWindow); children; children = children->next) { - GdkWindow *gdkWin = GDK_WINDOW(children->data); - nsWindow *child = get_window_for_gdk_window(gdkWin); + GdkWindow* gdkWin = GDK_WINDOW(children->data); + nsWindow* child = get_window_for_gdk_window(gdkWin); if (child && child->mHasMappedToplevel != aState) { child->SetHasMappedToplevel(aState); @@ -4187,9 +4187,9 @@ void nsWindow::CleanLayerManagerRecursive(void) { DestroyCompositor(); - GList *children = gdk_window_peek_children(mGdkWindow); - for (GList *list = children; list; list = list->next) { - nsWindow *window = get_window_for_gdk_window(GDK_WINDOW(list->data)); + GList* children = gdk_window_peek_children(mGdkWindow); + for (GList* list = children; list; list = list->next) { + nsWindow* window = get_window_for_gdk_window(GDK_WINDOW(list->data)); if (window) { window->CleanLayerManagerRecursive(); } @@ -4199,10 +4199,10 @@ void nsWindow::CleanLayerManagerRecursive(void) { void nsWindow::SetTransparencyMode(nsTransparencyMode aMode) { if (!mShell) { // Pass the request to the toplevel window - GtkWidget *topWidget = GetToplevelWidget(); + GtkWidget* topWidget = GetToplevelWidget(); if (!topWidget) return; - nsWindow *topWindow = get_window_for_gtk_widget(topWidget); + nsWindow* topWindow = get_window_for_gtk_widget(topWidget); if (!topWindow) return; topWindow->SetTransparencyMode(aMode); @@ -4233,12 +4233,12 @@ void nsWindow::SetTransparencyMode(nsTransparencyMode aMode) { nsTransparencyMode nsWindow::GetTransparencyMode() { if (!mShell) { // Pass the request to the toplevel window - GtkWidget *topWidget = GetToplevelWidget(); + GtkWidget* topWidget = GetToplevelWidget(); if (!topWidget) { return eTransparencyOpaque; } - nsWindow *topWindow = get_window_for_gtk_widget(topWidget); + nsWindow* topWindow = get_window_for_gtk_widget(topWidget); if (!topWindow) { return eTransparencyOpaque; } @@ -4252,16 +4252,16 @@ nsTransparencyMode nsWindow::GetTransparencyMode() { // For setting the draggable titlebar region from CSS // with -moz-window-dragging: drag. void nsWindow::UpdateWindowDraggingRegion( - const LayoutDeviceIntRegion &aRegion) { + const LayoutDeviceIntRegion& aRegion) { if (mDraggableRegion != aRegion) { mDraggableRegion = aRegion; } } -void nsWindow::UpdateOpaqueRegion(const LayoutDeviceIntRegion &aOpaqueRegion) { +void nsWindow::UpdateOpaqueRegion(const LayoutDeviceIntRegion& aOpaqueRegion) { // Available as of GTK 3.10+ static auto sGdkWindowSetOpaqueRegion = - (void (*)(GdkWindow *, cairo_region_t *))dlsym( + (void (*)(GdkWindow*, cairo_region_t*))dlsym( RTLD_DEFAULT, "gdk_window_set_opaque_region"); if (sGdkWindowSetOpaqueRegion && mGdkWindow && @@ -4269,9 +4269,9 @@ void nsWindow::UpdateOpaqueRegion(const LayoutDeviceIntRegion &aOpaqueRegion) { if (aOpaqueRegion.IsEmpty()) { (*sGdkWindowSetOpaqueRegion)(mGdkWindow, nullptr); } else { - cairo_region_t *region = cairo_region_create(); + cairo_region_t* region = cairo_region_create(); for (auto iter = aOpaqueRegion.RectIter(); !iter.Done(); iter.Next()) { - const LayoutDeviceIntRect &r = iter.Get(); + const LayoutDeviceIntRect& r = iter.Get(); cairo_rectangle_int_t rect = {r.x, r.y, r.width, r.height}; cairo_region_union_rectangle(region, &rect); } @@ -4282,7 +4282,7 @@ void nsWindow::UpdateOpaqueRegion(const LayoutDeviceIntRegion &aOpaqueRegion) { } nsresult nsWindow::ConfigureChildren( - const nsTArray &aConfigurations) { + const nsTArray& aConfigurations) { // If this is a remotely updated widget we receive clipping, position, and // size information from a source other than our owner. Don't let our parent // update this information. @@ -4291,8 +4291,8 @@ nsresult nsWindow::ConfigureChildren( } for (uint32_t i = 0; i < aConfigurations.Length(); ++i) { - const Configuration &configuration = aConfigurations[i]; - auto *w = static_cast(configuration.mChild.get()); + const Configuration& configuration = aConfigurations[i]; + auto* w = static_cast(configuration.mChild.get()); NS_ASSERTION(w->GetParent() == this, "Configured widget is not a child"); w->SetWindowClipRegion(configuration.mClipRegion, true); if (w->mBounds.Size() != configuration.mBounds.Size()) { @@ -4308,8 +4308,8 @@ nsresult nsWindow::ConfigureChildren( } nsresult nsWindow::SetWindowClipRegion( - const nsTArray &aRects, bool aIntersectWithExisting) { - const nsTArray *newRects = &aRects; + const nsTArray& aRects, bool aIntersectWithExisting) { + const nsTArray* newRects = &aRects; AutoTArray intersectRects; if (aIntersectWithExisting) { @@ -4339,9 +4339,9 @@ nsresult nsWindow::SetWindowClipRegion( if (!mGdkWindow) return NS_OK; - cairo_region_t *region = cairo_region_create(); + cairo_region_t* region = cairo_region_create(); for (uint32_t i = 0; i < newRects->Length(); ++i) { - const LayoutDeviceIntRect &r = newRects->ElementAt(i); + const LayoutDeviceIntRect& r = newRects->ElementAt(i); cairo_rectangle_int_t rect = {r.x, r.y, r.width, r.height}; cairo_region_union_rectangle(region, &rect); } @@ -4361,7 +4361,7 @@ void nsWindow::ResizeTransparencyBitmap() { int32_t newRowBytes = GetBitmapStride(mBounds.width); int32_t newSize = newRowBytes * mBounds.height; - auto *newBits = new gchar[newSize]; + auto* newBits = new gchar[newSize]; // fill new mask with "transparent", first memset(newBits, 0, newSize); @@ -4372,8 +4372,8 @@ void nsWindow::ResizeTransparencyBitmap() { int32_t copyBytes = GetBitmapStride(copyWidth); int32_t i; - gchar *fromPtr = mTransparencyBitmap; - gchar *toPtr = newBits; + gchar* fromPtr = mTransparencyBitmap; + gchar* toPtr = newBits; for (i = 0; i < copyHeight; i++) { memcpy(toPtr, fromPtr, copyBytes); fromPtr += oldRowBytes; @@ -4386,14 +4386,14 @@ void nsWindow::ResizeTransparencyBitmap() { mTransparencyBitmapHeight = mBounds.height; } -static bool ChangedMaskBits(gchar *aMaskBits, int32_t aMaskWidth, - int32_t aMaskHeight, const nsIntRect &aRect, - uint8_t *aAlphas, int32_t aStride) { +static bool ChangedMaskBits(gchar* aMaskBits, int32_t aMaskWidth, + int32_t aMaskHeight, const nsIntRect& aRect, + uint8_t* aAlphas, int32_t aStride) { int32_t x, y, xMax = aRect.XMost(), yMax = aRect.YMost(); int32_t maskBytesPerRow = GetBitmapStride(aMaskWidth); for (y = aRect.y; y < yMax; y++) { - gchar *maskBytes = aMaskBits + y * maskBytesPerRow; - uint8_t *alphas = aAlphas; + gchar* maskBytes = aMaskBits + y * maskBytesPerRow; + uint8_t* alphas = aAlphas; for (x = aRect.x; x < xMax; x++) { bool newBit = *alphas > 0x7f; alphas++; @@ -4411,14 +4411,14 @@ static bool ChangedMaskBits(gchar *aMaskBits, int32_t aMaskWidth, return false; } -static void UpdateMaskBits(gchar *aMaskBits, int32_t aMaskWidth, - int32_t aMaskHeight, const nsIntRect &aRect, - uint8_t *aAlphas, int32_t aStride) { +static void UpdateMaskBits(gchar* aMaskBits, int32_t aMaskWidth, + int32_t aMaskHeight, const nsIntRect& aRect, + uint8_t* aAlphas, int32_t aStride) { int32_t x, y, xMax = aRect.XMost(), yMax = aRect.YMost(); int32_t maskBytesPerRow = GetBitmapStride(aMaskWidth); for (y = aRect.y; y < yMax; y++) { - gchar *maskBytes = aMaskBits + y * maskBytesPerRow; - uint8_t *alphas = aAlphas; + gchar* maskBytes = aMaskBits + y * maskBytesPerRow; + uint8_t* alphas = aAlphas; for (x = aRect.x; x < xMax; x++) { bool newBit = *alphas > 0x7f; alphas++; @@ -4437,7 +4437,7 @@ void nsWindow::ApplyTransparencyBitmap() { // We use X11 calls where possible, because GDK handles expose events // for shaped windows in a way that's incompatible with us (Bug 635903). // It doesn't occur when the shapes are set through X. - Display *xDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow); + Display* xDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow); Window xDrawable = GDK_WINDOW_XID(mGdkWindow); Pixmap maskPixmap = XCreateBitmapFromData( xDisplay, xDrawable, mTransparencyBitmap, mTransparencyBitmapWidth, @@ -4446,14 +4446,14 @@ void nsWindow::ApplyTransparencyBitmap() { ShapeSet); XFreePixmap(xDisplay, maskPixmap); #else - cairo_surface_t *maskBitmap; + cairo_surface_t* maskBitmap; maskBitmap = cairo_image_surface_create_for_data( - (unsigned char *)mTransparencyBitmap, CAIRO_FORMAT_A1, + (unsigned char*)mTransparencyBitmap, CAIRO_FORMAT_A1, mTransparencyBitmapWidth, mTransparencyBitmapHeight, GetBitmapStride(mTransparencyBitmapWidth)); if (!maskBitmap) return; - cairo_region_t *maskRegion = gdk_cairo_region_create_from_surface(maskBitmap); + cairo_region_t* maskRegion = gdk_cairo_region_create_from_surface(maskBitmap); gtk_widget_shape_combine_region(mShell, maskRegion); cairo_region_destroy(maskRegion); cairo_surface_destroy(maskBitmap); @@ -4473,22 +4473,22 @@ void nsWindow::ClearTransparencyBitmap() { #ifdef MOZ_X11 if (!mGdkWindow) return; - Display *xDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow); + Display* xDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow); Window xWindow = gdk_x11_window_get_xid(mGdkWindow); XShapeCombineMask(xDisplay, xWindow, ShapeBounding, 0, 0, X11None, ShapeSet); #endif } -nsresult nsWindow::UpdateTranslucentWindowAlphaInternal(const nsIntRect &aRect, - uint8_t *aAlphas, +nsresult nsWindow::UpdateTranslucentWindowAlphaInternal(const nsIntRect& aRect, + uint8_t* aAlphas, int32_t aStride) { if (!mShell) { // Pass the request to the toplevel window - GtkWidget *topWidget = GetToplevelWidget(); + GtkWidget* topWidget = GetToplevelWidget(); if (!topWidget) return NS_ERROR_FAILURE; - nsWindow *topWindow = get_window_for_gtk_widget(topWidget); + nsWindow* topWindow = get_window_for_gtk_widget(topWidget); if (!topWindow) return NS_ERROR_FAILURE; return topWindow->UpdateTranslucentWindowAlphaInternal(aRect, aAlphas, @@ -4559,14 +4559,14 @@ void nsWindow::UpdateTitlebarTransparencyBitmap() { mTransparencyBitmapHeight = mBounds.height; if (maskUpdate) { - cairo_surface_t *surface = cairo_image_surface_create( + cairo_surface_t* surface = cairo_image_surface_create( CAIRO_FORMAT_A8, mTransparencyBitmapWidth, TITLEBAR_SHAPE_MASK_HEIGHT); if (!surface) return; - cairo_t *cr = cairo_create(surface); + cairo_t* cr = cairo_create(surface); GtkWidgetState state; - memset((void *)&state, 0, sizeof(state)); + memset((void*)&state, 0, sizeof(state)); GdkRectangle rect = {0, 0, mTransparencyBitmapWidth, TITLEBAR_SHAPE_MASK_HEIGHT}; @@ -4589,7 +4589,7 @@ void nsWindow::UpdateTitlebarTransparencyBitmap() { } if (!mNeedsShow) { - Display *xDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow); + Display* xDisplay = GDK_WINDOW_XDISPLAY(mGdkWindow); Window xDrawable = GDK_WINDOW_XID(mGdkWindow); Pixmap maskPixmap = XCreateBitmapFromData( @@ -4645,7 +4645,7 @@ void nsWindow::GrabPointer(guint32 aTime) { (GdkEventMask)(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK | GDK_TOUCH_MASK), - (GdkWindow *)nullptr, nullptr, aTime); + (GdkWindow*)nullptr, nullptr, aTime); if (retval == GDK_GRAB_NOT_VIEWABLE) { LOG(("GrabPointer: window not viewable; will retry\n")); @@ -4678,36 +4678,36 @@ void nsWindow::ReleaseGrabs(void) { gdk_pointer_ungrab(GDK_CURRENT_TIME); } -GtkWidget *nsWindow::GetToplevelWidget() { +GtkWidget* nsWindow::GetToplevelWidget() { if (mShell) { return mShell; } - GtkWidget *widget = GetMozContainerWidget(); + GtkWidget* widget = GetMozContainerWidget(); if (!widget) return nullptr; return gtk_widget_get_toplevel(widget); } -GtkWidget *nsWindow::GetMozContainerWidget() { +GtkWidget* nsWindow::GetMozContainerWidget() { if (!mGdkWindow) return nullptr; if (mContainer) return GTK_WIDGET(mContainer); - GtkWidget *owningWidget = get_gtk_widget_for_gdk_window(mGdkWindow); + GtkWidget* owningWidget = get_gtk_widget_for_gdk_window(mGdkWindow); return owningWidget; } -nsWindow *nsWindow::GetContainerWindow() { - GtkWidget *owningWidget = GetMozContainerWidget(); +nsWindow* nsWindow::GetContainerWindow() { + GtkWidget* owningWidget = GetMozContainerWidget(); if (!owningWidget) return nullptr; - nsWindow *window = get_window_for_gtk_widget(owningWidget); + nsWindow* window = get_window_for_gtk_widget(owningWidget); NS_ASSERTION(window, "No nsWindow for container widget"); return window; } -void nsWindow::SetUrgencyHint(GtkWidget *top_window, bool state) { +void nsWindow::SetUrgencyHint(GtkWidget* top_window, bool state) { if (!top_window) return; gdk_window_set_urgency_hint(gtk_widget_get_window(top_window), state); @@ -4736,9 +4736,9 @@ class FullscreenTransitionWindow final : public nsISupports { public: NS_DECL_ISUPPORTS - explicit FullscreenTransitionWindow(GtkWidget *aWidget); + explicit FullscreenTransitionWindow(GtkWidget* aWidget); - GtkWidget *mWindow; + GtkWidget* mWindow; private: ~FullscreenTransitionWindow(); @@ -4746,16 +4746,16 @@ class FullscreenTransitionWindow final : public nsISupports { NS_IMPL_ISUPPORTS0(FullscreenTransitionWindow) -FullscreenTransitionWindow::FullscreenTransitionWindow(GtkWidget *aWidget) { +FullscreenTransitionWindow::FullscreenTransitionWindow(GtkWidget* aWidget) { mWindow = gtk_window_new(GTK_WINDOW_POPUP); - GtkWindow *gtkWin = GTK_WINDOW(mWindow); + GtkWindow* gtkWin = GTK_WINDOW(mWindow); gtk_window_set_type_hint(gtkWin, GDK_WINDOW_TYPE_HINT_SPLASHSCREEN); gtk_window_set_transient_for(gtkWin, GTK_WINDOW(aWidget)); gtk_window_set_decorated(gtkWin, false); - GdkWindow *gdkWin = gtk_widget_get_window(aWidget); - GdkScreen *screen = gtk_widget_get_screen(aWidget); + GdkWindow* gdkWin = gtk_widget_get_window(aWidget); + GdkScreen* screen = gtk_widget_get_screen(aWidget); gint monitorNum = gdk_screen_get_monitor_at_window(screen, gdkWin); GdkRectangle monitorRect; gdk_screen_get_monitor_geometry(screen, monitorNum, &monitorRect); @@ -4780,8 +4780,8 @@ FullscreenTransitionWindow::~FullscreenTransitionWindow() { class FullscreenTransitionData { public: FullscreenTransitionData(nsIWidget::FullscreenTransitionStage aStage, - uint16_t aDuration, nsIRunnable *aCallback, - FullscreenTransitionWindow *aWindow) + uint16_t aDuration, nsIRunnable* aCallback, + FullscreenTransitionWindow* aWindow) : mStage(aStage), mStartTime(TimeStamp::Now()), mDuration(TimeDuration::FromMilliseconds(aDuration)), @@ -4802,7 +4802,7 @@ class FullscreenTransitionData { /* static */ gboolean FullscreenTransitionData::TimeoutCallback(gpointer aData) { bool finishing = false; - auto data = static_cast(aData); + auto data = static_cast(aData); gdouble opacity = (TimeStamp::Now() - data->mStartTime) / data->mDuration; if (opacity >= 1.0) { opacity = 1.0; @@ -4822,8 +4822,8 @@ gboolean FullscreenTransitionData::TimeoutCallback(gpointer aData) { } /* virtual */ -bool nsWindow::PrepareForFullscreenTransition(nsISupports **aData) { - GdkScreen *screen = gtk_widget_get_screen(mShell); +bool nsWindow::PrepareForFullscreenTransition(nsISupports** aData) { + GdkScreen* screen = gtk_widget_get_screen(mShell); if (!gdk_screen_is_composited(screen)) { return false; } @@ -4834,9 +4834,9 @@ bool nsWindow::PrepareForFullscreenTransition(nsISupports **aData) { /* virtual */ void nsWindow::PerformFullscreenTransition(FullscreenTransitionStage aStage, uint16_t aDuration, - nsISupports *aData, - nsIRunnable *aCallback) { - auto data = static_cast(aData); + nsISupports* aData, + nsIRunnable* aCallback) { + auto data = static_cast(aData); // This will be released at the end of the last timeout callback for it. auto transitionData = new FullscreenTransitionData(aStage, aDuration, aCallback, data); @@ -4866,9 +4866,9 @@ already_AddRefed nsWindow::GetWidgetScreen() { return screen.forget(); } -static bool IsFullscreenSupported(GtkWidget *aShell) { +static bool IsFullscreenSupported(GtkWidget* aShell) { #ifdef MOZ_X11 - GdkScreen *screen = gtk_widget_get_screen(aShell); + GdkScreen* screen = gtk_widget_get_screen(aShell); GdkAtom atom = gdk_atom_intern("_NET_WM_STATE_FULLSCREEN", FALSE); if (!gdk_x11_screen_supports_net_wm_hint(screen, atom)) { return false; @@ -4877,8 +4877,8 @@ static bool IsFullscreenSupported(GtkWidget *aShell) { return true; } -nsresult nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen *aTargetScreen) { - LOG(("nsWindow::MakeFullScreen [%p] aFullScreen %d\n", (void *)this, +nsresult nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen* aTargetScreen) { + LOG(("nsWindow::MakeFullScreen [%p] aFullScreen %d\n", (void*)this, aFullScreen)); if (mIsX11Display && !IsFullscreenSupported(mShell)) { @@ -4903,10 +4903,10 @@ nsresult nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen *aTargetScreen) { void nsWindow::SetWindowDecoration(nsBorderStyle aStyle) { if (!mShell) { // Pass the request to the toplevel window - GtkWidget *topWidget = GetToplevelWidget(); + GtkWidget* topWidget = GetToplevelWidget(); if (!topWidget) return; - nsWindow *topWindow = get_window_for_gtk_widget(topWidget); + nsWindow* topWindow = get_window_for_gtk_widget(topWidget); if (!topWindow) return; topWindow->SetWindowDecoration(aStyle); @@ -4915,7 +4915,7 @@ void nsWindow::SetWindowDecoration(nsBorderStyle aStyle) { // We can't use mGdkWindow directly here as it can be // derived from mContainer which is not a top-level GdkWindow. - GdkWindow *window = gtk_widget_get_window(mShell); + GdkWindow* window = gtk_widget_get_window(mShell); // Sawfish, metacity, and presumably other window managers get // confused if we change the window decorations while the window @@ -4952,7 +4952,7 @@ void nsWindow::HideWindowChrome(bool aShouldHide) { bool nsWindow::CheckForRollup(gdouble aMouseX, gdouble aMouseY, bool aIsWheel, bool aAlwaysRollup) { - nsIRollupListener *rollupListener = GetActiveRollupListener(); + nsIRollupListener* rollupListener = GetActiveRollupListener(); nsCOMPtr rollupWidget; if (rollupListener) { rollupWidget = rollupListener->GetRollupWidget(); @@ -4963,8 +4963,8 @@ bool nsWindow::CheckForRollup(gdouble aMouseX, gdouble aMouseY, bool aIsWheel, } bool retVal = false; - auto *currentPopup = - (GdkWindow *)rollupWidget->GetNativeData(NS_NATIVE_WINDOW); + auto* currentPopup = + (GdkWindow*)rollupWidget->GetNativeData(NS_NATIVE_WINDOW); if (aAlwaysRollup || !is_mouse_in_window(currentPopup, aMouseX, aMouseY)) { bool rollup = true; if (aIsWheel) { @@ -4976,12 +4976,12 @@ bool nsWindow::CheckForRollup(gdouble aMouseX, gdouble aMouseY, bool aIsWheel, // the current submenu uint32_t popupsToRollup = UINT32_MAX; if (!aAlwaysRollup) { - AutoTArray widgetChain; + AutoTArray widgetChain; uint32_t sameTypeCount = rollupListener->GetSubmenuWidgetChain(&widgetChain); for (uint32_t i = 0; i < widgetChain.Length(); ++i) { - nsIWidget *widget = widgetChain[i]; - auto *currWindow = (GdkWindow *)widget->GetNativeData(NS_NATIVE_WINDOW); + nsIWidget* widget = widgetChain[i]; + auto* currWindow = (GdkWindow*)widget->GetNativeData(NS_NATIVE_WINDOW); if (is_mouse_in_window(currWindow, aMouseX, aMouseY)) { // don't roll up if the mouse event occurred within a // menu of the same type. If the mouse event occurred @@ -5022,7 +5022,7 @@ bool nsWindow::DragInProgress(void) { return currentDragSession != nullptr; } -static bool is_mouse_in_window(GdkWindow *aWindow, gdouble aMouseX, +static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX, gdouble aMouseY) { gint x = 0; gint y = 0; @@ -5031,14 +5031,14 @@ static bool is_mouse_in_window(GdkWindow *aWindow, gdouble aMouseX, gint offsetX = 0; gint offsetY = 0; - GdkWindow *window = aWindow; + GdkWindow* window = aWindow; while (window) { gint tmpX = 0; gint tmpY = 0; gdk_window_get_position(window, &tmpX, &tmpY); - GtkWidget *widget = get_gtk_widget_for_gdk_window(window); + GtkWidget* widget = get_gtk_widget_for_gdk_window(window); // if this is a window, compute x and y given its origin and our // offset @@ -5062,34 +5062,34 @@ static bool is_mouse_in_window(GdkWindow *aWindow, gdouble aMouseX, return false; } -static nsWindow *get_window_for_gtk_widget(GtkWidget *widget) { +static nsWindow* get_window_for_gtk_widget(GtkWidget* widget) { gpointer user_data = g_object_get_data(G_OBJECT(widget), "nsWindow"); - return static_cast(user_data); + return static_cast(user_data); } -static nsWindow *get_window_for_gdk_window(GdkWindow *window) { +static nsWindow* get_window_for_gdk_window(GdkWindow* window) { gpointer user_data = g_object_get_data(G_OBJECT(window), "nsWindow"); - return static_cast(user_data); + return static_cast(user_data); } -static GtkWidget *get_gtk_widget_for_gdk_window(GdkWindow *window) { +static GtkWidget* get_gtk_widget_for_gdk_window(GdkWindow* window) { gpointer user_data = nullptr; gdk_window_get_user_data(window, &user_data); return GTK_WIDGET(user_data); } -static GdkCursor *get_gtk_cursor(nsCursor aCursor) { - GdkCursor *gdkcursor = nullptr; +static GdkCursor* get_gtk_cursor(nsCursor aCursor) { + GdkCursor* gdkcursor = nullptr; uint8_t newType = 0xff; if ((gdkcursor = gCursorCache[aCursor])) { return gdkcursor; } - GdkDisplay *defaultDisplay = gdk_display_get_default(); + GdkDisplay* defaultDisplay = gdk_display_get_default(); // The strategy here is to use standard GDK cursors, and, if not available, // load by standard name with gdk_cursor_new_from_name. @@ -5254,18 +5254,18 @@ static GdkCursor *get_gtk_cursor(nsCursor aCursor) { // If we still don't have a xcursor, we now really create a bitmap cursor if (newType != 0xff && !gdkcursor) { - GdkPixbuf *cursor_pixbuf = + GdkPixbuf* cursor_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32); if (!cursor_pixbuf) return nullptr; - guchar *data = gdk_pixbuf_get_pixels(cursor_pixbuf); + guchar* data = gdk_pixbuf_get_pixels(cursor_pixbuf); // Read data from GtkCursors and compose RGBA surface from 1bit bitmap and // mask GtkCursors bits and mask are 32x32 monochrome bitmaps (1 bit for // each pixel) so it's 128 byte array (4 bytes for are one bitmap row and // there are 32 rows here). - const unsigned char *bits = GtkCursors[newType].bits; - const unsigned char *mask_bits = GtkCursors[newType].mask_bits; + const unsigned char* bits = GtkCursors[newType].bits; + const unsigned char* mask_bits = GtkCursors[newType].mask_bits; for (int i = 0; i < 128; i++) { char bit = *bits++; @@ -5293,7 +5293,7 @@ static GdkCursor *get_gtk_cursor(nsCursor aCursor) { // gtk callbacks -void draw_window_of_widget(GtkWidget *widget, GdkWindow *aWindow, cairo_t *cr) { +void draw_window_of_widget(GtkWidget* widget, GdkWindow* aWindow, cairo_t* cr) { if (gtk_cairo_should_draw_window(cr, aWindow)) { RefPtr window = get_window_for_gdk_window(aWindow); if (!window) { @@ -5308,10 +5308,10 @@ void draw_window_of_widget(GtkWidget *widget, GdkWindow *aWindow, cairo_t *cr) { } } - GList *children = gdk_window_get_children(aWindow); - GList *child = children; + GList* children = gdk_window_get_children(aWindow); + GList* child = children; while (child) { - GdkWindow *window = GDK_WINDOW(child->data); + GdkWindow* window = GDK_WINDOW(child->data); gpointer windowWidget; gdk_window_get_user_data(window, &windowWidget); if (windowWidget == widget) { @@ -5323,7 +5323,7 @@ void draw_window_of_widget(GtkWidget *widget, GdkWindow *aWindow, cairo_t *cr) { } /* static */ -gboolean expose_event_cb(GtkWidget *widget, cairo_t *cr) { +gboolean expose_event_cb(GtkWidget* widget, cairo_t* cr) { draw_window_of_widget(widget, gtk_widget_get_window(widget), cr); // A strong reference is already held during "draw" signal emission, @@ -5340,29 +5340,29 @@ gboolean expose_event_cb(GtkWidget *widget, cairo_t *cr) { return FALSE; } -static gboolean configure_event_cb(GtkWidget *widget, - GdkEventConfigure *event) { +static gboolean configure_event_cb(GtkWidget* widget, + GdkEventConfigure* event) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) return FALSE; return window->OnConfigureEvent(widget, event); } -static void container_unrealize_cb(GtkWidget *widget) { +static void container_unrealize_cb(GtkWidget* widget) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) return; window->OnContainerUnrealize(); } -static void size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation) { +static void size_allocate_cb(GtkWidget* widget, GtkAllocation* allocation) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) return; window->OnSizeAllocate(allocation); } -static gboolean delete_event_cb(GtkWidget *widget, GdkEventAny *event) { +static gboolean delete_event_cb(GtkWidget* widget, GdkEventAny* event) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) return FALSE; @@ -5371,8 +5371,8 @@ static gboolean delete_event_cb(GtkWidget *widget, GdkEventAny *event) { return TRUE; } -static gboolean enter_notify_event_cb(GtkWidget *widget, - GdkEventCrossing *event) { +static gboolean enter_notify_event_cb(GtkWidget* widget, + GdkEventCrossing* event) { RefPtr window = get_window_for_gdk_window(event->window); if (!window) return TRUE; @@ -5381,8 +5381,8 @@ static gboolean enter_notify_event_cb(GtkWidget *widget, return TRUE; } -static gboolean leave_notify_event_cb(GtkWidget *widget, - GdkEventCrossing *event) { +static gboolean leave_notify_event_cb(GtkWidget* widget, + GdkEventCrossing* event) { if (is_parent_grab_leave(event)) { return TRUE; } @@ -5391,8 +5391,8 @@ static gboolean leave_notify_event_cb(GtkWidget *widget, // avoid generating spurious mouse exit events. auto x = gint(event->x_root); auto y = gint(event->y_root); - GdkDisplay *display = gtk_widget_get_display(widget); - GdkWindow *winAtPt = gdk_display_get_window_at_pointer(display, &x, &y); + GdkDisplay* display = gtk_widget_get_display(widget); + GdkWindow* winAtPt = gdk_display_get_window_at_pointer(display, &x, &y); if (winAtPt == event->window) { return TRUE; } @@ -5405,8 +5405,8 @@ static gboolean leave_notify_event_cb(GtkWidget *widget, return TRUE; } -static nsWindow *GetFirstNSWindowForGDKWindow(GdkWindow *aGdkWindow) { - nsWindow *window; +static nsWindow* GetFirstNSWindowForGDKWindow(GdkWindow* aGdkWindow) { + nsWindow* window; while (!(window = get_window_for_gdk_window(aGdkWindow))) { // The event has bubbled to the moz_container widget as passed into each // caller's *widget parameter, but its corresponding nsWindow is an ancestor @@ -5421,11 +5421,11 @@ static nsWindow *GetFirstNSWindowForGDKWindow(GdkWindow *aGdkWindow) { return window; } -static gboolean motion_notify_event_cb(GtkWidget *widget, - GdkEventMotion *event) { +static gboolean motion_notify_event_cb(GtkWidget* widget, + GdkEventMotion* event) { UpdateLastInputEventTime(event); - nsWindow *window = GetFirstNSWindowForGDKWindow(event->window); + nsWindow* window = GetFirstNSWindowForGDKWindow(event->window); if (!window) return FALSE; window->OnMotionNotifyEvent(event); @@ -5433,11 +5433,11 @@ static gboolean motion_notify_event_cb(GtkWidget *widget, return TRUE; } -static gboolean button_press_event_cb(GtkWidget *widget, - GdkEventButton *event) { +static gboolean button_press_event_cb(GtkWidget* widget, + GdkEventButton* event) { UpdateLastInputEventTime(event); - nsWindow *window = GetFirstNSWindowForGDKWindow(event->window); + nsWindow* window = GetFirstNSWindowForGDKWindow(event->window); if (!window) return FALSE; window->OnButtonPressEvent(event); @@ -5445,11 +5445,11 @@ static gboolean button_press_event_cb(GtkWidget *widget, return TRUE; } -static gboolean button_release_event_cb(GtkWidget *widget, - GdkEventButton *event) { +static gboolean button_release_event_cb(GtkWidget* widget, + GdkEventButton* event) { UpdateLastInputEventTime(event); - nsWindow *window = GetFirstNSWindowForGDKWindow(event->window); + nsWindow* window = GetFirstNSWindowForGDKWindow(event->window); if (!window) return FALSE; window->OnButtonReleaseEvent(event); @@ -5457,7 +5457,7 @@ static gboolean button_release_event_cb(GtkWidget *widget, return TRUE; } -static gboolean focus_in_event_cb(GtkWidget *widget, GdkEventFocus *event) { +static gboolean focus_in_event_cb(GtkWidget* widget, GdkEventFocus* event) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) return FALSE; @@ -5466,7 +5466,7 @@ static gboolean focus_in_event_cb(GtkWidget *widget, GdkEventFocus *event) { return FALSE; } -static gboolean focus_out_event_cb(GtkWidget *widget, GdkEventFocus *event) { +static gboolean focus_out_event_cb(GtkWidget* widget, GdkEventFocus* event) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) return FALSE; @@ -5494,12 +5494,12 @@ static gboolean focus_out_event_cb(GtkWidget *widget, GdkEventFocus *event) { // example), a request to make the parent window active is issued. When the // parent window becomes active, keyboard events will be received. -static GdkFilterReturn popup_take_focus_filter(GdkXEvent *gdk_xevent, - GdkEvent *event, gpointer data) { - auto *xevent = static_cast(gdk_xevent); +static GdkFilterReturn popup_take_focus_filter(GdkXEvent* gdk_xevent, + GdkEvent* event, gpointer data) { + auto* xevent = static_cast(gdk_xevent); if (xevent->type != ClientMessage) return GDK_FILTER_CONTINUE; - XClientMessageEvent &xclient = xevent->xclient; + XClientMessageEvent& xclient = xevent->xclient; if (xclient.message_type != gdk_x11_get_xatom_by_name("WM_PROTOCOLS")) return GDK_FILTER_CONTINUE; @@ -5509,16 +5509,16 @@ static GdkFilterReturn popup_take_focus_filter(GdkXEvent *gdk_xevent, guint32 timestamp = xclient.data.l[1]; - GtkWidget *widget = get_gtk_widget_for_gdk_window(event->any.window); + GtkWidget* widget = get_gtk_widget_for_gdk_window(event->any.window); if (!widget) return GDK_FILTER_CONTINUE; - GtkWindow *parent = gtk_window_get_transient_for(GTK_WINDOW(widget)); + GtkWindow* parent = gtk_window_get_transient_for(GTK_WINDOW(widget)); if (!parent) return GDK_FILTER_CONTINUE; if (gtk_window_is_active(parent)) return GDK_FILTER_REMOVE; // leave input focus on the parent - GdkWindow *parent_window = gtk_widget_get_window(GTK_WIDGET(parent)); + GdkWindow* parent_window = gtk_widget_get_window(GTK_WIDGET(parent)); if (!parent_window) return GDK_FILTER_CONTINUE; // In case the parent has not been deconified. @@ -5532,13 +5532,13 @@ static GdkFilterReturn popup_take_focus_filter(GdkXEvent *gdk_xevent, } #endif /* MOZ_X11 */ -static gboolean key_press_event_cb(GtkWidget *widget, GdkEventKey *event) { +static gboolean key_press_event_cb(GtkWidget* widget, GdkEventKey* event) { LOG(("key_press_event_cb\n")); UpdateLastInputEventTime(event); // find the window with focus and dispatch this event to that widget - nsWindow *window = get_window_for_gtk_widget(widget); + nsWindow* window = get_window_for_gtk_widget(widget); if (!window) return FALSE; RefPtr focusWindow = gFocusWindow ? gFocusWindow : window; @@ -5555,13 +5555,13 @@ static gboolean key_press_event_cb(GtkWidget *widget, GdkEventKey *event) { # ifndef KeyPress # define KeyPress 2 # endif - GdkDisplay *gdkDisplay = gtk_widget_get_display(widget); + GdkDisplay* gdkDisplay = gtk_widget_get_display(widget); if (GDK_IS_X11_DISPLAY(gdkDisplay)) { - Display *dpy = GDK_DISPLAY_XDISPLAY(gdkDisplay); + Display* dpy = GDK_DISPLAY_XDISPLAY(gdkDisplay); while (XPending(dpy)) { XEvent next_event; XPeekEvent(dpy, &next_event); - GdkWindow *nextGdkWindow = + GdkWindow* nextGdkWindow = gdk_x11_window_lookup_for_display(gdkDisplay, next_event.xany.window); if (nextGdkWindow != event->window || next_event.type != KeyPress || next_event.xkey.keycode != event->hardware_keycode || @@ -5577,13 +5577,13 @@ static gboolean key_press_event_cb(GtkWidget *widget, GdkEventKey *event) { return focusWindow->OnKeyPressEvent(event); } -static gboolean key_release_event_cb(GtkWidget *widget, GdkEventKey *event) { +static gboolean key_release_event_cb(GtkWidget* widget, GdkEventKey* event) { LOG(("key_release_event_cb\n")); UpdateLastInputEventTime(event); // find the window with focus and dispatch this event to that widget - nsWindow *window = get_window_for_gtk_widget(widget); + nsWindow* window = get_window_for_gtk_widget(widget); if (!window) return FALSE; RefPtr focusWindow = gFocusWindow ? gFocusWindow : window; @@ -5591,16 +5591,16 @@ static gboolean key_release_event_cb(GtkWidget *widget, GdkEventKey *event) { return focusWindow->OnKeyReleaseEvent(event); } -static gboolean property_notify_event_cb(GtkWidget *aWidget, - GdkEventProperty *aEvent) { +static gboolean property_notify_event_cb(GtkWidget* aWidget, + GdkEventProperty* aEvent) { RefPtr window = get_window_for_gdk_window(aEvent->window); if (!window) return FALSE; return window->OnPropertyNotifyEvent(aWidget, aEvent); } -static gboolean scroll_event_cb(GtkWidget *widget, GdkEventScroll *event) { - nsWindow *window = GetFirstNSWindowForGDKWindow(event->window); +static gboolean scroll_event_cb(GtkWidget* widget, GdkEventScroll* event) { + nsWindow* window = GetFirstNSWindowForGDKWindow(event->window); if (!window) return FALSE; window->OnScrollEvent(event); @@ -5608,8 +5608,8 @@ static gboolean scroll_event_cb(GtkWidget *widget, GdkEventScroll *event) { return TRUE; } -static gboolean visibility_notify_event_cb(GtkWidget *widget, - GdkEventVisibility *event) { +static gboolean visibility_notify_event_cb(GtkWidget* widget, + GdkEventVisibility* event) { RefPtr window = get_window_for_gdk_window(event->window); if (!window) return FALSE; @@ -5618,9 +5618,9 @@ static gboolean visibility_notify_event_cb(GtkWidget *widget, return TRUE; } -static void hierarchy_changed_cb(GtkWidget *widget, - GtkWidget *previous_toplevel) { - GtkWidget *toplevel = gtk_widget_get_toplevel(widget); +static void hierarchy_changed_cb(GtkWidget* widget, + GtkWidget* previous_toplevel) { + GtkWidget* toplevel = gtk_widget_get_toplevel(widget); GdkWindowState old_window_state = GDK_WINDOW_STATE_WITHDRAWN; GdkEventWindowState event; @@ -5629,7 +5629,7 @@ static void hierarchy_changed_cb(GtkWidget *widget, if (GTK_IS_WINDOW(previous_toplevel)) { g_signal_handlers_disconnect_by_func( previous_toplevel, FuncToGpointer(window_state_event_cb), widget); - GdkWindow *win = gtk_widget_get_window(previous_toplevel); + GdkWindow* win = gtk_widget_get_window(previous_toplevel); if (win) { old_window_state = gdk_window_get_state(win); } @@ -5638,7 +5638,7 @@ static void hierarchy_changed_cb(GtkWidget *widget, if (GTK_IS_WINDOW(toplevel)) { g_signal_connect_swapped(toplevel, "window-state-event", G_CALLBACK(window_state_event_cb), widget); - GdkWindow *win = gtk_widget_get_window(toplevel); + GdkWindow* win = gtk_widget_get_window(toplevel); if (win) { event.new_window_state = gdk_window_get_state(win); } @@ -5655,8 +5655,8 @@ static void hierarchy_changed_cb(GtkWidget *widget, } } -static gboolean window_state_event_cb(GtkWidget *widget, - GdkEventWindowState *event) { +static gboolean window_state_event_cb(GtkWidget* widget, + GdkEventWindowState* event) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) return FALSE; @@ -5665,13 +5665,13 @@ static gboolean window_state_event_cb(GtkWidget *widget, return FALSE; } -static void settings_changed_cb(GtkSettings *settings, GParamSpec *pspec, - nsWindow *data) { +static void settings_changed_cb(GtkSettings* settings, GParamSpec* pspec, + nsWindow* data) { RefPtr window = data; window->ThemeChanged(); } -static void check_resize_cb(GtkContainer *container, gpointer user_data) { +static void check_resize_cb(GtkContainer* container, gpointer user_data) { RefPtr window = get_window_for_gtk_widget(GTK_WIDGET(container)); if (!window) { return; @@ -5679,7 +5679,7 @@ static void check_resize_cb(GtkContainer *container, gpointer user_data) { window->OnCheckResize(); } -static void screen_composited_changed_cb(GdkScreen *screen, +static void screen_composited_changed_cb(GdkScreen* screen, gpointer user_data) { // This callback can run before gfxPlatform::Init() in rare // cases involving the profile manager. When this happens, @@ -5690,7 +5690,7 @@ static void screen_composited_changed_cb(GdkScreen *screen, } } -static void widget_composited_changed_cb(GtkWidget *widget, +static void widget_composited_changed_cb(GtkWidget* widget, gpointer user_data) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) { @@ -5699,7 +5699,7 @@ static void widget_composited_changed_cb(GtkWidget *widget, window->OnCompositedChanged(); } -static void scale_changed_cb(GtkWidget *widget, GParamSpec *aPSpec, +static void scale_changed_cb(GtkWidget* widget, GParamSpec* aPSpec, gpointer aPointer) { RefPtr window = get_window_for_gtk_widget(widget); if (!window) { @@ -5712,10 +5712,10 @@ static void scale_changed_cb(GtkWidget *widget, GParamSpec *aPSpec, } #if GTK_CHECK_VERSION(3, 4, 0) -static gboolean touch_event_cb(GtkWidget *aWidget, GdkEventTouch *aEvent) { +static gboolean touch_event_cb(GtkWidget* aWidget, GdkEventTouch* aEvent) { UpdateLastInputEventTime(aEvent); - nsWindow *window = GetFirstNSWindowForGDKWindow(aEvent->window); + nsWindow* window = GetFirstNSWindowForGDKWindow(aEvent->window); if (!window) { return FALSE; } @@ -5727,15 +5727,15 @@ static gboolean touch_event_cb(GtkWidget *aWidget, GdkEventTouch *aEvent) { ////////////////////////////////////////////////////////////////////// // These are all of our drag and drop operations -void nsWindow::InitDragEvent(WidgetDragEvent &aEvent) { +void nsWindow::InitDragEvent(WidgetDragEvent& aEvent) { // set the keyboard modifiers guint modifierState = KeymapWrapper::GetCurrentModifierState(); KeymapWrapper::InitInputEvent(aEvent, modifierState); } -gboolean WindowDragMotionHandler(GtkWidget *aWidget, - GdkDragContext *aDragContext, - nsWaylandDragContext *aWaylandDragContext, +gboolean WindowDragMotionHandler(GtkWidget* aWidget, + GdkDragContext* aDragContext, + nsWaylandDragContext* aWaylandDragContext, gint aX, gint aY, guint aTime) { RefPtr window = get_window_for_gtk_widget(aWidget); if (!window) return FALSE; @@ -5744,7 +5744,7 @@ gboolean WindowDragMotionHandler(GtkWidget *aWidget, nscoord retx = 0; nscoord rety = 0; - GdkWindow *innerWindow = get_inner_gdk_window(gtk_widget_get_window(aWidget), + GdkWindow* innerWindow = get_inner_gdk_window(gtk_widget_get_window(aWidget), aX, aY, &retx, &rety); RefPtr innerMostWindow = get_window_for_gdk_window(innerWindow); @@ -5752,7 +5752,7 @@ gboolean WindowDragMotionHandler(GtkWidget *aWidget, innerMostWindow = window; } - LOGDRAG(("nsWindow drag-motion signal for %p\n", (void *)innerMostWindow)); + LOGDRAG(("nsWindow drag-motion signal for %p\n", (void*)innerMostWindow)); LayoutDeviceIntPoint point = window->GdkPointToDevicePixels({retx, rety}); @@ -5761,19 +5761,19 @@ gboolean WindowDragMotionHandler(GtkWidget *aWidget, aWaylandDragContext, point, aTime); } -static gboolean drag_motion_event_cb(GtkWidget *aWidget, - GdkDragContext *aDragContext, gint aX, +static gboolean drag_motion_event_cb(GtkWidget* aWidget, + GdkDragContext* aDragContext, gint aX, gint aY, guint aTime, gpointer aData) { return WindowDragMotionHandler(aWidget, aDragContext, nullptr, aX, aY, aTime); } -void WindowDragLeaveHandler(GtkWidget *aWidget) { +void WindowDragLeaveHandler(GtkWidget* aWidget) { RefPtr window = get_window_for_gtk_widget(aWidget); if (!window) return; RefPtr dragService = nsDragService::GetInstance(); - nsWindow *mostRecentDragWindow = dragService->GetMostRecentDestWindow(); + nsWindow* mostRecentDragWindow = dragService->GetMostRecentDestWindow(); if (!mostRecentDragWindow) { // This can happen when the target will not accept a drop. A GTK drag // source sends the leave message to the destination before the @@ -5783,7 +5783,7 @@ void WindowDragLeaveHandler(GtkWidget *aWidget) { return; } - GtkWidget *mozContainer = mostRecentDragWindow->GetMozContainerWidget(); + GtkWidget* mozContainer = mostRecentDragWindow->GetMozContainerWidget(); if (aWidget != mozContainer) { // When the drag moves between widgets, GTK can send leave signal for // the old widget after the motion or drop signal for the new widget. @@ -5791,20 +5791,19 @@ void WindowDragLeaveHandler(GtkWidget *aWidget) { return; } - LOGDRAG( - ("nsWindow drag-leave signal for %p\n", (void *)mostRecentDragWindow)); + LOGDRAG(("nsWindow drag-leave signal for %p\n", (void*)mostRecentDragWindow)); dragService->ScheduleLeaveEvent(); } -static void drag_leave_event_cb(GtkWidget *aWidget, - GdkDragContext *aDragContext, guint aTime, +static void drag_leave_event_cb(GtkWidget* aWidget, + GdkDragContext* aDragContext, guint aTime, gpointer aData) { WindowDragLeaveHandler(aWidget); } -gboolean WindowDragDropHandler(GtkWidget *aWidget, GdkDragContext *aDragContext, - nsWaylandDragContext *aWaylandDragContext, +gboolean WindowDragDropHandler(GtkWidget* aWidget, GdkDragContext* aDragContext, + nsWaylandDragContext* aWaylandDragContext, gint aX, gint aY, guint aTime) { RefPtr window = get_window_for_gtk_widget(aWidget); if (!window) return FALSE; @@ -5813,7 +5812,7 @@ gboolean WindowDragDropHandler(GtkWidget *aWidget, GdkDragContext *aDragContext, nscoord retx = 0; nscoord rety = 0; - GdkWindow *innerWindow = get_inner_gdk_window(gtk_widget_get_window(aWidget), + GdkWindow* innerWindow = get_inner_gdk_window(gtk_widget_get_window(aWidget), aX, aY, &retx, &rety); RefPtr innerMostWindow = get_window_for_gdk_window(innerWindow); @@ -5821,7 +5820,7 @@ gboolean WindowDragDropHandler(GtkWidget *aWidget, GdkDragContext *aDragContext, innerMostWindow = window; } - LOGDRAG(("nsWindow drag-drop signal for %p\n", (void *)innerMostWindow)); + LOGDRAG(("nsWindow drag-drop signal for %p\n", (void*)innerMostWindow)); LayoutDeviceIntPoint point = window->GdkPointToDevicePixels({retx, rety}); @@ -5830,16 +5829,16 @@ gboolean WindowDragDropHandler(GtkWidget *aWidget, GdkDragContext *aDragContext, aWaylandDragContext, point, aTime); } -static gboolean drag_drop_event_cb(GtkWidget *aWidget, - GdkDragContext *aDragContext, gint aX, +static gboolean drag_drop_event_cb(GtkWidget* aWidget, + GdkDragContext* aDragContext, gint aX, gint aY, guint aTime, gpointer aData) { return WindowDragDropHandler(aWidget, aDragContext, nullptr, aX, aY, aTime); } -static void drag_data_received_event_cb(GtkWidget *aWidget, - GdkDragContext *aDragContext, gint aX, +static void drag_data_received_event_cb(GtkWidget* aWidget, + GdkDragContext* aDragContext, gint aX, gint aY, - GtkSelectionData *aSelectionData, + GtkSelectionData* aSelectionData, guint aInfo, guint aTime, gpointer aData) { RefPtr window = get_window_for_gtk_widget(aWidget); @@ -5856,13 +5855,13 @@ static nsresult initialize_prefs(void) { return NS_OK; } -static GdkWindow *get_inner_gdk_window(GdkWindow *aWindow, gint x, gint y, - gint *retx, gint *rety) { +static GdkWindow* get_inner_gdk_window(GdkWindow* aWindow, gint x, gint y, + gint* retx, gint* rety) { gint cx, cy, cw, ch; - GList *children = gdk_window_peek_children(aWindow); - for (GList *child = g_list_last(children); child; + GList* children = gdk_window_peek_children(aWindow); + for (GList* child = g_list_last(children); child; child = g_list_previous(child)) { - auto *childWindow = (GdkWindow *)child->data; + auto* childWindow = (GdkWindow*)child->data; if (get_window_for_gdk_window(childWindow)) { gdk_window_get_geometry(childWindow, &cx, &cy, &cw, &ch); if ((cx < x) && (x < (cx + cw)) && (cy < y) && (y < (cy + ch)) && @@ -5876,13 +5875,13 @@ static GdkWindow *get_inner_gdk_window(GdkWindow *aWindow, gint x, gint y, return aWindow; } -static int is_parent_ungrab_enter(GdkEventCrossing *aEvent) { +static int is_parent_ungrab_enter(GdkEventCrossing* aEvent) { return (GDK_CROSSING_UNGRAB == aEvent->mode) && ((GDK_NOTIFY_ANCESTOR == aEvent->detail) || (GDK_NOTIFY_VIRTUAL == aEvent->detail)); } -static int is_parent_grab_leave(GdkEventCrossing *aEvent) { +static int is_parent_grab_leave(GdkEventCrossing* aEvent) { return (GDK_CROSSING_GRAB == aEvent->mode) && ((GDK_NOTIFY_ANCESTOR == aEvent->detail) || (GDK_NOTIFY_VIRTUAL == aEvent->detail)); @@ -5901,13 +5900,13 @@ void nsWindow::DispatchEventToRootAccessible(uint32_t aEventType) { return; } - nsAccessibilityService *accService = GetOrCreateAccService(); + nsAccessibilityService* accService = GetOrCreateAccService(); if (!accService) { return; } // Get the root document accessible and fire event to it. - a11y::Accessible *acc = GetRootAccessible(); + a11y::Accessible* acc = GetRootAccessible(); if (acc) { accService->FireAccessibleEvent(aEventType, acc); } @@ -5935,8 +5934,8 @@ void nsWindow::DispatchRestoreEventAccessible(void) { #endif /* #ifdef ACCESSIBILITY */ -void nsWindow::SetInputContext(const InputContext &aContext, - const InputContextAction &aAction) { +void nsWindow::SetInputContext(const InputContext& aContext, + const InputContextAction& aAction) { if (!mIMContext) { return; } @@ -5954,7 +5953,7 @@ InputContext nsWindow::GetInputContext() { return context; } -TextEventDispatcherListener *nsWindow::GetNativeTextEventDispatcherListener() { +TextEventDispatcherListener* nsWindow::GetNativeTextEventDispatcherListener() { if (NS_WARN_IF(!mIMContext)) { return nullptr; } @@ -5962,8 +5961,8 @@ TextEventDispatcherListener *nsWindow::GetNativeTextEventDispatcherListener() { } void nsWindow::GetEditCommandsRemapped(NativeKeyBindingsType aType, - const WidgetKeyboardEvent &aEvent, - nsTArray &aCommands, + const WidgetKeyboardEvent& aEvent, + nsTArray& aCommands, uint32_t aGeckoKeyCode, uint32_t aNativeKeyCode) { // If aEvent.mNativeKeyEvent is nullptr, the event was created by chrome @@ -5974,16 +5973,16 @@ void nsWindow::GetEditCommandsRemapped(NativeKeyBindingsType aType, } WidgetKeyboardEvent modifiedEvent(aEvent); modifiedEvent.mKeyCode = aGeckoKeyCode; - static_cast(modifiedEvent.mNativeKeyEvent)->keyval = + static_cast(modifiedEvent.mNativeKeyEvent)->keyval = aNativeKeyCode; - NativeKeyBindings *keyBindings = NativeKeyBindings::GetInstance(aType); + NativeKeyBindings* keyBindings = NativeKeyBindings::GetInstance(aType); keyBindings->GetEditCommands(modifiedEvent, aCommands); } void nsWindow::GetEditCommands(NativeKeyBindingsType aType, - const WidgetKeyboardEvent &aEvent, - nsTArray &aCommands) { + const WidgetKeyboardEvent& aEvent, + nsTArray& aCommands) { // Validate the arguments. nsIWidget::GetEditCommands(aType, aEvent, aCommands); @@ -6035,24 +6034,24 @@ void nsWindow::GetEditCommands(NativeKeyBindingsType aType, } } - NativeKeyBindings *keyBindings = NativeKeyBindings::GetInstance(aType); + NativeKeyBindings* keyBindings = NativeKeyBindings::GetInstance(aType); keyBindings->GetEditCommands(aEvent, aCommands); } already_AddRefed nsWindow::StartRemoteDrawingInRegion( - LayoutDeviceIntRegion &aInvalidRegion, BufferMode *aBufferMode) { + LayoutDeviceIntRegion& aInvalidRegion, BufferMode* aBufferMode) { return mSurfaceProvider.StartRemoteDrawingInRegion(aInvalidRegion, aBufferMode); } -void nsWindow::EndRemoteDrawingInRegion(DrawTarget *aDrawTarget, - LayoutDeviceIntRegion &aInvalidRegion) { +void nsWindow::EndRemoteDrawingInRegion(DrawTarget* aDrawTarget, + LayoutDeviceIntRegion& aInvalidRegion) { mSurfaceProvider.EndRemoteDrawingInRegion(aDrawTarget, aInvalidRegion); } // Code shared begin BeginMoveDrag and BeginResizeDrag -bool nsWindow::GetDragInfo(WidgetMouseEvent *aMouseEvent, GdkWindow **aWindow, - gint *aButton, gint *aRootX, gint *aRootY) { +bool nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent, GdkWindow** aWindow, + gint* aButton, gint* aRootX, gint* aRootY) { if (aMouseEvent->mButton != MouseButton::eLeft) { // we can only begin a move drag with the left mouse button return false; @@ -6060,7 +6059,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent *aMouseEvent, GdkWindow **aWindow, *aButton = 1; // get the gdk window for this widget - GdkWindow *gdk_window = mGdkWindow; + GdkWindow* gdk_window = mGdkWindow; if (!gdk_window) { return false; } @@ -6086,7 +6085,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent *aMouseEvent, GdkWindow **aWindow, // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=789054 // To avoid crashes disable double-click on WM without _NET_WM_MOVERESIZE. // See _should_perform_ewmh_drag() at gdkwindow-x11.c - GdkScreen *screen = gdk_window_get_screen(gdk_window); + GdkScreen* screen = gdk_window_get_screen(gdk_window); GdkAtom atom = gdk_atom_intern("_NET_WM_MOVERESIZE", FALSE); if (!gdk_x11_screen_supports_net_wm_hint(screen, atom)) { static unsigned int lastTimeStamp = 0; @@ -6110,7 +6109,7 @@ bool nsWindow::GetDragInfo(WidgetMouseEvent *aMouseEvent, GdkWindow **aWindow, return true; } -nsresult nsWindow::BeginResizeDrag(WidgetGUIEvent *aEvent, int32_t aHorizontal, +nsresult nsWindow::BeginResizeDrag(WidgetGUIEvent* aEvent, int32_t aHorizontal, int32_t aVertical) { NS_ENSURE_ARG_POINTER(aEvent); @@ -6119,7 +6118,7 @@ nsresult nsWindow::BeginResizeDrag(WidgetGUIEvent *aEvent, int32_t aHorizontal, return NS_ERROR_INVALID_ARG; } - GdkWindow *gdk_window; + GdkWindow* gdk_window; gint button, screenX, screenY; if (!GetDragInfo(aEvent->AsMouseEvent(), &gdk_window, &button, &screenX, &screenY)) { @@ -6161,8 +6160,8 @@ nsresult nsWindow::BeginResizeDrag(WidgetGUIEvent *aEvent, int32_t aHorizontal, return NS_OK; } -nsIWidget::LayerManager *nsWindow::GetLayerManager( - PLayerTransactionChild *aShadowManager, LayersBackend aBackendHint, +nsIWidget::LayerManager* nsWindow::GetLayerManager( + PLayerTransactionChild* aShadowManager, LayersBackend aBackendHint, LayerManagerPersistence aPersistence) { if (mIsDestroyed) { // Prevent external code from triggering the re-creation of the @@ -6175,7 +6174,7 @@ nsIWidget::LayerManager *nsWindow::GetLayerManager( aPersistence); } -void nsWindow::SetCompositorWidgetDelegate(CompositorWidgetDelegate *delegate) { +void nsWindow::SetCompositorWidgetDelegate(CompositorWidgetDelegate* delegate) { if (delegate) { mCompositorWidgetDelegate = delegate->AsPlatformSpecificDelegate(); MOZ_ASSERT(mCompositorWidgetDelegate, @@ -6195,9 +6194,9 @@ void nsWindow::ClearCachedResources() { mLayerManager->ClearCachedResources(); } - GList *children = gdk_window_peek_children(mGdkWindow); - for (GList *list = children; list; list = list->next) { - nsWindow *window = get_window_for_gdk_window(GDK_WINDOW(list->data)); + GList* children = gdk_window_peek_children(mGdkWindow); + for (GList* list = children; list; list = list->next) { + nsWindow* window = get_window_for_gdk_window(GDK_WINDOW(list->data)); if (window) { window->ClearCachedResources(); } @@ -6235,7 +6234,7 @@ void nsWindow::UpdateClientOffsetForCSDWindow() { NotifyWindowMoved(mBounds.x, mBounds.y); } -nsresult nsWindow::SetNonClientMargins(LayoutDeviceIntMargin &aMargins) { +nsresult nsWindow::SetNonClientMargins(LayoutDeviceIntMargin& aMargins) { SetDrawsInTitlebar(aMargins.top == 0); return NS_OK; } @@ -6264,16 +6263,15 @@ void nsWindow::SetDrawsInTitlebar(bool aState) { // Using GTK_WINDOW_POPUP rather than // GTK_WINDOW_TOPLEVEL in the hope that POPUP results in less // initialization and window manager interaction. - GtkWidget *tmpWindow = gtk_window_new(GTK_WINDOW_POPUP); + GtkWidget* tmpWindow = gtk_window_new(GTK_WINDOW_POPUP); gtk_widget_realize(tmpWindow); gtk_widget_reparent(GTK_WIDGET(mContainer), tmpWindow); gtk_widget_unrealize(GTK_WIDGET(mShell)); // Available as of GTK 3.10+ - static auto sGtkWindowSetTitlebar = - (void (*)(GtkWindow *, GtkWidget *))dlsym(RTLD_DEFAULT, - "gtk_window_set_titlebar"); + static auto sGtkWindowSetTitlebar = (void (*)(GtkWindow*, GtkWidget*))dlsym( + RTLD_DEFAULT, "gtk_window_set_titlebar"); MOZ_ASSERT(sGtkWindowSetTitlebar, "Missing gtk_window_set_titlebar(), old Gtk+ library?"); @@ -6337,7 +6335,7 @@ void nsWindow::SetDrawsInTitlebar(bool aState) { gint nsWindow::GdkScaleFactor() { // Available as of GTK 3.10+ static auto sGdkWindowGetScaleFactorPtr = - (gint(*)(GdkWindow *))dlsym(RTLD_DEFAULT, "gdk_window_get_scale_factor"); + (gint(*)(GdkWindow*))dlsym(RTLD_DEFAULT, "gdk_window_get_scale_factor"); if (sGdkWindowGetScaleFactorPtr && mGdkWindow) return (*sGdkWindowGetScaleFactorPtr)(mGdkWindow); return ScreenHelperGTK::GetGTKMonitorScaleFactor(); @@ -6399,14 +6397,14 @@ LayoutDeviceIntRect nsWindow::GdkRectToDevicePixels(GdkRectangle rect) { nsresult nsWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, uint32_t aNativeMessage, uint32_t aModifierFlags, - nsIObserver *aObserver) { + nsIObserver* aObserver) { AutoObserverNotifier notifier(aObserver, "mouseevent"); if (!mGdkWindow) { return NS_OK; } - GdkDisplay *display = gdk_window_get_display(mGdkWindow); + GdkDisplay* display = gdk_window_get_display(mGdkWindow); // When a button-press/release event is requested, create it here and put it // in the event queue. This will not emit a motion event - this needs to be @@ -6423,7 +6421,7 @@ nsresult nsWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, event.button.time = GDK_CURRENT_TIME; // Get device for event source - GdkDeviceManager *device_manager = gdk_display_get_device_manager(display); + GdkDeviceManager* device_manager = gdk_display_get_device_manager(display); event.button.device = gdk_device_manager_get_client_pointer(device_manager); event.button.x_root = DevicePixelsToGdkCoordRoundDown(aPoint.x); @@ -6438,7 +6436,7 @@ nsresult nsWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, // We don't support specific events other than button-press/release. In all // other cases we'll synthesize a motion event that will be emitted by // gdk_display_warp_pointer(). - GdkScreen *screen = gdk_window_get_screen(mGdkWindow); + GdkScreen* screen = gdk_window_get_screen(mGdkWindow); GdkPoint point = DevicePixelsToGdkPointRoundDown(aPoint); gdk_display_warp_pointer(display, screen, point.x, point.y); } @@ -6449,7 +6447,7 @@ nsresult nsWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, nsresult nsWindow::SynthesizeNativeMouseScrollEvent( mozilla::LayoutDeviceIntPoint aPoint, uint32_t aNativeMessage, double aDeltaX, double aDeltaY, double aDeltaZ, uint32_t aModifierFlags, - uint32_t aAdditionalFlags, nsIObserver *aObserver) { + uint32_t aAdditionalFlags, nsIObserver* aObserver) { AutoObserverNotifier notifier(aObserver, "mousescrollevent"); if (!mGdkWindow) { @@ -6462,8 +6460,8 @@ nsresult nsWindow::SynthesizeNativeMouseScrollEvent( event.scroll.window = mGdkWindow; event.scroll.time = GDK_CURRENT_TIME; // Get device for event source - GdkDisplay *display = gdk_window_get_display(mGdkWindow); - GdkDeviceManager *device_manager = gdk_display_get_device_manager(display); + GdkDisplay* display = gdk_window_get_display(mGdkWindow); + GdkDeviceManager* device_manager = gdk_display_get_device_manager(display); event.scroll.device = gdk_device_manager_get_client_pointer(device_manager); event.scroll.x_root = DevicePixelsToGdkCoordRoundDown(aPoint.x); event.scroll.y_root = DevicePixelsToGdkCoordRoundDown(aPoint.y); @@ -6504,7 +6502,7 @@ nsresult nsWindow::SynthesizeNativeTouchPoint(uint32_t aPointerId, LayoutDeviceIntPoint aPoint, double aPointerPressure, uint32_t aPointerOrientation, - nsIObserver *aObserver) { + nsIObserver* aObserver) { AutoObserverNotifier notifier(aObserver, "touchpoint"); if (!mGdkWindow) { @@ -6514,7 +6512,7 @@ nsresult nsWindow::SynthesizeNativeTouchPoint(uint32_t aPointerId, GdkEvent event; memset(&event, 0, sizeof(GdkEvent)); - static std::map sKnownPointers; + static std::map sKnownPointers; auto result = sKnownPointers.find(aPointerId); switch (aPointerState) { @@ -6524,7 +6522,7 @@ nsresult nsWindow::SynthesizeNativeTouchPoint(uint32_t aPointerId, // dereferenced in the gtk code. It's an opaque pointer, the only // requirement is that it be distinct from other instances of // GdkEventSequence*. - event.touch.sequence = (GdkEventSequence *)((uintptr_t)aPointerId); + event.touch.sequence = (GdkEventSequence*)((uintptr_t)aPointerId); sKnownPointers[aPointerId] = event.touch.sequence; event.type = GDK_TOUCH_BEGIN; } else { @@ -6558,8 +6556,8 @@ nsresult nsWindow::SynthesizeNativeTouchPoint(uint32_t aPointerId, event.touch.window = mGdkWindow; event.touch.time = GDK_CURRENT_TIME; - GdkDisplay *display = gdk_window_get_display(mGdkWindow); - GdkDeviceManager *device_manager = gdk_display_get_device_manager(display); + GdkDisplay* display = gdk_window_get_display(mGdkWindow); + GdkDeviceManager* device_manager = gdk_display_get_device_manager(display); event.touch.device = gdk_device_manager_get_client_pointer(device_manager); event.touch.x_root = DevicePixelsToGdkCoordRoundDown(aPoint.x); @@ -6587,7 +6585,7 @@ nsWindow::CSDSupportLevel nsWindow::GetSystemCSDSupportLevel() { } // Allow MOZ_GTK_TITLEBAR_DECORATION to override our heuristics - const char *decorationOverride = getenv("MOZ_GTK_TITLEBAR_DECORATION"); + const char* decorationOverride = getenv("MOZ_GTK_TITLEBAR_DECORATION"); if (decorationOverride) { if (strcmp(decorationOverride, "none") == 0) { sCSDSupportLevel = CSD_SUPPORT_NONE; @@ -6605,7 +6603,7 @@ nsWindow::CSDSupportLevel nsWindow::GetSystemCSDSupportLevel() { return sCSDSupportLevel; } - const char *currentDesktop = getenv("XDG_CURRENT_DESKTOP"); + const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP"); if (currentDesktop) { // GNOME Flashback (fallback) if (strstr(currentDesktop, "GNOME-Flashback:GNOME") != nullptr) { @@ -6657,7 +6655,7 @@ nsWindow::CSDSupportLevel nsWindow::GetSystemCSDSupportLevel() { // decorations does not work with CSD. // We check GTK_CSD as well as gtk_window_should_use_csd() does. if (sCSDSupportLevel == CSD_SUPPORT_SYSTEM) { - const char *csdOverride = getenv("GTK_CSD"); + const char* csdOverride = getenv("GTK_CSD"); if (csdOverride && g_strcmp0(csdOverride, "1") == 0) { sCSDSupportLevel = CSD_SUPPORT_CLIENT; } @@ -6676,14 +6674,14 @@ bool nsWindow::TitlebarCanUseShapeMask() { } canUseShapeMask = true; - const char *currentDesktop = getenv("XDG_CURRENT_DESKTOP"); + const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP"); if (!currentDesktop) { return canUseShapeMask; } if (strstr(currentDesktop, "GNOME-Flashback:GNOME") != nullptr || strstr(currentDesktop, "GNOME") != nullptr) { - const char *sessionType = getenv("XDG_SESSION_TYPE"); + const char* sessionType = getenv("XDG_SESSION_TYPE"); canUseShapeMask = (sessionType && strstr(sessionType, "x11") == nullptr); } @@ -6704,7 +6702,7 @@ bool nsWindow::HideTitlebarByDefault() { return hideTitlebar; } - const char *currentDesktop = getenv("XDG_CURRENT_DESKTOP"); + const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP"); hideTitlebar = (currentDesktop && GetSystemCSDSupportLevel() != CSD_SUPPORT_NONE); @@ -6727,7 +6725,7 @@ bool nsWindow::HideTitlebarByDefault() { int32_t nsWindow::RoundsWidgetCoordinatesTo() { return GdkScaleFactor(); } void nsWindow::GetCompositorWidgetInitData( - mozilla::widget::CompositorWidgetInitData *aInitData) { + mozilla::widget::CompositorWidgetInitData* aInitData) { // Make sure the window XID is propagated to X server, we can fail otherwise // in GPU process (Bug 1401634). if (mXDisplay && mXWindow != X11None) { @@ -6742,7 +6740,7 @@ void nsWindow::GetCompositorWidgetInitData( } #ifdef MOZ_WAYLAND -wl_surface *nsWindow::GetWaylandSurface() { +wl_surface* nsWindow::GetWaylandSurface() { if (mContainer) return moz_container_get_wl_surface(MOZ_CONTAINER(mContainer)); @@ -6777,16 +6775,16 @@ bool nsWindow::WaylandSurfaceNeedsClear() { # define PROGRESS_HINT "_NET_WM_XAPP_PROGRESS" -static void set_window_hint_cardinal(Window xid, const gchar *atom_name, +static void set_window_hint_cardinal(Window xid, const gchar* atom_name, gulong cardinal) { - GdkDisplay *display; + GdkDisplay* display; display = gdk_display_get_default(); if (cardinal > 0) { XChangeProperty(GDK_DISPLAY_XDISPLAY(display), xid, gdk_x11_get_xatom_by_name_for_display(display, atom_name), - XA_CARDINAL, 32, PropModeReplace, (guchar *)&cardinal, 1); + XA_CARDINAL, 32, PropModeReplace, (guchar*)&cardinal, 1); } else { XDeleteProperty(GDK_DISPLAY_XDISPLAY(display), xid, gdk_x11_get_xatom_by_name_for_display(display, atom_name)); @@ -6823,20 +6821,20 @@ void nsWindow::SetCompositorHint(WindowComposeRequest aState) { gdk_atom_intern("_NET_WM_BYPASS_COMPOSITOR", FALSE), cardinal_atom, 32, // format - GDK_PROP_MODE_REPLACE, (guchar *)&value, 1); + GDK_PROP_MODE_REPLACE, (guchar*)&value, 1); } } #endif -nsresult nsWindow::SetSystemFont(const nsCString &aFontName) { - GtkSettings *settings = gtk_settings_get_default(); +nsresult nsWindow::SetSystemFont(const nsCString& aFontName) { + GtkSettings* settings = gtk_settings_get_default(); g_object_set(settings, "gtk-font-name", aFontName.get(), nullptr); return NS_OK; } -nsresult nsWindow::GetSystemFont(nsCString &aFontName) { - GtkSettings *settings = gtk_settings_get_default(); - gchar *fontName = nullptr; +nsresult nsWindow::GetSystemFont(nsCString& aFontName) { + GtkSettings* settings = gtk_settings_get_default(); + gchar* fontName = nullptr; g_object_get(settings, "gtk-font-name", &fontName, nullptr); if (fontName) { aFontName.Assign(fontName); @@ -6855,7 +6853,7 @@ already_AddRefed nsIWidget::CreateChildWindow() { return window.forget(); } -bool nsWindow::GetTopLevelWindowActiveState(nsIFrame *aFrame) { +bool nsWindow::GetTopLevelWindowActiveState(nsIFrame* aFrame) { // Used by window frame and button box rendering. We can end up in here in // the content process when rendering one of these moz styles freely in a // page. Fail in this case, there is no applicable window focus state. @@ -6868,19 +6866,19 @@ bool nsWindow::GetTopLevelWindowActiveState(nsIFrame *aFrame) { } // Get the widget. nsIFrame's GetNearestWidget walks up the view chain // until it finds a real window. - nsWindow *window = static_cast(aFrame->GetNearestWidget()); + nsWindow* window = static_cast(aFrame->GetNearestWidget()); if (!window) { return false; } // Get our toplevel nsWindow. if (!window->mIsTopLevel) { - GtkWidget *widget = window->GetMozContainerWidget(); + GtkWidget* widget = window->GetMozContainerWidget(); if (!widget) { return false; } - GtkWidget *toplevelWidget = gtk_widget_get_toplevel(widget); + GtkWidget* toplevelWidget = gtk_widget_get_toplevel(widget); window = get_window_for_gtk_widget(toplevelWidget); if (!window) { return false; @@ -6890,15 +6888,15 @@ bool nsWindow::GetTopLevelWindowActiveState(nsIFrame *aFrame) { return !window->mTitlebarBackdropState; } -static nsIFrame *FindTitlebarFrame(nsIFrame *aFrame) { - for (nsIFrame *childFrame : aFrame->PrincipalChildList()) { - const nsStyleDisplay *frameDisp = childFrame->StyleDisplay(); +static nsIFrame* FindTitlebarFrame(nsIFrame* aFrame) { + for (nsIFrame* childFrame : aFrame->PrincipalChildList()) { + const nsStyleDisplay* frameDisp = childFrame->StyleDisplay(); if (frameDisp->mAppearance == StyleAppearance::MozWindowTitlebar || frameDisp->mAppearance == StyleAppearance::MozWindowTitlebarMaximized) { return childFrame; } - if (nsIFrame *foundFrame = FindTitlebarFrame(childFrame)) { + if (nsIFrame* foundFrame = FindTitlebarFrame(childFrame)) { return foundFrame; } } @@ -6911,11 +6909,11 @@ void nsWindow::ForceTitlebarRedraw(void) { if (!mWidgetListener || !mWidgetListener->GetPresShell()) { return; } - nsView *view = nsView::GetViewFor(this); + nsView* view = nsView::GetViewFor(this); if (!view) { return; } - nsIFrame *frame = view->GetFrame(); + nsIFrame* frame = view->GetFrame(); if (!frame) { return; } @@ -6927,27 +6925,27 @@ void nsWindow::ForceTitlebarRedraw(void) { } } -GtkWindow *nsWindow::GetPopupParentWindow() { - nsView *view = nsView::GetViewFor(this); +GtkWindow* nsWindow::GetPopupParentWindow() { + nsView* view = nsView::GetViewFor(this); if (!view) { return nullptr; } - nsIFrame *frame = view->GetFrame(); + nsIFrame* frame = view->GetFrame(); if (!frame) { return nullptr; } - nsMenuPopupFrame *menuPopupFrame = do_QueryFrame(frame); - nsWindow *window = - static_cast(menuPopupFrame->GetParentMenuWidget()); + nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(frame); + nsWindow* window = + static_cast(menuPopupFrame->GetParentMenuWidget()); return window ? GTK_WINDOW(window->GetGtkWidget()) : nullptr; } GtkTextDirection nsWindow::GetTextDirection() { - nsView *view = nsView::GetViewFor(this); + nsView* view = nsView::GetViewFor(this); if (!view) { return GTK_TEXT_DIR_LTR; } - nsIFrame *frame = view->GetFrame(); + nsIFrame* frame = view->GetFrame(); if (!frame) { return GTK_TEXT_DIR_LTR; } diff --git a/widget/gtkxtbin/gtk2xtbin.c b/widget/gtkxtbin/gtk2xtbin.c index 0c73d5ca5fc9d..f4ef9755f7c42 100644 --- a/widget/gtkxtbin/gtk2xtbin.c +++ b/widget/gtkxtbin/gtk2xtbin.c @@ -35,36 +35,36 @@ #define XTBIN_MAX_EVENTS 30 -static void gtk_xtbin_class_init(GtkXtBinClass *klass); -static void gtk_xtbin_init(GtkXtBin *xtbin); -static void gtk_xtbin_realize(GtkWidget *widget); -static void gtk_xtbin_unrealize(GtkWidget *widget); -static void gtk_xtbin_destroy(GtkObject *object); +static void gtk_xtbin_class_init(GtkXtBinClass* klass); +static void gtk_xtbin_init(GtkXtBin* xtbin); +static void gtk_xtbin_realize(GtkWidget* widget); +static void gtk_xtbin_unrealize(GtkWidget* widget); +static void gtk_xtbin_destroy(GtkObject* object); /* Xt aware XEmbed */ static void xt_client_handle_xembed_message(Widget w, XtPointer client_data, - XEvent *event); + XEvent* event); static void xt_add_focus_listener(Widget w, XtPointer user_data); static void xt_add_focus_listener_tree(Widget treeroot, XtPointer user_data); static void xt_remove_focus_listener(Widget w, XtPointer user_data); static void xt_client_event_handler(Widget w, XtPointer client_data, - XEvent *event); + XEvent* event); static void xt_client_focus_listener(Widget w, XtPointer user_data, - XEvent *event); + XEvent* event); static void xt_client_set_info(Widget xtplug, unsigned long flags); -static void send_xembed_message(XtClient *xtclient, long message, long detail, +static void send_xembed_message(XtClient* xtclient, long message, long detail, long data1, long data2, long time); -static int error_handler(Display *display, XErrorEvent *error); +static int error_handler(Display* display, XErrorEvent* error); /* For error trap of XEmbed */ static void trap_errors(void); static int untrap_error(void); -static int (*old_error_handler)(Display *, XErrorEvent *); +static int (*old_error_handler)(Display*, XErrorEvent*); static int trapped_error_code = 0; -static GtkWidgetClass *parent_class = NULL; +static GtkWidgetClass* parent_class = NULL; -static Display *xtdisplay = NULL; -static String *fallback = NULL; +static Display* xtdisplay = NULL; +static String* fallback = NULL; static gboolean xt_is_initialized = FALSE; static gint num_widgets = 0; @@ -72,7 +72,7 @@ static GPollFD xt_event_poll_fd; static gint xt_polling_timer_id = 0; static guint tag = 0; -static gboolean xt_event_prepare(GSource *source_data, gint *timeout) { +static gboolean xt_event_prepare(GSource* source_data, gint* timeout) { int mask; mask = XPending(xtdisplay); @@ -80,7 +80,7 @@ static gboolean xt_event_prepare(GSource *source_data, gint *timeout) { return (gboolean)mask; } -static gboolean xt_event_check(GSource *source_data) { +static gboolean xt_event_check(GSource* source_data) { if (xt_event_poll_fd.revents & G_IO_IN) { int mask; mask = XPending(xtdisplay); @@ -90,7 +90,7 @@ static gboolean xt_event_check(GSource *source_data) { return FALSE; } -static gboolean xt_event_dispatch(GSource *source_data, GSourceFunc call_back, +static gboolean xt_event_dispatch(GSource* source_data, GSourceFunc call_back, gpointer user_data) { XtAppContext ac; int i = 0; @@ -114,11 +114,11 @@ static GSourceFuncs xt_event_funcs = { (GSourceFunc)NULL, (GSourceDummyMarshal)NULL}; static gboolean xt_event_polling_timer_callback(gpointer user_data) { - Display *display; + Display* display; XtAppContext ac; int eventsToProcess = 20; - display = (Display *)user_data; + display = (Display*)user_data; ac = XtDisplayToApplicationContext(display); /* We need to process many Xt events here. If we just process @@ -153,9 +153,9 @@ GType gtk_xtbin_get_type(void) { return xtbin_type; } -static void gtk_xtbin_class_init(GtkXtBinClass *klass) { - GtkWidgetClass *widget_class; - GtkObjectClass *object_class; +static void gtk_xtbin_class_init(GtkXtBinClass* klass) { + GtkWidgetClass* widget_class; + GtkObjectClass* object_class; parent_class = g_type_class_peek_parent(klass); @@ -167,14 +167,14 @@ static void gtk_xtbin_class_init(GtkXtBinClass *klass) { object_class->destroy = gtk_xtbin_destroy; } -static void gtk_xtbin_init(GtkXtBin *xtbin) { +static void gtk_xtbin_init(GtkXtBin* xtbin) { xtbin->xtdisplay = NULL; xtbin->parent_window = NULL; xtbin->xtwindow = 0; } -static void gtk_xtbin_realize(GtkWidget *widget) { - GtkXtBin *xtbin; +static void gtk_xtbin_realize(GtkWidget* widget) { + GtkXtBin* xtbin; GtkAllocation allocation = {0, 0, 200, 200}; gint x, y, w, h, d; /* geometry of window */ @@ -210,14 +210,14 @@ static void gtk_xtbin_realize(GtkWidget *widget) { gtk_socket_add_id(GTK_SOCKET(widget), xtbin->xtwindow); } -GtkWidget *gtk_xtbin_new(GdkWindow *parent_window, String *f) { - GtkXtBin *xtbin; +GtkWidget* gtk_xtbin_new(GdkWindow* parent_window, String* f) { + GtkXtBin* xtbin; gpointer user_data; assert(parent_window != NULL); xtbin = g_object_new(GTK_TYPE_XTBIN, NULL); - if (!xtbin) return (GtkWidget *)NULL; + if (!xtbin) return (GtkWidget*)NULL; if (f) fallback = f; @@ -236,7 +236,7 @@ GtkWidget *gtk_xtbin_new(GdkWindow *parent_window, String *f) { printf("gtk_xtbin_init: XtOpenDisplay() returned NULL.\n"); #endif g_free(xtbin); - return (GtkWidget *)NULL; + return (GtkWidget*)NULL; } /* Launch X event loop */ @@ -260,9 +260,9 @@ GtkWidget *gtk_xtbin_new(GdkWindow *parent_window, String *f) { return GTK_WIDGET(xtbin); } -static void gtk_xtbin_unrealize(GtkWidget *object) { - GtkXtBin *xtbin; - GtkWidget *widget; +static void gtk_xtbin_unrealize(GtkWidget* object) { + GtkXtBin* xtbin; + GtkWidget* widget; #ifdef DEBUG_XTBIN printf("gtk_xtbin_unrealize()\n"); @@ -281,8 +281,8 @@ static void gtk_xtbin_unrealize(GtkWidget *object) { (*GTK_WIDGET_CLASS(parent_class)->unrealize)(widget); } -static void gtk_xtbin_destroy(GtkObject *object) { - GtkXtBin *xtbin; +static void gtk_xtbin_destroy(GtkObject* object) { + GtkXtBin* xtbin; #ifdef DEBUG_XTBIN printf("gtk_xtbin_destroy()\n"); @@ -310,10 +310,10 @@ static void gtk_xtbin_destroy(GtkObject *object) { */ /* Initial Xt plugin */ -void xt_client_init(XtClient *xtclient, Visual *xtvisual, Colormap xtcolormap, +void xt_client_init(XtClient* xtclient, Visual* xtvisual, Colormap xtcolormap, int xtdepth) { XtAppContext app_context; - char *mArgv[1]; + char* mArgv[1]; int mArgc = 0; /* @@ -349,7 +349,7 @@ void xt_client_xloop_create(void) { mainloop */ if (0 == num_widgets) { int cnumber; - GSource *gs; + GSource* gs; /* Set up xtdisplay in case we're missing one */ if (!xtdisplay) { @@ -367,7 +367,7 @@ void xt_client_xloop_create(void) { g_source_set_priority(gs, GDK_PRIORITY_EVENTS); g_source_set_can_recurse(gs, TRUE); - tag = g_source_attach(gs, (GMainContext *)NULL); + tag = g_source_attach(gs, (GMainContext*)NULL); g_source_unref(gs); #ifdef VMS cnumber = XConnectionNumber(xtdisplay); @@ -378,7 +378,7 @@ void xt_client_xloop_create(void) { xt_event_poll_fd.events = G_IO_IN; xt_event_poll_fd.revents = 0; /* hmm... is this correct? */ - g_main_context_add_poll((GMainContext *)NULL, &xt_event_poll_fd, + g_main_context_add_poll((GMainContext*)NULL, &xt_event_poll_fd, G_PRIORITY_LOW); /* add a timer so that we can poll and process Xt timers */ xt_polling_timer_id = g_timeout_add( @@ -398,7 +398,7 @@ void xt_client_xloop_destroy(void) { #ifdef DEBUG_XTBIN printf("removing the Xt connection from the main loop\n"); #endif - g_main_context_remove_poll((GMainContext *)NULL, &xt_event_poll_fd); + g_main_context_remove_poll((GMainContext*)NULL, &xt_event_poll_fd); g_source_remove(tag); g_source_remove(xt_polling_timer_id); @@ -407,7 +407,7 @@ void xt_client_xloop_destroy(void) { } /* Get Xt Client display */ -Display *xt_client_get_display(void) { +Display* xt_client_get_display(void) { if (!xtdisplay) { XtClient tmp; xt_client_init(&tmp, NULL, 0, 0); @@ -417,7 +417,7 @@ Display *xt_client_get_display(void) { /* Create the Xt client widgets * */ -void xt_client_create(XtClient *xtclient, Window embedderid, int height, +void xt_client_create(XtClient* xtclient, Window embedderid, int height, int width) { int n; Arg args[6]; @@ -485,7 +485,7 @@ void xt_client_create(XtClient *xtclient, Window embedderid, int height, XSync(xtclient->xtdisplay, FALSE); } -void xt_client_unrealize(XtClient *xtclient) { +void xt_client_unrealize(XtClient* xtclient) { /* Explicitly destroy the child_widget window because this is actually a child of the socket window. It is not a child of top_widget's window when that is destroyed. */ @@ -505,7 +505,7 @@ void xt_client_unrealize(XtClient *xtclient) { XtUnrealizeWidget(xtclient->top_widget); } -void xt_client_destroy(XtClient *xtclient) { +void xt_client_destroy(XtClient* xtclient) { if (xtclient->top_widget) { XtRemoveEventHandler(xtclient->child_widget, StructureNotifyMask | KeyPressMask, TRUE, @@ -524,12 +524,12 @@ void xt_client_set_info(Widget xtplug, unsigned long flags) { buffer[1] = flags; XChangeProperty(XtDisplay(xtplug), XtWindow(xtplug), infoAtom, infoAtom, 32, - PropModeReplace, (unsigned char *)buffer, 2); + PropModeReplace, (unsigned char*)buffer, 2); } static void xt_client_handle_xembed_message(Widget w, XtPointer client_data, - XEvent *event) { - XtClient *xtplug = (XtClient *)client_data; + XEvent* event) { + XtClient* xtplug = (XtClient*)client_data; switch (event->xclient.data.l[1]) { case XEMBED_EMBEDDED_NOTIFY: break; @@ -581,8 +581,8 @@ static void xt_client_handle_xembed_message(Widget w, XtPointer client_data, } /* End of XEmbed Message */ } -void xt_client_event_handler(Widget w, XtPointer client_data, XEvent *event) { - XtClient *xtplug = (XtClient *)client_data; +void xt_client_event_handler(Widget w, XtPointer client_data, XEvent* event) { + XtClient* xtplug = (XtClient*)client_data; switch (event->type) { case ClientMessage: @@ -610,11 +610,11 @@ void xt_client_event_handler(Widget w, XtPointer client_data, XEvent *event) { } /* End of switch(event->type) */ } -static void send_xembed_message(XtClient *xtclient, long message, long detail, +static void send_xembed_message(XtClient* xtclient, long message, long detail, long data1, long data2, long time) { XEvent xevent; Window w = XtWindow(xtclient->top_widget); - Display *dpy = xtclient->xtdisplay; + Display* dpy = xtclient->xtdisplay; int errorcode; memset(&xevent, 0, sizeof(xevent)); @@ -639,7 +639,7 @@ static void send_xembed_message(XtClient *xtclient, long message, long detail, } } -static int error_handler(Display *display, XErrorEvent *error) { +static int error_handler(Display* display, XErrorEvent* error) { trapped_error_code = error->error_code; return 0; } @@ -659,9 +659,9 @@ static int untrap_error(void) { return trapped_error_code; } -void xt_client_focus_listener(Widget w, XtPointer user_data, XEvent *event) { - Display *dpy = XtDisplay(w); - XtClient *xtclient = user_data; +void xt_client_focus_listener(Widget w, XtPointer user_data, XEvent* event) { + Display* dpy = XtDisplay(w); + XtClient* xtclient = user_data; Window win = XtWindow(w); switch (event->type) { @@ -697,7 +697,7 @@ void xt_client_focus_listener(Widget w, XtPointer user_data, XEvent *event) { } static void xt_add_focus_listener(Widget w, XtPointer user_data) { - XtClient *xtclient = user_data; + XtClient* xtclient = user_data; trap_errors(); XtAddEventHandler(w, SubstructureNotifyMask | ButtonReleaseMask, FALSE, @@ -715,9 +715,9 @@ static void xt_remove_focus_listener(Widget w, XtPointer user_data) { static void xt_add_focus_listener_tree(Widget treeroot, XtPointer user_data) { Window win = XtWindow(treeroot); - Window *children; + Window* children; Window root, parent; - Display *dpy = XtDisplay(treeroot); + Display* dpy = XtDisplay(treeroot); unsigned int i, nchildren; /* ensure we don't add more than once */ @@ -735,5 +735,5 @@ static void xt_add_focus_listener_tree(Widget treeroot, XtPointer user_data) { Widget child = XtWindowToWidget(dpy, children[i]); if (child) xt_add_focus_listener_tree(child, user_data); } - XFree((void *)children); + XFree((void*)children); } diff --git a/widget/gtkxtbin/gtk2xtbin.h b/widget/gtkxtbin/gtk2xtbin.h index 4eba3d1760d07..bfef2e21abbf3 100644 --- a/widget/gtkxtbin/gtk2xtbin.h +++ b/widget/gtkxtbin/gtk2xtbin.h @@ -30,10 +30,10 @@ extern "C" { typedef struct _XtClient XtClient; struct _XtClient { - Display *xtdisplay; + Display* xtdisplay; Widget top_widget; /* The toplevel widget */ Widget child_widget; /* The embedded widget */ - Visual *xtvisual; + Visual* xtvisual; int xtdepth; Colormap xtcolormap; Window oldwindow; @@ -54,8 +54,8 @@ typedef struct _GtkXtBinClass GtkXtBinClass; struct _GtkXtBin { GtkSocket gsocket; - GdkWindow *parent_window; - Display *xtdisplay; /* Xt Toolkit Display */ + GdkWindow* parent_window; + Display* xtdisplay; /* Xt Toolkit Display */ Window xtwindow; /* Xt Toolkit XWindow */ XtClient xtclient; /* Xt Client for XEmbed */ @@ -66,13 +66,13 @@ struct _GtkXtBinClass { }; GTKXTBIN_API(GType) gtk_xtbin_get_type(void); -GTKXTBIN_API(GtkWidget *) gtk_xtbin_new(GdkWindow *parent_window, String *f); +GTKXTBIN_API(GtkWidget*) gtk_xtbin_new(GdkWindow* parent_window, String* f); #endif typedef struct _XtTMRec { XtTranslations translations; /* private to Translation Manager */ XtBoundActions proc_table; /* procedure bindings for actions */ - struct _XtStateRec *current_state; /* Translation Manager state ptr */ + struct _XtStateRec* current_state; /* Translation Manager state ptr */ unsigned long lastEventTime; } XtTMRec, *XtTM; @@ -98,7 +98,7 @@ typedef struct _CorePart { WidgetList popup_list; /* list of popups */ Cardinal num_popups; /* how many popups */ String name; /* widget resource name */ - Screen *screen; /* window's screen */ + Screen* screen; /* window's screen */ Colormap colormap; /* colormap */ Window window; /* window ID */ Cardinal depth; /* number of planes in window */ @@ -113,15 +113,15 @@ typedef struct _WidgetRec { } WidgetRec, CoreRec; /* Exported functions, used by Xt plugins */ -void xt_client_create(XtClient *xtclient, Window embeder, int height, +void xt_client_create(XtClient* xtclient, Window embeder, int height, int width); -void xt_client_unrealize(XtClient *xtclient); -void xt_client_destroy(XtClient *xtclient); -void xt_client_init(XtClient *xtclient, Visual *xtvisual, Colormap xtcolormap, +void xt_client_unrealize(XtClient* xtclient); +void xt_client_destroy(XtClient* xtclient); +void xt_client_init(XtClient* xtclient, Visual* xtvisual, Colormap xtcolormap, int xtdepth); void xt_client_xloop_create(void); void xt_client_xloop_destroy(void); -Display *xt_client_get_display(void); +Display* xt_client_get_display(void); #ifdef __cplusplus } diff --git a/widget/headless/HeadlessClipboard.cpp b/widget/headless/HeadlessClipboard.cpp index 4c686f50c3377..ff01220027804 100644 --- a/widget/headless/HeadlessClipboard.cpp +++ b/widget/headless/HeadlessClipboard.cpp @@ -17,8 +17,8 @@ HeadlessClipboard::HeadlessClipboard() : mClipboard(MakeUnique()) {} NS_IMETHODIMP -HeadlessClipboard::SetData(nsITransferable *aTransferable, - nsIClipboardOwner *anOwner, +HeadlessClipboard::SetData(nsITransferable* aTransferable, + nsIClipboardOwner* anOwner, int32_t aWhichClipboard) { if (aWhichClipboard != kGlobalClipboard) { return NS_ERROR_NOT_IMPLEMENTED; @@ -46,7 +46,7 @@ HeadlessClipboard::SetData(nsITransferable *aTransferable, } NS_IMETHODIMP -HeadlessClipboard::GetData(nsITransferable *aTransferable, +HeadlessClipboard::GetData(nsITransferable* aTransferable, int32_t aWhichClipboard) { if (aWhichClipboard != kGlobalClipboard) { return NS_ERROR_NOT_IMPLEMENTED; @@ -77,17 +77,17 @@ HeadlessClipboard::EmptyClipboard(int32_t aWhichClipboard) { } NS_IMETHODIMP -HeadlessClipboard::HasDataMatchingFlavors(const char **aFlavorList, +HeadlessClipboard::HasDataMatchingFlavors(const char** aFlavorList, uint32_t aLength, int32_t aWhichClipboard, - bool *aHasType) { + bool* aHasType) { *aHasType = false; if (aWhichClipboard != kGlobalClipboard) { return NS_ERROR_NOT_IMPLEMENTED; } // Retrieve the union of all aHasType in aFlavorList for (uint32_t i = 0; i < aLength; ++i) { - const char *flavor = aFlavorList[i]; + const char* flavor = aFlavorList[i]; if (!flavor) { continue; } @@ -99,13 +99,13 @@ HeadlessClipboard::HasDataMatchingFlavors(const char **aFlavorList, } NS_IMETHODIMP -HeadlessClipboard::SupportsSelectionClipboard(bool *aIsSupported) { +HeadlessClipboard::SupportsSelectionClipboard(bool* aIsSupported) { *aIsSupported = false; return NS_OK; } NS_IMETHODIMP -HeadlessClipboard::SupportsFindClipboard(bool *_retval) { +HeadlessClipboard::SupportsFindClipboard(bool* _retval) { NS_ENSURE_ARG_POINTER(_retval); *_retval = false; diff --git a/widget/headless/HeadlessLookAndFeel.h b/widget/headless/HeadlessLookAndFeel.h index c572cd966e60b..b9cde0b7b9887 100644 --- a/widget/headless/HeadlessLookAndFeel.h +++ b/widget/headless/HeadlessLookAndFeel.h @@ -23,12 +23,12 @@ class HeadlessLookAndFeel : public nsXPLookAndFeel { HeadlessLookAndFeel(); virtual ~HeadlessLookAndFeel(); - virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult) override; + virtual nsresult NativeGetColor(ColorID aID, nscolor& aResult) override; void NativeInit() final{}; - virtual nsresult GetIntImpl(IntID aID, int32_t &aResult) override; - virtual nsresult GetFloatImpl(FloatID aID, float &aResult) override; - virtual bool GetFontImpl(FontID aID, nsString &aFontName, - gfxFontStyle &aFontStyle) override; + virtual nsresult GetIntImpl(IntID aID, int32_t& aResult) override; + virtual nsresult GetFloatImpl(FloatID aID, float& aResult) override; + virtual bool GetFontImpl(FontID aID, nsString& aFontName, + gfxFontStyle& aFontStyle) override; virtual void RefreshImpl() override; virtual char16_t GetPasswordCharacterImpl() override; diff --git a/widget/headless/HeadlessSound.cpp b/widget/headless/HeadlessSound.cpp index ab0f7cd0ce4f3..537b4fdfd89a6 100644 --- a/widget/headless/HeadlessSound.cpp +++ b/widget/headless/HeadlessSound.cpp @@ -18,17 +18,17 @@ HeadlessSound::~HeadlessSound() {} NS_IMETHODIMP HeadlessSound::Init() { return NS_OK; } -NS_IMETHODIMP HeadlessSound::OnStreamComplete(nsIStreamLoader *aLoader, - nsISupports *context, +NS_IMETHODIMP HeadlessSound::OnStreamComplete(nsIStreamLoader* aLoader, + nsISupports* context, nsresult aStatus, uint32_t dataLen, - const uint8_t *data) { + const uint8_t* data) { return NS_OK; } NS_IMETHODIMP HeadlessSound::Beep() { return NS_OK; } -NS_IMETHODIMP HeadlessSound::Play(nsIURL *aURL) { return NS_OK; } +NS_IMETHODIMP HeadlessSound::Play(nsIURL* aURL) { return NS_OK; } NS_IMETHODIMP HeadlessSound::PlayEventSound(uint32_t aEventId) { return NS_OK; } diff --git a/widget/nsAppShellSingleton.h b/widget/nsAppShellSingleton.h index 71b3a23e7241b..665cdba5b044f 100644 --- a/widget/nsAppShellSingleton.h +++ b/widget/nsAppShellSingleton.h @@ -29,7 +29,7 @@ #include "nsXULAppAPI.h" -static nsIAppShell *sAppShell; +static nsIAppShell* sAppShell; static nsresult nsAppShellInit() { NS_ASSERTION(!sAppShell, "already initialized"); @@ -39,7 +39,7 @@ static nsresult nsAppShellInit() { NS_ADDREF(sAppShell); nsresult rv; - rv = static_cast(sAppShell)->Init(); + rv = static_cast(sAppShell)->Init(); if (NS_FAILED(rv)) { NS_RELEASE(sAppShell); return rv; @@ -50,8 +50,8 @@ static nsresult nsAppShellInit() { static void nsAppShellShutdown() { NS_RELEASE(sAppShell); } -nsresult nsAppShellConstructor(nsISupports *outer, const nsIID &iid, - void **result) { +nsresult nsAppShellConstructor(nsISupports* outer, const nsIID& iid, + void** result) { NS_ENSURE_TRUE(!outer, NS_ERROR_NO_AGGREGATION); NS_ENSURE_TRUE(sAppShell, NS_ERROR_NOT_INITIALIZED); diff --git a/widget/nsBaseAppShell.cpp b/widget/nsBaseAppShell.cpp index 4f248ae1077af..c312a0b1da61d 100644 --- a/widget/nsBaseAppShell.cpp +++ b/widget/nsBaseAppShell.cpp @@ -71,7 +71,7 @@ void nsBaseAppShell::NativeEventCallback() { // nsBaseAppShell::Run is not being used to pump events, so this may be // our only opportunity to process pending gecko events. - nsIThread *thread = NS_GetCurrentThread(); + nsIThread* thread = NS_GetCurrentThread(); bool prevBlockNativeEvent = mBlockNativeEvent; if (mEventloopNestingState == eEventloopOther) { if (!NS_HasPendingEvents(thread)) return; @@ -132,7 +132,7 @@ nsBaseAppShell::Run(void) { NS_ENSURE_STATE(!mRunning); // should not call Run twice mRunning = true; - nsIThread *thread = NS_GetCurrentThread(); + nsIThread* thread = NS_GetCurrentThread(); MessageLoop::current()->Run(); @@ -179,7 +179,7 @@ nsBaseAppShell::ResumeNative() { } NS_IMETHODIMP -nsBaseAppShell::GetEventloopNestingLevel(uint32_t *aNestingLevelResult) { +nsBaseAppShell::GetEventloopNestingLevel(uint32_t* aNestingLevelResult) { NS_ENSURE_ARG_POINTER(aNestingLevelResult); *aNestingLevelResult = mEventloopNestingLevel; @@ -204,7 +204,7 @@ nsBaseAppShell::OnDispatchedEvent() { // Called from the main thread NS_IMETHODIMP -nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal *thr, bool mayWait) { +nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal* thr, bool mayWait) { if (mBlockNativeEvent) { if (!mayWait) return NS_OK; // Hmm, we're in a nested native event loop and would like to get @@ -222,7 +222,7 @@ nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal *thr, bool mayWait) { // Unblock outer nested wait loop (below). if (mBlockedWait) *mBlockedWait = false; - bool *oldBlockedWait = mBlockedWait; + bool* oldBlockedWait = mBlockedWait; mBlockedWait = &mayWait; // When mayWait is true, we need to make sure that there is an event in the @@ -271,7 +271,7 @@ nsBaseAppShell::OnProcessNextEvent(nsIThreadInternal *thr, bool mayWait) { return NS_OK; } -bool nsBaseAppShell::DispatchDummyEvent(nsIThread *aTarget) { +bool nsBaseAppShell::DispatchDummyEvent(nsIThread* aTarget) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); if (!mDummyEvent) mDummyEvent = new mozilla::Runnable("DummyEvent"); @@ -291,14 +291,14 @@ void nsBaseAppShell::DecrementEventloopNestingLevel() { // Called from the main thread NS_IMETHODIMP -nsBaseAppShell::AfterProcessNextEvent(nsIThreadInternal *thr, +nsBaseAppShell::AfterProcessNextEvent(nsIThreadInternal* thr, bool eventWasProcessed) { return NS_OK; } NS_IMETHODIMP -nsBaseAppShell::Observe(nsISupports *subject, const char *topic, - const char16_t *data) { +nsBaseAppShell::Observe(nsISupports* subject, const char* topic, + const char16_t* data) { NS_ASSERTION(!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID), "oops"); Exit(); return NS_OK; diff --git a/widget/nsBaseScreen.cpp b/widget/nsBaseScreen.cpp index e3f42aa755768..72044b59a289c 100644 --- a/widget/nsBaseScreen.cpp +++ b/widget/nsBaseScreen.cpp @@ -16,31 +16,31 @@ nsBaseScreen::nsBaseScreen() {} nsBaseScreen::~nsBaseScreen() {} NS_IMETHODIMP -nsBaseScreen::GetRectDisplayPix(int32_t *outLeft, int32_t *outTop, - int32_t *outWidth, int32_t *outHeight) { +nsBaseScreen::GetRectDisplayPix(int32_t* outLeft, int32_t* outTop, + int32_t* outWidth, int32_t* outHeight) { return GetRect(outLeft, outTop, outWidth, outHeight); } NS_IMETHODIMP -nsBaseScreen::GetAvailRectDisplayPix(int32_t *outLeft, int32_t *outTop, - int32_t *outWidth, int32_t *outHeight) { +nsBaseScreen::GetAvailRectDisplayPix(int32_t* outLeft, int32_t* outTop, + int32_t* outWidth, int32_t* outHeight) { return GetAvailRect(outLeft, outTop, outWidth, outHeight); } NS_IMETHODIMP -nsBaseScreen::GetContentsScaleFactor(double *aContentsScaleFactor) { +nsBaseScreen::GetContentsScaleFactor(double* aContentsScaleFactor) { *aContentsScaleFactor = 1.0; return NS_OK; } NS_IMETHODIMP -nsBaseScreen::GetDefaultCSSScaleFactor(double *aScaleFactor) { +nsBaseScreen::GetDefaultCSSScaleFactor(double* aScaleFactor) { *aScaleFactor = 1.0; return NS_OK; } NS_IMETHODIMP -nsBaseScreen::GetDpi(float *aDPI) { +nsBaseScreen::GetDpi(float* aDPI) { *aDPI = 96; return NS_OK; } diff --git a/widget/nsBaseScreen.h b/widget/nsBaseScreen.h index 7d68c0806091e..31588947548fe 100644 --- a/widget/nsBaseScreen.h +++ b/widget/nsBaseScreen.h @@ -22,17 +22,17 @@ class nsBaseScreen : public nsIScreen { // These simply forward to the device-pixel versions; // implementations where desktop pixels may not correspond // to per-screen device pixels must override. - NS_IMETHOD GetRectDisplayPix(int32_t *outLeft, int32_t *outTop, - int32_t *outWidth, int32_t *outHeight) override; - NS_IMETHOD GetAvailRectDisplayPix(int32_t *outLeft, int32_t *outTop, - int32_t *outWidth, - int32_t *outHeight) override; + NS_IMETHOD GetRectDisplayPix(int32_t* outLeft, int32_t* outTop, + int32_t* outWidth, int32_t* outHeight) override; + NS_IMETHOD GetAvailRectDisplayPix(int32_t* outLeft, int32_t* outTop, + int32_t* outWidth, + int32_t* outHeight) override; - NS_IMETHOD GetContentsScaleFactor(double *aContentsScaleFactor) override; + NS_IMETHOD GetContentsScaleFactor(double* aContentsScaleFactor) override; - NS_IMETHOD GetDefaultCSSScaleFactor(double *aScaleFactor) override; + NS_IMETHOD GetDefaultCSSScaleFactor(double* aScaleFactor) override; - NS_IMETHOD GetDpi(float *aDPI) override; + NS_IMETHOD GetDpi(float* aDPI) override; protected: virtual ~nsBaseScreen(); diff --git a/widget/nsHTMLFormatConverter.cpp b/widget/nsHTMLFormatConverter.cpp index d44c8adb6f7a1..608f2bcc35d05 100644 --- a/widget/nsHTMLFormatConverter.cpp +++ b/widget/nsHTMLFormatConverter.cpp @@ -32,7 +32,7 @@ NS_IMPL_ISUPPORTS(nsHTMLFormatConverter, nsIFormatConverter) // knows how to import. In this case, it's just HTML. // NS_IMETHODIMP -nsHTMLFormatConverter::GetInputDataFlavors(nsTArray &aFlavors) { +nsHTMLFormatConverter::GetInputDataFlavors(nsTArray& aFlavors) { aFlavors.AppendElement(NS_LITERAL_CSTRING(kHTMLMime)); return NS_OK; } @@ -45,7 +45,7 @@ nsHTMLFormatConverter::GetInputDataFlavors(nsTArray &aFlavors) { // HTML can be converted to. // NS_IMETHODIMP -nsHTMLFormatConverter::GetOutputDataFlavors(nsTArray &aFlavors) { +nsHTMLFormatConverter::GetOutputDataFlavors(nsTArray& aFlavors) { aFlavors.AppendElement(NS_LITERAL_CSTRING(kHTMLMime)); aFlavors.AppendElement(NS_LITERAL_CSTRING(kUnicodeMime)); return NS_OK; @@ -58,8 +58,8 @@ nsHTMLFormatConverter::GetOutputDataFlavors(nsTArray &aFlavors) { // converts from HTML to others. // NS_IMETHODIMP -nsHTMLFormatConverter::CanConvert(const char *aFromDataFlavor, - const char *aToDataFlavor, bool *_retval) { +nsHTMLFormatConverter::CanConvert(const char* aFromDataFlavor, + const char* aToDataFlavor, bool* _retval) { if (!_retval) return NS_ERROR_INVALID_ARG; *_retval = false; @@ -96,10 +96,10 @@ nsHTMLFormatConverter::CanConvert(const char *aFromDataFlavor, // XXX unicode out of the string. Lame lame lame. // NS_IMETHODIMP -nsHTMLFormatConverter::Convert(const char *aFromDataFlavor, - nsISupports *aFromData, - const char *aToDataFlavor, - nsISupports **aToData) { +nsHTMLFormatConverter::Convert(const char* aFromDataFlavor, + nsISupports* aFromData, + const char* aToDataFlavor, + nsISupports** aToData) { if (!aToData) return NS_ERROR_INVALID_ARG; nsresult rv = NS_OK; @@ -162,8 +162,8 @@ nsHTMLFormatConverter::Convert(const char *aFromDataFlavor, // Takes HTML and converts it to plain text but in unicode. // NS_IMETHODIMP -nsHTMLFormatConverter::ConvertFromHTMLToUnicode(const nsAutoString &aFromStr, - nsAutoString &aToStr) { +nsHTMLFormatConverter::ConvertFromHTMLToUnicode(const nsAutoString& aFromStr, + nsAutoString& aToStr) { return nsContentUtils::ConvertToPlainText( aFromStr, aToStr, nsIDocumentEncoder::OutputSelectionOnly | @@ -174,8 +174,8 @@ nsHTMLFormatConverter::ConvertFromHTMLToUnicode(const nsAutoString &aFromStr, } // ConvertFromHTMLToUnicode NS_IMETHODIMP -nsHTMLFormatConverter::ConvertFromHTMLToAOLMail(const nsAutoString &aFromStr, - nsAutoString &aToStr) { +nsHTMLFormatConverter::ConvertFromHTMLToAOLMail(const nsAutoString& aFromStr, + nsAutoString& aToStr) { aToStr.AssignLiteral(""); aToStr.Append(aFromStr); aToStr.AppendLiteral(""); diff --git a/widget/nsIPrintDialogService.h b/widget/nsIPrintDialogService.h index 502a0918b4371..2821de46b12b3 100644 --- a/widget/nsIPrintDialogService.h +++ b/widget/nsIPrintDialogService.h @@ -49,8 +49,8 @@ class nsIPrintDialogService : public nsISupports { * @return NS_ERROR_ABORT if the user indicated not to proceed * @return a suitable error for failures to show the print dialog. */ - NS_IMETHOD Show(nsPIDOMWindowOuter *aParent, nsIPrintSettings *aSettings, - nsIWebBrowserPrint *aWebBrowserPrint) = 0; + NS_IMETHOD Show(nsPIDOMWindowOuter* aParent, nsIPrintSettings* aSettings, + nsIWebBrowserPrint* aWebBrowserPrint) = 0; /** * Show the page setup dialog. Note that there is no way to tell whether the @@ -62,8 +62,8 @@ class nsIPrintDialogService : public nsISupports { * @return NS_OK if everything is OK. * @return a suitable error for failures to show the page setup dialog. */ - NS_IMETHOD ShowPageSetup(nsPIDOMWindowOuter *aParent, - nsIPrintSettings *aSettings) = 0; + NS_IMETHOD ShowPageSetup(nsPIDOMWindowOuter* aParent, + nsIPrintSettings* aSettings) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrintDialogService, NS_IPRINTDIALOGSERVICE_IID) diff --git a/widget/nsPrintSettingsImpl.cpp b/widget/nsPrintSettingsImpl.cpp index 9d42fc2a1821b..8fcc595821e0c 100644 --- a/widget/nsPrintSettingsImpl.cpp +++ b/widget/nsPrintSettingsImpl.cpp @@ -60,12 +60,12 @@ nsPrintSettings::nsPrintSettings() mFooterStrs[2].AssignLiteral("&D"); } -nsPrintSettings::nsPrintSettings(const nsPrintSettings &aPS) { *this = aPS; } +nsPrintSettings::nsPrintSettings(const nsPrintSettings& aPS) { *this = aPS; } nsPrintSettings::~nsPrintSettings() {} NS_IMETHODIMP nsPrintSettings::GetPrintSession( - nsIPrintSession **aPrintSession) { + nsIPrintSession** aPrintSession) { NS_ENSURE_ARG_POINTER(aPrintSession); *aPrintSession = nullptr; @@ -75,7 +75,7 @@ NS_IMETHODIMP nsPrintSettings::GetPrintSession( NS_ADDREF(*aPrintSession); return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetPrintSession(nsIPrintSession *aPrintSession) { +NS_IMETHODIMP nsPrintSettings::SetPrintSession(nsIPrintSession* aPrintSession) { // Clearing it by passing nullptr is not allowed. That's why we // use a weak ref so that it doesn't have to be cleared. NS_ENSURE_ARG(aPrintSession); @@ -90,7 +90,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintSession(nsIPrintSession *aPrintSession) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetStartPageRange(int32_t *aStartPageRange) { +NS_IMETHODIMP nsPrintSettings::GetStartPageRange(int32_t* aStartPageRange) { // NS_ENSURE_ARG_POINTER(aStartPageRange); *aStartPageRange = mStartPageNum; return NS_OK; @@ -100,7 +100,7 @@ NS_IMETHODIMP nsPrintSettings::SetStartPageRange(int32_t aStartPageRange) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetEndPageRange(int32_t *aEndPageRange) { +NS_IMETHODIMP nsPrintSettings::GetEndPageRange(int32_t* aEndPageRange) { // NS_ENSURE_ARG_POINTER(aEndPageRange); *aEndPageRange = mEndPageNum; return NS_OK; @@ -110,7 +110,7 @@ NS_IMETHODIMP nsPrintSettings::SetEndPageRange(int32_t aEndPageRange) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintReversed(bool *aPrintReversed) { +NS_IMETHODIMP nsPrintSettings::GetPrintReversed(bool* aPrintReversed) { // NS_ENSURE_ARG_POINTER(aPrintReversed); *aPrintReversed = mPrintReversed; return NS_OK; @@ -120,7 +120,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintReversed(bool aPrintReversed) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintInColor(bool *aPrintInColor) { +NS_IMETHODIMP nsPrintSettings::GetPrintInColor(bool* aPrintInColor) { // NS_ENSURE_ARG_POINTER(aPrintInColor); *aPrintInColor = mPrintInColor; return NS_OK; @@ -130,7 +130,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintInColor(bool aPrintInColor) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetOrientation(int32_t *aOrientation) { +NS_IMETHODIMP nsPrintSettings::GetOrientation(int32_t* aOrientation) { NS_ENSURE_ARG_POINTER(aOrientation); *aOrientation = mOrientation; return NS_OK; @@ -140,7 +140,7 @@ NS_IMETHODIMP nsPrintSettings::SetOrientation(int32_t aOrientation) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetResolution(int32_t *aResolution) { +NS_IMETHODIMP nsPrintSettings::GetResolution(int32_t* aResolution) { NS_ENSURE_ARG_POINTER(aResolution); *aResolution = mResolution; return NS_OK; @@ -150,7 +150,7 @@ NS_IMETHODIMP nsPrintSettings::SetResolution(const int32_t aResolution) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetDuplex(int32_t *aDuplex) { +NS_IMETHODIMP nsPrintSettings::GetDuplex(int32_t* aDuplex) { NS_ENSURE_ARG_POINTER(aDuplex); *aDuplex = mDuplex; return NS_OK; @@ -160,12 +160,12 @@ NS_IMETHODIMP nsPrintSettings::SetDuplex(const int32_t aDuplex) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrinterName(nsAString &aPrinter) { +NS_IMETHODIMP nsPrintSettings::GetPrinterName(nsAString& aPrinter) { aPrinter = mPrinter; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetPrinterName(const nsAString &aPrinter) { +NS_IMETHODIMP nsPrintSettings::SetPrinterName(const nsAString& aPrinter) { if (!mPrinter.Equals(aPrinter)) { mIsInitedFromPrinter = false; mIsInitedFromPrefs = false; @@ -175,7 +175,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrinterName(const nsAString &aPrinter) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetNumCopies(int32_t *aNumCopies) { +NS_IMETHODIMP nsPrintSettings::GetNumCopies(int32_t* aNumCopies) { NS_ENSURE_ARG_POINTER(aNumCopies); *aNumCopies = mNumCopies; return NS_OK; @@ -185,7 +185,7 @@ NS_IMETHODIMP nsPrintSettings::SetNumCopies(int32_t aNumCopies) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintToFile(bool *aPrintToFile) { +NS_IMETHODIMP nsPrintSettings::GetPrintToFile(bool* aPrintToFile) { // NS_ENSURE_ARG_POINTER(aPrintToFile); *aPrintToFile = mPrintToFile; return NS_OK; @@ -195,16 +195,16 @@ NS_IMETHODIMP nsPrintSettings::SetPrintToFile(bool aPrintToFile) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetToFileName(nsAString &aToFileName) { +NS_IMETHODIMP nsPrintSettings::GetToFileName(nsAString& aToFileName) { aToFileName = mToFileName; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetToFileName(const nsAString &aToFileName) { +NS_IMETHODIMP nsPrintSettings::SetToFileName(const nsAString& aToFileName) { mToFileName = aToFileName; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetOutputFormat(int16_t *aOutputFormat) { +NS_IMETHODIMP nsPrintSettings::GetOutputFormat(int16_t* aOutputFormat) { NS_ENSURE_ARG_POINTER(aOutputFormat); *aOutputFormat = mOutputFormat; return NS_OK; @@ -214,7 +214,7 @@ NS_IMETHODIMP nsPrintSettings::SetOutputFormat(int16_t aOutputFormat) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintPageDelay(int32_t *aPrintPageDelay) { +NS_IMETHODIMP nsPrintSettings::GetPrintPageDelay(int32_t* aPrintPageDelay) { *aPrintPageDelay = mPrintPageDelay; return NS_OK; } @@ -224,7 +224,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintPageDelay(int32_t aPrintPageDelay) { } NS_IMETHODIMP nsPrintSettings::GetIsInitializedFromPrinter( - bool *aIsInitializedFromPrinter) { + bool* aIsInitializedFromPrinter) { NS_ENSURE_ARG_POINTER(aIsInitializedFromPrinter); *aIsInitializedFromPrinter = (bool)mIsInitedFromPrinter; return NS_OK; @@ -236,7 +236,7 @@ NS_IMETHODIMP nsPrintSettings::SetIsInitializedFromPrinter( } NS_IMETHODIMP nsPrintSettings::GetIsInitializedFromPrefs( - bool *aInitializedFromPrefs) { + bool* aInitializedFromPrefs) { NS_ENSURE_ARG_POINTER(aInitializedFromPrefs); *aInitializedFromPrefs = (bool)mIsInitedFromPrefs; return NS_OK; @@ -247,7 +247,7 @@ NS_IMETHODIMP nsPrintSettings::SetIsInitializedFromPrefs( return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetMarginTop(double *aMarginTop) { +NS_IMETHODIMP nsPrintSettings::GetMarginTop(double* aMarginTop) { NS_ENSURE_ARG_POINTER(aMarginTop); *aMarginTop = NS_TWIPS_TO_INCHES(mMargin.top); return NS_OK; @@ -257,7 +257,7 @@ NS_IMETHODIMP nsPrintSettings::SetMarginTop(double aMarginTop) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetMarginLeft(double *aMarginLeft) { +NS_IMETHODIMP nsPrintSettings::GetMarginLeft(double* aMarginLeft) { NS_ENSURE_ARG_POINTER(aMarginLeft); *aMarginLeft = NS_TWIPS_TO_INCHES(mMargin.left); return NS_OK; @@ -267,7 +267,7 @@ NS_IMETHODIMP nsPrintSettings::SetMarginLeft(double aMarginLeft) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetMarginBottom(double *aMarginBottom) { +NS_IMETHODIMP nsPrintSettings::GetMarginBottom(double* aMarginBottom) { NS_ENSURE_ARG_POINTER(aMarginBottom); *aMarginBottom = NS_TWIPS_TO_INCHES(mMargin.bottom); return NS_OK; @@ -277,7 +277,7 @@ NS_IMETHODIMP nsPrintSettings::SetMarginBottom(double aMarginBottom) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetMarginRight(double *aMarginRight) { +NS_IMETHODIMP nsPrintSettings::GetMarginRight(double* aMarginRight) { NS_ENSURE_ARG_POINTER(aMarginRight); *aMarginRight = NS_TWIPS_TO_INCHES(mMargin.right); return NS_OK; @@ -287,7 +287,7 @@ NS_IMETHODIMP nsPrintSettings::SetMarginRight(double aMarginRight) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetEdgeTop(double *aEdgeTop) { +NS_IMETHODIMP nsPrintSettings::GetEdgeTop(double* aEdgeTop) { NS_ENSURE_ARG_POINTER(aEdgeTop); *aEdgeTop = NS_TWIPS_TO_INCHES(mEdge.top); return NS_OK; @@ -297,7 +297,7 @@ NS_IMETHODIMP nsPrintSettings::SetEdgeTop(double aEdgeTop) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetEdgeLeft(double *aEdgeLeft) { +NS_IMETHODIMP nsPrintSettings::GetEdgeLeft(double* aEdgeLeft) { NS_ENSURE_ARG_POINTER(aEdgeLeft); *aEdgeLeft = NS_TWIPS_TO_INCHES(mEdge.left); return NS_OK; @@ -307,7 +307,7 @@ NS_IMETHODIMP nsPrintSettings::SetEdgeLeft(double aEdgeLeft) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetEdgeBottom(double *aEdgeBottom) { +NS_IMETHODIMP nsPrintSettings::GetEdgeBottom(double* aEdgeBottom) { NS_ENSURE_ARG_POINTER(aEdgeBottom); *aEdgeBottom = NS_TWIPS_TO_INCHES(mEdge.bottom); return NS_OK; @@ -317,7 +317,7 @@ NS_IMETHODIMP nsPrintSettings::SetEdgeBottom(double aEdgeBottom) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetEdgeRight(double *aEdgeRight) { +NS_IMETHODIMP nsPrintSettings::GetEdgeRight(double* aEdgeRight) { NS_ENSURE_ARG_POINTER(aEdgeRight); *aEdgeRight = NS_TWIPS_TO_INCHES(mEdge.right); return NS_OK; @@ -328,7 +328,7 @@ NS_IMETHODIMP nsPrintSettings::SetEdgeRight(double aEdgeRight) { } NS_IMETHODIMP nsPrintSettings::GetUnwriteableMarginTop( - double *aUnwriteableMarginTop) { + double* aUnwriteableMarginTop) { NS_ENSURE_ARG_POINTER(aUnwriteableMarginTop); *aUnwriteableMarginTop = NS_TWIPS_TO_INCHES(mUnwriteableMargin.top); return NS_OK; @@ -342,7 +342,7 @@ NS_IMETHODIMP nsPrintSettings::SetUnwriteableMarginTop( } NS_IMETHODIMP nsPrintSettings::GetUnwriteableMarginLeft( - double *aUnwriteableMarginLeft) { + double* aUnwriteableMarginLeft) { NS_ENSURE_ARG_POINTER(aUnwriteableMarginLeft); *aUnwriteableMarginLeft = NS_TWIPS_TO_INCHES(mUnwriteableMargin.left); return NS_OK; @@ -356,7 +356,7 @@ NS_IMETHODIMP nsPrintSettings::SetUnwriteableMarginLeft( } NS_IMETHODIMP nsPrintSettings::GetUnwriteableMarginBottom( - double *aUnwriteableMarginBottom) { + double* aUnwriteableMarginBottom) { NS_ENSURE_ARG_POINTER(aUnwriteableMarginBottom); *aUnwriteableMarginBottom = NS_TWIPS_TO_INCHES(mUnwriteableMargin.bottom); return NS_OK; @@ -371,7 +371,7 @@ NS_IMETHODIMP nsPrintSettings::SetUnwriteableMarginBottom( } NS_IMETHODIMP nsPrintSettings::GetUnwriteableMarginRight( - double *aUnwriteableMarginRight) { + double* aUnwriteableMarginRight) { NS_ENSURE_ARG_POINTER(aUnwriteableMarginRight); *aUnwriteableMarginRight = NS_TWIPS_TO_INCHES(mUnwriteableMargin.right); return NS_OK; @@ -384,7 +384,7 @@ NS_IMETHODIMP nsPrintSettings::SetUnwriteableMarginRight( return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetScaling(double *aScaling) { +NS_IMETHODIMP nsPrintSettings::GetScaling(double* aScaling) { NS_ENSURE_ARG_POINTER(aScaling); *aScaling = mScaling; return NS_OK; @@ -395,7 +395,7 @@ NS_IMETHODIMP nsPrintSettings::SetScaling(double aScaling) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintBGColors(bool *aPrintBGColors) { +NS_IMETHODIMP nsPrintSettings::GetPrintBGColors(bool* aPrintBGColors) { NS_ENSURE_ARG_POINTER(aPrintBGColors); *aPrintBGColors = mPrintBGColors; return NS_OK; @@ -405,7 +405,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintBGColors(bool aPrintBGColors) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintBGImages(bool *aPrintBGImages) { +NS_IMETHODIMP nsPrintSettings::GetPrintBGImages(bool* aPrintBGImages) { NS_ENSURE_ARG_POINTER(aPrintBGImages); *aPrintBGImages = mPrintBGImages; return NS_OK; @@ -415,7 +415,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintBGImages(bool aPrintBGImages) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintRange(int16_t *aPrintRange) { +NS_IMETHODIMP nsPrintSettings::GetPrintRange(int16_t* aPrintRange) { NS_ENSURE_ARG_POINTER(aPrintRange); *aPrintRange = mPrintRange; return NS_OK; @@ -425,20 +425,20 @@ NS_IMETHODIMP nsPrintSettings::SetPrintRange(int16_t aPrintRange) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetTitle(nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::GetTitle(nsAString& aTitle) { aTitle = mTitle; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetTitle(const nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::SetTitle(const nsAString& aTitle) { mTitle = aTitle; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetDocURL(nsAString &aDocURL) { +NS_IMETHODIMP nsPrintSettings::GetDocURL(nsAString& aDocURL) { aDocURL = mURL; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetDocURL(const nsAString &aDocURL) { +NS_IMETHODIMP nsPrintSettings::SetDocURL(const nsAString& aDocURL) { mURL = aDocURL; return NS_OK; } @@ -448,7 +448,7 @@ NS_IMETHODIMP nsPrintSettings::SetDocURL(const nsAString &aDocURL) { * @update 1/12/01 rods */ NS_IMETHODIMP -nsPrintSettings::GetPrintOptions(int32_t aType, bool *aTurnOnOff) { +nsPrintSettings::GetPrintOptions(int32_t aType, bool* aTurnOnOff) { NS_ENSURE_ARG_POINTER(aTurnOnOff); *aTurnOnOff = mPrintOptions & aType ? true : false; return NS_OK; @@ -472,7 +472,7 @@ nsPrintSettings::SetPrintOptions(int32_t aType, bool aTurnOnOff) { * @update 1/12/01 rods */ NS_IMETHODIMP -nsPrintSettings::GetPrintOptionsBits(int32_t *aBits) { +nsPrintSettings::GetPrintOptionsBits(int32_t* aBits) { NS_ENSURE_ARG_POINTER(aBits); *aBits = mPrintOptions; return NS_OK; @@ -484,62 +484,62 @@ nsPrintSettings::SetPrintOptionsBits(int32_t aBits) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetHeaderStrLeft(nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::GetHeaderStrLeft(nsAString& aTitle) { aTitle = mHeaderStrs[0]; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetHeaderStrLeft(const nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::SetHeaderStrLeft(const nsAString& aTitle) { mHeaderStrs[0] = aTitle; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetHeaderStrCenter(nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::GetHeaderStrCenter(nsAString& aTitle) { aTitle = mHeaderStrs[1]; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetHeaderStrCenter(const nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::SetHeaderStrCenter(const nsAString& aTitle) { mHeaderStrs[1] = aTitle; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetHeaderStrRight(nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::GetHeaderStrRight(nsAString& aTitle) { aTitle = mHeaderStrs[2]; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetHeaderStrRight(const nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::SetHeaderStrRight(const nsAString& aTitle) { mHeaderStrs[2] = aTitle; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetFooterStrLeft(nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::GetFooterStrLeft(nsAString& aTitle) { aTitle = mFooterStrs[0]; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetFooterStrLeft(const nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::SetFooterStrLeft(const nsAString& aTitle) { mFooterStrs[0] = aTitle; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetFooterStrCenter(nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::GetFooterStrCenter(nsAString& aTitle) { aTitle = mFooterStrs[1]; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetFooterStrCenter(const nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::SetFooterStrCenter(const nsAString& aTitle) { mFooterStrs[1] = aTitle; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetFooterStrRight(nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::GetFooterStrRight(nsAString& aTitle) { aTitle = mFooterStrs[2]; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetFooterStrRight(const nsAString &aTitle) { +NS_IMETHODIMP nsPrintSettings::SetFooterStrRight(const nsAString& aTitle) { mFooterStrs[2] = aTitle; return NS_OK; } NS_IMETHODIMP nsPrintSettings::GetPrintFrameTypeUsage( - int16_t *aPrintFrameTypeUsage) { + int16_t* aPrintFrameTypeUsage) { NS_ENSURE_ARG_POINTER(aPrintFrameTypeUsage); *aPrintFrameTypeUsage = mPrintFrameTypeUsage; return NS_OK; @@ -550,7 +550,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintFrameTypeUsage( return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintFrameType(int16_t *aPrintFrameType) { +NS_IMETHODIMP nsPrintSettings::GetPrintFrameType(int16_t* aPrintFrameType) { NS_ENSURE_ARG_POINTER(aPrintFrameType); *aPrintFrameType = (int32_t)mPrintFrameType; return NS_OK; @@ -560,7 +560,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintFrameType(int16_t aPrintFrameType) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPrintSilent(bool *aPrintSilent) { +NS_IMETHODIMP nsPrintSettings::GetPrintSilent(bool* aPrintSilent) { NS_ENSURE_ARG_POINTER(aPrintSilent); *aPrintSilent = mPrintSilent; return NS_OK; @@ -570,7 +570,7 @@ NS_IMETHODIMP nsPrintSettings::SetPrintSilent(bool aPrintSilent) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetShrinkToFit(bool *aShrinkToFit) { +NS_IMETHODIMP nsPrintSettings::GetShrinkToFit(bool* aShrinkToFit) { NS_ENSURE_ARG_POINTER(aShrinkToFit); *aShrinkToFit = mShrinkToFit; return NS_OK; @@ -580,7 +580,7 @@ NS_IMETHODIMP nsPrintSettings::SetShrinkToFit(bool aShrinkToFit) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetShowPrintProgress(bool *aShowPrintProgress) { +NS_IMETHODIMP nsPrintSettings::GetShowPrintProgress(bool* aShowPrintProgress) { NS_ENSURE_ARG_POINTER(aShowPrintProgress); *aShowPrintProgress = mShowPrintProgress; return NS_OK; @@ -590,17 +590,17 @@ NS_IMETHODIMP nsPrintSettings::SetShowPrintProgress(bool aShowPrintProgress) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPaperName(nsAString &aPaperName) { +NS_IMETHODIMP nsPrintSettings::GetPaperName(nsAString& aPaperName) { aPaperName = mPaperName; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::SetPaperName(const nsAString &aPaperName) { +NS_IMETHODIMP nsPrintSettings::SetPaperName(const nsAString& aPaperName) { mPaperName = aPaperName; return NS_OK; } NS_IMETHODIMP nsPrintSettings::GetHowToEnableFrameUI( - int16_t *aHowToEnableFrameUI) { + int16_t* aHowToEnableFrameUI) { NS_ENSURE_ARG_POINTER(aHowToEnableFrameUI); *aHowToEnableFrameUI = mHowToEnableFrameUI; return NS_OK; @@ -611,7 +611,7 @@ NS_IMETHODIMP nsPrintSettings::SetHowToEnableFrameUI( return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetIsCancelled(bool *aIsCancelled) { +NS_IMETHODIMP nsPrintSettings::GetIsCancelled(bool* aIsCancelled) { NS_ENSURE_ARG_POINTER(aIsCancelled); *aIsCancelled = mIsCancelled; return NS_OK; @@ -621,12 +621,12 @@ NS_IMETHODIMP nsPrintSettings::SetIsCancelled(bool aIsCancelled) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetSaveOnCancel(bool *aSaveOnCancel) { +NS_IMETHODIMP nsPrintSettings::GetSaveOnCancel(bool* aSaveOnCancel) { *aSaveOnCancel = mSaveOnCancel; return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPaperWidth(double *aPaperWidth) { +NS_IMETHODIMP nsPrintSettings::GetPaperWidth(double* aPaperWidth) { NS_ENSURE_ARG_POINTER(aPaperWidth); *aPaperWidth = mPaperWidth; return NS_OK; @@ -636,7 +636,7 @@ NS_IMETHODIMP nsPrintSettings::SetPaperWidth(double aPaperWidth) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPaperHeight(double *aPaperHeight) { +NS_IMETHODIMP nsPrintSettings::GetPaperHeight(double* aPaperHeight) { NS_ENSURE_ARG_POINTER(aPaperHeight); *aPaperHeight = mPaperHeight; return NS_OK; @@ -646,7 +646,7 @@ NS_IMETHODIMP nsPrintSettings::SetPaperHeight(double aPaperHeight) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPaperSizeUnit(int16_t *aPaperSizeUnit) { +NS_IMETHODIMP nsPrintSettings::GetPaperSizeUnit(int16_t* aPaperSizeUnit) { NS_ENSURE_ARG_POINTER(aPaperSizeUnit); *aPaperSizeUnit = mPaperSizeUnit; return NS_OK; @@ -656,7 +656,7 @@ NS_IMETHODIMP nsPrintSettings::SetPaperSizeUnit(int16_t aPaperSizeUnit) { return NS_OK; } -NS_IMETHODIMP nsPrintSettings::GetPaperData(int16_t *aPaperData) { +NS_IMETHODIMP nsPrintSettings::GetPaperData(int16_t* aPaperData) { NS_ENSURE_ARG_POINTER(aPaperData); *aPaperData = mPaperData; return NS_OK; @@ -672,13 +672,13 @@ NS_IMETHODIMP nsPrintSettings::SetPaperData(int16_t aPaperData) { * @update 1/12/01 rods */ NS_IMETHODIMP -nsPrintSettings::SetMarginInTwips(nsIntMargin &aMargin) { +nsPrintSettings::SetMarginInTwips(nsIntMargin& aMargin) { mMargin = aMargin; return NS_OK; } NS_IMETHODIMP -nsPrintSettings::SetEdgeInTwips(nsIntMargin &aEdge) { +nsPrintSettings::SetEdgeInTwips(nsIntMargin& aEdge) { mEdge = aEdge; return NS_OK; } @@ -687,7 +687,7 @@ nsPrintSettings::SetEdgeInTwips(nsIntMargin &aEdge) { // to check for negative margin values in aUnwriteableMargin (which // would indicate that we should use the system default unwriteable margin.) NS_IMETHODIMP -nsPrintSettings::SetUnwriteableMarginInTwips(nsIntMargin &aUnwriteableMargin) { +nsPrintSettings::SetUnwriteableMarginInTwips(nsIntMargin& aUnwriteableMargin) { if (aUnwriteableMargin.top >= 0) { mUnwriteableMargin.top = aUnwriteableMargin.top; } @@ -708,19 +708,19 @@ nsPrintSettings::SetUnwriteableMarginInTwips(nsIntMargin &aUnwriteableMargin) { * @update 6/21/00 dwc */ NS_IMETHODIMP -nsPrintSettings::GetMarginInTwips(nsIntMargin &aMargin) { +nsPrintSettings::GetMarginInTwips(nsIntMargin& aMargin) { aMargin = mMargin; return NS_OK; } NS_IMETHODIMP -nsPrintSettings::GetEdgeInTwips(nsIntMargin &aEdge) { +nsPrintSettings::GetEdgeInTwips(nsIntMargin& aEdge) { aEdge = mEdge; return NS_OK; } NS_IMETHODIMP -nsPrintSettings::GetUnwriteableMarginInTwips(nsIntMargin &aUnwriteableMargin) { +nsPrintSettings::GetUnwriteableMarginInTwips(nsIntMargin& aUnwriteableMargin) { aUnwriteableMargin = mUnwriteableMargin; return NS_OK; } @@ -735,7 +735,7 @@ nsPrintSettings::SetupSilentPrinting() { return NS_OK; } * See documentation in nsPrintSettingsService.h */ NS_IMETHODIMP -nsPrintSettings::GetEffectivePageSize(double *aWidth, double *aHeight) { +nsPrintSettings::GetEffectivePageSize(double* aWidth, double* aHeight) { if (mPaperSizeUnit == kPaperSizeInches) { *aWidth = NS_INCHES_TO_TWIPS(float(mPaperWidth)); *aHeight = NS_INCHES_TO_TWIPS(float(mPaperHeight)); @@ -752,37 +752,37 @@ nsPrintSettings::GetEffectivePageSize(double *aWidth, double *aHeight) { } NS_IMETHODIMP -nsPrintSettings::GetPageRanges(nsTArray &aPages) { +nsPrintSettings::GetPageRanges(nsTArray& aPages) { aPages.Clear(); return NS_OK; } -nsresult nsPrintSettings::_Clone(nsIPrintSettings **_retval) { +nsresult nsPrintSettings::_Clone(nsIPrintSettings** _retval) { RefPtr printSettings = new nsPrintSettings(*this); printSettings.forget(_retval); return NS_OK; } NS_IMETHODIMP -nsPrintSettings::Clone(nsIPrintSettings **_retval) { +nsPrintSettings::Clone(nsIPrintSettings** _retval) { NS_ENSURE_ARG_POINTER(_retval); return _Clone(_retval); } -nsresult nsPrintSettings::_Assign(nsIPrintSettings *aPS) { - nsPrintSettings *ps = static_cast(aPS); +nsresult nsPrintSettings::_Assign(nsIPrintSettings* aPS) { + nsPrintSettings* ps = static_cast(aPS); *this = *ps; return NS_OK; } NS_IMETHODIMP -nsPrintSettings::Assign(nsIPrintSettings *aPS) { +nsPrintSettings::Assign(nsIPrintSettings* aPS) { NS_ENSURE_ARG(aPS); return _Assign(aPS); } //------------------------------------------- -nsPrintSettings &nsPrintSettings::operator=(const nsPrintSettings &rhs) { +nsPrintSettings& nsPrintSettings::operator=(const nsPrintSettings& rhs) { if (this == &rhs) { return *this; } diff --git a/widget/nsSoundProxy.cpp b/widget/nsSoundProxy.cpp index 40b9c900cef21..241958dac2950 100644 --- a/widget/nsSoundProxy.cpp +++ b/widget/nsSoundProxy.cpp @@ -14,7 +14,7 @@ using namespace mozilla::dom; NS_IMPL_ISUPPORTS(nsSoundProxy, nsISound) NS_IMETHODIMP -nsSoundProxy::Play(nsIURL *aURL) { +nsSoundProxy::Play(nsIURL* aURL) { MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Content); nsCOMPtr soundURI(aURL); diff --git a/widget/uikit/GfxInfo.h b/widget/uikit/GfxInfo.h index 0e7b7f3a616d1..ab99386ee862b 100644 --- a/widget/uikit/GfxInfo.h +++ b/widget/uikit/GfxInfo.h @@ -31,28 +31,28 @@ class GfxInfo : public GfxInfoBase { // We only declare the subset of nsIGfxInfo that we actually implement. The // rest is brought forward from GfxInfoBase. - NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled) override; - NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled) override; - NS_IMETHOD GetDWriteVersion(nsAString &aDwriteVersion) override; - NS_IMETHOD GetCleartypeParameters(nsAString &aCleartypeParams) override; - NS_IMETHOD GetAdapterDescription(nsAString &aAdapterDescription) override; - NS_IMETHOD GetAdapterDriver(nsAString &aAdapterDriver) override; - NS_IMETHOD GetAdapterVendorID(nsAString &aAdapterVendorID) override; - NS_IMETHOD GetAdapterDeviceID(nsAString &aAdapterDeviceID) override; - NS_IMETHOD GetAdapterSubsysID(nsAString &aAdapterSubsysID) override; - NS_IMETHOD GetAdapterRAM(nsAString &aAdapterRAM) override; - NS_IMETHOD GetAdapterDriverVersion(nsAString &aAdapterDriverVersion) override; - NS_IMETHOD GetAdapterDriverDate(nsAString &aAdapterDriverDate) override; - NS_IMETHOD GetAdapterDescription2(nsAString &aAdapterDescription) override; - NS_IMETHOD GetAdapterDriver2(nsAString &aAdapterDriver) override; - NS_IMETHOD GetAdapterVendorID2(nsAString &aAdapterVendorID) override; - NS_IMETHOD GetAdapterDeviceID2(nsAString &aAdapterDeviceID) override; - NS_IMETHOD GetAdapterSubsysID2(nsAString &aAdapterSubsysID) override; - NS_IMETHOD GetAdapterRAM2(nsAString &aAdapterRAM) override; + NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override; + NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override; + NS_IMETHOD GetDWriteVersion(nsAString& aDwriteVersion) override; + NS_IMETHOD GetCleartypeParameters(nsAString& aCleartypeParams) override; + NS_IMETHOD GetAdapterDescription(nsAString& aAdapterDescription) override; + NS_IMETHOD GetAdapterDriver(nsAString& aAdapterDriver) override; + NS_IMETHOD GetAdapterVendorID(nsAString& aAdapterVendorID) override; + NS_IMETHOD GetAdapterDeviceID(nsAString& aAdapterDeviceID) override; + NS_IMETHOD GetAdapterSubsysID(nsAString& aAdapterSubsysID) override; + NS_IMETHOD GetAdapterRAM(nsAString& aAdapterRAM) override; + NS_IMETHOD GetAdapterDriverVersion(nsAString& aAdapterDriverVersion) override; + NS_IMETHOD GetAdapterDriverDate(nsAString& aAdapterDriverDate) override; + NS_IMETHOD GetAdapterDescription2(nsAString& aAdapterDescription) override; + NS_IMETHOD GetAdapterDriver2(nsAString& aAdapterDriver) override; + NS_IMETHOD GetAdapterVendorID2(nsAString& aAdapterVendorID) override; + NS_IMETHOD GetAdapterDeviceID2(nsAString& aAdapterDeviceID) override; + NS_IMETHOD GetAdapterSubsysID2(nsAString& aAdapterSubsysID) override; + NS_IMETHOD GetAdapterRAM2(nsAString& aAdapterRAM) override; NS_IMETHOD GetAdapterDriverVersion2( - nsAString &aAdapterDriverVersion) override; - NS_IMETHOD GetAdapterDriverDate2(nsAString &aAdapterDriverDate) override; - NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override; + nsAString& aAdapterDriverVersion) override; + NS_IMETHOD GetAdapterDriverDate2(nsAString& aAdapterDriverDate) override; + NS_IMETHOD GetIsGPU2Active(bool* aIsGPU2Active) override; using GfxInfoBase::GetFeatureStatus; using GfxInfoBase::GetFeatureSuggestedDriverVersion; @@ -63,10 +63,10 @@ class GfxInfo : public GfxInfoBase { protected: virtual nsresult GetFeatureStatusImpl( - int32_t aFeature, int32_t *aStatus, nsAString &aSuggestedDriverVersion, - const nsTArray &aDriverInfo, - OperatingSystem *aOS = nullptr); - virtual const nsTArray &GetGfxDriverInfo(); + int32_t aFeature, int32_t* aStatus, nsAString& aSuggestedDriverVersion, + const nsTArray& aDriverInfo, + OperatingSystem* aOS = nullptr); + virtual const nsTArray& GetGfxDriverInfo(); }; } // namespace widget diff --git a/widget/uikit/nsAppShell.mm b/widget/uikit/nsAppShell.mm index 05c698950344d..eae431bc2cc25 100644 --- a/widget/uikit/nsAppShell.mm +++ b/widget/uikit/nsAppShell.mm @@ -22,9 +22,9 @@ #include "nsIInterfaceRequestor.h" #include "nsIWebBrowserChrome.h" -nsAppShell *nsAppShell::gAppShell = NULL; -UIWindow *nsAppShell::gWindow = nil; -NSMutableArray *nsAppShell::gTopLevelViews = [[NSMutableArray alloc] init]; +nsAppShell* nsAppShell::gAppShell = NULL; +UIWindow* nsAppShell::gWindow = nil; +NSMutableArray* nsAppShell::gTopLevelViews = [[NSMutableArray alloc] init]; #define ALOG(args...) \ fprintf(stderr, args); \ @@ -42,7 +42,7 @@ - (void)loadView { self.view = [[UIView alloc] initWithFrame:r]; [self.view setBackgroundColor:[UIColor lightGrayColor]]; // add all of the top level views as children - for (UIView *v in nsAppShell::gTopLevelViews) { + for (UIView* v in nsAppShell::gTopLevelViews) { ALOG("[ViewController.view addSubView:%p]", v); [self.view addSubview:v]; } @@ -57,13 +57,13 @@ - (void)loadView { @interface AppShellDelegate : NSObject { } -@property(strong, nonatomic) UIWindow *window; +@property(strong, nonatomic) UIWindow* window; @end @implementation AppShellDelegate -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { +- (BOOL)application:(UIApplication*)application + didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { ALOG("[AppShellDelegate application:didFinishLaunchingWithOptions:]"); // We only create one window, since we can only display one window at // a time anyway. Also, iOS 4 fails to display UIWindows if you @@ -81,20 +81,20 @@ - (BOOL)application:(UIApplication *)application return YES; } -- (void)applicationWillTerminate:(UIApplication *)application { +- (void)applicationWillTerminate:(UIApplication*)application { ALOG("[AppShellDelegate applicationWillTerminate:]"); nsAppShell::gAppShell->WillTerminate(); } -- (void)applicationDidBecomeActive:(UIApplication *)application { +- (void)applicationDidBecomeActive:(UIApplication*)application { ALOG("[AppShellDelegate applicationDidBecomeActive:]"); } -- (void)applicationWillResignActive:(UIApplication *)application { +- (void)applicationWillResignActive:(UIApplication*)application { ALOG("[AppShellDelegate applicationWillResignActive:]"); } -- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { +- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application { ALOG("[AppShellDelegate applicationDidReceiveMemoryWarning:]"); NS_DispatchMemoryPressure(MemPressure_New); } @@ -165,8 +165,8 @@ - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { // signalled from ScheduleNativeEventCallback. // // protected static -void nsAppShell::ProcessGeckoEvents(void *aInfo) { - nsAppShell *self = static_cast(aInfo); +void nsAppShell::ProcessGeckoEvents(void* aInfo) { + nsAppShell* self = static_cast(aInfo); self->NativeEventCallback(); self->Release(); } @@ -205,10 +205,10 @@ - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { bool nsAppShell::ProcessNextNativeEvent(bool aMayWait) { if (mTerminated) return false; - NSString *currentMode = nil; - NSDate *waitUntil = nil; + NSString* currentMode = nil; + NSDate* waitUntil = nil; if (aMayWait) waitUntil = [NSDate distantFuture]; - NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; + NSRunLoop* currentRunLoop = [NSRunLoop currentRunLoop]; BOOL eventProcessed = NO; do { @@ -231,7 +231,7 @@ - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { nsAppShell::Run(void) { ALOG("nsAppShell::Run"); char argv[1][4] = {"app"}; - UIApplicationMain(1, (char **)argv, nil, @"AppShellDelegate"); + UIApplicationMain(1, (char**)argv, nil, @"AppShellDelegate"); // UIApplicationMain doesn't exit. :-( return NS_OK; } diff --git a/widget/uikit/nsLookAndFeel.h b/widget/uikit/nsLookAndFeel.h index ae12274e3980b..db1021e7a30b2 100644 --- a/widget/uikit/nsLookAndFeel.h +++ b/widget/uikit/nsLookAndFeel.h @@ -15,11 +15,11 @@ class nsLookAndFeel final : public nsXPLookAndFeel { void NativeInit() final; virtual void RefreshImpl(); - virtual nsresult NativeGetColor(const ColorID aID, nscolor &aResult); - virtual nsresult GetIntImpl(IntID aID, int32_t &aResult); - virtual nsresult GetFloatImpl(FloatID aID, float &aResult); - bool GetFontImpl(FontID aID, nsString &aFontName, - gfxFontStyle &aFontStyle) override; + virtual nsresult NativeGetColor(const ColorID aID, nscolor& aResult); + virtual nsresult GetIntImpl(IntID aID, int32_t& aResult); + virtual nsresult GetFloatImpl(FloatID aID, float& aResult); + bool GetFontImpl(FontID aID, nsString& aFontName, + gfxFontStyle& aFontStyle) override; virtual char16_t GetPasswordCharacterImpl() { // unicode value for the bullet character, used for password textfields. return 0x2022; diff --git a/widget/uikit/nsLookAndFeel.mm b/widget/uikit/nsLookAndFeel.mm index e33f432beca20..e972cba76bef9 100644 --- a/widget/uikit/nsLookAndFeel.mm +++ b/widget/uikit/nsLookAndFeel.mm @@ -17,10 +17,10 @@ nsLookAndFeel::~nsLookAndFeel() {} -static nscolor GetColorFromUIColor(UIColor *aColor) { +static nscolor GetColorFromUIColor(UIColor* aColor) { CGColorRef cgColor = [aColor CGColor]; CGColorSpaceModel model = CGColorSpaceGetModel(CGColorGetColorSpace(cgColor)); - const CGFloat *components = CGColorGetComponents(cgColor); + const CGFloat* components = CGColorGetComponents(cgColor); if (model == kCGColorSpaceModelRGB) { return NS_RGB((unsigned int)(components[0] * 255.0), (unsigned int)(components[1] * 255.0), (unsigned int)(components[2] * 255.0)); @@ -40,7 +40,7 @@ static nscolor GetColorFromUIColor(UIColor *aColor) { mInitialized = false; } -nsresult nsLookAndFeel::NativeGetColor(const ColorID aID, nscolor &aResult) { +nsresult nsLookAndFeel::NativeGetColor(const ColorID aID, nscolor& aResult) { EnsureInit(); nsresult res = NS_OK; @@ -257,7 +257,7 @@ static nscolor GetColorFromUIColor(UIColor *aColor) { } NS_IMETHODIMP -nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult) { +nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) { nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult); if (NS_SUCCEEDED(res)) return res; res = NS_OK; @@ -352,7 +352,7 @@ static nscolor GetColorFromUIColor(UIColor *aColor) { } NS_IMETHODIMP -nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult) { +nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) { nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult); if (NS_SUCCEEDED(res)) return res; res = NS_OK; @@ -372,7 +372,7 @@ static nscolor GetColorFromUIColor(UIColor *aColor) { return res; } -bool nsLookAndFeel::GetFontImpl(FontID aID, nsString &aFontName, gfxFontStyle &aFontStyle) { +bool nsLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName, gfxFontStyle& aFontStyle) { // hack for now if (aID == eFont_Window || aID == eFont_Document) { aFontStyle.style = FontSlantStyle::Normal(); diff --git a/widget/uikit/nsScreenManager.mm b/widget/uikit/nsScreenManager.mm index 93a5c375426da..a9ed0f3d66931 100644 --- a/widget/uikit/nsScreenManager.mm +++ b/widget/uikit/nsScreenManager.mm @@ -12,21 +12,21 @@ static LayoutDeviceIntRect gScreenBounds; static bool gScreenBoundsSet = false; -UIKitScreen::UIKitScreen(UIScreen *aScreen) { mScreen = [aScreen retain]; } +UIKitScreen::UIKitScreen(UIScreen* aScreen) { mScreen = [aScreen retain]; } NS_IMETHODIMP -UIKitScreen::GetRect(int32_t *outX, int32_t *outY, int32_t *outWidth, int32_t *outHeight) { +UIKitScreen::GetRect(int32_t* outX, int32_t* outY, int32_t* outWidth, int32_t* outHeight) { return GetRectDisplayPix(outX, outY, outWidth, outHeight); } NS_IMETHODIMP -UIKitScreen::GetAvailRect(int32_t *outX, int32_t *outY, int32_t *outWidth, int32_t *outHeight) { +UIKitScreen::GetAvailRect(int32_t* outX, int32_t* outY, int32_t* outWidth, int32_t* outHeight) { return GetAvailRectDisplayPix(outX, outY, outWidth, outHeight); } NS_IMETHODIMP -UIKitScreen::GetRectDisplayPix(int32_t *outX, int32_t *outY, int32_t *outWidth, - int32_t *outHeight) { +UIKitScreen::GetRectDisplayPix(int32_t* outX, int32_t* outY, int32_t* outWidth, + int32_t* outHeight) { nsIntRect rect = UIKitScreenManager::GetBounds(); *outX = rect.x; *outY = rect.y; @@ -37,8 +37,8 @@ } NS_IMETHODIMP -UIKitScreen::GetAvailRectDisplayPix(int32_t *outX, int32_t *outY, int32_t *outWidth, - int32_t *outHeight) { +UIKitScreen::GetAvailRectDisplayPix(int32_t* outX, int32_t* outY, int32_t* outWidth, + int32_t* outHeight) { CGRect rect = [mScreen applicationFrame]; CGFloat scale = [mScreen scale]; @@ -51,17 +51,17 @@ } NS_IMETHODIMP -UIKitScreen::GetPixelDepth(int32_t *aPixelDepth) { +UIKitScreen::GetPixelDepth(int32_t* aPixelDepth) { // Close enough. *aPixelDepth = 24; return NS_OK; } NS_IMETHODIMP -UIKitScreen::GetColorDepth(int32_t *aColorDepth) { return GetPixelDepth(aColorDepth); } +UIKitScreen::GetColorDepth(int32_t* aColorDepth) { return GetPixelDepth(aColorDepth); } NS_IMETHODIMP -UIKitScreen::GetContentsScaleFactor(double *aContentsScaleFactor) { +UIKitScreen::GetContentsScaleFactor(double* aContentsScaleFactor) { *aContentsScaleFactor = [mScreen scale]; return NS_OK; } @@ -86,13 +86,13 @@ } NS_IMETHODIMP -UIKitScreenManager::GetPrimaryScreen(nsIScreen **outScreen) { +UIKitScreenManager::GetPrimaryScreen(nsIScreen** outScreen) { NS_IF_ADDREF(*outScreen = mScreen.get()); return NS_OK; } NS_IMETHODIMP UIKitScreenManager::ScreenForRect(int32_t inLeft, int32_t inTop, int32_t inWidth, int32_t inHeight, - nsIScreen **outScreen) { + nsIScreen** outScreen) { return GetPrimaryScreen(outScreen); } diff --git a/widget/windows/IEnumFE.cpp b/widget/windows/IEnumFE.cpp index 90920fb189e76..8fe713860964a 100644 --- a/widget/windows/IEnumFE.cpp +++ b/widget/windows/IEnumFE.cpp @@ -10,7 +10,7 @@ CEnumFormatEtc::CEnumFormatEtc() : mRefCnt(0), mCurrentIdx(0) {} // Constructor used by Clone() -CEnumFormatEtc::CEnumFormatEtc(nsTArray &aArray) +CEnumFormatEtc::CEnumFormatEtc(nsTArray& aArray) : mRefCnt(0), mCurrentIdx(0) { // a deep copy, calls FormatEtc's copy constructor on each mFormatList.AppendElements(aArray); @@ -21,7 +21,7 @@ CEnumFormatEtc::~CEnumFormatEtc() {} /* IUnknown impl. */ STDMETHODIMP -CEnumFormatEtc::QueryInterface(REFIID riid, LPVOID *ppv) { +CEnumFormatEtc::QueryInterface(REFIID riid, LPVOID* ppv) { *ppv = nullptr; if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IEnumFORMATETC)) @@ -56,8 +56,8 @@ CEnumFormatEtc::Release() { /* IEnumFORMATETC impl. */ STDMETHODIMP -CEnumFormatEtc::Next(ULONG aMaxToFetch, FORMATETC *aResult, - ULONG *aNumFetched) { +CEnumFormatEtc::Next(ULONG aMaxToFetch, FORMATETC* aResult, + ULONG* aNumFetched) { // If the method retrieves the number of items requested, the return // value is S_OK. Otherwise, it is S_FALSE. @@ -108,12 +108,12 @@ CEnumFormatEtc::Reset(void) { } STDMETHODIMP -CEnumFormatEtc::Clone(LPENUMFORMATETC *aResult) { +CEnumFormatEtc::Clone(LPENUMFORMATETC* aResult) { // Must return a new IEnumFORMATETC interface with the same iterative state. if (!aResult) return E_INVALIDARG; - CEnumFormatEtc *pEnumObj = new CEnumFormatEtc(mFormatList); + CEnumFormatEtc* pEnumObj = new CEnumFormatEtc(mFormatList); if (!pEnumObj) return E_OUTOFMEMORY; @@ -129,7 +129,7 @@ CEnumFormatEtc::Clone(LPENUMFORMATETC *aResult) { void CEnumFormatEtc::AddFormatEtc(LPFORMATETC aFormat) { if (!aFormat) return; - FormatEtc *etc = mFormatList.AppendElement(); + FormatEtc* etc = mFormatList.AppendElement(); // Make a copy of aFormat if (etc) etc->CopyIn(aFormat); } diff --git a/widget/windows/IEnumFE.h b/widget/windows/IEnumFE.h index 02e5bd05dbf68..b8cb6ad9d0379 100644 --- a/widget/windows/IEnumFE.h +++ b/widget/windows/IEnumFE.h @@ -19,19 +19,19 @@ class FormatEtc { public: FormatEtc() { memset(&mFormat, 0, sizeof(FORMATETC)); } - FormatEtc(const FormatEtc ©) { CopyIn(©.mFormat); } + FormatEtc(const FormatEtc& copy) { CopyIn(©.mFormat); } ~FormatEtc() { if (mFormat.ptd) CoTaskMemFree(mFormat.ptd); } - void CopyIn(const FORMATETC *aSrc) { + void CopyIn(const FORMATETC* aSrc) { if (!aSrc) { memset(&mFormat, 0, sizeof(FORMATETC)); return; } mFormat = *aSrc; if (aSrc->ptd) { - mFormat.ptd = (DVTARGETDEVICE *)CoTaskMemAlloc(sizeof(DVTARGETDEVICE)); + mFormat.ptd = (DVTARGETDEVICE*)CoTaskMemAlloc(sizeof(DVTARGETDEVICE)); *(mFormat.ptd) = *(aSrc->ptd); } } @@ -40,7 +40,7 @@ class FormatEtc { if (!aDest) return; *aDest = mFormat; if (mFormat.ptd) { - aDest->ptd = (DVTARGETDEVICE *)CoTaskMemAlloc(sizeof(DVTARGETDEVICE)); + aDest->ptd = (DVTARGETDEVICE*)CoTaskMemAlloc(sizeof(DVTARGETDEVICE)); *(aDest->ptd) = *(mFormat.ptd); } } @@ -59,20 +59,20 @@ class FormatEtc { class CEnumFormatEtc final : public IEnumFORMATETC { public: - explicit CEnumFormatEtc(nsTArray &aArray); + explicit CEnumFormatEtc(nsTArray& aArray); CEnumFormatEtc(); ~CEnumFormatEtc(); // IUnknown impl. - STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv); + STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv); STDMETHODIMP_(ULONG) AddRef(); STDMETHODIMP_(ULONG) Release(); // IEnumFORMATETC impl. - STDMETHODIMP Next(ULONG aMaxToFetch, FORMATETC *aResult, ULONG *aNumFetched); + STDMETHODIMP Next(ULONG aMaxToFetch, FORMATETC* aResult, ULONG* aNumFetched); STDMETHODIMP Skip(ULONG aSkipNum); STDMETHODIMP Reset(); - STDMETHODIMP Clone(LPENUMFORMATETC *aResult); // Addrefs + STDMETHODIMP Clone(LPENUMFORMATETC* aResult); // Addrefs // Utils void AddFormatEtc(LPFORMATETC aFormat); diff --git a/widget/windows/JumpListItem.cpp b/widget/windows/JumpListItem.cpp index e26f44eaefbb4..941a479203c5a 100644 --- a/widget/windows/JumpListItem.cpp +++ b/widget/windows/JumpListItem.cpp @@ -50,7 +50,7 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(JumpListShortcut) NS_IMPL_CYCLE_COLLECTING_RELEASE(JumpListShortcut) NS_IMPL_CYCLE_COLLECTION(JumpListShortcut, mHandlerApp) -NS_IMETHODIMP JumpListItemBase::GetType(int16_t *aType) { +NS_IMETHODIMP JumpListItemBase::GetType(int16_t* aType) { NS_ENSURE_ARG_POINTER(aType); *aType = mItemType; @@ -58,7 +58,7 @@ NS_IMETHODIMP JumpListItemBase::GetType(int16_t *aType) { return NS_OK; } -NS_IMETHODIMP JumpListItemBase::Equals(nsIJumpListItem *aItem, bool *aResult) { +NS_IMETHODIMP JumpListItemBase::Equals(nsIJumpListItem* aItem, bool* aResult) { NS_ENSURE_ARG_POINTER(aItem); *aResult = false; @@ -76,37 +76,37 @@ NS_IMETHODIMP JumpListItemBase::Equals(nsIJumpListItem *aItem, bool *aResult) { /* link impl. */ -NS_IMETHODIMP JumpListLink::GetUri(nsIURI **aURI) { +NS_IMETHODIMP JumpListLink::GetUri(nsIURI** aURI) { NS_IF_ADDREF(*aURI = mURI); return NS_OK; } -NS_IMETHODIMP JumpListLink::SetUri(nsIURI *aURI) { +NS_IMETHODIMP JumpListLink::SetUri(nsIURI* aURI) { mURI = aURI; return NS_OK; } -NS_IMETHODIMP JumpListLink::SetUriTitle(const nsAString &aUriTitle) { +NS_IMETHODIMP JumpListLink::SetUriTitle(const nsAString& aUriTitle) { mUriTitle.Assign(aUriTitle); return NS_OK; } -NS_IMETHODIMP JumpListLink::GetUriTitle(nsAString &aUriTitle) { +NS_IMETHODIMP JumpListLink::GetUriTitle(nsAString& aUriTitle) { aUriTitle.Assign(mUriTitle); return NS_OK; } -NS_IMETHODIMP JumpListLink::GetUriHash(nsACString &aUriHash) { +NS_IMETHODIMP JumpListLink::GetUriHash(nsACString& aUriHash) { if (!mURI) return NS_ERROR_NOT_AVAILABLE; return mozilla::widget::FaviconHelper::HashURI(mCryptoHash, mURI, aUriHash); } -NS_IMETHODIMP JumpListLink::CompareHash(nsIURI *aUri, bool *aResult) { +NS_IMETHODIMP JumpListLink::CompareHash(nsIURI* aUri, bool* aResult) { nsresult rv; if (!mURI) { @@ -128,7 +128,7 @@ NS_IMETHODIMP JumpListLink::CompareHash(nsIURI *aUri, bool *aResult) { return NS_OK; } -NS_IMETHODIMP JumpListLink::Equals(nsIJumpListItem *aItem, bool *aResult) { +NS_IMETHODIMP JumpListLink::Equals(nsIJumpListItem* aItem, bool* aResult) { NS_ENSURE_ARG_POINTER(aItem); nsresult rv; @@ -167,18 +167,18 @@ NS_IMETHODIMP JumpListLink::Equals(nsIJumpListItem *aItem, bool *aResult) { /* shortcut impl. */ -NS_IMETHODIMP JumpListShortcut::GetApp(nsILocalHandlerApp **aApp) { +NS_IMETHODIMP JumpListShortcut::GetApp(nsILocalHandlerApp** aApp) { NS_IF_ADDREF(*aApp = mHandlerApp); return NS_OK; } -NS_IMETHODIMP JumpListShortcut::SetApp(nsILocalHandlerApp *aApp) { +NS_IMETHODIMP JumpListShortcut::SetApp(nsILocalHandlerApp* aApp) { mHandlerApp = aApp; return NS_OK; } -NS_IMETHODIMP JumpListShortcut::GetIconIndex(int32_t *aIconIndex) { +NS_IMETHODIMP JumpListShortcut::GetIconIndex(int32_t* aIconIndex) { NS_ENSURE_ARG_POINTER(aIconIndex); *aIconIndex = mIconIndex; @@ -190,18 +190,18 @@ NS_IMETHODIMP JumpListShortcut::SetIconIndex(int32_t aIconIndex) { return NS_OK; } -NS_IMETHODIMP JumpListShortcut::GetFaviconPageUri(nsIURI **aFaviconPageURI) { +NS_IMETHODIMP JumpListShortcut::GetFaviconPageUri(nsIURI** aFaviconPageURI) { NS_IF_ADDREF(*aFaviconPageURI = mFaviconPageURI); return NS_OK; } -NS_IMETHODIMP JumpListShortcut::SetFaviconPageUri(nsIURI *aFaviconPageURI) { +NS_IMETHODIMP JumpListShortcut::SetFaviconPageUri(nsIURI* aFaviconPageURI) { mFaviconPageURI = aFaviconPageURI; return NS_OK; } -NS_IMETHODIMP JumpListShortcut::Equals(nsIJumpListItem *aItem, bool *aResult) { +NS_IMETHODIMP JumpListShortcut::Equals(nsIJumpListItem* aItem, bool* aResult) { NS_ENSURE_ARG_POINTER(aItem); nsresult rv; @@ -243,17 +243,17 @@ NS_IMETHODIMP JumpListShortcut::Equals(nsIJumpListItem *aItem, bool *aResult) { /* internal helpers */ // (static) Creates a ShellLink that encapsulate a separator. -nsresult JumpListSeparator::GetSeparator(RefPtr &aShellLink) { +nsresult JumpListSeparator::GetSeparator(RefPtr& aShellLink) { HRESULT hr; - IShellLinkW *psl; + IShellLinkW* psl; // Create a IShellLink. hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, - IID_IShellLinkW, (LPVOID *)&psl); + IID_IShellLinkW, (LPVOID*)&psl); if (FAILED(hr)) return NS_ERROR_UNEXPECTED; - IPropertyStore *pPropStore = nullptr; - hr = psl->QueryInterface(IID_IPropertyStore, (LPVOID *)&pPropStore); + IPropertyStore* pPropStore = nullptr; + hr = psl->QueryInterface(IID_IPropertyStore, (LPVOID*)&pPropStore); if (FAILED(hr)) return NS_ERROR_UNEXPECTED; PROPVARIANT pv; @@ -271,11 +271,11 @@ nsresult JumpListSeparator::GetSeparator(RefPtr &aShellLink) { } // (static) Creates a ShellLink that encapsulate a shortcut to local apps. -nsresult JumpListShortcut::GetShellLink(nsCOMPtr &item, - RefPtr &aShellLink, - nsCOMPtr &aIOThread) { +nsresult JumpListShortcut::GetShellLink(nsCOMPtr& item, + RefPtr& aShellLink, + nsCOMPtr& aIOThread) { HRESULT hr; - IShellLinkW *psl; + IShellLinkW* psl; nsresult rv; // Shell links: @@ -297,7 +297,7 @@ nsresult JumpListShortcut::GetShellLink(nsCOMPtr &item, // Create a IShellLink hr = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, - IID_IShellLinkW, (LPVOID *)&psl); + IID_IShellLinkW, (LPVOID*)&psl); if (FAILED(hr)) return NS_ERROR_UNEXPECTED; // Retrieve the app path, title, description and optional command line args. @@ -337,8 +337,8 @@ nsresult JumpListShortcut::GetShellLink(nsCOMPtr &item, // Store the title of the app if (appTitle.Length() > 0) { - IPropertyStore *pPropStore = nullptr; - hr = psl->QueryInterface(IID_IPropertyStore, (LPVOID *)&pPropStore); + IPropertyStore* pPropStore = nullptr; + hr = psl->QueryInterface(IID_IPropertyStore, (LPVOID*)&pPropStore); if (FAILED(hr)) return NS_ERROR_UNEXPECTED; PROPVARIANT pv; @@ -380,8 +380,8 @@ nsresult JumpListShortcut::GetShellLink(nsCOMPtr &item, // If successful fills in the aSame parameter // aSame will be true if the path is in our icon cache -static nsresult IsPathInOurIconCache(nsCOMPtr &aShortcut, - wchar_t *aPath, bool *aSame) { +static nsresult IsPathInOurIconCache(nsCOMPtr& aShortcut, + wchar_t* aPath, bool* aSame) { NS_ENSURE_ARG_POINTER(aPath); NS_ENSURE_ARG_POINTER(aSame); @@ -418,7 +418,7 @@ static nsresult IsPathInOurIconCache(nsCOMPtr &aShortcut, // (static) For a given IShellLink, create and return a populated // nsIJumpListShortcut. nsresult JumpListShortcut::GetJumpListShortcut( - IShellLinkW *pLink, nsCOMPtr &aShortcut) { + IShellLinkW* pLink, nsCOMPtr& aShortcut) { NS_ENSURE_ARG_POINTER(pLink); nsresult rv; @@ -445,7 +445,7 @@ nsresult JumpListShortcut::GetJumpListShortcut( // Parameters hres = pLink->GetArguments(buf, MAX_PATH); if (SUCCEEDED(hres)) { - LPWSTR *arglist; + LPWSTR* arglist; int32_t numArgs; int32_t idx; @@ -494,9 +494,9 @@ nsresult JumpListShortcut::GetJumpListShortcut( // (static) ShellItems are used to encapsulate links to things. We currently // only support URI links, but more support could be added, such as local file // and directory links. -nsresult JumpListLink::GetShellItem(nsCOMPtr &item, - RefPtr &aShellItem) { - IShellItem2 *psi = nullptr; +nsresult JumpListLink::GetShellItem(nsCOMPtr& item, + RefPtr& aShellItem) { + IShellItem2* psi = nullptr; nsresult rv; int16_t type; @@ -525,9 +525,9 @@ nsresult JumpListLink::GetShellItem(nsCOMPtr &item, nsAutoString linkTitle; link->GetUriTitle(linkTitle); - IPropertyStore *pPropStore = nullptr; + IPropertyStore* pPropStore = nullptr; HRESULT hres = psi->GetPropertyStore(GPS_DEFAULT, IID_IPropertyStore, - (void **)&pPropStore); + (void**)&pPropStore); if (FAILED(hres)) return NS_ERROR_UNEXPECTED; PROPVARIANT pv; @@ -547,8 +547,8 @@ nsresult JumpListLink::GetShellItem(nsCOMPtr &item, // (static) For a given IShellItem, create and return a populated // nsIJumpListLink. -nsresult JumpListLink::GetJumpListLink(IShellItem *pItem, - nsCOMPtr &aLink) { +nsresult JumpListLink::GetJumpListLink(IShellItem* pItem, + nsCOMPtr& aLink) { NS_ENSURE_ARG_POINTER(pItem); // We assume for now these are URI links, but through properties we could diff --git a/widget/windows/JumpListItem.h b/widget/windows/JumpListItem.h index 6d8da2570bf2f..f3f5b11427ca1 100644 --- a/widget/windows/JumpListItem.h +++ b/widget/windows/JumpListItem.h @@ -62,7 +62,7 @@ class JumpListSeparator : public JumpListItemBase, public nsIJumpListSeparator { NS_DECL_ISUPPORTS NS_FORWARD_NSIJUMPLISTITEM(JumpListItemBase::) - static nsresult GetSeparator(RefPtr &aShellLink); + static nsresult GetSeparator(RefPtr& aShellLink); }; class JumpListLink : public JumpListItemBase, public nsIJumpListLink { @@ -72,16 +72,16 @@ class JumpListLink : public JumpListItemBase, public nsIJumpListLink { JumpListLink() : JumpListItemBase(nsIJumpListItem::JUMPLIST_ITEM_LINK) {} NS_DECL_ISUPPORTS - NS_IMETHOD GetType(int16_t *aType) override { + NS_IMETHOD GetType(int16_t* aType) override { return JumpListItemBase::GetType(aType); } - NS_IMETHOD Equals(nsIJumpListItem *item, bool *_retval) override; + NS_IMETHOD Equals(nsIJumpListItem* item, bool* _retval) override; NS_DECL_NSIJUMPLISTLINK - static nsresult GetShellItem(nsCOMPtr &item, - RefPtr &aShellItem); - static nsresult GetJumpListLink(IShellItem *pItem, - nsCOMPtr &aLink); + static nsresult GetShellItem(nsCOMPtr& item, + RefPtr& aShellItem); + static nsresult GetJumpListLink(IShellItem* pItem, + nsCOMPtr& aLink); protected: nsString mUriTitle; @@ -98,32 +98,32 @@ class JumpListShortcut : public JumpListItemBase, public nsIJumpListShortcut { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(JumpListShortcut, JumpListItemBase) - NS_IMETHOD GetType(int16_t *aType) override { + NS_IMETHOD GetType(int16_t* aType) override { return JumpListItemBase::GetType(aType); } - NS_IMETHOD Equals(nsIJumpListItem *item, bool *_retval) override; + NS_IMETHOD Equals(nsIJumpListItem* item, bool* _retval) override; NS_DECL_NSIJUMPLISTSHORTCUT - static nsresult GetShellLink(nsCOMPtr &item, - RefPtr &aShellLink, - nsCOMPtr &aIOThread); - static nsresult GetJumpListShortcut(IShellLinkW *pLink, - nsCOMPtr &aShortcut); + static nsresult GetShellLink(nsCOMPtr& item, + RefPtr& aShellLink, + nsCOMPtr& aIOThread); + static nsresult GetJumpListShortcut(IShellLinkW* pLink, + nsCOMPtr& aShortcut); static nsresult GetOutputIconPath(nsCOMPtr aFaviconPageURI, - nsCOMPtr &aICOFile); + nsCOMPtr& aICOFile); protected: int32_t mIconIndex; nsCOMPtr mFaviconPageURI; nsCOMPtr mHandlerApp; - bool ExecutableExists(nsCOMPtr &handlerApp); + bool ExecutableExists(nsCOMPtr& handlerApp); static nsresult ObtainCachedIconFile(nsCOMPtr aFaviconPageURI, - nsString &aICOFilePath, - nsCOMPtr &aIOThread); + nsString& aICOFilePath, + nsCOMPtr& aIOThread); static nsresult CacheIconFileFromFaviconURIAsync( nsCOMPtr aFaviconPageURI, nsCOMPtr aICOFile, - nsCOMPtr &aIOThread); + nsCOMPtr& aIOThread); }; } // namespace widget diff --git a/widget/windows/ProcInfo.cpp b/widget/windows/ProcInfo.cpp index a184e00f0475f..f64f80923e67a 100644 --- a/widget/windows/ProcInfo.cpp +++ b/widget/windows/ProcInfo.cpp @@ -9,18 +9,18 @@ #include #include -typedef HRESULT(WINAPI *GETTHREADDESCRIPTION)(HANDLE hThread, - PWSTR *threadDescription); +typedef HRESULT(WINAPI* GETTHREADDESCRIPTION)(HANDLE hThread, + PWSTR* threadDescription); namespace mozilla { -uint64_t ToNanoSeconds(const FILETIME &aFileTime) { +uint64_t ToNanoSeconds(const FILETIME& aFileTime) { // FILETIME values are 100-nanoseconds units, converting ULARGE_INTEGER usec = {{aFileTime.dwLowDateTime, aFileTime.dwHighDateTime}}; return usec.QuadPart * 100; } -void AppendThreads(ProcInfo *info) { +void AppendThreads(ProcInfo* info) { THREADENTRY32 te32; auto getThreadDescription = reinterpret_cast(::GetProcAddress( @@ -72,7 +72,7 @@ void AppendThreads(ProcInfo *info) { } RefPtr GetProcInfo(base::ProcessId pid, int32_t childId, - const ProcType &type) { + const ProcType& type) { auto holder = MakeUnique>(); RefPtr promise = holder->Ensure(__func__); diff --git a/widget/windows/TaskbarPreview.cpp b/widget/windows/TaskbarPreview.cpp index 50b1baa8fab7e..376dd9b166f5a 100644 --- a/widget/windows/TaskbarPreview.cpp +++ b/widget/windows/TaskbarPreview.cpp @@ -38,9 +38,9 @@ namespace widget { /////////////////////////////////////////////////////////////////////////////// // TaskbarPreview -TaskbarPreview::TaskbarPreview(ITaskbarList4 *aTaskbar, - nsITaskbarPreviewController *aController, - HWND aHWND, nsIDocShell *aShell) +TaskbarPreview::TaskbarPreview(ITaskbarList4* aTaskbar, + nsITaskbarPreviewController* aController, + HWND aHWND, nsIDocShell* aShell) : mTaskbar(aTaskbar), mController(aController), mWnd(aHWND), @@ -49,7 +49,7 @@ TaskbarPreview::TaskbarPreview(ITaskbarList4 *aTaskbar, // TaskbarPreview may outlive the WinTaskbar that created it ::CoInitialize(nullptr); - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); hook.AddMonitor(WM_DESTROY, MainWindowHook, this); } @@ -69,7 +69,7 @@ TaskbarPreview::~TaskbarPreview() { } NS_IMETHODIMP -TaskbarPreview::SetController(nsITaskbarPreviewController *aController) { +TaskbarPreview::SetController(nsITaskbarPreviewController* aController) { NS_ENSURE_ARG(aController); mController = aController; @@ -77,19 +77,19 @@ TaskbarPreview::SetController(nsITaskbarPreviewController *aController) { } NS_IMETHODIMP -TaskbarPreview::GetController(nsITaskbarPreviewController **aController) { +TaskbarPreview::GetController(nsITaskbarPreviewController** aController) { NS_ADDREF(*aController = mController); return NS_OK; } NS_IMETHODIMP -TaskbarPreview::GetTooltip(nsAString &aTooltip) { +TaskbarPreview::GetTooltip(nsAString& aTooltip) { aTooltip = mTooltip; return NS_OK; } NS_IMETHODIMP -TaskbarPreview::SetTooltip(const nsAString &aTooltip) { +TaskbarPreview::SetTooltip(const nsAString& aTooltip) { mTooltip = aTooltip; return CanMakeTaskbarCalls() ? UpdateTooltip() : NS_OK; } @@ -109,7 +109,7 @@ TaskbarPreview::SetVisible(bool visible) { } NS_IMETHODIMP -TaskbarPreview::GetVisible(bool *visible) { +TaskbarPreview::GetVisible(bool* visible) { *visible = mVisible; return NS_OK; } @@ -125,7 +125,7 @@ TaskbarPreview::SetActive(bool active) { } NS_IMETHODIMP -TaskbarPreview::GetActive(bool *active) { +TaskbarPreview::GetActive(bool* active) { *active = sActivePreview == this; return NS_OK; } @@ -164,7 +164,7 @@ nsresult TaskbarPreview::Enable() { if (CanMakeTaskbarCalls()) { rv = UpdateTaskbarProperties(); } else if (IsWindowAvailable()) { - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); hook.AddMonitor(nsAppShell::GetTaskbarButtonCreatedMessage(), MainWindowHook, this); } @@ -177,7 +177,7 @@ nsresult TaskbarPreview::Disable() { return NS_OK; } - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); (void)hook.RemoveMonitor(nsAppShell::GetTaskbarButtonCreatedMessage(), MainWindowHook, this); @@ -186,7 +186,7 @@ nsresult TaskbarPreview::Disable() { bool TaskbarPreview::IsWindowAvailable() const { if (mWnd) { - nsWindow *win = WinUtils::GetNSWindowPtr(mWnd); + nsWindow* win = WinUtils::GetNSWindowPtr(mWnd); if (win && !win->Destroyed()) { return true; } @@ -195,7 +195,7 @@ bool TaskbarPreview::IsWindowAvailable() const { } void TaskbarPreview::DetachFromNSWindow() { - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); hook.RemoveMonitor(WM_DESTROY, MainWindowHook, this); mWnd = nullptr; } @@ -251,15 +251,15 @@ bool TaskbarPreview::CanMakeTaskbarCalls() { // window close, the window seems to be hidden before being destroyed. if (!::IsWindowVisible(mWnd)) return false; if (mVisible) { - nsWindow *window = WinUtils::GetNSWindowPtr(mWnd); + nsWindow* window = WinUtils::GetNSWindowPtr(mWnd); NS_ASSERTION(window, "Could not get nsWindow from HWND"); return window->HasTaskbarIconBeenCreated(); } return false; } -WindowHook &TaskbarPreview::GetWindowHook() { - nsWindow *window = WinUtils::GetNSWindowPtr(mWnd); +WindowHook& TaskbarPreview::GetWindowHook() { + nsWindow* window = WinUtils::GetNSWindowPtr(mWnd); NS_ASSERTION(window, "Cannot use taskbar previews in an embedded context!"); return window->GetWindowHook(); @@ -292,10 +292,10 @@ void TaskbarPreview::DrawBitmap(uint32_t width, uint32_t height, return; } - ((TaskbarPreviewCallback *)callback.get())->SetPreview(this); + ((TaskbarPreviewCallback*)callback.get())->SetPreview(this); if (isPreview) { - ((TaskbarPreviewCallback *)callback.get())->SetIsPreview(); + ((TaskbarPreviewCallback*)callback.get())->SetIsPreview(); mController->RequestPreview(callback); } else { mController->RequestThumbnail(callback, width, height); @@ -309,7 +309,7 @@ NS_IMPL_ISUPPORTS(TaskbarPreviewCallback, nsITaskbarPreviewCallback) /* void done (in nsISupports aCanvas, in boolean aDrawBorder); */ NS_IMETHODIMP -TaskbarPreviewCallback::Done(nsISupports *aCanvas, bool aDrawBorder) { +TaskbarPreviewCallback::Done(nsISupports* aCanvas, bool aDrawBorder) { // We create and destroy TaskbarTabPreviews from front end code in response // to TabOpen and TabClose events. Each TaskbarTabPreview creates and owns a // proxy HWND which it hands to Windows as a tab identifier. When a tab @@ -369,21 +369,21 @@ TaskbarPreviewCallback::Done(nsISupports *aCanvas, bool aDrawBorder) { } /* static */ -bool TaskbarPreview::MainWindowHook(void *aContext, HWND hWnd, UINT nMsg, +bool TaskbarPreview::MainWindowHook(void* aContext, HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, - LRESULT *aResult) { + LRESULT* aResult) { NS_ASSERTION(nMsg == nsAppShell::GetTaskbarButtonCreatedMessage() || nMsg == WM_DESTROY, "Window hook proc called with wrong message"); NS_ASSERTION(aContext, "Null context in MainWindowHook"); if (!aContext) return false; - TaskbarPreview *preview = reinterpret_cast(aContext); + TaskbarPreview* preview = reinterpret_cast(aContext); if (nMsg == WM_DESTROY) { // nsWindow is being destroyed // We can't really do anything at this point including removing hooks return false; } else { - nsWindow *window = WinUtils::GetNSWindowPtr(preview->mWnd); + nsWindow* window = WinUtils::GetNSWindowPtr(preview->mWnd); if (window) { window->SetHasTaskbarIconBeenCreated(); @@ -393,7 +393,7 @@ bool TaskbarPreview::MainWindowHook(void *aContext, HWND hWnd, UINT nMsg, return false; } -TaskbarPreview *TaskbarPreview::sActivePreview = nullptr; +TaskbarPreview* TaskbarPreview::sActivePreview = nullptr; } // namespace widget } // namespace mozilla diff --git a/widget/windows/TaskbarPreview.h b/widget/windows/TaskbarPreview.h index 16299701ae2e9..dc94a20db017c 100644 --- a/widget/windows/TaskbarPreview.h +++ b/widget/windows/TaskbarPreview.h @@ -27,9 +27,9 @@ class TaskbarPreviewCallback; class TaskbarPreview : public nsITaskbarPreview { public: - TaskbarPreview(ITaskbarList4 *aTaskbar, - nsITaskbarPreviewController *aController, HWND aHWND, - nsIDocShell *aShell); + TaskbarPreview(ITaskbarList4* aTaskbar, + nsITaskbarPreviewController* aController, HWND aHWND, + nsIDocShell* aShell); friend class TaskbarPreviewCallback; @@ -55,7 +55,7 @@ class TaskbarPreview : public nsITaskbarPreview { // Marks this preview as being active virtual nsresult ShowActive(bool active) = 0; // Gets a reference to the window used to handle the preview messages - virtual HWND &PreviewWindow() = 0; + virtual HWND& PreviewWindow() = 0; // Window procedure for the PreviewWindow (hooked for window previews) virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam); @@ -66,7 +66,7 @@ class TaskbarPreview : public nsITaskbarPreview { bool CanMakeTaskbarCalls(); // Gets the WindowHook for the nsWindow - WindowHook &GetWindowHook(); + WindowHook& GetWindowHook(); // Enables/disables custom drawing for the given window static void EnableCustomDrawing(HWND aHWND, bool aEnable); @@ -89,8 +89,8 @@ class TaskbarPreview : public nsITaskbarPreview { void DrawBitmap(uint32_t width, uint32_t height, bool isPreview); // WindowHook procedure for hooking mWnd - static bool MainWindowHook(void *aContext, HWND hWnd, UINT nMsg, - WPARAM wParam, LPARAM lParam, LRESULT *aResult); + static bool MainWindowHook(void* aContext, HWND hWnd, UINT nMsg, + WPARAM wParam, LPARAM lParam, LRESULT* aResult); // Docshell corresponding to the the nsWindow contains nsWeakPtr mDocShell; @@ -98,7 +98,7 @@ class TaskbarPreview : public nsITaskbarPreview { // The preview currently marked as active in the taskbar. nullptr if no // preview is active (some other window is). - static TaskbarPreview *sActivePreview; + static TaskbarPreview* sActivePreview; }; /* @@ -113,7 +113,7 @@ class TaskbarPreviewCallback : public nsITaskbarPreviewCallback { NS_DECL_ISUPPORTS NS_DECL_NSITASKBARPREVIEWCALLBACK - void SetPreview(TaskbarPreview *aPreview) { mPreview = aPreview; } + void SetPreview(TaskbarPreview* aPreview) { mPreview = aPreview; } void SetIsPreview() { mIsThumbnail = false; } diff --git a/widget/windows/TaskbarPreviewButton.cpp b/widget/windows/TaskbarPreviewButton.cpp index 8babfbfb27e8e..209ff659f4ec4 100644 --- a/widget/windows/TaskbarPreviewButton.cpp +++ b/widget/windows/TaskbarPreviewButton.cpp @@ -19,29 +19,29 @@ namespace widget { NS_IMPL_ISUPPORTS(TaskbarPreviewButton, nsITaskbarPreviewButton, nsISupportsWeakReference) -TaskbarPreviewButton::TaskbarPreviewButton(TaskbarWindowPreview *preview, +TaskbarPreviewButton::TaskbarPreviewButton(TaskbarWindowPreview* preview, uint32_t index) : mPreview(preview), mIndex(index) {} TaskbarPreviewButton::~TaskbarPreviewButton() { SetVisible(false); } NS_IMETHODIMP -TaskbarPreviewButton::GetTooltip(nsAString &aTooltip) { +TaskbarPreviewButton::GetTooltip(nsAString& aTooltip) { aTooltip = mTooltip; return NS_OK; } NS_IMETHODIMP -TaskbarPreviewButton::SetTooltip(const nsAString &aTooltip) { +TaskbarPreviewButton::SetTooltip(const nsAString& aTooltip) { mTooltip = aTooltip; size_t destLength = sizeof Button().szTip / (sizeof Button().szTip[0]); - wchar_t *tooltip = &(Button().szTip[0]); + wchar_t* tooltip = &(Button().szTip[0]); StringCchCopyNW(tooltip, destLength, mTooltip.get(), mTooltip.Length()); return Update(); } NS_IMETHODIMP -TaskbarPreviewButton::GetDismissOnClick(bool *dismiss) { +TaskbarPreviewButton::GetDismissOnClick(bool* dismiss) { *dismiss = (Button().dwFlags & THBF_DISMISSONCLICK) == THBF_DISMISSONCLICK; return NS_OK; } @@ -56,7 +56,7 @@ TaskbarPreviewButton::SetDismissOnClick(bool dismiss) { } NS_IMETHODIMP -TaskbarPreviewButton::GetHasBorder(bool *hasBorder) { +TaskbarPreviewButton::GetHasBorder(bool* hasBorder) { *hasBorder = (Button().dwFlags & THBF_NOBACKGROUND) != THBF_NOBACKGROUND; return NS_OK; } @@ -71,7 +71,7 @@ TaskbarPreviewButton::SetHasBorder(bool hasBorder) { } NS_IMETHODIMP -TaskbarPreviewButton::GetDisabled(bool *disabled) { +TaskbarPreviewButton::GetDisabled(bool* disabled) { *disabled = (Button().dwFlags & THBF_DISABLED) == THBF_DISABLED; return NS_OK; } @@ -86,7 +86,7 @@ TaskbarPreviewButton::SetDisabled(bool disabled) { } NS_IMETHODIMP -TaskbarPreviewButton::GetImage(imgIContainer **img) { +TaskbarPreviewButton::GetImage(imgIContainer** img) { if (mImage) NS_ADDREF(*img = mImage); else @@ -95,7 +95,7 @@ TaskbarPreviewButton::GetImage(imgIContainer **img) { } NS_IMETHODIMP -TaskbarPreviewButton::SetImage(imgIContainer *img) { +TaskbarPreviewButton::SetImage(imgIContainer* img) { if (Button().hIcon) ::DestroyIcon(Button().hIcon); if (img) { nsresult rv; @@ -111,7 +111,7 @@ TaskbarPreviewButton::SetImage(imgIContainer *img) { } NS_IMETHODIMP -TaskbarPreviewButton::GetVisible(bool *visible) { +TaskbarPreviewButton::GetVisible(bool* visible) { *visible = (Button().dwFlags & THBF_HIDDEN) != THBF_HIDDEN; return NS_OK; } @@ -125,7 +125,7 @@ TaskbarPreviewButton::SetVisible(bool visible) { return Update(); } -THUMBBUTTON &TaskbarPreviewButton::Button() { +THUMBBUTTON& TaskbarPreviewButton::Button() { return mPreview->mThumbButtons[mIndex]; } diff --git a/widget/windows/TaskbarTabPreview.cpp b/widget/windows/TaskbarTabPreview.cpp index aff7134836218..807cddabadc86 100644 --- a/widget/windows/TaskbarTabPreview.cpp +++ b/widget/windows/TaskbarTabPreview.cpp @@ -18,16 +18,16 @@ namespace widget { NS_IMPL_ISUPPORTS(TaskbarTabPreview, nsITaskbarTabPreview) -const wchar_t *const kWindowClass = L"MozillaTaskbarPreviewClass"; +const wchar_t* const kWindowClass = L"MozillaTaskbarPreviewClass"; -TaskbarTabPreview::TaskbarTabPreview(ITaskbarList4 *aTaskbar, - nsITaskbarPreviewController *aController, - HWND aHWND, nsIDocShell *aShell) +TaskbarTabPreview::TaskbarTabPreview(ITaskbarList4* aTaskbar, + nsITaskbarPreviewController* aController, + HWND aHWND, nsIDocShell* aShell) : TaskbarPreview(aTaskbar, aController, aHWND, aShell), mProxyWindow(nullptr), mIcon(nullptr), mRegistered(false) { - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); hook.AddMonitor(WM_WINDOWPOSCHANGED, MainWindowHook, this); } @@ -59,7 +59,7 @@ nsresult TaskbarTabPreview::ShowActive(bool active) { : NS_OK; } -HWND &TaskbarTabPreview::PreviewWindow() { return mProxyWindow; } +HWND& TaskbarTabPreview::PreviewWindow() { return mProxyWindow; } nativeWindow TaskbarTabPreview::GetHWND() { return mProxyWindow; } @@ -71,19 +71,19 @@ void TaskbarTabPreview::EnsureRegistration() { } NS_IMETHODIMP -TaskbarTabPreview::GetTitle(nsAString &aTitle) { +TaskbarTabPreview::GetTitle(nsAString& aTitle) { aTitle = mTitle; return NS_OK; } NS_IMETHODIMP -TaskbarTabPreview::SetTitle(const nsAString &aTitle) { +TaskbarTabPreview::SetTitle(const nsAString& aTitle) { mTitle = aTitle; return mVisible ? UpdateTitle() : NS_OK; } NS_IMETHODIMP -TaskbarTabPreview::SetIcon(imgIContainer *icon) { +TaskbarTabPreview::SetIcon(imgIContainer* icon) { HICON hIcon = nullptr; if (icon) { nsresult rv; @@ -100,13 +100,13 @@ TaskbarTabPreview::SetIcon(imgIContainer *icon) { } NS_IMETHODIMP -TaskbarTabPreview::GetIcon(imgIContainer **icon) { +TaskbarTabPreview::GetIcon(imgIContainer** icon) { NS_IF_ADDREF(*icon = mIconImage); return NS_OK; } NS_IMETHODIMP -TaskbarTabPreview::Move(nsITaskbarTabPreview *aNext) { +TaskbarTabPreview::Move(nsITaskbarTabPreview* aNext) { if (aNext == this) return NS_ERROR_INVALID_ARG; mNext = aNext; return CanMakeTaskbarCalls() ? UpdateNext() : NS_OK; @@ -142,9 +142,9 @@ TaskbarTabPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) { bool activateWindow; nsresult rv = mController->OnActivate(&activateWindow); if (NS_SUCCEEDED(rv) && activateWindow) { - nsWindow *win = WinUtils::GetNSWindowPtr(mWnd); + nsWindow* win = WinUtils::GetNSWindowPtr(mWnd); if (win) { - nsWindow *parent = win->GetTopLevelWindow(true); + nsWindow* parent = win->GetTopLevelWindow(true); if (parent) { parent->Show(true); } @@ -183,15 +183,15 @@ TaskbarTabPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) { LRESULT CALLBACK TaskbarTabPreview::GlobalWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam) { - TaskbarTabPreview *preview(nullptr); + TaskbarTabPreview* preview(nullptr); if (nMsg == WM_CREATE) { - CREATESTRUCT *cs = reinterpret_cast(lParam); - preview = reinterpret_cast(cs->lpCreateParams); + CREATESTRUCT* cs = reinterpret_cast(lParam); + preview = reinterpret_cast(cs->lpCreateParams); if (!::SetPropW(hWnd, TASKBARPREVIEW_HWNDID, preview)) NS_ERROR("Could not associate native window with tab preview"); preview->mProxyWindow = hWnd; } else { - preview = reinterpret_cast( + preview = reinterpret_cast( ::GetPropW(hWnd, TASKBARPREVIEW_HWNDID)); if (nMsg == WM_DESTROY) ::RemovePropW(hWnd, TASKBARPREVIEW_HWNDID); } @@ -253,20 +253,19 @@ nsresult TaskbarTabPreview::Disable() { void TaskbarTabPreview::DetachFromNSWindow() { (void)SetVisible(false); - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); hook.RemoveMonitor(WM_WINDOWPOSCHANGED, MainWindowHook, this); TaskbarPreview::DetachFromNSWindow(); } /* static */ -bool TaskbarTabPreview::MainWindowHook(void *aContext, HWND hWnd, UINT nMsg, +bool TaskbarTabPreview::MainWindowHook(void* aContext, HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, - LRESULT *aResult) { + LRESULT* aResult) { if (nMsg == WM_WINDOWPOSCHANGED) { - TaskbarTabPreview *preview = - reinterpret_cast(aContext); - WINDOWPOS *pos = reinterpret_cast(lParam); + TaskbarTabPreview* preview = reinterpret_cast(aContext); + WINDOWPOS* pos = reinterpret_cast(lParam); if (SWP_FRAMECHANGED == (pos->flags & SWP_FRAMECHANGED)) preview->UpdateProxyWindowStyle(); } else { diff --git a/widget/windows/TaskbarTabPreview.h b/widget/windows/TaskbarTabPreview.h index 38e096ab92659..2774137261877 100644 --- a/widget/windows/TaskbarTabPreview.h +++ b/widget/windows/TaskbarTabPreview.h @@ -18,9 +18,9 @@ class TaskbarTabPreview : public nsITaskbarTabPreview, public TaskbarPreview { virtual ~TaskbarTabPreview(); public: - TaskbarTabPreview(ITaskbarList4 *aTaskbar, - nsITaskbarPreviewController *aController, HWND aHWND, - nsIDocShell *aShell); + TaskbarTabPreview(ITaskbarList4* aTaskbar, + nsITaskbarPreviewController* aController, HWND aHWND, + nsIDocShell* aShell); NS_DECL_ISUPPORTS NS_DECL_NSITASKBARTABPREVIEW @@ -28,7 +28,7 @@ class TaskbarTabPreview : public nsITaskbarTabPreview, public TaskbarPreview { private: virtual nsresult ShowActive(bool active); - virtual HWND &PreviewWindow(); + virtual HWND& PreviewWindow(); virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK GlobalWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam); @@ -39,8 +39,8 @@ class TaskbarTabPreview : public nsITaskbarTabPreview, public TaskbarPreview { virtual void DetachFromNSWindow(); // WindowHook procedure for hooking mWnd - static bool MainWindowHook(void *aContext, HWND hWnd, UINT nMsg, - WPARAM wParam, LPARAM lParam, LRESULT *aResult); + static bool MainWindowHook(void* aContext, HWND hWnd, UINT nMsg, + WPARAM wParam, LPARAM lParam, LRESULT* aResult); // Bug 520807 - we need to update the proxy window style based on the main // window's style to workaround a bug with the way the DWM displays the diff --git a/widget/windows/TaskbarWindowPreview.cpp b/widget/windows/TaskbarWindowPreview.cpp index df693fbcf2e1b..7d8e3653194a8 100644 --- a/widget/windows/TaskbarWindowPreview.cpp +++ b/widget/windows/TaskbarWindowPreview.cpp @@ -19,10 +19,10 @@ namespace mozilla { namespace widget { namespace { -bool WindowHookProc(void *aContext, HWND hWnd, UINT nMsg, WPARAM wParam, - LPARAM lParam, LRESULT *aResult) { - TaskbarWindowPreview *preview = - reinterpret_cast(aContext); +bool WindowHookProc(void* aContext, HWND hWnd, UINT nMsg, WPARAM wParam, + LPARAM lParam, LRESULT* aResult) { + TaskbarWindowPreview* preview = + reinterpret_cast(aContext); *aResult = preview->WndProc(nMsg, wParam, lParam); return true; } @@ -40,8 +40,8 @@ static TBPFLAG sNativeStates[] = {TBPF_NOPROGRESS, TBPF_INDETERMINATE, TBPF_NORMAL, TBPF_ERROR, TBPF_PAUSED}; TaskbarWindowPreview::TaskbarWindowPreview( - ITaskbarList4 *aTaskbar, nsITaskbarPreviewController *aController, - HWND aHWND, nsIDocShell *aShell) + ITaskbarList4* aTaskbar, nsITaskbarPreviewController* aController, + HWND aHWND, nsIDocShell* aShell) : TaskbarPreview(aTaskbar, aController, aHWND, aShell), mCustomDrawing(false), mHaveButtons(false), @@ -59,7 +59,7 @@ TaskbarWindowPreview::TaskbarWindowPreview( mThumbButtons[i].dwFlags = THBF_HIDDEN; } - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); if (!CanMakeTaskbarCalls()) hook.AddMonitor(nsAppShell::GetTaskbarButtonCreatedMessage(), TaskbarWindowHook, this); @@ -84,10 +84,10 @@ nsresult TaskbarWindowPreview::ShowActive(bool active) { : NS_OK; } -HWND &TaskbarWindowPreview::PreviewWindow() { return mWnd; } +HWND& TaskbarWindowPreview::PreviewWindow() { return mWnd; } nsresult TaskbarWindowPreview::GetButton(uint32_t index, - nsITaskbarPreviewButton **_retVal) { + nsITaskbarPreviewButton** _retVal) { if (index >= nsITaskbarWindowPreview::NUM_TOOLBAR_BUTTONS) return NS_ERROR_INVALID_ARG; @@ -106,7 +106,7 @@ nsresult TaskbarWindowPreview::GetButton(uint32_t index, if (!mHaveButtons) { mHaveButtons = true; - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); (void)hook.AddHook(WM_COMMAND, WindowHookProc, this); if (mVisible && FAILED(mTaskbar->ThumbBarAddButtons( @@ -125,7 +125,7 @@ TaskbarWindowPreview::SetEnableCustomDrawing(bool aEnable) { mCustomDrawing = aEnable; TaskbarPreview::EnableCustomDrawing(mWnd, aEnable); - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); if (aEnable) { (void)hook.AddHook(WM_DWMSENDICONICTHUMBNAIL, WindowHookProc, this); (void)hook.AddHook(WM_DWMSENDICONICLIVEPREVIEWBITMAP, WindowHookProc, this); @@ -138,7 +138,7 @@ TaskbarWindowPreview::SetEnableCustomDrawing(bool aEnable) { } NS_IMETHODIMP -TaskbarWindowPreview::GetEnableCustomDrawing(bool *aEnable) { +TaskbarWindowPreview::GetEnableCustomDrawing(bool* aEnable) { *aEnable = mCustomDrawing; return NS_OK; } @@ -167,8 +167,8 @@ TaskbarWindowPreview::SetProgressState(nsTaskbarProgressState aState, } NS_IMETHODIMP -TaskbarWindowPreview::SetOverlayIcon(imgIContainer *aStatusIcon, - const nsAString &aStatusDescription) { +TaskbarWindowPreview::SetOverlayIcon(imgIContainer* aStatusIcon, + const nsAString& aStatusDescription) { nsresult rv; if (aStatusIcon) { // The image shouldn't be animated @@ -239,13 +239,13 @@ TaskbarWindowPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) { } /* static */ -bool TaskbarWindowPreview::TaskbarWindowHook(void *aContext, HWND hWnd, +bool TaskbarWindowPreview::TaskbarWindowHook(void* aContext, HWND hWnd, UINT nMsg, WPARAM wParam, - LPARAM lParam, LRESULT *aResult) { + LPARAM lParam, LRESULT* aResult) { NS_ASSERTION(nMsg == nsAppShell::GetTaskbarButtonCreatedMessage(), "Window hook proc called with wrong message"); - TaskbarWindowPreview *preview = - reinterpret_cast(aContext); + TaskbarWindowPreview* preview = + reinterpret_cast(aContext); // Now we can make all the calls to mTaskbar preview->UpdateTaskbarProperties(); return false; @@ -269,7 +269,7 @@ void TaskbarWindowPreview::DetachFromNSWindow() { // Remove the hooks we have for drawing SetEnableCustomDrawing(false); - WindowHook &hook = GetWindowHook(); + WindowHook& hook = GetWindowHook(); (void)hook.RemoveHook(WM_COMMAND, WindowHookProc, this); (void)hook.RemoveMonitor(nsAppShell::GetTaskbarButtonCreatedMessage(), TaskbarWindowHook, this); diff --git a/widget/windows/TaskbarWindowPreview.h b/widget/windows/TaskbarWindowPreview.h index c09804bc0b361..01571125cf8ff 100644 --- a/widget/windows/TaskbarWindowPreview.h +++ b/widget/windows/TaskbarWindowPreview.h @@ -26,9 +26,9 @@ class TaskbarWindowPreview : public TaskbarPreview, virtual ~TaskbarWindowPreview(); public: - TaskbarWindowPreview(ITaskbarList4 *aTaskbar, - nsITaskbarPreviewController *aController, HWND aHWND, - nsIDocShell *aShell); + TaskbarWindowPreview(ITaskbarList4* aTaskbar, + nsITaskbarPreviewController* aController, HWND aHWND, + nsIDocShell* aShell); NS_DECL_ISUPPORTS NS_DECL_NSITASKBARWINDOWPREVIEW @@ -40,7 +40,7 @@ class TaskbarWindowPreview : public TaskbarPreview, private: virtual nsresult ShowActive(bool active) override; - virtual HWND &PreviewWindow() override; + virtual HWND& PreviewWindow() override; virtual nsresult UpdateTaskbarProperties() override; virtual nsresult Enable() override; @@ -72,8 +72,8 @@ class TaskbarWindowPreview : public TaskbarPreview, nsString mIconDescription; // WindowHook procedure for hooking mWnd for taskbar progress and icon stuff - static bool TaskbarWindowHook(void *aContext, HWND hWnd, UINT nMsg, - WPARAM wParam, LPARAM lParam, LRESULT *aResult); + static bool TaskbarWindowHook(void* aContext, HWND hWnd, UINT nMsg, + WPARAM wParam, LPARAM lParam, LRESULT* aResult); friend class TaskbarPreviewButton; }; diff --git a/widget/windows/WinPointerEvents.cpp b/widget/windows/WinPointerEvents.cpp index 958a8b890c31e..2ffa473c90dc5 100644 --- a/widget/windows/WinPointerEvents.cpp +++ b/widget/windows/WinPointerEvents.cpp @@ -90,7 +90,7 @@ bool WinPointerEvents::ShouldHandleWinPointerMessages(UINT aMsg, } bool WinPointerEvents::GetPointerType(uint32_t aPointerId, - POINTER_INPUT_TYPE *aPointerType) { + POINTER_INPUT_TYPE* aPointerType) { if (!getPointerType) { return false; } @@ -105,7 +105,7 @@ WinPointerEvents::GetPointerType(uint32_t aPointerId) { } bool WinPointerEvents::GetPointerInfo(uint32_t aPointerId, - POINTER_INFO *aPointerInfo) { + POINTER_INFO* aPointerInfo) { if (!getPointerInfo) { return false; } @@ -113,7 +113,7 @@ bool WinPointerEvents::GetPointerInfo(uint32_t aPointerId, } bool WinPointerEvents::GetPointerPenInfo(uint32_t aPointerId, - POINTER_PEN_INFO *aPenInfo) { + POINTER_PEN_INFO* aPenInfo) { if (!getPointerPenInfo) { return false; } @@ -139,7 +139,7 @@ bool WinPointerEvents::ShouldFirePointerEventByWinPointerMessages() { return sFirePointerEventsByWinPointerMessages; } -WinPointerInfo *WinPointerEvents::GetCachedPointerInfo(UINT aMsg, +WinPointerInfo* WinPointerEvents::GetCachedPointerInfo(UINT aMsg, WPARAM aWParam) { if (!sLibraryHandle || !sPointerEventEnabled || MOUSE_INPUT_SOURCE() != dom::MouseEvent_Binding::MOZ_SOURCE_PEN || @@ -186,7 +186,7 @@ void WinPointerEvents::ConvertAndCachePointerInfo(UINT aMsg, WPARAM aWParam) { } void WinPointerEvents::ConvertAndCachePointerInfo(WPARAM aWParam, - WinPointerInfo *aInfo) { + WinPointerInfo* aInfo) { MOZ_ASSERT(!sFirePointerEventsByWinPointerMessages); aInfo->pointerId = GetPointerId(aWParam); MOZ_ASSERT(GetPointerType(aInfo->pointerId) == PT_PEN); diff --git a/widget/windows/WinPointerEvents.h b/widget/windows/WinPointerEvents.h index f0268ca711441..f01ee2fb44f9b 100644 --- a/widget/windows/WinPointerEvents.h +++ b/widget/windows/WinPointerEvents.h @@ -138,25 +138,25 @@ class WinPointerEvents final { uint32_t GetPointerId(WPARAM aWParam) { return GET_POINTERID_WPARAM(aWParam); } - bool GetPointerType(uint32_t aPointerId, POINTER_INPUT_TYPE *aPointerType); + bool GetPointerType(uint32_t aPointerId, POINTER_INPUT_TYPE* aPointerType); POINTER_INPUT_TYPE GetPointerType(uint32_t aPointerId); - bool GetPointerInfo(uint32_t aPointerId, POINTER_INFO *aPointerInfo); - bool GetPointerPenInfo(uint32_t aPointerId, POINTER_PEN_INFO *aPenInfo); + bool GetPointerInfo(uint32_t aPointerId, POINTER_INFO* aPointerInfo); + bool GetPointerPenInfo(uint32_t aPointerId, POINTER_PEN_INFO* aPenInfo); bool ShouldEnableInkCollector(); bool ShouldRollupOnPointerEvent(UINT aMsg, WPARAM aWParam); bool ShouldFirePointerEventByWinPointerMessages(); - WinPointerInfo *GetCachedPointerInfo(UINT aMsg, WPARAM aWParam); + WinPointerInfo* GetCachedPointerInfo(UINT aMsg, WPARAM aWParam); void ConvertAndCachePointerInfo(UINT aMsg, WPARAM aWParam); - void ConvertAndCachePointerInfo(WPARAM aWParam, WinPointerInfo *aInfo); + void ConvertAndCachePointerInfo(WPARAM aWParam, WinPointerInfo* aInfo); private: // Function prototypes - typedef BOOL(WINAPI *GetPointerTypePtr)(uint32_t aPointerId, - POINTER_INPUT_TYPE *aPointerType); - typedef BOOL(WINAPI *GetPointerInfoPtr)(uint32_t aPointerId, - POINTER_INFO *aPointerInfo); - typedef BOOL(WINAPI *GetPointerPenInfoPtr)(uint32_t aPointerId, - POINTER_PEN_INFO *aPenInfo); + typedef BOOL(WINAPI* GetPointerTypePtr)(uint32_t aPointerId, + POINTER_INPUT_TYPE* aPointerType); + typedef BOOL(WINAPI* GetPointerInfoPtr)(uint32_t aPointerId, + POINTER_INFO* aPointerInfo); + typedef BOOL(WINAPI* GetPointerPenInfoPtr)(uint32_t aPointerId, + POINTER_PEN_INFO* aPenInfo); void InitLibrary(); diff --git a/widget/windows/WinTaskbar.cpp b/widget/windows/WinTaskbar.cpp index 2ab667e3287bd..1aa187428e70c 100644 --- a/widget/windows/WinTaskbar.cpp +++ b/widget/windows/WinTaskbar.cpp @@ -37,9 +37,9 @@ static NS_DEFINE_CID(kJumpListBuilderCID, NS_WIN_JUMPLISTBUILDER_CID); namespace { -HWND GetHWNDFromDocShell(nsIDocShell *aShell) { +HWND GetHWNDFromDocShell(nsIDocShell* aShell) { nsCOMPtr baseWindow( - do_QueryInterface(reinterpret_cast(aShell))); + do_QueryInterface(reinterpret_cast(aShell))); if (!baseWindow) return nullptr; @@ -49,7 +49,7 @@ HWND GetHWNDFromDocShell(nsIDocShell *aShell) { return widget ? (HWND)widget->GetNativeData(NS_NATIVE_WINDOW) : nullptr; } -HWND GetHWNDFromDOMWindow(mozIDOMWindow *dw) { +HWND GetHWNDFromDOMWindow(mozIDOMWindow* dw) { nsCOMPtr widget; if (!dw) return nullptr; @@ -58,8 +58,8 @@ HWND GetHWNDFromDOMWindow(mozIDOMWindow *dw) { return GetHWNDFromDocShell(window->GetDocShell()); } -nsresult SetWindowAppUserModelProp(mozIDOMWindow *aParent, - const nsString &aIdentifier) { +nsresult SetWindowAppUserModelProp(mozIDOMWindow* aParent, + const nsString& aIdentifier) { NS_ENSURE_ARG_POINTER(aParent); if (aIdentifier.IsEmpty()) return NS_ERROR_INVALID_ARG; @@ -105,7 +105,7 @@ class DefaultController final : public nsITaskbarPreviewController { }; NS_IMETHODIMP -DefaultController::GetWidth(uint32_t *aWidth) { +DefaultController::GetWidth(uint32_t* aWidth) { RECT r; ::GetClientRect(mWnd, &r); *aWidth = r.right; @@ -113,7 +113,7 @@ DefaultController::GetWidth(uint32_t *aWidth) { } NS_IMETHODIMP -DefaultController::GetHeight(uint32_t *aHeight) { +DefaultController::GetHeight(uint32_t* aHeight) { RECT r; ::GetClientRect(mWnd, &r); *aHeight = r.bottom; @@ -121,7 +121,7 @@ DefaultController::GetHeight(uint32_t *aHeight) { } NS_IMETHODIMP -DefaultController::GetThumbnailAspectRatio(float *aThumbnailAspectRatio) { +DefaultController::GetThumbnailAspectRatio(float* aThumbnailAspectRatio) { uint32_t width, height; GetWidth(&width); GetHeight(&height); @@ -132,13 +132,13 @@ DefaultController::GetThumbnailAspectRatio(float *aThumbnailAspectRatio) { } NS_IMETHODIMP -DefaultController::RequestThumbnail(nsITaskbarPreviewCallback *aCallback, +DefaultController::RequestThumbnail(nsITaskbarPreviewCallback* aCallback, uint32_t width, uint32_t height) { return NS_OK; } NS_IMETHODIMP -DefaultController::RequestPreview(nsITaskbarPreviewCallback *aCallback) { +DefaultController::RequestPreview(nsITaskbarPreviewCallback* aCallback) { return NS_OK; } @@ -151,7 +151,7 @@ DefaultController::OnClose(void) { } NS_IMETHODIMP -DefaultController::OnActivate(bool *rAcceptActivation) { +DefaultController::OnActivate(bool* rAcceptActivation) { *rAcceptActivation = true; MOZ_ASSERT_UNREACHABLE( "OnActivate should not be called for " @@ -160,7 +160,7 @@ DefaultController::OnActivate(bool *rAcceptActivation) { } NS_IMETHODIMP -DefaultController::OnClick(nsITaskbarPreviewButton *button) { return NS_OK; } +DefaultController::OnClick(nsITaskbarPreviewButton* button) { return NS_OK; } NS_IMPL_ISUPPORTS(DefaultController, nsITaskbarPreviewController) } // namespace @@ -179,7 +179,7 @@ bool WinTaskbar::Initialize() { ::CoInitialize(nullptr); HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, - IID_ITaskbarList4, (void **)&mTaskbar); + IID_ITaskbarList4, (void**)&mTaskbar); if (FAILED(hr)) return false; hr = mTaskbar->HrInit(); @@ -202,7 +202,7 @@ WinTaskbar::~WinTaskbar() { } // static -bool WinTaskbar::GetAppUserModelID(nsAString &aDefaultGroupId) { +bool WinTaskbar::GetAppUserModelID(nsAString& aDefaultGroupId) { // If marked as such in prefs, use a hash of the profile path for the id // instead of the install path hash setup by the installer. bool useProfile = Preferences::GetBool("taskbar.grouping.useprofile", false); @@ -246,7 +246,7 @@ bool WinTaskbar::GetAppUserModelID(nsAString &aDefaultGroupId) { WCHAR path[MAX_PATH]; if (GetModuleFileNameW(nullptr, path, MAX_PATH)) { - wchar_t *slash = wcsrchr(path, '\\'); + wchar_t* slash = wcsrchr(path, '\\'); if (!slash) return false; *slash = '\0'; // no trailing slash @@ -268,7 +268,7 @@ bool WinTaskbar::GetAppUserModelID(nsAString &aDefaultGroupId) { } NS_IMETHODIMP -WinTaskbar::GetDefaultGroupId(nsAString &aDefaultGroupId) { +WinTaskbar::GetDefaultGroupId(nsAString& aDefaultGroupId) { if (!GetAppUserModelID(aDefaultGroupId)) return NS_ERROR_UNEXPECTED; return NS_OK; @@ -283,7 +283,7 @@ bool WinTaskbar::RegisterAppUserModelID() { } NS_IMETHODIMP -WinTaskbar::GetAvailable(bool *aAvailable) { +WinTaskbar::GetAvailable(bool* aAvailable) { // ITaskbarList4::HrInit() may fail with shell extensions like blackbox // installed. Initialize early to return available=false in those cases. *aAvailable = Initialize(); @@ -292,9 +292,9 @@ WinTaskbar::GetAvailable(bool *aAvailable) { } NS_IMETHODIMP -WinTaskbar::CreateTaskbarTabPreview(nsIDocShell *shell, - nsITaskbarPreviewController *controller, - nsITaskbarTabPreview **_retval) { +WinTaskbar::CreateTaskbarTabPreview(nsIDocShell* shell, + nsITaskbarPreviewController* controller, + nsITaskbarTabPreview** _retval) { if (!Initialize()) return NS_ERROR_NOT_AVAILABLE; NS_ENSURE_ARG_POINTER(shell); @@ -314,8 +314,8 @@ WinTaskbar::CreateTaskbarTabPreview(nsIDocShell *shell, } NS_IMETHODIMP -WinTaskbar::GetTaskbarWindowPreview(nsIDocShell *shell, - nsITaskbarWindowPreview **_retval) { +WinTaskbar::GetTaskbarWindowPreview(nsIDocShell* shell, + nsITaskbarWindowPreview** _retval) { if (!Initialize()) return NS_ERROR_NOT_AVAILABLE; NS_ENSURE_ARG_POINTER(shell); @@ -324,7 +324,7 @@ WinTaskbar::GetTaskbarWindowPreview(nsIDocShell *shell, if (!toplevelHWND) return NS_ERROR_INVALID_ARG; - nsWindow *window = WinUtils::GetNSWindowPtr(toplevelHWND); + nsWindow* window = WinUtils::GetNSWindowPtr(toplevelHWND); if (!window) return NS_ERROR_FAILURE; @@ -344,8 +344,8 @@ WinTaskbar::GetTaskbarWindowPreview(nsIDocShell *shell, } NS_IMETHODIMP -WinTaskbar::GetTaskbarProgress(nsIDocShell *shell, - nsITaskbarProgress **_retval) { +WinTaskbar::GetTaskbarProgress(nsIDocShell* shell, + nsITaskbarProgress** _retval) { nsCOMPtr preview; nsresult rv = GetTaskbarWindowPreview(shell, getter_AddRefs(preview)); NS_ENSURE_SUCCESS(rv, rv); @@ -355,7 +355,7 @@ WinTaskbar::GetTaskbarProgress(nsIDocShell *shell, NS_IMETHODIMP WinTaskbar::GetOverlayIconController( - nsIDocShell *shell, nsITaskbarOverlayIconController **_retval) { + nsIDocShell* shell, nsITaskbarOverlayIconController** _retval) { nsCOMPtr preview; nsresult rv = GetTaskbarWindowPreview(shell, getter_AddRefs(preview)); NS_ENSURE_SUCCESS(rv, rv); @@ -364,7 +364,7 @@ WinTaskbar::GetOverlayIconController( } NS_IMETHODIMP -WinTaskbar::CreateJumpListBuilder(nsIJumpListBuilder **aJumpListBuilder) { +WinTaskbar::CreateJumpListBuilder(nsIJumpListBuilder** aJumpListBuilder) { nsresult rv; if (JumpListBuilder::sBuildingList) return NS_ERROR_ALREADY_INITIALIZED; @@ -379,13 +379,13 @@ WinTaskbar::CreateJumpListBuilder(nsIJumpListBuilder **aJumpListBuilder) { } NS_IMETHODIMP -WinTaskbar::SetGroupIdForWindow(mozIDOMWindow *aParent, - const nsAString &aIdentifier) { +WinTaskbar::SetGroupIdForWindow(mozIDOMWindow* aParent, + const nsAString& aIdentifier) { return SetWindowAppUserModelProp(aParent, nsString(aIdentifier)); } NS_IMETHODIMP -WinTaskbar::PrepareFullScreen(mozIDOMWindow *aWindow, bool aFullScreen) { +WinTaskbar::PrepareFullScreen(mozIDOMWindow* aWindow, bool aFullScreen) { NS_ENSURE_ARG_POINTER(aWindow); HWND toplevelHWND = ::GetAncestor(GetHWNDFromDOMWindow(aWindow), GA_ROOT); @@ -395,7 +395,7 @@ WinTaskbar::PrepareFullScreen(mozIDOMWindow *aWindow, bool aFullScreen) { } NS_IMETHODIMP -WinTaskbar::PrepareFullScreenHWND(void *aHWND, bool aFullScreen) { +WinTaskbar::PrepareFullScreenHWND(void* aHWND, bool aFullScreen) { if (!Initialize()) return NS_ERROR_NOT_AVAILABLE; NS_ENSURE_ARG_POINTER(aHWND); diff --git a/widget/windows/WinTaskbar.h b/widget/windows/WinTaskbar.h index 9443dbf83156f..44102f8b39ff3 100644 --- a/widget/windows/WinTaskbar.h +++ b/widget/windows/WinTaskbar.h @@ -29,14 +29,14 @@ class WinTaskbar final : public nsIWinTaskbar { // Registers the global app user model id for the instance. // See comments in WinTaskbar.cpp for more information. static bool RegisterAppUserModelID(); - static bool GetAppUserModelID(nsAString &aDefaultGroupId); + static bool GetAppUserModelID(nsAString& aDefaultGroupId); private: bool Initialize(); - typedef HRESULT(WINAPI *SetCurrentProcessExplicitAppUserModelIDPtr)( + typedef HRESULT(WINAPI* SetCurrentProcessExplicitAppUserModelIDPtr)( PCWSTR AppID); - ITaskbarList4 *mTaskbar; + ITaskbarList4* mTaskbar; }; } // namespace widget diff --git a/widget/windows/WindowHook.cpp b/widget/windows/WindowHook.cpp index d01950feeb5f7..a0e0ada81d407 100644 --- a/widget/windows/WindowHook.cpp +++ b/widget/windows/WindowHook.cpp @@ -11,8 +11,8 @@ namespace mozilla { namespace widget { -nsresult WindowHook::AddHook(UINT nMsg, Callback callback, void *context) { - MessageData *data = LookupOrCreate(nMsg); +nsresult WindowHook::AddHook(UINT nMsg, Callback callback, void* context) { + MessageData* data = LookupOrCreate(nMsg); if (!data) return NS_ERROR_OUT_OF_MEMORY; @@ -24,9 +24,9 @@ nsresult WindowHook::AddHook(UINT nMsg, Callback callback, void *context) { return NS_OK; } -nsresult WindowHook::RemoveHook(UINT nMsg, Callback callback, void *context) { +nsresult WindowHook::RemoveHook(UINT nMsg, Callback callback, void* context) { CallbackData cbdata(callback, context); - MessageData *data = Lookup(nMsg); + MessageData* data = Lookup(nMsg); if (!data) return NS_ERROR_UNEXPECTED; if (data->hook != cbdata) return NS_ERROR_UNEXPECTED; data->hook = CallbackData(); @@ -35,17 +35,17 @@ nsresult WindowHook::RemoveHook(UINT nMsg, Callback callback, void *context) { return NS_OK; } -nsresult WindowHook::AddMonitor(UINT nMsg, Callback callback, void *context) { - MessageData *data = LookupOrCreate(nMsg); +nsresult WindowHook::AddMonitor(UINT nMsg, Callback callback, void* context) { + MessageData* data = LookupOrCreate(nMsg); return (data && data->monitors.AppendElement(CallbackData(callback, context))) ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } nsresult WindowHook::RemoveMonitor(UINT nMsg, Callback callback, - void *context) { + void* context) { CallbackData cbdata(callback, context); - MessageData *data = Lookup(nMsg); + MessageData* data = Lookup(nMsg); if (!data) return NS_ERROR_UNEXPECTED; CallbackDataArray::index_type idx = data->monitors.IndexOf(cbdata); if (idx == CallbackDataArray::NoIndex) return NS_ERROR_UNEXPECTED; @@ -54,17 +54,17 @@ nsresult WindowHook::RemoveMonitor(UINT nMsg, Callback callback, return NS_OK; } -WindowHook::MessageData *WindowHook::Lookup(UINT nMsg) { +WindowHook::MessageData* WindowHook::Lookup(UINT nMsg) { MessageDataArray::index_type idx; for (idx = 0; idx < mMessageData.Length(); idx++) { - MessageData &data = mMessageData[idx]; + MessageData& data = mMessageData[idx]; if (data.nMsg == nMsg) return &data; } return nullptr; } -WindowHook::MessageData *WindowHook::LookupOrCreate(UINT nMsg) { - MessageData *data = Lookup(nMsg); +WindowHook::MessageData* WindowHook::LookupOrCreate(UINT nMsg) { + MessageData* data = Lookup(nMsg); if (!data) { data = mMessageData.AppendElement(); @@ -75,7 +75,7 @@ WindowHook::MessageData *WindowHook::LookupOrCreate(UINT nMsg) { return data; } -void WindowHook::DeleteIfEmpty(MessageData *data) { +void WindowHook::DeleteIfEmpty(MessageData* data) { // Never remove a MessageData that has still a hook or monitor entries. if (data->hook || !data->monitors.IsEmpty()) return; @@ -88,8 +88,8 @@ void WindowHook::DeleteIfEmpty(MessageData *data) { } bool WindowHook::Notify(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, - MSGResult &aResult) { - MessageData *data = Lookup(nMsg); + MSGResult& aResult) { + MessageData* data = Lookup(nMsg); if (!data) return false; uint32_t length = data->monitors.Length(); @@ -103,7 +103,7 @@ bool WindowHook::Notify(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, } bool WindowHook::CallbackData::Invoke(HWND hWnd, UINT msg, WPARAM wParam, - LPARAM lParam, LRESULT *aResult) { + LPARAM lParam, LRESULT* aResult) { if (!cb) return false; return cb(context, hWnd, msg, wParam, lParam, aResult); } diff --git a/widget/windows/WindowHook.h b/widget/windows/WindowHook.h index 066b7156bd312..1d1f4b02da048 100644 --- a/widget/windows/WindowHook.h +++ b/widget/windows/WindowHook.h @@ -25,27 +25,27 @@ struct MSGResult; class WindowHook { public: // It is expected that most callbacks will return false - typedef bool (*Callback)(void *aContext, HWND hWnd, UINT nMsg, WPARAM wParam, - LPARAM lParam, LRESULT *aResult); + typedef bool (*Callback)(void* aContext, HWND hWnd, UINT nMsg, WPARAM wParam, + LPARAM lParam, LRESULT* aResult); - nsresult AddHook(UINT nMsg, Callback callback, void *context); - nsresult RemoveHook(UINT nMsg, Callback callback, void *context); - nsresult AddMonitor(UINT nMsg, Callback callback, void *context); - nsresult RemoveMonitor(UINT nMsg, Callback callback, void *context); + nsresult AddHook(UINT nMsg, Callback callback, void* context); + nsresult RemoveHook(UINT nMsg, Callback callback, void* context); + nsresult AddMonitor(UINT nMsg, Callback callback, void* context); + nsresult RemoveMonitor(UINT nMsg, Callback callback, void* context); private: struct CallbackData { Callback cb; - void *context; + void* context; CallbackData() : cb(nullptr), context(nullptr) {} - CallbackData(Callback cb, void *ctx) : cb(cb), context(ctx) {} + CallbackData(Callback cb, void* ctx) : cb(cb), context(ctx) {} bool Invoke(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, - LRESULT *aResult); - bool operator==(const CallbackData &rhs) const { + LRESULT* aResult); + bool operator==(const CallbackData& rhs) const { return cb == rhs.cb && context == rhs.context; } - bool operator!=(const CallbackData &rhs) const { return !(*this == rhs); } + bool operator!=(const CallbackData& rhs) const { return !(*this == rhs); } explicit operator bool() const { return !!cb; } }; @@ -57,11 +57,11 @@ class WindowHook { }; bool Notify(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, - MSGResult &aResult); + MSGResult& aResult); - MessageData *Lookup(UINT nMsg); - MessageData *LookupOrCreate(UINT nMsg); - void DeleteIfEmpty(MessageData *data); + MessageData* Lookup(UINT nMsg); + MessageData* LookupOrCreate(UINT nMsg); + void DeleteIfEmpty(MessageData* data); typedef nsTArray MessageDataArray; MessageDataArray mMessageData; diff --git a/widget/windows/nsFilePicker.cpp b/widget/windows/nsFilePicker.cpp index dd356e0e24c9e..b34ff7f6e4654 100644 --- a/widget/windows/nsFilePicker.cpp +++ b/widget/windows/nsFilePicker.cpp @@ -35,7 +35,7 @@ using mozilla::UniquePtr; using mozilla::mscom::EnsureMTA; using namespace mozilla::widget; -char16_t *nsFilePicker::mLastUsedUnicodeDirectory; +char16_t* nsFilePicker::mLastUsedUnicodeDirectory; char nsFilePicker::mLastUsedDirectory[MAX_PATH + 1] = {0}; static const unsigned long kDialogTimerTimeout = 300; @@ -51,8 +51,8 @@ typedef DWORD FILEOPENDIALOGOPTIONS; // Manages matching SuppressBlurEvents calls on the parent widget. class AutoSuppressEvents { public: - explicit AutoSuppressEvents(nsIWidget *aWidget) - : mWindow(static_cast(aWidget)) { + explicit AutoSuppressEvents(nsIWidget* aWidget) + : mWindow(static_cast(aWidget)) { SuppressWidgetEvents(true); } @@ -110,8 +110,8 @@ class AutoDestroyTmpWindow { // Manages matching PickerOpen/PickerClosed calls on the parent widget. class AutoWidgetPickerState { public: - explicit AutoWidgetPickerState(nsIWidget *aWidget) - : mWindow(static_cast(aWidget)) { + explicit AutoWidgetPickerState(nsIWidget* aWidget) + : mWindow(static_cast(aWidget)) { PickerState(true); } @@ -132,9 +132,9 @@ class AutoWidgetPickerState { // Manages a simple callback timer class AutoTimerCallbackCancel { public: - AutoTimerCallbackCancel(nsFilePicker *aTarget, + AutoTimerCallbackCancel(nsFilePicker* aTarget, nsTimerCallbackFunc aCallbackFunc, - const char *aName) { + const char* aName) { Init(aTarget, aCallbackFunc, aName); } @@ -145,8 +145,8 @@ class AutoTimerCallbackCancel { } private: - void Init(nsFilePicker *aTarget, nsTimerCallbackFunc aCallbackFunc, - const char *aName) { + void Init(nsFilePicker* aTarget, nsTimerCallbackFunc aCallbackFunc, + const char* aName) { NS_NewTimerWithFuncCallback(getter_AddRefs(mPickerCallbackTimer), aCallbackFunc, aTarget, kDialogTimerTimeout, nsITimer::TYPE_REPEATING_SLACK, aName); @@ -175,16 +175,16 @@ nsFilePicker::~nsFilePicker() { NS_IMPL_ISUPPORTS(nsFilePicker, nsIFilePicker) -NS_IMETHODIMP nsFilePicker::Init(mozIDOMWindowProxy *aParent, - const nsAString &aTitle, int16_t aMode) { +NS_IMETHODIMP nsFilePicker::Init(mozIDOMWindowProxy* aParent, + const nsAString& aTitle, int16_t aMode) { nsCOMPtr window = do_QueryInterface(aParent); - nsIDocShell *docShell = window ? window->GetDocShell() : nullptr; + nsIDocShell* docShell = window ? window->GetDocShell() : nullptr; mLoadContext = do_QueryInterface(docShell); return nsBaseFilePicker::Init(aParent, aTitle, aMode); } -STDMETHODIMP nsFilePicker::QueryInterface(REFIID refiid, void **ppvResult) { +STDMETHODIMP nsFilePicker::QueryInterface(REFIID refiid, void** ppvResult) { *ppvResult = nullptr; if (IID_IUnknown == refiid || refiid == IID_IFileDialogEvents) { *ppvResult = this; @@ -203,27 +203,27 @@ STDMETHODIMP nsFilePicker::QueryInterface(REFIID refiid, void **ppvResult) { */ HRESULT -nsFilePicker::OnFileOk(IFileDialog *pfd) { return S_OK; } +nsFilePicker::OnFileOk(IFileDialog* pfd) { return S_OK; } HRESULT -nsFilePicker::OnFolderChanging(IFileDialog *pfd, IShellItem *psiFolder) { +nsFilePicker::OnFolderChanging(IFileDialog* pfd, IShellItem* psiFolder) { return S_OK; } HRESULT -nsFilePicker::OnFolderChange(IFileDialog *pfd) { return S_OK; } +nsFilePicker::OnFolderChange(IFileDialog* pfd) { return S_OK; } HRESULT -nsFilePicker::OnSelectionChange(IFileDialog *pfd) { return S_OK; } +nsFilePicker::OnSelectionChange(IFileDialog* pfd) { return S_OK; } HRESULT -nsFilePicker::OnShareViolation(IFileDialog *pfd, IShellItem *psi, - FDE_SHAREVIOLATION_RESPONSE *pResponse) { +nsFilePicker::OnShareViolation(IFileDialog* pfd, IShellItem* psi, + FDE_SHAREVIOLATION_RESPONSE* pResponse) { return S_OK; } HRESULT -nsFilePicker::OnTypeChange(IFileDialog *pfd) { +nsFilePicker::OnTypeChange(IFileDialog* pfd) { // Failures here result in errors due to security concerns. RefPtr win; pfd->QueryInterface(IID_IOleWindow, getter_AddRefs(win)); @@ -243,8 +243,8 @@ nsFilePicker::OnTypeChange(IFileDialog *pfd) { } HRESULT -nsFilePicker::OnOverwrite(IFileDialog *pfd, IShellItem *psi, - FDE_OVERWRITE_RESPONSE *pResponse) { +nsFilePicker::OnOverwrite(IFileDialog* pfd, IShellItem* psi, + FDE_OVERWRITE_RESPONSE* pResponse) { return S_OK; } @@ -255,7 +255,7 @@ nsFilePicker::OnOverwrite(IFileDialog *pfd, IShellItem *psi, bool nsFilePicker::ClosePickerIfNeeded() { if (!mParentWidget || !mDlgWnd) return false; - nsWindow *win = static_cast(mParentWidget.get()); + nsWindow* win = static_cast(mParentWidget.get()); if (IsWindow(mDlgWnd) && IsWindowVisible(mDlgWnd) && win->DestroyCalled()) { wchar_t className[64]; // Make sure we have the right window @@ -268,8 +268,8 @@ bool nsFilePicker::ClosePickerIfNeeded() { return false; } -void nsFilePicker::PickerCallbackTimerFunc(nsITimer *aTimer, void *aCtx) { - nsFilePicker *picker = (nsFilePicker *)aCtx; +void nsFilePicker::PickerCallbackTimerFunc(nsITimer* aTimer, void* aCtx) { + nsFilePicker* picker = (nsFilePicker*)aCtx; if (picker->ClosePickerIfNeeded()) { aTimer->Cancel(); } @@ -291,7 +291,7 @@ void nsFilePicker::SetDialogHandle(HWND aWnd) { * used if left blank. * @return true if a file was selected successfully. */ -bool nsFilePicker::ShowFolderPicker(const nsString &aInitialDir) { +bool nsFilePicker::ShowFolderPicker(const nsString& aInitialDir) { if (!IsWin8OrLater()) { // Some Windows 7 users are experiencing a race condition when some dlls // that are loaded by the file picker cause a crash while attempting to shut @@ -373,7 +373,7 @@ bool nsFilePicker::ShowFolderPicker(const nsString &aInitialDir) { * used if left blank. * @return true if a file was selected successfully. */ -bool nsFilePicker::ShowFilePicker(const nsString &aInitialDir) { +bool nsFilePicker::ShowFilePicker(const nsString& aInitialDir) { AUTO_PROFILER_LABEL("nsFilePicker::ShowFilePicker", OTHER); if (!IsWin8OrLater()) { @@ -532,7 +532,7 @@ bool nsFilePicker::ShowFilePicker(const nsString &aInitialDir) { /////////////////////////////////////////////////////////////////////////////// // nsIFilePicker impl. -nsresult nsFilePicker::ShowW(int16_t *aReturnVal) { +nsresult nsFilePicker::ShowW(int16_t* aReturnVal) { NS_ENSURE_ARG_POINTER(aReturnVal); *aReturnVal = returnCancel; @@ -584,10 +584,10 @@ nsresult nsFilePicker::ShowW(int16_t *aReturnVal) { return NS_OK; } -nsresult nsFilePicker::Show(int16_t *aReturnVal) { return ShowW(aReturnVal); } +nsresult nsFilePicker::Show(int16_t* aReturnVal) { return ShowW(aReturnVal); } NS_IMETHODIMP -nsFilePicker::GetFile(nsIFile **aFile) { +nsFilePicker::GetFile(nsIFile** aFile) { NS_ENSURE_ARG_POINTER(aFile); *aFile = nullptr; @@ -605,7 +605,7 @@ nsFilePicker::GetFile(nsIFile **aFile) { } NS_IMETHODIMP -nsFilePicker::GetFileURL(nsIURI **aFileURL) { +nsFilePicker::GetFileURL(nsIURI** aFileURL) { *aFileURL = nullptr; nsCOMPtr file; nsresult rv = GetFile(getter_AddRefs(file)); @@ -615,14 +615,14 @@ nsFilePicker::GetFileURL(nsIURI **aFileURL) { } NS_IMETHODIMP -nsFilePicker::GetFiles(nsISimpleEnumerator **aFiles) { +nsFilePicker::GetFiles(nsISimpleEnumerator** aFiles) { NS_ENSURE_ARG_POINTER(aFiles); return NS_NewArrayEnumerator(aFiles, mFiles, NS_GET_IID(nsIFile)); } // Get the file + path NS_IMETHODIMP -nsBaseWinFilePicker::SetDefaultString(const nsAString &aString) { +nsBaseWinFilePicker::SetDefaultString(const nsAString& aString) { mDefaultFilePath = aString; // First, make sure the file name is not too long. @@ -655,26 +655,26 @@ nsBaseWinFilePicker::SetDefaultString(const nsAString &aString) { } NS_IMETHODIMP -nsBaseWinFilePicker::GetDefaultString(nsAString &aString) { +nsBaseWinFilePicker::GetDefaultString(nsAString& aString) { return NS_ERROR_FAILURE; } // The default extension to use for files NS_IMETHODIMP -nsBaseWinFilePicker::GetDefaultExtension(nsAString &aExtension) { +nsBaseWinFilePicker::GetDefaultExtension(nsAString& aExtension) { aExtension = mDefaultExtension; return NS_OK; } NS_IMETHODIMP -nsBaseWinFilePicker::SetDefaultExtension(const nsAString &aExtension) { +nsBaseWinFilePicker::SetDefaultExtension(const nsAString& aExtension) { mDefaultExtension = aExtension; return NS_OK; } // Set the filter index NS_IMETHODIMP -nsFilePicker::GetFilterIndex(int32_t *aFilterIndex) { +nsFilePicker::GetFilterIndex(int32_t* aFilterIndex) { // Windows' filter index is 1-based, we use a 0-based system. *aFilterIndex = mSelectedType - 1; return NS_OK; @@ -687,13 +687,13 @@ nsFilePicker::SetFilterIndex(int32_t aFilterIndex) { return NS_OK; } -void nsFilePicker::InitNative(nsIWidget *aParent, const nsAString &aTitle) { +void nsFilePicker::InitNative(nsIWidget* aParent, const nsAString& aTitle) { mParentWidget = aParent; mTitle.Assign(aTitle); } NS_IMETHODIMP -nsFilePicker::AppendFilter(const nsAString &aTitle, const nsAString &aFilter) { +nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) { mComFilterList.Append(aTitle, aFilter); return NS_OK; } @@ -749,15 +749,15 @@ bool nsFilePicker::IsDefaultPathHtml() { return false; } -void nsFilePicker::ComDlgFilterSpec::Append(const nsAString &aTitle, - const nsAString &aFilter) { - COMDLG_FILTERSPEC *pSpecForward = mSpecList.AppendElement(); +void nsFilePicker::ComDlgFilterSpec::Append(const nsAString& aTitle, + const nsAString& aFilter) { + COMDLG_FILTERSPEC* pSpecForward = mSpecList.AppendElement(); if (!pSpecForward) { NS_WARNING("mSpecList realloc failed."); return; } memset(pSpecForward, 0, sizeof(*pSpecForward)); - nsString *pStr = mStrings.AppendElement(aTitle); + nsString* pStr = mStrings.AppendElement(aTitle); if (!pStr) { NS_WARNING("mStrings.AppendElement failed."); return; diff --git a/widget/windows/nsFilePicker.h b/widget/windows/nsFilePicker.h index 31d9d1f3b1d76..b60bf5ba87f70 100644 --- a/widget/windows/nsFilePicker.h +++ b/widget/windows/nsFilePicker.h @@ -24,10 +24,10 @@ class nsILoadContext; class nsBaseWinFilePicker : public nsBaseFilePicker { public: - NS_IMETHOD GetDefaultString(nsAString &aDefaultString) override; - NS_IMETHOD SetDefaultString(const nsAString &aDefaultString) override; - NS_IMETHOD GetDefaultExtension(nsAString &aDefaultExtension) override; - NS_IMETHOD SetDefaultExtension(const nsAString &aDefaultExtension) override; + NS_IMETHOD GetDefaultString(nsAString& aDefaultString) override; + NS_IMETHOD SetDefaultString(const nsAString& aDefaultString) override; + NS_IMETHOD GetDefaultExtension(nsAString& aDefaultExtension) override; + NS_IMETHOD SetDefaultExtension(const nsAString& aDefaultExtension) override; protected: nsString mDefaultFilePath; @@ -45,51 +45,51 @@ class nsFilePicker : public IFileDialogEvents, public nsBaseWinFilePicker { public: nsFilePicker(); - NS_IMETHOD Init(mozIDOMWindowProxy *aParent, const nsAString &aTitle, + NS_IMETHOD Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle, int16_t aMode) override; NS_DECL_ISUPPORTS // IUnknown's QueryInterface - STDMETHODIMP QueryInterface(REFIID refiid, void **ppvResult); + STDMETHODIMP QueryInterface(REFIID refiid, void** ppvResult); // nsIFilePicker (less what's in nsBaseFilePicker and nsBaseWinFilePicker) - NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex) override; + NS_IMETHOD GetFilterIndex(int32_t* aFilterIndex) override; NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override; - NS_IMETHOD GetFile(nsIFile **aFile) override; - NS_IMETHOD GetFileURL(nsIURI **aFileURL) override; - NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles) override; - NS_IMETHOD AppendFilter(const nsAString &aTitle, - const nsAString &aFilter) override; + NS_IMETHOD GetFile(nsIFile** aFile) override; + NS_IMETHOD GetFileURL(nsIURI** aFileURL) override; + NS_IMETHOD GetFiles(nsISimpleEnumerator** aFiles) override; + NS_IMETHOD AppendFilter(const nsAString& aTitle, + const nsAString& aFilter) override; // IFileDialogEvents - HRESULT STDMETHODCALLTYPE OnFileOk(IFileDialog *pfd); - HRESULT STDMETHODCALLTYPE OnFolderChanging(IFileDialog *pfd, - IShellItem *psiFolder); - HRESULT STDMETHODCALLTYPE OnFolderChange(IFileDialog *pfd); - HRESULT STDMETHODCALLTYPE OnSelectionChange(IFileDialog *pfd); + HRESULT STDMETHODCALLTYPE OnFileOk(IFileDialog* pfd); + HRESULT STDMETHODCALLTYPE OnFolderChanging(IFileDialog* pfd, + IShellItem* psiFolder); + HRESULT STDMETHODCALLTYPE OnFolderChange(IFileDialog* pfd); + HRESULT STDMETHODCALLTYPE OnSelectionChange(IFileDialog* pfd); HRESULT STDMETHODCALLTYPE - OnShareViolation(IFileDialog *pfd, IShellItem *psi, - FDE_SHAREVIOLATION_RESPONSE *pResponse); - HRESULT STDMETHODCALLTYPE OnTypeChange(IFileDialog *pfd); - HRESULT STDMETHODCALLTYPE OnOverwrite(IFileDialog *pfd, IShellItem *psi, - FDE_OVERWRITE_RESPONSE *pResponse); + OnShareViolation(IFileDialog* pfd, IShellItem* psi, + FDE_SHAREVIOLATION_RESPONSE* pResponse); + HRESULT STDMETHODCALLTYPE OnTypeChange(IFileDialog* pfd); + HRESULT STDMETHODCALLTYPE OnOverwrite(IFileDialog* pfd, IShellItem* psi, + FDE_OVERWRITE_RESPONSE* pResponse); protected: /* method from nsBaseFilePicker */ - virtual void InitNative(nsIWidget *aParent, const nsAString &aTitle) override; - nsresult Show(int16_t *aReturnVal) override; - nsresult ShowW(int16_t *aReturnVal); - void GetFilterListArray(nsString &aFilterList); - bool ShowFolderPicker(const nsString &aInitialDir); - bool ShowFilePicker(const nsString &aInitialDir); + virtual void InitNative(nsIWidget* aParent, const nsAString& aTitle) override; + nsresult Show(int16_t* aReturnVal) override; + nsresult ShowW(int16_t* aReturnVal); + void GetFilterListArray(nsString& aFilterList); + bool ShowFolderPicker(const nsString& aInitialDir); + bool ShowFilePicker(const nsString& aInitialDir); void RememberLastUsedDirectory(); bool IsPrivacyModeEnabled(); bool IsDefaultPathLink(); bool IsDefaultPathHtml(); void SetDialogHandle(HWND aWnd); bool ClosePickerIfNeeded(); - static void PickerCallbackTimerFunc(nsITimer *aTimer, void *aPicker); + static void PickerCallbackTimerFunc(nsITimer* aTimer, void* aPicker); nsCOMPtr mLoadContext; nsCOMPtr mParentWidget; @@ -100,7 +100,7 @@ class nsFilePicker : public IFileDialogEvents, public nsBaseWinFilePicker { nsCOMArray mFiles; static char mLastUsedDirectory[]; nsString mUnicodeFile; - static char16_t *mLastUsedUnicodeDirectory; + static char16_t* mLastUsedUnicodeDirectory; HWND mDlgWnd; class ComDlgFilterSpec { @@ -112,9 +112,9 @@ class nsFilePicker : public IFileDialogEvents, public nsBaseWinFilePicker { const bool IsEmpty() { return (mSpecList.Length() == 0); } - const COMDLG_FILTERSPEC *get() { return mSpecList.Elements(); } + const COMDLG_FILTERSPEC* get() { return mSpecList.Elements(); } - void Append(const nsAString &aTitle, const nsAString &aFilter); + void Append(const nsAString& aTitle, const nsAString& aFilter); private: AutoTArray mSpecList; diff --git a/widget/windows/nsIdleServiceWin.cpp b/widget/windows/nsIdleServiceWin.cpp index 5c472cbb65614..443a6fe7a82ba 100644 --- a/widget/windows/nsIdleServiceWin.cpp +++ b/widget/windows/nsIdleServiceWin.cpp @@ -8,7 +8,7 @@ #include "nsIdleServiceWin.h" #include -bool nsIdleServiceWin::PollIdleTime(uint32_t *aIdleTime) { +bool nsIdleServiceWin::PollIdleTime(uint32_t* aIdleTime) { LASTINPUTINFO inputInfo; inputInfo.cbSize = sizeof(inputInfo); if (!::GetLastInputInfo(&inputInfo)) return false; diff --git a/widget/windows/nsLookAndFeel.cpp b/widget/windows/nsLookAndFeel.cpp index f2329a17b267a..dfbc5a4b9bc57 100644 --- a/widget/windows/nsLookAndFeel.cpp +++ b/widget/windows/nsLookAndFeel.cpp @@ -39,7 +39,7 @@ LookAndFeel::OperatingSystemVersion nsLookAndFeel::GetOperatingSystemVersion() { static nsresult GetColorFromTheme(nsUXThemeClass cls, int32_t aPart, int32_t aState, int32_t aPropId, - nscolor &aColor) { + nscolor& aColor) { COLORREF color; HRESULT hr = GetThemeColor(nsUXThemeData::GetTheme(cls), aPart, aState, aPropId, &color); @@ -55,7 +55,7 @@ static int32_t GetSystemParam(long flag, int32_t def) { return ::SystemParametersInfo(flag, 0, &value, 0) ? value : def; } -static nsresult SystemWantsDarkTheme(int32_t &darkThemeEnabled) { +static nsresult SystemWantsDarkTheme(int32_t& darkThemeEnabled) { if (!IsWin10OrLater()) { darkThemeEnabled = 0; return NS_OK; @@ -120,7 +120,7 @@ void nsLookAndFeel::RefreshImpl() { mInitialized = false; } -nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor) { +nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor) { EnsureInit(); nsresult res = NS_OK; @@ -360,7 +360,7 @@ nsresult nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor) { return res; } -nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult) { +nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) { nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult); if (NS_SUCCEEDED(res)) return res; res = NS_OK; @@ -606,7 +606,7 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult) { return res; } -nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult) { +nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float& aResult) { nsresult res = nsXPLookAndFeel::GetFloatImpl(aID, aResult); if (NS_SUCCEEDED(res)) return res; res = NS_OK; @@ -626,8 +626,8 @@ nsresult nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult) { } static bool GetSysFontInfo(HDC aHDC, LookAndFeel::FontID anID, - nsString &aFontName, gfxFontStyle &aFontStyle) { - const LOGFONTW *ptrLogFont = nullptr; + nsString& aFontName, gfxFontStyle& aFontStyle) { + const LOGFONTW* ptrLogFont = nullptr; LOGFONTW logFont; NONCLIENTMETRICSW ncm; char16_t name[LF_FACESIZE]; @@ -742,9 +742,9 @@ static bool GetSysFontInfo(HDC aHDC, LookAndFeel::FontID anID, return true; } -bool nsLookAndFeel::GetFontImpl(FontID anID, nsString &aFontName, - gfxFontStyle &aFontStyle) { - CachedSystemFont &cacheSlot = mSystemFontCache[anID]; +bool nsLookAndFeel::GetFontImpl(FontID anID, nsString& aFontName, + gfxFontStyle& aFontStyle) { + CachedSystemFont& cacheSlot = mSystemFontCache[anID]; bool status; if (cacheSlot.mCacheValid) { @@ -795,7 +795,7 @@ nsTArray nsLookAndFeel::GetIntCacheImpl() { } void nsLookAndFeel::SetIntCacheImpl( - const nsTArray &aLookAndFeelIntCache) { + const nsTArray& aLookAndFeelIntCache) { for (auto entry : aLookAndFeelIntCache) { switch (entry.id) { case eIntID_UseAccessibilityTheme: @@ -812,7 +812,7 @@ void nsLookAndFeel::SetIntCacheImpl( } /* static */ -nsresult nsLookAndFeel::GetAccentColor(nscolor &aColor) { +nsresult nsLookAndFeel::GetAccentColor(nscolor& aColor) { nsresult rv; if (!mDwmKey) { @@ -847,7 +847,7 @@ nsresult nsLookAndFeel::GetAccentColor(nscolor &aColor) { } /* static */ -nsresult nsLookAndFeel::GetAccentColorText(nscolor &aColor) { +nsresult nsLookAndFeel::GetAccentColorText(nscolor& aColor) { nscolor accentColor; nsresult rv = GetAccentColor(accentColor); if (NS_WARN_IF(NS_FAILED(rv))) { diff --git a/widget/windows/nsSound.cpp b/widget/windows/nsSound.cpp index 307940a86c788..0800118efcfb9 100644 --- a/widget/windows/nsSound.cpp +++ b/widget/windows/nsSound.cpp @@ -36,12 +36,12 @@ static mozilla::LazyLogModule gWin32SoundLog("nsSound"); class nsSoundPlayer : public mozilla::Runnable { public: - explicit nsSoundPlayer(const nsAString &aSoundName) + explicit nsSoundPlayer(const nsAString& aSoundName) : mozilla::Runnable("nsSoundPlayer"), mSoundName(aSoundName), mSoundData(nullptr) {} - nsSoundPlayer(const uint8_t *aData, size_t aSize) + nsSoundPlayer(const uint8_t* aData, size_t aSize) : mozilla::Runnable("nsSoundPlayer"), mSoundName(EmptyString()) { MOZ_ASSERT(aSize > 0, "Size should not be zero"); MOZ_ASSERT(aData, "Data shoud not be null"); @@ -57,7 +57,7 @@ class nsSoundPlayer : public mozilla::Runnable { ~nsSoundPlayer(); nsString mSoundName; - uint8_t *mSoundData; + uint8_t* mSoundData; }; NS_IMETHODIMP @@ -136,9 +136,9 @@ NS_IMETHODIMP nsSound::Beep() { return NS_OK; } -NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, - nsISupports *context, nsresult aStatus, - uint32_t dataLen, const uint8_t *data) { +NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader* aLoader, + nsISupports* context, nsresult aStatus, + uint32_t dataLen, const uint8_t* data) { MOZ_ASSERT(mPlayerThread, "player thread should not be null "); // print a load error on bad status if (NS_FAILED(aStatus)) { @@ -179,11 +179,11 @@ NS_IMETHODIMP nsSound::OnStreamComplete(nsIStreamLoader *aLoader, return NS_OK; } -NS_IMETHODIMP nsSound::Play(nsIURL *aURL) { +NS_IMETHODIMP nsSound::Play(nsIURL* aURL) { nsresult rv; #ifdef DEBUG_SOUND - char *url; + char* url; aURL->GetSpec(&url); MOZ_LOG(gWin32SoundLog, LogLevel::Info, ("%s\n", url)); #endif @@ -218,8 +218,8 @@ nsresult nsSound::CreatePlayerThread() { } NS_IMETHODIMP -nsSound::Observe(nsISupports *aSubject, const char *aTopic, - const char16_t *aData) { +nsSound::Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) { if (!strcmp(aTopic, "xpcom-shutdown-threads")) { PurgeLastSound(); @@ -259,7 +259,7 @@ NS_IMETHODIMP nsSound::PlayEventSound(uint32_t aEventId) { MOZ_ASSERT(mPlayerThread, "player thread should not be null "); PurgeLastSound(); - const wchar_t *sound = nullptr; + const wchar_t* sound = nullptr; switch (aEventId) { case EVENT_NEW_MAIL_RECEIVED: sound = L"MailBeep"; diff --git a/widget/windows/nsUXThemeData.cpp b/widget/windows/nsUXThemeData.cpp index b21d20076fdba..9c979e2d125bd 100644 --- a/widget/windows/nsUXThemeData.cpp +++ b/widget/windows/nsUXThemeData.cpp @@ -60,7 +60,7 @@ nsUXThemeData::GetTheme(nsUXThemeClass cls) { return sThemes[cls]; } -const wchar_t *nsUXThemeData::GetClassName(nsUXThemeClass cls) { +const wchar_t* nsUXThemeData::GetClassName(nsUXThemeClass cls) { switch (cls) { case eUXButton: return L"Button"; diff --git a/widget/windows/nsUXThemeData.h b/widget/windows/nsUXThemeData.h index 2199084551399..8c4b4241983c4 100644 --- a/widget/windows/nsUXThemeData.h +++ b/widget/windows/nsUXThemeData.h @@ -89,7 +89,7 @@ class nsUXThemeData { static SIZE sCommandButtonBoxMetrics; static bool sCommandButtonBoxMetricsInitialized; - static const wchar_t *GetClassName(nsUXThemeClass); + static const wchar_t* GetClassName(nsUXThemeClass); static void EnsureCommandButtonMetrics(); static void EnsureCommandButtonBoxMetrics(); diff --git a/widget/windows/nsWidgetFactory.h b/widget/windows/nsWidgetFactory.h index cc9b30a776769..797d0a60bb426 100644 --- a/widget/windows/nsWidgetFactory.h +++ b/widget/windows/nsWidgetFactory.h @@ -13,8 +13,8 @@ class nsISupports; -nsresult nsAppShellConstructor(nsISupports *outer, const nsIID &iid, - void **result); +nsresult nsAppShellConstructor(nsISupports* outer, const nsIID& iid, + void** result); nsresult nsWidgetWindowsModuleCtor(); void nsWidgetWindowsModuleDtor(); diff --git a/widget/windows/nsWindowDbg.cpp b/widget/windows/nsWindowDbg.cpp index cabdf3fc0d7a1..c0880817d05f5 100644 --- a/widget/windows/nsWindowDbg.cpp +++ b/widget/windows/nsWindowDbg.cpp @@ -42,7 +42,7 @@ void PrintEvent(UINT msg, bool aShowAllEvents, bool aShowMouseMoves) { } #ifdef DEBUG -void DDError(const char *msg, HRESULT hr) { +void DDError(const char* msg, HRESULT hr) { /*XXX make nicer */ MOZ_LOG(gWindowsLog, LogLevel::Error, ("direct draw error %s: 0x%08lx\n", msg, hr)); diff --git a/widget/windows/nsWindowDbg.h b/widget/windows/nsWindowDbg.h index 339668b48b573..c303b068552f3 100644 --- a/widget/windows/nsWindowDbg.h +++ b/widget/windows/nsWindowDbg.h @@ -38,7 +38,7 @@ void PrintEvent(UINT msg, bool aShowAllEvents, bool aShowMouseMoves); #if defined(POPUP_ROLLUP_DEBUG_OUTPUT) typedef struct { - char *mStr; + char* mStr; int mId; } MSGFEventMsgInfo; @@ -49,7 +49,7 @@ typedef struct { #endif // defined(POPUP_ROLLUP_DEBUG_OUTPUT) #if defined(DEBUG) -void DDError(const char *msg, HRESULT hr); +void DDError(const char* msg, HRESULT hr); #endif // defined(DEBUG) #if defined(DEBUG_VK) diff --git a/xpcom/components/ModuleUtils.h b/xpcom/components/ModuleUtils.h index 853f30e18b5d3..2dc572cef09df 100644 --- a/xpcom/components/ModuleUtils.h +++ b/xpcom/components/ModuleUtils.h @@ -11,8 +11,8 @@ #include "mozilla/Module.h" #define NS_GENERIC_FACTORY_CONSTRUCTOR(_InstanceClass) \ - static nsresult _InstanceClass##Constructor(nsISupports *aOuter, \ - REFNSIID aIID, void **aResult) { \ + static nsresult _InstanceClass##Constructor(nsISupports* aOuter, \ + REFNSIID aIID, void** aResult) { \ RefPtr<_InstanceClass> inst; \ \ *aResult = nullptr; \ @@ -25,8 +25,8 @@ } #define NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(_InstanceClass, _InitMethod) \ - static nsresult _InstanceClass##Constructor(nsISupports *aOuter, \ - REFNSIID aIID, void **aResult) { \ + static nsresult _InstanceClass##Constructor(nsISupports* aOuter, \ + REFNSIID aIID, void** aResult) { \ nsresult rv; \ \ RefPtr<_InstanceClass> inst; \ @@ -63,8 +63,8 @@ struct RemoveAlreadyAddRefed> { // 'Constructor' that uses an existing getter function that gets a singleton. #define NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(_InstanceClass, _GetterProc) \ - static nsresult _InstanceClass##Constructor(nsISupports *aOuter, \ - REFNSIID aIID, void **aResult) { \ + static nsresult _InstanceClass##Constructor(nsISupports* aOuter, \ + REFNSIID aIID, void** aResult) { \ RefPtr<_InstanceClass> inst; \ \ *aResult = nullptr; \ diff --git a/xpcom/ds/nsQuickSort.cpp b/xpcom/ds/nsQuickSort.cpp index 1b4a861e25156..11ad2d95e9abf 100644 --- a/xpcom/ds/nsQuickSort.cpp +++ b/xpcom/ds/nsQuickSort.cpp @@ -47,9 +47,9 @@ extern "C" { # define INLINE #endif -typedef int cmp_t(const void *, const void *, void *); -static INLINE char *med3(char *, char *, char *, cmp_t *, void *); -static INLINE void swapfunc(char *, char *, int, int); +typedef int cmp_t(const void*, const void*, void*); +static INLINE char* med3(char*, char*, char*, cmp_t*, void*); +static INLINE void swapfunc(char*, char*, int, int); /* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". @@ -57,8 +57,8 @@ static INLINE void swapfunc(char *, char *, int, int); #define swapcode(TYPE, parmi, parmj, n) \ { \ long i = (n) / sizeof(TYPE); \ - TYPE *pi = (TYPE *)(parmi); \ - TYPE *pj = (TYPE *)(parmj); \ + TYPE* pi = (TYPE*)(parmi); \ + TYPE* pj = (TYPE*)(parmj); \ do { \ TYPE t = *pi; \ *pi++ = *pj; \ @@ -66,34 +66,34 @@ static INLINE void swapfunc(char *, char *, int, int); } while (--i > 0); \ } -#define SWAPINIT(a, es) \ - swaptype = ((char *)a - (char *)0) % sizeof(long) || es % sizeof(long) \ - ? 2 \ +#define SWAPINIT(a, es) \ + swaptype = ((char*)a - (char*)0) % sizeof(long) || es % sizeof(long) \ + ? 2 \ : es == sizeof(long) ? 0 : 1; -static INLINE void swapfunc(char *a, char *b, int n, int swaptype) { +static INLINE void swapfunc(char* a, char* b, int n, int swaptype) { if (swaptype <= 1) swapcode(long, a, b, n) else swapcode(char, a, b, n) } -#define swap(a, b) \ - if (swaptype == 0) { \ - long t = *(long *)(a); \ - *(long *)(a) = *(long *)(b); \ - *(long *)(b) = t; \ - } else \ - swapfunc((char *)a, (char *)b, (int)es, swaptype) +#define swap(a, b) \ + if (swaptype == 0) { \ + long t = *(long*)(a); \ + *(long*)(a) = *(long*)(b); \ + *(long*)(b) = t; \ + } else \ + swapfunc((char*)a, (char*)b, (int)es, swaptype) #define vecswap(a, b, n) \ - if ((n) > 0) swapfunc((char *)a, (char *)b, (int)n, swaptype) + if ((n) > 0) swapfunc((char*)a, (char*)b, (int)n, swaptype) -static INLINE char *med3(char *a, char *b, char *c, cmp_t *cmp, void *data) { +static INLINE char* med3(char* a, char* b, char* c, cmp_t* cmp, void* data) { return cmp(a, b, data) < 0 ? (cmp(b, c, data) < 0 ? b : (cmp(a, c, data) < 0 ? c : a)) : (cmp(b, c, data) > 0 ? b : (cmp(a, c, data) < 0 ? a : c)); } -void NS_QuickSort(void *a, unsigned int n, unsigned int es, cmp_t *cmp, - void *data) { +void NS_QuickSort(void* a, unsigned int n, unsigned int es, cmp_t* cmp, + void* data) { char *pa, *pb, *pc, *pd, *pl, *pm, *pn; int d, r, swaptype; @@ -101,16 +101,16 @@ void NS_QuickSort(void *a, unsigned int n, unsigned int es, cmp_t *cmp, SWAPINIT(a, es); /* Use insertion sort when input is small */ if (n < 7) { - for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es) - for (pl = pm; pl > (char *)a && cmp(pl - es, pl, data) > 0; pl -= es) + for (pm = (char*)a + es; pm < (char*)a + n * es; pm += es) + for (pl = pm; pl > (char*)a && cmp(pl - es, pl, data) > 0; pl -= es) swap(pl, pl - es); return; } /* Choose pivot */ - pm = (char *)a + (n / 2) * es; + pm = (char*)a + (n / 2) * es; if (n > 7) { - pl = (char *)a; - pn = (char *)a + (n - 1) * es; + pl = (char*)a; + pn = (char*)a + (n - 1) * es; if (n > 40) { d = (n / 8) * es; pl = med3(pl, pl + d, pl + 2 * d, cmp, data); @@ -120,9 +120,9 @@ void NS_QuickSort(void *a, unsigned int n, unsigned int es, cmp_t *cmp, pm = med3(pl, pm, pn, cmp, data); } swap(a, pm); - pa = pb = (char *)a + es; + pa = pb = (char*)a + es; - pc = pd = (char *)a + (n - 1) * es; + pc = pd = (char*)a + (n - 1) * es; /* loop invariants: * [a, pa) = pivot * [pa, pb) < pivot @@ -151,8 +151,8 @@ void NS_QuickSort(void *a, unsigned int n, unsigned int es, cmp_t *cmp, pc -= es; } /* Move pivot values */ - pn = (char *)a + n * es; - r = XPCOM_MIN(pa - (char *)a, pb - pa); + pn = (char*)a + n * es; + r = XPCOM_MIN(pa - (char*)a, pb - pa); vecswap(a, pb - r, r); r = XPCOM_MIN(pd - pc, pn - pd - es); vecswap(pb, pn - r, r); diff --git a/xpcom/io/crc32c.h b/xpcom/io/crc32c.h index ded6d54efa17a..4fb3ddbde1a68 100644 --- a/xpcom/io/crc32c.h +++ b/xpcom/io/crc32c.h @@ -13,7 +13,7 @@ extern "C" { // // ComputeCrc32c(~0, buffer, bufferLength); // -uint32_t ComputeCrc32c(uint32_t aCrc, const void *aBuf, size_t aSize); +uint32_t ComputeCrc32c(uint32_t aCrc, const void* aBuf, size_t aSize); #ifdef __cplusplus } // extern "C" diff --git a/xpcom/io/nsLocalFile.h b/xpcom/io/nsLocalFile.h index 221512e84e81f..56a2e3444cc10 100644 --- a/xpcom/io/nsLocalFile.h +++ b/xpcom/io/nsLocalFile.h @@ -17,19 +17,19 @@ } #define NS_DECL_NSLOCALFILE_UNICODE_METHODS \ - nsresult AppendUnicode(const char16_t *aNode); \ - nsresult GetUnicodeLeafName(char16_t **aLeafName); \ - nsresult SetUnicodeLeafName(const char16_t *aLeafName); \ - nsresult CopyToUnicode(nsIFile *aNewParentDir, \ - const char16_t *aNewLeafName); \ - nsresult CopyToFollowingLinksUnicode(nsIFile *aNewParentDir, \ - const char16_t *aNewLeafName); \ - nsresult MoveToUnicode(nsIFile *aNewParentDir, \ - const char16_t *aNewLeafName); \ - nsresult GetUnicodeTarget(char16_t **aTarget); \ - nsresult GetUnicodePath(char16_t **aPath); \ - nsresult InitWithUnicodePath(const char16_t *aPath); \ - nsresult AppendRelativeUnicodePath(const char16_t *aRelativePath); + nsresult AppendUnicode(const char16_t* aNode); \ + nsresult GetUnicodeLeafName(char16_t** aLeafName); \ + nsresult SetUnicodeLeafName(const char16_t* aLeafName); \ + nsresult CopyToUnicode(nsIFile* aNewParentDir, \ + const char16_t* aNewLeafName); \ + nsresult CopyToFollowingLinksUnicode(nsIFile* aNewParentDir, \ + const char16_t* aNewLeafName); \ + nsresult MoveToUnicode(nsIFile* aNewParentDir, \ + const char16_t* aNewLeafName); \ + nsresult GetUnicodeTarget(char16_t** aTarget); \ + nsresult GetUnicodePath(char16_t** aPath); \ + nsresult InitWithUnicodePath(const char16_t* aPath); \ + nsresult AppendRelativeUnicodePath(const char16_t* aRelativePath); // XPCOMInit needs to know about how we are implemented, // so here we will export it. Other users should not depend diff --git a/xpcom/tests/RegFactory.cpp b/xpcom/tests/RegFactory.cpp index cb5ba00d26929..fc74b87f13f67 100644 --- a/xpcom/tests/RegFactory.cpp +++ b/xpcom/tests/RegFactory.cpp @@ -34,7 +34,7 @@ void print_err(nsresult err) { } } -nsresult Register(nsIComponentRegistrar *registrar, const char *path) { +nsresult Register(nsIComponentRegistrar* registrar, const char* path) { nsCOMPtr file; nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(path), true, getter_AddRefs(file)); @@ -43,7 +43,7 @@ nsresult Register(nsIComponentRegistrar *registrar, const char *path) { return rv; } -nsresult Unregister(const char *path) { +nsresult Unregister(const char* path) { /* NEEDS IMPLEMENTATION */ #if 0 nsresult res = nsComponentManager::AutoUnregisterComponent(path); @@ -53,7 +53,7 @@ nsresult Unregister(const char *path) { #endif } -int ProcessArgs(nsIComponentRegistrar *registrar, int argc, char *argv[]) { +int ProcessArgs(nsIComponentRegistrar* registrar, int argc, char* argv[]) { int i = 1; nsresult res; @@ -96,7 +96,7 @@ int ProcessArgs(nsIComponentRegistrar *registrar, int argc, char *argv[]) { return 0; } -int main(int argc, char *argv[]) { +int main(int argc, char* argv[]) { int ret = 0; nsresult rv; { diff --git a/xpcom/tests/TestPRIntN.cpp b/xpcom/tests/TestPRIntN.cpp index d295ea64ee41d..0873d16ef8900 100644 --- a/xpcom/tests/TestPRIntN.cpp +++ b/xpcom/tests/TestPRIntN.cpp @@ -9,14 +9,14 @@ // PRInt{N} matches int{N}_t. If they don't match, we should get a // compiler warning or error in main(). -static void ClearNSPRIntTypes(PRInt8 *a, PRInt16 *b, PRInt32 *c, PRInt64 *d) { +static void ClearNSPRIntTypes(PRInt8* a, PRInt16* b, PRInt32* c, PRInt64* d) { *a = 0; *b = 0; *c = 0; *d = 0; } -static void ClearStdIntTypes(int8_t *w, int16_t *x, int32_t *y, int64_t *z) { +static void ClearStdIntTypes(int8_t* w, int16_t* x, int32_t* y, int64_t* z) { *w = 0; *x = 0; *y = 0; diff --git a/xpcom/tests/gtest/TestAutoPtr.cpp b/xpcom/tests/gtest/TestAutoPtr.cpp index d0f13673feea6..6d0caa7c99b31 100644 --- a/xpcom/tests/gtest/TestAutoPtr.cpp +++ b/xpcom/tests/gtest/TestAutoPtr.cpp @@ -11,9 +11,9 @@ class TestObjectBaseA { public: // Virtual dtor for deleting through base class pointer virtual ~TestObjectBaseA() {} - void MemberFunction(int, int *, int &) {} - virtual void VirtualMemberFunction(int, int *, int &){}; - virtual void VirtualConstMemberFunction(int, int *, int &) const {}; + void MemberFunction(int, int*, int&) {} + virtual void VirtualMemberFunction(int, int*, int&){}; + virtual void VirtualConstMemberFunction(int, int*, int&) const {}; int fooA; }; @@ -31,34 +31,34 @@ class TestObject : public TestObjectBaseA, public TestObjectBaseB { // Virtual dtor for deleting through base class pointer virtual ~TestObject() { destructed++; } - virtual void VirtualMemberFunction(int, int *, int &) override {} - virtual void VirtualConstMemberFunction(int, int *, int &) const override {} + virtual void VirtualMemberFunction(int, int*, int&) override {} + virtual void VirtualConstMemberFunction(int, int*, int&) const override {} static int destructed; - static const void *last_ptr; + static const void* last_ptr; }; int TestObject::destructed = 0; -const void *TestObject::last_ptr = nullptr; +const void* TestObject::last_ptr = nullptr; -static void CreateTestObject(TestObject **aResult) { +static void CreateTestObject(TestObject** aResult) { *aResult = new TestObject(); } -static void DoSomethingWithTestObject(TestObject *aIn) { - TestObject::last_ptr = static_cast(aIn); +static void DoSomethingWithTestObject(TestObject* aIn) { + TestObject::last_ptr = static_cast(aIn); } -static void DoSomethingWithConstTestObject(const TestObject *aIn) { - TestObject::last_ptr = static_cast(aIn); +static void DoSomethingWithConstTestObject(const TestObject* aIn) { + TestObject::last_ptr = static_cast(aIn); } -static void DoSomethingWithTestObjectBaseB(TestObjectBaseB *aIn) { - TestObject::last_ptr = static_cast(aIn); +static void DoSomethingWithTestObjectBaseB(TestObjectBaseB* aIn) { + TestObject::last_ptr = static_cast(aIn); } -static void DoSomethingWithConstTestObjectBaseB(const TestObjectBaseB *aIn) { - TestObject::last_ptr = static_cast(aIn); +static void DoSomethingWithConstTestObjectBaseB(const TestObjectBaseB* aIn) { + TestObject::last_ptr = static_cast(aIn); } TEST(AutoPtr, Assignment) @@ -94,13 +94,13 @@ TEST(AutoPtr, Casting) { // This comparison is always false, as it should be. The extra parens // suppress a -Wunreachable-code warning about printf being unreachable. - ASSERT_NE(((void *)(TestObject *)0x1000), - ((void *)(TestObjectBaseB *)(TestObject *)0x1000)); + ASSERT_NE(((void*)(TestObject*)0x1000), + ((void*)(TestObjectBaseB*)(TestObject*)0x1000)); { nsAutoPtr p1(new TestObject()); - TestObjectBaseB *p2 = p1; - ASSERT_NE(static_cast(p1), static_cast(p2)); + TestObjectBaseB* p2 = p1; + ASSERT_NE(static_cast(p1), static_cast(p2)); ASSERT_EQ(p1, p2); ASSERT_FALSE(p1 != p2); ASSERT_EQ(p2, p1); @@ -108,7 +108,7 @@ TEST(AutoPtr, Casting) } { - TestObject *p1 = new TestObject(); + TestObject* p1 = new TestObject(); nsAutoPtr p2(p1); ASSERT_EQ(p1, p2); ASSERT_FALSE(p1 != p2); @@ -186,11 +186,11 @@ TEST(AutoPtr, ArrowOperator) { int test = 1; - void (TestObjectBaseA::*fPtr)(int, int *, int &) = + void (TestObjectBaseA::*fPtr)(int, int*, int&) = &TestObjectBaseA::MemberFunction; - void (TestObjectBaseA::*fVPtr)(int, int *, int &) = + void (TestObjectBaseA::*fVPtr)(int, int*, int&) = &TestObjectBaseA::VirtualMemberFunction; - void (TestObjectBaseA::*fVCPtr)(int, int *, int &) const = + void (TestObjectBaseA::*fVCPtr)(int, int*, int&) const = &TestObjectBaseA::VirtualConstMemberFunction; nsAutoPtr pobj(new TestObject()); (pobj->*fPtr)(test, &test, test); diff --git a/xpcom/tests/gtest/TestAutoRef.cpp b/xpcom/tests/gtest/TestAutoRef.cpp index cfc611db07c6a..b29a57fee3a9e 100644 --- a/xpcom/tests/gtest/TestAutoRef.cpp +++ b/xpcom/tests/gtest/TestAutoRef.cpp @@ -22,14 +22,14 @@ class nsAutoRefTraits : public nsPointerRefTraits { public: static int mTotalRefsCnt; - static void Release(TestObjectA *ptr) { + static void Release(TestObjectA* ptr) { ptr->mRefCnt--; if (ptr->mRefCnt == 0) { delete ptr; } } - static void AddRef(TestObjectA *ptr) { ptr->mRefCnt++; } + static void AddRef(TestObjectA* ptr) { ptr->mRefCnt++; } }; int nsAutoRefTraits::mTotalRefsCnt = 0; diff --git a/xpcom/tests/gtest/TestCallTemplates.cpp b/xpcom/tests/gtest/TestCallTemplates.cpp index bd262dfa4a048..bc1ec8818ffc0 100644 --- a/xpcom/tests/gtest/TestCallTemplates.cpp +++ b/xpcom/tests/gtest/TestCallTemplates.cpp @@ -82,14 +82,14 @@ inline void JustTestingCompilation() { /* Test CallQueryInterface */ - nsISupports *mySupportsPtr = reinterpret_cast(0x1000); + nsISupports* mySupportsPtr = reinterpret_cast(0x1000); - nsITestService *myITestService = nullptr; + nsITestService* myITestService = nullptr; CallQueryInterface(mySupportsPtr, &myITestService); - nsTestService *myTestService = - reinterpret_cast(mySupportsPtr); - nsITestService2 *myTestService2; + nsTestService* myTestService = + reinterpret_cast(mySupportsPtr); + nsITestService2* myTestService2; CallQueryInterface(myTestService, &myTestService2); nsCOMPtr mySupportsCOMPtr = mySupportsPtr; @@ -100,7 +100,7 @@ inline void JustTestingCompilation() { /* Test CallQueryReferent */ - nsIWeakReference *myWeakRef = static_cast(mySupportsPtr); + nsIWeakReference* myWeakRef = static_cast(mySupportsPtr); CallQueryReferent(myWeakRef, &myITestService); /* Test CallCreateInstance */ @@ -116,7 +116,7 @@ inline void JustTestingCompilation() { CallGetService(NS_TEST_SERVICE_CONTRACTID, &myITestService); /* Test CallGetInterface */ - nsIInterfaceRequestor *myInterfaceRequestor = - static_cast(mySupportsPtr); + nsIInterfaceRequestor* myInterfaceRequestor = + static_cast(mySupportsPtr); CallGetInterface(myInterfaceRequestor, &myITestService); } diff --git a/xpcom/tests/gtest/TestTextFormatter.cpp b/xpcom/tests/gtest/TestTextFormatter.cpp index e532b3c65b5c1..0c2e35dc1e7ea 100644 --- a/xpcom/tests/gtest/TestTextFormatter.cpp +++ b/xpcom/tests/gtest/TestTextFormatter.cpp @@ -19,7 +19,7 @@ TEST(TextFormatter, Tests) nsTextFormatter::snprintf(buf, 256, fmt.get(), d, 333, utf8, ucs2); nsAutoString out(buf); - const char16_t *uout = out.get(); + const char16_t* uout = out.get(); const char16_t expected[] = { 0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x4E00, 0xAC00, 0xFF45, 0x0103, 0x20, 0x33, 0x20, 0x33, 0x33, 0x33, 0x20, @@ -35,8 +35,7 @@ TEST(TextFormatter, Tests) EXPECT_STREQ("%1m!", NS_ConvertUTF16toUTF8(out2).get()); // Treat NULL the same in both %s cases. - nsTextFormatter::ssprintf(out2, u"%s %S", (char *)nullptr, - (char16_t *)nullptr); + nsTextFormatter::ssprintf(out2, u"%s %S", (char*)nullptr, (char16_t*)nullptr); EXPECT_STREQ("(null) (null)", NS_ConvertUTF16toUTF8(out2).get()); nsTextFormatter::ssprintf(out2, u"%lld", INT64_MIN); diff --git a/xpcom/tests/windows/TestCOM.cpp b/xpcom/tests/windows/TestCOM.cpp index bbc87d5c3d8ef..c0d66013b8713 100644 --- a/xpcom/tests/windows/TestCOM.cpp +++ b/xpcom/tests/windows/TestCOM.cpp @@ -73,8 +73,8 @@ class nsTestComFactory final : public nsIFactory { public: nsTestComFactory() {} - NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID &aIID, - void **aResult); + NS_IMETHOD CreateInstance(nsISupports* aOuter, const nsIID& aIID, + void** aResult); NS_IMETHOD LockFactory(bool aLock) override { return NS_OK; } @@ -85,13 +85,13 @@ int nsTestComFactory::sDestructions; NS_IMPL_ISUPPORTS(nsTestComFactory, nsIFactory) -nsresult nsTestComFactory::CreateInstance(nsISupports *aOuter, - const nsIID &aIID, void **aResult) { +nsresult nsTestComFactory::CreateInstance(nsISupports* aOuter, + const nsIID& aIID, void** aResult) { if (aOuter != nullptr) { return NS_ERROR_NO_AGGREGATION; } - nsTestCom *t = new nsTestCom(); + nsTestCom* t = new nsTestCom(); if (t == nullptr) { return NS_ERROR_OUT_OF_MEMORY; @@ -106,30 +106,29 @@ nsresult nsTestComFactory::CreateInstance(nsISupports *aOuter, TEST(TestCOM, WindowsInterop) { - nsTestComFactory *inst = new nsTestComFactory(); + nsTestComFactory* inst = new nsTestComFactory(); // Test we can QI nsIFactory to an IClassFactory. - IClassFactory *iFactory = nullptr; - nsresult rv = - inst->QueryInterface(NS_GET_IID(nsIFactory), (void **)&iFactory); + IClassFactory* iFactory = nullptr; + nsresult rv = inst->QueryInterface(NS_GET_IID(nsIFactory), (void**)&iFactory); ASSERT_TRUE(NS_SUCCEEDED(rv)); ASSERT_TRUE(iFactory); // Test we can CreateInstance with an IUnknown. - IUnknown *iUnknown = nullptr; + IUnknown* iUnknown = nullptr; HRESULT hr = iFactory->LockServer(TRUE); ASSERT_TRUE(SUCCEEDED(hr)); - hr = iFactory->CreateInstance(nullptr, IID_IUnknown, (void **)&iUnknown); + hr = iFactory->CreateInstance(nullptr, IID_IUnknown, (void**)&iUnknown); ASSERT_TRUE(SUCCEEDED(hr)); ASSERT_TRUE(iUnknown); hr = iFactory->LockServer(FALSE); ASSERT_TRUE(SUCCEEDED(hr)); // Test we can QI an IUnknown to nsITestCom. - nsITestCom *iTestCom = nullptr; + nsITestCom* iTestCom = nullptr; GUID testGUID = NS_ITEST_COM_IID; - hr = iUnknown->QueryInterface(testGUID, (void **)&iTestCom); + hr = iUnknown->QueryInterface(testGUID, (void**)&iTestCom); ASSERT_TRUE(SUCCEEDED(hr)); ASSERT_TRUE(iTestCom); diff --git a/xpfe/appshell/nsAppShellService.h b/xpfe/appshell/nsAppShellService.h index c0395fbb79dfe..6ffeedbdcdb3f 100644 --- a/xpfe/appshell/nsAppShellService.h +++ b/xpfe/appshell/nsAppShellService.h @@ -39,13 +39,13 @@ class nsAppShellService final : public nsIAppShellService, public nsIObserver { void EnsureHiddenWindow(); void EnsurePrivateHiddenWindow(); - nsresult JustCreateTopWindow(nsIXULWindow *aParent, nsIURI *aUrl, + nsresult JustCreateTopWindow(nsIXULWindow* aParent, nsIURI* aUrl, uint32_t aChromeMask, int32_t aInitialWidth, int32_t aInitialHeight, bool aIsHiddenWindow, - nsIRemoteTab *aOpeningTab, - mozIDOMWindowProxy *aOpenerWindow, - nsWebShellWindow **aResult); - uint32_t CalculateWindowZLevel(nsIXULWindow *aParent, uint32_t aChromeMask); + nsIRemoteTab* aOpeningTab, + mozIDOMWindowProxy* aOpenerWindow, + nsWebShellWindow** aResult); + uint32_t CalculateWindowZLevel(nsIXULWindow* aParent, uint32_t aChromeMask); RefPtr mHiddenWindow; RefPtr mHiddenPrivateWindow; diff --git a/xpfe/appshell/nsAppShellWindowEnumerator.cpp b/xpfe/appshell/nsAppShellWindowEnumerator.cpp index 59a34f842a753..5a46dd021965e 100644 --- a/xpfe/appshell/nsAppShellWindowEnumerator.cpp +++ b/xpfe/appshell/nsAppShellWindowEnumerator.cpp @@ -24,11 +24,11 @@ using mozilla::dom::Element; // static helper functions // -static void GetAttribute(nsIXULWindow *inWindow, const nsAString &inAttribute, - nsAString &outValue); -static void GetWindowType(nsIXULWindow *inWindow, nsString &outType); +static void GetAttribute(nsIXULWindow* inWindow, const nsAString& inAttribute, + nsAString& outValue); +static void GetWindowType(nsIXULWindow* inWindow, nsString& outType); -static Element *GetElementFromDocShell(nsIDocShell *aShell) { +static Element* GetElementFromDocShell(nsIDocShell* aShell) { nsCOMPtr cv; aShell->GetContentViewer(getter_AddRefs(cv)); if (cv) { @@ -42,8 +42,8 @@ static Element *GetElementFromDocShell(nsIDocShell *aShell) { } // generic "retrieve the value of a XUL attribute" function -void GetAttribute(nsIXULWindow *inWindow, const nsAString &inAttribute, - nsAString &outValue) { +void GetAttribute(nsIXULWindow* inWindow, const nsAString& inAttribute, + nsAString& outValue) { nsCOMPtr shell; if (inWindow && NS_SUCCEEDED(inWindow->GetDocShell(getter_AddRefs(shell)))) { RefPtr webshellElement = GetElementFromDocShell(shell); @@ -55,7 +55,7 @@ void GetAttribute(nsIXULWindow *inWindow, const nsAString &inAttribute, // retrieve the window type, stored as the value of a particular // attribute in its XUL window tag -void GetWindowType(nsIXULWindow *aWindow, nsString &outType) { +void GetWindowType(nsIXULWindow* aWindow, nsString& outType) { GetAttribute(aWindow, NS_LITERAL_STRING("windowtype"), outType); } @@ -63,7 +63,7 @@ void GetWindowType(nsIXULWindow *aWindow, nsString &outType) { // nsWindowInfo // -nsWindowInfo::nsWindowInfo(nsIXULWindow *inWindow, int32_t inTimeStamp) +nsWindowInfo::nsWindowInfo(nsIXULWindow* inWindow, int32_t inTimeStamp) : mWindow(inWindow), mTimeStamp(inTimeStamp), mZLevel(nsIXULWindow::normalZ) { @@ -74,7 +74,7 @@ nsWindowInfo::~nsWindowInfo() {} // return true if the window described by this WindowInfo has a type // equal to the given type -bool nsWindowInfo::TypeEquals(const nsAString &aType) { +bool nsWindowInfo::TypeEquals(const nsAString& aType) { nsAutoString rtnString; GetWindowType(mWindow, rtnString); return rtnString == aType; @@ -82,7 +82,7 @@ bool nsWindowInfo::TypeEquals(const nsAString &aType) { // insert the struct into their two linked lists, in position after the // given (independent) method arguments -void nsWindowInfo::InsertAfter(nsWindowInfo *inOlder, nsWindowInfo *inHigher) { +void nsWindowInfo::InsertAfter(nsWindowInfo* inOlder, nsWindowInfo* inHigher) { if (inOlder) { mOlder = inOlder; mYounger = inOlder->mYounger; @@ -131,7 +131,7 @@ void nsWindowInfo::ReferenceSelf(bool inAge, bool inZ) { // nsAppShellWindowEnumerator::nsAppShellWindowEnumerator( - const char16_t *aTypeString, nsWindowMediator &aMediator) + const char16_t* aTypeString, nsWindowMediator& aMediator) : mWindowMediator(&aMediator), mType(aTypeString), mCurrentPosition(nullptr) { @@ -152,7 +152,7 @@ void nsAppShellWindowEnumerator::AdjustInitialPosition() { mCurrentPosition = FindNext(); } -NS_IMETHODIMP nsAppShellWindowEnumerator::HasMoreElements(bool *retval) { +NS_IMETHODIMP nsAppShellWindowEnumerator::HasMoreElements(bool* retval) { if (!retval) return NS_ERROR_INVALID_ARG; *retval = mCurrentPosition ? true : false; @@ -160,7 +160,7 @@ NS_IMETHODIMP nsAppShellWindowEnumerator::HasMoreElements(bool *retval) { } // if a window is being removed adjust the iterator's current position -void nsAppShellWindowEnumerator::WindowRemoved(nsWindowInfo *inInfo) { +void nsAppShellWindowEnumerator::WindowRemoved(nsWindowInfo* inInfo) { if (mCurrentPosition == inInfo) mCurrentPosition = FindNext(); } @@ -168,13 +168,13 @@ void nsAppShellWindowEnumerator::WindowRemoved(nsWindowInfo *inInfo) { // nsASDOMWindowEnumerator // -nsASDOMWindowEnumerator::nsASDOMWindowEnumerator(const char16_t *aTypeString, - nsWindowMediator &aMediator) +nsASDOMWindowEnumerator::nsASDOMWindowEnumerator(const char16_t* aTypeString, + nsWindowMediator& aMediator) : nsAppShellWindowEnumerator(aTypeString, aMediator) {} nsASDOMWindowEnumerator::~nsASDOMWindowEnumerator() {} -NS_IMETHODIMP nsASDOMWindowEnumerator::GetNext(nsISupports **retval) { +NS_IMETHODIMP nsASDOMWindowEnumerator::GetNext(nsISupports** retval) { if (!retval) return NS_ERROR_INVALID_ARG; *retval = nullptr; @@ -191,13 +191,13 @@ NS_IMETHODIMP nsASDOMWindowEnumerator::GetNext(nsISupports **retval) { // nsASXULWindowEnumerator // -nsASXULWindowEnumerator::nsASXULWindowEnumerator(const char16_t *aTypeString, - nsWindowMediator &aMediator) +nsASXULWindowEnumerator::nsASXULWindowEnumerator(const char16_t* aTypeString, + nsWindowMediator& aMediator) : nsAppShellWindowEnumerator(aTypeString, aMediator) {} nsASXULWindowEnumerator::~nsASXULWindowEnumerator() {} -NS_IMETHODIMP nsASXULWindowEnumerator::GetNext(nsISupports **retval) { +NS_IMETHODIMP nsASXULWindowEnumerator::GetNext(nsISupports** retval) { if (!retval) return NS_ERROR_INVALID_ARG; *retval = nullptr; @@ -214,7 +214,7 @@ NS_IMETHODIMP nsASXULWindowEnumerator::GetNext(nsISupports **retval) { // nsASDOMWindowEarlyToLateEnumerator::nsASDOMWindowEarlyToLateEnumerator( - const char16_t *aTypeString, nsWindowMediator &aMediator) + const char16_t* aTypeString, nsWindowMediator& aMediator) : nsASDOMWindowEnumerator(aTypeString, aMediator) { mCurrentPosition = aMediator.mOldestWindow; AdjustInitialPosition(); @@ -222,7 +222,7 @@ nsASDOMWindowEarlyToLateEnumerator::nsASDOMWindowEarlyToLateEnumerator( nsASDOMWindowEarlyToLateEnumerator::~nsASDOMWindowEarlyToLateEnumerator() {} -nsWindowInfo *nsASDOMWindowEarlyToLateEnumerator::FindNext() { +nsWindowInfo* nsASDOMWindowEarlyToLateEnumerator::FindNext() { nsWindowInfo *info, *listEnd; bool allWindows = mType.IsEmpty(); @@ -245,7 +245,7 @@ nsWindowInfo *nsASDOMWindowEarlyToLateEnumerator::FindNext() { // nsASXULWindowEarlyToLateEnumerator::nsASXULWindowEarlyToLateEnumerator( - const char16_t *aTypeString, nsWindowMediator &aMediator) + const char16_t* aTypeString, nsWindowMediator& aMediator) : nsASXULWindowEnumerator(aTypeString, aMediator) { mCurrentPosition = aMediator.mOldestWindow; AdjustInitialPosition(); @@ -253,7 +253,7 @@ nsASXULWindowEarlyToLateEnumerator::nsASXULWindowEarlyToLateEnumerator( nsASXULWindowEarlyToLateEnumerator::~nsASXULWindowEarlyToLateEnumerator() {} -nsWindowInfo *nsASXULWindowEarlyToLateEnumerator::FindNext() { +nsWindowInfo* nsASXULWindowEarlyToLateEnumerator::FindNext() { nsWindowInfo *info, *listEnd; bool allWindows = mType.IsEmpty(); @@ -282,7 +282,7 @@ nsWindowInfo *nsASXULWindowEarlyToLateEnumerator::FindNext() { // nsASXULWindowFrontToBackEnumerator::nsASXULWindowFrontToBackEnumerator( - const char16_t *aTypeString, nsWindowMediator &aMediator) + const char16_t* aTypeString, nsWindowMediator& aMediator) : nsASXULWindowEnumerator(aTypeString, aMediator) { mCurrentPosition = aMediator.mTopmostWindow; AdjustInitialPosition(); @@ -290,7 +290,7 @@ nsASXULWindowFrontToBackEnumerator::nsASXULWindowFrontToBackEnumerator( nsASXULWindowFrontToBackEnumerator::~nsASXULWindowFrontToBackEnumerator() {} -nsWindowInfo *nsASXULWindowFrontToBackEnumerator::FindNext() { +nsWindowInfo* nsASXULWindowFrontToBackEnumerator::FindNext() { nsWindowInfo *info, *listEnd; bool allWindows = mType.IsEmpty(); @@ -313,7 +313,7 @@ nsWindowInfo *nsASXULWindowFrontToBackEnumerator::FindNext() { // nsASXULWindowBackToFrontEnumerator::nsASXULWindowBackToFrontEnumerator( - const char16_t *aTypeString, nsWindowMediator &aMediator) + const char16_t* aTypeString, nsWindowMediator& aMediator) : nsASXULWindowEnumerator(aTypeString, aMediator) { mCurrentPosition = aMediator.mTopmostWindow ? aMediator.mTopmostWindow->mHigher : nullptr; @@ -322,7 +322,7 @@ nsASXULWindowBackToFrontEnumerator::nsASXULWindowBackToFrontEnumerator( nsASXULWindowBackToFrontEnumerator::~nsASXULWindowBackToFrontEnumerator() {} -nsWindowInfo *nsASXULWindowBackToFrontEnumerator::FindNext() { +nsWindowInfo* nsASXULWindowBackToFrontEnumerator::FindNext() { nsWindowInfo *info, *listEnd; bool allWindows = mType.IsEmpty(); diff --git a/xpfe/appshell/nsAppShellWindowEnumerator.h b/xpfe/appshell/nsAppShellWindowEnumerator.h index 9ed85fdd95d44..e16b6011346b2 100644 --- a/xpfe/appshell/nsAppShellWindowEnumerator.h +++ b/xpfe/appshell/nsAppShellWindowEnumerator.h @@ -19,7 +19,7 @@ class nsWindowMediator; // struct nsWindowInfo { - nsWindowInfo(nsIXULWindow *inWindow, int32_t inTimeStamp); + nsWindowInfo(nsIXULWindow* inWindow, int32_t inTimeStamp); ~nsWindowInfo(); nsCOMPtr mWindow; @@ -32,8 +32,8 @@ struct nsWindowInfo { nsWindowInfo *mLower, // next lower in z-order *mHigher; - bool TypeEquals(const nsAString &aType); - void InsertAfter(nsWindowInfo *inOlder, nsWindowInfo *inHigher); + bool TypeEquals(const nsAString& aType); + void InsertAfter(nsWindowInfo* inOlder, nsWindowInfo* inHigher); void Unlink(bool inAge, bool inZ); void ReferenceSelf(bool inAge, bool inZ); }; @@ -46,40 +46,40 @@ class nsAppShellWindowEnumerator : public nsSimpleEnumerator { friend class nsWindowMediator; public: - nsAppShellWindowEnumerator(const char16_t *aTypeString, - nsWindowMediator &inMediator); - NS_IMETHOD GetNext(nsISupports **retval) override = 0; - NS_IMETHOD HasMoreElements(bool *retval) override; + nsAppShellWindowEnumerator(const char16_t* aTypeString, + nsWindowMediator& inMediator); + NS_IMETHOD GetNext(nsISupports** retval) override = 0; + NS_IMETHOD HasMoreElements(bool* retval) override; protected: ~nsAppShellWindowEnumerator() override; void AdjustInitialPosition(); - virtual nsWindowInfo *FindNext() = 0; + virtual nsWindowInfo* FindNext() = 0; - void WindowRemoved(nsWindowInfo *inInfo); + void WindowRemoved(nsWindowInfo* inInfo); - nsWindowMediator *mWindowMediator; + nsWindowMediator* mWindowMediator; nsString mType; - nsWindowInfo *mCurrentPosition; + nsWindowInfo* mCurrentPosition; }; class nsASDOMWindowEnumerator : public nsAppShellWindowEnumerator { public: - nsASDOMWindowEnumerator(const char16_t *aTypeString, - nsWindowMediator &inMediator); + nsASDOMWindowEnumerator(const char16_t* aTypeString, + nsWindowMediator& inMediator); virtual ~nsASDOMWindowEnumerator(); - NS_IMETHOD GetNext(nsISupports **retval) override; + NS_IMETHOD GetNext(nsISupports** retval) override; }; class nsASXULWindowEnumerator : public nsAppShellWindowEnumerator { public: - nsASXULWindowEnumerator(const char16_t *aTypeString, - nsWindowMediator &inMediator); + nsASXULWindowEnumerator(const char16_t* aTypeString, + nsWindowMediator& inMediator); virtual ~nsASXULWindowEnumerator(); - NS_IMETHOD GetNext(nsISupports **retval) override; + NS_IMETHOD GetNext(nsISupports** retval) override; - const nsID &DefaultInterface() override { return NS_GET_IID(nsIXULWindow); } + const nsID& DefaultInterface() override { return NS_GET_IID(nsIXULWindow); } }; // @@ -88,46 +88,46 @@ class nsASXULWindowEnumerator : public nsAppShellWindowEnumerator { class nsASDOMWindowEarlyToLateEnumerator : public nsASDOMWindowEnumerator { public: - nsASDOMWindowEarlyToLateEnumerator(const char16_t *aTypeString, - nsWindowMediator &inMediator); + nsASDOMWindowEarlyToLateEnumerator(const char16_t* aTypeString, + nsWindowMediator& inMediator); virtual ~nsASDOMWindowEarlyToLateEnumerator(); protected: - virtual nsWindowInfo *FindNext() override; + virtual nsWindowInfo* FindNext() override; }; class nsASXULWindowEarlyToLateEnumerator : public nsASXULWindowEnumerator { public: - nsASXULWindowEarlyToLateEnumerator(const char16_t *aTypeString, - nsWindowMediator &inMediator); + nsASXULWindowEarlyToLateEnumerator(const char16_t* aTypeString, + nsWindowMediator& inMediator); virtual ~nsASXULWindowEarlyToLateEnumerator(); protected: - virtual nsWindowInfo *FindNext() override; + virtual nsWindowInfo* FindNext() override; }; class nsASXULWindowFrontToBackEnumerator : public nsASXULWindowEnumerator { public: - nsASXULWindowFrontToBackEnumerator(const char16_t *aTypeString, - nsWindowMediator &inMediator); + nsASXULWindowFrontToBackEnumerator(const char16_t* aTypeString, + nsWindowMediator& inMediator); virtual ~nsASXULWindowFrontToBackEnumerator(); protected: - virtual nsWindowInfo *FindNext() override; + virtual nsWindowInfo* FindNext() override; }; class nsASXULWindowBackToFrontEnumerator : public nsASXULWindowEnumerator { public: - nsASXULWindowBackToFrontEnumerator(const char16_t *aTypeString, - nsWindowMediator &inMediator); + nsASXULWindowBackToFrontEnumerator(const char16_t* aTypeString, + nsWindowMediator& inMediator); virtual ~nsASXULWindowBackToFrontEnumerator(); protected: - virtual nsWindowInfo *FindNext() override; + virtual nsWindowInfo* FindNext() override; }; #endif diff --git a/xpfe/appshell/nsWindowMediator.h b/xpfe/appshell/nsWindowMediator.h index 2e4126c8a5401..e7d29a4f92aba 100644 --- a/xpfe/appshell/nsWindowMediator.h +++ b/xpfe/appshell/nsWindowMediator.h @@ -43,24 +43,24 @@ class nsWindowMediator : public nsIWindowMediator, NS_DECL_NSIWINDOWMEDIATOR NS_DECL_NSIOBSERVER - static nsresult GetDOMWindow(nsIXULWindow *inWindow, - nsCOMPtr &outDOMWindow); + static nsresult GetDOMWindow(nsIXULWindow* inWindow, + nsCOMPtr& outDOMWindow); private: - int32_t AddEnumerator(nsAppShellWindowEnumerator *inEnumerator); - int32_t RemoveEnumerator(nsAppShellWindowEnumerator *inEnumerator); - nsWindowInfo *MostRecentWindowInfo(const char16_t *inType, + int32_t AddEnumerator(nsAppShellWindowEnumerator* inEnumerator); + int32_t RemoveEnumerator(nsAppShellWindowEnumerator* inEnumerator); + nsWindowInfo* MostRecentWindowInfo(const char16_t* inType, bool aSkipPrivateBrowsingOrClosed = false); - nsresult UnregisterWindow(nsWindowInfo *inInfo); - nsWindowInfo *GetInfoFor(nsIXULWindow *aWindow); - nsWindowInfo *GetInfoFor(nsIWidget *aWindow); + nsresult UnregisterWindow(nsWindowInfo* inInfo); + nsWindowInfo* GetInfoFor(nsIXULWindow* aWindow); + nsWindowInfo* GetInfoFor(nsIWidget* aWindow); void SortZOrderFrontToBack(); void SortZOrderBackToFront(); - nsTArray mEnumeratorList; - nsWindowInfo *mOldestWindow; - nsWindowInfo *mTopmostWindow; + nsTArray mEnumeratorList; + nsWindowInfo* mOldestWindow; + nsWindowInfo* mTopmostWindow; int32_t mTimeStamp; bool mSortingZOrder; bool mReady;