Bug 1713820 - Add dedicated QM_LOG_ERROR_ENABLED identifier for conditional LogError compilation; r=dom-storage-reviewers,jstutte

Differential Revision: https://phabricator.services.mozilla.com/D117132
This commit is contained in:
Jan Varga 2021-06-08 16:27:28 +00:00
Родитель 41fc1feef9
Коммит 74cdcac137
4 изменённых файлов: 22 добавлений и 6 удалений

14
dom/quota/Config.h Normal file
Просмотреть файл

@ -0,0 +1,14 @@
/* -*- 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 DOM_QUOTA_CONFIG_H_
#define DOM_QUOTA_CONFIG_H_
#if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)
# define QM_LOG_ERROR_ENABLED
#endif
#endif // DOM_QUOTA_CONFIG_H_

Просмотреть файл

@ -403,7 +403,7 @@ nsDependentCSubstring MakeSourceFileRelativePath(
} // namespace detail
#if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)
#ifdef QM_LOG_ERROR_ENABLED
# ifdef QM_ERROR_STACKS_ENABLED
void LogError(const nsACString& aExpr, const ResultType& aResult,
const nsACString& aSourceFilePath, const int32_t aSourceFileLine,

Просмотреть файл

@ -7,9 +7,11 @@
#ifndef mozilla_dom_quota_quotacommon_h__
#define mozilla_dom_quota_quotacommon_h__
#include "mozilla/dom/quota/Config.h"
// This must be included at the very beginning since it also contains
// QM_ERROR_STACKS_ENABLED definition which is used below.
// XXX Create a special file for this, like QuotaConfig.h
// XXX Move QM_ERROR_STACKS_ENABLED definition to Config.h
#include "mozilla/dom/QMResult.h"
#include <algorithm>
@ -28,8 +30,7 @@
#include "mozilla/Result.h"
#include "mozilla/ResultExtensions.h"
#include "mozilla/ThreadLocal.h"
#if (defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)) && \
defined(QM_ERROR_STACKS_ENABLED)
#if defined(QM_LOG_ERROR_ENABLED) && defined(QM_ERROR_STACKS_ENABLED)
# include "mozilla/Variant.h"
#endif
#include "mozilla/ipc/ProtocolUtils.h"
@ -1323,7 +1324,7 @@ enum class Severity {
Verbose,
};
#if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)
#ifdef QM_LOG_ERROR_ENABLED
# ifdef QM_ERROR_STACKS_ENABLED
using ResultType = Variant<QMResult, nsresult, Nothing>;
@ -1411,7 +1412,7 @@ struct MOZ_STACK_CLASS ScopedLogExtraInfo {
//
// This functions are not intended to be called
// directly, they should only be called from the QM_* macros.
#if defined(EARLY_BETA_OR_EARLIER) || defined(DEBUG)
#ifdef QM_LOG_ERROR_ENABLED
template <typename T>
MOZ_COLD void HandleError(const char* aExpr, const T& aRv,
const char* aSourceFilePath, int32_t aSourceFileLine,

Просмотреть файл

@ -32,6 +32,7 @@ EXPORTS.mozilla.dom.quota += [
"Client.h",
"ClientImpl.h",
"CommonMetadata.h",
"Config.h",
"DecryptingInputStream.h",
"DecryptingInputStream_impl.h",
"DirectoryLock.h",