Simplify sanity checks in extensions headers
Use static_assert() instead of #error to simplify some sanity checks. Then the conditionals for those checks can be of the positive form. Change-Id: Ibdae70de3ff4dad79a3dd972ee57d42fff984c90 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5960212 Reviewed-by: Emilia Paz <emiliapaz@chromium.org> Auto-Submit: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1374437}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
e205fc3f4d
commit
080ab7a9bf
chrome
browser
common
extensions
@ -53,9 +53,7 @@
|
||||
#include "extensions/common/extension_set.h"
|
||||
#include "extensions/common/manifest.h"
|
||||
|
||||
#if !BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#error "Extensions must be enabled"
|
||||
#endif
|
||||
static_assert(BUILDFLAG(ENABLE_EXTENSIONS));
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
#include "chrome/browser/extensions/ash_extension_keeplist_manager.h"
|
||||
|
@ -19,14 +19,12 @@
|
||||
#include "ui/base/ui_base_types.h"
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
|
||||
#if !BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#error "Extensions must be enabled"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
#include "base/files/safe_base_name.h"
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
static_assert(BUILDFLAG(ENABLE_EXTENSIONS));
|
||||
|
||||
class Browser;
|
||||
class SettingsOverriddenDialogController;
|
||||
class Profile;
|
||||
|
@ -7,9 +7,7 @@
|
||||
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
|
||||
#if !BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
#error "Extensions must be enabled"
|
||||
#endif
|
||||
static_assert(BUILDFLAG(ENABLE_EXTENSIONS_CORE));
|
||||
|
||||
// Initializes the single instance of the ExtensionsClient. Safe to call
|
||||
// multiple times.
|
||||
|
@ -18,10 +18,8 @@
|
||||
#include "extensions/common/extension_id.h"
|
||||
#include "extensions/common/extension_set.h"
|
||||
|
||||
#if !BUILDFLAG(ENABLE_EXTENSIONS) && \
|
||||
!BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)
|
||||
#error "Extensions must be enabled"
|
||||
#endif
|
||||
static_assert(BUILDFLAG(ENABLE_EXTENSIONS) ||
|
||||
BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS));
|
||||
|
||||
namespace content {
|
||||
class BrowserContext;
|
||||
|
@ -17,10 +17,8 @@
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/extension_id.h"
|
||||
|
||||
#if !BUILDFLAG(ENABLE_EXTENSIONS) && \
|
||||
!BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)
|
||||
#error "Extensions must be enabled"
|
||||
#endif
|
||||
static_assert(BUILDFLAG(ENABLE_EXTENSIONS) ||
|
||||
BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS));
|
||||
|
||||
namespace base {
|
||||
class OneShotEvent;
|
||||
|
@ -29,10 +29,8 @@
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
#if !BUILDFLAG(ENABLE_EXTENSIONS) && \
|
||||
!BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS)
|
||||
#error "Extensions must be enabled"
|
||||
#endif
|
||||
static_assert(BUILDFLAG(ENABLE_EXTENSIONS) ||
|
||||
BUILDFLAG(ENABLE_DESKTOP_ANDROID_EXTENSIONS));
|
||||
|
||||
namespace extensions {
|
||||
class HashedExtensionId;
|
||||
|
Reference in New Issue
Block a user