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/base/net_log.h" | 5 #include "net/base/net_log.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // Parameters for logging data transferred events. Includes bytes transferred | 18 // Parameters for logging data transferred events. Includes bytes transferred |
19 // and, if |bytes| is not NULL, the bytes themselves. | 19 // and, if |bytes| is not NULL, the bytes themselves. |
20 class NetLogBytesTransferredParameter : public NetLog::EventParameters { | 20 class NetLogBytesTransferredParameter : public NetLog::EventParameters { |
21 public: | 21 public: |
22 NetLogBytesTransferredParameter(int byte_count, const char* bytes); | 22 NetLogBytesTransferredParameter(int byte_count, const char* bytes); |
23 | 23 |
24 virtual Value* ToValue() const; | 24 virtual Value* ToValue() const; |
25 | 25 |
26 private: | 26 private: |
| 27 virtual ~NetLogBytesTransferredParameter() {} |
| 28 |
27 const int byte_count_; | 29 const int byte_count_; |
28 std::string hex_encoded_bytes_; | 30 std::string hex_encoded_bytes_; |
29 bool has_bytes_; | 31 bool has_bytes_; |
30 }; | 32 }; |
31 | 33 |
32 NetLogBytesTransferredParameter::NetLogBytesTransferredParameter( | 34 NetLogBytesTransferredParameter::NetLogBytesTransferredParameter( |
33 int byte_count, const char* transferred_bytes) | 35 int byte_count, const char* transferred_bytes) |
34 : byte_count_(byte_count), | 36 : byte_count_(byte_count), |
35 has_bytes_(false) { | 37 has_bytes_(false) { |
36 if (transferred_bytes) { | 38 if (transferred_bytes) { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 const scoped_refptr<NetLog::EventParameters>& end_event_params) { | 330 const scoped_refptr<NetLog::EventParameters>& end_event_params) { |
329 DCHECK(!end_event_params_.get()); | 331 DCHECK(!end_event_params_.get()); |
330 end_event_params_ = end_event_params; | 332 end_event_params_ = end_event_params; |
331 } | 333 } |
332 | 334 |
333 const BoundNetLog& ScopedNetLogEvent::net_log() const { | 335 const BoundNetLog& ScopedNetLogEvent::net_log() const { |
334 return net_log_; | 336 return net_log_; |
335 } | 337 } |
336 | 338 |
337 } // namespace net | 339 } // namespace net |
OLD | NEW |