Title: [213338] trunk/Source
Revision
213338
Author
mark....@apple.com
Date
2017-03-02 18:42:52 -0800 (Thu, 02 Mar 2017)

Log Message

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.

Source/_javascript_Core:

* 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:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (213337 => 213338)


--- trunk/Source/_javascript_Core/ChangeLog	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-03-03 02:42:52 UTC (rev 213338)
@@ -1,3 +1,15 @@
+2017-03-02  Mark Lam  <mark....@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  <msab...@apple.com>
 
         Add JSC identity when code signing to allow debugging on iOS

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (213337 => 213338)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2017-03-03 02:42:52 UTC (rev 213338)
@@ -957,7 +957,9 @@
         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);

Modified: trunk/Source/_javascript_Core/runtime/VM.h (213337 => 213338)


--- trunk/Source/_javascript_Core/runtime/VM.h	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2017-03-03 02:42:52 UTC (rev 213338)
@@ -676,6 +676,7 @@
     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); }
 

Modified: trunk/Source/WebKit2/CMakeLists.txt (213337 => 213338)


--- trunk/Source/WebKit2/CMakeLists.txt	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/WebKit2/CMakeLists.txt	2017-03-03 02:42:52 UTC (rev 213338)
@@ -572,6 +572,7 @@
     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 @@
     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
 )

Modified: trunk/Source/WebKit2/ChangeLog (213337 => 213338)


--- trunk/Source/WebKit2/ChangeLog	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-03 02:42:52 UTC (rev 213338)
@@ -1,3 +1,28 @@
+2017-03-02  Mark Lam  <mark....@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  <beid...@apple.com>
 
         Update WKWebsiteDatastoreConfiguration SPI.

Modified: trunk/Source/WebKit2/DerivedSources.make (213337 => 213338)


--- trunk/Source/WebKit2/DerivedSources.make	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/WebKit2/DerivedSources.make	2017-03-03 02:42:52 UTC (rev 213338)
@@ -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 @@
     WebIconDatabase \
     WebIconDatabaseProxy \
     WebInspector \
+    WebInspectorInterruptDispatcher \
     WebInspectorProxy \
     WebInspectorUI \
     WebNotificationManager \

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (213337 => 213338)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2017-03-03 02:42:52 UTC (rev 213338)
@@ -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 @@
 
     eagerlyCreateInspectorPage();
 
+    m_inspectedPage->process().send(Messages::WebInspectorInterruptDispatcher::NotifyNeedDebuggerBreak(), 0);
     m_inspectedPage->process().send(Messages::WebInspector::Show(), m_inspectedPage->pageID());
 }
 

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (213337 => 213338)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2017-03-03 02:42:52 UTC (rev 213338)
@@ -1970,6 +1970,10 @@
 		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 */
@@ -4237,6 +4241,11 @@
 		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 */
@@ -6446,6 +6455,9 @@
 				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 */,
@@ -7616,6 +7628,8 @@
 				510523781C73DA70007993CB /* WebIDBConnectionToClientMessages.h */,
 				510523721C73D37B007993CB /* WebIDBConnectionToServerMessageReceiver.cpp */,
 				510523731C73D37B007993CB /* WebIDBConnectionToServerMessages.h */,
+				FEDBDCD41E68D19C00A59F8F /* WebInspectorInterruptDispatcherMessageReceiver.cpp */,
+				FEDBDCD51E68D19C00A59F8F /* WebInspectorInterruptDispatcherMessages.h */,
 				1C8E2A311277852400BC7BD0 /* WebInspectorMessageReceiver.cpp */,
 				1C8E2A321277852400BC7BD0 /* WebInspectorMessages.h */,
 				1CA8B943127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp */,
@@ -8562,6 +8576,7 @@
 				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 */,
@@ -8776,6 +8791,7 @@
 				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 */,
@@ -9730,6 +9746,7 @@
 				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 */,
@@ -10213,6 +10230,7 @@
 				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 */,

Added: trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp (0 => 213338)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp	2017-03-03 02:42:52 UTC (rev 213338)
@@ -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 <_javascript_Core/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

Added: trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.h (0 => 213338)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.h	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.h	2017-03-03 02:42:52 UTC (rev 213338)
@@ -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

Added: trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in (0 => 213338)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in	2017-03-03 02:42:52 UTC (rev 213338)
@@ -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()
+}

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (213337 => 213338)


--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2017-03-03 02:42:52 UTC (rev 213338)
@@ -157,6 +157,7 @@
 #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 @@
 #if PLATFORM(IOS)
     m_viewUpdateDispatcher->initializeConnection(connection);
 #endif // PLATFORM(IOS)
+    m_webInspectorInterruptDispatcher->initializeConnection(connection);
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     m_pluginProcessConnectionManager->initializeConnection(connection);

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (213337 => 213338)


--- trunk/Source/WebKit2/WebProcess/WebProcess.h	2017-03-03 02:05:32 UTC (rev 213337)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h	2017-03-03 02:42:52 UTC (rev 213338)
@@ -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 @@
 #if PLATFORM(IOS)
     RefPtr<ViewUpdateDispatcher> m_viewUpdateDispatcher;
 #endif
+    RefPtr<WebInspectorInterruptDispatcher> m_webInspectorInterruptDispatcher;
 
     HashMap<WebCore::SessionID, HashMap<unsigned, double>> m_plugInAutoStartOriginHashes;
     HashSet<String> m_plugInAutoStartOrigins;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to