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

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

Issue 22909053: Store the Document's encoding on the Document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010. Adam Barth. All rights reserved. 2 * Copyright (C) 2010. Adam Barth. 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 parser->pinToMainThread(); 80 parser->pinToMainThread();
81 // Because we're pinned to the main thread we don't need to worry about 81 // Because we're pinned to the main thread we don't need to worry about
82 // passing ownership of the source string. 82 // passing ownership of the source string.
83 parser->append(source.impl()); 83 parser->append(source.impl());
84 } 84 }
85 } 85 }
86 86
87 void DocumentWriter::reportDataReceived() 87 void DocumentWriter::reportDataReceived()
88 { 88 {
89 ASSERT(m_decoder); 89 ASSERT(m_decoder);
90 m_document->setEncoding(m_decoder->encoding());
90 if (m_hasReceivedSomeData) 91 if (m_hasReceivedSomeData)
91 return; 92 return;
92 m_hasReceivedSomeData = true; 93 m_hasReceivedSomeData = true;
93 if (m_decoder->encoding().usesVisualOrdering()) 94 if (m_decoder->encoding().usesVisualOrdering())
94 m_document->setVisuallyOrdered(); 95 m_document->setVisuallyOrdered();
95 } 96 }
96 97
97 void DocumentWriter::addData(const char* bytes, size_t length) 98 void DocumentWriter::addData(const char* bytes, size_t length)
98 { 99 {
99 ASSERT(m_parser); 100 ASSERT(m_parser);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 m_document = 0; 134 m_document = 0;
134 } 135 }
135 136
136 void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation() 137 void DocumentWriter::setDocumentWasLoadedAsPartOfNavigation()
137 { 138 {
138 ASSERT(m_parser && !m_parser->isStopped()); 139 ASSERT(m_parser && !m_parser->isStopped());
139 m_parser->setDocumentWasLoadedAsPartOfNavigation(); 140 m_parser->setDocumentWasLoadedAsPartOfNavigation();
140 } 141 }
141 142
142 } // namespace WebCore 143 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698