| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #ifndef TextEncoder_h | 31 #ifndef TextEncoder_h |
| 32 #define TextEncoder_h | 32 #define TextEncoder_h |
| 33 | 33 |
| 34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
| 35 #include "wtf/ArrayBufferView.h" | 35 #include "wtf/ArrayBufferView.h" |
| 36 #include "wtf/Uint8Array.h" | 36 #include "wtf/Uint8Array.h" |
| 37 #include "wtf/text/TextCodec.h" | 37 #include "wtf/text/TextCodec.h" |
| 38 #include "wtf/text/TextEncoding.h" | 38 #include "wtf/text/TextEncoding.h" |
| 39 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace blink { |
| 42 | 42 |
| 43 class ExceptionState; | 43 class ExceptionState; |
| 44 | 44 |
| 45 class TextEncoder FINAL : public GarbageCollectedFinalized<TextEncoder> { | 45 class TextEncoder FINAL : public GarbageCollectedFinalized<TextEncoder> { |
| 46 public: | 46 public: |
| 47 static TextEncoder* create(const String& utfLabel, ExceptionState&); | 47 static TextEncoder* create(const String& utfLabel, ExceptionState&); |
| 48 ~TextEncoder(); | 48 ~TextEncoder(); |
| 49 | 49 |
| 50 // Implement the IDL | 50 // Implement the IDL |
| 51 String encoding() const; | 51 String encoding() const; |
| 52 PassRefPtr<Uint8Array> encode(const String&); | 52 PassRefPtr<Uint8Array> encode(const String&); |
| 53 | 53 |
| 54 void trace(Visitor*) { } | 54 void trace(Visitor*) { } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 TextEncoder(const WTF::TextEncoding&); | 57 TextEncoder(const WTF::TextEncoding&); |
| 58 | 58 |
| 59 WTF::TextEncoding m_encoding; | 59 WTF::TextEncoding m_encoding; |
| 60 OwnPtr<WTF::TextCodec> m_codec; | 60 OwnPtr<WTF::TextCodec> m_codec; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace WebCore | 63 } // namespace blink |
| 64 | 64 |
| 65 #endif // TextEncoder_h | 65 #endif // TextEncoder_h |
| OLD | NEW |