Mir

Merge lp:~vanvugt/mir/frontend-server into lp:mir

Proposed by Daniel van Vugt
Status: Rejected
Rejected by: Daniel van Vugt
Proposed branch: lp:~vanvugt/mir/frontend-server
Merge into: lp:mir
Diff against target: 666 lines (+75/-77)
20 files modified
examples/demo-inprocess-surface-client/demo_inprocess_surface_client.cpp (+1/-1)
examples/demo-inprocess-surface-client/inprocess_egl_client.cpp (+5/-5)
examples/demo-inprocess-surface-client/inprocess_egl_client.h (+3/-3)
include/server/mir/default_server_configuration.h (+3/-3)
include/server/mir/frontend/server.h (+8/-8)
include/server/mir/server_configuration.h (+0/-1)
include/test/mir_test_doubles/mock_server.h (+5/-5)
include/test/mir_test_doubles/stub_server.h (+6/-6)
src/server/frontend/default_configuration.cpp (+7/-7)
src/server/frontend/session_mediator.cpp (+7/-7)
src/server/frontend/session_mediator.h (+3/-3)
src/server/scene/default_configuration.cpp (+2/-2)
src/server/scene/session_manager.h (+2/-2)
tests/acceptance-tests/test_protobuf.cpp (+1/-1)
tests/integration-tests/session_management.cpp (+2/-2)
tests/integration-tests/test_error_reporting.cpp (+1/-1)
tests/mir_test_framework/input_testing_server_options.cpp (+0/-1)
tests/unit-tests/frontend/test_session_mediator.cpp (+9/-9)
tests/unit-tests/frontend/test_session_mediator_android.cpp (+5/-5)
tests/unit-tests/frontend/test_session_mediator_mesa.cpp (+5/-5)
To merge this branch: bzr merge lp:~vanvugt/mir/frontend-server
Reviewer Review Type Date Requested Status
Robert Carr (community) Disapprove
PS Jenkins bot (community) continuous-integration Approve
Chris Halse Rogers Abstain
Andreas Pokorny (community) Needs Fixing
Kevin DuBois (community) needs discussion Needs Information
Alan Griffiths Needs Fixing
Alexandros Frantzis (community) Needs Information
Review via email: mp+207602@code.launchpad.net

Commit message

Rename frontend::Shell --> frontend::Server

That class in no way resembles a shell, does not relate to the "shell"
component, and does not provide real shells with any shell-related interface.

This frees up the name "Shell" for more appropriate and less confusing
use in real shell code.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

I am not sure about the new name - but it seems a better fit. Something with Session would be nice.. but SessionManager..... nah.

review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

I don't find the new name an improvement. What's a 'server' from the point of view of the frontend? Why is not the graphics platform or the focus controller also part of the 'server'?

"Needs discussion"

review: Needs Information
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I think this is a verschlimmbesserung (sorry, don't know an English equivalent)

I could understand changing "Shell" to "Scene", but to "Server"?

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It looks like most of the team could agree that "frontend::Shell" needs renaming in the least. If you're unhappy with "Server" then suggest away.

Looking at the interface it provides, no obvious noun comes to mind. But I feel "Server" is less bad than "Shell" for the reasons already stated. Although if no obvious noun comes to mind, that also suggests the interface itself is a bad fit and might be better placed as part of some other class/interface.

Revision history for this message
kevin gunn (kgunn72) wrote :

so maybe i'm just simpleminded...i read through the comment, then read thru the code a bit. "server" makes sense to me.

Revision history for this message
Kevin DuBois (kdub) wrote :

mf::Shell (in lp:mir/devel) has open_session, close_session, create_surface_for, and handle_surface_created.

I've had the thought before that create_surface_for() doesn't quite fit with the rest of the interface, and that the session should should have a create_surface() method instead of mf::Shell having a create_surface_for() method.

So, create_surface_for() and handle_surface_created() seemed like misplaced functions on this interface, and the primary purpose of this interface is to create sessions.... so maybe mf::Shell should be mf::SessionFactory, and we should put a TODO/FIXME about the misplaced functions.

Revision history for this message
Kevin DuBois (kdub) :
review: Needs Information (needs discussion)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'd rather not call it a Factory. That pattern is presently reserved for construction-only interfaces. I don't see this as sufficient reason to break with that tradition.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I think the problem is that frontend::Shell doesn't represent a clear abstraction. If it did, then we would probably have a good name for that abstraction.

Three of the four functions are actually to do with manipulating the data model. Vis: open_session(), close_session() and create_surface_for(). I agree that as Session is part of the data model it ought to understand creating a surface and the latter is misplaced.

That comes down to a poor interface design around scene, Session and Surface. It ought to be easy for a shell to decorate the data model required by frontend and add its own logic. The fact that we've made that hard for ourselves (and for unity8) is the underlying cause for the awkward handle_surface_created().

Note that this interface is a part of a larger mess: We've got an awkward coupling between creating surfaces and them being added to the scene. (Creating the surface implicitly adds it to the scene *before* the client has had a chance to paint a buffer.)

The interface should probably be something like:

class frontend::XXXXX
{
public:
    virtual std::shared_ptr<Session> create_session(...) = 0;
    virtual void activate(std::shared_ptr<Session> a_session) = 0;
    virtual void deactivate(std::shared_ptr<Session> a_session) = 0;
};

class frontend::Session
{
public:
    virtual std::shared_ptr<Surface> create_session(...) = 0;
    virtual void activate(std::shared_ptr<Surface> a_surface) = 0;
    virtual void deactivate(std::shared_ptr<Surface> a_surface) = 0;
    ...
};

We ought to provide utility classes for decorating implementations of these that can be used by shells to wrap the implementations provided by scene.

PS I still think that Scene is a better name than Server

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Odd how my thoughts change shortly after posting.
...
> The interface should probably be something like:
>
> class frontend::XXXXX
> {
> public:
> virtual std::shared_ptr<Session> create_session(...) = 0;
> virtual void activate(std::shared_ptr<Session> a_session) = 0;
> virtual void deactivate(std::shared_ptr<Session> a_session) = 0;
> };
>
> class frontend::Session
> {
> public:
> virtual std::shared_ptr<Surface> create_session(...) = 0;
> virtual void activate(std::shared_ptr<Surface> a_surface) = 0;
> virtual void deactivate(std::shared_ptr<Surface> a_surface) = 0;
> ...
> };

Actually:

class frontend::Scene
{
public:
    virtual std::shared_ptr<Session> create_session(...) = 0;

    virtual void add(std::shared_ptr<Session> a_session) = 0;
    virtual void remove(std::shared_ptr<Session> a_session) = 0;

    virtual void add(std::shared_ptr<Surface> a_surface) = 0;
    virtual void remove(std::shared_ptr<Surface> a_surface) = 0;
};

class frontend::Session
{
public:
    virtual std::shared_ptr<Surface> create_surface(...) = 0;
    ...
};

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alan,

I think overlapping names like that between components makes things less clear. Class "frontend::Scene" isn't a member of component/namespace "scene". That's definitely confusing and just recreates the problem being solved here. There may be good reasons out there to do that sometimes but I don't see this as one.

Re: "Creating the surface implicitly adds it to the scene *before* the client has had a chance to paint a buffer". That's fine and desirable even. We have the smarts in place to never composite a surface which hasn't been painted. With a few minor bugs (in progress) that feature does work. More importantly we must remember to never trust any client(!). They are external processes beyond our control and we should ensure there is never any sever logic which blocks on, or depends on a client behaving correctly.

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

frontend::Shell does seem weird.

What about frontend::Service or frontend::SessionService?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

"Service" is a overly generic word, I think.

It sounds like we're all confused by the role of the class and that's what really needs to be resolved before a good name is obvious.

Revision history for this message
Chris Halse Rogers (raof) wrote :

Yeah.

So, as I understand it it's currently a combination of Session factoryish and weird surface bits.

create_surface_for looks to be a bit of a hack we should get away from - this is an internal implementation detail that shells shouldn't have to worry about.

handle_surface_created is simply a listener interface that could go elsewhere.

It's somewhat inconvenient that we already have a frontend::SessionCreator. Otherwise that would be a fine name for the first part :).

lp:~vanvugt/mir/frontend-server updated
1418. By Daniel van Vugt

Merge latest development-branch

1419. By Daniel van Vugt

Merge latest development-branch

1420. By Daniel van Vugt

Merge latest development-branch.

1421. By Daniel van Vugt

Merge latest development-branch

1422. By Daniel van Vugt

Merge latest development-branch

1423. By Daniel van Vugt

Merge latest development-branch

1424. By Daniel van Vugt

Merge latest development-branch.

1425. By Daniel van Vugt

Merge latest development-branch

1426. By Daniel van Vugt

Merge latest development-branch

1427. By Daniel van Vugt

Merge latest development-branch

1428. By Daniel van Vugt

Merge latest development-branch

1429. By Daniel van Vugt

Merge latest development-branch

1430. By Daniel van Vugt

Merge latest development-branch

1431. By Daniel van Vugt

Merge latest development-branch

1432. By Daniel van Vugt

Merge latest development-branch

1433. By Daniel van Vugt

Merge latest development-branch

1434. By Daniel van Vugt

Merge latest development-branch

1435. By Daniel van Vugt

Merge latest development-branch and resolve a conflict.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

Alans proposal is more convincing than just renaming.

But I am not yet sure about scene vs server vs something better:

object_of_bespoke_interface->add(session_ptr)
    // is add now supposed to decide whether the sessions surface should be visible, maybe focused or stay invisible?

Then both Scene and Shell seem to be legitimate names

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The common problem is the "frontend" component. While it exists, at least in that vague guise, it will continue to cause confusion around the purposes of the things within it.

As far as I understand "frontend" means the protocol server "end". And by that understanding there should probably be no "Shell" or "Scene" within that. Maybe my understanding is amiss somewhere?

Revision history for this message
Chris Halse Rogers (raof) wrote :

Given that we're all agreed that this class needs to be refactored, I don't think there's much benefit in churning the name, but I don't strongly object either.

review: Abstain
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Carr (robertcarr) wrote :

Andreas wrote:
>> Alans proposal is more convincing than just renaming.
>> But I am not yet sure about scene vs server vs something better:
>> object_of_bespoke_interface->add(session_ptr)
>> // is add now supposed to decide whether the sessions surface should be visible, maybe focused or stay >> invisible?
>> Then both Scene and Shell seem to be legitimate names

I agree. Going on, it's possible to think of the Shell as interpreting requests from the frontend to the Scene...which isnt a total lie with the current object. Sure, the implementation object is not convincingly a shell...but that's not so important, it's the interface which exposes the shell services to the frontend. I'm not so upset with Shell.

I think scene is a little overly general in this case.

Given some refactoring in SessionMediator and SessionManager we could imagine this interface as a sort of "mf::ProtocolInterpreter"

Daniel wrote:
>> The common problem is the "frontend" component. While it exists, at least in that vague guise, it will
>> continue to cause confusion around the purposes of the things within it.

>> As far as I understand "frontend" means the protocol server "end". And by that understanding there should >> probably be no "Shell" or "Scene" within that. Maybe my understanding is amiss somewhere?

Sure there should be no Shell or Scene implementation there, but it may need an interface by which to interact with the Shell or Scene. We declare interfaces in the namespace they are used to improve radial encapsulation.

Chris Wrote:
>> Given that we're all agreed that this class needs to be refactored, I don't think there's much benefit in >> churning the name, but I don't strongly object either.

+1!

Revision history for this message
Robert Carr (robertcarr) :
review: Abstain
lp:~vanvugt/mir/frontend-server updated
1436. By Daniel van Vugt

Merge latest development-branch

1437. By Daniel van Vugt

Merge latest development-branch

1438. By Daniel van Vugt

Merge latest development-branch

1439. By Daniel van Vugt

Merge latest development-branch

1440. By Daniel van Vugt

Merge latest development-branch

1441. By Daniel van Vugt

Merge latest development-branch

1442. By Daniel van Vugt

Merge latest development-branch

1443. By Daniel van Vugt

Merge latest development-branch and fix conflicts

1444. By Daniel van Vugt

Fix more (soft) conflicts from recent changes

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

There were actually several revisions last week too, but the history from my home machine clobbered them. Still, same end result...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Carr (robertcarr) wrote :

The new name isnt growing on me, dont think we need to churn it right now.

review: Disapprove
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I give up. Clearly the current architecture does not lend itself to being able to easily choose accurate class names. We need to work on both problems at once.

Unmerged revisions

1444. By Daniel van Vugt

Fix more (soft) conflicts from recent changes

1443. By Daniel van Vugt

Merge latest development-branch and fix conflicts

1442. By Daniel van Vugt

Merge latest development-branch

1441. By Daniel van Vugt

Merge latest development-branch

1440. By Daniel van Vugt

Merge latest development-branch

1439. By Daniel van Vugt

Merge latest development-branch

1438. By Daniel van Vugt

Merge latest development-branch

1437. By Daniel van Vugt

Merge latest development-branch

1436. By Daniel van Vugt

Merge latest development-branch

1435. By Daniel van Vugt

Merge latest development-branch and resolve a conflict.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/demo-inprocess-surface-client/demo_inprocess_surface_client.cpp'
2--- examples/demo-inprocess-surface-client/demo_inprocess_surface_client.cpp 2014-03-06 06:05:17 +0000
3+++ examples/demo-inprocess-surface-client/demo_inprocess_surface_client.cpp 2014-04-15 04:08:26 +0000
4@@ -49,7 +49,7 @@
5 {
6 client = std::make_shared<me::InprocessEGLClient>(
7 config.the_graphics_platform(),
8- config.the_frontend_shell(),
9+ config.the_frontend_server(),
10 config.the_focus_controller());
11 });
12 ///\internal [main_tag]
13
14=== modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.cpp'
15--- examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2014-04-08 09:06:37 +0000
16+++ examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2014-04-15 04:08:26 +0000
17@@ -25,7 +25,7 @@
18 #include "mir/scene/surface_creation_parameters.h"
19 #include "mir/scene/session.h"
20 #include "mir/frontend/session.h"
21-#include "mir/frontend/shell.h"
22+#include "mir/frontend/server.h"
23 #include "mir/geometry/size.h"
24 #include "mir/graphics/buffer_properties.h"
25 #include "mir/graphics/platform.h"
26@@ -58,10 +58,10 @@
27
28 me::InprocessEGLClient::InprocessEGLClient(
29 std::shared_ptr<mg::Platform> const& graphics_platform,
30- std::shared_ptr<frontend::Shell> const& shell,
31+ std::shared_ptr<frontend::Server> const& server,
32 std::shared_ptr<shell::FocusController> const& focus_controller)
33 : graphics_platform(graphics_platform),
34- shell(shell),
35+ server(server),
36 focus_controller(focus_controller),
37 client_thread(std::mem_fn(&InprocessEGLClient::thread_loop), this),
38 terminate(false)
39@@ -96,9 +96,9 @@
40 .of_size(surface_size)
41 .of_buffer_usage(mg::BufferUsage::hardware)
42 .of_pixel_format(mir_pixel_format_argb_8888);
43- auto session = shell->open_session(getpid(), "Inprocess client", std::make_shared<NullEventSink>());
44+ auto session = server->open_session(getpid(), "Inprocess client", std::make_shared<NullEventSink>());
45 // TODO: Why do we get an ID? ~racarr
46- auto surface = session->get_surface(shell->create_surface_for(session, params));
47+ auto surface = session->get_surface(server->create_surface_for(session, params));
48
49 auto input_platform = mircv::InputPlatform::create();
50 input_thread = input_platform->create_input_thread(
51
52=== modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.h'
53--- examples/demo-inprocess-surface-client/inprocess_egl_client.h 2014-03-06 06:05:17 +0000
54+++ examples/demo-inprocess-surface-client/inprocess_egl_client.h 2014-04-15 04:08:26 +0000
55@@ -37,7 +37,7 @@
56 }
57 namespace graphics { class Platform; }
58 namespace shell { class FocusController; }
59-namespace frontend { class Shell; }
60+namespace frontend { class Server; }
61
62 namespace examples
63 {
64@@ -48,7 +48,7 @@
65 public:
66 InprocessEGLClient(
67 std::shared_ptr<graphics::Platform> const& graphics_platform,
68- std::shared_ptr<frontend::Shell> const& shell,
69+ std::shared_ptr<frontend::Server> const& server,
70 std::shared_ptr<shell::FocusController> const& focus_controller);
71
72 ~InprocessEGLClient();
73@@ -59,7 +59,7 @@
74
75 private:
76 std::shared_ptr<graphics::Platform> const graphics_platform;
77- std::shared_ptr<frontend::Shell> const shell;
78+ std::shared_ptr<frontend::Server> const server;
79 std::shared_ptr<shell::FocusController> const focus_controller;
80
81 std::thread client_thread;
82
83=== modified file 'include/server/mir/default_server_configuration.h'
84--- include/server/mir/default_server_configuration.h 2014-04-14 11:31:04 +0000
85+++ include/server/mir/default_server_configuration.h 2014-04-15 04:08:26 +0000
86@@ -39,7 +39,7 @@
87 }
88 namespace frontend
89 {
90-class Shell;
91+class Server;
92 class Connector;
93 class ConnectorReport;
94 class ProtobufIpcFactory;
95@@ -180,7 +180,7 @@
96 virtual std::shared_ptr<frontend::SessionMediatorReport> the_session_mediator_report();
97 virtual std::shared_ptr<frontend::MessageProcessorReport> the_message_processor_report();
98 virtual std::shared_ptr<frontend::SessionAuthorizer> the_session_authorizer();
99- virtual std::shared_ptr<frontend::Shell> the_frontend_shell();
100+ virtual std::shared_ptr<frontend::Server> the_frontend_server();
101 virtual std::shared_ptr<frontend::EventSink> the_global_event_sink();
102 virtual std::shared_ptr<frontend::DisplayChanger> the_frontend_display_changer();
103 virtual std::shared_ptr<frontend::Screencast> the_screencast();
104@@ -250,7 +250,7 @@
105 virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory();
106 virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer();
107 virtual std::shared_ptr<frontend::ProtobufIpcFactory> the_ipc_factory(
108- std::shared_ptr<frontend::Shell> const& shell,
109+ std::shared_ptr<frontend::Server> const& server,
110 std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator);
111
112 CachedPtr<frontend::Connector> connector;
113
114=== renamed file 'include/server/mir/frontend/shell.h' => 'include/server/mir/frontend/server.h'
115--- include/server/mir/frontend/shell.h 2014-04-08 09:06:37 +0000
116+++ include/server/mir/frontend/server.h 2014-04-15 04:08:26 +0000
117@@ -16,8 +16,8 @@
118 * Authored by: Thomas Voss <thomas.voss@canonical.com>
119 */
120
121-#ifndef MIR_FRONTEND_SHELL_H_
122-#define MIR_FRONTEND_SHELL_H_
123+#ifndef MIR_FRONTEND_SERVER_H_
124+#define MIR_FRONTEND_SERVER_H_
125
126 #include "mir/frontend/surface_id.h"
127
128@@ -36,10 +36,10 @@
129 class EventSink;
130 class Session;
131
132-class Shell
133+class Server
134 {
135 public:
136- virtual ~Shell() = default;
137+ virtual ~Server() = default;
138
139 virtual std::shared_ptr<Session> open_session(
140 pid_t client_pid,
141@@ -55,12 +55,12 @@
142 virtual void handle_surface_created(std::shared_ptr<Session> const& session) = 0;
143
144 protected:
145- Shell() = default;
146- Shell(const Shell&) = delete;
147- Shell& operator=(const Shell&) = delete;
148+ Server() = default;
149+ Server(const Server&) = delete;
150+ Server& operator=(const Server&) = delete;
151 };
152
153 }
154 }
155
156-#endif // MIR_FRONTEND_SHELL_H_
157+#endif // MIR_FRONTEND_SERVER_H_
158
159=== modified file 'include/server/mir/server_configuration.h'
160--- include/server/mir/server_configuration.h 2013-10-16 07:34:22 +0000
161+++ include/server/mir/server_configuration.h 2014-04-15 04:08:26 +0000
162@@ -29,7 +29,6 @@
163 namespace frontend
164 {
165 class Connector;
166-class Shell;
167 }
168 namespace shell
169 {
170
171=== renamed file 'include/test/mir_test_doubles/mock_shell.h' => 'include/test/mir_test_doubles/mock_server.h'
172--- include/test/mir_test_doubles/mock_shell.h 2014-04-08 09:06:37 +0000
173+++ include/test/mir_test_doubles/mock_server.h 2014-04-15 04:08:26 +0000
174@@ -16,11 +16,11 @@
175 * Authored by: Robert Carr <robert.carr@canonical.com>
176 */
177
178-#ifndef MIR_TEST_DOUBLES_SHELL_H_
179-#define MIR_TEST_DOUBLES_SHELL_H_
180+#ifndef MIR_TEST_DOUBLES_MOCK_SERVER_H_
181+#define MIR_TEST_DOUBLES_MOCK_SERVER_H_
182
183 #include "mir/scene/surface_creation_parameters.h"
184-#include "mir/frontend/shell.h"
185+#include "mir/frontend/server.h"
186 #include "mir/frontend/surface_id.h"
187
188 #include <gmock/gmock.h>
189@@ -32,7 +32,7 @@
190 namespace doubles
191 {
192
193-struct MockShell : public frontend::Shell
194+struct MockServer : public frontend::Server
195 {
196 MOCK_METHOD3(open_session, std::shared_ptr<frontend::Session>(
197 pid_t client_pid,
198@@ -49,4 +49,4 @@
199 }
200 } // namespace mir
201
202-#endif // MIR_TEST_DOUBLES_SHELL_H_
203+#endif // MIR_TEST_DOUBLES_MOCK_SERVER_H_
204
205=== renamed file 'include/test/mir_test_doubles/stub_shell.h' => 'include/test/mir_test_doubles/stub_server.h'
206--- include/test/mir_test_doubles/stub_shell.h 2014-04-08 09:06:37 +0000
207+++ include/test/mir_test_doubles/stub_server.h 2014-04-15 04:08:26 +0000
208@@ -16,10 +16,10 @@
209 * Authored by: Robert Carr <robert.carr@canonical.com>
210 */
211
212-#ifndef MIR_TEST_DOUBLES_STUB_SHELL_H_
213-#define MIR_TEST_DOUBLES_STUB_SHELL_H_
214+#ifndef MIR_TEST_DOUBLES_STUB_SERVER_H_
215+#define MIR_TEST_DOUBLES_STUB_SERVER_H_
216
217-#include "mir/frontend/shell.h"
218+#include "mir/frontend/server.h"
219 #include "mir_test_doubles/stub_session.h"
220
221 namespace mir
222@@ -29,9 +29,9 @@
223 namespace doubles
224 {
225
226-struct StubShell : public frontend::Shell
227+struct StubServer : public frontend::Server
228 {
229- StubShell() : stub_session(std::make_shared<StubSession>())
230+ StubServer() : stub_session(std::make_shared<StubSession>())
231 {
232 }
233 std::shared_ptr<frontend::Session> open_session(pid_t, std::string const& /* name */, std::shared_ptr<frontend::EventSink> const& /* sink */) override
234@@ -56,4 +56,4 @@
235 }
236 } // namespace mir
237
238-#endif // MIR_TEST_DOUBLES_STUB_SHELL_H_
239+#endif // MIR_TEST_DOUBLES_STUB_SERVER_H_
240
241=== modified file 'src/server/frontend/default_configuration.cpp'
242--- src/server/frontend/default_configuration.cpp 2014-03-26 05:48:59 +0000
243+++ src/server/frontend/default_configuration.cpp 2014-04-15 04:08:26 +0000
244@@ -41,14 +41,14 @@
245 {
246 public:
247 explicit DefaultIpcFactory(
248- std::shared_ptr<mf::Shell> const& shell,
249+ std::shared_ptr<mf::Server> const& server,
250 std::shared_ptr<mf::SessionMediatorReport> const& sm_report,
251 std::shared_ptr<mg::Platform> const& graphics_platform,
252 std::shared_ptr<mf::DisplayChanger> const& display_changer,
253 std::shared_ptr<mg::GraphicBufferAllocator> const& buffer_allocator,
254 std::shared_ptr<mf::Screencast> const& screencast,
255 std::shared_ptr<mf::SessionAuthorizer> const& session_authorizer) :
256- shell(shell),
257+ server(server),
258 sm_report(sm_report),
259 cache(std::make_shared<mf::ResourceCache>()),
260 graphics_platform(graphics_platform),
261@@ -60,7 +60,7 @@
262 }
263
264 private:
265- std::shared_ptr<mf::Shell> shell;
266+ std::shared_ptr<mf::Server> server;
267 std::shared_ptr<mf::SessionMediatorReport> const sm_report;
268 std::shared_ptr<mf::ResourceCache> const cache;
269 std::shared_ptr<mg::Platform> const graphics_platform;
270@@ -96,7 +96,7 @@
271
272 return std::make_shared<mf::SessionMediator>(
273 client_pid,
274- shell,
275+ server,
276 graphics_platform,
277 changer,
278 buffer_allocator->supported_pixel_formats(),
279@@ -119,7 +119,7 @@
280 return session_creator([this]
281 {
282 return std::make_shared<mf::ProtobufSessionCreator>(
283- the_ipc_factory(the_frontend_shell(), the_buffer_allocator()),
284+ the_ipc_factory(the_frontend_server(), the_buffer_allocator()),
285 the_session_authorizer(),
286 the_message_processor_report());
287 });
288@@ -153,14 +153,14 @@
289
290 std::shared_ptr<mir::frontend::ProtobufIpcFactory>
291 mir::DefaultServerConfiguration::the_ipc_factory(
292- std::shared_ptr<mf::Shell> const& shell,
293+ std::shared_ptr<mf::Server> const& server,
294 std::shared_ptr<mg::GraphicBufferAllocator> const& allocator)
295 {
296 return ipc_factory(
297 [&]()
298 {
299 return std::make_shared<DefaultIpcFactory>(
300- shell,
301+ server,
302 the_session_mediator_report(),
303 the_graphics_platform(),
304 the_frontend_display_changer(),
305
306=== modified file 'src/server/frontend/session_mediator.cpp'
307--- src/server/frontend/session_mediator.cpp 2014-04-08 09:06:37 +0000
308+++ src/server/frontend/session_mediator.cpp 2014-04-15 04:08:26 +0000
309@@ -20,7 +20,7 @@
310 #include "client_buffer_tracker.h"
311
312 #include "mir/frontend/session_mediator_report.h"
313-#include "mir/frontend/shell.h"
314+#include "mir/frontend/server.h"
315 #include "mir/frontend/session.h"
316 #include "mir/frontend/surface.h"
317 #include "mir/scene/surface_creation_parameters.h"
318@@ -60,7 +60,7 @@
319
320 mf::SessionMediator::SessionMediator(
321 pid_t client_pid,
322- std::shared_ptr<frontend::Shell> const& shell,
323+ std::shared_ptr<frontend::Server> const& server,
324 std::shared_ptr<graphics::Platform> const & graphics_platform,
325 std::shared_ptr<mf::DisplayChanger> const& display_changer,
326 std::vector<MirPixelFormat> const& surface_pixel_formats,
327@@ -69,7 +69,7 @@
328 std::shared_ptr<ResourceCache> const& resource_cache,
329 std::shared_ptr<Screencast> const& screencast) :
330 client_pid(client_pid),
331- shell(shell),
332+ server(server),
333 graphics_platform(graphics_platform),
334 surface_pixel_formats(surface_pixel_formats),
335 display_changer(display_changer),
336@@ -85,7 +85,7 @@
337 if (auto session = weak_session.lock())
338 {
339 report->session_error(session->name(), __PRETTY_FUNCTION__, "connection dropped without disconnect");
340- shell->close_session(session);
341+ server->close_session(session);
342 }
343 }
344
345@@ -99,7 +99,7 @@
346
347 {
348 std::unique_lock<std::mutex> lock(session_mutex);
349- weak_session = shell->open_session(client_pid, request->application_name(), event_sink);
350+ weak_session = server->open_session(client_pid, request->application_name(), event_sink);
351 }
352
353 auto ipc_package = graphics_platform->get_ipc_package();
354@@ -191,7 +191,7 @@
355 // To achieve this order we rely on done->Run() sending messages synchronously. As documented in mfd::SocketMessenger::send.
356 // this will require additional synchronization if mfd::SocketMessenger::send changes.
357 done->Run();
358- shell->handle_surface_created(session);
359+ server->handle_surface_created(session);
360 });
361 }
362
363@@ -267,7 +267,7 @@
364
365 report->session_disconnect_called(session->name());
366
367- shell->close_session(session);
368+ server->close_session(session);
369 weak_session.reset();
370 }
371
372
373=== modified file 'src/server/frontend/session_mediator.h'
374--- src/server/frontend/session_mediator.h 2014-03-06 06:05:17 +0000
375+++ src/server/frontend/session_mediator.h 2014-04-15 04:08:26 +0000
376@@ -46,7 +46,7 @@
377 namespace frontend
378 {
379 class ClientBufferTracker;
380-class Shell;
381+class Server;
382 class Session;
383 class Surface;
384 class ResourceCache;
385@@ -61,7 +61,7 @@
386 public:
387 SessionMediator(
388 pid_t client_pid,
389- std::shared_ptr<Shell> const& shell,
390+ std::shared_ptr<Server> const& server,
391 std::shared_ptr<graphics::Platform> const& graphics_platform,
392 std::shared_ptr<frontend::DisplayChanger> const& display_changer,
393 std::vector<MirPixelFormat> const& surface_pixel_formats,
394@@ -137,7 +137,7 @@
395
396 void advance_buffer(SurfaceId surf_id, Surface& surface, std::function<void(graphics::Buffer*, bool)> complete);
397 pid_t client_pid;
398- std::shared_ptr<Shell> const shell;
399+ std::shared_ptr<Server> const server;
400 std::shared_ptr<graphics::Platform> const graphics_platform;
401
402 std::vector<MirPixelFormat> const surface_pixel_formats;
403
404=== modified file 'src/server/scene/default_configuration.cpp'
405--- src/server/scene/default_configuration.cpp 2014-04-14 11:31:04 +0000
406+++ src/server/scene/default_configuration.cpp 2014-04-15 04:08:26 +0000
407@@ -187,8 +187,8 @@
408 });
409 }
410
411-std::shared_ptr<mf::Shell>
412-mir::DefaultServerConfiguration::the_frontend_shell()
413+std::shared_ptr<mf::Server>
414+mir::DefaultServerConfiguration::the_frontend_server()
415 {
416 return the_session_manager();
417 }
418
419=== modified file 'src/server/scene/session_manager.h'
420--- src/server/scene/session_manager.h 2014-04-08 09:06:37 +0000
421+++ src/server/scene/session_manager.h 2014-04-15 04:08:26 +0000
422@@ -20,7 +20,7 @@
423 #define MIR_SCENE_APPLICATION_MANAGER_H_
424
425 #include "mir/frontend/surface_id.h"
426-#include "mir/frontend/shell.h"
427+#include "mir/frontend/server.h"
428 #include "mir/shell/focus_controller.h"
429
430 #include <mutex>
431@@ -43,7 +43,7 @@
432 class SnapshotStrategy;
433 class SurfaceCoordinator;
434
435-class SessionManager : public frontend::Shell, public shell::FocusController
436+class SessionManager : public frontend::Server, public shell::FocusController
437 {
438 public:
439 explicit SessionManager(std::shared_ptr<SurfaceCoordinator> const& surface_coordinator,
440
441=== modified file 'tests/acceptance-tests/test_protobuf.cpp'
442--- tests/acceptance-tests/test_protobuf.cpp 2014-03-26 05:48:59 +0000
443+++ tests/acceptance-tests/test_protobuf.cpp 2014-04-15 04:08:26 +0000
444@@ -141,7 +141,7 @@
445 return session_creator([this]
446 {
447 return std::make_shared<DemoSessionCreator>(
448- the_ipc_factory(the_frontend_shell(), the_buffer_allocator()),
449+ the_ipc_factory(the_frontend_server(), the_buffer_allocator()),
450 the_session_authorizer(),
451 the_message_processor_report());
452 });
453
454=== modified file 'tests/integration-tests/session_management.cpp'
455--- tests/integration-tests/session_management.cpp 2014-04-08 17:21:28 +0000
456+++ tests/integration-tests/session_management.cpp 2014-04-15 04:08:26 +0000
457@@ -17,7 +17,7 @@
458 */
459
460 #include "mir/frontend/session.h"
461-#include "mir/frontend/shell.h"
462+#include "mir/frontend/server.h"
463 #include "mir/input/input_configuration.h"
464
465 #include "mir/scene/surface_creation_parameters.h"
466@@ -100,7 +100,7 @@
467 {
468 TestConfiguration builder;
469 std::shared_ptr<mf::EventSink> const event_sink = std::make_shared<mtd::NullEventSink>();
470- std::shared_ptr<mf::Shell> const session_manager = builder.the_frontend_shell();
471+ std::shared_ptr<mf::Server> const session_manager = builder.the_frontend_server();
472 std::shared_ptr<TestSurfaceStack> const& test_surface_stack = builder.test_surface_stack;
473
474 void SetUp()
475
476=== modified file 'tests/integration-tests/test_error_reporting.cpp'
477--- tests/integration-tests/test_error_reporting.cpp 2014-03-06 06:05:17 +0000
478+++ tests/integration-tests/test_error_reporting.cpp 2014-04-15 04:08:26 +0000
479@@ -206,7 +206,7 @@
480 struct ServerConfig : TestingServerConfiguration
481 {
482 std::shared_ptr<mf::ProtobufIpcFactory> the_ipc_factory(
483- std::shared_ptr<mir::frontend::Shell> const&,
484+ std::shared_ptr<mir::frontend::Server> const&,
485 std::shared_ptr<mg::GraphicBufferAllocator> const&) override
486 {
487 static auto error_server = std::make_shared<ErrorServer>();
488
489=== modified file 'tests/mir_test_framework/input_testing_server_options.cpp'
490--- tests/mir_test_framework/input_testing_server_options.cpp 2014-04-08 09:06:37 +0000
491+++ tests/mir_test_framework/input_testing_server_options.cpp 2014-04-15 04:08:26 +0000
492@@ -22,7 +22,6 @@
493 #include "mir/scene/input_registrar.h"
494 #include "mir/input/surface.h"
495 #include "mir/scene/surface_creation_parameters.h"
496-#include "mir/frontend/shell.h"
497 #include "mir/frontend/session.h"
498 #include "mir/input/composite_event_filter.h"
499
500
501=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
502--- tests/unit-tests/frontend/test_session_mediator.cpp 2014-04-08 09:06:37 +0000
503+++ tests/unit-tests/frontend/test_session_mediator.cpp 2014-04-15 04:08:26 +0000
504@@ -32,7 +32,7 @@
505 #include "mir_test_doubles/null_event_sink.h"
506 #include "mir_test_doubles/null_display_changer.h"
507 #include "mir_test_doubles/mock_display.h"
508-#include "mir_test_doubles/mock_shell.h"
509+#include "mir_test_doubles/mock_server.h"
510 #include "mir_test_doubles/mock_frontend_surface.h"
511 #include "mir_test_doubles/mock_buffer.h"
512 #include "mir_test_doubles/stub_session.h"
513@@ -198,14 +198,14 @@
514 struct SessionMediatorTest : public ::testing::Test
515 {
516 SessionMediatorTest()
517- : shell{std::make_shared<testing::NiceMock<mtd::MockShell>>()},
518+ : server{std::make_shared<testing::NiceMock<mtd::MockServer>>()},
519 graphics_platform{std::make_shared<testing::NiceMock<MockPlatform>>()},
520 graphics_changer{std::make_shared<mtd::NullDisplayChanger>()},
521 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
522 report{mr::null_session_mediator_report()},
523 resource_cache{std::make_shared<mf::ResourceCache>()},
524 stub_screencast{std::make_shared<StubScreencast>()},
525- mediator{__LINE__, shell, graphics_platform, graphics_changer,
526+ mediator{__LINE__, server, graphics_platform, graphics_changer,
527 surface_pixel_formats, report,
528 std::make_shared<mtd::NullEventSink>(),
529 resource_cache, stub_screencast},
530@@ -214,12 +214,12 @@
531 {
532 using namespace ::testing;
533
534- ON_CALL(*shell, open_session(_, _, _)).WillByDefault(Return(stubbed_session));
535- ON_CALL(*shell, create_surface_for(_, _))
536+ ON_CALL(*server, open_session(_, _, _)).WillByDefault(Return(stubbed_session));
537+ ON_CALL(*server, create_surface_for(_, _))
538 .WillByDefault(WithArg<1>(Invoke(stubbed_session.get(), &StubbedSession::create_surface)));
539 }
540
541- std::shared_ptr<testing::NiceMock<mtd::MockShell>> const shell;
542+ std::shared_ptr<testing::NiceMock<mtd::MockServer>> const server;
543 std::shared_ptr<MockPlatform> const graphics_platform;
544 std::shared_ptr<mf::DisplayChanger> const graphics_changer;
545 std::vector<MirPixelFormat> const surface_pixel_formats;
546@@ -240,7 +240,7 @@
547 mp::ConnectParameters connect_parameters;
548 mp::Connection connection;
549
550- EXPECT_CALL(*shell, close_session(_)).Times(1);
551+ EXPECT_CALL(*server, close_session(_)).Times(1);
552
553 mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get());
554 mediator.disconnect(nullptr, nullptr, nullptr, null_callback.get());
555@@ -369,7 +369,7 @@
556 .Times(1)
557 .WillOnce(Return(mt::fake_shared(config)));
558 mf::SessionMediator mediator(
559- __LINE__, shell, graphics_platform, mock_display,
560+ __LINE__, server, graphics_platform, mock_display,
561 surface_pixel_formats, report,
562 std::make_shared<mtd::NullEventSink>(),
563 resource_cache, std::make_shared<mtd::NullScreencast>());
564@@ -593,7 +593,7 @@
565 .WillOnce(Return(mt::fake_shared(stub_display_config)));
566
567 mf::SessionMediator session_mediator{
568- __LINE__, shell, graphics_platform, mock_display_selector,
569+ __LINE__, server, graphics_platform, mock_display_selector,
570 surface_pixel_formats, report,
571 std::make_shared<mtd::NullEventSink>(), resource_cache,
572 std::make_shared<mtd::NullScreencast>()};
573
574=== modified file 'tests/unit-tests/frontend/test_session_mediator_android.cpp'
575--- tests/unit-tests/frontend/test_session_mediator_android.cpp 2014-04-08 12:26:40 +0000
576+++ tests/unit-tests/frontend/test_session_mediator_android.cpp 2014-04-15 04:08:26 +0000
577@@ -21,7 +21,7 @@
578 #include "src/server/frontend/resource_cache.h"
579 #include "src/server/scene/application_session.h"
580 #include "src/server/report/null_report_factory.h"
581-#include "mir/frontend/shell.h"
582+#include "mir/frontend/server.h"
583 #include "mir/scene/surface_creation_parameters.h"
584 #include "mir/graphics/display.h"
585 #include "mir/graphics/platform.h"
586@@ -29,7 +29,7 @@
587
588 #include "mir_test_doubles/null_display_changer.h"
589 #include "mir_test_doubles/mock_session.h"
590-#include "mir_test_doubles/stub_shell.h"
591+#include "mir_test_doubles/stub_server.h"
592 #include "mir_test_doubles/null_platform.h"
593 #include "mir_test_doubles/null_event_sink.h"
594 #include "mir_test_doubles/stub_buffer_allocator.h"
595@@ -52,13 +52,13 @@
596 struct SessionMediatorAndroidTest : public ::testing::Test
597 {
598 SessionMediatorAndroidTest()
599- : shell{std::make_shared<mtd::StubShell>()},
600+ : server{std::make_shared<mtd::StubServer>()},
601 graphics_platform{std::make_shared<mtd::NullPlatform>()},
602 display_changer{std::make_shared<mtd::NullDisplayChanger>()},
603 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
604 report{mr::null_session_mediator_report()},
605 resource_cache{std::make_shared<mf::ResourceCache>()},
606- mediator{__LINE__, shell, graphics_platform, display_changer,
607+ mediator{__LINE__, server, graphics_platform, display_changer,
608 surface_pixel_formats, report,
609 std::make_shared<mtd::NullEventSink>(),
610 resource_cache, std::make_shared<mtd::NullScreencast>()},
611@@ -66,7 +66,7 @@
612 {
613 }
614
615- std::shared_ptr<mtd::StubShell> const shell;
616+ std::shared_ptr<mtd::StubServer> const server;
617 std::shared_ptr<mtd::NullPlatform> const graphics_platform;
618 std::shared_ptr<mf::DisplayChanger> const display_changer;
619 std::vector<MirPixelFormat> const surface_pixel_formats;
620
621=== modified file 'tests/unit-tests/frontend/test_session_mediator_mesa.cpp'
622--- tests/unit-tests/frontend/test_session_mediator_mesa.cpp 2014-04-08 12:26:40 +0000
623+++ tests/unit-tests/frontend/test_session_mediator_mesa.cpp 2014-04-15 04:08:26 +0000
624@@ -22,7 +22,7 @@
625 #include "src/server/scene/application_session.h"
626 #include "src/server/frontend/session_mediator.h"
627 #include "src/server/report/null_report_factory.h"
628-#include "mir/frontend/shell.h"
629+#include "mir/frontend/server.h"
630 #include "mir/graphics/display.h"
631 #include "mir/graphics/drm_authenticator.h"
632 #include "mir/frontend/event_sink.h"
633@@ -35,7 +35,7 @@
634 #include "mir_test_doubles/null_display_changer.h"
635 #include "mir_test_doubles/null_platform.h"
636 #include "mir_test_doubles/mock_session.h"
637-#include "mir_test_doubles/stub_shell.h"
638+#include "mir_test_doubles/stub_server.h"
639 #include "mir_test_doubles/null_screencast.h"
640
641 #include <gtest/gtest.h>
642@@ -66,13 +66,13 @@
643 struct SessionMediatorMesaTest : public ::testing::Test
644 {
645 SessionMediatorMesaTest()
646- : shell{std::make_shared<mtd::StubShell>()},
647+ : server{std::make_shared<mtd::StubServer>()},
648 mock_platform{std::make_shared<MockAuthenticatingPlatform>()},
649 display_changer{std::make_shared<mtd::NullDisplayChanger>()},
650 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
651 report{mr::null_session_mediator_report()},
652 resource_cache{std::make_shared<mf::ResourceCache>()},
653- mediator{__LINE__, shell, mock_platform, display_changer,
654+ mediator{__LINE__, server, mock_platform, display_changer,
655 surface_pixel_formats, report,
656 std::make_shared<mtd::NullEventSink>(),
657 resource_cache, std::make_shared<mtd::NullScreencast>()},
658@@ -80,7 +80,7 @@
659 {
660 }
661
662- std::shared_ptr<mtd::StubShell> const shell;
663+ std::shared_ptr<mtd::StubServer> const server;
664 std::shared_ptr<MockAuthenticatingPlatform> const mock_platform;
665 std::shared_ptr<mf::DisplayChanger> const display_changer;
666 std::vector<MirPixelFormat> const surface_pixel_formats;

Subscribers

People subscribed via source and target branches