<https://webkit.org/b/183908>
<rdar://problem/
33553533>
Reviewed by Daniel Bates.
Source/ThirdParty/libwebrtc:
* Source/webrtc/rtc_base/task_queue_gcd.cc: Remove use of
dispatch_set_target_queue() by changing dispatch_queue_create()
to dispatch_queue_create_with_target().
* WebKit/0009-Remove-dispatch_set_target_queue.patch: Add patch.
Filed this to track upstreaming the change:
<https://bugs.chromium.org/p/webrtc/issues/detail?id=9055>
* WebKit/patch-libwebrtc: Delete empty patch file.
Source/WebCore:
No new tests since no change in behavior.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::globaVideoCaptureSerialQueue): Remove use of
dispatch_set_target_queue() by changing dispatch_queue_create()
to dispatch_queue_create_with_target().
Source/WebKit:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
dispatch_set_target_queue() since this is handled in the
dispatch_io_create() call above.
Source/WTF:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::platformInitialize): Remove !HAVE(QOS_CLASSES)
code path since it's never used now that HAVE(QOS_CLASSES) is
equivalent to PLATFORM(COCOA) in <wtf/Platform.h>.
Tools:
* Scripts/webkitpy/style/checkers/cpp.py:
(check_language): Add check for use of
dispatch_set_target_queue().
(CppChecker): Add 'runtime/dispatch_set_target_queue' category.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest): Add test.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229913
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-03-23 David Kilzer <ddkilzer@apple.com>
+
+ Stop using dispatch_set_target_queue()
+ <https://webkit.org/b/183908>
+ <rdar://problem/33553533>
+
+ Reviewed by Daniel Bates.
+
+ * Source/webrtc/rtc_base/task_queue_gcd.cc: Remove use of
+ dispatch_set_target_queue() by changing dispatch_queue_create()
+ to dispatch_queue_create_with_target().
+ * WebKit/0009-Remove-dispatch_set_target_queue.patch: Add patch.
+ Filed this to track upstreaming the change:
+ <https://bugs.chromium.org/p/webrtc/issues/detail?id=9055>
+ * WebKit/patch-libwebrtc: Delete empty patch file.
+
2018-03-23 Youenn Fablet <youenn@apple.com>
Use libwebrtc ObjectiveC H264 encoder and decoder
TaskQueue::Impl::Impl(const char* queue_name,
TaskQueue* task_queue,
Priority priority)
- : queue_(dispatch_queue_create(queue_name, DISPATCH_QUEUE_SERIAL)),
+ : queue_(dispatch_queue_create_with_target(queue_name, DISPATCH_QUEUE_SERIAL, dispatch_get_global_queue(TaskQueuePriorityToGCD(priority), 0))),
context_(new QueueContext(task_queue)) {
RTC_DCHECK(queue_name);
RTC_CHECK(queue_);
// to the queue is released. This may run after the TaskQueue object has
// been deleted.
dispatch_set_finalizer_f(queue_, &QueueContext::DeleteContext);
-
- dispatch_set_target_queue(
- queue_, dispatch_get_global_queue(TaskQueuePriorityToGCD(priority), 0));
}
TaskQueue::Impl::~Impl() {
--- /dev/null
+diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/task_queue_gcd.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/task_queue_gcd.cc
+index a13e088ede6..675b8005722 100644
+--- a/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/task_queue_gcd.cc
++++ b/Source/ThirdParty/libwebrtc/Source/webrtc/rtc_base/task_queue_gcd.cc
+@@ -139,7 +139,7 @@ class TaskQueue::Impl : public RefCountInterface {
+ TaskQueue::Impl::Impl(const char* queue_name,
+ TaskQueue* task_queue,
+ Priority priority)
+- : queue_(dispatch_queue_create(queue_name, DISPATCH_QUEUE_SERIAL)),
++ : queue_(dispatch_queue_create_with_target(queue_name, DISPATCH_QUEUE_SERIAL, dispatch_get_global_queue(TaskQueuePriorityToGCD(priority), 0))),
+ context_(new QueueContext(task_queue)) {
+ RTC_DCHECK(queue_name);
+ RTC_CHECK(queue_);
+@@ -148,9 +148,6 @@ TaskQueue::Impl::Impl(const char* queue_name,
+ // to the queue is released. This may run after the TaskQueue object has
+ // been deleted.
+ dispatch_set_finalizer_f(queue_, &QueueContext::DeleteContext);
+-
+- dispatch_set_target_queue(
+- queue_, dispatch_get_global_queue(TaskQueuePriorityToGCD(priority), 0));
+ }
+
+ TaskQueue::Impl::~Impl() {
+2018-03-23 David Kilzer <ddkilzer@apple.com>
+
+ Stop using dispatch_set_target_queue()
+ <https://webkit.org/b/183908>
+ <rdar://problem/33553533>
+
+ Reviewed by Daniel Bates.
+
+ * wtf/cocoa/WorkQueueCocoa.cpp:
+ (WTF::WorkQueue::platformInitialize): Remove !HAVE(QOS_CLASSES)
+ code path since it's never used now that HAVE(QOS_CLASSES) is
+ equivalent to PLATFORM(COCOA) in <wtf/Platform.h>.
+
2018-03-23 Carlos Alberto Lopez Perez <clopez@igalia.com>
WebProcess memory monitor thresholds should be better tuned for embedded systems.
void WorkQueue::platformInitialize(const char* name, Type type, QOS qos)
{
dispatch_queue_attr_t attr = type == Type::Concurrent ? DISPATCH_QUEUE_CONCURRENT : DISPATCH_QUEUE_SERIAL;
-#if HAVE(QOS_CLASSES)
attr = dispatch_queue_attr_make_with_qos_class(attr, dispatchQOSClass(qos), 0);
-#else
- UNUSED_PARAM(qos);
-#endif
m_dispatchQueue = dispatch_queue_create(name, attr);
-#if !HAVE(QOS_CLASSES)
- if (qos != WorkQueue::QOS::Default)
- dispatch_set_target_queue(m_dispatchQueue, targetQueueForQOSClass(qos));
-#endif
dispatch_set_context(m_dispatchQueue, this);
}
+2018-03-23 David Kilzer <ddkilzer@apple.com>
+
+ Stop using dispatch_set_target_queue()
+ <https://webkit.org/b/183908>
+ <rdar://problem/33553533>
+
+ Reviewed by Daniel Bates.
+
+ No new tests since no change in behavior.
+
+ * platform/mediastream/mac/AVMediaCaptureSource.mm:
+ (WebCore::globaVideoCaptureSerialQueue): Remove use of
+ dispatch_set_target_queue() by changing dispatch_queue_create()
+ to dispatch_queue_create_with_target().
+
2018-03-23 Youenn Fablet <youenn@apple.com>
Use libwebrtc ObjectiveC H264 encoder and decoder
static dispatch_queue_t globalQueue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
- globalQueue = dispatch_queue_create("WebCoreAVMediaCaptureSource video capture queue", DISPATCH_QUEUE_SERIAL);
- dispatch_set_target_queue(globalQueue, dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_HIGH, 0));
+ globalQueue = dispatch_queue_create_with_target("WebCoreAVMediaCaptureSource video capture queue", DISPATCH_QUEUE_SERIAL, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));
});
return globalQueue;
}
+2018-03-23 David Kilzer <ddkilzer@apple.com>
+
+ Stop using dispatch_set_target_queue()
+ <https://webkit.org/b/183908>
+ <rdar://problem/33553533>
+
+ Reviewed by Daniel Bates.
+
+ * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
+ (WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
+ dispatch_set_target_queue() since this is handled in the
+ dispatch_io_create() call above.
+
2018-03-23 Youenn Fablet <youenn@apple.com>
CacheStorage::Engine should not ref itself when hopping to a background thread
// This makes the channel read/write all data before invoking the handlers.
dispatch_io_set_low_water(m_dispatchIO.get(), std::numeric_limits<size_t>::max());
-
- if (useLowIOPriority) {
- // The target queue of a dispatch I/O channel specifies the priority of the global queue where its I/O operations are executed.
- dispatch_set_target_queue(m_dispatchIO.get(), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0));
- }
}
IOChannel::~IOChannel()
+2018-03-23 David Kilzer <ddkilzer@apple.com>
+
+ Stop using dispatch_set_target_queue()
+ <https://webkit.org/b/183908>
+ <rdar://problem/33553533>
+
+ Reviewed by Daniel Bates.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ (check_language): Add check for use of
+ dispatch_set_target_queue().
+ (CppChecker): Add 'runtime/dispatch_set_target_queue' category.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+ (CppStyleTest): Add test.
+
2018-03-23 Youenn Fablet <youenn@apple.com>
Allow fully whitelisted plug-ins to match non HTTP URLs
error(line_number, 'security/temp_file', 5,
'Never use mktemp. Use mkstemp or mkostemp instead.')
+ if search(r'\bdispatch_set_target_queue\b', line):
+ error(line_number, 'runtime/dispatch_set_target_queue', 5,
+ 'Never use dispatch_set_target_queue. Use dispatch_queue_create_with_target instead.')
+
# Check for suspicious usage of "if" like
# } if (a == b) {
if search(r'\}\s*if\s*\(', line):
'runtime/bitfields',
'runtime/casting',
'runtime/ctype_function',
+ 'runtime/dispatch_set_target_queue',
'runtime/enum_bitfields',
'runtime/explicit',
'runtime/init',
self.assert_lint('mkstemp(template);', '')
self.assert_lint('mkostemp(template);', '')
+ def test_dispatch_set_target_queue(self):
+ self.assert_lint(
+ '''\
+ globalQueue = dispatch_queue_create("My Serial Queue", DISPATCH_QUEUE_SERIAL);
+ dispatch_set_target_queue(globalQueue, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));''',
+ 'Never use dispatch_set_target_queue. Use dispatch_queue_create_with_target instead.'
+ ' [runtime/dispatch_set_target_queue] [5]')
+ self.assert_lint('globalQueue = dispatch_queue_create_with_target("My Serial Queue", DISPATCH_QUEUE_SERIAL, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));', '')
+
# Variable-length arrays are not permitted.
def test_variable_length_array_detection(self):
errmsg = ('Do not use variable-length arrays. Use an appropriately named '