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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2041993002: WebUI: Fix lifecycle-bug when RenderFrameHost is swapped out (Closed) 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 1264
1265 set_render_frame_proxy_host(proxy); 1265 set_render_frame_proxy_host(proxy);
1266 1266
1267 if (IsRenderFrameLive()) { 1267 if (IsRenderFrameLive()) {
1268 FrameReplicationState replication_state = 1268 FrameReplicationState replication_state =
1269 proxy->frame_tree_node()->current_replication_state(); 1269 proxy->frame_tree_node()->current_replication_state();
1270 Send(new FrameMsg_SwapOut(routing_id_, proxy->GetRoutingID(), is_loading, 1270 Send(new FrameMsg_SwapOut(routing_id_, proxy->GetRoutingID(), is_loading,
1271 replication_state)); 1271 replication_state));
1272 } 1272 }
1273 1273
1274 if (web_ui())
1275 web_ui()->RenderFrameHostSwappingOut();
1276
1274 // TODO(nasko): If the frame is not live, the RFH should just be deleted by 1277 // TODO(nasko): If the frame is not live, the RFH should just be deleted by
1275 // simulating the receipt of swap out ack. 1278 // simulating the receipt of swap out ack.
1276 is_waiting_for_swapout_ack_ = true; 1279 is_waiting_for_swapout_ack_ = true;
1277 if (frame_tree_node_->IsMainFrame()) 1280 if (frame_tree_node_->IsMainFrame())
1278 render_view_host_->set_is_active(false); 1281 render_view_host_->set_is_active(false);
1279 } 1282 }
1280 1283
1281 void RenderFrameHostImpl::OnBeforeUnloadACK( 1284 void RenderFrameHostImpl::OnBeforeUnloadACK(
1282 bool proceed, 1285 bool proceed,
1283 const base::TimeTicks& renderer_before_unload_start_time, 1286 const base::TimeTicks& renderer_before_unload_start_time,
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2861 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2859 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2862 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2860 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2863 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2861 } 2864 }
2862 2865
2863 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2866 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2864 web_bluetooth_service_.reset(); 2867 web_bluetooth_service_.reset();
2865 } 2868 }
2866 2869
2867 } // namespace content 2870 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698