OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cronet_bidirectional_stream_adapter.h" | 5 #include "cronet_bidirectional_stream_adapter.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 jint http_status_code = 0; | 261 jint http_status_code = 0; |
262 const auto http_status_header = response_headers.find(":status"); | 262 const auto http_status_header = response_headers.find(":status"); |
263 if (http_status_header != response_headers.end()) | 263 if (http_status_header != response_headers.end()) |
264 base::StringToInt(http_status_header->second, &http_status_code); | 264 base::StringToInt(http_status_header->second, &http_status_code); |
265 | 265 |
266 std::string protocol; | 266 std::string protocol; |
267 switch (bidi_stream_->GetProtocol()) { | 267 switch (bidi_stream_->GetProtocol()) { |
268 case net::kProtoHTTP2: | 268 case net::kProtoHTTP2: |
269 protocol = "h2"; | 269 protocol = "h2"; |
270 break; | 270 break; |
271 case net::kProtoQUIC1SPDY3: | 271 case net::kProtoQUIC: |
272 protocol = "quic/1+spdy/3"; | 272 protocol = "quic/1+spdy/3"; |
273 break; | 273 break; |
274 default: | 274 default: |
275 break; | 275 break; |
276 } | 276 } |
277 | 277 |
278 cronet::Java_CronetBidirectionalStream_onResponseHeadersReceived( | 278 cronet::Java_CronetBidirectionalStream_onResponseHeadersReceived( |
279 env, owner_.obj(), http_status_code, | 279 env, owner_.obj(), http_status_code, |
280 ConvertUTF8ToJavaString(env, protocol).obj(), | 280 ConvertUTF8ToJavaString(env, protocol).obj(), |
281 GetHeadersArray(env, response_headers).obj(), | 281 GetHeadersArray(env, response_headers).obj(), |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 start_time), | 470 start_time), |
471 metrics_util::ConvertTime(load_timing_info.receive_headers_end, | 471 metrics_util::ConvertTime(load_timing_info.receive_headers_end, |
472 start_ticks, start_time), | 472 start_ticks, start_time), |
473 metrics_util::ConvertTime(base::TimeTicks::Now(), start_ticks, | 473 metrics_util::ConvertTime(base::TimeTicks::Now(), start_ticks, |
474 start_time), | 474 start_time), |
475 load_timing_info.socket_reused, bidi_stream_->GetTotalSentBytes(), | 475 load_timing_info.socket_reused, bidi_stream_->GetTotalSentBytes(), |
476 bidi_stream_->GetTotalReceivedBytes()); | 476 bidi_stream_->GetTotalReceivedBytes()); |
477 } | 477 } |
478 | 478 |
479 } // namespace cronet | 479 } // namespace cronet |
OLD | NEW |