2018-08-20 15:33:17 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_simpledb_SimpledbCommon_h
|
|
|
|
#define mozilla_dom_simpledb_SimpledbCommon_h
|
|
|
|
|
2020-07-24 14:47:48 +03:00
|
|
|
#include "mozilla/dom/quota/QuotaCommon.h"
|
2020-10-21 16:18:15 +03:00
|
|
|
#include "nsLiteralString.h"
|
2020-07-24 14:47:48 +03:00
|
|
|
|
2020-10-14 13:01:20 +03:00
|
|
|
// SimpleDB equivalents of QM_TRY.
|
2020-09-07 21:00:00 +03:00
|
|
|
#define SDB_TRY_GLUE(...) \
|
|
|
|
QM_TRY_META(mozilla::dom::simpledb, MOZ_UNIQUE_VAR(tryResult), ##__VA_ARGS__)
|
|
|
|
#define SDB_TRY(...) SDB_TRY_GLUE(__VA_ARGS__)
|
2020-07-24 14:47:48 +03:00
|
|
|
|
2020-10-14 13:01:20 +03:00
|
|
|
// SimpleDB equivalents of QM_TRY_UNWRAP and QM_TRY_INSPECT.
|
2020-10-14 15:14:14 +03:00
|
|
|
#define SDB_TRY_ASSIGN_GLUE(accessFunction, ...) \
|
|
|
|
QM_TRY_ASSIGN_META(mozilla::dom::simpledb, MOZ_UNIQUE_VAR(tryResult), \
|
|
|
|
accessFunction, ##__VA_ARGS__)
|
|
|
|
#define SDB_TRY_UNWRAP(...) SDB_TRY_ASSIGN_GLUE(unwrap, __VA_ARGS__)
|
|
|
|
#define SDB_TRY_INSPECT(...) SDB_TRY_ASSIGN_GLUE(inspect, __VA_ARGS__)
|
2020-07-24 14:47:48 +03:00
|
|
|
|
2020-10-14 13:01:20 +03:00
|
|
|
// SimpleDB equivalents of QM_TRY_RETURN.
|
2020-09-17 17:01:01 +03:00
|
|
|
#define SDB_TRY_RETURN_GLUE(...) \
|
|
|
|
QM_TRY_RETURN_META(mozilla::dom::simpledb, MOZ_UNIQUE_VAR(tryResult), \
|
|
|
|
##__VA_ARGS__)
|
|
|
|
#define SDB_TRY_RETURN(...) SDB_TRY_RETURN_GLUE(__VA_ARGS__)
|
|
|
|
|
2020-10-14 13:01:20 +03:00
|
|
|
// SimpleDB equivalents of QM_FAIL.
|
2020-09-07 21:00:00 +03:00
|
|
|
#define SDB_FAIL_GLUE(...) QM_FAIL_META(mozilla::dom::simpledb, ##__VA_ARGS__)
|
|
|
|
#define SDB_FAIL(...) SDB_FAIL_GLUE(__VA_ARGS__)
|
2020-08-27 14:10:10 +03:00
|
|
|
|
2018-08-20 15:33:17 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
extern const char* kPrefSimpleDBEnabled;
|
|
|
|
|
2020-07-24 14:47:48 +03:00
|
|
|
namespace simpledb {
|
|
|
|
|
2020-09-14 15:14:17 +03:00
|
|
|
QM_META_HANDLE_ERROR("SimpleDB"_ns)
|
2020-07-24 14:47:48 +03:00
|
|
|
|
|
|
|
} // namespace simpledb
|
|
|
|
|
2018-08-20 15:33:17 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_simpledb_SimpledbCommon_h
|