Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |