Skip to content

Commit

Permalink
Merge pull request #36690 from YorikSar/fix-chromium-build
Browse files Browse the repository at this point in the history
chromium: fix GCC 7 related build issues
  • Loading branch information
7c6f434c committed Mar 10, 2018
2 parents c0737e1 + ebce421 commit cac24cc
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 315 deletions.
32 changes: 24 additions & 8 deletions pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,43 @@ let

patches = [
./patches/nix_plugin_paths_52.patch
# To enable ChromeCast, go to chrome://flags and set "Load Media Router Component Extension" to Enabled
## Fixes Chromecast: https://bugs.chromium.org/p/chromium/issues/detail?id=734325
## TODO investigate build error
#./patches/fix_network_api_crash.patch

# As major versions are added, you can trawl the gentoo and arch repos at
# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/
# https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/chromium
# for updated patches and hints about build flags

# (gentooPatch "<patch>" "0000000000000000000000000000000000000000000000000000000000000000")
] ++ optionals (versionRange "65" "66") [
(gentooPatch "chromium-stdint.patch" "037gjnc8h087g6dpxz53nqvzbpa9mq0z47h25vix9p62s9nhz2a8")
(gentooPatch "chromium-webrtc-r0.patch" "0wp4zivbv2wpgiwmiznbq1aw4w98mvwjvdy36cpfmnvr8yw430pd")
(gentooPatch "chromium-math.h-r0.patch" "0dlzbdj0lvp9qklgifsvgbn6p1ppxbl3hkwqqqfsw1d9jka9wy8x")
# To enable ChromeCast, go to chrome://flags and set "Load Media Router Component Extension" to Enabled
# Fixes Chromecast: https://bugs.chromium.org/p/chromium/issues/detail?id=734325
(githubPatch "1517db71cccaec48a05cdf30208e0cba7ab9b9a8" "08ac502cwwb05ml3w4wzn66i5c2d1h22xs5rzszwlnhxckxfc0fk")
# GCC 7 fixes
(githubPatch "f64fadcd79aebe5ed893ecbf258d1123609d28f8" "1h255w1v327r08cnifs19s4bwmkinqjmdmbwihddc5dyl43sjnvv")
(githubPatch "4d8468a07f374c11425494271256151fb6fe0c34" "0kqqq8kj0zv5bi1n9mm0vnn8wsgi98mjmj7snpav21fh3pgiqjrm")
(githubPatch "ede5178322ccd297b0ad82ae4c59119ceaab9ea5" "0rsal0dy0yhgs4lhn8h1vy1s77xcssy4f5wals7hvrz5m08jqizj")
(githubPatch "7d721f438acb38db556ae9a9e6e8b718bd503216" "13lzvxm63zq3rd8p387ylq4bm9wr4r09vk2w4p81f838pf0v1kbj")
# Following commit doesn't apply cleanly to stable branch, replace with handcrafted one
#(githubPatch "4f2b52281ce1649ea8347489443965ad33262ecc" "1g59izkicn9cpcphamdgrijs306h5b9i7i4pmy134asn1ifiax5z")
./patches/PlaybackImageProvider-copy-constructor.patch
# * base/optional.h
(githubPatch "f1c8789c71dbdaeeef98ecd52c9715495824e6b0" "0w3d82s10cl10r6zq9vpsscmdhbdkcy0vbdiqy5pvbr031nfxw5w")
(githubPatch "5cae9645215d02cb1f986a181a208f8a4817fc86" "052y0f9nwq6y6jh2gvr1pm8qdcqghyi3jj5svvrp5aqirlkwb7ri")
# * ConfigurationPolicyProviders
(githubPatch "1ee888aed9f9a6291570ce360bcdd2d06bcc68cb" "1bm34p3bsny44sk60j842ghhhx8qaibwpqnfnyndfj96f7nb2az0")
(githubPatch "76da73abaeede740fc97479c09c92a52972bc477" "03rkf514ddj9d32d3zfcnf96kzzdk6cwxvrqj8acyv93vp1hvckr")
#(gentooPatch "<patch>" "0000000000000000000000000000000000000000000000000000000000000000")
] ++ optionals (versionRange "66" "67") [
(gentooPatch "chromium-stdint.patch" "037gjnc8h087g6dpxz53nqvzbpa9mq0z47h25vix9p62s9nhz2a8")
(gentooPatch "chromium-webrtc-r0.patch" "0wp4zivbv2wpgiwmiznbq1aw4w98mvwjvdy36cpfmnvr8yw430pd")
(gentooPatch "chromium-math.h-r0.patch" "0dlzbdj0lvp9qklgifsvgbn6p1ppxbl3hkwqqqfsw1d9jka9wy8x")
(gentooPatch "chromium-ffmpeg-r1.patch" "1k8agaqsvg0w0s6s5wh346ih02cc86vr0vwyshw2q9vafa0jvmq4")
# GCC 7 fixes
(githubPatch "f64fadcd79aebe5ed893ecbf258d1123609d28f8" "1h255w1v327r08cnifs19s4bwmkinqjmdmbwihddc5dyl43sjnvv")
(githubPatch "ede5178322ccd297b0ad82ae4c59119ceaab9ea5" "0rsal0dy0yhgs4lhn8h1vy1s77xcssy4f5wals7hvrz5m08jqizj")
(githubPatch "7d721f438acb38db556ae9a9e6e8b718bd503216" "13lzvxm63zq3rd8p387ylq4bm9wr4r09vk2w4p81f838pf0v1kbj")
(githubPatch "ba4141e451f4e0b1b19410b1b503bd32e150df06" "1cjxw1f9fin6z12b0mcxnxf2mdjb0n3chwz7mgvmp9yij8qhqnxj")
(githubPatch "b34ed1e6524479d61ee944ebf6ca7389ea47e563" "1s13zw93nsyr259dzck6gbhg4x46qg5sg14djf4bvrrc6hlkiczw")
(githubPatch "4f2b52281ce1649ea8347489443965ad33262ecc" "1g59izkicn9cpcphamdgrijs306h5b9i7i4pmy134asn1ifiax5z")
] ++ optional enableWideVine ./patches/widevine.patch;

