Changeset 211027 in webkit


Ignore:
Timestamp:
Jan 22, 2017 9:24:51 AM (7 years ago)
Author:
mmaxfield@apple.com
Message:

Introducing the Platform Abstraction Layer (PAL)
https://bugs.webkit.org/show_bug.cgi?id=143358

Reviewed by Alex Christensen.

.:

  • CMakeLists.txt:
  • Source/CMakeLists.txt:
  • Source/cmake/WebKitFS.cmake:

Source/WebCore:

In order to enforce layering and promote testability, WebCore/platform files
should be compiled in their own project. This new project can enforce layering
and can be tested with unit tests in addition to layout tests.

The name of this new project is the Platform Abstraction Layer, or "PAL."
This comprises of a new directory in WebCore which will be the destination
for files migrated from WebCore/platform. This new folder, and its associated
project, will maintain layering invariants. These invariants are enforced at
build-time by setting the #include path for PAL to not include the rest of
WebCore (which is the same layering enforcement mechanism for WTF). Files will
be migrated into this new target/directory piece-by-piece, and the migration
of a file will be performed as soon as it can be migrated without violating
layering.

Within WebCore, files should include PAL files using the convention
#include <pal/foo.h>. Symbols within PAL are placed within a new top-level
namespace, "PAL," and therefore when used should be referred to as PAL::Foo.

The first set of files to move into the new platform is the crypto/ subdirectory
because it is both simple but also includes platform-dependent files.

No new tests because there is no behavior change.

  • CMakeLists.txt:
  • Configurations/WebCore.xcconfig: Add PAL to the include path
  • PAL/Configurations/Base.xcconfig: Added.
  • PAL/Configurations/DebugRelease.xcconfig: Added.
  • PAL/Configurations/PAL.xcconfig: Added. Sets up some PAL-specific

variables.

  • PAL/Configurations/FeatureDefines.xcconfig: Added.
  • PAL/Configurations/Version.xcconfig: Added.
  • PAL/PAL.xcodeproj/project.pbxproj: Added. New project file.
  • PAL/config.h: Added. Simplified from WebCore/config.h.
  • PAL/pal/CMakeLists.txt: Added.
  • PAL/pal/PlatformEfl.cmake: Added.
  • PAL/pal/PlatformGTK.cmake: Added.
  • PAL/pal/PlatformMac.cmake: Added.
  • PAL/pal/PlatformWin.cmake: Added.
  • PAL/pal/crypto/CryptoDigest.h: Renamed from Source/WebCore/platform/crypto/CryptoDigest.h.
  • PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp: Renamed from Source/WebCore/platform/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp.
  • PAL/pal/crypto/gcrypt/CryptoDigestGCrypt.cpp: Renamed from Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp.
  • PAL/pal/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/platform/crypto/gnutls/CryptoDigestGnuTLS.cpp.
  • PAL/pal/crypto/win/CryptoDigestWin.cpp: Renamed from Source/WebCore/platform/crypto/win/CryptoDigestWin.cpp.
  • PlatformEfl.cmake:
  • PlatformGTK.cmake:
  • PlatformMac.cmake:
  • PlatformWin.cmake:
  • WebCore.xcodeproj/project.pbxproj: Create a project link so WebCore

knows that it needs to build PAL as a dependency.

  • crypto/algorithms/CryptoAlgorithmSHA1.cpp:

(WebCore::CryptoAlgorithmSHA1::digest): Update #include and namespace.

  • crypto/algorithms/CryptoAlgorithmSHA224.cpp:

(WebCore::CryptoAlgorithmSHA224::digest): Ditto.

  • crypto/algorithms/CryptoAlgorithmSHA256.cpp:

(WebCore::CryptoAlgorithmSHA256::digest): Ditto.

  • crypto/algorithms/CryptoAlgorithmSHA384.cpp:

(WebCore::CryptoAlgorithmSHA384::digest): Ditto.

  • crypto/algorithms/CryptoAlgorithmSHA512.cpp:

(WebCore::CryptoAlgorithmSHA512::digest): Ditto.

  • crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:

(WebCore::cryptoDigestAlgorithm): Ditto.
(WebCore::signRSASSA_PKCS1_v1_5): Ditto.
(WebCore::verifyRSASSA_PKCS1_v1_5): Ditto.

  • inspector/InspectorDOMAgent.cpp:

(WebCore::computeContentSecurityPolicySHA256Hash): Ditto.

  • page/csp/ContentSecurityPolicy.cpp:

(WebCore::toCryptoDigestAlgorithm): Ditto.
(WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): Ditto.

  • platform/network/soup/SoupNetworkSession.cpp:

(WebCore::HostTLSCertificateSet::computeCertificateHash): Ditto.

Location:
trunk
Files:
20 added
1 deleted
29 edited
6 copied

Legend:

