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

Unified Diff: third_party/WebKit/Source/platform/mojo/GeometryStructTraits.cpp

Issue 2379993003: Mojo C++ bindings: make String16 and gfx::Size available in Blink (Closed)
Patch Set: mapping back to WebSize :( Created 4 years, 2 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: third_party/WebKit/Source/platform/mojo/GeometryStructTraits.cpp
diff --git a/third_party/WebKit/Source/platform/mojo/GeometryStructTraits.cpp b/third_party/WebKit/Source/platform/mojo/GeometryStructTraits.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..21de7c1032e9851dc6b9b8234a26ac75bd2f6c03
--- /dev/null
+++ b/third_party/WebKit/Source/platform/mojo/GeometryStructTraits.cpp
@@ -0,0 +1,20 @@
+// 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.
+
+#include "platform/mojo/GeometryStructTraits.h"
+
+namespace mojo {
+
+// static
+bool StructTraits<gfx::mojom::blink::Size::DataView, ::blink::WebSize>::Read(
+ gfx::mojom::blink::Size::DataView data,
+ ::blink::WebSize* out) {
+ if (data.width() < 0 || data.height() < 0)
+ return false;
+ out->width = data.width();
+ out->height = data.height();
+ return true;
+}
+
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698