Add WebKit2 hooks to notify the VM that the user has requested a debugger break.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Mar 2017 02:42:52 +0000 (02:42 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Mar 2017 02:42:52 +0000 (02:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169089

Reviewed by Tim Horton and Joseph Pecoraro.

Source/JavaScriptCore:

* runtime/VM.cpp:
(JSC::VM::handleTraps):
* runtime/VM.h:
(JSC::VM::notifyNeedDebuggerBreak):

Source/WebKit2:

* CMakeLists.txt:
* DerivedSources.make:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::connect):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp: Added.
(WebKit::WebInspectorInterruptDispatcher::create):
(WebKit::WebInspectorInterruptDispatcher::WebInspectorInterruptDispatcher):
(WebKit::WebInspectorInterruptDispatcher::~WebInspectorInterruptDispatcher):
(WebKit::WebInspectorInterruptDispatcher::initializeConnection):
(WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):
* WebProcess/WebPage/WebInspectorInterruptDispatcher.h: Added.
* WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in: Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeConnection):
* WebProcess/WebProcess.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213338 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.h [new file with mode: 0644]
Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in [new file with mode: 0644]
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h

index 9a397f7..beb26cb 100644 (file)
@@ -1,3 +1,15 @@
+2017-03-02  Mark Lam  <mark.lam@apple.com>
+
+        Add WebKit2 hooks to notify the VM that the user has requested a debugger break.
+        https://bugs.webkit.org/show_bug.cgi?id=169089
+
+        Reviewed by Tim Horton and Joseph Pecoraro.
+
+        * runtime/VM.cpp:
+        (JSC::VM::handleTraps):
+        * runtime/VM.h:
+        (JSC::VM::notifyNeedDebuggerBreak):
+
 2017-03-02  Michael Saboff  <msaboff@apple.com>
 
         Add JSC identity when code signing to allow debugging on iOS
index 96aed50..bd387de 100644 (file)
@@ -957,7 +957,9 @@ void VM::handleTraps(ExecState* exec, VMTraps::Mask mask)
         auto trapEventType = m_traps.takeTopPriorityTrap(mask);
         switch (trapEventType) {
         case VMTraps::NeedDebuggerBreak:
-            RELEASE_ASSERT_NOT_REACHED();
+            if (Options::alwaysCheckTraps())
+                dataLog("VM ", RawPointer(this), " on pid ", getCurrentProcessID(), " received NeedDebuggerBreak trap\n");
+            return;
 
         case VMTraps::NeedWatchdogCheck:
             ASSERT(m_watchdog);
index 466f854..74e645f 100644 (file)
@@ -676,6 +676,7 @@ public:
     bool needTrapHandling(VMTraps::Mask mask = VMTraps::Mask::allEventTypes()) { return m_traps.needTrapHandling(mask); }
     void* needTrapHandlingAddress() { return m_traps.needTrapHandlingAddress(); }
 
+    void notifyNeedDebuggerBreak() { m_traps.fireTrap(VMTraps::NeedDebuggerBreak); }
     void notifyNeedTermination() { m_traps.fireTrap(VMTraps::NeedTermination); }
     void notifyNeedWatchdogCheck() { m_traps.fireTrap(VMTraps::NeedWatchdogCheck); }
 
index 5c08e9e..5e13354 100644 (file)
@@ -572,6 +572,7 @@ set(WebKit2_SOURCES
     WebProcess/WebPage/WebDocumentLoader.cpp
     WebProcess/WebPage/WebFrame.cpp
     WebProcess/WebPage/WebInspector.cpp
+    WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp
     WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp
     WebProcess/WebPage/WebInspectorUI.cpp
     WebProcess/WebPage/WebOpenPanelResultListener.cpp
@@ -679,6 +680,7 @@ set(WebKit2_MESSAGES_IN_FILES
     WebProcess/WebPage/RemoteWebInspectorUI.messages.in
     WebProcess/WebPage/VisitedLinkTableController.messages.in
     WebProcess/WebPage/WebInspector.messages.in
+    WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in
     WebProcess/WebPage/WebInspectorUI.messages.in
     WebProcess/WebPage/WebPage.messages.in
 )
index 52ab8b5..de1f222 100644 (file)
@@ -1,3 +1,28 @@
+2017-03-02  Mark Lam  <mark.lam@apple.com>
+
+        Add WebKit2 hooks to notify the VM that the user has requested a debugger break.
+        https://bugs.webkit.org/show_bug.cgi?id=169089
+
+        Reviewed by Tim Horton and Joseph Pecoraro.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::connect):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp: Added.
+        (WebKit::WebInspectorInterruptDispatcher::create):
+        (WebKit::WebInspectorInterruptDispatcher::WebInspectorInterruptDispatcher):
+        (WebKit::WebInspectorInterruptDispatcher::~WebInspectorInterruptDispatcher):
+        (WebKit::WebInspectorInterruptDispatcher::initializeConnection):
+        (WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):
+        * WebProcess/WebPage/WebInspectorInterruptDispatcher.h: Added.
+        * WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in: Added.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::WebProcess):
+        (WebKit::WebProcess::initializeConnection):
+        * WebProcess/WebProcess.h:
+
 2017-03-02  Brady Eidson  <beidson@apple.com>
 
         Update WKWebsiteDatastoreConfiguration SPI.
