Bug 1406829 (part 3) - Use [ptr] native for nsAtom pointers in .idl files. r=froydnj.

Even though it's more verbose because of the `%{C++` section, it's the proper
way to do this kind of thing, rather than faking it with `interface`.
This commit is contained in:
Nicholas Nethercote 2017-10-11 08:34:38 +11:00
parent 1de4b467c1
commit f4bf415086
5 changed files with 33 additions and 15 deletions

View File

@ -5,7 +5,6 @@
#include "domstubs.idl"
interface nsAtom; // not a real interface; used in [noscript] methods only
interface nsIContent;
interface nsIXULBuilderListener;
interface nsIXULTemplateResult;
@ -15,6 +14,11 @@ interface nsIRDFResource;
interface nsIRDFCompositeDataSource;
interface nsIDOMDataTransfer;
%{C++
class nsAtom;
%}
[ptr] native nsAtomPtr(nsAtom);
/**
* A template builder, given an input source of data, a template, and a
* reference point, generates a list of results from the input, and copies
@ -268,7 +272,7 @@ interface nsIXULTemplateBuilder : nsISupports
* @param aTag tag that must match
*/
[noscript] boolean hasGeneratedContent(in nsIRDFResource aNode,
in nsAtom aTag);
in nsAtomPtr aTag);
/**
* Adds a rule filter for a given rule, which may be used for specialized

View File

@ -5,13 +5,17 @@
#include "domstubs.idl"
interface nsAtom; // not a real interface; used in [noscript] methods only
interface nsIArray;
interface nsISimpleEnumerator;
interface nsIXULTemplateResult;
interface nsIXULTemplateRuleFilter;
interface nsIXULTemplateBuilder;
%{C++
class nsAtom;
%}
[ptr] native nsAtomPtr(nsAtom);
/**
* A query processor takes a template query and generates results for it given
* a datasource and a reference point. There is a one-to-one relationship
@ -164,8 +168,8 @@ interface nsIXULTemplateQueryProcessor : nsISupports
*/
[noscript] nsISupports compileQuery(in nsIXULTemplateBuilder aBuilder,
in nsIDOMNode aQuery,
in nsAtom aRefVariable,
in nsAtom aMemberVariable);
in nsAtomPtr aRefVariable,
in nsAtomPtr aMemberVariable);
/**
* Generate the results of a query and return them in an enumerator. The
@ -223,8 +227,8 @@ interface nsIXULTemplateQueryProcessor : nsISupports
* @param aExpr expression used to compute the value to assign
*/
[noscript] void addBinding(in nsIDOMNode aRuleNode,
in nsAtom aVar,
in nsAtom aRef,
in nsAtomPtr aVar,
in nsAtomPtr aRef,
in AString aExpr);
/**
@ -271,6 +275,6 @@ interface nsIXULTemplateQueryProcessor : nsISupports
*/
[noscript] int32_t compareResults(in nsIXULTemplateResult aLeft,
in nsIXULTemplateResult aRight,
in nsAtom aVar,
in nsAtomPtr aVar,
in unsigned long aSortHints);
};

View File

@ -5,10 +5,14 @@
#include "nsISupports.idl"
interface nsAtom; // not a real interface; used in [noscript] methods only
interface nsIDOMNode;
interface nsIRDFResource;
%{C++
class nsAtom;
%}
[ptr] native nsAtomPtr(nsAtom);
/**
* A single result generated from a template query. Each result is identified
* by an id, which must be unique within the set of results produced from a
@ -80,7 +84,7 @@ interface nsIXULTemplateResult : nsISupports
*
* @return the value for the variable or a null string if it has no value
*/
[noscript] AString getBindingFor(in nsAtom aVar);
[noscript] AString getBindingFor(in nsAtomPtr aVar);
/**
* Get an object value for a variable such as ?name for this result.
@ -93,7 +97,7 @@ interface nsIXULTemplateResult : nsISupports
*
* @return the value for the variable or null if it has no value
*/
[noscript] nsISupports getBindingObjectFor(in nsAtom aVar);
[noscript] nsISupports getBindingObjectFor(in nsAtomPtr aVar);
/**
* Indicate that a particular rule of a query has matched and that output

View File

@ -7,7 +7,10 @@
#include "nsISupports.idl"
#include "nsIRDFDataSource.idl"
interface nsAtom; // not a real interface; used in [noscript] methods only
%{C++
class nsAtom;
%}
[ptr] native nsAtomPtr(nsAtom);
[scriptable, uuid(8ae1fbf8-1dd2-11b2-bd21-d728069cca92)]
interface nsIRDFXMLSerializer : nsISupports
@ -24,5 +27,5 @@ interface nsIRDFXMLSerializer : nsISupports
* @param aPrefix the attribute namespace prefix
* @param aURI the namespace URI
*/
[noscript] void addNameSpace(in nsAtom aPrefix, in DOMString aURI);
[noscript] void addNameSpace(in nsAtomPtr aPrefix, in DOMString aURI);
};

View File

@ -12,7 +12,10 @@
#include "nsISupports.idl"
interface nsAtom; // not a real interface; used in [noscript] methods only
%{C++
class nsAtom;
%}
[ptr] native nsAtomPtr(nsAtom);
// XXX Until these get scriptable. See nsIRDFXMLSink::AddNameSpace()
[ref] native nsStringRef(nsString);
@ -102,7 +105,7 @@ interface nsIRDFXMLSink : nsISupports
* @param aPrefix the namespace prefix
* @param aURI the namespace URI
*/
[noscript] void addNameSpace(in nsAtom aPrefix,
[noscript] void addNameSpace(in nsAtomPtr aPrefix,
[const] in nsStringRef aURI);
/**