Unreviewed rollout r173731. Broke multiple builds.
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Sep 2014 22:06:26 +0000 (22:06 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Sep 2014 22:06:26 +0000 (22:06 +0000)
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

22 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h
Source/JavaScriptCore/inspector/remote/RemoteInspector.h
Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h
Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm
Source/JavaScriptCore/runtime/JSGlobalObjectDebuggable.cpp
Source/JavaScriptCore/runtime/JSGlobalObjectDebuggable.h
Source/WTF/ChangeLog
Source/WTF/wtf/Assertions.cpp
Source/WTF/wtf/Assertions.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/page/PageDebuggable.cpp
Source/WebCore/page/PageDebuggable.h
Source/WebCore/testing/Internals.cpp

index 9123f20..412edf5 100644 (file)
@@ -1,5 +1,43 @@
 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
 
index c88a43c..8809e8a 100644 (file)
@@ -61,7 +61,6 @@ JSGlobalObjectInspectorController::JSGlobalObjectInspectorController(JSGlobalObj
     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);
 
@@ -85,7 +84,7 @@ void JSGlobalObjectInspectorController::globalObjectDestroyed()
     m_injectedScriptManager->disconnect();
 }
 
-void JSGlobalObjectInspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel, bool isAutomaticInspection)
+void JSGlobalObjectInspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel)
 {
     ASSERT(!m_inspectorFrontendChannel);
     ASSERT(!m_inspectorBackendDispatcher);
@@ -94,15 +93,6 @@ void JSGlobalObjectInspectorController::connectFrontend(InspectorFrontendChannel
     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)
index 7fe1c93..7605a5c 100644 (file)
@@ -47,7 +47,6 @@ class InjectedScriptManager;
 class InspectorConsoleAgent;
 class InspectorBackendDispatcher;
 class InspectorConsoleAgent;
-class InspectorDebuggerAgent;
 class InspectorFrontendChannel;
 class JSGlobalObjectConsoleClient;
 class ScriptCallStack;
@@ -59,7 +58,7 @@ public:
     JSGlobalObjectInspectorController(JSC::JSGlobalObject&);
     ~JSGlobalObjectInspectorController();
 
-    void connectFrontend(InspectorFrontendChannel*, bool isAutomaticInspection);
+    void connectFrontend(InspectorFrontendChannel*);
     void disconnectFrontend(InspectorDisconnectReason reason);
     void dispatchMessageFromFrontend(const String&);
 
@@ -86,7 +85,6 @@ private:
     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;
index bcd7808..fb6a78a 100644 (file)
@@ -52,11 +52,8 @@ public:
     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; }
@@ -86,8 +83,6 @@ private:
 
     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;
@@ -99,8 +94,6 @@ private:
     void receivedIndicateMessage(NSDictionary *userInfo);
     void receivedProxyApplicationSetupMessage(NSDictionary *userInfo);
     void receivedConnectionDiedMessage(NSDictionary *userInfo);
-    void receivedAutomaticInspectionConfigurationMessage(NSDictionary *userInfo);
-    void receivedAutomaticInspectionRejectMessage(NSDictionary *userInfo);
 
     static bool startEnabled;
 
@@ -124,9 +117,6 @@ private:
     pid_t m_parentProcessIdentifier;
     RetainPtr<CFDataRef> m_parentProcessAuditData;
     bool m_shouldSendParentProcessInformation;
-    bool m_automaticInspectionEnabled;
-    bool m_automaticInspectionPaused;
-    unsigned m_automaticInspectionCandidateIdentifier;
 };
 
 } // namespace Inspector
index 6bf742c..68faa82 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -68,17 +68,6 @@ static bool canAccessWebInspectorMachPort()
     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)
@@ -123,9 +112,6 @@ RemoteInspector::RemoteInspector()
     , m_pushScheduled(false)
     , m_parentProcessIdentifier(0)
     , m_shouldSendParentProcessInformation(false)
