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

Unified Diff: content/browser/frame_host/debug_urls.cc

Issue 1063753005: Allow Waitable event to be used to intentionally hang the UI thread for debugging purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/threading/thread_restrictions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/debug_urls.cc
diff --git a/content/browser/frame_host/debug_urls.cc b/content/browser/frame_host/debug_urls.cc
index 29915ef9fa83cab5a83ce9f508bee2f225703257..3f6769bac1fc385235637ef1d93177efb1929159 100644
--- a/content/browser/frame_host/debug_urls.cc
+++ b/content/browser/frame_host/debug_urls.cc
@@ -15,6 +15,7 @@
#include "base/debug/profiler.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
+#include "base/threading/thread_restrictions.h"
#include "cc/base/switches.h"
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/public/browser/browser_thread.h"
@@ -150,6 +151,11 @@ bool HandleAsanDebugURL(const GURL& url) {
} // namespace
+class ScopedAllowWaitForDebugURL {
+ private:
+ base::ThreadRestrictions::ScopedAllowWait wait;
+};
+
bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
// Ensure that the user explicitly navigated to this URL, unless
// kEnableGpuBenchmarking is enabled by Telemetry.
@@ -177,6 +183,7 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
}
if (url == GURL(kChromeUIBrowserUIHang)) {
+ ScopedAllowWaitForDebugURL allow_wait;
base::WaitableEvent(false, false).Wait();
return true;
}
« no previous file with comments | « base/threading/thread_restrictions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698