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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/ipc/cc_param_traits.h" 5 #include "cc/ipc/cc_param_traits.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 void ParamTraits<cc::BeginFrameAck>::Log(const param_type& p, std::string* l) { 987 void ParamTraits<cc::BeginFrameAck>::Log(const param_type& p, std::string* l) {
988 l->append("("); 988 l->append("(");
989 LogParam(p.sequence_number, l); 989 LogParam(p.sequence_number, l);
990 l->append(", "); 990 l->append(", ");
991 LogParam(p.latest_confirmed_sequence_number, l); 991 LogParam(p.latest_confirmed_sequence_number, l);
992 l->append(", "); 992 l->append(", ");
993 LogParam(p.source_id, l); 993 LogParam(p.source_id, l);
994 l->append(")"); 994 l->append(")");
995 } 995 }
996 996
997 void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::GetSize(
998 base::PickleSizer* s,
999 const param_type& p) {
1000 GetParamSize(s, p.unique_id_hash_code);
1001 }
1002
1003 void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Write(
1004 base::Pickle* m,
1005 const param_type& p) {
1006 m->WriteInt(p.unique_id_hash_code);
1007 }
1008
1009 bool ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Read(
1010 const base::Pickle* m,
1011 base::PickleIterator* iter,
1012 param_type* p) {
1013 int32_t unique_id_hash_code;
1014 if (!iter->ReadInt(&unique_id_hash_code))
1015 return false;
1016 new (p) net::MutableNetworkTrafficAnnotationTag({unique_id_hash_code});
1017 return true;
1018 }
1019
1020 void ParamTraits<net::MutableNetworkTrafficAnnotationTag>::Log(
1021 const param_type& p,
1022 std::string* l) {
1023 l->append("(");
1024 LogParam(p.unique_id_hash_code, l);
1025 l->append(")");
1026 }
1027
1028 void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::GetSize(
1029 base::PickleSizer* s,
1030 const param_type& p) {
1031 GetParamSize(s, p.unique_id_hash_code);
1032 #if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
1033 GetParamSize(s, p.completing_id_hash_code);
1034 #endif
1035 }
1036
1037 void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Write(
1038 base::Pickle* m,
1039 const param_type& p) {
1040 m->WriteInt(p.unique_id_hash_code);
1041
1042 // |completing_id_hash_code| is only stored and needed when DCHECKs are on.
1043 #if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
1044 m->WriteInt(p.completing_id_hash_code);
1045 #endif
1046 }
1047
1048 bool ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Read(
1049 const base::Pickle* m,
1050 base::PickleIterator* iter,
1051 param_type* p) {
1052 int32_t unique_id_hash_code;
1053 if (!iter->ReadInt(&unique_id_hash_code))
1054 return false;
1055 #if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
1056 int32_t completing_id_hash_code;
1057 if (!iter->ReadInt(&completing_id_hash_code))
1058 return false;
1059 new (p) net::MutablePartialNetworkTrafficAnnotationTag(
1060 {unique_id_hash_code, completing_id_hash_code});
1061 #else
1062 new (p) net::MutablePartialNetworkTrafficAnnotationTag({unique_id_hash_code});
1063 #endif
1064
1065 return true;
1066 }
1067
1068 void ParamTraits<net::MutablePartialNetworkTrafficAnnotationTag>::Log(
1069 const param_type& p,
1070 std::string* l) {
1071 l->append("(");
1072 LogParam(p.unique_id_hash_code, l);
1073 #if defined(_DEBUG) || defined(DCHECK_ALWAYS_ON)
1074 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 ", ".
1075 LogParam(p.completing_id_hash_code, l);
1076 #endif
1077 l->append(")");
1078 }
1079
997 } // namespace IPC 1080 } // namespace IPC
998 1081
999 // Generate param traits size methods. 1082 // Generate param traits size methods.
1000 #include "ipc/param_traits_size_macros.h" 1083 #include "ipc/param_traits_size_macros.h"
1001 namespace IPC { 1084 namespace IPC {
1002 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 1085 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
1003 #include "cc/ipc/cc_param_traits_macros.h" 1086 #include "cc/ipc/cc_param_traits_macros.h"
1004 } 1087 }
1005 1088
1006 // Generate param traits write methods. 1089 // Generate param traits write methods.
1007 #include "ipc/param_traits_write_macros.h" 1090 #include "ipc/param_traits_write_macros.h"
1008 namespace IPC { 1091 namespace IPC {
1009 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 1092 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
1010 #include "cc/ipc/cc_param_traits_macros.h" 1093 #include "cc/ipc/cc_param_traits_macros.h"
1011 } // namespace IPC 1094 } // namespace IPC
1012 1095
1013 // Generate param traits read methods. 1096 // Generate param traits read methods.
1014 #include "ipc/param_traits_read_macros.h" 1097 #include "ipc/param_traits_read_macros.h"
1015 namespace IPC { 1098 namespace IPC {
1016 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 1099 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
1017 #include "cc/ipc/cc_param_traits_macros.h" 1100 #include "cc/ipc/cc_param_traits_macros.h"
1018 } // namespace IPC 1101 } // namespace IPC
1019 1102
1020 // Generate param traits log methods. 1103 // Generate param traits log methods.
1021 #include "ipc/param_traits_log_macros.h" 1104 #include "ipc/param_traits_log_macros.h"
1022 namespace IPC { 1105 namespace IPC {
1023 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 1106 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
1024 #include "cc/ipc/cc_param_traits_macros.h" 1107 #include "cc/ipc/cc_param_traits_macros.h"
1025 } // namespace IPC 1108 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698