Title: [196667] trunk/Source/_javascript_Core
Revision
196667
Author
[email protected]
Date
2016-02-16 15:45:27 -0800 (Tue, 16 Feb 2016)

Log Message

RemoteInspector should forward new automation session requests to its client
https://bugs.webkit.org/show_bug.cgi?id=154260
<rdar://problem/24663313>

Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::listingForAutomationTarget):
Use the correct key for the session identifier in the listing. The name()
override for RemoteAutomationTarget is actually the session identifier.

(Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):
* inspector/remote/RemoteInspectorConstants.h: Add new constants.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (196666 => 196667)


--- trunk/Source/_javascript_Core/ChangeLog	2016-02-16 23:24:14 UTC (rev 196666)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-02-16 23:45:27 UTC (rev 196667)
@@ -1,3 +1,21 @@
+2016-02-16  Brian Burg  <[email protected]>
+
+        RemoteInspector should forward new automation session requests to its client
+        https://bugs.webkit.org/show_bug.cgi?id=154260
+        <rdar://problem/24663313>
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/remote/RemoteInspector.h:
+        * inspector/remote/RemoteInspector.mm:
+        (Inspector::RemoteInspector::xpcConnectionReceivedMessage):
+        (Inspector::RemoteInspector::listingForAutomationTarget):
+        Use the correct key for the session identifier in the listing. The name()
+        override for RemoteAutomationTarget is actually the session identifier.
+
+        (Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):
+        * inspector/remote/RemoteInspectorConstants.h: Add new constants.
+
 2016-02-16  Saam barati  <[email protected]>
 
         SamplingProfiler still fails with ASan enabled

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h (196666 => 196667)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h	2016-02-16 23:24:14 UTC (rev 196666)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.h	2016-02-16 23:45:27 UTC (rev 196667)
@@ -117,6 +117,7 @@
     void receivedConnectionDiedMessage(NSDictionary *userInfo);
     void receivedAutomaticInspectionConfigurationMessage(NSDictionary *userInfo);
     void receivedAutomaticInspectionRejectMessage(NSDictionary *userInfo);
+    void receivedAutomationSessionRequestMessage(NSDictionary *userInfo);
 
     static bool startEnabled;
 

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm (196666 => 196667)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2016-02-16 23:24:14 UTC (rev 196666)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2016-02-16 23:45:27 UTC (rev 196667)
@@ -440,6 +440,8 @@
         receivedAutomaticInspectionConfigurationMessage(userInfo);
     else if ([messageName isEqualToString:WIRAutomaticInspectionRejectMessage])
         receivedAutomaticInspectionRejectMessage(userInfo);
+    else if ([messageName isEqualToString:WIRAutomationSessionRequestMessage])
+        receivedAutomationSessionRequestMessage(userInfo);
     else
         NSLog(@"Unrecognized RemoteInspector XPC Message: %@", messageName);
 }
@@ -527,7 +529,7 @@
 
     RetainPtr<NSMutableDictionary> listing = adoptNS([[NSMutableDictionary alloc] init]);
     [listing setObject:@(target.targetIdentifier()) forKey:WIRTargetIdentifierKey];
-    [listing setObject:target.name() forKey:WIRTitleKey];
+    [listing setObject:target.name() forKey:WIRSessionIdentifierKey];
     [listing setObject:WIRTypeAutomation forKey:WIRTypeKey];
     [listing setObject:@(target.isPaired()) forKey:WIRAutomationTargetIsPairedKey];
 
@@ -776,6 +778,21 @@
         m_automaticInspectionPaused = false;
 }
 
+void RemoteInspector::receivedAutomationSessionRequestMessage(NSDictionary *userInfo)
+{
+    if (!m_client)
+        return;
+
+    if (!m_client->remoteAutomationAllowed())
+        return;
+
+    NSString *suggestedSessionIdentifier = [userInfo objectForKey:WIRSessionIdentifierKey];
+    if (!suggestedSessionIdentifier)
+        return;
+
+    m_client->requestAutomationSession(suggestedSessionIdentifier);
+}
+
 } // namespace Inspector
 
 #endif // ENABLE(REMOTE_INSPECTOR)

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h (196666 => 196667)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h	2016-02-16 23:24:14 UTC (rev 196666)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspectorConstants.h	2016-02-16 23:45:27 UTC (rev 196667)
@@ -84,6 +84,8 @@
 #define WIRAutomaticInspectionCandidateMessage     @"WIRAutomaticInspectionCandidateMessage"
 
 #define WIRAutomationTargetIsPairedKey             @"WIRAutomationTargetIsPairedKey"
+#define WIRSessionIdentifierKey                    @"WIRSessionIdentifierKey"
+#define WIRAutomationSessionRequestMessage         @"WIRAutomationSessionRequestMessage"
 
 // These definitions are shared with a Simulator webinspectord and
 // OS X process communicating with it.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to