index 1ac6af2..330af6c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
+# Copyright (C) 2010-2017 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -140,6 +140,7 @@ MESSAGE_RECEIVERS = \
     WebIconDatabase \
     WebIconDatabaseProxy \
     WebInspector \
+    WebInspectorInterruptDispatcher \
     WebInspectorProxy \
     WebInspectorUI \
     WebNotificationManager \
index 38c8039..155d84e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2014, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
  * Portions Copyright (c) 2011 Motorola Mobility, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,6 +35,7 @@
 #include "WebAutomationSession.h"
 #include "WebFramePolicyListenerProxy.h"
 #include "WebFrameProxy.h"
+#include "WebInspectorInterruptDispatcherMessages.h"
 #include "WebInspectorMessages.h"
 #include "WebInspectorProxyMessages.h"
 #include "WebInspectorUIMessages.h"
@@ -121,6 +122,7 @@ void WebInspectorProxy::connect()
 
     eagerlyCreateInspectorPage();
 
+    m_inspectedPage->process().send(Messages::WebInspectorInterruptDispatcher::NotifyNeedDebuggerBreak(), 0);
     m_inspectedPage->process().send(Messages::WebInspector::Show(), m_inspectedPage->pageID());
 }
 
index 77285cb..d04f95e 100644 (file)
                F6A90813133C20510082C3F4 /* WebCookieManagerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6A90811133C1F3D0082C3F4 /* WebCookieManagerMac.mm */; };
                F6D632BC133D198200743D77 /* WebCookieManagerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6D632BA133D181B00743D77 /* WebCookieManagerProxyMac.mm */; };
                FED3C1DC1B447EAC00E0EB7F /* APISerializedScriptValueCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED3C1DA1B447AE800E0EB7F /* APISerializedScriptValueCocoa.mm */; };
+               FEDBDCD61E68D20000A59F8F /* WebInspectorInterruptDispatcherMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDBDCD41E68D19C00A59F8F /* WebInspectorInterruptDispatcherMessageReceiver.cpp */; };
+               FEDBDCD71E68D20500A59F8F /* WebInspectorInterruptDispatcherMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDBDCD51E68D19C00A59F8F /* WebInspectorInterruptDispatcherMessages.h */; };
+               FEE43FD31E67B0180077D6D1 /* WebInspectorInterruptDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE43FD11E67AFC60077D6D1 /* WebInspectorInterruptDispatcher.h */; };
+               FEE43FD41E67B0210077D6D1 /* WebInspectorInterruptDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEE43FD01E67AFC60077D6D1 /* WebInspectorInterruptDispatcher.cpp */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
                F6A90811133C1F3D0082C3F4 /* WebCookieManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCookieManagerMac.mm; sourceTree = "<group>"; };
                F6D632BA133D181B00743D77 /* WebCookieManagerProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCookieManagerProxyMac.mm; sourceTree = "<group>"; };
                FED3C1DA1B447AE800E0EB7F /* APISerializedScriptValueCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = APISerializedScriptValueCocoa.mm; sourceTree = "<group>"; };
+               FEDBDCD41E68D19C00A59F8F /* WebInspectorInterruptDispatcherMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorInterruptDispatcherMessageReceiver.cpp; sourceTree = "<group>"; };
+               FEDBDCD51E68D19C00A59F8F /* WebInspectorInterruptDispatcherMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorInterruptDispatcherMessages.h; sourceTree = "<group>"; };
+               FEE43FD01E67AFC60077D6D1 /* WebInspectorInterruptDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorInterruptDispatcher.cpp; sourceTree = "<group>"; };
+               FEE43FD11E67AFC60077D6D1 /* WebInspectorInterruptDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorInterruptDispatcher.h; sourceTree = "<group>"; };
+               FEE43FD21E67AFC60077D6D1 /* WebInspectorInterruptDispatcher.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebInspectorInterruptDispatcher.messages.in; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
                                1C8E2A1C1277833F00BC7BD0 /* WebInspector.messages.in */,
                                A55BA8321BA3E6FA007CD33D /* WebInspectorFrontendAPIDispatcher.cpp */,
                                A55BA8331BA3E6FA007CD33D /* WebInspectorFrontendAPIDispatcher.h */,
