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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/time/tick_clock.h" | 10 #include "base/time/tick_clock.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 } // namespace | 122 } // namespace |
123 | 123 |
124 Logger::AggregatedSocketEventLog::AggregatedSocketEventLog() { | 124 Logger::AggregatedSocketEventLog::AggregatedSocketEventLog() { |
125 } | 125 } |
126 | 126 |
127 Logger::AggregatedSocketEventLog::~AggregatedSocketEventLog() { | 127 Logger::AggregatedSocketEventLog::~AggregatedSocketEventLog() { |
128 } | 128 } |
129 | 129 |
130 Logger::Logger(scoped_ptr<base::TickClock> clock, | 130 Logger::Logger(const scoped_refptr<base::TickClock>& clock, |
131 base::TimeTicks unix_epoch_time_ticks) | 131 base::TimeTicks unix_epoch_time_ticks) |
132 : clock_(clock.Pass()), unix_epoch_time_ticks_(unix_epoch_time_ticks) { | 132 : clock_(clock), unix_epoch_time_ticks_(unix_epoch_time_ticks) { |
133 DCHECK(clock_); | 133 DCHECK(clock_.get() != NULL); |
134 | 134 |
135 // Logger may not be necessarily be created on the IO thread, but logging | 135 // Logger may not be necessarily be created on the IO thread, but logging |
136 // happens exclusively there. | 136 // happens exclusively there. |
137 thread_checker_.DetachFromThread(); | 137 thread_checker_.DetachFromThread(); |
138 } | 138 } |
139 | 139 |
140 Logger::~Logger() { | 140 Logger::~Logger() { |
141 } | 141 } |
142 | 142 |
143 void Logger::LogNewSocketEvent(const CastSocket& cast_socket) { | 143 void Logger::LogNewSocketEvent(const CastSocket& cast_socket) { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 if (it != aggregated_socket_events_.end()) { | 362 if (it != aggregated_socket_events_.end()) { |
363 return it->second->last_errors; | 363 return it->second->last_errors; |
364 } else { | 364 } else { |
365 return LastErrors(); | 365 return LastErrors(); |
366 } | 366 } |
367 } | 367 } |
368 | 368 |
369 } // namespace cast_channel | 369 } // namespace cast_channel |
370 } // namespace core_api | 370 } // namespace core_api |
371 } // namespace extensions | 371 } // namespace extensions |
OLD | NEW |