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

Unified Diff: chrome/browser/renderer_host/safe_browsing_resource_throttle.cc

Issue 1569673002: [NOT FOR LANDING] Detailed loading traces Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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
Index: chrome/browser/renderer_host/safe_browsing_resource_throttle.cc
diff --git a/chrome/browser/renderer_host/safe_browsing_resource_throttle.cc b/chrome/browser/renderer_host/safe_browsing_resource_throttle.cc
index 891ee982b500dbd4e253a9f7905b9824b02d2fe7..2c781227f80de6b828de94274197258857a4689d 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_throttle.cc
+++ b/chrome/browser/renderer_host/safe_browsing_resource_throttle.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/trace_event/trace_event.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
@@ -98,6 +99,9 @@ SafeBrowsingResourceThrottle::SafeBrowsingResourceThrottle(
NetLog::SOURCE_SAFE_BROWSING)) {}
SafeBrowsingResourceThrottle::~SafeBrowsingResourceThrottle() {
+ TRACE_EVENT0("toplevel",
+ "SafeBrowsingResourceThrottle::~SafeBrowsingResourceThrottle");
+
if (defer_state_ != DEFERRED_NONE) {
EndNetLogEvent(NetLog::TYPE_SAFE_BROWSING_DEFERRED, nullptr, nullptr);
}
@@ -132,6 +136,8 @@ void SafeBrowsingResourceThrottle::EndNetLogEvent(NetLog::EventType type,
}
void SafeBrowsingResourceThrottle::WillStartRequest(bool* defer) {
+ TRACE_EVENT0("toplevel", "SafeBrowsingResourceThrottle::WillStartRequest");
+
// We need to check the new URL before starting the request.
if (CheckUrl(request_->url()))
return;
@@ -323,6 +329,7 @@ void SafeBrowsingResourceThrottle::OnBlockingPageComplete(bool proceed) {
}
bool SafeBrowsingResourceThrottle::CheckUrl(const GURL& url) {
+ TRACE_EVENT0("toplevel", "SafeBrowsingResourceThrottle::CheckUrl");
TRACE_EVENT1("loader", "SafeBrowsingResourceThrottle::CheckUrl", "url",
url.spec());
CHECK_EQ(state_, STATE_NONE);
@@ -334,7 +341,12 @@ bool SafeBrowsingResourceThrottle::CheckUrl(const GURL& url) {
return true;
}
- bool succeeded_synchronously = database_manager_->CheckBrowseUrl(url, this);
+ bool succeeded_synchronously;
+ {
+ TRACE_EVENT0("toplevel", "SafeBrowsingDatabaseManaager::CheckBrowseUrl");
+ succeeded_synchronously = database_manager_->CheckBrowseUrl(url, this);
+ }
+
UMA_HISTOGRAM_ENUMERATION("SB2.ResourceTypes2.Checked", resource_type_,
content::RESOURCE_TYPE_LAST_TYPE);

Powered by Google App Engine
This is Rietveld 408576698