Closed Bug 329230 Opened 18 years ago Closed 1 month ago

Prefix "cache" in RDFServiceImpl::GetResource() can lead to mishandling of resource URIs

Categories

(Core Graveyard :: RDF, defect)

x86
Windows XP
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: matthew.gertner, Unassigned)

References

()

Details

Attachments

(1 obsolete file)

RDFServiceImpl::GetResource() uses the prefix (i.e. scheme) of the resource URI to identify a factory to instantiate the resource implementation. If no factory is found for that prefix, the default one is used. For optimization purposes, the method remembers the last prefix and factory used.

This goes wrong if a resource is instantiated with the URI "foo" (no prefix so the default factory is used) and then a foo:bar resource is instantiated, where the foo: prefix has its own factory. Because the URI "foo" is remembered erroneously as the last prefix, the default factory is used instead of the foo factory.
Sadly, we can't just error in onvalid URIs. Localstore and in particular,
XUL persistance, has it all over.

Pfft.
Yeah, I guess the right thing to do is not remember the "last prefix" if the URI is invalid. I'll take the bug and propose a patch when I get a chance.
Status: NEW → ASSIGNED
Assignee: nobody → matthew
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
This is a patch that can actually be applied to a normal Mozilla tree without the need for hand-tweaking (as was the case with the previous version). I also made a number of the changes Daniel asked for, mostly (but not exclusively) to do with formatting. I haven't changed the behavior (e.g. of minimizeAll) or added features (e.g. number of clicks to restore) since I still hold out the hope that someone who actually wants these will pick up the ball and implement them.

A much bigger problem with the current patch is that it still crashes when you right-click a few times on the tray icon. I spent a considerable amount of time investigating this, but I don't know anything about the handling of events and frames inside Mozilla, and the code is too complex to fix this or find a workaround without a significant time investment.

If someone knowledgeable in this area can help out (at least by giving me a nudge in the right direction) this would be greatly appreciated. Otherwise this patch is basically useless.
Comment on attachment 226161 [details] [diff] [review]
Patch that can be applied painlessly
[Wrong bug]

Sorry wrong bug :-O
Attachment #226161 - Attachment is obsolete: true
Taking this off my todo list since we're no longer using Mozilla's RDF implementation.
Assignee: matthew → nobody
Status: ASSIGNED → NEW
Attachment #226161 - Attachment description: Patch that can be applied painlessly → Patch that can be applied painlessly [Wrong bug]
Product: Core → Core Graveyard
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: