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

Unified Diff: net/url_request/url_request.cc

Issue 2540233002: Instrument SourceStream using MemoryDumpProvider
Patch Set: Rebased Created 4 years 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 | « net/url_request/url_request.h ('k') | net/url_request/url_request_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 75eb4220106fe424eb49df9492143b2558913953..a29e852ba44a75721a7adead7b7700f198178879 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -15,9 +15,12 @@
#include "base/profiler/scoped_tracker.h"
#include "base/rand_util.h"
#include "base/stl_util.h"
+#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/trace_event/memory_allocator_dump.h"
+#include "base/trace_event/process_memory_dump.h"
#include "base/values.h"
#include "net/base/auth.h"
#include "net/base/host_port_pair.h"
@@ -1214,6 +1217,17 @@ void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const {
out->clear();
}
+void URLRequest::DumpMemoryStats(
+ base::trace_event::ProcessMemoryDump* pmd,
+ const std::string& parent_dump_absolute_name) const {
+ if (!job_)
+ return;
+ base::trace_event::MemoryAllocatorDump* url_request_dump =
+ pmd->CreateAllocatorDump(base::StringPrintf(
+ "%s/url_request_%p", parent_dump_absolute_name.c_str(), this));
+ job_->DumpMemoryStats(pmd, url_request_dump->absolute_name());
+}
+
void URLRequest::set_status(URLRequestStatus status) {
DCHECK(status_.is_io_pending() || status_.is_success() ||
(!status.is_success() && !status.is_io_pending()));
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698