Source/JavaScriptCore:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
* inspector/JSGlobalObjectInspectorController.h:
* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::RemoteInspector):
(Inspector::RemoteInspector::setupFailed):
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::stopInternal):
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::receivedSetupMessage):
(Inspector::globalAutomaticInspectionState): Deleted.
(Inspector::RemoteInspector::updateDebuggableAutomaticInspectCandidate): Deleted.
(Inspector::RemoteInspector::sendAutomaticInspectionCandidateMessage): Deleted.
(Inspector::RemoteInspector::setupSucceeded): Deleted.
(Inspector::RemoteInspector::waitingForAutomaticInspection): Deleted.
(Inspector::RemoteInspector::receivedAutomaticInspectionConfigurationMessage): Deleted.
(Inspector::RemoteInspector::receivedAutomaticInspectionRejectMessage): Deleted.
* inspector/remote/RemoteInspectorConstants.h:
* inspector/remote/RemoteInspectorDebuggable.cpp:
(Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
(Inspector::RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection): Deleted.
* inspector/remote/RemoteInspectorDebuggable.h:
* inspector/remote/RemoteInspectorDebuggableConnection.h:
* inspector/remote/RemoteInspectorDebuggableConnection.mm:
(Inspector::RemoteInspectorDebuggableConnection::setup):
* runtime/JSGlobalObjectDebuggable.cpp:
(JSC::JSGlobalObjectDebuggable::connect):
(JSC::JSGlobalObjectDebuggable::pauseWaitingForAutomaticInspection): Deleted.
* runtime/JSGlobalObjectDebuggable.h:
Source/WebCore:
* WebCore.exp.in:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::show):
* inspector/InspectorController.h:
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
* page/PageDebuggable.h:
* testing/Internals.cpp:
(WebCore::Internals::openDummyInspectorFrontend):
Source/WTF:
* wtf/Assertions.cpp:
* wtf/Assertions.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173736
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
+ Unreviewed rollout r173731. Broke multiple builds.
+
+ * inspector/JSGlobalObjectInspectorController.cpp:
+ (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
+ (Inspector::JSGlobalObjectInspectorController::connectFrontend):
+ * inspector/JSGlobalObjectInspectorController.h:
+ * inspector/remote/RemoteInspector.h:
+ * inspector/remote/RemoteInspector.mm:
+ (Inspector::RemoteInspector::RemoteInspector):
+ (Inspector::RemoteInspector::setupFailed):
+ (Inspector::RemoteInspector::start):
+ (Inspector::RemoteInspector::stopInternal):
+ (Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
+ (Inspector::RemoteInspector::xpcConnectionReceivedMessage):
+ (Inspector::RemoteInspector::xpcConnectionFailed):
+ (Inspector::RemoteInspector::receivedSetupMessage):
+ (Inspector::globalAutomaticInspectionState): Deleted.
+ (Inspector::RemoteInspector::updateDebuggableAutomaticInspectCandidate): Deleted.
+ (Inspector::RemoteInspector::sendAutomaticInspectionCandidateMessage): Deleted.
+ (Inspector::RemoteInspector::setupSucceeded): Deleted.
+ (Inspector::RemoteInspector::waitingForAutomaticInspection): Deleted.
+ (Inspector::RemoteInspector::receivedAutomaticInspectionConfigurationMessage): Deleted.
+ (Inspector::RemoteInspector::receivedAutomaticInspectionRejectMessage): Deleted.
+ * inspector/remote/RemoteInspectorConstants.h:
+ * inspector/remote/RemoteInspectorDebuggable.cpp:
+ (Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
+ (Inspector::RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection): Deleted.
+ * inspector/remote/RemoteInspectorDebuggable.h:
+ * inspector/remote/RemoteInspectorDebuggableConnection.h:
+ * inspector/remote/RemoteInspectorDebuggableConnection.mm:
+ (Inspector::RemoteInspectorDebuggableConnection::setup):
+ * runtime/JSGlobalObjectDebuggable.cpp:
+ (JSC::JSGlobalObjectDebuggable::connect):
+ (JSC::JSGlobalObjectDebuggable::pauseWaitingForAutomaticInspection): Deleted.
+ * runtime/JSGlobalObjectDebuggable.h:
+
+2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
+
Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
https://bugs.webkit.org/show_bug.cgi?id=136893
auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(m_injectedScriptManager.get());
auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(m_injectedScriptManager.get(), m_globalObject, consoleAgent.get());
- m_debuggerAgent = debuggerAgent.get();
m_consoleAgent = consoleAgent.get();
m_consoleClient = std::make_unique<JSGlobalObjectConsoleClient>(m_consoleAgent);
m_injectedScriptManager->disconnect();
}
-void JSGlobalObjectInspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel, bool isAutomaticInspection)
+void JSGlobalObjectInspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel)
{
ASSERT(!m_inspectorFrontendChannel);
ASSERT(!m_inspectorBackendDispatcher);
m_inspectorBackendDispatcher = InspectorBackendDispatcher::create(frontendChannel);
m_agents.didCreateFrontendAndBackend(frontendChannel, m_inspectorBackendDispatcher.get());
-
- if (isAutomaticInspection) {
- // FIXME: We should not always pause for automatic inspection.
- // Currently if we don't automatically pause, then we may miss a breakpoint, since breakpoints
- // come from the frontend and might be received after some evaluateScript message. We should
- // have the frontend signal the backend when its setup messages are complete.
- m_debuggerAgent->enable(nullptr);
- m_debuggerAgent->pause(nullptr);
- }
}
void JSGlobalObjectInspectorController::disconnectFrontend(InspectorDisconnectReason reason)
class InspectorConsoleAgent;
class InspectorBackendDispatcher;
class InspectorConsoleAgent;
-class InspectorDebuggerAgent;
class InspectorFrontendChannel;
class JSGlobalObjectConsoleClient;
class ScriptCallStack;
JSGlobalObjectInspectorController(JSC::JSGlobalObject&);
~JSGlobalObjectInspectorController();
- void connectFrontend(InspectorFrontendChannel*, bool isAutomaticInspection);
+ void connectFrontend(InspectorFrontendChannel*);
void disconnectFrontend(InspectorDisconnectReason reason);
void dispatchMessageFromFrontend(const String&);
std::unique_ptr<InjectedScriptManager> m_injectedScriptManager;
std::unique_ptr<JSGlobalObjectConsoleClient> m_consoleClient;
InspectorConsoleAgent* m_consoleAgent;
- InspectorDebuggerAgent* m_debuggerAgent;
InspectorAgentRegistry m_agents;
InspectorFrontendChannel* m_inspectorFrontendChannel;
RefPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
void registerDebuggable(RemoteInspectorDebuggable*);
void unregisterDebuggable(RemoteInspectorDebuggable*);
void updateDebuggable(RemoteInspectorDebuggable*);
- void updateDebuggableAutomaticInspectCandidate(RemoteInspectorDebuggable*);
void sendMessageToRemoteFrontend(unsigned identifier, const String& message);
void setupFailed(unsigned identifier);
- void setupSucceeded(unsigned identifier);
- bool waitingForAutomaticInspection(unsigned identifier);
bool enabled() const { return m_enabled; }
bool hasActiveDebugSession() const { return m_hasActiveDebugSession; }
void updateHasActiveDebugSession();
- void sendAutomaticInspectionCandidateMessage();
-
virtual void xpcConnectionReceivedMessage(RemoteInspectorXPCConnection*, NSString *messageName, NSDictionary *userInfo) override;
virtual void xpcConnectionFailed(RemoteInspectorXPCConnection*) override;
virtual void xpcConnectionUnhandledMessage(RemoteInspectorXPCConnection*, xpc_object_t) override;
void receivedIndicateMessage(NSDictionary *userInfo);
void receivedProxyApplicationSetupMessage(NSDictionary *userInfo);
void receivedConnectionDiedMessage(NSDictionary *userInfo);
- void receivedAutomaticInspectionConfigurationMessage(NSDictionary *userInfo);
- void receivedAutomaticInspectionRejectMessage(NSDictionary *userInfo);
static bool startEnabled;
pid_t m_parentProcessIdentifier;
RetainPtr<CFDataRef> m_parentProcessAuditData;
bool m_shouldSendParentProcessInformation;
- bool m_automaticInspectionEnabled;
- bool m_automaticInspectionPaused;
- unsigned m_automaticInspectionCandidateIdentifier;
};
} // namespace Inspector
/*
- * Copyright (C) 2013, 2014 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2013 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
return sandbox_check(getpid(), "mach-lookup", SANDBOX_FILTER_GLOBAL_NAME, WIRXPCMachPortName) == 0;
}
-static bool globalAutomaticInspectionState()
-{
- int token = 0;
- if (notify_register_check(WIRAutomaticInspectionEnabledState, &token) != NOTIFY_STATUS_OK)
- return false;
-
- uint64_t automaticInspectionEnabled = 0;
- notify_get_state(token, &automaticInspectionEnabled);
- return automaticInspectionEnabled == 1;
-}
-
static void dispatchAsyncOnQueueSafeForAnyDebuggable(void (^block)())
{
#if PLATFORM(IOS)
, m_pushScheduled(false)
, m_parentProcessIdentifier(0)
, m_shouldSendParentProcessInformation(false)
- , m_automaticInspectionEnabled(false)
- , m_automaticInspectionPaused(false)
- , m_automaticInspectionCandidateIdentifier(0)
{
}
pushListingSoon();
}
-void RemoteInspector::updateDebuggableAutomaticInspectCandidate(RemoteInspectorDebuggable* debuggable)
-{
- {
- std::lock_guard<std::mutex> lock(m_mutex);
-
- unsigned identifier = debuggable->identifier();
- if (!identifier)
- return;
-
- auto result = m_debuggableMap.set(identifier, std::make_pair(debuggable, debuggable->info()));
- ASSERT_UNUSED(result, !result.isNewEntry);
-
- // Don't allow automatic inspection unless there is a debugger or we are stopped.
- if (!WTFIsDebuggerAttached() || !m_automaticInspectionEnabled || !m_enabled) {
- pushListingSoon();
- return;
- }
-
- // FIXME: We should handle multiple debuggables trying to pause at the same time on different threads.
- // To make this work we will need to change m_automaticInspectionCandidateIdentifier to be a per-thread value.
- // Multiple attempts on the same thread should not be possible because our nested run loop is in a special RWI mode.
- if (m_automaticInspectionPaused) {
- LOG_ERROR("Skipping Automatic Inspection Candidate with pageId(%u) because we are already paused waiting for pageId(%u)", identifier, m_automaticInspectionCandidateIdentifier);
- pushListingSoon();
- return;
- }
-
- m_automaticInspectionPaused = true;
- m_automaticInspectionCandidateIdentifier = identifier;
-
- // If we are pausing before we have connected to webinspectord the candidate message will be sent as soon as the connection is established.
- if (m_xpcConnection) {
- pushListingNow();
- sendAutomaticInspectionCandidateMessage();
- }
-
- // In case debuggers fail to respond, or we cannot connect to webinspectord, automatically continue after a short period of time.
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- std::lock_guard<std::mutex> lock(m_mutex);
- if (m_automaticInspectionCandidateIdentifier == identifier) {
- LOG_ERROR("Skipping Automatic Inspection Candidate with pageId(%u) because we failed to receive a response in time.", m_automaticInspectionCandidateIdentifier);
- m_automaticInspectionPaused = false;
- }
- });
- }
-
- debuggable->pauseWaitingForAutomaticInspection();
-
- {
- std::lock_guard<std::mutex> lock(m_mutex);
-
- ASSERT(m_automaticInspectionCandidateIdentifier);
- m_automaticInspectionCandidateIdentifier = 0;
- }
-}
-
-void RemoteInspector::sendAutomaticInspectionCandidateMessage()
-{
- ASSERT(m_enabled);
- ASSERT(m_automaticInspectionEnabled);
- ASSERT(m_automaticInspectionPaused);
- ASSERT(m_automaticInspectionCandidateIdentifier);
- ASSERT(m_xpcConnection);
-
- NSDictionary *details = @{WIRPageIdentifierKey: @(m_automaticInspectionCandidateIdentifier)};
- m_xpcConnection->sendMessage(WIRAutomaticInspectionCandidateMessage, details);
-}
-
void RemoteInspector::sendMessageToRemoteFrontend(unsigned identifier, const String& message)
{
std::lock_guard<std::mutex> lock(m_mutex);
updateHasActiveDebugSession();
- if (identifier == m_automaticInspectionCandidateIdentifier)
- m_automaticInspectionPaused = false;
-
pushListingSoon();
}
-void RemoteInspector::setupSucceeded(unsigned identifier)
-{
- std::lock_guard<std::mutex> lock(m_mutex);
-
- if (identifier == m_automaticInspectionCandidateIdentifier)
- m_automaticInspectionPaused = false;
-}
-
-bool RemoteInspector::waitingForAutomaticInspection(unsigned)
-{
- // We don't take the lock to check this because we assume it will be checked repeatedly.
- return m_automaticInspectionPaused;
-}
-
void RemoteInspector::start()
{
std::lock_guard<std::mutex> lock(m_mutex);
m_enabled = true;
- // Load the initial automatic inspection state when first started, so we know it before we have even connected to webinspectord.
- static dispatch_once_t once;
- dispatch_once(&once, ^{
- m_automaticInspectionEnabled = globalAutomaticInspectionState();
- });
-
notify_register_dispatch(WIRServiceAvailableNotification, &m_notifyToken, m_xpcQueue, ^(int) {
RemoteInspector::shared().setupXPCConnectionIfNeeded();
});
updateHasActiveDebugSession();
- m_automaticInspectionPaused = false;
-
if (m_xpcConnection) {
switch (source) {
case StopSource::API:
m_xpcConnection->sendMessage(@"syn", nil); // Send a simple message to initialize the XPC connection.
xpc_release(connection);
- if (m_automaticInspectionCandidateIdentifier) {
- // We already have a debuggable waiting to be automatically inspected.
- pushListingNow();
- sendAutomaticInspectionCandidateMessage();
- } else
- pushListingSoon();
+ pushListingSoon();
}
#pragma mark - Proxy Application Information
receivedProxyApplicationSetupMessage(userInfo);
else if ([messageName isEqualToString:WIRConnectionDiedMessage])
receivedConnectionDiedMessage(userInfo);
- else if ([messageName isEqualToString:WIRAutomaticInspectionConfigurationMessage])
- receivedAutomaticInspectionConfigurationMessage(userInfo);
- else if ([messageName isEqualToString:WIRAutomaticInspectionRejectMessage])
- receivedAutomaticInspectionRejectMessage(userInfo);
else
NSLog(@"Unrecognized RemoteInspector XPC Message: %@", messageName);
}
updateHasActiveDebugSession();
- m_automaticInspectionPaused = false;
-
// The connection will close itself.
m_xpcConnection = nullptr;
}
// Legacy iOS WebKit 1 had a notification. This will need to be smarter with WebKit2.
}
-
#pragma mark - Received XPC Messages
void RemoteInspector::receivedSetupMessage(NSDictionary *userInfo)
RemoteInspectorDebuggable* debuggable = it->value.first;
RemoteInspectorDebuggableInfo debuggableInfo = it->value.second;
RefPtr<RemoteInspectorDebuggableConnection> connection = adoptRef(new RemoteInspectorDebuggableConnection(debuggable, connectionIdentifier, sender, debuggableInfo.type));
- bool isAutomaticInspection = m_automaticInspectionCandidateIdentifier == debuggable->identifier();
- if (!connection->setup(isAutomaticInspection)) {
+ if (!connection->setup()) {
connection->close();
return;
}
updateHasActiveDebugSession();
}
-void RemoteInspector::receivedAutomaticInspectionConfigurationMessage(NSDictionary *userInfo)
-{
- m_automaticInspectionEnabled = [[userInfo objectForKey:WIRAutomaticInspectionEnabledKey] boolValue];
-
- if (!m_automaticInspectionEnabled && m_automaticInspectionPaused)
- m_automaticInspectionPaused = false;
-}
-
-void RemoteInspector::receivedAutomaticInspectionRejectMessage(NSDictionary *userInfo)
-{
- unsigned rejectionIdentifier = [[userInfo objectForKey:WIRPageIdentifierKey] unsignedIntValue];
-
- ASSERT(rejectionIdentifier == m_automaticInspectionCandidateIdentifier);
- if (rejectionIdentifier == m_automaticInspectionCandidateIdentifier)
- m_automaticInspectionPaused = false;
-}
-
} // namespace Inspector
#endif // ENABLE(REMOTE_INSPECTOR)
#define WIRServiceAvailabilityCheckNotification "com.apple.webinspectord.availability_check"
#define WIRServiceEnabledNotification "com.apple.webinspectord.enabled"
#define WIRServiceDisabledNotification "com.apple.webinspectord.disabled"
-#define WIRAutomaticInspectionEnabledState "com.apple.webinspectord.automatic_inspection_enabled"
#define WIRApplicationIdentifierKey @"WIRApplicationIdentifierKey"
#define WIRApplicationBundleIdentifierKey @"WIRApplicationBundleIdentifierKey"
#define WIRApplicationNameKey @"WIRApplicationNameKey"
#define WIRIsApplicationProxyKey @"WIRIsApplicationProxyKey"
-#define WIRIsApplicationActiveKey @"WIRIsApplicationActiveKey"
#define WIRHostApplicationIdentifierKey @"WIRHostApplicationIdentifierKey"
#define WIRHostApplicationNameKey @"WIRHostApplicationNameKey"
#define WIRConnectionIdentifierKey @"WIRConnectionIdentifierKey"
#define WIRTypeJavaScript @"WIRTypeJavaScript"
#define WIRTypeWeb @"WIRTypeWeb"
-#define WIRAutomaticInspectionEnabledKey @"WIRAutomaticInspectionEnabledKey"
-#define WIRAutomaticInspectionSessionIdentifierKey @"WIRAutomaticInspectionSessionIdentifierKey"
-#define WIRAutomaticInspectionConfigurationMessage @"WIRAutomaticInspectionConfigurationMessage"
-#define WIRAutomaticInspectionRejectMessage @"WIRAutomaticInspectionRejectMessage"
-#define WIRAutomaticInspectionCandidateMessage @"WIRAutomaticInspectionCandidateMessage"
-
// These definitions are shared with a Simulator webinspectord and
// OS X process communicating with it.
#if ENABLE(REMOTE_INSPECTOR)
-#include "EventLoop.h"
#include "InspectorFrontendChannel.h"
#include "RemoteInspector.h"
m_allowed = allowed;
- if (m_allowed && automaticInspectionAllowed())
- RemoteInspector::shared().updateDebuggableAutomaticInspectCandidate(this);
- else
- RemoteInspector::shared().updateDebuggable(this);
+ update();
}
RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const
return info;
}
-void RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection()
-{
- ASSERT(m_identifier);
- ASSERT(m_allowed);
- ASSERT(automaticInspectionAllowed());
-
- EventLoop loop;
- while (RemoteInspector::shared().waitingForAutomaticInspection(identifier()) && !loop.ended())
- loop.cycle();
-}
-
} // namespace Inspector
#endif // ENABLE(REMOTE_INSPECTOR)
virtual String url() const { return String(); } // Web
virtual bool hasLocalDebugger() const = 0;
- virtual void connect(InspectorFrontendChannel*, bool isAutomaticInspection) = 0;
+ virtual void connect(InspectorFrontendChannel*) = 0;
virtual void disconnect() = 0;
virtual void dispatchMessageFromRemoteFrontend(const String& message) = 0;
virtual void setIndicating(bool) { } // Default is to do nothing.
- virtual bool automaticInspectionAllowed() const { return false; }
- virtual void pauseWaitingForAutomaticInspection();
-
private:
unsigned m_identifier;
bool m_allowed;
NSString *connectionIdentifier() const;
unsigned identifier() const { return m_identifier; }
- bool setup(bool isAutomaticInspection);
+ bool setup();
void close();
void closeFromDebuggable();
RemoteInspectorQueueTaskOnGlobalQueue(block);
}
-bool RemoteInspectorDebuggableConnection::setup(bool isAutomaticInspection)
+bool RemoteInspectorDebuggableConnection::setup()
{
std::lock_guard<std::mutex> lock(m_debuggableMutex);
RemoteInspector::shared().setupFailed(identifier());
m_debuggable = nullptr;
} else {
- m_debuggable->connect(this, isAutomaticInspection);
+ m_debuggable->connect(this);
m_connected = true;
- RemoteInspector::shared().setupSucceeded(identifier());
}
}
deref();
#if ENABLE(REMOTE_INSPECTOR)
-#include "JSLock.h"
#include "InspectorAgentBase.h"
#include "InspectorFrontendChannel.h"
#include "JSGlobalObject.h"
return name.isEmpty() ? ASCIILiteral("JSContext") : name;
}
-void JSGlobalObjectDebuggable::connect(InspectorFrontendChannel* frontendChannel, bool automaticInspection)
+void JSGlobalObjectDebuggable::connect(InspectorFrontendChannel* frontendChannel)
{
JSLockHolder locker(&m_globalObject.vm());
- m_globalObject.inspectorController().connectFrontend(frontendChannel, automaticInspection);
+ m_globalObject.inspectorController().connectFrontend(frontendChannel);
}
void JSGlobalObjectDebuggable::disconnect()
m_globalObject.inspectorController().dispatchMessageFromFrontend(message);
}
-void JSGlobalObjectDebuggable::pauseWaitingForAutomaticInspection()
-{
- JSC::JSLock::DropAllLocks dropAllLocks(&m_globalObject.vm());
- RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection();
-}
-
} // namespace JSC
#endif // ENABLE(REMOTE_INSPECTOR)
virtual String name() const override;
virtual bool hasLocalDebugger() const override { return false; }
- virtual void connect(Inspector::InspectorFrontendChannel*, bool automaticInspection) override;
+ virtual void connect(Inspector::InspectorFrontendChannel*) override;
virtual void disconnect() override;
virtual void dispatchMessageFromRemoteFrontend(const String& message) override;
- virtual bool automaticInspectionAllowed() const override { return true; }
- virtual void pauseWaitingForAutomaticInspection() override;
-
private:
JSGlobalObject& m_globalObject;
};
2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
+ Unreviewed rollout r173731. Broke multiple builds.
+
+ * wtf/Assertions.cpp:
+ * wtf/Assertions.h:
+
+2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
+
Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
https://bugs.webkit.org/show_bug.cgi?id=136893
#include <windows.h>
#endif
-#if OS(DARWIN)
-#include <sys/sysctl.h>
-#include <unistd.h>
-#endif
-
#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
#include <cxxabi.h>
#include <dlfcn.h>
#endif
}
-bool WTFIsDebuggerAttached()
-{
-#if OS(DARWIN)
- struct kinfo_proc info;
- int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() };
- size_t size = sizeof(info);
- if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &info, &size, nullptr, 0) != 0)
- return false;
- return (info.kp_proc.p_flag & P_TRACED) != 0;
-#else
- return false;
-#endif
-}
-
void WTFReportFatalError(const char* file, int line, const char* function, const char* format, ...)
{
va_list args;
#include <inttypes.h>
#include <stdarg.h>
-#include <stdbool.h>
#include <stddef.h>
#ifdef NDEBUG
WTF_EXPORT_PRIVATE void WTFSetCrashHook(WTFCrashHookFunction);
WTF_EXPORT_PRIVATE void WTFInstallReportBacktraceOnCrashHook();
-WTF_EXPORT_PRIVATE bool WTFIsDebuggerAttached();
-
#ifdef __cplusplus
}
#endif
+2014-09-18 Joseph Pecoraro <pecoraro@apple.com>
+
+ Unreviewed rollout r173731. Broke multiple builds.
+
+ * WebCore.exp.in:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::show):
+ * inspector/InspectorController.h:
+ * page/PageDebuggable.cpp:
+ (WebCore::PageDebuggable::connect):
+ * page/PageDebuggable.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::openDummyInspectorFrontend):
+
2014-09-18 Beth Dakin <bdakin@apple.com>
ASSERT in RenderBox::instrinsicScrollbarLogicalWidth opening the inspector
#if ENABLE(INSPECTOR)
__ZN7WebCore14SchemeRegistry27shouldTreatURLSchemeAsLocalERKN3WTF6StringE
__ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
-__ZN7WebCore19InspectorController15connectFrontendEPN9Inspector24InspectorFrontendChannelEb
+__ZN7WebCore19InspectorController15connectFrontendEPN9Inspector24InspectorFrontendChannelE
__ZN7WebCore19InspectorController18disconnectFrontendEN9Inspector25InspectorDisconnectReasonE
__ZN7WebCore19InspectorController18setProfilerEnabledEb
__ZN7WebCore19InspectorController25evaluateForTestInFrontendERKN3WTF6StringE
m_inspectorFrontendClient->windowObjectCleared();
}
-void InspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel, bool)
+void InspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel)
{
ASSERT(frontendChannel);
ASSERT(m_inspectorClient);
else {
InspectorFrontendChannel* frontendChannel = m_inspectorClient->openInspectorFrontend(this);
if (frontendChannel)
- connectFrontend(frontendChannel, false);
+ connectFrontend(frontendChannel);
}
}
bool hasLocalFrontend() const;
bool hasRemoteFrontend() const;
- WEBCORE_EXPORT void connectFrontend(Inspector::InspectorFrontendChannel*, bool isAutomaticInspection);
+ WEBCORE_EXPORT void connectFrontend(Inspector::InspectorFrontendChannel*);
WEBCORE_EXPORT void disconnectFrontend(Inspector::InspectorDisconnectReason);
void setProcessId(long);
return m_page.inspectorController().hasLocalFrontend();
}
-void PageDebuggable::connect(Inspector::InspectorFrontendChannel* channel, bool isAutomaticInspection)
+void PageDebuggable::connect(Inspector::InspectorFrontendChannel* channel)
{
if (!m_page.settings().developerExtrasEnabled()) {
m_forcedDeveloperExtrasEnabled = true;
InspectorController& inspectorController = m_page.inspectorController();
inspectorController.setHasRemoteFrontend(true);
- inspectorController.connectFrontend(reinterpret_cast<WebCore::InspectorFrontendChannel*>(channel), isAutomaticInspection);
+ inspectorController.connectFrontend(reinterpret_cast<WebCore::InspectorFrontendChannel*>(channel));
}
void PageDebuggable::disconnect()
virtual String url() const override;
virtual bool hasLocalDebugger() const override;
- virtual void connect(Inspector::InspectorFrontendChannel*, bool isAutomaticInspection) override;
+ virtual void connect(Inspector::InspectorFrontendChannel*) override;
virtual void disconnect() override;
virtual void dispatchMessageFromRemoteFrontend(const String& message) override;
virtual void setIndicating(bool) override;
m_frontendChannel = adoptPtr(new InspectorFrontendChannelDummy(frontendPage));
- bool isAutomaticInspection = false;
- page->inspectorController().connectFrontend(m_frontendChannel.get(), isAutomaticInspection);
+ page->inspectorController().connectFrontend(m_frontendChannel.get());
return m_frontendWindow;
}