| OLD | NEW |
| 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 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ |
| 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ | 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // If the internal map is already logging maximum number of sockets and this | 109 // If the internal map is already logging maximum number of sockets and this |
| 110 // is a new socket, the socket with the smallest channel id will be discarded. | 110 // is a new socket, the socket with the smallest channel id will be discarded. |
| 111 // Returns a pointer to the Event proto with |event_type| and | 111 // Returns a pointer to the Event proto with |event_type| and |
| 112 // timestamp populated. | 112 // timestamp populated. |
| 113 void LogSocketEvent(int channel_id, const proto::SocketEvent& socket_event); | 113 void LogSocketEvent(int channel_id, const proto::SocketEvent& socket_event); |
| 114 | 114 |
| 115 scoped_ptr<base::TickClock> clock_; | 115 scoped_ptr<base::TickClock> clock_; |
| 116 AggregatedSocketEventLogMap aggregated_socket_events_; | 116 AggregatedSocketEventLogMap aggregated_socket_events_; |
| 117 base::TimeTicks unix_epoch_time_ticks_; | 117 base::TimeTicks unix_epoch_time_ticks_; |
| 118 | 118 |
| 119 // Number of socket / event entries evicted by the logger due to size | 119 // Log proto holding global statistics. |
| 120 // constraints. | 120 proto::Log log_; |
| 121 int num_evicted_aggregated_socket_events_; | |
| 122 int num_evicted_socket_events_; | |
| 123 | 121 |
| 124 base::ThreadChecker thread_checker_; | 122 base::ThreadChecker thread_checker_; |
| 125 | 123 |
| 126 DISALLOW_COPY_AND_ASSIGN(Logger); | 124 DISALLOW_COPY_AND_ASSIGN(Logger); |
| 127 }; | 125 }; |
| 128 } // namespace cast_channel | 126 } // namespace cast_channel |
| 129 } // namespace api | 127 } // namespace api |
| 130 } // namespace extensions | 128 } // namespace extensions |
| 131 | 129 |
| 132 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ | 130 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ |
| OLD | NEW |