mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1639837 - make CloseFileRunnable use mozilla::Runnable; r=jld
Differential Revision: https://phabricator.services.mozilla.com/D76300
This commit is contained in:
parent
c686b5d561
commit
5e67b31c1f
@ -12,7 +12,6 @@
|
||||
#include "nsDebug.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "prio.h"
|
||||
#include "private/pprio.h"
|
||||
|
||||
@ -25,15 +24,12 @@
|
||||
|
||||
using mozilla::ipc::CloseFileRunnable;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
CloseFileRunnable::CloseFileRunnable(const FileDescriptor& aFileDescriptor)
|
||||
: mFileDescriptor(aFileDescriptor) {
|
||||
: Runnable("CloseFileRunnable"),
|
||||
mFileDescriptor(aFileDescriptor) {
|
||||
MOZ_ASSERT(aFileDescriptor.IsValid());
|
||||
}
|
||||
|
||||
#endif // DEBUG
|
||||
|
||||
CloseFileRunnable::~CloseFileRunnable() {
|
||||
if (mFileDescriptor.IsValid()) {
|
||||
// It's probably safer to take the main thread IO hit here rather than leak
|
||||
@ -42,7 +38,7 @@ CloseFileRunnable::~CloseFileRunnable() {
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(CloseFileRunnable, nsIRunnable)
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(CloseFileRunnable, Runnable)
|
||||
|
||||
void CloseFileRunnable::Dispatch() {
|
||||
nsCOMPtr<nsIEventTarget> eventTarget =
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/ipc/FileDescriptor.h"
|
||||
#include "nsIRunnable.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include <stdio.h>
|
||||
|
||||
namespace mozilla {
|
||||
@ -18,21 +18,15 @@ namespace ipc {
|
||||
// When Dispatch() is called (from main thread) this class arranges to close the
|
||||
// provided FileDescriptor on one of the socket transport service threads (to
|
||||
// avoid main thread I/O).
|
||||
class CloseFileRunnable final : public nsIRunnable {
|
||||
class CloseFileRunnable final : public Runnable {
|
||||
typedef mozilla::ipc::FileDescriptor FileDescriptor;
|
||||
|
||||
FileDescriptor mFileDescriptor;
|
||||
|
||||
public:
|
||||
explicit CloseFileRunnable(const FileDescriptor& aFileDescriptor)
|
||||
#ifdef DEBUG
|
||||
;
|
||||
#else
|
||||
: mFileDescriptor(aFileDescriptor) {
|
||||
}
|
||||
#endif
|
||||
explicit CloseFileRunnable(const FileDescriptor& aFileDescriptor);
|
||||
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIRUNNABLE
|
||||
|
||||
void Dispatch();
|
||||
|
Loading…
Reference in New Issue
Block a user