| 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 COMPONENTS_CAST_CHANNEL_LOGGER_H_ |
| 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ | 6 #define COMPONENTS_CAST_CHANNEL_LOGGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 18 #include "extensions/common/api/cast_channel/logging.pb.h" | 18 #include "components/cast_channel/proto/logging.pb.h" |
| 19 | 19 |
| 20 | |
| 21 namespace extensions { | |
| 22 namespace api { | |
| 23 namespace cast_channel { | 20 namespace cast_channel { |
| 24 | 21 |
| 25 struct AuthResult; | 22 struct AuthResult; |
| 26 | 23 |
| 27 // Holds the most recent errors encountered by a CastSocket. | 24 // Holds the most recent errors encountered by a CastSocket. |
| 28 struct LastErrors { | 25 struct LastErrors { |
| 29 public: | 26 public: |
| 30 LastErrors(); | 27 LastErrors(); |
| 31 ~LastErrors(); | 28 ~LastErrors(); |
| 32 | 29 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 66 |
| 70 // Returns a SocketEvent proto with common fields (EventType, timestamp) | 67 // Returns a SocketEvent proto with common fields (EventType, timestamp) |
| 71 // populated. | 68 // populated. |
| 72 proto::SocketEvent CreateEvent(proto::EventType event_type); | 69 proto::SocketEvent CreateEvent(proto::EventType event_type); |
| 73 | 70 |
| 74 // Uses |event| associated with |channel_id| to update its LastErrors. | 71 // Uses |event| associated with |channel_id| to update its LastErrors. |
| 75 void LogSocketEvent(int channel_id, const proto::SocketEvent& socket_event); | 72 void LogSocketEvent(int channel_id, const proto::SocketEvent& socket_event); |
| 76 | 73 |
| 77 LastErrorsMap last_errors_; | 74 LastErrorsMap last_errors_; |
| 78 | 75 |
| 79 base::ThreadChecker thread_checker_; | 76 THREAD_CHECKER(thread_checker_); |
| 80 | 77 |
| 81 DISALLOW_COPY_AND_ASSIGN(Logger); | 78 DISALLOW_COPY_AND_ASSIGN(Logger); |
| 82 }; | 79 }; |
| 83 } // namespace cast_channel | 80 } // namespace cast_channel |
| 84 } // namespace api | |
| 85 } // namespace extensions | |
| 86 | 81 |
| 87 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_H_ | 82 #endif // COMPONENTS_CAST_CHANNEL_LOGGER_H_ |
| OLD | NEW |