// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef REMOTING_SIGNALING_DELEGATING_SIGNAL_STRATEGY_H_ #define REMOTING_SIGNALING_DELEGATING_SIGNAL_STRATEGY_H_ #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "remoting/signaling/signal_strategy.h" #include "remoting/signaling/signaling_address.h" namespace base { class SingleThreadTaskRunner; } // namespace base namespace remoting { // A signaling strategy class that delegates IQ sending and receiving. // // Notes on thread safety: // 1. This object can be created on any thread. // 2. |send_iq_callback| will always be called on the thread that it is created. // Note that |send_iq_callback| may be called after this object is destroyed. // 3. The caller should invoke all methods on the SignalStrategy interface on // the |client_task_runner|. // 4. All listeners will be called on |client_task_runner| as well. // 5. The destructor should always be called on the |client_task_runner|. // 6. As a result of (5), use MakeIncomingMessageCallback() to obtain a callback // when passing incoming signaling messages from the delegate. The callback // can then be invoked at any thread. class DelegatingSignalStrategy : public SignalStrategy { … }; } // namespace remoting #endif // REMOTING_SIGNALING_DELEGATING_SIGNAL_STRATEGY_H_