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

Commit 864bd976 authored by Steven Moreland's avatar Steven Moreland Committed by Gerrit Code Review
Browse files

Merge "libbinder: update 'TODO' comments for RPC"

parents 1b48b713 a5036f0b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ status_t Parcel::flattenBinder(const sp<IBinder>& binder) {
            status_t status = writeInt32(1); // non-null
            if (status != OK) return status;
            RpcAddress address = RpcAddress::zero();
            // TODO(b/167966510): need to undo this if the Parcel is not sent
            status = mSession->state()->onBinderLeaving(mSession, binder, &address);
            if (status != OK) return status;
            status = address.writeToParcel(this);
+3 −3
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ bool RpcSession::setupSocketClient(const RpcSocketAddress& addr) {

    if (!setupOneSocketConnection(addr, RPC_SESSION_ID_NEW, false /*reverse*/)) return false;

    // TODO(b/185167543): we should add additional sessions dynamically
    // TODO(b/189955605): we should add additional sessions dynamically
    // instead of all at once.
    // TODO(b/186470974): first risk of blocking
    size_t numThreadsAvailable;
@@ -314,11 +314,11 @@ bool RpcSession::setupSocketClient(const RpcSocketAddress& addr) {

    // we've already setup one client
    for (size_t i = 0; i + 1 < numThreadsAvailable; i++) {
        // TODO(b/185167543): shutdown existing connections?
        // TODO(b/189955605): shutdown existing connections?
        if (!setupOneSocketConnection(addr, mId.value(), false /*reverse*/)) return false;
    }

    // TODO(b/185167543): we should add additional sessions dynamically
    // TODO(b/189955605): we should add additional sessions dynamically
    // instead of all at once - the other side should be responsible for setting
    // up additional connections. We need to create at least one (unless 0 are
    // requested to be set) in order to allow the other side to reliably make
+2 −0
Original line number Diff line number Diff line
@@ -400,6 +400,8 @@ status_t RpcState::transactAddress(const base::unique_fd& fd, const RpcAddress&
    if (status_t status =
                rpcSend(fd, session, "transaction", transactionData.data(), transactionData.size());
        status != OK)
        // TODO(b/167966510): need to undo onBinderLeaving - we know the
        // refcount isn't successfully transferred.
        return status;

    if (flags & IBinder::FLAG_ONEWAY) {
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ public:
     *
     * If this is not specified, this will be a single-threaded server.
     *
     * TODO(b/185167543): these are currently created per client, but these
     * TODO(b/167966510): these are currently created per client, but these
     * should be shared.
     */
    void setMaxThreads(size_t threads);
+1 −4
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public:
     * If this is called, 'shutdown' on this session must also be called.
     * Otherwise, a threadpool will leak.
     *
     * TODO(b/185167543): start these dynamically
     * TODO(b/189955605): start these dynamically
     */
    void setMaxThreads(size_t threads);
    size_t getMaxThreads();
@@ -273,9 +273,6 @@ private:
    size_t mClientConnectionsOffset = 0;
    std::vector<sp<RpcConnection>> mClientConnections;
    std::vector<sp<RpcConnection>> mServerConnections;

    // TODO(b/185167543): allow sharing between different sessions in a
    // process? (or combine with mServerConnections)
    std::map<std::thread::id, std::thread> mThreads;
};