2015-05-03 12:32:37 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 04:12:37 -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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsMimeTypeArray.h"
|
2013-08-13 23:56:21 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
#include "mozilla/dom/MimeTypeArrayBinding.h"
|
|
|
|
#include "mozilla/dom/MimeTypeBinding.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIDOMNavigator.h"
|
2015-05-20 06:30:05 -07:00
|
|
|
#include "nsPIDOMWindow.h"
|
2013-07-09 06:58:21 -07:00
|
|
|
#include "nsPluginArray.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIMIMEService.h"
|
|
|
|
#include "nsIMIMEInfo.h"
|
2013-07-17 20:23:52 -07:00
|
|
|
#include "Navigator.h"
|
2013-09-22 20:35:05 -07:00
|
|
|
#include "nsServiceManagerUtils.h"
|
2015-05-20 06:30:05 -07:00
|
|
|
#include "nsPluginTags.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
using namespace mozilla;
|
|
|
|
using namespace mozilla::dom;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsMimeTypeArray)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsMimeTypeArray)
|
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsMimeTypeArray)
|
|
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
2014-04-29 01:57:00 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsMimeTypeArray,
|
|
|
|
mWindow,
|
2015-05-29 22:42:23 -07:00
|
|
|
mMimeTypes)
|
2013-07-09 06:58:21 -07:00
|
|
|
|
2013-08-28 13:55:29 -07:00
|
|
|
nsMimeTypeArray::nsMimeTypeArray(nsPIDOMWindow* aWindow)
|
2013-10-31 22:19:09 -07:00
|
|
|
: mWindow(aWindow)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsMimeTypeArray::~nsMimeTypeArray()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07: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 07:13:33 -07:00
|
|
|
nsMimeTypeArray::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2013-07-09 06:58:21 -07: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 07:13:33 -07:00
|
|
|
return MimeTypeArrayBinding::Wrap(aCx, this, aGivenProto);
|
2013-07-09 06:58:21 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
void
|
|
|
|
nsMimeTypeArray::Refresh()
|
|
|
|
{
|
|
|
|
mMimeTypes.Clear();
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-08-28 13:55:29 -07:00
|
|
|
nsPIDOMWindow*
|
2013-07-09 06:58:21 -07:00
|
|
|
nsMimeTypeArray::GetParentObject() const
|
|
|
|
{
|
2013-08-28 13:55:29 -07:00
|
|
|
MOZ_ASSERT(mWindow);
|
|
|
|
return mWindow;
|
2013-07-09 06:58:21 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
nsMimeType*
|
|
|
|
nsMimeTypeArray::Item(uint32_t aIndex)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-07-09 06:58:21 -07:00
|
|
|
bool unused;
|
|
|
|
return IndexedGetter(aIndex, unused);
|
|
|
|
}
|
2008-10-31 14:40:35 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
nsMimeType*
|
|
|
|
nsMimeTypeArray::NamedItem(const nsAString& aName)
|
|
|
|
{
|
|
|
|
bool unused;
|
|
|
|
return NamedGetter(aName, unused);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
nsMimeType*
|
|
|
|
nsMimeTypeArray::IndexedGetter(uint32_t aIndex, bool &aFound)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-07-09 06:58:21 -07:00
|
|
|
aFound = false;
|
|
|
|
|
2013-10-20 00:05:05 -07:00
|
|
|
EnsurePluginMimeTypes();
|
2008-10-22 07:31:14 -07:00
|
|
|
|
2013-10-31 22:19:09 -07:00
|
|
|
if (aIndex >= mMimeTypes.Length()) {
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2008-10-22 07:31:14 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
aFound = true;
|
2008-10-22 07:31:14 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
return mMimeTypes[aIndex];
|
2008-10-22 07:31:14 -07:00
|
|
|
}
|
|
|
|
|
2013-10-31 22:19:09 -07:00
|
|
|
static nsMimeType*
|
2015-10-17 22:24:48 -07:00
|
|
|
FindMimeType(const nsTArray<RefPtr<nsMimeType> >& aMimeTypes,
|
2013-10-31 22:19:09 -07:00
|
|
|
const nsAString& aType)
|
|
|
|
{
|
|
|
|
for (uint32_t i = 0; i < aMimeTypes.Length(); ++i) {
|
|
|
|
nsMimeType* mimeType = aMimeTypes[i];
|
|
|
|
if (aType.Equals(mimeType->Type())) {
|
|
|
|
return mimeType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
nsMimeType*
|
|
|
|
nsMimeTypeArray::NamedGetter(const nsAString& aName, bool &aFound)
|
2008-10-22 07:31:14 -07:00
|
|
|
{
|
2013-07-09 06:58:21 -07:00
|
|
|
aFound = false;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-10-20 00:05:05 -07:00
|
|
|
EnsurePluginMimeTypes();
|
2008-10-31 08:55:59 -07:00
|
|
|
|
2014-03-20 15:41:51 -07:00
|
|
|
nsString lowerName(aName);
|
|
|
|
ToLowerCase(lowerName);
|
|
|
|
|
|
|
|
nsMimeType* mimeType = FindMimeType(mMimeTypes, lowerName);
|
2013-10-31 22:19:09 -07:00
|
|
|
if (mimeType) {
|
|
|
|
aFound = true;
|
|
|
|
return mimeType;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// Now let's check with the MIME service.
|
|
|
|
nsCOMPtr<nsIMIMEService> mimeSrv = do_GetService("@mozilla.org/mime;1");
|
2013-07-09 06:58:21 -07:00
|
|
|
if (!mimeSrv) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
nsCOMPtr<nsIMIMEInfo> mimeInfo;
|
2014-03-20 15:41:51 -07:00
|
|
|
mimeSrv->GetFromTypeAndExtension(NS_ConvertUTF16toUTF8(lowerName),
|
|
|
|
EmptyCString(), getter_AddRefs(mimeInfo));
|
2013-07-09 06:58:21 -07:00
|
|
|
if (!mimeInfo) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2008-10-31 14:40:35 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
// Now we check whether we can really claim to support this type
|
|
|
|
nsHandlerInfoAction action = nsIHandlerInfo::saveToDisk;
|
|
|
|
mimeInfo->GetPreferredAction(&action);
|
|
|
|
if (action != nsIMIMEInfo::handleInternally) {
|
|
|
|
bool hasHelper = false;
|
|
|
|
mimeInfo->GetHasDefaultHandler(&hasHelper);
|
|
|
|
|
|
|
|
if (!hasHelper) {
|
|
|
|
nsCOMPtr<nsIHandlerApp> helper;
|
|
|
|
mimeInfo->GetPreferredApplicationHandler(getter_AddRefs(helper));
|
|
|
|
|
|
|
|
if (!helper) {
|
|
|
|
// mime info from the OS may not have a PreferredApplicationHandler
|
|
|
|
// so just check for an empty default description
|
|
|
|
nsAutoString defaultDescription;
|
|
|
|
mimeInfo->GetDefaultDescription(defaultDescription);
|
|
|
|
|
|
|
|
if (defaultDescription.IsEmpty()) {
|
|
|
|
// no support; just leave
|
|
|
|
return nullptr;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
// If we got here, we support this type! Say so.
|
|
|
|
aFound = true;
|
|
|
|
|
2014-03-20 15:41:51 -07:00
|
|
|
nsMimeType *mt = new nsMimeType(mWindow, lowerName);
|
2015-05-29 22:42:23 -07:00
|
|
|
mMimeTypes.AppendElement(mt);
|
2013-07-09 06:58:21 -07:00
|
|
|
return mt;
|
2008-10-31 14:40:35 -07:00
|
|
|
}
|
|
|
|
|
2014-04-15 19:58:44 -07:00
|
|
|
bool
|
|
|
|
nsMimeTypeArray::NameIsEnumerable(const nsAString& aName)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
uint32_t
|
|
|
|
nsMimeTypeArray::Length()
|
2008-10-31 14:40:35 -07:00
|
|
|
{
|
2013-10-20 00:05:05 -07:00
|
|
|
EnsurePluginMimeTypes();
|
2008-10-31 14:40:35 -07:00
|
|
|
|
2013-10-31 22:19:09 -07:00
|
|
|
return mMimeTypes.Length();
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2011-12-01 00:28:16 -08:00
|
|
|
void
|
2014-04-15 19:58:44 -07:00
|
|
|
nsMimeTypeArray::GetSupportedNames(unsigned, nsTArray< nsString >& aRetval)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-10-20 00:05:05 -07:00
|
|
|
EnsurePluginMimeTypes();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
for (uint32_t i = 0; i < mMimeTypes.Length(); ++i) {
|
|
|
|
aRetval.AppendElement(mMimeTypes[i]->Type());
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
void
|
2013-10-20 00:05:05 -07:00
|
|
|
nsMimeTypeArray::EnsurePluginMimeTypes()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2015-05-29 22:42:23 -07:00
|
|
|
if (!mMimeTypes.IsEmpty() || !mWindow) {
|
2013-07-09 06:58:21 -07:00
|
|
|
return;
|
2010-08-12 21:05:05 -07:00
|
|
|
}
|
|
|
|
|
2015-10-26 14:37:32 -07:00
|
|
|
nsCOMPtr<nsIDOMNavigator> navigator = mWindow->GetNavigator();
|
2013-07-09 06:58:21 -07:00
|
|
|
|
|
|
|
if (!navigator) {
|
|
|
|
return;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-07-17 20:23:52 -07:00
|
|
|
ErrorResult rv;
|
2013-07-09 06:58:21 -07:00
|
|
|
nsPluginArray *pluginArray =
|
2013-07-17 20:23:52 -07:00
|
|
|
static_cast<Navigator*>(navigator.get())->GetPlugins(rv);
|
|
|
|
if (!pluginArray) {
|
|
|
|
return;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2015-05-29 22:42:23 -07:00
|
|
|
pluginArray->GetMimeTypes(mMimeTypes);
|
2013-07-09 06:58:21 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsMimeType, AddRef)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsMimeType, Release)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-04-29 01:57:00 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsMimeType, mWindow, mPluginElement)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2015-05-20 06:30:05 -07:00
|
|
|
nsMimeType::nsMimeType(nsPIDOMWindow* aWindow,
|
|
|
|
nsPluginElement* aPluginElement,
|
|
|
|
const nsAString& aType,
|
|
|
|
const nsAString& aDescription,
|
|
|
|
const nsAString& aExtension)
|
2013-07-09 06:58:21 -07:00
|
|
|
: mWindow(aWindow),
|
|
|
|
mPluginElement(aPluginElement),
|
2015-05-20 06:30:05 -07:00
|
|
|
mType(aType),
|
|
|
|
mDescription(aDescription),
|
|
|
|
mExtension(aExtension)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-08-28 13:55:29 -07:00
|
|
|
nsMimeType::nsMimeType(nsPIDOMWindow* aWindow, const nsAString& aType)
|
2013-07-09 06:58:21 -07:00
|
|
|
: mWindow(aWindow),
|
|
|
|
mPluginElement(nullptr),
|
|
|
|
mType(aType)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
nsMimeType::~nsMimeType()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-08-28 13:55:29 -07:00
|
|
|
nsPIDOMWindow*
|
2013-07-09 06:58:21 -07:00
|
|
|
nsMimeType::GetParentObject() const
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-08-28 13:55:29 -07:00
|
|
|
MOZ_ASSERT(mWindow);
|
|
|
|
return mWindow;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07: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 07:13:33 -07:00
|
|
|
nsMimeType::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
2007-03-22 10:30:00 -07: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 07:13:33 -07:00
|
|
|
return MimeTypeBinding::Wrap(aCx, this, aGivenProto);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
void
|
2015-05-20 06:30:05 -07:00
|
|
|
nsMimeType::GetDescription(nsString& aRetval) const
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2015-05-20 06:30:05 -07:00
|
|
|
aRetval = mDescription;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
nsPluginElement*
|
|
|
|
nsMimeType::GetEnabledPlugin() const
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2015-08-13 05:22:48 -07:00
|
|
|
if (!mPluginElement || !mPluginElement->PluginTag()->IsEnabled()) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return mPluginElement;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
void
|
2015-05-20 06:30:05 -07:00
|
|
|
nsMimeType::GetSuffixes(nsString& aRetval) const
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2015-05-20 06:30:05 -07:00
|
|
|
aRetval = mExtension;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-07-09 06:58:21 -07:00
|
|
|
void
|
|
|
|
nsMimeType::GetType(nsString& aRetval) const
|
|
|
|
{
|
|
|
|
aRetval = mType;
|
|
|
|
}
|