From 0793f321512150b15fa048ddb2e97b2e2e183884 Mon Sep 17 00:00:00 2001 From: Patrick McManus Date: Tue, 6 Oct 2015 11:03:50 -0400 Subject: [PATCH] bug 1211916 - rename brotli http coding to br r=bagder --- modules/libpref/init/all.js | 2 +- netwerk/build/nsNetModule.cpp | 2 +- netwerk/protocol/http/HttpBaseChannel.cpp | 4 ++-- netwerk/streamconv/converters/nsHTTPCompressConv.h | 2 +- netwerk/test/unit/test_content_encoding_gzip.js | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 7789ca03b74a..1204c6e4743c 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1326,7 +1326,7 @@ pref("network.http.redirection-limit", 20); // NOTE: support for "compress" has been disabled per bug 196406. // NOTE: separate values with comma+space (", "): see bug 576033 pref("network.http.accept-encoding", "gzip, deflate"); -pref("network.http.accept-encoding.secure", "gzip, deflate, brotli"); +pref("network.http.accept-encoding.secure", "gzip, deflate, br"); pref("network.http.pipelining" , false); pref("network.http.pipelining.ssl" , false); // disable pipelining over SSL diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index 520d143de4b5..c45271bdc0b4 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -443,7 +443,7 @@ nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv); #define UNKNOWN_CONTENT "?from=" UNKNOWN_CONTENT_TYPE "&to=*/*" #define GZIP_TO_UNCOMPRESSED "?from=gzip&to=uncompressed" #define XGZIP_TO_UNCOMPRESSED "?from=x-gzip&to=uncompressed" -#define BROTLI_TO_UNCOMPRESSED "?from=brotli&to=uncompressed" +#define BROTLI_TO_UNCOMPRESSED "?from=br&to=uncompressed" #define COMPRESS_TO_UNCOMPRESSED "?from=compress&to=uncompressed" #define XCOMPRESS_TO_UNCOMPRESSED "?from=x-compress&to=uncompressed" #define DEFLATE_TO_UNCOMPRESSED "?from=deflate&to=uncompressed" diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 53172dbe9dc3..7101a3dfddc1 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -894,7 +894,7 @@ HttpBaseChannel::DoApplyContentConversions(nsIStreamListener* aNextListener, mode = 1; } else if (from.Equals("deflate") || from.Equals("x-deflate")) { mode = 2; - } else if (from.Equals("brotli")) { + } else if (from.Equals("br")) { mode = 3; } Telemetry::Accumulate(Telemetry::HTTP_CONTENT_ENCODING, mode); @@ -1005,7 +1005,7 @@ HttpBaseChannel::nsContentEncodings::GetNext(nsACString& aNextEncoding) if (!haveType) { encoding.BeginReading(start); - if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("brotli"), start, end)) { + if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("br"), start, end)) { aNextEncoding.AssignLiteral(APPLICATION_BROTLI); haveType = true; } diff --git a/netwerk/streamconv/converters/nsHTTPCompressConv.h b/netwerk/streamconv/converters/nsHTTPCompressConv.h index e443f9543128..433f4159ea8c 100644 --- a/netwerk/streamconv/converters/nsHTTPCompressConv.h +++ b/netwerk/streamconv/converters/nsHTTPCompressConv.h @@ -34,7 +34,7 @@ class nsIStringInputStream; #define HTTP_X_GZIP_TYPE "x-gzip" #define HTTP_COMPRESS_TYPE "compress" #define HTTP_X_COMPRESS_TYPE "x-compress" -#define HTTP_BROTLI_TYPE "brotli" +#define HTTP_BROTLI_TYPE "br" #define HTTP_IDENTITY_TYPE "identity" #define HTTP_UNCOMPRESSED_TYPE "uncompressed" diff --git a/netwerk/test/unit/test_content_encoding_gzip.js b/netwerk/test/unit/test_content_encoding_gzip.js index 28cc89774932..e4fe346a7c1f 100644 --- a/netwerk/test/unit/test_content_encoding_gzip.js +++ b/netwerk/test/unit/test_content_encoding_gzip.js @@ -27,7 +27,7 @@ var tests = [ {url: "/test/cebrotli1", flags: CL_EXPECT_GZIP, - ce: "brotli", + ce: "br", body: [0x0B, 0x02, 0x80, 0x74, 0x65, 0x73, 0x74, 0x0A, 0x03], datalen: 5 // the data length of the uncompressed document @@ -36,7 +36,7 @@ var tests = [ // this is not a brotli document {url: "/test/cebrotli2", flags: CL_EXPECT_GZIP | CL_EXPECT_FAILURE, - ce: "brotli", + ce: "br", body: [0x0B, 0x0A, 0x09], datalen: 3 }, @@ -44,7 +44,7 @@ var tests = [ // this is brotli but should come through as identity due to prefs {url: "/test/cebrotli3", flags: 0, - ce: "brotli", + ce: "br", body: [0x0B, 0x02, 0x80, 0x74, 0x65, 0x73, 0x74, 0x0A, 0x03], datalen: 9 @@ -92,7 +92,7 @@ var cePref; function run_test() { prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); cePref = prefs.getCharPref("network.http.accept-encoding"); - prefs.setCharPref("network.http.accept-encoding", "gzip, deflate, brotli"); + prefs.setCharPref("network.http.accept-encoding", "gzip, deflate, br"); httpserver.registerPathHandler("/test/cegzip1", handler); httpserver.registerPathHandler("/test/cegzip2", handler);