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); }
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); }
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); }
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); }