Global replace of assert with ASSERT.
+2007-10-16 Adam Roben <aroben@apple.com>
+
+ Make testkjs not delay-load WebKit
+
+ Soon, delay-loading WebKit will be impossible (because we will be
+ using __declspec(thread) for thread-local storage). This change
+ prepares testkjs for the future.
+
+ Reviewed by Sam.
+
+ * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed WebKitInitializer,
+ added FindSafari.
+ * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Don't link against
+ WebKitInitializer, don't delay-load WebKit.
+ * kjs/testkjs.cpp: Don't use WebKitInitializer.
+
2007-10-16 Adam Roben <aroben@apple.com>
Updated testkjs for the rename of WebKit_debug.dll to WebKit.dll for the Debug configuration
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testkjs", "testkjs\testkjs.vcproj", "{C59E5129-B453-49B7-A52B-1E104715F76E}"\r
ProjectSection(ProjectDependencies) = postProject\r
{AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6}\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02} = {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}\r
{011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}\r
EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WTF", "WTF\WTF.vcproj", "{AA8A5A85-592B-4357-BC60-E0E91E026AF6}"\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitInitializer", "..\..\WebKitTools\WebKitInitializer\WebKitInitializer.vcproj", "{9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FindSafari", "..\..\WebKitTools\FindSafari\FindSafari.vcproj", "{DA31DA52-6675-48D4-89E0-333A7144397C}"\r
EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
{AA8A5A85-592B-4357-BC60-E0E91E026AF6}.Debug|Win32.Build.0 = Debug|Win32\r
{AA8A5A85-592B-4357-BC60-E0E91E026AF6}.Release|Win32.ActiveCfg = Release|Win32\r
{AA8A5A85-592B-4357-BC60-E0E91E026AF6}.Release|Win32.Build.0 = Release|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug_Internal|Win32.ActiveCfg = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug_Internal|Win32.Build.0 = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug|Win32.Build.0 = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Release|Win32.ActiveCfg = Release|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Release|Win32.Build.0 = Release|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug_Internal|Win32.ActiveCfg = Debug|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug_Internal|Win32.Build.0 = Debug|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug|Win32.Build.0 = Debug|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Release|Win32.ActiveCfg = Release|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Release|Win32.Build.0 = Release|Win32\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
<Tool\r
Name="VCLinkerTool"\r
LinkLibraryDependencies="false"\r
- AdditionalDependencies="JavaScriptCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitInitializer$(WebKitConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib"\r
+ AdditionalDependencies="JavaScriptCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).exe"\r
LinkIncremental="2"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib";..\..\..\icu\lib"\r
- DelayLoadDLLs="icuuc36$(LibraryConfigSuffix).dll;pthreadVC2$(LibraryConfigSuffix).dll;WebKit$(WebKitDLLConfigSuffix).dll"\r
+ DelayLoadDLLs="icuuc36$(LibraryConfigSuffix).dll;pthreadVC2$(LibraryConfigSuffix).dll"\r
GenerateDebugInformation="true"\r
SubSystem="1"\r
TargetMachine="1"\r
<Tool\r
Name="VCLinkerTool"\r
LinkLibraryDependencies="false"\r
- AdditionalDependencies="JavaScriptCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitInitializer$(WebKitConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib"\r
+ AdditionalDependencies="JavaScriptCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).exe"\r
LinkIncremental="1"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib";..\..\..\icu\lib"\r
- DelayLoadDLLs="icuuc36$(LibraryConfigSuffix).dll;pthreadVC2$(LibraryConfigSuffix).dll;WebKit$(WebKitDLLConfigSuffix).dll"\r
+ DelayLoadDLLs="icuuc36$(LibraryConfigSuffix).dll;pthreadVC2$(LibraryConfigSuffix).dll"\r
GenerateDebugInformation="true"\r
SubSystem="1"\r
OptimizeReferences="2"\r
<Tool\r
Name="VCLinkerTool"\r
LinkLibraryDependencies="false"\r
- AdditionalDependencies="JavaScriptCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitInitializer$(WebKitConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib"\r
+ AdditionalDependencies="JavaScriptCore$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib icuuc$(LibraryConfigSuffix).lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).exe"\r
LinkIncremental="2"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib";..\..\..\icu\lib"\r
- DelayLoadDLLs="icuuc36$(LibraryConfigSuffix).dll;pthreadVC2$(LibraryConfigSuffix).dll;WebKit$(WebKitDLLConfigSuffix).dll"\r
+ DelayLoadDLLs="icuuc36$(LibraryConfigSuffix).dll;pthreadVC2$(LibraryConfigSuffix).dll"\r
GenerateDebugInformation="true"\r
SubSystem="1"\r
TargetMachine="1"\r
#endif
#if PLATFORM(WIN)
-#include <WebKitInitializer/WebKitInitializer.h>
#include <crtdbg.h>
#include <windows.h>
#endif
int main(int argc, char** argv)
{
-#if PLATFORM(WIN)
- if (!initializeWebKit()) {
- fprintf(stderr, "Failed to initialize WebKit\n");
- abort();
- }
-#endif
#if defined(_DEBUG) && PLATFORM(WIN_OS)
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
+2007-10-16 Adam Roben <aroben@apple.com>
+
+ Remove WebKitInitializer
+
+ Reviewed by Sam.
+
+ * WebKit.vcproj/WebKit.sln:
+
2007-10-16 Adam Roben <aroben@apple.com>
Add FindSafari
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DumpRenderTree", "..\..\..\WebKitTools\DumpRenderTree\win\DumpRenderTree.vcproj", "{6567DFD4-D6DE-4CD5-825D-17E353D160E1}"\r
ProjectSection(ProjectDependencies) = postProject\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02} = {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}\r
{0662A8A9-82A3-4638-97D8-EC425D8D87C9} = {0662A8A9-82A3-4638-97D8-EC425D8D87C9}\r
EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testkjs", "..\..\..\JavaScriptCore\JavaScriptCore.vcproj\testkjs\testkjs.vcproj", "{C59E5129-B453-49B7-A52B-1E104715F76E}"\r
ProjectSection(ProjectDependencies) = postProject\r
{AA8A5A85-592B-4357-BC60-E0E91E026AF6} = {AA8A5A85-592B-4357-BC60-E0E91E026AF6}\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02} = {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}\r
{011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}\r
EndProjectSection\r
EndProject\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WTF", "..\..\..\JavaScriptCore\JavaScriptCore.vcproj\WTF\WTF.vcproj", "{AA8A5A85-592B-4357-BC60-E0E91E026AF6}"\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitInitializer", "..\..\..\WebKitTools\WebKitInitializer\WebKitInitializer.vcproj", "{9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}"\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FindSafari", "..\..\..\WebKitTools\FindSafari\FindSafari.vcproj", "{DA31DA52-6675-48D4-89E0-333A7144397C}"\r
EndProject\r
Global\r
{AA8A5A85-592B-4357-BC60-E0E91E026AF6}.Debug|Win32.Build.0 = Debug|Win32\r
{AA8A5A85-592B-4357-BC60-E0E91E026AF6}.Release|Win32.ActiveCfg = Release|Win32\r
{AA8A5A85-592B-4357-BC60-E0E91E026AF6}.Release|Win32.Build.0 = Release|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug|Win32.Build.0 = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Release|Win32.ActiveCfg = Release|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Release|Win32.Build.0 = Release|Win32\r
{DA31DA52-6675-48D4-89E0-333A7144397C}.Debug|Win32.ActiveCfg = Debug|Win32\r
{DA31DA52-6675-48D4-89E0-333A7144397C}.Debug|Win32.Build.0 = Debug|Win32\r
{DA31DA52-6675-48D4-89E0-333A7144397C}.Release|Win32.ActiveCfg = Release|Win32\r
number of tweaks, including fixing a potential bug where expectedDirectoryForTest
would take the type of results into account only some of the time.
+2007-10-16 Adam Roben <aroben@apple.com>
+
+ Replace WebKitInitializer with FindSafari
+
+ We now rely on setting the PATH environment variable to tell Windows
+ where to find WebKit and its dependencies (similar to
+ DYLD_FRAMEWORK_PATH on Mac).
+
+ This change also make DumpRenderTree no longer delay-load WebKit.
+
+ Reviewed by Sam.
+
+ * DumpRenderTree/DumpRenderTree.sln: Removed WebKitInitializer, added
+ FindSafari.
+ * DumpRenderTree/win/DumpRenderTree.cpp: Don't use WebKitInitializer.
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Don't link against
+ WebKitInitializer, don't delay-load WebKit.
+ * Scripts/run-javascriptcore-tests: Call setPathForRunningWebKitApp.
+ * Scripts/run-webkit-tests: Ditto.
+ * Scripts/webkitdirs.pm:
+ (sub setPathForRunningWebKitApp): Added.
+ * WebKitInitializer/WebKitInitializer.cpp: Removed.
+ * WebKitInitializer/WebKitInitializer.h: Removed.
+ * WebKitInitializer/WebKitInitializer.vcproj: Removed.
+ * WebKitInitializer/debug.vsprops: Removed.
+ * WebKitInitializer/debug_internal.vsprops: Removed.
+ * WebKitInitializer/release.vsprops: Removed.
+
2007-10-16 Adam Roben <aroben@apple.com>
Fix Bug 15532: run-safari fails if Safari is installed in a non-default location
Microsoft Visual Studio Solution File, Format Version 9.00\r
# Visual Studio 2005\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DumpRenderTree", "win\DumpRenderTree.vcproj", "{6567DFD4-D6DE-4CD5-825D-17E353D160E1}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02} = {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}\r
- EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestNetscapePlugin", "win\TestNetscapePlugin\TestNetscapePlugin.vcproj", "{C0737398-3565-439E-A2B8-AB2BE4D5430C}"\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitInitializer", "..\WebKitInitializer\WebKitInitializer.vcproj", "{9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FindSafari", "..\FindSafari\FindSafari.vcproj", "{DA31DA52-6675-48D4-89E0-333A7144397C}"\r
EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
{C0737398-3565-439E-A2B8-AB2BE4D5430C}.Debug|Win32.Build.0 = Debug|Win32\r
{C0737398-3565-439E-A2B8-AB2BE4D5430C}.Release|Win32.ActiveCfg = Release|Win32\r
{C0737398-3565-439E-A2B8-AB2BE4D5430C}.Release|Win32.Build.0 = Release|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug_Internal|Win32.ActiveCfg = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug_Internal|Win32.Build.0 = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Debug|Win32.Build.0 = Debug|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Release|Win32.ActiveCfg = Release|Win32\r
- {9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}.Release|Win32.Build.0 = Release|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug_Internal|Win32.ActiveCfg = Debug|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug_Internal|Win32.Build.0 = Debug|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug|Win32.ActiveCfg = Debug|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug|Win32.Build.0 = Debug|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Release|Win32.ActiveCfg = Release|Win32\r
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Release|Win32.Build.0 = Release|Win32\r
EndGlobalSection\r
GlobalSection(SolutionProperties) = preSolution\r
HideSolutionNode = FALSE\r
#include <pthread.h>
#include <string>
#include <tchar.h>
-#include <WebKitInitializer/WebKitInitializer.h>
#include <WebKit/DOMPrivate.h>
#include <WebKit/IWebFramePrivate.h>
#include <WebKit/IWebHistoryItem.h>
static wstring initialize(HMODULE hModule)
{
- if (!initializeWebKit()) {
- fprintf(stderr, "WebKit failed to initialize\n");
- abort();
- }
-
static LPCTSTR fontsToInstall[] = {
TEXT("AHEM____.ttf"),
TEXT("Apple Chancery.ttf"),
/>\r
<Tool\r
Name="VCLinkerTool"\r
- AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitInitializer$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib"\r
+ AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).exe"\r
LinkIncremental="2"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib";"$(WebKitOutputDir)\bin""\r
/>\r
<Tool\r
Name="VCLinkerTool"\r
- AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitInitializer$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib"\r
+ AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).exe"\r
LinkIncremental="1"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib";"$(WebKitOutputDir)\bin""\r
/>\r
<Tool\r
Name="VCLinkerTool"\r
- AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib WebKitInitializer$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib"\r
+ AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib"\r
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).exe"\r
LinkIncremental="2"\r
AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib";"$(WebKitOutputDir)\bin""\r
$productDir .= "/JavaScriptCore" if (isQt() or isGtk());
$ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+setPathForRunningWebKitApp(\%ENV) if isCygwin();
my $testkjsName;
sub determineTestkjsName
if (isCygwin()) {
$ENV{HOMEDRIVE} = $homeDrive;
$ENV{HOMEPATH} = $homePath;
+ setPathForRunningWebKitApp(\%ENV) if isCygwin();
}
my @args = ();
return buildQMakeProject(@buildArgs);
}
+sub setPathForRunningWebKitApp
+{
+ my ($env) = @_;
+
+ return unless isCygwin();
+
+ $env->{PATH} = join(':', productDir(), dirname(installedSafariPath()), $env->{PATH} || "");
+}
+
1;
+++ /dev/null
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "WebKitInitializer.h"
-
-// Needed to get SetDllDirectory.
-#define _WIN32_WINNT 0x0502
-
-#include <shlwapi.h>
-#include <tchar.h>
-#include <windows.h>
-
-#define LOG(header, ...) \
- do { \
- _ftprintf(stderr, header); \
- _ftprintf(stderr, __VA_ARGS__); \
- } while (0)
-#define LOG_WARNING(...) LOG(TEXT("WARNING: "), __VA_ARGS__)
-#define LOG_ERROR(...) LOG(TEXT("ERROR: "), __VA_ARGS__)
-
-#define DEBUGDLLSUFFIX TEXT("_debug")
-#define RELEASEDLLSUFFIX
-
-#define EITHERDLL(name, suffix) (TEXT( #name ) suffix TEXT(".dll"))
-#define RELEASEDLL(name) EITHERDLL(name, RELEASEDLLSUFFIX)
-#define DEBUGDLL(name) EITHERDLL(name, DEBUGDLLSUFFIX)
-
-#ifdef USE_DEBUG_SUPPORT_LIBS
-#define DLL(name) DEBUGDLL(name)
-#else
-#define DLL(name) RELEASEDLL(name)
-#endif
-
-#ifdef DEBUG_WEBKIT_HAS_SUFFIX
-#define WEBKITDLL DEBUGDLL(WebKit)
-#else
-#define WEBKITDLL RELEASEDLL(WebKit)
-#endif
-
-static TCHAR* getStringValue(HKEY key, LPCTSTR valueName)
-{
- DWORD type = 0;
- DWORD bufferSize = 0;
- if (RegQueryValueEx(key, valueName, 0, &type, 0, &bufferSize) != ERROR_SUCCESS || type != REG_SZ)
- return 0;
-
- TCHAR* buffer = (TCHAR*)malloc(bufferSize);
- if (RegQueryValueEx(key, 0, 0, &type, reinterpret_cast<LPBYTE>(buffer), &bufferSize) != ERROR_SUCCESS) {
- free(buffer);
- return 0;
- }
-
- return buffer;
-}
-
-static LPOLESTR getWebViewCLSID()
-{
- // FIXME <rdar://5505062>: Once WebKit switches to truly version-independent
- // ProgIDs, this should just become "WebKit.WebView".
- LPCTSTR webViewProgID = TEXT("WebKit.WebView.3");
-
- CLSID clsid = CLSID_NULL;
- HRESULT hr = CLSIDFromProgID(webViewProgID, &clsid);
- if (FAILED(hr)) {
- LOG_WARNING(TEXT("Failed to get CLSID for %s\n"), webViewProgID);
- return 0;
- }
-
- LPOLESTR clsidString = 0;
- if (FAILED(StringFromCLSID(clsid, &clsidString))) {
- LOG_WARNING(TEXT("Failed to get string representation of CLSID for WebView\n"));
- return 0;
- }
-
- return clsidString;
-}
-
-static TCHAR* getInstalledWebKitDirectory()
-{
- LPCTSTR keyPrefix = TEXT("SOFTWARE\\Classes\\CLSID\\");
- LPCTSTR keySuffix = TEXT("\\InprocServer32");
-
- LPOLESTR clsid = getWebViewCLSID();
- if (!clsid)
- return 0;
-
- size_t keyBufferLength = _tcslen(keyPrefix) + _tcslen(clsid) + _tcslen(keySuffix) + 1;
- TCHAR* keyString = (TCHAR*)malloc(keyBufferLength * sizeof(TCHAR));
-
- int ret = _sntprintf_s(keyString, keyBufferLength, keyBufferLength - 1, TEXT("%s%s%s"), keyPrefix, clsid, keySuffix);
- CoTaskMemFree(clsid);
- if (ret == -1) {
- LOG_WARNING(TEXT("Failed to construct InprocServer32 key\n"));
- return 0;
- }
-
- HKEY serverKey = 0;
- LONG error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyString, 0, KEY_READ, &serverKey);
- free(keyString);
- if (error != ERROR_SUCCESS) {
- LOG_WARNING(TEXT("Failed to open registry key %s\n"), keyString);
- return 0;
- }
-
- TCHAR* webKitPath = getStringValue(serverKey, 0);
- RegCloseKey(serverKey);
- if (!webKitPath) {
- LOG_WARNING(TEXT("Couldn't retrieve value for registry key %s\n"), keyString);
- return 0;
- }
-
- TCHAR* startOfFileName = PathFindFileName(webKitPath);
- if (startOfFileName == webKitPath) {
- LOG_WARNING(TEXT("Couldn't find filename from path %s\n"), webKitPath);
- free(webKitPath);
- return 0;
- }
-
- *startOfFileName = '\0';
- return webKitPath;
-}
-
-bool initializeWebKit()
-{
- static bool haveInitialized;
- static bool success;
- if (haveInitialized)
- return success;
-
- haveInitialized = true;
-
- if (TCHAR* directory = getInstalledWebKitDirectory()) {
- SetDllDirectory(directory);
- free(directory);
- } else
- LOG_WARNING(TEXT("Couldn't determine installed WebKit directory\n"));
-
- LPCTSTR webKitDependencies[] = {
- DLL(CFNetwork),
- DLL(CoreFoundation),
- DLL(CoreGraphics),
- DLL(SQLite3),
- DLL(SafariTheme),
- RELEASEDLL(icudt36),
- DLL(icuin36),
- DLL(icuuc36),
- DLL(libxml2),
- DLL(libxslt),
- DLL(pthreadVC2),
- DLL(zlib1),
- };
-
- for (int i = 0; i < ARRAYSIZE(webKitDependencies); ++i)
- if (!LoadLibrary(webKitDependencies[i])) {
- LOG_ERROR(TEXT("LoadLibrary(%s) failed\n"), webKitDependencies[i]);
- return false;
- }
-
- HMODULE webKitModule = LoadLibrary(WEBKITDLL);
- if (!webKitModule) {
- LOG_ERROR(TEXT("LoadLibrary(%s) failed\n"), DLL(WebKit));
- return false;
- }
-
- FARPROC dllRegisterServer = GetProcAddress(webKitModule, "DllRegisterServer");
- if (!dllRegisterServer) {
- LOG_ERROR(TEXT("GetProcAddress(webKitModule, \"DllRegisterServer\") failed\n"));
- return false;
- }
-
- dllRegisterServer();
-
- success = true;
- return success;
-}
+++ /dev/null
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-bool initializeWebKit();
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
- ProjectType="Visual C++"\r
- Version="8.00"\r
- Name="WebKitInitializer"\r
- ProjectGUID="{9E96B9B5-0CCB-47F8-A95E-C25ABE049E02}"\r
- RootNamespace="WebKitInitializer"\r
- >\r
- <Platforms>\r
- <Platform\r
- Name="Win32"\r
- />\r
- </Platforms>\r
- <ToolFiles>\r
- </ToolFiles>\r
- <Configurations>\r
- <Configuration\r
- Name="Debug|Win32"\r
- OutputDirectory="$(WebKitOutputDir)\lib"\r
- IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"\r
- ConfigurationType="4"\r
- InheritedPropertySheets=".\debug.vsprops"\r
- CharacterSet="1"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- Optimization="0"\r
- PreprocessorDefinitions="DEBUG"\r
- MinimalRebuild="true"\r
- BasicRuntimeChecks="3"\r
- RuntimeLibrary="3"\r
- WarningLevel="4"\r
- WarnAsError="true"\r
- Detect64BitPortabilityProblems="true"\r
- DebugInformationFormat="4"\r
- DisableSpecificWarnings="4127"\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLibrarianTool"\r
- AdditionalDependencies="shlwapi.lib advapi32.lib ole32.lib"\r
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).lib"\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\include\WebKitInitializer"
xcopy /y /d "$(InputDir)*.h" "$(WebKitOutputDir)\include\WebKitInitializer"
"\r
- />\r
- </Configuration>\r
- <Configuration\r
- Name="Release|Win32"\r
- OutputDirectory="$(WebKitOutputDir)\lib"\r
- IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"\r
- ConfigurationType="4"\r
- InheritedPropertySheets=".\release.vsprops"\r
- CharacterSet="1"\r
- WholeProgramOptimization="1"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- PreprocessorDefinitions="NDEBUG"\r
- RuntimeLibrary="2"\r
- WarningLevel="4"\r
- WarnAsError="true"\r
- Detect64BitPortabilityProblems="true"\r
- DebugInformationFormat="3"\r
- DisableSpecificWarnings="4127"\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLibrarianTool"\r
- AdditionalDependencies="shlwapi.lib advapi32.lib ole32.lib"\r
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).lib"\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\include\WebKitInitializer"
xcopy /y /d "$(InputDir)*.h" "$(WebKitOutputDir)\include\WebKitInitializer"
"\r
- />\r
- </Configuration>\r
- <Configuration\r
- Name="Debug_Internal|Win32"\r
- OutputDirectory="$(WebKitOutputDir)\lib"\r
- IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"\r
- ConfigurationType="4"\r
- InheritedPropertySheets=".\debug_internal.vsprops"\r
- CharacterSet="1"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- Optimization="0"\r
- PreprocessorDefinitions="DEBUG"\r
- MinimalRebuild="true"\r
- BasicRuntimeChecks="3"\r
- RuntimeLibrary="3"\r
- WarningLevel="4"\r
- WarnAsError="true"\r
- Detect64BitPortabilityProblems="true"\r
- DebugInformationFormat="4"\r
- DisableSpecificWarnings="4127"\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLibrarianTool"\r
- AdditionalDependencies="shlwapi.lib advapi32.lib ole32.lib"\r
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).lib"\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\include\WebKitInitializer"
xcopy /y /d "$(InputDir)*.h" "$(WebKitOutputDir)\include\WebKitInitializer"
"\r
- />\r
- </Configuration>\r
- </Configurations>\r
- <References>\r
- </References>\r
- <Files>\r
- <Filter\r
- Name="Source Files"\r
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
- >\r
- <File\r
- RelativePath=".\WebKitInitializer.cpp"\r
- >\r
- </File>\r
- </Filter>\r
- <Filter\r
- Name="Header Files"\r
- Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
- >\r
- <File\r
- RelativePath=".\WebKitInitializer.h"\r
- >\r
- </File>\r
- </Filter>\r
- <Filter\r
- Name="Resource Files"\r
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
- >\r
- </Filter>\r
- </Files>\r
- <Globals>\r
- </Globals>\r
-</VisualStudioProject>\r
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioPropertySheet
- ProjectType="Visual C++"
- Version="8.00"
- Name="debug"
- >
- <UserMacro
- Name="WebKitConfigSuffix"
- Value="_debug"
- />
-</VisualStudioPropertySheet>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioPropertySheet
- ProjectType="Visual C++"
- Version="8.00"
- Name="debug_internal"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions="USE_DEBUG_SUPPORT_LIBS;DEBUG_WEBKIT_HAS_SUFFIX"
- />
- <UserMacro
- Name="WebKitConfigSuffix"
- Value="_debug"
- />
-</VisualStudioPropertySheet>
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioPropertySheet
- ProjectType="Visual C++"
- Version="8.00"
- Name="release"
- >
- <UserMacro
- Name="WebKitConfigSuffix"
- Value=""
- />
-</VisualStudioPropertySheet>