Rename shouldBufferData to dataBufferingPolicy
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2012 20:26:43 +0000 (20:26 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2012 20:26:43 +0000 (20:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=105450

Reviewed by Alexey Proskuryakov.

No new tests, simple rename.

Source/WebCore:

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::appendBytes):
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::didReceiveData):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::setDataBufferingPolicy):
* loader/MainResourceLoader.h:
(MainResourceLoader):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::setDataBufferingPolicy):
(WebCore::ResourceLoader::addData):
(WebCore::ResourceLoader::willStopBufferingData):
* loader/ResourceLoader.h:
(ResourceLoader):
* loader/ResourceLoaderOptions.h:
(WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
(ResourceLoaderOptions):
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::data):
(WebCore::CachedRawResource::setDataBufferingPolicy):
(WebCore::CachedRawResource::canReuse):
* loader/cache/CachedRawResource.h:
(CachedRawResource):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::dataBufferingPolicy):
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::didReceiveDataArray):
* page/EventSource.cpp:
(WebCore::EventSource::connect):

Source/WebKit/chromium:

* src/AssociatedURLLoader.cpp:
(WebKit::AssociatedURLLoader::loadAsynchronously):

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

17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/PluginDocument.cpp
Source/WebCore/inspector/InspectorResourceAgent.cpp
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/MainResourceLoader.cpp
Source/WebCore/loader/MainResourceLoader.h
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/ResourceLoaderOptions.h
Source/WebCore/loader/cache/CachedRawResource.cpp
Source/WebCore/loader/cache/CachedRawResource.h
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/mac/ResourceLoaderMac.mm
Source/WebCore/page/EventSource.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/AssociatedURLLoader.cpp

index b20a429..6dda7b2 100644 (file)
@@ -1,3 +1,46 @@
+2012-12-20  Nate Chapin  <japhet@chromium.org>
+
+        Rename shouldBufferData to dataBufferingPolicy
+        https://bugs.webkit.org/show_bug.cgi?id=105450
+
+        Reviewed by Alexey Proskuryakov.
+
+        No new tests, simple rename.
+
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocumentParser::createDocumentStructure):
+        * html/PluginDocument.cpp:
+        (WebCore::PluginDocumentParser::appendBytes):
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::didReceiveData):
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::loadRequest):
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::setDataBufferingPolicy):
+        * loader/MainResourceLoader.h:
+        (MainResourceLoader):
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::setDataBufferingPolicy):
+        (WebCore::ResourceLoader::addData):
+        (WebCore::ResourceLoader::willStopBufferingData):
+        * loader/ResourceLoader.h:
+        (ResourceLoader):
+        * loader/ResourceLoaderOptions.h:
+        (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
+        (ResourceLoaderOptions):
+        * loader/cache/CachedRawResource.cpp:
+        (WebCore::CachedRawResource::data):
+        (WebCore::CachedRawResource::setDataBufferingPolicy):
+        (WebCore::CachedRawResource::canReuse):
+        * loader/cache/CachedRawResource.h:
+        (CachedRawResource):
+        * loader/cache/CachedResource.h:
+        (WebCore::CachedResource::dataBufferingPolicy):
+        * loader/mac/ResourceLoaderMac.mm:
+        (WebCore::ResourceLoader::didReceiveDataArray):
+        * page/EventSource.cpp:
+        (WebCore::EventSource::connect):
+
 2012-12-19  Dean Jackson  <dino@apple.com>
 
         Track menu in wrong location when fullscreen
index e519454..57b1b79 100644 (file)
@@ -105,7 +105,7 @@ void MediaDocumentParser::createDocumentStructure()
     if (!frame)
         return;
 
-    frame->loader()->activeDocumentLoader()->mainResourceLoader()->setShouldBufferData(DoNotBufferData);
+    frame->loader()->activeDocumentLoader()->mainResourceLoader()->setDataBufferingPolicy(DoNotBufferData);
 }
 
 void MediaDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
index 1ad032a..474d991 100644 (file)
@@ -130,7 +130,7 @@ void PluginDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
             // In a plugin document, the main resource is the plugin. If we have a null widget, that means
             // the loading of the plugin was cancelled, which gives us a null mainResourceLoader(), so we
             // need to have this call in a null check of the widget or of mainResourceLoader().
-            frame->loader()->activeDocumentLoader()->mainResourceLoader()->setShouldBufferData(DoNotBufferData);
+            frame->loader()->activeDocumentLoader()->mainResourceLoader()->setDataBufferingPolicy(DoNotBufferData);
         }
     }
 }
index bb1b4fe..a3aec9a 100644 (file)
@@ -291,7 +291,7 @@ void InspectorResourceAgent::didReceiveData(unsigned long identifier, const char
 
     if (data) {
         NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
-        if (resourceData && !m_loadingXHRSynchronously && (!resourceData->cachedResource() || !resourceData->cachedResource()->shouldBufferData() || isErrorStatusCode(resourceData->httpStatusCode())))
+        if (resourceData && !m_loadingXHRSynchronously && (!resourceData->cachedResource() || resourceData->cachedResource()->dataBufferingPolicy() == DoNotBufferData || isErrorStatusCode(resourceData->httpStatusCode())))
             m_resourcesData->maybeAddResourceData(requestId, data, dataLength);
     }
 
index 3458863..3db752c 100644 (file)
@@ -371,7 +371,7 @@ void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, Secur
             options.sendLoadCallbacks = DoNotSendCallbacks;
             options.sniffContent = DoNotSniffContent;
             // Keep buffering the data for the preflight request.
-            options.shouldBufferData = BufferData;
+            options.dataBufferingPolicy = BufferData;
         }
 
         CachedResourceRequest newRequest(request, options);
index 8565c17..350eb0d 100644 (file)
@@ -679,10 +679,10 @@ bool MainResourceLoader::defersLoading() const
     return loader() ? loader()->defersLoading() : false;
 }
 
-void MainResourceLoader::setShouldBufferData(DataBufferingPolicy shouldBufferData)
+void MainResourceLoader::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
 {
     ASSERT(m_resource);
-    m_resource->setShouldBufferData(shouldBufferData);
+    m_resource->setDataBufferingPolicy(dataBufferingPolicy);
 }
 
 ResourceLoader* MainResourceLoader::loader() const
index 5467613..5e7fd55 100644 (file)
@@ -64,7 +64,7 @@ public:
     PassRefPtr<ResourceBuffer> resourceData();
 
     void setDefersLoading(bool);
-    void setShouldBufferData(DataBufferingPolicy);
+    void setDataBufferingPolicy(DataBufferingPolicy);
 
 #if HAVE(RUNLOOP_TIMER)
     typedef RunLoopTimer<MainResourceLoader> MainResourceLoaderTimer;
index 08d7b63..18eafb7 100644 (file)
@@ -189,19 +189,19 @@ FrameLoader* ResourceLoader::frameLoader() const
     return m_frame->loader();
 }
 
-void ResourceLoader::setShouldBufferData(DataBufferingPolicy shouldBufferData)
+void ResourceLoader::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
 { 
-    m_options.shouldBufferData = shouldBufferData
+    m_options.dataBufferingPolicy = dataBufferingPolicy
 
     // Reset any already buffered data
-    if (shouldBufferData == DoNotBufferData)
+    if (dataBufferingPolicy == DoNotBufferData)
         m_resourceData = 0;
 }
     
 
 void ResourceLoader::addData(const char* data, int length, bool allAtOnce)
 {
-    if (m_options.shouldBufferData == DoNotBufferData)
+    if (m_options.dataBufferingPolicy == DoNotBufferData)
         return;
 
     if (allAtOnce) {
@@ -299,7 +299,7 @@ void ResourceLoader::didReceiveData(const char* data, int length, long long enco
 
 void ResourceLoader::willStopBufferingData(const char* data, int length)
 {
-    if (m_options.shouldBufferData == DoNotBufferData)
+    if (m_options.dataBufferingPolicy == DoNotBufferData)
         return;
 
     ASSERT(!m_resourceData);
index e29d6a7..11a46a9 100644 (file)
@@ -146,7 +146,7 @@ public:
 
     const ResourceRequest& request() const { return m_request; }
 
-    void setShouldBufferData(DataBufferingPolicy);
+    void setDataBufferingPolicy(DataBufferingPolicy);
 
     virtual void reportMemoryUsage(MemoryObjectInfo*) const;
 
index a290ad7..8fde9e5 100644 (file)
@@ -61,11 +61,11 @@ enum SecurityCheckPolicy {
 };
 
 struct ResourceLoaderOptions {
-    ResourceLoaderOptions() : sendLoadCallbacks(DoNotSendCallbacks), sniffContent(DoNotSniffContent), shouldBufferData(BufferData), allowCredentials(DoNotAllowStoredCredentials), crossOriginCredentialPolicy(DoNotAskClientForCrossOriginCredentials), securityCheck(DoSecurityCheck) { }
-    ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy shouldBufferData, StoredCredentials allowCredentials, ClientCrossOriginCredentialPolicy crossOriginCredentialPolicy, SecurityCheckPolicy securityCheck)
+    ResourceLoaderOptions() : sendLoadCallbacks(DoNotSendCallbacks), sniffContent(DoNotSniffContent), dataBufferingPolicy(BufferData), allowCredentials(DoNotAllowStoredCredentials), crossOriginCredentialPolicy(DoNotAskClientForCrossOriginCredentials), securityCheck(DoSecurityCheck) { }
+    ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCrossOriginCredentialPolicy crossOriginCredentialPolicy, SecurityCheckPolicy securityCheck)
         : sendLoadCallbacks(sendLoadCallbacks)
         , sniffContent(sniffContent)
-        , shouldBufferData(shouldBufferData)
+        , dataBufferingPolicy(dataBufferingPolicy)
         , allowCredentials(allowCredentials)
         , crossOriginCredentialPolicy(crossOriginCredentialPolicy)
         , securityCheck(securityCheck)
@@ -73,7 +73,7 @@ struct ResourceLoaderOptions {
     }
     SendCallbackPolicy sendLoadCallbacks;
     ContentSniffingPolicy sniffContent;
-    DataBufferingPolicy shouldBufferData;
+    DataBufferingPolicy dataBufferingPolicy;
     StoredCredentials allowCredentials; // Whether HTTP credentials and cookies are sent with the request.
     ClientCrossOriginCredentialPolicy crossOriginCredentialPolicy; // Whether we will ask the client for credentials (if we allow credentials at all).
     SecurityCheckPolicy securityCheck;
index 9b10dd8..832d223 100644 (file)
@@ -51,19 +51,19 @@ void CachedRawResource::data(PassRefPtr<ResourceBuffer> data, bool allDataReceiv
         // If we are buffering data, then we are saving the buffer in m_data and need to manually
         // calculate the incremental data. If we are not buffering, then m_data will be null and
         // the buffer contains only the incremental data.
-        size_t previousDataLength = (m_options.shouldBufferData == BufferData) ? encodedSize() : 0;
+        size_t previousDataLength = (m_options.dataBufferingPolicy == BufferData) ? encodedSize() : 0;
         ASSERT(data->size() >= previousDataLength);
         incrementalData = data->data() + previousDataLength;
         incrementalDataLength = data->size() - previousDataLength;
     }
 
-    if (m_options.shouldBufferData == BufferData) {
+    if (m_options.dataBufferingPolicy == BufferData) {
         if (data)
             setEncodedSize(data->size());
         m_data = data;
     }
 
-    DataBufferingPolicy dataBufferingPolicy = m_options.shouldBufferData;
+    DataBufferingPolicy dataBufferingPolicy = m_options.dataBufferingPolicy;
     if (incrementalDataLength) {
         CachedResourceClientWalker<CachedRawResourceClient> w(m_clients);
         while (CachedRawResourceClient* c = w.next())
@@ -71,9 +71,9 @@ void CachedRawResource::data(PassRefPtr<ResourceBuffer> data, bool allDataReceiv
     }
     CachedResource::data(m_data, allDataReceived);
 
-    if (dataBufferingPolicy == BufferData && m_options.shouldBufferData == DoNotBufferData) {
+    if (dataBufferingPolicy == BufferData && m_options.dataBufferingPolicy == DoNotBufferData) {
         if (m_loader)
-            m_loader->setShouldBufferData(DoNotBufferData);
+            m_loader->setDataBufferingPolicy(DoNotBufferData);
         clear();
     }
 }
@@ -137,9 +137,9 @@ void CachedRawResource::setDefersLoading(bool defers)
         m_loader->setDefersLoading(defers);
 }
 
-void CachedRawResource::setShouldBufferData(DataBufferingPolicy shouldBufferData)
+void CachedRawResource::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
 {
-    m_options.shouldBufferData = shouldBufferData;
+    m_options.dataBufferingPolicy = dataBufferingPolicy;
 }
 
 static bool shouldIgnoreHeaderForCacheReuse(AtomicString headerName)
@@ -162,7 +162,7 @@ static bool shouldIgnoreHeaderForCacheReuse(AtomicString headerName)
 
 bool CachedRawResource::canReuse(const ResourceRequest& newRequest) const
 {
-    if (m_options.shouldBufferData == DoNotBufferData)
+    if (m_options.dataBufferingPolicy == DoNotBufferData)
         return false;
 
     if (m_resourceRequest.httpMethod() != newRequest.httpMethod())
index 1fc042f..cb97aba 100644 (file)
@@ -40,7 +40,7 @@ public:
     // This can be fixed by splitting CORS preflighting out of DocumentThreacableLoader.
     virtual void setDefersLoading(bool);
 
-    virtual void setShouldBufferData(DataBufferingPolicy);
+    virtual void setDataBufferingPolicy(DataBufferingPolicy);
     
     // FIXME: This is exposed for the InpsectorInstrumentation for preflights in DocumentThreadableLoader. It's also really lame.
     unsigned long identifier() const { return m_identifier; }
index faff763..8f7908d 100644 (file)
@@ -215,7 +215,7 @@ public:
     bool loadFailedOrCanceled() { return !m_error.isNull(); }
 
     bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks == SendCallbacks; }
-    bool shouldBufferData() const { return m_options.shouldBufferData == BufferData; }
+    DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBufferingPolicy; }
     
     virtual void destroyDecodedData() { }
 
index 8e7ce9f..c16b8f7 100644 (file)
@@ -82,7 +82,7 @@ void ResourceLoader::didReceiveDataArray(CFArrayRef dataArray)
         CFDataRef data = static_cast<CFDataRef>(CFArrayGetValueAtIndex(dataArray, i));
         int dataLen = static_cast<int>(CFDataGetLength(data));
 
-        if (m_options.shouldBufferData == BufferData) {
+        if (m_options.dataBufferingPolicy == BufferData) {
             if (!m_resourceData)
                 m_resourceData = ResourceBuffer::create();
             m_resourceData->append(data);
index f044345..9a88abd 100644 (file)
@@ -124,7 +124,7 @@ void EventSource::connect()
     options.allowCredentials = (origin->canRequest(m_url) || m_withCredentials) ? AllowStoredCredentials : DoNotAllowStoredCredentials;
     options.preflightPolicy = PreventPreflight;
     options.crossOriginRequestPolicy = UseAccessControl;
-    options.shouldBufferData = DoNotBufferData;
+    options.dataBufferingPolicy = DoNotBufferData;
     options.securityOrigin = origin;
 
     m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, options);
index b9a097c..0ed7180 100644 (file)
@@ -1,3 +1,15 @@
+2012-12-20  Nate Chapin  <japhet@chromium.org>
+
+        Rename shouldBufferData to dataBufferingPolicy
+        https://bugs.webkit.org/show_bug.cgi?id=105450
+
+        Reviewed by Alexey Proskuryakov.
+
+        No new tests, simple rename.
+
+        * src/AssociatedURLLoader.cpp:
+        (WebKit::AssociatedURLLoader::loadAsynchronously):
+
 2012-12-20  Dominic Mazzoni  <dmazzoni@google.com>
 
         AX: support clickPoint in DRT for chromium
index b2ceab7..cebedfa 100644 (file)
@@ -344,7 +344,7 @@ void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebUR
         options.allowCredentials = m_options.allowCredentials ? AllowStoredCredentials : DoNotAllowStoredCredentials;
         options.preflightPolicy = m_options.forcePreflight ? ForcePreflight : ConsiderPreflight;
         options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginRequestPolicy>(m_options.crossOriginRequestPolicy);
-        options.shouldBufferData = DoNotBufferData;
+        options.dataBufferingPolicy = DoNotBufferData;
 
         const ResourceRequest& webcoreRequest = newRequest.toResourceRequest();
         Document* webcoreDocument = m_frameImpl->frame()->document();