Closed Bug 1705194 Opened 3 years ago Closed 3 years ago

Add `inline` for MediaCache's static members to avoid out-of-class defintion

Categories

(Core :: Audio/Video: Playback, task, P3)

task

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

It's weird that the definition of MediaCache is not in the MediaCache.h. For the consistency of media codebase, we should move it to the header.

See Static data members part in [1], inline is able to be used on static member since C++17.

[1] https://en.cppreference.com/w/cpp/language/static

Depends on D112080

The purpose of previous implementation (putting the definition of MediaCache in the cpp file) is probably to prevent people using that directly (they should use MediaCacheStream), so this patch is going to preseve that ability.

Depends on D112081

Attachment #9215906 - Attachment is obsolete: true
Attachment #9215873 - Attachment is obsolete: true

After an offline discussion with bryce, we would keep the definition in the cpp file still.

Summary: Move the definition of `MediaCache` to the header file → Add `inline` for MediaCache's static members to avoid out-of-class defintion
Attachment #9215874 - Attachment description: Bug 1705194 - part2 : use 'inline' on static members to remove the out-of-class definition. r?bryce → Bug 1705194 - use 'inline' on static members to remove the out-of-class definition. r?bryce
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9147f4def4ad
use 'inline' on static members to remove the out-of-class definition. r=bryce
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: