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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/environment_data_collection_win.cc

Issue 1548133002: Switch to standard integer types in chrome/browser/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/safe_browsing/incident_reporting/environment_data_colle ction_win.h" 5 #include "chrome/browser/safe_browsing/incident_reporting/environment_data_colle ction_win.h"
6 6
7 #include <stdint.h>
8
7 #include <set> 9 #include <set>
8 #include <string> 10 #include <string>
9 11
10 #include "base/i18n/case_conversion.h" 12 #include "base/i18n/case_conversion.h"
13 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
12 #include "base/metrics/histogram_macros.h" 15 #include "base/metrics/histogram_macros.h"
13 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
14 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
15 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
16 #include "base/win/registry.h" 19 #include "base/win/registry.h"
17 #include "base/win/win_util.h" 20 #include "base/win/win_util.h"
18 #include "chrome/browser/install_verification/win/module_info.h" 21 #include "chrome/browser/install_verification/win/module_info.h"
19 #include "chrome/browser/install_verification/win/module_verification_common.h" 22 #include "chrome/browser/install_verification/win/module_verification_common.h"
20 #include "chrome/browser/net/service_providers_win.h" 23 #include "chrome/browser/net/service_providers_win.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 DWORD max_value_name_len = 0; 88 DWORD max_value_name_len = 0;
86 DWORD max_value_len = 0; 89 DWORD max_value_len = 0;
87 LONG result = RegQueryInfoKey( 90 LONG result = RegQueryInfoKey(
88 key.Handle(), NULL, NULL, NULL, &num_subkeys, &max_subkey_name_len, NULL, 91 key.Handle(), NULL, NULL, NULL, &num_subkeys, &max_subkey_name_len, NULL,
89 &num_values, &max_value_name_len, &max_value_len, NULL, NULL); 92 &num_values, &max_value_name_len, &max_value_len, NULL, NULL);
90 93
91 DWORD max_name_len = std::max(max_subkey_name_len, max_value_name_len) + 1; 94 DWORD max_name_len = std::max(max_subkey_name_len, max_value_name_len) + 1;
92 std::vector<wchar_t> name_buffer(max_name_len); 95 std::vector<wchar_t> name_buffer(max_name_len);
93 // Read the values. 96 // Read the values.
94 if (num_values != 0) { 97 if (num_values != 0) {
95 std::vector<uint8> value_buffer(max_value_len != 0 ? max_value_len : 1); 98 std::vector<uint8_t> value_buffer(max_value_len != 0 ? max_value_len : 1);
96 DWORD name_size = 0; 99 DWORD name_size = 0;
97 DWORD value_type = REG_NONE; 100 DWORD value_type = REG_NONE;
98 DWORD value_size = 0; 101 DWORD value_size = 0;
99 102
100 std::wstring name_str; 103 std::wstring name_str;
101 RegistryValueProto* registry_value; 104 RegistryValueProto* registry_value;
102 for (DWORD i = 0; i < num_values;) { 105 for (DWORD i = 0; i < num_values;) {
103 name_size = static_cast<DWORD>(name_buffer.size()); 106 name_size = static_cast<DWORD>(name_buffer.size());
104 value_size = static_cast<DWORD>(value_buffer.size()); 107 value_size = static_cast<DWORD>(value_buffer.size());
105 result = ::RegEnumValue(key.Handle(), i, &name_buffer[0], &name_size, 108 result = ::RegEnumValue(key.Handle(), i, &name_buffer[0], &name_size,
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 void CollectPlatformOSData(ClientIncidentReport_EnvironmentData_OS* os_data) { 318 void CollectPlatformOSData(ClientIncidentReport_EnvironmentData_OS* os_data) {
316 const std::string reg_data_param_value = variations::GetVariationParamValue( 319 const std::string reg_data_param_value = variations::GetVariationParamValue(
317 "SafeBrowsingIncidentReportingService", "collect_reg_data"); 320 "SafeBrowsingIncidentReportingService", "collect_reg_data");
318 if (reg_data_param_value == "true") { 321 if (reg_data_param_value == "true") {
319 CollectRegistryData(kRegKeysToCollect, arraysize(kRegKeysToCollect), 322 CollectRegistryData(kRegKeysToCollect, arraysize(kRegKeysToCollect),
320 os_data->mutable_registry_key()); 323 os_data->mutable_registry_key());
321 } 324 }
322 CollectDomainEnrollmentData(os_data); 325 CollectDomainEnrollmentData(os_data);
323 } 326 }
324 } // namespace safe_browsing 327 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698