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

Side by Side Diff: chrome/installer/util/channel_info.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup 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 | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/util/delete_tree_work_item.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 "chrome/installer/util/channel_info.h" 5 #include "chrome/installer/util/channel_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/win/registry.h" 10 #include "base/win/registry.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 MOD_CHROME_FRAME, 46 MOD_CHROME_FRAME,
47 MOD_APP_HOST_DEPRECATED, 47 MOD_APP_HOST_DEPRECATED,
48 MOD_APP_LAUNCHER_DEPRECATED, 48 MOD_APP_LAUNCHER_DEPRECATED,
49 MOD_READY_MODE, 49 MOD_READY_MODE,
50 SFX_MULTI_FAIL, 50 SFX_MULTI_FAIL,
51 SFX_MIGRATING, 51 SFX_MIGRATING,
52 SFX_FULL, 52 SFX_FULL,
53 NUM_MODIFIERS 53 NUM_MODIFIERS
54 }; 54 };
55 55
56 COMPILE_ASSERT(NUM_MODIFIERS == arraysize(kModifiers), 56 static_assert(NUM_MODIFIERS == arraysize(kModifiers),
57 kModifiers_disagrees_with_ModifierIndex_comma_they_must_match_bang); 57 "kModifiers disagrees with ModifierIndex; they must match!");
58 58
59 // Returns true if the modifier is found, in which case |position| holds the 59 // Returns true if the modifier is found, in which case |position| holds the
60 // location at which the modifier was found. The number of characters in the 60 // location at which the modifier was found. The number of characters in the
61 // modifier is returned in |length|, if non-NULL. 61 // modifier is returned in |length|, if non-NULL.
62 bool FindModifier(ModifierIndex index, 62 bool FindModifier(ModifierIndex index,
63 const base::string16& ap_value, 63 const base::string16& ap_value,
64 base::string16::size_type* position, 64 base::string16::size_type* position,
65 base::string16::size_type* length) { 65 base::string16::size_type* length) {
66 DCHECK(position != NULL); 66 DCHECK(position != NULL);
67 base::string16::size_type mod_position = base::string16::npos; 67 base::string16::size_type mod_position = base::string16::npos;
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 for (int scan = 0; scan < NUM_MODIFIERS; ++scan) { 341 for (int scan = 0; scan < NUM_MODIFIERS; ++scan) {
342 ModifierIndex index = static_cast<ModifierIndex>(scan); 342 ModifierIndex index = static_cast<ModifierIndex>(scan);
343 modified = SetModifier(index, false, &value_) || modified; 343 modified = SetModifier(index, false, &value_) || modified;
344 } 344 }
345 345
346 return modified; 346 return modified;
347 } 347 }
348 348
349 } // namespace installer 349 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/util/delete_tree_work_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698