| 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/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/fetch/Resource.h" | 9 #include "core/fetch/Resource.h" |
| 10 #include <memory> | |
| 11 | 10 |
| 12 namespace blink { | 11 namespace blink { |
| 13 | 12 |
| 14 class TextResourceDecoder; | 13 class TextResourceDecoder; |
| 15 | 14 |
| 16 class CORE_EXPORT TextResource : public Resource { | 15 class CORE_EXPORT TextResource : public Resource { |
| 17 public: | 16 public: |
| 18 // Returns the decoded data in text form. The data has to be available at | 17 // Returns the decoded data in text form. The data has to be available at |
| 19 // call time. | 18 // call time. |
| 20 String decodedText() const; | 19 String decodedText() const; |
| 21 | 20 |
| 22 void setEncoding(const String&) override; | 21 void setEncoding(const String&) override; |
| 23 String encoding() const override; | 22 String encoding() const override; |
| 24 | 23 |
| 25 protected: | 24 protected: |
| 26 TextResource(const ResourceRequest&, Type, const ResourceLoaderOptions&, con
st String& mimeType, const String& charset); | 25 TextResource(const ResourceRequest&, Type, const ResourceLoaderOptions&, con
st String& mimeType, const String& charset); |
| 27 ~TextResource() override; | 26 ~TextResource() override; |
| 28 | 27 |
| 29 private: | 28 private: |
| 30 std::unique_ptr<TextResourceDecoder> m_decoder; | 29 OwnPtr<TextResourceDecoder> m_decoder; |
| 31 }; | 30 }; |
| 32 | 31 |
| 33 } // namespace blink | 32 } // namespace blink |
| 34 | 33 |
| 35 #endif // TextResource_h | 34 #endif // TextResource_h |
| OLD | NEW |