Commit 92f51cda authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Keep track of the number of requests with keepalive set

This CL adds two histograms to measure how many requests with keepalive
set are used per process or globally.

Bug: 764589
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I3bb4f26d88a714c5fa37db408e76c725454dd12d
Reviewed-on: https://chromium-review.googlesource.com/892190
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533905}
parent 37d18e87
......@@ -63,10 +63,10 @@ class TestURLLoaderRequestHandler : public URLLoaderRequestHandler {
network::mojom::URLLoaderClientPtr client) {
*most_recent_resource_request_ = resource_request;
// The URLLoader will delete itself upon completion.
new network::URLLoader(context_, nullptr, std::move(request),
0 /* options */, resource_request,
false /* report_raw_headers */, std::move(client),
TRAFFIC_ANNOTATION_FOR_TESTS, 0 /* process_id */);
new network::URLLoader(
context_, nullptr, std::move(request), 0 /* options */,
resource_request, false /* report_raw_headers */, std::move(client),
TRAFFIC_ANNOTATION_FOR_TESTS, 0 /* process_id */, nullptr);
}
bool MaybeCreateLoaderForResponse(
......
......@@ -406,6 +406,10 @@ void ResourceDispatcherHostImpl::CancelRequestsForContext(
if (loader->GetRequestInfo()->GetContext() == context) {
loaders_to_cancel.push_back(std::move(i->second));
IncrementOutstandingRequestsMemory(-1, *loader->GetRequestInfo());
if (loader->GetRequestInfo()->keepalive()) {
keepalive_statistics_recorder_.OnLoadFinished(
loader->GetRequestInfo()->GetChildID());
}
pending_loaders_.erase(i++);
} else {
++i;
......@@ -702,6 +706,8 @@ void ResourceDispatcherHostImpl::OnShutdown() {
DCHECK(io_thread_task_runner_->BelongsToCurrentThread());
is_shutdown_ = true;
keepalive_statistics_recorder_.Shutdown();
pending_loaders_.clear();
// Make sure we shutdown the timers now, otherwise by the time our destructor
......@@ -1192,6 +1198,12 @@ void ResourceDispatcherHostImpl::ContinuePendingBeginRequest(
}
}
if (request_data.keepalive) {
const auto& map = keepalive_statistics_recorder_.per_process_records();
if (child_id != 0 && map.find(child_id) == map.end())
keepalive_statistics_recorder_.Register(child_id);
}
new_request->SetLoadFlags(load_flags);
// Make extra info and read footer (contains request ID).
......@@ -1551,6 +1563,9 @@ void ResourceDispatcherHostImpl::ResumeDeferredNavigation(
void ResourceDispatcherHostImpl::CancelRequestsForProcess(int child_id) {
CancelRequestsForRoute(
GlobalFrameRoutingId(child_id, MSG_ROUTING_NONE /* cancel all */));
const auto& map = keepalive_statistics_recorder_.per_process_records();
if (map.find(child_id) != map.end())
keepalive_statistics_recorder_.Unregister(child_id);
registered_temp_files_.erase(child_id);
}
......@@ -1664,6 +1679,9 @@ void ResourceDispatcherHostImpl::RemovePendingLoader(
const LoaderMap::iterator& iter) {
ResourceRequestInfoImpl* info = iter->second->GetRequestInfo();
if (info->keepalive())
keepalive_statistics_recorder_.OnLoadFinished(info->GetChildID());
// Remove the memory credit that we added when pushing the request onto
// the pending list.
IncrementOutstandingRequestsMemory(-1, *info);
......@@ -2221,6 +2239,8 @@ void ResourceDispatcherHostImpl::StartLoading(
ResourceLoader* loader_ptr = loader.get();
DCHECK(pending_loaders_[info->GetGlobalRequestID()] == nullptr);
pending_loaders_[info->GetGlobalRequestID()] = std::move(loader);
if (info->keepalive())
keepalive_statistics_recorder_.OnLoadStarted(info->GetChildID());
loader_ptr->StartRequest();
}
......
......@@ -40,6 +40,7 @@
#include "net/base/load_states.h"
#include "net/base/request_priority.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/keepalive_statistics_recorder.h"
#include "services/network/public/interfaces/url_loader.mojom.h"
#include "url/gurl.h"
......@@ -337,6 +338,10 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
return main_thread_task_runner_;
}
network::KeepaliveStatisticsRecorder* keepalive_statistics_recorder() {
return &keepalive_statistics_recorder_;
}
private:
class ScheduledResourceRequestAdapter;
friend class ResourceDispatcherHostTest;
......@@ -795,6 +800,8 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
// Used to invoke an interceptor for the HTTP header.
HeaderInterceptorMap http_header_interceptor_map_;
network::KeepaliveStatisticsRecorder keepalive_statistics_recorder_;
// Points to the registered download handler intercept.
CreateDownloadHandlerIntercept create_download_handler_intercept_;
......
......@@ -20,6 +20,8 @@ component("network_service") {
"http_server_properties_pref_delegate.h",
"ignore_errors_cert_verifier.cc",
"ignore_errors_cert_verifier.h",
"keepalive_statistics_recorder.cc",
"keepalive_statistics_recorder.h",
"loader_util.cc",
"loader_util.h",
"network_change_manager.cc",
......@@ -114,6 +116,7 @@ source_set("tests") {
"cookie_manager_unittest.cc",
"data_pipe_element_reader_unittest.cc",
"ignore_errors_cert_verifier_unittest.cc",
"keepalive_statistics_recorder_unittest.cc",
"network_change_manager_unittest.cc",
"network_context_unittest.cc",
"proxy_config_service_mojo_unittest.cc",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "services/network/keepalive_statistics_recorder.h"
#include <algorithm>
#include "base/metrics/histogram_macros.h"
namespace network {
KeepaliveStatisticsRecorder::KeepaliveStatisticsRecorder() = default;
KeepaliveStatisticsRecorder::~KeepaliveStatisticsRecorder() {
Shutdown();
}
void KeepaliveStatisticsRecorder::Register(int process_id) {
if (!is_active_)
return;
auto it = per_process_records_.find(process_id);
if (it == per_process_records_.end()) {
per_process_records_.insert(std::make_pair(process_id, PerProcessStats()));
return;
}
++it->second.num_registrations;
}
void KeepaliveStatisticsRecorder::Unregister(int process_id) {
if (!is_active_)
return;
auto it = per_process_records_.find(process_id);
DCHECK(it != per_process_records_.end());
if (it->second.num_registrations == 1) {
DumpPerProcessStats(it->second);
per_process_records_.erase(it);
return;
}
--it->second.num_registrations;
}
void KeepaliveStatisticsRecorder::OnLoadStarted(int process_id) {
if (!is_active_)
return;
auto it = per_process_records_.find(process_id);
if (it != per_process_records_.end()) {
++it->second.num_inflight_requests;
it->second.peak_inflight_requests = std::max(
it->second.peak_inflight_requests, it->second.num_inflight_requests);
}
++num_inflight_requests_;
peak_inflight_requests_ =
std::max(peak_inflight_requests_, num_inflight_requests_);
}
void KeepaliveStatisticsRecorder::OnLoadFinished(int process_id) {
if (!is_active_)
return;
auto it = per_process_records_.find(process_id);
if (it != per_process_records_.end())
--it->second.num_inflight_requests;
--num_inflight_requests_;
}
void KeepaliveStatisticsRecorder::Shutdown() {
if (!is_active_)
return;
for (const auto& pair : per_process_records_)
DumpPerProcessStats(pair.second);
per_process_records_.clear();
UMA_HISTOGRAM_COUNTS_1000(
"Net.KeepaliveStatisticsRecorder.PeakInflightRequests",
peak_inflight_requests_);
is_active_ = false;
}
int KeepaliveStatisticsRecorder::NumInflightRequestsPerProcess(
int process_id) const {
auto it = per_process_records_.find(process_id);
if (it == per_process_records_.end())
return 0;
return it->second.num_inflight_requests;
}
void KeepaliveStatisticsRecorder::DumpPerProcessStats(
const PerProcessStats& stats) {
UMA_HISTOGRAM_COUNTS_100(
"Net.KeepaliveStatisticsRecorder.PeakInflightRequestsPerProcess",
stats.peak_inflight_requests);
}
} // namespace network
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SERVICES_NETWORK_KEEPALIVE_STATISTICS_RECORDER_H_
#define SERVICES_NETWORK_KEEPALIVE_STATISTICS_RECORDER_H_
#include <unordered_map>
#include "base/component_export.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
namespace network {
// KeepaliveStatisticsRecorder keeps tracks of the number of inflight requests
// with "keepalive" set and records UMA histograms.
class COMPONENT_EXPORT(NETWORK_SERVICE) KeepaliveStatisticsRecorder
: public base::SupportsWeakPtr<KeepaliveStatisticsRecorder> {
public:
struct PerProcessStats {
int num_registrations = 1;
int num_inflight_requests = 0;
int peak_inflight_requests = 0;
};
KeepaliveStatisticsRecorder();
~KeepaliveStatisticsRecorder();
// Registers / Unregisters |process_id| to this object. There can be multiple
// Register / Unregister calls with the same |process_id|, and this object
// thinks a process |p| is gone when the number of Register calls with |p|
// equals to the number of Unregister calls with |p|.
void Register(int process_id);
void Unregister(int process_id);
// Called when a request with keepalive set starts.
void OnLoadStarted(int process_id);
// Called when a request with keepalive set finishes.
void OnLoadFinished(int process_id);
void Shutdown();
const std::unordered_map<int, PerProcessStats>& per_process_records() const {
return per_process_records_;
}
int NumInflightRequestsPerProcess(int process_id) const;
int num_inflight_requests() const { return num_inflight_requests_; }
int peak_inflight_requests() const { return peak_inflight_requests_; }
private:
void DumpPerProcessStats(const PerProcessStats& stats);
std::unordered_map<int, PerProcessStats> per_process_records_;
int num_inflight_requests_ = 0;
int peak_inflight_requests_ = 0;
bool is_active_ = true;
DISALLOW_COPY_AND_ASSIGN(KeepaliveStatisticsRecorder);
};
} // namespace network
#endif // SERVICES_NETWORK_KEEPALIVE_STATISTICS_RECORDER_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "services/network/keepalive_statistics_recorder.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace network {
namespace {
TEST(KeepaliveStatisticsRecorderTest, InitialState) {
KeepaliveStatisticsRecorder r;
EXPECT_EQ(0, r.num_inflight_requests());
EXPECT_EQ(0, r.peak_inflight_requests());
EXPECT_TRUE(r.per_process_records().empty());
}
TEST(KeepaliveStatisticsRecorderTest, Register) {
KeepaliveStatisticsRecorder r;
constexpr int process_id = 4;
r.Register(process_id);
EXPECT_EQ(0, r.num_inflight_requests());
EXPECT_EQ(0, r.peak_inflight_requests());
const auto& map = r.per_process_records();
EXPECT_EQ(1u, map.size());
auto it = map.find(process_id);
ASSERT_NE(it, map.end());
EXPECT_EQ(1, it->second.num_registrations);
EXPECT_EQ(0, it->second.num_inflight_requests);
EXPECT_EQ(0, it->second.peak_inflight_requests);
}
TEST(KeepaliveStatisticsRecorderTest, Unregister) {
KeepaliveStatisticsRecorder r;
constexpr int process_id = 4;
r.Register(process_id);
EXPECT_FALSE(r.per_process_records().empty());
r.Unregister(process_id);
EXPECT_TRUE(r.per_process_records().empty());
}
TEST(KeepaliveStatisticsRecorderTest, MultipleRegistration) {
KeepaliveStatisticsRecorder r;
constexpr int process1 = 4;
constexpr int process2 = 7;
constexpr int process3 = 8;
r.Register(process1);
r.Register(process2);
r.Register(process3);
r.Register(process1);
r.Register(process2);
r.Unregister(process1);
r.Unregister(process3);
const auto& map = r.per_process_records();
EXPECT_EQ(2u, map.size());
auto it1 = map.find(process1);
auto it2 = map.find(process2);
auto it3 = map.find(process3);
EXPECT_NE(it1, map.end());
EXPECT_EQ(1, it1->second.num_registrations);
EXPECT_EQ(0, it1->second.num_inflight_requests);
EXPECT_EQ(0, it1->second.peak_inflight_requests);
EXPECT_NE(it2, map.end());
EXPECT_EQ(2, it2->second.num_registrations);
EXPECT_EQ(0, it2->second.num_inflight_requests);
EXPECT_EQ(0, it2->second.peak_inflight_requests);
EXPECT_EQ(it3, map.end());
}
TEST(KeepaliveStatisticsRecorderTest, IssueOneRequest) {
KeepaliveStatisticsRecorder r;
constexpr int process = 4;
r.Register(process);
r.OnLoadStarted(process);
{
const auto& map = r.per_process_records();
EXPECT_EQ(1u, map.size());
auto it = map.find(process);
ASSERT_NE(it, map.end());
EXPECT_EQ(1, it->second.num_registrations);
EXPECT_EQ(1, it->second.num_inflight_requests);
EXPECT_EQ(1, it->second.peak_inflight_requests);
EXPECT_EQ(1, r.num_inflight_requests());
EXPECT_EQ(1, r.peak_inflight_requests());
}
r.OnLoadFinished(process);
{
const auto& map = r.per_process_records();
EXPECT_EQ(1u, map.size());
auto it = map.find(process);
ASSERT_NE(it, map.end());
EXPECT_EQ(1, it->second.num_registrations);
EXPECT_EQ(0, it->second.num_inflight_requests);
EXPECT_EQ(1, it->second.peak_inflight_requests);
EXPECT_EQ(0, r.num_inflight_requests());
EXPECT_EQ(1, r.peak_inflight_requests());
}
}
TEST(KeepaliveStatisticsRecorderTest, IssueRequests) {
KeepaliveStatisticsRecorder r;
constexpr int process1 = 2;
constexpr int process2 = 3;
constexpr int no_process = 0;
r.Register(process1);
r.Register(process1);
r.Register(process1);
r.Register(process2);
r.Register(process2);
r.OnLoadStarted(process1);
r.OnLoadStarted(process1);
r.OnLoadStarted(process2);
r.OnLoadStarted(process2);
r.OnLoadStarted(process2);
r.OnLoadStarted(process2);
r.OnLoadStarted(no_process);
r.OnLoadFinished(process2);
r.OnLoadFinished(process2);
r.OnLoadFinished(process2);
r.OnLoadStarted(process2);
r.OnLoadStarted(no_process);
r.OnLoadStarted(no_process);
r.OnLoadStarted(no_process);
r.OnLoadStarted(no_process);
r.OnLoadStarted(no_process);
r.OnLoadFinished(no_process);
const auto& map = r.per_process_records();
EXPECT_EQ(2u, map.size());
auto it1 = map.find(process1);
auto it2 = map.find(process2);
ASSERT_NE(it1, map.end());
EXPECT_EQ(3, it1->second.num_registrations);
EXPECT_EQ(2, it1->second.num_inflight_requests);
EXPECT_EQ(2, it1->second.peak_inflight_requests);
ASSERT_NE(it2, map.end());
EXPECT_EQ(2, it2->second.num_registrations);
EXPECT_EQ(2, it2->second.num_inflight_requests);
EXPECT_EQ(4, it2->second.peak_inflight_requests);
EXPECT_EQ(9, r.num_inflight_requests());
EXPECT_EQ(10, r.peak_inflight_requests());
}
TEST(KeepaliveStatisticsRecorderTest, ProcessReuse) {
KeepaliveStatisticsRecorder r;
constexpr int process = 2;
r.Register(process);
r.OnLoadStarted(process);
r.OnLoadStarted(process);
r.OnLoadStarted(process);
r.OnLoadFinished(process);
r.OnLoadFinished(process);
r.OnLoadFinished(process);
r.Unregister(process);
r.Register(process);
const auto& map = r.per_process_records();
EXPECT_EQ(1u, map.size());
auto it = map.find(process);
ASSERT_NE(it, map.end());
EXPECT_EQ(1, it->second.num_registrations);
EXPECT_EQ(0, it->second.num_inflight_requests);
EXPECT_EQ(0, it->second.peak_inflight_requests);
}
} // namespace
} // namespace network
......@@ -17,6 +17,7 @@
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/strong_binding_set.h"
#include "services/network/cookie_manager.h"
#include "services/network/keepalive_statistics_recorder.h"
#include "services/network/public/interfaces/network_service.mojom.h"
#include "services/network/public/interfaces/udp_socket.mojom.h"
#include "services/network/public/interfaces/url_loader_factory.mojom.h"
......@@ -80,6 +81,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
NetworkService* network_service() { return network_service_; }
KeepaliveStatisticsRecorder* keepalive_statistics_recorder() {
return &keepalive_statistics_recorder_;
}
// mojom::NetworkContext implementation:
void CreateURLLoaderFactory(mojom::URLLoaderFactoryRequest request,
uint32_t process_id) override;
......@@ -141,6 +146,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
// NetworkServiceURLLoaderFactory instances.
mojo::StrongBindingSet<mojom::URLLoaderFactory> loader_factory_bindings_;
KeepaliveStatisticsRecorder keepalive_statistics_recorder_;
mojom::NetworkContextParamsPtr params_;
mojo::Binding<mojom::NetworkContext> binding_;
......
......@@ -16,10 +16,12 @@ NetworkServiceURLLoaderFactory::NetworkServiceURLLoaderFactory(
NetworkContext* context,
uint32_t process_id)
: context_(context), process_id_(process_id) {
ignore_result(process_id_);
context->keepalive_statistics_recorder()->Register(process_id_);
}
NetworkServiceURLLoaderFactory::~NetworkServiceURLLoaderFactory() = default;
NetworkServiceURLLoaderFactory::~NetworkServiceURLLoaderFactory() {
context_->keepalive_statistics_recorder()->Unregister(process_id_);
}
void NetworkServiceURLLoaderFactory::CreateLoaderAndStart(
mojom::URLLoaderRequest request,
......@@ -45,7 +47,7 @@ void NetworkServiceURLLoaderFactory::CreateLoaderAndStart(
std::move(request), options, url_request, report_raw_headers,
std::move(client),
static_cast<net::NetworkTrafficAnnotationTag>(traffic_annotation),
process_id_);
process_id_, context_->keepalive_statistics_recorder()->AsWeakPtr());
}
void NetworkServiceURLLoaderFactory::Clone(
......
......@@ -242,7 +242,8 @@ URLLoader::URLLoader(
bool report_raw_headers,
mojom::URLLoaderClientPtr url_loader_client,
const net::NetworkTrafficAnnotationTag& traffic_annotation,
uint32_t process_id)
uint32_t process_id,
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder)
: url_request_context_getter_(url_request_context_getter),
network_service_client_(network_service_client),
options_(options),
......@@ -251,6 +252,7 @@ URLLoader::URLLoader(
process_id_(process_id),
render_frame_id_(request.render_frame_id),
connected_(true),
keepalive_(request.keepalive),
binding_(this, std::move(url_loader_request)),
url_loader_client_(std::move(url_loader_client)),
writable_handle_watcher_(FROM_HERE,
......@@ -258,6 +260,7 @@ URLLoader::URLLoader(
peer_closed_handle_watcher_(FROM_HERE,
mojo::SimpleWatcher::ArmingPolicy::MANUAL),
report_raw_headers_(report_raw_headers),
keepalive_statistics_recorder_(std::move(keepalive_statistics_recorder)),
weak_ptr_factory_(this) {
url_request_context_getter_->AddObserver(this);
binding_.set_connection_error_handler(
......@@ -305,12 +308,18 @@ URLLoader::URLLoader(
base::Bind(&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
}
if (keepalive_ && keepalive_statistics_recorder_)
keepalive_statistics_recorder_->OnLoadStarted(process_id_);
url_request_->Start();
}
URLLoader::~URLLoader() {
RecordBodyReadFromNetBeforePausedIfNeeded();
url_request_context_getter_->RemoveObserver(this);
if (keepalive_ && keepalive_statistics_recorder_)
keepalive_statistics_recorder_->OnLoadFinished(process_id_);
}
void URLLoader::FollowRedirect() {
......
......@@ -18,6 +18,7 @@
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context_getter_observer.h"
#include "services/network/keepalive_statistics_recorder.h"
#include "services/network/public/interfaces/network_service.mojom.h"
#include "services/network/public/interfaces/url_loader.mojom.h"
#include "services/network/upload_progress_tracker.h"
......@@ -30,6 +31,7 @@ class URLRequestContextGetter;
namespace network {
class NetToMojoPendingBuffer;
class KeepaliveStatisticsRecorder;
struct ResourceResponse;
class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
......@@ -46,7 +48,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
bool report_raw_headers,
mojom::URLLoaderClientPtr url_loader_client,
const net::NetworkTrafficAnnotationTag& traffic_annotation,
uint32_t process_id);
uint32_t process_id,
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder);
~URLLoader() override;
// mojom::URLLoader implementation:
......@@ -109,6 +112,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
uint32_t process_id_;
uint32_t render_frame_id_;
bool connected_;
const bool keepalive_;
std::unique_ptr<net::URLRequest> url_request_;
mojo::Binding<mojom::URLLoader> binding_;
mojom::URLLoaderClientPtr url_loader_client_;
......@@ -148,6 +152,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
mojom::SSLPrivateKeyPtr ssl_private_key_;
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder_;
base::WeakPtrFactory<URLLoader> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(URLLoader);
......
......@@ -256,7 +256,7 @@ class URLLoaderTest : public testing::Test {
URLLoader loader_impl(context(), nullptr, mojo::MakeRequest(&loader),
options, request, false, client_.CreateInterfacePtr(),
TRAFFIC_ANNOTATION_FOR_TESTS, 0);
TRAFFIC_ANNOTATION_FOR_TESTS, 0, nullptr);
ran_ = true;
......@@ -604,7 +604,7 @@ TEST_F(URLLoaderTest, DestroyContextWithLiveRequest) {
base::WeakPtr<URLLoader> loader_impl =
(new URLLoader(context(), nullptr, mojo::MakeRequest(&loader), 0, request,
false, client()->CreateInterfacePtr(),
TRAFFIC_ANNOTATION_FOR_TESTS, 0))
TRAFFIC_ANNOTATION_FOR_TESTS, 0, nullptr))
->GetWeakPtrForTests();
client()->RunUntilResponseReceived();
......@@ -761,7 +761,7 @@ TEST_F(URLLoaderTest, CloseResponseBodyConsumerBeforeProducer) {
// The loader is implicitly owned by the client and the NetworkContext.
new URLLoader(context(), nullptr, mojo::MakeRequest(&loader), 0, request,
false, client()->CreateInterfacePtr(),
TRAFFIC_ANNOTATION_FOR_TESTS, 0);
TRAFFIC_ANNOTATION_FOR_TESTS, 0, nullptr);
client()->RunUntilResponseBodyArrived();
EXPECT_TRUE(client()->has_received_response());
......@@ -807,7 +807,7 @@ TEST_F(URLLoaderTest, PauseReadingBodyFromNetBeforeRespnoseHeaders) {
// The loader is implicitly owned by the client and the NetworkContext.
new URLLoader(context(), nullptr, mojo::MakeRequest(&loader), 0, request,
false, client()->CreateInterfacePtr(),
TRAFFIC_ANNOTATION_FOR_TESTS, 0);
TRAFFIC_ANNOTATION_FOR_TESTS, 0, nullptr);
// Pausing reading response body from network stops future reads from the
// underlying URLRequest. So no data should be sent using the response body
......@@ -875,7 +875,7 @@ TEST_F(URLLoaderTest, PauseReadingBodyFromNetWhenReadIsPending) {
// The loader is implicitly owned by the client and the NetworkContext.
new URLLoader(context(), nullptr, mojo::MakeRequest(&loader), 0, request,
false, client()->CreateInterfacePtr(),
TRAFFIC_ANNOTATION_FOR_TESTS, 0);
TRAFFIC_ANNOTATION_FOR_TESTS, 0, nullptr);
response_controller.WaitForRequest();
response_controller.Send(
......@@ -932,7 +932,7 @@ TEST_F(URLLoaderTest, ResumeReadingBodyFromNetAfterClosingConsumer) {
// The loader is implicitly owned by the client and the NetworkContext.
new URLLoader(context(), nullptr, mojo::MakeRequest(&loader), 0, request,
false, client()->CreateInterfacePtr(),
TRAFFIC_ANNOTATION_FOR_TESTS, 0);
TRAFFIC_ANNOTATION_FOR_TESTS, 0, nullptr);
loader->PauseReadingBodyFromNet();
loader.FlushForTesting();
......@@ -983,7 +983,7 @@ TEST_F(URLLoaderTest, MultiplePauseResumeReadingBodyFromNet) {
// The loader is implicitly owned by the client and the NetworkContext.
new URLLoader(context(), nullptr, mojo::MakeRequest(&loader), 0, request,
false, client()->CreateInterfacePtr(),
TRAFFIC_ANNOTATION_FOR_TESTS, 0);
TRAFFIC_ANNOTATION_FOR_TESTS, 0, nullptr);
// It is okay to call ResumeReadingBodyFromNet() even if there is no prior
// PauseReadingBodyFromNet().
......
......@@ -44784,6 +44784,24 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
<histogram name="Net.KeepaliveStatisticsRecorder.PeakInflightRequests"
units="requests">
<owner>yhirano@chromium.org</owner>
<summary>
The peak number of concurrent outstanding requests with keepalive specified.
</summary>
</histogram>
<histogram
name="Net.KeepaliveStatisticsRecorder.PeakInflightRequestsPerProcess"
units="requests">
<owner>yhirano@chromium.org</owner>
<summary>
The peak number of concurrent outstanding requests with keepalive specified
per render process.
</summary>
</histogram>
<histogram name="Net.LoadPrefetch.Pattern" enum="PrefetchStatus">
<owner>droger@chromium.org</owner>
<owner>mattcary@chromium.org</owner>
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