Changeset 195589 in webkit


Ignore:
Timestamp:
Jan 26, 2016 8:08:21 AM (8 years ago)
Author:
dbates@webkit.org
Message:

WebKitTestRunner: Credential cache is not cleared between tests
https://bugs.webkit.org/show_bug.cgi?id=153407
<rdar://problem/24280834>

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

Expose SPI to call CredentialStorage::clearCredentials() on the default network storage
session to clear cached credentials.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::clearCachedCredentials): Added.

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in: Added message ClearCachedCredentials().
  • UIProcess/API/C/WKContext.cpp:

(WKContextClearCachedCredentials): Added.

  • UIProcess/API/C/WKContextPrivate.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::clearCachedCredentials): Notify all web processes and the
network process to clear cached credentials.

  • UIProcess/WebProcessPool.h:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::clearCachedCredentials): Clear cached credentials in the default
network storage session.

  • WebProcess/WebProcess.h:
  • WebProcess/WebProcess.messages.in: Added message ClearCachedCredentials().

Tools:

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetStateToConsistentValues): Call WKContextClearCachedCredentials()
to clear cached credentials.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r195586 r195589  
     12016-01-26  Daniel Bates  <dabates@apple.com>
     2
     3        WebKitTestRunner: Credential cache is not cleared between tests
     4        https://bugs.webkit.org/show_bug.cgi?id=153407
     5        <rdar://problem/24280834>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        Expose SPI to call CredentialStorage::clearCredentials() on the default network storage
     10        session to clear cached credentials.
     11
     12        * NetworkProcess/NetworkProcess.cpp:
     13        (WebKit::NetworkProcess::clearCachedCredentials): Added.
     14        * NetworkProcess/NetworkProcess.h:
     15        * NetworkProcess/NetworkProcess.messages.in: Added message ClearCachedCredentials().
     16        * UIProcess/API/C/WKContext.cpp:
     17        (WKContextClearCachedCredentials): Added.
     18        * UIProcess/API/C/WKContextPrivate.h:
     19        * UIProcess/WebProcessPool.cpp:
     20        (WebKit::WebProcessPool::clearCachedCredentials): Notify all web processes and the
     21        network process to clear cached credentials.
     22        * UIProcess/WebProcessPool.h:
     23        * WebProcess/WebProcess.cpp:
     24        (WebKit::WebProcess::clearCachedCredentials): Clear cached credentials in the default
     25        network storage session.
     26        * WebProcess/WebProcess.h:
     27        * WebProcess/WebProcess.messages.in: Added message ClearCachedCredentials().
     28
    1292016-01-26  Mario Sanchez Prada  <mario@endlessm.com>
    230
  • trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp

    r195558 r195589  
    256256}
    257257
     258void NetworkProcess::clearCachedCredentials()
     259{
     260    NetworkStorageSession::defaultStorageSession().credentialStorage().clearCredentials();
     261}
     262
    258263void NetworkProcess::ensurePrivateBrowsingSession(SessionID sessionID)
    259264{
  • trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h

    r195558 r195589  
    147147    void deleteWebsiteDataForOrigins(WebCore::SessionID, uint64_t websiteDataTypes, const Vector<WebCore::SecurityOriginData>& origins, const Vector<String>& cookieHostNames, uint64_t callbackID);
    148148
     149    void clearCachedCredentials();
     150
    149151    // FIXME: This should take a session ID so we can identify which disk cache to delete.
    150152    void clearDiskCache(std::chrono::system_clock::time_point modifiedSince, std::function<void ()> completionHandler);
  • trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in

    r195558 r195589  
    3333#endif
    3434
     35    ClearCachedCredentials()
     36
    3537    EnsurePrivateBrowsingSession(WebCore::SessionID sessionID)
    3638    DestroyPrivateBrowsingSession(WebCore::SessionID sessionID)
  • trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp

    r195558 r195589  
    539539}
    540540
     541void WKContextClearCachedCredentials(WKContextRef context)
     542{
     543    toImpl(context)->clearCachedCredentials();
     544}
     545
    541546WKDictionaryRef WKContextCopyPlugInAutoStartOriginHashes(WKContextRef contextRef)
    542547{
  • trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h

    r195558 r195589  
    8383WK_EXPORT void WKContextUseTestingNetworkSession(WKContextRef context);
    8484
     85// Test only. Should be called before running a test.
     86WK_EXPORT void WKContextClearCachedCredentials(WKContextRef context);
     87
    8588typedef void (*WKContextInvalidMessageFunction)(WKStringRef messageName);
    8689WK_EXPORT void WKContextSetInvalidMessageFunction(WKContextInvalidMessageFunction invalidMessageFunction);
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp

    r195558 r195589  
    10741074}
    10751075
     1076void WebProcessPool::clearCachedCredentials()
     1077{
     1078    sendToAllProcesses(Messages::WebProcess::ClearCachedCredentials());
     1079    if (m_networkProcess)
     1080        m_networkProcess->send(Messages::NetworkProcess::ClearCachedCredentials(), 0);
     1081}
     1082
    10761083void WebProcessPool::allowSpecificHTTPSCertificateForHost(const WebCertificateInfo* certificate, const String& host)
    10771084{
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.h

    r195558 r195589  
    242242    bool isUsingTestingNetworkSession() const { return m_shouldUseTestingNetworkSession; }
    243243
     244    void clearCachedCredentials();
     245
    244246    void allowSpecificHTTPSCertificateForHost(const WebCertificateInfo*, const String& host);
    245247
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r195558 r195589  
    499499}
    500500
     501void WebProcess::clearCachedCredentials()
     502{
     503    NetworkStorageSession::defaultStorageSession().credentialStorage().clearCredentials();
     504}
     505
    501506WebPage* WebProcess::focusedWebPage() const
    502507{   
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r195558 r195589  
    211211    void platformInitializeWebProcess(WebProcessCreationParameters&&);
    212212
     213    void clearCachedCredentials();
     214
    213215    void platformTerminate();
    214216    void registerURLSchemeAsEmptyDocument(const String&);
  • trunk/Source/WebKit2/WebProcess/WebProcess.messages.in

    r195558 r195589  
    4545    UserPreferredLanguagesChanged(Vector<String> languages)
    4646    FullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled)
     47
     48    ClearCachedCredentials()
    4749
    4850    // Legacy private browsing session is per process. Individual pages or page groups may use the private session or the default one as appropriate.
  • trunk/Tools/ChangeLog

    r195587 r195589  
     12016-01-26  Daniel Bates  <dabates@apple.com>
     2
     3        WebKitTestRunner: Credential cache is not cleared between tests
     4        https://bugs.webkit.org/show_bug.cgi?id=153407
     5        <rdar://problem/24280834>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        * WebKitTestRunner/TestController.cpp:
     10        (WTR::TestController::resetStateToConsistentValues): Call WKContextClearCachedCredentials()
     11        to clear cached credentials.
     12
    1132016-01-26  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    214
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r195558 r195589  
    715715    WKContextSetCacheModel(TestController::singleton().context(), kWKCacheModelDocumentBrowser);
    716716
     717    WKContextClearCachedCredentials(TestController::singleton().context());
     718
    717719    // FIXME: This function should also ensure that there is only one page open.
    718720
Note: See TracChangeset for help on using the changeset viewer.