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

Unified Diff: content/renderer/render_view_impl.cc

Issue 9413038: SPDY - chrome:loadtimes() should display negotiated NPN protocol. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/renderer/document_state.h ('k') | webkit/glue/resource_loader_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
===================================================================
--- content/renderer/render_view_impl.cc (revision 123758)
+++ content/renderer/render_view_impl.cc (working copy)
@@ -159,6 +159,7 @@
#include "webkit/glue/webkit_constants.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/weburlloader_impl.h"
+#include "webkit/glue/weburlresponse_extradata_impl.h"
#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
#include "webkit/media/webmediaplayer_impl.h"
#include "webkit/plugins/npapi/plugin_list.h"
@@ -268,6 +269,7 @@
using webkit::forms::PasswordFormDomManager;
using webkit_glue::AltErrorPageResourceFetcher;
using webkit_glue::ResourceFetcher;
+using webkit_glue::WebURLResponseExtraDataImpl;
//-----------------------------------------------------------------------------
@@ -318,13 +320,19 @@
params.navigation_type == ViewMsg_Navigate_Type::RELOAD_IGNORING_CACHE;
}
-static WebReferrerPolicy getReferrerPolicyFromRequest(
+static WebReferrerPolicy GetReferrerPolicyFromRequest(
const WebURLRequest& request) {
return request.extraData() ?
static_cast<RequestExtraData*>(request.extraData())->referrer_policy() :
WebKit::WebReferrerPolicyDefault;
}
+static WebURLResponseExtraDataImpl* GetExtraDataFromResponse(
+ const WebURLResponse& response) {
+ return static_cast<WebURLResponseExtraDataImpl*>(
+ response.extraData());
+}
+
NOINLINE static void CrashIntentionally() {
// NOTE(shess): Crash directly rather than using NOTREACHED() so
// that the signature is easier to triage in crash reports.
@@ -1267,7 +1275,7 @@
// would be nice if we could get the real referrer from somewhere.
params.referrer = Referrer(GURL(
original_request.httpHeaderField(WebString::fromUTF8("Referer"))),
- getReferrerPolicyFromRequest(original_request));
+ GetReferrerPolicyFromRequest(original_request));
}
string16 method = request.httpMethod();
@@ -2182,7 +2190,7 @@
suggested_name));
} else {
OpenURL(frame, request.url(),
- Referrer(referrer, getReferrerPolicyFromRequest(request)), policy);
+ Referrer(referrer, GetReferrerPolicyFromRequest(request)), policy);
}
}
@@ -2226,7 +2234,7 @@
if (frame_url.GetOrigin() != url.GetOrigin()) {
Referrer referrer(
GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
- getReferrerPolicyFromRequest(request));
+ GetReferrerPolicyFromRequest(request));
OpenURL(frame, url, referrer, default_policy);
return WebKit::WebNavigationPolicyIgnore;
}
@@ -2242,7 +2250,7 @@
renderer_preferences_.browser_handles_all_requests) {
Referrer referrer(
GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
- getReferrerPolicyFromRequest(request));
+ GetReferrerPolicyFromRequest(request));
// Reset these counters as the RenderView could be reused for the next
// navigation.
page_id_ = -1;
@@ -2285,7 +2293,7 @@
if (should_fork) {
Referrer referrer(
GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
- getReferrerPolicyFromRequest(request));
+ GetReferrerPolicyFromRequest(request));
OpenURL(
frame, url, send_referrer ? referrer : Referrer(), default_policy);
return WebKit::WebNavigationPolicyIgnore; // Suppress the load here.
@@ -2460,7 +2468,7 @@
// If there's no provisional data source, it's a reference fragment
// navigation.
completed_client_redirect_src_ = Referrer(
- from, ds ? getReferrerPolicyFromRequest(ds->request()) :
+ from, ds ? GetReferrerPolicyFromRequest(ds->request()) :
frame->referrerPolicy());
}
FOR_EACH_OBSERVER(
@@ -3015,6 +3023,11 @@
// Record page load flags.
document_state->set_was_fetched_via_spdy(response.wasFetchedViaSPDY());
document_state->set_was_npn_negotiated(response.wasNpnNegotiated());
+ WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response);
+ if (extra_data) {
+ document_state->set_npn_negotiated_protocol(
+ extra_data->npn_negotiated_protocol());
+ }
document_state->set_was_alternate_protocol_available(
response.wasAlternateProtocolAvailable());
document_state->set_was_fetched_via_proxy(response.wasFetchedViaProxy());
« no previous file with comments | « content/public/renderer/document_state.h ('k') | webkit/glue/resource_loader_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698