| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CAST_CHANNEL_SERVICE_H_ | 5 #ifndef COMPONENTS_CAST_CHANNEL_CAST_CHANNEL_SERVICE_H_ |
| 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_SERVICE_H_ | 6 #define COMPONENTS_CAST_CHANNEL_CAST_CHANNEL_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "components/cast_channel/cast_socket.h" |
| 13 #include "components/keyed_service/core/refcounted_keyed_service.h" | 14 #include "components/keyed_service/core/refcounted_keyed_service.h" |
| 14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 15 #include "extensions/browser/api/cast_channel/cast_socket.h" | |
| 16 | 16 |
| 17 namespace extensions { | |
| 18 namespace api { | |
| 19 namespace cast_channel { | 17 namespace cast_channel { |
| 20 | 18 |
| 21 // This class adds, removes, and returns cast sockets created by CastChannelAPI | 19 // This class adds, removes, and returns cast sockets created by CastChannelAPI |
| 22 // to underlying storage. | 20 // to underlying storage. |
| 23 // Instance of this class is created on the UI thread and destroyed on the IO | 21 // Instance of this class is created on the UI thread and destroyed on the IO |
| 24 // thread. All public API must be called from the IO thread. | 22 // thread. All public API must be called from the IO thread. |
| 25 class CastSocketService : public RefcountedKeyedService { | 23 class CastSocketService : public RefcountedKeyedService { |
| 26 public: | 24 public: |
| 27 CastSocketService(); | 25 CastSocketService(); |
| 28 | 26 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 49 | 47 |
| 50 // The collection of CastSocket keyed by channel_id. | 48 // The collection of CastSocket keyed by channel_id. |
| 51 std::map<int, std::unique_ptr<CastSocket>> sockets_; | 49 std::map<int, std::unique_ptr<CastSocket>> sockets_; |
| 52 | 50 |
| 53 THREAD_CHECKER(thread_checker_); | 51 THREAD_CHECKER(thread_checker_); |
| 54 | 52 |
| 55 DISALLOW_COPY_AND_ASSIGN(CastSocketService); | 53 DISALLOW_COPY_AND_ASSIGN(CastSocketService); |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 } // namespace cast_channel | 56 } // namespace cast_channel |
| 59 } // namespace api | |
| 60 } // namespace extensions | |
| 61 | 57 |
| 62 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_SERVICE_H_ | 58 #endif // COMPONENTS_CAST_CHANNEL_CAST_CHANNEL_SERVICE_H_ |
| OLD | NEW |