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

Unified Diff: cc/ipc/copy_output_request_struct_traits.cc

Issue 2670213006: Mojom structs for copy requests / results should map to unique_ptr (Closed)
Patch Set: c Created 3 years, 10 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: cc/ipc/copy_output_request_struct_traits.cc
diff --git a/cc/ipc/copy_output_request_struct_traits.cc b/cc/ipc/copy_output_request_struct_traits.cc
new file mode 100644
index 0000000000000000000000000000000000000000..246f73f43625c7c16473e2288398cf36bcf2f54e
--- /dev/null
+++ b/cc/ipc/copy_output_request_struct_traits.cc
@@ -0,0 +1,21 @@
+// 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.
+
+#include "cc/ipc/copy_output_request_struct_traits.h"
+
+namespace mojo {
+
+// static
+bool StructTraits<cc::mojom::CopyOutputRequestDataView,
+ std::unique_ptr<cc::CopyOutputRequest>>::
+ Read(cc::mojom::CopyOutputRequestDataView data,
+ std::unique_ptr<cc::CopyOutputRequest>* out_p) {
+ std::unique_ptr<cc::CopyOutputRequest>& out = *out_p;
+ out = cc::CopyOutputRequest::CreateEmptyRequest();
+ out->force_bitmap_result_ = data.force_bitmap_result();
+ return data.ReadSource(&out->source_) && data.ReadArea(&out->area_) &&
Tom Sepez 2017/02/04 00:32:14 I suppose it's ok to short-circuit here, the calle
Saman Sami 2017/02/04 01:09:25 Good idea. It'll make the code cleaner too. Here i
+ data.ReadTextureMailbox(&out->texture_mailbox_);
+}
+
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698