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

Side by Side Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 815363002: replace COMPILE_ASSERT with static_assert in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 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 (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/browser/themes/browser_theme_pack.h" 5 #include "chrome/browser/themes/browser_theme_pack.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 } 952 }
953 953
954 void BrowserThemePack::BuildHeader(const Extension* extension) { 954 void BrowserThemePack::BuildHeader(const Extension* extension) {
955 header_ = new BrowserThemePackHeader; 955 header_ = new BrowserThemePackHeader;
956 header_->version = kThemePackVersion; 956 header_->version = kThemePackVersion;
957 957
958 // TODO(erg): Need to make this endian safe on other computers. Prerequisite 958 // TODO(erg): Need to make this endian safe on other computers. Prerequisite
959 // is that ui::DataPack removes this same check. 959 // is that ui::DataPack removes this same check.
960 #if defined(__BYTE_ORDER) 960 #if defined(__BYTE_ORDER)
961 // Linux check 961 // Linux check
962 COMPILE_ASSERT(__BYTE_ORDER == __LITTLE_ENDIAN, 962 static_assert(__BYTE_ORDER == __LITTLE_ENDIAN,
963 datapack_assumes_little_endian); 963 "datapack assumes little endian");
964 #elif defined(__BIG_ENDIAN__) 964 #elif defined(__BIG_ENDIAN__)
965 // Mac check 965 // Mac check
966 #error DataPack assumes little endian 966 #error DataPack assumes little endian
967 #endif 967 #endif
968 header_->little_endian = 1; 968 header_->little_endian = 1;
969 969
970 const std::string& id = extension->id(); 970 const std::string& id = extension->id();
971 memcpy(header_->theme_id, id.c_str(), crx_file::id_util::kIdSize); 971 memcpy(header_->theme_id, id.c_str(), crx_file::id_util::kIdSize);
972 } 972 }
973 973
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 false, 1629 false,
1630 &bitmap_data)) { 1630 &bitmap_data)) {
1631 NOTREACHED() << "Unable to encode theme image for prs_id=" 1631 NOTREACHED() << "Unable to encode theme image for prs_id="
1632 << prs_id << " for scale_factor=" << scale_factors_[i]; 1632 << prs_id << " for scale_factor=" << scale_factors_[i];
1633 break; 1633 break;
1634 } 1634 }
1635 image_memory_[scaled_raw_id] = 1635 image_memory_[scaled_raw_id] =
1636 base::RefCountedBytes::TakeVector(&bitmap_data); 1636 base::RefCountedBytes::TakeVector(&bitmap_data);
1637 } 1637 }
1638 } 1638 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698