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

Unified Diff: ui/gfx/mojo/icc_profile_struct_traits.cc

Issue 2381493003: Move ViewMsg_New to mojom (Closed)
Patch Set: . Created 4 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: ui/gfx/mojo/icc_profile_struct_traits.cc
diff --git a/ui/gfx/mojo/icc_profile_struct_traits.cc b/ui/gfx/mojo/icc_profile_struct_traits.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eb541e60372916265b4d8f82ebe805b64a841358
--- /dev/null
+++ b/ui/gfx/mojo/icc_profile_struct_traits.cc
@@ -0,0 +1,26 @@
+// 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 <algorithm>
+
+#include "ui/gfx/mojo/icc_profile_struct_traits.h"
+
+namespace mojo {
+
+// static
+bool StructTraits<gfx::mojom::ICCProfileDataView, gfx::ICCProfile>::Read(
+ gfx::mojom::ICCProfileDataView data,
+ gfx::ICCProfile* out) {
+ out->valid_ = data.valid();
+ out->id_ = data.id();
+
+ std::vector<int8_t> bytes;
+ if (!data.ReadData(&bytes))
+ return false;
+
+ std::copy(bytes.begin(), bytes.end(), out->data_.begin());
+ return true;
+}
+
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698