~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to WebCore/storage/StorageEventDispatcher.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-02-04 19:30:57 UTC
  • mfrom: (1.2.8 upstream) (4.3.9 sid)
  • Revision ID: james.westby@ubuntu.com-20100204193057-d3018lm1fipb0703
* New upstream release
* debian/copyright:
- Updated with changes since 1.1.19.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    if (storageType == SessionStorage) {
51
51
        // Send events only to our page.
52
52
        for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
53
 
            if (frame->document()->securityOrigin()->equal(securityOrigin))
 
53
            if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))
54
54
                frames.append(frame);
55
55
        }
56
56
 
57
57
        for (unsigned i = 0; i < frames.size(); ++i)
58
 
            frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->sessionStorage()));
 
58
            frames[i]->document()->enqueueStorageEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->sessionStorage()));
59
59
    } else {
60
60
        // Send events to every page.
61
61
        const HashSet<Page*>& pages = page->group().pages();
62
62
        HashSet<Page*>::const_iterator end = pages.end();
63
63
        for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) {
64
64
            for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
65
 
                if (frame->document()->securityOrigin()->equal(securityOrigin))
 
65
                if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))
66
66
                    frames.append(frame);
67
67
            }
68
68
        }
69
69
 
70
70
        for (unsigned i = 0; i < frames.size(); ++i)
71
 
            frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->localStorage()));
 
71
            frames[i]->document()->enqueueStorageEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->localStorage()));
72
72
    }
73
73
}
74
74