本文整理汇总了C++中sharedmemory::Handle类的典型用法代码示例。如果您正苦于以下问题:C++ Handle类的具体用法?C++ Handle怎么用?C++ Handle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Handle类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
RefPtr<WebCore::SharedBuffer> WebPlatformStrategies::readBufferFromPasteboard(int index, const String& pasteboardType)
{
SharedMemory::Handle handle;
uint64_t size = 0;
WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::ReadBufferFromPasteboard(index, pasteboardType), Messages::WebPasteboardProxy::ReadBufferFromPasteboard::Reply(handle, size), 0);
if (handle.isNull())
return nullptr;
RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly);
return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size);
}
示例2: create
PassRefPtr<WebCore::SharedBuffer> WebPlatformStrategies::bufferForType(const String& pasteboardType, const String& pasteboardName)
{
SharedMemory::Handle handle;
uint64_t size = 0;
WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPasteboardBufferForType(pasteboardName, pasteboardType),
Messages::WebContext::GetPasteboardBufferForType::Reply(handle, size), 0);
if (handle.isNull())
return 0;
RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::create(handle, SharedMemory::ReadOnly);
return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size);
}
示例3: adoptVector
RefPtr<WebCore::SharedBuffer> WebPlatformStrategies::bufferForType(const String& pasteboardType, const String& pasteboardName)
{
// First check the overrides.
Vector<char> overrideBuffer;
if (WebPasteboardOverrides::sharedPasteboardOverrides().getDataForOverride(pasteboardName, pasteboardType, overrideBuffer))
return SharedBuffer::adoptVector(overrideBuffer);
// Fallback to messaging the UI process for native pasteboard content.
SharedMemory::Handle handle;
uint64_t size = 0;
WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::GetPasteboardBufferForType(pasteboardName, pasteboardType), Messages::WebPasteboardProxy::GetPasteboardBufferForType::Reply(handle, size), 0);
if (handle.isNull())
return nullptr;
RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly);
return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size);
}
示例4: geometryDidChange
void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const IntRect& clipRect, const SharedMemory::Handle& backingStoreHandle)
{
m_frameRect = frameRect;
m_clipRect = clipRect;
ASSERT(m_plugin);
if (!backingStoreHandle.isNull()) {
// Create a new backing store.
m_backingStore = ShareableBitmap::create(frameRect.size(), backingStoreHandle);
}
m_plugin->geometryDidChange(frameRect, clipRect);
platformGeometryDidChange(frameRect, clipRect);
}