diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index b15a160bd1d9..21b8024f2966 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -1041,7 +1041,7 @@ void WebContents::NavigationEntryCommitted( } int64_t WebContents::GetIDForContents(content::WebContents* web_contents) { - int64_t process_id = web_contents->GetRenderProcessHost()->GetID(); + int64_t process_id = web_contents->GetMainFrame()->GetProcess()->GetID(); int64_t routing_id = web_contents->GetMainFrame()->GetRoutingID(); int64_t rv = (process_id << 32) + routing_id; return rv; @@ -1052,11 +1052,12 @@ int64_t WebContents::GetID() const { } int WebContents::GetProcessID() const { - return web_contents()->GetRenderProcessHost()->GetID(); + return web_contents()->GetMainFrame()->GetProcess()->GetID(); } base::ProcessId WebContents::GetOSProcessID() const { - auto process_handle = web_contents()->GetRenderProcessHost()->GetHandle(); + auto process_handle = + web_contents()->GetMainFrame()->GetProcess()->GetHandle(); return base::GetProcId(process_handle); } diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 0a4d1a5fdbc6..bc8b0f27bda9 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -97,7 +97,7 @@ content::WebContents* WebContentsPreferences::GetWebContentsFromProcessID( int process_id) { for (WebContentsPreferences* preferences : instances_) { content::WebContents* web_contents = preferences->web_contents_; - if (web_contents->GetRenderProcessHost()->GetID() == process_id) + if (web_contents->GetMainFrame()->GetProcess()->GetID() == process_id) return web_contents; } return nullptr; diff --git a/atom/browser/web_contents_zoom_controller.cc b/atom/browser/web_contents_zoom_controller.cc index 3c8d512b6bb4..82618e3696b8 100644 --- a/atom/browser/web_contents_zoom_controller.cc +++ b/atom/browser/web_contents_zoom_controller.cc @@ -7,6 +7,7 @@ #include "content/public/browser/navigation_details.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_handle.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" @@ -53,7 +54,8 @@ void WebContentsZoomController::SetZoomLevel(double level) { zoom_mode_ == ZOOM_MODE_DISABLED) return; - int render_process_id = web_contents()->GetRenderProcessHost()->GetID(); + int render_process_id = + web_contents()->GetRenderViewHost()->GetProcess()->GetID(); int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); if (zoom_mode_ == ZOOM_MODE_MANUAL) { @@ -98,7 +100,7 @@ double WebContentsZoomController::GetDefaultZoomFactor() { } void WebContentsZoomController::SetTemporaryZoomLevel(double level) { - old_process_id_ = web_contents()->GetRenderProcessHost()->GetID(); + old_process_id_ = web_contents()->GetRenderViewHost()->GetProcess()->GetID(); old_view_id_ = web_contents()->GetRenderViewHost()->GetRoutingID(); host_zoom_map_->SetTemporaryZoomLevel(old_process_id_, old_view_id_, level); // Notify observers of zoom level changes. @@ -107,7 +109,8 @@ void WebContentsZoomController::SetTemporaryZoomLevel(double level) { } bool WebContentsZoomController::UsesTemporaryZoomLevel() { - int render_process_id = web_contents()->GetRenderProcessHost()->GetID(); + int render_process_id = + web_contents()->GetRenderViewHost()->GetProcess()->GetID(); int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); return host_zoom_map_->UsesTemporaryZoomLevel(render_process_id, render_view_id); @@ -120,7 +123,8 @@ void WebContentsZoomController::SetZoomMode(ZoomMode new_mode) { content::HostZoomMap* zoom_map = content::HostZoomMap::GetForWebContents(web_contents()); - int render_process_id = web_contents()->GetRenderProcessHost()->GetID(); + int render_process_id = + web_contents()->GetRenderViewHost()->GetProcess()->GetID(); int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); double original_zoom_level = GetZoomLevel(); @@ -203,7 +207,8 @@ void WebContentsZoomController::ResetZoomModeOnNavigationIfNeeded( if (zoom_mode_ != ZOOM_MODE_ISOLATED && zoom_mode_ != ZOOM_MODE_MANUAL) return; - int render_process_id = web_contents()->GetRenderProcessHost()->GetID(); + int render_process_id = + web_contents()->GetRenderViewHost()->GetProcess()->GetID(); int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); content::HostZoomMap* zoom_map = content::HostZoomMap::GetForWebContents(web_contents()); diff --git a/atom/browser/web_view_manager.cc b/atom/browser/web_view_manager.cc index 96201b994ce8..ce63d6e4412b 100644 --- a/atom/browser/web_view_manager.cc +++ b/atom/browser/web_view_manager.cc @@ -5,6 +5,7 @@ #include "atom/browser/web_view_manager.h" #include "atom/browser/atom_browser_context.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" @@ -23,7 +24,7 @@ void WebViewManager::AddGuest(int guest_instance_id, web_contents_embedder_map_[guest_instance_id] = { web_contents, embedder }; // Map the element in embedder to guest. - int owner_process_id = embedder->GetRenderProcessHost()->GetID(); + int owner_process_id = embedder->GetMainFrame()->GetProcess()->GetID(); ElementInstanceKey key(owner_process_id, element_instance_id); element_instance_id_to_guest_map_[key] = guest_instance_id; }