Bug 1499462: Remove dead failure handling and comments from ThrottledEventQueue::Create. r=froydnj
authorJim Blandy <jimb@mozilla.com>
Tue, 16 Oct 2018 21:24:48 +0000
changeset 489940 e85db490e17a596a40eb8bc2a3d2787a77c41d50
parent 489939 8fee7620570b941294f056eab7fa220cc531669c
child 489941 6dad1580bc3ea76a5239ef86a78e82745f197f5a
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersfroydnj
bugs1499462
milestone64.0a1
Bug 1499462: Remove dead failure handling and comments from ThrottledEventQueue::Create. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D8890
xpcom/threads/ThrottledEventQueue.cpp
xpcom/threads/ThrottledEventQueue.h
--- a/xpcom/threads/ThrottledEventQueue.cpp
+++ b/xpcom/threads/ThrottledEventQueue.cpp
@@ -303,19 +303,16 @@ ThrottledEventQueue::ThrottledEventQueue
 
 already_AddRefed<ThrottledEventQueue>
 ThrottledEventQueue::Create(nsISerialEventTarget* aBaseTarget)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aBaseTarget);
 
   RefPtr<Inner> inner = Inner::Create(aBaseTarget);
-  if (NS_WARN_IF(!inner)) {
-    return nullptr;
-  }
 
   RefPtr<ThrottledEventQueue> ref =
     new ThrottledEventQueue(inner.forget());
   return ref.forget();
 }
 
 bool
 ThrottledEventQueue::IsEmpty() const
--- a/xpcom/threads/ThrottledEventQueue.h
+++ b/xpcom/threads/ThrottledEventQueue.h
@@ -59,18 +59,17 @@ class ThrottledEventQueue final : public
 {
   class Inner;
   RefPtr<Inner> mInner;
 
   explicit ThrottledEventQueue(already_AddRefed<Inner> aInner);
   ~ThrottledEventQueue() = default;
 
 public:
-  // Attempt to create a ThrottledEventQueue for the given target.  This
-  // may return nullptr if the browser is already shutting down.
+  // Create a ThrottledEventQueue for the given target.
   static already_AddRefed<ThrottledEventQueue>
   Create(nsISerialEventTarget* aBaseTarget);
 
   // Determine if there are any events pending in the queue.
   bool IsEmpty() const;
 
   // Determine how many events are pending in the queue.
   uint32_t Length() const;