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 protected: |
| 27 virtual ~NetLogBytesTransferredParameter() {} |
| 28 |
26 private: | 29 private: |
27 const int byte_count_; | 30 const int byte_count_; |
28 std::string hex_encoded_bytes_; | 31 std::string hex_encoded_bytes_; |
29 bool has_bytes_; | 32 bool has_bytes_; |
30 }; | 33 }; |
31 | 34 |
32 NetLogBytesTransferredParameter::NetLogBytesTransferredParameter( | 35 NetLogBytesTransferredParameter::NetLogBytesTransferredParameter( |
33 int byte_count, const char* transferred_bytes) | 36 int byte_count, const char* transferred_bytes) |
34 : byte_count_(byte_count), | 37 : byte_count_(byte_count), |
35 has_bytes_(false) { | 38 has_bytes_(false) { |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 const scoped_refptr<NetLog::EventParameters>& end_event_params) { | 331 const scoped_refptr<NetLog::EventParameters>& end_event_params) { |
329 DCHECK(!end_event_params_.get()); | 332 DCHECK(!end_event_params_.get()); |
330 end_event_params_ = end_event_params; | 333 end_event_params_ = end_event_params; |
331 } | 334 } |
332 | 335 |
333 const BoundNetLog& ScopedNetLogEvent::net_log() const { | 336 const BoundNetLog& ScopedNetLogEvent::net_log() const { |
334 return net_log_; | 337 return net_log_; |
335 } | 338 } |
336 | 339 |
337 } // namespace net | 340 } // namespace net |
OLD | NEW |