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

Unified Diff: third_party/brotli/tools/bro.cc

Issue 2013493006: Revert of Brotli compression used on about credits html file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/brotli/brotli.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/brotli/tools/bro.cc
diff --git a/third_party/brotli/tools/bro.cc b/third_party/brotli/tools/bro.cc
index 0c2ec76b01b56cfd5dfcf472269c7b35108f8ea0..b254f0ffdb0857e2fd281faca3fe1253c64c9662 100644
--- a/third_party/brotli/tools/bro.cc
+++ b/third_party/brotli/tools/bro.cc
@@ -287,10 +287,16 @@
brotli::BrotliParams params;
params.lgwin = lgwin;
params.quality = quality;
- brotli::BrotliFileIn in(fin, 1 << 16);
- brotli::BrotliFileOut out(fout);
- if (!BrotliCompress(params, &in, &out)) {
- fprintf(stderr, "compression failed\n");
+ try {
+ brotli::BrotliFileIn in(fin, 1 << 16);
+ brotli::BrotliFileOut out(fout);
+ if (!BrotliCompress(params, &in, &out)) {
+ fprintf(stderr, "compression failed\n");
+ unlink(output_path);
+ exit(1);
+ }
+ } catch (std::bad_alloc&) {
+ fprintf(stderr, "not enough memory\n");
unlink(output_path);
exit(1);
}
« no previous file with comments | « third_party/brotli/brotli.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698