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

Unified Diff: content/browser/accessibility/browser_accessibility_state_impl.cc

Issue 11299312: Run Chrome OS accessibility histograms on main thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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: content/browser/accessibility/browser_accessibility_state_impl.cc
diff --git a/content/browser/accessibility/browser_accessibility_state_impl.cc b/content/browser/accessibility/browser_accessibility_state_impl.cc
index 44a8d29d2a54f9e724ef671c7878424f10ff6ada..01ffc2a7913f1c00d1bb06f154f49f46f07e1bfe 100644
--- a/content/browser/accessibility/browser_accessibility_state_impl.cc
+++ b/content/browser/accessibility/browser_accessibility_state_impl.cc
@@ -49,13 +49,24 @@ BrowserAccessibilityStateImpl::BrowserAccessibilityStateImpl()
accessibility_mode_ = AccessibilityModeComplete;
}
+#if defined(OS_WIN)
oshima 2012/12/03 22:09:23 From the stack trace, the problem seems to be chro
dmazzoni 2012/12/03 23:32:30 Currently there's no Mac-specific or Linux-specifi
+ // On Windows, UpdateHistogram calls some system functions with unknown
+ // runtime, so call it on the file thread to ensure there's no jank.
+ // Everything in that method must be safe to call on another thread.
+ BrowserThread::ID browser_thread = BrowserThread::FILE;
+#else
+ // On all other platforms, UpdateHistogram should be called on the main
+ // thread.
+ BrowserThread::ID browser_thread = BrowserThread::UI;
oshima 2012/12/03 22:09:23 the name |browser_thread| doesn't make much sense.
dmazzoni 2012/12/03 23:32:30 Done.
+#endif
+
// UpdateHistogram only takes a couple of milliseconds, but run it on
// the FILE thread to guarantee there's no jank.
// And we need to AddRef() the leaky singleton so that Bind doesn't
// delete it prematurely.
oshima 2012/12/03 22:09:23 update this comment too. May be just move it insid
dmazzoni 2012/12/03 23:32:30 Thanks, meant to do that earlier. Done.
AddRef();
BrowserThread::PostDelayedTask(
- BrowserThread::FILE, FROM_HERE,
+ browser_thread, FROM_HERE,
base::Bind(&BrowserAccessibilityStateImpl::UpdateHistogram, this),
base::TimeDelta::FromSeconds(kAccessibilityHistogramDelaySecs));
}

Powered by Google App Engine
This is Rietveld 408576698