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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp

Issue 2022873003: IndexedDB: Throw exception if no valid context in IDBRequest.result. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added exception comment. Created 4 years, 7 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 | « no previous file | 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/indexeddb/IDBRequest.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
index 87b075a457d29c767b6670981cd79b4e76c8a3b9..c4157b0382229b02758eed4fcb9e22d44ab2dccd 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
@@ -90,11 +90,14 @@ DEFINE_TRACE(IDBRequest)
ScriptValue IDBRequest::result(ExceptionState& exceptionState)
{
if (m_readyState != DONE) {
+ // Must throw if returning an empty value. Message is arbitrary since it will never be seen.
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::requestNotFinishedErrorMessage);
return ScriptValue();
}
- if (m_contextStopped || !getExecutionContext())
+ if (m_contextStopped || !getExecutionContext()) {
+ exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databaseClosedErrorMessage);
return ScriptValue();
+ }
m_resultDirty = false;
ScriptValue value = ScriptValue::from(m_scriptState.get(), m_result);
return value;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698