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

Side by Side Diff: chrome/installer/util/installer_state.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/util/installation_state.cc ('k') | chrome/installer/util/logging_installer.h » ('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/installer_state.h" 5 #include "chrome/installer/util/installer_state.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 const InstallationState& machine_state, 479 const InstallationState& machine_state,
480 uint32 file_bits) const { 480 uint32 file_bits) const {
481 static const wchar_t* const kBinaryFileNames[] = { 481 static const wchar_t* const kBinaryFileNames[] = {
482 kChromeDll, 482 kChromeDll,
483 kChromeFrameDll, 483 kChromeFrameDll,
484 kChromeFrameHelperDll, 484 kChromeFrameHelperDll,
485 kChromeFrameHelperExe, 485 kChromeFrameHelperExe,
486 }; 486 };
487 DCHECK_NE(file_bits, 0U); 487 DCHECK_NE(file_bits, 0U);
488 DCHECK_LT(file_bits, 1U << NUM_BINARIES); 488 DCHECK_LT(file_bits, 1U << NUM_BINARIES);
489 COMPILE_ASSERT(CHROME_DLL == 1, no_youre_out_of_order); 489 static_assert(CHROME_DLL == 1, "binary file names and values must match");
490 COMPILE_ASSERT(CHROME_FRAME_DLL == 2, no_youre_out_of_order); 490 static_assert(CHROME_FRAME_DLL == 2,
491 COMPILE_ASSERT(CHROME_FRAME_HELPER_DLL == 4, no_youre_out_of_order); 491 "binary file names and values must match");
492 COMPILE_ASSERT(CHROME_FRAME_HELPER_EXE == 8, no_youre_out_of_order); 492 static_assert(CHROME_FRAME_HELPER_DLL == 4,
493 "binary file names and values must match");
494 static_assert(CHROME_FRAME_HELPER_EXE == 8,
495 "binary file names and values must match");
493 496
494 // Check only for the current version (i.e., the version we are upgrading 497 // Check only for the current version (i.e., the version we are upgrading
495 // _from_). Later versions from pending in-use updates need not be checked 498 // _from_). Later versions from pending in-use updates need not be checked
496 // since the current version is guaranteed to be in use if any such are. 499 // since the current version is guaranteed to be in use if any such are.
497 scoped_ptr<Version> current_version(GetCurrentVersion(machine_state)); 500 scoped_ptr<Version> current_version(GetCurrentVersion(machine_state));
498 if (!current_version) 501 if (!current_version)
499 return false; 502 return false;
500 base::FilePath directory( 503 base::FilePath directory(
501 target_path().AppendASCII(current_version->GetString())); 504 target_path().AppendASCII(current_version->GetString()));
502 for (int i = 0; i < NUM_BINARIES; ++i) { 505 for (int i = 0; i < NUM_BINARIES; ++i) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 } 688 }
686 if (!install_list->Do()) 689 if (!install_list->Do())
687 LOG(ERROR) << "Failed to record installer error information in registry."; 690 LOG(ERROR) << "Failed to record installer error information in registry.";
688 } 691 }
689 692
690 bool InstallerState::RequiresActiveSetup() const { 693 bool InstallerState::RequiresActiveSetup() const {
691 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); 694 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER);
692 } 695 }
693 696
694 } // namespace installer 697 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/util/installation_state.cc ('k') | chrome/installer/util/logging_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698