WebKit Bugzilla
Attachment 358517 Details for
Bug 193200
: Move the ResourceLoadStatisticsClassifier to WebCore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193200-20190107125901.patch (text/plain), 65.12 KB, created by
Brent Fulgham
on 2019-01-07 12:59:01 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2019-01-07 12:59:01 PST
Size:
65.12 KB
patch
obsolete
>Subversion Revision: 239675 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3b718d102b27c05fb479747b9368f58f924e93e2..b65ce26ea9dbaee82ef8807932c08504c0ccfdc7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,37 @@ >+2019-01-07 Brent Fulgham <bfulgham@apple.com> >+ >+ Move the ResourceLoadStatisticsClassifier to WebCore >+ https://bugs.webkit.org/show_bug.cgi?id=193200 >+ <rdar://problem/47088232> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Move the ResourceLoadStatisticsClassifier classes from WebKit to WebCore. This is a first >+ step in the effort to move this logic to the NetworkProcess. >+ >+ No change in behavior. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/WebCore.xcconfig: >+ * PlatformMac.cmake: >+ * PlatformWin.cmake: >+ * SourcesCocoa.txt: >+ * SourcesGTK.txt: >+ * SourcesWPE.txt: >+ * UnifiedSources-input.xcfilelist: >+ * WebCore.xcodeproj/project.pbxproj: >+ * platform/classifier/ResourceLoadStatisticsClassifier.cpp: Renamed from Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.cpp. >+ (WebCore::vectorLength): >+ (WebCore::ResourceLoadStatisticsClassifier::calculateResourcePrevalence): >+ (WebCore::ResourceLoadStatisticsClassifier::classifyWithVectorThreshold): >+ * platform/classifier/ResourceLoadStatisticsClassifier.h: Renamed from Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.h. >+ * platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Renamed from Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp. >+ (WebCore::ResourceLoadStatisticsClassifierCocoa::classify): >+ (WebCore::ResourceLoadStatisticsClassifierCocoa::storagePath): >+ (WebCore::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): >+ (WebCore::ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel): >+ * platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Renamed from Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h. >+ > 2019-01-07 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes. >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index c8d74df16a3230c2aa420f9481c106c66c302696..a014008645bdc147f829a93ded7ca7845f142841 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-07 Brent Fulgham <bfulgham@apple.com> >+ >+ Move the ResourceLoadStatisticsClassifier to WebCore >+ https://bugs.webkit.org/show_bug.cgi?id=193200 >+ <rdar://problem/47088232> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Move the ResourceLoadStatisticsClassifier classes from WebKit to WebCore. This is a first >+ step in the effort to move this logic to the NetworkProcess. >+ >+ No change in behavior. >+ >+ * PAL.xcodeproj/project.pbxproj: >+ * pal/spi/cocoa/CorePredictionSPI.h: Renamed from Source/WebKit/Platform/spi/Cocoa/CorePredictionSPI.h. >+ > 2019-01-04 Jer Noble <jer.noble@apple.com> > > Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4c199aaaae5acbb24d144cde08b4b8dd13b49b07..340dbea2aa74ab613790afb0adbf684d2cb772e1 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,24 @@ >+2019-01-07 Brent Fulgham <bfulgham@apple.com> >+ >+ Move the ResourceLoadStatisticsClassifier to WebCore >+ https://bugs.webkit.org/show_bug.cgi?id=193200 >+ <rdar://problem/47088232> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Move the ResourceLoadStatisticsClassifier classes from WebKit to WebCore. This is a first >+ step in the effort to move this logic to the NetworkProcess. >+ >+ No change in behavior. >+ >+ * PlatformMac.cmake: >+ * PlatformWin.cmake: >+ * SourcesCocoa.txt: >+ * SourcesGTK.txt: >+ * SourcesWPE.txt: >+ * UIProcess/ResourceLoadStatisticsMemoryStore.h: >+ * WebKit.xcodeproj/project.pbxproj: >+ > 2019-01-07 Alex Christensen <achristensen@webkit.org> > > Modernize CacheModel and disk cache fetching and clearing >diff --git a/Source/WebCore/Configurations/Base.xcconfig b/Source/WebCore/Configurations/Base.xcconfig >index 21fef8a035bf6cd2e80ddad493c80eb8387f4e74..b3407e3b5c6d1b02d22c7b0c42163680395db0f8 100644 >--- a/Source/WebCore/Configurations/Base.xcconfig >+++ b/Source/WebCore/Configurations/Base.xcconfig >@@ -136,6 +136,10 @@ WK_USE_ALTERNATE_FRAMEWORKS_DIR = $(WK_NOT_$(WK_EMPTY_$(WK_ALTERNATE_FRAMEWORKS_ > WK_ALTERNATE_WEBKIT_SDK_PATH = $(WK_ALTERNATE_WEBKIT_SDK_PATH_$(WK_USE_ALTERNATE_FRAMEWORKS_DIR)); > WK_ALTERNATE_WEBKIT_SDK_PATH_YES = $(WK_ALTERNATE_FRAMEWORKS_DIR)/; > >+WK_MACOS_WEAK_FRAMEWORK = $(WK_MACOS_WEAK_FRAMEWORK_$(WK_COCOA_TOUCH)); >+WK_MACOS_WEAK_FRAMEWORK_cocoatouch = -framework >+WK_MACOS_WEAK_FRAMEWORK_ = -weak_framework >+ > WK_PLATFORM_NAME = $(WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_$(WK_USE_ALTERNATE_FRAMEWORKS_DIR)); > WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_YES = iosmac; > WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_NO = $(PLATFORM_NAME); >diff --git a/Source/WebCore/Configurations/WebCore.xcconfig b/Source/WebCore/Configurations/WebCore.xcconfig >index ab84e890de20b2ebcc6a823dc6de5e37ed126764..6af5f1fea0404947b32186fa6785b19c4a196da6 100644 >--- a/Source/WebCore/Configurations/WebCore.xcconfig >+++ b/Source/WebCore/Configurations/WebCore.xcconfig >@@ -24,8 +24,14 @@ > #include "FeatureDefines.xcconfig" > #include "Version.xcconfig" > >+WK_HAVE_CORE_PREDICTION = YES; >+WK_HAVE_CORE_PREDICTION[sdk=macosx*][arch=i386] = NO; >+ >+WK_CORE_PREDICTION_DEFINES = $(WK_CORE_PREDICTION_DEFINES_$(WK_HAVE_CORE_PREDICTION)); >+WK_CORE_PREDICTION_DEFINES_YES = HAVE_CORE_PREDICTION; >+ > GCC_PREFIX_HEADER = WebCorePrefix.h; >-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) BUILDING_WEBKIT U_DISABLE_RENAMING=1 U_SHOW_CPLUSPLUS_API=0 GL_SILENCE_DEPRECATION=1 GLES_SILENCE_DEPRECATION=1 $(inherited); >+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) $(WK_CORE_PREDICTION_DEFINES) BUILDING_WEBKIT U_DISABLE_RENAMING=1 U_SHOW_CPLUSPLUS_API=0 GL_SILENCE_DEPRECATION=1 GLES_SILENCE_DEPRECATION=1 $(inherited); > > WK_PRIVATE_FRAMEWORKS_DIR = $(WK_PRIVATE_FRAMEWORKS_DIR_$(USE_INTERNAL_SDK)); > WK_PRIVATE_FRAMEWORKS_DIR_[sdk=iphone*] = $(PROJECT_DIR)/../../WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/$(WK_TARGET_IOS_VERSION_MAJOR); >@@ -80,6 +86,9 @@ WK_AUDIO_UNIT_LDFLAGS_macosx = -framework AudioUnit; > WK_CARBON_LDFLAGS = $(WK_CARBON_LDFLAGS_$(WK_PLATFORM_NAME)); > WK_CARBON_LDFLAGS_macosx = -framework Carbon; > >+WK_CORE_PREDICTION_LDFLAGS = $(WK_CORE_PREDICTION_LDFLAGS_$(WK_HAVE_CORE_PREDICTION)); >+WK_CORE_PREDICTION_LDFLAGS_YES = $(WK_MACOS_WEAK_FRAMEWORK) CorePrediction; >+ > WK_CORE_UI_LDFLAGS = $(WK_CORE_UI_LDFLAGS_$(WK_PLATFORM_NAME)); > WK_CORE_UI_LDFLAGS_macosx = -framework CoreUI; > >@@ -126,7 +135,7 @@ WK_URL_FORMATTING_LDFLAGS = $(WK_URL_FORMATTING_LDFLAGS_$(WK_HAVE_URL_FORMATTING > WK_URL_FORMATTING_LDFLAGS_YES = -framework URLFormatting; > > // FIXME: Reduce the number of allowable_clients <rdar://problem/31823969> >-OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS); >+OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS); > > OTHER_LDFLAGS_PLATFORM_cocoatouch = -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI; > OTHER_LDFLAGS_PLATFORM_macosx = -sub_library libobjc -umbrella WebKit; >diff --git a/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj b/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >index 10df3ee4cf7be8283e7567537ebdbc203169b393..4330aebd18269747c896de87046d8d63f42b7a09 100644 >--- a/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >+++ b/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >@@ -274,6 +274,7 @@ > 570AB8F820AF6E3D00B8BE87 /* NSXPCConnectionSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSXPCConnectionSPI.h; sourceTree = "<group>"; }; > 63E369F921AFA83F001C14BC /* NSProgressSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSProgressSPI.h; sourceTree = "<group>"; }; > 7A1656431F97B2B800BA3CE4 /* NSKeyedArchiverSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSKeyedArchiverSPI.h; sourceTree = "<group>"; }; >+ 7A3A4A8421E3CD25004AA84E /* CorePredictionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePredictionSPI.h; sourceTree = "<group>"; }; > 7A3A6A7F20CADB4600317AAE /* NSImageSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSImageSPI.h; sourceTree = "<group>"; }; > 93E5909C1F93BF1E0067F8CF /* UnencodableHandling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UnencodableHandling.h; sourceTree = "<group>"; }; > A10265881F56747A00B4C844 /* HIToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HIToolboxSPI.h; sourceTree = "<group>"; }; >@@ -380,6 +381,7 @@ > 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */, > 0C2DA1221F3BEB4900DBC317 /* AVKitSPI.h */, > 0C2DA1231F3BEB4900DBC317 /* CFNSURLConnectionSPI.h */, >+ 7A3A4A8421E3CD25004AA84E /* CorePredictionSPI.h */, > 0C2DA1241F3BEB4900DBC317 /* CoreTextSPI.h */, > 0C2DA1251F3BEB4900DBC317 /* DataDetectorsCoreSPI.h */, > CE5673862151A7B9002F92D7 /* IOKitSPI.h */, >@@ -720,6 +722,7 @@ > 0C7785931F45130F00F4EBB6 /* NSPasteboardSPI.h in Headers */, > E5D45D142106A18700D2B738 /* NSPopoverColorWellSPI.h in Headers */, > 0C7785941F45130F00F4EBB6 /* NSPopoverSPI.h in Headers */, >+ 63C7EDC721AFAE04006A7B99 /* NSProgressSPI.h in Headers */, > A10826F11F573BCA004772AC /* NSResponderSPI.h in Headers */, > 0C7785951F45130F00F4EBB6 /* NSScrollerImpSPI.h in Headers */, > 0C7785961F45130F00F4EBB6 /* NSScrollingInputFilterSPI.h in Headers */, >@@ -746,7 +749,6 @@ > 0C77859F1F45130F00F4EBB6 /* QTKitSPI.h in Headers */, > 0C2DA1571F3BEB4900DBC317 /* QuartzCoreSPI.h in Headers */, > A102658B1F56748C00B4C844 /* QuickDrawSPI.h in Headers */, >- 63C7EDC721AFAE04006A7B99 /* NSProgressSPI.h in Headers */, > 0C7785A01F45130F00F4EBB6 /* QuickLookMacSPI.h in Headers */, > 0C5AF9201F43A4C7002EAC02 /* QuickLookSPI.h in Headers */, > 442956CD218A72DF0080DB54 /* RevealSPI.h in Headers */, >diff --git a/Source/WebCore/PAL/pal/spi/cocoa/CorePredictionSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/CorePredictionSPI.h >new file mode 100644 >index 0000000000000000000000000000000000000000..a1ea9d809dc9d0ccd1b930e36a0134fa2d37b1af >--- /dev/null >+++ b/Source/WebCore/PAL/pal/spi/cocoa/CorePredictionSPI.h >@@ -0,0 +1,56 @@ >+/* >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if HAVE(CORE_PREDICTION) >+ >+#if USE(APPLE_INTERNAL_SDK) >+ >+#import <CorePrediction/svm.h> >+ >+#else >+ >+struct svm_node { >+ int index; >+ double value; >+}; >+ >+#endif >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+typedef struct svm_node svm_node; >+ >+struct svm_model *svm_load_model(const char *model_file_name); >+double svm_predict_values(const struct svm_model*, const struct svm_node* x, double* dec_values); >+ >+#ifdef __cplusplus >+} >+#endif >+ >+#endif >diff --git a/Source/WebCore/PlatformMac.cmake b/Source/WebCore/PlatformMac.cmake >index 8dd999e2081f97b334236f3f30d085bb5d05d484..c76b64382728bda39a29333e3bacbccbdb6df139 100644 >--- a/Source/WebCore/PlatformMac.cmake >+++ b/Source/WebCore/PlatformMac.cmake >@@ -189,6 +189,10 @@ list(APPEND WebCore_SOURCES > platform/audio/mac/CARingBuffer.cpp > platform/audio/mac/FFTFrameMac.cpp > >+ platform/classifier/ResourceLoadStatisticsClassifier.cpp >+ >+ platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >+ > platform/cf/FileSystemCF.cpp > platform/cf/KeyedDecoderCF.cpp > platform/cf/KeyedEncoderCF.cpp >diff --git a/Source/WebCore/PlatformWin.cmake b/Source/WebCore/PlatformWin.cmake >index 70046821da81b79ef5f8510e9d01b31f767521bd..55bdb063d0bd8a96c216165ee99661bcb7778fc1 100644 >--- a/Source/WebCore/PlatformWin.cmake >+++ b/Source/WebCore/PlatformWin.cmake >@@ -37,6 +37,8 @@ list(APPEND WebCore_SOURCES > > platform/audio/PlatformMediaSessionManager.cpp > >+ platform/classifier/ResourceLoadStatisticsClassifier.cpp >+ > platform/graphics/GraphicsContext3DPrivate.cpp > > platform/graphics/egl/GLContextEGL.cpp >diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt >index 2005c9a92e16fe7171f7a7bbdf4b7bbdfda5b9e7..06f3ae406b0a7e966d07202cfec5bdd22be504a9 100644 >--- a/Source/WebCore/SourcesCocoa.txt >+++ b/Source/WebCore/SourcesCocoa.txt >@@ -1,4 +1,4 @@ >-// Copyright (C) 2017-2018 Apple Inc. All rights reserved. >+// Copyright (C) 2017-2019 Apple Inc. All rights reserved. > // > // Redistribution and use in source and binary forms, with or without > // modification, are permitted provided that the following conditions >@@ -180,6 +180,9 @@ platform/audio/mac/AudioSessionMac.cpp > platform/audio/mac/CARingBuffer.cpp > platform/audio/mac/FFTFrameMac.cpp > >+platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >+platform/classifier/ResourceLoadStatisticsClassifier.cpp >+ > platform/cf/FileSystemCF.cpp > platform/cf/KeyedDecoderCF.cpp > platform/cf/KeyedEncoderCF.cpp >diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt >index 15a0ba83ff7897cdd690833970cdd5af87bf711e..7fdf30058c46abd48064b9c5efb9cfd1f7880733 100644 >--- a/Source/WebCore/SourcesGTK.txt >+++ b/Source/WebCore/SourcesGTK.txt >@@ -59,6 +59,8 @@ platform/ScrollAnimationKinetic.cpp > platform/ScrollAnimationSmooth.cpp > platform/UserAgentQuirks.cpp > >+platform/classifier/ResourceLoadStatisticsClassifier.cpp >+ > platform/generic/ScrollAnimatorGeneric.cpp > > platform/geoclue/GeolocationProviderGeoclue.cpp >diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt >index 3c32d895505c419bca2c5feb42e2e6544e97ca7a..46fc034db2e4ad44c2f527b97f771135b5a78021 100644 >--- a/Source/WebCore/SourcesWPE.txt >+++ b/Source/WebCore/SourcesWPE.txt >@@ -42,6 +42,8 @@ page/scrolling/generic/ScrollingThreadGeneric.cpp > > platform/UserAgentQuirks.cpp > >+platform/classifier/ResourceLoadStatisticsClassifier.cpp >+ > // This can't go into SourcesGLib.txt because it has to go into WebCorePlatformGTK. > platform/glib/EventHandlerGLib.cpp > >diff --git a/Source/WebCore/UnifiedSources-input.xcfilelist b/Source/WebCore/UnifiedSources-input.xcfilelist >index dfc2a3c29529a4146448ec8c3b5bcee081411730..664e61abef6ed6e6a968b44ca98f29d8bfb2c8bd 100644 >--- a/Source/WebCore/UnifiedSources-input.xcfilelist >+++ b/Source/WebCore/UnifiedSources-input.xcfilelist >@@ -2643,6 +2643,8 @@ $(SRCROOT)/platform/cf/MediaAccessibilitySoftLink.cpp > $(SRCROOT)/platform/cf/RunLoopObserver.cpp > $(SRCROOT)/platform/cf/SharedBufferCF.cpp > $(SRCROOT)/platform/cf/URLCF.cpp >+$(SRCROOT)/platform/classifier/ResourceLoadStatisticsClassifier.cpp >+$(SRCROOT)/platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp > $(SRCROOT)/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm > $(SRCROOT)/platform/cocoa/CoreVideoSoftLink.cpp > $(SRCROOT)/platform/cocoa/DataDetectorsCoreSoftLink.mm >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index c1748b63488ef83f0f58fb3b99a6c6460344fc3d..3e7a112e41b3ac6f1628e151cc5da842e903bdbe 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -2153,6 +2153,8 @@ > 7A1D7FCB18F85F0F00C385AD /* mediaControlsLocalizedStrings.js in Resources */ = {isa = PBXBuildFile; fileRef = 7A1D7FC918F85F0F00C385AD /* mediaControlsLocalizedStrings.js */; }; > 7A22732120C9FAFE00DB1DEF /* WebKitNSImageExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A22731F20C9F9DA00DB1DEF /* WebKitNSImageExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7A29F57218C69514004D0F81 /* OutOfBandTextTrackPrivateAVF.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A29F57118C69514004D0F81 /* OutOfBandTextTrackPrivateAVF.h */; }; >+ 7A3A4A8521E3D047004AA84E /* ResourceLoadStatisticsClassifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A3A4A8121E3CC8F004AA84E /* ResourceLoadStatisticsClassifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 7A3A4A8621E3D04E004AA84E /* ResourceLoadStatisticsClassifierCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A3A4A7E21E3CC8F004AA84E /* ResourceLoadStatisticsClassifierCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7A45032F18DB717200377B34 /* BufferedLineReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A45032D18DB717200377B34 /* BufferedLineReader.cpp */; }; > 7A45033018DB717200377B34 /* BufferedLineReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A45032E18DB717200377B34 /* BufferedLineReader.h */; }; > 7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A54857E14E02D51006AE05A /* InspectorHistory.h */; }; >@@ -9464,6 +9466,10 @@ > 7A29BA67187B732200F29CEB /* TemporaryOpenGLSetting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemporaryOpenGLSetting.h; sourceTree = "<group>"; }; > 7A29BA69187B781C00F29CEB /* TemporaryOpenGLSetting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TemporaryOpenGLSetting.cpp; sourceTree = "<group>"; }; > 7A29F57118C69514004D0F81 /* OutOfBandTextTrackPrivateAVF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OutOfBandTextTrackPrivateAVF.h; sourceTree = "<group>"; }; >+ 7A3A4A7D21E3CC8F004AA84E /* ResourceLoadStatisticsClassifierCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatisticsClassifierCocoa.cpp; sourceTree = "<group>"; }; >+ 7A3A4A7E21E3CC8F004AA84E /* ResourceLoadStatisticsClassifierCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifierCocoa.h; sourceTree = "<group>"; }; >+ 7A3A4A8021E3CC8F004AA84E /* ResourceLoadStatisticsClassifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatisticsClassifier.cpp; sourceTree = "<group>"; }; >+ 7A3A4A8121E3CC8F004AA84E /* ResourceLoadStatisticsClassifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifier.h; sourceTree = "<group>"; }; > 7A3EBEAA21BF054C000D043D /* JSSVGViewSpecCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGViewSpecCustom.cpp; sourceTree = "<group>"; }; > 7A3EBEAC21BF0921000D043D /* SVGAttributeOwnerProxy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAttributeOwnerProxy.cpp; sourceTree = "<group>"; }; > 7A45032D18DB717200377B34 /* BufferedLineReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BufferedLineReader.cpp; sourceTree = "<group>"; }; >@@ -20387,6 +20393,25 @@ > path = macOS; > sourceTree = "<group>"; > }; >+ 7A3A4A7F21E3CC8F004AA84E /* cocoa */ = { >+ isa = PBXGroup; >+ children = ( >+ 7A3A4A7D21E3CC8F004AA84E /* ResourceLoadStatisticsClassifierCocoa.cpp */, >+ 7A3A4A7E21E3CC8F004AA84E /* ResourceLoadStatisticsClassifierCocoa.h */, >+ ); >+ path = cocoa; >+ sourceTree = "<group>"; >+ }; >+ 7A3A4A8221E3CC8F004AA84E /* classifier */ = { >+ isa = PBXGroup; >+ children = ( >+ 7A3A4A7F21E3CC8F004AA84E /* cocoa */, >+ 7A3A4A8021E3CC8F004AA84E /* ResourceLoadStatisticsClassifier.cpp */, >+ 7A3A4A8121E3CC8F004AA84E /* ResourceLoadStatisticsClassifier.h */, >+ ); >+ path = classifier; >+ sourceTree = "<group>"; >+ }; > 7C330A041DF9F93B00D3395C /* Geolocation */ = { > isa = PBXGroup; > children = ( >@@ -25055,6 +25080,7 @@ > 49E912A40EFAC8E6009D0CAF /* animation */, > FD31604012B026A300C1A359 /* audio */, > 1AE42F670AA4B8CB00C8612D /* cf */, >+ 7A3A4A8221E3CC8F004AA84E /* classifier */, > A5C974CE11485FDA0066F2AB /* cocoa */, > CD94A5CB1F71CB4600F525C5 /* encryptedmedia */, > 515BE1871D54F5DB00DD7C68 /* gamepad */, >@@ -30887,6 +30913,8 @@ > 6B693A2E1C51A82E00B03BEF /* ResourceLoadObserver.h in Headers */, > E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */, > 7A929CA71C598AA9004DF226 /* ResourceLoadStatistics.h in Headers */, >+ 7A3A4A8521E3D047004AA84E /* ResourceLoadStatisticsClassifier.h in Headers */, >+ 7A3A4A8621E3D04E004AA84E /* ResourceLoadStatisticsClassifierCocoa.h in Headers */, > 7EE6846D12D26E3800E79415 /* ResourceRequest.h in Headers */, > 514C767D0CE923A1007EF3CD /* ResourceRequestBase.h in Headers */, > 7EE6846F12D26E3800E79415 /* ResourceRequestCFNet.h in Headers */, >diff --git a/Source/WebCore/platform/classifier/ResourceLoadStatisticsClassifier.cpp b/Source/WebCore/platform/classifier/ResourceLoadStatisticsClassifier.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..989978df14809f5b4956cb285f6a7505b38b46d7 >--- /dev/null >+++ b/Source/WebCore/platform/classifier/ResourceLoadStatisticsClassifier.cpp >@@ -0,0 +1,82 @@ >+/* >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "ResourceLoadStatisticsClassifier.h" >+ >+#include "Logging.h" >+#include <WebCore/ResourceLoadStatistics.h> >+ >+namespace WebCore { >+ >+static double vectorLength(unsigned a, unsigned b, unsigned c) >+{ >+ return sqrt(a * a + b * b + c * c); >+} >+ >+static const auto featureVectorLengthThresholdHigh = 3; >+static const auto featureVectorLengthThresholdVeryHigh = 30; >+ResourceLoadPrevalence ResourceLoadStatisticsClassifier::calculateResourcePrevalence(const ResourceLoadStatistics& resourceStatistic, ResourceLoadPrevalence currentPrevalence) >+{ >+ ASSERT(currentPrevalence != VeryHigh); >+ >+ auto subresourceUnderTopFrameOriginsCount = resourceStatistic.subresourceUnderTopFrameOrigins.size(); >+ auto subresourceUniqueRedirectsToCount = resourceStatistic.subresourceUniqueRedirectsTo.size(); >+ auto subframeUnderTopFrameOriginsCount = resourceStatistic.subframeUnderTopFrameOrigins.size(); >+ auto topFrameUniqueRedirectsToCount = resourceStatistic.topFrameUniqueRedirectsTo.size(); >+ >+ if (!subresourceUnderTopFrameOriginsCount >+ && !subresourceUniqueRedirectsToCount >+ && !subframeUnderTopFrameOriginsCount >+ && !topFrameUniqueRedirectsToCount) { >+ return Low; >+ } >+ >+ if (vectorLength(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount) > featureVectorLengthThresholdVeryHigh) >+ return VeryHigh; >+ >+ if (currentPrevalence == High >+ || subresourceUnderTopFrameOriginsCount > featureVectorLengthThresholdHigh >+ || subresourceUniqueRedirectsToCount > featureVectorLengthThresholdHigh >+ || subframeUnderTopFrameOriginsCount > featureVectorLengthThresholdHigh >+ || topFrameUniqueRedirectsToCount > featureVectorLengthThresholdHigh >+ || classify(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount)) >+ return High; >+ >+ return Low; >+} >+ >+bool ResourceLoadStatisticsClassifier::classifyWithVectorThreshold(unsigned a, unsigned b, unsigned c) >+{ >+ LOG(ResourceLoadStatistics, "ResourceLoadStatisticsClassifier::classifyWithVectorThreshold(): Classified with threshold."); >+ return vectorLength(a, b, c) > featureVectorLengthThresholdHigh; >+} >+ >+bool ResourceLoadStatisticsClassifier::classify(unsigned subresourceUnderTopFrameOriginsCount, unsigned subresourceUniqueRedirectsToCount, unsigned subframeUnderTopFrameOriginsCount) >+{ >+ return classifyWithVectorThreshold(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount); >+} >+ >+} >diff --git a/Source/WebCore/platform/classifier/ResourceLoadStatisticsClassifier.h b/Source/WebCore/platform/classifier/ResourceLoadStatisticsClassifier.h >new file mode 100644 >index 0000000000000000000000000000000000000000..9b4b1371d095e80cebabbaffd163c9544c2b9d6d >--- /dev/null >+++ b/Source/WebCore/platform/classifier/ResourceLoadStatisticsClassifier.h >@@ -0,0 +1,50 @@ >+/* >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+namespace WebCore { >+ >+struct ResourceLoadStatistics; >+ >+enum ResourceLoadPrevalence { >+ Low = 1 << 0, >+ High = 1 << 1, >+ VeryHigh = 1 << 2, >+}; >+ >+class WEBCORE_EXPORT ResourceLoadStatisticsClassifier { >+public: >+ ResourceLoadStatisticsClassifier() = default; >+ virtual ~ResourceLoadStatisticsClassifier() = default; >+ >+ ResourceLoadPrevalence calculateResourcePrevalence(const ResourceLoadStatistics& resourceStatistic, ResourceLoadPrevalence currentPrevalence); >+ >+protected: >+ virtual bool classify(unsigned subresourceUnderTopFrameOriginsCount, unsigned subresourceUniqueRedirectsToCount, unsigned subframeUnderTopFrameOriginsCount); >+ bool classifyWithVectorThreshold(unsigned, unsigned, unsigned); >+}; >+ >+} >diff --git a/Source/WebCore/platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp b/Source/WebCore/platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..47f8ca479929aaf03f2649badc96b6cb52690858 >--- /dev/null >+++ b/Source/WebCore/platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >@@ -0,0 +1,125 @@ >+/* >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "ResourceLoadStatisticsClassifierCocoa.h" >+ >+#if HAVE(CORE_PREDICTION) >+ >+#include "Logging.h" >+#include <pal/spi/cocoa/CorePredictionSPI.h> >+#include <wtf/NeverDestroyed.h> >+#include <wtf/darwin/WeakLinking.h> >+ >+namespace WebCore { >+ >+bool ResourceLoadStatisticsClassifierCocoa::classify(unsigned subresourceUnderTopFrameOriginsCount, unsigned subresourceUniqueRedirectsToCount, unsigned subframeUnderTopFrameOriginsCount) >+{ >+ if (!canUseCorePrediction()) >+ return classifyWithVectorThreshold(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount); >+ >+ Vector<svm_node> features; >+ >+ if (subresourceUnderTopFrameOriginsCount) >+ features.append({1, static_cast<double>(subresourceUnderTopFrameOriginsCount)}); >+ if (subresourceUniqueRedirectsToCount) >+ features.append({2, static_cast<double>(subresourceUniqueRedirectsToCount)}); >+ if (subframeUnderTopFrameOriginsCount) >+ features.append({3, static_cast<double>(subframeUnderTopFrameOriginsCount)}); >+ >+ // Add termination node with index -1. >+ features.append({-1, -1}); >+ >+ double score; >+ int classification = svm_predict_values(singletonPredictionModel(), features.data(), &score); >+ LOG(ResourceLoadStatistics, "ResourceLoadStatisticsClassifierCocoa::classify(): Classified with CorePrediction."); >+ return classification < 0; >+} >+ >+String ResourceLoadStatisticsClassifierCocoa::storagePath() >+{ >+ CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit")); >+ RetainPtr<CFURLRef> resourceUrl = adoptCF(CFBundleCopyResourcesDirectoryURL(webKitBundle)); >+ resourceUrl = adoptCF(CFURLCreateCopyAppendingPathComponent(nullptr, resourceUrl.get(), CFSTR("corePrediction_model"), false)); >+ CFErrorRef error = nullptr; >+ resourceUrl = adoptCF(CFURLCreateFilePathURL(nullptr, resourceUrl.get(), &error)); >+ >+ if (error || !resourceUrl) >+ return String(); >+ >+ RetainPtr<CFStringRef> resourceUrlString = adoptCF(CFURLCopyFileSystemPath(resourceUrl.get(), kCFURLPOSIXPathStyle)); >+ return String(resourceUrlString.get()); >+} >+ >+bool ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction() >+{ >+ if (m_haveLoadedModel) >+ return true; >+ >+ if (!m_useCorePrediction) >+ return false; >+ >+ if (isNullFunctionPointer(svm_load_model)) { >+ m_useCorePrediction = false; >+ return false; >+ } >+ >+ String storagePathStr = storagePath(); >+ if (storagePathStr.isNull() || storagePathStr.isEmpty()) { >+ m_useCorePrediction = false; >+ return false; >+ } >+ >+ if (singletonPredictionModel()) { >+ m_haveLoadedModel = true; >+ return true; >+ } >+ >+ m_useCorePrediction = false; >+ return false; >+} >+ >+const struct svm_model* ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel() >+{ >+ static Optional<struct svm_model*> corePredictionModel; >+ static dispatch_once_t onceToken; >+ dispatch_once(&onceToken, ^{ >+ auto path = storagePath(); >+ if (path.isEmpty()) >+ return; >+ >+ corePredictionModel = svm_load_model(path.utf8().data()); >+ }); >+ >+ if (corePredictionModel && corePredictionModel.value()) >+ return corePredictionModel.value(); >+ >+ WTFLogAlways("ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel(): Couldn't load model file at path %s.", storagePath().utf8().data()); >+ m_useCorePrediction = false; >+ return nullptr; >+} >+} >+ >+#endif >diff --git a/Source/WebCore/platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h b/Source/WebCore/platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h >new file mode 100644 >index 0000000000000000000000000000000000000000..47248f51ed33bf3dd08d858f6ed7fbc77a5d8528 >--- /dev/null >+++ b/Source/WebCore/platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h >@@ -0,0 +1,54 @@ >+/* >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if HAVE(CORE_PREDICTION) >+ >+#include "ResourceLoadStatisticsClassifier.h" >+#include <wtf/Platform.h> >+#include <wtf/text/WTFString.h> >+ >+struct svm_model; >+ >+namespace WebCore { >+ >+class WEBCORE_EXPORT ResourceLoadStatisticsClassifierCocoa : public ResourceLoadStatisticsClassifier { >+public: >+ ResourceLoadStatisticsClassifierCocoa() = default; >+ virtual ~ResourceLoadStatisticsClassifierCocoa() = default; >+ >+private: >+ bool classify(unsigned, unsigned, unsigned) override; >+ String storagePath(); >+ bool canUseCorePrediction(); >+ const struct svm_model* singletonPredictionModel(); >+ bool m_useCorePrediction { true }; >+ bool m_haveLoadedModel { false }; >+}; >+ >+} >+ >+#endif >diff --git a/Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.cpp b/Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.cpp >deleted file mode 100644 >index bdbfdfc2051c6f4487749d0fb4db70d0ceb727a9..0000000000000000000000000000000000000000 >--- a/Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.cpp >+++ /dev/null >@@ -1,78 +0,0 @@ >-/* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "ResourceLoadStatisticsClassifier.h" >- >-#include "Logging.h" >-#include <WebCore/ResourceLoadStatistics.h> >- >-namespace WebKit { >-using namespace WebCore; >- >-static double vectorLength(unsigned a, unsigned b, unsigned c) >-{ >- return sqrt(a * a + b * b + c * c); >-} >- >-static const auto featureVectorLengthThresholdHigh = 3; >-static const auto featureVectorLengthThresholdVeryHigh = 30; >-ResourceLoadPrevalence ResourceLoadStatisticsClassifier::calculateResourcePrevalence(const ResourceLoadStatistics& resourceStatistic, ResourceLoadPrevalence currentPrevalence) >-{ >- ASSERT(currentPrevalence != VeryHigh); >- >- auto subresourceUnderTopFrameOriginsCount = resourceStatistic.subresourceUnderTopFrameOrigins.size(); >- auto subresourceUniqueRedirectsToCount = resourceStatistic.subresourceUniqueRedirectsTo.size(); >- auto subframeUnderTopFrameOriginsCount = resourceStatistic.subframeUnderTopFrameOrigins.size(); >- auto topFrameUniqueRedirectsToCount = resourceStatistic.topFrameUniqueRedirectsTo.size(); >- >- if (!subresourceUnderTopFrameOriginsCount >- && !subresourceUniqueRedirectsToCount >- && !subframeUnderTopFrameOriginsCount >- && !topFrameUniqueRedirectsToCount) { >- return Low; >- } >- >- if (vectorLength(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount) > featureVectorLengthThresholdVeryHigh) >- return VeryHigh; >- >- if (currentPrevalence == High >- || subresourceUnderTopFrameOriginsCount > featureVectorLengthThresholdHigh >- || subresourceUniqueRedirectsToCount > featureVectorLengthThresholdHigh >- || subframeUnderTopFrameOriginsCount > featureVectorLengthThresholdHigh >- || topFrameUniqueRedirectsToCount > featureVectorLengthThresholdHigh >- || classify(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount)) >- return High; >- >- return Low; >-} >- >-bool ResourceLoadStatisticsClassifier::classifyWithVectorThreshold(unsigned a, unsigned b, unsigned c) >-{ >- LOG(ResourceLoadStatistics, "ResourceLoadStatisticsClassifier::classifyWithVectorThreshold(): Classified with threshold."); >- return vectorLength(a, b, c) > featureVectorLengthThresholdHigh; >-} >- >-} >diff --git a/Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.h b/Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.h >deleted file mode 100644 >index acf1f389dd51a00c5107dc672f9d3fba9f2bfef0..0000000000000000000000000000000000000000 >--- a/Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.h >+++ /dev/null >@@ -1,53 +0,0 @@ >-/* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-namespace WebCore { >-struct ResourceLoadStatistics; >-} >- >-namespace WebKit { >- >-enum ResourceLoadPrevalence { >- Low = 1 << 0, >- High = 1 << 1, >- VeryHigh = 1 << 2, >-}; >- >-class ResourceLoadStatisticsClassifier { >-public: >- ResourceLoadStatisticsClassifier() = default; >- virtual ~ResourceLoadStatisticsClassifier() = default; >- ResourceLoadPrevalence calculateResourcePrevalence(const WebCore::ResourceLoadStatistics& resourceStatistic, ResourceLoadPrevalence currentPrevalence); >-protected: >- virtual bool classify(unsigned subresourceUnderTopFrameOriginsCount, unsigned subresourceUniqueRedirectsToCount, unsigned subframeUnderTopFrameOriginsCount) >- { >- return classifyWithVectorThreshold(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount); >- } >- bool classifyWithVectorThreshold(unsigned, unsigned, unsigned); >-}; >- >-} >diff --git a/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp b/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >deleted file mode 100644 >index acfbe3cdbc1c3a951f72370bd5987e472e8d4c25..0000000000000000000000000000000000000000 >--- a/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >+++ /dev/null >@@ -1,125 +0,0 @@ >-/* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "ResourceLoadStatisticsClassifierCocoa.h" >- >-#if HAVE(CORE_PREDICTION) >- >-#include "CorePredictionSPI.h" >-#include "Logging.h" >-#include <wtf/NeverDestroyed.h> >-#include <wtf/darwin/WeakLinking.h> >- >-namespace WebKit { >- >-bool ResourceLoadStatisticsClassifierCocoa::classify(unsigned subresourceUnderTopFrameOriginsCount, unsigned subresourceUniqueRedirectsToCount, unsigned subframeUnderTopFrameOriginsCount) >-{ >- if (!canUseCorePrediction()) >- return classifyWithVectorThreshold(subresourceUnderTopFrameOriginsCount, subresourceUniqueRedirectsToCount, subframeUnderTopFrameOriginsCount); >- >- Vector<svm_node> features; >- >- if (subresourceUnderTopFrameOriginsCount) >- features.append({1, static_cast<double>(subresourceUnderTopFrameOriginsCount)}); >- if (subresourceUniqueRedirectsToCount) >- features.append({2, static_cast<double>(subresourceUniqueRedirectsToCount)}); >- if (subframeUnderTopFrameOriginsCount) >- features.append({3, static_cast<double>(subframeUnderTopFrameOriginsCount)}); >- >- // Add termination node with index -1. >- features.append({-1, -1}); >- >- double score; >- int classification = svm_predict_values(singletonPredictionModel(), features.data(), &score); >- LOG(ResourceLoadStatistics, "ResourceLoadStatisticsClassifierCocoa::classify(): Classified with CorePrediction."); >- return classification < 0; >-} >- >-String ResourceLoadStatisticsClassifierCocoa::storagePath() >-{ >- CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit")); >- RetainPtr<CFURLRef> resourceUrl = adoptCF(CFBundleCopyResourcesDirectoryURL(webKitBundle)); >- resourceUrl = adoptCF(CFURLCreateCopyAppendingPathComponent(nullptr, resourceUrl.get(), CFSTR("corePrediction_model"), false)); >- CFErrorRef error = nullptr; >- resourceUrl = adoptCF(CFURLCreateFilePathURL(nullptr, resourceUrl.get(), &error)); >- >- if (error || !resourceUrl) >- return String(); >- >- RetainPtr<CFStringRef> resourceUrlString = adoptCF(CFURLCopyFileSystemPath(resourceUrl.get(), kCFURLPOSIXPathStyle)); >- return String(resourceUrlString.get()); >-} >- >-bool ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction() >-{ >- if (m_haveLoadedModel) >- return true; >- >- if (!m_useCorePrediction) >- return false; >- >- if (isNullFunctionPointer(svm_load_model)) { >- m_useCorePrediction = false; >- return false; >- } >- >- String storagePathStr = storagePath(); >- if (storagePathStr.isNull() || storagePathStr.isEmpty()) { >- m_useCorePrediction = false; >- return false; >- } >- >- if (singletonPredictionModel()) { >- m_haveLoadedModel = true; >- return true; >- } >- >- m_useCorePrediction = false; >- return false; >-} >- >-const struct svm_model* ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel() >-{ >- static Optional<struct svm_model*> corePredictionModel; >- static dispatch_once_t onceToken; >- dispatch_once(&onceToken, ^{ >- auto path = storagePath(); >- if (path.isEmpty()) >- return; >- >- corePredictionModel = svm_load_model(path.utf8().data()); >- }); >- >- if (corePredictionModel && corePredictionModel.value()) >- return corePredictionModel.value(); >- >- WTFLogAlways("ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel(): Couldn't load model file at path %s.", storagePath().utf8().data()); >- m_useCorePrediction = false; >- return nullptr; >-} >-} >- >-#endif >diff --git a/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h b/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h >deleted file mode 100644 >index ad6bf06c19701a5f489c4480d614b17f5ce05aa5..0000000000000000000000000000000000000000 >--- a/Source/WebKit/Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h >+++ /dev/null >@@ -1,50 +0,0 @@ >-/* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#if HAVE(CORE_PREDICTION) >- >-#include "ResourceLoadStatisticsClassifier.h" >-#include <wtf/Platform.h> >-#include <wtf/text/WTFString.h> >- >-struct svm_model; >- >-namespace WebKit { >- >-class ResourceLoadStatisticsClassifierCocoa : public ResourceLoadStatisticsClassifier { >-private: >- bool classify(unsigned, unsigned, unsigned) override; >- String storagePath(); >- bool canUseCorePrediction(); >- const struct svm_model* singletonPredictionModel(); >- bool m_useCorePrediction { true }; >- bool m_haveLoadedModel { false }; >-}; >- >-} >- >-#endif >diff --git a/Source/WebKit/Platform/spi/Cocoa/CorePredictionSPI.h b/Source/WebKit/Platform/spi/Cocoa/CorePredictionSPI.h >deleted file mode 100644 >index a9f250fc2f37e4c0ebea2e57c1a23dc1e3e71f94..0000000000000000000000000000000000000000 >--- a/Source/WebKit/Platform/spi/Cocoa/CorePredictionSPI.h >+++ /dev/null >@@ -1,57 +0,0 @@ >-/* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#if HAVE(CORE_PREDICTION) >- >-#if USE(APPLE_INTERNAL_SDK) >- >-#import <CorePrediction/svm.h> >- >-#else >- >-struct svm_node >-{ >- int index; >- double value; >-}; >- >-#endif >- >-#ifdef __cplusplus >-extern "C" { >-#endif >- >-typedef struct svm_node svm_node; >- >-struct svm_model *svm_load_model(const char *model_file_name); >-double svm_predict_values(const struct svm_model *model, const struct svm_node *x, double* dec_values); >- >-#ifdef __cplusplus >-} >-#endif >- >-#endif >diff --git a/Source/WebKit/PlatformMac.cmake b/Source/WebKit/PlatformMac.cmake >index d67e64cd974037288598697affd3c6e7320566ad..fc80b741132958dff38c1ddedfb3bf20fb26fbe3 100644 >--- a/Source/WebKit/PlatformMac.cmake >+++ b/Source/WebKit/PlatformMac.cmake >@@ -48,10 +48,6 @@ list(APPEND WebKit_SOURCES > > Platform/cocoa/WKCrashReporter.mm > >- Platform/classifier/ResourceLoadStatisticsClassifier.cpp >- >- Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >- > Platform/foundation/LoggingFoundation.mm > > Platform/cocoa/SharedMemoryCocoa.cpp >diff --git a/Source/WebKit/PlatformWin.cmake b/Source/WebKit/PlatformWin.cmake >index 2aa35ad4835799641c0944a7af9c90794e8d901b..9a3b14afa5832b8f1d539e14acb8df386279012e 100644 >--- a/Source/WebKit/PlatformWin.cmake >+++ b/Source/WebKit/PlatformWin.cmake >@@ -13,8 +13,6 @@ list(APPEND WebKit_SOURCES > Platform/IPC/win/AttachmentWin.cpp > Platform/IPC/win/ConnectionWin.cpp > >- Platform/classifier/ResourceLoadStatisticsClassifier.cpp >- > Platform/win/LoggingWin.cpp > Platform/win/ModuleWin.cpp > Platform/win/SharedMemoryWin.cpp >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index a5855ba7e999770a527e017087f04e9637df246b..8f7fdee396b2a01ba077d9fd27dafbc62ed07543 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -57,9 +57,6 @@ Platform/cf/ModuleCF.cpp > > Platform/cg/CGUtilities.cpp > >-Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp >-Platform/classifier/ResourceLoadStatisticsClassifier.cpp >- > Platform/cocoa/SharedMemoryCocoa.cpp > Platform/cocoa/WKCrashReporter.mm > Platform/cocoa/WebKitAdditions.mm @no-unify >diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt >index 265384b641887537895d07f3ad5832944c01d291..6868d910244953719c4aadd824b5a0433575dda3 100644 >--- a/Source/WebKit/SourcesGTK.txt >+++ b/Source/WebKit/SourcesGTK.txt >@@ -49,8 +49,6 @@ Platform/IPC/glib/GSocketMonitor.cpp @no-unify > Platform/IPC/unix/AttachmentUnix.cpp @no-unify > Platform/IPC/unix/ConnectionUnix.cpp @no-unify > >-Platform/classifier/ResourceLoadStatisticsClassifier.cpp >- > Platform/glib/ModuleGlib.cpp @no-unify > > Platform/unix/LoggingUnix.cpp @no-unify >diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt >index 8ee2fef42a6647859f35f8d34793af94a029393e..fa242cd1a39b4929d80eda0cc5d41529e2f10c00 100644 >--- a/Source/WebKit/SourcesWPE.txt >+++ b/Source/WebKit/SourcesWPE.txt >@@ -46,8 +46,6 @@ Platform/IPC/glib/GSocketMonitor.cpp > Platform/IPC/unix/AttachmentUnix.cpp > Platform/IPC/unix/ConnectionUnix.cpp > >-Platform/classifier/ResourceLoadStatisticsClassifier.cpp >- > Platform/glib/ModuleGlib.cpp > > Platform/unix/LoggingUnix.cpp >diff --git a/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h b/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h >index f3a9a7b96a00d85d0c1ea7b1caa61c72bd1db0c4..436f84238e1b3260e8fa532f1e8b77ac7ea1460a 100644 >--- a/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h >+++ b/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.h >@@ -25,15 +25,15 @@ > > #pragma once > >-#include "ResourceLoadStatisticsClassifier.h" > #include "WebResourceLoadStatisticsStore.h" >+#include <WebCore/ResourceLoadStatisticsClassifier.h> > #include <wtf/CompletionHandler.h> > #include <wtf/Vector.h> > #include <wtf/WeakPtr.h> > #include <wtf/WorkQueue.h> > > #if HAVE(CORE_PREDICTION) >-#include "ResourceLoadStatisticsClassifierCocoa.h" >+#include <WebCore/ResourceLoadStatisticsClassifierCocoa.h> > #endif > > namespace WebCore { >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 7e7e927380d8d4ba64d3891f43c1b279a5be49e6..d5994daffb0d93b61e45f75b158e940bbd3e0c54 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -1088,8 +1088,6 @@ > 6A5080BF1F0EDAAA00E617C5 /* WKWindowFeaturesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A5080BE1F0EDAAA00E617C5 /* WKWindowFeaturesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 6B821DDC1EEF05DD00D7AF4A /* WebResourceLoadStatisticsTelemetry.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B821DDA1EEF05DD00D7AF4A /* WebResourceLoadStatisticsTelemetry.h */; }; > 6BE969C11E54D452008B7483 /* corePrediction_model in Resources */ = {isa = PBXBuildFile; fileRef = 6BE969C01E54D452008B7483 /* corePrediction_model */; }; >- 6BE969CB1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */; }; >- 6BE969CD1E54E054008B7483 /* ResourceLoadStatisticsClassifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifier.h */; }; > 6EE849C81368D9390038D481 /* WKInspectorPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 728E86F11795188C0087879E /* WebColorPickerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 728E86EF1795188C0087879E /* WebColorPickerMac.h */; }; > 753E3E0E1887398900188496 /* SessionTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 753E3E091887394B00188496 /* SessionTracker.h */; }; >@@ -2974,7 +2972,7 @@ > 37BEC4DF19491486008B4286 /* CompletionHandlerCallChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompletionHandlerCallChecker.h; sourceTree = "<group>"; }; > 37BF2F041947DEB400723C48 /* WKNSURLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNSURLRequest.h; sourceTree = "<group>"; }; > 37BF2F051947DEB400723C48 /* WKNSURLRequest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNSURLRequest.mm; sourceTree = "<group>"; }; >- 37C21CAD1E994C0C0029D5F9 /* CorePredictionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePredictionSPI.h; sourceTree = "<group>"; }; >+ 37C21CAD1E994C0C0029D5F9 /* CorePredictionSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CorePredictionSPI.h; path = ../../../../WebCore/PAL/pal/spi/cocoa/CorePredictionSPI.h; sourceTree = "<group>"; }; > 37C4C08418149C5B003688B9 /* WKBackForwardListItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKBackForwardListItem.mm; sourceTree = "<group>"; }; > 37C4C08518149C5B003688B9 /* WKBackForwardListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBackForwardListItem.h; sourceTree = "<group>"; }; > 37C4C08818149F23003688B9 /* WKBackForwardListItemInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBackForwardListItemInternal.h; sourceTree = "<group>"; }; >@@ -3511,10 +3509,6 @@ > 6B821DDA1EEF05DD00D7AF4A /* WebResourceLoadStatisticsTelemetry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadStatisticsTelemetry.h; sourceTree = "<group>"; }; > 6B821DDB1EEF05DD00D7AF4A /* WebResourceLoadStatisticsTelemetry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceLoadStatisticsTelemetry.cpp; sourceTree = "<group>"; }; > 6BE969C01E54D452008B7483 /* corePrediction_model */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = corePrediction_model; sourceTree = "<group>"; }; >- 6BE969C61E54D4B6008B7483 /* ResourceLoadStatisticsClassifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatisticsClassifier.cpp; sourceTree = "<group>"; }; >- 6BE969C81E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatisticsClassifierCocoa.cpp; sourceTree = "<group>"; }; >- 6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifierCocoa.h; sourceTree = "<group>"; }; >- 6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsClassifier.h; sourceTree = "<group>"; }; > 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>"; }; > 6EE849C61368D92D0038D481 /* WKInspectorPrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKInspectorPrivateMac.h; path = mac/WKInspectorPrivateMac.h; sourceTree = "<group>"; }; > 728E86EF1795188C0087879E /* WebColorPickerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorPickerMac.h; sourceTree = "<group>"; }; >@@ -6853,25 +6847,6 @@ > path = Resources/ResourceLoadStatistics; > sourceTree = "<group>"; > }; >- 6BE969C21E54D467008B7483 /* classifier */ = { >- isa = PBXGroup; >- children = ( >- 6BE969C31E54D467008B7483 /* cocoa */, >- 6BE969C61E54D4B6008B7483 /* ResourceLoadStatisticsClassifier.cpp */, >- 6BE969CC1E54E054008B7483 /* ResourceLoadStatisticsClassifier.h */, >- ); >- path = classifier; >- sourceTree = "<group>"; >- }; >- 6BE969C31E54D467008B7483 /* cocoa */ = { >- isa = PBXGroup; >- children = ( >- 6BE969C81E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.cpp */, >- 6BE969C91E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h */, >- ); >- path = cocoa; >- sourceTree = "<group>"; >- }; > 6EE849C41368D9040038D481 /* mac */ = { > isa = PBXGroup; > children = ( >@@ -7915,7 +7890,6 @@ > children = ( > 3709504118A88BA40087AE5D /* cf */, > 1AA2E51A12E4C05600BC4966 /* cg */, >- 6BE969C21E54D467008B7483 /* classifier */, > 4450AEBE1DC3FAAC009943F2 /* cocoa */, > 3709504218A88CDE0087AE5D /* foundation */, > A182D5B11BE6BCF40087A7CC /* ios */, >@@ -9241,8 +9215,6 @@ > A55BA81F1BA25B27007CD33D /* RemoteWebInspectorProxy.h in Headers */, > A55BA8251BA25CFB007CD33D /* RemoteWebInspectorProxyMessages.h in Headers */, > A55BA8171BA23E12007CD33D /* RemoteWebInspectorUI.h in Headers */, >- 6BE969CD1E54E054008B7483 /* ResourceLoadStatisticsClassifier.h in Headers */, >- 6BE969CB1E54D4CF008B7483 /* ResourceLoadStatisticsClassifierCocoa.h in Headers */, > 83B3CB1020E2AB0100441E9B /* ResourceLoadStatisticsMemoryStore.h in Headers */, > 51E6C1641F2935DD00FD3437 /* ResourceLoadStatisticsPersistentStorage.h in Headers */, > 1A30066E1110F4F70031937C /* ResponsivenessTimer.h in Headers */,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193200
:
358517
|
358528