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

Side by Side Diff: services/ui/ws/window_tree_binding.h

Issue 2352893002: Makes windowserver not send messages during shutdown (Closed)
Patch Set: merge Created 4 years, 3 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
« no previous file with comments | « services/ui/ws/window_tree.cc ('k') | services/ui/ws/window_tree_binding.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SERVICES_UI_WS_WINDOW_TREE_BINDING_H_ 5 #ifndef SERVICES_UI_WS_WINDOW_TREE_BINDING_H_
6 #define SERVICES_UI_WS_WINDOW_TREE_BINDING_H_ 6 #define SERVICES_UI_WS_WINDOW_TREE_BINDING_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 15 matching lines...) Expand all
26 explicit WindowTreeBinding(mojom::WindowTreeClient* client); 26 explicit WindowTreeBinding(mojom::WindowTreeClient* client);
27 virtual ~WindowTreeBinding(); 27 virtual ~WindowTreeBinding();
28 28
29 mojom::WindowTreeClient* client() { return client_; } 29 mojom::WindowTreeClient* client() { return client_; }
30 30
31 // Obtains a new WindowManager. This should only be called once. 31 // Obtains a new WindowManager. This should only be called once.
32 virtual mojom::WindowManager* GetWindowManager() = 0; 32 virtual mojom::WindowManager* GetWindowManager() = 0;
33 33
34 virtual void SetIncomingMethodCallProcessingPaused(bool paused) = 0; 34 virtual void SetIncomingMethodCallProcessingPaused(bool paused) = 0;
35 35
36 // Called when the WindowServer is destroyed. Sets |client_| to
37 // CreateClientForShutdown().
38 void ResetClientForShutdown();
39
40 protected:
41 virtual mojom::WindowTreeClient* CreateClientForShutdown() = 0;
42
36 private: 43 private:
37 mojom::WindowTreeClient* client_; 44 mojom::WindowTreeClient* client_;
38 45
39 DISALLOW_COPY_AND_ASSIGN(WindowTreeBinding); 46 DISALLOW_COPY_AND_ASSIGN(WindowTreeBinding);
40 }; 47 };
41 48
42 // Bindings implementation of WindowTreeBinding. 49 // Bindings implementation of WindowTreeBinding.
43 class DefaultWindowTreeBinding : public WindowTreeBinding { 50 class DefaultWindowTreeBinding : public WindowTreeBinding {
44 public: 51 public:
45 DefaultWindowTreeBinding(WindowTree* tree, 52 DefaultWindowTreeBinding(WindowTree* tree,
46 WindowServer* window_server, 53 WindowServer* window_server,
47 mojom::WindowTreeRequest service_request, 54 mojom::WindowTreeRequest service_request,
48 mojom::WindowTreeClientPtr client); 55 mojom::WindowTreeClientPtr client);
49 DefaultWindowTreeBinding(WindowTree* tree, 56 DefaultWindowTreeBinding(WindowTree* tree,
50 mojom::WindowTreeClientPtr client); 57 mojom::WindowTreeClientPtr client);
51 ~DefaultWindowTreeBinding() override; 58 ~DefaultWindowTreeBinding() override;
52 59
53 // Use when created with the constructor that does not take a 60 // Use when created with the constructor that does not take a
54 // WindowTreeRequest. 61 // WindowTreeRequest.
55 mojom::WindowTreePtr CreateInterfacePtrAndBind(); 62 mojom::WindowTreePtr CreateInterfacePtrAndBind();
56 63
57 // WindowTreeBinding: 64 // WindowTreeBinding:
58 mojom::WindowManager* GetWindowManager() override; 65 mojom::WindowManager* GetWindowManager() override;
59 void SetIncomingMethodCallProcessingPaused(bool paused) override; 66 void SetIncomingMethodCallProcessingPaused(bool paused) override;
60 67
68 protected:
69 // WindowTreeBinding:
70 mojom::WindowTreeClient* CreateClientForShutdown() override;
71
61 private: 72 private:
62 mojo::Binding<mojom::WindowTree> binding_; 73 mojo::Binding<mojom::WindowTree> binding_;
63 mojom::WindowTreeClientPtr client_; 74 mojom::WindowTreeClientPtr client_;
64 mojom::WindowManagerAssociatedPtr window_manager_internal_; 75 mojom::WindowManagerAssociatedPtr window_manager_internal_;
65 76
66 DISALLOW_COPY_AND_ASSIGN(DefaultWindowTreeBinding); 77 DISALLOW_COPY_AND_ASSIGN(DefaultWindowTreeBinding);
67 }; 78 };
68 79
69 } // namespace ws 80 } // namespace ws
70 } // namespace ui 81 } // namespace ui
71 82
72 #endif // SERVICES_UI_WS_WINDOW_TREE_BINDING_H_ 83 #endif // SERVICES_UI_WS_WINDOW_TREE_BINDING_H_
OLDNEW
« no previous file with comments | « services/ui/ws/window_tree.cc ('k') | services/ui/ws/window_tree_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698