Small ResourceLoader cleanups.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2013 21:36:29 +0000 (21:36 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2013 21:36:29 +0000 (21:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112279

Reviewed by Geoff Garen.

Source/WebCore:

No new tests (Refactor with no behavior change).

1 - Add "OVERRIDE" to virtual methods in subclasses of ResourceLoader to catch future mistakes.
2 - Replace the "bool allAtOnce" flag with a descriptive enum to make reading code easier.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):

* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::didReceiveData):
* loader/NetscapePlugInStreamLoader.h:

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::addData):
(WebCore::ResourceLoader::didReceiveData):
* loader/ResourceLoader.h:
* loader/ResourceLoaderTypes.h: Added.

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveData):
* loader/SubresourceLoader.h:

Source/WebKit2:

Replace the "bool allAtOnce" flag with a descriptive enum to make reading code easier.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveData):

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveData):
(WebKit::WebResourceLoader::didReceiveResource):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in: Get rid of the "allAtOnce" flag since it was always false.

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

19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/NetscapePlugInStreamLoader.cpp
Source/WebCore/loader/NetscapePlugInStreamLoader.h
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/ResourceLoaderTypes.h [new file with mode: 0644]
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/SubresourceLoader.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
Source/WebKit2/WebProcess/Network/WebResourceLoader.h
Source/WebKit2/WebProcess/Network/WebResourceLoader.messages.in

index 091858a..9dbcc43 100644 (file)
@@ -1,3 +1,38 @@
+2013-03-13  Brady Eidson  <beidson@apple.com>
+
+        Small ResourceLoader cleanups.
+        https://bugs.webkit.org/show_bug.cgi?id=112279
+
+        Reviewed by Geoff Garen.
+
+        No new tests (Refactor with no behavior change).
+
+        1 - Add "OVERRIDE" to virtual methods in subclasses of ResourceLoader to catch future mistakes.
+        2 - Replace the "bool allAtOnce" flag with a descriptive enum to make reading code easier.
+
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
+
+        * loader/NetscapePlugInStreamLoader.cpp:
+        (WebCore::NetscapePlugInStreamLoader::didReceiveData):
+        * loader/NetscapePlugInStreamLoader.h:
+
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::addData):
+        (WebCore::ResourceLoader::didReceiveData):
+        * loader/ResourceLoader.h:
+        * loader/ResourceLoaderTypes.h: Added.
+
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::didReceiveData):
+        * loader/SubresourceLoader.h:
+
 2013-03-13  Nate Chapin  <japhet@chromium.org>
 
         chromium's WebFrameTest.ReplaceNavigationAfterHistoryNavigation failing after r145734
index f5ed1d3..e3df9ee 100644 (file)
@@ -4085,6 +4085,7 @@ webcore_sources += \
        Source/WebCore/loader/ResourceLoader.cpp \
        Source/WebCore/loader/ResourceLoader.h \
        Source/WebCore/loader/ResourceLoaderOptions.h \
+       Source/WebCore/loader/ResourceLoaderTypes.h \
        Source/WebCore/loader/ResourceLoadNotifier.cpp \
        Source/WebCore/loader/ResourceLoadNotifier.h \
        Source/WebCore/loader/ResourceLoadScheduler.cpp \
index bfb87ac..391ddd7 100644 (file)
@@ -2087,6 +2087,7 @@ HEADERS += \
     loader/ProgressTracker.h \
     loader/ResourceBuffer.h \
     loader/ResourceLoader.h \
+    loader/ResourceLoaderTypes.h \
     loader/SubresourceLoader.h \
     loader/SubstituteData.h \
     loader/TextResourceDecoder.h \
index 69aa0bd..b093acf 100644 (file)
             'loader/ResourceLoadScheduler.cpp',
             'loader/ResourceLoader.cpp',
             'loader/ResourceLoaderOptions.h',
+            'loader/ResourceLoaderTypes.h',
             'loader/SinkDocument.cpp',
             'loader/SinkDocument.h',
             'loader/SubframeLoader.cpp',
index 38c4eb6..ca7bc5e 100755 (executable)
                                >
                        </File>
                        <File
+                               RelativePath="..\loader\ResourceLoaderTypes.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\loader\ResourceLoadNotifier.cpp"
                                >
                        </File>
