Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "base/basictypes.h" |
michael@0 | 6 | #include "GetUserMediaRequest.h" |
michael@0 | 7 | #include "mozilla/dom/MediaStreamBinding.h" |
michael@0 | 8 | #include "mozilla/dom/GetUserMediaRequestBinding.h" |
michael@0 | 9 | #include "nsIScriptGlobalObject.h" |
michael@0 | 10 | #include "nsPIDOMWindow.h" |
michael@0 | 11 | #include "nsCxPusher.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace dom { |
michael@0 | 15 | |
michael@0 | 16 | GetUserMediaRequest::GetUserMediaRequest( |
michael@0 | 17 | nsPIDOMWindow* aInnerWindow, |
michael@0 | 18 | const nsAString& aCallID, |
michael@0 | 19 | const MediaStreamConstraints& aConstraints, |
michael@0 | 20 | bool aIsSecure) |
michael@0 | 21 | : mInnerWindowID(aInnerWindow->WindowID()) |
michael@0 | 22 | , mOuterWindowID(aInnerWindow->GetOuterWindow()->WindowID()) |
michael@0 | 23 | , mCallID(aCallID) |
michael@0 | 24 | , mConstraints(new MediaStreamConstraints(aConstraints)) |
michael@0 | 25 | , mIsSecure(aIsSecure) |
michael@0 | 26 | { |
michael@0 | 27 | SetIsDOMBinding(); |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(GetUserMediaRequest) |
michael@0 | 31 | NS_IMPL_CYCLE_COLLECTING_ADDREF(GetUserMediaRequest) |
michael@0 | 32 | NS_IMPL_CYCLE_COLLECTING_RELEASE(GetUserMediaRequest) |
michael@0 | 33 | NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GetUserMediaRequest) |
michael@0 | 34 | NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY |
michael@0 | 35 | NS_INTERFACE_MAP_ENTRY(nsISupports) |
michael@0 | 36 | NS_INTERFACE_MAP_END |
michael@0 | 37 | |
michael@0 | 38 | JSObject* |
michael@0 | 39 | GetUserMediaRequest::WrapObject(JSContext* aCx) |
michael@0 | 40 | { |
michael@0 | 41 | return GetUserMediaRequestBinding::Wrap(aCx, this); |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | nsISupports* GetUserMediaRequest::GetParentObject() |
michael@0 | 45 | { |
michael@0 | 46 | return nullptr; |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | void GetUserMediaRequest::GetCallID(nsString& retval) |
michael@0 | 50 | { |
michael@0 | 51 | retval = mCallID; |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | uint64_t GetUserMediaRequest::WindowID() |
michael@0 | 55 | { |
michael@0 | 56 | return mOuterWindowID; |
michael@0 | 57 | } |
michael@0 | 58 | |
michael@0 | 59 | uint64_t GetUserMediaRequest::InnerWindowID() |
michael@0 | 60 | { |
michael@0 | 61 | return mInnerWindowID; |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | bool GetUserMediaRequest::IsSecure() |
michael@0 | 65 | { |
michael@0 | 66 | return mIsSecure; |
michael@0 | 67 | } |
michael@0 | 68 | |
michael@0 | 69 | void |
michael@0 | 70 | GetUserMediaRequest::GetConstraints(MediaStreamConstraints &result) |
michael@0 | 71 | { |
michael@0 | 72 | result = *mConstraints; |
michael@0 | 73 | } |
michael@0 | 74 | |
michael@0 | 75 | } // namespace dom |
michael@0 | 76 | } // namespace mozilla |