WebNetscapePluginView should no longer use deleteAllValues
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Oct 2013 16:31:36 +0000 (16:31 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Oct 2013 16:31:36 +0000 (16:31 +0000)
commitc069adc02bf663576514f62ff379c0f6a64c0952
tree7fb32bbf4327beba0958f27c20f53efe0af863c4
parent8c0a1f8f817cb3591c7d71494ca0a7a4bb638151
WebNetscapePluginView should no longer use deleteAllValues
https://bugs.webkit.org/show_bug.cgi?id=122495

Reviewed by Anders Carlsson.

* Plugins/WebNetscapePluginView.h: Use unique_ptr for both the pointer to
the timers hash table, and for the values in the hash table.

* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView stopTimers]): Rewrote loop so it works with unique_ptr.
(-[WebNetscapePluginView startTimers]): Ditto.
(-[WebNetscapePluginView fini]): Removed unneeded code to delete timers.
(-[WebNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]): Make
the timers hash table with make-unique. Fixed the loop that chooses the timer
ID so it won't ever try to use a deleted value, although that never happens
in practice. Use HashMap::add instead of using both contains and set.
Rearranged code so we don't need to make a raw pointer for the timer.
(-[WebNetscapePluginView unscheduleTimer:]): Use remove instead of take/delete,
since remove takes care of the deletion automatically since we are using the
unique_ptr class.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/WebNetscapePluginView.h
Source/WebKit/mac/Plugins/WebNetscapePluginView.mm