2013-09-15 23:34:57 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "base/basictypes.h"
|
|
|
|
#include "GetUserMediaRequest.h"
|
2014-04-04 02:54:25 -07:00
|
|
|
#include "mozilla/dom/MediaStreamBinding.h"
|
2013-09-15 23:34:57 -07:00
|
|
|
#include "mozilla/dom/GetUserMediaRequestBinding.h"
|
|
|
|
#include "nsIScriptGlobalObject.h"
|
|
|
|
#include "nsPIDOMWindow.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
GetUserMediaRequest::GetUserMediaRequest(
|
|
|
|
nsPIDOMWindow* aInnerWindow,
|
|
|
|
const nsAString& aCallID,
|
2014-04-18 11:00:16 -07:00
|
|
|
const MediaStreamConstraints& aConstraints,
|
2014-04-15 23:22:19 -07:00
|
|
|
bool aIsSecure)
|
2014-02-14 11:32:58 -08:00
|
|
|
: mInnerWindowID(aInnerWindow->WindowID())
|
|
|
|
, mOuterWindowID(aInnerWindow->GetOuterWindow()->WindowID())
|
2013-09-15 23:34:57 -07:00
|
|
|
, mCallID(aCallID)
|
2014-04-18 11:00:16 -07:00
|
|
|
, mConstraints(new MediaStreamConstraints(aConstraints))
|
2014-04-15 23:22:19 -07:00
|
|
|
, mIsSecure(aIsSecure)
|
2013-09-15 23:34:57 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-14 11:32:58 -08:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(GetUserMediaRequest)
|
2013-09-15 23:34:57 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(GetUserMediaRequest)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(GetUserMediaRequest)
|
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GetUserMediaRequest)
|
|
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
|
|
|
JSObject*
|
2014-04-08 15:27:18 -07:00
|
|
|
GetUserMediaRequest::WrapObject(JSContext* aCx)
|
2013-09-15 23:34:57 -07:00
|
|
|
{
|
Bug 991742 part 6. Remove the "aScope" argument of binding Wrap() methods. r=bholley
This patch was mostly generated with this command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""
plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
2014-04-08 15:27:17 -07:00
|
|
|
return GetUserMediaRequestBinding::Wrap(aCx, this);
|
2013-09-15 23:34:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
nsISupports* GetUserMediaRequest::GetParentObject()
|
|
|
|
{
|
2014-02-14 11:32:58 -08:00
|
|
|
return nullptr;
|
2013-09-15 23:34:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void GetUserMediaRequest::GetCallID(nsString& retval)
|
|
|
|
{
|
|
|
|
retval = mCallID;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t GetUserMediaRequest::WindowID()
|
|
|
|
{
|
2014-02-14 11:32:58 -08:00
|
|
|
return mOuterWindowID;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t GetUserMediaRequest::InnerWindowID()
|
|
|
|
{
|
|
|
|
return mInnerWindowID;
|
2013-09-15 23:34:57 -07:00
|
|
|
}
|
|
|
|
|
2014-04-15 23:22:19 -07:00
|
|
|
bool GetUserMediaRequest::IsSecure()
|
|
|
|
{
|
|
|
|
return mIsSecure;
|
|
|
|
}
|
|
|
|
|
2013-09-15 23:34:57 -07:00
|
|
|
void
|
2014-04-18 11:00:16 -07:00
|
|
|
GetUserMediaRequest::GetConstraints(MediaStreamConstraints &result)
|
2013-09-15 23:34:57 -07:00
|
|
|
{
|
2014-04-04 02:54:25 -07:00
|
|
|
result = *mConstraints;
|
2013-09-15 23:34:57 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|