diff options
author | thakis <thakis@chromium.org> | 2015-08-12 14:50:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-12 21:51:28 +0000 |
commit | 24b0507394153b44923e8bd82d18859c97dc690d (patch) | |
tree | 3296b8eda3d9c933022763b10cc19f6ff3412787 | |
parent | 0f43d2c299172e6fd24230edafe1b7c90f6c8f1a (diff) | |
download | chromium_src-24b0507394153b44923e8bd82d18859c97dc690d.zip chromium_src-24b0507394153b44923e8bd82d18859c97dc690d.tar.gz chromium_src-24b0507394153b44923e8bd82d18859c97dc690d.tar.bz2 |
Remove STATIC_CONST_MEMBER_DEFINITION.
There's a single client of it, and that client becomes shorter by not using
this. Also see discussion on https://codereview.chromium.org/60103005/
and thread "[chromium-dev] Style question: static const members vs enums"
BUG=none
Review URL: https://codereview.chromium.org/1291623002
Cr-Commit-Position: refs/heads/master@{#343102}
-rw-r--r-- | base/compiler_specific.h | 22 | ||||
-rw-r--r-- | content/browser/storage_partition_impl.cc | 30 | ||||
-rw-r--r-- | content/public/browser/storage_partition.h | 38 |
3 files changed, 20 insertions, 70 deletions
diff --git a/base/compiler_specific.h b/base/compiler_specific.h index a81afb5..02603df 100644 --- a/base/compiler_specific.h +++ b/base/compiler_specific.h @@ -68,28 +68,6 @@ #endif // COMPILER_MSVC -// The C++ standard requires that static const members have an out-of-class -// definition (in a single compilation unit), but MSVC chokes on this (when -// language extensions, which are required, are enabled). (You're only likely to -// notice the need for a definition if you take the address of the member or, -// more commonly, pass it to a function that takes it as a reference argument -- -// probably an STL function.) This macro makes MSVC do the right thing. See -// http://msdn.microsoft.com/en-us/library/34h23df8(v=vs.100).aspx for more -// information. Use like: -// -// In .h file: -// struct Foo { -// static const int kBar = 5; -// }; -// -// In .cc file: -// STATIC_CONST_MEMBER_DEFINITION const int Foo::kBar; -#if defined(COMPILER_MSVC) -#define STATIC_CONST_MEMBER_DEFINITION __declspec(selectany) -#else -#define STATIC_CONST_MEMBER_DEFINITION -#endif - // Annotate a variable indicating it's ok if the variable is not used. // (Typically used to silence a compiler warning when the assignment // is important for some other reason.) diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index 41ea89e..8fba715 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc @@ -200,36 +200,6 @@ void ClearSessionStorageOnUIThread( } // namespace -// static -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_APPCACHE; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_COOKIES; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_FILE_SYSTEMS; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_INDEXEDDB; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_SERVICE_WORKERS; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_SHADER_CACHE; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_WEBSQL; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_WEBRTC_IDENTITY; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::REMOVE_DATA_MASK_ALL; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::QUOTA_MANAGED_STORAGE_MASK_TEMPORARY; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::QUOTA_MANAGED_STORAGE_MASK_PERSISTENT; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::QUOTA_MANAGED_STORAGE_MASK_SYNCABLE; -STATIC_CONST_MEMBER_DEFINITION const uint32 - StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL; - // Static. int StoragePartitionImpl::GenerateQuotaClientMask(uint32 remove_mask) { int quota_client_mask = 0; diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h index dd5a789..9adfd67 100644 --- a/content/public/browser/storage_partition.h +++ b/content/public/browser/storage_partition.h @@ -77,24 +77,26 @@ class CONTENT_EXPORT StoragePartition { virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0; virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0; - static const uint32 REMOVE_DATA_MASK_APPCACHE = 1 << 0; - static const uint32 REMOVE_DATA_MASK_COOKIES = 1 << 1; - static const uint32 REMOVE_DATA_MASK_FILE_SYSTEMS = 1 << 2; - static const uint32 REMOVE_DATA_MASK_INDEXEDDB = 1 << 3; - static const uint32 REMOVE_DATA_MASK_LOCAL_STORAGE = 1 << 4; - static const uint32 REMOVE_DATA_MASK_SHADER_CACHE = 1 << 5; - static const uint32 REMOVE_DATA_MASK_WEBSQL = 1 << 6; - static const uint32 REMOVE_DATA_MASK_WEBRTC_IDENTITY = 1 << 7; - static const uint32 REMOVE_DATA_MASK_SERVICE_WORKERS = 1 << 8; - static const uint32 REMOVE_DATA_MASK_ALL = 0xFFFFFFFF; - - // Corresponds to storage::kStorageTypeTemporary. - static const uint32 QUOTA_MANAGED_STORAGE_MASK_TEMPORARY = 1 << 0; - // Corresponds to storage::kStorageTypePersistent. - static const uint32 QUOTA_MANAGED_STORAGE_MASK_PERSISTENT = 1 << 1; - // Corresponds to storage::kStorageTypeSyncable. - static const uint32 QUOTA_MANAGED_STORAGE_MASK_SYNCABLE = 1 << 2; - static const uint32 QUOTA_MANAGED_STORAGE_MASK_ALL = 0xFFFFFFFF; + enum : uint32 { + REMOVE_DATA_MASK_APPCACHE = 1 << 0, + REMOVE_DATA_MASK_COOKIES = 1 << 1, + REMOVE_DATA_MASK_FILE_SYSTEMS = 1 << 2, + REMOVE_DATA_MASK_INDEXEDDB = 1 << 3, + REMOVE_DATA_MASK_LOCAL_STORAGE = 1 << 4, + REMOVE_DATA_MASK_SHADER_CACHE = 1 << 5, + REMOVE_DATA_MASK_WEBSQL = 1 << 6, + REMOVE_DATA_MASK_WEBRTC_IDENTITY = 1 << 7, + REMOVE_DATA_MASK_SERVICE_WORKERS = 1 << 8, + REMOVE_DATA_MASK_ALL = 0xFFFFFFFF, + + // Corresponds to storage::kStorageTypeTemporary. + QUOTA_MANAGED_STORAGE_MASK_TEMPORARY = 1 << 0, + // Corresponds to storage::kStorageTypePersistent. + QUOTA_MANAGED_STORAGE_MASK_PERSISTENT = 1 << 1, + // Corresponds to storage::kStorageTypeSyncable. + QUOTA_MANAGED_STORAGE_MASK_SYNCABLE = 1 << 2, + QUOTA_MANAGED_STORAGE_MASK_ALL = 0xFFFFFFFF, + }; // Starts an asynchronous task that does a best-effort clear the data // corresponding to the given |remove_mask| and |quota_storage_remove_mask| |