mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1297802 - Remove unused RefPtr<> and COMPtr<> types in dom/, r=baku
MozReview-Commit-ID: CLUJZdbN7sW
This commit is contained in:
parent
ef6bd6dd59
commit
b258dfaa89
@ -4842,8 +4842,6 @@ nsDocument::SetScriptHandlingObject(nsIScriptGlobalObject* aScriptObject)
|
|||||||
NS_ASSERTION(!mScriptGlobalObject ||
|
NS_ASSERTION(!mScriptGlobalObject ||
|
||||||
mScriptGlobalObject == aScriptObject,
|
mScriptGlobalObject == aScriptObject,
|
||||||
"Wrong script object!");
|
"Wrong script object!");
|
||||||
// XXXkhuey why bother?
|
|
||||||
nsCOMPtr<nsPIDOMWindowInner> win = do_QueryInterface(aScriptObject);
|
|
||||||
if (aScriptObject) {
|
if (aScriptObject) {
|
||||||
mScopeObject = do_GetWeakReference(aScriptObject);
|
mScopeObject = do_GetWeakReference(aScriptObject);
|
||||||
mHasHadScriptHandlingObject = true;
|
mHasHadScriptHandlingObject = true;
|
||||||
@ -7708,8 +7706,6 @@ nsDOMAttributeMap::BlastSubtreeToPieces(nsINode *aNode)
|
|||||||
Element *element = aNode->AsElement();
|
Element *element = aNode->AsElement();
|
||||||
const nsDOMAttributeMap *map = element->GetAttributeMap();
|
const nsDOMAttributeMap *map = element->GetAttributeMap();
|
||||||
if (map) {
|
if (map) {
|
||||||
nsCOMPtr<nsIAttribute> attr;
|
|
||||||
|
|
||||||
// This non-standard style of iteration is presumably used because some
|
// This non-standard style of iteration is presumably used because some
|
||||||
// of the code in the loop body can trigger element removal, which
|
// of the code in the loop body can trigger element removal, which
|
||||||
// invalidates the iterator.
|
// invalidates the iterator.
|
||||||
@ -8762,7 +8758,6 @@ nsDocument::Sanitize()
|
|||||||
|
|
||||||
RefPtr<nsContentList> nodes = GetElementsByTagName(NS_LITERAL_STRING("input"));
|
RefPtr<nsContentList> nodes = GetElementsByTagName(NS_LITERAL_STRING("input"));
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> item;
|
|
||||||
nsAutoString value;
|
nsAutoString value;
|
||||||
|
|
||||||
uint32_t length = nodes->Length(true);
|
uint32_t length = nodes->Length(true);
|
||||||
@ -10437,7 +10432,6 @@ nsDocument::GetStateObject(nsIVariant** aState)
|
|||||||
// mStateObjectContainer may be null; this just means that there's no
|
// mStateObjectContainer may be null; this just means that there's no
|
||||||
// current state object.
|
// current state object.
|
||||||
|
|
||||||
nsCOMPtr<nsIVariant> stateObj;
|
|
||||||
if (!mStateObjectCached && mStateObjectContainer) {
|
if (!mStateObjectCached && mStateObjectContainer) {
|
||||||
AutoJSContext cx;
|
AutoJSContext cx;
|
||||||
nsIGlobalObject* sgo = GetScopeObject();
|
nsIGlobalObject* sgo = GetScopeObject();
|
||||||
@ -10878,7 +10872,6 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY)
|
|||||||
if (nodeIsAnonymous) {
|
if (nodeIsAnonymous) {
|
||||||
node = ptFrame->GetContent();
|
node = ptFrame->GetContent();
|
||||||
nsIContent* nonanon = node->FindFirstNonChromeOnlyAccessContent();
|
nsIContent* nonanon = node->FindFirstNonChromeOnlyAccessContent();
|
||||||
nsCOMPtr<nsIDOMHTMLInputElement> input = do_QueryInterface(nonanon);
|
|
||||||
nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea = do_QueryInterface(nonanon);
|
nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea = do_QueryInterface(nonanon);
|
||||||
nsITextControlFrame* textFrame = do_QueryFrame(nonanon->GetPrimaryFrame());
|
nsITextControlFrame* textFrame = do_QueryFrame(nonanon->GetPrimaryFrame());
|
||||||
nsNumberControlFrame* numberFrame = do_QueryFrame(nonanon->GetPrimaryFrame());
|
nsNumberControlFrame* numberFrame = do_QueryFrame(nonanon->GetPrimaryFrame());
|
||||||
|
@ -1120,8 +1120,6 @@ nsDocumentEncoder::EncodeToStringWithMaxLength(uint32_t aMaxLength,
|
|||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIAtom> charsetAtom;
|
|
||||||
|
|
||||||
bool rewriteEncodingDeclaration = !(mSelection || mRange || mNode) && !(mFlags & OutputDontRewriteEncodingDeclaration);
|
bool rewriteEncodingDeclaration = !(mSelection || mRange || mNode) && !(mFlags & OutputDontRewriteEncodingDeclaration);
|
||||||
mSerializer->Init(mFlags, mWrapColumn, mCharset.get(), mIsCopying, rewriteEncodingDeclaration);
|
mSerializer->Init(mFlags, mWrapColumn, mCharset.get(), mIsCopying, rewriteEncodingDeclaration);
|
||||||
|
|
||||||
@ -1651,7 +1649,6 @@ nsHTMLCopyEncoder::PromoteRange(nsIDOMRange *inRange)
|
|||||||
nsCOMPtr<nsIDOMNode> opStartNode;
|
nsCOMPtr<nsIDOMNode> opStartNode;
|
||||||
nsCOMPtr<nsIDOMNode> opEndNode;
|
nsCOMPtr<nsIDOMNode> opEndNode;
|
||||||
int32_t opStartOffset, opEndOffset;
|
int32_t opStartOffset, opEndOffset;
|
||||||
nsCOMPtr<nsIDOMRange> opRange;
|
|
||||||
|
|
||||||
// examine range endpoints.
|
// examine range endpoints.
|
||||||
rv = GetPromotedPoint( kStart, startNode, startOffset, address_of(opStartNode), &opStartOffset, common);
|
rv = GetPromotedPoint( kStart, startNode, startOffset, address_of(opStartNode), &opStartOffset, common);
|
||||||
@ -2105,4 +2102,3 @@ nsHTMLCopyEncoder::GetImmediateContextCount(const nsTArray<nsINode*>& aAncestorA
|
|||||||
}
|
}
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14019,7 +14019,6 @@ nsGlobalModalWindow::GetReturnValue(nsIVariant **aRetVal)
|
|||||||
{
|
{
|
||||||
FORWARD_TO_OUTER_MODAL_CONTENT_WINDOW(GetReturnValue, (aRetVal), NS_OK);
|
FORWARD_TO_OUTER_MODAL_CONTENT_WINDOW(GetReturnValue, (aRetVal), NS_OK);
|
||||||
|
|
||||||
nsCOMPtr<nsIVariant> result;
|
|
||||||
if (!mReturnValue) {
|
if (!mReturnValue) {
|
||||||
nsCOMPtr<nsIVariant> variant = CreateVoidVariant();
|
nsCOMPtr<nsIVariant> variant = CreateVoidVariant();
|
||||||
variant.forget(aRetVal);
|
variant.forget(aRetVal);
|
||||||
|
@ -220,7 +220,6 @@ class BlobURLsReporter final : public nsIMemoryReporter
|
|||||||
"blob cannot be freed until all URLs for it have been explicitly "
|
"blob cannot be freed until all URLs for it have been explicitly "
|
||||||
"invalidated with URL.revokeObjectURL.");
|
"invalidated with URL.revokeObjectURL.");
|
||||||
nsAutoCString path, url, owner, specialDesc;
|
nsAutoCString path, url, owner, specialDesc;
|
||||||
nsCOMPtr<nsIURI> principalURI;
|
|
||||||
uint64_t size = 0;
|
uint64_t size = 0;
|
||||||
uint32_t refCount = 1;
|
uint32_t refCount = 1;
|
||||||
DebugOnly<bool> blobImplWasCounted;
|
DebugOnly<bool> blobImplWasCounted;
|
||||||
|
@ -263,7 +263,6 @@ nsLocation::SetURI(nsIURI* aURI, bool aReplace)
|
|||||||
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
|
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
|
||||||
if (docShell) {
|
if (docShell) {
|
||||||
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
|
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
|
||||||
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
|
|
||||||
|
|
||||||
if(NS_FAILED(CheckURL(aURI, getter_AddRefs(loadInfo))))
|
if(NS_FAILED(CheckURL(aURI, getter_AddRefs(loadInfo))))
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
@ -2660,7 +2660,6 @@ nsScriptLoader::PrepareLoadedRequest(nsScriptLoadRequest* aRequest,
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIURI> baseURL;
|
|
||||||
channel->GetURI(getter_AddRefs(request->mBaseURL));
|
channel->GetURI(getter_AddRefs(request->mBaseURL));
|
||||||
|
|
||||||
// Attempt to compile off main thread.
|
// Attempt to compile off main thread.
|
||||||
|
@ -3118,8 +3118,6 @@ nsDOMDeviceStorage::AddOrAppendNamed(Blob* aBlob, const nsAString& aPath,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIRunnable> r;
|
|
||||||
|
|
||||||
if (IsFullPath(aPath)) {
|
if (IsFullPath(aPath)) {
|
||||||
nsString storagePath;
|
nsString storagePath;
|
||||||
RefPtr<nsDOMDeviceStorage> ds = GetStorage(aPath, storagePath);
|
RefPtr<nsDOMDeviceStorage> ds = GetStorage(aPath, storagePath);
|
||||||
|
@ -614,7 +614,6 @@ HTMLSelectElement::Add(nsIDOMHTMLElement* aElement,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsISupports> supports;
|
nsCOMPtr<nsISupports> supports;
|
||||||
nsCOMPtr<nsIDOMHTMLElement> beforeElement;
|
|
||||||
|
|
||||||
// whether aBefore is nsIDOMHTMLElement...
|
// whether aBefore is nsIDOMHTMLElement...
|
||||||
if (NS_SUCCEEDED(aBefore->GetAsISupports(getter_AddRefs(supports)))) {
|
if (NS_SUCCEEDED(aBefore->GetAsISupports(getter_AddRefs(supports)))) {
|
||||||
|
@ -3123,9 +3123,6 @@ nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
|
|||||||
void
|
void
|
||||||
nsGenericHTMLElement::SetInnerText(const nsAString& aValue)
|
nsGenericHTMLElement::SetInnerText(const nsAString& aValue)
|
||||||
{
|
{
|
||||||
// Fire DOMNodeRemoved mutation events before we do anything else.
|
|
||||||
nsCOMPtr<nsIContent> kungFuDeathGrip;
|
|
||||||
|
|
||||||
// Batch possible DOMSubtreeModified events.
|
// Batch possible DOMSubtreeModified events.
|
||||||
mozAutoSubtreeModified subtree(OwnerDoc(), nullptr);
|
mozAutoSubtreeModified subtree(OwnerDoc(), nullptr);
|
||||||
FireNodeRemovedForChildren();
|
FireNodeRemovedForChildren();
|
||||||
|
@ -1085,7 +1085,6 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (aContext.IsMozBrowserElement() || !aContext.HasOwnApp()) {
|
if (aContext.IsMozBrowserElement() || !aContext.HasOwnApp()) {
|
||||||
RefPtr<TabParent> tp;
|
|
||||||
RefPtr<nsIContentParent> constructorSender;
|
RefPtr<nsIContentParent> constructorSender;
|
||||||
if (isInContentProcess) {
|
if (isInContentProcess) {
|
||||||
MOZ_ASSERT(aContext.IsMozBrowserElement());
|
MOZ_ASSERT(aContext.IsMozBrowserElement());
|
||||||
|
@ -528,8 +528,6 @@ MediaDecoderReader::Shutdown()
|
|||||||
// Shut down the watch manager before shutting down our task queue.
|
// Shut down the watch manager before shutting down our task queue.
|
||||||
mWatchManager.Shutdown();
|
mWatchManager.Shutdown();
|
||||||
|
|
||||||
RefPtr<ShutdownPromise> p;
|
|
||||||
|
|
||||||
mDecoder = nullptr;
|
mDecoder = nullptr;
|
||||||
|
|
||||||
ReaderQueue::Instance().Remove(this);
|
ReaderQueue::Instance().Remove(this);
|
||||||
|
@ -411,7 +411,6 @@ nsPluginStreamListenerPeer::SetupPluginCacheFile(nsIChannel* channel)
|
|||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
// create a file output stream to write to...
|
// create a file output stream to write to...
|
||||||
nsCOMPtr<nsIOutputStream> outstream;
|
|
||||||
rv = NS_NewLocalFileOutputStream(getter_AddRefs(mFileCacheOutputStream), pluginTmp, -1, 00600);
|
rv = NS_NewLocalFileOutputStream(getter_AddRefs(mFileCacheOutputStream), pluginTmp, -1, 00600);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -3355,7 +3355,6 @@ PluginInstanceChild::CreateOptSurface(void)
|
|||||||
"Need a valid surface type here");
|
"Need a valid surface type here");
|
||||||
NS_ASSERTION(!mCurrentSurface, "mCurrentSurfaceActor can get out of sync.");
|
NS_ASSERTION(!mCurrentSurface, "mCurrentSurfaceActor can get out of sync.");
|
||||||
|
|
||||||
RefPtr<gfxASurface> retsurf;
|
|
||||||
// Use an opaque surface unless we're transparent and *don't* have
|
// Use an opaque surface unless we're transparent and *don't* have
|
||||||
// a background to source from.
|
// a background to source from.
|
||||||
gfxImageFormat format =
|
gfxImageFormat format =
|
||||||
@ -3581,7 +3580,9 @@ PluginInstanceChild::EnsureCurrentBuffer(void)
|
|||||||
void
|
void
|
||||||
PluginInstanceChild::UpdateWindowAttributes(bool aForceSetWindow)
|
PluginInstanceChild::UpdateWindowAttributes(bool aForceSetWindow)
|
||||||
{
|
{
|
||||||
|
#if defined(MOZ_X11) || defined(XP_WIN)
|
||||||
RefPtr<gfxASurface> curSurface = mHelperSurface ? mHelperSurface : mCurrentSurface;
|
RefPtr<gfxASurface> curSurface = mHelperSurface ? mHelperSurface : mCurrentSurface;
|
||||||
|
#endif // Only used within MOZ_X11 or XP_WIN blocks. Unused variable otherwise
|
||||||
bool needWindowUpdate = aForceSetWindow;
|
bool needWindowUpdate = aForceSetWindow;
|
||||||
#ifdef MOZ_X11
|
#ifdef MOZ_X11
|
||||||
Visual* visual = nullptr;
|
Visual* visual = nullptr;
|
||||||
|
@ -7488,8 +7488,6 @@ UpgradeDirectoryMetadataFrom1To2Helper::DoProcessOriginDirectories()
|
|||||||
{
|
{
|
||||||
AssertIsOnIOThread();
|
AssertIsOnIOThread();
|
||||||
|
|
||||||
nsCOMPtr<nsIFile> permanentStorageDir;
|
|
||||||
|
|
||||||
for (uint32_t count = mOriginProps.Length(), index = 0;
|
for (uint32_t count = mOriginProps.Length(), index = 0;
|
||||||
index < count;
|
index < count;
|
||||||
index++) {
|
index++) {
|
||||||
|
@ -457,7 +457,6 @@ DOMStorageDBThread::OpenDatabaseConnection()
|
|||||||
= do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv);
|
= do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<mozIStorageConnection> connection;
|
|
||||||
rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(mWorkerConnection));
|
rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(mWorkerConnection));
|
||||||
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
if (rv == NS_ERROR_FILE_CORRUPTED) {
|
||||||
// delete the db and try opening again
|
// delete the db and try opening again
|
||||||
|
@ -167,8 +167,6 @@ nsXMLFragmentContentSink::WillBuildModel(nsDTDMode aDTDMode)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXMLFragmentContentSink::DidBuildModel(bool aTerminated)
|
nsXMLFragmentContentSink::DidBuildModel(bool aTerminated)
|
||||||
{
|
{
|
||||||
RefPtr<nsParserBase> kungFuDeathGrip(mParser);
|
|
||||||
|
|
||||||
// Drop our reference to the parser to get rid of a circular
|
// Drop our reference to the parser to get rid of a circular
|
||||||
// reference.
|
// reference.
|
||||||
mParser = nullptr;
|
mParser = nullptr;
|
||||||
|
@ -225,7 +225,6 @@ nsXULTemplateQueryProcessorStorage::GetDatasource(nsIArray* aDataSources,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIFile> file;
|
|
||||||
rv = fileChannel->GetFile(getter_AddRefs(databaseFile));
|
rv = fileChannel->GetFile(getter_AddRefs(databaseFile));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user