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

Side by Side Diff: blimp/net/blimp_connection_details.cc

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "blimp/net/blimp_connection_details.h"
6
7 namespace blimp {
8
9 BlimpConnectionDetails::BlimpConnectionDetails(
10 NetworkActivityObserver* observer)
11 : bytes_received_(0), bytes_sent_(0), observer_(observer) {}
12
13 BlimpConnectionDetails::~BlimpConnectionDetails() {}
14
15 void BlimpConnectionDetails::OnPacketReceived(int bytes) {
16 bytes_received_ += bytes;
17 if (observer_) {
18 observer_->OnPacketReceived(bytes_received_);
19 }
20 }
21
22 void BlimpConnectionDetails::OnPacketSent(int bytes) {
23 bytes_sent_ += bytes;
24 if (observer_) {
25 observer_->OnPacketSent(bytes_sent_);
26 }
27 }
28
29 void BlimpConnectionDetails::ResetStats() {
30 bytes_sent_ = 0;
31 bytes_received_ = 0;
32 }
33 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698