Changeset 245858 in webkit
- Timestamp:
- May 29, 2019, 11:36:06 AM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r245857 r245858 1 2019-05-29 Youenn Fablet <youenn@apple.com> 2 3 UserMediaCaptureManagerProxy::SourceProxy should directly have access to its IPC connection 4 https://bugs.webkit.org/show_bug.cgi?id=198335 5 6 Reviewed by Eric Carlson. 7 8 Previously, SourceProxy was getting its IPC connection by going through its manager, then its process proxy. 9 As some calls can be done from a background thread, it is safer to directly make SourceProxy own a Ref of its IPC connection. 10 11 * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: 12 (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy): 13 (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): 14 1 15 2019-05-28 Geoffrey Garen <ggaren@apple.com> 2 16 -
trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp
r245856 r245858 47 47 class UserMediaCaptureManagerProxy::SourceProxy : public RealtimeMediaSource::Observer, public SharedRingBufferStorage::Client { 48 48 public: 49 SourceProxy(uint64_t id, UserMediaCaptureManagerProxy& manager, Ref<RealtimeMediaSource>&& source)49 SourceProxy(uint64_t id, Ref<IPC::Connection>&& connection, Ref<RealtimeMediaSource>&& source) 50 50 : m_id(id) 51 , m_ manager(manager)51 , m_connection(WTFMove(connection)) 52 52 , m_source(WTFMove(source)) 53 53 , m_ringBuffer(makeUniqueRef<SharedRingBufferStorage>(makeUniqueRef<SharedRingBufferStorage>(this))) … … 69 69 void sourceStopped() final { 70 70 if (m_source->captureDidFail()) { 71 m_ manager.process().send(Messages::UserMediaCaptureManager::CaptureFailed(m_id), 0);71 m_connection->send(Messages::UserMediaCaptureManager::CaptureFailed(m_id), 0); 72 72 return; 73 73 } 74 m_ manager.process().send(Messages::UserMediaCaptureManager::SourceStopped(m_id), 0);74 m_connection->send(Messages::UserMediaCaptureManager::SourceStopped(m_id), 0); 75 75 } 76 76 77 77 void sourceMutedChanged() final { 78 m_ manager.process().send(Messages::UserMediaCaptureManager::SourceMutedChanged(m_id, m_source->muted()), 0);78 m_connection->send(Messages::UserMediaCaptureManager::SourceMutedChanged(m_id, m_source->muted()), 0); 79 79 } 80 80 81 81 void sourceSettingsChanged() final { 82 m_ manager.process().send(Messages::UserMediaCaptureManager::SourceSettingsChanged(m_id, m_source->settings()), 0);82 m_connection->send(Messages::UserMediaCaptureManager::SourceSettingsChanged(m_id, m_source->settings()), 0); 83 83 } 84 84 … … 99 99 uint64_t endFrame; 100 100 m_ringBuffer.getCurrentFrameBounds(startFrame, endFrame); 101 m_ manager.process().send(Messages::UserMediaCaptureManager::AudioSamplesAvailable(m_id, time, numberOfFrames, startFrame, endFrame), 0);101 m_connection->send(Messages::UserMediaCaptureManager::AudioSamplesAvailable(m_id, time, numberOfFrames, startFrame, endFrame), 0); 102 102 } 103 103 … … 107 107 auto remoteSample = RemoteVideoSample::create(WTFMove(sample)); 108 108 if (remoteSample) 109 m_ manager.process().send(Messages::UserMediaCaptureManager::RemoteVideoSampleAvailable(m_id, WTFMove(*remoteSample)), 0);109 m_connection->send(Messages::UserMediaCaptureManager::RemoteVideoSampleAvailable(m_id, WTFMove(*remoteSample)), 0); 110 110 #else 111 111 ASSERT_NOT_REACHED(); … … 117 117 if (storage) 118 118 storage->createHandle(handle, SharedMemory::Protection::ReadOnly); 119 m_ manager.process().send(Messages::UserMediaCaptureManager::StorageChanged(m_id, handle, m_description, m_numberOfFrames), 0);119 m_connection->send(Messages::UserMediaCaptureManager::StorageChanged(m_id, handle, m_description, m_numberOfFrames), 0); 120 120 } 121 121 122 122 protected: 123 123 uint64_t m_id; 124 UserMediaCaptureManagerProxy& m_manager;124 Ref<IPC::Connection> m_connection; 125 125 Ref<RealtimeMediaSource> m_source; 126 126 CARingBuffer m_ringBuffer; … … 169 169 settings = source->settings(); 170 170 ASSERT(!m_proxies.contains(id)); 171 m_proxies.add(id, std::make_unique<SourceProxy>(id, * this, WTFMove(source)));171 m_proxies.add(id, std::make_unique<SourceProxy>(id, *m_process.connection(), WTFMove(source))); 172 172 } else 173 173 invalidConstraints = WTFMove(sourceOrError.errorMessage);
Note:
See TracChangeset
for help on using the changeset viewer.