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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1877153003: mash: Fix crashes during chrome teardown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp"); 962 TRACE_EVENT0("shutdown", "BrowserMainLoop::ShutdownThreadsAndCleanUp");
963 963
964 // Teardown may start in PostMainMessageLoopRun, and during teardown we 964 // Teardown may start in PostMainMessageLoopRun, and during teardown we
965 // need to be able to perform IO. 965 // need to be able to perform IO.
966 base::ThreadRestrictions::SetIOAllowed(true); 966 base::ThreadRestrictions::SetIOAllowed(true);
967 BrowserThread::PostTask( 967 BrowserThread::PostTask(
968 BrowserThread::IO, FROM_HERE, 968 BrowserThread::IO, FROM_HERE,
969 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), 969 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed),
970 true)); 970 true));
971 971
972 if (IsRunningInMojoShell())
973 MojoShellConnection::Destroy();
974
975 if (RenderProcessHost::run_renderer_in_process()) 972 if (RenderProcessHost::run_renderer_in_process())
976 RenderProcessHostImpl::ShutDownInProcessRenderer(); 973 RenderProcessHostImpl::ShutDownInProcessRenderer();
977 974
978 if (parts_) { 975 if (parts_) {
979 TRACE_EVENT0("shutdown", 976 TRACE_EVENT0("shutdown",
980 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); 977 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun");
981 parts_->PostMainMessageLoopRun(); 978 parts_->PostMainMessageLoopRun();
982 } 979 }
983 980
981 if (IsRunningInMojoShell())
982 MojoShellConnection::Destroy();
983
984 #if defined(USE_AURA) 984 #if defined(USE_AURA)
985 env_.reset(); 985 env_.reset();
986 #endif 986 #endif
987 987
988 system_stats_monitor_.reset(); 988 system_stats_monitor_.reset();
989 989
990 // Destroying the GpuProcessHostUIShims on the UI thread posts a task to 990 // Destroying the GpuProcessHostUIShims on the UI thread posts a task to
991 // delete related objects on the GPU thread. This must be done before 991 // delete related objects on the GPU thread. This must be done before
992 // stopping the GPU thread. The GPU thread will close IPC channels to renderer 992 // stopping the GPU thread. The GPU thread will close IPC channels to renderer
993 // processes so this has to happen before stopping the IO thread. 993 // processes so this has to happen before stopping the IO thread.
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 DCHECK(is_tracing_startup_for_duration_); 1451 DCHECK(is_tracing_startup_for_duration_);
1452 1452
1453 is_tracing_startup_for_duration_ = false; 1453 is_tracing_startup_for_duration_ = false;
1454 TracingController::GetInstance()->StopTracing( 1454 TracingController::GetInstance()->StopTracing(
1455 TracingController::CreateFileSink( 1455 TracingController::CreateFileSink(
1456 startup_trace_file_, 1456 startup_trace_file_,
1457 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1457 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1458 } 1458 }
1459 1459
1460 } // namespace content 1460 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698