Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp

Issue 2632553002: [DevTools] Clear local storage (Closed)
Patch Set: [DevTools] Clear local storage Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp
diff --git a/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp b/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp
index 2e746f4611ae6d2a5d0212d0a400854609bf1640..7d6f6912a19171f40ca1f3bbf7185cbc4f1f8baa 100644
--- a/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp
+++ b/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp
@@ -94,6 +94,20 @@ Response InspectorDOMStorageAgent::disable() {
return Response::OK();
}
+Response InspectorDOMStorageAgent::clear(
+ std::unique_ptr<protocol::DOMStorage::StorageId> storageId) {
+ LocalFrame* frame = nullptr;
+ StorageArea* storageArea = nullptr;
+ Response response = findStorageArea(std::move(storageId), frame, storageArea);
+ if (!response.isSuccess())
+ return response;
+ DummyExceptionStateForTesting exceptionState;
+ storageArea->clear(exceptionState, frame);
+ if (exceptionState.hadException())
+ return Response::Error("Could not clear the storage");
+ return Response::OK();
+}
+
Response InspectorDOMStorageAgent::getDOMStorageItems(
std::unique_ptr<protocol::DOMStorage::StorageId> storageId,
std::unique_ptr<protocol::Array<protocol::Array<String>>>* items) {
« no previous file with comments | « third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698