Bug 1583929 - remove unused skipResume in FTPChannelParent r=valentin
authorJunior Hsu <juhsu@mozilla.com>
Wed, 25 Sep 2019 20:00:40 +0000
changeset 494967 a0c6e1a16a2de01d775d815c784f38b5870069f7
parent 494966 a7180808eaaeb815467d7794477f69a71b62a93b
child 494968 c407e5da6487773b8a4a3585676ee9f047a0698f
push id114131
push userdluca@mozilla.com
push dateThu, 26 Sep 2019 09:47:34 +0000
treeherdermozilla-inbound@1dc1a755079a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1583929
milestone71.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 1583929 - remove unused skipResume in FTPChannelParent r=valentin mSuspendedForDiversion is for the same purpose. All function involved happened in the same thread. Differential Revision: https://phabricator.services.mozilla.com/D47124
netwerk/protocol/ftp/FTPChannelParent.cpp
netwerk/protocol/ftp/FTPChannelParent.h
--- a/netwerk/protocol/ftp/FTPChannelParent.cpp
+++ b/netwerk/protocol/ftp/FTPChannelParent.cpp
@@ -653,17 +653,17 @@ nsresult FTPChannelParent::ResumeForDive
       do_QueryInterface(mChannel);
   if (chan) {
     chan->MessageDiversionStop();
   }
 
   if (mSuspendedForDiversion) {
     nsresult rv = ResumeChannelInternalIfPossible();
     if (NS_WARN_IF(NS_FAILED(rv))) {
-      FailDiversion(NS_ERROR_UNEXPECTED, true);
+      FailDiversion(NS_ERROR_UNEXPECTED);
       return rv;
     }
     mSuspendedForDiversion = false;
   }
 
   // Delete() will tear down IPDL, but ref from underlying nsFTPChannel will
   // keep us alive if there's more data to be delivered to listener.
   if (NS_WARN_IF(NS_FAILED(Delete()))) {
@@ -748,48 +748,43 @@ void FTPChannelParent::StartDiversion() 
   if (NS_WARN_IF(mIPCClosed || !SendDivertMessages())) {
     FailDiversion(NS_ERROR_UNEXPECTED);
     return;
   }
 }
 
 class FTPFailDiversionEvent : public Runnable {
  public:
-  FTPFailDiversionEvent(FTPChannelParent* aChannelParent, nsresult aErrorCode,
-                        bool aSkipResume)
+  FTPFailDiversionEvent(FTPChannelParent* aChannelParent, nsresult aErrorCode)
       : Runnable("net::FTPFailDiversionEvent"),
         mChannelParent(aChannelParent),
-        mErrorCode(aErrorCode),
-        mSkipResume(aSkipResume) {
+        mErrorCode(aErrorCode) {
     MOZ_RELEASE_ASSERT(aChannelParent);
     MOZ_RELEASE_ASSERT(NS_FAILED(aErrorCode));
   }
   NS_IMETHOD Run() override {
-    mChannelParent->NotifyDiversionFailed(mErrorCode, mSkipResume);
+    mChannelParent->NotifyDiversionFailed(mErrorCode);
     return NS_OK;
   }
 
  private:
   RefPtr<FTPChannelParent> mChannelParent;
   nsresult mErrorCode;
-  bool mSkipResume;
 };
 
-void FTPChannelParent::FailDiversion(nsresult aErrorCode, bool aSkipResume) {
+void FTPChannelParent::FailDiversion(nsresult aErrorCode) {
   MOZ_RELEASE_ASSERT(NS_FAILED(aErrorCode));
   MOZ_RELEASE_ASSERT(mDivertingFromChild);
   MOZ_RELEASE_ASSERT(mDivertToListener);
   MOZ_RELEASE_ASSERT(mChannel);
 
-  NS_DispatchToCurrentThread(
-      new FTPFailDiversionEvent(this, aErrorCode, aSkipResume));
+  NS_DispatchToCurrentThread(new FTPFailDiversionEvent(this, aErrorCode));
 }
 
-void FTPChannelParent::NotifyDiversionFailed(nsresult aErrorCode,
-                                             bool aSkipResume) {
+void FTPChannelParent::NotifyDiversionFailed(nsresult aErrorCode) {
   MOZ_RELEASE_ASSERT(NS_FAILED(aErrorCode));
   MOZ_RELEASE_ASSERT(mDivertingFromChild);
   MOZ_RELEASE_ASSERT(mDivertToListener);
   MOZ_RELEASE_ASSERT(mChannel);
 
   mChannel->Cancel(aErrorCode);
   nsCOMPtr<nsIForcePendingChannel> forcePendingIChan =
       do_QueryInterface(mChannel);
--- a/netwerk/protocol/ftp/FTPChannelParent.h
+++ b/netwerk/protocol/ftp/FTPChannelParent.h
@@ -57,28 +57,28 @@ class FTPChannelParent final : public PF
 
   // Calls OnStartRequest for "DivertTo" listener, then notifies child channel
   // that it should divert OnDataAvailable and OnStopRequest calls to this
   // parent channel.
   void StartDiversion();
 
   // Handles calling OnStart/Stop if there are errors during diversion.
   // Called asynchronously from FailDiversion.
-  void NotifyDiversionFailed(nsresult aErrorCode, bool aSkipResume = true);
+  void NotifyDiversionFailed(nsresult aErrorCode);
 
   NS_IMETHOD SetErrorMsg(const char* aMsg, bool aUseUTF8) override;
 
  protected:
   virtual ~FTPChannelParent();
 
   // private, supporting function for ADivertableParentChannel.
   nsresult ResumeForDiversion();
 
   // Asynchronously calls NotifyDiversionFailed.
-  void FailDiversion(nsresult aErrorCode, bool aSkipResume = true);
+  void FailDiversion(nsresult aErrorCode);
 
   bool DoAsyncOpen(const URIParams& aURI, const uint64_t& aStartPos,
                    const nsCString& aEntityID,
                    const Maybe<IPCStream>& aUploadStream,
                    const Maybe<LoadInfoArgs>& aLoadInfoArgs,
                    const uint32_t& aLoadFlags);
 
   // used to connect redirected-to channel in parent with just created