Bug 1405312 - Remove dead code from nsPluginHost; r?jimm
MozReview-Commit-ID: BsZIoTeZrNL
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -122,20 +122,16 @@ using mozilla::dom::FakePluginMimeEntry;
{ \
while (list_) { \
type_ temp = list_->mNext_; \
list_->mNext_ = nullptr; \
list_ = temp; \
} \
}
-// this is the name of the directory which will be created
-// to cache temporary files.
-#define kPluginTmpDirName NS_LITERAL_CSTRING("plugtmp")
-
static const char *kPrefWhitelist = "plugin.allowed_types";
static const char *kPrefLoadInParentPrefix = "plugin.load_in_parent_process.";
static const char *kPrefDisableFullPage = "plugin.disable_full_page_plugin_for_types";
// How long we wait before unloading an idle plugin process.
// Defaults to 30 seconds.
static const char *kPrefUnloadPluginTimeoutSecs = "dom.ipc.plugins.unloadTimeoutSecs";
static const uint32_t kDefaultPluginUnloadingTimeout = 30;
@@ -668,37 +664,16 @@ void nsPluginHost::OnPluginInstanceDestr
aPluginTag->mUnloadTimer->InitWithCallback(this,
1000 * unloadTimeout,
nsITimer::TYPE_ONE_SHOT);
}
}
}
nsresult
-nsPluginHost::GetPluginTempDir(nsIFile **aDir)
-{
- if (!sPluginTempDir) {
- nsCOMPtr<nsIFile> tmpDir;
- nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR,
- getter_AddRefs(tmpDir));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = tmpDir->AppendNative(kPluginTmpDirName);
-
- // make it unique, and mode == 0700, not world-readable
- rv = tmpDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0700);
- NS_ENSURE_SUCCESS(rv, rv);
-
- tmpDir.swap(sPluginTempDir);
- }
-
- return sPluginTempDir->Clone(aDir);
-}
-
-nsresult
nsPluginHost::InstantiatePluginInstance(const nsACString& aMimeType, nsIURI* aURL,
nsObjectLoadingContent *aContent,
nsPluginInstanceOwner** aOwner)
{
NS_ENSURE_ARG_POINTER(aOwner);
#ifdef PLUGIN_LOGGING
nsAutoCString urlSpec;
--- a/dom/plugins/base/nsPluginHost.h
+++ b/dom/plugins/base/nsPluginHost.h
@@ -177,18 +177,16 @@ public:
bool forceJSEnabled = false,
uint32_t getHeadersLength = 0,
const char* getHeaders = nullptr);
nsresult
AddHeadersToChannel(const char *aHeadersData, uint32_t aHeadersDataLen,
nsIChannel *aGenericChannel);
- static nsresult GetPluginTempDir(nsIFile **aDir);
-
// Helper that checks if a type is whitelisted in plugin.allowed_types.
// Always returns true if plugin.allowed_types is not set
static bool IsTypeWhitelisted(const char *aType);
// Helper that checks if a plugin of a given MIME type can be loaded by the
// parent process. It checks the plugin.load_in_parent_process.<mime> pref.
// Always returns false if plugin.load_in_parent_process.<mime> is not set.
static bool ShouldLoadTypeInParent(const nsACString& aMimeType);