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

Unified Diff: net/base/network_delegate.cc

Issue 1834273002: Add TRACE_EVENT macros to net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments. Created 4 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 | « content/browser/loader/resource_loader.cc ('k') | net/base/network_quality_estimator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_delegate.cc
diff --git a/net/base/network_delegate.cc b/net/base/network_delegate.cc
index 8c23a5329424896f7e637312a22a113f6759d9cd..113b7481478458d50ba6a42f4613bc0c0de69642 100644
--- a/net/base/network_delegate.cc
+++ b/net/base/network_delegate.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/profiler/scoped_tracker.h"
+#include "base/trace_event/trace_event.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_info.h"
@@ -16,6 +17,8 @@ namespace net {
int NetworkDelegate::NotifyBeforeURLRequest(
URLRequest* request, const CompletionCallback& callback,
GURL* new_url) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
+ "NetworkDelegate::NotifyBeforeURLRequest");
DCHECK(CalledOnValidThread());
DCHECK(request);
DCHECK(!callback.is_null());
@@ -29,6 +32,8 @@ int NetworkDelegate::NotifyBeforeURLRequest(
int NetworkDelegate::NotifyBeforeSendHeaders(
URLRequest* request, const CompletionCallback& callback,
HttpRequestHeaders* headers) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
+ "NetworkDelegate::NotifyBeforeSendHeaders");
DCHECK(CalledOnValidThread());
DCHECK(headers);
DCHECK(!callback.is_null());
@@ -46,6 +51,8 @@ void NetworkDelegate::NotifyBeforeSendProxyHeaders(
void NetworkDelegate::NotifySendHeaders(URLRequest* request,
const HttpRequestHeaders& headers) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
+ "NetworkDelegate::NotifySendHeaders");
DCHECK(CalledOnValidThread());
OnSendHeaders(request, headers);
}
@@ -56,6 +63,8 @@ int NetworkDelegate::NotifyHeadersReceived(
const HttpResponseHeaders* original_response_headers,
scoped_refptr<HttpResponseHeaders>* override_response_headers,
GURL* allowed_unsafe_redirect_url) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
+ "NetworkDelegate::NotifyHeadersReceived");
DCHECK(CalledOnValidThread());
DCHECK(original_response_headers);
DCHECK(!callback.is_null());
@@ -74,6 +83,8 @@ void NetworkDelegate::NotifyResponseStarted(URLRequest* request) {
void NetworkDelegate::NotifyNetworkBytesReceived(URLRequest* request,
int64_t bytes_received) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
+ "NetworkDelegate::NotifyNetworkBytesReceived");
DCHECK(CalledOnValidThread());
DCHECK_GT(bytes_received, 0);
OnNetworkBytesReceived(request, bytes_received);
@@ -94,6 +105,8 @@ void NetworkDelegate::NotifyBeforeRedirect(URLRequest* request,
}
void NetworkDelegate::NotifyCompleted(URLRequest* request, bool started) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
+ "NetworkDelegate::NotifyCompleted");
DCHECK(CalledOnValidThread());
DCHECK(request);
// TODO(cbentzel): Remove ScopedTracker below once crbug.com/475753 is fixed.
@@ -103,6 +116,8 @@ void NetworkDelegate::NotifyCompleted(URLRequest* request, bool started) {
}
void NetworkDelegate::NotifyURLRequestDestroyed(URLRequest* request) {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
+ "NetworkDelegate::NotifyURLRequestDestroyed");
DCHECK(CalledOnValidThread());
DCHECK(request);
OnURLRequestDestroyed(request);
@@ -147,6 +162,8 @@ bool NetworkDelegate::CanAccessFile(const URLRequest& request,
bool NetworkDelegate::CanEnablePrivacyMode(
const GURL& url,
const GURL& first_party_for_cookies) const {
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"),
+ "NetworkDelegate::CanEnablePrivacyMode");
DCHECK(CalledOnValidThread());
return OnCanEnablePrivacyMode(url, first_party_for_cookies);
}
« no previous file with comments | « content/browser/loader/resource_loader.cc ('k') | net/base/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698