Created
March 12, 2013 11:50
-
-
Save vivekgalatage/5142312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InspectorHistory* InspectorDOMStorageAgent::findStorageHistory(ErrorString* errorString, const RefPtr<InspectorObject>& storageId, RefPtr<StorageArea>& storageArea, Frame*& targetFrame) | |
{ | |
storageArea = findStorageArea(0, storageId, targetFrame); | |
if (!storageArea) { | |
*errorString = "Storage not found"; | |
return 0; | |
} | |
String historyMapKey; | |
bool isLocalStorage = false; | |
bool success = storageId->getString("securityOrigin", &historyMapKey); | |
if (success) | |
success = storageId->getBoolean("isLocalStorage", &isLocalStorage); | |
if (!success) { | |
if (errorString) | |
*errorString = "Invalid storageId format"; | |
return 0; | |
} | |
historyMapKey.append(isLocalStorage ? "@localStorage" : "@sessionStorage"); | |
StorageIdToHistoryMap::iterator it = m_storageHistoryMap.find(historyMapKey); | |
if (it == m_storageHistoryMap.end()) | |
it = m_storageHistoryMap.set(historyMapKey, adoptPtr(new InspectorHistory())).iterator; | |
ASSERT(it != m_storageHistoryMap.end()); | |
return it->value.get(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment