Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | package org.mozilla.gecko.background.sync.helpers; |
michael@0 | 5 | |
michael@0 | 6 | import org.mozilla.gecko.sync.repositories.RepositorySession; |
michael@0 | 7 | import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionCreationDelegate; |
michael@0 | 8 | |
michael@0 | 9 | public class DefaultSessionCreationDelegate extends DefaultDelegate implements |
michael@0 | 10 | RepositorySessionCreationDelegate { |
michael@0 | 11 | |
michael@0 | 12 | @Override |
michael@0 | 13 | public void onSessionCreateFailed(Exception ex) { |
michael@0 | 14 | performNotify("Session creation failed", ex); |
michael@0 | 15 | } |
michael@0 | 16 | |
michael@0 | 17 | @Override |
michael@0 | 18 | public void onSessionCreated(RepositorySession session) { |
michael@0 | 19 | performNotify("Should not have been created.", null); |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | @Override |
michael@0 | 23 | public RepositorySessionCreationDelegate deferredCreationDelegate() { |
michael@0 | 24 | final RepositorySessionCreationDelegate self = this; |
michael@0 | 25 | return new RepositorySessionCreationDelegate() { |
michael@0 | 26 | |
michael@0 | 27 | @Override |
michael@0 | 28 | public void onSessionCreated(final RepositorySession session) { |
michael@0 | 29 | new Thread(new Runnable() { |
michael@0 | 30 | @Override |
michael@0 | 31 | public void run() { |
michael@0 | 32 | self.onSessionCreated(session); |
michael@0 | 33 | } |
michael@0 | 34 | }).start(); |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | @Override |
michael@0 | 38 | public void onSessionCreateFailed(final Exception ex) { |
michael@0 | 39 | new Thread(new Runnable() { |
michael@0 | 40 | @Override |
michael@0 | 41 | public void run() { |
michael@0 | 42 | self.onSessionCreateFailed(ex); |
michael@0 | 43 | } |
michael@0 | 44 | }).start(); |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | @Override |
michael@0 | 48 | public RepositorySessionCreationDelegate deferredCreationDelegate() { |
michael@0 | 49 | return this; |
michael@0 | 50 | } |
michael@0 | 51 | }; |
michael@0 | 52 | } |
michael@0 | 53 | } |