| 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)
|
|
|