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

Unified Diff: content/renderer/mus/compositor_mus_connection.h

Issue 2301353003: Changes ownership of WindowTreeClient (Closed)
Patch Set: fix navigation 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
« no previous file with comments | « ash/mus/window_manager_unittest.cc ('k') | content/renderer/mus/compositor_mus_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/mus/compositor_mus_connection.h
diff --git a/content/renderer/mus/compositor_mus_connection.h b/content/renderer/mus/compositor_mus_connection.h
index 2d477448898d42e0d46ea5486fab50fbe9d7f856..ee7ede8273925b217931fc2ff919a85ea7392496 100644
--- a/content/renderer/mus/compositor_mus_connection.h
+++ b/content/renderer/mus/compositor_mus_connection.h
@@ -5,9 +5,12 @@
#ifndef CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
#define CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
+#include <memory>
+
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/synchronization/lock.h"
#include "content/common/content_export.h"
#include "services/ui/public/cpp/input_event_handler.h"
#include "services/ui/public/cpp/window.h"
@@ -72,9 +75,12 @@ class CONTENT_EXPORT CompositorMusConnection
std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event);
+ void DeleteWindowTreeClient();
+
// WindowTreeClientDelegate implementation:
- void OnDidDestroyClient(ui::WindowTreeClient* client) override;
void OnEmbed(ui::Window* root) override;
+ void OnEmbedRootDestroyed(ui::Window* root) override;
+ void OnLostConnection(ui::WindowTreeClient* client) override;
void OnPointerEventObserved(const ui::PointerEvent& event,
ui::Window* target) override;
@@ -86,6 +92,10 @@ class CONTENT_EXPORT CompositorMusConnection
ack_callback) override;
const int routing_id_;
+ // Use this lock when accessing |window_tree_client_|. Lock exists solely for
+ // DCHECK in destructor.
+ base::Lock window_tree_client_lock_;
+ std::unique_ptr<ui::WindowTreeClient> window_tree_client_;
ui::Window* root_;
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
« no previous file with comments | « ash/mus/window_manager_unittest.cc ('k') | content/renderer/mus/compositor_mus_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698