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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // For security, we should never send non-Web-UI URLs to a Web UI renderer. | 374 // For security, we should never send non-Web-UI URLs to a Web UI renderer. |
375 // Double check that here. | 375 // Double check that here. |
376 CheckWebUIRendererDoesNotDisplayNormalURL( | 376 CheckWebUIRendererDoesNotDisplayNormalURL( |
377 dest_render_frame_host, entry.GetURL()); | 377 dest_render_frame_host, entry.GetURL()); |
378 | 378 |
379 // Notify observers that we will navigate in this RenderFrame. | 379 // Notify observers that we will navigate in this RenderFrame. |
380 if (delegate_) | 380 if (delegate_) |
381 delegate_->AboutToNavigateRenderFrame(dest_render_frame_host); | 381 delegate_->AboutToNavigateRenderFrame(dest_render_frame_host); |
382 | 382 |
383 // Navigate in the desired RenderFrameHost. | 383 // Navigate in the desired RenderFrameHost. |
384 dest_render_frame_host->Navigate(navigate_params); | 384 // 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 |
| 386 // been issued. In that case, simply resume the response. |
| 387 bool is_transfer_to_same = |
| 388 navigate_params.transferred_request_child_id != -1 && |
| 389 navigate_params.transferred_request_child_id == |
| 390 dest_render_frame_host->GetProcess()->GetID(); |
| 391 if (!is_transfer_to_same) { |
| 392 dest_render_frame_host->Navigate(navigate_params); |
| 393 } else { |
| 394 // No need to navigate again. Just resume the deferred request. |
| 395 dest_render_frame_host->GetProcess()->ResumeDeferredNavigation( |
| 396 GlobalRequestID(navigate_params.transferred_request_child_id, |
| 397 navigate_params.transferred_request_request_id)); |
| 398 } |
385 | 399 |
386 // Make sure no code called via RFH::Navigate clears the pending entry. | 400 // Make sure no code called via RFH::Navigate clears the pending entry. |
387 CHECK_EQ(controller_->GetPendingEntry(), &entry); | 401 CHECK_EQ(controller_->GetPendingEntry(), &entry); |
388 | 402 |
389 if (entry.GetPageID() == -1) { | 403 if (entry.GetPageID() == -1) { |
390 // HACK!! This code suppresses javascript: URLs from being added to | 404 // HACK!! This code suppresses javascript: URLs from being added to |
391 // session history, which is what we want to do for javascript: URLs that | 405 // session history, which is what we want to do for javascript: URLs that |
392 // do not generate content. What we really need is a message from the | 406 // do not generate content. What we really need is a message from the |
393 // renderer telling us that a new page was not created. The same message | 407 // renderer telling us that a new page was not created. The same message |
394 // could be used for mailto: URLs and the like. | 408 // could be used for mailto: URLs and the like. |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 controller_->GetBrowserContext(), url); | 681 controller_->GetBrowserContext(), url); |
668 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && | 682 if ((enabled_bindings & BINDINGS_POLICY_WEB_UI) && |
669 !is_allowed_in_web_ui_renderer) { | 683 !is_allowed_in_web_ui_renderer) { |
670 // Log the URL to help us diagnose any future failures of this CHECK. | 684 // Log the URL to help us diagnose any future failures of this CHECK. |
671 GetContentClient()->SetActiveURL(url); | 685 GetContentClient()->SetActiveURL(url); |
672 CHECK(0); | 686 CHECK(0); |
673 } | 687 } |
674 } | 688 } |
675 | 689 |
676 } // namespace content | 690 } // namespace content |
OLD | NEW |