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

        Reviewed by kevin.

        * WebFramePrivate.cpp:
        (WebKit::WebFramePrivate::loadFilePath): Style fix.
        (WebKit::WebFramePrivate::loadHTMLString): Style fix.
        (WebKit::WebFramePrivate::receivedAllData): Call host->loadEnd() with data indicating success/failure of load.
        * WebKitWin.vcproj/WebKitWin/WebKitWin.vcproj: Fix include paths.
        * WebView.cpp:
        (WebKit::WebView::WebView): Don't load boilerplate test HTML from core code.
        * public/WebHost.h: Add host callback for loadEnd().

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

WebKitWin/ChangeLog
WebKitWin/WebFramePrivate.cpp
WebKitWin/WebKitWin.vcproj/WebKitWin/WebKitWin.vcproj
WebKitWin/WebView.cpp
WebKitWin/public/WebHost.h

index f547f56f54462958f2349df821f95d1e0dd3912a..2dda2d6727fabca470a091c19389c6f57f4af9ce 100644 (file)
@@ -1,3 +1,18 @@
+2006-05-09  Steve Falkenburg  <sfalken@apple.com>
+
+        Add host calback so caller can determine success/failure of a page load.
+        
+        Reviewed by kevin.
+
+        * WebFramePrivate.cpp:
+        (WebKit::WebFramePrivate::loadFilePath): Style fix.
+        (WebKit::WebFramePrivate::loadHTMLString): Style fix.
+        (WebKit::WebFramePrivate::receivedAllData): Call host->loadEnd() with data indicating success/failure of load.
+        * WebKitWin.vcproj/WebKitWin/WebKitWin.vcproj: Fix include paths.
+        * WebView.cpp: 
+        (WebKit::WebView::WebView): Don't load boilerplate test HTML from core code. 
+        * public/WebHost.h: Add host callback for loadEnd().
+
 2006-05-02  Darin Adler  <darin@apple.com>
 
         * ChangeLog: Added.
index a2e7b953cececd242d1b68bdff80649c8ae31718..f12aef277f2e1ac46ea48aceadeda7aa041459ef 100644 (file)
@@ -40,6 +40,7 @@
 #include "cairo.h"
 #include "cairo-win32.h"
 #include "TransferJob.h"
+#include "TransferJobWin.h"
 
 #include <io.h>
 #include <fcntl.h>
@@ -92,7 +93,7 @@ void WebFramePrivate::loadFilePath(char* path)
 
     d->frame->didOpenURL(URL);
     d->frame->begin(URL);
-    HANDLE fileHandle = CreateFileA(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+    HANDLE fileHandle = CreateFileA(path, GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
      
     bool result = false;
     DWORD bytesRead = 0;
@@ -100,7 +101,7 @@ void WebFramePrivate::loadFilePath(char* path)
     do {
       const int bufferSize = 8193;
       char buffer[bufferSize];
-      result = ReadFile(fileHandle, &buffer, bufferSize - 1, &bytesRead, NULL); 
+      result = ReadFile(fileHandle, &buffer, bufferSize - 1, &bytesRead, 0); 
       buffer[bytesRead] = '\0';
       d->frame->write(buffer);
       // Check for end of file. 
@@ -111,7 +112,7 @@ void WebFramePrivate::loadFilePath(char* path)
     d->frame->end();
 }
 
-void WebFramePrivate::loadHTMLString(char *html, char *baseURL)
+void WebFramePrivate::loadHTMLString(char* html, char* baseURL)
 {
     d->frame->begin();
     d->frame->write(html);
@@ -176,8 +177,11 @@ void WebFramePrivate::receivedData(WebCore::TransferJob*, const char* data, int
     d->frame->write(data, length);
 }
 
-void WebFramePrivate::receivedAllData(WebCore::TransferJob* job, WebCore::PlatformData)
+void WebFramePrivate::receivedAllData(WebCore::TransferJob* job, WebCore::PlatformData data)
 {
+    if (d->m_host)
+        (d->m_host->loadEnd)(data->loaded, data->error, data->errorString);
+
     d->frame->end();
 }
 
index 705922e9c7ca4dbd190187f02b4c9c496ef5a5d2..6f7859a2321214559e26bb4c74db527bdfbf93ef 100644 (file)
@@ -40,7 +40,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\..\WebCore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\loader&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\ecma&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\html&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\css&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\misc&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\page&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\rendering&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\editing&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\xml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\kwq&quot;;&quot;$(ProjectDir)\..\..\..\iconv&quot;;&quot;$(ProjectDir)\..\..\..\libxml2&quot;;&quot;$(ProjectDir)\..\..\..\icu\include&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\os-win32&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\kxmlcore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)\..\..\public&quot;"\r
+                               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\..\WebCore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\loader&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\ecma&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\html&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\css&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\misc&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\page&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\rendering&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\editing&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\xml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\kwq&quot;;&quot;$(ProjectDir)\..\..\..\iconv&quot;;&quot;$(ProjectDir)\..\..\..\libxml2&quot;;&quot;$(ProjectDir)\..\..\..\icu\include&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\os-win32&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)\..\..\public&quot;"\r
                                PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"\r
                                MinimalRebuild="true"\r
                                ExceptionHandling="0"\r
@@ -80,7 +80,7 @@
                        />\r
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
-                               CommandLine="xcopy /y /r /i &quot;$(ProjectDir)\..\..\public&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WebKitWin&quot;"\r
+                               CommandLine="xcopy /y /r /i &quot;$(ProjectDir)\..\..\public&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WebKitWin&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\Vector.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\Assertions.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\VectorTraits.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\RefPtr.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\Platform.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\FastMalloc.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;"\r
                        />\r
                </Configuration>\r
                <Configuration\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\..\WebCore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\loader&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\ecma&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\html&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\css&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\misc&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\page&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\rendering&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\editing&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\xml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\kwq&quot;;&quot;$(ProjectDir)\..\..\..\iconv&quot;;&quot;$(ProjectDir)\..\..\..\libxml2&quot;;&quot;$(ProjectDir)\..\..\..\icu\include&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\os-win32&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\kxmlcore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)\..\..\public&quot;"\r
