Bug 1521017 - Using NS_NAMED_LITERNAL_CSTRING to avoid increasing the number of static constructors; r=asuth

This patch uses nsLiteralCString instead of nsCString for avoiding increasing
the number of static constructors. Also, it removes the declaration of
kInternalError and kExternalError on Beta and Release since they won't be use
in these channels.

Differential Revision: https://phabricator.services.mozilla.com/D16981

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Tung 2019-01-18 22:52:06 +00:00
Родитель 12149d8542
Коммит 698bbba539
3 изменённых файлов: 22 добавлений и 4 удалений

16
dom/quota/QuotaCommon.cpp Normal file
Просмотреть файл

@ -0,0 +1,16 @@
/* -*- 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/. */
#include "QuotaCommon.h"
BEGIN_QUOTA_NAMESPACE
#ifdef NIGHTLY_BUILD
NS_NAMED_LITERAL_CSTRING(kInternalError, "internal");
NS_NAMED_LITERAL_CSTRING(kExternalError, "external");
#endif
END_QUOTA_NAMESPACE

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

@ -73,11 +73,12 @@ BEGIN_QUOTA_NAMESPACE
// Telemetry keys to indicate types of errors.
#ifdef NIGHTLY_BUILD
const nsCString kInternalError = NS_LITERAL_CSTRING("internal");
const nsCString kExternalError = NS_LITERAL_CSTRING("external");
extern const nsLiteralCString kInternalError;
extern const nsLiteralCString kExternalError;
#else
const nsCString kInternalError = EmptyCString();
const nsCString kExternalError = EmptyCString();
// No need for these when we're not collecting telemetry.
# define kInternalError
# define kExternalError
#endif
class BackgroundThreadObject {

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

@ -54,6 +54,7 @@ UNIFIED_SOURCES += [
'ActorsParent.cpp',
'FileStreams.cpp',
'MemoryOutputStream.cpp',
'QuotaCommon.cpp',
'QuotaManagerService.cpp',
'QuotaRequests.cpp',
'QuotaResults.cpp',