[webkit-changes] [WebKit/WebKit] 50fe78: Clean up / optimize WebProcessPool initialization

Chris Dumez noreply at github.com
Fri Feb 24 13:35:07 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 50fe78eb4399d77832bd8d672042396b9acb3f44
      https://github.com/WebKit/WebKit/commit/50fe78eb4399d77832bd8d672042396b9acb3f44
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/UIProcess/WebProcessPool.h

  Log Message:
  -----------
  Clean up / optimize WebProcessPool initialization
https://bugs.webkit.org/show_bug.cgi?id=252915

Reviewed by Per Arne Vollan.

Use a single static s_didGlobalStaticInitialization variable to determine if we
need to do the global static initialization work, instead of multiple other
static variables and std::call_once() scopes. No multi-threading is involved
here since WebProcessPools are always constructed on the main thread.

Make the shouldCrashWhenCreatingWebProcess flag static instead of per
WebProcessPool since its value won't change.

Move some work behind the s_didGlobalStaticInitialization flag since it only
makes sense to do it once in the lifetime of the app.

* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaults):
(WebKit::determineIfWeShouldCrashWhenCreatingWebProcess):
(WebKit::WebProcessPool::platformInitialize):
(WebKit::registerUserDefaultsIfNeeded): Deleted.
* Source/WebKit/UIProcess/WebProcessPool.cpp:
* Source/WebKit/UIProcess/WebProcessPool.h:

Canonical link: https://commits.webkit.org/260813@main




More information about the webkit-changes mailing list