[Webkit-unassigned] [Bug 32369] Support for storage and databases in sandboxed iframes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 15 09:51:22 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=32369


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #50700|review?, commit-queue?      |review+, commit-queue+
               Flag|                            |




--- Comment #7 from Darin Adler <darin at apple.com>  2010-03-15 09:51:22 PST ---
(From update of attachment 50700)
> -    bool isLocalStorage = (frame->domWindow()->localStorage() == storage);
> +    ExceptionCode ec = 0;
> +    bool isLocalStorage = (frame->domWindow()->localStorage(ec) == storage && !ec);'

> -    bool isLocalStorage = storage->frame()->domWindow()->localStorage() == storage;
> +    ExceptionCode ec = 0;
> +    bool isLocalStorage = (storage->frame()->domWindow()->localStorage(ec) == storage && !ec);

Since the localStorage function returns 0 when there is an error, the !ec check
seems unnecessary.

> -        for (unsigned i = 0; i < frames.size(); ++i)
> -            frames[i]->document()->enqueueStorageEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->localStorage()));
> +        for (unsigned i = 0; i < frames.size(); ++i) {
> +            ExceptionCode ec = 0;
> +            Storage* storage = frames[i]->domWindow()->localStorage(ec);
> +            if (!ec)
> +                frames[i]->document()->enqueueStorageEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage));
> +        }

I think it would be cleaner to just check the returned storage object to see if
it's 0 rather than checking ec. We do need the ExceptionCode to communicate
with the JavaScript binding, but I don't think we need to use it inside the
engine itself.

Minor issues.

r=me based on my own reading of the code, the EWS results, and Adam Barth’s
earlier review

-- 
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