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

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

Issue 2038633002: Renderers should immediately exit on failure to send an IPC to the browser. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 } 967 }
968 } 968 }
969 969
970 if (pumping_events) { 970 if (pumping_events) {
971 renderer_scheduler_->SuspendTimerQueue(); 971 renderer_scheduler_->SuspendTimerQueue();
972 WebView::willEnterModalLoop(); 972 WebView::willEnterModalLoop();
973 } 973 }
974 974
975 bool rv = ChildThreadImpl::Send(msg); 975 bool rv = ChildThreadImpl::Send(msg);
976 976
977 // In the fast shutdown path, the browser kills the IPC channel without
978 // informing the renderer. This means that any IPC message might fail. Either
979 // every sender of any IPC message needs to gracefully handle failures, or
980 // else the process needs to exit immediately. Since the renderer is no longer
981 // expected to have any user-visible effects, or make any persistent changes,
982 // exit immediately. https://crbug.com/615121.
983 if (!rv)
984 exit(EXIT_SUCCESS);
jam 2016/06/06 20:25:52 seems like this should match exit(0) in SuicideOnC
985
977 if (pumping_events) { 986 if (pumping_events) {
978 WebView::didExitModalLoop(); 987 WebView::didExitModalLoop();
979 renderer_scheduler_->ResumeTimerQueue(); 988 renderer_scheduler_->ResumeTimerQueue();
980 } 989 }
981 990
982 return rv; 991 return rv;
983 } 992 }
984 993
985 IPC::SyncChannel* RenderThreadImpl::GetChannel() { 994 IPC::SyncChannel* RenderThreadImpl::GetChannel() {
986 return channel(); 995 return channel();
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2091 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2100 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2092 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2101 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2093 2102
2094 blink::mainThreadIsolate()->MemoryPressureNotification( 2103 blink::mainThreadIsolate()->MemoryPressureNotification(
2095 v8_memory_pressure_level); 2104 v8_memory_pressure_level);
2096 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2105 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2097 v8_memory_pressure_level); 2106 v8_memory_pressure_level);
2098 } 2107 }
2099 2108
2100 } // namespace content 2109 } // 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