Bug 1405312 - Remove dead code from nsPluginHost; r?jimm draft
authorAlex Gaynor <agaynor@mozilla.com>
Tue, 03 Oct 2017 09:53:08 -0400
changeset 674222 230783cb751d83de29e0fcb8c59939905e9844b4
parent 674178 11fe0a2895aab26c57bcfe61b3041d7837e954cd
child 734263 c0b519e6326c327208b85f84fc5e45550668f119
push id82763
push userbmo:agaynor@mozilla.com
push dateTue, 03 Oct 2017 13:53:26 +0000
reviewersjimm
bugs1405312
milestone58.0a1
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);