/src/mozilla-central/dom/media/webspeech/recognition/SpeechGrammar.cpp
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 | | #include "SpeechGrammar.h" |
8 | | |
9 | | #include "mozilla/dom/SpeechGrammarBinding.h" |
10 | | |
11 | | namespace mozilla { |
12 | | namespace dom { |
13 | | |
14 | | NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(SpeechGrammar, mParent) |
15 | | NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechGrammar) |
16 | | NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechGrammar) |
17 | 0 | NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechGrammar) |
18 | 0 | NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY |
19 | 0 | NS_INTERFACE_MAP_ENTRY(nsISupports) |
20 | 0 | NS_INTERFACE_MAP_END |
21 | | |
22 | | SpeechGrammar::SpeechGrammar(nsISupports* aParent) |
23 | | : mParent(aParent) |
24 | 0 | { |
25 | 0 | } |
26 | | |
27 | | SpeechGrammar::~SpeechGrammar() |
28 | 0 | { |
29 | 0 | } |
30 | | |
31 | | already_AddRefed<SpeechGrammar> |
32 | | SpeechGrammar::Constructor(const GlobalObject& aGlobal, |
33 | | ErrorResult& aRv) |
34 | 0 | { |
35 | 0 | RefPtr<SpeechGrammar> speechGrammar = |
36 | 0 | new SpeechGrammar(aGlobal.GetAsSupports()); |
37 | 0 | return speechGrammar.forget(); |
38 | 0 | } |
39 | | |
40 | | nsISupports* |
41 | | SpeechGrammar::GetParentObject() const |
42 | 0 | { |
43 | 0 | return mParent; |
44 | 0 | } |
45 | | |
46 | | JSObject* |
47 | | SpeechGrammar::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
48 | 0 | { |
49 | 0 | return SpeechGrammar_Binding::Wrap(aCx, this, aGivenProto); |
50 | 0 | } |
51 | | |
52 | | void |
53 | | SpeechGrammar::GetSrc(nsString& aRetVal, ErrorResult& aRv) const |
54 | 0 | { |
55 | 0 | aRetVal = mSrc; |
56 | 0 | } |
57 | | |
58 | | void |
59 | | SpeechGrammar::SetSrc(const nsAString& aArg, ErrorResult& aRv) |
60 | 0 | { |
61 | 0 | mSrc = aArg; |
62 | 0 | } |
63 | | |
64 | | float |
65 | | SpeechGrammar::GetWeight(ErrorResult& aRv) const |
66 | 0 | { |
67 | 0 | aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
68 | 0 | return 0; |
69 | 0 | } |
70 | | |
71 | | void |
72 | | SpeechGrammar::SetWeight(float aArg, ErrorResult& aRv) |
73 | 0 | { |
74 | 0 | aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); |
75 | 0 | } |
76 | | |
77 | | } // namespace dom |
78 | | } // namespace mozilla |