Commit cdced8a6 authored by thestig's avatar thestig Committed by Commit bot

Extensions: Split the constants from the extensions_common target into its own...

Extensions: Split the constants from the extensions_common target into its own extensions_common_constants target.

The extensions constants are used in too many places and very hard to
get rid of. Making it into its own target so it can be included in all
builds, even when extensions are not enabled.

BUG=424746

Review URL: https://codereview.chromium.org/652623003

Cr-Commit-Position: refs/heads/master@{#300335}
parent fd1ee51e
...@@ -11,6 +11,20 @@ mojom("mojo") { ...@@ -11,6 +11,20 @@ mojom("mojo") {
] ]
} }
# GYP version: extensions/extensions.gyp:extensions_common_constants
source_set("common_constants") {
sources = [
"constants.cc",
"constants.h",
]
if (is_win) {
cflags = [
"/wd4267", # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
]
}
}
# GYP version: extensions/extensions.gyp:extensions_common # GYP version: extensions/extensions.gyp:extensions_common
source_set("common") { source_set("common") {
sources = [ sources = [
...@@ -29,8 +43,6 @@ source_set("common") { ...@@ -29,8 +43,6 @@ source_set("common") {
"api/sockets/sockets_manifest_permission.h", "api/sockets/sockets_manifest_permission.h",
"common_manifest_handlers.cc", "common_manifest_handlers.cc",
"common_manifest_handlers.h", "common_manifest_handlers.h",
"constants.cc",
"constants.h",
"csp_validator.cc", "csp_validator.cc",
"csp_validator.h", "csp_validator.h",
"dom_action_types.h", "dom_action_types.h",
...@@ -201,6 +213,7 @@ source_set("common") { ...@@ -201,6 +213,7 @@ source_set("common") {
] ]
deps = [ deps = [
":common_constants",
":mojo", ":mojo",
# TODO(benwells): figure out what to do with the api target and # TODO(benwells): figure out what to do with the api target and
# api resources compiled into the chrome resource bundle. # api resources compiled into the chrome resource bundle.
......
...@@ -21,6 +21,22 @@ ...@@ -21,6 +21,22 @@
'common/stash.mojom', 'common/stash.mojom',
], ],
}, },
{
# GN version: //extensions/common
'target_name': 'extensions_common_constants',
'type': 'static_library',
'include_dirs': [
'..',
'<(INTERMEDIATE_DIR)',
],
'sources': [
# Note: sources list duplicated in GN build.
'common/constants.cc',
'common/constants.h',
],
# Disable c4267 warnings until we fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ],
},
{ {
# GN version: //extensions/common # GN version: //extensions/common
'target_name': 'extensions_common', 'target_name': 'extensions_common',
...@@ -40,6 +56,7 @@ ...@@ -40,6 +56,7 @@
'../third_party/libxml/libxml.gyp:libxml', '../third_party/libxml/libxml.gyp:libxml',
'extensions_resources.gyp:extensions_resources', 'extensions_resources.gyp:extensions_resources',
'extensions_strings.gyp:extensions_strings', 'extensions_strings.gyp:extensions_strings',
'extensions_common_constants',
'extensions_common_mojo', 'extensions_common_mojo',
], ],
'include_dirs': [ 'include_dirs': [
...@@ -63,8 +80,6 @@ ...@@ -63,8 +80,6 @@
'common/api/sockets/sockets_manifest_permission.h', 'common/api/sockets/sockets_manifest_permission.h',
'common/common_manifest_handlers.cc', 'common/common_manifest_handlers.cc',
'common/common_manifest_handlers.h', 'common/common_manifest_handlers.h',
'common/constants.cc',
'common/constants.h',
'common/csp_validator.cc', 'common/csp_validator.cc',
'common/csp_validator.h', 'common/csp_validator.h',
'common/dom_action_types.h', 'common/dom_action_types.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment