Bug 1261072 - File::GetName() should be const, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 01 Apr 2016 11:50:16 +0100
changeset 291219 d04909bc6f959de45d64fdb0143df7606d443b58
parent 291218 dcefde651ddb7528416ffe62bdb17df1afc2f2d2
child 291220 55fa7abf986320f694750d14fe67ed87722eee39
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1261072
milestone48.0a1
Bug 1261072 - File::GetName() should be const, r=smaug
dom/base/File.cpp
dom/base/File.h
dom/indexedDB/FileSnapshot.h
dom/ipc/Blob.cpp
--- a/dom/base/File.cpp
+++ b/dom/base/File.cpp
@@ -454,17 +454,17 @@ File::CreateFromFile(nsISupports* aParen
 
 JSObject*
 File::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return FileBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
-File::GetName(nsAString& aFileName)
+File::GetName(nsAString& aFileName) const
 {
   mImpl->GetName(aFileName);
 }
 
 void
 File::GetPath(nsAString& aPath, ErrorResult& aRv)
 {
   mImpl->GetPath(aPath, aRv);
@@ -673,17 +673,17 @@ BlobImpl::Slice(const Optional<int64_t>&
 NS_IMPL_ISUPPORTS(BlobImpl, BlobImpl)
 
 ////////////////////////////////////////////////////////////////////////////
 // BlobImplFile implementation
 
 NS_IMPL_ISUPPORTS_INHERITED0(BlobImplFile, BlobImpl)
 
 void
-BlobImplBase::GetName(nsAString& aName)
+BlobImplBase::GetName(nsAString& aName) const
 {
   NS_ASSERTION(mIsFile, "Should only be called on files");
   aName = mName;
 }
 
 void
 BlobImplBase::GetPath(nsAString& aPath, ErrorResult& aRv)
 {
--- a/dom/base/File.h
+++ b/dom/base/File.h
@@ -225,17 +225,17 @@ public:
 
   // File constructor - ChromeOnly
   static already_AddRefed<File>
   Constructor(const GlobalObject& aGlobal,
               nsIFile* aData,
               const ChromeFilePropertyBag& aBag,
               ErrorResult& aRv);
 
-  void GetName(nsAString& aName);
+  void GetName(nsAString& aName) const;
 
   int64_t GetLastModified(ErrorResult& aRv);
 
   Date GetLastModifiedDate(ErrorResult& aRv);
 
   void GetPath(nsAString& aName, ErrorResult& aRv);
 
   void GetMozFullPath(nsAString& aFilename, ErrorResult& aRv) const;
@@ -257,17 +257,17 @@ private:
 class BlobImpl : public nsISupports
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(BLOBIMPL_IID)
   NS_DECL_THREADSAFE_ISUPPORTS
 
   BlobImpl() {}
 
-  virtual void GetName(nsAString& aName) = 0;
+  virtual void GetName(nsAString& aName) const = 0;
 
   virtual void GetPath(nsAString& aName, ErrorResult& aRv) = 0;
 
   virtual int64_t GetLastModified(ErrorResult& aRv) = 0;
 
   virtual void SetLastModified(int64_t aLastModified) = 0;
 
   virtual void GetMozFullPath(nsAString& aName, ErrorResult& aRv) const = 0;
@@ -393,17 +393,17 @@ public:
     , mSerialNumber(NextSerialNumber())
   {
     NS_ASSERTION(aLength != UINT64_MAX,
                  "Must know length when creating slice");
     // Ensure non-null mContentType by default
     mContentType.SetIsVoid(false);
   }
 
-  virtual void GetName(nsAString& aName) override;
+  virtual void GetName(nsAString& aName) const override;
 
   virtual void GetPath(nsAString& aName, ErrorResult& aRv) override;
 
   virtual int64_t GetLastModified(ErrorResult& aRv) override;
 
   virtual void SetLastModified(int64_t aLastModified) override;
 
   virtual void GetMozFullPath(nsAString& aName, ErrorResult& aRv) const override;
--- a/dom/indexedDB/FileSnapshot.h
+++ b/dom/indexedDB/FileSnapshot.h
@@ -50,17 +50,17 @@ public:
 private:
   BlobImplSnapshot(BlobImpl* aImpl,
                    nsIWeakReference* aFileHandle);
 
   ~BlobImplSnapshot();
 
   // BlobImpl
   virtual void
-  GetName(nsAString& aName) override
+  GetName(nsAString& aName) const override
   {
     mBlobImpl->GetName(aName);
   }
 
   virtual void
   GetPath(nsAString& aPath, ErrorResult& aRv) override
   {
     mBlobImpl->GetPath(aPath, aRv);
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -1972,17 +1972,17 @@ public:
   RemoteBlobImpl(BlobParent* aActor, BlobImpl* aBlobImpl);
 
   void
   NoteDyingActor();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   virtual void
-  GetName(nsAString& aName) override;
+  GetName(nsAString& aName) const override;
 
   virtual void
   GetPath(nsAString& aPath, ErrorResult& aRv) override;
 
   virtual int64_t
   GetLastModified(ErrorResult& aRv) override;
 
   virtual void
@@ -2634,17 +2634,17 @@ RemoteBlobImpl::Destroy()
 NS_IMPL_ADDREF(BlobParent::RemoteBlobImpl)
 NS_IMPL_RELEASE_WITH_DESTROY(BlobParent::RemoteBlobImpl, Destroy())
 NS_IMPL_QUERY_INTERFACE_INHERITED(BlobParent::RemoteBlobImpl,
                                   BlobImpl,
                                   nsIRemoteBlob)
 
 void
 BlobParent::
-RemoteBlobImpl::GetName(nsAString& aName)
+RemoteBlobImpl::GetName(nsAString& aName) const
 {
   mBlobImpl->GetName(aName);
 }
 
 void
 BlobParent::
 RemoteBlobImpl::GetPath(nsAString& aPath, ErrorResult& aRv)
 {