WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-234021.diff (text/plain), 7.62 KB, created by
Don Olmstead
on 2021-12-08 11:28:27 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Don Olmstead
Created:
2021-12-08 11:28:27 PST
Size:
7.62 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2ced8dfe2422..ede07679b5ab 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2021-12-08 Don Olmstead <don.olmstead@sony.com> >+ >+ [Win] WebCore::cfHDropFormat implementation is not CF specific >+ https://bugs.webkit.org/show_bug.cgi?id=234021 >+ >+ Reviewed by Alex Christensen. >+ >+ The implementation of cfHDropFormat was guarded by USE(CF) but there is nothing CF specific >+ about the implementation. Drop the guards around it and any of its callers. >+ >+ Renaming CFData functions to HDropData to better represent the underlying Windows type for >+ the clipboard and make sure its not mistaken for CoreFoundation functionality. >+ >+ * platform/win/ClipboardUtilitiesWin.cpp: >+ (WebCore::getWebLocData): >+ (WebCore::getHDropData): >+ (WebCore::setHDropData): >+ (WebCore::getClipboardMap): >+ (WebCore::getCFData): Deleted. >+ (WebCore::setCFData): Deleted. >+ * platform/win/DragDataWin.cpp: >+ (WebCore::DragData::containsFiles const): >+ (WebCore::DragData::numberOfFiles const): >+ (WebCore::DragData::asFilenames const): >+ * platform/win/PasteboardWin.cpp: >+ (WebCore::Pasteboard::read): >+ (WebCore::writeFileToDataObject): >+ > 2021-12-08 Antti Koivisto <antti@apple.com> > > [CSS Cascade Layers] Update CSSOM to the spec >diff --git a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp >index 3e97e804e115..26d392641f68 100644 >--- a/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp >+++ b/Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp >@@ -46,13 +46,14 @@ > > namespace WebCore { > >-#if USE(CF) > FORMATETC* cfHDropFormat() > { > static FORMATETC urlFormat = {CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; > return &urlFormat; > } > >+#if USE(CF) >+ > static bool urlFromPath(CFStringRef path, String& url) > { > if (!path) >@@ -84,7 +85,6 @@ static bool getDataMapItem(const DragDataMap* dataObject, FORMATETC* format, Str > static bool getWebLocData(IDataObject* dataObject, String& url, String* title) > { > bool succeeded = false; >-#if USE(CF) > WCHAR filename[MAX_PATH]; > WCHAR urlBuffer[INTERNET_MAX_URL_LENGTH]; > >@@ -118,13 +118,11 @@ exit: > // Free up memory. > DragFinish(hdrop); > GlobalUnlock(medium.hGlobal); >-#endif > return succeeded; > } > > static bool getWebLocData(const DragDataMap* dataObject, String& url, String* title) > { >-#if USE(CF) > WCHAR filename[MAX_PATH]; > WCHAR urlBuffer[INTERNET_MAX_URL_LENGTH]; > >@@ -145,9 +143,6 @@ static bool getWebLocData(const DragDataMap* dataObject, String& url, String* ti > > url = String(urlBuffer); > return true; >-#else >- return false; >-#endif > } > > static String extractURL(const String &inURL, String* title) >@@ -739,8 +734,7 @@ void getUtf8Data(IDataObject* data, FORMATETC* format, Vector<String>& dataStrin > ReleaseStgMedium(&store); > } > >-#if USE(CF) >-void getCFData(IDataObject* data, FORMATETC* format, Vector<String>& dataStrings) >+void getHDropData(IDataObject* data, FORMATETC* format, Vector<String>& dataStrings) > { > STGMEDIUM store; > if (FAILED(data->GetData(format, &store))) >@@ -761,7 +755,6 @@ void getCFData(IDataObject* data, FORMATETC* format, Vector<String>& dataStrings > GlobalUnlock(store.hGlobal); > ReleaseStgMedium(&store); > } >-#endif > > // Setter functions. > >@@ -795,8 +788,7 @@ void setUtf8Data(IDataObject* data, FORMATETC* format, const Vector<String>& dat > ::GlobalFree(medium.hGlobal); > } > >-#if USE(CF) >-void setCFData(IDataObject* data, FORMATETC* format, const Vector<String>& dataStrings) >+void setHDropData(IDataObject* data, FORMATETC* format, const Vector<String>& dataStrings) > { > STGMEDIUM medium { }; > medium.tymed = TYMED_HGLOBAL; >@@ -815,7 +807,6 @@ void setCFData(IDataObject* data, FORMATETC* format, const Vector<String>& dataS > data->SetData(format, &medium, FALSE); > ::GlobalFree(medium.hGlobal); > } >-#endif > > static const ClipboardFormatMap& getClipboardMap() > { >@@ -825,9 +816,7 @@ static const ClipboardFormatMap& getClipboardMap() > formatMap.add(texthtmlFormat()->cfFormat, new ClipboardDataItem(texthtmlFormat(), getStringData<UChar>, setUCharData)); > formatMap.add(plainTextFormat()->cfFormat, new ClipboardDataItem(plainTextFormat(), getStringData<char>, setUtf8Data)); > formatMap.add(plainTextWFormat()->cfFormat, new ClipboardDataItem(plainTextWFormat(), getStringData<UChar>, setUCharData)); >-#if USE(CF) >- formatMap.add(cfHDropFormat()->cfFormat, new ClipboardDataItem(cfHDropFormat(), getCFData, setCFData)); >-#endif >+ formatMap.add(cfHDropFormat()->cfFormat, new ClipboardDataItem(cfHDropFormat(), getHDropData, setHDropData)); > formatMap.add(filenameFormat()->cfFormat, new ClipboardDataItem(filenameFormat(), getStringData<char>, setUtf8Data)); > formatMap.add(filenameWFormat()->cfFormat, new ClipboardDataItem(filenameWFormat(), getStringData<UChar>, setUCharData)); > formatMap.add(urlFormat()->cfFormat, new ClipboardDataItem(urlFormat(), getStringData<char>, setUtf8Data)); >diff --git a/Source/WebCore/platform/win/DragDataWin.cpp b/Source/WebCore/platform/win/DragDataWin.cpp >index 579a112579af..9ee178cd370a 100644 >--- a/Source/WebCore/platform/win/DragDataWin.cpp >+++ b/Source/WebCore/platform/win/DragDataWin.cpp >@@ -103,16 +103,11 @@ String DragData::asURL(FilenameConversionPolicy filenamePolicy, String* title) c > > bool DragData::containsFiles() const > { >-#if USE(CF) > return (m_platformDragData) ? SUCCEEDED(m_platformDragData->QueryGetData(cfHDropFormat())) : m_dragDataMap.contains(cfHDropFormat()->cfFormat); >-#else >- return false; >-#endif > } > > unsigned DragData::numberOfFiles() const > { >-#if USE(CF) > if (!m_platformDragData) > return 0; > >@@ -131,16 +126,12 @@ unsigned DragData::numberOfFiles() const > GlobalUnlock(medium.hGlobal); > > return numFiles; >-#else >- return 0; >-#endif > } > > Vector<String> DragData::asFilenames() const > { > Vector<String> result; > >-#if USE(CF) > if (m_platformDragData) { > WCHAR filename[MAX_PATH]; > >@@ -167,7 +158,6 @@ Vector<String> DragData::asFilenames() const > return result; > } > result = m_dragDataMap.get(cfHDropFormat()->cfFormat); >-#endif > > return result; > } >diff --git a/Source/WebCore/platform/win/PasteboardWin.cpp b/Source/WebCore/platform/win/PasteboardWin.cpp >index c5445385a77a..58fe9b1d71ca 100644 >--- a/Source/WebCore/platform/win/PasteboardWin.cpp >+++ b/Source/WebCore/platform/win/PasteboardWin.cpp >@@ -371,7 +371,6 @@ Pasteboard::FileContentState Pasteboard::fileContentState() > > void Pasteboard::read(PasteboardFileReader& reader, std::optional<size_t>) > { >-#if USE(CF) > if (m_dataObject) { > STGMEDIUM medium; > if (FAILED(m_dataObject->GetData(cfHDropFormat(), &medium))) >@@ -399,11 +398,6 @@ void Pasteboard::read(PasteboardFileReader& reader, std::optional<size_t>) > > for (auto& filename : list->value) > reader.readFilename(filename); >-#else >- UNUSED_PARAM(reader); >- notImplemented(); >- return; >-#endif > } > > static bool writeURL(WCDataObject *data, const URL& url, String title, bool withPlainText, bool withHTML) >@@ -671,13 +665,11 @@ static HRESULT writeFileToDataObject(IDataObject* dataObject, HGLOBAL fileDescri > if (FAILED(hr = dataObject->SetData(fe, &medium, TRUE))) > goto exit; > >-#if USE(CF) > // HDROP > if (hDropContent) { > medium.hGlobal = hDropContent; > hr = dataObject->SetData(cfHDropFormat(), &medium, TRUE); > } >-#endif > > exit: > if (FAILED(hr)) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 234021
:
446389
| 446395