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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2802113002: One minor cleanup for JobController::EstimateMemoryUsage() (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job_controller.cc
diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc
index 7c420b5365933517cc8d724551649b3456272526..6972d27a57689f4002f4ca141a0327f959e314ee 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -13,6 +13,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "base/values.h"
#include "net/base/host_mapping_rules.h"
#include "net/base/proxy_delegate.h"
@@ -679,12 +680,8 @@ bool HttpStreamFactoryImpl::JobController::HasPendingAltJob() const {
}
size_t HttpStreamFactoryImpl::JobController::EstimateMemoryUsage() const {
- size_t estimated_size = 0;
- if (main_job_)
- estimated_size += main_job_->EstimateMemoryUsage();
- if (alternative_job_)
- estimated_size += alternative_job_->EstimateMemoryUsage();
- return estimated_size;
+ return base::trace_event::EstimateMemoryUsage(main_job_) +
+ base::trace_event::EstimateMemoryUsage(alternative_job_);
}
WebSocketHandshakeStreamBase::CreateHelper* HttpStreamFactoryImpl::
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698