[Webkit-unassigned] [Bug 26189] DOM Storage: Changes for Android and macro guards

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 9 06:44:24 PDT 2009


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


ddkilzer at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31089|review?                     |review-
               Flag|                            |




------- Comment #15 from ddkilzer at webkit.org  2009-06-09 06:44 PDT -------
(From update of attachment 31089)
Good catch, Ben!

>-    for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
>-        if (LocalStorage* localStorage = it->second->localStorage())
>-            localStorage->close();
>-    }
>+    for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it)
>+        it->second->closeLocalStorageInternal();
> #endif
> }
> 
>+#if ENABLE(DOM_STORAGE)
>+void PageGroup::closeLocalStorageInternal()
>+{
>+    // Only close the local storage object if we have one.
>+    if (m_localStorage)
>+        m_localStorage->close();
>+}
>+#endif

Instead of creating a closeLocalStorageInternal() method, I think it would be
better to create a hasLocalStorage() method like this in PageGroup.h:

#if ENABLE(DOM_STORAGE)
bool hasLocalStorage() { return m_localStorage; }
#endif

Then the for loop would look like this:

#if ENABLE(DOM_STORAGE)
    for (PageGroupMap::iterator it = pageGroups->begin(); it != end; ++it) {
        if (it->second->hasLocalStorage())
            it->second->localStorage()->close();
    }
#endif

r- for this patch, but r+ with the above changes.


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



More information about the webkit-unassigned mailing list