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

Unified Diff: content/renderer/in_process_renderer_thread.cc

Issue 1900513003: Try to diagnose blink reinitialisation in WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow InProcessRendererThread to die if BrowserMainLoop is dying, to avoid breaking tests 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
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/in_process_renderer_thread.cc
diff --git a/content/renderer/in_process_renderer_thread.cc b/content/renderer/in_process_renderer_thread.cc
index a2c8c5d4459b8e316f009617f03bbb87e9dccac5..219df3e2801182aca540f182e4ec68321b8a59c4 100644
--- a/content/renderer/in_process_renderer_thread.cc
+++ b/content/renderer/in_process_renderer_thread.cc
@@ -15,12 +15,23 @@
namespace content {
+#if defined(OS_ANDROID)
+extern bool g_browser_main_loop_shutting_down;
+#endif
+
InProcessRendererThread::InProcessRendererThread(
const InProcessChildThreadParams& params)
: Thread("Chrome_InProcRendererThread"), params_(params) {
}
InProcessRendererThread::~InProcessRendererThread() {
+#if defined(OS_ANDROID)
+ // Don't allow the render thread to be shut down in single process mode on
+ // Android unless the browser is shutting down.
+ // Temporary CHECK() to debug http://crbug.com/514141
+ CHECK(g_browser_main_loop_shutting_down);
+#endif
+
Stop();
}
@@ -31,12 +42,22 @@ void InProcessRendererThread::Init() {
// will not change the thread name kept in Java VM.
#if defined(OS_ANDROID)
base::android::AttachCurrentThreadWithName(thread_name());
+ // Make sure we aren't somehow reinitialising the inprocess renderer thread on
+ // Android. Temporary CHECK() to debug http://crbug.com/514141
+ CHECK(!render_process_);
#endif
render_process_.reset(new RenderProcessImpl());
RenderThreadImpl::Create(params_);
}
void InProcessRendererThread::CleanUp() {
+#if defined(OS_ANDROID)
+ // Don't allow the render thread to be shut down in single process mode on
+ // Android unless the browser is shutting down.
+ // Temporary CHECK() to debug http://crbug.com/514141
+ CHECK(g_browser_main_loop_shutting_down);
+#endif
+
render_process_.reset();
// It's a little lame to manually set this flag. But the single process
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698