diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 08:37:28 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 08:37:28 +0000 |
commit | df3a97915da711b6767349cfc6d047d44e4f76fa (patch) | |
tree | acaf184bde8d3383eb869b2060d219eec48a492e | |
parent | adf4ebac0d526f8f918a0fbc94f325f08ffb54ac (diff) | |
download | chromium_src-df3a97915da711b6767349cfc6d047d44e4f76fa.zip chromium_src-df3a97915da711b6767349cfc6d047d44e4f76fa.tar.gz chromium_src-df3a97915da711b6767349cfc6d047d44e4f76fa.tar.bz2 |
Pull string constants into separate .cc for split dll build
Requires https://codereview.chromium.org/15310002/ before landing.
TBR=brettw@chromium.org
R=cpu@chromium.org
BUG=237249
Review URL: https://chromiumcodereview.appspot.com/15300017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201264 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/base.gypi | 1 | ||||
-rw-r--r-- | base/string_util.cc | 48 | ||||
-rw-r--r-- | base/string_util_constants.cc | 55 | ||||
-rw-r--r-- | build/split_link_partition.py | 1 | ||||
-rw-r--r-- | tools/win/split_link/split_link.py | 10 |
5 files changed, 61 insertions, 54 deletions
diff --git a/base/base.gypi b/base/base.gypi index d88824a..5914da4 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -404,6 +404,7 @@ 'stl_util.h', 'string_util.cc', 'string_util.h', + 'string_util_constants.cc', 'string_util_posix.h', 'string_util_win.h', 'string16.cc', diff --git a/base/string_util.cc b/base/string_util.cc index 91a1c4c..4e96ba8 100644 --- a/base/string_util.cc +++ b/base/string_util.cc @@ -116,54 +116,6 @@ const string16& EmptyString16() { return EmptyStrings::GetInstance()->s16; } -#define WHITESPACE_UNICODE \ - 0x0009, /* <control-0009> to <control-000D> */ \ - 0x000A, \ - 0x000B, \ - 0x000C, \ - 0x000D, \ - 0x0020, /* Space */ \ - 0x0085, /* <control-0085> */ \ - 0x00A0, /* No-Break Space */ \ - 0x1680, /* Ogham Space Mark */ \ - 0x180E, /* Mongolian Vowel Separator */ \ - 0x2000, /* En Quad to Hair Space */ \ - 0x2001, \ - 0x2002, \ - 0x2003, \ - 0x2004, \ - 0x2005, \ - 0x2006, \ - 0x2007, \ - 0x2008, \ - 0x2009, \ - 0x200A, \ - 0x200C, /* Zero Width Non-Joiner */ \ - 0x2028, /* Line Separator */ \ - 0x2029, /* Paragraph Separator */ \ - 0x202F, /* Narrow No-Break Space */ \ - 0x205F, /* Medium Mathematical Space */ \ - 0x3000, /* Ideographic Space */ \ - 0 - -const wchar_t kWhitespaceWide[] = { - WHITESPACE_UNICODE -}; -const char16 kWhitespaceUTF16[] = { - WHITESPACE_UNICODE -}; -const char kWhitespaceASCII[] = { - 0x09, // <control-0009> to <control-000D> - 0x0A, - 0x0B, - 0x0C, - 0x0D, - 0x20, // Space - 0 -}; - -const char kUtf8ByteOrderMark[] = "\xEF\xBB\xBF"; - template<typename STR> bool ReplaceCharsT(const STR& input, const typename STR::value_type replace_chars[], diff --git a/base/string_util_constants.cc b/base/string_util_constants.cc new file mode 100644 index 0000000..225bd92 --- /dev/null +++ b/base/string_util_constants.cc @@ -0,0 +1,55 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/string_util.h" + +#define WHITESPACE_UNICODE \ + 0x0009, /* <control-0009> to <control-000D> */ \ + 0x000A, \ + 0x000B, \ + 0x000C, \ + 0x000D, \ + 0x0020, /* Space */ \ + 0x0085, /* <control-0085> */ \ + 0x00A0, /* No-Break Space */ \ + 0x1680, /* Ogham Space Mark */ \ + 0x180E, /* Mongolian Vowel Separator */ \ + 0x2000, /* En Quad to Hair Space */ \ + 0x2001, \ + 0x2002, \ + 0x2003, \ + 0x2004, \ + 0x2005, \ + 0x2006, \ + 0x2007, \ + 0x2008, \ + 0x2009, \ + 0x200A, \ + 0x200C, /* Zero Width Non-Joiner */ \ + 0x2028, /* Line Separator */ \ + 0x2029, /* Paragraph Separator */ \ + 0x202F, /* Narrow No-Break Space */ \ + 0x205F, /* Medium Mathematical Space */ \ + 0x3000, /* Ideographic Space */ \ + 0 + +const wchar_t kWhitespaceWide[] = { + WHITESPACE_UNICODE +}; + +const char16 kWhitespaceUTF16[] = { + WHITESPACE_UNICODE +}; + +const char kWhitespaceASCII[] = { + 0x09, // <control-0009> to <control-000D> + 0x0A, + 0x0B, + 0x0C, + 0x0D, + 0x20, // Space + 0 +}; + +const char kUtf8ByteOrderMark[] = "\xEF\xBB\xBF"; diff --git a/build/split_link_partition.py b/build/split_link_partition.py index d8b1730..2c63daa 100644 --- a/build/split_link_partition.py +++ b/build/split_link_partition.py @@ -125,6 +125,7 @@ # .lib files. 'all_from_libs': [ (r'autofill_common\.lib$', r'switches\.obj$'), + (r'\bbase\.lib$', r'string_util_constants\.obj$'), (r'base_static\.lib$', r'base_switches\.obj$'), (r'\bcc\.lib$', r'switches\.obj$'), (r'\bcommon\.lib$', r'extension_constants\.obj$'), diff --git a/tools/win/split_link/split_link.py b/tools/win/split_link/split_link.py index 72b6c47..ee70c0e 100644 --- a/tools/win/split_link/split_link.py +++ b/tools/win/split_link/split_link.py @@ -378,12 +378,10 @@ def main(): deffiles = GenerateDefFiles(unresolved_by_part) import_libs = BuildImportLibs(flags, inputs_by_part, deffiles) else: - return 1 - - if data_exports: - print 'Data exports found, see report above.' - print('These cannot be exported, and must be either duplicated to the ' - 'target DLL, or wrapped in a function.') + if data_exports: + print '%d data exports found, see report above.' % data_exports + print('These cannot be exported, and must be either duplicated to the ' + 'target DLL (if constant), or wrapped in a function.') return 1 mt_exe = GetMtPath() |