Move stringize_macros to base/strings.
This removes the unused L-string macros in the file.
BUG=
Review URL: https://codereview.chromium.org/12090083
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179926 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/base.gyp b/base/base.gyp
index bd8a0c8..cdac9450 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -531,8 +531,8 @@
'string_split_unittest.cc',
'string_tokenizer_unittest.cc',
'string_util_unittest.cc',
- 'stringize_macros_unittest.cc',
'stringprintf_unittest.cc',
+ 'strings/stringize_macros_unittest.cc',
'synchronization/cancellation_flag_unittest.cc',
'synchronization/condition_variable_unittest.cc',
'synchronization/lock_unittest.cc',
diff --git a/base/base.gypi b/base/base.gypi
index 0a7dfdeb..6689ceb 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -397,9 +397,9 @@
'string_util_win.h',
'string16.cc',
'string16.h',
- 'stringize_macros.h',
'stringprintf.cc',
'stringprintf.h',
+ 'strings/stringize_macros.h',
'supports_user_data.cc',
'supports_user_data.h',
'synchronization/cancellation_flag.cc',
diff --git a/base/stringize_macros.h b/base/stringize_macros.h
deleted file mode 100644
index 1d53e48..0000000
--- a/base/stringize_macros.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2010 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.
-//
-// This file defines preprocessor macros for stringizing preprocessor
-// symbols (or their output) and manipulating preprocessor symbols
-// that define strings.
-
-#ifndef BASE_STRINGIZE_MACROS_H_
-#define BASE_STRINGIZE_MACROS_H_
-
-#include "build/build_config.h"
-
-// This is not very useful as it does not expand defined symbols if
-// called directly. Use its counterpart without the _NO_EXPANSION
-// suffix, below.
-#define STRINGIZE_NO_EXPANSION(x) #x
-
-// Use this to quote the provided parameter, first expanding it if it
-// is a preprocessor symbol.
-//
-// For example, if:
-// #define A FOO
-// #define B(x) myobj->FunctionCall(x)
-//
-// Then:
-// STRINGIZE(A) produces "FOO"
-// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)"
-#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x)
-
-// The following are defined only on Windows (for use when interacting
-// with Windows APIs) as wide strings are otherwise deprecated.
-#if defined(OS_WIN)
-
-// Second-level utility macros to let us expand symbols.
-#define LSTRINGIZE_NO_EXPANSION(x) L ## #x
-#define TO_L_STRING_NO_EXPANSION(x) L ## x
-
-// L version of STRINGIZE(). For examples above,
-// LSTRINGIZE(A) produces L"FOO"
-// LSTRINGIZE(B(y)) produces L"myobj->FunctionCall(y)"
-#define LSTRINGIZE(x) LSTRINGIZE_NO_EXPANSION(x)
-
-// Adds an L in front of an existing ASCII string constant (after
-// expanding symbols). Does not do any quoting.
-//
-// For example, if:
-// #define C "foo"
-//
-// Then:
-// TO_L_STRING(C) produces L"foo"
-#define TO_L_STRING(x) TO_L_STRING_NO_EXPANSION(x)
-
-#endif // defined(OS_WIN)
-
-#endif // BASE_STRINGIZE_MACROS_H_
diff --git a/base/stringize_macros_unittest.cc b/base/stringize_macros_unittest.cc
deleted file mode 100644
index 8d92d538..0000000
--- a/base/stringize_macros_unittest.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) 2010 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.
-//
-// Unit tests for stringize_macros.h
-
-#include "base/stringize_macros.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-// Macros as per documentation in header file.
-#define PREPROCESSOR_UTIL_UNITTEST_A FOO
-#define PREPROCESSOR_UTIL_UNITTEST_B(x) myobj->FunctionCall(x)
-#define PREPROCESSOR_UTIL_UNITTEST_C "foo"
-
-TEST(StringizeTest, Ansi) {
- EXPECT_STREQ(
- "PREPROCESSOR_UTIL_UNITTEST_A",
- STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_A));
- EXPECT_STREQ(
- "PREPROCESSOR_UTIL_UNITTEST_B(y)",
- STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_B(y)));
- EXPECT_STREQ(
- "PREPROCESSOR_UTIL_UNITTEST_C",
- STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_C));
-
- EXPECT_STREQ("FOO", STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_A));
- EXPECT_STREQ("myobj->FunctionCall(y)",
- STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_B(y)));
- EXPECT_STREQ("\"foo\"", STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_C));
-}
-
-#if defined(OS_WIN)
-
-TEST(StringizeTest, Wide) {
- EXPECT_STREQ(
- L"PREPROCESSOR_UTIL_UNITTEST_A",
- LSTRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_A));
- EXPECT_STREQ(
- L"PREPROCESSOR_UTIL_UNITTEST_B(y)",
- LSTRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_B(y)));
- EXPECT_STREQ(
- L"PREPROCESSOR_UTIL_UNITTEST_C",
- LSTRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_C));
-
- EXPECT_STREQ(L"FOO", LSTRINGIZE(PREPROCESSOR_UTIL_UNITTEST_A));
- EXPECT_STREQ(L"myobj->FunctionCall(y)",
- LSTRINGIZE(PREPROCESSOR_UTIL_UNITTEST_B(y)));
- EXPECT_STREQ(L"\"foo\"", LSTRINGIZE(PREPROCESSOR_UTIL_UNITTEST_C));
-}
-
-TEST(ToLStringTest, Main) {
- EXPECT_STREQ(L"blat", TO_L_STRING_NO_EXPANSION("blat"));
-
- EXPECT_STREQ(L"foo", TO_L_STRING(PREPROCESSOR_UTIL_UNITTEST_C));
- EXPECT_STREQ(L"blat", TO_L_STRING("blat"));
-}
-
-#endif // defined(OS_WIN)
diff --git a/base/strings/stringize_macros.h b/base/strings/stringize_macros.h
new file mode 100644
index 0000000..d4e2707
--- /dev/null
+++ b/base/strings/stringize_macros.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 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.
+//
+// This file defines preprocessor macros for stringizing preprocessor
+// symbols (or their output) and manipulating preprocessor symbols
+// that define strings.
+
+#ifndef BASE_STRINGS_STRINGIZE_MACROS_H_
+#define BASE_STRINGS_STRINGIZE_MACROS_H_
+
+#include "build/build_config.h"
+
+// This is not very useful as it does not expand defined symbols if
+// called directly. Use its counterpart without the _NO_EXPANSION
+// suffix, below.
+#define STRINGIZE_NO_EXPANSION(x) #x
+
+// Use this to quote the provided parameter, first expanding it if it
+// is a preprocessor symbol.
+//
+// For example, if:
+// #define A FOO
+// #define B(x) myobj->FunctionCall(x)
+//
+// Then:
+// STRINGIZE(A) produces "FOO"
+// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)"
+#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x)
+
+#endif // BASE_STRINGS_STRINGIZE_MACROS_H_
diff --git a/base/strings/stringize_macros_unittest.cc b/base/strings/stringize_macros_unittest.cc
new file mode 100644
index 0000000..d7f9e560a
--- /dev/null
+++ b/base/strings/stringize_macros_unittest.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2010 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/strings/stringize_macros.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+// Macros as per documentation in header file.
+#define PREPROCESSOR_UTIL_UNITTEST_A FOO
+#define PREPROCESSOR_UTIL_UNITTEST_B(x) myobj->FunctionCall(x)
+#define PREPROCESSOR_UTIL_UNITTEST_C "foo"
+
+TEST(StringizeTest, Ansi) {
+ EXPECT_STREQ(
+ "PREPROCESSOR_UTIL_UNITTEST_A",
+ STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_A));
+ EXPECT_STREQ(
+ "PREPROCESSOR_UTIL_UNITTEST_B(y)",
+ STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_B(y)));
+ EXPECT_STREQ(
+ "PREPROCESSOR_UTIL_UNITTEST_C",
+ STRINGIZE_NO_EXPANSION(PREPROCESSOR_UTIL_UNITTEST_C));
+
+ EXPECT_STREQ("FOO", STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_A));
+ EXPECT_STREQ("myobj->FunctionCall(y)",
+ STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_B(y)));
+ EXPECT_STREQ("\"foo\"", STRINGIZE(PREPROCESSOR_UTIL_UNITTEST_C));
+}
diff --git a/content/common/gpu/media/rendering_helper_gl.cc b/content/common/gpu/media/rendering_helper_gl.cc
index b4cf57d6..80c2d52 100644
--- a/content/common/gpu/media/rendering_helper_gl.cc
+++ b/content/common/gpu/media/rendering_helper_gl.cc
@@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/message_loop.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#include "base/synchronization/waitable_event.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index fa65981097f..756a904 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -33,7 +33,7 @@
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "base/string_split.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc
index 97ef31a..cd13b9e 100644
--- a/google_apis/google_api_keys.cc
+++ b/google_apis/google_api_keys.cc
@@ -11,7 +11,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS)
#include "google_apis/internal/google_chrome_api_keys.h"
diff --git a/google_apis/google_api_keys_unittest.cc b/google_apis/google_api_keys_unittest.cc
index 0ed52d6..8d1c036 100644
--- a/google_apis/google_api_keys_unittest.cc
+++ b/google_apis/google_api_keys_unittest.cc
@@ -35,7 +35,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
// This is the default baked-in value for OAuth IDs and secrets.
static const char kDummyToken[] = "dummytoken";
diff --git a/media/base/media_posix.cc b/media/base/media_posix.cc
index a6bebaa..724e1130 100644
--- a/media/base/media_posix.cc
+++ b/media/base/media_posix.cc
@@ -9,7 +9,7 @@
#include "base/file_path.h"
#include "base/logging.h"
#include "base/path_service.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#include "media/ffmpeg/ffmpeg_common.h"
#if !defined(USE_SYSTEM_FFMPEG)
diff --git a/media/base/sinc_resampler_unittest.cc b/media/base/sinc_resampler_unittest.cc
index 59a9f81..0f718f2 100644
--- a/media/base/sinc_resampler_unittest.cc
+++ b/media/base/sinc_resampler_unittest.cc
@@ -12,7 +12,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#include "base/time.h"
#include "build/build_config.h"
#include "media/base/sinc_resampler.h"
diff --git a/net/base/net_errors.cc b/net/base/net_errors.cc
index 78c6e27..01fda390 100644
--- a/net/base/net_errors.cc
+++ b/net/base/net_errors.cc
@@ -6,7 +6,7 @@
#include "base/basictypes.h"
#include "base/metrics/histogram.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
namespace {
diff --git a/remoting/host/plugin/host_plugin.cc b/remoting/host/plugin/host_plugin.cc
index a55c309..a9b233a6 100644
--- a/remoting/host/plugin/host_plugin.cc
+++ b/remoting/host/plugin/host_plugin.cc
@@ -11,7 +11,7 @@
#include "base/at_exit.h"
#include "base/basictypes.h"
#include "base/logging.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#include "net/socket/ssl_server_socket.h"
#include "remoting/base/plugin_thread_task_runner.h"
#include "remoting/host/plugin/constants.h"
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 45d550cb..0e3d9487 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -18,7 +18,7 @@
#include "base/single_thread_task_runner.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
diff --git a/remoting/host/server_log_entry.cc b/remoting/host/server_log_entry.cc
index d1cc6eb..cf6f861 100644
--- a/remoting/host/server_log_entry.cc
+++ b/remoting/host/server_log_entry.cc
@@ -5,7 +5,7 @@
#include "remoting/host/server_log_entry.h"
#include "base/logging.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#include "base/sys_info.h"
#include "remoting/base/constants.h"
#include "remoting/protocol/session.h"
diff --git a/remoting/host/server_log_entry_unittest.cc b/remoting/host/server_log_entry_unittest.cc
index 25f7adb..e2e7853 100644
--- a/remoting/host/server_log_entry_unittest.cc
+++ b/remoting/host/server_log_entry_unittest.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/memory/scoped_ptr.h"
-#include "base/stringize_macros.h"
+#include "base/strings/stringize_macros.h"
#include "remoting/host/server_log_entry.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"