Chromium Code Reviews| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 Logger::~Logger() { | 137 Logger::~Logger() { |
| 138 } | 138 } |
| 139 | 139 |
| 140 void Logger::LogNewSocketEvent(const CastSocket& cast_socket) { | 140 void Logger::LogNewSocketEvent(const CastSocket& cast_socket) { |
| 141 DCHECK(thread_checker_.CalledOnValidThread()); | 141 DCHECK(thread_checker_.CalledOnValidThread()); |
| 142 | 142 |
| 143 SocketEvent event = CreateEvent(proto::CAST_SOCKET_CREATED); | 143 SocketEvent event = CreateEvent(proto::CAST_SOCKET_CREATED); |
| 144 AggregatedSocketEvent& aggregated_socket_event = | 144 AggregatedSocketEvent& aggregated_socket_event = |
| 145 LogSocketEvent(cast_socket.id(), event); | 145 LogSocketEvent(cast_socket.id(), event); |
| 146 | 146 |
| 147 const net::IPAddressNumber& ip = cast_socket.ip_endpoint().address().bytes(); | 147 const net::IPAddress& ip = cast_socket.ip_endpoint().address(); |
| 148 aggregated_socket_event.set_endpoint_id(ip.back()); | 148 aggregated_socket_event.set_endpoint_id(ip.bytes().back()); |
|
eroman
2016/03/29 18:10:51
As far as refactoring goes, this is a correct.
Bu
Wez
2016/03/29 20:46:29
Fair point; |cast_socket.ip_endpoint()| is the add
martijnc
2016/03/29 21:00:48
Added.
| |
| 149 aggregated_socket_event.set_channel_auth_type(cast_socket.channel_auth() == | 149 aggregated_socket_event.set_channel_auth_type(cast_socket.channel_auth() == |
| 150 CHANNEL_AUTH_TYPE_SSL | 150 CHANNEL_AUTH_TYPE_SSL |
| 151 ? proto::SSL | 151 ? proto::SSL |
| 152 : proto::SSL_VERIFIED); | 152 : proto::SSL_VERIFIED); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void Logger::LogSocketEvent(int channel_id, EventType event_type) { | 155 void Logger::LogSocketEvent(int channel_id, EventType event_type) { |
| 156 DCHECK(thread_checker_.CalledOnValidThread()); | 156 DCHECK(thread_checker_.CalledOnValidThread()); |
| 157 | 157 |
| 158 LogSocketEventWithDetails(channel_id, event_type, std::string()); | 158 LogSocketEventWithDetails(channel_id, event_type, std::string()); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 357 if (it != aggregated_socket_events_.end()) { | 357 if (it != aggregated_socket_events_.end()) { |
| 358 return it->second->last_errors; | 358 return it->second->last_errors; |
| 359 } else { | 359 } else { |
| 360 return LastErrors(); | 360 return LastErrors(); |
| 361 } | 361 } |
| 362 } | 362 } |
| 363 | 363 |
| 364 } // namespace cast_channel | 364 } // namespace cast_channel |
| 365 } // namespace api | 365 } // namespace api |
| 366 } // namespace extensions | 366 } // namespace extensions |
| OLD | NEW |