⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 240685 in webkit


Ignore:
Timestamp:
Jan 29, 2019, 2:40:44 PM (8 years ago)
Author:
Devin Rousso
Message:

Web Inspector: expose a way of determining if a detached frontend is for a remote target
https://bugs.webkit.org/show_bug.cgi?id=193951
<rdar://problem/47621366>

Reviewed by Joseph Pecoraro.

  • UIProcess/WebInspectorProxy.h:

(WebKit::WebInspectorProxy::InspectionTargetType): Added.
(WebKit::WebInspectorProxy::createFrontendWindow):

  • UIProcess/mac/WebInspectorProxyMac.mm:

(WebKit::WebInspectorProxy::createFrontendWindow):
(WebKit::WebInspectorProxy::platformCreateFrontendWindow):

  • UIProcess/mac/RemoteWebInspectorProxyMac.mm:

(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):

  • UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
  • UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.

(-[WKInspectorWindow isRemote]): Added.

  • Shared/API/Cocoa/_WKNSWindowExtras.mm:

(-[NSWindow _web_isWebInspectorWindow]):

  • PlatformMac.cmake:
  • SourcesCocoa.txt:
  • UnifiedSources-input.xcfilelist:
  • WebKit.xcodeproj/project.pbxproj:
Location:
trunk/Source/WebKit
Files:
9 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r240683 r240685  
     12019-01-29  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: expose a way of determining if a detached frontend is for a remote target
     4        https://bugs.webkit.org/show_bug.cgi?id=193951
     5        <rdar://problem/47621366>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * UIProcess/WebInspectorProxy.h:
     10        (WebKit::WebInspectorProxy::InspectionTargetType): Added.
     11        (WebKit::WebInspectorProxy::createFrontendWindow):
     12        * UIProcess/mac/WebInspectorProxyMac.mm:
     13        (WebKit::WebInspectorProxy::createFrontendWindow):
     14        (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
     15        * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
     16        (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
     17
     18        * UIProcess/API/Cocoa/_WKInspectorWindow.h: Moved from UIProcess/mac/WKInspectorWindow.h.
     19        * UIProcess/API/Cocoa/_WKInspectorWindow.mm: Moved from UIProcess/mac/WKInspectorWindow.mm.
     20        (-[WKInspectorWindow isRemote]): Added.
     21
     22        * Shared/API/Cocoa/_WKNSWindowExtras.mm:
     23        (-[NSWindow _web_isWebInspectorWindow]):
     24
     25        * PlatformMac.cmake:
     26        * SourcesCocoa.txt:
     27        * UnifiedSources-input.xcfilelist:
     28        * WebKit.xcodeproj/project.pbxproj:
     29
    1302019-01-29  Alex Christensen  <achristensen@webkit.org>
    231
  • trunk/Source/WebKit/PlatformMac.cmake

    r240683 r240685  
    297297    UIProcess/mac/WKInspectorViewController.mm
    298298    UIProcess/mac/WKInspectorWKWebView.mm
    299     UIProcess/mac/WKInspectorWindow.mm
    300299    UIProcess/mac/WKPrintingView.mm
    301300    UIProcess/mac/WKSharingServicePickerDelegate.mm
  • trunk/Source/WebKit/Shared/API/Cocoa/_WKNSWindowExtras.mm

    r226536 r240685  
    3131#if !TARGET_OS_IPHONE
    3232
    33 #import "WKInspectorWindow.h"
     33#import "_WKInspectorWindow.h"
    3434
    3535@implementation NSWindow (WKExtras)
     
    3737- (BOOL)_web_isWebInspectorWindow
    3838{
    39     return [self isKindOfClass:[WKInspectorWindow class]];
     39    return [self isKindOfClass:[_WKInspectorWindow class]];
    4040}
    4141
  • trunk/Source/WebKit/SourcesCocoa.txt

    r240683 r240685  
    238238UIProcess/API/Cocoa/_WKGeolocationPosition.mm
    239239UIProcess/API/Cocoa/_WKInspector.mm
     240UIProcess/API/Cocoa/_WKInspectorWindow.mm
    240241UIProcess/API/Cocoa/_WKInternalDebugFeature.mm
    241242UIProcess/API/Cocoa/_WKLinkIconParameters.mm
     
    439440UIProcess/mac/WKImmediateActionController.mm
    440441UIProcess/mac/WKInspectorViewController.mm
    441 UIProcess/mac/WKInspectorWindow.mm
    442442UIProcess/mac/WKInspectorWKWebView.mm
    443443UIProcess/mac/WKPrintingView.mm
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspectorWindow.h

    r240684 r240685  
    2626#import <WebKit/WKFoundation.h>
    2727
    28 #if PLATFORM(MAC) && WK_API_ENABLED
     28#if WK_API_ENABLED && !TARGET_OS_IPHONE
    2929
    30 @interface WKInspectorWindow : NSWindow
     30WK_CLASS_AVAILABLE(macosx(WK_MAC_TBA))
     31@interface _WKInspectorWindow : NSWindow
     32
     33@property (nonatomic, getter=isForRemoteTarget) BOOL forRemoteTarget;
     34
    3135@end
    3236
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspectorWindow.mm

    r240684 r240685  
    2525
    2626#import "config.h"
    27 #import "WKInspectorWindow.h"
     27#import "_WKInspectorWindow.h"
    2828
    2929#if PLATFORM(MAC) && WK_API_ENABLED
    3030
    31 @implementation WKInspectorWindow
     31@implementation _WKInspectorWindow
     32
     33- (BOOL)isForRemoteTarget
     34{
     35    return _forRemoteTarget;
     36}
     37
    3238@end
    3339
  • trunk/Source/WebKit/UIProcess/WebInspectorProxy.h

    r238771 r240685  
    106106
    107107#if PLATFORM(MAC) && WK_API_ENABLED
    108     static RetainPtr<NSWindow> createFrontendWindow(NSRect savedWindowFrame);
     108    enum class InspectionTargetType { Local, Remote };
     109    static RetainPtr<NSWindow> createFrontendWindow(NSRect savedWindowFrame, InspectionTargetType);
    109110
    110111    void updateInspectorWindowTitle() const;
  • trunk/Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm

    r239697 r240685  
    8989    [m_inspectorView.get() setDelegate:m_objCAdapter.get()];
    9090
    91     m_window = WebInspectorProxy::createFrontendWindow(NSZeroRect);
     91    m_window = WebInspectorProxy::createFrontendWindow(NSZeroRect, WebInspectorProxy::InspectionTargetType::Remote);
    9292    [m_window setFrameAutosaveName:@"WKRemoteWebInspectorWindowFrame"];
    9393
  • trunk/Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm

    r239647 r240685  
    3131#import "WKInspectorPrivateMac.h"
    3232#import "WKInspectorViewController.h"
    33 #import "WKInspectorWindow.h"
    3433#import "WKViewInternal.h"
    3534#import "WKWebViewInternal.h"
     
    3837#import "WebPageProxy.h"
    3938#import "_WKInspectorInternal.h"
     39#import "_WKInspectorWindow.h"
    4040#import <SecurityInterface/SFCertificatePanel.h>
    4141#import <SecurityInterface/SFCertificateView.h>
     
    229229}
    230230
    231 RetainPtr<NSWindow> WebInspectorProxy::createFrontendWindow(NSRect savedWindowFrame)
     231RetainPtr<NSWindow> WebInspectorProxy::createFrontendWindow(NSRect savedWindowFrame, InspectionTargetType targetType)
    232232{
    233233    NSRect windowFrame = !NSIsEmptyRect(savedWindowFrame) ? savedWindowFrame : NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight);
    234     auto window = adoptNS([[WKInspectorWindow alloc] initWithContentRect:windowFrame styleMask:windowStyleMask backing:NSBackingStoreBuffered defer:NO]);
     234    auto window = adoptNS([[_WKInspectorWindow alloc] initWithContentRect:windowFrame styleMask:windowStyleMask backing:NSBackingStoreBuffered defer:NO]);
    235235    [window setMinSize:NSMakeSize(minimumWindowWidth, minimumWindowHeight)];
    236236    [window setReleasedWhenClosed:NO];
    237237    [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary)];
     238
     239    bool forRemoteTarget = targetType == InspectionTargetType::Remote;
     240    [window setForRemoteTarget:forRemoteTarget];
    238241
    239242    CGFloat approximatelyHalfScreenSize = ([window screen].frame.size.width / 2) - 4;
     
    283286    NSRect savedWindowFrame = NSRectFromString(savedWindowFrameString);
    284287
    285     m_inspectorWindow = WebInspectorProxy::createFrontendWindow(savedWindowFrame);
     288    m_inspectorWindow = WebInspectorProxy::createFrontendWindow(savedWindowFrame, InspectionTargetType::Local);
    286289    [m_inspectorWindow setDelegate:m_objCAdapter.get()];
    287290
  • trunk/Source/WebKit/UnifiedSources-input.xcfilelist

    r240683 r240685  
    447447$(SRCROOT)/UIProcess/API/Cocoa/_WKGeolocationPosition.mm
    448448$(SRCROOT)/UIProcess/API/Cocoa/_WKInspector.mm
     449$(SRCROOT)/UIProcess/API/Cocoa/_WKInspectorWindow.mm
    449450$(SRCROOT)/UIProcess/API/Cocoa/_WKInternalDebugFeature.mm
    450451$(SRCROOT)/UIProcess/API/Cocoa/_WKLinkIconParameters.mm
     
    719720$(SRCROOT)/UIProcess/mac/WKInspectorViewController.mm
    720721$(SRCROOT)/UIProcess/mac/WKInspectorWKWebView.mm
    721 $(SRCROOT)/UIProcess/mac/WKInspectorWindow.mm
    722722$(SRCROOT)/UIProcess/mac/WKPrintingView.mm
    723723$(SRCROOT)/UIProcess/mac/WKSharingServicePickerDelegate.mm
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r240683 r240685  
    13081308                A58B6F0818FCA733008CBA53 /* WKFileUploadPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = A58B6F0618FCA733008CBA53 /* WKFileUploadPanel.h */; };
    13091309                A5C0F0A72000654D00536536 /* _WKNSWindowExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C0F0A62000654400536536 /* _WKNSWindowExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1310                 A5C0F0AB2000658200536536 /* WKInspectorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C0F0AA2000656E00536536 /* WKInspectorWindow.h */; };
     1310                A5C0F0AB2000658200536536 /* _WKInspectorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C0F0AA2000656E00536536 /* _WKInspectorWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
    13111311                A5E391FD2183C1F800C8FB31 /* InspectorTargetProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E391FC2183C1E900C8FB31 /* InspectorTargetProxy.h */; };
    13121312                A5EC6AD42151BD7B00677D17 /* WebPageDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EC6AD32151BD6900677D17 /* WebPageDebuggable.h */; };
     
    38953895                A5C0F0A52000654400536536 /* _WKNSWindowExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKNSWindowExtras.mm; sourceTree = "<group>"; };
    38963896                A5C0F0A62000654400536536 /* _WKNSWindowExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKNSWindowExtras.h; sourceTree = "<group>"; };
    3897                 A5C0F0A92000656E00536536 /* WKInspectorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKInspectorWindow.mm; sourceTree = "<group>"; };
    3898                 A5C0F0AA2000656E00536536 /* WKInspectorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKInspectorWindow.h; sourceTree = "<group>"; };
     3897                A5C0F0A92000656E00536536 /* _WKInspectorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKInspectorWindow.mm; sourceTree = "<group>"; };
     3898                A5C0F0AA2000656E00536536 /* _WKInspectorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKInspectorWindow.h; sourceTree = "<group>"; };
    38993899                A5D3504D1D78F0D2005124A9 /* RemoteWebInspectorProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteWebInspectorProxyMac.mm; sourceTree = "<group>"; };
    39003900                A5E391FB2183C1E900C8FB31 /* InspectorTargetProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTargetProxy.cpp; sourceTree = "<group>"; };
     
    60506050                                5CAFDE432130843600B1F7E1 /* _WKInspector.mm */,
    60516051                                5CAFDE442130843600B1F7E1 /* _WKInspectorInternal.h */,
     6052                                A5C0F0AA2000656E00536536 /* _WKInspectorWindow.h */,
     6053                                A5C0F0A92000656E00536536 /* _WKInspectorWindow.mm */,
    60526054                                31B362942141EBAD007BFA53 /* _WKInternalDebugFeature.h */,
    60536055                                31B362922141EBAC007BFA53 /* _WKInternalDebugFeature.mm */,
     
    82238225                                994BADF11F7D77EA00B571E7 /* WKInspectorViewController.h */,
    82248226                                994BADF21F7D77EB00B571E7 /* WKInspectorViewController.mm */,
    8225                                 A5C0F0AA2000656E00536536 /* WKInspectorWindow.h */,
    8226                                 A5C0F0A92000656E00536536 /* WKInspectorWindow.mm */,
    82278227                                A518B5D01FE1D55B00F9FA28 /* WKInspectorWKWebView.h */,
    82288228                                A518B5D11FE1D55B00F9FA28 /* WKInspectorWKWebView.mm */,
     
    88648864                                5CAFDE452130846300B1F7E1 /* _WKInspector.h in Headers */,
    88658865                                5CAFDE472130846A00B1F7E1 /* _WKInspectorInternal.h in Headers */,
     8866                                A5C0F0AB2000658200536536 /* _WKInspectorWindow.h in Headers */,
    88668867                                31B362952141EBCD007BFA53 /* _WKInternalDebugFeature.h in Headers */,
    88678868                                31B362972141EBD9007BFA53 /* _WKInternalDebugFeatureInternal.h in Headers */,
Note: See TracChangeset for help on using the changeset viewer.