Bug 1633791 part 2: Use ExpectingShutdown to prevent ShutDownKill for remote canvas. r=jrmuizel
authorBob Owen <bobowencode@gmail.com>
Fri, 22 May 2020 18:22:02 +0000
changeset 531700 d457d4a5b0b1d55a618b91bdd12af48629fc2801
parent 531699 1e8d16c595f5c727c3321cbae0fe380fa13f8701
child 531701 151f9f0eaadaedf9d8c105ffe04b8fefd719549a
push id37442
push userncsoregi@mozilla.com
push dateSat, 23 May 2020 09:21:24 +0000
treeherdermozilla-central@bbcc193fe0f0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1633791
milestone78.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 1633791 part 2: Use ExpectingShutdown to prevent ShutDownKill for remote canvas. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D75508
gfx/layers/ipc/CanvasChild.cpp
--- a/gfx/layers/ipc/CanvasChild.cpp
+++ b/gfx/layers/ipc/CanvasChild.cpp
@@ -6,33 +6,35 @@
 
 #include "CanvasChild.h"
 
 #include "MainThreadUtils.h"
 #include "mozilla/gfx/DrawTargetRecording.h"
 #include "mozilla/gfx/Tools.h"
 #include "mozilla/gfx/Rect.h"
 #include "mozilla/gfx/Point.h"
+#include "mozilla/ipc/ProcessChild.h"
 #include "mozilla/layers/CanvasDrawEventRecorder.h"
 #include "nsIObserverService.h"
 #include "RecordedCanvasEventImpl.h"
 
 namespace mozilla {
 namespace layers {
 
 class RingBufferWriterServices final
     : public CanvasEventRingBuffer::WriterServices {
  public:
   explicit RingBufferWriterServices(RefPtr<CanvasChild> aCanvasChild)
       : mCanvasChild(std::move(aCanvasChild)) {}
 
   ~RingBufferWriterServices() final = default;
 
   bool ReaderClosed() final {
-    return !mCanvasChild->GetIPCChannel()->CanSend();
+    return !mCanvasChild->GetIPCChannel()->CanSend() ||
+           ipc::ProcessChild::ExpectingShutdown();
   }
 
   void ResumeReader() final { mCanvasChild->ResumeTranslation(); }
 
  private:
   RefPtr<CanvasChild> mCanvasChild;
 };