Title: [216833] trunk
Revision
216833
Author
[email protected]
Date
2017-05-13 21:04:35 -0700 (Sat, 13 May 2017)

Log Message

Stop using RefPtr::release()
https://bugs.webkit.org/show_bug.cgi?id=172074

Reviewed by Geoffrey Garen.

Source/WebCore:

* css/parser/CSSPropertyParser.cpp:
(WebCore::FontVariantLigaturesParser::finalizeValue):
(WebCore::FontVariantNumericParser::finalizeValue):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::create):
* loader/archive/mhtml/MHTMLArchive.cpp:
(WebCore::MHTMLArchive::generateMHTMLData):
* loader/archive/mhtml/MHTMLArchive.h:
* loader/archive/mhtml/MHTMLParser.cpp:
(WebCore::MHTMLParser::parseArchiveWithHeader):
* platform/audio/ios/AudioFileReaderIOS.cpp:
(WebCore::AudioFileReader::createBus):
* platform/glib/SharedBufferGlib.cpp:
(WebCore::SharedBuffer::createFromReadingFile):
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::create):
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::copyCairoImageSurface):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::getImageData):
* platform/graphics/gtk/IconGtk.cpp:
(WebCore::Icon::createIconForFiles):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::systemFallbackForCharacters):
* platform/win/SharedBufferWin.cpp:
(WebCore::SharedBuffer::createFromReadingFile):

Source/WebKit/win:

* WebFrame.cpp:
(WebFrame::loadPlainTextString):
(WebFrame::loadHTMLString):
* WebFramePolicyListener.cpp:
(WebFramePolicyListener::receivedPolicyDecision):

Source/WebKit2:

* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::create):
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::createImageBacking):
* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::createCairoSurface):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
(WebKit::core):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getContentsAsMHTMLData):

Source/WTF:

* wtf/win/WorkQueueWin.cpp:
(WTF::WorkQueue::dispatchAfter):

Tools:

* TestWebKitAPI/Tests/WTF/RefPtr.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (216832 => 216833)


--- trunk/Source/WTF/ChangeLog	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WTF/ChangeLog	2017-05-14 04:04:35 UTC (rev 216833)
@@ -1,3 +1,13 @@
+2017-05-13  Chris Dumez  <[email protected]>
+
+        Stop using RefPtr::release()
+        https://bugs.webkit.org/show_bug.cgi?id=172074
+
+        Reviewed by Geoffrey Garen.
+
+        * wtf/win/WorkQueueWin.cpp:
+        (WTF::WorkQueue::dispatchAfter):
+
 2017-05-13  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r216808.

Modified: trunk/Source/WTF/wtf/win/WorkQueueWin.cpp (216832 => 216833)


--- trunk/Source/WTF/wtf/win/WorkQueueWin.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WTF/wtf/win/WorkQueueWin.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -187,7 +187,7 @@
     }
 
     // The timer callback will handle destroying context.
-    context.release().leakRef();
+    context.leakRef();
 }
 
 } // namespace WTF

Modified: trunk/Source/WebCore/ChangeLog (216832 => 216833)


--- trunk/Source/WebCore/ChangeLog	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/ChangeLog	2017-05-14 04:04:35 UTC (rev 216833)
@@ -1,3 +1,39 @@
+2017-05-13  Chris Dumez  <[email protected]>
+
+        Stop using RefPtr::release()
+        https://bugs.webkit.org/show_bug.cgi?id=172074
+
+        Reviewed by Geoffrey Garen.
+
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::FontVariantLigaturesParser::finalizeValue):
+        (WebCore::FontVariantNumericParser::finalizeValue):
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::create):
+        * loader/archive/mhtml/MHTMLArchive.cpp:
+        (WebCore::MHTMLArchive::generateMHTMLData):
+        * loader/archive/mhtml/MHTMLArchive.h:
+        * loader/archive/mhtml/MHTMLParser.cpp:
+        (WebCore::MHTMLParser::parseArchiveWithHeader):
+        * platform/audio/ios/AudioFileReaderIOS.cpp:
+        (WebCore::AudioFileReader::createBus):
+        * platform/glib/SharedBufferGlib.cpp:
+        (WebCore::SharedBuffer::createFromReadingFile):
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::CACFLayerTreeHost::create):
+        * platform/graphics/cairo/CairoUtilities.cpp:
+        (WebCore::copyCairoImageSurface):
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::getImageData):
+        * platform/graphics/gtk/IconGtk.cpp:
+        (WebCore::Icon::createIconForFiles):
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::systemFallbackForCharacters):
+        * platform/win/SharedBufferWin.cpp:
+        (WebCore::SharedBuffer::createFromReadingFile):
+
 2017-05-13  Javier Fernandez  <[email protected]>
 
         [css-align] Implement the place-self shorthand

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (216832 => 216833)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -630,7 +630,7 @@
     {
         if (!m_result->length())
             return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
-        return m_result.release();
+        return WTFMove(m_result);
     }
 
 private:
@@ -832,7 +832,7 @@
     {
         if (!m_result->length())
             return CSSValuePool::singleton().createIdentifierValue(CSSValueNormal);
-        return m_result.release();
+        return WTFMove(m_result);
     }
 
 

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (216832 => 216833)


--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -93,7 +93,7 @@
         if (!m_calcValue)
             return nullptr;
         m_sourceRange = m_range;
-        return CSSValuePool::singleton().createValue(m_calcValue.release());
+        return CSSValuePool::singleton().createValue(WTFMove(m_calcValue));
     }
     RefPtr<CSSPrimitiveValue> consumeNumber()
     {

Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (216832 => 216833)


--- trunk/Source/WebCore/loader/SubresourceLoader.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -111,7 +111,7 @@
         // is disabled to avoid re-entering style selection from a different thread (see <rdar://problem/9121719>).
         // FIXME: This should be fixed for all ports in <https://bugs.webkit.org/show_bug.cgi?id=56647>.
         subloader->m_iOSOriginalRequest = request;
-        return subloader.release();
+        return subloader;
     }
 #endif
     if (!subloader->init(request))

Modified: trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp (216832 => 216833)


--- trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -130,7 +130,7 @@
     return mainArchive;
 }
 
-RefPtr<SharedBuffer> MHTMLArchive::generateMHTMLData(Page* page)
+Ref<SharedBuffer> MHTMLArchive::generateMHTMLData(Page* page)
 {
     Vector<PageSerializer::Resource> resources;
     PageSerializer pageSerializer(resources);
@@ -162,7 +162,7 @@
     // We use utf8() below instead of ascii() as ascii() replaces CRLFs with ?? (we still only have put ASCII characters in it).
     ASSERT(stringBuilder.toString().containsOnlyASCII());
     CString asciiString = stringBuilder.toString().utf8();
-    RefPtr<SharedBuffer> mhtmlData = SharedBuffer::create();
+    auto mhtmlData = SharedBuffer::create();
     mhtmlData->append(asciiString.data(), asciiString.length());
 
     for (auto& resource : resources) {
@@ -213,7 +213,7 @@
     asciiString = makeString("--", boundary, "--\r\n").utf8();
     mhtmlData->append(asciiString.data(), asciiString.length());
 
-    return mhtmlData.release();
+    return mhtmlData;
 }
 
 }

Modified: trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.h (216832 => 216833)


--- trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.h	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/loader/archive/mhtml/MHTMLArchive.h	2017-05-14 04:04:35 UTC (rev 216833)
@@ -45,7 +45,7 @@
     static Ref<MHTMLArchive> create();
     static RefPtr<MHTMLArchive> create(const URL&, SharedBuffer&);
 
-    static RefPtr<SharedBuffer> generateMHTMLData(Page*);
+    static Ref<SharedBuffer> generateMHTMLData(Page*);
 
     virtual ~MHTMLArchive();
 

Modified: trunk/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp (216832 => 216833)


--- trunk/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/loader/archive/mhtml/MHTMLParser.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -68,7 +68,7 @@
         return nullptr;
     }
 
-    RefPtr<MHTMLArchive> archive = MHTMLArchive::create();
+    auto archive = MHTMLArchive::create();
     if (!header->isMultipart()) {
         // With IE a page with no resource is not multi-part.
         bool endOfArchiveReached = false;
@@ -76,7 +76,7 @@
         if (!resource)
             return nullptr;
         archive->setMainResource(resource.releaseNonNull());
-        return archive;
+        return WTFMove(archive);
     }
 
     // Skip the message content (it's a generic browser specific message).
@@ -100,7 +100,7 @@
             ASSERT_UNUSED(endOfPartReached, endOfPartReached);
             // The top-frame is the first frame found, regardless of the nesting level.
             if (subframeArchive->mainResource())
-                addResourceToArchive(subframeArchive->mainResource(), archive.get());
+                addResourceToArchive(subframeArchive->mainResource(), archive.ptr());
             archive->addSubframeArchive(subframeArchive.releaseNonNull());
             continue;
         }
@@ -110,10 +110,10 @@
             LOG_ERROR("Failed to parse MHTML part.");
             return nullptr;
         }
-        addResourceToArchive(resource.get(), archive.get());
+        addResourceToArchive(resource.get(), archive.ptr());
     }
 
-    return archive.release();
+    return WTFMove(archive);
 }
 
 void MHTMLParser::addResourceToArchive(ArchiveResource* resource, MHTMLArchive* archive)

Modified: trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.cpp (216832 => 216833)


--- trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -177,7 +177,7 @@
     size_t busChannelCount = mixToMono ? 1 : numberOfChannels;
 
     // Create AudioBus where we'll put the PCM audio data
-    RefPtr<AudioBus> audioBus = AudioBus::create(busChannelCount, numberOfFrames);
+    auto audioBus = AudioBus::create(busChannelCount, numberOfFrames);
     audioBus->setSampleRate(m_clientDataFormat.mSampleRate); // save for later
 
     // Only allocated in the mixToMono case; deallocated on destruction.
@@ -228,7 +228,7 @@
 
     destroyAudioBufferList(bufferList);
 
-    return audioBus.release();
+    return audioBus;
 }
 
 RefPtr<AudioBus> createBusFromAudioFile(const char* filePath, bool mixToMono, float sampleRate)

Modified: trunk/Source/WebCore/platform/glib/SharedBufferGlib.cpp (216832 => 216833)


--- trunk/Source/WebCore/platform/glib/SharedBufferGlib.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/platform/glib/SharedBufferGlib.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -31,7 +31,7 @@
 RefPtr<SharedBuffer> SharedBuffer::createFromReadingFile(const String& filePath)
 {
     if (filePath.isEmpty())
-        return 0;
+        return nullptr;
 
     CString filename = fileSystemRepresentation(filePath);
     GUniqueOutPtr<gchar> contents;
@@ -39,12 +39,10 @@
     GUniqueOutPtr<GError> error;
     if (!g_file_get_contents(filename.data(), &contents.outPtr(), &size, &error.outPtr())) {
         LOG_ERROR("Failed to fully read contents of file %s - %s", filenameForDisplay(filePath).utf8().data(), error->message);
-        return 0;
+        return nullptr;
     }
 
-    RefPtr<SharedBuffer> result = SharedBuffer::create(contents.get(), size);
-
-    return result.release();
+    return SharedBuffer::create(contents.get(), size);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp (216832 => 216833)


--- trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -131,7 +131,7 @@
         return nullptr;
     }
     host->initialize();
-    return host.release();
+    return host;
 }
 
 CACFLayerTreeHost::CACFLayerTreeHost()

Modified: trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp (216832 => 216833)


--- trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -282,7 +282,7 @@
     cairo_set_source_surface(cr.get(), originalSurface, 0, 0);
     cairo_set_operator(cr.get(), CAIRO_OPERATOR_SOURCE);
     cairo_paint(cr.get());
-    return newSurface.release();
+    return newSurface;
 }
 
 void copyRectFromCairoSurfaceToContext(cairo_surface_t* from, cairo_t* to, const IntSize& offset, const IntRect& rect)

Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (216832 => 216833)


--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -333,7 +333,7 @@
 template <Multiply multiplied>
 RefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, const IntRect& logicalRect, const ImageBufferData& data, const IntSize& size, const IntSize& logicalSize, float resolutionScale)
 {
-    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
+    auto result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
     if (!result)
         return nullptr;
 
@@ -410,7 +410,7 @@
         destRows += destBytesPerRow;
     }
 
-    return result.release();
+    return result;
 }
 
 template<typename Unit>

Modified: trunk/Source/WebCore/platform/graphics/gtk/IconGtk.cpp (216832 => 216833)


--- trunk/Source/WebCore/platform/graphics/gtk/IconGtk.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/platform/graphics/gtk/IconGtk.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -93,11 +93,11 @@
 RefPtr<Icon> Icon::createIconForFiles(const Vector<String>& filenames)
 {
     if (filenames.isEmpty())
-        return 0;
+        return nullptr;
 
     if (filenames.size() == 1) {
         if (!g_path_skip_root(filenames[0].utf8().data()))
-            return 0;
+            return nullptr;
 
         String MIMEType = MIMETypeRegistry::getMIMETypeForPath(filenames[0]);
         String iconName = lookupIconName(MIMEType);
@@ -105,8 +105,8 @@
         RefPtr<Icon> icon = adoptRef(new Icon);
         icon->m_icon = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), iconName.utf8().data(), 16, GTK_ICON_LOOKUP_USE_BUILTIN, 0);
         if (!icon->m_icon)
-            return 0;
-        return icon.release();
+            return nullptr;
+        return icon;
     }
 
     //FIXME: Implement this

Modified: trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp (216832 => 216833)


--- trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -319,7 +319,7 @@
         DeleteObject(hfont);
     }
 
-    return fontData.release();
+    return fontData;
 }
 
 Vector<String> FontCache::systemFontFamilies()

Modified: trunk/Source/WebCore/platform/win/SharedBufferWin.cpp (216832 => 216833)


--- trunk/Source/WebCore/platform/win/SharedBufferWin.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebCore/platform/win/SharedBufferWin.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -36,13 +36,13 @@
 RefPtr<SharedBuffer> SharedBuffer::createFromReadingFile(const String& filePath)
 {
     if (filePath.isEmpty())
-        return 0;
+        return nullptr;
 
     String nullifiedPath = filePath;
     HANDLE fileHandle = CreateFileW(nullifiedPath.charactersWithNullTermination().data(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
     if (fileHandle == INVALID_HANDLE_VALUE) {
         LOG_ERROR("Failed to open file %s to create shared buffer, GetLastError() = %u", filePath.ascii().data(), GetLastError());
-        return 0;
+        return nullptr;
     }
 
     RefPtr<SharedBuffer> result;
@@ -60,7 +60,7 @@
         LOG_ERROR("Failed to get filesize of file %s, GetLastError() = %u", filePath.ascii().data(), lastError);
 
     CloseHandle(fileHandle);
-    return result.release();
+    return result;
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebKit/win/ChangeLog (216832 => 216833)


--- trunk/Source/WebKit/win/ChangeLog	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit/win/ChangeLog	2017-05-14 04:04:35 UTC (rev 216833)
@@ -1,5 +1,18 @@
 2017-05-13  Chris Dumez  <[email protected]>
 
+        Stop using RefPtr::release()
+        https://bugs.webkit.org/show_bug.cgi?id=172074
+
+        Reviewed by Geoffrey Garen.
+
+        * WebFrame.cpp:
+        (WebFrame::loadPlainTextString):
+        (WebFrame::loadHTMLString):
+        * WebFramePolicyListener.cpp:
+        (WebFramePolicyListener::receivedPolicyDecision):
+
+2017-05-13  Chris Dumez  <[email protected]>
+
         Drop uses of PassRefPtr in WebKit/win
         https://bugs.webkit.org/show_bug.cgi?id=172067
 

Modified: trunk/Source/WebKit/win/WebFrame.cpp (216832 => 216833)


--- trunk/Source/WebKit/win/WebFrame.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit/win/WebFrame.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -614,7 +614,7 @@
     RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<char*>(plainText), sizeof(UChar) * SysStringLen(plainText));
     BString plainTextMimeType(TEXT("text/plain"), 10);
     BString utf16Encoding(TEXT("utf-16"), 6);
-    loadData(sharedBuffer.release(), plainTextMimeType, utf16Encoding, url, nullptr);
+    loadData(WTFMove(sharedBuffer), plainTextMimeType, utf16Encoding, url, nullptr);
     return S_OK;
 }
 
@@ -622,7 +622,7 @@
 {
     RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<char*>(htmlString), sizeof(UChar) * SysStringLen(htmlString));
     BString utf16Encoding(TEXT("utf-16"), 6);
-    loadData(sharedBuffer.release(), 0, utf16Encoding, baseURL, unreachableURL);
+    loadData(WTFMove(sharedBuffer), 0, utf16Encoding, baseURL, unreachableURL);
 }
 
 HRESULT WebFrame::loadHTMLString(_In_ BSTR htmlString, _In_ BSTR baseURL)

Modified: trunk/Source/WebKit/win/WebFramePolicyListener.cpp (216832 => 216833)


--- trunk/Source/WebKit/win/WebFramePolicyListener.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit/win/WebFramePolicyListener.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -120,7 +120,7 @@
 // WebFramePolicyListener ----------------------------------------------------------------
 void WebFramePolicyListener::receivedPolicyDecision(PolicyAction action)
 {
-    RefPtr<Frame> frame = m_frame.release();
+    RefPtr<Frame> frame = WTFMove(m_frame);
     if (frame)
         static_cast<WebFrameLoaderClient&>(frame->loader().client()).receivedPolicyDecision(action);
 }

Modified: trunk/Source/WebKit2/ChangeLog (216832 => 216833)


--- trunk/Source/WebKit2/ChangeLog	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-14 04:04:35 UTC (rev 216833)
@@ -1,3 +1,21 @@
+2017-05-13  Chris Dumez  <[email protected]>
+
+        Stop using RefPtr::release()
+        https://bugs.webkit.org/show_bug.cgi?id=172074
+
+        Reviewed by Geoffrey Garen.
+
+        * Platform/unix/SharedMemoryUnix.cpp:
+        (WebKit::SharedMemory::create):
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::createImageBacking):
+        * Shared/cairo/ShareableBitmapCairo.cpp:
+        (WebKit::ShareableBitmap::createCairoSurface):
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
+        (WebKit::core):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::getContentsAsMHTMLData):
+
 2017-05-12  Chris Dumez  <[email protected]>
 
         Drop remaining uses of PassRefPtr in WebKit2/WebProcess

Modified: trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp (216832 => 216833)


--- trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -122,7 +122,7 @@
     }
     if (fileDescriptor == -1) {
         WTFLogAlways("Failed to create shared memory file %s: %s", tempName.data(), strerror(errno));
-        return 0;
+        return nullptr;
     }
 
     while (ftruncate(fileDescriptor, size) == -1) {
@@ -129,7 +129,7 @@
         if (errno != EINTR) {
             closeWithRetry(fileDescriptor);
             shm_unlink(tempName.data());
-            return 0;
+            return nullptr;
         }
     }
 
@@ -137,7 +137,7 @@
     if (data == MAP_FAILED) {
         closeWithRetry(fileDescriptor);
         shm_unlink(tempName.data());
-        return 0;
+        return nullptr;
     }
 
     shm_unlink(tempName.data());
@@ -146,7 +146,7 @@
     instance->m_data = data;
     instance->m_fileDescriptor = fileDescriptor;
     instance->m_size = size;
-    return instance.release();
+    return instance;
 }
 
 RefPtr<SharedMemory> SharedMemory::allocate(size_t size)

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (216832 => 216833)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -463,8 +463,7 @@
 void CoordinatedGraphicsScene::createImageBacking(CoordinatedImageBackingID imageID)
 {
     ASSERT(!m_imageBackings.contains(imageID));
-    RefPtr<CoordinatedBackingStore> backingStore(CoordinatedBackingStore::create());
-    m_imageBackings.add(imageID, backingStore.release());
+    m_imageBackings.add(imageID, CoordinatedBackingStore::create());
 }
 
 void CoordinatedGraphicsScene::updateImageBacking(CoordinatedImageBackingID imageID, RefPtr<CoordinatedSurface>&& surface)

Modified: trunk/Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp (216832 => 216833)


--- trunk/Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -79,7 +79,7 @@
     ref(); // Balanced by deref in releaseSurfaceData.
     static cairo_user_data_key_t dataKey;
     cairo_surface_set_user_data(image.get(), &dataKey, this, releaseSurfaceData);
-    return image.release();
+    return image;
 }
 
 void ShareableBitmap::releaseSurfaceData(void* typelessBitmap)

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp (216832 => 216833)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -77,7 +77,7 @@
         g_object_weak_ref(G_OBJECT(nodeFilter), nodeFilterObjectDestroyedCallback, coreNodeFilter.get());
         g_object_set_data(G_OBJECT(nodeFilter), "webkit-core-node-filter", coreNodeFilter.get());
     }
-    return coreNodeFilter.release();
+    return coreNodeFilter;
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (216832 => 216833)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -2870,12 +2870,11 @@
 #if ENABLE(MHTML)
 void WebPage::getContentsAsMHTMLData(uint64_t callbackID)
 {
-    RefPtr<SharedBuffer> buffer = MHTMLArchive::generateMHTMLData(m_page.get());
+    auto buffer = MHTMLArchive::generateMHTMLData(m_page.get());
 
     // FIXME: Use SharedBufferDataReference.
     IPC::DataReference dataReference;
-    if (buffer)
-        dataReference = IPC::DataReference(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
+    dataReference = IPC::DataReference(reinterpret_cast<const uint8_t*>(buffer->data()), buffer->size());
     send(Messages::WebPageProxy::DataCallback(dataReference, callbackID));
 }
 #endif

Modified: trunk/Tools/ChangeLog (216832 => 216833)


--- trunk/Tools/ChangeLog	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Tools/ChangeLog	2017-05-14 04:04:35 UTC (rev 216833)
@@ -1,3 +1,13 @@
+2017-05-13  Chris Dumez  <[email protected]>
+
+        Stop using RefPtr::release()
+        https://bugs.webkit.org/show_bug.cgi?id=172074
+
+        Reviewed by Geoffrey Garen.
+
+        * TestWebKitAPI/Tests/WTF/RefPtr.cpp:
+        (TestWebKitAPI::TEST):
+
 2017-05-13  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r216808.

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp (216832 => 216833)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp	2017-05-14 02:20:04 UTC (rev 216832)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp	2017-05-14 04:04:35 UTC (rev 216833)
@@ -108,14 +108,6 @@
         ASSERT_EQ(nullptr, ptr.get());
     }
     ASSERT_STREQ("ref(a) deref(a) ", takeLogStr().c_str());
-
-    {
-        RefPtr<RefLogger> ptr(&a);
-        ASSERT_EQ(&a, ptr.get());
-        ptr.release();
-        ASSERT_EQ(nullptr, ptr.get());
-    }
-    ASSERT_STREQ("ref(a) deref(a) ", takeLogStr().c_str());
 }
 
 TEST(WTF_RefPtr, AssignPassRefToRefPtr)
@@ -125,8 +117,6 @@
         Ref<RefLogger> passRef(a);
         RefPtr<RefLogger> ptr = WTFMove(passRef);
         ASSERT_EQ(&a, ptr.get());
-        ptr.release();
-        ASSERT_EQ(nullptr, ptr.get());
     }
     ASSERT_STREQ("ref(a) deref(a) ", takeLogStr().c_str());
 }
@@ -336,7 +326,7 @@
 
     {
         RefPtr<RefLogger> p1 = &a;
-        RefPtr<RefLogger> p2 = p1.release();
+        RefPtr<RefLogger> p2 = WTFMove(p1);
         ASSERT_EQ(nullptr, p1.get());
         ASSERT_EQ(&a, p2.get());
     }
@@ -344,7 +334,7 @@
 
     {
         RefPtr<RefLogger> p1 = &a;
-        RefPtr<RefLogger> p2(p1.release());
+        RefPtr<RefLogger> p2(WTFMove(p1));
         ASSERT_EQ(nullptr, p1.get());
         ASSERT_EQ(&a, p2.get());
     }
@@ -352,7 +342,7 @@
 
     {
         RefPtr<DerivedRefLogger> p1 = &a;
-        RefPtr<RefLogger> p2 = p1.release();
+        RefPtr<RefLogger> p2 = WTFMove(p1);
         ASSERT_EQ(nullptr, p1.get());
         ASSERT_EQ(&a, p2.get());
     }
@@ -364,7 +354,7 @@
         ASSERT_EQ(&a, p1.get());
         ASSERT_EQ(&b, p2.get());
         log() << "| ";
-        p1 = p2.release();
+        p1 = WTFMove(p2);
         ASSERT_EQ(&b, p1.get());
         ASSERT_EQ(nullptr, p2.get());
         log() << "| ";
@@ -377,7 +367,7 @@
         ASSERT_EQ(&a, p1.get());
         ASSERT_EQ(&c, p2.get());
         log() << "| ";
-        p1 = p2.release();
+        p1 = WTFMove(p2);
         ASSERT_EQ(&c, p1.get());
         ASSERT_EQ(nullptr, p2.get());
         log() << "| ";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to