Changeset 196454 in webkit


Ignore:
Timestamp:
Feb 11, 2016 4:02:29 PM (8 years ago)
Author:
BJ Burg
Message:

Web Inspector: RemoteInspector's listings should include whether an AutomationTarget is paired
https://bugs.webkit.org/show_bug.cgi?id=154077
<rdar://problem/24589133>

Reviewed by Joseph Pecoraro.

Instead of not generating a listing for the target when it is occupied,
generate the listing with a 'paired' flag. The old flag was redundant
because a _WKAutomationDelegate will not create a session if it doesn't
support automation or it already has an active session.

  • inspector/remote/RemoteAutomationTarget.cpp:

(Inspector::RemoteAutomationTarget::setIsPaired):
(Inspector::RemoteAutomationTarget::setAutomationAllowed): Deleted.

  • inspector/remote/RemoteAutomationTarget.h:

Return false for remoteControlAllowed() if the target is already paired.
This function is used by RemoteInspector to deny incoming connections.

  • inspector/remote/RemoteInspector.mm:

(Inspector::RemoteInspector::listingForAutomationTarget):

  • inspector/remote/RemoteInspectorConstants.h:
Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r196446 r196454  
     12016-02-11  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: RemoteInspector's listings should include whether an AutomationTarget is paired
     4        https://bugs.webkit.org/show_bug.cgi?id=154077
     5        <rdar://problem/24589133>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Instead of not generating a listing for the target when it is occupied,
     10        generate the listing with a 'paired' flag. The old flag was redundant
     11        because a _WKAutomationDelegate will not create a session if it doesn't
     12        support automation or it already has an active session.
     13
     14        * inspector/remote/RemoteAutomationTarget.cpp:
     15        (Inspector::RemoteAutomationTarget::setIsPaired):
     16        (Inspector::RemoteAutomationTarget::setAutomationAllowed): Deleted.
     17        * inspector/remote/RemoteAutomationTarget.h:
     18        Return false for remoteControlAllowed() if the target is already paired.
     19        This function is used by RemoteInspector to deny incoming connections.
     20
     21        * inspector/remote/RemoteInspector.mm:
     22        (Inspector::RemoteInspector::listingForAutomationTarget):
     23        * inspector/remote/RemoteInspectorConstants.h:
     24
    1252016-02-11  Filip Pizlo  <fpizlo@apple.com>
    226
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteAutomationTarget.cpp

    r192753 r196454  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333namespace Inspector {
    3434
    35 void RemoteAutomationTarget::setAutomationAllowed(bool allowed)
     35void RemoteAutomationTarget::setIsPaired(bool paired)
    3636{
    37     if (m_allowed == allowed)
     37    if (m_paired == paired)
    3838        return;
    3939
    40     m_allowed = allowed;
     40    m_paired = paired;
    4141
    4242    update();
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteAutomationTarget.h

    r192753 r196454  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4040    virtual ~RemoteAutomationTarget() { }
    4141
    42     bool automationAllowed() const { return m_allowed; }
    43     void setAutomationAllowed(bool);
     42    bool isPaired() const { return m_paired; }
     43    void setIsPaired(bool);
    4444
    4545    virtual String name() const = 0;
    4646    virtual RemoteControllableTarget::Type type() const override { return RemoteControllableTarget::Type::Automation; }
    47     virtual bool remoteControlAllowed() const override { return automationAllowed(); };
     47    virtual bool remoteControlAllowed() const override { return !m_paired; };
    4848
    4949private:
    50     bool m_allowed { false };
     50    bool m_paired { false };
    5151};
    5252
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm

    r194646 r196454  
    526526    ASSERT(isMainThread());
    527527
    528     if (!target.automationAllowed())
    529         return nil;
    530 
    531528    RetainPtr<NSMutableDictionary> listing = adoptNS([[NSMutableDictionary alloc] init]);
    532529    [listing setObject:@(target.identifier()) forKey:WIRPageIdentifierKey];
    533530    [listing setObject:target.name() forKey:WIRTitleKey];
    534531    [listing setObject:WIRTypeAutomation forKey:WIRTypeKey];
     532    [listing setObject:@(target.isPaired()) forKey:WIRAutomationTargetIsPairedKey];
    535533
    536534    if (auto connection = m_connectionMap.get(target.identifier()))
  • trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h

    r194646 r196454  
    8383#define WIRAutomaticInspectionCandidateMessage     @"WIRAutomaticInspectionCandidateMessage"
    8484
     85#define WIRAutomationTargetIsPairedKey             @"WIRAutomationTargetIsPairedKey"
     86
    8587// These definitions are shared with a Simulator webinspectord and
    8688// OS X process communicating with it.
Note: See TracChangeset for help on using the changeset viewer.