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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « cc/ipc/copy_output_request_struct_traits.h ('k') | cc/ipc/copy_output_result.typemap » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/ipc/copy_output_request_struct_traits.h"
6
7 namespace mojo {
8
9 // static
10 bool StructTraits<cc::mojom::CopyOutputRequestDataView,
11 std::unique_ptr<cc::CopyOutputRequest>>::
12 Read(cc::mojom::CopyOutputRequestDataView data,
13 std::unique_ptr<cc::CopyOutputRequest>* out_p) {
14 auto request = cc::CopyOutputRequest::CreateEmptyRequest();
15
16 request->force_bitmap_result_ = data.force_bitmap_result();
17
18 if (!data.ReadSource(&request->source_))
19 return false;
20
21 if (!data.ReadArea(&request->area_))
22 return false;
23
24 if (!data.ReadTextureMailbox(&request->texture_mailbox_))
25 return false;
26
27 *out_p = std::move(request);
28
29 return true;
30 }
31
32 } // namespace mojo
OLDNEW
« no previous file with comments | « cc/ipc/copy_output_request_struct_traits.h ('k') | cc/ipc/copy_output_result.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698