| Index: third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp
|
| diff --git a/third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp b/third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp
|
| index 0df2c620e0fe2dd69f41e41fe1c65baf678adc55..e4ae3835df19017afbe2066840e16b9e7380959c 100644
|
| --- a/third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp
|
| +++ b/third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp
|
| @@ -39,7 +39,7 @@ namespace blink {
|
| bool detectTextEncoding(const char* data,
|
| size_t length,
|
| const char* hintEncodingName,
|
| - const char* hintUrl,
|
| + const KURL* hintUrl,
|
| const char* hintUserLanguage,
|
| WTF::TextEncoding* detectedEncoding) {
|
| *detectedEncoding = WTF::TextEncoding();
|
| @@ -48,8 +48,8 @@ bool detectTextEncoding(const char* data,
|
| int consumedBytes;
|
| bool isReliable;
|
| Encoding encoding = CompactEncDet::DetectEncoding(
|
| - data, length, hintUrl, nullptr, nullptr,
|
| - EncodingNameAliasToEncoding(hintEncodingName), language,
|
| + data, length, hintUrl ? hintUrl->getString().ascii().data() : nullptr,
|
| + nullptr, nullptr, EncodingNameAliasToEncoding(hintEncodingName), language,
|
| CompactEncDet::WEB_CORPUS,
|
| false, // Include 7-bit encodings to detect ISO-2022-JP
|
| &consumedBytes, &isReliable);
|
| @@ -61,7 +61,7 @@ bool detectTextEncoding(const char* data,
|
| // be applied to local file resources).
|
| // Detection failure leads |TextResourceDecoder| to use its default encoding
|
| // determined from system locale or TLD.
|
| - String protocol = hintUrl ? KURL(ParsedURLString, hintUrl).protocol() : "";
|
| + String protocol = hintUrl ? hintUrl->protocol() : "";
|
| if (encoding == UNKNOWN_ENCODING || (protocol != "file" && encoding == UTF8))
|
| return false;
|
|
|
|
|