Bug 1297802 - Remove unused RefPtr<> and COMPtr<> types in dom/, r=baku

MozReview-Commit-ID: CLUJZdbN7sW
This commit is contained in:
Michael Layzell 2016-08-24 14:09:12 -04:00
parent ef6bd6dd59
commit b258dfaa89
17 changed files with 87 additions and 117 deletions

View File

@ -4842,8 +4842,6 @@ nsDocument::SetScriptHandlingObject(nsIScriptGlobalObject* aScriptObject)
NS_ASSERTION(!mScriptGlobalObject ||
mScriptGlobalObject == aScriptObject,
"Wrong script object!");
// XXXkhuey why bother?
nsCOMPtr<nsPIDOMWindowInner> win = do_QueryInterface(aScriptObject);
if (aScriptObject) {
mScopeObject = do_GetWeakReference(aScriptObject);
mHasHadScriptHandlingObject = true;
@ -7708,8 +7706,6 @@ nsDOMAttributeMap::BlastSubtreeToPieces(nsINode *aNode)
Element *element = aNode->AsElement();
const nsDOMAttributeMap *map = element->GetAttributeMap();
if (map) {
nsCOMPtr<nsIAttribute> attr;
// This non-standard style of iteration is presumably used because some
// of the code in the loop body can trigger element removal, which
// invalidates the iterator.
@ -8762,7 +8758,6 @@ nsDocument::Sanitize()
RefPtr<nsContentList> nodes = GetElementsByTagName(NS_LITERAL_STRING("input"));
nsCOMPtr<nsIContent> item;
nsAutoString value;
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
// current state object.
nsCOMPtr<nsIVariant> stateObj;
if (!mStateObjectCached && mStateObjectContainer) {
AutoJSContext cx;
nsIGlobalObject* sgo = GetScopeObject();
@ -10878,7 +10872,6 @@ nsIDocument::CaretPositionFromPoint(float aX, float aY)
if (nodeIsAnonymous) {
node = ptFrame->GetContent();
nsIContent* nonanon = node->FindFirstNonChromeOnlyAccessContent();
nsCOMPtr<nsIDOMHTMLInputElement> input = do_QueryInterface(nonanon);
nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea = do_QueryInterface(nonanon);
nsITextControlFrame* textFrame = do_QueryFrame(nonanon->GetPrimaryFrame());
nsNumberControlFrame* numberFrame = do_QueryFrame(nonanon->GetPrimaryFrame());

View File

@ -1120,8 +1120,6 @@ nsDocumentEncoder::EncodeToStringWithMaxLength(uint32_t aMaxLength,
nsresult rv = NS_OK;
nsCOMPtr<nsIAtom> charsetAtom;
bool rewriteEncodingDeclaration = !(mSelection || mRange || mNode) && !(mFlags & OutputDontRewriteEncodingDeclaration);
mSerializer->Init(mFlags, mWrapColumn, mCharset.get(), mIsCopying, rewriteEncodingDeclaration);
@ -1651,7 +1649,6 @@ nsHTMLCopyEncoder::PromoteRange(nsIDOMRange *inRange)
nsCOMPtr<nsIDOMNode> opStartNode;
nsCOMPtr<nsIDOMNode> opEndNode;
int32_t opStartOffset, opEndOffset;
nsCOMPtr<nsIDOMRange> opRange;
// examine range endpoints.
rv = GetPromotedPoint( kStart, startNode, startOffset, address_of(opStartNode), &opStartOffset, common);
@ -2105,4 +2102,3 @@ nsHTMLCopyEncoder::GetImmediateContextCount(const nsTArray<nsINode*>& aAncestorA
}
return j;
}

View File

@ -14019,7 +14019,6 @@ nsGlobalModalWindow::GetReturnValue(nsIVariant **aRetVal)
{
FORWARD_TO_OUTER_MODAL_CONTENT_WINDOW(GetReturnValue, (aRetVal), NS_OK);
nsCOMPtr<nsIVariant> result;
if (!mReturnValue) {
nsCOMPtr<nsIVariant> variant = CreateVoidVariant();
variant.forget(aRetVal);

View File

@ -220,7 +220,6 @@ class BlobURLsReporter final : public nsIMemoryReporter
"blob cannot be freed until all URLs for it have been explicitly "
"invalidated with URL.revokeObjectURL.");
nsAutoCString path, url, owner, specialDesc;
nsCOMPtr<nsIURI> principalURI;
uint64_t size = 0;
uint32_t refCount = 1;
DebugOnly<bool> blobImplWasCounted;

View File

@ -263,7 +263,6 @@ nsLocation::SetURI(nsIURI* aURI, bool aReplace)
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
if (docShell) {
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
if(NS_FAILED(CheckURL(aURI, getter_AddRefs(loadInfo))))
return NS_ERROR_FAILURE;

View File

@ -2660,7 +2660,6 @@ nsScriptLoader::PrepareLoadedRequest(nsScriptLoadRequest* aRequest,
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIURI> baseURL;
channel->GetURI(getter_AddRefs(request->mBaseURL));
// Attempt to compile off main thread.

View File

@ -3118,8 +3118,6 @@ nsDOMDeviceStorage::AddOrAppendNamed(Blob* aBlob, const nsAString& aPath,
return nullptr;
}
nsCOMPtr<nsIRunnable> r;
if (IsFullPath(aPath)) {
nsString storagePath;
RefPtr<nsDOMDeviceStorage> ds = GetStorage(aPath, storagePath);

View File

@ -614,7 +614,6 @@ HTMLSelectElement::Add(nsIDOMHTMLElement* aElement,
}
nsCOMPtr<nsISupports> supports;
nsCOMPtr<nsIDOMHTMLElement> beforeElement;
// whether aBefore is nsIDOMHTMLElement...
if (NS_SUCCEEDED(aBefore->GetAsISupports(getter_AddRefs(supports)))) {

View File

@ -3123,9 +3123,6 @@ nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
void
nsGenericHTMLElement::SetInnerText(const nsAString& aValue)
{
// Fire DOMNodeRemoved mutation events before we do anything else.
nsCOMPtr<nsIContent> kungFuDeathGrip;
// Batch possible DOMSubtreeModified events.
mozAutoSubtreeModified subtree(OwnerDoc(), nullptr);
FireNodeRemovedForChildren();

View File

@ -1085,7 +1085,6 @@ ContentParent::CreateBrowserOrApp(const TabContext& aContext,
}
if (aContext.IsMozBrowserElement() || !aContext.HasOwnApp()) {
RefPtr<TabParent> tp;
RefPtr<nsIContentParent> constructorSender;
if (isInContentProcess) {
MOZ_ASSERT(aContext.IsMozBrowserElement());

View File

@ -528,8 +528,6 @@ MediaDecoderReader::Shutdown()
// Shut down the watch manager before shutting down our task queue.
mWatchManager.Shutdown();
RefPtr<ShutdownPromise> p;
mDecoder = nullptr;
ReaderQueue::Instance().Remove(this);

View File

@ -411,7 +411,6 @@ nsPluginStreamListenerPeer::SetupPluginCacheFile(nsIChannel* channel)
return rv;
// create a file output stream to write to...
nsCOMPtr<nsIOutputStream> outstream;
rv = NS_NewLocalFileOutputStream(getter_AddRefs(mFileCacheOutputStream), pluginTmp, -1, 00600);
if (NS_FAILED(rv))
return rv;

View File

@ -3355,7 +3355,6 @@ PluginInstanceChild::CreateOptSurface(void)
"Need a valid surface type here");
NS_ASSERTION(!mCurrentSurface, "mCurrentSurfaceActor can get out of sync.");
RefPtr<gfxASurface> retsurf;
// Use an opaque surface unless we're transparent and *don't* have
// a background to source from.
gfxImageFormat format =
@ -3581,7 +3580,9 @@ PluginInstanceChild::EnsureCurrentBuffer(void)
void
PluginInstanceChild::UpdateWindowAttributes(bool aForceSetWindow)
{
#if defined(MOZ_X11) || defined(XP_WIN)
RefPtr<gfxASurface> curSurface = mHelperSurface ? mHelperSurface : mCurrentSurface;
#endif // Only used within MOZ_X11 or XP_WIN blocks. Unused variable otherwise
bool needWindowUpdate = aForceSetWindow;
#ifdef MOZ_X11
Visual* visual = nullptr;

View File

@ -7488,8 +7488,6 @@ UpgradeDirectoryMetadataFrom1To2Helper::DoProcessOriginDirectories()
{
AssertIsOnIOThread();
nsCOMPtr<nsIFile> permanentStorageDir;
for (uint32_t count = mOriginProps.Length(), index = 0;
index < count;
index++) {

View File

@ -457,7 +457,6 @@ DOMStorageDBThread::OpenDatabaseConnection()
= do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<mozIStorageConnection> connection;
rv = service->OpenUnsharedDatabase(mDatabaseFile, getter_AddRefs(mWorkerConnection));
if (rv == NS_ERROR_FILE_CORRUPTED) {
// delete the db and try opening again

View File

@ -167,8 +167,6 @@ nsXMLFragmentContentSink::WillBuildModel(nsDTDMode aDTDMode)
NS_IMETHODIMP
nsXMLFragmentContentSink::DidBuildModel(bool aTerminated)
{
RefPtr<nsParserBase> kungFuDeathGrip(mParser);
// Drop our reference to the parser to get rid of a circular
// reference.
mParser = nullptr;

View File

@ -225,7 +225,6 @@ nsXULTemplateQueryProcessorStorage::GetDatasource(nsIArray* aDataSources,
return rv;
}
nsCOMPtr<nsIFile> file;
rv = fileChannel->GetFile(getter_AddRefs(databaseFile));
NS_ENSURE_SUCCESS(rv, rv);
}