 Chromium Code Reviews
 Chromium Code Reviews Issue 746993003:
  Only cancel navigation on user gesture  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 746993003:
  Only cancel navigation on user gesture  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 510 controller_->TakeScreenshot(); | 510 controller_->TakeScreenshot(); | 
| 511 } | 511 } | 
| 512 | 512 | 
| 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( | 
| 521 render_frame_host, input_params.gesture == NavigationGestureUser); | |
| 
Charlie Reis
2014/12/05 19:37:42
This is the third time I've asked you to use param
 | |
| 521 } | 522 } | 
| 522 | 523 | 
| 523 // When using --site-per-process, we notify the RFHM for all navigations, | 524 // When using --site-per-process, we notify the RFHM for all navigations, | 
| 524 // not just main frame navigations. | 525 // not just main frame navigations. | 
| 525 if (use_site_per_process) { | 526 if (use_site_per_process) { | 
| 526 FrameTreeNode* frame = render_frame_host->frame_tree_node(); | 527 FrameTreeNode* frame = render_frame_host->frame_tree_node(); | 
| 527 frame->render_manager()->DidNavigateFrame(render_frame_host); | 528 frame->render_manager()->DidNavigateFrame( | 
| 529 render_frame_host, input_params.gesture == NavigationGestureUser); | |
| 528 } | 530 } | 
| 529 | 531 | 
| 530 // Update the site of the SiteInstance if it doesn't have one yet, unless | 532 // 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 | 533 // 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 | 534 // SiteInstance can still be considered unused until a navigation to a real | 
| 533 // page. | 535 // page. | 
| 534 SiteInstanceImpl* site_instance = | 536 SiteInstanceImpl* site_instance = | 
| 535 static_cast<SiteInstanceImpl*>(render_frame_host->GetSiteInstance()); | 537 static_cast<SiteInstanceImpl*>(render_frame_host->GetSiteInstance()); | 
| 536 if (!site_instance->HasSite() && | 538 if (!site_instance->HasSite() && | 
| 537 ShouldAssignSiteForURL(params.url)) { | 539 ShouldAssignSiteForURL(params.url)) { | 
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 938 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 940 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 
| 939 time_to_commit); | 941 time_to_commit); | 
| 940 UMA_HISTOGRAM_TIMES( | 942 UMA_HISTOGRAM_TIMES( | 
| 941 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 943 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 
| 942 time_to_network); | 944 time_to_network); | 
| 943 } | 945 } | 
| 944 navigation_data_.reset(); | 946 navigation_data_.reset(); | 
| 945 } | 947 } | 
| 946 | 948 | 
| 947 } // namespace content | 949 } // namespace content | 
| OLD | NEW |