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

Side by Side Diff: Source/core/loader/TextResourceDecoderBuilder.cpp

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 return TextResourceDecoder::create(m_mimeType, String()); 66 return TextResourceDecoder::create(m_mimeType, String());
67 } 67 }
68 68
69 inline void TextResourceDecoderBuilder::setupEncoding(TextResourceDecoder* decod er, Document* document) 69 inline void TextResourceDecoderBuilder::setupEncoding(TextResourceDecoder* decod er, Document* document)
70 { 70 {
71 LocalFrame* frame = document->frame(); 71 LocalFrame* frame = document->frame();
72 LocalFrame* parentFrame = 0; 72 LocalFrame* parentFrame = 0;
73 if (frame && frame->tree().parent() && frame->tree().parent()->isLocalFrame( )) 73 if (frame && frame->tree().parent() && frame->tree().parent()->isLocalFrame( ))
74 parentFrame = frame->tree().parent(); 74 parentFrame = toLocalFrame(frame->tree().parent());
75 75
76 if (!m_encoding.isEmpty()) 76 if (!m_encoding.isEmpty())
77 decoder->setEncoding(m_encoding.string(), m_encodingWasChosenByUser ? Te xtResourceDecoder::UserChosenEncoding : TextResourceDecoder::EncodingFromHTTPHea der); 77 decoder->setEncoding(m_encoding.string(), m_encodingWasChosenByUser ? Te xtResourceDecoder::UserChosenEncoding : TextResourceDecoder::EncodingFromHTTPHea der);
78 78
79 // Set the hint encoding to the parent frame encoding only if 79 // Set the hint encoding to the parent frame encoding only if
80 // the parent and the current frames share the security origin. 80 // the parent and the current frames share the security origin.
81 // We impose this condition because somebody can make a child frameg63 81 // We impose this condition because somebody can make a child frameg63
82 // containing a carefully crafted html/javascript in one encoding 82 // containing a carefully crafted html/javascript in one encoding
83 // that can be mistaken for hintEncoding (or related encoding) by 83 // that can be mistaken for hintEncoding (or related encoding) by
84 // an auto detector. When interpreted in the latter, it could be 84 // an auto detector. When interpreted in the latter, it could be
(...skipping 16 matching lines...) Expand all
101 return decoder.release(); 101 return decoder.release();
102 } 102 }
103 103
104 void TextResourceDecoderBuilder::clear() 104 void TextResourceDecoderBuilder::clear()
105 { 105 {
106 if (!m_encodingWasChosenByUser) 106 if (!m_encodingWasChosenByUser)
107 m_encoding = nullAtom; 107 m_encoding = nullAtom;
108 } 108 }
109 109
110 } 110 }
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/loader/appcache/ApplicationCacheHost.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698