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/time/time.h" | 8 #include "base/time/time.h" |
9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
341 // "Open link in new tab"). We need to keep it above RFHM::Navigate() call to | 341 // "Open link in new tab"). We need to keep it above RFHM::Navigate() call to |
342 // capture the time needed for the RenderFrameHost initialization. | 342 // capture the time needed for the RenderFrameHost initialization. |
343 base::TimeTicks navigation_start = base::TimeTicks::Now(); | 343 base::TimeTicks navigation_start = base::TimeTicks::Now(); |
344 | 344 |
345 // WebContents uses this to fill LoadNotificationDetails when the load | 345 // WebContents uses this to fill LoadNotificationDetails when the load |
346 // completes, so that PerformanceMonitor that listens to the notification can | 346 // completes, so that PerformanceMonitor that listens to the notification can |
347 // record the load time. PerformanceMonitor is no longer maintained. | 347 // record the load time. PerformanceMonitor is no longer maintained. |
348 // TODO(ppi): make this go away. | 348 // TODO(ppi): make this go away. |
349 current_load_start_ = base::TimeTicks::Now(); | 349 current_load_start_ = base::TimeTicks::Now(); |
350 | 350 |
351 // Create the navigation parameters. | |
352 FrameMsg_Navigate_Params navigate_params; | 351 FrameMsg_Navigate_Params navigate_params; |
353 MakeNavigateParams( | |
354 entry, *controller_, reload_type, navigation_start, &navigate_params); | |
355 | |
356 RenderFrameHostManager* manager = | 352 RenderFrameHostManager* manager = |
357 render_frame_host->frame_tree_node()->render_manager(); | 353 render_frame_host->frame_tree_node()->render_manager(); |
358 | 354 |
359 // PlzNavigate: the RenderFrameHosts are no longer asked to navigate. Instead | 355 // PlzNavigate: the RenderFrameHosts are no longer asked to navigate. Instead |
360 // the RenderFrameHostManager handles the navigation requests for that frame | 356 // the RenderFrameHostManager handles the navigation requests for that frame |
361 // node. | 357 // node. |
362 if (CommandLine::ForCurrentProcess()->HasSwitch( | 358 if (CommandLine::ForCurrentProcess()->HasSwitch( |
363 switches::kEnableBrowserSideNavigation)) { | 359 switches::kEnableBrowserSideNavigation)) { |
360 // Create the navigation parameters. | |
361 MakeNavigateParams( | |
362 entry, *controller_, reload_type, navigation_start, &navigate_params); | |
364 return manager->RequestNavigation(entry, navigate_params); | 363 return manager->RequestNavigation(entry, navigate_params); |
365 } | 364 } |
366 | 365 |
367 RenderFrameHostImpl* dest_render_frame_host = manager->Navigate(entry); | 366 RenderFrameHostImpl* dest_render_frame_host = manager->Navigate(entry); |
368 if (!dest_render_frame_host) | 367 if (!dest_render_frame_host) |
369 return false; // Unable to create the desired RenderFrameHost. | 368 return false; // Unable to create the desired RenderFrameHost. |
370 | 369 |
371 // Make sure no code called via RFHM::Navigate clears the pending entry. | 370 // Make sure no code called via RFHM::Navigate clears the pending entry. |
372 CHECK_EQ(controller_->GetPendingEntry(), &entry); | 371 CHECK_EQ(controller_->GetPendingEntry(), &entry); |
373 | 372 |
374 // For security, we should never send non-Web-UI URLs to a Web UI renderer. | 373 // For security, we should never send non-Web-UI URLs to a Web UI renderer. |
375 // Double check that here. | 374 // Double check that here. |
376 CheckWebUIRendererDoesNotDisplayNormalURL( | 375 CheckWebUIRendererDoesNotDisplayNormalURL( |
377 dest_render_frame_host, entry.GetURL()); | 376 dest_render_frame_host, entry.GetURL()); |
378 | 377 |
379 // Notify observers that we will navigate in this RenderFrame. | 378 // Notify observers that we will navigate in this RenderFrame. |
380 if (delegate_) | 379 if (delegate_) |
381 delegate_->AboutToNavigateRenderFrame(dest_render_frame_host); | 380 delegate_->AboutToNavigateRenderFrame(dest_render_frame_host); |
382 | 381 |
382 // Create the navigation parameters. | |
Charlie Reis
2014/09/16 21:13:20
Please add something like:
// TODO(vitalybuka): Mo
clamy
2014/09/17 13:33:46
Done.
| |
383 MakeNavigateParams( | |
384 entry, *controller_, reload_type, navigation_start, &navigate_params); | |
385 | |
383 // Navigate in the desired RenderFrameHost. | 386 // Navigate in the desired RenderFrameHost. |
384 // We can skip this step in the rare case that this is a transfer navigation | 387 // We can skip this step in the rare case that this is a transfer navigation |
385 // which began in the chosen RenderFrameHost, since the request has already | 388 // which began in the chosen RenderFrameHost, since the request has already |
386 // been issued. In that case, simply resume the response. | 389 // been issued. In that case, simply resume the response. |
387 bool is_transfer_to_same = | 390 bool is_transfer_to_same = |
388 navigate_params.transferred_request_child_id != -1 && | 391 navigate_params.transferred_request_child_id != -1 && |
389 navigate_params.transferred_request_child_id == | 392 navigate_params.transferred_request_child_id == |
390 dest_render_frame_host->GetProcess()->GetID(); | 393 dest_render_frame_host->GetProcess()->GetID(); |
391 if (!is_transfer_to_same) { | 394 if (!is_transfer_to_same) { |
392 dest_render_frame_host->Navigate(navigate_params); | 395 dest_render_frame_host->Navigate(navigate_params); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
681 controller_->GetBrowserContext(), url); | 684 controller_->GetBrowserContext(), url); |
682 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && | 685 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && |
683 !is_allowed_in_web_ui_renderer) { | 686 !is_allowed_in_web_ui_renderer) { |
684 // Log the URL to help us diagnose any future failures of this CHECK. | 687 // Log the URL to help us diagnose any future failures of this CHECK. |
685 GetContentClient()->SetActiveURL(url); | 688 GetContentClient()->SetActiveURL(url); |
686 CHECK(0); | 689 CHECK(0); |
687 } | 690 } |
688 } | 691 } |
689 | 692 |
690 } // namespace content | 693 } // namespace content |
OLD | NEW |