summaryrefslogtreecommitdiff
path: root/chromium/net/disk_cache/simple/simple_entry_impl.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-05 17:15:33 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-11 07:47:18 +0000
commit7324afb043a0b1e623d8e8eb906cdc53bdeb4685 (patch)
treea3fe2d74ea9c9e142c390dac4ca0e219382ace46 /chromium/net/disk_cache/simple/simple_entry_impl.cc
parent6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (diff)
downloadqtwebengine-chromium-7324afb043a0b1e623d8e8eb906cdc53bdeb4685.tar.gz
BASELINE: Update Chromium to 58.0.3029.54
Change-Id: I67f57065a7afdc8e4614adb5c0230281428df4d1 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/net/disk_cache/simple/simple_entry_impl.cc')
-rw-r--r--chromium/net/disk_cache/simple/simple_entry_impl.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/chromium/net/disk_cache/simple/simple_entry_impl.cc b/chromium/net/disk_cache/simple/simple_entry_impl.cc
index 23136ba60e5..2b354cd0f68 100644
--- a/chromium/net/disk_cache/simple/simple_entry_impl.cc
+++ b/chromium/net/disk_cache/simple/simple_entry_impl.cc
@@ -20,6 +20,7 @@
#include "base/task_runner_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/net_log_parameters.h"
@@ -149,6 +150,13 @@ using base::FilePath;
using base::Time;
using base::TaskRunner;
+// Static function called by base::trace_event::EstimateMemoryUsage() to
+// estimate the memory of SimpleEntryOperation.
+// This needs to be in disk_cache namespace.
+size_t EstimateMemoryUsage(const SimpleEntryOperation& op) {
+ return 0;
+}
+
// A helper class to insure that RunNextOperationIfNeeded() is called when
// exiting the current stack frame.
class SimpleEntryImpl::ScopedOperationRunner {
@@ -543,6 +551,15 @@ int SimpleEntryImpl::ReadyForSparseIO(const CompletionCallback& callback) {
return net::OK;
}
+size_t SimpleEntryImpl::EstimateMemoryUsage() const {
+ // TODO(xunjieli): crbug.com/669108. It'd be nice to have the rest of |entry|
+ // measured, but the ownership of SimpleSynchronousEntry isn't straightforward
+ return sizeof(SimpleSynchronousEntry) +
+ base::trace_event::EstimateMemoryUsage(pending_operations_) +
+ base::trace_event::EstimateMemoryUsage(executing_operation_) +
+ (stream_0_data_ ? stream_0_data_->capacity() : 0);
+}
+
SimpleEntryImpl::~SimpleEntryImpl() {
DCHECK(io_thread_checker_.CalledOnValidThread());
DCHECK_EQ(0U, pending_operations_.size());