diff --git a/DEPS b/DEPS index 579194967..8c0c6a7 100644 --- a/DEPS +++ b/DEPS
@@ -44,7 +44,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '5ea931aa84f9bd3970b5d95ac5f2cc8243012bff', + 'v8_revision': 'f3a8df7a2fa2d17d445da114b882b923091a4373', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other.
diff --git a/chrome/browser/ui/browser_mac.cc b/chrome/browser/ui/browser_mac.cc index 3075d29..319b318 100644 --- a/chrome/browser/ui/browser_mac.cc +++ b/chrome/browser/ui/browser_mac.cc
@@ -41,13 +41,6 @@ browser->window()->Show(); } -void OpenSyncSetupWindow(Profile* profile, - signin_metrics::AccessPoint access_point) { - Browser* browser = new Browser(Browser::CreateParams(profile)); - ShowBrowserSigninOrSettings(browser, access_point); - browser->window()->Show(); -} - void OpenClearBrowsingDataDialogWindow(Profile* profile) { Browser* browser = new Browser(Browser::CreateParams(profile)); ShowClearBrowsingDataDialog(browser);
diff --git a/chrome/browser/ui/browser_mac.h b/chrome/browser/ui/browser_mac.h index 2c11822..136bb2e 100644 --- a/chrome/browser/ui/browser_mac.h +++ b/chrome/browser/ui/browser_mac.h
@@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_UI_BROWSER_MAC_H_ #define CHROME_BROWSER_UI_BROWSER_MAC_H_ -#include "chrome/browser/signin/signin_promo.h" #include "chrome/browser/ui/chrome_pages.h" class Profile; @@ -19,8 +18,6 @@ void OpenDownloadsWindow(Profile* profile); void OpenHelpWindow(Profile* profile, HelpSource source); void OpenOptionsWindow(Profile* profile); -void OpenSyncSetupWindow(Profile* profile, - signin_metrics::AccessPoint access_point); void OpenClearBrowsingDataDialogWindow(Profile* profile); void OpenImportSettingsDialogWindow(Profile* profile); void OpenBookmarkManagerWindow(Profile* profile);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/request-referrer-policy-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/request-referrer-policy-expected.txt new file mode 100644 index 0000000..00f85ef --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/request-referrer-policy-expected.txt
@@ -0,0 +1,9 @@ +Tests that network requests are annotated with the correct referrer policy. + +Network agent enabled +PASS: Request with expected policy unsafe-url observed +PASS: Request with expected policy no-referrer-when-downgrade observed +PASS: Request with expected policy no-referrer observed +PASS: Request with expected policy origin observed +PASS: Request with expected policy origin-when-cross-origin observed +
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/request-referrer-policy.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/request-referrer-policy.html new file mode 100644 index 0000000..de4331a --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/request-referrer-policy.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<script src="../inspector-protocol/inspector-protocol-test.js"></script> +<script src="/resources/get-host-info.js"></script> +<script> +function sendRequest(policy) { + var img = document.createElement("img"); + img.referrerPolicy = policy; + img.src = "/resources/square.png?" + Math.random(); + document.body.appendChild(img); +} + +function test() { + var policy_num = 0; + var policies = [ + "unsafe-url", "no-referrer-when-downgrade", "no-referrer", "origin", + "origin-when-cross-origin" + ]; + + InspectorTest.eventHandler["Network.requestWillBeSent"] = onRequestWillBeSent; + InspectorTest.sendCommand("Network.enable", {}, didEnableNetwork); + + function onRequestWillBeSent(evt) { + var req = evt.params.request; + if (req.referrerPolicy == policies[policy_num]) { + InspectorTest.log("PASS: Request with expected policy " + + policies[policy_num] + " observed"); + } else { + InspectorTest.log("FAIL: Request with policy " + req.referrerPolicy + + " observed (expected " + policies[policy_num] + ")"); + } + policy_num++; + if (policy_num >= policies.length) { + InspectorTest.completeTest(); + } else { + InspectorTest.sendCommand( + "Runtime.evaluate", + {"expression" : "sendRequest('" + policies[policy_num] + "')"}); + } + } + + function didEnableNetwork(messageObject) { + if (messageObject.error) { + InspectorTest.log("FAIL: Couldn't enable network agent " + + messageObject.error.message); + InspectorTest.completeTest(); + return; + } + InspectorTest.log("Network agent enabled"); + InspectorTest.sendCommand( + "Runtime.evaluate", + {"expression" : "sendRequest('" + policies[policy_num] + "')"}); + } +} +</script> +<body onload="runTest()"> + <p> + Tests that network requests are annotated with the correct referrer + policy. + </p> +</body>
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp index 66d67d1e..b10f395 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -58,6 +58,7 @@ #include "core/page/NetworkStateNotifier.h" #include "core/page/Page.h" #include "core/xmlhttprequest/XMLHttpRequest.h" +#include "platform/RuntimeEnabledFeatures.h" #include "platform/blob/BlobData.h" #include "platform/network/HTTPHeaderMap.h" #include "platform/network/ResourceError.h" @@ -67,6 +68,7 @@ #include "platform/network/WebSocketHandshakeRequest.h" #include "platform/network/WebSocketHandshakeResponse.h" #include "platform/weborigin/KURL.h" +#include "platform/weborigin/ReferrerPolicy.h" #include "platform/weborigin/SecurityOrigin.h" #include "public/platform/WebCachePolicy.h" #include "public/platform/WebMixedContent.h" @@ -287,6 +289,37 @@ return WebConnectionTypeUnknown; } +String referrerPolicy(ReferrerPolicy policy) { + switch (policy) { + case ReferrerPolicyAlways: + return protocol::Network::Request::ReferrerPolicyEnum::UnsafeUrl; + case ReferrerPolicyDefault: + if (RuntimeEnabledFeatures::reducedReferrerGranularityEnabled()) { + return protocol::Network::Request::ReferrerPolicyEnum:: + NoReferrerWhenDowngradeOriginWhenCrossOrigin; + } else { + return protocol::Network::Request::ReferrerPolicyEnum:: + NoReferrerWhenDowngrade; + } + case ReferrerPolicyNoReferrerWhenDowngrade: + return protocol::Network::Request::ReferrerPolicyEnum:: + NoReferrerWhenDowngrade; + case ReferrerPolicyNever: + return protocol::Network::Request::ReferrerPolicyEnum::NoReferrer; + case ReferrerPolicyOrigin: + return protocol::Network::Request::ReferrerPolicyEnum::Origin; + case ReferrerPolicyOriginWhenCrossOrigin: + return protocol::Network::Request::ReferrerPolicyEnum:: + OriginWhenCrossOrigin; + case ReferrerPolicyNoReferrerWhenDowngradeOriginWhenCrossOrigin: + return protocol::Network::Request::ReferrerPolicyEnum:: + NoReferrerWhenDowngradeOriginWhenCrossOrigin; + } + + return protocol::Network::Request::ReferrerPolicyEnum:: + NoReferrerWhenDowngrade; +} + } // namespace void InspectorNetworkAgent::restore() { @@ -329,6 +362,7 @@ .setMethod(request.httpMethod()) .setHeaders(buildObjectForHeaders(request.httpHeaderFields())) .setInitialPriority(resourcePriorityJSON(request.priority())) + .setReferrerPolicy(referrerPolicy(request.getReferrerPolicy())) .build(); if (request.httpBody() && !request.httpBody()->isEmpty()) { Vector<char> bytes; @@ -601,6 +635,8 @@ requestInfo->setMixedContentType(mixedContentTypeForContextType( MixedContentChecker::contextTypeForInspector(frame, request))); + requestInfo->setReferrerPolicy(referrerPolicy(request.getReferrerPolicy())); + String resourceType = InspectorPageAgent::resourceTypeJson(type); frontend()->requestWillBeSent( requestId, frameId, loaderId,
diff --git a/third_party/WebKit/Source/core/inspector/browser_protocol.json b/third_party/WebKit/Source/core/inspector/browser_protocol.json index 8c02d78c..662d9e1 100644 --- a/third_party/WebKit/Source/core/inspector/browser_protocol.json +++ b/third_party/WebKit/Source/core/inspector/browser_protocol.json
@@ -989,7 +989,8 @@ { "name": "headers", "$ref": "Headers", "description": "HTTP request headers." }, { "name": "postData", "type": "string", "optional": true, "description": "HTTP POST request data." }, { "name": "mixedContentType", "optional": true, "type": "string", "enum": ["blockable", "optionally-blockable", "none"], "description": "The mixed content status of the request, as defined in http://www.w3.org/TR/mixed-content/" }, - { "name": "initialPriority", "$ref": "ResourcePriority", "description": "Priority of the resource request at the time request is sent."} + { "name": "initialPriority", "$ref": "ResourcePriority", "description": "Priority of the resource request at the time request is sent."}, + { "name": "referrerPolicy", "type": "string", "enum": [ "unsafe-url", "no-referrer-when-downgrade", "no-referrer", "origin", "origin-when-cross-origin", "no-referrer-when-downgrade-origin-when-cross-origin" ], "description": "The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/" } ] }, {
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestHeadersView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestHeadersView.js index 9ad8fa6..a59900cc 100644 --- a/third_party/WebKit/Source/devtools/front_end/network/RequestHeadersView.js +++ b/third_party/WebKit/Source/devtools/front_end/network/RequestHeadersView.js
@@ -60,6 +60,8 @@ this._statusCodeItem = generalCategory.createLeaf(); this._remoteAddressItem = generalCategory.createLeaf(); this._remoteAddressItem.hidden = true; + this._referrerPolicyItem = generalCategory.createLeaf(); + this._referrerPolicyItem.hidden = true; this._responseHeadersCategory = new Network.RequestHeadersView.Category(root, 'responseHeaders', ''); this._requestHeadersCategory = new Network.RequestHeadersView.Category(root, 'requestHeaders', ''); @@ -85,6 +87,7 @@ this._refreshResponseHeaders(); this._refreshHTTPInformation(); this._refreshRemoteAddress(); + this._refreshReferrerPolicy(); } /** @@ -447,6 +450,14 @@ treeElement.title = this._formatHeader(Common.UIString('Remote Address'), remoteAddress); } + _refreshReferrerPolicy() { + var referrerPolicy = this._request.referrerPolicy(); + var treeElement = this._referrerPolicyItem; + treeElement.hidden = !referrerPolicy; + if (referrerPolicy) + treeElement.title = this._formatHeader(Common.UIString('Referrer Policy'), referrerPolicy); + } + /** * @param {!Event} event */
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js index 6965ab59..c0568afad3 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js
@@ -196,6 +196,7 @@ networkRequest.requestFormData = request.postData; networkRequest.setInitialPriority(request.initialPriority); networkRequest.mixedContentType = request.mixedContentType || Protocol.Network.RequestMixedContentType.None; + networkRequest.setReferrerPolicy(request.referrerPolicy); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js index 4dbbcc9..73c7946 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js
@@ -85,6 +85,9 @@ this._remoteAddress = ''; + /** @type {?Protocol.Network.RequestReferrerPolicy} */ + this._referrerPolicy = null; + /** @type {!Protocol.Security.SecurityState} */ this._securityState = Protocol.Security.SecurityState.Unknown; /** @type {?Protocol.Network.SecurityDetails} */ @@ -184,6 +187,20 @@ } /** + * @param {!Protocol.Network.RequestReferrerPolicy} referrerPolicy + */ + setReferrerPolicy(referrerPolicy) { + this._referrerPolicy = referrerPolicy; + } + + /** + * @return {?Protocol.Network.RequestReferrerPolicy} + */ + referrerPolicy() { + return this._referrerPolicy; + } + + /** * @return {!Protocol.Security.SecurityState} */ securityState() {