WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
209287
Make the MediaSample::toJSONString method generic
https://bugs.webkit.org/show_bug.cgi?id=209287
Summary
Make the MediaSample::toJSONString method generic
Philippe Normand
Reported
2020-03-19 09:44:39 PDT
As the current Objc impl is cross-platform already, let's move it to the base class?
Attachments
Patch
(3.48 KB, patch)
2020-03-19 09:46 PDT
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
Patch
(3.53 KB, patch)
2020-03-21 03:54 PDT
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Philippe Normand
Comment 1
2020-03-19 09:46:25 PDT
Created
attachment 393988
[details]
Patch
Eric Carlson
Comment 2
2020-03-19 10:17:29 PDT
Comment on
attachment 393988
[details]
Patch r=me once the bots are happy
Philippe Normand
Comment 3
2020-03-20 05:14:34 PDT
Ld /Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/Release/TestWebKitAPI normal x86_64 cd /Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/Tools/TestWebKitAPI export MACOSX_DEPLOYMENT_TARGET=10.14 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -L/Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/Release -F/Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/Release -F/Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/Tools/TestWebKitAPI/../../WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/101400 -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/PrivateFrameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/PrivateFrameworks -iframework /Application s/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Quartz.framework/Frameworks -filelist /Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/TestWebKitAPI.build/Release/TestWebKitAPI.build/Objects-normal/x86_64/TestWebKitAPI.LinkFileList -Xlinker -rpath -Xlinker @loader_path -mmacosx-version-min=10.14 -Xlinker -object_path_lto -Xlinker /Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/TestWebKitAPI.build/Release/TestWebKitAPI.build/Objects-normal/x86_64/TestWebKitAPI_lto.o -stdlib=libc++ -fobjc-link-runtime -Wl,-unexported_symbol -Wl,__ZN7testing4Test16TearDownTestCaseEv -Wl,-unexported_symbol -Wl,__ZN7testing4Test13SetUpTestCaseEv -lgtest -force_load /Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/Release/libTestWebKitAPI.a -framework JavaScriptCore -framework WebKit -lWebCoreTestSupport -framework Network -framework PDFKit -framework Cocoa -framework Carbon -framework CoreGraphics -framework CoreLocation -framework CoreText -framework IOKit -lboringssl -licucore -framework LocalAuthentication -framework QuartzCore -framework Security -sectcreate __TEXT __info_plist /Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/TestWebKitAPI.build/Release/TestWebKitAPI.build/Objects-normal/x86_64/Processed-Info.plist -Xlinker -dependency_info -Xlinker /Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/TestWebKitAPI.build/Release/TestWebKitAPI.build/Objects-normal/x86_64/TestWebKitAPI_dependency_info.dat -o /Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/WebKitBuild/Release/TestWebKitAPI ld: warning: directory not found for option '-F/Volumes/Data/worker/macOS-Mojave-Release-Build-EWS/build/Tools/TestWebKitAPI/../../WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/101400' Undefined symbols for architecture x86_64: "WebCore::FloatSize::toJSONObject() const", referenced from: WebCore::MediaSample::toJSONString() const in libTestWebKitAPI.a(SampleMap.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I don't understand the error... FloatSize.cpp seems to be in TestWebKitAPI sources already.
Eric Carlson
Comment 4
2020-03-20 10:00:10 PDT
I don't understand the failure either. I applied your patch locally and it builds without error.
Eric Carlson
Comment 5
2020-03-20 10:00:33 PDT
Comment on
attachment 393988
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=393988&action=review
> Source/WebCore/platform/MediaSample.h:101 > + virtual String toJSONString() const
Nit: this doesn't need to be virtual.
Philippe Normand
Comment 6
2020-03-21 03:54:52 PDT
Created
attachment 394165
[details]
Patch
Philippe Normand
Comment 7
2020-03-21 07:25:26 PDT
Committed
r258807
: <
https://trac.webkit.org/changeset/258807
>
Radar WebKit Bug Importer
Comment 8
2020-03-21 07:26:17 PDT
<
rdar://problem/60724828
>
Darin Adler
Comment 9
2020-03-21 17:28:08 PDT
Comment on
attachment 394165
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=394165&action=review
> Source/WebCore/platform/MediaSample.h:112 > + String toJSONString() const > + { > + auto object = JSON::Object::create(); > + > + object->setObject("pts"_s, presentationTime().toJSONObject()); > + object->setObject("dts"_s, decodeTime().toJSONObject()); > + object->setObject("duration"_s, duration().toJSONObject()); > + object->setInteger("flags"_s, static_cast<unsigned>(flags())); > + object->setObject("presentationSize"_s, presentationSize().toJSONObject()); > + > + return object->toJSONString(); > + }
Why inlined? No handy .cpp file to put it in?
Philippe Normand
Comment 10
2020-03-22 03:03:36 PDT
Comment on
attachment 394165
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=394165&action=review
>> Source/WebCore/platform/MediaSample.h:112 >> + } > > Why inlined? No handy .cpp file to put it in?
No MediaSample.cpp indeed. This is the only method with more than one line body, I wasn't sure a dedicated .cpp file made sense in this case.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug