michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozStorageError.h" michael@0: michael@0: namespace mozilla { michael@0: namespace storage { michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: //// Error michael@0: michael@0: Error::Error(int aResult, michael@0: const char *aMessage) michael@0: : mResult(aResult) michael@0: , mMessage(aMessage) michael@0: { michael@0: } michael@0: michael@0: /** michael@0: * Note: This object is only ever accessed on one thread at a time. It it not michael@0: * threadsafe, but it does need threadsafe AddRef and Release. michael@0: */ michael@0: NS_IMPL_ISUPPORTS( michael@0: Error, michael@0: mozIStorageError michael@0: ) michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: //// mozIStorageError michael@0: michael@0: NS_IMETHODIMP michael@0: Error::GetResult(int32_t *_result) michael@0: { michael@0: *_result = mResult; michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: Error::GetMessage(nsACString &_message) michael@0: { michael@0: _message = mMessage; michael@0: return NS_OK; michael@0: } michael@0: michael@0: } // namespace storage michael@0: } // namespace mozilla