зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1018486 - Part 8: Various other changes, r=smaug
MozReview-Commit-ID: B0dsomkWgEk
This commit is contained in:
Родитель
0c311dc0f9
Коммит
36e08437d0
|
@ -124,7 +124,6 @@ XULTreeAccessible::Value(nsString& aValue)
|
|||
return;
|
||||
|
||||
int32_t currentIndex;
|
||||
nsCOMPtr<nsIDOMElement> selectItem;
|
||||
selection->GetCurrentIndex(¤tIndex);
|
||||
if (currentIndex >= 0) {
|
||||
nsCOMPtr<nsITreeColumn> keyCol;
|
||||
|
|
|
@ -141,8 +141,6 @@ CopyURIs(const InfallibleTArray<URIParams>& aDomains, nsIDomainSet* aSet)
|
|||
void
|
||||
DomainPolicy::ApplyClone(DomainPolicyClone* aClone)
|
||||
{
|
||||
nsCOMPtr<nsIDomainSet> list;
|
||||
|
||||
CopyURIs(aClone->blacklist(), mBlacklist);
|
||||
CopyURIs(aClone->whitelist(), mWhitelist);
|
||||
CopyURIs(aClone->superBlacklist(), mSuperBlacklist);
|
||||
|
|
|
@ -75,7 +75,6 @@ nsChromeRegistryContent::RegisterPackage(const ChromePackage& aPackage)
|
|||
return;
|
||||
}
|
||||
if (aPackage.skinBaseURI.spec.Length()) {
|
||||
nsCOMPtr<nsIURI> skinBaseURI;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(skin),
|
||||
aPackage.skinBaseURI.spec,
|
||||
aPackage.skinBaseURI.charset.get(),
|
||||
|
|
|
@ -1661,7 +1661,11 @@ nsWebBrowser::ScrollByPages(int32_t aNumPages)
|
|||
NS_IMETHODIMP
|
||||
nsWebBrowser::SetDocShell(nsIDocShell* aDocShell)
|
||||
{
|
||||
// We need to keep the docshell alive while we perform the changes, but we
|
||||
// don't need to call any methods on it.
|
||||
nsCOMPtr<nsIDocShell> kungFuDeathGrip(mDocShell);
|
||||
mozilla::Unused << kungFuDeathGrip;
|
||||
|
||||
if (aDocShell) {
|
||||
NS_ENSURE_TRUE(!mDocShell, NS_ERROR_FAILURE);
|
||||
|
||||
|
|
|
@ -1529,7 +1529,6 @@ nsWebBrowserPersist::GetExtensionForContentType(const char16_t *aContentType, ch
|
|||
NS_ENSURE_TRUE(mMIMEService, NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIMIMEInfo> mimeInfo;
|
||||
nsAutoCString contentType;
|
||||
contentType.AssignWithConversion(aContentType);
|
||||
nsAutoCString ext;
|
||||
|
|
|
@ -1805,7 +1805,6 @@ nsresult mozInlineSpellChecker::GetSpellCheckSelection(nsISelection ** aSpellChe
|
|||
nsresult rv = editor->GetSelectionController(getter_AddRefs(selcon));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISelection> spellCheckSelection;
|
||||
return selcon->GetSelection(nsISelectionController::SELECTION_SPELLCHECK, aSpellCheckSelection);
|
||||
}
|
||||
|
||||
|
|
|
@ -1501,7 +1501,6 @@ MOZ_GTEST_BENCH(TreeTraversal, TreeTraversal_ForwardDepthFirstSearchPostOrderPer
|
|||
template <typename Node>
|
||||
static RefPtr<Node> BreadthFirstSearchForwardQueue(RefPtr<Node> aNode)
|
||||
{
|
||||
RefPtr<Node> returnNode = nullptr;
|
||||
queue<RefPtr<Node>> nodes;
|
||||
nodes.push(aNode);
|
||||
while(!nodes.empty()) {
|
||||
|
@ -1951,7 +1950,6 @@ MOZ_GTEST_BENCH(TreeTraversal, TreeTraversal_ReverseDepthFirstSearchPostOrderPer
|
|||
template <typename Node>
|
||||
static RefPtr<Node> BreadthFirstSearchReverseQueue(RefPtr<Node> aNode)
|
||||
{
|
||||
RefPtr<Node> returnNode = nullptr;
|
||||
queue<RefPtr<Node>> nodes;
|
||||
nodes.push(aNode);
|
||||
while(!nodes.empty()) {
|
||||
|
|
|
@ -368,8 +368,7 @@ SVGDocumentWrapper::SetupViewer(nsIRequest* aRequest,
|
|||
NS_ENSURE_TRUE(parser, NS_ERROR_UNEXPECTED);
|
||||
|
||||
// XML-only, because this is for SVG content
|
||||
nsIContentSink* sink = parser->GetContentSink();
|
||||
nsCOMPtr<nsIXMLContentSink> xmlSink = do_QueryInterface(sink);
|
||||
nsCOMPtr<nsIContentSink> sink = parser->GetContentSink();
|
||||
NS_ENSURE_TRUE(sink, NS_ERROR_UNEXPECTED);
|
||||
|
||||
listener.swap(mListener);
|
||||
|
|
|
@ -787,7 +787,7 @@ imgRequestProxy::Notify(int32_t aType, const mozilla::gfx::IntRect* aRect)
|
|||
// Make sure the listener stays alive while we notify.
|
||||
nsCOMPtr<imgINotificationObserver> listener(mListener);
|
||||
|
||||
mListener->Notify(this, aType, aRect);
|
||||
listener->Notify(this, aType, aRect);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -807,8 +807,8 @@ imgRequestProxy::OnLoadComplete(bool aLastPart)
|
|||
|
||||
if (mListener && !mCanceled) {
|
||||
// Hold a ref to the listener while we call it, just in case.
|
||||
nsCOMPtr<imgINotificationObserver> kungFuDeathGrip(mListener);
|
||||
mListener->Notify(this, imgINotificationObserver::LOAD_COMPLETE, nullptr);
|
||||
nsCOMPtr<imgINotificationObserver> listener(mListener);
|
||||
listener->Notify(this, imgINotificationObserver::LOAD_COMPLETE, nullptr);
|
||||
}
|
||||
|
||||
// If we're expecting more data from a multipart channel, re-add ourself
|
||||
|
|
|
@ -59,7 +59,6 @@ JSValIsInterfaceOfType(JSContext* cx, HandleValue v, REFNSIID iid)
|
|||
{
|
||||
|
||||
nsCOMPtr<nsIXPConnectWrappedNative> wn;
|
||||
nsCOMPtr<nsISupports> sup;
|
||||
nsCOMPtr<nsISupports> iface;
|
||||
|
||||
if (v.isPrimitive())
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
using mozilla::WrapNotNull;
|
||||
using mozilla::MakeUnique;
|
||||
|
@ -283,10 +284,12 @@ TestNotNullWithRefPtr()
|
|||
// At this point the refcount is still 2.
|
||||
|
||||
RefPtr<MyRefType> r4 = r2;
|
||||
mozilla::Unused << r4;
|
||||
|
||||
// At this point the refcount is 3.
|
||||
|
||||
RefPtr<MyRefType> r5 = r3.get();
|
||||
mozilla::Unused << r5;
|
||||
|
||||
// At this point the refcount is 4.
|
||||
|
||||
|
|
|
@ -1112,7 +1112,6 @@ nsZipReaderCache::IsCached(nsIFile* zipFile, bool* aResult)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(zipFile);
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIZipReader> antiLockZipGrip;
|
||||
MutexAutoLock lock(mLock);
|
||||
|
||||
nsAutoCString uri;
|
||||
|
@ -1131,7 +1130,6 @@ nsZipReaderCache::GetZip(nsIFile* zipFile, nsIZipReader* *result)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(zipFile);
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIZipReader> antiLockZipGrip;
|
||||
MutexAutoLock lock(mLock);
|
||||
|
||||
#ifdef ZIP_CACHE_HIT_RATE
|
||||
|
|
|
@ -335,7 +335,6 @@ nsJARChannel::LookupFile(bool aAllowAsync)
|
|||
return NS_OK;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
|
||||
rv = mJarURI->GetJARFile(getter_AddRefs(mJarBaseURI));
|
||||
if (NS_FAILED(rv))
|
||||
|
|
|
@ -1823,7 +1823,6 @@ NS_IMETHODIMP CacheOutputCloseListener::Run()
|
|||
size_t CacheEntry::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
|
||||
{
|
||||
size_t n = 0;
|
||||
nsCOMPtr<nsISizeOf> sizeOf;
|
||||
|
||||
n += mCallbacks.ShallowSizeOfExcludingThis(mallocSizeOf);
|
||||
if (mFile) {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "mozilla/net/ChannelEventQueue.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
@ -36,6 +37,7 @@ ChannelEventQueue::FlushQueue()
|
|||
// destructor) unless we make sure its refcount doesn't drop to 0 while this
|
||||
// method is running.
|
||||
nsCOMPtr<nsISupports> kungFuDeathGrip(mOwner);
|
||||
mozilla::Unused << kungFuDeathGrip; // Not used in this function
|
||||
|
||||
// Prevent flushed events from flushing the queue recursively
|
||||
{
|
||||
|
|
|
@ -162,8 +162,6 @@ InterceptedChannelChrome::InterceptedChannelChrome(nsHttpChannel* aChannel,
|
|||
void
|
||||
InterceptedChannelChrome::NotifyController()
|
||||
{
|
||||
nsCOMPtr<nsIOutputStream> out;
|
||||
|
||||
// Intercepted responses should already be decoded.
|
||||
mChannel->SetApplyConversion(false);
|
||||
|
||||
|
|
|
@ -2546,7 +2546,7 @@ DataChannel::Close()
|
|||
{
|
||||
ENSURE_DATACONNECTION;
|
||||
RefPtr<DataChannelConnection> connection(mConnection);
|
||||
mConnection->Close(this);
|
||||
connection->Close(this);
|
||||
}
|
||||
|
||||
// Used when disconnecting from the DataChannelConnection
|
||||
|
|
|
@ -475,7 +475,6 @@ RDFXMLDataSourceImpl::BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer)
|
|||
// should be able to do by itself.
|
||||
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
nsCOMPtr<nsIRequest> request;
|
||||
|
||||
// Null LoadGroup ?
|
||||
rv = NS_NewChannel(getter_AddRefs(channel),
|
||||
|
|
|
@ -87,7 +87,6 @@ nsNSSASN1Tree::InitChildsRecursively(myNode* n)
|
|||
|
||||
myNode *walk = nullptr;
|
||||
myNode *prev = nullptr;
|
||||
nsCOMPtr<nsISupports> isupports;
|
||||
for (uint32_t i = 0; i < numObjects; i++) {
|
||||
if (0 == i) {
|
||||
n->child = walk = new myNode;
|
||||
|
|
|
@ -2194,7 +2194,6 @@ GetDefaultCertVerifier()
|
|||
static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID);
|
||||
|
||||
nsCOMPtr<nsINSSComponent> nssComponent(do_GetService(kNSSComponentCID));
|
||||
RefPtr<SharedCertVerifier> certVerifier;
|
||||
if (nssComponent) {
|
||||
return nssComponent->GetDefaultCertVerifier();
|
||||
}
|
||||
|
|
|
@ -70,10 +70,9 @@ public:
|
|||
// Hold a strong reference to the callback while notifying it, so that if
|
||||
// it spins the event loop, the callback won't be released and freed out
|
||||
// from under us.
|
||||
nsCOMPtr<mozIStorageStatementCallback> callback =
|
||||
do_QueryInterface(mCallback);
|
||||
nsCOMPtr<mozIStorageStatementCallback> callback = mCallback;
|
||||
|
||||
(void)mCallback->HandleResult(mResults);
|
||||
(void)callback->HandleResult(mResults);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -106,10 +105,9 @@ public:
|
|||
// Hold a strong reference to the callback while notifying it, so that if
|
||||
// it spins the event loop, the callback won't be released and freed out
|
||||
// from under us.
|
||||
nsCOMPtr<mozIStorageStatementCallback> callback =
|
||||
do_QueryInterface(mCallback);
|
||||
nsCOMPtr<mozIStorageStatementCallback> callback = mCallback;
|
||||
|
||||
(void)mCallback->HandleError(mErrorObj);
|
||||
(void)callback->HandleError(mErrorObj);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -613,7 +613,6 @@ nsFormFillController::GetInPrivateContext(bool *aInPrivateContext)
|
|||
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(mFocusedInput);
|
||||
element->GetOwnerDocument(getter_AddRefs(inputDoc));
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(inputDoc);
|
||||
nsCOMPtr<nsIDocShell> docShell = doc->GetDocShell();
|
||||
nsCOMPtr<nsILoadContext> loadContext = doc->GetLoadContext();
|
||||
*aInPrivateContext = loadContext && loadContext->UsePrivateBrowsing();
|
||||
return NS_OK;
|
||||
|
|
|
@ -394,7 +394,6 @@ nsTypeAheadFind::FindItNow(nsIPresShell *aPresShell, bool aIsLinksOnly,
|
|||
|
||||
// ------------ Get ranges ready ----------------
|
||||
nsCOMPtr<nsIDOMRange> returnRange;
|
||||
nsCOMPtr<nsIPresShell> focusedPS;
|
||||
if (NS_FAILED(GetSearchContainers(currentContainer,
|
||||
(!aIsFirstVisiblePreferred ||
|
||||
mStartFindRange) ?
|
||||
|
@ -897,7 +896,7 @@ nsTypeAheadFind::RangeStartsInsideLink(nsIDOMRange *aRange,
|
|||
// We now have the correct start node for the range
|
||||
// Search for links, starting with startNode, and going up parent chain
|
||||
|
||||
nsCOMPtr<nsIAtom> tag, hrefAtom(NS_Atomize("href"));
|
||||
nsCOMPtr<nsIAtom> hrefAtom(NS_Atomize("href"));
|
||||
nsCOMPtr<nsIAtom> typeAtom(NS_Atomize("type"));
|
||||
|
||||
while (true) {
|
||||
|
|
|
@ -1987,7 +1987,6 @@ nsComponentManagerImpl::RemoveBootstrappedManifestLocation(nsIFile* aLocation)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> manifest;
|
||||
nsString path;
|
||||
nsresult rv = aLocation->GetPath(path);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <stdio.h>
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISupports.h"
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
#define NS_IFOO_IID \
|
||||
{ 0x6f7652e0, 0xee43, 0x11d1, \
|
||||
|
@ -360,6 +361,7 @@ main()
|
|||
{
|
||||
printf("\n### Test 6: will a |nsCOMPtr| call the correct destructor?\n");
|
||||
nsCOMPtr<IFoo> foop( do_QueryInterface(new IBar) );
|
||||
mozilla::Unused << foop;
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "nsAutoPtr.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsQueryObject.h"
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
#define NS_FOO_IID \
|
||||
{ 0x6f7652e0, 0xee43, 0x11d1, \
|
||||
|
@ -431,6 +432,7 @@ main()
|
|||
{
|
||||
printf("\n### Test 6: will a |nsCOMPtr| call the correct destructor?\n");
|
||||
RefPtr<Foo> foop( do_QueryObject(new Bar) );
|
||||
mozilla::Unused << foop;
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче