OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_UDP_UDP_DATA_TRANSFER_PARAM_H_ | 5 #ifndef NET_UDP_UDP_DATA_TRANSFER_PARAM_H_ |
6 #define NET_UDP_UDP_DATA_TRANSFER_PARAM_H_ | 6 #define NET_UDP_UDP_DATA_TRANSFER_PARAM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "net/base/net_log.h" | 13 #include "net/base/net_log.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 | 16 |
17 class IPEndPoint; | 17 class IPEndPoint; |
18 | 18 |
19 // NetLog parameter to describe a UDP receive/send event. Each event has a | 19 // NetLog parameter to describe a UDP receive/send event. Each event has a |
20 // byte count, and may optionally have transferred bytes and an IPEndPoint as | 20 // byte count, and may optionally have transferred bytes and an IPEndPoint as |
21 // well. | 21 // well. |
22 class UDPDataTransferNetLogParam : public NetLog::EventParameters { | 22 class UDPDataTransferNetLogParam : public NetLog::EventParameters { |
23 public: | 23 public: |
24 // |bytes| are only logged when |log_bytes| is non-NULL. | 24 // |bytes| are only logged when |log_bytes| is non-NULL. |
25 // |address| may be NULL. | 25 // |address| may be NULL. |
26 UDPDataTransferNetLogParam(int byte_count, const char* bytes, bool log_bytes, | 26 UDPDataTransferNetLogParam(int byte_count, |
| 27 const char* bytes, |
| 28 bool log_bytes, |
27 const IPEndPoint* address); | 29 const IPEndPoint* address); |
28 virtual ~UDPDataTransferNetLogParam(); | |
29 | 30 |
30 virtual base::Value* ToValue() const OVERRIDE; | 31 virtual base::Value* ToValue() const OVERRIDE; |
31 | 32 |
| 33 protected: |
| 34 virtual ~UDPDataTransferNetLogParam(); |
| 35 |
32 private: | 36 private: |
33 const int byte_count_; | 37 const int byte_count_; |
34 const std::string hex_encoded_bytes_; | 38 const std::string hex_encoded_bytes_; |
35 scoped_ptr<IPEndPoint> address_; | 39 scoped_ptr<IPEndPoint> address_; |
36 }; | 40 }; |
37 | 41 |
38 } // namespace net | 42 } // namespace net |
39 | 43 |
40 #endif // NET_BASE_ADDRESS_LIST_NET_LOG_PARAM_H_ | 44 #endif // NET_BASE_ADDRESS_LIST_NET_LOG_PARAM_H_ |
OLD | NEW |