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

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

Issue 236773003: Completely remove DOMRequestState from IndexedDB code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « Source/modules/indexeddb/IDBRequest.h ('k') | Source/modules/indexeddb/IDBRequest.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/IDBRequest.cpp
diff --git a/Source/modules/indexeddb/IDBRequest.cpp b/Source/modules/indexeddb/IDBRequest.cpp
index c7e3223a44cba98c1ec88d1b010f88689ddec1ce..8bab481acd04588ae746702afc9acc8d6e0995c7 100644
--- a/Source/modules/indexeddb/IDBRequest.cpp
+++ b/Source/modules/indexeddb/IDBRequest.cpp
@@ -60,6 +60,7 @@ IDBRequest::IDBRequest(ExecutionContext* context, PassRefPtr<IDBAny> source, IDB
, m_transaction(transaction)
, m_readyState(PENDING)
, m_requestAborted(false)
+ , m_scriptState(NewScriptState::current(toIsolate(context)))
, m_source(source)
, m_hasPendingActivity(true)
, m_cursorType(IndexedDB::CursorKeyAndValue)
@@ -68,7 +69,6 @@ IDBRequest::IDBRequest(ExecutionContext* context, PassRefPtr<IDBAny> source, IDB
, m_didFireUpgradeNeededEvent(false)
, m_preventPropagation(false)
, m_resultDirty(true)
- , m_requestState(toIsolate(context))
{
ScriptWrappable::init(this);
}
@@ -78,7 +78,7 @@ IDBRequest::~IDBRequest()
ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !executionContext());
}
-ScriptValue IDBRequest::result(NewScriptState* scriptState, ExceptionState& exceptionState)
+ScriptValue IDBRequest::result(ExceptionState& exceptionState)
{
if (m_readyState != DONE) {
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::requestNotFinishedErrorMessage);
@@ -87,7 +87,7 @@ ScriptValue IDBRequest::result(NewScriptState* scriptState, ExceptionState& exce
if (m_contextStopped || !executionContext())
return ScriptValue();
m_resultDirty = false;
- return idbAnyToScriptValue(scriptState, m_result);
+ return idbAnyToScriptValue(m_scriptState.get(), m_result);
}
PassRefPtrWillBeRawPtr<DOMError> IDBRequest::error(ExceptionState& exceptionState) const
@@ -99,12 +99,12 @@ PassRefPtrWillBeRawPtr<DOMError> IDBRequest::error(ExceptionState& exceptionStat
return m_error;
}
-ScriptValue IDBRequest::source(NewScriptState* scriptState) const
+ScriptValue IDBRequest::source() const
{
if (m_contextStopped || !executionContext())
return ScriptValue();
- return idbAnyToScriptValue(scriptState, m_source);
+ return idbAnyToScriptValue(m_scriptState.get(), m_source);
}
const String& IDBRequest::readyState() const
@@ -314,7 +314,7 @@ void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> prpValueBuffer, PassRefPtr<I
RefPtr<IDBKey> primaryKey = prpPrimaryKey;
#ifndef NDEBUG
- assertPrimaryKeyValidOrInjectable(&m_requestState, valueBuffer, primaryKey, keyPath);
+ assertPrimaryKeyValidOrInjectable(m_scriptState.get(), valueBuffer, primaryKey, keyPath);
#endif
onSuccessInternal(IDBAny::create(valueBuffer, primaryKey, keyPath));
@@ -374,7 +374,6 @@ void IDBRequest::stop()
return;
m_contextStopped = true;
- m_requestState.clear();
RefPtr<IDBRequest> protect(this);
@@ -404,13 +403,12 @@ bool IDBRequest::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
IDB_TRACE("IDBRequest::dispatchEvent");
if (m_contextStopped || !executionContext())
return false;
- ASSERT(m_requestState.isValid());
ASSERT(m_readyState == PENDING);
ASSERT(m_hasPendingActivity);
ASSERT(m_enqueuedEvents.size());
ASSERT(event->target() == this);
- DOMRequestState::Scope scope(m_requestState);
+ NewScriptState::Scope scope(m_scriptState.get());
if (event->type() != EventTypeNames::blocked)
m_readyState = DONE;
« no previous file with comments | « Source/modules/indexeddb/IDBRequest.h ('k') | Source/modules/indexeddb/IDBRequest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698