Index: third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp |
diff --git a/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp b/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp |
index 890bcfff476b071a1ff9f4added3b6ca16b3464a..fa72e6b21a6a4bb330adaf4f6c4365516788598c 100644 |
--- a/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp |
+++ b/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp |
@@ -101,7 +101,8 @@ TextResourceDecoderBuilder::createDecoderInstance(Document* document) { |
getEncodingFromDomain(document->url()); |
if (LocalFrame* frame = document->frame()) { |
if (Settings* settings = frame->settings()) { |
- // Disable autodetection for XML to honor the default encoding (UTF-8) for unlabelled documents. |
+ // Disable autodetection for XML to honor the default encoding (UTF-8) for |
+ // unlabelled documents. |
return TextResourceDecoder::create( |
m_mimeType, |
encodingFromDomain.isValid() ? encodingFromDomain |
@@ -125,15 +126,14 @@ inline void TextResourceDecoderBuilder::setupEncoding( |
decoder->setEncoding(m_encoding.getString(), |
TextResourceDecoder::EncodingFromHTTPHeader); |
- // Set the hint encoding to the parent frame encoding only if |
- // the parent and the current frames share the security origin. |
- // We impose this condition because somebody can make a child frameg63 |
- // containing a carefully crafted html/javascript in one encoding |
- // that can be mistaken for hintEncoding (or related encoding) by |
- // an auto detector. When interpreted in the latter, it could be |
- // an attack vector. |
- // FIXME: This might be too cautious for non-7bit-encodings and |
- // we may consider relaxing this later after testing. |
+ // Set the hint encoding to the parent frame encoding only if the parent and |
+ // the current frames share the security origin. We impose this condition |
+ // because somebody can make a child frameg63 containing a carefully crafted |
+ // html/javascript in one encoding that can be mistaken for hintEncoding (or |
+ // related encoding) by an auto detector. When interpreted in the latter, it |
+ // could be an attack vector. |
+ // FIXME: This might be too cautious for non-7bit-encodings and we may |
+ // consider relaxing this later after testing. |
if (frame && canReferToParentFrameEncoding(frame, parentFrame)) { |
if (parentFrame->document()->encodingWasDetectedHeuristically()) |
decoder->setHintEncoding(parentFrame->document()->encoding()); |