Bug 1108767 - Allow promises to be resolved without a MediaPromiseHolder. r=cpearce, a=sledru
authorBobby Holley <bobbyholley@gmail.com>
Mon, 08 Dec 2014 17:19:05 -0800
changeset 242716 9d0bfa85dedaa03aa6576426035e7d8aca642dd3
parent 242715 9dc7dfc38f64c9037b9b4e7460d8155ea24231ac
child 242717 adad22a377906ee881e8b2805c18b03f9f63dad5
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, sledru
bugs1108767
milestone36.0a2
Bug 1108767 - Allow promises to be resolved without a MediaPromiseHolder. r=cpearce, a=sledru It turns out that there are use-cases where this restriction is clunky.
dom/media/MediaPromise.h
--- a/dom/media/MediaPromise.h
+++ b/dom/media/MediaPromise.h
@@ -220,19 +220,16 @@ public:
                 aCallSite, this, thenValue, aThisVal, (int) IsPending());
     if (!IsPending()) {
       thenValue->Dispatch(this);
     } else {
       mThenValues.AppendElement(thenValue);
     }
   }
 
-private:
-  // Resolve and Reject may only be invoked via MediaPromiseHolder.
-  friend class MediaPromiseHolder<MediaPromise<ResolveValueType, RejectValueType>>;
   void Resolve(ResolveValueType aResolveValue, const char* aResolveSite)
   {
     MutexAutoLock lock(mMutex);
     MOZ_ASSERT(IsPending());
     PROMISE_LOG("%s resolving MediaPromise (%p created at %s)", aResolveSite, this, mCreationSite);
     mResolveValue.emplace(aResolveValue);
     DispatchAll();
   }