[PSON] Avoid tearing down the drawing area when suspending a WebPage due to process...
[WebKit-https.git] / Source / WebKit / UIProcess / SuspendedPageProxy.h
index 7be0856..7fa0c3e 100644 (file)
@@ -36,20 +36,17 @@ namespace WebKit {
 class WebPageProxy;
 class WebProcessProxy;
 
-class SuspendedPageProxy : public CanMakeWeakPtr<SuspendedPageProxy> {
+class SuspendedPageProxy final: public IPC::MessageReceiver, public CanMakeWeakPtr<SuspendedPageProxy> {
 public:
-    SuspendedPageProxy(WebPageProxy&, WebProcessProxy&, WebBackForwardListItem&);
+    SuspendedPageProxy(WebPageProxy&, Ref<WebProcessProxy>&&, WebBackForwardListItem&, uint64_t mainFrameID);
     ~SuspendedPageProxy();
 
-    void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
-
     WebPageProxy& page() const { return m_page; }
-    WebProcessProxy* process() const { return m_process; }
+    WebProcessProxy& process() { return m_process.get(); }
+    uint64_t mainFrameID() const { return m_mainFrameID; }
     const WebCore::SecurityOriginData& origin() const { return m_origin; }
 
-    void webProcessDidClose(WebProcessProxy&);
-    void destroyWebPageInWebProcess();
-    void tearDownDrawingAreaInWebProcess();
+    void unsuspend();
 
 #if !LOG_DISABLED
     const char* loggingString() const;
@@ -58,10 +55,17 @@ public:
 private:
     void didFinishLoad();
 
+    // IPC::MessageReceiver
+    void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
+    void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) final;
+
     WebPageProxy& m_page;
-    WebProcessProxy* m_process;
+    Ref<WebProcessProxy> m_process;
+    uint64_t m_mainFrameID;
     WebCore::SecurityOriginData m_origin;
 
+    bool m_isSuspended { true };
+
 #if !LOG_DISABLED
     bool m_finishedSuspending { false };
 #endif