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

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

Issue 1942273002: Crash on channel error in single-process mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « content/renderer/render_thread_impl.h ('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/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 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 1621
1622 std::unique_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory( 1622 std::unique_ptr<base::SharedMemory> RenderThreadImpl::AllocateSharedMemory(
1623 size_t size) { 1623 size_t size) {
1624 return HostAllocateSharedMemoryBuffer(size); 1624 return HostAllocateSharedMemoryBuffer(size);
1625 } 1625 }
1626 1626
1627 void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() { 1627 void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() {
1628 notify_webkit_of_modal_loop_ = false; 1628 notify_webkit_of_modal_loop_ = false;
1629 } 1629 }
1630 1630
1631 void RenderThreadImpl::OnChannelError() {
1632 // In single-process mode, the renderer can't be restarted after shutdown.
1633 // So, if we get a channel error, crash the whole process right now to get a
1634 // more informative stack, since we will otherwise just crash later when we
1635 // try to restart it.
1636 CHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(
1637 switches::kSingleProcess));
1638 ChildThreadImpl::OnChannelError();
1639 }
1640
1631 bool RenderThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { 1641 bool RenderThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
1632 base::ObserverListBase<RenderThreadObserver>::Iterator it(&observers_); 1642 base::ObserverListBase<RenderThreadObserver>::Iterator it(&observers_);
1633 RenderThreadObserver* observer; 1643 RenderThreadObserver* observer;
1634 while ((observer = it.GetNext()) != NULL) { 1644 while ((observer = it.GetNext()) != NULL) {
1635 if (observer->OnControlMessageReceived(msg)) 1645 if (observer->OnControlMessageReceived(msg))
1636 return true; 1646 return true;
1637 } 1647 }
1638 1648
1639 // Some messages are handled by delegates. 1649 // Some messages are handled by delegates.
1640 if (appcache_dispatcher_->OnMessageReceived(msg) || 1650 if (appcache_dispatcher_->OnMessageReceived(msg) ||
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2050 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2060 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2051 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2061 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2052 2062
2053 blink::mainThreadIsolate()->MemoryPressureNotification( 2063 blink::mainThreadIsolate()->MemoryPressureNotification(
2054 v8_memory_pressure_level); 2064 v8_memory_pressure_level);
2055 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2065 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2056 v8_memory_pressure_level); 2066 v8_memory_pressure_level);
2057 } 2067 }
2058 2068
2059 } // namespace content 2069 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698