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

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: Fix nit. 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
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 1333
1334 // Execute any pending AX tree snapshot callbacks with an empty response, 1334 // Execute any pending AX tree snapshot callbacks with an empty response,
1335 // since we're never going to get a response from this renderer. 1335 // since we're never going to get a response from this renderer.
1336 for (const auto& iter : ax_tree_snapshot_callbacks_) 1336 for (const auto& iter : ax_tree_snapshot_callbacks_)
1337 iter.second.Run(ui::AXTreeUpdate()); 1337 iter.second.Run(ui::AXTreeUpdate());
1338 ax_tree_snapshot_callbacks_.clear(); 1338 ax_tree_snapshot_callbacks_.clear();
1339 1339
1340 // If the process has died, we don't need to wait for the swap out ack from 1340 // If the process has died, we don't need to wait for the swap out ack from
1341 // this RenderFrame if it is pending deletion. Complete the swap out to 1341 // this RenderFrame if it is pending deletion. Complete the swap out to
1342 // destroy it. 1342 // destroy it.
1343 if (frame_tree_node_->render_manager()->IsPendingDeletion(this)) 1343 if (!IsRFHStateActive(rfh_state()))
1344 OnSwappedOut(); 1344 OnSwappedOut();
1345 1345
1346 // Note: don't add any more code at this point in the function because 1346 // Note: don't add any more code at this point in the function because
1347 // |this| may be deleted. Any additional cleanup should happen before 1347 // |this| may be deleted. Any additional cleanup should happen before
1348 // the last block of code here. 1348 // the last block of code here.
1349 } 1349 }
1350 1350
1351 void RenderFrameHostImpl::OnSwappedOut() { 1351 void RenderFrameHostImpl::OnSwappedOut() {
1352 // Ignore spurious swap out ack. 1352 // Ignore spurious swap out ack.
1353 if (rfh_state_ != STATE_PENDING_SWAP_OUT) 1353 if (rfh_state_ != STATE_PENDING_SWAP_OUT)
1354 return; 1354 return;
1355 1355
1356 TRACE_EVENT_ASYNC_END0("navigation", "RenderFrameHostImpl::SwapOut", this); 1356 TRACE_EVENT_ASYNC_END0("navigation", "RenderFrameHostImpl::SwapOut", this);
1357 swapout_event_monitor_timeout_->Stop(); 1357 swapout_event_monitor_timeout_->Stop();
1358 1358
1359 ClearAllWebUI(); 1359 ClearAllWebUI();
1360 1360
1361 // If this is a main frame RFH that's about to be deleted, update its RVH's 1361 // If this is a main frame RFH that's about to be deleted, update its RVH's
1362 // swapped-out state here, since SetState won't be called once this RFH is 1362 // swapped-out state here, since SetState won't be called once this RFH is
1363 // deleted below. https://crbug.com/505887 1363 // deleted below. https://crbug.com/505887
1364 if (frame_tree_node_->IsMainFrame() && 1364 if (frame_tree_node_->IsMainFrame()) {
1365 frame_tree_node_->render_manager()->IsPendingDeletion(this)) {
1366 render_view_host_->set_is_active(false); 1365 render_view_host_->set_is_active(false);
1367 render_view_host_->set_is_swapped_out(true); 1366 render_view_host_->set_is_swapped_out(true);
1368 } 1367 }
1369 1368
1370 bool deleted = 1369 bool deleted =
1371 frame_tree_node_->render_manager()->DeleteFromPendingList(this); 1370 frame_tree_node_->render_manager()->DeleteFromPendingList(this);
1372 CHECK(deleted); 1371 CHECK(deleted);
1373 } 1372 }
1374 1373
1375 void RenderFrameHostImpl::ResetSwapOutTimerForTesting() { 1374 void RenderFrameHostImpl::ResetSwapOutTimerForTesting() {
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 } 2743 }
2745 2744
2746 void RenderFrameHostImpl::CreateWebBluetoothService( 2745 void RenderFrameHostImpl::CreateWebBluetoothService(
2747 blink::mojom::WebBluetoothServiceRequest request) { 2746 blink::mojom::WebBluetoothServiceRequest request) {
2748 DCHECK(!web_bluetooth_service_); 2747 DCHECK(!web_bluetooth_service_);
2749 web_bluetooth_service_.reset( 2748 web_bluetooth_service_.reset(
2750 new WebBluetoothServiceImpl(this, std::move(request))); 2749 new WebBluetoothServiceImpl(this, std::move(request)));
2751 } 2750 }
2752 2751
2753 } // namespace content 2752 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698