Bug 609710 - Fix warnings in TestStartupCache.cpp; r=mwu f=Ms2ger
authorNathan Froyd <froydnj@mozilla.com>
Thu, 29 Dec 2011 15:06:00 -0500
changeset 86095 092e88ea2eb70f5b549efdf7c7201c9ac89e5ce9
parent 86094 50116672ff05465c5b9d737fc54e30defd76226f
child 86096 7d23dd6c50ebb19e7edeb495367c55352bbc809c
push id674
push userffxbld
push dateTue, 13 Mar 2012 21:17:50 +0000
treeherdermozilla-beta@e3c4c92dec31 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu
bugs609710
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 609710 - Fix warnings in TestStartupCache.cpp; r=mwu f=Ms2ger
startupcache/StartupCache.cpp
startupcache/nsIStartupCache.idl
startupcache/test/TestStartupCache.cpp
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -676,17 +676,17 @@ StartupCacheWrapper::GetBuffer(const cha
   StartupCache* sc = StartupCache::GetSingleton();
   if (!sc) {
     return NS_ERROR_NOT_INITIALIZED;
   }
   return sc->GetBuffer(id, outbuf, length);
 }
 
 nsresult
-StartupCacheWrapper::PutBuffer(const char* id, char* inbuf, PRUint32 length) 
+StartupCacheWrapper::PutBuffer(const char* id, const char* inbuf, PRUint32 length) 
 {
   StartupCache* sc = StartupCache::GetSingleton();
   if (!sc) {
     return NS_ERROR_NOT_INITIALIZED;
   }
   return sc->PutBuffer(id, inbuf, length);
 }
 
--- a/startupcache/nsIStartupCache.idl
+++ b/startupcache/nsIStartupCache.idl
@@ -37,27 +37,27 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIInputStream.idl"
 #include "nsISupports.idl"
 #include "nsIObserver.idl"
 #include "nsIObjectOutputStream.idl"
 
-[uuid(de798fab-af49-4a61-8144-81550986e1da)]
+[uuid(8c2a360b-e337-455b-8c1b-04265ef9c5a3)]
 interface nsIStartupCache : nsISupports
 {
 
   /** This interface is provided for testing purposes only, basically
    *  just to solve link vagaries. See docs in StartupCache.h
    *  GetBuffer, PutBuffer, and InvalidateCache act as described 
    *  in that file. */
 
   PRUint32 getBuffer(in string aID, out charPtr aBuffer);
-  void putBuffer(in string aID, in charPtr aBuffer, 
+  void putBuffer(in string aID, in string aBuffer, 
                             in PRUint32 aLength);
  
   void invalidateCache();
   
   /** In debug builds, wraps this object output stream with a stream that will 
    *  detect and prevent the write of a multiply-referenced non-singleton object 
    *  during serialization. In non-debug, returns an add-ref'd pointer to
    *  original stream, unwrapped. */
--- a/startupcache/test/TestStartupCache.cpp
+++ b/startupcache/test/TestStartupCache.cpp
@@ -111,18 +111,18 @@ TestStartupWriteRead() {
   if (!sc) {
     fail("didn't get a pointer...");
     return NS_ERROR_FAILURE;
   } else {
     passed("got a pointer?");
   }
   sc->InvalidateCache();
   
-  char* buf = "Market opportunities for BeardBook";
-  char* id = "id";
+  const char* buf = "Market opportunities for BeardBook";
+  const char* id = "id";
   char* outbufPtr = NULL;
   nsAutoArrayPtr<char> outbuf;  
   PRUint32 len;
   
   rv = sc->PutBuffer(id, buf, strlen(buf) + 1);
   NS_ENSURE_SUCCESS(rv, rv);
   
   rv = sc->GetBuffer(id, &outbufPtr, &len);
@@ -140,18 +140,18 @@ TestStartupWriteRead() {
   NS_ENSURE_STR_MATCH(buf, outbuf, "simple write/read");
 
   return NS_OK;
 }
 
 nsresult
 TestWriteInvalidateRead() {
   nsresult rv;
-  char* buf = "BeardBook competitive analysis";
-  char* id = "id";
+  const char* buf = "BeardBook competitive analysis";
+  const char* id = "id";
   char* outbuf = NULL;
   PRUint32 len;
   nsCOMPtr<nsIStartupCache> sc 
     = do_GetService("@mozilla.org/startupcache/cache;1", &rv);
   sc->InvalidateCache();
 
   rv = sc->PutBuffer(id, buf, strlen(buf) + 1);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -189,17 +189,17 @@ TestWriteObject() {
   nsCOMPtr<nsIStartupCache> sc = do_GetService("@mozilla.org/startupcache/cache;1", &rv);
 
   sc->InvalidateCache();
   
   // Create an object stream. Usually this is done with
   // NewObjectOutputWrappedStorageStream, but that uses
   // StartupCache::GetSingleton in debug builds, and we
   // don't have access to that here. Obviously.
-  char* id = "id";
+  const char* id = "id";
   nsCOMPtr<nsIStorageStream> storageStream
     = do_CreateInstance("@mozilla.org/storagestream;1");
   NS_ENSURE_ARG_POINTER(storageStream);
   
   rv = storageStream->Init(256, (PRUint32) -1, nsnull);
   NS_ENSURE_SUCCESS(rv, rv);
   
   nsCOMPtr<nsIObjectOutputStream> objectOutput
@@ -280,18 +280,18 @@ TestWriteObject() {
 
 nsresult
 TestEarlyShutdown() {
   nsresult rv;
   nsCOMPtr<nsIStartupCache> sc 
     = do_GetService("@mozilla.org/startupcache/cache;1", &rv);
   sc->InvalidateCache();
 
-  char* buf = "Find your soul beardmate on BeardBook";
-  char* id = "id";
+  const char* buf = "Find your soul beardmate on BeardBook";
+  const char* id = "id";
   PRUint32 len;
   char* outbuf = NULL;
   
   sc->ResetStartupWriteTimer();
   rv = sc->PutBuffer(buf, id, strlen(buf) + 1);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIObserver> obs;