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

Unified Diff: Source/bindings/core/v8/V8PerIsolateData.h

Issue 686153003: Replace IDBPendingTransactionMonitor with end-of-recursion-scope tasks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review feedback Created 6 years, 1 month 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/bindings/core/v8/V8PerIsolateData.h
diff --git a/Source/bindings/core/v8/V8PerIsolateData.h b/Source/bindings/core/v8/V8PerIsolateData.h
index b0c27f6f7290346c84cfe8f5c577a44eabb065a0..322472dc61fac7034f40487ddede7b5341936823 100644
--- a/Source/bindings/core/v8/V8PerIsolateData.h
+++ b/Source/bindings/core/v8/V8PerIsolateData.h
@@ -31,7 +31,6 @@
#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/WrapperTypeInfo.h"
#include "gin/public/isolate_holder.h"
-#include "modules/indexeddb/IDBPendingTransactionMonitor.h"
#include "wtf/HashMap.h"
#include "wtf/OwnPtr.h"
#include "wtf/Vector.h"
@@ -48,6 +47,12 @@ typedef WTF::Vector<DOMDataStore*> DOMDataStoreList;
class V8PerIsolateData {
public:
+ class EndOfScopeTask {
+ public:
+ virtual ~EndOfScopeTask() { }
+ virtual void Run() = 0;
+ };
+
static v8::Isolate* initialize();
static V8PerIsolateData* from(v8::Isolate* isolate)
{
@@ -102,7 +107,13 @@ public:
const char* previousSamplingState() const { return m_previousSamplingState; }
void setPreviousSamplingState(const char* name) { m_previousSamplingState = name; }
- IDBPendingTransactionMonitor* ensureIDBPendingTransactionMonitor();
+ // EndOfScopeTasks are run by V8RecursionScope when control is returning
+ // to C++ from script, after executing a script task (e.g. callback,
+ // event) or microtasks (e.g. promise). This is explicitly needed for
+ // Indexed DB transactions per spec, but should in general be avoided.
+ void addEndOfScopeTask(PassOwnPtr<EndOfScopeTask>);
+ void runEndOfScopeTasks();
+ void clearEndOfScopeTasks();
private:
V8PerIsolateData();
@@ -138,7 +149,7 @@ private:
OwnPtr<GCEventData> m_gcEventData;
bool m_performingMicrotaskCheckpoint;
- OwnPtr<IDBPendingTransactionMonitor> m_idbPendingTransactionMonitor;
+ Vector<OwnPtr<EndOfScopeTask>> m_endOfScopeTasks;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698