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

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

Issue 383263005: Remove more CreateIntegerValue calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/SetBoolean/SetInteger Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/preg_parser_win.h" 5 #include "components/policy/core/common/preg_parser_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 value->reset(base::Value::CreateStringValue(DecodePRegStringValue(data))); 121 value->reset(base::Value::CreateStringValue(DecodePRegStringValue(data)));
122 return true; 122 return true;
123 case REG_DWORD_LITTLE_ENDIAN: 123 case REG_DWORD_LITTLE_ENDIAN:
124 case REG_DWORD_BIG_ENDIAN: 124 case REG_DWORD_BIG_ENDIAN:
125 if (data.size() == sizeof(uint32)) { 125 if (data.size() == sizeof(uint32)) {
126 uint32 val = *reinterpret_cast<const uint32*>(vector_as_array(&data)); 126 uint32 val = *reinterpret_cast<const uint32*>(vector_as_array(&data));
127 if (type == REG_DWORD_BIG_ENDIAN) 127 if (type == REG_DWORD_BIG_ENDIAN)
128 val = base::NetToHost32(val); 128 val = base::NetToHost32(val);
129 else 129 else
130 val = base::ByteSwapToLE32(val); 130 val = base::ByteSwapToLE32(val);
131 value->reset(base::Value::CreateIntegerValue(static_cast<int>(val))); 131 value->reset(new base::FundamentalValue(static_cast<int>(val)));
132 return true; 132 return true;
133 } else { 133 } else {
134 LOG(ERROR) << "Bad data size " << data.size(); 134 LOG(ERROR) << "Bad data size " << data.size();
135 } 135 }
136 break; 136 break;
137 case REG_NONE: 137 case REG_NONE:
138 case REG_LINK: 138 case REG_LINK:
139 case REG_MULTI_SZ: 139 case REG_MULTI_SZ:
140 case REG_RESOURCE_LIST: 140 case REG_RESOURCE_LIST:
141 case REG_FULL_RESOURCE_DESCRIPTOR: 141 case REG_FULL_RESOURCE_DESCRIPTOR:
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 300 }
301 301
302 LOG(ERROR) << "Error parsing " << file_path.value() << " at offset " 302 LOG(ERROR) << "Error parsing " << file_path.value() << " at offset "
303 << reinterpret_cast<const uint8*>(cursor - 1) - mapped_file.data(); 303 << reinterpret_cast<const uint8*>(cursor - 1) - mapped_file.data();
304 status->Add(POLICY_LOAD_STATUS_PARSE_ERROR); 304 status->Add(POLICY_LOAD_STATUS_PARSE_ERROR);
305 return false; 305 return false;
306 } 306 }
307 307
308 } // namespace preg_parser 308 } // namespace preg_parser
309 } // namespace policy 309 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_service_impl_unittest.cc ('k') | components/policy/core/common/registry_dict_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698