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

Unified Diff: net/socket/stream_socket.cc

Issue 7084007: Adds URLRequestJob bytes read to NetLog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 9 years, 7 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
Index: net/socket/stream_socket.cc
===================================================================
--- net/socket/stream_socket.cc (revision 87467)
+++ net/socket/stream_socket.cc (working copy)
@@ -11,42 +11,6 @@
namespace net {
-namespace {
-
-// Parameters for SOCKET_BYTES_RECEIVED and SOCKET_BYTES_SENT events.
-// Includes bytes transferred and, if |bytes| is not NULL, the bytes themselves.
-class NetLogBytesTransferredParameter : public NetLog::EventParameters {
- public:
- NetLogBytesTransferredParameter(int byte_count, const char* bytes);
-
- virtual Value* ToValue() const;
-
- private:
- const int byte_count_;
- std::string hex_encoded_bytes_;
- bool has_bytes_;
-};
-
-NetLogBytesTransferredParameter::NetLogBytesTransferredParameter(
- int byte_count, const char* transferred_bytes)
- : byte_count_(byte_count),
- has_bytes_(false) {
- if (transferred_bytes) {
- hex_encoded_bytes_ = base::HexEncode(transferred_bytes, byte_count);
- has_bytes_ = true;
- }
-}
-
-Value* NetLogBytesTransferredParameter::ToValue() const {
- DictionaryValue* dict = new DictionaryValue();
- dict->SetInteger("byte_count", byte_count_);
- if (has_bytes_)
- dict->SetString("hex_encoded_bytes", hex_encoded_bytes_);
- return dict;
-}
-
-} // namespace
-
StreamSocket::UseHistory::UseHistory()
: was_ever_connected_(false),
was_used_to_convey_data_(false),
@@ -143,17 +107,4 @@
}
}
-void StreamSocket::LogByteTransfer(const BoundNetLog& net_log,
- NetLog::EventType event_type,
- int byte_count,
- char* bytes) const {
- scoped_refptr<NetLog::EventParameters> params;
- if (net_log.IsLoggingBytes()) {
- params = new NetLogBytesTransferredParameter(byte_count, bytes);
- } else {
- params = new NetLogBytesTransferredParameter(byte_count, NULL);
- }
- net_log.AddEvent(event_type, params);
-}
-
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698