Closed Bug 1635094 Opened 9 months ago Closed 9 months ago

Cleanup the referrerinfo code.

Categories

(Core :: DOM: Security, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: emilio, Assigned: emilio)

Details

(Whiteboard: [domsecurity-active])

Attachments

(2 files, 1 obsolete file)

No description provided.

The cast in InitWithNode is wrong. AsElement() asserts instead of
checking the flag, so we always pass an element (and if we didn't we'd
have type confusion problems). I audited the callers and we're fine.

Anyhow, always require an element, and add two convenience constructors
for C++ code.

Depends on D73634

Attachment #9145429 - Attachment is obsolete: true
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ead4f26f76ee
Allow having const WebIDL pointers in XPIDL. r=froydnj
https://hg.mozilla.org/integration/autoland/rev/0a2b0c6ea19a
Cleanup the ReferrerInfo code. r=ckerschb
Status: NEW → ASSIGNED
Whiteboard: [domsecurity-active]

Backed out 2 changesets (bug 1635094) for build bustages on nsMacShellService.cpp

Backout: https://hg.mozilla.org/integration/autoland/rev/34d71b4a00863e7615463592662dfe362c4a993e

Failure push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=0a2b0c6ea19a775b664d06ab159ac447c8b0ff1f

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=300691712&repo=autoland&lineNumber=33138

[task 2020-05-04T16:54:44.488Z] 16:54:44 INFO - security/nss/lib/freebl/freeblver.o
[task 2020-05-04T16:54:44.488Z] 16:54:44 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang -isysroot /builds/worker/checkouts/gecko/MacOSX10.11.sdk -std=gnu99 --target=x86_64-apple-darwin -o freeblver.o -c -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -ftrivial-auto-var-init=pattern -DDEBUG '-DSHLIB_SUFFIX="dylib"' '-DSHLIB_PREFIX="lib"' '-DSHLIB_VERSION="3"' '-DSOFTOKEN_SHLIB_VERSION="3"' -DRIJNDAEL_INCLUDE_TABLES -DMP_API_COMPATIBLE -DHAVE_INT128_SUPPORT -DNSS_FIPS_DISABLED -DNSS_NO_INIT_SUPPORT -DNSS_X86_OR_X64 -DNSS_X64 -DNSS_USE_64 -DSEED_ONLY_DEV_URANDOM -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DHAVE_BSD_FLOCK -DHAVE_STRERROR -DXP_UNIX -D_REENTRANT -DDARWIN -DNSS_DISABLE_DBM -DNSS_DISABLE_LIBPKIX -I/builds/worker/checkouts/gecko/security/nss/lib/freebl -I/builds/worker/workspace/obj-build/security/nss/lib/freebl/freebl_freebl3 -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/mpi -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/ecl -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified/kremlin/include -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified/kremlin/kremlib/dist/minimal -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/private/nss -I/builds/worker/workspace/obj-build/dist/include/nss -I/builds/worker/workspace/obj-build/dist/include -fPIC -include /builds/worker/workspace/obj-build/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pthread -pipe -g -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O3 -fno-omit-frame-pointer -funwind-tables -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -MD -MP -MF .deps/freeblver.o.pp /builds/worker/checkouts/gecko/security/nss/lib/freebl/freeblver.c
[task 2020-05-04T16:54:44.488Z] 16:54:44 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/security/nss/lib/freebl/freebl_freebl3'
[task 2020-05-04T16:54:44.584Z] 16:54:44 INFO - make[4]: Entering directory '/builds/worker/workspace/obj-build/security/nss/lib/freebl/freebl_freebl3'
[task 2020-05-04T16:54:44.584Z] 16:54:44 INFO - security/nss/lib/freebl/gcm.o
[task 2020-05-04T16:54:44.585Z] 16:54:44 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang -isysroot /builds/worker/checkouts/gecko/MacOSX10.11.sdk -std=gnu99 --target=x86_64-apple-darwin -o gcm.o -c -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -ftrivial-auto-var-init=pattern -DDEBUG '-DSHLIB_SUFFIX="dylib"' '-DSHLIB_PREFIX="lib"' '-DSHLIB_VERSION="3"' '-DSOFTOKEN_SHLIB_VERSION="3"' -DRIJNDAEL_INCLUDE_TABLES -DMP_API_COMPATIBLE -DHAVE_INT128_SUPPORT -DNSS_FIPS_DISABLED -DNSS_NO_INIT_SUPPORT -DNSS_X86_OR_X64 -DNSS_X64 -DNSS_USE_64 -DSEED_ONLY_DEV_URANDOM -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DHAVE_BSD_FLOCK -DHAVE_STRERROR -DXP_UNIX -D_REENTRANT -DDARWIN -DNSS_DISABLE_DBM -DNSS_DISABLE_LIBPKIX -I/builds/worker/checkouts/gecko/security/nss/lib/freebl -I/builds/worker/workspace/obj-build/security/nss/lib/freebl/freebl_freebl3 -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/mpi -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/ecl -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified/kremlin/include -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified/kremlin/kremlib/dist/minimal -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/private/nss -I/builds/worker/workspace/obj-build/dist/include/nss -I/builds/worker/workspace/obj-build/dist/include -fPIC -include /builds/worker/workspace/obj-build/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pthread -pipe -g -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O3 -fno-omit-frame-pointer -funwind-tables -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -MD -MP -MF .deps/gcm.o.pp /builds/worker/checkouts/gecko/security/nss/lib/freebl/gcm.c
[task 2020-05-04T16:54:44.585Z] 16:54:44 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/security/nss/lib/freebl/freebl_freebl3'
[task 2020-05-04T16:54:44.668Z] 16:54:44 INFO - make[4]: Entering directory '/builds/worker/workspace/obj-build/browser/components/shell'
[task 2020-05-04T16:54:44.671Z] 16:54:44 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang++ -isysroot /builds/worker/checkouts/gecko/MacOSX10.11.sdk -std=gnu++17 --target=x86_64-apple-darwin -o nsMacShellService.o -c -fvisibility=hidden -fvisibility-inlines-hidden -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -ftrivial-auto-var-init=pattern -DDEBUG=1 '-DMOZ_APP_NAME="firefox"' '-DMOZ_APP_VERSION="78.0a1"' -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/browser/components/shell -I/builds/worker/workspace/obj-build/browser/components/shell -I/builds/worker/checkouts/gecko/xpcom/build -I/builds/worker/checkouts/gecko/xpcom/io -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-build/mozilla-config.h -Qunused-arguments -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Wunused-function -Wunused-variable -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -fno-sized-deallocation -fno-aligned-new -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-exceptions -fno-strict-aliasing -stdlib=libc++ -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O3 -fno-omit-frame-pointer -funwind-tables -Werror -MD -MP -MF .deps/nsMacShellService.o.pp /builds/worker/checkouts/gecko/browser/components/shell/nsMacShellService.cpp
[task 2020-05-04T16:54:44.672Z] 16:54:44 ERROR - /builds/worker/checkouts/gecko/browser/components/shell/nsMacShellService.cpp:155:23: error: use of undeclared identifier 'MakeRefPtr'; did you mean 'mozilla::MakeRefPtr'?
[task 2020-05-04T16:54:44.672Z] 16:54:44 INFO - auto referrerInfo = MakeRefPtr<mozilla::dom::ReferrerInfo>(*aElement);
[task 2020-05-04T16:54:44.672Z] 16:54:44 INFO - ^~~~~~~~~~
[task 2020-05-04T16:54:44.673Z] 16:54:44 INFO - mozilla::MakeRefPtr
[task 2020-05-04T16:54:44.673Z] 16:54:44 INFO - /builds/worker/workspace/obj-build/dist/include/mozilla/RefPtr.h:591:11: note: 'mozilla::MakeRefPtr' declared here
[task 2020-05-04T16:54:44.673Z] 16:54:44 INFO - RefPtr<T> MakeRefPtr(Args&&... aArgs) {
[task 2020-05-04T16:54:44.673Z] 16:54:44 INFO - ^
[task 2020-05-04T16:54:44.673Z] 16:54:44 ERROR - /builds/worker/checkouts/gecko/browser/components/shell/nsMacShellService.cpp:155:23: error: use of function template name with no prior declaration in function call with explicit template arguments is a C++2a extension [-Werror,-Wc++2a-extensions]
[task 2020-05-04T16:54:44.674Z] 16:54:44 INFO - auto referrerInfo = MakeRefPtr<mozilla::dom::ReferrerInfo>(*aElement);
[task 2020-05-04T16:54:44.674Z] 16:54:44 INFO - ^
[task 2020-05-04T16:54:44.674Z] 16:54:44 INFO - 2 errors generated.
[task 2020-05-04T16:54:44.674Z] 16:54:44 INFO - /builds/worker/checkouts/gecko/config/rules.mk:750: recipe for target 'nsMacShellService.o' failed
[task 2020-05-04T16:54:44.674Z] 16:54:44 ERROR - make[4]: *** [nsMacShellService.o] Error 1
[task 2020-05-04T16:54:44.675Z] 16:54:44 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/browser/components/shell'
[task 2020-05-04T16:54:44.676Z] 16:54:44 INFO - /builds/worker/checkouts/gecko/config/recurse.mk:74: recipe for target 'browser/components/shell/target-objects' failed
[task 2020-05-04T16:54:44.676Z] 16:54:44 ERROR - make[3]: *** [browser/components/shell/target-objects] Error 2
[task 2020-05-04T16:54:44.676Z] 16:54:44 INFO - make[3]: *** Waiting for unfinished jobs....
[task 2020-05-04T16:54:44.711Z] 16:54:44 INFO - make[4]: Entering directory '/builds/worker/workspace/obj-build/security/nss/lib/freebl/freebl_freebl3'
[task 2020-05-04T16:54:44.712Z] 16:54:44 INFO - security/nss/lib/freebl/hmacct.o
[task 2020-05-04T16:54:44.712Z] 16:54:44 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang -isysroot /builds/worker/checkouts/gecko/MacOSX10.11.sdk -std=gnu99 --target=x86_64-apple-darwin -o hmacct.o -c -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -ftrivial-auto-var-init=pattern -DDEBUG '-DSHLIB_SUFFIX="dylib"' '-DSHLIB_PREFIX="lib"' '-DSHLIB_VERSION="3"' '-DSOFTOKEN_SHLIB_VERSION="3"' -DRIJNDAEL_INCLUDE_TABLES -DMP_API_COMPATIBLE -DHAVE_INT128_SUPPORT -DNSS_FIPS_DISABLED -DNSS_NO_INIT_SUPPORT -DNSS_X86_OR_X64 -DNSS_X64 -DNSS_USE_64 -DSEED_ONLY_DEV_URANDOM -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DHAVE_BSD_FLOCK -DHAVE_STRERROR -DXP_UNIX -D_REENTRANT -DDARWIN -DNSS_DISABLE_DBM -DNSS_DISABLE_LIBPKIX -I/builds/worker/checkouts/gecko/security/nss/lib/freebl -I/builds/worker/workspace/obj-build/security/nss/lib/freebl/freebl_freebl3 -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/mpi -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/ecl -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified/kremlin/include -I/builds/worker/checkouts/gecko/security/nss/lib/freebl/verified/kremlin/kremlib/dist/minimal -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/private/nss -I/builds/worker/workspace/obj-build/dist/include/nss -I/builds/worker/workspace/obj-build/dist/include -fPIC -include /builds/worker/workspace/obj-build/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pthread -pipe -g -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O3 -fno-omit-frame-pointer -funwind-tables -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -MD -MP -MF .deps/hmacct.o.pp /builds/worker/checkouts/gecko/security/nss/lib/freebl/hmacct.c
[task 2020-05-04T16:54:44.713Z] 16:54:44 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/security/nss/lib/freebl/freebl_freebl3'
[task 2020-05-04T16:54:44.728Z] 16:54:44 INFO - make[4]: Entering directory '/builds/worker/workspace/obj-build/media/ffvpx/libavutil'
[task 2020-05-04T16:54:44.729Z] 16:54:44 INFO - /builds/worker/workspace/obj-build/_virtualenvs/init_py3/bin/python -m mozbuild.action.check_binary --target libmozavutil.dylib
[task 2020-05-04T16:54:44.730Z] 16:54:44 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/media/ffvpx/libavutil'
[task 2020-05-04T16:54:44.744Z] 16:54:44 INFO - make[4]: Entering directory '/builds/worker/workspace/obj-build/media/ffvpx/libavutil'
[task 2020-05-04T16:54:44.744Z] 16:54:44 INFO - chmod +x libmozavutil.dylib

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e3b9bc0fa329
Allow having const WebIDL pointers in XPIDL. r=froydnj
https://hg.mozilla.org/integration/autoland/rev/d7d0fdb56cbf
Cleanup the ReferrerInfo code. r=ckerschb
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.