Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
Created attachment 323157 [details] Patch
I'm not sure about the name SizedIteratorRange. Maybe IteratorRangeWithSize? Maybe something more abstract, like Container?
Maybe SizedContainerProxy?
Created attachment 323174 [details] Patch
Created attachment 323177 [details] Patch
Comment on attachment 323177 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=323177&action=review > Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:80 > + WTF::SizedIteratorRange<OptionContainer, OptionContainer::iterator::Values> options() { return m_options.values(); } I’d like the type here to be OptionContainer::ValuesIteratorRange. Can we add some "using" to HashMap.h so we can do it that way instead of having to write out the type like this? > Source/WebKit/Shared/AsyncRequest.h:141 > + WTF::SizedIteratorRange<RequestMap, RequestMap::iterator::Values> values() Ditto. > Source/WebKit/UIProcess/WebProcessProxy.h:101 > + WTF::SizedIteratorRange<WebPageProxyMap, WebPageProxyMap::const_iterator::Values> pages() const { return m_pageMap.values(); } And again.
Comment on attachment 323177 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=323177&action=review >> Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:80 >> + WTF::SizedIteratorRange<OptionContainer, OptionContainer::iterator::Values> options() { return m_options.values(); } > > I’d like the type here to be OptionContainer::ValuesIteratorRange. Can we add some "using" to HashMap.h so we can do it that way instead of having to write out the type like this? Or is there some way to use std::result_of?
Created attachment 323196 [details] Patch
(In reply to Darin Adler from comment #7) > Comment on attachment 323177 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=323177&action=review > > >> Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:80 > >> + WTF::SizedIteratorRange<OptionContainer, OptionContainer::iterator::Values> options() { return m_options.values(); } > > > > I’d like the type here to be OptionContainer::ValuesIteratorRange. Can we add some "using" to HashMap.h so we can do it that way instead of having to write out the type like this? > > Or is there some way to use std::result_of? I went with the type aliases. No need to make the caller user do something weird.
Comment on attachment 323196 [details] Patch Clearing flags on attachment: 323196 Committed r223061: <http://trac.webkit.org/changeset/223061>
<rdar://problem/34910705>