Bug 1432620 - Make nsIMozIconURI attributes readonly
MozReview-Commit-ID: LLSjC2fBa4x
--- a/image/decoders/icon/nsIconURI.cpp
+++ b/image/decoders/icon/nsIconURI.cpp
@@ -592,53 +592,31 @@ NS_IMETHODIMP
nsMozIconURI::GetIconURL(nsIURL** aFileUrl)
{
*aFileUrl = mIconURL;
NS_IF_ADDREF(*aFileUrl);
return NS_OK;
}
NS_IMETHODIMP
-nsMozIconURI::SetIconURL(nsIURL* aFileUrl)
-{
- // this isn't called anywhere, needs to go through SetSpec parsing
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
nsMozIconURI::GetImageSize(uint32_t* aImageSize)
// measured by # of pixels in a row. defaults to 16.
{
*aImageSize = mSize;
return NS_OK;
}
NS_IMETHODIMP
-nsMozIconURI::SetImageSize(uint32_t aImageSize)
- // measured by # of pixels in a row. defaults to 16.
-{
- mSize = aImageSize;
- return NS_OK;
-}
-
-NS_IMETHODIMP
nsMozIconURI::GetContentType(nsACString& aContentType)
{
aContentType = mContentType;
return NS_OK;
}
NS_IMETHODIMP
-nsMozIconURI::SetContentType(const nsACString& aContentType)
-{
- mContentType = aContentType;
- return NS_OK;
-}
-
-NS_IMETHODIMP
nsMozIconURI::GetFileExtension(nsACString& aFileExtension)
{
// First, try to get the extension from mIconURL if we have one
if (mIconURL) {
nsAutoCString fileExt;
if (NS_SUCCEEDED(mIconURL->GetFileExtension(fileExt))) {
if (!fileExt.IsEmpty()) {
// unfortunately, this code doesn't give us the required '.' in
--- a/image/nsIIconURI.idl
+++ b/image/nsIIconURI.idl
@@ -44,32 +44,32 @@
* Description: The mime type we want an icon for. This is ignored by
* stock images.
*/
[scriptable, builtinclass, uuid(f8fe5ef2-5f2b-43f3-857d-5b64d192c427)]
interface nsIMozIconURI : nsIURI
{
/// iconFile: the file URL contained within this moz-icon url, or null.
- attribute nsIURL iconURL;
+ readonly attribute nsIURL iconURL;
/// imageSize: The image area in square pixels, defaults to 16 if unspecified.
- attribute unsigned long imageSize;
+ readonly attribute unsigned long imageSize;
/// stockIcon: The stock icon name requested from the OS.
readonly attribute ACString stockIcon;
/// iconSize: The stock icon size requested from the OS.
readonly attribute ACString iconSize;
/// iconState: The stock icon state requested from the OS.
readonly attribute ACString iconState;
/// contentType: A valid mime type, or the empty string.
- attribute ACString contentType;
+ readonly attribute ACString contentType;
/// fileExtension: The file extension of the file which we are looking up.
readonly attribute ACString fileExtension;
};
%{C++
// CID for nsMozIconURI, if implemented on this platform.