summaryrefslogtreecommitdiff
path: root/chromium/net/reporting
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-09-03 13:32:17 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-01 14:31:55 +0200
commit21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (patch)
tree91be119f694044dfc1ff9fdc054459e925de9df0 /chromium/net/reporting
parent03c549e0392f92c02536d3f86d5e1d8dfa3435ac (diff)
downloadqtwebengine-chromium-21ba0c5d4bf8fba15dddd97cd693bad2358b77fd.tar.gz
BASELINE: Update Chromium to 92.0.4515.166
Change-Id: I42a050486714e9e54fc271f2a8939223a02ae364
Diffstat (limited to 'chromium/net/reporting')
-rw-r--r--chromium/net/reporting/reporting_cache_impl.cc19
-rw-r--r--chromium/net/reporting/reporting_cache_impl.h11
-rw-r--r--chromium/net/reporting/reporting_cache_unittest.cc9
-rw-r--r--chromium/net/reporting/reporting_context.h1
-rw-r--r--chromium/net/reporting/reporting_delivery_agent.cc1
-rw-r--r--chromium/net/reporting/reporting_delivery_agent_unittest.cc6
-rw-r--r--chromium/net/reporting/reporting_header_parser.cc14
-rw-r--r--chromium/net/reporting/reporting_header_parser.h10
-rw-r--r--chromium/net/reporting/reporting_header_parser_unittest.cc28
-rw-r--r--chromium/net/reporting/reporting_report.h2
-rw-r--r--chromium/net/reporting/reporting_service.cc4
-rw-r--r--chromium/net/reporting/reporting_uploader_unittest.cc18
12 files changed, 81 insertions, 42 deletions
diff --git a/chromium/net/reporting/reporting_cache_impl.cc b/chromium/net/reporting/reporting_cache_impl.cc
index 41a35e227bc..8b742949435 100644
--- a/chromium/net/reporting/reporting_cache_impl.cc
+++ b/chromium/net/reporting/reporting_cache_impl.cc
@@ -9,6 +9,7 @@
#include <unordered_set>
#include <utility>
+#include "base/containers/contains.h"
#include "base/stl_util.h"
#include "base/time/clock.h"
#include "base/time/tick_clock.h"
@@ -240,9 +241,7 @@ void ReportingCacheImpl::OnParsedHeader(
new_client.network_isolation_key);
DCHECK_EQ(new_group.group_key.origin, new_client.origin);
- std::set<GURL> new_endpoints;
for (const auto& parsed_endpoint_info : parsed_endpoint_group.endpoints) {
- new_endpoints.insert(parsed_endpoint_info.url);
endpoints_per_group[new_group.group_key].insert(parsed_endpoint_info.url);
ReportingEndpoint new_endpoint(new_group.group_key,
std::move(parsed_endpoint_info));
@@ -412,7 +411,7 @@ void ReportingCacheImpl::AddClientsLoadedFromStore(
auto endpoints_it = loaded_endpoints.begin();
auto endpoint_groups_it = loaded_endpoint_groups.begin();
- base::Optional<Client> client;
+ absl::optional<Client> client;
while (endpoint_groups_it != loaded_endpoint_groups.end() &&
endpoints_it != loaded_endpoints.end()) {
@@ -457,7 +456,7 @@ void ReportingCacheImpl::AddClientsLoadedFromStore(
EnforcePerClientAndGlobalEndpointLimits(client_it);
}
DCHECK(FindClientIt(group_key) == clients_.end());
- client = base::make_optional(
+ client = absl::make_optional(
Client(group_key.network_isolation_key, group_key.origin));
}
DCHECK(client.has_value());
@@ -971,7 +970,7 @@ void ReportingCacheImpl::RemoveEndpointsInGroupOtherThan(
// This may invalidate |group_it| (and also possibly |client_it|), but only
// if we are processing the last remaining endpoint in the group.
- base::Optional<EndpointMap::iterator> next_it =
+ absl::optional<EndpointMap::iterator> next_it =
RemoveEndpointInternal(client_it, group_it, it);
if (!next_it.has_value())
return;
@@ -1025,7 +1024,7 @@ void ReportingCacheImpl::MarkEndpointGroupAndClientUsed(
store()->UpdateReportingEndpointGroupAccessTime(group_it->second);
}
-base::Optional<ReportingCacheImpl::EndpointMap::iterator>
+absl::optional<ReportingCacheImpl::EndpointMap::iterator>
ReportingCacheImpl::RemoveEndpointInternal(ClientMap::iterator client_it,
EndpointGroupMap::iterator group_it,
EndpointMap::iterator endpoint_it) {
@@ -1039,7 +1038,7 @@ ReportingCacheImpl::RemoveEndpointInternal(ClientMap::iterator client_it,
// be removed if it becomes empty.
if (endpoints_.count(group_key) == 1) {
RemoveEndpointGroupInternal(client_it, group_it);
- return base::nullopt;
+ return absl::nullopt;
}
// Otherwise, there are other endpoints in the group, so there is no chance
// of needing to remove the group/client. Just remove this endpoint and
@@ -1052,7 +1051,7 @@ ReportingCacheImpl::RemoveEndpointInternal(ClientMap::iterator client_it,
return endpoints_.erase(endpoint_it);
}
-base::Optional<ReportingCacheImpl::EndpointGroupMap::iterator>
+absl::optional<ReportingCacheImpl::EndpointGroupMap::iterator>
ReportingCacheImpl::RemoveEndpointGroupInternal(
ClientMap::iterator client_it,
EndpointGroupMap::iterator group_it,
@@ -1088,14 +1087,14 @@ ReportingCacheImpl::RemoveEndpointGroupInternal(
if (context_->IsClientDataPersisted())
store()->DeleteReportingEndpointGroup(group_it->second);
- base::Optional<EndpointGroupMap::iterator> rv =
+ absl::optional<EndpointGroupMap::iterator> rv =
endpoint_groups_.erase(group_it);
// Delete client if empty.
if (client.endpoint_count == 0) {
DCHECK(client.endpoint_group_names.empty());
clients_.erase(client_it);
- rv = base::nullopt;
+ rv = absl::nullopt;
}
return rv;
}
diff --git a/chromium/net/reporting/reporting_cache_impl.h b/chromium/net/reporting/reporting_cache_impl.h
index 8992da264c7..59b1ed8c383 100644
--- a/chromium/net/reporting/reporting_cache_impl.h
+++ b/chromium/net/reporting/reporting_cache_impl.h
@@ -9,7 +9,6 @@
#include <memory>
#include <set>
#include <string>
-#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
@@ -17,7 +16,6 @@
#include "base/containers/flat_set.h"
#include "base/containers/unique_ptr_adapters.h"
#include "base/macros.h"
-#include "base/optional.h"
#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "base/values.h"
@@ -26,6 +24,7 @@
#include "net/reporting/reporting_endpoint.h"
#include "net/reporting/reporting_header_parser.h"
#include "net/reporting/reporting_report.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
#include "url/origin.h"
@@ -232,10 +231,10 @@ class ReportingCacheImpl : public ReportingCache {
// Also takes iterators to the client and endpoint group to avoid repeated
// lookups. May cause the client and/or group to be removed if they become
// empty, which would invalidate those iterators.
- // Returns the iterator following the endpoint removed, or base::nullopt if
+ // Returns the iterator following the endpoint removed, or absl::nullopt if
// either of |group_it| or |client_it| were invalidated. (If |client_it| is
// invalidated, then so must |group_it|).
- base::Optional<EndpointMap::iterator> RemoveEndpointInternal(
+ absl::optional<EndpointMap::iterator> RemoveEndpointInternal(
ClientMap::iterator client_it,
EndpointGroupMap::iterator group_it,
EndpointMap::iterator endpoint_it);
@@ -246,9 +245,9 @@ class ReportingCacheImpl : public ReportingCache {
// invalidate |client_it|. If |num_endpoints_removed| is not null, then
// |*num_endpoints_removed| is incremented by the number of endpoints
// removed.
- // Returns the iterator following the endpoint group removed, or base::nullopt
+ // Returns the iterator following the endpoint group removed, or absl::nullopt
// if |client_it| was invalidated.
- base::Optional<EndpointGroupMap::iterator> RemoveEndpointGroupInternal(
+ absl::optional<EndpointGroupMap::iterator> RemoveEndpointGroupInternal(
ClientMap::iterator client_it,
EndpointGroupMap::iterator group_it,
size_t* num_endpoints_removed = nullptr);
diff --git a/chromium/net/reporting/reporting_cache_unittest.cc b/chromium/net/reporting/reporting_cache_unittest.cc
index 3231f0effeb..a13448da238 100644
--- a/chromium/net/reporting/reporting_cache_unittest.cc
+++ b/chromium/net/reporting/reporting_cache_unittest.cc
@@ -897,9 +897,8 @@ TEST_P(ReportingCacheTest, GetClientsAsValue) {
/* reports */ 1, /* succeeded */ false);
base::Value actual = cache()->GetClientsAsValue();
- std::unique_ptr<base::Value> expected =
- base::test::ParseJsonDeprecated(base::StringPrintf(
- R"json(
+ base::Value expected = base::test::ParseJson(base::StringPrintf(
+ R"json(
[
{
"network_isolation_key": "%s",
@@ -935,10 +934,10 @@ TEST_P(ReportingCacheTest, GetClientsAsValue) {
},
]
)json",
- kNik_.ToDebugString().c_str(), kOtherNik_.ToDebugString().c_str()));
+ kNik_.ToDebugString().c_str(), kOtherNik_.ToDebugString().c_str()));
// Compare disregarding order.
- auto expected_list = expected->TakeList();
+ auto expected_list = expected.TakeList();
auto actual_list = actual.TakeList();
std::sort(expected_list.begin(), expected_list.end());
std::sort(actual_list.begin(), actual_list.end());
diff --git a/chromium/net/reporting/reporting_context.h b/chromium/net/reporting/reporting_context.h
index e0bb4aad467..8d780dc3882 100644
--- a/chromium/net/reporting/reporting_context.h
+++ b/chromium/net/reporting/reporting_context.h
@@ -8,7 +8,6 @@
#include <memory>
#include "base/observer_list.h"
-#include "base/time/time.h"
#include "net/base/backoff_entry.h"
#include "net/base/net_export.h"
#include "net/base/rand_callback.h"
diff --git a/chromium/net/reporting/reporting_delivery_agent.cc b/chromium/net/reporting/reporting_delivery_agent.cc
index 80a7a8c9e75..1e815abd625 100644
--- a/chromium/net/reporting/reporting_delivery_agent.cc
+++ b/chromium/net/reporting/reporting_delivery_agent.cc
@@ -13,6 +13,7 @@
#include "base/bind.h"
#include "base/check.h"
+#include "base/containers/contains.h"
#include "base/json/json_writer.h"
#include "base/time/tick_clock.h"
#include "base/timer/timer.h"
diff --git a/chromium/net/reporting/reporting_delivery_agent_unittest.cc b/chromium/net/reporting/reporting_delivery_agent_unittest.cc
index 46462c802bd..17c62318488 100644
--- a/chromium/net/reporting/reporting_delivery_agent_unittest.cc
+++ b/chromium/net/reporting/reporting_delivery_agent_unittest.cc
@@ -117,7 +117,7 @@ TEST_F(ReportingDeliveryAgentTest, SuccessfulImmediateUpload) {
base::DictionaryValue* report;
ASSERT_TRUE(list->GetDictionary(0, &report));
- EXPECT_EQ(5u, report->size());
+ EXPECT_EQ(5u, report->DictSize());
ExpectDictIntegerValue(0, *report, "age");
ExpectDictStringValue(kType_, *report, "type");
@@ -163,7 +163,7 @@ TEST_F(ReportingDeliveryAgentTest, SuccessfulImmediateSubdomainUpload) {
base::DictionaryValue* report;
ASSERT_TRUE(list->GetDictionary(0, &report));
- EXPECT_EQ(5u, report->size());
+ EXPECT_EQ(5u, report->DictSize());
ExpectDictIntegerValue(0, *report, "age");
ExpectDictStringValue(kType_, *report, "type");
@@ -243,7 +243,7 @@ TEST_F(ReportingDeliveryAgentTest, SuccessfulDelayedUpload) {
base::DictionaryValue* report;
ASSERT_TRUE(list->GetDictionary(0, &report));
- EXPECT_EQ(5u, report->size());
+ EXPECT_EQ(5u, report->DictSize());
ExpectDictIntegerValue(0, *report, "age");
ExpectDictStringValue(kType_, *report, "type");
diff --git a/chromium/net/reporting/reporting_header_parser.cc b/chromium/net/reporting/reporting_header_parser.cc
index bf638f36840..10f6cef3041 100644
--- a/chromium/net/reporting/reporting_header_parser.cc
+++ b/chromium/net/reporting/reporting_header_parser.cc
@@ -13,7 +13,7 @@
#include "base/check.h"
#include "base/feature_list.h"
#include "base/json/json_reader.h"
-#include "base/metrics/histogram_macros.h"
+#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "base/values.h"
#include "net/base/features.h"
@@ -259,6 +259,12 @@ bool ProcessEndpointGroupStructuredHeader(
} // namespace
// static
+void ReportingHeaderParser::RecordReportingHeaderType(
+ ReportingHeaderType header_type) {
+ base::UmaHistogramEnumeration("Net.Reporting.HeaderType", header_type);
+}
+
+// static
void ReportingHeaderParser::ParseReportToHeader(
ReportingContext* context,
const NetworkIsolationKey& network_isolation_key,
@@ -288,12 +294,18 @@ void ReportingHeaderParser::ParseReportToHeader(
}
}
+ if (parsed_header.empty() && group_list->GetSize() > 0) {
+ RecordReportingHeaderType(ReportingHeaderType::kReportToInvalid);
+ }
+
// Remove the client if it has no valid endpoint groups.
if (parsed_header.empty()) {
cache->RemoveClient(network_isolation_key, origin);
return;
}
+ RecordReportingHeaderType(ReportingHeaderType::kReportTo);
+
cache->OnParsedHeader(network_isolation_key, origin,
std::move(parsed_header));
}
diff --git a/chromium/net/reporting/reporting_header_parser.h b/chromium/net/reporting/reporting_header_parser.h
index 829f03fd025..a332f4529b8 100644
--- a/chromium/net/reporting/reporting_header_parser.h
+++ b/chromium/net/reporting/reporting_header_parser.h
@@ -24,6 +24,14 @@ class ReportingContext;
class NET_EXPORT ReportingHeaderParser {
public:
+ // These values are persisted to logs. Entries should not be renumbered and
+ // numeric values should never be reused.
+ enum class ReportingHeaderType {
+ kReportTo = 0,
+ kReportToInvalid = 1,
+ kMaxValue = kReportToInvalid,
+ };
+
static void ParseReportToHeader(
ReportingContext* context,
const NetworkIsolationKey& network_isolation_key,
@@ -36,6 +44,8 @@ class NET_EXPORT ReportingHeaderParser {
const url::Origin& origin,
std::unique_ptr<structured_headers::Dictionary> value);
+ static void RecordReportingHeaderType(ReportingHeaderType header_type);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ReportingHeaderParser);
};
diff --git a/chromium/net/reporting/reporting_header_parser_unittest.cc b/chromium/net/reporting/reporting_header_parser_unittest.cc
index e3c00d2df35..fe0dc05367f 100644
--- a/chromium/net/reporting/reporting_header_parser_unittest.cc
+++ b/chromium/net/reporting/reporting_header_parser_unittest.cc
@@ -13,6 +13,7 @@
#include "base/stl_util.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
+#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
@@ -33,6 +34,8 @@ namespace {
using CommandType = MockPersistentReportingStore::Command::Type;
using Dictionary = structured_headers::Dictionary;
+constexpr char kReportingHeaderTypeHistogram[] = "Net.Reporting.HeaderType";
+
class ReportingHeaderParserTestBase
: public ReportingTestBase,
public ::testing::WithParamInterface<bool> {
@@ -236,30 +239,43 @@ TEST_P(ReportingHeaderParserTest, Invalid) {
"{\"max_age\":1, \"endpoints\": [{\"url\":\"https://b/\"}]}]",
"wrapped in list"}};
- for (size_t i = 0; i < base::size(kInvalidHeaderTestCases); ++i) {
- auto& test_case = kInvalidHeaderTestCases[i];
+ base::HistogramTester histograms;
+ int invalid_case_count = 0;
+
+ for (const auto& test_case : kInvalidHeaderTestCases) {
ParseHeader(kNik_, kUrl1_, test_case.header_value);
+ invalid_case_count++;
EXPECT_EQ(0u, cache()->GetEndpointCount())
<< "Invalid Report-To header (" << test_case.description << ": \""
<< test_case.header_value << "\") parsed as valid.";
-
+ histograms.ExpectBucketCount(
+ kReportingHeaderTypeHistogram,
+ ReportingHeaderParser::ReportingHeaderType::kReportToInvalid,
+ invalid_case_count);
if (mock_store()) {
mock_store()->Flush();
EXPECT_EQ(0, mock_store()->StoredEndpointsCount());
EXPECT_EQ(0, mock_store()->StoredEndpointGroupsCount());
}
}
+ histograms.ExpectBucketCount(
+ kReportingHeaderTypeHistogram,
+ ReportingHeaderParser::ReportingHeaderType::kReportTo, 0);
}
TEST_P(ReportingHeaderParserTest, Basic) {
std::vector<ReportingEndpoint::EndpointInfo> endpoints = {{kEndpoint1_}};
+ base::HistogramTester histograms;
std::string header =
ConstructHeaderGroupString(MakeEndpointGroup(kGroup1_, endpoints));
ParseHeader(kNik_, kUrl1_, header);
EXPECT_EQ(1u, cache()->GetEndpointGroupCountForTesting());
+ histograms.ExpectBucketCount(
+ kReportingHeaderTypeHistogram,
+ ReportingHeaderParser::ReportingHeaderType::kReportTo, 1);
EXPECT_TRUE(
EndpointGroupExistsInCache(kGroupKey11_, OriginSubdomains::DEFAULT));
EXPECT_TRUE(ClientExistsInCacheForOrigin(kOrigin1_));
@@ -292,9 +308,13 @@ TEST_P(ReportingHeaderParserTest, PathAbsoluteURLEndpoint) {
std::string header =
"{\"group\": \"group1\", \"max_age\":1, \"endpoints\": "
"[{\"url\":\"/path-absolute-url\"}]}";
+ base::HistogramTester histograms;
ParseHeader(kNik_, kUrl1_, header);
EXPECT_EQ(1u, cache()->GetEndpointGroupCountForTesting());
+ histograms.ExpectBucketCount(
+ kReportingHeaderTypeHistogram,
+ ReportingHeaderParser::ReportingHeaderType::kReportTo, 1);
EXPECT_TRUE(
EndpointGroupExistsInCache(kGroupKey11_, OriginSubdomains::DEFAULT));
EXPECT_TRUE(ClientExistsInCacheForOrigin(kOrigin1_));
@@ -1754,7 +1774,7 @@ class ReportingHeaderParserStructuredHeaderTest
void ParseHeader(const NetworkIsolationKey& network_isolation_key,
const url::Origin& origin,
const std::string& header_string) {
- base::Optional<Dictionary> header_dict =
+ absl::optional<Dictionary> header_dict =
structured_headers::ParseDictionary(header_string);
if (header_dict) {
diff --git a/chromium/net/reporting/reporting_report.h b/chromium/net/reporting/reporting_report.h
index dee358878cc..5da1dc27693 100644
--- a/chromium/net/reporting/reporting_report.h
+++ b/chromium/net/reporting/reporting_report.h
@@ -8,11 +8,11 @@
#include <memory>
#include <string>
-#include "base/optional.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
#include "net/base/network_isolation_key.h"
#include "net/reporting/reporting_endpoint.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
namespace base {
diff --git a/chromium/net/reporting/reporting_service.cc b/chromium/net/reporting/reporting_service.cc
index 9381c4e0931..3e237a8f245 100644
--- a/chromium/net/reporting/reporting_service.cc
+++ b/chromium/net/reporting/reporting_service.cc
@@ -12,7 +12,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "base/optional.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "base/values.h"
@@ -24,6 +23,7 @@
#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_header_parser.h"
#include "net/reporting/reporting_uploader.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
namespace net {
@@ -111,7 +111,7 @@ class ReportingServiceImpl : public ReportingService {
if (header_string.size() == 0 || header_string.size() > kMaxSHSize)
return;
- base::Optional<structured_headers::Dictionary> header_dict =
+ absl::optional<structured_headers::Dictionary> header_dict =
structured_headers::ParseDictionary(header_string);
if (!header_dict) {
DVLOG(1) << "Error processing Reporting-Endpoints header string: "
diff --git a/chromium/net/reporting/reporting_uploader_unittest.cc b/chromium/net/reporting/reporting_uploader_unittest.cc
index 0c184d097c2..484184b2576 100644
--- a/chromium/net/reporting/reporting_uploader_unittest.cc
+++ b/chromium/net/reporting/reporting_uploader_unittest.cc
@@ -61,7 +61,7 @@ void CheckUpload(const test_server::HttpRequest& request) {
std::unique_ptr<test_server::HttpResponse> AllowPreflight(
const test_server::HttpRequest& request) {
if (request.method_string != "OPTIONS") {
- return std::unique_ptr<test_server::HttpResponse>();
+ return nullptr;
}
auto it = request.headers.find("Origin");
EXPECT_TRUE(it != request.headers.end());
@@ -202,7 +202,7 @@ std::unique_ptr<test_server::HttpResponse> VerifyPreflight(
bool* preflight_received_out,
const test_server::HttpRequest& request) {
if (request.method_string != "OPTIONS") {
- return std::unique_ptr<test_server::HttpResponse>();
+ return nullptr;
}
*preflight_received_out = true;
return AllowPreflight(request);
@@ -245,7 +245,7 @@ TEST_F(ReportingUploaderTest, SkipPreflightForSameOrigin) {
std::unique_ptr<test_server::HttpResponse> ReturnPreflightError(
const test_server::HttpRequest& request) {
if (request.method_string != "OPTIONS") {
- return std::unique_ptr<test_server::HttpResponse>();
+ return nullptr;
}
auto response = std::make_unique<test_server::BasicHttpResponse>();
response->set_code(HTTP_FORBIDDEN);
@@ -270,7 +270,7 @@ TEST_F(ReportingUploaderTest, FailedCorsPreflight) {
std::unique_ptr<test_server::HttpResponse> ReturnPreflightWithoutOrigin(
const test_server::HttpRequest& request) {
if (request.method_string != "OPTIONS") {
- return std::unique_ptr<test_server::HttpResponse>();
+ return nullptr;
}
auto it = request.headers.find("Origin");
EXPECT_TRUE(it != request.headers.end());
@@ -300,7 +300,7 @@ TEST_F(ReportingUploaderTest, CorsPreflightWithoutOrigin) {
std::unique_ptr<test_server::HttpResponse> ReturnPreflightWithoutMethods(
const test_server::HttpRequest& request) {
if (request.method_string != "OPTIONS") {
- return std::unique_ptr<test_server::HttpResponse>();
+ return nullptr;
}
auto it = request.headers.find("Origin");
EXPECT_TRUE(it != request.headers.end());
@@ -330,7 +330,7 @@ TEST_F(ReportingUploaderTest, CorsPreflightWithoutMethods) {
std::unique_ptr<test_server::HttpResponse> ReturnPreflightWithoutHeaders(
const test_server::HttpRequest& request) {
if (request.method_string != "OPTIONS") {
- return std::unique_ptr<test_server::HttpResponse>();
+ return nullptr;
}
auto it = request.headers.find("Origin");
EXPECT_TRUE(it != request.headers.end());
@@ -377,7 +377,7 @@ std::unique_ptr<test_server::HttpResponse> ReturnRedirect(
const std::string& location,
const test_server::HttpRequest& request) {
if (request.relative_url != "/")
- return std::unique_ptr<test_server::HttpResponse>();
+ return nullptr;
auto response = std::make_unique<test_server::BasicHttpResponse>();
response->set_code(HTTP_FOUND);
@@ -392,7 +392,7 @@ std::unique_ptr<test_server::HttpResponse> CheckRedirect(
bool* redirect_followed_out,
const test_server::HttpRequest& request) {
if (request.relative_url != kRedirectPath)
- return std::unique_ptr<test_server::HttpResponse>();
+ return nullptr;
*redirect_followed_out = true;
return ReturnResponse(HTTP_OK, request);
@@ -453,7 +453,7 @@ TEST_F(ReportingUploaderTest, DontSendCookies) {
ResultSavingCookieCallback<CookieAccessResult> cookie_callback;
GURL url = server_.GetURL("/");
auto cookie = CanonicalCookie::Create(url, "foo=bar", base::Time::Now(),
- base::nullopt /* server_time */);
+ absl::nullopt /* server_time */);
context_.cookie_store()->SetCanonicalCookieAsync(
std::move(cookie), url, CookieOptions::MakeAllInclusive(),
cookie_callback.MakeCallback());