nsImageLoadingContent::Notify is where all image notifications for things like <img> elements go through. The vast majority being implemented in C++. Any image observers implemented in JS must go through ScriptedNotificationObserver.
We only use ScriptedNotificationObserver in tests. The addon repository only has six hits, and four of them seem to be different versions of the same addon. And they don't seem to be among the more popular addons.
The original location of the assert only caught some images anyway. Things like CSS background images don't go through nsImageLoadingContent. ProgressTracker is the origin of all image notifications.
nsContentUtils::IsPatternMatching is the most common by far, but the
other is a generic location that may cover a number of issues.
MozReview-Commit-ID: Kli39btsqdd
--HG--
extra : rebase_source : 9ffdafb1f6654a90ab5e93594ffcb11e987f2b5e
nsContentUtils::IsPatternMatching is the most common by far, but the
other two are generic locations that may cover a number of issues.
MozReview-Commit-ID: Kli39btsqdd
--HG--
extra : rebase_source : 1a7eda2a711f079978b54012d9c7466bbd6de36f
This is refcounted as we'll need to hold strong references to the ImageTracker
from style structs that load images.
MozReview-Commit-ID: 994gE9tOjAn
--HG--
extra : rebase_source : 2d50059e51b42251c89a92a954cef7b49720ceba
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout. The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.
CLOSED TREE makes big refactorings like this a piece of cake.
# The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
xargs perl -p -i -e '
s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
s/nsRefPtr ?</RefPtr</g; # handle declarations and variables
'
# Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h
# Handle nsRefPtr.h itself, a couple places that define constructors
# from nsRefPtr, and code generators specially. We do this here, rather
# than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
# things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
mfbt/nsRefPtr.h \
xpcom/glue/nsCOMPtr.h \
xpcom/base/OwningNonNull.h \
ipc/ipdl/ipdl/lower.py \
ipc/ipdl/ipdl/builtin.py \
dom/bindings/Codegen.py \
python/lldbutils/lldbutils/utils.py
# In our indiscriminate substitution above, we renamed
# nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'
if [ -d .git ]; then
git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
The bulk of this commit was generated by running:
run-clang-tidy.py \
-checks='-*,llvm-namespace-comment' \
-header-filter=^/.../mozilla-central/.* \
-fix
This patch was generated with the following command:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 's/return ([a-zA-Z0-9]+)\.ErrorCode\(\);/return \1.StealNSResult();/'