| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_KEEP_ALIVE_DELEGATE_H_ | 5 #ifndef COMPONENTS_CAST_CHANNEL_KEEP_ALIVE_DELEGATE_H_ |
| 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_KEEP_ALIVE_DELEGATE_H_ | 6 #define COMPONENTS_CAST_CHANNEL_KEEP_ALIVE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| 11 #include "extensions/browser/api/cast_channel/cast_transport.h" | 11 #include "components/cast_channel/cast_transport.h" |
| 12 #include "extensions/common/api/cast_channel/cast_channel.pb.h" | 12 #include "components/cast_channel/proto/cast_channel.pb.h" |
| 13 | 13 |
| 14 namespace extensions { | |
| 15 namespace api { | |
| 16 namespace cast_channel { | 14 namespace cast_channel { |
| 17 | 15 |
| 18 class CastSocket; | 16 class CastSocket; |
| 19 class Logger; | 17 class Logger; |
| 20 | 18 |
| 21 // Decorator delegate which provides keep-alive functionality. | 19 // Decorator delegate which provides keep-alive functionality. |
| 22 // Keep-alive messages are handled by this object; all other messages and | 20 // Keep-alive messages are handled by this object; all other messages and |
| 23 // errors are passed to |inner_delegate_|. | 21 // errors are passed to |inner_delegate_|. |
| 24 class KeepAliveDelegate : public CastTransport::Delegate { | 22 class KeepAliveDelegate : public CastTransport::Delegate { |
| 25 public: | 23 public: |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 96 |
| 99 // Fired when |liveness_timer_| is exceeded. | 97 // Fired when |liveness_timer_| is exceeded. |
| 100 std::unique_ptr<base::Timer> liveness_timer_; | 98 std::unique_ptr<base::Timer> liveness_timer_; |
| 101 | 99 |
| 102 // The PING message to send over the wire. | 100 // The PING message to send over the wire. |
| 103 CastMessage ping_message_; | 101 CastMessage ping_message_; |
| 104 | 102 |
| 105 // The PONG message to send over the wire. | 103 // The PONG message to send over the wire. |
| 106 CastMessage pong_message_; | 104 CastMessage pong_message_; |
| 107 | 105 |
| 108 base::ThreadChecker thread_checker_; | 106 THREAD_CHECKER(thread_checker_); |
| 109 | 107 |
| 110 DISALLOW_COPY_AND_ASSIGN(KeepAliveDelegate); | 108 DISALLOW_COPY_AND_ASSIGN(KeepAliveDelegate); |
| 111 }; | 109 }; |
| 112 | 110 |
| 113 } // namespace cast_channel | 111 } // namespace cast_channel |
| 114 } // namespace api | |
| 115 } // namespace extensions | |
| 116 | 112 |
| 117 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_KEEP_ALIVE_DELEGATE_H_ | 113 #endif // COMPONENTS_CAST_CHANNEL_KEEP_ALIVE_DELEGATE_H_ |
| OLD | NEW |