+                               AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\..\WebCore&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\loader&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\ecma&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\html&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\css&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\khtml\misc&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\page&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\bridge&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\cairo\cairo\src&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\platform\win&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\rendering&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\editing&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\dom&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\xml&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\kwq&quot;;&quot;$(ProjectDir)\..\..\..\iconv&quot;;&quot;$(ProjectDir)\..\..\..\libxml2&quot;;&quot;$(ProjectDir)\..\..\..\icu\include&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\os-win32&quot;;&quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf&quot;;&quot;$(ProjectDir)\..\..\..\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)\..\..\public&quot;"\r
                                PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"\r
                                ExceptionHandling="0"\r
                                RuntimeLibrary="2"\r
                        />\r
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
-                               CommandLine="xcopy /y /r /i &quot;$(ProjectDir)\..\..\public&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WebKitWin&quot;"\r
+                               CommandLine="xcopy /y /r /i &quot;$(ProjectDir)\..\..\public&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WebKitWin&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\Vector.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\Assertions.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\VectorTraits.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\RefPtr.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\Platform.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;xcopy /y &quot;$(ProjectDir)\..\..\..\JavaScriptCore\wtf\FastMalloc.h&quot; &quot;$(WebKitOutputDir)\$(ConfigurationName)\WTF&quot;&#x0D;&#x0A;"\r
                        />\r
                </Configuration>\r
        </Configurations>\r
index 6aafa79692da861a7eaf8036314ebe2f0ada7a13..b4ae84d28d114aecd33f0235b62aba613f0f832b 100644 (file)
@@ -108,7 +108,6 @@ WebView::WebView(HWND hWnd, WebHost* host)
     d = new WebViewPrivate();
     d->windowHandle = hWnd;
     d->mainFrame = WebFrame::createWebFrame("dummy", this, host);
-    d->mainFrame->loadHTMLString("<p style=\"background-color: #00FF00\">Testing</p><img src=\"http://webkit.opendarwin.org/images/icon-gold.png\" alt=\"Face\"><div style=\"border: solid blue\" contenteditable=\"true\">div with blue border</div><ul><li>foo<li>bar<li>baz</ul>");
 }
 
 WebView::~WebView()
index ee7dd0d4142e20a8fc8e155b4f29df8594c20d0e..316e52ed8645a156c8537c1bc712168ce2c29d89 100644 (file)
@@ -32,6 +32,7 @@ class WebHost
 {
 public:
     virtual void updateLocationBar(const char* URL) = 0;
+    virtual void loadEnd(BOOL successful, DWORD error, LPCTSTR errorString) = 0;
 };
 
 }