Since mir_client_library.cpp has started to become unwieldly I propose we follow the convention mir_screencast is using, i.e.:
1. Public header file goes in mir_toolkit/mir_trust_session.h
2. C API implementation goes in src/client/mir_trust_session_api.cpp
3. Internal classes as usual, src/client/mir_trust_session.{cpp,h}
148 +///\page trust_session.c trust_session.c: A mir client which starts a trust session and trusted client app.
149 +/// mir_demo_client_trust_session shows the use of mir trust session API.
150 +/// This program opens a mir connection and creates a trust session.
...
We tend to prefer to keep the parameter list on the same line as the capture list:
[this] (MirTrustSessionState new_state), but that's not a hard and fast rule AFAIK.
A first pass...
Since mir_client_ library. cpp has started to become unwieldly I propose we follow the convention mir_screencast is using, i.e.:
1. Public header file goes in mir_toolkit/ mir_trust_ session. h mir_trust_ session_ api.cpp mir_trust_ session. {cpp,h}
2. C API implementation goes in src/client/
3. Internal classes as usual, src/client/
148 +///\page trust_session.c trust_session.c: A mir client which starts a trust session and trusted client app. client_ trust_session shows the use of mir trust session API.
149 +/// mir_demo_
150 +/// This program opens a mir connection and creates a trust session.
...
519 + virtual std::shared_ ptr<TrustSessio n> start_trust_ session_ for(std: :string& error, ptr<Session> const& session,
520 + std::shared_
Since this is a C file, the C(/Javadoc) format is preferred, like in the public files.
519 + virtual std::shared_ ptr<TrustSessio n> start_trust_ session_ for(std: :string& error, ptr<Session> const& session,
520 + std::shared_
...
Either use a 4-space indentation or align with char after '('.
567 + virtual ~TrustSession() {}
1129 + TrustSession() {}
1130 + virtual ~TrustSession() {}
Use '= default' instead;
744 +#include <string>
Not needed.
1239 +/***** ******* ******* ******* ******* ******* *****/
1240 + * Trust session specific functions *
1241 + *******
This can be made prettier :)
1249 + pid_t pid)
1255 + mir_trust_ session_ callback callback,
1256 + void* context)
1272 + reinterpret_ cast<mir_ trust_session_ callback>
1273 + (assign_result),
1274 + NULL));
1279 + mir_trust_ session_ callback callback,
1280 + void* context)
1296 + reinterpret_ cast<mir_ trust_session_ callback>
1297 + (assign_result),
1298 + NULL));
1308 + mir_trust_ session_ event_callback callback,
1309 + void* context)
Either use a 4-space indentation or align with char after '(' on previous line.
1427 + [this] nState new_state)
1428 + (MirTrustSessio
1501 + [this, callback, context] nState state)
1502 + (MirTrustSessio
2771 + [this] ptr<msh: :Session> const& child_session)
2772 + (std::shared_
We tend to prefer to keep the parameter list on the same line as the capture list: nState new_state), but that's not a hard and fast rule AFAIK.
[this] (MirTrustSessio
1430 + std::lock_ guard<std: :recursive_ mutex> lock(mutex);
Why do we need a recursive mutex?
1595 + MirTrustSession (mir::protobuf: :DisplayServer: :Stub & server, (MirTrustSessio n const &) = delete; (MirTrustSessio n const &) = delete;
1600 + MirTrustSession
1601 + MirTrustSession& operator=
... and others in the class
* and & go with the type (or 'const' if there is one).
1820 + std::unique_ lock<std: :mutex> lk(guard);
Since the lock is not used with condition variables or moved, we could use the simpler std::lock_guard<>.
1814 +mcl::TrustSess ionControl: :~TrustSessionC ontrol( )
1815 +{
1816 +}
Is this needed?
2737 + TrustSession* impl = new TrustSession( trusted_ helper, parameters, sink); ptr<msh: :TrustSession> ptr(impl);
2738 + std::shared_
auto const trust_session = std::make_ shared< TrustSession> (trusted_ helper, parameters, sink);