Drop dead code related to local storage prewarming
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2020 18:45:34 +0000 (18:45 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jan 2020 18:45:34 +0000 (18:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=206418

Reviewed by Sam Weinig.

Drop dead code related to local storage prewarming. Sihui neutered it in <https://trac.webkit.org/changeset/248734>
but did not remove the code.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::prewarmLocalStorageIfNecessary): Deleted.
* page/DOMWindow.h:
* page/Frame.cpp:
(WebCore::Frame::didPrewarmLocalStorage): Deleted.
(WebCore::Frame::mayPrewarmLocalStorage const): Deleted.
* page/Frame.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h

index 3b6ed9d..e9f14b5 100644 (file)
@@ -1,3 +1,23 @@
+2020-01-17  Chris Dumez  <cdumez@apple.com>
+
+        Drop dead code related to local storage prewarming
+        https://bugs.webkit.org/show_bug.cgi?id=206418
+
+        Reviewed by Sam Weinig.
+
+        Drop dead code related to local storage prewarming. Sihui neutered it in <https://trac.webkit.org/changeset/248734>
+        but did not remove the code.
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::commitData):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::prewarmLocalStorageIfNecessary): Deleted.
+        * page/DOMWindow.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::didPrewarmLocalStorage): Deleted.
+        (WebCore::Frame::mayPrewarmLocalStorage const): Deleted.
+        * page/Frame.h:
+
 2020-01-17  Adrian Perez de Castro  <aperez@igalia.com>
 
         Fix various non-unified build issues introduced since r254327
index 2ab2ef5..78e08c7 100644 (file)
@@ -1092,9 +1092,6 @@ void DocumentLoader::commitData(const char* bytes, size_t length)
         if (!isLoading())
             return;
 
-        if (auto* window = m_frame->document()->domWindow())
-            window->prewarmLocalStorageIfNecessary();
-
         bool userChosen;
         String encoding;
         if (overrideEncoding().isNull()) {
index 400ded4..743b6e8 100644 (file)
@@ -439,28 +439,6 @@ void DOMWindow::didSecureTransitionTo(Document& document)
     m_performance = nullptr;
 }
 
-void DOMWindow::prewarmLocalStorageIfNecessary()
-{
-    auto* page = this->page();
-
-    // No need to prewarm for ephemeral sessions since the data is in memory only.
-    if (!page || page->usesEphemeralSession())
-        return;
-
-    if (!page->mainFrame().mayPrewarmLocalStorage())
-        return;
-
-    auto localStorageResult = this->localStorage();
-    if (localStorageResult.hasException())
-        return;
-
-    auto* localStorage = localStorageResult.returnValue();
-    if (!localStorage)
-        return;
-
-    page->mainFrame().didPrewarmLocalStorage();
-}
-
 DOMWindow::~DOMWindow()
 {
     if (m_suspendedForDocumentSuspension)
index f7e0728..024b263 100644 (file)
@@ -203,8 +203,6 @@ public:
 
     void showModalDialog(const String& urlString, const String& dialogFeaturesString, DOMWindow& activeWindow, DOMWindow& firstWindow, const WTF::Function<void(DOMWindow&)>& prepareDialogFunction);
 
-    void prewarmLocalStorageIfNecessary();
-
     void alert(const String& message = emptyString());
     bool confirmForBindings(const String& message);
     String prompt(const String& message, const String& defaultValue);
index 6f434d9..dc0266d 100644 (file)
@@ -117,9 +117,6 @@ static const Seconds scrollFrequency { 1000_s / 60. };
 
 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame"));
 
-// We prewarm local storage for at most 5 origins in a given page.
-static const unsigned maxlocalStoragePrewarmingCount { 5 };
-
 static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
 {
     if (!ownerElement)
@@ -988,19 +985,6 @@ void Frame::dropChildren()
         tree().removeChild(*child);
 }
 
-void Frame::didPrewarmLocalStorage()
-{
-    ASSERT(isMainFrame());
-    ASSERT(m_localStoragePrewarmingCount < maxlocalStoragePrewarmingCount);
-    ++m_localStoragePrewarmingCount;
-}
-
-bool Frame::mayPrewarmLocalStorage() const
-{
-    ASSERT(isMainFrame());
-    return m_localStoragePrewarmingCount < maxlocalStoragePrewarmingCount;
-}
-
 void Frame::selfOnlyRef()
 {
     ASSERT(isMainFrame());
index dd9802c..2d8d007 100644 (file)
@@ -291,9 +291,6 @@ public:
 
     WEBCORE_EXPORT bool isAlwaysOnLoggingAllowed() const;
 
-    void didPrewarmLocalStorage();
-    bool mayPrewarmLocalStorage() const;
-
 // ========
 
     void selfOnlyRef();
@@ -356,7 +353,6 @@ private:
     unsigned m_navigationDisableCount { 0 };
     unsigned m_selfOnlyRefCount { 0 };
     bool m_hasHadUserInteraction { false };
-    unsigned m_localStoragePrewarmingCount { 0 };
 
 protected:
     UniqueRef<EventHandler> m_eventHandler;