index f5b2147..68d6f4a 100644 (file)
                51ABAE1E103C1913008C5260 /* SocketStreamHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABAE1C103C1913008C5260 /* SocketStreamHandle.h */; };
                51ABAE1F103C1913008C5260 /* SocketStreamHandleCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ABAE1D103C1913008C5260 /* SocketStreamHandleCFNet.cpp */; };
                51ABF64D16392E2800132A7A /* LoaderStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ABF64C16392E2800132A7A /* LoaderStrategy.cpp */; };
+               51AF503616F100F60095B2E8 /* ResourceLoaderTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AF503516F100F60095B2E8 /* ResourceLoaderTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */; };
                51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BE37DE0DAEE00E001085FC /* StorageArea.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51C0AA390F2AA10A001648C2 /* CachedFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C0AA380F2AA10A001648C2 /* CachedFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51ABAE1C103C1913008C5260 /* SocketStreamHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketStreamHandle.h; sourceTree = "<group>"; };
                51ABAE1D103C1913008C5260 /* SocketStreamHandleCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketStreamHandleCFNet.cpp; sourceTree = "<group>"; };
                51ABF64C16392E2800132A7A /* LoaderStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoaderStrategy.cpp; sourceTree = "<group>"; };
+               51AF503516F100F60095B2E8 /* ResourceLoaderTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoaderTypes.h; sourceTree = "<group>"; };
                51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyWebArchiveMac.mm; sourceTree = "<group>"; };
                51BE37DE0DAEE00E001085FC /* StorageArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageArea.h; sourceTree = "<group>"; };
                51C0AA380F2AA10A001648C2 /* CachedFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedFrame.h; sourceTree = "<group>"; };
                                514BC841161CF05C004D52F4 /* ResourceBuffer.h */,
                                93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */,
                                656D37270ADBA5DE00A4554D /* ResourceLoader.h */,
+                               51AF503516F100F60095B2E8 /* ResourceLoaderTypes.h */,
                                D0A3A7301405A39800FB8ED3 /* ResourceLoaderOptions.h */,
                                973E325410883B7C005BC493 /* ResourceLoadNotifier.cpp */,
                                973E325510883B7C005BC493 /* ResourceLoadNotifier.h */,
                                85D79ADE0ACA17EB00F02FC5 /* DOMSVGTransformable.h in Headers */,
                                854163980AC718680001E01B /* DOMSVGTransformInternal.h in Headers */,
                                8541636B0AC7180B0001E01B /* DOMSVGTransformList.h in Headers */,
+                               51AF503616F100F60095B2E8 /* ResourceLoaderTypes.h in Headers */,
                                854163970AC718680001E01B /* DOMSVGTransformListInternal.h in Headers */,
                                859D62BA0AD888EF00012995 /* DOMSVGTRefElement.h in Headers */,
                                859D62EB0AD8892700012995 /* DOMSVGTRefElementInternal.h in Headers */,
index b9851a1..3a5a830 100644 (file)
@@ -781,7 +781,7 @@ void DocumentLoader::substituteResourceDeliveryTimerFired(Timer<DocumentLoader>*
             if (loader->reachedTerminalState())
                 return;
 
-            loader->didReceiveData(data->data(), data->size(), data->size(), true);
+            loader->didReceiveData(data->data(), data->size(), data->size(), DataPayloadWholeResource);
 
             // Calling ResourceLoader::didReceiveData can end up cancelling the load,
             // so we need to check if the loader has reached its terminal state.
index e960609..9643cd8 100644 (file)
@@ -93,13 +93,13 @@ void NetscapePlugInStreamLoader::didReceiveResponse(const ResourceResponse& resp
         cancel(frameLoader()->client()->fileDoesNotExistError(response));
 }
 
-void NetscapePlugInStreamLoader::didReceiveData(const char* data, int length, long long encodedDataLength, bool allAtOnce)
+void NetscapePlugInStreamLoader::didReceiveData(const char* data, int length, long long encodedDataLength, DataPayloadType dataPayloadType)
 {
     RefPtr<NetscapePlugInStreamLoader> protect(this);
 
     m_client->didReceiveData(this, data, length);
     
-    ResourceLoader::didReceiveData(data, length, encodedDataLength, allAtOnce);
+    ResourceLoader::didReceiveData(data, length, encodedDataLength, dataPayloadType);
 }
 
 void NetscapePlugInStreamLoader::didFinishLoading(double finishTime)
index b7321f7..8f0fa6c 100644 (file)
@@ -56,17 +56,17 @@ public:
     bool isDone() const;
 
 private:
-    virtual void didReceiveResponse(const ResourceResponse&);
-    virtual void didReceiveData(const char*, int, long long encodedDataLength, bool allAtOnce);
-    virtual void didFinishLoading(double finishTime);
-    virtual void didFail(const ResourceError&);
+    virtual void didReceiveResponse(const ResourceResponse&) OVERRIDE;
+    virtual void didReceiveData(const char*, int, long long encodedDataLength, DataPayloadType) OVERRIDE;
+    virtual void didFinishLoading(double finishTime) OVERRIDE;
+    virtual void didFail(const ResourceError&) OVERRIDE;
 
-    virtual void releaseResources();
+    virtual void releaseResources() OVERRIDE;
 
     NetscapePlugInStreamLoader(Frame*, NetscapePlugInStreamLoaderClient*);
 
-    virtual void willCancel(const ResourceError&);
-    virtual void didCancel(const ResourceError&);
+    virtual void willCancel(const ResourceError&) OVERRIDE;
+    virtual void didCancel(const ResourceError&) OVERRIDE;
 
     NetscapePlugInStreamLoaderClient* m_client;
 };
