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

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

Issue 2542373002: RB-B P1 issue: Add debug aliases for state_ and urls to debug CHECK failures (Closed)
Patch Set: Keep alias string small to increase the chances of getting minidumps 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/loader/safe_browsing_resource_throttle.cc
diff --git a/chrome/browser/loader/safe_browsing_resource_throttle.cc b/chrome/browser/loader/safe_browsing_resource_throttle.cc
index 23a27088ef4fe9f2a774c7f7516457b8d5fddca2..1167a31df2658b728aa854aedbfd49ca07c54712 100644
--- a/chrome/browser/loader/safe_browsing_resource_throttle.cc
+++ b/chrome/browser/loader/safe_browsing_resource_throttle.cc
@@ -7,6 +7,7 @@
#include <iterator>
#include <utility>
+#include "base/debug/alias.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
@@ -233,9 +234,17 @@ void SafeBrowsingResourceThrottle::OnCheckBrowseUrlResult(
safe_browsing::SBThreatType threat_type,
const safe_browsing::ThreatMetadata& metadata) {
CHECK_EQ(state_, STATE_CHECKING_URL);
+ // TODO(vakh): The following base::debug::Alias() and CHECK calls should be
+ // removed after http://crbug.com/660293 is fixed.
CHECK(url.is_valid());
CHECK(url_being_checked_.is_valid());
- CHECK_EQ(url, url_being_checked_);
+ if (url != url_being_checked_) {
+ char buf[2000];
+ snprintf(buf, sizeof(buf), "sbtr::ocbur:%s -- %s\n", url.spec().c_str(),
+ url_being_checked_.spec().c_str());
+ base::debug::Alias(buf);
+ CHECK(false) << "buf: " << buf;
+ }
timer_.Stop(); // Cancel the timeout timer.
threat_type_ = threat_type;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698