Apply remote changes to storage maps locally
https://bugs.webkit.org/show_bug.cgi?id=115825

Reviewed by Beth Dakin.

* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::resetValues):
Clear the pending values map.

(WebKit::StorageAreaMap::didSetItem):
If we failed to set the item, forget everything we know about this storage map.
Otherwise, remove the pending item.

(WebKit::StorageAreaMap::didRemoveItem):
Remove the pending item.

(WebKit::StorageAreaMap::shouldApplyChangeForKey):
Helper function that returns whether a change for a given key should be applied.

(WebKit::StorageAreaMap::applyChange):
Apply the change. Currently only adds and removes are handled.

(WebKit::StorageAreaMap::dispatchStorageEvent):
Apply the change locally as well if needed.

* WebProcess/Storage/StorageAreaMap.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149772 268f45cc-cd09-0410-ab3c-d52691b4dbfc