Remove unused SharedBuffer::wrapCFDataArray
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Apr 2017 22:26:38 +0000 (22:26 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Apr 2017 22:26:38 +0000 (22:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170794

Reviewed by Brady Eidson.

Source/WebCore:

It's unused since r215280.

* platform/SharedBuffer.h:
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::wrapCFDataArray): Deleted.

Tools:

* TestWebKitAPI/Tests/WebCore/cocoa/SharedBuffer.mm:
(TestWebKitAPI::TEST_F):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/SharedBuffer.h
Source/WebCore/platform/cf/SharedBufferCF.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/cocoa/SharedBuffer.mm

index e9a7c18..66c054f 100644 (file)
@@ -1,3 +1,16 @@
+2017-04-12  Alex Christensen  <achristensen@webkit.org>
+
+        Remove unused SharedBuffer::wrapCFDataArray
+        https://bugs.webkit.org/show_bug.cgi?id=170794
+
+        Reviewed by Brady Eidson.
+
+        It's unused since r215280.
+
+        * platform/SharedBuffer.h:
+        * platform/cf/SharedBufferCF.cpp:
+        (WebCore::SharedBuffer::wrapCFDataArray): Deleted.
+
 2017-04-12  Anders Carlsson  <andersca@apple.com>
 
         Tweak WebCore::setMetadataURL function
index ef2876f..35749b7 100644 (file)
@@ -100,7 +100,6 @@ public:
     unsigned platformDataSize() const;
 
 #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
-    WEBCORE_EXPORT static Ref<SharedBuffer> wrapCFDataArray(CFArrayRef);
     WEBCORE_EXPORT void append(CFDataRef);
 #endif
 
@@ -159,7 +158,6 @@ private:
     mutable Ref<DataBuffer> m_buffer;
 
 #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
-    explicit SharedBuffer(CFArrayRef);
     mutable Vector<RetainPtr<CFDataRef>> m_dataArray;
     unsigned copySomeDataFromDataArray(const char*& someData, unsigned position) const;
     const char *singleDataArrayBuffer() const;
index 83ea33b..f4024b4 100644 (file)
@@ -118,20 +118,6 @@ bool SharedBuffer::maybeAppendPlatformData(SharedBuffer& newContents)
 }
 
 #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
-Ref<SharedBuffer> SharedBuffer::wrapCFDataArray(CFArrayRef cfDataArray)
-{
-    return adoptRef(*new SharedBuffer(cfDataArray));
-}
-
-SharedBuffer::SharedBuffer(CFArrayRef cfDataArray)
-    : m_buffer(adoptRef(*new DataBuffer))
-    , m_cfData(nullptr)
-{
-    CFIndex dataArrayCount = CFArrayGetCount(cfDataArray);
-    for (CFIndex index = 0; index < dataArrayCount; ++index)
-        append(checked_cf_cast<CFDataRef>(CFArrayGetValueAtIndex(cfDataArray, index)));
-}
-
 void SharedBuffer::append(CFDataRef data)
 {
     ASSERT(data);
index 566227a..306cff9 100644 (file)
@@ -1,3 +1,13 @@
+2017-04-12  Alex Christensen  <achristensen@webkit.org>
+
+        Remove unused SharedBuffer::wrapCFDataArray
+        https://bugs.webkit.org/show_bug.cgi?id=170794
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/Tests/WebCore/cocoa/SharedBuffer.mm:
+        (TestWebKitAPI::TEST_F):
+
 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading implementation semantics to Pthread one
index ccd2876..2646766 100644 (file)
@@ -62,14 +62,6 @@ TEST_F(SharedBufferTest, createNSDataArray)
         expectDataArraysEqual(@[ helloData ], SharedBuffer::wrapNSData(helloData)->createNSDataArray().get());
         expectDataArraysEqual(@[ worldData ], SharedBuffer::wrapCFData((CFDataRef)worldData)->createNSDataArray().get());
 
-        NSArray<NSData *> *dataArray = @[ [NSData dataWithBytes:"one" length:3], [NSData dataWithBytes:"two" length:3], [NSData dataWithBytes:"three" length:5] ];
-        auto wrappedDataArray = SharedBuffer::wrapCFDataArray((CFArrayRef)dataArray);
-        expectDataArraysEqual(dataArray, wrappedDataArray->createNSDataArray().get());
-
-        NSArray<NSData *> *secondDataArray = @[ [NSData dataWithBytes:"four" length:4], [NSData dataWithBytes:"five" length:4], [NSData dataWithBytes:"six" length:3] ];
-        wrappedDataArray->append(SharedBuffer::wrapCFDataArray((CFArrayRef)secondDataArray).get());
-        expectDataArraysEqual([dataArray arrayByAddingObjectsFromArray:secondDataArray], wrappedDataArray->createNSDataArray().get());
-
         expectDataArraysEqual(@[ [NSData dataWithContentsOfFile:tempFilePath()] ], SharedBuffer::createWithContentsOfFile(tempFilePath())->createNSDataArray().get());
     }
 }