widget code should called nsIPlatformCharset by using do_GetService

RESOLVED FIXED in M15

Status

()

Core
XUL
P3
normal
RESOLVED FIXED
18 years ago
18 years ago

People

(Reporter: Frank Tang, Assigned: nhottanscp)

Tracking

({perf})

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: patch ready)

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
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 nhotta
mozilla/widget/src/gtk/nsFileWidget.cpp
416 nhotta   1.37   // Create an unicode converter for file system charset
417                 if (nsnull == gUnicodeEncoder) {
418                     nsAutoString localeCharset;
419               
420                     nsCOMPtr <nsIPlatformCharset> platformCharset;
421                     rv = 
nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_PROGID, nsnull, 
422                                                             
NS_GET_IID(nsIPlatformCharset), getter_AddRefs(platformCharset));
423 


mozilla/widget/src/mac/nsMacControl.cpp
596                       nsCOMPtr <nsIPlatformCharset> platformCharset;
597                       rv = 
nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_PROGID, nsnull, 
598                                                               
NS_GET_IID(nsIPlatformCharset), getter_AddRefs(platformCharset));


widget/src/windows/nsFileWidget.cpp#381
380     nsCOMPtr <nsIPlatformCharset> platformCharset;
381     rv = nsComponentManager::CreateInstance(NS_PLATFORMCHARSET_PROGID, 
nsnull, 
382                                             NS_GET_IID(nsIPlatformCharset), 
getter_AddRefs(platformCharset));
(Reporter)

Updated

18 years ago
Blocks: 30201
(Reporter)

Comment 1

18 years ago
performance issue add perf keyword
Keywords: perf
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Target Milestone: M15
(Assignee)

Updated

18 years ago
Summary: widget code should called nsIPlatformCharset by using NS_WITH_SERVICE → widget code should called nsIPlatformCharset by using do_GetService
(Assignee)

Comment 2

18 years ago
Created attachment 6080 [details] [diff] [review]
patch

Updated

18 years ago
Whiteboard: patch ready
(Assignee)

Comment 3

18 years ago
fix checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.