2006-05-09 Steve Falkenburg <sfalken@apple.com>
authorsfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 May 2006 21:54:53 +0000 (21:54 +0000)
committersfalken <sfalken@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 May 2006 21:54:53 +0000 (21:54 +0000)
        Fix Windows build.
        Add host calback so caller can determine success/failure of a page load.

        Reviewed by kevin.

        * WebCore.vcproj/WebCore/WebCore.vcproj: Fix paths, add missing files
        * loader/CachedResource.h: Fix include path.
        * loader/CachedResourceClientWalker.h: Fix include path.
        * platform/FontPlatformData.h: Fix include path.
        * platform/TransferJobClient.h: Make PlatformData, PlatformResponse an opaque struct.
        * platform/image-decoders/ImageDecoder.h: Fix include path.
        * platform/win/SharedTimerWin.cpp: Fix include path.
        * platform/win/TransferJobWin.cpp:
        (WebCore::TransferJobWndProc): Add host callback for success/failure of load.
        * platform/win/TransferJobWin.h: Added. Windows version of PlatformData/PlatformResponse.
        * xpath/impl/XPathFunctions.cpp: Work around missing math functions in MSVC.
        (round): Work around missing math functions in MSVC.
        * xpath/impl/XPathPredicate.cpp: Work around missing math functions in MSVC.
        * xpath/impl/XPathValue.cpp: Work around missing math functions in MSVC.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/loader/CachedResource.h
WebCore/loader/CachedResourceClientWalker.h
WebCore/platform/FontPlatformData.h
WebCore/platform/TransferJobClient.h
WebCore/platform/image-decoders/ImageDecoder.h
WebCore/platform/win/SharedTimerWin.cpp
WebCore/platform/win/TransferJobWin.cpp
WebCore/platform/win/TransferJobWin.h [new file with mode: 0644]
WebCore/xpath/impl/XPathFunctions.cpp
WebCore/xpath/impl/XPathPredicate.cpp
WebCore/xpath/impl/XPathValue.cpp

index d84165c..c5d5213 100644 (file)
@@ -1,3 +1,25 @@
+2006-05-09  Steve Falkenburg  <sfalken@apple.com>
+
+        Fix Windows build.
+        Add host calback so caller can determine success/failure of a page load.
+        
+        Reviewed by kevin.
+
+        * WebCore.vcproj/WebCore/WebCore.vcproj: Fix paths, add missing files
+        * loader/CachedResource.h: Fix include path.
+        * loader/CachedResourceClientWalker.h: Fix include path.
+        * platform/FontPlatformData.h: Fix include path.
+        * platform/TransferJobClient.h: Make PlatformData, PlatformResponse an opaque struct.
+        * platform/image-decoders/ImageDecoder.h: Fix include path.
+        * platform/win/SharedTimerWin.cpp: Fix include path.
+        * platform/win/TransferJobWin.cpp: 
+        (WebCore::TransferJobWndProc): Add host callback for success/failure of load.
+        * platform/win/TransferJobWin.h: Added. Windows version of PlatformData/PlatformResponse.
+        * xpath/impl/XPathFunctions.cpp: Work around missing math functions in MSVC.
+        (round): Work around missing math functions in MSVC.
+        * xpath/impl/XPathPredicate.cpp: Work around missing math functions in MSVC.
+        * xpath/impl/XPathValue.cpp: Work around missing math functions in MSVC.
+
 2006-05-09  David Hyatt  <hyatt@apple.com>
 
         Revert styleForElement, pseudoStyleForElement, styleForRenderer back to
index 84d9c4b..6d79d65 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\DerivedSources\WebCore\JSNodeFilter.cpp"\r
+                               RelativePath="..\..\DerivedSources\WebCore\JSNode.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\DerivedSources\WebCore\JSNode.cpp"\r
+                               RelativePath="..\..\DerivedSources\WebCore\JSNodeFilter.cpp"\r
                                >\r
                        </File>\r
                        <File\r
                                RelativePath="..\..\DerivedSources\WebCore\JSWheelEvent.cpp"\r
                                >\r
                        </File>\r
