Bug 1432620 - Make nsIMozIconURI attributes readonly r=mayhemer
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 23 Jan 2018 22:25:18 +0100
changeset 402192 840e2763fe9408e4dee544c9b0e9df76ee4c1d00
parent 402191 64a1594b0ad28c567861a4b708e9e62b871784f4
child 402193 0aa414efaff9fec661d00c35e835ca50a15f046d
push id33371
push userccoroiu@mozilla.com
push dateFri, 02 Feb 2018 17:36:53 +0000
treeherdermozilla-central@9e41a686a5ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1432620
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1432620 - Make nsIMozIconURI attributes readonly r=mayhemer 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.