Changeset 273215 in webkit
- Timestamp:
- Feb 20, 2021 8:24:31 PM (3 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r273214 r273215 1 2021-02-20 BJ Burg <bburg@apple.com> 2 3 [Cocoa] Web Inspector: expose the WKBrowsingContextHandle associated with Web Inspector's page 4 https://bugs.webkit.org/show_bug.cgi?id=222226 5 6 Reviewed by Timothy Hatcher. 7 8 In order to implement browser.devtools.inspectedWindow.tabId for Web Extensions, 9 we need a way to do a reverse lookup of the tabId using the current browsing context 10 controller (WKWebProcessPlugInBrowserContextController) in the injected bundle. 11 12 This patch exposes the browsing context handle for the underlying WKWebView that 13 hosts the inspector page. Clients can use this to precompute a tabId for each 14 inspector browsing context that may be encountered by injected bundle code. 15 16 * UIProcess/API/Cocoa/_WKInspectorPrivate.h: 17 * UIProcess/API/Cocoa/_WKInspector.mm: 18 (-[_WKInspector handle]): Added. 19 20 * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: 21 (WebKit::InjectedBundle::classesForCoder): 22 Drive-by, make it possible to use WKBrowsingContextHandle in injected bundle parameters. 23 This is easy because it conforms to NSSecureCoding and is simply a pageId + frameId. 24 1 25 2021-02-20 Chris Fleizach <cfleizach@apple.com> 2 26 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm
r273128 r273215 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 170 170 } 171 171 172 - (WKBrowsingContextHandle *)handle 173 { 174 return self.inspectorWebView._handle; 175 } 176 172 177 // MARK: _WKInspectorInternal methods 173 178 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInspectorPrivate.h
r271424 r273215 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #import "_WKInspector.h" 27 27 28 @class WKBrowsingContextHandle; 28 29 @protocol _WKDiagnosticLoggingDelegate; 29 30 … … 32 33 @property (nonatomic, weak, setter=_setDiagnosticLoggingDelegate:) id<_WKDiagnosticLoggingDelegate> _diagnosticLoggingDelegate; 33 34 35 /** 36 * @abstract The browsing context handle associated with Web Inspector's user interface. 37 * @discussion This can be used to identify the inspector page and any associated subframes 38 * from within the injected bundle. 39 */ 40 @property (nonatomic, readonly) WKBrowsingContextHandle *handle; 41 34 42 @end -
trunk/Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm
r260215 r273215 30 30 #import "APIData.h" 31 31 #import "ObjCObjectGraph.h" 32 #import "WKBrowsingContextHandle.h" 32 33 #import "WKBundleAPICast.h" 33 34 #import "WKBundleInitialize.h" … … 267 268 { 268 269 if (!m_classesForCoder) 269 m_classesForCoder = [NSSet setWithObjects:[NSArray class], [NSData class], [NSDate class], [NSDictionary class], [NSNull class], [NSNumber class], [NSSet class], [NSString class], [NSTimeZone class], [NSURL class], [NSUUID class], nil];270 m_classesForCoder = [NSSet setWithObjects:[NSArray class], [NSData class], [NSDate class], [NSDictionary class], [NSNull class], [NSNumber class], [NSSet class], [NSString class], [NSTimeZone class], [NSURL class], [NSUUID class], [WKBrowsingContextHandle class], nil]; 270 271 271 272 return m_classesForCoder.get();
Note: See TracChangeset
for help on using the changeset viewer.