commit | 9adff4f28264c5f1f79bc78096c80cf8bedf6648 | [log] [tgz] |
---|---|---|
author | darin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc> | Mon Jan 24 00:55:31 2022 +0000 |
committer | darin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc> | Mon Jan 24 00:55:31 2022 +0000 |
tree | de3ae276473a06518edaee2ea9482261a35560f8 | |
parent | d83219997d56017de70fab63f837c76c4b36062d [diff] |
Improve FourCC to use more inlining, fix incorrect mix of WEBCORE_EXPORT on entire class with inline functions https://bugs.webkit.org/show_bug.cgi?id=235461 Reviewed by Sam Weinig. * WebCore.xcodeproj/project.pbxproj: Added FourCC.cpp. Because of unified sources it was compiled, but because it was not in the project various Xcode features would not work. * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp: Added some explicitly non-inlined exported functions. These need to be exported because they are used in TestWebKitAPI tests and we want to export the functions rather than the vtable pointer. * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h: Stop using WEBCORE_EXPORT on whole classes that contain inline functions, and instead use it on individual functions. * platform/graphics/FourCC.cpp: (WebCore::FourCC::fromString): Take a StringView instead of String. Removed unnecessary allocation of a temporary CString for the result of String::ascii. (WebCore::FourCC::string const): Rename from toString to string and changed the return type to std::array instead of String. * platform/graphics/FourCC.h: Made all the constructors constexpr. Changed the string literal constructor to just work with 4-character strings. The old one was a template for any length string, but then asserted it was 4 characters long, which is a roundabout way to do it. * platform/graphics/HEVCUtilities.cpp: (WebCore::parseHEVCDecoderConfigurationRecord): Take FourCC instead of const FourCC&. Also removed unnecessary explicit conversion to FourCC since four character strings. * platform/graphics/HEVCUtilities.h: Ditto. * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h: Removed unneeded WEBCORE_EXPORT on these classes. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Removed unnecesary calls to toString, logging can handle FourCC without it. Also removed unneeded type casts to size_t. * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: (WebCore::contentTypesToCodecs): Removed unnecessary allocation of a String by using StringView for the substring. * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: (WebCore::validateHEVCParameters): Added an explicit cast to String since FourCC::fromString now takes a StringView. Sadly there's not a trivial way to do this without allocating a String. * platform/graphics/cv/GraphicsContextGLCVCocoa.cpp: (WebCore::GraphicsContextGLCVCocoa::copyVideoSampleToTexture): Since FourCC::string now returns a std::array with a C-style null-terminated string, use it instead of calling toString and then utf8. Cleaner and also much more efficient. * platform/graphics/iso/ISOBox.cpp: Moved constructors and destructors so they are no longer inlined so there is no need to export the vtable. (WebCore::ISOBox::peekBox): Removed unnecessary initialization of FourCC since they are zero by default. * platform/graphics/iso/ISOBox.h: Removed WEBCORE_EXPORT of the entire class, since that's not fully compatible with a class with inline functions (warning is done by check-webkit-style). Put WEBCORE_EXPORT on individual functions instead. Also use some more constexpr, removed unneeded FourCC initialization since it is zero by default, and use FourCC, not const FourCC& for return value. * platform/graphics/iso/ISOOriginalFormatBox.h: Removed unneeded FourCC initialization since it is zero by default. * platform/graphics/iso/ISOSchemeTypeBox.h: Ditto. * platform/graphics/iso/ISOVTTCue.cpp: Moved constructors and destructors so they are no longer inlined so there is no need to export the vtable. (WebCore::ISOWebVTTCue::parse): Use PRIu64 instead of casting to size_t, no need to rely on the relationship between type sizes. * platform/graphics/iso/ISOVTTCue.h: Removed WEBCORE_EXPORT of the entire class, since that's not fully compatible with a class with inline functions (warning is done by check-webkit-style). Put WEBCORE_EXPORT on individual functions instead. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@288426 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit is a cross-platform web browser engine. On iOS and macOS, it powers Safari, Mail, iBooks, and many other applications.
Visit WebKit Feature Status page to see which Web API has been implemented, in development, or under consideration.
On macOS, download Safari Technology Preview to test the latest version of WebKit. On Linux, download Epiphany Technology Preview. On Windows, you'll have to build it yourself.
Once your bug is filed, you will receive email when it is updated at each stage in the bug life cycle. After the bug is considered fixed, you may be asked to download the latest nightly and confirm that the fix works for you.
On Windows, follow the instructions on our website.
Run the following command to clone WebKit's Git SVN repository:
git clone git@github.com:WebKit/WebKit.git WebKit
or
git clone https://github.com/WebKit/WebKit.git WebKit
If you want to be able to track Subversion revision from your git checkout, you can run the following command to do so:
Tools/Scripts/git-webkit setup-git-svn
For information about this, and other aspects of using Git with WebKit, read the wiki page.
If you don‘t want to use Git, run the following command to check out WebKit’s Subversion repository:
svn checkout https://svn.webkit.org/repository/webkit/trunk WebKit
Install Xcode and its command line tools if you haven't done so already:
xcode-select --install
Run the following command to build a debug build with debugging symbols and assertions:
Tools/Scripts/build-webkit --debug
For performance testing, and other purposes, use --release
instead.
You can open WebKit.xcworkspace
to build and debug WebKit within Xcode.
If you don't use a custom build location in Xcode preferences, you have to update the workspace settings to use WebKitBuild
directory. In menu bar, choose File > Workspace Settings, then click the Advanced button, select “Custom”, “Relative to Workspace”, and enter WebKitBuild
for both Products and Intermediates.
iOS, tvOS and watchOS are all considered embedded builds. The first time after you install a new Xcode, you will need to run:
sudo Tools/Scripts/configure-xcode-for-embedded-development
Without this step, you will see the error message: “target specifies product type ‘com.apple.product-type.tool’, but there’s no such product type for the ‘iphonesimulator’ platform.
” when building target JSCLLIntOffsetsExtractor
of project JavaScriptCore
.
Run the following command to build a debug build with debugging symbols and assertions for embedded simulators:
Tools/Scripts/build-webkit --debug --<platform>-simulator
or embedded devices:
Tools/Scripts/build-webkit --debug --<platform>-device
where platform
is ios
, tvos
or watchos
.
For production builds:
cmake -DPORT=GTK -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja ninja sudo ninja install
For development builds:
Tools/gtk/install-dependencies Tools/Scripts/update-webkitgtk-libs Tools/Scripts/build-webkit --gtk --debug
For more information on building WebKitGTK+, see the wiki page.
For production builds:
cmake -DPORT=WPE -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja ninja sudo ninja install
For development builds:
Tools/wpe/install-dependencies Tools/Scripts/update-webkitwpe-libs Tools/Scripts/build-webkit --wpe --debug
For building WebKit on Windows, see the wiki page.
Run the following command to launch Safari with your local build of WebKit:
Tools/Scripts/run-safari --debug
The run-safari
script sets the DYLD_FRAMEWORK_PATH
environment variable to point to your build products, and then launches /Applications/Safari.app
. DYLD_FRAMEWORK_PATH
tells the system loader to prefer your build products over the frameworks installed in /System/Library/Frameworks
.
To run other applications with your local build of WebKit, run the following command:
Tools/Scripts/run-webkit-app <application-path>
Run the following command to launch iOS simulator with your local build of WebKit:
run-safari --debug --ios-simulator
In both cases, if you have built release builds instead, use --release
instead of --debug
.
If you have a development build, you can use the run-minibrowser script, e.g.:
run-minibrowser --debug --wpe
Pass one of --gtk
, --jsc-only
, or --wpe
to indicate the port to use.
Congratulations! You’re up and running. Now you can begin coding in WebKit and contribute your fixes and new features to the project. For details on submitting your code to the project, read Contributing Code.