WebKit Bugzilla
Attachment 341390 Details for
Bug 186009
: [iOS] Fix warnings about leaks found by clang static analyzer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v2
bug-186009-20180525222522.patch (text/plain), 36.56 KB, created by
David Kilzer (:ddkilzer)
on 2018-05-25 22:25:22 PDT
(
hide
)
Description:
Patch v2
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-05-25 22:25:22 PDT
Size:
36.56 KB
patch
obsolete
>Subversion Revision: 232222 >diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog >index 39b888ab7db8803d4ed47ccde90ea1ec6e27fb48..83604b3711bf51a7dbdcfafec0c8f02cd6a60849 100644 >--- a/Source/ThirdParty/libwebrtc/ChangeLog >+++ b/Source/ThirdParty/libwebrtc/ChangeLog >@@ -1,3 +1,31 @@ >+2018-05-25 David Kilzer <ddkilzer@apple.com> >+ >+ [iOS] Fix warnings about leaks found by clang static analyzer >+ <https://webkit.org/b/186009> >+ <rdar://problem/40574267> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Source/third_party/opus/src/src/opus_compare.c: >+ * Source/third_party/opus/src/src/opus_demo.c: >+ (main): >+ - Free allocated memory on early returns. >+ * Source/third_party/usrsctp/usrsctplib/user_mbuf.c: >+ (clust_constructor_dup): >+ (mb_ctor_clust): >+ - Free allocated memory if `m` is NULL. >+ * Source/third_party/usrsctp/usrsctplib/user_socket.c: >+ (usrsctp_connect): Free `sa` memory if getsockaddr() returns an >+ error, but still allocates memory for `sa`. >+ * WebKit/patch-opus.diff: Add patch for opus changes. >+ * WebKit/patch-usrsctp: Rename empty file to patch-usrsctp.diff. >+ * WebKit/patch-usrsctp.diff: Add patch for usrsctp changes. >+ * libwebrtc.xcodeproj/project.pbxproj: Remove opus_compare.c, >+ opus_demo.c, and repacketizer_demo.c from opus target. This >+ code is for stand-alone tools, and although it may be removed >+ during dead code linking, we don't need to spend time compiling >+ it. >+ > 2018-05-07 Youenn Fablet <youenn@apple.com> > > Activate ARC for libwebrtc Objective C files >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0b5eb7af7a67cc6291fa4a2f4ca2b5761e64da4c..67e2297e0bbe7665e8bc54137020c8cdcee7fee2 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2018-05-25 David Kilzer <ddkilzer@apple.com> >+ >+ [iOS] Fix warnings about leaks found by clang static analyzer >+ <https://webkit.org/b/186009> >+ <rdar://problem/40574267> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Modules/webauthn/cocoa/LocalAuthenticator.mm: >+ (WebCore::LocalAuthenticator::makeCredential): >+ (WebCore::LocalAuthenticator::getAssertion): >+ (WebCore::LocalAuthenticator::issueClientCertificate const): >+ - Don't leak CF objects in early return paths, and get rid of >+ `retained*` variables, by making original variables use >+ RetainPtr<>. >+ * bridge/objc/WebScriptObject.mm: >+ (+[WebUndefined allocWithZone:]): Modernize WebUndefined by >+ using NeverDestroyed<RetainPr<WebUndefined>> type. Explicitly >+ retain the object returned on each call. >+ (+[WebUndefined undefined]): Explicitly autorelase the object >+ returned. Note that neither of these changes fixes the static >+ analyzer warnings in this source file. >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: >+ (WebCore::exernalDeviceDisplayNameForPlayer): Use RetainPtr<> to >+ stop leaking NSString objects in a loop. >+ * platform/ios/wak/WAKWindow.h: >+ (-[WAKWindow _newFirstResponderAfterResigning]): Mark as >+ NS_RETURNS_NOT_RETAINED like the corresponding AppKit method >+ since this doesn't return a new object. This fixes some >+ false-positive leaks warnings. >+ > 2018-05-25 Myles C. Maxfield <mmaxfield@apple.com> > > Improve the performance of Font::canRenderCombiningCharacterSequence() >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index e0006fcd4ac2b91006b200543f2b70d8aac4315b..ea0d5c25e5918f728d036a49f528f68a566f4e0e 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2018-05-25 David Kilzer <ddkilzer@apple.com> >+ >+ [iOS] Fix warnings about leaks found by clang static analyzer >+ <https://webkit.org/b/186009> >+ <rdar://problem/40574267> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Automation/ios/WebAutomationSessionIOS.mm: >+ (WebKit::WebAutomationSession::platformSimulateKeySequence): Fix >+ leak of two WebEvent objects that happened in a loop. >+ * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: >+ (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]): >+ Fix leak of a UIImage. >+ > 2018-05-25 Timothy Hatcher <timothy@apple.com> > > Setting drawsBackground to YES on a WKView doesn't take effect immediately >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index e01b453ded09bef25bfb77ac51da528cbfc30ed3..81d66452ee49a0a0672d5b57257a4451d260eebe 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-25 David Kilzer <ddkilzer@apple.com> >+ >+ [iOS] Fix warnings about leaks found by clang static analyzer >+ <https://webkit.org/b/186009> >+ <rdar://problem/40574267> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebHTMLView.mm: >+ (-[WebHTMLView doCommandBySelector:]): Fix use of an >+ uninitialized boolean variable (`eventWasHandled`) that only >+ happened on iOS. >+ > 2018-05-25 Chris Dumez <cdumez@apple.com> > > Minor ApplicationCacheStorage clean up >diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_compare.c b/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_compare.c >index 06c67d752f7153c191344947d594b3611636c9f8..66828fd8caef6c8f7cc90f87e379e2cfb07d0ce8 100644 >--- a/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_compare.c >+++ b/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_compare.c >@@ -238,11 +238,15 @@ int main(int _argc,const char **_argv){ > if(xlength!=ylength*downsample){ > fprintf(stderr,"Sample counts do not match (%lu!=%lu).\n", > (unsigned long)xlength,(unsigned long)ylength*downsample); >+ free(x); >+ free(y); > return EXIT_FAILURE; > } > if(xlength<TEST_WIN_SIZE){ > fprintf(stderr,"Insufficient sample data (%lu<%i).\n", > (unsigned long)xlength,TEST_WIN_SIZE); >+ free(x); >+ free(y); > return EXIT_FAILURE; > } > nframes=(xlength-TEST_WIN_SIZE+TEST_WIN_STEP)/TEST_WIN_STEP; >diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_demo.c b/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_demo.c >index 7c930699d6143dea31d7dd69b4323ade812a0e38..6988a8cb15d6e608f5865277178e1c04c6961d4b 100644 >--- a/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_demo.c >+++ b/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_demo.c >@@ -721,8 +721,14 @@ int main(int argc, char *argv[]) > if (len[toggle] < 0) > { > fprintf (stderr, "opus_encode() returned %d\n", len[toggle]); >+ free(data[0]); >+ if (use_inbandfec) >+ free(data[1]); > fclose(fin); > fclose(fout); >+ free(in); >+ free(out); >+ free(fbytes); > return EXIT_FAILURE; > } > curr_mode_count += frame_size; >@@ -740,6 +746,14 @@ int main(int argc, char *argv[]) > if ((err = opus_packet_pad(data[toggle], len[toggle], new_len)) != OPUS_OK) > { > fprintf(stderr, "padding failed: %s\n", opus_strerror(err)); >+ free(data[0]); >+ if (use_inbandfec) >+ free(data[1]); >+ fclose(fin); >+ fclose(fout); >+ free(in); >+ free(out); >+ free(fbytes); > return EXIT_FAILURE; > } > len[toggle] = new_len; >@@ -751,15 +765,39 @@ int main(int argc, char *argv[]) > int_to_char(len[toggle], int_field); > if (fwrite(int_field, 1, 4, fout) != 4) { > fprintf(stderr, "Error writing.\n"); >+ free(data[0]); >+ if (use_inbandfec) >+ free(data[1]); >+ fclose(fin); >+ fclose(fout); >+ free(in); >+ free(out); >+ free(fbytes); > return EXIT_FAILURE; > } > int_to_char(enc_final_range[toggle], int_field); > if (fwrite(int_field, 1, 4, fout) != 4) { > fprintf(stderr, "Error writing.\n"); >+ free(data[0]); >+ if (use_inbandfec) >+ free(data[1]); >+ fclose(fin); >+ fclose(fout); >+ free(in); >+ free(out); >+ free(fbytes); > return EXIT_FAILURE; > } > if (fwrite(data[toggle], 1, len[toggle], fout) != (unsigned)len[toggle]) { > fprintf(stderr, "Error writing.\n"); >+ free(data[0]); >+ if (use_inbandfec) >+ free(data[1]); >+ fclose(fin); >+ fclose(fout); >+ free(in); >+ free(out); >+ free(fbytes); > return EXIT_FAILURE; > } > tot_samples += nb_encoded; >@@ -803,6 +841,14 @@ int main(int argc, char *argv[]) > } > if (fwrite(fbytes, sizeof(short)*channels, output_samples-skip, fout) != (unsigned)(output_samples-skip)){ > fprintf(stderr, "Error writing.\n"); >+ free(data[0]); >+ if (use_inbandfec) >+ free(data[1]); >+ fclose(fin); >+ fclose(fout); >+ free(in); >+ free(out); >+ free(fbytes); > return EXIT_FAILURE; > } > tot_out += output_samples-skip; >@@ -829,8 +875,14 @@ int main(int argc, char *argv[]) > (long)count, > (unsigned long)enc_final_range[toggle^use_inbandfec], > (unsigned long)dec_final_range); >+ free(data[0]); >+ if (use_inbandfec) >+ free(data[1]); > fclose(fin); > fclose(fout); >+ free(in); >+ free(out); >+ free(fbytes); > return EXIT_FAILURE; > } > >diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_mbuf.c b/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_mbuf.c >index 7a1aaba855ee6e0d34015d8aab8ffd8626311848..3ebd8a27b6b77d0ab58a63c9e77d2bcdf153172b 100644 >--- a/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_mbuf.c >+++ b/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_mbuf.c >@@ -232,7 +232,8 @@ static int clust_constructor_dup(caddr_t m_clust, struct mbuf* m) > m->m_ext.ext_size = size; > m->m_ext.ext_type = type; > m->m_ext.ref_cnt = refcnt; >- } >+ } else >+ SCTP_ZONE_FREE(zone_ext_refcnt, refcnt); > > return (0); > } >@@ -527,7 +528,8 @@ mb_ctor_clust(void *mem, void *arg, int flgs) > m->m_ext.ext_size = size; > m->m_ext.ext_type = type; > m->m_ext.ref_cnt = refcnt; >- } >+ } else >+ SCTP_ZONE_FREE(zone_ext_refcnt, refcnt); > #endif > return (0); > } >diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_socket.c b/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_socket.c >index a54996efdd886ed83528537d257cc085d11aa5d9..b94e1e5c24af330ec678761e920a55e7fb19681d 100644 >--- a/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_socket.c >+++ b/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_socket.c >@@ -2131,11 +2131,14 @@ done1: > > int usrsctp_connect(struct socket *so, struct sockaddr *name, int namelen) > { >- struct sockaddr *sa; >+ struct sockaddr *sa = NULL; > > errno = getsockaddr(&sa, (caddr_t)name, namelen); >- if (errno) >+ if (errno) { >+ if (sa) >+ FREE(sa, M_SONAME); > return (-1); >+ } > > errno = user_connect(so, sa); > FREE(sa, M_SONAME); >diff --git a/Source/ThirdParty/libwebrtc/WebKit/patch-opus.diff b/Source/ThirdParty/libwebrtc/WebKit/patch-opus.diff >new file mode 100644 >index 0000000000000000000000000000000000000000..0fd5648e395d840fdc162f5c70a711ccf84176a2 >--- /dev/null >+++ b/Source/ThirdParty/libwebrtc/WebKit/patch-opus.diff >@@ -0,0 +1,124 @@ >+diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_compare.c b/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_compare.c >+index 06c67d752f7..66828fd8cae 100644 >+--- a/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_compare.c >++++ b/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_compare.c >+@@ -238,11 +238,15 @@ int main(int _argc,const char **_argv){ >+ if(xlength!=ylength*downsample){ >+ fprintf(stderr,"Sample counts do not match (%lu!=%lu).\n", >+ (unsigned long)xlength,(unsigned long)ylength*downsample); >++ free(x); >++ free(y); >+ return EXIT_FAILURE; >+ } >+ if(xlength<TEST_WIN_SIZE){ >+ fprintf(stderr,"Insufficient sample data (%lu<%i).\n", >+ (unsigned long)xlength,TEST_WIN_SIZE); >++ free(x); >++ free(y); >+ return EXIT_FAILURE; >+ } >+ nframes=(xlength-TEST_WIN_SIZE+TEST_WIN_STEP)/TEST_WIN_STEP; >+diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_demo.c b/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_demo.c >+index 7c930699d61..6988a8cb15d 100644 >+--- a/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_demo.c >++++ b/Source/ThirdParty/libwebrtc/Source/third_party/opus/src/src/opus_demo.c >+@@ -721,8 +721,14 @@ int main(int argc, char *argv[]) >+ if (len[toggle] < 0) >+ { >+ fprintf (stderr, "opus_encode() returned %d\n", len[toggle]); >++ free(data[0]); >++ if (use_inbandfec) >++ free(data[1]); >+ fclose(fin); >+ fclose(fout); >++ free(in); >++ free(out); >++ free(fbytes); >+ return EXIT_FAILURE; >+ } >+ curr_mode_count += frame_size; >+@@ -740,6 +746,14 @@ int main(int argc, char *argv[]) >+ if ((err = opus_packet_pad(data[toggle], len[toggle], new_len)) != OPUS_OK) >+ { >+ fprintf(stderr, "padding failed: %s\n", opus_strerror(err)); >++ free(data[0]); >++ if (use_inbandfec) >++ free(data[1]); >++ fclose(fin); >++ fclose(fout); >++ free(in); >++ free(out); >++ free(fbytes); >+ return EXIT_FAILURE; >+ } >+ len[toggle] = new_len; >+@@ -751,15 +765,39 @@ int main(int argc, char *argv[]) >+ int_to_char(len[toggle], int_field); >+ if (fwrite(int_field, 1, 4, fout) != 4) { >+ fprintf(stderr, "Error writing.\n"); >++ free(data[0]); >++ if (use_inbandfec) >++ free(data[1]); >++ fclose(fin); >++ fclose(fout); >++ free(in); >++ free(out); >++ free(fbytes); >+ return EXIT_FAILURE; >+ } >+ int_to_char(enc_final_range[toggle], int_field); >+ if (fwrite(int_field, 1, 4, fout) != 4) { >+ fprintf(stderr, "Error writing.\n"); >++ free(data[0]); >++ if (use_inbandfec) >++ free(data[1]); >++ fclose(fin); >++ fclose(fout); >++ free(in); >++ free(out); >++ free(fbytes); >+ return EXIT_FAILURE; >+ } >+ if (fwrite(data[toggle], 1, len[toggle], fout) != (unsigned)len[toggle]) { >+ fprintf(stderr, "Error writing.\n"); >++ free(data[0]); >++ if (use_inbandfec) >++ free(data[1]); >++ fclose(fin); >++ fclose(fout); >++ free(in); >++ free(out); >++ free(fbytes); >+ return EXIT_FAILURE; >+ } >+ tot_samples += nb_encoded; >+@@ -803,6 +841,14 @@ int main(int argc, char *argv[]) >+ } >+ if (fwrite(fbytes, sizeof(short)*channels, output_samples-skip, fout) != (unsigned)(output_samples-skip)){ >+ fprintf(stderr, "Error writing.\n"); >++ free(data[0]); >++ if (use_inbandfec) >++ free(data[1]); >++ fclose(fin); >++ fclose(fout); >++ free(in); >++ free(out); >++ free(fbytes); >+ return EXIT_FAILURE; >+ } >+ tot_out += output_samples-skip; >+@@ -829,8 +875,14 @@ int main(int argc, char *argv[]) >+ (long)count, >+ (unsigned long)enc_final_range[toggle^use_inbandfec], >+ (unsigned long)dec_final_range); >++ free(data[0]); >++ if (use_inbandfec) >++ free(data[1]); >+ fclose(fin); >+ fclose(fout); >++ free(in); >++ free(out); >++ free(fbytes); >+ return EXIT_FAILURE; >+ } >+ >diff --git a/Source/ThirdParty/libwebrtc/WebKit/patch-usrsctp b/Source/ThirdParty/libwebrtc/WebKit/patch-usrsctp >deleted file mode 100644 >index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 >diff --git a/Source/ThirdParty/libwebrtc/WebKit/patch-usrsctp.diff b/Source/ThirdParty/libwebrtc/WebKit/patch-usrsctp.diff >new file mode 100644 >index 0000000000000000000000000000000000000000..a18a8f5c645784d6f5d93682a5f9f18c232cd155 >--- /dev/null >+++ b/Source/ThirdParty/libwebrtc/WebKit/patch-usrsctp.diff >@@ -0,0 +1,45 @@ >+diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_mbuf.c b/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_mbuf.c >+index 7a1aaba855e..3ebd8a27b6b 100644 >+--- a/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_mbuf.c >++++ b/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_mbuf.c >+@@ -232,7 +232,8 @@ static int clust_constructor_dup(caddr_t m_clust, struct mbuf* m) >+ m->m_ext.ext_size = size; >+ m->m_ext.ext_type = type; >+ m->m_ext.ref_cnt = refcnt; >+- } >++ } else >++ SCTP_ZONE_FREE(zone_ext_refcnt, refcnt); >+ >+ return (0); >+ } >+@@ -527,7 +528,8 @@ mb_ctor_clust(void *mem, void *arg, int flgs) >+ m->m_ext.ext_size = size; >+ m->m_ext.ext_type = type; >+ m->m_ext.ref_cnt = refcnt; >+- } >++ } else >++ SCTP_ZONE_FREE(zone_ext_refcnt, refcnt); >+ #endif >+ return (0); >+ } >+diff --git a/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_socket.c b/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_socket.c >+index a54996efdd8..b94e1e5c24a 100644 >+--- a/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_socket.c >++++ b/Source/ThirdParty/libwebrtc/Source/third_party/usrsctp/usrsctplib/user_socket.c >+@@ -2131,11 +2131,14 @@ done1: >+ >+ int usrsctp_connect(struct socket *so, struct sockaddr *name, int namelen) >+ { >+- struct sockaddr *sa; >++ struct sockaddr *sa = NULL; >+ >+ errno = getsockaddr(&sa, (caddr_t)name, namelen); >+- if (errno) >++ if (errno) { >++ if (sa) >++ FREE(sa, M_SONAME); >+ return (-1); >++ } >+ >+ errno = user_connect(so, sa); >+ FREE(sa, M_SONAME); >diff --git a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj >index a8eb3ba15b35e6f1d23de417b76042486c8212e2..f217ec367cf4553f2f5a84776950562733c66e60 100644 >--- a/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj >+++ b/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj >@@ -1260,16 +1260,13 @@ > 5C4B4AB71E42C574002651C8 /* mlp_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A951E42C52D002651C8 /* mlp_data.c */; }; > 5C4B4AB81E42C574002651C8 /* mlp.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A961E42C52D002651C8 /* mlp.c */; }; > 5C4B4AB91E42C574002651C8 /* mlp.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4B4A971E42C52D002651C8 /* mlp.h */; }; >- 5C4B4ABA1E42C574002651C8 /* opus_compare.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A981E42C52D002651C8 /* opus_compare.c */; }; > 5C4B4ABB1E42C574002651C8 /* opus_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A991E42C52D002651C8 /* opus_decoder.c */; }; >- 5C4B4ABC1E42C574002651C8 /* opus_demo.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A9A1E42C52D002651C8 /* opus_demo.c */; }; > 5C4B4ABD1E42C574002651C8 /* opus_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A9B1E42C52D002651C8 /* opus_encoder.c */; }; > 5C4B4ABE1E42C574002651C8 /* opus_multistream_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A9C1E42C52D002651C8 /* opus_multistream_decoder.c */; }; > 5C4B4ABF1E42C574002651C8 /* opus_multistream_encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A9D1E42C52D002651C8 /* opus_multistream_encoder.c */; }; > 5C4B4AC01E42C574002651C8 /* opus_multistream.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4A9E1E42C52D002651C8 /* opus_multistream.c */; }; > 5C4B4AC11E42C574002651C8 /* opus_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4B4A9F1E42C52D002651C8 /* opus_private.h */; }; > 5C4B4AC21E42C574002651C8 /* opus.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4AA01E42C52D002651C8 /* opus.c */; }; >- 5C4B4AC31E42C574002651C8 /* repacketizer_demo.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4AA11E42C52D002651C8 /* repacketizer_demo.c */; }; > 5C4B4AC41E42C574002651C8 /* repacketizer.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4AA21E42C52D002651C8 /* repacketizer.c */; }; > 5C4B4AC51E42C574002651C8 /* tansig_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4B4AA31E42C52D002651C8 /* tansig_table.h */; }; > 5C4B4C191E431F75002651C8 /* bitrate_adjuster.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C4B4C101E431F75002651C8 /* bitrate_adjuster.cc */; }; >@@ -12449,9 +12446,7 @@ > 5C5F40971E978FDB00D94279 /* NSQ_del_dec_sse.c in Sources */, > 5C5F40981E978FDB00D94279 /* NSQ_sse.c in Sources */, > 5C4B4AC21E42C574002651C8 /* opus.c in Sources */, >- 5C4B4ABA1E42C574002651C8 /* opus_compare.c in Sources */, > 5C4B4ABB1E42C574002651C8 /* opus_decoder.c in Sources */, >- 5C4B4ABC1E42C574002651C8 /* opus_demo.c in Sources */, > 5C4B4ABD1E42C574002651C8 /* opus_encoder.c in Sources */, > 5C4B4AC01E42C574002651C8 /* opus_multistream.c in Sources */, > 5C4B4ABE1E42C574002651C8 /* opus_multistream_decoder.c in Sources */, >@@ -12472,7 +12467,6 @@ > 5CDD8F4C1E43CB1E00621E92 /* regularize_correlations_FIX.c in Sources */, > 5CDD8EF71E43C9F600621E92 /* regularize_correlations_FLP.c in Sources */, > 5C4B4AC41E42C574002651C8 /* repacketizer.c in Sources */, >- 5C4B4AC31E42C574002651C8 /* repacketizer_demo.c in Sources */, > 5CDD8E811E43C80C00621E92 /* resampler.c in Sources */, > 5CDD8E781E43C80C00621E92 /* resampler_down2.c in Sources */, > 5CDD8E771E43C80C00621E92 /* resampler_down2_3.c in Sources */, >diff --git a/Source/WebCore/Modules/webauthn/cocoa/LocalAuthenticator.mm b/Source/WebCore/Modules/webauthn/cocoa/LocalAuthenticator.mm >index 42ac4fa04b9a0794408374ca735f8a67a074dad0..1259a30dcc769fe170c070519d67c4d02d061da4 100644 >--- a/Source/WebCore/Modules/webauthn/cocoa/LocalAuthenticator.mm >+++ b/Source/WebCore/Modules/webauthn/cocoa/LocalAuthenticator.mm >@@ -296,27 +296,26 @@ void LocalAuthenticator::makeCredential(const Vector<uint8_t>& hash, const Publi > attestedCredentialData.appendVector(credentialId); > > // credentialPublicKey >- CFDataRef publicKeyDataRef = nullptr; >+ RetainPtr<CFDataRef> publicKeyDataRef; > { > auto publicKey = adoptCF(SecKeyCopyPublicKey(privateKey)); > CFErrorRef errorRef = nullptr; >- publicKeyDataRef = SecKeyCopyExternalRepresentation(publicKey.get(), &errorRef); >+ publicKeyDataRef = adoptCF(SecKeyCopyExternalRepresentation(publicKey.get(), &errorRef)); > auto retainError = adoptCF(errorRef); > if (errorRef) { > LOG_ERROR("Couldn't export the public key: %@", (NSError*)errorRef); > exceptionCallback({ UnknownError, ASCIILiteral("Unknown internal error.") }); > return; > } >- ASSERT(((NSData *)publicKeyDataRef).length == (1 + 2*ES256KeySizeInBytes)); // 04 | X | Y >+ ASSERT(((NSData *)publicKeyDataRef.get()).length == (1 + 2*ES256KeySizeInBytes)); // 04 | X | Y > } >- auto retainPublicKeyData = adoptCF(publicKeyDataRef); > > // COSE Encoding > // FIXME(183535): Improve CBOR encoder to work with bytes directly. > Vector<uint8_t> x(ES256KeySizeInBytes); >- [(NSData *)publicKeyDataRef getBytes: x.data() range:NSMakeRange(1, ES256KeySizeInBytes)]; >+ [(NSData *)publicKeyDataRef.get() getBytes: x.data() range:NSMakeRange(1, ES256KeySizeInBytes)]; > Vector<uint8_t> y(ES256KeySizeInBytes); >- [(NSData *)publicKeyDataRef getBytes: y.data() range:NSMakeRange(1 + ES256KeySizeInBytes, ES256KeySizeInBytes)]; >+ [(NSData *)publicKeyDataRef.get() getBytes: y.data() range:NSMakeRange(1 + ES256KeySizeInBytes, ES256KeySizeInBytes)]; > cbor::CBORValue::MapValue publicKeyMap; > publicKeyMap[cbor::CBORValue(COSE::kty)] = cbor::CBORValue(COSE::EC2); > publicKeyMap[cbor::CBORValue(COSE::alg)] = cbor::CBORValue(COSE::ES256); >@@ -344,15 +343,14 @@ void LocalAuthenticator::makeCredential(const Vector<uint8_t>& hash, const Publi > { > CFErrorRef errorRef = nullptr; > // FIXME(183652): Reduce prompt for biometrics >- CFDataRef signatureRef = SecKeyCreateSignature(privateKey, kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (__bridge CFDataRef)[NSData dataWithBytes:authData.data() length:authData.size()], &errorRef); >+ auto signatureRef = adoptCF(SecKeyCreateSignature(privateKey, kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (__bridge CFDataRef)[NSData dataWithBytes:authData.data() length:authData.size()], &errorRef)); > auto retainError = adoptCF(errorRef); > if (errorRef) { > LOG_ERROR("Couldn't generate the signature: %@", (NSError*)errorRef); > exceptionCallback({ UnknownError, ASCIILiteral("Unknown internal error.") }); > return; > } >- auto retainSignature = adoptCF(signatureRef); >- NSData *nsSignature = (NSData *)signatureRef; >+ NSData *nsSignature = (NSData *)signatureRef.get(); > signature.append(reinterpret_cast<const uint8_t*>(nsSignature.bytes), nsSignature.length); > } > attestationStatementMap[cbor::CBORValue("alg")] = cbor::CBORValue(COSE::ES256); >@@ -502,15 +500,14 @@ void LocalAuthenticator::getAssertion(const Vector<uint8_t>& hash, const PublicK > > CFErrorRef errorRef = nullptr; > // FIXME: Converting CFTypeRef to SecKeyRef is quite subtle here. >- CFDataRef signatureRef = SecKeyCreateSignature((__bridge SecKeyRef)((id)privateKeyRef), kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (__bridge CFDataRef)dataToSign, &errorRef); >+ auto signatureRef = adoptCF(SecKeyCreateSignature((__bridge SecKeyRef)((id)privateKeyRef), kSecKeyAlgorithmECDSASignatureMessageX962SHA256, (__bridge CFDataRef)dataToSign, &errorRef)); > auto retainError = adoptCF(errorRef); > if (errorRef) { > LOG_ERROR("Couldn't generate the signature: %@", (NSError*)errorRef); > exceptionCallback({ UnknownError, ASCIILiteral("Unknown internal error.") }); > return; > } >- auto retainSignature = adoptCF(signatureRef); >- NSData *nsSignature = (NSData *)signatureRef; >+ NSData *nsSignature = (NSData *)signatureRef.get(); > signature.append(reinterpret_cast<const uint8_t*>(nsSignature.bytes), nsSignature.length); > } > >@@ -554,10 +551,10 @@ void LocalAuthenticator::issueClientCertificate(const String& rpId, const String > // Apple Attestation > ASSERT(hash.size() <= 32); > >- SecAccessControlRef accessControlRef; >+ RetainPtr<SecAccessControlRef> accessControlRef; > { > CFErrorRef errorRef = nullptr; >- accessControlRef = SecAccessControlCreateWithFlags(NULL, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, kSecAccessControlPrivateKeyUsage | kSecAccessControlUserPresence, &errorRef); >+ accessControlRef = adoptCF(SecAccessControlCreateWithFlags(NULL, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, kSecAccessControlPrivateKeyUsage | kSecAccessControlUserPresence, &errorRef)); > auto retainError = adoptCF(errorRef); > if (errorRef) { > LOG_ERROR("Couldn't create ACL: %@", (NSError *)errorRef); >@@ -565,7 +562,6 @@ void LocalAuthenticator::issueClientCertificate(const String& rpId, const String > return; > } > } >- auto retainAccessControl = adoptCF(accessControlRef); > > String label(username); > label.append("@" + rpId); >@@ -578,7 +574,7 @@ void LocalAuthenticator::issueClientCertificate(const String& rpId, const String > kMAOptionsBAAValidity: @(1440), // Last one day. > kMAOptionsBAASCRTAttestation: @(NO), > kMAOptionsBAANonce: [NSData dataWithBytes:hash.data() length:hash.size()], >- kMAOptionsBAAAccessControls: (id)accessControlRef, >+ kMAOptionsBAAAccessControls: (id)accessControlRef.get(), > kMAOptionsBAAOIDSToInclude: @[kMAOptionsBAAOIDNonce] > }; > >diff --git a/Source/WebCore/bridge/objc/WebScriptObject.mm b/Source/WebCore/bridge/objc/WebScriptObject.mm >index 18b1735ca0ab949305c191e34df09e844cc7a3c9..00affef4e2e201edadb9f1b3af45f7f2644100ab 100644 >--- a/Source/WebCore/bridge/objc/WebScriptObject.mm >+++ b/Source/WebCore/bridge/objc/WebScriptObject.mm >@@ -656,10 +656,10 @@ + (id)allocWithZone:(NSZone *)unusedZone > { > UNUSED_PARAM(unusedZone); > >- static WebUndefined *sharedUndefined = 0; >- if (!sharedUndefined) >- sharedUndefined = [super allocWithZone:NULL]; >- return sharedUndefined; >+ static NeverDestroyed<RetainPtr<WebUndefined>> sharedUndefined; >+ if (!sharedUndefined.get()) >+ sharedUndefined.get() = adoptNS([super allocWithZone:NULL]); >+ return [sharedUndefined.get() retain]; > } > > - (NSString *)description >@@ -715,7 +715,7 @@ - (void)dealloc > > + (WebUndefined *)undefined > { >- return [WebUndefined allocWithZone:NULL]; >+ return [[WebUndefined allocWithZone:NULL] autorelease]; > } > > @end >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >index 5b2225138920edc33267ee83343420bd6688a01e..84a19bf1e3694fd08ed2be53d762c15a4469b511 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -2802,8 +2802,10 @@ static NSString *exernalDeviceDisplayNameForPlayer(AVPlayerType *player) > return [outputContext deviceName]; > > auto outputDeviceNames = adoptNS([[NSMutableArray alloc] init]); >- for (AVOutputDevice *outputDevice in [outputContext outputDevices]) >- [outputDeviceNames addObject:[[outputDevice name] copy]]; >+ for (AVOutputDevice *outputDevice in [outputContext outputDevices]) { >+ auto outputDeviceName = adoptNS([[outputDevice name] copy]); >+ [outputDeviceNames addObject:outputDeviceName.get()]; >+ } > > return [outputDeviceNames componentsJoinedByString:@" + "]; > } >diff --git a/Source/WebCore/platform/ios/wak/WAKWindow.h b/Source/WebCore/platform/ios/wak/WAKWindow.h >index 87399a170dc61799206c1f933f6ea619da42cebe..4c8f61d9e3be8fd8b97b5d022e7b6052d5733062 100644 >--- a/Source/WebCore/platform/ios/wak/WAKWindow.h >+++ b/Source/WebCore/platform/ios/wak/WAKWindow.h >@@ -116,7 +116,7 @@ WEBCORE_EXPORT @interface WAKWindow : WAKResponder > - (void)setVisible:(BOOL)visible; > - (NSSelectionDirection)keyViewSelectionDirection; > - (BOOL)makeFirstResponder:(NSResponder *)aResponder; >-- (WAKView *)_newFirstResponderAfterResigning; >+- (WAKView *)_newFirstResponderAfterResigning NS_RETURNS_NOT_RETAINED; > - (void)setFrame:(NSRect)frameRect display:(BOOL)flag; > - (CGRect)frame; > - (void)setContentRect:(CGRect)rect; >diff --git a/Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm b/Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm >index a083c299e39f45792d8d088ef7b641a650588f2f..c11c0346ed03e82e7c73243fa6f27a3fc1d6f675 100644 >--- a/Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm >+++ b/Source/WebKit/UIProcess/Automation/ios/WebAutomationSessionIOS.mm >@@ -163,8 +163,10 @@ void WebAutomationSession::platformSimulateKeySequence(WebPageProxy& page, const > BOOL isTabKey = [text isEqualToString:@"\t"]; > > [text enumerateSubstringsInRange:NSMakeRange(0, text.length) options:NSStringEnumerationByComposedCharacterSequences usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { >- [eventsToBeSent addObject:[[::WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:CFAbsoluteTimeGetCurrent() characters:substring charactersIgnoringModifiers:substring modifiers:m_currentModifiers isRepeating:NO withFlags:0 withInputManagerHint:nil keyCode:0 isTabKey:isTabKey]]; >- [eventsToBeSent addObject:[[::WebEvent alloc] initWithKeyEventType:WebEventKeyUp timeStamp:CFAbsoluteTimeGetCurrent() characters:substring charactersIgnoringModifiers:substring modifiers:m_currentModifiers isRepeating:NO withFlags:0 withInputManagerHint:nil keyCode:0 isTabKey:isTabKey]]; >+ auto keyDownEvent = adoptNS([[::WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:CFAbsoluteTimeGetCurrent() characters:substring charactersIgnoringModifiers:substring modifiers:m_currentModifiers isRepeating:NO withFlags:0 withInputManagerHint:nil keyCode:0 isTabKey:isTabKey]); >+ [eventsToBeSent addObject:keyDownEvent.get()]; >+ auto keyUpEvent = adoptNS([[::WebEvent alloc] initWithKeyEventType:WebEventKeyUp timeStamp:CFAbsoluteTimeGetCurrent() characters:substring charactersIgnoringModifiers:substring modifiers:m_currentModifiers isRepeating:NO withFlags:0 withInputManagerHint:nil keyCode:0 isTabKey:isTabKey]); >+ [eventsToBeSent addObject:keyUpEvent.get()]; > }]; > > sendSynthesizedEventsToPage(page, eventsToBeSent.get()); >diff --git a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >index 727891a99a8a0c7114f0363502841b8b655c8c59..429fb0c3da43b99979c711e69e8540243c2c8e35 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >@@ -183,7 +183,7 @@ - (UIImage *)previewController:(QLPreviewController *)controller transitionImage > } > } > >- return [UIImage new]; >+ return [[UIImage new] autorelease]; > } > > @end >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index 5975322ba3c4259b7472e5fddbf1ddce5d2ee95c..9d270ec1e04bb33b5c928be01803132e40de31c1 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -6754,8 +6754,8 @@ - (void)doCommandBySelector:(SEL)selector > Editor::Command command = [self coreCommandBySelector:selector]; > if (command.isSupported()) > eventWasHandled = command.execute(event); >-#if PLATFORM(MAC) > else { >+#if PLATFORM(MAC) > // If WebKit does not support this command, we need to pass the selector to super. > _private->selectorForDoCommandBySelector = selector; > >@@ -6767,8 +6767,10 @@ - (void)doCommandBySelector:(SEL)selector > [sink detach]; > > _private->selectorForDoCommandBySelector = 0; >- } >+#else >+ eventWasHandled = false; > #endif >+ } > } > > if (parameters)
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 186009
:
341389
|
341390
|
341431