REGRESSION(r217515): Correct iterator invalidation bug (AGAIN)
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 16:57:20 +0000 (16:57 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 16:57:20 +0000 (16:57 +0000)
commit0312e95154344126ef17b9bcfbf19c62b3f67fa2
tree40bf26865c623c7022981f72ea7c8c6d811cdb5f
parentffc88fc8fa60c63f66cea2ae1bd0bb3cb25df043
REGRESSION(r217515): Correct iterator invalidation bug (AGAIN)
https://bugs.webkit.org/show_bug.cgi?id=172722
<rdar://problem/32462876>

Reviewed by Zalan Bujtas.

Over-enthusiastic clean-up during r217515 re-introduced a bug caused by holding a reference
to an iterator that gets invalidated while handling the frame navigation. This patch returns
to the copy/set behavior used prior to r217515.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation): Make a copy of the returned value, since
the iterator will be invalidated during the function call. Then set the copy back in the data
store with the updated counts.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadObserver.cpp