This commit is contained in:
Ben Turner 2009-07-02 13:48:33 -07:00
Родитель fb20290727
Коммит 9530b586ff
13 изменённых файлов: 56 добавлений и 23 удалений

Просмотреть файл

@ -72,6 +72,7 @@ LIBRARY_NAME = domplugins_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
ENABLE_CXX_EXCEPTIONS = 1
CPPSRCS = \
NPAPIPluginChild.cpp \

Просмотреть файл

@ -890,12 +890,12 @@ _getauthenticationinfo(NPP aNPP,
#endif /* NP_VERSION_MINOR > 19 */
nsresult
NPAPIPluginChild::AnswerNP_Initialize(NPError* rv)
NPAPIPluginChild::AnswerNP_Initialize(NPError* _retval)
{
_MOZ_LOG(__FUNCTION__);
#if defined(OS_LINUX)
*rv = mInitializeFunc(&sBrowserFuncs, &mFunctions);
*_retval = mInitializeFunc(&sBrowserFuncs, &mFunctions);
return NS_OK;
#elif defined(OS_WIN)
@ -905,7 +905,7 @@ NPAPIPluginChild::AnswerNP_Initialize(NPError* rv)
NS_ASSERTION(HIBYTE(mFunctions.version) >= NP_VERSION_MAJOR,
"callback version is less than NP version");
*rv = mInitializeFunc(&sBrowserFuncs);
*_retval = mInitializeFunc(&sBrowserFuncs);
return NS_OK;
#else
# error Please implement me for your platform

Просмотреть файл

@ -121,6 +121,7 @@ NPAPIPluginParent::NPPDestructor(NPPProtocolParent* __a,
{
_MOZ_LOG(__FUNCTION__);
delete __a;
return NS_OK;
}
void
@ -171,12 +172,9 @@ NPAPIPluginParent::NP_Initialize(const NPNetscapeFuncs* npnIface)
NPError prv;
nsresult rv = CallNP_Initialize(&prv);
if (NS_OK != rv)
if (NS_FAILED(rv))
return rv;
else if (NPERR_NO_ERROR != prv)
return prv
return NPERR_NO_ERROR;
return prv;
}
NPError

Просмотреть файл

@ -150,7 +150,7 @@ public:
return MsgPayloadError;
}
NPPProtocolChild* __a;
__a = dynamic_cast<NPPProtocolChild*>(Lookup(__ah.mChildId));
__a = static_cast<NPPProtocolChild*>(Lookup(__ah.mChildId));
if (!(__a)) {
return MsgValueError;
}

Просмотреть файл

@ -114,7 +114,7 @@ public:
return NS_ERROR_ILLEGAL_VALUE;
}
NPPProtocolParent* __b;
__b = dynamic_cast<NPPProtocolParent*>(Lookup(__a->mId));
__b = static_cast<NPPProtocolParent*>(Lookup(__a->mId));
if ((__a) != (__b)) {
return NS_ERROR_ILLEGAL_VALUE;
}

Просмотреть файл

@ -236,7 +236,7 @@ NPPInstanceChild::RegisterWindowClass()
wcex.hInstance = GetModuleHandle(NULL);
wcex.hIcon = 0;
wcex.hCursor = 0;
wcex.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW1);
wcex.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1);
wcex.lpszMenuName = 0;
wcex.lpszClassName = kWindowClassName;
wcex.hIconSm = 0;
@ -355,6 +355,5 @@ NPPInstanceChild::PluginWindowProc(HWND hWnd,
#endif // OS_WIN
} // namespace plugins
} // namespace mozilla

Просмотреть файл

@ -67,6 +67,8 @@ LIBS += \
$(NSPR_LIBS) \
$(NULL)
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1

Просмотреть файл

@ -42,8 +42,9 @@
// FIXME/cjones testing
#if !defined(OS_WIN)
#include <unistd.h>
#endif
#ifdef XP_WIN
#include <windows.h>
@ -64,4 +65,5 @@ main(int argc, char* argv[])
ScopedLogging log;
nsresult rv = XRE_InitChildProcess(argc, argv, "PluginThreadChild");
NS_ENSURE_SUCCESS(rv, 1);
return 0;
}

Просмотреть файл

@ -5,6 +5,37 @@
#ifndef BASE_BASICTYPES_H_
#define BASE_BASICTYPES_H_
#ifdef CHROMIUM_MOZILLA_BUILD
#ifndef NO_NSPR_10_SUPPORT
#define NO_NSPR_10_SUPPORT
#define NO_NSPR_10_SUPPORT_SAVE
#endif
#include "nspr/prtypes.h"
#ifdef NO_NSPR_10_SUPPORT_SAVE
#undef NO_NSPR_10_SUPPORT_SAVE
#undef NO_NSPR_10_SUPPORT
#endif
#ifdef _WIN32
#undef _WIN32
#define _WIN32_SAVE
#endif
#include "nspr/obsolete/protypes.h"
#define _INT32
#define _UINT32
#ifdef _WIN32_SAVE
#undef _WIN32_SAVE
#define _WIN32
#endif
#endif // CHROMIUM_MOZILLA_BUILD
#include <limits.h> // So we can set the bounds of our types
#include <stddef.h> // For size_t
#include <string.h> // for memcpy

