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

Side by Side Diff: rlz/win/lib/rlz_value_store_registry.cc

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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
« no previous file with comments | « rlz/win/lib/process_info.cc ('k') | sandbox/win/src/handle_closer_agent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "rlz/win/lib/rlz_value_store_registry.h" 5 #include "rlz/win/lib/rlz_value_store_registry.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/win/registry.h" 9 #include "base/win/registry.h"
10 #include "rlz/lib/assert.h" 10 #include "rlz/lib/assert.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 void RlzValueStoreRegistry::CollectGarbage() { 343 void RlzValueStoreRegistry::CollectGarbage() {
344 // Delete each of the known subkeys if empty. 344 // Delete each of the known subkeys if empty.
345 const char* const subkeys[] = { 345 const char* const subkeys[] = {
346 kRlzsSubkeyName, 346 kRlzsSubkeyName,
347 kEventsSubkeyName, 347 kEventsSubkeyName,
348 kStatefulEventsSubkeyName, 348 kStatefulEventsSubkeyName,
349 kPingTimesSubkeyName 349 kPingTimesSubkeyName
350 }; 350 };
351 351
352 for (int i = 0; i < arraysize(subkeys); i++) { 352 for (size_t i = 0; i < arraysize(subkeys); i++) {
353 std::string subkey_name; 353 std::string subkey_name;
354 base::StringAppendF(&subkey_name, "%s\\%s", kLibKeyName, subkeys[i]); 354 base::StringAppendF(&subkey_name, "%s\\%s", kLibKeyName, subkeys[i]);
355 AppendBrandToString(&subkey_name); 355 AppendBrandToString(&subkey_name);
356 base::string16 subkey_name16 = ASCIIToUTF16(subkey_name); 356 base::string16 subkey_name16 = ASCIIToUTF16(subkey_name);
357 357
358 VERIFY(DeleteKeyIfEmpty(HKEY_CURRENT_USER, subkey_name16.c_str())); 358 VERIFY(DeleteKeyIfEmpty(HKEY_CURRENT_USER, subkey_name16.c_str()));
359 } 359 }
360 360
361 // Delete the library key and its parents too now if empty. 361 // Delete the library key and its parents too now if empty.
362 VERIFY(DeleteKeyIfEmpty(HKEY_CURRENT_USER, GetWideLibKeyName().c_str())); 362 VERIFY(DeleteKeyIfEmpty(HKEY_CURRENT_USER, GetWideLibKeyName().c_str()));
363 VERIFY(DeleteKeyIfEmpty(HKEY_CURRENT_USER, kGoogleCommonKeyName)); 363 VERIFY(DeleteKeyIfEmpty(HKEY_CURRENT_USER, kGoogleCommonKeyName));
364 VERIFY(DeleteKeyIfEmpty(HKEY_CURRENT_USER, kGoogleKeyName)); 364 VERIFY(DeleteKeyIfEmpty(HKEY_CURRENT_USER, kGoogleKeyName));
365 } 365 }
366 366
367 ScopedRlzValueStoreLock::ScopedRlzValueStoreLock() { 367 ScopedRlzValueStoreLock::ScopedRlzValueStoreLock() {
368 if (!lock_.failed()) 368 if (!lock_.failed())
369 store_.reset(new RlzValueStoreRegistry); 369 store_.reset(new RlzValueStoreRegistry);
370 } 370 }
371 371
372 ScopedRlzValueStoreLock::~ScopedRlzValueStoreLock() { 372 ScopedRlzValueStoreLock::~ScopedRlzValueStoreLock() {
373 } 373 }
374 374
375 RlzValueStore* ScopedRlzValueStoreLock::GetStore() { 375 RlzValueStore* ScopedRlzValueStoreLock::GetStore() {
376 return store_.get(); 376 return store_.get();
377 } 377 }
378 378
379 } // namespace rlz_lib 379 } // namespace rlz_lib
OLDNEW
« no previous file with comments | « rlz/win/lib/process_info.cc ('k') | sandbox/win/src/handle_closer_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698