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

Unified Diff: chrome/utility/media_galleries/picasa_album_table_reader.cc

Issue 18986012: Media Galleries API Picasa: Make PicasaDataProvider handle async PMP and INI parsing robustly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0039-picasa-import-sandbox-ini-parsing
Patch Set: Created 7 years, 4 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
Index: chrome/utility/media_galleries/picasa_album_table_reader.cc
diff --git a/chrome/utility/media_galleries/picasa_album_table_reader.cc b/chrome/utility/media_galleries/picasa_album_table_reader.cc
index ac5fc67cbe50614ab5ebb4828265185ea8c072dd..d6e2cc3667a562575836a2723dbbef684ec2bf31 100644
--- a/chrome/utility/media_galleries/picasa_album_table_reader.cc
+++ b/chrome/utility/media_galleries/picasa_album_table_reader.cc
@@ -89,31 +89,23 @@ bool PicasaAlbumTableReader::Init() {
base::Time timestamp = TimeFromMicrosoftVariantTime(date);
- switch (category) {
- case kAlbumCategoryAlbum: {
- std::string token;
- if (!token_column.ReadString(i, &token) || token.empty() ||
- !StartsWithASCII(token, kAlbumTokenPrefix, false)) {
- continue;
- }
-
- albums_.push_back(AlbumInfo(name, timestamp, uid, base::FilePath()));
- break;
+ if (category == kAlbumCategoryAlbum) {
+ std::string token;
+ if (!token_column.ReadString(i, &token) || token.empty() ||
+ !StartsWithASCII(token, kAlbumTokenPrefix, false)) {
+ continue;
}
- case kAlbumCategoryFolder: {
- std::string filename;
- if (!filename_column.ReadString(i, &filename) || filename.empty())
- continue;
- base::FilePath path =
- base::FilePath(base::FilePath::FromUTF8Unsafe(filename));
+ albums_.push_back(AlbumInfo(name, timestamp, uid, base::FilePath()));
+ } else if (category == kAlbumCategoryFolder) {
+ std::string filename;
+ if (!filename_column.ReadString(i, &filename) || filename.empty())
+ continue;
- folders_.push_back(AlbumInfo(name, timestamp, uid, path));
- break;
- }
- default: {
- break;
- }
+ base::FilePath path =
+ base::FilePath(base::FilePath::FromUTF8Unsafe(filename));
+
+ folders_.push_back(AlbumInfo(name, timestamp, uid, path));
}
}

Powered by Google App Engine
This is Rietveld 408576698