Bug 1405312 - Remove dead code from nsPluginHost; r=jimm
authorAlex Gaynor <agaynor@mozilla.com>
Tue, 03 Oct 2017 09:53:08 -0400
changeset 384252 e8a4604faef277558f5862cb8424160251f40006
parent 384251 0bf07287d61448f027f4f8de2e587a634bb70ec8
child 384253 29a20bc04c6f95f8014238511d2cce7f299fabf3
push id32625
push userarchaeopteryx@coole-files.de
push dateWed, 04 Oct 2017 09:11:07 +0000
treeherdermozilla-central@933b30269777 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1405312
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1405312 - Remove dead code from nsPluginHost; r=jimm MozReview-Commit-ID: BsZIoTeZrNL
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginHost.h
--- 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);