Avoid moving the same vector multiple times
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 18:05:22 +0000 (18:05 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 18:05:22 +0000 (18:05 +0000)
commit0341bea3665aa2998001000584458935b0b9b047
treee07b8505a0ba70db186829e447ecbc9f3dabd874
parentc71f349862b53fadaa56af141c7f7fded33561bb
Avoid moving the same vector multiple times
https://bugs.webkit.org/show_bug.cgi?id=173748
<rdar://problem/32936804>

Reviewed by Chris Dumez.

We discovered that a Vector<String> was being moved inside a loop, causing it to be moved more than once.
We should never do this!

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
Do not perform a move at each step of the iteration.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Receive vector of top privately
controlled domains as a const reference. Copy this vector into the completion handler. Do not move
origins out of the vector in the inner loop.
(WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Receive vector of top privately
controlled domains as a const reference.
* UIProcess/WebsiteData/WebsiteDataStore.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h