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

Unified Diff: Source/core/storage/Storage.cpp

Issue 106853005: Implement platform deleters per spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch to DeleteResult enum + extend scheme to indexed deleters Created 7 years 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
Index: Source/core/storage/Storage.cpp
diff --git a/Source/core/storage/Storage.cpp b/Source/core/storage/Storage.cpp
index 76abd82a300ffeb590d682add181d3dc831bcee6..bb01df1b4ad6f384c9d7a43b38c2c3d75764d430 100644
--- a/Source/core/storage/Storage.cpp
+++ b/Source/core/storage/Storage.cpp
@@ -78,20 +78,23 @@ bool Storage::anonymousIndexedSetter(unsigned index, const AtomicString& value,
return anonymousNamedSetter(AtomicString::number(index), value, exceptionState);
}
-bool Storage::anonymousNamedDeleter(const AtomicString& name, ExceptionState& exceptionState)
+DeleteResult Storage::anonymousNamedDeleter(const AtomicString& name, ExceptionState& exceptionState)
{
bool found = contains(name, exceptionState);
- if (!found || exceptionState.hadException())
- return false;
+ if (!found)
+ return DeleteUnknownProperty;
+ if (exceptionState.hadException())
+ return DeleteReject;
removeItem(name, exceptionState);
if (exceptionState.hadException())
- return false;
- return true;
+ return DeleteReject;
+ return DeleteSuccess;
}
-bool Storage::anonymousIndexedDeleter(unsigned index, ExceptionState& exceptionState)
+DeleteResult Storage::anonymousIndexedDeleter(unsigned index, ExceptionState& exceptionState)
{
- return anonymousNamedDeleter(AtomicString::number(index), exceptionState);
+ DeleteResult result = anonymousNamedDeleter(AtomicString::number(index), exceptionState);
+ return result == DeleteUnknownProperty ? DeleteSuccess : result;
}
void Storage::namedPropertyEnumerator(Vector<String>& names, ExceptionState& exceptionState)
« Source/bindings/scripts/code_generator_v8.pm ('K') | « Source/core/storage/Storage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698