void InspectorDOMStorageAgent::removeDOMStorageItem(ErrorString* errorString, const RefPtr<JSONObject>& storageId, const String& key)
{
    LocalFrame* frame;
    StorageArea* storageArea = findStorageArea(0, storageId, frame);
    if (!storageArea) {
        *errorString = "Storage not found";
        return;
    }

    TrackExceptionState exceptionState;
    storageArea->removeItem(key, exceptionState, frame);
    *errorString = toErrorString(exceptionState);
}
Ejemplo n.º 2
0
Response InspectorDOMStorageAgent::removeDOMStorageItem(
    std::unique_ptr<protocol::DOMStorage::StorageId> storageId,
    const String& key) {
  LocalFrame* frame = nullptr;
  StorageArea* storageArea = nullptr;
  Response response = findStorageArea(std::move(storageId), frame, storageArea);
  if (!response.isSuccess())
    return response;

  TrackExceptionState exceptionState;
  storageArea->removeItem(key, exceptionState, frame);
  return toResponse(exceptionState);
}