storage/src/mozStorageError.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/storage/src/mozStorageError.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "mozStorageError.h"
    1.11 +
    1.12 +namespace mozilla {
    1.13 +namespace storage {
    1.14 +
    1.15 +////////////////////////////////////////////////////////////////////////////////
    1.16 +//// Error
    1.17 +
    1.18 +Error::Error(int aResult,
    1.19 +             const char *aMessage)
    1.20 +: mResult(aResult)
    1.21 +, mMessage(aMessage)
    1.22 +{
    1.23 +}
    1.24 +
    1.25 +/**
    1.26 + * Note:  This object is only ever accessed on one thread at a time.  It it not
    1.27 + *        threadsafe, but it does need threadsafe AddRef and Release.
    1.28 + */
    1.29 +NS_IMPL_ISUPPORTS(
    1.30 +  Error,
    1.31 +  mozIStorageError
    1.32 +)
    1.33 +
    1.34 +////////////////////////////////////////////////////////////////////////////////
    1.35 +//// mozIStorageError
    1.36 +
    1.37 +NS_IMETHODIMP
    1.38 +Error::GetResult(int32_t *_result)
    1.39 +{
    1.40 +  *_result = mResult;
    1.41 +  return NS_OK;
    1.42 +}
    1.43 +
    1.44 +NS_IMETHODIMP
    1.45 +Error::GetMessage(nsACString &_message)
    1.46 +{
    1.47 +  _message = mMessage;
    1.48 +  return NS_OK;
    1.49 +}
    1.50 +
    1.51 +} // namespace storage
    1.52 +} // namespace mozilla

mercurial