Remove nsIPluginTagInfo2, fold it into nsIPluginTagInfo. b=501812 r/sr=jst

This commit is contained in:
Josh Aas 2009-07-01 20:54:18 -04:00
parent 3f48024026
commit d5e66a3fb6
8 changed files with 120 additions and 191 deletions

View File

@ -74,7 +74,6 @@
#include "nsIPluginInstanceOwner.h"
#include "nsIPluginInstance.h"
#include "nsIPluginTagInfo.h"
#include "nsIPluginTagInfo2.h"
#include "plstr.h"
#include "nsILinkHandler.h"
#include "nsIEventListener.h"
@ -233,7 +232,7 @@ public:
class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
public nsIPluginTagInfo2,
public nsIPluginTagInfo,
public nsIEventListener,
public nsITimerCallback,
public nsIDOMMouseListener,
@ -241,7 +240,6 @@ class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
public nsIDOMKeyListener,
public nsIDOMFocusListener,
public nsIScrollPositionListener
{
public:
nsPluginInstanceOwner();
@ -286,8 +284,6 @@ public:
NS_IMETHOD GetAttribute(const char* name, const char* *result);
//nsIPluginTagInfo2 interface
NS_IMETHOD GetTagType(nsPluginTagType *result);
NS_IMETHOD GetTagText(const char* *result);
@ -2276,7 +2272,6 @@ NS_IMPL_RELEASE(nsPluginInstanceOwner)
NS_INTERFACE_MAP_BEGIN(nsPluginInstanceOwner)
NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner)
NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo)
NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo2)
NS_INTERFACE_MAP_ENTRY(nsIEventListener)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener)

View File

@ -70,7 +70,6 @@ XPIDLSRCS = \
nsIHTTPHeaderListener.idl \
nsIPluginTag.idl \
nsIPluginTagInfo.idl \
nsIPluginTagInfo2.idl \
nsIPluginInputStream.idl \
nsIPluginStreamListener.idl \
nsIPluginInstance.idl \

View File

@ -35,23 +35,22 @@
*
* ***** END LICENSE BLOCK ***** */
/**
* nsIPluginTagInfo
*
* @status DEPRECATED
*
* Originally published XPCOM Plugin API is now deprecated
* Developers are welcome to use NPAPI, please refer to:
* http://mozilla.org/projects/plugins/
*/
#include "nsISupports.idl"
#include "nspluginroot.idl"
%{C++
#include "nsplugindefs.h"
enum nsPluginTagType {
nsPluginTagType_Unknown,
nsPluginTagType_Embed,
nsPluginTagType_Object,
nsPluginTagType_Applet
};
%}
native nsPluginTagType(nsPluginTagType);
interface nsIDOMElement;
/**
@ -60,7 +59,7 @@ interface nsIDOMElement;
* Some day this might get superseded by a DOM API.
*/
[uuid(5f1ec1d0-019b-11d2-815b-006008119d7a)]
[uuid(6D827DF5-B5CD-416C-85CB-3CDD05C7AED1)]
interface nsIPluginTagInfo : nsISupports
{
/**
@ -76,14 +75,95 @@ interface nsIPluginTagInfo : nsISupports
in constCharStarConstStar aNames,
in constCharStarConstStar aValues);
/**
* Gets the value for the named attribute.
*
/**
* Gets the value for the named attribute.
*
* @param aName - the name of the attribute to find
* @param aResult - the resulting attribute
* @result - NS_OK if this operation was successful, NS_ERROR_FAILURE if
* this operation failed. result is set to NULL if the attribute is not found
* else to the found value.
*/
* @result - NS_OK if this operation was successful, NS_ERROR_FAILURE if
* this operation failed. result is set to NULL if the attribute is not found
* else to the found value.
*/
void getAttribute(in string aName, out constCharPtr aResult);
/**
* Get the type of the HTML tag that was used ot instantiate this
* plugin. Currently supported tags are EMBED, OBJECT and APPLET.
*/
readonly attribute nsPluginTagType tagType;
/**
* Get the complete text of the HTML tag that was used to instantiate this plugin.
*/
void getTagText(out constCharPtr aTagText);
/**
* Get a ptr to the paired list of parameter names and values,
* returns the length of the array.
*
* Each name or value is a null-terminated string.
*/
void getParameters(in PRUint16Ref aCount,
in constCharStarConstStar aNames,
in constCharStarConstStar aValues);
/**
* Get the value for the named parameter. Returns null
* if the parameter was not set.
*
* @param aName - name of the parameter
* @param aResult - parameter value
* @result - NS_OK if this operation was successful
*/
void getParameter(in string aName, out constCharPtr aResult);
/**
* Get the document base
*/
void getDocumentBase(out constCharPtr aDocumentBase);
/**
* Return an encoding whose name is specified in:
* http://java.sun.com/products/jdk/1.1/docs/guide/intl/intl.doc.html#25303
*/
void getDocumentEncoding(out constCharPtr aDocumentEncoding);
/**
* Get object alignment
*/
void getAlignment(out constCharPtr aElignment);
/**
* Get object width
*/
readonly attribute unsigned long width;
/**
* Get object height
*/
readonly attribute unsigned long height;
/**
* Get border vertical space
*/
readonly attribute unsigned long borderVertSpace;
/**
* Get border horizontal space
*/
readonly attribute unsigned long borderHorizSpace;
/**
* Returns a unique id for the current document containing plugin
*/
readonly attribute unsigned long uniqueID;
/**
* Returns the DOM element corresponding to the tag which references
* this plugin in the document.
*
* @param aDOMElement - resulting DOM element
* @result - NS_OK if this operation was successful
*/
readonly attribute nsIDOMElement DOMElement;
};

