OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "components/policy/core/common/registry_dict.h" | 5 #include "components/policy/core/common/registry_dict.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 base::JSONReader::Read(string_value); | 131 base::JSONReader::Read(string_value); |
132 if (result && result->IsType(schema.type())) | 132 if (result && result->IsType(schema.type())) |
133 return result; | 133 return result; |
134 } | 134 } |
135 break; | 135 break; |
136 } | 136 } |
137 case base::Value::Type::STRING: | 137 case base::Value::Type::STRING: |
138 case base::Value::Type::BINARY: | 138 case base::Value::Type::BINARY: |
139 // No conversion possible. | 139 // No conversion possible. |
140 break; | 140 break; |
| 141 |
| 142 case base::Value::Type::DELETED: |
| 143 // TODO(crbug.com/697817): This means a use-after-free. |
| 144 CHECK(false); |
| 145 break; |
141 } | 146 } |
142 | 147 |
143 LOG(WARNING) << "Failed to convert " << value.GetType() | 148 LOG(WARNING) << "Failed to convert " << value.GetType() |
144 << " to " << schema.type(); | 149 << " to " << schema.type(); |
145 return nullptr; | 150 return nullptr; |
146 } | 151 } |
147 #endif // #if defined(OS_WIN) | 152 #endif // #if defined(OS_WIN) |
148 | 153 |
149 } // namespace | 154 } // namespace |
150 | 155 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 return std::move(result); | 357 return std::move(result); |
353 } | 358 } |
354 default: | 359 default: |
355 LOG(WARNING) << "Can't convert registry key to schema type " << type; | 360 LOG(WARNING) << "Can't convert registry key to schema type " << type; |
356 } | 361 } |
357 | 362 |
358 return nullptr; | 363 return nullptr; |
359 } | 364 } |
360 #endif // #if defined(OS_WIN) | 365 #endif // #if defined(OS_WIN) |
361 } // namespace policy | 366 } // namespace policy |
OLD | NEW |