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

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

Issue 1163923005: Fix crash in inspector-protocol/debugger/debugger-pause-dedicated-worker.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed printf Created 5 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 | « Source/core/core.gypi ('k') | Source/core/inspector/InspectorTaskRunner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorTaskRunner.h
diff --git a/Source/core/inspector/InspectorTaskRunner.h b/Source/core/inspector/InspectorTaskRunner.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e608ed6c75837d268c2d98883e0278545a665da
--- /dev/null
+++ b/Source/core/inspector/InspectorTaskRunner.h
@@ -0,0 +1,46 @@
+// Copyright 2015 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 InspectorTaskRunner_h
+#define InspectorTaskRunner_h
+
+#include "wtf/Forward.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include <v8.h>
+
+namespace blink {
+
+class InspectorTaskRunner final {
+ WTF_MAKE_NONCOPYABLE(InspectorTaskRunner);
+public:
+ explicit InspectorTaskRunner(v8::Isolate*);
+ ~InspectorTaskRunner();
+
+ class Task {
+ public:
+ virtual ~Task() { }
+ virtual void run() = 0;
+ };
+ // This method can be called on any thread. It is caller's responsibility to make sure that
+ // this V8Debugger and corresponding v8::Isolate exist while this method is running.
+ void interruptAndRun(PassOwnPtr<Task>);
+ void runPendingTasks();
+
+ void setIgnoreInterrupts(bool ignore) { m_ignoreInterrupts = ignore; }
+
+private:
+ static void v8InterruptCallback(v8::Isolate*, void* data);
+
+ v8::Isolate* m_isolate;
+ class ThreadSafeTaskQueue;
+ OwnPtr<ThreadSafeTaskQueue> m_taskQueue;
+ bool m_ignoreInterrupts;
+};
+
+} // namespace blink
+
+
+#endif // !defined(InspectorTaskRunner_h)
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/inspector/InspectorTaskRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698