Changeset 31793 in webkit
- Timestamp:
- Apr 10, 2008, 6:06:27 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 13 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r31792 r31793 1 2008-04-10 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Sam Weinig 4 5 The name "OriginStorage" never felt right to a few of us. The HTML5 spec refers to our 6 concept of "OriginStorage" as a "storage area", which makes more sense here. 7 8 This patch is basically: 9 s/OriginStorage/StorageArea/ 10 11 * GNUmakefile.am: 12 * WebCore.pro: 13 * WebCore.vcproj/WebCore.vcproj: 14 * WebCore.xcodeproj/project.pbxproj: 15 * WebCoreSources.bkl: 16 17 * loader/FrameLoader.cpp: 18 19 * page/DOMWindow.cpp: 20 (WebCore::DOMWindow::sessionStorage): 21 * page/Page.cpp: 22 23 * storage/OriginStorage.cpp: Removed. 24 * storage/OriginStorage.h: Removed. 25 26 * storage/SessionStorage.cpp: 27 (WebCore::SessionStorage::copy): 28 (WebCore::SessionStorage::storageArea): 29 * storage/SessionStorage.h: 30 31 * storage/Storage.cpp: 32 (WebCore::Storage::create): 33 (WebCore::Storage::Storage): 34 (WebCore::Storage::length): 35 (WebCore::Storage::key): 36 (WebCore::Storage::getItem): 37 (WebCore::Storage::setItem): 38 (WebCore::Storage::removeItem): 39 (WebCore::Storage::contains): 40 * storage/Storage.h: 41 42 * storage/StorageArea.cpp: Copied from storage/OriginStorage.cpp. 43 (WebCore::StorageArea::create): 44 (WebCore::StorageArea::StorageArea): 45 (WebCore::StorageArea::~StorageArea): 46 (WebCore::StorageArea::copy): 47 (WebCore::StorageArea::length): 48 (WebCore::StorageArea::key): 49 (WebCore::StorageArea::getItem): 50 (WebCore::StorageArea::setItem): 51 (WebCore::StorageArea::removeItem): 52 (WebCore::StorageArea::contains): 53 (WebCore::StorageArea::dispatchStorageEvent): 54 * storage/StorageArea.h: Copied from storage/OriginStorage.h. 55 1 56 2008-04-10 Xan Lopez <xan@gnome.org> 2 57 -
trunk/WebCore/GNUmakefile.am
r31746 r31793 1190 1190 1191 1191 webcore_sources += \ 1192 WebCore/storage/OriginStorage.cpp \1193 1192 WebCore/storage/Storage.cpp \ 1193 WebCore/storage/StorageArea.cpp \ 1194 1194 WebCore/storage/StorageEvent.cpp \ 1195 1195 WebCore/storage/StorageMap.cpp \ -
trunk/WebCore/WebCore.pro
r31746 r31793 1207 1207 1208 1208 SOURCES += \ 1209 storage/OriginStorage.cpp \1210 1209 storage/Storage.cpp \ 1210 storage/StorageArea.cpp \ 1211 1211 storage/StorageEvent.cpp \ 1212 1212 storage/StorageMap.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r31746 r31793 15751 15751 </File> 15752 15752 <File 15753 RelativePath="..\storage\OriginStorage.cpp"15754 >15755 </File>15756 <File15757 RelativePath="..\storage\OriginStorage.h"15758 >15759 </File>15760 <File15761 15753 RelativePath="..\storage\OriginUsageRecord.cpp" 15762 15754 > … … 15828 15820 <File 15829 15821 RelativePath="..\storage\Storage.h" 15822 > 15823 </File> 15824 <File 15825 RelativePath="..\storage\StorageArea.cpp" 15826 > 15827 </File> 15828 <File 15829 RelativePath="..\storage\StorageArea.h" 15830 15830 > 15831 15831 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r31780 r31793 418 418 5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */; }; 419 419 5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5126E6BA0A2E3B12005C29FA /* IconDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 420 51272D840DA9800900844E2F /* OriginStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 51272D820DA9800900844E2F /* OriginStorage.h */; };421 51272D850DA9800900844E2F /* OriginStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51272D830DA9800900844E2F /* OriginStorage.cpp */; };422 420 512DD8E30D91E2B4000F89EE /* SharedBufferCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512DD8E20D91E2B4000F89EE /* SharedBufferCF.cpp */; }; 423 421 512DD8F40D91E6AF000F89EE /* LegacyWebArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512DD8EA0D91E6AF000F89EE /* LegacyWebArchive.cpp */; }; … … 495 493 51AA3F6F0BD5AA9E00892971 /* ResourceLoaderMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51AA3F6E0BD5AA9E00892971 /* ResourceLoaderMac.mm */; }; 496 494 51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */; }; 495 51BE37DF0DAEE00E001085FC /* StorageArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51BE37DD0DAEE00E001085FC /* StorageArea.cpp */; }; 496 51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BE37DE0DAEE00E001085FC /* StorageArea.h */; }; 497 497 51C81B890C4422F70019ECE3 /* FTPDirectoryParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51C81B870C4422F70019ECE3 /* FTPDirectoryParser.cpp */; }; 498 498 51C81B8A0C4422F70019ECE3 /* FTPDirectoryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C81B880C4422F70019ECE3 /* FTPDirectoryParser.h */; }; … … 4822 4822 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IconDatabase.cpp; sourceTree = "<group>"; }; 4823 4823 5126E6BA0A2E3B12005C29FA /* IconDatabase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IconDatabase.h; sourceTree = "<group>"; }; 4824 51272D820DA9800900844E2F /* OriginStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginStorage.h; sourceTree = "<group>"; };4825 51272D830DA9800900844E2F /* OriginStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OriginStorage.cpp; sourceTree = "<group>"; };4826 4824 512DD8E20D91E2B4000F89EE /* SharedBufferCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedBufferCF.cpp; sourceTree = "<group>"; }; 4827 4825 512DD8EA0D91E6AF000F89EE /* LegacyWebArchive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyWebArchive.cpp; sourceTree = "<group>"; }; … … 4903 4901 51AA3F6E0BD5AA9E00892971 /* ResourceLoaderMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceLoaderMac.mm; sourceTree = "<group>"; }; 4904 4902 51B2417A0D931F3F00E83F5C /* LegacyWebArchiveMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyWebArchiveMac.mm; sourceTree = "<group>"; }; 4903 51BE37DD0DAEE00E001085FC /* StorageArea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageArea.cpp; sourceTree = "<group>"; }; 4904 51BE37DE0DAEE00E001085FC /* StorageArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageArea.h; sourceTree = "<group>"; }; 4905 4905 51C81B870C4422F70019ECE3 /* FTPDirectoryParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FTPDirectoryParser.cpp; sourceTree = "<group>"; }; 4906 4906 51C81B880C4422F70019ECE3 /* FTPDirectoryParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FTPDirectoryParser.h; sourceTree = "<group>"; }; … … 8477 8477 51A926780D53F0570063ECC2 /* OriginQuotaManager.cpp */, 8478 8478 51A926790D53F0570063ECC2 /* OriginQuotaManager.h */, 8479 51272D830DA9800900844E2F /* OriginStorage.cpp */,8480 51272D820DA9800900844E2F /* OriginStorage.h */,8481 8479 51A9267A0D53F0570063ECC2 /* OriginUsageRecord.cpp */, 8482 8480 51A9267B0D53F0570063ECC2 /* OriginUsageRecord.h */, … … 8505 8503 51E3F9C40DA059DC00250911 /* Storage.h */, 8506 8504 51E3F9D10DA05D7100250911 /* Storage.idl */, 8505 51BE37DD0DAEE00E001085FC /* StorageArea.cpp */, 8506 51BE37DE0DAEE00E001085FC /* StorageArea.h */, 8507 8507 51E0BABA0DA5547100A9E417 /* StorageEvent.cpp */, 8508 8508 51E0BAB90DA5547100A9E417 /* StorageEvent.h */, … … 14754 14754 51E0BB380DA5ACB600A9E417 /* StorageMap.h in Headers */, 14755 14755 BC53C5F50DA56B920021EB5D /* Gradient.h in Headers */, 14756 51 272D840DA9800900844E2F /* OriginStorage.h in Headers */,14756 51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */, 14757 14757 ); 14758 14758 runOnlyForDeploymentPostprocessing = 0; … … 16436 16436 BC53C60B0DA56CF10021EB5D /* GradientCG.cpp in Sources */, 16437 16437 4B24F9A80DA7050B00269E58 /* AXObjectCache.cpp in Sources */, 16438 51272D850DA9800900844E2F /* OriginStorage.cpp in Sources */,16439 16438 51D0C5160DAA90B7003B3831 /* JSStorageCustom.cpp in Sources */, 16439 51BE37DF0DAEE00E001085FC /* StorageArea.cpp in Sources */, 16440 16440 ); 16441 16441 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/WebCoreSources.bkl
r31746 r31793 793 793 storage/DatabaseTracker.cpp 794 794 storage/OriginQuotaManager.cpp 795 storage/OriginStorage.cpp796 795 storage/OriginUsageRecord.cpp 797 796 storage/SQLResultSet.cpp … … 800 799 storage/SQLTransaction.cpp 801 800 storage/Storage.cpp 801 storage/StorageArea.cpp 802 802 storage/StorageEvent.cpp 803 803 storage/StorageMap.cpp -
trunk/WebCore/loader/FrameLoader.cpp
r31746 r31793 100 100 101 101 #if ENABLE(DOM_STORAGE) 102 #include "OriginStorage.h"103 102 #include "SessionStorage.h" 103 #include "StorageArea.h" 104 104 #endif 105 105 -
trunk/WebCore/page/DOMWindow.cpp
r31697 r31793 61 61 62 62 #if ENABLE(DOM_STORAGE) 63 #include "OriginStorage.h"64 63 #include "SessionStorage.h" 65 64 #include "Storage.h" 65 #include "StorageArea.h" 66 66 #endif 67 67 … … 274 274 return 0; 275 275 276 RefPtr< OriginStorage> originStorage = page->sessionStorage()->originStorage(document->securityOrigin());277 m_sessionStorage = Storage::create(m_frame, originStorage.release());276 RefPtr<StorageArea> storageArea = page->sessionStorage()->storageArea(document->securityOrigin()); 277 m_sessionStorage = Storage::create(m_frame, storageArea.release()); 278 278 return m_sessionStorage.get(); 279 279 } -
trunk/WebCore/page/Page.cpp
r31697 r31793 55 55 56 56 #if ENABLE(DOM_STORAGE) 57 #include "OriginStorage.h"58 57 #include "SessionStorage.h" 58 #include "StorageArea.h" 59 59 #endif 60 60 -
trunk/WebCore/storage/SessionStorage.cpp
r31697 r31793 27 27 #include "SessionStorage.h" 28 28 29 #include " OriginStorage.h"29 #include "StorageArea.h" 30 30 #include "StorageMap.h" 31 31 … … 46 46 RefPtr<SessionStorage> newSession = SessionStorage::create(newPage); 47 47 48 OriginStorageMap::iterator end = m_originStorageMap.end();49 for ( OriginStorageMap::iterator i = m_originStorageMap.begin(); i != end; ++i)50 newSession->m_ originStorageMap.set(i->first, i->second->copy(newPage, i->first.get()));48 StorageAreaMap::iterator end = m_storageAreaMap.end(); 49 for (StorageAreaMap::iterator i = m_storageAreaMap.begin(); i != end; ++i) 50 newSession->m_storageAreaMap.set(i->first, i->second->copy(newPage, i->first.get())); 51 51 52 52 return newSession.release(); 53 53 } 54 54 55 PassRefPtr< OriginStorage> SessionStorage::originStorage(SecurityOrigin* origin)55 PassRefPtr<StorageArea> SessionStorage::storageArea(SecurityOrigin* origin) 56 56 { 57 RefPtr< OriginStorage> originStorage;58 if ( originStorage = m_originStorageMap.get(origin))59 return originStorage.release();57 RefPtr<StorageArea> storageArea; 58 if (storageArea = m_storageAreaMap.get(origin)) 59 return storageArea.release(); 60 60 61 originStorage = OriginStorage::create(m_page, origin);62 m_ originStorageMap.set(origin, originStorage);63 return originStorage.release();61 storageArea = StorageArea::create(m_page, origin); 62 m_storageAreaMap.set(origin, storageArea); 63 return storageArea.release(); 64 64 } 65 65 -
trunk/WebCore/storage/SessionStorage.h
r31697 r31793 35 35 namespace WebCore { 36 36 37 class OriginStorage;37 class StorageArea; 38 38 class Page; 39 39 … … 43 43 PassRefPtr<SessionStorage> copy(Page*); 44 44 45 PassRefPtr< OriginStorage> originStorage(SecurityOrigin*);45 PassRefPtr<StorageArea> storageArea(SecurityOrigin*); 46 46 47 47 #ifndef NDEBUG … … 54 54 Page* m_page; 55 55 56 typedef HashMap<RefPtr<SecurityOrigin>, RefPtr< OriginStorage>, SecurityOriginHash, SecurityOriginTraits> OriginStorageMap;57 OriginStorageMap m_originStorageMap;56 typedef HashMap<RefPtr<SecurityOrigin>, RefPtr<StorageArea>, SecurityOriginHash, SecurityOriginTraits> StorageAreaMap; 57 StorageAreaMap m_storageAreaMap; 58 58 }; 59 59 -
trunk/WebCore/storage/Storage.cpp
r31697 r31793 27 27 #include "Storage.h" 28 28 29 #include " OriginStorage.h"29 #include "StorageArea.h" 30 30 #include "PlatformString.h" 31 31 #include <wtf/PassRefPtr.h> … … 33 33 namespace WebCore { 34 34 35 PassRefPtr<Storage> Storage::create(Frame* frame, PassRefPtr< OriginStorage> originStorage)35 PassRefPtr<Storage> Storage::create(Frame* frame, PassRefPtr<StorageArea> storageArea) 36 36 { 37 return adoptRef(new Storage(frame, originStorage));37 return adoptRef(new Storage(frame, storageArea)); 38 38 } 39 39 40 Storage::Storage(Frame* frame, PassRefPtr< OriginStorage> originStorage)40 Storage::Storage(Frame* frame, PassRefPtr<StorageArea> storageArea) 41 41 : m_frame(frame) 42 , m_ originStorage(originStorage)42 , m_storageArea(storageArea) 43 43 { 44 44 ASSERT(m_frame); 45 ASSERT(m_ originStorage);45 ASSERT(m_storageArea); 46 46 } 47 47 … … 51 51 return 0; 52 52 53 return m_ originStorage->length();53 return m_storageArea->length(); 54 54 } 55 55 … … 60 60 return String(); 61 61 62 return m_ originStorage->key(index, ec);62 return m_storageArea->key(index, ec); 63 63 } 64 64 … … 68 68 return String(); 69 69 70 return m_ originStorage->getItem(key);70 return m_storageArea->getItem(key); 71 71 } 72 72 … … 77 77 return; 78 78 79 m_ originStorage->setItem(key, value, ec, m_frame);79 m_storageArea->setItem(key, value, ec, m_frame); 80 80 } 81 81 … … 85 85 return; 86 86 87 m_ originStorage->removeItem(key, m_frame);87 m_storageArea->removeItem(key, m_frame); 88 88 } 89 89 … … 93 93 return false; 94 94 95 return m_ originStorage->contains(key);95 return m_storageArea->contains(key); 96 96 } 97 97 -
trunk/WebCore/storage/Storage.h
r31697 r31793 27 27 #define Storage_h 28 28 29 #include " OriginStorage.h"29 #include "StorageArea.h" 30 30 31 31 #include <wtf/Forward.h> … … 41 41 class Storage : public RefCounted<Storage> { 42 42 public: 43 static PassRefPtr<Storage> create(Frame*, PassRefPtr< OriginStorage>);43 static PassRefPtr<Storage> create(Frame*, PassRefPtr<StorageArea>); 44 44 45 45 unsigned length() const; … … 54 54 55 55 private: 56 Storage(Frame*, PassRefPtr< OriginStorage>);56 Storage(Frame*, PassRefPtr<StorageArea>); 57 57 58 58 Frame* m_frame; 59 RefPtr< OriginStorage> m_originStorage;59 RefPtr<StorageArea> m_storageArea; 60 60 }; 61 61 -
trunk/WebCore/storage/StorageArea.cpp
r31777 r31793 25 25 26 26 #include "config.h" 27 #include " OriginStorage.h"27 #include "StorageArea.h" 28 28 29 29 #include "CString.h" … … 39 39 namespace WebCore { 40 40 41 PassRefPtr< OriginStorage> OriginStorage::create(Page* page, SecurityOrigin* origin)41 PassRefPtr<StorageArea> StorageArea::create(Page* page, SecurityOrigin* origin) 42 42 { 43 return adoptRef(new OriginStorage(page, origin));43 return adoptRef(new StorageArea(page, origin)); 44 44 } 45 45 46 OriginStorage::OriginStorage(Page* page, SecurityOrigin* origin)46 StorageArea::StorageArea(Page* page, SecurityOrigin* origin) 47 47 : m_page(page) 48 48 , m_securityOrigin(origin) … … 51 51 } 52 52 53 OriginStorage::OriginStorage(Page* page, SecurityOrigin* origin, PassRefPtr<StorageMap> map)53 StorageArea::StorageArea(Page* page, SecurityOrigin* origin, PassRefPtr<StorageMap> map) 54 54 : m_page(page) 55 55 , m_securityOrigin(origin) … … 58 58 } 59 59 60 OriginStorage::~OriginStorage()60 StorageArea::~StorageArea() 61 61 { 62 62 } 63 63 64 PassRefPtr< OriginStorage> OriginStorage::copy(Page* newPage, SecurityOrigin* origin)64 PassRefPtr<StorageArea> StorageArea::copy(Page* newPage, SecurityOrigin* origin) 65 65 { 66 return adoptRef(new OriginStorage(newPage, origin, m_storageMap));66 return adoptRef(new StorageArea(newPage, origin, m_storageMap)); 67 67 } 68 68 69 unsigned OriginStorage::length() const69 unsigned StorageArea::length() const 70 70 { 71 71 return m_storageMap->length(); 72 72 } 73 73 74 String OriginStorage::key(unsigned index, ExceptionCode& ec) const74 String StorageArea::key(unsigned index, ExceptionCode& ec) const 75 75 { 76 76 String key; … … 84 84 } 85 85 86 String OriginStorage::getItem(const String& key) const86 String StorageArea::getItem(const String& key) const 87 87 { 88 88 return m_storageMap->getItem(key); 89 89 } 90 90 91 void OriginStorage::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)91 void StorageArea::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame) 92 92 { 93 93 // Per the spec, inserting a NULL value into the map is the same as removing the key altogether … … 113 113 } 114 114 115 void OriginStorage::removeItem(const String& key, Frame* frame)115 void StorageArea::removeItem(const String& key, Frame* frame) 116 116 { 117 117 String oldValue; … … 125 125 } 126 126 127 bool OriginStorage::contains(const String& key) const127 bool StorageArea::contains(const String& key) const 128 128 { 129 129 return m_storageMap->contains(key); 130 130 } 131 131 132 void OriginStorage::dispatchStorageEvent(const String& key, const String& oldValue, const String& newValue, Frame* sourceFrame)132 void StorageArea::dispatchStorageEvent(const String& key, const String& oldValue, const String& newValue, Frame* sourceFrame) 133 133 { 134 134 // For SessionStorage events, each frame in the page's frametree with the same origin as this Storage needs to be notified of the change -
trunk/WebCore/storage/StorageArea.h
r31777 r31793 24 24 */ 25 25 26 #ifndef OriginStorage_h27 #define OriginStorage_h26 #ifndef StorageArea_h 27 #define StorageArea_h 28 28 29 29 #include <wtf/Forward.h> … … 40 40 typedef int ExceptionCode; 41 41 42 class OriginStorage : public RefCounted<OriginStorage> {42 class StorageArea : public RefCounted<StorageArea> { 43 43 public: 44 virtual ~ OriginStorage();44 virtual ~StorageArea(); 45 45 46 static PassRefPtr< OriginStorage> create(Page*, SecurityOrigin*);47 PassRefPtr< OriginStorage> copy(Page*, SecurityOrigin*);46 static PassRefPtr<StorageArea> create(Page*, SecurityOrigin*); 47 PassRefPtr<StorageArea> copy(Page*, SecurityOrigin*); 48 48 49 49 unsigned length() const; … … 56 56 57 57 private: 58 OriginStorage(Page*, SecurityOrigin*);59 OriginStorage(Page*, SecurityOrigin*, PassRefPtr<StorageMap>);58 StorageArea(Page*, SecurityOrigin*); 59 StorageArea(Page*, SecurityOrigin*, PassRefPtr<StorageMap>); 60 60 61 61 void dispatchStorageEvent(const String& key, const String& oldValue, const String& newValue, Frame* sourceFrame); … … 68 68 } // namespace WebCore 69 69 70 #endif // OriginStorage_h70 #endif // StorageArea_h
Note:
See TracChangeset
for help on using the changeset viewer.