fix-garburator.patch
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 81 c44369c08f6589473ff14827f7c0001428eae19e
permissions -rw-r--r--
State as of now

diff --git a/modules/libpref/public/nsIRelativeFilePref.idl b/modules/libpref/public/nsIRelativeFilePref.idl
--- a/modules/libpref/public/nsIRelativeFilePref.idl
+++ b/modules/libpref/public/nsIRelativeFilePref.idl
@@ -89,7 +89,7 @@ NS_NewRelativeFilePref(nsILocalFile* aFi
 NS_NewRelativeFilePref(nsILocalFile* aFile, const nsACString& relativeToKey, nsIRelativeFilePref** result)
 {
     nsresult rv;
-    nsCOMPtr<nsIRelativeFilePref> local(do_CreateInstance(NS_RELATIVEFILEPREF_CONTRACTID, &rv));
+    nsIRelativeFilePref* local(do_CreateInstance(NS_RELATIVEFILEPREF_CONTRACTID, &rv));
     if (NS_FAILED(rv)) return rv;
     
     (void)local->SetFile(aFile);
diff --git a/modules/plugin/base/public/nsIPluginHost.idl b/modules/plugin/base/public/nsIPluginHost.idl
--- a/modules/plugin/base/public/nsIPluginHost.idl
+++ b/modules/plugin/base/public/nsIPluginHost.idl
@@ -138,7 +138,7 @@ NS_NewPluginPostDataStream(nsIInputStrea
         return NS_ERROR_OUT_OF_MEMORY;
       memcpy(buf, data, contentLength);
     }
-    nsCOMPtr<nsIStringInputStream> sis = do_CreateInstance("@mozilla.org/io/string-input-stream;1",&rv);
+    nsIStringInputStream* sis = do_CreateInstance("@mozilla.org/io/string-input-stream;1",&rv);
     if (NS_SUCCEEDED(rv)) {
       sis->AdoptData(buf, contentLength);  // let the string stream manage our data
       rv = CallQueryInterface(sis, result);
@@ -146,10 +146,10 @@ NS_NewPluginPostDataStream(nsIInputStrea
     else if (headers)
       nsMemory::Free(buf); // Cleanup the memory if the data was copied.
   } else {
-    nsCOMPtr<nsILocalFile> file; // tmp file will be deleted on release of stream
-    nsCOMPtr<nsIInputStream> fileStream;
-    if (NS_SUCCEEDED(rv = NS_NewNativeLocalFile(nsDependentCString(data), PR_FALSE, getter_AddRefs(file))) &&
-        NS_SUCCEEDED(rv = NS_NewLocalFileInputStream(getter_AddRefs(fileStream),
+    nsILocalFile* file; // tmp file will be deleted on release of stream
+    nsIInputStream* fileStream;
+    if (NS_SUCCEEDED(rv = NS_NewNativeLocalFile(nsDependentCString(data), PR_FALSE, &file)) &&
+        NS_SUCCEEDED(rv = NS_NewLocalFileInputStream(&fileStream,
                                      file,
                                      PR_RDONLY,
                                      0600,
diff --git a/netwerk/test/TestProtocols.cpp b/netwerk/test/TestProtocols.cpp
--- a/netwerk/test/TestProtocols.cpp
+++ b/netwerk/test/TestProtocols.cpp
@@ -401,9 +401,9 @@ InputTestConsumer::OnStartRequest(nsIReq
         LOG(("\tContent-Length: Unknown\n"));
     }
 
-    nsCOMPtr<nsISupports> owner;
-    channel->GetOwner(getter_AddRefs(owner));
-    LOG(("\tChannel Owner: %x\n", owner.get()));
+    nsISupports* owner;
+    channel->GetOwner(&owner);
+    LOG(("\tChannel Owner: %x\n", owner));
   }
 
   nsCOMPtr<nsIPropertyBag2> props = do_QueryInterface(request);
diff --git a/netwerk/test/TestStreamLoader.cpp b/netwerk/test/TestStreamLoader.cpp
--- a/netwerk/test/TestStreamLoader.cpp
+++ b/netwerk/test/TestStreamLoader.cpp
@@ -30,9 +30,9 @@ MyStreamLoaderObserver::OnStreamComplete
 {
   LOG(("OnStreamComplete [status=%x resultLen=%u]\n", status, resultLen));
 
-  nsCOMPtr<nsIRequest> request;
-  loader->GetRequest(getter_AddRefs(request));
-  LOG(("  request=%p\n", request.get()));
+  nsIRequest* request;
+  loader->GetRequest(&request);
+  LOG(("  request=%p\n", request));
 
   QuitPumpingEvents();
   return NS_OK;
diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp
--- a/uriloader/base/nsURILoader.cpp
+++ b/uriloader/base/nsURILoader.cpp
@@ -477,7 +477,7 @@ nsresult nsDocumentOpenInfo::DispatchCon
                mContentType.get(), contractidString.get()));
 
           listener = do_CreateInstance(contractidString);
-          LOG(("  Listener from category manager: 0x%p", listener.get()));
+          LOG(("  Listener from category manager: 0x%p", listener));
           
           if (listener && TryContentListener(listener, aChannel)) {
             LOG(("  Listener from category manager likes this type"));
@@ -638,7 +638,7 @@ nsDocumentOpenInfo::ConvertData(nsIReque
     new nsDocumentOpenInfo(m_originalContext, mFlags, mURILoader);
   if (!nextLink) return NS_ERROR_OUT_OF_MEMORY;
 
-  LOG(("  Downstream DocumentOpenInfo would be: 0x%p", nextLink.get()));
+  LOG(("  Downstream DocumentOpenInfo would be: 0x%p", nextLink));
   
   // Make sure nextLink starts with the contentListener that said it wanted the
   // results of this decode.
diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -624,7 +624,7 @@ NS_IMETHODIMP nsExternalHelperAppService
     mimeSvc->GetFromTypeAndExtension(aMimeContentType, fileExtension,
                                      getter_AddRefs(mimeInfo));
   } 
-  LOG(("Type/Ext lookup found 0x%p\n", mimeInfo.get()));
+  LOG(("Type/Ext lookup found 0x%p\n", mimeInfo));
 
   // No mimeinfo -> we can't continue. probably OOM.
   if (!mimeInfo)
diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.cpp b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -1631,7 +1631,7 @@ nsOfflineCacheUpdateService::OnStateChan
         if (!doc) return NS_OK;
 
         LOG(("nsOfflineCacheUpdateService::OnStateChange [%p, doc=%p]",
-             this, doc.get()));
+             this, doc));
 
 
         PendingUpdate *pendingUpdate;
diff --git a/xpcom/io/nsIFastLoadService.idl b/xpcom/io/nsIFastLoadService.idl
--- a/xpcom/io/nsIFastLoadService.idl
+++ b/xpcom/io/nsIFastLoadService.idl
@@ -149,7 +149,7 @@ inline nsresult
 inline nsresult
 NS_AddFastLoadDependency(nsIFile* aFile)
 {
-    nsCOMPtr<nsIFastLoadService> fastLoadService(do_GetFastLoadService());
+    nsIFastLoadService* fastLoadService(do_GetFastLoadService());
     if (fastLoadService) {
         nsresult rv = fastLoadService->AddDependency(aFile);
         if (NS_FAILED(rv) && rv != NS_ERROR_NOT_AVAILABLE)
diff --git a/xpcom/proxy/src/nsProxyEventObject.cpp b/xpcom/proxy/src/nsProxyEventObject.cpp
--- a/xpcom/proxy/src/nsProxyEventObject.cpp
+++ b/xpcom/proxy/src/nsProxyEventObject.cpp
@@ -226,6 +226,6 @@ nsProxyEventObject::CallMethod(PRUint16 
 
     threadInt->PopEventQueue();
 
-    PROXY_LOG(("PROXY(%p): PostAndWait exit [%p %x]\n", this, proxyInfo.get(), rv));
+    PROXY_LOG(("PROXY(%p): PostAndWait exit [%p %x]\n", this, proxyInfo, rv));
     return rv;
 }
diff --git a/xpcom/proxy/tests/proxytests.cpp b/xpcom/proxy/tests/proxytests.cpp
--- a/xpcom/proxy/tests/proxytests.cpp
+++ b/xpcom/proxy/tests/proxytests.cpp
@@ -160,7 +160,7 @@ NS_IMETHODIMP nsTestXPCFoo2::Test(PRInt3
     nsCOMPtr<nsIProxyObjectManager> manager =
             do_GetService(NS_XPCOMPROXY_CONTRACTID);
 
-    LOG(("TEST: ProxyObjectManager: %p \n", (void *) manager.get()));
+    LOG(("TEST: ProxyObjectManager: %p \n", (void *) manager));
     
     PR_ASSERT(manager);
 
@@ -276,7 +276,7 @@ void TestCase_NestedLoop(nsIThread *thre
     nsCOMPtr<nsIProxyObjectManager> manager =
             do_GetService(NS_XPCOMPROXY_CONTRACTID);
 
-    LOG(("TEST: ProxyObjectManager: %p\n", (void *) manager.get()));
+    LOG(("TEST: ProxyObjectManager: %p\n", (void *) manager));
     
     PR_ASSERT(manager);
 
diff --git a/xpcom/tests/Makefile.in b/xpcom/tests/Makefile.in
--- a/xpcom/tests/Makefile.in
+++ b/xpcom/tests/Makefile.in
@@ -66,7 +66,6 @@ CPPSRCS		= \
 		TestINIParser.cpp \
 		TestObserverService.cpp \
 		TestServMgr.cpp \
-		TestAutoPtr.cpp \
 		TestVersionComparator.cpp \
 		TestTextFormatter.cpp \
 		TestPipe.cpp \
diff --git a/xpcom/tests/TestAutoPtr.cpp b/xpcom/tests/TestAutoPtr.cpp
deleted file mode 100644
--- a/xpcom/tests/TestAutoPtr.cpp
+++ /dev/null
@@ -1,575 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-// vim:cindent:ts=4:et:sw=4:
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is TestCOMPtrEq.cpp.
- *
- * The Initial Developer of the Original Code is
- * L. David Baron.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   L. David Baron <dbaron@dbaron.org> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsAutoPtr.h"
-#include <stdio.h>
-#include "nscore.h"
-
-class TestObjectBaseA {
-    public:
-        // Virtual dtor for deleting through base class pointer
-        virtual ~TestObjectBaseA() { };
-        int fooA;
-};
-
-class TestObjectBaseB {
-    public:
-        // Virtual dtor for deleting through base class pointer
-        virtual ~TestObjectBaseB() { };
-        int fooB;
-};
-
-class TestObject : public TestObjectBaseA, public TestObjectBaseB {
-    public:
-        TestObject()
-        {
-            printf("  Creating TestObject %p.\n",
-                   static_cast<void*>(this));
-        }
-
-        // Virtual dtor for deleting through base class pointer
-        virtual ~TestObject()
-        {
-            printf("  Destroying TestObject %p.\n",
-                   static_cast<void*>(this));
-        }
-};
-
-class TestRefObjectBaseA {
-    public:
-        int fooA;
-        // Must return |nsrefcnt| to keep |nsDerivedSafe| happy.
-        virtual nsrefcnt AddRef() = 0;
-        virtual nsrefcnt Release() = 0;
-};
-
-class TestRefObjectBaseB {
-    public:
-        int fooB;
-        virtual nsrefcnt AddRef() = 0;
-        virtual nsrefcnt Release() = 0;
-};
-
-class TestRefObject : public TestRefObjectBaseA, public TestRefObjectBaseB {
-    public:
-        TestRefObject()
-            : mRefCount(0)
-        {
-            printf("  Creating TestRefObject %p.\n",
-                   static_cast<void*>(this));
-        }
-
-        ~TestRefObject()
-        {
-            printf("  Destroying TestRefObject %p.\n",
-                   static_cast<void*>(this));
-        }
-
-        nsrefcnt AddRef()
-        {
-            ++mRefCount;
-            printf("  AddRef to %d on TestRefObject %p.\n",
-                   mRefCount, static_cast<void*>(this));
-            return mRefCount;
-        }
-
-        nsrefcnt Release()
-        {
-            --mRefCount;
-            printf("  Release to %d on TestRefObject %p.\n",
-                   mRefCount, static_cast<void*>(this));
-            if (mRefCount == 0) {
-                delete const_cast<TestRefObject*>(this);
-                return 0;
-            }
-            return mRefCount;
-        }
-
-    protected:
-        PRUint32 mRefCount;
-
-};
-
-static void CreateTestObject(TestObject **aResult)
-{
-    *aResult = new TestObject();
-}
-
-static void CreateTestRefObject(TestRefObject **aResult)
-{
-    (*aResult = new TestRefObject())->AddRef();
-}
-
-static void DoSomethingWithTestObject(TestObject *aIn)
-{
-    printf("  Doing something with |TestObject| %p.\n",
-           static_cast<void*>(aIn));
-}
-
-static void DoSomethingWithConstTestObject(const TestObject *aIn)
-{
-    printf("  Doing something with |const TestObject| %p.\n",
-           static_cast<const void*>(aIn));
-}
-
-static void DoSomethingWithTestRefObject(TestRefObject *aIn)
-{
-    printf("  Doing something with |TestRefObject| %p.\n",
-           static_cast<void*>(aIn));
-}
-
-static void DoSomethingWithConstTestRefObject(const TestRefObject *aIn)
-{
-    printf("  Doing something with |const TestRefObject| %p.\n",
-           static_cast<const void*>(aIn));
-}
-
-static void DoSomethingWithTestObjectBaseB(TestObjectBaseB *aIn)
-{
-    printf("  Doing something with |TestObjectBaseB| %p.\n",
-           static_cast<void*>(aIn));
-}
-
-static void DoSomethingWithConstTestObjectBaseB(const TestObjectBaseB *aIn)
-{
-    printf("  Doing something with |const TestObjectBaseB| %p.\n",
-           static_cast<const void*>(aIn));
-}
-
-static void DoSomethingWithTestRefObjectBaseB(TestRefObjectBaseB *aIn)
-{
-    printf("  Doing something with |TestRefObjectBaseB| %p.\n",
-           static_cast<void*>(aIn));
-}
-
-static void DoSomethingWithConstTestRefObjectBaseB(const TestRefObjectBaseB *aIn)
-{
-    printf("  Doing something with |const TestRefObjectBaseB| %p.\n",
-           static_cast<const void*>(aIn));
-}
-
-int main()
-{
-    {
-        printf("Should create one |TestObject|:\n");
-        nsAutoPtr<TestObject> pobj( new TestObject() );
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        printf("Should create one |TestObject|:\n");
-        nsAutoPtr<TestObject> pobj( new TestObject() );
-        printf("Should create one |TestObject| and then destroy one:\n");
-        pobj = new TestObject();
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        printf("Should create 3 |TestObject|s:\n");
-        nsAutoArrayPtr<TestObject> pobj( new TestObject[3] );
-        printf("Should create 5 |TestObject|s and then destroy 3:\n");
-        pobj = new TestObject[5];
-        printf("Should destroy 5 |TestObject|s:\n");
-    }
-
-    {
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        nsRefPtr<TestRefObject> pobj( new TestRefObject() );
-        printf("Should Release and destroy one |TestRefObject|:\n");
-    }
-
-    {
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        nsRefPtr<TestRefObject> pobj( new TestRefObject() );
-        printf("Should create and AddRef one |TestRefObject| and then Release and destroy one:\n");
-        pobj = new TestRefObject();
-        printf("Should Release and destroy one |TestRefObject|:\n");
-    }
-
-    {
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        printf("Should AddRef one |TestRefObject|:\n");
-        nsRefPtr<TestRefObject> p2( p1 );
-        printf("Should Release twice and destroy one |TestRefObject|:\n");
-    }
-
-    printf("\nTesting equality (with all const-ness combinations):\n");
-
-    {
-        nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        nsRefPtr<TestRefObject> p2( p1 );
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2)) ? "OK" : "broken");
-    }
-
-    {
-        const nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        nsRefPtr<TestRefObject> p2( p1 );
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2)) ? "OK" : "broken");
-    }
-
-    {
-        nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        const nsRefPtr<TestRefObject> p2( p1 );
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2)) ? "OK" : "broken");
-    }
-
-    {
-        const nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        const nsRefPtr<TestRefObject> p2( p1 );
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2)) ? "OK" : "broken");
-    }
-
-    {
-        nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        TestRefObject * p2 = p1;
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1)) ? "OK" : "broken");
-    }
-
-    {
-        const nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        TestRefObject * p2 = p1;
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1)) ? "OK" : "broken");
-    }
-
-#if 0 /* MSVC++ 6.0 can't be coaxed to accept this */
-    {
-        nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        TestRefObject * const p2 = p1;
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1)) ? "OK" : "broken");
-    }
-
-    {
-        const nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        TestRefObject * const p2 = p1;
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1)) ? "OK" : "broken");
-    }
-#endif /* Things that MSVC++ 6.0 can't be coaxed to accept */
-
-    {
-        nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        const TestRefObject * p2 = p1;
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1)) ? "OK" : "broken");
-    }
-
-    {
-        const nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        const TestRefObject * p2 = p1;
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1)) ? "OK" : "broken");
-    }
-
-    {
-        nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        const TestRefObject * const p2 = p1;
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1)) ? "OK" : "broken");
-    }
-
-    {
-        const nsRefPtr<TestRefObject> p1( new TestRefObject() );
-        const TestRefObject * const p2 = p1;
-        printf("equality %s.\n",
-               ((p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1)) ? "OK" : "broken");
-    }
-
-    printf("\nTesting getter_Transfers and getter_AddRefs.\n");
-
-    {
-        nsAutoPtr<TestObject> ptr;
-        printf("Should create one |TestObject|:\n");
-        CreateTestObject(getter_Transfers(ptr));
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        nsRefPtr<TestRefObject> ptr;
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        CreateTestRefObject(getter_AddRefs(ptr));
-        printf("Should Release and destroy one |TestRefObject|:\n");
-    }
-
-    printf("\nTesting casts and equality tests.\n");
-
-    if ((void*)(TestObject*)0x1000 ==
-        (void*)(TestObjectBaseB*)(TestObject*)0x1000)
-        printf("\n\nAll these tests are meaningless!\n\n\n");
-
-    {
-        nsAutoPtr<TestObject> p1(new TestObject());
-        TestObjectBaseB *p2 = p1;
-        printf("equality %s.\n",
-               ((static_cast<void*>(p1) != static_cast<void*>(p2)) &&
-                (p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1))
-               ? "OK" : "broken");
-    }
-
-    {
-        TestObject *p1 = new TestObject();
-        nsAutoPtr<TestObjectBaseB> p2(p1);
-        printf("equality %s.\n",
-               ((static_cast<void*>(p1) != static_cast<void*>(p2)) &&
-                (p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1))
-               ? "OK" : "broken");
-    }
-
-    {
-        nsRefPtr<TestRefObject> p1 = new TestRefObject();
-        // nsCOMPtr requires a |get| for something like this as well
-        nsRefPtr<TestRefObjectBaseB> p2 = p1.get();
-        printf("equality %s.\n",
-               ((static_cast<void*>(p1) != static_cast<void*>(p2)) &&
-                (p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1))
-               ? "OK" : "broken");
-    }
-
-    {
-        nsRefPtr<TestRefObject> p1 = new TestRefObject();
-        TestRefObjectBaseB *p2 = p1;
-        printf("equality %s.\n",
-               ((static_cast<void*>(p1) != static_cast<void*>(p2)) &&
-                (p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1))
-               ? "OK" : "broken");
-    }
-
-    {
-        TestRefObject *p1 = new TestRefObject();
-        nsRefPtr<TestRefObjectBaseB> p2 = p1;
-        printf("equality %s.\n",
-               ((static_cast<void*>(p1) != static_cast<void*>(p2)) &&
-                (p1 == p2) && !(p1 != p2) && (p2 == p1) && !(p2 != p1))
-               ? "OK" : "broken");
-    }
-
-    printf("\nTesting |forget()|.\n");
-
-    {
-        printf("Should create one |TestObject|:\n");
-        nsAutoPtr<TestObject> pobj( new TestObject() );
-        printf("Should do nothing:\n");
-        nsAutoPtr<TestObject> pobj2( pobj.forget() );
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        printf("Should create 3 |TestObject|s:\n");
-        nsAutoArrayPtr<TestObject> pobj( new TestObject[3] );
-        printf("Should do nothing:\n");
-        nsAutoArrayPtr<TestObject> pobj2( pobj.forget() );
-        printf("Should destroy 3 |TestObject|s:\n");
-    }
-
-    {
-        printf("Should create one |TestRefObject|:\n");
-        nsRefPtr<TestRefObject> pobj( new TestRefObject() );
-        printf("Should do nothing:\n");
-        nsRefPtr<TestRefObject> pobj2( pobj.forget() );
-        printf("Should destroy one |TestRefObject|:\n");
-    }
-
-
-    printf("\nTesting construction.\n");
-
-    {
-        printf("Should create one |TestObject|:\n");
-        nsAutoPtr<TestObject> pobj(new TestObject());
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        printf("Should create 3 |TestObject|s:\n");
-        nsAutoArrayPtr<TestObject> pobj(new TestObject[3]);
-        printf("Should destroy 3 |TestObject|s:\n");
-    }
-
-    {
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        nsRefPtr<TestRefObject> pobj = new TestRefObject();
-        printf("Should Release and destroy one |TestRefObject|:\n");
-    }
-
-    printf("\nTesting calling of functions (including array access and casts).\n");
-
-    {
-        printf("Should create one |TestObject|:\n");
-        nsAutoPtr<TestObject> pobj(new TestObject());
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObject(pobj);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObject(pobj);
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        printf("Should create 3 |TestObject|s:\n");
-        nsAutoArrayPtr<TestObject> pobj(new TestObject[3]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObject(&pobj[2]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObject(&pobj[1]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObject(pobj + 2);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObject(pobj + 1);
-        printf("Should destroy 3 |TestObject|s:\n");
-    }
-
-    {
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        nsRefPtr<TestRefObject> pobj = new TestRefObject();
-        printf("Should do something with one |TestRefObject|:\n");
-        DoSomethingWithTestRefObject(pobj);
-        printf("Should do something with one |TestRefObject|:\n");
-        DoSomethingWithConstTestRefObject(pobj);
-        printf("Should Release and destroy one |TestRefObject|:\n");
-    }
-
-    {
-        printf("Should create one |TestObject|:\n");
-        nsAutoPtr<TestObject> pobj(new TestObject());
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObjectBaseB(pobj);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObjectBaseB(pobj);
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        printf("Should create 3 |TestObject|s:\n");
-        nsAutoArrayPtr<TestObject> pobj(new TestObject[3]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObjectBaseB(&pobj[2]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObjectBaseB(&pobj[1]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObjectBaseB(pobj + 2);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObjectBaseB(pobj + 1);
-        printf("Should destroy 3 |TestObject|s:\n");
-    }
-
-    {
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        nsRefPtr<TestRefObject> pobj = new TestRefObject();
-        printf("Should do something with one |TestRefObject|:\n");
-        DoSomethingWithTestRefObjectBaseB(pobj);
-        printf("Should do something with one |TestRefObject|:\n");
-        DoSomethingWithConstTestRefObjectBaseB(pobj);
-        printf("Should Release and destroy one |TestRefObject|:\n");
-    }
-
-    {
-        printf("Should create one |TestObject|:\n");
-        const nsAutoPtr<TestObject> pobj(new TestObject());
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObject(pobj);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObject(pobj);
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        printf("Should create 3 |TestObject|s:\n");
-        const nsAutoArrayPtr<TestObject> pobj(new TestObject[3]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObject(&pobj[2]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObject(&pobj[1]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObject(pobj + 2);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObject(pobj + 1);
-        printf("Should destroy 3 |TestObject|s:\n");
-    }
-
-    {
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        const nsRefPtr<TestRefObject> pobj = new TestRefObject();
-        printf("Should do something with one |TestRefObject|:\n");
-        DoSomethingWithTestRefObject(pobj);
-        printf("Should do something with one |TestRefObject|:\n");
-        DoSomethingWithConstTestRefObject(pobj);
-        printf("Should Release and destroy one |TestRefObject|:\n");
-    }
-
-    {
-        printf("Should create one |TestObject|:\n");
-        const nsAutoPtr<TestObject> pobj(new TestObject());
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObjectBaseB(pobj);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObjectBaseB(pobj);
-        printf("Should destroy one |TestObject|:\n");
-    }
-
-    {
-        printf("Should create 3 |TestObject|s:\n");
-        const nsAutoArrayPtr<TestObject> pobj(new TestObject[3]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObjectBaseB(&pobj[2]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObjectBaseB(&pobj[1]);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithTestObjectBaseB(pobj + 2);
-        printf("Should do something with one |TestObject|:\n");
-        DoSomethingWithConstTestObjectBaseB(pobj + 1);
-        printf("Should destroy 3 |TestObject|s:\n");
-    }
-
-    {
-        printf("Should create and AddRef one |TestRefObject|:\n");
-        const nsRefPtr<TestRefObject> pobj = new TestRefObject();
-        printf("Should do something with one |TestRefObject|:\n");
-        DoSomethingWithTestRefObjectBaseB(pobj);
-        printf("Should do something with one |TestRefObject|:\n");
-        DoSomethingWithConstTestRefObjectBaseB(pobj);
-        printf("Should Release and destroy one |TestRefObject|:\n");
-    }
-
-    return 0;
-}
diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -503,7 +503,7 @@ nsThread::ProcessNextEvent(PRBool mayWai
   nsresult rv = NS_OK;
 
   if (event) {
-    LOG(("THRD(%p) running [%p]\n", this, event.get()));
+    LOG(("THRD(%p) running [%p]\n", this, event));
     ++mRunningEvent;
     event->Run();
     --mRunningEvent;
diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp
--- a/xpcom/threads/nsThreadPool.cpp
+++ b/xpcom/threads/nsThreadPool.cpp
@@ -119,7 +119,7 @@ nsThreadPool::PutEvent(nsIRunnable *even
       killThread = PR_TRUE;  // okay, we don't need this thread anymore
     }
   }
-  LOG(("THRD-P(%p) put [%p kill=%d]\n", this, thread.get(), killThread));
+  LOG(("THRD-P(%p) put [%p kill=%d]\n", this, thread, killThread));
   if (killThread) {
     thread->Shutdown();
   } else {
@@ -205,7 +205,7 @@ nsThreadPool::Run()
       }
     }
     if (event) {
-      LOG(("THRD-P(%p) running [%p]\n", this, event.get()));
+      LOG(("THRD-P(%p) running [%p]\n", this, event));
       event->Run();
     }
   } while (!exitThread);