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

Unified Diff: mojo/services/html_viewer/blink_basic_type_converters.cc

Issue 540683002: Mojo: Implement the rest of the WebSocket interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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
Index: mojo/services/html_viewer/blink_basic_type_converters.cc
diff --git a/mojo/services/html_viewer/blink_basic_type_converters.cc b/mojo/services/html_viewer/blink_basic_type_converters.cc
new file mode 100644
index 0000000000000000000000000000000000000000..23b9e5f2ddddcb432b433424467749bb545d5b97
--- /dev/null
+++ b/mojo/services/html_viewer/blink_basic_type_converters.cc
@@ -0,0 +1,24 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/html_viewer/blink_basic_type_converters.h"
+
+#include "mojo/public/cpp/bindings/string.h"
+#include "third_party/WebKit/public/platform/WebString.h"
+
+using blink::WebString;
+
+namespace mojo {
+
+// static
+String TypeConverter<String, WebString>::Convert(const WebString& str) {
+ return String(str.utf8());
+}
+
+// static
+WebString TypeConverter<WebString, String>::Convert(const String& str) {
+ return WebString::fromUTF8(str.get());
+}
+
+} // namespace mojo
« no previous file with comments | « mojo/services/html_viewer/blink_basic_type_converters.h ('k') | mojo/services/html_viewer/websockethandle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698