Removing callers of the 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 replaces callers of this
API, so that they go through an equivalent API that explicitly selects
which frame's process is needed.
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).
This CL was uploaded by git cl split.
[email protected]
Bug: 666525
Change-Id: Iff2b7f18d4c593b10846eac3c8ec5a03a0b0ef6d
Reviewed-on: https://chromium-review.googlesource.com/689114
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Marc Treib <[email protected]>
Commit-Queue: Ćukasz Anforowicz <[email protected]>
Cr-Commit-Position: refs/heads/master@{#505408}
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 61e22be..74b7cb1 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -9,6 +9,8 @@
#include <memory>
#include <set>
+#include <string>
+#include <vector>
#include "base/callback_forward.h"
#include "base/files/file_path.h"
@@ -248,7 +250,7 @@
virtual RenderProcessHost* GetRenderProcessHost() const = 0;
// Returns the main frame for the currently active view.
- virtual RenderFrameHost* GetMainFrame() = 0;
+ virtual RenderFrameHost* GetMainFrame() const = 0;
// Returns the focused frame for the currently active view.
virtual RenderFrameHost* GetFocusedFrame() = 0;
@@ -740,8 +742,9 @@
// Returns true if the WebContents is responsible for displaying a subframe
// in a different process from its parent page.
- // TODO: this doesn't really belong here. With site isolation, this should be
- // removed since we can then embed iframes in different processes.
+ // TODO(lazyboy): https://crbug.com/542893: this doesn't really belong here.
+ // With site isolation, this should be removed since we can then embed iframes
+ // in different processes.
virtual bool IsSubframe() const = 0;
// Finds text on a page. |search_text| should not be empty.