Skip to content

Commit

Permalink
Revert "Removing WebContents::GetRenderProcessHost() method."
Browse files Browse the repository at this point in the history
This reverts commit 4229f25.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 504862 as the
culprit for failures in the build cycles as shown on:
https://findit-for-me.appspot.com/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtLzQyMjlmMjVjMzQ3YWE2NGYwMWQ5MzJkZDIzODU2ZTQ0ZWFlNmQ3YTYM

Sample Failed Build: https://luci-milo.appspot.com/buildbot/chromium.win/Win%20x64%20Builder/38179

Original change's description:
> Removing WebContents::GetRenderProcessHost() method.
> 
> WebContents::GetRenderProcessHost is an API that doesn't behave as
> expected with out-of-process iframes, as multiple processes can be
> associated with a single WebContents.  This CL removes this API
> altogether.
> 
> This CL was started by using an ad-hoc clang-plugin that replaced
> existing callsites of WebContents::GetRenderProcessHost() with a call to
> something like wc->GetMainFrame()->GetProcess().  This was followed-up
> by manually adding an include of render_frame_host.h and git cl format
> and git cl lint and then a self-review with small tweaks (e.g. sometimes
> using a wc->GetRenderViewHost()->GetProcess() is more appropriate).
> 
> For the record, below is a list of existing bugs that have been
> uncovered or highlighted during the review of this CL:
> - https://crbug.com/715924: Headless OOPIF support
> - https://crbug.com/767519: Android WebView code duplication
> - https://crbug.com/767526: Handling of unresponsive renderers
> - https://crbug.com/767539: TabSpecificContentSettings
> - https://crbug.com/767557: ExtensionMsg_UpdateTabSpecificPermissions
> - https://crbug.com/767563: chrome.processes.getProcessIdForTab
> - https://crbug.com/769385: WebViewInternalAddContentScriptsFunction
> - https://crbug.com/769461: BrowserTag/WebView owner tracking
> - https://crbug.com/769479: PrintPreviewDialogController
> 
> Bug: 666525
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
> Change-Id: Idcb70a8c3928f0631a38a61b7029876fdaf921cb
> Tbr: alokp@chromium.org, boliu@chromium.org, derat@chromium.org, dvallet@chromium.org, haraken@chromium.org, lazyboy@chromium.org, lfg@chromium.org, raymes@chromium.org, rdsmith@chromium.org, tapted@chromium.org, tedchoc@chromium.org, thestig@chromium.org, treib@chromium.org
> Tbr: asvitkine@chromium.org, bartfab@chromium.org, bengr@chromium.org, benwells@chromium.org, dewittj@chromium.org, dsinclair@chromium.org, jkarlin@chromium.org, jsbell@chromium.org, meacer@chromium.org, mmenke@chromium.org, nparker@chromium.org, sergeyu@chromium.org, sky@chromium.org, stanisc@chromium.org, tommycli@chromium.org, wjmaclean@chromium.org
> Reviewed-on: https://chromium-review.googlesource.com/673124
> Reviewed-by: Justin DeWitt <dewittj@chromium.org>
> Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
> Reviewed-by: Stanislav Chiknavaryan <stanisc@chromium.org>
> Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
> Reviewed-by: Nathan Parker <nparker@chromium.org>
> Reviewed-by: David Vallet <dvallet@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Lucas Gadani <lfg@chromium.org>
> Reviewed-by: Bo <boliu@chromium.org>
> Reviewed-by: Dan Erat <derat@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Nick Carter <nick@chromium.org>
> Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#504862}

Change-Id: I389fcfe03f5ed41366855d1340f767d89592408c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 666525
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Reviewed-on: https://chromium-review.googlesource.com/688759
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504868}
  • Loading branch information
Findit authored and Commit Bot committed Sep 28, 2017
1 parent 8eb07d3 commit 86f6ae0
Show file tree
Hide file tree
Showing 137 changed files with 611 additions and 903 deletions.
20 changes: 8 additions & 12 deletions android_webview/browser/aw_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,9 @@ AwContents::AwContents(std::unique_ptr<WebContents> web_contents)
browser_view_renderer_.RegisterWithWebContents(web_contents_.get());

