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; |
} |