Bug 1528586 - Remove PluginContextProxy. r=jimm
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sun, 17 Feb 2019 12:38:39 +0900
changeset 518975 211fcf7cb803afac968c00334fada58cb516bd2d
parent 518974 f36ad41394372f398f5ae748a788e9768dcffabc
child 518976 90ec592466c052a420e600f02c9c7b558c25b7fc
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1528586
milestone67.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 1528586 - Remove PluginContextProxy. r=jimm
dom/plugins/base/nsPluginStreamListenerPeer.cpp
--- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp
+++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp
@@ -261,60 +261,16 @@ nsresult nsPluginStreamListenerPeer::Get
   return NS_OK;
 }
 
 nsresult nsPluginStreamListenerPeer::GetURL(const char** result) {
   *result = mURLSpec.get();
   return NS_OK;
 }
 
-// XXX: Converting the channel within nsPluginStreamListenerPeer
-// to use asyncOpen() and do not want to touch the fragile logic
-// of byte range requests. Hence we just introduce this lightweight
-// wrapper to proxy the context.
-class PluginContextProxy final : public nsIStreamListener {
- public:
-  NS_DECL_ISUPPORTS
-
-  PluginContextProxy(nsIStreamListener* aListener, nsISupports* aContext)
-      : mListener(aListener), mContext(aContext) {
-    MOZ_ASSERT(aListener);
-    MOZ_ASSERT(aContext);
-  }
-
-  NS_IMETHOD
-  OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
-                  nsIInputStream* aIStream, uint64_t aSourceOffset,
-                  uint32_t aLength) override {
-    // Proxy OnDataAvailable using the internal context
-    return mListener->OnDataAvailable(aRequest, mContext, aIStream,
-                                      aSourceOffset, aLength);
-  }
-
-  NS_IMETHOD
-  OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) override {
-    // Proxy OnStartRequest using the internal context
-    return mListener->OnStartRequest(aRequest, mContext);
-  }
-
-  NS_IMETHOD
-  OnStopRequest(nsIRequest* aRequest, nsISupports* aContext,
-                nsresult aStatusCode) override {
-    // Proxy OnStopRequest using the inernal context
-    return mListener->OnStopRequest(aRequest, mContext, aStatusCode);
-  }
-
- private:
-  ~PluginContextProxy() {}
-  nsCOMPtr<nsIStreamListener> mListener;
-  nsCOMPtr<nsISupports> mContext;
-};
-
-NS_IMPL_ISUPPORTS(PluginContextProxy, nsIStreamListener)
-
 nsresult nsPluginStreamListenerPeer::GetStreamOffset(int32_t* result) {
   *result = mStreamOffset;
   return NS_OK;
 }
 
 nsresult nsPluginStreamListenerPeer::SetStreamOffset(int32_t value) {
   mStreamOffset = value;
   return NS_OK;