Changeset 143031 in webkit


Ignore:
Timestamp:
Feb 15, 2013 12:05:57 PM (11 years ago)
Author:
andersca@apple.com
Message:

Remove const from a bunch of StorageArea member functions
https://bugs.webkit.org/show_bug.cgi?id=109957

Reviewed by Beth Dakin.

Source/WebCore:

StorageArea is an abstract base class, and its subclasses might want to mutate the object
when certain member functions are called so remove const from all member functions.

  • storage/StorageArea.h:

(WebCore):
(StorageArea):
(WebCore::StorageArea::~StorageArea):
(WebCore::StorageArea::incrementAccessCount):
(WebCore::StorageArea::decrementAccessCount):
(WebCore::StorageArea::closeDatabaseIfIdle):

  • storage/StorageAreaImpl.cpp:

(WebCore::StorageAreaImpl::canAccessStorage):
(WebCore::StorageAreaImpl::length):
(WebCore::StorageAreaImpl::key):
(WebCore::StorageAreaImpl::getItem):
(WebCore::StorageAreaImpl::contains):
(WebCore::StorageAreaImpl::memoryBytesUsedByCache):

  • storage/StorageAreaImpl.h:

(StorageAreaImpl):

Source/WebKit/chromium:

Update for WebCore changes.

  • src/StorageAreaProxy.cpp:

(WebCore::StorageAreaProxy::length):
(WebCore::StorageAreaProxy::key):
(WebCore::StorageAreaProxy::getItem):
(WebCore::StorageAreaProxy::contains):
(WebCore::StorageAreaProxy::canAccessStorage):
(WebCore::StorageAreaProxy::memoryBytesUsedByCache):

  • src/StorageAreaProxy.h:

(StorageAreaProxy):

Source/WebKit2:

Update for WebCore changes.

  • WebProcess/Storage/StorageAreaProxy.cpp:

(WebKit::StorageAreaProxy::length):
(WebKit::StorageAreaProxy::key):
(WebKit::StorageAreaProxy::getItem):
(WebKit::StorageAreaProxy::contains):
(WebKit::StorageAreaProxy::canAccessStorage):
(WebKit::StorageAreaProxy::memoryBytesUsedByCache):

  • WebProcess/Storage/StorageAreaProxy.h:

