void InspectorDOMStorageAgent::setDOMStorageItem(ErrorString* errorString, const RefPtr<JSONObject>& storageId, const String& key, const String& value) { LocalFrame* frame; StorageArea* storageArea = findStorageArea(0, storageId, frame); if (!storageArea) { *errorString = "Storage not found"; return; } TrackExceptionState exceptionState; storageArea->setItem(key, value, exceptionState, frame); *errorString = toErrorString(exceptionState); }
Response InspectorDOMStorageAgent::setDOMStorageItem( std::unique_ptr<protocol::DOMStorage::StorageId> storageId, const String& key, const String& value) { LocalFrame* frame = nullptr; StorageArea* storageArea = nullptr; Response response = findStorageArea(std::move(storageId), frame, storageArea); if (!response.isSuccess()) return response; TrackExceptionState exceptionState; storageArea->setItem(key, value, exceptionState, frame); return toResponse(exceptionState); }