OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_COMMON_SAFE_BROWSING_FILE_TYPE_POLICIES_H_ | 5 #ifndef CHROME_COMMON_SAFE_BROWSING_FILE_TYPE_POLICIES_H_ |
6 #define CHROME_COMMON_SAFE_BROWSING_FILE_TYPE_POLICIES_H_ | 6 #define CHROME_COMMON_SAFE_BROWSING_FILE_TYPE_POLICIES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // Used in metrics, do not reorder. | 80 // Used in metrics, do not reorder. |
81 enum class UpdateResult { | 81 enum class UpdateResult { |
82 SUCCESS = 1, | 82 SUCCESS = 1, |
83 FAILED_EMPTY = 2, | 83 FAILED_EMPTY = 2, |
84 FAILED_PROTO_PARSE = 3, | 84 FAILED_PROTO_PARSE = 3, |
85 FAILED_DELTA_CHECK = 4, | 85 FAILED_DELTA_CHECK = 4, |
86 FAILED_VERSION_CHECK = 5, | 86 FAILED_VERSION_CHECK = 5, |
87 FAILED_DEFAULT_SETTING_SET = 6, | 87 FAILED_DEFAULT_SETTING_SET = 6, |
88 FAILED_WRONG_SETTINGS_COUNT = 7, | 88 FAILED_WRONG_SETTINGS_COUNT = 7, |
| 89 SKIPPED_VERSION_CHECK_EQUAL = 8, |
89 }; | 90 }; |
90 | 91 |
91 // Read data from an serialized protobuf and update the internal list | 92 // Read data from an serialized protobuf and update the internal list |
92 // only if it passes integrity checks. | 93 // only if it passes integrity checks. |
93 virtual UpdateResult PopulateFromBinaryPb(const std::string& binary_pb); | 94 virtual UpdateResult PopulateFromBinaryPb(const std::string& binary_pb); |
94 | 95 |
95 // Fetch the blob from the main resource bundle. | 96 // Fetch the blob from the main resource bundle. |
96 virtual void ReadResourceBundle(std::string* binary_pb); | 97 virtual void ReadResourceBundle(std::string* binary_pb); |
97 | 98 |
98 // Record the result of an update attempt. | 99 // Record the result of an update attempt. |
(...skipping 30 matching lines...) Expand all Loading... |
129 FRIEND_TEST_ALL_PREFIXES(FileTypePoliciesTest, UnpackResourceBundle); | 130 FRIEND_TEST_ALL_PREFIXES(FileTypePoliciesTest, UnpackResourceBundle); |
130 FRIEND_TEST_ALL_PREFIXES(FileTypePoliciesTest, BadProto); | 131 FRIEND_TEST_ALL_PREFIXES(FileTypePoliciesTest, BadProto); |
131 FRIEND_TEST_ALL_PREFIXES(FileTypePoliciesTest, BadUpdateFromExisting); | 132 FRIEND_TEST_ALL_PREFIXES(FileTypePoliciesTest, BadUpdateFromExisting); |
132 | 133 |
133 friend struct FileTypePoliciesSingletonTrait; | 134 friend struct FileTypePoliciesSingletonTrait; |
134 }; | 135 }; |
135 | 136 |
136 } // namespace safe_browsing | 137 } // namespace safe_browsing |
137 | 138 |
138 #endif // CHROME_COMMON_SAFE_BROWSING_FILE_TYPE_POLICIES_H_ | 139 #endif // CHROME_COMMON_SAFE_BROWSING_FILE_TYPE_POLICIES_H_ |
OLD | NEW |