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

Unified Diff: ui/views/cocoa/bridged_native_widget.h

Issue 2863883002: Tracing for NSMenu timelines
Patch Set: big CL with more trace points Created 3 years, 7 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 | « ui/base/cocoa/menu_controller_unittest.mm ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_native_widget.h
diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
index 4a4acdefa6298d22295e548523ac62516c25969e..0378f3867e0c505d9f88d6cba9eace65556148aa 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
+#include <functional>
#include <memory>
#include <vector>
@@ -184,6 +185,10 @@ class VIEWS_EXPORT BridgedNativeWidget
// Sorts child NSViews according to NativeViewHosts order in views hierarchy.
void ReorderChildViews();
+ // Schedules a draw then blocks the UI thread until the UI Compositor swaps in
+ // a new frame or a timeout occurs.
+ void PumpCompositor();
+
NativeWidgetMac* native_widget_mac() { return native_widget_mac_; }
BridgedContentView* ns_view() { return bridged_view_; }
NSWindow* ns_window() { return window_; }
@@ -235,10 +240,13 @@ class VIEWS_EXPORT BridgedNativeWidget
void UpdateLayerProperties();
// Immediately return if there is a composited frame matching |size_in_dip|.
- // Otherwise, asks ui::WindowResizeHelperMac to run tasks until a matching
- // frame is ready, or a timeout occurs.
+ // Otherwise, calls WaitForFrame() to obtain one.
void MaybeWaitForFrame(const gfx::Size& size_in_dip);
+ // Asks ui::WindowResizeHelperMac to run tasks until |predicate| returns true
+ // or |timeout_ms| passes.
+ void WaitForFrame(int timeout_ms, std::function<bool()> predicate);
+
// Show the window using -[NSApp beginSheet:..], modal for the parent window.
void ShowAsModalSheet();
@@ -327,6 +335,9 @@ class VIEWS_EXPORT BridgedNativeWidget
// the compositor arrives to avoid "blinking".
bool initial_visibility_suppressed_ = false;
+ // Set to true whenever a frame is swapped. Used to wait for a frame.
+ bool frame_swapped_ = false;
+
AssociatedViews associated_views_;
DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
« no previous file with comments | « ui/base/cocoa/menu_controller_unittest.mm ('k') | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698