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

Unified Diff: cc/ipc/copy_output_request_struct_traits.h

Issue 2655963006: Implemented StructTraits for cc::CopyOutputRequest (Closed)
Patch Set: c Created 3 years, 11 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 | « cc/ipc/copy_output_request.typemap ('k') | cc/ipc/struct_traits_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/ipc/copy_output_request_struct_traits.h
diff --git a/cc/ipc/copy_output_request_struct_traits.h b/cc/ipc/copy_output_request_struct_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..c05c55ccc5c3d1d10edf908ca81e4d10c80511f0
--- /dev/null
+++ b/cc/ipc/copy_output_request_struct_traits.h
@@ -0,0 +1,45 @@
+// Copyright 2017 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 CC_IPC_COPY_OUTPUT_REQUEST_STRUCT_TRAITS_H_
+#define CC_IPC_COPY_OUTPUT_REQUEST_STRUCT_TRAITS_H_
+
+#include "cc/ipc/copy_output_request.mojom-shared.h"
+#include "cc/output/copy_output_request.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<cc::mojom::CopyOutputRequestDataView,
+ cc::CopyOutputRequest> {
+ static const base::Optional<base::UnguessableToken>& source(
+ const cc::CopyOutputRequest& request) {
+ return request.source_;
+ }
+
+ static bool force_bitmap_result(const cc::CopyOutputRequest& request) {
+ return request.force_bitmap_result_;
+ }
+
+ static const base::Optional<gfx::Rect>& area(
+ const cc::CopyOutputRequest& request) {
+ return request.area_;
+ }
+
+ static const base::Optional<cc::TextureMailbox>& texture_mailbox(
+ const cc::CopyOutputRequest& request) {
+ return request.texture_mailbox_;
+ }
+
+ static bool Read(cc::mojom::CopyOutputRequestDataView data,
+ cc::CopyOutputRequest* out) {
+ out->force_bitmap_result_ = data.force_bitmap_result();
+ return data.ReadSource(&out->source_) && data.ReadArea(&out->area_) &&
+ data.ReadTextureMailbox(&out->texture_mailbox_);
+ }
+};
+
+} // namespace mojo
+
+#endif // CC_IPC_COPY_OUTPUT_REQUEST_STRUCT_TRAITS_H_
« no previous file with comments | « cc/ipc/copy_output_request.typemap ('k') | cc/ipc/struct_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698