Chromium Code Reviews| 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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 690 (response->head.headers->response_code() == 204 || | 690 (response->head.headers->response_code() == 204 || |
| 691 response->head.headers->response_code() == 205)) { | 691 response->head.headers->response_code() == 205)) { |
| 692 CancelNavigation(frame_tree_node); | 692 CancelNavigation(frame_tree_node); |
| 693 return; | 693 return; |
| 694 } | 694 } |
| 695 | 695 |
| 696 // Select an appropriate renderer to commit the navigation. | 696 // Select an appropriate renderer to commit the navigation. |
| 697 RenderFrameHostImpl* render_frame_host = | 697 RenderFrameHostImpl* render_frame_host = |
| 698 frame_tree_node->render_manager()->GetFrameHostForNavigation( | 698 frame_tree_node->render_manager()->GetFrameHostForNavigation( |
| 699 *navigation_request); | 699 *navigation_request); |
| 700 | |
| 701 // The renderer can exit view source mode when any error or cancellation | |
| 702 // happen. When reusing the same renderer, overwrite to recover the mode. | |
|
clamy
2015/03/26 16:15:13
Note that this cannot happen in GetFrameHostForNav
nasko
2015/03/26 20:46:31
Acknowledged.
| |
| 703 if (navigation_request->is_view_source() && | |
| 704 render_frame_host == | |
| 705 frame_tree_node->render_manager()->current_frame_host()) { | |
| 706 render_frame_host->render_view_host()->Send( | |
|
nasko
2015/03/26 20:46:31
We should (D)CHECK here that the RFH is the top-le
clamy
2015/03/27 10:53:12
Done.
| |
| 707 new ViewMsg_EnableViewSourceMode( | |
| 708 render_frame_host->render_view_host()->GetRoutingID())); | |
| 709 } | |
| 710 | |
| 700 CheckWebUIRendererDoesNotDisplayNormalURL( | 711 CheckWebUIRendererDoesNotDisplayNormalURL( |
| 701 render_frame_host, navigation_request->common_params().url); | 712 render_frame_host, navigation_request->common_params().url); |
| 702 | 713 |
| 703 render_frame_host->CommitNavigation(response, body.Pass(), | 714 render_frame_host->CommitNavigation(response, body.Pass(), |
| 704 navigation_request->common_params(), | 715 navigation_request->common_params(), |
| 705 navigation_request->request_params()); | 716 navigation_request->request_params()); |
| 706 } | 717 } |
| 707 | 718 |
| 708 // PlzNavigate | 719 // PlzNavigate |
| 709 void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) { | 720 void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 874 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 885 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
| 875 time_to_commit); | 886 time_to_commit); |
| 876 UMA_HISTOGRAM_TIMES( | 887 UMA_HISTOGRAM_TIMES( |
| 877 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 888 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
| 878 time_to_network); | 889 time_to_network); |
| 879 } | 890 } |
| 880 navigation_data_.reset(); | 891 navigation_data_.reset(); |
| 881 } | 892 } |
| 882 | 893 |
| 883 } // namespace content | 894 } // namespace content |
| OLD | NEW |