-                       <File\r
+      <File\r
                                RelativePath="..\..\DerivedSources\WebCore\JSXPathEvaluator.cpp"\r
                                >\r
-                       </File>\r
-                       <File\r
+      </File>\r
+      <File\r
+                               RelativePath="..\..\DerivedSources\WebCore\JSXPathExpression.cpp"\r
+                               >\r
+      </File>\r
+      <File\r
                                RelativePath="..\..\DerivedSources\WebCore\JSXPathNSResolver.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\platform\GraphicsTypes.h"\r
+                               RelativePath="..\..\platform\GraphicsTypes.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\platform\GraphicsTypes.cpp"\r
+                               RelativePath="..\..\platform\GraphicsTypes.h"\r
                                >\r
                        </File>\r
                        <File\r
                                        >\r
                                </File>\r
                                <File\r
+                                       RelativePath="..\..\platform\win\TransferJobWin.h"\r
+                                       >\r
+                               </File>\r
+                               <File\r
                                        RelativePath="..\..\platform\win\WidgetWin.cpp"\r
                                        >\r
                                </File>\r
                            Name="impl"\r
                        >\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathExpressionNode.cpp"\r
+                               RelativePath="..\..\xpath\impl\XPathExpressionNode.cpp"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathExpressionNode.h"\r
+                               RelativePath="..\..\xpath\impl\XPathExpressionNode.h"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathFunctions.cpp"\r
+                               RelativePath="..\..\xpath\impl\XPathFunctions.cpp"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathFunctions.h"\r
+                               RelativePath="..\..\xpath\impl\XPathFunctions.h"\r
                                >\r
                            </File>\r
                            <File\r
                                >\r
                        </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathParser.cpp"\r
+                               RelativePath="..\..\xpath\impl\XPathParser.cpp"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathParser.h"\r
+                               RelativePath="..\..\xpath\impl\XPathParser.h"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathPath.cpp"\r
+                               RelativePath="..\..\xpath\impl\XPathPath.cpp"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathPath.h"\r
+                               RelativePath="..\..\xpath\impl\XPathPath.h"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathStep.cpp"\r
+                               RelativePath="..\..\xpath\impl\XPathPredicate.cpp"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathStep.h"\r
+                               RelativePath="..\..\xpath\impl\XPathPredicate.h"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathUtil.cpp"\r
+                               RelativePath="..\..\xpath\impl\XPathStep.cpp"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathUtil.h"\r
+                               RelativePath="..\..\xpath\impl\XPathStep.h"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathValue.cpp"\r
+                               RelativePath="..\..\xpath\impl\XPathUtil.cpp"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathValue.h"\r
+                               RelativePath="..\..\xpath\impl\XPathUtil.h"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathVariableReference.cpp"\r
+                               RelativePath="..\..\xpath\impl\XPathValue.cpp"\r
                                >\r
                            </File>\r
                            <File\r
-                               RelativePath="\..\..\xpath\impl\XPathVariableReference.h"\r
+                               RelativePath="..\..\xpath\impl\XPathValue.h"\r
+                               >\r
+                           </File>\r
+                           <File\r
+                               RelativePath="..\..\xpath\impl\XPathVariableReference.cpp"\r
+                               >\r
+                           </File>\r
+                           <File\r
+                               RelativePath="..\..\xpath\impl\XPathVariableReference.h"\r
                                >\r
                            </File>                         \r
                        </Filter>\r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathEvaluator.cpp"\r
+                       RelativePath="..\..\xpath\XPathEvaluator.cpp"\r
                        >\r
                    </File>\r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathEvaluator.h"\r
+                       RelativePath="..\..\xpath\XPathEvaluator.h"\r
                        >\r
                    </File>\r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathExpression.cpp"\r
