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

Unified Diff: cc/ipc/surface_id_struct_traits.h

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
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;
}
};
« no previous file with comments | « cc/ipc/surface_id.mojom ('k') | cc/surfaces/surface_id.h » ('j') | cc/surfaces/surface_id.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698