Closed
Bug 1610067
Opened 6 years ago
Closed 5 years ago
[meta] Remove nsAutoPtr
Categories
(Core :: XPCOM, task)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla77
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: erahm, Assigned: erahm)
References
Details
(Keywords: meta)
Attachments
(1 file)
nsAutoPtr
is deprecated in favor of UniquePtr
, this bug will track the conversion to UniquePtr
and the eventual removal of nsAutoPtr
.
Conversion is not always straightforward, but generally follows this pattern:
- Replace
#include "nsAutoPtr.h"
with#include "mozilla/UniquePtr.h"
, possibly add the missing include - Replace
nsAutoPtr
withUniquePtr
or possibly a fully-qualifiedmozilla::UniquePtr
- Fix up any place that expects implicit conversion from the container to the
T*
raw pointer type by useUniquePtr<T>::get()
, possibly just switching the variable type toconst auto&
, or optionally consider updating consumers to use a ref instead so you can just use*ptr
- Fix up any place that assigns a raw pointer to a
UniquePtr
. For cases callingnew
replace that withMakeUnique
, if you're passed a raw pointer you can useWrapUnique
orUniquePtr<T>::reset
- Replace
nsAutoPtr::forget
withUniquePtr<T>::release
. It's possible you'll need prefix the release withUnused <<
- For things with a private destructor replace
friend class nsAutoPtr
withfriend class mozilla::DefaultDelete
There are currently 735 references in tree.
Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Assignee: nobody → erahm
Status: NEW → ASSIGNED
Updated•5 years ago
|
Attachment #9144104 -
Attachment description: Bug 1610067 - Remove nsAutoPtr. r=#xpcom-reviewers!'
`nsAutoPtr` has been deprecated for 6 years. All remaining references are gone and it can now be removed. → Bug 1610067 - Remove nsAutoPtr. r=#xpcom-reviewers!'
Pushed by erahm@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eeaa8ec71789
Remove nsAutoPtr. r=xpcom-reviewers,nika'
Comment 3•5 years ago
|
||
Backed out changeset eeaa8ec71789 (bug 1610067) for bustages complaining about nsAutoPtr.h
Backout link: https://hg.mozilla.org/integration/autoland/rev/0306492fe5a5500efe7bfce78bd6f1cfebdbbad3
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=300009157&repo=autoland&lineNumber=21479
task 2020-04-29T15:51:28.766Z] 15:51:28 INFO - make[4]: Entering directory '/builds/worker/workspace/obj-build/gfx/vr'
[task 2020-04-29T15:51:28.770Z] 15:51:28 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang++ -std=gnu++17 -o VRManager.o -c -I/builds/worker/workspace/obj-build/dist/stl_wrappers -I/builds/worker/workspace/obj-build/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -ftrivial-auto-var-init=pattern -DDEBUG=1 -DOS_POSIX=1 -DOS_LINUX=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/gfx/vr -I/builds/worker/workspace/obj-build/gfx/vr -I/builds/worker/checkouts/gecko/dom/base -I/builds/worker/checkouts/gecko/gfx/layers/d3d11 -I/builds/worker/checkouts/gecko/gfx/thebes -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/ipc/glue -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 -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-exceptions -fno-strict-aliasing -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 -Os -fno-omit-frame-pointer -funwind-tables -Werror -I/builds/worker/workspace/obj-build/dist/include/cairo -I/builds/worker/checkouts/gecko/widget/gtk/compat-gtk3 -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gtk-3.0/unix-print -fexperimental-new-pass-manager -MD -MP -MF .deps/VRManager.o.pp /builds/worker/checkouts/gecko/gfx/vr/VRManager.cpp
[task 2020-04-29T15:51:28.770Z] 15:51:28 INFO - In file included from /builds/worker/checkouts/gecko/gfx/vr/VRManager.cpp:14:
[task 2020-04-29T15:51:28.770Z] 15:51:28 INFO - In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/dom/VRDisplay.h:16:
[task 2020-04-29T15:51:28.770Z] 15:51:28 INFO - In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/dom/DOMPoint.h:11:
[task 2020-04-29T15:51:28.770Z] 15:51:28 INFO - /builds/worker/workspace/obj-build/dist/include/mozilla/dom/DOMMatrix.h:11:10: fatal error: 'nsAutoPtr.h' file not found
[task 2020-04-29T15:51:28.770Z] 15:51:28 INFO - #include "nsAutoPtr.h"
[task 2020-04-29T15:51:28.771Z] 15:51:28 INFO - ^~~~~~~~~~~~~
[task 2020-04-29T15:51:28.771Z] 15:51:28 INFO - 1 error generated.
[task 2020-04-29T15:51:28.771Z] 15:51:28 INFO - /builds/worker/checkouts/gecko/config/rules.mk:750: recipe for target 'VRManager.o' failed
[task 2020-04-29T15:51:28.771Z] 15:51:28 ERROR - make[4]: *** [VRManager.o] Error 1
[task 2020-04-29T15:51:28.771Z] 15:51:28 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/gfx/vr'
[task 2020-04-29T15:51:28.771Z] 15:51:28 INFO - /builds/worker/checkouts/gecko/config/recurse.mk:74: recipe for target 'gfx/vr/target-objects' failed
[task 2020-04-29T15:51:28.771Z] 15:51:28 ERROR - make[3]: *** [gfx/vr/target-objects] Error 2
[task 2020-04-29T15:51:28.771Z] 15:51:28 INFO - make[3]: *** Waiting for unfinished jobs....
[task 2020-04-29T15:51:28.771Z] 15:51:28 INFO - make[4]: Entering directory '/builds/worker/workspace/obj-build/gfx/layers'
Flags: needinfo?(erahm)
Pushed by erahm@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1186bfb95124
Remove nsAutoPtr. r=xpcom-reviewers,nika'
Assignee | ||
Updated•5 years ago
|
Flags: needinfo?(erahm)
Comment 5•5 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox77:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in
before you can comment on or make changes to this bug.
Description
•