Source/WTF/ChangeLog

 12014-04-16 Darin Adler <darin@apple.com>
 2
 3 Use HashMap<unique_ptr> and Vector<unique_ptr> instead of deprecatedDeleteAllValues
 4 https://bugs.webkit.org/show_bug.cgi?id=73757
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * wtf/Vector.h:
 9 (WTF::deprecatedDeleteAllValues): Deleted.
 10
1112014-04-16 Simon Fraser <simon.fraser@apple.com>
212
313 Don't include CryptographicallyRandomNumber.h in StringImpl.h

Source/WebKit2/ChangeLog

 12014-04-16 Darin Adler <darin@apple.com>
 2
 3 Use HashMap<unique_ptr> and Vector<unique_ptr> instead of deprecatedDeleteAllValues
 4 https://bugs.webkit.org/show_bug.cgi?id=73757
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * Shared/Plugins/NPRemoteObjectMap.cpp:
 9 (WebKit::NPRemoteObjectMap::pluginDestroyed): Use new-style code and write the
 10 deprecatedDeleteAllValues function out using a loop. Might be nice to return here
 11 and use unique_ptr instead some day, but I tried that before and got it wrong, so
 12 lets do that another time.
 13
1142014-04-16 Benjamin Poulain <bpoulain@apple.com>
215
316 [iOS][WK2] Fix the DidCommitLoad initial scrolling position

Source/WTF/wtf/Vector.h

@@inline void Vector<T, inlineCapacity, OverflowHandler>::checkConsistency()
12071207}
12081208
12091209template<typename T, size_t inlineCapacity, typename OverflowHandler>
1210 void deprecatedDeleteAllValues(const Vector<T, inlineCapacity, OverflowHandler>& collection)
1211 {
1212  typedef typename Vector<T, inlineCapacity, OverflowHandler>::const_iterator iterator;
1213  iterator end = collection.end();
1214  for (iterator it = collection.begin(); it != end; ++it)
1215  delete *it;
1216 }
1217 
1218 template<typename T, size_t inlineCapacity, typename OverflowHandler>
12191210inline void swap(Vector<T, inlineCapacity, OverflowHandler>& a, Vector<T, inlineCapacity, OverflowHandler>& b)
12201211{
12211212 a.swap(b);

Source/WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp

@@NPVariant NPRemoteObjectMap::npVariantDataToNPVariant(const NPVariantData& npVar
196196
197197void NPRemoteObjectMap::pluginDestroyed(Plugin* plugin)
198198{
199  Vector<NPObjectMessageReceiver*> messageReceivers;
200 
201  // Gather the receivers associated with this plug-in.
202  for (HashMap<uint64_t, NPObjectMessageReceiver*>::const_iterator it = m_registeredNPObjects.begin(), end = m_registeredNPObjects.end(); it != end; ++it) {
203  NPObjectMessageReceiver* npObjectMessageReceiver = it->value;
204  if (npObjectMessageReceiver->plugin() == plugin)
205  messageReceivers.append(npObjectMessageReceiver);
206  }
207 
208  // Now delete all the receivers.
209  deprecatedDeleteAllValues(messageReceivers);
210 
211  Vector<NPObjectProxy*> objectProxies;
212  for (HashSet<NPObjectProxy*>::const_iterator it = m_npObjectProxies.begin(), end = m_npObjectProxies.end(); it != end; ++it) {
213  NPObjectProxy* npObjectProxy = *it;
214 
215  if (npObjectProxy->plugin() == plugin)
216  objectProxies.append(npObjectProxy);
 199 // Gather and delete the receivers associated with this plug-in.
 200 Vector<NPObjectMessageReceiver*> receivers;
 201 for (auto* receiver : m_registeredNPObjects.values()) {
 202 if (receiver->plugin() == plugin)
 203 receivers.append(receiver);
217204 }
 205 for (auto* receiver : receivers)
 206 delete receiver;
218207
219208 // Invalidate and remove all proxies associated with this plug-in.
220  for (size_t i = 0; i < objectProxies.size(); ++i) {
221  NPObjectProxy* npObjectProxy = objectProxies[i];
222 
223  npObjectProxy->invalidate();
224 
225  ASSERT(m_npObjectProxies.contains(npObjectProxy));
226  m_npObjectProxies.remove(npObjectProxy);
 209 Vector<NPObjectProxy*> proxies;
 210 for (auto* proxy : m_npObjectProxies) {
 211 if (proxy->plugin() == plugin)
 212 proxies.append(proxy);
 213 }
 214 for (auto* proxy : proxies) {
 215 proxy->invalidate();
 216 ASSERT(m_npObjectProxies.contains(proxy));
 217 m_npObjectProxies.remove(proxy);
227218 }
228219}
229220