Chromium Code Reviews| Index: ios/chrome/browser/ui/browser_view_controller.mm |
| diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm |
| index 1271cea016bb063baa8cc2dd4162d3f0fff7faca..d24e44201cdf03d08721b9b8929c73938739b21b 100644 |
| --- a/ios/chrome/browser/ui/browser_view_controller.mm |
| +++ b/ios/chrome/browser/ui/browser_view_controller.mm |
| @@ -3384,6 +3384,22 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver { |
| DCHECK(_browserState); |
| DCHECK(self.visible || self.dismissingModal); |
| + // Record the responsiveness of this show menu operation. |
| + NSTimeInterval startTime = [NSDate timeIntervalSinceReferenceDate]; |
|
rohitrao (ping after 24h)
2017/05/18 01:16:25
Another option would be to add this startTime to T
PL
2017/05/18 23:36:34
Done! This is a smart idea... the configuration is
|
| + __block id<NSObject> oneTimeObserver = [[NSNotificationCenter defaultCenter] |
| + addObserverForName:kMenuDidShowNotification |
| + object:nil |
| + queue:nil |
| + usingBlock:^(NSNotification* _Nonnull note) { |
| + UMA_HISTOGRAM_TIMES( |
| + "UI.Performance.ShowToolsMenuResponsiveness", |
| + base::TimeDelta::FromSecondsD( |
| + [NSDate timeIntervalSinceReferenceDate] - startTime)); |
| + [[NSNotificationCenter defaultCenter] |
| + removeObserver:oneTimeObserver]; |
| + oneTimeObserver = nil; |
| + }]; |
| + |
| // Dismiss the omnibox (if open). |
| [_toolbarController cancelOmniboxEdit]; |
| // Dismiss the soft keyboard (if open). |