OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_store.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 if (del_set.count(iter->chunk_id) == 0) { | 83 if (del_set.count(iter->chunk_id) == 0) { |
84 *end_iter = *iter; | 84 *end_iter = *iter; |
85 ++end_iter; | 85 ++end_iter; |
86 } | 86 } |
87 } | 87 } |
88 items->erase(end_iter, items->end()); | 88 items->erase(end_iter, items->end()); |
89 } | 89 } |
90 | 90 |
91 } // namespace | 91 } // namespace |
92 | 92 |
| 93 namespace safe_browsing { |
| 94 |
93 void SBProcessSubs(SBAddPrefixes* add_prefixes, | 95 void SBProcessSubs(SBAddPrefixes* add_prefixes, |
94 SBSubPrefixes* sub_prefixes, | 96 SBSubPrefixes* sub_prefixes, |
95 std::vector<SBAddFullHash>* add_full_hashes, | 97 std::vector<SBAddFullHash>* add_full_hashes, |
96 std::vector<SBSubFullHash>* sub_full_hashes, | 98 std::vector<SBSubFullHash>* sub_full_hashes, |
97 const base::hash_set<int32>& add_chunks_deleted, | 99 const base::hash_set<int32>& add_chunks_deleted, |
98 const base::hash_set<int32>& sub_chunks_deleted) { | 100 const base::hash_set<int32>& sub_chunks_deleted) { |
99 // It is possible to structure templates and template | 101 // It is possible to structure templates and template |
100 // specializations such that the following calls work without having | 102 // specializations such that the following calls work without having |
101 // to qualify things. It becomes very arbitrary, though, and less | 103 // to qualify things. It becomes very arbitrary, though, and less |
102 // clear how things are working. | 104 // clear how things are working. |
(...skipping 19 matching lines...) Expand all Loading... |
122 SBAddPrefixHashLess<SBSubFullHash,SBAddFullHash>); | 124 SBAddPrefixHashLess<SBSubFullHash,SBAddFullHash>); |
123 | 125 |
124 // Remove items from the deleted chunks. This is done after other | 126 // Remove items from the deleted chunks. This is done after other |
125 // processing to allow subs to knock out adds (and be removed) even | 127 // processing to allow subs to knock out adds (and be removed) even |
126 // if the add's chunk is deleted. | 128 // if the add's chunk is deleted. |
127 RemoveDeleted(add_prefixes, add_chunks_deleted); | 129 RemoveDeleted(add_prefixes, add_chunks_deleted); |
128 RemoveDeleted(sub_prefixes, sub_chunks_deleted); | 130 RemoveDeleted(sub_prefixes, sub_chunks_deleted); |
129 RemoveDeleted(add_full_hashes, add_chunks_deleted); | 131 RemoveDeleted(add_full_hashes, add_chunks_deleted); |
130 RemoveDeleted(sub_full_hashes, sub_chunks_deleted); | 132 RemoveDeleted(sub_full_hashes, sub_chunks_deleted); |
131 } | 133 } |
| 134 |
| 135 } // namespace safe_browsing |
OLD | NEW |