Bug 1194112. Part 5 - remove dead code. r=kinetik.
authorJW Wang <jwwang@mozilla.com>
Mon, 24 Aug 2015 10:38:37 +0800
changeset 259022 d9d782e4fbc443688f8c0db2d88259cd8b0a2ffa
parent 259021 1254f92e2493d81474705f7fa90ab455682febb6
child 259023 2875976a9a6ffde1bc9410b5ce2f738e713262aa
push id29268
push userryanvm@gmail.com
push dateTue, 25 Aug 2015 00:37:23 +0000
treeherdermozilla-central@08015770c9d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1194112
milestone43.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 1194112. Part 5 - remove dead code. r=kinetik.
dom/media/MediaEventSource.h
--- a/dom/media/MediaEventSource.h
+++ b/dom/media/MediaEventSource.h
@@ -362,53 +362,16 @@ class MediaEventSource {
   typedef detail::Listener<ArgType, PassMode> Listener;
 
   template<typename Target, typename Func>
   using ListenerImpl = detail::ListenerImpl<Target, Func, ArgType, PassMode>;
 
   template <typename Method>
   using TakeArgs = detail::TakeArgs<Method>;
 
-  /**
-   * Stored by MediaEventSource to send notifications to the listener.
-   */
-  class Listener {
-  public:
-    Listener() : mToken(new RevocableToken()) {}
-
-    virtual ~Listener() {
-      MOZ_ASSERT(Token()->IsRevoked(), "Must disconnect the listener.");
-    }
-
-    virtual void Dispatch(const ArgType& aEvent) = 0;
-
-    RevocableToken* Token() const {
-      return mToken;
-    }
-
-  private:
-    const nsRefPtr<RevocableToken> mToken;
-  };
-
-  /**
-   * Store the registered target thread and function so it knows where and to
-   * whom to send the event data.
-   */
-  template<typename Target, typename Function>
-  class ListenerImpl : public Listener {
-  public:
-    explicit ListenerImpl(Target* aTarget, const Function& aFunction)
-      : mHelper(Listener::Token(), aTarget, aFunction) {}
-    void Dispatch(const ArgType& aEvent) override {
-      mHelper.Dispatch(aEvent);
-    }
-  private:
-    detail::ListenerHelper<Target, Function> mHelper;
-  };
-
   template<typename Target, typename Function>
   MediaEventListener
   ConnectInternal(Target* aTarget, const Function& aFunction) {
     MutexAutoLock lock(mMutex);
     MOZ_ASSERT(Mode == ListenerMode::NonExclusive || mListeners.IsEmpty());
     auto l = mListeners.AppendElement();
     l->reset(new ListenerImpl<Target, Function>(aTarget, aFunction));
     return MediaEventListener((*l)->Token());