Changeset 142170 in webkit
- Timestamp:
- Feb 7, 2013 1:26:41 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142168 r142170 1 2013-02-07 Gavin Peters <gavinp@chromium.org> 2 3 Unreviewed, rolling out r142155. 4 http://trac.webkit.org/changeset/142155 5 https://bugs.webkit.org/show_bug.cgi?id=82888 6 7 cr/win build broke. 8 9 * bindings/js/JSClipboardCustom.cpp: 10 (WebCore::JSClipboard::types): 11 * bindings/v8/custom/V8ClipboardCustom.cpp: 12 (WebCore::V8Clipboard::typesAccessorGetter): 13 * dom/Clipboard.h: 14 (Clipboard): 15 * platform/blackberry/ClipboardBlackBerry.cpp: 16 (WebCore::ClipboardBlackBerry::types): 17 * platform/blackberry/ClipboardBlackBerry.h: 18 (ClipboardBlackBerry): 19 * platform/chromium/ChromiumDataObject.cpp: 20 (WebCore::ChromiumDataObject::types): 21 * platform/chromium/ChromiumDataObject.h: 22 (ChromiumDataObject): 23 * platform/chromium/ClipboardChromium.cpp: 24 (WebCore::ClipboardChromium::types): 25 * platform/chromium/ClipboardChromium.h: 26 (ClipboardChromium): 27 * platform/efl/ClipboardEfl.cpp: 28 (WebCore::ClipboardEfl::types): 29 * platform/efl/ClipboardEfl.h: 30 (ClipboardEfl): 31 * platform/gtk/ClipboardGtk.cpp: 32 (WebCore::ClipboardGtk::types): 33 * platform/gtk/ClipboardGtk.h: 34 (ClipboardGtk): 35 * platform/mac/ClipboardMac.h: 36 (ClipboardMac): 37 * platform/mac/ClipboardMac.mm: 38 (WebCore::addHTMLClipboardTypesForCocoaType): 39 (WebCore::ClipboardMac::types): 40 * platform/qt/ClipboardQt.cpp: 41 (WebCore::ClipboardQt::types): 42 * platform/qt/ClipboardQt.h: 43 (ClipboardQt): 44 * platform/win/ClipboardWin.cpp: 45 (WebCore::addMimeTypesForFormat): 46 (WebCore::ClipboardWin::types): 47 * platform/win/ClipboardWin.h: 48 (ClipboardWin): 49 1 50 2013-02-07 Rik Cabanier <cabanier@adobe.com> 2 51 -
trunk/Source/WebCore/bindings/js/JSClipboardCustom.cpp
r142155 r142170 52 52 Clipboard* clipboard = impl(); 53 53 54 Vector<String> types = clipboard->types();54 ListHashSet<String> types = clipboard->types(); 55 55 if (types.isEmpty()) 56 56 return jsNull(); 57 57 58 58 MarkedArgumentBuffer list; 59 Vector<String>::const_iterator end = types.end();60 for ( Vector<String>::const_iterator it = types.begin(); it != end; ++it)59 ListHashSet<String>::const_iterator end = types.end(); 60 for (ListHashSet<String>::const_iterator it = types.begin(); it != end; ++it) 61 61 list.append(jsStringWithCache(exec, *it)); 62 62 return constructArray(exec, 0, globalObject(), list); -
trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
r142155 r142170 48 48 Clipboard* clipboard = V8Clipboard::toNative(info.Holder()); 49 49 50 Vector<String> types = clipboard->types();50 ListHashSet<String> types = clipboard->types(); 51 51 if (types.isEmpty()) 52 52 return v8Null(info.GetIsolate()); 53 53 54 54 v8::Local<v8::Array> result = v8::Array::New(types.size()); 55 Vector<String>::const_iterator end = types.end();55 ListHashSet<String>::const_iterator end = types.end(); 56 56 int index = 0; 57 for ( Vector<String>::const_iterator it = types.begin(); it != end; ++it, ++index)57 for (ListHashSet<String>::const_iterator it = types.begin(); it != end; ++it, ++index) 58 58 result->Set(v8Integer(index, info.GetIsolate()), v8String(*it, info.GetIsolate())); 59 59 -
trunk/Source/WebCore/dom/Clipboard.h
r142155 r142170 67 67 68 68 // extensions beyond IE's API 69 virtual Vector<String> types() const = 0;69 virtual ListHashSet<String> types() const = 0; 70 70 virtual PassRefPtr<FileList> files() const = 0; 71 71 -
trunk/Source/WebCore/platform/blackberry/ClipboardBlackBerry.cpp
r142155 r142170 79 79 } 80 80 81 Vector<String> ClipboardBlackBerry::types() const81 ListHashSet<String> ClipboardBlackBerry::types() const 82 82 { 83 83 if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) 84 return Vector<String>();84 return ListHashSet<String>(); 85 85 86 86 // We use hardcoded list here since there seems to be no API to get the list. 87 Vector<String> ret;88 ret.a ppend(ASCIILiteral("text/plain"));89 ret.a ppend(ASCIILiteral("text/html"));90 ret.a ppend(ASCIILiteral("text/url"));87 ListHashSet<String> ret; 88 ret.add("text/plain"); 89 ret.add("text/html"); 90 ret.add("text/url"); 91 91 return ret; 92 92 } -
trunk/Source/WebCore/platform/blackberry/ClipboardBlackBerry.h
r142155 r142170 40 40 41 41 // extensions beyond IE's API 42 virtual Vector<String> types() const;42 virtual ListHashSet<String> types() const; 43 43 virtual PassRefPtr<FileList> files() const; 44 44 virtual DragImageRef createDragImage(IntPoint&) const; -
trunk/Source/WebCore/platform/chromium/ChromiumDataObject.cpp
r142155 r142170 127 127 } 128 128 129 Vector<String> ChromiumDataObject::types() const130 { 131 Vector<String> results;129 ListHashSet<String> ChromiumDataObject::types() const 130 { 131 ListHashSet<String> results; 132 132 bool containsFiles = false; 133 133 for (size_t i = 0; i < m_itemList.size(); ++i) { 134 134 if (m_itemList[i]->kind() == DataTransferItem::kindString) 135 results.a ppend(m_itemList[i]->type());135 results.add(m_itemList[i]->type()); 136 136 else if (m_itemList[i]->kind() == DataTransferItem::kindFile) 137 137 containsFiles = true; … … 140 140 } 141 141 if (containsFiles) 142 results.a ppend(ASCIILiteral(mimeTypeFiles));142 results.add(mimeTypeFiles); 143 143 return results; 144 144 } -
trunk/Source/WebCore/platform/chromium/ChromiumDataObject.h
r142155 r142170 70 70 void clearAllExceptFiles(); 71 71 72 Vector<String> types() const;72 ListHashSet<String> types() const; 73 73 String getData(const String& type) const; 74 74 bool setData(const String& type, const String& data); -
trunk/Source/WebCore/platform/chromium/ClipboardChromium.cpp
r142155 r142170 276 276 277 277 // extensions beyond IE's API 278 Vector<String> ClipboardChromium::types() const278 ListHashSet<String> ClipboardChromium::types() const 279 279 { 280 280 if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) 281 return Vector<String>();281 return ListHashSet<String>(); 282 282 283 283 return m_dataObject->types(); -
trunk/Source/WebCore/platform/chromium/ClipboardChromium.h
r142155 r142170 85 85 86 86 // extensions beyond IE's API 87 virtual Vector<String> types() const;87 virtual ListHashSet<String> types() const; 88 88 virtual PassRefPtr<FileList> files() const; 89 89 -
trunk/Source/WebCore/platform/efl/ClipboardEfl.cpp
r142155 r142170 77 77 } 78 78 79 Vector<String> ClipboardEfl::types() const79 ListHashSet<String> ClipboardEfl::types() const 80 80 { 81 81 notImplemented(); 82 return Vector<String>();82 return ListHashSet<String>(); 83 83 } 84 84 -
trunk/Source/WebCore/platform/efl/ClipboardEfl.h
r142155 r142170 40 40 bool setData(const String&, const String&); 41 41 42 Vector<String> types() const;42 ListHashSet<String> types() const; 43 43 virtual PassRefPtr<FileList> files() const; 44 44 -
trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp
r142155 r142170 189 189 } 190 190 191 Vector<String> ClipboardGtk::types() const191 ListHashSet<String> ClipboardGtk::types() const 192 192 { 193 193 if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) 194 return Vector<String>();194 return ListHashSet<String>(); 195 195 196 196 if (m_clipboard) 197 197 PasteboardHelper::defaultPasteboardHelper()->getClipboardContents(m_clipboard); 198 198 199 Vector<String> types;199 ListHashSet<String> types; 200 200 if (m_dataObject->hasText()) { 201 types.a ppend(ASCIILiteral("text/plain"));202 types.a ppend(ASCIILiteral("Text"));203 types.a ppend(ASCIILiteral("text"));201 types.add("text/plain"); 202 types.add("Text"); 203 types.add("text"); 204 204 } 205 205 206 206 if (m_dataObject->hasMarkup()) 207 types.a ppend(ASCIILiteral("text/html"));207 types.add("text/html"); 208 208 209 209 if (m_dataObject->hasURIList()) { 210 types.a ppend(ASCIILiteral("text/uri-list"));211 types.a ppend(ASCIILiteral("URL"));210 types.add("text/uri-list"); 211 types.add("URL"); 212 212 } 213 213 214 214 if (m_dataObject->hasFilenames()) 215 types.a ppend(ASCIILiteral("Files"));215 types.add("Files"); 216 216 217 217 return types; -
trunk/Source/WebCore/platform/gtk/ClipboardGtk.h
r142155 r142170 58 58 bool setData(const String&, const String&); 59 59 60 virtual Vector<String> types() const;60 virtual ListHashSet<String> types() const; 61 61 virtual PassRefPtr<FileList> files() const; 62 62 -
trunk/Source/WebCore/platform/mac/ClipboardMac.h
r142155 r142170 63 63 64 64 // extensions beyond IE's API 65 virtual Vector<String> types() const;65 virtual ListHashSet<String> types() const; 66 66 virtual PassRefPtr<FileList> files() const; 67 67 -
trunk/Source/WebCore/platform/mac/ClipboardMac.mm
r142155 r142170 119 119 } 120 120 121 static void addHTMLClipboardTypesForCocoaType( Vector<String>& resultTypes, const String& cocoaType, const String& pasteboardName)121 static void addHTMLClipboardTypesForCocoaType(ListHashSet<String>& resultTypes, const String& cocoaType, const String& pasteboardName) 122 122 { 123 123 // UTI may not do these right, so make sure we get the right, predictable result 124 124 if (cocoaType == String(NSStringPboardType)) { 125 resultTypes.a ppend(ASCIILiteral("text/plain"));125 resultTypes.add("text/plain"); 126 126 return; 127 127 } 128 128 if (cocoaType == String(NSURLPboardType)) { 129 resultTypes.a ppend(ASCIILiteral("text/uri-list"));129 resultTypes.add("text/uri-list"); 130 130 return; 131 131 } … … 139 139 // It is unknown if NSFilenamesPboardType always implies NSURLPboardType in Cocoa, 140 140 // but NSFilenamesPboardType should imply both 'text/uri-list' and 'Files' 141 resultTypes.a ppend(ASCIILiteral("text/uri-list"));142 resultTypes.a ppend(ASCIILiteral("Files"));141 resultTypes.add("text/uri-list"); 142 resultTypes.add("Files"); 143 143 } 144 144 return; … … 146 146 String utiType = utiTypeFromCocoaType(cocoaType); 147 147 if (!utiType.isEmpty()) { 148 resultTypes.a ppend(utiType);148 resultTypes.add(utiType); 149 149 return; 150 150 } 151 151 // No mapping, just pass the whole string though 152 resultTypes.a ppend(cocoaType);152 resultTypes.add(cocoaType); 153 153 } 154 154 … … 281 281 } 282 282 283 Vector<String> ClipboardMac::types() const283 ListHashSet<String> ClipboardMac::types() const 284 284 { 285 285 if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) 286 return Vector<String>();286 return ListHashSet<String>(); 287 287 288 288 Vector<String> types; … … 292 292 // sure it doesn't change between our testing the change count and accessing the data. 293 293 if (m_changeCount != platformStrategies()->pasteboardStrategy()->changeCount(m_pasteboardName)) 294 return Vector<String>();295 296 Vector<String> result;294 return ListHashSet<String>(); 295 296 ListHashSet<String> result; 297 297 // FIXME: This loop could be split into two stages. One which adds all the HTML5 specified types 298 298 // and a second which adds all the extra types from the cocoa clipboard (which is Mac-only behavior). -
trunk/Source/WebCore/platform/qt/ClipboardQt.cpp
r142155 r142170 183 183 184 184 // extensions beyond IE's API 185 Vector<String> ClipboardQt::types() const185 ListHashSet<String> ClipboardQt::types() const 186 186 { 187 187 if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) 188 return Vector<String>();188 return ListHashSet<String>(); 189 189 190 190 ASSERT(m_readableData); 191 Vector<String> result;191 ListHashSet<String> result; 192 192 QStringList formats = m_readableData->formats(); 193 193 for (int i = 0; i < formats.count(); ++i) 194 result.a ppend(formats.at(i));194 result.add(formats.at(i)); 195 195 return result; 196 196 } -
trunk/Source/WebCore/platform/qt/ClipboardQt.h
r142155 r142170 58 58 59 59 // extensions beyond IE's API 60 virtual Vector<String> types() const;60 virtual ListHashSet<String> types() const; 61 61 virtual PassRefPtr<FileList> files() const; 62 62 -
trunk/Source/WebCore/platform/win/ClipboardWin.cpp
r142155 r142170 485 485 } 486 486 487 static void addMimeTypesForFormat( Vector<String>& results, const FORMATETC& format)487 static void addMimeTypesForFormat(ListHashSet<String>& results, const FORMATETC& format) 488 488 { 489 489 // URL and Text are provided for compatibility with IE's model 490 490 if (format.cfFormat == urlFormat()->cfFormat || format.cfFormat == urlWFormat()->cfFormat) { 491 results.a ppend(ASCIILiteral("URL"));492 results.a ppend(ASCIILiteral("text/uri-list"));491 results.add("URL"); 492 results.add("text/uri-list"); 493 493 } 494 494 495 495 if (format.cfFormat == plainTextWFormat()->cfFormat || format.cfFormat == plainTextFormat()->cfFormat) { 496 results.a ppend(ASCIILiteral("Text"));497 results.a ppend(ASCIILiteral("text/plain"));496 results.add("Text"); 497 results.add("text/plain"); 498 498 } 499 499 } 500 500 501 501 // extensions beyond IE's API 502 Vector<String> ClipboardWin::types() const502 ListHashSet<String> ClipboardWin::types() const 503 503 { 504 Vector<String> results;504 ListHashSet<String> results; 505 505 if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable) 506 506 return results; -
trunk/Source/WebCore/platform/win/ClipboardWin.h
r142155 r142170 65 65 66 66 // extensions beyond IE's API 67 virtual Vector<String> types() const;67 virtual ListHashSet<String> types() const; 68 68 virtual PassRefPtr<FileList> files() const; 69 69
Note: See TracChangeset
for help on using the changeset viewer.