+                       RelativePath="..\..\xpath\XPathExpression.cpp"\r
                        >\r
                    </File>\r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathExpression.h"\r
+                       RelativePath="..\..\xpath\XPathExpression.h"\r
                        >\r
                    </File>                         \r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathNamespace.cpp"\r
+                       RelativePath="..\..\xpath\XPathNamespace.cpp"\r
                        >\r
                    </File>\r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathNamespace.h"\r
+                       RelativePath="..\..\xpath\XPathNamespace.h"\r
                        >\r
                    </File>                         \r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathNSResolver.cpp"\r
+                       RelativePath="..\..\xpath\XPathNSResolver.cpp"\r
                        >\r
                    </File>\r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathNSResolver.h"\r
+                       RelativePath="..\..\xpath\XPathNSResolver.h"\r
                        >\r
                    </File>                         \r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathResult.cpp"\r
+                       RelativePath="..\..\xpath\XPathResult.cpp"\r
                        >\r
                    </File>\r
                    <File\r
-                       RelativePath="\..\..\xpath\XPathResult.h"\r
+                       RelativePath="..\..\xpath\XPathResult.h"\r
                        >\r
                    </File>                         \r
                </Filter>               \r
                                Name="js"\r
                                >\r
                                <File\r
-                                       RelativePath="..\..\bindings\js\JSHTMLElementWrapperFactory.h"\r
+                                       RelativePath="..\..\bindings\js\JSCanvasRenderingContext2DBase.cpp"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\bindings\js\JSHTMLElementWrapperFactory.cpp"\r
+                                       RelativePath="..\..\bindings\js\JSCanvasRenderingContext2DBase.h"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\bindings\js\JSCanvasRenderingContext2DBase.cpp"\r
+                                       RelativePath="..\..\bindings\js\JSDOMParser.cpp"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\bindings\js\JSCanvasRenderingContext2DBase.h"\r
+                                       RelativePath="..\..\bindings\js\JSDOMParser.h"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\bindings\js\JSDOMParser.cpp"\r
+                                       RelativePath="..\..\bindings\js\JSHTMLElementWrapperFactory.cpp"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\..\bindings\js\JSDOMParser.h"\r
+                                       RelativePath="..\..\bindings\js\JSHTMLElementWrapperFactory.h"\r
                                        >\r
                                </File>\r
                                <File\r
index 2fa59aa..2f45ad3 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "PlatformString.h"
 #include "KWQKIOGlobal.h"
-#include <kxmlcore/HashSet.h>
+#include <wtf/HashSet.h>
 #include <time.h>
 
 #if __OBJC__
index d2b36ea..7c37843 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef KHTML_CachedObjectClientWalker_h
 #define KHTML_CachedObjectClientWalker_h
 
