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

Unified Diff: cc/ipc/cc_param_traits.cc

Issue 1996783002: Make cc::SurfaceId unguessable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ben's comment Created 4 years, 7 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
« no previous file with comments | « cc/ipc/cc_param_traits.h ('k') | cc/ipc/cc_param_traits_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/ipc/cc_param_traits.cc
diff --git a/cc/ipc/cc_param_traits.cc b/cc/ipc/cc_param_traits.cc
index 7c4406bf96f6c73682c4956de17ee5cc792c978c..9caa36f9bd98eb8ca1942737f22b2570937d8656 100644
--- a/cc/ipc/cc_param_traits.cc
+++ b/cc/ipc/cc_param_traits.cc
@@ -19,6 +19,7 @@
#include "cc/quads/surface_draw_quad.h"
#include "cc/quads/tile_draw_quad.h"
#include "cc/quads/yuv_video_draw_quad.h"
+#include "cc/surfaces/surface_id.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkFlattenableSerialization.h"
#include "third_party/skia/include/core/SkImageFilter.h"
@@ -567,6 +568,48 @@ void ParamTraits<cc::RenderPass>::Log(const param_type& p, std::string* l) {
l->append("])");
}
+void ParamTraits<cc::SurfaceId>::GetSize(base::PickleSizer* s,
+ const param_type& p) {
+ GetParamSize(s, p.id_namespace());
+ GetParamSize(s, p.local_id());
+ GetParamSize(s, p.nonce());
+}
+
+void ParamTraits<cc::SurfaceId>::Write(base::Pickle* m, const param_type& p) {
+ WriteParam(m, p.id_namespace());
+ WriteParam(m, p.local_id());
+ WriteParam(m, p.nonce());
+}
+
+bool ParamTraits<cc::SurfaceId>::Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* p) {
+ uint32_t id_namespace;
+ if (!ReadParam(m, iter, &id_namespace))
+ return false;
+
+ uint32_t local_id;
+ if (!ReadParam(m, iter, &local_id))
+ return false;
+
+ uint64_t nonce;
+ if (!ReadParam(m, iter, &nonce))
+ return false;
+
+ *p = cc::SurfaceId(id_namespace, local_id, nonce);
+ return true;
+}
+
+void ParamTraits<cc::SurfaceId>::Log(const param_type& p, std::string* l) {
+ l->append("SurfaceId(");
+ LogParam(p.id_namespace(), l);
+ l->append(", ");
+ LogParam(p.local_id(), l);
+ l->append(", ");
+ LogParam(p.nonce(), l);
+ l->append(")");
+}
+
namespace {
enum CompositorFrameType {
NO_FRAME,
« no previous file with comments | « cc/ipc/cc_param_traits.h ('k') | cc/ipc/cc_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698