Closed Bug 1273307 Opened 3 years ago Closed 3 years ago

Remove copy constructor/assignment operator for Message/Pickle

Categories

(Core :: IPC, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: billm, Assigned: billm)

References

Details

(Whiteboard: btpp-active)

Attachments

(1 file)

This is a nice thing to do, and it caught a silly bug where I copied a message by accident. I haven't done a try push to Mac yet, but I'm worried it may depend on bug 1246743 based on what happened in bug 1092462. It looks like bug 1246743 is pretty far along though.
Attachment #8753090 - Flags: review?(nfroyd)
Comment on attachment 8753090 [details] [diff] [review]
Remove Message/Pickle copy constructor and copy operator=

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

Excellent.

::: ipc/chromium/src/base/pickle.h
@@ +54,5 @@
>    // ownership == OWNS, then again no copying takes place. However, the buffer
>    // is writable and will be freed when this Pickle is destroyed.
>    Pickle(const char* data, int data_len, Ownership ownership = BORROWS);
>  
> +  Pickle(const Pickle& other) = delete;

Can you write a small comment describing why we want this deleted?
Attachment #8753090 - Flags: review?(nfroyd) → review+
Duplicate of this bug: 1092462
Also the "// Performs a deep copy." comment can probably be deleted given that the method does not actually exist.
Whiteboard: btpp-active
https://hg.mozilla.org/mozilla-central/rev/ea8c597133e5
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.