CompositorID compositor_id;
if (web_contents_->GetRenderViewHost() &&
web_contents_->GetRenderViewHost()->GetProcess()) {
compositor_id.process_id =
web_contents_->GetRenderViewHost()->GetProcess()->GetID();
if (web_contents_->GetRenderProcessHost() &&
web_contents_->GetRenderViewHost()) {
compositor_id.process_id = web_contents_->GetRenderProcessHost()->GetID();
compositor_id.routing_id =
web_contents_->GetRenderViewHost()->GetRoutingID();
}
Expand Down Expand Up @@ -1213,9 +1212,7 @@ void AwContents::InsertVisualStateCallback(
jint AwContents::GetEffectivePriority(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj) {
switch (web_contents_->GetMainFrame()
->GetProcess()
->ComputeEffectiveImportance()) {
switch (web_contents_->GetRenderProcessHost()->ComputeEffectiveImportance()) {
case content::ChildProcessImportance::NORMAL:
return static_cast<jint>(RendererPriority::WAIVED);
case content::ChildProcessImportance::MODERATE:
Expand Down Expand Up @@ -1287,7 +1284,7 @@ void AwContents::GrantFileSchemeAccesstoChildProcess(
JNIEnv* env,
const JavaParamRef<jobject>& obj) {
content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
web_contents_->GetMainFrame()->GetProcess()->GetID(), url::kFileScheme);
web_contents_->GetRenderProcessHost()->GetID(), url::kFileScheme);
}

void AwContents::ResumeLoadingCreatedPopupWebContents(
Expand Down Expand Up @@ -1334,10 +1331,9 @@ void AwContents::DidDetachInterstitialPage() {
CompositorID compositor_id;
if (!web_contents_)
return;
if (web_contents_->GetRenderViewHost() &&
web_contents_->GetRenderViewHost()->GetProcess()) {
compositor_id.process_id =
web_contents_->GetRenderViewHost()->GetProcess()->GetID();
if (web_contents_->GetRenderProcessHost() &&
web_contents_->GetRenderViewHost()) {
compositor_id.process_id = web_contents_->GetRenderProcessHost()->GetID();
compositor_id.routing_id =
web_contents_->GetRenderViewHost()->GetRoutingID();
} else {
Expand Down
8 changes: 3 additions & 5 deletions android_webview/browser/state_serializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/restore_type.h"
#include "content/public/browser/web_contents.h"
Expand Down Expand Up @@ -107,10 +106,9 @@ bool RestoreFromPickle(base::PickleIterator* iterator,

if (controller.GetLastCommittedEntry()) {
// Set up the file access rights for the selected navigation entry.
// TODO(joth): https://crbug.com/767519: This is duplicated from
// chrome/.../session_restore.cc and should be shared e.g. in
// NavigationController.
const int id = web_contents->GetMainFrame()->GetProcess()->GetID();
// TODO(joth): This is duplicated from chrome/.../session_restore.cc and
// should be shared e.g. in NavigationController. http://crbug.com/68222
const int id = web_contents->GetRenderProcessHost()->GetID();
const content::PageState& page_state =
controller.GetLastCommittedEntry()->GetPageState();
const std::vector<base::FilePath>& file_paths =
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/download/download_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ void DownloadController::OnDangerousDownload(DownloadItem* item) {
void DownloadController::StartContextMenuDownload(
const ContextMenuParams& params, WebContents* web_contents, bool is_link,
const std::string& extra_headers) {
int process_id = web_contents->GetRenderViewHost()->GetProcess()->GetID();
int process_id = web_contents->GetRenderProcessHost()->GetID();
int routing_id = web_contents->GetRenderViewHost()->GetRoutingID();

const content::ResourceRequestInfo::WebContentsGetter& wc_getter(
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/tab_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ void TabAndroid::DestroyWebContents(JNIEnv* env,
// during shutdown. See https://codereview.chromium.org/146693011/
// and http://crbug.com/338709 for details.
content::RenderProcessHost* process =
web_contents()->GetMainFrame()->GetProcess();
web_contents()->GetRenderProcessHost();
if (process)
process->FastShutdownIfPossible(1, false);

Expand Down
5 changes: 2 additions & 3 deletions chrome/browser/android/tab_web_contents_delegate_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.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"
Expand Down Expand Up @@ -441,8 +440,8 @@ void OnRendererUnresponsive(JNIEnv* env,
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
DCHECK(!FindHungRendererInfoBar(infobar_service));
HungRendererInfoBarDelegate::Create(
infobar_service, web_contents->GetMainFrame()->GetProcess());
HungRendererInfoBarDelegate::Create(infobar_service,
web_contents->GetRenderProcessHost());
}

void OnRendererResponsive(JNIEnv* env,
Expand Down
4 changes: 1 addition & 3 deletions chrome/browser/apps/guest_view/app_view_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "components/guest_view/browser/guest_view_manager_factory.h"
#include "components/guest_view/browser/test_guest_view_manager.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_process_host_observer.h"
#include "content/public/common/content_features.h"
Expand Down Expand Up @@ -223,8 +222,7 @@ IN_PROC_BROWSER_TEST_P(AppViewTest, KillGuestWithInvalidInstanceID) {
extensions::AppWindowRegistry::Get(browser()->profile())
->GetCurrentAppWindowForApp(bad_app->id())
->web_contents()
->GetMainFrame()
->GetProcess();
->GetRenderProcessHost();

// Monitor |bad_app|'s RenderProcessHost for its exiting.
RenderProcessHostObserverForExit exit_observer(bad_app_render_process_host);
Expand Down
34 changes: 14 additions & 20 deletions chrome/browser/apps/guest_view/web_view_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
Expand Down Expand Up @@ -681,10 +680,8 @@ class WebViewTestBase : public extensions::PlatformAppBrowserTest {
guest_observer.Wait();
content::Source<content::NavigationController> source =
guest_observer.source();
EXPECT_TRUE(source->GetWebContents()
->GetMainFrame()
->GetProcess()
->IsForGuestsOnly());
EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()->
IsForGuestsOnly());

content::WebContents* guest_web_contents = source->GetWebContents();
return guest_web_contents;
Expand Down Expand Up @@ -721,8 +718,7 @@ class WebViewTestBase : public extensions::PlatformAppBrowserTest {
// Wait for interstitial page to be shown in guest.
content::WebContents* guest_web_contents =
GetGuestViewManager()->WaitForSingleGuestCreated();
ASSERT_TRUE(
guest_web_contents->GetMainFrame()->GetProcess()->IsForGuestsOnly());
ASSERT_TRUE(guest_web_contents->GetRenderProcessHost()->IsForGuestsOnly());
content::WaitForInterstitialAttach(guest_web_contents);
}

Expand Down Expand Up @@ -1670,10 +1666,8 @@ IN_PROC_BROWSER_TEST_P(WebViewTest, Shim_TestRemoveWebviewOnExit) {

content::Source<content::NavigationController> source =
guest_observer.source();
EXPECT_TRUE(source->GetWebContents()
->GetMainFrame()
->GetProcess()
->IsForGuestsOnly());
EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()->
IsForGuestsOnly());

ASSERT_TRUE(guest_loaded_listener.WaitUntilSatisfied());

Expand Down Expand Up @@ -2618,19 +2612,19 @@ IN_PROC_BROWSER_TEST_P(WebViewTest, DownloadPermission) {
// 1. Guest requests a download that its embedder denies.
EXPECT_TRUE(content::ExecuteScript(guest_web_contents,
"startDownload('download-link-1')"));
mock_delegate->WaitForCanDownload(false); // Expect to not allow.
mock_delegate->WaitForCanDownload(false); // Expect to not allow.
mock_delegate->Reset();

// 2. Guest requests a download that its embedder allows.
EXPECT_TRUE(content::ExecuteScript(guest_web_contents,
"startDownload('download-link-2')"));
mock_delegate->WaitForCanDownload(true); // Expect to allow.
mock_delegate->WaitForCanDownload(true); // Expect to allow.
mock_delegate->Reset();

// 3. Guest requests a download that its embedder ignores, this implies deny.
EXPECT_TRUE(content::ExecuteScript(guest_web_contents,
"startDownload('download-link-3')"));
mock_delegate->WaitForCanDownload(false); // Expect to not allow.
mock_delegate->WaitForCanDownload(false); // Expect to not allow.
completion_observer->WaitForFinished();
}

Expand Down Expand Up @@ -3237,7 +3231,7 @@ IN_PROC_BROWSER_TEST_P(
Profile* profile = browser()->profile();
int rules_registry_id =
extensions::WebViewGuest::GetOrGenerateRulesRegistryID(
guest->owner_web_contents()->GetMainFrame()->GetProcess()->GetID(),
guest->owner_web_contents()->GetRenderProcessHost()->GetID(),
guest->view_instance_id());

extensions::RulesRegistryService* registry_service =
Expand All @@ -3252,7 +3246,7 @@ IN_PROC_BROWSER_TEST_P(

// Kill the embedder's render process, so the webview will go as well.
base::Process process = base::Process::DeprecatedGetProcessFromHandle(
embedder_web_contents->GetMainFrame()->GetProcess()->GetHandle());
embedder_web_contents->GetRenderProcessHost()->GetHandle());
process.Terminate(0, false);
observer->WaitForEmbedderRenderProcessTerminate();

Expand All @@ -3274,7 +3268,7 @@ IN_PROC_BROWSER_TEST_P(WebViewTest, Shim_WebViewWebRequestRegistryHasNoCache) {
extensions::RulesRegistryService::Get(profile);
int rules_registry_id =
extensions::WebViewGuest::GetOrGenerateRulesRegistryID(
guest->owner_web_contents()->GetMainFrame()->GetProcess()->GetID(),
guest->owner_web_contents()->GetRenderProcessHost()->GetID(),
guest->view_instance_id());

// Get an existing registered rule for the guest.
Expand Down Expand Up @@ -3661,9 +3655,9 @@ class WebViewGuestScrollTest
}

private:
base::test::ScopedFeatureList scoped_feature_list_;

DISALLOW_COPY_AND_ASSIGN(WebViewGuestScrollTest);

base::test::ScopedFeatureList scoped_feature_list_;
};

class WebViewGuestScrollTouchTest : public WebViewGuestScrollTest {
Expand Down Expand Up @@ -3872,7 +3866,7 @@ IN_PROC_BROWSER_TEST_F(WebViewGuestTouchFocusTest,
gfx::Point point(10, 10);
FocusChangeWaiter focus_waiter(guest_contents, false);
SendRoutedTouchTapSequence(embedder_contents, point);
SendRoutedGestureTapSequence(embedder_contents, point);
SendRoutedGestureTapSequence(embedder_contents,point);
focus_waiter.WaitForFocusChange();
EXPECT_FALSE(IsWebContentsBrowserPluginFocused(guest_contents));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,8 @@ class WebViewInteractiveTestBase : public extensions::PlatformAppBrowserTest {
guest_observer.Wait();
content::Source<content::NavigationController> source =
guest_observer.source();
EXPECT_TRUE(source->GetWebContents()
->GetMainFrame()
->GetProcess()
->IsForGuestsOnly());
EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()->
IsForGuestsOnly());

guest_web_contents_ = source->GetWebContents();
embedder_web_contents_ =
Expand Down Expand Up @@ -1547,7 +1545,7 @@ IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, TextSelection) {
guest_web_contents()->GetRenderWidgetHostView();
ASSERT_TRUE(guest_rwhv);
std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText());
ASSERT_GE(selected_text.size(), 10u);
ASSERT_TRUE(selected_text.size() >= 10u);
ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10));
}

Expand All @@ -1566,7 +1564,7 @@ IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, WordLookup) {

auto guest_message_filter =
browser_client.GetTextInputClientMessageFilterForProcess(
guest_web_contents()->GetMainFrame()->GetProcess());
guest_web_contents()->GetRenderProcessHost());
ASSERT_TRUE(guest_message_filter);

// Lookup some string through context menu.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/web_contents_tester.h"
Expand All @@ -38,7 +37,7 @@ class BackgroundSyncPermissionContextTest
base::RunLoop run_loop;

const PermissionRequestID id(
web_contents()->GetMainFrame()->GetProcess()->GetID(),
web_contents()->GetRenderProcessHost()->GetID(),
web_contents()->GetMainFrame()->GetRoutingID(), -1 /* request_id */);
permission_context->RequestPermission(
web_contents(), id, url, false /* user_gesture */,
Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/chromeos/power/renderer_freezer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
Expand Down Expand Up @@ -155,7 +154,7 @@ void RendererFreezer::OnScreenLockStateChanged(chromeos::ScreenLocker* locker,
content::WebContents* web_contents = locker->delegate()->GetWebContents();
if (web_contents) {
delegate_->SetShouldFreezeRenderer(
web_contents->GetMainFrame()->GetProcess()->GetHandle(), false);
web_contents->GetRenderProcessHost()->GetHandle(), false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "chrome/browser/content_settings/tab_specific_content_settings.h"

#include <list>
#include <vector>

#include "base/command_line.h"
#include "base/lazy_instance.h"
Expand Down Expand Up @@ -742,7 +741,7 @@ void TabSpecificContentSettings::OnContentSettingChanged(
GetRendererContentSettingRules(map, &rules);

IPC::ChannelProxy* channel =
web_contents()->GetMainFrame()->GetProcess()->GetChannel();
web_contents()->GetRenderProcessHost()->GetChannel();
// channel might be NULL in tests.
if (channel) {
chrome::mojom::RendererConfigurationAssociatedPtr rc_interface;
Expand Down
6 changes: 2 additions & 4 deletions chrome/browser/crash_recovery_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, Reload) {
&title_after_crash));
EXPECT_NE(title_before_crash, title_after_crash);
ASSERT_TRUE(GetActiveWebContents()->GetMainFrame()->GetView()->IsShowing());
ASSERT_FALSE(GetActiveWebContents()
->GetMainFrame()
->GetProcess()
->IsProcessBackgrounded());
ASSERT_FALSE(
GetActiveWebContents()->GetRenderProcessHost()->IsProcessBackgrounded());
}

// Test that reload after a crash forces a cache revalidation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void ChromeDataUseAscriberService::DidStartNavigation(
content::BrowserThread::IO, FROM_HERE,
base::BindOnce(&ChromeDataUseAscriber::DidStartMainFrameNavigation,
base::Unretained(ascriber_), navigation_handle->GetURL(),
web_contents->GetMainFrame()->GetProcess()->GetID(),
web_contents->GetRenderProcessHost()->GetID(),
web_contents->GetMainFrame()->GetRoutingID(),
navigation_handle));
}
Expand All @@ -157,7 +157,7 @@ void ChromeDataUseAscriberService::ReadyToCommitNavigation(
base::BindOnce(&ChromeDataUseAscriber::ReadyToCommitMainFrameNavigation,
base::Unretained(ascriber_),
navigation_handle->GetGlobalRequestID(),
web_contents->GetMainFrame()->GetProcess()->GetID(),
web_contents->GetRenderProcessHost()->GetID(),
web_contents->GetMainFrame()->GetRoutingID()));
}

Expand All @@ -177,7 +177,7 @@ void ChromeDataUseAscriberService::DidFinishNavigation(
base::BindOnce(
&ChromeDataUseAscriber::DidFinishMainFrameNavigation,
base::Unretained(ascriber_),
web_contents->GetMainFrame()->GetProcess()->GetID(),
web_contents->GetRenderProcessHost()->GetID(),
web_contents->GetMainFrame()->GetRoutingID(),
navigation_handle->GetURL(), navigation_handle->IsSameDocument(),
navigation_handle->GetPageTransition(), base::TimeTicks::Now()));
Expand Down
5 changes: 1 addition & 4 deletions chrome/browser/download/save_package_file_picker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include <stddef.h>

#include <memory>

#include "base/bind.h"
#include "base/command_line.h"
#include "base/i18n/file_util_icu.h"
Expand All @@ -24,7 +22,6 @@
#include "components/prefs/pref_member.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/save_page_type.h"
#include "content/public/browser/web_contents.h"
Expand Down Expand Up @@ -135,7 +132,7 @@ SavePackageFilePicker::SavePackageFilePicker(
bool can_save_as_complete,
DownloadPrefs* download_prefs,
const content::SavePackagePathPickedCallback& callback)
: render_process_id_(web_contents->GetMainFrame()->GetProcess()->GetID()),
: render_process_id_(web_contents->GetRenderProcessHost()->GetID()),
can_save_as_complete_(can_save_as_complete),
download_prefs_(download_prefs),
callback_(callback) {
Expand Down
Loading

0 comments on commit 86f6ae0

Please sign in to comment.