Closed
Bug 1276590
Opened 9 years ago
Closed 8 years ago
B2GOS: ShadowLayerUtilsGralloc.cpp:126:14: error: 'const class IPC::Message' has no member named 'ReadBytes'
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(firefox50 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: gwagner, Assigned: tzimmermann)
References
Details
Attachments
(1 file)
No description provided.
Reporter | ||
Updated•9 years ago
|
Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/56550/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/56550/
Attachment #8758245 -
Flags: review?(nfroyd)
Comment 2•9 years ago
|
||
Comment on attachment 8758245 [details]
Bug 1276590: Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code,
https://reviewboard.mozilla.org/r/56550/#review53102
r=me with the changes below, assuming they pass tests.
::: gfx/layers/ipc/GonkNativeHandleUtils.cpp:40
(Diff revision 1)
> PickleIterator* aIter, paramType* aResult)
> {
> size_t nbytes;
> const char* data;
> if (!aMsg->ReadSize(aIter, &nbytes) ||
> - !aMsg->ReadBytes(aIter, &data, nbytes)) {
> + !aMsg->ReadBytesInto(aIter, &data, nbytes)) {
ReadBytesInto assumes that its second parameter points to a chunk of memory that is `nbytes` long, which isn't the case here. I think you want:
aMsg->FlattenBytes(aIter, &data, nbytes)
instead.
::: gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp:126
(Diff revision 1)
> int64_t index;
>
> if (!aMsg->ReadInt(aIter, &owner) ||
> !aMsg->ReadInt64(aIter, &index) ||
> !aMsg->ReadSize(aIter, &nbytes) ||
> - !aMsg->ReadBytes(aIter, &data, nbytes)) {
> + !aMsg->ReadBytesInto(aIter, &data, nbytes)) {
Same thing here.
Attachment #8758245 -
Flags: review?(nfroyd) → review+
Pushed by tdz@users.sourceforge.net:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1f80fae4ca27
Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code, r=froydnj
Comment 4•9 years ago
|
||
backed out by request from Thomas
Backout by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/69312b20d716
Backed out changeset 1f80fae4ca27 on developers request
We're going to be removing FlattenBytes in a month or so (once bug 1264642 is done). I wouldn't recommend using it. Instead, it would be better to use ReadBytesInto to read into actual allocated memory.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → tzimmermann
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8758245 [details]
Bug 1276590: Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code,
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/56550/diff/1-2/
Attachment #8758245 -
Attachment description: MozReview Request: Bug 1276590: Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code, r?froydnj → MozReview Request: Bug 1276590: Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code, r?billm
Attachment #8758245 -
Flags: review?(wmccloskey)
Comment on attachment 8758245 [details]
Bug 1276590: Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code,
https://reviewboard.mozilla.org/r/56550/#review53720
::: gfx/layers/ipc/GonkNativeHandleUtils.cpp:56
(Diff revision 2)
> }
>
> - memcpy(nativeHandle->data + nativeHandle->numFds, data, nbytes);
> + auto data =
> + reinterpret_cast<char*>(nativeHandle->data + nativeHandle->numFds);
> + if (!aMsg->ReadBytesInto(aIter, data, nbytes)) {
> + return false;
If this fails, it looks like you'll leak nativeHandle.
Attachment #8758245 -
Flags: review?(wmccloskey) → review+
Assignee | ||
Comment 9•8 years ago
|
||
https://reviewboard.mozilla.org/r/56550/#review53720
> If this fails, it looks like you'll leak nativeHandle.
This method has always been leaking on errors. I'll fix that with |UniquePtr| in the next iteration of the patch.
Assignee | ||
Comment 10•8 years ago
|
||
Comment on attachment 8758245 [details]
Bug 1276590: Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code,
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/56550/diff/2-3/
Attachment #8758245 -
Attachment description: MozReview Request: Bug 1276590: Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code, r?billm → Bug 1276590: Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code,
Comment 11•8 years ago
|
||
Pushed by tdz@users.sourceforge.net:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e9b2e7b412b9
Replace |ReadBytes| with |ReadBytesInto| in Gonk IPC code, r=froydnj,billm
Assignee | ||
Comment 12•8 years ago
|
||
Comment 13•8 years ago
|
||
bugherder |
You need to log in
before you can comment on or make changes to this bug.
Description
•