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 "net/http/bidirectional_stream.h" | 5 #include "net/http/bidirectional_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "net/ssl/ssl_config.h" | 32 #include "net/ssl/ssl_config.h" |
33 #include "url/gurl.h" | 33 #include "url/gurl.h" |
34 | 34 |
35 namespace net { | 35 namespace net { |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
39 std::unique_ptr<base::Value> NetLogHeadersCallback( | 39 std::unique_ptr<base::Value> NetLogHeadersCallback( |
40 const SpdyHeaderBlock* headers, | 40 const SpdyHeaderBlock* headers, |
41 NetLogCaptureMode capture_mode) { | 41 NetLogCaptureMode capture_mode) { |
42 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 42 auto dict = base::MakeUnique<base::DictionaryValue>(); |
43 dict->Set("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode)); | 43 dict->Set("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode)); |
44 return std::move(dict); | 44 return std::move(dict); |
45 } | 45 } |
46 | 46 |
47 std::unique_ptr<base::Value> NetLogCallback(const GURL* url, | 47 std::unique_ptr<base::Value> NetLogCallback(const GURL* url, |
48 const std::string* method, | 48 const std::string* method, |
49 const HttpRequestHeaders* headers, | 49 const HttpRequestHeaders* headers, |
50 NetLogCaptureMode capture_mode) { | 50 NetLogCaptureMode capture_mode) { |
51 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 51 auto dict = base::MakeUnique<base::DictionaryValue>(); |
52 dict->SetString("url", url->possibly_invalid_spec()); | 52 dict->SetString("url", url->possibly_invalid_spec()); |
53 dict->SetString("method", *method); | 53 dict->SetString("method", *method); |
54 std::string empty; | 54 std::string empty; |
55 std::unique_ptr<base::Value> headers_param( | 55 std::unique_ptr<base::Value> headers_param( |
56 headers->NetLogCallback(&empty, capture_mode)); | 56 headers->NetLogCallback(&empty, capture_mode)); |
57 dict->Set("headers", std::move(headers_param)); | 57 dict->Set("headers", std::move(headers_param)); |
58 return std::move(dict); | 58 return std::move(dict); |
59 } | 59 } |
60 | 60 |
61 } // namespace | 61 } // namespace |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 "Net.BidirectionalStream.TimeToSendEnd.QUIC", | 442 "Net.BidirectionalStream.TimeToSendEnd.QUIC", |
443 load_timing_info_.send_end - load_timing_info_.request_start); | 443 load_timing_info_.send_end - load_timing_info_.request_start); |
444 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.ReceivedBytes.QUIC", | 444 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.ReceivedBytes.QUIC", |
445 stream_impl_->GetTotalReceivedBytes()); | 445 stream_impl_->GetTotalReceivedBytes()); |
446 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.SentBytes.QUIC", | 446 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.SentBytes.QUIC", |
447 stream_impl_->GetTotalSentBytes()); | 447 stream_impl_->GetTotalSentBytes()); |
448 } | 448 } |
449 } | 449 } |
450 | 450 |
451 } // namespace net | 451 } // namespace net |
OLD | NEW |