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

Unified Diff: net/base/net_log.cc

Issue 374033002: Fixes for re-enabling more MSVC level 4 warnings: net/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comment Created 6 years, 5 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 | « net/base/dns_util_unittest.cc ('k') | net/cert/test_root_certs_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log.cc
diff --git a/net/base/net_log.cc b/net/base/net_log.cc
index 6016d0de026d44d2b92a1c8654f45ef02420a1ba..36c94ca9441734cc887c5085f48357066cf31a59 100644
--- a/net/base/net_log.cc
+++ b/net/base/net_log.cc
@@ -101,10 +101,10 @@ NetLog::ParametersCallback NetLog::Source::ToEventParametersCallback() const {
// static
bool NetLog::Source::FromEventParameters(base::Value* event_params,
Source* source) {
- base::DictionaryValue* dict;
- base::DictionaryValue* source_dict;
- int source_id;
- int source_type;
+ base::DictionaryValue* dict = NULL;
+ base::DictionaryValue* source_dict = NULL;
+ int source_id = -1;
+ int source_type = NetLog::SOURCE_COUNT;
if (!event_params ||
!event_params->GetAsDictionary(&dict) ||
!dict->GetDictionary("source_dependency", &source_dict) ||
@@ -114,7 +114,7 @@ bool NetLog::Source::FromEventParameters(base::Value* event_params,
return false;
}
- DCHECK_LE(0, source_id);
+ DCHECK_GE(source_id, 0);
DCHECK_LT(source_type, NetLog::SOURCE_COUNT);
*source = Source(static_cast<SourceType>(source_type), source_id);
return true;
« no previous file with comments | « net/base/dns_util_unittest.cc ('k') | net/cert/test_root_certs_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698