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

Unified Diff: Source/core/inspector/PromiseTracker.h

Issue 433653003: Support Promises event-based instrumentation on backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address review comments + REBASE Created 6 years, 4 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/core/inspector/InspectorDebuggerAgent.cpp ('k') | Source/core/inspector/PromiseTracker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/PromiseTracker.h
diff --git a/Source/core/inspector/PromiseTracker.h b/Source/core/inspector/PromiseTracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..ffb6bd475f33cd5f03efe12fe861a8243028a24b
--- /dev/null
+++ b/Source/core/inspector/PromiseTracker.h
@@ -0,0 +1,44 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PromiseTracker_h
+#define PromiseTracker_h
+
+#include "wtf/HashMap.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/RefPtr.h"
+#include "wtf/Vector.h"
+#include <v8.h>
+
+namespace blink {
+
+class ScriptState;
+
+class PromiseTracker {
+ WTF_MAKE_NONCOPYABLE(PromiseTracker);
+public:
+ PromiseTracker();
+ ~PromiseTracker();
+
+ bool isEnabled() const { return m_isEnabled; }
+ void enable();
+ void disable();
+
+ void clear();
+
+ void didReceiveV8PromiseEvent(ScriptState*, v8::Handle<v8::Object> promise, v8::Handle<v8::Value> parentPromise, int status);
+
+ class PromiseData;
aandrey 2014/08/28 14:05:53 make this and below private? (if needed remove ano
+
+ typedef Vector<RefPtr<PromiseData> > PromiseDataVector;
+ typedef HashMap<int, PromiseDataVector> PromiseDataMap;
+
+private:
+ bool m_isEnabled;
+ PromiseDataMap m_promiseDataMap;
+};
+
+} // namespace blink
+
+#endif // !defined(PromiseTracker_h)
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.cpp ('k') | Source/core/inspector/PromiseTracker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698