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

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: Add TODO to remove debugging code after fixing bug 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..396226f09ea60c8ef70cf82ea2c5ef8ebba828e2 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"
@@ -232,10 +233,27 @@ void SafeBrowsingResourceThrottle::OnCheckBrowseUrlResult(
const GURL& url,
safe_browsing::SBThreatType threat_type,
const safe_browsing::ThreatMetadata& metadata) {
- CHECK_EQ(state_, STATE_CHECKING_URL);
- CHECK(url.is_valid());
- CHECK(url_being_checked_.is_valid());
- CHECK_EQ(url, url_being_checked_);
+ // TODO(vakh): The following base::debug::Alias() calls should be removed and
+ // CHECKs corrected after http://crbug.com/660293 is fixed.
+ base::debug::Alias(&state_);
+ base::debug::Alias(&url);
+ base::debug::Alias(&url_being_checked_);
Scott Hess - ex-Googler 2016/12/02 04:19:27 I am not sure that these work. They'll annotate t
+ std::string alias_str = base::StringPrintf(
+ "OnCheckBrowseUrlResult: state_: %d, url: %s, url_being_checked_: %s",
+ state_, url.spec().c_str(), url_being_checked_.spec().c_str());
Scott Hess - ex-Googler 2016/12/02 04:19:27 In fact, I'm not even sure this will work, because
+ base::debug::Alias(&alias_str);
+ if (!url_being_checked_.is_valid()) {
+ CHECK(false);
+ }
+ if (!url.is_valid()) {
+ CHECK(false);
+ }
+ if (url != url_being_checked_) {
+ CHECK(false);
+ }
+ if (state_ != STATE_CHECKING_URL) {
+ 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