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

Unified Diff: net/url_request/url_request_context.h

Issue 2525743002: Make URLRequestContext a MemoryDumpProvider (Abandoned) (Closed)
Patch Set: self review 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
Index: net/url_request/url_request_context.h
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index 0158d9aca17282fb5153f318f65d596a3c5fb6ef..68fe507304e6c41f7ad70bb2a872a35ac58e580a 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -16,6 +16,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
+#include "base/trace_event/memory_dump_provider.h"
#include "net/base/net_export.h"
#include "net/base/request_priority.h"
#include "net/http/http_network_session.h"
@@ -24,6 +25,12 @@
#include "net/ssl/ssl_config_service.h"
#include "net/url_request/url_request.h"
+namespace base {
+namespace trace_event {
+class ProcessMemoryDump;
+}
+}
+
namespace net {
class CertVerifier;
class ChannelIDService;
@@ -51,10 +58,11 @@ class URLRequestThrottlerManager;
// URLRequestContext rather than creating a new one, as guaranteeing that the
// URLRequestContext is destroyed before its members can be difficult.
class NET_EXPORT URLRequestContext
- : NON_EXPORTED_BASE(public base::NonThreadSafe) {
+ : NON_EXPORTED_BASE(public base::NonThreadSafe),
+ public base::trace_event::MemoryDumpProvider {
public:
URLRequestContext();
- virtual ~URLRequestContext();
+ ~URLRequestContext() override;
// Copies the state from |other| into this context.
void CopyFrom(const URLRequestContext* other);
@@ -230,6 +238,14 @@ class NET_EXPORT URLRequestContext
bool enable_brotli() const { return enable_brotli_; }
+ void set_name_string(const std::string& name_string) {
+ name_string_ = name_string;
+ }
+
+ // MemoryDumpProvider implementation:
+ bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
+ base::trace_event::ProcessMemoryDump* pmd) override;
+
private:
// ---------------------------------------------------------------------------
// Important: When adding any new members below, consider whether they need to
@@ -269,6 +285,8 @@ class NET_EXPORT URLRequestContext
// Enables Brotli Content-Encoding support.
bool enable_brotli_;
+ std::string name_string_;
ssid 2016/12/02 21:36:35 just name_ or client_name_ or embedder_name_?
+
DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
};

Powered by Google App Engine
This is Rietveld 408576698