-    , m_automaticInspectionEnabled(false)
-    , m_automaticInspectionPaused(false)
-    , m_automaticInspectionCandidateIdentifier(0)
 {
 }
 
@@ -184,74 +170,6 @@ void RemoteInspector::updateDebuggable(RemoteInspectorDebuggable* debuggable)
     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);
@@ -280,26 +198,9 @@ void RemoteInspector::setupFailed(unsigned identifier)
 
     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);
@@ -309,12 +210,6 @@ void RemoteInspector::start()
 
     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();
     });
@@ -344,8 +239,6 @@ void RemoteInspector::stopInternal(StopSource source)
 
     updateHasActiveDebugSession();
 
-    m_automaticInspectionPaused = false;
-
     if (m_xpcConnection) {
         switch (source) {
         case StopSource::API:
@@ -377,12 +270,7 @@ void RemoteInspector::setupXPCConnectionIfNeeded()
     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
@@ -426,10 +314,6 @@ void RemoteInspector::xpcConnectionReceivedMessage(RemoteInspectorXPCConnection*
         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);
 }
@@ -450,8 +334,6 @@ void RemoteInspector::xpcConnectionFailed(RemoteInspectorXPCConnection* connecti
 
     updateHasActiveDebugSession();
 
-    m_automaticInspectionPaused = false;
-
     // The connection will close itself.
     m_xpcConnection = nullptr;
 }
@@ -551,7 +433,6 @@ void RemoteInspector::updateHasActiveDebugSession()
     // 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)
@@ -580,8 +461,7 @@ 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;
     }
@@ -713,23 +593,6 @@ void RemoteInspector::receivedConnectionDiedMessage(NSDictionary *userInfo)
     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)
index e3eb445..647b22e 100644 (file)
 #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.
 
index 1f98a70..fdf1d96 100644 (file)
@@ -28,7 +28,6 @@
 
 #if ENABLE(REMOTE_INSPECTOR)
 
-#include "EventLoop.h"
 #include "InspectorFrontendChannel.h"
 #include "RemoteInspector.h"
 
@@ -62,10 +61,7 @@ void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed)
 
     m_allowed = allowed;
 
-    if (m_allowed && automaticInspectionAllowed())
-        RemoteInspector::shared().updateDebuggableAutomaticInspectCandidate(this);
-    else
-        RemoteInspector::shared().updateDebuggable(this);
+    update();
 }
 
 RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const
@@ -80,17 +76,6 @@ 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)
index 39d50b6..d480968 100644 (file)
@@ -62,14 +62,11 @@ public:
     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;
index 15cbb2c..2bec437 100644 (file)
@@ -84,7 +84,7 @@ public:
     NSString *connectionIdentifier() const;
     unsigned identifier() const { return m_identifier; }
 
-    bool setup(bool isAutomaticInspection);
+    bool setup();
 
     void close();
     void closeFromDebuggable();
index 5d9353e..0c3b908 100644 (file)
@@ -149,7 +149,7 @@ void RemoteInspectorDebuggableConnection::dispatchAsyncOnDebuggable(void (^block
     RemoteInspectorQueueTaskOnGlobalQueue(block);
 }
 
-bool RemoteInspectorDebuggableConnection::setup(bool isAutomaticInspection)
+bool RemoteInspectorDebuggableConnection::setup()
 {
     std::lock_guard<std::mutex> lock(m_debuggableMutex);
 
@@ -164,9 +164,8 @@ bool RemoteInspectorDebuggableConnection::setup(bool isAutomaticInspection)
                 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();
index 67e9fb4..05e0d87 100644 (file)
@@ -28,7 +28,6 @@
 
 #if ENABLE(REMOTE_INSPECTOR)
 
-#include "JSLock.h"
 #include "InspectorAgentBase.h"
 #include "InspectorFrontendChannel.h"
 #include "JSGlobalObject.h"
@@ -49,11 +48,11 @@ String JSGlobalObjectDebuggable::name() const
     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()
@@ -70,12 +69,6 @@ void JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend(const String& m
     m_globalObject.inspectorController().dispatchMessageFromFrontend(message);
 }
 
-void JSGlobalObjectDebuggable::pauseWaitingForAutomaticInspection()
-{
-    JSC::JSLock::DropAllLocks dropAllLocks(&m_globalObject.vm());
-    RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection();
-}
-
 } // namespace JSC
 
 #endif // ENABLE(REMOTE_INSPECTOR)
index 8c6eab7..9f4b6e8 100644 (file)
@@ -51,13 +51,10 @@ public:
     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;
 };
