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

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: Add invalidate call. Created 7 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
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 89db518f6e3624b34d38833fbfd1bada22ac78f1..68516c39be12dd2f5fb29fac034f1870f7c995ae 100644
--- a/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc
+++ b/chrome/browser/media_galleries/fileapi/safe_picasa_albums_indexer.cc
@@ -9,7 +9,6 @@
#include "chrome/common/chrome_utility_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
-#include "content/public/browser/utility_process_host.h"
using chrome::MediaFileSystemBackend;
using content::BrowserThread;
@@ -100,11 +99,14 @@ void SafePicasaAlbumsIndexer::StartWorkOnIOThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_EQ(FINISHED_READING_INI_FILES_STATE, parser_state_);
- UtilityProcessHost* host =
- UtilityProcessHost::Create(this, base::MessageLoopProxy::current());
- host->EnableZygote();
- host->Send(new ChromeUtilityMsg_IndexPicasaAlbumsContents(album_uids_,
- folders_inis_));
+ utility_process_host_ = content::UtilityProcessHost::Create(
+ this,
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get())
+ ->AsWeakPtr();
+
+ utility_process_host_->EnableZygote();
+ utility_process_host_->Send(new ChromeUtilityMsg_IndexPicasaAlbumsContents(
+ album_uids_, folders_inis_));
parser_state_ = STARTED_PARSING_STATE;
}
@@ -116,7 +118,9 @@ void SafePicasaAlbumsIndexer::OnIndexPicasaAlbumsContentsFinished(
MediaFileSystemBackend::MediaTaskRunner()->PostTask(
FROM_HERE,
- base::Bind(callback_, albums_images));
+ base::Bind(callback_,
+ scoped_refptr<SafePicasaAlbumsIndexer>(this),
+ albums_images));
parser_state_ = FINISHED_PARSING_STATE;
}

Powered by Google App Engine
This is Rietveld 408576698