buffet: Switch XmppChannel to use asynchronous socket streams
Changed XmppClient from using raw socket file descriptors to
chromeos::Stream in preparation of adding TLS support (via subsituting
the regular socket-based FileStream with TlsStream once TLS handshake
is initiated by the XMPP server).
Also implemented exponential backoff for reconnecting to the server
in case of a network error as well as more comprehensive network
read/write mechanism which will tie better into more strict XML-based
parser/communication and renamed XmppClient to XmppChannel after
adding a generic interface for NotificationChannel and NotificationDelegate
which will help us implement other notification channels such as
GCM and periodic polling.
BUG=brillo:458
TEST=`FEATURES=test emerge-link buffet`
Tested XMPP operation on DUT.
Change-Id: I88d593692ca56d03356155e12cde2f2942f8391e
Reviewed-on: https://chromium-review.googlesource.com/271151
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Nathan Bullock <nathanbullock@google.com>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/buffet.gyp b/buffet/buffet.gyp
index 83cebba..7a466d7 100644
--- a/buffet/buffet.gyp
+++ b/buffet/buffet.gyp
@@ -39,6 +39,7 @@
'dbus_bindings/org.chromium.Buffet.Manager.xml',
'dbus_constants.cc',
'manager.cc',
+ 'notification/xmpp_channel.cc',
'registration_status.cc',
'storage_impls.cc',
'states/error_codes.cc',
@@ -46,8 +47,6 @@
'states/state_manager.cc',
'states/state_package.cc',
'utils.cc',
- 'xmpp/xmpp_client.cc',
- 'xmpp/xmpp_connection.cc',
],
'includes': ['../common-mk/generate-dbus-adaptors.gypi'],
'actions': [
@@ -120,10 +119,10 @@
'commands/schema_utils_unittest.cc',
'commands/unittest_utils.cc',
'device_registration_info_unittest.cc',
+ 'notification/xmpp_channel_unittest.cc',
'states/state_change_queue_unittest.cc',
'states/state_manager_unittest.cc',
'states/state_package_unittest.cc',
- 'xmpp/xmpp_client_unittest.cc',
],
},
],