Bug 722570 - make BaseResource.{getConnectionManager,enableTLSConnectionManager} thread-safe. r=rnewman
authorNick Alexander <nalexander@mozilla.com>
Fri, 02 Mar 2012 17:36:15 -0800
changeset 88392 6827710a19f1c3c1e2adbaa85ed309377f8bf33a
parent 88391 16bf8c62011d2a8fc922329bed6c995f0b220c4c
child 88393 92b773c99586e3ebb466d055ba8ad488a9d13f89
push id157
push userMs2ger@gmail.com
push dateWed, 07 Mar 2012 19:27:10 +0000
reviewersrnewman
bugs722570
milestone13.0a1
Bug 722570 - make BaseResource.{getConnectionManager,enableTLSConnectionManager} thread-safe. r=rnewman
mobile/android/base/sync/net/BaseResource.java
--- a/mobile/android/base/sync/net/BaseResource.java
+++ b/mobile/android/base/sync/net/BaseResource.java
@@ -172,17 +172,17 @@ public class BaseResource implements Res
   public static ClientConnectionManager enablePlainHTTPConnectionManager() {
     synchronized (connManagerMonitor) {
       ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
       connManager = cm;
       return cm;
     }
   }
 
-  public static ClientConnectionManager enableTLSConnectionManager() throws KeyManagementException, NoSuchAlgorithmException  {
+  private static ClientConnectionManager enableTLSConnectionManager() throws KeyManagementException, NoSuchAlgorithmException  {
     SSLContext sslContext = SSLContext.getInstance("TLS");
     sslContext.init(null, null, new SecureRandom());
     SSLSocketFactory sf = new TLSSocketFactory(sslContext);
     SchemeRegistry schemeRegistry = new SchemeRegistry();
     schemeRegistry.register(new Scheme("https", 443, sf));
     schemeRegistry.register(new Scheme("http", 80, new PlainSocketFactory()));
     ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager(schemeRegistry);
     connManager = cm;