Log Message
Adapt CARingBuffer to be usable across processes https://bugs.webkit.org/show_bug.cgi?id=169591
Reviewed by Alex Christensen. Source/WebCore: When used with a SharedMemory backing store, storing the pointers to channel data at the beginning of the channel data itself is problematic: when the SharedMemory is mapped on the far side of the process boundary, it will not exist at the same memory location as it did on the near side. Instead of storing these pointers inside the channel data, store them in a small (usually 1 or 2 entry) vector recreated when the backing store is (re-)allocated. * platform/audio/mac/CARingBuffer.cpp: (WebCore::CARingBuffer::CARingBuffer): (WebCore::CARingBuffer::allocate): (WebCore::CARingBuffer::deallocate): (WebCore::ZeroRange): (WebCore::StoreABL): (WebCore::FetchABL): (WebCore::CARingBuffer::store): (WebCore::CARingBuffer::getCurrentFrameBounds): (WebCore::CARingBuffer::fetch): * platform/audio/mac/CARingBuffer.h: Source/WebKit2: Add a new class which wraps a SharedMemory object and uses that shared memory as the backing store of a CARingBuffer. This backing store can be set to "read only", which prevents the backing from being de- or re-allocated. * WebKit2.xcodeproj/project.pbxproj: * Shared/Cocoa/SharedRingBufferStorage.cpp: Added. (WebKit::SharedRingBufferStorage::setStorage): (WebKit::SharedRingBufferStorage::setReadOnly): (WebKit::SharedRingBufferStorage::allocate): (WebKit::SharedRingBufferStorage::deallocate): (WebKit::SharedRingBufferStorage::data): * Shared/Cocoa/SharedRingBufferStorage.h: Added. (WebKit::SharedRingBufferStorage::SharedRingBufferStorage): (WebKit::SharedRingBufferStorage::invalidate): (WebKit::SharedRingBufferStorage::storage): (WebKit::SharedRingBufferStorage::readOnly):
Modified Paths
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/platform/audio/mac/CARingBuffer.cpp
- trunk/Source/WebCore/platform/audio/mac/CARingBuffer.h
- trunk/Source/WebKit2/ChangeLog
- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (213934 => 213935)
--- trunk/Source/WebCore/ChangeLog 2017-03-14 20:07:16 UTC (rev 213934)
+++ trunk/Source/WebCore/ChangeLog 2017-03-14 20:45:52 UTC (rev 213935)
@@ -1,5 +1,30 @@
2017-03-14 Jer Noble <[email protected]>
+ Adapt CARingBuffer to be usable across processes
+ https://bugs.webkit.org/show_bug.cgi?id=169591
+
+ Reviewed by Alex Christensen.
+
+ When used with a SharedMemory backing store, storing the pointers to channel data at the beginning
+ of the channel data itself is problematic: when the SharedMemory is mapped on the far side of the
+ process boundary, it will not exist at the same memory location as it did on the near side. Instead
+ of storing these pointers inside the channel data, store them in a small (usually 1 or 2 entry) vector
+ recreated when the backing store is (re-)allocated.
+
+ * platform/audio/mac/CARingBuffer.cpp:
+ (WebCore::CARingBuffer::CARingBuffer):
+ (WebCore::CARingBuffer::allocate):
+ (WebCore::CARingBuffer::deallocate):
+ (WebCore::ZeroRange):
+ (WebCore::StoreABL):
+ (WebCore::FetchABL):
+ (WebCore::CARingBuffer::store):
+ (WebCore::CARingBuffer::getCurrentFrameBounds):
+ (WebCore::CARingBuffer::fetch):
+ * platform/audio/mac/CARingBuffer.h:
+
+2017-03-14 Jer Noble <[email protected]>
+
Pulling more frames from AudioSampleDataSource than the last push added will always fail.
https://bugs.webkit.org/show_bug.cgi?id=168644
Modified: trunk/Source/WebCore/platform/audio/mac/CARingBuffer.cpp (213934 => 213935)
--- trunk/Source/WebCore/platform/audio/mac/CARingBuffer.cpp 2017-03-14 20:07:16 UTC (rev 213934)
+++ trunk/Source/WebCore/platform/audio/mac/CARingBuffer.cpp 2017-03-14 20:45:52 UTC (rev 213935)
@@ -39,37 +39,37 @@
namespace WebCore {
CARingBuffer::CARingBuffer()
- : m_timeBoundsQueue(kGeneralRingTimeBoundsQueueSize)
+ : m_buffers(makeUniqueRef<CARingBufferStorageVector>())
+ , m_timeBoundsQueue(kGeneralRingTimeBoundsQueueSize)
{
}
-void CARingBuffer::allocate(const CAAudioStreamDescription& format, size_t frameCount)
+CARingBuffer::CARingBuffer(UniqueRef<CARingBufferStorage>&& storage)
+ : m_buffers(WTFMove(storage))
+ , m_timeBoundsQueue(kGeneralRingTimeBoundsQueueSize)
{
- m_description = format;
- allocate(format.numberOfChannelStreams(), format.bytesPerFrame(), frameCount);
}
-void CARingBuffer::allocate(uint32_t channelCount, size_t bytesPerFrame, size_t frameCount)
+void CARingBuffer::allocate(const CAAudioStreamDescription& format, size_t frameCount)
{
+ m_description = format;
deallocate();
frameCount = WTF::roundUpToPowerOfTwo(frameCount);
- m_channelCount = channelCount;
- m_bytesPerFrame = bytesPerFrame;
+ m_channelCount = format.numberOfChannelStreams();
+ m_bytesPerFrame = format.bytesPerFrame();
m_frameCount = frameCount;
m_frameCountMask = frameCount - 1;
- m_capacityBytes = bytesPerFrame * frameCount;
+ m_capacityBytes = m_bytesPerFrame * frameCount;
- size_t pointersSize = channelCount * sizeof(Byte*);
- size_t allocSize = pointersSize + (m_capacityBytes * channelCount);
- m_buffers = ArrayBuffer::create(allocSize, 1);
+ m_buffers->allocate(m_capacityBytes * m_channelCount);
- Byte** pointers = static_cast<Byte**>(m_buffers->data());
- Byte* channelData = static_cast<Byte*>(m_buffers->data()) + pointersSize;
+ m_pointers.resize(m_channelCount);
+ Byte* channelData = static_cast<Byte*>(m_buffers->data());
- for (unsigned i = 0; i < channelCount; ++i) {
- pointers[i] = channelData;
+ for (auto& pointer : m_pointers) {
+ pointer = channelData;
channelData += m_capacityBytes;
}
@@ -78,51 +78,47 @@
void CARingBuffer::deallocate()
{
- if (m_buffers)
- m_buffers = nullptr;
-
+ m_buffers->deallocate();
+ m_pointers.clear();
m_channelCount = 0;
m_capacityBytes = 0;
m_frameCount = 0;
}
-static void ZeroRange(Byte** buffers, int channelCount, size_t offset, size_t nbytes)
+static void ZeroRange(Vector<Byte*>& pointers, size_t offset, size_t nbytes)
{
- while (--channelCount >= 0) {
- memset(*buffers + offset, 0, nbytes);
- ++buffers;
- }
+ for (auto& pointer : pointers)
+ memset(pointer + offset, 0, nbytes);
}
-static void StoreABL(Byte** buffers, size_t destOffset, const AudioBufferList* list, size_t srcOffset, size_t nbytes)
+static void StoreABL(Vector<Byte*>& pointers, size_t destOffset, const AudioBufferList* list, size_t srcOffset, size_t nbytes)
{
- int channelCount = list->mNumberBuffers;
+ ASSERT(list->mNumberBuffers == pointers.size());
const AudioBuffer* src = ""
- while (--channelCount >= 0) {
+ for (auto& pointer : pointers) {
if (srcOffset > src->mDataByteSize)
continue;
- memcpy(*buffers + destOffset, static_cast<Byte*>(src->mData) + srcOffset, std::min<size_t>(nbytes, src->mDataByteSize - srcOffset));
- ++buffers;
+ memcpy(pointer + destOffset, static_cast<Byte*>(src->mData) + srcOffset, std::min<size_t>(nbytes, src->mDataByteSize - srcOffset));
++src;
}
}
-static void FetchABL(AudioBufferList* list, size_t destOffset, Byte** buffers, size_t srcOffset, size_t nbytes, AudioStreamDescription::PCMFormat format, CARingBuffer::FetchMode mode)
+static void FetchABL(AudioBufferList* list, size_t destOffset, Vector<Byte*>& pointers, size_t srcOffset, size_t nbytes, AudioStreamDescription::PCMFormat format, CARingBuffer::FetchMode mode)
{
- int channelCount = list->mNumberBuffers;
+ ASSERT(list->mNumberBuffers == pointers.size());
AudioBuffer* dest = list->mBuffers;
- while (--channelCount >= 0) {
+ for (auto& pointer : pointers) {
if (destOffset > dest->mDataByteSize)
continue;
nbytes = std::min<size_t>(nbytes, dest->mDataByteSize - destOffset);
if (mode == CARingBuffer::Copy)
- memcpy(static_cast<Byte*>(dest->mData) + destOffset, *buffers + srcOffset, nbytes);
+ memcpy(static_cast<Byte*>(dest->mData) + destOffset, pointer + srcOffset, nbytes);
else {
switch (format) {
case AudioStreamDescription::Int16: {
int16_t* destination = static_cast<int16_t*>(dest->mData);
- int16_t* source = reinterpret_cast<int16_t*>(*buffers + srcOffset);
+ int16_t* source = reinterpret_cast<int16_t*>(pointer + srcOffset);
for (size_t i = 0; i < nbytes / sizeof(int16_t); i++)
destination[i] += source[i];
break;
@@ -129,17 +125,17 @@
}
case AudioStreamDescription::Int32: {
int32_t* destination = static_cast<int32_t*>(dest->mData);
- vDSP_vaddi(destination, 1, reinterpret_cast<int32_t*>(*buffers + srcOffset), 1, destination, 1, nbytes / sizeof(int32_t));
+ vDSP_vaddi(destination, 1, reinterpret_cast<int32_t*>(pointer + srcOffset), 1, destination, 1, nbytes / sizeof(int32_t));
break;
}
case AudioStreamDescription::Float32: {
float* destination = static_cast<float*>(dest->mData);
- vDSP_vadd(destination, 1, reinterpret_cast<float*>(*buffers + srcOffset), 1, destination, 1, nbytes / sizeof(float));
+ vDSP_vadd(destination, 1, reinterpret_cast<float*>(pointer + srcOffset), 1, destination, 1, nbytes / sizeof(float));
break;
}
case AudioStreamDescription::Float64: {
double* destination = static_cast<double*>(dest->mData);
- vDSP_vaddD(destination, 1, reinterpret_cast<double*>(*buffers + srcOffset), 1, destination, 1, nbytes / sizeof(double));
+ vDSP_vaddD(destination, 1, reinterpret_cast<double*>(pointer + srcOffset), 1, destination, 1, nbytes / sizeof(double));
break;
}
case AudioStreamDescription::None:
@@ -147,7 +143,6 @@
break;
}
}
- ++buffers;
++dest;
}
}
@@ -200,7 +195,6 @@
}
// Write the new frames.
- Byte** buffers = static_cast<Byte**>(m_buffers->data());
size_t offset0;
size_t offset1;
uint64_t curEnd = currentEndFrame();
@@ -210,10 +204,10 @@
offset0 = frameOffset(curEnd);
offset1 = frameOffset(startFrame);
if (offset0 < offset1)
- ZeroRange(buffers, m_channelCount, offset0, offset1 - offset0);
+ ZeroRange(m_pointers, offset0, offset1 - offset0);
else {
- ZeroRange(buffers, m_channelCount, offset0, m_capacityBytes - offset0);
- ZeroRange(buffers, m_channelCount, 0, offset1);
+ ZeroRange(m_pointers, offset0, m_capacityBytes - offset0);
+ ZeroRange(m_pointers, 0, offset1);
}
offset0 = offset1;
} else
@@ -221,11 +215,11 @@
offset1 = frameOffset(endFrame);
if (offset0 < offset1)
- StoreABL(buffers, offset0, list, 0, offset1 - offset0);
+ StoreABL(m_pointers, offset0, list, 0, offset1 - offset0);
else {
size_t nbytes = m_capacityBytes - offset0;
- StoreABL(buffers, offset0, list, 0, nbytes);
- StoreABL(buffers, 0, list, nbytes, offset1);
+ StoreABL(m_pointers, offset0, list, 0, nbytes);
+ StoreABL(m_pointers, 0, list, nbytes, offset1);
}
// Now update the end time.
@@ -248,7 +242,6 @@
void CARingBuffer::getCurrentFrameBounds(uint64_t &startTime, uint64_t &endTime)
{
- LockHolder locker(m_currentFrameBoundsLock);
uint32_t curPtr = m_timeBoundsQueuePtr.load();
uint32_t index = curPtr & kGeneralRingTimeBoundsQueueMask;
CARingBuffer::TimeBounds& bounds = m_timeBoundsQueue[index];
@@ -316,7 +309,6 @@
if (destEndSize > 0)
ZeroABL(list, destStartByteOffset + byteSize, destEndSize * m_bytesPerFrame);
- Byte **buffers = static_cast<Byte**>(m_buffers->data());
size_t offset0 = frameOffset(startRead);
size_t offset1 = frameOffset(endRead);
size_t nbytes;
@@ -323,12 +315,12 @@
if (offset0 < offset1) {
nbytes = offset1 - offset0;
- FetchABL(list, destStartByteOffset, buffers, offset0, nbytes, m_description.format(), mode);
+ FetchABL(list, destStartByteOffset, m_pointers, offset0, nbytes, m_description.format(), mode);
} else {
nbytes = m_capacityBytes - offset0;
- FetchABL(list, destStartByteOffset, buffers, offset0, nbytes, m_description.format(), mode);
+ FetchABL(list, destStartByteOffset, m_pointers, offset0, nbytes, m_description.format(), mode);
if (offset1)
- FetchABL(list, destStartByteOffset + nbytes, buffers, 0, offset1, m_description.format(), mode);
+ FetchABL(list, destStartByteOffset + nbytes, m_pointers, 0, offset1, m_description.format(), mode);
nbytes += offset1;
}
Modified: trunk/Source/WebCore/platform/audio/mac/CARingBuffer.h (213934 => 213935)
--- trunk/Source/WebCore/platform/audio/mac/CARingBuffer.h 2017-03-14 20:07:16 UTC (rev 213934)
+++ trunk/Source/WebCore/platform/audio/mac/CARingBuffer.h 2017-03-14 20:45:52 UTC (rev 213935)
@@ -31,6 +31,7 @@
#include "CAAudioStreamDescription.h"
#include <runtime/ArrayBuffer.h>
#include <wtf/Lock.h>
+#include <wtf/UniqueRef.h>
#include <wtf/Vector.h>
typedef struct AudioBufferList AudioBufferList;
@@ -37,9 +38,29 @@
namespace WebCore {
+class CARingBufferStorage {
+public:
+ virtual ~CARingBufferStorage() = default;
+ virtual void allocate(size_t) = 0;
+ virtual void deallocate() = 0;
+ virtual void* data() = 0;
+};
+
+class CARingBufferStorageVector : public CARingBufferStorage {
+public:
+ ~CARingBufferStorageVector() = default;
+
+private:
+ void allocate(size_t byteCount) final { m_buffer.grow(byteCount); }
+ void deallocate() final { m_buffer.clear(); }
+ void* data() final { return m_buffer.data(); }
+ Vector<uint8_t> m_buffer;
+};
+
class CARingBuffer {
public:
WEBCORE_EXPORT CARingBuffer();
+ WEBCORE_EXPORT CARingBuffer(UniqueRef<CARingBufferStorage>&&);
WEBCORE_EXPORT ~CARingBuffer()
{
deallocate();
@@ -61,11 +82,11 @@
WEBCORE_EXPORT void flush();
WEBCORE_EXPORT void getCurrentFrameBounds(uint64_t &startTime, uint64_t &endTime);
+ WEBCORE_EXPORT void setCurrentFrameBounds(uint64_t startFrame, uint64_t endFrame);
uint32_t channelCount() const { return m_channelCount; }
private:
- void allocate(uint32_t m_channelCount, size_t bytesPerFrame, size_t frameCount);
size_t frameOffset(uint64_t frameNumber) { return (frameNumber & m_frameCountMask) * m_bytesPerFrame; }
void clipTimeBounds(uint64_t& startRead, uint64_t& endRead);
@@ -72,9 +93,9 @@
uint64_t currentStartFrame() const;
uint64_t currentEndFrame() const;
- void setCurrentFrameBounds(uint64_t startFrame, uint64_t endFrame);
- RefPtr<ArrayBuffer> m_buffers;
+ UniqueRef<CARingBufferStorage> m_buffers;
+ Vector<Byte*> m_pointers;
uint32_t m_channelCount { 0 };
size_t m_bytesPerFrame { 0 };
uint32_t m_frameCount { 0 };
Modified: trunk/Source/WebKit2/ChangeLog (213934 => 213935)
--- trunk/Source/WebKit2/ChangeLog 2017-03-14 20:07:16 UTC (rev 213934)
+++ trunk/Source/WebKit2/ChangeLog 2017-03-14 20:45:52 UTC (rev 213935)
@@ -1,3 +1,27 @@
+2017-03-14 Jer Noble <[email protected]>
+
+ Adapt CARingBuffer to be usable across processes
+ https://bugs.webkit.org/show_bug.cgi?id=169591
+
+ Reviewed by Alex Christensen.
+
+ Add a new class which wraps a SharedMemory object and uses that shared memory as the
+ backing store of a CARingBuffer. This backing store can be set to "read only", which
+ prevents the backing from being de- or re-allocated.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ * Shared/Cocoa/SharedRingBufferStorage.cpp: Added.
+ (WebKit::SharedRingBufferStorage::setStorage):
+ (WebKit::SharedRingBufferStorage::setReadOnly):
+ (WebKit::SharedRingBufferStorage::allocate):
+ (WebKit::SharedRingBufferStorage::deallocate):
+ (WebKit::SharedRingBufferStorage::data):
+ * Shared/Cocoa/SharedRingBufferStorage.h: Added.
+ (WebKit::SharedRingBufferStorage::SharedRingBufferStorage):
+ (WebKit::SharedRingBufferStorage::invalidate):
+ (WebKit::SharedRingBufferStorage::storage):
+ (WebKit::SharedRingBufferStorage::readOnly):
+
2017-03-14 Eric Carlson <[email protected]>
[iOS] The web process should inherit application state from UI process
Added: trunk/Source/WebKit2/Shared/Cocoa/SharedRingBufferStorage.cpp (0 => 213935)
--- trunk/Source/WebKit2/Shared/Cocoa/SharedRingBufferStorage.cpp (rev 0)
+++ trunk/Source/WebKit2/Shared/Cocoa/SharedRingBufferStorage.cpp 2017-03-14 20:45:52 UTC (rev 213935)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SharedRingBufferStorage.h"
+
+#if USE(MEDIATOOLBOX)
+
+namespace WebKit {
+
+void SharedRingBufferStorage::setStorage(RefPtr<SharedMemory>&& storage)
+{
+ ASSERT(storage || !m_readOnly);
+ m_storage = WTFMove(storage);
+ if (m_client)
+ m_client->storageChanged(m_storage.get());
+}
+
+void SharedRingBufferStorage::setReadOnly(bool readOnly)
+{
+ ASSERT(m_storage || !readOnly);
+ m_readOnly = readOnly;
+}
+
+void SharedRingBufferStorage::allocate(size_t byteCount)
+{
+ if (!m_readOnly)
+ setStorage(SharedMemory::allocate(byteCount));
+}
+
+void SharedRingBufferStorage::deallocate()
+{
+ if (!m_readOnly)
+ setStorage(nullptr);
+}
+
+void* SharedRingBufferStorage::data()
+{
+ return m_storage ? m_storage->data() : nullptr;
+}
+
+}
+
+#endif
Added: trunk/Source/WebKit2/Shared/Cocoa/SharedRingBufferStorage.h (0 => 213935)
--- trunk/Source/WebKit2/Shared/Cocoa/SharedRingBufferStorage.h (rev 0)
+++ trunk/Source/WebKit2/Shared/Cocoa/SharedRingBufferStorage.h 2017-03-14 20:45:52 UTC (rev 213935)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(MEDIATOOLBOX)
+
+#include "SharedMemory.h"
+#include <WebCore/CARingBuffer.h>
+
+namespace WebKit {
+
+class SharedRingBufferStorage : public WebCore::CARingBufferStorage {
+public:
+ class Client {
+ public:
+ virtual ~Client() = default;
+ virtual void storageChanged(SharedMemory*) = 0;
+ };
+
+ SharedRingBufferStorage(Client* client)
+ : m_client(client)
+ {
+ }
+
+ void invalidate() { m_client = nullptr; }
+
+ RefPtr<SharedMemory> storage() const { return m_storage; }
+ void setStorage(RefPtr<SharedMemory>&&);
+
+ bool readOnly() const { return m_readOnly; }
+ void setReadOnly(bool);
+
+ // WebCore::CARingBufferStorage
+ void allocate(size_t) final;
+ void deallocate() final;
+ void* data() final;
+
+private:
+ Client* m_client;
+ RefPtr<SharedMemory> m_storage;
+ bool m_readOnly { false };
+};
+
+}
+
+#endif
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (213934 => 213935)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2017-03-14 20:07:16 UTC (rev 213934)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2017-03-14 20:45:52 UTC (rev 213935)
@@ -1879,6 +1879,8 @@
CD003A5319D49B5D005ABCE0 /* WebMediaKeyStorageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CD003A5119D49B5D005ABCE0 /* WebMediaKeyStorageManager.h */; };
CD19A26D1A13E82A008D650E /* WebDiagnosticLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD19A2691A13E820008D650E /* WebDiagnosticLoggingClient.cpp */; };
CD19A26E1A13E834008D650E /* WebDiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD19A26A1A13E821008D650E /* WebDiagnosticLoggingClient.h */; };
+ CD4B4D9C1E765E0000D27092 /* SharedRingBufferStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD4B4D9A1E765E0000D27092 /* SharedRingBufferStorage.cpp */; };
+ CD4B4D9D1E765E0000D27092 /* SharedRingBufferStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = CD4B4D9B1E765E0000D27092 /* SharedRingBufferStorage.h */; };
CD5C66A0134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */; };
CD5C66A1134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */; };
CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */; };
@@ -4166,6 +4168,8 @@
CD003A5119D49B5D005ABCE0 /* WebMediaKeyStorageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebMediaKeyStorageManager.h; path = MediaCache/WebMediaKeyStorageManager.h; sourceTree = "<group>"; };
CD19A2691A13E820008D650E /* WebDiagnosticLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebDiagnosticLoggingClient.cpp; sourceTree = "<group>"; };
CD19A26A1A13E821008D650E /* WebDiagnosticLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDiagnosticLoggingClient.h; sourceTree = "<group>"; };
+ CD4B4D9A1E765E0000D27092 /* SharedRingBufferStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedRingBufferStorage.cpp; sourceTree = "<group>"; };
+ CD4B4D9B1E765E0000D27092 /* SharedRingBufferStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedRingBufferStorage.h; sourceTree = "<group>"; };
CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageFullScreenClient.cpp; sourceTree = "<group>"; };
CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageFullScreenClient.h; sourceTree = "<group>"; };
CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebFullScreenManager.cpp; path = FullScreen/WebFullScreenManager.cpp; sourceTree = "<group>"; };
@@ -5673,6 +5677,8 @@
37BF2F051947DEB400723C48 /* WKNSURLRequest.mm */,
378E1A3F181EDA010031007A /* WKObject.h */,
374436871820E7240049579F /* WKObject.mm */,
+ CD4B4D9A1E765E0000D27092 /* SharedRingBufferStorage.cpp */,
+ CD4B4D9B1E765E0000D27092 /* SharedRingBufferStorage.h */,
);
name = cocoa;
path = Cocoa;
@@ -8370,6 +8376,7 @@
2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */,
51D124351E6DF652002B2820 /* WKURLSchemeHandlerTask.h in Headers */,
2DDF731518E95060004F5A66 /* RemoteLayerBackingStoreCollection.h in Headers */,
+ CD4B4D9D1E765E0000D27092 /* SharedRingBufferStorage.h in Headers */,
1AB16AEA164B3A8800290D62 /* RemoteLayerTreeContext.h in Headers */,
2D29ECD0192F2C2E00984B78 /* RemoteLayerTreeDisplayRefreshMonitor.h in Headers */,
1AB16ADE1648598400290D62 /* RemoteLayerTreeDrawingArea.h in Headers */,
@@ -10379,6 +10386,7 @@
37183D56182F4E700080C811 /* WKNSURLExtras.mm in Sources */,
37BF2F071947DEB400723C48 /* WKNSURLRequest.mm in Sources */,
BC407601124FF0270068F20A /* WKNumber.cpp in Sources */,
+ CD4B4D9C1E765E0000D27092 /* SharedRingBufferStorage.cpp in Sources */,
7CD5EBB81746A15B000C1C45 /* WKObjCTypeWrapperRef.mm in Sources */,
374436881820E7240049579F /* WKObject.mm in Sources */,
1ACC50F11CBC381D003C7D03 /* WKOpenPanelParameters.mm in Sources */,
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
