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
=== modified file 'examples/demo-inprocess-surface-client/demo_inprocess_surface_client.cpp'
--- examples/demo-inprocess-surface-client/demo_inprocess_surface_client.cpp 2014-03-06 06:05:17 +0000
+++ examples/demo-inprocess-surface-client/demo_inprocess_surface_client.cpp 2014-04-15 04:08:26 +0000
@@ -49,7 +49,7 @@
49 {49 {
50 client = std::make_shared<me::InprocessEGLClient>(50 client = std::make_shared<me::InprocessEGLClient>(
51 config.the_graphics_platform(),51 config.the_graphics_platform(),
52 config.the_frontend_shell(),52 config.the_frontend_server(),
53 config.the_focus_controller());53 config.the_focus_controller());
54 });54 });
55 ///\internal [main_tag]55 ///\internal [main_tag]
5656
=== modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.cpp'
--- examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2014-04-08 09:06:37 +0000
+++ examples/demo-inprocess-surface-client/inprocess_egl_client.cpp 2014-04-15 04:08:26 +0000
@@ -25,7 +25,7 @@
25#include "mir/scene/surface_creation_parameters.h"25#include "mir/scene/surface_creation_parameters.h"
26#include "mir/scene/session.h"26#include "mir/scene/session.h"
27#include "mir/frontend/session.h"27#include "mir/frontend/session.h"
28#include "mir/frontend/shell.h"28#include "mir/frontend/server.h"
29#include "mir/geometry/size.h"29#include "mir/geometry/size.h"
30#include "mir/graphics/buffer_properties.h"30#include "mir/graphics/buffer_properties.h"
31#include "mir/graphics/platform.h"31#include "mir/graphics/platform.h"
@@ -58,10 +58,10 @@
5858
59me::InprocessEGLClient::InprocessEGLClient(59me::InprocessEGLClient::InprocessEGLClient(
60 std::shared_ptr<mg::Platform> const& graphics_platform,60 std::shared_ptr<mg::Platform> const& graphics_platform,
61 std::shared_ptr<frontend::Shell> const& shell,61 std::shared_ptr<frontend::Server> const& server,
62 std::shared_ptr<shell::FocusController> const& focus_controller)62 std::shared_ptr<shell::FocusController> const& focus_controller)
63 : graphics_platform(graphics_platform),63 : graphics_platform(graphics_platform),
64 shell(shell),64 server(server),
65 focus_controller(focus_controller),65 focus_controller(focus_controller),
66 client_thread(std::mem_fn(&InprocessEGLClient::thread_loop), this),66 client_thread(std::mem_fn(&InprocessEGLClient::thread_loop), this),
67 terminate(false)67 terminate(false)
@@ -96,9 +96,9 @@
96 .of_size(surface_size)96 .of_size(surface_size)
97 .of_buffer_usage(mg::BufferUsage::hardware)97 .of_buffer_usage(mg::BufferUsage::hardware)
98 .of_pixel_format(mir_pixel_format_argb_8888);98 .of_pixel_format(mir_pixel_format_argb_8888);
99 auto session = shell->open_session(getpid(), "Inprocess client", std::make_shared<NullEventSink>());99 auto session = server->open_session(getpid(), "Inprocess client", std::make_shared<NullEventSink>());
100 // TODO: Why do we get an ID? ~racarr100 // TODO: Why do we get an ID? ~racarr
101 auto surface = session->get_surface(shell->create_surface_for(session, params));101 auto surface = session->get_surface(server->create_surface_for(session, params));
102102
103 auto input_platform = mircv::InputPlatform::create();103 auto input_platform = mircv::InputPlatform::create();
104 input_thread = input_platform->create_input_thread(104 input_thread = input_platform->create_input_thread(
105105
=== modified file 'examples/demo-inprocess-surface-client/inprocess_egl_client.h'
--- examples/demo-inprocess-surface-client/inprocess_egl_client.h 2014-03-06 06:05:17 +0000
+++ examples/demo-inprocess-surface-client/inprocess_egl_client.h 2014-04-15 04:08:26 +0000
@@ -37,7 +37,7 @@
37}37}
38namespace graphics { class Platform; }38namespace graphics { class Platform; }
39namespace shell { class FocusController; }39namespace shell { class FocusController; }
40namespace frontend { class Shell; }40namespace frontend { class Server; }
4141
42namespace examples42namespace examples
43{43{
@@ -48,7 +48,7 @@
48public:48public:
49 InprocessEGLClient(49 InprocessEGLClient(
50 std::shared_ptr<graphics::Platform> const& graphics_platform,50 std::shared_ptr<graphics::Platform> const& graphics_platform,
51 std::shared_ptr<frontend::Shell> const& shell,51 std::shared_ptr<frontend::Server> const& server,
52 std::shared_ptr<shell::FocusController> const& focus_controller);52 std::shared_ptr<shell::FocusController> const& focus_controller);
5353
54 ~InprocessEGLClient();54 ~InprocessEGLClient();
@@ -59,7 +59,7 @@
5959
60private:60private:
61 std::shared_ptr<graphics::Platform> const graphics_platform;61 std::shared_ptr<graphics::Platform> const graphics_platform;
62 std::shared_ptr<frontend::Shell> const shell;62 std::shared_ptr<frontend::Server> const server;
63 std::shared_ptr<shell::FocusController> const focus_controller;63 std::shared_ptr<shell::FocusController> const focus_controller;
6464
65 std::thread client_thread;65 std::thread client_thread;
6666
=== modified file 'include/server/mir/default_server_configuration.h'
--- include/server/mir/default_server_configuration.h 2014-04-14 11:31:04 +0000
+++ include/server/mir/default_server_configuration.h 2014-04-15 04:08:26 +0000
@@ -39,7 +39,7 @@
39}39}
40namespace frontend40namespace frontend
41{41{
42class Shell;42class Server;
43class Connector;43class Connector;
44class ConnectorReport;44class ConnectorReport;
45class ProtobufIpcFactory;45class ProtobufIpcFactory;
@@ -180,7 +180,7 @@
180 virtual std::shared_ptr<frontend::SessionMediatorReport> the_session_mediator_report();180 virtual std::shared_ptr<frontend::SessionMediatorReport> the_session_mediator_report();
181 virtual std::shared_ptr<frontend::MessageProcessorReport> the_message_processor_report();181 virtual std::shared_ptr<frontend::MessageProcessorReport> the_message_processor_report();
182 virtual std::shared_ptr<frontend::SessionAuthorizer> the_session_authorizer();182 virtual std::shared_ptr<frontend::SessionAuthorizer> the_session_authorizer();
183 virtual std::shared_ptr<frontend::Shell> the_frontend_shell();183 virtual std::shared_ptr<frontend::Server> the_frontend_server();
184 virtual std::shared_ptr<frontend::EventSink> the_global_event_sink();184 virtual std::shared_ptr<frontend::EventSink> the_global_event_sink();
185 virtual std::shared_ptr<frontend::DisplayChanger> the_frontend_display_changer();185 virtual std::shared_ptr<frontend::DisplayChanger> the_frontend_display_changer();
186 virtual std::shared_ptr<frontend::Screencast> the_screencast();186 virtual std::shared_ptr<frontend::Screencast> the_screencast();
@@ -250,7 +250,7 @@
250 virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory();250 virtual std::shared_ptr<input::InputChannelFactory> the_input_channel_factory();
251 virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer();251 virtual std::shared_ptr<scene::MediatingDisplayChanger> the_mediating_display_changer();
252 virtual std::shared_ptr<frontend::ProtobufIpcFactory> the_ipc_factory(252 virtual std::shared_ptr<frontend::ProtobufIpcFactory> the_ipc_factory(
253 std::shared_ptr<frontend::Shell> const& shell,253 std::shared_ptr<frontend::Server> const& server,
254 std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator);254 std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator);
255255
256 CachedPtr<frontend::Connector> connector;256 CachedPtr<frontend::Connector> connector;
257257
=== renamed file 'include/server/mir/frontend/shell.h' => 'include/server/mir/frontend/server.h'
--- include/server/mir/frontend/shell.h 2014-04-08 09:06:37 +0000
+++ include/server/mir/frontend/server.h 2014-04-15 04:08:26 +0000
@@ -16,8 +16,8 @@
16 * Authored by: Thomas Voss <thomas.voss@canonical.com>16 * Authored by: Thomas Voss <thomas.voss@canonical.com>
17 */17 */
1818
19#ifndef MIR_FRONTEND_SHELL_H_19#ifndef MIR_FRONTEND_SERVER_H_
20#define MIR_FRONTEND_SHELL_H_20#define MIR_FRONTEND_SERVER_H_
2121
22#include "mir/frontend/surface_id.h"22#include "mir/frontend/surface_id.h"
2323
@@ -36,10 +36,10 @@
36class EventSink;36class EventSink;
37class Session;37class Session;
3838
39class Shell39class Server
40{40{
41public:41public:
42 virtual ~Shell() = default;42 virtual ~Server() = default;
4343
44 virtual std::shared_ptr<Session> open_session(44 virtual std::shared_ptr<Session> open_session(
45 pid_t client_pid,45 pid_t client_pid,
@@ -55,12 +55,12 @@
55 virtual void handle_surface_created(std::shared_ptr<Session> const& session) = 0;55 virtual void handle_surface_created(std::shared_ptr<Session> const& session) = 0;
5656
57protected:57protected:
58 Shell() = default;58 Server() = default;
59 Shell(const Shell&) = delete;59 Server(const Server&) = delete;
60 Shell& operator=(const Shell&) = delete;60 Server& operator=(const Server&) = delete;
61};61};
6262
63}63}
64}64}
6565
66#endif // MIR_FRONTEND_SHELL_H_66#endif // MIR_FRONTEND_SERVER_H_
6767
=== modified file 'include/server/mir/server_configuration.h'
--- include/server/mir/server_configuration.h 2013-10-16 07:34:22 +0000
+++ include/server/mir/server_configuration.h 2014-04-15 04:08:26 +0000
@@ -29,7 +29,6 @@
29namespace frontend29namespace frontend
30{30{
31class Connector;31class Connector;
32class Shell;
33}32}
34namespace shell33namespace shell
35{34{
3635
=== renamed file 'include/test/mir_test_doubles/mock_shell.h' => 'include/test/mir_test_doubles/mock_server.h'
--- include/test/mir_test_doubles/mock_shell.h 2014-04-08 09:06:37 +0000
+++ include/test/mir_test_doubles/mock_server.h 2014-04-15 04:08:26 +0000
@@ -16,11 +16,11 @@
16 * Authored by: Robert Carr <robert.carr@canonical.com>16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#ifndef MIR_TEST_DOUBLES_SHELL_H_19#ifndef MIR_TEST_DOUBLES_MOCK_SERVER_H_
20#define MIR_TEST_DOUBLES_SHELL_H_20#define MIR_TEST_DOUBLES_MOCK_SERVER_H_
2121
22#include "mir/scene/surface_creation_parameters.h"22#include "mir/scene/surface_creation_parameters.h"
23#include "mir/frontend/shell.h"23#include "mir/frontend/server.h"
24#include "mir/frontend/surface_id.h"24#include "mir/frontend/surface_id.h"
2525
26#include <gmock/gmock.h>26#include <gmock/gmock.h>
@@ -32,7 +32,7 @@
32namespace doubles32namespace doubles
33{33{
3434
35struct MockShell : public frontend::Shell35struct MockServer : public frontend::Server
36{36{
37 MOCK_METHOD3(open_session, std::shared_ptr<frontend::Session>(37 MOCK_METHOD3(open_session, std::shared_ptr<frontend::Session>(
38 pid_t client_pid,38 pid_t client_pid,
@@ -49,4 +49,4 @@
49}49}
50} // namespace mir50} // namespace mir
5151
52#endif // MIR_TEST_DOUBLES_SHELL_H_52#endif // MIR_TEST_DOUBLES_MOCK_SERVER_H_
5353
=== renamed file 'include/test/mir_test_doubles/stub_shell.h' => 'include/test/mir_test_doubles/stub_server.h'
--- include/test/mir_test_doubles/stub_shell.h 2014-04-08 09:06:37 +0000
+++ include/test/mir_test_doubles/stub_server.h 2014-04-15 04:08:26 +0000
@@ -16,10 +16,10 @@
16 * Authored by: Robert Carr <robert.carr@canonical.com>16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#ifndef MIR_TEST_DOUBLES_STUB_SHELL_H_19#ifndef MIR_TEST_DOUBLES_STUB_SERVER_H_
20#define MIR_TEST_DOUBLES_STUB_SHELL_H_20#define MIR_TEST_DOUBLES_STUB_SERVER_H_
2121
22#include "mir/frontend/shell.h"22#include "mir/frontend/server.h"
23#include "mir_test_doubles/stub_session.h"23#include "mir_test_doubles/stub_session.h"
2424
25namespace mir25namespace mir
@@ -29,9 +29,9 @@
29namespace doubles29namespace doubles
30{30{
3131
32struct StubShell : public frontend::Shell32struct StubServer : public frontend::Server
33{33{
34 StubShell() : stub_session(std::make_shared<StubSession>())34 StubServer() : stub_session(std::make_shared<StubSession>())
35 {35 {
36 }36 }
37 std::shared_ptr<frontend::Session> open_session(pid_t, std::string const& /* name */, std::shared_ptr<frontend::EventSink> const& /* sink */) override37 std::shared_ptr<frontend::Session> open_session(pid_t, std::string const& /* name */, std::shared_ptr<frontend::EventSink> const& /* sink */) override
@@ -56,4 +56,4 @@
56}56}
57} // namespace mir57} // namespace mir
5858
59#endif // MIR_TEST_DOUBLES_STUB_SHELL_H_59#endif // MIR_TEST_DOUBLES_STUB_SERVER_H_
6060
=== modified file 'src/server/frontend/default_configuration.cpp'
--- src/server/frontend/default_configuration.cpp 2014-03-26 05:48:59 +0000
+++ src/server/frontend/default_configuration.cpp 2014-04-15 04:08:26 +0000
@@ -41,14 +41,14 @@
41{41{
42public:42public:
43 explicit DefaultIpcFactory(43 explicit DefaultIpcFactory(
44 std::shared_ptr<mf::Shell> const& shell,44 std::shared_ptr<mf::Server> const& server,
45 std::shared_ptr<mf::SessionMediatorReport> const& sm_report,45 std::shared_ptr<mf::SessionMediatorReport> const& sm_report,
46 std::shared_ptr<mg::Platform> const& graphics_platform,46 std::shared_ptr<mg::Platform> const& graphics_platform,
47 std::shared_ptr<mf::DisplayChanger> const& display_changer,47 std::shared_ptr<mf::DisplayChanger> const& display_changer,
48 std::shared_ptr<mg::GraphicBufferAllocator> const& buffer_allocator,48 std::shared_ptr<mg::GraphicBufferAllocator> const& buffer_allocator,
49 std::shared_ptr<mf::Screencast> const& screencast,49 std::shared_ptr<mf::Screencast> const& screencast,
50 std::shared_ptr<mf::SessionAuthorizer> const& session_authorizer) :50 std::shared_ptr<mf::SessionAuthorizer> const& session_authorizer) :
51 shell(shell),51 server(server),
52 sm_report(sm_report),52 sm_report(sm_report),
53 cache(std::make_shared<mf::ResourceCache>()),53 cache(std::make_shared<mf::ResourceCache>()),
54 graphics_platform(graphics_platform),54 graphics_platform(graphics_platform),
@@ -60,7 +60,7 @@
60 }60 }
6161
62private:62private:
63 std::shared_ptr<mf::Shell> shell;63 std::shared_ptr<mf::Server> server;
64 std::shared_ptr<mf::SessionMediatorReport> const sm_report;64 std::shared_ptr<mf::SessionMediatorReport> const sm_report;
65 std::shared_ptr<mf::ResourceCache> const cache;65 std::shared_ptr<mf::ResourceCache> const cache;
66 std::shared_ptr<mg::Platform> const graphics_platform;66 std::shared_ptr<mg::Platform> const graphics_platform;
@@ -96,7 +96,7 @@
9696
97 return std::make_shared<mf::SessionMediator>(97 return std::make_shared<mf::SessionMediator>(
98 client_pid,98 client_pid,
99 shell,99 server,
100 graphics_platform,100 graphics_platform,
101 changer,101 changer,
102 buffer_allocator->supported_pixel_formats(),102 buffer_allocator->supported_pixel_formats(),
@@ -119,7 +119,7 @@
119 return session_creator([this]119 return session_creator([this]
120 {120 {
121 return std::make_shared<mf::ProtobufSessionCreator>(121 return std::make_shared<mf::ProtobufSessionCreator>(
122 the_ipc_factory(the_frontend_shell(), the_buffer_allocator()),122 the_ipc_factory(the_frontend_server(), the_buffer_allocator()),
123 the_session_authorizer(),123 the_session_authorizer(),
124 the_message_processor_report());124 the_message_processor_report());
125 });125 });
@@ -153,14 +153,14 @@
153153
154std::shared_ptr<mir::frontend::ProtobufIpcFactory>154std::shared_ptr<mir::frontend::ProtobufIpcFactory>
155mir::DefaultServerConfiguration::the_ipc_factory(155mir::DefaultServerConfiguration::the_ipc_factory(
156 std::shared_ptr<mf::Shell> const& shell,156 std::shared_ptr<mf::Server> const& server,
157 std::shared_ptr<mg::GraphicBufferAllocator> const& allocator)157 std::shared_ptr<mg::GraphicBufferAllocator> const& allocator)
158{158{
159 return ipc_factory(159 return ipc_factory(
160 [&]()160 [&]()
161 {161 {
162 return std::make_shared<DefaultIpcFactory>(162 return std::make_shared<DefaultIpcFactory>(
163 shell,163 server,
164 the_session_mediator_report(),164 the_session_mediator_report(),
165 the_graphics_platform(),165 the_graphics_platform(),
166 the_frontend_display_changer(),166 the_frontend_display_changer(),
167167
=== modified file 'src/server/frontend/session_mediator.cpp'
--- src/server/frontend/session_mediator.cpp 2014-04-08 09:06:37 +0000
+++ src/server/frontend/session_mediator.cpp 2014-04-15 04:08:26 +0000
@@ -20,7 +20,7 @@
20#include "client_buffer_tracker.h"20#include "client_buffer_tracker.h"
2121
22#include "mir/frontend/session_mediator_report.h"22#include "mir/frontend/session_mediator_report.h"
23#include "mir/frontend/shell.h"23#include "mir/frontend/server.h"
24#include "mir/frontend/session.h"24#include "mir/frontend/session.h"
25#include "mir/frontend/surface.h"25#include "mir/frontend/surface.h"
26#include "mir/scene/surface_creation_parameters.h"26#include "mir/scene/surface_creation_parameters.h"
@@ -60,7 +60,7 @@
6060
61mf::SessionMediator::SessionMediator(61mf::SessionMediator::SessionMediator(
62 pid_t client_pid,62 pid_t client_pid,
63 std::shared_ptr<frontend::Shell> const& shell,63 std::shared_ptr<frontend::Server> const& server,
64 std::shared_ptr<graphics::Platform> const & graphics_platform,64 std::shared_ptr<graphics::Platform> const & graphics_platform,
65 std::shared_ptr<mf::DisplayChanger> const& display_changer,65 std::shared_ptr<mf::DisplayChanger> const& display_changer,
66 std::vector<MirPixelFormat> const& surface_pixel_formats,66 std::vector<MirPixelFormat> const& surface_pixel_formats,
@@ -69,7 +69,7 @@
69 std::shared_ptr<ResourceCache> const& resource_cache,69 std::shared_ptr<ResourceCache> const& resource_cache,
70 std::shared_ptr<Screencast> const& screencast) :70 std::shared_ptr<Screencast> const& screencast) :
71 client_pid(client_pid),71 client_pid(client_pid),
72 shell(shell),72 server(server),
73 graphics_platform(graphics_platform),73 graphics_platform(graphics_platform),
74 surface_pixel_formats(surface_pixel_formats),74 surface_pixel_formats(surface_pixel_formats),
75 display_changer(display_changer),75 display_changer(display_changer),
@@ -85,7 +85,7 @@
85 if (auto session = weak_session.lock())85 if (auto session = weak_session.lock())
86 {86 {
87 report->session_error(session->name(), __PRETTY_FUNCTION__, "connection dropped without disconnect");87 report->session_error(session->name(), __PRETTY_FUNCTION__, "connection dropped without disconnect");
88 shell->close_session(session);88 server->close_session(session);
89 }89 }
90}90}
9191
@@ -99,7 +99,7 @@
9999
100 {100 {
101 std::unique_lock<std::mutex> lock(session_mutex);101 std::unique_lock<std::mutex> lock(session_mutex);
102 weak_session = shell->open_session(client_pid, request->application_name(), event_sink);102 weak_session = server->open_session(client_pid, request->application_name(), event_sink);
103 }103 }
104104
105 auto ipc_package = graphics_platform->get_ipc_package();105 auto ipc_package = graphics_platform->get_ipc_package();
@@ -191,7 +191,7 @@
191 // To achieve this order we rely on done->Run() sending messages synchronously. As documented in mfd::SocketMessenger::send.191 // To achieve this order we rely on done->Run() sending messages synchronously. As documented in mfd::SocketMessenger::send.
192 // this will require additional synchronization if mfd::SocketMessenger::send changes.192 // this will require additional synchronization if mfd::SocketMessenger::send changes.
193 done->Run();193 done->Run();
194 shell->handle_surface_created(session);194 server->handle_surface_created(session);
195 });195 });
196}196}
197197
@@ -267,7 +267,7 @@
267267
268 report->session_disconnect_called(session->name());268 report->session_disconnect_called(session->name());
269269
270 shell->close_session(session);270 server->close_session(session);
271 weak_session.reset();271 weak_session.reset();
272 }272 }
273273
274274
=== modified file 'src/server/frontend/session_mediator.h'
--- src/server/frontend/session_mediator.h 2014-03-06 06:05:17 +0000
+++ src/server/frontend/session_mediator.h 2014-04-15 04:08:26 +0000
@@ -46,7 +46,7 @@
46namespace frontend46namespace frontend
47{47{
48class ClientBufferTracker;48class ClientBufferTracker;
49class Shell;49class Server;
50class Session;50class Session;
51class Surface;51class Surface;
52class ResourceCache;52class ResourceCache;
@@ -61,7 +61,7 @@
61public:61public:
62 SessionMediator(62 SessionMediator(
63 pid_t client_pid,63 pid_t client_pid,
64 std::shared_ptr<Shell> const& shell,64 std::shared_ptr<Server> const& server,
65 std::shared_ptr<graphics::Platform> const& graphics_platform,65 std::shared_ptr<graphics::Platform> const& graphics_platform,
66 std::shared_ptr<frontend::DisplayChanger> const& display_changer,66 std::shared_ptr<frontend::DisplayChanger> const& display_changer,
67 std::vector<MirPixelFormat> const& surface_pixel_formats,67 std::vector<MirPixelFormat> const& surface_pixel_formats,
@@ -137,7 +137,7 @@
137137
138 void advance_buffer(SurfaceId surf_id, Surface& surface, std::function<void(graphics::Buffer*, bool)> complete);138 void advance_buffer(SurfaceId surf_id, Surface& surface, std::function<void(graphics::Buffer*, bool)> complete);
139 pid_t client_pid;139 pid_t client_pid;
140 std::shared_ptr<Shell> const shell;140 std::shared_ptr<Server> const server;
141 std::shared_ptr<graphics::Platform> const graphics_platform;141 std::shared_ptr<graphics::Platform> const graphics_platform;
142142
143 std::vector<MirPixelFormat> const surface_pixel_formats;143 std::vector<MirPixelFormat> const surface_pixel_formats;
144144
=== modified file 'src/server/scene/default_configuration.cpp'
--- src/server/scene/default_configuration.cpp 2014-04-14 11:31:04 +0000
+++ src/server/scene/default_configuration.cpp 2014-04-15 04:08:26 +0000
@@ -187,8 +187,8 @@
187 });187 });
188}188}
189189
190std::shared_ptr<mf::Shell>190std::shared_ptr<mf::Server>
191mir::DefaultServerConfiguration::the_frontend_shell()191mir::DefaultServerConfiguration::the_frontend_server()
192{192{
193 return the_session_manager();193 return the_session_manager();
194}194}
195195
=== modified file 'src/server/scene/session_manager.h'
--- src/server/scene/session_manager.h 2014-04-08 09:06:37 +0000
+++ src/server/scene/session_manager.h 2014-04-15 04:08:26 +0000
@@ -20,7 +20,7 @@
20#define MIR_SCENE_APPLICATION_MANAGER_H_20#define MIR_SCENE_APPLICATION_MANAGER_H_
2121
22#include "mir/frontend/surface_id.h"22#include "mir/frontend/surface_id.h"
23#include "mir/frontend/shell.h"23#include "mir/frontend/server.h"
24#include "mir/shell/focus_controller.h"24#include "mir/shell/focus_controller.h"
2525
26#include <mutex>26#include <mutex>
@@ -43,7 +43,7 @@
43class SnapshotStrategy;43class SnapshotStrategy;
44class SurfaceCoordinator;44class SurfaceCoordinator;
4545
46class SessionManager : public frontend::Shell, public shell::FocusController46class SessionManager : public frontend::Server, public shell::FocusController
47{47{
48public:48public:
49 explicit SessionManager(std::shared_ptr<SurfaceCoordinator> const& surface_coordinator,49 explicit SessionManager(std::shared_ptr<SurfaceCoordinator> const& surface_coordinator,
5050
=== modified file 'tests/acceptance-tests/test_protobuf.cpp'
--- tests/acceptance-tests/test_protobuf.cpp 2014-03-26 05:48:59 +0000
+++ tests/acceptance-tests/test_protobuf.cpp 2014-04-15 04:08:26 +0000
@@ -141,7 +141,7 @@
141 return session_creator([this]141 return session_creator([this]
142 {142 {
143 return std::make_shared<DemoSessionCreator>(143 return std::make_shared<DemoSessionCreator>(
144 the_ipc_factory(the_frontend_shell(), the_buffer_allocator()),144 the_ipc_factory(the_frontend_server(), the_buffer_allocator()),
145 the_session_authorizer(),145 the_session_authorizer(),
146 the_message_processor_report());146 the_message_processor_report());
147 });147 });
148148
=== modified file 'tests/integration-tests/session_management.cpp'
--- tests/integration-tests/session_management.cpp 2014-04-08 17:21:28 +0000
+++ tests/integration-tests/session_management.cpp 2014-04-15 04:08:26 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "mir/frontend/session.h"19#include "mir/frontend/session.h"
20#include "mir/frontend/shell.h"20#include "mir/frontend/server.h"
21#include "mir/input/input_configuration.h"21#include "mir/input/input_configuration.h"
2222
23#include "mir/scene/surface_creation_parameters.h"23#include "mir/scene/surface_creation_parameters.h"
@@ -100,7 +100,7 @@
100{100{
101 TestConfiguration builder;101 TestConfiguration builder;
102 std::shared_ptr<mf::EventSink> const event_sink = std::make_shared<mtd::NullEventSink>();102 std::shared_ptr<mf::EventSink> const event_sink = std::make_shared<mtd::NullEventSink>();
103 std::shared_ptr<mf::Shell> const session_manager = builder.the_frontend_shell();103 std::shared_ptr<mf::Server> const session_manager = builder.the_frontend_server();
104 std::shared_ptr<TestSurfaceStack> const& test_surface_stack = builder.test_surface_stack;104 std::shared_ptr<TestSurfaceStack> const& test_surface_stack = builder.test_surface_stack;
105105
106 void SetUp()106 void SetUp()
107107
=== modified file 'tests/integration-tests/test_error_reporting.cpp'
--- tests/integration-tests/test_error_reporting.cpp 2014-03-06 06:05:17 +0000
+++ tests/integration-tests/test_error_reporting.cpp 2014-04-15 04:08:26 +0000
@@ -206,7 +206,7 @@
206 struct ServerConfig : TestingServerConfiguration206 struct ServerConfig : TestingServerConfiguration
207 {207 {
208 std::shared_ptr<mf::ProtobufIpcFactory> the_ipc_factory(208 std::shared_ptr<mf::ProtobufIpcFactory> the_ipc_factory(
209 std::shared_ptr<mir::frontend::Shell> const&,209 std::shared_ptr<mir::frontend::Server> const&,
210 std::shared_ptr<mg::GraphicBufferAllocator> const&) override210 std::shared_ptr<mg::GraphicBufferAllocator> const&) override
211 {211 {
212 static auto error_server = std::make_shared<ErrorServer>();212 static auto error_server = std::make_shared<ErrorServer>();
213213
=== modified file 'tests/mir_test_framework/input_testing_server_options.cpp'
--- tests/mir_test_framework/input_testing_server_options.cpp 2014-04-08 09:06:37 +0000
+++ tests/mir_test_framework/input_testing_server_options.cpp 2014-04-15 04:08:26 +0000
@@ -22,7 +22,6 @@
22#include "mir/scene/input_registrar.h"22#include "mir/scene/input_registrar.h"
23#include "mir/input/surface.h"23#include "mir/input/surface.h"
24#include "mir/scene/surface_creation_parameters.h"24#include "mir/scene/surface_creation_parameters.h"
25#include "mir/frontend/shell.h"
26#include "mir/frontend/session.h"25#include "mir/frontend/session.h"
27#include "mir/input/composite_event_filter.h"26#include "mir/input/composite_event_filter.h"
2827
2928
=== modified file 'tests/unit-tests/frontend/test_session_mediator.cpp'
--- tests/unit-tests/frontend/test_session_mediator.cpp 2014-04-08 09:06:37 +0000
+++ tests/unit-tests/frontend/test_session_mediator.cpp 2014-04-15 04:08:26 +0000
@@ -32,7 +32,7 @@
32#include "mir_test_doubles/null_event_sink.h"32#include "mir_test_doubles/null_event_sink.h"
33#include "mir_test_doubles/null_display_changer.h"33#include "mir_test_doubles/null_display_changer.h"
34#include "mir_test_doubles/mock_display.h"34#include "mir_test_doubles/mock_display.h"
35#include "mir_test_doubles/mock_shell.h"35#include "mir_test_doubles/mock_server.h"
36#include "mir_test_doubles/mock_frontend_surface.h"36#include "mir_test_doubles/mock_frontend_surface.h"
37#include "mir_test_doubles/mock_buffer.h"37#include "mir_test_doubles/mock_buffer.h"
38#include "mir_test_doubles/stub_session.h"38#include "mir_test_doubles/stub_session.h"
@@ -198,14 +198,14 @@
198struct SessionMediatorTest : public ::testing::Test198struct SessionMediatorTest : public ::testing::Test
199{199{
200 SessionMediatorTest()200 SessionMediatorTest()
201 : shell{std::make_shared<testing::NiceMock<mtd::MockShell>>()},201 : server{std::make_shared<testing::NiceMock<mtd::MockServer>>()},
202 graphics_platform{std::make_shared<testing::NiceMock<MockPlatform>>()},202 graphics_platform{std::make_shared<testing::NiceMock<MockPlatform>>()},
203 graphics_changer{std::make_shared<mtd::NullDisplayChanger>()},203 graphics_changer{std::make_shared<mtd::NullDisplayChanger>()},
204 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},204 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
205 report{mr::null_session_mediator_report()},205 report{mr::null_session_mediator_report()},
206 resource_cache{std::make_shared<mf::ResourceCache>()},206 resource_cache{std::make_shared<mf::ResourceCache>()},
207 stub_screencast{std::make_shared<StubScreencast>()},207 stub_screencast{std::make_shared<StubScreencast>()},
208 mediator{__LINE__, shell, graphics_platform, graphics_changer,208 mediator{__LINE__, server, graphics_platform, graphics_changer,
209 surface_pixel_formats, report,209 surface_pixel_formats, report,
210 std::make_shared<mtd::NullEventSink>(),210 std::make_shared<mtd::NullEventSink>(),
211 resource_cache, stub_screencast},211 resource_cache, stub_screencast},
@@ -214,12 +214,12 @@
214 {214 {
215 using namespace ::testing;215 using namespace ::testing;
216216
217 ON_CALL(*shell, open_session(_, _, _)).WillByDefault(Return(stubbed_session));217 ON_CALL(*server, open_session(_, _, _)).WillByDefault(Return(stubbed_session));
218 ON_CALL(*shell, create_surface_for(_, _))218 ON_CALL(*server, create_surface_for(_, _))
219 .WillByDefault(WithArg<1>(Invoke(stubbed_session.get(), &StubbedSession::create_surface)));219 .WillByDefault(WithArg<1>(Invoke(stubbed_session.get(), &StubbedSession::create_surface)));
220 }220 }
221221
222 std::shared_ptr<testing::NiceMock<mtd::MockShell>> const shell;222 std::shared_ptr<testing::NiceMock<mtd::MockServer>> const server;
223 std::shared_ptr<MockPlatform> const graphics_platform;223 std::shared_ptr<MockPlatform> const graphics_platform;
224 std::shared_ptr<mf::DisplayChanger> const graphics_changer;224 std::shared_ptr<mf::DisplayChanger> const graphics_changer;
225 std::vector<MirPixelFormat> const surface_pixel_formats;225 std::vector<MirPixelFormat> const surface_pixel_formats;
@@ -240,7 +240,7 @@
240 mp::ConnectParameters connect_parameters;240 mp::ConnectParameters connect_parameters;
241 mp::Connection connection;241 mp::Connection connection;
242242
243 EXPECT_CALL(*shell, close_session(_)).Times(1);243 EXPECT_CALL(*server, close_session(_)).Times(1);
244244
245 mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get());245 mediator.connect(nullptr, &connect_parameters, &connection, null_callback.get());
246 mediator.disconnect(nullptr, nullptr, nullptr, null_callback.get());246 mediator.disconnect(nullptr, nullptr, nullptr, null_callback.get());
@@ -369,7 +369,7 @@
369 .Times(1)369 .Times(1)
370 .WillOnce(Return(mt::fake_shared(config)));370 .WillOnce(Return(mt::fake_shared(config)));
371 mf::SessionMediator mediator(371 mf::SessionMediator mediator(
372 __LINE__, shell, graphics_platform, mock_display,372 __LINE__, server, graphics_platform, mock_display,
373 surface_pixel_formats, report,373 surface_pixel_formats, report,
374 std::make_shared<mtd::NullEventSink>(),374 std::make_shared<mtd::NullEventSink>(),
375 resource_cache, std::make_shared<mtd::NullScreencast>());375 resource_cache, std::make_shared<mtd::NullScreencast>());
@@ -593,7 +593,7 @@
593 .WillOnce(Return(mt::fake_shared(stub_display_config)));593 .WillOnce(Return(mt::fake_shared(stub_display_config)));
594594
595 mf::SessionMediator session_mediator{595 mf::SessionMediator session_mediator{
596 __LINE__, shell, graphics_platform, mock_display_selector,596 __LINE__, server, graphics_platform, mock_display_selector,
597 surface_pixel_formats, report,597 surface_pixel_formats, report,
598 std::make_shared<mtd::NullEventSink>(), resource_cache,598 std::make_shared<mtd::NullEventSink>(), resource_cache,
599 std::make_shared<mtd::NullScreencast>()};599 std::make_shared<mtd::NullScreencast>()};
600600
=== modified file 'tests/unit-tests/frontend/test_session_mediator_android.cpp'
--- tests/unit-tests/frontend/test_session_mediator_android.cpp 2014-04-08 12:26:40 +0000
+++ tests/unit-tests/frontend/test_session_mediator_android.cpp 2014-04-15 04:08:26 +0000
@@ -21,7 +21,7 @@
21#include "src/server/frontend/resource_cache.h"21#include "src/server/frontend/resource_cache.h"
22#include "src/server/scene/application_session.h"22#include "src/server/scene/application_session.h"
23#include "src/server/report/null_report_factory.h"23#include "src/server/report/null_report_factory.h"
24#include "mir/frontend/shell.h"24#include "mir/frontend/server.h"
25#include "mir/scene/surface_creation_parameters.h"25#include "mir/scene/surface_creation_parameters.h"
26#include "mir/graphics/display.h"26#include "mir/graphics/display.h"
27#include "mir/graphics/platform.h"27#include "mir/graphics/platform.h"
@@ -29,7 +29,7 @@
2929
30#include "mir_test_doubles/null_display_changer.h"30#include "mir_test_doubles/null_display_changer.h"
31#include "mir_test_doubles/mock_session.h"31#include "mir_test_doubles/mock_session.h"
32#include "mir_test_doubles/stub_shell.h"32#include "mir_test_doubles/stub_server.h"
33#include "mir_test_doubles/null_platform.h"33#include "mir_test_doubles/null_platform.h"
34#include "mir_test_doubles/null_event_sink.h"34#include "mir_test_doubles/null_event_sink.h"
35#include "mir_test_doubles/stub_buffer_allocator.h"35#include "mir_test_doubles/stub_buffer_allocator.h"
@@ -52,13 +52,13 @@
52struct SessionMediatorAndroidTest : public ::testing::Test52struct SessionMediatorAndroidTest : public ::testing::Test
53{53{
54 SessionMediatorAndroidTest()54 SessionMediatorAndroidTest()
55 : shell{std::make_shared<mtd::StubShell>()},55 : server{std::make_shared<mtd::StubServer>()},
56 graphics_platform{std::make_shared<mtd::NullPlatform>()},56 graphics_platform{std::make_shared<mtd::NullPlatform>()},
57 display_changer{std::make_shared<mtd::NullDisplayChanger>()},57 display_changer{std::make_shared<mtd::NullDisplayChanger>()},
58 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},58 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
59 report{mr::null_session_mediator_report()},59 report{mr::null_session_mediator_report()},
60 resource_cache{std::make_shared<mf::ResourceCache>()},60 resource_cache{std::make_shared<mf::ResourceCache>()},
61 mediator{__LINE__, shell, graphics_platform, display_changer,61 mediator{__LINE__, server, graphics_platform, display_changer,
62 surface_pixel_formats, report,62 surface_pixel_formats, report,
63 std::make_shared<mtd::NullEventSink>(),63 std::make_shared<mtd::NullEventSink>(),
64 resource_cache, std::make_shared<mtd::NullScreencast>()},64 resource_cache, std::make_shared<mtd::NullScreencast>()},
@@ -66,7 +66,7 @@
66 {66 {
67 }67 }
6868
69 std::shared_ptr<mtd::StubShell> const shell;69 std::shared_ptr<mtd::StubServer> const server;
70 std::shared_ptr<mtd::NullPlatform> const graphics_platform;70 std::shared_ptr<mtd::NullPlatform> const graphics_platform;
71 std::shared_ptr<mf::DisplayChanger> const display_changer;71 std::shared_ptr<mf::DisplayChanger> const display_changer;
72 std::vector<MirPixelFormat> const surface_pixel_formats;72 std::vector<MirPixelFormat> const surface_pixel_formats;
7373
=== modified file 'tests/unit-tests/frontend/test_session_mediator_mesa.cpp'
--- tests/unit-tests/frontend/test_session_mediator_mesa.cpp 2014-04-08 12:26:40 +0000
+++ tests/unit-tests/frontend/test_session_mediator_mesa.cpp 2014-04-15 04:08:26 +0000
@@ -22,7 +22,7 @@
22#include "src/server/scene/application_session.h"22#include "src/server/scene/application_session.h"
23#include "src/server/frontend/session_mediator.h"23#include "src/server/frontend/session_mediator.h"
24#include "src/server/report/null_report_factory.h"24#include "src/server/report/null_report_factory.h"
25#include "mir/frontend/shell.h"25#include "mir/frontend/server.h"
26#include "mir/graphics/display.h"26#include "mir/graphics/display.h"
27#include "mir/graphics/drm_authenticator.h"27#include "mir/graphics/drm_authenticator.h"
28#include "mir/frontend/event_sink.h"28#include "mir/frontend/event_sink.h"
@@ -35,7 +35,7 @@
35#include "mir_test_doubles/null_display_changer.h"35#include "mir_test_doubles/null_display_changer.h"
36#include "mir_test_doubles/null_platform.h"36#include "mir_test_doubles/null_platform.h"
37#include "mir_test_doubles/mock_session.h"37#include "mir_test_doubles/mock_session.h"
38#include "mir_test_doubles/stub_shell.h"38#include "mir_test_doubles/stub_server.h"
39#include "mir_test_doubles/null_screencast.h"39#include "mir_test_doubles/null_screencast.h"
4040
41#include <gtest/gtest.h>41#include <gtest/gtest.h>
@@ -66,13 +66,13 @@
66struct SessionMediatorMesaTest : public ::testing::Test66struct SessionMediatorMesaTest : public ::testing::Test
67{67{
68 SessionMediatorMesaTest()68 SessionMediatorMesaTest()
69 : shell{std::make_shared<mtd::StubShell>()},69 : server{std::make_shared<mtd::StubServer>()},
70 mock_platform{std::make_shared<MockAuthenticatingPlatform>()},70 mock_platform{std::make_shared<MockAuthenticatingPlatform>()},
71 display_changer{std::make_shared<mtd::NullDisplayChanger>()},71 display_changer{std::make_shared<mtd::NullDisplayChanger>()},
72 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},72 surface_pixel_formats{mir_pixel_format_argb_8888, mir_pixel_format_xrgb_8888},
73 report{mr::null_session_mediator_report()},73 report{mr::null_session_mediator_report()},
74 resource_cache{std::make_shared<mf::ResourceCache>()},74 resource_cache{std::make_shared<mf::ResourceCache>()},
75 mediator{__LINE__, shell, mock_platform, display_changer,75 mediator{__LINE__, server, mock_platform, display_changer,
76 surface_pixel_formats, report,76 surface_pixel_formats, report,
77 std::make_shared<mtd::NullEventSink>(),77 std::make_shared<mtd::NullEventSink>(),
78 resource_cache, std::make_shared<mtd::NullScreencast>()},78 resource_cache, std::make_shared<mtd::NullScreencast>()},
@@ -80,7 +80,7 @@
80 {80 {
81 }81 }
8282
83 std::shared_ptr<mtd::StubShell> const shell;83 std::shared_ptr<mtd::StubServer> const server;
84 std::shared_ptr<MockAuthenticatingPlatform> const mock_platform;84 std::shared_ptr<MockAuthenticatingPlatform> const mock_platform;
85 std::shared_ptr<mf::DisplayChanger> const display_changer;85 std::shared_ptr<mf::DisplayChanger> const display_changer;
86 std::vector<MirPixelFormat> const surface_pixel_formats;86 std::vector<MirPixelFormat> const surface_pixel_formats;

Subscribers

People subscribed via source and target branches