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

Unified Diff: chrome/common/cast_messages.cc

Issue 1515433002: Replace uses of raw uint32's with a type-checked RtpTimeTicks data type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed mkwst's comments, plus REBASE. Created 5 years 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: chrome/common/cast_messages.cc
diff --git a/chrome/common/cast_messages.cc b/chrome/common/cast_messages.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a67c4b59d2bb30b2890a1dae511fed7a0dd68927
--- /dev/null
+++ b/chrome/common/cast_messages.cc
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/cast_messages.h"
+
+namespace IPC {
+
+void ParamTraits<media::cast::RtpTimeTicks>::Write(Message* m,
+ const param_type& p) {
+ ParamTraits<uint64_t>::Write(m, p.SerializeForIPC());
+}
+
+bool ParamTraits<media::cast::RtpTimeTicks>::Read(
+ const Message* m, base::PickleIterator* iter, param_type* r) {
+ uint64_t serialized = UINT64_C(0);
+ if (ParamTraits<uint64_t>::Read(m, iter, &serialized)) {
+ *r = param_type::DeserializeForIPC(serialized);
+ return true;
+ }
+ return false;
+}
+
+void ParamTraits<media::cast::RtpTimeTicks>::Log(const param_type& p,
+ std::string* l) {
+ std::ostringstream oss;
+ oss << p;
+ l->append(oss.str());
+}
+
+} // namespace IPC

Powered by Google App Engine
This is Rietveld 408576698