Closed Bug 304845 Opened 19 years ago Closed 19 years ago

[FIXr]NS_CheckContent*Policy should allow cached service ptr

Categories

(Core :: DOM: Core & HTML, defect, P2)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

And nsContentUtils::CanLoadImage should use one.
Keywords: perf
Attached patch Like soSplinter Review
Attachment #192841 - Flags: superreview?(jst)
Attachment #192841 - Flags: review?(cbiesinger)
Priority: -- → P2
Summary: NS_CheckContent*Policy should allow cached service ptr → [FIX]NS_CheckContent*Policy should allow cached service ptr
Target Milestone: --- → mozilla1.9alpha
Comment on attachment 192841 [details] [diff] [review] Like so sr=jst
Attachment #192841 - Flags: superreview?(jst) → superreview+
Comment on attachment 192841 [details] [diff] [review] Like so content/base/public/nsContentPolicyUtils.h +#define CHECK_CONTENT_POLICY_WITH_SERVICE(action, _policy) \ might be nicer to have the service be the first argument. mmm, hidden returns... content/base/public/nsContentUtils.h + static nsIContentPolicy *GetContentPolicy() maybe better to group it with the other service-getting functions? (like img loader, io service, etc) since there can be a lot of content policy implementations, maybe this should be called GetContentPolicyService()? r=biesi either way.
Attachment #192841 - Flags: review?(cbiesinger) → review+
Summary: [FIX]NS_CheckContent*Policy should allow cached service ptr → [FIXr]NS_CheckContent*Policy should allow cached service ptr
> maybe better to group it with the other service-getting functions? Those are basically in static member order right now, which is what I used here. > maybe this should be called GetContentPolicyService()? I tried that, and it made it very hard to keep to 80-char limits in various places, hence the code in the current patch.
Fixed.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 192841 [details] [diff] [review] Like so >+ // It's also OK to not have a content policy service >+ CallGetService(NS_CONTENTPOLICY_CONTRACTID, &sContentPolicyService); >+ This caused a reentrant call to Initialize: Initialize(nsIModule * 0x00a34190) line 262 + 35 bytes nsGenericModule::Initialize(nsIComponentManager * 0x002aba20) line 272 + 10 bytes nsGenericModule::GetClassObject(nsGenericModule * const 0x00a34190, nsIComponentManager * 0x002aba20, const nsID & {...}, const nsID & {...}, void * * 0x0012f418) line 360 + 12 bytes nsNativeComponentLoader::GetFactoryFromModule(nsDll * 0x009d6df8, const nsID & {...}, nsIFactory * * 0x0012f418) line 1058 + 44 bytes nsNativeComponentLoader::GetFactory(nsNativeComponentLoader * const 0x00949780, const nsID & {...}, const char * 0x00982290, const char * 0x0094a560, nsIFactory * * 0x0012f418) line 143 + 20 bytes nsFactoryEntry::GetFactory(nsIFactory * * 0x0012f418, nsComponentManagerImpl * 0x002aba20) line 301 + 58 bytes nsComponentManagerImpl::CreateInstanceByContractID(nsComponentManagerImpl * const 0x002aba20, const char * 0x01a3b4c0, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012f460) line 1976 + 16 bytes nsComponentManagerImpl::GetServiceByContractID(nsComponentManagerImpl * const 0x002aba24, const char * 0x01a3b4c0, const nsID & {...}, void * * 0x01b0702c class nsIContentPolicy * nsContentUtils::sContentPolicyService) line 2408 + 50 bytes CallGetService(const char * 0x01a3b4c0, const nsID & {...}, void * * 0x01b0702c class nsIContentPolicy * nsContentUtils::sContentPolicyService) line 95 CallGetService(const char * 0x01a3b4c0, nsIContentPolicy * * 0x01b0702c class nsIContentPolicy * nsContentUtils::sContentPolicyService) line 130 + 20 bytes nsContentUtils::Init() line 164 + 15 bytes Initialize(nsIModule * 0x00a34190) line 270 + 5 bytes nsGenericModule::Initialize(nsIComponentManager * 0x002aba20) line 272 + 10 bytes nsGenericModule::GetClassObject(nsGenericModule * const 0x00a34190, nsIComponentManager * 0x002aba20, const nsID & {...}, const nsID & {...}, void * * 0x0012fa50) line 360 + 12 bytes nsNativeComponentLoader::GetFactoryFromModule(nsDll * 0x009d6df8, const nsID & {...}, nsIFactory * * 0x0012fa50) line 1058 + 44 bytes nsNativeComponentLoader::GetFactory(nsNativeComponentLoader * const 0x00949780, const nsID & {...}, const char * 0x00951298, const char * 0x0094a560, nsIFactory * * 0x0012fa50) line 143 + 20 bytes nsFactoryEntry::GetFactory(nsIFactory * * 0x0012fa50, nsComponentManagerImpl * 0x002aba20) line 301 + 58 bytes nsComponentManagerImpl::CreateInstance(nsComponentManagerImpl * const 0x002aba20, const nsID & {...}, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012faa8) line 1895 + 16 bytes CallCreateInstance(const nsID & {...}, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012faa8) line 158 nsCreateInstanceByCID::operator()(const nsID & {...}, void * * 0x0012faa8) line 199 + 27 bytes nsCOMPtr<nsIDOMRange>::assign_from_helper(const nsCOMPtr_helper & {...}, const nsID & {...}) line 1292 + 18 bytes nsCOMPtr<nsIDOMRange>::operator=(const nsCOMPtr_helper & {...}) line 781 nsTypeAheadFind::Init() line 190 nsTypeAheadFind::GetInstance() line 230 + 11 bytes nsTypeAheadFindConstructor(nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012fbf0) line 85 + 38 bytes nsGenericFactory::CreateInstance(nsGenericFactory * const 0x00a339b8, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012fbf0) line 79 + 21 bytes nsComponentManagerImpl::CreateInstanceByContractID(nsComponentManagerImpl * const 0x002aba20, const char * 0x0012fd50, nsISupports * 0x00000000, const nsID & {...}, void * * 0x0012fbf0) line 1981 + 24 bytes nsComponentManagerImpl::GetServiceByContractID(nsComponentManagerImpl * const 0x002aba24, const char * 0x0012fd50, const nsID & {...}, void * * 0x0012fc5c) line 2408 + 50 bytes CallGetService(const char * 0x0012fd50, const nsID & {...}, void * * 0x0012fc5c) line 95 nsGetServiceByContractIDWithError::operator()(const nsID & {...}, void * * 0x0012fc5c) line 288 + 19 bytes nsCOMPtr<nsIObserver>::assign_from_gs_contractid_with_error(const nsGetServiceByContractIDWithError & {...}, const nsID & {...}) line 1282 + 17 bytes nsCOMPtr<nsIObserver>::operator=(const nsGetServiceByContractIDWithError & {...}) line 772 nsAppStartupNotifier::Observe(nsAppStartupNotifier * const 0x009e39e8, nsISupports * 0x00000000, const char * 0x0041ca20, const unsigned short * 0x00000000) line 99 main1(int 1, char * * 0x002a2db8, nsISupports * 0x00952220) line 1059 main(int 1, char * * 0x002a2db8) line 1738 + 37 bytes mainCRTStartup() line 338 + 17 bytes
I filed Bug 305310 about that assertion.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: