Title: [274306] trunk/Source
Revision
274306
Author
[email protected]
Date
2021-03-11 15:59:14 -0800 (Thu, 11 Mar 2021)

Log Message

Use CallOnMainThreadAndWait() instead of CallAndMainThread() + BinarySemaphore
https://bugs.webkit.org/show_bug.cgi?id=223093

Reviewed by Geoffrey Garen.

Source/WebCore:

* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::process):
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::blobSize):
* platform/glib/FileMonitorGLib.cpp:
* platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
* platform/mock/MockAudioDestinationCocoa.cpp:

Source/WebKit:

* NetworkProcess/WebStorage/StorageManagerSet.cpp:
* UIProcess/API/glib/IconDatabase.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (274305 => 274306)


--- trunk/Source/WebCore/ChangeLog	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebCore/ChangeLog	2021-03-11 23:59:14 UTC (rev 274306)
@@ -1,3 +1,18 @@
+2021-03-11  Chris Dumez  <[email protected]>
+
+        Use CallOnMainThreadAndWait() instead of CallAndMainThread() + BinarySemaphore
+        https://bugs.webkit.org/show_bug.cgi?id=223093
+
+        Reviewed by Geoffrey Garen.
+
+        * Modules/webaudio/ScriptProcessorNode.cpp:
+        (WebCore::ScriptProcessorNode::process):
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::ThreadableBlobRegistry::blobSize):
+        * platform/glib/FileMonitorGLib.cpp:
+        * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm:
+        * platform/mock/MockAudioDestinationCocoa.cpp:
+
 2021-03-11  Wenson Hsieh  <[email protected]>
 
         [macOS] Selecting text via mouse drag in image documents shouldn't trigger click events

Modified: trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp (274305 => 274306)


--- trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebCore/Modules/webaudio/ScriptProcessorNode.cpp	2021-03-11 23:59:14 UTC (rev 274306)
@@ -40,7 +40,6 @@
 #include <_javascript_Core/Float32Array.h>
 #include <wtf/IsoMallocInlines.h>
 #include <wtf/MainThread.h>
-#include <wtf/threads/BinarySemaphore.h>
 
 namespace WebCore {
 
@@ -219,12 +218,9 @@
         // Reference ourself so we don't accidentally get deleted before fireProcessEvent() gets called.
         // We only wait for script code execution when the context is an offline one for performance reasons.
         if (context().isOfflineContext()) {
-            BinarySemaphore semaphore;
-            callOnMainThread([this, &semaphore, doubleBufferIndex = m_doubleBufferIndex, protector = makeRef(*this)] {
+            callOnMainThreadAndWait([this, doubleBufferIndex = m_doubleBufferIndex, protector = makeRef(*this)] {
                 fireProcessEvent(doubleBufferIndex);
-                semaphore.signal();
             });
-            semaphore.wait();
         } else {
             callOnMainThread([this, doubleBufferIndex = m_doubleBufferIndex, protector = makeRef(*this)] {
                 auto locker = holdLock(m_processLock);

Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (274305 => 274306)


--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp	2021-03-11 23:59:14 UTC (rev 274306)
@@ -142,12 +142,9 @@
         return blobRegistry().blobSize(url);
 
     unsigned long long resultSize;
-    BinarySemaphore semaphore;
-    callOnMainThread([url = "" &semaphore, &resultSize] {
+    callOnMainThreadAndWait([url = "" &resultSize] {
         resultSize = blobRegistry().blobSize(url);
-        semaphore.signal();
     });
-    semaphore.wait();
     return resultSize;
 }
 

Modified: trunk/Source/WebCore/platform/glib/FileMonitorGLib.cpp (274305 => 274306)


--- trunk/Source/WebCore/platform/glib/FileMonitorGLib.cpp	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebCore/platform/glib/FileMonitorGLib.cpp	2021-03-11 23:59:14 UTC (rev 274306)
@@ -28,7 +28,6 @@
 
 #include <wtf/FileSystem.h>
 #include <wtf/glib/GUniquePtr.h>
-#include <wtf/threads/BinarySemaphore.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm (274305 => 274306)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm	2021-03-11 23:59:14 UTC (rev 274306)
@@ -40,7 +40,6 @@
 #import <wtf/MainThread.h>
 #import <wtf/MonotonicTime.h>
 #import <wtf/cf/TypeCastsCF.h>
-#import <wtf/threads/BinarySemaphore.h>
 
 #import <pal/cocoa/AVFoundationSoftLink.h>
 

Modified: trunk/Source/WebCore/platform/mock/MockAudioDestinationCocoa.cpp (274305 => 274306)


--- trunk/Source/WebCore/platform/mock/MockAudioDestinationCocoa.cpp	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebCore/platform/mock/MockAudioDestinationCocoa.cpp	2021-03-11 23:59:14 UTC (rev 274306)
@@ -30,7 +30,6 @@
 
 #include "CAAudioStreamDescription.h"
 #include "WebAudioBufferList.h"
-#include <wtf/threads/BinarySemaphore.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebKit/ChangeLog (274305 => 274306)


--- trunk/Source/WebKit/ChangeLog	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebKit/ChangeLog	2021-03-11 23:59:14 UTC (rev 274306)
@@ -1,3 +1,13 @@
+2021-03-11  Chris Dumez  <[email protected]>
+
+        Use CallOnMainThreadAndWait() instead of CallAndMainThread() + BinarySemaphore
+        https://bugs.webkit.org/show_bug.cgi?id=223093
+
+        Reviewed by Geoffrey Garen.
+
+        * NetworkProcess/WebStorage/StorageManagerSet.cpp:
+        * UIProcess/API/glib/IconDatabase.cpp:
+
 2021-03-11  Tim Horton  <[email protected]>
 
         Adopt WKSeparatedModelView for <model>

Modified: trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManagerSet.cpp (274305 => 274306)


--- trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManagerSet.cpp	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManagerSet.cpp	2021-03-11 23:59:14 UTC (rev 274306)
@@ -31,7 +31,6 @@
 #include "StorageManagerSetMessages.h"
 #include <WebCore/TextEncoding.h>
 #include <wtf/CrossThreadCopier.h>
-#include <wtf/threads/BinarySemaphore.h>
 
 namespace WebKit {
 

Modified: trunk/Source/WebKit/UIProcess/API/glib/IconDatabase.cpp (274305 => 274306)


--- trunk/Source/WebKit/UIProcess/API/glib/IconDatabase.cpp	2021-03-11 23:55:40 UTC (rev 274305)
+++ trunk/Source/WebKit/UIProcess/API/glib/IconDatabase.cpp	2021-03-11 23:59:14 UTC (rev 274306)
@@ -28,7 +28,6 @@
 #include <wtf/FileSystem.h>
 #include <wtf/RunLoop.h>
 #include <wtf/glib/RunLoopSourcePriority.h>
-#include <wtf/threads/BinarySemaphore.h>
 
 namespace WebKit {
 using namespace WebCore;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to