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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2693353002: WIP shutdown handler for better stats dumping (Closed)
Patch Set: use DumpAndResetStats Created 3 years, 9 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 | « no previous file | 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/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 901
902 RenderThreadImpl::~RenderThreadImpl() { 902 RenderThreadImpl::~RenderThreadImpl() {
903 } 903 }
904 904
905 void RenderThreadImpl::Shutdown() { 905 void RenderThreadImpl::Shutdown() {
906 // In a multi-process mode, we immediately exit the renderer. 906 // In a multi-process mode, we immediately exit the renderer.
907 // Historically we had a graceful shutdown sequence here but it was 907 // Historically we had a graceful shutdown sequence here but it was
908 // 1) a waste of performance and 2) a source of lots of complicated 908 // 1) a waste of performance and 2) a source of lots of complicated
909 // crashes caused by shutdown ordering. Immediate exit eliminates 909 // crashes caused by shutdown ordering. Immediate exit eliminates
910 // those problems. 910 // those problems.
911 // 911
912 // Give the V8 isolate a chance to dump internal stats useful for performance
913 // evaluation and debugging.
914 blink::mainThreadIsolate()->DumpAndResetStats();
915
912 // In a single-process mode, we cannot call _exit(0) in Shutdown() because 916 // In a single-process mode, we cannot call _exit(0) in Shutdown() because
913 // it will exit the process before the browser side is ready to exit. 917 // it will exit the process before the browser side is ready to exit.
914 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 918 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
915 switches::kSingleProcess)) 919 switches::kSingleProcess))
916 base::Process::TerminateCurrentProcessImmediately(0); 920 base::Process::TerminateCurrentProcessImmediately(0);
917 } 921 }
918 922
919 bool RenderThreadImpl::ShouldBeDestroyed() { 923 bool RenderThreadImpl::ShouldBeDestroyed() {
920 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 924 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
921 switches::kSingleProcess)); 925 switches::kSingleProcess));
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 } 2384 }
2381 } 2385 }
2382 2386
2383 void RenderThreadImpl::OnRendererInterfaceRequest( 2387 void RenderThreadImpl::OnRendererInterfaceRequest(
2384 mojom::RendererAssociatedRequest request) { 2388 mojom::RendererAssociatedRequest request) {
2385 DCHECK(!renderer_binding_.is_bound()); 2389 DCHECK(!renderer_binding_.is_bound());
2386 renderer_binding_.Bind(std::move(request)); 2390 renderer_binding_.Bind(std::move(request));
2387 } 2391 }
2388 2392
2389 } // namespace content 2393 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698