Commit 4f5ce901 authored by Tsuyoshi Horo's avatar Tsuyoshi Horo Committed by Commit Bot

Enable Signed Exchange Reporting for distributors behind Experimental Web Platform Features flag

Bug: 910516
Change-Id: Idea34833925b9aeead30c00fc0ae409a505c2846
Reviewed-on: https://chromium-review.googlesource.com/c/1488488Reviewed-by: default avatarKunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635789}
parent fa5f3dd8
......@@ -8,10 +8,10 @@
#include <utility>
#include "base/callback.h"
#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
#include "base/task/post_task.h"
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/web_package/signed_exchange_utils.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
......@@ -19,9 +19,7 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "net/base/ip_endpoint.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/resource_response_info.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "url/origin.h"
......@@ -143,9 +141,8 @@ std::unique_ptr<SignedExchangeReporter> SignedExchangeReporter::MaybeCreate(
const std::string& referrer,
const network::ResourceResponseHead& response,
base::OnceCallback<int(void)> frame_tree_node_id_getter) {
if (!base::FeatureList::IsEnabled(network::features::kReporting) ||
!base::FeatureList::IsEnabled(
features::kSignedExchangeReportingForDistributors)) {
if (!signed_exchange_utils::
IsSignedExchangeReportingForDistributorsEnabled()) {
return nullptr;
}
return base::WrapUnique(new SignedExchangeReporter(
......
......@@ -17,6 +17,7 @@
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "net/http/http_util.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/resource_response.h"
namespace content {
......@@ -39,6 +40,14 @@ bool IsSignedExchangeHandlingEnabled() {
switches::kEnableExperimentalWebPlatformFeatures);
}
bool IsSignedExchangeReportingForDistributorsEnabled() {
return base::FeatureList::IsEnabled(network::features::kReporting) &&
(base::FeatureList::IsEnabled(
features::kSignedExchangeReportingForDistributors) ||
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableExperimentalWebPlatformFeatures));
}
bool ShouldHandleAsSignedHTTPExchange(
const GURL& request_url,
const network::ResourceResponseHead& head) {
......
......@@ -45,6 +45,9 @@ void ReportErrorAndTraceEvent(
// Returns true when SignedHTTPExchange feature is enabled.
CONTENT_EXPORT bool IsSignedExchangeHandlingEnabled();
// Returns true when SignedExchangeReportingForDistributors feature is enabled.
bool IsSignedExchangeReportingForDistributorsEnabled();
// Returns true when the response should be handled as a signed exchange by
// checking the mime type and the feature flags.
bool ShouldHandleAsSignedHTTPExchange(
......
......@@ -4149,10 +4149,6 @@ crbug.com/655458 virtual/omt-worker-fetch/external/wpt/workers/semantics/multipl
crbug.com/435547 http/tests/cachestorage/serviceworker/ignore-search-with-credentials.html [ Skip ]
# Signed Exchange Reporting tests require SignedExchangeReportingForDistributors feature.
crbug.com/910516 external/wpt/signed-exchange/reporting/ [ Skip ]
crbug.com/910516 virtual/sxg-with-network-service/external/wpt/signed-exchange/reporting/ [ Skip ]
crbug.com/697971 [ Mac10.12 ] fast/text/selection/flexbox-selection-nested.html [ Skip ]
crbug.com/697971 [ Mac10.12 ] fast/text/selection/flexbox-selection.html [ Skip ]
......
......@@ -562,16 +562,6 @@
"base": "inspector-protocol/memory",
"args": ["--sampling-heap-profiler"]
},
{
"prefix": "sxg-reporting",
"base": "external/wpt/signed-exchange",
"args": ["--enable-features=SignedExchangeReportingForDistributors"]
},
{
"prefix": "sxg-reporting-with-network-service",
"base": "external/wpt/signed-exchange",
"args": ["--enable-features=SignedExchangeReportingForDistributors,NetworkService"]
},
{
"prefix": "sxg-with-network-service",
"base": "http/tests/loading/sxg",
......
This directory is for testing the SignedExchangeReportingForDistributors feature
This directory is for testing the SignedExchangeReportingForDistributors feature
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment