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

Unified Diff: gpu/ipc/gpu_command_buffer_traits.cc

Issue 1548443002: Introducing gpu::CommandBufferId as a distinct, IdType<...>-based type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-save-package-id-self-contained
Patch Set: Rebasing (i.e. had to add GetSize to IPC traits). Created 4 years, 10 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: gpu/ipc/gpu_command_buffer_traits.cc
diff --git a/gpu/ipc/gpu_command_buffer_traits.cc b/gpu/ipc/gpu_command_buffer_traits.cc
index fdf2e15c6c28ac4c251b6ea69315d4ff002a56d3..85a1c8ea6b926e47688d25eb8adcd983ba95d86e 100644
--- a/gpu/ipc/gpu_command_buffer_traits.cc
+++ b/gpu/ipc/gpu_command_buffer_traits.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include "gpu/command_buffer/common/command_buffer_id.h"
#include "gpu/command_buffer/common/mailbox_holder.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "gpu/command_buffer/common/value_state.h"
@@ -95,7 +96,7 @@ bool ParamTraits<gpu::SyncToken>::Read(const base::Pickle* m,
bool verified_flush = false;
gpu::CommandBufferNamespace namespace_id =
gpu::CommandBufferNamespace::INVALID;
- uint64_t command_buffer_id = 0;
+ gpu::CommandBufferId command_buffer_id;
uint64_t release_count = 0;
if (!ReadParam(m, iter, &verified_flush) ||
@@ -116,10 +117,10 @@ bool ParamTraits<gpu::SyncToken>::Read(const base::Pickle* m,
}
void ParamTraits<gpu::SyncToken>::Log(const param_type& p, std::string* l) {
- *l +=
- base::StringPrintf("[%d:%llX] %llu", static_cast<int>(p.namespace_id()),
- static_cast<unsigned long long>(p.command_buffer_id()),
- static_cast<unsigned long long>(p.release_count()));
+ *l += base::StringPrintf(
+ "[%d:%llX] %llu", static_cast<int>(p.namespace_id()),
dcheng 2016/02/12 19:23:17 How about: *l += base::StringPrintf("[%d:" PRIu64
Łukasz Anforowicz 2016/02/12 22:33:24 Done - thanks for catching this. Can you please d
+ static_cast<unsigned long long>(p.command_buffer_id().GetUnsafeValue()),
+ static_cast<unsigned long long>(p.release_count()));
}
void ParamTraits<gpu::Mailbox>::GetSize(base::PickleSizer* s,

Powered by Google App Engine
This is Rietveld 408576698