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

Unified Diff: Source/bindings/core/v8/V8Debugger.cpp

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/bindings/core/v8/V8Debugger.h ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Debugger.cpp
diff --git a/Source/bindings/core/v8/V8Debugger.cpp b/Source/bindings/core/v8/V8Debugger.cpp
index 3e3966e7c3e8619f034b5779c82dd7fd1e634639..579efe25fd9d11e3fdd548b4d881cb68f149e862 100644
--- a/Source/bindings/core/v8/V8Debugger.cpp
+++ b/Source/bindings/core/v8/V8Debugger.cpp
@@ -37,9 +37,7 @@
#include "core/inspector/JavaScriptCallFrame.h"
#include "core/inspector/ScriptDebugListener.h"
#include "platform/JSONValues.h"
-#include "wtf/Deque.h"
#include "wtf/StdLibExtras.h"
-#include "wtf/ThreadingPrimitives.h"
#include "wtf/Vector.h"
#include "wtf/dtoa/utils.h"
#include "wtf/text/CString.h"
@@ -51,27 +49,6 @@ const char stepIntoV8MethodName[] = "stepIntoStatement";
const char stepOutV8MethodName[] = "stepOutOfFunction";
}
-class V8Debugger::ThreadSafeTaskQueue {
- WTF_MAKE_NONCOPYABLE(ThreadSafeTaskQueue);
-public:
- ThreadSafeTaskQueue() { }
- PassOwnPtr<Task> tryTake()
- {
- MutexLocker lock(m_mutex);
- if (m_queue.isEmpty())
- return nullptr;
- return m_queue.takeFirst();
- }
- void append(PassOwnPtr<Task> task)
- {
- MutexLocker lock(m_mutex);
- m_queue.append(task);
- }
-private:
- Mutex m_mutex;
- Deque<OwnPtr<Task>> m_queue;
-};
-
v8::MaybeLocal<v8::Value> V8Debugger::callDebuggerMethod(const char* functionName, int argc, v8::Local<v8::Value> argv[])
{
v8::Local<v8::Object> debuggerScript = debuggerScriptLocal();
@@ -85,7 +62,6 @@ V8Debugger::V8Debugger(v8::Isolate* isolate, Client* client)
, m_client(client)
, m_breakpointsActivated(true)
, m_runningNestedMessageLoop(false)
- , m_taskQueue(adoptPtr(new ThreadSafeTaskQueue))
{
}
@@ -482,22 +458,6 @@ PassRefPtrWillBeRawPtr<JavaScriptCallFrame> V8Debugger::callFrameNoScopes(int in
return JavaScriptCallFrame::create(debuggerContext(), v8::Local<v8::Object>::Cast(currentCallFrameV8));
}
-void V8Debugger::interruptAndRun(PassOwnPtr<Task> task)
-{
- m_taskQueue->append(task);
- m_isolate->RequestInterrupt(&v8InterruptCallback, this);
-}
-
-void V8Debugger::runPendingTasks()
-{
- while (true) {
- OwnPtr<Task> task = m_taskQueue->tryTake();
- if (!task)
- return;
- task->run();
- }
-}
-
static V8Debugger* toV8Debugger(v8::Local<v8::Value> data)
{
void* p = v8::Local<v8::External>::Cast(data)->Value();
@@ -557,13 +517,6 @@ void V8Debugger::handleProgramBreak(ScriptState* pausedScriptState, v8::Local<v8
}
}
-void V8Debugger::v8InterruptCallback(v8::Isolate*, void* data)
-{
- V8Debugger* server = static_cast<V8Debugger*>(data);
- if (server->enabled())
- server->runPendingTasks();
-}
-
void V8Debugger::v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails)
{
V8Debugger* thisPtr = toV8Debugger(eventDetails.GetCallbackData());
« no previous file with comments | « Source/bindings/core/v8/V8Debugger.h ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698