⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243795 in webkit


Ignore:
Timestamp:
Apr 3, 2019, 5:42:38 AM (7 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Remote Inspector indicate callback should always happen on the main thread
https://bugs.webkit.org/show_bug.cgi?id=196513
<rdar://problem/49498284>

Reviewed by Devin Rousso.

Source/JavaScriptCore:

  • inspector/remote/cocoa/RemoteInspectorCocoa.mm:

(Inspector::RemoteInspector::receivedIndicateMessage):
When we have a WebThread, don't just run on the WebThread,
run on the MainThread with the WebThreadLock.

Source/WebCore:

  • platform/ios/wak/WebCoreThreadSystemInterface.cpp:

(InitWebCoreThreadSystemInterface):

Source/WTF:

  • wtf/MainThread.h:
  • wtf/cocoa/MainThreadCocoa.mm:

(WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded):

  • wtf/ios/WebCoreThread.cpp:
  • wtf/ios/WebCoreThread.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r243754 r243795  
     12019-04-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Remote Inspector indicate callback should always happen on the main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=196513
     5        <rdar://problem/49498284>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * inspector/remote/cocoa/RemoteInspectorCocoa.mm:
     10        (Inspector::RemoteInspector::receivedIndicateMessage):
     11        When we have a WebThread, don't just run on the WebThread,
     12        run on the MainThread with the WebThreadLock.
     13
    1142019-04-02  Michael Saboff  <msaboff@apple.com>
    215
  • trunk/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm

    r242576 r243795  
    593593        return;
    594594
    595     callOnWebThreadOrDispatchAsyncOnMainThread(^{
     595    dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded(^{
    596596        RemoteControllableTarget* target = nullptr;
    597597        {
  • trunk/Source/WTF/ChangeLog

    r243747 r243795  
     12019-04-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Remote Inspector indicate callback should always happen on the main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=196513
     5        <rdar://problem/49498284>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * wtf/MainThread.h:
     10        * wtf/cocoa/MainThreadCocoa.mm:
     11        (WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded):
     12        * wtf/ios/WebCoreThread.cpp:
     13        * wtf/ios/WebCoreThread.h:
     14
    1152019-04-02  Keith Rollin  <krollin@apple.com>
    216
  • trunk/Source/WTF/wtf/MainThread.h

    r242776 r243795  
    4747
    4848#if PLATFORM(COCOA)
     49WTF_EXPORT_PRIVATE void dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded(void (^block)());
    4950WTF_EXPORT_PRIVATE void callOnWebThreadOrDispatchAsyncOnMainThread(void (^block)());
    5051#endif
     
    109110using WTF::setMainThreadCallbacksPaused;
    110111#if PLATFORM(COCOA)
     112using WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded;
    111113using WTF::callOnWebThreadOrDispatchAsyncOnMainThread;
    112114#endif
  • trunk/Source/WTF/wtf/cocoa/MainThreadCocoa.mm

    r237099 r243795  
    141141}
    142142
     143void dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded(void (^block)())
     144{
     145#if USE(WEB_THREAD)
     146    if (WebCoreWebThreadIsEnabled && WebCoreWebThreadIsEnabled()) {
     147        dispatch_async(dispatch_get_main_queue(), ^{
     148            WebCoreWebThreadLock();
     149            block();
     150        });
     151        return;
     152    }
     153#endif
     154    dispatch_async(dispatch_get_main_queue(), block);
     155}
     156
    143157void callOnWebThreadOrDispatchAsyncOnMainThread(void (^block)())
    144158{
  • trunk/Source/WTF/wtf/ios/WebCoreThread.cpp

    r237099 r243795  
    2828
    2929#if USE(WEB_THREAD)
     30WTF_EXPORT_PRIVATE void (*WebCoreWebThreadLock)(void);
    3031WTF_EXPORT_PRIVATE bool (*WebCoreWebThreadIsLockedOrDisabled)(void);
    3132WTF_EXPORT_PRIVATE bool (*WebCoreWebThreadIsEnabled)(void);
  • trunk/Source/WTF/wtf/ios/WebCoreThread.h

    r237099 r243795  
    3030#endif
    3131
     32extern void (*WebCoreWebThreadLock)(void);
    3233extern bool (*WebCoreWebThreadIsLockedOrDisabled)(void);
    3334extern bool (*WebCoreWebThreadIsEnabled)(void);
  • trunk/Source/WebCore/ChangeLog

    r243786 r243795  
     12019-04-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Remote Inspector indicate callback should always happen on the main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=196513
     5        <rdar://problem/49498284>
     6
     7        Reviewed by Devin Rousso.
     8
     9        * platform/ios/wak/WebCoreThreadSystemInterface.cpp:
     10        (InitWebCoreThreadSystemInterface):
     11
    1122019-04-02  Simon Fraser  <simon.fraser@apple.com>
    213
  • trunk/Source/WebCore/platform/ios/wak/WebCoreThreadSystemInterface.cpp

    r237266 r243795  
    4545        return;
    4646
     47    INIT(WebThreadLock);
    4748    INIT(WebThreadIsLockedOrDisabled);
    4849    INIT(WebThreadIsEnabled);
Note: See TracChangeset for help on using the changeset viewer.