Web Replay: add methods to encode a frame's index based on its FrameTree position
authorburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Apr 2014 21:51:34 +0000 (21:51 +0000)
committerburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Apr 2014 21:51:34 +0000 (21:51 +0000)
commit3b309f6b7df06f8a3a7aead28d07a38479099599
tree81a9c435690e734ddaae41b73f9c0d06bd55fa93
parent6247c696fac865af694b90ab8553080e8ee3b291
Web Replay: add methods to encode a frame's index based on its FrameTree position
https://bugs.webkit.org/show_bug.cgi?id=131281

Reviewed by Timothy Hatcher.

Given a frame, its encoded index is computed by traversing the frame tree
and saving how many nodes have been traversed to reach a given frame.

This is used to disambiguate frames when dispatching frame-specific event
loop inputs during replay, such as timers and resource loaders.

* replay/SerializationMethods.cpp:
(WebCore::frameIndexFromDocument): Added.
(WebCore::frameIndexFromFrame): Added.
(WebCore::documentFromFrameIndex): Added.
(WebCore::frameFromFrameIndex): Added.
* replay/SerializationMethods.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/replay/SerializationMethods.cpp
Source/WebCore/replay/SerializationMethods.h