Bug 1345036 - label shutdown event dispatching. r?jwwang draft
authorJohn Lin <jolin@mozilla.com>
Thu, 09 Mar 2017 13:43:30 +0800
changeset 495694 928d83602ba3c85283b1105843b2a1a36d85a275
parent 495693 841aed80ebd0c9d5b86fd878b8c652872bd23fad
child 548443 544dcbe16ff2f2d75288b05b13278c63164bf65d
push id48405
push userbmo:jolin@mozilla.com
push dateThu, 09 Mar 2017 06:10:14 +0000
reviewersjwwang
bugs1345036
milestone55.0a1
Bug 1345036 - label shutdown event dispatching. r?jwwang MozReview-Commit-ID: HfiocBzddNS
dom/media/android/AndroidMediaResourceServer.cpp
--- a/dom/media/android/AndroidMediaResourceServer.cpp
+++ b/dom/media/android/AndroidMediaResourceServer.cpp
@@ -319,17 +319,17 @@ ServeResourceEvent::Shutdown()
 {
   // Cleanup resources and exit.
   mInput->Close();
   mOutput->Close();
 
   // To shutdown the current thread we need to first exit this event.
   // The Shutdown event below is posted to the main thread to do this.
   nsCOMPtr<nsIRunnable> event = new ShutdownThreadEvent(NS_GetCurrentThread());
-  NS_DispatchToMainThread(event);
+  SystemGroup::Dispatch("ServeResourceEvent::Shutdown", TaskCategory::Other, event.forget());
 }
 
 /*
   This is the listener attached to the server socket. When an HTTP
   request is made by the client the OnSocketAccepted method is
   called. This method will spawn a thread to process the request.
   The thread receives a single event which does the parsing of
   the HTTP request and forwarding the data from the MediaResource