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

Unified Diff: cc/ipc/cc_param_traits.cc

Issue 2893233002: Network traffic annotation added to URLLoaderImpl. (Closed)
Patch Set: Mutable network traffic annotation added. Created 3 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
Index: cc/ipc/cc_param_traits.cc
diff --git a/cc/ipc/cc_param_traits.cc b/cc/ipc/cc_param_traits.cc
index 02483340a769547ea3cf350089b486d832ce4eef..6b49fefa735094f1422141b3c3b990a4137b6e7a 100644
--- a/cc/ipc/cc_param_traits.cc
+++ b/cc/ipc/cc_param_traits.cc
@@ -994,6 +994,89 @@ void ParamTraits<cc::BeginFrameAck>::Log(const param_type& p, std::string* l) {
l->append(")");
}
+void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::GetSize(
+ base::PickleSizer* s,
+ const param_type& p) {
+ GetParamSize(s, p.unique_id_hash_code);
+}
+
+void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Write(
+ base::Pickle* m,
+ const param_type& p) {
+ m->WriteInt(p.unique_id_hash_code);
+}
+
+bool ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Read(
+ const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* p) {
+ int32_t unique_id_hash_code;
+ if (!iter->ReadInt(&unique_id_hash_code))
+ return false;
+ new (p) net::MutableNetworkTrafficAnnotationTag({unique_id_hash_code});
+ return true;
+}
+
+void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Log(
+ const param_type& p,
+ std::string* l) {
+ l->append("(");
+ LogParam(p.unique_id_hash_code, l);
+ l->append(")");
+}
+
+void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::GetSize(
+ base::PickleSizer* s,
+ const param_type& p) {
+ GetParamSize(s, p.unique_id_hash_code);
+#if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
+ GetParamSize(s, p.completing_id_hash_code);
+#endif
+}
+
+void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Write(
+ base::Pickle* m,
+ const param_type& p) {
+ m->WriteInt(p.unique_id_hash_code);
+
+// |completing_id_hash_code| is only stored and needed when DCHECKs are on.
+#if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
+ m->WriteInt(p.completing_id_hash_code);
+#endif
+}
+
+bool ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Read(
+ const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* p) {
+ int32_t unique_id_hash_code;
+ if (!iter->ReadInt(&unique_id_hash_code))
+ return false;
+#if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
+ int32_t completing_id_hash_code;
+ if (!iter->ReadInt(&completing_id_hash_code))
+ return false;
+ new (p) net::MutablePartialNetworkTrafficAnnotationTag(
+ {unique_id_hash_code, completing_id_hash_code});
+#else
+ new (p) net::MutablePartialNetworkTrafficAnnotationTag({unique_id_hash_code});
+#endif
+
+ return true;
+}
+
+void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Log(
+ const param_type& p,
+ std::string* l) {
+ l->append("(");
+ LogParam(p.unique_id_hash_code, l);
+#if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
+ l->append("(");
battre 2017/06/01 12:36:36 drop previous line.
Ramin Halavati 2017/06/01 13:14:27 It had to be a ", ".
+ LogParam(p.completing_id_hash_code, l);
+#endif
+ l->append(")");
+}
+
} // namespace IPC
// Generate param traits size methods.

Powered by Google App Engine
This is Rietveld 408576698