Merge mozilla-central to mozilla-inbound

This commit is contained in:
Ed Morley 2012-10-19 15:24:43 +01:00
commit b9b019f736
8 changed files with 89 additions and 6 deletions

View File

@ -202,12 +202,6 @@
fun:_ZN22nsComponentManagerImpl17ManifestComponentERNS_25ManifestProcessingContextEiPKPc
...
}
{
Bug 799157
Memcheck:Cond
fun:_ZN2js3ion5Range6updateEPKS1_
...
}
{
Bug 803386
Memcheck:Free

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<script>
document.createElement('canvas').toBlob(null);
</script>

View File

@ -15,3 +15,4 @@ load 743499-negative-size.html
load 767337-1.html
load 780392-1.html
load 794463-1.html
load 802926-1.html

View File

@ -588,6 +588,10 @@ nsHTMLCanvasElement::ToBlob(nsIFileCallback* aCallback,
return NS_ERROR_DOM_SECURITY_ERR;
}
if (!aCallback) {
return NS_ERROR_UNEXPECTED;
}
nsAutoString type;
nsresult rv = nsContentUtils::ASCIIToLower(aType, type);
if (NS_FAILED(rv)) {

View File

@ -134,12 +134,86 @@ static inline bool IsItWindowsNT()
}
#endif
// Delayed load libraries are loaded when the first symbol is used.
// The following ensures that we load the delayed loaded libraries from the
// system directory.
struct AutoLoadSystemDependencies
{
AutoLoadSystemDependencies()
{
static LPCWSTR delayDLLs[] = { L"dwmapi.dll" };
WCHAR systemDirectory[MAX_PATH + 1] = { L'\0' };
// If GetSystemDirectory fails we accept that we'll load the DLLs from the
// normal search path.
GetSystemDirectoryW(systemDirectory, MAX_PATH + 1);
size_t systemDirLen = wcslen(systemDirectory);
// Make the system directory path terminate with a slash
if (systemDirectory[systemDirLen - 1] != L'\\' && systemDirLen) {
systemDirectory[systemDirLen] = L'\\';
++systemDirLen;
// No need to re-NULL terminate
}
// For each known DLL ensure it is loaded from the system32 directory
for (size_t i = 0; i < sizeof(delayDLLs) / sizeof(delayDLLs[0]); ++i) {
size_t fileLen = wcslen(delayDLLs[i]);
wcsncpy(systemDirectory + systemDirLen, delayDLLs[i],
MAX_PATH - systemDirLen);
if (systemDirLen + fileLen <= MAX_PATH) {
systemDirectory[systemDirLen + fileLen] = L'\0';
} else {
systemDirectory[MAX_PATH] = L'\0';
}
LPCWSTR fullModulePath = systemDirectory; // just for code readability
LoadLibraryW(fullModulePath);
}
}
} loadDLLs;
BOOL
RemoveCurrentDirFromSearchPath()
{
// kernel32.dll is in the knownDLL list so it is safe to load without a full path
HMODULE kernel32 = LoadLibraryW(L"kernel32.dll");
if (!kernel32) {
return FALSE;
}
typedef BOOL (WINAPI *SetDllDirectoryType)(LPCWSTR);
SetDllDirectoryType SetDllDirectoryFn =
(SetDllDirectoryType)GetProcAddress(kernel32, "SetDllDirectoryW");
if (!SetDllDirectoryFn) {
FreeLibrary(kernel32);
return FALSE;
}
// If this call fails we can't do much about it, so ignore it.
// It is unlikely to fail and this is just a precaution anyway.
SetDllDirectoryFn(L"");
FreeLibrary(kernel32);
return TRUE;
}
int APIENTRY WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// Disable current directory from being in the search path.
// This call does not help with implicitly loaded DLLs.
if (!RemoveCurrentDirFromSearchPath()) {
WCHAR minOSTitle[512] = { '\0' };
WCHAR minOSText[512] = { '\0' };
LoadStringW(NULL, IDS_MIN_OS_TITLE, minOSTitle,
sizeof(minOSTitle) / sizeof(minOSTitle[0]));
LoadStringW(NULL, IDS_MIN_OS_TEXT, minOSText,
sizeof(minOSText) / sizeof(minOSText[0]));
MessageBoxW(NULL, minOSText, minOSTitle, MB_OK | MB_ICONERROR);
return 1;
}
g_hInstance = (HINSTANCE)hInstance;
#ifndef _UNICODE
g_IsNT = IsItWindowsNT();

View File

@ -4,3 +4,5 @@
#define IDS_EXTRACTION_ERROR_MESSAGE 8
#define IDS_CANNOT_CREATE_FOLDER 9
#define IDS_PROGRESS_EXTRACTING 69
#define IDS_MIN_OS_TITLE 70
#define IDS_MIN_OS_TEXT 71

View File

@ -11,6 +11,8 @@ BEGIN
IDS_EXTRACTION_ERROR_MESSAGE "File is corrupt"
IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'"
IDS_PROGRESS_EXTRACTING "Extracting"
IDS_MIN_OS_TITLE "Setup Error"
IDS_MIN_OS_TEXT "Microsoft Windows XP SP2 or newer is required."
END
#include "../../FileManager/Resource/ProgressDialog/resource.rc"