Changeset 179754 in webkit


Ignore:
Timestamp:
Feb 6, 2015 1:21:08 PM (9 years ago)
Author:
ap@apple.com
Message:

Report network process crashes during layout tests
https://bugs.webkit.org/show_bug.cgi?id=139646

Reviewed by Anders Carlsson.

Source/WebKit2:

Added a way to get network process pid, modeled after how we do this for web process.

  • UIProcess/API/C/mac/WKContextPrivateMac.h:
  • UIProcess/API/C/mac/WKContextPrivateMac.mm:

(WKContextGetNetworkProcessIdentifier):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::networkProcessCrashed): Don't reset m_networkProcess until
after calling the client, so that the client could retrieve its pid.
(WebKit::WebProcessPool::networkProcessIdentifier):

  • UIProcess/WebProcessPool.h:

Tools:

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::initialize):
(WTR::TestController::networkProcessName):
(WTR::TestController::networkProcessDidCrash):

  • WebKitTestRunner/TestController.h:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r179752 r179754  
     12015-02-06  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Report network process crashes during layout tests
     4        https://bugs.webkit.org/show_bug.cgi?id=139646
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Added a way to get network process pid, modeled after how we do this for web process.
     9
     10        * UIProcess/API/C/mac/WKContextPrivateMac.h:
     11        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
     12        (WKContextGetNetworkProcessIdentifier):
     13        * UIProcess/WebProcessPool.cpp:
     14        (WebKit::WebProcessPool::networkProcessCrashed): Don't reset m_networkProcess until
     15        after calling the client, so that the client could retrieve its pid.
     16        (WebKit::WebProcessPool::networkProcessIdentifier):
     17        * UIProcess/WebProcessPool.h:
     18
    1192015-02-05  Timothy Hatcher  <timothy@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h

    r168541 r179754  
    7171WK_EXPORT bool WKContextShouldSuggestBlockWebGL();
    7272
     73WK_EXPORT pid_t WKContextGetNetworkProcessIdentifier(WKContextRef context);
     74
    7375#ifdef __cplusplus
    7476}
  • trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm

    r177699 r179754  
    147147    return WKShouldSuggestBlockingWebGL();
    148148}
     149
     150pid_t WKContextGetNetworkProcessIdentifier(WKContextRef contextRef)
     151{
     152#if ENABLE(NETWORK_PROCESS)
     153    return toImpl(contextRef)->networkProcessIdentifier();
     154#else
     155    UNUSED_PARAM(contextRef);
     156    return 0;
     157#endif
     158}
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp

    r179599 r179754  
    449449        it->value->processDidClose(networkProcessProxy);
    450450
     451    m_client.networkProcessDidCrash(this);
     452
     453    // Leave the process proxy around during client call, so that the client could query the process identifier.
    451454    m_networkProcess = nullptr;
    452 
    453     m_client.networkProcessDidCrash(this);
    454455}
    455456
     
    940941#endif // ENABLE(NETSCAPE_PLUGIN_API)
    941942
     943#if ENABLE(NETWORK_PROCESS)
     944PlatformProcessIdentifier WebProcessPool::networkProcessIdentifier()
     945{
     946    if (!m_networkProcess)
     947        return 0;
     948
     949    return m_networkProcess->processIdentifier();
     950}
     951#endif
     952
    942953void WebProcessPool::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
    943954{
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.h

    r179373 r179754  
    188188#endif
    189189
     190#if ENABLE(NETWORK_PROCESS)
     191    PlatformProcessIdentifier networkProcessIdentifier();
     192#endif
     193
    190194    void setAlwaysUsesComplexTextCodePath(bool);
    191195    void setShouldUseFontSmoothing(bool);
  • trunk/Tools/ChangeLog

    r179747 r179754  
     12015-02-06  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Report network process crashes during layout tests
     4        https://bugs.webkit.org/show_bug.cgi?id=139646
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * WebKitTestRunner/TestController.cpp:
     9        (WTR::TestController::initialize):
     10        (WTR::TestController::networkProcessName):
     11        (WTR::TestController::networkProcessDidCrash):
     12        * WebKitTestRunner/TestController.h:
     13
    1142015-02-06  Csaba Osztrogonác  <ossy@webkit.org>
    215
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r179588 r179754  
    5757
    5858#if PLATFORM(COCOA)
     59#include <WebKit/WKContextPrivateMac.h>
    5960#include <WebKit/WKPagePrivateMac.h>
    6061#endif
     
    392393    WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient.base);
    393394
     395    WKContextClientV1 contextClient = {
     396        { 1, this },
     397        0, // plugInAutoStartOriginHashesChanged
     398        networkProcessDidCrash,
     399        0, // plugInInformationBecameAvailable
     400        0, // copyWebCryptoMasterKey
     401    };
     402    WKContextSetClient(m_context.get(), &contextClient.base);
     403
    394404    WKContextHistoryClientV0 historyClient = {
    395405        { 0, this },
     
    692702}
    693703
     704const char* TestController::networkProcessName()
     705{
     706    // FIXME: Find a way to not hardcode the process name.
     707#if PLATFORM(IOS)
     708    return "com.apple.WebKit.Networking";
     709#elif PLATFORM(MAC)
     710    return "com.apple.WebKit.Networking.Development";
     711#else
     712    return "NetworkProcess";
     713#endif
     714}
     715
    694716void TestController::updateWebViewSizeForTest(const TestInvocation& test)
    695717{
     
    915937{
    916938    *returnData = static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody).leakRef();
     939}
     940
     941void TestController::networkProcessDidCrash(WKContextRef context, const void *clientInfo)
     942{
     943    static_cast<TestController*>(const_cast<void*>(clientInfo))->networkProcessDidCrash();
    917944}
    918945
     
    12011228}
    12021229
     1230// WKContextClient
     1231
     1232void TestController::networkProcessDidCrash()
     1233{
     1234#if PLATFORM(COCOA)
     1235    pid_t pid = WKContextGetNetworkProcessIdentifier(m_context.get());
     1236    fprintf(stderr, "#CRASHED - %s (pid %ld)\n", networkProcessName(), static_cast<long>(pid));
     1237#else
     1238    fprintf(stderr, "#CRASHED - %s\n", networkProcessName());
     1239#endif
     1240    exit(1);
     1241}
     1242
    12031243// WKPageNavigationClient
    12041244
  • trunk/Tools/WebKitTestRunner/TestController.h

    r179588 r179754  
    106106
    107107    static const char* webProcessName();
     108    static const char* networkProcessName();
    108109
    109110    WorkQueueManager& workQueueManager() { return m_workQueueManager; }
     
    151152    void didReceiveKeyDownMessageFromInjectedBundle(WKDictionaryRef messageBodyDictionary, bool synchronous);
    152153
     154    // WKContextClient
     155    static void networkProcessDidCrash(WKContextRef, const void*);
     156    void networkProcessDidCrash();
     157
    153158    // WKPageNavigationClient
    154159    static void didCommitNavigation(WKPageRef, WKNavigationRef, WKTypeRef userData, const void*);
Note: See TracChangeset for help on using the changeset viewer.