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

Unified Diff: third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp

Issue 2383403002: Reflow comments in core/loader (Closed)
Patch Set: yhirano comments Created 4 years, 2 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
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());
« no previous file with comments | « third_party/WebKit/Source/core/loader/ProgressTracker.cpp ('k') | third_party/WebKit/Source/core/loader/TextTrackLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698