[PSON] Introduce a WebContent Process cache
[WebKit-https.git] / Source / WebKit / UIProcess / WebProcessPool.h
index e574e1d..ebff9bf 100644 (file)
@@ -101,6 +101,7 @@ class WebAutomationSession;
 class WebContextSupplement;
 class WebPageGroup;
 class WebPageProxy;
+class WebProcessCache;
 struct NetworkProcessCreationParameters;
 struct StatisticsData;
 struct WebProcessCreationParameters;
@@ -176,6 +177,8 @@ public:
 
     void processDidFinishLaunching(WebProcessProxy*);
 
+    WebProcessCache& webProcessCache() { return m_webProcessCache.get(); }
+
     // Disconnect the process from the context.
     void disconnectProcess(WebProcessProxy*);
 
@@ -464,6 +467,7 @@ public:
     void removeSuspendedPage(SuspendedPageProxy&);
     bool hasSuspendedPageFor(WebProcessProxy&, WebPageProxy* = nullptr) const;
     unsigned maxSuspendedPageCount() const { return m_maxSuspendedPageCount; }
+    RefPtr<WebProcessProxy> findReusableSuspendedPageProcess(const String&, WebPageProxy&);
 
     void didReachGoodTimeToPrewarm();
 
@@ -548,6 +552,8 @@ private:
     void unregisterNotificationObservers();
 #endif
 
+    void setApplicationIsActive(bool);
+
     void addPlugInAutoStartOriginHash(const String& pageOrigin, unsigned plugInOriginHash, PAL::SessionID);
     void plugInDidReceiveUserInteraction(unsigned plugInOriginHash, PAL::SessionID);
 
@@ -649,6 +655,8 @@ private:
 #if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
     RetainPtr<NSObject> m_scrollerStyleNotificationObserver;
 #endif
+    RetainPtr<NSObject> m_activationObserver;
+    RetainPtr<NSObject> m_deactivationObserver;
 
     std::unique_ptr<HighPerformanceGraphicsUsageSampler> m_highPerformanceGraphicsUsageSampler;
     std::unique_ptr<PerActivityStateCPUUsageSampler> m_perActivityStateCPUUsageSampler;
@@ -739,6 +747,7 @@ private:
     Deque<std::unique_ptr<SuspendedPageProxy>> m_suspendedPages;
     unsigned m_maxSuspendedPageCount { 0 };
 
+    UniqueRef<WebProcessCache> m_webProcessCache;
     HashMap<String, RefPtr<WebProcessProxy>> m_swappedProcessesPerRegistrableDomain;
 
     HashMap<String, std::unique_ptr<WebCore::PrewarmInformation>> m_prewarmInformationPerRegistrableDomain;