Title: [94810] trunk/Source/WebCore
- Revision
- 94810
- Author
- [email protected]
- Date
- 2011-09-08 15:20:39 -0700 (Thu, 08 Sep 2011)
Log 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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (94809 => 94810)
--- trunk/Source/WebCore/ChangeLog 2011-09-08 22:17:34 UTC (rev 94809)
+++ trunk/Source/WebCore/ChangeLog 2011-09-08 22:20:39 UTC (rev 94810)
@@ -1,3 +1,17 @@
+2011-09-08 Adam Barth <[email protected]>
+
+ 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 <[email protected]>
<style scoped>: Add 'scoped' attribute
Modified: trunk/Source/WebCore/loader/DocumentWriter.cpp (94809 => 94810)
--- trunk/Source/WebCore/loader/DocumentWriter.cpp 2011-09-08 22:17:34 UTC (rev 94809)
+++ trunk/Source/WebCore/loader/DocumentWriter.cpp 2011-09-08 22:20:39 UTC (rev 94810)
@@ -236,16 +236,6 @@
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 @@
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()
Modified: trunk/Source/WebCore/loader/DocumentWriter.h (94809 => 94810)
--- trunk/Source/WebCore/loader/DocumentWriter.h 2011-09-08 22:17:34 UTC (rev 94809)
+++ trunk/Source/WebCore/loader/DocumentWriter.h 2011-09-08 22:20:39 UTC (rev 94810)
@@ -57,7 +57,6 @@
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.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes