Style fix. Replace strongThis with protectedThis.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jul 2017 18:21:33 +0000 (18:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jul 2017 18:21:33 +0000 (18:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174444

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-13
Reviewed by Eric Carlson.

Rename, no behavior change.

Source/WebCore:

* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::finish):
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
(WebCore::WebCoreDecompressionSession::enqueueSample):
(WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
(WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
(WebCore::WebCoreDecompressionSession::requestMediaDataWhenReady):
(WebCore::WebCoreDecompressionSession::flush):

Source/WebKit2:

* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::didSetupFullscreen):
(WebKit::WebVideoFullscreenManager::didEnterFullscreen):
(WebKit::WebVideoFullscreenManager::didExitFullscreen):
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen):

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp
Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm

index 4403c02..29a9c34 100644 (file)
@@ -1,5 +1,24 @@
 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
 
+        Style fix. Replace strongThis with protectedThis.
+        https://bugs.webkit.org/show_bug.cgi?id=174444
+
+        Reviewed by Eric Carlson.
+
+        Rename, no behavior change.
+
+        * Modules/webaudio/AudioScheduledSourceNode.cpp:
+        (WebCore::AudioScheduledSourceNode::finish):
+        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
+        (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
+        (WebCore::WebCoreDecompressionSession::enqueueSample):
+        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
+        (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
+        (WebCore::WebCoreDecompressionSession::requestMediaDataWhenReady):
+        (WebCore::WebCoreDecompressionSession::flush):
+
+2017-07-13  Jeremy Jones  <jeremyj@apple.com>
+
         Fix block style in WebVideoFullscreen classes.
         https://bugs.webkit.org/show_bug.cgi?id=174446
 
index e2cfc90..da07567 100644 (file)
@@ -167,8 +167,8 @@ void AudioScheduledSourceNode::finish()
     }
 
     if (m_hasEndedListener) {
-        callOnMainThread([strongThis = makeRef(*this)] () mutable {
-            strongThis->dispatchEvent(Event::create(eventNames().endedEvent, false, false));
+        callOnMainThread([protectedThis = makeRef(*this)] () mutable {
+            protectedThis->dispatchEvent(Event::create(eventNames().endedEvent, false, false));
         });
     }
 }
index 258f949..e7febc9 100644 (file)
@@ -102,10 +102,10 @@ void WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData()
         return;
     }
 
-    RefPtr<WebCoreDecompressionSession> strongThis { this };
-    dispatch_async(dispatch_get_main_queue(), [strongThis] {
-        if (strongThis->m_notificationCallback)
-            strongThis->m_notificationCallback();
+    RefPtr<WebCoreDecompressionSession> protectedThis { this };
+    dispatch_async(dispatch_get_main_queue(), [protectedThis] {
+        if (protectedThis->m_notificationCallback)
+            protectedThis->m_notificationCallback();
     });
 }
 
@@ -175,8 +175,8 @@ void WebCoreDecompressionSession::enqueueSample(CMSampleBufferRef sampleBuffer,
 
     LOG(Media, "WebCoreDecompressionSession::enqueueSample(%p) - framesBeingDecoded(%d)", this, m_framesBeingDecoded);
 
-    dispatch_async(m_decompressionQueue.get(), [strongThis = makeRefPtr(*this), strongBuffer = retainPtr(sampleBuffer), displaying] {
-        strongThis->decodeSample(strongBuffer.get(), displaying);
+    dispatch_async(m_decompressionQueue.get(), [protectedThis = makeRefPtr(*this), strongBuffer = retainPtr(sampleBuffer), displaying] {
+        protectedThis->decodeSample(strongBuffer.get(), displaying);
     });
 }
 
@@ -238,11 +238,11 @@ void WebCoreDecompressionSession::handleDecompressionOutput(bool displaying, OSS
     CMSampleBufferRef rawImageSampleBuffer = nullptr;
     if (noErr != CMSampleBufferCreateReadyWithImageBuffer(kCFAllocatorDefault, rawImageBuffer, imageBufferDescription.get(), &imageBufferTiming, &rawImageSampleBuffer))
         return;
-    RefPtr<WebCoreDecompressionSession> strongThis { this };
+    RefPtr<WebCoreDecompressionSession> protectedThis { this };
     RetainPtr<CMSampleBufferRef> imageSampleBuffer = adoptCF(rawImageSampleBuffer);
-    dispatch_async(m_enqueingQueue.get(), [strongThis, status, imageSampleBuffer, infoFlags, displaying] {
+    dispatch_async(m_enqueingQueue.get(), [protectedThis, status, imageSampleBuffer, infoFlags, displaying] {
         UNUSED_PARAM(infoFlags);
-        strongThis->enqueueDecodedSample(imageSampleBuffer.get(), displaying);
+        protectedThis->enqueueDecodedSample(imageSampleBuffer.get(), displaying);
     });
 }
 
@@ -314,8 +314,8 @@ void WebCoreDecompressionSession::enqueueDecodedSample(CMSampleBufferRef sample,
     if (m_hasAvailableFrameCallback) {
         std::function<void()> callback { m_hasAvailableFrameCallback };
         m_hasAvailableFrameCallback = nullptr;
-        RefPtr<WebCoreDecompressionSession> strongThis { this };
-        dispatch_async(dispatch_get_main_queue(), [strongThis, callback] {
+        RefPtr<WebCoreDecompressionSession> protectedThis { this };
+        dispatch_async(dispatch_get_main_queue(), [protectedThis, callback] {
             callback();
         });
     }
@@ -333,10 +333,10 @@ void WebCoreDecompressionSession::requestMediaDataWhenReady(std::function<void()
     m_notificationCallback = notificationCallback;
 
     if (notificationCallback && isReadyForMoreMediaData()) {
-        RefPtr<WebCoreDecompressionSession> strongThis { this };
-        dispatch_async(dispatch_get_main_queue(), [strongThis] {
-            if (strongThis->m_notificationCallback)
-                strongThis->m_notificationCallback();
+        RefPtr<WebCoreDecompressionSession> protectedThis { this };
+        dispatch_async(dispatch_get_main_queue(), [protectedThis] {
+            if (protectedThis->m_notificationCallback)
+                protectedThis->m_notificationCallback();
         });
     }
 }
@@ -406,10 +406,10 @@ RetainPtr<CVPixelBufferRef> WebCoreDecompressionSession::imageForTime(const Medi
 
 void WebCoreDecompressionSession::flush()
 {
-    dispatch_sync(m_decompressionQueue.get(), [strongThis = RefPtr<WebCoreDecompressionSession>(this)] {
-        CMBufferQueueReset(strongThis->m_producerQueue.get());
-        dispatch_sync(strongThis->m_enqueingQueue.get(), [strongThis] {
-            CMBufferQueueReset(strongThis->m_consumerQueue.get());
+    dispatch_sync(m_decompressionQueue.get(), [protectedThis = RefPtr<WebCoreDecompressionSession>(this)] {
+        CMBufferQueueReset(protectedThis->m_producerQueue.get());
+        dispatch_sync(protectedThis->m_enqueingQueue.get(), [protectedThis] {
+            CMBufferQueueReset(protectedThis->m_consumerQueue.get());
         });
     });
 }
index 27465f4..1a12aa4 100644 (file)
@@ -1,3 +1,18 @@
+2017-07-13  Jeremy Jones  <jeremyj@apple.com>
+
+        Style fix. Replace strongThis with protectedThis.
+        https://bugs.webkit.org/show_bug.cgi?id=174444
+
+        Reviewed by Eric Carlson.
+
+        Rename, no behavior change.
+
+        * WebProcess/cocoa/WebVideoFullscreenManager.mm:
+        (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
+        (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
+        (WebKit::WebVideoFullscreenManager::didExitFullscreen):
+        (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
+
 2017-07-13  Chris Dumez  <cdumez@apple.com>
 
         Moved filesystem code out of WebResourceLoadStatisticsStore class
index df46174..24c98ca 100644 (file)
@@ -339,12 +339,12 @@ void WebVideoFullscreenManager::didSetupFullscreen(uint64_t contextId)
 
     interface->layerHostingContext()->setRootLayer(videoLayer);
 
-    RefPtr<WebVideoFullscreenManager> strongThis(this);
+    RefPtr<WebVideoFullscreenManager> protectedThis(this);
     
-    model->setVideoFullscreenLayer(videoLayer, [strongThis, this, contextId] {
-        dispatch_async(dispatch_get_main_queue(), [strongThis, this, contextId] {
-            if (strongThis->m_page)
-                m_page->send(Messages::WebVideoFullscreenManagerProxy::EnterFullscreen(contextId), strongThis->m_page->pageID());
+    model->setVideoFullscreenLayer(videoLayer, [protectedThis, this, contextId] {
+        dispatch_async(dispatch_get_main_queue(), [protectedThis, this, contextId] {
+            if (protectedThis->m_page)
+                m_page->send(Messages::WebVideoFullscreenManagerProxy::EnterFullscreen(contextId), protectedThis->m_page->pageID());
         });
     });
     
@@ -368,10 +368,10 @@ void WebVideoFullscreenManager::didEnterFullscreen(uint64_t contextId)
         return;
 
     // exit fullscreen now if it was previously requested during an animation.
-    RefPtr<WebVideoFullscreenManager> strongThis(this);
-    dispatch_async(dispatch_get_main_queue(), [strongThis, videoElement] {
-        if (strongThis->m_page)
-            strongThis->exitVideoFullscreenForVideoElement(*videoElement);
+    RefPtr<WebVideoFullscreenManager> protectedThis(this);
+    dispatch_async(dispatch_get_main_queue(), [protectedThis, videoElement] {
+        if (protectedThis->m_page)
+            protectedThis->exitVideoFullscreenForVideoElement(*videoElement);
     });
 }
 
@@ -380,18 +380,18 @@ void WebVideoFullscreenManager::didExitFullscreen(uint64_t contextId)
     RefPtr<WebVideoFullscreenModelVideoElement> model;
     RefPtr<WebVideoFullscreenInterfaceContext> interface;
     std::tie(model, interface) = ensureModelAndInterface(contextId);
-    RefPtr<WebVideoFullscreenManager> strongThis(this);
+    RefPtr<WebVideoFullscreenManager> protectedThis(this);
     
-    model->waitForPreparedForInlineThen([strongThis, contextId, interface, model] {
-        dispatch_async(dispatch_get_main_queue(), [strongThis, contextId, interface, model] {
-            model->setVideoFullscreenLayer(nil, [strongThis, contextId, interface] {
-                dispatch_async(dispatch_get_main_queue(), [strongThis, contextId, interface] {
+    model->waitForPreparedForInlineThen([protectedThis, contextId, interface, model] {
+        dispatch_async(dispatch_get_main_queue(), [protectedThis, contextId, interface, model] {
+            model->setVideoFullscreenLayer(nil, [protectedThis, contextId, interface] {
+                dispatch_async(dispatch_get_main_queue(), [protectedThis, contextId, interface] {
                     if (interface->layerHostingContext()) {
                         interface->layerHostingContext()->setRootLayer(nullptr);
                         interface->setLayerHostingContext(nullptr);
                     }
-                    if (strongThis->m_page)
-                        strongThis->m_page->send(Messages::WebVideoFullscreenManagerProxy::CleanupFullscreen(contextId), strongThis->m_page->pageID());
+                    if (protectedThis->m_page)
+                        protectedThis->m_page->send(Messages::WebVideoFullscreenManagerProxy::CleanupFullscreen(contextId), protectedThis->m_page->pageID());
                 });
             });
         });
@@ -418,10 +418,10 @@ void WebVideoFullscreenManager::didCleanupFullscreen(uint64_t contextId)
     if (!videoElement || !targetIsFullscreen)
         return;
 
-    RefPtr<WebVideoFullscreenManager> strongThis(this);
-    dispatch_async(dispatch_get_main_queue(), [strongThis, videoElement, mode] {
-        if (strongThis->m_page)
-            strongThis->enterVideoFullscreenForVideoElement(*videoElement, mode);
+    RefPtr<WebVideoFullscreenManager> protectedThis(this);
+    dispatch_async(dispatch_get_main_queue(), [protectedThis, videoElement, mode] {
+        if (protectedThis->m_page)
+            protectedThis->enterVideoFullscreenForVideoElement(*videoElement, mode);
     });
 }