Reviewed by Eric.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Mar 2006 11:59:43 +0000 (11:59 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Mar 2006 11:59:43 +0000 (11:59 +0000)
        - load URLs, not file paths, in Spinneret

        * Spinneret/Spinneret/Spinneret.cpp:
        (MyEditProc):
        * Spinneret/Spinneret/Spinneret.vcproj:
        * Spinneret/Spinneret/WebFrame.cpp:
        (WebKit::WebFrame::loadURL):
        (WebKit::WebFrame::receivedData):
        (WebKit::WebFrame::receivedAllData):
        * Spinneret/Spinneret/WebFrame.h:
        * Spinneret/Spinneret/WebView.cpp:
        (WebKit::WebView::WebView):

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

WebKitTools/ChangeLog
WebKitTools/Spinneret/Spinneret/Spinneret.cpp
WebKitTools/Spinneret/Spinneret/Spinneret.vcproj
WebKitTools/Spinneret/Spinneret/WebFrame.cpp
WebKitTools/Spinneret/Spinneret/WebFrame.h
WebKitTools/Spinneret/Spinneret/WebView.cpp

index 351e0cc411d89b9d38dbc4b13f7f4dad9f80af78..5c868bcb7ca2346d08fc563b6b5d77da50f4ef9f 100644 (file)
@@ -1,3 +1,20 @@
+2006-03-08  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Eric.
+
+        - load URLs, not file paths, in Spinneret
+
+        * Spinneret/Spinneret/Spinneret.cpp:
+        (MyEditProc):
+        * Spinneret/Spinneret/Spinneret.vcproj:
+        * Spinneret/Spinneret/WebFrame.cpp:
+        (WebKit::WebFrame::loadURL):
+        (WebKit::WebFrame::receivedData):
+        (WebKit::WebFrame::receivedAllData):
+        * Spinneret/Spinneret/WebFrame.h:
+        * Spinneret/Spinneret/WebView.cpp:
+        (WebKit::WebView::WebView):
+
 2006-03-08  Darin Adler  <darin@apple.com>
 
         Reviewed by Eric.
index ca62a11c0390d3c0043f3bd42c3f09674ba0df0f..0f5f1db3f88e729ad5c4877b1e816d1febcb145e 100755 (executable)
@@ -209,7 +209,7 @@ LRESULT CALLBACK MyEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPara
                     cstrPtr[x] = strPtr[x];
                 cstrPtr[x] = 0;
 
-                gWebView->mainFrame()->loadFilePath(cstrPtr);
+                gWebView->mainFrame()->loadURL(cstrPtr);
 
                 return 0;
             } else
index 7ac2509249eaf854bc83bda53b303c253cc238ce..1746d8469bc428d2ce56a42dcae137735a1617c4 100755 (executable)
@@ -61,7 +61,7 @@
                        />\r
                        <Tool\r
                                Name="VCLinkerTool"\r
-                               AdditionalOptions="&quot;$(WebKitOutputDir)\WebCore.intermediate\$(ConfigurationName)\WebCore.intermediate\WebCore.lib&quot;&#x0D;&#x0A;&quot;$(WebKitOutputDir)\JavaScriptCore.intermediate\$(ConfigurationName)\JavaScriptCore.intermediate\JavaScriptCore.lib&quot;&#x0D;&#x0A;&quot;$(SolutionDir)\..\..\iconv\lib\iconv.lib&quot;&#x0D;&#x0A;&quot;$(SolutionDir)\..\..\libxml\lib\libxml2.lib&quot;&#x0D;&#x0A;&quot;$(SolutionDir)\..\..\libxslt\lib\libxslt.lib&quot;&#x0D;&#x0A;&quot;$(SolutionDir)\..\..\icu\lib\icuuc.lib&quot;&#x0D;&#x0A;comctl32.lib"\r
+                               AdditionalOptions="&quot;$(WebKitOutputDir)\WebCore.intermediate\$(ConfigurationName)\WebCore.intermediate\WebCore.lib&quot;&#x0D;&#x0A;&quot;$(WebKitOutputDir)\JavaScriptCore.intermediate\$(ConfigurationName)\JavaScriptCore.intermediate\JavaScriptCore.lib&quot;&#x0D;&#x0A;&quot;$(SolutionDir)\..\..\iconv\lib\iconv.lib&quot;&#x0D;&#x0A;&quot;$(SolutionDir)\..\..\libxml\lib\libxml2.lib&quot;&#x0D;&#x0A;&quot;$(SolutionDir)\..\..\libxslt\lib\libxslt.lib&quot;&#x0D;&#x0A;&quot;$(SolutionDir)\..\..\icu\lib\icuuc.lib&quot;&#x0D;&#x0A;comctl32.lib&#x0D;&#x0A;wininet.lib"\r
                                LinkIncremental="2"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
index 3d39d7beb41be381535ac90b22a41266b9a534f7..f568066be828eb7b675a94de7d2cfccb08ac44ce 100755 (executable)
@@ -36,6 +36,7 @@
 #include "render_frames.h"
 #include "cairo.h"
 #include "cairo-win32.h"
+#include "TransferJob.h"
 
 #include <io.h>
 #include <fcntl.h>
@@ -100,6 +101,25 @@ void WebFrame::loadHTMLString(char *html, char *baseURL)
     d->frame->end();
 }
 
+void WebFrame::loadURL(char* URL)
+{
+    d->frame->didOpenURL(URL);
+    d->frame->begin(URL);
+    WebCore::TransferJob* job = new TransferJob(this, "GET", URL);
+    job->start(0);
+}
+    
+void WebFrame::receivedData(WebCore::TransferJob*, const char* data, int length)
+{
+    d->frame->write(data, length);
+}
+
+void WebFrame::receivedAllData(WebCore::TransferJob* job, WebCore::PlatformData)
+{
+    d->frame->end();
+    delete job;
+}
+
 void WebFrame::paint()
 {
     d->frameView->layout();
index b148244244dda2b17e2f53800ac608ef90dc887e..4d0e7edb51fb66e6fe864e6ad3f6abbef9348e2e 100755 (executable)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
+#include "TransferJobClient.h"
+
 namespace WebCore {
     class Frame;
     class FrameView;
+    class TransferJob;
 }
 
 namespace WebKit {
 
     class WebView;
 
-    class WebFrame {
+    class WebFrame : public WebCore::TransferJobClient {
     public:
     WebFrame(char* name, WebView*);
 
     void loadFilePath(char*);
     void loadHTMLString(char* html, char* baseURL = 0);
 
+    void loadURL(char*);
+    
+    virtual void receivedData(WebCore::TransferJob*, const char*, int);
+    virtual void receivedAllData(WebCore::TransferJob*, WebCore::PlatformData);
+
     void paint();
 
     WebCore::Frame* impl();
index 0553a8981364499cf2adc5e740892553815e39e5..68ad9fa50884baf5db6a4a100b3128cbc37c9d07 100755 (executable)
@@ -100,7 +100,7 @@ WebView::WebView(HWND hWnd)
     d = new WebViewPrivate();
     d->windowHandle = hWnd;
     d->mainFrame = new WebFrame("dummy", this);
-    d->mainFrame->loadHTMLString("<p style=\"background-color: #00FF00\">Testing</p><img src=\"data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7\" alt=\"Face\"><div style=\"border: solid blue\">div with blue border</div><ul><li>foo<li>bar<li>baz</ul>");
+    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\">div with blue border</div><ul><li>foo<li>bar<li>baz</ul>");
 }
 
 WebView::~WebView()