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

Side by Side Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 645803002: OOPIF: Fix CapturePageInfo to only operate on local main frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/chrome_render_view_observer.h" 5 #include "chrome/renderer/chrome_render_view_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 374 }
375 375
376 void ChromeRenderViewObserver::CapturePageInfo(bool preliminary_capture) { 376 void ChromeRenderViewObserver::CapturePageInfo(bool preliminary_capture) {
377 if (!render_view()->GetWebView()) 377 if (!render_view()->GetWebView())
378 return; 378 return;
379 379
380 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); 380 WebFrame* main_frame = render_view()->GetWebView()->mainFrame();
381 if (!main_frame) 381 if (!main_frame)
382 return; 382 return;
383 383
384 // TODO(creis): Refactor WebFrame::contentAsText to handle RemoteFrames,
385 // likely by moving it to the browser process. For now, only capture page
386 // info from main frames that are LocalFrames, and ignore their RemoteFrame
387 // children.
388 if (main_frame->isWebRemoteFrame())
389 return;
390
384 // Don't index/capture pages that are in view source mode. 391 // Don't index/capture pages that are in view source mode.
385 if (main_frame->isViewSourceModeEnabled()) 392 if (main_frame->isViewSourceModeEnabled())
386 return; 393 return;
387 394
388 // Don't index/capture pages that failed to load. This only checks the top 395 // Don't index/capture pages that failed to load. This only checks the top
389 // level frame so the thumbnail may contain a frame that failed to load. 396 // level frame so the thumbnail may contain a frame that failed to load.
390 WebDataSource* ds = main_frame->dataSource(); 397 WebDataSource* ds = main_frame->dataSource();
391 if (ds && ds->hasUnreachableURL()) 398 if (ds && ds->hasUnreachableURL())
392 return; 399 return;
393 400
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 WebElement element = node.to<WebElement>(); 472 WebElement element = node.to<WebElement>();
466 if (!element.hasHTMLTagName(tag_name)) 473 if (!element.hasHTMLTagName(tag_name))
467 continue; 474 continue;
468 WebString value = element.getAttribute(attribute_name); 475 WebString value = element.getAttribute(attribute_name);
469 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) 476 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh"))
470 continue; 477 continue;
471 return true; 478 return true;
472 } 479 }
473 return false; 480 return false;
474 } 481 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698