user_pref("plugin.dont_try_safe_calls", true); is ignored

RESOLVED WORKSFORME

Status

()

Core
Plug-ins
RESOLVED WORKSFORME
14 years ago
5 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

14 years ago
the "fix" for bug 166815 didn't actually _fix_ the problem...
(Assignee)

Comment 1

14 years ago
Created attachment 145308 [details] [diff] [review]
try to observe pref changes
(Assignee)

Updated

14 years ago
Attachment #145308 - Flags: review?(caillon)
Comment on attachment 145308 [details] [diff] [review]
try to observe pref changes

>+    nsCOMPtr<nsIPrefBranchInternal> pbi(do_QueryInterface(mPrefService));
>+    pbi->AddObserver("plugin", this, PR_FALSE);

Make sure QI succeeds.

>   }
> 
>   nsCOMPtr<nsIObserverService> obsService = do_GetService("@mozilla.org/observer-service;1");
>@@ -6089,7 +6092,7 @@
> ////////////////////////////////////////////////////////////////////////
> NS_IMETHODIMP nsPluginHostImpl::Observe(nsISupports *aSubject,
>                                         const char *aTopic,
>-                                        const PRUnichar *someData)
>+                                        const PRUnichar *aSomeData)

Since you're changing this, please change it to match the usual name of
|aData|.

> {
> #ifdef NS_DEBUG
>   printf("nsPluginHostImpl::Observe \"%s\"\n", aTopic ? aTopic : "");
>@@ -6100,6 +6103,18 @@
>   } else if (!nsCRT::strcmp(NS_XPCOM_SHUTDOWN_OBSERVER_ID, aTopic))

Care to fix this to use ::strcmp instead of the nsCRT version?

>   {
>     UnloadUnusedLibraries();
>+    if (mPrefService) {
>+      nsCOMPtr<nsIPrefBranchInternal> pbi(do_QueryInterface(mPrefService));
>+      pbi->RemoveObserver("plugin", this);

Again check the QI result.

>+    }
>+  } else if (!strcmp("nsPref:changed", aTopic)) {

NS_PREFBRANCH_PREFCHANGED_TOPIC_ID

>+    nsDependentString someData(aSomeData);
>+    if (someData.Equals(NS_LITERAL_STRING("plugin.dont_try_safe_calls")))
>+      mPrefService->GetBoolPref("plugin.dont_try_safe_calls", &gSkipPluginSafeCalls);
>+    else if (someData.Equals(NS_LITERAL_STRING("plugin.override_internal_types")))
>+      mPrefService->GetBoolPref("plugin.override_internal_types", &mOverrideInternalTypes);
>+    else if (someData.Equals(NS_LITERAL_STRING("plugin.allow_alien_star_handler")))
>+      mPrefService->GetBoolPref("plugin.allow_alien_star_handler", &mAllowAlienStarHandler);
>   }
>   return NS_OK;
> }


Shouldn't you also change FindPlugins() to not check the pref value all the
time its called, and move the initialization somewhere else?  But maybe not. 
I'm not familiar with the plugin architechture...
Attachment #145308 - Flags: review?(caillon)
what if those prefs are not set?
QA Contact: plugins
This got pref removed with bug 839731
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.