Closed Bug 28780 Opened 25 years ago Closed 24 years ago

Why doesn't nsProfileAccess use nsISupports?

Categories

(Core Graveyard :: Profile: BackEnd, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED INVALID

People

(Reporter: bruce, Assigned: ccarlen)

Details

Why doesn't this use nsISupports for the nsProfileAccess? 177 nsProfile::nsProfile() 178 { 179 mAutomigrate = PR_FALSE; 180 181 if(!gProfileDataAccess) 182 gProfileDataAccess = new nsProfileAccess(); 183 184 gDataAccessInstCount++; 185 186 NS_INIT_REFCNT(); 187 } 188 189 nsProfile::~nsProfile() 190 { 191 #if defined(DEBUG_profile) 192 printf("~nsProfile \n"); 193 #endif 194 195 CleanUp(); 196 gProfileDataAccess->UpdateRegistry(); 197 198 gDataAccessInstCount--; 199 if (gDataAccessInstCount == 0) 200 delete gProfileDataAccess; 201 } 202
Updating summary to be more descriptive.
Assignee: selmer → racham
Summary: Why does this not use nsISupports? → Why doesn't nsProfile use nsISupports?
ProfileAccess is a class that is and need to be accessed only by nsProfile. It is like a utility class for profile data maintenance. It needed to maintain the count so that when the destructor called on profile, the operation won't affect the data in the profile access class.
Summary: Why doesn't nsProfile use nsISupports? → Why doesn't nsProfileAccess use nsISupports?
One advantage to using nsISupports here, even in this case is that it is a familiar pattern used throughout the code. It makes it obvious what should be done and there aren't any questions. It also gets rid of a static global variable which isn't needed all the time (and moves it elsewhere).
I agree that is a standard. We will do that in our post-beta schedule. Thanks.
Status: NEW → ASSIGNED
Target Milestone: M15
Target Milestone: M15 → M17
Target Milestone: M17 → M18
Will probably get to this in later milestones.. Not in beta3.
Target Milestone: M18 → M20
Doing a mass reassign to Conrad Carlen. Conrad is going address all current and upcoming profile manager issues. Please do not hesitate to involve me in any of the issues.
Assignee: racham → ccarlen
Status: ASSIGNED → NEW
It doesn't need to use nsISupports because nsProfileAccess is only used internally by nsProfile. Having it it not be derived from nsISupports makes this usage clear. Also, just having it use nsISupports wouldn't get rid of the static variable anyway. That was being done to prevent more than one instance of an nsProfileAccess object form being created even if more than one instance of nsProfile was.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
vfy
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.