mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
8c296bbcd4
This patch was generated by a script. Here's the source of the script for future reference: function convert() { echo "Converting $1 to $2..." find . ! -wholename "*nsprpub*" \ ! -wholename "*security/nss*" \ ! -wholename "*/.hg*" \ ! -wholename "obj-ff-dbg*" \ ! -name nsXPCOMCID.h \ ! -name prtypes.h \ -type f \ \( -iname "*.cpp" \ -o -iname "*.h" \ -o -iname "*.c" \ -o -iname "*.cc" \ -o -iname "*.idl" \ -o -iname "*.ipdl" \ -o -iname "*.ipdlh" \ -o -iname "*.mm" \) | \ xargs -n 1 sed -i -e "s/\b$1\b/$2/g" } convert PRInt8 int8_t convert PRUint8 uint8_t convert PRInt16 int16_t convert PRUint16 uint16_t convert PRInt32 int32_t convert PRUint32 uint32_t convert PRInt64 int64_t convert PRUint64 uint64_t convert PRIntn int convert PRUintn unsigned convert PRSize size_t convert PROffset32 int32_t convert PROffset64 int64_t convert PRPtrdiff ptrdiff_t convert PRFloat64 double
110 lines
2.7 KiB
C++
110 lines
2.7 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=2 sw=2 et tw=79: */
|
|
/* 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/. */
|
|
|
|
#ifndef nsMimeTypeArray_h___
|
|
#define nsMimeTypeArray_h___
|
|
|
|
#include "nsIDOMMimeTypeArray.h"
|
|
#include "nsIDOMMimeType.h"
|
|
#include "nsString.h"
|
|
#include "nsCOMPtr.h"
|
|
#include "nsCOMArray.h"
|
|
|
|
class nsIDOMNavigator;
|
|
|
|
// NB: Due to weak references, nsNavigator has intimate knowledge of our
|
|
// members.
|
|
class nsMimeTypeArray : public nsIDOMMimeTypeArray
|
|
{
|
|
public:
|
|
nsMimeTypeArray(nsIDOMNavigator* navigator);
|
|
virtual ~nsMimeTypeArray();
|
|
|
|
NS_DECL_ISUPPORTS
|
|
NS_DECL_NSIDOMMIMETYPEARRAY
|
|
|
|
void Refresh();
|
|
|
|
nsIDOMMimeType* GetItemAt(uint32_t aIndex, nsresult* aResult);
|
|
nsIDOMMimeType* GetNamedItem(const nsAString& aName, nsresult* aResult);
|
|
|
|
static nsMimeTypeArray* FromSupports(nsISupports* aSupports)
|
|
{
|
|
#ifdef DEBUG
|
|
{
|
|
nsCOMPtr<nsIDOMMimeTypeArray> array_qi = do_QueryInterface(aSupports);
|
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
// question doesn't use the nsIDOMMimeTypeArray pointer as the nsISupports
|
|
// pointer. That must be fixed, or we'll crash...
|
|
NS_ASSERTION(array_qi == static_cast<nsIDOMMimeTypeArray*>(aSupports),
|
|
"Uh, fix QI!");
|
|
}
|
|
#endif
|
|
|
|
return static_cast<nsMimeTypeArray*>(aSupports);
|
|
}
|
|
|
|
void Invalidate()
|
|
{
|
|
// NB: This will cause GetMimeTypes to fail from now on.
|
|
mNavigator = nullptr;
|
|
Clear();
|
|
}
|
|
|
|
private:
|
|
nsresult GetMimeTypes();
|
|
void Clear();
|
|
|
|
protected:
|
|
nsIDOMNavigator* mNavigator;
|
|
// Number of mimetypes handled by plugins.
|
|
uint32_t mPluginMimeTypeCount;
|
|
// mMimeTypeArray contains all mimetypes handled by plugins
|
|
// (mPluginMimeTypeCount) and any mimetypes that we handle internally and
|
|
// have been looked up before. The number of items in mMimeTypeArray should
|
|
// thus always be equal to or higher than mPluginMimeTypeCount.
|
|
nsCOMArray<nsIDOMMimeType> mMimeTypeArray;
|
|
bool mInited;
|
|
};
|
|
|
|
class nsMimeType : public nsIDOMMimeType
|
|
{
|
|
public:
|
|
nsMimeType(nsIDOMPlugin* aPlugin, nsIDOMMimeType* aMimeType);
|
|
virtual ~nsMimeType();
|
|
|
|
NS_DECL_ISUPPORTS
|
|
NS_DECL_NSIDOMMIMETYPE
|
|
|
|
void DetachPlugin() { mPlugin = nullptr; }
|
|
|
|
protected:
|
|
nsIDOMPlugin* mPlugin;
|
|
nsCOMPtr<nsIDOMMimeType> mMimeType;
|
|
};
|
|
|
|
class nsHelperMimeType : public nsIDOMMimeType
|
|
{
|
|
public:
|
|
nsHelperMimeType(const nsAString& aType)
|
|
: mType(aType)
|
|
{
|
|
}
|
|
|
|
virtual ~nsHelperMimeType()
|
|
{
|
|
}
|
|
|
|
NS_DECL_ISUPPORTS
|
|
NS_DECL_NSIDOMMIMETYPE
|
|
|
|
private:
|
|
nsString mType;
|
|
};
|
|
|
|
#endif /* nsMimeTypeArray_h___ */
|