View File

@ -1,144 +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 ***** */
/**
* nsIPluginTagInfo2
*
* @status DEPRECATED
*
* Originally published XPCOM Plugin API is now deprecated
* Developers are welcome to use NPAPI, please refer to:
* http://mozilla.org/projects/plugins/
*/
#include "nsIPluginTagInfo.idl"
%{C++
enum nsPluginTagType {
nsPluginTagType_Unknown,
nsPluginTagType_Embed,
nsPluginTagType_Object,
nsPluginTagType_Applet
};
%}
native nsPluginTagType(nsPluginTagType);
[uuid(6a49c9a0-019b-11d2-815b-006008119d7a)]
interface nsIPluginTagInfo2 : nsIPluginTagInfo
{
/**
* Get the type of the HTML tag that was used ot instantiate this
* plugin. Currently supported tags are EMBED, OBJECT and APPLET.
*/
readonly attribute nsPluginTagType tagType;
/**
* Get the complete text of the HTML tag that was used to instantiate this plugin.
*/
void getTagText(out constCharPtr aTagText);
/**
* Get a ptr to the paired list of parameter names and values,
* returns the length of the array.
*
* Each name or value is a null-terminated string.
*/
void getParameters(in PRUint16Ref aCount,
in constCharStarConstStar aNames,
in constCharStarConstStar aValues);
/**
* Get the value for the named parameter. Returns null
* if the parameter was not set.
*
* @param aName - name of the parameter
* @param aResult - parameter value
* @result - NS_OK if this operation was successful
*/
void getParameter(in string aName, out constCharPtr aResult);
/**
* Get the document base
*/
void getDocumentBase(out constCharPtr aDocumentBase);
/**
* Return an encoding whose name is specified in:
* http://java.sun.com/products/jdk/1.1/docs/guide/intl/intl.doc.html#25303
*/
void getDocumentEncoding(out constCharPtr aDocumentEncoding);
/**
* Get object alignment
*/
void getAlignment(out constCharPtr aElignment);
/**
* Get object width
*/
readonly attribute unsigned long width;
/**
* Get object height
*/
readonly attribute unsigned long height;
/**
* Get border vertical space
*/
readonly attribute unsigned long borderVertSpace;
/**
* Get border horizontal space
*/
readonly attribute unsigned long borderHorizSpace;
/**
* Returns a unique id for the current document containing plugin
*/
readonly attribute unsigned long uniqueID;
/**
* Returns the DOM element corresponding to the tag which references
* this plugin in the document.
*
* @param aDOMElement - resulting DOM element
* @result - NS_OK if this operation was successful
*/
readonly attribute nsIDOMElement DOMElement;
};

View File

