Bug 782252 - Convert declared types to nsresult; r=ehsan
authorAryeh Gregor <ayg@aryeh.name>
Mon, 06 Aug 2012 15:02:31 +0300
changeset 107884 4ec6f3cb235863f8f838846c21a0242103de7a85
parent 107883 3bc014ea9703529dd858f4445f706d01067a44ad
child 107885 fb5f3b3cc280475f437bee3278b67ba56c3388b0
push id1490
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 18:29:50 +0000
treeherdermozilla-beta@f335e7dacdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs782252
milestone17.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 782252 - Convert declared types to nsresult; r=ehsan
content/base/src/nsAttrValue.cpp
content/base/src/nsAttrValue.h
embedding/browser/webBrowser/nsWebBrowser.cpp
embedding/browser/webBrowser/nsWebBrowser.h
embedding/components/webbrowserpersist/public/nsIWebBrowserPersist.idl
embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h
netwerk/wifi/nsIWifiListener.idl
toolkit/xre/nsEmbedFunctions.cpp
--- a/content/base/src/nsAttrValue.cpp
+++ b/content/base/src/nsAttrValue.cpp
@@ -1305,17 +1305,17 @@ nsAttrValue::ParseEnumValue(const nsAStr
   return false;
 }
 
 bool
 nsAttrValue::ParseSpecialIntValue(const nsAString& aString)
 {
   ResetIfSet();
 
-  PRInt32 ec;
+  nsresult ec;
   bool strict;
   bool isPercent = false;
   nsAutoString tmp(aString);
   PRInt32 originalVal = StringToInteger(aString, &strict, &ec, true, &isPercent);
 
   if (NS_FAILED(ec)) {
     return false;
   }
@@ -1338,17 +1338,17 @@ nsAttrValue::ParseSpecialIntValue(const 
 bool
 nsAttrValue::ParseIntWithBounds(const nsAString& aString,
                                 PRInt32 aMin, PRInt32 aMax)
 {
   NS_PRECONDITION(aMin < aMax, "bad boundaries");
 
   ResetIfSet();
 
-  PRInt32 ec;
+  nsresult ec;
   bool strict;
   PRInt32 originalVal = StringToInteger(aString, &strict, &ec);
   if (NS_FAILED(ec)) {
     return false;
   }
 
   PRInt32 val = NS_MAX(originalVal, aMin);
   val = NS_MIN(val, aMax);
@@ -1358,34 +1358,34 @@ nsAttrValue::ParseIntWithBounds(const ns
   return true;
 }
 
 bool
 nsAttrValue::ParseNonNegativeIntValue(const nsAString& aString)
 {
   ResetIfSet();
 
-  PRInt32 ec;
+  nsresult ec;
   bool strict;
   PRInt32 originalVal = StringToInteger(aString, &strict, &ec);
   if (NS_FAILED(ec) || originalVal < 0) {
     return false;
   }
 
   SetIntValueAndType(originalVal, eInteger, strict ? nullptr : &aString);
 
   return true;
 }
 
 bool
 nsAttrValue::ParsePositiveIntValue(const nsAString& aString)
 {
   ResetIfSet();
 
-  PRInt32 ec;
+  nsresult ec;
   bool strict;
   PRInt32 originalVal = StringToInteger(aString, &strict, &ec);
   if (NS_FAILED(ec) || originalVal <= 0) {
     return false;
   }
 
   SetIntValueAndType(originalVal, eInteger, strict ? nullptr : &aString);
 
@@ -1656,17 +1656,17 @@ nsAttrValue::GetStringBuffer(const nsASt
   PRUnichar *data = static_cast<PRUnichar*>(buf->Data());
   CopyUnicodeTo(aValue, 0, data, len);
   data[len] = PRUnichar(0);
   return buf;
 }
 
 PRInt32
 nsAttrValue::StringToInteger(const nsAString& aValue, bool* aStrict,
-                             PRInt32* aErrorCode,
+                             nsresult* aErrorCode,
                              bool aCanBePercent,
                              bool* aIsPercent) const
 {
   *aStrict = true;
   *aErrorCode = NS_ERROR_ILLEGAL_VALUE;
   if (aCanBePercent) {
     *aIsPercent = false;
   }
--- a/content/base/src/nsAttrValue.h
+++ b/content/base/src/nsAttrValue.h
@@ -413,17 +413,17 @@ private:
 
   bool EnsureEmptyMiscContainer();
   bool EnsureEmptyAtomArray();
   nsStringBuffer* GetStringBuffer(const nsAString& aValue) const;
   // aStrict is set true if stringifying the return value equals with
   // aValue.
   PRInt32 StringToInteger(const nsAString& aValue,
                           bool* aStrict,
-                          PRInt32* aErrorCode,
+                          nsresult* aErrorCode,
                           bool aCanBePercent = false,
                           bool* aIsPercent = nullptr) const;
   // Given an enum table and a particular entry in that table, return
   // the actual integer value we should store.
   PRInt32 EnumTableEntryToValue(const EnumTable* aEnumTable,
                                 const EnumTable* aTableEntry);  
 
   static nsTArray<const EnumTable*, nsTArrayDefaultAllocator>* sEnumTableArray;
--- a/embedding/browser/webBrowser/nsWebBrowser.cpp
+++ b/embedding/browser/webBrowser/nsWebBrowser.cpp
@@ -882,18 +882,18 @@ NS_IMETHODIMP nsWebBrowser::GetCurrentSt
     if (mPersist)
     {
         mPersist->GetCurrentState(&mPersistCurrentState);
     }
     *aCurrentState = mPersistCurrentState;
     return NS_OK;
 }
 
-/* readonly attribute unsigned long result; */
-NS_IMETHODIMP nsWebBrowser::GetResult(PRUint32 *aResult)
+/* readonly attribute nsresult result; */
+NS_IMETHODIMP nsWebBrowser::GetResult(nsresult *aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     if (mPersist)
     {
         mPersist->GetResult(&mPersistResult);
     }
     *aResult = mPersistResult;
     return NS_OK;
--- a/embedding/browser/webBrowser/nsWebBrowser.h
+++ b/embedding/browser/webBrowser/nsWebBrowser.h
@@ -144,17 +144,17 @@ protected:
    nsCOMPtr<nsIPrintSettings> mPrintSettings;
 
    // cached background color
    nscolor                       mBackgroundColor;
 
    // persistence object
    nsCOMPtr<nsIWebBrowserPersist> mPersist;
    PRUint32                       mPersistCurrentState;
-   PRUint32                       mPersistResult;
+   nsresult                       mPersistResult;
    PRUint32                       mPersistFlags;
 
    // stream
    nsEmbedStream                 *mStream;
    nsCOMPtr<nsISupports>          mStreamGuard;
 
    //Weak Reference interfaces...
    nsIWidget*                            mParentWidget;
--- a/embedding/components/webbrowserpersist/public/nsIWebBrowserPersist.idl
+++ b/embedding/components/webbrowserpersist/public/nsIWebBrowserPersist.idl
@@ -93,17 +93,17 @@ interface nsIWebBrowserPersist : nsICanc
   /**
    * Value indicating the success or failure of the persist
    * operation.
    *
    * @return NS_OK Operation was successful or is still ongoing.
    * @return NS_BINDING_ABORTED Operation cancelled.
    * @return NS_ERROR_FAILURE Non-specific failure.
    */
-  readonly attribute unsigned long result;
+  readonly attribute nsresult result;
 
   /**
    * Callback listener for progress notifications. The object that the
    * embbedder supplies may also implement nsIInterfaceRequestor and be
    * prepared to return nsIAuthPrompt or other interfaces that may be required
    * to download data.
    *
    * @see nsIAuthPrompt
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
@@ -298,17 +298,17 @@ NS_IMETHODIMP nsWebBrowserPersist::GetCu
     else
     {
         *aCurrentState = PERSIST_STATE_READY;
     }
     return NS_OK;
 }
 
 /* readonly attribute unsigned long result; */
-NS_IMETHODIMP nsWebBrowserPersist::GetResult(PRUint32 *aResult)
+NS_IMETHODIMP nsWebBrowserPersist::GetResult(nsresult *aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     *aResult = mPersistResult;
     return NS_OK;
 }
 
 /* attribute nsIWebBrowserPersistProgress progressListener; */
 NS_IMETHODIMP nsWebBrowserPersist::GetProgressListener(
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h
@@ -198,17 +198,17 @@ private:
     bool                      mFirstAndOnlyUse;
     bool                      mCancel;
     bool                      mJustStartedLoading;
     bool                      mCompleted;
     bool                      mStartSaving;
     bool                      mReplaceExisting;
     bool                      mSerializingOutput;
     PRUint32                  mPersistFlags;
-    PRUint32                  mPersistResult;
+    nsresult                  mPersistResult;
     PRInt64                   mTotalCurrentProgress;
     PRInt64                   mTotalMaxProgress;
     PRInt16                   mWrapColumn;
     PRUint32                  mEncodingFlags;
     nsString                  mContentType;
 };
 
 // Helper class does node fixup during persistence
--- a/netwerk/wifi/nsIWifiListener.idl
+++ b/netwerk/wifi/nsIWifiListener.idl
@@ -21,10 +21,10 @@ interface nsIWifiListener : nsISupports
 
   /*
    * Called when there is a problem with listening to wifi
    *
    * @param error the error which caused this event.  The
    *              error values will be nsresult codes.
    */
 
-  void onError(in long error);
+  void onError(in nsresult error);
 };
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -418,17 +418,17 @@ XRE_InitChildProcess(int aArgc,
   }
 #endif
 
   base::AtExitManager exitManager;
   NotificationService notificationService;
 
   NS_LogInit();
 
-  int rv = XRE_InitCommandLine(aArgc, aArgv);
+  nsresult rv = XRE_InitCommandLine(aArgc, aArgv);
   if (NS_FAILED(rv)) {
     NS_LogTerm();
     return NS_ERROR_FAILURE;
   }
 
   MessageLoop::Type uiLoopType;
   switch (aProcess) {
   case GeckoProcessType_Content:
@@ -542,17 +542,17 @@ XRE_InitParentProcess(int aArgc,
   NS_ENSURE_ARG_MIN(aArgc, 1);
   NS_ENSURE_ARG_POINTER(aArgv);
   NS_ENSURE_ARG_POINTER(aArgv[0]);
 
   ScopedXREEmbed embed;
 
   gArgc = aArgc;
   gArgv = aArgv;
-  int rv = XRE_InitCommandLine(gArgc, gArgv);
+  nsresult rv = XRE_InitCommandLine(gArgc, gArgv);
   if (NS_FAILED(rv))
       return NS_ERROR_FAILURE;
 
   {
     embed.Start();
 
     nsCOMPtr<nsIAppShell> appShell(do_GetService(kAppShellCID));
     NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);