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

Changeset 211304 in webkit


Ignore:
Timestamp:
Jan 27, 2017, 3:11:17 PM (10 years ago)
Author:
Chris Dumez
Message:

Fix remaining bad uses of logDiagnosticMessageWithValue()
​https://bugs.webkit.org/show_bug.cgi?id=167526

Reviewed by Alex Christensen.

Source/WebCore:

Drop unused keys, add new ones.

  • page/DiagnosticLoggingKeys.cpp:

(WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
(WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
(WebCore::DiagnosticLoggingKeys::userZoomActionKey):
(WebCore::DiagnosticLoggingKeys::deltaKey): Deleted.
(WebCore::DiagnosticLoggingKeys::backNavigationKey): Deleted.
(WebCore::DiagnosticLoggingKeys::requestKey): Deleted.
(WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey): Deleted.
(WebCore::DiagnosticLoggingKeys::userKey): Deleted.
(WebCore::DiagnosticLoggingKeys::zoomedKey): Deleted.
(WebCore::DiagnosticLoggingKeys::notInCacheKey): Deleted.

  • page/DiagnosticLoggingKeys.h:

Source/WebKit2:

Fix remaining bad uses of logDiagnosticMessageWithValue(). It can only
be called with numeric values.

  • NetworkProcess/cache/NetworkCacheStatistics.cpp:

(WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
(WebKit::NetworkCache::Statistics::recordRetrievalFailure):
(WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):

  • UIProcess/WebBackForwardList.cpp:

(WebKit::WebBackForwardList::goToItem):

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::willStartUserTriggeredZooming):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r211303 r211304  
     12017-01-27  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix remaining bad uses of logDiagnosticMessageWithValue()
     4        https://bugs.webkit.org/show_bug.cgi?id=167526
     5
     6        Reviewed by Alex Christensen.
     7
     8        Drop unused keys, add new ones.
     9
     10        * page/DiagnosticLoggingKeys.cpp:
     11        (WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
     12        (WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
     13        (WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
     14        (WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
     15        (WebCore::DiagnosticLoggingKeys::userZoomActionKey):
     16        (WebCore::DiagnosticLoggingKeys::deltaKey): Deleted.
     17        (WebCore::DiagnosticLoggingKeys::backNavigationKey): Deleted.
     18        (WebCore::DiagnosticLoggingKeys::requestKey): Deleted.
     19        (WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey): Deleted.
     20        (WebCore::DiagnosticLoggingKeys::userKey): Deleted.
     21        (WebCore::DiagnosticLoggingKeys::zoomedKey): Deleted.
     22        (WebCore::DiagnosticLoggingKeys::notInCacheKey): Deleted.
     23        * page/DiagnosticLoggingKeys.h:
     24
    1252017-01-27  Myles C. Maxfield  <mmaxfield@apple.com>
    226
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp

    r211301 r211304  
    154154}
    155155
     156String DiagnosticLoggingKeys::networkCacheFailureReasonKey()
     157{
     158    return ASCIILiteral("networkCacheFailureReason");
     159}
     160
     161String DiagnosticLoggingKeys::networkCacheUnusedReasonKey()
     162{
     163    return ASCIILiteral("networkCacheUnusedReason");
     164}
     165
     166String DiagnosticLoggingKeys::networkCacheReuseFailureKey()
     167{
     168    return ASCIILiteral("networkCacheReuseFailure");
     169}
     170
    156171String DiagnosticLoggingKeys::networkKey()
    157172{
    … …  
    344359}
    345360
    346 String DiagnosticLoggingKeys::deltaKey()
    347 {
    348     return ASCIILiteral("delta");
    349 }
    350 
    351361String DiagnosticLoggingKeys::activeInForegroundTabKey()
    352362{
    … …  
    369379}
    370380
    371 String DiagnosticLoggingKeys::backNavigationKey()
    372 {
    373     return ASCIILiteral("backNavigation");
     381String DiagnosticLoggingKeys::backNavigationDeltaKey()
     382{
     383    return ASCIILiteral("backNavigationDelta");
    374384}
    375385
    … …  
    434444}
    435445
    436 String DiagnosticLoggingKeys::requestKey()
    437 {
    438     return ASCIILiteral("request");
    439 }
    440 
    441446String DiagnosticLoggingKeys::retrievalRequestKey()
    442447{
    … …  
    539544}
    540545
    541 String DiagnosticLoggingKeys::unusableCachedEntryKey()
    542 {
    543     return ASCIILiteral("unusableCachedEntry");
    544 }
    545 
    546546String DiagnosticLoggingKeys::unusedKey()
    547547{
    … …  
    589589}
    590590
    591 String DiagnosticLoggingKeys::userKey()
    592 {
    593     return ASCIILiteral("user");
     591String DiagnosticLoggingKeys::userZoomActionKey()
     592{
     593    return ASCIILiteral("userZoomAction");
    594594}
    595595
    … …  
    634634}
    635635
    636 String DiagnosticLoggingKeys::zoomedKey()
    637 {
    638     return ASCIILiteral("zoomed");
    639 }
    640 
    641636String DiagnosticLoggingKeys::expiredKey()
    642637{
    … …  
    677672{
    678673    return ASCIILiteral("notHTTPFamily");
    679 }
    680 
    681 String DiagnosticLoggingKeys::notInCacheKey()
    682 {
    683     return ASCIILiteral("notInCache");
    684674}
    685675
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.h

    r211301 r211304  
    3636    static String applicationCacheKey();
    3737    static String audioKey();
    38     WEBCORE_EXPORT static String backNavigationKey();
     38    WEBCORE_EXPORT static String backNavigationDeltaKey();
    3939    WEBCORE_EXPORT static String cacheControlNoStoreKey();
    4040    static String cachedResourceRevalidationKey();
    … …  
    4444    WEBCORE_EXPORT static String cpuUsageKey();
    4545    WEBCORE_EXPORT static String createSharedBufferFailedKey();
    46     WEBCORE_EXPORT static String deltaKey();
    4746    static String deniedByClientKey();
    4847    static String deviceMotionKey();
    … …  
    8483    WEBCORE_EXPORT static String needsRevalidationKey();
    8584    WEBCORE_EXPORT static String networkCacheKey();
     85    WEBCORE_EXPORT static String networkCacheFailureReasonKey();
     86    WEBCORE_EXPORT static String networkCacheUnusedReasonKey();
     87    WEBCORE_EXPORT static String networkCacheReuseFailureKey();
    8688    static String networkKey();
    8789    WEBCORE_EXPORT static String networkProcessCrashedKey();
    … …  
    9597    WEBCORE_EXPORT static String nonVisibleStateKey();
    9698    WEBCORE_EXPORT static String notHTTPFamilyKey();
    97     WEBCORE_EXPORT static String notInCacheKey();
    9899    static String notInMemoryCacheKey();
    99100    WEBCORE_EXPORT static String otherKey();
    … …  
    123124    static String reloadKey();
    124125    static String replaceKey();
    125     WEBCORE_EXPORT static String requestKey();
    126126    static String resourceLoadedKey();
    127127    static String resourceResponseSourceKey();
    … …  
    143143    WEBCORE_EXPORT static String unsupportedHTTPMethodKey();
    144144    static String unsuspendableDOMObjectKey();
    145     WEBCORE_EXPORT static String unusableCachedEntryKey();
    146145    WEBCORE_EXPORT static String unusedKey();
    147146    static String unusedReasonCredentialSettingsKey();
    … …  
    153152    static String unusedReasonTypeMismatchKey();
    154153    static String usedKey();
    155     WEBCORE_EXPORT static String userKey();
     154    WEBCORE_EXPORT static String userZoomActionKey();
    156155    WEBCORE_EXPORT static String varyingHeaderMismatchKey();
    157156    static String videoKey();
    … …  
    163162    WEBCORE_EXPORT static String webViewKey();
    164163    static String yesKey();
    165     WEBCORE_EXPORT static String zoomedKey();
    166164
    167165    WEBCORE_EXPORT static String memoryUsageToDiagnosticLoggingKey(uint64_t memoryUsage);
  • trunk/Source/WebKit2/ChangeLog

    r211295 r211304  
     12017-01-27  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix remaining bad uses of logDiagnosticMessageWithValue()
     4        https://bugs.webkit.org/show_bug.cgi?id=167526
     5
     6        Reviewed by Alex Christensen.
     7
     8        Fix remaining bad uses of logDiagnosticMessageWithValue(). It can only
     9        be called with numeric values.
     10
     11        * NetworkProcess/cache/NetworkCacheStatistics.cpp:
     12        (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
     13        (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
     14        (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
     15        * UIProcess/WebBackForwardList.cpp:
     16        (WebKit::WebBackForwardList::goToItem):
     17        * WebProcess/WebPage/ios/WebPageIOS.mm:
     18        (WebKit::WebPage::willStartUserTriggeredZooming):
     19
    1202017-01-27  Chris Dumez  <cdumez@apple.com>
    221
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp

    r208985 r211304  
    221221            String diagnosticKey = retrieveDecisionToDiagnosticKey(retrieveDecision);
    222222            LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was previously requested but we are not using the cache, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data());
    223             NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::unusedKey(), diagnosticKey, WebCore::ShouldSample::Yes);
     223            NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey(), diagnosticKey, WebCore::ShouldSample::Yes);
    224224        } else {
    225             NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::requestKey(), WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey(), WebCore::ShouldSample::Yes);
     225            NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey(), WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey(), WebCore::ShouldSample::Yes);
    226226            markAsRequested(hash);
    227227        }
    … …  
    261261            String diagnosticKey = storeDecisionToDiagnosticKey(storeDecision.value());
    262262            LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was previously request but is not in the cache, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data());
    263             NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::notInCacheKey(), diagnosticKey, WebCore::ShouldSample::Yes);
     263            NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey(), diagnosticKey, WebCore::ShouldSample::Yes);
    264264        } else {
    265             NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::requestKey(), WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey(), WebCore::ShouldSample::Yes);
     265            NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey(), WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey(), WebCore::ShouldSample::Yes);
    266266            markAsRequested(hash);
    267267        }
    … …  
    298298    if (decision == UseDecision::Validate) {
    299299        LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s is in the cache but needs revalidation", webPageID, requestURL.string().ascii().data());
    300         NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::retrievalKey(), WebCore::DiagnosticLoggingKeys::needsRevalidationKey(), WebCore::ShouldSample::Yes);
     300        NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::needsRevalidationKey(), WebCore::ShouldSample::Yes);
    301301        return;
    302302    }
    … …  
    304304    String diagnosticKey = cachedEntryReuseFailureToDiagnosticKey(decision);
    305305    LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s is in the cache but wasn't used, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data());
    306     NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey(), diagnosticKey, WebCore::ShouldSample::Yes);
     306    NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey(), diagnosticKey, WebCore::ShouldSample::Yes);
    307307}
    308308
  • trunk/Source/WebKit2/UIProcess/WebBackForwardList.cpp

    r208985 r211304  
    180180        unsigned delta = m_entries.size() - targetIndex - 1;
    181181        String deltaValue = delta > 10 ? ASCIILiteral("over10") : String::number(delta);
    182         m_page->logDiagnosticMessageWithValue(WebCore::DiagnosticLoggingKeys::backNavigationKey(), WebCore::DiagnosticLoggingKeys::deltaKey(), deltaValue, false /* shouldSample */);
     182        m_page->logDiagnosticMessage(WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey(), deltaValue, false /* shouldSample */);
    183183    }
    184184
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r211199 r211304  
    31283128void WebPage::willStartUserTriggeredZooming()
    31293129{
    3130     m_page->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::webViewKey(), DiagnosticLoggingKeys::userKey(), DiagnosticLoggingKeys::zoomedKey(), ShouldSample::No);
     3130    m_page->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::webViewKey(), DiagnosticLoggingKeys::userZoomActionKey(), ShouldSample::No);
    31313131    m_userHasChangedPageScaleFactor = true;
    31323132}
Note: See TracChangeset for help on using the changeset viewer.