@ -1042,7 +1042,7 @@ nsresult
nsNPAPIPluginInstance::GetTagType(nsPluginTagType *result)
{
if (mOwner) {
nsCOMPtr<nsIPluginTagInfo2> tinfo(do_QueryInterface(mOwner));
nsCOMPtr<nsIPluginTagInfo> tinfo(do_QueryInterface(mOwner));
if (tinfo)
return tinfo->GetTagType(result);
}
@ -1055,7 +1055,7 @@ nsNPAPIPluginInstance::GetAttributes(PRUint16& n, const char*const*& names,
const char*const*& values)
{
if (mOwner) {
nsCOMPtr<nsIPluginTagInfo2> tinfo(do_QueryInterface(mOwner));
nsCOMPtr<nsIPluginTagInfo> tinfo(do_QueryInterface(mOwner));
if (tinfo)
return tinfo->GetAttributes(n, names, values);
}
@ -1068,7 +1068,7 @@ nsNPAPIPluginInstance::GetParameters(PRUint16& n, const char*const*& names,
const char*const*& values)
{
if (mOwner) {
nsCOMPtr<nsIPluginTagInfo2> tinfo(do_QueryInterface(mOwner));
nsCOMPtr<nsIPluginTagInfo> tinfo(do_QueryInterface(mOwner));
if (tinfo)
return tinfo->GetParameters(n, names, values);
}
@ -1733,7 +1733,7 @@ nsNPAPIPluginInstance::GetDOMElement(nsIDOMElement* *result)
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPluginTagInfo2> tinfo(do_QueryInterface(mOwner));
nsCOMPtr<nsIPluginTagInfo> tinfo(do_QueryInterface(mOwner));
if (tinfo)
return tinfo->GetDOMElement(result);

View File

@ -44,8 +44,8 @@
#include "nsTArray.h"
#include "nsIPlugin.h"
#include "nsIPluginInstance.h"
#include "nsIPluginTagInfo2.h"
#include "nsIPluginInstanceInternal.h"
#include "nsIPluginTagInfo.h"
#include "nsPIDOMWindow.h"
#include "nsIPluginInstanceOwner.h"
#include "nsITimer.h"

View File

@ -192,7 +192,7 @@ static const char *kMinimumRegistryVersion = "0.9";
// CID's && IID's
static NS_DEFINE_IID(kIPluginInstanceIID, NS_IPLUGININSTANCE_IID);
static NS_DEFINE_CID(kPluginCID, NS_PLUGIN_CID);
static NS_DEFINE_IID(kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID);
static NS_DEFINE_IID(kIPluginTagInfoIID, NS_IPLUGINTAGINFO_IID);
static const char kDirectoryServiceContractID[] = "@mozilla.org/file/directory_service;1";
// Registry keys for caching plugin info
@ -1863,10 +1863,10 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
// by getting the tag type and checking for an error, we can determine if
// the frame is gone
if (mOwner) {
nsCOMPtr<nsIPluginTagInfo2> pti2 = do_QueryInterface(mOwner);
NS_ENSURE_TRUE(pti2, NS_ERROR_FAILURE);
nsCOMPtr<nsIPluginTagInfo> pti = do_QueryInterface(mOwner);
NS_ENSURE_TRUE(pti, NS_ERROR_FAILURE);
nsPluginTagType tagType;
if (NS_FAILED(pti2->GetTagType(&tagType)))
if (NS_FAILED(pti->GetTagType(&tagType)))
return NS_ERROR_FAILURE; // something happened to our object frame, so bail!
}
@ -3043,8 +3043,8 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiatePluginForChannel(nsIChannel* aChannel
// Called by nsPluginInstanceOwner (nsObjectFrame.cpp - embedded case)
NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbeddedPlugin(const char *aMimeType,
nsIURI* aURL,
nsIPluginInstanceOwner *aOwner)
nsIURI* aURL,
nsIPluginInstanceOwner *aOwner)
{
NS_ENSURE_ARG_POINTER(aOwner);
@ -3062,15 +3062,15 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbeddedPlugin(const char *aMimeType,
nsresult rv;
nsIPluginInstance *instance = nsnull;
nsCOMPtr<nsIPluginTagInfo2> pti2;
nsCOMPtr<nsIPluginTagInfo> pti;
nsPluginTagType tagType;
rv = aOwner->QueryInterface(kIPluginTagInfo2IID, getter_AddRefs(pti2));
rv = aOwner->QueryInterface(kIPluginTagInfoIID, getter_AddRefs(pti));
if (rv != NS_OK)
return rv;
rv = pti2->GetTagType(&tagType);
rv = pti->GetTagType(&tagType);
if ((rv != NS_OK) || !((tagType == nsPluginTagType_Embed)
|| (tagType == nsPluginTagType_Applet)
@ -3097,7 +3097,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbeddedPlugin(const char *aMimeType,
return rv;
nsCOMPtr<nsIDOMElement> elem;
pti2->GetDOMElement(getter_AddRefs(elem));
pti->GetDOMElement(getter_AddRefs(elem));
PRInt16 shouldLoad = nsIContentPolicy::ACCEPT; // default permit
nsresult rv =
@ -3180,11 +3180,11 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbeddedPlugin(const char *aMimeType,
*/
PRBool bHasPluginURL = PR_FALSE;
nsCOMPtr<nsIPluginTagInfo2> pti2(do_QueryInterface(aOwner));
nsCOMPtr<nsIPluginTagInfo> pti(do_QueryInterface(aOwner));
if (pti2) {
if (pti) {
const char *value;
bHasPluginURL = NS_SUCCEEDED(pti2->GetParameter("PLUGINURL", &value));
bHasPluginURL = NS_SUCCEEDED(pti->GetParameter("PLUGINURL", &value));
}
// if we didn't find a pluginURL param on the object tag,
@ -5148,10 +5148,10 @@ nsresult nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
rv = NS_NewURI(getter_AddRefs(url), absUrl);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIPluginTagInfo2> pti2 = do_QueryInterface(owner);
nsCOMPtr<nsIPluginTagInfo> pti = do_QueryInterface(owner);
nsCOMPtr<nsIDOMElement> element;
if (pti2)
pti2->GetDOMElement(getter_AddRefs(element));
if (pti)
pti->GetDOMElement(getter_AddRefs(element));
PRInt16 shouldLoad = nsIContentPolicy::ACCEPT;
rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_OBJECT_SUBREQUEST,

View File

@ -49,7 +49,6 @@
#include "nsIPlugin.h"
#include "nsIPluginTag.h"
#include "nsIPluginTagInfo2.h"
#include "nsPluginsDir.h"
#include "nsPluginDirServiceProvider.h"