Changeset 48992 in webkit


Ignore:
Timestamp:
Oct 1, 2009 12:54:25 PM (15 years ago)
Author:
jorlow@chromium.org
Message:

2009-09-30 Jeremy Orlow <jorlow@chromium.org>

Reviewed by Darin Adler.

Clean up use of const and mutable in StorageMap
https://bugs.webkit.org/show_bug.cgi?id=29933

What's the point of having every single member variable be mutable and nearly
every method be const? Let's clean it up.

  • storage/StorageMap.cpp: (WebCore::StorageMap::setIteratorToIndex): (WebCore::StorageMap::key): (WebCore::StorageMap::importItem):
  • storage/StorageMap.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r48989 r48992  
     12009-09-30  Jeremy Orlow  <jorlow@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Clean up use of const and mutable in StorageMap
     6        https://bugs.webkit.org/show_bug.cgi?id=29933
     7
     8        What's the point of having every single member variable be mutable and nearly
     9        every method be const?  Let's clean it up.
     10
     11        * storage/StorageMap.cpp:
     12        (WebCore::StorageMap::setIteratorToIndex):
     13        (WebCore::StorageMap::key):
     14        (WebCore::StorageMap::importItem):
     15        * storage/StorageMap.h:
     16
    1172009-10-01  Beth Dakin  <bdakin@apple.com>
    218
  • trunk/WebCore/storage/StorageMap.cpp

    r47808 r48992  
    5555}
    5656
    57 void StorageMap::setIteratorToIndex(unsigned index) const
     57void StorageMap::setIteratorToIndex(unsigned index)
    5858{
    5959    // FIXME: Once we have bidirectional iterators for HashMap we can be more intelligent about this.
     
    8383}
    8484
    85 String StorageMap::key(unsigned index) const
     85String StorageMap::key(unsigned index)
    8686{
    8787    if (index >= length())
     
    146146}
    147147
    148 void StorageMap::importItem(const String& key, const String& value) const
     148void StorageMap::importItem(const String& key, const String& value)
    149149{
    150150    // Be sure to copy the keys/values as items imported on a background thread are destined
  • trunk/WebCore/storage/StorageMap.h

    r47808 r48992  
    4343
    4444        unsigned length() const;
    45         String key(unsigned index) const;
     45        String key(unsigned index);
    4646        String getItem(const String&) const;
    4747        PassRefPtr<StorageMap> setItem(const String& key, const String& value, String& oldValue);
     
    5050        bool contains(const String& key) const;
    5151
    52         void importItem(const String& key, const String& value) const;
     52        void importItem(const String& key, const String& value);
    5353
    5454    private:
     
    5656        PassRefPtr<StorageMap> copy();
    5757        void invalidateIterator();
    58         void setIteratorToIndex(unsigned) const;
     58        void setIteratorToIndex(unsigned);
    5959
    60         mutable HashMap<String, String> m_map;
    61         mutable HashMap<String, String>::iterator m_iterator;
    62         mutable unsigned m_iteratorIndex;
     60        HashMap<String, String> m_map;
     61        HashMap<String, String>::iterator m_iterator;
     62        unsigned m_iteratorIndex;
    6363    };
    6464
Note: See TracChangeset for help on using the changeset viewer.