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 #include "extensions/browser/api/cast_channel/logger.h" | 5 #include "extensions/browser/api/cast_channel/logger.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/time/tick_clock.h" | 8 #include "base/time/tick_clock.h" |
9 #include "extensions/browser/api/cast_channel/cast_auth_util.h" | 9 #include "extensions/browser/api/cast_channel/cast_auth_util.h" |
10 #include "extensions/browser/api/cast_channel/logger_util.h" | 10 #include "extensions/browser/api/cast_channel/logger_util.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 DCHECK(clock_); | 112 DCHECK(clock_); |
113 | 113 |
114 // Logger may not be necessarily be created on the IO thread, but logging | 114 // Logger may not be necessarily be created on the IO thread, but logging |
115 // happens exclusively there. | 115 // happens exclusively there. |
116 thread_checker_.DetachFromThread(); | 116 thread_checker_.DetachFromThread(); |
117 } | 117 } |
118 | 118 |
119 Logger::~Logger() { | 119 Logger::~Logger() { |
120 } | 120 } |
121 | 121 |
122 void Logger::LogNewSocketEvent(const CastSocket& cast_socket) { | 122 void Logger::LogNewSocketEvent(const CastSocketImpl& cast_socket) { |
123 DCHECK(thread_checker_.CalledOnValidThread()); | 123 DCHECK(thread_checker_.CalledOnValidThread()); |
124 | 124 |
125 int channel_id = cast_socket.id(); | 125 int channel_id = cast_socket.id(); |
126 SocketEvent event = CreateEvent(proto::CAST_SOCKET_CREATED); | 126 SocketEvent event = CreateEvent(proto::CAST_SOCKET_CREATED); |
127 AggregatedSocketEvent& aggregated_socket_event = | 127 AggregatedSocketEvent& aggregated_socket_event = |
128 LogSocketEvent(channel_id, event); | 128 LogSocketEvent(channel_id, event); |
129 | 129 |
130 const net::IPAddressNumber& ip = cast_socket.ip_endpoint().address(); | 130 const net::IPAddressNumber& ip = cast_socket.ip_endpoint().address(); |
131 aggregated_socket_event.set_endpoint_id(ip.back()); | 131 aggregated_socket_event.set_endpoint_id(ip.back()); |
132 aggregated_socket_event.set_channel_auth_type(cast_socket.channel_auth() == | 132 aggregated_socket_event.set_channel_auth_type(cast_socket.channel_auth() == |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 if (it != aggregated_socket_events_.end()) { | 351 if (it != aggregated_socket_events_.end()) { |
352 return it->second->last_errors; | 352 return it->second->last_errors; |
353 } else { | 353 } else { |
354 return LastErrors(); | 354 return LastErrors(); |
355 } | 355 } |
356 } | 356 } |
357 | 357 |
358 } // namespace cast_channel | 358 } // namespace cast_channel |
359 } // namespace api | 359 } // namespace api |
360 } // namespace extensions | 360 } // namespace extensions |
OLD | NEW |