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

Side by Side Diff: chrome/installer/util/installation_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/install_util.cc ('k') | chrome/installer/util/installer_state.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/installation_state.h" 5 #include "chrome/installer/util/installation_state.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return false; 217 return false;
218 *usagestats = usagestats_; 218 *usagestats = usagestats_;
219 return true; 219 return true;
220 } 220 }
221 221
222 InstallationState::InstallationState() { 222 InstallationState::InstallationState() {
223 } 223 }
224 224
225 // static 225 // static
226 int InstallationState::IndexFromDistType(BrowserDistribution::Type type) { 226 int InstallationState::IndexFromDistType(BrowserDistribution::Type type) {
227 COMPILE_ASSERT(BrowserDistribution::CHROME_BROWSER == CHROME_BROWSER_INDEX, 227 static_assert(BrowserDistribution::CHROME_BROWSER == CHROME_BROWSER_INDEX,
228 unexpected_chrome_browser_distribution_value_); 228 "unexpected_chrome_browser_distribution_value_");
229 COMPILE_ASSERT(BrowserDistribution::CHROME_FRAME == CHROME_FRAME_INDEX, 229 static_assert(BrowserDistribution::CHROME_FRAME == CHROME_FRAME_INDEX,
230 unexpected_chrome_frame_distribution_value_); 230 "unexpected_chrome_frame_distribution_value_");
231 COMPILE_ASSERT(BrowserDistribution::CHROME_BINARIES == CHROME_BINARIES_INDEX, 231 static_assert(BrowserDistribution::CHROME_BINARIES == CHROME_BINARIES_INDEX,
232 unexpected_chrome_frame_distribution_value_); 232 "unexpected_chrome_frame_distribution_value_");
233 DCHECK(type == BrowserDistribution::CHROME_BROWSER || 233 DCHECK(type == BrowserDistribution::CHROME_BROWSER ||
234 type == BrowserDistribution::CHROME_FRAME || 234 type == BrowserDistribution::CHROME_FRAME ||
235 type == BrowserDistribution::CHROME_BINARIES); 235 type == BrowserDistribution::CHROME_BINARIES);
236 return type; 236 return type;
237 } 237 }
238 238
239 void InstallationState::Initialize() { 239 void InstallationState::Initialize() {
240 BrowserDistribution* distribution; 240 BrowserDistribution* distribution;
241 241
242 distribution = BrowserDistribution::GetSpecificDistribution( 242 distribution = BrowserDistribution::GetSpecificDistribution(
(...skipping 21 matching lines...) Expand all
264 } 264 }
265 265
266 const ProductState* InstallationState::GetProductState( 266 const ProductState* InstallationState::GetProductState(
267 bool system_install, 267 bool system_install,
268 BrowserDistribution::Type type) const { 268 BrowserDistribution::Type type) const {
269 const ProductState* product_state = 269 const ProductState* product_state =
270 GetNonVersionedProductState(system_install, type); 270 GetNonVersionedProductState(system_install, type);
271 return product_state->version_.get() == NULL ? NULL : product_state; 271 return product_state->version_.get() == NULL ? NULL : product_state;
272 } 272 }
273 } // namespace installer 273 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/util/install_util.cc ('k') | chrome/installer/util/installer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698