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

Unified Diff: chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.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: Nevermind. Can't be done. 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/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc
diff --git a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc
index 57ea926b534a50ad185d4017f5595fa1b1df24a7..00079311513585f3f5b83f565bfc10e7d521bc86 100644
--- a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc
+++ b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc
@@ -19,17 +19,17 @@ namespace picasa {
namespace {
+// Arbitrarily chosen to be a decent size but not block thread too much.
+const int kPicasaINIReadBatchSize = 10;
+
+} // namespace
+
// Picasa INI files are named "picasa.ini" on Picasa for Windows before version
// 71.18. Later versions and Picasa for Mac uses ".picasa.ini".
// See: https://support.google.com/picasa/answer/11257?hl=en
const char kPicasaINIFilename[] = ".picasa.ini";
const char kPicasaINIFilenameLegacy[] = "picasa.ini";
-// Arbitrarily chosen to be a decent size but not block thread too much.
-const int kPicasaINIReadBatchSize = 10;
-
-} // namespace
-
SafePicasaAlbumsIndexer::SafePicasaAlbumsIndexer(
const AlbumMap& albums,
const AlbumMap& folders,
@@ -114,7 +114,7 @@ void SafePicasaAlbumsIndexer::OnIndexPicasaAlbumsContentsFinished(
MediaFileSystemBackend::MediaTaskRunner()->PostTask(
FROM_HERE,
- base::Bind(callback_, true, albums_images));
+ base::Bind(callback_, make_scoped_refptr(this), true, albums_images));
parser_state_ = FINISHED_PARSING_STATE;
}
@@ -123,7 +123,7 @@ void SafePicasaAlbumsIndexer::OnProcessCrashed(int exit_code) {
MediaFileSystemBackend::MediaTaskRunner()->PostTask(
FROM_HERE,
- base::Bind(callback_, false, AlbumImagesMap()));
+ base::Bind(callback_, make_scoped_refptr(this), false, AlbumImagesMap()));
}
bool SafePicasaAlbumsIndexer::OnMessageReceived(

Powered by Google App Engine
This is Rietveld 408576698