Changeset 286708 in webkit
- Timestamp:
- Dec 8, 2021, 12:46:39 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
platform/win/ClipboardUtilitiesWin.cpp (modified) (11 diffs)
-
platform/win/DragDataWin.cpp (modified) (4 diffs)
-
platform/win/PasteboardWin.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r286705 r286708 1 2021-12-08 Don Olmstead <don.olmstead@sony.com> 2 3 [Win] WebCore::cfHDropFormat implementation is not CF specific 4 https://bugs.webkit.org/show_bug.cgi?id=234021 5 6 Reviewed by Alex Christensen. 7 8 The implementation of cfHDropFormat was guarded by USE(CF) but there is nothing CF specific 9 about the implementation. Drop the guards around it and any of its callers. 10 11 Renaming CFData functions to HDropData to better represent the underlying Windows type for 12 the clipboard and make sure its not mistaken for CoreFoundation functionality. 13 14 * platform/win/ClipboardUtilitiesWin.cpp: 15 (WebCore::getWebLocData): 16 (WebCore::getHDropData): 17 (WebCore::setHDropData): 18 (WebCore::getClipboardMap): 19 (WebCore::getCFData): Deleted. 20 (WebCore::setCFData): Deleted. 21 * platform/win/DragDataWin.cpp: 22 (WebCore::DragData::containsFiles const): 23 (WebCore::DragData::numberOfFiles const): 24 (WebCore::DragData::asFilenames const): 25 * platform/win/PasteboardWin.cpp: 26 (WebCore::Pasteboard::read): 27 (WebCore::writeFileToDataObject): 28 1 29 2021-12-08 Truitt Savell <tsavell@apple.com> 2 30 -
trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
r277967 r286708 47 47 namespace WebCore { 48 48 49 #if USE(CF)50 49 FORMATETC* cfHDropFormat() 51 50 { … … 53 52 return &urlFormat; 54 53 } 54 55 #if USE(CF) 55 56 56 57 static bool urlFromPath(CFStringRef path, String& url) … … 85 86 { 86 87 bool succeeded = false; 87 #if USE(CF)88 88 WCHAR filename[MAX_PATH]; 89 89 WCHAR urlBuffer[INTERNET_MAX_URL_LENGTH]; … … 119 119 DragFinish(hdrop); 120 120 GlobalUnlock(medium.hGlobal); 121 #endif122 121 return succeeded; 123 122 } … … 125 124 static bool getWebLocData(const DragDataMap* dataObject, String& url, String* title) 126 125 { 127 #if USE(CF)128 126 WCHAR filename[MAX_PATH]; 129 127 WCHAR urlBuffer[INTERNET_MAX_URL_LENGTH]; … … 146 144 url = String(urlBuffer); 147 145 return true; 148 #else149 return false;150 #endif151 146 } 152 147 … … 740 735 } 741 736 742 #if USE(CF) 743 void getCFData(IDataObject* data, FORMATETC* format, Vector<String>& dataStrings) 737 void getHDropData(IDataObject* data, FORMATETC* format, Vector<String>& dataStrings) 744 738 { 745 739 STGMEDIUM store; … … 762 756 ReleaseStgMedium(&store); 763 757 } 764 #endif765 758 766 759 // Setter functions. … … 796 789 } 797 790 798 #if USE(CF) 799 void setCFData(IDataObject* data, FORMATETC* format, const Vector<String>& dataStrings) 791 void setHDropData(IDataObject* data, FORMATETC* format, const Vector<String>& dataStrings) 800 792 { 801 793 STGMEDIUM medium { }; … … 816 808 ::GlobalFree(medium.hGlobal); 817 809 } 818 #endif819 810 820 811 static const ClipboardFormatMap& getClipboardMap() … … 826 817 formatMap.add(plainTextFormat()->cfFormat, new ClipboardDataItem(plainTextFormat(), getStringData<char>, setUtf8Data)); 827 818 formatMap.add(plainTextWFormat()->cfFormat, new ClipboardDataItem(plainTextWFormat(), getStringData<UChar>, setUCharData)); 828 #if USE(CF) 829 formatMap.add(cfHDropFormat()->cfFormat, new ClipboardDataItem(cfHDropFormat(), getCFData, setCFData)); 830 #endif 819 formatMap.add(cfHDropFormat()->cfFormat, new ClipboardDataItem(cfHDropFormat(), getHDropData, setHDropData)); 831 820 formatMap.add(filenameFormat()->cfFormat, new ClipboardDataItem(filenameFormat(), getStringData<char>, setUtf8Data)); 832 821 formatMap.add(filenameWFormat()->cfFormat, new ClipboardDataItem(filenameWFormat(), getStringData<UChar>, setUCharData)); -
trunk/Source/WebCore/platform/win/DragDataWin.cpp
r278253 r286708 104 104 bool DragData::containsFiles() const 105 105 { 106 #if USE(CF)107 106 return (m_platformDragData) ? SUCCEEDED(m_platformDragData->QueryGetData(cfHDropFormat())) : m_dragDataMap.contains(cfHDropFormat()->cfFormat); 108 #else109 return false;110 #endif111 107 } 112 108 113 109 unsigned DragData::numberOfFiles() const 114 110 { 115 #if USE(CF)116 111 if (!m_platformDragData) 117 112 return 0; … … 132 127 133 128 return numFiles; 134 #else135 return 0;136 #endif137 129 } 138 130 … … 141 133 Vector<String> result; 142 134 143 #if USE(CF)144 135 if (m_platformDragData) { 145 136 WCHAR filename[MAX_PATH]; … … 168 159 } 169 160 result = m_dragDataMap.get(cfHDropFormat()->cfFormat); 170 #endif171 161 172 162 return result; -
trunk/Source/WebCore/platform/win/PasteboardWin.cpp
r284095 r286708 372 372 void Pasteboard::read(PasteboardFileReader& reader, std::optional<size_t>) 373 373 { 374 #if USE(CF)375 374 if (m_dataObject) { 376 375 STGMEDIUM medium; … … 400 399 for (auto& filename : list->value) 401 400 reader.readFilename(filename); 402 #else403 UNUSED_PARAM(reader);404 notImplemented();405 return;406 #endif407 401 } 408 402 … … 672 666 goto exit; 673 667 674 #if USE(CF)675 668 // HDROP 676 669 if (hDropContent) { … … 678 671 hr = dataObject->SetData(cfHDropFormat(), &medium, TRUE); 679 672 } 680 #endif681 673 682 674 exit:
Note:
See TracChangeset
for help on using the changeset viewer.