[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

darin at chromium.org darin at chromium.org
Wed Dec 22 11:22:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b5fc21c30d9cbeceec6d0123eafe4c02bd9495d3
Author: darin at chromium.org <darin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 20 19:56:58 2010 +0000

    2010-07-20  Darin Fisher  <darin at chromium.org>
    
            Reviewed by Jian Li.
    
            [Chromium] Add interface for downloading to a file.  This can be used
            in the future to support XMLHttpRequest.responseBlob, but it also
            serves a use case in Chromium.
    
            https://bugs.webkit.org/show_bug.cgi?id=42657
    
            * public/WebURLLoaderClient.h:
            (WebKit::WebURLLoaderClient::willSendRequest):
            (WebKit::WebURLLoaderClient::didSendData):
            (WebKit::WebURLLoaderClient::didReceiveResponse):
            (WebKit::WebURLLoaderClient::didDownloadData):
            (WebKit::WebURLLoaderClient::didReceiveData):
            (WebKit::WebURLLoaderClient::didFinishLoading):
            (WebKit::WebURLLoaderClient::didFail):
            * public/WebURLRequest.h:
            * public/WebURLResponse.h:
            * src/WebURLRequest.cpp:
            (WebKit::WebURLRequest::downloadToFile):
            (WebKit::WebURLRequest::setDownloadToFile):
            * src/WebURLRequestPrivate.h:
            (WebKit::WebURLRequestPrivate::WebURLRequestPrivate):
            * src/WebURLResponse.cpp:
            (WebKit::WebURLResponse::downloadFilePath):
            (WebKit::WebURLResponse::setDownloadFilePath):
            * src/WebURLResponsePrivate.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63769 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 459683b..b6193f0 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,33 @@
+2010-07-20  Darin Fisher  <darin at chromium.org>
+
+        Reviewed by Jian Li.
+
+        [Chromium] Add interface for downloading to a file.  This can be used
+        in the future to support XMLHttpRequest.responseBlob, but it also
+        serves a use case in Chromium.
+
+        https://bugs.webkit.org/show_bug.cgi?id=42657
+
+        * public/WebURLLoaderClient.h:
+        (WebKit::WebURLLoaderClient::willSendRequest):
+        (WebKit::WebURLLoaderClient::didSendData):
+        (WebKit::WebURLLoaderClient::didReceiveResponse):
+        (WebKit::WebURLLoaderClient::didDownloadData):
+        (WebKit::WebURLLoaderClient::didReceiveData):
+        (WebKit::WebURLLoaderClient::didFinishLoading):
+        (WebKit::WebURLLoaderClient::didFail):
+        * public/WebURLRequest.h:
+        * public/WebURLResponse.h:
+        * src/WebURLRequest.cpp:
+        (WebKit::WebURLRequest::downloadToFile):
+        (WebKit::WebURLRequest::setDownloadToFile):
+        * src/WebURLRequestPrivate.h:
+        (WebKit::WebURLRequestPrivate::WebURLRequestPrivate):
+        * src/WebURLResponse.cpp:
+        (WebKit::WebURLResponse::downloadFilePath):
+        (WebKit::WebURLResponse::setDownloadFilePath):
+        * src/WebURLResponsePrivate.h:
+
 2010-07-20  Sheriff Bot  <webkit.review.bot at gmail.com>
 
         Unreviewed, rolling out r63750.
diff --git a/WebKit/chromium/public/WebURLLoaderClient.h b/WebKit/chromium/public/WebURLLoaderClient.h
index a66b153..c716e5d 100644
--- a/WebKit/chromium/public/WebURLLoaderClient.h
+++ b/WebKit/chromium/public/WebURLLoaderClient.h
@@ -43,27 +43,31 @@ public:
     // Called when following a redirect.  |newRequest| contains the request
     // generated by the redirect.  The client may modify |newRequest|.
     virtual void willSendRequest(
-        WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirectResponse) = 0;
+        WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirectResponse) { }
 
     // Called to report upload progress.  The bytes reported correspond to
     // the HTTP message body.
     virtual void didSendData(
-        WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) = 0;
+        WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) { }
 
     // Called when response headers are received.
-    virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&) = 0;
+    virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&) { }
+
+    // Called when a chunk of response data is downloaded.  This is only called
+    // if WebURLRequest's downloadToFile flag was set to true.
+    virtual void didDownloadData(WebURLLoader*, int dataLength) { }
 
     // Called when a chunk of response data is received.
-    virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength) = 0;
+    virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength) { }
 
     // Called when a chunk of renderer-generated metadata is received from the cache.
     virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) { }
 
     // Called when the load completes successfully.
-    virtual void didFinishLoading(WebURLLoader*) = 0;
+    virtual void didFinishLoading(WebURLLoader*) { }
 
     // Called when the load completes with an error.
-    virtual void didFail(WebURLLoader*, const WebURLError&) = 0;
+    virtual void didFail(WebURLLoader*, const WebURLError&) { }
 
 protected:
     ~WebURLLoaderClient() { }
diff --git a/WebKit/chromium/public/WebURLRequest.h b/WebKit/chromium/public/WebURLRequest.h
index b60d5be..36d6791 100644
--- a/WebKit/chromium/public/WebURLRequest.h
+++ b/WebKit/chromium/public/WebURLRequest.h
@@ -151,6 +151,11 @@ public:
     WEBKIT_API int appCacheHostID() const;
     WEBKIT_API void setAppCacheHostID(int id);
 
+    // If true, the response body will be downloaded to a file managed by the
+    // WebURLLoader.  See WebURLResponse::downloadedFilePath.
+    WEBKIT_API bool downloadToFile() const;
+    WEBKIT_API void setDownloadToFile(bool);
+
 #if defined(WEBKIT_IMPLEMENTATION)
     WebCore::ResourceRequest& toMutableResourceRequest();
     const WebCore::ResourceRequest& toResourceRequest() const;
diff --git a/WebKit/chromium/public/WebURLResponse.h b/WebKit/chromium/public/WebURLResponse.h
index 4727c73..ac75d4c 100644
--- a/WebKit/chromium/public/WebURLResponse.h
+++ b/WebKit/chromium/public/WebURLResponse.h
@@ -158,6 +158,12 @@ public:
     WEBKIT_API bool isMultipartPayload() const;
     WEBKIT_API void setIsMultipartPayload(bool);
 
+    // This indicates the location of a downloaded response if the
+    // WebURLRequest had the downloadToFile flag set to true.  This file path
+    // remains valid for the lifetime of the WebURLLoader used to create it.
+    WEBKIT_API WebString downloadFilePath() const;
+    WEBKIT_API void setDownloadFilePath(const WebString&);
+
 protected:
     void assign(WebURLResponsePrivate*);
 
diff --git a/WebKit/chromium/src/WebURLRequest.cpp b/WebKit/chromium/src/WebURLRequest.cpp
index 3b2d251..69dfac4 100644
--- a/WebKit/chromium/src/WebURLRequest.cpp
+++ b/WebKit/chromium/src/WebURLRequest.cpp
@@ -245,6 +245,16 @@ void WebURLRequest::setAppCacheHostID(int appCacheHostID)
     m_private->m_resourceRequest->setAppCacheHostID(appCacheHostID);
 }
 
+bool WebURLRequest::downloadToFile() const
+{
+    return m_private->m_downloadToFile;
+}
+
+void WebURLRequest::setDownloadToFile(bool downloadToFile)
+{
+    m_private->m_downloadToFile = downloadToFile;
+}
+
 ResourceRequest& WebURLRequest::toMutableResourceRequest()
 {
     ASSERT(m_private);
diff --git a/WebKit/chromium/src/WebURLRequestPrivate.h b/WebKit/chromium/src/WebURLRequestPrivate.h
index 2f7c25f..79f6451 100644
--- a/WebKit/chromium/src/WebURLRequestPrivate.h
+++ b/WebKit/chromium/src/WebURLRequestPrivate.h
@@ -37,13 +37,19 @@ namespace WebKit {
 
 class WebURLRequestPrivate {
 public:
-    WebURLRequestPrivate() : m_resourceRequest(0), m_allowStoredCredentials(true) { }
+    WebURLRequestPrivate()
+        : m_resourceRequest(0)
+        , m_allowStoredCredentials(true)
+        , m_downloadToFile(false) { }
 
     // Called by WebURLRequest when it no longer needs this object.
     virtual void dispose() = 0;
 
     WebCore::ResourceRequest* m_resourceRequest;
     bool m_allowStoredCredentials;
+
+    // FIXME: Move this to ResourceRequest once we have an internal consumer.
+    bool m_downloadToFile;
 };
 
 } // namespace WebKit
diff --git a/WebKit/chromium/src/WebURLResponse.cpp b/WebKit/chromium/src/WebURLResponse.cpp
index e4172e7..0511f8d 100644
--- a/WebKit/chromium/src/WebURLResponse.cpp
+++ b/WebKit/chromium/src/WebURLResponse.cpp
@@ -362,6 +362,16 @@ void WebURLResponse::setIsMultipartPayload(bool value)
     m_private->m_resourceResponse->setIsMultipartPayload(value);
 }
 
+WebString WebURLResponse::downloadFilePath() const
+{
+    return m_private->m_downloadFilePath;
+}
+
+void WebURLResponse::setDownloadFilePath(const WebString& downloadFilePath)
+{
+    m_private->m_downloadFilePath = downloadFilePath;
+}
+
 void WebURLResponse::assign(WebURLResponsePrivate* p)
 {
     // Subclasses may call this directly so a self-assignment check is needed
diff --git a/WebKit/chromium/src/WebURLResponsePrivate.h b/WebKit/chromium/src/WebURLResponsePrivate.h
index 716c8db..dc5ce22 100644
--- a/WebKit/chromium/src/WebURLResponsePrivate.h
+++ b/WebKit/chromium/src/WebURLResponsePrivate.h
@@ -31,6 +31,8 @@
 #ifndef WebURLResponsePrivate_h
 #define WebURLResponsePrivate_h
 
+#include "WebString.h"
+
 namespace WebCore { class ResourceResponse; }
 
 namespace WebKit {
@@ -43,6 +45,9 @@ public:
     virtual void dispose() = 0;
 
     WebCore::ResourceResponse* m_resourceResponse;
+
+    // FIXME: Move this to ResourceResponse once we have an internal consumer.
+    WebString m_downloadFilePath;
 };
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list