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

Side by Side Diff: components/policy/core/common/policy_test_utils.cc

Issue 2750533003: Temporarily CHECK use after free in Value (Closed)
Patch Set: Fix more Created 3 years, 9 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
OLDNEW
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/policy_test_utils.h" 5 #include "components/policy/core/common/policy_test_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return array; 133 return array;
134 } 134 }
135 break; 135 break;
136 } 136 }
137 137
138 case base::Value::Type::BINARY: 138 case base::Value::Type::BINARY:
139 // This type isn't converted (though it can be represented as CFData) 139 // This type isn't converted (though it can be represented as CFData)
140 // because there's no equivalent JSON type, and policy values can only 140 // because there's no equivalent JSON type, and policy values can only
141 // take valid JSON values. 141 // take valid JSON values.
142 break; 142 break;
143
144 case base::Value::Type::DELETED:
145 // TODO(crbug.com/697817): This means |value| is used after free.
146 CHECK(false);
147 break;
143 } 148 }
144 149
145 return NULL; 150 return NULL;
146 } 151 }
147 #endif // defined(OS_IOS) || defined(OS_MACOSX) 152 #endif // defined(OS_IOS) || defined(OS_MACOSX)
148 153
149 } // namespace policy 154 } // namespace policy
150 155
151 std::ostream& operator<<(std::ostream& os, 156 std::ostream& operator<<(std::ostream& os,
152 const policy::PolicyBundle& bundle) { 157 const policy::PolicyBundle& bundle) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 << " \"scope\": " << e.scope << "," << std::endl 238 << " \"scope\": " << e.scope << "," << std::endl
234 << " \"value\": " << value 239 << " \"value\": " << value
235 << "}"; 240 << "}";
236 return os; 241 return os;
237 } 242 }
238 243
239 std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns) { 244 std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns) {
240 os << ns.domain << "/" << ns.component_id; 245 os << ns.domain << "/" << ns.component_id;
241 return os; 246 return os;
242 } 247 }
OLDNEW
« no previous file with comments | « components/policy/core/browser/android/policy_converter.cc ('k') | components/policy/core/common/registry_dict.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698