Make StorageArea cleanly observe its cached frame

StorageArea caches the result of its last access check wrt to a
LocalFrame. With Oilpan, we have to weakly hold on to that frame
so as not to have scripts be able to retain an entire frame.

Also, the cached frame might be destroyed before the StorageArea
holding a reference is; the implementation is better off clearing
that reference when this happens (with or without Oilpan.)

Address both by making StorageArea a FrameDestructionObserver that
observes its cached frame. It is a weak reference and it will be
cleared upon frame destruction.

To accommodate StorageArea switching the frame it is observing,
make FrameDestructionObserver::observeFrame() again a protected
method.

R=haraken,ager,zerny
BUG=340522

Review URL: https://codereview.chromium.org/594083002

git-svn-id: svn://svn.chromium.org/blink/trunk@182501 bbb929c8-8fbe-4397-9dbb-9b2b20218538
6 files changed
tree: 826fd943b3a0765976e1827a3c24bf05b7d0d7bc
  1. third_party/