Просмотреть файл

@ -420,7 +420,7 @@ nsNPAPIPlugin::CreatePlugin(const char* aFilePath, PRLibrary* aLibrary,
// Note: on Windows, we must use the fCallback because plugins may
// change the function table. The Shockwave installer makes changes
// in the table while running
*aResult = new nsNPAPIPlugin(nsnull, aLibrary, nsnull);
*aResult = new nsNPAPIPlugin(nsnull, pluginLib, aLibrary, nsnull);
if (*aResult == NULL)
return NS_ERROR_OUT_OF_MEMORY;
@ -648,7 +648,7 @@ nsNPAPIPlugin::Shutdown(void)
if (fPluginRefNum > 0)
::CloseResFile(fPluginRefNum);
#else
NS_TRY_SAFE_CALL_VOID(fShutdownEntry(), fLibrary, nsnull);
NS_TRY_SAFE_CALL_VOID(fShutdownEntry(), nsnull, nsnull);
#endif
fShutdownEntry = nsnull;
}

Просмотреть файл

@ -3559,7 +3559,7 @@ nsPluginHostImpl::TrySetUpPluginInstance(const char *aMimeType,
BOOL restoreOrigDir = FALSE;
char origDir[_MAX_PATH];
if (pluginTag->mIsJavaPlugin && !firstJavaPlugin) {
DWORD dw = ::GetCurrentDirectory(_MAX_PATH, origDir);
DWORD dw = GetCurrentDirectoryA(_MAX_PATH, origDir);
NS_ASSERTION(dw <= _MAX_PATH, "Falied to obtain the current directory, which may leads to incorrect class laoding");
nsCOMPtr<nsIFile> binDirectory;
result = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR,
@ -3568,7 +3568,7 @@ nsPluginHostImpl::TrySetUpPluginInstance(const char *aMimeType,
if (NS_SUCCEEDED(result)) {
nsCAutoString path;
binDirectory->GetNativePath(path);
restoreOrigDir = ::SetCurrentDirectory(path.get());
restoreOrigDir = SetCurrentDirectoryA(path.get());
}
}
#endif
@ -3576,7 +3576,7 @@ nsPluginHostImpl::TrySetUpPluginInstance(const char *aMimeType,
#if defined(XP_WIN) && !defined(WINCE)
if (!firstJavaPlugin && restoreOrigDir) {
BOOL bCheck = ::SetCurrentDirectory(origDir);
BOOL bCheck = SetCurrentDirectoryA(origDir);
NS_ASSERTION(bCheck, " Error restoring driectoy");
firstJavaPlugin = TRUE;
}

Просмотреть файл

@ -78,7 +78,7 @@ PR_BEGIN_MACRO \
nsresult res; \
nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &res));\
if(NS_SUCCEEDED(res) && (host != nsnull)) \
host->HandleBadPlugin(library, pluginInst);\
host->HandleBadPlugin(nsnull, pluginInst); \
ret = (NPError)NS_ERROR_FAILURE; \
} \
} \
@ -101,7 +101,7 @@ PR_BEGIN_MACRO \
nsresult res; \
nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &res));\
if(NS_SUCCEEDED(res) && (host != nsnull))\
host->HandleBadPlugin(library, pluginInst);\
host->HandleBadPlugin(nsnull, pluginInst);\
} \
} \
NS_NotifyPluginCall(startTime); \

Просмотреть файл

@ -239,11 +239,11 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary* &outLibrary)
BOOL restoreOrigDir = FALSE;
char aOrigDir[MAX_PATH + 1];
DWORD dwCheck = ::GetCurrentDirectory(sizeof(aOrigDir), aOrigDir);
DWORD dwCheck = GetCurrentDirectoryA(sizeof(aOrigDir), aOrigDir);
NS_ASSERTION(dwCheck <= MAX_PATH + 1, "Error in Loading plugin");
if (dwCheck <= MAX_PATH + 1) {
restoreOrigDir = ::SetCurrentDirectory(pluginFolderPath);
restoreOrigDir = SetCurrentDirectoryA(pluginFolderPath);
NS_ASSERTION(restoreOrigDir, "Error in Loading plugin");
}
#endif
@ -252,7 +252,7 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary* &outLibrary)
#ifndef WINCE
if (restoreOrigDir) {
BOOL bCheck = ::SetCurrentDirectory(aOrigDir);
BOOL bCheck = SetCurrentDirectoryA(aOrigDir);
NS_ASSERTION(bCheck, "Error in Loading plugin");
}