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

Side by Side Diff: extensions/browser/api/cast_channel/cast_socket.cc

Issue 475463002: Cast channel logging: log additional statistics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@REAL-NEW-MASTER
Patch Set: Addressed comments Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/cast_channel/cast_socket.h" 5 #include "extensions/browser/api/cast_channel/cast_socket.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 if (io_buffer->BytesRemaining() == 0) // Message fully sent 706 if (io_buffer->BytesRemaining() == 0) // Message fully sent
707 SetWriteState(WRITE_STATE_DO_CALLBACK); 707 SetWriteState(WRITE_STATE_DO_CALLBACK);
708 else 708 else
709 SetWriteState(WRITE_STATE_WRITE); 709 SetWriteState(WRITE_STATE_WRITE);
710 710
711 return net::OK; 711 return net::OK;
712 } 712 }
713 713
714 int CastSocket::DoWriteCallback() { 714 int CastSocket::DoWriteCallback() {
715 DCHECK(!write_queue_.empty()); 715 DCHECK(!write_queue_.empty());
716 write_state_ = WRITE_STATE_WRITE; 716
717 logger_->LogSocketWriteState(channel_id_, WriteStateToProto(write_state_)); 717 SetWriteState(WRITE_STATE_WRITE);
718
718 WriteRequest& request = write_queue_.front(); 719 WriteRequest& request = write_queue_.front();
719 int bytes_consumed = request.io_buffer->BytesConsumed(); 720 int bytes_consumed = request.io_buffer->BytesConsumed();
720 logger_->LogSocketEventForMessage( 721 logger_->LogSocketEventForMessage(
721 channel_id_, 722 channel_id_,
722 proto::MESSAGE_WRITTEN, 723 proto::MESSAGE_WRITTEN,
723 request.message_namespace, 724 request.message_namespace,
724 base::StringPrintf("Bytes: %d", bytes_consumed)); 725 base::StringPrintf("Bytes: %d", bytes_consumed));
725 request.callback.Run(bytes_consumed); 726 request.callback.Run(bytes_consumed);
726 write_queue_.pop(); 727 write_queue_.pop();
727 return net::OK; 728 return net::OK;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 return true; 1090 return true;
1090 } 1091 }
1091 1092
1092 CastSocket::WriteRequest::~WriteRequest() { } 1093 CastSocket::WriteRequest::~WriteRequest() { }
1093 1094
1094 } // namespace cast_channel 1095 } // namespace cast_channel
1095 } // namespace core_api 1096 } // namespace core_api
1096 } // namespace extensions 1097 } // namespace extensions
1097 1098
1098 #undef VLOG_WITH_CONNECTION 1099 #undef VLOG_WITH_CONNECTION
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/cast_channel/logger.h » ('j') | extensions/browser/api/cast_channel/logger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698