Closed Bug 1376628 Opened 7 years ago Closed 7 years ago

Static analysis fixes in dom/base/

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: janx, Assigned: janx)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

There are a few larges files in dom/base/ [0] that present opportunities for quick automated improvements using clang-tidy [1].

[0] For example:
- dom/base/nsContentUtils.cpp
- dom/base/nsDOMWindowUtils.cpp
- dom/base/nsGlobalWindow.cpp

[1] Using auto-fixable rules like:
- modernize-use-nullptr
- readability-else-after-return
- performance-for-range-copy
Comment on attachment 8881619 [details] [diff] [review]
Annotate methods with 'override' where possible in dom/base/ (clang-tidy: modernize-use-override).

Review of attachment 8881619 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsContentUtils.cpp
@@ +538,5 @@
>    NS_DECL_NSIOBSERVER
>  
>    void Init();
>    void Shutdown();
> +  void AnnotateHang(HangMonitor::HangAnnotations& aAnnotations) override;

Note: This is a slightly unrelated drive-by fix ('virtual' is unnecessary because 'override' already implies it).
Comment on attachment 8881616 [details] [diff] [review]
Use nullptr where possible in dom/base/ (clang-tidy: modernize-use-nullptr).

Ehsan, please have a look when convenient.

Also, please indicate if any changes are not worth the effort / shouldn't be pursued.
Attachment #8881616 - Flags: review?(ehsan)
Attachment #8881617 - Flags: review?(ehsan)
Attachment #8881618 - Flags: review?(ehsan)
Attachment #8881619 - Flags: review?(ehsan)
Attachment #8881616 - Flags: review?(ehsan) → review+
Attachment #8881617 - Flags: review?(ehsan) → review+
Attachment #8881618 - Flags: review?(ehsan) → review+
Attachment #8881619 - Flags: review?(ehsan) → review+
Thank you Ehsan!

Sheriffs, please land these fixes.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/075df18a0a58
Use nullptr where possible in dom/base/ (clang-tidy: modernize-use-nullptr). r=ehsan
https://hg.mozilla.org/integration/mozilla-inbound/rev/b7021a785963
Don't use 'else' after 'break' or 'return' in dom/base/ (clang-tidy: readability-else-after-return). r=ehsan
https://hg.mozilla.org/integration/mozilla-inbound/rev/ab7c82c4c34c
Change loop variable copies to const references where possible in dom/base/ (clang-tidy: performance-for-range-copy). r=ehsan
https://hg.mozilla.org/integration/mozilla-inbound/rev/7095cd0f91c7
Annotate methods with 'override' where possible in dom/base/ (clang-tidy: modernize-use-override). r=ehsan
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.