Closed Bug 30210 Opened 24 years ago Closed 24 years ago

nsPrimitiveHelpers.cpp should called nsIPlatformCharset by using do_GetService

Categories

(Core :: XUL, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: ftang, Assigned: nhottanscp)

References

Details

(Keywords: perf)

Attachments

(1 file)

This is a performance problem . Part of 30201. 
nsIPlatformCharset is deisgned to be used as a service/singleton. The following 
places call it by CreateInstance, which cause peroformance problem-

cvsblame show pinkerton

mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp

147                   nsCOMPtr <nsIPlatformCharset> platformCharsetService;
148                   nsAutoString platformCharset;
149                   nsresult res = 
nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_PROGID, nsnull, 
150                                                                      
NS_GET_IID(nsIPlatformCharset), 
151                                                                      
getter_AddRefs(platformCharsetService));
152                   if (NS_SUCCEEDED(res))



202                   nsCOMPtr <nsIPlatformCharset> platformCharsetService;
203                   nsAutoString platformCharset;
204                   nsresult res = 
nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_PROGID, nsnull, 
205                                                                      
NS_GET_IID(nsIPlatformCharset), 
206                                                                      
getter_AddRefs(platformCharsetService));
Blocks: 30201
also mozilla/widget/src/xpwidgets/nsXIFFormatConverter.cpp

288                    nsCOMPtr <nsIPlatformCharset> platformCharsetService;
289                    nsresult res = 
nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_PROGID, nsnull, 
290                                                                       
NS_GET_IID(nsIPlatformCharset), 
291                                                                       
getter_AddRefs(platformCharsetService));

performance issue add perf keyword
Keywords: perf
I have same kind of bug in other places, reassign to me.
Assignee: pinkerton → nhotta
Status: NEW → ASSIGNED
Target Milestone: M15
Summary: nsPrimitiveHelpers.cpp should called nsIPlatformCharset by using NS_WITH_SERVICE → nsPrimitiveHelpers.cpp should called nsIPlatformCharset by using do_GetService
Attached patch patchSplinter Review
fix checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.