Unmodified
Added
Removed
  • trunk/CMakeLists.txt

    r210734 r211027  
    115115
    116116set(JavaScriptCore_LIBRARY_TYPE SHARED)
     117set(PAL_LIBRARY_TYPE STATIC)
    117118set(WebKit_LIBRARY_TYPE SHARED)
    118119set(WebKit2_LIBRARY_TYPE SHARED)
  • trunk/ChangeLog

    r210992 r211027  
     12017-01-22  Don Olmstead <don.olmstead@am.sony.com> and Myles C. Maxfield <mmaxfield@apple.com>
     2
     3        Introducing the Platform Abstraction Layer (PAL)
     4        https://bugs.webkit.org/show_bug.cgi?id=143358
     5
     6        Reviewed by Alex Christensen.
     7
     8        * CMakeLists.txt:
     9        * Source/CMakeLists.txt:
     10        * Source/cmake/WebKitFS.cmake:
     11
    1122017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
    213
  • trunk/Source/CMakeLists.txt

    r205418 r211027  
    4747
    4848if (ENABLE_WEBCORE)
     49    WEBKIT_SET_EXTRA_COMPILER_FLAGS(PAL ${ADDITIONAL_COMPILER_FLAGS})
    4950    WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCoreTestSupport ${ADDITIONAL_COMPILER_FLAGS})
    5051    WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebCore ${ADDITIONAL_COMPILER_FLAGS})
  • trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig

    r210992 r211027  
    1 // Copyright (C) 2009, 2010, 2014, 2015, 2016 Apple Inc. All rights reserved.
     1// Copyright (C) 2009, 2010, 2014, 2015, 2016, 2017 Apple Inc. All rights reserved.
    22// Copyright (C) 2009 Google Inc. All rights reserved.
    33//
  • trunk/Source/WebCore/CMakeLists.txt

    r210936 r211027  
    22include(WebKitCommon)
    33set_property(DIRECTORY . PROPERTY FOLDER "WebCore")
     4add_subdirectory(PAL/pal)
    45
    56set(WebCore_INCLUDE_DIRECTORIES
     
    29462947    ${ICU_LIBRARIES}
    29472948    JavaScriptCore${DEBUG_SUFFIX}
     2949    PAL${DEBUG_SUFFIX}
    29482950)
    29492951
  • trunk/Source/WebCore/ChangeLog

    r211026 r211027  
     12017-01-22  Don Olmstead <don.olmstead@am.sony.com> and Myles C. Maxfield <mmaxfield@apple.com>
     2
     3        Introducing the Platform Abstraction Layer (PAL)
     4        https://bugs.webkit.org/show_bug.cgi?id=143358
     5
     6        Reviewed by Alex Christensen.
     7
     8        In order to enforce layering and promote testability, WebCore/platform files
     9        should be compiled in their own project. This new project can enforce layering
     10        and can be tested with unit tests in addition to layout tests.
     11
     12        The name of this new project is the Platform Abstraction Layer, or "PAL."
     13        This comprises of a new directory in WebCore which will be the destination
     14        for files migrated from WebCore/platform. This new folder, and its associated
     15        project, will maintain layering invariants. These invariants are enforced at
     16        build-time by setting the #include path for PAL to not include the rest of
     17        WebCore (which is the same layering enforcement mechanism for WTF). Files will
     18        be migrated into this new target/directory piece-by-piece, and the migration
     19        of a file will be performed as soon as it can be migrated without violating
     20        layering.
     21
     22        Within WebCore, files should include PAL files using the convention
     23        #include <pal/foo.h>. Symbols within PAL are placed within a new top-level
     24        namespace, "PAL," and therefore when used should be referred to as PAL::Foo.
     25
     26        The first set of files to move into the new platform is the crypto/ subdirectory
     27        because it is both simple but also includes platform-dependent files.
     28
     29        No new tests because there is no behavior change.
     30
     31        * CMakeLists.txt:
     32        * Configurations/WebCore.xcconfig: Add PAL to the include path
     33        * PAL/Configurations/Base.xcconfig: Added.
     34        * PAL/Configurations/DebugRelease.xcconfig: Added.
     35        * PAL/Configurations/PAL.xcconfig: Added. Sets up some PAL-specific
     36        variables.
     37        * PAL/Configurations/FeatureDefines.xcconfig: Added.
     38        * PAL/Configurations/Version.xcconfig: Added.
     39        * PAL/PAL.xcodeproj/project.pbxproj: Added. New project file.
     40        * PAL/config.h: Added. Simplified from WebCore/config.h.
     41        * PAL/pal/CMakeLists.txt: Added.
     42        * PAL/pal/PlatformEfl.cmake: Added.
     43        * PAL/pal/PlatformGTK.cmake: Added.
     44        * PAL/pal/PlatformMac.cmake: Added.
     45        * PAL/pal/PlatformWin.cmake: Added.
     46        * PAL/pal/crypto/CryptoDigest.h: Renamed from Source/WebCore/platform/crypto/CryptoDigest.h.
     47        * PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp: Renamed from Source/WebCore/platform/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp.
     48        * PAL/pal/crypto/gcrypt/CryptoDigestGCrypt.cpp: Renamed from Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp.
     49        * PAL/pal/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/platform/crypto/gnutls/CryptoDigestGnuTLS.cpp.
     50        * PAL/pal/crypto/win/CryptoDigestWin.cpp: Renamed from Source/WebCore/platform/crypto/win/CryptoDigestWin.cpp.
     51        * PlatformEfl.cmake:
     52        * PlatformGTK.cmake:
     53        * PlatformMac.cmake:
     54        * PlatformWin.cmake:
     55        * WebCore.xcodeproj/project.pbxproj: Create a project link so WebCore
     56        knows that it needs to build PAL as a dependency.
     57        * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
     58        (WebCore::CryptoAlgorithmSHA1::digest): Update #include and namespace.
     59        * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
     60        (WebCore::CryptoAlgorithmSHA224::digest): Ditto.
     61        * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
     62        (WebCore::CryptoAlgorithmSHA256::digest): Ditto.
     63        * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
     64        (WebCore::CryptoAlgorithmSHA384::digest): Ditto.
     65        * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
     66        (WebCore::CryptoAlgorithmSHA512::digest): Ditto.
     67        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
     68        (WebCore::cryptoDigestAlgorithm): Ditto.
     69        (WebCore::signRSASSA_PKCS1_v1_5): Ditto.
     70        (WebCore::verifyRSASSA_PKCS1_v1_5): Ditto.
     71        * inspector/InspectorDOMAgent.cpp:
     72        (WebCore::computeContentSecurityPolicySHA256Hash): Ditto.
     73        * page/csp/ContentSecurityPolicy.cpp:
     74        (WebCore::toCryptoDigestAlgorithm): Ditto.
     75        (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): Ditto.
     76        * platform/network/soup/SoupNetworkSession.cpp:
     77        (WebCore::HostTLSCertificateSet::computeCertificateHash): Ditto.
     78
    1792017-01-22  Zan Dobersek  <zdobersek@igalia.com>
    280
  • trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig

    r210992 r211027  
    1 // Copyright (C) 2009, 2010, 2014, 2015, 2016 Apple Inc. All rights reserved.
     1// Copyright (C) 2009, 2010, 2014, 2015, 2016, 2017 Apple Inc. All rights reserved.
    22// Copyright (C) 2009 Google Inc. All rights reserved.
    33//
  • trunk/Source/WebCore/Configurations/WebCore.xcconfig

    r210688 r211027  
    4747WEBKITADDITIONS_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include/WebKitAdditions $(SDKROOT)/usr/local/include/WebKitAdditions;
    4848
    49 HEADER_SEARCH_PATHS = ForwardingHeaders icu /usr/include/libxslt /usr/include/libxml2 "$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore" "$(BUILT_PRODUCTS_DIR)/usr/local/include" $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) $(HEADER_SEARCH_PATHS);
     49HEADER_SEARCH_PATHS = PAL ForwardingHeaders icu /usr/include/libxslt /usr/include/libxml2 "$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore" "$(BUILT_PRODUCTS_DIR)/usr/local/include" $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) $(HEADER_SEARCH_PATHS);
    5050INFOPLIST_FILE = Info.plist;
    5151INSTALL_PATH = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
  • trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig

    r211026 r211027  
    1 // Copyright (C) 2009, 2010, 2014, 2015, 2016 Apple Inc. All rights reserved.
     1// Copyright (C) 2009, 2010, 2014, 2015, 2016, 2017 Apple Inc. All rights reserved.
    22// Copyright (C) 2009 Google Inc. All rights reserved.
    33//
  • trunk/Source/WebCore/PAL/pal/crypto/CryptoDigest.h

    r211026 r211027  
    2424 */
    2525
    26 #ifndef CryptoDigest_h
    27 #define CryptoDigest_h
     26#pragma once
    2827
    2928#include <wtf/Noncopyable.h>
    3029#include <wtf/Vector.h>
    3130
    32 namespace WebCore {
     31namespace PAL {
    3332
    3433struct CryptoDigestContext;
     
    5655};
    5756
    58 } // namespace WebCore
    59 
    60 #endif // CryptoDigest_h
     57} // namespace PAL
  • trunk/Source/WebCore/PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp

    r211026 r211027  
    2929#include <CommonCrypto/CommonCrypto.h>
    3030
    31 namespace WebCore {
     31namespace PAL {
    3232
    3333struct CryptoDigestContext {
     
    177177}
    178178
    179 } // namespace WebCore
     179} // namespace PAL
  • trunk/Source/WebCore/PAL/pal/crypto/gcrypt/CryptoDigestGCrypt.cpp

    r211026 r211027  
    3030#include <gcrypt.h>
    3131
    32 namespace WebCore {
     32namespace PAL {
    3333
    3434struct CryptoDigestContext {
     
    9595}
    9696
    97 } // namespace WebCore
     97} // namespace PAL
  • trunk/Source/WebCore/PAL/pal/crypto/gnutls/CryptoDigestGnuTLS.cpp

    r211026 r211027  
    3030#include <gnutls/crypto.h>
    3131
    32 namespace WebCore {
     32namespace PAL {
    3333
    3434struct CryptoDigestContext {
     
    100100}
    101101
    102 } // namespace WebCore
     102} // namespace PAL
  • trunk/Source/WebCore/PAL/pal/crypto/win/CryptoDigestWin.cpp

    r211026 r211027  
    2727#include "CryptoDigest.h"
    2828
     29#include <windows.h>
    2930#include <wincrypt.h>
    3031
    31 namespace WebCore {
     32namespace PAL {
    3233
    3334struct CryptoDigestContext {
     
    101102}
    102103
    103 } // namespace WebCore
     104} // namespace PAL
  • trunk/Source/WebCore/PlatformEfl.cmake

    r209665 r211027  
    6969
    7070    platform/audio/efl/AudioBusEfl.cpp
    71 
    72     platform/crypto/gcrypt/CryptoDigestGCrypt.cpp
    7371
    7472    platform/efl/CursorEfl.cpp
  • trunk/Source/WebCore/PlatformGTK.cmake

    r210582 r211027  
    6969    platform/audio/glib/AudioBusGLib.cpp
    7070
    71     platform/crypto/gcrypt/CryptoDigestGCrypt.cpp
    72 
    7371    platform/gamepad/glib/GamepadsGlib.cpp
    7472
  • trunk/Source/WebCore/PlatformMac.cmake

    r210884 r211027  
    334334    platform/cocoa/WebCoreNSErrorExtras.mm
    335335
    336     platform/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
    337 
    338336    platform/gamepad/mac/HIDGamepad.cpp
    339337    platform/gamepad/mac/HIDGamepadProvider.cpp
  • trunk/Source/WebCore/PlatformWin.cmake

    r210532 r211027  
    7474    platform/cf/win/CertificateCFWin.cpp
    7575
    76     platform/crypto/win/CryptoDigestWin.cpp
    77 
    7876    platform/graphics/GraphicsContext3DPrivate.cpp
    7977
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r211008 r211027  
    978978                1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */; };
    979979                1C0939EB1A13E12900B788E5 /* CachedSVGFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0939E91A13E12900B788E5 /* CachedSVGFont.h */; };
     980                1C09D0591E31C6A900725F18 /* libPAL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C09D0501E31C32900725F18 /* libPAL.a */; };
    980981                1C18DA58181AF6A500C4EF22 /* TextPainter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */; };
    981982                1C18DA59181AF6A500C4EF22 /* TextPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C18DA57181AF6A500C4EF22 /* TextPainter.h */; };
     
    62646265                E1F80B8D183172B5007885C3 /* JSCryptoKeyPair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */; };
    62656266                E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */; };
    6266                 E1FE13641834351100892F13 /* CryptoDigestCommonCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FE13621834351100892F13 /* CryptoDigestCommonCrypto.cpp */; };
    6267                 E1FE136718343A1000892F13 /* CryptoDigest.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FE136618343A1000892F13 /* CryptoDigest.h */; };
    62686267                E1FE136A183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FE1368183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.cpp */; };
    62696268                E1FE136B183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FE1369183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h */; };
     
    68906889
    68916890/* Begin PBXContainerItemProxy section */
     6891                1C09D04F1E31C32900725F18 /* PBXContainerItemProxy */ = {
     6892                        isa = PBXContainerItemProxy;
     6893                        containerPortal = 1C09D04B1E31C32800725F18 /* PAL.xcodeproj */;
     6894                        proxyType = 2;
     6895                        remoteGlobalIDString = 1C09D03D1E31C32800725F18;
     6896                        remoteInfo = PAL;
     6897                };
     6898                1C09D0671E32079D00725F18 /* PBXContainerItemProxy */ = {
     6899                        isa = PBXContainerItemProxy;
     6900                        containerPortal = 1C09D04B1E31C32800725F18 /* PAL.xcodeproj */;
     6901                        proxyType = 1;
     6902                        remoteGlobalIDString = 1C09D03C1E31C32800725F18;
     6903                        remoteInfo = PAL;
     6904                };
    68926905                417DA6D413734E0D007C57FB /* PBXContainerItemProxy */ = {
    68936906                        isa = PBXContainerItemProxy;
     
    80568069                1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGFont.cpp; sourceTree = "<group>"; };
    80578070                1C0939E91A13E12900B788E5 /* CachedSVGFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedSVGFont.h; sourceTree = "<group>"; };
     8071                1C09D04B1E31C32800725F18 /* PAL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PAL.xcodeproj; path = PAL/PAL.xcodeproj; sourceTree = "<group>"; };
    80588072                1C18DA56181AF6A500C4EF22 /* TextPainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextPainter.cpp; sourceTree = "<group>"; };
    80598073                1C18DA57181AF6A500C4EF22 /* TextPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPainter.h; sourceTree = "<group>"; };
     
    1427514289                E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeyPair.cpp; sourceTree = "<group>"; };
    1427614290                E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoKeyPair.h; sourceTree = "<group>"; };
    14277                 E1FE13621834351100892F13 /* CryptoDigestCommonCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoDigestCommonCrypto.cpp; sourceTree = "<group>"; };
    14278                 E1FE136618343A1000892F13 /* CryptoDigest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoDigest.h; sourceTree = "<group>"; };
    1427914291                E1FE1368183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRSA_OAEP.cpp; sourceTree = "<group>"; };
    1428014292                E1FE1369183FE1AB00892F13 /* CryptoAlgorithmRSA_OAEP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRSA_OAEP.h; sourceTree = "<group>"; };
     
    1499015002                        buildActionMask = 2147483647;
    1499115003                        files = (
     15004                                1C09D0591E31C6A900725F18 /* libPAL.a in Frameworks */,
    1499215005                                FD2DBF1212B048A300ED98C6 /* Accelerate.framework in Frameworks */,
    1499315006                                FD2DBF1312B048A300ED98C6 /* AudioToolbox.framework in Frameworks */,
     
    1540515418                        isa = PBXGroup;
    1540615419                        children = (
     15420                                1C09D04B1E31C32800725F18 /* PAL.xcodeproj */,
    1540715421                                65C97AF208EA908800ACD273 /* config.h */,
    1540815422                                EDEC98020AED7E170059137F /* WebCorePrefix.h */,
     
    1608416098                        );
    1608516099                        path = mac;
     16100                        sourceTree = "<group>";
     16101                };
     16102                1C09D04C1E31C32800725F18 /* Products */ = {
     16103                        isa = PBXGroup;
     16104                        children = (
     16105                                1C09D0501E31C32900725F18 /* libPAL.a */,
     16106                        );
     16107                        name = Products;
    1608616108                        sourceTree = "<group>";
    1608716109                };
     
    2250022522                                1AE42F670AA4B8CB00C8612D /* cf */,
    2250122523                                A5C974CE11485FDA0066F2AB /* cocoa */,
    22502                                 CE50D8CE1C8932ED0072EA5A /* crypto */,
    2250322524                                515BE1871D54F5DB00DD7C68 /* gamepad */,
    2250422525                                B2A015910AF6CD53006BCE0E /* graphics */,
     
    2294222963                        );
    2294322964                        path = ios;
    22944                         sourceTree = "<group>";
    22945                 };
    22946                 CE50D8CE1C8932ED0072EA5A /* crypto */ = {
    22947                         isa = PBXGroup;
    22948                         children = (
    22949                                 CE50D8CF1C8932FB0072EA5A /* commoncrypto */,
    22950                                 E1FE136618343A1000892F13 /* CryptoDigest.h */,
    22951                         );
    22952                         path = crypto;
    22953                         sourceTree = "<group>";
    22954                 };
    22955                 CE50D8CF1C8932FB0072EA5A /* commoncrypto */ = {
    22956                         isa = PBXGroup;
    22957                         children = (
    22958                                 E1FE13621834351100892F13 /* CryptoDigestCommonCrypto.cpp */,
    22959                         );
    22960                         path = commoncrypto;
    2296122965                        sourceTree = "<group>";
    2296222966                };
     
    2525425258                                E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */,
    2525525259                                E19AC3F51824DC7900349426 /* CryptoAlgorithmSHA512.h in Headers */,
    25256                                 E1FE136718343A1000892F13 /* CryptoDigest.h in Headers */,
    2525725260                                E157A8E518173A3A009F821D /* CryptoKey.h in Headers */,
    2525825261                                E125F84E1824289D00D84CD9 /* CryptoKeyAES.h in Headers */,
     
    2850928512                        );
    2851028513                        dependencies = (
     28514                                1C09D0681E32079D00725F18 /* PBXTargetDependency */,
    2851128515                                DD041FF109D9E3250010AF2A /* PBXTargetDependency */,
    2851228516                        );
     
    2856128565                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
    2856228566                        projectDirPath = "";
     28567                        projectReferences = (
     28568                                {
     28569                                        ProductGroup = 1C09D04C1E31C32800725F18 /* Products */;
     28570                                        ProjectRef = 1C09D04B1E31C32800725F18 /* PAL.xcodeproj */;
     28571                                },
     28572                        );
    2856328573                        projectRoot = "";
    2856428574                        targets = (
     
    2857128581                };
    2857228582/* End PBXProject section */
     28583
     28584/* Begin PBXReferenceProxy section */
     28585                1C09D0501E31C32900725F18 /* libPAL.a */ = {
     28586                        isa = PBXReferenceProxy;
     28587                        fileType = archive.ar;
     28588                        path = libPAL.a;
     28589                        remoteRef = 1C09D04F1E31C32900725F18 /* PBXContainerItemProxy */;
     28590                        sourceTree = BUILT_PRODUCTS_DIR;
     28591                };
     28592/* End PBXReferenceProxy section */
    2857328593
    2857428594/* Begin PBXResourcesBuildPhase section */
     
    2909829118                                E19AC3F21824DC7900349426 /* CryptoAlgorithmSHA384.cpp in Sources */,
    2909929119                                E19AC3F41824DC7900349426 /* CryptoAlgorithmSHA512.cpp in Sources */,
    29100                                 E1FE13641834351100892F13 /* CryptoDigestCommonCrypto.cpp in Sources */,
    2910129120                                E157A8E418173A3A009F821D /* CryptoKey.cpp in Sources */,
    2910229121                                E125F84D1824289D00D84CD9 /* CryptoKeyAES.cpp in Sources */,
     
    3193031949
    3193131950/* Begin PBXTargetDependency section */
     31951                1C09D0681E32079D00725F18 /* PBXTargetDependency */ = {
     31952                        isa = PBXTargetDependency;
     31953                        name = PAL;
     31954                        targetProxy = 1C09D0671E32079D00725F18 /* PBXContainerItemProxy */;
     31955                };
    3193231956                417DA6D513734E0D007C57FB /* PBXTargetDependency */ = {
    3193331957                        isa = PBXTargetDependency;
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA1.cpp

    r209164 r211027  
    2929#if ENABLE(SUBTLE_CRYPTO)
    3030
    31 #include "CryptoDigest.h"
    3231#include "ExceptionCode.h"
    3332#include "ScriptExecutionContext.h"
     33#include <pal/crypto/CryptoDigest.h>
    3434
    3535namespace WebCore {
     
    4747void CryptoAlgorithmSHA1::digest(Vector<uint8_t>&& message, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
    4848{
    49     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_1);
     49    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_1);
    5050    if (!digest) {
    5151        exceptionCallback(OperationError);
     
    6666ExceptionOr<void> CryptoAlgorithmSHA1::digest(const CryptoAlgorithmParametersDeprecated&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    6767{
    68     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_1);
     68    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_1);
    6969    if (!digest) {
    7070        failureCallback();
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA224.cpp

    r209164 r211027  
    2929#if ENABLE(SUBTLE_CRYPTO)
    3030
    31 #include "CryptoDigest.h"
    3231#include "ExceptionCode.h"
    3332#include "ScriptExecutionContext.h"
     33#include <pal/crypto/CryptoDigest.h>
    3434
    3535namespace WebCore {
     
    4747void CryptoAlgorithmSHA224::digest(Vector<uint8_t>&& message, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
    4848{
    49     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_224);
     49    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_224);
    5050    if (!digest) {
    5151        exceptionCallback(OperationError);
     
    6666ExceptionOr<void> CryptoAlgorithmSHA224::digest(const CryptoAlgorithmParametersDeprecated&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    6767{
    68     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_224);
     68    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_224);
    6969    if (!digest) {
    7070        failureCallback();
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA256.cpp

    r209164 r211027  
    2929#if ENABLE(SUBTLE_CRYPTO)
    3030
    31 #include "CryptoDigest.h"
    3231#include "ExceptionCode.h"
    3332#include "ScriptExecutionContext.h"
     33#include <pal/crypto/CryptoDigest.h>
    3434
    3535namespace WebCore {
     
    4747void CryptoAlgorithmSHA256::digest(Vector<uint8_t>&& message, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
    4848{
    49     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_256);
     49    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_256);
    5050    if (!digest) {
    5151        exceptionCallback(OperationError);
     
    6666ExceptionOr<void> CryptoAlgorithmSHA256::digest(const CryptoAlgorithmParametersDeprecated&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    6767{
    68     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_256);
     68    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_256);
    6969    if (!digest) {
    7070        failureCallback();
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA384.cpp

    r209164 r211027  
    2929#if ENABLE(SUBTLE_CRYPTO)
    3030
    31 #include "CryptoDigest.h"
    3231#include "ExceptionCode.h"
    3332#include "ScriptExecutionContext.h"
     33#include <pal/crypto/CryptoDigest.h>
    3434
    3535namespace WebCore {
     
    4747void CryptoAlgorithmSHA384::digest(Vector<uint8_t>&& message, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
    4848{
    49     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_384);
     49    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_384);
    5050    if (!digest) {
    5151        exceptionCallback(OperationError);
     
    6666ExceptionOr<void> CryptoAlgorithmSHA384::digest(const CryptoAlgorithmParametersDeprecated&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    6767{
    68     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_384);
     68    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_384);
    6969    if (!digest) {
    7070        failureCallback();
  • trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmSHA512.cpp

    r209164 r211027  
    2929#if ENABLE(SUBTLE_CRYPTO)
    3030
    31 #include "CryptoDigest.h"
    3231#include "ExceptionCode.h"
    3332#include "ScriptExecutionContext.h"
     33#include <pal/crypto/CryptoDigest.h>
    3434
    3535namespace WebCore {
     
    4747void CryptoAlgorithmSHA512::digest(Vector<uint8_t>&& message, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue)
    4848{
    49     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_512);
     49    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_512);
    5050    if (!digest) {
    5151        exceptionCallback(OperationError);
     
    6666ExceptionOr<void> CryptoAlgorithmSHA512::digest(const CryptoAlgorithmParametersDeprecated&, const CryptoOperationData& data, VectorCallback&& callback, VoidCallback&& failureCallback)
    6767{
    68     auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_512);
     68    auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_512);
    6969    if (!digest) {
    7070        failureCallback();
  • trunk/Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp

    r209150 r211027  
    3131#include "CommonCryptoUtilities.h"
    3232#include "CryptoAlgorithmRsaSsaParamsDeprecated.h"
    33 #include "CryptoDigest.h"
    3433#include "CryptoKeyRSA.h"
    3534#include "ExceptionCode.h"
    3635#include "ScriptExecutionContext.h"
     36#include <pal/crypto/CryptoDigest.h>
    3737
    3838namespace WebCore {
    3939
    40 inline std::optional<CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction)
     40inline std::optional<PAL::CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction)
    4141{
    4242    switch (hashFunction) {
    4343    case CryptoAlgorithmIdentifier::SHA_1:
    44         return CryptoDigest::Algorithm::SHA_1;
     44        return PAL::CryptoDigest::Algorithm::SHA_1;
    4545    case CryptoAlgorithmIdentifier::SHA_224:
    46         return CryptoDigest::Algorithm::SHA_224;
     46        return PAL::CryptoDigest::Algorithm::SHA_224;
    4747    case CryptoAlgorithmIdentifier::SHA_256:
    48         return CryptoDigest::Algorithm::SHA_256;
     48        return PAL::CryptoDigest::Algorithm::SHA_256;
    4949    case CryptoAlgorithmIdentifier::SHA_384:
    50         return CryptoDigest::Algorithm::SHA_384;
     50        return PAL::CryptoDigest::Algorithm::SHA_384;
    5151    case CryptoAlgorithmIdentifier::SHA_512:
    52         return CryptoDigest::Algorithm::SHA_512;
     52        return PAL::CryptoDigest::Algorithm::SHA_512;
    5353    default:
    5454        return std::nullopt;
     
    6767    if (!cryptoDigestAlgorithm)
    6868        return Exception { OperationError };
    69     auto digest = CryptoDigest::create(*cryptoDigestAlgorithm);
     69    auto digest = PAL::CryptoDigest::create(*cryptoDigestAlgorithm);
    7070    if (!digest)
    7171        return Exception { OperationError };
     
    9494    if (!cryptoDigestAlgorithm)
    9595        return Exception { OperationError };
    96     auto digest = CryptoDigest::create(*cryptoDigestAlgorithm);
     96    auto digest = PAL::CryptoDigest::create(*cryptoDigestAlgorithm);
    9797    if (!digest)
    9898        return Exception { OperationError };
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r210828 r211027  
    4646#include "Cookie.h"
    4747#include "CookieJar.h"
    48 #include "CryptoDigest.h"
    4948#include "DOMEditor.h"
    5049#include "DOMPatchSupport.h"
     
    9796#include <inspector/InjectedScript.h>
    9897#include <inspector/InjectedScriptManager.h>
     98#include <pal/crypto/CryptoDigest.h>
    9999#include <runtime/JSCInlines.h>
    100100#include <wtf/text/Base64.h>
     
    13171317    const TextEncoding& encodingToUse = documentEncoding.isValid() ? documentEncoding : UTF8Encoding();
    13181318    CString content = encodingToUse.encode(TextNodeTraversal::contentsAsString(element), EntitiesForUnencodables);
    1319     auto cryptoDigest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_256);
     1319    auto cryptoDigest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_256);
    13201320    cryptoDigest->addBytes(content.data(), content.length());
    13211321    Vector<uint8_t> digest = cryptoDigest->computeHash();
  • trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp

    r210992 r211027  
    3434#include "ContentSecurityPolicySource.h"
    3535#include "ContentSecurityPolicySourceList.h"
    36 #include "CryptoDigest.h"
    3736#include "DOMStringList.h"
    3837#include "Document.h"
     
    5857#include <inspector/ScriptCallStack.h>
    5958#include <inspector/ScriptCallStackFactory.h>
     59#include <pal/crypto/CryptoDigest.h>
    6060#include <wtf/SetForScope.h>
    6161#include <wtf/text/StringBuilder.h>
     
    302302}
    303303
    304 static CryptoDigest::Algorithm toCryptoDigestAlgorithm(ContentSecurityPolicyHashAlgorithm algorithm)
     304static PAL::CryptoDigest::Algorithm toCryptoDigestAlgorithm(ContentSecurityPolicyHashAlgorithm algorithm)
    305305{
    306306    switch (algorithm) {
    307307    case ContentSecurityPolicyHashAlgorithm::SHA_256:
    308         return CryptoDigest::Algorithm::SHA_256;
     308        return PAL::CryptoDigest::Algorithm::SHA_256;
    309309    case ContentSecurityPolicyHashAlgorithm::SHA_384:
    310         return CryptoDigest::Algorithm::SHA_384;
     310        return PAL::CryptoDigest::Algorithm::SHA_384;
    311311    case ContentSecurityPolicyHashAlgorithm::SHA_512:
    312         return CryptoDigest::Algorithm::SHA_512;
     312        return PAL::CryptoDigest::Algorithm::SHA_512;
    313313    }
    314314    ASSERT_NOT_REACHED();
    315     return CryptoDigest::Algorithm::SHA_512;
     315    return PAL::CryptoDigest::Algorithm::SHA_512;
    316316}
    317317
     
    334334    bool foundHashInReportOnlyPolicies = false;
    335335    for (auto algorithm : algorithms) {
    336         auto cryptoDigest = CryptoDigest::create(toCryptoDigestAlgorithm(algorithm));
     336        auto cryptoDigest = PAL::CryptoDigest::create(toCryptoDigestAlgorithm(algorithm));
    337337        cryptoDigest->addBytes(contentCString.data(), contentCString.length());
    338338        ContentSecurityPolicyHash hash = { algorithm, cryptoDigest->computeHash() };
  • trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp

    r211014 r211027  
    3131
    3232#include "AuthenticationChallenge.h"
    33 #include "CryptoDigest.h"
    3433#include "FileSystem.h"
    3534#include "GUniquePtrSoup.h"
     
    3938#include <glib/gstdio.h>
    4039#include <libsoup/soup.h>
     40#include <pal/crypto/CryptoDigest.h>
    4141#include <wtf/HashSet.h>
    4242#include <wtf/NeverDestroyed.h>
     
    7979            return String();
    8080
    81         auto digest = CryptoDigest::create(CryptoDigest::Algorithm::SHA_256);
     81        auto digest = PAL::CryptoDigest::create(PAL::CryptoDigest::Algorithm::SHA_256);
    8282        digest->addBytes(certificateData->data, certificateData->len);
    8383
  • trunk/Source/WebKit/CMakeLists.txt

    r210359 r211027  
    3333    PRIVATE JavaScriptCore${DEBUG_SUFFIX}
    3434    PRIVATE WebCore${DEBUG_SUFFIX}
     35    PRIVATE PAL${DEBUG_SUFFIX}
    3536)
    3637
  • trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig

    r210992 r211027  
    1 // Copyright (C) 2009, 2010, 2014, 2015, 2016 Apple Inc. All rights reserved.
     1// Copyright (C) 2009, 2010, 2014, 2015, 2016, 2017 Apple Inc. All rights reserved.
    22// Copyright (C) 2009 Google Inc. All rights reserved.
    33//
  • trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig

    r210992 r211027  
    1 // Copyright (C) 2009, 2010, 2014, 2015, 2016 Apple Inc. All rights reserved.
     1// Copyright (C) 2009, 2010, 2014, 2015, 2016, 2017 Apple Inc. All rights reserved.
    22// Copyright (C) 2009 Google Inc. All rights reserved.
    33//
  • trunk/Source/cmake/OptionsWin.cmake

    r210992 r211027  
    183183set(JavaScriptCore_LIBRARY_TYPE SHARED)
    184184set(WTF_LIBRARY_TYPE SHARED)
     185set(PAL_LIBRARY_TYPE STATIC)
    185186
    186187find_package(ICU REQUIRED)
  • trunk/Source/cmake/WebKitFS.cmake

    r205418 r211027  
    1010if (NOT WEBCORE_DIR)
    1111    set(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore")
     12endif ()
     13if (NOT PAL_DIR)
     14    set(PAL_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore/PAL")
    1215endif ()
    1316if (NOT WEBKIT_DIR)
  • trunk/Tools/Scripts/webkitpy/style/checkers/featuredefines.py

    r199217 r211027  
    4444            "Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig",
    4545            "Source/WebCore/Configurations/FeatureDefines.xcconfig",
     46            "Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig",
    4647            "Source/WebKit/mac/Configurations/FeatureDefines.xcconfig",
    4748            "Source/WebKit2/Configurations/FeatureDefines.xcconfig",
  • trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig

    r210992 r211027  
    1 // Copyright (C) 2009, 2010, 2014, 2015, 2016 Apple Inc. All rights reserved.
     1// Copyright (C) 2009, 2010, 2014, 2015, 2016, 2017 Apple Inc. All rights reserved.
    22// Copyright (C) 2009 Google Inc. All rights reserved.
    33//
Note: See TracChangeset for help on using the changeset viewer.