OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TextResource_h | 5 #ifndef TextResource_h |
6 #define TextResource_h | 6 #define TextResource_h |
7 | 7 |
8 #include "core/fetch/ResourcePtr.h" | 8 #include "core/fetch/ResourcePtr.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class ResourceFetcher; | |
13 class TextResourceDecoder; | 12 class TextResourceDecoder; |
14 | 13 |
15 class TextResource : public Resource { | 14 class TextResource : public Resource { |
16 public: | 15 public: |
17 // Returns the decoded data in text form. The data has to be available at | 16 // Returns the decoded data in text form. The data has to be available at |
18 // call time. | 17 // call time. |
19 String decodedText() const; | 18 String decodedText() const; |
20 | 19 |
21 virtual void setEncoding(const String&) OVERRIDE; | 20 virtual void setEncoding(const String&) OVERRIDE; |
22 virtual String encoding() const OVERRIDE; | 21 virtual String encoding() const OVERRIDE; |
23 | 22 |
24 protected: | 23 protected: |
25 TextResource(const ResourceRequest&, Type, const String& mimeType, const Str
ing& charset); | 24 TextResource(const ResourceRequest&, Type, const String& mimeType, const Str
ing& charset); |
26 virtual ~TextResource(); | 25 virtual ~TextResource(); |
27 | 26 |
28 private: | 27 private: |
29 OwnPtr<TextResourceDecoder> m_decoder; | 28 OwnPtr<TextResourceDecoder> m_decoder; |
30 }; | 29 }; |
31 | 30 |
32 } | 31 } |
33 | 32 |
34 #endif // TextResource_h | 33 #endif // TextResource_h |
OLD | NEW |