OOPIF: Fix CapturePageInfo to only operate on local main frames.
This logic will need to move to the browser process to capture text
from frames that live in other processes.
BUG=346764
TEST=Navigate in an out-of-process iframe and wait 10 seconds.
Review URL: https://codereview.chromium.org/645803002
Cr-Commit-Position: refs/heads/master@{#299138}
diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc
index 38aaae9f..a2e1b9a 100644
--- a/chrome/renderer/chrome_render_view_observer.cc
+++ b/chrome/renderer/chrome_render_view_observer.cc
@@ -381,6 +381,13 @@
if (!main_frame)
return;
+ // TODO(creis): Refactor WebFrame::contentAsText to handle RemoteFrames,
+ // likely by moving it to the browser process. For now, only capture page
+ // info from main frames that are LocalFrames, and ignore their RemoteFrame
+ // children.
+ if (main_frame->isWebRemoteFrame())
+ return;
+
// Don't index/capture pages that are in view source mode.
if (main_frame->isViewSourceModeEnabled())
return;