Skip to content
Permalink
Browse files
Lazily construct the NetworkHTTPSUpgradeChecker
https://bugs.webkit.org/show_bug.cgi?id=198500

Reviewed by Alex Christensen.

Lazily construct the NetworkHTTPSUpgradeChecker since the feature is off by default and this
avoids unnecessarily opening its database in the common case.

* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::networkHTTPSUpgradeChecker):


Canonical link: https://commits.webkit.org/212530@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Jun 4, 2019
1 parent f7ff8c8 commit 0c0986942a996633d03a90f13c354601a9138511
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
@@ -1,3 +1,17 @@
2019-06-04 Chris Dumez <cdumez@apple.com>

Lazily construct the NetworkHTTPSUpgradeChecker
https://bugs.webkit.org/show_bug.cgi?id=198500

Reviewed by Alex Christensen.

Lazily construct the NetworkHTTPSUpgradeChecker since the feature is off by default and this
avoids unnecessarily opening its database in the common case.

* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::networkHTTPSUpgradeChecker):

2019-06-04 Youenn Fablet <youenn@apple.com>

REGRESSION (r245913) [ Debug ] ASSERTION FAILED: m_swConnectionsByIdentifier.contains(connection.serverConnectionIdentifier()) Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash
@@ -316,7 +316,7 @@ class NetworkProcess : public AuxiliaryProcess, private DownloadManager::Client,
#endif

#if PLATFORM(COCOA)
NetworkHTTPSUpgradeChecker& networkHTTPSUpgradeChecker() { return m_networkHTTPSUpgradeChecker; }
NetworkHTTPSUpgradeChecker& networkHTTPSUpgradeChecker();
#endif

const String& uiProcessBundleIdentifier() const { return m_uiProcessBundleIdentifier; }
@@ -546,7 +546,7 @@ class NetworkProcess : public AuxiliaryProcess, private DownloadManager::Client,
#endif

#if PLATFORM(COCOA)
NetworkHTTPSUpgradeChecker m_networkHTTPSUpgradeChecker;
std::unique_ptr<NetworkHTTPSUpgradeChecker> m_networkHTTPSUpgradeChecker;
#endif

class StorageQuotaManagers {
@@ -304,4 +304,11 @@ static void saveCookies(NSHTTPCookieStorage *cookieStorage, CompletionHandler<vo
{
}

NetworkHTTPSUpgradeChecker& NetworkProcess::networkHTTPSUpgradeChecker()
{
if (!m_networkHTTPSUpgradeChecker)
m_networkHTTPSUpgradeChecker = std::make_unique<NetworkHTTPSUpgradeChecker>();
return *m_networkHTTPSUpgradeChecker;
}

} // namespace WebKit

0 comments on commit 0c09869

Please sign in to comment.