Title: [235758] trunk/Source
Revision
235758
Author
an...@apple.com
Date
2018-09-06 14:37:15 -0700 (Thu, 06 Sep 2018)

Log Message

Actively prewarm processes created for prewarm pool
https://bugs.webkit.org/show_bug.cgi?id=189364

Reviewed by Chris Dumez.

Source/WebCore:

Do some basic prewarming for newly created processes.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
* css/CSSDefaultStyleSheets.h:
* page/Frame.cpp:
(WebCore::Frame::Frame):
* page/ProcessWarming.cpp: Added.
(WebCore::ProcessWarming::initializeNames):

Factor name initialization into a function.

(WebCore::ProcessWarming::prewarm):

Prewarm
- names
- settings (system fonts)
- user agent stylesheet
- _javascript_ VM
- telephone number detection

* page/ProcessWarming.h: Added.

Source/WebKit:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::prewarm):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (235757 => 235758)


--- trunk/Source/WebCore/ChangeLog	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebCore/ChangeLog	2018-09-06 21:37:15 UTC (rev 235758)
@@ -1,3 +1,35 @@
+2018-09-06  Antti Koivisto  <an...@apple.com>
+
+        Actively prewarm processes created for prewarm pool
+        https://bugs.webkit.org/show_bug.cgi?id=189364
+
+        Reviewed by Chris Dumez.
+
+        Do some basic prewarming for newly created processes.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSDefaultStyleSheets.cpp:
+        (WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
+        * css/CSSDefaultStyleSheets.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        * page/ProcessWarming.cpp: Added.
+        (WebCore::ProcessWarming::initializeNames):
+
+        Factor name initialization into a function.
+
+        (WebCore::ProcessWarming::prewarm):
+
+        Prewarm
+        - names
+        - settings (system fonts)
+        - user agent stylesheet
+        - _javascript_ VM
+        - telephone number detection
+
+        * page/ProcessWarming.h: Added.
+
 2018-09-06  Youenn Fablet  <you...@apple.com>
 
         Move replaceTrack logic to RTCRtpSender backend

Modified: trunk/Source/WebCore/Sources.txt (235757 => 235758)


--- trunk/Source/WebCore/Sources.txt	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebCore/Sources.txt	2018-09-06 21:37:15 UTC (rev 235758)
@@ -1416,6 +1416,7 @@
 page/PerformanceUserTiming.cpp
 page/PointerLockController.cpp
 page/PrintContext.cpp
+page/ProcessWarming.cpp
 page/RemoteDOMWindow.cpp
 page/RemoteFrame.cpp
 page/ResourceUsageOverlay.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (235757 => 235758)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-09-06 21:37:15 UTC (rev 235758)
@@ -4715,6 +4715,7 @@
 		E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E401E0A41C3C0B8300F34D10 /* StyleChange.h in Headers */ = {isa = PBXBuildFile; fileRef = E401E0A31C3C0B8300F34D10 /* StyleChange.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E419041F1CC6486B00C35F5D /* FontSelectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E419041E1CC6486B00C35F5D /* FontSelectorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E42050172141901B0066EF3B /* ProcessWarming.h in Headers */ = {isa = PBXBuildFile; fileRef = E42050142141901A0066EF3B /* ProcessWarming.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E424A39E1330DF0100CF6DC9 /* LegacyTileGridTile.h in Headers */ = {isa = PBXBuildFile; fileRef = E424A39D1330DF0100CF6DC9 /* LegacyTileGridTile.h */; };
 		E425A49A18292B840020CFCF /* CollectionIndexCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E425A49918292B840020CFCF /* CollectionIndexCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */ = {isa = PBXBuildFile; fileRef = E4295FA312B0614E00D1ACE0 /* ResourceLoadPriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -9805,10 +9806,10 @@
 		834DFACC1F7DAE5600C2725B /* SharedStringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedStringHash.h; sourceTree = "<group>"; };
 		834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; };
 		8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; };
+		8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
+		8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
 		8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; };
-		8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; };
 		8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; };
-		8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; };
 		8350C3E81DA59B6200356446 /* ScrollToOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollToOptions.idl; sourceTree = "<group>"; };
 		83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; };
 		835657C61ECAB0E800CDE72D /* JSDOMMatrixInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMMatrixInit.cpp; sourceTree = "<group>"; };
@@ -9946,10 +9947,10 @@
 		83E8667F1FBA5640008855C5 /* ServiceWorkerData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerData.cpp; sourceTree = "<group>"; };
 		83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; };
 		83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; };
+		83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
+		83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
 		83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; };
-		83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; };
 		83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; };
-		83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; };
 		83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollToOptions.h; sourceTree = "<group>"; };
 		83EE598B1F50958B003E8B30 /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; };
 		83EE598C1F50958B003E8B30 /* JSErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorCallback.cpp; sourceTree = "<group>"; };
@@ -14315,6 +14316,8 @@
 		E419041E1CC6486B00C35F5D /* FontSelectorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSelectorClient.h; sourceTree = "<group>"; };
 		E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertyNames.cpp; sourceTree = "<group>"; };
 		E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValueKeywords.cpp; sourceTree = "<group>"; };
+		E42050142141901A0066EF3B /* ProcessWarming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessWarming.h; sourceTree = "<group>"; };
+		E42050162141901B0066EF3B /* ProcessWarming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessWarming.cpp; sourceTree = "<group>"; };
 		E424A39D1330DF0100CF6DC9 /* LegacyTileGridTile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyTileGridTile.h; sourceTree = "<group>"; };
 		E424A39F1330DF1E00CF6DC9 /* LegacyTileGridTile.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyTileGridTile.mm; sourceTree = "<group>"; };
 		E425A49918292B840020CFCF /* CollectionIndexCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionIndexCache.h; sourceTree = "<group>"; };
@@ -19425,6 +19428,8 @@
 				3772B09516535856000A49CA /* PopupOpeningObserver.h */,
 				B776D43C1104527500BEB0EC /* PrintContext.cpp */,
 				B776D43A1104525D00BEB0EC /* PrintContext.h */,
+				E42050162141901B0066EF3B /* ProcessWarming.cpp */,
+				E42050142141901A0066EF3B /* ProcessWarming.h */,
 				46B9518D207D632A00A7D2DD /* RemoteDOMWindow.cpp */,
 				46B9518E207D632A00A7D2DD /* RemoteDOMWindow.h */,
 				46BCBBC3208500A700710638 /* RemoteDOMWindow.idl */,
@@ -28776,6 +28781,7 @@
 				D6489D26166FFCF1007C031B /* JSHTMLTemplateElement.h in Headers */,
 				A80E7E9D0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.h in Headers */,
 				83E359A21BB1031D002CEB98 /* JSHTMLTimeElement.h in Headers */,
+				E42050172141901B0066EF3B /* ProcessWarming.h in Headers */,
 				A80E7B0C0A19D606007FB8C5 /* JSHTMLTitleElement.h in Headers */,
 				070756D414239A4F00414161 /* JSHTMLTrackElement.h in Headers */,
 				1A85B2110A1B258700D8C87C /* JSHTMLUListElement.h in Headers */,

Modified: trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp (235757 => 235758)


--- trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebCore/css/CSSDefaultStyleSheets.cpp	2018-09-06 21:37:15 UTC (rev 235758)
@@ -142,6 +142,9 @@
 
 void CSSDefaultStyleSheets::loadFullDefaultStyle()
 {
+    if (defaultStyle && !simpleDefaultStyleSheet)
+        return;
+    
     if (simpleDefaultStyleSheet) {
         ASSERT(defaultStyle);
         ASSERT(defaultPrintStyle == defaultStyle);

Modified: trunk/Source/WebCore/css/CSSDefaultStyleSheets.h (235757 => 235758)


--- trunk/Source/WebCore/css/CSSDefaultStyleSheets.h	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebCore/css/CSSDefaultStyleSheets.h	2018-09-06 21:37:15 UTC (rev 235758)
@@ -49,9 +49,9 @@
 
     static void initDefaultStyle(const Element*);
     static void ensureDefaultStyleSheetsForElement(const Element&);
+    static void loadFullDefaultStyle();
 
 private:
-    static void loadFullDefaultStyle();
     static void loadSimpleDefaultStyle();
     static void addToDefaultStyle(StyleSheetContents&);
 };

Modified: trunk/Source/WebCore/page/Frame.cpp (235757 => 235758)


--- trunk/Source/WebCore/page/Frame.cpp	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebCore/page/Frame.cpp	2018-09-06 21:37:15 UTC (rev 235758)
@@ -69,8 +69,6 @@
 #include "InspectorInstrumentation.h"
 #include "JSWindowProxy.h"
 #include "Logging.h"
-#include "MathMLNames.h"
-#include "MediaFeatureNames.h"
 #include "NavigationScheduler.h"
 #include "Navigator.h"
 #include "NodeList.h"
@@ -77,6 +75,7 @@
 #include "NodeTraversal.h"
 #include "Page.h"
 #include "PageCache.h"
+#include "ProcessWarming.h"
 #include "RenderLayerCompositor.h"
 #include "RenderTableCell.h"
 #include "RenderText.h"
@@ -87,7 +86,6 @@
 #include "RuntimeEnabledFeatures.h"
 #include "SVGDocument.h"
 #include "SVGDocumentExtensions.h"
-#include "SVGNames.h"
 #include "ScriptController.h"
 #include "ScriptSourceCode.h"
 #include "ScrollingCoordinator.h"
@@ -101,10 +99,6 @@
 #include "UserScript.h"
 #include "UserTypingGestureIndicator.h"
 #include "VisibleUnits.h"
-#include "WebKitFontFamilyNames.h"
-#include "XLinkNames.h"
-#include "XMLNSNames.h"
-#include "XMLNames.h"
 #include "markup.h"
 #include "npruntime_impl.h"
 #include "runtime_root.h"
@@ -171,16 +165,7 @@
     , m_activeDOMObjectsAndAnimationsSuspendedCount(0)
     , m_eventHandler(makeUniqueRef<EventHandler>(*this))
 {
-    AtomicString::init();
-    HTMLNames::init();
-    QualifiedName::init();
-    MediaFeatureNames::init();
-    SVGNames::init();
-    XLinkNames::init();
-    MathMLNames::init();
-    XMLNSNames::init();
-    XMLNames::init();
-    WebKitFontFamilyNames::init();
+    ProcessWarming::initializeNames();
 
     if (ownerElement) {
         m_mainFrame.selfOnlyRef();

Added: trunk/Source/WebCore/page/ProcessWarming.cpp (0 => 235758)


--- trunk/Source/WebCore/page/ProcessWarming.cpp	                        (rev 0)
+++ trunk/Source/WebCore/page/ProcessWarming.cpp	2018-09-06 21:37:15 UTC (rev 235758)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ProcessWarming.h"
+
+#include "CSSDefaultStyleSheets.h"
+#include "CommonVM.h"
+#include "Font.h"
+#include "FontCache.h"
+#include "HTMLNames.h"
+#include "MathMLNames.h"
+#include "MediaFeatureNames.h"
+#include "QualifiedName.h"
+#include "SVGNames.h"
+#include "Settings.h"
+#include "TelephoneNumberDetector.h"
+#include "WebKitFontFamilyNames.h"
+#include "XLinkNames.h"
+#include "XMLNSNames.h"
+#include "XMLNames.h"
+
+namespace WebCore {
+
+void ProcessWarming::initializeNames()
+{
+    AtomicString::init();
+    HTMLNames::init();
+    QualifiedName::init();
+    MediaFeatureNames::init();
+    SVGNames::init();
+    XLinkNames::init();
+    MathMLNames::init();
+    XMLNSNames::init();
+    XMLNames::init();
+    WebKitFontFamilyNames::init();
+}
+    
+void ProcessWarming::prewarm()
+{
+    initializeNames();
+    
+    // Initializes default font families.
+    Settings::create(nullptr);
+    
+    // Prewarms user agent stylesheet.
+    CSSDefaultStyleSheets::loadFullDefaultStyle();
+    
+    // Prewarms JS VM.
+    commonVM();
+    
+#if ENABLE(TELEPHONE_NUMBER_DETECTION)
+    TelephoneNumberDetector::isSupported();
+#endif
+}
+
+}

Added: trunk/Source/WebCore/page/ProcessWarming.h (0 => 235758)


--- trunk/Source/WebCore/page/ProcessWarming.h	                        (rev 0)
+++ trunk/Source/WebCore/page/ProcessWarming.h	2018-09-06 21:37:15 UTC (rev 235758)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+class WEBCORE_EXPORT ProcessWarming {
+public:
+    static void initializeNames();
+    static void prewarm();
+};
+
+}

Modified: trunk/Source/WebKit/ChangeLog (235757 => 235758)


--- trunk/Source/WebKit/ChangeLog	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebKit/ChangeLog	2018-09-06 21:37:15 UTC (rev 235758)
@@ -1,3 +1,17 @@
+2018-09-06  Antti Koivisto  <an...@apple.com>
+
+        Actively prewarm processes created for prewarm pool
+        https://bugs.webkit.org/show_bug.cgi?id=189364
+
+        Reviewed by Chris Dumez.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::createNewWebProcess):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::prewarm):
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+
 2018-09-06  Jer Noble  <jer.no...@apple.com>
 
         Don't pause playback when locking screen if video is being displayed on second screen.

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (235757 => 235758)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-09-06 21:37:15 UTC (rev 235758)
@@ -777,6 +777,8 @@
     if (isPrewarmed == WebProcessProxy::IsPrewarmed::Yes) {
         ASSERT(!m_prewarmedProcess);
         m_prewarmedProcess = &process;
+        
+        m_prewarmedProcess->send(Messages::WebProcess::Prewarm(), 0);
     }
 
     if (m_serviceWorkerProcessesTerminationTimer.isActive())

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (235757 => 235758)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-09-06 21:37:15 UTC (rev 235758)
@@ -107,6 +107,7 @@
 #include <WebCore/PageCache.h>
 #include <WebCore/PageGroup.h>
 #include <WebCore/PlatformMediaSessionManager.h>
+#include <WebCore/ProcessWarming.h>
 #include <WebCore/ResourceLoadObserver.h>
 #include <WebCore/ResourceLoadStatistics.h>
 #include <WebCore/RuntimeApplicationChecks.h>
@@ -427,6 +428,11 @@
     RELEASE_LOG(Process, "%p - WebProcess::initializeWebProcess: Presenting process = %d", this, WebCore::presentingApplicationPID());
 }
 
+void WebProcess::prewarm()
+{
+    WebCore::ProcessWarming::prewarm();
+}
+
 void WebProcess::registerURLSchemeAsEmptyDocument(const String& urlScheme)
 {
     SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (235757 => 235758)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2018-09-06 21:37:15 UTC (rev 235758)
@@ -249,6 +249,8 @@
     void initializeWebProcess(WebProcessCreationParameters&&);
     void platformInitializeWebProcess(WebProcessCreationParameters&&);
 
+    void prewarm();
+
 #if USE(OS_STATE)
     void registerWithStateDumper();
 #endif

Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (235757 => 235758)


--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2018-09-06 21:14:07 UTC (rev 235757)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2018-09-06 21:37:15 UTC (rev 235758)
@@ -26,6 +26,8 @@
     # Create a new page.
     CreateWebPage(uint64_t newPageID, struct WebKit::WebPageCreationParameters pageCreationParameters)
 
+    Prewarm();
+ 
     # Global preferences.
     SetCacheModel(uint32_t cacheModel)
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to