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

Side by Side Diff: cc/ipc/copy_output_result_struct_traits.h

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_result.typemap ('k') | cc/ipc/copy_output_result_struct_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ 5 #ifndef CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_
6 #define CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ 6 #define CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_
7 7
8 #include "cc/ipc/copy_output_result.mojom-shared.h" 8 #include "cc/ipc/copy_output_result.mojom-shared.h"
9 #include "cc/ipc/texture_mailbox_struct_traits.h" 9 #include "cc/ipc/texture_mailbox_struct_traits.h"
10 #include "cc/output/copy_output_result.h" 10 #include "cc/output/copy_output_result.h"
11 #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h" 11 #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h"
12 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" 12 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
13 13
14 namespace mojo { 14 namespace mojo {
15 15
16 template <> 16 template <>
17 struct StructTraits<cc::mojom::CopyOutputResultDataView, cc::CopyOutputResult> { 17 struct StructTraits<cc::mojom::CopyOutputResultDataView,
18 static const gfx::Size& size(const cc::CopyOutputResult& result) { 18 std::unique_ptr<cc::CopyOutputResult>> {
19 return result.size_; 19 static const gfx::Size& size(
20 const std::unique_ptr<cc::CopyOutputResult>& result) {
21 return result->size_;
20 } 22 }
21 23
22 static const SkBitmap& bitmap(const cc::CopyOutputResult& result); 24 static const SkBitmap& bitmap(
25 const std::unique_ptr<cc::CopyOutputResult>& result);
23 26
24 static const cc::TextureMailbox& texture_mailbox( 27 static const cc::TextureMailbox& texture_mailbox(
25 const cc::CopyOutputResult& result) { 28 const std::unique_ptr<cc::CopyOutputResult>& result) {
26 return result.texture_mailbox_; 29 return result->texture_mailbox_;
27 } 30 }
28 31
29 static bool Read(cc::mojom::CopyOutputResultDataView data, 32 static bool Read(cc::mojom::CopyOutputResultDataView data,
30 cc::CopyOutputResult* out); 33 std::unique_ptr<cc::CopyOutputResult>* out_p);
31 }; 34 };
32 35
33 } // namespace mojo 36 } // namespace mojo
34 37
35 #endif // CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ 38 #endif // CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « cc/ipc/copy_output_result.typemap ('k') | cc/ipc/copy_output_result_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698