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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 9317009: Store the UploadData identifier in NavigationEntryImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits from self-review Created 8 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 virtual bool HandleMouseLockedInputEvent( 357 virtual bool HandleMouseLockedInputEvent(
358 const WebKit::WebMouseEvent &event) OVERRIDE { 358 const WebKit::WebMouseEvent &event) OVERRIDE {
359 // The WebWidget handles mouse lock in WebKit's handleInputEvent(). 359 // The WebWidget handles mouse lock in WebKit's handleInputEvent().
360 return false; 360 return false;
361 } 361 }
362 362
363 private: 363 private:
364 WebKit::WebWidget* webwidget_; 364 WebKit::WebWidget* webwidget_;
365 }; 365 };
366 366
367 int64 ExtractPostId(const WebHistoryItem& item) {
368 if (item.isNull())
369 return -1;
370
371 if (item.httpBody().isNull())
372 return -1;
373
374 return item.httpBody().identifier();
375 }
376
367 } // namespace 377 } // namespace
368 378
369 RenderViewImpl::RenderViewImpl( 379 RenderViewImpl::RenderViewImpl(
370 gfx::NativeViewId parent_hwnd, 380 gfx::NativeViewId parent_hwnd,
371 int32 opener_id, 381 int32 opener_id,
372 const content::RendererPreferences& renderer_prefs, 382 const content::RendererPreferences& renderer_prefs,
373 const WebPreferences& webkit_prefs, 383 const WebPreferences& webkit_prefs,
374 SharedRenderViewCounter* counter, 384 SharedRenderViewCounter* counter,
375 int32 routing_id, 385 int32 routing_id,
376 int32 surface_id, 386 int32 surface_id,
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 const WebURLRequest& request = ds->request(); 1106 const WebURLRequest& request = ds->request();
1097 const WebURLRequest& original_request = ds->originalRequest(); 1107 const WebURLRequest& original_request = ds->originalRequest();
1098 const WebURLResponse& response = ds->response(); 1108 const WebURLResponse& response = ds->response();
1099 1109
1100 DocumentState* document_state = DocumentState::FromDataSource(ds); 1110 DocumentState* document_state = DocumentState::FromDataSource(ds);
1101 NavigationState* navigation_state = document_state->navigation_state(); 1111 NavigationState* navigation_state = document_state->navigation_state();
1102 1112
1103 ViewHostMsg_FrameNavigate_Params params; 1113 ViewHostMsg_FrameNavigate_Params params;
1104 params.http_status_code = response.httpStatusCode(); 1114 params.http_status_code = response.httpStatusCode();
1105 params.is_post = false; 1115 params.is_post = false;
1116 params.post_id = -1;
1106 params.page_id = page_id_; 1117 params.page_id = page_id_;
1107 params.frame_id = frame->identifier(); 1118 params.frame_id = frame->identifier();
1108 params.socket_address.set_host(response.remoteIPAddress().utf8()); 1119 params.socket_address.set_host(response.remoteIPAddress().utf8());
1109 params.socket_address.set_port(response.remotePort()); 1120 params.socket_address.set_port(response.remotePort());
1110 params.was_fetched_via_proxy = response.wasFetchedViaProxy(); 1121 params.was_fetched_via_proxy = response.wasFetchedViaProxy();
1111 params.was_within_same_page = navigation_state->was_within_same_page(); 1122 params.was_within_same_page = navigation_state->was_within_same_page();
1112 if (!document_state->security_info().empty()) { 1123 if (!document_state->security_info().empty()) {
1113 // SSL state specified in the request takes precedence over the one in the 1124 // SSL state specified in the request takes precedence over the one in the
1114 // response. 1125 // response.
1115 // So far this is only intended for error pages that are not expected to be 1126 // So far this is only intended for error pages that are not expected to be
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 params.transition | content::PAGE_TRANSITION_CLIENT_REDIRECT); 1225 params.transition | content::PAGE_TRANSITION_CLIENT_REDIRECT);
1215 } else { 1226 } else {
1216 // Bug 654101: the referrer will be empty on https->http transitions. It 1227 // Bug 654101: the referrer will be empty on https->http transitions. It
1217 // would be nice if we could get the real referrer from somewhere. 1228 // would be nice if we could get the real referrer from somewhere.
1218 params.referrer = Referrer(GURL( 1229 params.referrer = Referrer(GURL(
1219 original_request.httpHeaderField(WebString::fromUTF8("Referer"))), 1230 original_request.httpHeaderField(WebString::fromUTF8("Referer"))),
1220 getReferrerPolicyFromRequest(original_request)); 1231 getReferrerPolicyFromRequest(original_request));
1221 } 1232 }
1222 1233
1223 string16 method = request.httpMethod(); 1234 string16 method = request.httpMethod();
1224 if (EqualsASCII(method, "POST")) 1235 if (EqualsASCII(method, "POST")) {
1225 params.is_post = true; 1236 params.is_post = true;
1237 params.post_id = ExtractPostId(item);
1238 }
1226 1239
1227 // Save some histogram data so we can compute the average memory used per 1240 // Save some histogram data so we can compute the average memory used per
1228 // page load of the glyphs. 1241 // page load of the glyphs.
1229 UMA_HISTOGRAM_COUNTS_10000("Memory.GlyphPagesPerLoad", 1242 UMA_HISTOGRAM_COUNTS_10000("Memory.GlyphPagesPerLoad",
1230 webkit_glue::GetGlyphPageCount()); 1243 webkit_glue::GetGlyphPageCount());
1231 1244
1232 // This message needs to be sent before any of allowScripts(), 1245 // This message needs to be sent before any of allowScripts(),
1233 // allowImages(), allowPlugins() is called for the new page, so that when 1246 // allowImages(), allowPlugins() is called for the new page, so that when
1234 // these functions send a ViewHostMsg_ContentBlocked message, it arrives 1247 // these functions send a ViewHostMsg_ContentBlocked message, it arrives
1235 // after the ViewHostMsg_FrameNavigate message. 1248 // after the ViewHostMsg_FrameNavigate message.
(...skipping 3712 matching lines...) Expand 10 before | Expand all | Expand 10 after
4948 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 4961 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
4949 return !!RenderThreadImpl::current()->compositor_thread(); 4962 return !!RenderThreadImpl::current()->compositor_thread();
4950 } 4963 }
4951 4964
4952 void RenderViewImpl::OnJavaBridgeInit() { 4965 void RenderViewImpl::OnJavaBridgeInit() {
4953 DCHECK(!java_bridge_dispatcher_.get()); 4966 DCHECK(!java_bridge_dispatcher_.get());
4954 #if defined(ENABLE_JAVA_BRIDGE) 4967 #if defined(ENABLE_JAVA_BRIDGE)
4955 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 4968 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
4956 #endif 4969 #endif
4957 } 4970 }
OLDNEW
« content/common/view_messages.h ('K') | « content/public/browser/navigation_entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698