2008-07-11 12:47:33 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2009-04-13 09:29:41 -07:00
|
|
|
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-07-11 12:47:33 -07:00
|
|
|
|
|
|
|
#include "mozStorageError.h"
|
|
|
|
|
2009-05-08 17:29:55 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace storage {
|
|
|
|
|
2008-07-11 12:47:33 -07:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2009-05-08 17:29:55 -07:00
|
|
|
//// Error
|
|
|
|
|
|
|
|
Error::Error(int aResult,
|
|
|
|
const char *aMessage)
|
|
|
|
: mResult(aResult)
|
|
|
|
, mMessage(aMessage)
|
|
|
|
{
|
|
|
|
}
|
2008-07-11 12:47:33 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2014-04-27 00:06:00 -07:00
|
|
|
NS_IMPL_ISUPPORTS(
|
2009-05-08 17:29:55 -07:00
|
|
|
Error,
|
|
|
|
mozIStorageError
|
|
|
|
)
|
2008-07-11 12:47:33 -07:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//// mozIStorageError
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-08-22 08:56:38 -07:00
|
|
|
Error::GetResult(int32_t *_result)
|
2008-07-11 12:47:33 -07:00
|
|
|
{
|
|
|
|
*_result = mResult;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2009-05-08 17:29:55 -07:00
|
|
|
Error::GetMessage(nsACString &_message)
|
2008-07-11 12:47:33 -07:00
|
|
|
{
|
|
|
|
_message = mMessage;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2009-05-08 17:29:55 -07:00
|
|
|
|
|
|
|
} // namespace storage
|
|
|
|
} // namespace mozilla
|