diff options
author | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-03 23:26:22 +0000 |
---|---|---|
committer | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-03 23:26:22 +0000 |
commit | f9b0ea5e6108f356011d2b38a64960ecc36c2259 (patch) | |
tree | 44f8d14ca0d9cd528ce411ebaae608746cebf015 | |
parent | 50388640382f805efb3d8411e50d7d08526d169d (diff) | |
download | chromium_src-f9b0ea5e6108f356011d2b38a64960ecc36c2259.zip chromium_src-f9b0ea5e6108f356011d2b38a64960ecc36c2259.tar.gz chromium_src-f9b0ea5e6108f356011d2b38a64960ecc36c2259.tar.bz2 |
Clean up unused constant globals
Found by clang's new -Wunused-const-variable.
BUG=290204
TBR=mark, acolwell, agl, alexeypa, markus, brettw
Review URL: https://codereview.chromium.org/25849004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226888 0039d316-1c4b-4281-b951-d872f2087c98
30 files changed, 16 insertions, 63 deletions
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc index eb5ee08..731fb39 100644 --- a/base/debug/stack_trace_posix.cc +++ b/base/debug/stack_trace_posix.cc @@ -43,6 +43,7 @@ namespace { volatile sig_atomic_t in_signal_handler = 0; +#if !defined(USE_SYMBOLIZE) && defined(__GLIBCXX__) // The prefix used for mangled symbols, per the Itanium C++ ABI: // http://www.codesourcery.com/cxx-abi/abi.html#mangling const char kMangledSymbolPrefix[] = "_Z"; @@ -51,6 +52,7 @@ const char kMangledSymbolPrefix[] = "_Z"; // (('a'..'z').to_a+('A'..'Z').to_a+('0'..'9').to_a + ['_']).join const char kSymbolCharacters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"; +#endif // !defined(USE_SYMBOLIZE) && defined(__GLIBCXX__) #if !defined(USE_SYMBOLIZE) // Demangles C++ symbols in the given text. Example: diff --git a/base/time/time_posix.cc b/base/time/time_posix.cc index 39958f7..141da8f 100644 --- a/base/time/time_posix.cc +++ b/base/time/time_posix.cc @@ -124,8 +124,6 @@ struct timespec TimeDelta::ToTimeSpec() const { // irb(main):011:0> Time.at(-11644473600).getutc() // => Mon Jan 01 00:00:00 UTC 1601 static const int64 kWindowsEpochDeltaSeconds = GG_INT64_C(11644473600); -static const int64 kWindowsEpochDeltaMilliseconds = - kWindowsEpochDeltaSeconds * Time::kMillisecondsPerSecond; // static const int64 Time::kWindowsEpochDeltaMicroseconds = diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index c3bf7c0..849c3ec 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -516,7 +516,9 @@ void DumpProcess() { g_breakpad->WriteMinidump(); } +#if defined(OS_ANDROID) const char kGoogleBreakpad[] = "google-breakpad"; +#endif size_t WriteLog(const char* buf, size_t nbytes) { #if defined(OS_ANDROID) diff --git a/chrome/browser/apps/app_launcher_util.cc b/chrome/browser/apps/app_launcher_util.cc index 8d1be30..ffe444153 100644 --- a/chrome/browser/apps/app_launcher_util.cc +++ b/chrome/browser/apps/app_launcher_util.cc @@ -13,6 +13,7 @@ namespace { +#if defined(ENABLE_APP_LIST) // The field trial group name that enables showing the promo. const char kShowLauncherPromoOnceGroupName[] = "ShowPromoUntilDismissed"; @@ -22,6 +23,7 @@ const char kResetShowLauncherPromoPrefGroupName[] = "ResetShowPromoPref"; // The name of the field trial that controls showing the app launcher promo. const char kLauncherPromoTrialName[] = "ShowAppLauncherPromo"; +#endif // defined(ENABLE_APP_LIST) } // namespace diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc index 8a8e215..aa3fc4b 100644 --- a/chrome/browser/extensions/updater/extension_updater.cc +++ b/chrome/browser/extensions/updater/extension_updater.cc @@ -52,7 +52,9 @@ namespace { const int kStartupWaitSeconds = 60 * 5; // For sanity checking on update frequency - enforced in release mode only. +#ifdef NDEBUG const int kMinUpdateFrequencySeconds = 30; +#endif const int kMaxUpdateFrequencySeconds = 60 * 60 * 24 * 7; // 7 days // Require at least 5 seconds between consecutive non-succesful extension update diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc index 4cfbc41..a5d841d 100644 --- a/chrome/browser/jankometer.cc +++ b/chrome/browser/jankometer.cc @@ -48,8 +48,10 @@ const int kMaxIOMessageDelayMs = 400; // considering it delayed. const int kMaxMessageProcessingMs = 100; +#if defined(OS_WIN) // TODO(brettw) Consider making this a pref. const bool kPlaySounds = false; +#endif //------------------------------------------------------------------------------ // Provide a special watchdog to make it easy to set the breakpoint on this diff --git a/chrome/browser/performance_monitor/performance_monitor.cc b/chrome/browser/performance_monitor/performance_monitor.cc index 55e5df1..12d7a7c 100644 --- a/chrome/browser/performance_monitor/performance_monitor.cc +++ b/chrome/browser/performance_monitor/performance_monitor.cc @@ -50,11 +50,6 @@ namespace performance_monitor { namespace { -const uint32 kAccessFlags = base::kProcessAccessDuplicateHandle | - base::kProcessAccessQueryInformation | - base::kProcessAccessTerminate | - base::kProcessAccessWaitForTermination; - std::string TimeToString(base::Time time) { int64 time_int64 = time.ToInternalValue(); return base::Int64ToString(time_int64); diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc index 4140b6d..34f300a 100644 --- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc @@ -64,10 +64,6 @@ const int kButtonPadding = 4; // and chevron if they are both showing). const int kButtonChevronPadding = 2; -// The padding to the left, top and bottom of the browser actions toolbar -// separator. -const int kSeparatorPadding = 2; - // Width of the invisible gripper for resizing the toolbar. const int kResizeGripperWidth = 4; diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc index 42ce7c87..32e9aeb 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.cc +++ b/chrome/browser/ui/gtk/browser_titlebar.cc @@ -78,11 +78,6 @@ const int kAvatarBottomSpacing = 1; // it on the left, and between it and the tabstrip on the right). const int kAvatarSideSpacing = 2; -// The thickness of the custom frame border; we need it here to enlarge the -// close button whent the custom frame border isn't showing but the custom -// titlebar is showing. -const int kFrameBorderThickness = 4; - // There is a 4px gap between the icon and the title text. const int kIconTitleSpacing = 4; diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc index 92f14b0..c3035cf 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc @@ -47,9 +47,6 @@ const int kIconPreviewSizePixels = 32; // Minimum width (in pixels) of the shortcut description label. const int kDescriptionLabelMinimumWidthPixels = 200; -// Height (in lines) of the shortcut description label. -const int kDescriptionLabelHeightLines = 3; - } // namespace namespace chrome { diff --git a/chrome/browser/ui/gtk/download/download_started_animation_gtk.cc b/chrome/browser/ui/gtk/download/download_started_animation_gtk.cc index a43e41b..9cb44a0 100644 --- a/chrome/browser/ui/gtk/download/download_started_animation_gtk.cc +++ b/chrome/browser/ui/gtk/download/download_started_animation_gtk.cc @@ -32,11 +32,6 @@ const int kMoveTimeMs = 600; // The animation framerate. const int kFrameRateHz = 60; -// What fraction of the frame height to move downward from the frame center. -// Note that setting this greater than 0.5 will mean moving past the bottom of -// the frame. -const double kMoveFraction = 1.0 / 3.0; - class DownloadStartedAnimationGtk : public gfx::LinearAnimation, public content::NotificationObserver { public: diff --git a/chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc index d2f4411..9cd5f93 100644 --- a/chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/extensions/extension_uninstall_dialog_gtk.cc @@ -22,9 +22,6 @@ namespace { -// Left or right margin. -const int kPanelHorizMargin = 13; - // GTK implementation of the uninstall dialog. class ExtensionUninstallDialogGtk : public ExtensionUninstallDialog { public: diff --git a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc index 8415dae..c0e855c 100644 --- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc @@ -23,7 +23,6 @@ namespace { const GdkColor kBackgroundColor = GDK_COLOR_RGB(0xff, 0xff, 0xff); const GdkColor kFrameColor = GDK_COLOR_RGB(0x63, 0x63, 0x63); -const int kMiddlePaddingPx = 30; } // namespace diff --git a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc index ab2417b..a2bd308 100644 --- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc +++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc @@ -33,9 +33,6 @@ const int kElementPadding = 5; const int kLeftPadding = 5; const int kRightPadding = 5; -// Spacing between buttons. -const int kButtonButtonSpacing = 3; - } // namespace diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc index 660c5d9..3e09ab9 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc @@ -154,11 +154,6 @@ const GdkColor kContentSettingBorderColor = GDK_COLOR_RGB(0xe9, 0xb9, 0x66); const GdkColor kContentSettingTopColor = GDK_COLOR_RGB(0xff, 0xf8, 0xd4); const GdkColor kContentSettingBottomColor = GDK_COLOR_RGB(0xff, 0xe6, 0xaf); -// Styling for gray button. -const GdkColor kGrayBorderColor = GDK_COLOR_RGB(0xa0, 0xa0, 0xa0); -const GdkColor kTopColorGray = GDK_COLOR_RGB(0xe5, 0xe5, 0xe5); -const GdkColor kBottomColorGray = GDK_COLOR_RGB(0xd0, 0xd0, 0xd0); - inline int InnerPadding() { return extensions::FeatureSwitch::script_badges()->IsEnabled() ? kScriptBadgeInnerPadding : kInnerPadding; diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc index 4cd8297..c642ea5 100644 --- a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc +++ b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc @@ -54,10 +54,6 @@ const int kBottomMargin = 1; const int kLeftMargin = 1; const int kRightMargin = 1; -// How many pixels of overlap there is between the shelf top and the -// balloon bottom. -const int kShelfBorderTopOverlap = 0; - // Properties of the origin label. const int kLeftLabelMargin = 8; diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc index 4d268f3..2908f93 100644 --- a/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc +++ b/chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk_unittest.cc @@ -19,8 +19,6 @@ namespace { -const float kLargeWidth = 10000; - const GdkColor kContentTextColor = GDK_COLOR_RGB(0x00, 0x00, 0x00); const GdkColor kDimContentTextColor = GDK_COLOR_RGB(0x80, 0x80, 0x80); const GdkColor kURLTextColor = GDK_COLOR_RGB(0x00, 0x88, 0x00); diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc index ed447e2..4835970 100644 --- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc @@ -52,7 +52,6 @@ const int kLeftPadding = 16; const int kTopPadding = 6; const int kRightPadding = 15; const int kBottomPadding = 5; -const int kDropShadowHeight = 2; const int kFaviconTitleSpacing = 4; const int kTitleCloseButtonSpacing = 5; const int kStandardTitleWidth = 175; diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc index 7fbdf14..561e387 100644 --- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc @@ -58,7 +58,6 @@ namespace { const int kDefaultAnimationDurationMs = 100; const int kResizeLayoutAnimationDurationMs = 166; const int kReorderAnimationDurationMs = 166; -const int kAnimateToBoundsDurationMs = 150; const int kMiniTabAnimationDurationMs = 150; const int kNewTabButtonHOffset = -5; @@ -76,8 +75,6 @@ const int kLayoutAfterSizeAllocateMs = 10; // start/stop the resize animation. const int kTabStripAnimationVSlop = 40; -const int kHorizontalMoveThreshold = 16; // pixels - // The horizontal offset from one tab to the next, which results in overlapping // tabs. const int kTabHOffset = -16; diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc index 8077127..78d04ff 100644 --- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc +++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc @@ -20,8 +20,6 @@ namespace local_discovery { namespace { const char kSampleServiceName[] = "myService._privet._tcp.local"; -const char kSampleDeviceID[] = "MyFakeID"; -const char kSampleDeviceHost[] = "myservice.local"; class TestMessageLoopCondition { public: diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc index dbabb00..5c586f4 100644 --- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc +++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc @@ -49,7 +49,6 @@ static const char kNameId[] = "name"; static const char kReadOnlyId[] = "readonly"; static const char kUntrustedId[] = "untrusted"; static const char kExtractableId[] = "extractable"; -static const char kSecurityDeviceId[] = "device"; static const char kErrorId[] = "error"; static const char kPolicyTrustedId[] = "policy"; diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index 647aee8..3ecf2e9 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -122,8 +122,10 @@ const uint32 kRemotingViewerPluginPermissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV; #endif // defined(ENABLE_REMOTING) +#if defined(OS_MACOSX) && !defined(OS_IOS) const char kInterposeLibraryPath[] = "@executable_path/../../../libplugin_carbon_interpose.dylib"; +#endif // defined(OS_MACOSX) && !defined(OS_IOS) // Appends the known built-in plugins to the given vector. Some built-in // plugins are "internal" which means they are compiled into the Chrome binary, diff --git a/chrome/renderer/printing/print_web_view_helper_browsertest.cc b/chrome/renderer/printing/print_web_view_helper_browsertest.cc index fc2d214..93fc332 100644 --- a/chrome/renderer/printing/print_web_view_helper_browsertest.cc +++ b/chrome/renderer/printing/print_web_view_helper_browsertest.cc @@ -347,6 +347,7 @@ struct TestPageData { const wchar_t* file; }; +#if defined(OS_WIN) || defined(OS_MACOSX) const TestPageData kTestPages[] = { {"<html>" "<head>" @@ -369,6 +370,7 @@ const TestPageData kTestPages[] = { NULL, }, }; +#endif // defined(OS_WIN) || defined(OS_MACOSX) } // namespace // TODO(estade): need to port MockPrinter to get this on Linux. This involves diff --git a/media/tools/player_x11/gl_video_renderer.cc b/media/tools/player_x11/gl_video_renderer.cc index 9e50808..8d7c94f 100644 --- a/media/tools/player_x11/gl_video_renderer.cc +++ b/media/tools/player_x11/gl_video_renderer.cc @@ -67,14 +67,6 @@ static const float kVertices[8] = { 1.f, -1.f, }; -// Texture Coordinates mapping the entire texture. -static const float kTextureCoords[8] = { - 0, 0, - 0, 1, - 1, 0, - 1, 1, -}; - // Pass-through vertex shader. static const char kVertexShader[] = "varying vec2 interp_tc;\n" diff --git a/net/base/address_tracker_linux_unittest.cc b/net/base/address_tracker_linux_unittest.cc index a9feed4..4708380 100644 --- a/net/base/address_tracker_linux_unittest.cc +++ b/net/base/address_tracker_linux_unittest.cc @@ -136,8 +136,6 @@ const unsigned char kAddress1[] = { 10, 0, 0, 1 }; const unsigned char kAddress2[] = { 192, 168, 0, 1 }; const unsigned char kAddress3[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; -const unsigned char kAddress4[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, - 169, 254, 0, 1 }; TEST_F(AddressTrackerLinuxTest, NewAddress) { const IPAddressNumber kEmpty; diff --git a/net/tools/quic/quic_server.cc b/net/tools/quic/quic_server.cc index 9eae4ab..a5c1e5b 100644 --- a/net/tools/quic/quic_server.cc +++ b/net/tools/quic/quic_server.cc @@ -28,7 +28,6 @@ #endif const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET; -const int kNumPacketsPerReadCall = 5; // Arbitrary static const char kSourceAddressTokenSecret[] = "secret"; namespace net { diff --git a/net/websockets/websocket_basic_stream_test.cc b/net/websockets/websocket_basic_stream_test.cc index 37a49f6..117c00c 100644 --- a/net/websockets/websocket_basic_stream_test.cc +++ b/net/websockets/websocket_basic_stream_test.cc @@ -30,7 +30,6 @@ const char kPartialLargeFrame[] = "chromiunum ad pasco per loca insanis pullum manducat frumenti"; const size_t kPartialLargeFrameSize = arraysize(kPartialLargeFrame) - 1; const size_t kLargeFrameHeaderSize = 10; -const size_t kLargeFrameDeclaredPayloadSize = 0x7FFFFFFF; const char kMultipleFrames[] = "\x81\x01X\x81\x01Y\x81\x01Z"; const size_t kMultipleFramesSize = arraysize(kMultipleFrames) - 1; // This frame encodes a payload length of 7 in two bytes, which is always diff --git a/remoting/host/server_log_entry.cc b/remoting/host/server_log_entry.cc index 8ef8e49..58e24b5 100644 --- a/remoting/host/server_log_entry.cc +++ b/remoting/host/server_log_entry.cc @@ -44,7 +44,9 @@ const char kExitCodeName[] = "exit-code"; const char kKeyOsName[] = "os-name"; +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) const char kKeyOsVersion[] = "os-version"; +#endif const char kKeyHostVersion[] = "host-version"; diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc index ea138df..1e3ce66 100644 --- a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc +++ b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc @@ -1110,7 +1110,6 @@ class EqualityStressTest { // Don't increase these values. We are pushing the limits of the maximum // BPF program that the kernel will allow us to load. If the values are // increased too much, the test will start failing. - static const int kNumIterations = 3; static const int kNumTestCases = 40; static const int kMaxFanOut = 3; static const int kMaxArgs = 6; diff --git a/tools/gn/command_gyp.cc b/tools/gn/command_gyp.cc index 73e33e5..bc5ab5d 100644 --- a/tools/gn/command_gyp.cc +++ b/tools/gn/command_gyp.cc @@ -38,7 +38,6 @@ const char kSwitchNoGyp[] = "no-gyp"; // Where to have GYP write its outputs. const char kDirOut[] = "out.gn"; -const char kSourceDirOut[] = "//out.gn/"; // We'll do the GN build to here. const char kBuildSourceDir[] = "//out.gn/Debug/"; |