Bug 331566 - Change idl interfaces to use @throws instead of @return NS_. r=bsmedberg

This commit is contained in:
Maria Grazia Alastra 2013-05-16 08:26:55 -04:00
parent aa76626ff9
commit 29ebfeceb8
18 changed files with 36 additions and 94 deletions

View File

@ -22,7 +22,6 @@ interface nsISelectionDisplay : nsISupports
This will tell the rendering engine to draw the different
selection types.
@return NS_OK if successful.
*/
void setSelectionFlags(in short toggle);
@ -32,7 +31,6 @@ interface nsISelectionDisplay : nsISupports
@param short *aReturn - This will be filled with DISPLAY_(TEXT,IMAGE,FRAMES,ALL)
bit flags.
@return NS_OK if successful.
*/
short getSelectionFlags();

View File

@ -18,8 +18,7 @@ interface nsIWebPageDescriptor : nsISupports
/**
* Tells the object to load the page specified by the page descriptor
*
* @return NS_OK -
* NS_ERROR_FAILURE -
* @throws NS_ERROR_FAILURE -
*/
void loadPage(in nsISupports aPageDescriptor, in unsigned long aDisplayType);

View File

@ -95,9 +95,8 @@ interface nsIWebBrowserPersist : nsICancelable
* Value indicating the success or failure of the persist
* operation.
*
* @return NS_OK Operation was successful or is still ongoing.
* @return NS_BINDING_ABORTED Operation cancelled.
* @return NS_ERROR_FAILURE Non-specific failure.
* @throws NS_BINDING_ABORTED Operation cancelled.
* @throws NS_ERROR_FAILURE Non-specific failure.
*/
readonly attribute nsresult result;
@ -141,8 +140,7 @@ interface nsIWebBrowserPersist : nsICancelable
* @see nsIURI
* @see nsIInputStream
*
* @return NS_OK Operation has been started.
* @return NS_ERROR_INVALID_ARG One or more arguments was invalid.
* @throws NS_ERROR_INVALID_ARG One or more arguments was invalid.
*/
void saveURI(in nsIURI aURI, in nsISupports aCacheKey,
in nsIURI aReferrer, in nsIInputStream aPostData,
@ -263,8 +261,7 @@ interface nsIWebBrowserPersist : nsICancelable
* @see nsIFile
* @see nsIURI
*
* @return NS_OK Operation has been started.
* @return NS_ERROR_INVALID_ARG One or more arguments was invalid.
* @throws NS_ERROR_INVALID_ARG One or more arguments was invalid.
*/
void saveDocument(in nsIDOMDocument aDocument,
in nsISupports aFile, in nsISupports aDataPath,

View File

@ -32,8 +32,7 @@ interface imgICache : nsISupports
* Evict images from the cache.
*
* @param uri The URI to remove.
* @return NS_OK if \a uri was removed from the cache.
* NS_ERROR_NOT_AVAILABLE if \a uri was unable to be removed from the cache.
* @throws NS_ERROR_NOT_AVAILABLE if \a uri was unable to be removed from the cache.
*/
void removeEntry(in nsIURI uri);

View File

@ -70,8 +70,7 @@ interface nsIPrefBranch : nsISupports
* @param aPrefName The boolean preference to set the state of.
* @param aValue The boolean value to set the preference to.
*
* @return NS_OK The value was successfully set.
* @return Other The value was not set or is the wrong type.
* @throws Error if setting failed or the value is the wrong type.
*
* @see getBoolPref
*/
@ -107,8 +106,7 @@ interface nsIPrefBranch : nsISupports
* @param aPrefName The string preference to set.
* @param aValue The string value to set the preference to.
*
* @return NS_OK The value was successfully set.
* @return Other The value was not set or is the wrong type.
* @throws Error if setting failed or the value is the wrong type.
*
* @see getCharPref
*/
@ -131,8 +129,7 @@ interface nsIPrefBranch : nsISupports
* @param aPrefName The integer preference to set the value of.
* @param aValue The integer value to set the preference to.
*
* @return NS_OK The value was successfully set.
* @return Other The value was not set or is the wrong type.
* @throws Error if setting failed or the value is the wrong type.
*
* @see getIntPref
*/
@ -152,8 +149,7 @@ interface nsIPrefBranch : nsISupports
* @param aValue The XPCOM object into which to the complex preference
* value should be retrieved.
*
* @return NS_OK The value was successfully retrieved.
* @return Other The value does not exist or is the wrong type.
* @throws Error The value does not exist or is the wrong type.
*
* @see setComplexValue
*/
@ -174,8 +170,7 @@ interface nsIPrefBranch : nsISupports
* @param aValue The XPCOM object from which to set the complex preference
* value.
*
* @return NS_OK The value was successfully set.
* @return Other The value was not set or is the wrong type.
* @throws Error if setting failed or the value is the wrong type.
*
* @see getComplexValue
*/
@ -190,8 +185,6 @@ interface nsIPrefBranch : nsISupports
*
* @note
* This method does nothing if this object is a default branch.
*
* @return NS_OK The user preference was successfully cleared.
*/
void clearUserPref(in string aPrefName);
@ -206,8 +199,7 @@ interface nsIPrefBranch : nsISupports
* This method can be called on either a default or user branch but, in
* effect, always operates on the default branch.
*
* @return NS_OK The preference was successfully locked.
* @return Other The preference does not exist or an error occurred.
* @throws Error The preference does not exist or an error occurred.
*
* @see unlockPref
*/
@ -264,8 +256,7 @@ interface nsIPrefBranch : nsISupports
* This method can be called on either a default or user branch but, in
* effect, always operates on the default branch.
*
* @return NS_OK The preference was successfully unlocked.
* @return Other The preference does not exist or an error occurred.
* @throws Error The preference does not exist or an error occurred.
*
* @see lockPref
*/
@ -283,8 +274,7 @@ interface nsIPrefBranch : nsISupports
* This method can be called on either a default or user branch but, in
* effect, always operates on both.
*
* @return NS_OK The preference(s) were successfully removed.
* @return Other The preference(s) do not exist or an error occurred.
* @throws Error The preference(s) do not exist or an error occurred.
*/
void deleteBranch(in string aStartingAt);
@ -302,8 +292,7 @@ interface nsIPrefBranch : nsISupports
* This method can be called on either a default or user branch but, in
* effect, always operates on both.
*
* @return NS_OK The preference list was successfully retrieved.
* @return Other The preference(s) do not exist or an error occurred.
* @throws Error The preference(s) do not exist or an error occurred.
*/
void getChildList(in string aStartingAt,
[optional] out unsigned long aCount,
@ -321,8 +310,7 @@ interface nsIPrefBranch : nsISupports
* This method can be called on either a default or user branch but, in
* effect, always operates on the user branch.
*
* @return NS_OK The preference(s) were successfully reset.
* @return Other The preference(s) do not exist or an error occurred.
* @throws Error The preference(s) do not exist or an error occurred.
*/
void resetBranch(in string aStartingAt);

View File

@ -22,8 +22,7 @@ interface nsIPrefLocalizedString : nsISupports
/**
* Provides access to string data stored in this property.
*
* @return NS_OK The operation succeeded.
* @return Other An error occurred.
* @throws Error An error occurred.
*/
attribute wstring data;
@ -45,8 +44,6 @@ interface nsIPrefLocalizedString : nsISupports
*
* @note
* This makes a copy of the string argument passed in.
*
* @return NS_OK The data was successfully stored.
*/
void setDataWithLength(in unsigned long length,
[size_is(length)] in wstring data);

View File

@ -39,8 +39,7 @@ interface nsIPrefService : nsISupports
* If nullptr is passed in for the aFile parameter the default preferences
* file(s) [prefs.js, user.js] will be read and processed.
*
* @return NS_OK File was read and processed.
* @return Other File failed to read or contained invalid data.
* @throws Error File failed to read or contained invalid data.
*
* @see savePrefFile
* @see nsIFile
@ -50,16 +49,13 @@ interface nsIPrefService : nsISupports
/**
* Called to completely flush and re-initialize the preferences system.
*
* @return NS_OK The preference service was re-initialized correctly.
* @return Other The preference service failed to restart correctly.
* @throws Error The preference service failed to restart correctly.
*/
void resetPrefs();
/**
* Called to reset all preferences with user set values back to the
* application default values.
*
* @return NS_OK Always.
*/
void resetUserPrefs();
@ -72,8 +68,7 @@ interface nsIPrefService : nsISupports
* If nullptr is passed in for the aFile parameter the preference data is
* written out to the current preferences file (usually prefs.js.)
*
* @return NS_OK File was written.
* @return Other File failed to write.
* @throws Error File failed to write.
*
* @see readUserPrefs
* @see nsIFile

View File

@ -21,7 +21,7 @@ interface nsIRDFDataSource : nsISupports
/** Find an RDF resource that points to a given node over the
* specified arc & truth value
*
* @return NS_RDF_NO_VALUE if there is no source that leads
* @throws NS_RDF_NO_VALUE if there is no source that leads
* to the target with the specified property.
*/
nsIRDFResource GetSource(in nsIRDFResource aProperty,
@ -31,10 +31,6 @@ interface nsIRDFDataSource : nsISupports
/**
* Find all RDF resources that point to a given node over the
* specified arc & truth value
*
* @return NS_OK unless a catastrophic error occurs. If the
* method returns NS_OK, you may assume that nsISimpleEnumerator points
* to a valid (but possibly empty) cursor.
*/
nsISimpleEnumerator GetSources(in nsIRDFResource aProperty,
in nsIRDFNode aTarget,
@ -44,7 +40,7 @@ interface nsIRDFDataSource : nsISupports
* Find a child of that is related to the source by the given arc
* arc and truth value
*
* @return NS_RDF_NO_VALUE if there is no target accessible from the
* @throws NS_RDF_NO_VALUE if there is no target accessible from the
* source via the specified property.
*/
nsIRDFNode GetTarget(in nsIRDFResource aSource,
@ -54,10 +50,6 @@ interface nsIRDFDataSource : nsISupports
/**
* Find all children of that are related to the source by the given arc
* arc and truth value.
*
* @return NS_OK unless a catastrophic error occurs. If the
* method returns NS_OK, you may assume that nsISimpleEnumerator points
* to a valid (but possibly empty) cursor.
*/
nsISimpleEnumerator GetTargets(in nsIRDFResource aSource,
in nsIRDFResource aProperty,
@ -128,20 +120,12 @@ interface nsIRDFDataSource : nsISupports
/**
* Get a cursor to iterate over all the arcs that point into a node.
*
* @return NS_OK unless a catastrophic error occurs. If the method
* returns NS_OK, you may assume that labels points to a valid (but
* possible empty) nsISimpleEnumerator object.
*/
nsISimpleEnumerator ArcLabelsIn(in nsIRDFNode aNode);
/**
* Get a cursor to iterate over all the arcs that originate in
* a resource.
*
* @return NS_OK unless a catastrophic error occurs. If the method
* returns NS_OK, you may assume that labels points to a valid (but
* possible empty) nsISimpleEnumerator object.
*/
nsISimpleEnumerator ArcLabelsOut(in nsIRDFResource aSource);

View File

@ -27,9 +27,8 @@ interface nsIInterfaceRequestor : nsISupports
* @param uuid The IID of the interface being requested.
* @param result [out] The interface pointer to be filled in if
* the interface is accessible.
* @return NS_OK - interface was successfully returned.
* NS_NOINTERFACE - interface not accessible.
* NS_ERROR* - method failure.
* @throws NS_NOINTERFACE - interface not accessible.
* @throws NS_ERROR* - method failure.
*/
void getInterface(in nsIIDRef uuid,
[iid_is(uuid),retval] out nsQIResult result);

View File

@ -90,7 +90,7 @@ interface nsIMemory : nsISupports
* immediately if the call was made on the main thread. If
* false, the flush will be scheduled to happen when the app is
* idle.
* @return NS_ERROR_FAILURE if 'immediate' is set an the call
* @throws NS_ERROR_FAILURE if 'immediate' is set an the call
* was not on the application's main thread.
*/
void heapMinimize(in boolean immediate);

View File

@ -62,8 +62,7 @@ interface nsIComponentRegistrar : nsISupports
* @param aFactory : Factory previously registered to create instances of
* CID aClass.
*
* @return NS_OK Unregistration was successful.
* NS_ERROR* Method failure.
* @throws NS_ERROR* Method failure.
*/
void unregisterFactory(in nsCIDRef aClass,
in nsIFactory aFactory);

View File

@ -21,10 +21,8 @@ interface nsIFactory : nsISupports {
* @param iid The IID of the interface being requested in
* the component which is being currently created.
* @param result [out] Pointer to the newly created instance, if successful.
* @return NS_OK - Component successfully created and the interface
* being requested was successfully returned in result.
* NS_NOINTERFACE - Interface not accessible.
* NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the
* @throws NS_NOINTERFACE - Interface not accessible.
* @throws NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the
* component is not aggregatable.
* NS_ERROR* - Method failure.
*/
@ -38,8 +36,7 @@ interface nsIFactory : nsISupports {
* to release the factory.
*
* @param lock - Must be PR_TRUE or PR_FALSE
* @return NS_OK - If the lock operation was successful.
* NS_ERROR* - Method failure.
* @throws NS_ERROR* - Method failure.
*/
void lockFactory(in boolean lock);
};

View File

@ -15,8 +15,8 @@ interface nsIProperties : nsISupports
/**
* Gets a property with a given name.
*
* @return NS_ERROR_FAILURE if a property with that name doesn't exist.
* @return NS_ERROR_NO_INTERFACE if the found property fails to QI to the
* @throws NS_ERROR_FAILURE if a property with that name doesn't exist.
* @throws NS_ERROR_NO_INTERFACE if the found property fails to QI to the
* given iid.
*/
void get(in string prop, in nsIIDRef iid,
@ -34,7 +34,7 @@ interface nsIProperties : nsISupports
/**
* Undefines a property.
* @return NS_ERROR_FAILURE if a property with that name doesn't
* @throws NS_ERROR_FAILURE if a property with that name doesn't
* already exist.
*/
void undefine(in string prop);

View File

@ -38,9 +38,7 @@ interface nsISimpleEnumerator : nsISupports {
* the elements in the enumerator.
*
* @see hasMoreElements()
* @return NS_OK if the call succeeded in returning a non-null
* value through the out parameter.
* NS_ERROR_FAILURE if there are no more elements
* @throws NS_ERROR_FAILURE if there are no more elements
* to enumerate.
* @return the next element in the enumeration.
*/

View File

@ -303,7 +303,7 @@ interface nsIFile : nsISupports
* Returns an enumeration of the elements in a directory. Each
* element in the enumeration is an nsIFile.
*
* @return NS_ERROR_FILE_NOT_DIRECTORY if the current nsIFile does
* @throws NS_ERROR_FILE_NOT_DIRECTORY if the current nsIFile does
* not specify a directory.
*/
readonly attribute nsISimpleEnumerator directoryEntries;

View File

@ -22,9 +22,7 @@ interface nsIInputStream;
*
* Implementers should return the following:
*
* @return NS_OK and (*aReadCount > 0) if successfully provided some data
* @return NS_OK and (*aReadCount = 0) or
* @return <any-error> if not interested in providing any data
* @throws <any-error> if not interested in providing any data
*
* Errors are never passed to the caller of WriteSegments.
*/

View File

@ -22,8 +22,7 @@ interface nsIInputStream;
*
* Implementers should return the following:
*
* @return NS_OK and (*aWriteCount > 0) if consumed some data
* @return <any-error> if not interested in consuming any data
* @throws <any-error> if not interested in consuming any data
*
* Errors are never passed to the caller of ReadSegments.
*

View File

@ -16,11 +16,6 @@ interface nsIEventTarget;
*
* @param aTimer the timer which has expired
* @param aClosure opaque parameter passed to initWithFuncCallback
*
* Implementers should return the following:
*
* @return NS_OK
*
*/
class nsITimer;
typedef void (*nsTimerCallbackFunc) (nsITimer *aTimer, void *aClosure);