Changeset 212691 in webkit


Ignore:
Timestamp:
Feb 20, 2017 5:48:10 PM (7 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r212685.

This change broke the 32-bit Sierra build.

Reverted changeset:

"Resource Load Statistics: Add alternate classification
method"
https://bugs.webkit.org/show_bug.cgi?id=168347
http://trac.webkit.org/changeset/212685

Location:
trunk
Files:
19 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r212686 r212691  
     12017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r212685.
     4
     5        This change broke the 32-bit Sierra build.
     6
     7        Reverted changeset:
     8
     9        "Resource Load Statistics: Add alternate classification
     10        method"
     11        https://bugs.webkit.org/show_bug.cgi?id=168347
     12        http://trac.webkit.org/changeset/212685
     13
    1142017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r212685 r212691  
    932932webkit.org/b/163782 media/video-played-ranges-1.html [ Crash Pass ]
    933933
    934 webkit.org/b/168171 http/tests/loading/resourceLoadStatistics [ Crash ]
     934webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html [ Crash ]
     935webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html [ Crash ]
     936webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html [ Crash ]
     937webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction.html [ Crash ]
     938webkit.org/b/168171 http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html [ Crash ]
    935939
    936940webkit.org/b/167576 imported/w3c/IndexedDB-private-browsing/idbcursor_iterating.html [ Crash ]
  • trunk/LayoutTests/platform/wk2/TestExpectations

    r212685 r212691  
    706706http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html [ Pass Timeout ]
    707707http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html [ Pass Timeout ]
    708 http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html [ Pass ]
    709 http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html [ Pass ]
    710 http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html [ Pass ]
    711 http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html [ Pass ]
    712 http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html [ Pass ]
    713 http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html [ Pass ]
    714 http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html [ Pass ]
    715 http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html [ Pass ]
    716708
    717709### END OF (5) Progressions, expected successes that are expected failures in WebKit1.
  • trunk/Source/WTF/ChangeLog

    r212685 r212691  
     12017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r212685.
     4
     5        This change broke the 32-bit Sierra build.
     6
     7        Reverted changeset:
     8
     9        "Resource Load Statistics: Add alternate classification
     10        method"
     11        https://bugs.webkit.org/show_bug.cgi?id=168347
     12        http://trac.webkit.org/changeset/212685
     13
    1142017-02-20  John Wilander  <wilander@apple.com>
    215
  • trunk/Source/WTF/wtf/Platform.h

    r212685 r212691  
    12091209#endif /* PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101201 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 */
    12101210
    1211 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
    1212 #define HAVE_CORE_PREDICTION 1
    1213 #endif
    1214 
    12151211#endif /* WTF_Platform_h */
  • trunk/Source/WebCore/ChangeLog

    r212689 r212691  
     12017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r212685.
     4
     5        This change broke the 32-bit Sierra build.
     6
     7        Reverted changeset:
     8
     9        "Resource Load Statistics: Add alternate classification
     10        method"
     11        https://bugs.webkit.org/show_bug.cgi?id=168347
     12        http://trac.webkit.org/changeset/212685
     13
    1142017-02-20  Sam Weinig  <sam@webkit.org>
    215
  • trunk/Source/WebCore/loader/ResourceLoadObserver.cpp

    r212685 r212691  
    376376}
    377377
    378 void ResourceLoadObserver::setSubframeUnderTopFrameOrigin(const URL& subframe, const URL& topFrame)
    379 {
    380     if (subframe.isBlankURL() || subframe.isEmpty() || topFrame.isBlankURL() || topFrame.isEmpty())
    381         return;
    382    
    383     auto& statistics = m_store->ensureResourceStatisticsForPrimaryDomain(primaryDomain(subframe));
    384     statistics.subframeUnderTopFrameOrigins.add(primaryDomain(topFrame));
    385 }
    386 
    387 void ResourceLoadObserver::setSubresourceUnderTopFrameOrigin(const URL& subresource, const URL& topFrame)
    388 {
    389     if (subresource.isBlankURL() || subresource.isEmpty() || topFrame.isBlankURL() || topFrame.isEmpty())
    390         return;
    391    
    392     auto& statistics = m_store->ensureResourceStatisticsForPrimaryDomain(primaryDomain(subresource));
    393     statistics.subresourceUnderTopFrameOrigins.add(primaryDomain(topFrame));
    394 }
    395 
    396 void ResourceLoadObserver::setSubresourceUniqueRedirectTo(const URL& subresource, const URL& hostNameRedirectedTo)
    397 {
    398     if (subresource.isBlankURL() || subresource.isEmpty() || hostNameRedirectedTo.isBlankURL() || hostNameRedirectedTo.isEmpty())
    399         return;
    400    
    401     auto& statistics = m_store->ensureResourceStatisticsForPrimaryDomain(primaryDomain(subresource));
    402     statistics.subresourceUniqueRedirectsTo.add(primaryDomain(hostNameRedirectedTo));
    403 }
    404 
    405378void ResourceLoadObserver::setTimeToLiveUserInteraction(double seconds)
    406379{
  • trunk/Source/WebCore/loader/ResourceLoadObserver.h

    r212685 r212691  
    5959    WEBCORE_EXPORT void clearPrevalentResource(const URL&);
    6060
    61     WEBCORE_EXPORT void setSubframeUnderTopFrameOrigin(const URL& subframe, const URL& topFrame);
    62     WEBCORE_EXPORT void setSubresourceUnderTopFrameOrigin(const URL& subresource, const URL& topFrame);
    63     WEBCORE_EXPORT void setSubresourceUniqueRedirectTo(const URL& subresource, const URL& hostNameRedirectedTo);
    64 
    6561    WEBCORE_EXPORT void setTimeToLiveUserInteraction(double seconds);
    6662    WEBCORE_EXPORT void setReducedTimestampResolution(double seconds);
  • trunk/Source/WebKit2/ChangeLog

    r212685 r212691  
     12017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r212685.
     4
     5        This change broke the 32-bit Sierra build.
     6
     7        Reverted changeset:
     8
     9        "Resource Load Statistics: Add alternate classification
     10        method"
     11        https://bugs.webkit.org/show_bug.cgi?id=168347
     12        http://trac.webkit.org/changeset/212685
     13
    1142017-02-20  John Wilander  <wilander@apple.com>
    215
  • trunk/Source/WebKit2/Configurations/BaseTarget.xcconfig

    r212685 r212691  
    3333WK_PRIVATE_FRAMEWORKS_DIR_iphoneos_NO = $(PRODUCTION_FRAMEWORKS_DIR);
    3434
    35 FRAMEWORK_SEARCH_PATHS_base = "$(UMBRELLA_FRAMEWORKS_DIR)" /System/Library/PrivateFrameworks $(FRAMEWORK_SEARCH_PATHS);
     35FRAMEWORK_SEARCH_PATHS_base = "$(UMBRELLA_FRAMEWORKS_DIR)" $(FRAMEWORK_SEARCH_PATHS);
    3636FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(FRAMEWORK_SEARCH_PATHS_base) $(WK_PRIVATE_FRAMEWORKS_DIR);
    3737FRAMEWORK_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS_base);
  • trunk/Source/WebKit2/Configurations/WebKit.xcconfig

    r212685 r212691  
    3535DYLIB_INSTALL_NAME_BASE = $(NORMAL_WEBKIT_FRAMEWORKS_DIR);
    3636
    37 FRAMEWORK_AND_LIBRARY_LDFLAGS_BASE_ios = -lobjc -framework AssertionServices -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CorePDF -framework CorePrediction -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework UIKit -framework OpenGLES -framework MobileCoreServices -lMobileGestalt $(FRAMEWORK_AND_LIBRARY_LDFLAGS_PLATFORM_$(PLATFORM_NAME));
     37FRAMEWORK_AND_LIBRARY_LDFLAGS_BASE_ios = -lobjc -framework AssertionServices -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CorePDF -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework UIKit -framework OpenGLES -framework MobileCoreServices -lMobileGestalt $(FRAMEWORK_AND_LIBRARY_LDFLAGS_PLATFORM_$(PLATFORM_NAME));
    3838FRAMEWORK_AND_LIBRARY_LDFLAGS[sdk=iphoneos*] = $(FRAMEWORK_AND_LIBRARY_LDFLAGS_BASE_ios) -framework IOSurface;
    3939FRAMEWORK_AND_LIBRARY_LDFLAGS[sdk=iphonesimulator*] = $(FRAMEWORK_AND_LIBRARY_LDFLAGS_BASE_ios);
    4040FRAMEWORK_AND_LIBRARY_LDFLAGS_PLATFORM_iphoneos = ;
    4141FRAMEWORK_AND_LIBRARY_LDFLAGS_PLATFORM_iphonesimulator = ;
    42 FRAMEWORK_AND_LIBRARY_LDFLAGS[sdk=macosx*] = -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreServices -framework IOKit -framework CoreAudio -framework IOSurface -framework OpenGL $(EXTRA_FRAMEWORK_AND_LIBRARY_LDFLAGS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
    43 EXTRA_FRAMEWORK_AND_LIBRARY_LDFLAGS_101200 = -framework CorePrediction;
    44 EXTRA_FRAMEWORK_AND_LIBRARY_LDFLAGS_101300 = -framework CorePrediction;
     42FRAMEWORK_AND_LIBRARY_LDFLAGS[sdk=macosx*] = -framework ApplicationServices -framework Carbon -framework Cocoa -framework CoreServices -framework IOKit -framework CoreAudio -framework IOSurface -framework OpenGL;
    4543
    4644// Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols.
  • trunk/Source/WebKit2/PlatformGTK.cmake

    r212685 r212691  
    4646    Platform/IPC/unix/AttachmentUnix.cpp
    4747    Platform/IPC/unix/ConnectionUnix.cpp
    48 
    49     Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp
    5048
    5149    Platform/glib/ModuleGlib.cpp
     
    855853    "${WEBKIT2_DIR}/NetworkProcess/unix"
    856854    "${WEBKIT2_DIR}/Platform/IPC/glib"
    857     "${WEBKIT2_DIR}/Platform/classifier"
    858855    "${WEBKIT2_DIR}/Shared/API/c/gtk"
    859856    "${WEBKIT2_DIR}/Shared/Plugins/unix"
  • trunk/Source/WebKit2/PlatformMac.cmake

    r212685 r212691  
    4949
    5050    Platform/cg/CGUtilities.cpp
    51 
    52     Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp
    53 
    54     Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp
    5551
    5652    Platform/foundation/LoggingFoundation.mm
     
    397393    "${WEBKIT2_DIR}/UIProcess/ios"
    398394    "${WEBKIT2_DIR}/Platform/cg"
    399     "${WEBKIT2_DIR}/Platform/classifier"
    400     "${WEBKIT2_DIR}/Platform/classifier/cocoa"
    401395    "${WEBKIT2_DIR}/Platform/mac"
    402396    "${WEBKIT2_DIR}/Platform/unix"
  • trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp

    r212685 r212691  
    5757}
    5858
    59 void WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName)
    60 {
    61     WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin(toWTFString(hostName), toWTFString(topFrameHostName));
    62 }
    63 
    64 void WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName)
    65 {
    66     WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin(toWTFString(hostName), toWTFString(topFrameHostName));
    67 }
    68 
    69 void WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo)
    70 {
    71     WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo(toWTFString(hostName), toWTFString(hostNameRedirectedTo));
    72 }
    73 
    7459void WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction(double seconds)
    7560{
  • trunk/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h

    r212685 r212691  
    3939    WK_EXPORT void WKResourceLoadStatisticsManagerSetHasHadUserInteraction(WKStringRef hostName, bool value);
    4040    WK_EXPORT bool WKResourceLoadStatisticsManagerIsHasHadUserInteraction(WKStringRef hostName);
    41     WK_EXPORT void WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
    42     WK_EXPORT void WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
    43     WK_EXPORT void WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo);
    4441    WK_EXPORT void WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction(double seconds);
    4542    WK_EXPORT void WKResourceLoadStatisticsManagerSetReducedTimestampResolution(double seconds);
  • trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.cpp

    r212685 r212691  
    6262}
    6363
    64 void WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin(const String& hostName, const String& topFrameHostName)
    65 {
    66     WebCore::ResourceLoadObserver::sharedObserver().setSubframeUnderTopFrameOrigin(URL(URL(), hostName), URL(URL(), topFrameHostName));
    67 }
    68 
    69 void WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin(const String& hostName, const String& topFrameHostName)
    70 {
    71     WebCore::ResourceLoadObserver::sharedObserver().setSubresourceUnderTopFrameOrigin(URL(URL(), hostName), URL(URL(), topFrameHostName));
    72 }
    73 
    74 void WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo(const String& hostName, const String& hostNameRedirectedTo)
    75 {
    76     WebCore::ResourceLoadObserver::sharedObserver().setSubresourceUniqueRedirectTo(URL(URL(), hostName), URL(URL(), hostNameRedirectedTo));
    77 }
    78 
    7964void WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction(double seconds)
    8065{
  • trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsManager.h

    r212685 r212691  
    4343    static void setHasHadUserInteraction(const String& hostName, bool value);
    4444    static bool hasHadUserInteraction(const String& hostName);
    45     static void setSubframeUnderTopFrameOrigin(const String& hostName, const String& topFrameHostName);
    46     static void setSubresourceUnderTopFrameOrigin(const String& hostName, const String& topFrameHostName);
    47     static void setSubresourceUniqueRedirectTo(const String& hostName, const String& hostNameRedirectedTo);
    4845    static void setTimeToLiveUserInteraction(double seconds);
    4946    static void setReducedTimestampResolution(double seconds);
  • trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp

    r212685 r212691  
    4646namespace WebKit {
    4747
     48static const auto featureVectorLengthThreshold = 3;
    4849static auto minimumTimeBetweeenDataRecordsRemoval = 60;
    4950static OptionSet<WebKit::WebsiteDataType> dataTypesToRemove;
     
    5960    : m_resourceLoadStatisticsStore(ResourceLoadStatisticsStore::create())
    6061    , m_statisticsQueue(WorkQueue::create("WebResourceLoadStatisticsStore Process Data Queue"))
    61     , m_statisticsStoragePath(resourceLoadStatisticsDirectory)
     62    , m_storagePath(resourceLoadStatisticsDirectory)
    6263{
    6364}
     
    8384}
    8485
     86bool WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics(const ResourceLoadStatistics& resourceStatistic)
     87{
     88    auto subresourceUnderTopFrameOriginsCount = resourceStatistic.subresourceUnderTopFrameOrigins.size();
     89    auto subresourceUniqueRedirectsToCount = resourceStatistic.subresourceUniqueRedirectsTo.size();
     90    auto subframeUnderTopFrameOriginsCount = resourceStatistic.subframeUnderTopFrameOrigins.size();
     91   
     92    if (!subresourceUnderTopFrameOriginsCount
     93        && !subresourceUniqueRedirectsToCount
     94        && !subframeUnderTopFrameOriginsCount)
     95        return false;
     96
     97    if (subresourceUnderTopFrameOriginsCount > featureVectorLengthThreshold
     98        || subresourceUniqueRedirectsToCount > featureVectorLengthThreshold
     99        || subframeUnderTopFrameOriginsCount > featureVectorLengthThreshold)
     100        return true;
     101
     102    // The resource is considered prevalent if the feature vector
     103    // is longer than the threshold.
     104    // Vector length for n dimensions is sqrt(a^2 + (...) + n^2).
     105    double vectorLength = 0;
     106    vectorLength += subresourceUnderTopFrameOriginsCount * subresourceUnderTopFrameOriginsCount;
     107    vectorLength += subresourceUniqueRedirectsToCount * subresourceUniqueRedirectsToCount;
     108    vectorLength += subframeUnderTopFrameOriginsCount * subframeUnderTopFrameOriginsCount;
     109
     110    ASSERT(vectorLength > 0);
     111
     112    return sqrt(vectorLength) > featureVectorLengthThreshold;
     113}
     114   
    85115void WebResourceLoadStatisticsStore::classifyResource(ResourceLoadStatistics& resourceStatistic)
    86116{
    87     if (!resourceStatistic.isPrevalentResource
    88         && m_resourceLoadStatisticsClassifier.hasPrevalentResourceCharacteristics(resourceStatistic))
     117    if (!resourceStatistic.isPrevalentResource && hasPrevalentResourceCharacteristics(resourceStatistic)) {
    89118        resourceStatistic.isPrevalentResource = true;
     119    }
    90120}
    91121
     
    219249String WebResourceLoadStatisticsStore::persistentStoragePath(const String& label) const
    220250{
    221     if (m_statisticsStoragePath.isEmpty())
     251    if (m_storagePath.isEmpty())
    222252        return emptyString();
    223253
    224254    // TODO Decide what to call this file
    225     return pathByAppendingComponent(m_statisticsStoragePath, label + "_resourceLog.plist");
     255    return pathByAppendingComponent(m_storagePath, label + "_resourceLog.plist");
    226256}
    227257
     
    236266        return;
    237267
    238     if (!m_statisticsStoragePath.isEmpty())
    239         makeAllDirectories(m_statisticsStoragePath);
     268    if (!m_storagePath.isEmpty())
     269        makeAllDirectories(m_storagePath);
    240270
    241271    auto handle = openFile(resourceLog, OpenForWrite);
  • trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.h

    r212685 r212691  
    2929#include "APIObject.h"
    3030#include "Connection.h"
    31 #include "ResourceLoadStatisticsClassifier.h"
    3231#include "WebsiteDataRecord.h"
    3332#include <WebCore/ResourceLoadStatisticsStore.h>
     
    7877    void processStatisticsAndDataRecords();
    7978
     79    bool hasPrevalentResourceCharacteristics(const WebCore::ResourceLoadStatistics&);
    8080    void classifyResource(WebCore::ResourceLoadStatistics&);
    8181    void removeDataRecords();
     
    9090
    9191    Ref<WebCore::ResourceLoadStatisticsStore> m_resourceLoadStatisticsStore;
    92     ResourceLoadStatisticsClassifier m_resourceLoadStatisticsClassifier;
    9392    Ref<WTF::WorkQueue> m_statisticsQueue;
    94     String m_statisticsStoragePath;
     93    String m_storagePath;
    9594    bool m_resourceLoadStatisticsEnabled { false };
    9695
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r212685 r212691  
    11491149                659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */; };
    11501150                65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1151                 6B2E09BA1E57B88100C8A8B9 /* CorePredictionSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B2E09B91E57B88100C8A8B9 /* CorePredictionSPI.h */; };
    11521151                6BE9699C1E43B3FF008B7483 /* WKResourceLoadStatisticsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE9699B1E43B3FF008B7483 /* WKResourceLoadStatisticsManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11531152                6BE9699E1E43B41D008B7483 /* WKResourceLoadStatisticsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BE9699D1E43B41D008B7483 /* WKResourceLoadStatisticsManager.cpp */; };
    11541153                6BE969A01E43B86E008B7483 /* WebResourceLoadStatisticsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE9699F1E43B86E008B7483 /* WebResourceLoadStatisticsManager.h */; };
    11551154                6BE969A21E43B8A4008B7483 /* WebResourceLoadStatisticsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BE969A11E43B8A4008B7483 /* WebResourceLoadStatisticsManager.cpp */; };
    1156                 6BE969C11E54D452008B7483 /* corePrediction_model in Resources */ = {isa = PBXBuildFile; fileRef = 6BE969C01E54D452008B7483 /* corePrediction_model */; };
    1157                 6BE969C51E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969C41E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h */; };
    1158                 6BE969C71E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BE969C61E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp */; };
    1159                 6BE969CA1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BE969C81E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp */; };
    1160                 6BE969CB1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */; };
    1161                 6BE969CD1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h */; };
    11621155                6EE849C81368D9390038D481 /* WKInspectorPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11631156                728E86F11795188C0087879E /* WebColorPickerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 728E86EF1795188C0087879E /* WebColorPickerMac.h */; };
     
    33463339                65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleInspector.cpp; sourceTree = "<group>"; };
    33473340                65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleInspector.h; sourceTree = "<group>"; };
    3348                 6B2E09B91E57B88100C8A8B9 /* CorePredictionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePredictionSPI.h; sourceTree = "<group>"; };
    33493341                6BE9699B1E43B3FF008B7483 /* WKResourceLoadStatisticsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKResourceLoadStatisticsManager.h; sourceTree = "<group>"; };
    33503342                6BE9699D1E43B41D008B7483 /* WKResourceLoadStatisticsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKResourceLoadStatisticsManager.cpp; sourceTree = "<group>"; };
    33513343                6BE9699F1E43B86E008B7483 /* WebResourceLoadStatisticsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadStatisticsManager.h; sourceTree = "<group>"; };
    33523344                6BE969A11E43B8A4008B7483 /* WebResourceLoadStatisticsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceLoadStatisticsManager.cpp; sourceTree = "<group>"; };
    3353                 6BE969C01E54D452008B7483 /* corePrediction_model */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = corePrediction_model; sourceTree = "<group>"; };
    3354                 6BE969C41E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifier.h; sourceTree = "<group>"; };
    3355                 6BE969C61E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatisticsClassifierBase.cpp; sourceTree = "<group>"; };
    3356                 6BE969C81E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatisticsClassifierCocoa.cpp; sourceTree = "<group>"; };
    3357                 6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifierCocoa.h; sourceTree = "<group>"; };
    3358                 6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifierBase.h; sourceTree = "<group>"; };
    33593345                6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb.in; path = WebProcess/com.apple.WebProcess.sb.in; sourceTree = "<group>"; };
    33603346                6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKInspectorPrivateMac.h; path = mac/WKInspectorPrivateMac.h; sourceTree = "<group>"; };
     
    43694355                        isa = PBXGroup;
    43704356                        children = (
    4371                                 6BE969BF1E54D452008B7483 /* ResourceLoadStatistics */,
    43724357                                37F8C94F1AE22BD8007DAB9E /* mac */,
    43734358                                7CB16FE11724B9B5007A0A95 /* PlugInSandboxProfiles */,
     
    61316116                        sourceTree = "<group>";
    61326117                };
    6133                 6BE969BF1E54D452008B7483 /* ResourceLoadStatistics */ = {
    6134                         isa = PBXGroup;
    6135                         children = (
    6136                                 6BE969C01E54D452008B7483 /* corePrediction_model */,
    6137                         );
    6138                         name = ResourceLoadStatistics;
    6139                         path = Resources/ResourceLoadStatistics;
    6140                         sourceTree = "<group>";
    6141                 };
    6142                 6BE969C21E54D467008B7483 /* classifier */ = {
    6143                         isa = PBXGroup;
    6144                         children = (
    6145                                 6BE969C31E54D467008B7483 /* cocoa */,
    6146                                 6BE969C61E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp */,
    6147                                 6BE969C41E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h */,
    6148                                 6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h */,
    6149                         );
    6150                         path = classifier;
    6151                         sourceTree = "<group>";
    6152                 };
    6153                 6BE969C31E54D467008B7483 /* cocoa */ = {
    6154                         isa = PBXGroup;
    6155                         children = (
    6156                                 6BE969C81E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp */,
    6157                                 6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */,
    6158                                 6B2E09B91E57B88100C8A8B9 /* CorePredictionSPI.h */,
    6159                         );
    6160                         path = cocoa;
    6161                         sourceTree = "<group>";
    6162                 };
    61636118                6EE849C41368D9040038D481 /* mac */ = {
    61646119                        isa = PBXGroup;
     
    70617016                        isa = PBXGroup;
    70627017                        children = (
    7063                                 6BE969C21E54D467008B7483 /* classifier */,
    70647018                                3709504118A88BA40087AE5D /* cf */,
    70657019                                1AA2E51A12E4C05600BC4966 /* cg */,
     
    79447898                                7C1BA33E1A4A0E600043E249 /* APIDictionary.h in Headers */,
    79457899                                1F7D36C118DA513F00D9D659 /* APIDownloadClient.h in Headers */,
    7946                                 6BE969CB1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h in Headers */,
    79477900                                516A4A5D120A2CCD00C05B7F /* APIError.h in Headers */,
    79487901                                317FE7C51C487A6C00A0CA89 /* APIExperimentalFeature.h in Headers */,
     
    83658318                                BC1DD7B2114DC396005ADAF3 /* WebCoreArgumentCoders.h in Headers */,
    83668319                                512F589B12A8838800629530 /* WebCredential.h in Headers */,
    8367                                 6BE969C51E54D4A4008B7483 /* ResourceLoadStatisticsClassifier.h in Headers */,
    83688320                                1AA83F6D1A5B63FF00026EC6 /* WebDatabaseProvider.h in Headers */,
    83698321                                CD19A26E1A13E834008D650E /* WebDiagnosticLoggingClient.h in Headers */,
     
    84518403                                7C4694D11A51E36800AD5845 /* WebPasteboardProxy.h in Headers */,
    84528404                                7C4694CA1A4B4EA100AD5845 /* WebPasteboardProxyMessages.h in Headers */,
    8453                                 6B2E09BA1E57B88100C8A8B9 /* CorePredictionSPI.h in Headers */,
    84548405                                1AB1F7971D1B3613007C9BD1 /* WebPaymentCoordinatorMessages.h in Headers */,
    84558406                                1AB1F78C1D1B3355007C9BD1 /* WebPaymentCoordinatorProxy.h in Headers */,
     
    85708521                                1AB474D8184D43FD0051B622 /* WKBundlePageLoaderClient.h in Headers */,
    85718522                                ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */,
    8572                                 6BE969CD1E54E054008B7483 /* ResourceLoadStatisticsClassifierBase.h in Headers */,
    85738523                                1AB474EA184D45130051B622 /* WKBundlePagePolicyClient.h in Headers */,
    85748524                                BC1B419811D41D570011E8DD /* WKBundlePagePrivate.h in Headers */,
     
    91049054                                8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
    91059055                                93A2A3461D246125002B59D3 /* mediaIcon.pdf in Resources */,
    9106                                 6BE969C11E54D452008B7483 /* corePrediction_model in Resources */,
    91079056                        );
    91089057                        runOnlyForDeploymentPostprocessing = 0;
     
    96939642                                5163199416289A6000E22F00 /* NetworkProcessMessageReceiver.cpp in Sources */,
    96949643                                E14A954916E016A40068DE82 /* NetworkProcessPlatformStrategies.cpp in Sources */,
    9695                                 6BE969CA1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp in Sources */,
    96969644                                5179556D162877B100FA43B6 /* NetworkProcessProxy.cpp in Sources */,
    96979645                                516319921628980A00E22F00 /* NetworkProcessProxyMac.mm in Sources */,
     
    100389986                                BCC43AC7127B99DE00317F16 /* WebPopupMenuMac.mm in Sources */,
    100399987                                BC5750981268F3C6006F0F12 /* WebPopupMenuProxyMac.mm in Sources */,
    10040                                 6BE969C71E54D4B6008B7483 /* ResourceLoadStatisticsClassifierBase.cpp in Sources */,
    100419988                                BCD59800112B57BE00EC8C23 /* WebPreferences.cpp in Sources */,
    100429989                                7C85FD7F19341665000177C4 /* WebPreferencesKeys.cpp in Sources */,
  • trunk/Tools/ChangeLog

    r212685 r212691  
     12017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r212685.
     4
     5        This change broke the 32-bit Sierra build.
     6
     7        Reverted changeset:
     8
     9        "Resource Load Statistics: Add alternate classification
     10        method"
     11        https://bugs.webkit.org/show_bug.cgi?id=168347
     12        http://trac.webkit.org/changeset/212685
     13
    1142017-02-20  John Wilander  <wilander@apple.com>
    215
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r212685 r212691  
    254254    void setStatisticsHasHadUserInteraction(DOMString hostName, boolean value);
    255255    boolean isStatisticsHasHadUserInteraction(DOMString hostName);
    256     void setStatisticsSubframeUnderTopFrameOrigin(DOMString hostName, DOMString topFrameHostName);
    257     void setStatisticsSubresourceUnderTopFrameOrigin(DOMString hostName, DOMString topFrameHostName);
    258     void setStatisticsSubresourceUniqueRedirectTo(DOMString hostName, DOMString hostNameRedirectedTo);
    259256    void setStatisticsTimeToLiveUserInteraction(double seconds);
    260257    void statisticsFireDataModificationHandler();
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r212685 r212691  
    12271227}
    12281228
    1229 void TestRunner::setStatisticsSubframeUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName)
     1229void TestRunner::setStatisticsTimeToLiveUserInteraction(double seconds)
     1230{
     1231    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsTimeToLiveUserInteraction"));
     1232    WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(seconds));
     1233    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     1234}
     1235
     1236void TestRunner::installStatisticsDidModifyDataRecordsCallback(JSValueRef callback)
     1237{
     1238    cacheTestRunnerCallback(StatisticsDidModifyDataRecordsCallbackID, callback);
     1239}
     1240
     1241void TestRunner::statisticsDidModifyDataRecordsCallback()
     1242{
     1243    callTestRunnerCallback(StatisticsDidModifyDataRecordsCallbackID);
     1244}
     1245
     1246void TestRunner::statisticsFireDataModificationHandler()
     1247{
     1248    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsFireDataModificationHandler"));
     1249    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr);
     1250}
     1251
     1252void TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool value)
     1253{
     1254    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsNotifyPagesWhenDataRecordsWereScanned"));
     1255    WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1256    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     1257}
     1258
     1259void TestRunner::setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(bool value)
     1260{
     1261    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsShouldClassifyResourcesBeforeDataRecordsRemoval"));
     1262    WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
     1263    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     1264}
     1265
     1266void TestRunner::setStatisticsMinimumTimeBetweeenDataRecordsRemoval(double seconds)
     1267{
     1268    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsMinimumTimeBetweeenDataRecordsRemoval"));
     1269    WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(seconds));
     1270    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     1271}
     1272   
     1273void TestRunner::statisticsResetToConsistentState()
     1274{
     1275    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsResetToConsistentState"));
     1276    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr);
     1277}
     1278
     1279#if PLATFORM(MAC)
     1280void TestRunner::connectMockGamepad(unsigned index)
     1281{
     1282    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ConnectMockGamepad"));
     1283    WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(index));
     1284
     1285    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     1286}
     1287
     1288void TestRunner::disconnectMockGamepad(unsigned index)
     1289{
     1290    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DisconnectMockGamepad"));
     1291    WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(index));
     1292
     1293    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
     1294}
     1295
     1296void TestRunner::setMockGamepadDetails(unsigned index, JSStringRef gamepadID, unsigned axisCount, unsigned buttonCount)
    12301297{
    12311298    Vector<WKRetainPtr<WKStringRef>> keys;
    12321299    Vector<WKRetainPtr<WKTypeRef>> values;
    1233    
    1234     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1235     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1236    
    1237     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("TopFrameHostName") });
    1238     values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHostName) });
    1239    
     1300
     1301    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadID") });
     1302    values.append(toWK(gamepadID));
     1303
     1304    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
     1305    values.append({ AdoptWK, WKUInt64Create(index) });
     1306
     1307    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("AxisCount") });
     1308    values.append({ AdoptWK, WKUInt64Create(axisCount) });
     1309
     1310    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ButtonCount") });
     1311    values.append({ AdoptWK, WKUInt64Create(buttonCount) });
     1312
    12401313    Vector<WKStringRef> rawKeys;
    12411314    Vector<WKTypeRef> rawValues;
    12421315    rawKeys.resize(keys.size());
    12431316    rawValues.resize(values.size());
    1244    
     1317
    12451318    for (size_t i = 0; i < keys.size(); ++i) {
    12461319        rawKeys[i] = keys[i].get();
    12471320        rawValues[i] = values[i].get();
    12481321    }
    1249    
    1250     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsSubframeUnderTopFrameOrigin"));
     1322
     1323    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGamepadDetails"));
    12511324    WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1325
    12521326    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    12531327}
    12541328
    1255 void TestRunner::setStatisticsSubresourceUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName)
     1329void TestRunner::setMockGamepadAxisValue(unsigned index, unsigned axisIndex, double value)
    12561330{
    12571331    Vector<WKRetainPtr<WKStringRef>> keys;
    12581332    Vector<WKRetainPtr<WKTypeRef>> values;
    1259    
    1260     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1261     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1262    
    1263     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("TopFrameHostName") });
    1264     values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHostName) });
    1265    
     1333
     1334    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
     1335    values.append({ AdoptWK, WKUInt64Create(index) });
     1336
     1337    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("AxisIndex") });
     1338    values.append({ AdoptWK, WKUInt64Create(axisIndex) });
     1339
     1340    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
     1341    values.append({ AdoptWK, WKDoubleCreate(value) });
     1342
    12661343    Vector<WKStringRef> rawKeys;
    12671344    Vector<WKTypeRef> rawValues;
    12681345    rawKeys.resize(keys.size());
    12691346    rawValues.resize(values.size());
    1270    
     1347
    12711348    for (size_t i = 0; i < keys.size(); ++i) {
    12721349        rawKeys[i] = keys[i].get();
    12731350        rawValues[i] = values[i].get();
    12741351    }
    1275    
    1276     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsSubresourceUnderTopFrameOrigin"));
     1352
     1353    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGamepadAxisValue"));
    12771354    WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
     1355
    12781356    WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    12791357}
    12801358
    1281 void TestRunner::setStatisticsSubresourceUniqueRedirectTo(JSStringRef hostName, JSStringRef hostNameRedirectedTo)
     1359void TestRunner::setMockGamepadButtonValue(unsigned index, unsigned buttonIndex, double value)
    12821360{
    12831361    Vector<WKRetainPtr<WKStringRef>> keys;
    12841362    Vector<WKRetainPtr<WKTypeRef>> values;
    1285    
    1286     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostName") });
    1287     values.append({ AdoptWK, WKStringCreateWithJSString(hostName) });
    1288    
    1289     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedTo") });
    1290     values.append({ AdoptWK, WKStringCreateWithJSString(hostNameRedirectedTo) });
    1291    
     1363
     1364    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
     1365    values.append({ AdoptWK, WKUInt64Create(index) });
     1366
     1367    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ButtonIndex") });
     1368    values.append({ AdoptWK, WKUInt64Create(buttonIndex) });
     1369
     1370    keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
     1371    values.append({ AdoptWK, WKDoubleCreate(value) });
     1372
    12921373    Vector<WKStringRef> rawKeys;
    12931374    Vector<WKTypeRef> rawValues;
    12941375    rawKeys.resize(keys.size());
    12951376    rawValues.resize(values.size());
    1296    
     1377
    12971378    for (size_t i = 0; i < keys.size(); ++i) {
    12981379        rawKeys[i] = keys[i].get();
    12991380        rawValues[i] = values[i].get();
    13001381    }
    1301    
    1302     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsSubresourceUniqueRedirectTo"));
    1303     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    1304     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1305 }
    1306 
    1307 void TestRunner::setStatisticsTimeToLiveUserInteraction(double seconds)
    1308 {
    1309     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsTimeToLiveUserInteraction"));
    1310     WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(seconds));
    1311     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1312 }
    1313 
    1314 void TestRunner::installStatisticsDidModifyDataRecordsCallback(JSValueRef callback)
    1315 {
    1316     cacheTestRunnerCallback(StatisticsDidModifyDataRecordsCallbackID, callback);
    1317 }
    1318 
    1319 void TestRunner::statisticsDidModifyDataRecordsCallback()
    1320 {
    1321     callTestRunnerCallback(StatisticsDidModifyDataRecordsCallbackID);
    1322 }
    1323 
    1324 void TestRunner::statisticsFireDataModificationHandler()
    1325 {
    1326     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsFireDataModificationHandler"));
    1327     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr);
    1328 }
    1329 
    1330 void TestRunner::setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool value)
    1331 {
    1332     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsNotifyPagesWhenDataRecordsWereScanned"));
    1333     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
    1334     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1335 }
    1336 
    1337 void TestRunner::setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(bool value)
    1338 {
    1339     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsShouldClassifyResourcesBeforeDataRecordsRemoval"));
    1340     WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(value));
    1341     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1342 }
    1343 
    1344 void TestRunner::setStatisticsMinimumTimeBetweeenDataRecordsRemoval(double seconds)
    1345 {
    1346     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetStatisticsMinimumTimeBetweeenDataRecordsRemoval"));
    1347     WKRetainPtr<WKDoubleRef> messageBody(AdoptWK, WKDoubleCreate(seconds));
    1348     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1349 }
    1350    
    1351 void TestRunner::statisticsResetToConsistentState()
    1352 {
    1353     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("StatisticsResetToConsistentState"));
    1354     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), 0, nullptr);
    1355 }
    1356 
    1357 #if PLATFORM(MAC)
    1358 void TestRunner::connectMockGamepad(unsigned index)
    1359 {
    1360     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ConnectMockGamepad"));
    1361     WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(index));
    1362 
    1363     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1364 }
    1365 
    1366 void TestRunner::disconnectMockGamepad(unsigned index)
    1367 {
    1368     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DisconnectMockGamepad"));
    1369     WKRetainPtr<WKTypeRef> messageBody(AdoptWK, WKUInt64Create(index));
    1370 
    1371     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1372 }
    1373 
    1374 void TestRunner::setMockGamepadDetails(unsigned index, JSStringRef gamepadID, unsigned axisCount, unsigned buttonCount)
    1375 {
    1376     Vector<WKRetainPtr<WKStringRef>> keys;
    1377     Vector<WKRetainPtr<WKTypeRef>> values;
    1378 
    1379     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadID") });
    1380     values.append(toWK(gamepadID));
    1381 
    1382     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
    1383     values.append({ AdoptWK, WKUInt64Create(index) });
    1384 
    1385     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("AxisCount") });
    1386     values.append({ AdoptWK, WKUInt64Create(axisCount) });
    1387 
    1388     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ButtonCount") });
    1389     values.append({ AdoptWK, WKUInt64Create(buttonCount) });
    1390 
    1391     Vector<WKStringRef> rawKeys;
    1392     Vector<WKTypeRef> rawValues;
    1393     rawKeys.resize(keys.size());
    1394     rawValues.resize(values.size());
    1395 
    1396     for (size_t i = 0; i < keys.size(); ++i) {
    1397         rawKeys[i] = keys[i].get();
    1398         rawValues[i] = values[i].get();
    1399     }
    1400 
    1401     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGamepadDetails"));
    1402     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    1403 
    1404     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1405 }
    1406 
    1407 void TestRunner::setMockGamepadAxisValue(unsigned index, unsigned axisIndex, double value)
    1408 {
    1409     Vector<WKRetainPtr<WKStringRef>> keys;
    1410     Vector<WKRetainPtr<WKTypeRef>> values;
    1411 
    1412     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
    1413     values.append({ AdoptWK, WKUInt64Create(index) });
    1414 
    1415     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("AxisIndex") });
    1416     values.append({ AdoptWK, WKUInt64Create(axisIndex) });
    1417 
    1418     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    1419     values.append({ AdoptWK, WKDoubleCreate(value) });
    1420 
    1421     Vector<WKStringRef> rawKeys;
    1422     Vector<WKTypeRef> rawValues;
    1423     rawKeys.resize(keys.size());
    1424     rawValues.resize(values.size());
    1425 
    1426     for (size_t i = 0; i < keys.size(); ++i) {
    1427         rawKeys[i] = keys[i].get();
    1428         rawValues[i] = values[i].get();
    1429     }
    1430 
    1431     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGamepadAxisValue"));
    1432     WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
    1433 
    1434     WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr);
    1435 }
    1436 
    1437 void TestRunner::setMockGamepadButtonValue(unsigned index, unsigned buttonIndex, double value)
    1438 {
    1439     Vector<WKRetainPtr<WKStringRef>> keys;
    1440     Vector<WKRetainPtr<WKTypeRef>> values;
    1441 
    1442     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("GamepadIndex") });
    1443     values.append({ AdoptWK, WKUInt64Create(index) });
    1444 
    1445     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("ButtonIndex") });
    1446     values.append({ AdoptWK, WKUInt64Create(buttonIndex) });
    1447 
    1448     keys.append({ AdoptWK, WKStringCreateWithUTF8CString("Value") });
    1449     values.append({ AdoptWK, WKDoubleCreate(value) });
    1450 
    1451     Vector<WKStringRef> rawKeys;
    1452     Vector<WKTypeRef> rawValues;
    1453     rawKeys.resize(keys.size());
    1454     rawValues.resize(values.size());
    1455 
    1456     for (size_t i = 0; i < keys.size(); ++i) {
    1457         rawKeys[i] = keys[i].get();
    1458         rawValues[i] = values[i].get();
    1459     }
    14601382
    14611383    WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetMockGamepadButtonValue"));
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r212685 r212691  
    355355    void setStatisticsHasHadUserInteraction(JSStringRef hostName, bool value);
    356356    bool isStatisticsHasHadUserInteraction(JSStringRef hostName);
    357     void setStatisticsSubframeUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName);
    358     void setStatisticsSubresourceUnderTopFrameOrigin(JSStringRef hostName, JSStringRef topFrameHostName);
    359     void setStatisticsSubresourceUniqueRedirectTo(JSStringRef hostName, JSStringRef hostNameRedirectedTo);
    360357    void setStatisticsTimeToLiveUserInteraction(double seconds);
    361358    void setStatisticsNotifyPagesWhenDataRecordsWereScanned(bool);
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r212685 r212691  
    22302230}
    22312231
    2232 void TestController::setStatisticsSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName)
    2233 {
    2234     WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin(hostName, topFrameHostName);
    2235 }
    2236 
    2237 void TestController::setStatisticsSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName)
    2238 {
    2239     WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin(hostName, topFrameHostName);
    2240 }
    2241    
    2242 void TestController::setStatisticsSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo)
    2243 {
    2244     WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo(hostName, hostNameRedirectedTo);
    2245 }
    2246 
    22472232void TestController::setStatisticsTimeToLiveUserInteraction(double seconds)
    22482233{
  • trunk/Tools/WebKitTestRunner/TestController.h

    r212685 r212691  
    153153    void setStatisticsHasHadUserInteraction(WKStringRef hostName, bool value);
    154154    bool isStatisticsHasHadUserInteraction(WKStringRef hostName);
    155     void setStatisticsSubframeUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
    156     void setStatisticsSubresourceUnderTopFrameOrigin(WKStringRef hostName, WKStringRef topFrameHostName);
    157     void setStatisticsSubresourceUniqueRedirectTo(WKStringRef hostName, WKStringRef hostNameRedirectedTo);
    158155    void setStatisticsTimeToLiveUserInteraction(double seconds);
    159156    void statisticsFireDataModificationHandler();
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r212685 r212691  
    933933    }
    934934   
    935     if (WKStringIsEqualToUTF8CString(messageName, "SetStatisticsSubframeUnderTopFrameOrigin")) {
    936         ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
    937        
    938         WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    939         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    940         WKRetainPtr<WKStringRef> topFrameHostNameKey(AdoptWK, WKStringCreateWithUTF8CString("TopFrameHostName"));
    941        
    942         WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
    943         WKStringRef topFrameHostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, topFrameHostNameKey.get()));
    944 
    945         TestController::singleton().setStatisticsSubframeUnderTopFrameOrigin(hostName, topFrameHostName);
    946         return nullptr;
    947     }
    948    
    949     if (WKStringIsEqualToUTF8CString(messageName, "SetStatisticsSubresourceUnderTopFrameOrigin")) {
    950         ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
    951        
    952         WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    953         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    954         WKRetainPtr<WKStringRef> topFrameHostNameKey(AdoptWK, WKStringCreateWithUTF8CString("TopFrameHostName"));
    955        
    956         WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
    957         WKStringRef topFrameHostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, topFrameHostNameKey.get()));
    958        
    959         TestController::singleton().setStatisticsSubresourceUnderTopFrameOrigin(hostName, topFrameHostName);
    960         return nullptr;
    961     }
    962    
    963     if (WKStringIsEqualToUTF8CString(messageName, "SetStatisticsSubresourceUniqueRedirectTo")) {
    964         ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
    965        
    966         WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
    967         WKRetainPtr<WKStringRef> hostNameKey(AdoptWK, WKStringCreateWithUTF8CString("HostName"));
    968         WKRetainPtr<WKStringRef> hostNameRedirectedToKey(AdoptWK, WKStringCreateWithUTF8CString("HostNameRedirectedTo"));
    969        
    970         WKStringRef hostName = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameKey.get()));
    971         WKStringRef hostNameRedirectedTo = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostNameRedirectedToKey.get()));
    972        
    973         TestController::singleton().setStatisticsSubresourceUniqueRedirectTo(hostName, hostNameRedirectedTo);
    974         return nullptr;
    975     }
    976 
    977935    if (WKStringIsEqualToUTF8CString(messageName, "SetStatisticsTimeToLiveUserInteraction")) {
    978936        ASSERT(WKGetTypeID(messageBody) == WKDoubleGetTypeID());
  • trunk/WebKitLibraries/ChangeLog

    r212685 r212691  
     12017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r212685.
     4
     5        This change broke the 32-bit Sierra build.
     6
     7        Reverted changeset:
     8
     9        "Resource Load Statistics: Add alternate classification
     10        method"
     11        https://bugs.webkit.org/show_bug.cgi?id=168347
     12        http://trac.webkit.org/changeset/212685
     13
    1142017-02-20  John Wilander  <wilander@apple.com>
    215
Note: See TracChangeset for help on using the changeset viewer.