Summary: | Some style improvements to main thread code | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Geoffrey Garen <ggaren> | ||||||||
Component: | New Bugs | Assignee: | Geoffrey Garen <ggaren> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, darin, ews-watchlist, koivisto, sihui_liu, simon.fraser, thorton, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Geoffrey Garen
2020-06-10 15:10:21 PDT
Created attachment 401590 [details]
Patch
Created attachment 401591 [details]
Patch
Comment on attachment 401591 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401591&action=review > Source/WTF/wtf/cocoa/MainThreadCocoa.mm:61 > +static pthread_t s_webThreadPthread { nullptr }; The "{ nullptr }" has no effect or value here. > Source/WTF/wtf/cocoa/MainThreadCocoa.mm:106 > + if (RunLoop::webIfExists()) { > RunLoop::web().dispatch(dispatchFunctionsFromMainThread); > return; > } Why get it twice? Put it in a local variable and use it? > Source/WebKit/Shared/WebKit2Initialize.cpp:43 > JSC::initializeThreading(); > - RunLoop::initializeMainRunLoop(); > + RunLoop::initializeMain(); Is there any reason that these are two separate function calls that both need to be called in each location? If JSC::initializeThreading called RunLoop::initializeMain, what would go wrong? > > Source/WebKit/Shared/WebKit2Initialize.cpp:43
> > JSC::initializeThreading();
> > - RunLoop::initializeMainRunLoop();
> > + RunLoop::initializeMain();
>
> Is there any reason that these are two separate function calls that both
> need to be called in each location? If JSC::initializeThreading called
> RunLoop::initializeMain, what would go wrong?
JSC::initializeThreading can be called on any thread. RunLoop::initializeMain must be called on the main thread.
But maybe we could add a JSC::initializeMain() convenience function to do both from the main thread.
Created attachment 401603 [details]
Patch for landing
Committed r262878: <https://trac.webkit.org/changeset/262878> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401603 [details]. |