| OLD | NEW |
| 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 "net/quic/quic_chromium_client_session.h" | 5 #include "net/quic/quic_chromium_client_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 124 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 125 dict->SetString("host", server_id->host()); | 125 dict->SetString("host", server_id->host()); |
| 126 dict->SetInteger("port", server_id->port()); | 126 dict->SetInteger("port", server_id->port()); |
| 127 dict->SetBoolean("privacy_mode", | 127 dict->SetBoolean("privacy_mode", |
| 128 server_id->privacy_mode() == PRIVACY_MODE_ENABLED); | 128 server_id->privacy_mode() == PRIVACY_MODE_ENABLED); |
| 129 dict->SetBoolean("require_confirmation", require_confirmation); | 129 dict->SetBoolean("require_confirmation", require_confirmation); |
| 130 dict->SetInteger("cert_verify_flags", cert_verify_flags); | 130 dict->SetInteger("cert_verify_flags", cert_verify_flags); |
| 131 return std::move(dict); | 131 return std::move(dict); |
| 132 } | 132 } |
| 133 | 133 |
| 134 std::unique_ptr<base::ListValue> SpdyHeaderBlockToListValue( | |
| 135 const SpdyHeaderBlock& headers, | |
| 136 NetLogCaptureMode capture_mode) { | |
| 137 std::unique_ptr<base::ListValue> headers_list(new base::ListValue()); | |
| 138 for (const auto& it : headers) { | |
| 139 headers_list->AppendString( | |
| 140 it.first.as_string() + ": " + | |
| 141 ElideHeaderValueForNetLog(capture_mode, it.first.as_string(), | |
| 142 it.second.as_string())); | |
| 143 } | |
| 144 return headers_list; | |
| 145 } | |
| 146 | |
| 147 std::unique_ptr<base::Value> NetLogQuicPushPromiseReceivedCallback( | 134 std::unique_ptr<base::Value> NetLogQuicPushPromiseReceivedCallback( |
| 148 const SpdyHeaderBlock* headers, | 135 const SpdyHeaderBlock* headers, |
| 149 SpdyStreamId stream_id, | 136 SpdyStreamId stream_id, |
| 150 SpdyStreamId promised_stream_id, | 137 SpdyStreamId promised_stream_id, |
| 151 NetLogCaptureMode capture_mode) { | 138 NetLogCaptureMode capture_mode) { |
| 152 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 139 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 153 dict->Set("headers", SpdyHeaderBlockToListValue(*headers, capture_mode)); | 140 dict->Set("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode)); |
| 154 dict->SetInteger("id", stream_id); | 141 dict->SetInteger("id", stream_id); |
| 155 dict->SetInteger("promised_stream_id", promised_stream_id); | 142 dict->SetInteger("promised_stream_id", promised_stream_id); |
| 156 return std::move(dict); | 143 return std::move(dict); |
| 157 } | 144 } |
| 158 | 145 |
| 159 } // namespace | 146 } // namespace |
| 160 | 147 |
| 161 QuicChromiumClientSession::StreamRequest::StreamRequest() : stream_(nullptr) {} | 148 QuicChromiumClientSession::StreamRequest::StreamRequest() : stream_(nullptr) {} |
| 162 | 149 |
| 163 QuicChromiumClientSession::StreamRequest::~StreamRequest() { | 150 QuicChromiumClientSession::StreamRequest::~StreamRequest() { |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 } | 1175 } |
| 1189 | 1176 |
| 1190 void QuicChromiumClientSession::DeletePromised( | 1177 void QuicChromiumClientSession::DeletePromised( |
| 1191 QuicClientPromisedInfo* promised) { | 1178 QuicClientPromisedInfo* promised) { |
| 1192 if (IsOpenStream(promised->id())) | 1179 if (IsOpenStream(promised->id())) |
| 1193 streams_pushed_and_claimed_count_++; | 1180 streams_pushed_and_claimed_count_++; |
| 1194 QuicClientSessionBase::DeletePromised(promised); | 1181 QuicClientSessionBase::DeletePromised(promised); |
| 1195 } | 1182 } |
| 1196 | 1183 |
| 1197 } // namespace net | 1184 } // namespace net |
| OLD | NEW |