Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Unified Diff: net/udp/udp_net_log_parameters.h

Issue 10546133: NetLogEventParameter to Callback refactoring 4. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync? Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/udp/udp_data_transfer_param.cc ('k') | net/udp/udp_net_log_parameters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_net_log_parameters.h
===================================================================
--- net/udp/udp_net_log_parameters.h (revision 141669)
+++ net/udp/udp_net_log_parameters.h (working copy)
@@ -2,43 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_UDP_UDP_DATA_TRANSFER_PARAM_H_
-#define NET_UDP_UDP_DATA_TRANSFER_PARAM_H_
+#ifndef NET_UDP_UDP_NET_LOG_PARAMETERS_H_
+#define NET_UDP_UDP_NET_LOG_PARAMETERS_H_
#pragma once
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
#include "net/base/net_log.h"
namespace net {
class IPEndPoint;
-// NetLog parameter to describe a UDP receive/send event. Each event has a
-// byte count, and may optionally have transferred bytes and an IPEndPoint as
-// well.
-class UDPDataTransferNetLogParam : public NetLog::EventParameters {
- public:
- // |bytes| are only logged when |log_bytes| is non-NULL.
- // |address| may be NULL.
- UDPDataTransferNetLogParam(int byte_count,
- const char* bytes,
- bool log_bytes,
- const IPEndPoint* address);
+// Creates a NetLog callback that returns parameters describing a UDP
+// receive/send event. |bytes| are only logged when byte logging is
+// enabled. |address| may be NULL. |address| (if given) and |bytes|
+// must be valid for the life of the callback.
+NetLog::ParametersCallback CreateNetLogUDPDataTranferCallback(
+ int byte_count,
+ const char* bytes,
+ const IPEndPoint* address);
- virtual base::Value* ToValue() const OVERRIDE;
+// Creates a NetLog callback that returns parameters describing a UDP
+// connect event. |address| cannot be NULL, and must remain valid for
+// the lifetime of the callback.
+NetLog::ParametersCallback CreateNetLogUDPConnectCallback(
+ const IPEndPoint* address);
- protected:
- virtual ~UDPDataTransferNetLogParam();
-
- private:
- const int byte_count_;
- const std::string hex_encoded_bytes_;
- scoped_ptr<IPEndPoint> address_;
-};
-
} // namespace net
-#endif // NET_UDP_UDP_DATA_TRANSFER_PARAM_H_
+#endif // NET_UDP_UDP_NET_LOG_PARAMETERS_H_
« no previous file with comments | « net/udp/udp_data_transfer_param.cc ('k') | net/udp/udp_net_log_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698