Changeset 143396 in webkit
- Timestamp:
- Feb 19, 2013, 3:31:58 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r143385 r143396 1 2013-02-19 Anders Carlsson <andersca@apple.com> 2 3 StorageAreaProxy should know its quota 4 https://bugs.webkit.org/show_bug.cgi?id=110268 5 6 Reviewed by Sam Weinig. 7 8 Begin stubbing out StorageAreaProxy::setItem and add some quota member variables. 9 10 * WebProcess/Storage/StorageAreaProxy.cpp: 11 (WebKit::StorageAreaProxy::StorageAreaProxy): 12 (WebKit::StorageAreaProxy::setItem): 13 * WebProcess/Storage/StorageAreaProxy.h: 14 (StorageAreaProxy): 15 * WebProcess/Storage/StorageNamespaceProxy.cpp: 16 (WebKit::StorageNamespaceProxy::createSessionStorageNamespace): 17 (WebKit::StorageNamespaceProxy::StorageNamespaceProxy): 18 * WebProcess/Storage/StorageNamespaceProxy.h: 19 (WebKit::StorageNamespaceProxy::quota): 20 (StorageNamespaceProxy): 21 1 22 2013-02-19 Alexey Proskuryakov <ap@apple.com> 2 23 -
trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp
r143050 r143396 53 53 StorageAreaProxy::StorageAreaProxy(StorageNamespaceProxy* storageNamespaceProxy, PassRefPtr<SecurityOrigin> securityOrigin) 54 54 : m_storageType(storageNamespaceProxy->storageType()) 55 , m_quotaInBytes(storageNamespaceProxy->quotaInBytes()) 55 56 , m_storageAreaID(generateStorageAreaID()) 56 57 { … … 63 64 } 64 65 65 unsigned StorageAreaProxy::length(ExceptionCode& e xceptionCode, Frame* sourceFrame)66 unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* sourceFrame) 66 67 { 67 e xceptionCode= 0;68 ec = 0; 68 69 if (!canAccessStorage(sourceFrame)) { 69 e xceptionCode= SECURITY_ERR;70 ec = SECURITY_ERR; 70 71 return 0; 71 72 } … … 92 93 } 93 94 94 void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& , Frame* sourceFrame)95 void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame) 95 96 { 96 // FIXME: Implement this. 97 ec = 0; 98 if (!canAccessStorage(sourceFrame)) { 99 ec = SECURITY_ERR; 100 return; 101 } 102 103 ASSERT(!value.isNull()); 104 105 if (disabledByPrivateBrowsingInFrame(sourceFrame)) { 106 ec = QUOTA_EXCEEDED_ERR; 107 return; 108 } 109 110 loadValuesIfNeeded(); 111 112 // FIXME: Actually set the value. 97 113 ASSERT_NOT_REACHED(); 98 114 } -
trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.h
r143038 r143396 61 61 62 62 WebCore::StorageType m_storageType; 63 unsigned m_quotaInBytes; 63 64 uint64_t m_storageAreaID; 64 65 OwnPtr<HashMap<String, String> > m_values; -
trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceProxy.cpp
r143038 r143396 30 30 #include "WebPage.h" 31 31 #include <WebCore/SecurityOrigin.h> 32 #include <WebCore/Settings.h> 32 33 33 34 using namespace WebCore; … … 37 38 PassRefPtr<StorageNamespaceProxy> StorageNamespaceProxy::createSessionStorageNamespace(WebPage* webPage) 38 39 { 39 return adoptRef(new StorageNamespaceProxy(webPage ));40 return adoptRef(new StorageNamespaceProxy(webPage->pageID(), webPage->corePage()->settings()->sessionStorageQuota())); 40 41 } 41 42 42 StorageNamespaceProxy::StorageNamespaceProxy(WebPage* webPage) 43 : m_storageNamespaceID(webPage->pageID()) 43 StorageNamespaceProxy::StorageNamespaceProxy(uint64_t storageNamespaceID, unsigned quotaInBytes) 44 : m_storageNamespaceID(storageNamespaceID) 45 , m_quotaInBytes(quotaInBytes) 44 46 { 45 47 } -
trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceProxy.h
r143038 r143396 40 40 41 41 uint64_t storageNamespaceID() const { return m_storageNamespaceID; } 42 unsigned quotaInBytes() const { return m_quotaInBytes; } 43 42 44 WebCore::StorageType storageType() const; 43 45 44 46 private: 45 explicit StorageNamespaceProxy( WebPage*);47 explicit StorageNamespaceProxy(uint64_t storageNamespaceID, unsigned quotaInBytes); 46 48 47 49 virtual PassRefPtr<WebCore::StorageArea> storageArea(PassRefPtr<WebCore::SecurityOrigin>) OVERRIDE; … … 54 56 55 57 uint64_t m_storageNamespaceID; 58 unsigned m_quotaInBytes; 56 59 }; 57 60
Note:
See TracChangeset
for help on using the changeset viewer.