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

Unified Diff: content/shell/browser/layout_test/blink_test_controller.cc

Issue 2527133002: Remove some WebContents::GetRenderViewHost() calls. (Closed)
Patch Set: More reverts for the same reason as patch set 3, fixes merge conflict Created 4 years 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/shell/browser/layout_test/blink_test_controller.cc
diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc
index a2f531ae5cd1e4853f1675e6d3743f1b2abe2698..5b585a76259c9b69f1b96fb8643f71d929fbee11 100644
--- a/content/shell/browser/layout_test/blink_test_controller.cc
+++ b/content/shell/browser/layout_test/blink_test_controller.cc
@@ -826,20 +826,18 @@ void BlinkTestController::OnCaptureSessionHistory() {
std::vector<std::vector<PageState> > session_histories;
std::vector<unsigned> current_entry_indexes;
- RenderViewHost* render_view_host =
- main_window_->web_contents()->GetRenderViewHost();
+ RenderFrameHost* render_frame_host =
+ main_window_->web_contents()->GetMainFrame();
- for (std::vector<Shell*>::iterator window = Shell::windows().begin();
- window != Shell::windows().end();
- ++window) {
- WebContents* web_contents = (*window)->web_contents();
+ for (auto* window : Shell::windows()) {
+ WebContents* web_contents = window->web_contents();
// Only capture the history from windows in the same process as the main
// window. During layout tests, we only use two processes when an
// devtools window is open.
- if (render_view_host->GetProcess() !=
- web_contents->GetRenderViewHost()->GetProcess()) {
+ auto* process = web_contents->GetMainFrame()->GetProcess();
+ if (render_frame_host->GetProcess() != process)
continue;
- }
+
routing_ids.push_back(web_contents->GetRenderViewHost()->GetRoutingID());
current_entry_indexes.push_back(
web_contents->GetController().GetCurrentEntryIndex());
@@ -857,6 +855,8 @@ void BlinkTestController::OnCaptureSessionHistory() {
session_histories.push_back(history);
}
+ RenderViewHost* render_view_host =
+ main_window_->web_contents()->GetRenderViewHost();
Send(new ShellViewMsg_SessionHistory(render_view_host->GetRoutingID(),
routing_ids,
session_histories,
« no previous file with comments | « content/browser/security_exploit_browsertest.cc ('k') | extensions/browser/api/alarms/alarms_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698