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

Unified Diff: services/ui/public/cpp/tests/test_window_tree_client_setup.h

Issue 2301353003: Changes ownership of WindowTreeClient (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/public/cpp/tests/test_window_tree_client_setup.h
diff --git a/services/ui/public/cpp/tests/test_window_tree_client_setup.h b/services/ui/public/cpp/tests/test_window_tree_client_setup.h
index 04f3961bd5a89fed4b5045ba92a8a9aa2c4327df..90a280159a9a47e3a149fd9beb75b382ad64d906 100644
--- a/services/ui/public/cpp/tests/test_window_tree_client_setup.h
+++ b/services/ui/public/cpp/tests/test_window_tree_client_setup.h
@@ -37,6 +37,9 @@ class TestWindowTreeClientSetup : public ui::WindowTreeClientObserver {
// The WindowTree that WindowTreeClient talks to.
TestWindowTree* window_tree() { return window_tree_.get(); }
+ // Returns ownership of WindowTreeClient to the caller.
+ std::unique_ptr<WindowTreeClient> OwnWindowTreeClient();
+
WindowTreeClient* window_tree_client();
private:
@@ -44,14 +47,8 @@ class TestWindowTreeClientSetup : public ui::WindowTreeClientObserver {
void CommonInit(WindowTreeClientDelegate* window_tree_delegate,
WindowManagerDelegate* window_manager_delegate);
- // ui::WindowTreeClientObserver:
- void OnDidDestroyClient(ui::WindowTreeClient* client) override;
-
std::unique_ptr<TestWindowTree> window_tree_;
- // See description of WindowTreeClientDelegate for details on ownership. The
- // WindowTreeClient may be deleted during shutdown by the test. If not,
- // we own it and must delete it.
std::unique_ptr<WindowTreeClient> window_tree_client_;
DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientSetup);

Powered by Google App Engine
This is Rietveld 408576698