Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: net/disk_cache/simple/simple_index.h

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply fixups Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.cc ('k') | net/disk_cache/simple/simple_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
7 7
8 #include <list> 8 #include <list>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 private: 62 private:
63 friend class SimpleIndexFileTest; 63 friend class SimpleIndexFileTest;
64 64
65 // There are tens of thousands of instances of EntryMetadata in memory, so the 65 // There are tens of thousands of instances of EntryMetadata in memory, so the
66 // size of each entry matters. Even when the values used to set these members 66 // size of each entry matters. Even when the values used to set these members
67 // are originally calculated as >32-bit types, the actual necessary size for 67 // are originally calculated as >32-bit types, the actual necessary size for
68 // each shouldn't exceed 32 bits, so we use 32-bit types here. 68 // each shouldn't exceed 32 bits, so we use 32-bit types here.
69 uint32 last_used_time_seconds_since_epoch_; 69 uint32 last_used_time_seconds_since_epoch_;
70 int32 entry_size_; // Storage size in bytes. 70 int32 entry_size_; // Storage size in bytes.
71 }; 71 };
72 COMPILE_ASSERT(sizeof(EntryMetadata) == 8, metadata_size); 72 static_assert(sizeof(EntryMetadata) == 8, "incorrect metadata size");
73 73
74 // This class is not Thread-safe. 74 // This class is not Thread-safe.
75 class NET_EXPORT_PRIVATE SimpleIndex 75 class NET_EXPORT_PRIVATE SimpleIndex
76 : public base::SupportsWeakPtr<SimpleIndex> { 76 : public base::SupportsWeakPtr<SimpleIndex> {
77 public: 77 public:
78 typedef std::vector<uint64> HashList; 78 typedef std::vector<uint64> HashList;
79 79
80 SimpleIndex(const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, 80 SimpleIndex(const scoped_refptr<base::SingleThreadTaskRunner>& io_thread,
81 SimpleIndexDelegate* delegate, 81 SimpleIndexDelegate* delegate,
82 net::CacheType cache_type, 82 net::CacheType cache_type,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // Set to true when the app is on the background. When the app is in the 194 // Set to true when the app is on the background. When the app is in the
195 // background we can write the index much more frequently, to insure fresh 195 // background we can write the index much more frequently, to insure fresh
196 // index on next startup. 196 // index on next startup.
197 bool app_on_background_; 197 bool app_on_background_;
198 }; 198 };
199 199
200 } // namespace disk_cache 200 } // namespace disk_cache
201 201
202 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 202 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_entry_impl.cc ('k') | net/disk_cache/simple/simple_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698