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

Side by Side Diff: trunk/src/chrome/browser/safe_browsing/safe_browsing_store_file.cc

Issue 227743006: Revert 262147 "Remove all uses of GG_LONGLONG and GG_ULONGLONG." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_store_file.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/scoped_file.h" 8 #include "base/files/scoped_file.h"
9 #include "base/md5.h" 9 #include "base/md5.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 27 matching lines...) Expand all
38 // values are preferred to minimize looping overhead during processing. 38 // values are preferred to minimize looping overhead during processing.
39 const int64 kUpdateStorageBytes = 100 * 1024; 39 const int64 kUpdateStorageBytes = 100 * 1024;
40 40
41 // Prevent excessive sharding by setting a lower limit on the shard stride. 41 // Prevent excessive sharding by setting a lower limit on the shard stride.
42 // Smaller values should work fine, but very small values will probably lead to 42 // Smaller values should work fine, but very small values will probably lead to
43 // poor performance. Shard stride is indirectly related to 43 // poor performance. Shard stride is indirectly related to
44 // |kUpdateStorageBytes|, setting that very small will bump against this. 44 // |kUpdateStorageBytes|, setting that very small will bump against this.
45 const uint32 kMinShardStride = 1 << 24; 45 const uint32 kMinShardStride = 1 << 24;
46 46
47 // Strides over the entire SBPrefix space. 47 // Strides over the entire SBPrefix space.
48 const uint64 kMaxShardStride = 1ULL << 32; 48 const uint64 kMaxShardStride = GG_LONGLONG(1u) << 32;
49 49
50 // Maximum SBPrefix value. 50 // Maximum SBPrefix value.
51 const SBPrefix kMaxSBPrefix = ~0; 51 const SBPrefix kMaxSBPrefix = ~0;
52 52
53 // Header at the front of the main database file. 53 // Header at the front of the main database file.
54 struct FileHeaderV8 { 54 struct FileHeaderV8 {
55 int32 magic, version; 55 int32 magic, version;
56 uint32 add_chunk_count, sub_chunk_count; 56 uint32 add_chunk_count, sub_chunk_count;
57 uint32 shard_stride; 57 uint32 shard_stride;
58 // TODO(shess): Is this where 64-bit will bite me? Perhaps write a 58 // TODO(shess): Is this where 64-bit will bite me? Perhaps write a
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 // With SQLite support gone, one way to get to this code is if the 1209 // With SQLite support gone, one way to get to this code is if the
1210 // existing file is a SQLite file. Make sure the journal file is 1210 // existing file is a SQLite file. Make sure the journal file is
1211 // also removed. 1211 // also removed.
1212 const base::FilePath journal_filename( 1212 const base::FilePath journal_filename(
1213 basename.value() + FILE_PATH_LITERAL("-journal")); 1213 basename.value() + FILE_PATH_LITERAL("-journal"));
1214 if (base::PathExists(journal_filename)) 1214 if (base::PathExists(journal_filename))
1215 base::DeleteFile(journal_filename, false); 1215 base::DeleteFile(journal_filename, false);
1216 1216
1217 return true; 1217 return true;
1218 } 1218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698