Commit d5b296c6 authored by abarth@webkit.org's avatar abarth@webkit.org

Inline DocumentWriter::encoding() into it's only caller: deprecatedFrameEncoding()

https://bugs.webkit.org/show_bug.cgi?id=67807

Reviewed by Eric Seidel.

This function is super nutty.  We don't want any more folks to call it
thinking that it does something sane.

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::deprecatedFrameEncoding):
* loader/DocumentWriter.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 16a03c20
2011-09-08 Adam Barth <abarth@webkit.org>
Inline DocumentWriter::encoding() into it's only caller: deprecatedFrameEncoding()
https://bugs.webkit.org/show_bug.cgi?id=67807
Reviewed by Eric Seidel.
This function is super nutty. We don't want any more folks to call it
thinking that it does something sane.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::deprecatedFrameEncoding):
* loader/DocumentWriter.h:
2011-09-08 Roland Steiner <rolandsteiner@chromium.org>
<style scoped>: Add 'scoped' attribute
......@@ -236,16 +236,6 @@ void DocumentWriter::endIfNotLoadingMainResource()
m_parser = 0;
}
String DocumentWriter::encoding() const
{
if (m_encodingWasChosenByUser && !m_encoding.isEmpty())
return m_encoding;
if (m_decoder && m_decoder->encoding().isValid())
return m_decoder->encoding().name();
Settings* settings = m_frame->settings();
return settings ? settings->defaultTextEncodingName() : String();
}
void DocumentWriter::setEncoding(const String& name, bool userChosen)
{
m_frame->loader()->willSetEncoding();
......@@ -255,7 +245,17 @@ void DocumentWriter::setEncoding(const String& name, bool userChosen)
String DocumentWriter::deprecatedFrameEncoding() const
{
return m_frame->document()->url().isEmpty() ? m_encoding : encoding();
if (m_frame->document()->url().isEmpty())
return m_encoding;
if (m_encodingWasChosenByUser && !m_encoding.isEmpty())
return m_encoding;
if (m_decoder && m_decoder->encoding().isValid())
return m_decoder->encoding().name();
Settings* settings = m_frame->settings();
return settings ? settings->defaultTextEncodingName() : String();
}
void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation()
......
......@@ -57,7 +57,6 @@ public:
void setFrame(Frame* frame) { m_frame = frame; }
String encoding() const;
void setEncoding(const String& encoding, bool userChosen);
// FIXME: It's really unforunate to need to expose this piece of state.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment