Changeset 196667 in webkit


Ignore:
Timestamp:
Feb 16, 2016 3:45:27 PM (8 years ago)
Author:
BJ Burg
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.
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r196658 r196667  
     12016-02-16  Brian Burg  <bburg@apple.com>
     2
     3        RemoteInspector should forward new automation session requests to its client
     4        https://bugs.webkit.org/show_bug.cgi?id=154260
     5        <rdar://problem/24663313>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * inspector/remote/RemoteInspector.h:
     10        * inspector/remote/RemoteInspector.mm:
     11        (Inspector::RemoteInspector::xpcConnectionReceivedMessage):
     12        (Inspector::RemoteInspector::listingForAutomationTarget):
     13        Use the correct key for the session identifier in the listing. The name()
     14        override for RemoteAutomationTarget is actually the session identifier.
     15
     16        (Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):
     17        * inspector/remote/RemoteInspectorConstants.h: Add new constants.
     18
    1192016-02-16  Saam barati  <sbarati@apple.com>
    220
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.h

    r196562 r196667  
    118118    void receivedAutomaticInspectionConfigurationMessage(NSDictionary *userInfo);
    119119    void receivedAutomaticInspectionRejectMessage(NSDictionary *userInfo);
     120    void receivedAutomationSessionRequestMessage(NSDictionary *userInfo);
    120121
    121122    static bool startEnabled;
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm

    r196515 r196667  
    441441    else if ([messageName isEqualToString:WIRAutomaticInspectionRejectMessage])
    442442        receivedAutomaticInspectionRejectMessage(userInfo);
     443    else if ([messageName isEqualToString:WIRAutomationSessionRequestMessage])
     444        receivedAutomationSessionRequestMessage(userInfo);
    443445    else
    444446        NSLog(@"Unrecognized RemoteInspector XPC Message: %@", messageName);
     
    528530    RetainPtr<NSMutableDictionary> listing = adoptNS([[NSMutableDictionary alloc] init]);
    529531    [listing setObject:@(target.targetIdentifier()) forKey:WIRTargetIdentifierKey];
    530     [listing setObject:target.name() forKey:WIRTitleKey];
     532    [listing setObject:target.name() forKey:WIRSessionIdentifierKey];
    531533    [listing setObject:WIRTypeAutomation forKey:WIRTypeKey];
    532534    [listing setObject:@(target.isPaired()) forKey:WIRAutomationTargetIsPairedKey];
     
    777779}
    778780
     781void RemoteInspector::receivedAutomationSessionRequestMessage(NSDictionary *userInfo)
     782{
     783    if (!m_client)
     784        return;
     785
     786    if (!m_client->remoteAutomationAllowed())
     787        return;
     788
     789    NSString *suggestedSessionIdentifier = [userInfo objectForKey:WIRSessionIdentifierKey];
     790    if (!suggestedSessionIdentifier)
     791        return;
     792
     793    m_client->requestAutomationSession(suggestedSessionIdentifier);
     794}
     795
    779796} // namespace Inspector
    780797
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h

    r196515 r196667  
    8585
    8686#define WIRAutomationTargetIsPairedKey             @"WIRAutomationTargetIsPairedKey"
     87#define WIRSessionIdentifierKey                    @"WIRSessionIdentifierKey"
     88#define WIRAutomationSessionRequestMessage         @"WIRAutomationSessionRequestMessage"
    8789
    8890// These definitions are shared with a Simulator webinspectord and
Note: See TracChangeset for help on using the changeset viewer.