Bug 722570 - make BaseResource.{getConnectionManager,enableTLSConnectionManager} thread-safe. r=rnewman
authorNick Alexander <nalexander@mozilla.com>
Fri, 02 Mar 2012 17:36:15 -0800
changeset 88192 6827710a19f1c3c1e2adbaa85ed309377f8bf33a
parent 88191 16bf8c62011d2a8fc922329bed6c995f0b220c4c
child 88193 92b773c99586e3ebb466d055ba8ad488a9d13f89
push id6730
push userrnewman@mozilla.com
push dateSat, 03 Mar 2012 02:44:09 +0000
treeherdermozilla-inbound@f3a1091ccf99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs722570
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;