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/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
14 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 14 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
15 #include "third_party/libjingle/source/talk/xmpp/constants.h" | 15 #include "third_party/libjingle/source/talk/xmpp/constants.h" |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 | 18 |
19 // static | 19 // static |
20 void FakeSignalStrategy::Connect(FakeSignalStrategy* peer1, | 20 void FakeSignalStrategy::Connect(FakeSignalStrategy* peer1, |
21 FakeSignalStrategy* peer2) { | 21 FakeSignalStrategy* peer2) { |
22 peer1->peer_ = peer2; | 22 peer1->peer_ = peer2; |
23 peer2->peer_ = peer1; | 23 peer2->peer_ = peer1; |
24 } | 24 } |
25 | 25 |
26 FakeSignalStrategy::FakeSignalStrategy(const std::string& jid) | 26 FakeSignalStrategy::FakeSignalStrategy(const std::string& jid) |
27 : jid_(jid), | 27 : jid_(jid), |
28 peer_(NULL), | 28 peer_(NULL), |
29 last_id_(0), | 29 last_id_(0), |
30 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 30 weak_factory_(this) { |
31 | 31 |
32 } | 32 } |
33 | 33 |
34 FakeSignalStrategy::~FakeSignalStrategy() { | 34 FakeSignalStrategy::~FakeSignalStrategy() { |
35 while (!received_messages_.empty()) { | 35 while (!received_messages_.empty()) { |
36 delete received_messages_.front(); | 36 delete received_messages_.front(); |
37 received_messages_.pop_front(); | 37 received_messages_.pop_front(); |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 while ((listener = it.GetNext()) != NULL) { | 116 while ((listener = it.GetNext()) != NULL) { |
117 if (listener->OnSignalStrategyIncomingStanza(stanza)) | 117 if (listener->OnSignalStrategyIncomingStanza(stanza)) |
118 break; | 118 break; |
119 } | 119 } |
120 | 120 |
121 pending_messages_.pop(); | 121 pending_messages_.pop(); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 } // namespace remoting | 125 } // namespace remoting |
OLD | NEW |