Skip to content
Permalink
Browse files
Telemetry for stalled webpage loads
https://bugs.webkit.org/show_bug.cgi?id=183221
<rdar://problem/36549013>

Reviewed by Chris Dumez.

Add telemetry for page loads, tracking the pages that succeed, fail,
or are canceled. This information will be used to track the overall
health of our page loading as time goes on.

Source/WebCore:

No new tests -- no new/changed user-level functionality.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
(WebCore::DiagnosticLoggingKeys::timedOutKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::occurredKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
* page/DiagnosticLoggingKeys.h:
* platform/network/cf/ResourceError.h:
(WebCore::ResourceError::ResourceError):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::getNSURLErrorDomain const):
(WebCore::ResourceError::getCFErrorDomainCFNetwork const):
(WebCore::ResourceError::mapPlatformError):

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::reportPageLoadResult):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::reportPageLoadResult):


Canonical link: https://commits.webkit.org/199318@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
keith-rollin committed Mar 15, 2018
1 parent 2276bfa commit 9cdf035add99318052d56d4ed818cf12659bff95
@@ -1,3 +1,42 @@
2018-03-15 Keith Rollin <krollin@apple.com>

Telemetry for stalled webpage loads
https://bugs.webkit.org/show_bug.cgi?id=183221
<rdar://problem/36549013>

Reviewed by Chris Dumez.

Add telemetry for page loads, tracking the pages that succeed, fail,
or are canceled. This information will be used to track the overall
health of our page loading as time goes on.

No new tests -- no new/changed user-level functionality.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
(WebCore::DiagnosticLoggingKeys::timedOutKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::occurredKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
(WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
* page/DiagnosticLoggingKeys.h:
* platform/network/cf/ResourceError.h:
(WebCore::ResourceError::ResourceError):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::getNSURLErrorDomain const):
(WebCore::ResourceError::getCFErrorDomainCFNetwork const):
(WebCore::ResourceError::mapPlatformError):

2018-03-15 Youenn Fablet <youenn@apple.com>

ActiveDOMObject should assert that they are destroyed in the thread they are created
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
* Copyright (C) 2012-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -565,6 +565,81 @@ String DiagnosticLoggingKeys::synchronousMessageFailedKey()
return ASCIILiteral("synchronousMessageFailed");
}

String DiagnosticLoggingKeys::telemetryPageLoadKey()
{
return ASCIILiteral("telemetryPageLoad");
}

String DiagnosticLoggingKeys::timedOutKey()
{
return ASCIILiteral("timedOut");
}

String DiagnosticLoggingKeys::canceledLessThan2SecondsKey()
{
return ASCIILiteral("canceledLessThan2Seconds");
}

String DiagnosticLoggingKeys::canceledLessThan5SecondsKey()
{
return ASCIILiteral("canceledLessThan5Seconds");
}

String DiagnosticLoggingKeys::canceledLessThan20SecondsKey()
{
return ASCIILiteral("canceledLessThan20Seconds");
}

String DiagnosticLoggingKeys::canceledMoreThan20SecondsKey()
{
return ASCIILiteral("canceledMoreThan20Seconds");
}

String DiagnosticLoggingKeys::failedLessThan2SecondsKey()
{
return ASCIILiteral("failedLessThan2Seconds");
}

String DiagnosticLoggingKeys::failedLessThan5SecondsKey()
{
return ASCIILiteral("failedLessThan5Seconds");
}

String DiagnosticLoggingKeys::failedLessThan20SecondsKey()
{
return ASCIILiteral("failedLessThan20Seconds");
}

String DiagnosticLoggingKeys::failedMoreThan20SecondsKey()
{
return ASCIILiteral("failedMoreThan20Seconds");
}

String DiagnosticLoggingKeys::occurredKey()
{
return ASCIILiteral("occurred");
}

String DiagnosticLoggingKeys::succeededLessThan2SecondsKey()
{
return ASCIILiteral("succeededLessThan2Seconds");
}

String DiagnosticLoggingKeys::succeededLessThan5SecondsKey()
{
return ASCIILiteral("succeededLessThan5Seconds");
}

String DiagnosticLoggingKeys::succeededLessThan20SecondsKey()
{
return ASCIILiteral("succeededLessThan20Seconds");
}

String DiagnosticLoggingKeys::succeededMoreThan20SecondsKey()
{
return ASCIILiteral("succeededMoreThan20Seconds");
}

String DiagnosticLoggingKeys::uncacheableStatusCodeKey()
{
return ASCIILiteral("uncacheableStatusCode");
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
* Copyright (C) 2012-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,6 +43,10 @@ class DiagnosticLoggingKeys {
static String cachedResourceRevalidationKey();
static String cachedResourceRevalidationReasonKey();
static String canCacheKey();
WEBCORE_EXPORT static String canceledLessThan2SecondsKey();
WEBCORE_EXPORT static String canceledLessThan5SecondsKey();
WEBCORE_EXPORT static String canceledLessThan20SecondsKey();
WEBCORE_EXPORT static String canceledMoreThan20SecondsKey();
static String cannotSuspendActiveDOMObjectsKey();
WEBCORE_EXPORT static String cpuUsageKey();
WEBCORE_EXPORT static String createSharedBufferFailedKey();
@@ -64,6 +68,10 @@ class DiagnosticLoggingKeys {
WEBCORE_EXPORT static String entryRightlyNotWarmedUpKey();
WEBCORE_EXPORT static String entryWronglyNotWarmedUpKey();
static String expiredKey();
WEBCORE_EXPORT static String failedLessThan2SecondsKey();
WEBCORE_EXPORT static String failedLessThan5SecondsKey();
WEBCORE_EXPORT static String failedLessThan20SecondsKey();
WEBCORE_EXPORT static String failedMoreThan20SecondsKey();
static String fontKey();
static String hasPluginsKey();
static String httpsNoStoreKey();
@@ -105,6 +113,7 @@ class DiagnosticLoggingKeys {
WEBCORE_EXPORT static String nonVisibleStateKey();
WEBCORE_EXPORT static String notHTTPFamilyKey();
static String notInMemoryCacheKey();
WEBCORE_EXPORT static String occurredKey();
WEBCORE_EXPORT static String otherKey();
static String pageCacheKey();
static String pageCacheFailureKey();
@@ -142,10 +151,16 @@ class DiagnosticLoggingKeys {
static String serviceWorkerKey();
WEBCORE_EXPORT static String streamingMedia();
static String styleSheetKey();
WEBCORE_EXPORT static String succeededLessThan2SecondsKey();
WEBCORE_EXPORT static String succeededLessThan5SecondsKey();
WEBCORE_EXPORT static String succeededLessThan20SecondsKey();
WEBCORE_EXPORT static String succeededMoreThan20SecondsKey();
WEBCORE_EXPORT static String successfulSpeculativeWarmupWithRevalidationKey();
WEBCORE_EXPORT static String successfulSpeculativeWarmupWithoutRevalidationKey();
static String svgDocumentKey();
WEBCORE_EXPORT static String synchronousMessageFailedKey();
WEBCORE_EXPORT static String telemetryPageLoadKey();
WEBCORE_EXPORT static String timedOutKey();
WEBCORE_EXPORT static String uncacheableStatusCodeKey();
static String underMemoryPressureKey();
WEBCORE_EXPORT static String unknownEntryRequestKey();
@@ -54,6 +54,10 @@ class ResourceError : public ResourceErrorBase {
: ResourceErrorBase(domain, errorCode, failingURL, localizedDescription, type)
, m_dataIsUpToDate(true)
{
#if PLATFORM(COCOA)
ASSERT(domain != getNSURLErrorDomain());
ASSERT(domain != getCFErrorDomainCFNetwork());
#endif
}

WEBCORE_EXPORT ResourceError(CFErrorRef error);
@@ -81,6 +85,11 @@ class ResourceError : public ResourceErrorBase {
private:
friend class ResourceErrorBase;

#if PLATFORM(COCOA)
WEBCORE_EXPORT const String& getNSURLErrorDomain() const;
WEBCORE_EXPORT const String& getCFErrorDomainCFNetwork() const;
WEBCORE_EXPORT void mapPlatformError();
#endif
void platformLazyInit();

void doPlatformIsolatedCopy(const ResourceError&);
@@ -30,6 +30,8 @@
#import <CoreFoundation/CFError.h>
#import <Foundation/Foundation.h>
#import <wtf/BlockObjCExceptions.h>
#import <wtf/NeverDestroyed.h>
#import <wtf/text/WTFString.h>

@interface NSError (WebExtras)
- (NSString *)_web_localizedDescription;
@@ -112,15 +114,43 @@ - (void)encodeWithCoder:(NSCoder *)coder
, m_dataIsUpToDate(false)
, m_platformError(nsError)
{
if (nsError)
setType(([m_platformError.get() code] == NSURLErrorTimedOut) ? Type::Timeout : Type::General);
mapPlatformError();
}

ResourceError::ResourceError(CFErrorRef cfError)
: ResourceError((NSError *)cfError)
{
}

const String& ResourceError::getNSURLErrorDomain() const
{
static const NeverDestroyed<String> errorDomain(NSURLErrorDomain);
return errorDomain.get();
}

const String& ResourceError::getCFErrorDomainCFNetwork() const
{
static const NeverDestroyed<String> errorDomain(kCFErrorDomainCFNetwork);
return errorDomain.get();
}

void ResourceError::mapPlatformError()
{
static_assert(NSURLErrorTimedOut == kCFURLErrorTimedOut, "NSURLErrorTimedOut needs to equal kCFURLErrorTimedOut");
static_assert(NSURLErrorCancelled == kCFURLErrorCancelled, "NSURLErrorCancelled needs to equal kCFURLErrorCancelled");

if (!m_platformError)
return;

auto domain = [m_platformError.get() domain];
auto errorCode = [m_platformError.get() code];

if ([domain isEqualToString:NSURLErrorDomain] || [domain isEqualToString:(__bridge NSString *)kCFErrorDomainCFNetwork])
setType((errorCode == NSURLErrorTimedOut) ? Type::Timeout : (errorCode == NSURLErrorCancelled) ? Type::Cancellation : Type::General);
else
setType(Type::General);
}

void ResourceError::platformLazyInit()
{
if (m_dataIsUpToDate)
@@ -1,3 +1,25 @@
2018-03-15 Keith Rollin <krollin@apple.com>

Telemetry for stalled webpage loads
https://bugs.webkit.org/show_bug.cgi?id=183221
<rdar://problem/36549013>

Reviewed by Chris Dumez.

Add telemetry for page loads, tracking the pages that succeed, fail,
or are canceled. This information will be used to track the overall
health of our page loading as time goes on.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::reportPageLoadResult):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::reportPageLoadResult):

2018-03-15 Wenson Hsieh <wenson_hsieh@apple.com>

[iOS WK2] Hit-testing fails when specifying a large top content inset

0 comments on commit 9cdf035

Please sign in to comment.