index 10b4a79..3f6cdfb 100644 (file)
@@ -200,12 +200,12 @@ void ResourceLoader::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPol
 }
     
 
-void ResourceLoader::addData(const char* data, int length, bool allAtOnce)
+void ResourceLoader::addData(const char* data, int length, DataPayloadType dataPayloadType)
 {
     if (m_options.dataBufferingPolicy == DoNotBufferData)
         return;
 
-    if (allAtOnce) {
+    if (dataPayloadType == DataPayloadWholeResource) {
         m_resourceData = ResourceBuffer::create(data, length);
         return;
     }
@@ -287,7 +287,7 @@ void ResourceLoader::didReceiveResponse(const ResourceResponse& r)
         frameLoader()->notifier()->didReceiveResponse(this, m_response);
 }
 
-void ResourceLoader::didReceiveData(const char* data, int length, long long encodedDataLength, bool allAtOnce)
+void ResourceLoader::didReceiveData(const char* data, int length, long long encodedDataLength, DataPayloadType dataPayloadType)
 {
     // The following assertions are not quite valid here, since a subclass
     // might override didReceiveData in a way that invalidates them. This
@@ -299,7 +299,7 @@ void ResourceLoader::didReceiveData(const char* data, int length, long long enco
     // anything including possibly derefing this; one example of this is Radar 3266216.
     RefPtr<ResourceLoader> protector(this);
 
-    addData(data, length, allAtOnce);
+    addData(data, length, dataPayloadType);
     // FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
     // However, with today's computers and networking speeds, this won't happen in practice.
     // Could be an issue with a giant local file.
@@ -465,7 +465,7 @@ void ResourceLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse&
 void ResourceLoader::didReceiveData(ResourceHandle*, const char* data, int length, int encodedDataLength)
 {
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceData(m_frame.get(), identifier(), encodedDataLength);
-    didReceiveData(data, length, encodedDataLength, false);
+    didReceiveData(data, length, encodedDataLength, DataPayloadBytes);
     InspectorInstrumentation::didReceiveResourceData(cookie);
 }
 
index a89fac0..7356e78 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "ResourceHandleClient.h"
 #include "ResourceLoaderOptions.h"
+#include "ResourceLoaderTypes.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
 
@@ -72,7 +73,7 @@ public:
     virtual void releaseResources();
     const ResourceResponse& response() const;
 
-    virtual void addData(const char*, int, bool allAtOnce);
+    virtual void addData(const char*, int, DataPayloadType);
     virtual PassRefPtr<ResourceBuffer> resourceData();
     void clearResourceData();
     virtual bool isSubresourceLoader();
@@ -80,7 +81,7 @@ public:
     virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse);
     virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
     virtual void didReceiveResponse(const ResourceResponse&);
-    virtual void didReceiveData(const char*, int, long long encodedDataLength, bool allAtOnce);
+    virtual void didReceiveData(const char*, int, long long encodedDataLength, DataPayloadType);
     virtual void didReceiveCachedMetadata(const char*, int) { }
     void willStopBufferingData(const char*, int);
     virtual void didFinishLoading(double finishTime);
diff --git a/Source/WebCore/loader/ResourceLoaderTypes.h b/Source/WebCore/loader/ResourceLoaderTypes.h
new file mode 100644 (file)
index 0000000..8448579
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2013 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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.
+ */
+
+#ifndef ResourceLoaderTypes_h
+#define ResourceLoaderTypes_h
+
+namespace WebCore {
+
+// DataPayloadType describes the nature of an invocation of the ResourceLoader::didReceiveData callback.
+//  - DataPayloadWholeResource is expected when the buffer points to a whole resource. There will only be one such didReceiveData callback for the load.
+//  - DataPayloadBytes is expected when the buffer points to a range of bytes, which may or may not be a whole resource.
+//    There may have been previous didReceieveData callbacks, and there may be future didReceieveData callbacks.
+
+enum DataPayloadType {
+    DataPayloadWholeResource,
+    DataPayloadBytes,
+};
+
+} // namespace WebCore
+
+#endif // ResourceLoaderTypes_h
index 1c96543..0b5e385 100644 (file)
@@ -213,7 +213,7 @@ void SubresourceLoader::didReceiveResponse(const ResourceResponse& response)
     checkForHTTPStatusCodeError();
 }
 
-void SubresourceLoader::didReceiveData(const char* data, int length, long long encodedDataLength, bool allAtOnce)
+void SubresourceLoader::didReceiveData(const char* data, int length, long long encodedDataLength, DataPayloadType dataPayloadType)
 {
     if (m_resource->response().httpStatusCode() >= 400 && !m_resource->shouldIgnoreHTTPStatusCodeErrors())
         return;
@@ -223,7 +223,7 @@ void SubresourceLoader::didReceiveData(const char* data, int length, long long e
     // Reference the object in this method since the additional processing can do
     // anything including removing the last reference to this object; one example of this is 3266216.
     RefPtr<SubresourceLoader> protect(this);
-    addData(data, length, allAtOnce);
+    addData(data, length, dataPayloadType);
     if (!m_loadingMultipartContent)
         sendDataToResource(data, length);
     if (shouldSendResourceLoadCallbacks() && m_frame)
index a0600ed..fbe7dfc 100644 (file)
@@ -55,26 +55,26 @@ private:
     SubresourceLoader(Frame*, CachedResource*, const ResourceLoaderOptions&);
     virtual ~SubresourceLoader();
 
-    virtual bool init(const ResourceRequest&);
-
-    virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse);
-    virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
-    virtual void didReceiveResponse(const ResourceResponse&);
-    virtual void didReceiveData(const char*, int, long long encodedDataLength, bool allAtOnce);
-    virtual void didReceiveCachedMetadata(const char*, int);
-    virtual void didFinishLoading(double finishTime);
-    virtual void didFail(const ResourceError&);
-    virtual void willCancel(const ResourceError&);
-    virtual void didCancel(const ResourceError&) { }
+    virtual bool init(const ResourceRequest&) OVERRIDE;
+
+    virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse) OVERRIDE;
+    virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) OVERRIDE;
+    virtual void didReceiveResponse(const ResourceResponse&) OVERRIDE;
+    virtual void didReceiveData(const char*, int, long long encodedDataLength, DataPayloadType) OVERRIDE;
+    virtual void didReceiveCachedMetadata(const char*, int) OVERRIDE;
+    virtual void didFinishLoading(double finishTime) OVERRIDE;
+    virtual void didFail(const ResourceError&) OVERRIDE;
+    virtual void willCancel(const ResourceError&) OVERRIDE;
+    virtual void didCancel(const ResourceError&) OVERRIDE { }
 
 #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
