[X2Go-Commits] [pale-moon] 146/294: Revert "Guard against re-entrancy in nsStringStream."

git-admin at x2go.org git-admin at x2go.org
Sat Apr 27 08:58:01 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch upstream/28.5.0
in repository pale-moon.

commit 34939b2d177be9d397e17d6a16837dd60e6b3906
Author: wolfbeast <mcwerewolf at wolfbeast.com>
Date:   Fri Mar 22 14:06:07 2019 +0100

    Revert "Guard against re-entrancy in nsStringStream."
    
    This reverts commit 411919cca7a3795d08ec3cd24efa0167683a80fb.
---
 xpcom/io/nsStringStream.cpp | 34 ----------------------------------
 1 file changed, 34 deletions(-)

diff --git a/xpcom/io/nsStringStream.cpp b/xpcom/io/nsStringStream.cpp
index 60da385..b65242c 100644
--- a/xpcom/io/nsStringStream.cpp
+++ b/xpcom/io/nsStringStream.cpp
@@ -22,7 +22,6 @@
 #include "nsIClassInfoImpl.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ipc/InputStreamUtils.h"
-#include "mozilla/ReentrantMonitor.h"
 #include "nsIIPCSerializableInputStream.h"
 
 using namespace mozilla::ipc;
@@ -51,7 +50,6 @@ public:
   NS_DECL_NSICLONEABLEINPUTSTREAM
 
   nsStringInputStream()
-  : mMon("nsStringInputStream")
   {
     Clear();
   }
@@ -91,8 +89,6 @@ private:
 
   nsDependentCSubstring mData;
   uint32_t mOffset;
-  
-  mozilla::ReentrantMonitor mMon;
 };
 
 // This class needs to support threadsafe refcounting since people often
@@ -130,8 +126,6 @@ nsStringInputStream::GetType(uint16_t* aType)
 NS_IMETHODIMP
 nsStringInputStream::GetData(nsACString& data)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   // The stream doesn't have any data when it is closed.  We could fake it
   // and return an empty string here, but it seems better to keep this return
   // value consistent with the behavior of the other 'getter' methods.
@@ -146,8 +140,6 @@ nsStringInputStream::GetData(nsACString& data)
 NS_IMETHODIMP
 nsStringInputStream::SetData(const nsACString& aData)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   mData.Assign(aData);
   mOffset = 0;
   return NS_OK;
@@ -167,8 +159,6 @@ nsStringInputStream::ToString(char** aResult)
 NS_IMETHODIMP
 nsStringInputStream::SetData(const char* aData, int32_t aDataLen)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   if (NS_WARN_IF(!aData)) {
     return NS_ERROR_INVALID_ARG;
   }
@@ -180,8 +170,6 @@ nsStringInputStream::SetData(const char* aData, int32_t aDataLen)
 NS_IMETHODIMP
 nsStringInputStream::AdoptData(char* aData, int32_t aDataLen)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   if (NS_WARN_IF(!aData)) {
     return NS_ERROR_INVALID_ARG;
   }
@@ -193,8 +181,6 @@ nsStringInputStream::AdoptData(char* aData, int32_t aDataLen)
 NS_IMETHODIMP
 nsStringInputStream::ShareData(const char* aData, int32_t aDataLen)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   if (NS_WARN_IF(!aData)) {
     return NS_ERROR_INVALID_ARG;
   }
@@ -211,8 +197,6 @@ nsStringInputStream::ShareData(const char* aData, int32_t aDataLen)
 NS_IMETHODIMP_(size_t)
 nsStringInputStream::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   size_t n = aMallocSizeOf(this);
   n += mData.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
   return n;
@@ -225,8 +209,6 @@ nsStringInputStream::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
 NS_IMETHODIMP
 nsStringInputStream::Close()
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   Clear();
   return NS_OK;
 }
@@ -234,8 +216,6 @@ nsStringInputStream::Close()
 NS_IMETHODIMP
 nsStringInputStream::Available(uint64_t* aLength)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   NS_ASSERTION(aLength, "null ptr");
 
   if (Closed()) {
@@ -257,8 +237,6 @@ NS_IMETHODIMP
 nsStringInputStream::ReadSegments(nsWriteSegmentFun aWriter, void* aClosure,
                                   uint32_t aCount, uint32_t* aResult)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   NS_ASSERTION(aResult, "null ptr");
   NS_ASSERTION(Length() >= mOffset, "bad stream state");
 
@@ -302,8 +280,6 @@ nsStringInputStream::IsNonBlocking(bool* aNonBlocking)
 NS_IMETHODIMP
 nsStringInputStream::Seek(int32_t aWhence, int64_t aOffset)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   if (Closed()) {
     return NS_BASE_STREAM_CLOSED;
   }
@@ -336,8 +312,6 @@ nsStringInputStream::Seek(int32_t aWhence, int64_t aOffset)
 NS_IMETHODIMP
 nsStringInputStream::Tell(int64_t* aOutWhere)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   if (Closed()) {
     return NS_BASE_STREAM_CLOSED;
   }
@@ -349,8 +323,6 @@ nsStringInputStream::Tell(int64_t* aOutWhere)
 NS_IMETHODIMP
 nsStringInputStream::SetEOF()
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   if (Closed()) {
     return NS_BASE_STREAM_CLOSED;
   }
@@ -367,8 +339,6 @@ void
 nsStringInputStream::Serialize(InputStreamParams& aParams,
                                FileDescriptorArray& /* aFDs */)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   StringInputStreamParams params;
   params.data() = PromiseFlatCString(mData);
   aParams = params;
@@ -397,8 +367,6 @@ nsStringInputStream::Deserialize(const InputStreamParams& aParams,
 Maybe<uint64_t>
 nsStringInputStream::ExpectedSerializedLength()
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   return Some(static_cast<uint64_t>(Length()));
 }
 
@@ -416,8 +384,6 @@ nsStringInputStream::GetCloneable(bool* aCloneableOut)
 NS_IMETHODIMP
 nsStringInputStream::Clone(nsIInputStream** aCloneOut)
 {
-  ReentrantMonitorAutoEnter lock(mMon);
-  
   RefPtr<nsIInputStream> ref = new nsStringInputStream(*this);
   ref.forget(aCloneOut);
   return NS_OK;

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pale-moon.git


More information about the x2go-commits mailing list