Closed
Bug 1061967
Opened 10 years ago
Closed 10 years ago
Move checking for special-cased plugin types to a central spot
Categories
(Core Graveyard :: Plug-ins, defect)
Core Graveyard
Plug-ins
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla38
People
(Reporter: johns, Assigned: bzbarsky)
References
Details
(Whiteboard: [shumway])
Attachments
(4 files, 2 obsolete files)
8.41 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
25.32 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
24.98 KB,
patch
|
Details | Diff | Splinter Review | |
8.36 KB,
patch
|
Details | Diff | Splinter Review |
Splitting out from bug 558184 - various spots in the tree are checking mime type strings for java/flash, some less consistently than others.
Reporter | ||
Comment 1•10 years ago
|
||
Adds nsPluginHost::IsSpecialType() to check for all the various MIME types we sniff, removes a ton of said checks from various spots. Many checks were not checking all possible mime types.
Reporter | ||
Comment 2•10 years ago
|
||
Reporter | ||
Comment 3•10 years ago
|
||
Updated•10 years ago
|
Whiteboard: [shumway]
Reporter | ||
Comment 4•10 years ago
|
||
New and improved, now compiles on OSes other than my own.
Attachment #8485978 -
Attachment is obsolete: true
Reporter | ||
Comment 5•10 years ago
|
||
(In reply to John Schoenick [:johns] from comment #3)
> https://tbpl.mozilla.org/?tree=Try&rev=10c9cfce49c7
(In reply to John Schoenick [:johns] from comment #4)
> Created attachment 8486591 [details] [diff] [review]
> Move checking for special-cased plugin types to a central spot
>
> New and improved, now compiles on OSes other than my own.
Let's try that again
https://tbpl.mozilla.org/?tree=Try&rev=a9f6fe815968
Reporter | ||
Comment 6•10 years ago
|
||
And then we found out that Preferences::GetCString() can return invalid strings that crash. Woo.
Attempt #3 went better
https://tbpl.mozilla.org/?tree=Try&rev=8222336cd7d4
https://tbpl.mozilla.org/?tree=Try&rev=96ea8a21e1c5
Attachment #8486591 -
Attachment is obsolete: true
Attachment #8487354 -
Flags: review?(benjamin)
Reporter | ||
Updated•10 years ago
|
Attachment #8485979 -
Flags: review?(benjamin)
Comment 7•10 years ago
|
||
Comment on attachment 8487354 [details] [diff] [review]
Move checking for special-cased plugin types to a central spot
Review of attachment 8487354 [details] [diff] [review]:
-----------------------------------------------------------------
That's a nice cleanup, adding some driveby commentary :)
::: content/base/src/nsObjectLoadingContent.cpp
@@ +115,5 @@
>
> static bool
> +IsJavaMIME(const nsACString & aMIMEType)
> +{
> + return nsPluginHost::IsSpecialType(aMIMEType) == \
Nit: Left-over back-slash?
::: dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ +537,5 @@
> // bug 108347, flash plugin on linux doesn't like window->width <=
> // 0, but Java needs wants this call.
> + if (window && window->type == NPWindowTypeWindow &&
> + (window->width <= 0 || window->height <= 0) &&
> + (nsPluginHost::IsSpecialType(nsDependentCString(mMIMEType)) != \
Nit: Left-over backslash?
::: dom/plugins/base/nsPluginHost.cpp
@@ +1577,5 @@
> + return eSpecialType_Silverlight;
> + }
> +
> + if (aMIMEType.LowerCaseEqualsASCII("audio/x-pn-realaudio-plugin")) {
> + NS_WARNING("You are loading real player");
Nit: Why does this plugin specifically get a warning?
::: dom/plugins/base/nsPluginHost.h
@@ +172,5 @@
> + // Native widget quirks
> + eSpecialType_PDF,
> + // Native widget quirks
> + eSpecialType_RealPlayer };
> + static SpecialType IsSpecialType(const nsACString & aMIMEType);
Usually |IsFoo()| functions would be expected to return a boolean though, maybe |GetSpecialType()|?
::: dom/plugins/base/nsPluginInstanceOwner.cpp
@@ +830,5 @@
>
> // Flash invokes InvalidateRect for us.
> const char* mime = nullptr;
> + if (NS_SUCCEEDED(mInstance->GetMIMEType(&mime)) && mime &&
> + nsPluginHost::IsSpecialType(nsDependentCString(mime)) == \
Nit: backslash
::: dom/plugins/base/nsPluginTags.cpp
@@ +162,5 @@
> + break;
> + case nsPluginHost::eSpecialType_Flash:
> + mIsFlashPlugin = true;
> + break;
> + case nsPluginHost::eSpecialType_None:
This line seems redundant?
Comment 8•10 years ago
|
||
"You are loading real player" should probably be "You are loading RealPlayer".
Updated•10 years ago
|
Attachment #8485979 -
Flags: review?(benjamin) → review+
Updated•10 years ago
|
Attachment #8487354 -
Flags: review?(benjamin) → review+
Comment 9•10 years ago
|
||
Comment on attachment 8487354 [details] [diff] [review]
Move checking for special-cased plugin types to a central spot
Review of attachment 8487354 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/plugins/base/nsPluginTags.cpp
@@ +155,5 @@
> continue;
> }
>
> // Look for certain special plugins.
> + switch (nsPluginHost::IsSpecialType(mimeType)) {
Looking here again from the bug 1074822 context... can't we just store this as |nsPluginTag::mSpecialType| instead and get rid of mIsFlashPlugin & mIsJavaPlugin and the switching here?
We could still have helper functions for convenience if needed.
Comment 10•10 years ago
|
||
Boris: bsmedberg r+'d this bug's jsplugin-related patches before johns left, but they never landed. Should these patches land with your jsplugins work?
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 11•10 years ago
|
||
Probably, yes. Thanks for the pointer!
Assignee | ||
Comment 12•10 years ago
|
||
Addresses the review comments, except comment 9: we can't really use nsPluginHost::SpecialType there, so needs a bit more thought on how best to store this
Assignee | ||
Updated•10 years ago
|
Assignee: john → bzbarsky
Assignee | ||
Comment 13•10 years ago
|
||
Assignee | ||
Comment 14•10 years ago
|
||
Flags: needinfo?(bzbarsky)
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 15•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/469e07a25f44
https://hg.mozilla.org/integration/mozilla-inbound/rev/234d306dfbba
Flags: needinfo?(bzbarsky)
Comment 16•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/469e07a25f44
https://hg.mozilla.org/mozilla-central/rev/234d306dfbba
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•