-#include <kxmlcore/HashSet.h>
+#include <wtf/HashSet.h>
 
 namespace WebCore {
 
index 367292a..d444716 100644 (file)
@@ -45,7 +45,7 @@ struct FontPlatformData {
 
 #else
 
-#include <kxmlcore/Noncopyable.h>
+#include <wtf/Noncopyable.h>
 
 #if WIN32
 typedef struct HFONT__ *HFONT;
index 81d1dab..717b779 100644 (file)
@@ -45,8 +45,8 @@ namespace WebCore {
     typedef NSURLResponse* PlatformResponse;
 #else
     // Not sure what the strategy for this will be on other platforms.
-    typedef void* PlatformData;
-    typedef void* PlatformResponse;
+    typedef struct PlatformDataStruct *PlatformData;
+    typedef struct PlatformResponseStruct *PlatformResponse;
 #endif
 
     class TransferJob;
index c4cb1f6..f1d0762 100644 (file)
@@ -29,7 +29,7 @@
 #include "config.h"
 #include "IntRect.h"
 #include "ImageSource.h"
-#include <kxmlcore/Vector.h>
+#include <wtf/Vector.h>
 #include "DeprecatedArray.h"
 
 namespace WebCore {
index c9a4de5..582394e 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "SystemTime.h"
 #include "Widget.h"
-#include <kxmlcore/Assertions.h>
+#include <wtf/Assertions.h>
 #include <windows.h>
 
 namespace WebCore {
index ec137d2..548c950 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "TransferJob.h"
 #include "TransferJobInternal.h"
+#include "TransferJobWin.h"
 
 #include "DocLoader.h"
 #include "Frame.h"
@@ -95,7 +96,7 @@ LRESULT CALLBACK TransferJobWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
                 delete job;
             }
         } else if (internetStatus == INTERNET_STATUS_REQUEST_COMPLETE) {
-            bool ok = false;
+            BOOL ok = FALSE;
 
             static const int bufferSize = 32768;
             char buffer[bufferSize];
@@ -109,16 +110,29 @@ LRESULT CALLBACK TransferJobWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
                 buffers.dwBufferLength = bufferSize;
             }
 
+            PlatformDataStruct platformData;
+            platformData.errorString = 0;
+            platformData.error = 0;
+            platformData.loaded = ok;
+
             if (!ok) {
                 int error = GetLastError();
                 if (error == ERROR_IO_PENDING)
                     return 0;
-                else
+                else {
+                    DWORD errorStringChars = 0;
+                    if (!InternetGetLastResponseInfo(&platformData.error, 0, &errorStringChars)) {
+                        if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+                            platformData.errorString = new TCHAR[errorStringChars];
+                            InternetGetLastResponseInfo(&platformData.error, platformData.errorString, &errorStringChars);
+                        }
+                    }
                     _RPTF1(_CRT_WARN, "Load error: %i\n", error);
+                }
             }
             
             InternetCloseHandle(job->d->m_resourceHandle);
-            job->client()->receivedAllData(job, 0);
+            job->client()->receivedAllData(job, &platformData);
             job->client()->receivedAllData(job);
             delete job;
         }
diff --git a/WebCore/platform/win/TransferJobWin.h b/WebCore/platform/win/TransferJobWin.h
new file mode 100644 (file)
index 0000000..62a8770
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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. 
+ */
+
+#ifndef TransferJobWin_H
+#define TransferJobWin_H
+
+#include <windows.h>
+
+namespace WebCore {
+
+struct PlatformDataStruct
+{
+    DWORD   error;
+    BOOL    loaded;
+    LPTSTR  errorString;
+};
+
+struct PlatformResponseStruct
+{
+};
+
+}
+
+#endif
index 4009a35..78f76eb 100644 (file)
 
 #include <math.h>
 
+#ifdef _MSC_VER // No round() in standard C library for Visual Studio
+static double round(double val)\r
+{\r
+    double valFloor = floor(val);\r
+    if (val >= 0)\r
+        return (val - valFloor < 0.5) ? valFloor : (valFloor+1.0);\r
+    else\r
+        return (val - valFloor <= 0.5) ? valFloor : (valFloor+1.0);\r
+}\r
+#endif\r
+
 namespace WebCore {
 namespace XPath {
         
index 09fb27b..5f55732 100644 (file)
 
 #include <math.h>
 
+#ifdef _MSC_VER // math functions missing from Microsoft Visual Studio standard C library
+#define remainder(x, y) fmod((x), (y))
+#endif
+
 namespace WebCore {
 namespace XPath {
         
index a0b3aaf..229fa09 100644 (file)
 #include "XPathValue.h"
 #include "Logging.h"
 
+#ifdef _MSC_VER // math functions missing from Microsoft Visual Studio standard C library
+#include <xmath.h>
+#define isnan(x) _isnan(x)
+#define isinf(x) !_finite(x)
+#define signbit(x) (_copysign(1.0, (x)) < 0)
+#endif
+
 namespace WebCore {
 namespace XPath {