Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Side by Side Diff: mojo/services/view_manager/client_connection.h

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_VIEW_MANAGER_CLIENT_CONNECTION_H_
6 #define SERVICES_VIEW_MANAGER_CLIENT_CONNECTION_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "mojo/public/cpp/bindings/binding.h"
10 #include "mojo/public/cpp/bindings/error_handler.h"
11 #include "third_party/mojo_services/src/view_manager/public/interfaces/view_mana ger.mojom.h"
12
13 namespace view_manager {
14
15 class ConnectionManager;
16 class ViewManagerServiceImpl;
17
18 // ClientConnection encapsulates the state needed for a single client connected
19 // to the view manager.
20 class ClientConnection {
21 public:
22 ClientConnection(scoped_ptr<ViewManagerServiceImpl> service,
23 mojo::ViewManagerClient* client);
24 virtual ~ClientConnection();
25
26 ViewManagerServiceImpl* service() { return service_.get(); }
27 const ViewManagerServiceImpl* service() const { return service_.get(); }
28
29 mojo::ViewManagerClient* client() { return client_; }
30
31 private:
32 scoped_ptr<ViewManagerServiceImpl> service_;
33 mojo::ViewManagerClient* client_;
34
35 DISALLOW_COPY_AND_ASSIGN(ClientConnection);
36 };
37
38 // Bindings implementation of ClientConnection.
39 class DefaultClientConnection : public ClientConnection,
40 public mojo::ErrorHandler {
41 public:
42 DefaultClientConnection(
43 scoped_ptr<ViewManagerServiceImpl> service_impl,
44 ConnectionManager* connection_manager,
45 mojo::InterfaceRequest<mojo::ViewManagerService> service_request,
46 mojo::ViewManagerClientPtr client);
47 ~DefaultClientConnection() override;
48
49 private:
50 // ErrorHandler:
51 void OnConnectionError() override;
52
53 ConnectionManager* connection_manager_;
54 mojo::Binding<mojo::ViewManagerService> binding_;
55 mojo::ViewManagerClientPtr client_;
56
57 DISALLOW_COPY_AND_ASSIGN(DefaultClientConnection);
58 };
59
60 } // namespace view_manager
61
62 #endif // SERVICES_VIEW_MANAGER_CLIENT_CONNECTION_H_
OLDNEW
« no previous file with comments | « mojo/services/view_manager/animation_runner_unittest.cc ('k') | mojo/services/view_manager/client_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698