Bug 1755316 - Add audio tests with simultaneous processes r=alwu
[gecko.git] / widget / nsContentProcessWidgetFactory.cpp
blob70d91f1f1d35582296724c1d191244ddfc28f586
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include "mozilla/ModuleUtils.h"
9 #include "nsWidgetsCID.h"
10 #include "nsClipboardProxy.h"
11 #include "nsColorPickerProxy.h"
12 #include "nsDragServiceProxy.h"
13 #include "nsFilePickerProxy.h"
14 #include "nsSoundProxy.h"
15 #include "mozilla/widget/ScreenManager.h"
17 using namespace mozilla;
18 using namespace mozilla::widget;
20 NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardProxy)
21 NS_GENERIC_FACTORY_CONSTRUCTOR(nsColorPickerProxy)
22 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragServiceProxy)
23 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePickerProxy)
24 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSoundProxy)
25 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ScreenManager,
26 ScreenManager::GetAddRefedSingleton)
28 NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
29 NS_DEFINE_NAMED_CID(NS_COLORPICKER_CID);
30 NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
31 NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
32 NS_DEFINE_NAMED_CID(NS_SOUND_CID);
33 NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
35 static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
36 {&kNS_CLIPBOARD_CID, false, nullptr, nsClipboardProxyConstructor,
37 Module::CONTENT_PROCESS_ONLY},
38 {&kNS_COLORPICKER_CID, false, nullptr, nsColorPickerProxyConstructor,
39 Module::CONTENT_PROCESS_ONLY},
40 {&kNS_DRAGSERVICE_CID, false, nullptr, nsDragServiceProxyConstructor,
41 Module::CONTENT_PROCESS_ONLY},
42 {&kNS_FILEPICKER_CID, false, nullptr, nsFilePickerProxyConstructor,
43 Module::CONTENT_PROCESS_ONLY},
44 {&kNS_SOUND_CID, false, nullptr, nsSoundProxyConstructor,
45 Module::CONTENT_PROCESS_ONLY},
46 {&kNS_SCREENMANAGER_CID, false, nullptr, ScreenManagerConstructor,
47 Module::CONTENT_PROCESS_ONLY},
48 {nullptr}};
50 static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
51 {"@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID,
52 Module::CONTENT_PROCESS_ONLY},
53 {"@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID,
54 Module::CONTENT_PROCESS_ONLY},
55 {"@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID,
56 Module::CONTENT_PROCESS_ONLY},
57 {"@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID,
58 Module::CONTENT_PROCESS_ONLY},
59 {"@mozilla.org/sound;1", &kNS_SOUND_CID, Module::CONTENT_PROCESS_ONLY},
60 {"@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID,
61 Module::CONTENT_PROCESS_ONLY},
62 {nullptr}};
64 extern const mozilla::Module kContentProcessWidgetModule = {
65 mozilla::Module::kVersion, kWidgetCIDs, kWidgetContracts};