Chromium Code Reviews| 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 #ifndef NET_UDP_UDP_DATA_TRANSFER_PARAM_H_ | 5 #ifndef NET_UDP_UDP_DATA_TRANSFER_PARAM_H_ |
|
eroman
2012/06/13 18:39:41
Update for new path
mmenke
2012/06/13 19:43:44
Done. Guess the presubmit check doesn't like rena
| |
| 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> | |
| 10 | |
| 11 #include "base/compiler_specific.h" | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
| 14 | 10 |
| 15 namespace net { | 11 namespace net { |
| 16 | 12 |
| 17 class IPEndPoint; | 13 class IPEndPoint; |
| 18 | 14 |
| 19 // NetLog parameter to describe a UDP receive/send event. Each event has a | 15 // Creates a NetLog callback that returns parameters describing a UDP |
| 20 // byte count, and may optionally have transferred bytes and an IPEndPoint as | 16 // receive/send event. |bytes| are only logged when byte logging is |
| 21 // well. | 17 // enabled. |address| may be NULL. |address| (if given) and |bytes| |
| 22 class UDPDataTransferNetLogParam : public NetLog::EventParameters { | 18 // must be valid for the life of the callback. |
| 23 public: | 19 NetLog::ParametersCallback CreateNetLogUDPDataTranferCallback( |
| 24 // |bytes| are only logged when |log_bytes| is non-NULL. | 20 int byte_count, |
| 25 // |address| may be NULL. | 21 const char* bytes, |
| 26 UDPDataTransferNetLogParam(int byte_count, | 22 const IPEndPoint* address); |
| 27 const char* bytes, | |
| 28 bool log_bytes, | |
| 29 const IPEndPoint* address); | |
| 30 | 23 |
| 31 virtual base::Value* ToValue() const OVERRIDE; | 24 // Creates a NetLog callback that returns parameters describing a UDP |
| 32 | 25 // connect event. |address| cannot be NULL, and must remain valid for |
| 33 protected: | 26 // the lifetime of the callback. |
| 34 virtual ~UDPDataTransferNetLogParam(); | 27 NetLog::ParametersCallback CreateNetLogUDPConnectCallback( |
| 35 | 28 const IPEndPoint* address); |
| 36 private: | |
| 37 const int byte_count_; | |
| 38 const std::string hex_encoded_bytes_; | |
| 39 scoped_ptr<IPEndPoint> address_; | |
| 40 }; | |
| 41 | 29 |
| 42 } // namespace net | 30 } // namespace net |
| 43 | 31 |
| 44 #endif // NET_UDP_UDP_DATA_TRANSFER_PARAM_H_ | 32 #endif // NET_UDP_UDP_DATA_TRANSFER_PARAM_H_ |
| OLD | NEW |