Changeset 94810 in webkit


Ignore:
Timestamp:
Sep 8, 2011 3:20:39 PM (13 years ago)
Author:
abarth@webkit.org
Message:

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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r94809 r94810  
     12011-09-08  Adam Barth  <abarth@webkit.org>
     2
     3        Inline DocumentWriter::encoding() into it's only caller: deprecatedFrameEncoding()
     4        https://bugs.webkit.org/show_bug.cgi?id=67807
     5
     6        Reviewed by Eric Seidel.
     7
     8        This function is super nutty.  We don't want any more folks to call it
     9        thinking that it does something sane.
     10
     11        * loader/DocumentWriter.cpp:
     12        (WebCore::DocumentWriter::deprecatedFrameEncoding):
     13        * loader/DocumentWriter.h:
     14
    1152011-09-08  Roland Steiner  <rolandsteiner@chromium.org>
    216
  • trunk/Source/WebCore/loader/DocumentWriter.cpp

    r94800 r94810  
    237237}
    238238
    239 String DocumentWriter::encoding() const
    240 {
    241     if (m_encodingWasChosenByUser && !m_encoding.isEmpty())
    242         return m_encoding;
    243     if (m_decoder && m_decoder->encoding().isValid())
    244         return m_decoder->encoding().name();
    245     Settings* settings = m_frame->settings();
    246     return settings ? settings->defaultTextEncodingName() : String();
    247 }
    248 
    249239void DocumentWriter::setEncoding(const String& name, bool userChosen)
    250240{
     
    256246String DocumentWriter::deprecatedFrameEncoding() const
    257247{
    258     return m_frame->document()->url().isEmpty() ? m_encoding : encoding();
     248    if (m_frame->document()->url().isEmpty())
     249        return m_encoding;
     250
     251    if (m_encodingWasChosenByUser && !m_encoding.isEmpty())
     252        return m_encoding;
     253
     254    if (m_decoder && m_decoder->encoding().isValid())
     255        return m_decoder->encoding().name();
     256
     257    Settings* settings = m_frame->settings();
     258    return settings ? settings->defaultTextEncodingName() : String();
    259259}
    260260
  • trunk/Source/WebCore/loader/DocumentWriter.h

    r94800 r94810  
    5858    void setFrame(Frame* frame) { m_frame = frame; }
    5959
    60     String encoding() const;
    6160    void setEncoding(const String& encoding, bool userChosen);
    6261
Note: See TracChangeset for help on using the changeset viewer.