Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #ifndef BLIMP_NET_BLIMP_CONNECTION_DETAILS_H_ | |
| 6 #define BLIMP_NET_BLIMP_CONNECTION_DETAILS_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "blimp/net/blimp_net_export.h" | |
| 10 | |
| 11 namespace blimp { | |
| 12 | |
| 13 class NetworkActivityObserver { | |
|
Kevin M
2016/05/10 23:54:24
Push a NetLog object down the layers to collect by
shaktisahu
2016/05/11 22:08:00
Apparently the NetLog::ThreadSafeObserver is depre
| |
| 14 public: | |
| 15 virtual void OnPacketReceived(int bytes) = 0; | |
| 16 virtual void OnPacketSent(int bytes) = 0; | |
| 17 }; | |
| 18 | |
| 19 // Collects network traffic information like packets received and sent over a | |
| 20 // blimp a network connection. | |
| 21 class BLIMP_NET_EXPORT BlimpConnectionDetails { | |
| 22 public: | |
| 23 BlimpConnectionDetails(NetworkActivityObserver* observer); | |
| 24 | |
| 25 ~BlimpConnectionDetails(); | |
| 26 | |
| 27 void OnPacketReceived(int bytes); | |
| 28 void OnPacketSent(int bytes); | |
| 29 | |
| 30 void ResetStats(); | |
| 31 | |
| 32 protected: | |
| 33 private: | |
| 34 int bytes_received_; | |
| 35 int bytes_sent_; | |
| 36 NetworkActivityObserver* observer_ = nullptr; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(BlimpConnectionDetails); | |
| 39 }; | |
| 40 | |
| 41 } // namespace blimp | |
| 42 | |
| 43 #endif // BLIMP_NET_BLIMP_CONNECTION_DETAILS_H_ | |
| OLD | NEW |