postPatch = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
--- a/cc/raster/playback_image_provider.cc
+++ b/cc/raster/playback_image_provider.cc
@@ -20,7 +20,7 @@
PlaybackImageProvider::PlaybackImageProvider(
ImageDecodeCache* cache,
const gfx::ColorSpace& target_color_space,
- base::Optional<Settings> settings)
+ base::Optional<Settings>&& settings)
: cache_(cache),
target_color_space_(target_color_space),
settings_(std::move(settings)) {
@@ -70,7 +70,10 @@
}

PlaybackImageProvider::Settings::Settings() = default;
-PlaybackImageProvider::Settings::Settings(const Settings& other) = default;
+PlaybackImageProvider::Settings::Settings(PlaybackImageProvider::Settings&&) =
+ default;
PlaybackImageProvider::Settings::~Settings() = default;
+PlaybackImageProvider::Settings& PlaybackImageProvider::Settings::operator=(
+ PlaybackImageProvider::Settings&&) = default;

} // namespace cc
--- a/cc/raster/playback_image_provider.h
+++ b/cc/raster/playback_image_provider.h
@@ -20,8 +20,10 @@
public:
struct CC_EXPORT Settings {
Settings();
- Settings(const Settings& other);
+ Settings(const Settings&) = delete;
+ Settings(Settings&&);
~Settings();
+ Settings& operator=(Settings&&);

// The set of image ids to skip during raster.
PaintImageIdFlatSet images_to_skip;
@@ -34,7 +36,7 @@
// If no settings are provided, all images are skipped during rasterization.
PlaybackImageProvider(ImageDecodeCache* cache,
const gfx::ColorSpace& target_color_space,
- base::Optional<Settings> settings);
+ base::Optional<Settings>&& settings);
~PlaybackImageProvider() override;

PlaybackImageProvider(PlaybackImageProvider&& other);
--- a/cc/raster/playback_image_provider_unittest.cc
+++ b/cc/raster/playback_image_provider_unittest.cc
@@ -84,7 +84,8 @@ TEST(PlaybackImageProviderTest, SkipsSomeImages) {
settings.emplace();
settings->images_to_skip = {skip_image.stable_id()};

- PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings);
+ PlaybackImageProvider provider(&cache, gfx::ColorSpace(),
+ std::move(settings));
provider.BeginRaster();

SkIRect rect = SkIRect::MakeWH(10, 10);
@@ -100,7 +101,8 @@ TEST(PlaybackImageProviderTest, RefAndUnrefDecode) {

base::Optional<PlaybackImageProvider::Settings> settings;
settings.emplace();
- PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings);
+ PlaybackImageProvider provider(&cache, gfx::ColorSpace(),
+ std::move(settings));
provider.BeginRaster();

{
@@ -133,7 +135,8 @@ TEST(PlaybackImageProviderTest, AtRasterImages) {
settings.emplace();
settings->at_raster_images = {draw_image1, draw_image2};

- PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings);
+ PlaybackImageProvider provider(&cache, gfx::ColorSpace(),
+ std::move(settings));

EXPECT_EQ(cache.refed_image_count(), 0);
provider.BeginRaster();
@@ -158,7 +161,8 @@ TEST(PlaybackImageProviderTest, SwapsGivenFrames) {
settings.emplace();
settings->image_to_current_frame_index = image_to_frame;

- PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings);
+ PlaybackImageProvider provider(&cache, gfx::ColorSpace(),
+ std::move(settings));
provider.BeginRaster();

SkIRect rect = SkIRect::MakeWH(10, 10);

This file was deleted.

This file was deleted.

0 comments on commit cac24cc

Please sign in to comment.