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

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

Issue 1255573005: Create FrameNavigationEntries for the initial blank page in subframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments Created 5 years, 5 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 | « content/browser/frame_host/navigation_request.cc ('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 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 entry.restore_type())); 307 entry.restore_type()));
308 // Create the navigation parameters. 308 // Create the navigation parameters.
309 FrameMsg_Navigate_Type::Value navigation_type = 309 FrameMsg_Navigate_Type::Value navigation_type =
310 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); 310 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type);
311 dest_render_frame_host->Navigate( 311 dest_render_frame_host->Navigate(
312 entry.ConstructCommonNavigationParams(dest_url, dest_referrer, 312 entry.ConstructCommonNavigationParams(dest_url, dest_referrer,
313 frame_entry, navigation_type), 313 frame_entry, navigation_type),
314 entry.ConstructStartNavigationParams(), 314 entry.ConstructStartNavigationParams(),
315 entry.ConstructRequestNavigationParams( 315 entry.ConstructRequestNavigationParams(
316 frame_entry, navigation_start, is_same_document_history_load, 316 frame_entry, navigation_start, is_same_document_history_load,
317 controller_->HasCommittedRealLoad(frame_tree_node), 317 frame_tree_node->has_committed_real_load(),
318 controller_->GetPendingEntryIndex() == -1, 318 controller_->GetPendingEntryIndex() == -1,
319 controller_->GetIndexOfEntry(&entry), 319 controller_->GetIndexOfEntry(&entry),
320 controller_->GetLastCommittedEntryIndex(), 320 controller_->GetLastCommittedEntryIndex(),
321 controller_->GetEntryCount())); 321 controller_->GetEntryCount()));
322 } else { 322 } else {
323 // No need to navigate again. Just resume the deferred request. 323 // No need to navigate again. Just resume the deferred request.
324 dest_render_frame_host->GetProcess()->ResumeDeferredNavigation( 324 dest_render_frame_host->GetProcess()->ResumeDeferredNavigation(
325 entry.transferred_global_request_id()); 325 entry.transferred_global_request_id());
326 } 326 }
327 327
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 // TODO(nasko): Verify the correctness of the above comment, since some of the 432 // TODO(nasko): Verify the correctness of the above comment, since some of the
433 // code doesn't exist anymore. Also, move this code in the 433 // code doesn't exist anymore. Also, move this code in the
434 // PageTransitionIsMainFrame code block above. 434 // PageTransitionIsMainFrame code block above.
435 if (ui::PageTransitionIsMainFrame(params.transition) && delegate_) 435 if (ui::PageTransitionIsMainFrame(params.transition) && delegate_)
436 delegate_->SetMainFrameMimeType(params.contents_mime_type); 436 delegate_->SetMainFrameMimeType(params.contents_mime_type);
437 437
438 LoadCommittedDetails details; 438 LoadCommittedDetails details;
439 bool did_navigate = controller_->RendererDidNavigate(render_frame_host, 439 bool did_navigate = controller_->RendererDidNavigate(render_frame_host,
440 params, &details); 440 params, &details);
441 441
442 // For now, keep track of each frame's URL in its FrameTreeNode. This lets 442 // Keep track of each frame's URL in its FrameTreeNode.
443 // us estimate our process count for implementing OOP iframes. 443 render_frame_host->frame_tree_node()->SetCurrentURL(params.url);
444 // TODO(creis): Remove this when we track which pages commit in each frame.
445 render_frame_host->frame_tree_node()->set_current_url(params.url);
446 444
447 // Send notification about committed provisional loads. This notification is 445 // Send notification about committed provisional loads. This notification is
448 // different from the NAV_ENTRY_COMMITTED notification which doesn't include 446 // different from the NAV_ENTRY_COMMITTED notification which doesn't include
449 // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations. 447 // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations.
450 if (details.type != NAVIGATION_TYPE_NAV_IGNORE && delegate_) { 448 if (details.type != NAVIGATION_TYPE_NAV_IGNORE && delegate_) {
451 DCHECK_EQ(!render_frame_host->GetParent(), 449 DCHECK_EQ(!render_frame_host->GetParent(),
452 did_navigate ? details.is_main_frame : false); 450 did_navigate ? details.is_main_frame : false);
453 ui::PageTransition transition_type = params.transition; 451 ui::PageTransition transition_type = params.transition;
454 // Whether or not a page transition was triggered by going backward or 452 // Whether or not a page transition was triggered by going backward or
455 // forward in the history is only stored in the navigation controller's 453 // forward in the history is only stored in the navigation controller's
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 entry->set_should_replace_entry(pending_entry->should_replace_entry()); 917 entry->set_should_replace_entry(pending_entry->should_replace_entry());
920 entry->SetRedirectChain(pending_entry->GetRedirectChain()); 918 entry->SetRedirectChain(pending_entry->GetRedirectChain());
921 } 919 }
922 controller_->SetPendingEntry(entry.Pass()); 920 controller_->SetPendingEntry(entry.Pass());
923 if (delegate_) 921 if (delegate_)
924 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 922 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
925 } 923 }
926 } 924 }
927 925
928 } // namespace content 926 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698