| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 #include <iostream> | 12 #include <iostream> |
| 13 #include <map> | 13 #include <map> |
| 14 #include <sstream> | 14 #include <sstream> |
| 15 #include <string> | 15 #include <string> |
| 16 #include <vector> | 16 #include <vector> |
| 17 #include "webrtc/libjingle/xmpp/chatroommodule.h" | 17 #include "webrtc/libjingle/xmpp/chatroommodule.h" |
| 18 #include "webrtc/libjingle/xmpp/constants.h" | 18 #include "webrtc/libjingle/xmpp/constants.h" |
| 19 #include "webrtc/libjingle/xmpp/moduleimpl.h" | 19 #include "webrtc/libjingle/xmpp/moduleimpl.h" |
| 20 #include "webrtc/base/arraysize.h" |
| 20 #include "webrtc/base/common.h" | 21 #include "webrtc/base/common.h" |
| 21 | 22 |
| 22 namespace buzz { | 23 namespace buzz { |
| 23 | 24 |
| 24 // forward declarations | 25 // forward declarations |
| 25 class XmppChatroomImpl; | 26 class XmppChatroomImpl; |
| 26 class XmppChatroomMemberImpl; | 27 class XmppChatroomMemberImpl; |
| 27 | 28 |
| 28 //! Module that encapsulates multiple chatrooms. | 29 //! Module that encapsulates multiple chatrooms. |
| 29 //! Each chatroom is represented by an XmppChatroomImpl instance | 30 //! Each chatroom is represented by an XmppChatroomImpl instance |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 RTC_UNUSED(presence); | 529 RTC_UNUSED(presence); |
| 529 | 530 |
| 530 XmppChatroomState old_state = chatroom_state_; | 531 XmppChatroomState old_state = chatroom_state_; |
| 531 | 532 |
| 532 // do nothing if state hasn't changed | 533 // do nothing if state hasn't changed |
| 533 if (old_state == new_state) | 534 if (old_state == new_state) |
| 534 return XMPP_RETURN_OK; | 535 return XMPP_RETURN_OK; |
| 535 | 536 |
| 536 // find the right transition description | 537 // find the right transition description |
| 537 StateTransitionDescription* transition_desc = NULL; | 538 StateTransitionDescription* transition_desc = NULL; |
| 538 for (int i=0; i < ARRAY_SIZE(Transitions); i++) { | 539 for (size_t i = 0; i < arraysize(Transitions); i++) { |
| 539 if (Transitions[i].old_state == old_state && | 540 if (Transitions[i].old_state == old_state && |
| 540 Transitions[i].new_state == new_state) { | 541 Transitions[i].new_state == new_state) { |
| 541 transition_desc = &Transitions[i]; | 542 transition_desc = &Transitions[i]; |
| 542 break; | 543 break; |
| 543 } | 544 } |
| 544 } | 545 } |
| 545 | 546 |
| 546 if (transition_desc == NULL) { | 547 if (transition_desc == NULL) { |
| 547 ASSERT(0); | 548 ASSERT(0); |
| 548 return XMPP_RETURN_BADSTATE; | 549 return XMPP_RETURN_BADSTATE; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 } | 727 } |
| 727 | 728 |
| 728 bool | 729 bool |
| 729 XmppChatroomMemberEnumeratorImpl::IsAfterEnd() { | 730 XmppChatroomMemberEnumeratorImpl::IsAfterEnd() { |
| 730 return (iterator_ == map_->end()); | 731 return (iterator_ == map_->end()); |
| 731 } | 732 } |
| 732 | 733 |
| 733 | 734 |
| 734 | 735 |
| 735 } // namespace buzz | 736 } // namespace buzz |
| OLD | NEW |