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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 3561008: Implement the frame id required for the web navigation api. (Closed)
Patch Set: updates Created 10 years, 2 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 const WebURLRequest& original_request = ds->originalRequest(); 1304 const WebURLRequest& original_request = ds->originalRequest();
1305 const WebURLResponse& response = ds->response(); 1305 const WebURLResponse& response = ds->response();
1306 1306
1307 NavigationState* navigation_state = NavigationState::FromDataSource(ds); 1307 NavigationState* navigation_state = NavigationState::FromDataSource(ds);
1308 DCHECK(navigation_state); 1308 DCHECK(navigation_state);
1309 1309
1310 ViewHostMsg_FrameNavigate_Params params; 1310 ViewHostMsg_FrameNavigate_Params params;
1311 params.http_status_code = response.httpStatusCode(); 1311 params.http_status_code = response.httpStatusCode();
1312 params.is_post = false; 1312 params.is_post = false;
1313 params.page_id = page_id_; 1313 params.page_id = page_id_;
1314 params.frame_id = frame->identifier();
1314 params.is_content_filtered = response.isContentFiltered(); 1315 params.is_content_filtered = response.isContentFiltered();
1315 params.was_within_same_page = navigation_state->was_within_same_page(); 1316 params.was_within_same_page = navigation_state->was_within_same_page();
1316 if (!navigation_state->security_info().empty()) { 1317 if (!navigation_state->security_info().empty()) {
1317 // SSL state specified in the request takes precedence over the one in the 1318 // SSL state specified in the request takes precedence over the one in the
1318 // response. 1319 // response.
1319 // So far this is only intended for error pages that are not expected to be 1320 // So far this is only intended for error pages that are not expected to be
1320 // over ssl, so we should not get any clash. 1321 // over ssl, so we should not get any clash.
1321 DCHECK(response.securityInfo().isEmpty()); 1322 DCHECK(response.securityInfo().isEmpty());
1322 params.security_info = navigation_state->security_info(); 1323 params.security_info = navigation_state->security_info();
1323 } else { 1324 } else {
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
2877 2878
2878 // Make sure redirect tracking state is clear for the new load. 2879 // Make sure redirect tracking state is clear for the new load.
2879 completed_client_redirect_src_ = GURL(); 2880 completed_client_redirect_src_ = GURL();
2880 } else if (frame->parent()->isLoading()) { 2881 } else if (frame->parent()->isLoading()) {
2881 // Take note of AUTO_SUBFRAME loads here, so that we can know how to 2882 // Take note of AUTO_SUBFRAME loads here, so that we can know how to
2882 // load an error page. See didFailProvisionalLoad. 2883 // load an error page. See didFailProvisionalLoad.
2883 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME); 2884 navigation_state->set_transition_type(PageTransition::AUTO_SUBFRAME);
2884 } 2885 }
2885 2886
2886 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame( 2887 Send(new ViewHostMsg_DidStartProvisionalLoadForFrame(
2887 routing_id_, is_top_most, ds->request().url())); 2888 routing_id_, frame->identifier(), is_top_most, ds->request().url()));
2888 } 2889 }
2889 2890
2890 void RenderView::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame) { 2891 void RenderView::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame) {
2891 if (frame->parent()) 2892 if (frame->parent())
2892 return; 2893 return;
2893 // Received a redirect on the main frame. 2894 // Received a redirect on the main frame.
2894 WebDataSource* data_source = frame->provisionalDataSource(); 2895 WebDataSource* data_source = frame->provisionalDataSource();
2895 if (!data_source) { 2896 if (!data_source) {
2896 // Should only be invoked when we have a data source. 2897 // Should only be invoked when we have a data source.
2897 NOTREACHED(); 2898 NOTREACHED();
(...skipping 17 matching lines...) Expand all
2915 // 2916 //
2916 WebDataSource* ds = frame->provisionalDataSource(); 2917 WebDataSource* ds = frame->provisionalDataSource();
2917 DCHECK(ds); 2918 DCHECK(ds);
2918 2919
2919 const WebURLRequest& failed_request = ds->request(); 2920 const WebURLRequest& failed_request = ds->request();
2920 2921
2921 bool show_repost_interstitial = 2922 bool show_repost_interstitial =
2922 (error.reason == net::ERR_CACHE_MISS && 2923 (error.reason == net::ERR_CACHE_MISS &&
2923 EqualsASCII(failed_request.httpMethod(), "POST")); 2924 EqualsASCII(failed_request.httpMethod(), "POST"));
2924 Send(new ViewHostMsg_DidFailProvisionalLoadWithError( 2925 Send(new ViewHostMsg_DidFailProvisionalLoadWithError(
2925 routing_id_, !frame->parent(), error.reason, error.unreachableURL, 2926 routing_id_, frame->identifier(), !frame->parent(), error.reason,
2926 show_repost_interstitial)); 2927 error.unreachableURL, show_repost_interstitial));
2927 2928
2928 // Don't display an error page if this is simply a cancelled load. Aside 2929 // Don't display an error page if this is simply a cancelled load. Aside
2929 // from being dumb, WebCore doesn't expect it and it will cause a crash. 2930 // from being dumb, WebCore doesn't expect it and it will cause a crash.
2930 if (error.reason == net::ERR_ABORTED) 2931 if (error.reason == net::ERR_ABORTED)
2931 return; 2932 return;
2932 2933
2933 // Make sure we never show errors in view source mode. 2934 // Make sure we never show errors in view source mode.
2934 frame->enableViewSourceMode(false); 2935 frame->enableViewSourceMode(false);
2935 2936
2936 NavigationState* navigation_state = NavigationState::FromDataSource(ds); 2937 NavigationState* navigation_state = NavigationState::FromDataSource(ds);
(...skipping 2981 matching lines...) Expand 10 before | Expand all | Expand 10 after
5918 } 5919 }
5919 5920
5920 void RenderView::OnAsyncFileOpened(base::PlatformFileError error_code, 5921 void RenderView::OnAsyncFileOpened(base::PlatformFileError error_code,
5921 IPC::PlatformFileForTransit file_for_transit, 5922 IPC::PlatformFileForTransit file_for_transit,
5922 int message_id) { 5923 int message_id) {
5923 pepper_delegate_.OnAsyncFileOpened( 5924 pepper_delegate_.OnAsyncFileOpened(
5924 error_code, 5925 error_code,
5925 IPC::PlatformFileForTransitToPlatformFile(file_for_transit), 5926 IPC::PlatformFileForTransitToPlatformFile(file_for_transit),
5926 message_id); 5927 message_id);
5927 } 5928 }
OLDNEW
« no previous file with comments | « chrome/common/render_messages_params.cc ('k') | chrome/test/data/extensions/api_test/webnavigation/navigation/iframe/d.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698