Bug 1432620 - Make nsIMozIconURI attributes readonly draft
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 23 Jan 2018 22:25:18 +0100
changeset 723818 a22f1252112291287d4dce57f59e951e7e0ad3fa
parent 723812 3d5b3960d30dea704ef6f38b618864448616e65e
child 746959 fc5f92411833232dddc0cdaac0097dc66e48cca4
push id96540
push uservalentin.gosu@gmail.com
push dateTue, 23 Jan 2018 21:26:18 +0000
bugs1432620
milestone59.0a1
Bug 1432620 - Make nsIMozIconURI attributes readonly MozReview-Commit-ID: LLSjC2fBa4x
image/decoders/icon/nsIconURI.cpp
image/nsIIconURI.idl
--- 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.