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

Unified Diff: Source/modules/encoding/TextEncoder.h

Issue 15901002: Implement Encoding API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline webexposed global constructor tests Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/encoding/TextDecoder.idl ('k') | Source/modules/encoding/TextEncoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/encoding/TextEncoder.h
diff --git a/Source/modules/donottrack/NavigatorDoNotTrack.h b/Source/modules/encoding/TextEncoder.h
similarity index 69%
copy from Source/modules/donottrack/NavigatorDoNotTrack.h
copy to Source/modules/encoding/TextEncoder.h
index 0c044e7cd8edef2f8860c374d59f077e1e963816..08199a8a28fbeb407d56e0d153e6d8999b3d9cd5 100644
--- a/Source/modules/donottrack/NavigatorDoNotTrack.h
+++ b/Source/modules/encoding/TextEncoder.h
@@ -28,32 +28,40 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef NavigatorDoNotTrack_h
-#define NavigatorDoNotTrack_h
+#ifndef TextEncoder_h
+#define TextEncoder_h
-#include "core/page/DOMWindowProperty.h"
-#include "core/platform/Supplementable.h"
+#include "wtf/ArrayBufferView.h"
+#include "wtf/RefCounted.h"
+#include "wtf/Uint8Array.h"
+#include "wtf/text/TextCodec.h"
+#include "wtf/text/TextEncoding.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
-class Frame;
-class Navigator;
+class Dictionary;
+class ExceptionState;
-class NavigatorDoNotTrack : public Supplement<Navigator>, public DOMWindowProperty {
+class TextEncoder : public RefCounted<TextEncoder> {
public:
- virtual ~NavigatorDoNotTrack();
- static NavigatorDoNotTrack* from(Navigator*);
+ static PassRefPtr<TextEncoder> create(const String& utfLabel, ExceptionState&);
+ virtual ~TextEncoder();
- static String doNotTrack(Navigator*);
+ // Implement the IDL
+ String encoding() const;
+ PassRefPtr<Uint8Array> encode(const String&, const Dictionary&);
- String doNotTrack();
+ using RefCounted<TextEncoder>::ref;
+ using RefCounted<TextEncoder>::deref;
private:
- explicit NavigatorDoNotTrack(Frame*);
- static const char* supplementName();
+ TextEncoder(const String& encoding);
+
+ WTF::TextEncoding m_encoding;
+ OwnPtr<WTF::TextCodec> m_codec;
};
} // namespace WebCore
-#endif // NavigatorDoNotTrack_h
+#endif // TextEncoder_h
« no previous file with comments | « Source/modules/encoding/TextDecoder.idl ('k') | Source/modules/encoding/TextEncoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698