Changeset 234009 in webkit


Ignore:
Timestamp:
Jul 19, 2018, 4:11:11 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Move WebFrameListenerProxy to WebFramePolicyListenerProxy, its only subclass
https://bugs.webkit.org/show_bug.cgi?id=187825

Reviewed by Brady Eidson.

  • CMakeLists.txt:
  • UIProcess/API/C/WKPage.cpp:
  • UIProcess/API/Cocoa/WKBrowsingContextController.mm:
  • UIProcess/Automation/WebAutomationSession.cpp:
  • UIProcess/Cocoa/WebViewImpl.mm:
  • UIProcess/RemoteWebInspectorProxy.cpp:
  • UIProcess/WebFormSubmissionListenerProxy.h:

(WebKit::WebFormSubmissionListenerProxy::create):
(WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):

  • UIProcess/WebFrameListenerProxy.cpp: Removed.
  • UIProcess/WebFrameListenerProxy.h: Removed.
  • UIProcess/WebFramePolicyListenerProxy.cpp:

(WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
(WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision):
(WebKit::WebFramePolicyListenerProxy::changeWebsiteDataStore):
(WebKit::WebFramePolicyListenerProxy::invalidate):
(WebKit::WebFramePolicyListenerProxy::isMainFrame const):
(WebKit::WebFramePolicyListenerProxy::setNavigation):

  • UIProcess/WebFramePolicyListenerProxy.h:

(WebKit::WebFramePolicyListenerProxy::listenerID const):
(WebKit::WebFramePolicyListenerProxy::operator new): Deleted.

  • UIProcess/WebFrameProxy.cpp:

(WebKit::WebFrameProxy::activePolicyListenerProxy):

  • UIProcess/WebFrameProxy.h:
  • UIProcess/WebInspectorProxy.cpp:
  • UIProcess/WebProcessPool.cpp:
  • UIProcess/ios/ViewGestureControllerIOS.mm:
  • UIProcess/mac/ViewGestureControllerMac.mm:
  • UIProcess/mac/WKInspectorViewController.mm:
  • WebKit.xcodeproj/project.pbxproj:
Location:
trunk/Source/WebKit
Files:
2 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/CMakeLists.txt

    r233310 r234009  
    336336    UIProcess/WebFormClient.cpp
    337337    UIProcess/WebFormSubmissionListenerProxy.cpp
    338     UIProcess/WebFrameListenerProxy.cpp
    339338    UIProcess/WebFramePolicyListenerProxy.cpp
    340339    UIProcess/WebFrameProxy.cpp
  • trunk/Source/WebKit/ChangeLog

    r233992 r234009  
     12018-07-19  Alex Christensen  <achristensen@webkit.org>
     2
     3        Move WebFrameListenerProxy to WebFramePolicyListenerProxy, its only subclass
     4        https://bugs.webkit.org/show_bug.cgi?id=187825
     5
     6        Reviewed by Brady Eidson.
     7
     8        * CMakeLists.txt:
     9        * UIProcess/API/C/WKPage.cpp:
     10        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
     11        * UIProcess/Automation/WebAutomationSession.cpp:
     12        * UIProcess/Cocoa/WebViewImpl.mm:
     13        * UIProcess/RemoteWebInspectorProxy.cpp:
     14        * UIProcess/WebFormSubmissionListenerProxy.h:
     15        (WebKit::WebFormSubmissionListenerProxy::create):
     16        (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
     17        * UIProcess/WebFrameListenerProxy.cpp: Removed.
     18        * UIProcess/WebFrameListenerProxy.h: Removed.
     19        * UIProcess/WebFramePolicyListenerProxy.cpp:
     20        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
     21        (WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision):
     22        (WebKit::WebFramePolicyListenerProxy::changeWebsiteDataStore):
     23        (WebKit::WebFramePolicyListenerProxy::invalidate):
     24        (WebKit::WebFramePolicyListenerProxy::isMainFrame const):
     25        (WebKit::WebFramePolicyListenerProxy::setNavigation):
     26        * UIProcess/WebFramePolicyListenerProxy.h:
     27        (WebKit::WebFramePolicyListenerProxy::listenerID const):
     28        (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
     29        * UIProcess/WebFrameProxy.cpp:
     30        (WebKit::WebFrameProxy::activePolicyListenerProxy):
     31        * UIProcess/WebFrameProxy.h:
     32        * UIProcess/WebInspectorProxy.cpp:
     33        * UIProcess/WebProcessPool.cpp:
     34        * UIProcess/ios/ViewGestureControllerIOS.mm:
     35        * UIProcess/mac/ViewGestureControllerMac.mm:
     36        * UIProcess/mac/WKInspectorViewController.mm:
     37        * WebKit.xcodeproj/project.pbxproj:
     38
    1392018-07-19  Jon Lee  <jonlee@apple.com>
    240
  • trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp

    r232808 r234009  
    3939#include "APIHitTestResult.h"
    4040#include "APILoaderClient.h"
     41#include "APINavigation.h"
    4142#include "APINavigationAction.h"
    4243#include "APINavigationClient.h"
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm

    r232520 r234009  
    3030
    3131#import "APIData.h"
     32#import "APINavigation.h"
    3233#import "ObjCObjectGraph.h"
    3334#import "PageLoadStateObserver.h"
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp

    r232671 r234009  
    2525
    2626#include "APIData.h"
     27#include "APINavigation.h"
    2728#include "APISerializedScriptValue.h"
    2829#include "ImageOptions.h"
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp

    r233131 r234009  
    3030#include "APIArray.h"
    3131#include "APIAutomationSessionClient.h"
     32#include "APINavigation.h"
    3233#include "APIOpenPanelParameters.h"
    3334#include "AutomationProtocolObjects.h"
  • trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm

    r233926 r234009  
    3030
    3131#import "APILegacyContextHistoryClient.h"
     32#import "APINavigation.h"
    3233#import "AttributedString.h"
    3334#import "ColorSpaceData.h"
  • trunk/Source/WebKit/UIProcess/RemoteWebInspectorProxy.cpp

    r224249 r234009  
    2727#include "RemoteWebInspectorProxy.h"
    2828
     29#include "APINavigation.h"
    2930#include "RemoteWebInspectorProxyMessages.h"
    3031#include "RemoteWebInspectorUIMessages.h"
  • trunk/Source/WebKit/UIProcess/WebFormSubmissionListenerProxy.h

    r222583 r234009  
    2626#pragma once
    2727
    28 #include "WebFrameListenerProxy.h"
     28#include "APIObject.h"
     29#include <wtf/CompletionHandler.h>
    2930
    3031namespace WebKit {
     
    3233class WebFormSubmissionListenerProxy : public API::ObjectImpl<API::Object::Type::FormSubmissionListener> {
    3334public:
    34     static Ref<WebFormSubmissionListenerProxy> create(WTF::Function<void(void)>&& completionHandler)
     35    static Ref<WebFormSubmissionListenerProxy> create(CompletionHandler<void(void)>&& completionHandler)
    3536    {
    3637        return adoptRef(*new WebFormSubmissionListenerProxy(WTFMove(completionHandler)));
     
    4041
    4142private:
    42     WebFormSubmissionListenerProxy(WTF::Function<void(void)>&& completionHandler)
     43    WebFormSubmissionListenerProxy(CompletionHandler<void(void)>&& completionHandler)
    4344        : m_completionHandler(WTFMove(completionHandler))
    4445    { }
    45     WTF::Function<void(void)> m_completionHandler;
     46    CompletionHandler<void(void)> m_completionHandler;
    4647};
    4748
  • trunk/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp

    r229778 r234009  
    2727#include "WebFramePolicyListenerProxy.h"
    2828
     29#include "APINavigation.h"
    2930#include "WebFrameProxy.h"
    3031#include "WebsiteDataStore.h"
     
    3435
    3536WebFramePolicyListenerProxy::WebFramePolicyListenerProxy(WebFrameProxy* frame, uint64_t listenerID, PolicyListenerType policyType)
    36     : WebFrameListenerProxy(frame, listenerID)
    37     , m_policyType(policyType)
     37    : m_policyType(policyType)
     38    , m_frame(frame)
     39    , m_listenerID(listenerID)
    3840{
    3941}
    4042
     43void WebFramePolicyListenerProxy::receivedPolicyDecision(WebCore::PolicyAction action, std::optional<WebsitePoliciesData>&& data)
     44{
     45    if (!m_frame)
     46        return;
     47   
     48    m_frame->receivedPolicyDecision(action, m_listenerID, m_navigation.get(), WTFMove(data));
     49    m_frame = nullptr;
     50}
     51
     52void WebFramePolicyListenerProxy::changeWebsiteDataStore(WebsiteDataStore& websiteDataStore)
     53{
     54    if (!m_frame)
     55        return;
     56   
     57    m_frame->changeWebsiteDataStore(websiteDataStore);
     58}
     59
     60void WebFramePolicyListenerProxy::invalidate()
     61{
     62    m_frame = nullptr;
     63}
     64
     65bool WebFramePolicyListenerProxy::isMainFrame() const
     66{
     67    if (!m_frame)
     68        return false;
     69   
     70    return m_frame->isMainFrame();
     71}
     72
     73void WebFramePolicyListenerProxy::setNavigation(Ref<API::Navigation>&& navigation)
     74{
     75    m_navigation = WTFMove(navigation);
     76}
     77   
    4178void WebFramePolicyListenerProxy::use(std::optional<WebsitePoliciesData>&& data)
    4279{
  • trunk/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h

    r229778 r234009  
    2626#pragma once
    2727
    28 #include "WebFrameListenerProxy.h"
     28#include "APIObject.h"
    2929
    3030#if PLATFORM(COCOA)
     
    3232#endif
    3333
    34 #define DELEGATE_REF_COUNTING_TO_COCOA (PLATFORM(COCOA) && WK_API_ENABLED)
     34namespace API {
     35class Navigation;
     36}
     37
     38namespace WebCore {
     39enum class PolicyAction;
     40}
    3541
    3642namespace WebKit {
     43
     44class WebsiteDataStore;
     45class WebFrameProxy;
     46struct WebsitePoliciesData;
    3747
    3848enum class PolicyListenerType {
     
    4252};
    4353
    44 class WebFramePolicyListenerProxy : public WebFrameListenerProxy {
     54class WebFramePolicyListenerProxy : public API::ObjectImpl<API::Object::Type::FramePolicyListener> {
    4555public:
    46     static const Type APIType = Type::FramePolicyListener;
    4756
    4857    static Ref<WebFramePolicyListenerProxy> create(WebFrameProxy* frame, uint64_t listenerID, PolicyListenerType policyType)
     
    5766    PolicyListenerType policyListenerType() const { return m_policyType; }
    5867
     68    uint64_t listenerID() const { return m_listenerID; }
     69   
     70    void setNavigation(Ref<API::Navigation>&&);
     71    void invalidate();
     72   
     73    void changeWebsiteDataStore(WebsiteDataStore&);
     74    bool isMainFrame() const;
     75
     76    void setApplyPolicyInNewProcessIfPossible(bool applyPolicyInNewProcessIfPossible) { m_applyPolicyInNewProcessIfPossible = applyPolicyInNewProcessIfPossible; }
     77    bool applyPolicyInNewProcessIfPossible() const { return m_applyPolicyInNewProcessIfPossible; }
     78
    5979private:
    6080    WebFramePolicyListenerProxy(WebFrameProxy*, uint64_t listenerID, PolicyListenerType);
    6181
    62     Type type() const override { return APIType; }
    63 
    64 #if DELEGATE_REF_COUNTING_TO_COCOA
    65     void* operator new(size_t size) { return newObject(size, APIType); }
    66 #endif
     82    void receivedPolicyDecision(WebCore::PolicyAction, std::optional<WebsitePoliciesData>&&);
    6783
    6884    PolicyListenerType m_policyType;
     85    RefPtr<WebFrameProxy> m_frame;
     86    uint64_t m_listenerID { 0 };
     87    RefPtr<API::Navigation> m_navigation;
     88    bool m_applyPolicyInNewProcessIfPossible { false };
    6989};
    7090
    7191} // namespace WebKit
    72 
    73 #undef DELEGATE_REF_COUNTING_TO_COCOA
  • trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp

    r229778 r234009  
    2727#include "WebFrameProxy.h"
    2828
     29#include "APINavigation.h"
    2930#include "WebCertificateInfo.h"
    3031#include "WebFramePolicyListenerProxy.h"
     
    198199WebFramePolicyListenerProxy* WebFrameProxy::activePolicyListenerProxy()
    199200{
    200     if (!m_activeListener || m_activeListener->type() != WebFramePolicyListenerProxy::APIType)
    201         return nullptr;
    202 
    203     return static_cast<WebFramePolicyListenerProxy*>(m_activeListener.get());
     201    return m_activeListener.get();
    204202}
    205203
  • trunk/Source/WebKit/UIProcess/WebFrameProxy.h

    r229778 r234009  
    2929#include "FrameLoadState.h"
    3030#include "GenericCallback.h"
    31 #include "WebFrameListenerProxy.h"
     31#include "WebFramePolicyListenerProxy.h"
    3232#include <WebCore/FrameLoaderTypes.h>
    3333#include <wtf/Forward.h>
     
    145145    bool m_containsPluginDocument { false };
    146146    RefPtr<WebCertificateInfo> m_certificateInfo;
    147     RefPtr<WebFrameListenerProxy> m_activeListener;
     147    RefPtr<WebFramePolicyListenerProxy> m_activeListener;
    148148    uint64_t m_frameID;
    149149#if ENABLE(CONTENT_FILTERING)
  • trunk/Source/WebKit/UIProcess/WebInspectorProxy.cpp

    r224575 r234009  
    2828#include "WebInspectorProxy.h"
    2929
     30#include "APINavigation.h"
    3031#include "APIProcessPoolConfiguration.h"
    3132#include "WebAutomationSession.h"
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r233986 r234009  
    3434#include "APIInjectedBundleClient.h"
    3535#include "APILegacyContextHistoryClient.h"
     36#include "APINavigation.h"
    3637#include "APIPageConfiguration.h"
    3738#include "APIProcessPoolConfiguration.h"
  • trunk/Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp

    r232832 r234009  
    3030#include "WebInspectorProxy.h"
    3131
     32#include "APINavigation.h"
    3233#include "APINavigationAction.h"
    3334#include "WKArray.h"
  • trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm

    r233678 r234009  
    2929#if PLATFORM(IOS)
    3030
     31#import "APINavigation.h"
    3132#import "DrawingAreaProxy.h"
    3233#import "UIKitSPI.h"
  • trunk/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm

    r233678 r234009  
    2929#if PLATFORM(MAC)
    3030
     31#import "APINavigation.h"
    3132#import "DrawingAreaProxy.h"
    3233#import "FrameLoadState.h"
  • trunk/Source/WebKit/UIProcess/mac/WKInspectorViewController.mm

    r233316 r234009  
    2929#if PLATFORM(MAC) && WK_API_ENABLED
    3030
     31#import "APINavigation.h"
    3132#import "VersionChecks.h"
    3233#import "WKFrameInfo.h"
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r233866 r234009  
    19811981                BCE469591214EDF4000B98EB /* WKFormSubmissionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */; };
    19821982                BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1983                 BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */; };
    1984                 BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */; };
    19851983                BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE81D8A1319F7EF00241910 /* FontInfo.cpp */; };
    19861984                BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE81D8B1319F7EF00241910 /* FontInfo.h */; };
     
    45994597                BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKFormSubmissionListener.cpp; sourceTree = "<group>"; };
    46004598                BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFormSubmissionListener.h; sourceTree = "<group>"; };
    4601                 BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameListenerProxy.h; sourceTree = "<group>"; };
    4602                 BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFrameListenerProxy.cpp; sourceTree = "<group>"; };
    46034599                BCE81D8A1319F7EF00241910 /* FontInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontInfo.cpp; sourceTree = "<group>"; };
    46044600                BCE81D8B1319F7EF00241910 /* FontInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontInfo.h; sourceTree = "<group>"; };
     
    74967492                                BCE469511214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp */,
    74977493                                BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */,
    7498                                 BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */,
    7499                                 BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */,
    75007494                                BCB9F69F1123A84B00A137E0 /* WebFramePolicyListenerProxy.cpp */,
    75017495                                BCB9F69E1123A84B00A137E0 /* WebFramePolicyListenerProxy.h */,
     
    94739467                                BCE469561214E6CB000B98EB /* WebFormSubmissionListenerProxy.h in Headers */,
    94749468                                BC032D8D10F437A00058C15A /* WebFrame.h in Headers */,
    9475                                 BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */,
    94769469                                BC032D7F10F4378D0058C15A /* WebFrameLoaderClient.h in Headers */,
    94779470                                9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
     
    1128611279                                BCE469551214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp in Sources */,
    1128711280                                BC111ADD112F5B9300337BAB /* WebFrame.cpp in Sources */,
    11288                                 BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */,
    1128911281                                BC111A5F112F4FBB00337BAB /* WebFrameLoaderClient.cpp in Sources */,
    1129011282                                2D28F3E71885CCC1004B9EAE /* WebFrameLoaderClientIOS.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.