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

Unified Diff: net/ftp/ftp_util.cc

Issue 13743004: FTP: Make ICU resource loading fail loadly (CHECK) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_util.cc
===================================================================
--- net/ftp/ftp_util.cc (revision 192575)
+++ net/ftp/ftp_util.cc (working copy)
@@ -187,6 +187,24 @@
map_[month_name.substr(0, 3)] = month + 1;
}
}
+
+ // Fail loudly if the data returned by ICU is obviously incomplete.
+ // This is intended to catch cases like http://crbug.com/177428
+ // much earlier. Note that the issue above turned out to be non-trivial
+ // to reproduce - crash data is much better indicator of a problem
+ // than incomplete bug reports.
+ CHECK_EQ( 1, map_[ASCIIToUTF16("jan")]);
ericroman 2013/04/06 01:31:41 nit: I recommend removing the whitespace on these
Paweł Hajdan Jr. 2013/04/08 18:22:29 Done.
+ CHECK_EQ( 2, map_[ASCIIToUTF16("feb")]);
+ CHECK_EQ( 3, map_[ASCIIToUTF16("mar")]);
+ CHECK_EQ( 4, map_[ASCIIToUTF16("apr")]);
+ CHECK_EQ( 5, map_[ASCIIToUTF16("may")]);
+ CHECK_EQ( 6, map_[ASCIIToUTF16("jun")]);
+ CHECK_EQ( 7, map_[ASCIIToUTF16("jul")]);
+ CHECK_EQ( 8, map_[ASCIIToUTF16("aug")]);
+ CHECK_EQ( 9, map_[ASCIIToUTF16("sep")]);
+ CHECK_EQ(10, map_[ASCIIToUTF16("oct")]);
+ CHECK_EQ(11, map_[ASCIIToUTF16("nov")]);
+ CHECK_EQ(12, map_[ASCIIToUTF16("dec")]);
}
// Maps lowercase month names to numbers in range 1-12.
« 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