forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "Add brotli compression to grit"
This reverts commit 1b4225a. Reason for revert: Bug filed to fix broken Asan Builders, added temp workaround Original change's description: > Revert "Add brotli compression to grit" > > This reverts commit a0d64f3. > > Reason for revert: Suspecting this CL of breaking generate_build_files step in Mac ASan 64 Builder. > > First failure here: https://ci.chromium.org/p/chromium/builders/ci/Mac%20ASan%2064%20Builder/86877 > > Original change's description: > > Add brotli compression to grit > > > > -Add the "compress='brotli'" flag option in grdp files > > -Grit will now automatically brotli compress if flag is included > > -Previous Cl that was split into this one: > > https://chromium-review.googlesource.com/c/chromium/src/+/1660352 > > > > > > Bug: 826858 > > Change-Id: I010ad1650394e4bdd58e066486b161cf74f2fff5 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692234 > > Commit-Queue: Andrew Grieve <agrieve@chromium.org> > > Reviewed-by: Andrew Grieve <agrieve@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#675763} > > TBR=dbeam@chromium.org,dpapad@chromium.org,agrieve@chromium.org,tiborg@chromium.org,smaier@chromium.org,jacqueschen@google.com > > Change-Id: I724ed738b56529fe4b4ac1c2ad3e0b9adbee9671 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 826858 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1693809 > Reviewed-by: Hector Carmona <hcarmona@chromium.org> > Commit-Queue: Hector Carmona <hcarmona@chromium.org> > Cr-Commit-Position: refs/heads/master@{#675839} Change-Id: I82ff2a6de6ea754923318900d60c1f845fa59a33 Bug: 826858 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695881 Commit-Queue: Jacques Chen <jacqueschen@google.com> Reviewed-by: Andrew Grieve <agrieve@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Reviewed-by: Dan Beam <dbeam@chromium.org> Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org> Reviewed-by: Sam Maier <smaier@chromium.org> Cr-Commit-Position: refs/heads/master@{#677818}
- Loading branch information
Jacques Chen
authored and
Commit Bot
committed
Jul 16, 2019
1 parent
bf73b60
commit 6d681c6
Showing
9 changed files
with
157 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2019 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
"""Framework for compressing resources using Brotli.""" | ||
|
||
import subprocess | ||
|
||
__brotli_executable = None | ||
|
||
|
||
def SetBrotliCommand(brotli): | ||
# brotli is a list. In production it contains the path to the Brotli executable. | ||
# During testing it contains [python, mock_brotli.py] for testing on Windows. | ||
global __brotli_executable | ||
__brotli_executable = brotli | ||
|
||
|
||
def BrotliCompress(data): | ||
if not __brotli_executable: | ||
raise Exception('SetBrotliCommand has not been called yet!') | ||
compress = subprocess.Popen(__brotli_executable + ['-', '-f'], | ||
stdin=subprocess.PIPE, stdout=subprocess.PIPE) | ||
return compress.communicate(data)[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2019 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
"""Mock Brotli Executable for testing purposes.""" | ||
|
||
import sys | ||
|
||
sys.stdout.write('This has been mock compressed!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters