Skip to content

Commit

Permalink
Cleanup: Remove static storage for variables in an unnamed namespace.
Browse files Browse the repository at this point in the history
BUG=none
TEST=none
R=binji

Review URL: https://chromiumcodereview.appspot.com/9271061

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119535 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jhawkins@chromium.org committed Jan 28, 2012
1 parent 6f1485e commit da9ccfb
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 53 deletions.
2 changes: 1 addition & 1 deletion base/linux_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class LinuxDistroHelper {
#endif // if defined(OS_LINUX)

// expected prefix of the target of the /proc/self/fd/%d link for a socket
static const char kSocketLinkPrefix[] = "socket:[";
const char kSocketLinkPrefix[] = "socket:[";

// Parse a symlink in /proc/pid/fd/$x and return the inode number of the
// socket.
Expand Down
6 changes: 3 additions & 3 deletions base/nix/mime_util_xdg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@

namespace {

class IconTheme;

// None of the XDG stuff is thread-safe, so serialize all access under
// this lock.
static base::LazyInstance<base::Lock>::Leaky
base::LazyInstance<base::Lock>::Leaky
g_mime_util_xdg_lock = LAZY_INSTANCE_INITIALIZER;

class IconTheme;

class MimeUtilConstants {
public:
typedef std::map<std::string, IconTheme*> IconThemeMap;
Expand Down
10 changes: 5 additions & 5 deletions base/path_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct Provider {
bool is_static;
};

static Provider base_provider = {
Provider base_provider = {
base::PathProvider,
NULL,
#ifndef NDEBUG
Expand All @@ -57,7 +57,7 @@ static Provider base_provider = {
};

#if defined(OS_WIN)
static Provider base_provider_win = {
Provider base_provider_win = {
base::PathProviderWin,
&base_provider,
#ifndef NDEBUG
Expand All @@ -69,7 +69,7 @@ static Provider base_provider_win = {
#endif

#if defined(OS_MACOSX)
static Provider base_provider_mac = {
Provider base_provider_mac = {
base::PathProviderMac,
&base_provider,
#ifndef NDEBUG
Expand All @@ -81,7 +81,7 @@ static Provider base_provider_mac = {
#endif

#if defined(OS_ANDROID)
static Provider base_provider_android = {
Provider base_provider_android = {
base::PathProviderAndroid,
&base_provider,
#ifndef NDEBUG
Expand All @@ -93,7 +93,7 @@ static Provider base_provider_android = {
#endif

#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
static Provider base_provider_posix = {
Provider base_provider_posix = {
base::PathProviderPosix,
&base_provider,
#ifndef NDEBUG
Expand Down
8 changes: 5 additions & 3 deletions base/tracked_objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ using base::TimeDelta;
namespace tracked_objects {

namespace {

// Flag to compile out almost all of the task tracking code.
static const bool kTrackAllTaskObjects = true;
const bool kTrackAllTaskObjects = true;

// Flag to compile out parent-child link recording.
static const bool kTrackParentChildLinks = false;
const bool kTrackParentChildLinks = false;

// When ThreadData is first initialized, should we start in an ACTIVE state to
// record all of the startup-time tasks, or should we start up DEACTIVATED, so
// that we only record after parsing the command line flag --enable-tracking.
// Note that the flag may force either state, so this really controls only the
// period of time up until that flag is parsed. If there is no flag seen, then
// this state may prevail for much or all of the process lifetime.
static const ThreadData::Status kInitialStartupState =
const ThreadData::Status kInitialStartupState =
ThreadData::PROFILING_CHILDREN_ACTIVE;

} // namespace

//------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/sync/engine/syncer_proto_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ using sessions::SyncSession;
namespace {

// Time to backoff syncing after receiving a throttled response.
static const int kSyncDelayAfterThrottled = 2 * 60 * 60; // 2 hours
const int kSyncDelayAfterThrottled = 2 * 60 * 60; // 2 hours

void LogResponseProfilingData(const ClientToServerResponse& response) {
if (response.has_profiling_data()) {
stringstream response_trace;
Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/sync/syncable/syncable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@
#include "net/base/escape.h"

namespace {

enum InvariantCheckLevel {
OFF = 0,
VERIFY_IN_MEMORY = 1,
FULL_DB_VERIFICATION = 2
};

static const InvariantCheckLevel kInvariantCheckLevel = VERIFY_IN_MEMORY;
const InvariantCheckLevel kInvariantCheckLevel = VERIFY_IN_MEMORY;

// Max number of milliseconds to spend checking syncable entry invariants
static const int kInvariantCheckMaxMs = 50;
const int kInvariantCheckMaxMs = 50;

// This function checks to see if the given list of Metahandles has any nodes
// whose PREV_ID, PARENT_ID or NEXT_ID values refer to ID values that do not
Expand Down
13 changes: 7 additions & 6 deletions chrome/service/cloud_print/print_system_cups.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@
#include "ui/base/l10n/l10n_util.h"

namespace {

// CUPS specific options.
static const char kCUPSPrinterInfoOpt[] = "printer-info";
static const char kCUPSPrinterStateOpt[] = "printer-state";
const char kCUPSPrinterInfoOpt[] = "printer-info";
const char kCUPSPrinterStateOpt[] = "printer-state";

// Print system config options.
static const char kCUPSPrintServerURLs[] = "print_server_urls";
static const char kCUPSUpdateTimeoutMs[] = "update_timeout_ms";
static const char kCUPSNotifyDelete[] = "notify_delete";
const char kCUPSPrintServerURLs[] = "print_server_urls";
const char kCUPSUpdateTimeoutMs[] = "update_timeout_ms";
const char kCUPSNotifyDelete[] = "notify_delete";

// Default port for IPP print servers.
static const int kDefaultIPPServerPort = 631;
const int kDefaultIPPServerPort = 631;

// Time interval to check for printer's updates.
const int kCheckForPrinterUpdatesMs = 5*60*1000;
Expand Down
4 changes: 2 additions & 2 deletions content/renderer/gpu/renderer_gl_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class GLES2Initializer {

////////////////////////////////////////////////////////////////////////////////

static base::LazyInstance<GLES2Initializer> g_gles2_initializer =
base::LazyInstance<GLES2Initializer> g_gles2_initializer =
LAZY_INSTANCE_INITIALIZER;

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -74,7 +74,7 @@ RendererGLContext::ContextLostReason ConvertReason(
}
#endif

} // namespace anonymous
} // namespace

RendererGLContext::~RendererGLContext() {
Destroy();
Expand Down
6 changes: 3 additions & 3 deletions content/renderer/media/media_stream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

namespace {

static const int kVideoCaptureWidth = 352;
static const int kVideoCaptureHeight = 288;
static const int kVideoCaptureFramePerSecond = 30;
const int kVideoCaptureWidth = 352;
const int kVideoCaptureHeight = 288;
const int kVideoCaptureFramePerSecond = 30;

} // namespace

Expand Down
11 changes: 6 additions & 5 deletions content/renderer/render_thread_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@ using WebKit::WebView;
using content::RenderProcessObserver;

namespace {
static const int64 kInitialIdleHandlerDelayMs = 1000;
static const int64 kShortIdleHandlerDelayMs = 1000;
static const int64 kLongIdleHandlerDelayMs = 30*1000;
static const int kIdleCPUUsageThresholdInPercents = 3;

const int64 kInitialIdleHandlerDelayMs = 1000;
const int64 kShortIdleHandlerDelayMs = 1000;
const int64 kLongIdleHandlerDelayMs = 30*1000;
const int kIdleCPUUsageThresholdInPercents = 3;

// Keep the global RenderThreadImpl in a TLS slot so it is impossible to access
// incorrectly from the wrong thread.
static base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> >
base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> >
lazy_tls = LAZY_INSTANCE_INITIALIZER;

class RenderViewZoomer : public content::RenderViewVisitor {
Expand Down
2 changes: 0 additions & 2 deletions media/audio/linux/alsa_output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include "media/base/data_buffer.h"
#include "media/base/seekable_buffer.h"

namespace {
// Amount of time to wait if we've exhausted the data source. This is to avoid
// busy looping.
static const uint32 kNoDataSleepMilliseconds = 10;
Expand Down Expand Up @@ -143,7 +142,6 @@ static void Swizzle51Layout(Format* b, uint32 filled) {
b[5] = aac[5]; // LFE
}
}
} // end namespace

std::ostream& operator<<(std::ostream& os,
AlsaPcmOutputStream::InternalState state) {
Expand Down
2 changes: 1 addition & 1 deletion printing/backend/print_backend_cups.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class GcryptInitializer {
}
};

static base::LazyInstance<GcryptInitializer> g_gcrypt_initializer =
base::LazyInstance<GcryptInitializer> g_gcrypt_initializer =
LAZY_INSTANCE_INITIALIZER;

} // namespace
Expand Down
2 changes: 1 addition & 1 deletion printing/printed_document.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct PrintDebugDumpPath {
FilePath debug_dump_path;
};

static base::LazyInstance<PrintDebugDumpPath> g_debug_dump_info =
base::LazyInstance<PrintDebugDumpPath> g_debug_dump_info =
LAZY_INSTANCE_INITIALIZER;

} // namespace
Expand Down
10 changes: 6 additions & 4 deletions printing/printing_context_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
#include "printing/units.h"

namespace {
// Function pointer for creating print dialogs. |callback| is only used when
// |show_dialog| is true.
static printing::PrintDialogGtkInterface* (*create_dialog_func_)(
printing::PrintingContextGtk* context) = NULL;

// Function pointer for creating print dialogs. |callback| is only used when
// |show_dialog| is true.
printing::PrintDialogGtkInterface* (*create_dialog_func_)(
printing::PrintingContextGtk* context) = NULL;

} // namespace

namespace printing {
Expand Down
4 changes: 2 additions & 2 deletions remoting/client/chromoting_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
namespace {

// The default window of bandwidth and frame rate in seconds.
static const int kTimeWindow = 3;
const int kTimeWindow = 3;

// We take the last 10 latency numbers and report the average.
static const int kLatencyWindow = 10;
const int kLatencyWindow = 10;

} // namespace

Expand Down
4 changes: 2 additions & 2 deletions remoting/protocol/jingle_messages.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ T NameToValue(const NameMapElement<T> map[], size_t map_size,
return default_value;
}

static const NameMapElement<JingleMessage::ActionType> kActionTypes[] = {
const NameMapElement<JingleMessage::ActionType> kActionTypes[] = {
{ JingleMessage::SESSION_INITIATE, "session-initiate" },
{ JingleMessage::SESSION_ACCEPT, "session-accept" },
{ JingleMessage::SESSION_TERMINATE, "session-terminate" },
{ JingleMessage::SESSION_INFO, "session-info" },
{ JingleMessage::TRANSPORT_INFO, "transport-info" },
};

static const NameMapElement<JingleMessage::Reason> kReasons[] = {
const NameMapElement<JingleMessage::Reason> kReasons[] = {
{ JingleMessage::SUCCESS, "success" },
{ JingleMessage::DECLINE, "decline" },
{ JingleMessage::GENERAL_ERROR, "general-error" },
Expand Down
2 changes: 1 addition & 1 deletion webkit/plugins/npapi/plugin_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace {

static const char kApplicationOctetStream[] = "application/octet-stream";
const char kApplicationOctetStream[] = "application/octet-stream";

base::LazyInstance<webkit::npapi::PluginList> g_singleton =
LAZY_INSTANCE_INITIALIZER;
Expand Down
11 changes: 6 additions & 5 deletions webkit/plugins/npapi/webplugin_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ namespace npapi {

namespace {

static const char kFlashMimeType[] = "application/x-shockwave-flash";
static const char kOctetStreamMimeType[] = "application/octet-stream";
static const char kHTMLMimeType[] = "text/html";
static const char kPlainTextMimeType[] = "text/plain";
static const char kPluginFlashMimeType[] = "Plugin.FlashMIMEType";
const char kFlashMimeType[] = "application/x-shockwave-flash";
const char kOctetStreamMimeType[] = "application/octet-stream";
const char kHTMLMimeType[] = "text/html";
const char kPlainTextMimeType[] = "text/plain";
const char kPluginFlashMimeType[] = "Plugin.FlashMIMEType";

enum {
MIME_TYPE_OK = 0,
MIME_TYPE_EMPTY,
Expand Down
8 changes: 4 additions & 4 deletions webkit/plugins/ppapi/ppapi_plugin_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ const ui::TextInputType kPluginDefaultTextInputType = ui::TEXT_INPUT_TYPE_TEXT;
mismatching_enums)

// <embed>/<object> attributes.
static const char kWidth[] = "width";
static const char kHeight[] = "height";
static const char kBorder[] = "border"; // According to w3c, deprecated.
static const char kStyle[] = "style";
const char kWidth[] = "width";
const char kHeight[] = "height";
const char kBorder[] = "border"; // According to w3c, deprecated.
const char kStyle[] = "style";

COMPILE_ASSERT_MATCHING_ENUM(TypePointer, PP_CURSORTYPE_POINTER);
COMPILE_ASSERT_MATCHING_ENUM(TypeCross, PP_CURSORTYPE_CROSS);
Expand Down

0 comments on commit da9ccfb

Please sign in to comment.