зеркало из https://github.com/mozilla/gecko-dev.git
Get rid of nsMIMEType type. b=503025 r/sr=jst
This commit is contained in:
Родитель
0af09aedf1
Коммит
8872098fcd
|
@ -1852,7 +1852,7 @@ static const char*
|
|||
GetMIMEType(nsIPluginInstance *aPluginInstance)
|
||||
{
|
||||
if (aPluginInstance) {
|
||||
nsMIMEType mime = NULL;
|
||||
char* mime = nsnull;
|
||||
if (NS_SUCCEEDED(aPluginInstance->GetMIMEType(&mime)) && mime)
|
||||
return mime;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ interface nsIPluginInstance : nsISupports
|
|||
* @param aMime - the mime type for the instance
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
void initialize(in nsIPluginInstanceOwner aOwner, in nsMIMEType aMIMEType);
|
||||
void initialize(in nsIPluginInstanceOwner aOwner, in string aMIMEType);
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to start. This will be
|
||||
|
@ -120,7 +120,7 @@ interface nsIPluginInstance : nsISupports
|
|||
* @param aResult - the resulting output stream
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
void newStreamFromPlugin(in nsMIMEType aType, in string aTarget, out nsIOutputStream aResult);
|
||||
void newStreamFromPlugin(in string aType, in string aTarget, out nsIOutputStream aResult);
|
||||
|
||||
/**
|
||||
* Called to instruct the plugin instance to print itself to a printer.
|
||||
|
@ -181,7 +181,7 @@ interface nsIPluginInstance : nsISupports
|
|||
* @param aMIMEType - resulting MIME type
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
readonly attribute nsMIMEType MIMEType;
|
||||
readonly attribute string MIMEType;
|
||||
|
||||
/**
|
||||
* Get the JavaScript context to this plugin instance.
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
[uuid(ed7d4ca0-b005-11d2-adaa-00805f6dec49)]
|
||||
interface nsIPluginStreamInfo : nsISupports
|
||||
{
|
||||
readonly attribute nsMIMEType contentType;
|
||||
readonly attribute string contentType;
|
||||
|
||||
void isSeekable(out boolean aSeekable);
|
||||
|
||||
|
|
|
@ -114,8 +114,6 @@ RCDATA NS_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Structures and definitions
|
||||
|
||||
typedef const char* nsMIMEType;
|
||||
|
||||
struct nsByteRange {
|
||||
PRInt32 offset; /* negative offset means from the end */
|
||||
PRUint32 length;
|
||||
|
|
|
@ -47,7 +47,6 @@ native nativeChar(const char * *);
|
|||
|
||||
native nsPluginMode(nsPluginMode);
|
||||
native nsPluginStreamType(nsPluginStreamType);
|
||||
native nsMIMEType(nsMIMEType);
|
||||
native nsPluginWindow(nsPluginWindow);
|
||||
[ptr] native nsPluginWindowPtr(nsPluginWindow);
|
||||
[ref] native nsPluginWindowStarRef(nsPluginWindow *);
|
||||
|
|
|
@ -338,7 +338,7 @@ nsNPAPIPluginStreamListener::OnStartBinding(nsIPluginStreamInfo* pluginInfo)
|
|||
return NS_ERROR_FAILURE;
|
||||
|
||||
PRBool seekable;
|
||||
nsMIMEType contentType;
|
||||
char* contentType;
|
||||
PRUint16 streamType = NP_NORMAL;
|
||||
NPError error;
|
||||
|
||||
|
@ -921,17 +921,17 @@ nsNPAPIPluginInstance::IsStarted(void)
|
|||
return mStarted;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsNPAPIPluginInstance::Initialize(nsIPluginInstanceOwner* aOwner, const nsMIMEType aMIMEType)
|
||||
NS_IMETHODIMP nsNPAPIPluginInstance::Initialize(nsIPluginInstanceOwner* aOwner, const char* aMIMEType)
|
||||
{
|
||||
PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::Initialize this=%p\n",this));
|
||||
|
||||
mOwner = aOwner;
|
||||
|
||||
if (aMIMEType) {
|
||||
mMIMEType = (nsMIMEType)PR_Malloc(PL_strlen(aMIMEType) + 1);
|
||||
mMIMEType = (char*)PR_Malloc(PL_strlen(aMIMEType) + 1);
|
||||
|
||||
if (mMIMEType)
|
||||
PL_strcpy((char *)mMIMEType, aMIMEType);
|
||||
PL_strcpy(mMIMEType, aMIMEType);
|
||||
}
|
||||
|
||||
return InitializePlugin();
|
||||
|
@ -1123,7 +1123,7 @@ nsNPAPIPluginInstance::InitializePlugin()
|
|||
// backward compatible...
|
||||
|
||||
nsPluginMode mode;
|
||||
nsMIMEType mimetype;
|
||||
char* mimetype;
|
||||
NPError error;
|
||||
|
||||
GetMode(&mode);
|
||||
|
@ -1258,7 +1258,7 @@ nsNPAPIPluginInstance::NewStreamToPlugin(nsIPluginStreamListener** listener)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNPAPIPluginInstance::NewStreamFromPlugin(nsMIMEType type, const char* target,
|
||||
nsNPAPIPluginInstance::NewStreamFromPlugin(const char* type, const char* target,
|
||||
nsIOutputStream* *result)
|
||||
{
|
||||
nsPluginStreamToFile* stream = new nsPluginStreamToFile(target, mOwner);
|
||||
|
@ -1783,7 +1783,7 @@ nsNPAPIPluginInstance::ForceRedraw()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNPAPIPluginInstance::GetMIMEType(nsMIMEType *result)
|
||||
nsNPAPIPluginInstance::GetMIMEType(char* *result)
|
||||
{
|
||||
if (!mMIMEType)
|
||||
*result = "";
|
||||
|
|
|
@ -164,7 +164,7 @@ public:
|
|||
private:
|
||||
nsTArray<PopupControlState> mPopupStates;
|
||||
|
||||
nsMIMEType mMIMEType;
|
||||
char* mMIMEType;
|
||||
|
||||
// Weak pointer to the owner. The owner nulls this out (by calling
|
||||
// InvalidateOwner()) when it's no longer our owner.
|
||||
|
|
|
@ -531,7 +531,7 @@ nsPluginInstanceTag * nsPluginInstanceTagList::find(const char * mimetype)
|
|||
if (!p->mInstance)
|
||||
continue;
|
||||
|
||||
nsMIMEType mt;
|
||||
char* mt;
|
||||
nsresult rv = p->mInstance->GetMIMEType(&mt);
|
||||
if (NS_FAILED(rv))
|
||||
continue;
|
||||
|
@ -1101,7 +1101,7 @@ public:
|
|||
// nsINPAPIPluginStreamInfo interface
|
||||
|
||||
NS_IMETHOD
|
||||
GetContentType(nsMIMEType* result);
|
||||
GetContentType(char **result);
|
||||
|
||||
NS_IMETHOD
|
||||
IsSeekable(PRBool* result);
|
||||
|
@ -1127,7 +1127,7 @@ public:
|
|||
// local methods
|
||||
|
||||
void
|
||||
SetContentType(const nsMIMEType contentType);
|
||||
SetContentType(const char* contentType);
|
||||
|
||||
void
|
||||
SetSeekable(const PRBool seekable);
|
||||
|
@ -1293,7 +1293,7 @@ NS_IMPL_ISUPPORTS2(nsPluginStreamInfo, nsIPluginStreamInfo,
|
|||
nsINPAPIPluginStreamInfo)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPluginStreamInfo::GetContentType(nsMIMEType* result)
|
||||
nsPluginStreamInfo::GetContentType(char **result)
|
||||
{
|
||||
*result = mContentType;
|
||||
return NS_OK;
|
||||
|
@ -1450,7 +1450,7 @@ nsPluginStreamInfo::SetStreamOffset(PRInt32 offset)
|
|||
}
|
||||
|
||||
void
|
||||
nsPluginStreamInfo::SetContentType(const nsMIMEType contentType)
|
||||
nsPluginStreamInfo::SetContentType(const char* contentType)
|
||||
{
|
||||
if (mContentType != nsnull)
|
||||
PL_strfree(mContentType);
|
||||
|
|
|
@ -178,7 +178,7 @@ MRESULT EXPENTRY PluginWndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
|||
nsCOMPtr<nsIPluginInstance> inst;
|
||||
win->GetPluginInstance(inst);
|
||||
if (inst) {
|
||||
nsMIMEType mimetype = nsnull;
|
||||
char* mimetype = nsnull;
|
||||
inst->GetMIMEType(&mimetype);
|
||||
if (mimetype) {
|
||||
if (!strcmp(mimetype, "application/x-shockwave-flash"))
|
||||
|
|
|
@ -225,7 +225,7 @@ static LRESULT CALLBACK PluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
|
|||
// Flash will need special treatment later
|
||||
if (win->mPluginType == nsPluginType_Unknown) {
|
||||
if (inst) {
|
||||
nsMIMEType mimetype = nsnull;
|
||||
char* mimetype = nsnull;
|
||||
inst->GetMIMEType(&mimetype);
|
||||
if (mimetype) {
|
||||
if (!strcmp(mimetype, "application/x-shockwave-flash"))
|
||||
|
|
Загрузка…
Ссылка в новой задаче