#import "EventLoop.h"
#import "RemoteInspector.h"
+#import <dispatch/dispatch.h>
#import <wtf/Vector.h>
#if PLATFORM(IOS)
rwiQueueMutex = std::make_unique<std::mutex>().release();
CFRunLoopSourceContext runLoopSourceContext = {0, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, RemoteInspectorHandleRunSourceGlobal};
- rwiRunLoopSource = CFRunLoopSourceCreate(nullptr, 1, &runLoopSourceContext);
+ rwiRunLoopSource = CFRunLoopSourceCreate(kCFAllocatorDefault, 1, &runLoopSourceContext);
// Add to the default run loop mode for default handling, and the JSContext remote inspector run loop mode when paused.
CFRunLoopAddSource(CFRunLoopGetMain(), rwiRunLoopSource, kCFRunLoopDefaultMode);
RemoteInspectorQueueTaskOnGlobalQueue(block);
}
-bool RemoteInspectorDebuggableConnection::setup()
+bool RemoteInspectorDebuggableConnection::setup(bool isAutomaticInspection, bool automaticallyPause)
{
std::lock_guard<std::mutex> lock(m_debuggableMutex);
{
std::lock_guard<std::mutex> lock(m_debuggableMutex);
if (!m_debuggable || !m_debuggable->remoteDebuggingAllowed() || m_debuggable->hasLocalDebugger()) {
- RemoteInspector::shared().setupFailed(identifier());
+ RemoteInspector::singleton().setupFailed(identifier());
m_debuggable = nullptr;
} else {
- m_debuggable->connect(this);
+ m_debuggable->connect(this, isAutomaticInspection);
m_connected = true;
+
+ if (automaticallyPause)
+ m_debuggable->pause();
}
}
deref();
bool RemoteInspectorDebuggableConnection::sendMessageToFrontend(const String& message)
{
- RemoteInspector::shared().sendMessageToRemoteFrontend(identifier(), message);
+ RemoteInspector::singleton().sendMessageToRemoteFrontend(identifier(), message);
return true;
}
m_runLoop = debuggerRunLoop;
CFRunLoopSourceContext runLoopSourceContext = {0, this, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, RemoteInspectorHandleRunSourceWithInfo};
- m_runLoopSource = CFRunLoopSourceCreate(nullptr, 1, &runLoopSourceContext);
+ m_runLoopSource = adoptCF(CFRunLoopSourceCreate(kCFAllocatorDefault, 1, &runLoopSourceContext));
CFRunLoopAddSource(m_runLoop.get(), m_runLoopSource.get(), kCFRunLoopDefaultMode);
CFRunLoopAddSource(m_runLoop.get(), m_runLoopSource.get(), EventLoop::remoteInspectorRunLoopMode());