[Webkit-unassigned] [Bug 83012] Web Inspector: localStorage items are not updated when the storage changes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 9 02:09:05 PDT 2012


--- Comment #5 from Vivek Galatage <vivekgalatage at gmail.com>  2012-04-09 02:09:04 PST ---
Adding to further analysis, the method InspectorDOMStorageResource::startReportingChangesToFrontend() adds itself as Storage event listener on the page being inspected (m_frame). 

So now when the page being inspected(m_frame) adds the new key value pair in the localStorage, the StorageEventDispatcher::dispatch() method is invoked. But now here this method filters out the page who added this change(in this scenario the m_frame itself) from sending any notifications (ref: http://dev.w3.org/html5/webstorage/#dom-localstorage)  by following lines - 

        // Send events to every page.
        const HashSet<Page*>& pages = page->group().pages();
        HashSet<Page*>::const_iterator end = pages.end();
        for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) {
            for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
===============>if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))

So here in this case, sourceFrame will always be the frame so this frame would never get any such notifications.

Hence InspectorDOMStorageResource::handleEvent() is not triggered.

Moving further, for testing purposes I explicitly removed this check and made sure the InspectorDOMStorageResource::handleEvent() is invoked.

So in the InspectorDOMStorageResource::handleEvent() method, there is a check if the event hasInterface("StorageEvent") which evaluates to true so the handleEvent returns from there itself.

So again for testing purposes, when I bypassed this check, the DOMStorage.js (from inspector/front-end) file's method updateDOMStorage() is invoked and it basically updates the view correctly.

So what would be your comments on how do we proceed on this. I think we need to change the inspector's behavior on how it listens to the storageEvent as the inspector page is not in the same PageGroup as the page being inspected.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list