From c530cd6322072129b0664649dfc3e4caac1dd64f Mon Sep 17 00:00:00 2001 From: Josh Aas Date: Wed, 11 May 2011 16:23:25 -0400 Subject: [PATCH] Bug 637253: Remove nsIPlugin interface. r=bsmedberg --- dom/plugins/base/Makefile.in | 1 - dom/plugins/base/nsIPlugin.idl | 69 --------------------- dom/plugins/base/nsIPluginHost.idl | 5 +- dom/plugins/base/nsIPluginInstanceOwner.idl | 1 - dom/plugins/base/nsNPAPIPlugin.cpp | 4 +- dom/plugins/base/nsNPAPIPlugin.h | 7 ++- dom/plugins/base/nsPluginHost.cpp | 5 +- dom/plugins/base/nsPluginHost.h | 3 +- dom/plugins/base/nsPluginTags.h | 1 - 9 files changed, 11 insertions(+), 85 deletions(-) delete mode 100644 dom/plugins/base/nsIPlugin.idl diff --git a/dom/plugins/base/Makefile.in b/dom/plugins/base/Makefile.in index c30679033d2..fdc6c0d73d2 100644 --- a/dom/plugins/base/Makefile.in +++ b/dom/plugins/base/Makefile.in @@ -54,7 +54,6 @@ EXPORTS_NAMESPACES = mozilla XPIDLSRCS = \ nsIHTTPHeaderListener.idl \ - nsIPlugin.idl \ nsIPluginDocument.idl \ nsIPluginHost.idl \ nsIPluginInputStream.idl \ diff --git a/dom/plugins/base/nsIPlugin.idl b/dom/plugins/base/nsIPlugin.idl deleted file mode 100644 index 10ee3601209..00000000000 --- a/dom/plugins/base/nsIPlugin.idl +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsISupports.idl" -#include "nspluginroot.idl" - -%{C++ -#include "npapi.h" - -#define MOZ_PLUGIN_CONTRACTID \ - "@mozilla.org/plugin/plugin;1" -%} - -interface nsIPluginInstance; - -[uuid(94C32FEA-5C50-49D3-9D3D-9047CD342777)] -interface nsIPlugin : nsISupports -{ - /** - * Creates a new plugin instance, based on a MIME type. This - * allows different impelementations to be created depending on - * the specified MIME type. - */ - void createPluginInstance(out nsIPluginInstance aResult); - - /** - * Called when the browser is done with the plugin factory, or when - * the plugin is disabled by the user. - * - * (Corresponds to NPP_Shutdown.) - * - * @result - NS_OK if this operation was successful - */ - void shutdown(); -}; diff --git a/dom/plugins/base/nsIPluginHost.idl b/dom/plugins/base/nsIPluginHost.idl index 01f9c5136de..8375761da85 100644 --- a/dom/plugins/base/nsIPluginHost.idl +++ b/dom/plugins/base/nsIPluginHost.idl @@ -55,7 +55,6 @@ "@mozilla.org/plugin/host;1" %} -interface nsIPlugin; interface nsIURI; interface nsIDOMPlugin; interface nsIChannel; @@ -64,7 +63,7 @@ interface nsIPluginStreamListener; [ptr] native PRLibraryPtr(PRLibrary); [ptr] native nsPluginNativeWindowPtr(nsPluginNativeWindow); -[scriptable, uuid(0BB66261-4114-4D73-8DFC-C3CA997E6817)] +[scriptable, uuid(FB2E7827-1E7D-4DCC-93A8-94098A4B588D)] interface nsIPluginHost : nsISupports { [noscript] void init(); @@ -82,8 +81,6 @@ interface nsIPluginHost : nsISupports */ void reloadPlugins(in boolean reloadPages); - [noscript] nsIPlugin getPlugin(in string aMimeType); - /** * Instantiate an embedded plugin for an existing channel. The caller is * responsible for opening the channel. It may or may not be already opened diff --git a/dom/plugins/base/nsIPluginInstanceOwner.idl b/dom/plugins/base/nsIPluginInstanceOwner.idl index dafcbd1dd9f..f3267f3a1e6 100644 --- a/dom/plugins/base/nsIPluginInstanceOwner.idl +++ b/dom/plugins/base/nsIPluginInstanceOwner.idl @@ -37,7 +37,6 @@ #include "nsISupports.idl" #include "nspluginroot.idl" -#include "nsIPlugin.idl" #include "nsIInputStream.idl" interface nsIPluginInstance; diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index 00caf6cf7a1..a27f1d1fb28 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -233,7 +233,7 @@ static void CheckClassInitialized() NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL,("NPN callbacks initialized\n")); } -NS_IMPL_ISUPPORTS1(nsNPAPIPlugin, nsIPlugin) +NS_IMPL_ISUPPORTS0(nsNPAPIPlugin) nsNPAPIPlugin::nsNPAPIPlugin() { @@ -534,7 +534,7 @@ nsNPAPIPlugin::PluginFuncs() return &mPluginFuncs; } -NS_IMETHODIMP +nsresult nsNPAPIPlugin::CreatePluginInstance(nsIPluginInstance **aResult) { if (!aResult) diff --git a/dom/plugins/base/nsNPAPIPlugin.h b/dom/plugins/base/nsNPAPIPlugin.h index e539a533d65..016b850bfe4 100644 --- a/dom/plugins/base/nsNPAPIPlugin.h +++ b/dom/plugins/base/nsNPAPIPlugin.h @@ -38,7 +38,6 @@ #ifndef nsNPAPIPlugin_h_ #define nsNPAPIPlugin_h_ -#include "nsIPlugin.h" #include "prlink.h" #include "npfunctions.h" #include "nsPluginHost.h" @@ -72,7 +71,7 @@ typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGININIT) (const NPNetscapeFuncs* typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINUNIXINIT) (const NPNetscapeFuncs* pCallbacks, NPPluginFuncs* fCallbacks); typedef NS_NPAPIPLUGIN_CALLBACK(NPError, NP_PLUGINSHUTDOWN) (); -class nsNPAPIPlugin : public nsIPlugin +class nsNPAPIPlugin : public nsISupports { private: typedef mozilla::PluginLibrary PluginLibrary; @@ -82,7 +81,6 @@ public: virtual ~nsNPAPIPlugin(); NS_DECL_ISUPPORTS - NS_DECL_NSIPLUGIN // Constructs and initializes an nsNPAPIPlugin object. A NULL file path // will prevent this from calling NP_Initialize. @@ -105,6 +103,9 @@ public: static PRBool RunPluginOOP(const nsPluginTag *aPluginTag); + nsresult CreatePluginInstance(nsIPluginInstance **aResult); + nsresult Shutdown(); + protected: NPPluginFuncs mPluginFuncs; PluginLibrary* mLibrary; diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index 3ea289294a9..ff5a7022c81 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -49,7 +49,6 @@ #include "nsIComponentManager.h" #include "nsNPAPIPlugin.h" #include "nsNPAPIPluginStreamListener.h" -#include "nsIPlugin.h" #include "nsNPAPIPluginInstance.h" #include "nsIPluginStreamListener.h" #include "nsIHTTPHeaderListener.h" @@ -1323,7 +1322,7 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType, NS_ASSERTION(pluginTag, "Must have plugin tag here!"); - nsCOMPtr plugin; + nsRefPtr plugin; GetPlugin(mimetype, getter_AddRefs(plugin)); nsCOMPtr instance; @@ -1726,7 +1725,7 @@ nsresult nsPluginHost::EnsurePluginLoaded(nsPluginTag* plugin) return NS_OK; } -NS_IMETHODIMP nsPluginHost::GetPlugin(const char *aMimeType, nsIPlugin** aPlugin) +nsresult nsPluginHost::GetPlugin(const char *aMimeType, nsNPAPIPlugin** aPlugin) { nsresult rv = NS_ERROR_FAILURE; *aPlugin = NULL; diff --git a/dom/plugins/base/nsPluginHost.h b/dom/plugins/base/nsPluginHost.h index ed3b53554db..4caae3f3c30 100644 --- a/dom/plugins/base/nsPluginHost.h +++ b/dom/plugins/base/nsPluginHost.h @@ -46,7 +46,6 @@ #include "prclist.h" #include "npapi.h" #include "nsNPAPIPluginInstance.h" -#include "nsIPlugin.h" #include "nsIPluginTag.h" #include "nsPluginsDir.h" #include "nsPluginDirServiceProvider.h" @@ -178,6 +177,8 @@ public: // Does not accept NULL and should never fail. nsPluginTag* TagForPlugin(nsNPAPIPlugin* aPlugin); + nsresult GetPlugin(const char *aMimeType, nsNPAPIPlugin** aPlugin); + private: nsresult TrySetUpPluginInstance(const char *aMimeType, nsIURI *aURL, nsIPluginInstanceOwner *aOwner); diff --git a/dom/plugins/base/nsPluginTags.h b/dom/plugins/base/nsPluginTags.h index a680c1ed8db..5a68b536f27 100644 --- a/dom/plugins/base/nsPluginTags.h +++ b/dom/plugins/base/nsPluginTags.h @@ -45,7 +45,6 @@ #include "nsCOMPtr.h" #include "nsCOMArray.h" #include "nsIPluginTag.h" -#include "nsIPlugin.h" #include "nsNPAPIPluginInstance.h" #include "nsISupportsArray.h"