Changeset 243325 in webkit
- Timestamp:
- Mar 21, 2019 2:03:43 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r243324 r243325 1 2019-03-21 Alex Christensen <achristensen@webkit.org> 2 3 Stop using LegacySync messages in WebPasteboardProxy 4 https://bugs.webkit.org/show_bug.cgi?id=196060 5 6 Reviewed by Chris Dumez. 7 8 * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: 9 (WebKit::WebPasteboardProxy::getPasteboardTypes): 10 (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): 11 (WebKit::WebPasteboardProxy::getPasteboardStringForType): 12 (WebKit::WebPasteboardProxy::getPasteboardStringsForType): 13 (WebKit::WebPasteboardProxy::getPasteboardBufferForType): 14 (WebKit::WebPasteboardProxy::pasteboardCopy): 15 (WebKit::WebPasteboardProxy::getPasteboardChangeCount): 16 (WebKit::WebPasteboardProxy::getPasteboardUniqueName): 17 (WebKit::WebPasteboardProxy::getPasteboardColor): 18 (WebKit::WebPasteboardProxy::getPasteboardURL): 19 (WebKit::WebPasteboardProxy::addPasteboardTypes): 20 (WebKit::WebPasteboardProxy::setPasteboardTypes): 21 (WebKit::WebPasteboardProxy::setPasteboardURL): 22 (WebKit::WebPasteboardProxy::setPasteboardColor): 23 (WebKit::WebPasteboardProxy::setPasteboardStringForType): 24 (WebKit::WebPasteboardProxy::setPasteboardBufferForType): 25 (WebKit::WebPasteboardProxy::getNumberOfFiles): 26 (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): 27 (WebKit::WebPasteboardProxy::writeCustomData): 28 (WebKit::WebPasteboardProxy::readStringFromPasteboard): 29 (WebKit::WebPasteboardProxy::readURLFromPasteboard): 30 (WebKit::WebPasteboardProxy::readBufferFromPasteboard): 31 (WebKit::WebPasteboardProxy::getPasteboardItemsCount): 32 (WebKit::WebPasteboardProxy::allPasteboardItemInfo): 33 (WebKit::WebPasteboardProxy::informationForItemAtIndex): 34 * UIProcess/WebPasteboardProxy.cpp: 35 (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite): 36 (WebKit::WebPasteboardProxy::writeCustomData): 37 * UIProcess/WebPasteboardProxy.h: 38 * UIProcess/WebPasteboardProxy.messages.in: 39 * UIProcess/gtk/WebPasteboardProxyGtk.cpp: 40 (WebKit::WebPasteboardProxy::writeToClipboard): 41 (WebKit::WebPasteboardProxy::readFromClipboard): 42 * UIProcess/wpe/WebPasteboardProxyWPE.cpp: 43 (WebKit::WebPasteboardProxy::getPasteboardTypes): 44 (WebKit::WebPasteboardProxy::readStringFromPasteboard): 45 (WebKit::WebPasteboardProxy::writeWebContentToPasteboard): 46 (WebKit::WebPasteboardProxy::writeStringToPasteboard): 47 1 48 2019-03-21 Andy Estes <aestes@apple.com> 2 49 -
trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm
r241749 r243325 39 39 using namespace WebCore; 40 40 41 void WebPasteboardProxy::getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes) 42 { 41 void WebPasteboardProxy::getPasteboardTypes(const String& pasteboardName, CompletionHandler<void(Vector<String>&&)>&& completionHandler) 42 { 43 Vector<String> pasteboardTypes; 43 44 PlatformPasteboard(pasteboardName).getTypes(pasteboardTypes); 45 completionHandler(WTFMove(pasteboardTypes)); 44 46 } 45 47 46 48 void WebPasteboardProxy::getPasteboardPathnamesForType(IPC::Connection& connection, const String& pasteboardName, const String& pasteboardType, 47 Vector<String>& pathnames, SandboxExtension::HandleArray& sandboxExtensions) 48 { 49 CompletionHandler<void(Vector<String>&& pathnames, SandboxExtension::HandleArray&& sandboxExtensions)>&& completionHandler) 50 { 51 Vector<String> pathnames; 52 SandboxExtension::HandleArray sandboxExtensions; 49 53 for (auto* webProcessProxy : m_webProcessProxyList) { 50 54 if (!webProcessProxy->hasConnection(connection)) … … 64 68 #endif 65 69 } 66 } 67 68 void WebPasteboardProxy::getPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, String& string) 69 { 70 string = PlatformPasteboard(pasteboardName).stringForType(pasteboardType); 71 } 72 73 void WebPasteboardProxy::getPasteboardStringsForType(const String& pasteboardName, const String& pasteboardType, Vector<String>& strings) 74 { 75 strings = PlatformPasteboard(pasteboardName).allStringsForType(pasteboardType); 76 } 77 78 void WebPasteboardProxy::getPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, SharedMemory::Handle& handle, uint64_t& size) 70 completionHandler(WTFMove(pathnames), WTFMove(sandboxExtensions)); 71 } 72 73 void WebPasteboardProxy::getPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, CompletionHandler<void(String&&)>&& completionHandler) 74 { 75 completionHandler(PlatformPasteboard(pasteboardName).stringForType(pasteboardType)); 76 } 77 78 void WebPasteboardProxy::getPasteboardStringsForType(const String& pasteboardName, const String& pasteboardType, CompletionHandler<void(Vector<String>&&)>&& completionHandler) 79 { 80 completionHandler(PlatformPasteboard(pasteboardName).allStringsForType(pasteboardType)); 81 } 82 83 void WebPasteboardProxy::getPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, CompletionHandler<void(SharedMemory::Handle&&, uint64_t)>&& completionHandler) 79 84 { 80 85 RefPtr<SharedBuffer> buffer = PlatformPasteboard(pasteboardName).bufferForType(pasteboardType); 81 86 if (!buffer) 82 return ;83 size = buffer->size();87 return completionHandler({ }, 0); 88 uint64_t size = buffer->size(); 84 89 if (!size) 85 return ;90 return completionHandler({ }, 0); 86 91 RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::allocate(size); 87 92 if (!sharedMemoryBuffer) 88 return ;93 return completionHandler({ }, 0); 89 94 memcpy(sharedMemoryBuffer->data(), buffer->data(), size); 95 SharedMemory::Handle handle; 90 96 sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly); 91 } 92 93 void WebPasteboardProxy::pasteboardCopy(const String& fromPasteboard, const String& toPasteboard, uint64_t& newChangeCount) 94 { 95 newChangeCount = PlatformPasteboard(toPasteboard).copy(fromPasteboard); 96 } 97 98 void WebPasteboardProxy::getPasteboardChangeCount(const String& pasteboardName, uint64_t& changeCount) 99 { 100 changeCount = PlatformPasteboard(pasteboardName).changeCount(); 101 } 102 103 void WebPasteboardProxy::getPasteboardUniqueName(String& pasteboardName) 104 { 105 pasteboardName = PlatformPasteboard::uniqueName(); 106 } 107 108 void WebPasteboardProxy::getPasteboardColor(const String& pasteboardName, WebCore::Color& color) 109 { 110 color = PlatformPasteboard(pasteboardName).color(); 111 } 112 113 void WebPasteboardProxy::getPasteboardURL(const String& pasteboardName, WTF::String& urlString) 114 { 115 urlString = PlatformPasteboard(pasteboardName).url().string(); 116 } 117 118 void WebPasteboardProxy::addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount) 119 { 120 newChangeCount = PlatformPasteboard(pasteboardName).addTypes(pasteboardTypes); 121 } 122 123 void WebPasteboardProxy::setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount) 124 { 125 newChangeCount = PlatformPasteboard(pasteboardName).setTypes(pasteboardTypes); 126 } 127 128 void WebPasteboardProxy::setPasteboardURL(IPC::Connection& connection, const PasteboardURL& pasteboardURL, const String& pasteboardName, uint64_t& newChangeCount) 97 completionHandler(WTFMove(handle), size); 98 } 99 100 void WebPasteboardProxy::pasteboardCopy(const String& fromPasteboard, const String& toPasteboard, CompletionHandler<void(uint64_t)>&& completionHandler) 101 { 102 completionHandler(PlatformPasteboard(toPasteboard).copy(fromPasteboard)); 103 } 104 105 void WebPasteboardProxy::getPasteboardChangeCount(const String& pasteboardName, CompletionHandler<void(uint64_t)>&& completionHandler) 106 { 107 completionHandler(PlatformPasteboard(pasteboardName).changeCount()); 108 } 109 110 void WebPasteboardProxy::getPasteboardUniqueName(CompletionHandler<void(String&&)>&& completionHandler) 111 { 112 completionHandler(PlatformPasteboard::uniqueName()); 113 } 114 115 void WebPasteboardProxy::getPasteboardColor(const String& pasteboardName, CompletionHandler<void(WebCore::Color&&)>&& completionHandler) 116 { 117 completionHandler(PlatformPasteboard(pasteboardName).color()); 118 } 119 120 void WebPasteboardProxy::getPasteboardURL(const String& pasteboardName, CompletionHandler<void(const String&)>&& completionHandler) 121 { 122 completionHandler(PlatformPasteboard(pasteboardName).url().string()); 123 } 124 125 void WebPasteboardProxy::addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, CompletionHandler<void(uint64_t)>&& completionHandler) 126 { 127 completionHandler(PlatformPasteboard(pasteboardName).addTypes(pasteboardTypes)); 128 } 129 130 void WebPasteboardProxy::setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, CompletionHandler<void(uint64_t)>&& completionHandler) 131 { 132 completionHandler(PlatformPasteboard(pasteboardName).setTypes(pasteboardTypes)); 133 } 134 135 void WebPasteboardProxy::setPasteboardURL(IPC::Connection& connection, const PasteboardURL& pasteboardURL, const String& pasteboardName, CompletionHandler<void(uint64_t)>&& completionHandler) 129 136 { 130 137 for (auto* webProcessProxy : m_webProcessProxyList) { … … 132 139 continue; 133 140 134 if (!webProcessProxy->checkURLReceivedFromWebProcess(pasteboardURL.url.string())) { 135 newChangeCount = 0; 136 return; 137 } 138 139 newChangeCount = PlatformPasteboard(pasteboardName).setURL(pasteboardURL); 140 return; 141 if (!webProcessProxy->checkURLReceivedFromWebProcess(pasteboardURL.url.string())) 142 return completionHandler(0); 143 144 return completionHandler(PlatformPasteboard(pasteboardName).setURL(pasteboardURL)); 141 145 } 142 newChangeCount = 0; 143 } 144 145 void WebPasteboardProxy::setPasteboardColor(const String& pasteboardName, const WebCore::Color& color, uint64_t& newChangeCount) 146 { 147 newChangeCount = PlatformPasteboard(pasteboardName).setColor(color); 148 } 149 150 void WebPasteboardProxy::setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String& string, uint64_t& newChangeCount) 151 { 152 newChangeCount = PlatformPasteboard(pasteboardName).setStringForType(string, pasteboardType); 153 } 154 155 void WebPasteboardProxy::setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle& handle, uint64_t size, uint64_t& newChangeCount) 156 { 157 if (handle.isNull()) { 158 newChangeCount = PlatformPasteboard(pasteboardName).setBufferForType(0, pasteboardType); 159 return; 160 } 146 completionHandler(0); 147 } 148 149 void WebPasteboardProxy::setPasteboardColor(const String& pasteboardName, const WebCore::Color& color, CompletionHandler<void(uint64_t)>&& completionHandler) 150 { 151 completionHandler(PlatformPasteboard(pasteboardName).setColor(color)); 152 } 153 154 void WebPasteboardProxy::setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String& string, CompletionHandler<void(uint64_t)>&& completionHandler) 155 { 156 completionHandler(PlatformPasteboard(pasteboardName).setStringForType(string, pasteboardType)); 157 } 158 159 void WebPasteboardProxy::setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle& handle, uint64_t size, CompletionHandler<void(uint64_t)>&& completionHandler) 160 { 161 if (handle.isNull()) 162 return completionHandler(PlatformPasteboard(pasteboardName).setBufferForType(0, pasteboardType)); 161 163 RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly); 162 164 auto buffer = SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size); 163 newChangeCount = PlatformPasteboard(pasteboardName).setBufferForType(buffer.ptr(), pasteboardType);164 } 165 166 void WebPasteboardProxy::getNumberOfFiles(const String& pasteboardName, uint64_t& numberOfFiles)167 { 168 numberOfFiles = PlatformPasteboard(pasteboardName).numberOfFiles();169 } 170 171 void WebPasteboardProxy::typesSafeForDOMToReadAndWrite(const String& pasteboardName, const String& origin, Vector<String>& types)172 { 173 types = PlatformPasteboard(pasteboardName).typesSafeForDOMToReadAndWrite(origin);174 } 175 176 void WebPasteboardProxy::writeCustomData(const WebCore::PasteboardCustomData& data, const String& pasteboardName, uint64_t& newChangeCount)177 { 178 newChangeCount = PlatformPasteboard(pasteboardName).write(data);165 completionHandler(PlatformPasteboard(pasteboardName).setBufferForType(buffer.ptr(), pasteboardType)); 166 } 167 168 void WebPasteboardProxy::getNumberOfFiles(const String& pasteboardName, CompletionHandler<void(uint64_t)>&& completionHandler) 169 { 170 completionHandler(PlatformPasteboard(pasteboardName).numberOfFiles()); 171 } 172 173 void WebPasteboardProxy::typesSafeForDOMToReadAndWrite(const String& pasteboardName, const String& origin, CompletionHandler<void(Vector<String>&&)>&& completionHandler) 174 { 175 completionHandler(PlatformPasteboard(pasteboardName).typesSafeForDOMToReadAndWrite(origin)); 176 } 177 178 void WebPasteboardProxy::writeCustomData(const WebCore::PasteboardCustomData& data, const String& pasteboardName, CompletionHandler<void(uint64_t)>&& completionHandler) 179 { 180 completionHandler(PlatformPasteboard(pasteboardName).write(data)); 179 181 } 180 182 … … 201 203 } 202 204 203 void WebPasteboardProxy::readStringFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName, WTF::String& value) 204 { 205 value = PlatformPasteboard(pasteboardName).readString(index, pasteboardType); 206 } 207 208 void WebPasteboardProxy::readURLFromPasteboard(uint64_t index, const String& pasteboardName, String& url, String& title) 209 { 210 url = PlatformPasteboard(pasteboardName).readURL(index, title); 211 } 212 213 void WebPasteboardProxy::readBufferFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName, SharedMemory::Handle& handle, uint64_t& size) 205 void WebPasteboardProxy::readStringFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName, CompletionHandler<void(String&&)>&& completionHandler) 206 { 207 completionHandler(PlatformPasteboard(pasteboardName).readString(index, pasteboardType)); 208 } 209 210 void WebPasteboardProxy::readURLFromPasteboard(uint64_t index, const String& pasteboardName, CompletionHandler<void(String&& url, String&& title)>&& completionHandler) 211 { 212 String title; 213 String url = PlatformPasteboard(pasteboardName).readURL(index, title); 214 completionHandler(WTFMove(url), WTFMove(title)); 215 } 216 217 void WebPasteboardProxy::readBufferFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName, CompletionHandler<void(SharedMemory::Handle&&, uint64_t size)>&& completionHandler) 214 218 { 215 219 RefPtr<SharedBuffer> buffer = PlatformPasteboard(pasteboardName).readBuffer(index, pasteboardType); 216 220 if (!buffer) 217 return ;218 size = buffer->size();221 return completionHandler({ }, 0); 222 uint64_t size = buffer->size(); 219 223 if (!size) 220 return ;224 return completionHandler({ }, 0); 221 225 RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::allocate(size); 222 226 if (!sharedMemoryBuffer) 223 return ;227 return completionHandler({ }, 0); 224 228 memcpy(sharedMemoryBuffer->data(), buffer->data(), size); 229 SharedMemory::Handle handle; 225 230 sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly); 226 } 227 228 void WebPasteboardProxy::getPasteboardItemsCount(const String& pasteboardName, uint64_t& itemsCount) 229 { 230 itemsCount = PlatformPasteboard(pasteboardName).count(); 231 } 232 233 void WebPasteboardProxy::allPasteboardItemInfo(const String& pasteboardName, Vector<PasteboardItemInfo>& allInfo) 234 { 235 allInfo = PlatformPasteboard(pasteboardName).allPasteboardItemInfo(); 236 } 237 238 void WebPasteboardProxy::informationForItemAtIndex(int index, const String& pasteboardName, PasteboardItemInfo& info) 239 { 240 info = PlatformPasteboard(pasteboardName).informationForItemAtIndex(index); 231 completionHandler(WTFMove(handle), size); 232 } 233 234 void WebPasteboardProxy::getPasteboardItemsCount(const String& pasteboardName, CompletionHandler<void(uint64_t)>&& completionHandler) 235 { 236 completionHandler(PlatformPasteboard(pasteboardName).count()); 237 } 238 239 void WebPasteboardProxy::allPasteboardItemInfo(const String& pasteboardName, CompletionHandler<void(Vector<PasteboardItemInfo>&&)>&& completionHandler) 240 { 241 completionHandler(PlatformPasteboard(pasteboardName).allPasteboardItemInfo()); 242 } 243 244 void WebPasteboardProxy::informationForItemAtIndex(int index, const String& pasteboardName, CompletionHandler<void(PasteboardItemInfo&&)>&& completionHandler) 245 { 246 completionHandler(PlatformPasteboard(pasteboardName).informationForItemAtIndex(index)); 241 247 } 242 248 -
trunk/Source/WebKit/UIProcess/WebPasteboardProxy.cpp
r223195 r243325 64 64 #if !PLATFORM(COCOA) 65 65 66 void WebPasteboardProxy::typesSafeForDOMToReadAndWrite(const String&, const String&, Vector<String>& types)66 void WebPasteboardProxy::typesSafeForDOMToReadAndWrite(const String&, const String&, CompletionHandler<void(Vector<String>&&)>&& completionHandler) 67 67 { 68 types = { };68 completionHandler({ }); 69 69 } 70 70 71 void WebPasteboardProxy::writeCustomData(const WebCore::PasteboardCustomData&, const String&, uint64_t& newChangeCount)71 void WebPasteboardProxy::writeCustomData(const WebCore::PasteboardCustomData&, const String&, CompletionHandler<void(uint64_t)>&& completionHandler) 72 72 { 73 newChangeCount = 0;73 completionHandler(0); 74 74 } 75 75 -
trunk/Source/WebKit/UIProcess/WebPasteboardProxy.h
r241749 r243325 74 74 void writeImageToPasteboard(const WebCore::PasteboardImage&, const String& pasteboardName); 75 75 void writeStringToPasteboard(const String& pasteboardType, const String&, const String& pasteboardName); 76 void readStringFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName, WTF::String&);77 void readURLFromPasteboard(uint64_t index, const String& pasteboardName, String& url, String& title);78 void readBufferFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName, SharedMemory::Handle&, uint64_t& size);79 void getPasteboardItemsCount(const String& pasteboardName, uint64_t& itemsCount);80 void allPasteboardItemInfo(const String& pasteboardName, Vector<WebCore::PasteboardItemInfo>&);81 void informationForItemAtIndex(int index, const String& pasteboardName, WebCore::PasteboardItemInfo& filename);76 void readStringFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName, CompletionHandler<void(String&&)>&&); 77 void readURLFromPasteboard(uint64_t index, const String& pasteboardName, CompletionHandler<void(String&& url, String&& title)>&&); 78 void readBufferFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName, CompletionHandler<void(SharedMemory::Handle&&, uint64_t size)>&&); 79 void getPasteboardItemsCount(const String& pasteboardName, CompletionHandler<void(uint64_t)>&&); 80 void allPasteboardItemInfo(const String& pasteboardName, CompletionHandler<void(Vector<WebCore::PasteboardItemInfo>&&)>&&); 81 void informationForItemAtIndex(int index, const String& pasteboardName, CompletionHandler<void(WebCore::PasteboardItemInfo&&)>&&); 82 82 void updateSupportedTypeIdentifiers(const Vector<String>& identifiers, const String& pasteboardName); 83 83 #endif 84 84 #if PLATFORM(COCOA) 85 void getNumberOfFiles(const String& pasteboardName, uint64_t& numberOfFiles);86 void getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes);87 void getPasteboardPathnamesForType(IPC::Connection&, const String& pasteboardName, const String& pasteboardType, Vector<String>& pathnames, SandboxExtension::HandleArray&);88 void getPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, String&);89 void getPasteboardStringsForType(const String& pasteboardName, const String& pasteboardType, Vector<String>&);90 void getPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, SharedMemory::Handle&, uint64_t& size);91 void pasteboardCopy(const String& fromPasteboard, const String& toPasteboard, uint64_t& newChangeCount);92 void getPasteboardChangeCount(const String& pasteboardName, uint64_t& changeCount);93 void getPasteboardUniqueName( String& pasteboardName);94 void getPasteboardColor(const String& pasteboardName, WebCore::Color&);95 void getPasteboardURL(const String& pasteboardName, WTF::String&);96 void addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount);97 void setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, uint64_t& newChangeCount);98 void setPasteboardURL(IPC::Connection&, const WebCore::PasteboardURL&, const String& pasteboardName, uint64_t& newChangeCount);99 void setPasteboardColor(const String&, const WebCore::Color&, uint64_t&);100 void setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String&, uint64_t& newChangeCount);101 void setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle&, uint64_t size, uint64_t& newChangeCount);85 void getNumberOfFiles(const String& pasteboardName, CompletionHandler<void(uint64_t)>&&); 86 void getPasteboardTypes(const String& pasteboardName, CompletionHandler<void(Vector<String>&&)>&&); 87 void getPasteboardPathnamesForType(IPC::Connection&, const String& pasteboardName, const String& pasteboardType, CompletionHandler<void(Vector<String>&& pathnames, SandboxExtension::HandleArray&&)>&&); 88 void getPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, CompletionHandler<void(String&&)>&&); 89 void getPasteboardStringsForType(const String& pasteboardName, const String& pasteboardType, CompletionHandler<void(Vector<String>&&)>&&); 90 void getPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, CompletionHandler<void(SharedMemory::Handle&&, uint64_t)>&&); 91 void pasteboardCopy(const String& fromPasteboard, const String& toPasteboard, CompletionHandler<void(uint64_t)>&&); 92 void getPasteboardChangeCount(const String& pasteboardName, CompletionHandler<void(uint64_t)>&&); 93 void getPasteboardUniqueName(CompletionHandler<void(String&&)>&&); 94 void getPasteboardColor(const String& pasteboardName, CompletionHandler<void(WebCore::Color&&)>&&); 95 void getPasteboardURL(const String& pasteboardName, CompletionHandler<void(const String&)>&&); 96 void addPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, CompletionHandler<void(uint64_t)>&&); 97 void setPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes, CompletionHandler<void(uint64_t)>&&); 98 void setPasteboardURL(IPC::Connection&, const WebCore::PasteboardURL&, const String& pasteboardName, CompletionHandler<void(uint64_t)>&&); 99 void setPasteboardColor(const String&, const WebCore::Color&, CompletionHandler<void(uint64_t)>&&); 100 void setPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String&, CompletionHandler<void(uint64_t)>&&); 101 void setPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const SharedMemory::Handle&, uint64_t size, CompletionHandler<void(uint64_t)>&&); 102 102 #endif 103 103 104 void writeCustomData(const WebCore::PasteboardCustomData&, const String& pasteboardName, uint64_t& newChangeCount);105 void typesSafeForDOMToReadAndWrite(const String& pasteboardName, const String& origin, Vector<String>& types);104 void writeCustomData(const WebCore::PasteboardCustomData&, const String& pasteboardName, CompletionHandler<void(uint64_t)>&&); 105 void typesSafeForDOMToReadAndWrite(const String& pasteboardName, const String& origin, CompletionHandler<void(Vector<String>&&)>&&); 106 106 107 107 #if PLATFORM(GTK) 108 108 void writeToClipboard(const String& pasteboardName, const WebSelectionData&); 109 void readFromClipboard(const String& pasteboardName, WebSelectionData&);109 void readFromClipboard(const String& pasteboardName, CompletionHandler<void(WebSelectionData&&)>&&); 110 110 111 111 WebFrameProxy* m_primarySelectionOwner { nullptr }; … … 114 114 115 115 #if USE(LIBWPE) 116 void getPasteboardTypes( Vector<String>& pasteboardTypes);117 void readStringFromPasteboard(uint64_t index, const String& pasteboardType, WTF::String&);116 void getPasteboardTypes(CompletionHandler<void(Vector<String>&&)>&&); 117 void readStringFromPasteboard(uint64_t index, const String& pasteboardType, CompletionHandler<void(String&&)>&&); 118 118 void writeWebContentToPasteboard(const WebCore::PasteboardWebContent&); 119 119 void writeStringToPasteboard(const String& pasteboardType, const String&); -
trunk/Source/WebKit/UIProcess/WebPasteboardProxy.messages.in
r241749 r243325 27 27 WriteImageToPasteboard(struct WebCore::PasteboardImage pasteboardImage, String pasteboardName) 28 28 WriteStringToPasteboard(String pasteboardType, String text, String pasteboardName) 29 ReadStringFromPasteboard(uint64_t index, String pasteboardType, String pasteboardName) -> (String string) LegacySync30 ReadURLFromPasteboard(uint64_t index, String pasteboardName) -> (String url, String title) LegacySync31 ReadBufferFromPasteboard(uint64_t index, String pasteboardType, String pasteboardName) -> (WebKit::SharedMemory::Handle handle, uint64_t size) LegacySync32 GetPasteboardItemsCount(String pasteboardName) -> (uint64_t itemsCount) LegacySync33 AllPasteboardItemInfo(String pasteboardName) -> (Vector<WebCore::PasteboardItemInfo> allInfo) LegacySync34 InformationForItemAtIndex(uint64_t index, String pasteboardName) -> (struct WebCore::PasteboardItemInfo info) LegacySync29 ReadStringFromPasteboard(uint64_t index, String pasteboardType, String pasteboardName) -> (String string) Delayed 30 ReadURLFromPasteboard(uint64_t index, String pasteboardName) -> (String url, String title) Delayed 31 ReadBufferFromPasteboard(uint64_t index, String pasteboardType, String pasteboardName) -> (WebKit::SharedMemory::Handle handle, uint64_t size) Delayed 32 GetPasteboardItemsCount(String pasteboardName) -> (uint64_t itemsCount) Delayed 33 AllPasteboardItemInfo(String pasteboardName) -> (Vector<WebCore::PasteboardItemInfo> allInfo) Delayed 34 InformationForItemAtIndex(uint64_t index, String pasteboardName) -> (struct WebCore::PasteboardItemInfo info) Delayed 35 35 UpdateSupportedTypeIdentifiers(Vector<String> identifiers, String pasteboardName) 36 36 #endif 37 37 38 WriteCustomData(struct WebCore::PasteboardCustomData data, String pasteboardName) -> (uint64_t changeCount) LegacySync39 TypesSafeForDOMToReadAndWrite(String pasteboardName, String origin) -> (Vector<String> types) LegacySync38 WriteCustomData(struct WebCore::PasteboardCustomData data, String pasteboardName) -> (uint64_t changeCount) Delayed 39 TypesSafeForDOMToReadAndWrite(String pasteboardName, String origin) -> (Vector<String> types) Delayed 40 40 41 41 #if PLATFORM(COCOA) 42 42 # Pasteboard messages. 43 GetNumberOfFiles(String pasteboardName) -> (uint64_t numberOfFiles) LegacySync44 GetPasteboardTypes(String pasteboardName) -> (Vector<String> types) LegacySync45 GetPasteboardPathnamesForType(String pasteboardName, String pasteboardType) -> (Vector<String> pathnames, WebKit::SandboxExtension::HandleArray sandboxExtensions) LegacySyncWantsConnection46 GetPasteboardStringForType(String pasteboardName, String pasteboardType) -> (String string) LegacySync47 GetPasteboardStringsForType(String pasteboardName, String pasteboardType) -> (Vector<String> strings) LegacySync48 GetPasteboardBufferForType(String pasteboardName, String pasteboardType) -> (WebKit::SharedMemory::Handle handle, uint64_t size) LegacySync49 PasteboardCopy(String fromPasteboard, String toPasteboard) -> (uint64_t changeCount) LegacySync50 GetPasteboardChangeCount(String pasteboardName) -> (uint64_t changeCount) LegacySync51 GetPasteboardUniqueName() -> (String pasteboardName) LegacySync52 GetPasteboardColor(String pasteboardName) -> (WebCore::Color color) LegacySync53 GetPasteboardURL(String pasteboardName) -> (String urlString) LegacySync54 AddPasteboardTypes(String pasteboardName, Vector<String> pasteboardTypes) -> (uint64_t changeCount) LegacySync55 SetPasteboardTypes(String pasteboardName, Vector<String> pasteboardTypes) -> (uint64_t changeCount) LegacySync56 SetPasteboardURL(struct WebCore::PasteboardURL pasteboardURL, String pasteboardName) -> (uint64_t changeCount) LegacySyncWantsConnection57 SetPasteboardColor(String pasteboardName, WebCore::Color color) -> (uint64_t changeCount) LegacySync58 SetPasteboardStringForType(String pasteboardName, String pasteboardType, String string) -> (uint64_t changeCount) LegacySync59 SetPasteboardBufferForType(String pasteboardName, String pasteboardType, WebKit::SharedMemory::Handle handle, uint64_t size) -> (uint64_t changeCount) LegacySync43 GetNumberOfFiles(String pasteboardName) -> (uint64_t numberOfFiles) Delayed 44 GetPasteboardTypes(String pasteboardName) -> (Vector<String> types) Delayed 45 GetPasteboardPathnamesForType(String pasteboardName, String pasteboardType) -> (Vector<String> pathnames, WebKit::SandboxExtension::HandleArray sandboxExtensions) Delayed WantsConnection 46 GetPasteboardStringForType(String pasteboardName, String pasteboardType) -> (String string) Delayed 47 GetPasteboardStringsForType(String pasteboardName, String pasteboardType) -> (Vector<String> strings) Delayed 48 GetPasteboardBufferForType(String pasteboardName, String pasteboardType) -> (WebKit::SharedMemory::Handle handle, uint64_t size) Delayed 49 PasteboardCopy(String fromPasteboard, String toPasteboard) -> (uint64_t changeCount) Delayed 50 GetPasteboardChangeCount(String pasteboardName) -> (uint64_t changeCount) Delayed 51 GetPasteboardUniqueName() -> (String pasteboardName) Delayed 52 GetPasteboardColor(String pasteboardName) -> (WebCore::Color color) Delayed 53 GetPasteboardURL(String pasteboardName) -> (String urlString) Delayed 54 AddPasteboardTypes(String pasteboardName, Vector<String> pasteboardTypes) -> (uint64_t changeCount) Delayed 55 SetPasteboardTypes(String pasteboardName, Vector<String> pasteboardTypes) -> (uint64_t changeCount) Delayed 56 SetPasteboardURL(struct WebCore::PasteboardURL pasteboardURL, String pasteboardName) -> (uint64_t changeCount) Delayed WantsConnection 57 SetPasteboardColor(String pasteboardName, WebCore::Color color) -> (uint64_t changeCount) Delayed 58 SetPasteboardStringForType(String pasteboardName, String pasteboardType, String string) -> (uint64_t changeCount) Delayed 59 SetPasteboardBufferForType(String pasteboardName, String pasteboardType, WebKit::SharedMemory::Handle handle, uint64_t size) -> (uint64_t changeCount) Delayed 60 60 #endif 61 61 62 62 #if PLATFORM(GTK) 63 WriteToClipboard(String pasteboardName, struct WebKit::WebSelectionData pasteboardContent) LegacySync64 ReadFromClipboard(String pasteboardName) -> (struct WebKit::WebSelectionData pasteboardContent) LegacySync63 WriteToClipboard(String pasteboardName, struct WebKit::WebSelectionData pasteboardContent) 64 ReadFromClipboard(String pasteboardName) -> (struct WebKit::WebSelectionData pasteboardContent) Delayed 65 65 #endif 66 66 67 67 #if USE(LIBWPE) 68 GetPasteboardTypes() -> (Vector<String> types) LegacySync69 ReadStringFromPasteboard(uint64_t index, String pasteboardType) -> (String string) LegacySync70 WriteWebContentToPasteboard(struct WebCore::PasteboardWebContent content) LegacySync71 WriteStringToPasteboard(String pasteboardType, String text) LegacySync68 GetPasteboardTypes() -> (Vector<String> types) Delayed 69 ReadStringFromPasteboard(uint64_t index, String pasteboardType) -> (String string) Delayed 70 WriteWebContentToPasteboard(struct WebCore::PasteboardWebContent content) 71 WriteStringToPasteboard(String pasteboardType, String text) 72 72 #endif 73 73 } -
trunk/Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp
r228373 r243325 45 45 } 46 46 47 void WebPasteboardProxy::readFromClipboard(const String& pasteboardName, WebSelectionData& selection)47 void WebPasteboardProxy::readFromClipboard(const String& pasteboardName, CompletionHandler<void(WebSelectionData&&)>&& completionHandler) 48 48 { 49 selection = WebSelectionData(PlatformPasteboard(pasteboardName).readFromClipboard());49 completionHandler(WebSelectionData(PlatformPasteboard(pasteboardName).readFromClipboard())); 50 50 } 51 51 -
trunk/Source/WebKit/UIProcess/wpe/WebPasteboardProxyWPE.cpp
r235265 r243325 33 33 using namespace WebCore; 34 34 35 void WebPasteboardProxy::getPasteboardTypes( Vector<String>& pasteboardTypes)35 void WebPasteboardProxy::getPasteboardTypes(CompletionHandler<void(Vector<String>&&)>&& completionHandler) 36 36 { 37 Vector<String> pasteboardTypes; 37 38 PlatformPasteboard().getTypes(pasteboardTypes); 39 completionHandler(WTFMove(pasteboardTypes)); 38 40 } 39 41 40 void WebPasteboardProxy::readStringFromPasteboard(uint64_t index, const String& pasteboardType, WTF::String& value)42 void WebPasteboardProxy::readStringFromPasteboard(uint64_t index, const String& pasteboardType, CompletionHandler<void(String&&)>&& completionHandler) 41 43 { 42 value = PlatformPasteboard().readString(index, pasteboardType);44 completionHandler(PlatformPasteboard().readString(index, pasteboardType)); 43 45 } 44 46
Note: See TracChangeset
for help on using the changeset viewer.