Bug 654504 - Remove WinCE code from dom/plugins/base/; r=josh

This commit is contained in:
Ed Morley 2011-05-08 19:45:56 +02:00
parent fc89f5809d
commit 785a1e559b
7 changed files with 8 additions and 67 deletions

View File

@ -94,7 +94,7 @@ CPPSRCS = \
PluginPRLibrary.cpp \
$(NULL)
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
ifeq ($(OS_ARCH),WINNT)
CPPSRCS += nsPluginsDirWin.cpp
CPPSRCS += nsPluginNativeWindowWin.cpp
CPPSRCS += nsPluginDirServiceProvider.cpp

View File

@ -625,7 +625,7 @@ MakeNewNPAPIStreamInternal(NPP npp, const char *relativeURL, const char *target,
return NPERR_NO_ERROR;
}
#if defined(MOZ_MEMORY_WINDOWS) && !defined(MOZ_MEMORY_WINCE)
#if defined(MOZ_MEMORY_WINDOWS)
extern "C" size_t malloc_usable_size(const void *ptr);
#endif
@ -738,7 +738,7 @@ doGetIdentifier(JSContext *cx, const NPUTF8* name)
return StringToNPIdentifier(str);
}
#if defined(MOZ_MEMORY_WINDOWS) && !defined(MOZ_MEMORY_WINCE)
#if defined(MOZ_MEMORY_WINDOWS)
BOOL
InHeap(HANDLE hHeap, LPVOID lpMem)
{
@ -1919,7 +1919,7 @@ _releasevariantvalue(NPVariant* variant)
const NPString *s = &NPVARIANT_TO_STRING(*variant);
if (s->UTF8Characters) {
#if defined(MOZ_MEMORY_WINDOWS) && !defined(MOZ_MEMORY_WINCE)
#if defined(MOZ_MEMORY_WINDOWS)
if (malloc_usable_size((void *)s->UTF8Characters) != 0) {
PR_Free((void *)s->UTF8Characters);
} else {
@ -2225,44 +2225,11 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
}
#endif
// we no longer hand out any XPCOM objects, except on WINCE,
// where it's needed for the ActiveX shunt that makes Flash
// work until we get an NPAPI plugin there.
#ifdef WINCE
case NPNVDOMWindow: {
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata;
NS_ENSURE_TRUE(inst, NPERR_GENERIC_ERROR);
nsIDOMWindow *domWindow = inst->GetDOMWindow().get();
if (domWindow) {
// Pass over ownership of domWindow to the caller.
(*(nsIDOMWindow**)result) = domWindow;
return NPERR_NO_ERROR;
}
return NPERR_GENERIC_ERROR;
}
case NPNVDOMElement: {
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *) npp->ndata;
NS_ENSURE_TRUE(inst, NPERR_GENERIC_ERROR);
nsCOMPtr<nsIDOMElement> e;
inst->GetDOMElement(getter_AddRefs(e));
if (e) {
NS_ADDREF(*(nsIDOMElement**)result = e.get());
return NPERR_NO_ERROR;
}
return NPERR_GENERIC_ERROR;
}
#else
// we no longer hand out any XPCOM objects
case NPNVDOMElement:
// fall through
case NPNVDOMWindow:
// fall through
#endif /* WINCE */
case NPNVserviceManager:
// old XPCOM objects, no longer supported, but null out the out
// param to avoid crashing plugins that still try to use this.

View File

@ -89,12 +89,7 @@ GetFileVersion(LPCWSTR szFile, verBlock *vbVersion)
ClearVersion(vbVersion);
if (FileExists(szFile)) {
bRv = TRUE;
#ifdef WINCE
// WinCe takes a non const file path string, while desktop take a const
LPWSTR lpFilepath = const_cast<LPWSTR>(szFile);
#else
LPCWSTR lpFilepath = szFile;
#endif
dwLen = GetFileVersionInfoSizeW(lpFilepath, &dwHandle);
lpData = (LPVOID)malloc(dwLen);
uLen = 0;

View File

@ -1328,7 +1328,7 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType,
nsCOMPtr<nsIPluginInstance> instance;
if (plugin) {
#if defined(XP_WIN) && !defined(WINCE)
#if defined(XP_WIN)
static BOOL firstJavaPlugin = FALSE;
BOOL restoreOrigDir = FALSE;
WCHAR origDir[_MAX_PATH];
@ -1349,7 +1349,7 @@ nsPluginHost::TrySetUpPluginInstance(const char *aMimeType,
rv = plugin->CreatePluginInstance(getter_AddRefs(instance));
#if defined(XP_WIN) && !defined(WINCE)
#if defined(XP_WIN)
if (!firstJavaPlugin && restoreOrigDir) {
BOOL bCheck = SetCurrentDirectoryW(origDir);
NS_ASSERTION(bCheck, "Error restoring directory");

View File

@ -146,10 +146,8 @@ public:
virtual nsresult CallSetWindow(nsCOMPtr<nsIPluginInstance> &aPluginInstance);
private:
#ifndef WINCE
nsresult SubclassAndAssociateWindow();
nsresult UndoSubclassAndAssociateWindow();
#endif
public:
// locals
@ -288,7 +286,6 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
break;
#ifndef WINCE
case WM_MOUSEACTIVATE: {
// If a child window of this plug-in is already focused,
// don't focus the parent to avoid focus dance. We'll
@ -332,7 +329,6 @@ static LRESULT CALLBACK PluginWndProcInternal(HWND hWnd, UINT msg, WPARAM wParam
}
break;
}
#endif
}
// Macromedia Flash plugin may flood the message queue with some special messages
@ -653,8 +649,6 @@ nsresult nsPluginNativeWindowWin::CallSetWindow(nsCOMPtr<nsIPluginInstance> &aPl
}
}
// WINCE does not subclass windows. See bug 300011 for the details.
#ifndef WINCE
if (window) {
// grab the widget procedure before the plug-in does a subclass in
// setwindow. We'll use this in PluginWndProc for forwarding focus
@ -675,24 +669,19 @@ nsresult nsPluginNativeWindowWin::CallSetWindow(nsCOMPtr<nsIPluginInstance> &aPl
}
}
}
#endif
nsPluginNativeWindow::CallSetWindow(aPluginInstance);
#ifndef WINCE
SubclassAndAssociateWindow();
if (window && mPluginType == nsPluginType_Flash &&
!GetPropW((HWND)window, L"PluginInstanceParentProperty")) {
HookSetWindowLongPtr();
}
#endif
return NS_OK;
}
#ifndef WINCE
nsresult nsPluginNativeWindowWin::SubclassAndAssociateWindow()
{
if (type != NPWindowTypeWindow || !window)
@ -774,7 +763,6 @@ nsresult nsPluginNativeWindowWin::UndoSubclassAndAssociateWindow()
return NS_OK;
}
#endif // WINCE
nsresult PLUG_NewPluginNativeWindow(nsPluginNativeWindow ** aPluginNativeWindow)
{

View File

@ -44,7 +44,7 @@
#include "nsIPrefService.h"
#include <prinrval.h>
#if defined(XP_WIN) && !defined(WINCE)
#if defined(XP_WIN)
#define CALL_SAFETY_ON
#endif

View File

@ -275,7 +275,6 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
PRBool protectCurrentDirectory = PR_TRUE;
#ifndef WINCE
nsAutoString pluginFolderPath;
plugin->GetPath(pluginFolderPath);
@ -298,7 +297,6 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
restoreOrigDir = SetCurrentDirectoryW(pluginFolderPath.get());
NS_ASSERTION(restoreOrigDir, "Error in Loading plugin");
}
#endif
if (protectCurrentDirectory) {
mozilla::NS_SetDllDirectory(NULL);
@ -312,12 +310,10 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
mozilla::NS_SetDllDirectory(L"");
}
#ifndef WINCE
if (restoreOrigDir) {
BOOL bCheck = SetCurrentDirectoryW(aOrigDir);
NS_ASSERTION(bCheck, "Error in Loading plugin");
}
#endif
return rv;
}
@ -347,12 +343,7 @@ nsresult nsPluginFile::GetPluginInfo(nsPluginInfo& info, PRLibrary **outLibrary)
if (NS_FAILED(rv = mPlugin->GetLeafName(fileName)))
return rv;
#ifdef WINCE
// WinCe takes a non const file path string, while desktop take a const
LPWSTR lpFilepath = const_cast<LPWSTR>(fullPath.get());
#else
LPCWSTR lpFilepath = fullPath.get();
#endif
versionsize = ::GetFileVersionInfoSizeW(lpFilepath, &zerome);