2016-05-28 00:54:31 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2012-05-21 15:12:37 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2010-05-11 08:18:00 +04:00
|
|
|
#ifndef dom_plugins_IOThreadChild_h
|
2022-08-10 17:55:22 +03:00
|
|
|
#define dom_plugins_IOThreadChild_h
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2010-05-11 08:18:00 +04:00
|
|
|
#include "chrome/common/child_thread.h"
|
2022-08-10 17:55:22 +03:00
|
|
|
#include "mozilla/ipc/Endpoint.h"
|
2021-06-22 21:17:22 +03:00
|
|
|
#include "mozilla/ipc/NodeController.h"
|
2022-08-10 17:55:22 +03:00
|
|
|
#include "mozilla/ipc/ProcessChild.h"
|
2009-06-30 22:51:05 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2010-05-11 08:18:00 +04:00
|
|
|
namespace ipc {
|
2009-06-30 22:51:05 +04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2010-05-11 08:18:00 +04:00
|
|
|
// The IOThreadChild class represents a background thread where the
|
|
|
|
// IPC IO MessageLoop lives.
|
|
|
|
class IOThreadChild : public ChildThread {
|
2009-06-30 22:51:05 +04:00
|
|
|
public:
|
2023-07-17 23:32:09 +03:00
|
|
|
explicit IOThreadChild(base::ProcessId aParentPid)
|
2010-05-11 08:18:00 +04:00
|
|
|
: ChildThread(base::Thread::Options(MessageLoop::TYPE_IO,
|
2023-07-17 23:32:09 +03:00
|
|
|
/* stack size */ 0),
|
|
|
|
aParentPid) {}
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2020-02-14 03:57:39 +03:00
|
|
|
~IOThreadChild() = default;
|
2010-02-04 01:17:09 +03:00
|
|
|
|
2010-05-11 08:18:00 +04:00
|
|
|
static MessageLoop* message_loop() {
|
|
|
|
return IOThreadChild::current()->Thread::message_loop();
|
|
|
|
}
|
2010-02-25 01:25:16 +03:00
|
|
|
|
2010-05-11 08:18:00 +04:00
|
|
|
protected:
|
|
|
|
static IOThreadChild* current() {
|
|
|
|
return static_cast<IOThreadChild*>(ChildThread::current());
|
|
|
|
}
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2010-05-11 08:18:00 +04:00
|
|
|
private:
|
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(IOThreadChild);
|
2009-06-30 22:51:05 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace ipc
|
|
|
|
} // namespace mozilla
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2010-05-11 08:18:00 +04:00
|
|
|
#endif // ifndef dom_plugins_IOThreadChild_h
|