Title: [245856] trunk/Source/WebKit
- Revision
- 245856
- Author
- [email protected]
- Date
- 2019-05-29 11:12:40 -0700 (Wed, 29 May 2019)
Log Message
Modernize getting proxies of UserMediaCaptureManagerProxy
https://bugs.webkit.org/show_bug.cgi?id=198336
Reviewed by Eric Carlson.
No change of behavior, use HashMap::get instead of find.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(WebKit::UserMediaCaptureManagerProxy::startProducingData):
(WebKit::UserMediaCaptureManagerProxy::stopProducingData):
(WebKit::UserMediaCaptureManagerProxy::capabilities):
(WebKit::UserMediaCaptureManagerProxy::setMuted):
(WebKit::UserMediaCaptureManagerProxy::applyConstraints):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (245855 => 245856)
--- trunk/Source/WebKit/ChangeLog 2019-05-29 17:59:31 UTC (rev 245855)
+++ trunk/Source/WebKit/ChangeLog 2019-05-29 18:12:40 UTC (rev 245856)
@@ -1,3 +1,19 @@
+2019-05-29 Youenn Fablet <[email protected]>
+
+ Modernize getting proxies of UserMediaCaptureManagerProxy
+ https://bugs.webkit.org/show_bug.cgi?id=198336
+
+ Reviewed by Eric Carlson.
+
+ No change of behavior, use HashMap::get instead of find.
+
+ * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
+ (WebKit::UserMediaCaptureManagerProxy::startProducingData):
+ (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
+ (WebKit::UserMediaCaptureManagerProxy::capabilities):
+ (WebKit::UserMediaCaptureManagerProxy::setMuted):
+ (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
+
2019-05-29 Andy Estes <[email protected]>
[watchOS] Remove an unneeded #import
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp (245855 => 245856)
--- trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp 2019-05-29 17:59:31 UTC (rev 245855)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp 2019-05-29 18:12:40 UTC (rev 245856)
@@ -177,17 +177,15 @@
void UserMediaCaptureManagerProxy::startProducingData(uint64_t id)
{
MESSAGE_CHECK_CONTEXTID(id);
- auto iter = m_proxies.find(id);
- if (iter != m_proxies.end())
- iter->value->source().start();
+ if (auto* proxy = m_proxies.get(id))
+ proxy->source().start();
}
void UserMediaCaptureManagerProxy::stopProducingData(uint64_t id)
{
MESSAGE_CHECK_CONTEXTID(id);
- auto iter = m_proxies.find(id);
- if (iter != m_proxies.end())
- iter->value->source().stop();
+ if (auto* proxy = m_proxies.get(id))
+ proxy->source().stop();
}
void UserMediaCaptureManagerProxy::end(uint64_t id)
@@ -200,9 +198,8 @@
{
MESSAGE_CHECK_CONTEXTID(id);
WebCore::RealtimeMediaSourceCapabilities capabilities;
- auto iter = m_proxies.find(id);
- if (iter != m_proxies.end())
- capabilities = iter->value->source().capabilities();
+ if (auto* proxy = m_proxies.get(id))
+ capabilities = proxy->source().capabilities();
completionHandler(WTFMove(capabilities));
}
@@ -209,19 +206,18 @@
void UserMediaCaptureManagerProxy::setMuted(uint64_t id, bool muted)
{
MESSAGE_CHECK_CONTEXTID(id);
- auto iter = m_proxies.find(id);
- if (iter != m_proxies.end())
- iter->value->source().setMuted(muted);
+ if (auto* proxy = m_proxies.get(id))
+ proxy->source().setMuted(muted);
}
void UserMediaCaptureManagerProxy::applyConstraints(uint64_t id, const WebCore::MediaConstraints& constraints)
{
MESSAGE_CHECK_CONTEXTID(id);
- auto iter = m_proxies.find(id);
- if (iter == m_proxies.end())
+ auto* proxy = m_proxies.get(id);
+ if (!proxy)
return;
- auto& source = iter->value->source();
+ auto& source = proxy->source();
auto result = source.applyConstraints(constraints);
if (!result)
m_process.send(Messages::UserMediaCaptureManager::ApplyConstraintsSucceeded(id, source.settings()), 0);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes