Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15feb9b5 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add private helpers needed for job queue.

We need to compare the data in parcels.  Bleah.

Test: not relevant here.

Change-Id: I7b694ec89793449bf7ac342f663dc534feedf9b6
parent 99dfb8a6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ public:
    status_t            appendFrom(const Parcel *parcel,
                                   size_t start, size_t len);

    int                 compareData(const Parcel& other);

    bool                allowFds() const;
    bool                pushAllowFds(bool allowFds);
    void                restoreAllowFds(bool lastValue);
+8 −0
Original line number Diff line number Diff line
@@ -553,6 +553,14 @@ status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len)
    return err;
}

int Parcel::compareData(const Parcel& other) {
    size_t size = dataSize();
    if (size != other.dataSize()) {
        return size < other.dataSize() ? -1 : 1;
    }
    return memcmp(data(), other.data(), size);
}

bool Parcel::allowFds() const
{
    return mAllowFds;