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 24 matching lines...) Expand all Loading... |
35 class Logger : public base::RefCounted<Logger> { | 35 class Logger : public base::RefCounted<Logger> { |
36 public: | 36 public: |
37 // |clock|: Clock used for generating timestamps for the events. Owned by | 37 // |clock|: Clock used for generating timestamps for the events. Owned by |
38 // this class. | 38 // this class. |
39 // |unix_epoch_time_ticks|: The TimeTicks that corresponds to Unix epoch. | 39 // |unix_epoch_time_ticks|: The TimeTicks that corresponds to Unix epoch. |
40 Logger(scoped_ptr<base::TickClock> clock, | 40 Logger(scoped_ptr<base::TickClock> clock, |
41 base::TimeTicks unix_epoch_time_ticks); | 41 base::TimeTicks unix_epoch_time_ticks); |
42 | 42 |
43 // For newly created sockets. Will create an event and log a | 43 // For newly created sockets. Will create an event and log a |
44 // CAST_SOCKET_CREATED event. | 44 // CAST_SOCKET_CREATED event. |
45 void LogNewSocketEvent(const CastSocket& cast_socket); | 45 void LogNewSocketEvent(const CastSocketImpl& cast_socket); |
46 | 46 |
47 void LogSocketEvent(int channel_id, proto::EventType event_type); | 47 void LogSocketEvent(int channel_id, proto::EventType event_type); |
48 void LogSocketEventWithDetails(int channel_id, | 48 void LogSocketEventWithDetails(int channel_id, |
49 proto::EventType event_type, | 49 proto::EventType event_type, |
50 const std::string& details); | 50 const std::string& details); |
51 | 51 |
52 // For events that involves socket / crypto operations that returns a value. | 52 // For events that involves socket / crypto operations that returns a value. |
53 void LogSocketEventWithRv(int channel_id, | 53 void LogSocketEventWithRv(int channel_id, |
54 proto::EventType event_type, | 54 proto::EventType event_type, |
55 int rv); | 55 int rv); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 base::ThreadChecker thread_checker_; | 132 base::ThreadChecker thread_checker_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(Logger); | 134 DISALLOW_COPY_AND_ASSIGN(Logger); |
135 }; | 135 }; |
136 } // namespace cast_channel | 136 } // namespace cast_channel |
137 } // namespace api | 137 } // namespace api |
138 } // namespace extensions | 138 } // namespace extensions |
139 | 139 |
140 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ | 140 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ |
OLD | NEW |