/src/mozilla-central/dom/media/TextTrackRegion.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 et tw=78: */ |
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/TextTrackRegion.h" |
8 | | |
9 | | namespace mozilla { |
10 | | namespace dom { |
11 | | |
12 | | NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(TextTrackRegion, mParent) |
13 | | NS_IMPL_CYCLE_COLLECTING_ADDREF(TextTrackRegion) |
14 | | NS_IMPL_CYCLE_COLLECTING_RELEASE(TextTrackRegion) |
15 | 0 | NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TextTrackRegion) |
16 | 0 | NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY |
17 | 0 | NS_INTERFACE_MAP_ENTRY(nsISupports) |
18 | 0 | NS_INTERFACE_MAP_END |
19 | | |
20 | | JSObject* |
21 | | TextTrackRegion::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
22 | 0 | { |
23 | 0 | return VTTRegion_Binding::Wrap(aCx, this, aGivenProto); |
24 | 0 | } |
25 | | |
26 | | already_AddRefed<TextTrackRegion> |
27 | | TextTrackRegion::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv) |
28 | 0 | { |
29 | 0 | nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal.GetAsSupports()); |
30 | 0 | if (!window) { |
31 | 0 | aRv.Throw(NS_ERROR_FAILURE); |
32 | 0 | return nullptr; |
33 | 0 | } |
34 | 0 | |
35 | 0 | RefPtr<TextTrackRegion> region = new TextTrackRegion(aGlobal.GetAsSupports()); |
36 | 0 | return region.forget(); |
37 | 0 | } |
38 | | |
39 | | TextTrackRegion::TextTrackRegion(nsISupports* aGlobal) |
40 | | : mParent(aGlobal) |
41 | | , mWidth(100) |
42 | | , mLines(3) |
43 | | , mRegionAnchorX(0) |
44 | | , mRegionAnchorY(100) |
45 | | , mViewportAnchorX(0) |
46 | | , mViewportAnchorY(100) |
47 | | , mScroll(ScrollSetting::_empty) |
48 | 0 | { |
49 | 0 | } |
50 | | |
51 | | void |
52 | | TextTrackRegion::CopyValues(TextTrackRegion& aRegion) |
53 | 0 | { |
54 | 0 | mId = aRegion.Id(); |
55 | 0 | mWidth = aRegion.Width(); |
56 | 0 | mLines = aRegion.Lines(); |
57 | 0 | mRegionAnchorX = aRegion.RegionAnchorX(); |
58 | 0 | mRegionAnchorY = aRegion.RegionAnchorY(); |
59 | 0 | mViewportAnchorX = aRegion.ViewportAnchorX(); |
60 | 0 | mViewportAnchorY = aRegion.ViewportAnchorY(); |
61 | 0 | mScroll = aRegion.Scroll(); |
62 | 0 | } |
63 | | |
64 | | } //namespace dom |
65 | | } //namespace mozilla |
66 | | |