-    virtual bool supportsDataArray() { return true; }
-    virtual void didReceiveDataArray(CFArrayRef);
+    virtual bool supportsDataArray() OVERRIDE { return true; }
+    virtual void didReceiveDataArray(CFArrayRef) OVERRIDE;
 #endif
 #if PLATFORM(CHROMIUM)
-    virtual void didDownloadData(int);
+    virtual void didDownloadData(int) OVERRIDE;
 #endif
-    virtual void releaseResources();
+    virtual void releaseResources() OVERRIDE;
 
     bool checkForHTTPStatusCodeError();
     void sendDataToResource(const char*, int);
index f03a4c3..002407e 100644 (file)
@@ -1,3 +1,21 @@
+2013-03-13  Brady Eidson  <beidson@apple.com>
+
+        Small ResourceLoader cleanups.
+        https://bugs.webkit.org/show_bug.cgi?id=112279
+
+        Reviewed by Geoff Garen.
+
+        Replace the "bool allAtOnce" flag with a descriptive enum to make reading code easier.
+
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::didReceiveData):
+
+        * WebProcess/Network/WebResourceLoader.cpp:
+        (WebKit::WebResourceLoader::didReceiveData):
+        (WebKit::WebResourceLoader::didReceiveResource):
+        * WebProcess/Network/WebResourceLoader.h:
+        * WebProcess/Network/WebResourceLoader.messages.in: Get rid of the "allAtOnce" flag since it was always false.
+
 2013-03-13  Abhishek Arya  <inferno@chromium.org>
 
         Replace static_casts with to* functions for document types.
