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

Side by Side Diff: third_party/WebKit/Source/platform/network/ResourceRequest.cpp

Issue 2751043002: DevTools: expose linkPreload bit on the network request. (Closed)
Patch Set: todo added as per request Created 3 years, 9 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 /* 1 /*
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 m_fetchRequestMode(WebURLRequest::FetchRequestModeNoCORS), 69 m_fetchRequestMode(WebURLRequest::FetchRequestModeNoCORS),
70 m_fetchCredentialsMode(WebURLRequest::FetchCredentialsModeInclude), 70 m_fetchCredentialsMode(WebURLRequest::FetchCredentialsModeInclude),
71 m_fetchRedirectMode(WebURLRequest::FetchRedirectModeFollow), 71 m_fetchRedirectMode(WebURLRequest::FetchRedirectModeFollow),
72 m_previewsState(WebURLRequest::PreviewsUnspecified), 72 m_previewsState(WebURLRequest::PreviewsUnspecified),
73 m_referrerPolicy(ReferrerPolicyDefault), 73 m_referrerPolicy(ReferrerPolicyDefault),
74 m_didSetHTTPReferrer(false), 74 m_didSetHTTPReferrer(false),
75 m_checkForBrowserSideNavigation(true), 75 m_checkForBrowserSideNavigation(true),
76 m_uiStartTime(0), 76 m_uiStartTime(0),
77 m_isExternalRequest(false), 77 m_isExternalRequest(false),
78 m_isSameDocumentNavigation(false), 78 m_isSameDocumentNavigation(false),
79 m_linkPreload(false),
80 m_speculativePreload(false),
81 m_preloadDiscoveryTime(0.0),
79 m_inputPerfMetricReportPolicy( 82 m_inputPerfMetricReportPolicy(
80 InputToLoadPerfMetricReportPolicy::NoReport), 83 InputToLoadPerfMetricReportPolicy::NoReport),
81 m_redirectStatus(RedirectStatus::NoRedirect) {} 84 m_redirectStatus(RedirectStatus::NoRedirect) {}
82 85
83 ResourceRequest::ResourceRequest(CrossThreadResourceRequestData* data) 86 ResourceRequest::ResourceRequest(CrossThreadResourceRequestData* data)
84 : ResourceRequest(data->m_url) { 87 : ResourceRequest(data->m_url) {
85 setCachePolicy(data->m_cachePolicy); 88 setCachePolicy(data->m_cachePolicy);
86 setTimeoutInterval(data->m_timeoutInterval); 89 setTimeoutInterval(data->m_timeoutInterval);
87 setFirstPartyForCookies(data->m_firstPartyForCookies); 90 setFirstPartyForCookies(data->m_firstPartyForCookies);
88 setRequestorOrigin(data->m_requestorOrigin); 91 setRequestorOrigin(data->m_requestorOrigin);
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 // to the widespread suppression of the Referer header at the network 418 // to the widespread suppression of the Referer header at the network
416 // layer. 419 // layer.
417 if (httpMethod() == HTTPNames::GET || httpMethod() == HTTPNames::HEAD) 420 if (httpMethod() == HTTPNames::GET || httpMethod() == HTTPNames::HEAD)
418 return false; 421 return false;
419 422
420 // For non-GET and non-HEAD methods, always send an Origin header so the 423 // For non-GET and non-HEAD methods, always send an Origin header so the
421 // server knows we support this feature. 424 // server knows we support this feature.
422 return true; 425 return true;
423 } 426 }
424 427
428 void ResourceRequest::setSpeculativePreload(bool speculativePreload,
429 double discoveryTime) {
430 m_speculativePreload = speculativePreload;
431 m_preloadDiscoveryTime = discoveryTime;
432 }
433
425 } // namespace blink 434 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698