/work/obj-fuzz/dist/include/nsISupportsUtils.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef nsISupportsUtils_h__ |
8 | | #define nsISupportsUtils_h__ |
9 | | |
10 | | #include "nscore.h" |
11 | | #include "nsISupportsBase.h" |
12 | | #include "nsError.h" |
13 | | #include "nsDebug.h" |
14 | | #include "nsISupportsImpl.h" |
15 | | #include "mozilla/RefPtr.h" |
16 | | #include "mozilla/TypeTraits.h" |
17 | | |
18 | | /** |
19 | | * Macro for adding a reference to an interface. |
20 | | * @param _ptr The interface pointer. |
21 | | */ |
22 | | #define NS_ADDREF(_ptr) \ |
23 | 17.9M | (_ptr)->AddRef() |
24 | | |
25 | | /** |
26 | | * Macro for adding a reference to this. This macro should be used |
27 | | * because NS_ADDREF (when tracing) may require an ambiguous cast |
28 | | * from the pointers primary type to nsISupports. This macro sidesteps |
29 | | * that entire problem. |
30 | | */ |
31 | | #define NS_ADDREF_THIS() \ |
32 | 1.62M | AddRef() |
33 | | |
34 | | |
35 | | // Making this a |inline| |template| allows |aExpr| to be evaluated only once, |
36 | | // yet still denies you the ability to |AddRef()| an |nsCOMPtr|. |
37 | | template<class T> |
38 | | inline void |
39 | | ns_if_addref(T aExpr) |
40 | 70 | { |
41 | 70 | if (aExpr) { |
42 | 56 | aExpr->AddRef(); |
43 | 56 | } |
44 | 70 | } void ns_if_addref<nsISupports*>(nsISupports*) Line | Count | Source | 40 | 9 | { | 41 | 9 | if (aExpr) { | 42 | 9 | aExpr->AddRef(); | 43 | 9 | } | 44 | 9 | } |
Unexecuted instantiation: void ns_if_addref<nsIOpenSignedAppFileCallback*>(nsIOpenSignedAppFileCallback*) Unexecuted instantiation: void ns_if_addref<nsIDOMEventListener*>(nsIDOMEventListener*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::EventListener*>(mozilla::dom::EventListener*) Unexecuted instantiation: void ns_if_addref<nsIVariant*>(nsIVariant*) Unexecuted instantiation: void ns_if_addref<nsIInputStream*>(nsIInputStream*) Unexecuted instantiation: void ns_if_addref<nsIOutputStream*>(nsIOutputStream*) Unexecuted instantiation: void ns_if_addref<nsIEventTarget*>(nsIEventTarget*) Unexecuted instantiation: void ns_if_addref<nsThread*>(nsThread*) Unexecuted instantiation: void ns_if_addref<nsIThread*>(nsIThread*) Unexecuted instantiation: void ns_if_addref<nsIThreadPoolListener*>(nsIThreadPoolListener*) Unexecuted instantiation: void ns_if_addref<nsITimerCallback*>(nsITimerCallback*) Unexecuted instantiation: void ns_if_addref<gfxFontEntry*>(gfxFontEntry*) void ns_if_addref<nsIURI*>(nsIURI*) Line | Count | Source | 40 | 14 | { | 41 | 14 | if (aExpr) { | 42 | 0 | aExpr->AddRef(); | 43 | 0 | } | 44 | 14 | } |
Unexecuted instantiation: void ns_if_addref<nsHyphenator*>(nsHyphenator*) Unexecuted instantiation: void ns_if_addref<nsIBackgroundFileSaverObserver*>(nsIBackgroundFileSaverObserver*) Unexecuted instantiation: void ns_if_addref<nsIArray*>(nsIArray*) Unexecuted instantiation: void ns_if_addref<NetDashboardCallback*>(NetDashboardCallback*) Unexecuted instantiation: void ns_if_addref<nsIPrincipal*>(nsIPrincipal*) Unexecuted instantiation: void ns_if_addref<nsIChannel*>(nsIChannel*) Unexecuted instantiation: void ns_if_addref<nsIParentChannel*>(nsIParentChannel*) Unexecuted instantiation: void ns_if_addref<mozilla::net::nsHttpConnectionInfo*>(mozilla::net::nsHttpConnectionInfo*) Unexecuted instantiation: void ns_if_addref<nsITLSServerSecurityObserver*>(nsITLSServerSecurityObserver*) Unexecuted instantiation: void ns_if_addref<nsIRequestContext*>(nsIRequestContext*) Unexecuted instantiation: void ns_if_addref<nsIX509Cert*>(nsIX509Cert*) Unexecuted instantiation: void ns_if_addref<nsITLSServerSocket*>(nsITLSServerSocket*) Unexecuted instantiation: void ns_if_addref<nsITLSClientStatus*>(nsITLSClientStatus*) Unexecuted instantiation: void ns_if_addref<nsILoadGroup*>(nsILoadGroup*) void ns_if_addref<nsILoadInfo*>(nsILoadInfo*) Line | Count | Source | 40 | 39 | { | 41 | 39 | if (aExpr) { | 42 | 39 | aExpr->AddRef(); | 43 | 39 | } | 44 | 39 | } |
Unexecuted instantiation: void ns_if_addref<nsIInterfaceRequestor*>(nsIInterfaceRequestor*) void ns_if_addref<nsIDNSService*>(nsIDNSService*) Line | Count | Source | 40 | 3 | { | 41 | 3 | if (aExpr) { | 42 | 3 | aExpr->AddRef(); | 43 | 3 | } | 44 | 3 | } |
Unexecuted instantiation: void ns_if_addref<nsIRequest*>(nsIRequest*) Unexecuted instantiation: void ns_if_addref<nsIRequestObserver*>(nsIRequestObserver*) Unexecuted instantiation: void ns_if_addref<nsIServerSocketListener*>(nsIServerSocketListener*) Unexecuted instantiation: void ns_if_addref<nsIProxyInfo*>(nsIProxyInfo*) Unexecuted instantiation: void ns_if_addref<mozilla::net::nsSocketTransportService*>(mozilla::net::nsSocketTransportService*) Unexecuted instantiation: void ns_if_addref<nsIUDPSocketListener*>(nsIUDPSocketListener*) Unexecuted instantiation: void ns_if_addref<nsIDNSListener*>(nsIDNSListener*) Unexecuted instantiation: void ns_if_addref<nsIDirIndexListener*>(nsIDirIndexListener*) Unexecuted instantiation: void ns_if_addref<nsICacheListener*>(nsICacheListener*) Unexecuted instantiation: void ns_if_addref<nsOfflineCacheDevice*>(nsOfflineCacheDevice*) Unexecuted instantiation: void ns_if_addref<nsIWeakReference*>(nsIWeakReference*) Unexecuted instantiation: void ns_if_addref<mozilla::net::CacheFileChunk*>(mozilla::net::CacheFileChunk*) Unexecuted instantiation: void ns_if_addref<mozilla::net::CacheEntry*>(mozilla::net::CacheEntry*) void ns_if_addref<nsIIOService*>(nsIIOService*) Line | Count | Source | 40 | 1 | { | 41 | 1 | if (aExpr) { | 42 | 1 | aExpr->AddRef(); | 43 | 1 | } | 44 | 1 | } |
Unexecuted instantiation: void ns_if_addref<nsIStreamConverterService*>(nsIStreamConverterService*) Unexecuted instantiation: void ns_if_addref<nsISiteSecurityService*>(nsISiteSecurityService*) Unexecuted instantiation: void ns_if_addref<nsICookieService*>(nsICookieService*) Unexecuted instantiation: void ns_if_addref<nsIStreamListener*>(nsIStreamListener*) Unexecuted instantiation: void ns_if_addref<nsIApplicationCache*>(nsIApplicationCache*) Unexecuted instantiation: void ns_if_addref<nsIHttpActivityObserver*>(nsIHttpActivityObserver*) Unexecuted instantiation: void ns_if_addref<nsIWifiListener*>(nsIWifiListener*) void ns_if_addref<nsJAR*>(nsJAR*) Line | Count | Source | 40 | 4 | { | 41 | 4 | if (aExpr) { | 42 | 4 | aExpr->AddRef(); | 43 | 4 | } | 44 | 4 | } |
Unexecuted instantiation: void ns_if_addref<mozIStorageConnection*>(mozIStorageConnection*) Unexecuted instantiation: void ns_if_addref<mozIStorageProgressHandler*>(mozIStorageProgressHandler*) Unexecuted instantiation: void ns_if_addref<mozilla::storage::AsyncStatementParamsHolder*>(mozilla::storage::AsyncStatementParamsHolder*) Unexecuted instantiation: void ns_if_addref<mozilla::storage::StatementRowHolder*>(mozilla::storage::StatementRowHolder*) Unexecuted instantiation: void ns_if_addref<mozilla::storage::StatementParamsHolder*>(mozilla::storage::StatementParamsHolder*) Unexecuted instantiation: void ns_if_addref<mozilla::MozPromise<bool, nsresult, false>::Private*>(mozilla::MozPromise<bool, nsresult, false>::Private*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::WebrtcGlobalStatisticsCallback*>(mozilla::dom::WebrtcGlobalStatisticsCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::WebrtcGlobalLoggingCallback*>(mozilla::dom::WebrtcGlobalLoggingCallback*) Unexecuted instantiation: void ns_if_addref<nsIHandlerApp*>(nsIHandlerApp*) Unexecuted instantiation: void ns_if_addref<nsIMutableArray*>(nsIMutableArray*) Unexecuted instantiation: void ns_if_addref<nsIContentSecurityPolicy*>(nsIContentSecurityPolicy*) Unexecuted instantiation: void ns_if_addref<nsISAXContentHandler*>(nsISAXContentHandler*) Unexecuted instantiation: void ns_if_addref<nsISAXErrorHandler*>(nsISAXErrorHandler*) Unexecuted instantiation: void ns_if_addref<nsIDTD*>(nsIDTD*) Unexecuted instantiation: void ns_if_addref<mozilla::gfx::SourceSurfaceSharedDataWrapper*>(mozilla::gfx::SourceSurfaceSharedDataWrapper*) Unexecuted instantiation: void ns_if_addref<mozilla::layers::MaskOperation*>(mozilla::layers::MaskOperation*) Unexecuted instantiation: void ns_if_addref<mozilla::gfx::VRDisplayHost*>(mozilla::gfx::VRDisplayHost*) Unexecuted instantiation: void ns_if_addref<mozilla::gfx::VRControllerHost*>(mozilla::gfx::VRControllerHost*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::Promise*>(mozilla::dom::Promise*) Unexecuted instantiation: void ns_if_addref<mozilla::gfx::impl::VRControllerPuppet*>(mozilla::gfx::impl::VRControllerPuppet*) Unexecuted instantiation: void ns_if_addref<mozilla::image::ImageSurfaceCache*>(mozilla::image::ImageSurfaceCache*) Unexecuted instantiation: void ns_if_addref<mozilla::image::CachedSurface*>(mozilla::image::CachedSurface*) Unexecuted instantiation: void ns_if_addref<imgCacheEntry*>(imgCacheEntry*) Unexecuted instantiation: void ns_if_addref<imgINotificationObserver*>(imgINotificationObserver*) Unexecuted instantiation: void ns_if_addref<imgILoader*>(imgILoader*) Unexecuted instantiation: void ns_if_addref<nsIURL*>(nsIURL*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::Element*>(mozilla::dom::Element*) Unexecuted instantiation: void ns_if_addref<nsINode*>(nsINode*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::MessageListener*>(mozilla::dom::MessageListener*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::Gamepad*>(mozilla::dom::Gamepad*) Unexecuted instantiation: void ns_if_addref<nsIBrowserDOMWindow*>(nsIBrowserDOMWindow*) Unexecuted instantiation: void ns_if_addref<nsIController*>(nsIController*) Unexecuted instantiation: void ns_if_addref<nsIWidget*>(nsIWidget*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::CustomElementCreationCallback*>(mozilla::dom::CustomElementCreationCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::css::URLValue*>(mozilla::css::URLValue*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::NavigatorUserMediaSuccessCallback*>(mozilla::dom::NavigatorUserMediaSuccessCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::NavigatorUserMediaErrorCallback*>(mozilla::dom::NavigatorUserMediaErrorCallback*) Unexecuted instantiation: void ns_if_addref<nsAtom*>(nsAtom*) Unexecuted instantiation: void ns_if_addref<nsIContent*>(nsIContent*) Unexecuted instantiation: void ns_if_addref<nsPIDOMWindowOuter*>(nsPIDOMWindowOuter*) Unexecuted instantiation: void ns_if_addref<mozIDOMWindowProxy*>(mozIDOMWindowProxy*) Unexecuted instantiation: void ns_if_addref<nsIFocusManager*>(nsIFocusManager*) Unexecuted instantiation: void ns_if_addref<nsIDocument*>(nsIDocument*) Unexecuted instantiation: void ns_if_addref<nsIPresShell*>(nsIPresShell*) Unexecuted instantiation: void ns_if_addref<nsIControllers*>(nsIControllers*) Unexecuted instantiation: void ns_if_addref<nsIControllerCommand*>(nsIControllerCommand*) Unexecuted instantiation: void ns_if_addref<nsICacheInfoChannel*>(nsICacheInfoChannel*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::PositionCallback*>(mozilla::dom::PositionCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::PositionErrorCallback*>(mozilla::dom::PositionErrorCallback*) Unexecuted instantiation: void ns_if_addref<nsIDOMGeoPositionCallback*>(nsIDOMGeoPositionCallback*) Unexecuted instantiation: void ns_if_addref<nsIDOMGeoPositionErrorCallback*>(nsIDOMGeoPositionErrorCallback*) Unexecuted instantiation: void ns_if_addref<nsIDOMGeoPositionCoords*>(nsIDOMGeoPositionCoords*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::HTMLInputElement*>(mozilla::dom::HTMLInputElement*) Unexecuted instantiation: void ns_if_addref<nsMappedAttributes*>(nsMappedAttributes*) Unexecuted instantiation: void ns_if_addref<nsIDOMGetUserMediaSuccessCallback*>(nsIDOMGetUserMediaSuccessCallback*) Unexecuted instantiation: void ns_if_addref<nsIDOMGetUserMediaErrorCallback*>(nsIDOMGetUserMediaErrorCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::GetUserMediaTask*>(mozilla::GetUserMediaTask*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::MediaKeySession*>(mozilla::dom::MediaKeySession*) Unexecuted instantiation: void ns_if_addref<mozilla::gmp::GMPContentParent*>(mozilla::gmp::GMPContentParent*) Unexecuted instantiation: void ns_if_addref<mozilla::gmp::GMPStorage*>(mozilla::gmp::GMPStorage*) Unexecuted instantiation: void ns_if_addref<mozilla::gmp::GMPRecordImpl*>(mozilla::gmp::GMPRecordImpl*) Unexecuted instantiation: void ns_if_addref<mozilla::MediaSourceDecoder*>(mozilla::MediaSourceDecoder*) Unexecuted instantiation: void ns_if_addref<mozilla::MediaEngineSource*>(mozilla::MediaEngineSource*) Unexecuted instantiation: void ns_if_addref<mozilla::media::Refcountable<mozilla::dom::MediaTrackSettings>*>(mozilla::media::Refcountable<mozilla::dom::MediaTrackSettings>*) Unexecuted instantiation: void ns_if_addref<mozIDOMWindow*>(mozIDOMWindow*) Unexecuted instantiation: void ns_if_addref<nsPIDOMWindowInner*>(nsPIDOMWindowInner*) Unexecuted instantiation: void ns_if_addref<nsIQuotaUsageCallback*>(nsIQuotaUsageCallback*) Unexecuted instantiation: void ns_if_addref<nsIQuotaCallback*>(nsIQuotaCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::SessionStorageCache*>(mozilla::dom::SessionStorageCache*) Unexecuted instantiation: void ns_if_addref<mozIStorageStatement*>(mozIStorageStatement*) Unexecuted instantiation: void ns_if_addref<nsNPAPIPluginInstance*>(nsNPAPIPluginInstance*) Unexecuted instantiation: void ns_if_addref<mozilla::plugins::PluginInstanceChild::DirectBitmap*>(mozilla::plugins::PluginInstanceChild::DirectBitmap*) Unexecuted instantiation: void ns_if_addref<mozilla::layers::ImageContainer*>(mozilla::layers::ImageContainer*) Unexecuted instantiation: ActorsParent.cpp:void ns_if_addref<mozilla::dom::indexedDB::(anonymous namespace)::FullObjectStoreMetadata*>(mozilla::dom::indexedDB::(anonymous namespace)::FullObjectStoreMetadata*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::indexedDB::FileInfo*>(mozilla::dom::indexedDB::FileInfo*) Unexecuted instantiation: ActorsParent.cpp:void ns_if_addref<mozilla::dom::indexedDB::(anonymous namespace)::FullIndexMetadata*>(mozilla::dom::indexedDB::(anonymous namespace)::FullIndexMetadata*) Unexecuted instantiation: void ns_if_addref<nsIWebBrowserChrome3*>(nsIWebBrowserChrome3*) Unexecuted instantiation: void ns_if_addref<nsIStorageStream*>(nsIStorageStream*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::U2FRegisterCallback*>(mozilla::dom::U2FRegisterCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::U2FSignCallback*>(mozilla::dom::U2FSignCallback*) Unexecuted instantiation: void ns_if_addref<nsIWebProgressListener*>(nsIWebProgressListener*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::ModuleScript*>(mozilla::dom::ModuleScript*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::ServiceWorkerPrivate*>(mozilla::dom::ServiceWorkerPrivate*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::KeepAliveToken*>(mozilla::dom::KeepAliveToken*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::ServiceWorkerRegistrationInfo*>(mozilla::dom::ServiceWorkerRegistrationInfo*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::ServiceWorkerJobQueue*>(mozilla::dom::ServiceWorkerJobQueue*) Unexecuted instantiation: void ns_if_addref<nsIInterceptedChannel*>(nsIInterceptedChannel*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::ServiceWorkerInfo*>(mozilla::dom::ServiceWorkerInfo*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::ServiceWorkerUpdateJob*>(mozilla::dom::ServiceWorkerUpdateJob*) Unexecuted instantiation: void ns_if_addref<nsISDBCloseCallback*>(nsISDBCloseCallback*) Unexecuted instantiation: void ns_if_addref<nsISDBCallback*>(nsISDBCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::PresentationSessionInfo*>(mozilla::dom::PresentationSessionInfo*) Unexecuted instantiation: void ns_if_addref<nsIPresentationRespondingListener*>(nsIPresentationRespondingListener*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::PresentationContentSessionInfo*>(mozilla::dom::PresentationContentSessionInfo*) Unexecuted instantiation: void ns_if_addref<nsIPresentationSessionListener*>(nsIPresentationSessionListener*) Unexecuted instantiation: void ns_if_addref<mozilla::dom::DataTransfer*>(mozilla::dom::DataTransfer*) Unexecuted instantiation: void ns_if_addref<nsIScreen*>(nsIScreen*) Unexecuted instantiation: void ns_if_addref<nsIFormatConverter*>(nsIFormatConverter*) Unexecuted instantiation: void ns_if_addref<nsITransactionManager*>(nsITransactionManager*) Unexecuted instantiation: void ns_if_addref<nsIInlineSpellChecker*>(nsIInlineSpellChecker*) Unexecuted instantiation: void ns_if_addref<mozilla::css::SheetLoadData*>(mozilla::css::SheetLoadData*) Unexecuted instantiation: void ns_if_addref<nsILayoutHistoryState*>(nsILayoutHistoryState*) Unexecuted instantiation: void ns_if_addref<nsPresContext*>(nsPresContext*) Unexecuted instantiation: void ns_if_addref<nsIContentViewer*>(nsIContentViewer*) Unexecuted instantiation: void ns_if_addref<nsISHEntry*>(nsISHEntry*) Unexecuted instantiation: void ns_if_addref<nsISelectionController*>(nsISelectionController*) Unexecuted instantiation: void ns_if_addref<gfxPattern*>(gfxPattern*) Unexecuted instantiation: void ns_if_addref<nsBoxLayout*>(nsBoxLayout*) Unexecuted instantiation: void ns_if_addref<nsITreeView*>(nsITreeView*) Unexecuted instantiation: void ns_if_addref<nsITreeSelection*>(nsITreeSelection*) Unexecuted instantiation: void ns_if_addref<nsITreeBoxObject*>(nsITreeBoxObject*) Unexecuted instantiation: void ns_if_addref<nsTreeColumn*>(nsTreeColumn*) Unexecuted instantiation: void ns_if_addref<nsIPrintSettings*>(nsIPrintSettings*) Unexecuted instantiation: void ns_if_addref<nsIURIContentListener*>(nsIURIContentListener*) Unexecuted instantiation: void ns_if_addref<nsISecureBrowserUI*>(nsISecureBrowserUI*) Unexecuted instantiation: void ns_if_addref<nsILoadURIDelegate*>(nsILoadURIDelegate*) Unexecuted instantiation: void ns_if_addref<nsIDocShellTreeOwner*>(nsIDocShellTreeOwner*) Unexecuted instantiation: void ns_if_addref<nsIHttpChannel*>(nsIHttpChannel*) Unexecuted instantiation: void ns_if_addref<nsIBFCacheEntry*>(nsIBFCacheEntry*) Unexecuted instantiation: void ns_if_addref<nsIDocShellTreeItem*>(nsIDocShellTreeItem*) Unexecuted instantiation: void ns_if_addref<nsIStructuredCloneContainer*>(nsIStructuredCloneContainer*) Unexecuted instantiation: void ns_if_addref<nsIXULWindow*>(nsIXULWindow*) Unexecuted instantiation: void ns_if_addref<nsIDocShell*>(nsIDocShell*) Unexecuted instantiation: void ns_if_addref<nsIXULBrowserWindow*>(nsIXULBrowserWindow*) Unexecuted instantiation: void ns_if_addref<nsIAccessible*>(nsIAccessible*) Unexecuted instantiation: void ns_if_addref<nsIAccessibleDocument*>(nsIAccessibleDocument*) Unexecuted instantiation: void ns_if_addref<nsIAccessibleHyperLink*>(nsIAccessibleHyperLink*) Unexecuted instantiation: void ns_if_addref<nsIAccessibleText*>(nsIAccessibleText*) Unexecuted instantiation: void ns_if_addref<mozIPersonalDictionary*>(mozIPersonalDictionary*) Unexecuted instantiation: void ns_if_addref<nsIEditorSpellCheck*>(nsIEditorSpellCheck*) Unexecuted instantiation: void ns_if_addref<nsILocalCertGetCallback*>(nsILocalCertGetCallback*) Unexecuted instantiation: void ns_if_addref<nsILocalCertCallback*>(nsILocalCertCallback*) Unexecuted instantiation: void ns_if_addref<mozilla::DataStorage*>(mozilla::DataStorage*) Unexecuted instantiation: void ns_if_addref<nsIObserver*>(nsIObserver*) Unexecuted instantiation: void ns_if_addref<nsIX509CertList*>(nsIX509CertList*) Unexecuted instantiation: void ns_if_addref<nsICertTreeItem*>(nsICertTreeItem*) Unexecuted instantiation: void ns_if_addref<nsKeygenThread*>(nsKeygenThread*) Unexecuted instantiation: void ns_if_addref<nsICertVerificationCallback*>(nsICertVerificationCallback*) Unexecuted instantiation: void ns_if_addref<nsITransportSecurityInfo*>(nsITransportSecurityInfo*) Unexecuted instantiation: void ns_if_addref<nsIDOMWindow*>(nsIDOMWindow*) Unexecuted instantiation: void ns_if_addref<nsITabParent*>(nsITabParent*) Unexecuted instantiation: void ns_if_addref<nsINativeOSFileSuccessCallback*>(nsINativeOSFileSuccessCallback*) Unexecuted instantiation: void ns_if_addref<nsINativeOSFileErrorCallback*>(nsINativeOSFileErrorCallback*) Unexecuted instantiation: void ns_if_addref<nsIPerformanceGroupDetails*>(nsIPerformanceGroupDetails*) Unexecuted instantiation: void ns_if_addref<nsIPerformanceStats*>(nsIPerformanceStats*) Unexecuted instantiation: void ns_if_addref<nsIPerformanceObservable*>(nsIPerformanceObservable*) Unexecuted instantiation: void ns_if_addref<mozIVisitedStatusCallback*>(mozIVisitedStatusCallback*) Unexecuted instantiation: void ns_if_addref<mozIStorageAsyncStatement*>(mozIStorageAsyncStatement*) Unexecuted instantiation: void ns_if_addref<nsIFaviconDataCallback*>(nsIFaviconDataCallback*) Unexecuted instantiation: void ns_if_addref<mozIVisitInfoCallback*>(mozIVisitInfoCallback*) Unexecuted instantiation: void ns_if_addref<nsIAsyncShutdownBarrier*>(nsIAsyncShutdownBarrier*) Unexecuted instantiation: void ns_if_addref<nsIAsyncShutdownClient*>(nsIAsyncShutdownClient*) Unexecuted instantiation: void ns_if_addref<mozIStoragePendingStatement*>(mozIStoragePendingStatement*) Unexecuted instantiation: void ns_if_addref<nsINavHistoryContainerResultNode*>(nsINavHistoryContainerResultNode*) Unexecuted instantiation: void ns_if_addref<nsINavHistoryResult*>(nsINavHistoryResult*) Unexecuted instantiation: void ns_if_addref<nsIUrlClassifierLookupCallback*>(nsIUrlClassifierLookupCallback*) Unexecuted instantiation: void ns_if_addref<nsIUrlClassifierCallback*>(nsIUrlClassifierCallback*) Unexecuted instantiation: void ns_if_addref<nsIUrlClassifierUpdateObserver*>(nsIUrlClassifierUpdateObserver*) Unexecuted instantiation: void ns_if_addref<nsIUrlClassifierGetCacheCallback*>(nsIUrlClassifierGetCacheCallback*) Unexecuted instantiation: void ns_if_addref<nsIURIClassifierCallback*>(nsIURIClassifierCallback*) Unexecuted instantiation: void ns_if_addref<nsIUrlClassifierHashCompleter*>(nsIUrlClassifierHashCompleter*) Unexecuted instantiation: void ns_if_addref<nsIWebBrowserChrome*>(nsIWebBrowserChrome*) Unexecuted instantiation: void ns_if_addref<nsIAutoCompleteInput*>(nsIAutoCompleteInput*) Unexecuted instantiation: void ns_if_addref<nsIAutoCompletePopup*>(nsIAutoCompletePopup*) Unexecuted instantiation: void ns_if_addref<nsIAutoCompleteController*>(nsIAutoCompleteController*) Unexecuted instantiation: void ns_if_addref<nsINativeAppSupport*>(nsINativeAppSupport*) Unexecuted instantiation: void ns_if_addref<nsIIdentityKeyGenCallback*>(nsIIdentityKeyGenCallback*) Unexecuted instantiation: void ns_if_addref<nsIIdentitySignCallback*>(nsIIdentitySignCallback*) Unexecuted instantiation: void ns_if_addref<TestHashtables::IFoo*>(TestHashtables::IFoo*) |
45 | | |
46 | | /** |
47 | | * Macro for adding a reference to an interface that checks for nullptr. |
48 | | * @param _expr The interface pointer. |
49 | | */ |
50 | 79 | #define NS_IF_ADDREF(_expr) ns_if_addref(_expr) |
51 | | |
52 | | /* |
53 | | * Given these declarations, it explicitly OK and efficient to end a `getter' with: |
54 | | * |
55 | | * NS_IF_ADDREF(*result = mThing); |
56 | | * |
57 | | * even if |mThing| is an |nsCOMPtr|. If |mThing| is an |nsCOMPtr|, however, it is still |
58 | | * _illegal_ to say |NS_IF_ADDREF(mThing)|. |
59 | | */ |
60 | | |
61 | | /** |
62 | | * Macro for releasing a reference to an interface. |
63 | | * @param _ptr The interface pointer. |
64 | | */ |
65 | | #define NS_RELEASE(_ptr) \ |
66 | 2.12M | do { \ |
67 | 1.84M | (_ptr)->Release(); \ |
68 | 1.84M | (_ptr) = 0; \ |
69 | 1.84M | } while (0) |
70 | | |
71 | | /** |
72 | | * Macro for releasing a reference to this interface. |
73 | | */ |
74 | | #define NS_RELEASE_THIS() \ |
75 | 0 | Release() |
76 | | |
77 | | /** |
78 | | * Macro for releasing a reference to an interface, except that this |
79 | | * macro preserves the return value from the underlying Release call. |
80 | | * The interface pointer argument will only be NULLed if the reference count |
81 | | * goes to zero. |
82 | | * |
83 | | * @param _ptr The interface pointer. |
84 | | * @param _rc The reference count. |
85 | | */ |
86 | | #define NS_RELEASE2(_ptr, _rc) \ |
87 | 0 | do { \ |
88 | 0 | _rc = (_ptr)->Release(); \ |
89 | 0 | if (0 == (_rc)) (_ptr) = 0; \ |
90 | 0 | } while (0) |
91 | | |
92 | | /** |
93 | | * Macro for releasing a reference to an interface that checks for nullptr; |
94 | | * @param _ptr The interface pointer. |
95 | | */ |
96 | | #define NS_IF_RELEASE(_ptr) \ |
97 | 12 | do { \ |
98 | 12 | if (_ptr) { \ |
99 | 6 | (_ptr)->Release(); \ |
100 | 6 | (_ptr) = 0; \ |
101 | 6 | } \ |
102 | 12 | } while (0) |
103 | | |
104 | | /* |
105 | | * Often you have to cast an implementation pointer, e.g., |this|, to an |
106 | | * |nsISupports*|, but because you have multiple inheritance, a simple cast |
107 | | * is ambiguous. One could simply say, e.g., (given a base |nsIBase|), |
108 | | * |static_cast<nsIBase*>(this)|; but that disguises the fact that what |
109 | | * you are really doing is disambiguating the |nsISupports|. You could make |
110 | | * that more obvious with a double cast, e.g., |static_cast<nsISupports*> |
111 | | (* static_cast<nsIBase*>(this))|, but that is bulky and harder to read... |
112 | | * |
113 | | * The following macro is clean, short, and obvious. In the example above, |
114 | | * you would use it like this: |NS_ISUPPORTS_CAST(nsIBase*, this)|. |
115 | | */ |
116 | | |
117 | | #define NS_ISUPPORTS_CAST(__unambiguousBase, __expr) \ |
118 | 32.3M | static_cast<nsISupports*>(static_cast<__unambiguousBase>(__expr)) |
119 | | |
120 | | // a type-safe shortcut for calling the |QueryInterface()| member function |
121 | | template<class T, class DestinationType> |
122 | | inline nsresult |
123 | | CallQueryInterface(T* aSource, DestinationType** aDestination) |
124 | 9.60M | { |
125 | 9.60M | // We permit nsISupports-to-nsISupports here so that one can still obtain |
126 | 9.60M | // the canonical nsISupports pointer with CallQueryInterface. |
127 | 9.60M | static_assert(!mozilla::IsSame<T, DestinationType>::value || |
128 | 9.60M | mozilla::IsSame<DestinationType, nsISupports>::value, |
129 | 9.60M | "don't use CallQueryInterface for compile-time-determinable casts"); |
130 | 9.60M | |
131 | 9.60M | MOZ_ASSERT(aSource, "null parameter"); |
132 | 9.60M | MOZ_ASSERT(aDestination, "null parameter"); |
133 | 9.60M | |
134 | 9.60M | return aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType), |
135 | 9.60M | reinterpret_cast<void**>(aDestination)); |
136 | 9.60M | } nsresult CallQueryInterface<nsISupports, nsXPCOMCycleCollectionParticipant>(nsISupports*, nsXPCOMCycleCollectionParticipant**) Line | Count | Source | 124 | 3 | { | 125 | 3 | // We permit nsISupports-to-nsISupports here so that one can still obtain | 126 | 3 | // the canonical nsISupports pointer with CallQueryInterface. | 127 | 3 | static_assert(!mozilla::IsSame<T, DestinationType>::value || | 128 | 3 | mozilla::IsSame<DestinationType, nsISupports>::value, | 129 | 3 | "don't use CallQueryInterface for compile-time-determinable casts"); | 130 | 3 | | 131 | 3 | MOZ_ASSERT(aSource, "null parameter"); | 132 | 3 | MOZ_ASSERT(aDestination, "null parameter"); | 133 | 3 | | 134 | 3 | return aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType), | 135 | 3 | reinterpret_cast<void**>(aDestination)); | 136 | 3 | } |
nsresult CallQueryInterface<nsISupports, nsWrapperCache>(nsISupports*, nsWrapperCache**) Line | Count | Source | 124 | 9.60M | { | 125 | 9.60M | // We permit nsISupports-to-nsISupports here so that one can still obtain | 126 | 9.60M | // the canonical nsISupports pointer with CallQueryInterface. | 127 | 9.60M | static_assert(!mozilla::IsSame<T, DestinationType>::value || | 128 | 9.60M | mozilla::IsSame<DestinationType, nsISupports>::value, | 129 | 9.60M | "don't use CallQueryInterface for compile-time-determinable casts"); | 130 | 9.60M | | 131 | 9.60M | MOZ_ASSERT(aSource, "null parameter"); | 132 | 9.60M | MOZ_ASSERT(aDestination, "null parameter"); | 133 | 9.60M | | 134 | 9.60M | return aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType), | 135 | 9.60M | reinterpret_cast<void**>(aDestination)); | 136 | 9.60M | } |
Unexecuted instantiation: nsresult CallQueryInterface<nsIGlobalObject, nsIScriptGlobalObject>(nsIGlobalObject*, nsIScriptGlobalObject**) nsresult CallQueryInterface<nsIProtocolHandler, nsIFileProtocolHandler>(nsIProtocolHandler*, nsIFileProtocolHandler**) Line | Count | Source | 124 | 11 | { | 125 | 11 | // We permit nsISupports-to-nsISupports here so that one can still obtain | 126 | 11 | // the canonical nsISupports pointer with CallQueryInterface. | 127 | 11 | static_assert(!mozilla::IsSame<T, DestinationType>::value || | 128 | 11 | mozilla::IsSame<DestinationType, nsISupports>::value, | 129 | 11 | "don't use CallQueryInterface for compile-time-determinable casts"); | 130 | 11 | | 131 | 11 | MOZ_ASSERT(aSource, "null parameter"); | 132 | 11 | MOZ_ASSERT(aDestination, "null parameter"); | 133 | 11 | | 134 | 11 | return aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType), | 135 | 11 | reinterpret_cast<void**>(aDestination)); | 136 | 11 | } |
Unexecuted instantiation: nsresult CallQueryInterface<nsIProxyInfo, mozilla::net::nsProxyInfo>(nsIProxyInfo*, mozilla::net::nsProxyInfo**) Unexecuted instantiation: nsresult CallQueryInterface<nsIHttpChannelInternal, mozilla::net::nsHttpChannel>(nsIHttpChannelInternal*, mozilla::net::nsHttpChannel**) Unexecuted instantiation: nsresult CallQueryInterface<nsIChannel, mozilla::net::nsHttpChannel>(nsIChannel*, mozilla::net::nsHttpChannel**) Unexecuted instantiation: nsresult CallQueryInterface<nsIStreamListener, nsIInterfaceRequestor>(nsIStreamListener*, nsIInterfaceRequestor**) Unexecuted instantiation: nsresult CallQueryInterface<nsICacheEntry, nsISupports>(nsICacheEntry*, nsISupports**) Unexecuted instantiation: nsresult CallQueryInterface<nsIHttpChannel, mozilla::net::nsHttpChannel>(nsIHttpChannel*, mozilla::net::nsHttpChannel**) Unexecuted instantiation: nsresult CallQueryInterface<nsIInputStream, nsIAsyncInputStream>(nsIInputStream*, nsIAsyncInputStream**) Unexecuted instantiation: nsresult CallQueryInterface<nsIOutputStream, nsIAsyncOutputStream>(nsIOutputStream*, nsIAsyncOutputStream**) Unexecuted instantiation: nsresult CallQueryInterface<nsIRequest, nsIChannel>(nsIRequest*, nsIChannel**) Unexecuted instantiation: nsresult CallQueryInterface<nsISupports, nsIPrincipal>(nsISupports*, nsIPrincipal**) Unexecuted instantiation: nsresult CallQueryInterface<imgIEncoder, nsIInputStream>(imgIEncoder*, nsIInputStream**) Unexecuted instantiation: nsresult CallQueryInterface<imgILoader, imgICache>(imgILoader*, imgICache**) Unexecuted instantiation: nsresult CallQueryInterface<mozilla::dom::ContentProcessMessageManager, nsISupports>(mozilla::dom::ContentProcessMessageManager*, nsISupports**) Unexecuted instantiation: nsresult CallQueryInterface<nsIObjectLoadingContent, nsIContent>(nsIObjectLoadingContent*, nsIContent**) Unexecuted instantiation: nsresult CallQueryInterface<nsIFile, nsISupports>(nsIFile*, nsISupports**) Unexecuted instantiation: nsresult CallQueryInterface<nsIPresShell, nsISelectionController>(nsIPresShell*, nsISelectionController**) Unexecuted instantiation: nsresult CallQueryInterface<nsIHTMLCollection, nsWrapperCache>(nsIHTMLCollection*, nsWrapperCache**) Unexecuted instantiation: nsresult CallQueryInterface<nsISupports, nsIGlobalObject>(nsISupports*, nsIGlobalObject**) Unexecuted instantiation: nsresult CallQueryInterface<nsICanvasRenderingContextInternal, nsXPCOMCycleCollectionParticipant>(nsICanvasRenderingContextInternal*, nsXPCOMCycleCollectionParticipant**) Unexecuted instantiation: nsresult CallQueryInterface<mozilla::DOMEventTargetHelper, nsXPCOMCycleCollectionParticipant>(mozilla::DOMEventTargetHelper*, nsXPCOMCycleCollectionParticipant**) Unexecuted instantiation: nsresult CallQueryInterface<nsIMultiplexInputStream, nsIInputStream>(nsIMultiplexInputStream*, nsIInputStream**) Unexecuted instantiation: nsresult CallQueryInterface<nsIMIMEInputStream, nsIInputStream>(nsIMIMEInputStream*, nsIInputStream**) Unexecuted instantiation: nsresult CallQueryInterface<nsHTMLDocument, nsINode>(nsHTMLDocument*, nsINode**) Unexecuted instantiation: nsresult CallQueryInterface<mozilla::dom::SVGDocument, nsINode>(mozilla::dom::SVGDocument*, nsINode**) Unexecuted instantiation: nsresult CallQueryInterface<nsIContent, mozilla::dom::SVGComponentTransferFunctionElement>(nsIContent*, mozilla::dom::SVGComponentTransferFunctionElement**) Unexecuted instantiation: nsresult CallQueryInterface<nsIParser, nsIStreamListener>(nsIParser*, nsIStreamListener**) Unexecuted instantiation: nsresult CallQueryInterface<mozilla::dom::XMLDocument, nsINode>(mozilla::dom::XMLDocument*, nsINode**) Unexecuted instantiation: nsresult CallQueryInterface<nsIStorageStream, nsIOutputStream>(nsIStorageStream*, nsIOutputStream**) Unexecuted instantiation: nsresult CallQueryInterface<nsIContent, nsSVGFE>(nsIContent*, nsSVGFE**) Unexecuted instantiation: nsresult CallQueryInterface<nsIDocShellTreeOwner, nsIBaseWindow>(nsIDocShellTreeOwner*, nsIBaseWindow**) Unexecuted instantiation: nsresult CallQueryInterface<nsContentDLF, nsIDocumentLoaderFactory>(nsContentDLF*, nsIDocumentLoaderFactory**) Unexecuted instantiation: nsresult CallQueryInterface<nsDocLoader, nsIDocShellTreeItem>(nsDocLoader*, nsIDocShellTreeItem**) Unexecuted instantiation: nsresult CallQueryInterface<nsIDocumentLoader, nsIDocShellTreeItem>(nsIDocumentLoader*, nsIDocShellTreeItem**) Unexecuted instantiation: nsresult CallQueryInterface<nsISHEntry, nsISupports>(nsISHEntry*, nsISupports**) Unexecuted instantiation: nsresult CallQueryInterface<nsPIDOMWindowOuter, nsISupports>(nsPIDOMWindowOuter*, nsISupports**) Unexecuted instantiation: nsresult CallQueryInterface<nsIXULWindow, nsISupports>(nsIXULWindow*, nsISupports**) Unexecuted instantiation: nsresult CallQueryInterface<mozIDOMWindowProxy, nsISupports>(mozIDOMWindowProxy*, nsISupports**) Unexecuted instantiation: nsresult CallQueryInterface<nsWatcherWindowEnumerator, nsISimpleEnumerator>(nsWatcherWindowEnumerator*, nsISimpleEnumerator**) Unexecuted instantiation: nsresult CallQueryInterface<nsPIDOMWindowOuter, mozIDOMWindowProxy>(nsPIDOMWindowOuter*, mozIDOMWindowProxy**) Unexecuted instantiation: nsresult CallQueryInterface<nsIDocShell, nsIDocShellTreeItem>(nsIDocShell*, nsIDocShellTreeItem**) Unexecuted instantiation: nsresult CallQueryInterface<nsISupports, nsITestService>(nsISupports*, nsITestService**) Unexecuted instantiation: nsresult CallQueryInterface<nsTestService, nsISupportsWeakReference>(nsTestService*, nsISupportsWeakReference**) |
137 | | |
138 | | template <class SourceType, class DestinationType> |
139 | | inline nsresult |
140 | | CallQueryInterface(RefPtr<SourceType>& aSourcePtr, DestinationType** aDestPtr) |
141 | 0 | { |
142 | 0 | return CallQueryInterface(aSourcePtr.get(), aDestPtr); |
143 | 0 | } Unexecuted instantiation: nsresult CallQueryInterface<mozilla::dom::ContentProcessMessageManager, nsISupports>(RefPtr<mozilla::dom::ContentProcessMessageManager>&, nsISupports**) Unexecuted instantiation: nsresult CallQueryInterface<nsICanvasRenderingContextInternal, nsXPCOMCycleCollectionParticipant>(RefPtr<nsICanvasRenderingContextInternal>&, nsXPCOMCycleCollectionParticipant**) Unexecuted instantiation: nsresult CallQueryInterface<nsTestService, nsISupportsWeakReference>(RefPtr<nsTestService>&, nsISupportsWeakReference**) |
144 | | |
145 | | #endif /* __nsISupportsUtils_h */ |