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

Side by Side Diff: gpu/ipc/common/mailbox_struct_traits.cc

Issue 2045723002: mojo ArrayTraits<T>::Resize returns bool indicating success (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #include "gpu/ipc/common/mailbox_struct_traits.h" 5 #include "gpu/ipc/common/mailbox_struct_traits.h"
6 6
7 namespace mojo { 7 namespace mojo {
8 8
9 // static 9 // static
10 size_t ArrayTraits<MailboxName>::GetSize(const MailboxName& b) { 10 size_t ArrayTraits<MailboxName>::GetSize(const MailboxName& b) {
(...skipping 14 matching lines...) Expand all
25 int8_t& ArrayTraits<MailboxName>::GetAt(MailboxName& b, size_t i) { 25 int8_t& ArrayTraits<MailboxName>::GetAt(MailboxName& b, size_t i) {
26 return b.data[i]; 26 return b.data[i];
27 } 27 }
28 28
29 // static 29 // static
30 const int8_t& ArrayTraits<MailboxName>::GetAt(const MailboxName& b, size_t i) { 30 const int8_t& ArrayTraits<MailboxName>::GetAt(const MailboxName& b, size_t i) {
31 return b.data[i]; 31 return b.data[i];
32 } 32 }
33 33
34 // static 34 // static
35 void ArrayTraits<MailboxName>::Resize(MailboxName& b, size_t size) { 35 bool ArrayTraits<MailboxName>::Resize(MailboxName& b, size_t size) {
36 DCHECK(GL_MAILBOX_SIZE_CHROMIUM == size); 36 return GL_MAILBOX_SIZE_CHROMIUM == size;
37 } 37 }
38 38
39 // static 39 // static
40 MailboxName StructTraits<gpu::mojom::Mailbox, gpu::Mailbox>::name( 40 MailboxName StructTraits<gpu::mojom::Mailbox, gpu::Mailbox>::name(
41 const gpu::Mailbox& mailbox) { 41 const gpu::Mailbox& mailbox) {
42 MailboxName mailbox_name; 42 MailboxName mailbox_name;
43 mailbox_name.data = const_cast<int8_t*>(&mailbox.name[0]); 43 mailbox_name.data = const_cast<int8_t*>(&mailbox.name[0]);
44 return mailbox_name; 44 return mailbox_name;
45 } 45 }
46 46
47 // static 47 // static
48 bool StructTraits<gpu::mojom::Mailbox, gpu::Mailbox>::Read( 48 bool StructTraits<gpu::mojom::Mailbox, gpu::Mailbox>::Read(
49 gpu::mojom::MailboxDataView data, 49 gpu::mojom::MailboxDataView data,
50 gpu::Mailbox* out) { 50 gpu::Mailbox* out) {
51 MailboxName mailbox_name; 51 MailboxName mailbox_name;
52 mailbox_name.data = &out->name[0]; 52 mailbox_name.data = &out->name[0];
53 return data.ReadName(&mailbox_name); 53 return data.ReadName(&mailbox_name);
54 } 54 }
55 55
56 } // namespace mojo 56 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698