+                               FEE43FD01E67AFC60077D6D1 /* WebInspectorInterruptDispatcher.cpp */,
+                               FEE43FD11E67AFC60077D6D1 /* WebInspectorInterruptDispatcher.h */,
+                               FEE43FD21E67AFC60077D6D1 /* WebInspectorInterruptDispatcher.messages.in */,
                                1C891D6219B124FF00BA79DD /* WebInspectorUI.cpp */,
                                1C891D6319B124FF00BA79DD /* WebInspectorUI.h */,
                                1C891D6419B124FF00BA79DD /* WebInspectorUI.messages.in */,
                                510523781C73DA70007993CB /* WebIDBConnectionToClientMessages.h */,
                                510523721C73D37B007993CB /* WebIDBConnectionToServerMessageReceiver.cpp */,
                                510523731C73D37B007993CB /* WebIDBConnectionToServerMessages.h */,
+                               FEDBDCD41E68D19C00A59F8F /* WebInspectorInterruptDispatcherMessageReceiver.cpp */,
+                               FEDBDCD51E68D19C00A59F8F /* WebInspectorInterruptDispatcherMessages.h */,
                                1C8E2A311277852400BC7BD0 /* WebInspectorMessageReceiver.cpp */,
                                1C8E2A321277852400BC7BD0 /* WebInspectorMessages.h */,
                                1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */,
                                BC204EEF11C83EC8008F3375 /* WKBundle.h in Headers */,
                                BC204EF011C83EC8008F3375 /* WKBundleAPICast.h in Headers */,
                                935EEB9F127761AC003322B8 /* WKBundleBackForwardList.h in Headers */,
+                               FEDBDCD71E68D20500A59F8F /* WebInspectorInterruptDispatcherMessages.h in Headers */,
                                935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */,
                                51EFC1CF1524E62500C9A938 /* WKBundleDOMWindowExtension.h in Headers */,
                                7CBB81211AA0F970006B1942 /* WKBundleFileHandleRef.h in Headers */,
                                1A7E377518E4A33A003D0FFF /* WKScriptMessageHandler.h in Headers */,
                                7CC99A3618EF7CBC0048C8B4 /* WKScriptMessageInternal.h in Headers */,
                                0FCB4E5418BBE044000FCFC9 /* WKScrollView.h in Headers */,
+                               FEE43FD31E67B0180077D6D1 /* WebInspectorInterruptDispatcher.h in Headers */,
                                51CD1C651B34B9D400142CA5 /* WKSecurityOrigin.h in Headers */,
                                51CD1C671B34B9DF00142CA5 /* WKSecurityOriginInternal.h in Headers */,
                                51CD1C5E1B3493B400142CA5 /* WKSecurityOriginRef.h in Headers */,
                                1A2D82A6127F4EAB001EB962 /* NPObjectProxy.cpp in Sources */,
                                1A2D82A8127F4EAB001EB962 /* NPRemoteObjectMap.cpp in Sources */,
                                1A2161B111F37664008AD0F5 /* NPRuntimeObjectMap.cpp in Sources */,
+                               FEE43FD41E67B0210077D6D1 /* WebInspectorInterruptDispatcher.cpp in Sources */,
                                1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */,
                                1A2D84A4127F6AD1001EB962 /* NPVariantData.cpp in Sources */,
                                BC8ACA1416670D89004C1941 /* ObjCObjectGraph.mm in Sources */,
                                5110AE0C133C16CB0072717A /* WKIconDatabase.cpp in Sources */,
                                5123CF1B133D260A0056F800 /* WKIconDatabaseCG.cpp in Sources */,
                                BCCF6AC212C91F34008F9C35 /* WKImage.cpp in Sources */,
+                               FEDBDCD61E68D20000A59F8F /* WebInspectorInterruptDispatcherMessageReceiver.cpp in Sources */,
                                BCCF6AC912C91F59008F9C35 /* WKImageCG.cpp in Sources */,
                                933DF8301B3BC0B400AEA9E3 /* WKImagePreviewViewController.mm in Sources */,
                                9321D5881A38EE74008052BE /* WKImmediateActionController.mm in Sources */,
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp b/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp
new file mode 100644 (file)
index 0000000..cca68df
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebInspectorInterruptDispatcher.h"
+
+#include "WebInspectorInterruptDispatcherMessages.h"
+#include <JavaScriptCore/VM.h>
+#include <WebCore/CommonVM.h>
+#include <wtf/WorkQueue.h>
+
+namespace WebKit {
+    
+Ref<WebInspectorInterruptDispatcher> WebInspectorInterruptDispatcher::create()
+{
+    return adoptRef(*new WebInspectorInterruptDispatcher);
+}
+
+WebInspectorInterruptDispatcher::WebInspectorInterruptDispatcher()
+    : m_queue(WorkQueue::create("com.apple.WebKit.WebInspectorInterruptDispatcher"))
+{
+}
+
+WebInspectorInterruptDispatcher::~WebInspectorInterruptDispatcher()
+{
+}
+
+void WebInspectorInterruptDispatcher::initializeConnection(IPC::Connection* connection)
+{
+    connection->addWorkQueueMessageReceiver(Messages::WebInspectorInterruptDispatcher::messageReceiverName(), m_queue.get(), this);
+}
+
+void WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak()
+{
+    JSC::VM& vm = WebCore::commonVM();
+    vm.notifyNeedDebuggerBreak();
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.h b/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.h
new file mode 100644 (file)
index 0000000..d8f6bd0
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "Connection.h"
+
+namespace WebKit {
+
+class WebInspectorInterruptDispatcher : public IPC::Connection::WorkQueueMessageReceiver {
+public:
+    static Ref<WebInspectorInterruptDispatcher> create();
+    ~WebInspectorInterruptDispatcher();
+    
+    void initializeConnection(IPC::Connection*);
+    
+private:
+    WebInspectorInterruptDispatcher();
+    // IPC::Connection::WorkQueueMessageReceiver.
+    void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
+    
+    void notifyNeedDebuggerBreak();
+    
+    Ref<WorkQueue> m_queue;
+};
+
+} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in b/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in
new file mode 100644 (file)
index 0000000..9870e52
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (C) 2017 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+messages -> WebInspectorInterruptDispatcher {
+    NotifyNeedDebuggerBreak()
+}
index cd5e9f4..baa78e7 100644 (file)
@@ -157,6 +157,7 @@ WebProcess::WebProcess()
 #if PLATFORM(IOS)
     , m_viewUpdateDispatcher(ViewUpdateDispatcher::create())
 #endif
+    , m_webInspectorInterruptDispatcher(WebInspectorInterruptDispatcher::create())
     , m_iconDatabaseProxy(*new WebIconDatabaseProxy(*this))
     , m_webLoaderStrategy(*new WebLoaderStrategy)
     , m_dnsPrefetchHystereris([this](HysteresisState state) { if (state == HysteresisState::Stopped) m_dnsPrefetchedHosts.clear(); })
@@ -221,6 +222,7 @@ void WebProcess::initializeConnection(IPC::Connection* connection)
 #if PLATFORM(IOS)
     m_viewUpdateDispatcher->initializeConnection(connection);
 #endif // PLATFORM(IOS)
+    m_webInspectorInterruptDispatcher->initializeConnection(connection);
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     m_pluginProcessConnectionManager->initializeConnection(connection);
index b0ce003..ef4ed30 100644 (file)
@@ -36,6 +36,7 @@
 #include "TextCheckerState.h"
 #include "ViewUpdateDispatcher.h"
 #include "VisitedLinkTable.h"
+#include "WebInspectorInterruptDispatcher.h"
 #include <WebCore/HysteresisActivity.h>
 #include <WebCore/ResourceLoadStatisticsStore.h>
 #include <WebCore/SessionID.h>
@@ -351,6 +352,7 @@ private:
 #if PLATFORM(IOS)
     RefPtr<ViewUpdateDispatcher> m_viewUpdateDispatcher;
 #endif
+    RefPtr<WebInspectorInterruptDispatcher> m_webInspectorInterruptDispatcher;
 
     HashMap<WebCore::SessionID, HashMap<unsigned, double>> m_plugInAutoStartOriginHashes;
     HashSet<String> m_plugInAutoStartOrigins;