From 3dafb8d491fb8aa460724f7e9d02f2acdb77aa21 Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Sat, 30 May 2020 10:19:44 +0800 Subject: [PATCH] import changes from `dev' branch of rmottola/Arctic-Fox: - Bug 1162293 - Part 1: Remove instances of #ifdef PR_LOGGING. r=froydnj (20456f454) - Bug 1162293 - Part 2: Fix string leak in logging code. r=froydnj (2b7552940) - Bug 1162748 - Remove instances of #ifdef PR_LOGGING in graphics. r=froydnj (1ec0e8140) - Bug 1156632 - Remove unused forward class declarations - patch 1 - dom/base, r=ehsan (eba98c427) - Bug 1149420 - Make the IndexedDB permissions prompt work in e10s. r=bent/mfinkle (fc977c048) - Bug 1156632 - Remove unused forward class declarations - patch 2 - dom/media, dom/indexedDB, dom/svg, r=ehsan (011caf393) - Bug 1156632 - Remove unused forward class declarations - patch 3 - dom/{events,xbl,xslt,xul} and others, r=ehsan (72051c70b) - Bug 1148005; Update WebVR APIs based on latest spec changes; r=baku (15b0a712f) - Bug 1156632 - Remove unused forward class declarations - patch 4 - netwerk image and dom, r=ehsan (5ee4f1679) - Bug 1139972 - IPC Proxy for charAt, r=tbsaunde (95d3626ec) - Bug 1139887 - IPC Proxy for caretOffset, r=tbsaunde (c44893cd5) - Bug 1141228 - include GfxMessageUtils.h in PDocAccessible.ipdl, r=tbsaunde (773e741f9) - goannaCoordType -> geckoCoordType (b6ede7903) - Bug 1145292 - IPC Proxy for ImageAccessible, r=tbsaunde (ca37ce753) - bug 1128751 - handle unbinding and rebinding of documents in content processes r=davidb (0ad3331ab) - Bug 1145366 - IPC Proxy for HyperLink, r=tbsaunde (87bc696f5) - Bug 1146615 - IPC Proxy for HyperText, r=tbsaunde (de5322207) - Bug 1146665 - IPC Proxy for TableCell, r=tbsaunde (895e24eee) - Bug 1147079 - IPC Proxy for Table, r=tbsaunde (6e54178fe) - Bug 1147168 - IPC Proxy for Selection, r=tbsaunde (40b8fa16e) - Bug 1147518 - IPC Proxy for Action, r=davidb (12d5a235f) - Bug 1147551 - IPC Proxy for min/cur/max values, r=davidb (3728abc54) - Bug 1148025 - IPC Proxy for 'Component', r=tbsaunde (38bea1f4a) - Bug 1148083 - IPC Proxy for Document, r=davidb (a7d53936d) - Bug 1132854 - Make nsIntSize a typedef of gfx::IntSize. r=Bas, roc (09d0ae0d9) - goannaRole -> geckoRole (421bdcd36) - bug 1138436 - start on proxying IAccessible2 r=surkov, r=davidb (b2be8ba44) - bug 1151402 - proxy most of IAccessibleText and IAccessibleEditableText r=davidb (dff7da028) - Bug 1162740 - Part 1: Remove instances of #ifdef PR_LOGGING in rdf. r=froydnj (e398edb14) - Bug 1162740 - Part 2: Wrap expensive calls in PR_LOG_TEST. r=froydnj (d873be4f4) - Bug 1067054 - Remove generic SQLITE_ERROR warning & suppress warning if transaction exists. r=mak (cdc03b034) - Bug 1137287 - Part 1: Shift some code from InterceptedChannelContent to HttpChannelChild. r=mayhemer (6141690a1) - Bug 1136969 - Add a check that OnStartRequest is called just once during the lifetime of a channel. r=mcmanus (3b6aa0560) - Bug 1053650 - Part 1: Add attribute 'networkInterfaceId' to XMLHttpRequest. r=bz Bug 1053650 - Part 2: Populate networkInterfaceId to SocketTransport r=mcmanus Bug 1053650 - Part 3: Make use of gonk-specific per-interface DNS lookup. r=mcmanus Bug 1053650 follow-up: Mark GetNetworkInterfaceId/SetNetworkInterfaceId as override (e308fc405) --- accessible/atk/AccessibleWrap.cpp | 4 +- accessible/atk/nsMaiInterfaceDocument.cpp | 89 +- accessible/atk/nsMaiInterfaceHypertext.cpp | 72 +- accessible/atk/nsMaiInterfaceImage.cpp | 28 +- accessible/atk/nsMaiInterfaceSelection.cpp | 89 +- accessible/atk/nsMaiInterfaceText.cpp | 72 +- accessible/atk/nsMaiInterfaceValue.cpp | 57 +- accessible/base/Asserts.cpp | 6 +- accessible/base/NotificationController.cpp | 15 +- accessible/base/RoleMap.h | 2 +- accessible/base/nsAccessibilityService.cpp | 4 +- accessible/base/nsAccessibilityService.h | 2 - accessible/base/nsTextEquivUtils.cpp | 4 +- accessible/ipc/DocAccessibleChild.cpp | 1174 ++++++++++++++++- accessible/ipc/DocAccessibleChild.h | 266 +++- accessible/ipc/DocAccessibleParent.cpp | 18 +- accessible/ipc/DocAccessibleParent.h | 11 +- accessible/ipc/PDocAccessible.ipdl | 116 +- accessible/ipc/ProxyAccessible.cpp | 641 ++++++++- accessible/ipc/ProxyAccessible.h | 126 +- accessible/ipc/moz.build | 18 + accessible/mac/mozAccessible.mm | 4 +- accessible/windows/ProxyWrappers.h | 52 + accessible/windows/ia2/ia2Accessible.cpp | 199 ++- accessible/windows/ia2/ia2Accessible.h | 3 + .../windows/ia2/ia2AccessibleEditableText.cpp | 26 +- accessible/windows/ia2/ia2AccessibleImage.cpp | 4 +- .../windows/ia2/ia2AccessibleRelation.h | 4 + accessible/windows/ia2/ia2AccessibleText.cpp | 169 ++- accessible/windows/ia2/moz.build | 3 + accessible/windows/msaa/AccessibleWrap.cpp | 16 +- accessible/windows/msaa/Platform.cpp | 17 +- accessible/windows/msaa/moz.build | 1 + browser/base/content/browser.js | 15 +- caps/DomainPolicy.h | 4 - caps/nsJSPrincipals.h | 2 - caps/nsPrincipal.h | 3 - caps/nsScriptSecurityManager.h | 3 - dom/base/DirectionalityUtils.h | 2 - dom/base/Element.h | 5 - dom/base/File.h | 2 - dom/base/ImportManager.h | 1 - dom/base/ShadowRoot.h | 3 - dom/base/ThirdPartyUtil.h | 2 - dom/base/URL.h | 2 - dom/base/WebSocket.h | 4 - dom/base/nsContentAreaDragDrop.h | 4 - dom/base/nsContentCreatorFunctions.h | 2 - dom/base/nsContentSink.h | 2 - dom/base/nsContentUtils.h | 7 - dom/base/nsDOMClassInfo.h | 3 - dom/base/nsDocument.h | 5 - dom/base/nsFrameLoader.h | 3 - dom/base/nsFrameMessageManager.h | 2 - dom/base/nsGenericDOMDataNode.h | 5 - dom/base/nsGlobalWindow.h | 2 +- dom/base/nsHostObjectProtocolHandler.h | 1 - dom/base/nsIAttribute.h | 1 - dom/base/nsIDOMScriptObjectFactory.h | 4 - dom/base/nsIDocument.h | 2 - dom/base/nsIDocumentObserver.h | 2 - dom/base/nsINode.h | 2 - dom/base/nsIScriptContext.h | 10 - dom/base/nsImageLoadingContent.h | 2 - dom/base/nsJSEnvironment.h | 4 - dom/base/nsMappedAttributes.h | 1 - dom/base/nsNameSpaceManager.h | 1 - dom/base/nsNodeUtils.h | 2 - dom/base/nsPIDOMWindow.h | 1 - dom/base/nsReferencedElement.h | 1 - dom/base/nsScriptNameSpaceManager.h | 4 - dom/base/nsTextFragment.h | 1 - dom/base/nsWindowRoot.h | 6 - dom/base/nsWrapperCache.h | 1 - dom/base/nsXMLContentSerializer.h | 1 - dom/base/nsXMLHttpRequest.cpp | 15 + dom/base/nsXMLHttpRequest.h | 19 + dom/battery/BatteryManager.h | 1 - dom/bindings/Bindings.conf | 9 - dom/bindings/test/TestCImplementedInterface.h | 2 - dom/bluetooth/BluetoothDevice.h | 1 - dom/bluetooth/BluetoothPropertyContainer.h | 1 - dom/bluetooth/BluetoothService.h | 1 - .../BluetoothDaemonSocketInterface.h | 2 - .../bluedroid/hfp/BluetoothHfpManager.h | 1 - dom/bluetooth2/BluetoothDevice.h | 1 - dom/bluetooth2/BluetoothDiscoveryHandle.h | 1 - dom/bluetooth2/BluetoothGatt.h | 2 - dom/bluetooth2/BluetoothPairingHandle.h | 2 - dom/bluetooth2/BluetoothPairingListener.h | 1 - dom/cache/OfflineStorage.h | 2 - dom/cache/ReadStream.h | 2 - dom/camera/GonkCameraControl.h | 3 - dom/camera/ICameraControl.h | 2 - dom/canvas/CanvasRenderingContext2D.h | 1 - dom/canvas/CanvasUtils.h | 4 - dom/canvas/WebGLContext.h | 2 - dom/canvas/WebGLFramebuffer.h | 1 - dom/canvas/WebGLObjectModel.h | 1 - dom/canvas/WebGLShaderPrecisionFormat.h | 2 - .../nsICanvasRenderingContextInternal.h | 1 - dom/datastore/DataStoreCursor.h | 2 - dom/datastore/DataStoreDB.h | 1 - dom/events/EventDispatcher.h | 1 - dom/events/EventListenerManager.h | 1 - dom/events/EventTarget.h | 1 - dom/events/IMEStateManager.h | 1 - dom/fetch/Fetch.h | 1 - dom/fetch/FetchDriver.h | 1 - dom/fetch/Headers.h | 2 - dom/fetch/InternalHeaders.h | 3 - dom/fetch/InternalRequest.h | 4 - dom/fetch/Request.h | 3 - dom/fetch/Response.h | 4 - dom/filesystem/FileSystemTaskBase.h | 1 - dom/fmradio/FMRadio.h | 1 - dom/gamepad/GamepadService.h | 2 - dom/html/HTMLAllCollection.h | 3 - dom/html/HTMLFrameElement.h | 2 - dom/html/HTMLInputElement.h | 1 - dom/html/HTMLSourceElement.h | 1 - dom/html/HTMLTableCellElement.h | 2 - dom/html/HTMLTableRowElement.h | 1 - dom/html/UndoManager.h | 1 - dom/html/nsFormSubmission.h | 5 - dom/html/nsHTMLDocument.h | 1 - dom/html/nsIForm.h | 2 - dom/html/nsIFormControl.h | 2 - dom/html/nsIHTMLCollection.h | 2 - dom/html/nsIHTMLDocument.h | 3 - dom/html/nsIRadioGroupContainer.h | 1 - dom/indexedDB/ActorsChild.cpp | 13 +- dom/indexedDB/ActorsChild.h | 1 - dom/indexedDB/ActorsParent.cpp | 8 +- dom/indexedDB/ActorsParent.h | 7 +- dom/indexedDB/IDBDatabase.h | 1 - dom/indexedDB/IDBObjectStore.h | 4 - dom/indexedDB/IDBRequest.h | 1 - dom/indexedDB/IDBTransaction.h | 2 - dom/indexedDB/IndexedDatabase.h | 4 - dom/indexedDB/IndexedDatabaseManager.h | 2 - dom/indexedDB/PermissionRequestBase.cpp | 25 +- dom/indexedDB/PermissionRequestBase.h | 8 +- dom/ipc/BlobChild.h | 1 - dom/ipc/BlobParent.h | 1 - dom/ipc/ContentChild.h | 6 - dom/ipc/ContentParent.h | 3 - dom/ipc/PBrowser.ipdl | 4 +- dom/ipc/PDocumentRenderer.ipdl | 2 +- dom/ipc/PreallocatedProcessManager.h | 2 - dom/ipc/ProcessHangMonitor.h | 2 - dom/ipc/StructuredCloneUtils.h | 3 - dom/ipc/TabParent.cpp | 11 +- dom/media/AbstractMediaDecoder.h | 1 - dom/media/AudioSegment.h | 1 - dom/media/AudioSink.h | 1 - dom/media/AudioTrack.h | 2 - dom/media/DOMMediaStream.h | 2 - dom/media/EncodedBufferCache.h | 2 - dom/media/GraphDriver.h | 1 - dom/media/Latency.h | 1 - dom/media/MediaData.cpp | 10 +- dom/media/MediaDecoderStateMachine.h | 5 - dom/media/MediaDeviceInfo.h | 3 - dom/media/MediaManager.h | 2 - dom/media/MediaShutdownManager.h | 1 - dom/media/MediaStreamGraph.h | 1 - dom/media/TextTrack.h | 1 - dom/media/VideoUtils.h | 2 +- dom/media/android/AndroidMediaPluginHost.h | 2 - dom/media/android/AndroidMediaReader.h | 4 - dom/media/directshow/DirectShowReader.h | 5 - dom/media/directshow/SourceFilter.h | 1 - dom/media/encoder/TrackEncoder.cpp | 2 +- dom/media/encoder/fmp4_muxer/ISOMediaBoxes.h | 1 - dom/media/encoder/fmp4_muxer/ISOMediaWriter.h | 1 - dom/media/gmp/GMPContentParent.h | 4 - dom/media/gmp/GMPParent.h | 1 - dom/media/imagecapture/ImageCapture.h | 2 - dom/media/mediasource/SourceBufferList.h | 1 - dom/media/omx/MediaOmxReader.h | 4 - dom/media/omx/OMXCodecProxy.h | 1 - dom/media/platforms/PlatformDecoderModule.h | 4 - dom/media/systemservices/LoadMonitor.h | 1 - dom/media/webaudio/AudioContext.h | 1 - dom/media/webaudio/blink/Reverb.h | 3 - dom/media/webm/WebMBufferedParser.h | 4 - dom/media/webrtc/MediaEngineDefault.h | 1 - .../webspeech/recognition/SpeechRecognition.h | 2 - dom/media/wmf/DXVA2Manager.h | 1 - dom/media/wmf/WMFReader.h | 4 - dom/mobileconnection/MobileNetworkInfo.h | 2 - dom/mobilemessage/MobileMessageCallback.h | 2 - dom/mobilemessage/ipc/SmsIPCService.h | 2 - dom/network/TCPServerSocketParent.h | 2 - dom/network/TCPSocketParent.h | 2 - dom/nfc/MozNDEFRecord.h | 1 - dom/offline/nsDOMOfflineResourceList.h | 2 - dom/plugins/base/android/android_npapi.h | 1 - dom/plugins/base/nsNPAPIPluginInstance.h | 1 + dom/plugins/base/nsPluginHost.h | 1 - dom/plugins/base/nsPluginInstanceOwner.h | 1 - dom/plugins/base/nsPluginTags.h | 1 - dom/plugins/ipc/PluginInstanceChild.h | 5 - dom/plugins/ipc/PluginInstanceParent.cpp | 2 +- dom/plugins/ipc/PluginInstanceParent.h | 3 - dom/plugins/ipc/PluginLibrary.h | 2 +- dom/plugins/ipc/PluginModuleChild.h | 1 - .../ipc/PluginScriptableObjectParent.h | 1 - dom/quota/Client.h | 1 - dom/quota/QuotaManager.h | 1 - dom/quota/nsIOfflineStorage.h | 2 - dom/security/nsCORSListenerProxy.h | 1 - dom/smil/nsISMILAttr.h | 1 - dom/svg/SVGContentUtils.h | 1 - dom/svg/SVGFragmentIdentifier.h | 1 - dom/svg/SVGIRect.h | 1 - dom/svg/SVGSVGElement.h | 1 - dom/svg/SVGTextPositioningElement.h | 2 - dom/svg/nsISVGPoint.h | 2 - dom/svg/nsSVGBoolean.h | 1 - dom/svg/nsSVGElement.h | 2 - dom/svg/nsSVGFilters.h | 1 - dom/svg/nsSVGPathGeometryElement.h | 2 - dom/system/gonk/AutoMounterSetting.h | 2 - dom/system/gonk/MozMtpServer.h | 6 - dom/system/gonk/nsVolume.h | 1 - dom/system/gonk/nsVolumeService.h | 1 - dom/tv/TVChannel.h | 1 - dom/vr/VRDevice.cpp | 195 +-- dom/vr/VRDevice.h | 93 +- dom/webidl/VRDevice.webidl | 62 +- dom/webidl/XMLHttpRequest.webidl | 5 + dom/workers/DataStore.h | 1 - dom/workers/DataStoreCursor.h | 1 - dom/workers/FileReaderSync.h | 1 - dom/workers/RuntimeService.h | 1 - dom/workers/ScriptLoader.h | 6 - dom/workers/ServiceWorker.h | 2 - dom/workers/ServiceWorkerManager.h | 2 - dom/workers/ServiceWorkerRegistrar.h | 1 - dom/workers/URL.h | 2 - dom/xbl/XBLChildrenElement.h | 2 - dom/xbl/nsBindingManager.h | 1 - dom/xbl/nsXBLBinding.h | 1 - dom/xbl/nsXBLDocumentInfo.h | 1 - dom/xbl/nsXBLProtoImplField.h | 1 - dom/xbl/nsXBLProtoImplMember.h | 1 - dom/xml/XMLDocument.h | 2 - dom/xml/nsXMLContentSink.h | 1 - dom/xslt/xpath/XPathExpression.h | 1 - dom/xslt/xpath/txExpr.h | 1 - dom/xslt/xpath/txExprParser.h | 2 - dom/xslt/xslt/txBufferingHandler.h | 1 - dom/xslt/xslt/txExecutionState.h | 1 - dom/xslt/xslt/txMozillaTextOutput.h | 1 - dom/xslt/xslt/txMozillaXMLOutput.h | 3 - dom/xslt/xslt/txMozillaXSLTProcessor.h | 1 - dom/xslt/xslt/txStylesheet.h | 1 - dom/xslt/xslt/txXSLTFunctions.h | 3 - dom/xslt/xslt/txXSLTPatterns.h | 2 - dom/xul/XULDocument.h | 1 - dom/xul/nsXULElement.h | 3 - dom/xul/templates/nsContentTestNode.h | 2 - dom/xul/templates/nsRuleNetwork.h | 1 - dom/xul/templates/nsXULContentUtils.h | 3 - dom/xul/templates/nsXULTemplateBuilder.h | 1 - .../nsXULTemplateQueryProcessorRDF.h | 1 - gfx/2d/Factory.cpp | 2 - gfx/2d/Logging.h | 33 +- gfx/gl/GLTextureImage.cpp | 21 +- gfx/gl/GLTextureImage.h | 23 +- gfx/layers/Compositor.h | 1 - gfx/layers/LayerScope.h | 2 - gfx/layers/LayersLogging.cpp | 9 - gfx/layers/LayersLogging.h | 5 - gfx/layers/LayersTypes.h | 20 +- gfx/layers/RotatedBuffer.h | 4 +- gfx/layers/client/ClientLayerManager.cpp | 2 +- .../composite/LayerManagerComposite.cpp | 2 - gfx/layers/composite/LayerManagerComposite.h | 2 - gfx/layers/composite/TextureHost.h | 2 - gfx/layers/composite/TiledContentHost.h | 3 +- gfx/layers/d3d11/CompositorD3D11.cpp | 2 +- gfx/layers/ipc/LayerTransactionParent.cpp | 2 - gfx/layers/ipc/LayersSurfaces.ipdlh | 1 - gfx/layers/ipc/ShadowLayerUtilsX11.cpp | 2 +- gfx/layers/opengl/TextureHostOGL.cpp | 6 +- gfx/layers/opengl/TextureHostOGL.h | 5 +- gfx/src/nsITheme.h | 2 +- gfx/src/nsSize.h | 21 +- gfx/tests/gtest/TestTextures.cpp | 6 +- gfx/thebes/gfxDWriteFontList.cpp | 6 - gfx/thebes/gfxDrawable.cpp | 2 +- gfx/thebes/gfxFT2FontList.cpp | 4 - gfx/thebes/gfxFont.cpp | 6 - gfx/thebes/gfxFontEntry.cpp | 3 +- gfx/thebes/gfxFontUtils.cpp | 6 - gfx/thebes/gfxFontUtils.h | 2 - gfx/thebes/gfxGDIFontList.cpp | 7 - gfx/thebes/gfxMacPlatformFontList.mm | 14 - gfx/thebes/gfxPlatform.cpp | 4 - gfx/thebes/gfxPlatformFontList.cpp | 20 - gfx/thebes/gfxTextRun.cpp | 6 - gfx/thebes/gfxUserFontSet.cpp | 10 - gfx/thebes/gfxUserFontSet.h | 2 - gfx/thebes/gfxXlibNativeRenderer.h | 9 +- image/DecodePool.h | 1 - image/Decoder.cpp | 4 +- image/ProgressTracker.h | 1 - image/RasterImage.cpp | 17 +- image/RasterImage.h | 2 - image/SVGDocumentWrapper.h | 3 +- image/VectorImage.h | 4 - image/encoders/ico/nsICOEncoder.h | 3 - image/imgFrame.cpp | 4 +- ipc/dbus/RawDBusConnection.h | 1 - ipc/glue/GeckoChildProcessHost.h | 2 - ipc/glue/nsIIPCSerializableInputStream.h | 1 - layout/base/FrameLayerBuilder.cpp | 2 +- layout/base/nsCSSRendering.cpp | 7 +- layout/svg/nsSVGPatternFrame.cpp | 2 +- modules/libjar/nsJAR.h | 1 - modules/libpref/Preferences.h | 2 - netwerk/base/ChannelDiverterChild.h | 4 - netwerk/base/Dashboard.h | 2 - netwerk/base/Predictor.h | 1 - netwerk/base/nsISocketTransport.idl | 13 +- netwerk/base/nsNativeConnectionHelper.h | 2 - netwerk/base/nsSocketTransport2.cpp | 20 +- netwerk/base/nsSocketTransport2.h | 4 + netwerk/cache/nsDiskCacheStreams.h | 1 - netwerk/cache2/CacheEntry.h | 2 - netwerk/cache2/CacheFileIOManager.h | 2 - netwerk/cache2/CacheStorageService.h | 2 - netwerk/cookie/CookieServiceParent.h | 1 - netwerk/cookie/nsCookieService.h | 1 - netwerk/ipc/ChannelEventQueue.h | 3 - netwerk/protocol/ftp/FTPChannelParent.h | 1 - netwerk/protocol/http/ASpdySession.h | 2 - netwerk/protocol/http/HttpBaseChannel.cpp | 21 + netwerk/protocol/http/HttpBaseChannel.h | 9 + netwerk/protocol/http/HttpChannelChild.cpp | 31 +- netwerk/protocol/http/HttpChannelChild.h | 4 +- .../protocol/http/HttpChannelParentListener.h | 2 - netwerk/protocol/http/InterceptedChannel.cpp | 30 +- netwerk/protocol/http/InterceptedChannel.h | 4 - netwerk/protocol/http/TunnelUtils.cpp | 12 + netwerk/protocol/http/TunnelUtils.h | 1 - netwerk/protocol/http/nsAHttpTransaction.h | 1 - netwerk/protocol/http/nsHttpChannel.cpp | 9 +- netwerk/protocol/http/nsHttpChannel.h | 1 - .../protocol/http/nsHttpConnectionInfo.cpp | 29 +- netwerk/protocol/http/nsHttpConnectionInfo.h | 10 + netwerk/protocol/http/nsHttpConnectionMgr.cpp | 4 + .../protocol/http/nsIHttpChannelInternal.idl | 7 +- .../rtsp/controller/RtspControllerParent.h | 2 - netwerk/sctp/datachannel/DataChannel.h | 1 - rdf/base/nsCompositeDataSource.cpp | 4 - rdf/base/nsInMemoryDataSource.cpp | 20 - rdf/base/nsRDFContentSink.cpp | 12 +- rdf/base/nsRDFService.cpp | 4 - rdf/base/nsRDFXMLDataSource.cpp | 78 +- .../src/mozStorageAsyncStatementExecution.cpp | 2 +- storage/src/mozStorageConnection.h | 3 +- storage/src/mozStoragePrivateHelpers.cpp | 2 +- .../jsdownloads/src/DownloadPlatform.h | 3 - toolkit/components/places/Database.h | 1 - toolkit/components/places/nsNavBookmarks.h | 1 - toolkit/components/places/nsNavHistory.h | 1 - toolkit/components/startup/nsAppStartup.h | 2 - toolkit/xre/nsAppRunner.h | 4 - uriloader/prefetch/OfflineCacheUpdateParent.h | 4 - uriloader/prefetch/nsOfflineCacheUpdate.h | 3 - uriloader/prefetch/nsPrefetchService.h | 1 - widget/cocoa/NativeKeyBindings.mm | 8 +- widget/cocoa/TextInputHandler.mm | 16 - widget/cocoa/nsChildView.mm | 4 - widget/cocoa/nsClipboard.mm | 2 - widget/cocoa/nsDragService.mm | 2 - widget/gtk/nsAppShell.cpp | 4 - widget/gtk/nsDeviceContextSpecG.cpp | 2 - widget/gtk/nsGtkIMModule.cpp | 4 - widget/gtk/nsGtkIMModule.h | 2 - widget/gtk/nsGtkKeyUtils.cpp | 8 - widget/gtk/nsGtkKeyUtils.h | 2 - widget/gtk/nsIdleServiceGTK.cpp | 13 +- widget/nsBaseDragService.cpp | 2 +- widget/nsIdleService.cpp | 8 - widget/qt/nsAppShell.cpp | 5 +- widget/qt/nsDeviceContextSpecQt.cpp | 2 - widget/windows/KeyboardLayout.cpp | 9 - widget/windows/WinMouseScrollHandler.cpp | 10 - widget/windows/WinMouseScrollHandler.h | 2 - widget/windows/WinUtils.cpp | 8 - widget/windows/nsClipboard.cpp | 4 - widget/windows/nsDeviceContextSpecWin.cpp | 4 - widget/windows/nsIMM32Handler.cpp | 8 - widget/windows/nsNativeThemeWin.cpp | 2 - widget/windows/nsNativeThemeWin.h | 2 +- widget/windows/nsSound.cpp | 4 - widget/windows/nsTextStore.cpp | 9 - widget/windows/nsWinGesture.cpp | 2 - widget/windows/nsWindow.cpp | 2 - widget/windows/nsWindowDbg.cpp | 2 - 405 files changed, 3579 insertions(+), 1542 deletions(-) create mode 100644 accessible/windows/ProxyWrappers.h diff --git a/accessible/atk/AccessibleWrap.cpp b/accessible/atk/AccessibleWrap.cpp index dc5d39f98a..37dc0daf83 100644 --- a/accessible/atk/AccessibleWrap.cpp +++ b/accessible/atk/AccessibleWrap.cpp @@ -689,9 +689,9 @@ getRoleCB(AtkObject *aAtkObj) role = accWrap->Role(); } -#define ROLE(goannaRole, stringRole, atkRole, macRole, \ +#define ROLE(geckoRole, stringRole, atkRole, macRole, \ msaaRole, ia2Role, nameRule) \ - case roles::goannaRole: \ + case roles::geckoRole: \ aAtkObj->role = atkRole; \ break; diff --git a/accessible/atk/nsMaiInterfaceDocument.cpp b/accessible/atk/nsMaiInterfaceDocument.cpp index 6ce1e8ff4c..7f4d3e1ff0 100644 --- a/accessible/atk/nsMaiInterfaceDocument.cpp +++ b/accessible/atk/nsMaiInterfaceDocument.cpp @@ -10,6 +10,7 @@ #include "AccessibleWrap.h" #include "DocAccessible.h" #include "nsMai.h" +#include "ProxyAccessible.h" #include "mozilla/Likely.h" using namespace mozilla::a11y; @@ -46,12 +47,14 @@ documentInterfaceInitCB(AtkDocumentIface *aIface) const gchar * getDocumentLocaleCB(AtkDocument *aDocument) { - AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); - if (!accWrap) - return nullptr; - nsAutoString locale; - accWrap->Language(locale); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); + if (accWrap) { + accWrap->Language(locale); + } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aDocument))) { + proxy->Language(locale); + } + return locale.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(locale); } @@ -71,24 +74,30 @@ prependToList(GSList *aList, const char *const aName, const nsAutoString &aValue AtkAttributeSet * getDocumentAttributesCB(AtkDocument *aDocument) { + nsAutoString url; + nsAutoString w3cDocType; + nsAutoString mimeType; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); - if (!accWrap || !accWrap->IsDoc()) + if (accWrap) { + if (!accWrap->IsDoc()) { + return nullptr; + } + + DocAccessible* document = accWrap->AsDoc(); + document->URL(url); + document->DocType(w3cDocType); + document->MimeType(mimeType); + } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aDocument))) { + proxy->URLDocTypeMimeType(url, w3cDocType, mimeType); + } else { return nullptr; + } // according to atkobject.h, AtkAttributeSet is a GSList GSList* attributes = nullptr; - DocAccessible* document = accWrap->AsDoc(); - nsAutoString aURL; - document->URL(aURL); - attributes = prependToList(attributes, kDocUrlName, aURL); - - nsAutoString aW3CDocType; - document->DocType(aW3CDocType); - attributes = prependToList(attributes, kDocTypeName, aW3CDocType); - - nsAutoString aMimeType; - document->MimeType(aMimeType); - attributes = prependToList(attributes, kMimeTypeName, aMimeType); + attributes = prependToList(attributes, kDocUrlName, url); + attributes = prependToList(attributes, kDocTypeName, w3cDocType); + attributes = prependToList(attributes, kMimeTypeName, mimeType); return attributes; } @@ -97,20 +106,44 @@ const gchar * getDocumentAttributeValueCB(AtkDocument *aDocument, const gchar *aAttrName) { + ProxyAccessible* proxy = nullptr; + DocAccessible* document = nullptr; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); - if (!accWrap || !accWrap->IsDoc()) - return nullptr; + if (accWrap) { + if (!accWrap->IsDoc()) { + return nullptr; + } + + document = accWrap->AsDoc(); + } else { + proxy = GetProxy(ATK_OBJECT(aDocument)); + if (!proxy) { + return nullptr; + } + } - DocAccessible* document = accWrap->AsDoc(); nsAutoString attrValue; - if (!strcasecmp(aAttrName, kDocTypeName)) - document->DocType(attrValue); - else if (!strcasecmp(aAttrName, kDocUrlName)) - document->URL(attrValue); - else if (!strcasecmp(aAttrName, kMimeTypeName)) - document->MimeType(attrValue); - else + if (!strcasecmp(aAttrName, kDocTypeName)) { + if (document) { + document->DocType(attrValue); + } else { + proxy->DocType(attrValue); + } + } else if (!strcasecmp(aAttrName, kDocUrlName)) { + if (document) { + document->URL(attrValue); + } else { + proxy->URL(attrValue); + } + } else if (!strcasecmp(aAttrName, kMimeTypeName)) { + if (document) { + document->MimeType(attrValue); + } else { + proxy->MimeType(attrValue); + } + } else { return nullptr; + } return attrValue.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(attrValue); } diff --git a/accessible/atk/nsMaiInterfaceHypertext.cpp b/accessible/atk/nsMaiInterfaceHypertext.cpp index 7baa58cf1f..bf9bd67d02 100644 --- a/accessible/atk/nsMaiInterfaceHypertext.cpp +++ b/accessible/atk/nsMaiInterfaceHypertext.cpp @@ -10,8 +10,10 @@ #include "HyperTextAccessible.h" #include "nsMai.h" #include "nsMaiHyperlink.h" +#include "ProxyAccessible.h" #include "mozilla/Likely.h" + using namespace mozilla::a11y; extern "C" { @@ -20,49 +22,69 @@ static AtkHyperlink* getLinkCB(AtkHypertext *aText, gint aLinkIndex) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) + if (accWrap) { + HyperTextAccessible* hyperText = accWrap->AsHyperText(); + NS_ENSURE_TRUE(hyperText, nullptr); + + Accessible* hyperLink = hyperText->LinkAt(aLinkIndex); + if (!hyperLink) { + return nullptr; + } + + AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink); + AccessibleWrap* accChild = GetAccessibleWrap(hyperLinkAtkObj); + NS_ENSURE_TRUE(accChild, nullptr); + + MaiHyperlink* maiHyperlink = accChild->GetMaiHyperlink(); + NS_ENSURE_TRUE(maiHyperlink, nullptr); + return maiHyperlink->GetAtkHyperlink(); + } + + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) { + ProxyAccessible* proxyLink = proxy->LinkAt(aLinkIndex); + if (proxyLink) { + NS_WARNING("IMPLEMENT ME! See bug 1146518."); + // We should somehow get from ProxyAccessible* to AtkHyperlink*. + } return nullptr; + } - HyperTextAccessible* hyperText = accWrap->AsHyperText(); - NS_ENSURE_TRUE(hyperText, nullptr); - - Accessible* hyperLink = hyperText->LinkAt(aLinkIndex); - if (!hyperLink) - return nullptr; - - AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink); - AccessibleWrap* accChild = GetAccessibleWrap(hyperLinkAtkObj); - NS_ENSURE_TRUE(accChild, nullptr); - - MaiHyperlink *maiHyperlink = accChild->GetMaiHyperlink(); - NS_ENSURE_TRUE(maiHyperlink, nullptr); - return maiHyperlink->GetAtkHyperlink(); + return nullptr; } static gint getLinkCountCB(AtkHypertext *aText) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return -1; + if (accWrap) { + HyperTextAccessible* hyperText = accWrap->AsHyperText(); + NS_ENSURE_TRUE(hyperText, -1); + return hyperText->LinkCount(); + } - HyperTextAccessible* hyperText = accWrap->AsHyperText(); - NS_ENSURE_TRUE(hyperText, -1); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) { + return proxy->LinkCount(); + } - return hyperText->LinkCount(); + return -1; } static gint getLinkIndexCB(AtkHypertext *aText, gint aCharIndex) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return -1; + if (accWrap) { + HyperTextAccessible* hyperText = accWrap->AsHyperText(); + NS_ENSURE_TRUE(hyperText, -1); - HyperTextAccessible* hyperText = accWrap->AsHyperText(); - NS_ENSURE_TRUE(hyperText, -1); + return hyperText->LinkIndexAtOffset(aCharIndex); + } - return hyperText->LinkIndexAtOffset(aCharIndex); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) { + return proxy->LinkIndexAtOffset(aCharIndex); + } + + return -1; } } diff --git a/accessible/atk/nsMaiInterfaceImage.cpp b/accessible/atk/nsMaiInterfaceImage.cpp index 7a0a55e03d..64a3beaab3 100644 --- a/accessible/atk/nsMaiInterfaceImage.cpp +++ b/accessible/atk/nsMaiInterfaceImage.cpp @@ -12,6 +12,7 @@ #include "nsMai.h" #include "nsIAccessibleTypes.h" #include "nsIURI.h" +#include "ProxyAccessible.h" using namespace mozilla; using namespace mozilla::a11y; @@ -23,15 +24,19 @@ static void getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY, AtkCoordType aCoordType) { - AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage)); - if (!accWrap || !accWrap->IsImage()) - return; - - ImageAccessible* image = accWrap->AsImage(); - uint32_t goannaCoordType = (aCoordType == ATK_XY_WINDOW) ? + nsIntPoint pos; + uint32_t geckoCoordType = (aCoordType == ATK_XY_WINDOW) ? nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE : nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE; - nsIntPoint pos = image->Position(goannaCoordType); + + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage)); + if (accWrap && accWrap->IsImage()) { + ImageAccessible* image = accWrap->AsImage(); + pos = image->Position(geckoCoordType); + } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aImage))) { + pos = proxy->ImagePosition(geckoCoordType); + } + *aAccX = pos.x; *aAccY = pos.y; } @@ -45,11 +50,14 @@ getImageDescriptionCB(AtkImage* aImage) static void getImageSizeCB(AtkImage* aImage, gint* aAccWidth, gint* aAccHeight) { + nsIntSize size; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage)); - if (!accWrap || !accWrap->IsImage()) - return; + if (accWrap && accWrap->IsImage()) { + size = accWrap->AsImage()->Size(); + } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aImage))) { + size = proxy->ImageSize(); + } - nsIntSize size = accWrap->AsImage()->Size(); *aAccWidth = size.width; *aAccHeight = size.height; } diff --git a/accessible/atk/nsMaiInterfaceSelection.cpp b/accessible/atk/nsMaiInterfaceSelection.cpp index ca27126a76..2ce63a4513 100644 --- a/accessible/atk/nsMaiInterfaceSelection.cpp +++ b/accessible/atk/nsMaiInterfaceSelection.cpp @@ -9,6 +9,7 @@ #include "Accessible-inl.h" #include "AccessibleWrap.h" #include "nsMai.h" +#include "ProxyAccessible.h" #include "mozilla/Likely.h" #include @@ -21,36 +22,54 @@ static gboolean addSelectionCB(AtkSelection *aSelection, gint i) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + if (accWrap && accWrap->IsSelect()) { + return accWrap->AddItemToSelection(i); + } - return accWrap->AddItemToSelection(i); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) { + return proxy->AddItemToSelection(i); + } + + return FALSE; } static gboolean clearSelectionCB(AtkSelection *aSelection) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + if (accWrap && accWrap->IsSelect()) { + return accWrap->UnselectAll(); + } - return accWrap->UnselectAll(); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) { + return proxy->UnselectAll(); + } + + return FALSE; } static AtkObject* refSelectionCB(AtkSelection *aSelection, gint i) { + AtkObject* atkObj = nullptr; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return nullptr; + if (accWrap && accWrap->IsSelect()) { + Accessible* selectedItem = accWrap->GetSelectedItem(i); + if (!selectedItem) { + return nullptr; + } - Accessible* selectedItem = accWrap->GetSelectedItem(i); - if (!selectedItem) - return nullptr; + atkObj = AccessibleWrap::GetAtkObject(selectedItem); + } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) { + ProxyAccessible* selectedItem = proxy->GetSelectedItem(i); + if (selectedItem) { + atkObj = GetWrapperFor(selectedItem); + } + } - AtkObject* atkObj = AccessibleWrap::GetAtkObject(selectedItem); - if (atkObj) + if (atkObj) { g_object_ref(atkObj); + } return atkObj; } @@ -59,40 +78,60 @@ static gint getSelectionCountCB(AtkSelection *aSelection) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return -1; + if (accWrap && accWrap->IsSelect()) { + return accWrap->SelectedItemCount(); + } - return accWrap->SelectedItemCount(); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) { + return proxy->SelectedItemCount(); + } + + return -1; } static gboolean isChildSelectedCB(AtkSelection *aSelection, gint i) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + if (accWrap && accWrap->IsSelect()) { + return accWrap->IsItemSelected(i); + } - return accWrap->IsItemSelected(i); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) { + return proxy->IsItemSelected(i); + } + + return FALSE; } static gboolean removeSelectionCB(AtkSelection *aSelection, gint i) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + if (accWrap && accWrap->IsSelect()) { + return accWrap->RemoveItemFromSelection(i); + } - return accWrap->RemoveItemFromSelection(i); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) { + return proxy->RemoveItemFromSelection(i); + } + + return FALSE; } static gboolean selectAllSelectionCB(AtkSelection *aSelection) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + if (accWrap && accWrap->IsSelect()) { + return accWrap->SelectAll(); + } - return accWrap->SelectAll(); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) { + return proxy->SelectAll(); + } + + return FALSE; } } diff --git a/accessible/atk/nsMaiInterfaceText.cpp b/accessible/atk/nsMaiInterfaceText.cpp index 27c8590acd..63be81941d 100644 --- a/accessible/atk/nsMaiInterfaceText.cpp +++ b/accessible/atk/nsMaiInterfaceText.cpp @@ -209,15 +209,21 @@ static gunichar getCharacterAtOffsetCB(AtkText* aText, gint aOffset) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return 0; + if (accWrap) { + HyperTextAccessible* text = accWrap->AsHyperText(); + if (!text || !text->IsTextRole()) { + return 0; + } - HyperTextAccessible* text = accWrap->AsHyperText(); - if (!text || !text->IsTextRole()) - return 0; + // char16_t is unsigned short in Mozilla, gnuichar is guint32 in glib. + return static_cast(text->CharAt(aOffset)); + } - // char16_t is unsigned short in Mozilla, gnuichar is guint32 in glib. - return static_cast(text->CharAt(aOffset)); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) { + return static_cast(proxy->CharAt(aOffset)); + } + + return 0; } static gchar* @@ -249,14 +255,20 @@ static gint getCaretOffsetCB(AtkText *aText) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return 0; + if (accWrap) { + HyperTextAccessible* text = accWrap->AsHyperText(); + if (!text || !text->IsTextRole()) { + return 0; + } - HyperTextAccessible* text = accWrap->AsHyperText(); - if (!text || !text->IsTextRole()) - return 0; + return static_cast(text->CaretOffset()); + } - return static_cast(text->CaretOffset()); + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) { + return static_cast(proxy->CaretOffset()); + } + + return 0; } static AtkAttributeSet* @@ -333,7 +345,7 @@ getCharacterExtentsCB(AtkText *aText, gint aOffset, nsIntRect rect; uint32_t geckoCoordType; if (aCoords == ATK_XY_SCREEN) { - goannaCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE; + geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE; } else { giabbaCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE; } @@ -345,9 +357,9 @@ getCharacterExtentsCB(AtkText *aText, gint aOffset, return; } - rect = text->CharBounds(aOffset, goannaCoordType); + rect = text->CharBounds(aOffset, geckoCoordType); } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) { - rect = proxy->CharBounds(aOffset, goannaCoordType); + rect = proxy->CharBounds(aOffset, geckoCoordType); } else { return; } @@ -367,11 +379,11 @@ getRangeExtentsCB(AtkText *aText, gint aStartOffset, gint aEndOffset, } nsIntRect rect; - uint32_t goannaCoordType; + uint32_t geckoCoordType; if (aCoords == ATK_XY_SCREEN) { - goannaCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE; + geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE; } else { - goannaCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE; + geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE; } AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); @@ -553,15 +565,23 @@ static gboolean setCaretOffsetCB(AtkText *aText, gint aOffset) { AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return FALSE; + if (accWrap) { + HyperTextAccessible* text = accWrap->AsHyperText(); + if (!text || !text->IsTextRole() || !text->IsValidOffset(aOffset)) { + return FALSE; + } - HyperTextAccessible* text = accWrap->AsHyperText(); - if (!text || !text->IsTextRole() || !text->IsValidOffset(aOffset)) - return FALSE; + text->SetCaretOffset(aOffset); + return TRUE; + } - text->SetCaretOffset(aOffset); - return TRUE; + if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) { + if (proxy->SetCaretOffset(aOffset)) { + return TRUE; + } + } + + return FALSE; } } diff --git a/accessible/atk/nsMaiInterfaceValue.cpp b/accessible/atk/nsMaiInterfaceValue.cpp index e7b2279cc0..016b3b672c 100644 --- a/accessible/atk/nsMaiInterfaceValue.cpp +++ b/accessible/atk/nsMaiInterfaceValue.cpp @@ -8,7 +8,7 @@ #include "AccessibleWrap.h" #include "nsMai.h" - +#include "ProxyAccessible.h" #include "mozilla/FloatingPoint.h" #include "mozilla/Likely.h" @@ -20,12 +20,17 @@ extern "C" { static void getCurrentValueCB(AtkValue *obj, GValue *value) { + ProxyAccessible* proxy = nullptr; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return; + if (!accWrap) { + proxy = GetProxy(ATK_OBJECT(obj)); + if (!proxy) { + return; + } + } memset (value, 0, sizeof (GValue)); - double accValue = accWrap->CurValue(); + double accValue = accWrap ? accWrap->CurValue() : proxy->CurValue(); if (IsNaN(accValue)) return; @@ -36,12 +41,17 @@ getCurrentValueCB(AtkValue *obj, GValue *value) static void getMaximumValueCB(AtkValue *obj, GValue *value) { + ProxyAccessible* proxy = nullptr; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return; + if (!accWrap) { + proxy = GetProxy(ATK_OBJECT(obj)); + if (!proxy) { + return; + } + } memset(value, 0, sizeof (GValue)); - double accValue = accWrap->MaxValue(); + double accValue = accWrap ? accWrap->MaxValue() : proxy->MaxValue(); if (IsNaN(accValue)) return; @@ -52,12 +62,17 @@ getMaximumValueCB(AtkValue *obj, GValue *value) static void getMinimumValueCB(AtkValue *obj, GValue *value) { + ProxyAccessible* proxy = nullptr; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return; + if (!accWrap) { + proxy = GetProxy(ATK_OBJECT(obj)); + if (!proxy) { + return; + } + } memset(value, 0, sizeof (GValue)); - double accValue = accWrap->MinValue(); + double accValue = accWrap ? accWrap->MinValue() : proxy->MinValue(); if (IsNaN(accValue)) return; @@ -68,12 +83,17 @@ getMinimumValueCB(AtkValue *obj, GValue *value) static void getMinimumIncrementCB(AtkValue *obj, GValue *minimumIncrement) { + ProxyAccessible* proxy = nullptr; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return; + if (!accWrap) { + proxy = GetProxy(ATK_OBJECT(obj)); + if (!proxy) { + return; + } + } memset(minimumIncrement, 0, sizeof (GValue)); - double accValue = accWrap->Step(); + double accValue = accWrap ? accWrap->Step() : proxy->Step(); if (IsNaN(accValue)) accValue = 0; // zero if the minimum increment is undefined @@ -84,12 +104,17 @@ getMinimumIncrementCB(AtkValue *obj, GValue *minimumIncrement) static gboolean setCurrentValueCB(AtkValue *obj, const GValue *value) { + ProxyAccessible* proxy = nullptr; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return FALSE; + if (!accWrap) { + proxy = GetProxy(ATK_OBJECT(obj)); + if (!proxy) { + return FALSE; + } + } double accValue =g_value_get_double(value); - return accWrap->SetCurValue(accValue); + return accWrap ? accWrap->SetCurValue(accValue) : proxy->SetCurValue(accValue); } } diff --git a/accessible/base/Asserts.cpp b/accessible/base/Asserts.cpp index f77094d6a9..1014337c77 100644 --- a/accessible/base/Asserts.cpp +++ b/accessible/base/Asserts.cpp @@ -11,9 +11,9 @@ using namespace mozilla::a11y; -#define ROLE(goannaRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \ - static_assert(static_cast(roles::goannaRole) \ - == static_cast(nsIAccessibleRole::ROLE_ ## goannaRole), \ +#define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \ + static_assert(static_cast(roles::geckoRole) \ + == static_cast(nsIAccessibleRole::ROLE_ ## geckoRole), \ "internal and xpcom roles differ!"); #include "RoleMap.h" #undef ROLE diff --git a/accessible/base/NotificationController.cpp b/accessible/base/NotificationController.cpp index 45110dbc4c..9c4046c080 100644 --- a/accessible/base/NotificationController.cpp +++ b/accessible/base/NotificationController.cpp @@ -280,12 +280,19 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime) size_t newDocCount = newChildDocs.Length(); for (size_t i = 0; i < newDocCount; i++) { DocAccessible* childDoc = newChildDocs[i]; - DocAccessibleChild* ipcDoc = new DocAccessibleChild(childDoc); + Accessible* parent = childDoc->Parent(); + DocAccessibleChild* parentIPCDoc = mDocument->IPCDoc(); + uint64_t id = reinterpret_cast(parent->UniqueID()); + MOZ_ASSERT(id); + DocAccessibleChild* ipcDoc = childDoc->IPCDoc(); + if (ipcDoc) { + parentIPCDoc->SendBindChildDoc(ipcDoc, id); + continue; + } + + ipcDoc = new DocAccessibleChild(childDoc); childDoc->SetIPCDoc(ipcDoc); auto contentChild = dom::ContentChild::GetSingleton(); - DocAccessibleChild* parentIPCDoc = mDocument->IPCDoc(); - uint64_t id = reinterpret_cast(childDoc->Parent()->UniqueID()); - MOZ_ASSERT(id); contentChild->SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id); } } diff --git a/accessible/base/RoleMap.h b/accessible/base/RoleMap.h index 0398b17dd9..4953077751 100644 --- a/accessible/base/RoleMap.h +++ b/accessible/base/RoleMap.h @@ -4,7 +4,7 @@ /** * Usage: declare the macro ROLE()with the following arguments: - * ROLE(goannaRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) + * ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) */ ROLE(NOTHING, diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index 7e4836c9b7..da584599ff 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -690,9 +690,9 @@ nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode, NS_IMETHODIMP nsAccessibilityService::GetStringRole(uint32_t aRole, nsAString& aString) { -#define ROLE(goannaRole, stringRole, atkRole, \ +#define ROLE(geckoRole, stringRole, atkRole, \ macRole, msaaRole, ia2Role, nameRule) \ - case roles::goannaRole: \ + case roles::geckoRole: \ CopyUTF8toUTF16(stringRole, aString); \ return NS_OK; diff --git a/accessible/base/nsAccessibilityService.h b/accessible/base/nsAccessibilityService.h index a9b4d39406..75091fc216 100644 --- a/accessible/base/nsAccessibilityService.h +++ b/accessible/base/nsAccessibilityService.h @@ -279,8 +279,6 @@ GetAccService() inline bool IPCAccessibilityActive() { - // XXX disable ipc accessibility for firefox 38 - return false; #ifdef MOZ_B2G return false; #else diff --git a/accessible/base/nsTextEquivUtils.cpp b/accessible/base/nsTextEquivUtils.cpp index 9825a92cfc..bb7b3d918d 100644 --- a/accessible/base/nsTextEquivUtils.cpp +++ b/accessible/base/nsTextEquivUtils.cpp @@ -347,9 +347,9 @@ nsTextEquivUtils::AppendString(nsAString *aString, uint32_t nsTextEquivUtils::GetRoleRule(role aRole) { -#define ROLE(goannaRole, stringRole, atkRole, \ +#define ROLE(geckoRole, stringRole, atkRole, \ macRole, msaaRole, ia2Role, nameRule) \ - case roles::goannaRole: \ + case roles::geckoRole: \ return nameRule; switch (aRole) { diff --git a/accessible/ipc/DocAccessibleChild.cpp b/accessible/ipc/DocAccessibleChild.cpp index f15d142e55..ae1d376d0d 100644 --- a/accessible/ipc/DocAccessibleChild.cpp +++ b/accessible/ipc/DocAccessibleChild.cpp @@ -9,9 +9,13 @@ #include "Accessible-inl.h" #include "ProxyAccessible.h" #include "Relation.h" - +#include "HyperTextAccessible-inl.h" +#include "ImageAccessible.h" +#include "TableAccessible.h" +#include "TableCellAccessible.h" #include "nsIPersistentProperties2.h" #include "nsISimpleEnumerator.h" +#include "nsAccUtils.h" namespace mozilla { namespace a11y { @@ -46,17 +50,51 @@ SerializeTree(Accessible* aRoot, nsTArray& aTree) } Accessible* -DocAccessibleChild::IdToAccessible(const uint64_t& aID) +DocAccessibleChild::IdToAccessible(const uint64_t& aID) const { return mDoc->GetAccessibleByUniqueID(reinterpret_cast(aID)); } -HyperTextAccessible* -DocAccessibleChild::IdToHyperTextAccessible(const uint64_t& aID) +Accessible* +DocAccessibleChild::IdToAccessibleLink(const uint64_t& aID) const { Accessible* acc = IdToAccessible(aID); - MOZ_ASSERT(!acc || acc->IsHyperText()); - return acc ? acc->AsHyperText() : nullptr; + return acc && acc->IsLink() ? acc : nullptr; +} + +Accessible* +DocAccessibleChild::IdToAccessibleSelect(const uint64_t& aID) const +{ + Accessible* acc = IdToAccessible(aID); + return acc && acc->IsSelect() ? acc : nullptr; +} + +HyperTextAccessible* +DocAccessibleChild::IdToHyperTextAccessible(const uint64_t& aID) const +{ + Accessible* acc = IdToAccessible(aID); + return acc && acc->IsHyperText() ? acc->AsHyperText() : nullptr; +} + +ImageAccessible* +DocAccessibleChild::IdToImageAccessible(const uint64_t& aID) const +{ + Accessible* acc = IdToAccessible(aID); + return (acc && acc->IsImage()) ? acc->AsImage() : nullptr; +} + +TableCellAccessible* +DocAccessibleChild::IdToTableCellAccessible(const uint64_t& aID) const +{ + Accessible* acc = IdToAccessible(aID); + return (acc && acc->IsTableCell()) ? acc->AsTableCell() : nullptr; +} + +TableAccessible* +DocAccessibleChild::IdToTableAccessible(const uint64_t& aID) const +{ + Accessible* acc = IdToAccessible(aID); + return (acc && acc->IsTable()) ? acc->AsTable() : nullptr; } void @@ -214,6 +252,28 @@ DocAccessibleChild::RecvRelations(const uint64_t& aID, return true; } +bool +DocAccessibleChild::RecvCaretOffset(const uint64_t& aID, int32_t* aOffset) +{ + HyperTextAccessible* acc = IdToHyperTextAccessible(aID); + *aOffset = acc && acc->IsTextRole() ? acc->CaretOffset() : 0; + return true; +} + +bool +DocAccessibleChild::RecvSetCaretOffset(const uint64_t& aID, + const int32_t& aOffset, + bool* aRetVal) +{ + HyperTextAccessible* acc = IdToHyperTextAccessible(aID); + *aRetVal = false; + if (acc && acc->IsTextRole() && acc->IsValidOffset(aOffset)) { + *aRetVal = true; + acc->SetCaretOffset(aOffset); + } + return true; +} + bool DocAccessibleChild::RecvCharacterCount(const uint64_t& aID, int32_t* aCount) { @@ -234,13 +294,14 @@ bool DocAccessibleChild::RecvTextSubstring(const uint64_t& aID, const int32_t& aStartOffset, const int32_t& aEndOffset, - nsString* aText) + nsString* aText, bool* aValid) { HyperTextAccessible* acc = IdToHyperTextAccessible(aID); if (!acc) { return true; } + *aValid = acc->IsValidRange(aStartOffset, aEndOffset); acc->TextSubstring(aStartOffset, aEndOffset, *aText); return true; } @@ -490,10 +551,11 @@ DocAccessibleChild::RecvReplaceText(const uint64_t& aID, bool DocAccessibleChild::RecvInsertText(const uint64_t& aID, const nsString& aText, - const int32_t& aPosition) + const int32_t& aPosition, bool* aValid) { HyperTextAccessible* acc = IdToHyperTextAccessible(aID); if (acc && acc->IsTextRole()) { + *aValid = acc->IsValidOffset(aPosition); acc->InsertText(aText, aPosition); } @@ -503,7 +565,7 @@ DocAccessibleChild::RecvInsertText(const uint64_t& aID, bool DocAccessibleChild::RecvCopyText(const uint64_t& aID, const int32_t& aStartPos, - const int32_t& aEndPos) + const int32_t& aEndPos, bool* aValid) { HyperTextAccessible* acc = IdToHyperTextAccessible(aID); if (acc && acc->IsTextRole()) { @@ -516,10 +578,11 @@ DocAccessibleChild::RecvCopyText(const uint64_t& aID, bool DocAccessibleChild::RecvCutText(const uint64_t& aID, const int32_t& aStartPos, - const int32_t& aEndPos) + const int32_t& aEndPos, bool* aValid) { HyperTextAccessible* acc = IdToHyperTextAccessible(aID); if (acc && acc->IsTextRole()) { + *aValid = acc->IsValidRange(aStartPos, aEndPos); acc->CutText(aStartPos, aEndPos); } @@ -529,10 +592,11 @@ DocAccessibleChild::RecvCutText(const uint64_t& aID, bool DocAccessibleChild::RecvDeleteText(const uint64_t& aID, const int32_t& aStartPos, - const int32_t& aEndPos) + const int32_t& aEndPos, bool* aValid) { HyperTextAccessible* acc = IdToHyperTextAccessible(aID); if (acc && acc->IsTextRole()) { + *aValid = acc->IsValidRange(aStartPos, aEndPos); acc->DeleteText(aStartPos, aEndPos); } @@ -541,15 +605,1101 @@ DocAccessibleChild::RecvDeleteText(const uint64_t& aID, bool DocAccessibleChild::RecvPasteText(const uint64_t& aID, - const int32_t& aPosition) + const int32_t& aPosition, bool* aValid) { HyperTextAccessible* acc = IdToHyperTextAccessible(aID); if (acc && acc->IsTextRole()) { + *aValid = acc->IsValidOffset(aPosition); acc->PasteText(aPosition); } return true; } +bool +DocAccessibleChild::RecvCharAt(const uint64_t& aID, + const int32_t& aOffset, + uint16_t* aChar) +{ + HyperTextAccessible* acc = IdToHyperTextAccessible(aID); + *aChar = acc && acc->IsTextRole() ? + static_cast(acc->CharAt(aOffset)) : 0; + return true; +} + +bool +DocAccessibleChild::RecvImagePosition(const uint64_t& aID, + const uint32_t& aCoordType, + nsIntPoint* aRetVal) +{ + ImageAccessible* acc = IdToImageAccessible(aID); + if (acc) { + *aRetVal = acc->Position(aCoordType); + } + + return true; +} + +bool +DocAccessibleChild::RecvImageSize(const uint64_t& aID, + nsIntSize* aRetVal) +{ + + ImageAccessible* acc = IdToImageAccessible(aID); + if (acc) { + *aRetVal = acc->Size(); + } + + return true; +} + +bool +DocAccessibleChild::RecvStartOffset(const uint64_t& aID, + uint32_t* aRetVal, + bool* aOk) +{ + Accessible* acc = IdToAccessibleLink(aID); + if (acc) { + *aRetVal = acc->StartOffset(); + *aOk = true; + } else { + *aRetVal = 0; + *aOk = false; + } + + return true; +} + +bool +DocAccessibleChild::RecvEndOffset(const uint64_t& aID, + uint32_t* aRetVal, + bool* aOk) +{ + Accessible* acc = IdToAccessibleLink(aID); + if (acc) { + *aRetVal = acc->EndOffset(); + *aOk = true; + } else { + *aRetVal = 0; + *aOk = false; + } + + return true; +} + +bool +DocAccessibleChild::RecvIsLinkValid(const uint64_t& aID, + bool* aRetVal) +{ + Accessible* acc = IdToAccessibleLink(aID); + if (acc) { + *aRetVal = acc->IsLinkValid(); + } else { + *aRetVal = false; + } + + return true; +} + +bool +DocAccessibleChild::RecvAnchorCount(const uint64_t& aID, + uint32_t* aRetVal, + bool* aOk) +{ + Accessible* acc = IdToAccessibleLink(aID); + if (acc) { + *aRetVal = acc->AnchorCount(); + *aOk = true; + } else { + *aRetVal = 0; + *aOk = false; + } + + return true; +} + +bool +DocAccessibleChild::RecvAnchorURIAt(const uint64_t& aID, + const uint32_t& aIndex, + nsCString* aURI, + bool* aOk) +{ + Accessible* acc = IdToAccessibleLink(aID); + *aOk = false; + if (acc) { + nsCOMPtr uri = acc->AnchorURIAt(aIndex); + if (uri) { + uri->GetSpec(*aURI); + *aOk = true; + } + } + + return true; +} + +bool +DocAccessibleChild::RecvAnchorAt(const uint64_t& aID, + const uint32_t& aIndex, + uint64_t* aIDOfAnchor, + bool* aOk) +{ + *aIDOfAnchor = 0; + *aOk = false; + Accessible* acc = IdToAccessibleLink(aID); + if (acc) { + Accessible* anchor = acc->AnchorAt(aIndex); + if (anchor) { + *aIDOfAnchor = reinterpret_cast(anchor->UniqueID()); + *aOk = true; + } + } + + return true; +} + +bool +DocAccessibleChild::RecvLinkCount(const uint64_t& aID, + uint32_t* aCount) +{ + HyperTextAccessible* acc = IdToHyperTextAccessible(aID); + *aCount = acc ? acc->LinkCount() : 0; + return true; +} + +bool +DocAccessibleChild::RecvLinkAt(const uint64_t& aID, + const uint32_t& aIndex, + uint64_t* aIDOfLink, + bool* aOk) +{ + *aIDOfLink = 0; + *aOk = false; + HyperTextAccessible* acc = IdToHyperTextAccessible(aID); + if (acc) { + Accessible* link = acc->LinkAt(aIndex); + if (link) { + *aIDOfLink = reinterpret_cast(link->UniqueID()); + *aOk = true; + } + } + + return true; +} + +bool +DocAccessibleChild::RecvLinkIndexOf(const uint64_t& aID, + const uint64_t& aLinkID, + int32_t* aIndex) +{ + HyperTextAccessible* acc = IdToHyperTextAccessible(aID); + Accessible* link = IdToAccessible(aLinkID); + *aIndex = -1; + if (acc && link) { + *aIndex = acc->LinkIndexOf(link); + } + + return true; +} + +bool +DocAccessibleChild::RecvLinkIndexAtOffset(const uint64_t& aID, + const uint32_t& aOffset, + int32_t* aIndex) +{ + HyperTextAccessible* acc = IdToHyperTextAccessible(aID); + *aIndex = acc ? acc->LinkIndexAtOffset(aOffset) : -1; + return true; +} + +bool +DocAccessibleChild::RecvTableOfACell(const uint64_t& aID, + uint64_t* aTableID, + bool* aOk) +{ + *aTableID = 0; + *aOk = false; + TableCellAccessible* acc = IdToTableCellAccessible(aID); + if (acc) { + TableAccessible* table = acc->Table(); + if (table) { + *aTableID = reinterpret_cast(table->AsAccessible()->UniqueID()); + *aOk = true; + } + } + + return true; +} + +bool +DocAccessibleChild::RecvColIdx(const uint64_t& aID, + uint32_t* aIndex) +{ + *aIndex = 0; + TableCellAccessible* acc = IdToTableCellAccessible(aID); + if (acc) { + *aIndex = acc->ColIdx(); + } + + return true; +} + +bool +DocAccessibleChild::RecvRowIdx(const uint64_t& aID, + uint32_t* aIndex) +{ + *aIndex = 0; + TableCellAccessible* acc = IdToTableCellAccessible(aID); + if (acc) { + *aIndex = acc->RowIdx(); + } + + return true; +} + +bool +DocAccessibleChild::RecvColExtent(const uint64_t& aID, + uint32_t* aExtent) +{ + *aExtent = 0; + TableCellAccessible* acc = IdToTableCellAccessible(aID); + if (acc) { + *aExtent = acc->ColExtent(); + } + + return true; +} + +bool +DocAccessibleChild::RecvRowExtent(const uint64_t& aID, + uint32_t* aExtent) +{ + *aExtent = 0; + TableCellAccessible* acc = IdToTableCellAccessible(aID); + if (acc) { + *aExtent = acc->RowExtent(); + } + + return true; +} + +bool +DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID, + nsTArray* aCells) +{ + TableCellAccessible* acc = IdToTableCellAccessible(aID); + if (acc) { + nsAutoTArray headerCells; + acc->ColHeaderCells(&headerCells); + aCells->SetCapacity(headerCells.Length()); + for (uint32_t i = 0; i < headerCells.Length(); ++i) { + aCells->AppendElement( + reinterpret_cast(headerCells[i]->UniqueID())); + } + } + + return true; +} + +bool +DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID, + nsTArray* aCells) +{ + TableCellAccessible* acc = IdToTableCellAccessible(aID); + if (acc) { + nsAutoTArray headerCells; + acc->RowHeaderCells(&headerCells); + aCells->SetCapacity(headerCells.Length()); + for (uint32_t i = 0; i < headerCells.Length(); ++i) { + aCells->AppendElement( + reinterpret_cast(headerCells[i]->UniqueID())); + } + } + + return true; +} + +bool +DocAccessibleChild::RecvIsCellSelected(const uint64_t& aID, + bool* aSelected) +{ + TableCellAccessible* acc = IdToTableCellAccessible(aID); + *aSelected = acc && acc->Selected(); + return true; +} + +bool +DocAccessibleChild::RecvTableCaption(const uint64_t& aID, + uint64_t* aCaptionID, + bool* aOk) +{ + *aCaptionID = 0; + *aOk = false; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + Accessible* caption = acc->Caption(); + if (caption) { + *aCaptionID = reinterpret_cast(caption->UniqueID()); + *aOk = true; + } + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSummary(const uint64_t& aID, + nsString* aSummary) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->Summary(*aSummary); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableColumnCount(const uint64_t& aID, + uint32_t* aColCount) +{ + *aColCount = 0; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aColCount = acc->ColCount(); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableRowCount(const uint64_t& aID, + uint32_t* aRowCount) +{ + *aRowCount = 0; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aRowCount = acc->RowCount(); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableCellAt(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + uint64_t* aCellID, + bool* aOk) +{ + *aCellID = 0; + *aOk = false; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + Accessible* cell = acc->CellAt(aRow, aCol); + if (cell) { + *aCellID = reinterpret_cast(cell->UniqueID()); + *aOk = true; + } + } + + return true; +} + +bool +DocAccessibleChild::RecvTableCellIndexAt(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + int32_t* aIndex) +{ + *aIndex = -1; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aIndex = acc->CellIndexAt(aRow, aCol); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableColumnIndexAt(const uint64_t& aID, + const uint32_t& aCellIndex, + int32_t* aCol) +{ + *aCol = -1; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aCol = acc->ColIndexAt(aCellIndex); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableRowIndexAt(const uint64_t& aID, + const uint32_t& aCellIndex, + int32_t* aRow) +{ + *aRow = -1; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aRow = acc->RowIndexAt(aCellIndex); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableRowAndColumnIndicesAt(const uint64_t& aID, + const uint32_t& aCellIndex, + int32_t* aRow, + int32_t* aCol) +{ + *aRow = -1; + *aCol = -1; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->RowAndColIndicesAt(aCellIndex, aRow, aCol); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableColumnExtentAt(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + uint32_t* aExtent) +{ + *aExtent = 0; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aExtent = acc->ColExtentAt(aRow, aCol); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableRowExtentAt(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + uint32_t* aExtent) +{ + *aExtent = 0; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aExtent = acc->RowExtentAt(aRow, aCol); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableColumnDescription(const uint64_t& aID, + const uint32_t& aCol, + nsString* aDescription) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->ColDescription(aCol, *aDescription); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableRowDescription(const uint64_t& aID, + const uint32_t& aRow, + nsString* aDescription) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->RowDescription(aRow, *aDescription); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableColumnSelected(const uint64_t& aID, + const uint32_t& aCol, + bool* aSelected) +{ + *aSelected = false; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aSelected = acc->IsColSelected(aCol); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableRowSelected(const uint64_t& aID, + const uint32_t& aRow, + bool* aSelected) +{ + *aSelected = false; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aSelected = acc->IsRowSelected(aRow); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableCellSelected(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + bool* aSelected) +{ + *aSelected = false; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aSelected = acc->IsCellSelected(aRow, aCol); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectedCellCount(const uint64_t& aID, + uint32_t* aSelectedCells) +{ + *aSelectedCells = 0; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aSelectedCells = acc->SelectedCellCount(); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectedColumnCount(const uint64_t& aID, + uint32_t* aSelectedColumns) +{ + *aSelectedColumns = 0; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aSelectedColumns = acc->SelectedColCount(); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectedRowCount(const uint64_t& aID, + uint32_t* aSelectedRows) +{ + *aSelectedRows = 0; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aSelectedRows = acc->SelectedRowCount(); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID, + nsTArray* aCellIDs) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + nsAutoTArray cells; + acc->SelectedCells(&cells); + aCellIDs->SetCapacity(cells.Length()); + for (uint32_t i = 0; i < cells.Length(); ++i) { + aCellIDs->AppendElement( + reinterpret_cast(cells[i]->UniqueID())); + } + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectedCellIndices(const uint64_t& aID, + nsTArray* aCellIndices) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->SelectedCellIndices(aCellIndices); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectedColumnIndices(const uint64_t& aID, + nsTArray* aColumnIndices) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->SelectedColIndices(aColumnIndices); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectedRowIndices(const uint64_t& aID, + nsTArray* aRowIndices) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->SelectedRowIndices(aRowIndices); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectColumn(const uint64_t& aID, + const uint32_t& aCol) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->SelectCol(aCol); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableSelectRow(const uint64_t& aID, + const uint32_t& aRow) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->SelectRow(aRow); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableUnselectColumn(const uint64_t& aID, + const uint32_t& aCol) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->UnselectCol(aCol); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableUnselectRow(const uint64_t& aID, + const uint32_t& aRow) +{ + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + acc->UnselectRow(aRow); + } + + return true; +} + +bool +DocAccessibleChild::RecvTableIsProbablyForLayout(const uint64_t& aID, + bool* aForLayout) +{ + *aForLayout = false; + TableAccessible* acc = IdToTableAccessible(aID); + if (acc) { + *aForLayout = acc->IsProbablyLayoutTable(); + } + + return true; +} + +bool +DocAccessibleChild::RecvSelectedItems(const uint64_t& aID, + nsTArray* aSelectedItemIDs) +{ + Accessible* acc = IdToAccessibleSelect(aID); + if (acc) { + nsAutoTArray selectedItems; + acc->SelectedItems(&selectedItems); + aSelectedItemIDs->SetCapacity(selectedItems.Length()); + for (size_t i = 0; i < selectedItems.Length(); ++i) { + aSelectedItemIDs->AppendElement( + reinterpret_cast(selectedItems[i]->UniqueID())); + } + } + + return true; +} + +bool +DocAccessibleChild::RecvSelectedItemCount(const uint64_t& aID, + uint32_t* aCount) +{ + *aCount = 0; + Accessible* acc = IdToAccessibleSelect(aID); + if (acc) { + *aCount = acc->SelectedItemCount(); + } + + return true; +} + +bool +DocAccessibleChild::RecvGetSelectedItem(const uint64_t& aID, + const uint32_t& aIndex, + uint64_t* aSelected, + bool* aOk) +{ + *aSelected = 0; + *aOk = false; + Accessible* acc = IdToAccessibleSelect(aID); + if (acc) { + Accessible* item = acc->GetSelectedItem(aIndex); + if (item) { + *aSelected = reinterpret_cast(item->UniqueID()); + *aOk = true; + } + } + + return true; +} + +bool +DocAccessibleChild::RecvIsItemSelected(const uint64_t& aID, + const uint32_t& aIndex, + bool* aSelected) +{ + *aSelected = false; + Accessible* acc = IdToAccessibleSelect(aID); + if (acc) { + *aSelected = acc->IsItemSelected(aIndex); + } + + return true; +} + +bool +DocAccessibleChild::RecvAddItemToSelection(const uint64_t& aID, + const uint32_t& aIndex, + bool* aSuccess) +{ + *aSuccess = false; + Accessible* acc = IdToAccessibleSelect(aID); + if (acc) { + *aSuccess = acc->AddItemToSelection(aIndex); + } + + return true; +} + +bool +DocAccessibleChild::RecvRemoveItemFromSelection(const uint64_t& aID, + const uint32_t& aIndex, + bool* aSuccess) +{ + *aSuccess = false; + Accessible* acc = IdToAccessibleSelect(aID); + if (acc) { + *aSuccess = acc->RemoveItemFromSelection(aIndex); + } + + return true; +} + +bool +DocAccessibleChild::RecvSelectAll(const uint64_t& aID, + bool* aSuccess) +{ + *aSuccess = false; + Accessible* acc = IdToAccessibleSelect(aID); + if (acc) { + *aSuccess = acc->SelectAll(); + } + + return true; +} + +bool +DocAccessibleChild::RecvUnselectAll(const uint64_t& aID, + bool* aSuccess) +{ + *aSuccess = false; + Accessible* acc = IdToAccessibleSelect(aID); + if (acc) { + *aSuccess = acc->UnselectAll(); + } + + return true; +} + +bool +DocAccessibleChild::RecvDoAction(const uint64_t& aID, + const uint8_t& aIndex, + bool* aSuccess) +{ + *aSuccess = false; + Accessible* acc = IdToAccessible(aID); + if (acc) { + *aSuccess = acc->DoAction(aIndex); + } + + return true; +} + +bool +DocAccessibleChild::RecvActionCount(const uint64_t& aID, + uint8_t* aCount) +{ + *aCount = 0; + Accessible* acc = IdToAccessible(aID); + if (acc) { + *aCount = acc->ActionCount(); + } + + return true; +} + +bool +DocAccessibleChild::RecvActionDescriptionAt(const uint64_t& aID, + const uint8_t& aIndex, + nsString* aDescription) +{ + Accessible* acc = IdToAccessible(aID); + if (acc) { + acc->ActionDescriptionAt(aIndex, *aDescription); + } + + return true; +} + +bool +DocAccessibleChild::RecvActionNameAt(const uint64_t& aID, + const uint8_t& aIndex, + nsString* aName) +{ + Accessible* acc = IdToAccessible(aID); + if (acc) { + acc->ActionNameAt(aIndex, *aName); + } + + return true; +} + +bool +DocAccessibleChild::RecvAccessKey(const uint64_t& aID, + uint32_t* aKey, + uint32_t* aModifierMask) +{ + *aKey = 0; + *aModifierMask = 0; + Accessible* acc = IdToAccessible(aID); + if (acc) { + KeyBinding kb = acc->AccessKey(); + *aKey = kb.Key(); + *aModifierMask = kb.ModifierMask(); + } + + return true; +} + +bool +DocAccessibleChild::RecvKeyboardShortcut(const uint64_t& aID, + uint32_t* aKey, + uint32_t* aModifierMask) +{ + *aKey = 0; + *aModifierMask = 0; + Accessible* acc = IdToAccessible(aID); + if (acc) { + KeyBinding kb = acc->KeyboardShortcut(); + *aKey = kb.Key(); + *aModifierMask = kb.ModifierMask(); + } + + return true; +} + +bool +DocAccessibleChild::RecvCurValue(const uint64_t& aID, + double* aValue) +{ + *aValue = UnspecifiedNaN(); + Accessible* acc = IdToAccessible(aID); + if (acc) { + *aValue = acc->CurValue(); + } + + return true; +} + +bool +DocAccessibleChild::RecvSetCurValue(const uint64_t& aID, + const double& aValue, + bool* aRetVal) +{ + *aRetVal = false; + Accessible* acc = IdToAccessible(aID); + if (acc) { + *aRetVal = acc->SetCurValue(aValue); + } + + return true; +} + +bool +DocAccessibleChild::RecvMinValue(const uint64_t& aID, + double* aValue) +{ + *aValue = UnspecifiedNaN(); + Accessible* acc = IdToAccessible(aID); + if (acc) { + *aValue = acc->MinValue(); + } + + return true; +} + +bool +DocAccessibleChild::RecvMaxValue(const uint64_t& aID, + double* aValue) +{ + *aValue = UnspecifiedNaN(); + Accessible* acc = IdToAccessible(aID); + if (acc) { + *aValue = acc->MaxValue(); + } + + return true; +} + +bool +DocAccessibleChild::RecvStep(const uint64_t& aID, + double* aStep) +{ + *aStep = UnspecifiedNaN(); + Accessible* acc = IdToAccessible(aID); + if (acc) { + *aStep = acc->Step(); + } + + return true; +} + +bool +DocAccessibleChild::RecvTakeFocus(const uint64_t& aID) +{ + Accessible* acc = IdToAccessible(aID); + if (acc) { + acc->TakeFocus(); + } + + return true; +} + +bool +DocAccessibleChild::RecvChildAtPoint(const uint64_t& aID, + const int32_t& aX, + const int32_t& aY, + const uint32_t& aWhich, + uint64_t* aChild, + bool* aOk) +{ + *aChild = 0; + *aOk = false; + Accessible* acc = IdToAccessible(aID); + if (acc && !acc->IsDefunct() && !nsAccUtils::MustPrune(acc)) { + Accessible* child = + acc->ChildAtPoint(aX, aY, + static_cast(aWhich)); + if (child) { + *aChild = reinterpret_cast(child->UniqueID()); + *aOk = true; + } + } + + return true; +} + +bool +DocAccessibleChild::RecvBounds(const uint64_t& aID, + nsIntRect* aRect) +{ + Accessible* acc = IdToAccessible(aID); + if (acc && !acc->IsDefunct()) { + *aRect = acc->Bounds(); + } + + return false; +} + +bool +DocAccessibleChild::RecvLanguage(const uint64_t& aID, + nsString* aLocale) +{ + Accessible* acc = IdToAccessible(aID); + if (acc) { + acc->Language(*aLocale); + } + + return true; +} + +bool +DocAccessibleChild::RecvDocType(const uint64_t& aID, + nsString* aType) +{ + Accessible* acc = IdToAccessible(aID); + if (acc && acc->IsDoc()) { + acc->AsDoc()->DocType(*aType); + } + + return true; +} + +bool +DocAccessibleChild::RecvURL(const uint64_t& aID, + nsString* aURL) +{ + Accessible* acc = IdToAccessible(aID); + if (acc && acc->IsDoc()) { + acc->AsDoc()->URL(*aURL); + } + + return true; +} + +bool +DocAccessibleChild::RecvMimeType(const uint64_t& aID, + nsString* aMime) +{ + Accessible* acc = IdToAccessible(aID); + if (acc && acc->IsDoc()) { + acc->AsDoc()->MimeType(*aMime); + } + + return true; +} + +bool +DocAccessibleChild::RecvURLDocTypeMimeType(const uint64_t& aID, + nsString* aURL, + nsString* aDocType, + nsString* aMimeType) +{ + Accessible* acc = IdToAccessible(aID); + if (acc && acc->IsDoc()) { + DocAccessible* doc = acc->AsDoc(); + doc->URL(*aURL); + doc->DocType(*aDocType); + doc->MimeType(*aMimeType); + } + + return true; +} + } } diff --git a/accessible/ipc/DocAccessibleChild.h b/accessible/ipc/DocAccessibleChild.h index ac6a0e9705..6376b4ea80 100644 --- a/accessible/ipc/DocAccessibleChild.h +++ b/accessible/ipc/DocAccessibleChild.h @@ -15,7 +15,9 @@ namespace mozilla { namespace a11y { class Accessible; class HyperTextAccessible; - +class ImageAccessible; +class TableAccessible; +class TableCellAccessible; class AccShowEvent; /* @@ -34,9 +36,6 @@ public: MOZ_COUNT_DTOR(DocAccessibleChild); } - Accessible* IdToAccessible(const uint64_t& aID); - HyperTextAccessible* IdToHyperTextAccessible(const uint64_t& aID); - void ShowEvent(AccShowEvent* aShowEvent); /* @@ -64,6 +63,11 @@ public: virtual bool RecvAttributes(const uint64_t& aID, nsTArray *aAttributes) override; + virtual bool RecvCaretOffset(const uint64_t& aID, int32_t* aOffset) + MOZ_OVERRIDE; + virtual bool RecvSetCaretOffset(const uint64_t& aID, const int32_t& aOffset, + bool* aValid) MOZ_OVERRIDE; + virtual bool RecvCharacterCount(const uint64_t& aID, int32_t* aCount) override; virtual bool RecvSelectionCount(const uint64_t& aID, int32_t* aCount) @@ -71,8 +75,8 @@ public: virtual bool RecvTextSubstring(const uint64_t& aID, const int32_t& aStartOffset, - const int32_t& aEndOffset, nsString* aText) - override; + const int32_t& aEndOffset, nsString* aText, + bool* aValid) override; virtual bool RecvGetTextAfterOffset(const uint64_t& aID, const int32_t& aOffset, @@ -158,24 +162,264 @@ public: virtual bool RecvInsertText(const uint64_t& aID, const nsString& aText, - const int32_t& aPosition) override; + const int32_t& aPosition, bool* aValid) override; virtual bool RecvCopyText(const uint64_t& aID, const int32_t& aStartPos, - const int32_t& aEndPos) override; + const int32_t& aEndPos, bool* aValid) override; virtual bool RecvCutText(const uint64_t& aID, const int32_t& aStartPos, - const int32_t& aEndPos) override; + const int32_t& aEndPos, bool* aValid) override; virtual bool RecvDeleteText(const uint64_t& aID, const int32_t& aStartPos, - const int32_t& aEndPos) override; + const int32_t& aEndPos, bool* aValid) override; virtual bool RecvPasteText(const uint64_t& aID, - const int32_t& aPosition) override; + const int32_t& aPosition, bool* aValid) override; + virtual bool RecvCharAt(const uint64_t& aID, + const int32_t& aOffset, + uint16_t* aChar) MOZ_OVERRIDE; + + virtual bool RecvImagePosition(const uint64_t& aID, + const uint32_t& aCoordType, + nsIntPoint* aRetVal) override; + + virtual bool RecvImageSize(const uint64_t& aID, + nsIntSize* aRetVal) override; + + virtual bool RecvStartOffset(const uint64_t& aID, + uint32_t* aRetVal, + bool* aOk) override; + virtual bool RecvEndOffset(const uint64_t& aID, + uint32_t* aRetVal, + bool* aOk) override; + virtual bool RecvIsLinkValid(const uint64_t& aID, + bool* aRetVal) override; + virtual bool RecvAnchorCount(const uint64_t& aID, + uint32_t* aRetVal, bool* aOk) override; + virtual bool RecvAnchorURIAt(const uint64_t& aID, + const uint32_t& aIndex, + nsCString* aURI, + bool* aOk) override; + virtual bool RecvAnchorAt(const uint64_t& aID, + const uint32_t& aIndex, + uint64_t* aIDOfAnchor, + bool* aOk) override; + + virtual bool RecvLinkCount(const uint64_t& aID, + uint32_t* aCount) override; + + virtual bool RecvLinkAt(const uint64_t& aID, + const uint32_t& aIndex, + uint64_t* aIDOfLink, + bool* aOk) override; + + virtual bool RecvLinkIndexOf(const uint64_t& aID, + const uint64_t& aLinkID, + int32_t* aIndex) override; + + virtual bool RecvLinkIndexAtOffset(const uint64_t& aID, + const uint32_t& aOffset, + int32_t* aIndex) override; + + virtual bool RecvTableOfACell(const uint64_t& aID, + uint64_t* aTableID, + bool* aOk) override; + + virtual bool RecvColIdx(const uint64_t& aID, uint32_t* aIndex) override; + + virtual bool RecvRowIdx(const uint64_t& aID, uint32_t* aIndex) override; + + virtual bool RecvColExtent(const uint64_t& aID, uint32_t* aExtent) override; + + virtual bool RecvRowExtent(const uint64_t& aID, uint32_t* aExtent) override; + + virtual bool RecvColHeaderCells(const uint64_t& aID, + nsTArray* aCells) override; + + virtual bool RecvRowHeaderCells(const uint64_t& aID, + nsTArray* aCells) override; + + virtual bool RecvIsCellSelected(const uint64_t& aID, + bool* aSelected) override; + + virtual bool RecvTableCaption(const uint64_t& aID, + uint64_t* aCaptionID, + bool* aOk) override; + virtual bool RecvTableSummary(const uint64_t& aID, + nsString* aSummary) override; + virtual bool RecvTableColumnCount(const uint64_t& aID, + uint32_t* aColCount) override; + virtual bool RecvTableRowCount(const uint64_t& aID, + uint32_t* aRowCount) override; + virtual bool RecvTableCellAt(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + uint64_t* aCellID, + bool* aOk) override; + virtual bool RecvTableCellIndexAt(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + int32_t* aIndex) override; + virtual bool RecvTableColumnIndexAt(const uint64_t& aID, + const uint32_t& aCellIndex, + int32_t* aCol) override; + virtual bool RecvTableRowIndexAt(const uint64_t& aID, + const uint32_t& aCellIndex, + int32_t* aRow) override; + virtual bool RecvTableRowAndColumnIndicesAt(const uint64_t& aID, + const uint32_t& aCellIndex, + int32_t* aRow, + int32_t* aCol) override; + virtual bool RecvTableColumnExtentAt(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + uint32_t* aExtent) override; + virtual bool RecvTableRowExtentAt(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + uint32_t* aExtent) override; + virtual bool RecvTableColumnDescription(const uint64_t& aID, + const uint32_t& aCol, + nsString* aDescription) override; + virtual bool RecvTableRowDescription(const uint64_t& aID, + const uint32_t& aRow, + nsString* aDescription) override; + virtual bool RecvTableColumnSelected(const uint64_t& aID, + const uint32_t& aCol, + bool* aSelected) override; + virtual bool RecvTableRowSelected(const uint64_t& aID, + const uint32_t& aRow, + bool* aSelected) override; + virtual bool RecvTableCellSelected(const uint64_t& aID, + const uint32_t& aRow, + const uint32_t& aCol, + bool* aSelected) override; + virtual bool RecvTableSelectedCellCount(const uint64_t& aID, + uint32_t* aSelectedCells) override; + virtual bool RecvTableSelectedColumnCount(const uint64_t& aID, + uint32_t* aSelectedColumns) override; + virtual bool RecvTableSelectedRowCount(const uint64_t& aID, + uint32_t* aSelectedRows) override; + virtual bool RecvTableSelectedCells(const uint64_t& aID, + nsTArray* aCellIDs) override; + virtual bool RecvTableSelectedCellIndices(const uint64_t& aID, + nsTArray* aCellIndices) override; + virtual bool RecvTableSelectedColumnIndices(const uint64_t& aID, + nsTArray* aColumnIndices) override; + virtual bool RecvTableSelectedRowIndices(const uint64_t& aID, + nsTArray* aRowIndices) override; + virtual bool RecvTableSelectColumn(const uint64_t& aID, + const uint32_t& aCol) override; + virtual bool RecvTableSelectRow(const uint64_t& aID, + const uint32_t& aRow) override; + virtual bool RecvTableUnselectColumn(const uint64_t& aID, + const uint32_t& aCol) override; + virtual bool RecvTableUnselectRow(const uint64_t& aID, + const uint32_t& aRow) override; + virtual bool RecvTableIsProbablyForLayout(const uint64_t& aID, + bool* aForLayout) override; + + virtual bool RecvSelectedItems(const uint64_t& aID, + nsTArray* aSelectedItemIDs) override; + + virtual bool RecvSelectedItemCount(const uint64_t& aID, + uint32_t* aCount) override; + + virtual bool RecvGetSelectedItem(const uint64_t& aID, + const uint32_t& aIndex, + uint64_t* aSelected, + bool* aOk) override; + + virtual bool RecvIsItemSelected(const uint64_t& aID, + const uint32_t& aIndex, + bool* aSelected) override; + + virtual bool RecvAddItemToSelection(const uint64_t& aID, + const uint32_t& aIndex, + bool* aSuccess) override; + + virtual bool RecvRemoveItemFromSelection(const uint64_t& aID, + const uint32_t& aIndex, + bool* aSuccess) override; + + virtual bool RecvSelectAll(const uint64_t& aID, + bool* aSuccess) override; + + virtual bool RecvUnselectAll(const uint64_t& aID, + bool* aSuccess) override; + + virtual bool RecvDoAction(const uint64_t& aID, + const uint8_t& aIndex, + bool* aSuccess) override; + + virtual bool RecvActionCount(const uint64_t& aID, + uint8_t* aCount) override; + + virtual bool RecvActionDescriptionAt(const uint64_t& aID, + const uint8_t& aIndex, + nsString* aDescription) override; + + virtual bool RecvActionNameAt(const uint64_t& aID, + const uint8_t& aIndex, + nsString* aName) override; + + virtual bool RecvAccessKey(const uint64_t& aID, + uint32_t* aKey, + uint32_t* aModifierMask) override; + + virtual bool RecvKeyboardShortcut(const uint64_t& aID, + uint32_t* aKey, + uint32_t* aModifierMask) override; + + virtual bool RecvCurValue(const uint64_t& aID, + double* aValue); + + virtual bool RecvSetCurValue(const uint64_t& aID, + const double& aValue, + bool* aRetVal); + + virtual bool RecvMinValue(const uint64_t& aID, + double* aValue); + + virtual bool RecvMaxValue(const uint64_t& aID, + double* aValue); + + virtual bool RecvStep(const uint64_t& aID, + double* aStep); + + virtual bool RecvTakeFocus(const uint64_t& aID) override; + + virtual bool RecvChildAtPoint(const uint64_t& aID, + const int32_t& aX, + const int32_t& aY, + const uint32_t& aWhich, + uint64_t* aChild, + bool* aOk) override; + + virtual bool RecvBounds(const uint64_t& aID, nsIntRect* aRect) override; + + virtual bool RecvLanguage(const uint64_t& aID, nsString* aLocale) override; + virtual bool RecvDocType(const uint64_t& aID, nsString* aType) override; + virtual bool RecvURL(const uint64_t& aID, nsString* aURL) override; + virtual bool RecvMimeType(const uint64_t& aID, nsString* aMime) override; + virtual bool RecvURLDocTypeMimeType(const uint64_t& aID, + nsString* aURL, + nsString* aDocType, + nsString* aMimeType) override; private: + + Accessible* IdToAccessible(const uint64_t& aID) const; + Accessible* IdToAccessibleLink(const uint64_t& aID) const; + Accessible* IdToAccessibleSelect(const uint64_t& aID) const; + HyperTextAccessible* IdToHyperTextAccessible(const uint64_t& aID) const; + ImageAccessible* IdToImageAccessible(const uint64_t& aID) const; + TableCellAccessible* IdToTableCellAccessible(const uint64_t& aID) const; + TableAccessible* IdToTableAccessible(const uint64_t& aID) const; + bool PersistentPropertiesToArray(nsIPersistentProperties* aProps, nsTArray* aAttributes); diff --git a/accessible/ipc/DocAccessibleParent.cpp b/accessible/ipc/DocAccessibleParent.cpp index 38b41357e9..fce7207a1c 100644 --- a/accessible/ipc/DocAccessibleParent.cpp +++ b/accessible/ipc/DocAccessibleParent.cpp @@ -137,9 +137,19 @@ DocAccessibleParent::RecvEvent(const uint64_t& aID, const uint32_t& aEventType) ProxyEvent(e->mProxy, aEventType); return true; } + +bool +DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID) +{ + auto childDoc = static_cast(aChildDoc); + DebugOnly result = AddChildDoc(childDoc, aID, false); + MOZ_ASSERT(result); + return true; +} + bool DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc, - uint64_t aParentID) + uint64_t aParentID, bool aCreating) { ProxyAccessible* outerDoc = mAccessibles.GetEntry(aParentID)->mProxy; if (!outerDoc) @@ -149,7 +159,11 @@ DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc, outerDoc->SetChildDoc(aChildDoc); mChildDocs.AppendElement(aChildDoc); aChildDoc->mParentDoc = this; - ProxyCreated(aChildDoc, 0); + + if (aCreating) { + ProxyCreated(aChildDoc, 0); + } + return true; } diff --git a/accessible/ipc/DocAccessibleParent.h b/accessible/ipc/DocAccessibleParent.h index 369dd5f49c..80fcea072f 100644 --- a/accessible/ipc/DocAccessibleParent.h +++ b/accessible/ipc/DocAccessibleParent.h @@ -45,6 +45,14 @@ public: virtual bool RecvShowEvent(const ShowEventData& aData) override; virtual bool RecvHideEvent(const uint64_t& aRootID) override; + virtual bool RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID) override; + void Unbind() + { + mParent = nullptr; + mParentDoc->mChildDocs.RemoveElement(this); + mParentDoc = nullptr; + } + void Destroy(); virtual void ActorDestroy(ActorDestroyReason aWhy) override { @@ -62,7 +70,8 @@ public: * Called when a document in a content process notifies the main process of a * new child document. */ - bool AddChildDoc(DocAccessibleParent* aChildDoc, uint64_t aParentID); + bool AddChildDoc(DocAccessibleParent* aChildDoc, uint64_t aParentID, + bool aCreating = true); /* * Called when the document in the content process this object represents diff --git a/accessible/ipc/PDocAccessible.ipdl b/accessible/ipc/PDocAccessible.ipdl index 21cc77aaa1..689879254d 100644 --- a/accessible/ipc/PDocAccessible.ipdl +++ b/accessible/ipc/PDocAccessible.ipdl @@ -6,7 +6,11 @@ include protocol PContent; +include "mozilla/GfxMessageUtils.h"; + +using struct nsIntPoint from "nsRect.h"; using struct nsIntRect from "nsRect.h"; +using mozilla::gfx::IntSize from "mozilla/gfx/Point.h"; namespace mozilla { namespace a11y { @@ -53,6 +57,12 @@ parent: ShowEvent(ShowEventData data); HideEvent(uint64_t aRootID); + /* + * Tell the parent document to bind the existing document as a new child + * document. + */ + BindChildDoc(PDocAccessible aChildDoc, uint64_t aID); + child: // Accessible prio(high) sync State(uint64_t aID) returns(uint64_t states); @@ -67,10 +77,12 @@ child: // AccessibleText // TextSubstring is getText in IDL. + prio(high) sync CaretOffset(uint64_t aID) returns(int32_t aOffset); + prio(high) sync SetCaretOffset(uint64_t aID, int32_t aOffset) returns (bool aValid); prio(high) sync CharacterCount(uint64_t aID) returns(int32_t aCount); prio(high) sync SelectionCount(uint64_t aID) returns(int32_t aCount); prio(high) sync TextSubstring(uint64_t aID, int32_t aStartOffset, int32_t - aEndOffset) returns(nsString aText); + aEndOffset) returns(nsString aText, bool aValid); prio(high) sync GetTextAfterOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType) returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset); prio(high) sync GetTextAtOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType) @@ -78,6 +90,7 @@ child: prio(high) sync GetTextBeforeOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType) returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset); + prio(high) sync CharAt(uint64_t aID, int32_t aOffset) returns(uint16_t aChar); prio(high) sync TextAttributes(uint64_t aID, bool aIncludeDefAttrs, int32_t aOffset) returns(Attribute[] aAttributes, int32_t aStartOffset, int32_t aEndOffset); @@ -111,11 +124,102 @@ child: int32_t aX, int32_t aY); prio(high) sync ReplaceText(uint64_t aID, nsString aText); - prio(high) sync InsertText(uint64_t aID, nsString aText, int32_t aPosition); - prio(high) sync CopyText(uint64_t aID, int32_t aStartPos, int32_t aEndPos); - prio(high) sync CutText(uint64_t aID, int32_t aStartPos, int32_t aEndPos); - prio(high) sync DeleteText(uint64_t aID, int32_t aStartPos, int32_t aEndPos); - prio(high) sync PasteText(uint64_t aID, int32_t aPosition); + prio(high) sync InsertText(uint64_t aID, nsString aText, int32_t aPosition) + returns(bool aValid); + prio(high) sync CopyText(uint64_t aID, int32_t aStartPos, int32_t aEndPos) + returns(bool aValid); + prio(high) sync CutText(uint64_t aID, int32_t aStartPos, int32_t aEndPos) + returns(bool aValid); + prio(high) sync DeleteText(uint64_t aID, int32_t aStartPos, int32_t aEndPos) + returns(bool aValid); + prio(high) sync PasteText(uint64_t aID, int32_t aPosition) + returns(bool aValid); + + prio(high) sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(nsIntPoint aRetVal); + prio(high) sync ImageSize(uint64_t aID) returns(IntSize aRetVal); + + prio(high) sync StartOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk); + prio(high) sync EndOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk); + prio(high) sync IsLinkValid(uint64_t aID) returns(bool aRetVal); + prio(high) sync AnchorCount(uint64_t aID) returns(uint32_t aRetVal, bool aOk); + prio(high) sync AnchorURIAt(uint64_t aID, uint32_t aIndex) returns(nsCString aURI, bool aOk); + prio(high) sync AnchorAt(uint64_t aID, uint32_t aIndex) returns(uint64_t aIDOfAnchor, bool aOk); + + prio(high) sync LinkCount(uint64_t aID) returns(uint32_t aCount); + prio(high) sync LinkAt(uint64_t aID, uint32_t aIndex) returns(uint64_t aIDOfLink, bool aOk); + prio(high) sync LinkIndexOf(uint64_t aID, uint64_t aLinkID) returns(int32_t aIndex); + prio(high) sync LinkIndexAtOffset(uint64_t aID, uint32_t aOffset) returns(int32_t aIndex); + + prio(high) sync TableOfACell(uint64_t aID) returns(uint64_t aTableID, bool aOk); + prio(high) sync ColIdx(uint64_t aID) returns(uint32_t aIndex); + prio(high) sync RowIdx(uint64_t aID) returns(uint32_t aIndex); + prio(high) sync ColExtent(uint64_t aID) returns(uint32_t aExtent); + prio(high) sync RowExtent(uint64_t aID) returns(uint32_t aExtent); + prio(high) sync ColHeaderCells(uint64_t aID) returns(uint64_t[] aCells); + prio(high) sync RowHeaderCells(uint64_t aID) returns(uint64_t[] aCells); + prio(high) sync IsCellSelected(uint64_t aID) returns(bool aSelected); + + prio(high) sync TableCaption(uint64_t aID) returns(uint64_t aCaptionID, bool aOk); + prio(high) sync TableSummary(uint64_t aID) returns(nsString aSummary); + prio(high) sync TableColumnCount(uint64_t aID) returns(uint32_t aColCount); + prio(high) sync TableRowCount(uint64_t aID) returns(uint32_t aRowCount); + prio(high) sync TableCellAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint64_t aCellID, bool aOk); + prio(high) sync TableCellIndexAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(int32_t aIndex); + prio(high) sync TableColumnIndexAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aCol); + prio(high) sync TableRowIndexAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aRow); + prio(high) sync TableRowAndColumnIndicesAt(uint64_t aID, uint32_t aCellIndex) returns(int32_t aRow, int32_t aCol); + prio(high) sync TableColumnExtentAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint32_t aExtent); + prio(high) sync TableRowExtentAt(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(uint32_t aExtent); + prio(high) sync TableColumnDescription(uint64_t aID, uint32_t aCol) returns(nsString aDescription); + prio(high) sync TableRowDescription(uint64_t aID, uint32_t aRow) returns(nsString aDescription); + prio(high) sync TableColumnSelected(uint64_t aID, uint32_t aCol) returns(bool aSelected); + prio(high) sync TableRowSelected(uint64_t aID, uint32_t aRow) returns(bool aSelected); + prio(high) sync TableCellSelected(uint64_t aID, uint32_t aRow, uint32_t aCol) returns(bool aSelected); + prio(high) sync TableSelectedCellCount(uint64_t aID) returns(uint32_t aSelectedCells); + prio(high) sync TableSelectedColumnCount(uint64_t aID) returns(uint32_t aSelectedColumns); + prio(high) sync TableSelectedRowCount(uint64_t aID) returns(uint32_t aSelectedRows); + prio(high) sync TableSelectedCells(uint64_t aID) returns(uint64_t[] aCellIDs); + prio(high) sync TableSelectedCellIndices(uint64_t aID) returns(uint32_t[] aCellIndeces); + prio(high) sync TableSelectedColumnIndices(uint64_t aID) returns(uint32_t[] aColumnIndeces); + prio(high) sync TableSelectedRowIndices(uint64_t aID) returns(uint32_t[] aRowIndeces); + prio(high) sync TableSelectColumn(uint64_t aID, uint32_t aCol); + prio(high) sync TableSelectRow(uint64_t aID, uint32_t aRow); + prio(high) sync TableUnselectColumn(uint64_t aID, uint32_t aCol); + prio(high) sync TableUnselectRow(uint64_t aID, uint32_t aRow); + prio(high) sync TableIsProbablyForLayout(uint64_t aID) returns(bool aForLayout); + + prio(high) sync SelectedItems(uint64_t aID) returns(uint64_t[] aSelectedItemIDs); + prio(high) sync SelectedItemCount(uint64_t aID) returns(uint32_t aCount); + prio(high) sync GetSelectedItem(uint64_t aID, uint32_t aIndex) returns(uint64_t aSelected, bool aOk); + prio(high) sync IsItemSelected(uint64_t aID, uint32_t aIndex) returns(bool aSelected); + prio(high) sync AddItemToSelection(uint64_t aID, uint32_t aIndex) returns(bool aSuccess); + prio(high) sync RemoveItemFromSelection(uint64_t aID, uint32_t aIndex) returns(bool aSuccess); + prio(high) sync SelectAll(uint64_t aID) returns(bool aSuccess); + prio(high) sync UnselectAll(uint64_t aID) returns(bool aSuccess); + + prio(high) sync DoAction(uint64_t aID, uint8_t aIndex) returns(bool aSuccess); + prio(high) sync ActionCount(uint64_t aID) returns(uint8_t aCount); + prio(high) sync ActionDescriptionAt(uint64_t aID, uint8_t aIndex) returns(nsString aDescription); + prio(high) sync ActionNameAt(uint64_t aID, uint8_t aIndex) returns(nsString aName); + prio(high) sync AccessKey(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask); + prio(high) sync KeyboardShortcut(uint64_t aID) returns(uint32_t aKey, uint32_t aModifierMask); + + prio(high) sync CurValue(uint64_t aID) returns(double aValue); + prio(high) sync SetCurValue(uint64_t aID, double aValue) returns(bool aRetVal); + prio(high) sync MinValue(uint64_t aID) returns(double aValue); + prio(high) sync MaxValue(uint64_t aID) returns(double aValue); + prio(high) sync Step(uint64_t aID) returns(double aStep); + + prio(high) sync TakeFocus(uint64_t aID); + prio(high) sync ChildAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aWhich) + returns(uint64_t aChild, bool aOk); + prio(high) sync Bounds(uint64_t aID) returns(nsIntRect aRect); + + prio(high) sync Language(uint64_t aID) returns(nsString aLocale); + prio(high) sync DocType(uint64_t aID) returns(nsString aType); + prio(high) sync URL(uint64_t aID) returns(nsString aURL); + prio(high) sync MimeType(uint64_t aID) returns(nsString aMime); + prio(high) sync URLDocTypeMimeType(uint64_t aID) returns(nsString aURL, nsString aDocType, nsString aMimeType); }; } diff --git a/accessible/ipc/ProxyAccessible.cpp b/accessible/ipc/ProxyAccessible.cpp index e9bf9d9563..aa38075fe7 100644 --- a/accessible/ipc/ProxyAccessible.cpp +++ b/accessible/ipc/ProxyAccessible.cpp @@ -29,7 +29,7 @@ ProxyAccessible::Shutdown() if (mChildren.Length() != 1) MOZ_CRASH("outer doc doesn't own adoc!"); - static_cast(mChildren[0])->Destroy(); + static_cast(mChildren[0])->Unbind(); } mChildren.Clear(); @@ -149,6 +149,22 @@ ProxyAccessible::Relations(nsTArray* aTypes, } } +int32_t +ProxyAccessible::CaretOffset() +{ + int32_t offset = 0; + unused << mDoc->SendCaretOffset(mID, &offset); + return offset; +} + +bool +ProxyAccessible::SetCaretOffset(int32_t aOffset) +{ + bool valid = false; + unused << mDoc->SendSetCaretOffset(mID, aOffset, &valid); + return valid; +} + int32_t ProxyAccessible::CharacterCount() { @@ -165,11 +181,13 @@ ProxyAccessible::SelectionCount() return count; } -void +bool ProxyAccessible::TextSubstring(int32_t aStartOffset, int32_t aEndOfset, nsString& aText) const { - unused << mDoc->SendTextSubstring(mID, aStartOffset, aEndOfset, &aText); + bool valid; + unused << mDoc->SendTextSubstring(mID, aStartOffset, aEndOfset, &aText, &valid); + return valid; } void @@ -309,34 +327,631 @@ ProxyAccessible::ReplaceText(const nsString& aText) unused << mDoc->SendReplaceText(mID, aText); } -void +bool ProxyAccessible::InsertText(const nsString& aText, int32_t aPosition) { - unused << mDoc->SendInsertText(mID, aText, aPosition); + bool valid; + unused << mDoc->SendInsertText(mID, aText, aPosition, &valid); + return valid; } -void +bool ProxyAccessible::CopyText(int32_t aStartPos, int32_t aEndPos) { - unused << mDoc->SendCopyText(mID, aStartPos, aEndPos); + bool valid; + unused << mDoc->SendCopyText(mID, aStartPos, aEndPos, &valid); + return valid; } -void +bool ProxyAccessible::CutText(int32_t aStartPos, int32_t aEndPos) { - unused << mDoc->SendCutText(mID, aStartPos, aEndPos); + bool valid; + unused << mDoc->SendCutText(mID, aStartPos, aEndPos, &valid); + return valid; } -void +bool ProxyAccessible::DeleteText(int32_t aStartPos, int32_t aEndPos) { - unused << mDoc->SendDeleteText(mID, aStartPos, aEndPos); + bool valid; + unused << mDoc->SendDeleteText(mID, aStartPos, aEndPos, &valid); + return valid; +} + +bool +ProxyAccessible::PasteText(int32_t aPosition) +{ + bool valid; + unused << mDoc->SendPasteText(mID, aPosition, &valid); + return valid; +} + +char16_t +ProxyAccessible::CharAt(int32_t aOffset) +{ + uint16_t retval = 0; + unused << mDoc->SendCharAt(mID, aOffset, &retval); + return static_cast(retval); +} + +nsIntPoint +ProxyAccessible::ImagePosition(uint32_t aCoordType) +{ + nsIntPoint retVal; + unused << mDoc->SendImagePosition(mID, aCoordType, &retVal); + return retVal; +} + +nsIntSize +ProxyAccessible::ImageSize() +{ + nsIntSize retVal; + unused << mDoc->SendImageSize(mID, &retVal); + return retVal; +} + +uint32_t +ProxyAccessible::StartOffset(bool* aOk) +{ + uint32_t retVal = 0; + unused << mDoc->SendStartOffset(mID, &retVal, aOk); + return retVal; +} + +uint32_t +ProxyAccessible::EndOffset(bool* aOk) +{ + uint32_t retVal = 0; + unused << mDoc->SendEndOffset(mID, &retVal, aOk); + return retVal; +} + +bool +ProxyAccessible::IsLinkValid() +{ + bool retVal = false; + unused << mDoc->SendIsLinkValid(mID, &retVal); + return retVal; +} + +uint32_t +ProxyAccessible::AnchorCount(bool* aOk) +{ + uint32_t retVal = 0; + unused << mDoc->SendAnchorCount(mID, &retVal, aOk); + return retVal; } void -ProxyAccessible::PasteText(int32_t aPosition) +ProxyAccessible::AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk) { - unused << mDoc->SendPasteText(mID, aPosition); + unused << mDoc->SendAnchorURIAt(mID, aIndex, &aURI, aOk); +} + +ProxyAccessible* +ProxyAccessible::AnchorAt(uint32_t aIndex) +{ + uint64_t id = 0; + bool ok = false; + unused << mDoc->SendAnchorAt(mID, aIndex, &id, &ok); + return ok ? mDoc->GetAccessible(id) : nullptr; +} + +uint32_t +ProxyAccessible::LinkCount() +{ + uint32_t retVal = 0; + unused << mDoc->SendLinkCount(mID, &retVal); + return retVal; +} + +ProxyAccessible* +ProxyAccessible::LinkAt(const uint32_t& aIndex) +{ + uint64_t linkID = 0; + bool ok = false; + unused << mDoc->SendLinkAt(mID, aIndex, &linkID, &ok); + return ok ? mDoc->GetAccessible(linkID) : nullptr; +} + +int32_t +ProxyAccessible::LinkIndexOf(ProxyAccessible* aLink) +{ + int32_t retVal = -1; + if (aLink) { + unused << mDoc->SendLinkIndexOf(mID, aLink->ID(), &retVal); + } + + return retVal; +} + +int32_t +ProxyAccessible::LinkIndexAtOffset(uint32_t aOffset) +{ + int32_t retVal = -1; + unused << mDoc->SendLinkIndexAtOffset(mID, aOffset, &retVal); + return retVal; +} + +ProxyAccessible* +ProxyAccessible::TableOfACell() +{ + uint64_t tableID = 0; + bool ok = false; + unused << mDoc->SendTableOfACell(mID, &tableID, &ok); + return ok ? mDoc->GetAccessible(tableID) : nullptr; +} + +uint32_t +ProxyAccessible::ColIdx() +{ + uint32_t index = 0; + unused << mDoc->SendColIdx(mID, &index); + return index; +} + +uint32_t +ProxyAccessible::RowIdx() +{ + uint32_t index = 0; + unused << mDoc->SendRowIdx(mID, &index); + return index; +} + +uint32_t +ProxyAccessible::ColExtent() +{ + uint32_t extent = 0; + unused << mDoc->SendColExtent(mID, &extent); + return extent; +} + +uint32_t +ProxyAccessible::RowExtent() +{ + uint32_t extent = 0; + unused << mDoc->SendRowExtent(mID, &extent); + return extent; +} + +void +ProxyAccessible::ColHeaderCells(nsTArray* aCells) +{ + unused << mDoc->SendColHeaderCells(mID, aCells); +} + +void +ProxyAccessible::RowHeaderCells(nsTArray* aCells) +{ + unused << mDoc->SendRowHeaderCells(mID, aCells); +} + +bool +ProxyAccessible::IsCellSelected() +{ + bool selected = false; + unused << mDoc->SendIsCellSelected(mID, &selected); + return selected; +} + +ProxyAccessible* +ProxyAccessible::TableCaption() +{ + uint64_t captionID = 0; + bool ok = false; + unused << mDoc->SendTableCaption(mID, &captionID, &ok); + return ok ? mDoc->GetAccessible(captionID) : nullptr; +} + +void +ProxyAccessible::TableSummary(nsString& aSummary) +{ + unused << mDoc->SendTableSummary(mID, &aSummary); +} + +uint32_t +ProxyAccessible::TableColumnCount() +{ + uint32_t count = 0; + unused << mDoc->SendTableColumnCount(mID, &count); + return count; +} + +uint32_t +ProxyAccessible::TableRowCount() +{ + uint32_t count = 0; + unused << mDoc->SendTableRowCount(mID, &count); + return count; +} + +ProxyAccessible* +ProxyAccessible::TableCellAt(uint32_t aRow, uint32_t aCol) +{ + uint64_t cellID = 0; + bool ok = false; + unused << mDoc->SendTableCellAt(mID, aRow, aCol, &cellID, &ok); + return ok ? mDoc->GetAccessible(cellID) : nullptr; +} + +int32_t +ProxyAccessible::TableCellIndexAt(uint32_t aRow, uint32_t aCol) +{ + int32_t index = 0; + unused << mDoc->SendTableCellIndexAt(mID, aRow, aCol, &index); + return index; +} + +int32_t +ProxyAccessible::TableColumnIndexAt(uint32_t aCellIndex) +{ + int32_t index = 0; + unused << mDoc->SendTableColumnIndexAt(mID, aCellIndex, &index); + return index; +} + +int32_t +ProxyAccessible::TableRowIndexAt(uint32_t aCellIndex) +{ + int32_t index = 0; + unused << mDoc->SendTableRowIndexAt(mID, aCellIndex, &index); + return index; +} + +void +ProxyAccessible::TableRowAndColumnIndicesAt(uint32_t aCellIndex, + int32_t* aRow, int32_t* aCol) +{ + unused << mDoc->SendTableRowAndColumnIndicesAt(mID, aCellIndex, aRow, aCol); +} + +uint32_t +ProxyAccessible::TableColumnExtentAt(uint32_t aRow, uint32_t aCol) +{ + uint32_t extent = 0; + unused << mDoc->SendTableColumnExtentAt(mID, aRow, aCol, &extent); + return extent; +} + +uint32_t +ProxyAccessible::TableRowExtentAt(uint32_t aRow, uint32_t aCol) +{ + uint32_t extent = 0; + unused << mDoc->SendTableRowExtentAt(mID, aRow, aCol, &extent); + return extent; +} + +void +ProxyAccessible::TableColumnDescription(uint32_t aCol, nsString& aDescription) +{ + unused << mDoc->SendTableColumnDescription(mID, aCol, &aDescription); +} + +void +ProxyAccessible::TableRowDescription(uint32_t aRow, nsString& aDescription) +{ + unused << mDoc->SendTableRowDescription(mID, aRow, &aDescription); +} + +bool +ProxyAccessible::TableColumnSelected(uint32_t aCol) +{ + bool selected = false; + unused << mDoc->SendTableColumnSelected(mID, aCol, &selected); + return selected; +} + +bool +ProxyAccessible::TableRowSelected(uint32_t aRow) +{ + bool selected = false; + unused << mDoc->SendTableRowSelected(mID, aRow, &selected); + return selected; +} + +bool +ProxyAccessible::TableCellSelected(uint32_t aRow, uint32_t aCol) +{ + bool selected = false; + unused << mDoc->SendTableCellSelected(mID, aRow, aCol, &selected); + return selected; +} + +uint32_t +ProxyAccessible::TableSelectedCellCount() +{ + uint32_t count = 0; + unused << mDoc->SendTableSelectedCellCount(mID, &count); + return count; +} + +uint32_t +ProxyAccessible::TableSelectedColumnCount() +{ + uint32_t count = 0; + unused << mDoc->SendTableSelectedColumnCount(mID, &count); + return count; +} + +uint32_t +ProxyAccessible::TableSelectedRowCount() +{ + uint32_t count = 0; + unused << mDoc->SendTableSelectedRowCount(mID, &count); + return count; +} + +void +ProxyAccessible::TableSelectedCells(nsTArray* aCellIDs) +{ + nsAutoTArray cellIDs; + unused << mDoc->SendTableSelectedCells(mID, &cellIDs); + aCellIDs->SetCapacity(cellIDs.Length()); + for (uint32_t i = 0; i < cellIDs.Length(); ++i) { + aCellIDs->AppendElement(mDoc->GetAccessible(cellIDs[i])); + } +} + +void +ProxyAccessible::TableSelectedCellIndices(nsTArray* aCellIndices) +{ + unused << mDoc->SendTableSelectedCellIndices(mID, aCellIndices); +} + +void +ProxyAccessible::TableSelectedColumnIndices(nsTArray* aColumnIndices) +{ + unused << mDoc->SendTableSelectedColumnIndices(mID, aColumnIndices); +} + +void +ProxyAccessible::TableSelectedRowIndices(nsTArray* aRowIndices) +{ + unused << mDoc->SendTableSelectedRowIndices(mID, aRowIndices); +} + +void +ProxyAccessible::TableSelectColumn(uint32_t aCol) +{ + unused << mDoc->SendTableSelectColumn(mID, aCol); +} + +void +ProxyAccessible::TableSelectRow(uint32_t aRow) +{ + unused << mDoc->SendTableSelectRow(mID, aRow); +} + +void +ProxyAccessible::TableUnselectColumn(uint32_t aCol) +{ + unused << mDoc->SendTableUnselectColumn(mID, aCol); +} + +void +ProxyAccessible::TableUnselectRow(uint32_t aRow) +{ + unused << mDoc->SendTableUnselectRow(mID, aRow); +} + +bool +ProxyAccessible::TableIsProbablyForLayout() +{ + bool forLayout = false; + unused << mDoc->SendTableIsProbablyForLayout(mID, &forLayout); + return forLayout; +} + +void +ProxyAccessible::SelectedItems(nsTArray* aSelectedItems) +{ + nsAutoTArray itemIDs; + unused << mDoc->SendSelectedItems(mID, &itemIDs); + aSelectedItems->SetCapacity(itemIDs.Length()); + for (size_t i = 0; i < itemIDs.Length(); ++i) { + aSelectedItems->AppendElement(mDoc->GetAccessible(itemIDs[i])); + } +} + +uint32_t +ProxyAccessible::SelectedItemCount() +{ + uint32_t count = 0; + unused << mDoc->SendSelectedItemCount(mID, &count); + return count; +} + +ProxyAccessible* +ProxyAccessible::GetSelectedItem(uint32_t aIndex) +{ + uint64_t selectedItemID = 0; + bool ok = false; + unused << mDoc->SendGetSelectedItem(mID, aIndex, &selectedItemID, &ok); + return ok ? mDoc->GetAccessible(selectedItemID) : nullptr; +} + +bool +ProxyAccessible::IsItemSelected(uint32_t aIndex) +{ + bool selected = false; + unused << mDoc->SendIsItemSelected(mID, aIndex, &selected); + return selected; +} + +bool +ProxyAccessible::AddItemToSelection(uint32_t aIndex) +{ + bool success = false; + unused << mDoc->SendAddItemToSelection(mID, aIndex, &success); + return success; +} + +bool +ProxyAccessible::RemoveItemFromSelection(uint32_t aIndex) +{ + bool success = false; + unused << mDoc->SendRemoveItemFromSelection(mID, aIndex, &success); + return success; +} + +bool +ProxyAccessible::SelectAll() +{ + bool success = false; + unused << mDoc->SendSelectAll(mID, &success); + return success; +} + +bool +ProxyAccessible::UnselectAll() +{ + bool success = false; + unused << mDoc->SendUnselectAll(mID, &success); + return success; +} + +bool +ProxyAccessible::DoAction(uint8_t aIndex) +{ + bool success = false; + unused << mDoc->SendDoAction(mID, aIndex, &success); + return success; +} + +uint8_t +ProxyAccessible::ActionCount() +{ + uint8_t count = 0; + unused << mDoc->SendActionCount(mID, &count); + return count; +} + +void +ProxyAccessible::ActionDescriptionAt(uint8_t aIndex, nsString& aDescription) +{ + unused << mDoc->SendActionDescriptionAt(mID, aIndex, &aDescription); +} + +void +ProxyAccessible::ActionNameAt(uint8_t aIndex, nsString& aName) +{ + unused << mDoc->SendActionNameAt(mID, aIndex, &aName); +} + +KeyBinding +ProxyAccessible::AccessKey() +{ + uint32_t key = 0; + uint32_t modifierMask = 0; + unused << mDoc->SendAccessKey(mID, &key, &modifierMask); + return KeyBinding(key, modifierMask); +} + +KeyBinding +ProxyAccessible::KeyboardShortcut() +{ + uint32_t key = 0; + uint32_t modifierMask = 0; + unused << mDoc->SendKeyboardShortcut(mID, &key, &modifierMask); + return KeyBinding(key, modifierMask); +} + +double +ProxyAccessible::CurValue() +{ + double val = UnspecifiedNaN(); + unused << mDoc->SendCurValue(mID, &val); + return val; +} + +bool +ProxyAccessible::SetCurValue(double aValue) +{ + bool success = false; + unused << mDoc->SendSetCurValue(mID, aValue, &success); + return success; +} + +double +ProxyAccessible::MinValue() +{ + double val = UnspecifiedNaN(); + unused << mDoc->SendMinValue(mID, &val); + return val; +} + +double +ProxyAccessible::MaxValue() +{ + double val = UnspecifiedNaN(); + unused << mDoc->SendMaxValue(mID, &val); + return val; +} + +double +ProxyAccessible::Step() +{ + double step = UnspecifiedNaN(); + unused << mDoc->SendStep(mID, &step); + return step; +} + +void +ProxyAccessible::TakeFocus() +{ + unused << mDoc->SendTakeFocus(mID); +} + +ProxyAccessible* +ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY, + Accessible::EWhichChildAtPoint aWhichChild) +{ + uint64_t childID = 0; + bool ok = false; + unused << mDoc->SendChildAtPoint(mID, aX, aY, + static_cast(aWhichChild), + &childID, &ok); + return ok ? mDoc->GetAccessible(childID) : nullptr; +} + +nsIntRect +ProxyAccessible::Bounds() +{ + nsIntRect rect; + unused << mDoc->SendBounds(mID, &rect); + return rect; +} + +void +ProxyAccessible::Language(nsString& aLocale) +{ + unused << mDoc->SendLanguage(mID, &aLocale); +} + +void +ProxyAccessible::DocType(nsString& aType) +{ + unused << mDoc->SendDocType(mID, &aType); +} + +void +ProxyAccessible::URL(nsString& aURL) +{ + unused << mDoc->SendURL(mID, &aURL); +} + +void +ProxyAccessible::MimeType(nsString aMime) +{ + unused << mDoc->SendMimeType(mID, &aMime); +} + +void +ProxyAccessible::URLDocTypeMimeType(nsString& aURL, nsString& aDocType, + nsString& aMimeType) +{ + unused << mDoc->SendURLDocTypeMimeType(mID, &aURL, &aDocType, &aMimeType); } } diff --git a/accessible/ipc/ProxyAccessible.h b/accessible/ipc/ProxyAccessible.h index acd1a0105f..ba7786e7b1 100644 --- a/accessible/ipc/ProxyAccessible.h +++ b/accessible/ipc/ProxyAccessible.h @@ -9,9 +9,11 @@ #include "mozilla/a11y/Role.h" #include "nsIAccessibleText.h" +#include "Accessible.h" #include "nsString.h" #include "nsTArray.h" #include "nsRect.h" +#include "Accessible.h" namespace mozilla { namespace a11y { @@ -42,6 +44,9 @@ public: uint32_t ChildrenCount() const { return mChildren.Length(); } ProxyAccessible* ChildAt(uint32_t aIdx) const { return mChildren[aIdx]; } + + // XXX evaluate if this is fast enough. + size_t IndexInParent() const { return mParent->mChildren.IndexOf(this); } bool MustPruneChildren() const; void Shutdown(); @@ -100,13 +105,18 @@ public: void Relations(nsTArray* aTypes, nsTArray>* aTargetSets) const; + int32_t CaretOffset(); + bool SetCaretOffset(int32_t aOffset); + int32_t CharacterCount(); int32_t SelectionCount(); + char16_t CharAt(int32_t aOffset); + /** * Get the text between the given offsets. */ - void TextSubstring(int32_t aStartOffset, int32_t aEndOfset, + bool TextSubstring(int32_t aStartOffset, int32_t aEndOfset, nsString& aText) const; void GetTextAfterOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType, @@ -159,15 +169,119 @@ public: void ReplaceText(const nsString& aText); - void InsertText(const nsString& aText, int32_t aPosition); + bool InsertText(const nsString& aText, int32_t aPosition); - void CopyText(int32_t aStartPos, int32_t aEndPos); + bool CopyText(int32_t aStartPos, int32_t aEndPos); - void CutText(int32_t aStartPos, int32_t aEndPos); + bool CutText(int32_t aStartPos, int32_t aEndPos); - void DeleteText(int32_t aStartPos, int32_t aEndPos); + bool DeleteText(int32_t aStartPos, int32_t aEndPos); - void PasteText(int32_t aPosition); + bool PasteText(int32_t aPosition); + + nsIntPoint ImagePosition(uint32_t aCoordType); + + nsIntSize ImageSize(); + + uint32_t StartOffset(bool* aOk); + + uint32_t EndOffset(bool* aOk); + + bool IsLinkValid(); + + uint32_t AnchorCount(bool* aOk); + + void AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk); + + ProxyAccessible* AnchorAt(uint32_t aIndex); + + uint32_t LinkCount(); + + ProxyAccessible* LinkAt(const uint32_t& aIndex); + + int32_t LinkIndexOf(ProxyAccessible* aLink); + + int32_t LinkIndexAtOffset(uint32_t aOffset); + + ProxyAccessible* TableOfACell(); + + uint32_t ColIdx(); + + uint32_t RowIdx(); + + uint32_t ColExtent(); + + uint32_t RowExtent(); + + void ColHeaderCells(nsTArray* aCells); + + void RowHeaderCells(nsTArray* aCells); + + bool IsCellSelected(); + + ProxyAccessible* TableCaption(); + void TableSummary(nsString& aSummary); + uint32_t TableColumnCount(); + uint32_t TableRowCount(); + ProxyAccessible* TableCellAt(uint32_t aRow, uint32_t aCol); + int32_t TableCellIndexAt(uint32_t aRow, uint32_t aCol); + int32_t TableColumnIndexAt(uint32_t aCellIndex); + int32_t TableRowIndexAt(uint32_t aCellIndex); + void TableRowAndColumnIndicesAt(uint32_t aCellIndex, + int32_t* aRow, int32_t* aCol); + uint32_t TableColumnExtentAt(uint32_t aRow, uint32_t aCol); + uint32_t TableRowExtentAt(uint32_t aRow, uint32_t aCol); + void TableColumnDescription(uint32_t aCol, nsString& aDescription); + void TableRowDescription(uint32_t aRow, nsString& aDescription); + bool TableColumnSelected(uint32_t aCol); + bool TableRowSelected(uint32_t aRow); + bool TableCellSelected(uint32_t aRow, uint32_t aCol); + uint32_t TableSelectedCellCount(); + uint32_t TableSelectedColumnCount(); + uint32_t TableSelectedRowCount(); + void TableSelectedCells(nsTArray* aCellIDs); + void TableSelectedCellIndices(nsTArray* aCellIndices); + void TableSelectedColumnIndices(nsTArray* aColumnIndices); + void TableSelectedRowIndices(nsTArray* aRowIndices); + void TableSelectColumn(uint32_t aCol); + void TableSelectRow(uint32_t aRow); + void TableUnselectColumn(uint32_t aCol); + void TableUnselectRow(uint32_t aRow); + bool TableIsProbablyForLayout(); + + void SelectedItems(nsTArray* aSelectedItems); + uint32_t SelectedItemCount(); + ProxyAccessible* GetSelectedItem(uint32_t aIndex); + bool IsItemSelected(uint32_t aIndex); + bool AddItemToSelection(uint32_t aIndex); + bool RemoveItemFromSelection(uint32_t aIndex); + bool SelectAll(); + bool UnselectAll(); + + bool DoAction(uint8_t aIndex); + uint8_t ActionCount(); + void ActionDescriptionAt(uint8_t aIndex, nsString& aDescription); + void ActionNameAt(uint8_t aIndex, nsString& aName); + KeyBinding AccessKey(); + KeyBinding KeyboardShortcut(); + + double CurValue(); + bool SetCurValue(double aValue); + double MinValue(); + double MaxValue(); + double Step(); + + void TakeFocus(); + ProxyAccessible* ChildAtPoint(int32_t aX, int32_t aY, + Accessible::EWhichChildAtPoint aWhichChild); + nsIntRect Bounds(); + + void Language(nsString& aLocale); + void DocType(nsString& aType); + void URL(nsString& aURL); + void MimeType(nsString aMime); + void URLDocTypeMimeType(nsString& aURL, nsString& aDocType, + nsString& aMimeType); /** * Allow the platform to store a pointers worth of data on us. diff --git a/accessible/ipc/moz.build b/accessible/ipc/moz.build index 9fa6ab68ab..3d417fea5e 100644 --- a/accessible/ipc/moz.build +++ b/accessible/ipc/moz.build @@ -26,6 +26,24 @@ if CONFIG['ACCESSIBILITY']: '../generic', ] + if CONFIG['MOZ_ENABLE_GTK']: + LOCAL_INCLUDES += [ + '/accessible/atk', + ] + elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': + LOCAL_INCLUDES += [ + '/accessible/windows/ia2', + '/accessible/windows/msaa', + ] + elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + LOCAL_INCLUDES += [ + '/accessible/mac', + ] + else: + LOCAL_INCLUDES += [ + '/accessible/other', + ] + FINAL_LIBRARY = 'xul' include('/ipc/chromium/chromium-config.mozbuild') diff --git a/accessible/mac/mozAccessible.mm b/accessible/mac/mozAccessible.mm index 70417810f2..d39b69e6fd 100644 --- a/accessible/mac/mozAccessible.mm +++ b/accessible/mac/mozAccessible.mm @@ -411,8 +411,8 @@ GetClosestInterestingAccessible(id anObject) "Does not support Text when it should"); #endif -#define ROLE(goannaRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \ - case roles::goannaRole: \ +#define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \ + case roles::geckoRole: \ return macRole; switch (mRole) { diff --git a/accessible/windows/ProxyWrappers.h b/accessible/windows/ProxyWrappers.h new file mode 100644 index 0000000000..42aa003451 --- /dev/null +++ b/accessible/windows/ProxyWrappers.h @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * + */ + +#ifndef MOZILLA_A11Y_ProxyWrappers_h +#define MOZILLA_A11Y_ProxyWrappers_h + +#include "HyperTextAccessible.h" + +namespace mozilla { +namespace a11y { + +class ProxyAccessibleWrap : public AccessibleWrap +{ + public: + ProxyAccessibleWrap(ProxyAccessible* aProxy) : + AccessibleWrap(nullptr, nullptr) + { + mType = eProxyType; + mBits.proxy = aProxy; + } + + virtual void Shutdown() override + { + mBits.proxy = nullptr; + } +}; + +class HyperTextProxyAccessibleWrap : public ProxyAccessibleWrap, + public ia2AccessibleEditableText, + public ia2AccessibleHypertext +{ + HyperTextProxyAccessibleWrap(ProxyAccessible* aProxy) : + ProxyAccessibleWrap(aProxy) {} +}; + +template +inline ProxyAccessible* +HyperTextProxyFor(T* aWrapper) +{ + static_assert(mozilla::IsBaseOf::value, "only IAccessible* should be passed in"); + auto wrapper = static_cast(aWrapper); + return wrapper->IsProxy() ? wrapper->Proxy() : nullptr; +} + +} +} + +#endif diff --git a/accessible/windows/ia2/ia2Accessible.cpp b/accessible/windows/ia2/ia2Accessible.cpp index 3b599fd9e6..fb372cd4c1 100644 --- a/accessible/windows/ia2/ia2Accessible.cpp +++ b/accessible/windows/ia2/ia2Accessible.cpp @@ -16,6 +16,7 @@ #include "IUnknownImpl.h" #include "nsCoreUtils.h" #include "nsIAccessibleTypes.h" +#include "mozilla/a11y/PDocAccessible.h" #include "Relation.h" #include "nsIPersistentProperties2.h" @@ -24,6 +25,8 @@ using namespace mozilla; using namespace mozilla::a11y; +template static void EscapeAttributeChars(String& aStr); + //////////////////////////////////////////////////////////////////////////////// // ia2Accessible //////////////////////////////////////////////////////////////////////////////// @@ -65,6 +68,15 @@ ia2Accessible::get_nRelations(long* aNRelations) if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; + if (acc->IsProxy()) { + // XXX evaluate performance of collecting all relation targets. + nsTArray types; + nsTArray> targetSets; + acc->Proxy()->Relations(&types, &targetSets); + *aNRelations = types.Length(); + return S_OK; + } + for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) { if (sRelationTypePairs[idx].second == IA2_RELATION_NULL) continue; @@ -84,7 +96,7 @@ ia2Accessible::get_relation(long aRelationIndex, { A11Y_TRYBLOCK_BEGIN - if (!aRelation) + if (!aRelation || aRelationIndex < 0) return E_INVALIDARG; *aRelation = nullptr; @@ -92,6 +104,34 @@ ia2Accessible::get_relation(long aRelationIndex, if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; + if (acc->IsProxy()) { + nsTArray types; + nsTArray> targetSets; + acc->Proxy()->Relations(&types, &targetSets); + + size_t targetSetCount = targetSets.Length(); + for (size_t i = 0; i < targetSetCount; i++) { + uint32_t relTypeIdx = static_cast(types[i]); + MOZ_ASSERT(sRelationTypePairs[relTypeIdx].first == types[i]); + if (sRelationTypePairs[relTypeIdx].second == IA2_RELATION_NULL) + continue; + + if (static_cast(aRelationIndex) == i) { + nsTArray> targets; + size_t targetCount = targetSets[i].Length(); + for (size_t j = 0; j < targetCount; j++) + targets.AppendElement(WrapperFor(targetSets[i][j])); + + nsRefPtr rel = + new ia2AccessibleRelation(types[i], Move(targets)); + rel.forget(aRelation); + return S_OK; + } + } + + return E_INVALIDARG; + } + long relIdx = 0; for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) { if (sRelationTypePairs[idx].second == IA2_RELATION_NULL) @@ -123,7 +163,7 @@ ia2Accessible::get_relations(long aMaxRelations, { A11Y_TRYBLOCK_BEGIN - if (!aRelation || !aNRelations) + if (!aRelation || !aNRelations || aMaxRelations <= 0) return E_INVALIDARG; *aNRelations = 0; @@ -131,6 +171,34 @@ ia2Accessible::get_relations(long aMaxRelations, if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; + if (acc->IsProxy()) { + nsTArray types; + nsTArray> targetSets; + acc->Proxy()->Relations(&types, &targetSets); + + size_t count = std::min(targetSets.Length(), + static_cast(aMaxRelations)); + size_t i = 0; + while (i < count) { + uint32_t relTypeIdx = static_cast(types[i]); + if (sRelationTypePairs[relTypeIdx].second == IA2_RELATION_NULL) + continue; + + size_t targetCount = targetSets[i].Length(); + nsTArray> targets(targetCount); + for (size_t j = 0; j < targetCount; j++) + targets.AppendElement(WrapperFor(targetSets[i][j])); + + nsRefPtr rel = + new ia2AccessibleRelation(types[i], Move(targets)); + rel.forget(aRelation + i); + i++; + } + + *aNRelations = i; + return S_OK; + } + for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs) && *aNRelations < aMaxRelations; idx++) { if (sRelationTypePairs[idx].second == IA2_RELATION_NULL) @@ -163,14 +231,18 @@ ia2Accessible::role(long* aRole) if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; -#define ROLE(_goannaRole, stringRole, atkRole, macRole, \ +#define ROLE(_geckoRole, stringRole, atkRole, macRole, \ msaaRole, ia2Role, nameRule) \ - case roles::_goannaRole: \ + case roles::_geckoRole: \ *aRole = ia2Role; \ break; - a11y::role goannaRole = acc->Role(); - switch (goannaRole) { + a11y::role geckoRole; + if (acc->IsProxy()) + geckoRole = acc->Proxy()->Role(); + else + geckoRole = acc->Role(); + switch (geckoRole) { #include "RoleMap.h" default: MOZ_CRASH("Unknown role."); @@ -180,10 +252,16 @@ ia2Accessible::role(long* aRole) // Special case, if there is a ROLE_ROW inside of a ROLE_TREE_TABLE, then call // the IA2 role a ROLE_OUTLINEITEM. - if (goannaRole == roles::ROW) { - Accessible* xpParent = acc->Parent(); - if (xpParent && xpParent->Role() == roles::TREE_TABLE) + if (acc->IsProxy()) { + if (geckoRole == roles::ROW && acc->Proxy()->Parent() && + acc->Proxy()->Parent()->Role() == roles::TREE_TABLE) *aRole = ROLE_SYSTEM_OUTLINEITEM; + } else { + if (geckoRole == roles::ROW) { + Accessible* xpParent = acc->Parent(); + if (xpParent && xpParent->Role() == roles::TREE_TABLE) + *aRole = ROLE_SYSTEM_OUTLINEITEM; + } } return S_OK; @@ -217,11 +295,11 @@ ia2Accessible::scrollToPoint(enum IA2CoordinateType aCoordType, if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; - uint32_t goannaCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? + uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE : nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; - acc->ScrollToPoint(goannaCoordType, aX, aY); + acc->ScrollToPoint(geckoCoordType, aX, aY); return S_OK; A11Y_TRYBLOCK_END @@ -274,7 +352,16 @@ ia2Accessible::get_states(AccessibleStates* aStates) // XXX: bug 344674 should come with better approach that we have here. AccessibleWrap* acc = static_cast(this); - uint64_t state = acc->State(); + if (acc->IsDefunct()) { + *aStates = IA2_STATE_DEFUNCT; + return CO_E_OBJNOTCONNECTED; + } + + uint64_t state; + if (acc->IsProxy()) + state = acc->Proxy()->State(); + else + state = acc->State(); if (state & states::INVALID) *aStates |= IA2_STATE_INVALID_ENTRY; @@ -446,7 +533,11 @@ ia2Accessible::get_indexInParent(long* aIndexInParent) if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; - *aIndexInParent = acc->IndexInParent(); + if (acc->IsProxy()) + *aIndexInParent = acc->Proxy()->IndexInParent(); + else + *aIndexInParent = acc->IndexInParent(); + if (*aIndexInParent == -1) return S_FALSE; @@ -521,8 +612,14 @@ ia2Accessible::get_attributes(BSTR* aAttributes) // The format is name:value;name:value; with \ for escaping these // characters ":;=,\". - nsCOMPtr attributes = acc->Attributes(); - return ConvertToIA2Attributes(attributes, aAttributes); + if (!acc->IsProxy()) { + nsCOMPtr attributes = acc->Attributes(); + return ConvertToIA2Attributes(attributes, aAttributes); + } + + nsTArray attrs; + acc->Proxy()->Attributes(&attrs); + return ConvertToIA2Attributes(&attrs, aAttributes); A11Y_TRYBLOCK_END } @@ -567,7 +664,7 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType, { A11Y_TRYBLOCK_BEGIN - if (!aTargets || !aNTargets) + if (!aTargets || !aNTargets || aMaxTargets < 0) return E_INVALIDARG; *aNTargets = 0; @@ -585,13 +682,23 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType, if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; - Relation rel = acc->RelationByType(*relationType); - nsTArray targets; - Accessible* target = nullptr; - while ((target = rel.Next()) && - static_cast(targets.Length()) <= aMaxTargets) - targets.AppendElement(target); + if (acc->IsProxy()) { + nsTArray targetProxies = + acc->Proxy()->RelationByType(*relationType); + + size_t targetCount = aMaxTargets; + if (targetProxies.Length() < targetCount) + targetCount = targetProxies.Length(); + for (size_t i = 0; i < targetCount; i++) + targets.AppendElement(WrapperFor(targetProxies[i])); + } else { + Relation rel = acc->RelationByType(*relationType); + Accessible* target = nullptr; + while ((target = rel.Next()) && + static_cast(targets.Length()) <= aMaxTargets) + targets.AppendElement(target); + } *aNTargets = targets.Length(); *aTargets = static_cast( @@ -613,6 +720,40 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType, //////////////////////////////////////////////////////////////////////////////// // Helpers +template +static inline void +EscapeAttributeChars(String& aStr) +{ + int32_t offset = 0; + static const char kCharsToEscape[] = ":;=,\\"; + while ((offset = aStr.FindCharInSet(kCharsToEscape, offset)) != kNotFound) { + aStr.Insert('\\', offset); + offset += 2; + } +} + +HRESULT +ia2Accessible::ConvertToIA2Attributes(nsTArray* aAttributes, + BSTR* aIA2Attributes) +{ + nsString attrStr; + size_t attrCount = aAttributes->Length(); + for (size_t i = 0; i < attrCount; i++) { + EscapeAttributeChars(aAttributes->ElementAt(i).Name()); + EscapeAttributeChars(aAttributes->ElementAt(i).Value()); + AppendUTF8toUTF16(aAttributes->ElementAt(i).Name(), attrStr); + attrStr.Append(':'); + attrStr.Append(aAttributes->ElementAt(i).Value()); + attrStr.Append(';'); + } + + if (attrStr.IsEmpty()) + return S_FALSE; + + *aIA2Attributes = ::SysAllocStringLen(attrStr.get(), attrStr.Length()); + return *aIA2Attributes ? S_OK : E_OUTOFMEMORY; +} + HRESULT ia2Accessible::ConvertToIA2Attributes(nsIPersistentProperties* aAttributes, BSTR* aIA2Attributes) @@ -632,8 +773,6 @@ ia2Accessible::ConvertToIA2Attributes(nsIPersistentProperties* aAttributes, nsAutoString strAttrs; - const char kCharsToEscape[] = ":;=,\\"; - bool hasMore = false; while (NS_SUCCEEDED(propEnum->HasMoreElements(&hasMore)) && hasMore) { nsCOMPtr propSupports; @@ -647,21 +786,13 @@ ia2Accessible::ConvertToIA2Attributes(nsIPersistentProperties* aAttributes, if (NS_FAILED(propElem->GetKey(name))) return E_FAIL; - int32_t offset = 0; - while ((offset = name.FindCharInSet(kCharsToEscape, offset)) != kNotFound) { - name.Insert('\\', offset); - offset += 2; - } + EscapeAttributeChars(name); nsAutoString value; if (NS_FAILED(propElem->GetValue(value))) return E_FAIL; - offset = 0; - while ((offset = value.FindCharInSet(kCharsToEscape, offset)) != kNotFound) { - value.Insert('\\', offset); - offset += 2; - } + EscapeAttributeChars(value); AppendUTF8toUTF16(name, strAttrs); strAttrs.Append(':'); diff --git a/accessible/windows/ia2/ia2Accessible.h b/accessible/windows/ia2/ia2Accessible.h index 7a14f960d8..0dba1b9537 100644 --- a/accessible/windows/ia2/ia2Accessible.h +++ b/accessible/windows/ia2/ia2Accessible.h @@ -13,6 +13,7 @@ namespace mozilla { namespace a11y { +class Attribute; class ia2Accessible : public IAccessible2_2 { @@ -106,6 +107,8 @@ public: // Helper method static HRESULT ConvertToIA2Attributes(nsIPersistentProperties* aAttributes, BSTR* aIA2Attributes); + static HRESULT ConvertToIA2Attributes(nsTArray* aAttributes, + BSTR* aIA2Attributes); }; } // namespace a11y diff --git a/accessible/windows/ia2/ia2AccessibleEditableText.cpp b/accessible/windows/ia2/ia2AccessibleEditableText.cpp index 668f6ff43f..4685a2df97 100644 --- a/accessible/windows/ia2/ia2AccessibleEditableText.cpp +++ b/accessible/windows/ia2/ia2AccessibleEditableText.cpp @@ -10,6 +10,7 @@ #include "AccessibleEditableText_i.c" #include "HyperTextAccessible-inl.h" #include "HyperTextAccessibleWrap.h" +#include "ProxyWrappers.h" #include "nsCOMPtr.h" #include "nsString.h" @@ -23,6 +24,10 @@ ia2AccessibleEditableText::copyText(long aStartOffset, long aEndOffset) { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->CopyText(aStartOffset, aEndOffset) ? S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -41,6 +46,10 @@ ia2AccessibleEditableText::deleteText(long aStartOffset, long aEndOffset) { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->DeleteText(aStartOffset, aEndOffset) ? S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -59,6 +68,12 @@ ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText) { A11Y_TRYBLOCK_BEGIN + uint32_t length = ::SysStringLen(*aText); + nsAutoString text(*aText, length); + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->InsertText(text, aOffset) ? S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -66,9 +81,6 @@ ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText) if (!textAcc->IsValidOffset(aOffset)) return E_INVALIDARG; - uint32_t length = ::SysStringLen(*aText); - nsAutoString text(*aText, length); - textAcc->InsertText(text, aOffset); return S_OK; @@ -80,6 +92,10 @@ ia2AccessibleEditableText::cutText(long aStartOffset, long aEndOffset) { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->CutText(aStartOffset, aEndOffset) ? S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -98,6 +114,10 @@ ia2AccessibleEditableText::pasteText(long aOffset) { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->PasteText(aOffset) ? S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; diff --git a/accessible/windows/ia2/ia2AccessibleImage.cpp b/accessible/windows/ia2/ia2AccessibleImage.cpp index 12da18b7ef..989fde9250 100644 --- a/accessible/windows/ia2/ia2AccessibleImage.cpp +++ b/accessible/windows/ia2/ia2AccessibleImage.cpp @@ -82,11 +82,11 @@ ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType, if (imageAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; - uint32_t goannaCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? + uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE : nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; - nsIntPoint pos = imageAcc->Position(goannaCoordType); + nsIntPoint pos = imageAcc->Position(geckoCoordType); *aX = pos.x; *aY = pos.y; return S_OK; diff --git a/accessible/windows/ia2/ia2AccessibleRelation.h b/accessible/windows/ia2/ia2AccessibleRelation.h index a2f13928c5..de169f12b1 100644 --- a/accessible/windows/ia2/ia2AccessibleRelation.h +++ b/accessible/windows/ia2/ia2AccessibleRelation.h @@ -24,6 +24,10 @@ class ia2AccessibleRelation final : public IAccessibleRelation public: ia2AccessibleRelation(RelationType aType, Relation* aRel); + ia2AccessibleRelation(RelationType aType, + nsTArray>&& aTargets) : + mType(aType), mTargets(Move(aTargets)) {} + // IUnknown DECL_IUNKNOWN diff --git a/accessible/windows/ia2/ia2AccessibleText.cpp b/accessible/windows/ia2/ia2AccessibleText.cpp index e44fb16d24..a171f6f3f8 100644 --- a/accessible/windows/ia2/ia2AccessibleText.cpp +++ b/accessible/windows/ia2/ia2AccessibleText.cpp @@ -12,6 +12,7 @@ #include "HyperTextAccessibleWrap.h" #include "HyperTextAccessible-inl.h" +#include "ProxyWrappers.h" using namespace mozilla::a11y; @@ -22,6 +23,11 @@ ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset) { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->AddToSelection(aStartOffset, aEndOffset) ? + S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -45,16 +51,23 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset, *aEndOffset = 0; *aTextAttributes = nullptr; - HyperTextAccessible* textAcc = static_cast(this); - if (textAcc->IsDefunct()) - return CO_E_OBJNOTCONNECTED; - int32_t startOffset = 0, endOffset = 0; - nsCOMPtr attributes = - textAcc->TextAttributes(true, aOffset, &startOffset, &endOffset); + HRESULT hr; + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + nsAutoTArray attrs; + proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset); + hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes); + } else { + HyperTextAccessible* textAcc = static_cast(this); + if (textAcc->IsDefunct()) + return CO_E_OBJNOTCONNECTED; + + nsCOMPtr attributes = + textAcc->TextAttributes(true, aOffset, &startOffset, &endOffset); + + hr = AccessibleWrap::ConvertToIA2Attributes(attributes, aTextAttributes); + } - HRESULT hr = AccessibleWrap::ConvertToIA2Attributes(attributes, - aTextAttributes); if (FAILED(hr)) return hr; @@ -76,11 +89,16 @@ ia2AccessibleText::get_caretOffset(long *aOffset) *aOffset = -1; - HyperTextAccessible* textAcc = static_cast(this); - if (textAcc->IsDefunct()) - return CO_E_OBJNOTCONNECTED; + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + *aOffset = proxy->CaretOffset(); + } else { + HyperTextAccessible* textAcc = static_cast(this); + if (textAcc->IsDefunct()) + return CO_E_OBJNOTCONNECTED; + + *aOffset = textAcc->CaretOffset(); + } - *aOffset = textAcc->CaretOffset(); return *aOffset != -1 ? S_OK : S_FALSE; A11Y_TRYBLOCK_END @@ -98,15 +116,19 @@ ia2AccessibleText::get_characterExtents(long aOffset, return E_INVALIDARG; *aX = *aY = *aWidth = *aHeight = 0; - HyperTextAccessible* textAcc = static_cast(this); - if (textAcc->IsDefunct()) - return CO_E_OBJNOTCONNECTED; - - uint32_t goannaCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? + uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE : nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; + nsIntRect rect; + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + rect = proxy->CharBounds(aOffset, geckoCoordType); + } else { + HyperTextAccessible* textAcc = static_cast(this); + if (textAcc->IsDefunct()) + return CO_E_OBJNOTCONNECTED; - nsIntRect rect = textAcc->CharBounds(aOffset, goannaCoordType); + rect = textAcc->CharBounds(aOffset, geckoCoordType); + } *aX = rect.x; *aY = rect.y; @@ -126,11 +148,16 @@ ia2AccessibleText::get_nSelections(long* aNSelections) return E_INVALIDARG; *aNSelections = 0; - HyperTextAccessible* textAcc = static_cast(this); - if (textAcc->IsDefunct()) - return CO_E_OBJNOTCONNECTED; + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + *aNSelections = proxy->SelectionCount(); + } else { + HyperTextAccessible* textAcc = static_cast(this); + if (textAcc->IsDefunct()) + return CO_E_OBJNOTCONNECTED; + + *aNSelections = textAcc->SelectionCount(); + } - *aNSelections = textAcc->SelectionCount(); return S_OK; A11Y_TRYBLOCK_END @@ -147,15 +174,20 @@ ia2AccessibleText::get_offsetAtPoint(long aX, long aY, return E_INVALIDARG; *aOffset = 0; - HyperTextAccessible* textAcc = static_cast(this); - if (textAcc->IsDefunct()) - return CO_E_OBJNOTCONNECTED; - - uint32_t goannaCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? + uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE : nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; - *aOffset = textAcc->OffsetAtPoint(aX, aY, goannaCoordType); + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + *aOffset = proxy->OffsetAtPoint(aX, aY, geckoCoordType); + } else { + HyperTextAccessible* textAcc = static_cast(this); + if (textAcc->IsDefunct()) + return CO_E_OBJNOTCONNECTED; + + *aOffset = textAcc->OffsetAtPoint(aX, aY, geckoCoordType); + } + return *aOffset == -1 ? S_FALSE : S_OK; A11Y_TRYBLOCK_END @@ -171,13 +203,20 @@ ia2AccessibleText::get_selection(long aSelectionIndex, long* aStartOffset, return E_INVALIDARG; *aStartOffset = *aEndOffset = 0; - HyperTextAccessible* textAcc = static_cast(this); - if (textAcc->IsDefunct()) - return CO_E_OBJNOTCONNECTED; - int32_t startOffset = 0, endOffset = 0; - if (!textAcc->SelectionBoundsAt(aSelectionIndex, &startOffset, &endOffset)) - return E_INVALIDARG; + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + nsString unused; + if (!proxy->SelectionBoundsAt(aSelectionIndex, unused, &startOffset, + &endOffset)) + return E_INVALIDARG; + } else { + HyperTextAccessible* textAcc = static_cast(this); + if (textAcc->IsDefunct()) + return CO_E_OBJNOTCONNECTED; + + if (!textAcc->SelectionBoundsAt(aSelectionIndex, &startOffset, &endOffset)) + return E_INVALIDARG; + } *aStartOffset = startOffset; *aEndOffset = endOffset; @@ -196,15 +235,22 @@ ia2AccessibleText::get_text(long aStartOffset, long aEndOffset, BSTR* aText) *aText = nullptr; - HyperTextAccessible* textAcc = static_cast(this); - if (textAcc->IsDefunct()) - return CO_E_OBJNOTCONNECTED; - - if (!textAcc->IsValidRange(aStartOffset, aEndOffset)) - return E_INVALIDARG; - nsAutoString text; - textAcc->TextSubstring(aStartOffset, aEndOffset, text); + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + if (!proxy->TextSubstring(aStartOffset, aEndOffset, text)) { + return E_INVALIDARG; + } + } else { + HyperTextAccessible* textAcc = static_cast(this); + if (textAcc->IsDefunct()) + return CO_E_OBJNOTCONNECTED; + + if (!textAcc->IsValidRange(aStartOffset, aEndOffset)) + return E_INVALIDARG; + + textAcc->TextSubstring(aStartOffset, aEndOffset, text); + } + if (text.IsEmpty()) return S_FALSE; @@ -361,6 +407,10 @@ ia2AccessibleText::removeSelection(long aSelectionIndex) { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->RemoveFromSelection(aSelectionIndex) ? S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -376,6 +426,10 @@ ia2AccessibleText::setCaretOffset(long aOffset) { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->SetCaretOffset(aOffset) ? S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -395,6 +449,11 @@ ia2AccessibleText::setSelection(long aSelectionIndex, long aStartOffset, { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + return proxy->SetSelectionBoundsAt(aSelectionIndex, aStartOffset, + aEndOffset) ? S_OK : E_INVALIDARG; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -414,6 +473,11 @@ ia2AccessibleText::get_nCharacters(long* aNCharacters) return E_INVALIDARG; *aNCharacters = 0; + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + *aNCharacters = proxy->CharacterCount(); + return S_OK; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -430,6 +494,11 @@ ia2AccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex, { A11Y_TRYBLOCK_BEGIN + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + proxy->ScrollSubstringTo(aStartIndex, aEndIndex, aScrollType); + return S_OK; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -450,6 +519,16 @@ ia2AccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex, { A11Y_TRYBLOCK_BEGIN + uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? + nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE : + nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; + + if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { + proxy->ScrollSubstringToPoint(aStartIndex, aEndIndex, geckoCoordType, aX, + aY); + return S_OK; + } + HyperTextAccessible* textAcc = static_cast(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -457,12 +536,8 @@ ia2AccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex, if (!textAcc->IsValidRange(aStartIndex, aEndIndex)) return E_INVALIDARG; - uint32_t goannaCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? - nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE : - nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; - textAcc->ScrollSubstringToPoint(aStartIndex, aEndIndex, - goannaCoordType, aX, aY); + geckoCoordType, aX, aY); return S_OK; A11Y_TRYBLOCK_END diff --git a/accessible/windows/ia2/moz.build b/accessible/windows/ia2/moz.build index 02faea6fec..7c593cf85f 100644 --- a/accessible/windows/ia2/moz.build +++ b/accessible/windows/ia2/moz.build @@ -39,6 +39,7 @@ LOCAL_INCLUDES += [ '/accessible/base', '/accessible/generic', '/accessible/html', + '/accessible/windows', '/accessible/windows/msaa', '/accessible/xpcom', '/accessible/xul', @@ -52,3 +53,5 @@ if CONFIG['OS_ARCH'] == 'WINNT': DEFINES['NOMINMAX'] = True FAIL_ON_WARNINGS = True + +include('/ipc/chromium/chromium-config.mozbuild') diff --git a/accessible/windows/msaa/AccessibleWrap.cpp b/accessible/windows/msaa/AccessibleWrap.cpp index d6934663a0..e332d4b063 100644 --- a/accessible/windows/msaa/AccessibleWrap.cpp +++ b/accessible/windows/msaa/AccessibleWrap.cpp @@ -398,27 +398,27 @@ AccessibleWrap::get_accRole( if (xpAccessible->IsDefunct()) return CO_E_OBJNOTCONNECTED; - a11y::role goannaRole; + a11y::role geckoRole; if (xpAccessible->IsProxy()) { - goannaRole = xpAccessible->Proxy()->Role(); + geckoRole = xpAccessible->Proxy()->Role(); } else { #ifdef DEBUG NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(xpAccessible), "Does not support Text when it should"); #endif - goannaRole = xpAccessible->Role(); + geckoRole = xpAccessible->Role(); } uint32_t msaaRole = 0; -#define ROLE(_goannaRole, stringRole, atkRole, macRole, \ +#define ROLE(_geckoRole, stringRole, atkRole, macRole, \ _msaaRole, ia2Role, nameRule) \ - case roles::_goannaRole: \ + case roles::_geckoRole: \ msaaRole = _msaaRole; \ break; - switch (goannaRole) { + switch (geckoRole) { #include "RoleMap.h" default: MOZ_CRASH("Unknown role."); @@ -430,11 +430,11 @@ AccessibleWrap::get_accRole( // a ROLE_OUTLINEITEM for consistency and compatibility. // We need this because ARIA has a role of "row" for both grid and treegrid if (xpAccessible->IsProxy()) { - if (goannaRole == roles::ROW + if (geckoRole == roles::ROW && xpAccessible->Proxy()->Parent()->Role() == roles::TREE_TABLE) msaaRole = ROLE_SYSTEM_OUTLINEITEM; } else { - if (goannaRole == roles::ROW) { + if (geckoRole == roles::ROW) { Accessible* xpParent = Parent(); if (xpParent && xpParent->Role() == roles::TREE_TABLE) msaaRole = ROLE_SYSTEM_OUTLINEITEM; diff --git a/accessible/windows/msaa/Platform.cpp b/accessible/windows/msaa/Platform.cpp index 9e7e6cf6a3..30f8a4dcee 100644 --- a/accessible/windows/msaa/Platform.cpp +++ b/accessible/windows/msaa/Platform.cpp @@ -11,6 +11,7 @@ #include "HyperTextAccessibleWrap.h" #include "nsWinUtils.h" #include "mozilla/a11y/ProxyAccessible.h" +#include "ProxyWrappers.h" #include "mozilla/ClearOnShutdown.h" @@ -35,22 +36,6 @@ a11y::PlatformShutdown() nsWinUtils::ShutdownWindowEmulation(); } -class ProxyAccessibleWrap : public AccessibleWrap -{ - public: - ProxyAccessibleWrap(ProxyAccessible* aProxy) : - AccessibleWrap(nullptr, nullptr) - { - mType = eProxyType; - mBits.proxy = aProxy; - } - - virtual void Shutdown() override - { - mBits.proxy = nullptr; - } -}; - void a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t) { diff --git a/accessible/windows/msaa/moz.build b/accessible/windows/msaa/moz.build index dc88de688b..804f2b4c2f 100644 --- a/accessible/windows/msaa/moz.build +++ b/accessible/windows/msaa/moz.build @@ -48,6 +48,7 @@ LOCAL_INCLUDES += [ '/accessible/base', '/accessible/generic', '/accessible/html', + '/accessible/windows', '/accessible/windows/ia2', '/accessible/windows/sdn', '/accessible/windows/uia', diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 13917eea27..da3549cb10 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -5716,20 +5716,13 @@ var IndexedDBPromptHelper = { var requestor = subject.QueryInterface(Ci.nsIInterfaceRequestor); - var contentWindow = requestor.getInterface(Ci.nsIDOMWindow); - var contentDocument = contentWindow.document; - var browserWindow = - OfflineApps._getBrowserWindowForContentWindow(contentWindow); - - if (browserWindow != window) { - // Must belong to some other window. + var browser = requestor.getInterface(Ci.nsIDOMNode); + if (browser.ownerDocument.defaultView != window) { + // Only listen for notifications for browsers in our chrome window. return; } - var browser = - OfflineApps._getBrowserForContentWindow(browserWindow, contentWindow); - - var host = contentDocument.documentURIObject.asciiHost; + var host = browser.currentURI.asciiHost; var message; var responseTopic; diff --git a/caps/DomainPolicy.h b/caps/DomainPolicy.h index fcd31f2784..321771b968 100644 --- a/caps/DomainPolicy.h +++ b/caps/DomainPolicy.h @@ -13,10 +13,6 @@ namespace mozilla { -namespace dom { -class nsIContentParent; -}; - namespace ipc { class URIParams; } // namespace ipc diff --git a/caps/nsJSPrincipals.h b/caps/nsJSPrincipals.h index 5b63574cf4..e53972ff76 100644 --- a/caps/nsJSPrincipals.h +++ b/caps/nsJSPrincipals.h @@ -9,8 +9,6 @@ #include "jsapi.h" #include "nsIPrincipal.h" -class nsCString; - struct nsJSPrincipals : nsIPrincipal, JSPrincipals { static bool Subsume(JSPrincipals *jsprin, JSPrincipals *other); diff --git a/caps/nsPrincipal.h b/caps/nsPrincipal.h index 24f9631c38..7ef0d8836c 100644 --- a/caps/nsPrincipal.h +++ b/caps/nsPrincipal.h @@ -15,9 +15,6 @@ #include "nsNetUtil.h" #include "nsScriptSecurityManager.h" -class nsIObjectInputStream; -class nsIObjectOutputStream; - class nsBasePrincipal : public nsJSPrincipals { public: diff --git a/caps/nsScriptSecurityManager.h b/caps/nsScriptSecurityManager.h index da9b3a2990..6af83712ee 100644 --- a/caps/nsScriptSecurityManager.h +++ b/caps/nsScriptSecurityManager.h @@ -17,13 +17,10 @@ #include -class nsIDocShell; class nsCString; -class nsIClassInfo; class nsIIOService; class nsIStringBundle; class nsSystemPrincipal; -class ClassInfoData; ///////////////////////////// // nsScriptSecurityManager // diff --git a/dom/base/DirectionalityUtils.h b/dom/base/DirectionalityUtils.h index 4b1758c180..6125191f7a 100644 --- a/dom/base/DirectionalityUtils.h +++ b/dom/base/DirectionalityUtils.h @@ -10,8 +10,6 @@ #include "nscore.h" class nsIContent; -class nsIDocument; -class nsINode; class nsAString; class nsAttrValue; class nsTextNode; diff --git a/dom/base/Element.h b/dom/base/Element.h index c801b841f1..a19e79b536 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -37,16 +37,11 @@ #include "mozilla/dom/ElementBinding.h" #include "Units.h" -class nsIDOMEventListener; class nsIFrame; class nsIDOMMozNamedAttrMap; -class nsIDOMCSSStyleDeclaration; class nsIURI; -class nsIControllers; -class nsEventChainVisitor; class nsIScrollableFrame; class nsAttrValueOrString; -class ContentUnbinder; class nsContentList; class nsDOMSettableTokenList; class nsDOMTokenList; diff --git a/dom/base/File.h b/dom/base/File.h index 1859f8ff21..88a9bd093e 100644 --- a/dom/base/File.h +++ b/dom/base/File.h @@ -29,10 +29,8 @@ #include "nsWrapperCache.h" #include "nsWeakReference.h" -class nsDOMMultipartFile; class nsIFile; class nsIInputStream; -class nsIClassInfo; #define FILEIMPL_IID \ { 0xbccb3275, 0x6778, 0x4ac5, \ diff --git a/dom/base/ImportManager.h b/dom/base/ImportManager.h index 8d1aa77c34..85e470e070 100644 --- a/dom/base/ImportManager.h +++ b/dom/base/ImportManager.h @@ -49,7 +49,6 @@ #include "nsURIHashKey.h" class nsIDocument; -class nsIChannel; class nsIPrincipal; class nsINode; class AutoError; diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h index 2217f62ea3..6824413517 100644 --- a/dom/base/ShadowRoot.h +++ b/dom/base/ShadowRoot.h @@ -15,10 +15,7 @@ class nsIAtom; class nsIContent; -class nsIDocument; -class nsPIDOMWindow; class nsXBLPrototypeBinding; -class nsTagNameMapEntry; namespace mozilla { namespace dom { diff --git a/dom/base/ThirdPartyUtil.h b/dom/base/ThirdPartyUtil.h index f0018693d4..c6c2979958 100644 --- a/dom/base/ThirdPartyUtil.h +++ b/dom/base/ThirdPartyUtil.h @@ -12,8 +12,6 @@ #include "mozilla/Attributes.h" class nsIURI; -class nsIChannel; -class nsIDOMWindow; class ThirdPartyUtil final : public mozIThirdPartyUtil { diff --git a/dom/base/URL.h b/dom/base/URL.h index bd160abff4..a502acba31 100644 --- a/dom/base/URL.h +++ b/dom/base/URL.h @@ -11,8 +11,6 @@ #include "nsAutoPtr.h" #include "nsString.h" -class nsIDOMBlob; -class nsIPrincipal; class nsISupports; class nsIURI; diff --git a/dom/base/WebSocket.h b/dom/base/WebSocket.h index 714f773800..de5c87ac4c 100644 --- a/dom/base/WebSocket.h +++ b/dom/base/WebSocket.h @@ -28,10 +28,6 @@ class nsIInputStream; namespace mozilla { namespace dom { -namespace workers { -class WorkerPrivate; -} - class File; class WebSocketImpl; diff --git a/dom/base/nsContentAreaDragDrop.h b/dom/base/nsContentAreaDragDrop.h index 98e6788ed1..6cfb259ca1 100644 --- a/dom/base/nsContentAreaDragDrop.h +++ b/dom/base/nsContentAreaDragDrop.h @@ -12,15 +12,11 @@ #include "nsIDOMEventListener.h" #include "nsITransferable.h" -class nsIDOMNode; class nsPIDOMWindow; -class nsIDOMDragEvent; class nsISelection; class nsITransferable; class nsIContent; -class nsIURI; class nsIFile; -class nsISimpleEnumerator; namespace mozilla { namespace dom { diff --git a/dom/base/nsContentCreatorFunctions.h b/dom/base/nsContentCreatorFunctions.h index e65c3c631d..272503ea2e 100644 --- a/dom/base/nsContentCreatorFunctions.h +++ b/dom/base/nsContentCreatorFunctions.h @@ -15,10 +15,8 @@ * (mozilla/content and mozilla/layout). */ -class nsAString; class nsIContent; class imgRequestProxy; -class nsNodeInfoManager; class nsGenericHTMLElement; namespace mozilla { diff --git a/dom/base/nsContentSink.h b/dom/base/nsContentSink.h index 8ffa209241..d56b174288 100644 --- a/dom/base/nsContentSink.h +++ b/dom/base/nsContentSink.h @@ -31,11 +31,9 @@ class nsIDocument; class nsIURI; class nsIChannel; class nsIDocShell; -class nsIParser; class nsIAtom; class nsIChannel; class nsIContent; -class nsViewManager; class nsNodeInfoManager; class nsScriptLoader; class nsIApplicationCache; diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index cdf395fa35..98c2d6c172 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -51,18 +51,14 @@ class nsIConsoleService; class nsIContent; class nsIContentPolicy; class nsIContentSecurityPolicy; -class nsIDocShell; class nsIDocument; class nsIDocumentLoaderFactory; -class nsIDocumentObserver; class nsIDOMDocument; class nsIDOMDocumentFragment; class nsIDOMEvent; -class nsIDOMHTMLFormElement; class nsIDOMHTMLInputElement; class nsIDOMKeyEvent; class nsIDOMNode; -class nsIDOMScriptObjectFactory; class nsIDOMWindow; class nsIDragSession; class nsIEditor; @@ -71,7 +67,6 @@ class nsIFrame; class nsIImageLoadingContent; class nsIInterfaceRequestor; class nsIIOService; -class nsIJSRuntimeService; class nsILineBreaker; class nsIMessageBroadcaster; class nsNameSpaceManager; @@ -83,7 +78,6 @@ class nsIPrincipal; class nsIRequest; class nsIRunnable; class nsIScriptContext; -class nsIScriptGlobalObject; class nsIScriptSecurityManager; class nsIStringBundle; class nsIStringBundleService; @@ -96,7 +90,6 @@ class nsIXPConnect; class nsNodeInfoManager; class nsPIDOMWindow; class nsPresContext; -class nsScriptObjectTracer; class nsStringBuffer; class nsStringHashKey; class nsTextFragment; diff --git a/dom/base/nsDOMClassInfo.h b/dom/base/nsDOMClassInfo.h index f1c6a6cd7f..c9d54237cc 100644 --- a/dom/base/nsDOMClassInfo.h +++ b/dom/base/nsDOMClassInfo.h @@ -18,11 +18,8 @@ #undef GetClassName #endif -class nsContentList; -class nsDocument; struct nsGlobalNameStruct; class nsGlobalWindow; -class nsIScriptSecurityManager; struct nsDOMClassInfoData; diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h index 2ea1f64f12..4a8a8b80a3 100644 --- a/dom/base/nsDocument.h +++ b/dom/base/nsDocument.h @@ -76,17 +76,12 @@ class nsDOMStyleSheetSetList; -class nsIOutputStream; class nsDocument; -class nsIDTD; class nsIRadioVisitor; class nsIFormControl; struct nsRadioGroupStruct; class nsOnloadBlocker; class nsUnblockOnloadEvent; -class nsChildContentList; -class nsHTMLStyleSheet; -class nsHTMLCSSStyleSheet; class nsDOMNavigationTiming; class nsWindowSizes; class nsHtml5TreeOpExecutor; diff --git a/dom/base/nsFrameLoader.h b/dom/base/nsFrameLoader.h index 1a3d8415cd..8cb86da402 100644 --- a/dom/base/nsFrameLoader.h +++ b/dom/base/nsFrameLoader.h @@ -51,9 +51,6 @@ class RenderFrameParent; #if defined(MOZ_WIDGET_GTK) typedef struct _GtkWidget GtkWidget; #endif -#ifdef MOZ_WIDGET_QT -class QX11EmbedContainer; -#endif class nsFrameLoader final : public nsIFrameLoader, public nsStubMutationObserver, diff --git a/dom/base/nsFrameMessageManager.h b/dom/base/nsFrameMessageManager.h index d25a8eddbf..e58b63dbfa 100644 --- a/dom/base/nsFrameMessageManager.h +++ b/dom/base/nsFrameMessageManager.h @@ -124,8 +124,6 @@ StructuredCloneData UnpackClonedMessageDataForChild(const ClonedMessageData& aDa } // namespace dom } // namespace mozilla -class nsAXPCNativeCallContext; - struct nsMessageListenerInfo { bool operator==(const nsMessageListenerInfo& aOther) const diff --git a/dom/base/nsGenericDOMDataNode.h b/dom/base/nsGenericDOMDataNode.h index e46944267c..d22b8db960 100644 --- a/dom/base/nsGenericDOMDataNode.h +++ b/dom/base/nsGenericDOMDataNode.h @@ -23,12 +23,7 @@ #include "mozilla/dom/ShadowRoot.h" class nsIDocument; -class nsIDOMAttr; -class nsIDOMEventListener; -class nsIDOMNodeList; -class nsIFrame; class nsIDOMText; -class nsURI; #define DATA_NODE_FLAG_BIT(n_) NODE_FLAG_BIT(NODE_TYPE_SPECIFIC_BITS_OFFSET + (n_)) diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 51fad6df14..60ac1d740f 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -51,6 +51,7 @@ #include "mozilla/dom/WindowBinding.h" #include "Units.h" #include "nsComponentManagerUtils.h" +#include "nsSize.h" #define DEFAULT_HOME_PAGE "www.mozilla.org" #define PREF_BROWSER_STARTUP_HOMEPAGE "browser.startup.homepage" @@ -90,7 +91,6 @@ class nsGlobalWindowObserver; class nsGlobalWindow; class nsDOMWindowUtils; class nsIIdleService; -struct nsIntSize; struct nsRect; class nsWindowSizes; diff --git a/dom/base/nsHostObjectProtocolHandler.h b/dom/base/nsHostObjectProtocolHandler.h index e2f3f2e19c..dc2c08fa59 100644 --- a/dom/base/nsHostObjectProtocolHandler.h +++ b/dom/base/nsHostObjectProtocolHandler.h @@ -17,7 +17,6 @@ #define FONTTABLEURI_SCHEME "moz-fonttable" #define RTSPURI_SCHEME "rtsp" -class nsIDOMBlob; class nsIPrincipal; namespace mozilla { diff --git a/dom/base/nsIAttribute.h b/dom/base/nsIAttribute.h index ac5cfcadbc..1e5e53fd61 100644 --- a/dom/base/nsIAttribute.h +++ b/dom/base/nsIAttribute.h @@ -9,7 +9,6 @@ #include "nsINode.h" class nsDOMAttributeMap; -class nsIContent; #define NS_IATTRIBUTE_IID \ { 0x233a9c4d, 0xb27f, 0x4662, \ diff --git a/dom/base/nsIDOMScriptObjectFactory.h b/dom/base/nsIDOMScriptObjectFactory.h index 03f20f3c39..271ec8e843 100644 --- a/dom/base/nsIDOMScriptObjectFactory.h +++ b/dom/base/nsIDOMScriptObjectFactory.h @@ -14,10 +14,6 @@ { 0x2a50e17c, 0x46ff, 0x4150, \ { 0xbb, 0x46, 0xd8, 0x07, 0xb3, 0x36, 0xde, 0xab } } -class nsIScriptContext; -class nsIScriptGlobalObject; -class nsIDOMEventListener; - typedef nsXPCClassInfo* (*nsDOMClassInfoExternalConstructorFnc) (const char* aName); diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index 0f0c59b987..11ad3981f4 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -51,7 +51,6 @@ class nsIDocShell; class nsIDocumentEncoder; class nsIDocumentObserver; class nsIDOMDocument; -class nsIDOMDocumentFragment; class nsIDOMDocumentType; class nsIDOMElement; class nsIDOMNodeFilter; @@ -121,7 +120,6 @@ class EventTarget; class FontFaceSet; class FrameRequestCallback; class ImportManager; -class OverfillCallback; class HTMLBodyElement; struct LifecycleCallbackArgs; class Link; diff --git a/dom/base/nsIDocumentObserver.h b/dom/base/nsIDocumentObserver.h index ebdf806c30..71df26d541 100644 --- a/dom/base/nsIDocumentObserver.h +++ b/dom/base/nsIDocumentObserver.h @@ -9,11 +9,9 @@ #include "nsISupports.h" #include "nsIMutationObserver.h" -class nsIAtom; class nsIContent; class nsIStyleSheet; class nsIStyleRule; -class nsString; class nsIDocument; #define NS_IDOCUMENT_OBSERVER_IID \ diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index 19911744e2..596d820de6 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -47,7 +47,6 @@ class nsIPrincipal; class nsIURI; class nsNodeSupportsWeakRefTearoff; class nsNodeWeakReference; -class nsXPCClassInfo; class nsDOMMutationObserver; namespace mozilla { @@ -72,7 +71,6 @@ class DOMQuad; class DOMRectReadOnly; class Element; class EventHandlerNonNull; -class OnErrorEventHandlerNonNull; template class Optional; class OwningNodeOrString; template class Sequence; diff --git a/dom/base/nsIScriptContext.h b/dom/base/nsIScriptContext.h index a94acc2af0..4c39dbf1bd 100644 --- a/dom/base/nsIScriptContext.h +++ b/dom/base/nsIScriptContext.h @@ -15,16 +15,6 @@ #include "js/GCAPI.h" class nsIScriptGlobalObject; -class nsIScriptSecurityManager; -class nsIPrincipal; -class nsIAtom; -class nsIArray; -class nsIVariant; -class nsIObjectInputStream; -class nsIObjectOutputStream; -class nsIScriptObjectPrincipal; -class nsIDOMWindow; -class nsIURI; #define NS_ISCRIPTCONTEXT_IID \ { 0x901f0d5e, 0x217a, 0x45fa, \ diff --git a/dom/base/nsImageLoadingContent.h b/dom/base/nsImageLoadingContent.h index 993cc5e171..7f0471c70b 100644 --- a/dom/base/nsImageLoadingContent.h +++ b/dom/base/nsImageLoadingContent.h @@ -27,8 +27,6 @@ class nsIURI; class nsIDocument; -class imgILoader; -class nsIIOService; class nsPresContext; class nsIContent; class imgRequestProxy; diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h index 7447f8dc4f..e87192a523 100644 --- a/dom/base/nsJSEnvironment.h +++ b/dom/base/nsJSEnvironment.h @@ -19,9 +19,7 @@ #include "xpcpublic.h" class nsICycleCollectorListener; -class nsIXPConnectJSObjectHolder; class nsScriptNameSpaceManager; -class nsCycleCollectionNoteRootCallback; namespace JS { class AutoValueVector; @@ -173,8 +171,6 @@ private: static bool DOMOperationCallback(JSContext *cx); }; -class nsIJSRuntimeService; -class nsIPrincipal; class nsPIDOMWindow; namespace mozilla { diff --git a/dom/base/nsMappedAttributes.h b/dom/base/nsMappedAttributes.h index e3a6d6bf8a..6d5a1d5b1d 100644 --- a/dom/base/nsMappedAttributes.h +++ b/dom/base/nsMappedAttributes.h @@ -19,7 +19,6 @@ class nsIAtom; class nsHTMLStyleSheet; -class nsRuleWalker; class nsMappedAttributes final : public nsIStyleRule { diff --git a/dom/base/nsNameSpaceManager.h b/dom/base/nsNameSpaceManager.h index 0d8428f0a4..566fc441bb 100644 --- a/dom/base/nsNameSpaceManager.h +++ b/dom/base/nsNameSpaceManager.h @@ -11,7 +11,6 @@ #include "mozilla/StaticPtr.h" -class nsIAtom; class nsAString; class nsNameSpaceKey : public PLDHashEntryHdr diff --git a/dom/base/nsNodeUtils.h b/dom/base/nsNodeUtils.h index a845e98038..91433b37ae 100644 --- a/dom/base/nsNodeUtils.h +++ b/dom/base/nsNodeUtils.h @@ -12,8 +12,6 @@ #include "nsCOMArray.h" struct CharacterDataChangeInfo; -class nsIVariant; -class nsIDOMNode; template class nsCOMArray; class nsCycleCollectionTraversalCallback; namespace mozilla { diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 0764f2836b..d5b4f56800 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -26,7 +26,6 @@ class nsIDocShell; class nsIDocShellLoadInfo; class nsIDocument; class nsIIdleObserver; -class nsIPrincipal; class nsIScriptTimeoutHandler; class nsIURI; class nsPerformance; diff --git a/dom/base/nsReferencedElement.h b/dom/base/nsReferencedElement.h index 733debce83..9e1d122317 100644 --- a/dom/base/nsReferencedElement.h +++ b/dom/base/nsReferencedElement.h @@ -15,7 +15,6 @@ #include "nsAutoPtr.h" class nsIURI; -class nsCycleCollectionCallback; /** * Class to track what element is referenced by a given ID. diff --git a/dom/base/nsScriptNameSpaceManager.h b/dom/base/nsScriptNameSpaceManager.h index b59f4849b3..a1a93178f0 100644 --- a/dom/base/nsScriptNameSpaceManager.h +++ b/dom/base/nsScriptNameSpaceManager.h @@ -79,11 +79,7 @@ struct nsGlobalNameStruct mozilla::dom::ConstructorEnabled* mConstructorEnabled; }; - -class nsIScriptContext; class nsICategoryManager; -class GlobalNameMapEntry; - class nsScriptNameSpaceManager : public nsIObserver, public nsSupportsWeakReference, diff --git a/dom/base/nsTextFragment.h b/dom/base/nsTextFragment.h index bfb2098048..7c1e0e33a6 100644 --- a/dom/base/nsTextFragment.h +++ b/dom/base/nsTextFragment.h @@ -19,7 +19,6 @@ #include "nsISupportsImpl.h" class nsString; -class nsCString; // XXX should this normalize the code to keep a \u0000 at the end? diff --git a/dom/base/nsWindowRoot.h b/dom/base/nsWindowRoot.h index 58488df307..77742e8da7 100644 --- a/dom/base/nsWindowRoot.h +++ b/dom/base/nsWindowRoot.h @@ -8,15 +8,9 @@ #define nsWindowRoot_h__ class nsPIDOMWindow; -class nsIDOMEventListener; class nsIDOMEvent; class nsIGlobalObject; -namespace mozilla { -class EventChainPostVisitor; -class EventChainPreVisitor; -} // namespace mozilla - #include "mozilla/Attributes.h" #include "mozilla/EventListenerManager.h" #include "nsIDOMEventTarget.h" diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h index ac6dfa0e27..e4606fef31 100644 --- a/dom/base/nsWrapperCache.h +++ b/dom/base/nsWrapperCache.h @@ -23,7 +23,6 @@ class ProcessGlobal; class SandboxPrivate; class nsInProcessTabChildGlobal; class nsWindowRoot; -class XPCWrappedNativeScope; #define NS_WRAPPERCACHE_IID \ { 0x6f3179a1, 0x36f7, 0x4a5c, \ diff --git a/dom/base/nsXMLContentSerializer.h b/dom/base/nsXMLContentSerializer.h index 7f14baff1f..56ff11ae76 100644 --- a/dom/base/nsXMLContentSerializer.h +++ b/dom/base/nsXMLContentSerializer.h @@ -23,7 +23,6 @@ #define kEndTag NS_LITERAL_STRING(" channel(do_QueryInterface(mChannel)); + if (!channel) { + return; + } + channel->SetNetworkInterfaceId(mNetworkInterfaceId); +} + /* * "Copy" from a stream. */ @@ -2656,6 +2669,8 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) { NS_ENSURE_TRUE(mPrincipal, NS_ERROR_NOT_INITIALIZED); + PopulateNetworkInterfaceId(); + nsresult rv = CheckInnerWindowCorrectness(); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/base/nsXMLHttpRequest.h b/dom/base/nsXMLHttpRequest.h index 3ba6dc7cc3..bc79e37211 100644 --- a/dom/base/nsXMLHttpRequest.h +++ b/dom/base/nsXMLHttpRequest.h @@ -428,6 +428,11 @@ private: bool IsDeniedCrossSiteRequest(); + // Tell our channel what network interface ID we were told to use. + // If it's an HTTP channel and we were told to use a non-default + // interface ID. + void PopulateNetworkInterfaceId(); + public: void Send(JSContext* /*aCx*/, ErrorResult& aRv) { @@ -538,6 +543,16 @@ public: return mChannel; } + void GetNetworkInterfaceId(nsACString& aId) const + { + aId = mNetworkInterfaceId; + } + + void SetNetworkInterfaceId(const nsACString& aId) + { + mNetworkInterfaceId = aId; + } + // We need a GetInterface callable from JS for chrome JS void GetInterface(JSContext* aCx, nsIJSID* aIID, JS::MutableHandle aRetval, ErrorResult& aRv); @@ -765,6 +780,10 @@ protected: bool mIsSystem; bool mIsAnon; + // A platform-specific identifer to represent the network interface + // that this request is associated with. + nsCString mNetworkInterfaceId; + /** * Close the XMLHttpRequest's channels and dispatch appropriate progress * events. diff --git a/dom/battery/BatteryManager.h b/dom/battery/BatteryManager.h index 8fdcc58279..5eb418aa1e 100644 --- a/dom/battery/BatteryManager.h +++ b/dom/battery/BatteryManager.h @@ -12,7 +12,6 @@ #include "nsCycleCollectionParticipant.h" class nsPIDOMWindow; -class nsIScriptContext; namespace mozilla { diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 28205affaa..2a516638af 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -1261,15 +1261,6 @@ DOMInterfaces = { 'wrapperCache': False, }], -'VRFieldOfView': { - 'wrapperCache': False, -}, - -'VRFieldOfViewReadOnly': { - 'concrete': False, - 'wrapperCache': False, -}, - 'VRDevice': { 'concrete': False }, diff --git a/dom/bindings/test/TestCImplementedInterface.h b/dom/bindings/test/TestCImplementedInterface.h index feb3b4e0e5..4b915ad86f 100644 --- a/dom/bindings/test/TestCImplementedInterface.h +++ b/dom/bindings/test/TestCImplementedInterface.h @@ -9,8 +9,6 @@ #include "../TestJSImplGenBinding.h" -class nsPIDOMWindow; - namespace mozilla { namespace dom { diff --git a/dom/bluetooth/BluetoothDevice.h b/dom/bluetooth/BluetoothDevice.h index 19a35fee85..afbd90313e 100644 --- a/dom/bluetooth/BluetoothDevice.h +++ b/dom/bluetooth/BluetoothDevice.h @@ -18,7 +18,6 @@ BEGIN_BLUETOOTH_NAMESPACE class BluetoothNamedValue; class BluetoothValue; class BluetoothSignal; -class BluetoothSocket; class BluetoothDevice : public DOMEventTargetHelper , public BluetoothSignalObserver diff --git a/dom/bluetooth/BluetoothPropertyContainer.h b/dom/bluetooth/BluetoothPropertyContainer.h index ce8670fdaf..655eb74d2f 100644 --- a/dom/bluetooth/BluetoothPropertyContainer.h +++ b/dom/bluetooth/BluetoothPropertyContainer.h @@ -10,7 +10,6 @@ #include "BluetoothCommon.h" #include "BluetoothReplyRunnable.h" -class nsIDOMDOMRequest; class nsPIDOMWindow; namespace mozilla { diff --git a/dom/bluetooth/BluetoothService.h b/dom/bluetooth/BluetoothService.h index f7a92109c7..288d5ab16f 100644 --- a/dom/bluetooth/BluetoothService.h +++ b/dom/bluetooth/BluetoothService.h @@ -30,7 +30,6 @@ class UnixSocketConsumer; BEGIN_BLUETOOTH_NAMESPACE -class BluetoothManager; class BluetoothNamedValue; class BluetoothReplyRunnable; class BluetoothSignal; diff --git a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h index 21a1543e2e..7ffd6f9bcb 100644 --- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h +++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.h @@ -15,8 +15,6 @@ BEGIN_BLUETOOTH_NAMESPACE using namespace mozilla::ipc; -class BlutoothDaemonInterface; - class BluetoothDaemonSocketModule { public: diff --git a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h index 2ffdcd1142..e2f80b7edc 100644 --- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h +++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.h @@ -17,7 +17,6 @@ BEGIN_BLUETOOTH_NAMESPACE -class BluetoothReplyRunnable; class BluetoothSocket; class Call; diff --git a/dom/bluetooth2/BluetoothDevice.h b/dom/bluetooth2/BluetoothDevice.h index 7dc40f981f..62bfbb4ffa 100644 --- a/dom/bluetooth2/BluetoothDevice.h +++ b/dom/bluetooth2/BluetoothDevice.h @@ -27,7 +27,6 @@ class BluetoothGatt; class BluetoothNamedValue; class BluetoothValue; class BluetoothSignal; -class BluetoothSocket; class BluetoothDevice final : public DOMEventTargetHelper , public BluetoothSignalObserver diff --git a/dom/bluetooth2/BluetoothDiscoveryHandle.h b/dom/bluetooth2/BluetoothDiscoveryHandle.h index 675741d4f7..d25588a164 100644 --- a/dom/bluetooth2/BluetoothDiscoveryHandle.h +++ b/dom/bluetooth2/BluetoothDiscoveryHandle.h @@ -16,7 +16,6 @@ BEGIN_BLUETOOTH_NAMESPACE class BluetoothDevice; -class BluetoothValue; class BluetoothDiscoveryHandle final : public DOMEventTargetHelper { diff --git a/dom/bluetooth2/BluetoothGatt.h b/dom/bluetooth2/BluetoothGatt.h index e8279e82f2..9253c4daa3 100644 --- a/dom/bluetooth2/BluetoothGatt.h +++ b/dom/bluetooth2/BluetoothGatt.h @@ -21,8 +21,6 @@ class Promise; BEGIN_BLUETOOTH_NAMESPACE -class BluetoothReplyRunnable; -class BluetoothService; class BluetoothSignal; class BluetoothValue; diff --git a/dom/bluetooth2/BluetoothPairingHandle.h b/dom/bluetooth2/BluetoothPairingHandle.h index 92434c3f03..d687cb6ff4 100644 --- a/dom/bluetooth2/BluetoothPairingHandle.h +++ b/dom/bluetooth2/BluetoothPairingHandle.h @@ -19,8 +19,6 @@ class Promise; BEGIN_BLUETOOTH_NAMESPACE -class BluetoothDevice; - class BluetoothPairingHandle final : public nsISupports , public nsWrapperCache { diff --git a/dom/bluetooth2/BluetoothPairingListener.h b/dom/bluetooth2/BluetoothPairingListener.h index a3a9bc4700..0e16804aa1 100644 --- a/dom/bluetooth2/BluetoothPairingListener.h +++ b/dom/bluetooth2/BluetoothPairingListener.h @@ -13,7 +13,6 @@ BEGIN_BLUETOOTH_NAMESPACE -class BluetoothDevice; class BluetoothSignal; class BluetoothPairingListener final : public DOMEventTargetHelper diff --git a/dom/cache/OfflineStorage.h b/dom/cache/OfflineStorage.h index 383f62b606..51291f5455 100644 --- a/dom/cache/OfflineStorage.h +++ b/dom/cache/OfflineStorage.h @@ -13,8 +13,6 @@ #include "nsIOfflineStorage.h" #include "nsTArray.h" -class nsIThread; - namespace mozilla { namespace dom { namespace cache { diff --git a/dom/cache/ReadStream.h b/dom/cache/ReadStream.h index 6db31527fa..e1c6587a22 100644 --- a/dom/cache/ReadStream.h +++ b/dom/cache/ReadStream.h @@ -15,8 +15,6 @@ #include "mozilla/RefPtr.h" #include "nsTArrayForwardDeclare.h" -class nsIThread; - namespace mozilla { namespace dom { namespace cache { diff --git a/dom/camera/GonkCameraControl.h b/dom/camera/GonkCameraControl.h index e2d6539fd2..efc8dbf0a1 100644 --- a/dom/camera/GonkCameraControl.h +++ b/dom/camera/GonkCameraControl.h @@ -48,9 +48,6 @@ namespace layers { class ImageContainer; } -class GonkRecorderProfile; -class GonkRecorderProfileManager; - class nsGonkCameraControl : public CameraControlImpl { public: diff --git a/dom/camera/ICameraControl.h b/dom/camera/ICameraControl.h index 6320c0b0a4..c3c9fdfe81 100644 --- a/dom/camera/ICameraControl.h +++ b/dom/camera/ICameraControl.h @@ -13,8 +13,6 @@ struct DeviceStorageFileDescriptor; -class nsIFile; - namespace mozilla { class CameraControlListener; diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h index b2a20fafac..3626fffe21 100644 --- a/dom/canvas/CanvasRenderingContext2D.h +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -42,7 +42,6 @@ class ImageData; class StringOrCanvasGradientOrCanvasPattern; class OwningStringOrCanvasGradientOrCanvasPattern; class TextMetrics; -class SVGMatrix; class CanvasFilterChainObserver; extern const mozilla::gfx::Float SIGMA_MAX; diff --git a/dom/canvas/CanvasUtils.h b/dom/canvas/CanvasUtils.h index fc69043fcd..673c5c04f9 100644 --- a/dom/canvas/CanvasUtils.h +++ b/dom/canvas/CanvasUtils.h @@ -15,10 +15,6 @@ class nsIPrincipal; namespace mozilla { -namespace gfx { -class Matrix; -} - namespace dom { class HTMLCanvasElement; } // namespace dom diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h index 872e1f8c46..27df52c85b 100644 --- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -68,7 +68,6 @@ class nsIDocShell; namespace mozilla { class WebGLActiveInfo; -class WebGLContextBoundObject; class WebGLContextLossHandler; class WebGLBuffer; class WebGLExtensionBase; @@ -84,7 +83,6 @@ class WebGLTexture; class WebGLTransformFeedback; class WebGLUniformLocation; class WebGLVertexArray; -struct WebGLVertexAttribData; namespace dom { class Element; diff --git a/dom/canvas/WebGLFramebuffer.h b/dom/canvas/WebGLFramebuffer.h index 817edc34b4..37a8ec40e0 100644 --- a/dom/canvas/WebGLFramebuffer.h +++ b/dom/canvas/WebGLFramebuffer.h @@ -14,7 +14,6 @@ namespace mozilla { -class WebGLFramebufferAttachable; class WebGLRenderbuffer; class WebGLTexture; diff --git a/dom/canvas/WebGLObjectModel.h b/dom/canvas/WebGLObjectModel.h index 193c419b67..311458d36a 100644 --- a/dom/canvas/WebGLObjectModel.h +++ b/dom/canvas/WebGLObjectModel.h @@ -12,7 +12,6 @@ namespace mozilla { -class WebGLBuffer; class WebGLContext; /* Each WebGL object class WebGLFoo wants to: diff --git a/dom/canvas/WebGLShaderPrecisionFormat.h b/dom/canvas/WebGLShaderPrecisionFormat.h index c7147f4a86..1b37dba22e 100644 --- a/dom/canvas/WebGLShaderPrecisionFormat.h +++ b/dom/canvas/WebGLShaderPrecisionFormat.h @@ -10,8 +10,6 @@ namespace mozilla { -class WebGLBuffer; - class WebGLShaderPrecisionFormat final : public WebGLContextBoundObject { diff --git a/dom/canvas/nsICanvasRenderingContextInternal.h b/dom/canvas/nsICanvasRenderingContextInternal.h index f6c9e39044..d97d963cdf 100644 --- a/dom/canvas/nsICanvasRenderingContextInternal.h +++ b/dom/canvas/nsICanvasRenderingContextInternal.h @@ -19,7 +19,6 @@ { 0x3cc9e801, 0x1806, 0x4ff6, \ { 0x86, 0x14, 0xf9, 0xd0, 0xf4, 0xfb, 0x3b, 0x08 } } -class gfxContext; class gfxASurface; class nsDisplayListBuilder; diff --git a/dom/datastore/DataStoreCursor.h b/dom/datastore/DataStoreCursor.h index c8a3243b2d..a53c147ffb 100644 --- a/dom/datastore/DataStoreCursor.h +++ b/dom/datastore/DataStoreCursor.h @@ -9,8 +9,6 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" -class nsPIDOMWindow; - namespace mozilla { class ErrorResult; diff --git a/dom/datastore/DataStoreDB.h b/dom/datastore/DataStoreDB.h index 2d28c8c374..e7603e8657 100644 --- a/dom/datastore/DataStoreDB.h +++ b/dom/datastore/DataStoreDB.h @@ -21,7 +21,6 @@ namespace dom { namespace indexedDB { class IDBDatabase; class IDBFactory; -class IDBObjectStore; class IDBOpenDBRequest; class IDBTransaction; } // namespace indexedDB diff --git a/dom/events/EventDispatcher.h b/dom/events/EventDispatcher.h index c0f2f96511..195f21e069 100644 --- a/dom/events/EventDispatcher.h +++ b/dom/events/EventDispatcher.h @@ -16,7 +16,6 @@ class nsIContent; class nsIDOMEvent; -class nsIScriptGlobalObject; class nsPresContext; template class nsCOMArray; diff --git a/dom/events/EventListenerManager.h b/dom/events/EventListenerManager.h index 144643d726..478ac7f174 100644 --- a/dom/events/EventListenerManager.h +++ b/dom/events/EventListenerManager.h @@ -19,7 +19,6 @@ class nsIDocShell; class nsIDOMEvent; class nsIEventListenerInfo; -class nsIScriptContext; class nsPIDOMWindow; class JSTracer; diff --git a/dom/events/EventTarget.h b/dom/events/EventTarget.h index cf59436c53..c0b58ac686 100644 --- a/dom/events/EventTarget.h +++ b/dom/events/EventTarget.h @@ -12,7 +12,6 @@ class nsIDOMWindow; class nsIGlobalObject; -class nsIDOMEventListener; namespace mozilla { diff --git a/dom/events/IMEStateManager.h b/dom/events/IMEStateManager.h index 30ea50be28..79ccf55ec3 100644 --- a/dom/events/IMEStateManager.h +++ b/dom/events/IMEStateManager.h @@ -13,7 +13,6 @@ class nsIContent; class nsIDOMMouseEvent; class nsIEditor; class nsINode; -class nsPIDOMWindow; class nsPresContext; class nsISelection; diff --git a/dom/fetch/Fetch.h b/dom/fetch/Fetch.h index 480c04fbaf..367dd2ef31 100644 --- a/dom/fetch/Fetch.h +++ b/dom/fetch/Fetch.h @@ -20,7 +20,6 @@ #include "mozilla/dom/RequestBinding.h" #include "mozilla/dom/workers/bindings/WorkerFeature.h" -class nsIOutputStream; class nsIGlobalObject; namespace mozilla { diff --git a/dom/fetch/FetchDriver.h b/dom/fetch/FetchDriver.h index fddcd552a3..6c0a7ea699 100644 --- a/dom/fetch/FetchDriver.h +++ b/dom/fetch/FetchDriver.h @@ -24,7 +24,6 @@ class nsIPrincipal; namespace mozilla { namespace dom { -class BlobSet; class InternalRequest; class InternalResponse; diff --git a/dom/fetch/Headers.h b/dom/fetch/Headers.h index 8d6bee84f4..b8cab7c0ce 100644 --- a/dom/fetch/Headers.h +++ b/dom/fetch/Headers.h @@ -14,8 +14,6 @@ #include "InternalHeaders.h" -class nsPIDOMWindow; - namespace mozilla { class ErrorResult; diff --git a/dom/fetch/InternalHeaders.h b/dom/fetch/InternalHeaders.h index 5d632dcb98..9e11a1e102 100644 --- a/dom/fetch/InternalHeaders.h +++ b/dom/fetch/InternalHeaders.h @@ -14,8 +14,6 @@ #include "nsClassHashtable.h" #include "nsWrapperCache.h" -class nsPIDOMWindow; - namespace mozilla { class ErrorResult; @@ -23,7 +21,6 @@ class ErrorResult; namespace dom { template class MozMap; -class HeadersOrByteStringSequenceSequenceOrByteStringMozMap; class InternalHeaders final { diff --git a/dom/fetch/InternalRequest.h b/dom/fetch/InternalRequest.h index 81f1c1b148..6e9b7f8e5b 100644 --- a/dom/fetch/InternalRequest.h +++ b/dom/fetch/InternalRequest.h @@ -19,9 +19,6 @@ #include "nsServiceManagerUtils.h" #endif -class nsIDocument; -class nsPIDOMWindow; - namespace mozilla { namespace dom { @@ -84,7 +81,6 @@ namespace dom { * TODO: Split TYPE_OBJECT into TYPE_EMBED and TYPE_OBJECT */ -class FetchBodyStream; class Request; #define kFETCH_CLIENT_REFERRER_STR "about:client" diff --git a/dom/fetch/Request.h b/dom/fetch/Request.h index 1bc6a69250..b38f058f98 100644 --- a/dom/fetch/Request.h +++ b/dom/fetch/Request.h @@ -16,14 +16,11 @@ // files. #include "mozilla/dom/RequestBinding.h" -class nsPIDOMWindow; - namespace mozilla { namespace dom { class Headers; class InternalHeaders; -class Promise; class RequestOrUSVString; class Request final : public nsISupports diff --git a/dom/fetch/Response.h b/dom/fetch/Response.h index 786736144b..af75446bca 100644 --- a/dom/fetch/Response.h +++ b/dom/fetch/Response.h @@ -14,15 +14,11 @@ #include "InternalResponse.h" -class nsPIDOMWindow; - namespace mozilla { namespace dom { -class ArrayBufferOrArrayBufferViewOrUSVStringOrURLSearchParams; class Headers; class InternalHeaders; -class Promise; class Response final : public nsISupports , public FetchBody diff --git a/dom/filesystem/FileSystemTaskBase.h b/dom/filesystem/FileSystemTaskBase.h index 22acbe6b92..624a71c291 100644 --- a/dom/filesystem/FileSystemTaskBase.h +++ b/dom/filesystem/FileSystemTaskBase.h @@ -19,7 +19,6 @@ namespace dom { class BlobParent; class FileSystemBase; class FileSystemParams; -class Promise; /* * The base class to implement a Task class. diff --git a/dom/fmradio/FMRadio.h b/dom/fmradio/FMRadio.h index 69dd6e20a7..5a275feb5b 100644 --- a/dom/fmradio/FMRadio.h +++ b/dom/fmradio/FMRadio.h @@ -14,7 +14,6 @@ #include "nsWeakReference.h" class nsPIDOMWindow; -class nsIScriptContext; BEGIN_FMRADIO_NAMESPACE diff --git a/dom/gamepad/GamepadService.h b/dom/gamepad/GamepadService.h index 4225e3c597..29e44c0325 100644 --- a/dom/gamepad/GamepadService.h +++ b/dom/gamepad/GamepadService.h @@ -16,8 +16,6 @@ #include "nsITimer.h" #include "nsTArray.h" -class nsIDOMDocument; - namespace mozilla { namespace dom { diff --git a/dom/html/HTMLAllCollection.h b/dom/html/HTMLAllCollection.h index d6d71e2c82..a80ff26ff4 100644 --- a/dom/html/HTMLAllCollection.h +++ b/dom/html/HTMLAllCollection.h @@ -21,9 +21,6 @@ class nsIContent; class nsINode; namespace mozilla { - -class ErrorResult; - namespace dom { class OwningNodeOrHTMLCollection; diff --git a/dom/html/HTMLFrameElement.h b/dom/html/HTMLFrameElement.h index ac8de9c896..d6a1698278 100644 --- a/dom/html/HTMLFrameElement.h +++ b/dom/html/HTMLFrameElement.h @@ -11,8 +11,6 @@ #include "nsGenericHTMLFrameElement.h" #include "nsGkAtoms.h" -class nsIDOMDocument; - namespace mozilla { namespace dom { diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h index c440501d27..a7a072ac94 100644 --- a/dom/html/HTMLInputElement.h +++ b/dom/html/HTMLInputElement.h @@ -25,7 +25,6 @@ #include "nsTextEditorState.h" class nsIRadioGroupContainer; -class nsIRadioGroupVisitor; class nsIRadioVisitor; namespace mozilla { diff --git a/dom/html/HTMLSourceElement.h b/dom/html/HTMLSourceElement.h index 34ddc82c1c..459aa64560 100644 --- a/dom/html/HTMLSourceElement.h +++ b/dom/html/HTMLSourceElement.h @@ -17,7 +17,6 @@ class nsMediaList; namespace mozilla { namespace dom { -class ResponsiveImageSelector; class HTMLSourceElement final : public nsGenericHTMLElement, public nsIDOMHTMLSourceElement { diff --git a/dom/html/HTMLTableCellElement.h b/dom/html/HTMLTableCellElement.h index d0da453f43..8b04563e4e 100644 --- a/dom/html/HTMLTableCellElement.h +++ b/dom/html/HTMLTableCellElement.h @@ -9,8 +9,6 @@ #include "nsGenericHTMLElement.h" #include "nsIDOMHTMLTableCellElement.h" -class nsIDOMHTMLTableRowElement; - namespace mozilla { namespace dom { diff --git a/dom/html/HTMLTableRowElement.h b/dom/html/HTMLTableRowElement.h index 222689f8ce..42779de5a5 100644 --- a/dom/html/HTMLTableRowElement.h +++ b/dom/html/HTMLTableRowElement.h @@ -8,7 +8,6 @@ #include "mozilla/Attributes.h" #include "nsGenericHTMLElement.h" -class nsIDOMHTMLTableElement; class nsContentList; namespace mozilla { diff --git a/dom/html/UndoManager.h b/dom/html/UndoManager.h index b56b62d0ed..ebc95e3e02 100644 --- a/dom/html/UndoManager.h +++ b/dom/html/UndoManager.h @@ -16,7 +16,6 @@ #include "mozilla/dom/Nullable.h" class nsITransactionManager; -class nsIMutationObserver; namespace mozilla { class ErrorResult; diff --git a/dom/html/nsFormSubmission.h b/dom/html/nsFormSubmission.h index 5645c2818d..802191e45a 100644 --- a/dom/html/nsFormSubmission.h +++ b/dom/html/nsFormSubmission.h @@ -13,11 +13,6 @@ class nsIURI; class nsIInputStream; class nsGenericHTMLElement; -class nsILinkHandler; -class nsIFormControl; -class nsIDOMHTMLElement; -class nsIDocShell; -class nsIRequest; class nsISaveAsCharset; class nsIMultiplexInputStream; diff --git a/dom/html/nsHTMLDocument.h b/dom/html/nsHTMLDocument.h index ec426d238a..e36e6469da 100644 --- a/dom/html/nsHTMLDocument.h +++ b/dom/html/nsHTMLDocument.h @@ -22,7 +22,6 @@ #include "mozilla/dom/HTMLSharedElement.h" class nsIEditor; -class nsIParser; class nsIURI; class nsIDocShell; class nsICachingChannel; diff --git a/dom/html/nsIForm.h b/dom/html/nsIForm.h index e103d1545f..2772024a58 100644 --- a/dom/html/nsIForm.h +++ b/dom/html/nsIForm.h @@ -9,8 +9,6 @@ #include "nsAString.h" class nsIFormControl; -class nsISimpleEnumerator; -class nsIURI; #define NS_FORM_METHOD_GET 0 #define NS_FORM_METHOD_POST 1 diff --git a/dom/html/nsIFormControl.h b/dom/html/nsIFormControl.h index ee68fde5de..ce83903cba 100644 --- a/dom/html/nsIFormControl.h +++ b/dom/html/nsIFormControl.h @@ -8,8 +8,6 @@ #include "nsISupports.h" class nsIDOMHTMLFormElement; class nsPresState; -class nsString; -class nsIFormProcessor; class nsFormSubmission; namespace mozilla { diff --git a/dom/html/nsIHTMLCollection.h b/dom/html/nsIHTMLCollection.h index 8f448be948..709948d17e 100644 --- a/dom/html/nsIHTMLCollection.h +++ b/dom/html/nsIHTMLCollection.h @@ -15,8 +15,6 @@ class nsINode; class nsString; namespace mozilla { -class ErrorResult; - namespace dom { class Element; } // namespace dom diff --git a/dom/html/nsIHTMLDocument.h b/dom/html/nsIHTMLDocument.h index db8618a3b1..78a4c65154 100644 --- a/dom/html/nsIHTMLDocument.h +++ b/dom/html/nsIHTMLDocument.h @@ -9,12 +9,9 @@ #include "nsISupports.h" #include "nsCompatibility.h" -class nsIDOMHTMLFormElement; class nsIContent; -class nsIScriptElement; class nsIEditor; class nsContentList; -class nsWrapperCache; #define NS_IHTMLDOCUMENT_IID \ { 0xcf814492, 0x303c, 0x4718, \ diff --git a/dom/html/nsIRadioGroupContainer.h b/dom/html/nsIRadioGroupContainer.h index 00cc274d9a..8a1e1af003 100644 --- a/dom/html/nsIRadioGroupContainer.h +++ b/dom/html/nsIRadioGroupContainer.h @@ -7,7 +7,6 @@ #include "nsISupports.h" -class nsString; class nsIRadioVisitor; class nsIFormControl; diff --git a/dom/indexedDB/ActorsChild.cpp b/dom/indexedDB/ActorsChild.cpp index c7338ea0d8..855ad601db 100644 --- a/dom/indexedDB/ActorsChild.cpp +++ b/dom/indexedDB/ActorsChild.cpp @@ -19,6 +19,7 @@ #include "mozilla/BasicEvents.h" #include "mozilla/Maybe.h" #include "mozilla/TypeTraits.h" +#include "mozilla/dom/Element.h" #include "mozilla/dom/PermissionMessageUtils.h" #include "mozilla/dom/TabChild.h" #include "mozilla/dom/indexedDB/PBackgroundIDBDatabaseFileChild.h" @@ -534,9 +535,9 @@ class PermissionRequestMainProcessHelper final public: PermissionRequestMainProcessHelper(BackgroundFactoryRequestChild* aActor, IDBFactory* aFactory, - nsPIDOMWindow* aWindow, + Element* aOwnerElement, nsIPrincipal* aPrincipal) - : PermissionRequestBase(aWindow, aPrincipal) + : PermissionRequestBase(aOwnerElement, aPrincipal) , mActor(aActor) , mFactory(aFactory) { @@ -1135,8 +1136,14 @@ BackgroundFactoryRequestChild::RecvPermissionChallenge( nsCOMPtr window = mFactory->GetParentObject(); MOZ_ASSERT(window); + nsCOMPtr ownerElement = + do_QueryInterface(window->GetChromeEventHandler()); + if (NS_WARN_IF(!ownerElement)) { + return false; + } + nsRefPtr helper = - new PermissionRequestMainProcessHelper(this, mFactory, window, principal); + new PermissionRequestMainProcessHelper(this, mFactory, ownerElement, principal); PermissionRequestBase::PermissionValue permission; if (NS_WARN_IF(NS_FAILED(helper->PromptIfNeeded(&permission)))) { diff --git a/dom/indexedDB/ActorsChild.h b/dom/indexedDB/ActorsChild.h index f1ead6c6e8..e85aff0651 100644 --- a/dom/indexedDB/ActorsChild.h +++ b/dom/indexedDB/ActorsChild.h @@ -42,7 +42,6 @@ class IDBMutableFile; class IDBOpenDBRequest; class IDBRequest; class Key; -class PBackgroundIDBFileChild; class PermissionRequestChild; class PermissionRequestParent; class SerializedStructuredCloneReadInfo; diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index c642a7a0e4..85ed3a9222 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -5032,9 +5032,9 @@ class PermissionRequestHelper final bool mActorDestroyed; public: - PermissionRequestHelper(nsPIDOMWindow* aWindow, + PermissionRequestHelper(Element* aOwnerElement, nsIPrincipal* aPrincipal) - : PermissionRequestBase(aWindow, aPrincipal) + : PermissionRequestBase(aOwnerElement, aPrincipal) , mActorDestroyed(false) { } @@ -5693,13 +5693,13 @@ DeallocPBackgroundIDBFactoryParent(PBackgroundIDBFactoryParent* aActor) } PIndexedDBPermissionRequestParent* -AllocPIndexedDBPermissionRequestParent(nsPIDOMWindow* aWindow, +AllocPIndexedDBPermissionRequestParent(Element* aOwnerElement, nsIPrincipal* aPrincipal) { MOZ_ASSERT(NS_IsMainThread()); nsRefPtr actor = - new PermissionRequestHelper(aWindow, aPrincipal); + new PermissionRequestHelper(aOwnerElement, aPrincipal); return actor.forget().take(); } diff --git a/dom/indexedDB/ActorsParent.h b/dom/indexedDB/ActorsParent.h index ad42be4ee9..ec7535733f 100644 --- a/dom/indexedDB/ActorsParent.h +++ b/dom/indexedDB/ActorsParent.h @@ -6,15 +6,12 @@ #define mozilla_dom_indexeddb_actorsparent_h__ template struct already_AddRefed; -class nsCString; -struct nsID; class nsIPrincipal; -class nsPIDOMWindow; namespace mozilla { namespace dom { -class TabParent; +class Element; namespace quota { @@ -39,7 +36,7 @@ bool DeallocPBackgroundIDBFactoryParent(PBackgroundIDBFactoryParent* aActor); PIndexedDBPermissionRequestParent* -AllocPIndexedDBPermissionRequestParent(nsPIDOMWindow* aWindow, +AllocPIndexedDBPermissionRequestParent(Element* aOwnerElement, nsIPrincipal* aPrincipal); bool diff --git a/dom/indexedDB/IDBDatabase.h b/dom/indexedDB/IDBDatabase.h index 8dfb4b058d..f0a1cf55e2 100644 --- a/dom/indexedDB/IDBDatabase.h +++ b/dom/indexedDB/IDBDatabase.h @@ -19,7 +19,6 @@ #include "nsTHashtable.h" class nsIDocument; -class nsIWeakReference; class nsPIDOMWindow; namespace mozilla { diff --git a/dom/indexedDB/IDBObjectStore.h b/dom/indexedDB/IDBObjectStore.h index 92074cf87d..a67c9d6186 100644 --- a/dom/indexedDB/IDBObjectStore.h +++ b/dom/indexedDB/IDBObjectStore.h @@ -27,21 +27,17 @@ class ErrorResult; namespace dom { class DOMStringList; -class nsIContentParent; template class Sequence; namespace indexedDB { -class FileManager; class IDBCursor; -class IDBKeyRange; class IDBRequest; class IDBTransaction; class IndexUpdateInfo; class Key; class KeyPath; class ObjectStoreSpec; -struct StructuredCloneFile; struct StructuredCloneReadInfo; class IDBObjectStore final diff --git a/dom/indexedDB/IDBRequest.h b/dom/indexedDB/IDBRequest.h index ffbb42f00f..00a2cd6a47 100644 --- a/dom/indexedDB/IDBRequest.h +++ b/dom/indexedDB/IDBRequest.h @@ -28,7 +28,6 @@ class ErrorResult; namespace dom { class DOMError; -struct ErrorEventInit; template struct Nullable; class OwningIDBObjectStoreOrIDBIndexOrIDBCursor; diff --git a/dom/indexedDB/IDBTransaction.h b/dom/indexedDB/IDBTransaction.h index bb329b1211..d31c1e4c4a 100644 --- a/dom/indexedDB/IDBTransaction.h +++ b/dom/indexedDB/IDBTransaction.h @@ -27,7 +27,6 @@ namespace dom { class DOMError; class DOMStringList; -class PBlobChild; namespace indexedDB { @@ -42,7 +41,6 @@ class IDBRequest; class IndexMetadata; class ObjectStoreSpec; class OpenCursorParams; -class PBackgroundIDBDatabaseFileChild; class RequestParams; class IDBTransaction final diff --git a/dom/indexedDB/IndexedDatabase.h b/dom/indexedDB/IndexedDatabase.h index a8b4542a08..9e70a81f9c 100644 --- a/dom/indexedDB/IndexedDatabase.h +++ b/dom/indexedDB/IndexedDatabase.h @@ -14,8 +14,6 @@ #include "nsCOMPtr.h" #include "nsTArray.h" -class nsIInputStream; - namespace mozilla { namespace dom { @@ -25,9 +23,7 @@ namespace indexedDB { class FileInfo; class IDBDatabase; -class IDBTransaction; class SerializedStructuredCloneReadInfo; -class SerializedStructuredCloneWriteInfo; struct StructuredCloneFile { diff --git a/dom/indexedDB/IndexedDatabaseManager.h b/dom/indexedDB/IndexedDatabaseManager.h index 851ddfb59f..0f4e0e0e76 100644 --- a/dom/indexedDB/IndexedDatabaseManager.h +++ b/dom/indexedDB/IndexedDatabaseManager.h @@ -16,12 +16,10 @@ #include "nsClassHashtable.h" #include "nsHashKeys.h" -class nsPIDOMWindow; struct PRLogModuleInfo; namespace mozilla { -class DOMEventTargetHelper; class EventChainPostVisitor; namespace dom { diff --git a/dom/indexedDB/PermissionRequestBase.cpp b/dom/indexedDB/PermissionRequestBase.cpp index a98f2d9178..aed2eb1abd 100644 --- a/dom/indexedDB/PermissionRequestBase.cpp +++ b/dom/indexedDB/PermissionRequestBase.cpp @@ -7,6 +7,7 @@ #include "MainThreadUtils.h" #include "mozilla/Assertions.h" #include "mozilla/Services.h" +#include "mozilla/dom/Element.h" #include "nsIDOMWindow.h" #include "nsIObserverService.h" #include "nsIPrincipal.h" @@ -46,13 +47,13 @@ AssertSanity() } // namespace -PermissionRequestBase::PermissionRequestBase(nsPIDOMWindow* aWindow, +PermissionRequestBase::PermissionRequestBase(Element* aOwnerElement, nsIPrincipal* aPrincipal) - : mWindow(aWindow) + : mOwnerElement(aOwnerElement) , mPrincipal(aPrincipal) { AssertSanity(); - MOZ_ASSERT(aWindow); + MOZ_ASSERT(aOwnerElement); MOZ_ASSERT(aPrincipal); } @@ -125,8 +126,8 @@ PermissionRequestBase::PromptIfNeeded(PermissionValue* aCurrentValue) // Tricky, we want to release the window and principal in all cases except // when we successfully prompt. - nsCOMPtr window; - mWindow.swap(window); + nsCOMPtr element; + mOwnerElement.swap(element); nsCOMPtr principal; mPrincipal.swap(principal); @@ -146,7 +147,7 @@ PermissionRequestBase::PromptIfNeeded(PermissionValue* aCurrentValue) } // We're about to prompt so swap the members back. - window.swap(mWindow); + element.swap(mOwnerElement); principal.swap(mPrincipal); rv = obsSvc->NotifyObservers(static_cast(this), @@ -154,7 +155,7 @@ PermissionRequestBase::PromptIfNeeded(PermissionValue* aCurrentValue) nullptr); if (NS_WARN_IF(NS_FAILED(rv))) { // Finally release if we failed the prompt. - mWindow = nullptr; + mOwnerElement = nullptr; mPrincipal = nullptr; return rv; } @@ -200,8 +201,8 @@ PermissionRequestBase::GetInterface(const nsIID& aIID, return QueryInterface(aIID, aResult); } - if (aIID.Equals(NS_GET_IID(nsIDOMWindow)) && mWindow) { - return mWindow->QueryInterface(aIID, aResult); + if (aIID.Equals(NS_GET_IID(nsIDOMNode)) && mOwnerElement) { + return mOwnerElement->QueryInterface(aIID, aResult); } *aResult = nullptr; @@ -215,11 +216,11 @@ PermissionRequestBase::Observe(nsISupports* aSubject, { AssertSanity(); MOZ_ASSERT(!strcmp(aTopic, kPermissionResponseTopic)); - MOZ_ASSERT(mWindow); + MOZ_ASSERT(mOwnerElement); MOZ_ASSERT(mPrincipal); - nsCOMPtr window; - mWindow.swap(window); + nsCOMPtr element; + element.swap(mOwnerElement); nsCOMPtr principal; mPrincipal.swap(principal); diff --git a/dom/indexedDB/PermissionRequestBase.h b/dom/indexedDB/PermissionRequestBase.h index 3ebf9b81f5..9ad3c4a715 100644 --- a/dom/indexedDB/PermissionRequestBase.h +++ b/dom/indexedDB/PermissionRequestBase.h @@ -14,17 +14,19 @@ #include "nsString.h" class nsIPrincipal; -class nsPIDOMWindow; namespace mozilla { namespace dom { + +class Element; + namespace indexedDB { class PermissionRequestBase : public nsIObserver , public nsIInterfaceRequestor { - nsCOMPtr mWindow; + nsCOMPtr mOwnerElement; nsCOMPtr mPrincipal; public: @@ -51,7 +53,7 @@ public: PromptIfNeeded(PermissionValue* aCurrentValue); protected: - PermissionRequestBase(nsPIDOMWindow* aWindow, + PermissionRequestBase(Element* aOwnerElement, nsIPrincipal* aPrincipal); // Reference counted. diff --git a/dom/ipc/BlobChild.h b/dom/ipc/BlobChild.h index 69798cd824..c5c94fe93c 100644 --- a/dom/ipc/BlobChild.h +++ b/dom/ipc/BlobChild.h @@ -10,7 +10,6 @@ #include "nsCOMPtr.h" #include "nsID.h" -class nsIDOMBlob; class nsIEventTarget; class nsIRemoteBlob; class nsString; diff --git a/dom/ipc/BlobParent.h b/dom/ipc/BlobParent.h index ee46909439..619e2329e0 100644 --- a/dom/ipc/BlobParent.h +++ b/dom/ipc/BlobParent.h @@ -14,7 +14,6 @@ template class nsDataHashtable; class nsIDHashKey; -class nsIDOMBlob; class nsIEventTarget; class nsIRemoteBlob; template class nsRevocableEventPtr; diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index f26b6a6b5a..7edb48db25 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -20,7 +20,6 @@ struct ChromePackage; -class nsIDOMBlob; class nsIObserver; struct ResourceMapping; struct OverrideMapping; @@ -35,10 +34,6 @@ class PFileDescriptorSetChild; class URIParams; }// namespace ipc -namespace jsipc { -class JavaScriptShared; -} - namespace layers { class PCompositorChild; } // namespace layers @@ -46,7 +41,6 @@ class PCompositorChild; namespace dom { class AlertObserver; -class PrefObserver; class ConsoleListener; class PStorageChild; class ClonedMessageData; diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 9d6d4d814f..947165acb7 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -30,9 +30,7 @@ class mozIApplication; class nsConsoleService; class nsICycleCollectorLogSink; -class nsIDOMBlob; class nsIDumpGCAndCCLogsCallback; -class nsIMemoryReporter; class nsITimer; class ParentIdleListener; class nsIWidget; @@ -48,7 +46,6 @@ class TestShellParent; } // namespace ipc namespace jsipc { -class JavaScriptShared; class PJavaScriptParent; } // namespace jsipc diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index 7bd5d52821..ff3a5b6700 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -40,7 +40,7 @@ using struct mozilla::widget::IMENotification from "nsIWidget.h"; using struct nsIMEUpdatePreference from "nsIWidget.h"; using struct nsIntPoint from "nsPoint.h"; using struct nsIntRect from "nsRect.h"; -using struct nsIntSize from "nsSize.h"; +using mozilla::gfx::IntSize from "mozilla/gfx/Point.h"; using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h"; using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h"; using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h"; @@ -611,7 +611,7 @@ child: PDocumentRenderer(nsRect documentRect, Matrix transform, nsString bgcolor, uint32_t renderFlags, bool flushLayout, - nsIntSize renderSize); + IntSize renderSize); /** * Sent by the chrome process when it no longer wants this remote diff --git a/dom/ipc/PDocumentRenderer.ipdl b/dom/ipc/PDocumentRenderer.ipdl index 6ee3358f7f..be3053d014 100644 --- a/dom/ipc/PDocumentRenderer.ipdl +++ b/dom/ipc/PDocumentRenderer.ipdl @@ -7,7 +7,7 @@ include protocol PBrowser; include "mozilla/GfxMessageUtils.h"; -using struct nsIntSize from "nsSize.h"; +using nsIntSize from "nsSize.h"; namespace mozilla { namespace ipc { diff --git a/dom/ipc/PreallocatedProcessManager.h b/dom/ipc/PreallocatedProcessManager.h index 938865ddd5..8a92381bb3 100644 --- a/dom/ipc/PreallocatedProcessManager.h +++ b/dom/ipc/PreallocatedProcessManager.h @@ -11,8 +11,6 @@ #include "nsCOMPtr.h" #include "nsIObserver.h" -class nsIRunnable; - namespace mozilla { namespace dom { class ContentParent; diff --git a/dom/ipc/ProcessHangMonitor.h b/dom/ipc/ProcessHangMonitor.h index 7c2461f854..f2f3d8e7dc 100644 --- a/dom/ipc/ProcessHangMonitor.h +++ b/dom/ipc/ProcessHangMonitor.h @@ -10,7 +10,6 @@ #include "mozilla/Atomics.h" #include "nsIObserver.h" -class nsGlobalWindow; class nsITabChild; class MessageLoop; @@ -26,7 +25,6 @@ class ContentParent; } // namespace dom class PProcessHangMonitorParent; -class PProcessHangMonitorChild; class ProcessHangMonitor final : public nsIObserver diff --git a/dom/ipc/StructuredCloneUtils.h b/dom/ipc/StructuredCloneUtils.h index c0171c4075..f6265a2bd1 100644 --- a/dom/ipc/StructuredCloneUtils.h +++ b/dom/ipc/StructuredCloneUtils.h @@ -14,9 +14,6 @@ #include "js/StructuredClone.h" namespace mozilla { - -struct SerializedStructuredCloneBuffer; - namespace dom { struct diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 0f9da458ee..76196a4bee 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1139,19 +1139,12 @@ TabParent::AllocPIndexedDBPermissionRequestParent(const Principal& aPrincipal) MOZ_CRASH("Figure out security checks for bridged content!"); } - nsCOMPtr window; - nsCOMPtr frame = do_QueryInterface(mFrameElement); - if (frame) { - MOZ_ASSERT(frame->OwnerDoc()); - window = do_QueryInterface(frame->OwnerDoc()->GetWindow()); - } - - if (!window) { + if (NS_WARN_IF(!mFrameElement)) { return nullptr; } return - mozilla::dom::indexedDB::AllocPIndexedDBPermissionRequestParent(window, + mozilla::dom::indexedDB::AllocPIndexedDBPermissionRequestParent(mFrameElement, principal); } diff --git a/dom/media/AbstractMediaDecoder.h b/dom/media/AbstractMediaDecoder.h index e4cf8baf02..b0c6fe6fcf 100644 --- a/dom/media/AbstractMediaDecoder.h +++ b/dom/media/AbstractMediaDecoder.h @@ -23,7 +23,6 @@ namespace layers class MediaResource; class ReentrantMonitor; class VideoFrameContainer; -class TimedMetadata; class MediaDecoderOwner; typedef nsDataHashtable MetadataTags; diff --git a/dom/media/AudioSegment.h b/dom/media/AudioSegment.h index b69e031bdf..54c2889ee6 100644 --- a/dom/media/AudioSegment.h +++ b/dom/media/AudioSegment.h @@ -43,7 +43,6 @@ public: nsTArray > mBuffers; }; -class AudioStream; class AudioMixer; /** diff --git a/dom/media/AudioSink.h b/dom/media/AudioSink.h index 3ca6962d85..3e1f1a9f32 100644 --- a/dom/media/AudioSink.h +++ b/dom/media/AudioSink.h @@ -13,7 +13,6 @@ namespace mozilla { -class AudioAvailableEventManager; class AudioStream; class MediaDecoderStateMachine; diff --git a/dom/media/AudioTrack.h b/dom/media/AudioTrack.h index b9de8c4c1a..ae8389e432 100644 --- a/dom/media/AudioTrack.h +++ b/dom/media/AudioTrack.h @@ -12,8 +12,6 @@ namespace mozilla { namespace dom { -class AudioTrackList; - class AudioTrack : public MediaTrack { public: diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index f9db68423f..f7c1f5b1f1 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -15,8 +15,6 @@ #include "mozilla/DOMEventTargetHelper.h" #include "mozilla/CORSMode.h" -class nsXPCClassInfo; - // GetCurrentTime is defined in winbase.h as zero argument macro forwarding to // GetTickCount() and conflicts with NS_DECL_NSIDOMMEDIASTREAM, containing // currentTime getter. diff --git a/dom/media/EncodedBufferCache.h b/dom/media/EncodedBufferCache.h index f7acf2327e..8b78efa900 100644 --- a/dom/media/EncodedBufferCache.h +++ b/dom/media/EncodedBufferCache.h @@ -12,7 +12,6 @@ #include "mozilla/Mutex.h" struct PRFileDesc; -class nsIDOMBlob; namespace mozilla { @@ -20,7 +19,6 @@ namespace dom { class File; } -class ReentrantMonitor; /** * Data is moved into a temporary file when it grows beyond * the maximal size passed in the Init function. diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h index 8c01a70e73..f46737f53e 100644 --- a/dom/media/GraphDriver.h +++ b/dom/media/GraphDriver.h @@ -60,7 +60,6 @@ static const int VIDEO_TARGET_MS = 2*MEDIA_GRAPH_TARGET_PERIOD_MS + SCHEDULE_SAFETY_MARGIN_MS; class MediaStreamGraphImpl; -class MessageBlock; /** * Microseconds relative to the start of the graph timeline. diff --git a/dom/media/Latency.h b/dom/media/Latency.h index 0cee37471f..56645da7da 100644 --- a/dom/media/Latency.h +++ b/dom/media/Latency.h @@ -16,7 +16,6 @@ #include "nsIObserver.h" class AsyncLatencyLogger; -class LogEvent; PRLogModuleInfo* GetLatencyLog(); diff --git a/dom/media/MediaData.cpp b/dom/media/MediaData.cpp index abae9ad297..63d8ba336c 100644 --- a/dom/media/MediaData.cpp +++ b/dom/media/MediaData.cpp @@ -260,7 +260,7 @@ VideoData::Create(const VideoInfo& aInfo, aDuration, aKeyframe, aTimecode, - aInfo.mDisplay.ToIntSize())); + aInfo.mDisplay)); return v.forget(); } @@ -302,7 +302,7 @@ VideoData::Create(const VideoInfo& aInfo, aDuration, aKeyframe, aTimecode, - aInfo.mDisplay.ToIntSize())); + aInfo.mDisplay)); #ifdef MOZ_WIDGET_GONK const YCbCrBuffer::Plane &Y = aBuffer.mPlanes[0]; const YCbCrBuffer::Plane &Cb = aBuffer.mPlanes[1]; @@ -404,7 +404,7 @@ VideoData::CreateFromImage(const VideoInfo& aInfo, aDuration, aKeyframe, aTimecode, - aInfo.mDisplay.ToIntSize())); + aInfo.mDisplay)); v->mImage = aImage; return v.forget(); } @@ -430,7 +430,7 @@ VideoData::Create(const VideoInfo& aInfo, aDuration, aKeyframe, aTimecode, - aInfo.mDisplay.ToIntSize())); + aInfo.mDisplay)); return v.forget(); } @@ -457,7 +457,7 @@ VideoData::Create(const VideoInfo& aInfo, aDuration, aKeyframe, aTimecode, - aInfo.mDisplay.ToIntSize())); + aInfo.mDisplay)); v->mImage = aContainer->CreateImage(ImageFormat::GRALLOC_PLANAR_YCBCR); if (!v->mImage) { diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index 9250310997..65bee2bf8a 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -94,16 +94,11 @@ hardware (via AudioStream). #include "StateMirroring.h" #include "DecodedStream.h" -class nsITimer; - namespace mozilla { class AudioSegment; -class VideoSegment; class MediaTaskQueue; -class SharedThreadPool; class AudioSink; -class MediaDecoderStateMachineScheduler; /* The state machine class. This manages the decoding and seeking in the diff --git a/dom/media/MediaDeviceInfo.h b/dom/media/MediaDeviceInfo.h index 2a90ea5b7a..c1a5a6001b 100644 --- a/dom/media/MediaDeviceInfo.h +++ b/dom/media/MediaDeviceInfo.h @@ -14,9 +14,6 @@ namespace mozilla { namespace dom { -class Promise; -struct MediaStreamConstraints; - #define MOZILLA_DOM_MEDIADEVICEINFO_IMPLEMENTATION_IID \ {0x25091870, 0x84d6, 0x4acf, {0xaf, 0x97, 0x6e, 0xd5, 0x5b, 0xe0, 0x47, 0xb2}} diff --git a/dom/media/MediaManager.h b/dom/media/MediaManager.h index 9e76d8b08e..32a8437310 100644 --- a/dom/media/MediaManager.h +++ b/dom/media/MediaManager.h @@ -45,8 +45,6 @@ namespace mozilla { namespace dom { struct MediaStreamConstraints; -class NavigatorUserMediaSuccessCallback; -class NavigatorUserMediaErrorCallback; struct MediaTrackConstraintSet; } // namespace dom diff --git a/dom/media/MediaShutdownManager.h b/dom/media/MediaShutdownManager.h index 3966e14e29..5e453f0654 100644 --- a/dom/media/MediaShutdownManager.h +++ b/dom/media/MediaShutdownManager.h @@ -19,7 +19,6 @@ namespace mozilla { class MediaDecoder; -class StateMachineThread; // The MediaShutdownManager manages shutting down the MediaDecoder // infrastructure in response to an xpcom-shutdown notification. This happens diff --git a/dom/media/MediaStreamGraph.h b/dom/media/MediaStreamGraph.h index f372b26a0c..95f588226d 100644 --- a/dom/media/MediaStreamGraph.h +++ b/dom/media/MediaStreamGraph.h @@ -246,7 +246,6 @@ class MediaInputPort; class AudioNodeEngine; class AudioNodeExternalInputStream; class AudioNodeStream; -struct AudioChunk; class CameraPreviewMediaStream; /** diff --git a/dom/media/TextTrack.h b/dom/media/TextTrack.h index 2983df14b4..03e8e4cd42 100644 --- a/dom/media/TextTrack.h +++ b/dom/media/TextTrack.h @@ -19,7 +19,6 @@ namespace dom { class TextTrackList; class TextTrackCue; class TextTrackCueList; -class TextTrackRegion; class HTMLTrackElement; enum TextTrackSource { diff --git a/dom/media/VideoUtils.h b/dom/media/VideoUtils.h index 63c6aa3e7d..d96e0d0bdb 100644 --- a/dom/media/VideoUtils.h +++ b/dom/media/VideoUtils.h @@ -11,6 +11,7 @@ #include "mozilla/ReentrantMonitor.h" #include "mozilla/CheckedInt.h" #include "nsIThread.h" +#include "nsSize.h" #if !(defined(XP_WIN) || defined(XP_MACOSX) || defined(LINUX)) || \ defined(MOZ_ASAN) @@ -28,7 +29,6 @@ using mozilla::CheckedUint64; using mozilla::CheckedInt32; using mozilla::CheckedUint32; -struct nsIntSize; struct nsIntRect; // This file contains stuff we'd rather put elsewhere, but which is diff --git a/dom/media/android/AndroidMediaPluginHost.h b/dom/media/android/AndroidMediaPluginHost.h index e965172efd..6a6ae3f51f 100644 --- a/dom/media/android/AndroidMediaPluginHost.h +++ b/dom/media/android/AndroidMediaPluginHost.h @@ -13,8 +13,6 @@ namespace mozilla { -class AndroidMediaReader; - class AndroidMediaPluginHost { nsRefPtr mResourceServer; nsTArray mPlugins; diff --git a/dom/media/android/AndroidMediaReader.h b/dom/media/android/AndroidMediaReader.h index a968b8a641..d573ea654b 100644 --- a/dom/media/android/AndroidMediaReader.h +++ b/dom/media/android/AndroidMediaReader.h @@ -25,10 +25,6 @@ namespace layers { class ImageContainer; } -namespace dom { -class TimeRanges; -} - class AndroidMediaReader : public MediaDecoderReader { nsCString mType; diff --git a/dom/media/directshow/DirectShowReader.h b/dom/media/directshow/DirectShowReader.h index 7699deebc9..792121a027 100644 --- a/dom/media/directshow/DirectShowReader.h +++ b/dom/media/directshow/DirectShowReader.h @@ -15,17 +15,12 @@ struct IGraphBuilder; struct IMediaControl; struct IMediaSeeking; -struct IMediaEventEx; namespace mozilla { class AudioSinkFilter; class SourceFilter; -namespace dom { -class TimeRanges; -} - // Decoder backend for decoding MP3 using DirectShow. DirectShow operates as // a filter graph. The basic design of the DirectShowReader is that we have // a SourceFilter that wraps the MediaResource that connects to the diff --git a/dom/media/directshow/SourceFilter.h b/dom/media/directshow/SourceFilter.h index 3b171bd450..d5ce2770e9 100644 --- a/dom/media/directshow/SourceFilter.h +++ b/dom/media/directshow/SourceFilter.h @@ -19,7 +19,6 @@ namespace mozilla { class MediaResource; -class ReadRequest; class OutputPin; diff --git a/dom/media/encoder/TrackEncoder.cpp b/dom/media/encoder/TrackEncoder.cpp index 420166a03f..93e0bac75b 100644 --- a/dom/media/encoder/TrackEncoder.cpp +++ b/dom/media/encoder/TrackEncoder.cpp @@ -228,7 +228,7 @@ VideoTrackEncoder::AppendVideoSegment(const VideoSegment& aSegment) nsRefPtr image = chunk.mFrame.GetImage(); mRawSegment.AppendFrame(image.forget(), chunk.GetDuration(), - chunk.mFrame.GetIntrinsicSize().ToIntSize(), + chunk.mFrame.GetIntrinsicSize(), chunk.mFrame.GetForceBlack()); iter.Next(); } diff --git a/dom/media/encoder/fmp4_muxer/ISOMediaBoxes.h b/dom/media/encoder/fmp4_muxer/ISOMediaBoxes.h index bc615f9695..3803210d54 100644 --- a/dom/media/encoder/fmp4_muxer/ISOMediaBoxes.h +++ b/dom/media/encoder/fmp4_muxer/ISOMediaBoxes.h @@ -28,7 +28,6 @@ namespace mozilla { class AudioTrackMetadata; class VideoTrackMetadata; -class ES_Descriptor; class ISOControl; /** diff --git a/dom/media/encoder/fmp4_muxer/ISOMediaWriter.h b/dom/media/encoder/fmp4_muxer/ISOMediaWriter.h index 5c6e8fb55e..342b9fbaf7 100644 --- a/dom/media/encoder/fmp4_muxer/ISOMediaWriter.h +++ b/dom/media/encoder/fmp4_muxer/ISOMediaWriter.h @@ -13,7 +13,6 @@ namespace mozilla { class ISOControl; class FragmentBuffer; -class ISOMediaWriterRunnable; class ISOMediaWriter : public ContainerWriter { diff --git a/dom/media/gmp/GMPContentParent.h b/dom/media/gmp/GMPContentParent.h index 67cb81e623..c137b675fb 100644 --- a/dom/media/gmp/GMPContentParent.h +++ b/dom/media/gmp/GMPContentParent.h @@ -9,14 +9,10 @@ #include "mozilla/gmp/PGMPContentParent.h" #include "nsISupportsImpl.h" -class nsITimer; - namespace mozilla { namespace gmp { -class GeckoMediaPluginService; class GMPAudioDecoderParent; -class GMPCapability; class GMPDecryptorParent; class GMPParent; class GMPVideoDecoderParent; diff --git a/dom/media/gmp/GMPParent.h b/dom/media/gmp/GMPParent.h index 54d352d82f..fb9822dd1b 100644 --- a/dom/media/gmp/GMPParent.h +++ b/dom/media/gmp/GMPParent.h @@ -22,7 +22,6 @@ #include "nsTArray.h" #include "nsIFile.h" -class nsILineInputStream; class nsIThread; namespace mozilla { diff --git a/dom/media/imagecapture/ImageCapture.h b/dom/media/imagecapture/ImageCapture.h index 690ed1e9b5..0761634e5d 100644 --- a/dom/media/imagecapture/ImageCapture.h +++ b/dom/media/imagecapture/ImageCapture.h @@ -11,8 +11,6 @@ #include "mozilla/dom/ImageCaptureBinding.h" #include "prlog.h" -class nsIDOMBlob; - namespace mozilla { #ifndef IC_LOG diff --git a/dom/media/mediasource/SourceBufferList.h b/dom/media/mediasource/SourceBufferList.h index 4a07e828fe..c1161b1268 100644 --- a/dom/media/mediasource/SourceBufferList.h +++ b/dom/media/mediasource/SourceBufferList.h @@ -22,7 +22,6 @@ class JSObject; namespace mozilla { -class ErrorResult; template class AsyncEventRunner; namespace dom { diff --git a/dom/media/omx/MediaOmxReader.h b/dom/media/omx/MediaOmxReader.h index 34b119bb5c..f2914527f0 100644 --- a/dom/media/omx/MediaOmxReader.h +++ b/dom/media/omx/MediaOmxReader.h @@ -22,10 +22,6 @@ class MOZ_EXPORT MediaExtractor; namespace mozilla { -namespace dom { - class TimeRanges; -} - class AbstractMediaDecoder; class MediaOmxReader : public MediaOmxCommonReader diff --git a/dom/media/omx/OMXCodecProxy.h b/dom/media/omx/OMXCodecProxy.h index a583acc05b..7c9e61efb9 100644 --- a/dom/media/omx/OMXCodecProxy.h +++ b/dom/media/omx/OMXCodecProxy.h @@ -17,7 +17,6 @@ namespace android { -struct MediaBufferGroup; struct MetaData; class OMXCodecProxy : public MediaSource, diff --git a/dom/media/platforms/PlatformDecoderModule.h b/dom/media/platforms/PlatformDecoderModule.h index 8ee6899aef..07b55efd73 100644 --- a/dom/media/platforms/PlatformDecoderModule.h +++ b/dom/media/platforms/PlatformDecoderModule.h @@ -13,14 +13,11 @@ #include "mozilla/RefPtr.h" #include -class nsIThreadPool; - namespace mozilla { class TrackInfo; class AudioInfo; class VideoInfo; class MediaRawData; -class MediaByteBuffer; namespace layers { class ImageContainer; @@ -28,7 +25,6 @@ class ImageContainer; class MediaDataDecoder; class MediaDataDecoderCallback; -class MediaInputQueue; class FlushableMediaTaskQueue; class CDMProxy; typedef int64_t Microseconds; diff --git a/dom/media/systemservices/LoadMonitor.h b/dom/media/systemservices/LoadMonitor.h index ad5f6aca42..2b496157e5 100644 --- a/dom/media/systemservices/LoadMonitor.h +++ b/dom/media/systemservices/LoadMonitor.h @@ -16,7 +16,6 @@ #include "nsIObserver.h" namespace mozilla { -class LoadInfoUpdateRunner; class LoadInfoCollectRunner; class LoadNotificationCallback diff --git a/dom/media/webaudio/AudioContext.h b/dom/media/webaudio/AudioContext.h index 192957aa7a..41e2259a81 100644 --- a/dom/media/webaudio/AudioContext.h +++ b/dom/media/webaudio/AudioContext.h @@ -35,7 +35,6 @@ class DOMMediaStream; class ErrorResult; class MediaStream; class MediaStreamGraph; -class AudioNodeEngine; class AudioNodeStream; namespace dom { diff --git a/dom/media/webaudio/blink/Reverb.h b/dom/media/webaudio/blink/Reverb.h index 54aeb546a2..97d01b454d 100644 --- a/dom/media/webaudio/blink/Reverb.h +++ b/dom/media/webaudio/blink/Reverb.h @@ -41,9 +41,6 @@ class ThreadSharedFloatArrayBufferList; namespace WebCore { -class DirectConvolver; -class FFTConvolver; - // Multi-channel convolution reverb with channel matrixing - one or more ReverbConvolver objects are used internally. class Reverb { diff --git a/dom/media/webm/WebMBufferedParser.h b/dom/media/webm/WebMBufferedParser.h index 0f539915aa..2599151ebb 100644 --- a/dom/media/webm/WebMBufferedParser.h +++ b/dom/media/webm/WebMBufferedParser.h @@ -12,10 +12,6 @@ namespace mozilla { -namespace dom { -class TimeRanges; -} - // Stores a stream byte offset and the scaled timecode of the block at // that offset. struct WebMTimeDataOffset diff --git a/dom/media/webrtc/MediaEngineDefault.h b/dom/media/webrtc/MediaEngineDefault.h index 130623d54d..82fc192171 100644 --- a/dom/media/webrtc/MediaEngineDefault.h +++ b/dom/media/webrtc/MediaEngineDefault.h @@ -23,7 +23,6 @@ namespace mozilla { namespace layers { class ImageContainer; -class PlanarYCbCrImage; } class MediaEngineDefault; diff --git a/dom/media/webspeech/recognition/SpeechRecognition.h b/dom/media/webspeech/recognition/SpeechRecognition.h index dccbe18831..f5b11c3c79 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.h +++ b/dom/media/webspeech/recognition/SpeechRecognition.h @@ -31,8 +31,6 @@ #include "mozilla/dom/SpeechRecognitionError.h" -class nsIDOMWindow; - namespace mozilla { namespace dom { diff --git a/dom/media/wmf/DXVA2Manager.h b/dom/media/wmf/DXVA2Manager.h index 84c1def13d..d0fe3002f8 100644 --- a/dom/media/wmf/DXVA2Manager.h +++ b/dom/media/wmf/DXVA2Manager.h @@ -10,7 +10,6 @@ #include "nsAutoPtr.h" #include "mozilla/Mutex.h" -struct nsIntSize; struct nsIntRect; namespace mozilla { diff --git a/dom/media/wmf/WMFReader.h b/dom/media/wmf/WMFReader.h index f5de0cf867..4c04c0ca3a 100644 --- a/dom/media/wmf/WMFReader.h +++ b/dom/media/wmf/WMFReader.h @@ -18,10 +18,6 @@ class WMFByteStream; class WMFSourceReaderCallback; class DXVA2Manager; -namespace dom { -class TimeRanges; -} - // Decoder backend for reading H.264/AAC in MP4/M4A, and MP3 files using // Windows Media Foundation. class WMFReader : public MediaDecoderReader diff --git a/dom/mobileconnection/MobileNetworkInfo.h b/dom/mobileconnection/MobileNetworkInfo.h index 7486fd297f..e5f0edc85c 100644 --- a/dom/mobileconnection/MobileNetworkInfo.h +++ b/dom/mobileconnection/MobileNetworkInfo.h @@ -15,8 +15,6 @@ namespace mozilla { namespace dom { -class GlobalObject; - class MobileNetworkInfo final : public nsIMobileNetworkInfo , public nsWrapperCache { diff --git a/dom/mobilemessage/MobileMessageCallback.h b/dom/mobilemessage/MobileMessageCallback.h index 11c4cae8f9..eb98d44817 100644 --- a/dom/mobilemessage/MobileMessageCallback.h +++ b/dom/mobilemessage/MobileMessageCallback.h @@ -10,8 +10,6 @@ #include "nsCOMPtr.h" #include "DOMRequest.h" -class nsIDOMMozMmsMessage; - namespace mozilla { namespace dom { namespace mobilemessage { diff --git a/dom/mobilemessage/ipc/SmsIPCService.h b/dom/mobilemessage/ipc/SmsIPCService.h index c8884a1ae5..c8e76d99f0 100644 --- a/dom/mobilemessage/ipc/SmsIPCService.h +++ b/dom/mobilemessage/ipc/SmsIPCService.h @@ -16,8 +16,6 @@ namespace mozilla { namespace dom { namespace mobilemessage { -class PSmsChild; - class SmsIPCService final : public nsISmsService , public nsIMmsService , public nsIMobileMessageDatabaseService diff --git a/dom/network/TCPServerSocketParent.h b/dom/network/TCPServerSocketParent.h index db9512f0a9..74402de0eb 100644 --- a/dom/network/TCPServerSocketParent.h +++ b/dom/network/TCPServerSocketParent.h @@ -13,8 +13,6 @@ namespace mozilla { namespace dom { -class PBrowserParent; - class TCPServerSocketParent : public mozilla::net::PTCPServerSocketParent , public nsITCPServerSocketParent { diff --git a/dom/network/TCPSocketParent.h b/dom/network/TCPSocketParent.h index 8a543eaac3..439c46be34 100644 --- a/dom/network/TCPSocketParent.h +++ b/dom/network/TCPSocketParent.h @@ -19,8 +19,6 @@ namespace mozilla { namespace dom { -class PBrowserParent; - class TCPSocketParentBase : public nsITCPSocketParent , public mozilla::net::DisconnectableParent { diff --git a/dom/nfc/MozNDEFRecord.h b/dom/nfc/MozNDEFRecord.h index d8061d06c1..fd5cfcfab0 100644 --- a/dom/nfc/MozNDEFRecord.h +++ b/dom/nfc/MozNDEFRecord.h @@ -21,7 +21,6 @@ #include "js/GCAPI.h" #include "nsISupports.h" -class nsIGlobalObject; struct JSContext; struct JSStructuredCloneWriter; diff --git a/dom/offline/nsDOMOfflineResourceList.h b/dom/offline/nsDOMOfflineResourceList.h index 7c5c8cfaee..2c33f8e79d 100644 --- a/dom/offline/nsDOMOfflineResourceList.h +++ b/dom/offline/nsDOMOfflineResourceList.h @@ -26,8 +26,6 @@ #include "mozilla/DOMEventTargetHelper.h" #include "mozilla/ErrorResult.h" -class nsIDOMWindow; - namespace mozilla { namespace dom { class DOMStringList; diff --git a/dom/plugins/base/android/android_npapi.h b/dom/plugins/base/android/android_npapi.h index 2f86a6fa04..ea7d772bb8 100644 --- a/dom/plugins/base/android/android_npapi.h +++ b/dom/plugins/base/android/android_npapi.h @@ -87,7 +87,6 @@ struct ANPCanvas; struct ANPMatrix; struct ANPPaint; struct ANPPath; -struct ANPRegion; struct ANPTypeface; enum ANPMatrixFlags { diff --git a/dom/plugins/base/nsNPAPIPluginInstance.h b/dom/plugins/base/nsNPAPIPluginInstance.h index b633c5e227..6899dc733d 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.h +++ b/dom/plugins/base/nsNPAPIPluginInstance.h @@ -6,6 +6,7 @@ #ifndef nsNPAPIPluginInstance_h_ #define nsNPAPIPluginInstance_h_ +#include "nsSize.h" #include "nsCOMPtr.h" #include "nsTArray.h" #include "nsPIDOMWindow.h" diff --git a/dom/plugins/base/nsPluginHost.h b/dom/plugins/base/nsPluginHost.h index e49c6cc793..9fddf5aae7 100644 --- a/dom/plugins/base/nsPluginHost.h +++ b/dom/plugins/base/nsPluginHost.h @@ -41,7 +41,6 @@ class PluginTag; } // namespace mozilla class nsNPAPIPlugin; -class nsIComponentManager; class nsIFile; class nsIChannel; class nsPluginNativeWindow; diff --git a/dom/plugins/base/nsPluginInstanceOwner.h b/dom/plugins/base/nsPluginInstanceOwner.h index 4ff9bfc58d..4ba860fc4d 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.h +++ b/dom/plugins/base/nsPluginInstanceOwner.h @@ -41,7 +41,6 @@ class PuppetWidget; using mozilla::widget::PuppetWidget; #ifdef MOZ_X11 -class gfxXlibSurface; #ifdef MOZ_WIDGET_QT #include "gfxQtNativeRenderer.h" #else diff --git a/dom/plugins/base/nsPluginTags.h b/dom/plugins/base/nsPluginTags.h index c36fb2979f..8099f7fa0f 100644 --- a/dom/plugins/base/nsPluginTags.h +++ b/dom/plugins/base/nsPluginTags.h @@ -15,7 +15,6 @@ #include "nsITimer.h" #include "nsString.h" -class nsPluginHost; struct PRLibrary; struct nsPluginInfo; class nsNPAPIPlugin; diff --git a/dom/plugins/ipc/PluginInstanceChild.h b/dom/plugins/ipc/PluginInstanceChild.h index d52aa7232b..7b1dab1e4d 100644 --- a/dom/plugins/ipc/PluginInstanceChild.h +++ b/dom/plugins/ipc/PluginInstanceChild.h @@ -40,11 +40,6 @@ class gfxASurface; namespace mozilla { - -namespace layers { -struct RemoteImageData; -} - namespace plugins { class PBrowserStreamChild; diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index c1a53a5cf2..a2935e85ed 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -641,7 +641,7 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect, NS_ASSERTION(image->GetFormat() == ImageFormat::CAIRO_SURFACE, "Wrong format?"); CairoImage* cairoImage = static_cast(image.get()); CairoImage::Data cairoData; - cairoData.mSize = surface->GetSize().ToIntSize(); + cairoData.mSize = surface->GetSize(); cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface); cairoImage->SetData(cairoData); diff --git a/dom/plugins/ipc/PluginInstanceParent.h b/dom/plugins/ipc/PluginInstanceParent.h index afeb190a7b..fc740774a7 100644 --- a/dom/plugins/ipc/PluginInstanceParent.h +++ b/dom/plugins/ipc/PluginInstanceParent.h @@ -24,9 +24,6 @@ #include "nsRect.h" #include "PluginDataResolver.h" -#ifdef MOZ_X11 -class gfxXlibSurface; -#endif #include "mozilla/unused.h" class gfxASurface; diff --git a/dom/plugins/ipc/PluginLibrary.h b/dom/plugins/ipc/PluginLibrary.h index 98d1b9ab46..aac31b7c1c 100644 --- a/dom/plugins/ipc/PluginLibrary.h +++ b/dom/plugins/ipc/PluginLibrary.h @@ -14,11 +14,11 @@ #include "nsTArray.h" #include "nsError.h" #include "mozilla/EventForwards.h" +#include "nsSize.h" class gfxContext; class nsCString; struct nsIntRect; -struct nsIntSize; class nsNPAPIPlugin; namespace mozilla { diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h index 71959e7d4a..dd11923434 100644 --- a/dom/plugins/ipc/PluginModuleChild.h +++ b/dom/plugins/ipc/PluginModuleChild.h @@ -53,7 +53,6 @@ class NestedLoopTimer; static const int kNestedLoopDetectorIntervalMs = 90; #endif -class PluginScriptableObjectChild; class PluginInstanceChild; class PluginModuleChild : public PPluginModuleChild diff --git a/dom/plugins/ipc/PluginScriptableObjectParent.h b/dom/plugins/ipc/PluginScriptableObjectParent.h index 6372eb0ff7..0b75152bf1 100644 --- a/dom/plugins/ipc/PluginScriptableObjectParent.h +++ b/dom/plugins/ipc/PluginScriptableObjectParent.h @@ -16,7 +16,6 @@ namespace mozilla { namespace plugins { -class PluginAsyncSurrogate; class PluginInstanceParent; class PluginScriptableObjectParent; diff --git a/dom/quota/Client.h b/dom/quota/Client.h index 1da6110b9c..11f57055b3 100644 --- a/dom/quota/Client.h +++ b/dom/quota/Client.h @@ -20,7 +20,6 @@ class nsIRunnable; BEGIN_QUOTA_NAMESPACE -class OriginOrPatternString; class UsageInfo; // An abstract interface for quota manager clients. diff --git a/dom/quota/QuotaManager.h b/dom/quota/QuotaManager.h index 86dc8ad259..af81eff7ba 100644 --- a/dom/quota/QuotaManager.h +++ b/dom/quota/QuotaManager.h @@ -40,7 +40,6 @@ class ContentParent; BEGIN_QUOTA_NAMESPACE -class AcquireListener; class AsyncUsageRunnable; class CollectOriginsHelper; class FinalizeOriginEvictionRunnable; diff --git a/dom/quota/nsIOfflineStorage.h b/dom/quota/nsIOfflineStorage.h index 987528590f..8466fbd3be 100644 --- a/dom/quota/nsIOfflineStorage.h +++ b/dom/quota/nsIOfflineStorage.h @@ -12,8 +12,6 @@ #define NS_OFFLINESTORAGE_IID \ {0x91c57bf2, 0x0eda, 0x4db6, {0x9f, 0xf6, 0xcb, 0x38, 0x26, 0x8d, 0xb3, 0x01}} -class nsPIDOMWindow; - namespace mozilla { namespace dom { diff --git a/dom/security/nsCORSListenerProxy.h b/dom/security/nsCORSListenerProxy.h index 040b64a3f4..593efc73e0 100644 --- a/dom/security/nsCORSListenerProxy.h +++ b/dom/security/nsCORSListenerProxy.h @@ -18,7 +18,6 @@ #include "mozilla/Attributes.h" class nsIURI; -class nsIParser; class nsIPrincipal; class nsINetworkInterceptController; diff --git a/dom/smil/nsISMILAttr.h b/dom/smil/nsISMILAttr.h index dbc7d3ea49..c4e257b7b2 100644 --- a/dom/smil/nsISMILAttr.h +++ b/dom/smil/nsISMILAttr.h @@ -9,7 +9,6 @@ #include "nscore.h" class nsSMILValue; -class nsISMILType; class nsIContent; class nsAString; diff --git a/dom/svg/SVGContentUtils.h b/dom/svg/SVGContentUtils.h index cfd2d2aea6..d8218708ff 100644 --- a/dom/svg/SVGContentUtils.h +++ b/dom/svg/SVGContentUtils.h @@ -21,7 +21,6 @@ class gfxTextContextPaint; class nsIContent; class nsIDocument; class nsIFrame; -class nsPresContext; class nsStyleContext; class nsStyleCoord; class nsSVGElement; diff --git a/dom/svg/SVGFragmentIdentifier.h b/dom/svg/SVGFragmentIdentifier.h index f0dec30f04..eee561e3e3 100644 --- a/dom/svg/SVGFragmentIdentifier.h +++ b/dom/svg/SVGFragmentIdentifier.h @@ -9,7 +9,6 @@ #include "nsString.h" class nsIDocument; -class nsSVGViewElement; namespace mozilla { diff --git a/dom/svg/SVGIRect.h b/dom/svg/SVGIRect.h index 44ba61feee..50c3daf235 100644 --- a/dom/svg/SVGIRect.h +++ b/dom/svg/SVGIRect.h @@ -13,7 +13,6 @@ #include "nsWrapperCache.h" class nsIContent; -class nsSVGElement; namespace mozilla { namespace dom { diff --git a/dom/svg/SVGSVGElement.h b/dom/svg/SVGSVGElement.h index 60d840a0cd..0c30262ffd 100644 --- a/dom/svg/SVGSVGElement.h +++ b/dom/svg/SVGSVGElement.h @@ -24,7 +24,6 @@ nsresult NS_NewSVGSVGElement(nsIContent **aResult, class nsSMILTimeContainer; class nsSVGOuterSVGFrame; class nsSVGInnerSVGFrame; -class nsSVGImageFrame; namespace mozilla { class AutoSVGRenderingState; diff --git a/dom/svg/SVGTextPositioningElement.h b/dom/svg/SVGTextPositioningElement.h index fce8108622..82029db9a0 100644 --- a/dom/svg/SVGTextPositioningElement.h +++ b/dom/svg/SVGTextPositioningElement.h @@ -10,8 +10,6 @@ #include "SVGAnimatedLengthList.h" #include "SVGAnimatedNumberList.h" -class nsSVGElement; - namespace mozilla { class SVGAnimatedLengthList; class DOMSVGAnimatedLengthList; diff --git a/dom/svg/nsISVGPoint.h b/dom/svg/nsISVGPoint.h index d585bfaa04..9a469cae24 100644 --- a/dom/svg/nsISVGPoint.h +++ b/dom/svg/nsISVGPoint.h @@ -11,8 +11,6 @@ #include "mozilla/dom/SVGPointBinding.h" #include "DOMSVGPointList.h" -class nsSVGElement; - // {d6b6c440-af8d-40ee-856b-02a317cab275} #define MOZILLA_NSISVGPOINT_IID \ { 0xd6b6c440, 0xaf8d, 0x40ee, \ diff --git a/dom/svg/nsSVGBoolean.h b/dom/svg/nsSVGBoolean.h index 7e61f35c73..f879bc633a 100644 --- a/dom/svg/nsSVGBoolean.h +++ b/dom/svg/nsSVGBoolean.h @@ -12,7 +12,6 @@ #include "mozilla/Attributes.h" class nsIAtom; -class nsISupports; class nsSMILValue; class nsSVGElement; diff --git a/dom/svg/nsSVGElement.h b/dom/svg/nsSVGElement.h index 6596c136ed..1f1e30b4b3 100644 --- a/dom/svg/nsSVGElement.h +++ b/dom/svg/nsSVGElement.h @@ -33,13 +33,11 @@ class nsSVGIntegerPair; class nsSVGLength2; class nsSVGNumber2; class nsSVGNumberPair; -class nsSVGPathGeometryElement; class nsSVGString; class nsSVGViewBox; namespace mozilla { namespace dom { -class CSSValue; class SVGSVGElement; static const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0; diff --git a/dom/svg/nsSVGFilters.h b/dom/svg/nsSVGFilters.h index 7fb687d5b1..7a5f227ee8 100644 --- a/dom/svg/nsSVGFilters.h +++ b/dom/svg/nsSVGFilters.h @@ -16,7 +16,6 @@ #include "FilterSupport.h" class nsSVGFilterInstance; -class nsSVGFilterResource; class nsSVGNumberPair; struct nsSVGStringInfo { diff --git a/dom/svg/nsSVGPathGeometryElement.h b/dom/svg/nsSVGPathGeometryElement.h index e38b648e17..d9f5449954 100644 --- a/dom/svg/nsSVGPathGeometryElement.h +++ b/dom/svg/nsSVGPathGeometryElement.h @@ -9,8 +9,6 @@ #include "mozilla/gfx/2D.h" #include "SVGGraphicsElement.h" -class gfxMatrix; - struct nsSVGMark { enum Type { eStart, diff --git a/dom/system/gonk/AutoMounterSetting.h b/dom/system/gonk/AutoMounterSetting.h index 9f08df3a3b..fac738c2ac 100644 --- a/dom/system/gonk/AutoMounterSetting.h +++ b/dom/system/gonk/AutoMounterSetting.h @@ -10,8 +10,6 @@ namespace mozilla { namespace system { -class ResultListener; - class AutoMounterSetting : public nsIObserver { public: diff --git a/dom/system/gonk/MozMtpServer.h b/dom/system/gonk/MozMtpServer.h index 1e4d109105..57892f875f 100644 --- a/dom/system/gonk/MozMtpServer.h +++ b/dom/system/gonk/MozMtpServer.h @@ -16,12 +16,6 @@ #include "nsCOMPtr.h" #include "nsIThread.h" -namespace mozilla { -namespace system { - class Volume; -} -} - BEGIN_MTP_NAMESPACE using namespace android; diff --git a/dom/system/gonk/nsVolume.h b/dom/system/gonk/nsVolume.h index a902fe83b8..efdf8a678a 100644 --- a/dom/system/gonk/nsVolume.h +++ b/dom/system/gonk/nsVolume.h @@ -14,7 +14,6 @@ namespace mozilla { namespace system { class Volume; -class VolumeMountLock; class nsVolume : public nsIVolume { diff --git a/dom/system/gonk/nsVolumeService.h b/dom/system/gonk/nsVolumeService.h index c393cec74a..a3c9904e6b 100644 --- a/dom/system/gonk/nsVolumeService.h +++ b/dom/system/gonk/nsVolumeService.h @@ -22,7 +22,6 @@ class VolumeInfo; namespace system { -class WakeLockCallback; class Volume; /*************************************************************************** diff --git a/dom/tv/TVChannel.h b/dom/tv/TVChannel.h index ced58da78a..c9a0248bb9 100644 --- a/dom/tv/TVChannel.h +++ b/dom/tv/TVChannel.h @@ -18,7 +18,6 @@ namespace mozilla { namespace dom { class Promise; -class TVProgram; class TVSource; class TVChannel final : public DOMEventTargetHelper diff --git a/dom/vr/VRDevice.cpp b/dom/vr/VRDevice.cpp index a3f81b7408..2085eb1773 100644 --- a/dom/vr/VRDevice.cpp +++ b/dom/vr/VRDevice.cpp @@ -17,30 +17,109 @@ using namespace mozilla::gfx; namespace mozilla { namespace dom { -VRFieldOfView* +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(VRFieldOfViewReadOnly, mParent) +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(VRFieldOfViewReadOnly, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(VRFieldOfViewReadOnly, Release) + +JSObject* +VRFieldOfViewReadOnly::WrapObject(JSContext* aCx, JS::Handle aGivenProto) +{ + return VRFieldOfViewReadOnlyBinding::Wrap(aCx, this, aGivenProto); +} + +already_AddRefed VRFieldOfView::Constructor(const GlobalObject& aGlobal, const VRFieldOfViewInit& aParams, ErrorResult& aRV) { - return new VRFieldOfView(aParams.mUpDegrees, aParams.mRightDegrees, - aParams.mDownDegrees, aParams.mLeftDegrees); + nsRefPtr fov = + new VRFieldOfView(aGlobal.GetAsSupports(), + aParams.mUpDegrees, aParams.mRightDegrees, + aParams.mDownDegrees, aParams.mLeftDegrees); + return fov.forget(); } -VRFieldOfView* +already_AddRefed VRFieldOfView::Constructor(const GlobalObject& aGlobal, double aUpDegrees, double aRightDegrees, double aDownDegrees, double aLeftDegrees, ErrorResult& aRV) { - return new VRFieldOfView(aUpDegrees, aRightDegrees, aDownDegrees, - aLeftDegrees); + nsRefPtr fov = + new VRFieldOfView(aGlobal.GetAsSupports(), + aUpDegrees, aRightDegrees, aDownDegrees, + aLeftDegrees); + return fov.forget(); } -bool +JSObject* VRFieldOfView::WrapObject(JSContext* aCx, - JS::Handle aGivenProto, - JS::MutableHandle aReflector) + JS::Handle aGivenProto) { - return VRFieldOfViewBinding::Wrap(aCx, this, aGivenProto, aReflector); + return VRFieldOfViewBinding::Wrap(aCx, this, aGivenProto); +} + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(VREyeParameters, mParent, mMinFOV, mMaxFOV, mRecFOV, mCurFOV, mEyeTranslation, mRenderRect) +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(VREyeParameters, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(VREyeParameters, Release) + +VREyeParameters::VREyeParameters(nsISupports* aParent, + const gfx::VRFieldOfView& aMinFOV, + const gfx::VRFieldOfView& aMaxFOV, + const gfx::VRFieldOfView& aRecFOV, + const gfx::Point3D& aEyeTranslation, + const gfx::VRFieldOfView& aCurFOV, + const gfx::IntRect& aRenderRect) + : mParent(aParent) +{ + mMinFOV = new VRFieldOfView(aParent, aMinFOV); + mMaxFOV = new VRFieldOfView(aParent, aMaxFOV); + mRecFOV = new VRFieldOfView(aParent, aRecFOV); + mCurFOV = new VRFieldOfView(aParent, aCurFOV); + + mEyeTranslation = new DOMPoint(aParent, aEyeTranslation.x, aEyeTranslation.y, aEyeTranslation.z, 0.0); + mRenderRect = new DOMRect(aParent, aRenderRect.x, aRenderRect.y, aRenderRect.width, aRenderRect.height); +} + +VRFieldOfView* +VREyeParameters::MinimumFieldOfView() +{ + return mMinFOV; +} + +VRFieldOfView* +VREyeParameters::MaximumFieldOfView() +{ + return mMaxFOV; +} + +VRFieldOfView* +VREyeParameters::RecommendedFieldOfView() +{ + return mRecFOV; +} + +VRFieldOfView* +VREyeParameters::CurrentFieldOfView() +{ + return mCurFOV; +} + +DOMPoint* +VREyeParameters::EyeTranslation() +{ + return mEyeTranslation; +} + +DOMRect* +VREyeParameters::RenderRect() +{ + return mRenderRect; +} + +JSObject* +VREyeParameters::WrapObject(JSContext* aCx, JS::Handle aGivenProto) +{ + return VREyeParametersBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(VRPositionState, mParent) @@ -126,37 +205,8 @@ PositionSensorVRDevice::WrapObject(JSContext* aCx, JS::Handle aGivenP return PositionSensorVRDeviceBinding::Wrap(aCx, this, aGivenProto); } -static void -ReleaseHMDInfoRef(void *, nsIAtom*, void *aPropertyValue, void *) -{ - if (aPropertyValue) { - static_cast(aPropertyValue)->Release(); - } -} - -void -HMDVRDevice::XxxToggleElementVR(Element& aElement) -{ - VRHMDInfo* hmdPtr = static_cast(aElement.GetProperty(nsGkAtoms::vr_state)); - if (hmdPtr) { - aElement.DeleteProperty(nsGkAtoms::vr_state); - return; - } - - nsRefPtr hmdRef = mHMD; - aElement.SetProperty(nsGkAtoms::vr_state, hmdRef.forget().take(), - ReleaseHMDInfoRef, - true); -} - namespace { -gfx::VRHMDInfo::Eye -EyeToEye(const VREye& aEye) -{ - return aEye == VREye::Left ? gfx::VRHMDInfo::Eye_Left : gfx::VRHMDInfo::Eye_Right; -} - class HMDInfoVRDevice : public HMDVRDevice { public: @@ -193,46 +243,22 @@ public: mHMD->SetFOV(left, right, zNear, zFar); } - virtual already_AddRefed GetEyeTranslation(VREye aEye) override + virtual already_AddRefed GetEyeParameters(VREye aEye) override { - gfx::Point3D p = mHMD->GetEyeTranslation(EyeToEye(aEye)); - - nsRefPtr obj = new DOMPoint(mParent, p.x, p.y, p.z, 0.0); - return obj.forget(); - } - - virtual VRFieldOfView* GetCurrentEyeFieldOfView(VREye aEye) override - { - return CopyFieldOfView(mHMD->GetEyeFOV(EyeToEye(aEye))); - } - - virtual VRFieldOfView* GetRecommendedEyeFieldOfView(VREye aEye) override - { - return CopyFieldOfView(mHMD->GetRecommendedEyeFOV(EyeToEye(aEye))); - } - - virtual VRFieldOfView* GetMaximumEyeFieldOfView(VREye aEye) override - { - return CopyFieldOfView(mHMD->GetMaximumEyeFOV(EyeToEye(aEye))); - } - - virtual already_AddRefed GetRecommendedEyeRenderRect(VREye aEye) override - { - const IntSize& a(mHMD->SuggestedEyeResolution()); - nsRefPtr obj = - new DOMRect(mParent, - (aEye == VREye::Left) ? 0 : a.width, 0, - a.width, a.height); - return obj.forget(); + gfx::IntSize sz(mHMD->SuggestedEyeResolution()); + gfx::VRHMDInfo::Eye eye = aEye == VREye::Left ? gfx::VRHMDInfo::Eye_Left : gfx::VRHMDInfo::Eye_Right; + nsRefPtr params = + new VREyeParameters(mParent, + gfx::VRFieldOfView(15, 15, 15, 15), // XXX min? + mHMD->GetMaximumEyeFOV(eye), + mHMD->GetRecommendedEyeFOV(eye), + mHMD->GetEyeTranslation(eye), + mHMD->GetEyeFOV(eye), + gfx::IntRect((aEye == VREye::Left) ? 0 : sz.width, 0, sz.width, sz.height)); + return params.forget(); } protected: - VRFieldOfView* - CopyFieldOfView(const gfx::VRFieldOfView& aSrc) - { - return new VRFieldOfView(aSrc.upDegrees, aSrc.rightDegrees, - aSrc.downDegrees, aSrc.leftDegrees); - } }; class HMDPositionVRDevice : public PositionSensorVRDevice @@ -258,20 +284,33 @@ public: } } - virtual already_AddRefed GetState(double timeOffset) override + virtual already_AddRefed GetState() override { if (!mTracking) { mHMD->StartSensorTracking(); mTracking = true; } - gfx::VRHMDSensorState state = mHMD->GetSensorState(timeOffset); + gfx::VRHMDSensorState state = mHMD->GetSensorState(); nsRefPtr obj = new VRPositionState(mParent, state); return obj.forget(); } - virtual void ZeroSensor() override + virtual already_AddRefed GetImmediateState() override + { + if (!mTracking) { + mHMD->StartSensorTracking(); + mTracking = true; + } + + gfx::VRHMDSensorState state = mHMD->GetSensorState(); + nsRefPtr obj = new VRPositionState(mParent, state); + + return obj.forget(); + } + + virtual void ResetSensor() override { mHMD->ZeroSensor(); } diff --git a/dom/vr/VRDevice.h b/dom/vr/VRDevice.h index 83bdf23562..40ab7e3590 100644 --- a/dom/vr/VRDevice.h +++ b/dom/vr/VRDevice.h @@ -24,26 +24,36 @@ namespace mozilla { namespace dom { -class Element; - -class VRFieldOfViewReadOnly : public NonRefcountedDOMObject +class VRFieldOfViewReadOnly : public nsWrapperCache { public: - VRFieldOfViewReadOnly(double aUpDegrees, double aRightDegrees, + VRFieldOfViewReadOnly(nsISupports* aParent, + double aUpDegrees, double aRightDegrees, double aDownDegrees, double aLeftDegrees) - : mUpDegrees(aUpDegrees) + : mParent(aParent) + , mUpDegrees(aUpDegrees) , mRightDegrees(aRightDegrees) , mDownDegrees(aDownDegrees) , mLeftDegrees(aLeftDegrees) { } + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VRFieldOfViewReadOnly) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VRFieldOfViewReadOnly) + double UpDegrees() const { return mUpDegrees; } double RightDegrees() const { return mRightDegrees; } double DownDegrees() const { return mDownDegrees; } double LeftDegrees() const { return mLeftDegrees; } + nsISupports* GetParentObject() const { return mParent; } + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; + protected: + virtual ~VRFieldOfViewReadOnly() {} + + nsCOMPtr mParent; + double mUpDegrees; double mRightDegrees; double mDownDegrees; @@ -53,22 +63,30 @@ protected: class VRFieldOfView final : public VRFieldOfViewReadOnly { public: - explicit VRFieldOfView(double aUpDegrees = 0.0, double aRightDegrees = 0.0, - double aDownDegrees = 0.0, double aLeftDegrees = 0.0) - : VRFieldOfViewReadOnly(aUpDegrees, aRightDegrees, aDownDegrees, aLeftDegrees) + VRFieldOfView(nsISupports* aParent, const gfx::VRFieldOfView& aSrc) + : VRFieldOfViewReadOnly(aParent, + aSrc.upDegrees, aSrc.rightDegrees, + aSrc.downDegrees, aSrc.leftDegrees) {} - static VRFieldOfView* + explicit VRFieldOfView(nsISupports* aParent, + double aUpDegrees = 0.0, double aRightDegrees = 0.0, + double aDownDegrees = 0.0, double aLeftDegrees = 0.0) + : VRFieldOfViewReadOnly(aParent, + aUpDegrees, aRightDegrees, aDownDegrees, aLeftDegrees) + {} + + static already_AddRefed Constructor(const GlobalObject& aGlobal, const VRFieldOfViewInit& aParams, ErrorResult& aRv); - static VRFieldOfView* + static already_AddRefed Constructor(const GlobalObject& aGlobal, double aUpDegrees, double aRightDegrees, double aDownDegrees, double aLeftDegrees, ErrorResult& aRv); - bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void SetUpDegrees(double aVal) { mUpDegrees = aVal; } void SetRightDegrees(double aVal) { mRightDegrees = aVal; } @@ -80,7 +98,7 @@ class VRPositionState final : public nsWrapperCache { ~VRPositionState() {} public: - explicit VRPositionState(nsISupports* aParent, const gfx::VRHMDSensorState& aState); + VRPositionState(nsISupports* aParent, const gfx::VRHMDSensorState& aState); NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VRPositionState) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VRPositionState) @@ -117,6 +135,43 @@ protected: nsRefPtr mAngularAcceleration; }; +class VREyeParameters final : public nsWrapperCache +{ +public: + VREyeParameters(nsISupports* aParent, + const gfx::VRFieldOfView& aMinFOV, + const gfx::VRFieldOfView& aMaxFOV, + const gfx::VRFieldOfView& aRecFOV, + const gfx::Point3D& aEyeTranslation, + const gfx::VRFieldOfView& aCurFOV, + const gfx::IntRect& aRenderRect); + + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VREyeParameters) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VREyeParameters) + + VRFieldOfView* MinimumFieldOfView(); + VRFieldOfView* MaximumFieldOfView(); + VRFieldOfView* RecommendedFieldOfView(); + DOMPoint* EyeTranslation(); + + VRFieldOfView* CurrentFieldOfView(); + DOMRect* RenderRect(); + + nsISupports* GetParentObject() const { return mParent; } + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; +protected: + ~VREyeParameters() {} + + nsCOMPtr mParent; + + nsRefPtr mMinFOV; + nsRefPtr mMaxFOV; + nsRefPtr mRecFOV; + nsRefPtr mEyeTranslation; + nsRefPtr mCurFOV; + nsRefPtr mRenderRect; +}; + class VRDevice : public nsISupports, public nsWrapperCache { @@ -176,20 +231,14 @@ protected: class HMDVRDevice : public VRDevice { public: - virtual already_AddRefed GetEyeTranslation(VREye aEye) = 0; + virtual already_AddRefed GetEyeParameters(VREye aEye) = 0; virtual void SetFieldOfView(const VRFieldOfViewInit& aLeftFOV, const VRFieldOfViewInit& aRightFOV, double zNear, double zFar) = 0; - virtual VRFieldOfView* GetCurrentEyeFieldOfView(VREye aEye) = 0; - virtual VRFieldOfView* GetRecommendedEyeFieldOfView(VREye aEye) = 0; - virtual VRFieldOfView* GetMaximumEyeFieldOfView(VREye aEye) = 0; - virtual already_AddRefed GetRecommendedEyeRenderRect(VREye aEye) = 0; virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; - void XxxToggleElementVR(Element& aElement); - gfx::VRHMDInfo *GetHMD() { return mHMD.get(); } protected: @@ -206,9 +255,11 @@ protected: class PositionSensorVRDevice : public VRDevice { public: - virtual already_AddRefed GetState(double timeOffset) = 0; + virtual already_AddRefed GetState() = 0; - virtual void ZeroSensor() = 0; + virtual already_AddRefed GetImmediateState() = 0; + + virtual void ResetSensor() = 0; virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; diff --git a/dom/webidl/VRDevice.webidl b/dom/webidl/VRDevice.webidl index 4590838180..6ff46383ac 100644 --- a/dom/webidl/VRDevice.webidl +++ b/dom/webidl/VRDevice.webidl @@ -52,6 +52,20 @@ interface VRPositionState { readonly attribute DOMPoint? angularAcceleration; }; +[Pref="dom.vr.enabled", + HeaderFile="mozilla/dom/VRDevice.h"] +interface VREyeParameters { + /* These values are expected to be static per-device/per-user */ + [Constant, Cached] readonly attribute VRFieldOfView minimumFieldOfView; + [Constant, Cached] readonly attribute VRFieldOfView maximumFieldOfView; + [Constant, Cached] readonly attribute VRFieldOfView recommendedFieldOfView; + [Constant, Cached] readonly attribute DOMPoint eyeTranslation; + + /* These values will vary after a FOV has been set */ + [Constant, Cached] readonly attribute VRFieldOfView currentFieldOfView; + [Constant, Cached] readonly attribute DOMRect renderRect; +}; + [Pref="dom.vr.enabled"] interface VRDevice { /** @@ -59,38 +73,26 @@ interface VRDevice { * VR Device is a part of. All VRDevice/Sensors that come * from the same hardware will have the same hardwareId */ - [Pure] readonly attribute DOMString hardwareUnitId; + [Constant] readonly attribute DOMString hardwareUnitId; /** * An identifier for this distinct sensor/device on a physical * hardware device. This shouldn't change across browser * restrats, allowing configuration data to be saved based on it. */ - [Pure] readonly attribute DOMString deviceId; + [Constant] readonly attribute DOMString deviceId; /** * a device name, a user-readable name identifying it */ - [Pure] readonly attribute DOMString deviceName; + [Constant] readonly attribute DOMString deviceName; }; [Pref="dom.vr.enabled", HeaderFile="mozilla/dom/VRDevice.h"] interface HMDVRDevice : VRDevice { - /* The translation that should be applied to the view matrix for rendering each eye */ - DOMPoint getEyeTranslation(VREye whichEye); - - // the FOV that the HMD was configured with - [NewObject] - VRFieldOfView getCurrentEyeFieldOfView(VREye whichEye); - - // the recommended FOV, per eye. - [NewObject] - VRFieldOfView getRecommendedEyeFieldOfView(VREye whichEye); - - // the maximum FOV, per eye. Above this, rendering will look broken. - [NewObject] - VRFieldOfView getMaximumEyeFieldOfView(VREye whichEye); + // Return the current VREyeParameters for the given eye + VREyeParameters getEyeParameters(VREye whichEye); // Set a field of view. If either of the fields of view is null, // or if their values are all zeros, then the recommended field of view @@ -99,34 +101,30 @@ interface HMDVRDevice : VRDevice { optional VRFieldOfViewInit rightFOV, optional double zNear = 0.01, optional double zFar = 10000.0); - - // return a recommended rect for this eye. Only useful for Canvas rendering, - // the x/y coordinates will be the location in the canvas where this eye should - // begin, and the width/height are the dimensions. Any canvas in the appropriate - // ratio will work. - DOMRect getRecommendedEyeRenderRect(VREye whichEye); - - // hack for testing - void xxxToggleElementVR(Element element); }; [Pref="dom.vr.enabled" , HeaderFile="mozilla/dom/VRDevice.h"] interface PositionSensorVRDevice : VRDevice { /* - * Return a VRPositionState dictionary containing the state of this position sensor, - * at an optional past time or predicted for a future time if timeOffset is != 0. + * Return a VRPositionState dictionary containing the state of this position sensor + * for the current frame if within a requestAnimationFrame callback, or for the + * previous frame if not. * * The VRPositionState will contain the position, orientation, and velocity * and acceleration of each of these properties. Use "hasPosition" and "hasOrientation" * to check if the associated members are valid; if these are false, those members * will be null. */ - [NewObject] - VRPositionState getState(optional double timeOffset = 0.0); + [NewObject] VRPositionState getState(); - /* Zero this sensor, treating its current position and orientation + /* + * Return the current instantaneous sensor state. + */ + [NewObject] VRPositionState getImmediateState(); + + /* Reset this sensor, treating its current position and orientation * as the "origin/zero" values. */ - void zeroSensor(); + void resetSensor(); }; diff --git a/dom/webidl/XMLHttpRequest.webidl b/dom/webidl/XMLHttpRequest.webidl index b00319d07f..d5cf4962cb 100644 --- a/dom/webidl/XMLHttpRequest.webidl +++ b/dom/webidl/XMLHttpRequest.webidl @@ -140,6 +140,11 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { [ChromeOnly, Exposed=Window] readonly attribute MozChannel? channel; + // A platform-specific identifer to represent the network interface + // which the HTTP request would occur on. + [ChromeOnly, Exposed=Window] + attribute ByteString? networkInterfaceId; + [Throws, ChromeOnly, Exposed=Window] any getInterface(IID iid); diff --git a/dom/workers/DataStore.h b/dom/workers/DataStore.h index d18414cb2f..6a85953610 100644 --- a/dom/workers/DataStore.h +++ b/dom/workers/DataStore.h @@ -18,7 +18,6 @@ namespace dom { class Promise; class DataStore; -class DataStoreImpl; class StringOrUnsignedLong; class OwningStringOrUnsignedLong; diff --git a/dom/workers/DataStoreCursor.h b/dom/workers/DataStoreCursor.h index e180c70dbd..1e36aa6ddb 100644 --- a/dom/workers/DataStoreCursor.h +++ b/dom/workers/DataStoreCursor.h @@ -16,7 +16,6 @@ namespace dom { class Promise; class GlobalObject; class DataStoreCursor; -class DataStoreCursorImpl; namespace workers { diff --git a/dom/workers/FileReaderSync.h b/dom/workers/FileReaderSync.h index 8d6a8e42f3..c3758ca094 100644 --- a/dom/workers/FileReaderSync.h +++ b/dom/workers/FileReaderSync.h @@ -10,7 +10,6 @@ #include "Workers.h" class nsIInputStream; -class nsIDOMBlob; namespace mozilla { class ErrorResult; diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h index 44a336e33e..a6be4e3bba 100644 --- a/dom/workers/RuntimeService.h +++ b/dom/workers/RuntimeService.h @@ -16,7 +16,6 @@ #include "nsHashKeys.h" #include "nsTArray.h" -class nsIRunnable; class nsITimer; class nsPIDOMWindow; diff --git a/dom/workers/ScriptLoader.h b/dom/workers/ScriptLoader.h index 7331144132..91a720fa2a 100644 --- a/dom/workers/ScriptLoader.h +++ b/dom/workers/ScriptLoader.h @@ -19,12 +19,6 @@ namespace mozilla { class ErrorResult; -namespace dom { - -template -class Sequence; - -} // namespace dom } // namespace mozilla BEGIN_WORKERS_NAMESPACE diff --git a/dom/workers/ServiceWorker.h b/dom/workers/ServiceWorker.h index 719e9ccaab..1223b75fed 100644 --- a/dom/workers/ServiceWorker.h +++ b/dom/workers/ServiceWorker.h @@ -15,8 +15,6 @@ class nsPIDOMWindow; namespace mozilla { namespace dom { -class Promise; - namespace workers { class ServiceWorkerInfo; diff --git a/dom/workers/ServiceWorkerManager.h b/dom/workers/ServiceWorkerManager.h index fe9627e53f..dcb190760d 100644 --- a/dom/workers/ServiceWorkerManager.h +++ b/dom/workers/ServiceWorkerManager.h @@ -28,8 +28,6 @@ #include "nsTArrayForwardDeclare.h" #include "nsTObserverArray.h" -class nsIScriptError; - namespace mozilla { namespace ipc { diff --git a/dom/workers/ServiceWorkerRegistrar.h b/dom/workers/ServiceWorkerRegistrar.h index a91eee3bbe..3a300d5c54 100644 --- a/dom/workers/ServiceWorkerRegistrar.h +++ b/dom/workers/ServiceWorkerRegistrar.h @@ -23,7 +23,6 @@ class nsIFile; -class nsRunnable; namespace mozilla { namespace dom { diff --git a/dom/workers/URL.h b/dom/workers/URL.h index e96b5d4d13..abf4399d8d 100644 --- a/dom/workers/URL.h +++ b/dom/workers/URL.h @@ -13,8 +13,6 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/URLSearchParams.h" -class nsIPrincipal; - namespace mozilla { namespace dom { class File; diff --git a/dom/xbl/XBLChildrenElement.h b/dom/xbl/XBLChildrenElement.h index e6440b7203..60c6683761 100644 --- a/dom/xbl/XBLChildrenElement.h +++ b/dom/xbl/XBLChildrenElement.h @@ -17,8 +17,6 @@ class nsAnonymousContentList; namespace mozilla { namespace dom { -class ExplicitChildIterator; - class XBLChildrenElement : public nsXMLElement { public: diff --git a/dom/xbl/nsBindingManager.h b/dom/xbl/nsBindingManager.h index d7271a788f..a2545f3744 100644 --- a/dom/xbl/nsBindingManager.h +++ b/dom/xbl/nsBindingManager.h @@ -25,7 +25,6 @@ class nsIDocument; class nsIURI; class nsXBLDocumentInfo; class nsIStreamListener; -class nsStyleSet; class nsXBLBinding; template class nsRefPtr; typedef nsTArray > nsBindingList; diff --git a/dom/xbl/nsXBLBinding.h b/dom/xbl/nsXBLBinding.h index 00f002500f..17ca5eeb42 100644 --- a/dom/xbl/nsXBLBinding.h +++ b/dom/xbl/nsXBLBinding.h @@ -21,7 +21,6 @@ class nsXBLPrototypeBinding; class nsIContent; class nsIAtom; class nsIDocument; -class nsIScriptContext; namespace mozilla { namespace dom { diff --git a/dom/xbl/nsXBLDocumentInfo.h b/dom/xbl/nsXBLDocumentInfo.h index 67f6588128..bcf81b7d1c 100644 --- a/dom/xbl/nsXBLDocumentInfo.h +++ b/dom/xbl/nsXBLDocumentInfo.h @@ -13,7 +13,6 @@ #include "nsCycleCollectionParticipant.h" class nsXBLPrototypeBinding; -class nsXBLDocGlobalObject; class nsXBLDocumentInfo final : public nsSupportsWeakReference { diff --git a/dom/xbl/nsXBLProtoImplField.h b/dom/xbl/nsXBLProtoImplField.h index 04da70a96e..13c0fa95b9 100644 --- a/dom/xbl/nsXBLProtoImplField.h +++ b/dom/xbl/nsXBLProtoImplField.h @@ -14,7 +14,6 @@ class nsIObjectInputStream; class nsIObjectOutputStream; -class nsIScriptContext; class nsIURI; class nsXBLProtoImplField diff --git a/dom/xbl/nsXBLProtoImplMember.h b/dom/xbl/nsXBLProtoImplMember.h index 0de828b380..83654863de 100644 --- a/dom/xbl/nsXBLProtoImplMember.h +++ b/dom/xbl/nsXBLProtoImplMember.h @@ -13,7 +13,6 @@ #include "nsContentUtils.h" // For NS_CONTENT_DELETE_LIST_MEMBER. #include "nsCycleCollectionParticipant.h" -class nsIContent; class nsIObjectOutputStream; struct nsXBLTextWithLineNumber diff --git a/dom/xml/XMLDocument.h b/dom/xml/XMLDocument.h index 0632cadb09..ad5bf55379 100644 --- a/dom/xml/XMLDocument.h +++ b/dom/xml/XMLDocument.h @@ -11,8 +11,6 @@ #include "nsIDOMXMLDocument.h" #include "nsIScriptContext.h" -class nsIParser; -class nsIDOMNode; class nsIURI; class nsIChannel; diff --git a/dom/xml/nsXMLContentSink.h b/dom/xml/nsXMLContentSink.h index f94f1bfea8..834638996b 100644 --- a/dom/xml/nsXMLContentSink.h +++ b/dom/xml/nsXMLContentSink.h @@ -22,7 +22,6 @@ class nsIDocument; class nsIURI; class nsIContent; class nsIParser; -class nsViewManager; namespace mozilla { namespace dom { diff --git a/dom/xslt/xpath/XPathExpression.h b/dom/xslt/xpath/XPathExpression.h index a45ad66f33..8bd9b59764 100644 --- a/dom/xslt/xpath/XPathExpression.h +++ b/dom/xslt/xpath/XPathExpression.h @@ -17,7 +17,6 @@ class Expr; class nsIDocument; class nsINode; class txResultRecycler; -class txXPathNode; namespace mozilla { namespace dom { diff --git a/dom/xslt/xpath/txExpr.h b/dom/xslt/xpath/txExpr.h index a24f78d1b9..474a459a9e 100644 --- a/dom/xslt/xpath/txExpr.h +++ b/dom/xslt/xpath/txExpr.h @@ -24,7 +24,6 @@ */ class nsIAtom; -class txIParseContext; class txIMatchContext; class txIEvalContext; class txNodeSet; diff --git a/dom/xslt/xpath/txExprParser.h b/dom/xslt/xpath/txExprParser.h index 8c0160bda0..238e033997 100644 --- a/dom/xslt/xpath/txExprParser.h +++ b/dom/xslt/xpath/txExprParser.h @@ -16,7 +16,6 @@ #include "nsAutoPtr.h" #include "nsString.h" -class AttributeValueTemplate; class Expr; class txExprLexer; class FunctionCall; @@ -26,7 +25,6 @@ class PredicateList; class Token; class txIParseContext; class txNodeTest; -class txNodeTypeTest; class txExprParser { diff --git a/dom/xslt/xslt/txBufferingHandler.h b/dom/xslt/xslt/txBufferingHandler.h index 5d4ddba76c..4d38f3c6f8 100644 --- a/dom/xslt/xslt/txBufferingHandler.h +++ b/dom/xslt/xslt/txBufferingHandler.h @@ -12,7 +12,6 @@ #include "nsAutoPtr.h" class txOutputTransaction; -class txCharacterTransaction; class txResultBuffer { diff --git a/dom/xslt/xslt/txExecutionState.h b/dom/xslt/xslt/txExecutionState.h index ce14aad88c..b5bfa562c1 100644 --- a/dom/xslt/xslt/txExecutionState.h +++ b/dom/xslt/xslt/txExecutionState.h @@ -21,7 +21,6 @@ class txAOutputHandlerFactory; class txAXMLEventHandler; class txInstruction; -class txIOutputHandlerFactory; class txLoadedDocumentEntry : public nsStringHashKey { diff --git a/dom/xslt/xslt/txMozillaTextOutput.h b/dom/xslt/xslt/txMozillaTextOutput.h index 561d8bdf81..14f03ab99a 100644 --- a/dom/xslt/xslt/txMozillaTextOutput.h +++ b/dom/xslt/xslt/txMozillaTextOutput.h @@ -11,7 +11,6 @@ #include "nsWeakPtr.h" #include "txOutputFormat.h" -class nsIDOMCharacterData; class nsIDOMDocument; class nsIDOMDocumentFragment; class nsITransformObserver; diff --git a/dom/xslt/xslt/txMozillaXMLOutput.h b/dom/xslt/xslt/txMozillaXMLOutput.h index 75732d596f..70156fc182 100644 --- a/dom/xslt/xslt/txMozillaXMLOutput.h +++ b/dom/xslt/xslt/txMozillaXMLOutput.h @@ -20,9 +20,6 @@ class nsIContent; class nsIDOMDocument; class nsIAtom; class nsIDOMDocumentFragment; -class nsIDOMElement; -class nsIStyleSheet; -class nsIDOMNode; class nsITransformObserver; class nsNodeInfoManager; class nsIDocument; diff --git a/dom/xslt/xslt/txMozillaXSLTProcessor.h b/dom/xslt/xslt/txMozillaXSLTProcessor.h index 33fd35abc1..af840f0857 100644 --- a/dom/xslt/xslt/txMozillaXSLTProcessor.h +++ b/dom/xslt/xslt/txMozillaXSLTProcessor.h @@ -22,7 +22,6 @@ class nsINode; class nsIDOMNode; class nsIURI; -class nsIXMLContentSink; class txStylesheet; class txResultRecycler; class txIGlobalParameter; diff --git a/dom/xslt/xslt/txStylesheet.h b/dom/xslt/xslt/txStylesheet.h index 2f8d5a36fa..978527a13e 100644 --- a/dom/xslt/xslt/txStylesheet.h +++ b/dom/xslt/xslt/txStylesheet.h @@ -13,7 +13,6 @@ #include "nsISupportsImpl.h" class txInstruction; -class txToplevelItem; class txTemplateItem; class txVariableItem; class txStripSpaceItem; diff --git a/dom/xslt/xslt/txXSLTFunctions.h b/dom/xslt/xslt/txXSLTFunctions.h index 7433901812..9efe4d3dba 100644 --- a/dom/xslt/xslt/txXSLTFunctions.h +++ b/dom/xslt/xslt/txXSLTFunctions.h @@ -11,10 +11,7 @@ #include "nsAutoPtr.h" #include "txNamespaceMap.h" -class txPattern; class txStylesheet; -class txKeyValueHashKey; -class txExecutionState; /** * The definition for the XSLT document() function diff --git a/dom/xslt/xslt/txXSLTPatterns.h b/dom/xslt/xslt/txXSLTPatterns.h index 0a6e2a11a0..d93d54fe0e 100644 --- a/dom/xslt/xslt/txXSLTPatterns.h +++ b/dom/xslt/xslt/txXSLTPatterns.h @@ -11,8 +11,6 @@ #include "txExpr.h" #include "txXMLUtils.h" -class ProcessorState; - class txPattern { public: diff --git a/dom/xul/XULDocument.h b/dom/xul/XULDocument.h index ef7100259d..57bf76225f 100644 --- a/dom/xul/XULDocument.h +++ b/dom/xul/XULDocument.h @@ -35,7 +35,6 @@ class nsPIWindowRoot; #if 0 // XXXbe save me, scc (need NSCAP_FORWARD_DECL(nsXULPrototypeScript)) class nsIObjectInputStream; class nsIObjectOutputStream; -class nsIXULPrototypeScript; #else #include "nsIObjectInputStream.h" #include "nsIObjectOutputStream.h" diff --git a/dom/xul/nsXULElement.h b/dom/xul/nsXULElement.h index a8b482f8a1..3b4a88e0e0 100644 --- a/dom/xul/nsXULElement.h +++ b/dom/xul/nsXULElement.h @@ -38,7 +38,6 @@ class nsIDocument; class nsString; -class nsIDocShell; class nsXULPrototypeDocument; class nsIObjectInputStream; @@ -365,8 +364,6 @@ ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + 3); #undef XUL_ELEMENT_FLAG_BIT -class nsScriptEventHandlerOwnerTearoff; - class nsXULElement final : public nsStyledElement, public nsIDOMXULElement { diff --git a/dom/xul/templates/nsContentTestNode.h b/dom/xul/templates/nsContentTestNode.h index 7eb56a0080..e39c7114ac 100644 --- a/dom/xul/templates/nsContentTestNode.h +++ b/dom/xul/templates/nsContentTestNode.h @@ -12,8 +12,6 @@ #include "nsIAtom.h" #include "nsIDOMDocument.h" -class nsIXULTemplateBuilder; - /** * The nsContentTestNode is always the top node in a query's rule network. It * exists so that Constrain can filter out resources that aren't part of a diff --git a/dom/xul/templates/nsRuleNetwork.h b/dom/xul/templates/nsRuleNetwork.h index d92739d24e..39fda00418 100644 --- a/dom/xul/templates/nsRuleNetwork.h +++ b/dom/xul/templates/nsRuleNetwork.h @@ -37,7 +37,6 @@ #include "pldhash.h" #include "nsIRDFNode.h" -class nsIRDFResource; class nsXULTemplateResultSetRDF; class nsXULTemplateQueryProcessorRDF; diff --git a/dom/xul/templates/nsXULContentUtils.h b/dom/xul/templates/nsXULContentUtils.h index 4d027897a1..c106fd91ec 100644 --- a/dom/xul/templates/nsXULContentUtils.h +++ b/dom/xul/templates/nsXULContentUtils.h @@ -17,10 +17,7 @@ class nsIAtom; class nsIContent; class nsIDocument; -class nsIDOMNodeList; class nsIRDFNode; -class nsCString; -class nsString; class nsIRDFResource; class nsIRDFLiteral; class nsIRDFService; diff --git a/dom/xul/templates/nsXULTemplateBuilder.h b/dom/xul/templates/nsXULTemplateBuilder.h index c68ad4b39e..98fa63cb40 100644 --- a/dom/xul/templates/nsXULTemplateBuilder.h +++ b/dom/xul/templates/nsXULTemplateBuilder.h @@ -33,7 +33,6 @@ extern PRLogModuleInfo* gXULTemplateLog; class nsIContent; class nsIObserverService; class nsIRDFCompositeDataSource; -class nsIXULDocument; /** * An object that translates an RDF graph into a presentation using a diff --git a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h index aaa4691e57..65685a3407 100644 --- a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h +++ b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h @@ -34,7 +34,6 @@ extern PRLogModuleInfo* gXULTemplateLog; #endif class nsIContent; -class nsIRDFCompositeDataSource; class nsXULTemplateResultRDF; /** diff --git a/gfx/2d/Factory.cpp b/gfx/2d/Factory.cpp index e86a16a60d..4697110a20 100644 --- a/gfx/2d/Factory.cpp +++ b/gfx/2d/Factory.cpp @@ -52,7 +52,6 @@ #include "mozilla/CheckedInt.h" -#if defined(PR_LOGGING) GFX2D_API PRLogModuleInfo * GetGFX2DLog() { @@ -61,7 +60,6 @@ GetGFX2DLog() sLog = PR_NewLogModule("gfx2d"); return sLog; } -#endif // The following code was largely taken from xpcom/glue/SSE.cpp and // made a little simpler. diff --git a/gfx/2d/Logging.h b/gfx/2d/Logging.h index c4fbb20a5a..e2706db8d3 100644 --- a/gfx/2d/Logging.h +++ b/gfx/2d/Logging.h @@ -22,20 +22,7 @@ #include "BaseRect.h" #include "Matrix.h" -#ifdef WIN32 -// This file gets included from nsGlobalWindow.cpp, which doesn't like -// having windows.h included in it. Since OutputDebugStringA is the only -// thing we need from windows.h, we just declare it here directly. -// Note: the function's documented signature is -// WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR lpOutputString) -// but if we don't include windows.h, the macros WINBASEAPI, WINAPI, and -// LPCSTR are not defined, so we need to replace them with their expansions. -extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString); -#endif - -#if defined(PR_LOGGING) extern GFX2D_API PRLogModuleInfo *GetGFX2DLog(); -#endif namespace mozilla { namespace gfx { @@ -55,8 +42,6 @@ const int LOG_DEFAULT = LOG_EVERYTHING; const int LOG_DEFAULT = LOG_CRITICAL; #endif -#if defined(PR_LOGGING) - inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) { switch (aLevel) { case LOG_CRITICAL: @@ -73,8 +58,6 @@ inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) { return PR_LOG_DEBUG; } -#endif - class PreferenceAccess { public: @@ -147,19 +130,15 @@ struct BasicLogger // in the appropriate places in that method. static bool ShouldOutputMessage(int aLevel) { if (PreferenceAccess::sGfxLogLevel >= aLevel) { -#if defined(WIN32) && !defined(PR_LOGGING) +#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID) return true; -#elif defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID) - return true; -#elif defined(PR_LOGGING) +#else if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) { return true; } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) || (aLevel < LOG_DEBUG)) { return true; } -#else - return true; #endif } return false; @@ -178,19 +157,15 @@ struct BasicLogger // make the corresponding change in the ShouldOutputMessage method // above. if (PreferenceAccess::sGfxLogLevel >= aLevel) { -#if defined(WIN32) && !defined(PR_LOGGING) - ::OutputDebugStringA((aNoNewline ? aString : aString+"\n").c_str()); -#elif defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID) +#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID) printf_stderr("%s%s", aString.c_str(), aNoNewline ? "" : "\n"); -#elif defined(PR_LOGGING) +#else if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) { PR_LogPrint("%s%s", aString.c_str(), aNoNewline ? "" : "\n"); } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) || (aLevel < LOG_DEBUG)) { printf("%s%s", aString.c_str(), aNoNewline ? "" : "\n"); } -#else - printf("%s%s", aString.c_str(), aNoNewline ? "" : "\n"); #endif } } diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp index 0ff68646c6..38dd6d4141 100644 --- a/gfx/gl/GLTextureImage.cpp +++ b/gfx/gl/GLTextureImage.cpp @@ -265,7 +265,7 @@ gfx::IntSize TextureImage::GetSize() const { TextureImage::TextureImage(const gfx::IntSize& aSize, GLenum aWrapMode, ContentType aContentType, - Flags aFlags) + Flags aFlags, ImageFormat aImageFormat) : mSize(aSize) , mWrapMode(aWrapMode) , mContentType(aContentType) @@ -273,21 +273,6 @@ TextureImage::TextureImage(const gfx::IntSize& aSize, , mFlags(aFlags) {} -BasicTextureImage::BasicTextureImage(GLuint aTexture, - const nsIntSize& aSize, - GLenum aWrapMode, - ContentType aContentType, - GLContext* aContext, - TextureImage::Flags aFlags /* = TextureImage::NoFlags */, - TextureImage::ImageFormat aImageFormat /* = gfxImageFormat::Unknown */) - : TextureImage(aSize, aWrapMode, aContentType, aFlags, aImageFormat) - , mTexture(aTexture) - , mTextureState(Created) - , mGLContext(aContext) - , mUpdateOffset(0, 0) -{ -} - BasicTextureImage::BasicTextureImage(GLuint aTexture, const gfx::IntSize& aSize, GLenum aWrapMode, @@ -295,7 +280,7 @@ BasicTextureImage::BasicTextureImage(GLuint aTexture, GLContext* aContext, TextureImage::Flags aFlags, TextureImage::ImageFormat aImageFormat) - : TextureImage(ThebesIntSize(aSize), aWrapMode, aContentType, aFlags, aImageFormat) + : TextureImage(aSize, aWrapMode, aContentType, aFlags, aImageFormat) , mTexture(aTexture) , mTextureState(Created) , mGLContext(aContext) @@ -499,7 +484,7 @@ TiledTextureImage::BeginUpdate(nsIntRegion& aRegion) (GetContentType() == gfxContentType::COLOR) ? gfx::SurfaceFormat::B8G8R8X8: gfx::SurfaceFormat::B8G8R8A8; mUpdateDrawTarget = gfx::Factory::CreateDrawTarget(gfx::BackendType::CAIRO, - bounds.Size().ToIntSize(), + bounds.Size(), format); return mUpdateDrawTarget;; diff --git a/gfx/gl/GLTextureImage.h b/gfx/gl/GLTextureImage.h index 79eb4d5084..8c2004ff82 100644 --- a/gfx/gl/GLTextureImage.h +++ b/gfx/gl/GLTextureImage.h @@ -211,22 +211,10 @@ protected: * TextureImage from GLContext::CreateTextureImage(). That is, * clients must not be given partially-constructed TextureImages. */ - TextureImage(const nsIntSize& aSize, - GLenum aWrapMode, ContentType aContentType, - Flags aFlags = NoFlags, - ImageFormat aImageFormat = gfxImageFormat::Unknown) - : mSize(aSize.ToIntSize()) - , mWrapMode(aWrapMode) - , mContentType(aContentType) - , mImageFormat(aImageFormat) - , mFilter(GraphicsFilter::FILTER_GOOD) - , mFlags(aFlags) - {} - - // Moz2D equivalent... TextureImage(const gfx::IntSize& aSize, GLenum aWrapMode, ContentType aContentType, - Flags aFlags = NoFlags); + Flags aFlags = NoFlags, + ImageFormat aImageFormat = gfxImageFormat::Unknown); // Protected destructor, to discourage deletion outside of Release(): virtual ~TextureImage() {} @@ -257,13 +245,6 @@ class BasicTextureImage public: virtual ~BasicTextureImage(); - BasicTextureImage(GLuint aTexture, - const nsIntSize& aSize, - GLenum aWrapMode, - ContentType aContentType, - GLContext* aContext, - TextureImage::Flags aFlags = TextureImage::NoFlags, - TextureImage::ImageFormat aImageFormat = gfxImageFormat::Unknown); BasicTextureImage(GLuint aTexture, const gfx::IntSize& aSize, GLenum aWrapMode, diff --git a/gfx/layers/Compositor.h b/gfx/layers/Compositor.h index 30c7a9f0b7..5f8113d433 100644 --- a/gfx/layers/Compositor.h +++ b/gfx/layers/Compositor.h @@ -106,7 +106,6 @@ */ class nsIWidget; -struct nsIntSize; class nsIntRegion; namespace mozilla { diff --git a/gfx/layers/LayerScope.h b/gfx/layers/LayerScope.h index 9a871371e9..18aa89fdd5 100644 --- a/gfx/layers/LayerScope.h +++ b/gfx/layers/LayerScope.h @@ -10,8 +10,6 @@ #include #include -struct nsIntSize; - namespace mozilla { namespace gl { class GLContext; } diff --git a/gfx/layers/LayersLogging.cpp b/gfx/layers/LayersLogging.cpp index 1cfa8250ba..3978ce21a4 100644 --- a/gfx/layers/LayersLogging.cpp +++ b/gfx/layers/LayersLogging.cpp @@ -164,15 +164,6 @@ AppendToString(std::stringstream& aStream, const EventRegions& e, aStream << "}" << sfx; } -void -AppendToString(std::stringstream& aStream, const nsIntSize& sz, - const char* pfx, const char* sfx) -{ - aStream << pfx; - aStream << nsPrintfCString("(w=%d, h=%d)", sz.width, sz.height).get(); - aStream << sfx; -} - void AppendToString(std::stringstream& aStream, const FrameMetrics& m, const char* pfx, const char* sfx, bool detailed) diff --git a/gfx/layers/LayersLogging.h b/gfx/layers/LayersLogging.h index c030090c7e..640f19ec92 100644 --- a/gfx/layers/LayersLogging.h +++ b/gfx/layers/LayersLogging.h @@ -19,7 +19,6 @@ struct gfxRGBA; struct nsIntPoint; struct nsIntRect; -struct nsIntSize; namespace mozilla { namespace gfx { @@ -113,10 +112,6 @@ void AppendToString(std::stringstream& aStream, const EventRegions& e, const char* pfx="", const char* sfx=""); -void -AppendToString(std::stringstream& aStream, const nsIntSize& sz, - const char* pfx="", const char* sfx=""); - void AppendToString(std::stringstream& aStream, const FrameMetrics& m, const char* pfx="", const char* sfx="", bool detailed = false); diff --git a/gfx/layers/LayersTypes.h b/gfx/layers/LayersTypes.h index e60a80fa2b..627e72a86f 100644 --- a/gfx/layers/LayersTypes.h +++ b/gfx/layers/LayersTypes.h @@ -15,21 +15,15 @@ #ifdef MOZ_WIDGET_GONK #include #endif -#if defined(DEBUG) || defined(PR_LOGGING) -# include // FILE -# include "prlog.h" // for PR_LOG -# ifndef MOZ_LAYERS_HAVE_LOG -# define MOZ_LAYERS_HAVE_LOG -# endif -# define MOZ_LAYERS_LOG(_args) \ +#include // FILE +#include "prlog.h" // for PR_LOG +#ifndef MOZ_LAYERS_HAVE_LOG +# define MOZ_LAYERS_HAVE_LOG +#endif +#define MOZ_LAYERS_LOG(_args) \ PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args) -# define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args) \ +#define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args) \ do { if (layer->AsShadowableLayer()) { PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args); } } while (0) -#else -struct PRLogModuleInfo; -# define MOZ_LAYERS_LOG(_args) -# define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args) -#endif // if defined(DEBUG) || defined(PR_LOGGING) #define INVALID_OVERLAY -1 diff --git a/gfx/layers/RotatedBuffer.h b/gfx/layers/RotatedBuffer.h index 7f602e28fc..c13f3432a8 100644 --- a/gfx/layers/RotatedBuffer.h +++ b/gfx/layers/RotatedBuffer.h @@ -21,8 +21,6 @@ #include "nsRegion.h" // for nsIntRegion #include "LayersTypes.h" -struct nsIntSize; - namespace mozilla { namespace gfx { class Matrix; @@ -389,7 +387,7 @@ protected: * buffer provider. */ gfxContentType BufferContentType(); - bool BufferSizeOkFor(const nsIntSize& aSize); + bool BufferSizeOkFor(const gfx::IntSize& aSize); /** * If the buffer hasn't been mapped, map it. */ diff --git a/gfx/layers/client/ClientLayerManager.cpp b/gfx/layers/client/ClientLayerManager.cpp index 19eac9f4c5..4d27bc92d9 100644 --- a/gfx/layers/client/ClientLayerManager.cpp +++ b/gfx/layers/client/ClientLayerManager.cpp @@ -476,7 +476,7 @@ ClientLayerManager::MakeSnapshotIfRequired() SurfaceDescriptor inSnapshot; if (!bounds.IsEmpty() && - mForwarder->AllocSurfaceDescriptor(bounds.Size().ToIntSize(), + mForwarder->AllocSurfaceDescriptor(bounds.Size(), gfxContentType::COLOR_ALPHA, &inSnapshot) && remoteRenderer->SendMakeSnapshot(inSnapshot, bounds)) { diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 9a9cad5287..c98fe5daa9 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -59,8 +59,6 @@ #include "TextRenderer.h" // for TextRenderer class gfxContext; -struct nsIntSize; - namespace mozilla { namespace layers { diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index ccb706c960..e91a0d5d69 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -31,8 +31,6 @@ #include "LayerTreeInvalidation.h" class gfxContext; -struct nsIntPoint; -struct nsIntSize; #ifdef XP_WIN #include diff --git a/gfx/layers/composite/TextureHost.h b/gfx/layers/composite/TextureHost.h index 8039f0c976..8c39083c30 100644 --- a/gfx/layers/composite/TextureHost.h +++ b/gfx/layers/composite/TextureHost.h @@ -30,8 +30,6 @@ #include "mozilla/layers/AtomicRefCountedWithFinalize.h" class gfxReusableSurfaceWrapper; -struct nsIntPoint; -struct nsIntSize; struct nsIntRect; namespace mozilla { diff --git a/gfx/layers/composite/TiledContentHost.h b/gfx/layers/composite/TiledContentHost.h index 7a5e452383..b5efd4d78d 100644 --- a/gfx/layers/composite/TiledContentHost.h +++ b/gfx/layers/composite/TiledContentHost.h @@ -34,7 +34,6 @@ class gfxReusableSurfaceWrapper; struct nsIntPoint; struct nsIntRect; -struct nsIntSize; namespace mozilla { namespace gfx { @@ -305,7 +304,7 @@ private: const gfx::Rect& aClipRect, const nsIntRegion& aScreenRegion, const nsIntPoint& aTextureOffset, - const nsIntSize& aTextureBounds); + const gfx::IntSize& aTextureBounds); void EnsureTileStore() {} diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index e3a4c1fb76..4d22a3bcd0 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -1234,7 +1234,7 @@ CompositorD3D11::UpdateRenderTarget() } mDefaultRT = new CompositingRenderTargetD3D11(backBuf, IntPoint(0, 0)); - mDefaultRT->SetSize(mSize.ToIntSize()); + mDefaultRT->SetSize(mSize); } bool diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 3547263607..2115f68a2f 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -625,11 +625,9 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray&& cset, severity = 1.f; } mLayerManager->VisualFrameWarning(severity); -#ifdef PR_LOGGING PR_LogPrint("LayerTransactionParent::RecvUpdate transaction from process %d took %f ms", OtherPid(), latency.ToMilliseconds()); -#endif } } diff --git a/gfx/layers/ipc/LayersSurfaces.ipdlh b/gfx/layers/ipc/LayersSurfaces.ipdlh index a8de2948af..6a3dd29314 100644 --- a/gfx/layers/ipc/LayersSurfaces.ipdlh +++ b/gfx/layers/ipc/LayersSurfaces.ipdlh @@ -5,7 +5,6 @@ using struct gfxPoint from "gfxPoint.h"; using struct nsIntRect from "nsRect.h"; using nsIntRegion from "nsRegion.h"; -using struct nsIntSize from "nsSize.h"; using struct mozilla::layers::MagicGrallocBufferHandle from "gfxipc/ShadowLayerUtils.h"; using struct mozilla::layers::GrallocBufferRef from "gfxipc/ShadowLayerUtils.h"; using struct mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h"; diff --git a/gfx/layers/ipc/ShadowLayerUtilsX11.cpp b/gfx/layers/ipc/ShadowLayerUtilsX11.cpp index ae130704f2..8fa9a53f0a 100644 --- a/gfx/layers/ipc/ShadowLayerUtilsX11.cpp +++ b/gfx/layers/ipc/ShadowLayerUtilsX11.cpp @@ -64,7 +64,7 @@ GetXRenderPictFormatFromId(Display* aDisplay, PictFormat aFormatId) SurfaceDescriptorX11::SurfaceDescriptorX11(gfxXlibSurface* aSurf) : mId(aSurf->XDrawable()) - , mSize(aSurf->GetSize().ToIntSize()) + , mSize(aSurf->GetSize()) { const XRenderPictFormat *pictFormat = aSurf->XRenderFormat(); if (pictFormat) { diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 5ad60b8e8b..4d1794f4fc 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -280,15 +280,15 @@ TextureImageTextureSourceOGL::EnsureBuffer(const nsIntSize& aSize, gfxContentType aContentType) { if (!mTexImage || - mTexImage->GetSize() != aSize.ToIntSize() || + mTexImage->GetSize() != aSize || mTexImage->GetContentType() != aContentType) { mTexImage = CreateTextureImage(mCompositor->gl(), - aSize.ToIntSize(), + aSize, aContentType, LOCAL_GL_CLAMP_TO_EDGE, FlagsToGLFlags(mFlags)); } - mTexImage->Resize(aSize.ToIntSize()); + mTexImage->Resize(aSize); } void diff --git a/gfx/layers/opengl/TextureHostOGL.h b/gfx/layers/opengl/TextureHostOGL.h index 25c391ab6d..e0baed0b4f 100644 --- a/gfx/layers/opengl/TextureHostOGL.h +++ b/gfx/layers/opengl/TextureHostOGL.h @@ -41,7 +41,6 @@ class gfxReusableSurfaceWrapper; class nsIntRegion; struct nsIntPoint; struct nsIntRect; -struct nsIntSize; namespace mozilla { namespace gfx { @@ -202,8 +201,8 @@ public: nsIntRegion* aDestRegion = nullptr, gfx::IntPoint* aSrcOffset = nullptr) override; - void EnsureBuffer(const nsIntSize& aSize, - gfxContentType aContentType); + void EnsureBuffer(const gfx::IntSize& aSize, + gfxContentType aContentType); void CopyTo(const nsIntRect& aSourceRect, DataTextureSource* aDest, diff --git a/gfx/src/nsITheme.h b/gfx/src/nsITheme.h index 9263251a2b..ff46778683 100644 --- a/gfx/src/nsITheme.h +++ b/gfx/src/nsITheme.h @@ -12,10 +12,10 @@ #include "nsISupports.h" #include "nsCOMPtr.h" #include "nsColor.h" +#include "nsSize.h" struct nsRect; struct nsIntRect; -struct nsIntSize; class nsIntRegion; struct nsFont; struct nsIntMargin; diff --git a/gfx/src/nsSize.h b/gfx/src/nsSize.h index f56cc735b6..7d6d5c1c3b 100644 --- a/gfx/src/nsSize.h +++ b/gfx/src/nsSize.h @@ -13,7 +13,7 @@ // Maximum allowable size #define NS_MAXSIZE nscoord_MAX -struct nsIntSize; +typedef mozilla::gfx::IntSize nsIntSize; typedef nsIntSize gfxIntSize; struct nsSize : public mozilla::gfx::BaseSize { @@ -30,19 +30,6 @@ struct nsSize : public mozilla::gfx::BaseSize { inline nsSize ConvertAppUnits(int32_t aFromAPP, int32_t aToAPP) const; }; -struct nsIntSize : public mozilla::gfx::BaseSize { - typedef mozilla::gfx::BaseSize Super; - - nsIntSize() : Super() {} - nsIntSize(int32_t aWidth, int32_t aHeight) : Super(aWidth, aHeight) {} - - inline nsSize ToAppUnits(nscoord aAppUnitsPerPixel) const; - mozilla::gfx::IntSize ToIntSize() const - { - return mozilla::gfx::IntSize(width, height); - }; -}; - inline nsIntSize nsSize::ScaleToNearestPixels(float aXScale, float aYScale, nscoord aAppUnitsPerPixel) const @@ -70,10 +57,10 @@ nsSize::ConvertAppUnits(int32_t aFromAPP, int32_t aToAPP) const { } inline nsSize -nsIntSize::ToAppUnits(nscoord aAppUnitsPerPixel) const +IntSizeToAppUnits(mozilla::gfx::IntSize aSize, nscoord aAppUnitsPerPixel) { - return nsSize(NSIntPixelsToAppUnits(width, aAppUnitsPerPixel), - NSIntPixelsToAppUnits(height, aAppUnitsPerPixel)); + return nsSize(NSIntPixelsToAppUnits(aSize.width, aAppUnitsPerPixel), + NSIntPixelsToAppUnits(aSize.height, aAppUnitsPerPixel)); } #endif /* NSSIZE_H */ diff --git a/gfx/tests/gtest/TestTextures.cpp b/gfx/tests/gtest/TestTextures.cpp index c22052a869..34e80b4d91 100644 --- a/gfx/tests/gtest/TestTextures.cpp +++ b/gfx/tests/gtest/TestTextures.cpp @@ -297,9 +297,9 @@ TEST(Layers, TextureYCbCrSerialization) { clientData.mYChannel = ySurface->Data(); clientData.mCbChannel = cbSurface->Data(); clientData.mCrChannel = crSurface->Data(); - clientData.mYSize = ySurface->GetSize().ToIntSize(); - clientData.mPicSize = ySurface->GetSize().ToIntSize(); - clientData.mCbCrSize = cbSurface->GetSize().ToIntSize(); + clientData.mYSize = ySurface->GetSize(); + clientData.mPicSize = ySurface->GetSize(); + clientData.mCbCrSize = cbSurface->GetSize(); clientData.mYStride = ySurface->Stride(); clientData.mCbCrStride = cbSurface->Stride(); clientData.mStereoMode = StereoMode::MONO; diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 26ef1d1bdf..372dbcfeea 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -212,7 +212,6 @@ gfxDWriteFontFamily::FindStyleVariations(FontInfoData *aFontInfoData) } } -#ifdef PR_LOGGING if (LOG_FONTLIST_ENABLED()) { LOG_FONTLIST(("(fontlist) added (%s) to family (%s)" " with style: %s weight: %d stretch: %d psname: %s fullname: %s", @@ -223,7 +222,6 @@ gfxDWriteFontFamily::FindStyleVariations(FontInfoData *aFontInfoData) NS_ConvertUTF16toUTF8(psname).get(), NS_ConvertUTF16toUTF8(fullname).get())); } -#endif } // assume that if no error, all postscript/fullnames were initialized @@ -548,7 +546,6 @@ gfxDWriteFontEntry::ReadCMAP(FontInfoData *aFontInfoData) mCharacterMap = new gfxCharacterMap(); } -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n", NS_ConvertUTF16toUTF8(mName).get(), charmap->SizeOfIncludingThis(moz_malloc_size_of), @@ -559,7 +556,6 @@ gfxDWriteFontEntry::ReadCMAP(FontInfoData *aFontInfoData) NS_ConvertUTF16toUTF8(mName).get()); charmap->Dump(prefix, eGfxLog_cmapdata); } -#endif return rv; } @@ -1019,7 +1015,6 @@ gfxDWriteFontList::DelayedInitFontList() faces[i]->mFamilyName = gillSansMTFamily->Name(); gillSansMTFamily->AddFontEntry(faces[i]); -#ifdef PR_LOGGING if (LOG_FONTLIST_ENABLED()) { gfxFontEntry *fe = faces[i]; LOG_FONTLIST(("(fontlist) moved (%s) to family (%s)" @@ -1029,7 +1024,6 @@ gfxDWriteFontList::DelayedInitFontList() (fe->IsItalic()) ? "italic" : "normal", fe->Weight(), fe->Stretch())); } -#endif } // remove Gills Sans diff --git a/gfx/thebes/gfxDrawable.cpp b/gfx/thebes/gfxDrawable.cpp index 7bcc6c9af7..3cadd85201 100644 --- a/gfx/thebes/gfxDrawable.cpp +++ b/gfx/thebes/gfxDrawable.cpp @@ -123,7 +123,7 @@ gfxCallbackDrawable::MakeSurfaceDrawable(const GraphicsFilter aFilter) SurfaceFormat format = gfxPlatform::GetPlatform()->Optimal2DFormatForContent(gfxContentType::COLOR_ALPHA); RefPtr dt = - gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(mSize.ToIntSize(), + gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(mSize, format); if (!dt) return nullptr; diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index 32b67fc7e6..789bc9cc9c 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -50,7 +50,6 @@ using namespace mozilla; -#ifdef PR_LOGGING static PRLogModuleInfo * GetFontInfoLog() { @@ -59,7 +58,6 @@ GetFontInfoLog() sLog = PR_NewLogModule("fontInfoLog"); return sLog; } -#endif /* PR_LOGGING */ #undef LOG #define LOG(args) PR_LOG(GetFontInfoLog(), PR_LOG_DEBUG, args) @@ -1060,7 +1058,6 @@ gfxFT2FontList::AddFaceToList(const nsCString& aEntryName, uint32_t aIndex, fe->CheckForBrokenFont(family); AppendToFaceList(aFaceList, name, fe); -#ifdef PR_LOGGING if (LOG_ENABLED()) { LOG(("(fontinit) added (%s) to family (%s)" " with style: %s weight: %d stretch: %d", @@ -1069,7 +1066,6 @@ gfxFT2FontList::AddFaceToList(const nsCString& aEntryName, uint32_t aIndex, fe->IsItalic() ? "italic" : "normal", fe->Weight(), fe->Stretch())); } -#endif } } diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 061825076d..d6d7e263e9 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -72,13 +72,11 @@ uint32_t gGlyphExtentsSetupLazyTight = 0; uint32_t gGlyphExtentsSetupFallBackToTight = 0; #endif -#ifdef PR_LOGGING #define LOG_FONTINIT(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \ PR_LOG_DEBUG, args) #define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \ gfxPlatform::GetLog(eGfxLog_fontinit), \ PR_LOG_DEBUG) -#endif // PR_LOGGING /* @@ -1082,13 +1080,11 @@ gfxFont::CheckForFeaturesInvolvingSpace() { mFontEntry->mHasSpaceFeaturesInitialized = true; -#ifdef PR_LOGGING bool log = LOG_FONTINIT_ENABLED(); TimeStamp start; if (MOZ_UNLIKELY(log)) { start = TimeStamp::Now(); } -#endif bool result = false; @@ -1185,7 +1181,6 @@ gfxFont::CheckForFeaturesInvolvingSpace() hb_face_destroy(face); mFontEntry->mHasSpaceFeatures = result; -#ifdef PR_LOGGING if (MOZ_UNLIKELY(log)) { TimeDuration elapsed = TimeStamp::Now() - start; LOG_FONTINIT(( @@ -1207,7 +1202,6 @@ gfxFont::CheckForFeaturesInvolvingSpace() elapsed.ToMilliseconds() )); } -#endif } bool diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index d73910afe9..55dbf14a0d 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -1495,7 +1495,7 @@ gfxFontFamily::FindFontForChar(GlobalFontMatch *aMatchData) if (fe->HasCharacter(aMatchData->mCh)) { rank += RANK_MATCHED_CMAP; aMatchData->mCount++; -#ifdef PR_LOGGING + PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun); if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_DEBUG))) { @@ -1508,7 +1508,6 @@ gfxFontFamily::FindFontForChar(GlobalFontMatch *aMatchData) unicodeRange, script, NS_ConvertUTF16toUTF8(fe->Name()).get())); } -#endif } aMatchData->mCmapsTested++; diff --git a/gfx/thebes/gfxFontUtils.cpp b/gfx/thebes/gfxFontUtils.cpp index 6517a4cc92..e00045b633 100644 --- a/gfx/thebes/gfxFontUtils.cpp +++ b/gfx/thebes/gfxFontUtils.cpp @@ -25,13 +25,9 @@ #include "plbase64.h" #include "prlog.h" -#ifdef PR_LOGGING - #define LOG(log, args) PR_LOG(gfxPlatform::GetLog(log), \ PR_LOG_DEBUG, args) -#endif // PR_LOGGING - #define UNICODE_BMP_LIMIT 0x10000 using namespace mozilla; @@ -63,7 +59,6 @@ typedef struct { #pragma pack() -#if PR_LOGGING void gfxSparseBitSet::Dump(const char* aPrefix, eGfxLog aWhichLog) const { @@ -91,7 +86,6 @@ gfxSparseBitSet::Dump(const char* aPrefix, eGfxLog aWhichLog) const LOG(aWhichLog, ("%s", outStr)); } } -#endif nsresult gfxFontUtils::ReadCMAPTableFormat10(const uint8_t *aBuf, uint32_t aLength, diff --git a/gfx/thebes/gfxFontUtils.h b/gfx/thebes/gfxFontUtils.h index d81cc16062..88e975d7bf 100644 --- a/gfx/thebes/gfxFontUtils.h +++ b/gfx/thebes/gfxFontUtils.h @@ -81,10 +81,8 @@ public: return ((block->mBits[(aIndex>>3) & (BLOCK_SIZE - 1)]) & (1 << (aIndex & 0x7))) != 0; } -#if PR_LOGGING // dump out contents of bitmap void Dump(const char* aPrefix, eGfxLog aWhichLog) const; -#endif bool TestRange(uint32_t aStart, uint32_t aEnd) { uint32_t startBlock, endBlock, blockLen; diff --git a/gfx/thebes/gfxGDIFontList.cpp b/gfx/thebes/gfxGDIFontList.cpp index 1ac1e17a2b..f046734cbe 100644 --- a/gfx/thebes/gfxGDIFontList.cpp +++ b/gfx/thebes/gfxGDIFontList.cpp @@ -40,7 +40,6 @@ using namespace mozilla; #define CLEARTYPE_QUALITY 5 #endif -#ifdef PR_LOGGING #define LOG_FONTLIST(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \ PR_LOG_DEBUG, args) #define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \ @@ -51,8 +50,6 @@ using namespace mozilla; gfxPlatform::GetLog(eGfxLog_cmapdata), \ PR_LOG_DEBUG) -#endif // PR_LOGGING - static __inline void BuildKeyNameFromFontName(nsAString &aName) { @@ -195,7 +192,6 @@ GDIFontEntry::ReadCMAP(FontInfoData *aFontInfoData) mCharacterMap->mBuildOnTheFly = true; } -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n", NS_ConvertUTF16toUTF8(mName).get(), charmap->SizeOfIncludingThis(moz_malloc_size_of), @@ -206,7 +202,6 @@ GDIFontEntry::ReadCMAP(FontInfoData *aFontInfoData) NS_ConvertUTF16toUTF8(mName).get()); charmap->Dump(prefix, eGfxLog_cmapdata); } -#endif return rv; } @@ -501,7 +496,6 @@ GDIFontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe, } } -#ifdef PR_LOGGING if (LOG_FONTLIST_ENABLED()) { LOG_FONTLIST(("(fontlist) added (%s) to family (%s)" " with style: %s weight: %d stretch: %d", @@ -510,7 +504,6 @@ GDIFontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe, (logFont.lfItalic == 0xff) ? "italic" : "normal", logFont.lfWeight, fe->Stretch())); } -#endif return 1; } diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index 62e6fa02b0..c73d966c6e 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -129,8 +129,6 @@ static NSString* GetNSStringForString(const nsAString& aSrc) length:aSrc.Length()]; } -#ifdef PR_LOGGING - #define LOG_FONTLIST(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \ PR_LOG_DEBUG, args) #define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \ @@ -140,8 +138,6 @@ static NSString* GetNSStringForString(const nsAString& aSrc) gfxPlatform::GetLog(eGfxLog_cmapdata), \ PR_LOG_DEBUG) -#endif // PR_LOGGING - #pragma mark- // Complex scripts will not render correctly unless appropriate AAT or OT @@ -255,7 +251,6 @@ MacOSFontEntry::ReadCMAP(FontInfoData *aFontInfoData) mCharacterMap = new gfxCharacterMap(); } -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n", NS_ConvertUTF16toUTF8(mName).get(), charmap->SizeOfIncludingThis(moz_malloc_size_of), @@ -266,7 +261,6 @@ MacOSFontEntry::ReadCMAP(FontInfoData *aFontInfoData) NS_ConvertUTF16toUTF8(mName).get()); charmap->Dump(prefix, eGfxLog_cmapdata); } -#endif return rv; } @@ -529,7 +523,6 @@ gfxMacFontFamily::FindStyleVariations(FontInfoData *aFontInfoData) fontEntry->mFixedPitch = true; } -#ifdef PR_LOGGING if (LOG_FONTLIST_ENABLED()) { LOG_FONTLIST(("(fontlist) added (%s) to family (%s)" " with style: %s weight: %d stretch: %d" @@ -540,7 +533,6 @@ gfxMacFontFamily::FindStyleVariations(FontInfoData *aFontInfoData) cssWeight, fontEntry->Stretch(), appKitWeight, macTraits)); } -#endif // insert into font entry array of family AddFontEntry(fontEntry); @@ -739,10 +731,8 @@ gfxMacPlatformFontList::InitSingleFaceList() uint32_t numFonts = singleFaceFonts.Length(); for (uint32_t i = 0; i < numFonts; i++) { -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-singleface) face name: %s\n", NS_ConvertUTF16toUTF8(singleFaceFonts[i]).get())); -#endif gfxFontEntry *fontEntry = LookupLocalFont(singleFaceFonts[i], 400, 0, NS_FONT_STYLE_NORMAL); @@ -750,11 +740,9 @@ gfxMacPlatformFontList::InitSingleFaceList() nsAutoString familyName, key; familyName = singleFaceFonts[i]; GenerateFontListKey(familyName, key); -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-singleface) family name: %s, key: %s\n", NS_ConvertUTF16toUTF8(familyName).get(), NS_ConvertUTF16toUTF8(key).get())); -#endif // add only if doesn't exist already if (!mFontFamilies.GetWeak(key)) { @@ -765,11 +753,9 @@ gfxMacPlatformFontList::InitSingleFaceList() familyEntry->AddFontEntry(fontEntry); familyEntry->SetHasStyles(true); mFontFamilies.Put(key, familyEntry); -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-singleface) added new family\n", NS_ConvertUTF16toUTF8(familyName).get(), NS_ConvertUTF16toUTF8(key).get())); -#endif } } } diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index d71dc1987c..692327b0f7 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2126,7 +2126,6 @@ PRLogModuleInfo* gfxPlatform::GetLog(eGfxLog aWhichLog) { // logs shared across gfx -#ifdef PR_LOGGING static PRLogModuleInfo *sFontlistLog = nullptr; static PRLogModuleInfo *sFontInitLog = nullptr; static PRLogModuleInfo *sTextrunLog = nullptr; @@ -2168,9 +2167,6 @@ gfxPlatform::GetLog(eGfxLog aWhichLog) } return nullptr; -#else - return nullptr; -#endif } int diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index eac248f483..4e694ad604 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -23,8 +23,6 @@ using namespace mozilla; -#ifdef PR_LOGGING - #define LOG_FONTLIST(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \ PR_LOG_DEBUG, args) #define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \ @@ -36,8 +34,6 @@ using namespace mozilla; gfxPlatform::GetLog(eGfxLog_fontinit), \ PR_LOG_DEBUG) -#endif // PR_LOGGING - gfxPlatformFontList *gfxPlatformFontList::sPlatformFontList = nullptr; // Character ranges that require complex-script shaping support in the font, @@ -268,14 +264,12 @@ gfxPlatformFontList::InitOtherFamilyNames() Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITOTHERFAMILYNAMES, start, end); -#ifdef PR_LOGGING if (LOG_FONTINIT_ENABLED()) { TimeDuration elapsed = end - start; LOG_FONTINIT(("(fontinit) InitOtherFamilyNames took %8.2f ms %s", elapsed.ToMilliseconds(), (otherNamesData.mTimedOut ? "timeout" : ""))); } -#endif } #define OTHERNAMES_TIMEOUT 200 @@ -328,7 +322,6 @@ gfxPlatformFontList::SearchFamiliesForFaceName(const nsAString& aFaceName) TimeStamp end = TimeStamp::Now(); Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITFACENAMELISTS, start, end); -#ifdef PR_LOGGING if (LOG_FONTINIT_ENABLED()) { TimeDuration elapsed = end - start; LOG_FONTINIT(("(fontinit) SearchFamiliesForFaceName took %8.2f ms %s %s", @@ -336,7 +329,6 @@ gfxPlatformFontList::SearchFamiliesForFaceName(const nsAString& aFaceName) (lookup ? "found name" : ""), (faceNameListsData.mTimedOut ? "timeout" : ""))); } -#endif return lookup; } @@ -586,7 +578,6 @@ gfxPlatformFontList::SystemFindFontForChar(uint32_t aCh, uint32_t aNextCh, } TimeDuration elapsed = TimeStamp::Now() - start; -#ifdef PR_LOGGING PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun); if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) { @@ -603,7 +594,6 @@ gfxPlatformFontList::SystemFindFontForChar(uint32_t aCh, uint32_t aNextCh, int32_t(elapsed.ToMicroseconds()), cmapCount)); } -#endif // no match? add to set of non-matching codepoints if (!fontEntry) { @@ -819,12 +809,10 @@ gfxPlatformFontList::AddOtherFamilyName(gfxFontFamily *aFamilyEntry, nsAString& if (!mOtherFamilyNames.GetWeak(key)) { mOtherFamilyNames.Put(key, aFamilyEntry); -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-otherfamily) canonical family: %s, " "other family: %s\n", NS_ConvertUTF16toUTF8(aFamilyEntry->Name()).get(), NS_ConvertUTF16toUTF8(aOtherFamilyName).get())); -#endif if (mBadUnderlineFamilyNames.Contains(key)) aFamilyEntry->SetBadUnderlineFamily(); } @@ -835,11 +823,9 @@ gfxPlatformFontList::AddFullname(gfxFontEntry *aFontEntry, nsAString& aFullname) { if (!mExtraNames->mFullnames.GetWeak(aFullname)) { mExtraNames->mFullnames.Put(aFullname, aFontEntry); -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-fullname) name: %s, fullname: %s\n", NS_ConvertUTF16toUTF8(aFontEntry->Name()).get(), NS_ConvertUTF16toUTF8(aFullname).get())); -#endif } } @@ -848,11 +834,9 @@ gfxPlatformFontList::AddPostscriptName(gfxFontEntry *aFontEntry, nsAString& aPos { if (!mExtraNames->mPostscriptNames.GetWeak(aPostscriptName)) { mExtraNames->mPostscriptNames.Put(aPostscriptName, aFontEntry); -#ifdef PR_LOGGING LOG_FONTLIST(("(fontlist-postscript) name: %s, psname: %s\n", NS_ConvertUTF16toUTF8(aFontEntry->Name()).get(), NS_ConvertUTF16toUTF8(aPostscriptName).get())); -#endif } } @@ -968,13 +952,11 @@ gfxPlatformFontList::LoadFontInfo() mStartIndex = endIndex; bool done = mStartIndex >= mNumFamilies; -#ifdef PR_LOGGING if (LOG_FONTINIT_ENABLED()) { TimeDuration elapsed = TimeStamp::Now() - start; LOG_FONTINIT(("(fontinit) fontloader load pass %8.2f ms done %s\n", elapsed.ToMilliseconds(), (done ? "true" : "false"))); } -#endif if (done) { mOtherFamilyNamesInitialized = true; @@ -1058,7 +1040,6 @@ gfxPlatformFontList::CleanupLoader() } } -#ifdef PR_LOGGING if (LOG_FONTINIT_ENABLED() && mFontInfo) { LOG_FONTINIT(("(fontinit) fontloader load thread took %8.2f ms " "%d families %d fonts %d cmaps " @@ -1072,7 +1053,6 @@ gfxPlatformFontList::CleanupLoader() (rebuilt ? "(userfont sets rebuilt)" : ""), (forceReflow ? "(global reflow)" : ""))); } -#endif gfxFontInfoLoader::CleanupLoader(); } diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index 64b578b8a5..9b861b41ea 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -2198,11 +2198,9 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, } } -#ifdef PR_LOGGING PRLogModuleInfo *log = (mStyle.systemFont ? gfxPlatform::GetLog(eGfxLog_textrunui) : gfxPlatform::GetLog(eGfxLog_textrun)); -#endif // variant fallback handling may end up passing through this twice bool redo; @@ -2211,7 +2209,6 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, if (sizeof(T) == sizeof(uint8_t) && !transformedString) { -#ifdef PR_LOGGING if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) { nsAutoCString lang; mStyle.language->ToUTF8String(lang); @@ -2237,7 +2234,6 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, sizeof(T), str.get())); } -#endif // the text is still purely 8-bit; bypass the script-run itemizer // and treat it as a single Latin run @@ -2261,7 +2257,6 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, int32_t runScript = MOZ_SCRIPT_LATIN; while (scriptRuns.Next(runStart, runLimit, runScript)) { - #ifdef PR_LOGGING if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) { nsAutoCString lang; mStyle.language->ToUTF8String(lang); @@ -2287,7 +2282,6 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, sizeof(T), NS_ConvertUTF16toUTF8(textPtr + runStart, runLen).get())); } - #endif InitScriptRun(aContext, aTextRun, textPtr + runStart, runStart, runLimit - runStart, runScript, aMFR); diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index 3c045f30f3..a0234e5c9e 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -24,7 +24,6 @@ using namespace mozilla; -#ifdef PR_LOGGING PRLogModuleInfo* gfxUserFontSet::GetUserFontsLog() { @@ -33,7 +32,6 @@ gfxUserFontSet::GetUserFontsLog() sLog = PR_NewLogModule("userfonts"); return sLog; } -#endif /* PR_LOGGING */ #define LOG(args) PR_LOG(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG, args) #define LOG_ENABLED() PR_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG) @@ -506,7 +504,6 @@ gfxUserFontEntry::LoadNextSrc() bool loadOK = NS_SUCCEEDED(rv); if (loadOK) { -#ifdef PR_LOGGING if (LOG_ENABLED()) { nsAutoCString fontURI; currSrc.mURI->GetSpec(fontURI); @@ -514,7 +511,6 @@ gfxUserFontEntry::LoadNextSrc() mFontSet, mSrcIndex, fontURI.get(), NS_ConvertUTF16toUTF8(mFamilyName).get())); } -#endif return; } else { mFontSet->LogMessage(this, @@ -651,7 +647,6 @@ gfxUserFontEntry::LoadPlatformFont(const uint8_t* aFontData, uint32_t& aLength) fe->mFamilyName = mFamilyName; StoreUserFontData(fe, mFontSet->GetPrivateBrowsing(), originalFullName, &metadata, metaOrigLen, compression); -#ifdef PR_LOGGING if (LOG_ENABLED()) { nsAutoCString fontURI; mSrcList[mSrcIndex].mURI->GetSpec(fontURI); @@ -661,12 +656,10 @@ gfxUserFontEntry::LoadPlatformFont(const uint8_t* aFontData, uint32_t& aLength) this, uint32_t(mFontSet->mGeneration))); } -#endif mPlatformFontEntry = fe; SetLoadState(STATUS_LOADED); gfxUserFontSet::UserFontCache::CacheFont(fe); } else { -#ifdef PR_LOGGING if (LOG_ENABLED()) { nsAutoCString fontURI; mSrcList[mSrcIndex].mURI->GetSpec(fontURI); @@ -675,7 +668,6 @@ gfxUserFontEntry::LoadPlatformFont(const uint8_t* aFontData, uint32_t& aLength) mFontSet, mSrcIndex, fontURI.get(), NS_ConvertUTF16toUTF8(mFamilyName).get())); } -#endif } // The downloaded data can now be discarded; the font entry is using the @@ -853,7 +845,6 @@ gfxUserFontSet::AddUserFontEntry(const nsAString& aFamilyName, gfxUserFontFamily* family = GetFamily(aFamilyName); family->AddFontEntry(aUserFontEntry); -#ifdef PR_LOGGING if (LOG_ENABLED()) { LOG(("userfonts (%p) added to \"%s\" (%p) style: %s weight: %d " "stretch: %d", @@ -861,7 +852,6 @@ gfxUserFontSet::AddUserFontEntry(const nsAString& aFamilyName, (aUserFontEntry->IsItalic() ? "italic" : "normal"), aUserFontEntry->Weight(), aUserFontEntry->Stretch())); } -#endif } gfxUserFontEntry* diff --git a/gfx/thebes/gfxUserFontSet.h b/gfx/thebes/gfxUserFontSet.h index 75245f9490..df2d2833d1 100644 --- a/gfx/thebes/gfxUserFontSet.h +++ b/gfx/thebes/gfxUserFontSet.h @@ -467,9 +467,7 @@ public: mLocalRulesUsed = true; } -#ifdef PR_LOGGING static PRLogModuleInfo* GetUserFontsLog(); -#endif protected: // Protected destructor, to discourage deletion outside of Release(): diff --git a/gfx/thebes/gfxXlibNativeRenderer.h b/gfx/thebes/gfxXlibNativeRenderer.h index a6e816b571..e355fe62e4 100644 --- a/gfx/thebes/gfxXlibNativeRenderer.h +++ b/gfx/thebes/gfxXlibNativeRenderer.h @@ -20,7 +20,6 @@ class gfxASurface; class gfxContext; struct nsIntRect; struct nsIntPoint; -struct nsIntSize; typedef struct _cairo cairo_t; typedef struct _cairo_surface cairo_surface_t; @@ -82,18 +81,18 @@ public: * successful, a pointer to the new gfxASurface is stored in *resultSurface, * otherwise *resultSurface is set to nullptr. */ - void Draw(gfxContext* ctx, nsIntSize size, + void Draw(gfxContext* ctx, mozilla::gfx::IntSize size, uint32_t flags, Screen *screen, Visual *visual); private: - bool DrawDirect(gfxContext *ctx, nsIntSize bounds, + bool DrawDirect(gfxContext *ctx, mozilla::gfx::IntSize bounds, uint32_t flags, Screen *screen, Visual *visual); - bool DrawCairo(cairo_t* cr, nsIntSize size, + bool DrawCairo(cairo_t* cr, mozilla::gfx::IntSize size, uint32_t flags, Screen *screen, Visual *visual); void DrawFallback(mozilla::gfx::DrawTarget* dt, gfxContext* ctx, - gfxASurface* aSurface, nsIntSize& size, + gfxASurface* aSurface, mozilla::gfx::IntSize& size, nsIntRect& drawingRect, bool canDrawOverBackground, uint32_t flags, Screen* screen, Visual* visual); diff --git a/image/DecodePool.h b/image/DecodePool.h index 64954682d2..0b26fd0a47 100644 --- a/image/DecodePool.h +++ b/image/DecodePool.h @@ -23,7 +23,6 @@ namespace mozilla { namespace image { class Decoder; -class RasterImage; /** * DecodePool is a singleton class that manages decoding of raster images. It diff --git a/image/Decoder.cpp b/image/Decoder.cpp index c886061c17..948da26a0f 100644 --- a/image/Decoder.cpp +++ b/image/Decoder.cpp @@ -471,7 +471,7 @@ Decoder::InternalAddFrame(uint32_t aFrameNum, } const uint32_t bytesPerPixel = aPaletteDepth == 0 ? 4 : 1; - if (!SurfaceCache::CanHold(aFrameRect.Size().ToIntSize(), bytesPerPixel)) { + if (!SurfaceCache::CanHold(aFrameRect.Size(), bytesPerPixel)) { NS_WARNING("Trying to add frame that's too large for the SurfaceCache"); return RawAccessFrameRef(); } @@ -493,7 +493,7 @@ Decoder::InternalAddFrame(uint32_t aFrameNum, InsertOutcome outcome = SurfaceCache::Insert(frame, ImageKey(mImage.get()), - RasterSurfaceKey(aTargetSize.ToIntSize(), + RasterSurfaceKey(aTargetSize, aDecodeFlags, aFrameNum), Lifetime::Persistent); diff --git a/image/ProgressTracker.h b/image/ProgressTracker.h index c6b8808571..127a45de7a 100644 --- a/image/ProgressTracker.h +++ b/image/ProgressTracker.h @@ -15,7 +15,6 @@ #include "nsRect.h" #include "IProgressObserver.h" -class imgIContainer; class nsIRunnable; namespace mozilla { diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 7cb11f044a..54cfd49e7f 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -165,7 +165,7 @@ public: // Insert the new surface into the cache immediately. We need to do this so // that we won't start multiple scaling jobs for the same size. SurfaceCache::Insert(mDstRef.get(), ImageKey(mImage.get()), - RasterSurfaceKey(mDstSize.ToIntSize(), mImageFlags, 0), + RasterSurfaceKey(mDstSize, mImageFlags, 0), Lifetime::Transient); return true; @@ -214,7 +214,7 @@ public: // Remove the frame from the cache since we know we don't need it. SurfaceCache::RemoveSurface(ImageKey(mImage.get()), - RasterSurfaceKey(mDstSize.ToIntSize(), + RasterSurfaceKey(mDstSize, mImageFlags, 0)); // Release everything we're holding, too. @@ -527,8 +527,7 @@ RasterImage::LookupFrame(uint32_t aFrameNum, MOZ_ASSERT(NS_IsMainThread()); IntSize requestedSize = CanDownscaleDuringDecode(aSize, aFlags) - ? aSize.ToIntSize() - : mSize.ToIntSize(); + ? aSize : mSize; DrawableFrameRef ref = LookupFrameInternal(aFrameNum, requestedSize, aFlags); @@ -942,7 +941,7 @@ RasterImage::OnAddedFrame(uint32_t aNewFrameCount, if (aNewFrameCount == 2) { // We're becoming animated, so initialize animation stuff. MOZ_ASSERT(!mAnim, "Already have animation state?"); - mAnim = MakeUnique(this, mSize.ToIntSize(), mAnimationMode); + mAnim = MakeUnique(this, mSize, mAnimationMode); // We don't support discarding animated images (See bug 414259). // Lock the image and throw away the key. @@ -1651,7 +1650,7 @@ RasterImage::CanScale(GraphicsFilter aFilter, } // There's no point in scaling if we can't store the result. - if (!SurfaceCache::CanHold(aSize.ToIntSize())) { + if (!SurfaceCache::CanHold(aSize)) { return false; } @@ -1693,7 +1692,7 @@ RasterImage::CanDownscaleDuringDecode(const nsIntSize& aSize, uint32_t aFlags) } // There's no point in scaling if we can't store the result. - if (!SurfaceCache::CanHold(aSize.ToIntSize())) { + if (!SurfaceCache::CanHold(aSize)) { return false; } @@ -1754,7 +1753,7 @@ RasterImage::DrawWithPreDownscaleIfNeeded(DrawableFrameRef&& aFrameRef, if (CanScale(aFilter, aSize, aFlags)) { frameRef = SurfaceCache::Lookup(ImageKey(this), - RasterSurfaceKey(aSize.ToIntSize(), + RasterSurfaceKey(aSize, DecodeFlags(aFlags), 0)); if (!frameRef) { @@ -2142,7 +2141,7 @@ RasterImage::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame, } else if (CanScale(aFilter, destSize, aFlags)) { DrawableFrameRef frameRef = SurfaceCache::Lookup(ImageKey(this), - RasterSurfaceKey(destSize.ToIntSize(), + RasterSurfaceKey(destSize, DecodeFlags(aFlags), 0)); diff --git a/image/RasterImage.h b/image/RasterImage.h index ab3004bbc7..ec0bc0735a 100644 --- a/image/RasterImage.h +++ b/image/RasterImage.h @@ -38,7 +38,6 @@ #endif class nsIInputStream; -class nsIThreadPool; class nsIRequest; #define NS_RASTERIMAGE_CID \ @@ -122,7 +121,6 @@ class nsIRequest; namespace mozilla { namespace layers { -class LayerManager; class ImageContainer; class Image; } // namespace layers diff --git a/image/SVGDocumentWrapper.h b/image/SVGDocumentWrapper.h index 473467e569..9872aa77ac 100644 --- a/image/SVGDocumentWrapper.h +++ b/image/SVGDocumentWrapper.h @@ -15,13 +15,12 @@ #include "nsIObserver.h" #include "nsIContentViewer.h" #include "nsWeakReference.h" +#include "nsSize.h" -class nsIAtom; class nsIPresShell; class nsIRequest; class nsILoadGroup; class nsIFrame; -struct nsIntSize; #define OBSERVER_SVC_CID "@mozilla.org/observer-service;1" diff --git a/image/VectorImage.h b/image/VectorImage.h index f1cbcafbd2..6efd520078 100644 --- a/image/VectorImage.h +++ b/image/VectorImage.h @@ -14,10 +14,6 @@ class nsIRequest; class gfxDrawable; namespace mozilla { -namespace layers { -class LayerManager; -class ImageContainer; -} namespace image { struct SVGDrawingParameters; diff --git a/image/encoders/ico/nsICOEncoder.h b/image/encoders/ico/nsICOEncoder.h index e4ad20bab2..123fae1b7a 100644 --- a/image/encoders/ico/nsICOEncoder.h +++ b/image/encoders/ico/nsICOEncoder.h @@ -11,9 +11,6 @@ #include "nsCOMPtr.h" #include "ICOFileHeaders.h" -class nsBMPEncoder; -class nsPNGEncoder; - #define NS_ICOENCODER_CID \ { /*92AE3AB2-8968-41B1-8709-B6123BCEAF21 */ \ 0x92ae3ab2, \ diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp index c2215b4316..7c605ce677 100644 --- a/image/imgFrame.cpp +++ b/image/imgFrame.cpp @@ -254,7 +254,7 @@ imgFrame::InitForDecoder(const nsIntSize& aImageSize, return NS_ERROR_FAILURE; } - mImageSize = aImageSize.ToIntSize(); + mImageSize = aImageSize; mOffset.MoveTo(aRect.x, aRect.y); mSize.SizeTo(aRect.width, aRect.height); @@ -318,7 +318,7 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable, return NS_ERROR_FAILURE; } - mImageSize = aSize.ToIntSize(); + mImageSize = aSize; mOffset.MoveTo(0, 0); mSize.SizeTo(aSize.width, aSize.height); diff --git a/ipc/dbus/RawDBusConnection.h b/ipc/dbus/RawDBusConnection.h index 05e8cbcf8b..20c80f469e 100644 --- a/ipc/dbus/RawDBusConnection.h +++ b/ipc/dbus/RawDBusConnection.h @@ -10,7 +10,6 @@ #include "mozilla/Scoped.h" struct DBusConnection; -struct DBusError; struct DBusMessage; namespace mozilla { diff --git a/ipc/glue/GeckoChildProcessHost.h b/ipc/glue/GeckoChildProcessHost.h index ff4d9c6811..76728058b5 100644 --- a/ipc/glue/GeckoChildProcessHost.h +++ b/ipc/glue/GeckoChildProcessHost.h @@ -23,8 +23,6 @@ #include "sandboxBroker.h" #endif -class nsIFile; - namespace mozilla { namespace ipc { diff --git a/ipc/glue/nsIIPCSerializableInputStream.h b/ipc/glue/nsIIPCSerializableInputStream.h index 0c4b48162c..acfccd1ffd 100644 --- a/ipc/glue/nsIIPCSerializableInputStream.h +++ b/ipc/glue/nsIIPCSerializableInputStream.h @@ -8,7 +8,6 @@ #include "nsISupports.h" #include "mozilla/Attributes.h" -struct nsTArrayDefaultAllocator; template class nsTArray; namespace mozilla { diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 205bc1e9c8..96aa3e2ea0 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -2683,7 +2683,7 @@ PaintInactiveLayer(nsDisplayListBuilder* aBuilder, RefPtr tempDT; if (gfxUtils::sDumpPainting) { tempDT = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget( - itemVisibleRect.Size().ToIntSize(), + itemVisibleRect.Size(), SurfaceFormat::B8G8R8A8); if (tempDT) { context = new gfxContext(tempDT); diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 6989ff737a..2acee77bf4 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -4815,9 +4815,10 @@ nsImageRenderer::ComputeIntrinsicSize() int32_t appUnitsPerDevPixel = mForFrame->PresContext()->AppUnitsPerDevPixel(); result.SetSize( - nsSVGIntegrationUtils::GetContinuationUnionSize(mPaintServerFrame). - ToNearestPixels(appUnitsPerDevPixel). - ToAppUnits(appUnitsPerDevPixel)); + IntSizeToAppUnits( + nsSVGIntegrationUtils::GetContinuationUnionSize(mPaintServerFrame). + ToNearestPixels(appUnitsPerDevPixel), + appUnitsPerDevPixel)); } } else { NS_ASSERTION(mImageElementSurface.mSourceSurface, "Surface should be ready."); diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp index 4a18fb1a3b..8bc6b29cb0 100644 --- a/layout/svg/nsSVGPatternFrame.cpp +++ b/layout/svg/nsSVGPatternFrame.cpp @@ -346,7 +346,7 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, bool resultOverflows; IntSize surfaceSize = nsSVGUtils::ConvertToSurfaceSize( - transformedBBox.Size(), &resultOverflows).ToIntSize(); + transformedBBox.Size(), &resultOverflows); // 0 disables rendering, < 0 is an error if (surfaceSize.width <= 0 || surfaceSize.height <= 0) { diff --git a/modules/libjar/nsJAR.h b/modules/libjar/nsJAR.h index c0a238a21b..4f6da72906 100644 --- a/modules/libjar/nsJAR.h +++ b/modules/libjar/nsJAR.h @@ -31,7 +31,6 @@ #include "mozilla/Attributes.h" class nsIX509Cert; -class nsIInputStream; class nsJARManifestItem; class nsZipReaderCache; diff --git a/modules/libpref/Preferences.h b/modules/libpref/Preferences.h index d2b03b768c..e686da3f1b 100644 --- a/modules/libpref/Preferences.h +++ b/modules/libpref/Preferences.h @@ -20,8 +20,6 @@ #include "mozilla/MemoryReporting.h" class nsIFile; -class nsCString; -class nsString; class nsAdoptingString; class nsAdoptingCString; diff --git a/netwerk/base/ChannelDiverterChild.h b/netwerk/base/ChannelDiverterChild.h index 529ae1da5a..a92de2f110 100644 --- a/netwerk/base/ChannelDiverterChild.h +++ b/netwerk/base/ChannelDiverterChild.h @@ -9,13 +9,9 @@ #include "mozilla/net/PChannelDiverterChild.h" -class nsIDivertableChannel; - namespace mozilla { namespace net { -class ChannelDiverterArgs; - class ChannelDiverterChild : public PChannelDiverterChild { diff --git a/netwerk/base/Dashboard.h b/netwerk/base/Dashboard.h index bd89b3437f..4e893c15d4 100644 --- a/netwerk/base/Dashboard.h +++ b/netwerk/base/Dashboard.h @@ -15,8 +15,6 @@ #include "nsITransport.h" class nsIDNSService; -class nsISocketTransport; -class nsIThread; namespace mozilla { namespace net { diff --git a/netwerk/base/Predictor.h b/netwerk/base/Predictor.h index 720c418022..26ed2bd533 100644 --- a/netwerk/base/Predictor.h +++ b/netwerk/base/Predictor.h @@ -26,7 +26,6 @@ class nsICacheStorage; class nsIDNSService; class nsIIOService; class nsINetworkPredictorVerifier; -class nsIThread; class nsITimer; namespace mozilla { diff --git a/netwerk/base/nsISocketTransport.idl b/netwerk/base/nsISocketTransport.idl index 7df679cf49..31d37779f7 100644 --- a/netwerk/base/nsISocketTransport.idl +++ b/netwerk/base/nsISocketTransport.idl @@ -28,8 +28,8 @@ native NetAddr(mozilla::net::NetAddr); * NOTE: This is a free-threaded interface, meaning that the methods on * this interface may be called from any thread. */ -[scriptable, uuid(a0b3b547-d6f0-4b65-a3de-a99ffa368840)] -interface nsISocketTransport : nsITransport +[scriptable, uuid(79221831-85e2-43a8-8152-05d77d6fde31)] +interface nsISocketTransport : nsITransport { /** * Get the peer's host for the underlying socket connection. @@ -44,6 +44,13 @@ interface nsISocketTransport : nsITransport */ readonly attribute long port; + /** + * The platform-specific network interface id that this socket + * associated with. Note that this attribute can be only accessed + * in the socket thread. + */ + attribute ACString networkInterfaceId; + /** * Returns the IP address of the socket connection peer. This * attribute is defined only once a connection has been established. @@ -207,6 +214,8 @@ interface nsISocketTransport : nsITransport /** * TCP keepalive configuration (support varies by platform). + * Note that the attribute as well as the setter can only accessed + * in the socket thread. */ attribute boolean keepaliveEnabled; void setKeepaliveVals(in long keepaliveIdleTime, diff --git a/netwerk/base/nsNativeConnectionHelper.h b/netwerk/base/nsNativeConnectionHelper.h index e86852d412..728d73e9f8 100644 --- a/netwerk/base/nsNativeConnectionHelper.h +++ b/netwerk/base/nsNativeConnectionHelper.h @@ -7,8 +7,6 @@ #include "nscore.h" -class nsISocketTransport; - class nsNativeConnectionHelper { public: diff --git a/netwerk/base/nsSocketTransport2.cpp b/netwerk/base/nsSocketTransport2.cpp index 86d77c4d11..c3fd226e2d 100644 --- a/netwerk/base/nsSocketTransport2.cpp +++ b/netwerk/base/nsSocketTransport2.cpp @@ -1048,8 +1048,8 @@ nsSocketTransport::ResolveHost() "Setting both RESOLVE_DISABLE_IPV6 and RESOLVE_DISABLE_IPV4"); SendStatus(NS_NET_STATUS_RESOLVING_HOST); - rv = dns->AsyncResolve(SocketHost(), dnsFlags, this, nullptr, - getter_AddRefs(mDNSRequest)); + rv = dns->AsyncResolveExtended(SocketHost(), dnsFlags, mNetworkInterfaceId, this, + nullptr, getter_AddRefs(mDNSRequest)); if (NS_SUCCEEDED(rv)) { SOCKET_LOG((" advancing to STATE_RESOLVING\n")); mState = STATE_RESOLVING; @@ -2195,6 +2195,22 @@ nsSocketTransport::GetPort(int32_t *port) return NS_OK; } +NS_IMETHODIMP +nsSocketTransport::GetNetworkInterfaceId(nsACString_internal &aNetworkInterfaceId) +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "wrong thread"); + aNetworkInterfaceId = mNetworkInterfaceId; + return NS_OK; +} + +NS_IMETHODIMP +nsSocketTransport::SetNetworkInterfaceId(const nsACString_internal &aNetworkInterfaceId) +{ + MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "wrong thread"); + mNetworkInterfaceId = aNetworkInterfaceId; + return NS_OK; +} + NS_IMETHODIMP nsSocketTransport::GetPeerAddr(NetAddr *addr) { diff --git a/netwerk/base/nsSocketTransport2.h b/netwerk/base/nsSocketTransport2.h index 969fd50cc9..b0b1521276 100644 --- a/netwerk/base/nsSocketTransport2.h +++ b/netwerk/base/nsSocketTransport2.h @@ -297,6 +297,10 @@ private: bool mInputClosed; bool mOutputClosed; + // The platform-specific network interface id that this socket + // associated with. + nsCString mNetworkInterfaceId; + // this flag is used to determine if the results of a host lookup arrive // recursively or not. this flag is not protected by any lock. bool mResolving; diff --git a/netwerk/cache/nsDiskCacheStreams.h b/netwerk/cache/nsDiskCacheStreams.h index 5017eed807..247c16a6ef 100644 --- a/netwerk/cache/nsDiskCacheStreams.h +++ b/netwerk/cache/nsDiskCacheStreams.h @@ -18,7 +18,6 @@ #include "mozilla/Atomics.h" -class nsDiskCacheInputStream; class nsDiskCacheDevice; class nsDiskCacheStreamIO : public nsIOutputStream { diff --git a/netwerk/cache2/CacheEntry.h b/netwerk/cache2/CacheEntry.h index d0143d8250..1309c17a68 100644 --- a/netwerk/cache2/CacheEntry.h +++ b/netwerk/cache2/CacheEntry.h @@ -33,7 +33,6 @@ PRTimeToSeconds(PRTime t_usec) #define NowInSeconds() PRTimeToSeconds(PR_Now()) -class nsIStorageStream; class nsIOutputStream; class nsIURI; class nsIThread; @@ -43,7 +42,6 @@ namespace net { class CacheStorageService; class CacheStorage; -class CacheFileOutputStream; class CacheOutputCloseListener; class CacheEntryHandle; diff --git a/netwerk/cache2/CacheFileIOManager.h b/netwerk/cache2/CacheFileIOManager.h index 389c2b95a0..c14e84644c 100644 --- a/netwerk/cache2/CacheFileIOManager.h +++ b/netwerk/cache2/CacheFileIOManager.h @@ -23,7 +23,6 @@ class nsIFile; class nsITimer; class nsIDirectoryEnumerator; class nsILoadContextInfo; -class nsICacheStorageVisitor; namespace mozilla { namespace net { @@ -174,7 +173,6 @@ private: //////////////////////////////////////////////////////////////////////////////// class OpenFileEvent; -class CloseFileEvent; class ReadEvent; class WriteEvent; class MetadataWriteScheduleEvent; diff --git a/netwerk/cache2/CacheStorageService.h b/netwerk/cache2/CacheStorageService.h index 51402026cb..f08c60f4ce 100644 --- a/netwerk/cache2/CacheStorageService.h +++ b/netwerk/cache2/CacheStorageService.h @@ -20,7 +20,6 @@ #include "nsTArray.h" class nsIURI; -class nsICacheEntryOpenCallback; class nsICacheEntryDoomCallback; class nsICacheStorageVisitor; class nsIRunnable; @@ -34,7 +33,6 @@ class CacheStorageService; class CacheStorage; class CacheEntry; class CacheEntryHandle; -class CacheEntryTable; class CacheMemoryConsumer { diff --git a/netwerk/cookie/CookieServiceParent.h b/netwerk/cookie/CookieServiceParent.h index 74663771e7..4204d6b802 100644 --- a/netwerk/cookie/CookieServiceParent.h +++ b/netwerk/cookie/CookieServiceParent.h @@ -10,7 +10,6 @@ #include "SerializedLoadContext.h" class nsCookieService; -class nsIIOService; namespace mozilla { namespace net { diff --git a/netwerk/cookie/nsCookieService.h b/netwerk/cookie/nsCookieService.h index 2a382fe90c..e3c8317e0d 100644 --- a/netwerk/cookie/nsCookieService.h +++ b/netwerk/cookie/nsCookieService.h @@ -42,7 +42,6 @@ class ReadCookieDBListener; struct nsCookieAttributes; struct nsListIter; -struct nsEnumerationData; namespace mozilla { namespace net { diff --git a/netwerk/ipc/ChannelEventQueue.h b/netwerk/ipc/ChannelEventQueue.h index 392b95ffea..be8d99139d 100644 --- a/netwerk/ipc/ChannelEventQueue.h +++ b/netwerk/ipc/ChannelEventQueue.h @@ -13,7 +13,6 @@ class nsISupports; class nsIEventTarget; -class nsIThread; namespace mozilla { namespace net { @@ -33,8 +32,6 @@ class ChannelEvent // instance) to be dispatched and called before mListener->OnStartRequest has // completed. -class AutoEventEnqueuerBase; - class ChannelEventQueue final { NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ChannelEventQueue) diff --git a/netwerk/protocol/ftp/FTPChannelParent.h b/netwerk/protocol/ftp/FTPChannelParent.h index 8188a26d69..e473689821 100644 --- a/netwerk/protocol/ftp/FTPChannelParent.h +++ b/netwerk/protocol/ftp/FTPChannelParent.h @@ -15,7 +15,6 @@ #include "nsIInterfaceRequestor.h" #include "OfflineObserver.h" -class nsFtpChannel; class nsILoadContext; namespace mozilla { diff --git a/netwerk/protocol/http/ASpdySession.h b/netwerk/protocol/http/ASpdySession.h index 857147994d..0a77339b0c 100644 --- a/netwerk/protocol/http/ASpdySession.h +++ b/netwerk/protocol/http/ASpdySession.h @@ -15,8 +15,6 @@ class nsISocketTransport; namespace mozilla { namespace net { -class nsHttpConnectionInfo; - class ASpdySession : public nsAHttpTransaction { public: diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 74c6d45189..662d026d0a 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -83,6 +83,7 @@ HttpBaseChannel::HttpBaseChannel() , mForcePending(false) , mCorsIncludeCredentials(false) , mCorsMode(nsIHttpChannelInternal::CORS_MODE_NO_CORS) + , mOnStartRequestCalled(false) { LOG(("Creating HttpBaseChannel @%x\n", this)); @@ -954,6 +955,21 @@ HttpBaseChannel::SetRequestMethod(const nsACString& aMethod) return NS_OK; } +NS_IMETHODIMP +HttpBaseChannel::GetNetworkInterfaceId(nsACString& aNetworkInterfaceId) +{ + aNetworkInterfaceId = mNetworkInterfaceId; + return NS_OK; +} + +NS_IMETHODIMP +HttpBaseChannel::SetNetworkInterfaceId(const nsACString& aNetworkInterfaceId) +{ + ENSURE_CALLED_BEFORE_CONNECT(); + mNetworkInterfaceId = aNetworkInterfaceId; + return NS_OK; +} + NS_IMETHODIMP HttpBaseChannel::GetReferrer(nsIURI **referrer) { @@ -2105,8 +2121,13 @@ void HttpBaseChannel::DoNotifyListener() { if (mListener) { + MOZ_ASSERT(!mOnStartRequestCalled, + "We should not call OnStartRequest twice"); + nsCOMPtr listener = mListener; listener->OnStartRequest(this, mListenerContext); + + mOnStartRequestCalled = true; } // Make sure mIsPending is set to false. At this moment we are done from diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index 653c59e431..19fb533973 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -184,6 +184,8 @@ public: NS_IMETHOD TakeAllSecurityMessages(nsCOMArray &aMessages) override; NS_IMETHOD GetResponseTimeoutEnabled(bool *aEnable) override; NS_IMETHOD SetResponseTimeoutEnabled(bool aEnable) override; + NS_IMETHOD GetNetworkInterfaceId(nsACString& aNetworkInterfaceId) override; + NS_IMETHOD SetNetworkInterfaceId(const nsACString& aNetworkInterfaceId) override; NS_IMETHOD AddRedirect(nsIPrincipal *aRedirect) override; NS_IMETHOD ForcePending(bool aForcePending) override; NS_IMETHOD GetLastModifiedTime(PRTime* lastModifiedTime) override; @@ -428,6 +430,13 @@ protected: bool mCorsIncludeCredentials; uint32_t mCorsMode; + + // This parameter is used to ensure that we do not call OnStartRequest more + // than once. + bool mOnStartRequestCalled; + + // The network interface id that's associated with this channel. + nsCString mNetworkInterfaceId; }; // Share some code while working around C++'s absurd inability to handle casting diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index 930eda50bd..3ecf9de516 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -2100,12 +2100,35 @@ HttpChannelChild::ResetInterception() void HttpChannelChild::OverrideWithSynthesizedResponse(nsAutoPtr& aResponseHead, - nsInputStreamPump* aPump, - int64_t aStreamLength) + nsIInputStream* aSynthesizedInput, + nsIStreamListener* aStreamListener) { - mSynthesizedResponsePump = aPump; + // In our current implementation, the FetchEvent handler will copy the + // response stream completely into the pipe backing the input stream so we + // can treat the available as the length of the stream. + uint64_t available; + nsresult rv = aSynthesizedInput->Available(&available); + if (NS_WARN_IF(NS_FAILED(rv))) { + mSynthesizedStreamLength = -1; + } else { + mSynthesizedStreamLength = int64_t(available); + } + + rv = nsInputStreamPump::Create(getter_AddRefs(mSynthesizedResponsePump), + aSynthesizedInput, + int64_t(-1), int64_t(-1), 0, 0, true); + if (NS_WARN_IF(NS_FAILED(rv))) { + aSynthesizedInput->Close(); + return; + } + + rv = mSynthesizedResponsePump->AsyncRead(aStreamListener, nullptr); + NS_ENSURE_SUCCESS_VOID(rv); + + // Intercepted responses should already be decoded. + SetApplyConversion(false); + mResponseHead = aResponseHead; - mSynthesizedStreamLength = aStreamLength; // if this channel has been suspended previously, the pump needs to be // correspondingly suspended now that it exists. diff --git a/netwerk/protocol/http/HttpChannelChild.h b/netwerk/protocol/http/HttpChannelChild.h index 7844f383bd..6f54013dac 100644 --- a/netwerk/protocol/http/HttpChannelChild.h +++ b/netwerk/protocol/http/HttpChannelChild.h @@ -159,7 +159,9 @@ private: // Override this channel's pending response with a synthesized one. The content will be // asynchronously read from the pump. - void OverrideWithSynthesizedResponse(nsAutoPtr& aResponseHead, nsInputStreamPump* aPump, int64_t aStreamLength); + void OverrideWithSynthesizedResponse(nsAutoPtr& aResponseHead, + nsIInputStream* aSynthesizedInput, + nsIStreamListener* aStreamListener); RequestHeaderTuples mClientSetRequestHeaders; nsCOMPtr mRedirectChannelChild; diff --git a/netwerk/protocol/http/HttpChannelParentListener.h b/netwerk/protocol/http/HttpChannelParentListener.h index fcf5356125..f7fa16d14c 100644 --- a/netwerk/protocol/http/HttpChannelParentListener.h +++ b/netwerk/protocol/http/HttpChannelParentListener.h @@ -12,8 +12,6 @@ #include "nsIChannelEventSink.h" #include "nsIRedirectResultListener.h" -class nsIParentChannel; - namespace mozilla { namespace net { diff --git a/netwerk/protocol/http/InterceptedChannel.cpp b/netwerk/protocol/http/InterceptedChannel.cpp index 6087740e17..3a6c272a36 100644 --- a/netwerk/protocol/http/InterceptedChannel.cpp +++ b/netwerk/protocol/http/InterceptedChannel.cpp @@ -306,35 +306,11 @@ InterceptedChannelContent::FinishSynthesizedResponse() EnsureSynthesizedResponse(); - nsresult rv = nsInputStreamPump::Create(getter_AddRefs(mStoragePump), mSynthesizedInput, - int64_t(-1), int64_t(-1), 0, 0, true); - if (NS_WARN_IF(NS_FAILED(rv))) { - mSynthesizedInput->Close(); - return rv; - } + mChannel->OverrideWithSynthesizedResponse(mSynthesizedResponseHead.ref(), + mSynthesizedInput, + mStreamListener); mResponseBody = nullptr; - - rv = mStoragePump->AsyncRead(mStreamListener, nullptr); - NS_ENSURE_SUCCESS(rv, rv); - - // Intercepted responses should already be decoded. - mChannel->SetApplyConversion(false); - - // In our current implementation, the FetchEvent handler will copy the - // response stream completely into the pipe backing the input stream so we - // can treat the available as the length of the stream. - int64_t streamLength; - uint64_t available; - rv = mSynthesizedInput->Available(&available); - if (NS_WARN_IF(NS_FAILED(rv))) { - streamLength = -1; - } else { - streamLength = int64_t(available); - } - - mChannel->OverrideWithSynthesizedResponse(mSynthesizedResponseHead.ref(), mStoragePump, streamLength); - mChannel = nullptr; mStreamListener = nullptr; return NS_OK; diff --git a/netwerk/protocol/http/InterceptedChannel.h b/netwerk/protocol/http/InterceptedChannel.h index d6f64c7acc..b009b8c143 100644 --- a/netwerk/protocol/http/InterceptedChannel.h +++ b/netwerk/protocol/http/InterceptedChannel.h @@ -13,7 +13,6 @@ class nsICacheEntry; class nsInputStreamPump; -class nsIStorageStream; class nsIStreamListener; namespace mozilla { @@ -96,9 +95,6 @@ class InterceptedChannelContent : public InterceptedChannelBase // Reader-side of the response body when synthesizing in a child proces nsCOMPtr mSynthesizedInput; - // Pump to read the synthesized body in child processes - nsRefPtr mStoragePump; - // Listener for the synthesized response to fix up the notifications before they reach // the actual channel. nsCOMPtr mStreamListener; diff --git a/netwerk/protocol/http/TunnelUtils.cpp b/netwerk/protocol/http/TunnelUtils.cpp index 8a391a762a..374cca8be1 100644 --- a/netwerk/protocol/http/TunnelUtils.cpp +++ b/netwerk/protocol/http/TunnelUtils.cpp @@ -1609,6 +1609,18 @@ SocketTransportShim::GetTimeout(uint32_t aType, uint32_t *_retval) return mWrapped->GetTimeout(aType, _retval); } +NS_IMETHODIMP +SocketTransportShim::GetNetworkInterfaceId(nsACString_internal &aNetworkInterfaceId) +{ + return mWrapped->GetNetworkInterfaceId(aNetworkInterfaceId); +} + +NS_IMETHODIMP +SocketTransportShim::SetNetworkInterfaceId(const nsACString_internal &aNetworkInterfaceId) +{ + return mWrapped->SetNetworkInterfaceId(aNetworkInterfaceId); +} + NS_IMETHODIMP SocketTransportShim::SetTimeout(uint32_t aType, uint32_t aValue) { diff --git a/netwerk/protocol/http/TunnelUtils.h b/netwerk/protocol/http/TunnelUtils.h index 690bacf4d8..b3decc860b 100644 --- a/netwerk/protocol/http/TunnelUtils.h +++ b/netwerk/protocol/http/TunnelUtils.h @@ -174,7 +174,6 @@ class SocketTransportShim; class InputStreamShim; class OutputStreamShim; class nsHttpConnection; -class ASpdySession; class SpdyConnectTransaction final : public NullHttpTransaction { diff --git a/netwerk/protocol/http/nsAHttpTransaction.h b/netwerk/protocol/http/nsAHttpTransaction.h index e9f01f7615..577ff331f3 100644 --- a/netwerk/protocol/http/nsAHttpTransaction.h +++ b/netwerk/protocol/http/nsAHttpTransaction.h @@ -10,7 +10,6 @@ #include "nsWeakReference.h" class nsIInterfaceRequestor; -class nsIEventTarget; class nsITransport; class nsILoadGroupConnectionInfo; diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 8cbb074bcf..edd215f7cf 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -929,8 +929,10 @@ nsHttpChannel::CallOnStartRequest() LOG((" calling mListener->OnStartRequest\n")); if (mListener) { - nsCOMPtr guard(mListener); - rv = guard->OnStartRequest(this, mListenerContext); + MOZ_ASSERT(!mOnStartRequestCalled, + "We should not call OsStartRequest twice"); + rv = mListener->OnStartRequest(this, mListenerContext); + mOnStartRequestCalled = true; if (NS_FAILED(rv)) return rv; } else { @@ -5594,7 +5596,10 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st // NOTE: since we have a failure status, we can ignore the return // value from onStartRequest. if (mListener) { + MOZ_ASSERT(!mOnStartRequestCalled, + "We should not call OnStartRequest twice."); mListener->OnStartRequest(this, mListenerContext); + mOnStartRequestCalled = true; } else { NS_WARNING("OnStartRequest skipped because of null listener"); } diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h index f9992b95aa..f6f20749a1 100644 --- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h @@ -23,7 +23,6 @@ #include "TimingStruct.h" #include "AutoClose.h" -class nsIPrincipal; class nsDNSPrefetch; class nsICancelable; class nsIHttpChannelAuthProvider; diff --git a/netwerk/protocol/http/nsHttpConnectionInfo.cpp b/netwerk/protocol/http/nsHttpConnectionInfo.cpp index 734b82b8e0..4d74f5c726 100644 --- a/netwerk/protocol/http/nsHttpConnectionInfo.cpp +++ b/netwerk/protocol/http/nsHttpConnectionInfo.cpp @@ -104,11 +104,14 @@ nsHttpConnectionInfo::Init(const nsACString &host, int32_t port, } void -nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port) +nsHttpConnectionInfo::SetNetworkInterfaceId(const nsACString& aNetworkInterfaceId) { - mHost = host; - mPort = port == -1 ? DefaultPort() : port; + mNetworkInterfaceId = aNetworkInterfaceId; + BuildHashKey(); +} +void nsHttpConnectionInfo::BuildHashKey() +{ // // build hash key: // @@ -140,6 +143,11 @@ nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port) mHashKey.AssignLiteral("......"); mHashKey.Append(keyHost); + if (!mNetworkInterfaceId.IsEmpty()) { + mHashKey.Append('('); + mHashKey.Append(mNetworkInterfaceId); + mHashKey.Append(')'); + } mHashKey.Append(':'); mHashKey.AppendInt(keyPort); if (!mUsername.IsEmpty()) { @@ -210,6 +218,14 @@ nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port) } } +void +nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port) +{ + mHost = host; + mPort = port == -1 ? DefaultPort() : port; + BuildHashKey(); +} + nsHttpConnectionInfo* nsHttpConnectionInfo::Clone() const { @@ -223,6 +239,10 @@ nsHttpConnectionInfo::Clone() const mAuthenticationPort); } + if (!mNetworkInterfaceId.IsEmpty()) { + clone->SetNetworkInterfaceId(mNetworkInterfaceId); + } + // Make sure the anonymous, relaxed, and private flags are transferred clone->SetAnonymous(GetAnonymous()); clone->SetPrivate(GetPrivate()); @@ -249,6 +269,9 @@ nsHttpConnectionInfo::CloneAsDirectRoute(nsHttpConnectionInfo **outCI) clone->SetPrivate(GetPrivate()); clone->SetRelaxed(GetRelaxed()); clone->SetNoSpdy(GetNoSpdy()); + if (!mNetworkInterfaceId.IsEmpty()) { + clone->SetNetworkInterfaceId(mNetworkInterfaceId); + } clone.forget(outCI); } diff --git a/netwerk/protocol/http/nsHttpConnectionInfo.h b/netwerk/protocol/http/nsHttpConnectionInfo.h index 1c6344ffea..346f31b7e1 100644 --- a/netwerk/protocol/http/nsHttpConnectionInfo.h +++ b/netwerk/protocol/http/nsHttpConnectionInfo.h @@ -55,12 +55,19 @@ private: PR_LOG(gHttpLog, 4, ("Destroying nsHttpConnectionInfo @%x\n", this)); } + void BuildHashKey(); + public: const nsAFlatCString &HashKey() const { return mHashKey; } const nsCString &GetAuthenticationHost() const { return mAuthenticationHost; } int32_t GetAuthenticationPort() const { return mAuthenticationPort; } + // With overhead rebuilding the hash key. The initial + // network interface is empty. So you can reduce one call + // if there's no explicit route after ctor. + void SetNetworkInterfaceId(const nsACString& aNetworkInterfaceId); + // OK to treat these as an infalible allocation nsHttpConnectionInfo* Clone() const; void CloneAsDirectRoute(nsHttpConnectionInfo **outParam); @@ -102,6 +109,8 @@ public: { mHashKey.SetCharAt(aNoSpdy ? 'X' : '.', 5); } bool GetNoSpdy() const { return mHashKey.CharAt(5) == 'X'; } + const nsCString &GetNetworkInterfaceId() const { return mNetworkInterfaceId; } + const nsCString &GetHost() { return mHost; } const nsCString &GetNPNToken() { return mNPNToken; } const nsCString &GetUsername() { return mUsername; } @@ -138,6 +147,7 @@ private: nsCString mHashKey; nsCString mHost; + nsCString mNetworkInterfaceId; int32_t mPort; nsCString mUsername; nsCString mAuthenticationHost; diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 8d52309a8a..05e062536b 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -3116,6 +3116,10 @@ nsHalfOpenSocket::SetupStreams(nsISocketTransport **transport, socketTransport->SetQoSBits(gHttpHandler->GetQoSBits()); + if (!mEnt->mConnInfo->GetNetworkInterfaceId().IsEmpty()) { + socketTransport->SetNetworkInterfaceId(mEnt->mConnInfo->GetNetworkInterfaceId()); + } + rv = socketTransport->SetEventSink(this, nullptr); NS_ENSURE_SUCCESS(rv, rv); diff --git a/netwerk/protocol/http/nsIHttpChannelInternal.idl b/netwerk/protocol/http/nsIHttpChannelInternal.idl index ce25000d3b..db9edc8d33 100644 --- a/netwerk/protocol/http/nsIHttpChannelInternal.idl +++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl @@ -38,7 +38,7 @@ interface nsIHttpUpgradeListener : nsISupports * using any feature exposed by this interface, be aware that this interface * will change and you will be broken. You have been warned. */ -[scriptable, uuid(80ee20a9-757b-4c4e-8a4a-84cbb5981879)] +[scriptable, uuid(ad8192a1-668e-4a47-bd77-081eb23e50fa)] interface nsIHttpChannelInternal : nsISupports { /** @@ -241,6 +241,11 @@ interface nsIHttpChannelInternal : nsISupports */ readonly attribute nsIURI topWindowURI; + /** + * The network interface id that's associated with this channel. + */ + attribute ACString networkInterfaceId; + /** * Read the proxy URI, which, if non-null, will be used to resolve * proxies for this channel. diff --git a/netwerk/protocol/rtsp/controller/RtspControllerParent.h b/netwerk/protocol/rtsp/controller/RtspControllerParent.h index ee40b956d1..854d83f9ae 100644 --- a/netwerk/protocol/rtsp/controller/RtspControllerParent.h +++ b/netwerk/protocol/rtsp/controller/RtspControllerParent.h @@ -15,8 +15,6 @@ #include "nsCOMPtr.h" #include "nsString.h" -class nsIAuthPromptProvider; - namespace mozilla { namespace net { diff --git a/netwerk/sctp/datachannel/DataChannel.h b/netwerk/sctp/datachannel/DataChannel.h index df1905e8cd..d627724857 100644 --- a/netwerk/sctp/datachannel/DataChannel.h +++ b/netwerk/sctp/datachannel/DataChannel.h @@ -48,7 +48,6 @@ extern "C" { namespace mozilla { -class DTLSConnection; class DataChannelConnection; class DataChannel; class DataChannelOnMessageAvailable; diff --git a/rdf/base/nsCompositeDataSource.cpp b/rdf/base/nsCompositeDataSource.cpp index 7760dc5c61..7a96e20d54 100644 --- a/rdf/base/nsCompositeDataSource.cpp +++ b/rdf/base/nsCompositeDataSource.cpp @@ -42,12 +42,10 @@ #include "nsEnumeratorUtils.h" -#ifdef PR_LOGGING #include "prlog.h" #include "prprf.h" #include PRLogModuleInfo* nsRDFLog = nullptr; -#endif //---------------------------------------------------------------------- // @@ -492,10 +490,8 @@ CompositeDataSourceImpl::CompositeDataSourceImpl(void) mCoalesceDuplicateArcs(true), mUpdateBatchNest(0) { -#ifdef PR_LOGGING if (nsRDFLog == nullptr) nsRDFLog = PR_NewLogModule("RDF"); -#endif } //---------------------------------------------------------------------- diff --git a/rdf/base/nsInMemoryDataSource.cpp b/rdf/base/nsInMemoryDataSource.cpp index d09163583f..66e5b67de0 100644 --- a/rdf/base/nsInMemoryDataSource.cpp +++ b/rdf/base/nsInMemoryDataSource.cpp @@ -359,26 +359,20 @@ public: } } -#ifdef PR_LOGGING void LogOperation(const char* aOperation, nsIRDFResource* asource, nsIRDFResource* aProperty, nsIRDFNode* aTarget, bool aTruthValue = true); -#endif bool mPropagateChanges; private: -#ifdef PR_LOGGING static PRLogModuleInfo* gLog; -#endif }; -#ifdef PR_LOGGING PRLogModuleInfo* InMemoryDataSource::gLog; -#endif //---------------------------------------------------------------------- // @@ -790,10 +784,8 @@ InMemoryDataSource::Init() PL_DHashTableInit(&mForwardArcs, PL_DHashGetStubOps(), sizeof(Entry)); PL_DHashTableInit(&mReverseArcs, PL_DHashGetStubOps(), sizeof(Entry)); -#ifdef PR_LOGGING if (! gLog) gLog = PR_NewLogModule("InMemoryDataSource"); -#endif return NS_OK; } @@ -866,7 +858,6 @@ NS_INTERFACE_MAP_END //////////////////////////////////////////////////////////////////////// -#ifdef PR_LOGGING void InMemoryDataSource::LogOperation(const char* aOperation, nsIRDFResource* aSource, @@ -915,7 +906,6 @@ InMemoryDataSource::LogOperation(const char* aOperation, (" -->(unknown-type)\n"); } } -#endif NS_IMETHODIMP @@ -1125,9 +1115,7 @@ InMemoryDataSource::LockedAssert(nsIRDFResource* aSource, nsIRDFNode* aTarget, bool aTruthValue) { -#ifdef PR_LOGGING LogOperation("ASSERT", aSource, aProperty, aTarget, aTruthValue); -#endif Assertion* next = GetForwardArcs(aSource); Assertion* prev = next; @@ -1265,9 +1253,7 @@ InMemoryDataSource::LockedUnassert(nsIRDFResource* aSource, nsIRDFResource* aProperty, nsIRDFNode* aTarget) { -#ifdef PR_LOGGING LogOperation("UNASSERT", aSource, aProperty, aTarget); -#endif Assertion* next = GetForwardArcs(aSource); Assertion* prev = next; @@ -1811,9 +1797,7 @@ InMemoryDataSource::Mark(nsIRDFResource* aSource, as->Mark(); *aDidMark = true; -#ifdef PR_LOGGING LogOperation("MARK", aSource, aProperty, aTarget, aTruthValue); -#endif return NS_OK; } @@ -1835,9 +1819,7 @@ InMemoryDataSource::Mark(nsIRDFResource* aSource, as->Mark(); *aDidMark = true; -#ifdef PR_LOGGING LogOperation("MARK", aSource, aProperty, aTarget, aTruthValue); -#endif return NS_OK; } @@ -1864,9 +1846,7 @@ InMemoryDataSource::Sweep() // Now do the notification. Assertion* as = info.mUnassertList; while (as) { -#ifdef PR_LOGGING LogOperation("SWEEP", as->mSource, as->u.as.mProperty, as->u.as.mTarget, as->u.as.mTruthValue); -#endif if (!(as->mHashEntry)) { for (int32_t i = int32_t(mNumObservers) - 1; mPropagateChanges && i >= 0; --i) { diff --git a/rdf/base/nsRDFContentSink.cpp b/rdf/base/nsRDFContentSink.cpp index 8c8eccb300..c4e58f2e59 100644 --- a/rdf/base/nsRDFContentSink.cpp +++ b/rdf/base/nsRDFContentSink.cpp @@ -226,9 +226,7 @@ protected: nsIURI* mDocumentURL; private: -#ifdef PR_LOGGING static PRLogModuleInfo* gLog; -#endif }; int32_t RDFContentSinkImpl::gRefCnt = 0; @@ -241,9 +239,7 @@ nsIRDFResource* RDFContentSinkImpl::kRDF_Bag; nsIRDFResource* RDFContentSinkImpl::kRDF_Seq; nsIRDFResource* RDFContentSinkImpl::kRDF_nextVal; -#ifdef PR_LOGGING PRLogModuleInfo* RDFContentSinkImpl::gLog; -#endif //////////////////////////////////////////////////////////////////////// @@ -296,10 +292,8 @@ RDFContentSinkImpl::RDFContentSinkImpl() NS_RegisterStaticAtoms(rdf_atoms); } -#ifdef PR_LOGGING if (! gLog) gLog = PR_NewLogModule("nsRDFContentSink"); -#endif } @@ -326,17 +320,15 @@ RDFContentSinkImpl::~RDFContentSinkImpl() RDFContentSinkParseMode parseMode; PopContext(resource, state, parseMode); -#ifdef PR_LOGGING // print some fairly useless debugging info // XXX we should save line numbers on the context stack: this'd // be about 1000x more helpful. - if (resource) { + if (resource && PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { nsXPIDLCString uri; resource->GetValue(getter_Copies(uri)); PR_LOG(gLog, PR_LOG_NOTICE, ("rdfxml: uri=%s", (const char*) uri)); } -#endif NS_IF_RELEASE(resource); } @@ -446,7 +438,6 @@ RDFContentSinkImpl::HandleEndElement(const char16_t *aName) nsIRDFResource* resource; if (NS_FAILED(PopContext(resource, mState, mParseMode))) { // XXX parser didn't catch unmatched tags? -#ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_WARNING)) { nsAutoString tagStr(aName); char* tagCStr = ToNewCString(tagStr); @@ -457,7 +448,6 @@ RDFContentSinkImpl::HandleEndElement(const char16_t *aName) NS_Free(tagCStr); } -#endif return NS_ERROR_UNEXPECTED; // XXX } diff --git a/rdf/base/nsRDFService.cpp b/rdf/base/nsRDFService.cpp index 15b43c403c..237e86124f 100644 --- a/rdf/base/nsRDFService.cpp +++ b/rdf/base/nsRDFService.cpp @@ -70,9 +70,7 @@ static NS_DEFINE_IID(kIRDFIntIID, NS_IRDFINT_IID); static NS_DEFINE_IID(kIRDFNodeIID, NS_IRDFNODE_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -#ifdef PR_LOGGING static PRLogModuleInfo* gLog = nullptr; -#endif class BlobImpl; @@ -755,10 +753,8 @@ RDFServiceImpl::Init() NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get default resource factory"); if (NS_FAILED(rv)) return rv; -#ifdef PR_LOGGING if (! gLog) gLog = PR_NewLogModule("nsRDFService"); -#endif return NS_OK; } diff --git a/rdf/base/nsRDFXMLDataSource.cpp b/rdf/base/nsRDFXMLDataSource.cpp index c4c6a0965d..3af4e16d3e 100644 --- a/rdf/base/nsRDFXMLDataSource.cpp +++ b/rdf/base/nsRDFXMLDataSource.cpp @@ -134,9 +134,7 @@ protected: static int32_t gRefCnt; static nsIRDFService* gRDFService; -#ifdef PR_LOGGING static PRLogModuleInfo* gLog; -#endif nsresult Init(); RDFXMLDataSourceImpl(void); @@ -360,9 +358,7 @@ protected: int32_t RDFXMLDataSourceImpl::gRefCnt = 0; nsIRDFService* RDFXMLDataSourceImpl::gRDFService; -#ifdef PR_LOGGING PRLogModuleInfo* RDFXMLDataSourceImpl::gLog; -#endif static const char kFileURIPrefix[] = "file:"; static const char kResourceURIPrefix[] = "resource:"; @@ -400,10 +396,8 @@ RDFXMLDataSourceImpl::RDFXMLDataSourceImpl(void) mIsDirty(false), mLoadState(eLoadState_Unloaded) { -#ifdef PR_LOGGING if (! gLog) gLog = PR_NewLogModule("nsRDFXMLDataSource"); -#endif } @@ -833,12 +827,12 @@ RDFXMLDataSourceImpl::Flush(void) if (! mURL) return NS_ERROR_NOT_INITIALIZED; -#ifdef PR_LOGGING - nsAutoCString spec; - mURL->GetSpec(spec); - PR_LOG(gLog, PR_LOG_NOTICE, - ("rdfxml[%p] flush(%s)", this, spec.get())); -#endif + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { + nsAutoCString spec; + mURL->GetSpec(spec); + PR_LOG(gLog, PR_LOG_NOTICE, + ("rdfxml[%p] flush(%s)", this, spec.get())); + } nsresult rv; if (NS_SUCCEEDED(rv = rdfXMLFlush(mURL))) @@ -913,14 +907,12 @@ RDFXMLDataSourceImpl::AsyncOnChannelRedirect(nsIChannel *aOldChannel, NS_IMETHODIMP RDFXMLDataSourceImpl::Refresh(bool aBlocking) { -#ifdef PR_LOGGING nsAutoCString spec; if (mURL) { mURL->GetSpec(spec); } PR_LOG(gLog, PR_LOG_NOTICE, ("rdfxml[%p] refresh(%s) %sblocking", this, spec.get(), (aBlocking ? "" : "non"))); -#endif // If an asynchronous load is already pending, then just let it do // the honors. @@ -977,14 +969,14 @@ RDFXMLDataSourceImpl::Refresh(bool aBlocking) NS_IMETHODIMP RDFXMLDataSourceImpl::BeginLoad(void) { -#ifdef PR_LOGGING - nsAutoCString spec; - if (mURL) { - mURL->GetSpec(spec); + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { + nsAutoCString spec; + if (mURL) { + mURL->GetSpec(spec); + } + PR_LOG(gLog, PR_LOG_NOTICE, + ("rdfxml[%p] begin-load(%s)", this, spec.get())); } - PR_LOG(gLog, PR_LOG_NOTICE, - ("rdfxml[%p] begin-load(%s)", this, spec.get())); -#endif mLoadState = eLoadState_Loading; for (int32_t i = mObservers.Count() - 1; i >= 0; --i) { @@ -1003,15 +995,15 @@ RDFXMLDataSourceImpl::BeginLoad(void) NS_IMETHODIMP RDFXMLDataSourceImpl::Interrupt(void) { -#ifdef PR_LOGGING - nsAutoCString spec; - if (mURL) { - mURL->GetSpec(spec); + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { + nsAutoCString spec; + if (mURL) { + mURL->GetSpec(spec); + } + PR_LOG(gLog, PR_LOG_NOTICE, + ("rdfxml[%p] interrupt(%s)", this, spec.get())); } - PR_LOG(gLog, PR_LOG_NOTICE, - ("rdfxml[%p] interrupt(%s)", this, spec.get())); -#endif - + for (int32_t i = mObservers.Count() - 1; i >= 0; --i) { // Make sure to hold a strong reference to the observer so // that it doesn't go away in this call if it removes itself @@ -1028,14 +1020,14 @@ RDFXMLDataSourceImpl::Interrupt(void) NS_IMETHODIMP RDFXMLDataSourceImpl::Resume(void) { -#ifdef PR_LOGGING - nsAutoCString spec; - if (mURL) { - mURL->GetSpec(spec); + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { + nsAutoCString spec; + if (mURL) { + mURL->GetSpec(spec); + } + PR_LOG(gLog, PR_LOG_NOTICE, + ("rdfxml[%p] resume(%s)", this, spec.get())); } - PR_LOG(gLog, PR_LOG_NOTICE, - ("rdfxml[%p] resume(%s)", this, spec.get())); -#endif for (int32_t i = mObservers.Count() - 1; i >= 0; --i) { // Make sure to hold a strong reference to the observer so @@ -1053,14 +1045,14 @@ RDFXMLDataSourceImpl::Resume(void) NS_IMETHODIMP RDFXMLDataSourceImpl::EndLoad(void) { -#ifdef PR_LOGGING - nsAutoCString spec; - if (mURL) { - mURL->GetSpec(spec); + if (PR_LOG_TEST(gLog, PR_LOG_NOTICE)) { + nsAutoCString spec; + if (mURL) { + mURL->GetSpec(spec); + } + PR_LOG(gLog, PR_LOG_NOTICE, + ("rdfxml[%p] end-load(%s)", this, spec.get())); } - PR_LOG(gLog, PR_LOG_NOTICE, - ("rdfxml[%p] end-load(%s)", this, spec.get())); -#endif mLoadState = eLoadState_Loaded; diff --git a/storage/src/mozStorageAsyncStatementExecution.cpp b/storage/src/mozStorageAsyncStatementExecution.cpp index ee8228accd..277b566fb8 100644 --- a/storage/src/mozStorageAsyncStatementExecution.cpp +++ b/storage/src/mozStorageAsyncStatementExecution.cpp @@ -586,7 +586,7 @@ AsyncExecuteStatements::Run() if (mState == CANCELED) return notifyComplete(); - if (statementsNeedTransaction()) { + if (statementsNeedTransaction() && mConnection->getAutocommit()) { if (NS_SUCCEEDED(mConnection->beginTransactionInternal(mNativeConnection, mozIStorageConnection::TRANSACTION_IMMEDIATE))) { mHasTransaction = true; diff --git a/storage/src/mozStorageConnection.h b/storage/src/mozStorageConnection.h index a86ec796f0..598646f017 100644 --- a/storage/src/mozStorageConnection.h +++ b/storage/src/mozStorageConnection.h @@ -124,8 +124,7 @@ public: * Gets autocommit status. */ bool getAutocommit() { - MOZ_ASSERT(mDBConn, "A connection must exist at this point"); - return static_cast(::sqlite3_get_autocommit(mDBConn)); + return mDBConn && static_cast(::sqlite3_get_autocommit(mDBConn)); }; /** diff --git a/storage/src/mozStoragePrivateHelpers.cpp b/storage/src/mozStoragePrivateHelpers.cpp index 7bd44183f0..682ae42ff9 100644 --- a/storage/src/mozStoragePrivateHelpers.cpp +++ b/storage/src/mozStoragePrivateHelpers.cpp @@ -75,7 +75,7 @@ convertResultCode(int aSQLiteResultCode) message.AppendLiteral("SQLite returned error code "); message.AppendInt(rc); message.AppendLiteral(" , Storage will convert it to NS_ERROR_FAILURE"); - NS_WARNING(message.get()); + NS_WARN_IF_FALSE(rc == SQLITE_ERROR, message.get()); #endif return NS_ERROR_FAILURE; } diff --git a/toolkit/components/jsdownloads/src/DownloadPlatform.h b/toolkit/components/jsdownloads/src/DownloadPlatform.h index b508c12d07..75e3b8d571 100644 --- a/toolkit/components/jsdownloads/src/DownloadPlatform.h +++ b/toolkit/components/jsdownloads/src/DownloadPlatform.h @@ -9,9 +9,6 @@ #include "nsCOMPtr.h" -class nsIURI; -class nsIFile; - class DownloadPlatform : public mozIDownloadPlatform { protected: diff --git a/toolkit/components/places/Database.h b/toolkit/components/places/Database.h index 69af86e964..48620b3a73 100644 --- a/toolkit/components/places/Database.h +++ b/toolkit/components/places/Database.h @@ -43,7 +43,6 @@ // Fired when the connection has gone, nothing will work from now on. #define TOPIC_PLACES_CONNECTION_CLOSED "places-connection-closed" -class nsIStringBundle; class nsIRunnable; namespace mozilla { diff --git a/toolkit/components/places/nsNavBookmarks.h b/toolkit/components/places/nsNavBookmarks.h index 586d2548a8..a5fcc130b7 100644 --- a/toolkit/components/places/nsNavBookmarks.h +++ b/toolkit/components/places/nsNavBookmarks.h @@ -18,7 +18,6 @@ #include "prtime.h" class nsNavBookmarks; -class nsIOutputStream; namespace mozilla { namespace places { diff --git a/toolkit/components/places/nsNavHistory.h b/toolkit/components/places/nsNavHistory.h index d21a5b3b0a..536d2ee8fa 100644 --- a/toolkit/components/places/nsNavHistory.h +++ b/toolkit/components/places/nsNavHistory.h @@ -51,7 +51,6 @@ // Fired after frecency has been updated. #define TOPIC_FRECENCY_UPDATED "places-frecency-updated" -class mozIAnnotationService; class nsNavHistory; class QueryKeyValuePair; class nsIEffectiveTLDService; diff --git a/toolkit/components/startup/nsAppStartup.h b/toolkit/components/startup/nsAppStartup.h index d3a9f3b70c..ef45a0a1c1 100644 --- a/toolkit/components/startup/nsAppStartup.h +++ b/toolkit/components/startup/nsAppStartup.h @@ -22,8 +22,6 @@ #endif //defined(XP_WIN) -struct PLEvent; - // {7DD4D320-C84B-4624-8D45-7BB9B2356977} #define NS_TOOLKIT_APPSTARTUP_CID \ { 0x7dd4d320, 0xc84b, 0x4624, { 0x8d, 0x45, 0x7b, 0xb9, 0xb2, 0x35, 0x69, 0x77 } } diff --git a/toolkit/xre/nsAppRunner.h b/toolkit/xre/nsAppRunner.h index 9480020a6f..9b2cb135b3 100644 --- a/toolkit/xre/nsAppRunner.h +++ b/toolkit/xre/nsAppRunner.h @@ -32,11 +32,7 @@ // and we load localstore from somewhere else. #define NS_LOCALSTORE_UNSAFE_FILE "LStoreS" -class nsACString; -struct nsStaticModuleInfo; - class nsINativeAppSupport; -class nsICmdLineService; class nsXREDirProvider; class nsIToolkitProfileService; class nsIFile; diff --git a/uriloader/prefetch/OfflineCacheUpdateParent.h b/uriloader/prefetch/OfflineCacheUpdateParent.h index 3300d69928..3cf9077448 100644 --- a/uriloader/prefetch/OfflineCacheUpdateParent.h +++ b/uriloader/prefetch/OfflineCacheUpdateParent.h @@ -14,10 +14,6 @@ namespace mozilla { -namespace dom { -class TabParent; -} - namespace ipc { class URIParams; } // namespace ipc diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.h b/uriloader/prefetch/nsOfflineCacheUpdate.h index 873e322ed8..de0c56303c 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.h +++ b/uriloader/prefetch/nsOfflineCacheUpdate.h @@ -36,9 +36,6 @@ class nsOfflineCacheUpdate; -class nsIUTF8StringEnumerator; -class nsILoadContext; - class nsOfflineCacheUpdateItem : public nsIStreamListener , public nsIRunnable , public nsIInterfaceRequestor diff --git a/uriloader/prefetch/nsPrefetchService.h b/uriloader/prefetch/nsPrefetchService.h index 0ac2636d94..0ae2f5264f 100644 --- a/uriloader/prefetch/nsPrefetchService.h +++ b/uriloader/prefetch/nsPrefetchService.h @@ -20,7 +20,6 @@ #include "mozilla/Attributes.h" class nsPrefetchService; -class nsPrefetchListener; class nsPrefetchNode; //----------------------------------------------------------------------------- diff --git a/widget/cocoa/NativeKeyBindings.mm b/widget/cocoa/NativeKeyBindings.mm index de5a896349..dea9496738 100644 --- a/widget/cocoa/NativeKeyBindings.mm +++ b/widget/cocoa/NativeKeyBindings.mm @@ -13,9 +13,7 @@ namespace mozilla { namespace widget { -#ifdef PR_LOGGING PRLogModuleInfo* gNativeKeyBindingsLog = nullptr; -#endif NativeKeyBindings* NativeKeyBindings::sInstanceForSingleLineEditor = nullptr; NativeKeyBindings* NativeKeyBindings::sInstanceForMultiLineEditor = nullptr; @@ -65,11 +63,9 @@ NativeKeyBindings::NativeKeyBindings() void NativeKeyBindings::Init(NativeKeyBindingsType aType) { -#ifdef PR_LOGGING if (!gNativeKeyBindingsLog) { gNativeKeyBindingsLog = PR_NewLogModule("NativeKeyBindings"); } -#endif PR_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::Init", this)); @@ -237,7 +233,6 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent, for (uint32_t i = 0; i < bindingCommands.Length(); i++) { SEL selector = bindingCommands[i].selector; -#ifdef PR_LOGGING if (PR_LOG_TEST(gNativeKeyBindingsLog, PR_LOG_ALWAYS)) { NSString* selectorString = NSStringFromSelector(selector); nsAutoString nsSelectorString; @@ -245,9 +240,8 @@ NativeKeyBindings::Execute(const WidgetKeyboardEvent& aEvent, PR_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS, ("%p NativeKeyBindings::KeyPress, selector=%s", - this, ToNewCString(nsSelectorString))); + this, NS_LossyConvertUTF16toASCII(nsSelectorString).get())); } -#endif // Try to find a simple mapping in the hashtable Command goannaCommand = static_cast(mSelectorToCommand.Get( diff --git a/widget/cocoa/TextInputHandler.mm b/widget/cocoa/TextInputHandler.mm index 59b067b454..8752521f83 100644 --- a/widget/cocoa/TextInputHandler.mm +++ b/widget/cocoa/TextInputHandler.mm @@ -28,8 +28,6 @@ using namespace mozilla; using namespace mozilla::widget; -#ifdef PR_LOGGING - PRLogModuleInfo* gLog = nullptr; static const char* @@ -305,8 +303,6 @@ GetWindowLevelName(NSInteger aWindowLevel) } } -#endif // #ifdef PR_LOGGING - static bool IsControlChar(uint32_t aCharCode) { @@ -319,14 +315,12 @@ static TISInputSourceWrapper gCurrentInputSource; static void InitLogModule() { -#ifdef PR_LOGGING // Clear() is always called when TISInputSourceWrappper is created. if (!gLog) { gLog = PR_NewLogModule("TextInputHandlerWidgets"); TextInputHandler::DebugPrintAllKeyboardLayouts(); IMEInputHandler::DebugPrintAllIMEModes(); } -#endif } static void @@ -1047,7 +1041,6 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent, NS_ASSERTION(aKeyEvent.message == NS_KEY_PRESS, "aKeyEvent must be NS_KEY_PRESS event"); -#ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { nsAutoString chars; nsCocoaUtils::GetStringForNSString([aNativeKeyEvent characters], chars); @@ -1062,7 +1055,6 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent, utf8ExpectedChar.get(), GetGoannaKeyEventType(aKeyEvent), aKbType, TrueOrFalse(IsOpenedIMEMode()))); } -#endif // #ifdef PR_LOGGING aKeyEvent.isChar = true; // this is not a special key XXX not used in XP aKeyEvent.charCode = aInsertChar; @@ -1451,7 +1443,6 @@ TextInputHandler::CreateAllKeyboardLayoutList() void TextInputHandler::DebugPrintAllKeyboardLayouts() { -#ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { CFArrayRef list = CreateAllKeyboardLayoutList(); PR_LOG(gLog, PR_LOG_ALWAYS, ("Keyboard layout configuration:")); @@ -1474,7 +1465,6 @@ TextInputHandler::DebugPrintAllKeyboardLayouts() } ::CFRelease(list); } -#endif // #ifdef PR_LOGGING } @@ -2270,7 +2260,6 @@ IMEInputHandler::OnCurrentTextInputSourceChange(CFNotificationCenterRef aCenter, tis.GetInputSourceID(sLatestIMEOpenedModeInputSourceID); } -#ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { static CFStringRef sLastTIS = nullptr; CFStringRef newTIS; @@ -2317,7 +2306,6 @@ IMEInputHandler::OnCurrentTextInputSourceChange(CFNotificationCenterRef aCenter, } sLastTIS = newTIS; } -#endif // #ifdef PR_LOGGING /** * When the direction is changed, all the children are notified. @@ -2360,7 +2348,6 @@ IMEInputHandler::CreateAllIMEModeList() void IMEInputHandler::DebugPrintAllIMEModes() { -#ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { CFArrayRef list = CreateAllIMEModeList(); PR_LOG(gLog, PR_LOG_ALWAYS, ("IME mode configuration:")); @@ -2382,7 +2369,6 @@ IMEInputHandler::DebugPrintAllIMEModes() } ::CFRelease(list); } -#endif // #ifdef PR_LOGGING } //static @@ -3695,7 +3681,6 @@ IMEInputHandler::OpenSystemPreferredLanguageIME() TISInputSourceWrapper tis; tis.InitByLanguage(lang); if (tis.IsOpenedIMEMode()) { -#ifdef PR_LOGGING if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) { CFStringRef foundTIS; tis.GetInputSourceID(foundTIS); @@ -3704,7 +3689,6 @@ IMEInputHandler::OpenSystemPreferredLanguageIME() "foundTIS=%s, lang=%s", this, GetCharacters(foundTIS), GetCharacters(lang))); } -#endif // #ifdef PR_LOGGING tis.Select(); changed = true; } diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 118e1f9581..11e02e5c0a 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -102,9 +102,7 @@ using mozilla::gfx::Matrix4x4; // out to the bounding-box if there are more #define MAX_RECTS_IN_REGION 100 -#ifdef PR_LOGGING PRLogModuleInfo* sCocoaLog = nullptr; -#endif extern "C" { CG_EXTERN void CGContextResetCTM(CGContextRef); @@ -249,11 +247,9 @@ FlipCocoaScreenCoordinate(NSPoint &inPoint) void EnsureLogInitialized() { -#ifdef PR_LOGGING if (!sCocoaLog) { sCocoaLog = PR_NewLogModule("nsCocoaWidgets"); } -#endif // PR_LOGGING } namespace { diff --git a/widget/cocoa/nsClipboard.mm b/widget/cocoa/nsClipboard.mm index 5dd4356c77..c61ea9dbc9 100644 --- a/widget/cocoa/nsClipboard.mm +++ b/widget/cocoa/nsClipboard.mm @@ -29,9 +29,7 @@ using mozilla::RefPtr; // Screenshots use the (undocumented) png pasteboard type. #define IMAGE_PASTEBOARD_TYPES NSTIFFPboardType, @"Apple PNG pasteboard type", nil -#ifdef PR_LOGGING extern PRLogModuleInfo* sCocoaLog; -#endif extern void EnsureLogInitialized(); diff --git a/widget/cocoa/nsDragService.mm b/widget/cocoa/nsDragService.mm index 573273bc30..6ddc1afa73 100644 --- a/widget/cocoa/nsDragService.mm +++ b/widget/cocoa/nsDragService.mm @@ -32,9 +32,7 @@ using namespace mozilla; using namespace mozilla::gfx; -#ifdef PR_LOGGING extern PRLogModuleInfo* sCocoaLog; -#endif extern void EnsureLogInitialized(); diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp index 66cf62e5f6..fbadbdbb4f 100644 --- a/widget/gtk/nsAppShell.cpp +++ b/widget/gtk/nsAppShell.cpp @@ -26,12 +26,10 @@ using mozilla::unused; #define NOTIFY_TOKEN 0xFA -#ifdef PR_LOGGING PRLogModuleInfo *gWidgetLog = nullptr; PRLogModuleInfo *gWidgetFocusLog = nullptr; PRLogModuleInfo *gWidgetDragLog = nullptr; PRLogModuleInfo *gWidgetDrawLog = nullptr; -#endif static GPollFunc sPollFunc; @@ -75,7 +73,6 @@ nsAppShell::~nsAppShell() nsresult nsAppShell::Init() { -#ifdef PR_LOGGING if (!gWidgetLog) gWidgetLog = PR_NewLogModule("Widget"); if (!gWidgetFocusLog) @@ -84,7 +81,6 @@ nsAppShell::Init() gWidgetDragLog = PR_NewLogModule("WidgetDrag"); if (!gWidgetDrawLog) gWidgetDrawLog = PR_NewLogModule("WidgetDraw"); -#endif #ifdef MOZ_ENABLE_DBUS nsCOMPtr powerManagerService = diff --git a/widget/gtk/nsDeviceContextSpecG.cpp b/widget/gtk/nsDeviceContextSpecG.cpp index 46bd2fe464..dac83f3cb9 100644 --- a/widget/gtk/nsDeviceContextSpecG.cpp +++ b/widget/gtk/nsDeviceContextSpecG.cpp @@ -33,7 +33,6 @@ using namespace mozilla; -#ifdef PR_LOGGING static PRLogModuleInfo * GetDeviceContextSpecGTKLog() { @@ -42,7 +41,6 @@ GetDeviceContextSpecGTKLog() sLog = PR_NewLogModule("DeviceContextSpecGTK"); return sLog; } -#endif /* PR_LOGGING */ /* Macro to make lines shorter */ #define DO_PR_DEBUG_LOG(x) PR_LOG(GetDeviceContextSpecGTKLog(), PR_LOG_DEBUG, x) diff --git a/widget/gtk/nsGtkIMModule.cpp b/widget/gtk/nsGtkIMModule.cpp index cb33ec5426..62d0f4c349 100644 --- a/widget/gtk/nsGtkIMModule.cpp +++ b/widget/gtk/nsGtkIMModule.cpp @@ -18,7 +18,6 @@ using namespace mozilla; using namespace mozilla::widget; -#ifdef PR_LOGGING PRLogModuleInfo* gGtkIMLog = nullptr; static const char* @@ -56,7 +55,6 @@ GetEnabledStateName(uint32_t aState) return "UNKNOWN ENABLED STATUS!!"; } } -#endif const static bool kUseSimpleContextDefault = MOZ_WIDGET_GTK == 2; @@ -77,11 +75,9 @@ nsGtkIMModule::nsGtkIMModule(nsWindow* aOwnerWindow) , mIsIMFocused(false) , mIsDeletingSurrounding(false) { -#ifdef PR_LOGGING if (!gGtkIMLog) { gGtkIMLog = PR_NewLogModule("nsGtkIMModuleWidgets"); } -#endif static bool sFirstInstance = true; if (sFirstInstance) { sFirstInstance = false; diff --git a/widget/gtk/nsGtkIMModule.h b/widget/gtk/nsGtkIMModule.h index e62ba85f01..99e079fcee 100644 --- a/widget/gtk/nsGtkIMModule.h +++ b/widget/gtk/nsGtkIMModule.h @@ -153,7 +153,6 @@ protected: */ bool IsValidContext(GtkIMContext* aContext) const; -#ifdef PR_LOGGING const char* GetCompositionStateName() { switch (mCompositionState) { @@ -167,7 +166,6 @@ protected: return "InvaildState"; } } -#endif // PR_LOGGING // mIsIMFocused is set to TRUE when we call gtk_im_context_focus_in(). And diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp index c5bb5007a7..afd55d26e5 100644 --- a/widget/gtk/nsGtkKeyUtils.cpp +++ b/widget/gtk/nsGtkKeyUtils.cpp @@ -22,9 +22,7 @@ #include "nsIBidiKeyboard.h" #include "nsServiceManagerUtils.h" -#ifdef PR_LOGGING PRLogModuleInfo* gKeymapWrapperLog = nullptr; -#endif // PR_LOGGING #include "mozilla/ArrayUtils.h" #include "mozilla/MouseEvents.h" @@ -44,8 +42,6 @@ KeymapWrapper::RepeatState KeymapWrapper::sRepeatState = KeymapWrapper::NOT_PRESSED; nsIBidiKeyboard* sBidiKeyboard = nullptr; -#ifdef PR_LOGGING - static const char* GetBoolName(bool aBool) { return aBool ? "TRUE" : "FALSE"; @@ -71,8 +67,6 @@ KeymapWrapper::GetModifierName(Modifier aModifier) } } -#endif // PR_LOGGING - /* static */ KeymapWrapper::Modifier KeymapWrapper::GetModifierForGDKKeyval(guint aGdkKeyval) { @@ -159,14 +153,12 @@ KeymapWrapper::KeymapWrapper() : mInitialized(false), mGdkKeymap(gdk_keymap_get_default()), mXKBBaseEventCode(0) { -#ifdef PR_LOGGING if (!gKeymapWrapperLog) { gKeymapWrapperLog = PR_NewLogModule("KeymapWrapperWidgets"); } PR_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS, ("KeymapWrapper(%p): Constructor, mGdkKeymap=%p", this, mGdkKeymap)); -#endif // PR_LOGGING g_signal_connect(mGdkKeymap, "keys-changed", (GCallback)OnKeysChanged, this); diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h index 721f152f20..02f1da4396 100644 --- a/widget/gtk/nsGtkKeyUtils.h +++ b/widget/gtk/nsGtkKeyUtils.h @@ -198,9 +198,7 @@ protected: */ static Modifier GetModifierForGDKKeyval(guint aGdkKeyval); -#ifdef PR_LOGGING static const char* GetModifierName(Modifier aModifier); -#endif // PR_LOGGING /** * mGdkKeymap is a wrapped instance by this class. diff --git a/widget/gtk/nsIdleServiceGTK.cpp b/widget/gtk/nsIdleServiceGTK.cpp index cbd7950f0b..e452a17897 100644 --- a/widget/gtk/nsIdleServiceGTK.cpp +++ b/widget/gtk/nsIdleServiceGTK.cpp @@ -13,9 +13,7 @@ #include "prlink.h" #include "prlog.h" -#ifdef PR_LOGGING static PRLogModuleInfo* sIdleLog = nullptr; -#endif typedef bool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base, int* error_base); @@ -38,9 +36,7 @@ static void Initialize() PRLibrary* xsslib = PR_LoadLibrary("libXss.so.1"); if (!xsslib) // ouch. { -#ifdef PR_LOGGING PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to find libXss.so!\n")); -#endif return; } @@ -50,14 +46,13 @@ static void Initialize() PR_FindFunctionSymbol(xsslib, "XScreenSaverAllocInfo"); _XSSQueryInfo = (_XScreenSaverQueryInfo_fn) PR_FindFunctionSymbol(xsslib, "XScreenSaverQueryInfo"); -#ifdef PR_LOGGING + if (!_XSSQueryExtension) PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryExtension!\n")); if (!_XSSAllocInfo) PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSAllocInfo!\n")); if (!_XSSQueryInfo) PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryInfo!\n")); -#endif sInitialized = true; } @@ -65,10 +60,8 @@ static void Initialize() nsIdleServiceGTK::nsIdleServiceGTK() : mXssInfo(nullptr) { -#ifdef PR_LOGGING if (!sIdleLog) sIdleLog = PR_NewLogModule("nsIIdleService"); -#endif Initialize(); } @@ -103,9 +96,7 @@ nsIdleServiceGTK::PollIdleTime(uint32_t *aIdleTime) // We might not have a display (cf. in xpcshell) Display *dplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); if (!dplay) { -#ifdef PR_LOGGING PR_LOG(sIdleLog, PR_LOG_WARNING, ("No display found!\n")); -#endif return false; } @@ -125,9 +116,7 @@ nsIdleServiceGTK::PollIdleTime(uint32_t *aIdleTime) return true; } // If we get here, we couldn't get to XScreenSaver: -#ifdef PR_LOGGING PR_LOG(sIdleLog, PR_LOG_WARNING, ("XSSQueryExtension returned false!\n")); -#endif return false; } diff --git a/widget/nsBaseDragService.cpp b/widget/nsBaseDragService.cpp index 3e54202abb..79dde7287a 100644 --- a/widget/nsBaseDragService.cpp +++ b/widget/nsBaseDragService.cpp @@ -667,7 +667,7 @@ nsBaseDragService::DrawDragForImage(nsPresContext* aPresContext, if (aImageLoader) { RefPtr dt = gfxPlatform::GetPlatform()-> - CreateOffscreenContentDrawTarget(destSize.ToIntSize(), + CreateOffscreenContentDrawTarget(destSize, SurfaceFormat::B8G8R8A8); if (!dt) return NS_ERROR_FAILURE; diff --git a/widget/nsIdleService.cpp b/widget/nsIdleService.cpp index a7993bc720..bb46b73191 100644 --- a/widget/nsIdleService.cpp +++ b/widget/nsIdleService.cpp @@ -46,9 +46,7 @@ using namespace mozilla; // Number of seconds in a day. #define SECONDS_PER_DAY 86400 -#ifdef PR_LOGGING static PRLogModuleInfo *sLog = nullptr; -#endif #define LOG_TAG "GoannaIdleService" #define LOG_LEVEL ANDROID_LOG_DEBUG @@ -396,10 +394,8 @@ nsIdleService::nsIdleService() : mCurrentlySetToTimeoutAt(TimeStamp()), mDeltaToNextIdleSwitchInS(UINT32_MAX), mLastUserInteraction(TimeStamp::Now()) { -#ifdef PR_LOGGING if (sLog == nullptr) sLog = PR_NewLogModule("idleService"); -#endif MOZ_ASSERT(!gIdleService); gIdleService = this; if (XRE_GetProcessType() == GeckoProcessType_Default) { @@ -792,9 +788,7 @@ nsIdleService::IdleTimerCallback(void) void nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout) { -#if defined(PR_LOGGING) || defined(MOZ_WIDGET_ANDROID) TimeDuration nextTimeoutDuration = aNextTimeout - TimeStamp::Now(); -#endif PR_LOG(sLog, PR_LOG_DEBUG, ("idleService: SetTimerExpiryIfBefore: next timeout %0.f msec from now", @@ -874,9 +868,7 @@ nsIdleService::ReconfigureTimer(void) TimeStamp nextTimeoutAt = mLastUserInteraction + TimeDuration::FromSeconds(mDeltaToNextIdleSwitchInS); -#if defined(PR_LOGGING) || defined(MOZ_WIDGET_ANDROID) TimeDuration nextTimeoutDuration = nextTimeoutAt - curTime; -#endif PR_LOG(sLog, PR_LOG_DEBUG, ("idleService: next timeout %0.f msec from now", diff --git a/widget/qt/nsAppShell.cpp b/widget/qt/nsAppShell.cpp index db835236a1..194743c2e1 100644 --- a/widget/qt/nsAppShell.cpp +++ b/widget/qt/nsAppShell.cpp @@ -21,12 +21,10 @@ #include "prlog.h" #endif -#ifdef PR_LOGGING PRLogModuleInfo *gWidgetLog = nullptr; PRLogModuleInfo *gWidgetFocusLog = nullptr; PRLogModuleInfo *gWidgetIMLog = nullptr; PRLogModuleInfo *gWidgetDrawLog = nullptr; -#endif static int sPokeEvent; @@ -38,7 +36,6 @@ nsAppShell::~nsAppShell() nsresult nsAppShell::Init() { -#ifdef PR_LOGGING if (!gWidgetLog) gWidgetLog = PR_NewLogModule("Widget"); if (!gWidgetFocusLog) @@ -47,7 +44,7 @@ nsAppShell::Init() gWidgetIMLog = PR_NewLogModule("WidgetIM"); if (!gWidgetDrawLog) gWidgetDrawLog = PR_NewLogModule("WidgetDraw"); -#endif + sPokeEvent = QEvent::registerEventType(); nsQAppInstance::AddRef(); diff --git a/widget/qt/nsDeviceContextSpecQt.cpp b/widget/qt/nsDeviceContextSpecQt.cpp index b1f0fce57e..309de21386 100644 --- a/widget/qt/nsDeviceContextSpecQt.cpp +++ b/widget/qt/nsDeviceContextSpecQt.cpp @@ -32,10 +32,8 @@ #include "gfxPDFSurface.h" -#ifdef PR_LOGGING static PRLogModuleInfo* DeviceContextSpecQtLM = PR_NewLogModule("DeviceContextSpecQt"); -#endif /* PR_LOGGING */ /* Macro to make lines shorter */ #define DO_PR_DEBUG_LOG(x) PR_LOG(DeviceContextSpecQtLM, PR_LOG_DEBUG, x) diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index 882cecc4fc..a3ef21033c 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -47,7 +47,6 @@ namespace mozilla { namespace widget { -#ifdef PR_LOGGING static const char* kVirtualKeyName[] = { "NULL", "VK_LBUTTON", "VK_RBUTTON", "VK_CANCEL", "VK_MBUTTON", "VK_XBUTTON1", "VK_XBUTTON2", "0x07", @@ -137,8 +136,6 @@ static const char* kVirtualKeyName[] = { static_assert(sizeof(kVirtualKeyName) / sizeof(const char*) == 0x100, "The virtual key name must be defined just 256 keys"); -#endif // #ifdef PR_LOGGING - // Unique id counter associated with a keydown / keypress events. Used in // identifing keypress events for removal from async event dispatch queue // in metrofx after preventDefault is called on keydown events. @@ -2088,20 +2085,16 @@ NativeKey::DispatchKeyPressEventForFollowingCharMessage( KeyboardLayout* KeyboardLayout::sInstance = nullptr; nsIIdleServiceInternal* KeyboardLayout::sIdleService = nullptr; -#ifdef PR_LOGGING PRLogModuleInfo* sKeyboardLayoutLogger = nullptr; -#endif // #ifdef PR_LOGGING // static KeyboardLayout* KeyboardLayout::GetInstance() { if (!sInstance) { -#ifdef PR_LOGGING if (!sKeyboardLayoutLogger) { sKeyboardLayoutLogger = PR_NewLogModule("KeyboardLayoutWidgets"); } -#endif // #ifdef PR_LOGGING sInstance = new KeyboardLayout(); nsCOMPtr idleService = do_GetService("@mozilla.org/widget/idleservice;1"); @@ -2379,7 +2372,6 @@ KeyboardLayout::LoadLayout(HKL aLayout) ::SetKeyboardState(originalKbdState); -#ifdef PR_LOGGING if (PR_LOG_TEST(sKeyboardLayoutLogger, PR_LOG_DEBUG)) { static const UINT kExtendedScanCode[] = { 0x0000, 0xE000 }; static const UINT kMapType = @@ -2402,7 +2394,6 @@ KeyboardLayout::LoadLayout(HKL aLayout) } } } -#endif // #ifdef PR_LOGGING } inline int32_t diff --git a/widget/windows/WinMouseScrollHandler.cpp b/widget/windows/WinMouseScrollHandler.cpp index 93cd1184b9..34146a95c9 100644 --- a/widget/windows/WinMouseScrollHandler.cpp +++ b/widget/windows/WinMouseScrollHandler.cpp @@ -27,7 +27,6 @@ namespace mozilla { namespace widget { -#ifdef PR_LOGGING PRLogModuleInfo* gMouseScrollLog = nullptr; static const char* GetBoolName(bool aBool) @@ -60,9 +59,6 @@ static void LogKeyStateImpl() } #define LOG_KEYSTATE() LogKeyStateImpl() -#else // PR_LOGGING -#define LOG_KEYSTATE() -#endif MouseScrollHandler* MouseScrollHandler::sInstance = nullptr; @@ -103,11 +99,9 @@ MouseScrollHandler::GetCurrentMessagePos() void MouseScrollHandler::Initialize() { -#ifdef PR_LOGGING if (!gMouseScrollLog) { gMouseScrollLog = PR_NewLogModule("MouseScrollHandlerWidgets"); } -#endif Device::Init(); } @@ -648,13 +642,11 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget, return; } } -#ifdef PR_LOGGING else { PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::HandleMouseWheelMessage: NS_WHEEL_WHEEL event is not " "dispatched")); } -#endif } void @@ -1229,12 +1221,10 @@ MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindowBase* aWidget, InitEvent(aWidget, commandEvent); aWidget->DispatchWindowEvent(&commandEvent); } -#ifdef PR_LOGGING else { PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS, ("MouseScroll::Device::Elantech::HandleKeyMessage(): Consumed")); } -#endif return true; // consume the message (doesn't need to dispatch key events) } diff --git a/widget/windows/WinMouseScrollHandler.h b/widget/windows/WinMouseScrollHandler.h index b7d8a179b9..2e506d44b8 100644 --- a/widget/windows/WinMouseScrollHandler.h +++ b/widget/windows/WinMouseScrollHandler.h @@ -383,7 +383,6 @@ private: }; Status mStatus; -#ifdef PR_LOGGING const char* GetStatusName() { switch (mStatus) { @@ -399,7 +398,6 @@ private: return "Unknown"; } } -#endif void Finish(); }; // SynthesizingEvent diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index dcd1e8f0ce..a986e35a92 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -46,9 +46,7 @@ #include "nsTextStore.h" #endif // #ifdef NS_ENABLE_TSF -#ifdef PR_LOGGING PRLogModuleInfo* gWindowsLog = nullptr; -#endif using namespace mozilla::gfx; @@ -432,11 +430,9 @@ WinUtils::DwmFlushProc WinUtils::dwmFlushProcPtr = nullptr; void WinUtils::Initialize() { -#ifdef PR_LOGGING if (!gWindowsLog) { gWindowsLog = PR_NewLogModule("Widget"); } -#endif if (!sDwmDll && IsVistaOrLater()) { sDwmDll = ::LoadLibraryW(kDwmLibraryName); @@ -485,11 +481,9 @@ WinUtils::LogW(const wchar_t *fmt, ...) nullptr) > 0) { // desktop console printf("%s\n", utf8); -#ifdef PR_LOGGING NS_ASSERTION(gWindowsLog, "Called WinUtils Log() but Widget " "log module doesn't exist!"); PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (utf8)); -#endif } delete[] utf8; } @@ -521,11 +515,9 @@ WinUtils::Log(const char *fmt, ...) // desktop console printf("%s\n", buffer); -#ifdef PR_LOGGING NS_ASSERTION(gWindowsLog, "Called WinUtils Log() but Widget " "log module doesn't exist!"); PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (buffer)); -#endif delete[] buffer; } diff --git a/widget/windows/nsClipboard.cpp b/widget/windows/nsClipboard.cpp index 140cb97bc5..a2c7111fbc 100644 --- a/widget/windows/nsClipboard.cpp +++ b/widget/windows/nsClipboard.cpp @@ -34,9 +34,7 @@ #include "nsEscape.h" #include "nsIObserverService.h" -#ifdef PR_LOGGING PRLogModuleInfo* gWin32ClipboardLog = nullptr; -#endif // oddly, this isn't in the MSVC headers anywhere. UINT nsClipboard::CF_HTML = ::RegisterClipboardFormatW(L"HTML Format"); @@ -49,11 +47,9 @@ UINT nsClipboard::CF_HTML = ::RegisterClipboardFormatW(L"HTML Format"); //------------------------------------------------------------------------- nsClipboard::nsClipboard() : nsBaseClipboard() { -#ifdef PR_LOGGING if (!gWin32ClipboardLog) { gWin32ClipboardLog = PR_NewLogModule("nsClipboard"); } -#endif mIgnoreEmptyNotification = false; mWindow = nullptr; diff --git a/widget/windows/nsDeviceContextSpecWin.cpp b/widget/windows/nsDeviceContextSpecWin.cpp index 15e41cf03c..86325eb093 100644 --- a/widget/windows/nsDeviceContextSpecWin.cpp +++ b/widget/windows/nsDeviceContextSpecWin.cpp @@ -42,12 +42,8 @@ #define NS_ERROR_GFX_PRINTER_BUNDLE_URL "chrome://global/locale/printing.properties" #include "prlog.h" -#ifdef PR_LOGGING PRLogModuleInfo * kWidgetPrintingLogMod = PR_NewLogModule("printing-widget"); #define PR_PL(_p1) PR_LOG(kWidgetPrintingLogMod, PR_LOG_DEBUG, _p1) -#else -#define PR_PL(_p1) -#endif using namespace mozilla; diff --git a/widget/windows/nsIMM32Handler.cpp b/widget/windows/nsIMM32Handler.cpp index e7c090ba72..78bfd0ecfc 100644 --- a/widget/windows/nsIMM32Handler.cpp +++ b/widget/windows/nsIMM32Handler.cpp @@ -21,9 +21,7 @@ using namespace mozilla::widget; static nsIMM32Handler* gIMM32Handler = nullptr; -#ifdef PR_LOGGING PRLogModuleInfo* gIMM32Log = nullptr; -#endif static UINT sWM_MSIME_MOUSE = 0; // mouse message for MSIME 98/2000 @@ -57,10 +55,8 @@ nsIMM32Handler::EnsureHandlerInstance() /* static */ void nsIMM32Handler::Initialize() { -#ifdef PR_LOGGING if (!gIMM32Log) gIMM32Log = PR_NewLogModule("nsIMM32HandlerWidgets"); -#endif if (!sWM_MSIME_MOUSE) { sWM_MSIME_MOUSE = ::RegisterWindowMessage(RWM_MOUSE); @@ -533,7 +529,6 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow, LPARAM lParam, MSGResult& aResult) { -#ifdef PR_LOGGING switch (wParam) { case IMN_CHANGECANDIDATE: PR_LOG(gIMM32Log, PR_LOG_ALWAYS, @@ -606,7 +601,6 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow, aWindow->GetWindowHandle())); break; } -#endif // PR_LOGGING // not implement yet aResult.mConsumed = false; @@ -1544,7 +1538,6 @@ PlatformToNSAttr(uint8_t aAttr) } } -#ifdef PR_LOGGING static const char* GetRangeTypeName(uint32_t aRangeType) { @@ -1563,7 +1556,6 @@ GetRangeTypeName(uint32_t aRangeType) return "UNKNOWN SELECTION TYPE!!"; } } -#endif void nsIMM32Handler::DispatchCompositionChangeEvent(nsWindow* aWindow, diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index 08faae0d10..9defd8d683 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -42,9 +42,7 @@ using mozilla::IsVistaOrLater; using namespace mozilla; using namespace mozilla::widget; -#ifdef PR_LOGGING extern PRLogModuleInfo* gWindowsLog; -#endif NS_IMPL_ISUPPORTS_INHERITED(nsNativeThemeWin, nsNativeTheme, nsITheme) diff --git a/widget/windows/nsNativeThemeWin.h b/widget/windows/nsNativeThemeWin.h index 96ddce2357..53a1545612 100644 --- a/widget/windows/nsNativeThemeWin.h +++ b/widget/windows/nsNativeThemeWin.h @@ -14,9 +14,9 @@ #include "gfxTypes.h" #include #include "mozilla/TimeStamp.h" +#include "nsSize.h" struct nsIntRect; -struct nsIntSize; class nsNativeThemeWin : private nsNativeTheme, public nsITheme { diff --git a/widget/windows/nsSound.cpp b/widget/windows/nsSound.cpp index 2db0d31990..8bef15580e 100644 --- a/widget/windows/nsSound.cpp +++ b/widget/windows/nsSound.cpp @@ -27,9 +27,7 @@ #include "nsNativeCharsetUtils.h" #include "nsThreadUtils.h" -#ifdef PR_LOGGING PRLogModuleInfo* gWin32SoundLog = nullptr; -#endif class nsSoundPlayer: public nsRunnable { public: @@ -108,11 +106,9 @@ NS_IMPL_ISUPPORTS(nsSound, nsISound, nsIStreamLoaderObserver) nsSound::nsSound() { -#ifdef PR_LOGGING if (!gWin32SoundLog) { gWin32SoundLog = PR_NewLogModule("nsSound"); } -#endif mLastSound = nullptr; } diff --git a/widget/windows/nsTextStore.cpp b/widget/windows/nsTextStore.cpp index dc38aff54e..e1bdfbcf23 100644 --- a/widget/windows/nsTextStore.cpp +++ b/widget/windows/nsTextStore.cpp @@ -26,7 +26,6 @@ using namespace mozilla::widget; static const char* kPrefNameEnableTSF = "intl.tsf.enable"; static const char* kPrefNameForceEnableTSF = "intl.tsf.force_enable"; -#ifdef PR_LOGGING /** * TSF related code should log its behavior even on release build especially * in the interface methods. @@ -629,8 +628,6 @@ GetModifiersName(Modifiers aModifiers) return names; } -#endif // #ifdef PR_LOGGING - /******************************************************************/ /* InputScopeImpl */ /******************************************************************/ @@ -1968,7 +1965,6 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty, HRESULT hr; -#ifdef PR_LOGGING if (PR_LOG_TEST(sTextStoreLog, PR_LOG_DEBUG)) { LONG start = 0, length = 0; hr = GetRangeExtent(aRange, &start, &length); @@ -1979,7 +1975,6 @@ nsTextStore::GetDisplayAttribute(ITfProperty* aAttrProperty, start - mComposition.mStart + length, GetCommonReturnValueName(hr))); } -#endif VARIANT propValue; ::VariantInit(&propValue); @@ -3827,7 +3822,6 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition, return hr; } -#ifdef PR_LOGGING if (PR_LOG_TEST(sTextStoreLog, PR_LOG_ALWAYS)) { Selection& currentSel = CurrentSelection(); if (currentSel.IsDirty()) { @@ -3845,7 +3839,6 @@ nsTextStore::OnUpdateComposition(ITfCompositionView* pComposition, currentSel.StartOffset(), currentSel.EndOffset(), GetActiveSelEndName(currentSel.ActiveSelEnd()))); } -#endif // #ifdef PR_LOGGING return S_OK; } @@ -4582,11 +4575,9 @@ nsTextStore::MarkContextAsEmpty(ITfContext* aContext) void nsTextStore::Initialize() { -#ifdef PR_LOGGING if (!sTextStoreLog) { sTextStoreLog = PR_NewLogModule("nsTextStoreWidgets"); } -#endif PR_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: nsTextStore::Initialize() is called...")); diff --git a/widget/windows/nsWinGesture.cpp b/widget/windows/nsWinGesture.cpp index 19c24899c7..d612579371 100644 --- a/widget/windows/nsWinGesture.cpp +++ b/widget/windows/nsWinGesture.cpp @@ -20,9 +20,7 @@ using namespace mozilla; using namespace mozilla::widget; -#ifdef PR_LOGGING extern PRLogModuleInfo* gWindowsLog; -#endif const wchar_t nsWinGesture::kGestureLibraryName[] = L"user32.dll"; HMODULE nsWinGesture::sLibraryHandle = nullptr; diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index b28aeaae85..a82f5bad57 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -262,9 +262,7 @@ TimeStamp nsWindow::sFirstEventTimeStamp = TimeStamp(); static const char *sScreenManagerContractID = "@mozilla.org/gfx/screenmanager;1"; -#ifdef PR_LOGGING extern PRLogModuleInfo* gWindowsLog; -#endif // Global used in Show window enumerations. static bool gWindowsVisible = false; diff --git a/widget/windows/nsWindowDbg.cpp b/widget/windows/nsWindowDbg.cpp index af2063ba9b..e569c389ec 100644 --- a/widget/windows/nsWindowDbg.cpp +++ b/widget/windows/nsWindowDbg.cpp @@ -12,9 +12,7 @@ using namespace mozilla::widget; -#ifdef PR_LOGGING extern PRLogModuleInfo* gWindowsLog; -#endif #if defined(POPUP_ROLLUP_DEBUG_OUTPUT) MSGFEventMsgInfo gMSGFEvents[] = {