(StorageAreaProxy):

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143030 r143031  
     12013-02-15  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove const from a bunch of StorageArea member functions
     4        https://bugs.webkit.org/show_bug.cgi?id=109957
     5
     6        Reviewed by Beth Dakin.
     7
     8        StorageArea is an abstract base class, and its subclasses might want to mutate the object
     9        when certain member functions are called so remove const from all member functions.
     10
     11        * storage/StorageArea.h:
     12        (WebCore):
     13        (StorageArea):
     14        (WebCore::StorageArea::~StorageArea):
     15        (WebCore::StorageArea::incrementAccessCount):
     16        (WebCore::StorageArea::decrementAccessCount):
     17        (WebCore::StorageArea::closeDatabaseIfIdle):
     18        * storage/StorageAreaImpl.cpp:
     19        (WebCore::StorageAreaImpl::canAccessStorage):
     20        (WebCore::StorageAreaImpl::length):
     21        (WebCore::StorageAreaImpl::key):
     22        (WebCore::StorageAreaImpl::getItem):
     23        (WebCore::StorageAreaImpl::contains):
     24        (WebCore::StorageAreaImpl::memoryBytesUsedByCache):
     25        * storage/StorageAreaImpl.h:
     26        (StorageAreaImpl):
     27
    1282013-02-13  Ryosuke Niwa  <rniwa@webkit.org>
    229
  • trunk/Source/WebCore/storage/StorageArea.h

    r136323 r143031  
    3434namespace WebCore {
    3535
    36     class Frame;
    37     class SecurityOrigin;
    38     class StorageSyncManager;
    39     typedef int ExceptionCode;
    40     enum StorageType { LocalStorage, SessionStorage };
     36class Frame;
     37class SecurityOrigin;
     38class StorageSyncManager;
     39typedef int ExceptionCode;
     40enum StorageType { LocalStorage, SessionStorage };
    4141
    42     // This interface is required for Chromium since these actions need to be proxied between processes.
    43     class StorageArea : public RefCounted<StorageArea> {
    44     public:
    45         virtual ~StorageArea() { }
     42class StorageArea : public RefCounted<StorageArea> {
     43public:
     44    virtual ~StorageArea() { }
    4645
    47         // The HTML5 DOM Storage API
    48         // FIXME: We should pass Document instead of Frame. Also, that parameter should go first.
    49         virtual unsigned length(ExceptionCode&, Frame* sourceFrame) const = 0;
    50         virtual String key(unsigned index, ExceptionCode&, Frame* sourceFrame) const = 0;
    51         virtual String getItem(const String& key, ExceptionCode&, Frame* sourceFrame) const = 0;
    52         virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame) = 0;
    53         virtual void removeItem(const String& key, ExceptionCode&, Frame* sourceFrame) = 0;
    54         virtual void clear(ExceptionCode&, Frame* sourceFrame) = 0;
    55         virtual bool contains(const String& key, ExceptionCode&, Frame* sourceFrame) const = 0;
     46    // The HTML5 DOM Storage API
     47    // FIXME: We should pass Document instead of Frame. Also, that parameter should go first.
     48    virtual unsigned length(ExceptionCode&, Frame* sourceFrame) = 0;
     49    virtual String key(unsigned index, ExceptionCode&, Frame* sourceFrame) = 0;
     50    virtual String getItem(const String& key, ExceptionCode&, Frame* sourceFrame) = 0;
     51    virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame) = 0;
     52    virtual void removeItem(const String& key, ExceptionCode&, Frame* sourceFrame) = 0;
     53    virtual void clear(ExceptionCode&, Frame* sourceFrame) = 0;
     54    virtual bool contains(const String& key, ExceptionCode&, Frame* sourceFrame) = 0;
    5655
    57         virtual bool canAccessStorage(Frame*) const = 0;
     56    virtual bool canAccessStorage(Frame*) = 0;
    5857
    59         virtual size_t memoryBytesUsedByCache() const = 0;
     58    virtual size_t memoryBytesUsedByCache() = 0;
    6059
    61         virtual void incrementAccessCount() { }
    62         virtual void decrementAccessCount() { }
    63         virtual void closeDatabaseIfIdle() { }
    64     };
     60    virtual void incrementAccessCount() { }
     61    virtual void decrementAccessCount() { }
     62    virtual void closeDatabaseIfIdle() { }
     63};
    6564
    6665} // namespace WebCore
  • trunk/Source/WebCore/storage/StorageAreaImpl.cpp

    r136323 r143031  
    105105}
    106106
    107 bool StorageAreaImpl::canAccessStorage(Frame* frame) const
     107bool StorageAreaImpl::canAccessStorage(Frame* frame)
    108108{
    109109    return frame && frame->page();
     
    119119}
    120120
    121 unsigned StorageAreaImpl::length(ExceptionCode& ec, Frame* frame) const
     121unsigned StorageAreaImpl::length(ExceptionCode& ec, Frame* frame)
    122122{
    123123    ec = 0;
     
    135135}
    136136
    137 String StorageAreaImpl::key(unsigned index, ExceptionCode& ec, Frame* frame) const
     137String StorageAreaImpl::key(unsigned index, ExceptionCode& ec, Frame* frame)
    138138{
    139139    ec = 0;
     
    151151}
    152152
    153 String StorageAreaImpl::getItem(const String& key, ExceptionCode& ec, Frame* frame) const
     153String StorageAreaImpl::getItem(const String& key, ExceptionCode& ec, Frame* frame)
    154154{
    155155    ec = 0;
     
    255255}
    256256
    257 bool StorageAreaImpl::contains(const String& key, ExceptionCode& ec, Frame* frame) const
     257bool StorageAreaImpl::contains(const String& key, ExceptionCode& ec, Frame* frame)
    258258{
    259259    ec = 0;
     
    318318}
    319319
    320 size_t StorageAreaImpl::memoryBytesUsedByCache() const
     320size_t StorageAreaImpl::memoryBytesUsedByCache()
    321321{
    322322    return 0;
  • trunk/Source/WebCore/storage/StorageAreaImpl.h

    r136323 r143031  
    4545
    4646        // The HTML5 DOM Storage API (and contains)
    47         virtual unsigned length(ExceptionCode&, Frame* sourceFrame) const;
    48         virtual String key(unsigned index, ExceptionCode&, Frame* sourceFrame) const;
    49         virtual String getItem(const String& key, ExceptionCode&, Frame* sourceFrame) const;
    50         virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame);
    51         virtual void removeItem(const String& key, ExceptionCode&, Frame* sourceFrame);
    52         virtual void clear(ExceptionCode&, Frame* sourceFrame);
    53         virtual bool contains(const String& key, ExceptionCode&, Frame* sourceFrame) const;
     47        virtual unsigned length(ExceptionCode&, Frame* sourceFrame) OVERRIDE;
     48        virtual String key(unsigned index, ExceptionCode&, Frame* sourceFrame) OVERRIDE;
     49        virtual String getItem(const String& key, ExceptionCode&, Frame* sourceFrame) OVERRIDE;
     50        virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame) OVERRIDE;
     51        virtual void removeItem(const String& key, ExceptionCode&, Frame* sourceFrame) OVERRIDE;
     52        virtual void clear(ExceptionCode&, Frame* sourceFrame) OVERRIDE;
     53        virtual bool contains(const String& key, ExceptionCode&, Frame* sourceFrame) OVERRIDE;
    5454
    55         virtual bool canAccessStorage(Frame* sourceFrame) const;
     55        virtual bool canAccessStorage(Frame* sourceFrame) OVERRIDE;
    5656
    57         virtual size_t memoryBytesUsedByCache() const;
     57        virtual size_t memoryBytesUsedByCache() OVERRIDE;
    5858
    5959        virtual void incrementAccessCount();
  • trunk/Source/WebKit/chromium/ChangeLog

    r142988 r143031  
     12013-02-15  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove const from a bunch of StorageArea member functions
     4        https://bugs.webkit.org/show_bug.cgi?id=109957
     5
     6        Reviewed by Beth Dakin.
     7
     8        Update for WebCore changes.
     9
     10        * src/StorageAreaProxy.cpp:
     11        (WebCore::StorageAreaProxy::length):
     12        (WebCore::StorageAreaProxy::key):
     13        (WebCore::StorageAreaProxy::getItem):
     14        (WebCore::StorageAreaProxy::contains):
     15        (WebCore::StorageAreaProxy::canAccessStorage):
     16        (WebCore::StorageAreaProxy::memoryBytesUsedByCache):
     17        * src/StorageAreaProxy.h:
     18        (StorageAreaProxy):
     19
    1202013-02-15  Keishi Hattori  <keishi@webkit.org>
    221
  • trunk/Source/WebKit/chromium/src/StorageAreaProxy.cpp

    r138798 r143031  
    6363}
    6464
    65 unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* frame) const
     65unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* frame)
    6666{
    6767    if (!canAccessStorage(frame)) {
     
    7373}
    7474
    75 String StorageAreaProxy::key(unsigned index, ExceptionCode& ec, Frame* frame) const
     75String StorageAreaProxy::key(unsigned index, ExceptionCode& ec, Frame* frame)
    7676{
    7777    if (!canAccessStorage(frame)) {
     
    8383}
    8484
    85 String StorageAreaProxy::getItem(const String& key, ExceptionCode& ec, Frame* frame) const
     85String StorageAreaProxy::getItem(const String& key, ExceptionCode& ec, Frame* frame)
    8686{
    8787    if (!canAccessStorage(frame)) {
     
    124124}
    125125
    126 bool StorageAreaProxy::contains(const String& key, ExceptionCode& ec, Frame* frame) const
     126bool StorageAreaProxy::contains(const String& key, ExceptionCode& ec, Frame* frame)
    127127{
    128128    if (!canAccessStorage(frame)) {
     
    133133}
    134134
    135 bool StorageAreaProxy::canAccessStorage(Frame* frame) const
     135bool StorageAreaProxy::canAccessStorage(Frame* frame)
    136136{
    137137    if (!frame || !frame->page())
     
    147147}
    148148
    149 size_t StorageAreaProxy::memoryBytesUsedByCache() const
     149size_t StorageAreaProxy::memoryBytesUsedByCache()
    150150{
    151151    return m_storageArea->memoryBytesUsedByCache();
  • trunk/Source/WebKit/chromium/src/StorageAreaProxy.h

    r132183 r143031  
    4949
    5050    // The HTML5 DOM Storage API
    51     virtual unsigned length(ExceptionCode&, Frame* sourceFrame) const;
    52     virtual String key(unsigned index, ExceptionCode&, Frame* sourceFrame) const;
    53     virtual String getItem(const String& key, ExceptionCode&, Frame* sourceFrame) const;
     51    virtual unsigned length(ExceptionCode&, Frame* sourceFrame);
     52    virtual String key(unsigned index, ExceptionCode&, Frame* sourceFrame);
     53    virtual String getItem(const String& key, ExceptionCode&, Frame* sourceFrame);
    5454    virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame);
    5555    virtual void removeItem(const String& key, ExceptionCode&, Frame* sourceFrame);
    5656    virtual void clear(ExceptionCode&, Frame* sourceFrame);
    57     virtual bool contains(const String& key, ExceptionCode&, Frame* sourceFrame) const;
     57    virtual bool contains(const String& key, ExceptionCode&, Frame* sourceFrame);
    5858
    59     virtual bool canAccessStorage(Frame*) const;
     59    virtual bool canAccessStorage(Frame*);
    6060
    61     virtual size_t memoryBytesUsedByCache() const;
     61    virtual size_t memoryBytesUsedByCache();
    6262
    6363    static void dispatchLocalStorageEvent(
  • trunk/Source/WebKit2/ChangeLog

    r143008 r143031  
     12013-02-15  Anders Carlsson  <andersca@apple.com>
     2
     3        Remove const from a bunch of StorageArea member functions
     4        https://bugs.webkit.org/show_bug.cgi?id=109957
     5
     6        Reviewed by Beth Dakin.
     7
     8        Update for WebCore changes.
     9
     10        * WebProcess/Storage/StorageAreaProxy.cpp:
     11        (WebKit::StorageAreaProxy::length):
     12        (WebKit::StorageAreaProxy::key):
     13        (WebKit::StorageAreaProxy::getItem):
     14        (WebKit::StorageAreaProxy::contains):
     15        (WebKit::StorageAreaProxy::canAccessStorage):
     16        (WebKit::StorageAreaProxy::memoryBytesUsedByCache):
     17        * WebProcess/Storage/StorageAreaProxy.h:
     18        (StorageAreaProxy):
     19
    1202013-02-15  Sudarsana Nagineni  <sudarsana.nagineni@intel.com>
    221
  • trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp

    r141830 r143031  
    6060}
    6161
    62 unsigned StorageAreaProxy::length(ExceptionCode&, Frame* sourceFrame) const
     62unsigned StorageAreaProxy::length(ExceptionCode&, Frame* sourceFrame)
    6363{
    6464    // FIXME: Implement this.
     
    6767}
    6868
    69 String StorageAreaProxy::key(unsigned index, ExceptionCode&, Frame* sourceFrame) const
     69String StorageAreaProxy::key(unsigned index, ExceptionCode&, Frame* sourceFrame)
    7070{
    7171    // FIXME: Implement this.
     
    7474}
    7575
    76 String StorageAreaProxy::getItem(const String& key, ExceptionCode&, Frame* sourceFrame) const
     76String StorageAreaProxy::getItem(const String& key, ExceptionCode&, Frame* sourceFrame)
    7777{
    7878    // FIXME: Implement this.
     
    9999}
    100100
    101 bool StorageAreaProxy::contains(const String& key, ExceptionCode&, Frame* sourceFrame) const
     101bool StorageAreaProxy::contains(const String& key, ExceptionCode&, Frame* sourceFrame)
    102102{
    103103    // FIXME: Implement this.
     
    105105}
    106106
    107 bool StorageAreaProxy::canAccessStorage(Frame* frame) const
     107bool StorageAreaProxy::canAccessStorage(Frame* frame)
    108108{
    109109    return frame && frame->page();
    110110}
    111111
    112 size_t StorageAreaProxy::memoryBytesUsedByCache() const
     112size_t StorageAreaProxy::memoryBytesUsedByCache()
    113113{
    114114    // FIXME: Implement this.
  • trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.h

    r141830 r143031  
    4242
    4343    // WebCore::StorageArea.
    44     virtual unsigned length(WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) const OVERRIDE;
    45     virtual String key(unsigned index, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) const OVERRIDE;
    46     virtual String getItem(const String& key, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) const OVERRIDE;
     44    virtual unsigned length(WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE;
     45    virtual String key(unsigned index, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE;
     46    virtual String getItem(const String& key, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE;
    4747    virtual void setItem(const String& key, const String& value, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE;
    4848    virtual void removeItem(const String& key, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE;
    4949    virtual void clear(WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE;
    50     virtual bool contains(const String& key, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) const OVERRIDE;
    51     virtual bool canAccessStorage(WebCore::Frame*) const OVERRIDE;
    52     virtual size_t memoryBytesUsedByCache() const OVERRIDE;
     50    virtual bool contains(const String& key, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE;
     51    virtual bool canAccessStorage(WebCore::Frame*) OVERRIDE;
     52    virtual size_t memoryBytesUsedByCache() OVERRIDE;
    5353    virtual void incrementAccessCount() OVERRIDE;
    5454    virtual void decrementAccessCount() OVERRIDE;
Note: See TracChangeset for help on using the changeset viewer.