Closed Bug 110781 Opened 23 years ago Closed 23 years ago

plugin scanning doesn't always catch duplicates

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: peterlubczynski-bugs, Assigned: peterlubczynski-bugs)

References

Details

(Whiteboard: [possible 0.9.4 branch cadidate???])

Attachments

(1 file)

As we are now increasing the number of folders scanned for plugins, it is
becoming more important that plugin code correctly identify duplicate plugins
found during the scan. Currently, we use a static method called
areTheSameFileNames in nsPluginHostImpl.cpp that attempts to weed out duplicates
based on filename. 

I propse this be replaced by 3 checks:
1) compare nsPluginTag->mName  (same name, same plugin)
2) compare nsPluginTag->mDescription
3) compare nsPlugingTag->mMimeTypeArray (same handlers, same plugin)

The reason for those three checks is because filenames can change as with
symlinks and on Mac. Quicktime updates the mName field with it's versions so 5.0
and 5.02 won't match. However, Java and Flash use mDescription, so we check for
that next. Finally, there are some plugins that update neither of those fields
on update new versions, so we need to check the mime type array as well.
*** Bug 110778 has been marked as a duplicate of this bug. ***
Blocks: 110768
Attachment #58377 - Attachment description: patch for deep copy → patch for deep compare
Comment on attachment 58377 [details] [diff] [review]
patch for deep compare

I like the patch, r=av

You may want o add a null-check, like

PRBool nsPluginTag::Equals(nsPluginTag *aPluginTag)
{
  if(!aPluginTag)
    return PR_FALSE;

Also, this code will not catch duplicates which are only different by the order
of the mime type listed, but I think this kind of situation is not likely.
Attachment #58377 - Flags: review+
Wcan we can also compare mLibrary on Unix, thus addressing bug 110768.
Comment on attachment 58377 [details] [diff] [review]
patch for deep compare

sr=beard
Attachment #58377 - Flags: superreview+
No longer blocks: 110768
*** Bug 110768 has been marked as a duplicate of this bug. ***
Thanks!  I added a null pointer check/assertion but I think the mLibrary isn't
needed. Checking the order of mime types should be enough to catch duplicates.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Whiteboard: [possible 0.9.4 branch cadidate???]
plugins get scanned fine now and are listed according to version numbers.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: