2008-07-09 12:22:20 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
2012-05-21 15:12:37 +04: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/. */
|
2013-02-14 19:59:21 +04:00
|
|
|
|
|
|
|
#include "mozilla/dom/MediaError.h"
|
2012-07-02 03:45:59 +04:00
|
|
|
#include "nsDOMClassInfoID.h"
|
2013-02-14 19:59:21 +04:00
|
|
|
#include "mozilla/dom/MediaErrorBinding.h"
|
2008-07-09 12:22:20 +04:00
|
|
|
|
2013-02-14 19:59:21 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2008-07-09 12:22:20 +04:00
|
|
|
|
2014-04-29 12:57:00 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(MediaError, mParent)
|
2013-02-14 19:59:21 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(MediaError)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(MediaError)
|
2010-01-12 16:08:43 +03:00
|
|
|
|
2013-02-14 19:59:21 +04:00
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MediaError)
|
|
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
2010-08-25 12:43:00 +04:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIDOMMediaError)
|
2013-02-14 19:59:21 +04:00
|
|
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMediaError)
|
2008-07-09 12:22:20 +04:00
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
2013-03-19 16:23:54 +04:00
|
|
|
MediaError::MediaError(HTMLMediaElement* aParent, uint16_t aCode)
|
2013-02-14 19:59:21 +04:00
|
|
|
: mParent(aParent)
|
|
|
|
, mCode(aCode)
|
2008-07-09 12:22:20 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-02-14 19:59:21 +04:00
|
|
|
NS_IMETHODIMP MediaError::GetCode(uint16_t* aCode)
|
2008-07-09 12:22:20 +04:00
|
|
|
{
|
|
|
|
if (aCode)
|
2013-02-14 19:59:21 +04:00
|
|
|
*aCode = Code();
|
2008-07-09 12:22:20 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2013-02-14 19:59:21 +04:00
|
|
|
|
2013-02-14 19:59:21 +04:00
|
|
|
JSObject*
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
MediaError::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2013-02-14 19:59:21 +04:00
|
|
|
{
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
return MediaErrorBinding::Wrap(aCx, this, aGivenProto);
|
2013-02-14 19:59:21 +04:00
|
|
|
}
|
|
|
|
|
2013-02-14 19:59:21 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|