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

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: Alias the right way 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..e7cf11b8c924102a4e326771c5c8b98a2bff799d 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,21 @@ 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 debug_url_buf[2000], debug_url_checked_buf[2000];
+ base::strlcpy(debug_url_buf, url.spec().c_str(), arraysize(debug_url_buf));
+ base::debug::Alias(&debug_url_buf);
+ base::strlcpy(debug_url_checked_buf, url_being_checked_.spec().c_str(),
+ arraysize(debug_url_checked_buf));
+ base::debug::Alias(&debug_url_checked_buf);
Scott Hess - ex-Googler 2016/12/02 23:21:13 Suggestion: Put something easy to search for in th
vakh (use Gerrit instead) 2016/12/02 23:30:37 Done.
+ DVLOG(1) << "debug_url_buf: " << debug_url_buf;
+ DVLOG(1) << "debug_url_checked_buf: " << debug_url_checked_buf;
Scott Hess - ex-Googler 2016/12/02 23:21:13 Do you run a long-term browser with settings that
vakh (use Gerrit instead) 2016/12/02 23:30:37 Yes, was planning on running the browser but I als
+ CHECK(false);
+ }
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