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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 log_.num_evicted_aggregated_socket_events() + 1); | 287 log_.num_evicted_aggregated_socket_events() + 1); |
288 log_.set_num_evicted_socket_events( | 288 log_.set_num_evicted_socket_events( |
289 log_.num_evicted_socket_events() + | 289 log_.num_evicted_socket_events() + |
290 erase_it->second->socket_events.size()); | 290 erase_it->second->socket_events.size()); |
291 | 291 |
292 aggregated_socket_events_.erase(erase_it); | 292 aggregated_socket_events_.erase(erase_it); |
293 } | 293 } |
294 | 294 |
295 it = aggregated_socket_events_ | 295 it = aggregated_socket_events_ |
296 .insert(std::make_pair( | 296 .insert(std::make_pair( |
297 channel_id, make_linked_ptr(new AggregatedSocketEventLog))) | 297 channel_id, base::MakeUnique<AggregatedSocketEventLog>())) |
298 .first; | 298 .first; |
299 it->second->aggregated_socket_event.set_id(channel_id); | 299 it->second->aggregated_socket_event.set_id(channel_id); |
300 } | 300 } |
301 | 301 |
302 std::deque<proto::SocketEvent>& socket_events = it->second->socket_events; | 302 std::deque<proto::SocketEvent>& socket_events = it->second->socket_events; |
303 if (socket_events.size() >= kMaxEventsPerSocket) { | 303 if (socket_events.size() >= kMaxEventsPerSocket) { |
304 socket_events.pop_front(); | 304 socket_events.pop_front(); |
305 log_.set_num_evicted_socket_events(log_.num_evicted_socket_events() + 1); | 305 log_.set_num_evicted_socket_events(log_.num_evicted_socket_events() + 1); |
306 } | 306 } |
307 socket_events.push_back(socket_event); | 307 socket_events.push_back(socket_event); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 if (it != aggregated_socket_events_.end()) { | 358 if (it != aggregated_socket_events_.end()) { |
359 return it->second->last_errors; | 359 return it->second->last_errors; |
360 } else { | 360 } else { |
361 return LastErrors(); | 361 return LastErrors(); |
362 } | 362 } |
363 } | 363 } |
364 | 364 |
365 } // namespace cast_channel | 365 } // namespace cast_channel |
366 } // namespace api | 366 } // namespace api |
367 } // namespace extensions | 367 } // namespace extensions |
OLD | NEW |