summaryrefslogtreecommitdiffstats
path: root/sync/tools/testserver
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-25 00:29:32 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-25 00:29:32 +0000
commit389f566a8d88ba4849dc1c2179e00bf64b1d1b39 (patch)
treead64c2dbf6b004f43fe3e8a0e7bd539f223a51f4 /sync/tools/testserver
parentccdcf4375d9a79dcea5d92692db30ae199ffff28 (diff)
downloadchromium_src-389f566a8d88ba4849dc1c2179e00bf64b1d1b39.zip
chromium_src-389f566a8d88ba4849dc1c2179e00bf64b1d1b39.tar.gz
chromium_src-389f566a8d88ba4849dc1c2179e00bf64b1d1b39.tar.bz2
Make use of InvalidationService
The InvalidationService was introduced r199520. That commit added the InvalidationService interface and several implementations of it, but made no use of the new code. This commit builds on that work. Up until now, TICL invalidations were handled on the sync thread. The related objects were instantiated and owned by the SyncBackendHost and SyncManager. All requests to update the set of object registrations had to be passed to the sync thread. Components that wanted to receive invalidations but were not part of sync had to route their communication with the invalidations server through ProfileSyncService to get to the sync thread. Things were a bit different on Android, but the system still tried to pretend that invalidations were owned by the sync thread. The new InvalidationService implementation is a ProfileKeyedService that is mostly independent from sync. It still relies on sync to manage sign in and fetch the appropriate auth tokens. However, it's now much easier for components outside of sync to communication with the invalidations server. The new system allows us to remove a lot of invalidations-related code from the ProfileSyncService, SyncBackendHost and SyncManager. Sync is now just one of many clients of the InvalidationService. The SyncBackendHost is responsible for forwarding messages back and forth between the InvalidationService and the sync thread. TBR=sky,erg BUG=124137 Review URL: https://chromiumcodereview.appspot.com/15580002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208315 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/tools/testserver')
-rw-r--r--sync/tools/testserver/xmppserver.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sync/tools/testserver/xmppserver.py b/sync/tools/testserver/xmppserver.py
index 0b32933..3f7c7d05 100644
--- a/sync/tools/testserver/xmppserver.py
+++ b/sync/tools/testserver/xmppserver.py
@@ -575,6 +575,14 @@ class XmppServer(asyncore.dispatcher):
def SetAuthenticated(self, auth_valid):
self._authenticated = auth_valid
+ # We check authentication only when establishing new connections. We close
+ # all existing connections here to make sure previously connected clients
+ # pick up on the change. It's a hack, but it works well enough for our
+ # purposes.
+ if not self._authenticated:
+ for connection in self._handshake_done_connections:
+ connection.close()
+
def GetAuthenticated(self):
return self._authenticated