| OLD | NEW |
| 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 "chrome/browser/policy/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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/files/memory_mapped_file.h" | 15 #include "base/files/memory_mapped_file.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
| 18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
| 19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/sys_byteorder.h" | 21 #include "base/sys_byteorder.h" |
| 22 #include "base/values.h" | 22 #include "base/values.h" |
| 23 #include "chrome/browser/policy/policy_load_status.h" | 23 #include "components/policy/core/common/policy_load_status.h" |
| 24 #include "components/policy/core/common/registry_dict_win.h" | 24 #include "components/policy/core/common/registry_dict_win.h" |
| 25 | 25 |
| 26 namespace policy { | 26 namespace policy { |
| 27 namespace preg_parser { | 27 namespace preg_parser { |
| 28 | 28 |
| 29 const char kPRegFileHeader[8] = | 29 const char kPRegFileHeader[8] = |
| 30 { 'P', 'R', 'e', 'g', '\x01', '\x00', '\x00', '\x00' }; | 30 { 'P', 'R', 'e', 'g', '\x01', '\x00', '\x00', '\x00' }; |
| 31 | 31 |
| 32 // Maximum PReg file size we're willing to accept. | 32 // Maximum PReg file size we're willing to accept. |
| 33 const int64 kMaxPRegFileSize = 1024 * 1024 * 16; | 33 const int64 kMaxPRegFileSize = 1024 * 1024 * 16; |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 297 } |
| 298 | 298 |
| 299 LOG(ERROR) << "Error parsing " << file_path.value() << " at offset " | 299 LOG(ERROR) << "Error parsing " << file_path.value() << " at offset " |
| 300 << reinterpret_cast<const uint8*>(cursor - 1) - mapped_file.data(); | 300 << reinterpret_cast<const uint8*>(cursor - 1) - mapped_file.data(); |
| 301 status->Add(POLICY_LOAD_STATUS_PARSE_ERROR); | 301 status->Add(POLICY_LOAD_STATUS_PARSE_ERROR); |
| 302 return false; | 302 return false; |
| 303 } | 303 } |
| 304 | 304 |
| 305 } // namespace preg_parser | 305 } // namespace preg_parser |
| 306 } // namespace policy | 306 } // namespace policy |
| OLD | NEW |