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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothUUIDTraits.h

Issue 2565913002: [Onion Soup] Move WebBluetoothImpl from //content/renderer/bluetooth to Blink's bluetooth module (Closed)
Patch Set: added typemap for Bluetooth uuid on blink side Created 4 years 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: third_party/WebKit/Source/modules/bluetooth/BluetoothUUIDTraits.h
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothUUIDTraits.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothUUIDTraits.h
new file mode 100644
index 0000000000000000000000000000000000000000..c670ebfbb1f2925dc967788c259b9fdc33de9563
--- /dev/null
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothUUIDTraits.h
@@ -0,0 +1,29 @@
+// Copyright 2016 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.
+
+#ifndef BluetoothUUIDTraits_h
+#define BluetoothUUIDTraits_h
+
+#include "device/bluetooth/public/interfaces/uuid.mojom-blink.h"
+#include "wtf/text/WTFString.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<bluetooth::mojom::blink::UUID::DataView, WTF::String> {
+ static const WTF::String& uuid(const WTF::String& input) { return input; }
+
+ static bool Read(bluetooth::mojom::blink::UUID::DataView data,
+ WTF::String* output) {
+ StringDataView view;
+ data.GetUuidDataView(&view);
+ *output = WTF::String(reinterpret_cast<const UChar*>(view.storage()),
dcheng 2016/12/29 08:58:06 Can this just be: return data.ReadUuid(output);
juncai 2016/12/29 22:22:59 Done.
+ view.size());
+ return true;
+ }
+};
+
+} // namespace mojo
+
+#endif // BluetoothUUIDTraits_h

Powered by Google App Engine
This is Rietveld 408576698