Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #include "mozilla/dom/DispatcherTrait.h"
8 :
9 : #include "mozilla/AbstractThread.h"
10 : #include "mozilla/SchedulerGroup.h"
11 : #include "nsINamed.h"
12 :
13 : using namespace mozilla;
14 : using namespace mozilla::dom;
15 :
16 : nsresult
17 130 : DispatcherTrait::Dispatch(const char* aName,
18 : TaskCategory aCategory,
19 : already_AddRefed<nsIRunnable>&& aRunnable)
20 : {
21 130 : return SchedulerGroup::UnlabeledDispatch(aName, aCategory, Move(aRunnable));
22 : }
23 :
24 : nsISerialEventTarget*
25 24 : DispatcherTrait::EventTargetFor(TaskCategory aCategory) const
26 : {
27 24 : return GetMainThreadSerialEventTarget();
28 : }
29 :
30 : AbstractThread*
31 0 : DispatcherTrait::AbstractMainThreadFor(TaskCategory aCategory)
32 : {
33 : // Return non DocGroup version by default.
34 0 : return AbstractThread::MainThread();
35 : }
|