| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/jingle_glue/fake_signal_strategy.h" | 5 #include "remoting/jingle_glue/fake_signal_strategy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void FakeSignalStrategy::Disconnect() { | 45 void FakeSignalStrategy::Disconnect() { |
| 46 DCHECK(CalledOnValidThread()); | 46 DCHECK(CalledOnValidThread()); |
| 47 FOR_EACH_OBSERVER(Listener, listeners_, | 47 FOR_EACH_OBSERVER(Listener, listeners_, |
| 48 OnSignalStrategyStateChange(DISCONNECTED)); | 48 OnSignalStrategyStateChange(DISCONNECTED)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 SignalStrategy::State FakeSignalStrategy::GetState() const { | 51 SignalStrategy::State FakeSignalStrategy::GetState() const { |
| 52 return CONNECTED; | 52 return CONNECTED; |
| 53 } | 53 } |
| 54 | 54 |
| 55 SignalStrategy::Error FakeSignalStrategy::GetError() const { |
| 56 return OK; |
| 57 } |
| 58 |
| 55 std::string FakeSignalStrategy::GetLocalJid() const { | 59 std::string FakeSignalStrategy::GetLocalJid() const { |
| 56 DCHECK(CalledOnValidThread()); | 60 DCHECK(CalledOnValidThread()); |
| 57 return jid_; | 61 return jid_; |
| 58 } | 62 } |
| 59 | 63 |
| 60 void FakeSignalStrategy::AddListener(Listener* listener) { | 64 void FakeSignalStrategy::AddListener(Listener* listener) { |
| 61 DCHECK(CalledOnValidThread()); | 65 DCHECK(CalledOnValidThread()); |
| 62 listeners_.AddObserver(listener); | 66 listeners_.AddObserver(listener); |
| 63 } | 67 } |
| 64 | 68 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 while ((listener = it.GetNext()) != NULL) { | 114 while ((listener = it.GetNext()) != NULL) { |
| 111 if (listener->OnSignalStrategyIncomingStanza(stanza)) | 115 if (listener->OnSignalStrategyIncomingStanza(stanza)) |
| 112 break; | 116 break; |
| 113 } | 117 } |
| 114 | 118 |
| 115 pending_messages_.pop(); | 119 pending_messages_.pop(); |
| 116 } | 120 } |
| 117 } | 121 } |
| 118 | 122 |
| 119 } // namespace remoting | 123 } // namespace remoting |
| OLD | NEW |