Bug 1127230: Change the NPAPI sandbox prefs to integers to indicate the level of sandboxing. r=bsmedberg

This commit is contained in:
Bob Owen
2015-01-30 17:48:15 +00:00
parent 764e4f1472
commit 4811c84eb6
8 changed files with 31 additions and 35 deletions

View File

@@ -394,12 +394,12 @@ PluginModuleChromeParent::LoadModule(const char* aFilePath, uint32_t aPluginId,
{
PLUGIN_LOG_DEBUG_FUNCTION;
bool enableSandbox = false;
int32_t sandboxLevel = 0;
#if defined(XP_WIN) && defined(MOZ_SANDBOX)
nsAutoCString sandboxPref("dom.ipc.plugins.sandbox.");
nsAutoCString sandboxPref("dom.ipc.plugins.sandbox-level.");
sandboxPref.Append(aPluginTag->GetNiceFileName());
if (NS_FAILED(Preferences::GetBool(sandboxPref.get(), &enableSandbox))) {
enableSandbox = Preferences::GetBool("dom.ipc.plugins.sandbox.default");
if (NS_FAILED(Preferences::GetInt(sandboxPref.get(), &sandboxLevel))) {
sandboxLevel = Preferences::GetInt("dom.ipc.plugins.sandbox-level.default");
}
#endif
@@ -408,7 +408,7 @@ PluginModuleChromeParent::LoadModule(const char* aFilePath, uint32_t aPluginId,
parent->mSubprocess->SetCallRunnableImmediately(!parent->mIsStartingAsync);
TimeStamp launchStart = TimeStamp::Now();
bool launched = parent->mSubprocess->Launch(Move(onLaunchedRunnable),
enableSandbox);
sandboxLevel);
if (!launched) {
// We never reached open
parent->mShutdown = true;