index fd03e9b..8aef869 100644 (file)
@@ -1,5 +1,12 @@
 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
 
index 07d0bd7..341bd01 100644 (file)
 #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>
@@ -390,20 +385,6 @@ void WTFInstallReportBacktraceOnCrashHook()
 #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;
index 8be094c..f4c892a 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <inttypes.h>
 #include <stdarg.h>
-#include <stdbool.h>
 #include <stddef.h>
 
 #ifdef NDEBUG
@@ -146,8 +145,6 @@ typedef void (*WTFCrashHookFunction)();
 WTF_EXPORT_PRIVATE void WTFSetCrashHook(WTFCrashHookFunction);
 WTF_EXPORT_PRIVATE void WTFInstallReportBacktraceOnCrashHook();
 
-WTF_EXPORT_PRIVATE bool WTFIsDebuggerAttached();
-
 #ifdef __cplusplus
 }
 #endif
index 2312ef7..0ca22e1 100644 (file)
@@ -1,3 +1,18 @@
+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
index 88e1eba..874e51e 100644 (file)
@@ -3123,7 +3123,7 @@ __ZN7WebCore5ColorC1ERKN3WTF6StringE
 #if ENABLE(INSPECTOR)
 __ZN7WebCore14SchemeRegistry27shouldTreatURLSchemeAsLocalERKN3WTF6StringE
 __ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
-__ZN7WebCore19InspectorController15connectFrontendEPN9Inspector24InspectorFrontendChannelEb
+__ZN7WebCore19InspectorController15connectFrontendEPN9Inspector24InspectorFrontendChannelE
 __ZN7WebCore19InspectorController18disconnectFrontendEN9Inspector25InspectorDisconnectReasonE
 __ZN7WebCore19InspectorController18setProfilerEnabledEb
 __ZN7WebCore19InspectorController25evaluateForTestInFrontendERKN3WTF6StringE
index 171a6a2..c7c8795 100644 (file)
@@ -230,7 +230,7 @@ void InspectorController::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWo
         m_inspectorFrontendClient->windowObjectCleared();
 }
 
-void InspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel, bool)
+void InspectorController::connectFrontend(InspectorFrontendChannel* frontendChannel)
 {
     ASSERT(frontendChannel);
     ASSERT(m_inspectorClient);
@@ -285,7 +285,7 @@ void InspectorController::show()
     else {
         InspectorFrontendChannel* frontendChannel = m_inspectorClient->openInspectorFrontend(this);
         if (frontendChannel)
-            connectFrontend(frontendChannel, false);
+            connectFrontend(frontendChannel);
     }
 }
 
index 12a1e6a..fd55924 100644 (file)
@@ -93,7 +93,7 @@ public:
     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);
 
index 5cf849a..678c5f2 100644 (file)
@@ -68,7 +68,7 @@ bool PageDebuggable::hasLocalDebugger() const
     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;
@@ -78,7 +78,7 @@ void PageDebuggable::connect(Inspector::InspectorFrontendChannel* channel, bool
 
     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()
index 41efbc7..673264c 100644 (file)
@@ -47,7 +47,7 @@ public:
     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;
index df77d93..0a0267a 100644 (file)
@@ -1477,8 +1477,7 @@ PassRefPtr<DOMWindow> Internals::openDummyInspectorFrontend(const String& url)
 
     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;
 }