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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 692973005: Pass origin information for remote frame creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failures for content:// URLs on Android Created 6 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 // Run tasks that must execute just before the commit. 513 // Run tasks that must execute just before the commit.
514 bool is_navigation_within_page = controller_->IsURLInPageNavigation( 514 bool is_navigation_within_page = controller_->IsURLInPageNavigation(
515 params.url, params.was_within_same_page, render_frame_host); 515 params.url, params.was_within_same_page, render_frame_host);
516 delegate_->DidNavigateMainFramePreCommit(is_navigation_within_page); 516 delegate_->DidNavigateMainFramePreCommit(is_navigation_within_page);
517 } 517 }
518 518
519 if (!use_site_per_process) 519 if (!use_site_per_process)
520 frame_tree->root()->render_manager()->DidNavigateFrame(render_frame_host); 520 frame_tree->root()->render_manager()->DidNavigateFrame(render_frame_host);
521 } 521 }
522 522
523 // Save the origin of the new page. Do this before calling
524 // DidNavigateFrame(), because the origin needs to be included in the SwapOut
525 // message, which is sent inside DidNavigateFrame(). SwapOut needs the
526 // origin because it creates a RenderFrameProxy that needs this to initialize
527 // its security context. This origin will also be sent to RenderFrameProxies
528 // created via ViewMsg_New and FrameMsg_NewFrameProxy.
529 render_frame_host->frame_tree_node()->set_current_origin(params.origin);
530
523 // When using --site-per-process, we notify the RFHM for all navigations, 531 // When using --site-per-process, we notify the RFHM for all navigations,
524 // not just main frame navigations. 532 // not just main frame navigations.
525 if (use_site_per_process) { 533 if (use_site_per_process) {
526 FrameTreeNode* frame = render_frame_host->frame_tree_node(); 534 FrameTreeNode* frame = render_frame_host->frame_tree_node();
527 frame->render_manager()->DidNavigateFrame(render_frame_host); 535 frame->render_manager()->DidNavigateFrame(render_frame_host);
528 } 536 }
529 537
530 // Update the site of the SiteInstance if it doesn't have one yet, unless 538 // Update the site of the SiteInstance if it doesn't have one yet, unless
531 // assigning a site is not necessary for this URL. In that case, the 539 // assigning a site is not necessary for this URL. In that case, the
532 // SiteInstance can still be considered unused until a navigation to a real 540 // SiteInstance can still be considered unused until a navigation to a real
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", 946 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted",
939 time_to_commit); 947 time_to_commit);
940 UMA_HISTOGRAM_TIMES( 948 UMA_HISTOGRAM_TIMES(
941 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", 949 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted",
942 time_to_network); 950 time_to_network);
943 } 951 }
944 navigation_data_.reset(); 952 navigation_data_.reset();
945 } 953 }
946 954
947 } // namespace content 955 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698