Changeset 143031 in webkit
- Timestamp:
- Feb 15, 2013 12:05:57 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143030 r143031 1 2013-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 1 28 2013-02-13 Ryosuke Niwa <rniwa@webkit.org> 2 29 -
trunk/Source/WebCore/storage/StorageArea.h
r136323 r143031 34 34 namespace WebCore { 35 35 36 37 38 39 40 36 class Frame; 37 class SecurityOrigin; 38 class StorageSyncManager; 39 typedef int ExceptionCode; 40 enum StorageType { LocalStorage, SessionStorage }; 41 41 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() { } 42 class StorageArea : public RefCounted<StorageArea> { 43 public: 44 virtual ~StorageArea() { } 46 45 47 48 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 53 54 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; 56 55 57 virtual bool canAccessStorage(Frame*) const= 0;56 virtual bool canAccessStorage(Frame*) = 0; 58 57 59 virtual size_t memoryBytesUsedByCache() const= 0;58 virtual size_t memoryBytesUsedByCache() = 0; 60 59 61 62 63 64 60 virtual void incrementAccessCount() { } 61 virtual void decrementAccessCount() { } 62 virtual void closeDatabaseIfIdle() { } 63 }; 65 64 66 65 } // namespace WebCore -
trunk/Source/WebCore/storage/StorageAreaImpl.cpp
r136323 r143031 105 105 } 106 106 107 bool StorageAreaImpl::canAccessStorage(Frame* frame) const107 bool StorageAreaImpl::canAccessStorage(Frame* frame) 108 108 { 109 109 return frame && frame->page(); … … 119 119 } 120 120 121 unsigned StorageAreaImpl::length(ExceptionCode& ec, Frame* frame) const121 unsigned StorageAreaImpl::length(ExceptionCode& ec, Frame* frame) 122 122 { 123 123 ec = 0; … … 135 135 } 136 136 137 String StorageAreaImpl::key(unsigned index, ExceptionCode& ec, Frame* frame) const137 String StorageAreaImpl::key(unsigned index, ExceptionCode& ec, Frame* frame) 138 138 { 139 139 ec = 0; … … 151 151 } 152 152 153 String StorageAreaImpl::getItem(const String& key, ExceptionCode& ec, Frame* frame) const153 String StorageAreaImpl::getItem(const String& key, ExceptionCode& ec, Frame* frame) 154 154 { 155 155 ec = 0; … … 255 255 } 256 256 257 bool StorageAreaImpl::contains(const String& key, ExceptionCode& ec, Frame* frame) const257 bool StorageAreaImpl::contains(const String& key, ExceptionCode& ec, Frame* frame) 258 258 { 259 259 ec = 0; … … 318 318 } 319 319 320 size_t StorageAreaImpl::memoryBytesUsedByCache() const320 size_t StorageAreaImpl::memoryBytesUsedByCache() 321 321 { 322 322 return 0; -
trunk/Source/WebCore/storage/StorageAreaImpl.h
r136323 r143031 45 45 46 46 // 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; 54 54 55 virtual bool canAccessStorage(Frame* sourceFrame) const;55 virtual bool canAccessStorage(Frame* sourceFrame) OVERRIDE; 56 56 57 virtual size_t memoryBytesUsedByCache() const;57 virtual size_t memoryBytesUsedByCache() OVERRIDE; 58 58 59 59 virtual void incrementAccessCount(); -
trunk/Source/WebKit/chromium/ChangeLog
r142988 r143031 1 2013-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 1 20 2013-02-15 Keishi Hattori <keishi@webkit.org> 2 21 -
trunk/Source/WebKit/chromium/src/StorageAreaProxy.cpp
r138798 r143031 63 63 } 64 64 65 unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* frame) const65 unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* frame) 66 66 { 67 67 if (!canAccessStorage(frame)) { … … 73 73 } 74 74 75 String StorageAreaProxy::key(unsigned index, ExceptionCode& ec, Frame* frame) const75 String StorageAreaProxy::key(unsigned index, ExceptionCode& ec, Frame* frame) 76 76 { 77 77 if (!canAccessStorage(frame)) { … … 83 83 } 84 84 85 String StorageAreaProxy::getItem(const String& key, ExceptionCode& ec, Frame* frame) const85 String StorageAreaProxy::getItem(const String& key, ExceptionCode& ec, Frame* frame) 86 86 { 87 87 if (!canAccessStorage(frame)) { … … 124 124 } 125 125 126 bool StorageAreaProxy::contains(const String& key, ExceptionCode& ec, Frame* frame) const126 bool StorageAreaProxy::contains(const String& key, ExceptionCode& ec, Frame* frame) 127 127 { 128 128 if (!canAccessStorage(frame)) { … … 133 133 } 134 134 135 bool StorageAreaProxy::canAccessStorage(Frame* frame) const135 bool StorageAreaProxy::canAccessStorage(Frame* frame) 136 136 { 137 137 if (!frame || !frame->page()) … … 147 147 } 148 148 149 size_t StorageAreaProxy::memoryBytesUsedByCache() const149 size_t StorageAreaProxy::memoryBytesUsedByCache() 150 150 { 151 151 return m_storageArea->memoryBytesUsedByCache(); -
trunk/Source/WebKit/chromium/src/StorageAreaProxy.h
r132183 r143031 49 49 50 50 // 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); 54 54 virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame); 55 55 virtual void removeItem(const String& key, ExceptionCode&, Frame* sourceFrame); 56 56 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); 58 58 59 virtual bool canAccessStorage(Frame*) const;59 virtual bool canAccessStorage(Frame*); 60 60 61 virtual size_t memoryBytesUsedByCache() const;61 virtual size_t memoryBytesUsedByCache(); 62 62 63 63 static void dispatchLocalStorageEvent( -
trunk/Source/WebKit2/ChangeLog
r143008 r143031 1 2013-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 1 20 2013-02-15 Sudarsana Nagineni <sudarsana.nagineni@intel.com> 2 21 -
trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp
r141830 r143031 60 60 } 61 61 62 unsigned StorageAreaProxy::length(ExceptionCode&, Frame* sourceFrame) const62 unsigned StorageAreaProxy::length(ExceptionCode&, Frame* sourceFrame) 63 63 { 64 64 // FIXME: Implement this. … … 67 67 } 68 68 69 String StorageAreaProxy::key(unsigned index, ExceptionCode&, Frame* sourceFrame) const69 String StorageAreaProxy::key(unsigned index, ExceptionCode&, Frame* sourceFrame) 70 70 { 71 71 // FIXME: Implement this. … … 74 74 } 75 75 76 String StorageAreaProxy::getItem(const String& key, ExceptionCode&, Frame* sourceFrame) const76 String StorageAreaProxy::getItem(const String& key, ExceptionCode&, Frame* sourceFrame) 77 77 { 78 78 // FIXME: Implement this. … … 99 99 } 100 100 101 bool StorageAreaProxy::contains(const String& key, ExceptionCode&, Frame* sourceFrame) const101 bool StorageAreaProxy::contains(const String& key, ExceptionCode&, Frame* sourceFrame) 102 102 { 103 103 // FIXME: Implement this. … … 105 105 } 106 106 107 bool StorageAreaProxy::canAccessStorage(Frame* frame) const107 bool StorageAreaProxy::canAccessStorage(Frame* frame) 108 108 { 109 109 return frame && frame->page(); 110 110 } 111 111 112 size_t StorageAreaProxy::memoryBytesUsedByCache() const112 size_t StorageAreaProxy::memoryBytesUsedByCache() 113 113 { 114 114 // FIXME: Implement this. -
trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.h
r141830 r143031 42 42 43 43 // WebCore::StorageArea. 44 virtual unsigned length(WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) constOVERRIDE;45 virtual String key(unsigned index, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) constOVERRIDE;46 virtual String getItem(const String& key, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) constOVERRIDE;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; 47 47 virtual void setItem(const String& key, const String& value, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE; 48 48 virtual void removeItem(const String& key, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE; 49 49 virtual void clear(WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) OVERRIDE; 50 virtual bool contains(const String& key, WebCore::ExceptionCode&, WebCore::Frame* sourceFrame) constOVERRIDE;51 virtual bool canAccessStorage(WebCore::Frame*) constOVERRIDE;52 virtual size_t memoryBytesUsedByCache() constOVERRIDE;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; 53 53 virtual void incrementAccessCount() OVERRIDE; 54 54 virtual void decrementAccessCount() OVERRIDE;
Note: See TracChangeset
for help on using the changeset viewer.