/src/mozilla-central/dom/media/webspeech/synth/test/nsFakeSynthServices.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
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 | | #ifndef nsFakeSynthServices_h |
8 | | #define nsFakeSynthServices_h |
9 | | |
10 | | #include "nsTArray.h" |
11 | | #include "nsIObserver.h" |
12 | | #include "nsIThread.h" |
13 | | #include "nsISpeechService.h" |
14 | | #include "nsRefPtrHashtable.h" |
15 | | #include "mozilla/StaticPtr.h" |
16 | | #include "mozilla/Monitor.h" |
17 | | |
18 | | namespace mozilla { |
19 | | namespace dom { |
20 | | |
21 | | class nsFakeSynthServices : public nsIObserver |
22 | | { |
23 | | |
24 | | public: |
25 | | NS_DECL_ISUPPORTS |
26 | | NS_DECL_NSIOBSERVER |
27 | | |
28 | 0 | nsFakeSynthServices() = default; |
29 | | |
30 | | static nsFakeSynthServices* GetInstance(); |
31 | | |
32 | | static already_AddRefed<nsFakeSynthServices> GetInstanceForService(); |
33 | | |
34 | | static void Shutdown(); |
35 | | |
36 | | private: |
37 | | |
38 | 0 | virtual ~nsFakeSynthServices() = default; |
39 | | |
40 | | void Init(); |
41 | | |
42 | | nsCOMPtr<nsISpeechService> mSynthService; |
43 | | |
44 | | static StaticRefPtr<nsFakeSynthServices> sSingleton; |
45 | | }; |
46 | | |
47 | | } // namespace dom |
48 | | } // namespace mozilla |
49 | | |
50 | | #endif |