Chromium Code Reviews| Index: cc/ipc/surface_id_struct_traits.h |
| diff --git a/cc/ipc/surface_id_struct_traits.h b/cc/ipc/surface_id_struct_traits.h |
| index 0600120979b9f0f056a0d62d720daca7e3f3cb99..94c4d9136b0bec5d5155b5dd23330f39b2aa1cfc 100644 |
| --- a/cc/ipc/surface_id_struct_traits.h |
| +++ b/cc/ipc/surface_id_struct_traits.h |
| @@ -7,6 +7,7 @@ |
| #include "cc/ipc/surface_id.mojom-shared.h" |
| #include "cc/surfaces/surface_id.h" |
| +#include "mojo/common/common_custom_types_struct_traits.h" |
| namespace mojo { |
| @@ -16,10 +17,15 @@ struct StructTraits<cc::mojom::SurfaceIdDataView, cc::SurfaceId> { |
| static uint32_t local_id(const cc::SurfaceId& id) { return id.local_id(); } |
| - static uint64_t nonce(const cc::SurfaceId& id) { return id.nonce(); } |
| + static base::UnguessableToken nonce(const cc::SurfaceId& id) { |
|
Fady Samuel
2016/09/30 20:30:41
const base::UnguessableToken&
Alex Z.
2016/10/05 18:10:45
Done.
|
| + return id.nonce(); |
| + } |
| static bool Read(cc::mojom::SurfaceIdDataView data, cc::SurfaceId* out) { |
| - *out = cc::SurfaceId(data.client_id(), data.local_id(), data.nonce()); |
| + base::UnguessableToken nonce; |
| + if (!data.ReadNonce(&nonce)) |
| + return false; |
| + *out = cc::SurfaceId(data.client_id(), data.local_id(), nonce); |
| return true; |
| } |
| }; |