Closed Bug 1246100 Opened 4 years ago Closed 4 years ago

[Static Analysis][Big parameter passed by value] In Function MockWebBrowserPrint

Categories

(Core Graveyard :: Embedding: APIs, defect)

defect
Not set

Tracking

(firefox47 fixed)

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1286525)

Attachments

(1 file)

The Static Analysis tool Coverity added aData is passed to contructor MockWebBrowserPrint by value:
>> explicit MockWebBrowserPrint(const PrintData aData);

The size of PrintData is around 560 bytes, more or less depending on platform data alignment. We could modify this by passing aData as 
PrintData& and than passing it to mData that calls the copy constructor:

>> MOZ_IMPLICIT PrintData(const PrintData& _o)

Thus we can avoid the first copy of PrinData on the stack of MockWebBrowserPrint's constructor.
Attachment #8716217 - Flags: review?(benjamin) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/4f4f57c87427
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.