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

Side by Side Diff: components/safe_browsing_db/prefix_set.h

Issue 1399843003: Move prefix_set and parts of s_b_util into a new component safe_browsing_db. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use group instead of a static_library for targets that have no sources. Created 5 years, 1 month 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 | « components/safe_browsing_db/README ('k') | components/safe_browsing_db/prefix_set.cc » ('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) 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 // A read-only set implementation for |SBPrefix| items. Prefixes are 5 // A read-only set implementation for |SBPrefix| items. Prefixes are
6 // sorted and stored as 16-bit deltas from the previous prefix. An 6 // sorted and stored as 16-bit deltas from the previous prefix. An
7 // index structure provides quick random access, and also handles 7 // index structure provides quick random access, and also handles
8 // cases where 16 bits cannot encode a delta. 8 // cases where 16 bits cannot encode a delta.
9 // 9 //
10 // For example, the sequence {20, 25, 41, 65432, 150000, 160000} would 10 // For example, the sequence {20, 25, 41, 65432, 150000, 160000} would
(...skipping 28 matching lines...) Expand all
39 // 39 //
40 // The on-disk format looks like: 40 // The on-disk format looks like:
41 // 4 byte magic number 41 // 4 byte magic number
42 // 4 byte version number 42 // 4 byte version number
43 // 4 byte |index_.size()| 43 // 4 byte |index_.size()|
44 // 4 byte |deltas_.size()| 44 // 4 byte |deltas_.size()|
45 // n * 8 byte |&index_[0]..&index_[n]| 45 // n * 8 byte |&index_[0]..&index_[n]|
46 // m * 2 byte |&deltas_[0]..&deltas_[m]| 46 // m * 2 byte |&deltas_[0]..&deltas_[m]|
47 // 16 byte digest 47 // 16 byte digest
48 48
49 #ifndef CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ 49 #ifndef COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_
50 #define CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ 50 #define COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_
51 51
52 #include <utility> 52 #include <utility>
53 #include <vector> 53 #include <vector>
54 54
55 #include "base/gtest_prod_util.h" 55 #include "base/gtest_prod_util.h"
56 #include "base/macros.h"
56 #include "base/memory/scoped_ptr.h" 57 #include "base/memory/scoped_ptr.h"
57 #include "chrome/browser/safe_browsing/safe_browsing_util.h" 58 #include "components/safe_browsing_db/safe_browsing_db_util.h"
58 59
59 namespace base { 60 namespace base {
60 class FilePath; 61 class FilePath;
61 } 62 }
62 63
63 namespace safe_browsing { 64 namespace safe_browsing {
64 65
65 class PrefixSet { 66 class PrefixSet {
66 public: 67 public:
67 ~PrefixSet(); 68 ~PrefixSet();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 177
177 // Buffers prefixes until enough are avaliable to emit a run. 178 // Buffers prefixes until enough are avaliable to emit a run.
178 std::vector<SBPrefix> buffer_; 179 std::vector<SBPrefix> buffer_;
179 180
180 // The PrefixSet being built. 181 // The PrefixSet being built.
181 scoped_ptr<PrefixSet> prefix_set_; 182 scoped_ptr<PrefixSet> prefix_set_;
182 }; 183 };
183 184
184 } // namespace safe_browsing 185 } // namespace safe_browsing
185 186
186 #endif // CHROME_BROWSER_SAFE_BROWSING_PREFIX_SET_H_ 187 #endif // COMPONENTS_SAFE_BROWSING_DB_PREFIX_SET_H_
OLDNEW
« no previous file with comments | « components/safe_browsing_db/README ('k') | components/safe_browsing_db/prefix_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698