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

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

Issue 1851253002: Remove RFHM::IsPendingDeletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on ToT. Created 4 years, 8 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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 1347
1348 // Execute any pending AX tree snapshot callbacks with an empty response, 1348 // Execute any pending AX tree snapshot callbacks with an empty response,
1349 // since we're never going to get a response from this renderer. 1349 // since we're never going to get a response from this renderer.
1350 for (const auto& iter : ax_tree_snapshot_callbacks_) 1350 for (const auto& iter : ax_tree_snapshot_callbacks_)
1351 iter.second.Run(ui::AXTreeUpdate()); 1351 iter.second.Run(ui::AXTreeUpdate());
1352 ax_tree_snapshot_callbacks_.clear(); 1352 ax_tree_snapshot_callbacks_.clear();
1353 1353
1354 // If the process has died, we don't need to wait for the swap out ack from 1354 // If the process has died, we don't need to wait for the swap out ack from
1355 // this RenderFrame if it is pending deletion. Complete the swap out to 1355 // this RenderFrame if it is pending deletion. Complete the swap out to
1356 // destroy it. 1356 // destroy it.
1357 if (frame_tree_node_->render_manager()->IsPendingDeletion(this)) 1357 if (frame_tree_node_->render_manager()->IsPendingDeletion(this))
alexmos 2016/04/04 18:53:57 Doesn't this need to be updated too?
nasko 2016/04/05 23:49:39 Argh! I didn't update my latest code to the review
1358 OnSwappedOut(); 1358 OnSwappedOut();
1359 1359
1360 // Note: don't add any more code at this point in the function because 1360 // Note: don't add any more code at this point in the function because
1361 // |this| may be deleted. Any additional cleanup should happen before 1361 // |this| may be deleted. Any additional cleanup should happen before
1362 // the last block of code here. 1362 // the last block of code here.
1363 } 1363 }
1364 1364
1365 void RenderFrameHostImpl::OnSwappedOut() { 1365 void RenderFrameHostImpl::OnSwappedOut() {
1366 // Ignore spurious swap out ack. 1366 // Ignore spurious swap out ack.
1367 if (rfh_state_ != STATE_PENDING_SWAP_OUT) 1367 if (rfh_state_ != STATE_PENDING_SWAP_OUT)
1368 return; 1368 return;
1369 1369
1370 TRACE_EVENT_ASYNC_END0("navigation", "RenderFrameHostImpl::SwapOut", this); 1370 TRACE_EVENT_ASYNC_END0("navigation", "RenderFrameHostImpl::SwapOut", this);
1371 swapout_event_monitor_timeout_->Stop(); 1371 swapout_event_monitor_timeout_->Stop();
1372 1372
1373 ClearAllWebUI(); 1373 ClearAllWebUI();
1374 1374
1375 // If this is a main frame RFH that's about to be deleted, update its RVH's 1375 // If this is a main frame RFH that's about to be deleted, update its RVH's
1376 // swapped-out state here, since SetState won't be called once this RFH is 1376 // swapped-out state here, since SetState won't be called once this RFH is
1377 // deleted below. https://crbug.com/505887 1377 // deleted below. https://crbug.com/505887
1378 if (frame_tree_node_->IsMainFrame() && 1378 if (frame_tree_node_->IsMainFrame()) {
1379 frame_tree_node_->render_manager()->IsPendingDeletion(this)) {
1380 render_view_host_->set_is_active(false); 1379 render_view_host_->set_is_active(false);
1381 render_view_host_->set_is_swapped_out(true); 1380 render_view_host_->set_is_swapped_out(true);
1382 } 1381 }
1383 1382
1384 bool deleted = 1383 bool deleted =
1385 frame_tree_node_->render_manager()->DeleteFromPendingList(this); 1384 frame_tree_node_->render_manager()->DeleteFromPendingList(this);
1386 CHECK(deleted); 1385 CHECK(deleted);
1387 } 1386 }
1388 1387
1389 void RenderFrameHostImpl::ResetSwapOutTimerForTesting() { 1388 void RenderFrameHostImpl::ResetSwapOutTimerForTesting() {
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 } 2757 }
2759 2758
2760 void RenderFrameHostImpl::CreateWebBluetoothService( 2759 void RenderFrameHostImpl::CreateWebBluetoothService(
2761 blink::mojom::WebBluetoothServiceRequest request) { 2760 blink::mojom::WebBluetoothServiceRequest request) {
2762 DCHECK(!web_bluetooth_service_); 2761 DCHECK(!web_bluetooth_service_);
2763 web_bluetooth_service_.reset( 2762 web_bluetooth_service_.reset(
2764 new WebBluetoothServiceImpl(this, std::move(request))); 2763 new WebBluetoothServiceImpl(this, std::move(request)));
2765 } 2764 }
2766 2765
2767 } // namespace content 2766 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698