Bug 489603 - Update mozStorageError.* to follow style guidelines
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Fri, 08 May 2009 20:29:55 -0400
changeset 28139 c1cb148be7bb2a1df30d902457737cf38d02aca7
parent 28138 930e980cae1c0abf772d3778331fd0a9566446d7
child 28140 4d9fc3354fbc77470bc4db3ac65c8bf3a2a6f0aa
push idunknown
push userunknown
push dateunknown
bugs489603
milestone1.9.2a1pre
Bug 489603 - Update mozStorageError.* to follow style guidelines Consistent spacing, consistent naming, and namespaces - OH MY! r=asuth
storage/src/mozStorageAsyncStatementExecution.cpp
storage/src/mozStorageError.cpp
storage/src/mozStorageError.h
--- a/storage/src/mozStorageAsyncStatementExecution.cpp
+++ b/storage/src/mozStorageAsyncStatementExecution.cpp
@@ -420,18 +420,17 @@ AsyncExecuteStatements::notifyComplete()
 
 nsresult
 AsyncExecuteStatements::notifyError(PRInt32 aErrorCode,
                                     const char *aMessage)
 {
   if (!mCallback)
     return NS_OK;
 
-  nsCOMPtr<mozIStorageError> errorObj =
-    new mozStorageError(aErrorCode, aMessage);
+  nsCOMPtr<mozIStorageError> errorObj(new Error(aErrorCode, aMessage));
   NS_ENSURE_TRUE(errorObj, NS_ERROR_OUT_OF_MEMORY);
 
   nsRefPtr<ErrorNotifier> notifier =
     new ErrorNotifier(mCallback, errorObj, this);
   NS_ENSURE_TRUE(notifier, NS_ERROR_OUT_OF_MEMORY);
 
   return mCallingThread->Dispatch(notifier, NS_DISPATCH_NORMAL);
 }
--- a/storage/src/mozStorageError.cpp
+++ b/storage/src/mozStorageError.cpp
@@ -34,39 +34,49 @@
  * 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 "mozStorageError.h"
 
+namespace mozilla {
+namespace storage {
+
 ////////////////////////////////////////////////////////////////////////////////
-//// mozStorageError
+//// Error
+
+Error::Error(int aResult,
+             const char *aMessage)
+: mResult(aResult)
+, mMessage(aMessage)
+{
+}
 
 /**
  * Note:  This object is only ever accessed on one thread at a time.  It it not
  *        threadsafe, but it does need threadsafe AddRef and Release.
  */
-NS_IMPL_THREADSAFE_ISUPPORTS1(mozStorageError, mozIStorageError)
-
-mozStorageError::mozStorageError(int aResult, const char *aMessage) :
-    mResult(aResult)
-  , mMessage(aMessage)
-{
-}
+NS_IMPL_THREADSAFE_ISUPPORTS1(
+  Error,
+  mozIStorageError
+)
 
 ////////////////////////////////////////////////////////////////////////////////
 //// mozIStorageError
 
 NS_IMETHODIMP
-mozStorageError::GetResult(PRInt32 *_result)
+Error::GetResult(PRInt32 *_result)
 {
   *_result = mResult;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-mozStorageError::GetMessage(nsACString &_message)
+Error::GetMessage(nsACString &_message)
 {
   _message = mMessage;
   return NS_OK;
 }
+
+} // namespace storage
+} // namespace mozilla
--- a/storage/src/mozStorageError.h
+++ b/storage/src/mozStorageError.h
@@ -38,22 +38,28 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef __mozStorageError_h__
 #define __mozStorageError_h__
 
 #include "mozIStorageError.h"
 #include "nsString.h"
 
-class mozStorageError : public mozIStorageError
+namespace mozilla {
+namespace storage {
+
+class Error : public mozIStorageError
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGEERROR
 
-  mozStorageError(int aResult, const char *aMessage);
+  Error(int aResult, const char *aMessage);
 
 private:
   int mResult;
   nsCString mMessage;
 };
 
+} // namespace stoarge
+} // namespace mozilla
+
 #endif // __mozStorageError_h__