index 60f5fe2..eab2e9e 100644 (file)
@@ -205,7 +205,7 @@ void NetworkResourceLoader::didReceiveData(ResourceHandle*, const char* data, in
     // Such buffering will need to be thread safe, as this callback is happening on a background thread.
     
     CoreIPC::DataReference dataReference(reinterpret_cast<const uint8_t*>(data), length);
-    sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveData(dataReference, encodedDataLength, false));
+    sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveData(dataReference, encodedDataLength));
 }
 
 void NetworkResourceLoader::didFinishLoading(ResourceHandle*, double finishTime)
index c9c8b30..0ec8e18 100644 (file)
@@ -87,10 +87,10 @@ void WebResourceLoader::didReceiveResponseWithCertificateInfo(const ResourceResp
     m_coreLoader->didReceiveResponse(responseCopy);
 }
 
-void WebResourceLoader::didReceiveData(const CoreIPC::DataReference& data, int64_t encodedDataLength, bool allAtOnce)
+void WebResourceLoader::didReceiveData(const CoreIPC::DataReference& data, int64_t encodedDataLength)
 {
     LOG(Network, "(WebProcess) WebResourceLoader::didReceiveData of size %i for '%s'", (int)data.size(), m_coreLoader->url().string().utf8().data());
-    m_coreLoader->didReceiveData(reinterpret_cast<const char*>(data.data()), data.size(), encodedDataLength, allAtOnce);
+    m_coreLoader->didReceiveData(reinterpret_cast<const char*>(data.data()), data.size(), encodedDataLength, DataPayloadBytes);
 }
 
 void WebResourceLoader::didFinishResourceLoad(double finishTime)
@@ -117,7 +117,7 @@ void WebResourceLoader::didReceiveResource(const ShareableResource::Handle& hand
         // FIXME (NetworkProcess): Give ResourceLoader the ability to take ResourceBuffer arguments.
         // That will allow us to pass it along to CachedResources and allow them to hang on to the shared memory behind the scenes.
         // FIXME (NetworkProcess): Pass along the correct value for encodedDataLength.
-        m_coreLoader->didReceiveData(reinterpret_cast<const char*>(resource->data()), resource->size(), -1 /* encodedDataLength */ , true);
+        m_coreLoader->didReceiveData(reinterpret_cast<const char*>(resource->data()), resource->size(), -1 /* encodedDataLength */ , DataPayloadWholeResource);
     }
 
     m_coreLoader->didFinishLoading(finishTime);
index 03e8271..ecb03fd 100644 (file)
@@ -75,7 +75,7 @@ private:
 
     void willSendRequest(const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse, WebCore::ResourceRequest& newRequest);
     void didReceiveResponseWithCertificateInfo(const WebCore::ResourceResponse&, const PlatformCertificateInfo&);
-    void didReceiveData(const CoreIPC::DataReference&, int64_t encodedDataLength, bool allAtOnce);
+    void didReceiveData(const CoreIPC::DataReference&, int64_t encodedDataLength);
     void didFinishResourceLoad(double finishTime);
     void didFailResourceLoad(const WebCore::ResourceError&);
     void didReceiveResource(const ShareableResource::Handle&, double finishTime);
index ead57a8..45c4fc7 100644 (file)
@@ -27,7 +27,7 @@ messages -> WebResourceLoader LegacyReceiver {
     // FIXME (NetworkProcess): We'll need much more granularity for response messages.
     WillSendRequest(WebCore::ResourceRequest request, WebCore::ResourceResponse redirectResponse) -> (WebCore::ResourceRequest newRequest)
     DidReceiveResponseWithCertificateInfo(WebCore::ResourceResponse response, WebKit::PlatformCertificateInfo certificateInfo)
-    DidReceiveData(CoreIPC::DataReference data, int64_t encodedDataLength, bool allAtOnce)
+    DidReceiveData(CoreIPC::DataReference data, int64_t encodedDataLength)
     DidFinishResourceLoad(double finishTime)
     DidFailResourceLoad(WebCore::ResourceError error)