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

Unified Diff: components/mus/public/cpp/lib/window_tree_client_impl.h

Issue 1881253002: mus: Implement ScreenMus::GetCursorScreenPoint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows more. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/mus/public/cpp/lib/window_tree_client_impl.h
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.h b/components/mus/public/cpp/lib/window_tree_client_impl.h
index 3d8d7653abedacd6236e0314a995d77a933bc8d7..270e35997910768fdc76551f9f4960067c72825e 100644
--- a/components/mus/public/cpp/lib/window_tree_client_impl.h
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.h
@@ -10,7 +10,9 @@
#include <map>
#include <set>
+#include "base/atomicops.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "components/mus/common/types.h"
#include "components/mus/public/cpp/window.h"
@@ -162,11 +164,15 @@ class WindowTreeClientImpl : public WindowTreeConnection,
Id focused_window_id,
bool drawn);
+ void OnReceivedCursorLocationMemory(mojo::ScopedSharedBufferHandle handle);
+
// Overridden from WindowTreeConnection:
void SetDeleteOnNoRoots(bool value) override;
const std::set<Window*>& GetRoots() override;
Window* GetFocusedWindow() override;
void ClearFocus() override;
+ void InitializeCursorLocation() override;
+ gfx::Point GetCursorScreenPoint() override;
Window* NewWindow(const Window::SharedProperties* properties) override;
Window* NewTopLevelWindow(
const Window::SharedProperties* properties) override;
@@ -290,12 +296,24 @@ class WindowTreeClientImpl : public WindowTreeConnection,
bool in_destructor_;
+ bool called_initialize_cursor_location_;
+
+ // A handle to shared memory that is one 65 bit integer long. The window
+ // server uses this to let us synchronously read the cursor location.
+ mojo::ScopedSharedBufferHandle cursor_location_handle_;
+
+ // The one int64 in |cursor_location_handle_|. When we read from this
+ // location, we must always read from it atomically.
+ base::subtle::Atomic64* cursor_location_memory_;
+
base::ObserverList<WindowTreeConnectionObserver> observers_;
scoped_ptr<mojo::AssociatedBinding<mojom::WindowManager>>
window_manager_internal_;
mojom::WindowManagerClientAssociatedPtr window_manager_internal_client_;
+ base::WeakPtrFactory<WindowTreeClientImpl> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(WindowTreeClientImpl);
};

Powered by Google App Engine
This is Rietveld 408576698