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

Side by Side Diff: cc/ipc/single_release_callback_struct_traits.cc

Issue 2686833003: CopyOutputResult must have a working release callback when received over mojo (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/single_release_callback_struct_traits.h ('k') | cc/ipc/struct_traits_unittest.cc » ('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 2016 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/single_release_callback_struct_traits.h"
6 #include "cc/ipc/texture_mailbox_releaser.mojom.h"
7
8 namespace mojo {
9
10 // static
11 cc::mojom::TextureMailboxReleaserPtr
12 StructTraits<cc::mojom::SingleReleaseCallbackDataView,
13 std::unique_ptr<cc::SingleReleaseCallback>>::
14 releaser(const std::unique_ptr<cc::SingleReleaseCallback>& callback) {
15 auto result = callback->ptr_holder_->TakePtr();
danakj 2017/02/08 23:24:17 It seems like we're being tied to the c++ types to
Saman Sami 2017/02/09 16:30:01 In struct traits, when serializing, a mojo pointer
Saman Sami 2017/02/09 16:52:25 However, note that having a method like TakePtr th
16 callback->ptr_holder_.reset();
17 return result;
18 }
19
20 // static
21 bool StructTraits<cc::mojom::SingleReleaseCallbackDataView,
22 std::unique_ptr<cc::SingleReleaseCallback>>::
23 Read(cc::mojom::SingleReleaseCallbackDataView data,
24 std::unique_ptr<cc::SingleReleaseCallback>* out) {
25 auto releaser = data.TakeReleaser<cc::mojom::TextureMailboxReleaserPtr>();
26 *out = cc::SingleReleaseCallback::Create(std::move(releaser));
27 return true;
28 }
29
30 } // namespace mojo
OLDNEW
« no previous file with comments | « cc/ipc/single_release_callback_struct_traits.h ('k') | cc/ipc/struct_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698