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

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 8372036: Ensure forced process swaps use the correct page_id and SiteInstance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/tab_contents/tab_contents.h" 5 #include "content/browser/tab_contents/tab_contents.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 } 568 }
569 return NULL; 569 return NULL;
570 } 570 }
571 571
572 bool TabContents::NavigateToPendingEntry( 572 bool TabContents::NavigateToPendingEntry(
573 NavigationController::ReloadType reload_type) { 573 NavigationController::ReloadType reload_type) {
574 return NavigateToEntry(*controller_.pending_entry(), reload_type); 574 return NavigateToEntry(*controller_.pending_entry(), reload_type);
575 } 575 }
576 576
577 bool TabContents::NavigateToEntry( 577 bool TabContents::NavigateToEntry(
578 const NavigationEntry& entry, 578 NavigationEntry& entry,
jam 2011/11/01 19:14:33 this is against the google style guide, so you wil
Charlie Reis 2011/11/01 19:16:27 Will do.
Charlie Reis 2011/11/01 19:25:45 Done.
579 NavigationController::ReloadType reload_type) { 579 NavigationController::ReloadType reload_type) {
580 // The renderer will reject IPC messages with URLs longer than 580 // The renderer will reject IPC messages with URLs longer than
581 // this limit, so don't attempt to navigate with a longer URL. 581 // this limit, so don't attempt to navigate with a longer URL.
582 if (entry.url().spec().size() > content::kMaxURLChars) 582 if (entry.url().spec().size() > content::kMaxURLChars)
583 return false; 583 return false;
584 584
585 RenderViewHost* dest_render_view_host = render_manager_.Navigate(entry); 585 RenderViewHost* dest_render_view_host = render_manager_.Navigate(entry);
586 if (!dest_render_view_host) 586 if (!dest_render_view_host)
587 return false; // Unable to create the desired render view host. 587 return false; // Unable to create the desired render view host.
588 588
589 // If we were forced to swap the entry's existing SiteInstance, we need to
590 // update it before the navigation begins so that we can find it when the
591 // navigation commits.
592 if (entry.site_instance() &&
593 entry.site_instance() != dest_render_view_host->site_instance())
594 entry.set_site_instance(dest_render_view_host->site_instance());
595
589 // For security, we should never send non-Web-UI URLs to a Web UI renderer. 596 // For security, we should never send non-Web-UI URLs to a Web UI renderer.
590 // Double check that here. 597 // Double check that here.
591 int enabled_bindings = dest_render_view_host->enabled_bindings(); 598 int enabled_bindings = dest_render_view_host->enabled_bindings();
592 bool is_allowed_in_web_ui_renderer = content::GetContentClient()-> 599 bool is_allowed_in_web_ui_renderer = content::GetContentClient()->
593 browser()->GetWebUIFactory()->IsURLAcceptableForWebUI(browser_context(), 600 browser()->GetWebUIFactory()->IsURLAcceptableForWebUI(browser_context(),
594 entry.url()); 601 entry.url());
595 CHECK(!(enabled_bindings & content::BINDINGS_POLICY_WEB_UI) || 602 CHECK(!(enabled_bindings & content::BINDINGS_POLICY_WEB_UI) ||
596 is_allowed_in_web_ui_renderer); 603 is_allowed_in_web_ui_renderer);
597 604
598 // Tell DevTools agent that it is attached prior to the navigation. 605 // Tell DevTools agent that it is attached prior to the navigation.
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 2006
2000 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2007 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2001 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2008 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2002 rwh_view->SetSize(view()->GetContainerSize()); 2009 rwh_view->SetSize(view()->GetContainerSize());
2003 } 2010 }
2004 2011
2005 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { 2012 bool TabContents::GotResponseToLockMouseRequest(bool allowed) {
2006 return render_view_host() ? 2013 return render_view_host() ?
2007 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; 2014 render_view_host()->GotResponseToLockMouseRequest(allowed) : false;
2008 } 2015 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698