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

Side by Side Diff: sky/engine/core/html/parser/TextResourceDecoder.cpp

Issue 1215103007: Remove remaining HTML elements (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sky/engine/core/html/parser/TextResourceDecoder.h"
6
7 #include "sky/engine/wtf/text/TextCodec.h"
8 #include "sky/engine/wtf/text/TextEncodingRegistry.h"
9
10 namespace blink {
11
12 TextResourceDecoder::TextResourceDecoder()
13 : m_sawError(false)
14 {
15 }
16
17 TextResourceDecoder::~TextResourceDecoder()
18 {
19 }
20
21 const WTF::TextEncoding& TextResourceDecoder::encoding() const
22 {
23 return WTF::UTF8Encoding();
24 }
25
26 String TextResourceDecoder::decode(const char* data, size_t len)
27 {
28 if (!m_codec)
29 m_codec = newTextCodec(encoding());
30 return m_codec->decode(data, len, WTF::DoNotFlush, false, m_sawError);
31 }
32
33 String TextResourceDecoder::flush()
34 {
35 if (!m_codec)
36 m_codec = newTextCodec(encoding());
37
38 String result = m_codec->decode(0, 0, WTF::FetchEOF, false, m_sawError);
39 m_codec.clear();
40 return result;
41 }
42
43 }
OLDNEW
« no previous file with comments | « sky/engine/core/html/parser/TextResourceDecoder.h ('k') | sky/engine/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698