Bug 646412 - fix autodial pref initialization r=cbiesinger
authorOleg Romashin <romaxa@gmail.com>
Sat, 07 May 2011 11:26:58 +0300
changeset 69088 4a5bcd4057d72f9cfbbd0cc4ad602d7ccf2fb9c9
parent 69087 62941612320d3bc12575f03c8df66b0b9c83ed05
child 69089 75a2043c05291b45e7d4f500fea0907778a7c729
push id19853
push userromaxa@gmail.com
push dateSat, 07 May 2011 08:36:37 +0000
treeherdermozilla-central@94042ef440fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscbiesinger
bugs646412
milestone6.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 646412 - fix autodial pref initialization r=cbiesinger
netwerk/base/src/nsIOService.cpp
netwerk/base/src/nsIOService.h
--- a/netwerk/base/src/nsIOService.cpp
+++ b/netwerk/base/src/nsIOService.cpp
@@ -177,16 +177,17 @@ nsIOService::nsIOService()
     : mOffline(PR_TRUE)
     , mOfflineForProfileChange(PR_FALSE)
     , mManageOfflineStatus(PR_TRUE)
     , mSettingOffline(PR_FALSE)
     , mSetOfflineValue(PR_FALSE)
     , mShutdown(PR_FALSE)
     , mChannelEventSinks(NS_CHANNEL_EVENT_SINK_CATEGORY)
     , mContentSniffers(NS_CONTENT_SNIFFER_CATEGORY)
+    , mAutoDialEnabled(PR_FALSE)
 {
 }
 
 nsresult
 nsIOService::Init()
 {
     NS_TIME_FUNCTION;
 
@@ -299,16 +300,17 @@ nsIOService::InitializeSocketTransportSe
         if (NS_FAILED(rv)) {
             NS_WARNING("failed to get socket transport service");
         }
     }
 
     if (mSocketTransportService) {
         rv = mSocketTransportService->Init();
         NS_ASSERTION(NS_SUCCEEDED(rv), "socket transport service init failed");
+        mSocketTransportService->SetAutodialEnabled(mAutoDialEnabled);
     }
 
     return rv;
 }
 
 nsIOService*
 nsIOService::GetInstance() {
     if (!gIOService) {
@@ -845,16 +847,17 @@ nsIOService::PrefsChanged(nsIPrefBranch 
     // ...as well as previous blocks to remove.
     if (!pref || strcmp(pref, PORT_PREF("banned.override")) == 0)
         ParsePortList(prefs, PORT_PREF("banned.override"), PR_TRUE);
 
     if (!pref || strcmp(pref, AUTODIAL_PREF) == 0) {
         PRBool enableAutodial = PR_FALSE;
         nsresult rv = prefs->GetBoolPref(AUTODIAL_PREF, &enableAutodial);
         // If pref not found, default to disabled.
+        mAutoDialEnabled = enableAutodial;
         if (NS_SUCCEEDED(rv)) {
             if (mSocketTransportService)
                 mSocketTransportService->SetAutodialEnabled(enableAutodial);
         }
     }
 
     if (!pref || strcmp(pref, MANAGE_OFFLINE_STATUS_PREF) == 0) {
         PRBool manage;
--- a/netwerk/base/src/nsIOService.h
+++ b/netwerk/base/src/nsIOService.h
@@ -156,16 +156,17 @@ private:
     nsWeakPtr                            mWeakHandler[NS_N(gScheme)];
 
     // cached categories
     nsCategoryCache<nsIChannelEventSink> mChannelEventSinks;
     nsCategoryCache<nsIContentSniffer>   mContentSniffers;
 
     nsTArray<PRInt32>                    mRestrictedPortList;
 
+    PRPackedBool                         mAutoDialEnabled;
 public:
     // Necko buffer cache. Used for all default buffer sizes that necko
     // allocates.
     static nsIMemory *gBufferCache;
     static PRUint32   gDefaultSegmentSize;
     static PRUint32   gDefaultSegmentCount;
 };