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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 305103003: Fix for 'Simple Adblock' extension crashes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderProcessHost can be a mock in unittests Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 5a310de48e30e8062fb2ba8c2e7eef80ad228a05..04437368cb2532149ae042ba337d8fcd29b290b2 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1315,6 +1315,7 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction,
OnUserMetricsRecordAction)
IPC_MESSAGE_HANDLER(ViewHostMsg_SavedPageAsMHTML, OnSavedPageAsMHTML)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK)
// Adding single handlers for your service here is fine, but once your
// service needs more than one handler, please extract them into a new
// message filter and add that filter to CreateMessageFilters().
@@ -1446,6 +1447,7 @@ void RenderProcessHostImpl::Cleanup() {
gpu_message_filter_ = NULL;
message_port_message_filter_ = NULL;
screen_orientation_dispatcher_host_ = NULL;
+ session_storage_namespaces_awaiting_close_.clear();
// Remove ourself from the list of renderer processes so that we can't be
// reused in between now and when the Delete task runs.
@@ -1835,6 +1837,7 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead) {
gpu_message_filter_ = NULL;
message_port_message_filter_ = NULL;
screen_orientation_dispatcher_host_ = NULL;
+ session_storage_namespaces_awaiting_close_.clear();
IDMap<IPC::Listener>::iterator iter(&listeners_);
while (!iter.IsAtEnd()) {
@@ -1903,6 +1906,12 @@ RenderProcessHostImpl::screen_orientation_dispatcher_host() const {
return make_scoped_refptr(screen_orientation_dispatcher_host_);
}
+void RenderProcessHostImpl::ReleaseOnCloseAck(
+ const SessionStorageNamespaceMap& sessions,
+ int view_route_id) {
+ session_storage_namespaces_awaiting_close_[view_route_id] = sessions;
+}
+
void RenderProcessHostImpl::OnShutdownRequest() {
// Don't shut down if there are active RenderViews, or if there are pending
// RenderViews being swapped back in.
@@ -2006,6 +2015,10 @@ void RenderProcessHostImpl::OnUserMetricsRecordAction(
RecordComputedAction(action);
}
+void RenderProcessHostImpl::OnCloseACK(int old_route_id) {
+ session_storage_namespaces_awaiting_close_.erase(old_route_id);
+}
+
void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) {
MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size);
}

Powered by Google App Engine
This is Rietveld 408576698